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