pollcatch 2.5.1 → 2.5.3

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 +515 -501
package/pc.js CHANGED
@@ -22,7 +22,7 @@ let Pe = class {
22
22
  return this.cssText;
23
23
  }
24
24
  };
25
- const We = (e) => new Pe(typeof e == "string" ? e : e + "", void 0, Gt), U = (e, ...t) => {
25
+ const We = (e) => new Pe(typeof e == "string" ? e : e + "", void 0, Gt), V = (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;
@@ -45,7 +45,7 @@ const We = (e) => new Pe(typeof e == "string" ? e : e + "", void 0, Gt), U = (e,
45
45
  * Copyright 2017 Google LLC
46
46
  * SPDX-License-Identifier: BSD-3-Clause
47
47
  */
48
- const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Je, getOwnPropertyNames: Xe, getOwnPropertySymbols: Qe, getPrototypeOf: to } = Object, q = globalThis, ie = q.trustedTypes, eo = ie ? ie.emptyScript : "", Mt = q.reactiveElementPolyfillSupport, pt = (e, t) => e, kt = { toAttribute(e, t) {
48
+ const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Xe, getOwnPropertyNames: Je, getOwnPropertySymbols: Qe, getPrototypeOf: to } = Object, H = globalThis, ie = H.trustedTypes, eo = ie ? ie.emptyScript : "", Mt = H.reactiveElementPolyfillSupport, pt = (e, t) => e, kt = { toAttribute(e, t) {
49
49
  switch (t) {
50
50
  case Boolean:
51
51
  e = e ? eo : null;
@@ -74,8 +74,8 @@ const { is: Ge, defineProperty: Ze, getOwnPropertyDescriptor: Je, getOwnProperty
74
74
  }
75
75
  return o;
76
76
  } }, Zt = (e, t) => !Ge(e, t), ae = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged: Zt };
77
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), q.litPropertyMetadata ?? (q.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
- let rt = class extends HTMLElement {
77
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
78
+ let st = class extends HTMLElement {
79
79
  static addInitializer(t) {
80
80
  this._$Ei(), (this.l ?? (this.l = [])).push(t);
81
81
  }
@@ -89,7 +89,7 @@ let rt = class extends HTMLElement {
89
89
  }
90
90
  }
91
91
  static getPropertyDescriptor(t, o, r) {
92
- const { get: s, set: i } = Je(this.prototype, t) ?? { get() {
92
+ const { get: s, set: i } = Xe(this.prototype, t) ?? { get() {
93
93
  return this[o];
94
94
  }, set(a) {
95
95
  this[o] = a;
@@ -112,7 +112,7 @@ let rt = class extends HTMLElement {
112
112
  static finalize() {
113
113
  if (this.hasOwnProperty(pt("finalized"))) return;
114
114
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(pt("properties"))) {
115
- const o = this.properties, r = [...Xe(o), ...Qe(o)];
115
+ const o = this.properties, r = [...Je(o), ...Qe(o)];
116
116
  for (const s of r) this.createProperty(s, o[s]);
117
117
  }
118
118
  const t = this[Symbol.metadata];
@@ -273,17 +273,17 @@ let rt = class extends HTMLElement {
273
273
  firstUpdated(t) {
274
274
  }
275
275
  };
276
- rt.elementStyles = [], rt.shadowRootOptions = { mode: "open" }, rt[pt("elementProperties")] = /* @__PURE__ */ new Map(), rt[pt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: rt }), (q.reactiveElementVersions ?? (q.reactiveElementVersions = [])).push("2.0.4");
276
+ st.elementStyles = [], st.shadowRootOptions = { mode: "open" }, st[pt("elementProperties")] = /* @__PURE__ */ new Map(), st[pt("finalized")] = /* @__PURE__ */ new Map(), Mt == null || Mt({ ReactiveElement: st }), (H.reactiveElementVersions ?? (H.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 ut = globalThis, Et = ut.trustedTypes, ne = Et ? Et.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Te = "$lit$", j = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + j, oo = `<${_e}>`, X = document, gt = () => X.createComment(""), mt = (e) => e === null || typeof e != "object" && typeof e != "function", Jt = Array.isArray, ro = (e) => Jt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
- \f\r]`, ct = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, le = /-->/g, ce = />/g, Z = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
- \f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, pe = /"/g, Oe = /^(?:script|style|textarea|title)$/i, so = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = so(1), H = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ue = /* @__PURE__ */ new WeakMap(), J = X.createTreeWalker(X, 129);
282
+ const ut = globalThis, Et = ut.trustedTypes, ne = Et ? Et.createPolicy("lit-html", { createHTML: (e) => e }) : void 0, Te = "$lit$", q = `lit$${Math.random().toFixed(9).slice(2)}$`, _e = "?" + q, oo = `<${_e}>`, Q = document, gt = () => Q.createComment(""), mt = (e) => e === null || typeof e != "object" && typeof e != "function", Xt = Array.isArray, ro = (e) => Xt(e) || typeof (e == null ? void 0 : e[Symbol.iterator]) == "function", Lt = `[
283
+ \f\r]`, ct = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, le = /-->/g, ce = />/g, X = RegExp(`>|${Lt}(?:([^\\s"'>=/]+)(${Lt}*=${Lt}*(?:[^
284
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), de = /'/g, pe = /"/g, Oe = /^(?:script|style|textarea|title)$/i, so = (e) => (t, ...o) => ({ _$litType$: e, strings: t, values: o }), c = so(1), F = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), ue = /* @__PURE__ */ new WeakMap(), J = Q.createTreeWalker(Q, 129);
285
285
  function Ie(e, t) {
286
- if (!Jt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
286
+ if (!Xt(e) || !e.hasOwnProperty("raw")) throw Error("invalid template strings array");
287
287
  return ne !== void 0 ? ne.createHTML(t) : t;
288
288
  }
289
289
  const io = (e, t) => {
@@ -291,10 +291,10 @@ const io = (e, t) => {
291
291
  let s, i = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", a = ct;
292
292
  for (let l = 0; l < o; l++) {
293
293
  const n = e[l];
294
- let d, p, h = -1, v = 0;
295
- for (; v < n.length && (a.lastIndex = v, p = a.exec(n), p !== null); ) v = a.lastIndex, a === ct ? p[1] === "!--" ? a = le : p[1] !== void 0 ? a = ce : p[2] !== void 0 ? (Oe.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = Z) : p[3] !== void 0 && (a = Z) : a === Z ? p[0] === ">" ? (a = s ?? ct, h = -1) : p[1] === void 0 ? h = -2 : (h = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? Z : p[3] === '"' ? pe : de) : a === pe || a === de ? a = Z : a === le || a === ce ? a = ct : (a = Z, s = void 0);
296
- const x = a === Z && e[l + 1].startsWith("/>") ? " " : "";
297
- i += a === ct ? n + oo : h >= 0 ? (r.push(d), n.slice(0, h) + Te + n.slice(h) + j + x) : n + j + (h === -2 ? l : x);
294
+ let d, p, f = -1, b = 0;
295
+ for (; b < n.length && (a.lastIndex = b, p = a.exec(n), p !== null); ) b = a.lastIndex, a === ct ? p[1] === "!--" ? a = le : p[1] !== void 0 ? a = ce : p[2] !== void 0 ? (Oe.test(p[2]) && (s = RegExp("</" + p[2], "g")), a = X) : p[3] !== void 0 && (a = X) : a === X ? p[0] === ">" ? (a = s ?? ct, f = -1) : p[1] === void 0 ? f = -2 : (f = a.lastIndex - p[2].length, d = p[1], a = p[3] === void 0 ? X : p[3] === '"' ? pe : de) : a === pe || a === de ? a = X : a === le || a === ce ? a = ct : (a = X, s = void 0);
296
+ const w = a === X && e[l + 1].startsWith("/>") ? " " : "";
297
+ i += a === ct ? n + oo : f >= 0 ? (r.push(d), n.slice(0, f) + Te + n.slice(f) + q + w) : n + q + (f === -2 ? l : w);
298
298
  }
299
299
  return [Ie(e, i + (e[o] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), r];
300
300
  };
@@ -305,42 +305,42 @@ let Ft = class ze {
305
305
  let i = 0, a = 0;
306
306
  const l = t.length - 1, n = this.parts, [d, p] = io(t, o);
307
307
  if (this.el = ze.createElement(d, r), J.currentNode = this.el.content, o === 2 || o === 3) {
308
- const h = this.el.content.firstChild;
309
- h.replaceWith(...h.childNodes);
308
+ const f = this.el.content.firstChild;
309
+ f.replaceWith(...f.childNodes);
310
310
  }
311
311
  for (; (s = J.nextNode()) !== null && n.length < l; ) {
312
312
  if (s.nodeType === 1) {
313
- if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Te)) {
314
- const v = p[a++], x = s.getAttribute(h).split(j), k = /([.?@])?(.*)/.exec(v);
315
- n.push({ type: 1, index: i, name: k[2], strings: x, ctor: k[1] === "." ? no : k[1] === "?" ? lo : k[1] === "@" ? co : Tt }), s.removeAttribute(h);
316
- } else h.startsWith(j) && (n.push({ type: 6, index: i }), s.removeAttribute(h));
313
+ if (s.hasAttributes()) for (const f of s.getAttributeNames()) if (f.endsWith(Te)) {
314
+ const b = p[a++], w = s.getAttribute(f).split(q), E = /([.?@])?(.*)/.exec(b);
315
+ n.push({ type: 1, index: i, name: E[2], strings: w, ctor: E[1] === "." ? no : E[1] === "?" ? lo : E[1] === "@" ? co : Tt }), s.removeAttribute(f);
316
+ } else f.startsWith(q) && (n.push({ type: 6, index: i }), s.removeAttribute(f));
317
317
  if (Oe.test(s.tagName)) {
318
- const h = s.textContent.split(j), v = h.length - 1;
319
- if (v > 0) {
318
+ const f = s.textContent.split(q), b = f.length - 1;
319
+ if (b > 0) {
320
320
  s.textContent = Et ? Et.emptyScript : "";
321
- for (let x = 0; x < v; x++) s.append(h[x], gt()), J.nextNode(), n.push({ type: 2, index: ++i });
322
- s.append(h[v], gt());
321
+ for (let w = 0; w < b; w++) s.append(f[w], gt()), J.nextNode(), n.push({ type: 2, index: ++i });
322
+ s.append(f[b], gt());
323
323
  }
324
324
  }
325
325
  } else if (s.nodeType === 8) if (s.data === _e) n.push({ type: 2, index: i });
326
326
  else {
327
- let h = -1;
328
- for (; (h = s.data.indexOf(j, h + 1)) !== -1; ) n.push({ type: 7, index: i }), h += j.length - 1;
327
+ let f = -1;
328
+ for (; (f = s.data.indexOf(q, f + 1)) !== -1; ) n.push({ type: 7, index: i }), f += q.length - 1;
329
329
  }
330
330
  i++;
331
331
  }
332
332
  }
333
333
  static createElement(t, o) {
334
- const r = X.createElement("template");
334
+ const r = Q.createElement("template");
335
335
  return r.innerHTML = t, r;
336
336
  }
337
337
  };
338
- function it(e, t, o = e, r) {
338
+ function at(e, t, o = e, r) {
339
339
  var a, l;
340
- if (t === H) return t;
340
+ if (t === F) return t;
341
341
  let s = r !== void 0 ? (a = o._$Co) == null ? void 0 : a[r] : o._$Cl;
342
342
  const i = mt(t) ? void 0 : t._$litDirective$;
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 = it(e, s._$AS(e, t.values), s, r)), t;
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 = at(e, s._$AS(e, t.values), s, r)), t;
344
344
  }
345
345
  let ao = class {
346
346
  constructor(t, o) {
@@ -353,7 +353,7 @@ let ao = 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) ?? X).importNode(o, !0);
356
+ const { el: { content: o }, parts: r } = this._$AD, s = ((t == null ? void 0 : t.creationScope) ?? Q).importNode(o, !0);
357
357
  J.currentNode = s;
358
358
  let i = J.nextNode(), a = 0, l = 0, n = r[0];
359
359
  for (; n !== void 0; ) {
@@ -363,7 +363,7 @@ let ao = class {
363
363
  }
364
364
  a !== (n == null ? void 0 : n.index) && (i = J.nextNode(), a++);
365
365
  }
366
- return J.currentNode = X, s;
366
+ return J.currentNode = Q, s;
367
367
  }
368
368
  p(t) {
369
369
  let o = 0;
@@ -390,7 +390,7 @@ class vt {
390
390
  return this._$AB;
391
391
  }
392
392
  _$AI(t, o = this) {
393
- t = it(this, t, o), mt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== H && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ro(t) ? this.k(t) : this._(t);
393
+ t = at(this, t, o), mt(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== F && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ro(t) ? this.k(t) : this._(t);
394
394
  }
395
395
  O(t) {
396
396
  return this._$AA.parentNode.insertBefore(t, this._$AB);
@@ -399,7 +399,7 @@ class vt {
399
399
  this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
400
400
  }
401
401
  _(t) {
402
- this._$AH !== u && mt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(X.createTextNode(t)), this._$AH = t;
402
+ this._$AH !== u && mt(this._$AH) ? this._$AA.nextSibling.data = t : this.T(Q.createTextNode(t)), this._$AH = t;
403
403
  }
404
404
  $(t) {
405
405
  var i;
@@ -415,7 +415,7 @@ class vt {
415
415
  return o === void 0 && ue.set(t.strings, o = new Ft(t)), o;
416
416
  }
417
417
  k(t) {
418
- Jt(this._$AH) || (this._$AH = [], this._$AR());
418
+ Xt(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 vt(this.O(gt()), this.O(gt()), this, this.options)) : r = o[s], r._$AI(i), s++;
@@ -446,11 +446,11 @@ class Tt {
446
446
  _$AI(t, o = this, r, s) {
447
447
  const i = this.strings;
448
448
  let a = !1;
449
- if (i === void 0) t = it(this, t, o, 0), a = !mt(t) || t !== this._$AH && t !== H, a && (this._$AH = t);
449
+ if (i === void 0) t = at(this, t, o, 0), a = !mt(t) || t !== this._$AH && t !== F, a && (this._$AH = t);
450
450
  else {
451
451
  const l = t;
452
452
  let n, d;
453
- for (t = i[0], n = 0; n < i.length - 1; n++) d = it(this, l[r + n], o, n), d === H && (d = this._$AH[n]), a || (a = !mt(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
453
+ for (t = i[0], n = 0; n < i.length - 1; n++) d = at(this, l[r + n], o, n), d === F && (d = this._$AH[n]), a || (a = !mt(d) || d !== this._$AH[n]), d === u ? t = u : t !== u && (t += (d ?? "") + i[n + 1]), this._$AH[n] = d;
454
454
  }
455
455
  a && !s && this.j(t);
456
456
  }
@@ -479,7 +479,7 @@ class co extends Tt {
479
479
  super(t, o, r, s, i), this.type = 5;
480
480
  }
481
481
  _$AI(t, o = this) {
482
- if ((t = it(this, t, o, 0) ?? u) === H) return;
482
+ if ((t = at(this, t, o, 0) ?? u) === F) return;
483
483
  const r = this._$AH, s = t === u && r !== u || t.capture !== r.capture || t.once !== r.once || t.passive !== r.passive, i = t !== u && (r === u || s);
484
484
  s && this.element.removeEventListener(this.name, this, r), i && this.element.addEventListener(this.name, this, t), this._$AH = t;
485
485
  }
@@ -496,7 +496,7 @@ class po {
496
496
  return this._$AM._$AU;
497
497
  }
498
498
  _$AI(t) {
499
- it(this, t);
499
+ at(this, t);
500
500
  }
501
501
  }
502
502
  const Dt = ut.litHtmlPolyfillSupport;
@@ -515,7 +515,7 @@ const uo = (e, t, o) => {
515
515
  * Copyright 2017 Google LLC
516
516
  * SPDX-License-Identifier: BSD-3-Clause
517
517
  */
518
- let R = class extends rt {
518
+ let B = class extends st {
519
519
  constructor() {
520
520
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
521
521
  }
@@ -537,13 +537,13 @@ let R = class extends rt {
537
537
  super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
538
538
  }
539
539
  render() {
540
- return H;
540
+ return F;
541
541
  }
542
542
  };
543
543
  var Ae;
544
- R._$litElement$ = !0, R.finalized = !0, (Ae = globalThis.litElementHydrateSupport) == null || Ae.call(globalThis, { LitElement: R });
544
+ B._$litElement$ = !0, B.finalized = !0, (Ae = globalThis.litElementHydrateSupport) == null || Ae.call(globalThis, { LitElement: B });
545
545
  const Nt = globalThis.litElementPolyfillSupport;
546
- Nt == null || Nt({ LitElement: R });
546
+ Nt == null || Nt({ LitElement: B });
547
547
  (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
548
548
  /**
549
549
  * @license
@@ -581,7 +581,7 @@ const ho = { attribute: !0, type: String, converter: kt, reflect: !1, hasChanged
581
581
  }
582
582
  throw Error("Unsupported decorator location: " + r);
583
583
  };
584
- function f(e) {
584
+ function h(e) {
585
585
  return (t, o) => typeof o == "object" ? fo(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;
@@ -592,8 +592,8 @@ function f(e) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function A(e) {
596
- return f({ ...e, state: !0, attribute: !1 });
595
+ function C(e) {
596
+ return h({ ...e, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
599
599
  * @license
@@ -617,8 +617,8 @@ function bt(e, t) {
617
617
  } });
618
618
  };
619
619
  }
620
- var S = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(S || {});
621
- const Xt = c`
620
+ var x = /* @__PURE__ */ ((e) => (e.reaction = "reaction", e.stars = "stars", e.poll = "poll", e.text = "text", e.nps = "nps", e))(x || {});
621
+ const Jt = c`
622
622
  <svg
623
623
  xmlns="http://www.w3.org/2000/svg"
624
624
  height="24px"
@@ -675,18 +675,18 @@ const Xt = c`
675
675
  <path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z" />
676
676
  </svg>
677
677
  `;
678
- var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
678
+ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, D = function(e) {
679
679
  return typeof e == "string" ? e.length > 0 : typeof e == "number";
680
- }, C = function(e, t, o) {
680
+ }, S = function(e, t, o) {
681
681
  return t === void 0 && (t = 0), o === void 0 && (o = Math.pow(10, t)), Math.round(o * e) / o + 0;
682
- }, T = function(e, t, o) {
682
+ }, P = function(e, t, o) {
683
683
  return t === void 0 && (t = 0), o === void 0 && (o = 1), e > o ? o : e > t ? e : t;
684
684
  }, Le = function(e) {
685
685
  return (e = isFinite(e) ? e % 360 : 0) > 0 ? e : e + 360;
686
686
  }, he = function(e) {
687
- return { r: T(e.r, 0, 255), g: T(e.g, 0, 255), b: T(e.b, 0, 255), a: T(e.a) };
687
+ return { r: P(e.r, 0, 255), g: P(e.g, 0, 255), b: P(e.b, 0, 255), a: P(e.a) };
688
688
  }, Rt = function(e) {
689
- return { r: C(e.r), g: C(e.g), b: C(e.b), a: C(e.a, 3) };
689
+ return { r: S(e.r), g: S(e.g), b: S(e.b), a: S(e.a, 3) };
690
690
  }, vo = /^#([0-9a-f]{3,8})$/i, xt = function(e) {
691
691
  var t = e.toString(16);
692
692
  return t.length < 2 ? "0" + t : t;
@@ -699,9 +699,9 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
699
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;
700
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 };
701
701
  }, fe = function(e) {
702
- return { h: Le(e.h), s: T(e.s, 0, 100), l: T(e.l, 0, 100), a: T(e.a) };
702
+ return { h: Le(e.h), s: P(e.s, 0, 100), l: P(e.l, 0, 100), a: P(e.a) };
703
703
  }, ge = function(e) {
704
- return { h: C(e.h), s: C(e.s), l: C(e.l), a: C(e.a, 3) };
704
+ return { h: S(e.h), s: S(e.s), l: S(e.l), a: S(e.a, 3) };
705
705
  }, me = function(e) {
706
706
  return Ne((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 }));
707
707
  var t, o, r;
@@ -710,7 +710,7 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
710
710
  var t, o, r, s;
711
711
  }, bo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, yo = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, wo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, xo = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i, ve = { string: [[function(e) {
712
712
  var t = vo.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 ? C(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 ? C(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
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 ? S(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 ? S(parseInt(e.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
714
714
  }, "hex"], [function(e) {
715
715
  var t = wo.exec(e) || xo.exec(e);
716
716
  return t ? t[2] !== t[4] || t[4] !== t[6] ? null : he({ 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;
@@ -721,17 +721,17 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
721
721
  return me(s);
722
722
  }, "hsl"]], object: [[function(e) {
723
723
  var t = e.r, o = e.g, r = e.b, s = e.a, i = s === void 0 ? 1 : s;
724
- return L(t) && L(o) && L(r) ? he({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
724
+ return D(t) && D(o) && D(r) ? he({ r: Number(t), g: Number(o), b: Number(r), a: Number(i) }) : null;
725
725
  }, "rgb"], [function(e) {
726
726
  var t = e.h, o = e.s, r = e.l, s = e.a, i = s === void 0 ? 1 : s;
727
- if (!L(t) || !L(o) || !L(r)) return null;
727
+ if (!D(t) || !D(o) || !D(r)) return null;
728
728
  var a = fe({ h: Number(t), s: Number(o), l: Number(r), a: Number(i) });
729
729
  return me(a);
730
730
  }, "hsl"], [function(e) {
731
731
  var t = e.h, o = e.s, r = e.v, s = e.a, i = s === void 0 ? 1 : s;
732
- if (!L(t) || !L(o) || !L(r)) return null;
732
+ if (!D(t) || !D(o) || !D(r)) return null;
733
733
  var a = function(l) {
734
- return { h: Le(l.h), s: T(l.s, 0, 100), v: T(l.v, 0, 100), a: T(l.a) };
734
+ return { h: Le(l.h), s: P(l.s, 0, 100), v: P(l.v, 0, 100), a: P(l.a) };
735
735
  }({ h: Number(t), s: Number(o), v: Number(r), a: Number(i) });
736
736
  return Ne(a);
737
737
  }, "hsv"]] }, be = function(e, t) {
@@ -744,12 +744,12 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
744
744
  return typeof e == "string" ? be(e.trim(), ve.string) : typeof e == "object" && e !== null ? be(e, ve.object) : [null, void 0];
745
745
  }, Bt = function(e, t) {
746
746
  var o = ht(e);
747
- return { h: o.h, s: T(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
747
+ return { h: o.h, s: P(o.s + 100 * t, 0, 100), l: o.l, a: o.a };
748
748
  }, Ut = function(e) {
749
749
  return (299 * e.r + 587 * e.g + 114 * e.b) / 1e3 / 255;
750
750
  }, ye = function(e, t) {
751
751
  var o = ht(e);
752
- return { h: o.h, s: o.s, l: T(o.l + 100 * t, 0, 100), a: o.a };
752
+ return { h: o.h, s: o.s, l: P(o.l + 100 * t, 0, 100), a: o.a };
753
753
  }, we = function() {
754
754
  function e(t) {
755
755
  this.parsed = $o(t)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
@@ -757,13 +757,13 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
757
757
  return e.prototype.isValid = function() {
758
758
  return this.parsed !== null;
759
759
  }, e.prototype.brightness = function() {
760
- return C(Ut(this.rgba), 2);
760
+ return S(Ut(this.rgba), 2);
761
761
  }, e.prototype.isDark = function() {
762
762
  return Ut(this.rgba) < 0.5;
763
763
  }, e.prototype.isLight = function() {
764
764
  return Ut(this.rgba) >= 0.5;
765
765
  }, e.prototype.toHex = function() {
766
- return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? xt(C(255 * i)) : "", "#" + xt(o) + xt(r) + xt(s) + a;
766
+ return t = Rt(this.rgba), o = t.r, r = t.g, s = t.b, a = (i = t.a) < 1 ? xt(S(255 * i)) : "", "#" + xt(o) + xt(r) + xt(s) + a;
767
767
  var t, o, r, s, i, a;
768
768
  }, e.prototype.toRgb = function() {
769
769
  return Rt(this.rgba);
@@ -776,36 +776,36 @@ var mo = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, L = function(e) {
776
776
  return t = ge(ht(this.rgba)), o = t.h, r = t.s, s = t.l, (i = t.a) < 1 ? "hsla(" + o + ", " + r + "%, " + s + "%, " + i + ")" : "hsl(" + o + ", " + r + "%, " + s + "%)";
777
777
  var t, o, r, s, i;
778
778
  }, e.prototype.toHsv = function() {
779
- return t = De(this.rgba), { h: C(t.h), s: C(t.s), v: C(t.v), a: C(t.a, 3) };
779
+ return t = De(this.rgba), { h: S(t.h), s: S(t.s), v: S(t.v), a: S(t.a, 3) };
780
780
  var t;
781
781
  }, e.prototype.invert = function() {
782
- return O({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
782
+ return T({ r: 255 - (t = this.rgba).r, g: 255 - t.g, b: 255 - t.b, a: t.a });
783
783
  var t;
784
784
  }, e.prototype.saturate = function(t) {
785
- return t === void 0 && (t = 0.1), O(Bt(this.rgba, t));
785
+ return t === void 0 && (t = 0.1), T(Bt(this.rgba, t));
786
786
  }, e.prototype.desaturate = function(t) {
787
- return t === void 0 && (t = 0.1), O(Bt(this.rgba, -t));
787
+ return t === void 0 && (t = 0.1), T(Bt(this.rgba, -t));
788
788
  }, e.prototype.grayscale = function() {
789
- return O(Bt(this.rgba, -1));
789
+ return T(Bt(this.rgba, -1));
790
790
  }, e.prototype.lighten = function(t) {
791
- return t === void 0 && (t = 0.1), O(ye(this.rgba, t));
791
+ return t === void 0 && (t = 0.1), T(ye(this.rgba, t));
792
792
  }, e.prototype.darken = function(t) {
793
- return t === void 0 && (t = 0.1), O(ye(this.rgba, -t));
793
+ return t === void 0 && (t = 0.1), T(ye(this.rgba, -t));
794
794
  }, e.prototype.rotate = function(t) {
795
795
  return t === void 0 && (t = 15), this.hue(this.hue() + t);
796
796
  }, e.prototype.alpha = function(t) {
797
- return typeof t == "number" ? O({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : C(this.rgba.a, 3);
797
+ return typeof t == "number" ? T({ r: (o = this.rgba).r, g: o.g, b: o.b, a: t }) : S(this.rgba.a, 3);
798
798
  var o;
799
799
  }, e.prototype.hue = function(t) {
800
800
  var o = ht(this.rgba);
801
- return typeof t == "number" ? O({ h: t, s: o.s, l: o.l, a: o.a }) : C(o.h);
801
+ return typeof t == "number" ? T({ h: t, s: o.s, l: o.l, a: o.a }) : S(o.h);
802
802
  }, e.prototype.isEqual = function(t) {
803
- return this.toHex() === O(t).toHex();
803
+ return this.toHex() === T(t).toHex();
804
804
  }, e;
805
- }(), O = function(e) {
805
+ }(), T = function(e) {
806
806
  return e instanceof we ? e : new we(e);
807
807
  };
808
- const So = typeof process < "u" ? process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test" : !1;
808
+ const So = typeof process < "u" && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test");
809
809
  function Vt() {
810
810
  if (So) return !0;
811
811
  try {
@@ -862,7 +862,7 @@ function xe(e) {
862
862
  return 0.2126 * i + 0.7152 * a + 0.0722 * l;
863
863
  }
864
864
  function Ao(e, t = {}) {
865
- if (!O(e).isValid())
865
+ if (!T(e).isValid())
866
866
  return g.warn(`Invalid color provided: ${e}`), "black";
867
867
  const {
868
868
  minContrast: r = 4.5,
@@ -875,16 +875,16 @@ function Ao(e, t = {}) {
875
875
  } = t, l = s.map((p) => p === "black" ? "#000000" : p === "white" ? "#ffffff" : p === "light" ? i.light || "#f8f9fa" : p === "dark" ? i.dark || "#343a40" : p);
876
876
  let n = a, d = 0;
877
877
  for (const p of l) {
878
- const h = jt(e, p);
879
- h >= r && h > d && (d = h, n = p);
878
+ const f = jt(e, p);
879
+ f >= r && f > d && (d = f, n = p);
880
880
  }
881
881
  if (d === 0) {
882
882
  const p = jt(e, a);
883
883
  n = a, d = p;
884
- for (const h of l) {
885
- if (h === a) continue;
886
- const v = jt(e, h);
887
- v > d && (d = v, n = h);
884
+ for (const f of l) {
885
+ if (f === a) continue;
886
+ const b = jt(e, f);
887
+ b > d && (d = b, n = f);
888
888
  }
889
889
  g.warn(
890
890
  `No color option met the minimum contrast ratio of ${r}:1 against ${e}. Using ${n} with contrast ratio ${d.toFixed(2)}:1 instead.`
@@ -893,13 +893,13 @@ function Ao(e, t = {}) {
893
893
  return n;
894
894
  }
895
895
  function Po(e) {
896
- const o = Eo(e) || e, r = O(o);
896
+ const o = Eo(e) || e, r = T(o);
897
897
  if (!r.isValid())
898
898
  return g.warn(`Invalid color provided: ${e}`), { r: 0, g: 0, b: 0 };
899
899
  const { r: s, g: i, b: a } = r.toRgb();
900
900
  return { r: s, g: i, b: a };
901
901
  }
902
- function z(e, t) {
902
+ function O(e, t) {
903
903
  const r = t ? {
904
904
  left: "start",
905
905
  right: "end",
@@ -950,8 +950,8 @@ function To(e, t = "4px") {
950
950
  const a = parseFloat(s);
951
951
  return isNaN(a) ? t : `${a}px`;
952
952
  }
953
- var D = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(D || {});
954
- function st(e) {
953
+ var N = /* @__PURE__ */ ((e) => (e.BUTTON = "button", e.CHECKBOX = "checkbox", e.RADIO = "radio", e.RADIOGROUP = "radiogroup", e.SWITCH = "switch", e.TAB = "tab", e.TABLIST = "tablist", e.TABPANEL = "tabpanel", e.MENU = "menu", e.MENUITEM = "menuitem", e.MENUITEMCHECKBOX = "menuitemcheckbox", e.MENUITEMRADIO = "menuitemradio", e.SLIDER = "slider", e.TEXTBOX = "textbox", e.COMBOBOX = "combobox", e.LISTBOX = "listbox", e.OPTION = "option", e.PROGRESSBAR = "progressbar", e.STATUS = "status", e.ALERT = "alert", e.DIALOG = "dialog", e.GROUP = "group", e.REGION = "region", e.NONE = "none", e.PRESENTATION = "presentation", e))(N || {});
954
+ function it(e) {
955
955
  const t = {};
956
956
  e.role !== void 0 && (t.role = e.role);
957
957
  for (const [o, r] of Object.entries(e)) {
@@ -962,7 +962,7 @@ function st(e) {
962
962
  return t;
963
963
  }
964
964
  function _o(e, t, o) {
965
- return st({
965
+ return it({
966
966
  role: "button",
967
967
  ariaLabel: e,
968
968
  ariaPressed: t,
@@ -970,7 +970,7 @@ function _o(e, t, o) {
970
970
  });
971
971
  }
972
972
  function Oo(e, t, o, r = !1) {
973
- return st({
973
+ return it({
974
974
  role: r ? "radio" : "checkbox",
975
975
  ariaLabel: e,
976
976
  ariaChecked: t,
@@ -986,7 +986,7 @@ function Io(e) {
986
986
  const t = e.replace(/[<>"']/g, "").trim();
987
987
  return /^(#[0-9a-fA-F]{3,8}|rgb\([^)]+\)|rgba\([^)]+\)|hsl\([^)]+\)|hsla\([^)]+\)|[a-zA-Z]+)$/.test(t);
988
988
  }
989
- function ot(e) {
989
+ function rt(e) {
990
990
  return Io(e) ? e.replace(/[<>"']/g, "").trim() : (g.warn("Invalid color value:", e), "#000000");
991
991
  }
992
992
  function zo(e) {
@@ -1091,7 +1091,7 @@ function Ce(e, t) {
1091
1091
  }
1092
1092
  return { avg: s > 0 ? Math.round(r / s * 10) / 10 : 0, count: s, sum: r, breakdown: o };
1093
1093
  }
1094
- function N() {
1094
+ function R() {
1095
1095
  return {
1096
1096
  count: 0,
1097
1097
  sum: 0,
@@ -1103,12 +1103,12 @@ function N() {
1103
1103
  }
1104
1104
  function Bo(e) {
1105
1105
  if (!te())
1106
- return N();
1106
+ return R();
1107
1107
  try {
1108
1108
  const t = Be(e);
1109
- return t ? { ...N(), ...t } : N();
1109
+ return t ? { ...R(), ...t } : R();
1110
1110
  } catch (t) {
1111
- return g.warn("Failed to load localStats from localStorage", t), N();
1111
+ return g.warn("Failed to load localStats from localStorage", t), R();
1112
1112
  }
1113
1113
  }
1114
1114
  function Uo(e, t) {
@@ -1137,7 +1137,7 @@ function Vo(e, t) {
1137
1137
  }
1138
1138
  function jo(e, t) {
1139
1139
  if (!e.count && !t.count)
1140
- return N();
1140
+ return R();
1141
1141
  if (!e.count)
1142
1142
  return { ...t };
1143
1143
  const o = {
@@ -1217,7 +1217,7 @@ const ke = 5;
1217
1217
  class Go {
1218
1218
  // Tracks if user has ever made a selection (even if later deselected)
1219
1219
  constructor(t) {
1220
- this.stats = N(), this.localStats = N(), this.prevLocalStats = N(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1220
+ this.stats = R(), this.localStats = R(), this.prevLocalStats = R(), this.isLoading = !0, this.isLoadingConfig = !1, this.isSubmitting = !1, this.hasInteracted = !1, (this.host = t).addController(this);
1221
1221
  }
1222
1222
  hostConnected() {
1223
1223
  this.loadStats();
@@ -1272,17 +1272,20 @@ class Go {
1272
1272
  if (o.type === "registered" && t.widgetId) {
1273
1273
  const a = Ko(t.widgetId);
1274
1274
  if (a) {
1275
- g.debug("Using prefetched config from cache", { widgetId: t.widgetId }), this.applyWidgetAttributes(a.attributes);
1276
- const l = this.getOptionsForDataFunc(t), n = Ce(a.stats.breakdown, l), d = n.count, p = n.sum, h = d > 0 ? Math.round(p / d * 10) / 10 : 0, v = d > 0 ? Math.round(p / d * 100) : 0;
1277
- this.stats = {
1275
+ g.debug("Using prefetched widget config from cache", { widgetId: t.widgetId }), this.applyWidgetAttributes(a.config.attributes);
1276
+ const l = this.getOptionsForDataFunc(t), n = Ce(
1277
+ a.stats.breakdown ?? {},
1278
+ l
1279
+ ), d = n.count, p = n.sum, f = d > 0 ? Math.round(p / d * 10) / 10 : 0, b = d > 0 ? Math.round(p / d * 100) : 0, w = {
1278
1280
  count: d,
1279
1281
  sum: p,
1280
- avg: h,
1281
- pct: v,
1282
- nps: t.type === S.nps ? ft(n.breakdown) : 0,
1282
+ avg: f,
1283
+ pct: b,
1284
+ nps: t.type === x.nps ? ft(n.breakdown) : 0,
1283
1285
  breakdown: n.breakdown,
1284
1286
  updated: a.stats.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
1285
- }, this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1287
+ };
1288
+ this.stats = w, this.isLoading = !1, this.isLoadingConfig = !1, this.host.requestUpdate();
1286
1289
  return;
1287
1290
  }
1288
1291
  }
@@ -1290,52 +1293,52 @@ class Go {
1290
1293
  const a = t.type;
1291
1294
  let l;
1292
1295
  if (t.dataFunc && typeof window < "u") {
1293
- const y = t.dataFunc.replace(/^window\./, "").split(".");
1294
- let E = window;
1295
- for (const G of y)
1296
- if (E = E == null ? void 0 : E[G], E === void 0) break;
1297
- l = E;
1296
+ const $ = t.dataFunc.replace(/^window\./, "").split(".");
1297
+ let A = window;
1298
+ for (const Z of $)
1299
+ if (A = A == null ? void 0 : A[Z], A === void 0) break;
1300
+ l = A;
1298
1301
  }
1299
1302
  let n, d = null;
1300
1303
  if (l && typeof l == "function") {
1301
- const $ = this.getOptionsForDataFunc(t);
1304
+ const k = this.getOptionsForDataFunc(t);
1302
1305
  g.debug(`Using data function for: ${t.widgetId || t.name}`, {
1303
1306
  dataFuncName: t.dataFunc,
1304
- options: $
1307
+ options: k
1305
1308
  });
1306
- const y = await l(t.widgetId, t.name, $);
1307
- if (y && typeof y == "object" && "success" in y && "data" in y) {
1308
- if (!y.success)
1309
- throw g.error("Custom data function returned unsuccessful response", y), new Error("Custom data function returned unsuccessful response");
1310
- n = y.data || {};
1309
+ const $ = await l(t.widgetId, t.name, k);
1310
+ if ($ && typeof $ == "object" && "success" in $ && "data" in $) {
1311
+ if (!$.success)
1312
+ throw g.error("Custom data function returned unsuccessful response", $), new Error("Custom data function returned unsuccessful response");
1313
+ n = $.data || {};
1311
1314
  } else
1312
- n = y || {};
1315
+ n = $ || {};
1313
1316
  } else {
1314
- const $ = t.dataEndpoint || Yt;
1315
- let y;
1316
- o.type === "registered" ? (y = `${$}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : y = `${$}/public-widgets/${encodeURIComponent(t.name)}`, g.debug("Fetching stats for widget", {
1317
- endpoint: y,
1317
+ const k = t.dataEndpoint || Yt;
1318
+ let $;
1319
+ o.type === "registered" ? ($ = `${k}/widgets/${encodeURIComponent(t.widgetId)}`, this.isLoadingConfig = !0, this.host.requestUpdate()) : $ = `${k}/public-widgets/${encodeURIComponent(t.name)}`, g.debug("Fetching stats for widget", {
1320
+ endpoint: $,
1318
1321
  type: o.type
1319
1322
  });
1320
- const E = await fetch(y);
1321
- if (!E.ok)
1322
- throw new Error(`API request failed with status: ${E.status}`);
1323
- const G = await E.json();
1324
- if (!G.success)
1325
- throw g.error("Backend returned unsuccessful response", G), new Error("Backend returned unsuccessful response");
1326
- o.type === "registered" ? (d = ((s = (r = G.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = G.data) == null ? void 0 : i.stats) || {}) : n = G.data || {};
1323
+ const A = await fetch($);
1324
+ if (!A.ok)
1325
+ throw new Error(`API request failed with status: ${A.status}`);
1326
+ const Z = await A.json();
1327
+ if (!Z.success)
1328
+ throw g.error("Backend returned unsuccessful response", Z), new Error("Backend returned unsuccessful response");
1329
+ o.type === "registered" ? (d = ((s = (r = Z.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null, n = ((i = Z.data) == null ? void 0 : i.stats) || {}) : n = Z.data || {};
1327
1330
  }
1328
1331
  d && !l && this.applyWidgetAttributes(d);
1329
- const p = this.getOptionsForDataFunc(t), h = Ce(n.breakdown ?? {}, p), v = h.count, x = h.sum, k = v > 0 ? Math.round(x / v * 10) / 10 : 0, P = v > 0 ? Math.round(x / v * 100) : 0, _ = {
1330
- count: v,
1331
- sum: x,
1332
- avg: k,
1333
- pct: P,
1334
- nps: a === S.nps ? ft(h.breakdown) : 0,
1335
- breakdown: h.breakdown,
1332
+ const p = this.getOptionsForDataFunc(t), f = Ce(n.breakdown ?? {}, p), b = f.count, w = f.sum, E = b > 0 ? Math.round(w / b * 10) / 10 : 0, M = b > 0 ? Math.round(w / b * 100) : 0, L = {
1333
+ count: b,
1334
+ sum: w,
1335
+ avg: E,
1336
+ pct: M,
1337
+ nps: a === x.nps ? ft(f.breakdown) : 0,
1338
+ breakdown: f.breakdown,
1336
1339
  updated: n.updatedAt || n.updated_at || (/* @__PURE__ */ new Date()).toISOString()
1337
1340
  };
1338
- this.stats = _;
1341
+ this.stats = L;
1339
1342
  } catch (a) {
1340
1343
  throw g.error("Error loading stats:", a, this.localStats), a;
1341
1344
  } finally {
@@ -1350,14 +1353,14 @@ class Go {
1350
1353
  */
1351
1354
  getOptionsForDataFunc(t) {
1352
1355
  switch (t.type) {
1353
- case S.stars: {
1356
+ case x.stars: {
1354
1357
  const r = t.numStars || 5;
1355
1358
  return Array.from({ length: r }, (s, i) => String(i + 1));
1356
1359
  }
1357
- case S.nps:
1360
+ case x.nps:
1358
1361
  return Array.from({ length: 11 }, (r, s) => String(s));
1359
- case S.poll:
1360
- case S.reaction:
1362
+ case x.poll:
1363
+ case x.reaction:
1361
1364
  default:
1362
1365
  return t.options.map((r) => r.value);
1363
1366
  }
@@ -1371,7 +1374,7 @@ class Go {
1371
1374
  const o = Bo(t);
1372
1375
  g.debug("Loaded localStats from localStorage", o), this.localStats = o, o.submitted && (this.prevLocalStats = { ...o });
1373
1376
  } catch (o) {
1374
- g.warn("Failed to generate localStorage key for localStats", o), this.localStats = N();
1377
+ g.warn("Failed to generate localStorage key for localStats", o), this.localStats = R();
1375
1378
  }
1376
1379
  this.host.requestUpdate();
1377
1380
  }
@@ -1490,7 +1493,7 @@ class Go {
1490
1493
  sum: (o == null ? void 0 : o.sum) || 0,
1491
1494
  avg: s,
1492
1495
  pct: (o == null ? void 0 : o.pct) || 0,
1493
- nps: r.type === S.nps ? ft((o == null ? void 0 : o.breakdown) || {}) : 0
1496
+ nps: r.type === x.nps ? ft((o == null ? void 0 : o.breakdown) || {}) : 0
1494
1497
  };
1495
1498
  return g.debug("Stats data: ", this.stats), Ho(t, i);
1496
1499
  }
@@ -1518,7 +1521,7 @@ class Go {
1518
1521
  toggleValueSelected(t, o) {
1519
1522
  const r = Object.keys(this.localStats.breakdown || {}), s = r.includes(t), i = this.host;
1520
1523
  let a = 1;
1521
- if ((i.type === S.stars || i.type === S.nps) && (a = parseInt(t)), s)
1524
+ if ((i.type === x.stars || i.type === x.nps) && (a = parseInt(t)), s)
1522
1525
  if (o) {
1523
1526
  const n = r.filter((d) => d !== t);
1524
1527
  this.updateStats(n.length > 0 ? 1 : 0, n);
@@ -1684,13 +1687,13 @@ function je(e, t = {}) {
1684
1687
  ariaHidden: !1
1685
1688
  };
1686
1689
  }
1687
- function Jo(e, t = "polite") {
1690
+ function Xo(e, t = "polite") {
1688
1691
  let o = document.getElementById("screen-reader-announcer");
1689
1692
  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(() => {
1690
1693
  o.textContent = e;
1691
1694
  }, 50);
1692
1695
  }
1693
- function Xo(e, t) {
1696
+ function Jo(e, t) {
1694
1697
  return `${e}: ${t}`;
1695
1698
  }
1696
1699
  /**
@@ -1720,7 +1723,7 @@ let Fe = class {
1720
1723
  * Copyright 2018 Google LLC
1721
1724
  * SPDX-License-Identifier: BSD-3-Clause
1722
1725
  */
1723
- const w = He(class extends Fe {
1726
+ const y = He(class extends Fe {
1724
1727
  constructor(e) {
1725
1728
  var t;
1726
1729
  if (super(e), e.type !== qe.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.");
@@ -1741,10 +1744,10 @@ const w = He(class extends Fe {
1741
1744
  const a = !!t[i];
1742
1745
  a === this.st.has(i) || (s = this.nt) != null && s.has(i) || (a ? (o.add(i), this.st.add(i)) : (o.remove(i), this.st.delete(i)));
1743
1746
  }
1744
- return H;
1747
+ return F;
1745
1748
  }
1746
1749
  });
1747
- var Qo = Object.defineProperty, b = (e, t, o, r) => {
1750
+ var Qo = Object.defineProperty, v = (e, t, o, r) => {
1748
1751
  for (var s = void 0, i = e.length - 1, a; i >= 0; i--)
1749
1752
  (a = e[i]) && (s = a(t, o, s) || s);
1750
1753
  return s && Qo(t, o, s), s;
@@ -1753,7 +1756,7 @@ const $t = {
1753
1756
  mobile: "480px",
1754
1757
  tablet: "768px",
1755
1758
  desktop: "1024px"
1756
- }, oe = class oe extends R {
1759
+ }, oe = class oe extends B {
1757
1760
  constructor() {
1758
1761
  super(...arguments), this.dataController = new Go(this), this.displayController = new Zo(this, this.dataController), this.hasEditButton = !0, this.showStats = "never", this.showChart = !1, this.initialized = !1, this.ariaLabel = null, this.minContrast = Re.AA_NORMAL, this.options = [], 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) => {
1759
1762
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.handleEnterEditMode());
@@ -1787,7 +1790,7 @@ const $t = {
1787
1790
  let o = `:host {
1788
1791
  `;
1789
1792
  if (this.primaryColor) {
1790
- const i = ot(this.primaryColor);
1793
+ const i = rt(this.primaryColor);
1791
1794
  o += `--pc-primary-color: ${i} !important;
1792
1795
  `;
1793
1796
  const a = Ao(i, {
@@ -1798,27 +1801,27 @@ const $t = {
1798
1801
  `;
1799
1802
  }
1800
1803
  if (this.muteColor) {
1801
- const i = ot(this.muteColor);
1804
+ const i = rt(this.muteColor);
1802
1805
  o += `--pc-mute-color: ${i} !important;
1803
1806
  `;
1804
1807
  }
1805
1808
  if (this.textColor) {
1806
- const i = ot(this.textColor);
1809
+ const i = rt(this.textColor);
1807
1810
  o += `--pc-text-color: ${i} !important;
1808
1811
  `;
1809
1812
  }
1810
1813
  if (this.backgroundColor) {
1811
- const i = ot(this.backgroundColor);
1814
+ const i = rt(this.backgroundColor);
1812
1815
  o += `--pc-background-color: ${i} !important;
1813
1816
  `;
1814
1817
  }
1815
1818
  const r = this.starColor || this.accentColor || this.primaryColor;
1816
1819
  if (r) {
1817
- const i = ot(r);
1820
+ const i = rt(r);
1818
1821
  o += `--pc-star-color: ${i} !important;
1819
1822
  `;
1820
1823
  }
1821
- const s = this.starHoverColor || (r ? `color-mix(in srgb, ${ot(r)} 80%, white)` : null);
1824
+ const s = this.starHoverColor || (r ? `color-mix(in srgb, ${rt(r)} 80%, white)` : null);
1822
1825
  if (s && (o += `--pc-star-hover-color: ${s} !important;
1823
1826
  `), this.starSize) {
1824
1827
  const i = qt(this.starSize, "1.5em", 1.5);
@@ -1872,7 +1875,7 @@ const $t = {
1872
1875
  */
1873
1876
  announceSelectionChange(t, o, r) {
1874
1877
  const s = `Poll for "${t}"`, i = r ? `${o.label} selected` : `${o.label} unselected`;
1875
- Jo(Xo(s, i));
1878
+ Xo(Jo(s, i));
1876
1879
  }
1877
1880
  /** Common render methods */
1878
1881
  renderLabel() {
@@ -1922,7 +1925,7 @@ const $t = {
1922
1925
  tabindex="0"
1923
1926
  aria-label="${this.displayController.isChartVisible ? "Hide chart" : "Show chart"}"
1924
1927
  @keydown="${() => this.displayController.toggleChartVisibility()}"
1925
- >${this.displayController.isChartVisible ? Qt : Xt}</span
1928
+ >${this.displayController.isChartVisible ? Qt : Jt}</span
1926
1929
  >
1927
1930
  ` : u;
1928
1931
  }
@@ -1931,9 +1934,9 @@ const $t = {
1931
1934
  return u;
1932
1935
  const o = {
1933
1936
  "pc-status": !0,
1934
- [`pc-flex-content-${z(this.statsPosition, this.statsAlign)}`]: !0
1937
+ [`pc-flex-content-${O(this.statsPosition, this.statsAlign)}`]: !0
1935
1938
  };
1936
- return c`<div class="${w(o)}" data-testid="pc-status">
1939
+ return c`<div class="${y(o)}" data-testid="pc-status">
1937
1940
  ${this.renderStatsText()} ${this.renderChartToggle()} ${this.renderEditToggleIcon()}
1938
1941
  </div>`;
1939
1942
  }
@@ -1970,7 +1973,7 @@ const $t = {
1970
1973
  }
1971
1974
  };
1972
1975
  oe.styles = [
1973
- U`
1976
+ V`
1974
1977
  :host {
1975
1978
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
1976
1979
  --default-font-size-base: 1rem;
@@ -2051,112 +2054,112 @@ oe.styles = [
2051
2054
  `
2052
2055
  ];
2053
2056
  let m = oe;
2054
- b([
2055
- f({ type: String, attribute: "show-stats" })
2057
+ v([
2058
+ h({ type: String, attribute: "show-stats" })
2056
2059
  ], m.prototype, "showStats");
2057
- b([
2058
- f({ type: Boolean, attribute: "show-chart" })
2060
+ v([
2061
+ h({ type: Boolean, attribute: "show-chart" })
2059
2062
  ], m.prototype, "showChart");
2060
- b([
2061
- f({ type: Boolean, attribute: "initialized" })
2063
+ v([
2064
+ h({ type: Boolean, attribute: "initialized" })
2062
2065
  ], m.prototype, "initialized");
2063
- b([
2064
- f({ type: String, attribute: "primary-color" })
2066
+ v([
2067
+ h({ type: String, attribute: "primary-color" })
2065
2068
  ], m.prototype, "primaryColor");
2066
- b([
2067
- f({ type: String, attribute: "mute-color" })
2069
+ v([
2070
+ h({ type: String, attribute: "mute-color" })
2068
2071
  ], m.prototype, "muteColor");
2069
- b([
2070
- f({ type: String, attribute: "text-color" })
2072
+ v([
2073
+ h({ type: String, attribute: "text-color" })
2071
2074
  ], m.prototype, "textColor");
2072
- b([
2073
- f({ type: String, attribute: "background-color" })
2075
+ v([
2076
+ h({ type: String, attribute: "background-color" })
2074
2077
  ], m.prototype, "backgroundColor");
2075
- b([
2076
- f({ type: String, attribute: "accent-color" })
2078
+ v([
2079
+ h({ type: String, attribute: "accent-color" })
2077
2080
  ], m.prototype, "accentColor");
2078
- b([
2079
- f({ type: String, attribute: "star-color" })
2081
+ v([
2082
+ h({ type: String, attribute: "star-color" })
2080
2083
  ], m.prototype, "starColor");
2081
- b([
2082
- f({ type: String, attribute: "star-hover-color" })
2084
+ v([
2085
+ h({ type: String, attribute: "star-hover-color" })
2083
2086
  ], m.prototype, "starHoverColor");
2084
- b([
2085
- f({ type: String, attribute: "star-size" })
2087
+ v([
2088
+ h({ type: String, attribute: "star-size" })
2086
2089
  ], m.prototype, "starSize");
2087
- b([
2088
- f({ type: String, attribute: "reaction-size" })
2090
+ v([
2091
+ h({ type: String, attribute: "reaction-size" })
2089
2092
  ], m.prototype, "reactionSize");
2090
- b([
2091
- f({ type: String })
2093
+ v([
2094
+ h({ type: String })
2092
2095
  ], m.prototype, "size");
2093
- b([
2094
- f({ type: String, attribute: "aria-label" })
2096
+ v([
2097
+ h({ type: String, attribute: "aria-label" })
2095
2098
  ], m.prototype, "ariaLabel");
2096
- b([
2097
- f({ type: String, attribute: "aria-describedby" })
2099
+ v([
2100
+ h({ type: String, attribute: "aria-describedby" })
2098
2101
  ], m.prototype, "ariaDescribedby");
2099
- b([
2100
- f({ type: Number, attribute: "min-contrast" })
2102
+ v([
2103
+ h({ type: Number, attribute: "min-contrast" })
2101
2104
  ], m.prototype, "minContrast");
2102
- b([
2103
- f({ type: String })
2105
+ v([
2106
+ h({ type: String })
2104
2107
  ], m.prototype, "css");
2105
- b([
2106
- f({ type: Array })
2108
+ v([
2109
+ h({ type: Array })
2107
2110
  ], m.prototype, "options");
2108
- b([
2109
- f({ type: String, attribute: "widget-id" })
2111
+ v([
2112
+ h({ type: String, attribute: "widget-id" })
2110
2113
  ], m.prototype, "widgetId");
2111
- b([
2112
- f({ type: String, attribute: "name" })
2114
+ v([
2115
+ h({ type: String, attribute: "name" })
2113
2116
  ], m.prototype, "name");
2114
- b([
2115
- f({ type: String })
2117
+ v([
2118
+ h({ type: String })
2116
2119
  ], m.prototype, "metadata");
2117
- b([
2118
- f({ type: String, attribute: "data-func" })
2120
+ v([
2121
+ h({ type: String, attribute: "data-func" })
2119
2122
  ], m.prototype, "dataFunc");
2120
- b([
2121
- f({ type: String, attribute: "data-endpoint" })
2123
+ v([
2124
+ h({ type: String, attribute: "data-endpoint" })
2122
2125
  ], m.prototype, "dataEndpoint");
2123
- b([
2124
- f({ type: String })
2126
+ v([
2127
+ h({ type: String })
2125
2128
  ], m.prototype, "question");
2126
- b([
2127
- f({ type: String, attribute: "question-position" })
2129
+ v([
2130
+ h({ type: String, attribute: "question-position" })
2128
2131
  ], m.prototype, "questionPosition");
2129
- b([
2130
- f({ type: String, attribute: "question-align" })
2132
+ v([
2133
+ h({ type: String, attribute: "question-align" })
2131
2134
  ], m.prototype, "questionAlign");
2132
- b([
2133
- f({ type: String, attribute: "stats-text" })
2135
+ v([
2136
+ h({ type: String, attribute: "stats-text" })
2134
2137
  ], m.prototype, "statsText");
2135
- b([
2136
- f({ type: String, attribute: "stats-position" })
2138
+ v([
2139
+ h({ type: String, attribute: "stats-position" })
2137
2140
  ], m.prototype, "statsPosition");
2138
- b([
2139
- f({ type: String, attribute: "stats-align" })
2141
+ v([
2142
+ h({ type: String, attribute: "stats-align" })
2140
2143
  ], m.prototype, "statsAlign");
2141
- b([
2142
- f({ type: String, attribute: "button-text" })
2144
+ v([
2145
+ h({ type: String, attribute: "button-text" })
2143
2146
  ], m.prototype, "buttonText");
2144
- b([
2145
- f({ type: String, attribute: "button-radius" })
2147
+ v([
2148
+ h({ type: String, attribute: "button-radius" })
2146
2149
  ], m.prototype, "buttonRadius");
2147
- b([
2148
- f({ type: String, attribute: "thank-you-msg" })
2150
+ v([
2151
+ h({ type: String, attribute: "thank-you-msg" })
2149
2152
  ], m.prototype, "thankYouMsg");
2150
- b([
2151
- f({ type: Boolean, attribute: "multiple" })
2153
+ v([
2154
+ h({ type: Boolean, attribute: "multiple" })
2152
2155
  ], m.prototype, "multiple");
2153
- b([
2154
- f({ type: Boolean, reflect: !0 })
2156
+ v([
2157
+ h({ type: Boolean, reflect: !0 })
2155
2158
  ], m.prototype, "inline");
2156
- b([
2157
- f({ type: Boolean, reflect: !0 })
2159
+ v([
2160
+ h({ type: Boolean, reflect: !0 })
2158
2161
  ], m.prototype, "readonly");
2159
- const tr = U`
2162
+ const tr = V`
2160
2163
  /* CSS variables inherit from parent - defaults are specified at usage sites */
2161
2164
 
2162
2165
  .pc-body {
@@ -2607,7 +2610,7 @@ const tr = U`
2607
2610
  animation: none;
2608
2611
  }
2609
2612
  }
2610
- `, It = U`
2613
+ `, It = V`
2611
2614
  /* Default values for CSS variables - can be overridden by external :root or parent definitions */
2612
2615
  :host {
2613
2616
  --default-primary-color: #2196f3;
@@ -3326,7 +3329,7 @@ const tr = U`
3326
3329
  opacity: 1;
3327
3330
  }
3328
3331
  }
3329
- `, er = U`
3332
+ `, er = V`
3330
3333
  :host {
3331
3334
  --popover-bg: light-dark(#ffffff, #1a1a1a);
3332
3335
  --popover-border: light-dark(#e0e0e0, #333333);
@@ -3448,21 +3451,21 @@ const tr = U`
3448
3451
  max-width: 100%;
3449
3452
  }
3450
3453
  `;
3451
- var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, V = (e, t, o, r) => {
3454
+ var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, j = (e, t, o, r) => {
3452
3455
  for (var s = r > 1 ? void 0 : r ? rr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3453
3456
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3454
3457
  return r && s && or(t, o, s), s;
3455
3458
  };
3456
- let I = class extends R {
3459
+ let _ = class extends B {
3457
3460
  constructor() {
3458
3461
  super(...arguments), this.open = !1, this.position = "auto", this.isClosing = !1, this.computedPosition = "bottom", this.popoverStyles = {}, this.arrowStyles = {}, this.updatePosition = () => {
3459
- var h;
3462
+ var f;
3460
3463
  if (!this.anchor || !this.open) return;
3461
- const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (h = this.popoverElement) == null ? void 0 : h.getBoundingClientRect(), i = (s == null ? void 0 : s.width) || 280, a = (s == null ? void 0 : s.height) || 200;
3464
+ const e = this.anchor.getBoundingClientRect(), t = window.innerWidth, o = window.innerHeight, r = 12, s = (f = this.popoverElement) == null ? void 0 : f.getBoundingClientRect(), i = (s == null ? void 0 : s.width) || 280, a = (s == null ? void 0 : s.height) || 200;
3462
3465
  let l = this.position;
3463
3466
  if (l === "auto") {
3464
- const v = o - e.bottom, x = e.top;
3465
- l = v >= a + r || v >= x ? "bottom" : "top";
3467
+ const b = o - e.bottom, w = e.top;
3468
+ l = b >= a + r || b >= w ? "bottom" : "top";
3466
3469
  }
3467
3470
  this.computedPosition = l;
3468
3471
  let n, d;
@@ -3526,7 +3529,7 @@ let I = class extends R {
3526
3529
  return c`
3527
3530
  <div class="pc-popover-scrim" @click=${this.handleScrimClick}></div>
3528
3531
  <div
3529
- class=${w(e)}
3532
+ class=${y(e)}
3530
3533
  data-position=${this.computedPosition}
3531
3534
  style=${Object.entries(this.popoverStyles).map(([t, o]) => `${t}: ${o}`).join("; ")}
3532
3535
  role="dialog"
@@ -3542,35 +3545,35 @@ let I = class extends R {
3542
3545
  `;
3543
3546
  }
3544
3547
  };
3545
- I.styles = [er];
3546
- V([
3547
- f({ type: Boolean, reflect: !0 })
3548
- ], I.prototype, "open", 2);
3549
- V([
3550
- f({ type: String })
3551
- ], I.prototype, "position", 2);
3552
- V([
3553
- f({ attribute: !1 })
3554
- ], I.prototype, "anchor", 2);
3555
- V([
3556
- A()
3557
- ], I.prototype, "isClosing", 2);
3558
- V([
3559
- A()
3560
- ], I.prototype, "computedPosition", 2);
3561
- V([
3562
- A()
3563
- ], I.prototype, "popoverStyles", 2);
3564
- V([
3565
- A()
3566
- ], I.prototype, "arrowStyles", 2);
3567
- V([
3548
+ _.styles = [er];
3549
+ j([
3550
+ h({ type: Boolean, reflect: !0 })
3551
+ ], _.prototype, "open", 2);
3552
+ j([
3553
+ h({ type: String })
3554
+ ], _.prototype, "position", 2);
3555
+ j([
3556
+ h({ attribute: !1 })
3557
+ ], _.prototype, "anchor", 2);
3558
+ j([
3559
+ C()
3560
+ ], _.prototype, "isClosing", 2);
3561
+ j([
3562
+ C()
3563
+ ], _.prototype, "computedPosition", 2);
3564
+ j([
3565
+ C()
3566
+ ], _.prototype, "popoverStyles", 2);
3567
+ j([
3568
+ C()
3569
+ ], _.prototype, "arrowStyles", 2);
3570
+ j([
3568
3571
  bt(".pc-popover")
3569
- ], I.prototype, "popoverElement", 2);
3570
- I = V([
3572
+ ], _.prototype, "popoverElement", 2);
3573
+ _ = j([
3571
3574
  W("pc-popover")
3572
- ], I);
3573
- const sr = U`
3575
+ ], _);
3576
+ const sr = V`
3574
3577
  :host {
3575
3578
  --sheet-bg: light-dark(#ffffff, #1a1a1a);
3576
3579
  --sheet-border: light-dark(#e0e0e0, #333333);
@@ -3683,12 +3686,12 @@ const sr = U`
3683
3686
  max-width: 100%;
3684
3687
  }
3685
3688
  `;
3686
- var ir = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, et = (e, t, o, r) => {
3689
+ var ir = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, ot = (e, t, o, r) => {
3687
3690
  for (var s = r > 1 ? void 0 : r ? ar(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3688
3691
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3689
3692
  return r && s && ir(t, o, s), s;
3690
3693
  };
3691
- let B = class extends R {
3694
+ let U = class extends B {
3692
3695
  constructor() {
3693
3696
  super(...arguments), this.open = !1, this.dragToClose = !0, this.isClosing = !1, this.isDragging = !1, this.dragOffset = 0, this.dragStartY = 0, this.sheetHeight = 0, this.handleKeyDown = (e) => {
3694
3697
  if (e.key === "Escape" && this.open && (e.preventDefault(), e.stopPropagation(), this.close()), e.key === "Tab" && this.open && this.sheetElement) {
@@ -3766,8 +3769,8 @@ let B = class extends R {
3766
3769
  dragging: this.isDragging
3767
3770
  };
3768
3771
  return c`
3769
- <div class=${w(e)} @click=${this.handleScrimClick}></div>
3770
- <div class=${w(t)} role="dialog" aria-modal="true" tabindex="-1">
3772
+ <div class=${y(e)} @click=${this.handleScrimClick}></div>
3773
+ <div class=${y(t)} role="dialog" aria-modal="true" tabindex="-1">
3771
3774
  <div
3772
3775
  class="pc-sheet-handle"
3773
3776
  @touchstart=${this.handleDragStart}
@@ -3782,35 +3785,35 @@ let B = class extends R {
3782
3785
  `;
3783
3786
  }
3784
3787
  };
3785
- B.styles = [sr];
3786
- et([
3787
- f({ type: Boolean, reflect: !0 })
3788
- ], B.prototype, "open", 2);
3789
- et([
3790
- f({ type: Boolean, attribute: "drag-to-close" })
3791
- ], B.prototype, "dragToClose", 2);
3792
- et([
3793
- A()
3794
- ], B.prototype, "isClosing", 2);
3795
- et([
3796
- A()
3797
- ], B.prototype, "isDragging", 2);
3798
- et([
3799
- A()
3800
- ], B.prototype, "dragOffset", 2);
3801
- et([
3788
+ U.styles = [sr];
3789
+ ot([
3790
+ h({ type: Boolean, reflect: !0 })
3791
+ ], U.prototype, "open", 2);
3792
+ ot([
3793
+ h({ type: Boolean, attribute: "drag-to-close" })
3794
+ ], U.prototype, "dragToClose", 2);
3795
+ ot([
3796
+ C()
3797
+ ], U.prototype, "isClosing", 2);
3798
+ ot([
3799
+ C()
3800
+ ], U.prototype, "isDragging", 2);
3801
+ ot([
3802
+ C()
3803
+ ], U.prototype, "dragOffset", 2);
3804
+ ot([
3802
3805
  bt(".pc-bottom-sheet")
3803
- ], B.prototype, "sheetElement", 2);
3804
- B = et([
3806
+ ], U.prototype, "sheetElement", 2);
3807
+ U = ot([
3805
3808
  W("pc-bottom-sheet")
3806
- ], B);
3809
+ ], U);
3807
3810
  var nr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, yt = (e, t, o, r) => {
3808
3811
  for (var s = r > 1 ? void 0 : r ? lr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3809
3812
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3810
3813
  return r && s && nr(t, o, s), s;
3811
3814
  };
3812
3815
  const cr = 768;
3813
- let Q = class extends R {
3816
+ let tt = class extends B {
3814
3817
  constructor() {
3815
3818
  super(...arguments), this.open = !1, this.position = "auto", this.isMobile = !1, this.handleMediaChange = (e) => {
3816
3819
  this.isMobile = e.matches;
@@ -3845,34 +3848,34 @@ let Q = class extends R {
3845
3848
  `;
3846
3849
  }
3847
3850
  };
3848
- Q.styles = U`
3851
+ tt.styles = V`
3849
3852
  :host {
3850
3853
  display: contents;
3851
3854
  }
3852
3855
  `;
3853
3856
  yt([
3854
- f({ type: Boolean, reflect: !0 })
3855
- ], Q.prototype, "open", 2);
3857
+ h({ type: Boolean, reflect: !0 })
3858
+ ], tt.prototype, "open", 2);
3856
3859
  yt([
3857
- f({ type: String })
3858
- ], Q.prototype, "position", 2);
3860
+ h({ type: String })
3861
+ ], tt.prototype, "position", 2);
3859
3862
  yt([
3860
- f({ attribute: !1 })
3861
- ], Q.prototype, "anchor", 2);
3863
+ h({ attribute: !1 })
3864
+ ], tt.prototype, "anchor", 2);
3862
3865
  yt([
3863
- A()
3864
- ], Q.prototype, "isMobile", 2);
3865
- Q = yt([
3866
+ C()
3867
+ ], tt.prototype, "isMobile", 2);
3868
+ tt = yt([
3866
3869
  W("pc-responsive-modal")
3867
- ], Q);
3870
+ ], tt);
3868
3871
  var dr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, K = (e, t, o, r) => {
3869
3872
  for (var s = r > 1 ? void 0 : r ? pr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
3870
3873
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
3871
3874
  return r && s && dr(t, o, s), s;
3872
3875
  };
3873
- let M = class extends m {
3876
+ let I = class extends m {
3874
3877
  constructor() {
3875
- super(), this.min = 0, this.max = 10, this.type = S.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.popoverOpen = !1, this.handleNumberLeave = () => {
3878
+ super(), this.min = 0, this.max = 10, this.type = x.nps, this.minLabel = "Not at all", this.maxLabel = "Extremely", this.minMaxPosition = "top", this.hoverValue = -1, this.popoverOpen = !1, this.handleNumberLeave = () => {
3876
3879
  this.hoverValue = -1;
3877
3880
  }, this.handleKeyDown = (e) => {
3878
3881
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.hoverValue >= 0 && this.handleNumberClick(this.hoverValue));
@@ -3882,8 +3885,8 @@ let M = class extends m {
3882
3885
  * Render NPS buttons for edit mode
3883
3886
  */
3884
3887
  renderNpsButtons() {
3885
- const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = st({
3886
- role: D.GROUP,
3888
+ const e = Array.from({ length: this.max - this.min + 1 }, (s, i) => i + this.min), t = `nps-control-${this.name || this.type}`, o = it({
3889
+ role: N.GROUP,
3887
3890
  ariaLabel: this.question || "NPS Rating",
3888
3891
  ariaDescribedby: `${t}-description`
3889
3892
  }), r = e.map((s) => {
@@ -3895,7 +3898,7 @@ let M = class extends m {
3895
3898
  <button
3896
3899
  data-testid="nps-button-${s}"
3897
3900
  ?disabled=${!this.displayController.allowEdit()}
3898
- class=${w(a)}
3901
+ class=${y(a)}
3899
3902
  @click="${() => this.handleNumberClick(s)}"
3900
3903
  @mouseenter="${() => this.handleNumberHover(s)}"
3901
3904
  @focus="${() => this.handleNumberHover(s)}"
@@ -3934,10 +3937,10 @@ let M = class extends m {
3934
3937
  * NPS score displayed prominently in the middle
3935
3938
  */
3936
3939
  renderChart() {
3937
- const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = ($) => ({
3938
- x: o + s * Math.cos($),
3939
- y: r - s * Math.sin($)
3940
- }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = ($, y, E = 0) => `M ${$.x} ${$.y} A ${s} ${s} 0 ${E} 1 ${y.x} ${y.y}`, h = p(a, l), v = p(l, n), x = p(n, d), P = (($) => Math.PI - ($ + 100) / 200 * Math.PI)(t), _ = i(P);
3940
+ const e = this.dataController.stats, t = (e == null ? void 0 : e.nps) ?? 0, o = 100, r = 100, s = 80, i = (k) => ({
3941
+ x: o + s * Math.cos(k),
3942
+ y: r - s * Math.sin(k)
3943
+ }), a = i(Math.PI), l = i(Math.PI / 2), n = i(Math.PI / 4), d = i(0), p = (k, $, A = 0) => `M ${k.x} ${k.y} A ${s} ${s} 0 ${A} 1 ${$.x} ${$.y}`, f = p(a, l), b = p(l, n), w = p(n, d), M = ((k) => Math.PI - (k + 100) / 200 * Math.PI)(t), L = i(M);
3941
3944
  return c`
3942
3945
  <div class="nps-semicircle-gauge" data-testid="nps-semicircle-gauge">
3943
3946
  <svg viewBox="0 0 200 115">
@@ -3948,12 +3951,12 @@ let M = class extends m {
3948
3951
  />
3949
3952
 
3950
3953
  <!-- Colored segments -->
3951
- <path class="gauge-arc gauge-arc-detractor" d="${h}" />
3952
- <path class="gauge-arc gauge-arc-passive" d="${v}" />
3953
- <path class="gauge-arc gauge-arc-promoter" d="${x}" />
3954
+ <path class="gauge-arc gauge-arc-detractor" d="${f}" />
3955
+ <path class="gauge-arc gauge-arc-passive" d="${b}" />
3956
+ <path class="gauge-arc gauge-arc-promoter" d="${w}" />
3954
3957
 
3955
3958
  <!-- Needle indicator -->
3956
- <circle class="gauge-needle" cx="${_.x}" cy="${_.y}" r="5" />
3959
+ <circle class="gauge-needle" cx="${L.x}" cy="${L.y}" r="5" />
3957
3960
 
3958
3961
  <!-- Score display in center -->
3959
3962
  <text class="gauge-score" x="${o}" y="${r - 15}">${t}</text>
@@ -4022,9 +4025,9 @@ let M = class extends m {
4022
4025
  </svg>
4023
4026
  </div>
4024
4027
  `;
4025
- const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, h = n / 100 * r, v = 0, x = -d, k = -(d + p), P = this.getUserScore();
4026
- let _ = "gauge-bg";
4027
- return P !== null && (P <= 6 ? _ = "gauge-detractor" : P <= 8 ? _ = "gauge-passive" : _ = "gauge-promoter"), c`
4028
+ const a = s.detractors / i * 100, l = s.passives / i * 100, n = s.promoters / i * 100, d = a / 100 * r, p = l / 100 * r, f = n / 100 * r, b = 0, w = -d, E = -(d + p), M = this.getUserScore();
4029
+ let L = "gauge-bg";
4030
+ return M !== null && (M <= 6 ? L = "gauge-detractor" : M <= 8 ? L = "gauge-passive" : L = "gauge-promoter"), c`
4028
4031
  <div class="inline-nps-gauge">
4029
4032
  <svg viewBox="0 0 20 20">
4030
4033
  <!-- Background circle -->
@@ -4036,7 +4039,7 @@ let M = class extends m {
4036
4039
  cy="10"
4037
4040
  r="${o}"
4038
4041
  stroke-dasharray="${d} ${r}"
4039
- stroke-dashoffset="${v}"
4042
+ stroke-dashoffset="${b}"
4040
4043
  />
4041
4044
  <!-- Passive segment (yellow) -->
4042
4045
  <circle
@@ -4045,7 +4048,7 @@ let M = class extends m {
4045
4048
  cy="10"
4046
4049
  r="${o}"
4047
4050
  stroke-dasharray="${p} ${r}"
4048
- stroke-dashoffset="${x}"
4051
+ stroke-dashoffset="${w}"
4049
4052
  />
4050
4053
  <!-- Promoter segment (green) -->
4051
4054
  <circle
@@ -4053,11 +4056,11 @@ let M = class extends m {
4053
4056
  cx="10"
4054
4057
  cy="10"
4055
4058
  r="${o}"
4056
- stroke-dasharray="${h} ${r}"
4057
- stroke-dashoffset="${k}"
4059
+ stroke-dasharray="${f} ${r}"
4060
+ stroke-dashoffset="${E}"
4058
4061
  />
4059
4062
  <!-- Center dot showing user's score category -->
4060
- <circle class="gauge-dot ${_}" cx="10" cy="10" r="2" />
4063
+ <circle class="gauge-dot ${L}" cx="10" cy="10" r="2" />
4061
4064
  </svg>
4062
4065
  </div>
4063
4066
  `;
@@ -4100,7 +4103,7 @@ let M = class extends m {
4100
4103
  };
4101
4104
  return c`
4102
4105
  <button
4103
- class=${w(i)}
4106
+ class=${y(i)}
4104
4107
  @click=${() => this.handlePopoverNumberClick(r)}
4105
4108
  @mouseenter=${() => this.handleNumberHover(r)}
4106
4109
  @mouseleave=${this.handleNumberLeave}
@@ -4134,7 +4137,7 @@ let M = class extends m {
4134
4137
  @keydown="${(e) => {
4135
4138
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
4136
4139
  }}"
4137
- >${this.displayController.isChartVisible ? Qt : Xt}</span
4140
+ >${this.displayController.isChartVisible ? Qt : Jt}</span
4138
4141
  >
4139
4142
  `;
4140
4143
  }
@@ -4203,16 +4206,16 @@ let M = class extends m {
4203
4206
  renderStandardMode() {
4204
4207
  const e = {
4205
4208
  [`pc-flex-pos-${this.questionPosition}`]: !0,
4206
- [`pc-flex-align-${z(this.questionPosition, this.questionAlign)}`]: !0
4209
+ [`pc-flex-align-${O(this.questionPosition, this.questionAlign)}`]: !0
4207
4210
  }, t = {
4208
4211
  nps: !0,
4209
4212
  [`pc-flex-pos-${this.statsPosition}`]: !0,
4210
- [`pc-flex-align-${z(this.statsPosition, this.statsAlign)}`]: !0
4213
+ [`pc-flex-align-${O(this.statsPosition, this.statsAlign)}`]: !0
4211
4214
  };
4212
4215
  return c`
4213
- <div class="pc-container ${w(e)}" data-testid="nps-container">
4216
+ <div class="pc-container ${y(e)}" data-testid="nps-container">
4214
4217
  ${this.renderLabelAtStart()}
4215
- <div class="pc-body ${w(t)}" data-testid="nps-body">
4218
+ <div class="pc-body ${y(t)}" data-testid="nps-body">
4216
4219
  ${this.renderStatusAtStart()} ${this.renderContent()} ${this.renderStatusAtEnd()}
4217
4220
  </div>
4218
4221
  ${this.renderLabelAtEnd()}
@@ -4226,32 +4229,32 @@ let M = class extends m {
4226
4229
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
4227
4230
  }
4228
4231
  };
4229
- M.styles = [...m.styles, It, tr];
4232
+ I.styles = [...m.styles, It, tr];
4230
4233
  K([
4231
- f({ type: String, attribute: "min-label" })
4232
- ], M.prototype, "minLabel", 2);
4234
+ h({ type: String, attribute: "min-label" })
4235
+ ], I.prototype, "minLabel", 2);
4233
4236
  K([
4234
- f({ type: String, attribute: "max-label" })
4235
- ], M.prototype, "maxLabel", 2);
4237
+ h({ type: String, attribute: "max-label" })
4238
+ ], I.prototype, "maxLabel", 2);
4236
4239
  K([
4237
- f({ type: String, attribute: "thank-you-msg" })
4238
- ], M.prototype, "thankYouMsg", 2);
4240
+ h({ type: String, attribute: "thank-you-msg" })
4241
+ ], I.prototype, "thankYouMsg", 2);
4239
4242
  K([
4240
- f({ type: String, attribute: "min-max-position" })
4241
- ], M.prototype, "minMaxPosition", 2);
4243
+ h({ type: String, attribute: "min-max-position" })
4244
+ ], I.prototype, "minMaxPosition", 2);
4242
4245
  K([
4243
- A()
4244
- ], M.prototype, "hoverValue", 2);
4246
+ C()
4247
+ ], I.prototype, "hoverValue", 2);
4245
4248
  K([
4246
- A()
4247
- ], M.prototype, "popoverOpen", 2);
4249
+ C()
4250
+ ], I.prototype, "popoverOpen", 2);
4248
4251
  K([
4249
4252
  bt(".pc-inline-trigger")
4250
- ], M.prototype, "triggerElement", 2);
4251
- M = K([
4253
+ ], I.prototype, "triggerElement", 2);
4254
+ I = K([
4252
4255
  W("pc-nps")
4253
- ], M);
4254
- const ur = U`
4256
+ ], I);
4257
+ const ur = V`
4255
4258
  /* CSS variables inherit from parent - defaults are specified at usage sites */
4256
4259
 
4257
4260
  .pc-container {
@@ -4641,16 +4644,16 @@ var hr = Object.defineProperty, fr = Object.getOwnPropertyDescriptor, wt = (e, t
4641
4644
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
4642
4645
  return r && s && hr(t, o, s), s;
4643
4646
  };
4644
- let tt = class extends m {
4647
+ let et = class extends m {
4645
4648
  constructor() {
4646
- 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";
4649
+ super(), this.type = x.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";
4647
4650
  }
4648
4651
  renderStatus() {
4649
4652
  const t = {
4650
4653
  "pc-status": !0,
4651
- [`pc-flex-content-${z("bottom", this.statsAlign)}`]: !0
4654
+ [`pc-flex-content-${O("bottom", this.statsAlign)}`]: !0
4652
4655
  };
4653
- return c`<div class="${w(t)}" data-testid="pc-status">
4656
+ return c`<div class="${y(t)}" data-testid="pc-status">
4654
4657
  <span>${this.renderStatsText()} ${this.renderEditToggleIcon("stats-edit-button")}</span>
4655
4658
  </div>`;
4656
4659
  }
@@ -4665,7 +4668,7 @@ let tt = class extends m {
4665
4668
  }, t = this.displayController.shouldDisableSubmitButton();
4666
4669
  return c`
4667
4670
  <button
4668
- class="${w(e)}"
4671
+ class="${y(e)}"
4669
4672
  data-testid="pc-submit-button"
4670
4673
  @click="${this.handleSubmit}"
4671
4674
  ?disabled="${t}"
@@ -4724,7 +4727,7 @@ let tt = class extends m {
4724
4727
  * Renders the selection indicator (checkbox or radio button) with proper ARIA roles
4725
4728
  */
4726
4729
  renderSelectionIndicator() {
4727
- const e = this.multiple ? D.CHECKBOX : D.RADIO;
4730
+ const e = this.multiple ? N.CHECKBOX : N.RADIO;
4728
4731
  return this.multiple ? c`<span class="poll-checkbox" role="${e}"></span>` : c`<span class="poll-radio" role="${e}"></span>`;
4729
4732
  }
4730
4733
  /**
@@ -4746,7 +4749,7 @@ let tt = class extends m {
4746
4749
  return c`
4747
4750
  <button
4748
4751
  data-testid="poll-option-i${t}"
4749
- class="${w(s)}"
4752
+ class="${y(s)}"
4750
4753
  @click="${(n) => {
4751
4754
  n.stopPropagation(), this.handleClick(e);
4752
4755
  }}"
@@ -4770,13 +4773,13 @@ let tt = class extends m {
4770
4773
  */
4771
4774
  renderPollOptions() {
4772
4775
  var s;
4773
- const e = this.multiple ? D.GROUP : D.RADIOGROUP, t = this.question || this.name || "Options", o = st({
4776
+ const e = this.multiple ? N.GROUP : N.RADIOGROUP, t = this.question || this.name || "Options", o = it({
4774
4777
  role: e,
4775
4778
  ariaLabel: t
4776
4779
  });
4777
4780
  return c`
4778
4781
  <div
4779
- class="${w({
4782
+ class="${y({
4780
4783
  "poll-container": !0
4781
4784
  })}"
4782
4785
  data-testid="poll-option-container"
@@ -4792,22 +4795,22 @@ let tt = class extends m {
4792
4795
  */
4793
4796
  renderBarChart() {
4794
4797
  var n, d;
4795
- const e = ((n = this.dataController.stats) == null ? void 0 : n.breakdown) || {}, t = ((d = this.dataController.localStats) == null ? void 0 : d.breakdown) || {}, o = Object.values(e).reduce((p, h) => p + h, 0), r = this.options.map((p, h) => {
4796
- const v = e[p.value] || 0, x = o > 0 ? Math.round(v / o * 100) : 0, k = (t[p.value] || 0) > 0;
4798
+ const e = ((n = this.dataController.stats) == null ? void 0 : n.breakdown) || {}, t = ((d = this.dataController.localStats) == null ? void 0 : d.breakdown) || {}, o = Object.values(e).reduce((p, f) => p + f, 0), r = this.options.map((p, f) => {
4799
+ const b = e[p.value] || 0, w = o > 0 ? Math.round(b / o * 100) : 0, E = (t[p.value] || 0) > 0;
4797
4800
  return {
4798
4801
  option: p,
4799
- index: h,
4800
- voteCount: v,
4801
- percentage: x,
4802
- isSelected: k
4802
+ index: f,
4803
+ voteCount: b,
4804
+ percentage: w,
4805
+ isSelected: E
4803
4806
  };
4804
- }), s = this.multiple ? D.GROUP : D.RADIOGROUP, i = this.question || this.name || "Options", a = st({
4807
+ }), s = this.multiple ? N.GROUP : N.RADIOGROUP, i = this.question || this.name || "Options", a = it({
4805
4808
  role: s,
4806
4809
  ariaLabel: i
4807
4810
  });
4808
4811
  return c`
4809
4812
  <div
4810
- class="${w({
4813
+ class="${y({
4811
4814
  "poll-container": !0
4812
4815
  })}"
4813
4816
  data-testid="poll-chart-container"
@@ -4815,7 +4818,7 @@ let tt = class extends m {
4815
4818
  ...=${a}
4816
4819
  >
4817
4820
  ${r.map((p) => {
4818
- const h = {
4821
+ const f = {
4819
4822
  "poll-option": !0,
4820
4823
  "poll-option--compact": this.compact,
4821
4824
  "poll-option--chart-view": !0,
@@ -4823,7 +4826,7 @@ let tt = class extends m {
4823
4826
  };
4824
4827
  return c`
4825
4828
  <div
4826
- class="${w(h)}"
4829
+ class="${y(f)}"
4827
4830
  data-testid="poll-chart-item-${p.index}"
4828
4831
  role="listitem"
4829
4832
  aria-label="${p.option.label}: ${p.percentage}% (${p.voteCount} votes)"
@@ -5027,25 +5030,25 @@ let tt = class extends m {
5027
5030
  * Render standard mode - original behavior
5028
5031
  */
5029
5032
  renderStandardMode() {
5030
- const e = z(this.questionPosition, this.questionAlign), t = {
5033
+ const e = O(this.questionPosition, this.questionAlign), t = {
5031
5034
  [`pc-flex-pos-${this.questionPosition}`]: !0,
5032
5035
  [`pc-flex-align-${e}`]: !0
5033
- }, o = z(this.statsPosition, this.statsAlign), r = {
5036
+ }, o = O(this.statsPosition, this.statsAlign), r = {
5034
5037
  "pc-body": !0,
5035
5038
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5036
5039
  [`pc-flex-align-${o}`]: !0
5037
- }, s = st({
5038
- role: D.REGION,
5040
+ }, s = it({
5041
+ role: N.REGION,
5039
5042
  ariaLabel: this.question || this.name || "Poll"
5040
5043
  });
5041
5044
  return c`
5042
5045
  <div
5043
- class="pc-container ${w(t)}"
5046
+ class="pc-container ${y(t)}"
5044
5047
  data-testid="poll-container"
5045
5048
  ...=${s}
5046
5049
  >
5047
5050
  ${this.renderLabelAtStart()}
5048
- <div class="${w(r)}" data-testid="poll-body">
5051
+ <div class="${y(r)}" data-testid="poll-body">
5049
5052
  ${this.renderContent()} ${this.renderFooter()}
5050
5053
  </div>
5051
5054
  ${this.renderLabelAtEnd()}
@@ -5056,23 +5059,23 @@ let tt = class extends m {
5056
5059
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5057
5060
  }
5058
5061
  };
5059
- tt.styles = [...m.styles, It, ur];
5062
+ et.styles = [...m.styles, It, ur];
5060
5063
  wt([
5061
- f({ type: Boolean })
5062
- ], tt.prototype, "multiple", 2);
5064
+ h({ type: Boolean })
5065
+ ], et.prototype, "multiple", 2);
5063
5066
  wt([
5064
- f({ type: Boolean })
5065
- ], tt.prototype, "compact", 2);
5067
+ h({ type: Boolean })
5068
+ ], et.prototype, "compact", 2);
5066
5069
  wt([
5067
- A()
5068
- ], tt.prototype, "popoverOpen", 2);
5070
+ C()
5071
+ ], et.prototype, "popoverOpen", 2);
5069
5072
  wt([
5070
5073
  bt(".pc-inline-trigger")
5071
- ], tt.prototype, "triggerElement", 2);
5072
- tt = wt([
5074
+ ], et.prototype, "triggerElement", 2);
5075
+ et = wt([
5073
5076
  W("pc-poll")
5074
- ], tt);
5075
- const gr = U`
5077
+ ], et);
5078
+ const gr = V`
5076
5079
  /* CSS variables inherit from parent - defaults are specified at usage sites */
5077
5080
 
5078
5081
  .pc-section {
@@ -5282,7 +5285,7 @@ const Ye = "important", mr = " !" + Ye, vr = He(class extends Fe {
5282
5285
  r.includes("-") || i ? o.setProperty(r, i ? s.slice(0, -11) : s, i ? Ye : "") : o[r] = s;
5283
5286
  }
5284
5287
  }
5285
- return H;
5288
+ return F;
5286
5289
  }
5287
5290
  });
5288
5291
  function Ct(e, t = {}) {
@@ -5464,14 +5467,14 @@ function Pt(e) {
5464
5467
  isRemoteImage: o
5465
5468
  };
5466
5469
  }
5467
- var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, nt = (e, t, o, r) => {
5470
+ var br = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
5468
5471
  for (var s = r > 1 ? void 0 : r ? yr(t, o) : t, i = e.length - 1, a; i >= 0; i--)
5469
5472
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
5470
5473
  return r && s && br(t, o, s), s;
5471
5474
  };
5472
- let F = class extends m {
5475
+ let Y = class extends m {
5473
5476
  constructor() {
5474
- super(), this.type = S.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
5477
+ super(), this.type = x.stars, this.icon = "★", this.numStars = 5, this.hoverValue = -1, this.popoverOpen = !1, this.handleStarKeyDown = (e) => {
5475
5478
  if (e.key === "Enter" || e.key === " ") {
5476
5479
  e.preventDefault();
5477
5480
  const t = e.target, o = parseInt(t.dataset.star || "0");
@@ -5510,22 +5513,22 @@ let F = class extends m {
5510
5513
  renderStars(e = !1) {
5511
5514
  var n;
5512
5515
  const t = this.getUserVotePosition(), o = this.dataController.stats, r = (o == null ? void 0 : o.avg) ?? 0, s = ((n = this.dataController.localStats) == null ? void 0 : n.avg) ?? 0, i = this.readonly ? r : s, a = this.displayController.allowEdit(), l = Array.from({ length: this.numStars }, (d, p) => p + 1).map((d) => {
5513
- const p = e ? t || 0 : Math.floor(i), h = d <= p || d <= (this.hoverValue || 0), v = !e && !h && d === Math.ceil(i) && i % 1 !== 0, x = {
5516
+ const p = e ? t || 0 : Math.floor(i), f = d <= p || d <= (this.hoverValue || 0), b = !e && !f && d === Math.ceil(i) && i % 1 !== 0, w = {
5514
5517
  star: !0,
5515
- selected: h,
5516
- partial: v,
5518
+ selected: f,
5519
+ partial: b,
5517
5520
  "view-mode": !a
5518
- }, k = v ? { "--partial-fill": `${i % 1 * 100}%` } : {}, P = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5521
+ }, E = b ? { "--partial-fill": `${i % 1 * 100}%` } : {}, M = e ? () => this.handlePopoverStarClick(d) : () => this.handleStarClick(d);
5519
5522
  return c`
5520
5523
  <div class="pc-section" data-testid="pc-section">
5521
5524
  <span
5522
5525
  data-testid="${e ? "popover" : "stars-view"}-star-${d}"
5523
- class=${w(x)}
5524
- style=${vr(k)}
5526
+ class=${y(w)}
5527
+ style=${vr(E)}
5525
5528
  role="${a ? "button" : "presentation"}"
5526
5529
  tabindex="${a ? "0" : ""}"
5527
5530
  aria-label="${a ? `Rate ${d} star${d > 1 ? "s" : ""}` : ""}"
5528
- @click="${P}"
5531
+ @click="${M}"
5529
5532
  @mouseenter="${() => this.handleStarHover(d)}"
5530
5533
  @focus="${() => this.handleStarHover(d)}"
5531
5534
  @mouseleave="${this.handleStarLeave}"
@@ -5616,7 +5619,7 @@ let F = class extends m {
5616
5619
  };
5617
5620
  return c`
5618
5621
  <button
5619
- class=${w(i)}
5622
+ class=${y(i)}
5620
5623
  @click=${() => {
5621
5624
  this.popoverOpen = !0;
5622
5625
  }}
@@ -5698,7 +5701,7 @@ let F = class extends m {
5698
5701
  @keydown="${(e) => {
5699
5702
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.displayController.toggleChartVisibility());
5700
5703
  }}"
5701
- >${this.displayController.isChartVisible ? Qt : Xt}</span
5704
+ >${this.displayController.isChartVisible ? Qt : Jt}</span
5702
5705
  >
5703
5706
  `;
5704
5707
  }
@@ -5756,18 +5759,18 @@ let F = class extends m {
5756
5759
  * Render standard mode - original behavior
5757
5760
  */
5758
5761
  renderStandardMode() {
5759
- const e = z(this.questionPosition, this.questionAlign), t = {
5762
+ const e = O(this.questionPosition, this.questionAlign), t = {
5760
5763
  [`pc-flex-pos-${this.questionPosition}`]: !0,
5761
5764
  [`pc-flex-align-${e}`]: !0
5762
- }, o = z(this.statsPosition, this.statsAlign), r = {
5765
+ }, o = O(this.statsPosition, this.statsAlign), r = {
5763
5766
  "pc-body": !0,
5764
5767
  [`pc-flex-pos-${this.statsPosition}`]: !0,
5765
5768
  [`pc-flex-align-${o}`]: !0
5766
5769
  }, s = !this.displayController.shouldShowChart();
5767
5770
  return c`
5768
- <div class="pc-container ${w(t)}" data-testid="pc-container">
5771
+ <div class="pc-container ${y(t)}" data-testid="pc-container">
5769
5772
  ${this.renderLabelAtStart()}
5770
- <div class="${w(r)}" data-testid="stars-body">
5773
+ <div class="${y(r)}" data-testid="stars-body">
5771
5774
  ${this.renderStatusAtStart()} ${this.renderChart()}
5772
5775
  ${s ? this.renderStars() : u} ${this.renderStatusAtEnd()}
5773
5776
  </div>
@@ -5779,26 +5782,26 @@ let F = class extends m {
5779
5782
  return this.inline ? this.renderInlineMode() : this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
5780
5783
  }
5781
5784
  };
5782
- F.styles = [...m.styles, It, gr];
5783
- nt([
5784
- f({ type: String })
5785
- ], F.prototype, "icon", 2);
5786
- nt([
5787
- f({ type: Number, attribute: "num-stars" })
5788
- ], F.prototype, "numStars", 2);
5789
- nt([
5790
- A()
5791
- ], F.prototype, "hoverValue", 2);
5792
- nt([
5793
- A()
5794
- ], F.prototype, "popoverOpen", 2);
5795
- nt([
5785
+ Y.styles = [...m.styles, It, gr];
5786
+ lt([
5787
+ h({ type: String })
5788
+ ], Y.prototype, "icon", 2);
5789
+ lt([
5790
+ h({ type: Number, attribute: "num-stars" })
5791
+ ], Y.prototype, "numStars", 2);
5792
+ lt([
5793
+ C()
5794
+ ], Y.prototype, "hoverValue", 2);
5795
+ lt([
5796
+ C()
5797
+ ], Y.prototype, "popoverOpen", 2);
5798
+ lt([
5796
5799
  bt(".pc-inline-trigger")
5797
- ], F.prototype, "triggerElement", 2);
5798
- F = nt([
5800
+ ], Y.prototype, "triggerElement", 2);
5801
+ Y = lt([
5799
5802
  W("pc-stars")
5800
- ], F);
5801
- const wr = U`
5803
+ ], Y);
5804
+ const wr = V`
5802
5805
  /* Adjust stats text for reactions */
5803
5806
  .pc-stats-text {
5804
5807
  font-size: var(--pc-font-size-small, var(--default-font-size-small));
@@ -6067,9 +6070,9 @@ var $r = Object.defineProperty, Sr = Object.getOwnPropertyDescriptor, zt = (e, t
6067
6070
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6068
6071
  return r && s && $r(t, o, s), s;
6069
6072
  };
6070
- let at = class extends m {
6073
+ let nt = class extends m {
6071
6074
  constructor() {
6072
- super(), this.type = S.reaction, this.showCounts = !1, this.compact = !1, this.popupPosition = "auto", this.hasEditButton = !1, this.statsText = "{count} votes", this.buttonRadius = "990px", this.muteColor = "#cccccc", this.questionPosition = "top", this.statsPosition = "right", this.popupPosition = "auto";
6075
+ super(), this.type = x.reaction, this.showCounts = !1, this.compact = !1, this.popupPosition = "auto", this.hasEditButton = !1, this.statsText = "{count} votes", this.buttonRadius = "990px", this.muteColor = "#cccccc", this.questionPosition = "top", this.statsPosition = "right", this.popupPosition = "auto";
6073
6076
  }
6074
6077
  /**
6075
6078
  * Get the display count for a specific reaction including local optimistic updates
@@ -6118,7 +6121,7 @@ let at = class extends m {
6118
6121
  }, l = `${e.tooltip || e.value} reaction${o ? ", selected" : ""}${t ? `, ${r} votes` : ""}`;
6119
6122
  return c`
6120
6123
  <button
6121
- class="${w(a)}"
6124
+ class="${y(a)}"
6122
6125
  @click="${() => this.handleReactionClick(e)}"
6123
6126
  ?disabled="${s}"
6124
6127
  aria-pressed="${o}"
@@ -6160,7 +6163,7 @@ let at = class extends m {
6160
6163
  bottom: this.popupPosition === "bottom" || this.popupPosition === "auto" && !this.shouldShowPopoverOnTop()
6161
6164
  };
6162
6165
  return c`
6163
- <div class="${w(e)}" role="menu">
6166
+ <div class="${y(e)}" role="menu">
6164
6167
  <div class="popover-content">
6165
6168
  ${this.options.map((t) => {
6166
6169
  const o = this.displayController.shouldDisableOption(t);
@@ -6207,7 +6210,7 @@ let at = class extends m {
6207
6210
  (o) => this.dataController.isValueSelected(o.value)
6208
6211
  );
6209
6212
  return c`
6210
- <div class="${w(e)}">
6213
+ <div class="${y(e)}">
6211
6214
  ${t.length > 0 ? c`
6212
6215
  <div class="reaction-list">
6213
6216
  ${t.map(
@@ -6220,7 +6223,7 @@ let at = class extends m {
6220
6223
  `;
6221
6224
  } else
6222
6225
  return c`
6223
- <div class="${w(e)}">
6226
+ <div class="${y(e)}">
6224
6227
  <div class="reaction-list">
6225
6228
  ${this.options.map((t) => this.renderReactionButton(t, this.showCounts))}
6226
6229
  </div>
@@ -6235,7 +6238,7 @@ let at = class extends m {
6235
6238
  const e = this.dataController.getBreakdownInfo(), o = Object.entries(e.breakdownCount).filter(
6236
6239
  ([n, d]) => this.options.some((p) => p.value === n)
6237
6240
  ).map(([n, d]) => {
6238
- const p = this.options.find((h) => h.value === n);
6241
+ const p = this.options.find((f) => f.value === n);
6239
6242
  return {
6240
6243
  label: n,
6241
6244
  // Use the reaction value as label
@@ -6284,18 +6287,18 @@ let at = class extends m {
6284
6287
  * (Reactions are inherently inline, so inline mode = standard mode)
6285
6288
  */
6286
6289
  renderStandardMode() {
6287
- const e = z(this.questionPosition, this.questionAlign), t = {
6290
+ const e = O(this.questionPosition, this.questionAlign), t = {
6288
6291
  [`pc-flex-pos-${this.questionPosition}`]: !0,
6289
6292
  [`pc-flex-align-${e}`]: !0
6290
- }, o = z(this.statsPosition, this.statsAlign), r = {
6293
+ }, o = O(this.statsPosition, this.statsAlign), r = {
6291
6294
  "pc-body": !0,
6292
6295
  [`pc-flex-pos-${this.statsPosition}`]: !0,
6293
6296
  [`pc-flex-align-${o}`]: !0
6294
6297
  };
6295
6298
  return c`
6296
- <div class="${w(t)}" data-testid="reaction-container">
6299
+ <div class="${y(t)}" data-testid="reaction-container">
6297
6300
  ${this.renderLabelAtStart()}
6298
- <div class="${w(r)}" data-testid="reaction-body">
6301
+ <div class="${y(r)}" data-testid="reaction-body">
6299
6302
  ${this.renderStatusAtStart()} ${this.renderChart()} ${this.renderReactions()}
6300
6303
  ${this.renderStatusAtEnd()}
6301
6304
  </div>
@@ -6307,19 +6310,19 @@ let at = class extends m {
6307
6310
  return this.readonly ? this.renderReadonlyMode() : this.renderStandardMode();
6308
6311
  }
6309
6312
  };
6310
- at.styles = [...m.styles, It, wr];
6313
+ nt.styles = [...m.styles, It, wr];
6311
6314
  zt([
6312
- f({ type: Boolean, attribute: "show-counts" })
6313
- ], at.prototype, "showCounts", 2);
6315
+ h({ type: Boolean, attribute: "show-counts" })
6316
+ ], nt.prototype, "showCounts", 2);
6314
6317
  zt([
6315
- f({ type: Boolean, reflect: !0 })
6316
- ], at.prototype, "compact", 2);
6318
+ h({ type: Boolean, reflect: !0 })
6319
+ ], nt.prototype, "compact", 2);
6317
6320
  zt([
6318
- f({ type: String, attribute: "popup-position" })
6319
- ], at.prototype, "popupPosition", 2);
6320
- at = zt([
6321
+ h({ type: String, attribute: "popup-position" })
6322
+ ], nt.prototype, "popupPosition", 2);
6323
+ nt = zt([
6321
6324
  W("pc-reaction")
6322
- ], at);
6325
+ ], nt);
6323
6326
  function dt(e, t, o = void 0) {
6324
6327
  const r = e.getAttribute(t);
6325
6328
  return r === null ? o : r == null ? void 0 : r.trim();
@@ -6328,14 +6331,15 @@ function Cr(e, t = void 0) {
6328
6331
  const o = e.textContent;
6329
6332
  return o === "" || o === null ? t : o == null ? void 0 : o.trim();
6330
6333
  }
6331
- var kr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, lt = (e, t, o, r) => {
6334
+ var kr = Object.defineProperty, Er = Object.getOwnPropertyDescriptor, G = (e, t, o, r) => {
6332
6335
  for (var s = r > 1 ? void 0 : r ? Er(t, o) : t, i = e.length - 1, a; i >= 0; i--)
6333
6336
  (a = e[i]) && (s = (r ? a(t, o, s) : a(s)) || s);
6334
6337
  return r && s && kr(t, o, s), s;
6335
6338
  };
6336
- let Y = class extends R {
6339
+ const Ar = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6340
+ let z = class extends B {
6337
6341
  constructor() {
6338
- super(), this.options = "", this.parsedOptions = [], this.isLoadingType = !1, Y.injectGlobalStyle();
6342
+ super(), this.options = "", this.parsedOptions = [], this.isPrefetching = !1, z.injectGlobalStyle();
6339
6343
  }
6340
6344
  /**
6341
6345
  * Inject global style to hide poll-catch-option elements
@@ -6360,41 +6364,7 @@ let Y = class extends R {
6360
6364
  return this;
6361
6365
  }
6362
6366
  connectedCallback() {
6363
- super.connectedCallback(), this.maybeFetchType();
6364
- }
6365
- async maybeFetchType() {
6366
- var t, o, r, s, i, a, l, n, d, p, h, v, x, k;
6367
- if (this.type || !this.widgetId) return;
6368
- if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(this.widgetId)) {
6369
- g.error(`poll-catch: Invalid widget-id format: ${this.widgetId}`);
6370
- return;
6371
- }
6372
- this.isLoadingType = !0;
6373
- try {
6374
- const _ = `${this.getAttribute("data-endpoint") || Yt}/widgets/${encodeURIComponent(this.widgetId)}`, $ = await fetch(_);
6375
- if (!$.ok)
6376
- throw new Error(`API request failed with status: ${$.status}`);
6377
- const y = await $.json();
6378
- if (!y.success)
6379
- throw new Error("Backend returned unsuccessful response");
6380
- const E = (o = (t = y.data) == null ? void 0 : t.config) == null ? void 0 : o.type;
6381
- if (!E)
6382
- throw new Error("Backend response missing widget type");
6383
- Wo(this.widgetId, {
6384
- type: E,
6385
- attributes: ((s = (r = y.data) == null ? void 0 : r.config) == null ? void 0 : s.attributes) || null,
6386
- stats: {
6387
- count: ((a = (i = y.data) == null ? void 0 : i.stats) == null ? void 0 : a.count) ?? 0,
6388
- sum: ((n = (l = y.data) == null ? void 0 : l.stats) == null ? void 0 : n.sum) ?? 0,
6389
- breakdown: ((p = (d = y.data) == null ? void 0 : d.stats) == null ? void 0 : p.breakdown) ?? {},
6390
- updatedAt: ((v = (h = y.data) == null ? void 0 : h.stats) == null ? void 0 : v.updatedAt) || ((k = (x = y.data) == null ? void 0 : x.stats) == null ? void 0 : k.updated_at)
6391
- }
6392
- }), this.type = E, await this.updateComplete, this.forceUpdate();
6393
- } catch (P) {
6394
- g.error("poll-catch: Failed to fetch widget config", P);
6395
- } finally {
6396
- this.isLoadingType = !1;
6397
- }
6367
+ super.connectedCallback(), this.widgetId && !this.type && !this.dataFunc && this.prefetchWidgetConfig();
6398
6368
  }
6399
6369
  forceUpdate() {
6400
6370
  this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
@@ -6414,6 +6384,44 @@ let Y = class extends R {
6414
6384
  this.forwardAttributesToWidget();
6415
6385
  });
6416
6386
  }
6387
+ /**
6388
+ * Prefetch widget config from the API to determine widget type
6389
+ */
6390
+ async prefetchWidgetConfig() {
6391
+ var e, t;
6392
+ if (!this.widgetId || !Ar.test(this.widgetId)) {
6393
+ g.warn(`poll-catch: Invalid widget-id format for prefetch: ${this.widgetId}`);
6394
+ return;
6395
+ }
6396
+ this.isPrefetching = !0;
6397
+ try {
6398
+ const r = `${this.dataEndpoint || Yt}/widgets/${encodeURIComponent(this.widgetId)}`;
6399
+ g.debug("poll-catch: Prefetching widget config", { url: r });
6400
+ const s = await fetch(r);
6401
+ if (!s.ok)
6402
+ throw new Error(`API request failed with status: ${s.status}`);
6403
+ const i = await s.json();
6404
+ if (!i.success)
6405
+ throw new Error("Backend returned unsuccessful response");
6406
+ const a = (e = i.data) == null ? void 0 : e.config, l = (t = i.data) == null ? void 0 : t.stats;
6407
+ if (!(a != null && a.type) || !Object.values(x).includes(a.type))
6408
+ throw new Error(`Invalid widget type from server: ${a == null ? void 0 : a.type}`);
6409
+ Wo(this.widgetId, {
6410
+ config: { type: a.type, attributes: a.attributes || null },
6411
+ stats: {
6412
+ count: (l == null ? void 0 : l.count) ?? 0,
6413
+ sum: (l == null ? void 0 : l.sum) ?? 0,
6414
+ breakdown: (l == null ? void 0 : l.breakdown) ?? {},
6415
+ updatedAt: (l == null ? void 0 : l.updatedAt) || (l == null ? void 0 : l.updated_at)
6416
+ }
6417
+ }), this.type = a.type;
6418
+ } catch (o) {
6419
+ g.warn("poll-catch: Failed to prefetch widget config", o);
6420
+ } finally {
6421
+ this.isPrefetching = !1;
6422
+ }
6423
+ this.requestUpdate(), await this.updateComplete, this.forwardAttributesToWidget(), this.forwardOptionsToWidget();
6424
+ }
6417
6425
  /**
6418
6426
  * Forward all attributes except 'type' to the child widget
6419
6427
  */
@@ -6440,8 +6448,8 @@ let Y = class extends R {
6440
6448
  t && t.length > 0 && (r = Array.from(t).map((s) => {
6441
6449
  const i = dt(s, "value", "") || "", a = dt(s, "label", Cr(s, i)) || "", l = dt(s, "icon", void 0), n = dt(s, "tooltip", void 0), d = dt(s, "disabled", void 0), p = { value: i, label: a };
6442
6450
  if (l !== void 0) {
6443
- const h = Pt(l);
6444
- p.icon = h.icon;
6451
+ const f = Pt(l);
6452
+ p.icon = f.icon;
6445
6453
  }
6446
6454
  return n !== void 0 && (p.tooltip = n), d !== void 0 && (p.disabled = !0), p;
6447
6455
  })), this.parsedOptions = r;
@@ -6450,16 +6458,16 @@ let Y = class extends R {
6450
6458
  * Render the appropriate widget based on the type
6451
6459
  */
6452
6460
  render() {
6453
- if (this.isLoadingType)
6461
+ if (this.isPrefetching)
6454
6462
  return u;
6455
6463
  switch (this.type) {
6456
- case S.nps:
6464
+ case x.nps:
6457
6465
  return c`<pc-nps></pc-nps>`;
6458
- case S.poll:
6466
+ case x.poll:
6459
6467
  return c`<pc-poll .options=${this.parsedOptions}></pc-poll>`;
6460
- case S.stars:
6468
+ case x.stars:
6461
6469
  return c`<pc-stars></pc-stars>`;
6462
- case S.reaction:
6470
+ case x.reaction:
6463
6471
  return c`<pc-reaction .options=${this.parsedOptions}></pc-reaction>`;
6464
6472
  default:
6465
6473
  return this.widgetId || console.warn(
@@ -6468,24 +6476,30 @@ let Y = class extends R {
6468
6476
  }
6469
6477
  }
6470
6478
  };
6471
- lt([
6472
- f({ type: String })
6473
- ], Y.prototype, "type", 2);
6474
- lt([
6475
- f({ type: String, attribute: "widget-id" })
6476
- ], Y.prototype, "widgetId", 2);
6477
- lt([
6478
- f({ type: String })
6479
- ], Y.prototype, "options", 2);
6480
- lt([
6481
- A()
6482
- ], Y.prototype, "parsedOptions", 2);
6483
- lt([
6484
- A()
6485
- ], Y.prototype, "isLoadingType", 2);
6486
- Y = lt([
6479
+ G([
6480
+ h({ type: String })
6481
+ ], z.prototype, "type", 2);
6482
+ G([
6483
+ h({ type: String })
6484
+ ], z.prototype, "options", 2);
6485
+ G([
6486
+ h({ type: String, attribute: "widget-id" })
6487
+ ], z.prototype, "widgetId", 2);
6488
+ G([
6489
+ h({ type: String, attribute: "data-endpoint" })
6490
+ ], z.prototype, "dataEndpoint", 2);
6491
+ G([
6492
+ h({ type: String, attribute: "data-func" })
6493
+ ], z.prototype, "dataFunc", 2);
6494
+ G([
6495
+ C()
6496
+ ], z.prototype, "parsedOptions", 2);
6497
+ G([
6498
+ C()
6499
+ ], z.prototype, "isPrefetching", 2);
6500
+ z = G([
6487
6501
  W("poll-catch")
6488
- ], Y);
6502
+ ], z);
6489
6503
  export {
6490
- Y as PollCatch
6504
+ z as PollCatch
6491
6505
  };