@gamention/pulse-elements 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/pulse-elements.cjs +205 -186
- package/dist/pulse-elements.js +906 -770
- package/package.json +2 -2
package/dist/pulse-elements.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
6
|
+
let Et = class extends Event {
|
|
7
7
|
constructor(e, t, i, s) {
|
|
8
8
|
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = s ?? !1;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ let kt = class extends Event {
|
|
|
18
18
|
* Copyright 2021 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
20
|
*/
|
|
21
|
-
let
|
|
21
|
+
let Je = class {
|
|
22
22
|
constructor(e, t, i, s) {
|
|
23
23
|
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
|
|
24
24
|
this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
|
|
@@ -35,7 +35,7 @@ let Ge = class {
|
|
|
35
35
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
36
36
|
}
|
|
37
37
|
dispatchRequest() {
|
|
38
|
-
this.host.dispatchEvent(new
|
|
38
|
+
this.host.dispatchEvent(new Et(this.context, this.host, this.t, this.subscribe));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
@@ -43,7 +43,7 @@ let Ge = class {
|
|
|
43
43
|
* Copyright 2021 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
45
|
*/
|
|
46
|
-
let
|
|
46
|
+
let Ut = class {
|
|
47
47
|
get value() {
|
|
48
48
|
return this.o;
|
|
49
49
|
}
|
|
@@ -76,11 +76,11 @@ let Lt = class {
|
|
|
76
76
|
* Copyright 2021 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
let
|
|
79
|
+
let zt = class extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
81
81
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Ze = class extends Ut {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
85
|
var s, o;
|
|
86
86
|
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
@@ -90,7 +90,7 @@ let jt = class extends Event {
|
|
|
90
90
|
}, this.onProviderRequest = (r) => {
|
|
91
91
|
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
92
|
const a = /* @__PURE__ */ new Set();
|
|
93
|
-
for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new
|
|
93
|
+
for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new Et(this.context, d, l, !0)));
|
|
94
94
|
r.stopPropagation();
|
|
95
95
|
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (s = this.host).addController) == null || o.call(s, this);
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ let jt = 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
|
|
101
|
+
this.host.dispatchEvent(new zt(this.context, this.host));
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
@@ -106,7 +106,7 @@ let jt = class extends Event {
|
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
108
|
*/
|
|
109
|
-
function
|
|
109
|
+
function Dt({ context: n }) {
|
|
110
110
|
return (e, t) => {
|
|
111
111
|
const i = /* @__PURE__ */ new WeakMap();
|
|
112
112
|
if (typeof t == "object") return { get() {
|
|
@@ -114,11 +114,11 @@ function zt({ 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
|
|
117
|
+
return i.set(this, new Ze(this, { context: n, initialValue: s })), s;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
120
|
e.constructor.addInitializer(((r) => {
|
|
121
|
-
i.set(r, new
|
|
121
|
+
i.set(r, new Ze(r, { context: n }));
|
|
122
122
|
}));
|
|
123
123
|
const s = Object.getOwnPropertyDescriptor(e, t);
|
|
124
124
|
let o;
|
|
@@ -147,17 +147,17 @@ function zt({ context: n }) {
|
|
|
147
147
|
function fe({ context: n, subscribe: e }) {
|
|
148
148
|
return (t, i) => {
|
|
149
149
|
typeof i == "object" ? i.addInitializer((function() {
|
|
150
|
-
new
|
|
150
|
+
new Je(this, { context: n, callback: (s) => {
|
|
151
151
|
t.set.call(this, s);
|
|
152
152
|
}, subscribe: e });
|
|
153
153
|
})) : t.constructor.addInitializer(((s) => {
|
|
154
|
-
new
|
|
154
|
+
new Je(s, { context: n, callback: (o) => {
|
|
155
155
|
s[i] = o;
|
|
156
156
|
}, subscribe: e });
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
160
|
+
var Ht = Object.defineProperty, Bt = (n, e, t) => e in n ? Ht(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, E = (n, e, t) => Bt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
161
161
|
const _e = {
|
|
162
162
|
allowImages: !0,
|
|
163
163
|
allowAudio: !0,
|
|
@@ -170,10 +170,10 @@ const _e = {
|
|
|
170
170
|
showCursors: !0,
|
|
171
171
|
showPresence: !0,
|
|
172
172
|
showTypingIndicators: !0
|
|
173
|
-
},
|
|
174
|
-
let
|
|
173
|
+
}, Nt = "ws://localhost:4567", Qe = 50, Ft = 3e4, qt = 1e3, Vt = 3e4;
|
|
174
|
+
let Be = class {
|
|
175
175
|
constructor() {
|
|
176
|
-
|
|
176
|
+
E(this, "handlers", /* @__PURE__ */ new Map());
|
|
177
177
|
}
|
|
178
178
|
on(e, t) {
|
|
179
179
|
this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
|
|
@@ -191,9 +191,9 @@ let He = class {
|
|
|
191
191
|
removeAll() {
|
|
192
192
|
this.handlers.clear();
|
|
193
193
|
}
|
|
194
|
-
},
|
|
194
|
+
}, Wt = class extends Be {
|
|
195
195
|
constructor(e) {
|
|
196
|
-
super(),
|
|
196
|
+
super(), E(this, "ws", null), E(this, "endpoint"), E(this, "reconnectAttempt", 0), E(this, "reconnectTimer", null), E(this, "_state", "disconnected"), this.endpoint = e ?? Nt;
|
|
197
197
|
}
|
|
198
198
|
get state() {
|
|
199
199
|
return this._state;
|
|
@@ -221,16 +221,16 @@ let He = class {
|
|
|
221
221
|
}
|
|
222
222
|
scheduleReconnect() {
|
|
223
223
|
const e = Math.min(
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
qt * 2 ** this.reconnectAttempt,
|
|
225
|
+
Vt
|
|
226
226
|
);
|
|
227
227
|
this.reconnectAttempt++, this.reconnectTimer = setTimeout(() => {
|
|
228
228
|
this.reconnectTimer = null, this.connect();
|
|
229
229
|
}, e);
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, Xt = class extends Be {
|
|
232
232
|
constructor() {
|
|
233
|
-
super(...arguments),
|
|
233
|
+
super(...arguments), E(this, "baseUrl", ""), E(this, "_user", null), E(this, "_config", { ..._e }), E(this, "_users", /* @__PURE__ */ new Map()), E(this, "_presence", /* @__PURE__ */ new Map()), E(this, "_threads", /* @__PURE__ */ new Map()), E(this, "_reactions", /* @__PURE__ */ new Map()), E(this, "_notifications", []), E(this, "_activityLogs", []), E(this, "_typing", /* @__PURE__ */ new Map()), E(this, "_viewports", /* @__PURE__ */ new Map()), E(this, "_selections", /* @__PURE__ */ new Map());
|
|
234
234
|
}
|
|
235
235
|
get user() {
|
|
236
236
|
return this._user;
|
|
@@ -278,6 +278,10 @@ let He = class {
|
|
|
278
278
|
getUser(e) {
|
|
279
279
|
return this._users.get(e);
|
|
280
280
|
}
|
|
281
|
+
/** Get all known users (from presence + comment authors). */
|
|
282
|
+
get users() {
|
|
283
|
+
return [...this._users.values()];
|
|
284
|
+
}
|
|
281
285
|
getReactions(e) {
|
|
282
286
|
return this._reactions.get(e) ?? [];
|
|
283
287
|
}
|
|
@@ -453,12 +457,12 @@ let He = class {
|
|
|
453
457
|
reset() {
|
|
454
458
|
this._user = null, this._config = { ..._e }, this._users.clear(), this._presence.clear(), this._threads.clear(), this._reactions.clear(), this._notifications = [], this._activityLogs = [], this._typing.clear(), this._viewports.clear(), this._selections.clear();
|
|
455
459
|
}
|
|
456
|
-
},
|
|
460
|
+
}, Ct = class extends Be {
|
|
457
461
|
constructor(e) {
|
|
458
462
|
var t;
|
|
459
|
-
super(),
|
|
463
|
+
super(), E(this, "state"), E(this, "connection"), E(this, "config"), E(this, "heartbeatTimer", null), E(this, "lastCursorSend", 0), E(this, "pendingCursor", null), E(this, "cursorTimer", null), this.config = e, this.state = new Xt(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
|
|
460
464
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
461
|
-
this.connection = new
|
|
465
|
+
this.connection = new Wt(i), this.connection.on("message", (s) => {
|
|
462
466
|
this.state.handleMessage(s), this.emit(s.type, s);
|
|
463
467
|
}), this.connection.on("state", (s) => {
|
|
464
468
|
this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
|
|
@@ -488,9 +492,9 @@ let He = class {
|
|
|
488
492
|
// ── Cursors ──
|
|
489
493
|
moveCursor(e) {
|
|
490
494
|
const t = Date.now();
|
|
491
|
-
this.pendingCursor = e, t - this.lastCursorSend >=
|
|
495
|
+
this.pendingCursor = e, t - this.lastCursorSend >= Qe ? this.flushCursor() : this.cursorTimer || (this.cursorTimer = setTimeout(() => {
|
|
492
496
|
this.cursorTimer = null, this.flushCursor();
|
|
493
|
-
},
|
|
497
|
+
}, Qe));
|
|
494
498
|
}
|
|
495
499
|
flushCursor() {
|
|
496
500
|
this.pendingCursor && (this.send({ type: "cursor:move", position: this.pendingCursor }), this.lastCursorSend = Date.now(), this.pendingCursor = null);
|
|
@@ -502,7 +506,7 @@ let He = class {
|
|
|
502
506
|
startHeartbeat() {
|
|
503
507
|
this.heartbeatTimer = setInterval(() => {
|
|
504
508
|
this.send({ type: "presence:update", status: "online" });
|
|
505
|
-
},
|
|
509
|
+
}, Ft);
|
|
506
510
|
}
|
|
507
511
|
stopHeartbeat() {
|
|
508
512
|
this.heartbeatTimer && (clearInterval(this.heartbeatTimer), this.heartbeatTimer = null);
|
|
@@ -602,10 +606,10 @@ let He = class {
|
|
|
602
606
|
* Copyright 2019 Google LLC
|
|
603
607
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
604
608
|
*/
|
|
605
|
-
const ye = globalThis, Ne = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
|
|
606
|
-
let
|
|
609
|
+
const ye = globalThis, Ne = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Fe = Symbol(), et = /* @__PURE__ */ new WeakMap();
|
|
610
|
+
let Tt = class {
|
|
607
611
|
constructor(e, t, i) {
|
|
608
|
-
if (this._$cssResult$ = !0, i !==
|
|
612
|
+
if (this._$cssResult$ = !0, i !== Fe) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
609
613
|
this.cssText = e, this.t = t;
|
|
610
614
|
}
|
|
611
615
|
get styleSheet() {
|
|
@@ -613,7 +617,7 @@ let Ct = class {
|
|
|
613
617
|
const t = this.t;
|
|
614
618
|
if (Ne && e === void 0) {
|
|
615
619
|
const i = t !== void 0 && t.length === 1;
|
|
616
|
-
i && (e =
|
|
620
|
+
i && (e = et.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && et.set(t, e));
|
|
617
621
|
}
|
|
618
622
|
return e;
|
|
619
623
|
}
|
|
@@ -621,33 +625,33 @@ let Ct = class {
|
|
|
621
625
|
return this.cssText;
|
|
622
626
|
}
|
|
623
627
|
};
|
|
624
|
-
const
|
|
628
|
+
const Yt = (n) => new Tt(typeof n == "string" ? n : n + "", void 0, Fe), O = (n, ...e) => {
|
|
625
629
|
const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
|
|
626
630
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
627
631
|
if (typeof r == "number") return r;
|
|
628
632
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
629
633
|
})(s) + n[o + 1], n[0]);
|
|
630
|
-
return new
|
|
631
|
-
},
|
|
634
|
+
return new Tt(t, n, Fe);
|
|
635
|
+
}, Kt = (n, e) => {
|
|
632
636
|
if (Ne) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
633
637
|
else for (const t of e) {
|
|
634
638
|
const i = document.createElement("style"), s = ye.litNonce;
|
|
635
639
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
|
|
636
640
|
}
|
|
637
|
-
},
|
|
641
|
+
}, tt = Ne ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
638
642
|
let t = "";
|
|
639
643
|
for (const i of e.cssRules) t += i.cssText;
|
|
640
|
-
return
|
|
644
|
+
return Yt(t);
|
|
641
645
|
})(n) : n;
|
|
642
646
|
/**
|
|
643
647
|
* @license
|
|
644
648
|
* Copyright 2017 Google LLC
|
|
645
649
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
646
650
|
*/
|
|
647
|
-
const { is:
|
|
651
|
+
const { is: Gt, defineProperty: Jt, getOwnPropertyDescriptor: Zt, getOwnPropertyNames: Qt, getOwnPropertySymbols: ei, getPrototypeOf: ti } = Object, H = globalThis, it = H.trustedTypes, ii = it ? it.emptyScript : "", Ie = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
|
|
648
652
|
switch (e) {
|
|
649
653
|
case Boolean:
|
|
650
|
-
n = n ?
|
|
654
|
+
n = n ? ii : null;
|
|
651
655
|
break;
|
|
652
656
|
case Object:
|
|
653
657
|
case Array:
|
|
@@ -672,7 +676,7 @@ const { is: Yt, defineProperty: Kt, getOwnPropertyDescriptor: Gt, getOwnProperty
|
|
|
672
676
|
}
|
|
673
677
|
}
|
|
674
678
|
return t;
|
|
675
|
-
} },
|
|
679
|
+
} }, qe = (n, e) => !Gt(n, e), st = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: qe };
|
|
676
680
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
677
681
|
let G = class extends HTMLElement {
|
|
678
682
|
static addInitializer(e) {
|
|
@@ -681,14 +685,14 @@ let G = class extends HTMLElement {
|
|
|
681
685
|
static get observedAttributes() {
|
|
682
686
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
683
687
|
}
|
|
684
|
-
static createProperty(e, t =
|
|
688
|
+
static createProperty(e, t = st) {
|
|
685
689
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
686
690
|
const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
|
|
687
|
-
s !== void 0 &&
|
|
691
|
+
s !== void 0 && Jt(this.prototype, e, s);
|
|
688
692
|
}
|
|
689
693
|
}
|
|
690
694
|
static getPropertyDescriptor(e, t, i) {
|
|
691
|
-
const { get: s, set: o } =
|
|
695
|
+
const { get: s, set: o } = Zt(this.prototype, e) ?? { get() {
|
|
692
696
|
return this[t];
|
|
693
697
|
}, set(r) {
|
|
694
698
|
this[t] = r;
|
|
@@ -699,17 +703,17 @@ let G = class extends HTMLElement {
|
|
|
699
703
|
}, configurable: !0, enumerable: !0 };
|
|
700
704
|
}
|
|
701
705
|
static getPropertyOptions(e) {
|
|
702
|
-
return this.elementProperties.get(e) ??
|
|
706
|
+
return this.elementProperties.get(e) ?? st;
|
|
703
707
|
}
|
|
704
708
|
static _$Ei() {
|
|
705
709
|
if (this.hasOwnProperty(ne("elementProperties"))) return;
|
|
706
|
-
const e =
|
|
710
|
+
const e = ti(this);
|
|
707
711
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
708
712
|
}
|
|
709
713
|
static finalize() {
|
|
710
714
|
if (this.hasOwnProperty(ne("finalized"))) return;
|
|
711
715
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
|
|
712
|
-
const t = this.properties, i = [...
|
|
716
|
+
const t = this.properties, i = [...Qt(t), ...ei(t)];
|
|
713
717
|
for (const s of i) this.createProperty(s, t[s]);
|
|
714
718
|
}
|
|
715
719
|
const e = this[Symbol.metadata];
|
|
@@ -728,8 +732,8 @@ let G = class extends HTMLElement {
|
|
|
728
732
|
const t = [];
|
|
729
733
|
if (Array.isArray(e)) {
|
|
730
734
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
731
|
-
for (const s of i) t.unshift(
|
|
732
|
-
} else e !== void 0 && t.push(
|
|
735
|
+
for (const s of i) t.unshift(tt(s));
|
|
736
|
+
} else e !== void 0 && t.push(tt(e));
|
|
733
737
|
return t;
|
|
734
738
|
}
|
|
735
739
|
static _$Eu(e, t) {
|
|
@@ -758,7 +762,7 @@ let G = class extends HTMLElement {
|
|
|
758
762
|
}
|
|
759
763
|
createRenderRoot() {
|
|
760
764
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
761
|
-
return
|
|
765
|
+
return Kt(e, this.constructor.elementStyles), e;
|
|
762
766
|
}
|
|
763
767
|
connectedCallback() {
|
|
764
768
|
var e;
|
|
@@ -801,7 +805,7 @@ let G = class extends HTMLElement {
|
|
|
801
805
|
var r;
|
|
802
806
|
if (e !== void 0) {
|
|
803
807
|
const a = this.constructor;
|
|
804
|
-
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ??
|
|
808
|
+
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? qe)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
|
|
805
809
|
this.C(e, t, i);
|
|
806
810
|
}
|
|
807
811
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -883,50 +887,50 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementPrope
|
|
|
883
887
|
* Copyright 2017 Google LLC
|
|
884
888
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
885
889
|
*/
|
|
886
|
-
const oe = globalThis,
|
|
887
|
-
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
888
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
889
|
-
function
|
|
890
|
-
if (!
|
|
891
|
-
return
|
|
890
|
+
const oe = globalThis, nt = (n) => n, Ee = oe.trustedTypes, ot = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, St = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, At = "?" + D, si = `<${At}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Ve = Array.isArray, ni = (n) => Ve(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Me = `[
|
|
891
|
+
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, at = />/g, N = RegExp(`>|${Me}(?:([^\\s"'>=/]+)(${Me}*=${Me}*(?:[^
|
|
892
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), lt = /'/g, ct = /"/g, Pt = /^(?:script|style|textarea|title)$/i, _t = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), p = _t(1), oi = _t(2), W = Symbol.for("lit-noChange"), g = Symbol.for("lit-nothing"), dt = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
|
|
893
|
+
function It(n, e) {
|
|
894
|
+
if (!Ve(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
895
|
+
return ot !== void 0 ? ot.createHTML(e) : e;
|
|
892
896
|
}
|
|
893
|
-
const
|
|
897
|
+
const ri = (n, e) => {
|
|
894
898
|
const t = n.length - 1, i = [];
|
|
895
899
|
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
|
|
896
900
|
for (let a = 0; a < t; a++) {
|
|
897
901
|
const l = n[a];
|
|
898
|
-
let d, c, h = -1,
|
|
899
|
-
for (;
|
|
900
|
-
const
|
|
901
|
-
o += r === se ? l +
|
|
902
|
+
let d, c, h = -1, u = 0;
|
|
903
|
+
for (; u < l.length && (r.lastIndex = u, c = r.exec(l), c !== null); ) u = r.lastIndex, r === se ? c[1] === "!--" ? r = rt : c[1] !== void 0 ? r = at : c[2] !== void 0 ? (Pt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = N) : c[3] !== void 0 && (r = N) : r === N ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? N : c[3] === '"' ? ct : lt) : r === ct || r === lt ? r = N : r === rt || r === at ? r = se : (r = N, s = void 0);
|
|
904
|
+
const f = r === N && n[a + 1].startsWith("/>") ? " " : "";
|
|
905
|
+
o += r === se ? l + si : h >= 0 ? (i.push(d), l.slice(0, h) + St + l.slice(h) + D + f) : l + D + (h === -2 ? a : f);
|
|
902
906
|
}
|
|
903
|
-
return [
|
|
907
|
+
return [It(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
904
908
|
};
|
|
905
909
|
class ce {
|
|
906
910
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
907
911
|
let s;
|
|
908
912
|
this.parts = [];
|
|
909
913
|
let o = 0, r = 0;
|
|
910
|
-
const a = e.length - 1, l = this.parts, [d, c] =
|
|
914
|
+
const a = e.length - 1, l = this.parts, [d, c] = ri(e, t);
|
|
911
915
|
if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
|
|
912
916
|
const h = this.el.content.firstChild;
|
|
913
917
|
h.replaceWith(...h.childNodes);
|
|
914
918
|
}
|
|
915
919
|
for (; (s = F.nextNode()) !== null && l.length < a; ) {
|
|
916
920
|
if (s.nodeType === 1) {
|
|
917
|
-
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(
|
|
918
|
-
const
|
|
919
|
-
l.push({ type: 1, index: o, name:
|
|
921
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(St)) {
|
|
922
|
+
const u = c[r++], f = s.getAttribute(h).split(D), b = /([.?@])?(.*)/.exec(u);
|
|
923
|
+
l.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? li : b[1] === "?" ? ci : b[1] === "@" ? di : Se }), s.removeAttribute(h);
|
|
920
924
|
} else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
|
|
921
|
-
if (
|
|
922
|
-
const h = s.textContent.split(D),
|
|
923
|
-
if (
|
|
925
|
+
if (Pt.test(s.tagName)) {
|
|
926
|
+
const h = s.textContent.split(D), u = h.length - 1;
|
|
927
|
+
if (u > 0) {
|
|
924
928
|
s.textContent = Ee ? Ee.emptyScript : "";
|
|
925
|
-
for (let
|
|
926
|
-
s.append(h[
|
|
929
|
+
for (let f = 0; f < u; f++) s.append(h[f], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
|
|
930
|
+
s.append(h[u], ae());
|
|
927
931
|
}
|
|
928
932
|
}
|
|
929
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
933
|
+
} else if (s.nodeType === 8) if (s.data === At) l.push({ type: 2, index: o });
|
|
930
934
|
else {
|
|
931
935
|
let h = -1;
|
|
932
936
|
for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
|
|
@@ -946,7 +950,7 @@ function J(n, e, t = n, i) {
|
|
|
946
950
|
const o = le(e) ? void 0 : e._$litDirective$;
|
|
947
951
|
return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = J(n, s._$AS(n, e.values), s, i)), e;
|
|
948
952
|
}
|
|
949
|
-
class
|
|
953
|
+
class ai {
|
|
950
954
|
constructor(e, t) {
|
|
951
955
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
952
956
|
}
|
|
@@ -963,7 +967,7 @@ class oi {
|
|
|
963
967
|
for (; l !== void 0; ) {
|
|
964
968
|
if (r === l.index) {
|
|
965
969
|
let d;
|
|
966
|
-
l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new
|
|
970
|
+
l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new hi(o, this, e)), this._$AV.push(d), l = i[++a];
|
|
967
971
|
}
|
|
968
972
|
r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
|
|
969
973
|
}
|
|
@@ -980,7 +984,7 @@ class me {
|
|
|
980
984
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
981
985
|
}
|
|
982
986
|
constructor(e, t, i, s) {
|
|
983
|
-
this.type = 2, this._$AH =
|
|
987
|
+
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
984
988
|
}
|
|
985
989
|
get parentNode() {
|
|
986
990
|
let e = this._$AA.parentNode;
|
|
@@ -994,7 +998,7 @@ class me {
|
|
|
994
998
|
return this._$AB;
|
|
995
999
|
}
|
|
996
1000
|
_$AI(e, t = this) {
|
|
997
|
-
e = J(this, e, t), le(e) ? e ===
|
|
1001
|
+
e = J(this, e, t), le(e) ? e === g || e == null || e === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : ni(e) ? this.k(e) : this._(e);
|
|
998
1002
|
}
|
|
999
1003
|
O(e) {
|
|
1000
1004
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -1003,23 +1007,23 @@ class me {
|
|
|
1003
1007
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
1004
1008
|
}
|
|
1005
1009
|
_(e) {
|
|
1006
|
-
this._$AH !==
|
|
1010
|
+
this._$AH !== g && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
|
|
1007
1011
|
}
|
|
1008
1012
|
$(e) {
|
|
1009
1013
|
var o;
|
|
1010
|
-
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(
|
|
1014
|
+
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(It(i.h, i.h[0]), this.options)), i);
|
|
1011
1015
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
|
|
1012
1016
|
else {
|
|
1013
|
-
const r = new
|
|
1017
|
+
const r = new ai(s, this), a = r.u(this.options);
|
|
1014
1018
|
r.p(t), this.T(a), this._$AH = r;
|
|
1015
1019
|
}
|
|
1016
1020
|
}
|
|
1017
1021
|
_$AC(e) {
|
|
1018
|
-
let t =
|
|
1019
|
-
return t === void 0 &&
|
|
1022
|
+
let t = dt.get(e.strings);
|
|
1023
|
+
return t === void 0 && dt.set(e.strings, t = new ce(e)), t;
|
|
1020
1024
|
}
|
|
1021
1025
|
k(e) {
|
|
1022
|
-
|
|
1026
|
+
Ve(this._$AH) || (this._$AH = [], this._$AR());
|
|
1023
1027
|
const t = this._$AH;
|
|
1024
1028
|
let i, s = 0;
|
|
1025
1029
|
for (const o of e) s === t.length ? t.push(i = new me(this.O(ae()), this.O(ae()), this, this.options)) : i = t[s], i._$AI(o), s++;
|
|
@@ -1028,8 +1032,8 @@ class me {
|
|
|
1028
1032
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
1029
1033
|
var i;
|
|
1030
1034
|
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
|
|
1031
|
-
const s =
|
|
1032
|
-
|
|
1035
|
+
const s = nt(e).nextSibling;
|
|
1036
|
+
nt(e).remove(), e = s;
|
|
1033
1037
|
}
|
|
1034
1038
|
}
|
|
1035
1039
|
setConnected(e) {
|
|
@@ -1045,7 +1049,7 @@ class Se {
|
|
|
1045
1049
|
return this._$AM._$AU;
|
|
1046
1050
|
}
|
|
1047
1051
|
constructor(e, t, i, s, o) {
|
|
1048
|
-
this.type = 1, this._$AH =
|
|
1052
|
+
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
|
|
1049
1053
|
}
|
|
1050
1054
|
_$AI(e, t = this, i, s) {
|
|
1051
1055
|
const o = this.strings;
|
|
@@ -1054,37 +1058,37 @@ class Se {
|
|
|
1054
1058
|
else {
|
|
1055
1059
|
const a = e;
|
|
1056
1060
|
let l, d;
|
|
1057
|
-
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d ===
|
|
1061
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === g ? e = g : e !== g && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
1058
1062
|
}
|
|
1059
1063
|
r && !s && this.j(e);
|
|
1060
1064
|
}
|
|
1061
1065
|
j(e) {
|
|
1062
|
-
e ===
|
|
1066
|
+
e === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1063
1067
|
}
|
|
1064
1068
|
}
|
|
1065
|
-
class
|
|
1069
|
+
class li extends Se {
|
|
1066
1070
|
constructor() {
|
|
1067
1071
|
super(...arguments), this.type = 3;
|
|
1068
1072
|
}
|
|
1069
1073
|
j(e) {
|
|
1070
|
-
this.element[this.name] = e ===
|
|
1074
|
+
this.element[this.name] = e === g ? void 0 : e;
|
|
1071
1075
|
}
|
|
1072
1076
|
}
|
|
1073
|
-
class
|
|
1077
|
+
class ci extends Se {
|
|
1074
1078
|
constructor() {
|
|
1075
1079
|
super(...arguments), this.type = 4;
|
|
1076
1080
|
}
|
|
1077
1081
|
j(e) {
|
|
1078
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1082
|
+
this.element.toggleAttribute(this.name, !!e && e !== g);
|
|
1079
1083
|
}
|
|
1080
1084
|
}
|
|
1081
|
-
class
|
|
1085
|
+
class di extends Se {
|
|
1082
1086
|
constructor(e, t, i, s, o) {
|
|
1083
1087
|
super(e, t, i, s, o), this.type = 5;
|
|
1084
1088
|
}
|
|
1085
1089
|
_$AI(e, t = this) {
|
|
1086
|
-
if ((e = J(this, e, t, 0) ??
|
|
1087
|
-
const i = this._$AH, s = e ===
|
|
1090
|
+
if ((e = J(this, e, t, 0) ?? g) === W) return;
|
|
1091
|
+
const i = this._$AH, s = e === g && i !== g || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== g && (i === g || s);
|
|
1088
1092
|
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1089
1093
|
}
|
|
1090
1094
|
handleEvent(e) {
|
|
@@ -1092,7 +1096,7 @@ class li extends Se {
|
|
|
1092
1096
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
1093
1097
|
}
|
|
1094
1098
|
}
|
|
1095
|
-
class
|
|
1099
|
+
class hi {
|
|
1096
1100
|
constructor(e, t, i) {
|
|
1097
1101
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
1098
1102
|
}
|
|
@@ -1105,7 +1109,7 @@ class ci {
|
|
|
1105
1109
|
}
|
|
1106
1110
|
const Oe = oe.litHtmlPolyfillSupport;
|
|
1107
1111
|
Oe == null || Oe(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
|
|
1108
|
-
const
|
|
1112
|
+
const pi = (n, e, t) => {
|
|
1109
1113
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1110
1114
|
let s = i._$litPart$;
|
|
1111
1115
|
if (s === void 0) {
|
|
@@ -1120,7 +1124,7 @@ const di = (n, e, t) => {
|
|
|
1120
1124
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1121
1125
|
*/
|
|
1122
1126
|
const q = globalThis;
|
|
1123
|
-
let
|
|
1127
|
+
let _ = class extends G {
|
|
1124
1128
|
constructor() {
|
|
1125
1129
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1126
1130
|
}
|
|
@@ -1131,7 +1135,7 @@ let A = class extends G {
|
|
|
1131
1135
|
}
|
|
1132
1136
|
update(e) {
|
|
1133
1137
|
const t = this.render();
|
|
1134
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
1138
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = pi(t, this.renderRoot, this.renderOptions);
|
|
1135
1139
|
}
|
|
1136
1140
|
connectedCallback() {
|
|
1137
1141
|
var e;
|
|
@@ -1145,10 +1149,10 @@ let A = class extends G {
|
|
|
1145
1149
|
return W;
|
|
1146
1150
|
}
|
|
1147
1151
|
};
|
|
1148
|
-
var
|
|
1149
|
-
|
|
1152
|
+
var kt;
|
|
1153
|
+
_._$litElement$ = !0, _.finalized = !0, (kt = q.litElementHydrateSupport) == null || kt.call(q, { LitElement: _ });
|
|
1150
1154
|
const Re = q.litElementPolyfillSupport;
|
|
1151
|
-
Re == null || Re({ LitElement:
|
|
1155
|
+
Re == null || Re({ LitElement: _ });
|
|
1152
1156
|
(q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
|
|
1153
1157
|
/**
|
|
1154
1158
|
* @license
|
|
@@ -1165,7 +1169,7 @@ const L = (n) => (e, t) => {
|
|
|
1165
1169
|
* Copyright 2017 Google LLC
|
|
1166
1170
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1167
1171
|
*/
|
|
1168
|
-
const
|
|
1172
|
+
const ui = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: qe }, fi = (n = ui, e, t) => {
|
|
1169
1173
|
const { kind: i, metadata: s } = t;
|
|
1170
1174
|
let o = globalThis.litPropertyMetadata.get(s);
|
|
1171
1175
|
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
|
|
@@ -1186,8 +1190,8 @@ const hi = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged
|
|
|
1186
1190
|
}
|
|
1187
1191
|
throw Error("Unsupported decorator location: " + i);
|
|
1188
1192
|
};
|
|
1189
|
-
function
|
|
1190
|
-
return (e, t) => typeof t == "object" ?
|
|
1193
|
+
function w(n) {
|
|
1194
|
+
return (e, t) => typeof t == "object" ? fi(n, e, t) : ((i, s, o) => {
|
|
1191
1195
|
const r = s.hasOwnProperty(o);
|
|
1192
1196
|
return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
|
|
1193
1197
|
})(n, e, t);
|
|
@@ -1197,16 +1201,16 @@ function x(n) {
|
|
|
1197
1201
|
* Copyright 2017 Google LLC
|
|
1198
1202
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1199
1203
|
*/
|
|
1200
|
-
function
|
|
1201
|
-
return
|
|
1204
|
+
function k(n) {
|
|
1205
|
+
return w({ ...n, state: !0, attribute: !1 });
|
|
1202
1206
|
}
|
|
1203
1207
|
const Q = "pulse-client";
|
|
1204
|
-
var
|
|
1205
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1208
|
+
var mi = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
|
|
1209
|
+
for (var s = i > 1 ? void 0 : i ? gi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1206
1210
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1207
|
-
return i && s &&
|
|
1211
|
+
return i && s && mi(e, t, s), s;
|
|
1208
1212
|
};
|
|
1209
|
-
let X = class extends
|
|
1213
|
+
let X = class extends _ {
|
|
1210
1214
|
constructor() {
|
|
1211
1215
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1212
1216
|
}
|
|
@@ -1218,40 +1222,40 @@ let X = class extends A {
|
|
|
1218
1222
|
room: this.room,
|
|
1219
1223
|
endpoint: this.endpoint
|
|
1220
1224
|
};
|
|
1221
|
-
this.client = new
|
|
1225
|
+
this.client = new Ct(n), this.client.connect();
|
|
1222
1226
|
}
|
|
1223
1227
|
disconnectedCallback() {
|
|
1224
1228
|
var n;
|
|
1225
1229
|
super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
|
|
1226
1230
|
}
|
|
1227
1231
|
render() {
|
|
1228
|
-
return
|
|
1232
|
+
return p`<slot></slot>`;
|
|
1229
1233
|
}
|
|
1230
1234
|
};
|
|
1231
1235
|
ee([
|
|
1232
|
-
|
|
1236
|
+
w({ attribute: "api-key" })
|
|
1233
1237
|
], X.prototype, "apiKey", 2);
|
|
1234
1238
|
ee([
|
|
1235
|
-
|
|
1239
|
+
w()
|
|
1236
1240
|
], X.prototype, "token", 2);
|
|
1237
1241
|
ee([
|
|
1238
|
-
|
|
1242
|
+
w()
|
|
1239
1243
|
], X.prototype, "room", 2);
|
|
1240
1244
|
ee([
|
|
1241
|
-
|
|
1245
|
+
w()
|
|
1242
1246
|
], X.prototype, "endpoint", 2);
|
|
1243
1247
|
ee([
|
|
1244
|
-
|
|
1248
|
+
Dt({ context: Q })
|
|
1245
1249
|
], X.prototype, "client", 2);
|
|
1246
1250
|
X = ee([
|
|
1247
1251
|
L("pulse-provider")
|
|
1248
1252
|
], X);
|
|
1249
|
-
var
|
|
1250
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1253
|
+
var vi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ae = (n, e, t, i) => {
|
|
1254
|
+
for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1251
1255
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1252
|
-
return i && s &&
|
|
1256
|
+
return i && s && vi(e, t, s), s;
|
|
1253
1257
|
};
|
|
1254
|
-
let Z = class extends
|
|
1258
|
+
let Z = class extends _ {
|
|
1255
1259
|
constructor() {
|
|
1256
1260
|
super(...arguments), this.maxVisible = 5, this.users = [];
|
|
1257
1261
|
}
|
|
@@ -1276,16 +1280,16 @@ let Z = class extends A {
|
|
|
1276
1280
|
}
|
|
1277
1281
|
render() {
|
|
1278
1282
|
const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
|
|
1279
|
-
return
|
|
1283
|
+
return p`
|
|
1280
1284
|
<div class="avatars">
|
|
1281
|
-
${e > 0 ?
|
|
1285
|
+
${e > 0 ? p`<div class="overflow">+${e}</div>` : null}
|
|
1282
1286
|
${n.map(
|
|
1283
|
-
(t) =>
|
|
1287
|
+
(t) => p`
|
|
1284
1288
|
<div
|
|
1285
1289
|
class="avatar"
|
|
1286
1290
|
style="background:${t.user.color}"
|
|
1287
1291
|
>
|
|
1288
|
-
${t.user.avatar ?
|
|
1292
|
+
${t.user.avatar ? p`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
|
|
1289
1293
|
<span class="status-ring ${t.status}"></span>
|
|
1290
1294
|
<span class="tooltip">${t.user.name}</span>
|
|
1291
1295
|
</div>
|
|
@@ -1295,7 +1299,7 @@ let Z = class extends A {
|
|
|
1295
1299
|
`;
|
|
1296
1300
|
}
|
|
1297
1301
|
};
|
|
1298
|
-
Z.styles =
|
|
1302
|
+
Z.styles = O`
|
|
1299
1303
|
:host {
|
|
1300
1304
|
display: inline-flex;
|
|
1301
1305
|
align-items: center;
|
|
@@ -1401,23 +1405,23 @@ Z.styles = M`
|
|
|
1401
1405
|
`;
|
|
1402
1406
|
Ae([
|
|
1403
1407
|
fe({ context: Q, subscribe: !0 }),
|
|
1404
|
-
|
|
1408
|
+
w({ attribute: !1 })
|
|
1405
1409
|
], Z.prototype, "client", 2);
|
|
1406
1410
|
Ae([
|
|
1407
|
-
|
|
1411
|
+
w({ type: Number, attribute: "max-visible" })
|
|
1408
1412
|
], Z.prototype, "maxVisible", 2);
|
|
1409
1413
|
Ae([
|
|
1410
|
-
|
|
1414
|
+
k()
|
|
1411
1415
|
], Z.prototype, "users", 2);
|
|
1412
1416
|
Z = Ae([
|
|
1413
1417
|
L("pulse-presence")
|
|
1414
1418
|
], Z);
|
|
1415
|
-
var
|
|
1416
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1419
|
+
var xi = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
|
|
1420
|
+
for (var s = i > 1 ? void 0 : i ? yi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1417
1421
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1418
|
-
return i && s &&
|
|
1422
|
+
return i && s && xi(e, t, s), s;
|
|
1419
1423
|
};
|
|
1420
|
-
let de = class extends
|
|
1424
|
+
let de = class extends _ {
|
|
1421
1425
|
constructor() {
|
|
1422
1426
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
|
|
1423
1427
|
var e;
|
|
@@ -1471,9 +1475,9 @@ let de = class extends A {
|
|
|
1471
1475
|
}
|
|
1472
1476
|
render() {
|
|
1473
1477
|
const n = [...this.cursors.values()];
|
|
1474
|
-
return
|
|
1478
|
+
return p`
|
|
1475
1479
|
${n.map(
|
|
1476
|
-
(e) =>
|
|
1480
|
+
(e) => p`
|
|
1477
1481
|
<div
|
|
1478
1482
|
class="cursor"
|
|
1479
1483
|
style="transform:translate(${e.position.x}px,${e.position.y}px)"
|
|
@@ -1494,7 +1498,7 @@ let de = class extends A {
|
|
|
1494
1498
|
`;
|
|
1495
1499
|
}
|
|
1496
1500
|
};
|
|
1497
|
-
de.styles =
|
|
1501
|
+
de.styles = O`
|
|
1498
1502
|
:host {
|
|
1499
1503
|
position: fixed;
|
|
1500
1504
|
top: 0;
|
|
@@ -1531,22 +1535,22 @@ de.styles = M`
|
|
|
1531
1535
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1532
1536
|
}
|
|
1533
1537
|
`;
|
|
1534
|
-
|
|
1538
|
+
We([
|
|
1535
1539
|
fe({ context: Q, subscribe: !0 }),
|
|
1536
|
-
|
|
1540
|
+
w({ attribute: !1 })
|
|
1537
1541
|
], de.prototype, "client", 2);
|
|
1538
|
-
|
|
1539
|
-
|
|
1542
|
+
We([
|
|
1543
|
+
k()
|
|
1540
1544
|
], de.prototype, "cursors", 2);
|
|
1541
|
-
de =
|
|
1545
|
+
de = We([
|
|
1542
1546
|
L("pulse-cursors")
|
|
1543
1547
|
], de);
|
|
1544
|
-
var
|
|
1545
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1548
|
+
var wi = Object.defineProperty, $i = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
|
|
1549
|
+
for (var s = i > 1 ? void 0 : i ? $i(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1546
1550
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1547
|
-
return i && s &&
|
|
1551
|
+
return i && s && wi(e, t, s), s;
|
|
1548
1552
|
};
|
|
1549
|
-
let Y = class extends
|
|
1553
|
+
let Y = class extends _ {
|
|
1550
1554
|
constructor() {
|
|
1551
1555
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1552
1556
|
}
|
|
@@ -1568,7 +1572,7 @@ let Y = class extends A {
|
|
|
1568
1572
|
}
|
|
1569
1573
|
parseMentions(n) {
|
|
1570
1574
|
return n.split(/(@\w+)/g).map(
|
|
1571
|
-
(t) => t.startsWith("@") ?
|
|
1575
|
+
(t) => t.startsWith("@") ? p`<span class="mention">${t}</span>` : t
|
|
1572
1576
|
);
|
|
1573
1577
|
}
|
|
1574
1578
|
getInitials(n) {
|
|
@@ -1594,9 +1598,9 @@ let Y = class extends A {
|
|
|
1594
1598
|
}
|
|
1595
1599
|
render() {
|
|
1596
1600
|
const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
1597
|
-
return
|
|
1601
|
+
return p`
|
|
1598
1602
|
<div class="threads">
|
|
1599
|
-
${n.length === 0 ?
|
|
1603
|
+
${n.length === 0 ? p`<div class="empty">
|
|
1600
1604
|
<div class="empty-icon">💬</div>
|
|
1601
1605
|
No comments yet.<br>Start a conversation below.
|
|
1602
1606
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -1610,12 +1614,12 @@ let Y = class extends A {
|
|
|
1610
1614
|
`;
|
|
1611
1615
|
}
|
|
1612
1616
|
renderThread(n) {
|
|
1613
|
-
return
|
|
1617
|
+
return p`
|
|
1614
1618
|
<div class="thread ${n.resolved ? "resolved" : ""}">
|
|
1615
1619
|
${n.comments.map((e, t) => {
|
|
1616
1620
|
const i = this.getUserForComment(e.userId);
|
|
1617
|
-
return
|
|
1618
|
-
${t > 0 ?
|
|
1621
|
+
return p`
|
|
1622
|
+
${t > 0 ? p`<div class="divider"></div>` : g}
|
|
1619
1623
|
<div class="comment">
|
|
1620
1624
|
<div class="comment-header">
|
|
1621
1625
|
<div
|
|
@@ -1647,12 +1651,12 @@ let Y = class extends A {
|
|
|
1647
1651
|
${n.resolved ? "Reopen" : "Resolve"}
|
|
1648
1652
|
</button>
|
|
1649
1653
|
</div>
|
|
1650
|
-
${this.replyingTo === n.id ?
|
|
1654
|
+
${this.replyingTo === n.id ? p`
|
|
1651
1655
|
<form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
|
|
1652
1656
|
<input type="text" placeholder="Write a reply..." />
|
|
1653
1657
|
<button type="submit">Send</button>
|
|
1654
1658
|
</form>
|
|
1655
|
-
` :
|
|
1659
|
+
` : g}
|
|
1656
1660
|
</div>
|
|
1657
1661
|
`;
|
|
1658
1662
|
}
|
|
@@ -1664,7 +1668,7 @@ let Y = class extends A {
|
|
|
1664
1668
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1665
1669
|
}
|
|
1666
1670
|
};
|
|
1667
|
-
Y.styles =
|
|
1671
|
+
Y.styles = O`
|
|
1668
1672
|
:host {
|
|
1669
1673
|
display: block;
|
|
1670
1674
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1878,39 +1882,39 @@ Y.styles = M`
|
|
|
1878
1882
|
`;
|
|
1879
1883
|
ge([
|
|
1880
1884
|
fe({ context: Q, subscribe: !0 }),
|
|
1881
|
-
|
|
1885
|
+
w({ attribute: !1 })
|
|
1882
1886
|
], Y.prototype, "client", 2);
|
|
1883
1887
|
ge([
|
|
1884
|
-
|
|
1888
|
+
w({ type: Boolean, attribute: "show-resolved" })
|
|
1885
1889
|
], Y.prototype, "showResolved", 2);
|
|
1886
1890
|
ge([
|
|
1887
|
-
|
|
1891
|
+
k()
|
|
1888
1892
|
], Y.prototype, "threads", 2);
|
|
1889
1893
|
ge([
|
|
1890
|
-
|
|
1894
|
+
k()
|
|
1891
1895
|
], Y.prototype, "replyingTo", 2);
|
|
1892
1896
|
Y = ge([
|
|
1893
1897
|
L("pulse-comments")
|
|
1894
1898
|
], Y);
|
|
1895
|
-
var
|
|
1896
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1899
|
+
var ki = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
|
|
1900
|
+
for (var s = i > 1 ? void 0 : i ? Ei(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1897
1901
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1898
|
-
return i && s &&
|
|
1902
|
+
return i && s && ki(e, t, s), s;
|
|
1899
1903
|
};
|
|
1900
|
-
const
|
|
1904
|
+
const Ci = {
|
|
1901
1905
|
"comment:created": "left a comment",
|
|
1902
1906
|
"comment:mention": "mentioned you",
|
|
1903
1907
|
"comment:reply": "replied to your comment",
|
|
1904
1908
|
"thread:resolved": "resolved a thread",
|
|
1905
1909
|
"reaction:added": "reacted to your comment"
|
|
1906
|
-
},
|
|
1910
|
+
}, Ti = {
|
|
1907
1911
|
"comment:created": "💬",
|
|
1908
1912
|
"comment:mention": "📣",
|
|
1909
1913
|
"comment:reply": "↩️",
|
|
1910
1914
|
"thread:resolved": "✅",
|
|
1911
1915
|
"reaction:added": "🎉"
|
|
1912
1916
|
};
|
|
1913
|
-
let he = class extends
|
|
1917
|
+
let he = class extends _ {
|
|
1914
1918
|
constructor() {
|
|
1915
1919
|
super(...arguments), this.notifications = [];
|
|
1916
1920
|
}
|
|
@@ -1957,31 +1961,31 @@ let he = class extends A {
|
|
|
1957
1961
|
}
|
|
1958
1962
|
render() {
|
|
1959
1963
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
1960
|
-
return
|
|
1964
|
+
return p`
|
|
1961
1965
|
<div class="header">
|
|
1962
1966
|
<span class="title">
|
|
1963
1967
|
Notifications
|
|
1964
|
-
${n > 0 ?
|
|
1968
|
+
${n > 0 ? p`<span class="badge">${n}</span>` : g}
|
|
1965
1969
|
</span>
|
|
1966
|
-
${n > 0 ?
|
|
1970
|
+
${n > 0 ? p`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1967
1971
|
Mark all read
|
|
1968
|
-
</button>` :
|
|
1972
|
+
</button>` : g}
|
|
1969
1973
|
</div>
|
|
1970
1974
|
<div class="list">
|
|
1971
|
-
${this.notifications.length === 0 ?
|
|
1975
|
+
${this.notifications.length === 0 ? p`<div class="empty">
|
|
1972
1976
|
<div class="empty-icon">🔔</div>
|
|
1973
1977
|
No notifications yet
|
|
1974
1978
|
</div>` : this.notifications.map(
|
|
1975
|
-
(e) =>
|
|
1979
|
+
(e) => p`
|
|
1976
1980
|
<div
|
|
1977
1981
|
class="item ${e.read ? "" : "unread"}"
|
|
1978
1982
|
@click=${() => this.handleClick(e)}
|
|
1979
1983
|
>
|
|
1980
|
-
<span class="icon">${
|
|
1984
|
+
<span class="icon">${Ti[e.type] ?? "🔔"}</span>
|
|
1981
1985
|
<div class="content">
|
|
1982
1986
|
<div class="text">
|
|
1983
1987
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1984
|
-
${
|
|
1988
|
+
${Ci[e.type] ?? e.type}
|
|
1985
1989
|
</div>
|
|
1986
1990
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1987
1991
|
</div>
|
|
@@ -1993,7 +1997,7 @@ let he = class extends A {
|
|
|
1993
1997
|
`;
|
|
1994
1998
|
}
|
|
1995
1999
|
};
|
|
1996
|
-
he.styles =
|
|
2000
|
+
he.styles = O`
|
|
1997
2001
|
:host {
|
|
1998
2002
|
display: block;
|
|
1999
2003
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2134,23 +2138,23 @@ he.styles = M`
|
|
|
2134
2138
|
opacity: 0.4;
|
|
2135
2139
|
}
|
|
2136
2140
|
`;
|
|
2137
|
-
|
|
2141
|
+
Xe([
|
|
2138
2142
|
fe({ context: Q, subscribe: !0 }),
|
|
2139
|
-
|
|
2143
|
+
w({ attribute: !1 })
|
|
2140
2144
|
], he.prototype, "client", 2);
|
|
2141
|
-
|
|
2142
|
-
|
|
2145
|
+
Xe([
|
|
2146
|
+
k()
|
|
2143
2147
|
], he.prototype, "notifications", 2);
|
|
2144
|
-
he =
|
|
2148
|
+
he = Xe([
|
|
2145
2149
|
L("pulse-notifications")
|
|
2146
2150
|
], he);
|
|
2147
|
-
var
|
|
2148
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2151
|
+
var Si = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
|
|
2152
|
+
for (var s = i > 1 ? void 0 : i ? Ai(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2149
2153
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2150
|
-
return i && s &&
|
|
2154
|
+
return i && s && Si(e, t, s), s;
|
|
2151
2155
|
};
|
|
2152
|
-
const
|
|
2153
|
-
let
|
|
2156
|
+
const Pi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2157
|
+
let B = class extends _ {
|
|
2154
2158
|
constructor() {
|
|
2155
2159
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
2156
2160
|
}
|
|
@@ -2190,9 +2194,9 @@ let N = class extends A {
|
|
|
2190
2194
|
}
|
|
2191
2195
|
render() {
|
|
2192
2196
|
const n = this.groupReactions();
|
|
2193
|
-
return
|
|
2197
|
+
return p`
|
|
2194
2198
|
${n.map(
|
|
2195
|
-
(e) =>
|
|
2199
|
+
(e) => p`
|
|
2196
2200
|
<button
|
|
2197
2201
|
class="reaction ${e.userReactionId ? "active" : ""}"
|
|
2198
2202
|
@click=${() => this.toggleReaction(e)}
|
|
@@ -2209,22 +2213,22 @@ let N = class extends A {
|
|
|
2209
2213
|
>
|
|
2210
2214
|
+
|
|
2211
2215
|
</button>
|
|
2212
|
-
${this.showPicker ?
|
|
2216
|
+
${this.showPicker ? p`
|
|
2213
2217
|
<div class="picker">
|
|
2214
|
-
${
|
|
2215
|
-
(e) =>
|
|
2218
|
+
${Pi.map(
|
|
2219
|
+
(e) => p`
|
|
2216
2220
|
<button @click=${() => this.addEmoji(e)}>
|
|
2217
2221
|
${e}
|
|
2218
2222
|
</button>
|
|
2219
2223
|
`
|
|
2220
2224
|
)}
|
|
2221
2225
|
</div>
|
|
2222
|
-
` :
|
|
2226
|
+
` : g}
|
|
2223
2227
|
</div>
|
|
2224
2228
|
`;
|
|
2225
2229
|
}
|
|
2226
2230
|
};
|
|
2227
|
-
|
|
2231
|
+
B.styles = O`
|
|
2228
2232
|
:host {
|
|
2229
2233
|
display: inline-flex;
|
|
2230
2234
|
align-items: center;
|
|
@@ -2338,30 +2342,43 @@ N.styles = M`
|
|
|
2338
2342
|
`;
|
|
2339
2343
|
te([
|
|
2340
2344
|
fe({ context: Q, subscribe: !0 }),
|
|
2341
|
-
|
|
2342
|
-
],
|
|
2345
|
+
w({ attribute: !1 })
|
|
2346
|
+
], B.prototype, "client", 2);
|
|
2343
2347
|
te([
|
|
2344
|
-
|
|
2345
|
-
],
|
|
2348
|
+
w({ attribute: "target-id" })
|
|
2349
|
+
], B.prototype, "targetId", 2);
|
|
2346
2350
|
te([
|
|
2347
|
-
|
|
2348
|
-
],
|
|
2351
|
+
w({ attribute: "target-type" })
|
|
2352
|
+
], B.prototype, "targetType", 2);
|
|
2349
2353
|
te([
|
|
2350
|
-
|
|
2351
|
-
],
|
|
2354
|
+
k()
|
|
2355
|
+
], B.prototype, "reactions", 2);
|
|
2352
2356
|
te([
|
|
2353
|
-
|
|
2354
|
-
],
|
|
2355
|
-
|
|
2357
|
+
k()
|
|
2358
|
+
], B.prototype, "showPicker", 2);
|
|
2359
|
+
B = te([
|
|
2356
2360
|
L("pulse-reactions")
|
|
2357
|
-
],
|
|
2361
|
+
], B);
|
|
2362
|
+
const Mt = {
|
|
2363
|
+
allowImages: !0,
|
|
2364
|
+
allowAudio: !0,
|
|
2365
|
+
allowVideo: !0,
|
|
2366
|
+
maxFileSizeMb: 10,
|
|
2367
|
+
maxAttachmentsPerComment: 5,
|
|
2368
|
+
allowReactions: !0,
|
|
2369
|
+
allowDrawing: !0,
|
|
2370
|
+
allowMentions: !0,
|
|
2371
|
+
showCursors: !0,
|
|
2372
|
+
showPresence: !0,
|
|
2373
|
+
showTypingIndicators: !0
|
|
2374
|
+
};
|
|
2358
2375
|
/**
|
|
2359
2376
|
* @license
|
|
2360
2377
|
* Copyright 2017 Google LLC
|
|
2361
2378
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2362
2379
|
*/
|
|
2363
|
-
const
|
|
2364
|
-
class
|
|
2380
|
+
const _i = { CHILD: 2 }, Ii = (n) => (...e) => ({ _$litDirective$: n, values: e });
|
|
2381
|
+
class Mi {
|
|
2365
2382
|
constructor(e) {
|
|
2366
2383
|
}
|
|
2367
2384
|
get _$AU() {
|
|
@@ -2382,12 +2399,12 @@ class _i {
|
|
|
2382
2399
|
* Copyright 2017 Google LLC
|
|
2383
2400
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2384
2401
|
*/
|
|
2385
|
-
class Le extends
|
|
2402
|
+
class Le extends Mi {
|
|
2386
2403
|
constructor(e) {
|
|
2387
|
-
if (super(e), this.it =
|
|
2404
|
+
if (super(e), this.it = g, e.type !== _i.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2388
2405
|
}
|
|
2389
2406
|
render(e) {
|
|
2390
|
-
if (e ===
|
|
2407
|
+
if (e === g || e == null) return this._t = void 0, this.it = e;
|
|
2391
2408
|
if (e === W) return e;
|
|
2392
2409
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2393
2410
|
if (e === this.it) return this._t;
|
|
@@ -2405,14 +2422,14 @@ Le.directiveName = "unsafeHTML", Le.resultType = 1;
|
|
|
2405
2422
|
class je extends Le {
|
|
2406
2423
|
}
|
|
2407
2424
|
je.directiveName = "unsafeSVG", je.resultType = 2;
|
|
2408
|
-
const
|
|
2425
|
+
const Oi = Ii(je);
|
|
2409
2426
|
/**
|
|
2410
2427
|
* @license lucide v0.577.0 - ISC
|
|
2411
2428
|
*
|
|
2412
2429
|
* This source code is licensed under the ISC license.
|
|
2413
2430
|
* See the LICENSE file in the root directory of this source tree.
|
|
2414
2431
|
*/
|
|
2415
|
-
const
|
|
2432
|
+
const Ri = [
|
|
2416
2433
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
|
|
2417
2434
|
[
|
|
2418
2435
|
"path",
|
|
@@ -2427,7 +2444,7 @@ const Mi = [
|
|
|
2427
2444
|
* This source code is licensed under the ISC license.
|
|
2428
2445
|
* See the LICENSE file in the root directory of this source tree.
|
|
2429
2446
|
*/
|
|
2430
|
-
const
|
|
2447
|
+
const Li = [
|
|
2431
2448
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2432
2449
|
["path", { d: "M12 6v6l4 2" }]
|
|
2433
2450
|
];
|
|
@@ -2437,7 +2454,7 @@ const Oi = [
|
|
|
2437
2454
|
* This source code is licensed under the ISC license.
|
|
2438
2455
|
* See the LICENSE file in the root directory of this source tree.
|
|
2439
2456
|
*/
|
|
2440
|
-
const
|
|
2457
|
+
const ji = [
|
|
2441
2458
|
[
|
|
2442
2459
|
"path",
|
|
2443
2460
|
{
|
|
@@ -2451,7 +2468,7 @@ const Ri = [
|
|
|
2451
2468
|
* This source code is licensed under the ISC license.
|
|
2452
2469
|
* See the LICENSE file in the root directory of this source tree.
|
|
2453
2470
|
*/
|
|
2454
|
-
const
|
|
2471
|
+
const Ui = [
|
|
2455
2472
|
["path", { d: "M12 19v3" }],
|
|
2456
2473
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
|
|
2457
2474
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
|
|
@@ -2462,7 +2479,7 @@ const Li = [
|
|
|
2462
2479
|
* This source code is licensed under the ISC license.
|
|
2463
2480
|
* See the LICENSE file in the root directory of this source tree.
|
|
2464
2481
|
*/
|
|
2465
|
-
const
|
|
2482
|
+
const zi = [
|
|
2466
2483
|
[
|
|
2467
2484
|
"path",
|
|
2468
2485
|
{
|
|
@@ -2476,7 +2493,7 @@ const ji = [
|
|
|
2476
2493
|
* This source code is licensed under the ISC license.
|
|
2477
2494
|
* See the LICENSE file in the root directory of this source tree.
|
|
2478
2495
|
*/
|
|
2479
|
-
const
|
|
2496
|
+
const Di = [
|
|
2480
2497
|
[
|
|
2481
2498
|
"path",
|
|
2482
2499
|
{
|
|
@@ -2498,7 +2515,7 @@ const zi = [
|
|
|
2498
2515
|
* This source code is licensed under the ISC license.
|
|
2499
2516
|
* See the LICENSE file in the root directory of this source tree.
|
|
2500
2517
|
*/
|
|
2501
|
-
const
|
|
2518
|
+
const Hi = [
|
|
2502
2519
|
[
|
|
2503
2520
|
"path",
|
|
2504
2521
|
{
|
|
@@ -2513,7 +2530,7 @@ const Ui = [
|
|
|
2513
2530
|
* This source code is licensed under the ISC license.
|
|
2514
2531
|
* See the LICENSE file in the root directory of this source tree.
|
|
2515
2532
|
*/
|
|
2516
|
-
const
|
|
2533
|
+
const Ot = [
|
|
2517
2534
|
["path", { d: "M12 17v5" }],
|
|
2518
2535
|
[
|
|
2519
2536
|
"path",
|
|
@@ -2528,7 +2545,7 @@ const It = [
|
|
|
2528
2545
|
* This source code is licensed under the ISC license.
|
|
2529
2546
|
* See the LICENSE file in the root directory of this source tree.
|
|
2530
2547
|
*/
|
|
2531
|
-
const
|
|
2548
|
+
const Bi = [
|
|
2532
2549
|
[
|
|
2533
2550
|
"path",
|
|
2534
2551
|
{
|
|
@@ -2543,7 +2560,7 @@ const Di = [
|
|
|
2543
2560
|
* This source code is licensed under the ISC license.
|
|
2544
2561
|
* See the LICENSE file in the root directory of this source tree.
|
|
2545
2562
|
*/
|
|
2546
|
-
const
|
|
2563
|
+
const Ni = [
|
|
2547
2564
|
["path", { d: "M10 11v6" }],
|
|
2548
2565
|
["path", { d: "M14 11v6" }],
|
|
2549
2566
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
|
|
@@ -2556,7 +2573,7 @@ const Hi = [
|
|
|
2556
2573
|
* This source code is licensed under the ISC license.
|
|
2557
2574
|
* See the LICENSE file in the root directory of this source tree.
|
|
2558
2575
|
*/
|
|
2559
|
-
const
|
|
2576
|
+
const Fi = [
|
|
2560
2577
|
["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
|
|
2561
2578
|
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
2562
2579
|
];
|
|
@@ -2576,7 +2593,7 @@ const ve = [
|
|
|
2576
2593
|
* This source code is licensed under the ISC license.
|
|
2577
2594
|
* See the LICENSE file in the root directory of this source tree.
|
|
2578
2595
|
*/
|
|
2579
|
-
const
|
|
2596
|
+
const qi = [
|
|
2580
2597
|
[
|
|
2581
2598
|
"path",
|
|
2582
2599
|
{
|
|
@@ -2584,14 +2601,14 @@ const Bi = [
|
|
|
2584
2601
|
}
|
|
2585
2602
|
]
|
|
2586
2603
|
];
|
|
2587
|
-
function
|
|
2604
|
+
function Vi(n) {
|
|
2588
2605
|
return n.map(([e, t]) => {
|
|
2589
2606
|
const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
|
|
2590
2607
|
return `<${e} ${i}/>`;
|
|
2591
2608
|
}).join("");
|
|
2592
2609
|
}
|
|
2593
|
-
function
|
|
2594
|
-
return
|
|
2610
|
+
function S(n, e = 18) {
|
|
2611
|
+
return oi`<svg
|
|
2595
2612
|
xmlns="http://www.w3.org/2000/svg"
|
|
2596
2613
|
width="${e}"
|
|
2597
2614
|
height="${e}"
|
|
@@ -2601,9 +2618,9 @@ function C(n, e = 18) {
|
|
|
2601
2618
|
stroke-width="2"
|
|
2602
2619
|
stroke-linecap="round"
|
|
2603
2620
|
stroke-linejoin="round"
|
|
2604
|
-
>${
|
|
2621
|
+
>${Oi(Vi(n))}</svg>`;
|
|
2605
2622
|
}
|
|
2606
|
-
const ie =
|
|
2623
|
+
const ie = O`
|
|
2607
2624
|
* {
|
|
2608
2625
|
box-sizing: border-box;
|
|
2609
2626
|
margin: 0;
|
|
@@ -2646,7 +2663,7 @@ const ie = M`
|
|
|
2646
2663
|
--pw-shadow: var(--pulse-shadow);
|
|
2647
2664
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2648
2665
|
}
|
|
2649
|
-
`, be =
|
|
2666
|
+
`, be = O`
|
|
2650
2667
|
.pw-btn {
|
|
2651
2668
|
display: inline-flex;
|
|
2652
2669
|
align-items: center;
|
|
@@ -2690,7 +2707,7 @@ const ie = M`
|
|
|
2690
2707
|
width: 18px;
|
|
2691
2708
|
height: 18px;
|
|
2692
2709
|
}
|
|
2693
|
-
`, Pe =
|
|
2710
|
+
`, Pe = O`
|
|
2694
2711
|
.pw-scrollable::-webkit-scrollbar {
|
|
2695
2712
|
width: 4px;
|
|
2696
2713
|
}
|
|
@@ -2702,12 +2719,12 @@ const ie = M`
|
|
|
2702
2719
|
background: transparent;
|
|
2703
2720
|
}
|
|
2704
2721
|
`;
|
|
2705
|
-
var
|
|
2706
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2722
|
+
var Wi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
|
|
2723
|
+
for (var s = i > 1 ? void 0 : i ? Xi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2707
2724
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2708
|
-
return i && s &&
|
|
2725
|
+
return i && s && Wi(e, t, s), s;
|
|
2709
2726
|
};
|
|
2710
|
-
let K = class extends
|
|
2727
|
+
let K = class extends _ {
|
|
2711
2728
|
constructor() {
|
|
2712
2729
|
super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
|
|
2713
2730
|
}
|
|
@@ -2753,18 +2770,18 @@ let K = class extends A {
|
|
|
2753
2770
|
);
|
|
2754
2771
|
}
|
|
2755
2772
|
render() {
|
|
2756
|
-
return
|
|
2773
|
+
return p`
|
|
2757
2774
|
<div class="panel">
|
|
2758
2775
|
<div class="panel-header">
|
|
2759
2776
|
<span class="panel-title">Activity</span>
|
|
2760
2777
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2761
|
-
${
|
|
2778
|
+
${S(ve, 16)}
|
|
2762
2779
|
</button>
|
|
2763
2780
|
</div>
|
|
2764
2781
|
|
|
2765
2782
|
<div class="panel-body pw-scrollable">
|
|
2766
|
-
${this.items.length === 0 ?
|
|
2767
|
-
(n) =>
|
|
2783
|
+
${this.items.length === 0 ? p`<div class="empty">No activity yet</div>` : this.items.map(
|
|
2784
|
+
(n) => p`
|
|
2768
2785
|
<div class="activity-item">
|
|
2769
2786
|
<div
|
|
2770
2787
|
class="activity-dot"
|
|
@@ -2772,7 +2789,7 @@ let K = class extends A {
|
|
|
2772
2789
|
></div>
|
|
2773
2790
|
<div class="activity-content">
|
|
2774
2791
|
<div class="activity-text">
|
|
2775
|
-
${n.userId ?
|
|
2792
|
+
${n.userId ? p`<span class="activity-user"
|
|
2776
2793
|
>${this.getUserName(n.userId)}</span
|
|
2777
2794
|
>
|
|
2778
2795
|
${n.description}` : n.description}
|
|
@@ -2793,7 +2810,7 @@ K.styles = [
|
|
|
2793
2810
|
ie,
|
|
2794
2811
|
be,
|
|
2795
2812
|
Pe,
|
|
2796
|
-
|
|
2813
|
+
O`
|
|
2797
2814
|
:host {
|
|
2798
2815
|
display: block;
|
|
2799
2816
|
}
|
|
@@ -2918,21 +2935,21 @@ K.TYPE_COLORS = {
|
|
|
2918
2935
|
comment: "#3b82f6",
|
|
2919
2936
|
resolve: "#22c55e"
|
|
2920
2937
|
};
|
|
2921
|
-
|
|
2922
|
-
|
|
2938
|
+
Ye([
|
|
2939
|
+
w({ attribute: !1 })
|
|
2923
2940
|
], K.prototype, "client", 2);
|
|
2924
|
-
|
|
2925
|
-
|
|
2941
|
+
Ye([
|
|
2942
|
+
k()
|
|
2926
2943
|
], K.prototype, "items", 2);
|
|
2927
|
-
K =
|
|
2944
|
+
K = Ye([
|
|
2928
2945
|
L("pulse-widget-activity-panel")
|
|
2929
2946
|
], K);
|
|
2930
|
-
const
|
|
2931
|
-
function
|
|
2947
|
+
const Yi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ht = "#6366f1", pt = "#e2e8f0", Ki = "#f8fafc", Gi = "#e2e8f0", ut = "#64748b", we = 28, Ji = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2948
|
+
function ft(n) {
|
|
2932
2949
|
const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
|
|
2933
2950
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
2934
2951
|
}
|
|
2935
|
-
class
|
|
2952
|
+
class Ue {
|
|
2936
2953
|
/**
|
|
2937
2954
|
* Create and return a fully self-contained inline audio player element.
|
|
2938
2955
|
*
|
|
@@ -2953,12 +2970,12 @@ class ze {
|
|
|
2953
2970
|
width: "220px",
|
|
2954
2971
|
height: "44px",
|
|
2955
2972
|
padding: "0 10px",
|
|
2956
|
-
background:
|
|
2973
|
+
background: Ki,
|
|
2957
2974
|
borderRadius: "12px",
|
|
2958
|
-
border: `1px solid ${
|
|
2959
|
-
fontFamily:
|
|
2975
|
+
border: `1px solid ${Gi}`,
|
|
2976
|
+
fontFamily: Yi,
|
|
2960
2977
|
fontSize: "11px",
|
|
2961
|
-
color:
|
|
2978
|
+
color: ut,
|
|
2962
2979
|
userSelect: "none",
|
|
2963
2980
|
boxSizing: "border-box"
|
|
2964
2981
|
});
|
|
@@ -2969,7 +2986,7 @@ class ze {
|
|
|
2969
2986
|
minWidth: "28px",
|
|
2970
2987
|
borderRadius: "50%",
|
|
2971
2988
|
border: "none",
|
|
2972
|
-
background:
|
|
2989
|
+
background: ht,
|
|
2973
2990
|
cursor: "pointer",
|
|
2974
2991
|
display: "flex",
|
|
2975
2992
|
alignItems: "center",
|
|
@@ -2997,8 +3014,8 @@ class ze {
|
|
|
2997
3014
|
</svg>`;
|
|
2998
3015
|
}
|
|
2999
3016
|
c(), l.appendChild(d);
|
|
3000
|
-
const
|
|
3001
|
-
Object.assign(
|
|
3017
|
+
const u = document.createElement("div");
|
|
3018
|
+
Object.assign(u.style, {
|
|
3002
3019
|
flex: "1",
|
|
3003
3020
|
display: "flex",
|
|
3004
3021
|
flexDirection: "column",
|
|
@@ -3006,50 +3023,50 @@ class ze {
|
|
|
3006
3023
|
overflow: "hidden",
|
|
3007
3024
|
minWidth: "0"
|
|
3008
3025
|
});
|
|
3009
|
-
const
|
|
3010
|
-
Object.assign(
|
|
3026
|
+
const f = document.createElement("div");
|
|
3027
|
+
Object.assign(f.style, {
|
|
3011
3028
|
display: "flex",
|
|
3012
3029
|
alignItems: "center",
|
|
3013
3030
|
gap: "1.5px",
|
|
3014
3031
|
height: "22px",
|
|
3015
3032
|
cursor: "pointer"
|
|
3016
3033
|
});
|
|
3017
|
-
const
|
|
3018
|
-
for (let
|
|
3019
|
-
const
|
|
3020
|
-
Object.assign(
|
|
3034
|
+
const b = [];
|
|
3035
|
+
for (let $ = 0; $ < we; $++) {
|
|
3036
|
+
const T = document.createElement("div"), U = Math.round(Ji[$] * 20);
|
|
3037
|
+
Object.assign(T.style, {
|
|
3021
3038
|
flex: "1",
|
|
3022
|
-
height: `${Math.max(3,
|
|
3039
|
+
height: `${Math.max(3, U)}px`,
|
|
3023
3040
|
borderRadius: "1px",
|
|
3024
|
-
background:
|
|
3041
|
+
background: pt,
|
|
3025
3042
|
transition: "background 0.1s ease",
|
|
3026
3043
|
minWidth: "0"
|
|
3027
|
-
}),
|
|
3044
|
+
}), b.push(T), f.appendChild(T);
|
|
3028
3045
|
}
|
|
3029
|
-
const
|
|
3030
|
-
Object.assign(
|
|
3046
|
+
const x = document.createElement("div");
|
|
3047
|
+
Object.assign(x.style, {
|
|
3031
3048
|
fontSize: "10px",
|
|
3032
|
-
color:
|
|
3049
|
+
color: ut,
|
|
3033
3050
|
whiteSpace: "nowrap",
|
|
3034
3051
|
lineHeight: "1"
|
|
3035
3052
|
});
|
|
3036
|
-
function
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3053
|
+
function y() {
|
|
3054
|
+
const $ = ft(o), T = ft(s);
|
|
3055
|
+
x.textContent = `${$} / ${T}`;
|
|
3039
3056
|
}
|
|
3040
|
-
|
|
3041
|
-
function
|
|
3042
|
-
const
|
|
3043
|
-
for (let
|
|
3044
|
-
|
|
3057
|
+
y(), u.appendChild(f), u.appendChild(x), a.appendChild(l), a.appendChild(u);
|
|
3058
|
+
function v() {
|
|
3059
|
+
const $ = s > 0 ? o / s : 0, T = Math.floor($ * we);
|
|
3060
|
+
for (let U = 0; U < we; U++)
|
|
3061
|
+
b[U].style.background = U <= T ? ht : pt;
|
|
3045
3062
|
}
|
|
3046
|
-
return
|
|
3063
|
+
return f.addEventListener("click", ($) => {
|
|
3047
3064
|
if (s <= 0) return;
|
|
3048
|
-
const
|
|
3065
|
+
const T = f.getBoundingClientRect(), U = Math.min(
|
|
3049
3066
|
1,
|
|
3050
|
-
Math.max(0, (
|
|
3067
|
+
Math.max(0, ($.clientX - T.left) / T.width)
|
|
3051
3068
|
);
|
|
3052
|
-
r.currentTime =
|
|
3069
|
+
r.currentTime = U * s, o = r.currentTime, v(), y();
|
|
3053
3070
|
}), l.addEventListener("click", () => {
|
|
3054
3071
|
i ? r.pause() : r.play().catch(() => {
|
|
3055
3072
|
});
|
|
@@ -3058,17 +3075,17 @@ class ze {
|
|
|
3058
3075
|
}), r.addEventListener("pause", () => {
|
|
3059
3076
|
i = !1, c();
|
|
3060
3077
|
}), r.addEventListener("ended", () => {
|
|
3061
|
-
i = !1, c(), o = 0,
|
|
3078
|
+
i = !1, c(), o = 0, v(), y();
|
|
3062
3079
|
}), r.addEventListener("timeupdate", () => {
|
|
3063
|
-
o = r.currentTime,
|
|
3080
|
+
o = r.currentTime, v(), y();
|
|
3064
3081
|
}), r.addEventListener("loadedmetadata", () => {
|
|
3065
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3082
|
+
r.duration && isFinite(r.duration) && (s = r.duration, y());
|
|
3066
3083
|
}), r.addEventListener("durationchange", () => {
|
|
3067
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3084
|
+
r.duration && isFinite(r.duration) && (s = r.duration, y());
|
|
3068
3085
|
}), a;
|
|
3069
3086
|
}
|
|
3070
3087
|
}
|
|
3071
|
-
class
|
|
3088
|
+
class ze {
|
|
3072
3089
|
constructor() {
|
|
3073
3090
|
this.container = null, this.stream = null, this.recorder = null, this.analyser = null, this.audioCtx = null, this.recording = !1, this.animFrame = null, this.startTime = 0, this.maxDuration = 12e4, this.maxTimer = null, this.canvas = null, this.timerEl = null, this.resolve = null, this.animate = () => {
|
|
3074
3091
|
this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
|
|
@@ -3199,8 +3216,8 @@ class Ue {
|
|
|
3199
3216
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3200
3217
|
const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
|
|
3201
3218
|
for (let d = 0; d < r; d++) {
|
|
3202
|
-
const c = o[d] / 255, h = Math.max(2, c * i * 0.85),
|
|
3203
|
-
e.fillStyle = `rgba(99, 102, 241, ${
|
|
3219
|
+
const c = o[d] / 255, h = Math.max(2, c * i * 0.85), u = d * (a + l), f = (i - h) / 2, b = 0.4 + c * 0.6;
|
|
3220
|
+
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u, f, a, h, 1), e.fill();
|
|
3204
3221
|
}
|
|
3205
3222
|
}
|
|
3206
3223
|
updateTimer() {
|
|
@@ -3218,25 +3235,25 @@ class Ue {
|
|
|
3218
3235
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3219
3236
|
}
|
|
3220
3237
|
}
|
|
3221
|
-
const
|
|
3238
|
+
const Zi = 180, Qi = 120, es = "#e2e8f0", ts = `
|
|
3222
3239
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3223
3240
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3224
3241
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
3225
|
-
</svg>`,
|
|
3242
|
+
</svg>`, mt = `
|
|
3226
3243
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3227
3244
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3228
3245
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3229
3246
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3230
|
-
</svg>`,
|
|
3247
|
+
</svg>`, is = `
|
|
3231
3248
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3232
3249
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3233
3250
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
3234
3251
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
3235
|
-
</svg>`,
|
|
3252
|
+
</svg>`, ss = `
|
|
3236
3253
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3237
3254
|
<polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
|
|
3238
3255
|
<polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
|
|
3239
|
-
</svg>`,
|
|
3256
|
+
</svg>`, A = class A {
|
|
3240
3257
|
/**
|
|
3241
3258
|
* Renders an inline rectangular video player and returns the root container.
|
|
3242
3259
|
* @param url - Video source URL
|
|
@@ -3248,10 +3265,10 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3248
3265
|
Object.assign(o.style, {
|
|
3249
3266
|
position: "relative",
|
|
3250
3267
|
display: "inline-block",
|
|
3251
|
-
width: `${
|
|
3252
|
-
height: `${
|
|
3268
|
+
width: `${Zi}px`,
|
|
3269
|
+
height: `${Qi}px`,
|
|
3253
3270
|
borderRadius: "8px",
|
|
3254
|
-
border: `1px solid ${
|
|
3271
|
+
border: `1px solid ${es}`,
|
|
3255
3272
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3256
3273
|
overflow: "hidden",
|
|
3257
3274
|
cursor: "pointer",
|
|
@@ -3281,7 +3298,7 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3281
3298
|
transition: "opacity 0.25s ease",
|
|
3282
3299
|
opacity: "1",
|
|
3283
3300
|
pointerEvents: "none"
|
|
3284
|
-
}), a.innerHTML =
|
|
3301
|
+
}), a.innerHTML = ts, o.appendChild(a);
|
|
3285
3302
|
const l = document.createElement("div");
|
|
3286
3303
|
Object.assign(l.style, {
|
|
3287
3304
|
position: "absolute",
|
|
@@ -3296,7 +3313,7 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3296
3313
|
justifyContent: "center",
|
|
3297
3314
|
pointerEvents: "none",
|
|
3298
3315
|
transition: "opacity 0.2s ease"
|
|
3299
|
-
}), l.innerHTML =
|
|
3316
|
+
}), l.innerHTML = mt, o.appendChild(l);
|
|
3300
3317
|
const d = document.createElement("div");
|
|
3301
3318
|
Object.assign(d.style, {
|
|
3302
3319
|
position: "absolute",
|
|
@@ -3312,28 +3329,28 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3312
3329
|
cursor: "pointer",
|
|
3313
3330
|
pointerEvents: "auto",
|
|
3314
3331
|
transition: "opacity 0.2s ease, background 0.15s ease"
|
|
3315
|
-
}), d.innerHTML =
|
|
3332
|
+
}), d.innerHTML = ss, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
|
|
3316
3333
|
d.style.background = "rgba(0,0,0,0.7)";
|
|
3317
3334
|
}), d.addEventListener("mouseleave", () => {
|
|
3318
3335
|
d.style.background = "rgba(0,0,0,0.45)";
|
|
3319
|
-
}), d.addEventListener("click", (
|
|
3320
|
-
|
|
3336
|
+
}), d.addEventListener("click", (u) => {
|
|
3337
|
+
u.stopPropagation(), A.openFullscreen(e, t);
|
|
3321
3338
|
}), o.appendChild(d);
|
|
3322
3339
|
function c() {
|
|
3323
3340
|
a.style.opacity = i ? "0" : "1";
|
|
3324
3341
|
}
|
|
3325
3342
|
function h() {
|
|
3326
|
-
l.style.display = i ? "flex" : "none", l.innerHTML = s ?
|
|
3343
|
+
l.style.display = i ? "flex" : "none", l.innerHTML = s ? mt : is, d.style.display = i ? "flex" : "none";
|
|
3327
3344
|
}
|
|
3328
|
-
return o.addEventListener("click", (
|
|
3329
|
-
|
|
3345
|
+
return o.addEventListener("click", (u) => {
|
|
3346
|
+
u.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
|
|
3330
3347
|
}), i = !0), c(), h();
|
|
3331
3348
|
}), r.addEventListener("pause", () => {
|
|
3332
3349
|
i && (i = !1, s = !0, r.muted = !0, c(), h());
|
|
3333
3350
|
}), o;
|
|
3334
3351
|
}
|
|
3335
3352
|
static openFullscreen(e, t) {
|
|
3336
|
-
|
|
3353
|
+
A.closeFullscreen();
|
|
3337
3354
|
const i = document.createElement("div");
|
|
3338
3355
|
Object.assign(i.style, {
|
|
3339
3356
|
position: "fixed",
|
|
@@ -3375,7 +3392,7 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3375
3392
|
}), s.addEventListener("mouseleave", () => {
|
|
3376
3393
|
s.style.background = "rgba(255,255,255,0.15)";
|
|
3377
3394
|
}), s.addEventListener("click", (a) => {
|
|
3378
|
-
a.stopPropagation(),
|
|
3395
|
+
a.stopPropagation(), A.closeFullscreen();
|
|
3379
3396
|
});
|
|
3380
3397
|
const o = document.createElement("video");
|
|
3381
3398
|
Object.assign(o.style, {
|
|
@@ -3384,25 +3401,25 @@ const Gi = 180, Ji = 120, Zi = "#e2e8f0", Qi = `
|
|
|
3384
3401
|
borderRadius: "8px",
|
|
3385
3402
|
outline: "none",
|
|
3386
3403
|
cursor: "default"
|
|
3387
|
-
}), 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", () =>
|
|
3404
|
+
}), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => A.closeFullscreen());
|
|
3388
3405
|
const r = (a) => {
|
|
3389
|
-
a.key === "Escape" &&
|
|
3406
|
+
a.key === "Escape" && A.closeFullscreen();
|
|
3390
3407
|
};
|
|
3391
|
-
document.addEventListener("keydown", r),
|
|
3408
|
+
document.addEventListener("keydown", r), A.fullscreenOverlay = i, A.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
|
|
3392
3409
|
i.style.opacity = "1";
|
|
3393
3410
|
});
|
|
3394
3411
|
}
|
|
3395
3412
|
static closeFullscreen() {
|
|
3396
|
-
if (!
|
|
3397
|
-
const e =
|
|
3398
|
-
|
|
3413
|
+
if (!A.fullscreenOverlay) return;
|
|
3414
|
+
const e = A.fullscreenOverlay;
|
|
3415
|
+
A.fullscreenKeyHandler && (document.removeEventListener("keydown", A.fullscreenKeyHandler), A.fullscreenKeyHandler = null);
|
|
3399
3416
|
const t = e.querySelector("video");
|
|
3400
|
-
t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()),
|
|
3417
|
+
t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), A.fullscreenOverlay = null;
|
|
3401
3418
|
}
|
|
3402
3419
|
};
|
|
3403
|
-
|
|
3404
|
-
let Ce =
|
|
3405
|
-
const
|
|
3420
|
+
A.fullscreenOverlay = null, A.fullscreenKeyHandler = null;
|
|
3421
|
+
let Ce = A;
|
|
3422
|
+
const gt = 60, ns = `
|
|
3406
3423
|
.vr-overlay {
|
|
3407
3424
|
display: flex;
|
|
3408
3425
|
flex-direction: column;
|
|
@@ -3509,14 +3526,14 @@ const mt = 60, is = `
|
|
|
3509
3526
|
color: #0f172a;
|
|
3510
3527
|
}
|
|
3511
3528
|
`;
|
|
3512
|
-
function
|
|
3529
|
+
function vt(n) {
|
|
3513
3530
|
return n.toString().padStart(2, "0");
|
|
3514
3531
|
}
|
|
3515
|
-
function
|
|
3532
|
+
function os(n) {
|
|
3516
3533
|
const e = Math.floor(n / 60), t = n % 60;
|
|
3517
|
-
return `${
|
|
3534
|
+
return `${vt(e)}:${vt(t)}`;
|
|
3518
3535
|
}
|
|
3519
|
-
function
|
|
3536
|
+
function rs() {
|
|
3520
3537
|
const n = [
|
|
3521
3538
|
"video/webm;codecs=vp9,opus",
|
|
3522
3539
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3527,7 +3544,7 @@ function ns() {
|
|
|
3527
3544
|
if (MediaRecorder.isTypeSupported(e)) return e;
|
|
3528
3545
|
return "";
|
|
3529
3546
|
}
|
|
3530
|
-
function
|
|
3547
|
+
function as(n) {
|
|
3531
3548
|
return new Promise((e, t) => {
|
|
3532
3549
|
const i = URL.createObjectURL(n), s = document.createElement("video");
|
|
3533
3550
|
s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
|
|
@@ -3563,7 +3580,7 @@ class De {
|
|
|
3563
3580
|
}
|
|
3564
3581
|
this.stream = t, this.container = e, this.recording = !0, this.elapsed = 0, this.chunks = [], this.buildUI(e), this.videoEl && (this.videoEl.srcObject = t, this.videoEl.play().catch(() => {
|
|
3565
3582
|
}));
|
|
3566
|
-
const i =
|
|
3583
|
+
const i = rs(), s = {};
|
|
3567
3584
|
i && (s.mimeType = i);
|
|
3568
3585
|
const o = new MediaRecorder(t, s);
|
|
3569
3586
|
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
@@ -3571,7 +3588,7 @@ class De {
|
|
|
3571
3588
|
}, o.onstop = () => {
|
|
3572
3589
|
this.handleRecordingComplete();
|
|
3573
3590
|
}, o.start(), this.timerInterval = setInterval(() => {
|
|
3574
|
-
this.elapsed++, this.updateTimer(), this.elapsed >=
|
|
3591
|
+
this.elapsed++, this.updateTimer(), this.elapsed >= gt && this.stopRecording();
|
|
3575
3592
|
}, 1e3), new Promise((r) => {
|
|
3576
3593
|
this.resolvePromise = r;
|
|
3577
3594
|
});
|
|
@@ -3588,7 +3605,7 @@ class De {
|
|
|
3588
3605
|
}
|
|
3589
3606
|
// ── Private ──
|
|
3590
3607
|
buildUI(e) {
|
|
3591
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3608
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = ns, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3592
3609
|
const t = document.createElement("div");
|
|
3593
3610
|
t.className = "vr-circle-wrapper";
|
|
3594
3611
|
const i = document.createElement("div");
|
|
@@ -3604,15 +3621,15 @@ class De {
|
|
|
3604
3621
|
}
|
|
3605
3622
|
updateTimer() {
|
|
3606
3623
|
if (!this.timerEl) return;
|
|
3607
|
-
const e =
|
|
3608
|
-
this.timerEl.textContent =
|
|
3624
|
+
const e = gt - this.elapsed;
|
|
3625
|
+
this.timerEl.textContent = os(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3609
3626
|
}
|
|
3610
3627
|
async handleRecordingComplete() {
|
|
3611
3628
|
var s, o;
|
|
3612
3629
|
const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3613
3630
|
let i;
|
|
3614
3631
|
try {
|
|
3615
|
-
i = await
|
|
3632
|
+
i = await as(t);
|
|
3616
3633
|
} catch {
|
|
3617
3634
|
const r = document.createElement("canvas");
|
|
3618
3635
|
r.width = 1, r.height = 1, i = await new Promise((a) => {
|
|
@@ -3635,7 +3652,7 @@ class De {
|
|
|
3635
3652
|
this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
|
|
3636
3653
|
}
|
|
3637
3654
|
}
|
|
3638
|
-
const
|
|
3655
|
+
const bt = {
|
|
3639
3656
|
position: "absolute",
|
|
3640
3657
|
top: "50%",
|
|
3641
3658
|
transform: "translateY(-50%)",
|
|
@@ -3653,7 +3670,7 @@ const vt = {
|
|
|
3653
3670
|
justifyContent: "center",
|
|
3654
3671
|
transition: "background 150ms ease",
|
|
3655
3672
|
zIndex: "1"
|
|
3656
|
-
},
|
|
3673
|
+
}, m = class m {
|
|
3657
3674
|
/**
|
|
3658
3675
|
* Opens a fullscreen lightbox overlay.
|
|
3659
3676
|
* @param imageUrl - Single image URL (backwards-compatible)
|
|
@@ -3661,8 +3678,8 @@ const vt = {
|
|
|
3661
3678
|
* @param startIndex - Index in allUrls to start at (default 0)
|
|
3662
3679
|
*/
|
|
3663
3680
|
static open(e, t, i) {
|
|
3664
|
-
|
|
3665
|
-
const s =
|
|
3681
|
+
m.close(), m.urls = t && t.length > 1 ? t : [e], m.currentIndex = i ?? 0;
|
|
3682
|
+
const s = m.urls.length > 1, o = document.createElement("div");
|
|
3666
3683
|
o.id = "pulse-widget-lightbox", Object.assign(o.style, {
|
|
3667
3684
|
position: "fixed",
|
|
3668
3685
|
top: "0",
|
|
@@ -3703,10 +3720,10 @@ const vt = {
|
|
|
3703
3720
|
}), r.addEventListener("mouseleave", () => {
|
|
3704
3721
|
r.style.background = "rgba(255,255,255,0.15)";
|
|
3705
3722
|
}), r.addEventListener("click", (d) => {
|
|
3706
|
-
d.stopPropagation(),
|
|
3723
|
+
d.stopPropagation(), m.close();
|
|
3707
3724
|
}), o.appendChild(r);
|
|
3708
3725
|
const a = document.createElement("img");
|
|
3709
|
-
if (a.src =
|
|
3726
|
+
if (a.src = m.urls[m.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
|
|
3710
3727
|
maxWidth: "90vw",
|
|
3711
3728
|
maxHeight: "85vh",
|
|
3712
3729
|
borderRadius: "8px",
|
|
@@ -3714,23 +3731,23 @@ const vt = {
|
|
|
3714
3731
|
cursor: "default",
|
|
3715
3732
|
userSelect: "none",
|
|
3716
3733
|
transition: "opacity 150ms ease"
|
|
3717
|
-
}), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a),
|
|
3734
|
+
}), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), m.imgEl = a, s) {
|
|
3718
3735
|
const d = document.createElement("button");
|
|
3719
|
-
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, { ...
|
|
3736
|
+
d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...bt, left: "16px" }), d.addEventListener("mouseenter", () => {
|
|
3720
3737
|
d.style.background = "rgba(255,255,255,0.3)";
|
|
3721
3738
|
}), d.addEventListener("mouseleave", () => {
|
|
3722
3739
|
d.style.background = "rgba(255,255,255,0.15)";
|
|
3723
|
-
}), d.addEventListener("click", (
|
|
3724
|
-
|
|
3725
|
-
}), o.appendChild(d),
|
|
3740
|
+
}), d.addEventListener("click", (u) => {
|
|
3741
|
+
u.stopPropagation(), m.navigate(-1);
|
|
3742
|
+
}), o.appendChild(d), m.prevBtn = d;
|
|
3726
3743
|
const c = document.createElement("button");
|
|
3727
|
-
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, { ...
|
|
3744
|
+
c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...bt, right: "16px" }), c.addEventListener("mouseenter", () => {
|
|
3728
3745
|
c.style.background = "rgba(255,255,255,0.3)";
|
|
3729
3746
|
}), c.addEventListener("mouseleave", () => {
|
|
3730
3747
|
c.style.background = "rgba(255,255,255,0.15)";
|
|
3731
|
-
}), c.addEventListener("click", (
|
|
3732
|
-
|
|
3733
|
-
}), o.appendChild(c),
|
|
3748
|
+
}), c.addEventListener("click", (u) => {
|
|
3749
|
+
u.stopPropagation(), m.navigate(1);
|
|
3750
|
+
}), o.appendChild(c), m.nextBtn = c;
|
|
3734
3751
|
const h = document.createElement("span");
|
|
3735
3752
|
Object.assign(h.style, {
|
|
3736
3753
|
position: "absolute",
|
|
@@ -3741,35 +3758,35 @@ const vt = {
|
|
|
3741
3758
|
fontSize: "13px",
|
|
3742
3759
|
fontWeight: "500",
|
|
3743
3760
|
pointerEvents: "none"
|
|
3744
|
-
}), o.appendChild(h),
|
|
3761
|
+
}), o.appendChild(h), m.counterEl = h, m.updateNav();
|
|
3745
3762
|
}
|
|
3746
|
-
o.addEventListener("click", () =>
|
|
3763
|
+
o.addEventListener("click", () => m.close());
|
|
3747
3764
|
const l = (d) => {
|
|
3748
|
-
d.key === "Escape" &&
|
|
3765
|
+
d.key === "Escape" && m.close(), s && d.key === "ArrowLeft" && m.navigate(-1), s && d.key === "ArrowRight" && m.navigate(1);
|
|
3749
3766
|
};
|
|
3750
|
-
document.addEventListener("keydown", l),
|
|
3767
|
+
document.addEventListener("keydown", l), m.overlay = o, m.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
|
|
3751
3768
|
o.style.opacity = "1";
|
|
3752
3769
|
});
|
|
3753
3770
|
}
|
|
3754
3771
|
static navigate(e) {
|
|
3755
|
-
const t =
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
}, 100)),
|
|
3772
|
+
const t = m.urls.length;
|
|
3773
|
+
m.currentIndex = (m.currentIndex + e + t) % t, m.imgEl && (m.imgEl.style.opacity = "0", setTimeout(() => {
|
|
3774
|
+
m.imgEl && (m.imgEl.src = m.urls[m.currentIndex], m.imgEl.style.opacity = "1");
|
|
3775
|
+
}, 100)), m.updateNav();
|
|
3759
3776
|
}
|
|
3760
3777
|
static updateNav() {
|
|
3761
|
-
const e =
|
|
3762
|
-
|
|
3778
|
+
const e = m.currentIndex, t = m.urls.length;
|
|
3779
|
+
m.counterEl && (m.counterEl.textContent = `${e + 1} / ${t}`);
|
|
3763
3780
|
}
|
|
3764
3781
|
/** Closes the lightbox if open. */
|
|
3765
3782
|
static close() {
|
|
3766
|
-
if (!
|
|
3767
|
-
const e =
|
|
3768
|
-
|
|
3783
|
+
if (!m.overlay) return;
|
|
3784
|
+
const e = m.overlay;
|
|
3785
|
+
m.onKeyDown && (document.removeEventListener("keydown", m.onKeyDown), m.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), m.overlay = null, m.imgEl = null, m.prevBtn = null, m.nextBtn = null, m.counterEl = null, m.urls = [], m.currentIndex = 0;
|
|
3769
3786
|
}
|
|
3770
3787
|
};
|
|
3771
|
-
|
|
3772
|
-
let Te =
|
|
3788
|
+
m.overlay = null, m.onKeyDown = null, m.urls = [], m.currentIndex = 0, m.imgEl = null, m.prevBtn = null, m.nextBtn = null, m.counterEl = null;
|
|
3789
|
+
let Te = m;
|
|
3773
3790
|
class re {
|
|
3774
3791
|
constructor(e) {
|
|
3775
3792
|
this.uploading = !1, this.client = e, this.input = document.createElement("input"), this.input.type = "file", this.input.style.display = "none", document.body.appendChild(this.input);
|
|
@@ -3864,7 +3881,105 @@ class re {
|
|
|
3864
3881
|
this.input.remove();
|
|
3865
3882
|
}
|
|
3866
3883
|
}
|
|
3867
|
-
const
|
|
3884
|
+
const ls = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
|
|
3885
|
+
class He {
|
|
3886
|
+
constructor(e) {
|
|
3887
|
+
this.dropdown = null, this.target = null, this.mentionStart = -1, this.selectedIndex = 0, this.filteredUsers = [], this.handleInput = () => {
|
|
3888
|
+
var l;
|
|
3889
|
+
if (!this.target) return;
|
|
3890
|
+
const t = this.target.value, i = this.target.selectionStart ?? t.length, s = t.slice(0, i), o = s.lastIndexOf("@");
|
|
3891
|
+
if (o === -1 || o > 0 && /\w/.test(s[o - 1])) {
|
|
3892
|
+
this.close();
|
|
3893
|
+
return;
|
|
3894
|
+
}
|
|
3895
|
+
const r = s.slice(o + 1).toLowerCase();
|
|
3896
|
+
if (r.includes(" ")) {
|
|
3897
|
+
this.close();
|
|
3898
|
+
return;
|
|
3899
|
+
}
|
|
3900
|
+
this.mentionStart = o;
|
|
3901
|
+
const a = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
3902
|
+
if (this.filteredUsers = this.client.state.users.filter((d) => d.id !== a && d.name.toLowerCase().includes(r)).slice(0, 5), this.filteredUsers.length === 0) {
|
|
3903
|
+
this.close();
|
|
3904
|
+
return;
|
|
3905
|
+
}
|
|
3906
|
+
this.selectedIndex = 0, this.showDropdown();
|
|
3907
|
+
}, this.handleKeydown = (t) => {
|
|
3908
|
+
this.dropdown && (t.key === "ArrowDown" ? (t.preventDefault(), this.selectedIndex = Math.min(this.selectedIndex + 1, this.filteredUsers.length - 1), this.renderItems()) : t.key === "ArrowUp" ? (t.preventDefault(), this.selectedIndex = Math.max(this.selectedIndex - 1, 0), this.renderItems()) : t.key === "Enter" && this.dropdown ? (t.preventDefault(), t.stopPropagation(), this.selectUser(this.filteredUsers[this.selectedIndex])) : t.key === "Escape" && this.close());
|
|
3909
|
+
}, this.handleBlur = () => {
|
|
3910
|
+
setTimeout(() => this.close(), 150);
|
|
3911
|
+
}, this.client = e;
|
|
3912
|
+
}
|
|
3913
|
+
/** Attach the mention picker to a text input or textarea. */
|
|
3914
|
+
attach(e) {
|
|
3915
|
+
this.target = e, e.addEventListener("input", this.handleInput), e.addEventListener("keydown", this.handleKeydown), e.addEventListener("blur", this.handleBlur);
|
|
3916
|
+
}
|
|
3917
|
+
/** Detach and clean up. */
|
|
3918
|
+
detach() {
|
|
3919
|
+
this.target && (this.target.removeEventListener("input", this.handleInput), this.target.removeEventListener("keydown", this.handleKeydown), this.target.removeEventListener("blur", this.handleBlur), this.target = null), this.close();
|
|
3920
|
+
}
|
|
3921
|
+
selectUser(e) {
|
|
3922
|
+
if (!this.target) return;
|
|
3923
|
+
const t = this.target.value, i = this.target.selectionStart ?? t.length, s = e.name.split(" ")[0], o = t.slice(0, this.mentionStart), r = t.slice(i);
|
|
3924
|
+
this.target.value = `${o}@${s} ${r}`;
|
|
3925
|
+
const a = this.mentionStart + s.length + 2;
|
|
3926
|
+
this.target.setSelectionRange(a, a), this.target.focus(), this.target.dispatchEvent(new Event("input", { bubbles: !0 })), this.close();
|
|
3927
|
+
}
|
|
3928
|
+
showDropdown() {
|
|
3929
|
+
if (!this.target) return;
|
|
3930
|
+
this.dropdown || (this.dropdown = document.createElement("div"), Object.assign(this.dropdown.style, {
|
|
3931
|
+
position: "absolute",
|
|
3932
|
+
zIndex: "100002",
|
|
3933
|
+
background: "#fff",
|
|
3934
|
+
border: "1px solid #e2e8f0",
|
|
3935
|
+
borderRadius: "8px",
|
|
3936
|
+
boxShadow: "0 4px 16px rgba(0,0,0,0.12)",
|
|
3937
|
+
overflow: "hidden",
|
|
3938
|
+
fontFamily: ls,
|
|
3939
|
+
minWidth: "160px",
|
|
3940
|
+
maxWidth: "220px"
|
|
3941
|
+
}), document.body.appendChild(this.dropdown));
|
|
3942
|
+
const e = this.target.getBoundingClientRect();
|
|
3943
|
+
this.dropdown.style.left = `${e.left}px`, this.dropdown.style.top = `${e.bottom + 4}px`, this.renderItems();
|
|
3944
|
+
}
|
|
3945
|
+
renderItems() {
|
|
3946
|
+
this.dropdown && (this.dropdown.innerHTML = this.filteredUsers.map((e, t) => {
|
|
3947
|
+
const i = e.name.split(" ").map((o) => o[0]).join("").toUpperCase().slice(0, 2), s = t === this.selectedIndex;
|
|
3948
|
+
return `
|
|
3949
|
+
<div class="mention-item" data-index="${t}" style="
|
|
3950
|
+
display:flex;align-items:center;gap:8px;padding:6px 10px;
|
|
3951
|
+
cursor:pointer;font-size:13px;
|
|
3952
|
+
background:${s ? "#f1f5f9" : "#fff"};
|
|
3953
|
+
transition:background 0.1s;
|
|
3954
|
+
">
|
|
3955
|
+
<div style="
|
|
3956
|
+
width:24px;height:24px;border-radius:50%;
|
|
3957
|
+
background:${e.color};color:#fff;
|
|
3958
|
+
display:flex;align-items:center;justify-content:center;
|
|
3959
|
+
font-size:10px;font-weight:700;flex-shrink:0;
|
|
3960
|
+
">${e.avatar ? `<img src="${e.avatar}" style="width:100%;height:100%;border-radius:50%;object-fit:cover;" />` : i}</div>
|
|
3961
|
+
<span style="color:#0f172a;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">${this.escapeHtml(e.name)}</span>
|
|
3962
|
+
</div>
|
|
3963
|
+
`;
|
|
3964
|
+
}).join(""), this.dropdown.querySelectorAll(".mention-item").forEach((e) => {
|
|
3965
|
+
e.addEventListener("mousedown", (t) => {
|
|
3966
|
+
t.preventDefault();
|
|
3967
|
+
const i = parseInt(e.dataset.index, 10);
|
|
3968
|
+
this.selectUser(this.filteredUsers[i]);
|
|
3969
|
+
}), e.addEventListener("mouseenter", () => {
|
|
3970
|
+
this.selectedIndex = parseInt(e.dataset.index, 10), this.renderItems();
|
|
3971
|
+
});
|
|
3972
|
+
}));
|
|
3973
|
+
}
|
|
3974
|
+
close() {
|
|
3975
|
+
var e;
|
|
3976
|
+
(e = this.dropdown) == null || e.remove(), this.dropdown = null, this.mentionStart = -1, this.filteredUsers = [];
|
|
3977
|
+
}
|
|
3978
|
+
escapeHtml(e) {
|
|
3979
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
const cs = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ds = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', hs = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', xt = `<button class="pulse-close-btn" style="
|
|
3868
3983
|
border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
|
|
3869
3984
|
border-radius:6px;display:flex;align-items:center;justify-content:center;
|
|
3870
3985
|
transition:all 0.15s;flex-shrink:0;
|
|
@@ -3872,7 +3987,7 @@ const rs = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-syst
|
|
|
3872
3987
|
onmouseout="this.style.background='none';this.style.color='#94a3b8'">
|
|
3873
3988
|
<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>
|
|
3874
3989
|
</button>`;
|
|
3875
|
-
class
|
|
3990
|
+
class ps {
|
|
3876
3991
|
constructor(e, t = {}) {
|
|
3877
3992
|
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 = () => {
|
|
3878
3993
|
this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
|
|
@@ -4012,7 +4127,7 @@ class cs {
|
|
|
4012
4127
|
}), this.form.innerHTML = `
|
|
4013
4128
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
|
|
4014
4129
|
<span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
|
|
4015
|
-
${
|
|
4130
|
+
${xt}
|
|
4016
4131
|
</div>
|
|
4017
4132
|
<textarea
|
|
4018
4133
|
placeholder="Write a comment..."
|
|
@@ -4044,13 +4159,15 @@ class cs {
|
|
|
4044
4159
|
</div>
|
|
4045
4160
|
<div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
|
|
4046
4161
|
`;
|
|
4047
|
-
const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
|
|
4048
|
-
d.addEventListener("click", () =>
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
const
|
|
4053
|
-
|
|
4162
|
+
const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit"), h = new He(this.client);
|
|
4163
|
+
h.attach(l), d.addEventListener("click", () => {
|
|
4164
|
+
h.detach(), this.exitPinMode();
|
|
4165
|
+
}), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
|
|
4166
|
+
const u = this.form.querySelector(".pin-attachments-preview"), f = (x, y) => {
|
|
4167
|
+
const v = document.createElement("div");
|
|
4168
|
+
Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
|
|
4169
|
+
const $ = document.createElement("button");
|
|
4170
|
+
$.innerHTML = "×", Object.assign($.style, {
|
|
4054
4171
|
position: "absolute",
|
|
4055
4172
|
top: "-4px",
|
|
4056
4173
|
right: "-4px",
|
|
@@ -4068,51 +4185,51 @@ class cs {
|
|
|
4068
4185
|
justifyContent: "center",
|
|
4069
4186
|
padding: "0",
|
|
4070
4187
|
fontWeight: "700"
|
|
4071
|
-
}),
|
|
4072
|
-
const
|
|
4073
|
-
|
|
4074
|
-
}),
|
|
4075
|
-
},
|
|
4188
|
+
}), $.addEventListener("click", () => {
|
|
4189
|
+
const T = this.pendingAttachmentIds.indexOf(x);
|
|
4190
|
+
T !== -1 && this.pendingAttachmentIds.splice(T, 1), v.remove();
|
|
4191
|
+
}), v.appendChild($), u.appendChild(v);
|
|
4192
|
+
}, b = 5;
|
|
4076
4193
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
4077
|
-
const
|
|
4078
|
-
if (
|
|
4079
|
-
const y = await this.upload.pickFiles("image/*",
|
|
4080
|
-
for (const
|
|
4081
|
-
this.pendingAttachmentIds.push(
|
|
4082
|
-
const
|
|
4083
|
-
|
|
4194
|
+
const x = b - this.pendingAttachmentIds.length;
|
|
4195
|
+
if (x <= 0) return;
|
|
4196
|
+
const y = await this.upload.pickFiles("image/*", x);
|
|
4197
|
+
for (const v of y) {
|
|
4198
|
+
this.pendingAttachmentIds.push(v.id);
|
|
4199
|
+
const $ = document.createElement("img");
|
|
4200
|
+
$.src = v.thumbnailUrl || v.url, Object.assign($.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), f(v.id, $);
|
|
4084
4201
|
}
|
|
4085
4202
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
4086
|
-
if (this.pendingAttachmentIds.length >=
|
|
4087
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
4088
|
-
const
|
|
4089
|
-
if (
|
|
4090
|
-
const y = await this.upload.uploadBlob(
|
|
4203
|
+
if (this.pendingAttachmentIds.length >= b) return;
|
|
4204
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4205
|
+
const x = await this.audioRecorder.startRecording(u);
|
|
4206
|
+
if (x) {
|
|
4207
|
+
const y = await this.upload.uploadBlob(x, "audio.webm");
|
|
4091
4208
|
if (y) {
|
|
4092
4209
|
this.pendingAttachmentIds.push(y.id);
|
|
4093
|
-
const
|
|
4094
|
-
Object.assign(
|
|
4210
|
+
const v = document.createElement("span");
|
|
4211
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", f(y.id, v);
|
|
4095
4212
|
}
|
|
4096
4213
|
}
|
|
4097
4214
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
4098
|
-
if (this.pendingAttachmentIds.length >=
|
|
4215
|
+
if (this.pendingAttachmentIds.length >= b) return;
|
|
4099
4216
|
this.videoRecorder || (this.videoRecorder = new De());
|
|
4100
|
-
const
|
|
4101
|
-
if (
|
|
4102
|
-
const y = await this.upload.uploadBlob(
|
|
4217
|
+
const x = await this.videoRecorder.startRecording(u);
|
|
4218
|
+
if (x) {
|
|
4219
|
+
const y = await this.upload.uploadBlob(x.blob, "video.webm");
|
|
4103
4220
|
if (y) {
|
|
4104
4221
|
this.pendingAttachmentIds.push(y.id);
|
|
4105
|
-
const
|
|
4106
|
-
Object.assign(
|
|
4222
|
+
const v = document.createElement("span");
|
|
4223
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", f(y.id, v);
|
|
4107
4224
|
}
|
|
4108
4225
|
}
|
|
4109
4226
|
}), c.addEventListener("click", () => {
|
|
4110
|
-
const
|
|
4111
|
-
if (!
|
|
4112
|
-
const y = [...(
|
|
4113
|
-
this.client.createThread(
|
|
4114
|
-
}), l.addEventListener("keydown", (
|
|
4115
|
-
|
|
4227
|
+
const x = l.value.trim();
|
|
4228
|
+
if (!x && this.pendingAttachmentIds.length === 0) return;
|
|
4229
|
+
const y = [...(x || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
|
|
4230
|
+
this.client.createThread(x, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
4231
|
+
}), l.addEventListener("keydown", (x) => {
|
|
4232
|
+
x.key === "Escape" && this.exitPinMode(), x.stopPropagation();
|
|
4116
4233
|
}), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
|
|
4117
4234
|
}
|
|
4118
4235
|
// ── Inline thread popover (shown when a pin dot is clicked) ──
|
|
@@ -4148,7 +4265,7 @@ class cs {
|
|
|
4148
4265
|
flexShrink: "0"
|
|
4149
4266
|
}), l.innerHTML = `
|
|
4150
4267
|
<span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
|
|
4151
|
-
${
|
|
4268
|
+
${xt}
|
|
4152
4269
|
`, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
|
|
4153
4270
|
this.closePopover();
|
|
4154
4271
|
}), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
|
|
@@ -4176,13 +4293,13 @@ class cs {
|
|
|
4176
4293
|
}
|
|
4177
4294
|
const i = (d = this.client.state.user) == null ? void 0 : d.id;
|
|
4178
4295
|
t.innerHTML = e.comments.map((c) => {
|
|
4179
|
-
const h = this.client.state.getUser(c.userId),
|
|
4296
|
+
const h = this.client.state.getUser(c.userId), u = h ? h.name.split(" ").map((R) => R[0]).join("").toUpperCase().slice(0, 2) : "?", f = (h == null ? void 0 : h.color) ?? "#94a3b8", b = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), x = this.formatTime(c.createdAt), y = i === c.userId, v = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
4180
4297
|
if (this.editingPopoverCommentId === c.id)
|
|
4181
4298
|
return `
|
|
4182
4299
|
<div style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4183
4300
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
|
|
4184
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4185
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4301
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${f};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${u}</div>
|
|
4302
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${b}</span>
|
|
4186
4303
|
</div>
|
|
4187
4304
|
<div style="margin-left:29px;">
|
|
4188
4305
|
<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>
|
|
@@ -4193,37 +4310,37 @@ class cs {
|
|
|
4193
4310
|
</div>
|
|
4194
4311
|
</div>
|
|
4195
4312
|
`;
|
|
4196
|
-
const
|
|
4313
|
+
const $ = c.body && c.body !== "(attachment)" ? c.body.replace(
|
|
4197
4314
|
/@(\w+)/g,
|
|
4198
4315
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
4199
|
-
) : "",
|
|
4200
|
-
if (
|
|
4201
|
-
const
|
|
4202
|
-
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(
|
|
4203
|
-
<img src="${this.escapeHtml(
|
|
4316
|
+
) : "", T = (c.attachments ?? []).map((R) => {
|
|
4317
|
+
if (R.type === "image") {
|
|
4318
|
+
const jt = R.thumbnailUrl || R.url;
|
|
4319
|
+
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(R.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
4320
|
+
<img src="${this.escapeHtml(jt)}" alt="${this.escapeHtml(R.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
4204
4321
|
</div>`;
|
|
4205
4322
|
}
|
|
4206
|
-
return
|
|
4207
|
-
}).join(""),
|
|
4323
|
+
return R.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(R.url)}" data-duration="${R.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : R.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(R.url)}" data-poster="${this.escapeHtml(R.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
4324
|
+
}).join(""), U = y ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
4208
4325
|
<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"
|
|
4209
4326
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
4210
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4327
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ds}</button>
|
|
4211
4328
|
<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"
|
|
4212
4329
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
4213
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4214
|
-
</div>` : "",
|
|
4330
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${hs}</button>
|
|
4331
|
+
</div>` : "", Lt = this.buildReactionPillsHtml(c.id);
|
|
4215
4332
|
return `
|
|
4216
4333
|
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4217
4334
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
4218
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4219
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4220
|
-
<span style="font-size:10px;color:#94a3b8;">${
|
|
4221
|
-
${
|
|
4335
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${f};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${u}</div>
|
|
4336
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${b}</span>
|
|
4337
|
+
<span style="font-size:10px;color:#94a3b8;">${x}</span>
|
|
4338
|
+
${v}
|
|
4222
4339
|
</div>
|
|
4223
|
-
${
|
|
4224
|
-
${
|
|
4225
|
-
${
|
|
4226
|
-
${
|
|
4340
|
+
${$ ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${$}</div>` : ""}
|
|
4341
|
+
${T}
|
|
4342
|
+
${U}
|
|
4343
|
+
${Lt}
|
|
4227
4344
|
</div>
|
|
4228
4345
|
`;
|
|
4229
4346
|
}).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
|
|
@@ -4241,7 +4358,7 @@ class cs {
|
|
|
4241
4358
|
s && r && s.addEventListener("click", () => {
|
|
4242
4359
|
const c = r.value.trim();
|
|
4243
4360
|
if (!c) return;
|
|
4244
|
-
const h = [...c.matchAll(/@(\w+)/g)].map((
|
|
4361
|
+
const h = [...c.matchAll(/@(\w+)/g)].map((u) => u[1]);
|
|
4245
4362
|
this.client.editComment(
|
|
4246
4363
|
this.editingPopoverCommentId,
|
|
4247
4364
|
c,
|
|
@@ -4252,33 +4369,33 @@ class cs {
|
|
|
4252
4369
|
}), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
|
|
4253
4370
|
c.addEventListener("click", (h) => {
|
|
4254
4371
|
h.stopPropagation();
|
|
4255
|
-
const
|
|
4256
|
-
|
|
4372
|
+
const u = c.dataset.reactionEmoji, f = c.dataset.reactionTarget, b = c.dataset.reactionId;
|
|
4373
|
+
b ? this.client.removeReaction(b) : this.client.addReaction(f, "comment", u);
|
|
4257
4374
|
});
|
|
4258
4375
|
}), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
|
|
4259
4376
|
c.addEventListener("click", (h) => {
|
|
4260
4377
|
h.stopPropagation();
|
|
4261
|
-
const
|
|
4262
|
-
this.popoverPickerOpen ===
|
|
4378
|
+
const u = c.dataset.commentId;
|
|
4379
|
+
this.popoverPickerOpen === u ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = u, this.showPickerForButton(c, u));
|
|
4263
4380
|
});
|
|
4264
4381
|
});
|
|
4265
4382
|
const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
|
|
4266
4383
|
a.forEach((c, h) => {
|
|
4267
4384
|
c.addEventListener("click", () => {
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4385
|
+
const u = c.dataset.fullUrl;
|
|
4386
|
+
u && Te.open(u, l, h);
|
|
4270
4387
|
});
|
|
4271
4388
|
}), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
|
|
4272
4389
|
const h = c.dataset.url;
|
|
4273
4390
|
if (h) {
|
|
4274
|
-
const
|
|
4275
|
-
c.appendChild(
|
|
4391
|
+
const u = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, f = Ue.render(h, u);
|
|
4392
|
+
c.appendChild(f);
|
|
4276
4393
|
}
|
|
4277
4394
|
}), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
|
|
4278
4395
|
const h = c.dataset.url;
|
|
4279
4396
|
if (h) {
|
|
4280
|
-
const
|
|
4281
|
-
c.appendChild(
|
|
4397
|
+
const u = c.dataset.poster || void 0, f = Ce.render(h, u);
|
|
4398
|
+
c.appendChild(f);
|
|
4282
4399
|
}
|
|
4283
4400
|
}), t.scrollTop = t.scrollHeight;
|
|
4284
4401
|
}
|
|
@@ -4311,9 +4428,11 @@ class cs {
|
|
|
4311
4428
|
`;
|
|
4312
4429
|
const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
|
|
4313
4430
|
this.upload || (this.upload = new re(this.client));
|
|
4314
|
-
const l = []
|
|
4315
|
-
|
|
4316
|
-
|
|
4431
|
+
const l = [];
|
|
4432
|
+
new He(this.client).attach(o);
|
|
4433
|
+
const c = (f, b) => {
|
|
4434
|
+
const x = document.createElement("span");
|
|
4435
|
+
Object.assign(x.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), x.textContent = b;
|
|
4317
4436
|
const y = document.createElement("button");
|
|
4318
4437
|
y.innerHTML = "×", Object.assign(y.style, {
|
|
4319
4438
|
position: "absolute",
|
|
@@ -4334,44 +4453,44 @@ class cs {
|
|
|
4334
4453
|
padding: "0",
|
|
4335
4454
|
fontWeight: "700"
|
|
4336
4455
|
}), y.addEventListener("click", () => {
|
|
4337
|
-
const
|
|
4338
|
-
|
|
4339
|
-
}),
|
|
4340
|
-
},
|
|
4456
|
+
const v = l.indexOf(f);
|
|
4457
|
+
v !== -1 && l.splice(v, 1), x.remove();
|
|
4458
|
+
}), x.appendChild(y), a.appendChild(x);
|
|
4459
|
+
}, h = 5;
|
|
4341
4460
|
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4342
|
-
const
|
|
4343
|
-
if (
|
|
4344
|
-
const
|
|
4345
|
-
for (const
|
|
4346
|
-
l.push(
|
|
4461
|
+
const f = h - l.length;
|
|
4462
|
+
if (f <= 0) return;
|
|
4463
|
+
const b = await this.upload.pickFiles("image/*", f);
|
|
4464
|
+
for (const x of b)
|
|
4465
|
+
l.push(x.id), c(x.id, "📎 Image");
|
|
4347
4466
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4348
|
-
if (l.length >=
|
|
4349
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
4350
|
-
const
|
|
4351
|
-
if (
|
|
4352
|
-
const
|
|
4353
|
-
|
|
4467
|
+
if (l.length >= h) return;
|
|
4468
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4469
|
+
const f = await this.audioRecorder.startRecording(t);
|
|
4470
|
+
if (f) {
|
|
4471
|
+
const b = await this.upload.uploadBlob(f, "audio.webm");
|
|
4472
|
+
b && (l.push(b.id), c(b.id, "🎤 Audio"));
|
|
4354
4473
|
}
|
|
4355
4474
|
}), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
|
|
4356
|
-
if (l.length >=
|
|
4475
|
+
if (l.length >= h) return;
|
|
4357
4476
|
this.videoRecorder || (this.videoRecorder = new De());
|
|
4358
|
-
const
|
|
4359
|
-
if (
|
|
4360
|
-
const
|
|
4361
|
-
|
|
4477
|
+
const f = await this.videoRecorder.startRecording(t);
|
|
4478
|
+
if (f) {
|
|
4479
|
+
const b = await this.upload.uploadBlob(f.blob, "video.webm");
|
|
4480
|
+
b && (l.push(b.id), c(b.id, "🎥 Video"));
|
|
4362
4481
|
}
|
|
4363
4482
|
});
|
|
4364
|
-
const
|
|
4365
|
-
const
|
|
4366
|
-
if (!
|
|
4367
|
-
const
|
|
4368
|
-
this.client.reply(e.id,
|
|
4483
|
+
const u = () => {
|
|
4484
|
+
const f = o.value.trim();
|
|
4485
|
+
if (!f && l.length === 0) return;
|
|
4486
|
+
const b = [...(f || "").matchAll(/@(\w+)/g)].map((x) => x[1]);
|
|
4487
|
+
this.client.reply(e.id, f, b, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
|
|
4369
4488
|
};
|
|
4370
|
-
r.addEventListener("click",
|
|
4371
|
-
const
|
|
4372
|
-
|
|
4373
|
-
}), o.addEventListener("keydown", (
|
|
4374
|
-
|
|
4489
|
+
r.addEventListener("click", u), o.addEventListener("input", () => {
|
|
4490
|
+
const f = Date.now(), b = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4491
|
+
f - b >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, f));
|
|
4492
|
+
}), o.addEventListener("keydown", (f) => {
|
|
4493
|
+
f.key === "Enter" && (f.preventDefault(), u()), f.key === "Escape" && this.closePopover(), f.stopPropagation();
|
|
4375
4494
|
}), this.popover.appendChild(t);
|
|
4376
4495
|
}
|
|
4377
4496
|
removePickerEl() {
|
|
@@ -4396,7 +4515,7 @@ class cs {
|
|
|
4396
4515
|
zIndex: "10002",
|
|
4397
4516
|
fontFamily: xe
|
|
4398
4517
|
});
|
|
4399
|
-
for (const s of
|
|
4518
|
+
for (const s of cs) {
|
|
4400
4519
|
const o = document.createElement("button");
|
|
4401
4520
|
Object.assign(o.style, {
|
|
4402
4521
|
border: "none",
|
|
@@ -4429,8 +4548,8 @@ class cs {
|
|
|
4429
4548
|
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;";
|
|
4430
4549
|
let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4431
4550
|
for (const [d, { count: c, ownId: h }] of s) {
|
|
4432
|
-
const
|
|
4433
|
-
a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${
|
|
4551
|
+
const u = h ? r : o;
|
|
4552
|
+
a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${u}">
|
|
4434
4553
|
<span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
|
|
4435
4554
|
</button>`;
|
|
4436
4555
|
}
|
|
@@ -4531,13 +4650,13 @@ class cs {
|
|
|
4531
4650
|
});
|
|
4532
4651
|
}
|
|
4533
4652
|
}
|
|
4534
|
-
var
|
|
4535
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
4653
|
+
var us = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, z = (n, e, t, i) => {
|
|
4654
|
+
for (var s = i > 1 ? void 0 : i ? fs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
4536
4655
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
4537
|
-
return i && s &&
|
|
4656
|
+
return i && s && us(e, t, s), s;
|
|
4538
4657
|
};
|
|
4539
|
-
const
|
|
4540
|
-
let
|
|
4658
|
+
const ms = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4659
|
+
let I = class extends _ {
|
|
4541
4660
|
constructor() {
|
|
4542
4661
|
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 = [];
|
|
4543
4662
|
}
|
|
@@ -4555,18 +4674,19 @@ let P = class extends A {
|
|
|
4555
4674
|
this.client && !this.unsub && this.ensureListener();
|
|
4556
4675
|
}
|
|
4557
4676
|
updated(n) {
|
|
4558
|
-
var
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4677
|
+
var t, i, s;
|
|
4678
|
+
const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".reply-form input");
|
|
4679
|
+
e && this.client && (this.mentionPicker || (this.mentionPicker = new He(this.client)), e.dataset.mentionAttached || (this.mentionPicker.attach(e), e.dataset.mentionAttached = "1")), (i = this.shadowRoot) == null || i.querySelectorAll(".audio-player-host").forEach((o) => {
|
|
4680
|
+
if (o.children.length > 0) return;
|
|
4681
|
+
const r = o.dataset.url;
|
|
4682
|
+
if (r) {
|
|
4683
|
+
const a = o.dataset.duration ? parseInt(o.dataset.duration) : void 0;
|
|
4684
|
+
o.appendChild(Ue.render(r, a));
|
|
4685
|
+
}
|
|
4686
|
+
}), (s = this.shadowRoot) == null || s.querySelectorAll(".video-player-host").forEach((o) => {
|
|
4687
|
+
if (o.children.length > 0) return;
|
|
4688
|
+
const r = o.dataset.url;
|
|
4689
|
+
r && o.appendChild(Ce.render(r, o.dataset.poster || void 0));
|
|
4570
4690
|
});
|
|
4571
4691
|
}
|
|
4572
4692
|
teardownListeners() {
|
|
@@ -4634,7 +4754,7 @@ let P = class extends A {
|
|
|
4634
4754
|
}
|
|
4635
4755
|
parseMentions(n) {
|
|
4636
4756
|
return n.split(/(@\w+)/g).map(
|
|
4637
|
-
(t) => t.startsWith("@") ?
|
|
4757
|
+
(t) => t.startsWith("@") ? p`<span class="mention">${t}</span>` : t
|
|
4638
4758
|
);
|
|
4639
4759
|
}
|
|
4640
4760
|
getInitials(n) {
|
|
@@ -4652,15 +4772,15 @@ let P = class extends A {
|
|
|
4652
4772
|
}
|
|
4653
4773
|
async handleAttachImage() {
|
|
4654
4774
|
this.upload || (this.upload = new re(this.client));
|
|
4655
|
-
const n =
|
|
4775
|
+
const n = I.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
|
|
4656
4776
|
if (n <= 0) return;
|
|
4657
4777
|
const e = await this.upload.pickFiles("image/*", n);
|
|
4658
4778
|
e.length > 0 && (this.replyAttachmentIds.push(...e.map((t) => t.id)), this.requestUpdate());
|
|
4659
4779
|
}
|
|
4660
4780
|
async handleRecordAudio(n) {
|
|
4661
4781
|
var i;
|
|
4662
|
-
if (this.replyAttachmentIds.length >=
|
|
4663
|
-
this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new
|
|
4782
|
+
if (this.replyAttachmentIds.length >= I.MAX_ATTACHMENTS) return;
|
|
4783
|
+
this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
|
|
4664
4784
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4665
4785
|
if (t) {
|
|
4666
4786
|
const s = await this.upload.uploadBlob(t, "audio.webm");
|
|
@@ -4669,7 +4789,7 @@ let P = class extends A {
|
|
|
4669
4789
|
}
|
|
4670
4790
|
async handleRecordVideo(n) {
|
|
4671
4791
|
var i;
|
|
4672
|
-
if (this.replyAttachmentIds.length >=
|
|
4792
|
+
if (this.replyAttachmentIds.length >= I.MAX_ATTACHMENTS) return;
|
|
4673
4793
|
this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new De());
|
|
4674
4794
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4675
4795
|
if (t) {
|
|
@@ -4707,7 +4827,7 @@ let P = class extends A {
|
|
|
4707
4827
|
this.client.deleteComment(n);
|
|
4708
4828
|
}
|
|
4709
4829
|
renderEditForm(n) {
|
|
4710
|
-
return
|
|
4830
|
+
return p`
|
|
4711
4831
|
<div class="edit-form">
|
|
4712
4832
|
<textarea
|
|
4713
4833
|
.value=${this.editBody}
|
|
@@ -4728,12 +4848,12 @@ let P = class extends A {
|
|
|
4728
4848
|
const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
|
|
4729
4849
|
for (const o of e)
|
|
4730
4850
|
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4731
|
-
return
|
|
4851
|
+
return p`
|
|
4732
4852
|
<div class="comment-reactions">
|
|
4733
4853
|
${[...i.entries()].map(
|
|
4734
4854
|
([o, r]) => {
|
|
4735
4855
|
const a = r.some((l) => l.userId === t);
|
|
4736
|
-
return
|
|
4856
|
+
return p`
|
|
4737
4857
|
<button
|
|
4738
4858
|
class="reaction-pill ${a ? "own" : ""}"
|
|
4739
4859
|
@click=${() => this.toggleReaction(n.id, o)}
|
|
@@ -4752,26 +4872,26 @@ let P = class extends A {
|
|
|
4752
4872
|
title="Add reaction"
|
|
4753
4873
|
>
|
|
4754
4874
|
+
|
|
4755
|
-
${this.pickerOpenForComment === n.id ?
|
|
4875
|
+
${this.pickerOpenForComment === n.id ? p`
|
|
4756
4876
|
<div class="emoji-picker">
|
|
4757
|
-
${
|
|
4758
|
-
(o) =>
|
|
4877
|
+
${ms.map(
|
|
4878
|
+
(o) => p`
|
|
4759
4879
|
<button @click=${(r) => {
|
|
4760
4880
|
r.stopPropagation(), this.toggleReaction(n.id, o);
|
|
4761
4881
|
}}>${o}</button>
|
|
4762
4882
|
`
|
|
4763
4883
|
)}
|
|
4764
4884
|
</div>
|
|
4765
|
-
` :
|
|
4885
|
+
` : g}
|
|
4766
4886
|
</button>
|
|
4767
4887
|
</div>
|
|
4768
4888
|
`;
|
|
4769
4889
|
}
|
|
4770
4890
|
renderTypingIndicator(n) {
|
|
4771
4891
|
const e = this.typingByThread.get(n) ?? [];
|
|
4772
|
-
if (e.length === 0) return
|
|
4892
|
+
if (e.length === 0) return g;
|
|
4773
4893
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4774
|
-
return
|
|
4894
|
+
return p`<div class="typing-indicator">${t}</div>`;
|
|
4775
4895
|
}
|
|
4776
4896
|
sortedThreads() {
|
|
4777
4897
|
return [...this.threads].sort((n, e) => {
|
|
@@ -4782,7 +4902,7 @@ let P = class extends A {
|
|
|
4782
4902
|
}
|
|
4783
4903
|
render() {
|
|
4784
4904
|
const n = this.sortedThreads();
|
|
4785
|
-
return
|
|
4905
|
+
return p`
|
|
4786
4906
|
<div class="panel">
|
|
4787
4907
|
<div class="panel-header">
|
|
4788
4908
|
<span class="panel-title">
|
|
@@ -4790,12 +4910,12 @@ let P = class extends A {
|
|
|
4790
4910
|
<span class="thread-count">${this.threads.length}</span>
|
|
4791
4911
|
</span>
|
|
4792
4912
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4793
|
-
${
|
|
4913
|
+
${S(ve, 16)}
|
|
4794
4914
|
</button>
|
|
4795
4915
|
</div>
|
|
4796
4916
|
|
|
4797
4917
|
<div class="panel-body pw-scrollable">
|
|
4798
|
-
${n.length === 0 ?
|
|
4918
|
+
${n.length === 0 ? p`<div class="empty">
|
|
4799
4919
|
<div class="empty-icon">💬</div>
|
|
4800
4920
|
No comments yet
|
|
4801
4921
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -4808,13 +4928,13 @@ let P = class extends A {
|
|
|
4808
4928
|
`;
|
|
4809
4929
|
}
|
|
4810
4930
|
renderAttachments(n) {
|
|
4811
|
-
if (!n || n.length === 0) return
|
|
4931
|
+
if (!n || n.length === 0) return g;
|
|
4812
4932
|
const e = n.filter((t) => t.type === "image").map((t) => t.url);
|
|
4813
|
-
return
|
|
4933
|
+
return p`
|
|
4814
4934
|
${n.map((t) => {
|
|
4815
4935
|
if (t.type === "image") {
|
|
4816
4936
|
const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
|
|
4817
|
-
return
|
|
4937
|
+
return p`
|
|
4818
4938
|
<div class="comment-attachment-media">
|
|
4819
4939
|
<img
|
|
4820
4940
|
class="comment-attachment-img"
|
|
@@ -4825,40 +4945,40 @@ let P = class extends A {
|
|
|
4825
4945
|
</div>
|
|
4826
4946
|
`;
|
|
4827
4947
|
}
|
|
4828
|
-
return t.type === "audio" ?
|
|
4948
|
+
return t.type === "audio" ? p`
|
|
4829
4949
|
<div class="comment-attachment-media" id="audio-${t.id}">
|
|
4830
4950
|
${this.renderAudioPlayer(t)}
|
|
4831
4951
|
</div>
|
|
4832
|
-
` : t.type === "video" ?
|
|
4952
|
+
` : t.type === "video" ? p`
|
|
4833
4953
|
<div class="comment-attachment-media" id="video-${t.id}">
|
|
4834
4954
|
${this.renderVideoPlayer(t)}
|
|
4835
4955
|
</div>
|
|
4836
|
-
` :
|
|
4956
|
+
` : g;
|
|
4837
4957
|
})}
|
|
4838
4958
|
`;
|
|
4839
4959
|
}
|
|
4840
4960
|
renderAudioPlayer(n) {
|
|
4841
|
-
const e = document.createElement("div"), t =
|
|
4842
|
-
return e.appendChild(t),
|
|
4961
|
+
const e = document.createElement("div"), t = Ue.render(n.url, n.durationMs);
|
|
4962
|
+
return e.appendChild(t), p`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
|
|
4843
4963
|
}
|
|
4844
4964
|
renderVideoPlayer(n) {
|
|
4845
|
-
return
|
|
4965
|
+
return p`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
|
|
4846
4966
|
}
|
|
4847
4967
|
renderThread(n) {
|
|
4848
4968
|
const e = this.highlightThreadId === n.id;
|
|
4849
|
-
return
|
|
4969
|
+
return p`
|
|
4850
4970
|
<div
|
|
4851
4971
|
class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
|
|
4852
4972
|
data-thread-id=${n.id}
|
|
4853
4973
|
>
|
|
4854
|
-
${n.position ?
|
|
4855
|
-
${
|
|
4974
|
+
${n.position ? p`<div class="pin-badge">
|
|
4975
|
+
${S(Ot, 12)}
|
|
4856
4976
|
Pinned
|
|
4857
|
-
</div>` :
|
|
4977
|
+
</div>` : g}
|
|
4858
4978
|
${n.comments.map((t, i) => {
|
|
4859
4979
|
const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4860
|
-
return
|
|
4861
|
-
${i > 0 ?
|
|
4980
|
+
return p`
|
|
4981
|
+
${i > 0 ? p`<div class="comment-divider"></div>` : g}
|
|
4862
4982
|
<div class="comment">
|
|
4863
4983
|
<div class="comment-header">
|
|
4864
4984
|
<div
|
|
@@ -4869,16 +4989,16 @@ let P = class extends A {
|
|
|
4869
4989
|
</div>
|
|
4870
4990
|
<span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
|
|
4871
4991
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4872
|
-
${t.editedAt ?
|
|
4992
|
+
${t.editedAt ? p`<span class="edited-badge">(edited)</span>` : g}
|
|
4873
4993
|
</div>
|
|
4874
|
-
${r ? this.renderEditForm(t) :
|
|
4875
|
-
${t.body && t.body !== "(attachment)" ?
|
|
4994
|
+
${r ? this.renderEditForm(t) : p`
|
|
4995
|
+
${t.body && t.body !== "(attachment)" ? p`<div class="comment-body">${this.parseMentions(t.body)}</div>` : g}
|
|
4876
4996
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4877
4997
|
`}
|
|
4878
|
-
${o && !r ?
|
|
4879
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${
|
|
4880
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${
|
|
4881
|
-
</div>` :
|
|
4998
|
+
${o && !r ? p`<div class="comment-actions">
|
|
4999
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${S(Hi, 14)}</button>
|
|
5000
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${S(Ni, 14)}</button>
|
|
5001
|
+
</div>` : g}
|
|
4882
5002
|
${this.renderReactions(t)}
|
|
4883
5003
|
</div>
|
|
4884
5004
|
`;
|
|
@@ -4899,7 +5019,7 @@ let P = class extends A {
|
|
|
4899
5019
|
|
|
4900
5020
|
${this.renderTypingIndicator(n.id)}
|
|
4901
5021
|
|
|
4902
|
-
${this.replyingTo === n.id ?
|
|
5022
|
+
${this.replyingTo === n.id ? p`
|
|
4903
5023
|
<form
|
|
4904
5024
|
class="reply-form"
|
|
4905
5025
|
@submit=${(t) => this.handleReply(n.id, t)}
|
|
@@ -4918,22 +5038,22 @@ let P = class extends A {
|
|
|
4918
5038
|
class="reply-media-btn"
|
|
4919
5039
|
title="Attach image"
|
|
4920
5040
|
@click=${() => this.handleAttachImage()}
|
|
4921
|
-
>${
|
|
5041
|
+
>${S(zi, 16)}</button>
|
|
4922
5042
|
<button
|
|
4923
5043
|
type="button"
|
|
4924
5044
|
class="reply-media-btn"
|
|
4925
5045
|
title="Record audio"
|
|
4926
5046
|
@click=${() => this.handleRecordAudio(n.id)}
|
|
4927
|
-
>${
|
|
5047
|
+
>${S(Ui, 16)}</button>
|
|
4928
5048
|
<button
|
|
4929
5049
|
type="button"
|
|
4930
5050
|
class="reply-media-btn"
|
|
4931
5051
|
title="Record video"
|
|
4932
5052
|
@click=${() => this.handleRecordVideo(n.id)}
|
|
4933
|
-
>${
|
|
5053
|
+
>${S(Fi, 16)}</button>
|
|
4934
5054
|
<div class="reply-preview">
|
|
4935
5055
|
${this.replyAttachmentIds.map(
|
|
4936
|
-
(t, i) =>
|
|
5056
|
+
(t, i) => p`<span class="reply-preview-badge">
|
|
4937
5057
|
Attached #${i + 1}
|
|
4938
5058
|
<button
|
|
4939
5059
|
type="button"
|
|
@@ -4945,16 +5065,16 @@ let P = class extends A {
|
|
|
4945
5065
|
</div>
|
|
4946
5066
|
</div>
|
|
4947
5067
|
</form>
|
|
4948
|
-
` :
|
|
5068
|
+
` : g}
|
|
4949
5069
|
</div>
|
|
4950
5070
|
`;
|
|
4951
5071
|
}
|
|
4952
5072
|
};
|
|
4953
|
-
|
|
5073
|
+
I.styles = [
|
|
4954
5074
|
ie,
|
|
4955
5075
|
be,
|
|
4956
5076
|
Pe,
|
|
4957
|
-
|
|
5077
|
+
O`
|
|
4958
5078
|
:host {
|
|
4959
5079
|
display: block;
|
|
4960
5080
|
}
|
|
@@ -5494,56 +5614,56 @@ P.styles = [
|
|
|
5494
5614
|
}
|
|
5495
5615
|
`
|
|
5496
5616
|
];
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
],
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
],
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
],
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
],
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
],
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
],
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
],
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
],
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
],
|
|
5525
|
-
|
|
5617
|
+
I.MAX_ATTACHMENTS = 5;
|
|
5618
|
+
z([
|
|
5619
|
+
w({ attribute: !1 })
|
|
5620
|
+
], I.prototype, "client", 2);
|
|
5621
|
+
z([
|
|
5622
|
+
w()
|
|
5623
|
+
], I.prototype, "highlightThreadId", 2);
|
|
5624
|
+
z([
|
|
5625
|
+
k()
|
|
5626
|
+
], I.prototype, "threadsVersion", 2);
|
|
5627
|
+
z([
|
|
5628
|
+
k()
|
|
5629
|
+
], I.prototype, "replyingTo", 2);
|
|
5630
|
+
z([
|
|
5631
|
+
k()
|
|
5632
|
+
], I.prototype, "editingCommentId", 2);
|
|
5633
|
+
z([
|
|
5634
|
+
k()
|
|
5635
|
+
], I.prototype, "editBody", 2);
|
|
5636
|
+
z([
|
|
5637
|
+
k()
|
|
5638
|
+
], I.prototype, "pickerOpenForComment", 2);
|
|
5639
|
+
z([
|
|
5640
|
+
k()
|
|
5641
|
+
], I.prototype, "typingByThread", 2);
|
|
5642
|
+
z([
|
|
5643
|
+
k()
|
|
5644
|
+
], I.prototype, "reactionsVersion", 2);
|
|
5645
|
+
I = z([
|
|
5526
5646
|
L("pulse-widget-comments-panel")
|
|
5527
|
-
],
|
|
5528
|
-
var
|
|
5529
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
5647
|
+
], I);
|
|
5648
|
+
var gs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, Ke = (n, e, t, i) => {
|
|
5649
|
+
for (var s = i > 1 ? void 0 : i ? vs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
5530
5650
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
5531
|
-
return i && s &&
|
|
5651
|
+
return i && s && gs(e, t, s), s;
|
|
5532
5652
|
};
|
|
5533
|
-
const
|
|
5653
|
+
const bs = {
|
|
5534
5654
|
"comment:created": "left a comment",
|
|
5535
5655
|
"comment:mention": "mentioned you",
|
|
5536
5656
|
"comment:reply": "replied to your comment",
|
|
5537
5657
|
"thread:resolved": "resolved a thread",
|
|
5538
5658
|
"reaction:added": "reacted to your comment"
|
|
5539
|
-
},
|
|
5659
|
+
}, xs = {
|
|
5540
5660
|
"comment:created": "💬",
|
|
5541
5661
|
"comment:mention": "📣",
|
|
5542
5662
|
"comment:reply": "↩️",
|
|
5543
5663
|
"thread:resolved": "✅",
|
|
5544
5664
|
"reaction:added": "🎉"
|
|
5545
5665
|
};
|
|
5546
|
-
let pe = class extends
|
|
5666
|
+
let pe = class extends _ {
|
|
5547
5667
|
constructor() {
|
|
5548
5668
|
super(...arguments), this.notifications = [];
|
|
5549
5669
|
}
|
|
@@ -5587,38 +5707,38 @@ let pe = class extends A {
|
|
|
5587
5707
|
}
|
|
5588
5708
|
render() {
|
|
5589
5709
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
5590
|
-
return
|
|
5710
|
+
return p`
|
|
5591
5711
|
<div class="panel">
|
|
5592
5712
|
<div class="panel-header">
|
|
5593
5713
|
<span class="panel-title">
|
|
5594
5714
|
Notifications
|
|
5595
|
-
${n > 0 ?
|
|
5715
|
+
${n > 0 ? p`<span class="unread-badge">${n}</span>` : g}
|
|
5596
5716
|
</span>
|
|
5597
5717
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5598
|
-
${n > 0 ?
|
|
5718
|
+
${n > 0 ? p`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5599
5719
|
Mark all read
|
|
5600
|
-
</button>` :
|
|
5720
|
+
</button>` : g}
|
|
5601
5721
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5602
|
-
${
|
|
5722
|
+
${S(ve, 16)}
|
|
5603
5723
|
</button>
|
|
5604
5724
|
</div>
|
|
5605
5725
|
</div>
|
|
5606
5726
|
|
|
5607
5727
|
<div class="panel-body pw-scrollable">
|
|
5608
|
-
${this.notifications.length === 0 ?
|
|
5728
|
+
${this.notifications.length === 0 ? p`<div class="empty">
|
|
5609
5729
|
<div class="empty-icon">🔔</div>
|
|
5610
5730
|
No notifications
|
|
5611
5731
|
</div>` : this.notifications.map(
|
|
5612
|
-
(e) =>
|
|
5732
|
+
(e) => p`
|
|
5613
5733
|
<div
|
|
5614
5734
|
class="item ${e.read ? "" : "unread"}"
|
|
5615
5735
|
@click=${() => this.handleClick(e)}
|
|
5616
5736
|
>
|
|
5617
|
-
<span class="icon">${
|
|
5737
|
+
<span class="icon">${xs[e.type] ?? "🔔"}</span>
|
|
5618
5738
|
<div class="content">
|
|
5619
5739
|
<div class="text">
|
|
5620
5740
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
5621
|
-
${
|
|
5741
|
+
${bs[e.type] ?? e.type}
|
|
5622
5742
|
</div>
|
|
5623
5743
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
5624
5744
|
</div>
|
|
@@ -5635,7 +5755,7 @@ pe.styles = [
|
|
|
5635
5755
|
ie,
|
|
5636
5756
|
be,
|
|
5637
5757
|
Pe,
|
|
5638
|
-
|
|
5758
|
+
O`
|
|
5639
5759
|
:host {
|
|
5640
5760
|
display: block;
|
|
5641
5761
|
}
|
|
@@ -5828,17 +5948,17 @@ pe.styles = [
|
|
|
5828
5948
|
}
|
|
5829
5949
|
`
|
|
5830
5950
|
];
|
|
5831
|
-
|
|
5832
|
-
|
|
5951
|
+
Ke([
|
|
5952
|
+
w({ attribute: !1 })
|
|
5833
5953
|
], pe.prototype, "client", 2);
|
|
5834
|
-
|
|
5835
|
-
|
|
5954
|
+
Ke([
|
|
5955
|
+
k()
|
|
5836
5956
|
], pe.prototype, "notifications", 2);
|
|
5837
|
-
pe =
|
|
5957
|
+
pe = Ke([
|
|
5838
5958
|
L("pulse-widget-notifications-panel")
|
|
5839
5959
|
], pe);
|
|
5840
|
-
const
|
|
5841
|
-
class
|
|
5960
|
+
const ys = 3e3;
|
|
5961
|
+
class ws {
|
|
5842
5962
|
constructor(e) {
|
|
5843
5963
|
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) => {
|
|
5844
5964
|
t.pointerType !== "touch" && this.client.moveCursor({
|
|
@@ -5890,7 +6010,7 @@ class bs {
|
|
|
5890
6010
|
), this.setSending(!0), this.staleTimer = setInterval(() => {
|
|
5891
6011
|
const e = Date.now();
|
|
5892
6012
|
for (const [t, i] of this.cursorLastSeen)
|
|
5893
|
-
if (e - i >
|
|
6013
|
+
if (e - i > ys) {
|
|
5894
6014
|
this.cursors.delete(t);
|
|
5895
6015
|
const s = this.cursorEls.get(t);
|
|
5896
6016
|
s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
|
|
@@ -5986,7 +6106,7 @@ class bs {
|
|
|
5986
6106
|
i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
|
|
5987
6107
|
}
|
|
5988
6108
|
}
|
|
5989
|
-
class
|
|
6109
|
+
class $s {
|
|
5990
6110
|
constructor(e) {
|
|
5991
6111
|
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) => {
|
|
5992
6112
|
var a, l, d;
|
|
@@ -6069,9 +6189,9 @@ class xs {
|
|
|
6069
6189
|
this.fadeTimers.set(e, t);
|
|
6070
6190
|
}
|
|
6071
6191
|
}
|
|
6072
|
-
function
|
|
6192
|
+
function ks(n) {
|
|
6073
6193
|
if (!n.rangeCount || n.isCollapsed) return null;
|
|
6074
|
-
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s =
|
|
6194
|
+
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = yt(t), o = yt(i);
|
|
6075
6195
|
return !s || !o ? null : {
|
|
6076
6196
|
startSelector: s,
|
|
6077
6197
|
startOffset: e.startOffset,
|
|
@@ -6079,10 +6199,10 @@ function ys(n) {
|
|
|
6079
6199
|
endOffset: e.endOffset
|
|
6080
6200
|
};
|
|
6081
6201
|
}
|
|
6082
|
-
function
|
|
6202
|
+
function Es(n) {
|
|
6083
6203
|
var e, t;
|
|
6084
6204
|
try {
|
|
6085
|
-
const i =
|
|
6205
|
+
const i = $t(n.startSelector), s = $t(n.endSelector);
|
|
6086
6206
|
if (!i || !s) return null;
|
|
6087
6207
|
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;
|
|
6088
6208
|
return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
|
|
@@ -6090,18 +6210,18 @@ function ws(n) {
|
|
|
6090
6210
|
return null;
|
|
6091
6211
|
}
|
|
6092
6212
|
}
|
|
6093
|
-
function
|
|
6213
|
+
function yt(n) {
|
|
6094
6214
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
6095
6215
|
const e = n.parentElement;
|
|
6096
6216
|
if (!e) return null;
|
|
6097
|
-
const t =
|
|
6217
|
+
const t = wt(e);
|
|
6098
6218
|
if (!t) return null;
|
|
6099
6219
|
const i = Array.from(e.childNodes).indexOf(n);
|
|
6100
6220
|
return `${t}::text(${i})`;
|
|
6101
6221
|
}
|
|
6102
|
-
return n.nodeType === Node.ELEMENT_NODE ?
|
|
6222
|
+
return n.nodeType === Node.ELEMENT_NODE ? wt(n) : null;
|
|
6103
6223
|
}
|
|
6104
|
-
function
|
|
6224
|
+
function wt(n) {
|
|
6105
6225
|
if (!n || n === document.documentElement) return "html";
|
|
6106
6226
|
if (n === document.body) return "body";
|
|
6107
6227
|
if (n.id) return `#${CSS.escape(n.id)}`;
|
|
@@ -6127,7 +6247,7 @@ function yt(n) {
|
|
|
6127
6247
|
}
|
|
6128
6248
|
return e.length > 0 ? e.join(" > ") : null;
|
|
6129
6249
|
}
|
|
6130
|
-
function
|
|
6250
|
+
function $t(n) {
|
|
6131
6251
|
const e = n.match(/^(.+)::text\((\d+)\)$/);
|
|
6132
6252
|
if (e) {
|
|
6133
6253
|
const t = e[1], i = parseInt(e[2], 10);
|
|
@@ -6144,7 +6264,7 @@ function wt(n) {
|
|
|
6144
6264
|
return null;
|
|
6145
6265
|
}
|
|
6146
6266
|
}
|
|
6147
|
-
class
|
|
6267
|
+
class Cs {
|
|
6148
6268
|
constructor(e) {
|
|
6149
6269
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
6150
6270
|
}
|
|
@@ -6188,7 +6308,7 @@ class $s {
|
|
|
6188
6308
|
if (!this.container) return;
|
|
6189
6309
|
const i = (a = this.client.state.user) == null ? void 0 : a.id;
|
|
6190
6310
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
6191
|
-
const s =
|
|
6311
|
+
const s = Es(t);
|
|
6192
6312
|
if (!s) return;
|
|
6193
6313
|
const o = this.client.state.presence.find(
|
|
6194
6314
|
(l) => l.user.id === e
|
|
@@ -6196,8 +6316,8 @@ class $s {
|
|
|
6196
6316
|
try {
|
|
6197
6317
|
const l = s.getClientRects(), d = [];
|
|
6198
6318
|
for (let c = 0; c < l.length; c++) {
|
|
6199
|
-
const h = l[c],
|
|
6200
|
-
Object.assign(
|
|
6319
|
+
const h = l[c], u = document.createElement("div");
|
|
6320
|
+
Object.assign(u.style, {
|
|
6201
6321
|
position: "absolute",
|
|
6202
6322
|
left: `${h.left}px`,
|
|
6203
6323
|
top: `${h.top}px`,
|
|
@@ -6207,7 +6327,7 @@ class $s {
|
|
|
6207
6327
|
opacity: "0.2",
|
|
6208
6328
|
borderRadius: "2px",
|
|
6209
6329
|
pointerEvents: "none"
|
|
6210
|
-
}), this.container.appendChild(
|
|
6330
|
+
}), this.container.appendChild(u), d.push(u);
|
|
6211
6331
|
}
|
|
6212
6332
|
this.selectionEls.set(e, d);
|
|
6213
6333
|
} catch {
|
|
@@ -6227,12 +6347,12 @@ class $s {
|
|
|
6227
6347
|
}
|
|
6228
6348
|
}
|
|
6229
6349
|
}
|
|
6230
|
-
var
|
|
6231
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6350
|
+
var Ts = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, Ge = (n, e, t, i) => {
|
|
6351
|
+
for (var s = i > 1 ? void 0 : i ? Ss(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6232
6352
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6233
|
-
return i && s &&
|
|
6353
|
+
return i && s && Ts(e, t, s), s;
|
|
6234
6354
|
};
|
|
6235
|
-
let ue = class extends
|
|
6355
|
+
let ue = class extends _ {
|
|
6236
6356
|
constructor() {
|
|
6237
6357
|
super(...arguments), this.roomId = "";
|
|
6238
6358
|
}
|
|
@@ -6252,7 +6372,7 @@ let ue = class extends A {
|
|
|
6252
6372
|
);
|
|
6253
6373
|
}
|
|
6254
6374
|
renderToggle(n, e) {
|
|
6255
|
-
return
|
|
6375
|
+
return p`
|
|
6256
6376
|
<div class="setting-row">
|
|
6257
6377
|
<span class="setting-label">${n}</span>
|
|
6258
6378
|
<label class="toggle">
|
|
@@ -6268,12 +6388,12 @@ let ue = class extends A {
|
|
|
6268
6388
|
}
|
|
6269
6389
|
render() {
|
|
6270
6390
|
const n = !this.settings.enabled;
|
|
6271
|
-
return
|
|
6391
|
+
return p`
|
|
6272
6392
|
<div class="panel">
|
|
6273
6393
|
<div class="panel-header">
|
|
6274
6394
|
<span class="panel-title">Settings</span>
|
|
6275
6395
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
6276
|
-
${
|
|
6396
|
+
${S(ve, 16)}
|
|
6277
6397
|
</button>
|
|
6278
6398
|
</div>
|
|
6279
6399
|
|
|
@@ -6322,7 +6442,7 @@ ue.styles = [
|
|
|
6322
6442
|
ie,
|
|
6323
6443
|
be,
|
|
6324
6444
|
Pe,
|
|
6325
|
-
|
|
6445
|
+
O`
|
|
6326
6446
|
:host {
|
|
6327
6447
|
display: block;
|
|
6328
6448
|
}
|
|
@@ -6493,13 +6613,13 @@ ue.styles = [
|
|
|
6493
6613
|
}
|
|
6494
6614
|
`
|
|
6495
6615
|
];
|
|
6496
|
-
|
|
6497
|
-
|
|
6616
|
+
Ge([
|
|
6617
|
+
w({ attribute: !1 })
|
|
6498
6618
|
], ue.prototype, "settings", 2);
|
|
6499
|
-
|
|
6500
|
-
|
|
6619
|
+
Ge([
|
|
6620
|
+
w()
|
|
6501
6621
|
], ue.prototype, "roomId", 2);
|
|
6502
|
-
ue =
|
|
6622
|
+
ue = Ge([
|
|
6503
6623
|
L("pulse-widget-settings-panel")
|
|
6504
6624
|
], ue);
|
|
6505
6625
|
const $e = {
|
|
@@ -6513,26 +6633,26 @@ const $e = {
|
|
|
6513
6633
|
showViewportIndicators: !0,
|
|
6514
6634
|
showSelections: !0,
|
|
6515
6635
|
showDrawings: !0
|
|
6516
|
-
},
|
|
6517
|
-
function
|
|
6636
|
+
}, Rt = "pulse:settings:";
|
|
6637
|
+
function As(n) {
|
|
6518
6638
|
try {
|
|
6519
|
-
const e = localStorage.getItem(`${
|
|
6639
|
+
const e = localStorage.getItem(`${Rt}${n}`);
|
|
6520
6640
|
return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
|
|
6521
6641
|
} catch {
|
|
6522
6642
|
return { ...$e };
|
|
6523
6643
|
}
|
|
6524
6644
|
}
|
|
6525
|
-
function
|
|
6526
|
-
localStorage.setItem(`${
|
|
6645
|
+
function Ps(n, e) {
|
|
6646
|
+
localStorage.setItem(`${Rt}${n}`, JSON.stringify(e));
|
|
6527
6647
|
}
|
|
6528
|
-
var
|
|
6529
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6648
|
+
var _s = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
|
|
6649
|
+
for (var s = i > 1 ? void 0 : i ? Is(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6530
6650
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6531
|
-
return i && s &&
|
|
6651
|
+
return i && s && _s(e, t, s), s;
|
|
6532
6652
|
};
|
|
6533
|
-
let
|
|
6653
|
+
let M = class extends _ {
|
|
6534
6654
|
constructor() {
|
|
6535
|
-
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;
|
|
6655
|
+
super(...arguments), this.collapsed = !1, this.activePanel = null, this.pinModeActive = !1, this.featuresDisabled = !1, this.drawModeActive = !1, this.followingUserId = null, this.display = "floating", this.envConfig = { ...Mt }, this.users = [], this.unreadCount = 0;
|
|
6536
6656
|
}
|
|
6537
6657
|
connectedCallback() {
|
|
6538
6658
|
super.connectedCallback(), this.setupPresence();
|
|
@@ -6583,35 +6703,35 @@ let R = class extends A {
|
|
|
6583
6703
|
render() {
|
|
6584
6704
|
const n = this.display === "inline";
|
|
6585
6705
|
if (this.collapsed)
|
|
6586
|
-
return
|
|
6706
|
+
return p`
|
|
6587
6707
|
<div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6588
|
-
<span class="fab-icon">${
|
|
6708
|
+
<span class="fab-icon">${S(qi, n ? 18 : 24)}</span>
|
|
6589
6709
|
</div>
|
|
6590
6710
|
`;
|
|
6591
6711
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
6592
|
-
return
|
|
6712
|
+
return p`
|
|
6593
6713
|
<div class="toolbar ${n ? "inline" : ""}"
|
|
6594
6714
|
<!-- Presence avatars -->
|
|
6595
|
-
${this.users.length > 0 ?
|
|
6715
|
+
${this.users.length > 0 && this.envConfig.showPresence ? p`
|
|
6596
6716
|
<div class="presence">
|
|
6597
|
-
${t > 0 ?
|
|
6717
|
+
${t > 0 ? p`<div class="presence-overflow">+${t}</div>` : g}
|
|
6598
6718
|
${e.map(
|
|
6599
|
-
(i) =>
|
|
6719
|
+
(i) => p`
|
|
6600
6720
|
<div
|
|
6601
6721
|
class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
|
|
6602
6722
|
style="background:${i.user.color}"
|
|
6603
6723
|
@click=${() => this.fireFollow(i.user.id)}
|
|
6604
6724
|
title="Click to follow ${i.user.name}"
|
|
6605
6725
|
>
|
|
6606
|
-
${i.user.avatar ?
|
|
6726
|
+
${i.user.avatar ? p`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6607
6727
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6608
|
-
${i.deviceType && i.deviceType !== "desktop" ?
|
|
6728
|
+
${i.deviceType && i.deviceType !== "desktop" ? p`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : g}
|
|
6609
6729
|
</div>
|
|
6610
6730
|
`
|
|
6611
6731
|
)}
|
|
6612
6732
|
</div>
|
|
6613
6733
|
<div class="separator"></div>
|
|
6614
|
-
` :
|
|
6734
|
+
` : g}
|
|
6615
6735
|
|
|
6616
6736
|
<!-- Pin comment (primary) -->
|
|
6617
6737
|
<button
|
|
@@ -6621,7 +6741,7 @@ let R = class extends A {
|
|
|
6621
6741
|
?disabled=${this.featuresDisabled}
|
|
6622
6742
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6623
6743
|
>
|
|
6624
|
-
${
|
|
6744
|
+
${S(Ot)}
|
|
6625
6745
|
</button>
|
|
6626
6746
|
|
|
6627
6747
|
<!-- View comments -->
|
|
@@ -6632,7 +6752,7 @@ let R = class extends A {
|
|
|
6632
6752
|
?disabled=${this.featuresDisabled}
|
|
6633
6753
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6634
6754
|
>
|
|
6635
|
-
${
|
|
6755
|
+
${S(ji)}
|
|
6636
6756
|
</button>
|
|
6637
6757
|
|
|
6638
6758
|
<!-- Activity feed -->
|
|
@@ -6643,19 +6763,21 @@ let R = class extends A {
|
|
|
6643
6763
|
?disabled=${this.featuresDisabled}
|
|
6644
6764
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6645
6765
|
>
|
|
6646
|
-
${
|
|
6766
|
+
${S(Li)}
|
|
6647
6767
|
</button>
|
|
6648
6768
|
|
|
6649
6769
|
<!-- Draw mode -->
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6770
|
+
${this.envConfig.allowDrawing ? p`
|
|
6771
|
+
<button
|
|
6772
|
+
class="pw-btn pw-btn-icon ${this.drawModeActive ? "active" : ""}"
|
|
6773
|
+
@click=${() => this.fire("draw-mode")}
|
|
6774
|
+
title="Draw on page"
|
|
6775
|
+
?disabled=${this.featuresDisabled}
|
|
6776
|
+
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6777
|
+
>
|
|
6778
|
+
${S(Di)}
|
|
6779
|
+
</button>
|
|
6780
|
+
` : g}
|
|
6659
6781
|
|
|
6660
6782
|
<!-- Notifications -->
|
|
6661
6783
|
<button
|
|
@@ -6665,8 +6787,8 @@ let R = class extends A {
|
|
|
6665
6787
|
?disabled=${this.featuresDisabled}
|
|
6666
6788
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6667
6789
|
>
|
|
6668
|
-
${
|
|
6669
|
-
${this.unreadCount > 0 ?
|
|
6790
|
+
${S(Ri)}
|
|
6791
|
+
${this.unreadCount > 0 ? p`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : g}
|
|
6670
6792
|
</button>
|
|
6671
6793
|
|
|
6672
6794
|
<!-- Settings -->
|
|
@@ -6675,7 +6797,7 @@ let R = class extends A {
|
|
|
6675
6797
|
@click=${() => this.fire("settings")}
|
|
6676
6798
|
title="Settings"
|
|
6677
6799
|
>
|
|
6678
|
-
${
|
|
6800
|
+
${S(Bi)}
|
|
6679
6801
|
</button>
|
|
6680
6802
|
|
|
6681
6803
|
<div class="separator"></div>
|
|
@@ -6686,16 +6808,16 @@ let R = class extends A {
|
|
|
6686
6808
|
@click=${this.fireToggle}
|
|
6687
6809
|
title="Collapse"
|
|
6688
6810
|
>
|
|
6689
|
-
${
|
|
6811
|
+
${S(ve, 14)}
|
|
6690
6812
|
</button>
|
|
6691
6813
|
</div>
|
|
6692
6814
|
`;
|
|
6693
6815
|
}
|
|
6694
6816
|
};
|
|
6695
|
-
|
|
6817
|
+
M.styles = [
|
|
6696
6818
|
ie,
|
|
6697
6819
|
be,
|
|
6698
|
-
|
|
6820
|
+
O`
|
|
6699
6821
|
:host {
|
|
6700
6822
|
display: block;
|
|
6701
6823
|
}
|
|
@@ -6908,39 +7030,42 @@ R.styles = [
|
|
|
6908
7030
|
`
|
|
6909
7031
|
];
|
|
6910
7032
|
j([
|
|
6911
|
-
|
|
6912
|
-
],
|
|
7033
|
+
w({ attribute: !1 })
|
|
7034
|
+
], M.prototype, "client", 2);
|
|
6913
7035
|
j([
|
|
6914
|
-
|
|
6915
|
-
],
|
|
7036
|
+
w({ type: Boolean })
|
|
7037
|
+
], M.prototype, "collapsed", 2);
|
|
6916
7038
|
j([
|
|
6917
|
-
|
|
6918
|
-
],
|
|
7039
|
+
w()
|
|
7040
|
+
], M.prototype, "activePanel", 2);
|
|
6919
7041
|
j([
|
|
6920
|
-
|
|
6921
|
-
],
|
|
7042
|
+
w({ type: Boolean })
|
|
7043
|
+
], M.prototype, "pinModeActive", 2);
|
|
6922
7044
|
j([
|
|
6923
|
-
|
|
6924
|
-
],
|
|
7045
|
+
w({ type: Boolean })
|
|
7046
|
+
], M.prototype, "featuresDisabled", 2);
|
|
6925
7047
|
j([
|
|
6926
|
-
|
|
6927
|
-
],
|
|
7048
|
+
w({ type: Boolean })
|
|
7049
|
+
], M.prototype, "drawModeActive", 2);
|
|
6928
7050
|
j([
|
|
6929
|
-
|
|
6930
|
-
],
|
|
7051
|
+
w()
|
|
7052
|
+
], M.prototype, "followingUserId", 2);
|
|
6931
7053
|
j([
|
|
6932
|
-
|
|
6933
|
-
],
|
|
7054
|
+
w()
|
|
7055
|
+
], M.prototype, "display", 2);
|
|
6934
7056
|
j([
|
|
6935
|
-
|
|
6936
|
-
],
|
|
7057
|
+
w({ attribute: !1 })
|
|
7058
|
+
], M.prototype, "envConfig", 2);
|
|
6937
7059
|
j([
|
|
6938
|
-
|
|
6939
|
-
],
|
|
6940
|
-
|
|
7060
|
+
k()
|
|
7061
|
+
], M.prototype, "users", 2);
|
|
7062
|
+
j([
|
|
7063
|
+
k()
|
|
7064
|
+
], M.prototype, "unreadCount", 2);
|
|
7065
|
+
M = j([
|
|
6941
7066
|
L("pulse-widget-toolbar")
|
|
6942
|
-
],
|
|
6943
|
-
class
|
|
7067
|
+
], M);
|
|
7068
|
+
class Ms {
|
|
6944
7069
|
constructor(e) {
|
|
6945
7070
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
6946
7071
|
}
|
|
@@ -6981,23 +7106,23 @@ class Ps {
|
|
|
6981
7106
|
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();
|
|
6982
7107
|
for (const [a, l] of this.client.state.viewports) {
|
|
6983
7108
|
if (a === s) continue;
|
|
6984
|
-
const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e,
|
|
6985
|
-
if (d >= h && c <=
|
|
6986
|
-
const
|
|
6987
|
-
|
|
7109
|
+
const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, u = e + t;
|
|
7110
|
+
if (d >= h && c <= u) {
|
|
7111
|
+
const $ = this.pillEls.get(a);
|
|
7112
|
+
$ && ($.style.display = "none");
|
|
6988
7113
|
continue;
|
|
6989
7114
|
}
|
|
6990
7115
|
o.add(a);
|
|
6991
|
-
const
|
|
6992
|
-
(
|
|
7116
|
+
const f = this.client.state.presence.find(
|
|
7117
|
+
($) => $.user.id === a
|
|
6993
7118
|
);
|
|
6994
|
-
if (!
|
|
6995
|
-
const
|
|
7119
|
+
if (!f) continue;
|
|
7120
|
+
const b = l.scrollY + l.viewportHeight / 2, x = i > 0 ? b / i : 0, y = Math.max(
|
|
6996
7121
|
8,
|
|
6997
|
-
Math.min(t - 28,
|
|
7122
|
+
Math.min(t - 28, x * t)
|
|
6998
7123
|
);
|
|
6999
|
-
let
|
|
7000
|
-
|
|
7124
|
+
let v = this.pillEls.get(a);
|
|
7125
|
+
v || (v = document.createElement("div"), Object.assign(v.style, {
|
|
7001
7126
|
position: "absolute",
|
|
7002
7127
|
right: "8px",
|
|
7003
7128
|
padding: "2px 6px",
|
|
@@ -7009,7 +7134,7 @@ class Ps {
|
|
|
7009
7134
|
whiteSpace: "nowrap",
|
|
7010
7135
|
pointerEvents: "none",
|
|
7011
7136
|
transition: "top 0.3s ease"
|
|
7012
|
-
}), this.container.appendChild(
|
|
7137
|
+
}), this.container.appendChild(v), this.pillEls.set(a, v)), v.style.display = "", v.style.background = f.user.color, v.style.top = `${y}px`, v.textContent = this.getInitials(f.user.name);
|
|
7013
7138
|
}
|
|
7014
7139
|
for (const [a, l] of this.pillEls)
|
|
7015
7140
|
!o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
|
|
@@ -7018,14 +7143,14 @@ class Ps {
|
|
|
7018
7143
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
7019
7144
|
}
|
|
7020
7145
|
}
|
|
7021
|
-
var
|
|
7022
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
7146
|
+
var Os = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, P = (n, e, t, i) => {
|
|
7147
|
+
for (var s = i > 1 ? void 0 : i ? Rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
7023
7148
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
7024
|
-
return i && s &&
|
|
7149
|
+
return i && s && Os(e, t, s), s;
|
|
7025
7150
|
};
|
|
7026
|
-
let
|
|
7151
|
+
let C = class extends _ {
|
|
7027
7152
|
constructor() {
|
|
7028
|
-
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 = () => {
|
|
7153
|
+
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.envConfig = { ...Mt }, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
|
|
7029
7154
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
7030
7155
|
var n;
|
|
7031
7156
|
this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
|
|
@@ -7046,7 +7171,7 @@ let T = class extends A {
|
|
|
7046
7171
|
(t = this.client) == null || t.updateSelection(null);
|
|
7047
7172
|
return;
|
|
7048
7173
|
}
|
|
7049
|
-
const e =
|
|
7174
|
+
const e = ks(n);
|
|
7050
7175
|
(i = this.client) == null || i.updateSelection(e);
|
|
7051
7176
|
}, 500));
|
|
7052
7177
|
}, this.handleDocumentClick = (n) => {
|
|
@@ -7078,11 +7203,16 @@ let T = class extends A {
|
|
|
7078
7203
|
room: this.room,
|
|
7079
7204
|
endpoint: this.endpoint
|
|
7080
7205
|
};
|
|
7081
|
-
this.client = new
|
|
7206
|
+
this.client = new Ct(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new ws(this.client), this.commentPins = new ps(this.client, {
|
|
7082
7207
|
onPinModeExit: () => {
|
|
7083
7208
|
this.pinModeActive = !1;
|
|
7084
7209
|
}
|
|
7085
|
-
}), this.viewportOverlay = new
|
|
7210
|
+
}), this.viewportOverlay = new Ms(this.client), this.selectionOverlay = new Cs(this.client), this.drawingOverlay = new $s(this.client), this.settings = As(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
7211
|
+
this.client.state.on("auth", () => {
|
|
7212
|
+
var e, t;
|
|
7213
|
+
this.envConfig = this.client.state.config, this.envConfig.showCursors || (e = this.cursorOverlay) == null || e.disable(), !this.envConfig.allowDrawing && this.drawModeActive && ((t = this.drawingOverlay) == null || t.disableDrawMode(), this.drawModeActive = !1);
|
|
7214
|
+
})
|
|
7215
|
+
), this.unsubs.push(
|
|
7086
7216
|
this.client.on("connection", (e) => {
|
|
7087
7217
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
7088
7218
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -7140,6 +7270,7 @@ let T = class extends A {
|
|
|
7140
7270
|
this.pinModeActive = !this.pinModeActive, this.pinModeActive && ((o = this.commentPins) == null || o.enterPinMode());
|
|
7141
7271
|
break;
|
|
7142
7272
|
case "draw-mode":
|
|
7273
|
+
if (!this.envConfig.allowDrawing) break;
|
|
7143
7274
|
this.drawModeActive = !this.drawModeActive, this.drawModeActive && ((r = this.drawingOverlay) == null || r.enableDrawMode());
|
|
7144
7275
|
break;
|
|
7145
7276
|
}
|
|
@@ -7150,15 +7281,15 @@ let T = class extends A {
|
|
|
7150
7281
|
}
|
|
7151
7282
|
handleSettingsChange(n) {
|
|
7152
7283
|
const e = n.detail;
|
|
7153
|
-
this.settings = e,
|
|
7284
|
+
this.settings = e, Ps(this.room, e), this.applySettings(e);
|
|
7154
7285
|
}
|
|
7155
7286
|
applySettings(n) {
|
|
7156
|
-
var e, t, i, s, o, r, a, l, d, c, h,
|
|
7287
|
+
var e, t, i, s, o, r, a, l, d, c, h, u, f, b, x, y, v;
|
|
7157
7288
|
if (!n.enabled) {
|
|
7158
7289
|
(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;
|
|
7159
7290
|
return;
|
|
7160
7291
|
}
|
|
7161
|
-
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() : (
|
|
7292
|
+
this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (u = this.viewportOverlay) == null || u.disable(), n.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (b = this.selectionOverlay) == null || b.disable(), n.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((y = this.drawingOverlay) == null || y.disable(), this.drawModeActive && ((v = this.drawingOverlay) == null || v.disableDrawMode(), this.drawModeActive = !1));
|
|
7162
7293
|
}
|
|
7163
7294
|
applyCursorSettings(n) {
|
|
7164
7295
|
if (!this.cursorOverlay) return;
|
|
@@ -7172,22 +7303,22 @@ let T = class extends A {
|
|
|
7172
7303
|
* the trigger element, flipping vertically/horizontally as needed.
|
|
7173
7304
|
*/
|
|
7174
7305
|
positionPopups() {
|
|
7175
|
-
var
|
|
7176
|
-
const n = this.display === "inline", e = (
|
|
7306
|
+
var b, x, y, v;
|
|
7307
|
+
const n = this.display === "inline", e = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".inline-trigger"), t = (x = this.shadowRoot) == null ? void 0 : x.querySelector("pulse-widget-toolbar"), i = n ? e : t;
|
|
7177
7308
|
if (!i) return;
|
|
7178
|
-
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (
|
|
7309
|
+
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (y = this.shadowRoot) == null ? void 0 : y.querySelector(".toolbar-popover");
|
|
7179
7310
|
if (l) {
|
|
7180
7311
|
Object.assign(l.style, { top: "auto", left: "auto" });
|
|
7181
|
-
const
|
|
7182
|
-
l.style.top = `${
|
|
7312
|
+
const $ = l.getBoundingClientRect(), T = this.computePosition(s, $, o, r, a);
|
|
7313
|
+
l.style.top = `${T.top}px`, l.style.left = `${T.left}px`;
|
|
7183
7314
|
}
|
|
7184
|
-
const d = (
|
|
7315
|
+
const d = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".panel-container");
|
|
7185
7316
|
if (!d) return;
|
|
7186
7317
|
Object.assign(d.style, { top: "auto", left: "auto" });
|
|
7187
7318
|
const c = l ?? t;
|
|
7188
7319
|
if (!c) return;
|
|
7189
|
-
const h = c.getBoundingClientRect(),
|
|
7190
|
-
d.style.top = `${
|
|
7320
|
+
const h = c.getBoundingClientRect(), u = d.getBoundingClientRect(), f = this.computePosition(h, u, o, r, a);
|
|
7321
|
+
d.style.top = `${f.top}px`, d.style.left = `${f.left}px`;
|
|
7191
7322
|
}
|
|
7192
7323
|
computePosition(n, e, t, i, s) {
|
|
7193
7324
|
const o = n.top, r = i - n.bottom;
|
|
@@ -7206,13 +7337,13 @@ let T = class extends A {
|
|
|
7206
7337
|
return (n == null ? void 0 : n.user.name) ?? "user";
|
|
7207
7338
|
}
|
|
7208
7339
|
renderConnectionBanner() {
|
|
7209
|
-
return this.showConnectedFlash ?
|
|
7340
|
+
return this.showConnectedFlash ? p`<div class="connection-banner connected">
|
|
7210
7341
|
<span class="connection-dot"></span>Connected
|
|
7211
|
-
</div>` : this.connectionState === "connecting" ?
|
|
7342
|
+
</div>` : this.connectionState === "connecting" ? p`<div class="connection-banner connecting">
|
|
7212
7343
|
<span class="connection-dot"></span>Reconnecting...
|
|
7213
|
-
</div>` : this.connectionState === "disconnected" && this.client ?
|
|
7344
|
+
</div>` : this.connectionState === "disconnected" && this.client ? p`<div class="connection-banner disconnected">
|
|
7214
7345
|
<span class="connection-dot"></span>Disconnected
|
|
7215
|
-
</div>` :
|
|
7346
|
+
</div>` : g;
|
|
7216
7347
|
}
|
|
7217
7348
|
handleToolbarToggle() {
|
|
7218
7349
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -7220,38 +7351,38 @@ let T = class extends A {
|
|
|
7220
7351
|
render() {
|
|
7221
7352
|
const n = this.display === "inline";
|
|
7222
7353
|
if (n && this.collapsed)
|
|
7223
|
-
return
|
|
7354
|
+
return p`
|
|
7224
7355
|
<div class="widget-root">
|
|
7225
7356
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
7226
7357
|
<slot>Collaborate</slot>
|
|
7227
7358
|
</div>
|
|
7228
7359
|
</div>
|
|
7229
7360
|
`;
|
|
7230
|
-
const e = this.activePanel ?
|
|
7361
|
+
const e = this.activePanel ? p`
|
|
7231
7362
|
<div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
|
|
7232
|
-
${this.activePanel === "comments" ?
|
|
7363
|
+
${this.activePanel === "comments" ? p`<pulse-widget-comments-panel
|
|
7233
7364
|
.client=${this.client}
|
|
7234
7365
|
.highlightThreadId=${this.highlightThreadId}
|
|
7235
|
-
></pulse-widget-comments-panel>` :
|
|
7236
|
-
${this.activePanel === "settings" ?
|
|
7366
|
+
></pulse-widget-comments-panel>` : g}
|
|
7367
|
+
${this.activePanel === "settings" ? p`<pulse-widget-settings-panel
|
|
7237
7368
|
.settings=${this.settings}
|
|
7238
7369
|
.roomId=${this.room}
|
|
7239
7370
|
@settings-change=${this.handleSettingsChange}
|
|
7240
|
-
></pulse-widget-settings-panel>` :
|
|
7241
|
-
${this.activePanel === "notifications" ?
|
|
7371
|
+
></pulse-widget-settings-panel>` : g}
|
|
7372
|
+
${this.activePanel === "notifications" ? p`<pulse-widget-notifications-panel
|
|
7242
7373
|
.client=${this.client}
|
|
7243
|
-
></pulse-widget-notifications-panel>` :
|
|
7244
|
-
${this.activePanel === "activity" ?
|
|
7374
|
+
></pulse-widget-notifications-panel>` : g}
|
|
7375
|
+
${this.activePanel === "activity" ? p`<pulse-widget-activity-panel
|
|
7245
7376
|
.client=${this.client}
|
|
7246
|
-
></pulse-widget-activity-panel>` :
|
|
7377
|
+
></pulse-widget-activity-panel>` : g}
|
|
7247
7378
|
</div>
|
|
7248
|
-
` :
|
|
7379
|
+
` : g, t = this.followingUserId ? p`<div class="follow-banner">
|
|
7249
7380
|
Following ${this.getFollowUserName()}
|
|
7250
7381
|
<button @click=${() => {
|
|
7251
7382
|
this.followingUserId = null;
|
|
7252
7383
|
}}>Stop</button>
|
|
7253
|
-
</div>` :
|
|
7254
|
-
return n ?
|
|
7384
|
+
</div>` : g;
|
|
7385
|
+
return n ? p`
|
|
7255
7386
|
${t}
|
|
7256
7387
|
<div class="widget-root">
|
|
7257
7388
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
@@ -7268,6 +7399,7 @@ let T = class extends A {
|
|
|
7268
7399
|
.drawModeActive=${this.drawModeActive}
|
|
7269
7400
|
.followingUserId=${this.followingUserId}
|
|
7270
7401
|
.display=${this.display}
|
|
7402
|
+
.envConfig=${this.envConfig}
|
|
7271
7403
|
@toolbar-action=${this.handleToolbarAction}
|
|
7272
7404
|
@toolbar-toggle=${this.handleToolbarToggle}
|
|
7273
7405
|
@toolbar-follow=${this.handleFollow}
|
|
@@ -7275,7 +7407,7 @@ let T = class extends A {
|
|
|
7275
7407
|
</div>
|
|
7276
7408
|
${e}
|
|
7277
7409
|
</div>
|
|
7278
|
-
` :
|
|
7410
|
+
` : p`
|
|
7279
7411
|
${t}
|
|
7280
7412
|
<div class="widget-root">
|
|
7281
7413
|
${e}
|
|
@@ -7289,6 +7421,7 @@ let T = class extends A {
|
|
|
7289
7421
|
.drawModeActive=${this.drawModeActive}
|
|
7290
7422
|
.followingUserId=${this.followingUserId}
|
|
7291
7423
|
.display=${this.display}
|
|
7424
|
+
.envConfig=${this.envConfig}
|
|
7292
7425
|
@toolbar-action=${this.handleToolbarAction}
|
|
7293
7426
|
@toolbar-toggle=${this.handleToolbarToggle}
|
|
7294
7427
|
@toolbar-follow=${this.handleFollow}
|
|
@@ -7297,9 +7430,9 @@ let T = class extends A {
|
|
|
7297
7430
|
`;
|
|
7298
7431
|
}
|
|
7299
7432
|
};
|
|
7300
|
-
|
|
7433
|
+
C.styles = [
|
|
7301
7434
|
ie,
|
|
7302
|
-
|
|
7435
|
+
O`
|
|
7303
7436
|
:host {
|
|
7304
7437
|
display: block;
|
|
7305
7438
|
}
|
|
@@ -7475,60 +7608,63 @@ T.styles = [
|
|
|
7475
7608
|
}
|
|
7476
7609
|
`
|
|
7477
7610
|
];
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
],
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
],
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
],
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
],
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
],
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
],
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
],
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
],
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
],
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
],
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
],
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
],
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
],
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
],
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
],
|
|
7523
|
-
|
|
7611
|
+
P([
|
|
7612
|
+
w({ attribute: "api-key" })
|
|
7613
|
+
], C.prototype, "apiKey", 2);
|
|
7614
|
+
P([
|
|
7615
|
+
w()
|
|
7616
|
+
], C.prototype, "token", 2);
|
|
7617
|
+
P([
|
|
7618
|
+
w()
|
|
7619
|
+
], C.prototype, "room", 2);
|
|
7620
|
+
P([
|
|
7621
|
+
w()
|
|
7622
|
+
], C.prototype, "endpoint", 2);
|
|
7623
|
+
P([
|
|
7624
|
+
w({ reflect: !0 })
|
|
7625
|
+
], C.prototype, "position", 2);
|
|
7626
|
+
P([
|
|
7627
|
+
w({ reflect: !0 })
|
|
7628
|
+
], C.prototype, "display", 2);
|
|
7629
|
+
P([
|
|
7630
|
+
k()
|
|
7631
|
+
], C.prototype, "collapsed", 2);
|
|
7632
|
+
P([
|
|
7633
|
+
k()
|
|
7634
|
+
], C.prototype, "activePanel", 2);
|
|
7635
|
+
P([
|
|
7636
|
+
k()
|
|
7637
|
+
], C.prototype, "pinModeActive", 2);
|
|
7638
|
+
P([
|
|
7639
|
+
k()
|
|
7640
|
+
], C.prototype, "highlightThreadId", 2);
|
|
7641
|
+
P([
|
|
7642
|
+
k()
|
|
7643
|
+
], C.prototype, "settings", 2);
|
|
7644
|
+
P([
|
|
7645
|
+
k()
|
|
7646
|
+
], C.prototype, "followingUserId", 2);
|
|
7647
|
+
P([
|
|
7648
|
+
k()
|
|
7649
|
+
], C.prototype, "drawModeActive", 2);
|
|
7650
|
+
P([
|
|
7651
|
+
k()
|
|
7652
|
+
], C.prototype, "connectionState", 2);
|
|
7653
|
+
P([
|
|
7654
|
+
k()
|
|
7655
|
+
], C.prototype, "showConnectedFlash", 2);
|
|
7656
|
+
P([
|
|
7657
|
+
k()
|
|
7658
|
+
], C.prototype, "envConfig", 2);
|
|
7659
|
+
C = P([
|
|
7524
7660
|
L("pulse-widget")
|
|
7525
|
-
],
|
|
7661
|
+
], C);
|
|
7526
7662
|
export {
|
|
7527
7663
|
Y as PulseComments,
|
|
7528
7664
|
de as PulseCursors,
|
|
7529
7665
|
he as PulseNotifications,
|
|
7530
7666
|
Z as PulsePresence,
|
|
7531
7667
|
X as PulseProvider,
|
|
7532
|
-
|
|
7533
|
-
|
|
7668
|
+
B as PulseReactions,
|
|
7669
|
+
C as PulseWidget
|
|
7534
7670
|
};
|