@gamention/pulse-elements 0.1.20 → 0.1.22

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.
@@ -3,7 +3,7 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
5
  */
6
- let kt = class extends Event {
6
+ let Et = class extends Event {
7
7
  constructor(e, t, i, s) {
8
8
  super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = s ?? !1;
9
9
  }
@@ -18,7 +18,7 @@ let kt = class extends Event {
18
18
  * Copyright 2021 Google LLC
19
19
  * SPDX-License-Identifier: BSD-3-Clause
20
20
  */
21
- let Ge = class {
21
+ let Je = class {
22
22
  constructor(e, t, i, s) {
23
23
  if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
24
24
  this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
@@ -35,7 +35,7 @@ let Ge = class {
35
35
  this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
36
36
  }
37
37
  dispatchRequest() {
38
- this.host.dispatchEvent(new kt(this.context, this.host, this.t, this.subscribe));
38
+ this.host.dispatchEvent(new Et(this.context, this.host, this.t, this.subscribe));
39
39
  }
40
40
  };
41
41
  /**
@@ -43,7 +43,7 @@ let Ge = class {
43
43
  * Copyright 2021 Google LLC
44
44
  * SPDX-License-Identifier: BSD-3-Clause
45
45
  */
46
- let jt = class {
46
+ let Ut = class {
47
47
  get value() {
48
48
  return this.o;
49
49
  }
@@ -80,7 +80,7 @@ let zt = class extends Event {
80
80
  constructor(e, t) {
81
81
  super("context-provider", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t;
82
82
  }
83
- }, Je = class extends jt {
83
+ }, Ze = class extends Ut {
84
84
  constructor(e, t, i) {
85
85
  var s, o;
86
86
  super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
@@ -90,7 +90,7 @@ let zt = class extends Event {
90
90
  }, this.onProviderRequest = (r) => {
91
91
  if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
92
92
  const a = /* @__PURE__ */ new Set();
93
- for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new kt(this.context, d, l, !0)));
93
+ for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new Et(this.context, d, l, !0)));
94
94
  r.stopPropagation();
95
95
  }, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (s = this.host).addController) == null || o.call(s, this);
96
96
  }
@@ -106,7 +106,7 @@ let zt = class extends Event {
106
106
  * Copyright 2017 Google LLC
107
107
  * SPDX-License-Identifier: BSD-3-Clause
108
108
  */
109
- function Ut({ context: n }) {
109
+ function Dt({ context: n }) {
110
110
  return (e, t) => {
111
111
  const i = /* @__PURE__ */ new WeakMap();
112
112
  if (typeof t == "object") return { get() {
@@ -114,11 +114,11 @@ function Ut({ context: n }) {
114
114
  }, set(s) {
115
115
  return i.get(this).setValue(s), e.set.call(this, s);
116
116
  }, init(s) {
117
- return i.set(this, new Je(this, { context: n, initialValue: s })), s;
117
+ return i.set(this, new Ze(this, { context: n, initialValue: s })), s;
118
118
  } };
119
119
  {
120
120
  e.constructor.addInitializer(((r) => {
121
- i.set(r, new Je(r, { context: n }));
121
+ i.set(r, new Ze(r, { context: n }));
122
122
  }));
123
123
  const s = Object.getOwnPropertyDescriptor(e, t);
124
124
  let o;
@@ -147,17 +147,17 @@ function Ut({ context: n }) {
147
147
  function fe({ context: n, subscribe: e }) {
148
148
  return (t, i) => {
149
149
  typeof i == "object" ? i.addInitializer((function() {
150
- new Ge(this, { context: n, callback: (s) => {
150
+ new Je(this, { context: n, callback: (s) => {
151
151
  t.set.call(this, s);
152
152
  }, subscribe: e });
153
153
  })) : t.constructor.addInitializer(((s) => {
154
- new Ge(s, { context: n, callback: (o) => {
154
+ new Je(s, { context: n, callback: (o) => {
155
155
  s[i] = o;
156
156
  }, subscribe: e });
157
157
  }));
158
158
  };
159
159
  }
160
- var Dt = Object.defineProperty, Ht = (n, e, t) => e in n ? Dt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, k = (n, e, t) => Ht(n, typeof e != "symbol" ? e + "" : e, t);
160
+ var Ht = Object.defineProperty, Bt = (n, e, t) => e in n ? Ht(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, E = (n, e, t) => Bt(n, typeof e != "symbol" ? e + "" : e, t);
161
161
  const _e = {
162
162
  allowImages: !0,
163
163
  allowAudio: !0,
@@ -170,10 +170,10 @@ const _e = {
170
170
  showCursors: !0,
171
171
  showPresence: !0,
172
172
  showTypingIndicators: !0
173
- }, Nt = "ws://localhost:4567", Ze = 50, Bt = 3e4, Ft = 1e3, qt = 3e4;
174
- let He = class {
173
+ }, Nt = "ws://localhost:4567", Qe = 50, Ft = 3e4, qt = 1e3, Vt = 3e4;
174
+ let Be = class {
175
175
  constructor() {
176
- k(this, "handlers", /* @__PURE__ */ new Map());
176
+ E(this, "handlers", /* @__PURE__ */ new Map());
177
177
  }
178
178
  on(e, t) {
179
179
  this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
@@ -191,9 +191,9 @@ let He = class {
191
191
  removeAll() {
192
192
  this.handlers.clear();
193
193
  }
194
- }, Vt = class extends He {
194
+ }, Wt = class extends Be {
195
195
  constructor(e) {
196
- super(), k(this, "ws", null), k(this, "endpoint"), k(this, "reconnectAttempt", 0), k(this, "reconnectTimer", null), k(this, "_state", "disconnected"), this.endpoint = e ?? Nt;
196
+ super(), E(this, "ws", null), E(this, "endpoint"), E(this, "reconnectAttempt", 0), E(this, "reconnectTimer", null), E(this, "_state", "disconnected"), this.endpoint = e ?? Nt;
197
197
  }
198
198
  get state() {
199
199
  return this._state;
@@ -221,16 +221,16 @@ let He = class {
221
221
  }
222
222
  scheduleReconnect() {
223
223
  const e = Math.min(
224
- Ft * 2 ** this.reconnectAttempt,
225
- qt
224
+ qt * 2 ** this.reconnectAttempt,
225
+ Vt
226
226
  );
227
227
  this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
228
228
  this.reconnectTimer = null, this.connect();
229
229
  }, e);
230
230
  }
231
- }, Wt = class extends He {
231
+ }, Xt = class extends Be {
232
232
  constructor() {
233
- super(...arguments), k(this, "baseUrl", ""), k(this, "_user", null), k(this, "_config", { ..._e }), k(this, "_users", /* @__PURE__ */ new Map()), k(this, "_presence", /* @__PURE__ */ new Map()), k(this, "_threads", /* @__PURE__ */ new Map()), k(this, "_reactions", /* @__PURE__ */ new Map()), k(this, "_notifications", []), k(this, "_activityLogs", []), k(this, "_typing", /* @__PURE__ */ new Map()), k(this, "_viewports", /* @__PURE__ */ new Map()), k(this, "_selections", /* @__PURE__ */ new Map());
233
+ super(...arguments), E(this, "baseUrl", ""), E(this, "_user", null), E(this, "_config", { ..._e }), E(this, "_users", /* @__PURE__ */ new Map()), E(this, "_presence", /* @__PURE__ */ new Map()), E(this, "_threads", /* @__PURE__ */ new Map()), E(this, "_reactions", /* @__PURE__ */ new Map()), E(this, "_notifications", []), E(this, "_activityLogs", []), E(this, "_typing", /* @__PURE__ */ new Map()), E(this, "_viewports", /* @__PURE__ */ new Map()), E(this, "_selections", /* @__PURE__ */ new Map());
234
234
  }
235
235
  get user() {
236
236
  return this._user;
@@ -278,6 +278,10 @@ let He = class {
278
278
  getUser(e) {
279
279
  return this._users.get(e);
280
280
  }
281
+ /** Get all known users (from presence + comment authors). */
282
+ get users() {
283
+ return [...this._users.values()];
284
+ }
281
285
  getReactions(e) {
282
286
  return this._reactions.get(e) ?? [];
283
287
  }
@@ -453,12 +457,12 @@ let He = class {
453
457
  reset() {
454
458
  this._user = null, this._config = { ..._e }, this._users.clear(), this._presence.clear(), this._threads.clear(), this._reactions.clear(), this._notifications = [], this._activityLogs = [], this._typing.clear(), this._viewports.clear(), this._selections.clear();
455
459
  }
456
- }, Et = class extends He {
460
+ }, Ct = class extends Be {
457
461
  constructor(e) {
458
462
  var t;
459
- super(), k(this, "state"), k(this, "connection"), k(this, "config"), k(this, "heartbeatTimer", null), k(this, "lastCursorSend", 0), k(this, "pendingCursor", null), k(this, "cursorTimer", null), this.config = e, this.state = new Wt(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
463
+ super(), E(this, "state"), E(this, "connection"), E(this, "config"), E(this, "heartbeatTimer", null), E(this, "lastCursorSend", 0), E(this, "pendingCursor", null), E(this, "cursorTimer", null), this.config = e, this.state = new Xt(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
460
464
  const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
461
- this.connection = new Vt(i), this.connection.on("message", (s) => {
465
+ this.connection = new Wt(i), this.connection.on("message", (s) => {
462
466
  this.state.handleMessage(s), this.emit(s.type, s);
463
467
  }), this.connection.on("state", (s) => {
464
468
  this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
@@ -488,9 +492,9 @@ let He = class {
488
492
  // ── Cursors ──
489
493
  moveCursor(e) {
490
494
  const t = Date.now();
491
- this.pendingCursor = e, t - this.lastCursorSend >= Ze ? this.flushCursor() : this.cursorTimer || (this.cursorTimer = setTimeout(() => {
495
+ this.pendingCursor = e, t - this.lastCursorSend >= Qe ? this.flushCursor() : this.cursorTimer || (this.cursorTimer = setTimeout(() => {
492
496
  this.cursorTimer = null, this.flushCursor();
493
- }, Ze));
497
+ }, Qe));
494
498
  }
495
499
  flushCursor() {
496
500
  this.pendingCursor && (this.send({ type: "cursor:move", position: this.pendingCursor }), this.lastCursorSend = Date.now(), this.pendingCursor = null);
@@ -502,7 +506,7 @@ let He = class {
502
506
  startHeartbeat() {
503
507
  this.heartbeatTimer = setInterval(() => {
504
508
  this.send({ type: "presence:update", status: "online" });
505
- }, Bt);
509
+ }, Ft);
506
510
  }
507
511
  stopHeartbeat() {
508
512
  this.heartbeatTimer && (clearInterval(this.heartbeatTimer), this.heartbeatTimer = null);
@@ -602,10 +606,10 @@ let He = class {
602
606
  * Copyright 2019 Google LLC
603
607
  * SPDX-License-Identifier: BSD-3-Clause
604
608
  */
605
- const ye = globalThis, Ne = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Be = Symbol(), Qe = /* @__PURE__ */ new WeakMap();
606
- let Ct = class {
609
+ const ye = globalThis, Ne = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Fe = Symbol(), et = /* @__PURE__ */ new WeakMap();
610
+ let Tt = class {
607
611
  constructor(e, t, i) {
608
- if (this._$cssResult$ = !0, i !== Be) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
612
+ if (this._$cssResult$ = !0, i !== Fe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
609
613
  this.cssText = e, this.t = t;
610
614
  }
611
615
  get styleSheet() {
@@ -613,7 +617,7 @@ let Ct = class {
613
617
  const t = this.t;
614
618
  if (Ne && e === void 0) {
615
619
  const i = t !== void 0 && t.length === 1;
616
- i && (e = Qe.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Qe.set(t, e));
620
+ i && (e = et.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && et.set(t, e));
617
621
  }
618
622
  return e;
619
623
  }
@@ -621,33 +625,33 @@ let Ct = class {
621
625
  return this.cssText;
622
626
  }
623
627
  };
624
- const Xt = (n) => new Ct(typeof n == "string" ? n : n + "", void 0, Be), O = (n, ...e) => {
628
+ const Yt = (n) => new Tt(typeof n == "string" ? n : n + "", void 0, Fe), O = (n, ...e) => {
625
629
  const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
626
630
  if (r._$cssResult$ === !0) return r.cssText;
627
631
  if (typeof r == "number") return r;
628
632
  throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
629
633
  })(s) + n[o + 1], n[0]);
630
- return new Ct(t, n, Be);
631
- }, Yt = (n, e) => {
634
+ return new Tt(t, n, Fe);
635
+ }, Kt = (n, e) => {
632
636
  if (Ne) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
633
637
  else for (const t of e) {
634
638
  const i = document.createElement("style"), s = ye.litNonce;
635
639
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
636
640
  }
637
- }, et = Ne ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
641
+ }, tt = Ne ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
638
642
  let t = "";
639
643
  for (const i of e.cssRules) t += i.cssText;
640
- return Xt(t);
644
+ return Yt(t);
641
645
  })(n) : n;
642
646
  /**
643
647
  * @license
644
648
  * Copyright 2017 Google LLC
645
649
  * SPDX-License-Identifier: BSD-3-Clause
646
650
  */
647
- const { is: Kt, defineProperty: Gt, getOwnPropertyDescriptor: Jt, getOwnPropertyNames: Zt, getOwnPropertySymbols: Qt, getPrototypeOf: ei } = Object, H = globalThis, tt = H.trustedTypes, ti = tt ? tt.emptyScript : "", Ie = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
651
+ const { is: Gt, defineProperty: Jt, getOwnPropertyDescriptor: Zt, getOwnPropertyNames: Qt, getOwnPropertySymbols: ei, getPrototypeOf: ti } = Object, H = globalThis, it = H.trustedTypes, ii = it ? it.emptyScript : "", Ie = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
648
652
  switch (e) {
649
653
  case Boolean:
650
- n = n ? ti : null;
654
+ n = n ? ii : null;
651
655
  break;
652
656
  case Object:
653
657
  case Array:
@@ -672,7 +676,7 @@ const { is: Kt, defineProperty: Gt, getOwnPropertyDescriptor: Jt, getOwnProperty
672
676
  }
673
677
  }
674
678
  return t;
675
- } }, Fe = (n, e) => !Kt(n, e), it = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Fe };
679
+ } }, qe = (n, e) => !Gt(n, e), st = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: qe };
676
680
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
677
681
  let G = class extends HTMLElement {
678
682
  static addInitializer(e) {
@@ -681,14 +685,14 @@ let G = class extends HTMLElement {
681
685
  static get observedAttributes() {
682
686
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
683
687
  }
684
- static createProperty(e, t = it) {
688
+ static createProperty(e, t = st) {
685
689
  if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
686
690
  const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
687
- s !== void 0 && Gt(this.prototype, e, s);
691
+ s !== void 0 && Jt(this.prototype, e, s);
688
692
  }
689
693
  }
690
694
  static getPropertyDescriptor(e, t, i) {
691
- const { get: s, set: o } = Jt(this.prototype, e) ?? { get() {
695
+ const { get: s, set: o } = Zt(this.prototype, e) ?? { get() {
692
696
  return this[t];
693
697
  }, set(r) {
694
698
  this[t] = r;
@@ -699,17 +703,17 @@ let G = class extends HTMLElement {
699
703
  }, configurable: !0, enumerable: !0 };
700
704
  }
701
705
  static getPropertyOptions(e) {
702
- return this.elementProperties.get(e) ?? it;
706
+ return this.elementProperties.get(e) ?? st;
703
707
  }
704
708
  static _$Ei() {
705
709
  if (this.hasOwnProperty(ne("elementProperties"))) return;
706
- const e = ei(this);
710
+ const e = ti(this);
707
711
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
708
712
  }
709
713
  static finalize() {
710
714
  if (this.hasOwnProperty(ne("finalized"))) return;
711
715
  if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
712
- const t = this.properties, i = [...Zt(t), ...Qt(t)];
716
+ const t = this.properties, i = [...Qt(t), ...ei(t)];
713
717
  for (const s of i) this.createProperty(s, t[s]);
714
718
  }
715
719
  const e = this[Symbol.metadata];
@@ -728,8 +732,8 @@ let G = class extends HTMLElement {
728
732
  const t = [];
729
733
  if (Array.isArray(e)) {
730
734
  const i = new Set(e.flat(1 / 0).reverse());
731
- for (const s of i) t.unshift(et(s));
732
- } else e !== void 0 && t.push(et(e));
735
+ for (const s of i) t.unshift(tt(s));
736
+ } else e !== void 0 && t.push(tt(e));
733
737
  return t;
734
738
  }
735
739
  static _$Eu(e, t) {
@@ -758,7 +762,7 @@ let G = class extends HTMLElement {
758
762
  }
759
763
  createRenderRoot() {
760
764
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
761
- return Yt(e, this.constructor.elementStyles), e;
765
+ return Kt(e, this.constructor.elementStyles), e;
762
766
  }
763
767
  connectedCallback() {
764
768
  var e;
@@ -801,7 +805,7 @@ let G = class extends HTMLElement {
801
805
  var r;
802
806
  if (e !== void 0) {
803
807
  const a = this.constructor;
804
- if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Fe)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
808
+ if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? qe)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
805
809
  this.C(e, t, i);
806
810
  }
807
811
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
@@ -883,50 +887,50 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementPrope
883
887
  * Copyright 2017 Google LLC
884
888
  * SPDX-License-Identifier: BSD-3-Clause
885
889
  */
886
- const oe = globalThis, st = (n) => n, Ee = oe.trustedTypes, nt = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Tt = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, St = "?" + D, ii = `<${St}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", qe = Array.isArray, si = (n) => qe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Me = `[
887
- \f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ot = /-->/g, rt = />/g, B = RegExp(`>|${Me}(?:([^\\s"'>=/]+)(${Me}*=${Me}*(?:[^
888
- \f\r"'\`<>=]|("|')|))|$)`, "g"), at = /'/g, lt = /"/g, At = /^(?:script|style|textarea|title)$/i, Pt = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = Pt(1), ni = Pt(2), W = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
889
- function _t(n, e) {
890
- if (!qe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
891
- return nt !== void 0 ? nt.createHTML(e) : e;
890
+ const oe = globalThis, nt = (n) => n, Ee = oe.trustedTypes, ot = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, St = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, At = "?" + D, si = `<${At}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Ve = Array.isArray, ni = (n) => Ve(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Me = `[
891
+ \f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, at = />/g, N = RegExp(`>|${Me}(?:([^\\s"'>=/]+)(${Me}*=${Me}*(?:[^
892
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), lt = /'/g, ct = /"/g, Pt = /^(?:script|style|textarea|title)$/i, _t = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), p = _t(1), oi = _t(2), W = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), dt = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
893
+ function It(n, e) {
894
+ if (!Ve(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
895
+ return ot !== void 0 ? ot.createHTML(e) : e;
892
896
  }
893
- const oi = (n, e) => {
897
+ const ri = (n, e) => {
894
898
  const t = n.length - 1, i = [];
895
899
  let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
896
900
  for (let a = 0; a < t; a++) {
897
901
  const l = n[a];
898
- let d, c, h = -1, p = 0;
899
- for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = ot : c[1] !== void 0 ? r = rt : c[2] !== void 0 ? (At.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = B) : c[3] !== void 0 && (r = B) : r === B ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? B : c[3] === '"' ? lt : at) : r === lt || r === at ? r = B : r === ot || r === rt ? r = se : (r = B, s = void 0);
900
- const m = r === B && n[a + 1].startsWith("/>") ? " " : "";
901
- o += r === se ? l + ii : h >= 0 ? (i.push(d), l.slice(0, h) + Tt + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
902
+ let d, c, h = -1, u = 0;
903
+ for (; u < l.length && (r.lastIndex = u, c = r.exec(l), c !== null); ) u = r.lastIndex, r === se ? c[1] === "!--" ? r = rt : c[1] !== void 0 ? r = at : c[2] !== void 0 ? (Pt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = N) : c[3] !== void 0 && (r = N) : r === N ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? N : c[3] === '"' ? ct : lt) : r === ct || r === lt ? r = N : r === rt || r === at ? r = se : (r = N, s = void 0);
904
+ const f = r === N && n[a + 1].startsWith("/>") ? " " : "";
905
+ o += r === se ? l + si : h >= 0 ? (i.push(d), l.slice(0, h) + St + l.slice(h) + D + f) : l + D + (h === -2 ? a : f);
902
906
  }
903
- return [_t(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
907
+ return [It(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
904
908
  };
905
909
  class ce {
906
910
  constructor({ strings: e, _$litType$: t }, i) {
907
911
  let s;
908
912
  this.parts = [];
909
913
  let o = 0, r = 0;
910
- const a = e.length - 1, l = this.parts, [d, c] = oi(e, t);
914
+ const a = e.length - 1, l = this.parts, [d, c] = ri(e, t);
911
915
  if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
912
916
  const h = this.el.content.firstChild;
913
917
  h.replaceWith(...h.childNodes);
914
918
  }
915
919
  for (; (s = F.nextNode()) !== null && l.length < a; ) {
916
920
  if (s.nodeType === 1) {
917
- if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Tt)) {
918
- const p = c[r++], m = s.getAttribute(h).split(D), g = /([.?@])?(.*)/.exec(p);
919
- l.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ai : g[1] === "?" ? li : g[1] === "@" ? ci : Se }), s.removeAttribute(h);
921
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(St)) {
922
+ const u = c[r++], f = s.getAttribute(h).split(D), b = /([.?@])?(.*)/.exec(u);
923
+ l.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? li : b[1] === "?" ? ci : b[1] === "@" ? di : Se }), s.removeAttribute(h);
920
924
  } else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
921
- if (At.test(s.tagName)) {
922
- const h = s.textContent.split(D), p = h.length - 1;
923
- if (p > 0) {
925
+ if (Pt.test(s.tagName)) {
926
+ const h = s.textContent.split(D), u = h.length - 1;
927
+ if (u > 0) {
924
928
  s.textContent = Ee ? Ee.emptyScript : "";
925
- for (let m = 0; m < p; m++) s.append(h[m], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
926
- s.append(h[p], ae());
929
+ for (let f = 0; f < u; f++) s.append(h[f], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
930
+ s.append(h[u], ae());
927
931
  }
928
932
  }
929
- } else if (s.nodeType === 8) if (s.data === St) l.push({ type: 2, index: o });
933
+ } else if (s.nodeType === 8) if (s.data === At) l.push({ type: 2, index: o });
930
934
  else {
931
935
  let h = -1;
932
936
  for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
@@ -946,7 +950,7 @@ function J(n, e, t = n, i) {
946
950
  const o = le(e) ? void 0 : e._$litDirective$;
947
951
  return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = J(n, s._$AS(n, e.values), s, i)), e;
948
952
  }
949
- class ri {
953
+ class ai {
950
954
  constructor(e, t) {
951
955
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
952
956
  }
@@ -963,7 +967,7 @@ class ri {
963
967
  for (; l !== void 0; ) {
964
968
  if (r === l.index) {
965
969
  let d;
966
- l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new di(o, this, e)), this._$AV.push(d), l = i[++a];
970
+ l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new hi(o, this, e)), this._$AV.push(d), l = i[++a];
967
971
  }
968
972
  r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
969
973
  }
@@ -980,7 +984,7 @@ class me {
980
984
  return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
981
985
  }
982
986
  constructor(e, t, i, s) {
983
- this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
987
+ this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
984
988
  }
985
989
  get parentNode() {
986
990
  let e = this._$AA.parentNode;
@@ -994,7 +998,7 @@ class me {
994
998
  return this._$AB;
995
999
  }
996
1000
  _$AI(e, t = this) {
997
- e = J(this, e, t), le(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : si(e) ? this.k(e) : this._(e);
1001
+ e = J(this, e, t), le(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ni(e) ? this.k(e) : this._(e);
998
1002
  }
999
1003
  O(e) {
1000
1004
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -1003,23 +1007,23 @@ class me {
1003
1007
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
1004
1008
  }
1005
1009
  _(e) {
1006
- this._$AH !== v && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
1010
+ this._$AH !== g && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
1007
1011
  }
1008
1012
  $(e) {
1009
1013
  var o;
1010
- const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(_t(i.h, i.h[0]), this.options)), i);
1014
+ const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(It(i.h, i.h[0]), this.options)), i);
1011
1015
  if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
1012
1016
  else {
1013
- const r = new ri(s, this), a = r.u(this.options);
1017
+ const r = new ai(s, this), a = r.u(this.options);
1014
1018
  r.p(t), this.T(a), this._$AH = r;
1015
1019
  }
1016
1020
  }
1017
1021
  _$AC(e) {
1018
- let t = ct.get(e.strings);
1019
- return t === void 0 && ct.set(e.strings, t = new ce(e)), t;
1022
+ let t = dt.get(e.strings);
1023
+ return t === void 0 && dt.set(e.strings, t = new ce(e)), t;
1020
1024
  }
1021
1025
  k(e) {
1022
- qe(this._$AH) || (this._$AH = [], this._$AR());
1026
+ Ve(this._$AH) || (this._$AH = [], this._$AR());
1023
1027
  const t = this._$AH;
1024
1028
  let i, s = 0;
1025
1029
  for (const o of e) s === t.length ? t.push(i = new me(this.O(ae()), this.O(ae()), this, this.options)) : i = t[s], i._$AI(o), s++;
@@ -1028,8 +1032,8 @@ class me {
1028
1032
  _$AR(e = this._$AA.nextSibling, t) {
1029
1033
  var i;
1030
1034
  for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
1031
- const s = st(e).nextSibling;
1032
- st(e).remove(), e = s;
1035
+ const s = nt(e).nextSibling;
1036
+ nt(e).remove(), e = s;
1033
1037
  }
1034
1038
  }
1035
1039
  setConnected(e) {
@@ -1045,7 +1049,7 @@ class Se {
1045
1049
  return this._$AM._$AU;
1046
1050
  }
1047
1051
  constructor(e, t, i, s, o) {
1048
- this.type = 1, this._$AH = v, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
1052
+ this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
1049
1053
  }
1050
1054
  _$AI(e, t = this, i, s) {
1051
1055
  const o = this.strings;
@@ -1054,37 +1058,37 @@ class Se {
1054
1058
  else {
1055
1059
  const a = e;
1056
1060
  let l, d;
1057
- for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === v ? e = v : e !== v && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1061
+ for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === g ? e = g : e !== g && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1058
1062
  }
1059
1063
  r && !s && this.j(e);
1060
1064
  }
1061
1065
  j(e) {
1062
- e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1066
+ e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1063
1067
  }
1064
1068
  }
1065
- class ai extends Se {
1069
+ class li extends Se {
1066
1070
  constructor() {
1067
1071
  super(...arguments), this.type = 3;
1068
1072
  }
1069
1073
  j(e) {
1070
- this.element[this.name] = e === v ? void 0 : e;
1074
+ this.element[this.name] = e === g ? void 0 : e;
1071
1075
  }
1072
1076
  }
1073
- class li extends Se {
1077
+ class ci extends Se {
1074
1078
  constructor() {
1075
1079
  super(...arguments), this.type = 4;
1076
1080
  }
1077
1081
  j(e) {
1078
- this.element.toggleAttribute(this.name, !!e && e !== v);
1082
+ this.element.toggleAttribute(this.name, !!e && e !== g);
1079
1083
  }
1080
1084
  }
1081
- class ci extends Se {
1085
+ class di extends Se {
1082
1086
  constructor(e, t, i, s, o) {
1083
1087
  super(e, t, i, s, o), this.type = 5;
1084
1088
  }
1085
1089
  _$AI(e, t = this) {
1086
- if ((e = J(this, e, t, 0) ?? v) === W) return;
1087
- const i = this._$AH, s = e === v && i !== v || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== v && (i === v || s);
1090
+ if ((e = J(this, e, t, 0) ?? g) === W) return;
1091
+ const i = this._$AH, s = e === g && i !== g || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== g && (i === g || s);
1088
1092
  s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
1089
1093
  }
1090
1094
  handleEvent(e) {
@@ -1092,7 +1096,7 @@ class ci extends Se {
1092
1096
  typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
1093
1097
  }
1094
1098
  }
1095
- class di {
1099
+ class hi {
1096
1100
  constructor(e, t, i) {
1097
1101
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
1098
1102
  }
@@ -1105,7 +1109,7 @@ class di {
1105
1109
  }
1106
1110
  const Oe = oe.litHtmlPolyfillSupport;
1107
1111
  Oe == null || Oe(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
1108
- const hi = (n, e, t) => {
1112
+ const pi = (n, e, t) => {
1109
1113
  const i = (t == null ? void 0 : t.renderBefore) ?? e;
1110
1114
  let s = i._$litPart$;
1111
1115
  if (s === void 0) {
@@ -1120,7 +1124,7 @@ const hi = (n, e, t) => {
1120
1124
  * SPDX-License-Identifier: BSD-3-Clause
1121
1125
  */
1122
1126
  const q = globalThis;
1123
- let P = class extends G {
1127
+ let _ = class extends G {
1124
1128
  constructor() {
1125
1129
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1126
1130
  }
@@ -1131,7 +1135,7 @@ let P = class extends G {
1131
1135
  }
1132
1136
  update(e) {
1133
1137
  const t = this.render();
1134
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = hi(t, this.renderRoot, this.renderOptions);
1138
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = pi(t, this.renderRoot, this.renderOptions);
1135
1139
  }
1136
1140
  connectedCallback() {
1137
1141
  var e;
@@ -1145,10 +1149,10 @@ let P = class extends G {
1145
1149
  return W;
1146
1150
  }
1147
1151
  };
1148
- var $t;
1149
- P._$litElement$ = !0, P.finalized = !0, ($t = q.litElementHydrateSupport) == null || $t.call(q, { LitElement: P });
1152
+ var kt;
1153
+ _._$litElement$ = !0, _.finalized = !0, (kt = q.litElementHydrateSupport) == null || kt.call(q, { LitElement: _ });
1150
1154
  const Re = q.litElementPolyfillSupport;
1151
- Re == null || Re({ LitElement: P });
1155
+ Re == null || Re({ LitElement: _ });
1152
1156
  (q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
1153
1157
  /**
1154
1158
  * @license
@@ -1165,7 +1169,7 @@ const L = (n) => (e, t) => {
1165
1169
  * Copyright 2017 Google LLC
1166
1170
  * SPDX-License-Identifier: BSD-3-Clause
1167
1171
  */
1168
- const pi = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Fe }, ui = (n = pi, e, t) => {
1172
+ const ui = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: qe }, fi = (n = ui, e, t) => {
1169
1173
  const { kind: i, metadata: s } = t;
1170
1174
  let o = globalThis.litPropertyMetadata.get(s);
1171
1175
  if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
@@ -1186,8 +1190,8 @@ const pi = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged
1186
1190
  }
1187
1191
  throw Error("Unsupported decorator location: " + i);
1188
1192
  };
1189
- function x(n) {
1190
- return (e, t) => typeof t == "object" ? ui(n, e, t) : ((i, s, o) => {
1193
+ function w(n) {
1194
+ return (e, t) => typeof t == "object" ? fi(n, e, t) : ((i, s, o) => {
1191
1195
  const r = s.hasOwnProperty(o);
1192
1196
  return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
1193
1197
  })(n, e, t);
@@ -1197,16 +1201,16 @@ function x(n) {
1197
1201
  * Copyright 2017 Google LLC
1198
1202
  * SPDX-License-Identifier: BSD-3-Clause
1199
1203
  */
1200
- function $(n) {
1201
- return x({ ...n, state: !0, attribute: !1 });
1204
+ function k(n) {
1205
+ return w({ ...n, state: !0, attribute: !1 });
1202
1206
  }
1203
1207
  const Q = "pulse-client";
1204
- var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
1205
- for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1208
+ var mi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
1209
+ for (var s = i > 1 ? void 0 : i ? gi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1206
1210
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1207
- return i && s && fi(e, t, s), s;
1211
+ return i && s && mi(e, t, s), s;
1208
1212
  };
1209
- let X = class extends P {
1213
+ let X = class extends _ {
1210
1214
  constructor() {
1211
1215
  super(...arguments), this.apiKey = "", this.token = "", this.room = "";
1212
1216
  }
@@ -1218,40 +1222,40 @@ let X = class extends P {
1218
1222
  room: this.room,
1219
1223
  endpoint: this.endpoint
1220
1224
  };
1221
- this.client = new Et(n), this.client.connect();
1225
+ this.client = new Ct(n), this.client.connect();
1222
1226
  }
1223
1227
  disconnectedCallback() {
1224
1228
  var n;
1225
1229
  super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
1226
1230
  }
1227
1231
  render() {
1228
- return u`<slot></slot>`;
1232
+ return p`<slot></slot>`;
1229
1233
  }
1230
1234
  };
1231
1235
  ee([
1232
- x({ attribute: "api-key" })
1236
+ w({ attribute: "api-key" })
1233
1237
  ], X.prototype, "apiKey", 2);
1234
1238
  ee([
1235
- x()
1239
+ w()
1236
1240
  ], X.prototype, "token", 2);
1237
1241
  ee([
1238
- x()
1242
+ w()
1239
1243
  ], X.prototype, "room", 2);
1240
1244
  ee([
1241
- x()
1245
+ w()
1242
1246
  ], X.prototype, "endpoint", 2);
1243
1247
  ee([
1244
- Ut({ context: Q })
1248
+ Dt({ context: Q })
1245
1249
  ], X.prototype, "client", 2);
1246
1250
  X = ee([
1247
1251
  L("pulse-provider")
1248
1252
  ], X);
1249
- var gi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Ae = (n, e, t, i) => {
1250
- for (var s = i > 1 ? void 0 : i ? vi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1253
+ var vi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ae = (n, e, t, i) => {
1254
+ for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1251
1255
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1252
- return i && s && gi(e, t, s), s;
1256
+ return i && s && vi(e, t, s), s;
1253
1257
  };
1254
- let Z = class extends P {
1258
+ let Z = class extends _ {
1255
1259
  constructor() {
1256
1260
  super(...arguments), this.maxVisible = 5, this.users = [];
1257
1261
  }
@@ -1276,16 +1280,16 @@ let Z = class extends P {
1276
1280
  }
1277
1281
  render() {
1278
1282
  const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
1279
- return u`
1283
+ return p`
1280
1284
  <div class="avatars">
1281
- ${e > 0 ? u`<div class="overflow">+${e}</div>` : null}
1285
+ ${e > 0 ? p`<div class="overflow">+${e}</div>` : null}
1282
1286
  ${n.map(
1283
- (t) => u`
1287
+ (t) => p`
1284
1288
  <div
1285
1289
  class="avatar"
1286
1290
  style="background:${t.user.color}"
1287
1291
  >
1288
- ${t.user.avatar ? u`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1292
+ ${t.user.avatar ? p`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1289
1293
  <span class="status-ring ${t.status}"></span>
1290
1294
  <span class="tooltip">${t.user.name}</span>
1291
1295
  </div>
@@ -1401,23 +1405,23 @@ Z.styles = O`
1401
1405
  `;
1402
1406
  Ae([
1403
1407
  fe({ context: Q, subscribe: !0 }),
1404
- x({ attribute: !1 })
1408
+ w({ attribute: !1 })
1405
1409
  ], Z.prototype, "client", 2);
1406
1410
  Ae([
1407
- x({ type: Number, attribute: "max-visible" })
1411
+ w({ type: Number, attribute: "max-visible" })
1408
1412
  ], Z.prototype, "maxVisible", 2);
1409
1413
  Ae([
1410
- $()
1414
+ k()
1411
1415
  ], Z.prototype, "users", 2);
1412
1416
  Z = Ae([
1413
1417
  L("pulse-presence")
1414
1418
  ], Z);
1415
- var bi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
1416
- for (var s = i > 1 ? void 0 : i ? xi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1419
+ var xi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
1420
+ for (var s = i > 1 ? void 0 : i ? yi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1417
1421
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1418
- return i && s && bi(e, t, s), s;
1422
+ return i && s && xi(e, t, s), s;
1419
1423
  };
1420
- let de = class extends P {
1424
+ let de = class extends _ {
1421
1425
  constructor() {
1422
1426
  super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
1423
1427
  var e;
@@ -1471,9 +1475,9 @@ let de = class extends P {
1471
1475
  }
1472
1476
  render() {
1473
1477
  const n = [...this.cursors.values()];
1474
- return u`
1478
+ return p`
1475
1479
  ${n.map(
1476
- (e) => u`
1480
+ (e) => p`
1477
1481
  <div
1478
1482
  class="cursor"
1479
1483
  style="transform:translate(${e.position.x}px,${e.position.y}px)"
@@ -1531,22 +1535,22 @@ de.styles = O`
1531
1535
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
1532
1536
  }
1533
1537
  `;
1534
- Ve([
1538
+ We([
1535
1539
  fe({ context: Q, subscribe: !0 }),
1536
- x({ attribute: !1 })
1540
+ w({ attribute: !1 })
1537
1541
  ], de.prototype, "client", 2);
1538
- Ve([
1539
- $()
1542
+ We([
1543
+ k()
1540
1544
  ], de.prototype, "cursors", 2);
1541
- de = Ve([
1545
+ de = We([
1542
1546
  L("pulse-cursors")
1543
1547
  ], de);
1544
- var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
1545
- for (var s = i > 1 ? void 0 : i ? wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1548
+ var wi = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
1549
+ for (var s = i > 1 ? void 0 : i ? $i(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1546
1550
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1547
- return i && s && yi(e, t, s), s;
1551
+ return i && s && wi(e, t, s), s;
1548
1552
  };
1549
- let Y = class extends P {
1553
+ let Y = class extends _ {
1550
1554
  constructor() {
1551
1555
  super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
1552
1556
  }
@@ -1568,7 +1572,7 @@ let Y = class extends P {
1568
1572
  }
1569
1573
  parseMentions(n) {
1570
1574
  return n.split(/(@\w+)/g).map(
1571
- (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
1575
+ (t) => t.startsWith("@") ? p`<span class="mention">${t}</span>` : t
1572
1576
  );
1573
1577
  }
1574
1578
  getInitials(n) {
@@ -1594,9 +1598,9 @@ let Y = class extends P {
1594
1598
  }
1595
1599
  render() {
1596
1600
  const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
1597
- return u`
1601
+ return p`
1598
1602
  <div class="threads">
1599
- ${n.length === 0 ? u`<div class="empty">
1603
+ ${n.length === 0 ? p`<div class="empty">
1600
1604
  <div class="empty-icon">&#128172;</div>
1601
1605
  No comments yet.<br>Start a conversation below.
1602
1606
  </div>` : n.map((e) => this.renderThread(e))}
@@ -1610,12 +1614,12 @@ let Y = class extends P {
1610
1614
  `;
1611
1615
  }
1612
1616
  renderThread(n) {
1613
- return u`
1617
+ return p`
1614
1618
  <div class="thread ${n.resolved ? "resolved" : ""}">
1615
1619
  ${n.comments.map((e, t) => {
1616
1620
  const i = this.getUserForComment(e.userId);
1617
- return u`
1618
- ${t > 0 ? u`<div class="divider"></div>` : v}
1621
+ return p`
1622
+ ${t > 0 ? p`<div class="divider"></div>` : g}
1619
1623
  <div class="comment">
1620
1624
  <div class="comment-header">
1621
1625
  <div
@@ -1647,12 +1651,12 @@ let Y = class extends P {
1647
1651
  ${n.resolved ? "Reopen" : "Resolve"}
1648
1652
  </button>
1649
1653
  </div>
1650
- ${this.replyingTo === n.id ? u`
1654
+ ${this.replyingTo === n.id ? p`
1651
1655
  <form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
1652
1656
  <input type="text" placeholder="Write a reply..." />
1653
1657
  <button type="submit">Send</button>
1654
1658
  </form>
1655
- ` : v}
1659
+ ` : g}
1656
1660
  </div>
1657
1661
  `;
1658
1662
  }
@@ -1878,39 +1882,39 @@ Y.styles = O`
1878
1882
  `;
1879
1883
  ge([
1880
1884
  fe({ context: Q, subscribe: !0 }),
1881
- x({ attribute: !1 })
1885
+ w({ attribute: !1 })
1882
1886
  ], Y.prototype, "client", 2);
1883
1887
  ge([
1884
- x({ type: Boolean, attribute: "show-resolved" })
1888
+ w({ type: Boolean, attribute: "show-resolved" })
1885
1889
  ], Y.prototype, "showResolved", 2);
1886
1890
  ge([
1887
- $()
1891
+ k()
1888
1892
  ], Y.prototype, "threads", 2);
1889
1893
  ge([
1890
- $()
1894
+ k()
1891
1895
  ], Y.prototype, "replyingTo", 2);
1892
1896
  Y = ge([
1893
1897
  L("pulse-comments")
1894
1898
  ], Y);
1895
- var $i = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
1896
- for (var s = i > 1 ? void 0 : i ? ki(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1899
+ var ki = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
1900
+ for (var s = i > 1 ? void 0 : i ? Ei(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1897
1901
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1898
- return i && s && $i(e, t, s), s;
1902
+ return i && s && ki(e, t, s), s;
1899
1903
  };
1900
- const Ei = {
1904
+ const Ci = {
1901
1905
  "comment:created": "left a comment",
1902
1906
  "comment:mention": "mentioned you",
1903
1907
  "comment:reply": "replied to your comment",
1904
1908
  "thread:resolved": "resolved a thread",
1905
1909
  "reaction:added": "reacted to your comment"
1906
- }, Ci = {
1910
+ }, Ti = {
1907
1911
  "comment:created": "💬",
1908
1912
  "comment:mention": "📣",
1909
1913
  "comment:reply": "↩️",
1910
1914
  "thread:resolved": "✅",
1911
1915
  "reaction:added": "🎉"
1912
1916
  };
1913
- let he = class extends P {
1917
+ let he = class extends _ {
1914
1918
  constructor() {
1915
1919
  super(...arguments), this.notifications = [];
1916
1920
  }
@@ -1957,31 +1961,31 @@ let he = class extends P {
1957
1961
  }
1958
1962
  render() {
1959
1963
  const n = this.notifications.filter((e) => !e.read).length;
1960
- return u`
1964
+ return p`
1961
1965
  <div class="header">
1962
1966
  <span class="title">
1963
1967
  Notifications
1964
- ${n > 0 ? u`<span class="badge">${n}</span>` : v}
1968
+ ${n > 0 ? p`<span class="badge">${n}</span>` : g}
1965
1969
  </span>
1966
- ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1970
+ ${n > 0 ? p`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1967
1971
  Mark all read
1968
- </button>` : v}
1972
+ </button>` : g}
1969
1973
  </div>
1970
1974
  <div class="list">
1971
- ${this.notifications.length === 0 ? u`<div class="empty">
1975
+ ${this.notifications.length === 0 ? p`<div class="empty">
1972
1976
  <div class="empty-icon">&#128276;</div>
1973
1977
  No notifications yet
1974
1978
  </div>` : this.notifications.map(
1975
- (e) => u`
1979
+ (e) => p`
1976
1980
  <div
1977
1981
  class="item ${e.read ? "" : "unread"}"
1978
1982
  @click=${() => this.handleClick(e)}
1979
1983
  >
1980
- <span class="icon">${Ci[e.type] ?? "🔔"}</span>
1984
+ <span class="icon">${Ti[e.type] ?? "🔔"}</span>
1981
1985
  <div class="content">
1982
1986
  <div class="text">
1983
1987
  <span class="actor">${this.getActorName(e.actorId)}</span>
1984
- ${Ei[e.type] ?? e.type}
1988
+ ${Ci[e.type] ?? e.type}
1985
1989
  </div>
1986
1990
  <div class="time">${this.formatTime(e.createdAt)}</div>
1987
1991
  </div>
@@ -2134,23 +2138,23 @@ he.styles = O`
2134
2138
  opacity: 0.4;
2135
2139
  }
2136
2140
  `;
2137
- We([
2141
+ Xe([
2138
2142
  fe({ context: Q, subscribe: !0 }),
2139
- x({ attribute: !1 })
2143
+ w({ attribute: !1 })
2140
2144
  ], he.prototype, "client", 2);
2141
- We([
2142
- $()
2145
+ Xe([
2146
+ k()
2143
2147
  ], he.prototype, "notifications", 2);
2144
- he = We([
2148
+ he = Xe([
2145
2149
  L("pulse-notifications")
2146
2150
  ], he);
2147
- var Ti = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
2148
- for (var s = i > 1 ? void 0 : i ? Si(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2151
+ var Si = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
2152
+ for (var s = i > 1 ? void 0 : i ? Ai(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2149
2153
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2150
- return i && s && Ti(e, t, s), s;
2154
+ return i && s && Si(e, t, s), s;
2151
2155
  };
2152
- const Ai = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2153
- let N = class extends P {
2156
+ const Pi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2157
+ let B = class extends _ {
2154
2158
  constructor() {
2155
2159
  super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
2156
2160
  }
@@ -2190,9 +2194,9 @@ let N = class extends P {
2190
2194
  }
2191
2195
  render() {
2192
2196
  const n = this.groupReactions();
2193
- return u`
2197
+ return p`
2194
2198
  ${n.map(
2195
- (e) => u`
2199
+ (e) => p`
2196
2200
  <button
2197
2201
  class="reaction ${e.userReactionId ? "active" : ""}"
2198
2202
  @click=${() => this.toggleReaction(e)}
@@ -2209,22 +2213,22 @@ let N = class extends P {
2209
2213
  >
2210
2214
  +
2211
2215
  </button>
2212
- ${this.showPicker ? u`
2216
+ ${this.showPicker ? p`
2213
2217
  <div class="picker">
2214
- ${Ai.map(
2215
- (e) => u`
2218
+ ${Pi.map(
2219
+ (e) => p`
2216
2220
  <button @click=${() => this.addEmoji(e)}>
2217
2221
  ${e}
2218
2222
  </button>
2219
2223
  `
2220
2224
  )}
2221
2225
  </div>
2222
- ` : v}
2226
+ ` : g}
2223
2227
  </div>
2224
2228
  `;
2225
2229
  }
2226
2230
  };
2227
- N.styles = O`
2231
+ B.styles = O`
2228
2232
  :host {
2229
2233
  display: inline-flex;
2230
2234
  align-items: center;
@@ -2338,24 +2342,24 @@ N.styles = O`
2338
2342
  `;
2339
2343
  te([
2340
2344
  fe({ context: Q, subscribe: !0 }),
2341
- x({ attribute: !1 })
2342
- ], N.prototype, "client", 2);
2345
+ w({ attribute: !1 })
2346
+ ], B.prototype, "client", 2);
2343
2347
  te([
2344
- x({ attribute: "target-id" })
2345
- ], N.prototype, "targetId", 2);
2348
+ w({ attribute: "target-id" })
2349
+ ], B.prototype, "targetId", 2);
2346
2350
  te([
2347
- x({ attribute: "target-type" })
2348
- ], N.prototype, "targetType", 2);
2351
+ w({ attribute: "target-type" })
2352
+ ], B.prototype, "targetType", 2);
2349
2353
  te([
2350
- $()
2351
- ], N.prototype, "reactions", 2);
2354
+ k()
2355
+ ], B.prototype, "reactions", 2);
2352
2356
  te([
2353
- $()
2354
- ], N.prototype, "showPicker", 2);
2355
- N = te([
2357
+ k()
2358
+ ], B.prototype, "showPicker", 2);
2359
+ B = te([
2356
2360
  L("pulse-reactions")
2357
- ], N);
2358
- const It = {
2361
+ ], B);
2362
+ const Mt = {
2359
2363
  allowImages: !0,
2360
2364
  allowAudio: !0,
2361
2365
  allowVideo: !0,
@@ -2373,8 +2377,8 @@ const It = {
2373
2377
  * Copyright 2017 Google LLC
2374
2378
  * SPDX-License-Identifier: BSD-3-Clause
2375
2379
  */
2376
- const Pi = { CHILD: 2 }, _i = (n) => (...e) => ({ _$litDirective$: n, values: e });
2377
- class Ii {
2380
+ const _i = { CHILD: 2 }, Ii = (n) => (...e) => ({ _$litDirective$: n, values: e });
2381
+ class Mi {
2378
2382
  constructor(e) {
2379
2383
  }
2380
2384
  get _$AU() {
@@ -2395,12 +2399,12 @@ class Ii {
2395
2399
  * Copyright 2017 Google LLC
2396
2400
  * SPDX-License-Identifier: BSD-3-Clause
2397
2401
  */
2398
- class Le extends Ii {
2402
+ class Le extends Mi {
2399
2403
  constructor(e) {
2400
- if (super(e), this.it = v, e.type !== Pi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2404
+ if (super(e), this.it = g, e.type !== _i.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2401
2405
  }
2402
2406
  render(e) {
2403
- if (e === v || e == null) return this._t = void 0, this.it = e;
2407
+ if (e === g || e == null) return this._t = void 0, this.it = e;
2404
2408
  if (e === W) return e;
2405
2409
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
2406
2410
  if (e === this.it) return this._t;
@@ -2418,14 +2422,14 @@ Le.directiveName = "unsafeHTML", Le.resultType = 1;
2418
2422
  class je extends Le {
2419
2423
  }
2420
2424
  je.directiveName = "unsafeSVG", je.resultType = 2;
2421
- const Mi = _i(je);
2425
+ const Oi = Ii(je);
2422
2426
  /**
2423
2427
  * @license lucide v0.577.0 - ISC
2424
2428
  *
2425
2429
  * This source code is licensed under the ISC license.
2426
2430
  * See the LICENSE file in the root directory of this source tree.
2427
2431
  */
2428
- const Oi = [
2432
+ const Ri = [
2429
2433
  ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
2430
2434
  [
2431
2435
  "path",
@@ -2440,7 +2444,7 @@ const Oi = [
2440
2444
  * This source code is licensed under the ISC license.
2441
2445
  * See the LICENSE file in the root directory of this source tree.
2442
2446
  */
2443
- const Ri = [
2447
+ const Li = [
2444
2448
  ["circle", { cx: "12", cy: "12", r: "10" }],
2445
2449
  ["path", { d: "M12 6v6l4 2" }]
2446
2450
  ];
@@ -2450,7 +2454,7 @@ const Ri = [
2450
2454
  * This source code is licensed under the ISC license.
2451
2455
  * See the LICENSE file in the root directory of this source tree.
2452
2456
  */
2453
- const Li = [
2457
+ const ji = [
2454
2458
  [
2455
2459
  "path",
2456
2460
  {
@@ -2464,7 +2468,7 @@ const Li = [
2464
2468
  * This source code is licensed under the ISC license.
2465
2469
  * See the LICENSE file in the root directory of this source tree.
2466
2470
  */
2467
- const ji = [
2471
+ const Ui = [
2468
2472
  ["path", { d: "M12 19v3" }],
2469
2473
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
2470
2474
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
@@ -2489,7 +2493,7 @@ const zi = [
2489
2493
  * This source code is licensed under the ISC license.
2490
2494
  * See the LICENSE file in the root directory of this source tree.
2491
2495
  */
2492
- const Ui = [
2496
+ const Di = [
2493
2497
  [
2494
2498
  "path",
2495
2499
  {
@@ -2511,7 +2515,7 @@ const Ui = [
2511
2515
  * This source code is licensed under the ISC license.
2512
2516
  * See the LICENSE file in the root directory of this source tree.
2513
2517
  */
2514
- const Di = [
2518
+ const Hi = [
2515
2519
  [
2516
2520
  "path",
2517
2521
  {
@@ -2526,7 +2530,7 @@ const Di = [
2526
2530
  * This source code is licensed under the ISC license.
2527
2531
  * See the LICENSE file in the root directory of this source tree.
2528
2532
  */
2529
- const Mt = [
2533
+ const Ot = [
2530
2534
  ["path", { d: "M12 17v5" }],
2531
2535
  [
2532
2536
  "path",
@@ -2541,7 +2545,7 @@ const Mt = [
2541
2545
  * This source code is licensed under the ISC license.
2542
2546
  * See the LICENSE file in the root directory of this source tree.
2543
2547
  */
2544
- const Hi = [
2548
+ const Bi = [
2545
2549
  [
2546
2550
  "path",
2547
2551
  {
@@ -2569,7 +2573,7 @@ const Ni = [
2569
2573
  * This source code is licensed under the ISC license.
2570
2574
  * See the LICENSE file in the root directory of this source tree.
2571
2575
  */
2572
- const Bi = [
2576
+ const Fi = [
2573
2577
  ["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
2574
2578
  ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
2575
2579
  ];
@@ -2589,7 +2593,7 @@ const ve = [
2589
2593
  * This source code is licensed under the ISC license.
2590
2594
  * See the LICENSE file in the root directory of this source tree.
2591
2595
  */
2592
- const Fi = [
2596
+ const qi = [
2593
2597
  [
2594
2598
  "path",
2595
2599
  {
@@ -2597,14 +2601,14 @@ const Fi = [
2597
2601
  }
2598
2602
  ]
2599
2603
  ];
2600
- function qi(n) {
2604
+ function Vi(n) {
2601
2605
  return n.map(([e, t]) => {
2602
2606
  const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
2603
2607
  return `<${e} ${i}/>`;
2604
2608
  }).join("");
2605
2609
  }
2606
- function T(n, e = 18) {
2607
- return ni`<svg
2610
+ function S(n, e = 18) {
2611
+ return oi`<svg
2608
2612
  xmlns="http://www.w3.org/2000/svg"
2609
2613
  width="${e}"
2610
2614
  height="${e}"
@@ -2614,7 +2618,7 @@ function T(n, e = 18) {
2614
2618
  stroke-width="2"
2615
2619
  stroke-linecap="round"
2616
2620
  stroke-linejoin="round"
2617
- >${Mi(qi(n))}</svg>`;
2621
+ >${Oi(Vi(n))}</svg>`;
2618
2622
  }
2619
2623
  const ie = O`
2620
2624
  * {
@@ -2715,12 +2719,12 @@ const ie = O`
2715
2719
  background: transparent;
2716
2720
  }
2717
2721
  `;
2718
- var Vi = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
2719
- for (var s = i > 1 ? void 0 : i ? Wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2722
+ var Wi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
2723
+ for (var s = i > 1 ? void 0 : i ? Xi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2720
2724
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2721
- return i && s && Vi(e, t, s), s;
2725
+ return i && s && Wi(e, t, s), s;
2722
2726
  };
2723
- let K = class extends P {
2727
+ let K = class extends _ {
2724
2728
  constructor() {
2725
2729
  super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
2726
2730
  }
@@ -2766,18 +2770,18 @@ let K = class extends P {
2766
2770
  );
2767
2771
  }
2768
2772
  render() {
2769
- return u`
2773
+ return p`
2770
2774
  <div class="panel">
2771
2775
  <div class="panel-header">
2772
2776
  <span class="panel-title">Activity</span>
2773
2777
  <button class="close-btn" @click=${this.fireClose} title="Close">
2774
- ${T(ve, 16)}
2778
+ ${S(ve, 16)}
2775
2779
  </button>
2776
2780
  </div>
2777
2781
 
2778
2782
  <div class="panel-body pw-scrollable">
2779
- ${this.items.length === 0 ? u`<div class="empty">No activity yet</div>` : this.items.map(
2780
- (n) => u`
2783
+ ${this.items.length === 0 ? p`<div class="empty">No activity yet</div>` : this.items.map(
2784
+ (n) => p`
2781
2785
  <div class="activity-item">
2782
2786
  <div
2783
2787
  class="activity-dot"
@@ -2785,7 +2789,7 @@ let K = class extends P {
2785
2789
  ></div>
2786
2790
  <div class="activity-content">
2787
2791
  <div class="activity-text">
2788
- ${n.userId ? u`<span class="activity-user"
2792
+ ${n.userId ? p`<span class="activity-user"
2789
2793
  >${this.getUserName(n.userId)}</span
2790
2794
  >
2791
2795
  ${n.description}` : n.description}
@@ -2931,21 +2935,21 @@ K.TYPE_COLORS = {
2931
2935
  comment: "#3b82f6",
2932
2936
  resolve: "#22c55e"
2933
2937
  };
2934
- Xe([
2935
- x({ attribute: !1 })
2938
+ Ye([
2939
+ w({ attribute: !1 })
2936
2940
  ], K.prototype, "client", 2);
2937
- Xe([
2938
- $()
2941
+ Ye([
2942
+ k()
2939
2943
  ], K.prototype, "items", 2);
2940
- K = Xe([
2944
+ K = Ye([
2941
2945
  L("pulse-widget-activity-panel")
2942
2946
  ], K);
2943
- const Xi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", dt = "#6366f1", ht = "#e2e8f0", Yi = "#f8fafc", Ki = "#e2e8f0", pt = "#64748b", we = 28, Gi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2944
- function ut(n) {
2947
+ const Yi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ht = "#6366f1", pt = "#e2e8f0", Ki = "#f8fafc", Gi = "#e2e8f0", ut = "#64748b", we = 28, Ji = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2948
+ function ft(n) {
2945
2949
  const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
2946
2950
  return `${t}:${i.toString().padStart(2, "0")}`;
2947
2951
  }
2948
- class ze {
2952
+ class Ue {
2949
2953
  /**
2950
2954
  * Create and return a fully self-contained inline audio player element.
2951
2955
  *
@@ -2966,12 +2970,12 @@ class ze {
2966
2970
  width: "220px",
2967
2971
  height: "44px",
2968
2972
  padding: "0 10px",
2969
- background: Yi,
2973
+ background: Ki,
2970
2974
  borderRadius: "12px",
2971
- border: `1px solid ${Ki}`,
2972
- fontFamily: Xi,
2975
+ border: `1px solid ${Gi}`,
2976
+ fontFamily: Yi,
2973
2977
  fontSize: "11px",
2974
- color: pt,
2978
+ color: ut,
2975
2979
  userSelect: "none",
2976
2980
  boxSizing: "border-box"
2977
2981
  });
@@ -2982,7 +2986,7 @@ class ze {
2982
2986
  minWidth: "28px",
2983
2987
  borderRadius: "50%",
2984
2988
  border: "none",
2985
- background: dt,
2989
+ background: ht,
2986
2990
  cursor: "pointer",
2987
2991
  display: "flex",
2988
2992
  alignItems: "center",
@@ -3010,8 +3014,8 @@ class ze {
3010
3014
  </svg>`;
3011
3015
  }
3012
3016
  c(), l.appendChild(d);
3013
- const p = document.createElement("div");
3014
- Object.assign(p.style, {
3017
+ const u = document.createElement("div");
3018
+ Object.assign(u.style, {
3015
3019
  flex: "1",
3016
3020
  display: "flex",
3017
3021
  flexDirection: "column",
@@ -3019,50 +3023,50 @@ class ze {
3019
3023
  overflow: "hidden",
3020
3024
  minWidth: "0"
3021
3025
  });
3022
- const m = document.createElement("div");
3023
- Object.assign(m.style, {
3026
+ const f = document.createElement("div");
3027
+ Object.assign(f.style, {
3024
3028
  display: "flex",
3025
3029
  alignItems: "center",
3026
3030
  gap: "1.5px",
3027
3031
  height: "22px",
3028
3032
  cursor: "pointer"
3029
3033
  });
3030
- const g = [];
3031
- for (let E = 0; E < we; E++) {
3032
- const I = document.createElement("div"), z = Math.round(Gi[E] * 20);
3033
- Object.assign(I.style, {
3034
+ const b = [];
3035
+ for (let $ = 0; $ < we; $++) {
3036
+ const T = document.createElement("div"), U = Math.round(Ji[$] * 20);
3037
+ Object.assign(T.style, {
3034
3038
  flex: "1",
3035
- height: `${Math.max(3, z)}px`,
3039
+ height: `${Math.max(3, U)}px`,
3036
3040
  borderRadius: "1px",
3037
- background: ht,
3041
+ background: pt,
3038
3042
  transition: "background 0.1s ease",
3039
3043
  minWidth: "0"
3040
- }), g.push(I), m.appendChild(I);
3044
+ }), b.push(T), f.appendChild(T);
3041
3045
  }
3042
- const y = document.createElement("div");
3043
- Object.assign(y.style, {
3046
+ const x = document.createElement("div");
3047
+ Object.assign(x.style, {
3044
3048
  fontSize: "10px",
3045
- color: pt,
3049
+ color: ut,
3046
3050
  whiteSpace: "nowrap",
3047
3051
  lineHeight: "1"
3048
3052
  });
3049
- function b() {
3050
- const E = ut(o), I = ut(s);
3051
- y.textContent = `${E} / ${I}`;
3053
+ function y() {
3054
+ const $ = ft(o), T = ft(s);
3055
+ x.textContent = `${$} / ${T}`;
3052
3056
  }
3053
- b(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
3054
- function w() {
3055
- const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
3056
- for (let z = 0; z < we; z++)
3057
- g[z].style.background = z <= I ? dt : ht;
3057
+ y(), u.appendChild(f), u.appendChild(x), a.appendChild(l), a.appendChild(u);
3058
+ function v() {
3059
+ const $ = s > 0 ? o / s : 0, T = Math.floor($ * we);
3060
+ for (let U = 0; U < we; U++)
3061
+ b[U].style.background = U <= T ? ht : pt;
3058
3062
  }
3059
- return m.addEventListener("click", (E) => {
3063
+ return f.addEventListener("click", ($) => {
3060
3064
  if (s <= 0) return;
3061
- const I = m.getBoundingClientRect(), z = Math.min(
3065
+ const T = f.getBoundingClientRect(), U = Math.min(
3062
3066
  1,
3063
- Math.max(0, (E.clientX - I.left) / I.width)
3067
+ Math.max(0, ($.clientX - T.left) / T.width)
3064
3068
  );
3065
- r.currentTime = z * s, o = r.currentTime, w(), b();
3069
+ r.currentTime = U * s, o = r.currentTime, v(), y();
3066
3070
  }), l.addEventListener("click", () => {
3067
3071
  i ? r.pause() : r.play().catch(() => {
3068
3072
  });
@@ -3071,17 +3075,17 @@ class ze {
3071
3075
  }), r.addEventListener("pause", () => {
3072
3076
  i = !1, c();
3073
3077
  }), r.addEventListener("ended", () => {
3074
- i = !1, c(), o = 0, w(), b();
3078
+ i = !1, c(), o = 0, v(), y();
3075
3079
  }), r.addEventListener("timeupdate", () => {
3076
- o = r.currentTime, w(), b();
3080
+ o = r.currentTime, v(), y();
3077
3081
  }), r.addEventListener("loadedmetadata", () => {
3078
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3082
+ r.duration && isFinite(r.duration) && (s = r.duration, y());
3079
3083
  }), r.addEventListener("durationchange", () => {
3080
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3084
+ r.duration && isFinite(r.duration) && (s = r.duration, y());
3081
3085
  }), a;
3082
3086
  }
3083
3087
  }
3084
- class Ue {
3088
+ class ze {
3085
3089
  constructor() {
3086
3090
  this.container = null, this.stream = null, this.recorder = null, this.analyser = null, this.audioCtx = null, this.recording = !1, this.animFrame = null, this.startTime = 0, this.maxDuration = 12e4, this.maxTimer = null, this.canvas = null, this.timerEl = null, this.resolve = null, this.animate = () => {
3087
3091
  this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
@@ -3212,8 +3216,8 @@ class Ue {
3212
3216
  this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
3213
3217
  const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
3214
3218
  for (let d = 0; d < r; d++) {
3215
- const c = o[d] / 255, h = Math.max(2, c * i * 0.85), p = d * (a + l), m = (i - h) / 2, g = 0.4 + c * 0.6;
3216
- e.fillStyle = `rgba(99, 102, 241, ${g})`, e.beginPath(), e.roundRect(p, m, a, h, 1), e.fill();
3219
+ const c = o[d] / 255, h = Math.max(2, c * i * 0.85), u = d * (a + l), f = (i - h) / 2, b = 0.4 + c * 0.6;
3220
+ e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u, f, a, h, 1), e.fill();
3217
3221
  }
3218
3222
  }
3219
3223
  updateTimer() {
@@ -3231,25 +3235,25 @@ class Ue {
3231
3235
  this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
3232
3236
  }
3233
3237
  }
3234
- const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3238
+ const Zi = 180, Qi = 120, es = "#e2e8f0", ts = `
3235
3239
  <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3236
3240
  <circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
3237
3241
  <polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
3238
- </svg>`, ft = `
3242
+ </svg>`, mt = `
3239
3243
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
3240
3244
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3241
3245
  <line x1="23" y1="9" x2="17" y2="15"/>
3242
3246
  <line x1="17" y1="9" x2="23" y2="15"/>
3243
- </svg>`, ts = `
3247
+ </svg>`, is = `
3244
3248
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
3245
3249
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3246
3250
  <path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
3247
3251
  <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
3248
- </svg>`, is = `
3252
+ </svg>`, ss = `
3249
3253
  <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
3250
3254
  <polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
3251
3255
  <polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
3252
- </svg>`, S = class S {
3256
+ </svg>`, A = class A {
3253
3257
  /**
3254
3258
  * Renders an inline rectangular video player and returns the root container.
3255
3259
  * @param url - Video source URL
@@ -3261,10 +3265,10 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3261
3265
  Object.assign(o.style, {
3262
3266
  position: "relative",
3263
3267
  display: "inline-block",
3264
- width: `${Ji}px`,
3265
- height: `${Zi}px`,
3268
+ width: `${Zi}px`,
3269
+ height: `${Qi}px`,
3266
3270
  borderRadius: "8px",
3267
- border: `1px solid ${Qi}`,
3271
+ border: `1px solid ${es}`,
3268
3272
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
3269
3273
  overflow: "hidden",
3270
3274
  cursor: "pointer",
@@ -3294,7 +3298,7 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3294
3298
  transition: "opacity 0.25s ease",
3295
3299
  opacity: "1",
3296
3300
  pointerEvents: "none"
3297
- }), a.innerHTML = es, o.appendChild(a);
3301
+ }), a.innerHTML = ts, o.appendChild(a);
3298
3302
  const l = document.createElement("div");
3299
3303
  Object.assign(l.style, {
3300
3304
  position: "absolute",
@@ -3309,7 +3313,7 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3309
3313
  justifyContent: "center",
3310
3314
  pointerEvents: "none",
3311
3315
  transition: "opacity 0.2s ease"
3312
- }), l.innerHTML = ft, o.appendChild(l);
3316
+ }), l.innerHTML = mt, o.appendChild(l);
3313
3317
  const d = document.createElement("div");
3314
3318
  Object.assign(d.style, {
3315
3319
  position: "absolute",
@@ -3325,28 +3329,28 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3325
3329
  cursor: "pointer",
3326
3330
  pointerEvents: "auto",
3327
3331
  transition: "opacity 0.2s ease, background 0.15s ease"
3328
- }), d.innerHTML = is, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
3332
+ }), d.innerHTML = ss, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
3329
3333
  d.style.background = "rgba(0,0,0,0.7)";
3330
3334
  }), d.addEventListener("mouseleave", () => {
3331
3335
  d.style.background = "rgba(0,0,0,0.45)";
3332
- }), d.addEventListener("click", (p) => {
3333
- p.stopPropagation(), S.openFullscreen(e, t);
3336
+ }), d.addEventListener("click", (u) => {
3337
+ u.stopPropagation(), A.openFullscreen(e, t);
3334
3338
  }), o.appendChild(d);
3335
3339
  function c() {
3336
3340
  a.style.opacity = i ? "0" : "1";
3337
3341
  }
3338
3342
  function h() {
3339
- l.style.display = i ? "flex" : "none", l.innerHTML = s ? ft : ts, d.style.display = i ? "flex" : "none";
3343
+ l.style.display = i ? "flex" : "none", l.innerHTML = s ? mt : is, d.style.display = i ? "flex" : "none";
3340
3344
  }
3341
- return o.addEventListener("click", (p) => {
3342
- p.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
3345
+ return o.addEventListener("click", (u) => {
3346
+ u.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
3343
3347
  }), i = !0), c(), h();
3344
3348
  }), r.addEventListener("pause", () => {
3345
3349
  i && (i = !1, s = !0, r.muted = !0, c(), h());
3346
3350
  }), o;
3347
3351
  }
3348
3352
  static openFullscreen(e, t) {
3349
- S.closeFullscreen();
3353
+ A.closeFullscreen();
3350
3354
  const i = document.createElement("div");
3351
3355
  Object.assign(i.style, {
3352
3356
  position: "fixed",
@@ -3388,7 +3392,7 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3388
3392
  }), s.addEventListener("mouseleave", () => {
3389
3393
  s.style.background = "rgba(255,255,255,0.15)";
3390
3394
  }), s.addEventListener("click", (a) => {
3391
- a.stopPropagation(), S.closeFullscreen();
3395
+ a.stopPropagation(), A.closeFullscreen();
3392
3396
  });
3393
3397
  const o = document.createElement("video");
3394
3398
  Object.assign(o.style, {
@@ -3397,25 +3401,25 @@ const Ji = 180, Zi = 120, Qi = "#e2e8f0", es = `
3397
3401
  borderRadius: "8px",
3398
3402
  outline: "none",
3399
3403
  cursor: "default"
3400
- }), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => S.closeFullscreen());
3404
+ }), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => A.closeFullscreen());
3401
3405
  const r = (a) => {
3402
- a.key === "Escape" && S.closeFullscreen();
3406
+ a.key === "Escape" && A.closeFullscreen();
3403
3407
  };
3404
- document.addEventListener("keydown", r), S.fullscreenOverlay = i, S.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3408
+ document.addEventListener("keydown", r), A.fullscreenOverlay = i, A.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3405
3409
  i.style.opacity = "1";
3406
3410
  });
3407
3411
  }
3408
3412
  static closeFullscreen() {
3409
- if (!S.fullscreenOverlay) return;
3410
- const e = S.fullscreenOverlay;
3411
- S.fullscreenKeyHandler && (document.removeEventListener("keydown", S.fullscreenKeyHandler), S.fullscreenKeyHandler = null);
3413
+ if (!A.fullscreenOverlay) return;
3414
+ const e = A.fullscreenOverlay;
3415
+ A.fullscreenKeyHandler && (document.removeEventListener("keydown", A.fullscreenKeyHandler), A.fullscreenKeyHandler = null);
3412
3416
  const t = e.querySelector("video");
3413
- t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), S.fullscreenOverlay = null;
3417
+ t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), A.fullscreenOverlay = null;
3414
3418
  }
3415
3419
  };
3416
- S.fullscreenOverlay = null, S.fullscreenKeyHandler = null;
3417
- let Ce = S;
3418
- const mt = 60, ss = `
3420
+ A.fullscreenOverlay = null, A.fullscreenKeyHandler = null;
3421
+ let Ce = A;
3422
+ const gt = 60, ns = `
3419
3423
  .vr-overlay {
3420
3424
  display: flex;
3421
3425
  flex-direction: column;
@@ -3522,14 +3526,14 @@ const mt = 60, ss = `
3522
3526
  color: #0f172a;
3523
3527
  }
3524
3528
  `;
3525
- function gt(n) {
3529
+ function vt(n) {
3526
3530
  return n.toString().padStart(2, "0");
3527
3531
  }
3528
- function ns(n) {
3532
+ function os(n) {
3529
3533
  const e = Math.floor(n / 60), t = n % 60;
3530
- return `${gt(e)}:${gt(t)}`;
3534
+ return `${vt(e)}:${vt(t)}`;
3531
3535
  }
3532
- function os() {
3536
+ function rs() {
3533
3537
  const n = [
3534
3538
  "video/webm;codecs=vp9,opus",
3535
3539
  "video/webm;codecs=vp8,opus",
@@ -3540,7 +3544,7 @@ function os() {
3540
3544
  if (MediaRecorder.isTypeSupported(e)) return e;
3541
3545
  return "";
3542
3546
  }
3543
- function rs(n) {
3547
+ function as(n) {
3544
3548
  return new Promise((e, t) => {
3545
3549
  const i = URL.createObjectURL(n), s = document.createElement("video");
3546
3550
  s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
@@ -3576,7 +3580,7 @@ class De {
3576
3580
  }
3577
3581
  this.stream = t, this.container = e, this.recording = !0, this.elapsed = 0, this.chunks = [], this.buildUI(e), this.videoEl && (this.videoEl.srcObject = t, this.videoEl.play().catch(() => {
3578
3582
  }));
3579
- const i = os(), s = {};
3583
+ const i = rs(), s = {};
3580
3584
  i && (s.mimeType = i);
3581
3585
  const o = new MediaRecorder(t, s);
3582
3586
  return this.mediaRecorder = o, o.ondataavailable = (r) => {
@@ -3584,7 +3588,7 @@ class De {
3584
3588
  }, o.onstop = () => {
3585
3589
  this.handleRecordingComplete();
3586
3590
  }, o.start(), this.timerInterval = setInterval(() => {
3587
- this.elapsed++, this.updateTimer(), this.elapsed >= mt && this.stopRecording();
3591
+ this.elapsed++, this.updateTimer(), this.elapsed >= gt && this.stopRecording();
3588
3592
  }, 1e3), new Promise((r) => {
3589
3593
  this.resolvePromise = r;
3590
3594
  });
@@ -3601,7 +3605,7 @@ class De {
3601
3605
  }
3602
3606
  // ── Private ──
3603
3607
  buildUI(e) {
3604
- this.styleEl = document.createElement("style"), this.styleEl.textContent = ss, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3608
+ this.styleEl = document.createElement("style"), this.styleEl.textContent = ns, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3605
3609
  const t = document.createElement("div");
3606
3610
  t.className = "vr-circle-wrapper";
3607
3611
  const i = document.createElement("div");
@@ -3617,15 +3621,15 @@ class De {
3617
3621
  }
3618
3622
  updateTimer() {
3619
3623
  if (!this.timerEl) return;
3620
- const e = mt - this.elapsed;
3621
- this.timerEl.textContent = ns(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3624
+ const e = gt - this.elapsed;
3625
+ this.timerEl.textContent = os(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3622
3626
  }
3623
3627
  async handleRecordingComplete() {
3624
3628
  var s, o;
3625
3629
  const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
3626
3630
  let i;
3627
3631
  try {
3628
- i = await rs(t);
3632
+ i = await as(t);
3629
3633
  } catch {
3630
3634
  const r = document.createElement("canvas");
3631
3635
  r.width = 1, r.height = 1, i = await new Promise((a) => {
@@ -3648,7 +3652,7 @@ class De {
3648
3652
  this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
3649
3653
  }
3650
3654
  }
3651
- const vt = {
3655
+ const bt = {
3652
3656
  position: "absolute",
3653
3657
  top: "50%",
3654
3658
  transform: "translateY(-50%)",
@@ -3666,7 +3670,7 @@ const vt = {
3666
3670
  justifyContent: "center",
3667
3671
  transition: "background 150ms ease",
3668
3672
  zIndex: "1"
3669
- }, f = class f {
3673
+ }, m = class m {
3670
3674
  /**
3671
3675
  * Opens a fullscreen lightbox overlay.
3672
3676
  * @param imageUrl - Single image URL (backwards-compatible)
@@ -3674,8 +3678,8 @@ const vt = {
3674
3678
  * @param startIndex - Index in allUrls to start at (default 0)
3675
3679
  */
3676
3680
  static open(e, t, i) {
3677
- f.close(), f.urls = t && t.length > 1 ? t : [e], f.currentIndex = i ?? 0;
3678
- const s = f.urls.length > 1, o = document.createElement("div");
3681
+ m.close(), m.urls = t && t.length > 1 ? t : [e], m.currentIndex = i ?? 0;
3682
+ const s = m.urls.length > 1, o = document.createElement("div");
3679
3683
  o.id = "pulse-widget-lightbox", Object.assign(o.style, {
3680
3684
  position: "fixed",
3681
3685
  top: "0",
@@ -3716,10 +3720,10 @@ const vt = {
3716
3720
  }), r.addEventListener("mouseleave", () => {
3717
3721
  r.style.background = "rgba(255,255,255,0.15)";
3718
3722
  }), r.addEventListener("click", (d) => {
3719
- d.stopPropagation(), f.close();
3723
+ d.stopPropagation(), m.close();
3720
3724
  }), o.appendChild(r);
3721
3725
  const a = document.createElement("img");
3722
- if (a.src = f.urls[f.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
3726
+ if (a.src = m.urls[m.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
3723
3727
  maxWidth: "90vw",
3724
3728
  maxHeight: "85vh",
3725
3729
  borderRadius: "8px",
@@ -3727,23 +3731,23 @@ const vt = {
3727
3731
  cursor: "default",
3728
3732
  userSelect: "none",
3729
3733
  transition: "opacity 150ms ease"
3730
- }), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), f.imgEl = a, s) {
3734
+ }), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), m.imgEl = a, s) {
3731
3735
  const d = document.createElement("button");
3732
- d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...vt, left: "16px" }), d.addEventListener("mouseenter", () => {
3736
+ d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...bt, left: "16px" }), d.addEventListener("mouseenter", () => {
3733
3737
  d.style.background = "rgba(255,255,255,0.3)";
3734
3738
  }), d.addEventListener("mouseleave", () => {
3735
3739
  d.style.background = "rgba(255,255,255,0.15)";
3736
- }), d.addEventListener("click", (p) => {
3737
- p.stopPropagation(), f.navigate(-1);
3738
- }), o.appendChild(d), f.prevBtn = d;
3740
+ }), d.addEventListener("click", (u) => {
3741
+ u.stopPropagation(), m.navigate(-1);
3742
+ }), o.appendChild(d), m.prevBtn = d;
3739
3743
  const c = document.createElement("button");
3740
- c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...vt, right: "16px" }), c.addEventListener("mouseenter", () => {
3744
+ c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...bt, right: "16px" }), c.addEventListener("mouseenter", () => {
3741
3745
  c.style.background = "rgba(255,255,255,0.3)";
3742
3746
  }), c.addEventListener("mouseleave", () => {
3743
3747
  c.style.background = "rgba(255,255,255,0.15)";
3744
- }), c.addEventListener("click", (p) => {
3745
- p.stopPropagation(), f.navigate(1);
3746
- }), o.appendChild(c), f.nextBtn = c;
3748
+ }), c.addEventListener("click", (u) => {
3749
+ u.stopPropagation(), m.navigate(1);
3750
+ }), o.appendChild(c), m.nextBtn = c;
3747
3751
  const h = document.createElement("span");
3748
3752
  Object.assign(h.style, {
3749
3753
  position: "absolute",
@@ -3754,35 +3758,35 @@ const vt = {
3754
3758
  fontSize: "13px",
3755
3759
  fontWeight: "500",
3756
3760
  pointerEvents: "none"
3757
- }), o.appendChild(h), f.counterEl = h, f.updateNav();
3761
+ }), o.appendChild(h), m.counterEl = h, m.updateNav();
3758
3762
  }
3759
- o.addEventListener("click", () => f.close());
3763
+ o.addEventListener("click", () => m.close());
3760
3764
  const l = (d) => {
3761
- d.key === "Escape" && f.close(), s && d.key === "ArrowLeft" && f.navigate(-1), s && d.key === "ArrowRight" && f.navigate(1);
3765
+ d.key === "Escape" && m.close(), s && d.key === "ArrowLeft" && m.navigate(-1), s && d.key === "ArrowRight" && m.navigate(1);
3762
3766
  };
3763
- document.addEventListener("keydown", l), f.overlay = o, f.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
3767
+ document.addEventListener("keydown", l), m.overlay = o, m.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
3764
3768
  o.style.opacity = "1";
3765
3769
  });
3766
3770
  }
3767
3771
  static navigate(e) {
3768
- const t = f.urls.length;
3769
- f.currentIndex = (f.currentIndex + e + t) % t, f.imgEl && (f.imgEl.style.opacity = "0", setTimeout(() => {
3770
- f.imgEl && (f.imgEl.src = f.urls[f.currentIndex], f.imgEl.style.opacity = "1");
3771
- }, 100)), f.updateNav();
3772
+ const t = m.urls.length;
3773
+ m.currentIndex = (m.currentIndex + e + t) % t, m.imgEl && (m.imgEl.style.opacity = "0", setTimeout(() => {
3774
+ m.imgEl && (m.imgEl.src = m.urls[m.currentIndex], m.imgEl.style.opacity = "1");
3775
+ }, 100)), m.updateNav();
3772
3776
  }
3773
3777
  static updateNav() {
3774
- const e = f.currentIndex, t = f.urls.length;
3775
- f.counterEl && (f.counterEl.textContent = `${e + 1} / ${t}`);
3778
+ const e = m.currentIndex, t = m.urls.length;
3779
+ m.counterEl && (m.counterEl.textContent = `${e + 1} / ${t}`);
3776
3780
  }
3777
3781
  /** Closes the lightbox if open. */
3778
3782
  static close() {
3779
- if (!f.overlay) return;
3780
- const e = f.overlay;
3781
- f.onKeyDown && (document.removeEventListener("keydown", f.onKeyDown), f.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), f.overlay = null, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null, f.urls = [], f.currentIndex = 0;
3783
+ if (!m.overlay) return;
3784
+ const e = m.overlay;
3785
+ m.onKeyDown && (document.removeEventListener("keydown", m.onKeyDown), m.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), m.overlay = null, m.imgEl = null, m.prevBtn = null, m.nextBtn = null, m.counterEl = null, m.urls = [], m.currentIndex = 0;
3782
3786
  }
3783
3787
  };
3784
- f.overlay = null, f.onKeyDown = null, f.urls = [], f.currentIndex = 0, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null;
3785
- let Te = f;
3788
+ m.overlay = null, m.onKeyDown = null, m.urls = [], m.currentIndex = 0, m.imgEl = null, m.prevBtn = null, m.nextBtn = null, m.counterEl = null;
3789
+ let Te = m;
3786
3790
  class re {
3787
3791
  constructor(e) {
3788
3792
  this.uploading = !1, this.client = e, this.input = document.createElement("input"), this.input.type = "file", this.input.style.display = "none", document.body.appendChild(this.input);
@@ -3877,7 +3881,113 @@ class re {
3877
3881
  this.input.remove();
3878
3882
  }
3879
3883
  }
3880
- const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ls = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', cs = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', bt = `<button class="pulse-close-btn" style="
3884
+ const ls = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
3885
+ class He {
3886
+ constructor(e) {
3887
+ this.dropdown = null, this.target = null, this.mentionStart = -1, this.selectedIndex = 0, this.filteredUsers = [], this.handleInput = () => {
3888
+ var d;
3889
+ if (!this.target) return;
3890
+ const t = this.target.value, i = this.target.selectionStart ?? t.length, s = t.slice(0, i), o = s.lastIndexOf("@");
3891
+ if (o === -1 || o > 0 && /\w/.test(s[o - 1])) {
3892
+ this.close();
3893
+ return;
3894
+ }
3895
+ const r = s.slice(o + 1).toLowerCase();
3896
+ if (r.includes(" ")) {
3897
+ this.close();
3898
+ return;
3899
+ }
3900
+ this.mentionStart = o;
3901
+ const a = (d = this.client.state.user) == null ? void 0 : d.id, l = new Set(this.client.state.presence.map((c) => c.user.id));
3902
+ if (this.filteredUsers = this.client.state.users.filter((c) => c.id !== a && c.name.toLowerCase().includes(r)).sort((c, h) => {
3903
+ const u = l.has(c.id) ? 0 : 1, f = l.has(h.id) ? 0 : 1;
3904
+ return u - f || c.name.localeCompare(h.name);
3905
+ }).slice(0, 5), this.filteredUsers.length === 0) {
3906
+ this.close();
3907
+ return;
3908
+ }
3909
+ this.selectedIndex = 0, this.showDropdown();
3910
+ }, this.handleKeydown = (t) => {
3911
+ this.dropdown && (t.key === "ArrowDown" ? (t.preventDefault(), this.selectedIndex = Math.min(this.selectedIndex + 1, this.filteredUsers.length - 1), this.renderItems()) : t.key === "ArrowUp" ? (t.preventDefault(), this.selectedIndex = Math.max(this.selectedIndex - 1, 0), this.renderItems()) : t.key === "Enter" && this.dropdown ? (t.preventDefault(), t.stopPropagation(), this.selectUser(this.filteredUsers[this.selectedIndex])) : t.key === "Escape" && this.close());
3912
+ }, this.handleBlur = () => {
3913
+ setTimeout(() => this.close(), 150);
3914
+ }, this.client = e;
3915
+ }
3916
+ /** Attach the mention picker to a text input or textarea. */
3917
+ attach(e) {
3918
+ this.target = e, e.addEventListener("input", this.handleInput), e.addEventListener("keydown", this.handleKeydown), e.addEventListener("blur", this.handleBlur);
3919
+ }
3920
+ /** Detach and clean up. */
3921
+ detach() {
3922
+ this.target && (this.target.removeEventListener("input", this.handleInput), this.target.removeEventListener("keydown", this.handleKeydown), this.target.removeEventListener("blur", this.handleBlur), this.target = null), this.close();
3923
+ }
3924
+ selectUser(e) {
3925
+ if (!this.target) return;
3926
+ const t = this.target.value, i = this.target.selectionStart ?? t.length, s = e.name.split(" ")[0], o = t.slice(0, this.mentionStart), r = t.slice(i);
3927
+ this.target.value = `${o}@${s} ${r}`;
3928
+ const a = this.mentionStart + s.length + 2;
3929
+ this.target.setSelectionRange(a, a), this.target.focus(), this.target.dispatchEvent(new Event("input", { bubbles: !0 })), this.close();
3930
+ }
3931
+ showDropdown() {
3932
+ if (!this.target) return;
3933
+ this.dropdown || (this.dropdown = document.createElement("div"), Object.assign(this.dropdown.style, {
3934
+ position: "absolute",
3935
+ zIndex: "100002",
3936
+ background: "#fff",
3937
+ border: "1px solid #e2e8f0",
3938
+ borderRadius: "8px",
3939
+ boxShadow: "0 4px 16px rgba(0,0,0,0.12)",
3940
+ overflow: "hidden",
3941
+ fontFamily: ls,
3942
+ minWidth: "160px",
3943
+ maxWidth: "220px"
3944
+ }), document.body.appendChild(this.dropdown));
3945
+ const e = this.target.getBoundingClientRect();
3946
+ this.dropdown.style.left = `${e.left}px`, this.dropdown.style.top = `${e.bottom + 4}px`, this.renderItems();
3947
+ }
3948
+ renderItems() {
3949
+ if (!this.dropdown) return;
3950
+ const e = new Set(this.client.state.presence.map((t) => t.user.id));
3951
+ this.dropdown.innerHTML = this.filteredUsers.map((t, i) => {
3952
+ const s = t.name.split(" ").map((a) => a[0]).join("").toUpperCase().slice(0, 2), o = i === this.selectedIndex, r = e.has(t.id);
3953
+ return `
3954
+ <div class="mention-item" data-index="${i}" style="
3955
+ display:flex;align-items:center;gap:8px;padding:6px 10px;
3956
+ cursor:pointer;font-size:13px;
3957
+ background:${o ? "#f1f5f9" : "#fff"};
3958
+ transition:background 0.1s;
3959
+ ">
3960
+ <div style="position:relative;flex-shrink:0;">
3961
+ <div style="
3962
+ width:24px;height:24px;border-radius:50%;
3963
+ background:${t.color};color:#fff;
3964
+ display:flex;align-items:center;justify-content:center;
3965
+ font-size:10px;font-weight:700;
3966
+ ">${t.avatar ? `<img src="${t.avatar}" style="width:100%;height:100%;border-radius:50%;object-fit:cover;" />` : s}</div>
3967
+ ${r ? '<div style="position:absolute;bottom:-1px;right:-1px;width:8px;height:8px;border-radius:50%;background:#22c55e;border:1.5px solid #fff;"></div>' : ""}
3968
+ </div>
3969
+ <span style="color:#0f172a;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${this.escapeHtml(t.name)}</span>
3970
+ </div>
3971
+ `;
3972
+ }).join(""), this.dropdown.querySelectorAll(".mention-item").forEach((t) => {
3973
+ t.addEventListener("mousedown", (i) => {
3974
+ i.preventDefault();
3975
+ const s = parseInt(t.dataset.index, 10);
3976
+ this.selectUser(this.filteredUsers[s]);
3977
+ }), t.addEventListener("mouseenter", () => {
3978
+ this.selectedIndex = parseInt(t.dataset.index, 10), this.renderItems();
3979
+ });
3980
+ });
3981
+ }
3982
+ close() {
3983
+ var e;
3984
+ (e = this.dropdown) == null || e.remove(), this.dropdown = null, this.mentionStart = -1, this.filteredUsers = [];
3985
+ }
3986
+ escapeHtml(e) {
3987
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
3988
+ }
3989
+ }
3990
+ const cs = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ds = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', hs = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', xt = `<button class="pulse-close-btn" style="
3881
3991
  border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
3882
3992
  border-radius:6px;display:flex;align-items:center;justify-content:center;
3883
3993
  transition:all 0.15s;flex-shrink:0;
@@ -3885,7 +3995,7 @@ const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-syst
3885
3995
  onmouseout="this.style.background='none';this.style.color='#94a3b8'">
3886
3996
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
3887
3997
  </button>`;
3888
- class ds {
3998
+ class ps {
3889
3999
  constructor(e, t = {}) {
3890
4000
  this.container = null, this.overlay = null, this.form = null, this.popover = null, this.threads = [], this.pinEls = /* @__PURE__ */ new Map(), this._pinModeActive = !1, this.editingPopoverCommentId = null, this.popoverPickerOpen = null, this.lastTypingSendPins = /* @__PURE__ */ new Map(), this.repositionDebounce = null, this.mutationObserver = null, this.upload = null, this.audioRecorder = null, this.videoRecorder = null, this.pendingAttachmentIds = [], this.handleReposition = () => {
3891
4001
  this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
@@ -4025,7 +4135,7 @@ class ds {
4025
4135
  }), this.form.innerHTML = `
4026
4136
  <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
4027
4137
  <span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
4028
- ${bt}
4138
+ ${xt}
4029
4139
  </div>
4030
4140
  <textarea
4031
4141
  placeholder="Write a comment..."
@@ -4057,13 +4167,15 @@ class ds {
4057
4167
  </div>
4058
4168
  <div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
4059
4169
  `;
4060
- const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
4061
- d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
4062
- const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
4063
- const b = document.createElement("div");
4064
- Object.assign(b.style, { position: "relative", display: "inline-block" }), b.appendChild(y);
4065
- const w = document.createElement("button");
4066
- w.innerHTML = "×", Object.assign(w.style, {
4170
+ const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit"), h = new He(this.client);
4171
+ h.attach(l), d.addEventListener("click", () => {
4172
+ h.detach(), this.exitPinMode();
4173
+ }), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
4174
+ const u = this.form.querySelector(".pin-attachments-preview"), f = (x, y) => {
4175
+ const v = document.createElement("div");
4176
+ Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
4177
+ const $ = document.createElement("button");
4178
+ $.innerHTML = "×", Object.assign($.style, {
4067
4179
  position: "absolute",
4068
4180
  top: "-4px",
4069
4181
  right: "-4px",
@@ -4081,51 +4193,51 @@ class ds {
4081
4193
  justifyContent: "center",
4082
4194
  padding: "0",
4083
4195
  fontWeight: "700"
4084
- }), w.addEventListener("click", () => {
4085
- const E = this.pendingAttachmentIds.indexOf(g);
4086
- E !== -1 && this.pendingAttachmentIds.splice(E, 1), b.remove();
4087
- }), b.appendChild(w), h.appendChild(b);
4088
- }, m = 5;
4196
+ }), $.addEventListener("click", () => {
4197
+ const T = this.pendingAttachmentIds.indexOf(x);
4198
+ T !== -1 && this.pendingAttachmentIds.splice(T, 1), v.remove();
4199
+ }), v.appendChild($), u.appendChild(v);
4200
+ }, b = 5;
4089
4201
  this.form.querySelector(".attach-img").addEventListener("click", async () => {
4090
- const g = m - this.pendingAttachmentIds.length;
4091
- if (g <= 0) return;
4092
- const y = await this.upload.pickFiles("image/*", g);
4093
- for (const b of y) {
4094
- this.pendingAttachmentIds.push(b.id);
4095
- const w = document.createElement("img");
4096
- w.src = b.thumbnailUrl || b.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(b.id, w);
4202
+ const x = b - this.pendingAttachmentIds.length;
4203
+ if (x <= 0) return;
4204
+ const y = await this.upload.pickFiles("image/*", x);
4205
+ for (const v of y) {
4206
+ this.pendingAttachmentIds.push(v.id);
4207
+ const $ = document.createElement("img");
4208
+ $.src = v.thumbnailUrl || v.url, Object.assign($.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), f(v.id, $);
4097
4209
  }
4098
4210
  }), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
4099
- if (this.pendingAttachmentIds.length >= m) return;
4100
- this.audioRecorder || (this.audioRecorder = new Ue());
4101
- const g = await this.audioRecorder.startRecording(h);
4102
- if (g) {
4103
- const y = await this.upload.uploadBlob(g, "audio.webm");
4211
+ if (this.pendingAttachmentIds.length >= b) return;
4212
+ this.audioRecorder || (this.audioRecorder = new ze());
4213
+ const x = await this.audioRecorder.startRecording(u);
4214
+ if (x) {
4215
+ const y = await this.upload.uploadBlob(x, "audio.webm");
4104
4216
  if (y) {
4105
4217
  this.pendingAttachmentIds.push(y.id);
4106
- const b = document.createElement("span");
4107
- Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎤 Audio", p(y.id, b);
4218
+ const v = document.createElement("span");
4219
+ Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", f(y.id, v);
4108
4220
  }
4109
4221
  }
4110
4222
  }), this.form.querySelector(".attach-video").addEventListener("click", async () => {
4111
- if (this.pendingAttachmentIds.length >= m) return;
4223
+ if (this.pendingAttachmentIds.length >= b) return;
4112
4224
  this.videoRecorder || (this.videoRecorder = new De());
4113
- const g = await this.videoRecorder.startRecording(h);
4114
- if (g) {
4115
- const y = await this.upload.uploadBlob(g.blob, "video.webm");
4225
+ const x = await this.videoRecorder.startRecording(u);
4226
+ if (x) {
4227
+ const y = await this.upload.uploadBlob(x.blob, "video.webm");
4116
4228
  if (y) {
4117
4229
  this.pendingAttachmentIds.push(y.id);
4118
- const b = document.createElement("span");
4119
- Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎥 Video", p(y.id, b);
4230
+ const v = document.createElement("span");
4231
+ Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", f(y.id, v);
4120
4232
  }
4121
4233
  }
4122
4234
  }), c.addEventListener("click", () => {
4123
- const g = l.value.trim();
4124
- if (!g && this.pendingAttachmentIds.length === 0) return;
4125
- const y = [...(g || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
4126
- this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4127
- }), l.addEventListener("keydown", (g) => {
4128
- g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
4235
+ const x = l.value.trim();
4236
+ if (!x && this.pendingAttachmentIds.length === 0) return;
4237
+ const y = [...(x || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
4238
+ this.client.createThread(x, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4239
+ }), l.addEventListener("keydown", (x) => {
4240
+ x.key === "Escape" && this.exitPinMode(), x.stopPropagation();
4129
4241
  }), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
4130
4242
  }
4131
4243
  // ── Inline thread popover (shown when a pin dot is clicked) ──
@@ -4161,7 +4273,7 @@ class ds {
4161
4273
  flexShrink: "0"
4162
4274
  }), l.innerHTML = `
4163
4275
  <span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
4164
- ${bt}
4276
+ ${xt}
4165
4277
  `, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
4166
4278
  this.closePopover();
4167
4279
  }), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
@@ -4189,13 +4301,13 @@ class ds {
4189
4301
  }
4190
4302
  const i = (d = this.client.state.user) == null ? void 0 : d.id;
4191
4303
  t.innerHTML = e.comments.map((c) => {
4192
- const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((R) => R[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), b = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4304
+ const h = this.client.state.getUser(c.userId), u = h ? h.name.split(" ").map((R) => R[0]).join("").toUpperCase().slice(0, 2) : "?", f = (h == null ? void 0 : h.color) ?? "#94a3b8", b = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), x = this.formatTime(c.createdAt), y = i === c.userId, v = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4193
4305
  if (this.editingPopoverCommentId === c.id)
4194
4306
  return `
4195
4307
  <div style="margin-bottom:10px;" data-comment-id="${c.id}">
4196
4308
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
4197
- <div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
4198
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4309
+ <div style="width:22px;height:22px;border-radius:50%;background:${f};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${u}</div>
4310
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${b}</span>
4199
4311
  </div>
4200
4312
  <div style="margin-left:29px;">
4201
4313
  <textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(c.body)}</textarea>
@@ -4206,37 +4318,37 @@ class ds {
4206
4318
  </div>
4207
4319
  </div>
4208
4320
  `;
4209
- const E = c.body && c.body !== "(attachment)" ? c.body.replace(
4321
+ const $ = c.body && c.body !== "(attachment)" ? c.body.replace(
4210
4322
  /@(\w+)/g,
4211
4323
  '<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
4212
- ) : "", I = (c.attachments ?? []).map((R) => {
4324
+ ) : "", T = (c.attachments ?? []).map((R) => {
4213
4325
  if (R.type === "image") {
4214
- const Lt = R.thumbnailUrl || R.url;
4326
+ const jt = R.thumbnailUrl || R.url;
4215
4327
  return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(R.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
4216
- <img src="${this.escapeHtml(Lt)}" alt="${this.escapeHtml(R.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4328
+ <img src="${this.escapeHtml(jt)}" alt="${this.escapeHtml(R.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4217
4329
  </div>`;
4218
4330
  }
4219
4331
  return R.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(R.url)}" data-duration="${R.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : R.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(R.url)}" data-poster="${this.escapeHtml(R.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4220
- }).join(""), z = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4332
+ }).join(""), U = y ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4221
4333
  <button class="edit-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
4222
4334
  onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
4223
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ls}</button>
4335
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ds}</button>
4224
4336
  <button class="delete-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Delete"
4225
4337
  onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
4226
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${cs}</button>
4227
- </div>` : "", Rt = this.buildReactionPillsHtml(c.id);
4338
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${hs}</button>
4339
+ </div>` : "", Lt = this.buildReactionPillsHtml(c.id);
4228
4340
  return `
4229
4341
  <div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
4230
4342
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
4231
- <div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
4232
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4233
- <span style="font-size:10px;color:#94a3b8;">${y}</span>
4234
- ${w}
4343
+ <div style="width:22px;height:22px;border-radius:50%;background:${f};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${u}</div>
4344
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${b}</span>
4345
+ <span style="font-size:10px;color:#94a3b8;">${x}</span>
4346
+ ${v}
4235
4347
  </div>
4236
- ${E ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${E}</div>` : ""}
4237
- ${I}
4238
- ${z}
4239
- ${Rt}
4348
+ ${$ ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${$}</div>` : ""}
4349
+ ${T}
4350
+ ${U}
4351
+ ${Lt}
4240
4352
  </div>
4241
4353
  `;
4242
4354
  }).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
@@ -4254,7 +4366,7 @@ class ds {
4254
4366
  s && r && s.addEventListener("click", () => {
4255
4367
  const c = r.value.trim();
4256
4368
  if (!c) return;
4257
- const h = [...c.matchAll(/@(\w+)/g)].map((p) => p[1]);
4369
+ const h = [...c.matchAll(/@(\w+)/g)].map((u) => u[1]);
4258
4370
  this.client.editComment(
4259
4371
  this.editingPopoverCommentId,
4260
4372
  c,
@@ -4265,33 +4377,33 @@ class ds {
4265
4377
  }), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
4266
4378
  c.addEventListener("click", (h) => {
4267
4379
  h.stopPropagation();
4268
- const p = c.dataset.reactionEmoji, m = c.dataset.reactionTarget, g = c.dataset.reactionId;
4269
- g ? this.client.removeReaction(g) : this.client.addReaction(m, "comment", p);
4380
+ const u = c.dataset.reactionEmoji, f = c.dataset.reactionTarget, b = c.dataset.reactionId;
4381
+ b ? this.client.removeReaction(b) : this.client.addReaction(f, "comment", u);
4270
4382
  });
4271
4383
  }), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
4272
4384
  c.addEventListener("click", (h) => {
4273
4385
  h.stopPropagation();
4274
- const p = c.dataset.commentId;
4275
- this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(c, p));
4386
+ const u = c.dataset.commentId;
4387
+ this.popoverPickerOpen === u ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = u, this.showPickerForButton(c, u));
4276
4388
  });
4277
4389
  });
4278
4390
  const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
4279
4391
  a.forEach((c, h) => {
4280
4392
  c.addEventListener("click", () => {
4281
- const p = c.dataset.fullUrl;
4282
- p && Te.open(p, l, h);
4393
+ const u = c.dataset.fullUrl;
4394
+ u && Te.open(u, l, h);
4283
4395
  });
4284
4396
  }), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
4285
4397
  const h = c.dataset.url;
4286
4398
  if (h) {
4287
- const p = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, m = ze.render(h, p);
4288
- c.appendChild(m);
4399
+ const u = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, f = Ue.render(h, u);
4400
+ c.appendChild(f);
4289
4401
  }
4290
4402
  }), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
4291
4403
  const h = c.dataset.url;
4292
4404
  if (h) {
4293
- const p = c.dataset.poster || void 0, m = Ce.render(h, p);
4294
- c.appendChild(m);
4405
+ const u = c.dataset.poster || void 0, f = Ce.render(h, u);
4406
+ c.appendChild(f);
4295
4407
  }
4296
4408
  }), t.scrollTop = t.scrollHeight;
4297
4409
  }
@@ -4324,9 +4436,11 @@ class ds {
4324
4436
  `;
4325
4437
  const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
4326
4438
  this.upload || (this.upload = new re(this.client));
4327
- const l = [], d = (p, m) => {
4328
- const g = document.createElement("span");
4329
- Object.assign(g.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), g.textContent = m;
4439
+ const l = [];
4440
+ new He(this.client).attach(o);
4441
+ const c = (f, b) => {
4442
+ const x = document.createElement("span");
4443
+ Object.assign(x.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), x.textContent = b;
4330
4444
  const y = document.createElement("button");
4331
4445
  y.innerHTML = "×", Object.assign(y.style, {
4332
4446
  position: "absolute",
@@ -4347,44 +4461,44 @@ class ds {
4347
4461
  padding: "0",
4348
4462
  fontWeight: "700"
4349
4463
  }), y.addEventListener("click", () => {
4350
- const b = l.indexOf(p);
4351
- b !== -1 && l.splice(b, 1), g.remove();
4352
- }), g.appendChild(y), a.appendChild(g);
4353
- }, c = 5;
4464
+ const v = l.indexOf(f);
4465
+ v !== -1 && l.splice(v, 1), x.remove();
4466
+ }), x.appendChild(y), a.appendChild(x);
4467
+ }, h = 5;
4354
4468
  t.querySelector(".reply-attach-img").addEventListener("click", async () => {
4355
- const p = c - l.length;
4356
- if (p <= 0) return;
4357
- const m = await this.upload.pickFiles("image/*", p);
4358
- for (const g of m)
4359
- l.push(g.id), d(g.id, "📎 Image");
4469
+ const f = h - l.length;
4470
+ if (f <= 0) return;
4471
+ const b = await this.upload.pickFiles("image/*", f);
4472
+ for (const x of b)
4473
+ l.push(x.id), c(x.id, "📎 Image");
4360
4474
  }), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
4361
- if (l.length >= c) return;
4362
- this.audioRecorder || (this.audioRecorder = new Ue());
4363
- const p = await this.audioRecorder.startRecording(t);
4364
- if (p) {
4365
- const m = await this.upload.uploadBlob(p, "audio.webm");
4366
- m && (l.push(m.id), d(m.id, "🎤 Audio"));
4475
+ if (l.length >= h) return;
4476
+ this.audioRecorder || (this.audioRecorder = new ze());
4477
+ const f = await this.audioRecorder.startRecording(t);
4478
+ if (f) {
4479
+ const b = await this.upload.uploadBlob(f, "audio.webm");
4480
+ b && (l.push(b.id), c(b.id, "🎤 Audio"));
4367
4481
  }
4368
4482
  }), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
4369
- if (l.length >= c) return;
4483
+ if (l.length >= h) return;
4370
4484
  this.videoRecorder || (this.videoRecorder = new De());
4371
- const p = await this.videoRecorder.startRecording(t);
4372
- if (p) {
4373
- const m = await this.upload.uploadBlob(p.blob, "video.webm");
4374
- m && (l.push(m.id), d(m.id, "🎥 Video"));
4485
+ const f = await this.videoRecorder.startRecording(t);
4486
+ if (f) {
4487
+ const b = await this.upload.uploadBlob(f.blob, "video.webm");
4488
+ b && (l.push(b.id), c(b.id, "🎥 Video"));
4375
4489
  }
4376
4490
  });
4377
- const h = () => {
4378
- const p = o.value.trim();
4379
- if (!p && l.length === 0) return;
4380
- const m = [...(p || "").matchAll(/@(\w+)/g)].map((g) => g[1]);
4381
- this.client.reply(e.id, p, m, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
4491
+ const u = () => {
4492
+ const f = o.value.trim();
4493
+ if (!f && l.length === 0) return;
4494
+ const b = [...(f || "").matchAll(/@(\w+)/g)].map((x) => x[1]);
4495
+ this.client.reply(e.id, f, b, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
4382
4496
  };
4383
- r.addEventListener("click", h), o.addEventListener("input", () => {
4384
- const p = Date.now(), m = this.lastTypingSendPins.get(e.id) ?? 0;
4385
- p - m >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, p));
4386
- }), o.addEventListener("keydown", (p) => {
4387
- p.key === "Enter" && (p.preventDefault(), h()), p.key === "Escape" && this.closePopover(), p.stopPropagation();
4497
+ r.addEventListener("click", u), o.addEventListener("input", () => {
4498
+ const f = Date.now(), b = this.lastTypingSendPins.get(e.id) ?? 0;
4499
+ f - b >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, f));
4500
+ }), o.addEventListener("keydown", (f) => {
4501
+ f.key === "Enter" && (f.preventDefault(), u()), f.key === "Escape" && this.closePopover(), f.stopPropagation();
4388
4502
  }), this.popover.appendChild(t);
4389
4503
  }
4390
4504
  removePickerEl() {
@@ -4409,7 +4523,7 @@ class ds {
4409
4523
  zIndex: "10002",
4410
4524
  fontFamily: xe
4411
4525
  });
4412
- for (const s of as) {
4526
+ for (const s of cs) {
4413
4527
  const o = document.createElement("button");
4414
4528
  Object.assign(o.style, {
4415
4529
  border: "none",
@@ -4442,8 +4556,8 @@ class ds {
4442
4556
  const o = "display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:12px;border:1px solid #e2e8f0;background:#fff;font-size:12px;cursor:pointer;transition:all 0.15s;line-height:1.4;", r = o + "background:#eef2ff;border-color:#6366f1;";
4443
4557
  let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
4444
4558
  for (const [d, { count: c, ownId: h }] of s) {
4445
- const p = h ? r : o;
4446
- a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${p}">
4559
+ const u = h ? r : o;
4560
+ a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${u}">
4447
4561
  <span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
4448
4562
  </button>`;
4449
4563
  }
@@ -4544,13 +4658,13 @@ class ds {
4544
4658
  });
4545
4659
  }
4546
4660
  }
4547
- var hs = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, U = (n, e, t, i) => {
4548
- for (var s = i > 1 ? void 0 : i ? ps(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4661
+ var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, z = (n, e, t, i) => {
4662
+ for (var s = i > 1 ? void 0 : i ? fs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4549
4663
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
4550
- return i && s && hs(e, t, s), s;
4664
+ return i && s && us(e, t, s), s;
4551
4665
  };
4552
- const us = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4553
- let _ = class extends P {
4666
+ const ms = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4667
+ let I = class extends _ {
4554
4668
  constructor() {
4555
4669
  super(...arguments), this.highlightThreadId = null, this.threadsVersion = 0, this.replyingTo = null, this.editingCommentId = null, this.editBody = "", this.pickerOpenForComment = null, this.typingByThread = /* @__PURE__ */ new Map(), this.reactionsVersion = 0, this.typingTimers = /* @__PURE__ */ new Map(), this.lastTypingSend = /* @__PURE__ */ new Map(), this.replyAttachmentIds = [];
4556
4670
  }
@@ -4568,18 +4682,19 @@ let _ = class extends P {
4568
4682
  this.client && !this.unsub && this.ensureListener();
4569
4683
  }
4570
4684
  updated(n) {
4571
- var e, t;
4572
- (e = this.shadowRoot) == null || e.querySelectorAll(".audio-player-host").forEach((i) => {
4573
- if (i.children.length > 0) return;
4574
- const s = i.dataset.url;
4575
- if (s) {
4576
- const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
4577
- i.appendChild(ze.render(s, o));
4578
- }
4579
- }), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
4580
- if (i.children.length > 0) return;
4581
- const s = i.dataset.url;
4582
- s && i.appendChild(Ce.render(s, i.dataset.poster || void 0));
4685
+ var t, i, s;
4686
+ const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".reply-form input");
4687
+ e && this.client && (this.mentionPicker || (this.mentionPicker = new He(this.client)), e.dataset.mentionAttached || (this.mentionPicker.attach(e), e.dataset.mentionAttached = "1")), (i = this.shadowRoot) == null || i.querySelectorAll(".audio-player-host").forEach((o) => {
4688
+ if (o.children.length > 0) return;
4689
+ const r = o.dataset.url;
4690
+ if (r) {
4691
+ const a = o.dataset.duration ? parseInt(o.dataset.duration) : void 0;
4692
+ o.appendChild(Ue.render(r, a));
4693
+ }
4694
+ }), (s = this.shadowRoot) == null || s.querySelectorAll(".video-player-host").forEach((o) => {
4695
+ if (o.children.length > 0) return;
4696
+ const r = o.dataset.url;
4697
+ r && o.appendChild(Ce.render(r, o.dataset.poster || void 0));
4583
4698
  });
4584
4699
  }
4585
4700
  teardownListeners() {
@@ -4647,7 +4762,7 @@ let _ = class extends P {
4647
4762
  }
4648
4763
  parseMentions(n) {
4649
4764
  return n.split(/(@\w+)/g).map(
4650
- (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
4765
+ (t) => t.startsWith("@") ? p`<span class="mention">${t}</span>` : t
4651
4766
  );
4652
4767
  }
4653
4768
  getInitials(n) {
@@ -4665,15 +4780,15 @@ let _ = class extends P {
4665
4780
  }
4666
4781
  async handleAttachImage() {
4667
4782
  this.upload || (this.upload = new re(this.client));
4668
- const n = _.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
4783
+ const n = I.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
4669
4784
  if (n <= 0) return;
4670
4785
  const e = await this.upload.pickFiles("image/*", n);
4671
4786
  e.length > 0 && (this.replyAttachmentIds.push(...e.map((t) => t.id)), this.requestUpdate());
4672
4787
  }
4673
4788
  async handleRecordAudio(n) {
4674
4789
  var i;
4675
- if (this.replyAttachmentIds.length >= _.MAX_ATTACHMENTS) return;
4676
- this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new Ue());
4790
+ if (this.replyAttachmentIds.length >= I.MAX_ATTACHMENTS) return;
4791
+ this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
4677
4792
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
4678
4793
  if (t) {
4679
4794
  const s = await this.upload.uploadBlob(t, "audio.webm");
@@ -4682,7 +4797,7 @@ let _ = class extends P {
4682
4797
  }
4683
4798
  async handleRecordVideo(n) {
4684
4799
  var i;
4685
- if (this.replyAttachmentIds.length >= _.MAX_ATTACHMENTS) return;
4800
+ if (this.replyAttachmentIds.length >= I.MAX_ATTACHMENTS) return;
4686
4801
  this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new De());
4687
4802
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
4688
4803
  if (t) {
@@ -4720,7 +4835,7 @@ let _ = class extends P {
4720
4835
  this.client.deleteComment(n);
4721
4836
  }
4722
4837
  renderEditForm(n) {
4723
- return u`
4838
+ return p`
4724
4839
  <div class="edit-form">
4725
4840
  <textarea
4726
4841
  .value=${this.editBody}
@@ -4741,12 +4856,12 @@ let _ = class extends P {
4741
4856
  const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
4742
4857
  for (const o of e)
4743
4858
  i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
4744
- return u`
4859
+ return p`
4745
4860
  <div class="comment-reactions">
4746
4861
  ${[...i.entries()].map(
4747
4862
  ([o, r]) => {
4748
4863
  const a = r.some((l) => l.userId === t);
4749
- return u`
4864
+ return p`
4750
4865
  <button
4751
4866
  class="reaction-pill ${a ? "own" : ""}"
4752
4867
  @click=${() => this.toggleReaction(n.id, o)}
@@ -4765,26 +4880,26 @@ let _ = class extends P {
4765
4880
  title="Add reaction"
4766
4881
  >
4767
4882
  +
4768
- ${this.pickerOpenForComment === n.id ? u`
4883
+ ${this.pickerOpenForComment === n.id ? p`
4769
4884
  <div class="emoji-picker">
4770
- ${us.map(
4771
- (o) => u`
4885
+ ${ms.map(
4886
+ (o) => p`
4772
4887
  <button @click=${(r) => {
4773
4888
  r.stopPropagation(), this.toggleReaction(n.id, o);
4774
4889
  }}>${o}</button>
4775
4890
  `
4776
4891
  )}
4777
4892
  </div>
4778
- ` : v}
4893
+ ` : g}
4779
4894
  </button>
4780
4895
  </div>
4781
4896
  `;
4782
4897
  }
4783
4898
  renderTypingIndicator(n) {
4784
4899
  const e = this.typingByThread.get(n) ?? [];
4785
- if (e.length === 0) return v;
4900
+ if (e.length === 0) return g;
4786
4901
  const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
4787
- return u`<div class="typing-indicator">${t}</div>`;
4902
+ return p`<div class="typing-indicator">${t}</div>`;
4788
4903
  }
4789
4904
  sortedThreads() {
4790
4905
  return [...this.threads].sort((n, e) => {
@@ -4795,7 +4910,7 @@ let _ = class extends P {
4795
4910
  }
4796
4911
  render() {
4797
4912
  const n = this.sortedThreads();
4798
- return u`
4913
+ return p`
4799
4914
  <div class="panel">
4800
4915
  <div class="panel-header">
4801
4916
  <span class="panel-title">
@@ -4803,12 +4918,12 @@ let _ = class extends P {
4803
4918
  <span class="thread-count">${this.threads.length}</span>
4804
4919
  </span>
4805
4920
  <button class="close-btn" @click=${this.fireClose} title="Close">
4806
- ${T(ve, 16)}
4921
+ ${S(ve, 16)}
4807
4922
  </button>
4808
4923
  </div>
4809
4924
 
4810
4925
  <div class="panel-body pw-scrollable">
4811
- ${n.length === 0 ? u`<div class="empty">
4926
+ ${n.length === 0 ? p`<div class="empty">
4812
4927
  <div class="empty-icon">&#128172;</div>
4813
4928
  No comments yet
4814
4929
  </div>` : n.map((e) => this.renderThread(e))}
@@ -4821,13 +4936,13 @@ let _ = class extends P {
4821
4936
  `;
4822
4937
  }
4823
4938
  renderAttachments(n) {
4824
- if (!n || n.length === 0) return v;
4939
+ if (!n || n.length === 0) return g;
4825
4940
  const e = n.filter((t) => t.type === "image").map((t) => t.url);
4826
- return u`
4941
+ return p`
4827
4942
  ${n.map((t) => {
4828
4943
  if (t.type === "image") {
4829
4944
  const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
4830
- return u`
4945
+ return p`
4831
4946
  <div class="comment-attachment-media">
4832
4947
  <img
4833
4948
  class="comment-attachment-img"
@@ -4838,40 +4953,40 @@ let _ = class extends P {
4838
4953
  </div>
4839
4954
  `;
4840
4955
  }
4841
- return t.type === "audio" ? u`
4956
+ return t.type === "audio" ? p`
4842
4957
  <div class="comment-attachment-media" id="audio-${t.id}">
4843
4958
  ${this.renderAudioPlayer(t)}
4844
4959
  </div>
4845
- ` : t.type === "video" ? u`
4960
+ ` : t.type === "video" ? p`
4846
4961
  <div class="comment-attachment-media" id="video-${t.id}">
4847
4962
  ${this.renderVideoPlayer(t)}
4848
4963
  </div>
4849
- ` : v;
4964
+ ` : g;
4850
4965
  })}
4851
4966
  `;
4852
4967
  }
4853
4968
  renderAudioPlayer(n) {
4854
- const e = document.createElement("div"), t = ze.render(n.url, n.durationMs);
4855
- return e.appendChild(t), u`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4969
+ const e = document.createElement("div"), t = Ue.render(n.url, n.durationMs);
4970
+ return e.appendChild(t), p`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4856
4971
  }
4857
4972
  renderVideoPlayer(n) {
4858
- return u`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4973
+ return p`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4859
4974
  }
4860
4975
  renderThread(n) {
4861
4976
  const e = this.highlightThreadId === n.id;
4862
- return u`
4977
+ return p`
4863
4978
  <div
4864
4979
  class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
4865
4980
  data-thread-id=${n.id}
4866
4981
  >
4867
- ${n.position ? u`<div class="pin-badge">
4868
- ${T(Mt, 12)}
4982
+ ${n.position ? p`<div class="pin-badge">
4983
+ ${S(Ot, 12)}
4869
4984
  Pinned
4870
- </div>` : v}
4985
+ </div>` : g}
4871
4986
  ${n.comments.map((t, i) => {
4872
4987
  const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
4873
- return u`
4874
- ${i > 0 ? u`<div class="comment-divider"></div>` : v}
4988
+ return p`
4989
+ ${i > 0 ? p`<div class="comment-divider"></div>` : g}
4875
4990
  <div class="comment">
4876
4991
  <div class="comment-header">
4877
4992
  <div
@@ -4882,16 +4997,16 @@ let _ = class extends P {
4882
4997
  </div>
4883
4998
  <span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
4884
4999
  <span class="comment-time">${this.formatTime(t.createdAt)}</span>
4885
- ${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : v}
5000
+ ${t.editedAt ? p`<span class="edited-badge">(edited)</span>` : g}
4886
5001
  </div>
4887
- ${r ? this.renderEditForm(t) : u`
4888
- ${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : v}
5002
+ ${r ? this.renderEditForm(t) : p`
5003
+ ${t.body && t.body !== "(attachment)" ? p`<div class="comment-body">${this.parseMentions(t.body)}</div>` : g}
4889
5004
  ${this.renderAttachments(t.attachments ?? [])}
4890
5005
  `}
4891
- ${o && !r ? u`<div class="comment-actions">
4892
- <button @click=${() => this.startEdit(t)} title="Edit">${T(Di, 14)}</button>
4893
- <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${T(Ni, 14)}</button>
4894
- </div>` : v}
5006
+ ${o && !r ? p`<div class="comment-actions">
5007
+ <button @click=${() => this.startEdit(t)} title="Edit">${S(Hi, 14)}</button>
5008
+ <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${S(Ni, 14)}</button>
5009
+ </div>` : g}
4895
5010
  ${this.renderReactions(t)}
4896
5011
  </div>
4897
5012
  `;
@@ -4912,7 +5027,7 @@ let _ = class extends P {
4912
5027
 
4913
5028
  ${this.renderTypingIndicator(n.id)}
4914
5029
 
4915
- ${this.replyingTo === n.id ? u`
5030
+ ${this.replyingTo === n.id ? p`
4916
5031
  <form
4917
5032
  class="reply-form"
4918
5033
  @submit=${(t) => this.handleReply(n.id, t)}
@@ -4931,22 +5046,22 @@ let _ = class extends P {
4931
5046
  class="reply-media-btn"
4932
5047
  title="Attach image"
4933
5048
  @click=${() => this.handleAttachImage()}
4934
- >${T(zi, 16)}</button>
5049
+ >${S(zi, 16)}</button>
4935
5050
  <button
4936
5051
  type="button"
4937
5052
  class="reply-media-btn"
4938
5053
  title="Record audio"
4939
5054
  @click=${() => this.handleRecordAudio(n.id)}
4940
- >${T(ji, 16)}</button>
5055
+ >${S(Ui, 16)}</button>
4941
5056
  <button
4942
5057
  type="button"
4943
5058
  class="reply-media-btn"
4944
5059
  title="Record video"
4945
5060
  @click=${() => this.handleRecordVideo(n.id)}
4946
- >${T(Bi, 16)}</button>
5061
+ >${S(Fi, 16)}</button>
4947
5062
  <div class="reply-preview">
4948
5063
  ${this.replyAttachmentIds.map(
4949
- (t, i) => u`<span class="reply-preview-badge">
5064
+ (t, i) => p`<span class="reply-preview-badge">
4950
5065
  Attached #${i + 1}
4951
5066
  <button
4952
5067
  type="button"
@@ -4958,12 +5073,12 @@ let _ = class extends P {
4958
5073
  </div>
4959
5074
  </div>
4960
5075
  </form>
4961
- ` : v}
5076
+ ` : g}
4962
5077
  </div>
4963
5078
  `;
4964
5079
  }
4965
5080
  };
4966
- _.styles = [
5081
+ I.styles = [
4967
5082
  ie,
4968
5083
  be,
4969
5084
  Pe,
@@ -5507,56 +5622,56 @@ _.styles = [
5507
5622
  }
5508
5623
  `
5509
5624
  ];
5510
- _.MAX_ATTACHMENTS = 5;
5511
- U([
5512
- x({ attribute: !1 })
5513
- ], _.prototype, "client", 2);
5514
- U([
5515
- x()
5516
- ], _.prototype, "highlightThreadId", 2);
5517
- U([
5518
- $()
5519
- ], _.prototype, "threadsVersion", 2);
5520
- U([
5521
- $()
5522
- ], _.prototype, "replyingTo", 2);
5523
- U([
5524
- $()
5525
- ], _.prototype, "editingCommentId", 2);
5526
- U([
5527
- $()
5528
- ], _.prototype, "editBody", 2);
5529
- U([
5530
- $()
5531
- ], _.prototype, "pickerOpenForComment", 2);
5532
- U([
5533
- $()
5534
- ], _.prototype, "typingByThread", 2);
5535
- U([
5536
- $()
5537
- ], _.prototype, "reactionsVersion", 2);
5538
- _ = U([
5625
+ I.MAX_ATTACHMENTS = 5;
5626
+ z([
5627
+ w({ attribute: !1 })
5628
+ ], I.prototype, "client", 2);
5629
+ z([
5630
+ w()
5631
+ ], I.prototype, "highlightThreadId", 2);
5632
+ z([
5633
+ k()
5634
+ ], I.prototype, "threadsVersion", 2);
5635
+ z([
5636
+ k()
5637
+ ], I.prototype, "replyingTo", 2);
5638
+ z([
5639
+ k()
5640
+ ], I.prototype, "editingCommentId", 2);
5641
+ z([
5642
+ k()
5643
+ ], I.prototype, "editBody", 2);
5644
+ z([
5645
+ k()
5646
+ ], I.prototype, "pickerOpenForComment", 2);
5647
+ z([
5648
+ k()
5649
+ ], I.prototype, "typingByThread", 2);
5650
+ z([
5651
+ k()
5652
+ ], I.prototype, "reactionsVersion", 2);
5653
+ I = z([
5539
5654
  L("pulse-widget-comments-panel")
5540
- ], _);
5541
- var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
5542
- for (var s = i > 1 ? void 0 : i ? ms(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5655
+ ], I);
5656
+ var gs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, Ke = (n, e, t, i) => {
5657
+ for (var s = i > 1 ? void 0 : i ? vs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5543
5658
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
5544
- return i && s && fs(e, t, s), s;
5659
+ return i && s && gs(e, t, s), s;
5545
5660
  };
5546
- const gs = {
5661
+ const bs = {
5547
5662
  "comment:created": "left a comment",
5548
5663
  "comment:mention": "mentioned you",
5549
5664
  "comment:reply": "replied to your comment",
5550
5665
  "thread:resolved": "resolved a thread",
5551
5666
  "reaction:added": "reacted to your comment"
5552
- }, vs = {
5667
+ }, xs = {
5553
5668
  "comment:created": "💬",
5554
5669
  "comment:mention": "📣",
5555
5670
  "comment:reply": "↩️",
5556
5671
  "thread:resolved": "✅",
5557
5672
  "reaction:added": "🎉"
5558
5673
  };
5559
- let pe = class extends P {
5674
+ let pe = class extends _ {
5560
5675
  constructor() {
5561
5676
  super(...arguments), this.notifications = [];
5562
5677
  }
@@ -5600,38 +5715,38 @@ let pe = class extends P {
5600
5715
  }
5601
5716
  render() {
5602
5717
  const n = this.notifications.filter((e) => !e.read).length;
5603
- return u`
5718
+ return p`
5604
5719
  <div class="panel">
5605
5720
  <div class="panel-header">
5606
5721
  <span class="panel-title">
5607
5722
  Notifications
5608
- ${n > 0 ? u`<span class="unread-badge">${n}</span>` : v}
5723
+ ${n > 0 ? p`<span class="unread-badge">${n}</span>` : g}
5609
5724
  </span>
5610
5725
  <div style="display:flex;align-items:center;gap:4px;">
5611
- ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5726
+ ${n > 0 ? p`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5612
5727
  Mark all read
5613
- </button>` : v}
5728
+ </button>` : g}
5614
5729
  <button class="close-btn" @click=${this.fireClose} title="Close">
5615
- ${T(ve, 16)}
5730
+ ${S(ve, 16)}
5616
5731
  </button>
5617
5732
  </div>
5618
5733
  </div>
5619
5734
 
5620
5735
  <div class="panel-body pw-scrollable">
5621
- ${this.notifications.length === 0 ? u`<div class="empty">
5736
+ ${this.notifications.length === 0 ? p`<div class="empty">
5622
5737
  <div class="empty-icon">&#128276;</div>
5623
5738
  No notifications
5624
5739
  </div>` : this.notifications.map(
5625
- (e) => u`
5740
+ (e) => p`
5626
5741
  <div
5627
5742
  class="item ${e.read ? "" : "unread"}"
5628
5743
  @click=${() => this.handleClick(e)}
5629
5744
  >
5630
- <span class="icon">${vs[e.type] ?? "🔔"}</span>
5745
+ <span class="icon">${xs[e.type] ?? "🔔"}</span>
5631
5746
  <div class="content">
5632
5747
  <div class="text">
5633
5748
  <span class="actor">${this.getActorName(e.actorId)}</span>
5634
- ${gs[e.type] ?? e.type}
5749
+ ${bs[e.type] ?? e.type}
5635
5750
  </div>
5636
5751
  <div class="time">${this.formatTime(e.createdAt)}</div>
5637
5752
  </div>
@@ -5841,17 +5956,17 @@ pe.styles = [
5841
5956
  }
5842
5957
  `
5843
5958
  ];
5844
- Ye([
5845
- x({ attribute: !1 })
5959
+ Ke([
5960
+ w({ attribute: !1 })
5846
5961
  ], pe.prototype, "client", 2);
5847
- Ye([
5848
- $()
5962
+ Ke([
5963
+ k()
5849
5964
  ], pe.prototype, "notifications", 2);
5850
- pe = Ye([
5965
+ pe = Ke([
5851
5966
  L("pulse-widget-notifications-panel")
5852
5967
  ], pe);
5853
- const bs = 3e3;
5854
- class xs {
5968
+ const ys = 3e3;
5969
+ class ws {
5855
5970
  constructor(e) {
5856
5971
  this.container = null, this.cursors = /* @__PURE__ */ new Map(), this.cursorEls = /* @__PURE__ */ new Map(), this.cursorLastSeen = /* @__PURE__ */ new Map(), this.unsubs = [], this.enabled = !1, this.sending = !1, this.staleTimer = null, this.handleLocalCursor = (t) => {
5857
5972
  t.pointerType !== "touch" && this.client.moveCursor({
@@ -5903,7 +6018,7 @@ class xs {
5903
6018
  ), this.setSending(!0), this.staleTimer = setInterval(() => {
5904
6019
  const e = Date.now();
5905
6020
  for (const [t, i] of this.cursorLastSeen)
5906
- if (e - i > bs) {
6021
+ if (e - i > ys) {
5907
6022
  this.cursors.delete(t);
5908
6023
  const s = this.cursorEls.get(t);
5909
6024
  s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
@@ -5999,7 +6114,7 @@ class xs {
5999
6114
  i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
6000
6115
  }
6001
6116
  }
6002
- class ys {
6117
+ class $s {
6003
6118
  constructor(e) {
6004
6119
  this.container = null, this.unsubs = [], this.enabled = !1, this.drawMode = !1, this.currentPoints = [], this.currentPath = null, this.lastPoint = null, this.fadeTimers = /* @__PURE__ */ new Map(), this.handlePointerDown = (t) => {
6005
6120
  var a, l, d;
@@ -6082,9 +6197,9 @@ class ys {
6082
6197
  this.fadeTimers.set(e, t);
6083
6198
  }
6084
6199
  }
6085
- function ws(n) {
6200
+ function ks(n) {
6086
6201
  if (!n.rangeCount || n.isCollapsed) return null;
6087
- const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = xt(t), o = xt(i);
6202
+ const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = yt(t), o = yt(i);
6088
6203
  return !s || !o ? null : {
6089
6204
  startSelector: s,
6090
6205
  startOffset: e.startOffset,
@@ -6092,10 +6207,10 @@ function ws(n) {
6092
6207
  endOffset: e.endOffset
6093
6208
  };
6094
6209
  }
6095
- function $s(n) {
6210
+ function Es(n) {
6096
6211
  var e, t;
6097
6212
  try {
6098
- const i = wt(n.startSelector), s = wt(n.endSelector);
6213
+ const i = $t(n.startSelector), s = $t(n.endSelector);
6099
6214
  if (!i || !s) return null;
6100
6215
  const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, a = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
6101
6216
  return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
@@ -6103,18 +6218,18 @@ function $s(n) {
6103
6218
  return null;
6104
6219
  }
6105
6220
  }
6106
- function xt(n) {
6221
+ function yt(n) {
6107
6222
  if (n.nodeType === Node.TEXT_NODE) {
6108
6223
  const e = n.parentElement;
6109
6224
  if (!e) return null;
6110
- const t = yt(e);
6225
+ const t = wt(e);
6111
6226
  if (!t) return null;
6112
6227
  const i = Array.from(e.childNodes).indexOf(n);
6113
6228
  return `${t}::text(${i})`;
6114
6229
  }
6115
- return n.nodeType === Node.ELEMENT_NODE ? yt(n) : null;
6230
+ return n.nodeType === Node.ELEMENT_NODE ? wt(n) : null;
6116
6231
  }
6117
- function yt(n) {
6232
+ function wt(n) {
6118
6233
  if (!n || n === document.documentElement) return "html";
6119
6234
  if (n === document.body) return "body";
6120
6235
  if (n.id) return `#${CSS.escape(n.id)}`;
@@ -6140,7 +6255,7 @@ function yt(n) {
6140
6255
  }
6141
6256
  return e.length > 0 ? e.join(" > ") : null;
6142
6257
  }
6143
- function wt(n) {
6258
+ function $t(n) {
6144
6259
  const e = n.match(/^(.+)::text\((\d+)\)$/);
6145
6260
  if (e) {
6146
6261
  const t = e[1], i = parseInt(e[2], 10);
@@ -6157,7 +6272,7 @@ function wt(n) {
6157
6272
  return null;
6158
6273
  }
6159
6274
  }
6160
- class ks {
6275
+ class Cs {
6161
6276
  constructor(e) {
6162
6277
  this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
6163
6278
  }
@@ -6201,7 +6316,7 @@ class ks {
6201
6316
  if (!this.container) return;
6202
6317
  const i = (a = this.client.state.user) == null ? void 0 : a.id;
6203
6318
  if (e === i || (this.clearSelection(e), !t)) return;
6204
- const s = $s(t);
6319
+ const s = Es(t);
6205
6320
  if (!s) return;
6206
6321
  const o = this.client.state.presence.find(
6207
6322
  (l) => l.user.id === e
@@ -6209,8 +6324,8 @@ class ks {
6209
6324
  try {
6210
6325
  const l = s.getClientRects(), d = [];
6211
6326
  for (let c = 0; c < l.length; c++) {
6212
- const h = l[c], p = document.createElement("div");
6213
- Object.assign(p.style, {
6327
+ const h = l[c], u = document.createElement("div");
6328
+ Object.assign(u.style, {
6214
6329
  position: "absolute",
6215
6330
  left: `${h.left}px`,
6216
6331
  top: `${h.top}px`,
@@ -6220,7 +6335,7 @@ class ks {
6220
6335
  opacity: "0.2",
6221
6336
  borderRadius: "2px",
6222
6337
  pointerEvents: "none"
6223
- }), this.container.appendChild(p), d.push(p);
6338
+ }), this.container.appendChild(u), d.push(u);
6224
6339
  }
6225
6340
  this.selectionEls.set(e, d);
6226
6341
  } catch {
@@ -6240,12 +6355,12 @@ class ks {
6240
6355
  }
6241
6356
  }
6242
6357
  }
6243
- var Es = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, Ke = (n, e, t, i) => {
6244
- for (var s = i > 1 ? void 0 : i ? Cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6358
+ var Ts = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, Ge = (n, e, t, i) => {
6359
+ for (var s = i > 1 ? void 0 : i ? Ss(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6245
6360
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6246
- return i && s && Es(e, t, s), s;
6361
+ return i && s && Ts(e, t, s), s;
6247
6362
  };
6248
- let ue = class extends P {
6363
+ let ue = class extends _ {
6249
6364
  constructor() {
6250
6365
  super(...arguments), this.roomId = "";
6251
6366
  }
@@ -6265,7 +6380,7 @@ let ue = class extends P {
6265
6380
  );
6266
6381
  }
6267
6382
  renderToggle(n, e) {
6268
- return u`
6383
+ return p`
6269
6384
  <div class="setting-row">
6270
6385
  <span class="setting-label">${n}</span>
6271
6386
  <label class="toggle">
@@ -6281,12 +6396,12 @@ let ue = class extends P {
6281
6396
  }
6282
6397
  render() {
6283
6398
  const n = !this.settings.enabled;
6284
- return u`
6399
+ return p`
6285
6400
  <div class="panel">
6286
6401
  <div class="panel-header">
6287
6402
  <span class="panel-title">Settings</span>
6288
6403
  <button class="close-btn" @click=${this.fireClose} title="Close">
6289
- ${T(ve, 16)}
6404
+ ${S(ve, 16)}
6290
6405
  </button>
6291
6406
  </div>
6292
6407
 
@@ -6506,13 +6621,13 @@ ue.styles = [
6506
6621
  }
6507
6622
  `
6508
6623
  ];
6509
- Ke([
6510
- x({ attribute: !1 })
6624
+ Ge([
6625
+ w({ attribute: !1 })
6511
6626
  ], ue.prototype, "settings", 2);
6512
- Ke([
6513
- x()
6627
+ Ge([
6628
+ w()
6514
6629
  ], ue.prototype, "roomId", 2);
6515
- ue = Ke([
6630
+ ue = Ge([
6516
6631
  L("pulse-widget-settings-panel")
6517
6632
  ], ue);
6518
6633
  const $e = {
@@ -6526,26 +6641,26 @@ const $e = {
6526
6641
  showViewportIndicators: !0,
6527
6642
  showSelections: !0,
6528
6643
  showDrawings: !0
6529
- }, Ot = "pulse:settings:";
6530
- function Ts(n) {
6644
+ }, Rt = "pulse:settings:";
6645
+ function As(n) {
6531
6646
  try {
6532
- const e = localStorage.getItem(`${Ot}${n}`);
6647
+ const e = localStorage.getItem(`${Rt}${n}`);
6533
6648
  return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
6534
6649
  } catch {
6535
6650
  return { ...$e };
6536
6651
  }
6537
6652
  }
6538
- function Ss(n, e) {
6539
- localStorage.setItem(`${Ot}${n}`, JSON.stringify(e));
6653
+ function Ps(n, e) {
6654
+ localStorage.setItem(`${Rt}${n}`, JSON.stringify(e));
6540
6655
  }
6541
- var As = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6542
- for (var s = i > 1 ? void 0 : i ? Ps(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6656
+ var _s = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6657
+ for (var s = i > 1 ? void 0 : i ? Is(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6543
6658
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6544
- return i && s && As(e, t, s), s;
6659
+ return i && s && _s(e, t, s), s;
6545
6660
  };
6546
- let M = class extends P {
6661
+ let M = class extends _ {
6547
6662
  constructor() {
6548
- super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.envConfig = { ...It }, this.users = [], this.unreadCount = 0;
6663
+ super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.envConfig = { ...Mt }, this.users = [], this.unreadCount = 0;
6549
6664
  }
6550
6665
  connectedCallback() {
6551
6666
  super.connectedCallback(), this.setupPresence();
@@ -6596,35 +6711,35 @@ let M = class extends P {
6596
6711
  render() {
6597
6712
  const n = this.display === "inline";
6598
6713
  if (this.collapsed)
6599
- return u`
6714
+ return p`
6600
6715
  <div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
6601
- <span class="fab-icon">${T(Fi, n ? 18 : 24)}</span>
6716
+ <span class="fab-icon">${S(qi, n ? 18 : 24)}</span>
6602
6717
  </div>
6603
6718
  `;
6604
6719
  const e = this.users.slice(0, 3), t = this.users.length - 3;
6605
- return u`
6720
+ return p`
6606
6721
  <div class="toolbar ${n ? "inline" : ""}"
6607
6722
  <!-- Presence avatars -->
6608
- ${this.users.length > 0 && this.envConfig.showPresence ? u`
6723
+ ${this.users.length > 0 && this.envConfig.showPresence ? p`
6609
6724
  <div class="presence">
6610
- ${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : v}
6725
+ ${t > 0 ? p`<div class="presence-overflow">+${t}</div>` : g}
6611
6726
  ${e.map(
6612
- (i) => u`
6727
+ (i) => p`
6613
6728
  <div
6614
6729
  class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
6615
6730
  style="background:${i.user.color}"
6616
6731
  @click=${() => this.fireFollow(i.user.id)}
6617
6732
  title="Click to follow ${i.user.name}"
6618
6733
  >
6619
- ${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6734
+ ${i.user.avatar ? p`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6620
6735
  <span class="presence-tooltip">${i.user.name}</span>
6621
- ${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : v}
6736
+ ${i.deviceType && i.deviceType !== "desktop" ? p`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : g}
6622
6737
  </div>
6623
6738
  `
6624
6739
  )}
6625
6740
  </div>
6626
6741
  <div class="separator"></div>
6627
- ` : v}
6742
+ ` : g}
6628
6743
 
6629
6744
  <!-- Pin comment (primary) -->
6630
6745
  <button
@@ -6634,7 +6749,7 @@ let M = class extends P {
6634
6749
  ?disabled=${this.featuresDisabled}
6635
6750
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6636
6751
  >
6637
- ${T(Mt)}
6752
+ ${S(Ot)}
6638
6753
  </button>
6639
6754
 
6640
6755
  <!-- View comments -->
@@ -6645,7 +6760,7 @@ let M = class extends P {
6645
6760
  ?disabled=${this.featuresDisabled}
6646
6761
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6647
6762
  >
6648
- ${T(Li)}
6763
+ ${S(ji)}
6649
6764
  </button>
6650
6765
 
6651
6766
  <!-- Activity feed -->
@@ -6656,11 +6771,11 @@ let M = class extends P {
6656
6771
  ?disabled=${this.featuresDisabled}
6657
6772
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6658
6773
  >
6659
- ${T(Ri)}
6774
+ ${S(Li)}
6660
6775
  </button>
6661
6776
 
6662
6777
  <!-- Draw mode -->
6663
- ${this.envConfig.allowDrawing ? u`
6778
+ ${this.envConfig.allowDrawing ? p`
6664
6779
  <button
6665
6780
  class="pw-btn pw-btn-icon ${this.drawModeActive ? "active" : ""}"
6666
6781
  @click=${() => this.fire("draw-mode")}
@@ -6668,9 +6783,9 @@ let M = class extends P {
6668
6783
  ?disabled=${this.featuresDisabled}
6669
6784
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6670
6785
  >
6671
- ${T(Ui)}
6786
+ ${S(Di)}
6672
6787
  </button>
6673
- ` : v}
6788
+ ` : g}
6674
6789
 
6675
6790
  <!-- Notifications -->
6676
6791
  <button
@@ -6680,8 +6795,8 @@ let M = class extends P {
6680
6795
  ?disabled=${this.featuresDisabled}
6681
6796
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
6682
6797
  >
6683
- ${T(Oi)}
6684
- ${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : v}
6798
+ ${S(Ri)}
6799
+ ${this.unreadCount > 0 ? p`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : g}
6685
6800
  </button>
6686
6801
 
6687
6802
  <!-- Settings -->
@@ -6690,7 +6805,7 @@ let M = class extends P {
6690
6805
  @click=${() => this.fire("settings")}
6691
6806
  title="Settings"
6692
6807
  >
6693
- ${T(Hi)}
6808
+ ${S(Bi)}
6694
6809
  </button>
6695
6810
 
6696
6811
  <div class="separator"></div>
@@ -6701,7 +6816,7 @@ let M = class extends P {
6701
6816
  @click=${this.fireToggle}
6702
6817
  title="Collapse"
6703
6818
  >
6704
- ${T(ve, 14)}
6819
+ ${S(ve, 14)}
6705
6820
  </button>
6706
6821
  </div>
6707
6822
  `;
@@ -6923,42 +7038,42 @@ M.styles = [
6923
7038
  `
6924
7039
  ];
6925
7040
  j([
6926
- x({ attribute: !1 })
7041
+ w({ attribute: !1 })
6927
7042
  ], M.prototype, "client", 2);
6928
7043
  j([
6929
- x({ type: Boolean })
7044
+ w({ type: Boolean })
6930
7045
  ], M.prototype, "collapsed", 2);
6931
7046
  j([
6932
- x()
7047
+ w()
6933
7048
  ], M.prototype, "activePanel", 2);
6934
7049
  j([
6935
- x({ type: Boolean })
7050
+ w({ type: Boolean })
6936
7051
  ], M.prototype, "pinModeActive", 2);
6937
7052
  j([
6938
- x({ type: Boolean })
7053
+ w({ type: Boolean })
6939
7054
  ], M.prototype, "featuresDisabled", 2);
6940
7055
  j([
6941
- x({ type: Boolean })
7056
+ w({ type: Boolean })
6942
7057
  ], M.prototype, "drawModeActive", 2);
6943
7058
  j([
6944
- x()
7059
+ w()
6945
7060
  ], M.prototype, "followingUserId", 2);
6946
7061
  j([
6947
- x()
7062
+ w()
6948
7063
  ], M.prototype, "display", 2);
6949
7064
  j([
6950
- x({ attribute: !1 })
7065
+ w({ attribute: !1 })
6951
7066
  ], M.prototype, "envConfig", 2);
6952
7067
  j([
6953
- $()
7068
+ k()
6954
7069
  ], M.prototype, "users", 2);
6955
7070
  j([
6956
- $()
7071
+ k()
6957
7072
  ], M.prototype, "unreadCount", 2);
6958
7073
  M = j([
6959
7074
  L("pulse-widget-toolbar")
6960
7075
  ], M);
6961
- class _s {
7076
+ class Ms {
6962
7077
  constructor(e) {
6963
7078
  this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
6964
7079
  }
@@ -6999,23 +7114,23 @@ class _s {
6999
7114
  const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, s = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
7000
7115
  for (const [a, l] of this.client.state.viewports) {
7001
7116
  if (a === s) continue;
7002
- const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, p = e + t;
7003
- if (d >= h && c <= p) {
7004
- const E = this.pillEls.get(a);
7005
- E && (E.style.display = "none");
7117
+ const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, u = e + t;
7118
+ if (d >= h && c <= u) {
7119
+ const $ = this.pillEls.get(a);
7120
+ $ && ($.style.display = "none");
7006
7121
  continue;
7007
7122
  }
7008
7123
  o.add(a);
7009
- const m = this.client.state.presence.find(
7010
- (E) => E.user.id === a
7124
+ const f = this.client.state.presence.find(
7125
+ ($) => $.user.id === a
7011
7126
  );
7012
- if (!m) continue;
7013
- const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, b = Math.max(
7127
+ if (!f) continue;
7128
+ const b = l.scrollY + l.viewportHeight / 2, x = i > 0 ? b / i : 0, y = Math.max(
7014
7129
  8,
7015
- Math.min(t - 28, y * t)
7130
+ Math.min(t - 28, x * t)
7016
7131
  );
7017
- let w = this.pillEls.get(a);
7018
- w || (w = document.createElement("div"), Object.assign(w.style, {
7132
+ let v = this.pillEls.get(a);
7133
+ v || (v = document.createElement("div"), Object.assign(v.style, {
7019
7134
  position: "absolute",
7020
7135
  right: "8px",
7021
7136
  padding: "2px 6px",
@@ -7027,7 +7142,7 @@ class _s {
7027
7142
  whiteSpace: "nowrap",
7028
7143
  pointerEvents: "none",
7029
7144
  transition: "top 0.3s ease"
7030
- }), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${b}px`, w.textContent = this.getInitials(m.user.name);
7145
+ }), this.container.appendChild(v), this.pillEls.set(a, v)), v.style.display = "", v.style.background = f.user.color, v.style.top = `${y}px`, v.textContent = this.getInitials(f.user.name);
7031
7146
  }
7032
7147
  for (const [a, l] of this.pillEls)
7033
7148
  !o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
@@ -7036,14 +7151,14 @@ class _s {
7036
7151
  return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
7037
7152
  }
7038
7153
  }
7039
- var Is = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, A = (n, e, t, i) => {
7040
- for (var s = i > 1 ? void 0 : i ? Ms(e, t) : e, o = n.length - 1, r; o >= 0; o--)
7154
+ var Os = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, P = (n, e, t, i) => {
7155
+ for (var s = i > 1 ? void 0 : i ? Rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
7041
7156
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
7042
- return i && s && Is(e, t, s), s;
7157
+ return i && s && Os(e, t, s), s;
7043
7158
  };
7044
- let C = class extends P {
7159
+ let C = class extends _ {
7045
7160
  constructor() {
7046
- super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.envConfig = { ...It }, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
7161
+ super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.envConfig = { ...Mt }, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
7047
7162
  !this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
7048
7163
  var n;
7049
7164
  this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
@@ -7064,7 +7179,7 @@ let C = class extends P {
7064
7179
  (t = this.client) == null || t.updateSelection(null);
7065
7180
  return;
7066
7181
  }
7067
- const e = ws(n);
7182
+ const e = ks(n);
7068
7183
  (i = this.client) == null || i.updateSelection(e);
7069
7184
  }, 500));
7070
7185
  }, this.handleDocumentClick = (n) => {
@@ -7096,11 +7211,11 @@ let C = class extends P {
7096
7211
  room: this.room,
7097
7212
  endpoint: this.endpoint
7098
7213
  };
7099
- this.client = new Et(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new xs(this.client), this.commentPins = new ds(this.client, {
7214
+ this.client = new Ct(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new ws(this.client), this.commentPins = new ps(this.client, {
7100
7215
  onPinModeExit: () => {
7101
7216
  this.pinModeActive = !1;
7102
7217
  }
7103
- }), this.viewportOverlay = new _s(this.client), this.selectionOverlay = new ks(this.client), this.drawingOverlay = new ys(this.client), this.settings = Ts(this.room), this.applySettings(this.settings), this.unsubs.push(
7218
+ }), this.viewportOverlay = new Ms(this.client), this.selectionOverlay = new Cs(this.client), this.drawingOverlay = new $s(this.client), this.settings = As(this.room), this.applySettings(this.settings), this.unsubs.push(
7104
7219
  this.client.state.on("auth", () => {
7105
7220
  var e, t;
7106
7221
  this.envConfig = this.client.state.config, this.envConfig.showCursors || (e = this.cursorOverlay) == null || e.disable(), !this.envConfig.allowDrawing && this.drawModeActive && ((t = this.drawingOverlay) == null || t.disableDrawMode(), this.drawModeActive = !1);
@@ -7174,15 +7289,15 @@ let C = class extends P {
7174
7289
  }
7175
7290
  handleSettingsChange(n) {
7176
7291
  const e = n.detail;
7177
- this.settings = e, Ss(this.room, e), this.applySettings(e);
7292
+ this.settings = e, Ps(this.room, e), this.applySettings(e);
7178
7293
  }
7179
7294
  applySettings(n) {
7180
- var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, b, w;
7295
+ var e, t, i, s, o, r, a, l, d, c, h, u, f, b, x, y, v;
7181
7296
  if (!n.enabled) {
7182
7297
  (e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
7183
7298
  return;
7184
7299
  }
7185
- this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((b = this.drawingOverlay) == null || b.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
7300
+ this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (u = this.viewportOverlay) == null || u.disable(), n.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (b = this.selectionOverlay) == null || b.disable(), n.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((y = this.drawingOverlay) == null || y.disable(), this.drawModeActive && ((v = this.drawingOverlay) == null || v.disableDrawMode(), this.drawModeActive = !1));
7186
7301
  }
7187
7302
  applyCursorSettings(n) {
7188
7303
  if (!this.cursorOverlay) return;
@@ -7196,22 +7311,22 @@ let C = class extends P {
7196
7311
  * the trigger element, flipping vertically/horizontally as needed.
7197
7312
  */
7198
7313
  positionPopups() {
7199
- var g, y, b, w;
7200
- const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7314
+ var b, x, y, v;
7315
+ const n = this.display === "inline", e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".inline-trigger"), t = (x = this.shadowRoot) == null ? void 0 : x.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7201
7316
  if (!i) return;
7202
- const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".toolbar-popover");
7317
+ const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (y = this.shadowRoot) == null ? void 0 : y.querySelector(".toolbar-popover");
7203
7318
  if (l) {
7204
7319
  Object.assign(l.style, { top: "auto", left: "auto" });
7205
- const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
7206
- l.style.top = `${I.top}px`, l.style.left = `${I.left}px`;
7320
+ const $ = l.getBoundingClientRect(), T = this.computePosition(s, $, o, r, a);
7321
+ l.style.top = `${T.top}px`, l.style.left = `${T.left}px`;
7207
7322
  }
7208
- const d = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
7323
+ const d = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".panel-container");
7209
7324
  if (!d) return;
7210
7325
  Object.assign(d.style, { top: "auto", left: "auto" });
7211
7326
  const c = l ?? t;
7212
7327
  if (!c) return;
7213
- const h = c.getBoundingClientRect(), p = d.getBoundingClientRect(), m = this.computePosition(h, p, o, r, a);
7214
- d.style.top = `${m.top}px`, d.style.left = `${m.left}px`;
7328
+ const h = c.getBoundingClientRect(), u = d.getBoundingClientRect(), f = this.computePosition(h, u, o, r, a);
7329
+ d.style.top = `${f.top}px`, d.style.left = `${f.left}px`;
7215
7330
  }
7216
7331
  computePosition(n, e, t, i, s) {
7217
7332
  const o = n.top, r = i - n.bottom;
@@ -7230,13 +7345,13 @@ let C = class extends P {
7230
7345
  return (n == null ? void 0 : n.user.name) ?? "user";
7231
7346
  }
7232
7347
  renderConnectionBanner() {
7233
- return this.showConnectedFlash ? u`<div class="connection-banner connected">
7348
+ return this.showConnectedFlash ? p`<div class="connection-banner connected">
7234
7349
  <span class="connection-dot"></span>Connected
7235
- </div>` : this.connectionState === "connecting" ? u`<div class="connection-banner connecting">
7350
+ </div>` : this.connectionState === "connecting" ? p`<div class="connection-banner connecting">
7236
7351
  <span class="connection-dot"></span>Reconnecting...
7237
- </div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
7352
+ </div>` : this.connectionState === "disconnected" && this.client ? p`<div class="connection-banner disconnected">
7238
7353
  <span class="connection-dot"></span>Disconnected
7239
- </div>` : v;
7354
+ </div>` : g;
7240
7355
  }
7241
7356
  handleToolbarToggle() {
7242
7357
  this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
@@ -7244,38 +7359,38 @@ let C = class extends P {
7244
7359
  render() {
7245
7360
  const n = this.display === "inline";
7246
7361
  if (n && this.collapsed)
7247
- return u`
7362
+ return p`
7248
7363
  <div class="widget-root">
7249
7364
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
7250
7365
  <slot>Collaborate</slot>
7251
7366
  </div>
7252
7367
  </div>
7253
7368
  `;
7254
- const e = this.activePanel ? u`
7369
+ const e = this.activePanel ? p`
7255
7370
  <div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
7256
- ${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
7371
+ ${this.activePanel === "comments" ? p`<pulse-widget-comments-panel
7257
7372
  .client=${this.client}
7258
7373
  .highlightThreadId=${this.highlightThreadId}
7259
- ></pulse-widget-comments-panel>` : v}
7260
- ${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
7374
+ ></pulse-widget-comments-panel>` : g}
7375
+ ${this.activePanel === "settings" ? p`<pulse-widget-settings-panel
7261
7376
  .settings=${this.settings}
7262
7377
  .roomId=${this.room}
7263
7378
  @settings-change=${this.handleSettingsChange}
7264
- ></pulse-widget-settings-panel>` : v}
7265
- ${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
7379
+ ></pulse-widget-settings-panel>` : g}
7380
+ ${this.activePanel === "notifications" ? p`<pulse-widget-notifications-panel
7266
7381
  .client=${this.client}
7267
- ></pulse-widget-notifications-panel>` : v}
7268
- ${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
7382
+ ></pulse-widget-notifications-panel>` : g}
7383
+ ${this.activePanel === "activity" ? p`<pulse-widget-activity-panel
7269
7384
  .client=${this.client}
7270
- ></pulse-widget-activity-panel>` : v}
7385
+ ></pulse-widget-activity-panel>` : g}
7271
7386
  </div>
7272
- ` : v, t = this.followingUserId ? u`<div class="follow-banner">
7387
+ ` : g, t = this.followingUserId ? p`<div class="follow-banner">
7273
7388
  Following ${this.getFollowUserName()}
7274
7389
  <button @click=${() => {
7275
7390
  this.followingUserId = null;
7276
7391
  }}>Stop</button>
7277
- </div>` : v;
7278
- return n ? u`
7392
+ </div>` : g;
7393
+ return n ? p`
7279
7394
  ${t}
7280
7395
  <div class="widget-root">
7281
7396
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
@@ -7300,7 +7415,7 @@ let C = class extends P {
7300
7415
  </div>
7301
7416
  ${e}
7302
7417
  </div>
7303
- ` : u`
7418
+ ` : p`
7304
7419
  ${t}
7305
7420
  <div class="widget-root">
7306
7421
  ${e}
@@ -7501,55 +7616,55 @@ C.styles = [
7501
7616
  }
7502
7617
  `
7503
7618
  ];
7504
- A([
7505
- x({ attribute: "api-key" })
7619
+ P([
7620
+ w({ attribute: "api-key" })
7506
7621
  ], C.prototype, "apiKey", 2);
7507
- A([
7508
- x()
7622
+ P([
7623
+ w()
7509
7624
  ], C.prototype, "token", 2);
7510
- A([
7511
- x()
7625
+ P([
7626
+ w()
7512
7627
  ], C.prototype, "room", 2);
7513
- A([
7514
- x()
7628
+ P([
7629
+ w()
7515
7630
  ], C.prototype, "endpoint", 2);
7516
- A([
7517
- x({ reflect: !0 })
7631
+ P([
7632
+ w({ reflect: !0 })
7518
7633
  ], C.prototype, "position", 2);
7519
- A([
7520
- x({ reflect: !0 })
7634
+ P([
7635
+ w({ reflect: !0 })
7521
7636
  ], C.prototype, "display", 2);
7522
- A([
7523
- $()
7637
+ P([
7638
+ k()
7524
7639
  ], C.prototype, "collapsed", 2);
7525
- A([
7526
- $()
7640
+ P([
7641
+ k()
7527
7642
  ], C.prototype, "activePanel", 2);
7528
- A([
7529
- $()
7643
+ P([
7644
+ k()
7530
7645
  ], C.prototype, "pinModeActive", 2);
7531
- A([
7532
- $()
7646
+ P([
7647
+ k()
7533
7648
  ], C.prototype, "highlightThreadId", 2);
7534
- A([
7535
- $()
7649
+ P([
7650
+ k()
7536
7651
  ], C.prototype, "settings", 2);
7537
- A([
7538
- $()
7652
+ P([
7653
+ k()
7539
7654
  ], C.prototype, "followingUserId", 2);
7540
- A([
7541
- $()
7655
+ P([
7656
+ k()
7542
7657
  ], C.prototype, "drawModeActive", 2);
7543
- A([
7544
- $()
7658
+ P([
7659
+ k()
7545
7660
  ], C.prototype, "connectionState", 2);
7546
- A([
7547
- $()
7661
+ P([
7662
+ k()
7548
7663
  ], C.prototype, "showConnectedFlash", 2);
7549
- A([
7550
- $()
7664
+ P([
7665
+ k()
7551
7666
  ], C.prototype, "envConfig", 2);
7552
- C = A([
7667
+ C = P([
7553
7668
  L("pulse-widget")
7554
7669
  ], C);
7555
7670
  export {
@@ -7558,6 +7673,6 @@ export {
7558
7673
  he as PulseNotifications,
7559
7674
  Z as PulsePresence,
7560
7675
  X as PulseProvider,
7561
- N as PulseReactions,
7676
+ B as PulseReactions,
7562
7677
  C as PulseWidget
7563
7678
  };