pollcatch 2.3.0 → 2.3.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/package.json +2 -2
- package/pc.js +435 -337
package/pc.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const yt = globalThis,
|
|
6
|
+
const yt = globalThis, qt = yt.ShadowRoot && (yt.ShadyCSS === void 0 || yt.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ht = Symbol(), Jt = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
let $e = class {
|
|
8
8
|
constructor(t, o, r) {
|
|
9
|
-
if (this._$cssResult$ = !0, r !==
|
|
9
|
+
if (this._$cssResult$ = !0, r !== Ht) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
10
10
|
this.cssText = t, this.t = o;
|
|
11
11
|
}
|
|
12
12
|
get styleSheet() {
|
|
13
13
|
let t = this.o;
|
|
14
14
|
const o = this.t;
|
|
15
|
-
if (
|
|
15
|
+
if (qt && t === void 0) {
|
|
16
16
|
const r = o !== void 0 && o.length === 1;
|
|
17
|
-
r && (t =
|
|
17
|
+
r && (t = Jt.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Jt.set(o, t));
|
|
18
18
|
}
|
|
19
19
|
return t;
|
|
20
20
|
}
|
|
@@ -22,30 +22,30 @@ let $e = class {
|
|
|
22
22
|
return this.cssText;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const
|
|
25
|
+
const Ue = (e) => new $e(typeof e == "string" ? e : e + "", void 0, Ht), R = (e, ...t) => {
|
|
26
26
|
const o = e.length === 1 ? e[0] : t.reduce((r, s, i) => r + ((a) => {
|
|
27
27
|
if (a._$cssResult$ === !0) return a.cssText;
|
|
28
28
|
if (typeof a == "number") return a;
|
|
29
29
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + a + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
30
30
|
})(s) + e[i + 1], e[0]);
|
|
31
|
-
return new $e(o, e,
|
|
32
|
-
},
|
|
33
|
-
if (
|
|
31
|
+
return new $e(o, e, Ht);
|
|
32
|
+
}, qe = (e, t) => {
|
|
33
|
+
if (qt) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
|
|
34
34
|
else for (const o of t) {
|
|
35
35
|
const r = document.createElement("style"), s = yt.litNonce;
|
|
36
36
|
s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
38
|
+
}, Qt = qt ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
|
|
39
39
|
let o = "";
|
|
40
40
|
for (const r of t.cssRules) o += r.cssText;
|
|
41
|
-
return
|
|
41
|
+
return Ue(o);
|
|
42
42
|
})(e) : e;
|
|
43
43
|
/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2017 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
47
|
*/
|
|
48
|
-
const { is:
|
|
48
|
+
const { is: He, defineProperty: Fe, getOwnPropertyDescriptor: Ye, getOwnPropertyNames: Ke, getOwnPropertySymbols: Ge, getPrototypeOf: Ze } = Object, V = globalThis, te = V.trustedTypes, We = te ? te.emptyScript : "", Ot = V.reactiveElementPolyfillSupport, nt = (e, t) => e, wt = { toAttribute(e, t) {
|
|
49
49
|
switch (t) {
|
|
50
50
|
case Boolean:
|
|
51
51
|
e = e ? We : null;
|
|
@@ -73,7 +73,7 @@ const { is: qe, defineProperty: He, getOwnPropertyDescriptor: Fe, getOwnProperty
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return o;
|
|
76
|
-
} },
|
|
76
|
+
} }, Ft = (e, t) => !He(e, t), ee = { attribute: !0, type: String, converter: wt, reflect: !1, hasChanged: Ft };
|
|
77
77
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), V.litPropertyMetadata ?? (V.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
78
78
|
let Q = class extends HTMLElement {
|
|
79
79
|
static addInitializer(t) {
|
|
@@ -82,14 +82,14 @@ let Q = class extends HTMLElement {
|
|
|
82
82
|
static get observedAttributes() {
|
|
83
83
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
84
84
|
}
|
|
85
|
-
static createProperty(t, o =
|
|
85
|
+
static createProperty(t, o = ee) {
|
|
86
86
|
if (o.state && (o.attribute = !1), this._$Ei(), this.elementProperties.set(t, o), !o.noAccessor) {
|
|
87
87
|
const r = Symbol(), s = this.getPropertyDescriptor(t, r, o);
|
|
88
|
-
s !== void 0 &&
|
|
88
|
+
s !== void 0 && Fe(this.prototype, t, s);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
static getPropertyDescriptor(t, o, r) {
|
|
92
|
-
const { get: s, set: i } =
|
|
92
|
+
const { get: s, set: i } = Ye(this.prototype, t) ?? { get() {
|
|
93
93
|
return this[o];
|
|
94
94
|
}, set(a) {
|
|
95
95
|
this[o] = a;
|
|
@@ -102,17 +102,17 @@ let Q = class extends HTMLElement {
|
|
|
102
102
|
}, configurable: !0, enumerable: !0 };
|
|
103
103
|
}
|
|
104
104
|
static getPropertyOptions(t) {
|
|
105
|
-
return this.elementProperties.get(t) ??
|
|
105
|
+
return this.elementProperties.get(t) ?? ee;
|
|
106
106
|
}
|
|
107
107
|
static _$Ei() {
|
|
108
108
|
if (this.hasOwnProperty(nt("elementProperties"))) return;
|
|
109
|
-
const t =
|
|
109
|
+
const t = Ze(this);
|
|
110
110
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
111
111
|
}
|
|
112
112
|
static finalize() {
|
|
113
113
|
if (this.hasOwnProperty(nt("finalized"))) return;
|
|
114
114
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(nt("properties"))) {
|
|
115
|
-
const o = this.properties, r = [...
|
|
115
|
+
const o = this.properties, r = [...Ke(o), ...Ge(o)];
|
|
116
116
|
for (const s of r) this.createProperty(s, o[s]);
|
|
117
117
|
}
|
|
118
118
|
const t = this[Symbol.metadata];
|
|
@@ -131,8 +131,8 @@ let Q = class extends HTMLElement {
|
|
|
131
131
|
const o = [];
|
|
132
132
|
if (Array.isArray(t)) {
|
|
133
133
|
const r = new Set(t.flat(1 / 0).reverse());
|
|
134
|
-
for (const s of r) o.unshift(
|
|
135
|
-
} else t !== void 0 && o.push(
|
|
134
|
+
for (const s of r) o.unshift(Qt(s));
|
|
135
|
+
} else t !== void 0 && o.push(Qt(t));
|
|
136
136
|
return o;
|
|
137
137
|
}
|
|
138
138
|
static _$Eu(t, o) {
|
|
@@ -161,7 +161,7 @@ let Q = class extends HTMLElement {
|
|
|
161
161
|
}
|
|
162
162
|
createRenderRoot() {
|
|
163
163
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
164
|
-
return
|
|
164
|
+
return qe(t, this.constructor.elementStyles), t;
|
|
165
165
|
}
|
|
166
166
|
connectedCallback() {
|
|
167
167
|
var t;
|
|
@@ -186,7 +186,7 @@ let Q = class extends HTMLElement {
|
|
|
186
186
|
var i;
|
|
187
187
|
const r = this.constructor.elementProperties.get(t), s = this.constructor._$Eu(t, r);
|
|
188
188
|
if (s !== void 0 && r.reflect === !0) {
|
|
189
|
-
const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter :
|
|
189
|
+
const a = (((i = r.converter) == null ? void 0 : i.toAttribute) !== void 0 ? r.converter : wt).toAttribute(o, r.type);
|
|
190
190
|
this._$Em = t, a == null ? this.removeAttribute(s) : this.setAttribute(s, a), this._$Em = null;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
@@ -194,13 +194,13 @@ let Q = class extends HTMLElement {
|
|
|
194
194
|
var i;
|
|
195
195
|
const r = this.constructor, s = r._$Eh.get(t);
|
|
196
196
|
if (s !== void 0 && this._$Em !== s) {
|
|
197
|
-
const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter :
|
|
197
|
+
const a = r.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((i = a.converter) == null ? void 0 : i.fromAttribute) !== void 0 ? a.converter : wt;
|
|
198
198
|
this._$Em = s, this[s] = l.fromAttribute(o, a.type), this._$Em = null;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
requestUpdate(t, o, r) {
|
|
202
202
|
if (t !== void 0) {
|
|
203
|
-
if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ??
|
|
203
|
+
if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Ft)(this[t], o)) return;
|
|
204
204
|
this.P(t, o, r);
|
|
205
205
|
}
|
|
206
206
|
this.isUpdatePending === !1 && (this._$ES = this._$ET());
|
|
@@ -273,56 +273,56 @@ let Q = class extends HTMLElement {
|
|
|
273
273
|
firstUpdated(t) {
|
|
274
274
|
}
|
|
275
275
|
};
|
|
276
|
-
Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[nt("elementProperties")] = /* @__PURE__ */ new Map(), Q[nt("finalized")] = /* @__PURE__ */ new Map(),
|
|
276
|
+
Q.elementStyles = [], Q.shadowRootOptions = { mode: "open" }, Q[nt("elementProperties")] = /* @__PURE__ */ new Map(), Q[nt("finalized")] = /* @__PURE__ */ new Map(), Ot == null || Ot({ ReactiveElement: Q }), (V.reactiveElementVersions ?? (V.reactiveElementVersions = [])).push("2.0.4");
|
|
277
277
|
/**
|
|
278
278
|
* @license
|
|
279
279
|
* Copyright 2017 Google LLC
|
|
280
280
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
281
281
|
*/
|
|
282
|
-
const lt = globalThis,
|
|
283
|
-
\f\r]`, it = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
284
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
return
|
|
282
|
+
const lt = globalThis, $t = lt.trustedTypes, oe = $t ? $t.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Se = "$lit$", B = `lit$${Math.random().toFixed(9).slice(2)}$`, Ce = "?" + B, Xe = `<${Ce}>`, G = document, dt = () => G.createComment(""), pt = (e) => e === null || typeof e != "object" && typeof e != "function", Yt = Array.isArray, Je = (e) => Yt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", It = `[
|
|
283
|
+
\f\r]`, it = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, re = /-->/g, se = />/g, Y = RegExp(`>|${It}(?:([^\\s"'>=/]+)(${It}*=${It}*(?:[^
|
|
284
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ie = /'/g, ae = /"/g, ke = /^(?:script|style|textarea|title)$/i, Qe = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = Qe(1), U = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ne = /* @__PURE__ */ new WeakMap(), K = G.createTreeWalker(G, 129);
|
|
285
|
+
function Ee(e, t) {
|
|
286
|
+
if (!Yt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
287
|
+
return oe !== void 0 ? oe.createHTML(t) : t;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
289
|
+
const to = (e, t) => {
|
|
290
290
|
const o = e.length - 1, r = [];
|
|
291
291
|
let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = it;
|
|
292
292
|
for (let l = 0; l < o; l++) {
|
|
293
293
|
const n = e[l];
|
|
294
294
|
let d, p, h = -1, b = 0;
|
|
295
|
-
for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === it ? p[1] === "!--" ? a =
|
|
295
|
+
for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === it ? p[1] === "!--" ? a = re : p[1] !== void 0 ? a = se : p[2] !== void 0 ? (ke.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = Y) : p[3] !== void 0 && (a = Y) : a === Y ? p[0] === ">" ? (a = s ?? it, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? Y : p[3] === '"' ? ae : ie) : a === ae || a === ie ? a = Y : a === re || a === se ? a = it : (a = Y, s = void 0);
|
|
296
296
|
const x = a === Y && e[l + 1].startsWith("/>") ? " " : "";
|
|
297
|
-
i += a === it ? n +
|
|
297
|
+
i += a === it ? n + Xe : h >= 0 ? (r.push(d), n.slice(0, h) + Se + n.slice(h) + B + x) : n + B + (h === -2 ? l : x);
|
|
298
298
|
}
|
|
299
|
-
return [
|
|
299
|
+
return [Ee(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
|
|
300
300
|
};
|
|
301
|
-
let
|
|
301
|
+
let Ut = class Ae {
|
|
302
302
|
constructor({ strings: t, _$litType$: o }, r) {
|
|
303
303
|
let s;
|
|
304
304
|
this.parts = [];
|
|
305
305
|
let i = 0, a = 0;
|
|
306
|
-
const l = t.length - 1, n = this.parts, [d, p] =
|
|
307
|
-
if (this.el =
|
|
306
|
+
const l = t.length - 1, n = this.parts, [d, p] = to(t, o);
|
|
307
|
+
if (this.el = Ae.createElement(d, r), K.currentNode = this.el.content, o === 2 || o === 3) {
|
|
308
308
|
const h = this.el.content.firstChild;
|
|
309
309
|
h.replaceWith(...h.childNodes);
|
|
310
310
|
}
|
|
311
311
|
for (; (s = K.nextNode()) !== null && n.length < l; ) {
|
|
312
312
|
if (s.nodeType === 1) {
|
|
313
|
-
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(
|
|
313
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Se)) {
|
|
314
314
|
const b = p[a++], x = s.getAttribute(h).split(B), E = /([.?@])?(.*)/.exec(b);
|
|
315
|
-
n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ?
|
|
315
|
+
n.push({ type: 1, index: i, name: E[2], strings: x, ctor: E[1] === "." ? oo : E[1] === "?" ? ro : E[1] === "@" ? so : Et }), s.removeAttribute(h);
|
|
316
316
|
} else h.startsWith(B) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
|
|
317
|
-
if (
|
|
317
|
+
if (ke.test(s.tagName)) {
|
|
318
318
|
const h = s.textContent.split(B), b = h.length - 1;
|
|
319
319
|
if (b > 0) {
|
|
320
|
-
s.textContent =
|
|
320
|
+
s.textContent = $t ? $t.emptyScript : "";
|
|
321
321
|
for (let x = 0; x < b; x++) s.append(h[x], dt()), K.nextNode(), n.push({ type: 2, index: ++i });
|
|
322
322
|
s.append(h[b], dt());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
325
|
+
} else if (s.nodeType === 8) if (s.data === Ce) n.push({ type: 2, index: i });
|
|
326
326
|
else {
|
|
327
327
|
let h = -1;
|
|
328
328
|
for (; (h = s.data.indexOf(B, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += B.length - 1;
|
|
@@ -342,7 +342,7 @@ function et(e, t, o = e, r) {
|
|
|
342
342
|
const i = pt(t) ? void 0 : t._$litDirective$;
|
|
343
343
|
return (s == null ? void 0 : s.constructor) !== i && ((l = s == null ? void 0 : s._$AO) == null || l.call(s, !1), i === void 0 ? s = void 0 : (s = new i(e), s._$AT(e, o, r)), r !== void 0 ? (o._$Co ?? (o._$Co = []))[r] = s : o._$Cl = s), s !== void 0 && (t = et(e, s._$AS(e, t.values), s, r)), t;
|
|
344
344
|
}
|
|
345
|
-
let
|
|
345
|
+
let eo = class {
|
|
346
346
|
constructor(t, o) {
|
|
347
347
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = o;
|
|
348
348
|
}
|
|
@@ -359,7 +359,7 @@ let to = class {
|
|
|
359
359
|
for (; n !== void 0; ) {
|
|
360
360
|
if (a === n.index) {
|
|
361
361
|
let d;
|
|
362
|
-
n.type === 2 ? d = new ut(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new
|
|
362
|
+
n.type === 2 ? d = new ut(i, i.nextSibling, this, t) : n.type === 1 ? d = new n.ctor(i, n.name, n.strings, this, t) : n.type === 6 && (d = new io(i, this, t)), this._$AV.push(d), n = r[++l];
|
|
363
363
|
}
|
|
364
364
|
a !== (n == null ? void 0 : n.index) && (i = K.nextNode(), a++);
|
|
365
365
|
}
|
|
@@ -390,7 +390,7 @@ class ut {
|
|
|
390
390
|
return this._$AB;
|
|
391
391
|
}
|
|
392
392
|
_$AI(t, o = this) {
|
|
393
|
-
t = et(this, t, o), pt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) :
|
|
393
|
+
t = et(this, t, o), pt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== U && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Je(t) ? this.k(t) : this._(t);
|
|
394
394
|
}
|
|
395
395
|
O(t) {
|
|
396
396
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -403,19 +403,19 @@ class ut {
|
|
|
403
403
|
}
|
|
404
404
|
$(t) {
|
|
405
405
|
var i;
|
|
406
|
-
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el =
|
|
406
|
+
const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = Ut.createElement(Ee(r.h, r.h[0]), this.options)), r);
|
|
407
407
|
if (((i = this._$AH) == null ? void 0 : i._$AD) === s) this._$AH.p(o);
|
|
408
408
|
else {
|
|
409
|
-
const a = new
|
|
409
|
+
const a = new eo(s, this), l = a.u(this.options);
|
|
410
410
|
a.p(o), this.T(l), this._$AH = a;
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
_$AC(t) {
|
|
414
|
-
let o =
|
|
415
|
-
return o === void 0 &&
|
|
414
|
+
let o = ne.get(t.strings);
|
|
415
|
+
return o === void 0 && ne.set(t.strings, o = new Ut(t)), o;
|
|
416
416
|
}
|
|
417
417
|
k(t) {
|
|
418
|
-
|
|
418
|
+
Yt(this._$AH) || (this._$AH = [], this._$AR());
|
|
419
419
|
const o = this._$AH;
|
|
420
420
|
let r, s = 0;
|
|
421
421
|
for (const i of t) s === o.length ? o.push(r = new ut(this.O(dt()), this.O(dt()), this, this.options)) : r = o[s], r._$AI(i), s++;
|
|
@@ -433,7 +433,7 @@ class ut {
|
|
|
433
433
|
this._$AM === void 0 && (this._$Cv = t, (o = this._$AP) == null || o.call(this, t));
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class Et {
|
|
437
437
|
get tagName() {
|
|
438
438
|
return this.element.tagName;
|
|
439
439
|
}
|
|
@@ -458,7 +458,7 @@ class kt {
|
|
|
458
458
|
t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
let
|
|
461
|
+
let oo = class extends Et {
|
|
462
462
|
constructor() {
|
|
463
463
|
super(...arguments), this.type = 3;
|
|
464
464
|
}
|
|
@@ -466,7 +466,7 @@ let eo = class extends kt {
|
|
|
466
466
|
this.element[this.name] = t === u ? void 0 : t;
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
class
|
|
469
|
+
class ro extends Et {
|
|
470
470
|
constructor() {
|
|
471
471
|
super(...arguments), this.type = 4;
|
|
472
472
|
}
|
|
@@ -474,7 +474,7 @@ class oo extends kt {
|
|
|
474
474
|
this.element.toggleAttribute(this.name, !!t && t !== u);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
class
|
|
477
|
+
class so extends Et {
|
|
478
478
|
constructor(t, o, r, s, i) {
|
|
479
479
|
super(t, o, r, s, i), this.type = 5;
|
|
480
480
|
}
|
|
@@ -488,7 +488,7 @@ class ro extends kt {
|
|
|
488
488
|
typeof this._$AH == "function" ? this._$AH.call(((o = this.options) == null ? void 0 : o.host) ?? this.element, t) : this._$AH.handleEvent(t);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
class
|
|
491
|
+
class io {
|
|
492
492
|
constructor(t, o, r) {
|
|
493
493
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = o, this.options = r;
|
|
494
494
|
}
|
|
@@ -499,9 +499,9 @@ class so {
|
|
|
499
499
|
et(this, t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
const
|
|
502
|
+
const zt = lt.litHtmlPolyfillSupport;
|
|
503
|
+
zt == null || zt(Ut, ut), (lt.litHtmlVersions ?? (lt.litHtmlVersions = [])).push("3.2.1");
|
|
504
|
+
const ao = (e, t, o) => {
|
|
505
505
|
const r = (o == null ? void 0 : o.renderBefore) ?? t;
|
|
506
506
|
let s = r._$litPart$;
|
|
507
507
|
if (s === void 0) {
|
|
@@ -526,7 +526,7 @@ let N = class extends Q {
|
|
|
526
526
|
}
|
|
527
527
|
update(t) {
|
|
528
528
|
const o = this.render();
|
|
529
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
529
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = ao(o, this.renderRoot, this.renderOptions);
|
|
530
530
|
}
|
|
531
531
|
connectedCallback() {
|
|
532
532
|
var t;
|
|
@@ -540,10 +540,10 @@ let N = class extends Q {
|
|
|
540
540
|
return U;
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
|
-
var
|
|
544
|
-
N._$litElement$ = !0, N.finalized = !0, (
|
|
545
|
-
const
|
|
546
|
-
|
|
543
|
+
var we;
|
|
544
|
+
N._$litElement$ = !0, N.finalized = !0, (we = globalThis.litElementHydrateSupport) == null || we.call(globalThis, { LitElement: N });
|
|
545
|
+
const Mt = globalThis.litElementPolyfillSupport;
|
|
546
|
+
Mt == null || Mt({ LitElement: N });
|
|
547
547
|
(globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
|
|
548
548
|
/**
|
|
549
549
|
* @license
|
|
@@ -560,7 +560,7 @@ const H = (e) => (t, o) => {
|
|
|
560
560
|
* Copyright 2017 Google LLC
|
|
561
561
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
562
562
|
*/
|
|
563
|
-
const
|
|
563
|
+
const no = { attribute: !0, type: String, converter: wt, reflect: !1, hasChanged: Ft }, lo = (e = no, t, o) => {
|
|
564
564
|
const { kind: r, metadata: s } = o;
|
|
565
565
|
let i = globalThis.litPropertyMetadata.get(s);
|
|
566
566
|
if (i === void 0 && globalThis.litPropertyMetadata.set(s, i = /* @__PURE__ */ new Map()), i.set(o.name, e), r === "accessor") {
|
|
@@ -582,7 +582,7 @@ const ao = { attribute: !0, type: String, converter: $t, reflect: !1, hasChanged
|
|
|
582
582
|
throw Error("Unsupported decorator location: " + r);
|
|
583
583
|
};
|
|
584
584
|
function f(e) {
|
|
585
|
-
return (t, o) => typeof o == "object" ?
|
|
585
|
+
return (t, o) => typeof o == "object" ? lo(e, t, o) : ((r, s, i) => {
|
|
586
586
|
const a = s.hasOwnProperty(i);
|
|
587
587
|
return s.constructor.createProperty(i, a ? { ...r, wrapped: !0 } : r), a ? Object.getOwnPropertyDescriptor(s, i) : void 0;
|
|
588
588
|
})(e, t, o);
|
|
@@ -600,7 +600,7 @@ function k(e) {
|
|
|
600
600
|
* Copyright 2017 Google LLC
|
|
601
601
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
602
602
|
*/
|
|
603
|
-
const
|
|
603
|
+
const co = (e, t, o) => (o.configurable = !0, o.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(e, t, o), o);
|
|
604
604
|
/**
|
|
605
605
|
* @license
|
|
606
606
|
* Copyright 2017 Google LLC
|
|
@@ -612,13 +612,13 @@ function ht(e, t) {
|
|
|
612
612
|
var l;
|
|
613
613
|
return ((l = a.renderRoot) == null ? void 0 : l.querySelector(e)) ?? null;
|
|
614
614
|
};
|
|
615
|
-
return
|
|
615
|
+
return co(o, r, { get() {
|
|
616
616
|
return i(this);
|
|
617
617
|
} });
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
620
|
var S = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(S || {});
|
|
621
|
-
const
|
|
621
|
+
const Kt = c`
|
|
622
622
|
<svg
|
|
623
623
|
xmlns="http://www.w3.org/2000/svg"
|
|
624
624
|
height="24px"
|
|
@@ -628,7 +628,7 @@ const Yt = c`
|
|
|
628
628
|
>
|
|
629
629
|
<path d="M640-160v-280h160v280H640Zm-240 0v-640h160v640H400Zm-240 0v-440h160v440H160Z" />
|
|
630
630
|
</svg>
|
|
631
|
-
`,
|
|
631
|
+
`, Gt = c`
|
|
632
632
|
<svg
|
|
633
633
|
xmlns="http://www.w3.org/2000/svg"
|
|
634
634
|
height="24px"
|
|
@@ -640,7 +640,7 @@ const Yt = c`
|
|
|
640
640
|
d="M160-160v-440h160v440H160Zm240 0v-400l160 160v240H400Zm160-354L400-674v-126h160v286Zm240 240L640-434v-6h160v166Zm-9 219L55-791l57-57 736 736-57 57Z"
|
|
641
641
|
/>
|
|
642
642
|
</svg>
|
|
643
|
-
`,
|
|
643
|
+
`, St = c`
|
|
644
644
|
<svg
|
|
645
645
|
xmlns="http://www.w3.org/2000/svg"
|
|
646
646
|
height="24px"
|
|
@@ -652,7 +652,7 @@ const Yt = c`
|
|
|
652
652
|
d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"
|
|
653
653
|
/>
|
|
654
654
|
</svg>
|
|
655
|
-
`,
|
|
655
|
+
`, po = c`
|
|
656
656
|
<svg
|
|
657
657
|
xmlns="http://www.w3.org/2000/svg"
|
|
658
658
|
width="16"
|
|
@@ -664,157 +664,167 @@ const Yt = c`
|
|
|
664
664
|
d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708"
|
|
665
665
|
/>
|
|
666
666
|
</svg>
|
|
667
|
+
`, Pe = c`
|
|
668
|
+
<svg
|
|
669
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
670
|
+
height="24px"
|
|
671
|
+
viewBox="0 -960 960 960"
|
|
672
|
+
width="24px"
|
|
673
|
+
fill="currentColor"
|
|
674
|
+
>
|
|
675
|
+
<path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
|
|
676
|
+
</svg>
|
|
667
677
|
`;
|
|
668
|
-
var
|
|
678
|
+
var uo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, z = function(e) {
|
|
669
679
|
return typeof e == "string" ? e.length > 0 : typeof e == "number";
|
|
670
|
-
},
|
|
680
|
+
}, $ = function(e, t, o) {
|
|
671
681
|
return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
|
|
672
682
|
}, A = function(e, t, o) {
|
|
673
683
|
return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
|
|
674
|
-
},
|
|
684
|
+
}, Te = function(e) {
|
|
675
685
|
return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
|
|
676
|
-
},
|
|
686
|
+
}, le = function(e) {
|
|
677
687
|
return { r: A(e.r, 0, 255), g: A(e.g, 0, 255), b: A(e.b, 0, 255), a: A(e.a) };
|
|
678
|
-
},
|
|
679
|
-
return { r:
|
|
680
|
-
},
|
|
688
|
+
}, Lt = function(e) {
|
|
689
|
+
return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
|
|
690
|
+
}, ho = /^#([0-9a-f]{3,8})$/i, vt = function(e) {
|
|
681
691
|
var t = e.toString(16);
|
|
682
692
|
return t.length < 2 ? "0" + t : t;
|
|
683
|
-
},
|
|
693
|
+
}, _e = function(e) {
|
|
684
694
|
var t = e.r, o = e.g, r = e.b, s = e.a, i = Math.max(t, o, r), a = i - Math.min(t, o, r), l = a ? i === t ? (o - r) / a : i === o ? 2 + (r - t) / a : 4 + (t - o) / a : 0;
|
|
685
695
|
return { h: 60 * (l < 0 ? l + 6 : l), s: i ? a / i * 100 : 0, v: i / 255 * 100, a: s };
|
|
686
|
-
},
|
|
696
|
+
}, Oe = function(e) {
|
|
687
697
|
var t = e.h, o = e.s, r = e.v, s = e.a;
|
|
688
698
|
t = t / 360 * 6, o /= 100, r /= 100;
|
|
689
699
|
var i = Math.floor(t), a = r * (1 - o), l = r * (1 - (t - i) * o), n = r * (1 - (1 - t + i) * o), d = i % 6;
|
|
690
700
|
return { r: 255 * [r, l, a, a, n, r][d], g: 255 * [n, r, r, l, a, a][d], b: 255 * [a, a, n, r, r, l][d], a: s };
|
|
691
|
-
}, le = function(e) {
|
|
692
|
-
return { h: Pe(e.h), s: A(e.s, 0, 100), l: A(e.l, 0, 100), a: A(e.a) };
|
|
693
701
|
}, ce = function(e) {
|
|
694
|
-
return { h:
|
|
702
|
+
return { h: Te(e.h), s: A(e.s, 0, 100), l: A(e.l, 0, 100), a: A(e.a) };
|
|
695
703
|
}, de = function(e) {
|
|
696
|
-
return
|
|
704
|
+
return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
|
|
705
|
+
}, pe = function(e) {
|
|
706
|
+
return Oe((o = (t = e).s, { h: t.h, s: (o *= ((r = t.l) < 50 ? r : 100 - r) / 100) > 0 ? 2 * o / (r + o) * 100 : 0, v: r + o, a: t.a }));
|
|
697
707
|
var t, o, r;
|
|
698
708
|
}, ct = function(e) {
|
|
699
|
-
return { h: (t =
|
|
709
|
+
return { h: (t = _e(e)).h, s: (s = (200 - (o = t.s)) * (r = t.v) / 100) > 0 && s < 200 ? o * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0, l: s / 2, a: t.a };
|
|
700
710
|
var t, o, r, s;
|
|
701
|
-
},
|
|
702
|
-
var t =
|
|
703
|
-
return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ?
|
|
711
|
+
}, fo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, go = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, mo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, vo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ue = { string: [[function(e) {
|
|
712
|
+
var t = ho.exec(e);
|
|
713
|
+
return t ? (e = t[1]).length <= 4 ? { r: parseInt(e[0] + e[0], 16), g: parseInt(e[1] + e[1], 16), b: parseInt(e[2] + e[2], 16), a: e.length === 4 ? $(parseInt(e[3] + e[3], 16) / 255, 2) : 1 } : e.length === 6 || e.length === 8 ? { r: parseInt(e.substr(0, 2), 16), g: parseInt(e.substr(2, 2), 16), b: parseInt(e.substr(4, 2), 16), a: e.length === 8 ? $(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
|
|
704
714
|
}, "hex"], [function(e) {
|
|
705
|
-
var t =
|
|
706
|
-
return t ? t[2] !== t[4] || t[4] !== t[6] ? null :
|
|
715
|
+
var t = mo.exec(e) || vo.exec(e);
|
|
716
|
+
return t ? t[2] !== t[4] || t[4] !== t[6] ? null : le({ r: Number(t[1]) / (t[2] ? 100 / 255 : 1), g: Number(t[3]) / (t[4] ? 100 / 255 : 1), b: Number(t[5]) / (t[6] ? 100 / 255 : 1), a: t[7] === void 0 ? 1 : Number(t[7]) / (t[8] ? 100 : 1) }) : null;
|
|
707
717
|
}, "rgb"], [function(e) {
|
|
708
|
-
var t =
|
|
718
|
+
var t = fo.exec(e) || go.exec(e);
|
|
709
719
|
if (!t) return null;
|
|
710
|
-
var o, r, s =
|
|
711
|
-
return
|
|
720
|
+
var o, r, s = ce({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (uo[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
|
|
721
|
+
return pe(s);
|
|
712
722
|
}, "hsl"]], object: [[function(e) {
|
|
713
723
|
var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
|
|
714
|
-
return z(t) && z(o) && z(r) ?
|
|
724
|
+
return z(t) && z(o) && z(r) ? le({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
|
|
715
725
|
}, "rgb"], [function(e) {
|
|
716
726
|
var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
|
|
717
727
|
if (!z(t) || !z(o) || !z(r)) return null;
|
|
718
|
-
var a =
|
|
719
|
-
return
|
|
728
|
+
var a = ce({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
|
|
729
|
+
return pe(a);
|
|
720
730
|
}, "hsl"], [function(e) {
|
|
721
731
|
var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
|
|
722
732
|
if (!z(t) || !z(o) || !z(r)) return null;
|
|
723
733
|
var a = function(l) {
|
|
724
|
-
return { h:
|
|
734
|
+
return { h: Te(l.h), s: A(l.s, 0, 100), v: A(l.v, 0, 100), a: A(l.a) };
|
|
725
735
|
}({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
|
|
726
|
-
return
|
|
727
|
-
}, "hsv"]] },
|
|
736
|
+
return Oe(a);
|
|
737
|
+
}, "hsv"]] }, he = function(e, t) {
|
|
728
738
|
for (var o = 0; o < t.length; o++) {
|
|
729
739
|
var r = t[o][0](e);
|
|
730
740
|
if (r) return [r, t[o][1]];
|
|
731
741
|
}
|
|
732
742
|
return [null, void 0];
|
|
733
|
-
},
|
|
734
|
-
return typeof e == "string" ?
|
|
735
|
-
},
|
|
743
|
+
}, bo = function(e) {
|
|
744
|
+
return typeof e == "string" ? he(e.trim(), ue.string) : typeof e == "object" && e !== null ? he(e, ue.object) : [null, void 0];
|
|
745
|
+
}, Nt = function(e, t) {
|
|
736
746
|
var o = ct(e);
|
|
737
747
|
return { h: o.h, s: A(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
|
|
738
|
-
},
|
|
748
|
+
}, Dt = function(e) {
|
|
739
749
|
return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
|
|
740
|
-
},
|
|
750
|
+
}, fe = function(e, t) {
|
|
741
751
|
var o = ct(e);
|
|
742
752
|
return { h: o.h, s: o.s, l: A(o.l + 100 * t, 0, 100), a: o.a };
|
|
743
|
-
},
|
|
753
|
+
}, ge = function() {
|
|
744
754
|
function e(t) {
|
|
745
|
-
this.parsed =
|
|
755
|
+
this.parsed = bo(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
|
|
746
756
|
}
|
|
747
757
|
return e.prototype.isValid = function() {
|
|
748
758
|
return this.parsed !== null;
|
|
749
759
|
}, e.prototype.brightness = function() {
|
|
750
|
-
return
|
|
760
|
+
return $(Dt(this.rgba), 2);
|
|
751
761
|
}, e.prototype.isDark = function() {
|
|
752
|
-
return
|
|
762
|
+
return Dt(this.rgba) < 0.5;
|
|
753
763
|
}, e.prototype.isLight = function() {
|
|
754
|
-
return
|
|
764
|
+
return Dt(this.rgba) >= 0.5;
|
|
755
765
|
}, e.prototype.toHex = function() {
|
|
756
|
-
return t =
|
|
766
|
+
return t = Lt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? vt($(255 * i)) : "", "#" + vt(o) + vt(r) + vt(s) + a;
|
|
757
767
|
var t, o, r, s, i, a;
|
|
758
768
|
}, e.prototype.toRgb = function() {
|
|
759
|
-
return
|
|
769
|
+
return Lt(this.rgba);
|
|
760
770
|
}, e.prototype.toRgbString = function() {
|
|
761
|
-
return t =
|
|
771
|
+
return t = Lt(this.rgba), o = t.r, r = t.g, s = t.b, (i = t.a) < 1 ? "rgba(" + o + ", " + r + ", " + s + ", " + i + ")" : "rgb(" + o + ", " + r + ", " + s + ")";
|
|
762
772
|
var t, o, r, s, i;
|
|
763
773
|
}, e.prototype.toHsl = function() {
|
|
764
|
-
return
|
|
774
|
+
return de(ct(this.rgba));
|
|
765
775
|
}, e.prototype.toHslString = function() {
|
|
766
|
-
return t =
|
|
776
|
+
return t = de(ct(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
|
|
767
777
|
var t, o, r, s, i;
|
|
768
778
|
}, e.prototype.toHsv = function() {
|
|
769
|
-
return t =
|
|
779
|
+
return t = _e(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
|
|
770
780
|
var t;
|
|
771
781
|
}, e.prototype.invert = function() {
|
|
772
782
|
return T({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
|
|
773
783
|
var t;
|
|
774
784
|
}, e.prototype.saturate = function(t) {
|
|
775
|
-
return t === void 0 && (t = 0.1), T(
|
|
785
|
+
return t === void 0 && (t = 0.1), T(Nt(this.rgba, t));
|
|
776
786
|
}, e.prototype.desaturate = function(t) {
|
|
777
|
-
return t === void 0 && (t = 0.1), T(
|
|
787
|
+
return t === void 0 && (t = 0.1), T(Nt(this.rgba, -t));
|
|
778
788
|
}, e.prototype.grayscale = function() {
|
|
779
|
-
return T(
|
|
789
|
+
return T(Nt(this.rgba, -1));
|
|
780
790
|
}, e.prototype.lighten = function(t) {
|
|
781
|
-
return t === void 0 && (t = 0.1), T(
|
|
791
|
+
return t === void 0 && (t = 0.1), T(fe(this.rgba, t));
|
|
782
792
|
}, e.prototype.darken = function(t) {
|
|
783
|
-
return t === void 0 && (t = 0.1), T(
|
|
793
|
+
return t === void 0 && (t = 0.1), T(fe(this.rgba, -t));
|
|
784
794
|
}, e.prototype.rotate = function(t) {
|
|
785
795
|
return t === void 0 && (t = 15), this.hue(this.hue() + t);
|
|
786
796
|
}, e.prototype.alpha = function(t) {
|
|
787
|
-
return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) :
|
|
797
|
+
return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : $(this.rgba.a, 3);
|
|
788
798
|
var o;
|
|
789
799
|
}, e.prototype.hue = function(t) {
|
|
790
800
|
var o = ct(this.rgba);
|
|
791
|
-
return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) :
|
|
801
|
+
return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : $(o.h);
|
|
792
802
|
}, e.prototype.isEqual = function(t) {
|
|
793
803
|
return this.toHex() === T(t).toHex();
|
|
794
804
|
}, e;
|
|
795
805
|
}(), T = function(e) {
|
|
796
|
-
return e instanceof
|
|
806
|
+
return e instanceof ge ? e : new ge(e);
|
|
797
807
|
};
|
|
798
|
-
const
|
|
799
|
-
function
|
|
808
|
+
const Rt = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
|
|
809
|
+
function yo(e) {
|
|
800
810
|
return {
|
|
801
811
|
debug: (t, ...o) => {
|
|
802
|
-
|
|
812
|
+
Rt && console.debug(`[${e}]`, t, ...o);
|
|
803
813
|
},
|
|
804
814
|
info: (t, ...o) => {
|
|
805
|
-
|
|
815
|
+
Rt && console.info(`[${e}]`, t, ...o);
|
|
806
816
|
},
|
|
807
817
|
warn: (t, ...o) => {
|
|
808
|
-
|
|
818
|
+
Rt && console.warn(`[${e}]`, t, ...o);
|
|
809
819
|
},
|
|
810
820
|
error: (t, ...o) => {
|
|
811
821
|
console.error(`[${e}]`, t, ...o);
|
|
812
822
|
}
|
|
813
823
|
};
|
|
814
824
|
}
|
|
815
|
-
const m =
|
|
816
|
-
var
|
|
817
|
-
const
|
|
825
|
+
const m = yo("Pollcatch");
|
|
826
|
+
var Ie = /* @__PURE__ */ ((e) => (e[e.AA_NORMAL = 4.5] = "AA_NORMAL", e[e.AA_LARGE = 3] = "AA_LARGE", e[e.AAA_NORMAL = 7] = "AAA_NORMAL", e[e.AAA_LARGE = 4.5] = "AAA_LARGE", e))(Ie || {});
|
|
827
|
+
const xo = {
|
|
818
828
|
black: "#000000",
|
|
819
829
|
white: "#ffffff",
|
|
820
830
|
red: "#ff0000",
|
|
@@ -831,16 +841,16 @@ const yo = {
|
|
|
831
841
|
teal: "#008080",
|
|
832
842
|
navy: "#000080"
|
|
833
843
|
};
|
|
834
|
-
function
|
|
844
|
+
function wo(e) {
|
|
835
845
|
const t = e.toLowerCase().trim();
|
|
836
|
-
return
|
|
846
|
+
return xo[t] || null;
|
|
837
847
|
}
|
|
838
|
-
function
|
|
839
|
-
const o =
|
|
848
|
+
function jt(e, t) {
|
|
849
|
+
const o = me(e), r = me(t), s = Math.max(o, r), i = Math.min(o, r);
|
|
840
850
|
return (s + 0.05) / (i + 0.05);
|
|
841
851
|
}
|
|
842
|
-
function
|
|
843
|
-
const t =
|
|
852
|
+
function me(e) {
|
|
853
|
+
const t = So(e), o = t.r / 255, r = t.g / 255, s = t.b / 255, i = o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4), a = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4), l = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
844
854
|
return 0.2126 * i + 0.7152 * a + 0.0722 * l;
|
|
845
855
|
}
|
|
846
856
|
function $o(e, t = {}) {
|
|
@@ -857,15 +867,15 @@ function $o(e, t = {}) {
|
|
|
857
867
|
} = t, l = s.map((p) => p === "black" ? "#000000" : p === "white" ? "#ffffff" : p === "light" ? i.light || "#f8f9fa" : p === "dark" ? i.dark || "#343a40" : p);
|
|
858
868
|
let n = a, d = 0;
|
|
859
869
|
for (const p of l) {
|
|
860
|
-
const h =
|
|
870
|
+
const h = jt(e, p);
|
|
861
871
|
h >= r && h > d && (d = h, n = p);
|
|
862
872
|
}
|
|
863
873
|
if (d === 0) {
|
|
864
|
-
const p =
|
|
874
|
+
const p = jt(e, a);
|
|
865
875
|
n = a, d = p;
|
|
866
876
|
for (const h of l) {
|
|
867
877
|
if (h === a) continue;
|
|
868
|
-
const b =
|
|
878
|
+
const b = jt(e, h);
|
|
869
879
|
b > d && (d = b, n = h);
|
|
870
880
|
}
|
|
871
881
|
m.warn(
|
|
@@ -874,8 +884,8 @@ function $o(e, t = {}) {
|
|
|
874
884
|
}
|
|
875
885
|
return n;
|
|
876
886
|
}
|
|
877
|
-
function
|
|
878
|
-
const o =
|
|
887
|
+
function So(e) {
|
|
888
|
+
const o = wo(e) || e, r = T(o);
|
|
879
889
|
if (!r.isValid())
|
|
880
890
|
return m.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
|
|
881
891
|
const { r: s, g: i, b: a } = r.toRgb();
|
|
@@ -893,7 +903,7 @@ function O(e, t) {
|
|
|
893
903
|
}[t] : void 0;
|
|
894
904
|
return e === "left" || e === "right" ? r || "center" : e === "top" || e === "bottom" ? r || "start" : r || "center";
|
|
895
905
|
}
|
|
896
|
-
function
|
|
906
|
+
function Bt(e, t = "1rem", o = 1) {
|
|
897
907
|
if (!e) return t;
|
|
898
908
|
const r = {
|
|
899
909
|
xs: 0.7,
|
|
@@ -912,7 +922,7 @@ function jt(e, t = "1rem", o = 1) {
|
|
|
912
922
|
const l = parseFloat(i);
|
|
913
923
|
return isNaN(l) ? t : `${l}rem`;
|
|
914
924
|
}
|
|
915
|
-
function
|
|
925
|
+
function Co(e, t = "4px") {
|
|
916
926
|
if (!e) return t;
|
|
917
927
|
const o = {
|
|
918
928
|
xs: "2px",
|
|
@@ -943,7 +953,7 @@ function tt(e) {
|
|
|
943
953
|
}
|
|
944
954
|
return t;
|
|
945
955
|
}
|
|
946
|
-
function
|
|
956
|
+
function ko(e, t, o) {
|
|
947
957
|
return tt({
|
|
948
958
|
role: "button",
|
|
949
959
|
ariaLabel: e,
|
|
@@ -951,7 +961,7 @@ function Co(e, t, o) {
|
|
|
951
961
|
ariaDisabled: o
|
|
952
962
|
});
|
|
953
963
|
}
|
|
954
|
-
function
|
|
964
|
+
function Eo(e, t, o, r = !1) {
|
|
955
965
|
return tt({
|
|
956
966
|
role: r ? "radio" : "checkbox",
|
|
957
967
|
ariaLabel: e,
|
|
@@ -959,38 +969,38 @@ function ko(e, t, o, r = !1) {
|
|
|
959
969
|
ariaDisabled: o
|
|
960
970
|
});
|
|
961
971
|
}
|
|
962
|
-
function
|
|
972
|
+
function Vt(e, t, o) {
|
|
963
973
|
typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
|
|
964
974
|
}
|
|
965
|
-
function
|
|
975
|
+
function Ao(e) {
|
|
966
976
|
if (typeof e != "string")
|
|
967
977
|
return !1;
|
|
968
978
|
const t = e.replace(/[<>"']/g, "").trim();
|
|
969
979
|
return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
|
|
970
980
|
}
|
|
971
981
|
function J(e) {
|
|
972
|
-
return
|
|
982
|
+
return Ao(e) ? e.replace(/[<>"']/g, "").trim() : (m.warn("Invalid color value:", e), "#000000");
|
|
973
983
|
}
|
|
974
|
-
function
|
|
984
|
+
function Po(e) {
|
|
975
985
|
if (typeof e != "string")
|
|
976
986
|
return m.warn("Non-string value passed to sanitizeCSS:", typeof e), "";
|
|
977
987
|
let t = e;
|
|
978
988
|
return t = t.replace(/@import[^;]+;/gi, "").replace(/expression\s*\([^)]*\)/gi, "").replace(/javascript:\s*[^"'\s;]*/gi, "").replace(/url\s*\(\s*["']?data:(?!image\/[^;]+;base64,)[^"')]*["']?\s*\)/gi, "").replace(/-moz-binding\s*:[^;]+;/gi, "").replace(/behavior\s*:[^;]+;/gi, ""), t;
|
|
979
989
|
}
|
|
980
|
-
function
|
|
990
|
+
function To(e) {
|
|
981
991
|
return typeof e != "string" || !e.trim() ? "" : e.replace(
|
|
982
992
|
/([^{}:;]+):\s*([^;{}!]+)(\s*!important)?\s*(;|})/gi,
|
|
983
993
|
(t, o, r, s, i) => s ? t : `${o}: ${r.trim()} !important${i}`
|
|
984
994
|
);
|
|
985
995
|
}
|
|
986
|
-
const
|
|
987
|
-
function
|
|
996
|
+
const ve = "https://jpxwfjorwcsrqraorpbj.supabase.co/functions/v1/data", _o = "pc_session_id", Oo = 24 * 60 * 60 * 1e3;
|
|
997
|
+
function be() {
|
|
988
998
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : (m.warn("crypto.randomUUID not available, using fallback UUID generator"), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
989
999
|
const t = Math.random() * 16 | 0;
|
|
990
1000
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
991
1001
|
}));
|
|
992
1002
|
}
|
|
993
|
-
function
|
|
1003
|
+
function Zt() {
|
|
994
1004
|
const e = "test-local-storage";
|
|
995
1005
|
try {
|
|
996
1006
|
return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
|
|
@@ -998,7 +1008,7 @@ function Gt() {
|
|
|
998
1008
|
return m.warn("localStorage not available, session ID will not persist"), !1;
|
|
999
1009
|
}
|
|
1000
1010
|
}
|
|
1001
|
-
function
|
|
1011
|
+
function ze(e) {
|
|
1002
1012
|
try {
|
|
1003
1013
|
const t = localStorage.getItem(e);
|
|
1004
1014
|
return t ? JSON.parse(t) : void 0;
|
|
@@ -1007,14 +1017,14 @@ function Ie(e) {
|
|
|
1007
1017
|
return;
|
|
1008
1018
|
}
|
|
1009
1019
|
}
|
|
1010
|
-
function
|
|
1020
|
+
function Me(e, t) {
|
|
1011
1021
|
try {
|
|
1012
1022
|
return localStorage.setItem(e, JSON.stringify(t)), !0;
|
|
1013
1023
|
} catch (o) {
|
|
1014
1024
|
return m.warn(`Failed to set item in localStorage: ${e}`, o), !1;
|
|
1015
1025
|
}
|
|
1016
1026
|
}
|
|
1017
|
-
async function
|
|
1027
|
+
async function Io() {
|
|
1018
1028
|
if (typeof window < "u") {
|
|
1019
1029
|
if (window.pcProject !== void 0)
|
|
1020
1030
|
return m.debug("Found project key in global variable"), window.pcProject;
|
|
@@ -1027,27 +1037,27 @@ async function Oo() {
|
|
|
1027
1037
|
}
|
|
1028
1038
|
m.warn("No project key found in global variable or script tags");
|
|
1029
1039
|
}
|
|
1030
|
-
async function
|
|
1031
|
-
const e =
|
|
1032
|
-
if (
|
|
1033
|
-
const o =
|
|
1040
|
+
async function ye() {
|
|
1041
|
+
const e = _o, t = Oo;
|
|
1042
|
+
if (Zt()) {
|
|
1043
|
+
const o = ze(e);
|
|
1034
1044
|
if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
|
|
1035
1045
|
return m.debug("Using existing session ID from localStorage"), o.id;
|
|
1036
1046
|
m.debug(
|
|
1037
1047
|
o ? "Session ID expired" : "No session ID found",
|
|
1038
1048
|
"generating new one"
|
|
1039
1049
|
);
|
|
1040
|
-
const r =
|
|
1041
|
-
return
|
|
1050
|
+
const r = be();
|
|
1051
|
+
return Me(e, {
|
|
1042
1052
|
id: r,
|
|
1043
1053
|
timestamp: Date.now()
|
|
1044
1054
|
}) ? m.debug("Generated and stored new session ID") : m.warn("Generated session ID but failed to store it"), r;
|
|
1045
1055
|
} else {
|
|
1046
|
-
const o =
|
|
1056
|
+
const o = be();
|
|
1047
1057
|
return m.debug("Generated non-persistent session ID"), o;
|
|
1048
1058
|
}
|
|
1049
1059
|
}
|
|
1050
|
-
function
|
|
1060
|
+
function Ct(e) {
|
|
1051
1061
|
if (!e || typeof e != "object")
|
|
1052
1062
|
return 0;
|
|
1053
1063
|
let t = 0, o = 0, r = 0;
|
|
@@ -1060,7 +1070,7 @@ function St(e) {
|
|
|
1060
1070
|
const s = t / r * 100, i = o / r * 100;
|
|
1061
1071
|
return Math.round(s - i);
|
|
1062
1072
|
}
|
|
1063
|
-
function
|
|
1073
|
+
function zo(e) {
|
|
1064
1074
|
if (!e || typeof e != "object")
|
|
1065
1075
|
return { promoters: 0, passives: 0, detractors: 0 };
|
|
1066
1076
|
let t = 0, o = 0, r = 0;
|
|
@@ -1070,14 +1080,14 @@ function Io(e) {
|
|
|
1070
1080
|
}
|
|
1071
1081
|
return { promoters: t, passives: o, detractors: r };
|
|
1072
1082
|
}
|
|
1073
|
-
function
|
|
1083
|
+
function Mo(e, t) {
|
|
1074
1084
|
const o = {};
|
|
1075
1085
|
for (const r of t)
|
|
1076
1086
|
o[r] = e[r] || 0;
|
|
1077
1087
|
return o;
|
|
1078
1088
|
}
|
|
1079
|
-
function
|
|
1080
|
-
const o = t ?
|
|
1089
|
+
function Lo(e, t) {
|
|
1090
|
+
const o = t ? Mo(e, t) : e;
|
|
1081
1091
|
let r = 0, s = 0;
|
|
1082
1092
|
for (const [a, l] of Object.entries(o)) {
|
|
1083
1093
|
s += l;
|
|
@@ -1096,26 +1106,26 @@ function L() {
|
|
|
1096
1106
|
updated: (/* @__PURE__ */ new Date()).toISOString()
|
|
1097
1107
|
};
|
|
1098
1108
|
}
|
|
1099
|
-
function
|
|
1100
|
-
if (!
|
|
1109
|
+
function No(e) {
|
|
1110
|
+
if (!Zt())
|
|
1101
1111
|
return L();
|
|
1102
1112
|
try {
|
|
1103
|
-
const t =
|
|
1113
|
+
const t = ze(e);
|
|
1104
1114
|
return t ? { ...L(), ...t } : L();
|
|
1105
1115
|
} catch (t) {
|
|
1106
1116
|
return m.warn("Failed to load localStats from localStorage", t), L();
|
|
1107
1117
|
}
|
|
1108
1118
|
}
|
|
1109
|
-
function
|
|
1110
|
-
if (!
|
|
1119
|
+
function Do(e, t) {
|
|
1120
|
+
if (!Zt())
|
|
1111
1121
|
return !1;
|
|
1112
1122
|
try {
|
|
1113
|
-
return
|
|
1123
|
+
return Me(e, t) ? (m.debug("Saved localStats to localStorage", t), !0) : !1;
|
|
1114
1124
|
} catch (o) {
|
|
1115
1125
|
return m.warn("Failed to save localStats to localStorage", o), !1;
|
|
1116
1126
|
}
|
|
1117
1127
|
}
|
|
1118
|
-
function
|
|
1128
|
+
function Ro(e, t) {
|
|
1119
1129
|
const o = {
|
|
1120
1130
|
count: Math.max(0, e.count - t.count),
|
|
1121
1131
|
sum: (e.sum || 0) - (t.sum || 0),
|
|
@@ -1128,9 +1138,9 @@ function Do(e, t) {
|
|
|
1128
1138
|
if (o.count > 0 && o.sum !== void 0 ? o.avg = Math.round(o.sum / o.count * 100) / 100 : o.avg = 0, t.breakdown && o.breakdown)
|
|
1129
1139
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1130
1140
|
o.breakdown[r] && (o.breakdown[r] = Math.max(0, o.breakdown[r] - s), o.breakdown[r] === 0 && delete o.breakdown[r]);
|
|
1131
|
-
return o.nps =
|
|
1141
|
+
return o.nps = Ct((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1132
1142
|
}
|
|
1133
|
-
function
|
|
1143
|
+
function jo(e, t) {
|
|
1134
1144
|
if (!e.count && !t.count)
|
|
1135
1145
|
return L();
|
|
1136
1146
|
if (!e.count)
|
|
@@ -1149,12 +1159,12 @@ function Ro(e, t) {
|
|
|
1149
1159
|
for (const [r, s] of Object.entries(t.breakdown))
|
|
1150
1160
|
o.breakdown[r] = (o.breakdown[r] || 0) + s;
|
|
1151
1161
|
}
|
|
1152
|
-
return o.nps =
|
|
1162
|
+
return o.nps = Ct((o == null ? void 0 : o.breakdown) || {}), o;
|
|
1153
1163
|
}
|
|
1154
|
-
function
|
|
1164
|
+
function Le(e) {
|
|
1155
1165
|
return !e || typeof e != "string" ? !1 : /^[\p{Emoji}]$/u.test(e) ? !0 : new RegExp("^\\p{Emoji}(\\p{Emoji_Modifier}|\\u200D\\p{Emoji})*$", "u").test(e);
|
|
1156
1166
|
}
|
|
1157
|
-
function
|
|
1167
|
+
function At(e) {
|
|
1158
1168
|
if (!e || typeof e != "string")
|
|
1159
1169
|
return !1;
|
|
1160
1170
|
const t = e.trim();
|
|
@@ -1168,7 +1178,7 @@ function Et(e) {
|
|
|
1168
1178
|
return !1;
|
|
1169
1179
|
}
|
|
1170
1180
|
}
|
|
1171
|
-
function
|
|
1181
|
+
function Bo(e) {
|
|
1172
1182
|
if (!e || typeof e != "string")
|
|
1173
1183
|
return [];
|
|
1174
1184
|
const t = e.trim();
|
|
@@ -1183,24 +1193,24 @@ function jo(e) {
|
|
|
1183
1193
|
}
|
|
1184
1194
|
return t.split(",").map((o) => o.trim()).filter((o) => o !== "");
|
|
1185
1195
|
}
|
|
1186
|
-
function
|
|
1196
|
+
function Vo(e, t) {
|
|
1187
1197
|
const o = /{([^{}]+)}/g;
|
|
1188
1198
|
return e.replace(o, (r, s) => {
|
|
1189
1199
|
const i = s.trim(), a = t[i];
|
|
1190
1200
|
return a !== void 0 ? String(a) : r;
|
|
1191
1201
|
});
|
|
1192
1202
|
}
|
|
1193
|
-
function
|
|
1203
|
+
function Uo(e, t) {
|
|
1194
1204
|
let o = 2166136261;
|
|
1195
1205
|
const r = e + ":" + t;
|
|
1196
1206
|
for (let s = 0; s < r.length; s++)
|
|
1197
1207
|
o ^= r.charCodeAt(s), o += (o << 1) + (o << 4) + (o << 7) + (o << 8) + (o << 24);
|
|
1198
1208
|
return (o >>> 0).toString(16).padStart(8, "0");
|
|
1199
1209
|
}
|
|
1200
|
-
function
|
|
1210
|
+
function qo(e, t = 50) {
|
|
1201
1211
|
return e.length <= t ? e : e.substring(0, t).trim() + "...";
|
|
1202
1212
|
}
|
|
1203
|
-
class
|
|
1213
|
+
class Ho {
|
|
1204
1214
|
// Tracks if user has ever made a selection (even if later deselected)
|
|
1205
1215
|
constructor(t) {
|
|
1206
1216
|
this.stats = L(), this.localStats = L(), this.prevLocalStats = L(), this.isLoading = !0, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
|
|
@@ -1209,10 +1219,10 @@ class qo {
|
|
|
1209
1219
|
this.loadStats();
|
|
1210
1220
|
}
|
|
1211
1221
|
async getProjectId() {
|
|
1212
|
-
return this.host.project || await
|
|
1222
|
+
return this.host.project || await Io() || "public";
|
|
1213
1223
|
}
|
|
1214
1224
|
async getLocalStatsKey() {
|
|
1215
|
-
const t = this.host, o = await
|
|
1225
|
+
const t = this.host, o = await ye(), r = await this.getProjectId(), s = t.name || "unnamed";
|
|
1216
1226
|
return `pc-local-stats-${o}-${r}-${s}`;
|
|
1217
1227
|
}
|
|
1218
1228
|
/**
|
|
@@ -1233,10 +1243,10 @@ class qo {
|
|
|
1233
1243
|
let i;
|
|
1234
1244
|
if (t.dataFunc && typeof window < "u") {
|
|
1235
1245
|
const P = t.dataFunc.replace(/^window\./, "").split(".");
|
|
1236
|
-
let
|
|
1246
|
+
let w = window;
|
|
1237
1247
|
for (const mt of P)
|
|
1238
|
-
if (
|
|
1239
|
-
i =
|
|
1248
|
+
if (w = w == null ? void 0 : w[mt], w === void 0) break;
|
|
1249
|
+
i = w;
|
|
1240
1250
|
}
|
|
1241
1251
|
let a, l;
|
|
1242
1252
|
if (i && typeof i == "function") {
|
|
@@ -1252,24 +1262,24 @@ class qo {
|
|
|
1252
1262
|
} else
|
|
1253
1263
|
l = a || {};
|
|
1254
1264
|
} else {
|
|
1255
|
-
const C = t.dataEndpoint ||
|
|
1265
|
+
const C = t.dataEndpoint || ve;
|
|
1256
1266
|
if (!r)
|
|
1257
1267
|
throw new Error("Name parameter is required");
|
|
1258
1268
|
const P = `${C}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
|
|
1259
1269
|
m.debug(`Fetching stats for: ${r}`, { endpoint: C, projectKey: o });
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
throw new Error(`API request failed with status: ${
|
|
1263
|
-
if (a = await
|
|
1270
|
+
const w = await fetch(P);
|
|
1271
|
+
if (!w.ok)
|
|
1272
|
+
throw new Error(`API request failed with status: ${w.status}`);
|
|
1273
|
+
if (a = await w.json(), !a.success)
|
|
1264
1274
|
throw m.error("Backend returned unsuccessful response", a), new Error("Backend returned unsuccessful response");
|
|
1265
1275
|
l = a.data || {};
|
|
1266
1276
|
}
|
|
1267
|
-
const n = this.getOptionsForDataFunc(t), d =
|
|
1277
|
+
const n = this.getOptionsForDataFunc(t), d = Lo(l.breakdown ?? {}, n), p = d.count, h = d.sum, b = p > 0 ? Math.round(h / p * 10) / 10 : 0, x = p > 0 ? Math.round(h / p * 100) : 0, E = {
|
|
1268
1278
|
count: p,
|
|
1269
1279
|
sum: h,
|
|
1270
1280
|
avg: b,
|
|
1271
1281
|
pct: x,
|
|
1272
|
-
nps: s === S.nps ?
|
|
1282
|
+
nps: s === S.nps ? Ct(d.breakdown) : 0,
|
|
1273
1283
|
breakdown: d.breakdown,
|
|
1274
1284
|
updated: l.updated_at || (/* @__PURE__ */ new Date()).toISOString()
|
|
1275
1285
|
};
|
|
@@ -1306,7 +1316,7 @@ class qo {
|
|
|
1306
1316
|
async loadLocalStats() {
|
|
1307
1317
|
const t = await this.getLocalStatsKey();
|
|
1308
1318
|
try {
|
|
1309
|
-
const o =
|
|
1319
|
+
const o = No(t);
|
|
1310
1320
|
m.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
|
|
1311
1321
|
} catch (o) {
|
|
1312
1322
|
m.warn("Failed to generate localStorage key for localStats", o), this.localStats = L();
|
|
@@ -1319,7 +1329,7 @@ class qo {
|
|
|
1319
1329
|
async persistLocalStats() {
|
|
1320
1330
|
try {
|
|
1321
1331
|
const t = await this.getLocalStatsKey();
|
|
1322
|
-
|
|
1332
|
+
Do(t, this.localStats) || m.warn("Failed to save localStats to localStorage");
|
|
1323
1333
|
} catch (t) {
|
|
1324
1334
|
m.warn("Failed to save localStats to localStorage", t);
|
|
1325
1335
|
}
|
|
@@ -1333,7 +1343,7 @@ class qo {
|
|
|
1333
1343
|
* @param textValues
|
|
1334
1344
|
*/
|
|
1335
1345
|
updateStats(t, o) {
|
|
1336
|
-
if (this.hasInteracted = !0, this.stats && (this.stats =
|
|
1346
|
+
if (this.hasInteracted = !0, this.stats && (this.stats = Ro(this.stats, this.localStats)), this.localStats = {
|
|
1337
1347
|
count: t > 0 || o.length > 0 ? 1 : 0,
|
|
1338
1348
|
sum: t,
|
|
1339
1349
|
// e.g. number of stars, nps value
|
|
@@ -1347,7 +1357,7 @@ class qo {
|
|
|
1347
1357
|
}, o && o.length > 0)
|
|
1348
1358
|
for (const r of o)
|
|
1349
1359
|
r && (this.localStats.breakdown[r] = 1);
|
|
1350
|
-
this.stats =
|
|
1360
|
+
this.stats = jo(this.stats, this.localStats), m.debug("Stats updated - remote: ", this.stats), m.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
|
|
1351
1361
|
}
|
|
1352
1362
|
async markStatsAsSubmitted() {
|
|
1353
1363
|
this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
|
|
@@ -1355,7 +1365,7 @@ class qo {
|
|
|
1355
1365
|
async submitStats() {
|
|
1356
1366
|
if (!this.hasLocalStats() && !this.hasInteracted)
|
|
1357
1367
|
throw m.warn("No local stats to submit"), new Error("No local stats to submit");
|
|
1358
|
-
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await
|
|
1368
|
+
const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await ye(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, l = Object.keys(this.localStats.breakdown || {}), n = this.prevLocalStats.sum, d = Object.keys(this.prevLocalStats.breakdown || {});
|
|
1359
1369
|
this.isSubmitting = !0, this.host.requestUpdate();
|
|
1360
1370
|
const p = {
|
|
1361
1371
|
sessionId: r,
|
|
@@ -1369,7 +1379,7 @@ class qo {
|
|
|
1369
1379
|
prevTextValues: d,
|
|
1370
1380
|
metadata: t.metadata,
|
|
1371
1381
|
timestamp: o
|
|
1372
|
-
}, h =
|
|
1382
|
+
}, h = Uo(JSON.stringify(p), o);
|
|
1373
1383
|
try {
|
|
1374
1384
|
await this.sendStats({ ...p, hash: h }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(p);
|
|
1375
1385
|
} catch (b) {
|
|
@@ -1380,12 +1390,12 @@ class qo {
|
|
|
1380
1390
|
return p;
|
|
1381
1391
|
}
|
|
1382
1392
|
async sendStats(t) {
|
|
1383
|
-
const o = JSON.stringify(t), r = this.host, s = r.dataEndpoint ||
|
|
1393
|
+
const o = JSON.stringify(t), r = this.host, s = r.dataEndpoint || ve;
|
|
1384
1394
|
if (r.dataFunc) {
|
|
1385
1395
|
m.debug("Skip sending stats as data function is in use.");
|
|
1386
1396
|
return;
|
|
1387
1397
|
}
|
|
1388
|
-
if (!
|
|
1398
|
+
if (!At(s))
|
|
1389
1399
|
throw m.error("Invalid data endpoint", { dataEndpoint: s }), new Error(`Invalid data endpoint: ${s}`);
|
|
1390
1400
|
try {
|
|
1391
1401
|
if (m.debug("Sending stats", { endpoint: s, event: t }), typeof navigator < "u" && navigator.sendBeacon)
|
|
@@ -1421,9 +1431,9 @@ class qo {
|
|
|
1421
1431
|
sum: (o == null ? void 0 : o.sum) || 0,
|
|
1422
1432
|
avg: s,
|
|
1423
1433
|
pct: (o == null ? void 0 : o.pct) || 0,
|
|
1424
|
-
nps: r.type === S.nps ?
|
|
1434
|
+
nps: r.type === S.nps ? Ct((o == null ? void 0 : o.breakdown) || {}) : 0
|
|
1425
1435
|
};
|
|
1426
|
-
return m.debug("Stats data: ", this.stats),
|
|
1436
|
+
return m.debug("Stats data: ", this.stats), Vo(t, i);
|
|
1427
1437
|
}
|
|
1428
1438
|
/**
|
|
1429
1439
|
* Checks if a value is selected in the local stats
|
|
@@ -1510,7 +1520,7 @@ class qo {
|
|
|
1510
1520
|
return ((t = this.localStats) == null ? void 0 : t.submitted) !== void 0 && this.hasLocalStats();
|
|
1511
1521
|
}
|
|
1512
1522
|
}
|
|
1513
|
-
class
|
|
1523
|
+
class Fo {
|
|
1514
1524
|
constructor(t, o) {
|
|
1515
1525
|
this.isEditing = !0, this.isChartVisible = !1, this.isStatsVisible = !1, this.isThankYouVisible = !1, this.isReactionPopoverVisible = !1, this.initialized = !1, this.handleClickOutside = (r) => {
|
|
1516
1526
|
r.target !== this.host && (this.toggleThankYouVisibility(!1), this.toggleReactionPopoverVisibility(!1));
|
|
@@ -1594,7 +1604,7 @@ class Ho {
|
|
|
1594
1604
|
}
|
|
1595
1605
|
}
|
|
1596
1606
|
var Wt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Wt || {});
|
|
1597
|
-
function
|
|
1607
|
+
function Ne(e, t = {}) {
|
|
1598
1608
|
const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
|
|
1599
1609
|
if (!e)
|
|
1600
1610
|
return { alt: "", ariaHidden: !0 };
|
|
@@ -1603,20 +1613,20 @@ function Le(e, t = {}) {
|
|
|
1603
1613
|
o === "functional" && !r && !s && console.warn(
|
|
1604
1614
|
"No alt text or aria-label provided for functional icon. This may cause accessibility issues."
|
|
1605
1615
|
);
|
|
1606
|
-
const a = i ? " (selected)" : "", l =
|
|
1616
|
+
const a = i ? " (selected)" : "", l = At(e) && !r ? "" : r || e, n = s || (l ? `${l}${a}` : a);
|
|
1607
1617
|
return {
|
|
1608
1618
|
alt: l,
|
|
1609
1619
|
ariaLabel: n,
|
|
1610
1620
|
ariaHidden: !1
|
|
1611
1621
|
};
|
|
1612
1622
|
}
|
|
1613
|
-
function
|
|
1623
|
+
function Yo(e, t = "polite") {
|
|
1614
1624
|
let o = document.getElementById("screen-reader-announcer");
|
|
1615
1625
|
o ? o.setAttribute("aria-live", t) : (o = document.createElement("div"), o.id = "screen-reader-announcer", o.setAttribute("aria-live", t), o.setAttribute("role", "status"), o.setAttribute("aria-atomic", "true"), o.style.position = "absolute", o.style.width = "1px", o.style.height = "1px", o.style.margin = "-1px", o.style.padding = "0", o.style.overflow = "hidden", o.style.clip = "rect(0, 0, 0, 0)", o.style.whiteSpace = "nowrap", o.style.border = "0", document.body.appendChild(o)), o.textContent = "", setTimeout(() => {
|
|
1616
1626
|
o.textContent = e;
|
|
1617
1627
|
}, 50);
|
|
1618
1628
|
}
|
|
1619
|
-
function
|
|
1629
|
+
function Ko(e, t) {
|
|
1620
1630
|
return `${e}: ${t}`;
|
|
1621
1631
|
}
|
|
1622
1632
|
/**
|
|
@@ -1624,8 +1634,8 @@ function Yo(e, t) {
|
|
|
1624
1634
|
* Copyright 2017 Google LLC
|
|
1625
1635
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1626
1636
|
*/
|
|
1627
|
-
const
|
|
1628
|
-
let
|
|
1637
|
+
const De = { ATTRIBUTE: 1 }, Re = (e) => (...t) => ({ _$litDirective$: e, values: t });
|
|
1638
|
+
let je = class {
|
|
1629
1639
|
constructor(t) {
|
|
1630
1640
|
}
|
|
1631
1641
|
get _$AU() {
|
|
@@ -1646,10 +1656,10 @@ let Re = class {
|
|
|
1646
1656
|
* Copyright 2018 Google LLC
|
|
1647
1657
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1648
1658
|
*/
|
|
1649
|
-
const y =
|
|
1659
|
+
const y = Re(class extends je {
|
|
1650
1660
|
constructor(e) {
|
|
1651
1661
|
var t;
|
|
1652
|
-
if (super(e), e.type !==
|
|
1662
|
+
if (super(e), e.type !== De.ATTRIBUTE || e.name !== "class" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
|
|
1653
1663
|
}
|
|
1654
1664
|
render(e) {
|
|
1655
1665
|
return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
|
|
@@ -1670,18 +1680,18 @@ const y = De(class extends Re {
|
|
|
1670
1680
|
return U;
|
|
1671
1681
|
}
|
|
1672
1682
|
});
|
|
1673
|
-
var
|
|
1683
|
+
var Go = Object.defineProperty, v = (e, t, o, r) => {
|
|
1674
1684
|
for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
|
|
1675
1685
|
(a = e[i]) && (s = a(t, o, s) || s);
|
|
1676
|
-
return s &&
|
|
1686
|
+
return s && Go(t, o, s), s;
|
|
1677
1687
|
};
|
|
1678
1688
|
const bt = {
|
|
1679
1689
|
mobile: "480px",
|
|
1680
1690
|
tablet: "768px",
|
|
1681
1691
|
desktop: "1024px"
|
|
1682
|
-
},
|
|
1692
|
+
}, Xt = class Xt extends N {
|
|
1683
1693
|
constructor() {
|
|
1684
|
-
super(...arguments), this.dataController = new
|
|
1694
|
+
super(...arguments), this.dataController = new Ho(this), this.displayController = new Fo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Ie.AA_NORMAL, this.options = [], this.project = "public", this.questionPosition = "top", this.statsText = "{count} votes", this.buttonText = "Submit", this.buttonRadius = "sm", this.multiple = !1, this.inline = !1, this.readonly = !1, this.handleEditToggleKeyDown = (t) => {
|
|
1685
1695
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
|
|
1686
1696
|
};
|
|
1687
1697
|
}
|
|
@@ -1747,33 +1757,33 @@ const bt = {
|
|
|
1747
1757
|
const s = this.starHoverColor || (r ? `color-mix(in srgb, ${J(r)} 80%, white)` : null);
|
|
1748
1758
|
if (s && (o += `--pc-star-hover-color: ${s} !important;
|
|
1749
1759
|
`), this.starSize) {
|
|
1750
|
-
const i =
|
|
1760
|
+
const i = Bt(this.starSize, "1.5em", 1.5);
|
|
1751
1761
|
o += `--pc-stars-star-size: ${i} !important;
|
|
1752
1762
|
`;
|
|
1753
1763
|
}
|
|
1754
1764
|
if (this.reactionSize) {
|
|
1755
|
-
const i =
|
|
1765
|
+
const i = Bt(this.reactionSize, "1em", 1);
|
|
1756
1766
|
o += `--pc-reaction-size: ${i} !important;
|
|
1757
1767
|
`;
|
|
1758
1768
|
}
|
|
1759
1769
|
if (this.size) {
|
|
1760
|
-
const i =
|
|
1770
|
+
const i = Bt(this.size);
|
|
1761
1771
|
o += `font-size: ${i} !important;
|
|
1762
1772
|
`;
|
|
1763
1773
|
}
|
|
1764
1774
|
if (this.buttonRadius) {
|
|
1765
|
-
const i =
|
|
1775
|
+
const i = Co(this.buttonRadius);
|
|
1766
1776
|
o += `--pc-button-radius: ${i} !important;
|
|
1767
1777
|
`;
|
|
1768
1778
|
}
|
|
1769
1779
|
o += `}
|
|
1770
|
-
`, this.css && (o += Po(
|
|
1780
|
+
`, this.css && (o += To(Po(this.css))), t.textContent = o;
|
|
1771
1781
|
}
|
|
1772
1782
|
/**
|
|
1773
1783
|
* Update ARIA attributes for accessibility
|
|
1774
1784
|
*/
|
|
1775
1785
|
updateAriaAttributes() {
|
|
1776
|
-
this.ariaLabel &&
|
|
1786
|
+
this.ariaLabel && Vt(this, "aria-label", this.ariaLabel), this.ariaDescribedby && Vt(this, "aria-describedby", this.ariaDescribedby), Vt(this, "aria-busy", this.dataController.isLoading ? "true" : "false");
|
|
1777
1787
|
}
|
|
1778
1788
|
/**
|
|
1779
1789
|
* Update host CSS classes based on state
|
|
@@ -1798,7 +1808,7 @@ const bt = {
|
|
|
1798
1808
|
*/
|
|
1799
1809
|
announceSelectionChange(t, o, r) {
|
|
1800
1810
|
const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
|
|
1801
|
-
|
|
1811
|
+
Yo(Ko(s, i));
|
|
1802
1812
|
}
|
|
1803
1813
|
/** Common render methods */
|
|
1804
1814
|
renderLabel() {
|
|
@@ -1829,7 +1839,7 @@ const bt = {
|
|
|
1829
1839
|
tabindex="0"
|
|
1830
1840
|
aria-label="Edit vote"
|
|
1831
1841
|
@keydown="${this.handleEditToggleKeyDown}"
|
|
1832
|
-
>${
|
|
1842
|
+
>${St}</span
|
|
1833
1843
|
>
|
|
1834
1844
|
` : u;
|
|
1835
1845
|
}
|
|
@@ -1848,7 +1858,7 @@ const bt = {
|
|
|
1848
1858
|
tabindex="0"
|
|
1849
1859
|
aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
|
|
1850
1860
|
@keydown="${() => this.displayController.toggleChartVisibility()}"
|
|
1851
|
-
>${this.displayController.isChartVisible ?
|
|
1861
|
+
>${this.displayController.isChartVisible ? Gt : Kt}</span
|
|
1852
1862
|
>
|
|
1853
1863
|
` : u;
|
|
1854
1864
|
}
|
|
@@ -1875,7 +1885,7 @@ const bt = {
|
|
|
1875
1885
|
renderThankYouMessage() {
|
|
1876
1886
|
if (!this.displayController.shouldDisplayThankYouMsg())
|
|
1877
1887
|
return u;
|
|
1878
|
-
const t =
|
|
1888
|
+
const t = qo(this.thankYouMsg || "");
|
|
1879
1889
|
return c`
|
|
1880
1890
|
<div class="pc-thank-you-overlay" data-testid="poll-thank-you-overlay">
|
|
1881
1891
|
<div class="pc-thank-you" data-testid="thank-you">
|
|
@@ -1887,7 +1897,7 @@ const bt = {
|
|
|
1887
1897
|
@click="${() => this.displayController.toggleThankYouVisibility(!1)}"
|
|
1888
1898
|
role="button"
|
|
1889
1899
|
aria-label="Close"
|
|
1890
|
-
>${
|
|
1900
|
+
>${po}</span
|
|
1891
1901
|
>
|
|
1892
1902
|
</div>
|
|
1893
1903
|
</div>
|
|
@@ -1895,7 +1905,7 @@ const bt = {
|
|
|
1895
1905
|
`;
|
|
1896
1906
|
}
|
|
1897
1907
|
};
|
|
1898
|
-
|
|
1908
|
+
Xt.styles = [
|
|
1899
1909
|
R`
|
|
1900
1910
|
:host {
|
|
1901
1911
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
@@ -1976,7 +1986,7 @@ Zt.styles = [
|
|
|
1976
1986
|
}
|
|
1977
1987
|
`
|
|
1978
1988
|
];
|
|
1979
|
-
let g =
|
|
1989
|
+
let g = Xt;
|
|
1980
1990
|
v([
|
|
1981
1991
|
f({ type: String, attribute: "show-stats" })
|
|
1982
1992
|
], g.prototype, "showStats");
|
|
@@ -2082,7 +2092,7 @@ v([
|
|
|
2082
2092
|
v([
|
|
2083
2093
|
f({ type: Boolean, reflect: !0 })
|
|
2084
2094
|
], g.prototype, "readonly");
|
|
2085
|
-
const
|
|
2095
|
+
const Zo = R`
|
|
2086
2096
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
2087
2097
|
|
|
2088
2098
|
.pc-body {
|
|
@@ -2310,6 +2320,24 @@ const Go = R`
|
|
|
2310
2320
|
fill: #66bb6a;
|
|
2311
2321
|
}
|
|
2312
2322
|
|
|
2323
|
+
/* Edit icon for inline trigger */
|
|
2324
|
+
.inline-nps-icon {
|
|
2325
|
+
display: inline-flex;
|
|
2326
|
+
align-items: center;
|
|
2327
|
+
justify-content: center;
|
|
2328
|
+
color: var(--pc-primary-color, var(--default-primary-color));
|
|
2329
|
+
opacity: 0.8;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
.inline-nps-icon svg {
|
|
2333
|
+
width: 0.9em;
|
|
2334
|
+
height: 0.9em;
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
.pc-inline-trigger:hover .inline-nps-icon {
|
|
2338
|
+
opacity: 1;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2313
2341
|
/* ========================================
|
|
2314
2342
|
* NPS-SPECIFIC POPOVER CONTENT STYLES
|
|
2315
2343
|
* (Shared popover styles are in pc-base-styles.ts)
|
|
@@ -2515,7 +2543,7 @@ const Go = R`
|
|
|
2515
2543
|
animation: none;
|
|
2516
2544
|
}
|
|
2517
2545
|
}
|
|
2518
|
-
`,
|
|
2546
|
+
`, Pt = R`
|
|
2519
2547
|
/* Default values for CSS variables - can be overridden by external :root or parent definitions */
|
|
2520
2548
|
:host {
|
|
2521
2549
|
--default-primary-color: #2196f3;
|
|
@@ -2944,6 +2972,22 @@ const Go = R`
|
|
|
2944
2972
|
text-decoration-thickness: 2px;
|
|
2945
2973
|
}
|
|
2946
2974
|
|
|
2975
|
+
/* Selected option indicator for inline mode */
|
|
2976
|
+
.pc-inline-selected {
|
|
2977
|
+
display: inline-flex;
|
|
2978
|
+
align-items: center;
|
|
2979
|
+
font-size: 0.9em;
|
|
2980
|
+
color: var(--pc-primary-color, var(--default-primary-color));
|
|
2981
|
+
opacity: 0.9;
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.pc-inline-selected .poll-option-icon,
|
|
2985
|
+
.pc-inline-selected .poll-option-icon-img {
|
|
2986
|
+
font-size: 1em;
|
|
2987
|
+
width: 1em;
|
|
2988
|
+
height: 1em;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2947
2991
|
/* Vertical layout for top/bottom stats position */
|
|
2948
2992
|
.pc-inline-trigger-vertical {
|
|
2949
2993
|
flex-direction: column;
|
|
@@ -3005,6 +3049,10 @@ const Go = R`
|
|
|
3005
3049
|
|
|
3006
3050
|
/* Popover stats text */
|
|
3007
3051
|
.pc-popover-stats {
|
|
3052
|
+
display: flex;
|
|
3053
|
+
align-items: center;
|
|
3054
|
+
justify-content: center;
|
|
3055
|
+
gap: 0.3em;
|
|
3008
3056
|
font-size: 0.85em;
|
|
3009
3057
|
color: var(--pc-text-color, var(--default-text-color));
|
|
3010
3058
|
opacity: 0.8;
|
|
@@ -3017,6 +3065,25 @@ const Go = R`
|
|
|
3017
3065
|
display: none;
|
|
3018
3066
|
}
|
|
3019
3067
|
|
|
3068
|
+
/* Edit icon in popover stats */
|
|
3069
|
+
.pc-popover-edit-icon {
|
|
3070
|
+
display: inline-flex;
|
|
3071
|
+
align-items: center;
|
|
3072
|
+
justify-content: center;
|
|
3073
|
+
cursor: pointer;
|
|
3074
|
+
opacity: 0.7;
|
|
3075
|
+
transition: opacity 0.15s ease;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
.pc-popover-edit-icon:hover {
|
|
3079
|
+
opacity: 1;
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
.pc-popover-edit-icon svg {
|
|
3083
|
+
width: 1.1em;
|
|
3084
|
+
height: 1.1em;
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3020
3087
|
/* Popover submit button */
|
|
3021
3088
|
.pc-popover-submit {
|
|
3022
3089
|
font: inherit;
|
|
@@ -3068,6 +3135,11 @@ const Go = R`
|
|
|
3068
3135
|
font-size: var(--pc-font-size-medium, var(--default-font-size-medium));
|
|
3069
3136
|
padding: 0.2em 0;
|
|
3070
3137
|
}
|
|
3138
|
+
|
|
3139
|
+
/* Popover content should not exceed screen width on mobile */
|
|
3140
|
+
.pc-popover-content {
|
|
3141
|
+
width: 100% !important;
|
|
3142
|
+
}
|
|
3071
3143
|
}
|
|
3072
3144
|
|
|
3073
3145
|
.pc-thank-you-msg {
|
|
@@ -3283,10 +3355,10 @@ const Go = R`
|
|
|
3283
3355
|
max-width: 100%;
|
|
3284
3356
|
}
|
|
3285
3357
|
`;
|
|
3286
|
-
var
|
|
3287
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3358
|
+
var Xo = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, j = (e, t, o, r) => {
|
|
3359
|
+
for (var s = r > 1 ? void 0 : r ? Jo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3288
3360
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3289
|
-
return r && s &&
|
|
3361
|
+
return r && s && Xo(t, o, s), s;
|
|
3290
3362
|
};
|
|
3291
3363
|
let _ = class extends N {
|
|
3292
3364
|
constructor() {
|
|
@@ -3405,7 +3477,7 @@ j([
|
|
|
3405
3477
|
_ = j([
|
|
3406
3478
|
H("pc-popover")
|
|
3407
3479
|
], _);
|
|
3408
|
-
const
|
|
3480
|
+
const Qo = R`
|
|
3409
3481
|
:host {
|
|
3410
3482
|
--sheet-bg: light-dark(#ffffff, #1a1a1a);
|
|
3411
3483
|
--sheet-border: light-dark(#e0e0e0, #333333);
|
|
@@ -3518,10 +3590,10 @@ const Jo = R`
|
|
|
3518
3590
|
max-width: 100%;
|
|
3519
3591
|
}
|
|
3520
3592
|
`;
|
|
3521
|
-
var
|
|
3522
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3593
|
+
var tr = Object.defineProperty, er = Object.getOwnPropertyDescriptor, X = (e, t, o, r) => {
|
|
3594
|
+
for (var s = r > 1 ? void 0 : r ? er(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3523
3595
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3524
|
-
return r && s &&
|
|
3596
|
+
return r && s && tr(t, o, s), s;
|
|
3525
3597
|
};
|
|
3526
3598
|
let D = class extends N {
|
|
3527
3599
|
constructor() {
|
|
@@ -3617,7 +3689,7 @@ let D = class extends N {
|
|
|
3617
3689
|
`;
|
|
3618
3690
|
}
|
|
3619
3691
|
};
|
|
3620
|
-
D.styles = [
|
|
3692
|
+
D.styles = [Qo];
|
|
3621
3693
|
X([
|
|
3622
3694
|
f({ type: Boolean, reflect: !0 })
|
|
3623
3695
|
], D.prototype, "open", 2);
|
|
@@ -3639,13 +3711,13 @@ X([
|
|
|
3639
3711
|
D = X([
|
|
3640
3712
|
H("pc-bottom-sheet")
|
|
3641
3713
|
], D);
|
|
3642
|
-
var
|
|
3643
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3714
|
+
var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, ft = (e, t, o, r) => {
|
|
3715
|
+
for (var s = r > 1 ? void 0 : r ? rr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3644
3716
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3645
|
-
return r && s &&
|
|
3717
|
+
return r && s && or(t, o, s), s;
|
|
3646
3718
|
};
|
|
3647
|
-
const
|
|
3648
|
-
let
|
|
3719
|
+
const sr = 768;
|
|
3720
|
+
let Z = class extends N {
|
|
3649
3721
|
constructor() {
|
|
3650
3722
|
super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
|
|
3651
3723
|
this.isMobile = e.matches;
|
|
@@ -3661,7 +3733,7 @@ let W = class extends N {
|
|
|
3661
3733
|
super.disconnectedCallback(), (e = this.mediaQuery) == null || e.removeEventListener("change", this.handleMediaChange);
|
|
3662
3734
|
}
|
|
3663
3735
|
setupMediaQuery() {
|
|
3664
|
-
this.mediaQuery = window.matchMedia(`(max-width: ${
|
|
3736
|
+
this.mediaQuery = window.matchMedia(`(max-width: ${sr - 1}px)`), this.isMobile = this.mediaQuery.matches, this.mediaQuery.addEventListener("change", this.handleMediaChange);
|
|
3665
3737
|
}
|
|
3666
3738
|
render() {
|
|
3667
3739
|
return this.isMobile ? c`
|
|
@@ -3680,30 +3752,30 @@ let W = class extends N {
|
|
|
3680
3752
|
`;
|
|
3681
3753
|
}
|
|
3682
3754
|
};
|
|
3683
|
-
|
|
3755
|
+
Z.styles = R`
|
|
3684
3756
|
:host {
|
|
3685
3757
|
display: contents;
|
|
3686
3758
|
}
|
|
3687
3759
|
`;
|
|
3688
3760
|
ft([
|
|
3689
3761
|
f({ type: Boolean, reflect: !0 })
|
|
3690
|
-
],
|
|
3762
|
+
], Z.prototype, "open", 2);
|
|
3691
3763
|
ft([
|
|
3692
3764
|
f({ type: String })
|
|
3693
|
-
],
|
|
3765
|
+
], Z.prototype, "position", 2);
|
|
3694
3766
|
ft([
|
|
3695
3767
|
f({ attribute: !1 })
|
|
3696
|
-
],
|
|
3768
|
+
], Z.prototype, "anchor", 2);
|
|
3697
3769
|
ft([
|
|
3698
3770
|
k()
|
|
3699
|
-
],
|
|
3700
|
-
|
|
3771
|
+
], Z.prototype, "isMobile", 2);
|
|
3772
|
+
Z = ft([
|
|
3701
3773
|
H("pc-responsive-modal")
|
|
3702
|
-
],
|
|
3703
|
-
var
|
|
3704
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
3774
|
+
], Z);
|
|
3775
|
+
var ir = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, F = (e, t, o, r) => {
|
|
3776
|
+
for (var s = r > 1 ? void 0 : r ? ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
3705
3777
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
3706
|
-
return r && s &&
|
|
3778
|
+
return r && s && ir(t, o, s), s;
|
|
3707
3779
|
};
|
|
3708
3780
|
let I = class extends g {
|
|
3709
3781
|
constructor() {
|
|
@@ -3725,7 +3797,7 @@ let I = class extends g {
|
|
|
3725
3797
|
const i = this.dataController.isValueSelected(String(s)), a = {
|
|
3726
3798
|
"nps-button": !0,
|
|
3727
3799
|
selected: i
|
|
3728
|
-
}, l =
|
|
3800
|
+
}, l = ko(`Rate ${s}`, i, !1);
|
|
3729
3801
|
return c`
|
|
3730
3802
|
<button
|
|
3731
3803
|
data-testid="nps-button-${s}"
|
|
@@ -3769,10 +3841,10 @@ let I = class extends g {
|
|
|
3769
3841
|
* NPS score displayed prominently in the middle
|
|
3770
3842
|
*/
|
|
3771
3843
|
renderChart() {
|
|
3772
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (
|
|
3773
|
-
x: o + s * Math.cos(
|
|
3774
|
-
y: r - s * Math.sin(
|
|
3775
|
-
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (
|
|
3844
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (w) => ({
|
|
3845
|
+
x: o + s * Math.cos(w),
|
|
3846
|
+
y: r - s * Math.sin(w)
|
|
3847
|
+
}), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (w, mt, Ve = 0) => `M ${w.x} ${w.y} A ${s} ${s} 0 ${Ve} 1 ${mt.x} ${mt.y}`, h = p(a, l), b = p(l, n), x = p(n, d), C = ((w) => Math.PI - (w + 100) / 200 * Math.PI)(t), P = i(C);
|
|
3776
3848
|
return c`
|
|
3777
3849
|
<div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
|
|
3778
3850
|
<svg viewBox="0 0 200 115">
|
|
@@ -3848,7 +3920,7 @@ let I = class extends g {
|
|
|
3848
3920
|
* Uses SVG with 3 colored segments for detractors/passives/promoters
|
|
3849
3921
|
*/
|
|
3850
3922
|
renderInlineGauge() {
|
|
3851
|
-
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s =
|
|
3923
|
+
const e = this.dataController.stats, t = (e == null ? void 0 : e.breakdown) || {}, o = 8, r = 2 * Math.PI * o, s = zo(t), i = s.detractors + s.passives + s.promoters;
|
|
3852
3924
|
if (i === 0)
|
|
3853
3925
|
return c`
|
|
3854
3926
|
<div class="inline-nps-gauge">
|
|
@@ -3899,9 +3971,11 @@ let I = class extends g {
|
|
|
3899
3971
|
}
|
|
3900
3972
|
/**
|
|
3901
3973
|
* Render the inline trigger button
|
|
3974
|
+
* Respects show-stats attribute for controlling stats text visibility
|
|
3975
|
+
* Shows add icon when no selection, edit icon when user has submitted
|
|
3902
3976
|
*/
|
|
3903
3977
|
renderInlineTrigger() {
|
|
3904
|
-
const
|
|
3978
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? St : Pe;
|
|
3905
3979
|
return c`
|
|
3906
3980
|
<button
|
|
3907
3981
|
class="pc-inline-trigger"
|
|
@@ -3913,7 +3987,8 @@ let I = class extends g {
|
|
|
3913
3987
|
data-testid="nps-inline-trigger"
|
|
3914
3988
|
>
|
|
3915
3989
|
${this.renderInlineGauge()}
|
|
3916
|
-
${
|
|
3990
|
+
${t ? c`<span class="pc-inline-stats-text">${t}</span>` : u}
|
|
3991
|
+
<span class="inline-nps-icon">${r}</span>
|
|
3917
3992
|
</button>
|
|
3918
3993
|
`;
|
|
3919
3994
|
}
|
|
@@ -3966,24 +4041,25 @@ let I = class extends g {
|
|
|
3966
4041
|
@keydown="${(e) => {
|
|
3967
4042
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
3968
4043
|
}}"
|
|
3969
|
-
>${this.displayController.isChartVisible ?
|
|
4044
|
+
>${this.displayController.isChartVisible ? Gt : Kt}</span
|
|
3970
4045
|
>
|
|
3971
4046
|
`;
|
|
3972
4047
|
}
|
|
3973
4048
|
/**
|
|
3974
4049
|
* Render popover content
|
|
3975
4050
|
* For inline mode popover: show stats text if provided, show chart toggle if show-chart is set
|
|
4051
|
+
* Respects show-stats attribute for controlling stats text visibility
|
|
3976
4052
|
*/
|
|
3977
4053
|
renderPopoverContent() {
|
|
3978
|
-
const
|
|
4054
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", o = this.showChart, r = !!t || o;
|
|
3979
4055
|
return c`
|
|
3980
4056
|
<div class="pc-popover-content" data-testid="nps-popover-content">
|
|
3981
4057
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
3982
4058
|
${this.renderPopoverNpsButtons()}
|
|
3983
|
-
${
|
|
4059
|
+
${r ? c`
|
|
3984
4060
|
<div class="pc-popover-footer">
|
|
3985
|
-
${
|
|
3986
|
-
${
|
|
4061
|
+
${t ? c`<span class="pc-popover-stats-text">${t}</span>` : u}
|
|
4062
|
+
${o ? this.renderPopoverChartToggle() : u}
|
|
3987
4063
|
</div>
|
|
3988
4064
|
` : u}
|
|
3989
4065
|
${this.displayController.isChartVisible ? this.renderChart() : u}
|
|
@@ -4049,7 +4125,7 @@ let I = class extends g {
|
|
|
4049
4125
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4050
4126
|
}
|
|
4051
4127
|
};
|
|
4052
|
-
I.styles = [...g.styles,
|
|
4128
|
+
I.styles = [...g.styles, Pt, Zo];
|
|
4053
4129
|
F([
|
|
4054
4130
|
f({ type: String, attribute: "min-label" })
|
|
4055
4131
|
], I.prototype, "minLabel", 2);
|
|
@@ -4074,7 +4150,7 @@ F([
|
|
|
4074
4150
|
I = F([
|
|
4075
4151
|
H("pc-nps")
|
|
4076
4152
|
], I);
|
|
4077
|
-
const
|
|
4153
|
+
const nr = R`
|
|
4078
4154
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4079
4155
|
|
|
4080
4156
|
.pc-container {
|
|
@@ -4381,8 +4457,7 @@ const ar = R`
|
|
|
4381
4457
|
/* Poll popover sizing */
|
|
4382
4458
|
.pc-popover-content {
|
|
4383
4459
|
padding: 0.5rem;
|
|
4384
|
-
min-width:
|
|
4385
|
-
max-width: 350px;
|
|
4460
|
+
min-width: 280px;
|
|
4386
4461
|
}
|
|
4387
4462
|
|
|
4388
4463
|
/* Poll-specific: center the stats text */
|
|
@@ -4460,12 +4535,12 @@ const ar = R`
|
|
|
4460
4535
|
opacity: 0.8;
|
|
4461
4536
|
}
|
|
4462
4537
|
`;
|
|
4463
|
-
var
|
|
4464
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
4538
|
+
var lr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, gt = (e, t, o, r) => {
|
|
4539
|
+
for (var s = r > 1 ? void 0 : r ? cr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
4465
4540
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
4466
|
-
return r && s &&
|
|
4541
|
+
return r && s && lr(t, o, s), s;
|
|
4467
4542
|
};
|
|
4468
|
-
let
|
|
4543
|
+
let W = class extends g {
|
|
4469
4544
|
constructor() {
|
|
4470
4545
|
super(), this.type = S.poll, this.multiple = !1, this.compact = !1, this.popoverOpen = !1, this.hasEditButton = !0, this.statsText = "{count} votes", this.questionPosition = "top", this.statsPosition = "bottom", this.showStats = "after-vote";
|
|
4471
4546
|
}
|
|
@@ -4523,16 +4598,16 @@ let Z = class extends g {
|
|
|
4523
4598
|
*/
|
|
4524
4599
|
renderOptionIcon(e) {
|
|
4525
4600
|
if (!(e != null && e.icon)) return "";
|
|
4526
|
-
const t = Wt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s =
|
|
4601
|
+
const t = Wt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = Ne(e == null ? void 0 : e.icon, {
|
|
4527
4602
|
type: t,
|
|
4528
4603
|
alt: o,
|
|
4529
4604
|
isSelected: r
|
|
4530
4605
|
});
|
|
4531
|
-
return
|
|
4606
|
+
return Le(e == null ? void 0 : e.icon) ? c`<span
|
|
4532
4607
|
class="poll-option-icon"
|
|
4533
4608
|
aria-hidden="${s.ariaHidden ? "true" : "false"}"
|
|
4534
4609
|
>${e == null ? void 0 : e.icon}</span
|
|
4535
|
-
>` :
|
|
4610
|
+
>` : At(e == null ? void 0 : e.icon) ? c`<img
|
|
4536
4611
|
src="${e == null ? void 0 : e.icon}"
|
|
4537
4612
|
alt="${s.alt}"
|
|
4538
4613
|
class="poll-option-icon-img"
|
|
@@ -4560,7 +4635,7 @@ let Z = class extends g {
|
|
|
4560
4635
|
selected: o,
|
|
4561
4636
|
"poll-option--compact": this.compact,
|
|
4562
4637
|
"poll-option--disabled": r
|
|
4563
|
-
}, i = t + 1, a = `poll-${this.type}-${i}`, l =
|
|
4638
|
+
}, i = t + 1, a = `poll-${this.type}-${i}`, l = Eo(
|
|
4564
4639
|
e.label,
|
|
4565
4640
|
o,
|
|
4566
4641
|
r,
|
|
@@ -4714,9 +4789,11 @@ let Z = class extends g {
|
|
|
4714
4789
|
}
|
|
4715
4790
|
/**
|
|
4716
4791
|
* Render the inline trigger button
|
|
4792
|
+
* Respects show-stats attribute for controlling stats text visibility
|
|
4793
|
+
* Shows add icon when no selection, edit icon when user has submitted
|
|
4717
4794
|
*/
|
|
4718
4795
|
renderInlineTrigger() {
|
|
4719
|
-
const
|
|
4796
|
+
const t = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = this.dataController.hasLocalStats() ? St : Pe;
|
|
4720
4797
|
return c`
|
|
4721
4798
|
<button
|
|
4722
4799
|
class="pc-inline-trigger"
|
|
@@ -4729,8 +4806,8 @@ let Z = class extends g {
|
|
|
4729
4806
|
data-testid="poll-inline-trigger"
|
|
4730
4807
|
>
|
|
4731
4808
|
${this.question ? c`<span class="inline-poll-question">${this.question}</span>` : u}
|
|
4732
|
-
${t
|
|
4733
|
-
<span class="inline-poll-icon">${
|
|
4809
|
+
${t ? c`<span class="pc-inline-stats-text">${t}</span>` : u}
|
|
4810
|
+
<span class="inline-poll-icon">${r}</span>
|
|
4734
4811
|
</button>
|
|
4735
4812
|
`;
|
|
4736
4813
|
}
|
|
@@ -4754,18 +4831,39 @@ let Z = class extends g {
|
|
|
4754
4831
|
</button>
|
|
4755
4832
|
`;
|
|
4756
4833
|
}
|
|
4834
|
+
/**
|
|
4835
|
+
* Handle edit button click in popover to switch back to edit mode
|
|
4836
|
+
*/
|
|
4837
|
+
handlePopoverEditClick() {
|
|
4838
|
+
this.displayController.toggleEditMode(!0), this.displayController.toggleChartVisibility(!1);
|
|
4839
|
+
}
|
|
4757
4840
|
/**
|
|
4758
4841
|
* Render popover content
|
|
4759
4842
|
* Shows poll options for voting, or chart after submission
|
|
4843
|
+
* Respects show-stats attribute for controlling stats text visibility
|
|
4760
4844
|
*/
|
|
4761
4845
|
renderPopoverContent() {
|
|
4762
|
-
const e = this.displayController.shouldShowChart(), o = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "";
|
|
4846
|
+
const e = this.displayController.shouldShowChart(), o = this.displayController.shouldShowStats() && this.statsText ? this.dataController.formatStatsText(this.statsText) : "", r = e && !this.readonly;
|
|
4763
4847
|
return c`
|
|
4764
4848
|
<div class="pc-popover-content" data-testid="poll-popover-content">
|
|
4765
4849
|
${this.question ? c`<div class="pc-popover-question">${this.question}</div>` : u}
|
|
4766
4850
|
${e ? this.renderBarChart() : this.renderPollOptions()}
|
|
4767
4851
|
${e ? u : this.renderPopoverSubmitButton()}
|
|
4768
|
-
${o ? c`<div class="pc-popover-stats"
|
|
4852
|
+
${o || r ? c`<div class="pc-popover-stats">
|
|
4853
|
+
${o ? c`<span>${o}</span>` : u}
|
|
4854
|
+
${r ? c`<span
|
|
4855
|
+
class="pc-popover-edit-icon"
|
|
4856
|
+
@click=${this.handlePopoverEditClick}
|
|
4857
|
+
role="button"
|
|
4858
|
+
tabindex="0"
|
|
4859
|
+
aria-label="Edit vote"
|
|
4860
|
+
data-testid="popover-edit-icon"
|
|
4861
|
+
@keydown=${(s) => {
|
|
4862
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), this.handlePopoverEditClick());
|
|
4863
|
+
}}
|
|
4864
|
+
>${St}</span
|
|
4865
|
+
>` : u}
|
|
4866
|
+
</div>` : u}
|
|
4769
4867
|
</div>
|
|
4770
4868
|
`;
|
|
4771
4869
|
}
|
|
@@ -4849,23 +4947,23 @@ let Z = class extends g {
|
|
|
4849
4947
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
4850
4948
|
}
|
|
4851
4949
|
};
|
|
4852
|
-
|
|
4950
|
+
W.styles = [...g.styles, Pt, nr];
|
|
4853
4951
|
gt([
|
|
4854
4952
|
f({ type: Boolean })
|
|
4855
|
-
],
|
|
4953
|
+
], W.prototype, "multiple", 2);
|
|
4856
4954
|
gt([
|
|
4857
4955
|
f({ type: Boolean })
|
|
4858
|
-
],
|
|
4956
|
+
], W.prototype, "compact", 2);
|
|
4859
4957
|
gt([
|
|
4860
4958
|
k()
|
|
4861
|
-
],
|
|
4959
|
+
], W.prototype, "popoverOpen", 2);
|
|
4862
4960
|
gt([
|
|
4863
4961
|
ht(".pc-inline-trigger")
|
|
4864
|
-
],
|
|
4865
|
-
|
|
4962
|
+
], W.prototype, "triggerElement", 2);
|
|
4963
|
+
W = gt([
|
|
4866
4964
|
H("pc-poll")
|
|
4867
|
-
],
|
|
4868
|
-
const
|
|
4965
|
+
], W);
|
|
4966
|
+
const dr = R`
|
|
4869
4967
|
/* CSS variables inherit from parent - defaults are specified at usage sites */
|
|
4870
4968
|
|
|
4871
4969
|
.pc-section {
|
|
@@ -5052,10 +5150,10 @@ const cr = R`
|
|
|
5052
5150
|
* Copyright 2018 Google LLC
|
|
5053
5151
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5054
5152
|
*/
|
|
5055
|
-
const
|
|
5153
|
+
const Be = "important", pr = " !" + Be, ur = Re(class extends je {
|
|
5056
5154
|
constructor(e) {
|
|
5057
5155
|
var t;
|
|
5058
|
-
if (super(e), e.type !==
|
|
5156
|
+
if (super(e), e.type !== De.ATTRIBUTE || e.name !== "style" || ((t = e.strings) == null ? void 0 : t.length) > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
5059
5157
|
}
|
|
5060
5158
|
render(e) {
|
|
5061
5159
|
return Object.keys(e).reduce((t, o) => {
|
|
@@ -5071,8 +5169,8 @@ const je = "important", dr = " !" + je, pr = De(class extends Re {
|
|
|
5071
5169
|
const s = t[r];
|
|
5072
5170
|
if (s != null) {
|
|
5073
5171
|
this.ft.add(r);
|
|
5074
|
-
const i = typeof s == "string" && s.endsWith(
|
|
5075
|
-
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ?
|
|
5172
|
+
const i = typeof s == "string" && s.endsWith(pr);
|
|
5173
|
+
r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Be : "") : o[r] = s;
|
|
5076
5174
|
}
|
|
5077
5175
|
}
|
|
5078
5176
|
return U;
|
|
@@ -5107,7 +5205,7 @@ function xt(e, t = {}) {
|
|
|
5107
5205
|
</div>
|
|
5108
5206
|
`;
|
|
5109
5207
|
}
|
|
5110
|
-
const
|
|
5208
|
+
const xe = {
|
|
5111
5209
|
// Faces
|
|
5112
5210
|
smile: "😊",
|
|
5113
5211
|
laugh: "😄",
|
|
@@ -5250,17 +5348,17 @@ const ye = {
|
|
|
5250
5348
|
hiking: "🥾",
|
|
5251
5349
|
yoga: "🧘"
|
|
5252
5350
|
};
|
|
5253
|
-
function
|
|
5351
|
+
function kt(e) {
|
|
5254
5352
|
let t = "❓", o = !1;
|
|
5255
|
-
return e ? e in
|
|
5353
|
+
return e ? e in xe ? t = xe[e] : Le(e) ? t = e : At(e) ? (o = !0, t = e) : /^\w+@\w+$/.test(e) ? t = e : e.endsWith(".svg") && !e.includes("/") ? (t = `https://cdn.jsdelivr.net/npm/@mdi/svg@7.4.47/svg/${e}`, o = !0) : t = e : t = "❓", {
|
|
5256
5354
|
icon: t,
|
|
5257
5355
|
isRemoteImage: o
|
|
5258
5356
|
};
|
|
5259
5357
|
}
|
|
5260
|
-
var
|
|
5261
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5358
|
+
var hr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, st = (e, t, o, r) => {
|
|
5359
|
+
for (var s = r > 1 ? void 0 : r ? fr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5262
5360
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5263
|
-
return r && s &&
|
|
5361
|
+
return r && s && hr(t, o, s), s;
|
|
5264
5362
|
};
|
|
5265
5363
|
let q = class extends g {
|
|
5266
5364
|
constructor() {
|
|
@@ -5285,14 +5383,14 @@ let q = class extends g {
|
|
|
5285
5383
|
* Renders the star icon using resolveIcon for emoji, URL, or MDI support
|
|
5286
5384
|
*/
|
|
5287
5385
|
renderStarIcon() {
|
|
5288
|
-
const { icon: e, isRemoteImage: t } =
|
|
5386
|
+
const { icon: e, isRemoteImage: t } = kt(this.icon);
|
|
5289
5387
|
return t ? c`<img class="star-icon-img" src="${e}" alt="star" />` : e;
|
|
5290
5388
|
}
|
|
5291
5389
|
/**
|
|
5292
5390
|
* Gets the resolved icon string (for use in chart labels)
|
|
5293
5391
|
*/
|
|
5294
5392
|
getResolvedIconString() {
|
|
5295
|
-
const { icon: e, isRemoteImage: t } =
|
|
5393
|
+
const { icon: e, isRemoteImage: t } = kt(this.icon);
|
|
5296
5394
|
return t ? "★" : e;
|
|
5297
5395
|
}
|
|
5298
5396
|
/**
|
|
@@ -5314,7 +5412,7 @@ let q = class extends g {
|
|
|
5314
5412
|
<span
|
|
5315
5413
|
data-testid="${e ? "popover" : "stars-view"}-star-${d}"
|
|
5316
5414
|
class=${y(x)}
|
|
5317
|
-
style=${
|
|
5415
|
+
style=${ur(E)}
|
|
5318
5416
|
role="${a ? "button" : "presentation"}"
|
|
5319
5417
|
tabindex="${a ? "0" : ""}"
|
|
5320
5418
|
aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
|
|
@@ -5483,7 +5581,7 @@ let q = class extends g {
|
|
|
5483
5581
|
@keydown="${(e) => {
|
|
5484
5582
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
|
|
5485
5583
|
}}"
|
|
5486
|
-
>${this.displayController.isChartVisible ?
|
|
5584
|
+
>${this.displayController.isChartVisible ? Gt : Kt}</span
|
|
5487
5585
|
>
|
|
5488
5586
|
`;
|
|
5489
5587
|
}
|
|
@@ -5564,7 +5662,7 @@ let q = class extends g {
|
|
|
5564
5662
|
return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
5565
5663
|
}
|
|
5566
5664
|
};
|
|
5567
|
-
q.styles = [...g.styles,
|
|
5665
|
+
q.styles = [...g.styles, Pt, dr];
|
|
5568
5666
|
st([
|
|
5569
5667
|
f({ type: String })
|
|
5570
5668
|
], q.prototype, "icon", 2);
|
|
@@ -5583,7 +5681,7 @@ st([
|
|
|
5583
5681
|
q = st([
|
|
5584
5682
|
H("pc-stars")
|
|
5585
5683
|
], q);
|
|
5586
|
-
const
|
|
5684
|
+
const gr = R`
|
|
5587
5685
|
/* Adjust stats text for reactions */
|
|
5588
5686
|
.pc-stats-text {
|
|
5589
5687
|
font-size: var(--pc-font-size-small, var(--default-font-size-small));
|
|
@@ -5846,11 +5944,11 @@ const fr = R`
|
|
|
5846
5944
|
animation: none;
|
|
5847
5945
|
}
|
|
5848
5946
|
}
|
|
5849
|
-
`,
|
|
5850
|
-
var
|
|
5851
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
5947
|
+
`, mr = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%20-960%20960%20960'%20width='24px'%20fill='%23434343'%3e%3cpath%20d='M480-480Zm0%20400q-83%200-156-31.5T197-197q-54-54-85.5-127T80-480q0-83%2031.5-156T197-763q54-54%20127-85.5T480-880q43%200%2083%208.5t77%2024.5v90q-35-20-75.5-31.5T480-800q-133%200-226.5%2093.5T160-480q0%20133%2093.5%20226.5T480-160q133%200%20226.5-93.5T800-480q0-32-6.5-62T776-600h86q9%2029%2013.5%2058.5T880-480q0%2083-31.5%20156T763-197q-54%2054-127%2085.5T480-80Zm320-600v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM620-520q25%200%2042.5-17.5T680-580q0-25-17.5-42.5T620-640q-25%200-42.5%2017.5T560-580q0%2025%2017.5%2042.5T620-520Zm-280%200q25%200%2042.5-17.5T400-580q0-25-17.5-42.5T340-640q-25%200-42.5%2017.5T280-580q0%2025%2017.5%2042.5T340-520Zm140%20260q68%200%20123.5-38.5T684-400H276q25%2063%2080.5%20101.5T480-260Z'/%3e%3c/svg%3e";
|
|
5948
|
+
var vr = Object.defineProperty, br = Object.getOwnPropertyDescriptor, Tt = (e, t, o, r) => {
|
|
5949
|
+
for (var s = r > 1 ? void 0 : r ? br(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
5852
5950
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
5853
|
-
return r && s &&
|
|
5951
|
+
return r && s && vr(t, o, s), s;
|
|
5854
5952
|
};
|
|
5855
5953
|
let ot = class extends g {
|
|
5856
5954
|
constructor() {
|
|
@@ -5876,7 +5974,7 @@ let ot = class extends g {
|
|
|
5876
5974
|
* Renders the icon for a reaction
|
|
5877
5975
|
*/
|
|
5878
5976
|
renderReactionIcon(e, t) {
|
|
5879
|
-
const { icon: o, isRemoteImage: r } =
|
|
5977
|
+
const { icon: o, isRemoteImage: r } = kt(e), s = Wt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = Ne(o, {
|
|
5880
5978
|
type: s,
|
|
5881
5979
|
alt: i,
|
|
5882
5980
|
ariaLabel: i,
|
|
@@ -5930,7 +6028,7 @@ let ot = class extends g {
|
|
|
5930
6028
|
aria-expanded="${this.displayController.shouldShowReactionPopover()}"
|
|
5931
6029
|
aria-haspopup="true"
|
|
5932
6030
|
>
|
|
5933
|
-
<img src="${
|
|
6031
|
+
<img src="${mr}" alt="" class="trigger-icon" />
|
|
5934
6032
|
</button>
|
|
5935
6033
|
`;
|
|
5936
6034
|
}
|
|
@@ -6092,31 +6190,31 @@ let ot = class extends g {
|
|
|
6092
6190
|
return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
|
|
6093
6191
|
}
|
|
6094
6192
|
};
|
|
6095
|
-
ot.styles = [...g.styles,
|
|
6096
|
-
|
|
6193
|
+
ot.styles = [...g.styles, Pt, gr];
|
|
6194
|
+
Tt([
|
|
6097
6195
|
f({ type: Boolean, attribute: "show-counts" })
|
|
6098
6196
|
], ot.prototype, "showCounts", 2);
|
|
6099
|
-
|
|
6197
|
+
Tt([
|
|
6100
6198
|
f({ type: Boolean, reflect: !0 })
|
|
6101
6199
|
], ot.prototype, "compact", 2);
|
|
6102
|
-
|
|
6200
|
+
Tt([
|
|
6103
6201
|
f({ type: String, attribute: "popup-position" })
|
|
6104
6202
|
], ot.prototype, "popupPosition", 2);
|
|
6105
|
-
ot =
|
|
6203
|
+
ot = Tt([
|
|
6106
6204
|
H("pc-reaction")
|
|
6107
6205
|
], ot);
|
|
6108
6206
|
function at(e, t, o = void 0) {
|
|
6109
6207
|
const r = e.getAttribute(t);
|
|
6110
6208
|
return r === null ? o : r == null ? void 0 : r.trim();
|
|
6111
6209
|
}
|
|
6112
|
-
function
|
|
6210
|
+
function yr(e, t = void 0) {
|
|
6113
6211
|
const o = e.textContent;
|
|
6114
6212
|
return o === "" || o === null ? t : o == null ? void 0 : o.trim();
|
|
6115
6213
|
}
|
|
6116
|
-
var
|
|
6117
|
-
for (var s = r > 1 ? void 0 : r ?
|
|
6214
|
+
var xr = Object.defineProperty, wr = Object.getOwnPropertyDescriptor, _t = (e, t, o, r) => {
|
|
6215
|
+
for (var s = r > 1 ? void 0 : r ? wr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
|
|
6118
6216
|
(a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
|
|
6119
|
-
return r && s &&
|
|
6217
|
+
return r && s && xr(t, o, s), s;
|
|
6120
6218
|
};
|
|
6121
6219
|
let rt = class extends N {
|
|
6122
6220
|
constructor() {
|
|
@@ -6179,16 +6277,16 @@ let rt = class extends N {
|
|
|
6179
6277
|
const e = this.querySelector("pc-poll, pc-reaction");
|
|
6180
6278
|
if (!e) return;
|
|
6181
6279
|
const t = this.querySelectorAll("poll-catch-option");
|
|
6182
|
-
let r =
|
|
6280
|
+
let r = Bo(this.options).map((s) => ({
|
|
6183
6281
|
value: s,
|
|
6184
6282
|
label: s,
|
|
6185
6283
|
icon: e.tagName === "PC-REACTION" ? s : void 0
|
|
6186
6284
|
// REACTION widget uses options for the icon
|
|
6187
6285
|
}));
|
|
6188
6286
|
t && t.length > 0 && (r = Array.from(t).map((s) => {
|
|
6189
|
-
const i = at(s, "value", "") || "", a = at(s, "label",
|
|
6287
|
+
const i = at(s, "value", "") || "", a = at(s, "label", yr(s, i)) || "", l = at(s, "icon", void 0), n = at(s, "tooltip", void 0), d = at(s, "disabled", void 0), p = { value: i, label: a };
|
|
6190
6288
|
if (l !== void 0) {
|
|
6191
|
-
const h =
|
|
6289
|
+
const h = kt(l);
|
|
6192
6290
|
p.icon = h.icon;
|
|
6193
6291
|
}
|
|
6194
6292
|
return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
|
|
@@ -6214,16 +6312,16 @@ let rt = class extends N {
|
|
|
6214
6312
|
}
|
|
6215
6313
|
}
|
|
6216
6314
|
};
|
|
6217
|
-
|
|
6315
|
+
_t([
|
|
6218
6316
|
f({ type: String })
|
|
6219
6317
|
], rt.prototype, "type", 2);
|
|
6220
|
-
|
|
6318
|
+
_t([
|
|
6221
6319
|
f({ type: String })
|
|
6222
6320
|
], rt.prototype, "options", 2);
|
|
6223
|
-
|
|
6321
|
+
_t([
|
|
6224
6322
|
k()
|
|
6225
6323
|
], rt.prototype, "parsedOptions", 2);
|
|
6226
|
-
rt =
|
|
6324
|
+
rt = _t([
|
|
6227
6325
|
H("poll-catch")
|
|
6228
6326
|
], rt);
|
|
6229
6327
|
export {
|