@gamention/pulse-elements 0.1.7 → 0.1.9
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 +283 -203
- package/dist/pulse-elements.js +758 -637
- package/package.json +3 -3
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 vt = class extends Event {
|
|
7
7
|
constructor(e, t, i, n) {
|
|
8
8
|
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = n ?? !1;
|
|
9
9
|
}
|
|
@@ -35,7 +35,7 @@ let We = 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 vt(this.context, this.host, this.t, this.subscribe));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
@@ -43,7 +43,7 @@ let We = class {
|
|
|
43
43
|
* Copyright 2021 Google LLC
|
|
44
44
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
45
|
*/
|
|
46
|
-
let
|
|
46
|
+
let At = class {
|
|
47
47
|
get value() {
|
|
48
48
|
return this.o;
|
|
49
49
|
}
|
|
@@ -76,11 +76,11 @@ let Pt = class {
|
|
|
76
76
|
* Copyright 2021 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
let
|
|
79
|
+
let It = 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
|
+
}, Xe = class extends At {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
85
|
var n, o;
|
|
86
86
|
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
@@ -90,7 +90,7 @@ let At = class extends Event {
|
|
|
90
90
|
}, this.onProviderRequest = (r) => {
|
|
91
91
|
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
92
|
const l = /* @__PURE__ */ new Set();
|
|
93
|
-
for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new
|
|
93
|
+
for (const [a, { consumerHost: c }] of this.subscriptions) l.has(a) || (l.add(a), c.dispatchEvent(new vt(this.context, c, a, !0)));
|
|
94
94
|
r.stopPropagation();
|
|
95
95
|
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (n = this.host).addController) == null || o.call(n, this);
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ let At = 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 It(this.context, this.host));
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
@@ -114,11 +114,11 @@ function Mt({ context: s }) {
|
|
|
114
114
|
}, set(n) {
|
|
115
115
|
return i.get(this).setValue(n), e.set.call(this, n);
|
|
116
116
|
}, init(n) {
|
|
117
|
-
return i.set(this, new
|
|
117
|
+
return i.set(this, new Xe(this, { context: s, initialValue: n })), n;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
120
|
e.constructor.addInitializer(((r) => {
|
|
121
|
-
i.set(r, new
|
|
121
|
+
i.set(r, new Xe(r, { context: s }));
|
|
122
122
|
}));
|
|
123
123
|
const n = Object.getOwnPropertyDescriptor(e, t);
|
|
124
124
|
let o;
|
|
@@ -144,7 +144,7 @@ function Mt({ context: s }) {
|
|
|
144
144
|
* Copyright 2022 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
147
|
+
function pe({ context: s, subscribe: e }) {
|
|
148
148
|
return (t, i) => {
|
|
149
149
|
typeof i == "object" ? i.addInitializer((function() {
|
|
150
150
|
new We(this, { context: s, callback: (n) => {
|
|
@@ -157,9 +157,9 @@ function he({ context: s, subscribe: e }) {
|
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
const
|
|
162
|
-
let
|
|
160
|
+
var Ot = Object.defineProperty, Rt = (s, e, t) => e in s ? Ot(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, y = (s, e, t) => Rt(s, typeof e != "symbol" ? e + "" : e, t);
|
|
161
|
+
const Lt = "ws://localhost:4567";
|
|
162
|
+
let je = class {
|
|
163
163
|
constructor() {
|
|
164
164
|
y(this, "handlers", /* @__PURE__ */ new Map());
|
|
165
165
|
}
|
|
@@ -179,9 +179,9 @@ let Le = class {
|
|
|
179
179
|
removeAll() {
|
|
180
180
|
this.handlers.clear();
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, jt = class extends je {
|
|
183
183
|
constructor(e) {
|
|
184
|
-
super(), y(this, "ws", null), y(this, "endpoint"), y(this, "reconnectAttempt", 0), y(this, "reconnectTimer", null), y(this, "_state", "disconnected"), this.endpoint = e ??
|
|
184
|
+
super(), y(this, "ws", null), y(this, "endpoint"), y(this, "reconnectAttempt", 0), y(this, "reconnectTimer", null), y(this, "_state", "disconnected"), this.endpoint = e ?? Lt;
|
|
185
185
|
}
|
|
186
186
|
get state() {
|
|
187
187
|
return this._state;
|
|
@@ -216,7 +216,7 @@ let Le = class {
|
|
|
216
216
|
this.reconnectTimer = null, this.connect();
|
|
217
217
|
}, e);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, zt = class extends je {
|
|
220
220
|
constructor() {
|
|
221
221
|
super(...arguments), y(this, "_user", null), y(this, "_users", /* @__PURE__ */ new Map()), y(this, "_presence", /* @__PURE__ */ new Map()), y(this, "_threads", /* @__PURE__ */ new Map()), y(this, "_reactions", /* @__PURE__ */ new Map()), y(this, "_notifications", []), y(this, "_activityLogs", []), y(this, "_typing", /* @__PURE__ */ new Map()), y(this, "_viewports", /* @__PURE__ */ new Map()), y(this, "_selections", /* @__PURE__ */ new Map());
|
|
222
222
|
}
|
|
@@ -396,12 +396,12 @@ let Le = class {
|
|
|
396
396
|
reset() {
|
|
397
397
|
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();
|
|
398
398
|
}
|
|
399
|
-
},
|
|
399
|
+
}, xt = class extends je {
|
|
400
400
|
constructor(e) {
|
|
401
401
|
var t;
|
|
402
|
-
super(), y(this, "state"), y(this, "connection"), y(this, "config"), y(this, "heartbeatTimer", null), y(this, "lastCursorSend", 0), y(this, "pendingCursor", null), y(this, "cursorTimer", null), this.config = e, this.state = new
|
|
402
|
+
super(), y(this, "state"), y(this, "connection"), y(this, "config"), y(this, "heartbeatTimer", null), y(this, "lastCursorSend", 0), y(this, "pendingCursor", null), y(this, "cursorTimer", null), this.config = e, this.state = new zt();
|
|
403
403
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
404
|
-
this.connection = new
|
|
404
|
+
this.connection = new jt(i), this.connection.on("message", (n) => {
|
|
405
405
|
this.state.handleMessage(n), this.emit(n.type, n);
|
|
406
406
|
}), this.connection.on("state", (n) => {
|
|
407
407
|
this.emit("connection", n), n === "connected" ? (this.authenticate(), this.startHeartbeat()) : n === "disconnected" && this.stopHeartbeat();
|
|
@@ -458,12 +458,13 @@ let Le = class {
|
|
|
458
458
|
id: i,
|
|
459
459
|
body: e,
|
|
460
460
|
mentions: t.mentions ?? [],
|
|
461
|
-
position: t.position ?? null
|
|
461
|
+
position: t.position ?? null,
|
|
462
|
+
attachmentIds: t.attachmentIds
|
|
462
463
|
}), i;
|
|
463
464
|
}
|
|
464
|
-
reply(e, t, i = []) {
|
|
465
|
-
const
|
|
466
|
-
return this.send({ type: "comment:create", threadId: e, id:
|
|
465
|
+
reply(e, t, i = [], n) {
|
|
466
|
+
const o = crypto.randomUUID();
|
|
467
|
+
return this.send({ type: "comment:create", threadId: e, id: o, body: t, mentions: i, attachmentIds: n }), o;
|
|
467
468
|
}
|
|
468
469
|
editComment(e, t, i = []) {
|
|
469
470
|
this.send({ type: "comment:edit", commentId: e, body: t, mentions: i });
|
|
@@ -517,7 +518,7 @@ let Le = class {
|
|
|
517
518
|
}
|
|
518
519
|
// ── File Upload ──
|
|
519
520
|
async uploadFile(e) {
|
|
520
|
-
const t = this.config.endpoint ?? window.location.origin, i = new FormData();
|
|
521
|
+
const t = (this.config.endpoint ?? window.location.origin).replace(/^ws(s?):/, "http$1:"), i = new FormData();
|
|
521
522
|
i.append("file", e);
|
|
522
523
|
const n = await fetch(`${t}/api/v1/upload`, {
|
|
523
524
|
method: "POST",
|
|
@@ -543,18 +544,18 @@ let Le = class {
|
|
|
543
544
|
* Copyright 2019 Google LLC
|
|
544
545
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
545
546
|
*/
|
|
546
|
-
const
|
|
547
|
-
let
|
|
547
|
+
const ve = globalThis, ze = ve.ShadowRoot && (ve.ShadyCSS === void 0 || ve.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Ue = Symbol(), Ye = /* @__PURE__ */ new WeakMap();
|
|
548
|
+
let yt = class {
|
|
548
549
|
constructor(e, t, i) {
|
|
549
|
-
if (this._$cssResult$ = !0, i !==
|
|
550
|
+
if (this._$cssResult$ = !0, i !== Ue) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
550
551
|
this.cssText = e, this.t = t;
|
|
551
552
|
}
|
|
552
553
|
get styleSheet() {
|
|
553
554
|
let e = this.o;
|
|
554
555
|
const t = this.t;
|
|
555
|
-
if (
|
|
556
|
+
if (ze && e === void 0) {
|
|
556
557
|
const i = t !== void 0 && t.length === 1;
|
|
557
|
-
i && (e =
|
|
558
|
+
i && (e = Ye.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Ye.set(t, e));
|
|
558
559
|
}
|
|
559
560
|
return e;
|
|
560
561
|
}
|
|
@@ -562,30 +563,30 @@ let xt = class {
|
|
|
562
563
|
return this.cssText;
|
|
563
564
|
}
|
|
564
565
|
};
|
|
565
|
-
const
|
|
566
|
+
const Ut = (s) => new yt(typeof s == "string" ? s : s + "", void 0, Ue), I = (s, ...e) => {
|
|
566
567
|
const t = s.length === 1 ? s[0] : e.reduce((i, n, o) => i + ((r) => {
|
|
567
568
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
568
569
|
if (typeof r == "number") return r;
|
|
569
570
|
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.");
|
|
570
571
|
})(n) + s[o + 1], s[0]);
|
|
571
|
-
return new
|
|
572
|
-
},
|
|
573
|
-
if (
|
|
572
|
+
return new yt(t, s, Ue);
|
|
573
|
+
}, Dt = (s, e) => {
|
|
574
|
+
if (ze) s.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
574
575
|
else for (const t of e) {
|
|
575
|
-
const i = document.createElement("style"), n =
|
|
576
|
+
const i = document.createElement("style"), n = ve.litNonce;
|
|
576
577
|
n !== void 0 && i.setAttribute("nonce", n), i.textContent = t.cssText, s.appendChild(i);
|
|
577
578
|
}
|
|
578
|
-
},
|
|
579
|
+
}, Ke = ze ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((e) => {
|
|
579
580
|
let t = "";
|
|
580
581
|
for (const i of e.cssRules) t += i.cssText;
|
|
581
|
-
return
|
|
582
|
+
return Ut(t);
|
|
582
583
|
})(s) : s;
|
|
583
584
|
/**
|
|
584
585
|
* @license
|
|
585
586
|
* Copyright 2017 Google LLC
|
|
586
587
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
587
588
|
*/
|
|
588
|
-
const { is:
|
|
589
|
+
const { is: Ht, defineProperty: Bt, getOwnPropertyDescriptor: Nt, getOwnPropertyNames: Ft, getOwnPropertySymbols: qt, getPrototypeOf: Vt } = Object, U = globalThis, Ge = U.trustedTypes, Wt = Ge ? Ge.emptyScript : "", Te = U.reactiveElementPolyfillSupport, ie = (s, e) => s, we = { toAttribute(s, e) {
|
|
589
590
|
switch (e) {
|
|
590
591
|
case Boolean:
|
|
591
592
|
s = s ? Wt : null;
|
|
@@ -613,7 +614,7 @@ const { is: Dt, defineProperty: Ht, getOwnPropertyDescriptor: Nt, getOwnProperty
|
|
|
613
614
|
}
|
|
614
615
|
}
|
|
615
616
|
return t;
|
|
616
|
-
} },
|
|
617
|
+
} }, De = (s, e) => !Ht(s, e), Ze = { attribute: !0, type: String, converter: we, reflect: !1, useDefault: !1, hasChanged: De };
|
|
617
618
|
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), U.litPropertyMetadata ?? (U.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
618
619
|
let Y = class extends HTMLElement {
|
|
619
620
|
static addInitializer(e) {
|
|
@@ -622,10 +623,10 @@ let Y = class extends HTMLElement {
|
|
|
622
623
|
static get observedAttributes() {
|
|
623
624
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
624
625
|
}
|
|
625
|
-
static createProperty(e, t =
|
|
626
|
+
static createProperty(e, t = Ze) {
|
|
626
627
|
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) {
|
|
627
628
|
const i = Symbol(), n = this.getPropertyDescriptor(e, i, t);
|
|
628
|
-
n !== void 0 &&
|
|
629
|
+
n !== void 0 && Bt(this.prototype, e, n);
|
|
629
630
|
}
|
|
630
631
|
}
|
|
631
632
|
static getPropertyDescriptor(e, t, i) {
|
|
@@ -640,17 +641,17 @@ let Y = class extends HTMLElement {
|
|
|
640
641
|
}, configurable: !0, enumerable: !0 };
|
|
641
642
|
}
|
|
642
643
|
static getPropertyOptions(e) {
|
|
643
|
-
return this.elementProperties.get(e) ??
|
|
644
|
+
return this.elementProperties.get(e) ?? Ze;
|
|
644
645
|
}
|
|
645
646
|
static _$Ei() {
|
|
646
647
|
if (this.hasOwnProperty(ie("elementProperties"))) return;
|
|
647
|
-
const e =
|
|
648
|
+
const e = Vt(this);
|
|
648
649
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
649
650
|
}
|
|
650
651
|
static finalize() {
|
|
651
652
|
if (this.hasOwnProperty(ie("finalized"))) return;
|
|
652
653
|
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ie("properties"))) {
|
|
653
|
-
const t = this.properties, i = [...
|
|
654
|
+
const t = this.properties, i = [...Ft(t), ...qt(t)];
|
|
654
655
|
for (const n of i) this.createProperty(n, t[n]);
|
|
655
656
|
}
|
|
656
657
|
const e = this[Symbol.metadata];
|
|
@@ -669,8 +670,8 @@ let Y = class extends HTMLElement {
|
|
|
669
670
|
const t = [];
|
|
670
671
|
if (Array.isArray(e)) {
|
|
671
672
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
672
|
-
for (const n of i) t.unshift(
|
|
673
|
-
} else e !== void 0 && t.push(
|
|
673
|
+
for (const n of i) t.unshift(Ke(n));
|
|
674
|
+
} else e !== void 0 && t.push(Ke(e));
|
|
674
675
|
return t;
|
|
675
676
|
}
|
|
676
677
|
static _$Eu(e, t) {
|
|
@@ -699,7 +700,7 @@ let Y = class extends HTMLElement {
|
|
|
699
700
|
}
|
|
700
701
|
createRenderRoot() {
|
|
701
702
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
702
|
-
return
|
|
703
|
+
return Dt(e, this.constructor.elementStyles), e;
|
|
703
704
|
}
|
|
704
705
|
connectedCallback() {
|
|
705
706
|
var e;
|
|
@@ -724,7 +725,7 @@ let Y = class extends HTMLElement {
|
|
|
724
725
|
var o;
|
|
725
726
|
const i = this.constructor.elementProperties.get(e), n = this.constructor._$Eu(e, i);
|
|
726
727
|
if (n !== void 0 && i.reflect === !0) {
|
|
727
|
-
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter :
|
|
728
|
+
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : we).toAttribute(t, i.type);
|
|
728
729
|
this._$Em = e, r == null ? this.removeAttribute(n) : this.setAttribute(n, r), this._$Em = null;
|
|
729
730
|
}
|
|
730
731
|
}
|
|
@@ -732,7 +733,7 @@ let Y = class extends HTMLElement {
|
|
|
732
733
|
var o, r;
|
|
733
734
|
const i = this.constructor, n = i._$Eh.get(e);
|
|
734
735
|
if (n !== void 0 && this._$Em !== n) {
|
|
735
|
-
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter :
|
|
736
|
+
const l = i.getPropertyOptions(n), a = typeof l.converter == "function" ? { fromAttribute: l.converter } : ((o = l.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? l.converter : we;
|
|
736
737
|
this._$Em = n;
|
|
737
738
|
const c = a.fromAttribute(t, l.type);
|
|
738
739
|
this[n] = c ?? ((r = this._$Ej) == null ? void 0 : r.get(n)) ?? c, this._$Em = null;
|
|
@@ -742,7 +743,7 @@ let Y = class extends HTMLElement {
|
|
|
742
743
|
var r;
|
|
743
744
|
if (e !== void 0) {
|
|
744
745
|
const l = this.constructor;
|
|
745
|
-
if (n === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ??
|
|
746
|
+
if (n === !1 && (o = this[e]), i ?? (i = l.getPropertyOptions(e)), !((i.hasChanged ?? De)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(l._$Eu(e, i)))) return;
|
|
746
747
|
this.C(e, t, i);
|
|
747
748
|
}
|
|
748
749
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -824,53 +825,53 @@ Y.elementStyles = [], Y.shadowRootOptions = { mode: "open" }, Y[ie("elementPrope
|
|
|
824
825
|
* Copyright 2017 Google LLC
|
|
825
826
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
826
827
|
*/
|
|
827
|
-
const se = globalThis, Je = (s) => s,
|
|
828
|
-
\f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
829
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
830
|
-
function
|
|
831
|
-
if (!
|
|
832
|
-
return
|
|
828
|
+
const se = globalThis, Je = (s) => s, $e = se.trustedTypes, Qe = $e ? $e.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, wt = "$lit$", z = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + z, Xt = `<${$t}>`, F = document, oe = () => F.createComment(""), re = (s) => s === null || typeof s != "object" && typeof s != "function", He = Array.isArray, Yt = (s) => He(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", Se = `[
|
|
829
|
+
\f\r]`, te = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, et = /-->/g, tt = />/g, H = RegExp(`>|${Se}(?:([^\\s"'>=/]+)(${Se}*=${Se}*(?:[^
|
|
830
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), it = /'/g, st = /"/g, kt = /^(?:script|style|textarea|title)$/i, Et = (s) => (e, ...t) => ({ _$litType$: s, strings: e, values: t }), h = Et(1), Kt = Et(2), q = Symbol.for("lit-noChange"), m = Symbol.for("lit-nothing"), nt = /* @__PURE__ */ new WeakMap(), B = F.createTreeWalker(F, 129);
|
|
831
|
+
function Ct(s, e) {
|
|
832
|
+
if (!He(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
833
|
+
return Qe !== void 0 ? Qe.createHTML(e) : e;
|
|
833
834
|
}
|
|
834
|
-
const
|
|
835
|
+
const Gt = (s, e) => {
|
|
835
836
|
const t = s.length - 1, i = [];
|
|
836
837
|
let n, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = te;
|
|
837
838
|
for (let l = 0; l < t; l++) {
|
|
838
839
|
const a = s[l];
|
|
839
|
-
let c,
|
|
840
|
-
for (;
|
|
840
|
+
let c, p, d = -1, u = 0;
|
|
841
|
+
for (; u < a.length && (r.lastIndex = u, p = r.exec(a), p !== null); ) u = r.lastIndex, r === te ? p[1] === "!--" ? r = et : p[1] !== void 0 ? r = tt : p[2] !== void 0 ? (kt.test(p[2]) && (n = RegExp("</" + p[2], "g")), r = H) : p[3] !== void 0 && (r = H) : r === H ? p[0] === ">" ? (r = n ?? te, d = -1) : p[1] === void 0 ? d = -2 : (d = r.lastIndex - p[2].length, c = p[1], r = p[3] === void 0 ? H : p[3] === '"' ? st : it) : r === st || r === it ? r = H : r === et || r === tt ? r = te : (r = H, n = void 0);
|
|
841
842
|
const f = r === H && s[l + 1].startsWith("/>") ? " " : "";
|
|
842
|
-
o += r === te ? a +
|
|
843
|
+
o += r === te ? a + Xt : d >= 0 ? (i.push(c), a.slice(0, d) + wt + a.slice(d) + z + f) : a + z + (d === -2 ? l : f);
|
|
843
844
|
}
|
|
844
|
-
return [
|
|
845
|
+
return [Ct(s, o + (s[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
845
846
|
};
|
|
846
|
-
class
|
|
847
|
+
class ae {
|
|
847
848
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
848
849
|
let n;
|
|
849
850
|
this.parts = [];
|
|
850
851
|
let o = 0, r = 0;
|
|
851
|
-
const l = e.length - 1, a = this.parts, [c,
|
|
852
|
-
if (this.el =
|
|
853
|
-
const
|
|
854
|
-
|
|
852
|
+
const l = e.length - 1, a = this.parts, [c, p] = Gt(e, t);
|
|
853
|
+
if (this.el = ae.createElement(c, i), B.currentNode = this.el.content, t === 2 || t === 3) {
|
|
854
|
+
const d = this.el.content.firstChild;
|
|
855
|
+
d.replaceWith(...d.childNodes);
|
|
855
856
|
}
|
|
856
|
-
for (; (n =
|
|
857
|
+
for (; (n = B.nextNode()) !== null && a.length < l; ) {
|
|
857
858
|
if (n.nodeType === 1) {
|
|
858
|
-
if (n.hasAttributes()) for (const
|
|
859
|
-
const
|
|
860
|
-
a.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? Jt : b[1] === "?" ?
|
|
861
|
-
} else
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
864
|
-
if (
|
|
865
|
-
n.textContent =
|
|
866
|
-
for (let f = 0; f <
|
|
867
|
-
n.append(
|
|
859
|
+
if (n.hasAttributes()) for (const d of n.getAttributeNames()) if (d.endsWith(wt)) {
|
|
860
|
+
const u = p[r++], f = n.getAttribute(d).split(z), b = /([.?@])?(.*)/.exec(u);
|
|
861
|
+
a.push({ type: 1, index: o, name: b[2], strings: f, ctor: b[1] === "." ? Jt : b[1] === "?" ? Qt : b[1] === "@" ? ei : Ee }), n.removeAttribute(d);
|
|
862
|
+
} else d.startsWith(z) && (a.push({ type: 6, index: o }), n.removeAttribute(d));
|
|
863
|
+
if (kt.test(n.tagName)) {
|
|
864
|
+
const d = n.textContent.split(z), u = d.length - 1;
|
|
865
|
+
if (u > 0) {
|
|
866
|
+
n.textContent = $e ? $e.emptyScript : "";
|
|
867
|
+
for (let f = 0; f < u; f++) n.append(d[f], oe()), B.nextNode(), a.push({ type: 2, index: ++o });
|
|
868
|
+
n.append(d[u], oe());
|
|
868
869
|
}
|
|
869
870
|
}
|
|
870
|
-
} else if (n.nodeType === 8) if (n.data ===
|
|
871
|
+
} else if (n.nodeType === 8) if (n.data === $t) a.push({ type: 2, index: o });
|
|
871
872
|
else {
|
|
872
|
-
let
|
|
873
|
-
for (; (
|
|
873
|
+
let d = -1;
|
|
874
|
+
for (; (d = n.data.indexOf(z, d + 1)) !== -1; ) a.push({ type: 7, index: o }), d += z.length - 1;
|
|
874
875
|
}
|
|
875
876
|
o++;
|
|
876
877
|
}
|
|
@@ -884,10 +885,10 @@ function K(s, e, t = s, i) {
|
|
|
884
885
|
var r, l;
|
|
885
886
|
if (e === q) return e;
|
|
886
887
|
let n = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
887
|
-
const o =
|
|
888
|
+
const o = re(e) ? void 0 : e._$litDirective$;
|
|
888
889
|
return (n == null ? void 0 : n.constructor) !== o && ((l = n == null ? void 0 : n._$AO) == null || l.call(n, !1), o === void 0 ? n = void 0 : (n = new o(s), n._$AT(s, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = n : t._$Cl = n), n !== void 0 && (e = K(s, n._$AS(s, e.values), n, i)), e;
|
|
889
890
|
}
|
|
890
|
-
class
|
|
891
|
+
class Zt {
|
|
891
892
|
constructor(e, t) {
|
|
892
893
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
893
894
|
}
|
|
@@ -899,29 +900,29 @@ class Gt {
|
|
|
899
900
|
}
|
|
900
901
|
u(e) {
|
|
901
902
|
const { el: { content: t }, parts: i } = this._$AD, n = ((e == null ? void 0 : e.creationScope) ?? F).importNode(t, !0);
|
|
902
|
-
|
|
903
|
-
let o =
|
|
903
|
+
B.currentNode = n;
|
|
904
|
+
let o = B.nextNode(), r = 0, l = 0, a = i[0];
|
|
904
905
|
for (; a !== void 0; ) {
|
|
905
906
|
if (r === a.index) {
|
|
906
907
|
let c;
|
|
907
|
-
a.type === 2 ? c = new
|
|
908
|
+
a.type === 2 ? c = new ue(o, o.nextSibling, this, e) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, e) : a.type === 6 && (c = new ti(o, this, e)), this._$AV.push(c), a = i[++l];
|
|
908
909
|
}
|
|
909
|
-
r !== (a == null ? void 0 : a.index) && (o =
|
|
910
|
+
r !== (a == null ? void 0 : a.index) && (o = B.nextNode(), r++);
|
|
910
911
|
}
|
|
911
|
-
return
|
|
912
|
+
return B.currentNode = F, n;
|
|
912
913
|
}
|
|
913
914
|
p(e) {
|
|
914
915
|
let t = 0;
|
|
915
916
|
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++;
|
|
916
917
|
}
|
|
917
918
|
}
|
|
918
|
-
class
|
|
919
|
+
class ue {
|
|
919
920
|
get _$AU() {
|
|
920
921
|
var e;
|
|
921
922
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
922
923
|
}
|
|
923
924
|
constructor(e, t, i, n) {
|
|
924
|
-
this.type = 2, this._$AH =
|
|
925
|
+
this.type = 2, this._$AH = m, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = n, this._$Cv = (n == null ? void 0 : n.isConnected) ?? !0;
|
|
925
926
|
}
|
|
926
927
|
get parentNode() {
|
|
927
928
|
let e = this._$AA.parentNode;
|
|
@@ -935,7 +936,7 @@ class pe {
|
|
|
935
936
|
return this._$AB;
|
|
936
937
|
}
|
|
937
938
|
_$AI(e, t = this) {
|
|
938
|
-
e = K(this, e, t),
|
|
939
|
+
e = K(this, e, t), re(e) ? e === m || e == null || e === "" ? (this._$AH !== m && this._$AR(), this._$AH = m) : e !== this._$AH && e !== q && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Yt(e) ? this.k(e) : this._(e);
|
|
939
940
|
}
|
|
940
941
|
O(e) {
|
|
941
942
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -944,26 +945,26 @@ class pe {
|
|
|
944
945
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
945
946
|
}
|
|
946
947
|
_(e) {
|
|
947
|
-
this._$AH !==
|
|
948
|
+
this._$AH !== m && re(this._$AH) ? this._$AA.nextSibling.data = e : this.T(F.createTextNode(e)), this._$AH = e;
|
|
948
949
|
}
|
|
949
950
|
$(e) {
|
|
950
951
|
var o;
|
|
951
|
-
const { values: t, _$litType$: i } = e, n = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el =
|
|
952
|
+
const { values: t, _$litType$: i } = e, n = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ae.createElement(Ct(i.h, i.h[0]), this.options)), i);
|
|
952
953
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === n) this._$AH.p(t);
|
|
953
954
|
else {
|
|
954
|
-
const r = new
|
|
955
|
+
const r = new Zt(n, this), l = r.u(this.options);
|
|
955
956
|
r.p(t), this.T(l), this._$AH = r;
|
|
956
957
|
}
|
|
957
958
|
}
|
|
958
959
|
_$AC(e) {
|
|
959
|
-
let t =
|
|
960
|
-
return t === void 0 &&
|
|
960
|
+
let t = nt.get(e.strings);
|
|
961
|
+
return t === void 0 && nt.set(e.strings, t = new ae(e)), t;
|
|
961
962
|
}
|
|
962
963
|
k(e) {
|
|
963
|
-
|
|
964
|
+
He(this._$AH) || (this._$AH = [], this._$AR());
|
|
964
965
|
const t = this._$AH;
|
|
965
966
|
let i, n = 0;
|
|
966
|
-
for (const o of e) n === t.length ? t.push(i = new
|
|
967
|
+
for (const o of e) n === t.length ? t.push(i = new ue(this.O(oe()), this.O(oe()), this, this.options)) : i = t[n], i._$AI(o), n++;
|
|
967
968
|
n < t.length && (this._$AR(i && i._$AB.nextSibling, n), t.length = n);
|
|
968
969
|
}
|
|
969
970
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
@@ -986,21 +987,21 @@ class Ee {
|
|
|
986
987
|
return this._$AM._$AU;
|
|
987
988
|
}
|
|
988
989
|
constructor(e, t, i, n, o) {
|
|
989
|
-
this.type = 1, this._$AH =
|
|
990
|
+
this.type = 1, this._$AH = m, this._$AN = void 0, this.element = e, this.name = t, this._$AM = n, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = m;
|
|
990
991
|
}
|
|
991
992
|
_$AI(e, t = this, i, n) {
|
|
992
993
|
const o = this.strings;
|
|
993
994
|
let r = !1;
|
|
994
|
-
if (o === void 0) e = K(this, e, t, 0), r = !
|
|
995
|
+
if (o === void 0) e = K(this, e, t, 0), r = !re(e) || e !== this._$AH && e !== q, r && (this._$AH = e);
|
|
995
996
|
else {
|
|
996
997
|
const l = e;
|
|
997
998
|
let a, c;
|
|
998
|
-
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === q && (c = this._$AH[a]), r || (r = !
|
|
999
|
+
for (e = o[0], a = 0; a < o.length - 1; a++) c = K(this, l[i + a], t, a), c === q && (c = this._$AH[a]), r || (r = !re(c) || c !== this._$AH[a]), c === m ? e = m : e !== m && (e += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
999
1000
|
}
|
|
1000
1001
|
r && !n && this.j(e);
|
|
1001
1002
|
}
|
|
1002
1003
|
j(e) {
|
|
1003
|
-
e ===
|
|
1004
|
+
e === m ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1004
1005
|
}
|
|
1005
1006
|
}
|
|
1006
1007
|
class Jt extends Ee {
|
|
@@ -1008,24 +1009,24 @@ class Jt extends Ee {
|
|
|
1008
1009
|
super(...arguments), this.type = 3;
|
|
1009
1010
|
}
|
|
1010
1011
|
j(e) {
|
|
1011
|
-
this.element[this.name] = e ===
|
|
1012
|
+
this.element[this.name] = e === m ? void 0 : e;
|
|
1012
1013
|
}
|
|
1013
1014
|
}
|
|
1014
|
-
class
|
|
1015
|
+
class Qt extends Ee {
|
|
1015
1016
|
constructor() {
|
|
1016
1017
|
super(...arguments), this.type = 4;
|
|
1017
1018
|
}
|
|
1018
1019
|
j(e) {
|
|
1019
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1020
|
+
this.element.toggleAttribute(this.name, !!e && e !== m);
|
|
1020
1021
|
}
|
|
1021
1022
|
}
|
|
1022
|
-
class
|
|
1023
|
+
class ei extends Ee {
|
|
1023
1024
|
constructor(e, t, i, n, o) {
|
|
1024
1025
|
super(e, t, i, n, o), this.type = 5;
|
|
1025
1026
|
}
|
|
1026
1027
|
_$AI(e, t = this) {
|
|
1027
|
-
if ((e = K(this, e, t, 0) ??
|
|
1028
|
-
const i = this._$AH, n = e ===
|
|
1028
|
+
if ((e = K(this, e, t, 0) ?? m) === q) return;
|
|
1029
|
+
const i = this._$AH, n = e === m && i !== m || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== m && (i === m || n);
|
|
1029
1030
|
n && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1030
1031
|
}
|
|
1031
1032
|
handleEvent(e) {
|
|
@@ -1033,7 +1034,7 @@ class Qt extends Ee {
|
|
|
1033
1034
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
1034
1035
|
}
|
|
1035
1036
|
}
|
|
1036
|
-
class
|
|
1037
|
+
class ti {
|
|
1037
1038
|
constructor(e, t, i) {
|
|
1038
1039
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
1039
1040
|
}
|
|
@@ -1045,13 +1046,13 @@ class ei {
|
|
|
1045
1046
|
}
|
|
1046
1047
|
}
|
|
1047
1048
|
const Pe = se.litHtmlPolyfillSupport;
|
|
1048
|
-
Pe == null || Pe(
|
|
1049
|
-
const
|
|
1049
|
+
Pe == null || Pe(ae, ue), (se.litHtmlVersions ?? (se.litHtmlVersions = [])).push("3.3.2");
|
|
1050
|
+
const ii = (s, e, t) => {
|
|
1050
1051
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1051
1052
|
let n = i._$litPart$;
|
|
1052
1053
|
if (n === void 0) {
|
|
1053
1054
|
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
1054
|
-
i._$litPart$ = n = new
|
|
1055
|
+
i._$litPart$ = n = new ue(e.insertBefore(oe(), o), o, void 0, t ?? {});
|
|
1055
1056
|
}
|
|
1056
1057
|
return n._$AI(s), n;
|
|
1057
1058
|
};
|
|
@@ -1060,7 +1061,7 @@ const ti = (s, e, t) => {
|
|
|
1060
1061
|
* Copyright 2017 Google LLC
|
|
1061
1062
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1062
1063
|
*/
|
|
1063
|
-
const
|
|
1064
|
+
const N = globalThis;
|
|
1064
1065
|
let S = class extends Y {
|
|
1065
1066
|
constructor() {
|
|
1066
1067
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
@@ -1072,7 +1073,7 @@ let S = class extends Y {
|
|
|
1072
1073
|
}
|
|
1073
1074
|
update(e) {
|
|
1074
1075
|
const t = this.render();
|
|
1075
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
1076
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ii(t, this.renderRoot, this.renderOptions);
|
|
1076
1077
|
}
|
|
1077
1078
|
connectedCallback() {
|
|
1078
1079
|
var e;
|
|
@@ -1086,11 +1087,11 @@ let S = class extends Y {
|
|
|
1086
1087
|
return q;
|
|
1087
1088
|
}
|
|
1088
1089
|
};
|
|
1089
|
-
var
|
|
1090
|
-
S._$litElement$ = !0, S.finalized = !0, (
|
|
1091
|
-
const Ae =
|
|
1090
|
+
var bt;
|
|
1091
|
+
S._$litElement$ = !0, S.finalized = !0, (bt = N.litElementHydrateSupport) == null || bt.call(N, { LitElement: S });
|
|
1092
|
+
const Ae = N.litElementPolyfillSupport;
|
|
1092
1093
|
Ae == null || Ae({ LitElement: S });
|
|
1093
|
-
(
|
|
1094
|
+
(N.litElementVersions ?? (N.litElementVersions = [])).push("4.2.2");
|
|
1094
1095
|
/**
|
|
1095
1096
|
* @license
|
|
1096
1097
|
* Copyright 2017 Google LLC
|
|
@@ -1106,7 +1107,7 @@ const R = (s) => (e, t) => {
|
|
|
1106
1107
|
* Copyright 2017 Google LLC
|
|
1107
1108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1108
1109
|
*/
|
|
1109
|
-
const
|
|
1110
|
+
const si = { attribute: !0, type: String, converter: we, reflect: !1, hasChanged: De }, ni = (s = si, e, t) => {
|
|
1110
1111
|
const { kind: i, metadata: n } = t;
|
|
1111
1112
|
let o = globalThis.litPropertyMetadata.get(n);
|
|
1112
1113
|
if (o === void 0 && globalThis.litPropertyMetadata.set(n, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(t.name, s), i === "accessor") {
|
|
@@ -1128,7 +1129,7 @@ const ii = { attribute: !0, type: String, converter: ye, reflect: !1, hasChanged
|
|
|
1128
1129
|
throw Error("Unsupported decorator location: " + i);
|
|
1129
1130
|
};
|
|
1130
1131
|
function g(s) {
|
|
1131
|
-
return (e, t) => typeof t == "object" ?
|
|
1132
|
+
return (e, t) => typeof t == "object" ? ni(s, e, t) : ((i, n, o) => {
|
|
1132
1133
|
const r = n.hasOwnProperty(o);
|
|
1133
1134
|
return n.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(n, o) : void 0;
|
|
1134
1135
|
})(s, e, t);
|
|
@@ -1141,13 +1142,13 @@ function g(s) {
|
|
|
1141
1142
|
function v(s) {
|
|
1142
1143
|
return g({ ...s, state: !0, attribute: !1 });
|
|
1143
1144
|
}
|
|
1144
|
-
const
|
|
1145
|
-
var
|
|
1146
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1145
|
+
const Z = "pulse-client";
|
|
1146
|
+
var oi = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, J = (s, e, t, i) => {
|
|
1147
|
+
for (var n = i > 1 ? void 0 : i ? ri(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1147
1148
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1148
|
-
return i && n &&
|
|
1149
|
+
return i && n && oi(e, t, n), n;
|
|
1149
1150
|
};
|
|
1150
|
-
let
|
|
1151
|
+
let V = class extends S {
|
|
1151
1152
|
constructor() {
|
|
1152
1153
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1153
1154
|
}
|
|
@@ -1159,38 +1160,38 @@ let W = class extends S {
|
|
|
1159
1160
|
room: this.room,
|
|
1160
1161
|
endpoint: this.endpoint
|
|
1161
1162
|
};
|
|
1162
|
-
this.client = new
|
|
1163
|
+
this.client = new xt(s), this.client.connect();
|
|
1163
1164
|
}
|
|
1164
1165
|
disconnectedCallback() {
|
|
1165
1166
|
var s;
|
|
1166
1167
|
super.disconnectedCallback(), (s = this.client) == null || s.disconnect();
|
|
1167
1168
|
}
|
|
1168
1169
|
render() {
|
|
1169
|
-
return
|
|
1170
|
+
return h`<slot></slot>`;
|
|
1170
1171
|
}
|
|
1171
1172
|
};
|
|
1172
|
-
|
|
1173
|
+
J([
|
|
1173
1174
|
g({ attribute: "api-key" })
|
|
1174
|
-
],
|
|
1175
|
-
|
|
1175
|
+
], V.prototype, "apiKey", 2);
|
|
1176
|
+
J([
|
|
1176
1177
|
g()
|
|
1177
|
-
],
|
|
1178
|
-
|
|
1178
|
+
], V.prototype, "token", 2);
|
|
1179
|
+
J([
|
|
1179
1180
|
g()
|
|
1180
|
-
],
|
|
1181
|
-
|
|
1181
|
+
], V.prototype, "room", 2);
|
|
1182
|
+
J([
|
|
1182
1183
|
g()
|
|
1183
|
-
],
|
|
1184
|
-
|
|
1185
|
-
Mt({ context:
|
|
1186
|
-
],
|
|
1187
|
-
|
|
1184
|
+
], V.prototype, "endpoint", 2);
|
|
1185
|
+
J([
|
|
1186
|
+
Mt({ context: Z })
|
|
1187
|
+
], V.prototype, "client", 2);
|
|
1188
|
+
V = J([
|
|
1188
1189
|
R("pulse-provider")
|
|
1189
|
-
],
|
|
1190
|
-
var
|
|
1191
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1190
|
+
], V);
|
|
1191
|
+
var ai = Object.defineProperty, li = Object.getOwnPropertyDescriptor, Ce = (s, e, t, i) => {
|
|
1192
|
+
for (var n = i > 1 ? void 0 : i ? li(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1192
1193
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1193
|
-
return i && n &&
|
|
1194
|
+
return i && n && ai(e, t, n), n;
|
|
1194
1195
|
};
|
|
1195
1196
|
let G = class extends S {
|
|
1196
1197
|
constructor() {
|
|
@@ -1217,16 +1218,16 @@ let G = class extends S {
|
|
|
1217
1218
|
}
|
|
1218
1219
|
render() {
|
|
1219
1220
|
const s = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
|
|
1220
|
-
return
|
|
1221
|
+
return h`
|
|
1221
1222
|
<div class="avatars">
|
|
1222
|
-
${e > 0 ?
|
|
1223
|
+
${e > 0 ? h`<div class="overflow">+${e}</div>` : null}
|
|
1223
1224
|
${s.map(
|
|
1224
|
-
(t) =>
|
|
1225
|
+
(t) => h`
|
|
1225
1226
|
<div
|
|
1226
1227
|
class="avatar"
|
|
1227
1228
|
style="background:${t.user.color}"
|
|
1228
1229
|
>
|
|
1229
|
-
${t.user.avatar ?
|
|
1230
|
+
${t.user.avatar ? h`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
|
|
1230
1231
|
<span class="status-ring ${t.status}"></span>
|
|
1231
1232
|
<span class="tooltip">${t.user.name}</span>
|
|
1232
1233
|
</div>
|
|
@@ -1236,7 +1237,7 @@ let G = class extends S {
|
|
|
1236
1237
|
`;
|
|
1237
1238
|
}
|
|
1238
1239
|
};
|
|
1239
|
-
G.styles =
|
|
1240
|
+
G.styles = I`
|
|
1240
1241
|
:host {
|
|
1241
1242
|
display: inline-flex;
|
|
1242
1243
|
align-items: center;
|
|
@@ -1341,7 +1342,7 @@ G.styles = M`
|
|
|
1341
1342
|
}
|
|
1342
1343
|
`;
|
|
1343
1344
|
Ce([
|
|
1344
|
-
|
|
1345
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1345
1346
|
g({ attribute: !1 })
|
|
1346
1347
|
], G.prototype, "client", 2);
|
|
1347
1348
|
Ce([
|
|
@@ -1353,12 +1354,12 @@ Ce([
|
|
|
1353
1354
|
G = Ce([
|
|
1354
1355
|
R("pulse-presence")
|
|
1355
1356
|
], G);
|
|
1356
|
-
var
|
|
1357
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1357
|
+
var ci = Object.defineProperty, di = Object.getOwnPropertyDescriptor, Be = (s, e, t, i) => {
|
|
1358
|
+
for (var n = i > 1 ? void 0 : i ? di(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1358
1359
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1359
|
-
return i && n &&
|
|
1360
|
+
return i && n && ci(e, t, n), n;
|
|
1360
1361
|
};
|
|
1361
|
-
let
|
|
1362
|
+
let le = class extends S {
|
|
1362
1363
|
constructor() {
|
|
1363
1364
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (s) => {
|
|
1364
1365
|
var e;
|
|
@@ -1412,9 +1413,9 @@ let ae = class extends S {
|
|
|
1412
1413
|
}
|
|
1413
1414
|
render() {
|
|
1414
1415
|
const s = [...this.cursors.values()];
|
|
1415
|
-
return
|
|
1416
|
+
return h`
|
|
1416
1417
|
${s.map(
|
|
1417
|
-
(e) =>
|
|
1418
|
+
(e) => h`
|
|
1418
1419
|
<div
|
|
1419
1420
|
class="cursor"
|
|
1420
1421
|
style="transform:translate(${e.position.x}px,${e.position.y}px)"
|
|
@@ -1435,7 +1436,7 @@ let ae = class extends S {
|
|
|
1435
1436
|
`;
|
|
1436
1437
|
}
|
|
1437
1438
|
};
|
|
1438
|
-
|
|
1439
|
+
le.styles = I`
|
|
1439
1440
|
:host {
|
|
1440
1441
|
position: fixed;
|
|
1441
1442
|
top: 0;
|
|
@@ -1472,22 +1473,22 @@ ae.styles = M`
|
|
|
1472
1473
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1473
1474
|
}
|
|
1474
1475
|
`;
|
|
1475
|
-
|
|
1476
|
-
|
|
1476
|
+
Be([
|
|
1477
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1477
1478
|
g({ attribute: !1 })
|
|
1478
|
-
],
|
|
1479
|
-
|
|
1479
|
+
], le.prototype, "client", 2);
|
|
1480
|
+
Be([
|
|
1480
1481
|
v()
|
|
1481
|
-
],
|
|
1482
|
-
|
|
1482
|
+
], le.prototype, "cursors", 2);
|
|
1483
|
+
le = Be([
|
|
1483
1484
|
R("pulse-cursors")
|
|
1484
|
-
],
|
|
1485
|
-
var
|
|
1486
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1485
|
+
], le);
|
|
1486
|
+
var hi = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, fe = (s, e, t, i) => {
|
|
1487
|
+
for (var n = i > 1 ? void 0 : i ? pi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1487
1488
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1488
|
-
return i && n &&
|
|
1489
|
+
return i && n && hi(e, t, n), n;
|
|
1489
1490
|
};
|
|
1490
|
-
let
|
|
1491
|
+
let W = class extends S {
|
|
1491
1492
|
constructor() {
|
|
1492
1493
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1493
1494
|
}
|
|
@@ -1509,7 +1510,7 @@ let V = class extends S {
|
|
|
1509
1510
|
}
|
|
1510
1511
|
parseMentions(s) {
|
|
1511
1512
|
return s.split(/(@\w+)/g).map(
|
|
1512
|
-
(t) => t.startsWith("@") ?
|
|
1513
|
+
(t) => t.startsWith("@") ? h`<span class="mention">${t}</span>` : t
|
|
1513
1514
|
);
|
|
1514
1515
|
}
|
|
1515
1516
|
getInitials(s) {
|
|
@@ -1535,9 +1536,9 @@ let V = class extends S {
|
|
|
1535
1536
|
}
|
|
1536
1537
|
render() {
|
|
1537
1538
|
const s = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
1538
|
-
return
|
|
1539
|
+
return h`
|
|
1539
1540
|
<div class="threads">
|
|
1540
|
-
${s.length === 0 ?
|
|
1541
|
+
${s.length === 0 ? h`<div class="empty">
|
|
1541
1542
|
<div class="empty-icon">💬</div>
|
|
1542
1543
|
No comments yet.<br>Start a conversation below.
|
|
1543
1544
|
</div>` : s.map((e) => this.renderThread(e))}
|
|
@@ -1551,12 +1552,12 @@ let V = class extends S {
|
|
|
1551
1552
|
`;
|
|
1552
1553
|
}
|
|
1553
1554
|
renderThread(s) {
|
|
1554
|
-
return
|
|
1555
|
+
return h`
|
|
1555
1556
|
<div class="thread ${s.resolved ? "resolved" : ""}">
|
|
1556
1557
|
${s.comments.map((e, t) => {
|
|
1557
1558
|
const i = this.getUserForComment(e.userId);
|
|
1558
|
-
return
|
|
1559
|
-
${t > 0 ?
|
|
1559
|
+
return h`
|
|
1560
|
+
${t > 0 ? h`<div class="divider"></div>` : m}
|
|
1560
1561
|
<div class="comment">
|
|
1561
1562
|
<div class="comment-header">
|
|
1562
1563
|
<div
|
|
@@ -1588,12 +1589,12 @@ let V = class extends S {
|
|
|
1588
1589
|
${s.resolved ? "Reopen" : "Resolve"}
|
|
1589
1590
|
</button>
|
|
1590
1591
|
</div>
|
|
1591
|
-
${this.replyingTo === s.id ?
|
|
1592
|
+
${this.replyingTo === s.id ? h`
|
|
1592
1593
|
<form class="reply-form" @submit=${(e) => this.handleReply(s.id, e)}>
|
|
1593
1594
|
<input type="text" placeholder="Write a reply..." />
|
|
1594
1595
|
<button type="submit">Send</button>
|
|
1595
1596
|
</form>
|
|
1596
|
-
` :
|
|
1597
|
+
` : m}
|
|
1597
1598
|
</div>
|
|
1598
1599
|
`;
|
|
1599
1600
|
}
|
|
@@ -1605,7 +1606,7 @@ let V = class extends S {
|
|
|
1605
1606
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1606
1607
|
}
|
|
1607
1608
|
};
|
|
1608
|
-
|
|
1609
|
+
W.styles = I`
|
|
1609
1610
|
:host {
|
|
1610
1611
|
display: block;
|
|
1611
1612
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1817,41 +1818,41 @@ V.styles = M`
|
|
|
1817
1818
|
opacity: 0.4;
|
|
1818
1819
|
}
|
|
1819
1820
|
`;
|
|
1820
|
-
|
|
1821
|
-
|
|
1821
|
+
fe([
|
|
1822
|
+
pe({ context: Z, subscribe: !0 }),
|
|
1822
1823
|
g({ attribute: !1 })
|
|
1823
|
-
],
|
|
1824
|
-
|
|
1824
|
+
], W.prototype, "client", 2);
|
|
1825
|
+
fe([
|
|
1825
1826
|
g({ type: Boolean, attribute: "show-resolved" })
|
|
1826
|
-
],
|
|
1827
|
-
|
|
1827
|
+
], W.prototype, "showResolved", 2);
|
|
1828
|
+
fe([
|
|
1828
1829
|
v()
|
|
1829
|
-
],
|
|
1830
|
-
|
|
1830
|
+
], W.prototype, "threads", 2);
|
|
1831
|
+
fe([
|
|
1831
1832
|
v()
|
|
1832
|
-
],
|
|
1833
|
-
|
|
1833
|
+
], W.prototype, "replyingTo", 2);
|
|
1834
|
+
W = fe([
|
|
1834
1835
|
R("pulse-comments")
|
|
1835
|
-
],
|
|
1836
|
-
var
|
|
1837
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
1836
|
+
], W);
|
|
1837
|
+
var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, Ne = (s, e, t, i) => {
|
|
1838
|
+
for (var n = i > 1 ? void 0 : i ? fi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
1838
1839
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
1839
|
-
return i && n &&
|
|
1840
|
+
return i && n && ui(e, t, n), n;
|
|
1840
1841
|
};
|
|
1841
|
-
const
|
|
1842
|
+
const mi = {
|
|
1842
1843
|
"comment:created": "left a comment",
|
|
1843
1844
|
"comment:mention": "mentioned you",
|
|
1844
1845
|
"comment:reply": "replied to your comment",
|
|
1845
1846
|
"thread:resolved": "resolved a thread",
|
|
1846
1847
|
"reaction:added": "reacted to your comment"
|
|
1847
|
-
},
|
|
1848
|
+
}, gi = {
|
|
1848
1849
|
"comment:created": "💬",
|
|
1849
1850
|
"comment:mention": "📣",
|
|
1850
1851
|
"comment:reply": "↩️",
|
|
1851
1852
|
"thread:resolved": "✅",
|
|
1852
1853
|
"reaction:added": "🎉"
|
|
1853
1854
|
};
|
|
1854
|
-
let
|
|
1855
|
+
let ce = class extends S {
|
|
1855
1856
|
constructor() {
|
|
1856
1857
|
super(...arguments), this.notifications = [];
|
|
1857
1858
|
}
|
|
@@ -1898,31 +1899,31 @@ let le = class extends S {
|
|
|
1898
1899
|
}
|
|
1899
1900
|
render() {
|
|
1900
1901
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
1901
|
-
return
|
|
1902
|
+
return h`
|
|
1902
1903
|
<div class="header">
|
|
1903
1904
|
<span class="title">
|
|
1904
1905
|
Notifications
|
|
1905
|
-
${s > 0 ?
|
|
1906
|
+
${s > 0 ? h`<span class="badge">${s}</span>` : m}
|
|
1906
1907
|
</span>
|
|
1907
|
-
${s > 0 ?
|
|
1908
|
+
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1908
1909
|
Mark all read
|
|
1909
|
-
</button>` :
|
|
1910
|
+
</button>` : m}
|
|
1910
1911
|
</div>
|
|
1911
1912
|
<div class="list">
|
|
1912
|
-
${this.notifications.length === 0 ?
|
|
1913
|
+
${this.notifications.length === 0 ? h`<div class="empty">
|
|
1913
1914
|
<div class="empty-icon">🔔</div>
|
|
1914
1915
|
No notifications yet
|
|
1915
1916
|
</div>` : this.notifications.map(
|
|
1916
|
-
(e) =>
|
|
1917
|
+
(e) => h`
|
|
1917
1918
|
<div
|
|
1918
1919
|
class="item ${e.read ? "" : "unread"}"
|
|
1919
1920
|
@click=${() => this.handleClick(e)}
|
|
1920
1921
|
>
|
|
1921
|
-
<span class="icon">${
|
|
1922
|
+
<span class="icon">${gi[e.type] ?? "🔔"}</span>
|
|
1922
1923
|
<div class="content">
|
|
1923
1924
|
<div class="text">
|
|
1924
1925
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1925
|
-
${
|
|
1926
|
+
${mi[e.type] ?? e.type}
|
|
1926
1927
|
</div>
|
|
1927
1928
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1928
1929
|
</div>
|
|
@@ -1934,7 +1935,7 @@ let le = class extends S {
|
|
|
1934
1935
|
`;
|
|
1935
1936
|
}
|
|
1936
1937
|
};
|
|
1937
|
-
|
|
1938
|
+
ce.styles = I`
|
|
1938
1939
|
:host {
|
|
1939
1940
|
display: block;
|
|
1940
1941
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2076,21 +2077,21 @@ le.styles = M`
|
|
|
2076
2077
|
}
|
|
2077
2078
|
`;
|
|
2078
2079
|
Ne([
|
|
2079
|
-
|
|
2080
|
+
pe({ context: Z, subscribe: !0 }),
|
|
2080
2081
|
g({ attribute: !1 })
|
|
2081
|
-
],
|
|
2082
|
+
], ce.prototype, "client", 2);
|
|
2082
2083
|
Ne([
|
|
2083
2084
|
v()
|
|
2084
|
-
],
|
|
2085
|
-
|
|
2085
|
+
], ce.prototype, "notifications", 2);
|
|
2086
|
+
ce = Ne([
|
|
2086
2087
|
R("pulse-notifications")
|
|
2087
|
-
],
|
|
2088
|
-
var
|
|
2089
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
2088
|
+
], ce);
|
|
2089
|
+
var bi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Q = (s, e, t, i) => {
|
|
2090
|
+
for (var n = i > 1 ? void 0 : i ? vi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2090
2091
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2091
|
-
return i && n &&
|
|
2092
|
+
return i && n && bi(e, t, n), n;
|
|
2092
2093
|
};
|
|
2093
|
-
const
|
|
2094
|
+
const xi = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2094
2095
|
let D = class extends S {
|
|
2095
2096
|
constructor() {
|
|
2096
2097
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
@@ -2131,9 +2132,9 @@ let D = class extends S {
|
|
|
2131
2132
|
}
|
|
2132
2133
|
render() {
|
|
2133
2134
|
const s = this.groupReactions();
|
|
2134
|
-
return
|
|
2135
|
+
return h`
|
|
2135
2136
|
${s.map(
|
|
2136
|
-
(e) =>
|
|
2137
|
+
(e) => h`
|
|
2137
2138
|
<button
|
|
2138
2139
|
class="reaction ${e.userReactionId ? "active" : ""}"
|
|
2139
2140
|
@click=${() => this.toggleReaction(e)}
|
|
@@ -2150,22 +2151,22 @@ let D = class extends S {
|
|
|
2150
2151
|
>
|
|
2151
2152
|
+
|
|
2152
2153
|
</button>
|
|
2153
|
-
${this.showPicker ?
|
|
2154
|
+
${this.showPicker ? h`
|
|
2154
2155
|
<div class="picker">
|
|
2155
|
-
${
|
|
2156
|
-
(e) =>
|
|
2156
|
+
${xi.map(
|
|
2157
|
+
(e) => h`
|
|
2157
2158
|
<button @click=${() => this.addEmoji(e)}>
|
|
2158
2159
|
${e}
|
|
2159
2160
|
</button>
|
|
2160
2161
|
`
|
|
2161
2162
|
)}
|
|
2162
2163
|
</div>
|
|
2163
|
-
` :
|
|
2164
|
+
` : m}
|
|
2164
2165
|
</div>
|
|
2165
2166
|
`;
|
|
2166
2167
|
}
|
|
2167
2168
|
};
|
|
2168
|
-
D.styles =
|
|
2169
|
+
D.styles = I`
|
|
2169
2170
|
:host {
|
|
2170
2171
|
display: inline-flex;
|
|
2171
2172
|
align-items: center;
|
|
@@ -2278,7 +2279,7 @@ D.styles = M`
|
|
|
2278
2279
|
}
|
|
2279
2280
|
`;
|
|
2280
2281
|
Q([
|
|
2281
|
-
|
|
2282
|
+
pe({ context: Z, subscribe: !0 }),
|
|
2282
2283
|
g({ attribute: !1 })
|
|
2283
2284
|
], D.prototype, "client", 2);
|
|
2284
2285
|
Q([
|
|
@@ -2301,8 +2302,8 @@ D = Q([
|
|
|
2301
2302
|
* Copyright 2017 Google LLC
|
|
2302
2303
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2303
2304
|
*/
|
|
2304
|
-
const
|
|
2305
|
-
class
|
|
2305
|
+
const yi = { CHILD: 2 }, wi = (s) => (...e) => ({ _$litDirective$: s, values: e });
|
|
2306
|
+
class $i {
|
|
2306
2307
|
constructor(e) {
|
|
2307
2308
|
}
|
|
2308
2309
|
get _$AU() {
|
|
@@ -2323,12 +2324,12 @@ class wi {
|
|
|
2323
2324
|
* Copyright 2017 Google LLC
|
|
2324
2325
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2325
2326
|
*/
|
|
2326
|
-
class
|
|
2327
|
+
class Ie extends $i {
|
|
2327
2328
|
constructor(e) {
|
|
2328
|
-
if (super(e), this.it =
|
|
2329
|
+
if (super(e), this.it = m, e.type !== yi.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2329
2330
|
}
|
|
2330
2331
|
render(e) {
|
|
2331
|
-
if (e ===
|
|
2332
|
+
if (e === m || e == null) return this._t = void 0, this.it = e;
|
|
2332
2333
|
if (e === q) return e;
|
|
2333
2334
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2334
2335
|
if (e === this.it) return this._t;
|
|
@@ -2337,23 +2338,23 @@ class Me extends wi {
|
|
|
2337
2338
|
return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
2338
2339
|
}
|
|
2339
2340
|
}
|
|
2340
|
-
|
|
2341
|
+
Ie.directiveName = "unsafeHTML", Ie.resultType = 1;
|
|
2341
2342
|
/**
|
|
2342
2343
|
* @license
|
|
2343
2344
|
* Copyright 2017 Google LLC
|
|
2344
2345
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2345
2346
|
*/
|
|
2346
|
-
class
|
|
2347
|
+
class Me extends Ie {
|
|
2347
2348
|
}
|
|
2348
|
-
|
|
2349
|
-
const
|
|
2349
|
+
Me.directiveName = "unsafeSVG", Me.resultType = 2;
|
|
2350
|
+
const ki = wi(Me);
|
|
2350
2351
|
/**
|
|
2351
2352
|
* @license lucide v0.577.0 - ISC
|
|
2352
2353
|
*
|
|
2353
2354
|
* This source code is licensed under the ISC license.
|
|
2354
2355
|
* See the LICENSE file in the root directory of this source tree.
|
|
2355
2356
|
*/
|
|
2356
|
-
const
|
|
2357
|
+
const Ei = [
|
|
2357
2358
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
|
|
2358
2359
|
[
|
|
2359
2360
|
"path",
|
|
@@ -2368,7 +2369,7 @@ const ki = [
|
|
|
2368
2369
|
* This source code is licensed under the ISC license.
|
|
2369
2370
|
* See the LICENSE file in the root directory of this source tree.
|
|
2370
2371
|
*/
|
|
2371
|
-
const
|
|
2372
|
+
const Ci = [
|
|
2372
2373
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2373
2374
|
["path", { d: "M12 6v6l4 2" }]
|
|
2374
2375
|
];
|
|
@@ -2378,7 +2379,7 @@ const Ei = [
|
|
|
2378
2379
|
* This source code is licensed under the ISC license.
|
|
2379
2380
|
* See the LICENSE file in the root directory of this source tree.
|
|
2380
2381
|
*/
|
|
2381
|
-
const
|
|
2382
|
+
const _i = [
|
|
2382
2383
|
[
|
|
2383
2384
|
"path",
|
|
2384
2385
|
{
|
|
@@ -2392,7 +2393,7 @@ const Ci = [
|
|
|
2392
2393
|
* This source code is licensed under the ISC license.
|
|
2393
2394
|
* See the LICENSE file in the root directory of this source tree.
|
|
2394
2395
|
*/
|
|
2395
|
-
const
|
|
2396
|
+
const Ti = [
|
|
2396
2397
|
["path", { d: "M12 19v3" }],
|
|
2397
2398
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
|
|
2398
2399
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
|
|
@@ -2403,7 +2404,7 @@ const _i = [
|
|
|
2403
2404
|
* This source code is licensed under the ISC license.
|
|
2404
2405
|
* See the LICENSE file in the root directory of this source tree.
|
|
2405
2406
|
*/
|
|
2406
|
-
const
|
|
2407
|
+
const Si = [
|
|
2407
2408
|
[
|
|
2408
2409
|
"path",
|
|
2409
2410
|
{
|
|
@@ -2417,7 +2418,7 @@ const Ti = [
|
|
|
2417
2418
|
* This source code is licensed under the ISC license.
|
|
2418
2419
|
* See the LICENSE file in the root directory of this source tree.
|
|
2419
2420
|
*/
|
|
2420
|
-
const
|
|
2421
|
+
const Pi = [
|
|
2421
2422
|
[
|
|
2422
2423
|
"path",
|
|
2423
2424
|
{
|
|
@@ -2439,7 +2440,7 @@ const Si = [
|
|
|
2439
2440
|
* This source code is licensed under the ISC license.
|
|
2440
2441
|
* See the LICENSE file in the root directory of this source tree.
|
|
2441
2442
|
*/
|
|
2442
|
-
const
|
|
2443
|
+
const Ai = [
|
|
2443
2444
|
[
|
|
2444
2445
|
"path",
|
|
2445
2446
|
{
|
|
@@ -2454,7 +2455,7 @@ const Pi = [
|
|
|
2454
2455
|
* This source code is licensed under the ISC license.
|
|
2455
2456
|
* See the LICENSE file in the root directory of this source tree.
|
|
2456
2457
|
*/
|
|
2457
|
-
const
|
|
2458
|
+
const _t = [
|
|
2458
2459
|
["path", { d: "M12 17v5" }],
|
|
2459
2460
|
[
|
|
2460
2461
|
"path",
|
|
@@ -2469,7 +2470,7 @@ const Ct = [
|
|
|
2469
2470
|
* This source code is licensed under the ISC license.
|
|
2470
2471
|
* See the LICENSE file in the root directory of this source tree.
|
|
2471
2472
|
*/
|
|
2472
|
-
const
|
|
2473
|
+
const Ii = [
|
|
2473
2474
|
[
|
|
2474
2475
|
"path",
|
|
2475
2476
|
{
|
|
@@ -2497,7 +2498,17 @@ const Mi = [
|
|
|
2497
2498
|
* This source code is licensed under the ISC license.
|
|
2498
2499
|
* See the LICENSE file in the root directory of this source tree.
|
|
2499
2500
|
*/
|
|
2500
|
-
const
|
|
2501
|
+
const Oi = [
|
|
2502
|
+
["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" }],
|
|
2503
|
+
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
2504
|
+
];
|
|
2505
|
+
/**
|
|
2506
|
+
* @license lucide v0.577.0 - ISC
|
|
2507
|
+
*
|
|
2508
|
+
* This source code is licensed under the ISC license.
|
|
2509
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
2510
|
+
*/
|
|
2511
|
+
const me = [
|
|
2501
2512
|
["path", { d: "M18 6 6 18" }],
|
|
2502
2513
|
["path", { d: "m6 6 12 12" }]
|
|
2503
2514
|
];
|
|
@@ -2507,7 +2518,7 @@ const fe = [
|
|
|
2507
2518
|
* This source code is licensed under the ISC license.
|
|
2508
2519
|
* See the LICENSE file in the root directory of this source tree.
|
|
2509
2520
|
*/
|
|
2510
|
-
const
|
|
2521
|
+
const Ri = [
|
|
2511
2522
|
[
|
|
2512
2523
|
"path",
|
|
2513
2524
|
{
|
|
@@ -2515,14 +2526,14 @@ const Ii = [
|
|
|
2515
2526
|
}
|
|
2516
2527
|
]
|
|
2517
2528
|
];
|
|
2518
|
-
function
|
|
2529
|
+
function Li(s) {
|
|
2519
2530
|
return s.map(([e, t]) => {
|
|
2520
2531
|
const i = Object.entries(t).filter(([, n]) => n != null).map(([n, o]) => `${n}="${o}"`).join(" ");
|
|
2521
2532
|
return `<${e} ${i}/>`;
|
|
2522
2533
|
}).join("");
|
|
2523
2534
|
}
|
|
2524
|
-
function
|
|
2525
|
-
return
|
|
2535
|
+
function E(s, e = 18) {
|
|
2536
|
+
return Kt`<svg
|
|
2526
2537
|
xmlns="http://www.w3.org/2000/svg"
|
|
2527
2538
|
width="${e}"
|
|
2528
2539
|
height="${e}"
|
|
@@ -2532,9 +2543,9 @@ function C(s, e = 18) {
|
|
|
2532
2543
|
stroke-width="2"
|
|
2533
2544
|
stroke-linecap="round"
|
|
2534
2545
|
stroke-linejoin="round"
|
|
2535
|
-
>${
|
|
2546
|
+
>${ki(Li(s))}</svg>`;
|
|
2536
2547
|
}
|
|
2537
|
-
const ee =
|
|
2548
|
+
const ee = I`
|
|
2538
2549
|
* {
|
|
2539
2550
|
box-sizing: border-box;
|
|
2540
2551
|
margin: 0;
|
|
@@ -2577,7 +2588,7 @@ const ee = M`
|
|
|
2577
2588
|
--pw-shadow: var(--pulse-shadow);
|
|
2578
2589
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2579
2590
|
}
|
|
2580
|
-
`,
|
|
2591
|
+
`, ge = I`
|
|
2581
2592
|
.pw-btn {
|
|
2582
2593
|
display: inline-flex;
|
|
2583
2594
|
align-items: center;
|
|
@@ -2621,7 +2632,7 @@ const ee = M`
|
|
|
2621
2632
|
width: 18px;
|
|
2622
2633
|
height: 18px;
|
|
2623
2634
|
}
|
|
2624
|
-
`, _e =
|
|
2635
|
+
`, _e = I`
|
|
2625
2636
|
.pw-scrollable::-webkit-scrollbar {
|
|
2626
2637
|
width: 4px;
|
|
2627
2638
|
}
|
|
@@ -2633,10 +2644,10 @@ const ee = M`
|
|
|
2633
2644
|
background: transparent;
|
|
2634
2645
|
}
|
|
2635
2646
|
`;
|
|
2636
|
-
var
|
|
2637
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
2647
|
+
var ji = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Fe = (s, e, t, i) => {
|
|
2648
|
+
for (var n = i > 1 ? void 0 : i ? zi(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
2638
2649
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
2639
|
-
return i && n &&
|
|
2650
|
+
return i && n && ji(e, t, n), n;
|
|
2640
2651
|
};
|
|
2641
2652
|
let X = class extends S {
|
|
2642
2653
|
constructor() {
|
|
@@ -2684,18 +2695,18 @@ let X = class extends S {
|
|
|
2684
2695
|
);
|
|
2685
2696
|
}
|
|
2686
2697
|
render() {
|
|
2687
|
-
return
|
|
2698
|
+
return h`
|
|
2688
2699
|
<div class="panel">
|
|
2689
2700
|
<div class="panel-header">
|
|
2690
2701
|
<span class="panel-title">Activity</span>
|
|
2691
2702
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2692
|
-
${
|
|
2703
|
+
${E(me, 16)}
|
|
2693
2704
|
</button>
|
|
2694
2705
|
</div>
|
|
2695
2706
|
|
|
2696
2707
|
<div class="panel-body pw-scrollable">
|
|
2697
|
-
${this.items.length === 0 ?
|
|
2698
|
-
(s) =>
|
|
2708
|
+
${this.items.length === 0 ? h`<div class="empty">No activity yet</div>` : this.items.map(
|
|
2709
|
+
(s) => h`
|
|
2699
2710
|
<div class="activity-item">
|
|
2700
2711
|
<div
|
|
2701
2712
|
class="activity-dot"
|
|
@@ -2703,7 +2714,7 @@ let X = class extends S {
|
|
|
2703
2714
|
></div>
|
|
2704
2715
|
<div class="activity-content">
|
|
2705
2716
|
<div class="activity-text">
|
|
2706
|
-
${s.userId ?
|
|
2717
|
+
${s.userId ? h`<span class="activity-user"
|
|
2707
2718
|
>${this.getUserName(s.userId)}</span
|
|
2708
2719
|
>
|
|
2709
2720
|
${s.description}` : s.description}
|
|
@@ -2722,9 +2733,9 @@ let X = class extends S {
|
|
|
2722
2733
|
};
|
|
2723
2734
|
X.styles = [
|
|
2724
2735
|
ee,
|
|
2725
|
-
|
|
2736
|
+
ge,
|
|
2726
2737
|
_e,
|
|
2727
|
-
|
|
2738
|
+
I`
|
|
2728
2739
|
:host {
|
|
2729
2740
|
display: block;
|
|
2730
2741
|
}
|
|
@@ -2849,17 +2860,17 @@ X.TYPE_COLORS = {
|
|
|
2849
2860
|
comment: "#3b82f6",
|
|
2850
2861
|
resolve: "#22c55e"
|
|
2851
2862
|
};
|
|
2852
|
-
|
|
2863
|
+
Fe([
|
|
2853
2864
|
g({ attribute: !1 })
|
|
2854
2865
|
], X.prototype, "client", 2);
|
|
2855
|
-
|
|
2866
|
+
Fe([
|
|
2856
2867
|
v()
|
|
2857
2868
|
], X.prototype, "items", 2);
|
|
2858
|
-
X =
|
|
2869
|
+
X = Fe([
|
|
2859
2870
|
R("pulse-widget-activity-panel")
|
|
2860
2871
|
], X);
|
|
2861
|
-
const
|
|
2862
|
-
function
|
|
2872
|
+
const Ui = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", ot = "#6366f1", rt = "#e2e8f0", Di = "#f8fafc", Hi = "#e2e8f0", at = "#64748b", xe = 28, Bi = Array.from({ length: xe }, (s, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2873
|
+
function lt(s) {
|
|
2863
2874
|
const e = Math.max(0, Math.floor(s)), t = Math.floor(e / 60), i = e % 60;
|
|
2864
2875
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
2865
2876
|
}
|
|
@@ -2884,12 +2895,12 @@ class Oe {
|
|
|
2884
2895
|
width: "220px",
|
|
2885
2896
|
height: "44px",
|
|
2886
2897
|
padding: "0 10px",
|
|
2887
|
-
background:
|
|
2898
|
+
background: Di,
|
|
2888
2899
|
borderRadius: "12px",
|
|
2889
|
-
border: `1px solid ${
|
|
2890
|
-
fontFamily:
|
|
2900
|
+
border: `1px solid ${Hi}`,
|
|
2901
|
+
fontFamily: Ui,
|
|
2891
2902
|
fontSize: "11px",
|
|
2892
|
-
color:
|
|
2903
|
+
color: at,
|
|
2893
2904
|
userSelect: "none",
|
|
2894
2905
|
boxSizing: "border-box"
|
|
2895
2906
|
});
|
|
@@ -2900,7 +2911,7 @@ class Oe {
|
|
|
2900
2911
|
minWidth: "28px",
|
|
2901
2912
|
borderRadius: "50%",
|
|
2902
2913
|
border: "none",
|
|
2903
|
-
background:
|
|
2914
|
+
background: ot,
|
|
2904
2915
|
cursor: "pointer",
|
|
2905
2916
|
display: "flex",
|
|
2906
2917
|
alignItems: "center",
|
|
@@ -2916,20 +2927,20 @@ class Oe {
|
|
|
2916
2927
|
height: "12px",
|
|
2917
2928
|
lineHeight: "0"
|
|
2918
2929
|
});
|
|
2919
|
-
function
|
|
2930
|
+
function p() {
|
|
2920
2931
|
c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2921
2932
|
<path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
|
|
2922
2933
|
</svg>`;
|
|
2923
2934
|
}
|
|
2924
|
-
function
|
|
2935
|
+
function d() {
|
|
2925
2936
|
c.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2926
2937
|
<rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2927
2938
|
<rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2928
2939
|
</svg>`;
|
|
2929
2940
|
}
|
|
2930
|
-
|
|
2931
|
-
const
|
|
2932
|
-
Object.assign(
|
|
2941
|
+
p(), a.appendChild(c);
|
|
2942
|
+
const u = document.createElement("div");
|
|
2943
|
+
Object.assign(u.style, {
|
|
2933
2944
|
flex: "1",
|
|
2934
2945
|
display: "flex",
|
|
2935
2946
|
flexDirection: "column",
|
|
@@ -2946,13 +2957,13 @@ class Oe {
|
|
|
2946
2957
|
cursor: "pointer"
|
|
2947
2958
|
});
|
|
2948
2959
|
const b = [];
|
|
2949
|
-
for (let k = 0; k <
|
|
2950
|
-
const A = document.createElement("div"), w = Math.round(
|
|
2960
|
+
for (let k = 0; k < xe; k++) {
|
|
2961
|
+
const A = document.createElement("div"), w = Math.round(Bi[k] * 20);
|
|
2951
2962
|
Object.assign(A.style, {
|
|
2952
2963
|
flex: "1",
|
|
2953
2964
|
height: `${Math.max(3, w)}px`,
|
|
2954
2965
|
borderRadius: "1px",
|
|
2955
|
-
background:
|
|
2966
|
+
background: rt,
|
|
2956
2967
|
transition: "background 0.1s ease",
|
|
2957
2968
|
minWidth: "0"
|
|
2958
2969
|
}), b.push(A), f.appendChild(A);
|
|
@@ -2960,19 +2971,19 @@ class Oe {
|
|
|
2960
2971
|
const x = document.createElement("div");
|
|
2961
2972
|
Object.assign(x.style, {
|
|
2962
2973
|
fontSize: "10px",
|
|
2963
|
-
color:
|
|
2974
|
+
color: at,
|
|
2964
2975
|
whiteSpace: "nowrap",
|
|
2965
2976
|
lineHeight: "1"
|
|
2966
2977
|
});
|
|
2967
2978
|
function _() {
|
|
2968
|
-
const k =
|
|
2979
|
+
const k = lt(o), A = lt(n);
|
|
2969
2980
|
x.textContent = `${k} / ${A}`;
|
|
2970
2981
|
}
|
|
2971
|
-
_(),
|
|
2982
|
+
_(), u.appendChild(f), u.appendChild(x), l.appendChild(a), l.appendChild(u);
|
|
2972
2983
|
function $() {
|
|
2973
|
-
const k = n > 0 ? o / n : 0, A = Math.floor(k *
|
|
2974
|
-
for (let w = 0; w <
|
|
2975
|
-
b[w].style.background = w <= A ?
|
|
2984
|
+
const k = n > 0 ? o / n : 0, A = Math.floor(k * xe);
|
|
2985
|
+
for (let w = 0; w < xe; w++)
|
|
2986
|
+
b[w].style.background = w <= A ? ot : rt;
|
|
2976
2987
|
}
|
|
2977
2988
|
return f.addEventListener("click", (k) => {
|
|
2978
2989
|
if (n <= 0) return;
|
|
@@ -2985,11 +2996,11 @@ class Oe {
|
|
|
2985
2996
|
i ? r.pause() : r.play().catch(() => {
|
|
2986
2997
|
});
|
|
2987
2998
|
}), r.addEventListener("play", () => {
|
|
2988
|
-
i = !0,
|
|
2999
|
+
i = !0, d();
|
|
2989
3000
|
}), r.addEventListener("pause", () => {
|
|
2990
|
-
i = !1,
|
|
3001
|
+
i = !1, p();
|
|
2991
3002
|
}), r.addEventListener("ended", () => {
|
|
2992
|
-
i = !1,
|
|
3003
|
+
i = !1, p(), o = 0, $(), _();
|
|
2993
3004
|
}), r.addEventListener("timeupdate", () => {
|
|
2994
3005
|
o = r.currentTime, $(), _();
|
|
2995
3006
|
}), r.addEventListener("loadedmetadata", () => {
|
|
@@ -3023,9 +3034,9 @@ class Re {
|
|
|
3023
3034
|
this.resolve = l;
|
|
3024
3035
|
});
|
|
3025
3036
|
return this.recorder.onstop = () => {
|
|
3026
|
-
var c,
|
|
3037
|
+
var c, p;
|
|
3027
3038
|
const l = ((c = this.recorder) == null ? void 0 : c.mimeType) || i || "audio/webm", a = new Blob(o, { type: l });
|
|
3028
|
-
(
|
|
3039
|
+
(p = this.resolve) == null || p.call(this, a), this.resolve = null, this.cleanupResources();
|
|
3029
3040
|
}, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
|
|
3030
3041
|
this.stopRecording();
|
|
3031
3042
|
}, this.maxDuration), this.animate(), r;
|
|
@@ -3130,8 +3141,8 @@ class Re {
|
|
|
3130
3141
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3131
3142
|
const r = n, l = Math.max(2, t / r * 0.7), a = (t - l * r) / (r - 1 || 1);
|
|
3132
3143
|
for (let c = 0; c < r; c++) {
|
|
3133
|
-
const
|
|
3134
|
-
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(
|
|
3144
|
+
const p = o[c] / 255, d = Math.max(2, p * i * 0.85), u = c * (l + a), f = (i - d) / 2, b = 0.4 + p * 0.6;
|
|
3145
|
+
e.fillStyle = `rgba(99, 102, 241, ${b})`, e.beginPath(), e.roundRect(u, f, l, d, 1), e.fill();
|
|
3135
3146
|
}
|
|
3136
3147
|
}
|
|
3137
3148
|
updateTimer() {
|
|
@@ -3149,22 +3160,22 @@ class Re {
|
|
|
3149
3160
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3150
3161
|
}
|
|
3151
3162
|
}
|
|
3152
|
-
const
|
|
3163
|
+
const ct = 80, Ni = "#e2e8f0", Fi = `
|
|
3153
3164
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3154
3165
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3155
3166
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
3156
|
-
</svg>`,
|
|
3167
|
+
</svg>`, dt = `
|
|
3157
3168
|
<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">
|
|
3158
3169
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3159
3170
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3160
3171
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3161
|
-
</svg>`,
|
|
3172
|
+
</svg>`, qi = `
|
|
3162
3173
|
<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">
|
|
3163
3174
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3164
3175
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
3165
3176
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
3166
3177
|
</svg>`;
|
|
3167
|
-
class
|
|
3178
|
+
class Tt {
|
|
3168
3179
|
/**
|
|
3169
3180
|
* Renders an inline circular video player and returns the root container.
|
|
3170
3181
|
* @param url - Video source URL
|
|
@@ -3176,10 +3187,10 @@ class _t {
|
|
|
3176
3187
|
Object.assign(o.style, {
|
|
3177
3188
|
position: "relative",
|
|
3178
3189
|
display: "inline-block",
|
|
3179
|
-
width: `${
|
|
3180
|
-
height: `${
|
|
3190
|
+
width: `${ct}px`,
|
|
3191
|
+
height: `${ct}px`,
|
|
3181
3192
|
borderRadius: "50%",
|
|
3182
|
-
border: `2px solid ${
|
|
3193
|
+
border: `2px solid ${Ni}`,
|
|
3183
3194
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3184
3195
|
overflow: "hidden",
|
|
3185
3196
|
cursor: "pointer",
|
|
@@ -3209,7 +3220,7 @@ class _t {
|
|
|
3209
3220
|
transition: "opacity 0.25s ease",
|
|
3210
3221
|
opacity: "1",
|
|
3211
3222
|
pointerEvents: "none"
|
|
3212
|
-
}), l.innerHTML =
|
|
3223
|
+
}), l.innerHTML = Fi, o.appendChild(l);
|
|
3213
3224
|
const a = document.createElement("div");
|
|
3214
3225
|
Object.assign(a.style, {
|
|
3215
3226
|
position: "absolute",
|
|
@@ -3224,22 +3235,22 @@ class _t {
|
|
|
3224
3235
|
justifyContent: "center",
|
|
3225
3236
|
pointerEvents: "none",
|
|
3226
3237
|
transition: "opacity 0.2s ease"
|
|
3227
|
-
}), a.innerHTML =
|
|
3238
|
+
}), a.innerHTML = dt, o.appendChild(a);
|
|
3228
3239
|
function c() {
|
|
3229
3240
|
l.style.opacity = i ? "0" : "1";
|
|
3230
3241
|
}
|
|
3231
|
-
function
|
|
3232
|
-
a.style.display = i ? "flex" : "none", a.innerHTML = n ?
|
|
3242
|
+
function p() {
|
|
3243
|
+
a.style.display = i ? "flex" : "none", a.innerHTML = n ? dt : qi;
|
|
3233
3244
|
}
|
|
3234
|
-
return o.addEventListener("click", (
|
|
3235
|
-
|
|
3236
|
-
}), i = !0), c(),
|
|
3245
|
+
return o.addEventListener("click", (d) => {
|
|
3246
|
+
d.stopPropagation(), i ? n ? (r.muted = !1, n = !1) : (r.pause(), i = !1, n = !0, r.muted = !0) : (r.muted = !0, n = !0, r.play().catch(() => {
|
|
3247
|
+
}), i = !0), c(), p();
|
|
3237
3248
|
}), r.addEventListener("pause", () => {
|
|
3238
|
-
i && (i = !1, n = !0, r.muted = !0, c(),
|
|
3249
|
+
i && (i = !1, n = !0, r.muted = !0, c(), p());
|
|
3239
3250
|
}), o;
|
|
3240
3251
|
}
|
|
3241
3252
|
}
|
|
3242
|
-
const
|
|
3253
|
+
const ht = 60, Vi = `
|
|
3243
3254
|
.vr-overlay {
|
|
3244
3255
|
display: flex;
|
|
3245
3256
|
flex-direction: column;
|
|
@@ -3346,14 +3357,14 @@ const dt = 60, Fi = `
|
|
|
3346
3357
|
color: #0f172a;
|
|
3347
3358
|
}
|
|
3348
3359
|
`;
|
|
3349
|
-
function
|
|
3360
|
+
function pt(s) {
|
|
3350
3361
|
return s.toString().padStart(2, "0");
|
|
3351
3362
|
}
|
|
3352
|
-
function
|
|
3363
|
+
function Wi(s) {
|
|
3353
3364
|
const e = Math.floor(s / 60), t = s % 60;
|
|
3354
|
-
return `${
|
|
3365
|
+
return `${pt(e)}:${pt(t)}`;
|
|
3355
3366
|
}
|
|
3356
|
-
function
|
|
3367
|
+
function Xi() {
|
|
3357
3368
|
const s = [
|
|
3358
3369
|
"video/webm;codecs=vp9,opus",
|
|
3359
3370
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3364,7 +3375,7 @@ function Wi() {
|
|
|
3364
3375
|
if (MediaRecorder.isTypeSupported(e)) return e;
|
|
3365
3376
|
return "";
|
|
3366
3377
|
}
|
|
3367
|
-
function
|
|
3378
|
+
function Yi(s) {
|
|
3368
3379
|
return new Promise((e, t) => {
|
|
3369
3380
|
const i = URL.createObjectURL(s), n = document.createElement("video");
|
|
3370
3381
|
n.muted = !0, n.playsInline = !0, n.preload = "auto", n.src = i, n.addEventListener("loadeddata", () => {
|
|
@@ -3383,7 +3394,7 @@ function Vi(s) {
|
|
|
3383
3394
|
}), n.load();
|
|
3384
3395
|
});
|
|
3385
3396
|
}
|
|
3386
|
-
class
|
|
3397
|
+
class Le {
|
|
3387
3398
|
constructor() {
|
|
3388
3399
|
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;
|
|
3389
3400
|
}
|
|
@@ -3400,7 +3411,7 @@ class Xi {
|
|
|
3400
3411
|
}
|
|
3401
3412
|
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(() => {
|
|
3402
3413
|
}));
|
|
3403
|
-
const i =
|
|
3414
|
+
const i = Xi(), n = {};
|
|
3404
3415
|
i && (n.mimeType = i);
|
|
3405
3416
|
const o = new MediaRecorder(t, n);
|
|
3406
3417
|
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
@@ -3408,7 +3419,7 @@ class Xi {
|
|
|
3408
3419
|
}, o.onstop = () => {
|
|
3409
3420
|
this.handleRecordingComplete();
|
|
3410
3421
|
}, o.start(), this.timerInterval = setInterval(() => {
|
|
3411
|
-
this.elapsed++, this.updateTimer(), this.elapsed >=
|
|
3422
|
+
this.elapsed++, this.updateTimer(), this.elapsed >= ht && this.stopRecording();
|
|
3412
3423
|
}, 1e3), new Promise((r) => {
|
|
3413
3424
|
this.resolvePromise = r;
|
|
3414
3425
|
});
|
|
@@ -3425,7 +3436,7 @@ class Xi {
|
|
|
3425
3436
|
}
|
|
3426
3437
|
// ── Private ──
|
|
3427
3438
|
buildUI(e) {
|
|
3428
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3439
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = Vi, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3429
3440
|
const t = document.createElement("div");
|
|
3430
3441
|
t.className = "vr-circle-wrapper";
|
|
3431
3442
|
const i = document.createElement("div");
|
|
@@ -3441,15 +3452,15 @@ class Xi {
|
|
|
3441
3452
|
}
|
|
3442
3453
|
updateTimer() {
|
|
3443
3454
|
if (!this.timerEl) return;
|
|
3444
|
-
const e =
|
|
3445
|
-
this.timerEl.textContent =
|
|
3455
|
+
const e = ht - this.elapsed;
|
|
3456
|
+
this.timerEl.textContent = Wi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3446
3457
|
}
|
|
3447
3458
|
async handleRecordingComplete() {
|
|
3448
3459
|
var n, o;
|
|
3449
3460
|
const e = ((n = this.mediaRecorder) == null ? void 0 : n.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3450
3461
|
let i;
|
|
3451
3462
|
try {
|
|
3452
|
-
i = await
|
|
3463
|
+
i = await Yi(t);
|
|
3453
3464
|
} catch {
|
|
3454
3465
|
const r = document.createElement("canvas");
|
|
3455
3466
|
r.width = 1, r.height = 1, i = await new Promise((l) => {
|
|
@@ -3551,8 +3562,8 @@ const T = class T {
|
|
|
3551
3562
|
}
|
|
3552
3563
|
};
|
|
3553
3564
|
T.overlay = null, T.onKeyDown = null;
|
|
3554
|
-
let
|
|
3555
|
-
class
|
|
3565
|
+
let ke = T;
|
|
3566
|
+
class ne {
|
|
3556
3567
|
constructor(e) {
|
|
3557
3568
|
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);
|
|
3558
3569
|
}
|
|
@@ -3608,7 +3619,7 @@ class ke {
|
|
|
3608
3619
|
this.input.remove();
|
|
3609
3620
|
}
|
|
3610
3621
|
}
|
|
3611
|
-
const
|
|
3622
|
+
const Ki = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], be = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", Gi = '<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>', Zi = '<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>', ut = `<button class="pulse-close-btn" style="
|
|
3612
3623
|
border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
|
|
3613
3624
|
border-radius:6px;display:flex;align-items:center;justify-content:center;
|
|
3614
3625
|
transition:all 0.15s;flex-shrink:0;
|
|
@@ -3752,11 +3763,11 @@ class Ji {
|
|
|
3752
3763
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3753
3764
|
border: "1px solid #e2e8f0",
|
|
3754
3765
|
padding: "14px",
|
|
3755
|
-
fontFamily:
|
|
3766
|
+
fontFamily: be
|
|
3756
3767
|
}), this.form.innerHTML = `
|
|
3757
3768
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
|
|
3758
3769
|
<span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
|
|
3759
|
-
${
|
|
3770
|
+
${ut}
|
|
3760
3771
|
</div>
|
|
3761
3772
|
<textarea
|
|
3762
3773
|
placeholder="Write a comment..."
|
|
@@ -3793,43 +3804,43 @@ class Ji {
|
|
|
3793
3804
|
</div>
|
|
3794
3805
|
<div class="pin-attachments-preview" style="margin-top:6px;"></div>
|
|
3795
3806
|
`;
|
|
3796
|
-
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"),
|
|
3797
|
-
c.addEventListener("click", () => this.exitPinMode()),
|
|
3798
|
-
const
|
|
3807
|
+
const a = this.form.querySelector("textarea"), c = this.form.querySelector(".pulse-close-btn"), p = this.form.querySelector(".pin-cancel"), d = this.form.querySelector(".pin-submit");
|
|
3808
|
+
c.addEventListener("click", () => this.exitPinMode()), p.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new ne(this.client));
|
|
3809
|
+
const u = this.form.querySelector(".pin-attachments-preview");
|
|
3799
3810
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
3800
3811
|
const f = await this.upload.pickFile("image/*");
|
|
3801
3812
|
if (f) {
|
|
3802
3813
|
this.pendingAttachmentIds.push(f.id);
|
|
3803
3814
|
const b = document.createElement("img");
|
|
3804
|
-
b.src = f.thumbnailUrl || f.url, Object.assign(b.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0" }),
|
|
3815
|
+
b.src = f.thumbnailUrl || f.url, Object.assign(b.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0" }), u.appendChild(b);
|
|
3805
3816
|
}
|
|
3806
3817
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
3807
3818
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
3808
|
-
const f = await this.audioRecorder.startRecording(
|
|
3819
|
+
const f = await this.audioRecorder.startRecording(u);
|
|
3809
3820
|
if (f) {
|
|
3810
3821
|
const b = await this.upload.uploadBlob(f, "audio.webm");
|
|
3811
3822
|
if (b) {
|
|
3812
3823
|
this.pendingAttachmentIds.push(b.id);
|
|
3813
3824
|
const x = document.createElement("span");
|
|
3814
|
-
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎤 Audio attached",
|
|
3825
|
+
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎤 Audio attached", u.appendChild(x);
|
|
3815
3826
|
}
|
|
3816
3827
|
}
|
|
3817
3828
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
3818
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
3819
|
-
const f = await this.videoRecorder.startRecording(
|
|
3829
|
+
this.videoRecorder || (this.videoRecorder = new Le());
|
|
3830
|
+
const f = await this.videoRecorder.startRecording(u);
|
|
3820
3831
|
if (f) {
|
|
3821
3832
|
const b = await this.upload.uploadBlob(f.blob, "video.webm");
|
|
3822
3833
|
if (b) {
|
|
3823
3834
|
this.pendingAttachmentIds.push(b.id);
|
|
3824
3835
|
const x = document.createElement("span");
|
|
3825
|
-
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎥 Video attached",
|
|
3836
|
+
Object.assign(x.style, { display: "inline-block", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b" }), x.textContent = "🎥 Video attached", u.appendChild(x);
|
|
3826
3837
|
}
|
|
3827
3838
|
}
|
|
3828
|
-
}),
|
|
3839
|
+
}), d.addEventListener("click", () => {
|
|
3829
3840
|
const f = a.value.trim();
|
|
3830
3841
|
if (!f && this.pendingAttachmentIds.length === 0) return;
|
|
3831
3842
|
const b = [...(f || "").matchAll(/@(\w+)/g)].map((x) => x[1]);
|
|
3832
|
-
this.client.createThread(f || "(attachment)", { position: i, mentions: b }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3843
|
+
this.client.createThread(f || "(attachment)", { position: i, mentions: b, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
3833
3844
|
}), a.addEventListener("keydown", (f) => {
|
|
3834
3845
|
f.key === "Escape" && this.exitPinMode(), f.stopPropagation();
|
|
3835
3846
|
}), document.body.appendChild(this.form), requestAnimationFrame(() => a.focus());
|
|
@@ -3850,7 +3861,7 @@ class Ji {
|
|
|
3850
3861
|
borderRadius: i ? "16px 16px 0 0" : "12px",
|
|
3851
3862
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3852
3863
|
border: "1px solid #e2e8f0",
|
|
3853
|
-
fontFamily:
|
|
3864
|
+
fontFamily: be,
|
|
3854
3865
|
display: "flex",
|
|
3855
3866
|
flexDirection: "column",
|
|
3856
3867
|
overflow: "hidden",
|
|
@@ -3867,7 +3878,7 @@ class Ji {
|
|
|
3867
3878
|
flexShrink: "0"
|
|
3868
3879
|
}), a.innerHTML = `
|
|
3869
3880
|
<span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
|
|
3870
|
-
${
|
|
3881
|
+
${ut}
|
|
3871
3882
|
`, a.querySelector(".pulse-close-btn").addEventListener("click", () => {
|
|
3872
3883
|
this.closePopover();
|
|
3873
3884
|
}), this.popover.appendChild(a), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
|
|
@@ -3895,13 +3906,13 @@ class Ji {
|
|
|
3895
3906
|
}
|
|
3896
3907
|
const i = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
3897
3908
|
t.innerHTML = e.comments.map((a) => {
|
|
3898
|
-
const c = this.client.state.getUser(a.userId),
|
|
3909
|
+
const c = this.client.state.getUser(a.userId), p = c ? c.name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2) : "?", d = (c == null ? void 0 : c.color) ?? "#94a3b8", u = this.escapeHtml((c == null ? void 0 : c.name) ?? "Unknown"), f = this.formatTime(a.createdAt), b = i === a.userId, x = a.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
3899
3910
|
if (this.editingPopoverCommentId === a.id)
|
|
3900
3911
|
return `
|
|
3901
3912
|
<div style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
3902
3913
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
|
|
3903
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
3904
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
3914
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${d};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
3915
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
|
|
3905
3916
|
</div>
|
|
3906
3917
|
<div style="margin-left:29px;">
|
|
3907
3918
|
<textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(a.body)}</textarea>
|
|
@@ -3917,25 +3928,25 @@ class Ji {
|
|
|
3917
3928
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
3918
3929
|
), $ = (a.attachments ?? []).map((w) => {
|
|
3919
3930
|
if (w.type === "image") {
|
|
3920
|
-
const
|
|
3931
|
+
const Pt = w.thumbnailUrl || w.url;
|
|
3921
3932
|
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(w.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
3922
|
-
<img src="${this.escapeHtml(
|
|
3933
|
+
<img src="${this.escapeHtml(Pt)}" alt="${this.escapeHtml(w.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
3923
3934
|
</div>`;
|
|
3924
3935
|
}
|
|
3925
3936
|
return w.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(w.url)}" data-duration="${w.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : w.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(w.url)}" data-poster="${this.escapeHtml(w.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
3926
3937
|
}).join(""), k = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
3927
3938
|
<button class="edit-btn" data-comment-id="${a.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
|
|
3928
3939
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
3929
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
3940
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Gi}</button>
|
|
3930
3941
|
<button class="delete-btn" data-comment-id="${a.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Delete"
|
|
3931
3942
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
3932
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
3943
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${Zi}</button>
|
|
3933
3944
|
</div>` : "", A = this.buildReactionPillsHtml(a.id);
|
|
3934
3945
|
return `
|
|
3935
3946
|
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${a.id}">
|
|
3936
3947
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
3937
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
3938
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
3948
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${d};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
3949
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${u}</span>
|
|
3939
3950
|
<span style="font-size:10px;color:#94a3b8;">${f}</span>
|
|
3940
3951
|
${x}
|
|
3941
3952
|
</div>
|
|
@@ -3960,7 +3971,7 @@ class Ji {
|
|
|
3960
3971
|
n && r && n.addEventListener("click", () => {
|
|
3961
3972
|
const a = r.value.trim();
|
|
3962
3973
|
if (!a) return;
|
|
3963
|
-
const c = [...a.matchAll(/@(\w+)/g)].map((
|
|
3974
|
+
const c = [...a.matchAll(/@(\w+)/g)].map((p) => p[1]);
|
|
3964
3975
|
this.client.editComment(
|
|
3965
3976
|
this.editingPopoverCommentId,
|
|
3966
3977
|
a,
|
|
@@ -3971,31 +3982,31 @@ class Ji {
|
|
|
3971
3982
|
}), t.querySelectorAll("[data-reaction-emoji]").forEach((a) => {
|
|
3972
3983
|
a.addEventListener("click", (c) => {
|
|
3973
3984
|
c.stopPropagation();
|
|
3974
|
-
const
|
|
3975
|
-
|
|
3985
|
+
const p = a.dataset.reactionEmoji, d = a.dataset.reactionTarget, u = a.dataset.reactionId;
|
|
3986
|
+
u ? this.client.removeReaction(u) : this.client.addReaction(d, "comment", p);
|
|
3976
3987
|
});
|
|
3977
3988
|
}), t.querySelectorAll(".popover-reaction-add").forEach((a) => {
|
|
3978
3989
|
a.addEventListener("click", (c) => {
|
|
3979
3990
|
c.stopPropagation();
|
|
3980
|
-
const
|
|
3981
|
-
this.popoverPickerOpen ===
|
|
3991
|
+
const p = a.dataset.commentId;
|
|
3992
|
+
this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(a, p));
|
|
3982
3993
|
});
|
|
3983
3994
|
}), t.querySelectorAll(".popover-attachment-img").forEach((a) => {
|
|
3984
3995
|
a.addEventListener("click", () => {
|
|
3985
3996
|
const c = a.dataset.fullUrl;
|
|
3986
|
-
c &&
|
|
3997
|
+
c && ke.open(c);
|
|
3987
3998
|
});
|
|
3988
3999
|
}), t.querySelectorAll(".popover-attachment-audio").forEach((a) => {
|
|
3989
4000
|
const c = a.dataset.url;
|
|
3990
4001
|
if (c) {
|
|
3991
|
-
const
|
|
3992
|
-
a.appendChild(
|
|
4002
|
+
const p = a.dataset.duration ? parseInt(a.dataset.duration) : void 0, d = Oe.render(c, p);
|
|
4003
|
+
a.appendChild(d);
|
|
3993
4004
|
}
|
|
3994
4005
|
}), t.querySelectorAll(".popover-attachment-video").forEach((a) => {
|
|
3995
4006
|
const c = a.dataset.url;
|
|
3996
4007
|
if (c) {
|
|
3997
|
-
const
|
|
3998
|
-
a.appendChild(
|
|
4008
|
+
const p = a.dataset.poster || void 0, d = Tt.render(c, p);
|
|
4009
|
+
a.appendChild(d);
|
|
3999
4010
|
}
|
|
4000
4011
|
}), t.scrollTop = t.scrollHeight;
|
|
4001
4012
|
}
|
|
@@ -4004,43 +4015,63 @@ class Ji {
|
|
|
4004
4015
|
const t = document.createElement("div");
|
|
4005
4016
|
Object.assign(t.style, {
|
|
4006
4017
|
padding: "8px 14px 12px",
|
|
4007
|
-
borderTop: "1px solid #f1f5f9"
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
<div style="display:flex;gap:6px;
|
|
4018
|
+
borderTop: "1px solid #f1f5f9"
|
|
4019
|
+
});
|
|
4020
|
+
const i = "border:none;background:none;cursor:pointer;color:#94a3b8;padding:6px;border-radius:6px;display:flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;transition:all 0.15s;", n = 'width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"';
|
|
4021
|
+
t.innerHTML = `
|
|
4022
|
+
<div style="display:flex;align-items:center;gap:4px;margin-bottom:6px;">
|
|
4012
4023
|
<input type="text" placeholder="Reply..."
|
|
4013
|
-
style="flex:1;padding:
|
|
4014
|
-
<
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
<
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4024
|
+
style="flex:1;padding:8px 12px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:13px;font-family:inherit;outline:none;color:#0f172a;min-width:0;min-height:36px;transition:border-color 0.15s;" />
|
|
4025
|
+
<button class="reply-send" style="padding:8px 14px;background:#6366f1;color:#fff;border:none;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;white-space:nowrap;flex-shrink:0;min-height:36px;transition:background 0.15s;" onmouseover="this.style.background='#4f46e5'" onmouseout="this.style.background='#6366f1'">Send</button>
|
|
4026
|
+
</div>
|
|
4027
|
+
<div style="display:flex;align-items:center;gap:2px;">
|
|
4028
|
+
<button class="reply-attach-img" title="Attach image" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4029
|
+
<svg ${n}><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>
|
|
4030
|
+
</button>
|
|
4031
|
+
<button class="reply-attach-mic" title="Record audio" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4032
|
+
<svg ${n}><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/><path d="M19 10v2a7 7 0 0 1-14 0v-2"/><line x1="12" x2="12" y1="19" y2="22"/></svg>
|
|
4033
|
+
</button>
|
|
4034
|
+
<button class="reply-attach-video" title="Record video" style="${i}" onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'" onmouseout="this.style.color='#94a3b8';this.style.background='none'">
|
|
4035
|
+
<svg ${n}><path d="m22 8-6 4 6 4V8Z"/><rect width="14" height="12" x="2" y="6" rx="2" ry="2"/></svg>
|
|
4036
|
+
</button>
|
|
4037
|
+
<div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
|
|
4023
4038
|
</div>
|
|
4024
4039
|
`;
|
|
4025
|
-
const
|
|
4026
|
-
this.upload || (this.upload = new
|
|
4027
|
-
|
|
4040
|
+
const o = t.querySelector("input"), r = t.querySelector(".reply-send"), l = t.querySelector(".reply-attachments-preview");
|
|
4041
|
+
this.upload || (this.upload = new ne(this.client));
|
|
4042
|
+
const a = [], c = (d) => {
|
|
4043
|
+
const u = document.createElement("span");
|
|
4044
|
+
Object.assign(u.style, { display: "inline-block", padding: "2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), u.textContent = d, l.appendChild(u);
|
|
4045
|
+
};
|
|
4046
|
+
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4047
|
+
const d = await this.upload.pickFile("image/*");
|
|
4048
|
+
d && (a.push(d.id), c("📎 Image"));
|
|
4028
4049
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4029
4050
|
this.audioRecorder || (this.audioRecorder = new Re());
|
|
4030
|
-
const
|
|
4031
|
-
|
|
4051
|
+
const d = await this.audioRecorder.startRecording(t);
|
|
4052
|
+
if (d) {
|
|
4053
|
+
const u = await this.upload.uploadBlob(d, "audio.webm");
|
|
4054
|
+
u && (a.push(u.id), c("🎤 Audio"));
|
|
4055
|
+
}
|
|
4056
|
+
}), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
|
|
4057
|
+
this.videoRecorder || (this.videoRecorder = new Le());
|
|
4058
|
+
const d = await this.videoRecorder.startRecording(t);
|
|
4059
|
+
if (d) {
|
|
4060
|
+
const u = await this.upload.uploadBlob(d.blob, "video.webm");
|
|
4061
|
+
u && (a.push(u.id), c("🎥 Video"));
|
|
4062
|
+
}
|
|
4032
4063
|
});
|
|
4033
|
-
const
|
|
4034
|
-
const
|
|
4035
|
-
if (!
|
|
4036
|
-
const
|
|
4037
|
-
this.client.reply(e.id,
|
|
4064
|
+
const p = () => {
|
|
4065
|
+
const d = o.value.trim();
|
|
4066
|
+
if (!d && a.length === 0) return;
|
|
4067
|
+
const u = [...(d || "").matchAll(/@(\w+)/g)].map((f) => f[1]);
|
|
4068
|
+
this.client.reply(e.id, d || "(attachment)", u, a.length > 0 ? [...a] : void 0), o.value = "", a.length = 0, l.innerHTML = "";
|
|
4038
4069
|
};
|
|
4039
|
-
|
|
4040
|
-
const
|
|
4041
|
-
|
|
4042
|
-
}),
|
|
4043
|
-
|
|
4070
|
+
r.addEventListener("click", p), o.addEventListener("input", () => {
|
|
4071
|
+
const d = Date.now(), u = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4072
|
+
d - u >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, d));
|
|
4073
|
+
}), o.addEventListener("keydown", (d) => {
|
|
4074
|
+
d.key === "Enter" && (d.preventDefault(), p()), d.key === "Escape" && this.closePopover(), d.stopPropagation();
|
|
4044
4075
|
}), this.popover.appendChild(t);
|
|
4045
4076
|
}
|
|
4046
4077
|
removePickerEl() {
|
|
@@ -4063,9 +4094,9 @@ class Ji {
|
|
|
4063
4094
|
borderRadius: "8px",
|
|
4064
4095
|
boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
|
|
4065
4096
|
zIndex: "10002",
|
|
4066
|
-
fontFamily:
|
|
4097
|
+
fontFamily: be
|
|
4067
4098
|
});
|
|
4068
|
-
for (const n of
|
|
4099
|
+
for (const n of Ki) {
|
|
4069
4100
|
const o = document.createElement("button");
|
|
4070
4101
|
Object.assign(o.style, {
|
|
4071
4102
|
border: "none",
|
|
@@ -4079,8 +4110,8 @@ class Ji {
|
|
|
4079
4110
|
r.stopPropagation();
|
|
4080
4111
|
const a = this.client.state.getReactions(t).find(
|
|
4081
4112
|
(c) => {
|
|
4082
|
-
var
|
|
4083
|
-
return c.emoji === n && c.userId === ((
|
|
4113
|
+
var p;
|
|
4114
|
+
return c.emoji === n && c.userId === ((p = this.client.state.user) == null ? void 0 : p.id);
|
|
4084
4115
|
}
|
|
4085
4116
|
);
|
|
4086
4117
|
a ? this.client.removeReaction(a.id) : this.client.addReaction(t, "comment", n), this.popoverPickerOpen = null, this.removePickerEl();
|
|
@@ -4092,15 +4123,15 @@ class Ji {
|
|
|
4092
4123
|
var a;
|
|
4093
4124
|
const t = this.client.state.getReactions(e), i = (a = this.client.state.user) == null ? void 0 : a.id, n = /* @__PURE__ */ new Map();
|
|
4094
4125
|
for (const c of t) {
|
|
4095
|
-
const
|
|
4096
|
-
|
|
4126
|
+
const p = n.get(c.emoji) ?? { count: 0, ownId: null };
|
|
4127
|
+
p.count++, c.userId === i && (p.ownId = c.id), n.set(c.emoji, p);
|
|
4097
4128
|
}
|
|
4098
4129
|
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;";
|
|
4099
4130
|
let l = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4100
|
-
for (const [c, { count:
|
|
4101
|
-
const
|
|
4102
|
-
l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${
|
|
4103
|
-
<span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${
|
|
4131
|
+
for (const [c, { count: p, ownId: d }] of n) {
|
|
4132
|
+
const u = d ? r : o;
|
|
4133
|
+
l += `<button data-reaction-emoji="${c}" data-reaction-target="${e}" ${d ? `data-reaction-id="${d}"` : ""} style="${u}">
|
|
4134
|
+
<span>${c}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${p}</span>
|
|
4104
4135
|
</button>`;
|
|
4105
4136
|
}
|
|
4106
4137
|
return l += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, l += "</div>", l;
|
|
@@ -4175,7 +4206,7 @@ class Ji {
|
|
|
4175
4206
|
justifyContent: "center",
|
|
4176
4207
|
fontSize: "11px",
|
|
4177
4208
|
fontWeight: "700",
|
|
4178
|
-
fontFamily:
|
|
4209
|
+
fontFamily: be,
|
|
4179
4210
|
cursor: "pointer",
|
|
4180
4211
|
pointerEvents: "auto",
|
|
4181
4212
|
boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
|
|
@@ -4200,15 +4231,15 @@ class Ji {
|
|
|
4200
4231
|
});
|
|
4201
4232
|
}
|
|
4202
4233
|
}
|
|
4203
|
-
var
|
|
4204
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
4234
|
+
var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, j = (s, e, t, i) => {
|
|
4235
|
+
for (var n = i > 1 ? void 0 : i ? es(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
4205
4236
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
4206
|
-
return i && n &&
|
|
4237
|
+
return i && n && Qi(e, t, n), n;
|
|
4207
4238
|
};
|
|
4208
|
-
const
|
|
4239
|
+
const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4209
4240
|
let O = class extends S {
|
|
4210
4241
|
constructor() {
|
|
4211
|
-
super(...arguments), this.highlightThreadId = null, this.threads = [], 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();
|
|
4242
|
+
super(...arguments), this.highlightThreadId = null, this.threads = [], 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 = [];
|
|
4212
4243
|
}
|
|
4213
4244
|
connectedCallback() {
|
|
4214
4245
|
super.connectedCallback(), this.ensureListener();
|
|
@@ -4216,9 +4247,12 @@ let O = class extends S {
|
|
|
4216
4247
|
disconnectedCallback() {
|
|
4217
4248
|
super.disconnectedCallback(), this.teardownListeners();
|
|
4218
4249
|
}
|
|
4250
|
+
willUpdate(s) {
|
|
4251
|
+
this.client && !this.unsub && this.ensureListener();
|
|
4252
|
+
}
|
|
4219
4253
|
updated(s) {
|
|
4220
4254
|
var e, t;
|
|
4221
|
-
|
|
4255
|
+
(e = this.shadowRoot) == null || e.querySelectorAll(".audio-player-host").forEach((i) => {
|
|
4222
4256
|
if (i.children.length > 0) return;
|
|
4223
4257
|
const n = i.dataset.url;
|
|
4224
4258
|
if (n) {
|
|
@@ -4228,7 +4262,7 @@ let O = class extends S {
|
|
|
4228
4262
|
}), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
|
|
4229
4263
|
if (i.children.length > 0) return;
|
|
4230
4264
|
const n = i.dataset.url;
|
|
4231
|
-
n && i.appendChild(
|
|
4265
|
+
n && i.appendChild(Tt.render(n, i.dataset.poster || void 0));
|
|
4232
4266
|
});
|
|
4233
4267
|
}
|
|
4234
4268
|
teardownListeners() {
|
|
@@ -4294,7 +4328,7 @@ let O = class extends S {
|
|
|
4294
4328
|
}
|
|
4295
4329
|
parseMentions(s) {
|
|
4296
4330
|
return s.split(/(@\w+)/g).map(
|
|
4297
|
-
(t) => t.startsWith("@") ?
|
|
4331
|
+
(t) => t.startsWith("@") ? h`<span class="mention">${t}</span>` : t
|
|
4298
4332
|
);
|
|
4299
4333
|
}
|
|
4300
4334
|
getInitials(s) {
|
|
@@ -4310,21 +4344,35 @@ let O = class extends S {
|
|
|
4310
4344
|
const o = Math.floor(n / 60);
|
|
4311
4345
|
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
4312
4346
|
}
|
|
4313
|
-
async handleAttachImage(
|
|
4314
|
-
this.upload || (this.upload = new
|
|
4347
|
+
async handleAttachImage() {
|
|
4348
|
+
this.upload || (this.upload = new ne(this.client));
|
|
4349
|
+
const s = await this.upload.pickFile("image/*");
|
|
4350
|
+
s && (this.replyAttachmentIds.push(s.id), this.requestUpdate());
|
|
4315
4351
|
}
|
|
4316
4352
|
async handleRecordAudio(s) {
|
|
4317
4353
|
var i;
|
|
4318
|
-
this.upload || (this.upload = new
|
|
4354
|
+
this.upload || (this.upload = new ne(this.client)), this.audioRecorder || (this.audioRecorder = new Re());
|
|
4319
4355
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${s}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4320
|
-
|
|
4356
|
+
if (t) {
|
|
4357
|
+
const n = await this.upload.uploadBlob(t, "audio.webm");
|
|
4358
|
+
n && (this.replyAttachmentIds.push(n.id), this.requestUpdate());
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
async handleRecordVideo(s) {
|
|
4362
|
+
var i;
|
|
4363
|
+
this.upload || (this.upload = new ne(this.client)), this.videoRecorder || (this.videoRecorder = new Le());
|
|
4364
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${s}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4365
|
+
if (t) {
|
|
4366
|
+
const n = await this.upload.uploadBlob(t.blob, "video.webm");
|
|
4367
|
+
n && (this.replyAttachmentIds.push(n.id), this.requestUpdate());
|
|
4368
|
+
}
|
|
4321
4369
|
}
|
|
4322
4370
|
handleReply(s, e) {
|
|
4323
4371
|
e.preventDefault();
|
|
4324
4372
|
const i = e.target.querySelector("input"), n = i.value.trim();
|
|
4325
|
-
if (!n) return;
|
|
4326
|
-
const o = [...n.matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4327
|
-
this.client.reply(s, n, o), i.value = "", this.replyingTo = null;
|
|
4373
|
+
if (!n && this.replyAttachmentIds.length === 0) return;
|
|
4374
|
+
const o = [...(n || "").matchAll(/@(\w+)/g)].map((r) => r[1]);
|
|
4375
|
+
this.client.reply(s, n || "(attachment)", o, this.replyAttachmentIds.length > 0 ? [...this.replyAttachmentIds] : void 0), i.value = "", this.replyAttachmentIds = [], this.replyingTo = null;
|
|
4328
4376
|
}
|
|
4329
4377
|
isOwnComment(s) {
|
|
4330
4378
|
var e, t;
|
|
@@ -4346,7 +4394,7 @@ let O = class extends S {
|
|
|
4346
4394
|
this.client.deleteComment(s);
|
|
4347
4395
|
}
|
|
4348
4396
|
renderEditForm(s) {
|
|
4349
|
-
return
|
|
4397
|
+
return h`
|
|
4350
4398
|
<div class="edit-form">
|
|
4351
4399
|
<textarea
|
|
4352
4400
|
.value=${this.editBody}
|
|
@@ -4367,12 +4415,12 @@ let O = class extends S {
|
|
|
4367
4415
|
const e = this.client.state.getReactions(s.id), t = (n = this.client.state.user) == null ? void 0 : n.id, i = /* @__PURE__ */ new Map();
|
|
4368
4416
|
for (const o of e)
|
|
4369
4417
|
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4370
|
-
return
|
|
4418
|
+
return h`
|
|
4371
4419
|
<div class="comment-reactions">
|
|
4372
4420
|
${[...i.entries()].map(
|
|
4373
4421
|
([o, r]) => {
|
|
4374
4422
|
const l = r.some((a) => a.userId === t);
|
|
4375
|
-
return
|
|
4423
|
+
return h`
|
|
4376
4424
|
<button
|
|
4377
4425
|
class="reaction-pill ${l ? "own" : ""}"
|
|
4378
4426
|
@click=${() => this.toggleReaction(s.id, o)}
|
|
@@ -4391,26 +4439,26 @@ let O = class extends S {
|
|
|
4391
4439
|
title="Add reaction"
|
|
4392
4440
|
>
|
|
4393
4441
|
+
|
|
4394
|
-
${this.pickerOpenForComment === s.id ?
|
|
4442
|
+
${this.pickerOpenForComment === s.id ? h`
|
|
4395
4443
|
<div class="emoji-picker">
|
|
4396
|
-
${
|
|
4397
|
-
(o) =>
|
|
4444
|
+
${ts.map(
|
|
4445
|
+
(o) => h`
|
|
4398
4446
|
<button @click=${(r) => {
|
|
4399
4447
|
r.stopPropagation(), this.toggleReaction(s.id, o);
|
|
4400
4448
|
}}>${o}</button>
|
|
4401
4449
|
`
|
|
4402
4450
|
)}
|
|
4403
4451
|
</div>
|
|
4404
|
-
` :
|
|
4452
|
+
` : m}
|
|
4405
4453
|
</button>
|
|
4406
4454
|
</div>
|
|
4407
4455
|
`;
|
|
4408
4456
|
}
|
|
4409
4457
|
renderTypingIndicator(s) {
|
|
4410
4458
|
const e = this.typingByThread.get(s) ?? [];
|
|
4411
|
-
if (e.length === 0) return
|
|
4459
|
+
if (e.length === 0) return m;
|
|
4412
4460
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4413
|
-
return
|
|
4461
|
+
return h`<div class="typing-indicator">${t}</div>`;
|
|
4414
4462
|
}
|
|
4415
4463
|
sortedThreads() {
|
|
4416
4464
|
return [...this.threads].sort((s, e) => {
|
|
@@ -4421,7 +4469,7 @@ let O = class extends S {
|
|
|
4421
4469
|
}
|
|
4422
4470
|
render() {
|
|
4423
4471
|
const s = this.sortedThreads();
|
|
4424
|
-
return
|
|
4472
|
+
return h`
|
|
4425
4473
|
<div class="panel">
|
|
4426
4474
|
<div class="panel-header">
|
|
4427
4475
|
<span class="panel-title">
|
|
@@ -4429,12 +4477,12 @@ let O = class extends S {
|
|
|
4429
4477
|
<span class="thread-count">${this.threads.length}</span>
|
|
4430
4478
|
</span>
|
|
4431
4479
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4432
|
-
${
|
|
4480
|
+
${E(me, 16)}
|
|
4433
4481
|
</button>
|
|
4434
4482
|
</div>
|
|
4435
4483
|
|
|
4436
4484
|
<div class="panel-body pw-scrollable">
|
|
4437
|
-
${s.length === 0 ?
|
|
4485
|
+
${s.length === 0 ? h`<div class="empty">
|
|
4438
4486
|
<div class="empty-icon">💬</div>
|
|
4439
4487
|
No comments yet
|
|
4440
4488
|
</div>` : s.map((e) => this.renderThread(e))}
|
|
@@ -4447,55 +4495,55 @@ let O = class extends S {
|
|
|
4447
4495
|
`;
|
|
4448
4496
|
}
|
|
4449
4497
|
renderAttachments(s) {
|
|
4450
|
-
return !s || s.length === 0 ?
|
|
4498
|
+
return !s || s.length === 0 ? m : h`
|
|
4451
4499
|
${s.map((e) => {
|
|
4452
4500
|
if (e.type === "image") {
|
|
4453
4501
|
const t = e.thumbnailUrl || e.url;
|
|
4454
|
-
return
|
|
4502
|
+
return h`
|
|
4455
4503
|
<div class="comment-attachment-media">
|
|
4456
4504
|
<img
|
|
4457
4505
|
class="comment-attachment-img"
|
|
4458
4506
|
src=${t}
|
|
4459
4507
|
alt=${e.filename}
|
|
4460
|
-
@click=${() =>
|
|
4508
|
+
@click=${() => ke.open(e.url)}
|
|
4461
4509
|
/>
|
|
4462
4510
|
</div>
|
|
4463
4511
|
`;
|
|
4464
4512
|
}
|
|
4465
|
-
return e.type === "audio" ?
|
|
4513
|
+
return e.type === "audio" ? h`
|
|
4466
4514
|
<div class="comment-attachment-media" id="audio-${e.id}">
|
|
4467
4515
|
${this.renderAudioPlayer(e)}
|
|
4468
4516
|
</div>
|
|
4469
|
-
` : e.type === "video" ?
|
|
4517
|
+
` : e.type === "video" ? h`
|
|
4470
4518
|
<div class="comment-attachment-media" id="video-${e.id}">
|
|
4471
4519
|
${this.renderVideoPlayer(e)}
|
|
4472
4520
|
</div>
|
|
4473
|
-
` :
|
|
4521
|
+
` : m;
|
|
4474
4522
|
})}
|
|
4475
4523
|
`;
|
|
4476
4524
|
}
|
|
4477
4525
|
renderAudioPlayer(s) {
|
|
4478
4526
|
const e = document.createElement("div"), t = Oe.render(s.url, s.durationMs);
|
|
4479
|
-
return e.appendChild(t),
|
|
4527
|
+
return e.appendChild(t), h`<div class="audio-player-host" data-url=${s.url} data-duration=${s.durationMs ?? ""}></div>`;
|
|
4480
4528
|
}
|
|
4481
4529
|
renderVideoPlayer(s) {
|
|
4482
|
-
return
|
|
4530
|
+
return h`<div class="video-player-host" data-url=${s.url} data-poster=${s.thumbnailUrl ?? ""}></div>`;
|
|
4483
4531
|
}
|
|
4484
4532
|
renderThread(s) {
|
|
4485
4533
|
const e = this.highlightThreadId === s.id;
|
|
4486
|
-
return
|
|
4534
|
+
return h`
|
|
4487
4535
|
<div
|
|
4488
4536
|
class="thread ${s.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
|
|
4489
4537
|
data-thread-id=${s.id}
|
|
4490
4538
|
>
|
|
4491
|
-
${s.position ?
|
|
4492
|
-
${
|
|
4539
|
+
${s.position ? h`<div class="pin-badge">
|
|
4540
|
+
${E(_t, 12)}
|
|
4493
4541
|
Pinned
|
|
4494
|
-
</div>` :
|
|
4542
|
+
</div>` : m}
|
|
4495
4543
|
${s.comments.map((t, i) => {
|
|
4496
4544
|
const n = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4497
|
-
return
|
|
4498
|
-
${i > 0 ?
|
|
4545
|
+
return h`
|
|
4546
|
+
${i > 0 ? h`<div class="comment-divider"></div>` : m}
|
|
4499
4547
|
<div class="comment">
|
|
4500
4548
|
<div class="comment-header">
|
|
4501
4549
|
<div
|
|
@@ -4506,16 +4554,16 @@ let O = class extends S {
|
|
|
4506
4554
|
</div>
|
|
4507
4555
|
<span class="comment-author">${(n == null ? void 0 : n.name) ?? "Unknown"}</span>
|
|
4508
4556
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4509
|
-
${t.editedAt ?
|
|
4557
|
+
${t.editedAt ? h`<span class="edited-badge">(edited)</span>` : m}
|
|
4510
4558
|
</div>
|
|
4511
|
-
${r ? this.renderEditForm(t) :
|
|
4559
|
+
${r ? this.renderEditForm(t) : h`
|
|
4512
4560
|
<div class="comment-body">${this.parseMentions(t.body)}</div>
|
|
4513
4561
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4514
4562
|
`}
|
|
4515
|
-
${o && !r ?
|
|
4516
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${
|
|
4517
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${
|
|
4518
|
-
</div>` :
|
|
4563
|
+
${o && !r ? h`<div class="comment-actions">
|
|
4564
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${E(Ai, 14)}</button>
|
|
4565
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${E(Mi, 14)}</button>
|
|
4566
|
+
</div>` : m}
|
|
4519
4567
|
${this.renderReactions(t)}
|
|
4520
4568
|
</div>
|
|
4521
4569
|
`;
|
|
@@ -4536,42 +4584,55 @@ let O = class extends S {
|
|
|
4536
4584
|
|
|
4537
4585
|
${this.renderTypingIndicator(s.id)}
|
|
4538
4586
|
|
|
4539
|
-
${this.replyingTo === s.id ?
|
|
4587
|
+
${this.replyingTo === s.id ? h`
|
|
4540
4588
|
<form
|
|
4541
4589
|
class="reply-form"
|
|
4542
4590
|
@submit=${(t) => this.handleReply(s.id, t)}
|
|
4543
4591
|
>
|
|
4544
|
-
<input
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
type="button
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4592
|
+
<div class="reply-input-row">
|
|
4593
|
+
<input
|
|
4594
|
+
type="text"
|
|
4595
|
+
placeholder="Reply..."
|
|
4596
|
+
@input=${() => this.handleTypingInput(s.id)}
|
|
4597
|
+
/>
|
|
4598
|
+
<button class="pw-btn pw-btn-primary" type="submit">Send</button>
|
|
4599
|
+
</div>
|
|
4600
|
+
<div class="reply-media-row">
|
|
4601
|
+
<button
|
|
4602
|
+
type="button"
|
|
4603
|
+
class="reply-media-btn"
|
|
4604
|
+
title="Attach image"
|
|
4605
|
+
@click=${() => this.handleAttachImage()}
|
|
4606
|
+
>${E(Si, 16)}</button>
|
|
4607
|
+
<button
|
|
4608
|
+
type="button"
|
|
4609
|
+
class="reply-media-btn"
|
|
4610
|
+
title="Record audio"
|
|
4611
|
+
@click=${() => this.handleRecordAudio(s.id)}
|
|
4612
|
+
>${E(Ti, 16)}</button>
|
|
4613
|
+
<button
|
|
4614
|
+
type="button"
|
|
4615
|
+
class="reply-media-btn"
|
|
4616
|
+
title="Record video"
|
|
4617
|
+
@click=${() => this.handleRecordVideo(s.id)}
|
|
4618
|
+
>${E(Oi, 16)}</button>
|
|
4619
|
+
<div class="reply-preview">
|
|
4620
|
+
${this.replyAttachmentIds.map(
|
|
4621
|
+
(t, i) => h`<span class="reply-preview-badge">Attached #${i + 1}</span>`
|
|
4622
|
+
)}
|
|
4623
|
+
</div>
|
|
4624
|
+
</div>
|
|
4564
4625
|
</form>
|
|
4565
|
-
` :
|
|
4626
|
+
` : m}
|
|
4566
4627
|
</div>
|
|
4567
4628
|
`;
|
|
4568
4629
|
}
|
|
4569
4630
|
};
|
|
4570
4631
|
O.styles = [
|
|
4571
4632
|
ee,
|
|
4572
|
-
|
|
4633
|
+
ge,
|
|
4573
4634
|
_e,
|
|
4574
|
-
|
|
4635
|
+
I`
|
|
4575
4636
|
:host {
|
|
4576
4637
|
display: block;
|
|
4577
4638
|
}
|
|
@@ -4746,23 +4807,29 @@ O.styles = [
|
|
|
4746
4807
|
|
|
4747
4808
|
/* Reply form */
|
|
4748
4809
|
.reply-form {
|
|
4749
|
-
display: flex;
|
|
4750
|
-
gap: 6px;
|
|
4751
4810
|
margin-top: 8px;
|
|
4752
4811
|
margin-left: 32px;
|
|
4753
4812
|
}
|
|
4754
4813
|
|
|
4814
|
+
.reply-input-row {
|
|
4815
|
+
display: flex;
|
|
4816
|
+
gap: 6px;
|
|
4817
|
+
align-items: center;
|
|
4818
|
+
}
|
|
4819
|
+
|
|
4755
4820
|
.reply-form input {
|
|
4756
4821
|
flex: 1;
|
|
4757
|
-
padding:
|
|
4822
|
+
padding: 8px 12px;
|
|
4758
4823
|
border: 1.5px solid var(--pw-border);
|
|
4759
|
-
border-radius:
|
|
4760
|
-
font-size:
|
|
4824
|
+
border-radius: 8px;
|
|
4825
|
+
font-size: 13px;
|
|
4761
4826
|
font-family: inherit;
|
|
4762
4827
|
outline: none;
|
|
4763
4828
|
transition: border-color 0.15s, box-shadow 0.15s;
|
|
4764
4829
|
color: var(--pw-text);
|
|
4765
4830
|
background: var(--pw-surface);
|
|
4831
|
+
min-height: 36px;
|
|
4832
|
+
min-width: 0;
|
|
4766
4833
|
}
|
|
4767
4834
|
|
|
4768
4835
|
.reply-form input:focus {
|
|
@@ -4770,9 +4837,54 @@ O.styles = [
|
|
|
4770
4837
|
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
|
|
4771
4838
|
}
|
|
4772
4839
|
|
|
4773
|
-
.reply-
|
|
4774
|
-
|
|
4840
|
+
.reply-media-row {
|
|
4841
|
+
display: flex;
|
|
4842
|
+
align-items: center;
|
|
4843
|
+
gap: 2px;
|
|
4844
|
+
margin-top: 6px;
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
.reply-media-btn {
|
|
4848
|
+
border: none;
|
|
4849
|
+
background: none;
|
|
4850
|
+
cursor: pointer;
|
|
4851
|
+
color: var(--pw-text-muted);
|
|
4852
|
+
padding: 6px;
|
|
4853
|
+
border-radius: 6px;
|
|
4854
|
+
display: flex;
|
|
4855
|
+
align-items: center;
|
|
4856
|
+
justify-content: center;
|
|
4857
|
+
min-width: 32px;
|
|
4858
|
+
min-height: 32px;
|
|
4859
|
+
transition: all 0.15s;
|
|
4860
|
+
}
|
|
4861
|
+
|
|
4862
|
+
.reply-media-btn:hover {
|
|
4863
|
+
color: var(--pw-accent);
|
|
4864
|
+
background: var(--pw-accent-light);
|
|
4865
|
+
}
|
|
4866
|
+
|
|
4867
|
+
.reply-preview {
|
|
4868
|
+
flex: 1;
|
|
4869
|
+
display: flex;
|
|
4870
|
+
gap: 4px;
|
|
4871
|
+
flex-wrap: wrap;
|
|
4872
|
+
margin-left: 4px;
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
.reply-preview-badge {
|
|
4876
|
+
display: inline-block;
|
|
4877
|
+
padding: 2px 8px;
|
|
4878
|
+
border-radius: 4px;
|
|
4879
|
+
background: var(--pw-surface-hover);
|
|
4880
|
+
font-size: 10px;
|
|
4881
|
+
color: var(--pw-text-muted);
|
|
4882
|
+
}
|
|
4883
|
+
|
|
4884
|
+
.reply-form .pw-btn-primary {
|
|
4885
|
+
padding: 8px 14px;
|
|
4775
4886
|
font-size: 12px;
|
|
4887
|
+
min-height: 36px;
|
|
4776
4888
|
}
|
|
4777
4889
|
|
|
4778
4890
|
.pin-hint {
|
|
@@ -4815,8 +4927,17 @@ O.styles = [
|
|
|
4815
4927
|
border-radius: 16px 16px 0 0;
|
|
4816
4928
|
}
|
|
4817
4929
|
|
|
4818
|
-
.reply-form input
|
|
4819
|
-
|
|
4930
|
+
.reply-form input {
|
|
4931
|
+
min-height: 44px;
|
|
4932
|
+
font-size: 16px; /* prevents zoom on iOS */
|
|
4933
|
+
}
|
|
4934
|
+
|
|
4935
|
+
.reply-form .pw-btn-primary {
|
|
4936
|
+
min-height: 44px;
|
|
4937
|
+
}
|
|
4938
|
+
|
|
4939
|
+
.reply-media-btn {
|
|
4940
|
+
min-width: 44px;
|
|
4820
4941
|
min-height: 44px;
|
|
4821
4942
|
}
|
|
4822
4943
|
|
|
@@ -5060,25 +5181,25 @@ j([
|
|
|
5060
5181
|
O = j([
|
|
5061
5182
|
R("pulse-widget-comments-panel")
|
|
5062
5183
|
], O);
|
|
5063
|
-
var
|
|
5064
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
5184
|
+
var is = Object.defineProperty, ss = Object.getOwnPropertyDescriptor, qe = (s, e, t, i) => {
|
|
5185
|
+
for (var n = i > 1 ? void 0 : i ? ss(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5065
5186
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5066
|
-
return i && n &&
|
|
5187
|
+
return i && n && is(e, t, n), n;
|
|
5067
5188
|
};
|
|
5068
|
-
const
|
|
5189
|
+
const ns = {
|
|
5069
5190
|
"comment:created": "left a comment",
|
|
5070
5191
|
"comment:mention": "mentioned you",
|
|
5071
5192
|
"comment:reply": "replied to your comment",
|
|
5072
5193
|
"thread:resolved": "resolved a thread",
|
|
5073
5194
|
"reaction:added": "reacted to your comment"
|
|
5074
|
-
},
|
|
5195
|
+
}, os = {
|
|
5075
5196
|
"comment:created": "💬",
|
|
5076
5197
|
"comment:mention": "📣",
|
|
5077
5198
|
"comment:reply": "↩️",
|
|
5078
5199
|
"thread:resolved": "✅",
|
|
5079
5200
|
"reaction:added": "🎉"
|
|
5080
5201
|
};
|
|
5081
|
-
let
|
|
5202
|
+
let de = class extends S {
|
|
5082
5203
|
constructor() {
|
|
5083
5204
|
super(...arguments), this.notifications = [];
|
|
5084
5205
|
}
|
|
@@ -5122,38 +5243,38 @@ let ce = class extends S {
|
|
|
5122
5243
|
}
|
|
5123
5244
|
render() {
|
|
5124
5245
|
const s = this.notifications.filter((e) => !e.read).length;
|
|
5125
|
-
return
|
|
5246
|
+
return h`
|
|
5126
5247
|
<div class="panel">
|
|
5127
5248
|
<div class="panel-header">
|
|
5128
5249
|
<span class="panel-title">
|
|
5129
5250
|
Notifications
|
|
5130
|
-
${s > 0 ?
|
|
5251
|
+
${s > 0 ? h`<span class="unread-badge">${s}</span>` : m}
|
|
5131
5252
|
</span>
|
|
5132
5253
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5133
|
-
${s > 0 ?
|
|
5254
|
+
${s > 0 ? h`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5134
5255
|
Mark all read
|
|
5135
|
-
</button>` :
|
|
5256
|
+
</button>` : m}
|
|
5136
5257
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5137
|
-
${
|
|
5258
|
+
${E(me, 16)}
|
|
5138
5259
|
</button>
|
|
5139
5260
|
</div>
|
|
5140
5261
|
</div>
|
|
5141
5262
|
|
|
5142
5263
|
<div class="panel-body pw-scrollable">
|
|
5143
|
-
${this.notifications.length === 0 ?
|
|
5264
|
+
${this.notifications.length === 0 ? h`<div class="empty">
|
|
5144
5265
|
<div class="empty-icon">🔔</div>
|
|
5145
5266
|
No notifications
|
|
5146
5267
|
</div>` : this.notifications.map(
|
|
5147
|
-
(e) =>
|
|
5268
|
+
(e) => h`
|
|
5148
5269
|
<div
|
|
5149
5270
|
class="item ${e.read ? "" : "unread"}"
|
|
5150
5271
|
@click=${() => this.handleClick(e)}
|
|
5151
5272
|
>
|
|
5152
|
-
<span class="icon">${
|
|
5273
|
+
<span class="icon">${os[e.type] ?? "🔔"}</span>
|
|
5153
5274
|
<div class="content">
|
|
5154
5275
|
<div class="text">
|
|
5155
5276
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
5156
|
-
${
|
|
5277
|
+
${ns[e.type] ?? e.type}
|
|
5157
5278
|
</div>
|
|
5158
5279
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
5159
5280
|
</div>
|
|
@@ -5166,11 +5287,11 @@ let ce = class extends S {
|
|
|
5166
5287
|
`;
|
|
5167
5288
|
}
|
|
5168
5289
|
};
|
|
5169
|
-
|
|
5290
|
+
de.styles = [
|
|
5170
5291
|
ee,
|
|
5171
|
-
|
|
5292
|
+
ge,
|
|
5172
5293
|
_e,
|
|
5173
|
-
|
|
5294
|
+
I`
|
|
5174
5295
|
:host {
|
|
5175
5296
|
display: block;
|
|
5176
5297
|
}
|
|
@@ -5363,17 +5484,17 @@ ce.styles = [
|
|
|
5363
5484
|
}
|
|
5364
5485
|
`
|
|
5365
5486
|
];
|
|
5366
|
-
|
|
5487
|
+
qe([
|
|
5367
5488
|
g({ attribute: !1 })
|
|
5368
|
-
],
|
|
5369
|
-
|
|
5489
|
+
], de.prototype, "client", 2);
|
|
5490
|
+
qe([
|
|
5370
5491
|
v()
|
|
5371
|
-
],
|
|
5372
|
-
|
|
5492
|
+
], de.prototype, "notifications", 2);
|
|
5493
|
+
de = qe([
|
|
5373
5494
|
R("pulse-widget-notifications-panel")
|
|
5374
|
-
],
|
|
5375
|
-
const
|
|
5376
|
-
class
|
|
5495
|
+
], de);
|
|
5496
|
+
const rs = 3e3;
|
|
5497
|
+
class as {
|
|
5377
5498
|
constructor(e) {
|
|
5378
5499
|
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) => {
|
|
5379
5500
|
t.pointerType !== "touch" && this.client.moveCursor({
|
|
@@ -5425,7 +5546,7 @@ class rs {
|
|
|
5425
5546
|
), this.setSending(!0), this.staleTimer = setInterval(() => {
|
|
5426
5547
|
const e = Date.now();
|
|
5427
5548
|
for (const [t, i] of this.cursorLastSeen)
|
|
5428
|
-
if (e - i >
|
|
5549
|
+
if (e - i > rs) {
|
|
5429
5550
|
this.cursors.delete(t);
|
|
5430
5551
|
const n = this.cursorEls.get(t);
|
|
5431
5552
|
n && n.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
|
|
@@ -5521,7 +5642,7 @@ class rs {
|
|
|
5521
5642
|
i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
|
|
5522
5643
|
}
|
|
5523
5644
|
}
|
|
5524
|
-
class
|
|
5645
|
+
class ls {
|
|
5525
5646
|
constructor(e) {
|
|
5526
5647
|
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) => {
|
|
5527
5648
|
var l, a, c;
|
|
@@ -5604,9 +5725,9 @@ class as {
|
|
|
5604
5725
|
this.fadeTimers.set(e, t);
|
|
5605
5726
|
}
|
|
5606
5727
|
}
|
|
5607
|
-
function
|
|
5728
|
+
function cs(s) {
|
|
5608
5729
|
if (!s.rangeCount || s.isCollapsed) return null;
|
|
5609
|
-
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n =
|
|
5730
|
+
const e = s.getRangeAt(0), t = e.startContainer, i = e.endContainer, n = ft(t), o = ft(i);
|
|
5610
5731
|
return !n || !o ? null : {
|
|
5611
5732
|
startSelector: n,
|
|
5612
5733
|
startOffset: e.startOffset,
|
|
@@ -5614,10 +5735,10 @@ function ls(s) {
|
|
|
5614
5735
|
endOffset: e.endOffset
|
|
5615
5736
|
};
|
|
5616
5737
|
}
|
|
5617
|
-
function
|
|
5738
|
+
function ds(s) {
|
|
5618
5739
|
var e, t;
|
|
5619
5740
|
try {
|
|
5620
|
-
const i =
|
|
5741
|
+
const i = gt(s.startSelector), n = gt(s.endSelector);
|
|
5621
5742
|
if (!i || !n) return null;
|
|
5622
5743
|
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, l = n.nodeType === Node.TEXT_NODE ? ((t = n.textContent) == null ? void 0 : t.length) ?? 0 : n.childNodes.length;
|
|
5623
5744
|
return o.setStart(i, Math.min(s.startOffset, r)), o.setEnd(n, Math.min(s.endOffset, l)), o;
|
|
@@ -5625,18 +5746,18 @@ function cs(s) {
|
|
|
5625
5746
|
return null;
|
|
5626
5747
|
}
|
|
5627
5748
|
}
|
|
5628
|
-
function
|
|
5749
|
+
function ft(s) {
|
|
5629
5750
|
if (s.nodeType === Node.TEXT_NODE) {
|
|
5630
5751
|
const e = s.parentElement;
|
|
5631
5752
|
if (!e) return null;
|
|
5632
|
-
const t =
|
|
5753
|
+
const t = mt(e);
|
|
5633
5754
|
if (!t) return null;
|
|
5634
5755
|
const i = Array.from(e.childNodes).indexOf(s);
|
|
5635
5756
|
return `${t}::text(${i})`;
|
|
5636
5757
|
}
|
|
5637
|
-
return s.nodeType === Node.ELEMENT_NODE ?
|
|
5758
|
+
return s.nodeType === Node.ELEMENT_NODE ? mt(s) : null;
|
|
5638
5759
|
}
|
|
5639
|
-
function
|
|
5760
|
+
function mt(s) {
|
|
5640
5761
|
if (!s || s === document.documentElement) return "html";
|
|
5641
5762
|
if (s === document.body) return "body";
|
|
5642
5763
|
if (s.id) return `#${CSS.escape(s.id)}`;
|
|
@@ -5662,7 +5783,7 @@ function ft(s) {
|
|
|
5662
5783
|
}
|
|
5663
5784
|
return e.length > 0 ? e.join(" > ") : null;
|
|
5664
5785
|
}
|
|
5665
|
-
function
|
|
5786
|
+
function gt(s) {
|
|
5666
5787
|
const e = s.match(/^(.+)::text\((\d+)\)$/);
|
|
5667
5788
|
if (e) {
|
|
5668
5789
|
const t = e[1], i = parseInt(e[2], 10);
|
|
@@ -5679,7 +5800,7 @@ function mt(s) {
|
|
|
5679
5800
|
return null;
|
|
5680
5801
|
}
|
|
5681
5802
|
}
|
|
5682
|
-
class
|
|
5803
|
+
class hs {
|
|
5683
5804
|
constructor(e) {
|
|
5684
5805
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
5685
5806
|
}
|
|
@@ -5723,26 +5844,26 @@ class ds {
|
|
|
5723
5844
|
if (!this.container) return;
|
|
5724
5845
|
const i = (l = this.client.state.user) == null ? void 0 : l.id;
|
|
5725
5846
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
5726
|
-
const n =
|
|
5847
|
+
const n = ds(t);
|
|
5727
5848
|
if (!n) return;
|
|
5728
5849
|
const o = this.client.state.presence.find(
|
|
5729
5850
|
(a) => a.user.id === e
|
|
5730
5851
|
), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
|
|
5731
5852
|
try {
|
|
5732
5853
|
const a = n.getClientRects(), c = [];
|
|
5733
|
-
for (let
|
|
5734
|
-
const
|
|
5735
|
-
Object.assign(
|
|
5854
|
+
for (let p = 0; p < a.length; p++) {
|
|
5855
|
+
const d = a[p], u = document.createElement("div");
|
|
5856
|
+
Object.assign(u.style, {
|
|
5736
5857
|
position: "absolute",
|
|
5737
|
-
left: `${
|
|
5738
|
-
top: `${
|
|
5739
|
-
width: `${
|
|
5740
|
-
height: `${
|
|
5858
|
+
left: `${d.left}px`,
|
|
5859
|
+
top: `${d.top}px`,
|
|
5860
|
+
width: `${d.width}px`,
|
|
5861
|
+
height: `${d.height}px`,
|
|
5741
5862
|
background: r,
|
|
5742
5863
|
opacity: "0.2",
|
|
5743
5864
|
borderRadius: "2px",
|
|
5744
5865
|
pointerEvents: "none"
|
|
5745
|
-
}), this.container.appendChild(
|
|
5866
|
+
}), this.container.appendChild(u), c.push(u);
|
|
5746
5867
|
}
|
|
5747
5868
|
this.selectionEls.set(e, c);
|
|
5748
5869
|
} catch {
|
|
@@ -5762,12 +5883,12 @@ class ds {
|
|
|
5762
5883
|
}
|
|
5763
5884
|
}
|
|
5764
5885
|
}
|
|
5765
|
-
var
|
|
5766
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
5886
|
+
var ps = Object.defineProperty, us = Object.getOwnPropertyDescriptor, Ve = (s, e, t, i) => {
|
|
5887
|
+
for (var n = i > 1 ? void 0 : i ? us(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
5767
5888
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
5768
|
-
return i && n &&
|
|
5889
|
+
return i && n && ps(e, t, n), n;
|
|
5769
5890
|
};
|
|
5770
|
-
let
|
|
5891
|
+
let he = class extends S {
|
|
5771
5892
|
constructor() {
|
|
5772
5893
|
super(...arguments), this.roomId = "";
|
|
5773
5894
|
}
|
|
@@ -5787,7 +5908,7 @@ let de = class extends S {
|
|
|
5787
5908
|
);
|
|
5788
5909
|
}
|
|
5789
5910
|
renderToggle(s, e) {
|
|
5790
|
-
return
|
|
5911
|
+
return h`
|
|
5791
5912
|
<div class="setting-row">
|
|
5792
5913
|
<span class="setting-label">${s}</span>
|
|
5793
5914
|
<label class="toggle">
|
|
@@ -5803,12 +5924,12 @@ let de = class extends S {
|
|
|
5803
5924
|
}
|
|
5804
5925
|
render() {
|
|
5805
5926
|
const s = !this.settings.enabled;
|
|
5806
|
-
return
|
|
5927
|
+
return h`
|
|
5807
5928
|
<div class="panel">
|
|
5808
5929
|
<div class="panel-header">
|
|
5809
5930
|
<span class="panel-title">Settings</span>
|
|
5810
5931
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5811
|
-
${
|
|
5932
|
+
${E(me, 16)}
|
|
5812
5933
|
</button>
|
|
5813
5934
|
</div>
|
|
5814
5935
|
|
|
@@ -5853,11 +5974,11 @@ let de = class extends S {
|
|
|
5853
5974
|
`;
|
|
5854
5975
|
}
|
|
5855
5976
|
};
|
|
5856
|
-
|
|
5977
|
+
he.styles = [
|
|
5857
5978
|
ee,
|
|
5858
|
-
|
|
5979
|
+
ge,
|
|
5859
5980
|
_e,
|
|
5860
|
-
|
|
5981
|
+
I`
|
|
5861
5982
|
:host {
|
|
5862
5983
|
display: block;
|
|
5863
5984
|
}
|
|
@@ -6028,16 +6149,16 @@ de.styles = [
|
|
|
6028
6149
|
}
|
|
6029
6150
|
`
|
|
6030
6151
|
];
|
|
6031
|
-
|
|
6152
|
+
Ve([
|
|
6032
6153
|
g({ attribute: !1 })
|
|
6033
|
-
],
|
|
6034
|
-
|
|
6154
|
+
], he.prototype, "settings", 2);
|
|
6155
|
+
Ve([
|
|
6035
6156
|
g()
|
|
6036
|
-
],
|
|
6037
|
-
|
|
6157
|
+
], he.prototype, "roomId", 2);
|
|
6158
|
+
he = Ve([
|
|
6038
6159
|
R("pulse-widget-settings-panel")
|
|
6039
|
-
],
|
|
6040
|
-
const
|
|
6160
|
+
], he);
|
|
6161
|
+
const ye = {
|
|
6041
6162
|
enabled: !0,
|
|
6042
6163
|
showMyCursor: !0,
|
|
6043
6164
|
showOthersCursors: !0,
|
|
@@ -6048,24 +6169,24 @@ const xe = {
|
|
|
6048
6169
|
showViewportIndicators: !0,
|
|
6049
6170
|
showSelections: !0,
|
|
6050
6171
|
showDrawings: !0
|
|
6051
|
-
},
|
|
6052
|
-
function
|
|
6172
|
+
}, St = "pulse:settings:";
|
|
6173
|
+
function fs(s) {
|
|
6053
6174
|
try {
|
|
6054
|
-
const e = localStorage.getItem(`${
|
|
6055
|
-
return e ? { ...
|
|
6175
|
+
const e = localStorage.getItem(`${St}${s}`);
|
|
6176
|
+
return e ? { ...ye, ...JSON.parse(e) } : { ...ye };
|
|
6056
6177
|
} catch {
|
|
6057
|
-
return { ...
|
|
6178
|
+
return { ...ye };
|
|
6058
6179
|
}
|
|
6059
6180
|
}
|
|
6060
|
-
function
|
|
6061
|
-
localStorage.setItem(`${
|
|
6181
|
+
function ms(s, e) {
|
|
6182
|
+
localStorage.setItem(`${St}${s}`, JSON.stringify(e));
|
|
6062
6183
|
}
|
|
6063
|
-
var
|
|
6064
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
6184
|
+
var gs = Object.defineProperty, bs = Object.getOwnPropertyDescriptor, L = (s, e, t, i) => {
|
|
6185
|
+
for (var n = i > 1 ? void 0 : i ? bs(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6065
6186
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6066
|
-
return i && n &&
|
|
6187
|
+
return i && n && gs(e, t, n), n;
|
|
6067
6188
|
};
|
|
6068
|
-
let
|
|
6189
|
+
let M = class extends S {
|
|
6069
6190
|
constructor() {
|
|
6070
6191
|
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;
|
|
6071
6192
|
}
|
|
@@ -6116,35 +6237,35 @@ let I = class extends S {
|
|
|
6116
6237
|
render() {
|
|
6117
6238
|
const s = this.display === "inline";
|
|
6118
6239
|
if (this.collapsed)
|
|
6119
|
-
return
|
|
6240
|
+
return h`
|
|
6120
6241
|
<div class="toolbar collapsed ${s ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6121
|
-
<span class="fab-icon">${
|
|
6242
|
+
<span class="fab-icon">${E(Ri, s ? 18 : 24)}</span>
|
|
6122
6243
|
</div>
|
|
6123
6244
|
`;
|
|
6124
6245
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
6125
|
-
return
|
|
6246
|
+
return h`
|
|
6126
6247
|
<div class="toolbar ${s ? "inline" : ""}"
|
|
6127
6248
|
<!-- Presence avatars -->
|
|
6128
|
-
${this.users.length > 0 ?
|
|
6249
|
+
${this.users.length > 0 ? h`
|
|
6129
6250
|
<div class="presence">
|
|
6130
|
-
${t > 0 ?
|
|
6251
|
+
${t > 0 ? h`<div class="presence-overflow">+${t}</div>` : m}
|
|
6131
6252
|
${e.map(
|
|
6132
|
-
(i) =>
|
|
6253
|
+
(i) => h`
|
|
6133
6254
|
<div
|
|
6134
6255
|
class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
|
|
6135
6256
|
style="background:${i.user.color}"
|
|
6136
6257
|
@click=${() => this.fireFollow(i.user.id)}
|
|
6137
6258
|
title="Click to follow ${i.user.name}"
|
|
6138
6259
|
>
|
|
6139
|
-
${i.user.avatar ?
|
|
6260
|
+
${i.user.avatar ? h`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6140
6261
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6141
|
-
${i.deviceType && i.deviceType !== "desktop" ?
|
|
6262
|
+
${i.deviceType && i.deviceType !== "desktop" ? h`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : m}
|
|
6142
6263
|
</div>
|
|
6143
6264
|
`
|
|
6144
6265
|
)}
|
|
6145
6266
|
</div>
|
|
6146
6267
|
<div class="separator"></div>
|
|
6147
|
-
` :
|
|
6268
|
+
` : m}
|
|
6148
6269
|
|
|
6149
6270
|
<!-- Pin comment (primary) -->
|
|
6150
6271
|
<button
|
|
@@ -6154,7 +6275,7 @@ let I = class extends S {
|
|
|
6154
6275
|
?disabled=${this.featuresDisabled}
|
|
6155
6276
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6156
6277
|
>
|
|
6157
|
-
${
|
|
6278
|
+
${E(_t)}
|
|
6158
6279
|
</button>
|
|
6159
6280
|
|
|
6160
6281
|
<!-- View comments -->
|
|
@@ -6165,7 +6286,7 @@ let I = class extends S {
|
|
|
6165
6286
|
?disabled=${this.featuresDisabled}
|
|
6166
6287
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6167
6288
|
>
|
|
6168
|
-
${
|
|
6289
|
+
${E(_i)}
|
|
6169
6290
|
</button>
|
|
6170
6291
|
|
|
6171
6292
|
<!-- Activity feed -->
|
|
@@ -6176,7 +6297,7 @@ let I = class extends S {
|
|
|
6176
6297
|
?disabled=${this.featuresDisabled}
|
|
6177
6298
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6178
6299
|
>
|
|
6179
|
-
${
|
|
6300
|
+
${E(Ci)}
|
|
6180
6301
|
</button>
|
|
6181
6302
|
|
|
6182
6303
|
<!-- Draw mode -->
|
|
@@ -6187,7 +6308,7 @@ let I = class extends S {
|
|
|
6187
6308
|
?disabled=${this.featuresDisabled}
|
|
6188
6309
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6189
6310
|
>
|
|
6190
|
-
${
|
|
6311
|
+
${E(Pi)}
|
|
6191
6312
|
</button>
|
|
6192
6313
|
|
|
6193
6314
|
<!-- Notifications -->
|
|
@@ -6198,8 +6319,8 @@ let I = class extends S {
|
|
|
6198
6319
|
?disabled=${this.featuresDisabled}
|
|
6199
6320
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6200
6321
|
>
|
|
6201
|
-
${
|
|
6202
|
-
${this.unreadCount > 0 ?
|
|
6322
|
+
${E(Ei)}
|
|
6323
|
+
${this.unreadCount > 0 ? h`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : m}
|
|
6203
6324
|
</button>
|
|
6204
6325
|
|
|
6205
6326
|
<!-- Settings -->
|
|
@@ -6208,7 +6329,7 @@ let I = class extends S {
|
|
|
6208
6329
|
@click=${() => this.fire("settings")}
|
|
6209
6330
|
title="Settings"
|
|
6210
6331
|
>
|
|
6211
|
-
${
|
|
6332
|
+
${E(Ii)}
|
|
6212
6333
|
</button>
|
|
6213
6334
|
|
|
6214
6335
|
<div class="separator"></div>
|
|
@@ -6219,16 +6340,16 @@ let I = class extends S {
|
|
|
6219
6340
|
@click=${this.fireToggle}
|
|
6220
6341
|
title="Collapse"
|
|
6221
6342
|
>
|
|
6222
|
-
${
|
|
6343
|
+
${E(me, 14)}
|
|
6223
6344
|
</button>
|
|
6224
6345
|
</div>
|
|
6225
6346
|
`;
|
|
6226
6347
|
}
|
|
6227
6348
|
};
|
|
6228
|
-
|
|
6349
|
+
M.styles = [
|
|
6229
6350
|
ee,
|
|
6230
|
-
|
|
6231
|
-
|
|
6351
|
+
ge,
|
|
6352
|
+
I`
|
|
6232
6353
|
:host {
|
|
6233
6354
|
display: block;
|
|
6234
6355
|
}
|
|
@@ -6442,38 +6563,38 @@ I.styles = [
|
|
|
6442
6563
|
];
|
|
6443
6564
|
L([
|
|
6444
6565
|
g({ attribute: !1 })
|
|
6445
|
-
],
|
|
6566
|
+
], M.prototype, "client", 2);
|
|
6446
6567
|
L([
|
|
6447
6568
|
g({ type: Boolean })
|
|
6448
|
-
],
|
|
6569
|
+
], M.prototype, "collapsed", 2);
|
|
6449
6570
|
L([
|
|
6450
6571
|
g()
|
|
6451
|
-
],
|
|
6572
|
+
], M.prototype, "activePanel", 2);
|
|
6452
6573
|
L([
|
|
6453
6574
|
g({ type: Boolean })
|
|
6454
|
-
],
|
|
6575
|
+
], M.prototype, "pinModeActive", 2);
|
|
6455
6576
|
L([
|
|
6456
6577
|
g({ type: Boolean })
|
|
6457
|
-
],
|
|
6578
|
+
], M.prototype, "featuresDisabled", 2);
|
|
6458
6579
|
L([
|
|
6459
6580
|
g({ type: Boolean })
|
|
6460
|
-
],
|
|
6581
|
+
], M.prototype, "drawModeActive", 2);
|
|
6461
6582
|
L([
|
|
6462
6583
|
g()
|
|
6463
|
-
],
|
|
6584
|
+
], M.prototype, "followingUserId", 2);
|
|
6464
6585
|
L([
|
|
6465
6586
|
g()
|
|
6466
|
-
],
|
|
6587
|
+
], M.prototype, "display", 2);
|
|
6467
6588
|
L([
|
|
6468
6589
|
v()
|
|
6469
|
-
],
|
|
6590
|
+
], M.prototype, "users", 2);
|
|
6470
6591
|
L([
|
|
6471
6592
|
v()
|
|
6472
|
-
],
|
|
6473
|
-
|
|
6593
|
+
], M.prototype, "unreadCount", 2);
|
|
6594
|
+
M = L([
|
|
6474
6595
|
R("pulse-widget-toolbar")
|
|
6475
|
-
],
|
|
6476
|
-
class
|
|
6596
|
+
], M);
|
|
6597
|
+
class vs {
|
|
6477
6598
|
constructor(e) {
|
|
6478
6599
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
6479
6600
|
}
|
|
@@ -6514,8 +6635,8 @@ class bs {
|
|
|
6514
6635
|
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, n = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
|
|
6515
6636
|
for (const [l, a] of this.client.state.viewports) {
|
|
6516
6637
|
if (l === n) continue;
|
|
6517
|
-
const c = a.scrollY,
|
|
6518
|
-
if (c >=
|
|
6638
|
+
const c = a.scrollY, p = a.scrollY + a.viewportHeight, d = e, u = e + t;
|
|
6639
|
+
if (c >= d && p <= u) {
|
|
6519
6640
|
const k = this.pillEls.get(l);
|
|
6520
6641
|
k && (k.style.display = "none");
|
|
6521
6642
|
continue;
|
|
@@ -6551,14 +6672,14 @@ class bs {
|
|
|
6551
6672
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6552
6673
|
}
|
|
6553
6674
|
}
|
|
6554
|
-
var
|
|
6555
|
-
for (var n = i > 1 ? void 0 : i ?
|
|
6675
|
+
var xs = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, P = (s, e, t, i) => {
|
|
6676
|
+
for (var n = i > 1 ? void 0 : i ? ys(e, t) : e, o = s.length - 1, r; o >= 0; o--)
|
|
6556
6677
|
(r = s[o]) && (n = (i ? r(e, t, n) : r(n)) || n);
|
|
6557
|
-
return i && n &&
|
|
6678
|
+
return i && n && xs(e, t, n), n;
|
|
6558
6679
|
};
|
|
6559
|
-
let
|
|
6680
|
+
let C = class extends S {
|
|
6560
6681
|
constructor() {
|
|
6561
|
-
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 = { ...
|
|
6682
|
+
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 = { ...ye }, 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 = () => {
|
|
6562
6683
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
6563
6684
|
var s;
|
|
6564
6685
|
this._viewportThrottleTimer = null, (s = this.client) == null || s.updateViewport({
|
|
@@ -6579,7 +6700,7 @@ let E = class extends S {
|
|
|
6579
6700
|
(t = this.client) == null || t.updateSelection(null);
|
|
6580
6701
|
return;
|
|
6581
6702
|
}
|
|
6582
|
-
const e =
|
|
6703
|
+
const e = cs(s);
|
|
6583
6704
|
(i = this.client) == null || i.updateSelection(e);
|
|
6584
6705
|
}, 500));
|
|
6585
6706
|
}, this.handleDocumentClick = (s) => {
|
|
@@ -6611,11 +6732,11 @@ let E = class extends S {
|
|
|
6611
6732
|
room: this.room,
|
|
6612
6733
|
endpoint: this.endpoint
|
|
6613
6734
|
};
|
|
6614
|
-
this.client = new
|
|
6735
|
+
this.client = new xt(s), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new as(this.client), this.commentPins = new Ji(this.client, {
|
|
6615
6736
|
onPinModeExit: () => {
|
|
6616
6737
|
this.pinModeActive = !1;
|
|
6617
6738
|
}
|
|
6618
|
-
}), this.viewportOverlay = new
|
|
6739
|
+
}), this.viewportOverlay = new vs(this.client), this.selectionOverlay = new hs(this.client), this.drawingOverlay = new ls(this.client), this.settings = fs(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
6619
6740
|
this.client.on("connection", (e) => {
|
|
6620
6741
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
6621
6742
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -6682,15 +6803,15 @@ let E = class extends S {
|
|
|
6682
6803
|
}
|
|
6683
6804
|
handleSettingsChange(s) {
|
|
6684
6805
|
const e = s.detail;
|
|
6685
|
-
this.settings = e,
|
|
6806
|
+
this.settings = e, ms(this.room, e), this.applySettings(e);
|
|
6686
6807
|
}
|
|
6687
6808
|
applySettings(s) {
|
|
6688
|
-
var e, t, i, n, o, r, l, a, c,
|
|
6809
|
+
var e, t, i, n, o, r, l, a, c, p, d, u, f, b, x, _, $;
|
|
6689
6810
|
if (!s.enabled) {
|
|
6690
6811
|
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (n = this.drawingOverlay) == null || n.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (l = this.commentPins) == null || l.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((a = this.commentPins) == null || a.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
6691
6812
|
return;
|
|
6692
6813
|
}
|
|
6693
|
-
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (
|
|
6814
|
+
this.applyCursorSettings(s), (c = this.client) == null || c.setAppearOffline(s.appearOffline), (p = this.commentPins) == null || p.setVisible(s.showCommentPins), s.showViewportIndicators ? (d = this.viewportOverlay) == null || d.enable() : (u = this.viewportOverlay) == null || u.disable(), s.showSelections ? (f = this.selectionOverlay) == null || f.enable() : (b = this.selectionOverlay) == null || b.disable(), s.showDrawings ? (x = this.drawingOverlay) == null || x.enable() : ((_ = this.drawingOverlay) == null || _.disable(), this.drawModeActive && (($ = this.drawingOverlay) == null || $.disableDrawMode(), this.drawModeActive = !1));
|
|
6694
6815
|
}
|
|
6695
6816
|
applyCursorSettings(s) {
|
|
6696
6817
|
if (!this.cursorOverlay) return;
|
|
@@ -6716,9 +6837,9 @@ let E = class extends S {
|
|
|
6716
6837
|
const c = ($ = this.shadowRoot) == null ? void 0 : $.querySelector(".panel-container");
|
|
6717
6838
|
if (!c) return;
|
|
6718
6839
|
Object.assign(c.style, { top: "auto", left: "auto" });
|
|
6719
|
-
const
|
|
6720
|
-
if (!
|
|
6721
|
-
const
|
|
6840
|
+
const p = a ?? t;
|
|
6841
|
+
if (!p) return;
|
|
6842
|
+
const d = p.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(d, u, o, r, l);
|
|
6722
6843
|
c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
|
|
6723
6844
|
}
|
|
6724
6845
|
computePosition(s, e, t, i, n) {
|
|
@@ -6738,13 +6859,13 @@ let E = class extends S {
|
|
|
6738
6859
|
return (s == null ? void 0 : s.user.name) ?? "user";
|
|
6739
6860
|
}
|
|
6740
6861
|
renderConnectionBanner() {
|
|
6741
|
-
return this.showConnectedFlash ?
|
|
6862
|
+
return this.showConnectedFlash ? h`<div class="connection-banner connected">
|
|
6742
6863
|
<span class="connection-dot"></span>Connected
|
|
6743
|
-
</div>` : this.connectionState === "connecting" ?
|
|
6864
|
+
</div>` : this.connectionState === "connecting" ? h`<div class="connection-banner connecting">
|
|
6744
6865
|
<span class="connection-dot"></span>Reconnecting...
|
|
6745
|
-
</div>` : this.connectionState === "disconnected" && this.client ?
|
|
6866
|
+
</div>` : this.connectionState === "disconnected" && this.client ? h`<div class="connection-banner disconnected">
|
|
6746
6867
|
<span class="connection-dot"></span>Disconnected
|
|
6747
|
-
</div>` :
|
|
6868
|
+
</div>` : m;
|
|
6748
6869
|
}
|
|
6749
6870
|
handleToolbarToggle() {
|
|
6750
6871
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -6752,38 +6873,38 @@ let E = class extends S {
|
|
|
6752
6873
|
render() {
|
|
6753
6874
|
const s = this.display === "inline";
|
|
6754
6875
|
if (s && this.collapsed)
|
|
6755
|
-
return
|
|
6876
|
+
return h`
|
|
6756
6877
|
<div class="widget-root">
|
|
6757
6878
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
6758
6879
|
<slot>Collaborate</slot>
|
|
6759
6880
|
</div>
|
|
6760
6881
|
</div>
|
|
6761
6882
|
`;
|
|
6762
|
-
const e = this.activePanel ?
|
|
6883
|
+
const e = this.activePanel ? h`
|
|
6763
6884
|
<div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
|
|
6764
|
-
${this.activePanel === "comments" ?
|
|
6885
|
+
${this.activePanel === "comments" ? h`<pulse-widget-comments-panel
|
|
6765
6886
|
.client=${this.client}
|
|
6766
6887
|
.highlightThreadId=${this.highlightThreadId}
|
|
6767
|
-
></pulse-widget-comments-panel>` :
|
|
6768
|
-
${this.activePanel === "settings" ?
|
|
6888
|
+
></pulse-widget-comments-panel>` : m}
|
|
6889
|
+
${this.activePanel === "settings" ? h`<pulse-widget-settings-panel
|
|
6769
6890
|
.settings=${this.settings}
|
|
6770
6891
|
.roomId=${this.room}
|
|
6771
6892
|
@settings-change=${this.handleSettingsChange}
|
|
6772
|
-
></pulse-widget-settings-panel>` :
|
|
6773
|
-
${this.activePanel === "notifications" ?
|
|
6893
|
+
></pulse-widget-settings-panel>` : m}
|
|
6894
|
+
${this.activePanel === "notifications" ? h`<pulse-widget-notifications-panel
|
|
6774
6895
|
.client=${this.client}
|
|
6775
|
-
></pulse-widget-notifications-panel>` :
|
|
6776
|
-
${this.activePanel === "activity" ?
|
|
6896
|
+
></pulse-widget-notifications-panel>` : m}
|
|
6897
|
+
${this.activePanel === "activity" ? h`<pulse-widget-activity-panel
|
|
6777
6898
|
.client=${this.client}
|
|
6778
|
-
></pulse-widget-activity-panel>` :
|
|
6899
|
+
></pulse-widget-activity-panel>` : m}
|
|
6779
6900
|
</div>
|
|
6780
|
-
` :
|
|
6901
|
+
` : m, t = this.followingUserId ? h`<div class="follow-banner">
|
|
6781
6902
|
Following ${this.getFollowUserName()}
|
|
6782
6903
|
<button @click=${() => {
|
|
6783
6904
|
this.followingUserId = null;
|
|
6784
6905
|
}}>Stop</button>
|
|
6785
|
-
</div>` :
|
|
6786
|
-
return s ?
|
|
6906
|
+
</div>` : m;
|
|
6907
|
+
return s ? h`
|
|
6787
6908
|
${t}
|
|
6788
6909
|
<div class="widget-root">
|
|
6789
6910
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
@@ -6807,7 +6928,7 @@ let E = class extends S {
|
|
|
6807
6928
|
</div>
|
|
6808
6929
|
${e}
|
|
6809
6930
|
</div>
|
|
6810
|
-
` :
|
|
6931
|
+
` : h`
|
|
6811
6932
|
${t}
|
|
6812
6933
|
<div class="widget-root">
|
|
6813
6934
|
${e}
|
|
@@ -6829,9 +6950,9 @@ let E = class extends S {
|
|
|
6829
6950
|
`;
|
|
6830
6951
|
}
|
|
6831
6952
|
};
|
|
6832
|
-
|
|
6953
|
+
C.styles = [
|
|
6833
6954
|
ee,
|
|
6834
|
-
|
|
6955
|
+
I`
|
|
6835
6956
|
:host {
|
|
6836
6957
|
display: block;
|
|
6837
6958
|
}
|
|
@@ -7009,58 +7130,58 @@ E.styles = [
|
|
|
7009
7130
|
];
|
|
7010
7131
|
P([
|
|
7011
7132
|
g({ attribute: "api-key" })
|
|
7012
|
-
],
|
|
7133
|
+
], C.prototype, "apiKey", 2);
|
|
7013
7134
|
P([
|
|
7014
7135
|
g()
|
|
7015
|
-
],
|
|
7136
|
+
], C.prototype, "token", 2);
|
|
7016
7137
|
P([
|
|
7017
7138
|
g()
|
|
7018
|
-
],
|
|
7139
|
+
], C.prototype, "room", 2);
|
|
7019
7140
|
P([
|
|
7020
7141
|
g()
|
|
7021
|
-
],
|
|
7142
|
+
], C.prototype, "endpoint", 2);
|
|
7022
7143
|
P([
|
|
7023
7144
|
g({ reflect: !0 })
|
|
7024
|
-
],
|
|
7145
|
+
], C.prototype, "position", 2);
|
|
7025
7146
|
P([
|
|
7026
7147
|
g({ reflect: !0 })
|
|
7027
|
-
],
|
|
7148
|
+
], C.prototype, "display", 2);
|
|
7028
7149
|
P([
|
|
7029
7150
|
v()
|
|
7030
|
-
],
|
|
7151
|
+
], C.prototype, "collapsed", 2);
|
|
7031
7152
|
P([
|
|
7032
7153
|
v()
|
|
7033
|
-
],
|
|
7154
|
+
], C.prototype, "activePanel", 2);
|
|
7034
7155
|
P([
|
|
7035
7156
|
v()
|
|
7036
|
-
],
|
|
7157
|
+
], C.prototype, "pinModeActive", 2);
|
|
7037
7158
|
P([
|
|
7038
7159
|
v()
|
|
7039
|
-
],
|
|
7160
|
+
], C.prototype, "highlightThreadId", 2);
|
|
7040
7161
|
P([
|
|
7041
7162
|
v()
|
|
7042
|
-
],
|
|
7163
|
+
], C.prototype, "settings", 2);
|
|
7043
7164
|
P([
|
|
7044
7165
|
v()
|
|
7045
|
-
],
|
|
7166
|
+
], C.prototype, "followingUserId", 2);
|
|
7046
7167
|
P([
|
|
7047
7168
|
v()
|
|
7048
|
-
],
|
|
7169
|
+
], C.prototype, "drawModeActive", 2);
|
|
7049
7170
|
P([
|
|
7050
7171
|
v()
|
|
7051
|
-
],
|
|
7172
|
+
], C.prototype, "connectionState", 2);
|
|
7052
7173
|
P([
|
|
7053
7174
|
v()
|
|
7054
|
-
],
|
|
7055
|
-
|
|
7175
|
+
], C.prototype, "showConnectedFlash", 2);
|
|
7176
|
+
C = P([
|
|
7056
7177
|
R("pulse-widget")
|
|
7057
|
-
],
|
|
7178
|
+
], C);
|
|
7058
7179
|
export {
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7180
|
+
W as PulseComments,
|
|
7181
|
+
le as PulseCursors,
|
|
7182
|
+
ce as PulseNotifications,
|
|
7062
7183
|
G as PulsePresence,
|
|
7063
|
-
|
|
7184
|
+
V as PulseProvider,
|
|
7064
7185
|
D as PulseReactions,
|
|
7065
|
-
|
|
7186
|
+
C as PulseWidget
|
|
7066
7187
|
};
|