pollcatch 2.2.3 → 2.2.5

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pc.js +173 -160
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pollcatch",
3
3
  "private": false,
4
- "version": "2.2.3",
4
+ "version": "2.2.5",
5
5
  "type": "module",
6
6
  "main": "pc.js",
7
7
  "module": "pc.js",
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 it = globalThis, _t = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Et = Symbol(), Lt = /* @__PURE__ */ new WeakMap();
6
+ const it = globalThis, Et = it.ShadowRoot && (it.ShadyCSS === void 0 || it.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Pt = Symbol(), jt = /* @__PURE__ */ new WeakMap();
7
7
  let le = class {
8
8
  constructor(t, o, r) {
9
- if (this._$cssResult$ = !0, r !== Et) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
9
+ if (this._$cssResult$ = !0, r !== Pt) 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 (_t && t === void 0) {
15
+ if (Et && t === void 0) {
16
16
  const r = o !== void 0 && o.length === 1;
17
- r && (t = Lt.get(o)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), r && Lt.set(o, 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,20 +22,20 @@ let le = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e, ...t) => {
25
+ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Pt), F = (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 le(o, e, Et);
31
+ return new le(o, e, Pt);
32
32
  }, _e = (e, t) => {
33
- if (_t) e.adoptedStyleSheets = t.map((o) => o instanceof CSSStyleSheet ? o : o.styleSheet);
33
+ if (Et) 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 = it.litNonce;
36
36
  s !== void 0 && r.setAttribute("nonce", s), r.textContent = o.cssText, e.appendChild(r);
37
37
  }
38
- }, jt = _t ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
38
+ }, Ut = Et ? (e) => e : (e) => e instanceof CSSStyleSheet ? ((t) => {
39
39
  let o = "";
40
40
  for (const r of t.cssRules) o += r.cssText;
41
41
  return Ae(o);
@@ -45,7 +45,7 @@ const Ae = (e) => new le(typeof e == "string" ? e : e + "", void 0, Et), F = (e,
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis, Ut = T.trustedTypes, Ne = Ut ? Ut.emptyScript : "", bt = T.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
48
+ const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnPropertyNames: Te, getOwnPropertySymbols: ze, getPrototypeOf: Ie } = Object, T = globalThis, Bt = T.trustedTypes, Ne = Bt ? Bt.emptyScript : "", bt = T.reactiveElementPolyfillSupport, K = (e, t) => e, at = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
51
  e = e ? Ne : null;
@@ -73,7 +73,7 @@ const { is: Ee, defineProperty: Pe, getOwnPropertyDescriptor: Oe, getOwnProperty
73
73
  }
74
74
  }
75
75
  return o;
76
- } }, Pt = (e, t) => !Ee(e, t), Bt = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Pt };
76
+ } }, Ot = (e, t) => !Ee(e, t), Dt = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Ot };
77
77
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), T.litPropertyMetadata ?? (T.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
78
  let j = class extends HTMLElement {
79
79
  static addInitializer(t) {
@@ -82,7 +82,7 @@ let j = 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 = Bt) {
85
+ static createProperty(t, o = Dt) {
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
88
  s !== void 0 && Pe(this.prototype, t, s);
@@ -102,7 +102,7 @@ let j = class extends HTMLElement {
102
102
  }, configurable: !0, enumerable: !0 };
103
103
  }
104
104
  static getPropertyOptions(t) {
105
- return this.elementProperties.get(t) ?? Bt;
105
+ return this.elementProperties.get(t) ?? Dt;
106
106
  }
107
107
  static _$Ei() {
108
108
  if (this.hasOwnProperty(K("elementProperties"))) return;
@@ -131,8 +131,8 @@ let j = 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(jt(s));
135
- } else t !== void 0 && o.push(jt(t));
134
+ for (const s of r) o.unshift(Ut(s));
135
+ } else t !== void 0 && o.push(Ut(t));
136
136
  return o;
137
137
  }
138
138
  static _$Eu(t, o) {
@@ -200,7 +200,7 @@ let j = class extends HTMLElement {
200
200
  }
201
201
  requestUpdate(t, o, r) {
202
202
  if (t !== void 0) {
203
- if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Pt)(this[t], o)) return;
203
+ if (r ?? (r = this.constructor.getPropertyOptions(t)), !(r.hasChanged ?? Ot)(this[t], o)) return;
204
204
  this.P(t, o, r);
205
205
  }
206
206
  this.isUpdatePending === !1 && (this._$ES = this._$ET());
