@gamention/pulse-elements 0.1.15 → 0.1.17

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 yt = class extends Event {
6
+ let wt = 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 yt = class extends Event {
18
18
  * Copyright 2021 Google LLC
19
19
  * SPDX-License-Identifier: BSD-3-Clause
20
20
  */
21
- let Ye = class {
21
+ let Ke = 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 Ye = class {
35
35
  this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
36
36
  }
37
37
  dispatchRequest() {
38
- this.host.dispatchEvent(new yt(this.context, this.host, this.t, this.subscribe));
38
+ this.host.dispatchEvent(new wt(this.context, this.host, this.t, this.subscribe));
39
39
  }
40
40
  };
41
41
  /**
@@ -43,7 +43,7 @@ let Ye = class {
43
43
  * Copyright 2021 Google LLC
44
44
  * SPDX-License-Identifier: BSD-3-Clause
45
45
  */
46
- let It = class {
46
+ let Ot = class {
47
47
  get value() {
48
48
  return this.o;
49
49
  }
@@ -76,21 +76,21 @@ let It = class {
76
76
  * Copyright 2021 Google LLC
77
77
  * SPDX-License-Identifier: BSD-3-Clause
78
78
  */
79
- let Mt = class extends Event {
79
+ let Rt = 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
- }, Ke = class extends It {
83
+ }, Ge = class extends Ot {
84
84
  constructor(e, t, i) {
85
85
  var s, o;
86
86
  super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
87
87
  if (r.context !== this.context) return;
88
- const l = r.contextTarget ?? r.composedPath()[0];
89
- l !== this.host && (r.stopPropagation(), this.addCallback(r.callback, l, r.subscribe));
88
+ const a = r.contextTarget ?? r.composedPath()[0];
89
+ a !== this.host && (r.stopPropagation(), this.addCallback(r.callback, a, r.subscribe));
90
90
  }, this.onProviderRequest = (r) => {
91
91
  if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
92
- const l = /* @__PURE__ */ new Set();
93
- for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new yt(this.context, c, a, !0)));
92
+ const a = /* @__PURE__ */ new Set();
93
+ for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new wt(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
  }
@@ -98,7 +98,7 @@ let Mt = class extends Event {
98
98
  this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
99
99
  }
100
100
  hostConnected() {
101
- this.host.dispatchEvent(new Mt(this.context, this.host));
101
+ this.host.dispatchEvent(new Rt(this.context, this.host));
102
102
  }
103
103
  };
104
104
  /**
@@ -106,7 +106,7 @@ let Mt = class extends Event {
106
106
  * Copyright 2017 Google LLC
107
107
  * SPDX-License-Identifier: BSD-3-Clause
108
108
  */
109
- function Ot({ context: n }) {
109
+ function Lt({ 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 Ot({ 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 Ke(this, { context: n, initialValue: s })), s;
117
+ return i.set(this, new Ge(this, { context: n, initialValue: s })), s;
118
118
  } };
119
119
  {
120
120
  e.constructor.addInitializer(((r) => {
121
- i.set(r, new Ke(r, { context: n }));
121
+ i.set(r, new Ge(r, { context: n }));
122
122
  }));
123
123
  const s = Object.getOwnPropertyDescriptor(e, t);
124
124
  let o;
@@ -126,13 +126,13 @@ function Ot({ context: n }) {
126
126
  const r = /* @__PURE__ */ new WeakMap();
127
127
  o = { get() {
128
128
  return r.get(this);
129
- }, set(l) {
130
- i.get(this).setValue(l), r.set(this, l);
129
+ }, set(a) {
130
+ i.get(this).setValue(a), r.set(this, a);
131
131
  }, configurable: !0, enumerable: !0 };
132
132
  } else {
133
133
  const r = s.set;
134
- o = { ...s, set(l) {
135
- i.get(this).setValue(l), r == null || r.call(this, l);
134
+ o = { ...s, set(a) {
135
+ i.get(this).setValue(a), r == null || r.call(this, a);
136
136
  } };
137
137
  }
138
138
  return void Object.defineProperty(e, t, o);
@@ -144,24 +144,24 @@ function Ot({ context: n }) {
144
144
  * Copyright 2022 Google LLC
145
145
  * SPDX-License-Identifier: BSD-3-Clause
146
146
  */
147
- function ue({ context: n, subscribe: e }) {
147
+ function fe({ context: n, subscribe: e }) {
148
148
  return (t, i) => {
149
149
  typeof i == "object" ? i.addInitializer((function() {
150
- new Ye(this, { context: n, callback: (s) => {
150
+ new Ke(this, { context: n, callback: (s) => {
151
151
  t.set.call(this, s);
152
152
  }, subscribe: e });
153
153
  })) : t.constructor.addInitializer(((s) => {
154
- new Ye(s, { context: n, callback: (o) => {
154
+ new Ke(s, { context: n, callback: (o) => {
155
155
  s[i] = o;
156
156
  }, subscribe: e });
157
157
  }));
158
158
  };
159
159
  }
160
- var Rt = Object.defineProperty, Lt = (n, e, t) => e in n ? Rt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, $ = (n, e, t) => Lt(n, typeof e != "symbol" ? e + "" : e, t);
161
- const jt = "ws://localhost:4567";
162
- let Ue = class {
160
+ var jt = Object.defineProperty, zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, k = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
161
+ const Ut = "ws://localhost:4567";
162
+ let De = class {
163
163
  constructor() {
164
- $(this, "handlers", /* @__PURE__ */ new Map());
164
+ k(this, "handlers", /* @__PURE__ */ new Map());
165
165
  }
166
166
  on(e, t) {
167
167
  this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
@@ -179,9 +179,9 @@ let Ue = class {
179
179
  removeAll() {
180
180
  this.handlers.clear();
181
181
  }
182
- }, zt = class extends Ue {
182
+ }, Dt = class extends De {
183
183
  constructor(e) {
184
- super(), $(this, "ws", null), $(this, "endpoint"), $(this, "reconnectAttempt", 0), $(this, "reconnectTimer", null), $(this, "_state", "disconnected"), this.endpoint = e ?? jt;
184
+ super(), k(this, "ws", null), k(this, "endpoint"), k(this, "reconnectAttempt", 0), k(this, "reconnectTimer", null), k(this, "_state", "disconnected"), this.endpoint = e ?? Ut;
185
185
  }
186
186
  get state() {
187
187
  return this._state;
@@ -216,9 +216,9 @@ let Ue = class {
216
216
  this.reconnectTimer = null, this.connect();
217
217
  }, e);
218
218
  }
219
- }, Ut = class extends Ue {
219
+ }, Ht = class extends De {
220
220
  constructor() {
221
- super(...arguments), $(this, "baseUrl", ""), $(this, "_user", null), $(this, "_users", /* @__PURE__ */ new Map()), $(this, "_presence", /* @__PURE__ */ new Map()), $(this, "_threads", /* @__PURE__ */ new Map()), $(this, "_reactions", /* @__PURE__ */ new Map()), $(this, "_notifications", []), $(this, "_activityLogs", []), $(this, "_typing", /* @__PURE__ */ new Map()), $(this, "_viewports", /* @__PURE__ */ new Map()), $(this, "_selections", /* @__PURE__ */ new Map());
221
+ super(...arguments), k(this, "baseUrl", ""), k(this, "_user", null), 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());
222
222
  }
223
223
  get user() {
224
224
  return this._user;
@@ -245,6 +245,18 @@ let Ue = class {
245
245
  get unreadCount() {
246
246
  return this._notifications.filter((e) => !e.read).length;
247
247
  }
248
+ /** Optimistically mark a single notification as read. */
249
+ markNotificationRead(e) {
250
+ const t = this._notifications.find((i) => i.id === e);
251
+ t && !t.read && (t.read = !0, this.emit("notifications", this._notifications));
252
+ }
253
+ /** Optimistically mark all notifications as read. */
254
+ markAllNotificationsRead() {
255
+ let e = !1;
256
+ for (const t of this._notifications)
257
+ t.read || (t.read = !0, e = !0);
258
+ e && this.emit("notifications", this._notifications);
259
+ }
248
260
  get activityLogs() {
249
261
  return this._activityLogs;
250
262
  }
@@ -426,12 +438,12 @@ let Ue = class {
426
438
  reset() {
427
439
  this._user = null, 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();
428
440
  }
429
- }, wt = class extends Ue {
441
+ }, $t = class extends De {
430
442
  constructor(e) {
431
443
  var t;
432
- super(), $(this, "state"), $(this, "connection"), $(this, "config"), $(this, "heartbeatTimer", null), $(this, "lastCursorSend", 0), $(this, "pendingCursor", null), $(this, "cursorTimer", null), this.config = e, this.state = new Ut(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
444
+ 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 Ht(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
433
445
  const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
434
- this.connection = new zt(i), this.connection.on("message", (s) => {
446
+ this.connection = new Dt(i), this.connection.on("message", (s) => {
435
447
  this.state.handleMessage(s), this.emit(s.type, s);
436
448
  }), this.connection.on("state", (s) => {
437
449
  this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
@@ -514,10 +526,10 @@ let Ue = class {
514
526
  }
515
527
  // ── Notifications ──
516
528
  markRead(e) {
517
- this.send({ type: "notification:read", notificationId: e });
529
+ this.state.markNotificationRead(e), this.send({ type: "notification:read", notificationId: e });
518
530
  }
519
531
  markAllRead() {
520
- this.send({ type: "notification:read-all" });
532
+ this.state.markAllNotificationsRead(), this.send({ type: "notification:read-all" });
521
533
  }
522
534
  // ── Clicks ──
523
535
  performClick(e) {
@@ -575,18 +587,18 @@ let Ue = class {
575
587
  * Copyright 2019 Google LLC
576
588
  * SPDX-License-Identifier: BSD-3-Clause
577
589
  */
578
- const xe = globalThis, De = xe.ShadowRoot && (xe.ShadyCSS === void 0 || xe.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, He = Symbol(), Ge = /* @__PURE__ */ new WeakMap();
579
- let $t = class {
590
+ const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ne = Symbol(), Je = /* @__PURE__ */ new WeakMap();
591
+ let kt = class {
580
592
  constructor(e, t, i) {
581
- if (this._$cssResult$ = !0, i !== He) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
593
+ if (this._$cssResult$ = !0, i !== Ne) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
582
594
  this.cssText = e, this.t = t;
583
595
  }
584
596
  get styleSheet() {
585
597
  let e = this.o;
586
598
  const t = this.t;
587
- if (De && e === void 0) {
599
+ if (He && e === void 0) {
588
600
  const i = t !== void 0 && t.length === 1;
589
- i && (e = Ge.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Ge.set(t, e));
601
+ i && (e = Je.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Je.set(t, e));
590
602
  }
591
603
  return e;
592
604
  }
@@ -594,33 +606,33 @@ let $t = class {
594
606
  return this.cssText;
595
607
  }
596
608
  };
597
- const Dt = (n) => new $t(typeof n == "string" ? n : n + "", void 0, He), O = (n, ...e) => {
609
+ const Nt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Ne), M = (n, ...e) => {
598
610
  const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
599
611
  if (r._$cssResult$ === !0) return r.cssText;
600
612
  if (typeof r == "number") return r;
601
613
  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.");
602
614
  })(s) + n[o + 1], n[0]);
603
- return new $t(t, n, He);
604
- }, Ht = (n, e) => {
605
- if (De) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
615
+ return new kt(t, n, Ne);
616
+ }, Bt = (n, e) => {
617
+ if (He) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
606
618
  else for (const t of e) {
607
- const i = document.createElement("style"), s = xe.litNonce;
619
+ const i = document.createElement("style"), s = ye.litNonce;
608
620
  s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
609
621
  }
610
- }, Ze = De ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
622
+ }, Ze = He ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
611
623
  let t = "";
612
624
  for (const i of e.cssRules) t += i.cssText;
613
- return Dt(t);
625
+ return Nt(t);
614
626
  })(n) : n;
615
627
  /**
616
628
  * @license
617
629
  * Copyright 2017 Google LLC
618
630
  * SPDX-License-Identifier: BSD-3-Clause
619
631
  */
620
- const { is: Nt, defineProperty: Ft, getOwnPropertyDescriptor: Bt, getOwnPropertyNames: qt, getOwnPropertySymbols: Vt, getPrototypeOf: Wt } = Object, D = globalThis, Je = D.trustedTypes, Xt = Je ? Je.emptyScript : "", Pe = D.reactiveElementPolyfillSupport, se = (n, e) => n, $e = { toAttribute(n, e) {
632
+ const { is: Ft, defineProperty: qt, getOwnPropertyDescriptor: Vt, getOwnPropertyNames: Wt, getOwnPropertySymbols: Xt, getPrototypeOf: Yt } = Object, H = globalThis, Qe = H.trustedTypes, Kt = Qe ? Qe.emptyScript : "", _e = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
621
633
  switch (e) {
622
634
  case Boolean:
623
- n = n ? Xt : null;
635
+ n = n ? Kt : null;
624
636
  break;
625
637
  case Object:
626
638
  case Array:
@@ -645,44 +657,44 @@ const { is: Nt, defineProperty: Ft, getOwnPropertyDescriptor: Bt, getOwnProperty
645
657
  }
646
658
  }
647
659
  return t;
648
- } }, Ne = (n, e) => !Nt(n, e), Qe = { attribute: !0, type: String, converter: $e, reflect: !1, useDefault: !1, hasChanged: Ne };
649
- Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), D.litPropertyMetadata ?? (D.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
650
- let K = class extends HTMLElement {
660
+ } }, Be = (n, e) => !Ft(n, e), et = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Be };
661
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
662
+ let G = class extends HTMLElement {
651
663
  static addInitializer(e) {
652
664
  this._$Ei(), (this.l ?? (this.l = [])).push(e);
653
665
  }
654
666
  static get observedAttributes() {
655
667
  return this.finalize(), this._$Eh && [...this._$Eh.keys()];
656
668
  }
657
- static createProperty(e, t = Qe) {
669
+ static createProperty(e, t = et) {
658
670
  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) {
659
671
  const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
660
- s !== void 0 && Ft(this.prototype, e, s);
672
+ s !== void 0 && qt(this.prototype, e, s);
661
673
  }
662
674
  }
663
675
  static getPropertyDescriptor(e, t, i) {
664
- const { get: s, set: o } = Bt(this.prototype, e) ?? { get() {
676
+ const { get: s, set: o } = Vt(this.prototype, e) ?? { get() {
665
677
  return this[t];
666
678
  }, set(r) {
667
679
  this[t] = r;
668
680
  } };
669
681
  return { get: s, set(r) {
670
- const l = s == null ? void 0 : s.call(this);
671
- o == null || o.call(this, r), this.requestUpdate(e, l, i);
682
+ const a = s == null ? void 0 : s.call(this);
683
+ o == null || o.call(this, r), this.requestUpdate(e, a, i);
672
684
  }, configurable: !0, enumerable: !0 };
673
685
  }
674
686
  static getPropertyOptions(e) {
675
- return this.elementProperties.get(e) ?? Qe;
687
+ return this.elementProperties.get(e) ?? et;
676
688
  }
677
689
  static _$Ei() {
678
- if (this.hasOwnProperty(se("elementProperties"))) return;
679
- const e = Wt(this);
690
+ if (this.hasOwnProperty(ne("elementProperties"))) return;
691
+ const e = Yt(this);
680
692
  e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
681
693
  }
682
694
  static finalize() {
683
- if (this.hasOwnProperty(se("finalized"))) return;
684
- if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(se("properties"))) {
685
- const t = this.properties, i = [...qt(t), ...Vt(t)];
695
+ if (this.hasOwnProperty(ne("finalized"))) return;
696
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
697
+ const t = this.properties, i = [...Wt(t), ...Xt(t)];
686
698
  for (const s of i) this.createProperty(s, t[s]);
687
699
  }
688
700
  const e = this[Symbol.metadata];
@@ -731,7 +743,7 @@ let K = class extends HTMLElement {
731
743
  }
732
744
  createRenderRoot() {
733
745
  const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
734
- return Ht(e, this.constructor.elementStyles), e;
746
+ return Bt(e, this.constructor.elementStyles), e;
735
747
  }
736
748
  connectedCallback() {
737
749
  var e;
@@ -756,7 +768,7 @@ let K = class extends HTMLElement {
756
768
  var o;
757
769
  const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
758
770
  if (s !== void 0 && i.reflect === !0) {
759
- const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : $e).toAttribute(t, i.type);
771
+ const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : ke).toAttribute(t, i.type);
760
772
  this._$Em = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
761
773
  }
762
774
  }
@@ -764,17 +776,17 @@ let K = class extends HTMLElement {
764
776
  var o, r;
765
777
  const i = this.constructor, s = i._$Eh.get(e);
766
778
  if (s !== void 0 && this._$Em !== s) {
767
- const l = i.getPropertyOptions(s), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : $e;
779
+ const a = i.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : ke;
768
780
  this._$Em = s;
769
- const c = a.fromAttribute(t, l.type);
770
- this[s] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? c, this._$Em = null;
781
+ const d = l.fromAttribute(t, a.type);
782
+ this[s] = d ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? d, this._$Em = null;
771
783
  }
772
784
  }
773
785
  requestUpdate(e, t, i, s = !1, o) {
774
786
  var r;
775
787
  if (e !== void 0) {
776
- const l = this.constructor;
777
- if (s === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ?? Ne)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, i)))) return;
788
+ const a = this.constructor;
789
+ if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Be)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
778
790
  this.C(e, t, i);
779
791
  }
780
792
  this.isUpdatePending === !1 && (this._$ES = this._$EP());
@@ -805,8 +817,8 @@ let K = class extends HTMLElement {
805
817
  }
806
818
  const s = this.constructor.elementProperties;
807
819
  if (s.size > 0) for (const [o, r] of s) {
808
- const { wrapped: l } = r, a = this[o];
809
- l !== !0 || this._$AL.has(o) || a === void 0 || this.C(o, void 0, r, a);
820
+ const { wrapped: a } = r, l = this[o];
821
+ a !== !0 || this._$AL.has(o) || l === void 0 || this.C(o, void 0, r, l);
810
822
  }
811
823
  }
812
824
  let e = !1;
@@ -850,76 +862,76 @@ let K = class extends HTMLElement {
850
862
  firstUpdated(e) {
851
863
  }
852
864
  };
853
- K.elementStyles = [], K.shadowRootOptions = { mode: "open" }, K[se("elementProperties")] = /* @__PURE__ */ new Map(), K[se("finalized")] = /* @__PURE__ */ new Map(), Pe == null || Pe({ ReactiveElement: K }), (D.reactiveElementVersions ?? (D.reactiveElementVersions = [])).push("2.1.2");
865
+ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementProperties")] = /* @__PURE__ */ new Map(), G[ne("finalized")] = /* @__PURE__ */ new Map(), _e == null || _e({ ReactiveElement: G }), (H.reactiveElementVersions ?? (H.reactiveElementVersions = [])).push("2.1.2");
854
866
  /**
855
867
  * @license
856
868
  * Copyright 2017 Google LLC
857
869
  * SPDX-License-Identifier: BSD-3-Clause
858
870
  */
859
- const ne = globalThis, et = (n) => n, ke = ne.trustedTypes, tt = ke ? ke.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, kt = "$lit$", U = `lit$${Math.random().toFixed(9).slice(2)}$`, Et = "?" + U, Yt = `<${Et}>`, q = document, re = () => q.createComment(""), ae = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Kt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ae = `[
860
- \f\r]`, ie = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, it = /-->/g, st = />/g, N = RegExp(`>|${Ae}(?:([^\\s"'>=/]+)(${Ae}*=${Ae}*(?:[^
861
- \f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, ot = /"/g, Ct = /^(?:script|style|textarea|title)$/i, Tt = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), d = Tt(1), Gt = Tt(2), V = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), rt = /* @__PURE__ */ new WeakMap(), F = q.createTreeWalker(q, 129);
862
- function _t(n, e) {
871
+ const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
872
+ \f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, B = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
873
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
874
+ function At(n, e) {
863
875
  if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
864
- return tt !== void 0 ? tt.createHTML(e) : e;
876
+ return it !== void 0 ? it.createHTML(e) : e;
865
877
  }
866
- const Zt = (n, e) => {
878
+ const Qt = (n, e) => {
867
879
  const t = n.length - 1, i = [];
868
- let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = ie;
869
- for (let l = 0; l < t; l++) {
870
- const a = n[l];
871
- let c, h, p = -1, u = 0;
872
- for (; u < a.length && (r.lastIndex = u, h = r.exec(a), h !== null); ) u = r.lastIndex, r === ie ? h[1] === "!--" ? r = it : h[1] !== void 0 ? r = st : h[2] !== void 0 ? (Ct.test(h[2]) && (s = RegExp("</" + h[2], "g")), r = N) : h[3] !== void 0 && (r = N) : r === N ? h[0] === ">" ? (r = s ?? ie, p = -1) : h[1] === void 0 ? p = -2 : (p = r.lastIndex - h[2].length, c = h[1], r = h[3] === void 0 ? N : h[3] === '"' ? ot : nt) : r === ot || r === nt ? r = N : r === it || r === st ? r = ie : (r = N, s = void 0);
873
- const f = r === N && n[l + 1].startsWith("/>") ? " " : "";
874
- o += r === ie ? a + Yt : p >= 0 ? (i.push(c), a.slice(0, p) + kt + a.slice(p) + U + f) : a + U + (p === -2 ? l : f);
875
- }
876
- return [_t(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
880
+ let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
881
+ for (let a = 0; a < t; a++) {
882
+ const l = n[a];
883
+ let d, c, h = -1, p = 0;
884
+ for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.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] === '"' ? rt : ot) : r === rt || r === ot ? r = B : r === st || r === nt ? r = se : (r = B, s = void 0);
885
+ const m = r === B && n[a + 1].startsWith("/>") ? " " : "";
886
+ o += r === se ? l + Gt : h >= 0 ? (i.push(d), l.slice(0, h) + Et + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
887
+ }
888
+ return [At(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
877
889
  };
878
- class le {
890
+ class ce {
879
891
  constructor({ strings: e, _$litType$: t }, i) {
880
892
  let s;
881
893
  this.parts = [];
882
894
  let o = 0, r = 0;
883
- const l = e.length - 1, a = this.parts, [c, h] = Zt(e, t);
884
- if (this.el = le.createElement(c, i), F.currentNode = this.el.content, t === 2 || t === 3) {
885
- const p = this.el.content.firstChild;
886
- p.replaceWith(...p.childNodes);
895
+ const a = e.length - 1, l = this.parts, [d, c] = Qt(e, t);
896
+ if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
897
+ const h = this.el.content.firstChild;
898
+ h.replaceWith(...h.childNodes);
887
899
  }
888
- for (; (s = F.nextNode()) !== null && a.length < l; ) {
900
+ for (; (s = F.nextNode()) !== null && l.length < a; ) {
889
901
  if (s.nodeType === 1) {
890
- if (s.hasAttributes()) for (const p of s.getAttributeNames()) if (p.endsWith(kt)) {
891
- const u = h[r++], f = s.getAttribute(p).split(U), m = /([.?@])?(.*)/.exec(u);
892
- a.push({ type: 1, index: o, name: m[2], strings: f, ctor: m[1] === "." ? Qt : m[1] === "?" ? ei : m[1] === "@" ? ti : Te }), s.removeAttribute(p);
893
- } else p.startsWith(U) && (a.push({ type: 6, index: o }), s.removeAttribute(p));
894
- if (Ct.test(s.tagName)) {
895
- const p = s.textContent.split(U), u = p.length - 1;
896
- if (u > 0) {
897
- s.textContent = ke ? ke.emptyScript : "";
898
- for (let f = 0; f < u; f++) s.append(p[f], re()), F.nextNode(), a.push({ type: 2, index: ++o });
899
- s.append(p[u], re());
902
+ if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Et)) {
903
+ const p = c[r++], m = s.getAttribute(h).split(D), g = /([.?@])?(.*)/.exec(p);
904
+ l.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ti : g[1] === "?" ? ii : g[1] === "@" ? si : Se }), s.removeAttribute(h);
905
+ } else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
906
+ if (Tt.test(s.tagName)) {
907
+ const h = s.textContent.split(D), p = h.length - 1;
908
+ if (p > 0) {
909
+ s.textContent = Ee ? Ee.emptyScript : "";
910
+ for (let m = 0; m < p; m++) s.append(h[m], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
911
+ s.append(h[p], ae());
900
912
  }
901
913
  }
902
- } else if (s.nodeType === 8) if (s.data === Et) a.push({ type: 2, index: o });
914
+ } else if (s.nodeType === 8) if (s.data === Ct) l.push({ type: 2, index: o });
903
915
  else {
904
- let p = -1;
905
- for (; (p = s.data.indexOf(U, p + 1)) !== -1; ) a.push({ type: 7, index: o }), p += U.length - 1;
916
+ let h = -1;
917
+ for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
906
918
  }
907
919
  o++;
908
920
  }
909
921
  }
910
922
  static createElement(e, t) {
911
- const i = q.createElement("template");
923
+ const i = V.createElement("template");
912
924
  return i.innerHTML = e, i;
913
925
  }
914
926
  }
915
- function G(n, e, t = n, i) {
916
- var r, l;
917
- if (e === V) return e;
927
+ function J(n, e, t = n, i) {
928
+ var r, a;
929
+ if (e === W) return e;
918
930
  let s = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
919
- const o = ae(e) ? void 0 : e._$litDirective$;
920
- return (s == null ? void 0 : s.constructor) !== o && ((l = s == null ? void 0 : s._$AO) == null || l.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 = G(n, s._$AS(n, e.values), s, i)), e;
931
+ const o = le(e) ? void 0 : e._$litDirective$;
932
+ 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;
921
933
  }
922
- class Jt {
934
+ class ei {
923
935
  constructor(e, t) {
924
936
  this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
925
937
  }
@@ -930,30 +942,30 @@ class Jt {
930
942
  return this._$AM._$AU;
931
943
  }
932
944
  u(e) {
933
- const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? q).importNode(t, !0);
945
+ const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? V).importNode(t, !0);
934
946
  F.currentNode = s;
935
- let o = F.nextNode(), r = 0, l = 0, a = i[0];
936
- for (; a !== void 0; ) {
937
- if (r === a.index) {
938
- let c;
939
- a.type === 2 ? c = new fe(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new ii(o, this, e)), this._$AV.push(c), a = i[++l];
947
+ let o = F.nextNode(), r = 0, a = 0, l = i[0];
948
+ for (; l !== void 0; ) {
949
+ if (r === l.index) {
950
+ let d;
951
+ 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 ni(o, this, e)), this._$AV.push(d), l = i[++a];
940
952
  }
941
- r !== (a == null ? void 0 : a.index) && (o = F.nextNode(), r++);
953
+ r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
942
954
  }
943
- return F.currentNode = q, s;
955
+ return F.currentNode = V, s;
944
956
  }
945
957
  p(e) {
946
958
  let t = 0;
947
959
  for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
948
960
  }
949
961
  }
950
- class fe {
962
+ class me {
951
963
  get _$AU() {
952
964
  var e;
953
965
  return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
954
966
  }
955
967
  constructor(e, t, i, s) {
956
- 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;
968
+ this.type = 2, this._$AH = b, 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;
957
969
  }
958
970
  get parentNode() {
959
971
  let e = this._$AA.parentNode;
@@ -967,7 +979,7 @@ class fe {
967
979
  return this._$AB;
968
980
  }
969
981
  _$AI(e, t = this) {
970
- e = G(this, e, t), ae(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== V && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Kt(e) ? this.k(e) : this._(e);
982
+ e = J(this, e, t), le(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
971
983
  }
972
984
  O(e) {
973
985
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -976,33 +988,33 @@ class fe {
976
988
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
977
989
  }
978
990
  _(e) {
979
- this._$AH !== g && ae(this._$AH) ? this._$AA.nextSibling.data = e : this.T(q.createTextNode(e)), this._$AH = e;
991
+ this._$AH !== b && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
980
992
  }
981
993
  $(e) {
982
994
  var o;
983
- const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = le.createElement(_t(i.h, i.h[0]), this.options)), i);
995
+ const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(At(i.h, i.h[0]), this.options)), i);
984
996
  if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
985
997
  else {
986
- const r = new Jt(s, this), l = r.u(this.options);
987
- r.p(t), this.T(l), this._$AH = r;
998
+ const r = new ei(s, this), a = r.u(this.options);
999
+ r.p(t), this.T(a), this._$AH = r;
988
1000
  }
989
1001
  }
990
1002
  _$AC(e) {
991
- let t = rt.get(e.strings);
992
- return t === void 0 && rt.set(e.strings, t = new le(e)), t;
1003
+ let t = at.get(e.strings);
1004
+ return t === void 0 && at.set(e.strings, t = new ce(e)), t;
993
1005
  }
994
1006
  k(e) {
995
1007
  Fe(this._$AH) || (this._$AH = [], this._$AR());
996
1008
  const t = this._$AH;
997
1009
  let i, s = 0;
998
- for (const o of e) s === t.length ? t.push(i = new fe(this.O(re()), this.O(re()), this, this.options)) : i = t[s], i._$AI(o), s++;
1010
+ 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++;
999
1011
  s < t.length && (this._$AR(i && i._$AB.nextSibling, s), t.length = s);
1000
1012
  }
1001
1013
  _$AR(e = this._$AA.nextSibling, t) {
1002
1014
  var i;
1003
1015
  for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
1004
- const s = et(e).nextSibling;
1005
- et(e).remove(), e = s;
1016
+ const s = tt(e).nextSibling;
1017
+ tt(e).remove(), e = s;
1006
1018
  }
1007
1019
  }
1008
1020
  setConnected(e) {
@@ -1010,7 +1022,7 @@ class fe {
1010
1022
  this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
1011
1023
  }
1012
1024
  }
1013
- class Te {
1025
+ class Se {
1014
1026
  get tagName() {
1015
1027
  return this.element.tagName;
1016
1028
  }
@@ -1018,46 +1030,46 @@ class Te {
1018
1030
  return this._$AM._$AU;
1019
1031
  }
1020
1032
  constructor(e, t, i, s, o) {
1021
- 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;
1033
+ this.type = 1, this._$AH = b, 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 = b;
1022
1034
  }
1023
1035
  _$AI(e, t = this, i, s) {
1024
1036
  const o = this.strings;
1025
1037
  let r = !1;
1026
- if (o === void 0) e = G(this, e, t, 0), r = !ae(e) || e !== this._$AH && e !== V, r && (this._$AH = e);
1038
+ if (o === void 0) e = J(this, e, t, 0), r = !le(e) || e !== this._$AH && e !== W, r && (this._$AH = e);
1027
1039
  else {
1028
- const l = e;
1029
- let a, c;
1030
- for (e = o[0], a = 0; a < o.length - 1; a++) c = G(this, l[i + a], t, a), c === V && (c = this._$AH[a]), r || (r = !ae(c) || c !== this._$AH[a]), c === g ? e = g : e !== g && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
1040
+ const a = e;
1041
+ let l, d;
1042
+ 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 === b ? e = b : e !== b && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1031
1043
  }
1032
1044
  r && !s && this.j(e);
1033
1045
  }
1034
1046
  j(e) {
1035
- e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1047
+ e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1036
1048
  }
1037
1049
  }
1038
- class Qt extends Te {
1050
+ class ti extends Se {
1039
1051
  constructor() {
1040
1052
  super(...arguments), this.type = 3;
1041
1053
  }
1042
1054
  j(e) {
1043
- this.element[this.name] = e === g ? void 0 : e;
1055
+ this.element[this.name] = e === b ? void 0 : e;
1044
1056
  }
1045
1057
  }
1046
- class ei extends Te {
1058
+ class ii extends Se {
1047
1059
  constructor() {
1048
1060
  super(...arguments), this.type = 4;
1049
1061
  }
1050
1062
  j(e) {
1051
- this.element.toggleAttribute(this.name, !!e && e !== g);
1063
+ this.element.toggleAttribute(this.name, !!e && e !== b);
1052
1064
  }
1053
1065
  }
1054
- class ti extends Te {
1066
+ class si extends Se {
1055
1067
  constructor(e, t, i, s, o) {
1056
1068
  super(e, t, i, s, o), this.type = 5;
1057
1069
  }
1058
1070
  _$AI(e, t = this) {
1059
- if ((e = G(this, e, t, 0) ?? g) === V) return;
1060
- 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);
1071
+ if ((e = J(this, e, t, 0) ?? b) === W) return;
1072
+ const i = this._$AH, s = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== b && (i === b || s);
1061
1073
  s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
1062
1074
  }
1063
1075
  handleEvent(e) {
@@ -1065,7 +1077,7 @@ class ti extends Te {
1065
1077
  typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
1066
1078
  }
1067
1079
  }
1068
- class ii {
1080
+ class ni {
1069
1081
  constructor(e, t, i) {
1070
1082
  this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
1071
1083
  }
@@ -1073,17 +1085,17 @@ class ii {
1073
1085
  return this._$AM._$AU;
1074
1086
  }
1075
1087
  _$AI(e) {
1076
- G(this, e);
1088
+ J(this, e);
1077
1089
  }
1078
1090
  }
1079
- const Ie = ne.litHtmlPolyfillSupport;
1080
- Ie == null || Ie(le, fe), (ne.litHtmlVersions ?? (ne.litHtmlVersions = [])).push("3.3.2");
1081
- const si = (n, e, t) => {
1091
+ const Me = oe.litHtmlPolyfillSupport;
1092
+ Me == null || Me(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
1093
+ const oi = (n, e, t) => {
1082
1094
  const i = (t == null ? void 0 : t.renderBefore) ?? e;
1083
1095
  let s = i._$litPart$;
1084
1096
  if (s === void 0) {
1085
1097
  const o = (t == null ? void 0 : t.renderBefore) ?? null;
1086
- i._$litPart$ = s = new fe(e.insertBefore(re(), o), o, void 0, t ?? {});
1098
+ i._$litPart$ = s = new me(e.insertBefore(ae(), o), o, void 0, t ?? {});
1087
1099
  }
1088
1100
  return s._$AI(n), s;
1089
1101
  };
@@ -1092,8 +1104,8 @@ const si = (n, e, t) => {
1092
1104
  * Copyright 2017 Google LLC
1093
1105
  * SPDX-License-Identifier: BSD-3-Clause
1094
1106
  */
1095
- const B = globalThis;
1096
- let P = class extends K {
1107
+ const q = globalThis;
1108
+ let A = class extends G {
1097
1109
  constructor() {
1098
1110
  super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1099
1111
  }
@@ -1104,7 +1116,7 @@ let P = class extends K {
1104
1116
  }
1105
1117
  update(e) {
1106
1118
  const t = this.render();
1107
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = si(t, this.renderRoot, this.renderOptions);
1119
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = oi(t, this.renderRoot, this.renderOptions);
1108
1120
  }
1109
1121
  connectedCallback() {
1110
1122
  var e;
@@ -1115,14 +1127,14 @@ let P = class extends K {
1115
1127
  super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
1116
1128
  }
1117
1129
  render() {
1118
- return V;
1130
+ return W;
1119
1131
  }
1120
1132
  };
1121
- var xt;
1122
- P._$litElement$ = !0, P.finalized = !0, (xt = B.litElementHydrateSupport) == null || xt.call(B, { LitElement: P });
1123
- const Me = B.litElementPolyfillSupport;
1124
- Me == null || Me({ LitElement: P });
1125
- (B.litElementVersions ?? (B.litElementVersions = [])).push("4.2.2");
1133
+ var yt;
1134
+ A._$litElement$ = !0, A.finalized = !0, (yt = q.litElementHydrateSupport) == null || yt.call(q, { LitElement: A });
1135
+ const Oe = q.litElementPolyfillSupport;
1136
+ Oe == null || Oe({ LitElement: A });
1137
+ (q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
1126
1138
  /**
1127
1139
  * @license
1128
1140
  * Copyright 2017 Google LLC
@@ -1138,29 +1150,29 @@ const L = (n) => (e, t) => {
1138
1150
  * Copyright 2017 Google LLC
1139
1151
  * SPDX-License-Identifier: BSD-3-Clause
1140
1152
  */
1141
- const ni = { attribute: !0, type: String, converter: $e, reflect: !1, hasChanged: Ne }, oi = (n = ni, e, t) => {
1153
+ const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Be }, ai = (n = ri, e, t) => {
1142
1154
  const { kind: i, metadata: s } = t;
1143
1155
  let o = globalThis.litPropertyMetadata.get(s);
1144
1156
  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") {
1145
1157
  const { name: r } = t;
1146
- return { set(l) {
1147
- const a = e.get.call(this);
1148
- e.set.call(this, l), this.requestUpdate(r, a, n, !0, l);
1149
- }, init(l) {
1150
- return l !== void 0 && this.C(r, void 0, n, l), l;
1158
+ return { set(a) {
1159
+ const l = e.get.call(this);
1160
+ e.set.call(this, a), this.requestUpdate(r, l, n, !0, a);
1161
+ }, init(a) {
1162
+ return a !== void 0 && this.C(r, void 0, n, a), a;
1151
1163
  } };
1152
1164
  }
1153
1165
  if (i === "setter") {
1154
1166
  const { name: r } = t;
1155
- return function(l) {
1156
- const a = this[r];
1157
- e.call(this, l), this.requestUpdate(r, a, n, !0, l);
1167
+ return function(a) {
1168
+ const l = this[r];
1169
+ e.call(this, a), this.requestUpdate(r, l, n, !0, a);
1158
1170
  };
1159
1171
  }
1160
1172
  throw Error("Unsupported decorator location: " + i);
1161
1173
  };
1162
- function v(n) {
1163
- return (e, t) => typeof t == "object" ? oi(n, e, t) : ((i, s, o) => {
1174
+ function x(n) {
1175
+ return (e, t) => typeof t == "object" ? ai(n, e, t) : ((i, s, o) => {
1164
1176
  const r = s.hasOwnProperty(o);
1165
1177
  return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
1166
1178
  })(n, e, t);
@@ -1170,16 +1182,16 @@ function v(n) {
1170
1182
  * Copyright 2017 Google LLC
1171
1183
  * SPDX-License-Identifier: BSD-3-Clause
1172
1184
  */
1173
- function w(n) {
1174
- return v({ ...n, state: !0, attribute: !1 });
1185
+ function $(n) {
1186
+ return x({ ...n, state: !0, attribute: !1 });
1175
1187
  }
1176
- const J = "pulse-client";
1177
- var ri = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Q = (n, e, t, i) => {
1178
- for (var s = i > 1 ? void 0 : i ? ai(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1188
+ const Q = "pulse-client";
1189
+ var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
1190
+ for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1179
1191
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1180
- return i && s && ri(e, t, s), s;
1192
+ return i && s && li(e, t, s), s;
1181
1193
  };
1182
- let W = class extends P {
1194
+ let X = class extends A {
1183
1195
  constructor() {
1184
1196
  super(...arguments), this.apiKey = "", this.token = "", this.room = "";
1185
1197
  }
@@ -1191,40 +1203,40 @@ let W = class extends P {
1191
1203
  room: this.room,
1192
1204
  endpoint: this.endpoint
1193
1205
  };
1194
- this.client = new wt(n), this.client.connect();
1206
+ this.client = new $t(n), this.client.connect();
1195
1207
  }
1196
1208
  disconnectedCallback() {
1197
1209
  var n;
1198
1210
  super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
1199
1211
  }
1200
1212
  render() {
1201
- return d`<slot></slot>`;
1213
+ return u`<slot></slot>`;
1202
1214
  }
1203
1215
  };
1204
- Q([
1205
- v({ attribute: "api-key" })
1206
- ], W.prototype, "apiKey", 2);
1207
- Q([
1208
- v()
1209
- ], W.prototype, "token", 2);
1210
- Q([
1211
- v()
1212
- ], W.prototype, "room", 2);
1213
- Q([
1214
- v()
1215
- ], W.prototype, "endpoint", 2);
1216
- Q([
1217
- Ot({ context: J })
1218
- ], W.prototype, "client", 2);
1219
- W = Q([
1216
+ ee([
1217
+ x({ attribute: "api-key" })
1218
+ ], X.prototype, "apiKey", 2);
1219
+ ee([
1220
+ x()
1221
+ ], X.prototype, "token", 2);
1222
+ ee([
1223
+ x()
1224
+ ], X.prototype, "room", 2);
1225
+ ee([
1226
+ x()
1227
+ ], X.prototype, "endpoint", 2);
1228
+ ee([
1229
+ Lt({ context: Q })
1230
+ ], X.prototype, "client", 2);
1231
+ X = ee([
1220
1232
  L("pulse-provider")
1221
- ], W);
1222
- var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, _e = (n, e, t, i) => {
1223
- for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1233
+ ], X);
1234
+ var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Ae = (n, e, t, i) => {
1235
+ for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1224
1236
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1225
- return i && s && li(e, t, s), s;
1237
+ return i && s && di(e, t, s), s;
1226
1238
  };
1227
- let Z = class extends P {
1239
+ let Z = class extends A {
1228
1240
  constructor() {
1229
1241
  super(...arguments), this.maxVisible = 5, this.users = [];
1230
1242
  }
@@ -1249,16 +1261,16 @@ let Z = class extends P {
1249
1261
  }
1250
1262
  render() {
1251
1263
  const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
1252
- return d`
1264
+ return u`
1253
1265
  <div class="avatars">
1254
- ${e > 0 ? d`<div class="overflow">+${e}</div>` : null}
1266
+ ${e > 0 ? u`<div class="overflow">+${e}</div>` : null}
1255
1267
  ${n.map(
1256
- (t) => d`
1268
+ (t) => u`
1257
1269
  <div
1258
1270
  class="avatar"
1259
1271
  style="background:${t.user.color}"
1260
1272
  >
1261
- ${t.user.avatar ? d`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1273
+ ${t.user.avatar ? u`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
1262
1274
  <span class="status-ring ${t.status}"></span>
1263
1275
  <span class="tooltip">${t.user.name}</span>
1264
1276
  </div>
@@ -1268,7 +1280,7 @@ let Z = class extends P {
1268
1280
  `;
1269
1281
  }
1270
1282
  };
1271
- Z.styles = O`
1283
+ Z.styles = M`
1272
1284
  :host {
1273
1285
  display: inline-flex;
1274
1286
  align-items: center;
@@ -1372,25 +1384,25 @@ Z.styles = O`
1372
1384
  opacity: 1;
1373
1385
  }
1374
1386
  `;
1375
- _e([
1376
- ue({ context: J, subscribe: !0 }),
1377
- v({ attribute: !1 })
1387
+ Ae([
1388
+ fe({ context: Q, subscribe: !0 }),
1389
+ x({ attribute: !1 })
1378
1390
  ], Z.prototype, "client", 2);
1379
- _e([
1380
- v({ type: Number, attribute: "max-visible" })
1391
+ Ae([
1392
+ x({ type: Number, attribute: "max-visible" })
1381
1393
  ], Z.prototype, "maxVisible", 2);
1382
- _e([
1383
- w()
1394
+ Ae([
1395
+ $()
1384
1396
  ], Z.prototype, "users", 2);
1385
- Z = _e([
1397
+ Z = Ae([
1386
1398
  L("pulse-presence")
1387
1399
  ], Z);
1388
- var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Be = (n, e, t, i) => {
1389
- for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1400
+ var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
1401
+ for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1390
1402
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1391
- return i && s && di(e, t, s), s;
1403
+ return i && s && pi(e, t, s), s;
1392
1404
  };
1393
- let ce = class extends P {
1405
+ let de = class extends A {
1394
1406
  constructor() {
1395
1407
  super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
1396
1408
  var e;
@@ -1444,9 +1456,9 @@ let ce = class extends P {
1444
1456
  }
1445
1457
  render() {
1446
1458
  const n = [...this.cursors.values()];
1447
- return d`
1459
+ return u`
1448
1460
  ${n.map(
1449
- (e) => d`
1461
+ (e) => u`
1450
1462
  <div
1451
1463
  class="cursor"
1452
1464
  style="transform:translate(${e.position.x}px,${e.position.y}px)"
@@ -1467,7 +1479,7 @@ let ce = class extends P {
1467
1479
  `;
1468
1480
  }
1469
1481
  };
1470
- ce.styles = O`
1482
+ de.styles = M`
1471
1483
  :host {
1472
1484
  position: fixed;
1473
1485
  top: 0;
@@ -1504,22 +1516,22 @@ ce.styles = O`
1504
1516
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
1505
1517
  }
1506
1518
  `;
1507
- Be([
1508
- ue({ context: J, subscribe: !0 }),
1509
- v({ attribute: !1 })
1510
- ], ce.prototype, "client", 2);
1511
- Be([
1512
- w()
1513
- ], ce.prototype, "cursors", 2);
1514
- ce = Be([
1519
+ qe([
1520
+ fe({ context: Q, subscribe: !0 }),
1521
+ x({ attribute: !1 })
1522
+ ], de.prototype, "client", 2);
1523
+ qe([
1524
+ $()
1525
+ ], de.prototype, "cursors", 2);
1526
+ de = qe([
1515
1527
  L("pulse-cursors")
1516
- ], ce);
1517
- var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, me = (n, e, t, i) => {
1518
- for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1528
+ ], de);
1529
+ var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
1530
+ for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1519
1531
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1520
- return i && s && pi(e, t, s), s;
1532
+ return i && s && fi(e, t, s), s;
1521
1533
  };
1522
- let X = class extends P {
1534
+ let Y = class extends A {
1523
1535
  constructor() {
1524
1536
  super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
1525
1537
  }
@@ -1541,7 +1553,7 @@ let X = class extends P {
1541
1553
  }
1542
1554
  parseMentions(n) {
1543
1555
  return n.split(/(@\w+)/g).map(
1544
- (t) => t.startsWith("@") ? d`<span class="mention">${t}</span>` : t
1556
+ (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
1545
1557
  );
1546
1558
  }
1547
1559
  getInitials(n) {
@@ -1567,9 +1579,9 @@ let X = class extends P {
1567
1579
  }
1568
1580
  render() {
1569
1581
  const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
1570
- return d`
1582
+ return u`
1571
1583
  <div class="threads">
1572
- ${n.length === 0 ? d`<div class="empty">
1584
+ ${n.length === 0 ? u`<div class="empty">
1573
1585
  <div class="empty-icon">&#128172;</div>
1574
1586
  No comments yet.<br>Start a conversation below.
1575
1587
  </div>` : n.map((e) => this.renderThread(e))}
@@ -1583,12 +1595,12 @@ let X = class extends P {
1583
1595
  `;
1584
1596
  }
1585
1597
  renderThread(n) {
1586
- return d`
1598
+ return u`
1587
1599
  <div class="thread ${n.resolved ? "resolved" : ""}">
1588
1600
  ${n.comments.map((e, t) => {
1589
1601
  const i = this.getUserForComment(e.userId);
1590
- return d`
1591
- ${t > 0 ? d`<div class="divider"></div>` : g}
1602
+ return u`
1603
+ ${t > 0 ? u`<div class="divider"></div>` : b}
1592
1604
  <div class="comment">
1593
1605
  <div class="comment-header">
1594
1606
  <div
@@ -1620,12 +1632,12 @@ let X = class extends P {
1620
1632
  ${n.resolved ? "Reopen" : "Resolve"}
1621
1633
  </button>
1622
1634
  </div>
1623
- ${this.replyingTo === n.id ? d`
1635
+ ${this.replyingTo === n.id ? u`
1624
1636
  <form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
1625
1637
  <input type="text" placeholder="Write a reply..." />
1626
1638
  <button type="submit">Send</button>
1627
1639
  </form>
1628
- ` : g}
1640
+ ` : b}
1629
1641
  </div>
1630
1642
  `;
1631
1643
  }
@@ -1637,7 +1649,7 @@ let X = class extends P {
1637
1649
  return o < 24 ? `${o}h ago` : e.toLocaleDateString();
1638
1650
  }
1639
1651
  };
1640
- X.styles = O`
1652
+ Y.styles = M`
1641
1653
  :host {
1642
1654
  display: block;
1643
1655
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
@@ -1849,41 +1861,41 @@ X.styles = O`
1849
1861
  opacity: 0.4;
1850
1862
  }
1851
1863
  `;
1852
- me([
1853
- ue({ context: J, subscribe: !0 }),
1854
- v({ attribute: !1 })
1855
- ], X.prototype, "client", 2);
1856
- me([
1857
- v({ type: Boolean, attribute: "show-resolved" })
1858
- ], X.prototype, "showResolved", 2);
1859
- me([
1860
- w()
1861
- ], X.prototype, "threads", 2);
1862
- me([
1863
- w()
1864
- ], X.prototype, "replyingTo", 2);
1865
- X = me([
1864
+ ge([
1865
+ fe({ context: Q, subscribe: !0 }),
1866
+ x({ attribute: !1 })
1867
+ ], Y.prototype, "client", 2);
1868
+ ge([
1869
+ x({ type: Boolean, attribute: "show-resolved" })
1870
+ ], Y.prototype, "showResolved", 2);
1871
+ ge([
1872
+ $()
1873
+ ], Y.prototype, "threads", 2);
1874
+ ge([
1875
+ $()
1876
+ ], Y.prototype, "replyingTo", 2);
1877
+ Y = ge([
1866
1878
  L("pulse-comments")
1867
- ], X);
1868
- var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
1869
- for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1879
+ ], Y);
1880
+ var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
1881
+ for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1870
1882
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1871
- return i && s && fi(e, t, s), s;
1883
+ return i && s && gi(e, t, s), s;
1872
1884
  };
1873
- const gi = {
1885
+ const vi = {
1874
1886
  "comment:created": "left a comment",
1875
1887
  "comment:mention": "mentioned you",
1876
1888
  "comment:reply": "replied to your comment",
1877
1889
  "thread:resolved": "resolved a thread",
1878
1890
  "reaction:added": "reacted to your comment"
1879
- }, bi = {
1891
+ }, xi = {
1880
1892
  "comment:created": "💬",
1881
1893
  "comment:mention": "📣",
1882
1894
  "comment:reply": "↩️",
1883
1895
  "thread:resolved": "✅",
1884
1896
  "reaction:added": "🎉"
1885
1897
  };
1886
- let de = class extends P {
1898
+ let he = class extends A {
1887
1899
  constructor() {
1888
1900
  super(...arguments), this.notifications = [];
1889
1901
  }
@@ -1930,31 +1942,31 @@ let de = class extends P {
1930
1942
  }
1931
1943
  render() {
1932
1944
  const n = this.notifications.filter((e) => !e.read).length;
1933
- return d`
1945
+ return u`
1934
1946
  <div class="header">
1935
1947
  <span class="title">
1936
1948
  Notifications
1937
- ${n > 0 ? d`<span class="badge">${n}</span>` : g}
1949
+ ${n > 0 ? u`<span class="badge">${n}</span>` : b}
1938
1950
  </span>
1939
- ${n > 0 ? d`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1951
+ ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1940
1952
  Mark all read
1941
- </button>` : g}
1953
+ </button>` : b}
1942
1954
  </div>
1943
1955
  <div class="list">
1944
- ${this.notifications.length === 0 ? d`<div class="empty">
1956
+ ${this.notifications.length === 0 ? u`<div class="empty">
1945
1957
  <div class="empty-icon">&#128276;</div>
1946
1958
  No notifications yet
1947
1959
  </div>` : this.notifications.map(
1948
- (e) => d`
1960
+ (e) => u`
1949
1961
  <div
1950
1962
  class="item ${e.read ? "" : "unread"}"
1951
1963
  @click=${() => this.handleClick(e)}
1952
1964
  >
1953
- <span class="icon">${bi[e.type] ?? "🔔"}</span>
1965
+ <span class="icon">${xi[e.type] ?? "🔔"}</span>
1954
1966
  <div class="content">
1955
1967
  <div class="text">
1956
1968
  <span class="actor">${this.getActorName(e.actorId)}</span>
1957
- ${gi[e.type] ?? e.type}
1969
+ ${vi[e.type] ?? e.type}
1958
1970
  </div>
1959
1971
  <div class="time">${this.formatTime(e.createdAt)}</div>
1960
1972
  </div>
@@ -1966,7 +1978,7 @@ let de = class extends P {
1966
1978
  `;
1967
1979
  }
1968
1980
  };
1969
- de.styles = O`
1981
+ he.styles = M`
1970
1982
  :host {
1971
1983
  display: block;
1972
1984
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
@@ -2107,23 +2119,23 @@ de.styles = O`
2107
2119
  opacity: 0.4;
2108
2120
  }
2109
2121
  `;
2110
- qe([
2111
- ue({ context: J, subscribe: !0 }),
2112
- v({ attribute: !1 })
2113
- ], de.prototype, "client", 2);
2114
- qe([
2115
- w()
2116
- ], de.prototype, "notifications", 2);
2117
- de = qe([
2122
+ Ve([
2123
+ fe({ context: Q, subscribe: !0 }),
2124
+ x({ attribute: !1 })
2125
+ ], he.prototype, "client", 2);
2126
+ Ve([
2127
+ $()
2128
+ ], he.prototype, "notifications", 2);
2129
+ he = Ve([
2118
2130
  L("pulse-notifications")
2119
- ], de);
2120
- var vi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
2121
- for (var s = i > 1 ? void 0 : i ? xi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2131
+ ], he);
2132
+ var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
2133
+ for (var s = i > 1 ? void 0 : i ? wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2122
2134
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2123
- return i && s && vi(e, t, s), s;
2135
+ return i && s && yi(e, t, s), s;
2124
2136
  };
2125
- const yi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2126
- let H = class extends P {
2137
+ const $i = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
2138
+ let N = class extends A {
2127
2139
  constructor() {
2128
2140
  super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
2129
2141
  }
@@ -2163,9 +2175,9 @@ let H = class extends P {
2163
2175
  }
2164
2176
  render() {
2165
2177
  const n = this.groupReactions();
2166
- return d`
2178
+ return u`
2167
2179
  ${n.map(
2168
- (e) => d`
2180
+ (e) => u`
2169
2181
  <button
2170
2182
  class="reaction ${e.userReactionId ? "active" : ""}"
2171
2183
  @click=${() => this.toggleReaction(e)}
@@ -2182,22 +2194,22 @@ let H = class extends P {
2182
2194
  >
2183
2195
  +
2184
2196
  </button>
2185
- ${this.showPicker ? d`
2197
+ ${this.showPicker ? u`
2186
2198
  <div class="picker">
2187
- ${yi.map(
2188
- (e) => d`
2199
+ ${$i.map(
2200
+ (e) => u`
2189
2201
  <button @click=${() => this.addEmoji(e)}>
2190
2202
  ${e}
2191
2203
  </button>
2192
2204
  `
2193
2205
  )}
2194
2206
  </div>
2195
- ` : g}
2207
+ ` : b}
2196
2208
  </div>
2197
2209
  `;
2198
2210
  }
2199
2211
  };
2200
- H.styles = O`
2212
+ N.styles = M`
2201
2213
  :host {
2202
2214
  display: inline-flex;
2203
2215
  align-items: center;
@@ -2309,32 +2321,32 @@ H.styles = O`
2309
2321
  transform: scale(1.2);
2310
2322
  }
2311
2323
  `;
2312
- ee([
2313
- ue({ context: J, subscribe: !0 }),
2314
- v({ attribute: !1 })
2315
- ], H.prototype, "client", 2);
2316
- ee([
2317
- v({ attribute: "target-id" })
2318
- ], H.prototype, "targetId", 2);
2319
- ee([
2320
- v({ attribute: "target-type" })
2321
- ], H.prototype, "targetType", 2);
2322
- ee([
2323
- w()
2324
- ], H.prototype, "reactions", 2);
2325
- ee([
2326
- w()
2327
- ], H.prototype, "showPicker", 2);
2328
- H = ee([
2324
+ te([
2325
+ fe({ context: Q, subscribe: !0 }),
2326
+ x({ attribute: !1 })
2327
+ ], N.prototype, "client", 2);
2328
+ te([
2329
+ x({ attribute: "target-id" })
2330
+ ], N.prototype, "targetId", 2);
2331
+ te([
2332
+ x({ attribute: "target-type" })
2333
+ ], N.prototype, "targetType", 2);
2334
+ te([
2335
+ $()
2336
+ ], N.prototype, "reactions", 2);
2337
+ te([
2338
+ $()
2339
+ ], N.prototype, "showPicker", 2);
2340
+ N = te([
2329
2341
  L("pulse-reactions")
2330
- ], H);
2342
+ ], N);
2331
2343
  /**
2332
2344
  * @license
2333
2345
  * Copyright 2017 Google LLC
2334
2346
  * SPDX-License-Identifier: BSD-3-Clause
2335
2347
  */
2336
- const wi = { CHILD: 2 }, $i = (n) => (...e) => ({ _$litDirective$: n, values: e });
2337
- class ki {
2348
+ const ki = { CHILD: 2 }, Ei = (n) => (...e) => ({ _$litDirective$: n, values: e });
2349
+ class Ci {
2338
2350
  constructor(e) {
2339
2351
  }
2340
2352
  get _$AU() {
@@ -2355,13 +2367,13 @@ class ki {
2355
2367
  * Copyright 2017 Google LLC
2356
2368
  * SPDX-License-Identifier: BSD-3-Clause
2357
2369
  */
2358
- class Oe extends ki {
2370
+ class Re extends Ci {
2359
2371
  constructor(e) {
2360
- if (super(e), this.it = g, e.type !== wi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2372
+ if (super(e), this.it = b, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2361
2373
  }
2362
2374
  render(e) {
2363
- if (e === g || e == null) return this._t = void 0, this.it = e;
2364
- if (e === V) return e;
2375
+ if (e === b || e == null) return this._t = void 0, this.it = e;
2376
+ if (e === W) return e;
2365
2377
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
2366
2378
  if (e === this.it) return this._t;
2367
2379
  this.it = e;
@@ -2369,23 +2381,23 @@ class Oe extends ki {
2369
2381
  return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
2370
2382
  }
2371
2383
  }
2372
- Oe.directiveName = "unsafeHTML", Oe.resultType = 1;
2384
+ Re.directiveName = "unsafeHTML", Re.resultType = 1;
2373
2385
  /**
2374
2386
  * @license
2375
2387
  * Copyright 2017 Google LLC
2376
2388
  * SPDX-License-Identifier: BSD-3-Clause
2377
2389
  */
2378
- class Re extends Oe {
2390
+ class Le extends Re {
2379
2391
  }
2380
- Re.directiveName = "unsafeSVG", Re.resultType = 2;
2381
- const Ei = $i(Re);
2392
+ Le.directiveName = "unsafeSVG", Le.resultType = 2;
2393
+ const Ti = Ei(Le);
2382
2394
  /**
2383
2395
  * @license lucide v0.577.0 - ISC
2384
2396
  *
2385
2397
  * This source code is licensed under the ISC license.
2386
2398
  * See the LICENSE file in the root directory of this source tree.
2387
2399
  */
2388
- const Ci = [
2400
+ const Si = [
2389
2401
  ["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
2390
2402
  [
2391
2403
  "path",
@@ -2400,7 +2412,7 @@ const Ci = [
2400
2412
  * This source code is licensed under the ISC license.
2401
2413
  * See the LICENSE file in the root directory of this source tree.
2402
2414
  */
2403
- const Ti = [
2415
+ const Ai = [
2404
2416
  ["circle", { cx: "12", cy: "12", r: "10" }],
2405
2417
  ["path", { d: "M12 6v6l4 2" }]
2406
2418
  ];
@@ -2410,7 +2422,7 @@ const Ti = [
2410
2422
  * This source code is licensed under the ISC license.
2411
2423
  * See the LICENSE file in the root directory of this source tree.
2412
2424
  */
2413
- const _i = [
2425
+ const Pi = [
2414
2426
  [
2415
2427
  "path",
2416
2428
  {
@@ -2424,7 +2436,7 @@ const _i = [
2424
2436
  * This source code is licensed under the ISC license.
2425
2437
  * See the LICENSE file in the root directory of this source tree.
2426
2438
  */
2427
- const Si = [
2439
+ const _i = [
2428
2440
  ["path", { d: "M12 19v3" }],
2429
2441
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
2430
2442
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
@@ -2435,7 +2447,7 @@ const Si = [
2435
2447
  * This source code is licensed under the ISC license.
2436
2448
  * See the LICENSE file in the root directory of this source tree.
2437
2449
  */
2438
- const Pi = [
2450
+ const Ii = [
2439
2451
  [
2440
2452
  "path",
2441
2453
  {
@@ -2449,7 +2461,7 @@ const Pi = [
2449
2461
  * This source code is licensed under the ISC license.
2450
2462
  * See the LICENSE file in the root directory of this source tree.
2451
2463
  */
2452
- const Ai = [
2464
+ const Mi = [
2453
2465
  [
2454
2466
  "path",
2455
2467
  {
@@ -2471,7 +2483,7 @@ const Ai = [
2471
2483
  * This source code is licensed under the ISC license.
2472
2484
  * See the LICENSE file in the root directory of this source tree.
2473
2485
  */
2474
- const Ii = [
2486
+ const Oi = [
2475
2487
  [
2476
2488
  "path",
2477
2489
  {
@@ -2486,7 +2498,7 @@ const Ii = [
2486
2498
  * This source code is licensed under the ISC license.
2487
2499
  * See the LICENSE file in the root directory of this source tree.
2488
2500
  */
2489
- const St = [
2501
+ const Pt = [
2490
2502
  ["path", { d: "M12 17v5" }],
2491
2503
  [
2492
2504
  "path",
@@ -2501,7 +2513,7 @@ const St = [
2501
2513
  * This source code is licensed under the ISC license.
2502
2514
  * See the LICENSE file in the root directory of this source tree.
2503
2515
  */
2504
- const Mi = [
2516
+ const Ri = [
2505
2517
  [
2506
2518
  "path",
2507
2519
  {
@@ -2516,7 +2528,7 @@ const Mi = [
2516
2528
  * This source code is licensed under the ISC license.
2517
2529
  * See the LICENSE file in the root directory of this source tree.
2518
2530
  */
2519
- const Oi = [
2531
+ const Li = [
2520
2532
  ["path", { d: "M10 11v6" }],
2521
2533
  ["path", { d: "M14 11v6" }],
2522
2534
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
@@ -2529,7 +2541,7 @@ const Oi = [
2529
2541
  * This source code is licensed under the ISC license.
2530
2542
  * See the LICENSE file in the root directory of this source tree.
2531
2543
  */
2532
- const Ri = [
2544
+ const ji = [
2533
2545
  ["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" }],
2534
2546
  ["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
2535
2547
  ];
@@ -2539,7 +2551,7 @@ const Ri = [
2539
2551
  * This source code is licensed under the ISC license.
2540
2552
  * See the LICENSE file in the root directory of this source tree.
2541
2553
  */
2542
- const ge = [
2554
+ const be = [
2543
2555
  ["path", { d: "M18 6 6 18" }],
2544
2556
  ["path", { d: "m6 6 12 12" }]
2545
2557
  ];
@@ -2549,7 +2561,7 @@ const ge = [
2549
2561
  * This source code is licensed under the ISC license.
2550
2562
  * See the LICENSE file in the root directory of this source tree.
2551
2563
  */
2552
- const Li = [
2564
+ const zi = [
2553
2565
  [
2554
2566
  "path",
2555
2567
  {
@@ -2557,14 +2569,14 @@ const Li = [
2557
2569
  }
2558
2570
  ]
2559
2571
  ];
2560
- function ji(n) {
2572
+ function Ui(n) {
2561
2573
  return n.map(([e, t]) => {
2562
2574
  const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
2563
2575
  return `<${e} ${i}/>`;
2564
2576
  }).join("");
2565
2577
  }
2566
2578
  function C(n, e = 18) {
2567
- return Gt`<svg
2579
+ return Zt`<svg
2568
2580
  xmlns="http://www.w3.org/2000/svg"
2569
2581
  width="${e}"
2570
2582
  height="${e}"
@@ -2574,9 +2586,9 @@ function C(n, e = 18) {
2574
2586
  stroke-width="2"
2575
2587
  stroke-linecap="round"
2576
2588
  stroke-linejoin="round"
2577
- >${Ei(ji(n))}</svg>`;
2589
+ >${Ti(Ui(n))}</svg>`;
2578
2590
  }
2579
- const te = O`
2591
+ const ie = M`
2580
2592
  * {
2581
2593
  box-sizing: border-box;
2582
2594
  margin: 0;
@@ -2619,7 +2631,7 @@ const te = O`
2619
2631
  --pw-shadow: var(--pulse-shadow);
2620
2632
  --pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
2621
2633
  }
2622
- `, be = O`
2634
+ `, ve = M`
2623
2635
  .pw-btn {
2624
2636
  display: inline-flex;
2625
2637
  align-items: center;
@@ -2663,7 +2675,7 @@ const te = O`
2663
2675
  width: 18px;
2664
2676
  height: 18px;
2665
2677
  }
2666
- `, Se = O`
2678
+ `, Pe = M`
2667
2679
  .pw-scrollable::-webkit-scrollbar {
2668
2680
  width: 4px;
2669
2681
  }
@@ -2675,12 +2687,12 @@ const te = O`
2675
2687
  background: transparent;
2676
2688
  }
2677
2689
  `;
2678
- var zi = Object.defineProperty, Ui = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
2679
- for (var s = i > 1 ? void 0 : i ? Ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2690
+ var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
2691
+ for (var s = i > 1 ? void 0 : i ? Hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
2680
2692
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
2681
- return i && s && zi(e, t, s), s;
2693
+ return i && s && Di(e, t, s), s;
2682
2694
  };
2683
- let Y = class extends P {
2695
+ let K = class extends A {
2684
2696
  constructor() {
2685
2697
  super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
2686
2698
  }
@@ -2709,7 +2721,7 @@ let Y = class extends P {
2709
2721
  userId: n.userId,
2710
2722
  description: n.description,
2711
2723
  timestamp: new Date(n.createdAt).getTime(),
2712
- color: Y.TYPE_COLORS[n.type] ?? "#94a3b8"
2724
+ color: K.TYPE_COLORS[n.type] ?? "#94a3b8"
2713
2725
  };
2714
2726
  }
2715
2727
  getUserName(n) {
@@ -2726,18 +2738,18 @@ let Y = class extends P {
2726
2738
  );
2727
2739
  }
2728
2740
  render() {
2729
- return d`
2741
+ return u`
2730
2742
  <div class="panel">
2731
2743
  <div class="panel-header">
2732
2744
  <span class="panel-title">Activity</span>
2733
2745
  <button class="close-btn" @click=${this.fireClose} title="Close">
2734
- ${C(ge, 16)}
2746
+ ${C(be, 16)}
2735
2747
  </button>
2736
2748
  </div>
2737
2749
 
2738
2750
  <div class="panel-body pw-scrollable">
2739
- ${this.items.length === 0 ? d`<div class="empty">No activity yet</div>` : this.items.map(
2740
- (n) => d`
2751
+ ${this.items.length === 0 ? u`<div class="empty">No activity yet</div>` : this.items.map(
2752
+ (n) => u`
2741
2753
  <div class="activity-item">
2742
2754
  <div
2743
2755
  class="activity-dot"
@@ -2745,7 +2757,7 @@ let Y = class extends P {
2745
2757
  ></div>
2746
2758
  <div class="activity-content">
2747
2759
  <div class="activity-text">
2748
- ${n.userId ? d`<span class="activity-user"
2760
+ ${n.userId ? u`<span class="activity-user"
2749
2761
  >${this.getUserName(n.userId)}</span
2750
2762
  >
2751
2763
  ${n.description}` : n.description}
@@ -2762,11 +2774,11 @@ let Y = class extends P {
2762
2774
  `;
2763
2775
  }
2764
2776
  };
2765
- Y.styles = [
2766
- te,
2767
- be,
2768
- Se,
2769
- O`
2777
+ K.styles = [
2778
+ ie,
2779
+ ve,
2780
+ Pe,
2781
+ M`
2770
2782
  :host {
2771
2783
  display: block;
2772
2784
  }
@@ -2884,28 +2896,28 @@ Y.styles = [
2884
2896
  }
2885
2897
  `
2886
2898
  ];
2887
- Y.TYPE_COLORS = {
2899
+ K.TYPE_COLORS = {
2888
2900
  join: "#22c55e",
2889
2901
  leave: "#94a3b8",
2890
2902
  thread: "var(--pw-accent, #6366f1)",
2891
2903
  comment: "#3b82f6",
2892
2904
  resolve: "#22c55e"
2893
2905
  };
2894
- Ve([
2895
- v({ attribute: !1 })
2896
- ], Y.prototype, "client", 2);
2897
- Ve([
2898
- w()
2899
- ], Y.prototype, "items", 2);
2900
- Y = Ve([
2906
+ We([
2907
+ x({ attribute: !1 })
2908
+ ], K.prototype, "client", 2);
2909
+ We([
2910
+ $()
2911
+ ], K.prototype, "items", 2);
2912
+ K = We([
2901
2913
  L("pulse-widget-activity-panel")
2902
- ], Y);
2903
- const Di = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", at = "#6366f1", lt = "#e2e8f0", Hi = "#f8fafc", Ni = "#e2e8f0", ct = "#64748b", ye = 28, Fi = Array.from({ length: ye }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2904
- function dt(n) {
2914
+ ], K);
2915
+ const Ni = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", lt = "#6366f1", ct = "#e2e8f0", Bi = "#f8fafc", Fi = "#e2e8f0", dt = "#64748b", we = 28, qi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
2916
+ function ht(n) {
2905
2917
  const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
2906
2918
  return `${t}:${i.toString().padStart(2, "0")}`;
2907
2919
  }
2908
- class Le {
2920
+ class je {
2909
2921
  /**
2910
2922
  * Create and return a fully self-contained inline audio player element.
2911
2923
  *
@@ -2918,31 +2930,31 @@ class Le {
2918
2930
  let i = !1, s = t != null ? t / 1e3 : 0, o = 0;
2919
2931
  const r = document.createElement("audio");
2920
2932
  r.preload = "metadata", r.src = e;
2921
- const l = document.createElement("div");
2922
- Object.assign(l.style, {
2933
+ const a = document.createElement("div");
2934
+ Object.assign(a.style, {
2923
2935
  display: "inline-flex",
2924
2936
  alignItems: "center",
2925
2937
  gap: "10px",
2926
2938
  width: "220px",
2927
2939
  height: "44px",
2928
2940
  padding: "0 10px",
2929
- background: Hi,
2941
+ background: Bi,
2930
2942
  borderRadius: "12px",
2931
- border: `1px solid ${Ni}`,
2932
- fontFamily: Di,
2943
+ border: `1px solid ${Fi}`,
2944
+ fontFamily: Ni,
2933
2945
  fontSize: "11px",
2934
- color: ct,
2946
+ color: dt,
2935
2947
  userSelect: "none",
2936
2948
  boxSizing: "border-box"
2937
2949
  });
2938
- const a = document.createElement("button");
2939
- Object.assign(a.style, {
2950
+ const l = document.createElement("button");
2951
+ Object.assign(l.style, {
2940
2952
  width: "28px",
2941
2953
  height: "28px",
2942
2954
  minWidth: "28px",
2943
2955
  borderRadius: "50%",
2944
2956
  border: "none",
2945
- background: at,
2957
+ background: lt,
2946
2958
  cursor: "pointer",
2947
2959
  display: "flex",
2948
2960
  alignItems: "center",
@@ -2951,27 +2963,27 @@ class Le {
2951
2963
  outline: "none",
2952
2964
  flexShrink: "0"
2953
2965
  });
2954
- const c = document.createElement("span");
2955
- Object.assign(c.style, {
2966
+ const d = document.createElement("span");
2967
+ Object.assign(d.style, {
2956
2968
  display: "block",
2957
2969
  width: "10px",
2958
2970
  height: "12px",
2959
2971
  lineHeight: "0"
2960
2972
  });
2961
- function h() {
2962
- c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2973
+ function c() {
2974
+ d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2963
2975
  <path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
2964
2976
  </svg>`;
2965
2977
  }
2966
- function p() {
2967
- c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2978
+ function h() {
2979
+ d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2968
2980
  <rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
2969
2981
  <rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
2970
2982
  </svg>`;
2971
2983
  }
2972
- h(), a.appendChild(c);
2973
- const u = document.createElement("div");
2974
- Object.assign(u.style, {
2984
+ c(), l.appendChild(d);
2985
+ const p = document.createElement("div");
2986
+ Object.assign(p.style, {
2975
2987
  flex: "1",
2976
2988
  display: "flex",
2977
2989
  flexDirection: "column",
@@ -2979,69 +2991,69 @@ class Le {
2979
2991
  overflow: "hidden",
2980
2992
  minWidth: "0"
2981
2993
  });
2982
- const f = document.createElement("div");
2983
- Object.assign(f.style, {
2994
+ const m = document.createElement("div");
2995
+ Object.assign(m.style, {
2984
2996
  display: "flex",
2985
2997
  alignItems: "center",
2986
2998
  gap: "1.5px",
2987
2999
  height: "22px",
2988
3000
  cursor: "pointer"
2989
3001
  });
2990
- const m = [];
2991
- for (let E = 0; E < ye; E++) {
2992
- const M = document.createElement("div"), k = Math.round(Fi[E] * 20);
2993
- Object.assign(M.style, {
3002
+ const g = [];
3003
+ for (let E = 0; E < we; E++) {
3004
+ const I = document.createElement("div"), z = Math.round(qi[E] * 20);
3005
+ Object.assign(I.style, {
2994
3006
  flex: "1",
2995
- height: `${Math.max(3, k)}px`,
3007
+ height: `${Math.max(3, z)}px`,
2996
3008
  borderRadius: "1px",
2997
- background: lt,
3009
+ background: ct,
2998
3010
  transition: "background 0.1s ease",
2999
3011
  minWidth: "0"
3000
- }), m.push(M), f.appendChild(M);
3012
+ }), g.push(I), m.appendChild(I);
3001
3013
  }
3002
- const x = document.createElement("div");
3003
- Object.assign(x.style, {
3014
+ const y = document.createElement("div");
3015
+ Object.assign(y.style, {
3004
3016
  fontSize: "10px",
3005
- color: ct,
3017
+ color: dt,
3006
3018
  whiteSpace: "nowrap",
3007
3019
  lineHeight: "1"
3008
3020
  });
3009
- function b() {
3010
- const E = dt(o), M = dt(s);
3011
- x.textContent = `${E} / ${M}`;
3021
+ function v() {
3022
+ const E = ht(o), I = ht(s);
3023
+ y.textContent = `${E} / ${I}`;
3012
3024
  }
3013
- b(), u.appendChild(f), u.appendChild(x), l.appendChild(a), l.appendChild(u);
3014
- function y() {
3015
- const E = s > 0 ? o / s : 0, M = Math.floor(E * ye);
3016
- for (let k = 0; k < ye; k++)
3017
- m[k].style.background = k <= M ? at : lt;
3025
+ v(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
3026
+ function w() {
3027
+ const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
3028
+ for (let z = 0; z < we; z++)
3029
+ g[z].style.background = z <= I ? lt : ct;
3018
3030
  }
3019
- return f.addEventListener("click", (E) => {
3031
+ return m.addEventListener("click", (E) => {
3020
3032
  if (s <= 0) return;
3021
- const M = f.getBoundingClientRect(), k = Math.min(
3033
+ const I = m.getBoundingClientRect(), z = Math.min(
3022
3034
  1,
3023
- Math.max(0, (E.clientX - M.left) / M.width)
3035
+ Math.max(0, (E.clientX - I.left) / I.width)
3024
3036
  );
3025
- r.currentTime = k * s, o = r.currentTime, y(), b();
3026
- }), a.addEventListener("click", () => {
3037
+ r.currentTime = z * s, o = r.currentTime, w(), v();
3038
+ }), l.addEventListener("click", () => {
3027
3039
  i ? r.pause() : r.play().catch(() => {
3028
3040
  });
3029
3041
  }), r.addEventListener("play", () => {
3030
- i = !0, p();
3042
+ i = !0, h();
3031
3043
  }), r.addEventListener("pause", () => {
3032
- i = !1, h();
3044
+ i = !1, c();
3033
3045
  }), r.addEventListener("ended", () => {
3034
- i = !1, h(), o = 0, y(), b();
3046
+ i = !1, c(), o = 0, w(), v();
3035
3047
  }), r.addEventListener("timeupdate", () => {
3036
- o = r.currentTime, y(), b();
3048
+ o = r.currentTime, w(), v();
3037
3049
  }), r.addEventListener("loadedmetadata", () => {
3038
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3050
+ r.duration && isFinite(r.duration) && (s = r.duration, v());
3039
3051
  }), r.addEventListener("durationchange", () => {
3040
- r.duration && isFinite(r.duration) && (s = r.duration, b());
3041
- }), l;
3052
+ r.duration && isFinite(r.duration) && (s = r.duration, v());
3053
+ }), a;
3042
3054
  }
3043
3055
  }
3044
- class je {
3056
+ class ze {
3045
3057
  constructor() {
3046
3058
  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 = () => {
3047
3059
  this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
@@ -3058,16 +3070,16 @@ class je {
3058
3070
  const i = this.detectMimeType(), s = {};
3059
3071
  i && (s.mimeType = i), this.recorder = new MediaRecorder(this.stream, s);
3060
3072
  const o = [];
3061
- this.recorder.ondataavailable = (l) => {
3062
- l.data.size > 0 && o.push(l.data);
3073
+ this.recorder.ondataavailable = (a) => {
3074
+ a.data.size > 0 && o.push(a.data);
3063
3075
  }, this.buildUI(e);
3064
- const r = new Promise((l) => {
3065
- this.resolve = l;
3076
+ const r = new Promise((a) => {
3077
+ this.resolve = a;
3066
3078
  });
3067
3079
  return this.recorder.onstop = () => {
3068
- var c, h;
3069
- const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(o, { type: l });
3070
- (h = this.resolve) == null || h.call(this, a), this.resolve = null, this.cleanupResources();
3080
+ var d, c;
3081
+ const a = ((d = this.recorder) == null ? void 0 : d.mimeType) || i || "audio/webm", l = new Blob(o, { type: a });
3082
+ (c = this.resolve) == null || c.call(this, l), this.resolve = null, this.cleanupResources();
3071
3083
  }, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
3072
3084
  this.stopRecording();
3073
3085
  }, this.maxDuration), this.animate(), r;
@@ -3170,10 +3182,10 @@ class je {
3170
3182
  if (!e) return;
3171
3183
  const t = this.canvas.width, i = this.canvas.height, s = this.analyser.frequencyBinCount, o = new Uint8Array(s);
3172
3184
  this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
3173
- const r = s, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
3174
- for (let c = 0; c < r; c++) {
3175
- const h = o[c] / 255, p = Math.max(2, h * i * 0.85), u = c * (l + a), f = (i - p) / 2, m = 0.4 + h * 0.6;
3176
- e.fillStyle = `rgba(99, 102, 241, ${m})`, e.beginPath(), e.roundRect(u, f, l, p, 1), e.fill();
3185
+ const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
3186
+ for (let d = 0; d < r; d++) {
3187
+ 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;
3188
+ e.fillStyle = `rgba(99, 102, 241, ${g})`, e.beginPath(), e.roundRect(p, m, a, h, 1), e.fill();
3177
3189
  }
3178
3190
  }
3179
3191
  updateTimer() {
@@ -3191,7 +3203,7 @@ class je {
3191
3203
  this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
3192
3204
  }
3193
3205
  }
3194
- const ht = 80, Bi = "#e2e8f0", qi = `
3206
+ const Vi = 180, Wi = 120, Xi = "#e2e8f0", Yi = `
3195
3207
  <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
3196
3208
  <circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
3197
3209
  <polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
@@ -3200,18 +3212,18 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3200
3212
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3201
3213
  <line x1="23" y1="9" x2="17" y2="15"/>
3202
3214
  <line x1="17" y1="9" x2="23" y2="15"/>
3203
- </svg>`, Vi = `
3215
+ </svg>`, Ki = `
3204
3216
  <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">
3205
3217
  <polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
3206
3218
  <path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
3207
3219
  <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
3208
- </svg>`, Wi = `
3220
+ </svg>`, Gi = `
3209
3221
  <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">
3210
3222
  <polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
3211
3223
  <polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
3212
- </svg>`, _ = class _ {
3224
+ </svg>`, S = class S {
3213
3225
  /**
3214
- * Renders an inline circular video player and returns the root container.
3226
+ * Renders an inline rectangular video player and returns the root container.
3215
3227
  * @param url - Video source URL
3216
3228
  * @param posterUrl - Optional poster/thumbnail image URL
3217
3229
  */
@@ -3221,10 +3233,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3221
3233
  Object.assign(o.style, {
3222
3234
  position: "relative",
3223
3235
  display: "inline-block",
3224
- width: `${ht}px`,
3225
- height: `${ht}px`,
3226
- borderRadius: "50%",
3227
- border: `2px solid ${Bi}`,
3236
+ width: `${Vi}px`,
3237
+ height: `${Wi}px`,
3238
+ borderRadius: "8px",
3239
+ border: `1px solid ${Xi}`,
3228
3240
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
3229
3241
  overflow: "hidden",
3230
3242
  cursor: "pointer",
@@ -3238,10 +3250,10 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3238
3250
  height: "100%",
3239
3251
  objectFit: "cover",
3240
3252
  display: "block",
3241
- borderRadius: "50%"
3253
+ borderRadius: "8px"
3242
3254
  }), r.src = e, r.loop = !0, r.muted = !0, r.playsInline = !0, r.preload = "metadata", t && (r.poster = t), o.appendChild(r);
3243
- const l = document.createElement("div");
3244
- Object.assign(l.style, {
3255
+ const a = document.createElement("div");
3256
+ Object.assign(a.style, {
3245
3257
  position: "absolute",
3246
3258
  top: "0",
3247
3259
  left: "0",
@@ -3250,13 +3262,13 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3250
3262
  display: "flex",
3251
3263
  alignItems: "center",
3252
3264
  justifyContent: "center",
3253
- borderRadius: "50%",
3265
+ borderRadius: "8px",
3254
3266
  transition: "opacity 0.25s ease",
3255
3267
  opacity: "1",
3256
3268
  pointerEvents: "none"
3257
- }), l.innerHTML = qi, o.appendChild(l);
3258
- const a = document.createElement("div");
3259
- Object.assign(a.style, {
3269
+ }), a.innerHTML = Yi, o.appendChild(a);
3270
+ const l = document.createElement("div");
3271
+ Object.assign(l.style, {
3260
3272
  position: "absolute",
3261
3273
  bottom: "2px",
3262
3274
  right: "2px",
@@ -3269,9 +3281,9 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3269
3281
  justifyContent: "center",
3270
3282
  pointerEvents: "none",
3271
3283
  transition: "opacity 0.2s ease"
3272
- }), a.innerHTML = pt, o.appendChild(a);
3273
- const c = document.createElement("div");
3274
- Object.assign(c.style, {
3284
+ }), l.innerHTML = pt, o.appendChild(l);
3285
+ const d = document.createElement("div");
3286
+ Object.assign(d.style, {
3275
3287
  position: "absolute",
3276
3288
  top: "2px",
3277
3289
  right: "2px",
@@ -3285,28 +3297,28 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3285
3297
  cursor: "pointer",
3286
3298
  pointerEvents: "auto",
3287
3299
  transition: "opacity 0.2s ease, background 0.15s ease"
3288
- }), c.innerHTML = Wi, c.title = "Fullscreen", c.addEventListener("mouseenter", () => {
3289
- c.style.background = "rgba(0,0,0,0.7)";
3290
- }), c.addEventListener("mouseleave", () => {
3291
- c.style.background = "rgba(0,0,0,0.45)";
3292
- }), c.addEventListener("click", (u) => {
3293
- u.stopPropagation(), _.openFullscreen(e, t);
3294
- }), o.appendChild(c);
3295
- function h() {
3296
- l.style.opacity = i ? "0" : "1";
3300
+ }), d.innerHTML = Gi, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
3301
+ d.style.background = "rgba(0,0,0,0.7)";
3302
+ }), d.addEventListener("mouseleave", () => {
3303
+ d.style.background = "rgba(0,0,0,0.45)";
3304
+ }), d.addEventListener("click", (p) => {
3305
+ p.stopPropagation(), S.openFullscreen(e, t);
3306
+ }), o.appendChild(d);
3307
+ function c() {
3308
+ a.style.opacity = i ? "0" : "1";
3297
3309
  }
3298
- function p() {
3299
- a.style.display = i ? "flex" : "none", a.innerHTML = s ? pt : Vi, c.style.display = i ? "flex" : "none";
3310
+ function h() {
3311
+ l.style.display = i ? "flex" : "none", l.innerHTML = s ? pt : Ki, d.style.display = i ? "flex" : "none";
3300
3312
  }
3301
- return o.addEventListener("click", (u) => {
3302
- 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(() => {
3303
- }), i = !0), h(), p();
3313
+ return o.addEventListener("click", (p) => {
3314
+ 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(() => {
3315
+ }), i = !0), c(), h();
3304
3316
  }), r.addEventListener("pause", () => {
3305
- i && (i = !1, s = !0, r.muted = !0, h(), p());
3317
+ i && (i = !1, s = !0, r.muted = !0, c(), h());
3306
3318
  }), o;
3307
3319
  }
3308
3320
  static openFullscreen(e, t) {
3309
- _.closeFullscreen();
3321
+ S.closeFullscreen();
3310
3322
  const i = document.createElement("div");
3311
3323
  Object.assign(i.style, {
3312
3324
  position: "fixed",
@@ -3347,8 +3359,8 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3347
3359
  s.style.background = "rgba(255,255,255,0.3)";
3348
3360
  }), s.addEventListener("mouseleave", () => {
3349
3361
  s.style.background = "rgba(255,255,255,0.15)";
3350
- }), s.addEventListener("click", (l) => {
3351
- l.stopPropagation(), _.closeFullscreen();
3362
+ }), s.addEventListener("click", (a) => {
3363
+ a.stopPropagation(), S.closeFullscreen();
3352
3364
  });
3353
3365
  const o = document.createElement("video");
3354
3366
  Object.assign(o.style, {
@@ -3357,25 +3369,25 @@ const ht = 80, Bi = "#e2e8f0", qi = `
3357
3369
  borderRadius: "8px",
3358
3370
  outline: "none",
3359
3371
  cursor: "default"
3360
- }), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (l) => l.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => _.closeFullscreen());
3361
- const r = (l) => {
3362
- l.key === "Escape" && _.closeFullscreen();
3372
+ }), 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());
3373
+ const r = (a) => {
3374
+ a.key === "Escape" && S.closeFullscreen();
3363
3375
  };
3364
- document.addEventListener("keydown", r), _.fullscreenOverlay = i, _.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3376
+ document.addEventListener("keydown", r), S.fullscreenOverlay = i, S.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
3365
3377
  i.style.opacity = "1";
3366
3378
  });
3367
3379
  }
3368
3380
  static closeFullscreen() {
3369
- if (!_.fullscreenOverlay) return;
3370
- const e = _.fullscreenOverlay;
3371
- _.fullscreenKeyHandler && (document.removeEventListener("keydown", _.fullscreenKeyHandler), _.fullscreenKeyHandler = null);
3381
+ if (!S.fullscreenOverlay) return;
3382
+ const e = S.fullscreenOverlay;
3383
+ S.fullscreenKeyHandler && (document.removeEventListener("keydown", S.fullscreenKeyHandler), S.fullscreenKeyHandler = null);
3372
3384
  const t = e.querySelector("video");
3373
- t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), _.fullscreenOverlay = null;
3385
+ t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), S.fullscreenOverlay = null;
3374
3386
  }
3375
3387
  };
3376
- _.fullscreenOverlay = null, _.fullscreenKeyHandler = null;
3377
- let Ee = _;
3378
- const ut = 60, Xi = `
3388
+ S.fullscreenOverlay = null, S.fullscreenKeyHandler = null;
3389
+ let Ce = S;
3390
+ const ut = 60, Ji = `
3379
3391
  .vr-overlay {
3380
3392
  display: flex;
3381
3393
  flex-direction: column;
@@ -3485,11 +3497,11 @@ const ut = 60, Xi = `
3485
3497
  function ft(n) {
3486
3498
  return n.toString().padStart(2, "0");
3487
3499
  }
3488
- function Yi(n) {
3500
+ function Zi(n) {
3489
3501
  const e = Math.floor(n / 60), t = n % 60;
3490
3502
  return `${ft(e)}:${ft(t)}`;
3491
3503
  }
3492
- function Ki() {
3504
+ function Qi() {
3493
3505
  const n = [
3494
3506
  "video/webm;codecs=vp9,opus",
3495
3507
  "video/webm;codecs=vp8,opus",
@@ -3500,7 +3512,7 @@ function Ki() {
3500
3512
  if (MediaRecorder.isTypeSupported(e)) return e;
3501
3513
  return "";
3502
3514
  }
3503
- function Gi(n) {
3515
+ function es(n) {
3504
3516
  return new Promise((e, t) => {
3505
3517
  const i = URL.createObjectURL(n), s = document.createElement("video");
3506
3518
  s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
@@ -3508,8 +3520,8 @@ function Gi(n) {
3508
3520
  }), s.addEventListener("seeked", () => {
3509
3521
  const o = document.createElement("canvas");
3510
3522
  o.width = s.videoWidth || 240, o.height = s.videoHeight || 240, o.getContext("2d").drawImage(s, 0, 0, o.width, o.height), URL.revokeObjectURL(i), o.toBlob(
3511
- (l) => {
3512
- l ? e(l) : t(new Error("Failed to generate poster frame"));
3523
+ (a) => {
3524
+ a ? e(a) : t(new Error("Failed to generate poster frame"));
3513
3525
  },
3514
3526
  "image/jpeg",
3515
3527
  0.85
@@ -3519,7 +3531,7 @@ function Gi(n) {
3519
3531
  }), s.load();
3520
3532
  });
3521
3533
  }
3522
- class ze {
3534
+ class Ue {
3523
3535
  constructor() {
3524
3536
  this.recording = !1, this.container = null, this.stream = null, this.mediaRecorder = null, this.chunks = [], this.timerInterval = null, this.elapsed = 0, this.resolvePromise = null, this.root = null, this.styleEl = null, this.videoEl = null, this.timerEl = null;
3525
3537
  }
@@ -3536,7 +3548,7 @@ class ze {
3536
3548
  }
3537
3549
  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(() => {
3538
3550
  }));
3539
- const i = Ki(), s = {};
3551
+ const i = Qi(), s = {};
3540
3552
  i && (s.mimeType = i);
3541
3553
  const o = new MediaRecorder(t, s);
3542
3554
  return this.mediaRecorder = o, o.ondataavailable = (r) => {
@@ -3561,7 +3573,7 @@ class ze {
3561
3573
  }
3562
3574
  // ── Private ──
3563
3575
  buildUI(e) {
3564
- this.styleEl = document.createElement("style"), this.styleEl.textContent = Xi, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3576
+ this.styleEl = document.createElement("style"), this.styleEl.textContent = Ji, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
3565
3577
  const t = document.createElement("div");
3566
3578
  t.className = "vr-circle-wrapper";
3567
3579
  const i = document.createElement("div");
@@ -3572,24 +3584,24 @@ class ze {
3572
3584
  o.className = "vr-actions";
3573
3585
  const r = document.createElement("button");
3574
3586
  r.className = "vr-btn vr-btn-stop", r.textContent = "Stop", r.addEventListener("click", () => this.stopRecording()), o.appendChild(r);
3575
- const l = document.createElement("button");
3576
- l.className = "vr-btn vr-btn-cancel", l.textContent = "Cancel", l.addEventListener("click", () => this.cancelRecording()), o.appendChild(l), this.root.appendChild(o), e.appendChild(this.root);
3587
+ const a = document.createElement("button");
3588
+ a.className = "vr-btn vr-btn-cancel", a.textContent = "Cancel", a.addEventListener("click", () => this.cancelRecording()), o.appendChild(a), this.root.appendChild(o), e.appendChild(this.root);
3577
3589
  }
3578
3590
  updateTimer() {
3579
3591
  if (!this.timerEl) return;
3580
3592
  const e = ut - this.elapsed;
3581
- this.timerEl.textContent = Yi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3593
+ this.timerEl.textContent = Zi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
3582
3594
  }
3583
3595
  async handleRecordingComplete() {
3584
3596
  var s, o;
3585
3597
  const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
3586
3598
  let i;
3587
3599
  try {
3588
- i = await Gi(t);
3600
+ i = await es(t);
3589
3601
  } catch {
3590
3602
  const r = document.createElement("canvas");
3591
- r.width = 1, r.height = 1, i = await new Promise((l) => {
3592
- r.toBlob((a) => l(a), "image/png");
3603
+ r.width = 1, r.height = 1, i = await new Promise((a) => {
3604
+ r.toBlob((l) => a(l), "image/png");
3593
3605
  });
3594
3606
  }
3595
3607
  this.cleanup(), (o = this.resolvePromise) == null || o.call(this, { blob: t, posterBlob: i }), this.resolvePromise = null;
@@ -3608,12 +3620,35 @@ class ze {
3608
3620
  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;
3609
3621
  }
3610
3622
  }
3611
- const S = class S {
3612
- /** Opens a fullscreen lightbox overlay showing the image. */
3613
- static open(e) {
3614
- S.close();
3615
- const t = document.createElement("div");
3616
- t.id = "pulse-widget-lightbox", Object.assign(t.style, {
3623
+ const mt = {
3624
+ position: "absolute",
3625
+ top: "50%",
3626
+ transform: "translateY(-50%)",
3627
+ width: "44px",
3628
+ height: "44px",
3629
+ border: "none",
3630
+ borderRadius: "50%",
3631
+ background: "rgba(255,255,255,0.15)",
3632
+ color: "#fff",
3633
+ fontSize: "22px",
3634
+ cursor: "pointer",
3635
+ padding: "0",
3636
+ display: "flex",
3637
+ alignItems: "center",
3638
+ justifyContent: "center",
3639
+ transition: "background 150ms ease",
3640
+ zIndex: "1"
3641
+ }, f = class f {
3642
+ /**
3643
+ * Opens a fullscreen lightbox overlay.
3644
+ * @param imageUrl - Single image URL (backwards-compatible)
3645
+ * @param allUrls - Optional array of all image URLs for navigation
3646
+ * @param startIndex - Index in allUrls to start at (default 0)
3647
+ */
3648
+ static open(e, t, i) {
3649
+ f.close(), f.urls = t && t.length > 1 ? t : [e], f.currentIndex = i ?? 0;
3650
+ const s = f.urls.length > 1, o = document.createElement("div");
3651
+ o.id = "pulse-widget-lightbox", Object.assign(o.style, {
3617
3652
  position: "fixed",
3618
3653
  top: "0",
3619
3654
  left: "0",
@@ -3629,8 +3664,8 @@ const S = class S {
3629
3664
  cursor: "pointer",
3630
3665
  fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
3631
3666
  });
3632
- const i = document.createElement("button");
3633
- i.textContent = "×", Object.assign(i.style, {
3667
+ const r = document.createElement("button");
3668
+ r.textContent = "×", Object.assign(r.style, {
3634
3669
  position: "absolute",
3635
3670
  top: "16px",
3636
3671
  right: "16px",
@@ -3641,54 +3676,86 @@ const S = class S {
3641
3676
  background: "rgba(255,255,255,0.15)",
3642
3677
  color: "#fff",
3643
3678
  fontSize: "24px",
3644
- lineHeight: "40px",
3645
- textAlign: "center",
3646
3679
  cursor: "pointer",
3647
3680
  padding: "0",
3648
- fontFamily: "inherit",
3649
3681
  display: "flex",
3650
3682
  alignItems: "center",
3651
3683
  justifyContent: "center",
3652
- transition: "background 150ms ease"
3653
- }), i.addEventListener("mouseenter", () => {
3654
- i.style.background = "rgba(255,255,255,0.3)";
3655
- }), i.addEventListener("mouseleave", () => {
3656
- i.style.background = "rgba(255,255,255,0.15)";
3657
- }), i.addEventListener("click", (r) => {
3658
- r.stopPropagation(), S.close();
3659
- });
3660
- const s = document.createElement("img");
3661
- s.src = e, s.alt = "Lightbox image", Object.assign(s.style, {
3684
+ transition: "background 150ms ease",
3685
+ zIndex: "1"
3686
+ }), r.addEventListener("mouseenter", () => {
3687
+ r.style.background = "rgba(255,255,255,0.3)";
3688
+ }), r.addEventListener("mouseleave", () => {
3689
+ r.style.background = "rgba(255,255,255,0.15)";
3690
+ }), r.addEventListener("click", (d) => {
3691
+ d.stopPropagation(), f.close();
3692
+ }), o.appendChild(r);
3693
+ const a = document.createElement("img");
3694
+ if (a.src = f.urls[f.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
3662
3695
  maxWidth: "90vw",
3663
- maxHeight: "90vh",
3696
+ maxHeight: "85vh",
3664
3697
  borderRadius: "8px",
3665
3698
  objectFit: "contain",
3666
3699
  cursor: "default",
3667
- userSelect: "none"
3668
- }), s.addEventListener("click", (r) => {
3669
- r.stopPropagation();
3670
- }), t.appendChild(i), t.appendChild(s), t.addEventListener("click", () => {
3671
- S.close();
3672
- });
3673
- const o = (r) => {
3674
- r.key === "Escape" && S.close();
3700
+ userSelect: "none",
3701
+ transition: "opacity 150ms ease"
3702
+ }), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), f.imgEl = a, s) {
3703
+ const d = document.createElement("button");
3704
+ 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, { ...mt, left: "16px" }), d.addEventListener("mouseenter", () => {
3705
+ d.style.background = "rgba(255,255,255,0.3)";
3706
+ }), d.addEventListener("mouseleave", () => {
3707
+ d.style.background = "rgba(255,255,255,0.15)";
3708
+ }), d.addEventListener("click", (p) => {
3709
+ p.stopPropagation(), f.navigate(-1);
3710
+ }), o.appendChild(d), f.prevBtn = d;
3711
+ const c = document.createElement("button");
3712
+ 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, { ...mt, right: "16px" }), c.addEventListener("mouseenter", () => {
3713
+ c.style.background = "rgba(255,255,255,0.3)";
3714
+ }), c.addEventListener("mouseleave", () => {
3715
+ c.style.background = "rgba(255,255,255,0.15)";
3716
+ }), c.addEventListener("click", (p) => {
3717
+ p.stopPropagation(), f.navigate(1);
3718
+ }), o.appendChild(c), f.nextBtn = c;
3719
+ const h = document.createElement("span");
3720
+ Object.assign(h.style, {
3721
+ position: "absolute",
3722
+ bottom: "20px",
3723
+ left: "50%",
3724
+ transform: "translateX(-50%)",
3725
+ color: "rgba(255,255,255,0.7)",
3726
+ fontSize: "13px",
3727
+ fontWeight: "500",
3728
+ pointerEvents: "none"
3729
+ }), o.appendChild(h), f.counterEl = h, f.updateNav();
3730
+ }
3731
+ o.addEventListener("click", () => f.close());
3732
+ const l = (d) => {
3733
+ d.key === "Escape" && f.close(), s && d.key === "ArrowLeft" && f.navigate(-1), s && d.key === "ArrowRight" && f.navigate(1);
3675
3734
  };
3676
- document.addEventListener("keydown", o), S.overlay = t, S.onKeyDown = o, document.body.appendChild(t), requestAnimationFrame(() => {
3677
- t.style.opacity = "1";
3735
+ document.addEventListener("keydown", l), f.overlay = o, f.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
3736
+ o.style.opacity = "1";
3678
3737
  });
3679
3738
  }
3739
+ static navigate(e) {
3740
+ const t = f.urls.length;
3741
+ f.currentIndex = (f.currentIndex + e + t) % t, f.imgEl && (f.imgEl.style.opacity = "0", setTimeout(() => {
3742
+ f.imgEl && (f.imgEl.src = f.urls[f.currentIndex], f.imgEl.style.opacity = "1");
3743
+ }, 100)), f.updateNav();
3744
+ }
3745
+ static updateNav() {
3746
+ const e = f.currentIndex, t = f.urls.length;
3747
+ f.counterEl && (f.counterEl.textContent = `${e + 1} / ${t}`);
3748
+ }
3680
3749
  /** Closes the lightbox if open. */
3681
3750
  static close() {
3682
- if (!S.overlay) return;
3683
- const e = S.overlay;
3684
- S.onKeyDown && (document.removeEventListener("keydown", S.onKeyDown), S.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => {
3685
- e.remove();
3686
- }), S.overlay = null;
3751
+ if (!f.overlay) return;
3752
+ const e = f.overlay;
3753
+ 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;
3687
3754
  }
3688
3755
  };
3689
- S.overlay = null, S.onKeyDown = null;
3690
- let Ce = S;
3691
- class oe {
3756
+ f.overlay = null, f.onKeyDown = null, f.urls = [], f.currentIndex = 0, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null;
3757
+ let Te = f;
3758
+ class re {
3692
3759
  constructor(e) {
3693
3760
  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);
3694
3761
  }
@@ -3702,19 +3769,19 @@ class oe {
3702
3769
  const i = () => {
3703
3770
  o(), t(null);
3704
3771
  }, s = async () => {
3705
- var l;
3772
+ var a;
3706
3773
  o();
3707
- const r = (l = this.input.files) == null ? void 0 : l[0];
3774
+ const r = (a = this.input.files) == null ? void 0 : a[0];
3708
3775
  if (!r) {
3709
3776
  t(null);
3710
3777
  return;
3711
3778
  }
3712
3779
  this.uploading = !0;
3713
3780
  try {
3714
- const a = await this.client.uploadFile(r);
3715
- t(a);
3716
- } catch (a) {
3717
- console.error("[Pulse] File upload failed:", a), t(null);
3781
+ const l = await this.client.uploadFile(r);
3782
+ t(l);
3783
+ } catch (l) {
3784
+ console.error("[Pulse] File upload failed:", l), t(null);
3718
3785
  } finally {
3719
3786
  this.uploading = !1;
3720
3787
  }
@@ -3735,24 +3802,24 @@ class oe {
3735
3802
  r(), i([]);
3736
3803
  }, o = async () => {
3737
3804
  r();
3738
- const l = this.input.files;
3739
- if (!l || l.length === 0) {
3805
+ const a = this.input.files;
3806
+ if (!a || a.length === 0) {
3740
3807
  i([]);
3741
3808
  return;
3742
3809
  }
3743
- const a = Array.from(l).slice(0, t);
3810
+ const l = Array.from(a).slice(0, t);
3744
3811
  this.uploading = !0;
3745
3812
  try {
3746
- const c = await Promise.all(
3747
- a.map(async (h) => {
3813
+ const d = await Promise.all(
3814
+ l.map(async (c) => {
3748
3815
  try {
3749
- return await this.client.uploadFile(h);
3750
- } catch (p) {
3751
- return console.error("[Pulse] File upload failed:", p), null;
3816
+ return await this.client.uploadFile(c);
3817
+ } catch (h) {
3818
+ return console.error("[Pulse] File upload failed:", h), null;
3752
3819
  }
3753
3820
  })
3754
3821
  );
3755
- i(c.filter((h) => h !== null));
3822
+ i(d.filter((c) => c !== null));
3756
3823
  } finally {
3757
3824
  this.uploading = !1, this.input.multiple = !1;
3758
3825
  }
@@ -3782,7 +3849,7 @@ class oe {
3782
3849
  this.input.remove();
3783
3850
  }
3784
3851
  }
3785
- const Zi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], ve = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", Ji = '<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>', Qi = '<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>', mt = `<button class="pulse-close-btn" style="
3852
+ const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", is = '<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>', ss = '<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>', gt = `<button class="pulse-close-btn" style="
3786
3853
  border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
3787
3854
  border-radius:6px;display:flex;align-items:center;justify-content:center;
3788
3855
  transition:all 0.15s;flex-shrink:0;
@@ -3790,7 +3857,7 @@ const Zi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], ve = "-apple-syst
3790
3857
  onmouseout="this.style.background='none';this.style.color='#94a3b8'">
3791
3858
  <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>
3792
3859
  </button>`;
3793
- class es {
3860
+ class ns {
3794
3861
  constructor(e, t = {}) {
3795
3862
  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 = () => {
3796
3863
  this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
@@ -3813,13 +3880,13 @@ class es {
3813
3880
  y: i.clientY / o,
3814
3881
  scrollX: window.scrollX,
3815
3882
  scrollY: window.scrollY
3816
- }, l = this.overlay.style.pointerEvents;
3883
+ }, a = this.overlay.style.pointerEvents;
3817
3884
  this.overlay.style.pointerEvents = "none";
3818
- const a = document.elementFromPoint(i.clientX, i.clientY);
3819
- if (this.overlay.style.pointerEvents = l, a) {
3820
- r.selector = this.getSelector(a);
3821
- const c = a.getBoundingClientRect();
3822
- c.width > 0 && c.height > 0 && (r.elementOffsetX = (i.clientX - c.left) / c.width, r.elementOffsetY = (i.clientY - c.top) / c.height);
3885
+ const l = document.elementFromPoint(i.clientX, i.clientY);
3886
+ if (this.overlay.style.pointerEvents = a, l) {
3887
+ r.selector = this.getSelector(l);
3888
+ const d = l.getBoundingClientRect();
3889
+ d.width > 0 && d.height > 0 && (r.elementOffsetX = (i.clientX - d.left) / d.width, r.elementOffsetY = (i.clientY - d.top) / d.height);
3823
3890
  }
3824
3891
  this.showPinForm(i.clientX, i.clientY, r);
3825
3892
  }, this.pickerEl = null, this.client = e, this.onPinModeExit = t.onPinModeExit, this.init();
@@ -3897,14 +3964,14 @@ class es {
3897
3964
  t.unshift(`#${i.id}`);
3898
3965
  break;
3899
3966
  }
3900
- const s = i.tagName.toLowerCase(), o = [...i.classList].filter((a) => !a.startsWith("pulse-")).slice(0, 2);
3967
+ const s = i.tagName.toLowerCase(), o = [...i.classList].filter((l) => !l.startsWith("pulse-")).slice(0, 2);
3901
3968
  let r = o.length > 0 ? `${s}.${o.join(".")}` : s;
3902
- const l = i.parentElement;
3903
- if (l) {
3904
- const a = [...l.children].filter((c) => c.tagName === i.tagName);
3905
- if (a.length > 1) {
3906
- const c = a.indexOf(i) + 1;
3907
- r += `:nth-child(${c})`;
3969
+ const a = i.parentElement;
3970
+ if (a) {
3971
+ const l = [...a.children].filter((d) => d.tagName === i.tagName);
3972
+ if (l.length > 1) {
3973
+ const d = l.indexOf(i) + 1;
3974
+ r += `:nth-child(${d})`;
3908
3975
  }
3909
3976
  }
3910
3977
  if (t.unshift(r), i = i.parentElement, t.length >= 4) break;
@@ -3914,11 +3981,11 @@ class es {
3914
3981
  showPinForm(e, t, i) {
3915
3982
  this.form = document.createElement("div");
3916
3983
  const s = Math.min(280, window.innerWidth - 32), o = 120;
3917
- let r = e + 16, l = t - 10;
3918
- r + s > window.innerWidth - 16 && (r = e - s - 16), l + o > window.innerHeight - 16 && (l = window.innerHeight - o - 16), l < 16 && (l = 16), Object.assign(this.form.style, {
3984
+ let r = e + 16, a = t - 10;
3985
+ r + s > window.innerWidth - 16 && (r = e - s - 16), a + o > window.innerHeight - 16 && (a = window.innerHeight - o - 16), a < 16 && (a = 16), Object.assign(this.form.style, {
3919
3986
  position: "fixed",
3920
3987
  left: `${r}px`,
3921
- top: `${l}px`,
3988
+ top: `${a}px`,
3922
3989
  width: `${s}px`,
3923
3990
  zIndex: "10001",
3924
3991
  background: "#fff",
@@ -3926,11 +3993,11 @@ class es {
3926
3993
  boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
3927
3994
  border: "1px solid #e2e8f0",
3928
3995
  padding: "14px",
3929
- fontFamily: ve
3996
+ fontFamily: xe
3930
3997
  }), this.form.innerHTML = `
3931
3998
  <div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
3932
3999
  <span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
3933
- ${mt}
4000
+ ${gt}
3934
4001
  </div>
3935
4002
  <textarea
3936
4003
  placeholder="Write a comment..."
@@ -3962,13 +4029,13 @@ class es {
3962
4029
  </div>
3963
4030
  <div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
3964
4031
  `;
3965
- const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), h = this.form.querySelector(".pin-submit");
3966
- c.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new oe(this.client));
3967
- const p = this.form.querySelector(".pin-attachments-preview"), u = (m, x) => {
3968
- const b = document.createElement("div");
3969
- Object.assign(b.style, { position: "relative", display: "inline-block" }), b.appendChild(x);
3970
- const y = document.createElement("button");
3971
- y.innerHTML = "×", Object.assign(y.style, {
4032
+ const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
4033
+ d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
4034
+ const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
4035
+ const v = document.createElement("div");
4036
+ Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
4037
+ const w = document.createElement("button");
4038
+ w.innerHTML = "×", Object.assign(w.style, {
3972
4039
  position: "absolute",
3973
4040
  top: "-4px",
3974
4041
  right: "-4px",
@@ -3986,62 +4053,62 @@ class es {
3986
4053
  justifyContent: "center",
3987
4054
  padding: "0",
3988
4055
  fontWeight: "700"
3989
- }), y.addEventListener("click", () => {
3990
- const E = this.pendingAttachmentIds.indexOf(m);
3991
- E !== -1 && this.pendingAttachmentIds.splice(E, 1), b.remove();
3992
- }), b.appendChild(y), p.appendChild(b);
3993
- }, f = 5;
4056
+ }), w.addEventListener("click", () => {
4057
+ const E = this.pendingAttachmentIds.indexOf(g);
4058
+ E !== -1 && this.pendingAttachmentIds.splice(E, 1), v.remove();
4059
+ }), v.appendChild(w), h.appendChild(v);
4060
+ }, m = 5;
3994
4061
  this.form.querySelector(".attach-img").addEventListener("click", async () => {
3995
- const m = f - this.pendingAttachmentIds.length;
3996
- if (m <= 0) return;
3997
- const x = await this.upload.pickFiles("image/*", m);
3998
- for (const b of x) {
3999
- this.pendingAttachmentIds.push(b.id);
4000
- const y = document.createElement("img");
4001
- y.src = b.thumbnailUrl || b.url, Object.assign(y.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), u(b.id, y);
4062
+ const g = m - this.pendingAttachmentIds.length;
4063
+ if (g <= 0) return;
4064
+ const y = await this.upload.pickFiles("image/*", g);
4065
+ for (const v of y) {
4066
+ this.pendingAttachmentIds.push(v.id);
4067
+ const w = document.createElement("img");
4068
+ w.src = v.thumbnailUrl || v.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(v.id, w);
4002
4069
  }
4003
4070
  }), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
4004
- if (this.pendingAttachmentIds.length >= f) return;
4005
- this.audioRecorder || (this.audioRecorder = new je());
4006
- const m = await this.audioRecorder.startRecording(p);
4007
- if (m) {
4008
- const x = await this.upload.uploadBlob(m, "audio.webm");
4009
- if (x) {
4010
- this.pendingAttachmentIds.push(x.id);
4011
- const b = document.createElement("span");
4012
- 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", u(x.id, b);
4071
+ if (this.pendingAttachmentIds.length >= m) return;
4072
+ this.audioRecorder || (this.audioRecorder = new ze());
4073
+ const g = await this.audioRecorder.startRecording(h);
4074
+ if (g) {
4075
+ const y = await this.upload.uploadBlob(g, "audio.webm");
4076
+ if (y) {
4077
+ this.pendingAttachmentIds.push(y.id);
4078
+ const v = document.createElement("span");
4079
+ 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", p(y.id, v);
4013
4080
  }
4014
4081
  }
4015
4082
  }), this.form.querySelector(".attach-video").addEventListener("click", async () => {
4016
- if (this.pendingAttachmentIds.length >= f) return;
4017
- this.videoRecorder || (this.videoRecorder = new ze());
4018
- const m = await this.videoRecorder.startRecording(p);
4019
- if (m) {
4020
- const x = await this.upload.uploadBlob(m.blob, "video.webm");
4021
- if (x) {
4022
- this.pendingAttachmentIds.push(x.id);
4023
- const b = document.createElement("span");
4024
- 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", u(x.id, b);
4083
+ if (this.pendingAttachmentIds.length >= m) return;
4084
+ this.videoRecorder || (this.videoRecorder = new Ue());
4085
+ const g = await this.videoRecorder.startRecording(h);
4086
+ if (g) {
4087
+ const y = await this.upload.uploadBlob(g.blob, "video.webm");
4088
+ if (y) {
4089
+ this.pendingAttachmentIds.push(y.id);
4090
+ const v = document.createElement("span");
4091
+ 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", p(y.id, v);
4025
4092
  }
4026
4093
  }
4027
- }), h.addEventListener("click", () => {
4028
- const m = a.value.trim();
4029
- if (!m && this.pendingAttachmentIds.length === 0) return;
4030
- const x = [...(m || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
4031
- this.client.createThread(m, { position: i, mentions: x, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4032
- }), a.addEventListener("keydown", (m) => {
4033
- m.key === "Escape" && this.exitPinMode(), m.stopPropagation();
4034
- }), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
4094
+ }), c.addEventListener("click", () => {
4095
+ const g = l.value.trim();
4096
+ if (!g && this.pendingAttachmentIds.length === 0) return;
4097
+ const y = [...(g || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
4098
+ this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4099
+ }), l.addEventListener("keydown", (g) => {
4100
+ g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
4101
+ }), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
4035
4102
  }
4036
4103
  // ── Inline thread popover (shown when a pin dot is clicked) ──
4037
4104
  showThreadPopover(e, t) {
4038
4105
  this.closePopover(), this.popover = document.createElement("div"), this.popover.dataset.threadId = e.id;
4039
4106
  const i = window.innerWidth <= 480, s = i ? window.innerWidth : 300, o = t.getBoundingClientRect();
4040
- let r, l;
4041
- i ? (r = 0, l = window.innerHeight * 0.4) : (r = o.right + 10, l = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), l < 16 && (l = 16)), Object.assign(this.popover.style, {
4107
+ let r, a;
4108
+ i ? (r = 0, a = window.innerHeight * 0.4) : (r = o.right + 10, a = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), a < 16 && (a = 16)), Object.assign(this.popover.style, {
4042
4109
  position: "fixed",
4043
4110
  left: `${r}px`,
4044
- top: `${l}px`,
4111
+ top: `${a}px`,
4045
4112
  width: i ? "100vw" : `${s}px`,
4046
4113
  maxHeight: i ? "60vh" : "360px",
4047
4114
  zIndex: "10001",
@@ -4049,36 +4116,36 @@ class es {
4049
4116
  borderRadius: i ? "16px 16px 0 0" : "12px",
4050
4117
  boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
4051
4118
  border: "1px solid #e2e8f0",
4052
- fontFamily: ve,
4119
+ fontFamily: xe,
4053
4120
  display: "flex",
4054
4121
  flexDirection: "column",
4055
4122
  overflow: "hidden",
4056
4123
  pointerEvents: "auto",
4057
4124
  ...i ? { bottom: "0", top: "auto" } : {}
4058
4125
  });
4059
- const a = document.createElement("div");
4060
- Object.assign(a.style, {
4126
+ const l = document.createElement("div");
4127
+ Object.assign(l.style, {
4061
4128
  display: "flex",
4062
4129
  alignItems: "center",
4063
4130
  justifyContent: "space-between",
4064
4131
  padding: "10px 14px",
4065
4132
  borderBottom: "1px solid #f1f5f9",
4066
4133
  flexShrink: "0"
4067
- }), a.innerHTML = `
4134
+ }), l.innerHTML = `
4068
4135
  <span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
4069
- ${mt}
4070
- `, a.querySelector(".pulse-close-btn").addEventListener("click", () => {
4136
+ ${gt}
4137
+ `, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
4071
4138
  this.closePopover();
4072
- }), this.popover.appendChild(a), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
4073
- const c = this.popover.getBoundingClientRect();
4074
- c.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - c.height - 16)}px`), requestAnimationFrame(() => {
4139
+ }), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
4140
+ const d = this.popover.getBoundingClientRect();
4141
+ d.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - d.height - 16)}px`), requestAnimationFrame(() => {
4075
4142
  document.addEventListener("pointerdown", this.handlePopoverOutsideClick), document.addEventListener("keydown", this.handlePopoverEscape);
4076
4143
  });
4077
4144
  }
4078
4145
  refreshPopoverComments(e) {
4079
- var l;
4146
+ var d;
4080
4147
  if (!this.popover) return;
4081
- this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((a) => a.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
4148
+ this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((c) => c.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
4082
4149
  let t = this.popover.querySelector(
4083
4150
  ".popover-comments"
4084
4151
  );
@@ -4089,21 +4156,21 @@ class es {
4089
4156
  padding: "12px 14px",
4090
4157
  minHeight: "0"
4091
4158
  });
4092
- const a = this.popover.firstElementChild;
4093
- a && a.nextSibling ? this.popover.insertBefore(t, a.nextSibling) : this.popover.appendChild(t);
4159
+ const c = this.popover.firstElementChild;
4160
+ c && c.nextSibling ? this.popover.insertBefore(t, c.nextSibling) : this.popover.appendChild(t);
4094
4161
  }
4095
- const i = (l = this.client.state.user) == null ? void 0 : l.id;
4096
- t.innerHTML = e.comments.map((a) => {
4097
- const c = this.client.state.getUser(a.userId), h = c ? c.name.split(" ").map((k) => k[0]).join("").toUpperCase().slice(0, 2) : "?", p = (c == null ? void 0 : c.color) ?? "#94a3b8", u = this.escapeHtml((c == null ? void 0 : c.name) ?? "Unknown"), f = this.formatTime(a.createdAt), m = i === a.userId, x = a.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4098
- if (this.editingPopoverCommentId === a.id)
4162
+ const i = (d = this.client.state.user) == null ? void 0 : d.id;
4163
+ t.innerHTML = e.comments.map((c) => {
4164
+ const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[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), v = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4165
+ if (this.editingPopoverCommentId === c.id)
4099
4166
  return `
4100
- <div style="margin-bottom:10px;" data-comment-id="${a.id}">
4167
+ <div style="margin-bottom:10px;" data-comment-id="${c.id}">
4101
4168
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
4102
- <div style="width:22px;height:22px;border-radius:50%;background:${p};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${h}</div>
4103
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
4169
+ <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>
4170
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4104
4171
  </div>
4105
4172
  <div style="margin-left:29px;">
4106
- <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(a.body)}</textarea>
4173
+ <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>
4107
4174
  <div style="display:flex;gap:6px;margin-top:6px;">
4108
4175
  <button class="edit-save" style="padding:4px 10px;background:#6366f1;color:#fff;border:none;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;">Save</button>
4109
4176
  <button class="edit-cancel" style="padding:4px 10px;border:1px solid #e2e8f0;border-radius:6px;font-size:11px;font-weight:500;cursor:pointer;background:#fff;font-family:inherit;color:#64748b;">Cancel</button>
@@ -4111,90 +4178,92 @@ class es {
4111
4178
  </div>
4112
4179
  </div>
4113
4180
  `;
4114
- const b = a.body && a.body !== "(attachment)" ? a.body.replace(
4181
+ const E = c.body && c.body !== "(attachment)" ? c.body.replace(
4115
4182
  /@(\w+)/g,
4116
4183
  '<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
4117
- ) : "", y = (a.attachments ?? []).map((k) => {
4118
- if (k.type === "image") {
4119
- const At = k.thumbnailUrl || k.url;
4120
- return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(k.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
4121
- <img src="${this.escapeHtml(At)}" alt="${this.escapeHtml(k.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4184
+ ) : "", I = (c.attachments ?? []).map((O) => {
4185
+ if (O.type === "image") {
4186
+ const Mt = O.thumbnailUrl || O.url;
4187
+ return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(O.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
4188
+ <img src="${this.escapeHtml(Mt)}" alt="${this.escapeHtml(O.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
4122
4189
  </div>`;
4123
4190
  }
4124
- return k.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(k.url)}" data-duration="${k.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : k.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(k.url)}" data-poster="${this.escapeHtml(k.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4125
- }).join(""), E = m ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4126
- <button class="edit-btn" data-comment-id="${a.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"
4191
+ return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4192
+ }).join(""), z = v ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4193
+ <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"
4127
4194
  onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
4128
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Ji}</button>
4129
- <button class="delete-btn" data-comment-id="${a.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"
4195
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
4196
+ <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"
4130
4197
  onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
4131
- onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Qi}</button>
4132
- </div>` : "", M = this.buildReactionPillsHtml(a.id);
4198
+ onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ss}</button>
4199
+ </div>` : "", It = this.buildReactionPillsHtml(c.id);
4133
4200
  return `
4134
- <div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${a.id}">
4201
+ <div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
4135
4202
  <div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
4136
- <div style="width:22px;height:22px;border-radius:50%;background:${p};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${h}</div>
4137
- <span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
4138
- <span style="font-size:10px;color:#94a3b8;">${f}</span>
4139
- ${x}
4203
+ <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>
4204
+ <span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
4205
+ <span style="font-size:10px;color:#94a3b8;">${y}</span>
4206
+ ${w}
4140
4207
  </div>
4141
- ${b ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${b}</div>` : ""}
4142
- ${y}
4143
- ${E}
4144
- ${M}
4208
+ ${E ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${E}</div>` : ""}
4209
+ ${I}
4210
+ ${z}
4211
+ ${It}
4145
4212
  </div>
4146
4213
  `;
4147
- }).join(""), t.querySelectorAll(".edit-btn").forEach((a) => {
4148
- a.addEventListener("click", () => {
4149
- this.editingPopoverCommentId = a.dataset.commentId, this.refreshPopoverComments(e);
4214
+ }).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
4215
+ c.addEventListener("click", () => {
4216
+ this.editingPopoverCommentId = c.dataset.commentId, this.refreshPopoverComments(e);
4150
4217
  });
4151
- }), t.querySelectorAll(".delete-btn").forEach((a) => {
4152
- a.addEventListener("click", () => {
4153
- this.client.deleteComment(a.dataset.commentId);
4218
+ }), t.querySelectorAll(".delete-btn").forEach((c) => {
4219
+ c.addEventListener("click", () => {
4220
+ this.client.deleteComment(c.dataset.commentId);
4154
4221
  });
4155
4222
  });
4156
4223
  const s = t.querySelector(".edit-save"), o = t.querySelector(".edit-cancel"), r = t.querySelector(
4157
4224
  ".edit-textarea"
4158
4225
  );
4159
4226
  s && r && s.addEventListener("click", () => {
4160
- const a = r.value.trim();
4161
- if (!a) return;
4162
- const c = [...a.matchAll(/@(\w+)/g)].map((h) => h[1]);
4227
+ const c = r.value.trim();
4228
+ if (!c) return;
4229
+ const h = [...c.matchAll(/@(\w+)/g)].map((p) => p[1]);
4163
4230
  this.client.editComment(
4164
4231
  this.editingPopoverCommentId,
4165
- a,
4166
- c
4232
+ c,
4233
+ h
4167
4234
  ), this.editingPopoverCommentId = null;
4168
4235
  }), o && o.addEventListener("click", () => {
4169
4236
  this.editingPopoverCommentId = null, this.refreshPopoverComments(e);
4170
- }), t.querySelectorAll("[data-reaction-emoji]").forEach((a) => {
4171
- a.addEventListener("click", (c) => {
4172
- c.stopPropagation();
4173
- const h = a.dataset.reactionEmoji, p = a.dataset.reactionTarget, u = a.dataset.reactionId;
4174
- u ? this.client.removeReaction(u) : this.client.addReaction(p, "comment", h);
4237
+ }), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
4238
+ c.addEventListener("click", (h) => {
4239
+ h.stopPropagation();
4240
+ const p = c.dataset.reactionEmoji, m = c.dataset.reactionTarget, g = c.dataset.reactionId;
4241
+ g ? this.client.removeReaction(g) : this.client.addReaction(m, "comment", p);
4175
4242
  });
4176
- }), t.querySelectorAll(".popover-reaction-add").forEach((a) => {
4177
- a.addEventListener("click", (c) => {
4178
- c.stopPropagation();
4179
- const h = a.dataset.commentId;
4180
- this.popoverPickerOpen === h ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = h, this.showPickerForButton(a, h));
4243
+ }), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
4244
+ c.addEventListener("click", (h) => {
4245
+ h.stopPropagation();
4246
+ const p = c.dataset.commentId;
4247
+ this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(c, p));
4181
4248
  });
4182
- }), t.querySelectorAll(".popover-attachment-img").forEach((a) => {
4183
- a.addEventListener("click", () => {
4184
- const c = a.dataset.fullUrl;
4185
- c && Ce.open(c);
4249
+ });
4250
+ const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
4251
+ a.forEach((c, h) => {
4252
+ c.addEventListener("click", () => {
4253
+ const p = c.dataset.fullUrl;
4254
+ p && Te.open(p, l, h);
4186
4255
  });
4187
- }), t.querySelectorAll(".popover-attachment-audio").forEach((a) => {
4188
- const c = a.dataset.url;
4189
- if (c) {
4190
- const h = a.dataset.duration ? parseInt(a.dataset.duration) : void 0, p = Le.render(c, h);
4191
- a.appendChild(p);
4192
- }
4193
- }), t.querySelectorAll(".popover-attachment-video").forEach((a) => {
4194
- const c = a.dataset.url;
4195
- if (c) {
4196
- const h = a.dataset.poster || void 0, p = Ee.render(c, h);
4197
- a.appendChild(p);
4256
+ }), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
4257
+ const h = c.dataset.url;
4258
+ if (h) {
4259
+ const p = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, m = je.render(h, p);
4260
+ c.appendChild(m);
4261
+ }
4262
+ }), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
4263
+ const h = c.dataset.url;
4264
+ if (h) {
4265
+ const p = c.dataset.poster || void 0, m = Ce.render(h, p);
4266
+ c.appendChild(m);
4198
4267
  }
4199
4268
  }), t.scrollTop = t.scrollHeight;
4200
4269
  }
@@ -4225,13 +4294,13 @@ class es {
4225
4294
  <div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
4226
4295
  </div>
4227
4296
  `;
4228
- const o = t.querySelector("input"), r = t.querySelector(".reply-send"), l = t.querySelector(".reply-attachments-preview");
4229
- this.upload || (this.upload = new oe(this.client));
4230
- const a = [], c = (u, f) => {
4231
- const m = document.createElement("span");
4232
- Object.assign(m.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), m.textContent = f;
4233
- const x = document.createElement("button");
4234
- x.innerHTML = "×", Object.assign(x.style, {
4297
+ const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
4298
+ this.upload || (this.upload = new re(this.client));
4299
+ const l = [], d = (p, m) => {
4300
+ const g = document.createElement("span");
4301
+ 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;
4302
+ const y = document.createElement("button");
4303
+ y.innerHTML = "×", Object.assign(y.style, {
4235
4304
  position: "absolute",
4236
4305
  top: "-3px",
4237
4306
  right: "-3px",
@@ -4249,45 +4318,45 @@ class es {
4249
4318
  justifyContent: "center",
4250
4319
  padding: "0",
4251
4320
  fontWeight: "700"
4252
- }), x.addEventListener("click", () => {
4253
- const b = a.indexOf(u);
4254
- b !== -1 && a.splice(b, 1), m.remove();
4255
- }), m.appendChild(x), l.appendChild(m);
4256
- }, h = 5;
4321
+ }), y.addEventListener("click", () => {
4322
+ const v = l.indexOf(p);
4323
+ v !== -1 && l.splice(v, 1), g.remove();
4324
+ }), g.appendChild(y), a.appendChild(g);
4325
+ }, c = 5;
4257
4326
  t.querySelector(".reply-attach-img").addEventListener("click", async () => {
4258
- const u = h - a.length;
4259
- if (u <= 0) return;
4260
- const f = await this.upload.pickFiles("image/*", u);
4261
- for (const m of f)
4262
- a.push(m.id), c(m.id, "📎 Image");
4327
+ const p = c - l.length;
4328
+ if (p <= 0) return;
4329
+ const m = await this.upload.pickFiles("image/*", p);
4330
+ for (const g of m)
4331
+ l.push(g.id), d(g.id, "📎 Image");
4263
4332
  }), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
4264
- if (a.length >= h) return;
4265
- this.audioRecorder || (this.audioRecorder = new je());
4266
- const u = await this.audioRecorder.startRecording(t);
4267
- if (u) {
4268
- const f = await this.upload.uploadBlob(u, "audio.webm");
4269
- f && (a.push(f.id), c(f.id, "🎤 Audio"));
4333
+ if (l.length >= c) return;
4334
+ this.audioRecorder || (this.audioRecorder = new ze());
4335
+ const p = await this.audioRecorder.startRecording(t);
4336
+ if (p) {
4337
+ const m = await this.upload.uploadBlob(p, "audio.webm");
4338
+ m && (l.push(m.id), d(m.id, "🎤 Audio"));
4270
4339
  }
4271
4340
  }), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
4272
- if (a.length >= h) return;
4273
- this.videoRecorder || (this.videoRecorder = new ze());
4274
- const u = await this.videoRecorder.startRecording(t);
4275
- if (u) {
4276
- const f = await this.upload.uploadBlob(u.blob, "video.webm");
4277
- f && (a.push(f.id), c(f.id, "🎥 Video"));
4341
+ if (l.length >= c) return;
4342
+ this.videoRecorder || (this.videoRecorder = new Ue());
4343
+ const p = await this.videoRecorder.startRecording(t);
4344
+ if (p) {
4345
+ const m = await this.upload.uploadBlob(p.blob, "video.webm");
4346
+ m && (l.push(m.id), d(m.id, "🎥 Video"));
4278
4347
  }
4279
4348
  });
4280
- const p = () => {
4281
- const u = o.value.trim();
4282
- if (!u && a.length === 0) return;
4283
- const f = [...(u || "").matchAll(/@(\w+)/g)].map((m) => m[1]);
4284
- this.client.reply(e.id, u, f, a.length > 0 ? [...a] : void 0), o.value = "", a.length = 0, l.innerHTML = "";
4349
+ const h = () => {
4350
+ const p = o.value.trim();
4351
+ if (!p && l.length === 0) return;
4352
+ const m = [...(p || "").matchAll(/@(\w+)/g)].map((g) => g[1]);
4353
+ this.client.reply(e.id, p, m, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
4285
4354
  };
4286
- r.addEventListener("click", p), o.addEventListener("input", () => {
4287
- const u = Date.now(), f = this.lastTypingSendPins.get(e.id) ?? 0;
4288
- u - f >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, u));
4289
- }), o.addEventListener("keydown", (u) => {
4290
- u.key === "Enter" && (u.preventDefault(), p()), u.key === "Escape" && this.closePopover(), u.stopPropagation();
4355
+ r.addEventListener("click", h), o.addEventListener("input", () => {
4356
+ const p = Date.now(), m = this.lastTypingSendPins.get(e.id) ?? 0;
4357
+ p - m >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, p));
4358
+ }), o.addEventListener("keydown", (p) => {
4359
+ p.key === "Enter" && (p.preventDefault(), h()), p.key === "Escape" && this.closePopover(), p.stopPropagation();
4291
4360
  }), this.popover.appendChild(t);
4292
4361
  }
4293
4362
  removePickerEl() {
@@ -4310,9 +4379,9 @@ class es {
4310
4379
  borderRadius: "8px",
4311
4380
  boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
4312
4381
  zIndex: "10002",
4313
- fontFamily: ve
4382
+ fontFamily: xe
4314
4383
  });
4315
- for (const s of Zi) {
4384
+ for (const s of ts) {
4316
4385
  const o = document.createElement("button");
4317
4386
  Object.assign(o.style, {
4318
4387
  border: "none",
@@ -4324,33 +4393,33 @@ class es {
4324
4393
  lineHeight: "1"
4325
4394
  }), o.textContent = s, o.addEventListener("click", (r) => {
4326
4395
  r.stopPropagation();
4327
- const a = this.client.state.getReactions(t).find(
4328
- (c) => {
4329
- var h;
4330
- return c.emoji === s && c.userId === ((h = this.client.state.user) == null ? void 0 : h.id);
4396
+ const l = this.client.state.getReactions(t).find(
4397
+ (d) => {
4398
+ var c;
4399
+ return d.emoji === s && d.userId === ((c = this.client.state.user) == null ? void 0 : c.id);
4331
4400
  }
4332
4401
  );
4333
- a ? this.client.removeReaction(a.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
4402
+ l ? this.client.removeReaction(l.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
4334
4403
  }), this.pickerEl.appendChild(o);
4335
4404
  }
4336
4405
  document.body.appendChild(this.pickerEl);
4337
4406
  }
4338
4407
  buildReactionPillsHtml(e) {
4339
- var a;
4340
- const t = this.client.state.getReactions(e), i = (a = this.client.state.user) == null ? void 0 : a.id, s = /* @__PURE__ */ new Map();
4341
- for (const c of t) {
4342
- const h = s.get(c.emoji) ?? { count: 0, ownId: null };
4343
- h.count++, c.userId === i && (h.ownId = c.id), s.set(c.emoji, h);
4408
+ var l;
4409
+ const t = this.client.state.getReactions(e), i = (l = this.client.state.user) == null ? void 0 : l.id, s = /* @__PURE__ */ new Map();
4410
+ for (const d of t) {
4411
+ const c = s.get(d.emoji) ?? { count: 0, ownId: null };
4412
+ c.count++, d.userId === i && (c.ownId = d.id), s.set(d.emoji, c);
4344
4413
  }
4345
4414
  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;";
4346
- let l = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
4347
- for (const [c, { count: h, ownId: p }] of s) {
4348
- const u = p ? r : o;
4349
- l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${p ? `data-reaction-id="${p}"` : ""} style="${u}">
4350
- <span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${h}</span>
4415
+ let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
4416
+ for (const [d, { count: c, ownId: h }] of s) {
4417
+ const p = h ? r : o;
4418
+ a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${p}">
4419
+ <span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
4351
4420
  </button>`;
4352
4421
  }
4353
- return l += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, l += "</div>", l;
4422
+ return a += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, a += "</div>", a;
4354
4423
  }
4355
4424
  updatePopoverTyping(e) {
4356
4425
  if (!this.popover) return;
@@ -4422,7 +4491,7 @@ class es {
4422
4491
  justifyContent: "center",
4423
4492
  fontSize: "11px",
4424
4493
  fontWeight: "700",
4425
- fontFamily: ve,
4494
+ fontFamily: xe,
4426
4495
  cursor: "pointer",
4427
4496
  pointerEvents: "auto",
4428
4497
  boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
@@ -4439,21 +4508,21 @@ class es {
4439
4508
  this.closePopover();
4440
4509
  return;
4441
4510
  }
4442
- const a = this.threads.find((c) => c.id === i.id);
4443
- a && this.showThreadPopover(a, r);
4511
+ const l = this.threads.find((d) => d.id === i.id);
4512
+ l && this.showThreadPopover(l, r);
4444
4513
  }), this.container.appendChild(r), this.pinEls.set(i.id, r)), r.textContent = `${s + 1}`;
4445
- const l = this.resolvePosition(o);
4446
- r.style.left = `${l.x}px`, r.style.top = `${l.y}px`;
4514
+ const a = this.resolvePosition(o);
4515
+ r.style.left = `${a.x}px`, r.style.top = `${a.y}px`;
4447
4516
  });
4448
4517
  }
4449
4518
  }
4450
- var ts = Object.defineProperty, is = Object.getOwnPropertyDescriptor, z = (n, e, t, i) => {
4451
- for (var s = i > 1 ? void 0 : i ? is(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4519
+ var os = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, U = (n, e, t, i) => {
4520
+ for (var s = i > 1 ? void 0 : i ? rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
4452
4521
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
4453
- return i && s && ts(e, t, s), s;
4522
+ return i && s && os(e, t, s), s;
4454
4523
  };
4455
- const ss = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4456
- let A = class extends P {
4524
+ const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
4525
+ let P = class extends A {
4457
4526
  constructor() {
4458
4527
  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 = [];
4459
4528
  }
@@ -4477,12 +4546,12 @@ let A = class extends P {
4477
4546
  const s = i.dataset.url;
4478
4547
  if (s) {
4479
4548
  const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
4480
- i.appendChild(Le.render(s, o));
4549
+ i.appendChild(je.render(s, o));
4481
4550
  }
4482
4551
  }), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
4483
4552
  if (i.children.length > 0) return;
4484
4553
  const s = i.dataset.url;
4485
- s && i.appendChild(Ee.render(s, i.dataset.poster || void 0));
4554
+ s && i.appendChild(Ce.render(s, i.dataset.poster || void 0));
4486
4555
  });
4487
4556
  }
4488
4557
  teardownListeners() {
@@ -4550,7 +4619,7 @@ let A = class extends P {
4550
4619
  }
4551
4620
  parseMentions(n) {
4552
4621
  return n.split(/(@\w+)/g).map(
4553
- (t) => t.startsWith("@") ? d`<span class="mention">${t}</span>` : t
4622
+ (t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
4554
4623
  );
4555
4624
  }
4556
4625
  getInitials(n) {
@@ -4567,16 +4636,16 @@ let A = class extends P {
4567
4636
  return o < 24 ? `${o}h` : e.toLocaleDateString();
4568
4637
  }
4569
4638
  async handleAttachImage() {
4570
- this.upload || (this.upload = new oe(this.client));
4571
- const n = A.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
4639
+ this.upload || (this.upload = new re(this.client));
4640
+ const n = P.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
4572
4641
  if (n <= 0) return;
4573
4642
  const e = await this.upload.pickFiles("image/*", n);
4574
4643
  e.length > 0 && (this.replyAttachmentIds.push(...e.map((t) => t.id)), this.requestUpdate());
4575
4644
  }
4576
4645
  async handleRecordAudio(n) {
4577
4646
  var i;
4578
- if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
4579
- this.upload || (this.upload = new oe(this.client)), this.audioRecorder || (this.audioRecorder = new je());
4647
+ if (this.replyAttachmentIds.length >= P.MAX_ATTACHMENTS) return;
4648
+ this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
4580
4649
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
4581
4650
  if (t) {
4582
4651
  const s = await this.upload.uploadBlob(t, "audio.webm");
@@ -4585,8 +4654,8 @@ let A = class extends P {
4585
4654
  }
4586
4655
  async handleRecordVideo(n) {
4587
4656
  var i;
4588
- if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
4589
- this.upload || (this.upload = new oe(this.client)), this.videoRecorder || (this.videoRecorder = new ze());
4657
+ if (this.replyAttachmentIds.length >= P.MAX_ATTACHMENTS) return;
4658
+ this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new Ue());
4590
4659
  const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
4591
4660
  if (t) {
4592
4661
  const s = await this.upload.uploadBlob(t.blob, "video.webm");
@@ -4623,7 +4692,7 @@ let A = class extends P {
4623
4692
  this.client.deleteComment(n);
4624
4693
  }
4625
4694
  renderEditForm(n) {
4626
- return d`
4695
+ return u`
4627
4696
  <div class="edit-form">
4628
4697
  <textarea
4629
4698
  .value=${this.editBody}
@@ -4644,14 +4713,14 @@ let A = class extends P {
4644
4713
  const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
4645
4714
  for (const o of e)
4646
4715
  i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
4647
- return d`
4716
+ return u`
4648
4717
  <div class="comment-reactions">
4649
4718
  ${[...i.entries()].map(
4650
4719
  ([o, r]) => {
4651
- const l = r.some((a) => a.userId === t);
4652
- return d`
4720
+ const a = r.some((l) => l.userId === t);
4721
+ return u`
4653
4722
  <button
4654
- class="reaction-pill ${l ? "own" : ""}"
4723
+ class="reaction-pill ${a ? "own" : ""}"
4655
4724
  @click=${() => this.toggleReaction(n.id, o)}
4656
4725
  >
4657
4726
  <span>${o}</span>
@@ -4668,26 +4737,26 @@ let A = class extends P {
4668
4737
  title="Add reaction"
4669
4738
  >
4670
4739
  +
4671
- ${this.pickerOpenForComment === n.id ? d`
4740
+ ${this.pickerOpenForComment === n.id ? u`
4672
4741
  <div class="emoji-picker">
4673
- ${ss.map(
4674
- (o) => d`
4742
+ ${as.map(
4743
+ (o) => u`
4675
4744
  <button @click=${(r) => {
4676
4745
  r.stopPropagation(), this.toggleReaction(n.id, o);
4677
4746
  }}>${o}</button>
4678
4747
  `
4679
4748
  )}
4680
4749
  </div>
4681
- ` : g}
4750
+ ` : b}
4682
4751
  </button>
4683
4752
  </div>
4684
4753
  `;
4685
4754
  }
4686
4755
  renderTypingIndicator(n) {
4687
4756
  const e = this.typingByThread.get(n) ?? [];
4688
- if (e.length === 0) return g;
4757
+ if (e.length === 0) return b;
4689
4758
  const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
4690
- return d`<div class="typing-indicator">${t}</div>`;
4759
+ return u`<div class="typing-indicator">${t}</div>`;
4691
4760
  }
4692
4761
  sortedThreads() {
4693
4762
  return [...this.threads].sort((n, e) => {
@@ -4698,7 +4767,7 @@ let A = class extends P {
4698
4767
  }
4699
4768
  render() {
4700
4769
  const n = this.sortedThreads();
4701
- return d`
4770
+ return u`
4702
4771
  <div class="panel">
4703
4772
  <div class="panel-header">
4704
4773
  <span class="panel-title">
@@ -4706,12 +4775,12 @@ let A = class extends P {
4706
4775
  <span class="thread-count">${this.threads.length}</span>
4707
4776
  </span>
4708
4777
  <button class="close-btn" @click=${this.fireClose} title="Close">
4709
- ${C(ge, 16)}
4778
+ ${C(be, 16)}
4710
4779
  </button>
4711
4780
  </div>
4712
4781
 
4713
4782
  <div class="panel-body pw-scrollable">
4714
- ${n.length === 0 ? d`<div class="empty">
4783
+ ${n.length === 0 ? u`<div class="empty">
4715
4784
  <div class="empty-icon">&#128172;</div>
4716
4785
  No comments yet
4717
4786
  </div>` : n.map((e) => this.renderThread(e))}
@@ -4724,55 +4793,57 @@ let A = class extends P {
4724
4793
  `;
4725
4794
  }
4726
4795
  renderAttachments(n) {
4727
- return !n || n.length === 0 ? g : d`
4728
- ${n.map((e) => {
4729
- if (e.type === "image") {
4730
- const t = e.thumbnailUrl || e.url;
4731
- return d`
4796
+ if (!n || n.length === 0) return b;
4797
+ const e = n.filter((t) => t.type === "image").map((t) => t.url);
4798
+ return u`
4799
+ ${n.map((t) => {
4800
+ if (t.type === "image") {
4801
+ const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
4802
+ return u`
4732
4803
  <div class="comment-attachment-media">
4733
4804
  <img
4734
4805
  class="comment-attachment-img"
4735
- src=${t}
4736
- alt=${e.filename}
4737
- @click=${() => Ce.open(e.url)}
4806
+ src=${i}
4807
+ alt=${t.filename}
4808
+ @click=${() => Te.open(t.url, e, s)}
4738
4809
  />
4739
4810
  </div>
4740
4811
  `;
4741
4812
  }
4742
- return e.type === "audio" ? d`
4743
- <div class="comment-attachment-media" id="audio-${e.id}">
4744
- ${this.renderAudioPlayer(e)}
4813
+ return t.type === "audio" ? u`
4814
+ <div class="comment-attachment-media" id="audio-${t.id}">
4815
+ ${this.renderAudioPlayer(t)}
4745
4816
  </div>
4746
- ` : e.type === "video" ? d`
4747
- <div class="comment-attachment-media" id="video-${e.id}">
4748
- ${this.renderVideoPlayer(e)}
4817
+ ` : t.type === "video" ? u`
4818
+ <div class="comment-attachment-media" id="video-${t.id}">
4819
+ ${this.renderVideoPlayer(t)}
4749
4820
  </div>
4750
- ` : g;
4821
+ ` : b;
4751
4822
  })}
4752
4823
  `;
4753
4824
  }
4754
4825
  renderAudioPlayer(n) {
4755
- const e = document.createElement("div"), t = Le.render(n.url, n.durationMs);
4756
- return e.appendChild(t), d`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4826
+ const e = document.createElement("div"), t = je.render(n.url, n.durationMs);
4827
+ return e.appendChild(t), u`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
4757
4828
  }
4758
4829
  renderVideoPlayer(n) {
4759
- return d`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4830
+ return u`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
4760
4831
  }
4761
4832
  renderThread(n) {
4762
4833
  const e = this.highlightThreadId === n.id;
4763
- return d`
4834
+ return u`
4764
4835
  <div
4765
4836
  class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
4766
4837
  data-thread-id=${n.id}
4767
4838
  >
4768
- ${n.position ? d`<div class="pin-badge">
4769
- ${C(St, 12)}
4839
+ ${n.position ? u`<div class="pin-badge">
4840
+ ${C(Pt, 12)}
4770
4841
  Pinned
4771
- </div>` : g}
4842
+ </div>` : b}
4772
4843
  ${n.comments.map((t, i) => {
4773
4844
  const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
4774
- return d`
4775
- ${i > 0 ? d`<div class="comment-divider"></div>` : g}
4845
+ return u`
4846
+ ${i > 0 ? u`<div class="comment-divider"></div>` : b}
4776
4847
  <div class="comment">
4777
4848
  <div class="comment-header">
4778
4849
  <div
@@ -4783,16 +4854,16 @@ let A = class extends P {
4783
4854
  </div>
4784
4855
  <span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
4785
4856
  <span class="comment-time">${this.formatTime(t.createdAt)}</span>
4786
- ${t.editedAt ? d`<span class="edited-badge">(edited)</span>` : g}
4857
+ ${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : b}
4787
4858
  </div>
4788
- ${r ? this.renderEditForm(t) : d`
4789
- ${t.body && t.body !== "(attachment)" ? d`<div class="comment-body">${this.parseMentions(t.body)}</div>` : g}
4859
+ ${r ? this.renderEditForm(t) : u`
4860
+ ${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : b}
4790
4861
  ${this.renderAttachments(t.attachments ?? [])}
4791
4862
  `}
4792
- ${o && !r ? d`<div class="comment-actions">
4793
- <button @click=${() => this.startEdit(t)} title="Edit">${C(Ii, 14)}</button>
4794
- <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Oi, 14)}</button>
4795
- </div>` : g}
4863
+ ${o && !r ? u`<div class="comment-actions">
4864
+ <button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
4865
+ <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
4866
+ </div>` : b}
4796
4867
  ${this.renderReactions(t)}
4797
4868
  </div>
4798
4869
  `;
@@ -4813,7 +4884,7 @@ let A = class extends P {
4813
4884
 
4814
4885
  ${this.renderTypingIndicator(n.id)}
4815
4886
 
4816
- ${this.replyingTo === n.id ? d`
4887
+ ${this.replyingTo === n.id ? u`
4817
4888
  <form
4818
4889
  class="reply-form"
4819
4890
  @submit=${(t) => this.handleReply(n.id, t)}
@@ -4832,22 +4903,22 @@ let A = class extends P {
4832
4903
  class="reply-media-btn"
4833
4904
  title="Attach image"
4834
4905
  @click=${() => this.handleAttachImage()}
4835
- >${C(Pi, 16)}</button>
4906
+ >${C(Ii, 16)}</button>
4836
4907
  <button
4837
4908
  type="button"
4838
4909
  class="reply-media-btn"
4839
4910
  title="Record audio"
4840
4911
  @click=${() => this.handleRecordAudio(n.id)}
4841
- >${C(Si, 16)}</button>
4912
+ >${C(_i, 16)}</button>
4842
4913
  <button
4843
4914
  type="button"
4844
4915
  class="reply-media-btn"
4845
4916
  title="Record video"
4846
4917
  @click=${() => this.handleRecordVideo(n.id)}
4847
- >${C(Ri, 16)}</button>
4918
+ >${C(ji, 16)}</button>
4848
4919
  <div class="reply-preview">
4849
4920
  ${this.replyAttachmentIds.map(
4850
- (t, i) => d`<span class="reply-preview-badge">
4921
+ (t, i) => u`<span class="reply-preview-badge">
4851
4922
  Attached #${i + 1}
4852
4923
  <button
4853
4924
  type="button"
@@ -4859,16 +4930,16 @@ let A = class extends P {
4859
4930
  </div>
4860
4931
  </div>
4861
4932
  </form>
4862
- ` : g}
4933
+ ` : b}
4863
4934
  </div>
4864
4935
  `;
4865
4936
  }
4866
4937
  };
4867
- A.styles = [
4868
- te,
4869
- be,
4870
- Se,
4871
- O`
4938
+ P.styles = [
4939
+ ie,
4940
+ ve,
4941
+ Pe,
4942
+ M`
4872
4943
  :host {
4873
4944
  display: block;
4874
4945
  }
@@ -5408,56 +5479,56 @@ A.styles = [
5408
5479
  }
5409
5480
  `
5410
5481
  ];
5411
- A.MAX_ATTACHMENTS = 5;
5412
- z([
5413
- v({ attribute: !1 })
5414
- ], A.prototype, "client", 2);
5415
- z([
5416
- v()
5417
- ], A.prototype, "highlightThreadId", 2);
5418
- z([
5419
- w()
5420
- ], A.prototype, "threadsVersion", 2);
5421
- z([
5422
- w()
5423
- ], A.prototype, "replyingTo", 2);
5424
- z([
5425
- w()
5426
- ], A.prototype, "editingCommentId", 2);
5427
- z([
5428
- w()
5429
- ], A.prototype, "editBody", 2);
5430
- z([
5431
- w()
5432
- ], A.prototype, "pickerOpenForComment", 2);
5433
- z([
5434
- w()
5435
- ], A.prototype, "typingByThread", 2);
5436
- z([
5437
- w()
5438
- ], A.prototype, "reactionsVersion", 2);
5439
- A = z([
5482
+ P.MAX_ATTACHMENTS = 5;
5483
+ U([
5484
+ x({ attribute: !1 })
5485
+ ], P.prototype, "client", 2);
5486
+ U([
5487
+ x()
5488
+ ], P.prototype, "highlightThreadId", 2);
5489
+ U([
5490
+ $()
5491
+ ], P.prototype, "threadsVersion", 2);
5492
+ U([
5493
+ $()
5494
+ ], P.prototype, "replyingTo", 2);
5495
+ U([
5496
+ $()
5497
+ ], P.prototype, "editingCommentId", 2);
5498
+ U([
5499
+ $()
5500
+ ], P.prototype, "editBody", 2);
5501
+ U([
5502
+ $()
5503
+ ], P.prototype, "pickerOpenForComment", 2);
5504
+ U([
5505
+ $()
5506
+ ], P.prototype, "typingByThread", 2);
5507
+ U([
5508
+ $()
5509
+ ], P.prototype, "reactionsVersion", 2);
5510
+ P = U([
5440
5511
  L("pulse-widget-comments-panel")
5441
- ], A);
5442
- var ns = Object.defineProperty, os = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
5443
- for (var s = i > 1 ? void 0 : i ? os(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5512
+ ], P);
5513
+ var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
5514
+ for (var s = i > 1 ? void 0 : i ? cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
5444
5515
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
5445
- return i && s && ns(e, t, s), s;
5516
+ return i && s && ls(e, t, s), s;
5446
5517
  };
5447
- const rs = {
5518
+ const ds = {
5448
5519
  "comment:created": "left a comment",
5449
5520
  "comment:mention": "mentioned you",
5450
5521
  "comment:reply": "replied to your comment",
5451
5522
  "thread:resolved": "resolved a thread",
5452
5523
  "reaction:added": "reacted to your comment"
5453
- }, as = {
5524
+ }, hs = {
5454
5525
  "comment:created": "💬",
5455
5526
  "comment:mention": "📣",
5456
5527
  "comment:reply": "↩️",
5457
5528
  "thread:resolved": "✅",
5458
5529
  "reaction:added": "🎉"
5459
5530
  };
5460
- let he = class extends P {
5531
+ let pe = class extends A {
5461
5532
  constructor() {
5462
5533
  super(...arguments), this.notifications = [];
5463
5534
  }
@@ -5501,38 +5572,38 @@ let he = class extends P {
5501
5572
  }
5502
5573
  render() {
5503
5574
  const n = this.notifications.filter((e) => !e.read).length;
5504
- return d`
5575
+ return u`
5505
5576
  <div class="panel">
5506
5577
  <div class="panel-header">
5507
5578
  <span class="panel-title">
5508
5579
  Notifications
5509
- ${n > 0 ? d`<span class="unread-badge">${n}</span>` : g}
5580
+ ${n > 0 ? u`<span class="unread-badge">${n}</span>` : b}
5510
5581
  </span>
5511
5582
  <div style="display:flex;align-items:center;gap:4px;">
5512
- ${n > 0 ? d`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5583
+ ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5513
5584
  Mark all read
5514
- </button>` : g}
5585
+ </button>` : b}
5515
5586
  <button class="close-btn" @click=${this.fireClose} title="Close">
5516
- ${C(ge, 16)}
5587
+ ${C(be, 16)}
5517
5588
  </button>
5518
5589
  </div>
5519
5590
  </div>
5520
5591
 
5521
5592
  <div class="panel-body pw-scrollable">
5522
- ${this.notifications.length === 0 ? d`<div class="empty">
5593
+ ${this.notifications.length === 0 ? u`<div class="empty">
5523
5594
  <div class="empty-icon">&#128276;</div>
5524
5595
  No notifications
5525
5596
  </div>` : this.notifications.map(
5526
- (e) => d`
5597
+ (e) => u`
5527
5598
  <div
5528
5599
  class="item ${e.read ? "" : "unread"}"
5529
5600
  @click=${() => this.handleClick(e)}
5530
5601
  >
5531
- <span class="icon">${as[e.type] ?? "🔔"}</span>
5602
+ <span class="icon">${hs[e.type] ?? "🔔"}</span>
5532
5603
  <div class="content">
5533
5604
  <div class="text">
5534
5605
  <span class="actor">${this.getActorName(e.actorId)}</span>
5535
- ${rs[e.type] ?? e.type}
5606
+ ${ds[e.type] ?? e.type}
5536
5607
  </div>
5537
5608
  <div class="time">${this.formatTime(e.createdAt)}</div>
5538
5609
  </div>
@@ -5545,11 +5616,11 @@ let he = class extends P {
5545
5616
  `;
5546
5617
  }
5547
5618
  };
5548
- he.styles = [
5549
- te,
5550
- be,
5551
- Se,
5552
- O`
5619
+ pe.styles = [
5620
+ ie,
5621
+ ve,
5622
+ Pe,
5623
+ M`
5553
5624
  :host {
5554
5625
  display: block;
5555
5626
  }
@@ -5742,17 +5813,17 @@ he.styles = [
5742
5813
  }
5743
5814
  `
5744
5815
  ];
5745
- We([
5746
- v({ attribute: !1 })
5747
- ], he.prototype, "client", 2);
5748
- We([
5749
- w()
5750
- ], he.prototype, "notifications", 2);
5751
- he = We([
5816
+ Xe([
5817
+ x({ attribute: !1 })
5818
+ ], pe.prototype, "client", 2);
5819
+ Xe([
5820
+ $()
5821
+ ], pe.prototype, "notifications", 2);
5822
+ pe = Xe([
5752
5823
  L("pulse-widget-notifications-panel")
5753
- ], he);
5754
- const ls = 3e3;
5755
- class cs {
5824
+ ], pe);
5825
+ const ps = 3e3;
5826
+ class us {
5756
5827
  constructor(e) {
5757
5828
  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) => {
5758
5829
  t.pointerType !== "touch" && this.client.moveCursor({
@@ -5804,7 +5875,7 @@ class cs {
5804
5875
  ), this.setSending(!0), this.staleTimer = setInterval(() => {
5805
5876
  const e = Date.now();
5806
5877
  for (const [t, i] of this.cursorLastSeen)
5807
- if (e - i > ls) {
5878
+ if (e - i > ps) {
5808
5879
  this.cursors.delete(t);
5809
5880
  const s = this.cursorEls.get(t);
5810
5881
  s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
@@ -5900,11 +5971,11 @@ class cs {
5900
5971
  i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
5901
5972
  }
5902
5973
  }
5903
- class ds {
5974
+ class fs {
5904
5975
  constructor(e) {
5905
5976
  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) => {
5906
- var l, a, c;
5907
- t.preventDefault(), (a = (l = t.target) == null ? void 0 : l.setPointerCapture) == null || a.call(l, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
5977
+ var a, l, d;
5978
+ t.preventDefault(), (l = (a = t.target) == null ? void 0 : a.setPointerCapture) == null || l.call(a, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
5908
5979
  const i = this.client.state.user, s = (i == null ? void 0 : i.color) ?? "#6366f1", r = 2 + (t.pressure > 0 ? t.pressure : 0.5) * 4;
5909
5980
  this.currentPath = document.createElementNS(
5910
5981
  "http://www.w3.org/2000/svg",
@@ -5912,7 +5983,7 @@ class ds {
5912
5983
  ), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", s), this.currentPath.setAttribute("stroke-width", String(r)), this.currentPath.setAttribute("stroke-linecap", "round"), this.currentPath.setAttribute("stroke-linejoin", "round"), this.currentPath.setAttribute(
5913
5984
  "points",
5914
5985
  `${t.clientX},${t.clientY}`
5915
- ), (c = this.container) == null || c.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
5986
+ ), (d = this.container) == null || d.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
5916
5987
  }, this.handlePointerMove = (t) => {
5917
5988
  if (!this.currentPath || !this.lastPoint) return;
5918
5989
  const i = t.clientX - this.lastPoint.x, s = t.clientY - this.lastPoint.y;
@@ -5983,9 +6054,9 @@ class ds {
5983
6054
  this.fadeTimers.set(e, t);
5984
6055
  }
5985
6056
  }
5986
- function hs(n) {
6057
+ function ms(n) {
5987
6058
  if (!n.rangeCount || n.isCollapsed) return null;
5988
- const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = gt(t), o = gt(i);
6059
+ const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = bt(t), o = bt(i);
5989
6060
  return !s || !o ? null : {
5990
6061
  startSelector: s,
5991
6062
  startOffset: e.startOffset,
@@ -5993,29 +6064,29 @@ function hs(n) {
5993
6064
  endOffset: e.endOffset
5994
6065
  };
5995
6066
  }
5996
- function ps(n) {
6067
+ function gs(n) {
5997
6068
  var e, t;
5998
6069
  try {
5999
- const i = vt(n.startSelector), s = vt(n.endSelector);
6070
+ const i = xt(n.startSelector), s = xt(n.endSelector);
6000
6071
  if (!i || !s) return null;
6001
- const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, l = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
6002
- return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, l)), o;
6072
+ 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;
6073
+ return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
6003
6074
  } catch {
6004
6075
  return null;
6005
6076
  }
6006
6077
  }
6007
- function gt(n) {
6078
+ function bt(n) {
6008
6079
  if (n.nodeType === Node.TEXT_NODE) {
6009
6080
  const e = n.parentElement;
6010
6081
  if (!e) return null;
6011
- const t = bt(e);
6082
+ const t = vt(e);
6012
6083
  if (!t) return null;
6013
6084
  const i = Array.from(e.childNodes).indexOf(n);
6014
6085
  return `${t}::text(${i})`;
6015
6086
  }
6016
- return n.nodeType === Node.ELEMENT_NODE ? bt(n) : null;
6087
+ return n.nodeType === Node.ELEMENT_NODE ? vt(n) : null;
6017
6088
  }
6018
- function bt(n) {
6089
+ function vt(n) {
6019
6090
  if (!n || n === document.documentElement) return "html";
6020
6091
  if (n === document.body) return "body";
6021
6092
  if (n.id) return `#${CSS.escape(n.id)}`;
@@ -6024,14 +6095,14 @@ function bt(n) {
6024
6095
  for (; t && t !== document.body && i < 10; ) {
6025
6096
  const s = t.parentElement;
6026
6097
  if (!s) break;
6027
- const o = t.tagName.toLowerCase(), r = t.tagName, l = Array.from(s.children).filter(
6028
- (a) => a.tagName === r
6098
+ const o = t.tagName.toLowerCase(), r = t.tagName, a = Array.from(s.children).filter(
6099
+ (l) => l.tagName === r
6029
6100
  );
6030
- if (l.length === 1)
6101
+ if (a.length === 1)
6031
6102
  e.unshift(o);
6032
6103
  else {
6033
- const a = l.indexOf(t) + 1;
6034
- e.unshift(`${o}:nth-of-type(${a})`);
6104
+ const l = a.indexOf(t) + 1;
6105
+ e.unshift(`${o}:nth-of-type(${l})`);
6035
6106
  }
6036
6107
  if (s.id) {
6037
6108
  e.unshift(`#${CSS.escape(s.id)}`);
@@ -6041,7 +6112,7 @@ function bt(n) {
6041
6112
  }
6042
6113
  return e.length > 0 ? e.join(" > ") : null;
6043
6114
  }
6044
- function vt(n) {
6115
+ function xt(n) {
6045
6116
  const e = n.match(/^(.+)::text\((\d+)\)$/);
6046
6117
  if (e) {
6047
6118
  const t = e[1], i = parseInt(e[2], 10);
@@ -6058,7 +6129,7 @@ function vt(n) {
6058
6129
  return null;
6059
6130
  }
6060
6131
  }
6061
- class us {
6132
+ class bs {
6062
6133
  constructor(e) {
6063
6134
  this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
6064
6135
  }
@@ -6098,32 +6169,32 @@ class us {
6098
6169
  this.disable();
6099
6170
  }
6100
6171
  renderSelection(e, t) {
6101
- var l;
6172
+ var a;
6102
6173
  if (!this.container) return;
6103
- const i = (l = this.client.state.user) == null ? void 0 : l.id;
6174
+ const i = (a = this.client.state.user) == null ? void 0 : a.id;
6104
6175
  if (e === i || (this.clearSelection(e), !t)) return;
6105
- const s = ps(t);
6176
+ const s = gs(t);
6106
6177
  if (!s) return;
6107
6178
  const o = this.client.state.presence.find(
6108
- (a) => a.user.id === e
6179
+ (l) => l.user.id === e
6109
6180
  ), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
6110
6181
  try {
6111
- const a = s.getClientRects(), c = [];
6112
- for (let h = 0; h < a.length; h++) {
6113
- const p = a[h], u = document.createElement("div");
6114
- Object.assign(u.style, {
6182
+ const l = s.getClientRects(), d = [];
6183
+ for (let c = 0; c < l.length; c++) {
6184
+ const h = l[c], p = document.createElement("div");
6185
+ Object.assign(p.style, {
6115
6186
  position: "absolute",
6116
- left: `${p.left}px`,
6117
- top: `${p.top}px`,
6118
- width: `${p.width}px`,
6119
- height: `${p.height}px`,
6187
+ left: `${h.left}px`,
6188
+ top: `${h.top}px`,
6189
+ width: `${h.width}px`,
6190
+ height: `${h.height}px`,
6120
6191
  background: r,
6121
6192
  opacity: "0.2",
6122
6193
  borderRadius: "2px",
6123
6194
  pointerEvents: "none"
6124
- }), this.container.appendChild(u), c.push(u);
6195
+ }), this.container.appendChild(p), d.push(p);
6125
6196
  }
6126
- this.selectionEls.set(e, c);
6197
+ this.selectionEls.set(e, d);
6127
6198
  } catch {
6128
6199
  }
6129
6200
  this.clearTimers.has(e) && clearTimeout(this.clearTimers.get(e)), this.clearTimers.set(
@@ -6141,12 +6212,12 @@ class us {
6141
6212
  }
6142
6213
  }
6143
6214
  }
6144
- var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
6145
- for (var s = i > 1 ? void 0 : i ? ms(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6215
+ var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
6216
+ for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6146
6217
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6147
- return i && s && fs(e, t, s), s;
6218
+ return i && s && vs(e, t, s), s;
6148
6219
  };
6149
- let pe = class extends P {
6220
+ let ue = class extends A {
6150
6221
  constructor() {
6151
6222
  super(...arguments), this.roomId = "";
6152
6223
  }
@@ -6166,7 +6237,7 @@ let pe = class extends P {
6166
6237
  );
6167
6238
  }
6168
6239
  renderToggle(n, e) {
6169
- return d`
6240
+ return u`
6170
6241
  <div class="setting-row">
6171
6242
  <span class="setting-label">${n}</span>
6172
6243
  <label class="toggle">
@@ -6182,12 +6253,12 @@ let pe = class extends P {
6182
6253
  }
6183
6254
  render() {
6184
6255
  const n = !this.settings.enabled;
6185
- return d`
6256
+ return u`
6186
6257
  <div class="panel">
6187
6258
  <div class="panel-header">
6188
6259
  <span class="panel-title">Settings</span>
6189
6260
  <button class="close-btn" @click=${this.fireClose} title="Close">
6190
- ${C(ge, 16)}
6261
+ ${C(be, 16)}
6191
6262
  </button>
6192
6263
  </div>
6193
6264
 
@@ -6232,11 +6303,11 @@ let pe = class extends P {
6232
6303
  `;
6233
6304
  }
6234
6305
  };
6235
- pe.styles = [
6236
- te,
6237
- be,
6238
- Se,
6239
- O`
6306
+ ue.styles = [
6307
+ ie,
6308
+ ve,
6309
+ Pe,
6310
+ M`
6240
6311
  :host {
6241
6312
  display: block;
6242
6313
  }
@@ -6407,16 +6478,16 @@ pe.styles = [
6407
6478
  }
6408
6479
  `
6409
6480
  ];
6410
- Xe([
6411
- v({ attribute: !1 })
6412
- ], pe.prototype, "settings", 2);
6413
- Xe([
6414
- v()
6415
- ], pe.prototype, "roomId", 2);
6416
- pe = Xe([
6481
+ Ye([
6482
+ x({ attribute: !1 })
6483
+ ], ue.prototype, "settings", 2);
6484
+ Ye([
6485
+ x()
6486
+ ], ue.prototype, "roomId", 2);
6487
+ ue = Ye([
6417
6488
  L("pulse-widget-settings-panel")
6418
- ], pe);
6419
- const we = {
6489
+ ], ue);
6490
+ const $e = {
6420
6491
  enabled: !0,
6421
6492
  showMyCursor: !0,
6422
6493
  showOthersCursors: !0,
@@ -6427,24 +6498,24 @@ const we = {
6427
6498
  showViewportIndicators: !0,
6428
6499
  showSelections: !0,
6429
6500
  showDrawings: !0
6430
- }, Pt = "pulse:settings:";
6431
- function gs(n) {
6501
+ }, _t = "pulse:settings:";
6502
+ function ys(n) {
6432
6503
  try {
6433
- const e = localStorage.getItem(`${Pt}${n}`);
6434
- return e ? { ...we, ...JSON.parse(e) } : { ...we };
6504
+ const e = localStorage.getItem(`${_t}${n}`);
6505
+ return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
6435
6506
  } catch {
6436
- return { ...we };
6507
+ return { ...$e };
6437
6508
  }
6438
6509
  }
6439
- function bs(n, e) {
6440
- localStorage.setItem(`${Pt}${n}`, JSON.stringify(e));
6510
+ function ws(n, e) {
6511
+ localStorage.setItem(`${_t}${n}`, JSON.stringify(e));
6441
6512
  }
6442
- var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6443
- for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6513
+ var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
6514
+ for (var s = i > 1 ? void 0 : i ? ks(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6444
6515
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6445
- return i && s && vs(e, t, s), s;
6516
+ return i && s && $s(e, t, s), s;
6446
6517
  };
6447
- let R = class extends P {
6518
+ let R = class extends A {
6448
6519
  constructor() {
6449
6520
  super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.users = [], this.unreadCount = 0;
6450
6521
  }
@@ -6452,16 +6523,18 @@ let R = class extends P {
6452
6523
  super.connectedCallback(), this.setupPresence();
6453
6524
  }
6454
6525
  disconnectedCallback() {
6455
- var n, e;
6456
- super.disconnectedCallback(), (n = this.unsub) == null || n.call(this), (e = this.notifUnsub) == null || e.call(this);
6526
+ var n, e, t;
6527
+ super.disconnectedCallback(), (n = this.unsub) == null || n.call(this), (e = this.authUnsub) == null || e.call(this), (t = this.notifUnsub) == null || t.call(this);
6457
6528
  }
6458
6529
  updated(n) {
6459
- var e, t;
6460
- n.has("client") && this.client && ((e = this.unsub) == null || e.call(this), (t = this.notifUnsub) == null || t.call(this), this.setupPresence());
6530
+ var e, t, i;
6531
+ n.has("client") && this.client && ((e = this.unsub) == null || e.call(this), (t = this.authUnsub) == null || t.call(this), (i = this.notifUnsub) == null || i.call(this), this.setupPresence());
6461
6532
  }
6462
6533
  setupPresence() {
6463
6534
  this.client && (this.users = this.client.state.presence, this.unreadCount = this.client.state.unreadCount, this.unsub = this.client.state.on("presence", (n) => {
6464
- this.users = n;
6535
+ this.users = [...n];
6536
+ }), this.authUnsub = this.client.state.on("auth", () => {
6537
+ this.users = this.client.state.presence, this.unreadCount = this.client.state.unreadCount;
6465
6538
  }), this.notifUnsub = this.client.state.on("notifications", () => {
6466
6539
  this.unreadCount = this.client.state.unreadCount;
6467
6540
  }));
@@ -6495,35 +6568,35 @@ let R = class extends P {
6495
6568
  render() {
6496
6569
  const n = this.display === "inline";
6497
6570
  if (this.collapsed)
6498
- return d`
6571
+ return u`
6499
6572
  <div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
6500
- <span class="fab-icon">${C(Li, n ? 18 : 24)}</span>
6573
+ <span class="fab-icon">${C(zi, n ? 18 : 24)}</span>
6501
6574
  </div>
6502
6575
  `;
6503
6576
  const e = this.users.slice(0, 3), t = this.users.length - 3;
6504
- return d`
6577
+ return u`
6505
6578
  <div class="toolbar ${n ? "inline" : ""}"
6506
6579
  <!-- Presence avatars -->
6507
- ${this.users.length > 0 ? d`
6580
+ ${this.users.length > 0 ? u`
6508
6581
  <div class="presence">
6509
- ${t > 0 ? d`<div class="presence-overflow">+${t}</div>` : g}
6582
+ ${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : b}
6510
6583
  ${e.map(
6511
- (i) => d`
6584
+ (i) => u`
6512
6585
  <div
6513
6586
  class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
6514
6587
  style="background:${i.user.color}"
6515
6588
  @click=${() => this.fireFollow(i.user.id)}
6516
6589
  title="Click to follow ${i.user.name}"
6517
6590
  >
6518
- ${i.user.avatar ? d`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6591
+ ${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6519
6592
  <span class="presence-tooltip">${i.user.name}</span>
6520
- ${i.deviceType && i.deviceType !== "desktop" ? d`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : g}
6593
+ ${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : b}
6521
6594
  </div>
6522
6595
  `
6523
6596
  )}
6524
6597
  </div>
6525
6598
  <div class="separator"></div>
6526
- ` : g}
6599
+ ` : b}
6527
6600
 
6528
6601
  <!-- Pin comment (primary) -->
6529
6602
  <button
@@ -6533,7 +6606,7 @@ let R = class extends P {
6533
6606
  ?disabled=${this.featuresDisabled}
6534
6607
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6535
6608
  >
6536
- ${C(St)}
6609
+ ${C(Pt)}
6537
6610
  </button>
6538
6611
 
6539
6612
  <!-- View comments -->
@@ -6544,7 +6617,7 @@ let R = class extends P {
6544
6617
  ?disabled=${this.featuresDisabled}
6545
6618
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6546
6619
  >
6547
- ${C(_i)}
6620
+ ${C(Pi)}
6548
6621
  </button>
6549
6622
 
6550
6623
  <!-- Activity feed -->
@@ -6555,7 +6628,7 @@ let R = class extends P {
6555
6628
  ?disabled=${this.featuresDisabled}
6556
6629
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6557
6630
  >
6558
- ${C(Ti)}
6631
+ ${C(Ai)}
6559
6632
  </button>
6560
6633
 
6561
6634
  <!-- Draw mode -->
@@ -6566,7 +6639,7 @@ let R = class extends P {
6566
6639
  ?disabled=${this.featuresDisabled}
6567
6640
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
6568
6641
  >
6569
- ${C(Ai)}
6642
+ ${C(Mi)}
6570
6643
  </button>
6571
6644
 
6572
6645
  <!-- Notifications -->
@@ -6577,8 +6650,8 @@ let R = class extends P {
6577
6650
  ?disabled=${this.featuresDisabled}
6578
6651
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
6579
6652
  >
6580
- ${C(Ci)}
6581
- ${this.unreadCount > 0 ? d`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : g}
6653
+ ${C(Si)}
6654
+ ${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : b}
6582
6655
  </button>
6583
6656
 
6584
6657
  <!-- Settings -->
@@ -6587,7 +6660,7 @@ let R = class extends P {
6587
6660
  @click=${() => this.fire("settings")}
6588
6661
  title="Settings"
6589
6662
  >
6590
- ${C(Mi)}
6663
+ ${C(Ri)}
6591
6664
  </button>
6592
6665
 
6593
6666
  <div class="separator"></div>
@@ -6598,16 +6671,16 @@ let R = class extends P {
6598
6671
  @click=${this.fireToggle}
6599
6672
  title="Collapse"
6600
6673
  >
6601
- ${C(ge, 14)}
6674
+ ${C(be, 14)}
6602
6675
  </button>
6603
6676
  </div>
6604
6677
  `;
6605
6678
  }
6606
6679
  };
6607
6680
  R.styles = [
6608
- te,
6609
- be,
6610
- O`
6681
+ ie,
6682
+ ve,
6683
+ M`
6611
6684
  :host {
6612
6685
  display: block;
6613
6686
  }
@@ -6820,39 +6893,39 @@ R.styles = [
6820
6893
  `
6821
6894
  ];
6822
6895
  j([
6823
- v({ attribute: !1 })
6896
+ x({ attribute: !1 })
6824
6897
  ], R.prototype, "client", 2);
6825
6898
  j([
6826
- v({ type: Boolean })
6899
+ x({ type: Boolean })
6827
6900
  ], R.prototype, "collapsed", 2);
6828
6901
  j([
6829
- v()
6902
+ x()
6830
6903
  ], R.prototype, "activePanel", 2);
6831
6904
  j([
6832
- v({ type: Boolean })
6905
+ x({ type: Boolean })
6833
6906
  ], R.prototype, "pinModeActive", 2);
6834
6907
  j([
6835
- v({ type: Boolean })
6908
+ x({ type: Boolean })
6836
6909
  ], R.prototype, "featuresDisabled", 2);
6837
6910
  j([
6838
- v({ type: Boolean })
6911
+ x({ type: Boolean })
6839
6912
  ], R.prototype, "drawModeActive", 2);
6840
6913
  j([
6841
- v()
6914
+ x()
6842
6915
  ], R.prototype, "followingUserId", 2);
6843
6916
  j([
6844
- v()
6917
+ x()
6845
6918
  ], R.prototype, "display", 2);
6846
6919
  j([
6847
- w()
6920
+ $()
6848
6921
  ], R.prototype, "users", 2);
6849
6922
  j([
6850
- w()
6923
+ $()
6851
6924
  ], R.prototype, "unreadCount", 2);
6852
6925
  R = j([
6853
6926
  L("pulse-widget-toolbar")
6854
6927
  ], R);
6855
- class ys {
6928
+ class Es {
6856
6929
  constructor(e) {
6857
6930
  this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
6858
6931
  }
@@ -6886,30 +6959,30 @@ class ys {
6886
6959
  var r;
6887
6960
  if (!this.container) return;
6888
6961
  if (document.documentElement.scrollHeight <= window.innerHeight) {
6889
- for (const l of this.pillEls.values()) l.remove();
6962
+ for (const a of this.pillEls.values()) a.remove();
6890
6963
  this.pillEls.clear();
6891
6964
  return;
6892
6965
  }
6893
6966
  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();
6894
- for (const [l, a] of this.client.state.viewports) {
6895
- if (l === s) continue;
6896
- const c = a.scrollY, h = a.scrollY + a.viewportHeight, p = e, u = e + t;
6897
- if (c >= p && h <= u) {
6898
- const E = this.pillEls.get(l);
6967
+ for (const [a, l] of this.client.state.viewports) {
6968
+ if (a === s) continue;
6969
+ const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, p = e + t;
6970
+ if (d >= h && c <= p) {
6971
+ const E = this.pillEls.get(a);
6899
6972
  E && (E.style.display = "none");
6900
6973
  continue;
6901
6974
  }
6902
- o.add(l);
6903
- const f = this.client.state.presence.find(
6904
- (E) => E.user.id === l
6975
+ o.add(a);
6976
+ const m = this.client.state.presence.find(
6977
+ (E) => E.user.id === a
6905
6978
  );
6906
- if (!f) continue;
6907
- const m = a.scrollY + a.viewportHeight / 2, x = i > 0 ? m / i : 0, b = Math.max(
6979
+ if (!m) continue;
6980
+ const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, v = Math.max(
6908
6981
  8,
6909
- Math.min(t - 28, x * t)
6982
+ Math.min(t - 28, y * t)
6910
6983
  );
6911
- let y = this.pillEls.get(l);
6912
- y || (y = document.createElement("div"), Object.assign(y.style, {
6984
+ let w = this.pillEls.get(a);
6985
+ w || (w = document.createElement("div"), Object.assign(w.style, {
6913
6986
  position: "absolute",
6914
6987
  right: "8px",
6915
6988
  padding: "2px 6px",
@@ -6921,23 +6994,23 @@ class ys {
6921
6994
  whiteSpace: "nowrap",
6922
6995
  pointerEvents: "none",
6923
6996
  transition: "top 0.3s ease"
6924
- }), this.container.appendChild(y), this.pillEls.set(l, y)), y.style.display = "", y.style.background = f.user.color, y.style.top = `${b}px`, y.textContent = this.getInitials(f.user.name);
6997
+ }), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${v}px`, w.textContent = this.getInitials(m.user.name);
6925
6998
  }
6926
- for (const [l, a] of this.pillEls)
6927
- !o.has(l) && !this.client.state.viewports.has(l) && (a.remove(), this.pillEls.delete(l));
6999
+ for (const [a, l] of this.pillEls)
7000
+ !o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
6928
7001
  }
6929
7002
  getInitials(e) {
6930
7003
  return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
6931
7004
  }
6932
7005
  }
6933
- var ws = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, I = (n, e, t, i) => {
6934
- for (var s = i > 1 ? void 0 : i ? $s(e, t) : e, o = n.length - 1, r; o >= 0; o--)
7006
+ var Cs = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, _ = (n, e, t, i) => {
7007
+ for (var s = i > 1 ? void 0 : i ? Ts(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6935
7008
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6936
- return i && s && ws(e, t, s), s;
7009
+ return i && s && Cs(e, t, s), s;
6937
7010
  };
6938
- let T = class extends P {
7011
+ let T = class extends A {
6939
7012
  constructor() {
6940
- 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 = { ...we }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
7013
+ 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.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
6941
7014
  !this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
6942
7015
  var n;
6943
7016
  this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
@@ -6958,7 +7031,7 @@ let T = class extends P {
6958
7031
  (t = this.client) == null || t.updateSelection(null);
6959
7032
  return;
6960
7033
  }
6961
- const e = hs(n);
7034
+ const e = ms(n);
6962
7035
  (i = this.client) == null || i.updateSelection(e);
6963
7036
  }, 500));
6964
7037
  }, this.handleDocumentClick = (n) => {
@@ -6990,11 +7063,11 @@ let T = class extends P {
6990
7063
  room: this.room,
6991
7064
  endpoint: this.endpoint
6992
7065
  };
6993
- this.client = new wt(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new cs(this.client), this.commentPins = new es(this.client, {
7066
+ this.client = new $t(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new us(this.client), this.commentPins = new ns(this.client, {
6994
7067
  onPinModeExit: () => {
6995
7068
  this.pinModeActive = !1;
6996
7069
  }
6997
- }), this.viewportOverlay = new ys(this.client), this.selectionOverlay = new us(this.client), this.drawingOverlay = new ds(this.client), this.settings = gs(this.room), this.applySettings(this.settings), this.unsubs.push(
7070
+ }), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new bs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
6998
7071
  this.client.on("connection", (e) => {
6999
7072
  this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
7000
7073
  this.showConnectedFlash = !1, this._connectedFlashTimer = null;
@@ -7061,15 +7134,15 @@ let T = class extends P {
7061
7134
  }
7062
7135
  handleSettingsChange(n) {
7063
7136
  const e = n.detail;
7064
- this.settings = e, bs(this.room, e), this.applySettings(e);
7137
+ this.settings = e, ws(this.room, e), this.applySettings(e);
7065
7138
  }
7066
7139
  applySettings(n) {
7067
- var e, t, i, s, o, r, l, a, c, h, p, u, f, m, x, b, y;
7140
+ var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, v, w;
7068
7141
  if (!n.enabled) {
7069
- (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), (l = this.commentPins) == null || l.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((a = this.commentPins) == null || a.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
7142
+ (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;
7070
7143
  return;
7071
7144
  }
7072
- this.applyCursorSettings(n), (c = this.client) == null || c.setAppearOffline(n.appearOffline), (h = this.commentPins) == null || h.setVisible(n.showCommentPins), n.showViewportIndicators ? (p = this.viewportOverlay) == null || p.enable() : (u = this.viewportOverlay) == null || u.disable(), n.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (m = this.selectionOverlay) == null || m.disable(), n.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((b = this.drawingOverlay) == null || b.disable(), this.drawModeActive && ((y = this.drawingOverlay) == null || y.disableDrawMode(), this.drawModeActive = !1));
7145
+ 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() : ((v = this.drawingOverlay) == null || v.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
7073
7146
  }
7074
7147
  applyCursorSettings(n) {
7075
7148
  if (!this.cursorOverlay) return;
@@ -7083,30 +7156,30 @@ let T = class extends P {
7083
7156
  * the trigger element, flipping vertically/horizontally as needed.
7084
7157
  */
7085
7158
  positionPopups() {
7086
- var m, x, b, y;
7087
- const n = this.display === "inline", e = (m = this.shadowRoot) == null ? void 0 : m.querySelector(".inline-trigger"), t = (x = this.shadowRoot) == null ? void 0 : x.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7159
+ var g, y, v, w;
7160
+ 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;
7088
7161
  if (!i) return;
7089
- const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, l = 8, a = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".toolbar-popover");
7090
- if (a) {
7091
- Object.assign(a.style, { top: "auto", left: "auto" });
7092
- const E = a.getBoundingClientRect(), M = this.computePosition(s, E, o, r, l);
7093
- a.style.top = `${M.top}px`, a.style.left = `${M.left}px`;
7094
- }
7095
- const c = (y = this.shadowRoot) == null ? void 0 : y.querySelector(".panel-container");
7162
+ const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".toolbar-popover");
7163
+ if (l) {
7164
+ Object.assign(l.style, { top: "auto", left: "auto" });
7165
+ const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
7166
+ l.style.top = `${I.top}px`, l.style.left = `${I.left}px`;
7167
+ }
7168
+ const d = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
7169
+ if (!d) return;
7170
+ Object.assign(d.style, { top: "auto", left: "auto" });
7171
+ const c = l ?? t;
7096
7172
  if (!c) return;
7097
- Object.assign(c.style, { top: "auto", left: "auto" });
7098
- const h = a ?? t;
7099
- if (!h) return;
7100
- const p = h.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(p, u, o, r, l);
7101
- c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
7173
+ const h = c.getBoundingClientRect(), p = d.getBoundingClientRect(), m = this.computePosition(h, p, o, r, a);
7174
+ d.style.top = `${m.top}px`, d.style.left = `${m.left}px`;
7102
7175
  }
7103
7176
  computePosition(n, e, t, i, s) {
7104
7177
  const o = n.top, r = i - n.bottom;
7105
- let l;
7106
- o >= e.height + s ? l = n.top - e.height - s : r >= e.height + s ? l = n.bottom + s : l = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
7107
7178
  let a;
7108
- const c = n.right - e.width;
7109
- return c >= s ? a = c : n.left + e.width + s <= t ? a = n.left : a = Math.max(s, Math.min(t - e.width - s, n.left)), l = Math.max(s, Math.min(i - e.height - s, l)), a = Math.max(s, Math.min(t - e.width - s, a)), { top: l, left: a };
7179
+ o >= e.height + s ? a = n.top - e.height - s : r >= e.height + s ? a = n.bottom + s : a = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
7180
+ let l;
7181
+ const d = n.right - e.width;
7182
+ return d >= s ? l = d : n.left + e.width + s <= t ? l = n.left : l = Math.max(s, Math.min(t - e.width - s, n.left)), a = Math.max(s, Math.min(i - e.height - s, a)), l = Math.max(s, Math.min(t - e.width - s, l)), { top: a, left: l };
7110
7183
  }
7111
7184
  getFollowUserName() {
7112
7185
  var e;
@@ -7117,13 +7190,13 @@ let T = class extends P {
7117
7190
  return (n == null ? void 0 : n.user.name) ?? "user";
7118
7191
  }
7119
7192
  renderConnectionBanner() {
7120
- return this.showConnectedFlash ? d`<div class="connection-banner connected">
7193
+ return this.showConnectedFlash ? u`<div class="connection-banner connected">
7121
7194
  <span class="connection-dot"></span>Connected
7122
- </div>` : this.connectionState === "connecting" ? d`<div class="connection-banner connecting">
7195
+ </div>` : this.connectionState === "connecting" ? u`<div class="connection-banner connecting">
7123
7196
  <span class="connection-dot"></span>Reconnecting...
7124
- </div>` : this.connectionState === "disconnected" && this.client ? d`<div class="connection-banner disconnected">
7197
+ </div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
7125
7198
  <span class="connection-dot"></span>Disconnected
7126
- </div>` : g;
7199
+ </div>` : b;
7127
7200
  }
7128
7201
  handleToolbarToggle() {
7129
7202
  this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
@@ -7131,38 +7204,38 @@ let T = class extends P {
7131
7204
  render() {
7132
7205
  const n = this.display === "inline";
7133
7206
  if (n && this.collapsed)
7134
- return d`
7207
+ return u`
7135
7208
  <div class="widget-root">
7136
7209
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
7137
7210
  <slot>Collaborate</slot>
7138
7211
  </div>
7139
7212
  </div>
7140
7213
  `;
7141
- const e = this.activePanel ? d`
7214
+ const e = this.activePanel ? u`
7142
7215
  <div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
7143
- ${this.activePanel === "comments" ? d`<pulse-widget-comments-panel
7216
+ ${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
7144
7217
  .client=${this.client}
7145
7218
  .highlightThreadId=${this.highlightThreadId}
7146
- ></pulse-widget-comments-panel>` : g}
7147
- ${this.activePanel === "settings" ? d`<pulse-widget-settings-panel
7219
+ ></pulse-widget-comments-panel>` : b}
7220
+ ${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
7148
7221
  .settings=${this.settings}
7149
7222
  .roomId=${this.room}
7150
7223
  @settings-change=${this.handleSettingsChange}
7151
- ></pulse-widget-settings-panel>` : g}
7152
- ${this.activePanel === "notifications" ? d`<pulse-widget-notifications-panel
7224
+ ></pulse-widget-settings-panel>` : b}
7225
+ ${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
7153
7226
  .client=${this.client}
7154
- ></pulse-widget-notifications-panel>` : g}
7155
- ${this.activePanel === "activity" ? d`<pulse-widget-activity-panel
7227
+ ></pulse-widget-notifications-panel>` : b}
7228
+ ${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
7156
7229
  .client=${this.client}
7157
- ></pulse-widget-activity-panel>` : g}
7230
+ ></pulse-widget-activity-panel>` : b}
7158
7231
  </div>
7159
- ` : g, t = this.followingUserId ? d`<div class="follow-banner">
7232
+ ` : b, t = this.followingUserId ? u`<div class="follow-banner">
7160
7233
  Following ${this.getFollowUserName()}
7161
7234
  <button @click=${() => {
7162
7235
  this.followingUserId = null;
7163
7236
  }}>Stop</button>
7164
- </div>` : g;
7165
- return n ? d`
7237
+ </div>` : b;
7238
+ return n ? u`
7166
7239
  ${t}
7167
7240
  <div class="widget-root">
7168
7241
  <div class="inline-trigger" @click=${this.handleToolbarToggle}>
@@ -7186,7 +7259,7 @@ let T = class extends P {
7186
7259
  </div>
7187
7260
  ${e}
7188
7261
  </div>
7189
- ` : d`
7262
+ ` : u`
7190
7263
  ${t}
7191
7264
  <div class="widget-root">
7192
7265
  ${e}
@@ -7209,8 +7282,8 @@ let T = class extends P {
7209
7282
  }
7210
7283
  };
7211
7284
  T.styles = [
7212
- te,
7213
- O`
7285
+ ie,
7286
+ M`
7214
7287
  :host {
7215
7288
  display: block;
7216
7289
  }
@@ -7386,60 +7459,60 @@ T.styles = [
7386
7459
  }
7387
7460
  `
7388
7461
  ];
7389
- I([
7390
- v({ attribute: "api-key" })
7462
+ _([
7463
+ x({ attribute: "api-key" })
7391
7464
  ], T.prototype, "apiKey", 2);
7392
- I([
7393
- v()
7465
+ _([
7466
+ x()
7394
7467
  ], T.prototype, "token", 2);
7395
- I([
7396
- v()
7468
+ _([
7469
+ x()
7397
7470
  ], T.prototype, "room", 2);
7398
- I([
7399
- v()
7471
+ _([
7472
+ x()
7400
7473
  ], T.prototype, "endpoint", 2);
7401
- I([
7402
- v({ reflect: !0 })
7474
+ _([
7475
+ x({ reflect: !0 })
7403
7476
  ], T.prototype, "position", 2);
7404
- I([
7405
- v({ reflect: !0 })
7477
+ _([
7478
+ x({ reflect: !0 })
7406
7479
  ], T.prototype, "display", 2);
7407
- I([
7408
- w()
7480
+ _([
7481
+ $()
7409
7482
  ], T.prototype, "collapsed", 2);
7410
- I([
7411
- w()
7483
+ _([
7484
+ $()
7412
7485
  ], T.prototype, "activePanel", 2);
7413
- I([
7414
- w()
7486
+ _([
7487
+ $()
7415
7488
  ], T.prototype, "pinModeActive", 2);
7416
- I([
7417
- w()
7489
+ _([
7490
+ $()
7418
7491
  ], T.prototype, "highlightThreadId", 2);
7419
- I([
7420
- w()
7492
+ _([
7493
+ $()
7421
7494
  ], T.prototype, "settings", 2);
7422
- I([
7423
- w()
7495
+ _([
7496
+ $()
7424
7497
  ], T.prototype, "followingUserId", 2);
7425
- I([
7426
- w()
7498
+ _([
7499
+ $()
7427
7500
  ], T.prototype, "drawModeActive", 2);
7428
- I([
7429
- w()
7501
+ _([
7502
+ $()
7430
7503
  ], T.prototype, "connectionState", 2);
7431
- I([
7432
- w()
7504
+ _([
7505
+ $()
7433
7506
  ], T.prototype, "showConnectedFlash", 2);
7434
- T = I([
7507
+ T = _([
7435
7508
  L("pulse-widget")
7436
7509
  ], T);
7437
7510
  export {
7438
- X as PulseComments,
7439
- ce as PulseCursors,
7440
- de as PulseNotifications,
7511
+ Y as PulseComments,
7512
+ de as PulseCursors,
7513
+ he as PulseNotifications,
7441
7514
  Z as PulsePresence,
7442
- W as PulseProvider,
7443
- H as PulseReactions,
7515
+ X as PulseProvider,
7516
+ N as PulseReactions,
7444
7517
  T as PulseWidget
7445
7518
  };