@@ -279,26 +279,26 @@ j.elementStyles = [], j.shadowRootOptions = { mode: "open" }, j[K("elementProper
279
279
  * Copyright 2017 Google LLC
280
280
  * SPDX-License-Identifier: BSD-3-Clause
281
281
  */
282
- const W = globalThis, nt = W.trustedTypes, Dt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ce = "$lit$", P = `lit$${Math.random().toFixed(9).slice(2)}$`, de = "?" + P, Me = `<${de}>`, R = document, X = () => R.createComment(""), Q = (e) => e === null || typeof e != "object" && typeof e != "function", Ot = Array.isArray, Re = (e) => Ot(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", gt = `[
283
- \f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Vt = /-->/g, qt = />/g, N = RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), Ht = /'/g, Ft = /"/g, pe = /^(?:script|style|textarea|title)$/i, Le = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Le(1), z = Symbol.for("lit-noChange"), h = Symbol.for("lit-nothing"), Yt = /* @__PURE__ */ new WeakMap(), M = R.createTreeWalker(R, 129);
282
+ const W = globalThis, nt = W.trustedTypes, Vt = nt ? nt.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, ce = "$lit$", O = `lit$${Math.random().toFixed(9).slice(2)}$`, de = "?" + O, Me = `<${de}>`, L = document, X = () => L.createComment(""), Q = (e) => e === null || typeof e != "object" && typeof e != "function", Tt = Array.isArray, Le = (e) => Tt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", gt = `[
283
+ \f\r]`, Z = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, qt = /-->/g, Ht = />/g, N = RegExp(`>|${gt}(?:([^\\s"'>=/]+)(${gt}*=${gt}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), Ft = /'/g, Yt = /"/g, pe = /^(?:script|style|textarea|title)$/i, Re = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), d = Re(1), z = Symbol.for("lit-noChange"), h = Symbol.for("lit-nothing"), Zt = /* @__PURE__ */ new WeakMap(), M = L.createTreeWalker(L, 129);
285
285
  function ue(e, t) {
286
- if (!Ot(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
- return Dt !== void 0 ? Dt.createHTML(t) : t;
286
+ if (!Tt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
+ return Vt !== void 0 ? Vt.createHTML(t) : t;
288
288
  }
289
289
  const je = (e, t) => {
290
290
  const o = e.length - 1, r = [];
291
291
  let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = Z;
292
292
  for (let n = 0; n < o; n++) {
293
293
  const l = e[n];
294
- let p, c, u = -1, w = 0;
295
- for (; w < l.length && (a.lastIndex = w, c = a.exec(l), c !== null); ) w = a.lastIndex, a === Z ? c[1] === "!--" ? a = Vt : c[1] !== void 0 ? a = qt : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = N) : c[3] !== void 0 && (a = N) : a === N ? c[0] === ">" ? (a = s ?? Z, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? N : c[3] === '"' ? Ft : Ht) : a === Ft || a === Ht ? a = N : a === Vt || a === qt ? a = Z : (a = N, s = void 0);
296
- const v = a === N && e[n + 1].startsWith("/>") ? " " : "";
297
- i += a === Z ? l + Me : u >= 0 ? (r.push(p), l.slice(0, u) + ce + l.slice(u) + P + v) : l + P + (u === -2 ? n : v);
294
+ let p, c, u = -1, v = 0;
295
+ for (; v < l.length && (a.lastIndex = v, c = a.exec(l), c !== null); ) v = a.lastIndex, a === Z ? c[1] === "!--" ? a = qt : c[1] !== void 0 ? a = Ht : c[2] !== void 0 ? (pe.test(c[2]) && (s = RegExp("</" + c[2], "g")), a = N) : c[3] !== void 0 && (a = N) : a === N ? c[0] === ">" ? (a = s ?? Z, u = -1) : c[1] === void 0 ? u = -2 : (u = a.lastIndex - c[2].length, p = c[1], a = c[3] === void 0 ? N : c[3] === '"' ? Yt : Ft) : a === Yt || a === Ft ? a = N : a === qt || a === Ht ? a = Z : (a = N, s = void 0);
296
+ const y = a === N && e[n + 1].startsWith("/>") ? " " : "";
297
+ i += a === Z ? l + Me : u >= 0 ? (r.push(p), l.slice(0, u) + ce + l.slice(u) + O + y) : l + O + (u === -2 ? n : y);
298
298
  }
299
299
  return [ue(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
301
- let At = class he {
301
+ let _t = class he {
302
302
  constructor({ strings: t, _$litType$: o }, r) {
303
303
  let s;
304
304
  this.parts = [];
@@ -311,27 +311,27 @@ let At = class he {
311
311
  for (; (s = M.nextNode()) !== null && l.length < n; ) {
312
312
  if (s.nodeType === 1) {
313
313
  if (s.hasAttributes()) for (const u of s.getAttributeNames()) if (u.endsWith(ce)) {
314
- const w = c[a++], v = s.getAttribute(u).split(P), E = /([.?@])?(.*)/.exec(w);
315
- l.push({ type: 1, index: i, name: E[2], strings: v, ctor: E[1] === "." ? Be : E[1] === "?" ? De : E[1] === "@" ? Ve : dt }), s.removeAttribute(u);
316
- } else u.startsWith(P) && (l.push({ type: 6, index: i }), s.removeAttribute(u));
314
+ const v = c[a++], y = s.getAttribute(u).split(O), P = /([.?@])?(.*)/.exec(v);
315
+ l.push({ type: 1, index: i, name: P[2], strings: y, ctor: P[1] === "." ? Be : P[1] === "?" ? De : P[1] === "@" ? Ve : dt }), s.removeAttribute(u);
316
+ } else u.startsWith(O) && (l.push({ type: 6, index: i }), s.removeAttribute(u));
317
317
  if (pe.test(s.tagName)) {
318
- const u = s.textContent.split(P), w = u.length - 1;
319
- if (w > 0) {
318
+ const u = s.textContent.split(O), v = u.length - 1;
319
+ if (v > 0) {
320
320
  s.textContent = nt ? nt.emptyScript : "";
321
- for (let v = 0; v < w; v++) s.append(u[v], X()), M.nextNode(), l.push({ type: 2, index: ++i });
322
- s.append(u[w], X());
321
+ for (let y = 0; y < v; y++) s.append(u[y], X()), M.nextNode(), l.push({ type: 2, index: ++i });
322
+ s.append(u[v], X());
323
323
  }
324
324
  }
325
325
  } else if (s.nodeType === 8) if (s.data === de) l.push({ type: 2, index: i });
326
326
  else {
327
327
  let u = -1;
328
- for (; (u = s.data.indexOf(P, u + 1)) !== -1; ) l.push({ type: 7, index: i }), u += P.length - 1;
328
+ for (; (u = s.data.indexOf(O, u + 1)) !== -1; ) l.push({ type: 7, index: i }), u += O.length - 1;
329
329
  }
330
330
  i++;
331
331
  }
332
332
  }
333
333
  static createElement(t, o) {
334
- const r = R.createElement("template");
334
+ const r = L.createElement("template");
335
335
  return r.innerHTML = t, r;
336
336
  }
337
337
  };
@@ -353,7 +353,7 @@ let Ue = class {
353
353
  return this._$AM._$AU;
354
354
  }
355
355
  u(t) {
356
- const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? R).importNode(o, !0);
356
+ const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? L).importNode(o, !0);
357
357
  M.currentNode = s;
358
358
  let i = M.nextNode(), a = 0, n = 0, l = r[0];
359
359
  for (; l !== void 0; ) {
@@ -363,7 +363,7 @@ let Ue = class {
363
363
  }
364
364
  a !== (l == null ? void 0 : l.index) && (i = M.nextNode(), a++);
365
365
  }
366
- return M.currentNode = R, s;
366
+ return M.currentNode = L, s;
367
367
  }
368
368
  p(t) {
369
369
  let o = 0;
@@ -390,7 +390,7 @@ class et {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(t, o = this) {
393
- t = D(this, t, o), Q(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Re(t) ? this.k(t) : this._(t);
393
+ t = D(this, t, o), Q(t) ? t === h || t == null || t === "" ? (this._$AH !== h && this._$AR(), this._$AH = h) : t !== this._$AH && t !== z && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Le(t) ? this.k(t) : this._(t);
394
394
  }
395
395
  O(t) {
396
396
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,11 +399,11 @@ class et {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== h && Q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(R.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== h && Q(this._$AH) ? this._$AA.nextSibling.data = t : this.T(L.createTextNode(t)), this._$AH = t;
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 = At.createElement(ue(r.h, r.h[0]), this.options)), r);
406
+ const { values: o, _$litType$: r } = t, s = typeof r == "number" ? this._$AC(t) : (r.el === void 0 && (r.el = _t.createElement(ue(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
409
  const a = new Ue(s, this), n = a.u(this.options);
@@ -411,11 +411,11 @@ class et {
411
411
  }
412
412
  }
413
413
  _$AC(t) {
414
- let o = Yt.get(t.strings);
415
- return o === void 0 && Yt.set(t.strings, o = new At(t)), o;
414
+ let o = Zt.get(t.strings);
415
+ return o === void 0 && Zt.set(t.strings, o = new _t(t)), o;
416
416
  }
417
417
  k(t) {
418
- Ot(this._$AH) || (this._$AH = [], this._$AR());
418
+ Tt(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 et(this.O(X()), this.O(X()), this, this.options)) : r = o[s], r._$AI(i), s++;
@@ -500,7 +500,7 @@ class qe {
500
500
  }
501
501
  }
502
502
  const vt = W.litHtmlPolyfillSupport;
503
- vt == null || vt(At, et), (W.litHtmlVersions ?? (W.litHtmlVersions = [])).push("3.2.1");
503
+ vt == null || vt(_t, et), (W.litHtmlVersions ?? (W.litHtmlVersions = [])).push("3.2.1");
504
504
  const He = (e, t, o) => {
505
505
  const r = (o == null ? void 0 : o.renderBefore) ?? t;
506
506
  let s = r._$litPart$;
@@ -560,7 +560,7 @@ const ot = (e) => (t, o) => {
560
560
  * Copyright 2017 Google LLC
561
561
  * SPDX-License-Identifier: BSD-3-Clause
562
562
  */
563
- const Fe = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Pt }, Ye = (e = Fe, t, o) => {
563
+ const Fe = { attribute: !0, type: String, converter: at, reflect: !1, hasChanged: Ot }, Ye = (e = Fe, 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") {
@@ -592,7 +592,7 @@ function f(e) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function Tt(e) {
595
+ function zt(e) {
596
596
  return f({ ...e, state: !0, attribute: !1 });
597
597
  }
598
598
  var x = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(x || {});
@@ -651,7 +651,7 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
651
651
  return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
652
652
  }, fe = function(e) {
653
653
  return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
654
- }, Zt = function(e) {
654
+ }, Gt = function(e) {
655
655
  return { r: S(e.r, 0, 255), g: S(e.g, 0, 255), b: S(e.b, 0, 255), a: S(e.a) };
656
656
  }, wt = function(e) {
657
657
  return { r: $(e.r), g: $(e.g), b: $(e.b), a: $(e.a, 3) };
@@ -666,35 +666,35 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
666
666
  t = t / 360 * 6, o /= 100, r /= 100;
667
667
  var i = Math.floor(t), a = r * (1 - o), n = r * (1 - (t - i) * o), l = r * (1 - (1 - t + i) * o), p = i % 6;
668
668
  return { r: 255 * [r, n, a, a, l, r][p], g: 255 * [l, r, r, n, a, a][p], b: 255 * [a, a, l, r, r, n][p], a: s };
669
- }, Gt = function(e) {
670
- return { h: fe(e.h), s: S(e.s, 0, 100), l: S(e.l, 0, 100), a: S(e.a) };
671
669
  }, Kt = function(e) {
672
- return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
670
+ return { h: fe(e.h), s: S(e.s, 0, 100), l: S(e.l, 0, 100), a: S(e.a) };
673
671
  }, Wt = function(e) {
672
+ return { h: $(e.h), s: $(e.s), l: $(e.l), a: $(e.a, 3) };
673
+ }, Jt = function(e) {
674
674
  return be((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 }));
675
675
  var t, o, r;
676
676
  }, J = function(e) {
677
677
  return { h: (t = me(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 };
678
678
  var t, o, r, s;
679
- }, Qe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, to = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, eo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, oo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Jt = { string: [[function(e) {
679
+ }, Qe = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, to = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, eo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, oo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, Xt = { string: [[function(e) {
680
680
  var t = Xe.exec(e);
681
681
  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;
682
682
  }, "hex"], [function(e) {
683
683
  var t = eo.exec(e) || oo.exec(e);
684
- return t ? t[2] !== t[4] || t[4] !== t[6] ? null : Zt({ 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;
684
+ return t ? t[2] !== t[4] || t[4] !== t[6] ? null : Gt({ 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;
685
685
  }, "rgb"], [function(e) {
686
686
  var t = Qe.exec(e) || to.exec(e);
687
687
  if (!t) return null;
688
- var o, r, s = Gt({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (Je[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
689
- return Wt(s);
688
+ var o, r, s = Kt({ h: (o = t[1], r = t[2], r === void 0 && (r = "deg"), Number(o) * (Je[r] || 1)), s: Number(t[3]), l: Number(t[4]), a: t[5] === void 0 ? 1 : Number(t[5]) / (t[6] ? 100 : 1) });
689
+ return Jt(s);
690
690
  }, "hsl"]], object: [[function(e) {
691
691
  var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
692
- return A(t) && A(o) && A(r) ? Zt({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
692
+ return A(t) && A(o) && A(r) ? Gt({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
693
693
  }, "rgb"], [function(e) {
694
694
  var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
695
695
  if (!A(t) || !A(o) || !A(r)) return null;
696
- var a = Gt({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
697
- return Wt(a);
696
+ var a = Kt({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
697
+ return Jt(a);
698
698
  }, "hsl"], [function(e) {
699
699
  var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
700
700
  if (!A(t) || !A(o) || !A(r)) return null;
@@ -702,23 +702,23 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
702
702
  return { h: fe(n.h), s: S(n.s, 0, 100), v: S(n.v, 0, 100), a: S(n.a) };
703
703
  }({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
704
704
  return be(a);
705
- }, "hsv"]] }, Xt = function(e, t) {
705
+ }, "hsv"]] }, Qt = function(e, t) {
706
706
  for (var o = 0; o < t.length; o++) {
707
707
  var r = t[o][0](e);
708
708
  if (r) return [r, t[o][1]];
709
709
  }
710
710
  return [null, void 0];
711
711
  }, ro = function(e) {
712
- return typeof e == "string" ? Xt(e.trim(), Jt.string) : typeof e == "object" && e !== null ? Xt(e, Jt.object) : [null, void 0];
712
+ return typeof e == "string" ? Qt(e.trim(), Xt.string) : typeof e == "object" && e !== null ? Qt(e, Xt.object) : [null, void 0];
713
713
  }, $t = function(e, t) {
714
714
  var o = J(e);
715
715
  return { h: o.h, s: S(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
716
716
  }, xt = function(e) {
717
717
  return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
718
- }, Qt = function(e, t) {
718
+ }, te = function(e, t) {
719
719
  var o = J(e);
720
720
  return { h: o.h, s: o.s, l: S(o.l + 100 * t, 0, 100), a: o.a };
721
- }, te = function() {
721
+ }, ee = function() {
722
722
  function e(t) {
723
723
  this.parsed = ro(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
724
724
  }
@@ -739,9 +739,9 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
739
739
  return t = wt(this.rgba), o = t.r, r = t.g, s = t.b, (i = t.a) < 1 ? "rgba(" + o + ", " + r + ", " + s + ", " + i + ")" : "rgb(" + o + ", " + r + ", " + s + ")";
740
740
  var t, o, r, s, i;
741
741
  }, e.prototype.toHsl = function() {
742
- return Kt(J(this.rgba));
742
+ return Wt(J(this.rgba));
743
743
  }, e.prototype.toHslString = function() {
744
- return t = Kt(J(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
744
+ return t = Wt(J(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
745
745
  var t, o, r, s, i;
746
746
  }, e.prototype.toHsv = function() {
747
747
  return t = me(this.rgba), { h: $(t.h), s: $(t.s), v: $(t.v), a: $(t.a, 3) };
@@ -756,9 +756,9 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
756
756
  }, e.prototype.grayscale = function() {
757
757
  return C($t(this.rgba, -1));
758
758
  }, e.prototype.lighten = function(t) {
759
- return t === void 0 && (t = 0.1), C(Qt(this.rgba, t));
759
+ return t === void 0 && (t = 0.1), C(te(this.rgba, t));
760
760
  }, e.prototype.darken = function(t) {
761
- return t === void 0 && (t = 0.1), C(Qt(this.rgba, -t));
761
+ return t === void 0 && (t = 0.1), C(te(this.rgba, -t));
762
762
  }, e.prototype.rotate = function(t) {
763
763
  return t === void 0 && (t = 15), this.hue(this.hue() + t);
764
764
  }, e.prototype.alpha = function(t) {
@@ -771,7 +771,7 @@ var Je = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, A = function(e) {
771
771
  return this.toHex() === C(t).toHex();
772
772
  }, e;
773
773
  }(), C = function(e) {
774
- return e instanceof te ? e : new te(e);
774
+ return e instanceof ee ? e : new ee(e);
775
775
  };
776
776
  const St = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
777
777
  function so(e) {
@@ -814,10 +814,10 @@ function ao(e) {
814
814
  return io[t] || null;
815
815
  }
816
816
  function Ct(e, t) {
817
- const o = ee(e), r = ee(t), s = Math.max(o, r), i = Math.min(o, r);
817
+ const o = oe(e), r = oe(t), s = Math.max(o, r), i = Math.min(o, r);
818
818
  return (s + 0.05) / (i + 0.05);
819
819
  }
820
- function ee(e) {
820
+ function oe(e) {
821
821
  const t = lo(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), n = s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
822
822
  return 0.2126 * i + 0.7152 * a + 0.0722 * n;
823
823
  }
@@ -843,8 +843,8 @@ function no(e, t = {}) {
843
843
  l = a, p = c;
844
844
  for (const u of n) {
845
845
  if (u === a) continue;
846
- const w = Ct(e, u);
847
- w > p && (p = w, l = u);
846
+ const v = Ct(e, u);
847
+ v > p && (p = v, l = u);
848
848
  }
849
849
  b.warn(
850
850
  `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${l} with contrast ratio ${p.toFixed(2)}:1 instead.`
@@ -871,17 +871,17 @@ function k(e, t) {
871
871
  }[t] : void 0;
872
872
  return e === "left" || e === "right" ? r || "center" : e === "top" || e === "bottom" ? r || "start" : r || "center";
873
873
  }
874
- function oe(e, t = "1rem", o = 1) {
874
+ function kt(e, t = "1rem", o = 1) {
875
875
  if (!e) return t;
876
876
  const r = {
877
- xs: 0.75,
878
- sm: 0.875,
877
+ xs: 0.7,
878
+ sm: 0.8,
879
879
  md: 1,
880
- lg: 1.25,
880
+ lg: 1.2,
881
881
  xl: 1.5
882
882
  }, s = e.toLowerCase().trim();
883
883
  if (r[s] !== void 0)
884
- return `${r[s] * o}rem`;
884
+ return `${r[s] * o}em`;
885
885
  const i = e.trim().replace(/\s+/g, " ");
886
886
  if (/\d+(\.\d+)?\s*(px|em|rem|%|vh|vw|pt|pc|in|cm|mm|ex|ch|vmin|vmax)$/i.test(
887
887
  i
@@ -937,7 +937,7 @@ function uo(e, t, o, r = !1) {
937
937
  ariaDisabled: o
938
938
  });
939
939
  }
940
- function kt(e, t, o) {
940
+ function At(e, t, o) {
941
941
  typeof o == "boolean" ? e.setAttribute(t, o ? "true" : "false") : e.setAttribute(t, o);
942
942
  }
943
943
  function ho(e) {
@@ -946,7 +946,7 @@ function ho(e) {
946
946
  const t = e.replace(/[<>"']/g, "").trim();
947
947
  return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
948
948
  }
949
- function L(e) {
949
+ function R(e) {
950
950
  return ho(e) ? e.replace(/[<>"']/g, "").trim() : (b.warn("Invalid color value:", e), "#000000");
951
951
  }
952
952
  function fo(e) {
@@ -968,7 +968,7 @@ function se() {
968
968
  return (e === "x" ? t : t & 3 | 8).toString(16);
969
969
  }));
970
970
  }
971
- function zt() {
971
+ function It() {
972
972
  const e = "test-local-storage";
973
973
  try {
974
974
  return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
@@ -1007,7 +1007,7 @@ async function vo() {
1007
1007
  }
1008
1008
  async function ie() {
1009
1009
  const e = bo, t = go;
1010
- if (zt()) {
1010
+ if (It()) {
1011
1011
  const o = ve(e);
1012
1012
  if (o && o.id && o.timestamp && Date.now() - o.timestamp < t)
1013
1013
  return b.debug("Using existing session ID from localStorage"), o.id;
@@ -1038,7 +1038,7 @@ function lt(e) {
1038
1038
  const s = t / r * 100, i = o / r * 100;
1039
1039
  return Math.round(s - i);
1040
1040
  }
1041
- function O() {
1041
+ function E() {
1042
1042
  return {
1043
1043
  count: 0,
1044
1044
  sum: 0,
@@ -1049,17 +1049,17 @@ function O() {
1049
1049
  };
1050
1050
  }
1051
1051
  function yo(e) {
1052
- if (!zt())
1053
- return O();
1052
+ if (!It())
1053
+ return E();
1054
1054
  try {
1055
1055
  const t = ve(e);
1056
- return t ? { ...O(), ...t } : O();
1056
+ return t ? { ...E(), ...t } : E();
1057
1057
  } catch (t) {
1058
- return b.warn("Failed to load localStats from localStorage", t), O();
1058
+ return b.warn("Failed to load localStats from localStorage", t), E();
1059
1059
  }
1060
1060
  }
1061
1061
  function wo(e, t) {
1062
- if (!zt())
1062
+ if (!It())
1063
1063
  return !1;
1064
1064
  try {
1065
1065
  return ye(e, t) ? (b.debug("Saved localStats to localStorage", t), !0) : !1;
@@ -1084,7 +1084,7 @@ function $o(e, t) {
1084
1084
  }
1085
1085
  function xo(e, t) {
1086
1086
  if (!e.count && !t.count)
1087
- return O();
1087
+ return E();
1088
1088
  if (!e.count)
1089
1089
  return { ...t };
1090
1090
  const o = {
@@ -1155,7 +1155,7 @@ function Ao(e, t = 50) {
1155
1155
  class _o {
1156
1156
  // Tracks if user has ever made a selection (even if later deselected)
1157
1157
  constructor(t) {
1158
- this.stats = O(), this.localStats = O(), this.isLoading = !0, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1158
+ this.stats = E(), this.localStats = E(), this.prevLocalStats = E(), this.isLoading = !0, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1159
1159
  }
1160
1160
  hostConnected() {
1161
1161
  this.loadStats();
@@ -1184,11 +1184,11 @@ class _o {
1184
1184
  const o = await this.getProjectId(), r = t.name, s = t.type;
1185
1185
  let i;
1186
1186
  if (t.dataFunc && typeof window < "u") {
1187
- const w = t.dataFunc.replace(/^window\./, "").split(".");
1188
- let v = window;
1189
- for (const E of w)
1190
- if (v = v == null ? void 0 : v[E], v === void 0) break;
1191
- i = v;
1187
+ const v = t.dataFunc.replace(/^window\./, "").split(".");
1188
+ let y = window;
1189
+ for (const P of v)
1190
+ if (y = y == null ? void 0 : y[P], y === void 0) break;
1191
+ i = y;
1192
1192
  }
1193
1193
  let a, n;
1194
1194
  if (i && typeof i == "function") {
@@ -1207,12 +1207,12 @@ class _o {
1207
1207
  const u = t.dataEndpoint || re;
1208
1208
  if (!r)
1209
1209
  throw new Error("Name parameter is required");
1210
- const w = `${u}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
1210
+ const v = `${u}/${encodeURIComponent(o)}/${encodeURIComponent(r)}`;
1211
1211
  b.debug(`Fetching stats for: ${r}`, { endpoint: u, projectKey: o });
1212
- const v = await fetch(w);
1213
- if (!v.ok)
1214
- throw new Error(`API request failed with status: ${v.status}`);
1215
- if (a = await v.json(), !a.success)
1212
+ const y = await fetch(v);
1213
+ if (!y.ok)
1214
+ throw new Error(`API request failed with status: ${y.status}`);
1215
+ if (a = await y.json(), !a.success)
1216
1216
  throw b.error("Backend returned unsuccessful response", a), new Error("Backend returned unsuccessful response");
1217
1217
  n = a.data || {};
1218
1218
  }
@@ -1259,9 +1259,9 @@ class _o {
1259
1259
  const t = await this.getLocalStatsKey();
1260
1260
  try {
1261
1261
  const o = yo(t);
1262
- b.debug("Loaded localStats from localStorage", o), this.localStats = o;
1262
+ b.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1263
1263
  } catch (o) {
1264
- b.warn("Failed to generate localStorage key for localStats", o), this.localStats = O();
1264
+ b.warn("Failed to generate localStorage key for localStats", o), this.localStats = E();
1265
1265
  }
1266
1266
  this.host.requestUpdate();
1267
1267
  }
@@ -1302,14 +1302,14 @@ class _o {
1302
1302
  this.stats = xo(this.stats, this.localStats), b.debug("Stats updated - remote: ", this.stats), b.debug("Stats updated - local: ", this.stats), this.persistLocalStats(), this.host.requestUpdate();
1303
1303
  }
1304
1304
  async markStatsAsSubmitted() {
1305
- this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), await this.persistLocalStats(), this.host.requestUpdate();
1305
+ this.localStats.submitted = (/* @__PURE__ */ new Date()).toISOString(), this.prevLocalStats = { ...this.localStats }, await this.persistLocalStats(), this.host.requestUpdate();
1306
1306
  }
1307
1307
  async submitStats() {
1308
1308
  if (!this.hasLocalStats() && !this.hasInteracted)
1309
1309
  throw b.warn("No local stats to submit"), new Error("No local stats to submit");
1310
- const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await ie(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, n = Object.keys(this.localStats.breakdown || {});
1310
+ const t = this.host, o = Math.floor(Date.now() / 1e3).toString(), r = await ie(), s = await this.getProjectId(), i = t.name || "", a = this.localStats.sum, n = Object.keys(this.localStats.breakdown || {}), l = this.prevLocalStats.sum, p = Object.keys(this.prevLocalStats.breakdown || {});
1311
1311
  this.isSubmitting = !0, this.host.requestUpdate();
1312
- const l = {
1312
+ const c = {
1313
1313
  sessionId: r,
1314
1314
  projectId: s,
1315
1315
  widgetName: i,
@@ -1317,17 +1317,19 @@ class _o {
1317
1317
  url: window.location.href,
1318
1318
  numericValue: a,
1319
1319
  textValues: n,
1320
+ prevNumericValue: l,
1321
+ prevTextValues: p,
1320
1322
  metadata: t.metadata,
1321
1323
  timestamp: o
1322
- }, p = ko(JSON.stringify(l), o);
1324
+ }, u = ko(JSON.stringify(c), o);
1323
1325
  try {
1324
- await this.sendStats({ ...l, hash: p }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(l);
1325
- } catch (c) {
1326
- b.warn("Failed to send stats event", c);
1326
+ await this.sendStats({ ...c, hash: u }), await this.markStatsAsSubmitted(), this.dispatchSubmitEvent(c);
1327
+ } catch (v) {
1328
+ b.warn("Failed to send stats event", v);
1327
1329
  } finally {
1328
1330
  this.isSubmitting = !1, this.host.requestUpdate();
1329
1331
  }
1330
- return l;
1332
+ return c;
1331
1333
  }
1332
1334
  async sendStats(t) {
1333
1335
  const o = JSON.stringify(t), r = this.host, s = r.dataEndpoint || re;
@@ -1544,7 +1546,7 @@ class Eo {
1544
1546
  return !(t.readOnly || !this.isEditing || t.lockAnswer && this.dataController.hasSubmittedStats());
1545
1547
  }
1546
1548
  }
1547
- var It = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(It || {});
1549
+ var Nt = /* @__PURE__ */ ((e) => (e.DECORATIVE = "decorative", e.FUNCTIONAL = "functional", e.STATUS = "status", e))(Nt || {});
1548
1550
  function $e(e, t = {}) {
1549
1551
  const { type: o = "functional", alt: r, ariaLabel: s, isSelected: i } = t;
1550
1552
  if (!e)
@@ -1597,7 +1599,7 @@ let Ce = class {
1597
1599
  * Copyright 2018 Google LLC
1598
1600
  * SPDX-License-Identifier: BSD-3-Clause
1599
1601
  */
1600
- const y = Se(class extends Ce {
1602
+ const w = Se(class extends Ce {
1601
1603
  constructor(e) {
1602
1604
  var t;
1603
1605
  if (super(e), e.type !== xe.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.");
@@ -1664,7 +1666,7 @@ const st = {
1664
1666
  let o = `:host {
1665
1667
  `;
1666
1668
  if (this.primaryColor) {
1667
- const i = L(this.primaryColor);
1669
+ const i = R(this.primaryColor);
1668
1670
  o += `--pc-primary-color: ${i} !important;
1669
1671
  `;
1670
1672
  const a = no(i, {
@@ -1675,35 +1677,40 @@ const st = {
1675
1677
  `;
1676
1678
  }
1677
1679
  if (this.muteColor) {
1678
- const i = L(this.muteColor);
1680
+ const i = R(this.muteColor);
1679
1681
  o += `--pc-mute-color: ${i} !important;
1680
1682
  `;
1681
1683
  }
1682
1684
  if (this.textColor) {
1683
- const i = L(this.textColor);
1685
+ const i = R(this.textColor);
1684
1686
  o += `--pc-text-color: ${i} !important;
1685
1687
  `;
1686
1688
  }
1687
1689
  if (this.backgroundColor) {
1688
- const i = L(this.backgroundColor);
1690
+ const i = R(this.backgroundColor);
1689
1691
  o += `--pc-background-color: ${i} !important;
1690
1692
  `;
1691
1693
  }
1692
1694
  const r = this.starColor || this.accentColor || this.primaryColor;
1693
1695
  if (r) {
1694
- const i = L(r);
1696
+ const i = R(r);
1695
1697
  o += `--pc-star-color: ${i} !important;
1696
1698
  `;
1697
1699
  }
1698
- const s = this.starHoverColor || (r ? `color-mix(in srgb, ${L(r)} 80%, white)` : null);
1700
+ const s = this.starHoverColor || (r ? `color-mix(in srgb, ${R(r)} 80%, white)` : null);
1699
1701
  if (s && (o += `--pc-star-hover-color: ${s} !important;
1700
1702
  `), this.starSize) {
1701
- const i = oe(this.starSize, "1rem", 1.5);
1703
+ const i = kt(this.starSize, "1.5em", 1.5);
1702
1704
  o += `--pc-stars-star-size: ${i} !important;
1705
+ `;
1706
+ }
1707
+ if (this.reactionSize) {
1708
+ const i = kt(this.reactionSize, "1em", 1);
1709
+ o += `--pc-reaction-size: ${i} !important;
1703
1710
  `;
1704
1711
  }
1705
1712
  if (this.size) {
1706
- const i = oe(this.size);
1713
+ const i = kt(this.size);
1707
1714
  o += `font-size: ${i} !important;
1708
1715
  `;
1709
1716
  }
@@ -1719,7 +1726,7 @@ const st = {
1719
1726
  * Update ARIA attributes for accessibility
1720
1727
  */
1721
1728
  updateAriaAttributes() {
1722
- this.ariaLabel && kt(this, "aria-label", this.ariaLabel), this.ariaDescribedby && kt(this, "aria-describedby", this.ariaDescribedby), kt(this, "aria-busy", this.dataController.isLoading ? "true" : "false");
1729
+ this.ariaLabel && At(this, "aria-label", this.ariaLabel), this.ariaDescribedby && At(this, "aria-describedby", this.ariaDescribedby), At(this, "aria-busy", this.dataController.isLoading ? "true" : "false");
1723
1730
  }
1724
1731
  /**
1725
1732
  * Update host CSS classes based on state
@@ -1805,7 +1812,7 @@ const st = {
1805
1812
  "pc-status": !0,
1806
1813
  [`pc-flex-content-${k(this.statsPosition, this.statsAlign)}`]: !0
1807
1814
  };
1808
- return d`<div class="${y(o)}" data-testid="pc-status">
1815
+ return d`<div class="${w(o)}" data-testid="pc-status">
1809
1816
  ${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
1810
1817
  </div>`;
1811
1818
  }
@@ -1968,6 +1975,9 @@ g([
1968
1975
  g([
1969
1976
  f({ type: String, attribute: "star-size" })
1970
1977
  ], m.prototype, "starSize");
1978
+ g([
1979
+ f({ type: String, attribute: "reaction-size" })
1980
+ ], m.prototype, "reactionSize");
1971
1981
  g([
1972
1982
  f({ type: String })
1973
1983
  ], m.prototype, "size");
@@ -2227,6 +2237,9 @@ const zo = F`
2227
2237
  --default-stars-hover-glow: rgba(255, 193, 7, 0.15);
2228
2238
  --default-stars-drop-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
2229
2239
 
2240
+ /* Reaction-specific defaults */
2241
+ --default-reaction-size: 1em;
2242
+
2230
2243
  /* NPS-specific defaults */
2231
2244
  --default-nps-button-height: clamp(1.6em, calc(1.5em + 0.5vw), 2.4em);
2232
2245
  --default-nps-button-width: clamp(1.4em, calc(1.2em + 0.3vw), 2em);
@@ -2680,7 +2693,7 @@ const zo = F`
2680
2693
  }
2681
2694
  }
2682
2695
  `;
2683
- function Nt(e, t = {}) {
2696
+ function Mt(e, t = {}) {
2684
2697
  if (!e || e.length === 0)
2685
2698
  return d`<div class="pc-bar-chart pc-bar-chart--empty">No data available</div>`;
2686
2699
  const o = Math.max(...e.map((i) => i.value)), s = { ...{
@@ -2739,7 +2752,7 @@ let I = class extends m {
2739
2752
  <button
2740
2753
  data-testid="nps-button-${s}"
2741
2754
  ?disabled=${!this.displayController.allowEdit()}
2742
- class=${y(a)}
2755
+ class=${w(a)}
2743
2756
  @click="${() => this.handleNumberClick(s)}"
2744
2757
  @mouseenter="${() => this.handleNumberHover(s)}"
2745
2758
  @focus="${() => this.handleNumberHover(s)}"
@@ -2781,7 +2794,7 @@ let I = class extends m {
2781
2794
  const e = ((a = this.dataController.stats) == null ? void 0 : a.breakdown) || {}, t = Object.values(e).reduce((n, l) => n + l, 0), o = Object.entries(e).map(([n, l]) => ({
2782
2795
  label: n,
2783
2796
  value: l
2784
- })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = Nt(o, {
2797
+ })), s = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", i = Mt(o, {
2785
2798
  barColor: s,
2786
2799
  labelFormatter: (n) => `${n.label}`,
2787
2800
  valueFormatter: (n) => `${t > 0 ? Math.round(n.value / t * 100) : 0}%`
@@ -2832,9 +2845,9 @@ let I = class extends m {
2832
2845
  [`pc-flex-align-${k(this.statsPosition, this.statsAlign)}`]: !0
2833
2846
  };
2834
2847
  return d`
2835
- <div class="pc-container ${y(e)}" data-testid="nps-container">
2848
+ <div class="pc-container ${w(e)}" data-testid="nps-container">
2836
2849
  ${this.renderLabelAtStart()}
2837
- <div class="pc-body ${y(t)}" data-testid="nps-body">
2850
+ <div class="pc-body ${w(t)}" data-testid="nps-body">
2838
2851
  ${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
2839
2852
  </div>
2840
2853
  ${this.renderLabelAtEnd()}
@@ -2856,7 +2869,7 @@ Y([
2856
2869
  f({ type: String, attribute: "min-max-position" })
2857
2870
  ], I.prototype, "minMaxPosition", 2);
2858
2871
  Y([
2859
- Tt()
2872
+ zt()
2860
2873
  ], I.prototype, "hoverValue", 2);
2861
2874
  I = Y([
2862
2875
  ot("pc-nps")
@@ -3118,10 +3131,10 @@ const Mo = F`
3118
3131
  visibility: hidden;
3119
3132
  }
3120
3133
  `;
3121
- var Ro = Object.defineProperty, Lo = Object.getOwnPropertyDescriptor, Mt = (e, t, o, r) => {
3122
- for (var s = r > 1 ? void 0 : r ? Lo(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3134
+ var Lo = Object.defineProperty, Ro = Object.getOwnPropertyDescriptor, Lt = (e, t, o, r) => {
3135
+ for (var s = r > 1 ? void 0 : r ? Ro(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3123
3136
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3124
- return r && s && Ro(t, o, s), s;
3137
+ return r && s && Lo(t, o, s), s;
3125
3138
  };
3126
3139
  let tt = class extends m {
3127
3140
  constructor() {
@@ -3132,7 +3145,7 @@ let tt = class extends m {
3132
3145
  "pc-status": !0,
3133
3146
  [`pc-flex-content-${k("bottom", this.statsAlign)}`]: !0
3134
3147
  };
3135
- return d`<div class="${y(t)}" data-testid="pc-status">
3148
+ return d`<div class="${w(t)}" data-testid="pc-status">
3136
3149
  <span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
3137
3150
  </div>`;
3138
3151
  }
@@ -3147,7 +3160,7 @@ let tt = class extends m {
3147
3160
  }, t = this.displayController.shouldDisableSubmitButton();
3148
3161
  return d`
3149
3162
  <button
3150
- class="${y(e)}"
3163
+ class="${w(e)}"
3151
3164
  data-testid="pc-submit-button"
3152
3165
  @click="${this.handleSubmit}"
3153
3166
  ?disabled="${t}"
@@ -3181,7 +3194,7 @@ let tt = class extends m {
3181
3194
  */
3182
3195
  renderOptionIcon(e) {
3183
3196
  if (!(e != null && e.icon)) return "";
3184
- const t = It.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = $e(e == null ? void 0 : e.icon, {
3197
+ const t = Nt.DECORATIVE, o = (e == null ? void 0 : e.label) || "", r = e ? this.dataController.isValueSelected(e.value) : !1, s = $e(e == null ? void 0 : e.icon, {
3185
3198
  type: t,
3186
3199
  alt: o,
3187
3200
  isSelected: r
@@ -3228,7 +3241,7 @@ let tt = class extends m {
3228
3241
  return d`
3229
3242
  <button
3230
3243
  data-testid="poll-option-i${t}"
3231
- class="${y(s)}"
3244
+ class="${w(s)}"
3232
3245
  @click="${() => this.handleClick(e)}"
3233
3246
  ?disabled="${r}"
3234
3247
  id="${a}-option-${t}"
@@ -3255,7 +3268,7 @@ let tt = class extends m {
3255
3268
  });
3256
3269
  return d`
3257
3270
  <div
3258
- class="${y({
3271
+ class="${w({
3259
3272
  "poll-container": !0
3260
3273
  })}"
3261
3274
  data-testid="poll-option-container"
@@ -3272,13 +3285,13 @@ let tt = class extends m {
3272
3285
  renderBarChart() {
3273
3286
  var l, p;
3274
3287
  const e = ((l = this.dataController.stats) == null ? void 0 : l.breakdown) || {}, t = ((p = this.dataController.localStats) == null ? void 0 : p.breakdown) || {}, o = Object.values(e).reduce((c, u) => c + u, 0), r = this.options.map((c, u) => {
3275
- const w = e[c.value] || 0, v = o > 0 ? Math.round(w / o * 100) : 0, E = (t[c.value] || 0) > 0;
3288
+ const v = e[c.value] || 0, y = o > 0 ? Math.round(v / o * 100) : 0, P = (t[c.value] || 0) > 0;
3276
3289
  return {
3277
3290
  option: c,
3278
3291
  index: u,
3279
- voteCount: w,
3280
- percentage: v,
3281
- isSelected: E
3292
+ voteCount: v,
3293
+ percentage: y,
3294
+ isSelected: P
3282
3295
  };
3283
3296
  }), s = this.multiple ? _.GROUP : _.RADIOGROUP, i = this.question || this.name || "Options", a = B({
3284
3297
  role: s,
@@ -3286,7 +3299,7 @@ let tt = class extends m {
3286
3299
  });
3287
3300
  return d`
3288
3301
  <div
3289
- class="${y({
3302
+ class="${w({
3290
3303
  "poll-container": !0
3291
3304
  })}"
3292
3305
  data-testid="poll-chart-container"
@@ -3302,7 +3315,7 @@ let tt = class extends m {
3302
3315
  };
3303
3316
  return d`
3304
3317
  <div
3305
- class="${y(u)}"
3318
+ class="${w(u)}"
3306
3319
  data-testid="poll-chart-item-${c.index}"
3307
3320
  role="listitem"
3308
3321
  aria-label="${c.option.label}: ${c.percentage}% (${c.voteCount} votes)"
@@ -3373,12 +3386,12 @@ let tt = class extends m {
3373
3386
  });
3374
3387
  return d`
3375
3388
  <div
3376
- class="pc-container ${y(t)}"
3389
+ class="pc-container ${w(t)}"
3377
3390
  data-testid="poll-container"
3378
3391
  ...=${s}
3379
3392
  >
3380
3393
  ${this.renderLabelAtStart()}
3381
- <div class="${y(r)}" data-testid="poll-body">
3394
+ <div class="${w(r)}" data-testid="poll-body">
3382
3395
  ${this.renderContent()} ${this.renderFooter()}
3383
3396
  </div>
3384
3397
  ${this.renderLabelAtEnd()}
@@ -3387,13 +3400,13 @@ let tt = class extends m {
3387
3400
  }
3388
3401
  };
3389
3402
  tt.styles = [...m.styles, ut, Mo];
3390
- Mt([
3403
+ Lt([
3391
3404
  f({ type: Boolean })
3392
3405
  ], tt.prototype, "multiple", 2);
3393
- Mt([
3406
+ Lt([
3394
3407
  f({ type: Boolean })
3395
3408
  ], tt.prototype, "compact", 2);
3396
- tt = Mt([
3409
+ tt = Lt([
3397
3410
  ot("pc-poll")
3398
3411
  ], tt);
3399
3412
  const jo = F`
@@ -3719,7 +3732,7 @@ let V = class extends m {
3719
3732
  <div class="pc-section" data-testid="pc-section">
3720
3733
  <span
3721
3734
  data-testid="stars-view-star-${n}"
3722
- class=${y(c)}
3735
+ class=${w(c)}
3723
3736
  style=${Bo(u)}
3724
3737
  role="${r ? "button" : "presentation"}"
3725
3738
  tabindex="${r ? "0" : ""}"
@@ -3748,7 +3761,7 @@ let V = class extends m {
3748
3761
  label: l,
3749
3762
  value: p,
3750
3763
  icon: o
3751
- })), i = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", a = Nt(r, {
3764
+ })), i = getComputedStyle(this).getPropertyValue("--pc-accent-color").trim() || "#ffc107", a = Mt(r, {
3752
3765
  barColor: i,
3753
3766
  labelFormatter: (l) => `${l.label} ${l.icon}`,
3754
3767
  valueFormatter: (l) => `${t > 0 ? Math.round(l.value / t * 100) : 0}%`
@@ -3769,9 +3782,9 @@ let V = class extends m {
3769
3782
  [`pc-flex-align-${o}`]: !0
3770
3783
  };
3771
3784
  return d`
3772
- <div class="pc-container ${y(t)}" data-testid="pc-container">
3785
+ <div class="pc-container ${w(t)}" data-testid="pc-container">
3773
3786
  ${this.renderLabelAtStart()}
3774
- <div class="${y(r)}" data-testid="stars-body">
3787
+ <div class="${w(r)}" data-testid="stars-body">
3775
3788
  ${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderStars()}
3776
3789
  ${this.renderStatusAtEnd()}
3777
3790
  </div>
@@ -3788,7 +3801,7 @@ ht([
3788
3801
  f({ type: Number, attribute: "num-stars" })
3789
3802
  ], V.prototype, "numStars", 2);
3790
3803
  ht([
3791
- Tt()
3804
+ zt()
3792
3805
  ], V.prototype, "hoverValue", 2);
3793
3806
  V = ht([
3794
3807
  ot("pc-stars")
@@ -3836,7 +3849,7 @@ const qo = F`
3836
3849
  color 0.2s,
3837
3850
  border-color 0.2s;
3838
3851
  position: relative;
3839
- font-size: var(--pc-font-size-medium, var(--default-font-size-medium));
3852
+ font-size: var(--pc-reaction-size, var(--default-reaction-size));
3840
3853
  gap: 0.25em;
3841
3854
  box-sizing: border-box;
3842
3855
  min-width: 2em;
@@ -3878,7 +3891,7 @@ const qo = F`
3878
3891
  background 0.2s,
3879
3892
  color 0.2s,
3880
3893
  border-color 0.2s;
3881
- font-size: var(--pc-font-size-medium, var(--default-font-size-medium));
3894
+ font-size: var(--pc-reaction-size, var(--default-reaction-size));
3882
3895
  }
3883
3896
 
3884
3897
  .trigger-btn:hover {
@@ -4011,13 +4024,13 @@ let q = class extends m {
4011
4024
  this.displayController.allowEdit() && (this.displayController.toggleReactionPopoverVisibility(), e.stopPropagation());
4012
4025
  }
4013
4026
  handleReactionClick(e) {
4014
- this.displayController.allowEdit() && (this.dataController.toggleValueSelected(e.value, this.multiple), this.displayController.toggleReactionPopoverVisibility(!1));
4027
+ this.displayController.allowEdit() && (this.dataController.toggleValueSelected(e.value, this.multiple), this.dataController.submitStats(), this.displayController.toggleReactionPopoverVisibility(!1));
4015
4028
  }
4016
4029
  /**
4017
4030
  * Renders the icon for a reaction
4018
4031
  */
4019
4032
  renderReactionIcon(e, t) {
4020
- const { icon: o, isRemoteImage: r } = ct(e), s = It.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = $e(o, {
4033
+ const { icon: o, isRemoteImage: r } = ct(e), s = Nt.FUNCTIONAL, i = t.tooltip || `${t.value} reaction`, a = $e(o, {
4021
4034
  type: s,
4022
4035
  alt: i,
4023
4036
  ariaLabel: i,
@@ -4044,7 +4057,7 @@ let q = class extends m {
4044
4057
  }, n = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
4045
4058
  return d`
4046
4059
  <button
4047
- class="${y(a)}"
4060
+ class="${w(a)}"
4048
4061
  @click="${() => this.handleReactionClick(e)}"
4049
4062
  ?disabled="${s}"
4050
4063
  aria-pressed="${o}"
@@ -4086,7 +4099,7 @@ let q = class extends m {
4086
4099
  bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
4087
4100
  };
4088
4101
  return d`
4089
- <div class="${y(e)}" role="menu">
4102
+ <div class="${w(e)}" role="menu">
4090
4103
  <div class="popover-content">
4091
4104
  ${this.options.map((t) => {
4092
4105
  const o = this.displayController.shouldDisableOption(t);
@@ -4133,7 +4146,7 @@ let q = class extends m {
4133
4146
  (o) => this.dataController.isValueSelected(o.value)
4134
4147
  );
4135
4148
  return d`
4136
- <div class="${y(e)}">
4149
+ <div class="${w(e)}">
4137
4150
  ${this.renderTriggerButton()}
4138
4151
  ${t.length > 0 ? d`
4139
4152
  <div class="reaction-list">
@@ -4147,7 +4160,7 @@ let q = class extends m {
4147
4160
  `;
4148
4161
  } else
4149
4162
  return d`
4150
- <div class="${y(e)}">
4163
+ <div class="${w(e)}">
4151
4164
  <div class="reaction-list">
4152
4165
  ${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
4153
4166
  </div>
@@ -4170,7 +4183,7 @@ let q = class extends m {
4170
4183
  icon: (c == null ? void 0 : c.icon) || l
4171
4184
  // Use the icon or fall back to reaction value
4172
4185
  };
4173
- }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", n = Nt(o, {
4186
+ }), r = getComputedStyle(this), s = r.getPropertyValue("--pc-primary-color").trim(), a = r.getPropertyValue("--pc-accent-color").trim() || s || "#ffc107", n = Mt(o, {
4174
4187
  barColor: a,
4175
4188
  labelFormatter: (l) => `${l.label}`,
4176
4189
  valueFormatter: (l) => `${e.totalCount > 0 ? Math.round(l.value / e.totalCount * 100) : 0}%`
@@ -4191,9 +4204,9 @@ let q = class extends m {
4191
4204
  [`pc-flex-align-${o}`]: !0
4192
4205
  };
4193
4206
  return d`
4194
- <div class="${y(t)}" data-testid="reaction-container">
4207
+ <div class="${w(t)}" data-testid="reaction-container">
4195
4208
  ${this.renderLabelAtStart()}
4196
- <div class="${y(r)}" data-testid="reaction-body">
4209
+ <div class="${w(r)}" data-testid="reaction-body">
4197
4210
  ${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
4198
4211
  ${this.renderStatusAtEnd()}
4199
4212
  </div>
@@ -4331,7 +4344,7 @@ mt([
4331
4344
  f({ type: String })
4332
4345
  ], H.prototype, "options", 2);
4333
4346
  mt([
4334
- Tt()
4347
+ zt()
4335
4348
  ], H.prototype, "parsedOptions", 2);
4336
4349
  H = mt([
4337
4350
  ot("poll-catch")