@gamention/pulse-elements 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pulse-elements.cjs +223 -219
- package/dist/pulse-elements.js +1274 -1121
- package/package.json +1 -1
package/dist/pulse-elements.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2021 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
let
|
|
6
|
+
let wt = class extends Event {
|
|
7
7
|
constructor(e, t, i, s) {
|
|
8
8
|
super("context-request", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t, this.callback = i, this.subscribe = s ?? !1;
|
|
9
9
|
}
|
|
@@ -18,7 +18,7 @@ let vt = class extends Event {
|
|
|
18
18
|
* Copyright 2021 Google LLC
|
|
19
19
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
20
|
*/
|
|
21
|
-
let
|
|
21
|
+
let Ke = class {
|
|
22
22
|
constructor(e, t, i, s) {
|
|
23
23
|
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, r) => {
|
|
24
24
|
this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, r)), this.unsubscribe = r;
|
|
@@ -35,7 +35,7 @@ let 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 wt(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 Ot = class {
|
|
47
47
|
get value() {
|
|
48
48
|
return this.o;
|
|
49
49
|
}
|
|
@@ -76,21 +76,21 @@ let At = class {
|
|
|
76
76
|
* Copyright 2021 Google LLC
|
|
77
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
78
78
|
*/
|
|
79
|
-
let
|
|
79
|
+
let Rt = class extends Event {
|
|
80
80
|
constructor(e, t) {
|
|
81
81
|
super("context-provider", { bubbles: !0, composed: !0 }), this.context = e, this.contextTarget = t;
|
|
82
82
|
}
|
|
83
|
-
},
|
|
83
|
+
}, Ge = class extends Ot {
|
|
84
84
|
constructor(e, t, i) {
|
|
85
85
|
var s, o;
|
|
86
86
|
super(t.context !== void 0 ? t.initialValue : i), this.onContextRequest = (r) => {
|
|
87
87
|
if (r.context !== this.context) return;
|
|
88
|
-
const
|
|
89
|
-
|
|
88
|
+
const a = r.contextTarget ?? r.composedPath()[0];
|
|
89
|
+
a !== this.host && (r.stopPropagation(), this.addCallback(r.callback, a, r.subscribe));
|
|
90
90
|
}, this.onProviderRequest = (r) => {
|
|
91
91
|
if (r.context !== this.context || (r.contextTarget ?? r.composedPath()[0]) === this.host) return;
|
|
92
|
-
const
|
|
93
|
-
for (const [
|
|
92
|
+
const a = /* @__PURE__ */ new Set();
|
|
93
|
+
for (const [l, { consumerHost: d }] of this.subscriptions) a.has(l) || (a.add(l), d.dispatchEvent(new wt(this.context, d, l, !0)));
|
|
94
94
|
r.stopPropagation();
|
|
95
95
|
}, this.host = e, t.context !== void 0 ? this.context = t.context : this.context = t, this.attachListeners(), (o = (s = this.host).addController) == null || o.call(s, this);
|
|
96
96
|
}
|
|
@@ -98,7 +98,7 @@ let It = class extends Event {
|
|
|
98
98
|
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
99
99
|
}
|
|
100
100
|
hostConnected() {
|
|
101
|
-
this.host.dispatchEvent(new
|
|
101
|
+
this.host.dispatchEvent(new Rt(this.context, this.host));
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
@@ -106,7 +106,7 @@ let It = class extends Event {
|
|
|
106
106
|
* Copyright 2017 Google LLC
|
|
107
107
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
108
108
|
*/
|
|
109
|
-
function
|
|
109
|
+
function Lt({ context: n }) {
|
|
110
110
|
return (e, t) => {
|
|
111
111
|
const i = /* @__PURE__ */ new WeakMap();
|
|
112
112
|
if (typeof t == "object") return { get() {
|
|
@@ -114,11 +114,11 @@ function Mt({ context: n }) {
|
|
|
114
114
|
}, set(s) {
|
|
115
115
|
return i.get(this).setValue(s), e.set.call(this, s);
|
|
116
116
|
}, init(s) {
|
|
117
|
-
return i.set(this, new
|
|
117
|
+
return i.set(this, new Ge(this, { context: n, initialValue: s })), s;
|
|
118
118
|
} };
|
|
119
119
|
{
|
|
120
120
|
e.constructor.addInitializer(((r) => {
|
|
121
|
-
i.set(r, new
|
|
121
|
+
i.set(r, new Ge(r, { context: n }));
|
|
122
122
|
}));
|
|
123
123
|
const s = Object.getOwnPropertyDescriptor(e, t);
|
|
124
124
|
let o;
|
|
@@ -126,13 +126,13 @@ function Mt({ context: n }) {
|
|
|
126
126
|
const r = /* @__PURE__ */ new WeakMap();
|
|
127
127
|
o = { get() {
|
|
128
128
|
return r.get(this);
|
|
129
|
-
}, set(
|
|
130
|
-
i.get(this).setValue(
|
|
129
|
+
}, set(a) {
|
|
130
|
+
i.get(this).setValue(a), r.set(this, a);
|
|
131
131
|
}, configurable: !0, enumerable: !0 };
|
|
132
132
|
} else {
|
|
133
133
|
const r = s.set;
|
|
134
|
-
o = { ...s, set(
|
|
135
|
-
i.get(this).setValue(
|
|
134
|
+
o = { ...s, set(a) {
|
|
135
|
+
i.get(this).setValue(a), r == null || r.call(this, a);
|
|
136
136
|
} };
|
|
137
137
|
}
|
|
138
138
|
return void Object.defineProperty(e, t, o);
|
|
@@ -144,24 +144,24 @@ function Mt({ context: n }) {
|
|
|
144
144
|
* Copyright 2022 Google LLC
|
|
145
145
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
146
146
|
*/
|
|
147
|
-
function
|
|
147
|
+
function fe({ context: n, subscribe: e }) {
|
|
148
148
|
return (t, i) => {
|
|
149
149
|
typeof i == "object" ? i.addInitializer((function() {
|
|
150
|
-
new
|
|
150
|
+
new Ke(this, { context: n, callback: (s) => {
|
|
151
151
|
t.set.call(this, s);
|
|
152
152
|
}, subscribe: e });
|
|
153
153
|
})) : t.constructor.addInitializer(((s) => {
|
|
154
|
-
new
|
|
154
|
+
new Ke(s, { context: n, callback: (o) => {
|
|
155
155
|
s[i] = o;
|
|
156
156
|
}, subscribe: e });
|
|
157
157
|
}));
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
const
|
|
162
|
-
let
|
|
160
|
+
var jt = Object.defineProperty, zt = (n, e, t) => e in n ? jt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, k = (n, e, t) => zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
161
|
+
const Ut = "ws://localhost:4567";
|
|
162
|
+
let De = class {
|
|
163
163
|
constructor() {
|
|
164
|
-
|
|
164
|
+
k(this, "handlers", /* @__PURE__ */ new Map());
|
|
165
165
|
}
|
|
166
166
|
on(e, t) {
|
|
167
167
|
this.handlers.has(e) || this.handlers.set(e, /* @__PURE__ */ new Set());
|
|
@@ -179,9 +179,9 @@ let je = class {
|
|
|
179
179
|
removeAll() {
|
|
180
180
|
this.handlers.clear();
|
|
181
181
|
}
|
|
182
|
-
},
|
|
182
|
+
}, Dt = class extends De {
|
|
183
183
|
constructor(e) {
|
|
184
|
-
super(),
|
|
184
|
+
super(), k(this, "ws", null), k(this, "endpoint"), k(this, "reconnectAttempt", 0), k(this, "reconnectTimer", null), k(this, "_state", "disconnected"), this.endpoint = e ?? Ut;
|
|
185
185
|
}
|
|
186
186
|
get state() {
|
|
187
187
|
return this._state;
|
|
@@ -216,9 +216,9 @@ let je = class {
|
|
|
216
216
|
this.reconnectTimer = null, this.connect();
|
|
217
217
|
}, e);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, Ht = class extends De {
|
|
220
220
|
constructor() {
|
|
221
|
-
super(...arguments),
|
|
221
|
+
super(...arguments), k(this, "baseUrl", ""), k(this, "_user", null), k(this, "_users", /* @__PURE__ */ new Map()), k(this, "_presence", /* @__PURE__ */ new Map()), k(this, "_threads", /* @__PURE__ */ new Map()), k(this, "_reactions", /* @__PURE__ */ new Map()), k(this, "_notifications", []), k(this, "_activityLogs", []), k(this, "_typing", /* @__PURE__ */ new Map()), k(this, "_viewports", /* @__PURE__ */ new Map()), k(this, "_selections", /* @__PURE__ */ new Map());
|
|
222
222
|
}
|
|
223
223
|
get user() {
|
|
224
224
|
return this._user;
|
|
@@ -426,12 +426,12 @@ let je = class {
|
|
|
426
426
|
reset() {
|
|
427
427
|
this._user = null, this._users.clear(), this._presence.clear(), this._threads.clear(), this._reactions.clear(), this._notifications = [], this._activityLogs = [], this._typing.clear(), this._viewports.clear(), this._selections.clear();
|
|
428
428
|
}
|
|
429
|
-
},
|
|
429
|
+
}, $t = class extends De {
|
|
430
430
|
constructor(e) {
|
|
431
431
|
var t;
|
|
432
|
-
super(),
|
|
432
|
+
super(), k(this, "state"), k(this, "connection"), k(this, "config"), k(this, "heartbeatTimer", null), k(this, "lastCursorSend", 0), k(this, "pendingCursor", null), k(this, "cursorTimer", null), this.config = e, this.state = new Ht(), this.state.baseUrl = (e.endpoint ?? "").replace(/^ws(s?):/, "http$1:").replace(/\/$/, "");
|
|
433
433
|
const i = ((t = e.endpoint) == null ? void 0 : t.replace(/^http/, "ws")) ?? void 0;
|
|
434
|
-
this.connection = new
|
|
434
|
+
this.connection = new Dt(i), this.connection.on("message", (s) => {
|
|
435
435
|
this.state.handleMessage(s), this.emit(s.type, s);
|
|
436
436
|
}), this.connection.on("state", (s) => {
|
|
437
437
|
this.emit("connection", s), s === "connected" ? (this.authenticate(), this.startHeartbeat()) : s === "disconnected" && this.stopHeartbeat();
|
|
@@ -575,18 +575,18 @@ let je = class {
|
|
|
575
575
|
* Copyright 2019 Google LLC
|
|
576
576
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
577
577
|
*/
|
|
578
|
-
const
|
|
579
|
-
let
|
|
578
|
+
const ye = globalThis, He = ye.ShadowRoot && (ye.ShadyCSS === void 0 || ye.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Be = Symbol(), Je = /* @__PURE__ */ new WeakMap();
|
|
579
|
+
let kt = class {
|
|
580
580
|
constructor(e, t, i) {
|
|
581
|
-
if (this._$cssResult$ = !0, i !==
|
|
581
|
+
if (this._$cssResult$ = !0, i !== Be) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
582
582
|
this.cssText = e, this.t = t;
|
|
583
583
|
}
|
|
584
584
|
get styleSheet() {
|
|
585
585
|
let e = this.o;
|
|
586
586
|
const t = this.t;
|
|
587
|
-
if (
|
|
587
|
+
if (He && e === void 0) {
|
|
588
588
|
const i = t !== void 0 && t.length === 1;
|
|
589
|
-
i && (e =
|
|
589
|
+
i && (e = Je.get(t)), e === void 0 && ((this.o = e = new CSSStyleSheet()).replaceSync(this.cssText), i && Je.set(t, e));
|
|
590
590
|
}
|
|
591
591
|
return e;
|
|
592
592
|
}
|
|
@@ -594,33 +594,33 @@ let yt = class {
|
|
|
594
594
|
return this.cssText;
|
|
595
595
|
}
|
|
596
596
|
};
|
|
597
|
-
const
|
|
597
|
+
const Bt = (n) => new kt(typeof n == "string" ? n : n + "", void 0, Be), M = (n, ...e) => {
|
|
598
598
|
const t = n.length === 1 ? n[0] : e.reduce((i, s, o) => i + ((r) => {
|
|
599
599
|
if (r._$cssResult$ === !0) return r.cssText;
|
|
600
600
|
if (typeof r == "number") return r;
|
|
601
601
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + r + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
602
602
|
})(s) + n[o + 1], n[0]);
|
|
603
|
-
return new
|
|
604
|
-
},
|
|
605
|
-
if (
|
|
603
|
+
return new kt(t, n, Be);
|
|
604
|
+
}, Nt = (n, e) => {
|
|
605
|
+
if (He) n.adoptedStyleSheets = e.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
606
606
|
else for (const t of e) {
|
|
607
|
-
const i = document.createElement("style"), s =
|
|
607
|
+
const i = document.createElement("style"), s = ye.litNonce;
|
|
608
608
|
s !== void 0 && i.setAttribute("nonce", s), i.textContent = t.cssText, n.appendChild(i);
|
|
609
609
|
}
|
|
610
|
-
},
|
|
610
|
+
}, Ze = He ? (n) => n : (n) => n instanceof CSSStyleSheet ? ((e) => {
|
|
611
611
|
let t = "";
|
|
612
612
|
for (const i of e.cssRules) t += i.cssText;
|
|
613
|
-
return
|
|
613
|
+
return Bt(t);
|
|
614
614
|
})(n) : n;
|
|
615
615
|
/**
|
|
616
616
|
* @license
|
|
617
617
|
* Copyright 2017 Google LLC
|
|
618
618
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
619
619
|
*/
|
|
620
|
-
const { is:
|
|
620
|
+
const { is: Ft, defineProperty: qt, getOwnPropertyDescriptor: Vt, getOwnPropertyNames: Wt, getOwnPropertySymbols: Xt, getPrototypeOf: Yt } = Object, H = globalThis, Qe = H.trustedTypes, Kt = Qe ? Qe.emptyScript : "", _e = H.reactiveElementPolyfillSupport, ne = (n, e) => n, ke = { toAttribute(n, e) {
|
|
621
621
|
switch (e) {
|
|
622
622
|
case Boolean:
|
|
623
|
-
n = n ?
|
|
623
|
+
n = n ? Kt : null;
|
|
624
624
|
break;
|
|
625
625
|
case Object:
|
|
626
626
|
case Array:
|
|
@@ -645,44 +645,44 @@ const { is: Ht, defineProperty: Nt, getOwnPropertyDescriptor: Bt, getOwnProperty
|
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
return t;
|
|
648
|
-
} },
|
|
649
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")),
|
|
650
|
-
let
|
|
648
|
+
} }, Ne = (n, e) => !Ft(n, e), et = { attribute: !0, type: String, converter: ke, reflect: !1, useDefault: !1, hasChanged: Ne };
|
|
649
|
+
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), H.litPropertyMetadata ?? (H.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
650
|
+
let G = class extends HTMLElement {
|
|
651
651
|
static addInitializer(e) {
|
|
652
652
|
this._$Ei(), (this.l ?? (this.l = [])).push(e);
|
|
653
653
|
}
|
|
654
654
|
static get observedAttributes() {
|
|
655
655
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
656
656
|
}
|
|
657
|
-
static createProperty(e, t =
|
|
657
|
+
static createProperty(e, t = et) {
|
|
658
658
|
if (t.state && (t.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(e) && ((t = Object.create(t)).wrapped = !0), this.elementProperties.set(e, t), !t.noAccessor) {
|
|
659
659
|
const i = Symbol(), s = this.getPropertyDescriptor(e, i, t);
|
|
660
|
-
s !== void 0 &&
|
|
660
|
+
s !== void 0 && qt(this.prototype, e, s);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
static getPropertyDescriptor(e, t, i) {
|
|
664
|
-
const { get: s, set: o } =
|
|
664
|
+
const { get: s, set: o } = Vt(this.prototype, e) ?? { get() {
|
|
665
665
|
return this[t];
|
|
666
666
|
}, set(r) {
|
|
667
667
|
this[t] = r;
|
|
668
668
|
} };
|
|
669
669
|
return { get: s, set(r) {
|
|
670
|
-
const
|
|
671
|
-
o == null || o.call(this, r), this.requestUpdate(e,
|
|
670
|
+
const a = s == null ? void 0 : s.call(this);
|
|
671
|
+
o == null || o.call(this, r), this.requestUpdate(e, a, i);
|
|
672
672
|
}, configurable: !0, enumerable: !0 };
|
|
673
673
|
}
|
|
674
674
|
static getPropertyOptions(e) {
|
|
675
|
-
return this.elementProperties.get(e) ??
|
|
675
|
+
return this.elementProperties.get(e) ?? et;
|
|
676
676
|
}
|
|
677
677
|
static _$Ei() {
|
|
678
|
-
if (this.hasOwnProperty(
|
|
679
|
-
const e =
|
|
678
|
+
if (this.hasOwnProperty(ne("elementProperties"))) return;
|
|
679
|
+
const e = Yt(this);
|
|
680
680
|
e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties);
|
|
681
681
|
}
|
|
682
682
|
static finalize() {
|
|
683
|
-
if (this.hasOwnProperty(
|
|
684
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
685
|
-
const t = this.properties, i = [...
|
|
683
|
+
if (this.hasOwnProperty(ne("finalized"))) return;
|
|
684
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(ne("properties"))) {
|
|
685
|
+
const t = this.properties, i = [...Wt(t), ...Xt(t)];
|
|
686
686
|
for (const s of i) this.createProperty(s, t[s]);
|
|
687
687
|
}
|
|
688
688
|
const e = this[Symbol.metadata];
|
|
@@ -701,8 +701,8 @@ let Y = class extends HTMLElement {
|
|
|
701
701
|
const t = [];
|
|
702
702
|
if (Array.isArray(e)) {
|
|
703
703
|
const i = new Set(e.flat(1 / 0).reverse());
|
|
704
|
-
for (const s of i) t.unshift(
|
|
705
|
-
} else e !== void 0 && t.push(
|
|
704
|
+
for (const s of i) t.unshift(Ze(s));
|
|
705
|
+
} else e !== void 0 && t.push(Ze(e));
|
|
706
706
|
return t;
|
|
707
707
|
}
|
|
708
708
|
static _$Eu(e, t) {
|
|
@@ -731,7 +731,7 @@ let Y = class extends HTMLElement {
|
|
|
731
731
|
}
|
|
732
732
|
createRenderRoot() {
|
|
733
733
|
const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
734
|
-
return
|
|
734
|
+
return Nt(e, this.constructor.elementStyles), e;
|
|
735
735
|
}
|
|
736
736
|
connectedCallback() {
|
|
737
737
|
var e;
|
|
@@ -756,7 +756,7 @@ let Y = class extends HTMLElement {
|
|
|
756
756
|
var o;
|
|
757
757
|
const i = this.constructor.elementProperties.get(e), s = this.constructor._$Eu(e, i);
|
|
758
758
|
if (s !== void 0 && i.reflect === !0) {
|
|
759
|
-
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter :
|
|
759
|
+
const r = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : ke).toAttribute(t, i.type);
|
|
760
760
|
this._$Em = e, r == null ? this.removeAttribute(s) : this.setAttribute(s, r), this._$Em = null;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
@@ -764,17 +764,17 @@ let Y = class extends HTMLElement {
|
|
|
764
764
|
var o, r;
|
|
765
765
|
const i = this.constructor, s = i._$Eh.get(e);
|
|
766
766
|
if (s !== void 0 && this._$Em !== s) {
|
|
767
|
-
const
|
|
767
|
+
const a = i.getPropertyOptions(s), l = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((o = a.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? a.converter : ke;
|
|
768
768
|
this._$Em = s;
|
|
769
|
-
const
|
|
770
|
-
this[s] =
|
|
769
|
+
const d = l.fromAttribute(t, a.type);
|
|
770
|
+
this[s] = d ?? ((r = this._$Ej) == null ? void 0 : r.get(s)) ?? d, this._$Em = null;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
requestUpdate(e, t, i, s = !1, o) {
|
|
774
774
|
var r;
|
|
775
775
|
if (e !== void 0) {
|
|
776
|
-
const
|
|
777
|
-
if (s === !1 && (o = this[e]), i ?? (i =
|
|
776
|
+
const a = this.constructor;
|
|
777
|
+
if (s === !1 && (o = this[e]), i ?? (i = a.getPropertyOptions(e)), !((i.hasChanged ?? Ne)(o, t) || i.useDefault && i.reflect && o === ((r = this._$Ej) == null ? void 0 : r.get(e)) && !this.hasAttribute(a._$Eu(e, i)))) return;
|
|
778
778
|
this.C(e, t, i);
|
|
779
779
|
}
|
|
780
780
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
@@ -805,8 +805,8 @@ let Y = class extends HTMLElement {
|
|
|
805
805
|
}
|
|
806
806
|
const s = this.constructor.elementProperties;
|
|
807
807
|
if (s.size > 0) for (const [o, r] of s) {
|
|
808
|
-
const { wrapped:
|
|
809
|
-
|
|
808
|
+
const { wrapped: a } = r, l = this[o];
|
|
809
|
+
a !== !0 || this._$AL.has(o) || l === void 0 || this.C(o, void 0, r, l);
|
|
810
810
|
}
|
|
811
811
|
}
|
|
812
812
|
let e = !1;
|
|
@@ -850,76 +850,76 @@ let Y = class extends HTMLElement {
|
|
|
850
850
|
firstUpdated(e) {
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
|
-
|
|
853
|
+
G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementProperties")] = /* @__PURE__ */ new Map(), G[ne("finalized")] = /* @__PURE__ */ new Map(), _e == null || _e({ ReactiveElement: G }), (H.reactiveElementVersions ?? (H.reactiveElementVersions = [])).push("2.1.2");
|
|
854
854
|
/**
|
|
855
855
|
* @license
|
|
856
856
|
* Copyright 2017 Google LLC
|
|
857
857
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
858
858
|
*/
|
|
859
|
-
const
|
|
860
|
-
\f\r]`,
|
|
861
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
862
|
-
function
|
|
863
|
-
if (!
|
|
864
|
-
return
|
|
859
|
+
const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
|
|
860
|
+
\f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, N = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
|
|
861
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
|
|
862
|
+
function Pt(n, e) {
|
|
863
|
+
if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
864
|
+
return it !== void 0 ? it.createHTML(e) : e;
|
|
865
865
|
}
|
|
866
|
-
const
|
|
866
|
+
const Qt = (n, e) => {
|
|
867
867
|
const t = n.length - 1, i = [];
|
|
868
|
-
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r =
|
|
869
|
-
for (let
|
|
870
|
-
const
|
|
871
|
-
let c, h
|
|
872
|
-
for (;
|
|
873
|
-
const
|
|
874
|
-
o += r ===
|
|
875
|
-
}
|
|
876
|
-
return [
|
|
868
|
+
let s, o = e === 2 ? "<svg>" : e === 3 ? "<math>" : "", r = se;
|
|
869
|
+
for (let a = 0; a < t; a++) {
|
|
870
|
+
const l = n[a];
|
|
871
|
+
let d, c, h = -1, p = 0;
|
|
872
|
+
for (; p < l.length && (r.lastIndex = p, c = r.exec(l), c !== null); ) p = r.lastIndex, r === se ? c[1] === "!--" ? r = st : c[1] !== void 0 ? r = nt : c[2] !== void 0 ? (Tt.test(c[2]) && (s = RegExp("</" + c[2], "g")), r = N) : c[3] !== void 0 && (r = N) : r === N ? c[0] === ">" ? (r = s ?? se, h = -1) : c[1] === void 0 ? h = -2 : (h = r.lastIndex - c[2].length, d = c[1], r = c[3] === void 0 ? N : c[3] === '"' ? rt : ot) : r === rt || r === ot ? r = N : r === st || r === nt ? r = se : (r = N, s = void 0);
|
|
873
|
+
const m = r === N && n[a + 1].startsWith("/>") ? " " : "";
|
|
874
|
+
o += r === se ? l + Gt : h >= 0 ? (i.push(d), l.slice(0, h) + Et + l.slice(h) + D + m) : l + D + (h === -2 ? a : m);
|
|
875
|
+
}
|
|
876
|
+
return [Pt(n, o + (n[t] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), i];
|
|
877
877
|
};
|
|
878
|
-
class
|
|
878
|
+
class ce {
|
|
879
879
|
constructor({ strings: e, _$litType$: t }, i) {
|
|
880
880
|
let s;
|
|
881
881
|
this.parts = [];
|
|
882
882
|
let o = 0, r = 0;
|
|
883
|
-
const
|
|
884
|
-
if (this.el =
|
|
885
|
-
const
|
|
886
|
-
|
|
883
|
+
const a = e.length - 1, l = this.parts, [d, c] = Qt(e, t);
|
|
884
|
+
if (this.el = ce.createElement(d, i), F.currentNode = this.el.content, t === 2 || t === 3) {
|
|
885
|
+
const h = this.el.content.firstChild;
|
|
886
|
+
h.replaceWith(...h.childNodes);
|
|
887
887
|
}
|
|
888
|
-
for (; (s =
|
|
888
|
+
for (; (s = F.nextNode()) !== null && l.length < a; ) {
|
|
889
889
|
if (s.nodeType === 1) {
|
|
890
|
-
if (s.hasAttributes()) for (const
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
} else
|
|
894
|
-
if (
|
|
895
|
-
const
|
|
896
|
-
if (
|
|
897
|
-
s.textContent =
|
|
898
|
-
for (let
|
|
899
|
-
s.append(p
|
|
890
|
+
if (s.hasAttributes()) for (const h of s.getAttributeNames()) if (h.endsWith(Et)) {
|
|
891
|
+
const p = c[r++], m = s.getAttribute(h).split(D), g = /([.?@])?(.*)/.exec(p);
|
|
892
|
+
l.push({ type: 1, index: o, name: g[2], strings: m, ctor: g[1] === "." ? ti : g[1] === "?" ? ii : g[1] === "@" ? si : Se }), s.removeAttribute(h);
|
|
893
|
+
} else h.startsWith(D) && (l.push({ type: 6, index: o }), s.removeAttribute(h));
|
|
894
|
+
if (Tt.test(s.tagName)) {
|
|
895
|
+
const h = s.textContent.split(D), p = h.length - 1;
|
|
896
|
+
if (p > 0) {
|
|
897
|
+
s.textContent = Ee ? Ee.emptyScript : "";
|
|
898
|
+
for (let m = 0; m < p; m++) s.append(h[m], ae()), F.nextNode(), l.push({ type: 2, index: ++o });
|
|
899
|
+
s.append(h[p], ae());
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
|
-
} else if (s.nodeType === 8) if (s.data ===
|
|
902
|
+
} else if (s.nodeType === 8) if (s.data === Ct) l.push({ type: 2, index: o });
|
|
903
903
|
else {
|
|
904
|
-
let
|
|
905
|
-
for (; (
|
|
904
|
+
let h = -1;
|
|
905
|
+
for (; (h = s.data.indexOf(D, h + 1)) !== -1; ) l.push({ type: 7, index: o }), h += D.length - 1;
|
|
906
906
|
}
|
|
907
907
|
o++;
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
static createElement(e, t) {
|
|
911
|
-
const i =
|
|
911
|
+
const i = V.createElement("template");
|
|
912
912
|
return i.innerHTML = e, i;
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
|
-
function
|
|
916
|
-
var r,
|
|
917
|
-
if (e ===
|
|
915
|
+
function J(n, e, t = n, i) {
|
|
916
|
+
var r, a;
|
|
917
|
+
if (e === W) return e;
|
|
918
918
|
let s = i !== void 0 ? (r = t._$Co) == null ? void 0 : r[i] : t._$Cl;
|
|
919
|
-
const o =
|
|
920
|
-
return (s == null ? void 0 : s.constructor) !== o && ((
|
|
919
|
+
const o = le(e) ? void 0 : e._$litDirective$;
|
|
920
|
+
return (s == null ? void 0 : s.constructor) !== o && ((a = s == null ? void 0 : s._$AO) == null || a.call(s, !1), o === void 0 ? s = void 0 : (s = new o(n), s._$AT(n, t, i)), i !== void 0 ? (t._$Co ?? (t._$Co = []))[i] = s : t._$Cl = s), s !== void 0 && (e = J(n, s._$AS(n, e.values), s, i)), e;
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class ei {
|
|
923
923
|
constructor(e, t) {
|
|
924
924
|
this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = t;
|
|
925
925
|
}
|
|
@@ -930,30 +930,30 @@ class Zt {
|
|
|
930
930
|
return this._$AM._$AU;
|
|
931
931
|
}
|
|
932
932
|
u(e) {
|
|
933
|
-
const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ??
|
|
934
|
-
|
|
935
|
-
let o =
|
|
936
|
-
for (;
|
|
937
|
-
if (r ===
|
|
938
|
-
let
|
|
939
|
-
|
|
933
|
+
const { el: { content: t }, parts: i } = this._$AD, s = ((e == null ? void 0 : e.creationScope) ?? V).importNode(t, !0);
|
|
934
|
+
F.currentNode = s;
|
|
935
|
+
let o = F.nextNode(), r = 0, a = 0, l = i[0];
|
|
936
|
+
for (; l !== void 0; ) {
|
|
937
|
+
if (r === l.index) {
|
|
938
|
+
let d;
|
|
939
|
+
l.type === 2 ? d = new me(o, o.nextSibling, this, e) : l.type === 1 ? d = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (d = new ni(o, this, e)), this._$AV.push(d), l = i[++a];
|
|
940
940
|
}
|
|
941
|
-
r !== (
|
|
941
|
+
r !== (l == null ? void 0 : l.index) && (o = F.nextNode(), r++);
|
|
942
942
|
}
|
|
943
|
-
return
|
|
943
|
+
return F.currentNode = V, s;
|
|
944
944
|
}
|
|
945
945
|
p(e) {
|
|
946
946
|
let t = 0;
|
|
947
947
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(e, i, t), t += i.strings.length - 2) : i._$AI(e[t])), t++;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
class
|
|
950
|
+
class me {
|
|
951
951
|
get _$AU() {
|
|
952
952
|
var e;
|
|
953
953
|
return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
|
|
954
954
|
}
|
|
955
955
|
constructor(e, t, i, s) {
|
|
956
|
-
this.type = 2, this._$AH =
|
|
956
|
+
this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
|
|
957
957
|
}
|
|
958
958
|
get parentNode() {
|
|
959
959
|
let e = this._$AA.parentNode;
|
|
@@ -967,7 +967,7 @@ class ue {
|
|
|
967
967
|
return this._$AB;
|
|
968
968
|
}
|
|
969
969
|
_$AI(e, t = this) {
|
|
970
|
-
e =
|
|
970
|
+
e = J(this, e, t), le(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
|
|
971
971
|
}
|
|
972
972
|
O(e) {
|
|
973
973
|
return this._$AA.parentNode.insertBefore(e, this._$AB);
|
|
@@ -976,33 +976,33 @@ class ue {
|
|
|
976
976
|
this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
|
|
977
977
|
}
|
|
978
978
|
_(e) {
|
|
979
|
-
this._$AH !==
|
|
979
|
+
this._$AH !== b && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
|
|
980
980
|
}
|
|
981
981
|
$(e) {
|
|
982
982
|
var o;
|
|
983
|
-
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el =
|
|
983
|
+
const { values: t, _$litType$: i } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = ce.createElement(Pt(i.h, i.h[0]), this.options)), i);
|
|
984
984
|
if (((o = this._$AH) == null ? void 0 : o._$AD) === s) this._$AH.p(t);
|
|
985
985
|
else {
|
|
986
|
-
const r = new
|
|
987
|
-
r.p(t), this.T(
|
|
986
|
+
const r = new ei(s, this), a = r.u(this.options);
|
|
987
|
+
r.p(t), this.T(a), this._$AH = r;
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
_$AC(e) {
|
|
991
|
-
let t =
|
|
992
|
-
return t === void 0 &&
|
|
991
|
+
let t = at.get(e.strings);
|
|
992
|
+
return t === void 0 && at.set(e.strings, t = new ce(e)), t;
|
|
993
993
|
}
|
|
994
994
|
k(e) {
|
|
995
|
-
|
|
995
|
+
Fe(this._$AH) || (this._$AH = [], this._$AR());
|
|
996
996
|
const t = this._$AH;
|
|
997
997
|
let i, s = 0;
|
|
998
|
-
for (const o of e) s === t.length ? t.push(i = new
|
|
998
|
+
for (const o of e) s === t.length ? t.push(i = new me(this.O(ae()), this.O(ae()), this, this.options)) : i = t[s], i._$AI(o), s++;
|
|
999
999
|
s < t.length && (this._$AR(i && i._$AB.nextSibling, s), t.length = s);
|
|
1000
1000
|
}
|
|
1001
1001
|
_$AR(e = this._$AA.nextSibling, t) {
|
|
1002
1002
|
var i;
|
|
1003
1003
|
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, t); e !== this._$AB; ) {
|
|
1004
|
-
const s =
|
|
1005
|
-
|
|
1004
|
+
const s = tt(e).nextSibling;
|
|
1005
|
+
tt(e).remove(), e = s;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
setConnected(e) {
|
|
@@ -1010,7 +1010,7 @@ class ue {
|
|
|
1010
1010
|
this._$AM === void 0 && (this._$Cv = e, (t = this._$AP) == null || t.call(this, e));
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
|
-
class
|
|
1013
|
+
class Se {
|
|
1014
1014
|
get tagName() {
|
|
1015
1015
|
return this.element.tagName;
|
|
1016
1016
|
}
|
|
@@ -1018,46 +1018,46 @@ class Ee {
|
|
|
1018
1018
|
return this._$AM._$AU;
|
|
1019
1019
|
}
|
|
1020
1020
|
constructor(e, t, i, s, o) {
|
|
1021
|
-
this.type = 1, this._$AH =
|
|
1021
|
+
this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = b;
|
|
1022
1022
|
}
|
|
1023
1023
|
_$AI(e, t = this, i, s) {
|
|
1024
1024
|
const o = this.strings;
|
|
1025
1025
|
let r = !1;
|
|
1026
|
-
if (o === void 0) e =
|
|
1026
|
+
if (o === void 0) e = J(this, e, t, 0), r = !le(e) || e !== this._$AH && e !== W, r && (this._$AH = e);
|
|
1027
1027
|
else {
|
|
1028
|
-
const
|
|
1029
|
-
let
|
|
1030
|
-
for (e = o[0],
|
|
1028
|
+
const a = e;
|
|
1029
|
+
let l, d;
|
|
1030
|
+
for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === b ? e = b : e !== b && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
|
|
1031
1031
|
}
|
|
1032
1032
|
r && !s && this.j(e);
|
|
1033
1033
|
}
|
|
1034
1034
|
j(e) {
|
|
1035
|
-
e ===
|
|
1035
|
+
e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
class
|
|
1038
|
+
class ti extends Se {
|
|
1039
1039
|
constructor() {
|
|
1040
1040
|
super(...arguments), this.type = 3;
|
|
1041
1041
|
}
|
|
1042
1042
|
j(e) {
|
|
1043
|
-
this.element[this.name] = e ===
|
|
1043
|
+
this.element[this.name] = e === b ? void 0 : e;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
|
-
class
|
|
1046
|
+
class ii extends Se {
|
|
1047
1047
|
constructor() {
|
|
1048
1048
|
super(...arguments), this.type = 4;
|
|
1049
1049
|
}
|
|
1050
1050
|
j(e) {
|
|
1051
|
-
this.element.toggleAttribute(this.name, !!e && e !==
|
|
1051
|
+
this.element.toggleAttribute(this.name, !!e && e !== b);
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
class
|
|
1054
|
+
class si extends Se {
|
|
1055
1055
|
constructor(e, t, i, s, o) {
|
|
1056
1056
|
super(e, t, i, s, o), this.type = 5;
|
|
1057
1057
|
}
|
|
1058
1058
|
_$AI(e, t = this) {
|
|
1059
|
-
if ((e =
|
|
1060
|
-
const i = this._$AH, s = e ===
|
|
1059
|
+
if ((e = J(this, e, t, 0) ?? b) === W) return;
|
|
1060
|
+
const i = this._$AH, s = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== b && (i === b || s);
|
|
1061
1061
|
s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
|
|
1062
1062
|
}
|
|
1063
1063
|
handleEvent(e) {
|
|
@@ -1065,7 +1065,7 @@ class ei extends Ee {
|
|
|
1065
1065
|
typeof this._$AH == "function" ? this._$AH.call(((t = this.options) == null ? void 0 : t.host) ?? this.element, e) : this._$AH.handleEvent(e);
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
class
|
|
1068
|
+
class ni {
|
|
1069
1069
|
constructor(e, t, i) {
|
|
1070
1070
|
this.element = e, this.type = 6, this._$AN = void 0, this._$AM = t, this.options = i;
|
|
1071
1071
|
}
|
|
@@ -1073,17 +1073,17 @@ class ti {
|
|
|
1073
1073
|
return this._$AM._$AU;
|
|
1074
1074
|
}
|
|
1075
1075
|
_$AI(e) {
|
|
1076
|
-
|
|
1076
|
+
J(this, e);
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1079
|
+
const Me = oe.litHtmlPolyfillSupport;
|
|
1080
|
+
Me == null || Me(ce, me), (oe.litHtmlVersions ?? (oe.litHtmlVersions = [])).push("3.3.2");
|
|
1081
|
+
const oi = (n, e, t) => {
|
|
1082
1082
|
const i = (t == null ? void 0 : t.renderBefore) ?? e;
|
|
1083
1083
|
let s = i._$litPart$;
|
|
1084
1084
|
if (s === void 0) {
|
|
1085
1085
|
const o = (t == null ? void 0 : t.renderBefore) ?? null;
|
|
1086
|
-
i._$litPart$ = s = new
|
|
1086
|
+
i._$litPart$ = s = new me(e.insertBefore(ae(), o), o, void 0, t ?? {});
|
|
1087
1087
|
}
|
|
1088
1088
|
return s._$AI(n), s;
|
|
1089
1089
|
};
|
|
@@ -1092,8 +1092,8 @@ const ii = (n, e, t) => {
|
|
|
1092
1092
|
* Copyright 2017 Google LLC
|
|
1093
1093
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1094
1094
|
*/
|
|
1095
|
-
const
|
|
1096
|
-
let
|
|
1095
|
+
const q = globalThis;
|
|
1096
|
+
let P = class extends G {
|
|
1097
1097
|
constructor() {
|
|
1098
1098
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1099
1099
|
}
|
|
@@ -1104,7 +1104,7 @@ let S = class extends Y {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
update(e) {
|
|
1106
1106
|
const t = this.render();
|
|
1107
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do =
|
|
1107
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = oi(t, this.renderRoot, this.renderOptions);
|
|
1108
1108
|
}
|
|
1109
1109
|
connectedCallback() {
|
|
1110
1110
|
var e;
|
|
@@ -1115,20 +1115,20 @@ let S = class extends Y {
|
|
|
1115
1115
|
super.disconnectedCallback(), (e = this._$Do) == null || e.setConnected(!1);
|
|
1116
1116
|
}
|
|
1117
1117
|
render() {
|
|
1118
|
-
return
|
|
1118
|
+
return W;
|
|
1119
1119
|
}
|
|
1120
1120
|
};
|
|
1121
|
-
var
|
|
1122
|
-
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
(
|
|
1121
|
+
var yt;
|
|
1122
|
+
P._$litElement$ = !0, P.finalized = !0, (yt = q.litElementHydrateSupport) == null || yt.call(q, { LitElement: P });
|
|
1123
|
+
const Oe = q.litElementPolyfillSupport;
|
|
1124
|
+
Oe == null || Oe({ LitElement: P });
|
|
1125
|
+
(q.litElementVersions ?? (q.litElementVersions = [])).push("4.2.2");
|
|
1126
1126
|
/**
|
|
1127
1127
|
* @license
|
|
1128
1128
|
* Copyright 2017 Google LLC
|
|
1129
1129
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1130
1130
|
*/
|
|
1131
|
-
const
|
|
1131
|
+
const L = (n) => (e, t) => {
|
|
1132
1132
|
t !== void 0 ? t.addInitializer(() => {
|
|
1133
1133
|
customElements.define(n, e);
|
|
1134
1134
|
}) : customElements.define(n, e);
|
|
@@ -1138,29 +1138,29 @@ const R = (n) => (e, t) => {
|
|
|
1138
1138
|
* Copyright 2017 Google LLC
|
|
1139
1139
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1140
1140
|
*/
|
|
1141
|
-
const
|
|
1141
|
+
const ri = { attribute: !0, type: String, converter: ke, reflect: !1, hasChanged: Ne }, ai = (n = ri, e, t) => {
|
|
1142
1142
|
const { kind: i, metadata: s } = t;
|
|
1143
1143
|
let o = globalThis.litPropertyMetadata.get(s);
|
|
1144
1144
|
if (o === void 0 && globalThis.litPropertyMetadata.set(s, o = /* @__PURE__ */ new Map()), i === "setter" && ((n = Object.create(n)).wrapped = !0), o.set(t.name, n), i === "accessor") {
|
|
1145
1145
|
const { name: r } = t;
|
|
1146
|
-
return { set(
|
|
1147
|
-
const
|
|
1148
|
-
e.set.call(this,
|
|
1149
|
-
}, init(
|
|
1150
|
-
return
|
|
1146
|
+
return { set(a) {
|
|
1147
|
+
const l = e.get.call(this);
|
|
1148
|
+
e.set.call(this, a), this.requestUpdate(r, l, n, !0, a);
|
|
1149
|
+
}, init(a) {
|
|
1150
|
+
return a !== void 0 && this.C(r, void 0, n, a), a;
|
|
1151
1151
|
} };
|
|
1152
1152
|
}
|
|
1153
1153
|
if (i === "setter") {
|
|
1154
1154
|
const { name: r } = t;
|
|
1155
|
-
return function(
|
|
1156
|
-
const
|
|
1157
|
-
e.call(this,
|
|
1155
|
+
return function(a) {
|
|
1156
|
+
const l = this[r];
|
|
1157
|
+
e.call(this, a), this.requestUpdate(r, l, n, !0, a);
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
1160
|
throw Error("Unsupported decorator location: " + i);
|
|
1161
1161
|
};
|
|
1162
|
-
function
|
|
1163
|
-
return (e, t) => typeof t == "object" ?
|
|
1162
|
+
function x(n) {
|
|
1163
|
+
return (e, t) => typeof t == "object" ? ai(n, e, t) : ((i, s, o) => {
|
|
1164
1164
|
const r = s.hasOwnProperty(o);
|
|
1165
1165
|
return s.constructor.createProperty(o, i), r ? Object.getOwnPropertyDescriptor(s, o) : void 0;
|
|
1166
1166
|
})(n, e, t);
|
|
@@ -1170,16 +1170,16 @@ function v(n) {
|
|
|
1170
1170
|
* Copyright 2017 Google LLC
|
|
1171
1171
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1172
1172
|
*/
|
|
1173
|
-
function
|
|
1174
|
-
return
|
|
1173
|
+
function $(n) {
|
|
1174
|
+
return x({ ...n, state: !0, attribute: !1 });
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1177
|
-
var
|
|
1178
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1176
|
+
const Q = "pulse-client";
|
|
1177
|
+
var li = Object.defineProperty, ci = Object.getOwnPropertyDescriptor, ee = (n, e, t, i) => {
|
|
1178
|
+
for (var s = i > 1 ? void 0 : i ? ci(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1179
1179
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1180
|
-
return i && s &&
|
|
1180
|
+
return i && s && li(e, t, s), s;
|
|
1181
1181
|
};
|
|
1182
|
-
let
|
|
1182
|
+
let X = class extends P {
|
|
1183
1183
|
constructor() {
|
|
1184
1184
|
super(...arguments), this.apiKey = "", this.token = "", this.room = "";
|
|
1185
1185
|
}
|
|
@@ -1191,40 +1191,40 @@ let q = class extends S {
|
|
|
1191
1191
|
room: this.room,
|
|
1192
1192
|
endpoint: this.endpoint
|
|
1193
1193
|
};
|
|
1194
|
-
this.client = new
|
|
1194
|
+
this.client = new $t(n), this.client.connect();
|
|
1195
1195
|
}
|
|
1196
1196
|
disconnectedCallback() {
|
|
1197
1197
|
var n;
|
|
1198
1198
|
super.disconnectedCallback(), (n = this.client) == null || n.disconnect();
|
|
1199
1199
|
}
|
|
1200
1200
|
render() {
|
|
1201
|
-
return
|
|
1201
|
+
return u`<slot></slot>`;
|
|
1202
1202
|
}
|
|
1203
1203
|
};
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
],
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
],
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
],
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
],
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
],
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
],
|
|
1222
|
-
var
|
|
1223
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1204
|
+
ee([
|
|
1205
|
+
x({ attribute: "api-key" })
|
|
1206
|
+
], X.prototype, "apiKey", 2);
|
|
1207
|
+
ee([
|
|
1208
|
+
x()
|
|
1209
|
+
], X.prototype, "token", 2);
|
|
1210
|
+
ee([
|
|
1211
|
+
x()
|
|
1212
|
+
], X.prototype, "room", 2);
|
|
1213
|
+
ee([
|
|
1214
|
+
x()
|
|
1215
|
+
], X.prototype, "endpoint", 2);
|
|
1216
|
+
ee([
|
|
1217
|
+
Lt({ context: Q })
|
|
1218
|
+
], X.prototype, "client", 2);
|
|
1219
|
+
X = ee([
|
|
1220
|
+
L("pulse-provider")
|
|
1221
|
+
], X);
|
|
1222
|
+
var di = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, Pe = (n, e, t, i) => {
|
|
1223
|
+
for (var s = i > 1 ? void 0 : i ? hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1224
1224
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1225
|
-
return i && s &&
|
|
1225
|
+
return i && s && di(e, t, s), s;
|
|
1226
1226
|
};
|
|
1227
|
-
let
|
|
1227
|
+
let Z = class extends P {
|
|
1228
1228
|
constructor() {
|
|
1229
1229
|
super(...arguments), this.maxVisible = 5, this.users = [];
|
|
1230
1230
|
}
|
|
@@ -1249,16 +1249,16 @@ let G = class extends S {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
render() {
|
|
1251
1251
|
const n = this.users.slice(0, this.maxVisible), e = this.users.length - this.maxVisible;
|
|
1252
|
-
return
|
|
1252
|
+
return u`
|
|
1253
1253
|
<div class="avatars">
|
|
1254
|
-
${e > 0 ?
|
|
1254
|
+
${e > 0 ? u`<div class="overflow">+${e}</div>` : null}
|
|
1255
1255
|
${n.map(
|
|
1256
|
-
(t) =>
|
|
1256
|
+
(t) => u`
|
|
1257
1257
|
<div
|
|
1258
1258
|
class="avatar"
|
|
1259
1259
|
style="background:${t.user.color}"
|
|
1260
1260
|
>
|
|
1261
|
-
${t.user.avatar ?
|
|
1261
|
+
${t.user.avatar ? u`<img src="${t.user.avatar}" alt="${t.user.name}" />` : this.getInitials(t.user.name)}
|
|
1262
1262
|
<span class="status-ring ${t.status}"></span>
|
|
1263
1263
|
<span class="tooltip">${t.user.name}</span>
|
|
1264
1264
|
</div>
|
|
@@ -1268,7 +1268,7 @@ let G = class extends S {
|
|
|
1268
1268
|
`;
|
|
1269
1269
|
}
|
|
1270
1270
|
};
|
|
1271
|
-
|
|
1271
|
+
Z.styles = M`
|
|
1272
1272
|
:host {
|
|
1273
1273
|
display: inline-flex;
|
|
1274
1274
|
align-items: center;
|
|
@@ -1372,25 +1372,25 @@ G.styles = M`
|
|
|
1372
1372
|
opacity: 1;
|
|
1373
1373
|
}
|
|
1374
1374
|
`;
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
],
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
],
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
],
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
],
|
|
1388
|
-
var
|
|
1389
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1375
|
+
Pe([
|
|
1376
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1377
|
+
x({ attribute: !1 })
|
|
1378
|
+
], Z.prototype, "client", 2);
|
|
1379
|
+
Pe([
|
|
1380
|
+
x({ type: Number, attribute: "max-visible" })
|
|
1381
|
+
], Z.prototype, "maxVisible", 2);
|
|
1382
|
+
Pe([
|
|
1383
|
+
$()
|
|
1384
|
+
], Z.prototype, "users", 2);
|
|
1385
|
+
Z = Pe([
|
|
1386
|
+
L("pulse-presence")
|
|
1387
|
+
], Z);
|
|
1388
|
+
var pi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, qe = (n, e, t, i) => {
|
|
1389
|
+
for (var s = i > 1 ? void 0 : i ? ui(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1390
1390
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1391
|
-
return i && s &&
|
|
1391
|
+
return i && s && pi(e, t, s), s;
|
|
1392
1392
|
};
|
|
1393
|
-
let
|
|
1393
|
+
let de = class extends P {
|
|
1394
1394
|
constructor() {
|
|
1395
1395
|
super(...arguments), this.cursors = /* @__PURE__ */ new Map(), this.unsubs = [], this.handleLocalCursor = (n) => {
|
|
1396
1396
|
var e;
|
|
@@ -1444,9 +1444,9 @@ let le = class extends S {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
render() {
|
|
1446
1446
|
const n = [...this.cursors.values()];
|
|
1447
|
-
return
|
|
1447
|
+
return u`
|
|
1448
1448
|
${n.map(
|
|
1449
|
-
(e) =>
|
|
1449
|
+
(e) => u`
|
|
1450
1450
|
<div
|
|
1451
1451
|
class="cursor"
|
|
1452
1452
|
style="transform:translate(${e.position.x}px,${e.position.y}px)"
|
|
@@ -1467,7 +1467,7 @@ let le = class extends S {
|
|
|
1467
1467
|
`;
|
|
1468
1468
|
}
|
|
1469
1469
|
};
|
|
1470
|
-
|
|
1470
|
+
de.styles = M`
|
|
1471
1471
|
:host {
|
|
1472
1472
|
position: fixed;
|
|
1473
1473
|
top: 0;
|
|
@@ -1504,22 +1504,22 @@ le.styles = M`
|
|
|
1504
1504
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1505
1505
|
}
|
|
1506
1506
|
`;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
],
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
],
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
],
|
|
1517
|
-
var
|
|
1518
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1507
|
+
qe([
|
|
1508
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1509
|
+
x({ attribute: !1 })
|
|
1510
|
+
], de.prototype, "client", 2);
|
|
1511
|
+
qe([
|
|
1512
|
+
$()
|
|
1513
|
+
], de.prototype, "cursors", 2);
|
|
1514
|
+
de = qe([
|
|
1515
|
+
L("pulse-cursors")
|
|
1516
|
+
], de);
|
|
1517
|
+
var fi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, ge = (n, e, t, i) => {
|
|
1518
|
+
for (var s = i > 1 ? void 0 : i ? mi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1519
1519
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1520
|
-
return i && s &&
|
|
1520
|
+
return i && s && fi(e, t, s), s;
|
|
1521
1521
|
};
|
|
1522
|
-
let
|
|
1522
|
+
let Y = class extends P {
|
|
1523
1523
|
constructor() {
|
|
1524
1524
|
super(...arguments), this.showResolved = !1, this.threads = [], this.replyingTo = null;
|
|
1525
1525
|
}
|
|
@@ -1541,7 +1541,7 @@ let W = class extends S {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
parseMentions(n) {
|
|
1543
1543
|
return n.split(/(@\w+)/g).map(
|
|
1544
|
-
(t) => t.startsWith("@") ?
|
|
1544
|
+
(t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
|
|
1545
1545
|
);
|
|
1546
1546
|
}
|
|
1547
1547
|
getInitials(n) {
|
|
@@ -1567,9 +1567,9 @@ let W = class extends S {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
render() {
|
|
1569
1569
|
const n = this.showResolved ? this.threads : this.threads.filter((e) => !e.resolved);
|
|
1570
|
-
return
|
|
1570
|
+
return u`
|
|
1571
1571
|
<div class="threads">
|
|
1572
|
-
${n.length === 0 ?
|
|
1572
|
+
${n.length === 0 ? u`<div class="empty">
|
|
1573
1573
|
<div class="empty-icon">💬</div>
|
|
1574
1574
|
No comments yet.<br>Start a conversation below.
|
|
1575
1575
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -1583,12 +1583,12 @@ let W = class extends S {
|
|
|
1583
1583
|
`;
|
|
1584
1584
|
}
|
|
1585
1585
|
renderThread(n) {
|
|
1586
|
-
return
|
|
1586
|
+
return u`
|
|
1587
1587
|
<div class="thread ${n.resolved ? "resolved" : ""}">
|
|
1588
1588
|
${n.comments.map((e, t) => {
|
|
1589
1589
|
const i = this.getUserForComment(e.userId);
|
|
1590
|
-
return
|
|
1591
|
-
${t > 0 ?
|
|
1590
|
+
return u`
|
|
1591
|
+
${t > 0 ? u`<div class="divider"></div>` : b}
|
|
1592
1592
|
<div class="comment">
|
|
1593
1593
|
<div class="comment-header">
|
|
1594
1594
|
<div
|
|
@@ -1620,12 +1620,12 @@ let W = class extends S {
|
|
|
1620
1620
|
${n.resolved ? "Reopen" : "Resolve"}
|
|
1621
1621
|
</button>
|
|
1622
1622
|
</div>
|
|
1623
|
-
${this.replyingTo === n.id ?
|
|
1623
|
+
${this.replyingTo === n.id ? u`
|
|
1624
1624
|
<form class="reply-form" @submit=${(e) => this.handleReply(n.id, e)}>
|
|
1625
1625
|
<input type="text" placeholder="Write a reply..." />
|
|
1626
1626
|
<button type="submit">Send</button>
|
|
1627
1627
|
</form>
|
|
1628
|
-
` :
|
|
1628
|
+
` : b}
|
|
1629
1629
|
</div>
|
|
1630
1630
|
`;
|
|
1631
1631
|
}
|
|
@@ -1637,7 +1637,7 @@ let W = class extends S {
|
|
|
1637
1637
|
return o < 24 ? `${o}h ago` : e.toLocaleDateString();
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
1640
|
-
|
|
1640
|
+
Y.styles = M`
|
|
1641
1641
|
:host {
|
|
1642
1642
|
display: block;
|
|
1643
1643
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -1849,41 +1849,41 @@ W.styles = M`
|
|
|
1849
1849
|
opacity: 0.4;
|
|
1850
1850
|
}
|
|
1851
1851
|
`;
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
],
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
],
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
],
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
],
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
],
|
|
1868
|
-
var
|
|
1869
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
1852
|
+
ge([
|
|
1853
|
+
fe({ context: Q, subscribe: !0 }),
|
|
1854
|
+
x({ attribute: !1 })
|
|
1855
|
+
], Y.prototype, "client", 2);
|
|
1856
|
+
ge([
|
|
1857
|
+
x({ type: Boolean, attribute: "show-resolved" })
|
|
1858
|
+
], Y.prototype, "showResolved", 2);
|
|
1859
|
+
ge([
|
|
1860
|
+
$()
|
|
1861
|
+
], Y.prototype, "threads", 2);
|
|
1862
|
+
ge([
|
|
1863
|
+
$()
|
|
1864
|
+
], Y.prototype, "replyingTo", 2);
|
|
1865
|
+
Y = ge([
|
|
1866
|
+
L("pulse-comments")
|
|
1867
|
+
], Y);
|
|
1868
|
+
var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
|
|
1869
|
+
for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
1870
1870
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
1871
|
-
return i && s &&
|
|
1871
|
+
return i && s && gi(e, t, s), s;
|
|
1872
1872
|
};
|
|
1873
|
-
const
|
|
1873
|
+
const vi = {
|
|
1874
1874
|
"comment:created": "left a comment",
|
|
1875
1875
|
"comment:mention": "mentioned you",
|
|
1876
1876
|
"comment:reply": "replied to your comment",
|
|
1877
1877
|
"thread:resolved": "resolved a thread",
|
|
1878
1878
|
"reaction:added": "reacted to your comment"
|
|
1879
|
-
},
|
|
1879
|
+
}, xi = {
|
|
1880
1880
|
"comment:created": "💬",
|
|
1881
1881
|
"comment:mention": "📣",
|
|
1882
1882
|
"comment:reply": "↩️",
|
|
1883
1883
|
"thread:resolved": "✅",
|
|
1884
1884
|
"reaction:added": "🎉"
|
|
1885
1885
|
};
|
|
1886
|
-
let
|
|
1886
|
+
let he = class extends P {
|
|
1887
1887
|
constructor() {
|
|
1888
1888
|
super(...arguments), this.notifications = [];
|
|
1889
1889
|
}
|
|
@@ -1930,31 +1930,31 @@ let ce = class extends S {
|
|
|
1930
1930
|
}
|
|
1931
1931
|
render() {
|
|
1932
1932
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
1933
|
-
return
|
|
1933
|
+
return u`
|
|
1934
1934
|
<div class="header">
|
|
1935
1935
|
<span class="title">
|
|
1936
1936
|
Notifications
|
|
1937
|
-
${n > 0 ?
|
|
1937
|
+
${n > 0 ? u`<span class="badge">${n}</span>` : b}
|
|
1938
1938
|
</span>
|
|
1939
|
-
${n > 0 ?
|
|
1939
|
+
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
1940
1940
|
Mark all read
|
|
1941
|
-
</button>` :
|
|
1941
|
+
</button>` : b}
|
|
1942
1942
|
</div>
|
|
1943
1943
|
<div class="list">
|
|
1944
|
-
${this.notifications.length === 0 ?
|
|
1944
|
+
${this.notifications.length === 0 ? u`<div class="empty">
|
|
1945
1945
|
<div class="empty-icon">🔔</div>
|
|
1946
1946
|
No notifications yet
|
|
1947
1947
|
</div>` : this.notifications.map(
|
|
1948
|
-
(e) =>
|
|
1948
|
+
(e) => u`
|
|
1949
1949
|
<div
|
|
1950
1950
|
class="item ${e.read ? "" : "unread"}"
|
|
1951
1951
|
@click=${() => this.handleClick(e)}
|
|
1952
1952
|
>
|
|
1953
|
-
<span class="icon">${
|
|
1953
|
+
<span class="icon">${xi[e.type] ?? "🔔"}</span>
|
|
1954
1954
|
<div class="content">
|
|
1955
1955
|
<div class="text">
|
|
1956
1956
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
1957
|
-
${
|
|
1957
|
+
${vi[e.type] ?? e.type}
|
|
1958
1958
|
</div>
|
|
1959
1959
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
1960
1960
|
</div>
|
|
@@ -1966,7 +1966,7 @@ let ce = class extends S {
|
|
|
1966
1966
|
`;
|
|
1967
1967
|
}
|
|
1968
1968
|
};
|
|
1969
|
-
|
|
1969
|
+
he.styles = M`
|
|
1970
1970
|
:host {
|
|
1971
1971
|
display: block;
|
|
1972
1972
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
|
@@ -2107,23 +2107,23 @@ ce.styles = M`
|
|
|
2107
2107
|
opacity: 0.4;
|
|
2108
2108
|
}
|
|
2109
2109
|
`;
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
],
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
],
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
],
|
|
2120
|
-
var
|
|
2121
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2110
|
+
Ve([
|
|
2111
|
+
fe({ context: Q, subscribe: !0 }),
|
|
2112
|
+
x({ attribute: !1 })
|
|
2113
|
+
], he.prototype, "client", 2);
|
|
2114
|
+
Ve([
|
|
2115
|
+
$()
|
|
2116
|
+
], he.prototype, "notifications", 2);
|
|
2117
|
+
he = Ve([
|
|
2118
|
+
L("pulse-notifications")
|
|
2119
|
+
], he);
|
|
2120
|
+
var yi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, te = (n, e, t, i) => {
|
|
2121
|
+
for (var s = i > 1 ? void 0 : i ? wi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2122
2122
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2123
|
-
return i && s &&
|
|
2123
|
+
return i && s && yi(e, t, s), s;
|
|
2124
2124
|
};
|
|
2125
|
-
const
|
|
2126
|
-
let
|
|
2125
|
+
const $i = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
2126
|
+
let B = class extends P {
|
|
2127
2127
|
constructor() {
|
|
2128
2128
|
super(...arguments), this.targetId = "", this.targetType = "comment", this.reactions = [], this.showPicker = !1;
|
|
2129
2129
|
}
|
|
@@ -2163,9 +2163,9 @@ let D = class extends S {
|
|
|
2163
2163
|
}
|
|
2164
2164
|
render() {
|
|
2165
2165
|
const n = this.groupReactions();
|
|
2166
|
-
return
|
|
2166
|
+
return u`
|
|
2167
2167
|
${n.map(
|
|
2168
|
-
(e) =>
|
|
2168
|
+
(e) => u`
|
|
2169
2169
|
<button
|
|
2170
2170
|
class="reaction ${e.userReactionId ? "active" : ""}"
|
|
2171
2171
|
@click=${() => this.toggleReaction(e)}
|
|
@@ -2182,22 +2182,22 @@ let D = class extends S {
|
|
|
2182
2182
|
>
|
|
2183
2183
|
+
|
|
2184
2184
|
</button>
|
|
2185
|
-
${this.showPicker ?
|
|
2185
|
+
${this.showPicker ? u`
|
|
2186
2186
|
<div class="picker">
|
|
2187
|
-
${
|
|
2188
|
-
(e) =>
|
|
2187
|
+
${$i.map(
|
|
2188
|
+
(e) => u`
|
|
2189
2189
|
<button @click=${() => this.addEmoji(e)}>
|
|
2190
2190
|
${e}
|
|
2191
2191
|
</button>
|
|
2192
2192
|
`
|
|
2193
2193
|
)}
|
|
2194
2194
|
</div>
|
|
2195
|
-
` :
|
|
2195
|
+
` : b}
|
|
2196
2196
|
</div>
|
|
2197
2197
|
`;
|
|
2198
2198
|
}
|
|
2199
2199
|
};
|
|
2200
|
-
|
|
2200
|
+
B.styles = M`
|
|
2201
2201
|
:host {
|
|
2202
2202
|
display: inline-flex;
|
|
2203
2203
|
align-items: center;
|
|
@@ -2309,32 +2309,32 @@ D.styles = M`
|
|
|
2309
2309
|
transform: scale(1.2);
|
|
2310
2310
|
}
|
|
2311
2311
|
`;
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
],
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
],
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
],
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
],
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
],
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
],
|
|
2312
|
+
te([
|
|
2313
|
+
fe({ context: Q, subscribe: !0 }),
|
|
2314
|
+
x({ attribute: !1 })
|
|
2315
|
+
], B.prototype, "client", 2);
|
|
2316
|
+
te([
|
|
2317
|
+
x({ attribute: "target-id" })
|
|
2318
|
+
], B.prototype, "targetId", 2);
|
|
2319
|
+
te([
|
|
2320
|
+
x({ attribute: "target-type" })
|
|
2321
|
+
], B.prototype, "targetType", 2);
|
|
2322
|
+
te([
|
|
2323
|
+
$()
|
|
2324
|
+
], B.prototype, "reactions", 2);
|
|
2325
|
+
te([
|
|
2326
|
+
$()
|
|
2327
|
+
], B.prototype, "showPicker", 2);
|
|
2328
|
+
B = te([
|
|
2329
|
+
L("pulse-reactions")
|
|
2330
|
+
], B);
|
|
2331
2331
|
/**
|
|
2332
2332
|
* @license
|
|
2333
2333
|
* Copyright 2017 Google LLC
|
|
2334
2334
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2335
2335
|
*/
|
|
2336
|
-
const
|
|
2337
|
-
class
|
|
2336
|
+
const ki = { CHILD: 2 }, Ei = (n) => (...e) => ({ _$litDirective$: n, values: e });
|
|
2337
|
+
class Ci {
|
|
2338
2338
|
constructor(e) {
|
|
2339
2339
|
}
|
|
2340
2340
|
get _$AU() {
|
|
@@ -2355,13 +2355,13 @@ class $i {
|
|
|
2355
2355
|
* Copyright 2017 Google LLC
|
|
2356
2356
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2357
2357
|
*/
|
|
2358
|
-
class
|
|
2358
|
+
class Re extends Ci {
|
|
2359
2359
|
constructor(e) {
|
|
2360
|
-
if (super(e), this.it =
|
|
2360
|
+
if (super(e), this.it = b, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
2361
2361
|
}
|
|
2362
2362
|
render(e) {
|
|
2363
|
-
if (e ===
|
|
2364
|
-
if (e ===
|
|
2363
|
+
if (e === b || e == null) return this._t = void 0, this.it = e;
|
|
2364
|
+
if (e === W) return e;
|
|
2365
2365
|
if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
2366
2366
|
if (e === this.it) return this._t;
|
|
2367
2367
|
this.it = e;
|
|
@@ -2369,23 +2369,23 @@ class Ie extends $i {
|
|
|
2369
2369
|
return t.raw = t, this._t = { _$litType$: this.constructor.resultType, strings: t, values: [] };
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
Re.directiveName = "unsafeHTML", Re.resultType = 1;
|
|
2373
2373
|
/**
|
|
2374
2374
|
* @license
|
|
2375
2375
|
* Copyright 2017 Google LLC
|
|
2376
2376
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2377
2377
|
*/
|
|
2378
|
-
class
|
|
2378
|
+
class Le extends Re {
|
|
2379
2379
|
}
|
|
2380
|
-
|
|
2381
|
-
const
|
|
2380
|
+
Le.directiveName = "unsafeSVG", Le.resultType = 2;
|
|
2381
|
+
const Ti = Ei(Le);
|
|
2382
2382
|
/**
|
|
2383
2383
|
* @license lucide v0.577.0 - ISC
|
|
2384
2384
|
*
|
|
2385
2385
|
* This source code is licensed under the ISC license.
|
|
2386
2386
|
* See the LICENSE file in the root directory of this source tree.
|
|
2387
2387
|
*/
|
|
2388
|
-
const
|
|
2388
|
+
const Si = [
|
|
2389
2389
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0" }],
|
|
2390
2390
|
[
|
|
2391
2391
|
"path",
|
|
@@ -2400,7 +2400,7 @@ const Ei = [
|
|
|
2400
2400
|
* This source code is licensed under the ISC license.
|
|
2401
2401
|
* See the LICENSE file in the root directory of this source tree.
|
|
2402
2402
|
*/
|
|
2403
|
-
const
|
|
2403
|
+
const Pi = [
|
|
2404
2404
|
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
2405
2405
|
["path", { d: "M12 6v6l4 2" }]
|
|
2406
2406
|
];
|
|
@@ -2410,7 +2410,7 @@ const Ci = [
|
|
|
2410
2410
|
* This source code is licensed under the ISC license.
|
|
2411
2411
|
* See the LICENSE file in the root directory of this source tree.
|
|
2412
2412
|
*/
|
|
2413
|
-
const
|
|
2413
|
+
const Ai = [
|
|
2414
2414
|
[
|
|
2415
2415
|
"path",
|
|
2416
2416
|
{
|
|
@@ -2424,7 +2424,7 @@ const _i = [
|
|
|
2424
2424
|
* This source code is licensed under the ISC license.
|
|
2425
2425
|
* See the LICENSE file in the root directory of this source tree.
|
|
2426
2426
|
*/
|
|
2427
|
-
const
|
|
2427
|
+
const _i = [
|
|
2428
2428
|
["path", { d: "M12 19v3" }],
|
|
2429
2429
|
["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2" }],
|
|
2430
2430
|
["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3" }]
|
|
@@ -2435,7 +2435,7 @@ const Ti = [
|
|
|
2435
2435
|
* This source code is licensed under the ISC license.
|
|
2436
2436
|
* See the LICENSE file in the root directory of this source tree.
|
|
2437
2437
|
*/
|
|
2438
|
-
const
|
|
2438
|
+
const Ii = [
|
|
2439
2439
|
[
|
|
2440
2440
|
"path",
|
|
2441
2441
|
{
|
|
@@ -2449,7 +2449,7 @@ const Si = [
|
|
|
2449
2449
|
* This source code is licensed under the ISC license.
|
|
2450
2450
|
* See the LICENSE file in the root directory of this source tree.
|
|
2451
2451
|
*/
|
|
2452
|
-
const
|
|
2452
|
+
const Mi = [
|
|
2453
2453
|
[
|
|
2454
2454
|
"path",
|
|
2455
2455
|
{
|
|
@@ -2471,7 +2471,7 @@ const Pi = [
|
|
|
2471
2471
|
* This source code is licensed under the ISC license.
|
|
2472
2472
|
* See the LICENSE file in the root directory of this source tree.
|
|
2473
2473
|
*/
|
|
2474
|
-
const
|
|
2474
|
+
const Oi = [
|
|
2475
2475
|
[
|
|
2476
2476
|
"path",
|
|
2477
2477
|
{
|
|
@@ -2486,7 +2486,7 @@ const Ai = [
|
|
|
2486
2486
|
* This source code is licensed under the ISC license.
|
|
2487
2487
|
* See the LICENSE file in the root directory of this source tree.
|
|
2488
2488
|
*/
|
|
2489
|
-
const
|
|
2489
|
+
const At = [
|
|
2490
2490
|
["path", { d: "M12 17v5" }],
|
|
2491
2491
|
[
|
|
2492
2492
|
"path",
|
|
@@ -2501,7 +2501,7 @@ const _t = [
|
|
|
2501
2501
|
* This source code is licensed under the ISC license.
|
|
2502
2502
|
* See the LICENSE file in the root directory of this source tree.
|
|
2503
2503
|
*/
|
|
2504
|
-
const
|
|
2504
|
+
const Ri = [
|
|
2505
2505
|
[
|
|
2506
2506
|
"path",
|
|
2507
2507
|
{
|
|
@@ -2516,7 +2516,7 @@ const Ii = [
|
|
|
2516
2516
|
* This source code is licensed under the ISC license.
|
|
2517
2517
|
* See the LICENSE file in the root directory of this source tree.
|
|
2518
2518
|
*/
|
|
2519
|
-
const
|
|
2519
|
+
const Li = [
|
|
2520
2520
|
["path", { d: "M10 11v6" }],
|
|
2521
2521
|
["path", { d: "M14 11v6" }],
|
|
2522
2522
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }],
|
|
@@ -2529,7 +2529,7 @@ const Mi = [
|
|
|
2529
2529
|
* This source code is licensed under the ISC license.
|
|
2530
2530
|
* See the LICENSE file in the root directory of this source tree.
|
|
2531
2531
|
*/
|
|
2532
|
-
const
|
|
2532
|
+
const ji = [
|
|
2533
2533
|
["path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }],
|
|
2534
2534
|
["rect", { x: "2", y: "6", width: "14", height: "12", rx: "2" }]
|
|
2535
2535
|
];
|
|
@@ -2539,7 +2539,7 @@ const Oi = [
|
|
|
2539
2539
|
* This source code is licensed under the ISC license.
|
|
2540
2540
|
* See the LICENSE file in the root directory of this source tree.
|
|
2541
2541
|
*/
|
|
2542
|
-
const
|
|
2542
|
+
const be = [
|
|
2543
2543
|
["path", { d: "M18 6 6 18" }],
|
|
2544
2544
|
["path", { d: "m6 6 12 12" }]
|
|
2545
2545
|
];
|
|
@@ -2549,7 +2549,7 @@ const me = [
|
|
|
2549
2549
|
* This source code is licensed under the ISC license.
|
|
2550
2550
|
* See the LICENSE file in the root directory of this source tree.
|
|
2551
2551
|
*/
|
|
2552
|
-
const
|
|
2552
|
+
const zi = [
|
|
2553
2553
|
[
|
|
2554
2554
|
"path",
|
|
2555
2555
|
{
|
|
@@ -2557,14 +2557,14 @@ const Ri = [
|
|
|
2557
2557
|
}
|
|
2558
2558
|
]
|
|
2559
2559
|
];
|
|
2560
|
-
function
|
|
2560
|
+
function Ui(n) {
|
|
2561
2561
|
return n.map(([e, t]) => {
|
|
2562
2562
|
const i = Object.entries(t).filter(([, s]) => s != null).map(([s, o]) => `${s}="${o}"`).join(" ");
|
|
2563
2563
|
return `<${e} ${i}/>`;
|
|
2564
2564
|
}).join("");
|
|
2565
2565
|
}
|
|
2566
2566
|
function C(n, e = 18) {
|
|
2567
|
-
return
|
|
2567
|
+
return Zt`<svg
|
|
2568
2568
|
xmlns="http://www.w3.org/2000/svg"
|
|
2569
2569
|
width="${e}"
|
|
2570
2570
|
height="${e}"
|
|
@@ -2574,9 +2574,9 @@ function C(n, e = 18) {
|
|
|
2574
2574
|
stroke-width="2"
|
|
2575
2575
|
stroke-linecap="round"
|
|
2576
2576
|
stroke-linejoin="round"
|
|
2577
|
-
>${
|
|
2577
|
+
>${Ti(Ui(n))}</svg>`;
|
|
2578
2578
|
}
|
|
2579
|
-
const
|
|
2579
|
+
const ie = M`
|
|
2580
2580
|
* {
|
|
2581
2581
|
box-sizing: border-box;
|
|
2582
2582
|
margin: 0;
|
|
@@ -2619,7 +2619,7 @@ const ee = M`
|
|
|
2619
2619
|
--pw-shadow: var(--pulse-shadow);
|
|
2620
2620
|
--pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
|
|
2621
2621
|
}
|
|
2622
|
-
`,
|
|
2622
|
+
`, ve = M`
|
|
2623
2623
|
.pw-btn {
|
|
2624
2624
|
display: inline-flex;
|
|
2625
2625
|
align-items: center;
|
|
@@ -2663,7 +2663,7 @@ const ee = M`
|
|
|
2663
2663
|
width: 18px;
|
|
2664
2664
|
height: 18px;
|
|
2665
2665
|
}
|
|
2666
|
-
`,
|
|
2666
|
+
`, Ae = M`
|
|
2667
2667
|
.pw-scrollable::-webkit-scrollbar {
|
|
2668
2668
|
width: 4px;
|
|
2669
2669
|
}
|
|
@@ -2675,12 +2675,12 @@ const ee = M`
|
|
|
2675
2675
|
background: transparent;
|
|
2676
2676
|
}
|
|
2677
2677
|
`;
|
|
2678
|
-
var
|
|
2679
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
2678
|
+
var Di = Object.defineProperty, Hi = Object.getOwnPropertyDescriptor, We = (n, e, t, i) => {
|
|
2679
|
+
for (var s = i > 1 ? void 0 : i ? Hi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
2680
2680
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
2681
|
-
return i && s &&
|
|
2681
|
+
return i && s && Di(e, t, s), s;
|
|
2682
2682
|
};
|
|
2683
|
-
let
|
|
2683
|
+
let K = class extends P {
|
|
2684
2684
|
constructor() {
|
|
2685
2685
|
super(...arguments), this.items = [], this.unsubs = [], this.counter = 0;
|
|
2686
2686
|
}
|
|
@@ -2709,7 +2709,7 @@ let X = class extends S {
|
|
|
2709
2709
|
userId: n.userId,
|
|
2710
2710
|
description: n.description,
|
|
2711
2711
|
timestamp: new Date(n.createdAt).getTime(),
|
|
2712
|
-
color:
|
|
2712
|
+
color: K.TYPE_COLORS[n.type] ?? "#94a3b8"
|
|
2713
2713
|
};
|
|
2714
2714
|
}
|
|
2715
2715
|
getUserName(n) {
|
|
@@ -2726,18 +2726,18 @@ let X = class extends S {
|
|
|
2726
2726
|
);
|
|
2727
2727
|
}
|
|
2728
2728
|
render() {
|
|
2729
|
-
return
|
|
2729
|
+
return u`
|
|
2730
2730
|
<div class="panel">
|
|
2731
2731
|
<div class="panel-header">
|
|
2732
2732
|
<span class="panel-title">Activity</span>
|
|
2733
2733
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
2734
|
-
${C(
|
|
2734
|
+
${C(be, 16)}
|
|
2735
2735
|
</button>
|
|
2736
2736
|
</div>
|
|
2737
2737
|
|
|
2738
2738
|
<div class="panel-body pw-scrollable">
|
|
2739
|
-
${this.items.length === 0 ?
|
|
2740
|
-
(n) =>
|
|
2739
|
+
${this.items.length === 0 ? u`<div class="empty">No activity yet</div>` : this.items.map(
|
|
2740
|
+
(n) => u`
|
|
2741
2741
|
<div class="activity-item">
|
|
2742
2742
|
<div
|
|
2743
2743
|
class="activity-dot"
|
|
@@ -2745,7 +2745,7 @@ let X = class extends S {
|
|
|
2745
2745
|
></div>
|
|
2746
2746
|
<div class="activity-content">
|
|
2747
2747
|
<div class="activity-text">
|
|
2748
|
-
${n.userId ?
|
|
2748
|
+
${n.userId ? u`<span class="activity-user"
|
|
2749
2749
|
>${this.getUserName(n.userId)}</span
|
|
2750
2750
|
>
|
|
2751
2751
|
${n.description}` : n.description}
|
|
@@ -2762,10 +2762,10 @@ let X = class extends S {
|
|
|
2762
2762
|
`;
|
|
2763
2763
|
}
|
|
2764
2764
|
};
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2765
|
+
K.styles = [
|
|
2766
|
+
ie,
|
|
2767
|
+
ve,
|
|
2768
|
+
Ae,
|
|
2769
2769
|
M`
|
|
2770
2770
|
:host {
|
|
2771
2771
|
display: block;
|
|
@@ -2884,28 +2884,28 @@ X.styles = [
|
|
|
2884
2884
|
}
|
|
2885
2885
|
`
|
|
2886
2886
|
];
|
|
2887
|
-
|
|
2887
|
+
K.TYPE_COLORS = {
|
|
2888
2888
|
join: "#22c55e",
|
|
2889
2889
|
leave: "#94a3b8",
|
|
2890
2890
|
thread: "var(--pw-accent, #6366f1)",
|
|
2891
2891
|
comment: "#3b82f6",
|
|
2892
2892
|
resolve: "#22c55e"
|
|
2893
2893
|
};
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
],
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
],
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
],
|
|
2903
|
-
const
|
|
2904
|
-
function
|
|
2894
|
+
We([
|
|
2895
|
+
x({ attribute: !1 })
|
|
2896
|
+
], K.prototype, "client", 2);
|
|
2897
|
+
We([
|
|
2898
|
+
$()
|
|
2899
|
+
], K.prototype, "items", 2);
|
|
2900
|
+
K = We([
|
|
2901
|
+
L("pulse-widget-activity-panel")
|
|
2902
|
+
], K);
|
|
2903
|
+
const Bi = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", lt = "#6366f1", ct = "#e2e8f0", Ni = "#f8fafc", Fi = "#e2e8f0", dt = "#64748b", we = 28, qi = Array.from({ length: we }, (n, e) => 0.2 + Math.abs(Math.sin(e * 12.9898 + 78.233) * 43758.5453) % 1 * 0.8);
|
|
2904
|
+
function ht(n) {
|
|
2905
2905
|
const e = Math.max(0, Math.floor(n)), t = Math.floor(e / 60), i = e % 60;
|
|
2906
2906
|
return `${t}:${i.toString().padStart(2, "0")}`;
|
|
2907
2907
|
}
|
|
2908
|
-
class
|
|
2908
|
+
class je {
|
|
2909
2909
|
/**
|
|
2910
2910
|
* Create and return a fully self-contained inline audio player element.
|
|
2911
2911
|
*
|
|
@@ -2918,31 +2918,31 @@ class Oe {
|
|
|
2918
2918
|
let i = !1, s = t != null ? t / 1e3 : 0, o = 0;
|
|
2919
2919
|
const r = document.createElement("audio");
|
|
2920
2920
|
r.preload = "metadata", r.src = e;
|
|
2921
|
-
const
|
|
2922
|
-
Object.assign(
|
|
2921
|
+
const a = document.createElement("div");
|
|
2922
|
+
Object.assign(a.style, {
|
|
2923
2923
|
display: "inline-flex",
|
|
2924
2924
|
alignItems: "center",
|
|
2925
2925
|
gap: "10px",
|
|
2926
2926
|
width: "220px",
|
|
2927
2927
|
height: "44px",
|
|
2928
2928
|
padding: "0 10px",
|
|
2929
|
-
background:
|
|
2929
|
+
background: Ni,
|
|
2930
2930
|
borderRadius: "12px",
|
|
2931
|
-
border: `1px solid ${
|
|
2932
|
-
fontFamily:
|
|
2931
|
+
border: `1px solid ${Fi}`,
|
|
2932
|
+
fontFamily: Bi,
|
|
2933
2933
|
fontSize: "11px",
|
|
2934
|
-
color:
|
|
2934
|
+
color: dt,
|
|
2935
2935
|
userSelect: "none",
|
|
2936
2936
|
boxSizing: "border-box"
|
|
2937
2937
|
});
|
|
2938
|
-
const
|
|
2939
|
-
Object.assign(
|
|
2938
|
+
const l = document.createElement("button");
|
|
2939
|
+
Object.assign(l.style, {
|
|
2940
2940
|
width: "28px",
|
|
2941
2941
|
height: "28px",
|
|
2942
2942
|
minWidth: "28px",
|
|
2943
2943
|
borderRadius: "50%",
|
|
2944
2944
|
border: "none",
|
|
2945
|
-
background:
|
|
2945
|
+
background: lt,
|
|
2946
2946
|
cursor: "pointer",
|
|
2947
2947
|
display: "flex",
|
|
2948
2948
|
alignItems: "center",
|
|
@@ -2951,27 +2951,27 @@ class Oe {
|
|
|
2951
2951
|
outline: "none",
|
|
2952
2952
|
flexShrink: "0"
|
|
2953
2953
|
});
|
|
2954
|
-
const
|
|
2955
|
-
Object.assign(
|
|
2954
|
+
const d = document.createElement("span");
|
|
2955
|
+
Object.assign(d.style, {
|
|
2956
2956
|
display: "block",
|
|
2957
2957
|
width: "10px",
|
|
2958
2958
|
height: "12px",
|
|
2959
2959
|
lineHeight: "0"
|
|
2960
2960
|
});
|
|
2961
|
-
function
|
|
2962
|
-
|
|
2961
|
+
function c() {
|
|
2962
|
+
d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2963
2963
|
<path d="M1 1L9 6L1 11V1Z" fill="white" stroke="white" stroke-width="1" stroke-linejoin="round"/>
|
|
2964
2964
|
</svg>`;
|
|
2965
2965
|
}
|
|
2966
|
-
function
|
|
2967
|
-
|
|
2966
|
+
function h() {
|
|
2967
|
+
d.innerHTML = `<svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2968
2968
|
<rect x="1" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2969
2969
|
<rect x="6.5" y="1" width="2.5" height="10" rx="0.5" fill="white"/>
|
|
2970
2970
|
</svg>`;
|
|
2971
2971
|
}
|
|
2972
|
-
|
|
2973
|
-
const
|
|
2974
|
-
Object.assign(
|
|
2972
|
+
c(), l.appendChild(d);
|
|
2973
|
+
const p = document.createElement("div");
|
|
2974
|
+
Object.assign(p.style, {
|
|
2975
2975
|
flex: "1",
|
|
2976
2976
|
display: "flex",
|
|
2977
2977
|
flexDirection: "column",
|
|
@@ -2979,69 +2979,69 @@ class Oe {
|
|
|
2979
2979
|
overflow: "hidden",
|
|
2980
2980
|
minWidth: "0"
|
|
2981
2981
|
});
|
|
2982
|
-
const
|
|
2983
|
-
Object.assign(
|
|
2982
|
+
const m = document.createElement("div");
|
|
2983
|
+
Object.assign(m.style, {
|
|
2984
2984
|
display: "flex",
|
|
2985
2985
|
alignItems: "center",
|
|
2986
2986
|
gap: "1.5px",
|
|
2987
2987
|
height: "22px",
|
|
2988
2988
|
cursor: "pointer"
|
|
2989
2989
|
});
|
|
2990
|
-
const
|
|
2991
|
-
for (let E = 0; E <
|
|
2992
|
-
const I = document.createElement("div"),
|
|
2990
|
+
const g = [];
|
|
2991
|
+
for (let E = 0; E < we; E++) {
|
|
2992
|
+
const I = document.createElement("div"), z = Math.round(qi[E] * 20);
|
|
2993
2993
|
Object.assign(I.style, {
|
|
2994
2994
|
flex: "1",
|
|
2995
|
-
height: `${Math.max(3,
|
|
2995
|
+
height: `${Math.max(3, z)}px`,
|
|
2996
2996
|
borderRadius: "1px",
|
|
2997
|
-
background:
|
|
2997
|
+
background: ct,
|
|
2998
2998
|
transition: "background 0.1s ease",
|
|
2999
2999
|
minWidth: "0"
|
|
3000
|
-
}),
|
|
3000
|
+
}), g.push(I), m.appendChild(I);
|
|
3001
3001
|
}
|
|
3002
|
-
const
|
|
3003
|
-
Object.assign(
|
|
3002
|
+
const y = document.createElement("div");
|
|
3003
|
+
Object.assign(y.style, {
|
|
3004
3004
|
fontSize: "10px",
|
|
3005
|
-
color:
|
|
3005
|
+
color: dt,
|
|
3006
3006
|
whiteSpace: "nowrap",
|
|
3007
3007
|
lineHeight: "1"
|
|
3008
3008
|
});
|
|
3009
|
-
function
|
|
3010
|
-
const E =
|
|
3011
|
-
|
|
3009
|
+
function v() {
|
|
3010
|
+
const E = ht(o), I = ht(s);
|
|
3011
|
+
y.textContent = `${E} / ${I}`;
|
|
3012
3012
|
}
|
|
3013
|
-
|
|
3014
|
-
function
|
|
3015
|
-
const E = s > 0 ? o / s : 0, I = Math.floor(E *
|
|
3016
|
-
for (let
|
|
3017
|
-
|
|
3013
|
+
v(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
|
|
3014
|
+
function w() {
|
|
3015
|
+
const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
|
|
3016
|
+
for (let z = 0; z < we; z++)
|
|
3017
|
+
g[z].style.background = z <= I ? lt : ct;
|
|
3018
3018
|
}
|
|
3019
|
-
return
|
|
3019
|
+
return m.addEventListener("click", (E) => {
|
|
3020
3020
|
if (s <= 0) return;
|
|
3021
|
-
const I =
|
|
3021
|
+
const I = m.getBoundingClientRect(), z = Math.min(
|
|
3022
3022
|
1,
|
|
3023
3023
|
Math.max(0, (E.clientX - I.left) / I.width)
|
|
3024
3024
|
);
|
|
3025
|
-
r.currentTime =
|
|
3026
|
-
}),
|
|
3025
|
+
r.currentTime = z * s, o = r.currentTime, w(), v();
|
|
3026
|
+
}), l.addEventListener("click", () => {
|
|
3027
3027
|
i ? r.pause() : r.play().catch(() => {
|
|
3028
3028
|
});
|
|
3029
3029
|
}), r.addEventListener("play", () => {
|
|
3030
|
-
i = !0,
|
|
3030
|
+
i = !0, h();
|
|
3031
3031
|
}), r.addEventListener("pause", () => {
|
|
3032
|
-
i = !1,
|
|
3032
|
+
i = !1, c();
|
|
3033
3033
|
}), r.addEventListener("ended", () => {
|
|
3034
|
-
i = !1,
|
|
3034
|
+
i = !1, c(), o = 0, w(), v();
|
|
3035
3035
|
}), r.addEventListener("timeupdate", () => {
|
|
3036
|
-
o = r.currentTime,
|
|
3036
|
+
o = r.currentTime, w(), v();
|
|
3037
3037
|
}), r.addEventListener("loadedmetadata", () => {
|
|
3038
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3038
|
+
r.duration && isFinite(r.duration) && (s = r.duration, v());
|
|
3039
3039
|
}), r.addEventListener("durationchange", () => {
|
|
3040
|
-
r.duration && isFinite(r.duration) && (s = r.duration,
|
|
3041
|
-
}),
|
|
3040
|
+
r.duration && isFinite(r.duration) && (s = r.duration, v());
|
|
3041
|
+
}), a;
|
|
3042
3042
|
}
|
|
3043
3043
|
}
|
|
3044
|
-
class
|
|
3044
|
+
class ze {
|
|
3045
3045
|
constructor() {
|
|
3046
3046
|
this.container = null, this.stream = null, this.recorder = null, this.analyser = null, this.audioCtx = null, this.recording = !1, this.animFrame = null, this.startTime = 0, this.maxDuration = 12e4, this.maxTimer = null, this.canvas = null, this.timerEl = null, this.resolve = null, this.animate = () => {
|
|
3047
3047
|
this.recording && (this.drawWaveform(), this.updateTimer(), this.animFrame = requestAnimationFrame(this.animate));
|
|
@@ -3058,16 +3058,16 @@ class Re {
|
|
|
3058
3058
|
const i = this.detectMimeType(), s = {};
|
|
3059
3059
|
i && (s.mimeType = i), this.recorder = new MediaRecorder(this.stream, s);
|
|
3060
3060
|
const o = [];
|
|
3061
|
-
this.recorder.ondataavailable = (
|
|
3062
|
-
|
|
3061
|
+
this.recorder.ondataavailable = (a) => {
|
|
3062
|
+
a.data.size > 0 && o.push(a.data);
|
|
3063
3063
|
}, this.buildUI(e);
|
|
3064
|
-
const r = new Promise((
|
|
3065
|
-
this.resolve =
|
|
3064
|
+
const r = new Promise((a) => {
|
|
3065
|
+
this.resolve = a;
|
|
3066
3066
|
});
|
|
3067
3067
|
return this.recorder.onstop = () => {
|
|
3068
|
-
var
|
|
3069
|
-
const
|
|
3070
|
-
(
|
|
3068
|
+
var d, c;
|
|
3069
|
+
const a = ((d = this.recorder) == null ? void 0 : d.mimeType) || i || "audio/webm", l = new Blob(o, { type: a });
|
|
3070
|
+
(c = this.resolve) == null || c.call(this, l), this.resolve = null, this.cleanupResources();
|
|
3071
3071
|
}, this.recorder.start(), this.recording = !0, this.startTime = Date.now(), this.maxTimer = setTimeout(() => {
|
|
3072
3072
|
this.stopRecording();
|
|
3073
3073
|
}, this.maxDuration), this.animate(), r;
|
|
@@ -3170,10 +3170,10 @@ class Re {
|
|
|
3170
3170
|
if (!e) return;
|
|
3171
3171
|
const t = this.canvas.width, i = this.canvas.height, s = this.analyser.frequencyBinCount, o = new Uint8Array(s);
|
|
3172
3172
|
this.analyser.getByteFrequencyData(o), e.clearRect(0, 0, t, i);
|
|
3173
|
-
const r = s,
|
|
3174
|
-
for (let
|
|
3175
|
-
const
|
|
3176
|
-
e.fillStyle = `rgba(99, 102, 241, ${
|
|
3173
|
+
const r = s, a = Math.max(2, t / r * 0.7), l = (t - a * r) / (r - 1 || 1);
|
|
3174
|
+
for (let d = 0; d < r; d++) {
|
|
3175
|
+
const c = o[d] / 255, h = Math.max(2, c * i * 0.85), p = d * (a + l), m = (i - h) / 2, g = 0.4 + c * 0.6;
|
|
3176
|
+
e.fillStyle = `rgba(99, 102, 241, ${g})`, e.beginPath(), e.roundRect(p, m, a, h, 1), e.fill();
|
|
3177
3177
|
}
|
|
3178
3178
|
}
|
|
3179
3179
|
updateTimer() {
|
|
@@ -3191,24 +3191,27 @@ class Re {
|
|
|
3191
3191
|
this.recorder = null, this.container && (this.container.remove(), this.container = null), this.canvas = null, this.timerEl = null;
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
const
|
|
3194
|
+
const Vi = 180, Wi = 120, Xi = "#e2e8f0", Yi = `
|
|
3195
3195
|
<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3196
3196
|
<circle cx="14" cy="14" r="14" fill="rgba(0,0,0,0.35)"/>
|
|
3197
3197
|
<polygon points="11,8 22,14 11,20" fill="rgba(255,255,255,0.9)"/>
|
|
3198
|
-
</svg>`,
|
|
3198
|
+
</svg>`, pt = `
|
|
3199
3199
|
<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">
|
|
3200
3200
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3201
3201
|
<line x1="23" y1="9" x2="17" y2="15"/>
|
|
3202
3202
|
<line x1="17" y1="9" x2="23" y2="15"/>
|
|
3203
|
-
</svg>`,
|
|
3203
|
+
</svg>`, Ki = `
|
|
3204
3204
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3205
3205
|
<polygon points="11,5 6,9 2,9 2,15 6,15 11,19"/>
|
|
3206
3206
|
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
|
|
3207
3207
|
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
|
|
3208
|
-
</svg
|
|
3209
|
-
|
|
3208
|
+
</svg>`, Gi = `
|
|
3209
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="rgba(255,255,255,0.9)" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg">
|
|
3210
|
+
<polyline points="15,3 21,3 21,9"/><line x1="21" y1="3" x2="14" y2="10"/>
|
|
3211
|
+
<polyline points="9,21 3,21 3,15"/><line x1="3" y1="21" x2="10" y2="14"/>
|
|
3212
|
+
</svg>`, S = class S {
|
|
3210
3213
|
/**
|
|
3211
|
-
* Renders an inline
|
|
3214
|
+
* Renders an inline rectangular video player and returns the root container.
|
|
3212
3215
|
* @param url - Video source URL
|
|
3213
3216
|
* @param posterUrl - Optional poster/thumbnail image URL
|
|
3214
3217
|
*/
|
|
@@ -3218,10 +3221,10 @@ class Tt {
|
|
|
3218
3221
|
Object.assign(o.style, {
|
|
3219
3222
|
position: "relative",
|
|
3220
3223
|
display: "inline-block",
|
|
3221
|
-
width: `${
|
|
3222
|
-
height: `${
|
|
3223
|
-
borderRadius: "
|
|
3224
|
-
border: `
|
|
3224
|
+
width: `${Vi}px`,
|
|
3225
|
+
height: `${Wi}px`,
|
|
3226
|
+
borderRadius: "8px",
|
|
3227
|
+
border: `1px solid ${Xi}`,
|
|
3225
3228
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)",
|
|
3226
3229
|
overflow: "hidden",
|
|
3227
3230
|
cursor: "pointer",
|
|
@@ -3235,10 +3238,10 @@ class Tt {
|
|
|
3235
3238
|
height: "100%",
|
|
3236
3239
|
objectFit: "cover",
|
|
3237
3240
|
display: "block",
|
|
3238
|
-
borderRadius: "
|
|
3241
|
+
borderRadius: "8px"
|
|
3239
3242
|
}), r.src = e, r.loop = !0, r.muted = !0, r.playsInline = !0, r.preload = "metadata", t && (r.poster = t), o.appendChild(r);
|
|
3240
|
-
const
|
|
3241
|
-
Object.assign(
|
|
3243
|
+
const a = document.createElement("div");
|
|
3244
|
+
Object.assign(a.style, {
|
|
3242
3245
|
position: "absolute",
|
|
3243
3246
|
top: "0",
|
|
3244
3247
|
left: "0",
|
|
@@ -3247,13 +3250,13 @@ class Tt {
|
|
|
3247
3250
|
display: "flex",
|
|
3248
3251
|
alignItems: "center",
|
|
3249
3252
|
justifyContent: "center",
|
|
3250
|
-
borderRadius: "
|
|
3253
|
+
borderRadius: "8px",
|
|
3251
3254
|
transition: "opacity 0.25s ease",
|
|
3252
3255
|
opacity: "1",
|
|
3253
3256
|
pointerEvents: "none"
|
|
3254
|
-
}),
|
|
3255
|
-
const
|
|
3256
|
-
Object.assign(
|
|
3257
|
+
}), a.innerHTML = Yi, o.appendChild(a);
|
|
3258
|
+
const l = document.createElement("div");
|
|
3259
|
+
Object.assign(l.style, {
|
|
3257
3260
|
position: "absolute",
|
|
3258
3261
|
bottom: "2px",
|
|
3259
3262
|
right: "2px",
|
|
@@ -3266,12 +3269,34 @@ class Tt {
|
|
|
3266
3269
|
justifyContent: "center",
|
|
3267
3270
|
pointerEvents: "none",
|
|
3268
3271
|
transition: "opacity 0.2s ease"
|
|
3269
|
-
}),
|
|
3272
|
+
}), l.innerHTML = pt, o.appendChild(l);
|
|
3273
|
+
const d = document.createElement("div");
|
|
3274
|
+
Object.assign(d.style, {
|
|
3275
|
+
position: "absolute",
|
|
3276
|
+
top: "2px",
|
|
3277
|
+
right: "2px",
|
|
3278
|
+
width: "22px",
|
|
3279
|
+
height: "22px",
|
|
3280
|
+
borderRadius: "50%",
|
|
3281
|
+
background: "rgba(0,0,0,0.45)",
|
|
3282
|
+
display: "none",
|
|
3283
|
+
alignItems: "center",
|
|
3284
|
+
justifyContent: "center",
|
|
3285
|
+
cursor: "pointer",
|
|
3286
|
+
pointerEvents: "auto",
|
|
3287
|
+
transition: "opacity 0.2s ease, background 0.15s ease"
|
|
3288
|
+
}), d.innerHTML = Gi, d.title = "Fullscreen", d.addEventListener("mouseenter", () => {
|
|
3289
|
+
d.style.background = "rgba(0,0,0,0.7)";
|
|
3290
|
+
}), d.addEventListener("mouseleave", () => {
|
|
3291
|
+
d.style.background = "rgba(0,0,0,0.45)";
|
|
3292
|
+
}), d.addEventListener("click", (p) => {
|
|
3293
|
+
p.stopPropagation(), S.openFullscreen(e, t);
|
|
3294
|
+
}), o.appendChild(d);
|
|
3270
3295
|
function c() {
|
|
3271
|
-
|
|
3296
|
+
a.style.opacity = i ? "0" : "1";
|
|
3272
3297
|
}
|
|
3273
3298
|
function h() {
|
|
3274
|
-
|
|
3299
|
+
l.style.display = i ? "flex" : "none", l.innerHTML = s ? pt : Ki, d.style.display = i ? "flex" : "none";
|
|
3275
3300
|
}
|
|
3276
3301
|
return o.addEventListener("click", (p) => {
|
|
3277
3302
|
p.stopPropagation(), i ? s ? (r.muted = !1, s = !1) : (r.pause(), i = !1, s = !0, r.muted = !0) : (r.muted = !0, s = !0, r.play().catch(() => {
|
|
@@ -3280,8 +3305,77 @@ class Tt {
|
|
|
3280
3305
|
i && (i = !1, s = !0, r.muted = !0, c(), h());
|
|
3281
3306
|
}), o;
|
|
3282
3307
|
}
|
|
3283
|
-
|
|
3284
|
-
|
|
3308
|
+
static openFullscreen(e, t) {
|
|
3309
|
+
S.closeFullscreen();
|
|
3310
|
+
const i = document.createElement("div");
|
|
3311
|
+
Object.assign(i.style, {
|
|
3312
|
+
position: "fixed",
|
|
3313
|
+
top: "0",
|
|
3314
|
+
left: "0",
|
|
3315
|
+
width: "100%",
|
|
3316
|
+
height: "100%",
|
|
3317
|
+
zIndex: "100000",
|
|
3318
|
+
background: "rgba(0,0,0,0.85)",
|
|
3319
|
+
display: "flex",
|
|
3320
|
+
alignItems: "center",
|
|
3321
|
+
justifyContent: "center",
|
|
3322
|
+
opacity: "0",
|
|
3323
|
+
transition: "opacity 200ms ease",
|
|
3324
|
+
cursor: "pointer",
|
|
3325
|
+
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
3326
|
+
});
|
|
3327
|
+
const s = document.createElement("button");
|
|
3328
|
+
s.textContent = "×", Object.assign(s.style, {
|
|
3329
|
+
position: "absolute",
|
|
3330
|
+
top: "16px",
|
|
3331
|
+
right: "16px",
|
|
3332
|
+
width: "40px",
|
|
3333
|
+
height: "40px",
|
|
3334
|
+
border: "none",
|
|
3335
|
+
borderRadius: "50%",
|
|
3336
|
+
background: "rgba(255,255,255,0.15)",
|
|
3337
|
+
color: "#fff",
|
|
3338
|
+
fontSize: "24px",
|
|
3339
|
+
cursor: "pointer",
|
|
3340
|
+
padding: "0",
|
|
3341
|
+
display: "flex",
|
|
3342
|
+
alignItems: "center",
|
|
3343
|
+
justifyContent: "center",
|
|
3344
|
+
transition: "background 150ms ease",
|
|
3345
|
+
zIndex: "1"
|
|
3346
|
+
}), s.addEventListener("mouseenter", () => {
|
|
3347
|
+
s.style.background = "rgba(255,255,255,0.3)";
|
|
3348
|
+
}), s.addEventListener("mouseleave", () => {
|
|
3349
|
+
s.style.background = "rgba(255,255,255,0.15)";
|
|
3350
|
+
}), s.addEventListener("click", (a) => {
|
|
3351
|
+
a.stopPropagation(), S.closeFullscreen();
|
|
3352
|
+
});
|
|
3353
|
+
const o = document.createElement("video");
|
|
3354
|
+
Object.assign(o.style, {
|
|
3355
|
+
maxWidth: "90vw",
|
|
3356
|
+
maxHeight: "90vh",
|
|
3357
|
+
borderRadius: "8px",
|
|
3358
|
+
outline: "none",
|
|
3359
|
+
cursor: "default"
|
|
3360
|
+
}), o.src = e, o.controls = !0, o.autoplay = !0, o.playsInline = !0, t && (o.poster = t), o.addEventListener("click", (a) => a.stopPropagation()), i.appendChild(s), i.appendChild(o), i.addEventListener("click", () => S.closeFullscreen());
|
|
3361
|
+
const r = (a) => {
|
|
3362
|
+
a.key === "Escape" && S.closeFullscreen();
|
|
3363
|
+
};
|
|
3364
|
+
document.addEventListener("keydown", r), S.fullscreenOverlay = i, S.fullscreenKeyHandler = r, document.body.appendChild(i), requestAnimationFrame(() => {
|
|
3365
|
+
i.style.opacity = "1";
|
|
3366
|
+
});
|
|
3367
|
+
}
|
|
3368
|
+
static closeFullscreen() {
|
|
3369
|
+
if (!S.fullscreenOverlay) return;
|
|
3370
|
+
const e = S.fullscreenOverlay;
|
|
3371
|
+
S.fullscreenKeyHandler && (document.removeEventListener("keydown", S.fullscreenKeyHandler), S.fullscreenKeyHandler = null);
|
|
3372
|
+
const t = e.querySelector("video");
|
|
3373
|
+
t && t.pause(), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), S.fullscreenOverlay = null;
|
|
3374
|
+
}
|
|
3375
|
+
};
|
|
3376
|
+
S.fullscreenOverlay = null, S.fullscreenKeyHandler = null;
|
|
3377
|
+
let Ce = S;
|
|
3378
|
+
const ut = 60, Ji = `
|
|
3285
3379
|
.vr-overlay {
|
|
3286
3380
|
display: flex;
|
|
3287
3381
|
flex-direction: column;
|
|
@@ -3388,14 +3482,14 @@ const ht = 60, qi = `
|
|
|
3388
3482
|
color: #0f172a;
|
|
3389
3483
|
}
|
|
3390
3484
|
`;
|
|
3391
|
-
function
|
|
3485
|
+
function ft(n) {
|
|
3392
3486
|
return n.toString().padStart(2, "0");
|
|
3393
3487
|
}
|
|
3394
|
-
function
|
|
3488
|
+
function Zi(n) {
|
|
3395
3489
|
const e = Math.floor(n / 60), t = n % 60;
|
|
3396
|
-
return `${
|
|
3490
|
+
return `${ft(e)}:${ft(t)}`;
|
|
3397
3491
|
}
|
|
3398
|
-
function
|
|
3492
|
+
function Qi() {
|
|
3399
3493
|
const n = [
|
|
3400
3494
|
"video/webm;codecs=vp9,opus",
|
|
3401
3495
|
"video/webm;codecs=vp8,opus",
|
|
@@ -3406,7 +3500,7 @@ function Xi() {
|
|
|
3406
3500
|
if (MediaRecorder.isTypeSupported(e)) return e;
|
|
3407
3501
|
return "";
|
|
3408
3502
|
}
|
|
3409
|
-
function
|
|
3503
|
+
function es(n) {
|
|
3410
3504
|
return new Promise((e, t) => {
|
|
3411
3505
|
const i = URL.createObjectURL(n), s = document.createElement("video");
|
|
3412
3506
|
s.muted = !0, s.playsInline = !0, s.preload = "auto", s.src = i, s.addEventListener("loadeddata", () => {
|
|
@@ -3414,8 +3508,8 @@ function Yi(n) {
|
|
|
3414
3508
|
}), s.addEventListener("seeked", () => {
|
|
3415
3509
|
const o = document.createElement("canvas");
|
|
3416
3510
|
o.width = s.videoWidth || 240, o.height = s.videoHeight || 240, o.getContext("2d").drawImage(s, 0, 0, o.width, o.height), URL.revokeObjectURL(i), o.toBlob(
|
|
3417
|
-
(
|
|
3418
|
-
|
|
3511
|
+
(a) => {
|
|
3512
|
+
a ? e(a) : t(new Error("Failed to generate poster frame"));
|
|
3419
3513
|
},
|
|
3420
3514
|
"image/jpeg",
|
|
3421
3515
|
0.85
|
|
@@ -3425,7 +3519,7 @@ function Yi(n) {
|
|
|
3425
3519
|
}), s.load();
|
|
3426
3520
|
});
|
|
3427
3521
|
}
|
|
3428
|
-
class
|
|
3522
|
+
class Ue {
|
|
3429
3523
|
constructor() {
|
|
3430
3524
|
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;
|
|
3431
3525
|
}
|
|
@@ -3442,7 +3536,7 @@ class Le {
|
|
|
3442
3536
|
}
|
|
3443
3537
|
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(() => {
|
|
3444
3538
|
}));
|
|
3445
|
-
const i =
|
|
3539
|
+
const i = Qi(), s = {};
|
|
3446
3540
|
i && (s.mimeType = i);
|
|
3447
3541
|
const o = new MediaRecorder(t, s);
|
|
3448
3542
|
return this.mediaRecorder = o, o.ondataavailable = (r) => {
|
|
@@ -3450,7 +3544,7 @@ class Le {
|
|
|
3450
3544
|
}, o.onstop = () => {
|
|
3451
3545
|
this.handleRecordingComplete();
|
|
3452
3546
|
}, o.start(), this.timerInterval = setInterval(() => {
|
|
3453
|
-
this.elapsed++, this.updateTimer(), this.elapsed >=
|
|
3547
|
+
this.elapsed++, this.updateTimer(), this.elapsed >= ut && this.stopRecording();
|
|
3454
3548
|
}, 1e3), new Promise((r) => {
|
|
3455
3549
|
this.resolvePromise = r;
|
|
3456
3550
|
});
|
|
@@ -3467,7 +3561,7 @@ class Le {
|
|
|
3467
3561
|
}
|
|
3468
3562
|
// ── Private ──
|
|
3469
3563
|
buildUI(e) {
|
|
3470
|
-
this.styleEl = document.createElement("style"), this.styleEl.textContent =
|
|
3564
|
+
this.styleEl = document.createElement("style"), this.styleEl.textContent = Ji, document.head.appendChild(this.styleEl), this.root = document.createElement("div"), this.root.className = "vr-overlay";
|
|
3471
3565
|
const t = document.createElement("div");
|
|
3472
3566
|
t.className = "vr-circle-wrapper";
|
|
3473
3567
|
const i = document.createElement("div");
|
|
@@ -3478,24 +3572,24 @@ class Le {
|
|
|
3478
3572
|
o.className = "vr-actions";
|
|
3479
3573
|
const r = document.createElement("button");
|
|
3480
3574
|
r.className = "vr-btn vr-btn-stop", r.textContent = "Stop", r.addEventListener("click", () => this.stopRecording()), o.appendChild(r);
|
|
3481
|
-
const
|
|
3482
|
-
|
|
3575
|
+
const a = document.createElement("button");
|
|
3576
|
+
a.className = "vr-btn vr-btn-cancel", a.textContent = "Cancel", a.addEventListener("click", () => this.cancelRecording()), o.appendChild(a), this.root.appendChild(o), e.appendChild(this.root);
|
|
3483
3577
|
}
|
|
3484
3578
|
updateTimer() {
|
|
3485
3579
|
if (!this.timerEl) return;
|
|
3486
|
-
const e =
|
|
3487
|
-
this.timerEl.textContent =
|
|
3580
|
+
const e = ut - this.elapsed;
|
|
3581
|
+
this.timerEl.textContent = Zi(this.elapsed), e <= 10 ? this.timerEl.classList.add("vr-countdown") : this.timerEl.classList.remove("vr-countdown");
|
|
3488
3582
|
}
|
|
3489
3583
|
async handleRecordingComplete() {
|
|
3490
3584
|
var s, o;
|
|
3491
3585
|
const e = ((s = this.mediaRecorder) == null ? void 0 : s.mimeType) || "video/webm", t = new Blob(this.chunks, { type: e });
|
|
3492
3586
|
let i;
|
|
3493
3587
|
try {
|
|
3494
|
-
i = await
|
|
3588
|
+
i = await es(t);
|
|
3495
3589
|
} catch {
|
|
3496
3590
|
const r = document.createElement("canvas");
|
|
3497
|
-
r.width = 1, r.height = 1, i = await new Promise((
|
|
3498
|
-
r.toBlob((
|
|
3591
|
+
r.width = 1, r.height = 1, i = await new Promise((a) => {
|
|
3592
|
+
r.toBlob((l) => a(l), "image/png");
|
|
3499
3593
|
});
|
|
3500
3594
|
}
|
|
3501
3595
|
this.cleanup(), (o = this.resolvePromise) == null || o.call(this, { blob: t, posterBlob: i }), this.resolvePromise = null;
|
|
@@ -3514,12 +3608,35 @@ class Le {
|
|
|
3514
3608
|
this.videoEl && (this.videoEl.srcObject = null, this.videoEl = null), this.root && this.root.parentElement && this.root.parentElement.removeChild(this.root), this.root = null, this.styleEl && this.styleEl.parentElement && this.styleEl.parentElement.removeChild(this.styleEl), this.styleEl = null, this.chunks = [], this.elapsed = 0;
|
|
3515
3609
|
}
|
|
3516
3610
|
}
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3611
|
+
const mt = {
|
|
3612
|
+
position: "absolute",
|
|
3613
|
+
top: "50%",
|
|
3614
|
+
transform: "translateY(-50%)",
|
|
3615
|
+
width: "44px",
|
|
3616
|
+
height: "44px",
|
|
3617
|
+
border: "none",
|
|
3618
|
+
borderRadius: "50%",
|
|
3619
|
+
background: "rgba(255,255,255,0.15)",
|
|
3620
|
+
color: "#fff",
|
|
3621
|
+
fontSize: "22px",
|
|
3622
|
+
cursor: "pointer",
|
|
3623
|
+
padding: "0",
|
|
3624
|
+
display: "flex",
|
|
3625
|
+
alignItems: "center",
|
|
3626
|
+
justifyContent: "center",
|
|
3627
|
+
transition: "background 150ms ease",
|
|
3628
|
+
zIndex: "1"
|
|
3629
|
+
}, f = class f {
|
|
3630
|
+
/**
|
|
3631
|
+
* Opens a fullscreen lightbox overlay.
|
|
3632
|
+
* @param imageUrl - Single image URL (backwards-compatible)
|
|
3633
|
+
* @param allUrls - Optional array of all image URLs for navigation
|
|
3634
|
+
* @param startIndex - Index in allUrls to start at (default 0)
|
|
3635
|
+
*/
|
|
3636
|
+
static open(e, t, i) {
|
|
3637
|
+
f.close(), f.urls = t && t.length > 1 ? t : [e], f.currentIndex = i ?? 0;
|
|
3638
|
+
const s = f.urls.length > 1, o = document.createElement("div");
|
|
3639
|
+
o.id = "pulse-widget-lightbox", Object.assign(o.style, {
|
|
3523
3640
|
position: "fixed",
|
|
3524
3641
|
top: "0",
|
|
3525
3642
|
left: "0",
|
|
@@ -3535,8 +3652,8 @@ const T = class T {
|
|
|
3535
3652
|
cursor: "pointer",
|
|
3536
3653
|
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"
|
|
3537
3654
|
});
|
|
3538
|
-
const
|
|
3539
|
-
|
|
3655
|
+
const r = document.createElement("button");
|
|
3656
|
+
r.textContent = "×", Object.assign(r.style, {
|
|
3540
3657
|
position: "absolute",
|
|
3541
3658
|
top: "16px",
|
|
3542
3659
|
right: "16px",
|
|
@@ -3547,54 +3664,86 @@ const T = class T {
|
|
|
3547
3664
|
background: "rgba(255,255,255,0.15)",
|
|
3548
3665
|
color: "#fff",
|
|
3549
3666
|
fontSize: "24px",
|
|
3550
|
-
lineHeight: "40px",
|
|
3551
|
-
textAlign: "center",
|
|
3552
3667
|
cursor: "pointer",
|
|
3553
3668
|
padding: "0",
|
|
3554
|
-
fontFamily: "inherit",
|
|
3555
3669
|
display: "flex",
|
|
3556
3670
|
alignItems: "center",
|
|
3557
3671
|
justifyContent: "center",
|
|
3558
|
-
transition: "background 150ms ease"
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3672
|
+
transition: "background 150ms ease",
|
|
3673
|
+
zIndex: "1"
|
|
3674
|
+
}), r.addEventListener("mouseenter", () => {
|
|
3675
|
+
r.style.background = "rgba(255,255,255,0.3)";
|
|
3676
|
+
}), r.addEventListener("mouseleave", () => {
|
|
3677
|
+
r.style.background = "rgba(255,255,255,0.15)";
|
|
3678
|
+
}), r.addEventListener("click", (d) => {
|
|
3679
|
+
d.stopPropagation(), f.close();
|
|
3680
|
+
}), o.appendChild(r);
|
|
3681
|
+
const a = document.createElement("img");
|
|
3682
|
+
if (a.src = f.urls[f.currentIndex], a.alt = "Lightbox image", Object.assign(a.style, {
|
|
3568
3683
|
maxWidth: "90vw",
|
|
3569
|
-
maxHeight: "
|
|
3684
|
+
maxHeight: "85vh",
|
|
3570
3685
|
borderRadius: "8px",
|
|
3571
3686
|
objectFit: "contain",
|
|
3572
3687
|
cursor: "default",
|
|
3573
|
-
userSelect: "none"
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3688
|
+
userSelect: "none",
|
|
3689
|
+
transition: "opacity 150ms ease"
|
|
3690
|
+
}), a.addEventListener("click", (d) => d.stopPropagation()), o.appendChild(a), f.imgEl = a, s) {
|
|
3691
|
+
const d = document.createElement("button");
|
|
3692
|
+
d.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="15,18 9,12 15,6"/></svg>', Object.assign(d.style, { ...mt, left: "16px" }), d.addEventListener("mouseenter", () => {
|
|
3693
|
+
d.style.background = "rgba(255,255,255,0.3)";
|
|
3694
|
+
}), d.addEventListener("mouseleave", () => {
|
|
3695
|
+
d.style.background = "rgba(255,255,255,0.15)";
|
|
3696
|
+
}), d.addEventListener("click", (p) => {
|
|
3697
|
+
p.stopPropagation(), f.navigate(-1);
|
|
3698
|
+
}), o.appendChild(d), f.prevBtn = d;
|
|
3699
|
+
const c = document.createElement("button");
|
|
3700
|
+
c.innerHTML = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9,18 15,12 9,6"/></svg>', Object.assign(c.style, { ...mt, right: "16px" }), c.addEventListener("mouseenter", () => {
|
|
3701
|
+
c.style.background = "rgba(255,255,255,0.3)";
|
|
3702
|
+
}), c.addEventListener("mouseleave", () => {
|
|
3703
|
+
c.style.background = "rgba(255,255,255,0.15)";
|
|
3704
|
+
}), c.addEventListener("click", (p) => {
|
|
3705
|
+
p.stopPropagation(), f.navigate(1);
|
|
3706
|
+
}), o.appendChild(c), f.nextBtn = c;
|
|
3707
|
+
const h = document.createElement("span");
|
|
3708
|
+
Object.assign(h.style, {
|
|
3709
|
+
position: "absolute",
|
|
3710
|
+
bottom: "20px",
|
|
3711
|
+
left: "50%",
|
|
3712
|
+
transform: "translateX(-50%)",
|
|
3713
|
+
color: "rgba(255,255,255,0.7)",
|
|
3714
|
+
fontSize: "13px",
|
|
3715
|
+
fontWeight: "500",
|
|
3716
|
+
pointerEvents: "none"
|
|
3717
|
+
}), o.appendChild(h), f.counterEl = h, f.updateNav();
|
|
3718
|
+
}
|
|
3719
|
+
o.addEventListener("click", () => f.close());
|
|
3720
|
+
const l = (d) => {
|
|
3721
|
+
d.key === "Escape" && f.close(), s && d.key === "ArrowLeft" && f.navigate(-1), s && d.key === "ArrowRight" && f.navigate(1);
|
|
3581
3722
|
};
|
|
3582
|
-
document.addEventListener("keydown",
|
|
3583
|
-
|
|
3723
|
+
document.addEventListener("keydown", l), f.overlay = o, f.onKeyDown = l, document.body.appendChild(o), requestAnimationFrame(() => {
|
|
3724
|
+
o.style.opacity = "1";
|
|
3584
3725
|
});
|
|
3585
3726
|
}
|
|
3727
|
+
static navigate(e) {
|
|
3728
|
+
const t = f.urls.length;
|
|
3729
|
+
f.currentIndex = (f.currentIndex + e + t) % t, f.imgEl && (f.imgEl.style.opacity = "0", setTimeout(() => {
|
|
3730
|
+
f.imgEl && (f.imgEl.src = f.urls[f.currentIndex], f.imgEl.style.opacity = "1");
|
|
3731
|
+
}, 100)), f.updateNav();
|
|
3732
|
+
}
|
|
3733
|
+
static updateNav() {
|
|
3734
|
+
const e = f.currentIndex, t = f.urls.length;
|
|
3735
|
+
f.counterEl && (f.counterEl.textContent = `${e + 1} / ${t}`);
|
|
3736
|
+
}
|
|
3586
3737
|
/** Closes the lightbox if open. */
|
|
3587
3738
|
static close() {
|
|
3588
|
-
if (!
|
|
3589
|
-
const e =
|
|
3590
|
-
|
|
3591
|
-
e.remove();
|
|
3592
|
-
}), T.overlay = null;
|
|
3739
|
+
if (!f.overlay) return;
|
|
3740
|
+
const e = f.overlay;
|
|
3741
|
+
f.onKeyDown && (document.removeEventListener("keydown", f.onKeyDown), f.onKeyDown = null), e.style.opacity = "0", e.addEventListener("transitionend", () => e.remove()), f.overlay = null, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null, f.urls = [], f.currentIndex = 0;
|
|
3593
3742
|
}
|
|
3594
3743
|
};
|
|
3595
|
-
|
|
3596
|
-
let
|
|
3597
|
-
class
|
|
3744
|
+
f.overlay = null, f.onKeyDown = null, f.urls = [], f.currentIndex = 0, f.imgEl = null, f.prevBtn = null, f.nextBtn = null, f.counterEl = null;
|
|
3745
|
+
let Te = f;
|
|
3746
|
+
class re {
|
|
3598
3747
|
constructor(e) {
|
|
3599
3748
|
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);
|
|
3600
3749
|
}
|
|
@@ -3608,19 +3757,19 @@ class ne {
|
|
|
3608
3757
|
const i = () => {
|
|
3609
3758
|
o(), t(null);
|
|
3610
3759
|
}, s = async () => {
|
|
3611
|
-
var
|
|
3760
|
+
var a;
|
|
3612
3761
|
o();
|
|
3613
|
-
const r = (
|
|
3762
|
+
const r = (a = this.input.files) == null ? void 0 : a[0];
|
|
3614
3763
|
if (!r) {
|
|
3615
3764
|
t(null);
|
|
3616
3765
|
return;
|
|
3617
3766
|
}
|
|
3618
3767
|
this.uploading = !0;
|
|
3619
3768
|
try {
|
|
3620
|
-
const
|
|
3621
|
-
t(
|
|
3622
|
-
} catch (
|
|
3623
|
-
console.error("[Pulse] File upload failed:",
|
|
3769
|
+
const l = await this.client.uploadFile(r);
|
|
3770
|
+
t(l);
|
|
3771
|
+
} catch (l) {
|
|
3772
|
+
console.error("[Pulse] File upload failed:", l), t(null);
|
|
3624
3773
|
} finally {
|
|
3625
3774
|
this.uploading = !1;
|
|
3626
3775
|
}
|
|
@@ -3641,24 +3790,24 @@ class ne {
|
|
|
3641
3790
|
r(), i([]);
|
|
3642
3791
|
}, o = async () => {
|
|
3643
3792
|
r();
|
|
3644
|
-
const
|
|
3645
|
-
if (!
|
|
3793
|
+
const a = this.input.files;
|
|
3794
|
+
if (!a || a.length === 0) {
|
|
3646
3795
|
i([]);
|
|
3647
3796
|
return;
|
|
3648
3797
|
}
|
|
3649
|
-
const
|
|
3798
|
+
const l = Array.from(a).slice(0, t);
|
|
3650
3799
|
this.uploading = !0;
|
|
3651
3800
|
try {
|
|
3652
|
-
const
|
|
3653
|
-
|
|
3801
|
+
const d = await Promise.all(
|
|
3802
|
+
l.map(async (c) => {
|
|
3654
3803
|
try {
|
|
3655
|
-
return await this.client.uploadFile(
|
|
3656
|
-
} catch (
|
|
3657
|
-
return console.error("[Pulse] File upload failed:",
|
|
3804
|
+
return await this.client.uploadFile(c);
|
|
3805
|
+
} catch (h) {
|
|
3806
|
+
return console.error("[Pulse] File upload failed:", h), null;
|
|
3658
3807
|
}
|
|
3659
3808
|
})
|
|
3660
3809
|
);
|
|
3661
|
-
i(
|
|
3810
|
+
i(d.filter((c) => c !== null));
|
|
3662
3811
|
} finally {
|
|
3663
3812
|
this.uploading = !1, this.input.multiple = !1;
|
|
3664
3813
|
}
|
|
@@ -3688,7 +3837,7 @@ class ne {
|
|
|
3688
3837
|
this.input.remove();
|
|
3689
3838
|
}
|
|
3690
3839
|
}
|
|
3691
|
-
const
|
|
3840
|
+
const ts = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], xe = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", is = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>', ss = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>', gt = `<button class="pulse-close-btn" style="
|
|
3692
3841
|
border:none;background:none;cursor:pointer;color:#94a3b8;padding:4px;
|
|
3693
3842
|
border-radius:6px;display:flex;align-items:center;justify-content:center;
|
|
3694
3843
|
transition:all 0.15s;flex-shrink:0;
|
|
@@ -3696,7 +3845,7 @@ const Ki = ["👍", "👎", "❤️", "🎉", "👀", "🚀"], be = "-apple-syst
|
|
|
3696
3845
|
onmouseout="this.style.background='none';this.style.color='#94a3b8'">
|
|
3697
3846
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
|
|
3698
3847
|
</button>`;
|
|
3699
|
-
class
|
|
3848
|
+
class ns {
|
|
3700
3849
|
constructor(e, t = {}) {
|
|
3701
3850
|
this.container = null, this.overlay = null, this.form = null, this.popover = null, this.threads = [], this.pinEls = /* @__PURE__ */ new Map(), this._pinModeActive = !1, this.editingPopoverCommentId = null, this.popoverPickerOpen = null, this.lastTypingSendPins = /* @__PURE__ */ new Map(), this.repositionDebounce = null, this.mutationObserver = null, this.upload = null, this.audioRecorder = null, this.videoRecorder = null, this.pendingAttachmentIds = [], this.handleReposition = () => {
|
|
3702
3851
|
this.repositionDebounce || (this.repositionDebounce = setTimeout(() => {
|
|
@@ -3719,13 +3868,13 @@ class Ji {
|
|
|
3719
3868
|
y: i.clientY / o,
|
|
3720
3869
|
scrollX: window.scrollX,
|
|
3721
3870
|
scrollY: window.scrollY
|
|
3722
|
-
},
|
|
3871
|
+
}, a = this.overlay.style.pointerEvents;
|
|
3723
3872
|
this.overlay.style.pointerEvents = "none";
|
|
3724
|
-
const
|
|
3725
|
-
if (this.overlay.style.pointerEvents =
|
|
3726
|
-
r.selector = this.getSelector(
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3873
|
+
const l = document.elementFromPoint(i.clientX, i.clientY);
|
|
3874
|
+
if (this.overlay.style.pointerEvents = a, l) {
|
|
3875
|
+
r.selector = this.getSelector(l);
|
|
3876
|
+
const d = l.getBoundingClientRect();
|
|
3877
|
+
d.width > 0 && d.height > 0 && (r.elementOffsetX = (i.clientX - d.left) / d.width, r.elementOffsetY = (i.clientY - d.top) / d.height);
|
|
3729
3878
|
}
|
|
3730
3879
|
this.showPinForm(i.clientX, i.clientY, r);
|
|
3731
3880
|
}, this.pickerEl = null, this.client = e, this.onPinModeExit = t.onPinModeExit, this.init();
|
|
@@ -3803,14 +3952,14 @@ class Ji {
|
|
|
3803
3952
|
t.unshift(`#${i.id}`);
|
|
3804
3953
|
break;
|
|
3805
3954
|
}
|
|
3806
|
-
const s = i.tagName.toLowerCase(), o = [...i.classList].filter((
|
|
3955
|
+
const s = i.tagName.toLowerCase(), o = [...i.classList].filter((l) => !l.startsWith("pulse-")).slice(0, 2);
|
|
3807
3956
|
let r = o.length > 0 ? `${s}.${o.join(".")}` : s;
|
|
3808
|
-
const
|
|
3809
|
-
if (
|
|
3810
|
-
const
|
|
3811
|
-
if (
|
|
3812
|
-
const
|
|
3813
|
-
r += `:nth-child(${
|
|
3957
|
+
const a = i.parentElement;
|
|
3958
|
+
if (a) {
|
|
3959
|
+
const l = [...a.children].filter((d) => d.tagName === i.tagName);
|
|
3960
|
+
if (l.length > 1) {
|
|
3961
|
+
const d = l.indexOf(i) + 1;
|
|
3962
|
+
r += `:nth-child(${d})`;
|
|
3814
3963
|
}
|
|
3815
3964
|
}
|
|
3816
3965
|
if (t.unshift(r), i = i.parentElement, t.length >= 4) break;
|
|
@@ -3820,11 +3969,11 @@ class Ji {
|
|
|
3820
3969
|
showPinForm(e, t, i) {
|
|
3821
3970
|
this.form = document.createElement("div");
|
|
3822
3971
|
const s = Math.min(280, window.innerWidth - 32), o = 120;
|
|
3823
|
-
let r = e + 16,
|
|
3824
|
-
r + s > window.innerWidth - 16 && (r = e - s - 16),
|
|
3972
|
+
let r = e + 16, a = t - 10;
|
|
3973
|
+
r + s > window.innerWidth - 16 && (r = e - s - 16), a + o > window.innerHeight - 16 && (a = window.innerHeight - o - 16), a < 16 && (a = 16), Object.assign(this.form.style, {
|
|
3825
3974
|
position: "fixed",
|
|
3826
3975
|
left: `${r}px`,
|
|
3827
|
-
top: `${
|
|
3976
|
+
top: `${a}px`,
|
|
3828
3977
|
width: `${s}px`,
|
|
3829
3978
|
zIndex: "10001",
|
|
3830
3979
|
background: "#fff",
|
|
@@ -3832,11 +3981,11 @@ class Ji {
|
|
|
3832
3981
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3833
3982
|
border: "1px solid #e2e8f0",
|
|
3834
3983
|
padding: "14px",
|
|
3835
|
-
fontFamily:
|
|
3984
|
+
fontFamily: xe
|
|
3836
3985
|
}), this.form.innerHTML = `
|
|
3837
3986
|
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;">
|
|
3838
3987
|
<span style="font-size:13px;font-weight:600;color:#0f172a;">Add a comment here</span>
|
|
3839
|
-
${
|
|
3988
|
+
${gt}
|
|
3840
3989
|
</div>
|
|
3841
3990
|
<textarea
|
|
3842
3991
|
placeholder="Write a comment..."
|
|
@@ -3868,13 +4017,13 @@ class Ji {
|
|
|
3868
4017
|
</div>
|
|
3869
4018
|
<div class="pin-attachments-preview" style="margin-top:6px;display:flex;flex-wrap:wrap;gap:6px;"></div>
|
|
3870
4019
|
`;
|
|
3871
|
-
const
|
|
3872
|
-
|
|
3873
|
-
const
|
|
3874
|
-
const
|
|
3875
|
-
Object.assign(
|
|
3876
|
-
const
|
|
3877
|
-
|
|
4020
|
+
const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
|
|
4021
|
+
d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
|
|
4022
|
+
const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
|
|
4023
|
+
const v = document.createElement("div");
|
|
4024
|
+
Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
|
|
4025
|
+
const w = document.createElement("button");
|
|
4026
|
+
w.innerHTML = "×", Object.assign(w.style, {
|
|
3878
4027
|
position: "absolute",
|
|
3879
4028
|
top: "-4px",
|
|
3880
4029
|
right: "-4px",
|
|
@@ -3892,62 +4041,62 @@ class Ji {
|
|
|
3892
4041
|
justifyContent: "center",
|
|
3893
4042
|
padding: "0",
|
|
3894
4043
|
fontWeight: "700"
|
|
3895
|
-
}),
|
|
3896
|
-
const E = this.pendingAttachmentIds.indexOf(
|
|
3897
|
-
E !== -1 && this.pendingAttachmentIds.splice(E, 1),
|
|
3898
|
-
}),
|
|
3899
|
-
},
|
|
4044
|
+
}), w.addEventListener("click", () => {
|
|
4045
|
+
const E = this.pendingAttachmentIds.indexOf(g);
|
|
4046
|
+
E !== -1 && this.pendingAttachmentIds.splice(E, 1), v.remove();
|
|
4047
|
+
}), v.appendChild(w), h.appendChild(v);
|
|
4048
|
+
}, m = 5;
|
|
3900
4049
|
this.form.querySelector(".attach-img").addEventListener("click", async () => {
|
|
3901
|
-
const
|
|
3902
|
-
if (
|
|
3903
|
-
const
|
|
3904
|
-
for (const
|
|
3905
|
-
this.pendingAttachmentIds.push(
|
|
3906
|
-
const
|
|
3907
|
-
|
|
4050
|
+
const g = m - this.pendingAttachmentIds.length;
|
|
4051
|
+
if (g <= 0) return;
|
|
4052
|
+
const y = await this.upload.pickFiles("image/*", g);
|
|
4053
|
+
for (const v of y) {
|
|
4054
|
+
this.pendingAttachmentIds.push(v.id);
|
|
4055
|
+
const w = document.createElement("img");
|
|
4056
|
+
w.src = v.thumbnailUrl || v.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(v.id, w);
|
|
3908
4057
|
}
|
|
3909
4058
|
}), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
|
|
3910
|
-
if (this.pendingAttachmentIds.length >=
|
|
3911
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
3912
|
-
const
|
|
3913
|
-
if (
|
|
3914
|
-
const
|
|
3915
|
-
if (
|
|
3916
|
-
this.pendingAttachmentIds.push(
|
|
3917
|
-
const
|
|
3918
|
-
Object.assign(
|
|
4059
|
+
if (this.pendingAttachmentIds.length >= m) return;
|
|
4060
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4061
|
+
const g = await this.audioRecorder.startRecording(h);
|
|
4062
|
+
if (g) {
|
|
4063
|
+
const y = await this.upload.uploadBlob(g, "audio.webm");
|
|
4064
|
+
if (y) {
|
|
4065
|
+
this.pendingAttachmentIds.push(y.id);
|
|
4066
|
+
const v = document.createElement("span");
|
|
4067
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", p(y.id, v);
|
|
3919
4068
|
}
|
|
3920
4069
|
}
|
|
3921
4070
|
}), this.form.querySelector(".attach-video").addEventListener("click", async () => {
|
|
3922
|
-
if (this.pendingAttachmentIds.length >=
|
|
3923
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
3924
|
-
const
|
|
3925
|
-
if (
|
|
3926
|
-
const
|
|
3927
|
-
if (
|
|
3928
|
-
this.pendingAttachmentIds.push(
|
|
3929
|
-
const
|
|
3930
|
-
Object.assign(
|
|
4071
|
+
if (this.pendingAttachmentIds.length >= m) return;
|
|
4072
|
+
this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4073
|
+
const g = await this.videoRecorder.startRecording(h);
|
|
4074
|
+
if (g) {
|
|
4075
|
+
const y = await this.upload.uploadBlob(g.blob, "video.webm");
|
|
4076
|
+
if (y) {
|
|
4077
|
+
this.pendingAttachmentIds.push(y.id);
|
|
4078
|
+
const v = document.createElement("span");
|
|
4079
|
+
Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", p(y.id, v);
|
|
3931
4080
|
}
|
|
3932
4081
|
}
|
|
3933
|
-
}),
|
|
3934
|
-
const
|
|
3935
|
-
if (!
|
|
3936
|
-
const
|
|
3937
|
-
this.client.createThread(
|
|
3938
|
-
}),
|
|
3939
|
-
|
|
3940
|
-
}), document.body.appendChild(this.form), requestAnimationFrame(() =>
|
|
4082
|
+
}), c.addEventListener("click", () => {
|
|
4083
|
+
const g = l.value.trim();
|
|
4084
|
+
if (!g && this.pendingAttachmentIds.length === 0) return;
|
|
4085
|
+
const y = [...(g || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
|
|
4086
|
+
this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
|
|
4087
|
+
}), l.addEventListener("keydown", (g) => {
|
|
4088
|
+
g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
|
|
4089
|
+
}), document.body.appendChild(this.form), requestAnimationFrame(() => l.focus());
|
|
3941
4090
|
}
|
|
3942
4091
|
// ── Inline thread popover (shown when a pin dot is clicked) ──
|
|
3943
4092
|
showThreadPopover(e, t) {
|
|
3944
4093
|
this.closePopover(), this.popover = document.createElement("div"), this.popover.dataset.threadId = e.id;
|
|
3945
4094
|
const i = window.innerWidth <= 480, s = i ? window.innerWidth : 300, o = t.getBoundingClientRect();
|
|
3946
|
-
let r,
|
|
3947
|
-
i ? (r = 0,
|
|
4095
|
+
let r, a;
|
|
4096
|
+
i ? (r = 0, a = window.innerHeight * 0.4) : (r = o.right + 10, a = o.top - 8, r + s > window.innerWidth - 16 && (r = o.left - s - 10), a < 16 && (a = 16)), Object.assign(this.popover.style, {
|
|
3948
4097
|
position: "fixed",
|
|
3949
4098
|
left: `${r}px`,
|
|
3950
|
-
top: `${
|
|
4099
|
+
top: `${a}px`,
|
|
3951
4100
|
width: i ? "100vw" : `${s}px`,
|
|
3952
4101
|
maxHeight: i ? "60vh" : "360px",
|
|
3953
4102
|
zIndex: "10001",
|
|
@@ -3955,36 +4104,36 @@ class Ji {
|
|
|
3955
4104
|
borderRadius: i ? "16px 16px 0 0" : "12px",
|
|
3956
4105
|
boxShadow: "0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08)",
|
|
3957
4106
|
border: "1px solid #e2e8f0",
|
|
3958
|
-
fontFamily:
|
|
4107
|
+
fontFamily: xe,
|
|
3959
4108
|
display: "flex",
|
|
3960
4109
|
flexDirection: "column",
|
|
3961
4110
|
overflow: "hidden",
|
|
3962
4111
|
pointerEvents: "auto",
|
|
3963
4112
|
...i ? { bottom: "0", top: "auto" } : {}
|
|
3964
4113
|
});
|
|
3965
|
-
const
|
|
3966
|
-
Object.assign(
|
|
4114
|
+
const l = document.createElement("div");
|
|
4115
|
+
Object.assign(l.style, {
|
|
3967
4116
|
display: "flex",
|
|
3968
4117
|
alignItems: "center",
|
|
3969
4118
|
justifyContent: "space-between",
|
|
3970
4119
|
padding: "10px 14px",
|
|
3971
4120
|
borderBottom: "1px solid #f1f5f9",
|
|
3972
4121
|
flexShrink: "0"
|
|
3973
|
-
}),
|
|
4122
|
+
}), l.innerHTML = `
|
|
3974
4123
|
<span style="font-size:13px;font-weight:700;color:#0f172a;">Thread</span>
|
|
3975
|
-
${
|
|
3976
|
-
`,
|
|
4124
|
+
${gt}
|
|
4125
|
+
`, l.querySelector(".pulse-close-btn").addEventListener("click", () => {
|
|
3977
4126
|
this.closePopover();
|
|
3978
|
-
}), this.popover.appendChild(
|
|
3979
|
-
const
|
|
3980
|
-
|
|
4127
|
+
}), this.popover.appendChild(l), this.refreshPopoverComments(e), this.addPopoverReplyForm(e), document.body.appendChild(this.popover);
|
|
4128
|
+
const d = this.popover.getBoundingClientRect();
|
|
4129
|
+
d.bottom > window.innerHeight - 16 && (this.popover.style.top = `${Math.max(16, window.innerHeight - d.height - 16)}px`), requestAnimationFrame(() => {
|
|
3981
4130
|
document.addEventListener("pointerdown", this.handlePopoverOutsideClick), document.addEventListener("keydown", this.handlePopoverEscape);
|
|
3982
4131
|
});
|
|
3983
4132
|
}
|
|
3984
4133
|
refreshPopoverComments(e) {
|
|
3985
|
-
var
|
|
4134
|
+
var d;
|
|
3986
4135
|
if (!this.popover) return;
|
|
3987
|
-
this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((
|
|
4136
|
+
this.removePickerEl(), this.editingPopoverCommentId && !e.comments.find((c) => c.id === this.editingPopoverCommentId) && (this.editingPopoverCommentId = null);
|
|
3988
4137
|
let t = this.popover.querySelector(
|
|
3989
4138
|
".popover-comments"
|
|
3990
4139
|
);
|
|
@@ -3995,21 +4144,21 @@ class Ji {
|
|
|
3995
4144
|
padding: "12px 14px",
|
|
3996
4145
|
minHeight: "0"
|
|
3997
4146
|
});
|
|
3998
|
-
const
|
|
3999
|
-
|
|
4147
|
+
const c = this.popover.firstElementChild;
|
|
4148
|
+
c && c.nextSibling ? this.popover.insertBefore(t, c.nextSibling) : this.popover.appendChild(t);
|
|
4000
4149
|
}
|
|
4001
|
-
const i = (
|
|
4002
|
-
t.innerHTML = e.comments.map((
|
|
4003
|
-
const
|
|
4004
|
-
if (this.editingPopoverCommentId ===
|
|
4150
|
+
const i = (d = this.client.state.user) == null ? void 0 : d.id;
|
|
4151
|
+
t.innerHTML = e.comments.map((c) => {
|
|
4152
|
+
const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), v = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
|
|
4153
|
+
if (this.editingPopoverCommentId === c.id)
|
|
4005
4154
|
return `
|
|
4006
|
-
<div style="margin-bottom:10px;" data-comment-id="${
|
|
4155
|
+
<div style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4007
4156
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:4px;">
|
|
4008
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4009
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4157
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
4158
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
|
|
4010
4159
|
</div>
|
|
4011
4160
|
<div style="margin-left:29px;">
|
|
4012
|
-
<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(
|
|
4161
|
+
<textarea class="edit-textarea" style="width:100%;padding:6px 10px;border:1.5px solid #e2e8f0;border-radius:6px;font-size:12px;font-family:inherit;outline:none;resize:vertical;min-height:48px;color:#0f172a;box-sizing:border-box;">${this.escapeHtml(c.body)}</textarea>
|
|
4013
4162
|
<div style="display:flex;gap:6px;margin-top:6px;">
|
|
4014
4163
|
<button class="edit-save" style="padding:4px 10px;background:#6366f1;color:#fff;border:none;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;">Save</button>
|
|
4015
4164
|
<button class="edit-cancel" style="padding:4px 10px;border:1px solid #e2e8f0;border-radius:6px;font-size:11px;font-weight:500;cursor:pointer;background:#fff;font-family:inherit;color:#64748b;">Cancel</button>
|
|
@@ -4017,90 +4166,92 @@ class Ji {
|
|
|
4017
4166
|
</div>
|
|
4018
4167
|
</div>
|
|
4019
4168
|
`;
|
|
4020
|
-
const
|
|
4169
|
+
const E = c.body && c.body !== "(attachment)" ? c.body.replace(
|
|
4021
4170
|
/@(\w+)/g,
|
|
4022
4171
|
'<span style="color:#6366f1;font-weight:600;background:#eef2ff;padding:0 3px;border-radius:3px;">@$1</span>'
|
|
4023
|
-
) : "",
|
|
4024
|
-
if (
|
|
4025
|
-
const
|
|
4026
|
-
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(
|
|
4027
|
-
<img src="${this.escapeHtml(
|
|
4172
|
+
) : "", I = (c.attachments ?? []).map((O) => {
|
|
4173
|
+
if (O.type === "image") {
|
|
4174
|
+
const Mt = O.thumbnailUrl || O.url;
|
|
4175
|
+
return `<div class="popover-attachment-img" data-full-url="${this.escapeHtml(O.url)}" style="margin:4px 0 4px 29px;cursor:pointer;">
|
|
4176
|
+
<img src="${this.escapeHtml(Mt)}" alt="${this.escapeHtml(O.filename)}" style="max-width:180px;max-height:120px;border-radius:8px;border:1px solid #e2e8f0;display:block;" />
|
|
4028
4177
|
</div>`;
|
|
4029
4178
|
}
|
|
4030
|
-
return
|
|
4031
|
-
}).join(""),
|
|
4032
|
-
<button class="edit-btn" data-comment-id="${
|
|
4179
|
+
return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
|
|
4180
|
+
}).join(""), z = v ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
|
|
4181
|
+
<button class="edit-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
|
|
4033
4182
|
onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
|
|
4034
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4035
|
-
<button class="delete-btn" data-comment-id="${
|
|
4183
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
|
|
4184
|
+
<button class="delete-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Delete"
|
|
4036
4185
|
onmouseover="this.style.color='#ef4444';this.style.background='#fef2f2'"
|
|
4037
|
-
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${
|
|
4038
|
-
</div>` : "",
|
|
4186
|
+
onmouseout="this.style.color='#94a3b8';this.style.background='none'">${ss}</button>
|
|
4187
|
+
</div>` : "", It = this.buildReactionPillsHtml(c.id);
|
|
4039
4188
|
return `
|
|
4040
|
-
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${
|
|
4189
|
+
<div class="popover-comment" style="margin-bottom:10px;" data-comment-id="${c.id}">
|
|
4041
4190
|
<div style="display:flex;align-items:center;gap:7px;margin-bottom:2px;">
|
|
4042
|
-
<div style="width:22px;height:22px;border-radius:50%;background:${
|
|
4043
|
-
<span style="font-size:12px;font-weight:600;color:#0f172a;">${
|
|
4044
|
-
<span style="font-size:10px;color:#94a3b8;">${
|
|
4045
|
-
${
|
|
4191
|
+
<div style="width:22px;height:22px;border-radius:50%;background:${m};color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;">${p}</div>
|
|
4192
|
+
<span style="font-size:12px;font-weight:600;color:#0f172a;">${g}</span>
|
|
4193
|
+
<span style="font-size:10px;color:#94a3b8;">${y}</span>
|
|
4194
|
+
${w}
|
|
4046
4195
|
</div>
|
|
4047
|
-
${
|
|
4048
|
-
${y}
|
|
4049
|
-
${E}
|
|
4196
|
+
${E ? `<div style="font-size:13px;color:#334155;line-height:1.45;margin-left:29px;word-wrap:break-word;">${E}</div>` : ""}
|
|
4050
4197
|
${I}
|
|
4198
|
+
${z}
|
|
4199
|
+
${It}
|
|
4051
4200
|
</div>
|
|
4052
4201
|
`;
|
|
4053
|
-
}).join(""), t.querySelectorAll(".edit-btn").forEach((
|
|
4054
|
-
|
|
4055
|
-
this.editingPopoverCommentId =
|
|
4202
|
+
}).join(""), t.querySelectorAll(".edit-btn").forEach((c) => {
|
|
4203
|
+
c.addEventListener("click", () => {
|
|
4204
|
+
this.editingPopoverCommentId = c.dataset.commentId, this.refreshPopoverComments(e);
|
|
4056
4205
|
});
|
|
4057
|
-
}), t.querySelectorAll(".delete-btn").forEach((
|
|
4058
|
-
|
|
4059
|
-
this.client.deleteComment(
|
|
4206
|
+
}), t.querySelectorAll(".delete-btn").forEach((c) => {
|
|
4207
|
+
c.addEventListener("click", () => {
|
|
4208
|
+
this.client.deleteComment(c.dataset.commentId);
|
|
4060
4209
|
});
|
|
4061
4210
|
});
|
|
4062
4211
|
const s = t.querySelector(".edit-save"), o = t.querySelector(".edit-cancel"), r = t.querySelector(
|
|
4063
4212
|
".edit-textarea"
|
|
4064
4213
|
);
|
|
4065
4214
|
s && r && s.addEventListener("click", () => {
|
|
4066
|
-
const
|
|
4067
|
-
if (!
|
|
4068
|
-
const
|
|
4215
|
+
const c = r.value.trim();
|
|
4216
|
+
if (!c) return;
|
|
4217
|
+
const h = [...c.matchAll(/@(\w+)/g)].map((p) => p[1]);
|
|
4069
4218
|
this.client.editComment(
|
|
4070
4219
|
this.editingPopoverCommentId,
|
|
4071
|
-
|
|
4072
|
-
|
|
4220
|
+
c,
|
|
4221
|
+
h
|
|
4073
4222
|
), this.editingPopoverCommentId = null;
|
|
4074
4223
|
}), o && o.addEventListener("click", () => {
|
|
4075
4224
|
this.editingPopoverCommentId = null, this.refreshPopoverComments(e);
|
|
4076
|
-
}), t.querySelectorAll("[data-reaction-emoji]").forEach((
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
const
|
|
4080
|
-
|
|
4225
|
+
}), t.querySelectorAll("[data-reaction-emoji]").forEach((c) => {
|
|
4226
|
+
c.addEventListener("click", (h) => {
|
|
4227
|
+
h.stopPropagation();
|
|
4228
|
+
const p = c.dataset.reactionEmoji, m = c.dataset.reactionTarget, g = c.dataset.reactionId;
|
|
4229
|
+
g ? this.client.removeReaction(g) : this.client.addReaction(m, "comment", p);
|
|
4081
4230
|
});
|
|
4082
|
-
}), t.querySelectorAll(".popover-reaction-add").forEach((
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
const
|
|
4086
|
-
this.popoverPickerOpen ===
|
|
4231
|
+
}), t.querySelectorAll(".popover-reaction-add").forEach((c) => {
|
|
4232
|
+
c.addEventListener("click", (h) => {
|
|
4233
|
+
h.stopPropagation();
|
|
4234
|
+
const p = c.dataset.commentId;
|
|
4235
|
+
this.popoverPickerOpen === p ? (this.popoverPickerOpen = null, this.removePickerEl()) : (this.popoverPickerOpen = p, this.showPickerForButton(c, p));
|
|
4087
4236
|
});
|
|
4088
|
-
})
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4237
|
+
});
|
|
4238
|
+
const a = t.querySelectorAll(".popover-attachment-img"), l = Array.from(a).map((c) => c.dataset.fullUrl).filter(Boolean);
|
|
4239
|
+
a.forEach((c, h) => {
|
|
4240
|
+
c.addEventListener("click", () => {
|
|
4241
|
+
const p = c.dataset.fullUrl;
|
|
4242
|
+
p && Te.open(p, l, h);
|
|
4092
4243
|
});
|
|
4093
|
-
}), t.querySelectorAll(".popover-attachment-audio").forEach((
|
|
4094
|
-
const
|
|
4095
|
-
if (
|
|
4096
|
-
const
|
|
4097
|
-
|
|
4098
|
-
}
|
|
4099
|
-
}), t.querySelectorAll(".popover-attachment-video").forEach((
|
|
4100
|
-
const
|
|
4101
|
-
if (
|
|
4102
|
-
const
|
|
4103
|
-
|
|
4244
|
+
}), t.querySelectorAll(".popover-attachment-audio").forEach((c) => {
|
|
4245
|
+
const h = c.dataset.url;
|
|
4246
|
+
if (h) {
|
|
4247
|
+
const p = c.dataset.duration ? parseInt(c.dataset.duration) : void 0, m = je.render(h, p);
|
|
4248
|
+
c.appendChild(m);
|
|
4249
|
+
}
|
|
4250
|
+
}), t.querySelectorAll(".popover-attachment-video").forEach((c) => {
|
|
4251
|
+
const h = c.dataset.url;
|
|
4252
|
+
if (h) {
|
|
4253
|
+
const p = c.dataset.poster || void 0, m = Ce.render(h, p);
|
|
4254
|
+
c.appendChild(m);
|
|
4104
4255
|
}
|
|
4105
4256
|
}), t.scrollTop = t.scrollHeight;
|
|
4106
4257
|
}
|
|
@@ -4131,13 +4282,13 @@ class Ji {
|
|
|
4131
4282
|
<div class="reply-attachments-preview" style="flex:1;display:flex;gap:4px;flex-wrap:wrap;margin-left:4px;"></div>
|
|
4132
4283
|
</div>
|
|
4133
4284
|
`;
|
|
4134
|
-
const o = t.querySelector("input"), r = t.querySelector(".reply-send"),
|
|
4135
|
-
this.upload || (this.upload = new
|
|
4136
|
-
const
|
|
4137
|
-
const
|
|
4138
|
-
Object.assign(
|
|
4139
|
-
const
|
|
4140
|
-
|
|
4285
|
+
const o = t.querySelector("input"), r = t.querySelector(".reply-send"), a = t.querySelector(".reply-attachments-preview");
|
|
4286
|
+
this.upload || (this.upload = new re(this.client));
|
|
4287
|
+
const l = [], d = (p, m) => {
|
|
4288
|
+
const g = document.createElement("span");
|
|
4289
|
+
Object.assign(g.style, { position: "relative", display: "inline-flex", alignItems: "center", padding: "2px 18px 2px 8px", borderRadius: "4px", background: "#f1f5f9", fontSize: "10px", color: "#64748b" }), g.textContent = m;
|
|
4290
|
+
const y = document.createElement("button");
|
|
4291
|
+
y.innerHTML = "×", Object.assign(y.style, {
|
|
4141
4292
|
position: "absolute",
|
|
4142
4293
|
top: "-3px",
|
|
4143
4294
|
right: "-3px",
|
|
@@ -4155,45 +4306,45 @@ class Ji {
|
|
|
4155
4306
|
justifyContent: "center",
|
|
4156
4307
|
padding: "0",
|
|
4157
4308
|
fontWeight: "700"
|
|
4158
|
-
}),
|
|
4159
|
-
const
|
|
4160
|
-
|
|
4161
|
-
}),
|
|
4162
|
-
},
|
|
4309
|
+
}), y.addEventListener("click", () => {
|
|
4310
|
+
const v = l.indexOf(p);
|
|
4311
|
+
v !== -1 && l.splice(v, 1), g.remove();
|
|
4312
|
+
}), g.appendChild(y), a.appendChild(g);
|
|
4313
|
+
}, c = 5;
|
|
4163
4314
|
t.querySelector(".reply-attach-img").addEventListener("click", async () => {
|
|
4164
|
-
const
|
|
4165
|
-
if (
|
|
4166
|
-
const
|
|
4167
|
-
for (const
|
|
4168
|
-
|
|
4315
|
+
const p = c - l.length;
|
|
4316
|
+
if (p <= 0) return;
|
|
4317
|
+
const m = await this.upload.pickFiles("image/*", p);
|
|
4318
|
+
for (const g of m)
|
|
4319
|
+
l.push(g.id), d(g.id, "📎 Image");
|
|
4169
4320
|
}), t.querySelector(".reply-attach-mic").addEventListener("click", async () => {
|
|
4170
|
-
if (
|
|
4171
|
-
this.audioRecorder || (this.audioRecorder = new
|
|
4172
|
-
const
|
|
4173
|
-
if (
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4321
|
+
if (l.length >= c) return;
|
|
4322
|
+
this.audioRecorder || (this.audioRecorder = new ze());
|
|
4323
|
+
const p = await this.audioRecorder.startRecording(t);
|
|
4324
|
+
if (p) {
|
|
4325
|
+
const m = await this.upload.uploadBlob(p, "audio.webm");
|
|
4326
|
+
m && (l.push(m.id), d(m.id, "🎤 Audio"));
|
|
4176
4327
|
}
|
|
4177
4328
|
}), t.querySelector(".reply-attach-video").addEventListener("click", async () => {
|
|
4178
|
-
if (
|
|
4179
|
-
this.videoRecorder || (this.videoRecorder = new
|
|
4180
|
-
const
|
|
4181
|
-
if (
|
|
4182
|
-
const
|
|
4183
|
-
|
|
4329
|
+
if (l.length >= c) return;
|
|
4330
|
+
this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4331
|
+
const p = await this.videoRecorder.startRecording(t);
|
|
4332
|
+
if (p) {
|
|
4333
|
+
const m = await this.upload.uploadBlob(p.blob, "video.webm");
|
|
4334
|
+
m && (l.push(m.id), d(m.id, "🎥 Video"));
|
|
4184
4335
|
}
|
|
4185
4336
|
});
|
|
4186
|
-
const
|
|
4187
|
-
const
|
|
4188
|
-
if (!
|
|
4189
|
-
const
|
|
4190
|
-
this.client.reply(e.id,
|
|
4337
|
+
const h = () => {
|
|
4338
|
+
const p = o.value.trim();
|
|
4339
|
+
if (!p && l.length === 0) return;
|
|
4340
|
+
const m = [...(p || "").matchAll(/@(\w+)/g)].map((g) => g[1]);
|
|
4341
|
+
this.client.reply(e.id, p, m, l.length > 0 ? [...l] : void 0), o.value = "", l.length = 0, a.innerHTML = "";
|
|
4191
4342
|
};
|
|
4192
|
-
r.addEventListener("click",
|
|
4193
|
-
const
|
|
4194
|
-
|
|
4195
|
-
}), o.addEventListener("keydown", (
|
|
4196
|
-
|
|
4343
|
+
r.addEventListener("click", h), o.addEventListener("input", () => {
|
|
4344
|
+
const p = Date.now(), m = this.lastTypingSendPins.get(e.id) ?? 0;
|
|
4345
|
+
p - m >= 2e3 && (this.client.sendTyping(e.id), this.lastTypingSendPins.set(e.id, p));
|
|
4346
|
+
}), o.addEventListener("keydown", (p) => {
|
|
4347
|
+
p.key === "Enter" && (p.preventDefault(), h()), p.key === "Escape" && this.closePopover(), p.stopPropagation();
|
|
4197
4348
|
}), this.popover.appendChild(t);
|
|
4198
4349
|
}
|
|
4199
4350
|
removePickerEl() {
|
|
@@ -4216,9 +4367,9 @@ class Ji {
|
|
|
4216
4367
|
borderRadius: "8px",
|
|
4217
4368
|
boxShadow: "0 4px 24px rgba(0,0,0,0.12)",
|
|
4218
4369
|
zIndex: "10002",
|
|
4219
|
-
fontFamily:
|
|
4370
|
+
fontFamily: xe
|
|
4220
4371
|
});
|
|
4221
|
-
for (const s of
|
|
4372
|
+
for (const s of ts) {
|
|
4222
4373
|
const o = document.createElement("button");
|
|
4223
4374
|
Object.assign(o.style, {
|
|
4224
4375
|
border: "none",
|
|
@@ -4230,33 +4381,33 @@ class Ji {
|
|
|
4230
4381
|
lineHeight: "1"
|
|
4231
4382
|
}), o.textContent = s, o.addEventListener("click", (r) => {
|
|
4232
4383
|
r.stopPropagation();
|
|
4233
|
-
const
|
|
4234
|
-
(
|
|
4235
|
-
var
|
|
4236
|
-
return
|
|
4384
|
+
const l = this.client.state.getReactions(t).find(
|
|
4385
|
+
(d) => {
|
|
4386
|
+
var c;
|
|
4387
|
+
return d.emoji === s && d.userId === ((c = this.client.state.user) == null ? void 0 : c.id);
|
|
4237
4388
|
}
|
|
4238
4389
|
);
|
|
4239
|
-
|
|
4390
|
+
l ? this.client.removeReaction(l.id) : this.client.addReaction(t, "comment", s), this.popoverPickerOpen = null, this.removePickerEl();
|
|
4240
4391
|
}), this.pickerEl.appendChild(o);
|
|
4241
4392
|
}
|
|
4242
4393
|
document.body.appendChild(this.pickerEl);
|
|
4243
4394
|
}
|
|
4244
4395
|
buildReactionPillsHtml(e) {
|
|
4245
|
-
var
|
|
4246
|
-
const t = this.client.state.getReactions(e), i = (
|
|
4247
|
-
for (const
|
|
4248
|
-
const
|
|
4249
|
-
|
|
4396
|
+
var l;
|
|
4397
|
+
const t = this.client.state.getReactions(e), i = (l = this.client.state.user) == null ? void 0 : l.id, s = /* @__PURE__ */ new Map();
|
|
4398
|
+
for (const d of t) {
|
|
4399
|
+
const c = s.get(d.emoji) ?? { count: 0, ownId: null };
|
|
4400
|
+
c.count++, d.userId === i && (c.ownId = d.id), s.set(d.emoji, c);
|
|
4250
4401
|
}
|
|
4251
4402
|
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;";
|
|
4252
|
-
let
|
|
4253
|
-
for (const [
|
|
4254
|
-
const
|
|
4255
|
-
|
|
4256
|
-
<span>${
|
|
4403
|
+
let a = '<div style="margin-left:29px;display:flex;gap:4px;flex-wrap:wrap;margin-top:4px;">';
|
|
4404
|
+
for (const [d, { count: c, ownId: h }] of s) {
|
|
4405
|
+
const p = h ? r : o;
|
|
4406
|
+
a += `<button data-reaction-emoji="${d}" data-reaction-target="${e}" ${h ? `data-reaction-id="${h}"` : ""} style="${p}">
|
|
4407
|
+
<span>${d}</span><span style="font-size:11px;font-weight:600;color:#64748b;">${c}</span>
|
|
4257
4408
|
</button>`;
|
|
4258
4409
|
}
|
|
4259
|
-
return
|
|
4410
|
+
return a += `<button class="popover-reaction-add" data-comment-id="${e}" style="display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:50%;border:1px dashed #e2e8f0;background:none;cursor:pointer;color:#94a3b8;font-size:14px;">+</button>`, a += "</div>", a;
|
|
4260
4411
|
}
|
|
4261
4412
|
updatePopoverTyping(e) {
|
|
4262
4413
|
if (!this.popover) return;
|
|
@@ -4328,7 +4479,7 @@ class Ji {
|
|
|
4328
4479
|
justifyContent: "center",
|
|
4329
4480
|
fontSize: "11px",
|
|
4330
4481
|
fontWeight: "700",
|
|
4331
|
-
fontFamily:
|
|
4482
|
+
fontFamily: xe,
|
|
4332
4483
|
cursor: "pointer",
|
|
4333
4484
|
pointerEvents: "auto",
|
|
4334
4485
|
boxShadow: "0 2px 8px rgba(99,102,241,0.4)",
|
|
@@ -4345,21 +4496,21 @@ class Ji {
|
|
|
4345
4496
|
this.closePopover();
|
|
4346
4497
|
return;
|
|
4347
4498
|
}
|
|
4348
|
-
const
|
|
4349
|
-
|
|
4499
|
+
const l = this.threads.find((d) => d.id === i.id);
|
|
4500
|
+
l && this.showThreadPopover(l, r);
|
|
4350
4501
|
}), this.container.appendChild(r), this.pinEls.set(i.id, r)), r.textContent = `${s + 1}`;
|
|
4351
|
-
const
|
|
4352
|
-
r.style.left = `${
|
|
4502
|
+
const a = this.resolvePosition(o);
|
|
4503
|
+
r.style.left = `${a.x}px`, r.style.top = `${a.y}px`;
|
|
4353
4504
|
});
|
|
4354
4505
|
}
|
|
4355
4506
|
}
|
|
4356
|
-
var
|
|
4357
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
4507
|
+
var os = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, U = (n, e, t, i) => {
|
|
4508
|
+
for (var s = i > 1 ? void 0 : i ? rs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
4358
4509
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
4359
|
-
return i && s &&
|
|
4510
|
+
return i && s && os(e, t, s), s;
|
|
4360
4511
|
};
|
|
4361
|
-
const
|
|
4362
|
-
let
|
|
4512
|
+
const as = ["👍", "👎", "❤️", "🎉", "👀", "🚀"];
|
|
4513
|
+
let A = class extends P {
|
|
4363
4514
|
constructor() {
|
|
4364
4515
|
super(...arguments), this.highlightThreadId = null, this.threadsVersion = 0, this.replyingTo = null, this.editingCommentId = null, this.editBody = "", this.pickerOpenForComment = null, this.typingByThread = /* @__PURE__ */ new Map(), this.reactionsVersion = 0, this.typingTimers = /* @__PURE__ */ new Map(), this.lastTypingSend = /* @__PURE__ */ new Map(), this.replyAttachmentIds = [];
|
|
4365
4516
|
}
|
|
@@ -4383,12 +4534,12 @@ let P = class extends S {
|
|
|
4383
4534
|
const s = i.dataset.url;
|
|
4384
4535
|
if (s) {
|
|
4385
4536
|
const o = i.dataset.duration ? parseInt(i.dataset.duration) : void 0;
|
|
4386
|
-
i.appendChild(
|
|
4537
|
+
i.appendChild(je.render(s, o));
|
|
4387
4538
|
}
|
|
4388
4539
|
}), (t = this.shadowRoot) == null || t.querySelectorAll(".video-player-host").forEach((i) => {
|
|
4389
4540
|
if (i.children.length > 0) return;
|
|
4390
4541
|
const s = i.dataset.url;
|
|
4391
|
-
s && i.appendChild(
|
|
4542
|
+
s && i.appendChild(Ce.render(s, i.dataset.poster || void 0));
|
|
4392
4543
|
});
|
|
4393
4544
|
}
|
|
4394
4545
|
teardownListeners() {
|
|
@@ -4456,7 +4607,7 @@ let P = class extends S {
|
|
|
4456
4607
|
}
|
|
4457
4608
|
parseMentions(n) {
|
|
4458
4609
|
return n.split(/(@\w+)/g).map(
|
|
4459
|
-
(t) => t.startsWith("@") ?
|
|
4610
|
+
(t) => t.startsWith("@") ? u`<span class="mention">${t}</span>` : t
|
|
4460
4611
|
);
|
|
4461
4612
|
}
|
|
4462
4613
|
getInitials(n) {
|
|
@@ -4473,16 +4624,16 @@ let P = class extends S {
|
|
|
4473
4624
|
return o < 24 ? `${o}h` : e.toLocaleDateString();
|
|
4474
4625
|
}
|
|
4475
4626
|
async handleAttachImage() {
|
|
4476
|
-
this.upload || (this.upload = new
|
|
4477
|
-
const n =
|
|
4627
|
+
this.upload || (this.upload = new re(this.client));
|
|
4628
|
+
const n = A.MAX_ATTACHMENTS - this.replyAttachmentIds.length;
|
|
4478
4629
|
if (n <= 0) return;
|
|
4479
4630
|
const e = await this.upload.pickFiles("image/*", n);
|
|
4480
4631
|
e.length > 0 && (this.replyAttachmentIds.push(...e.map((t) => t.id)), this.requestUpdate());
|
|
4481
4632
|
}
|
|
4482
4633
|
async handleRecordAudio(n) {
|
|
4483
4634
|
var i;
|
|
4484
|
-
if (this.replyAttachmentIds.length >=
|
|
4485
|
-
this.upload || (this.upload = new
|
|
4635
|
+
if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
|
|
4636
|
+
this.upload || (this.upload = new re(this.client)), this.audioRecorder || (this.audioRecorder = new ze());
|
|
4486
4637
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.audioRecorder.startRecording(e ?? document.body);
|
|
4487
4638
|
if (t) {
|
|
4488
4639
|
const s = await this.upload.uploadBlob(t, "audio.webm");
|
|
@@ -4491,8 +4642,8 @@ let P = class extends S {
|
|
|
4491
4642
|
}
|
|
4492
4643
|
async handleRecordVideo(n) {
|
|
4493
4644
|
var i;
|
|
4494
|
-
if (this.replyAttachmentIds.length >=
|
|
4495
|
-
this.upload || (this.upload = new
|
|
4645
|
+
if (this.replyAttachmentIds.length >= A.MAX_ATTACHMENTS) return;
|
|
4646
|
+
this.upload || (this.upload = new re(this.client)), this.videoRecorder || (this.videoRecorder = new Ue());
|
|
4496
4647
|
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(`[data-thread-id="${n}"]`), t = await this.videoRecorder.startRecording(e ?? document.body);
|
|
4497
4648
|
if (t) {
|
|
4498
4649
|
const s = await this.upload.uploadBlob(t.blob, "video.webm");
|
|
@@ -4529,7 +4680,7 @@ let P = class extends S {
|
|
|
4529
4680
|
this.client.deleteComment(n);
|
|
4530
4681
|
}
|
|
4531
4682
|
renderEditForm(n) {
|
|
4532
|
-
return
|
|
4683
|
+
return u`
|
|
4533
4684
|
<div class="edit-form">
|
|
4534
4685
|
<textarea
|
|
4535
4686
|
.value=${this.editBody}
|
|
@@ -4550,14 +4701,14 @@ let P = class extends S {
|
|
|
4550
4701
|
const e = this.client.state.getReactions(n.id), t = (s = this.client.state.user) == null ? void 0 : s.id, i = /* @__PURE__ */ new Map();
|
|
4551
4702
|
for (const o of e)
|
|
4552
4703
|
i.has(o.emoji) || i.set(o.emoji, []), i.get(o.emoji).push(o);
|
|
4553
|
-
return
|
|
4704
|
+
return u`
|
|
4554
4705
|
<div class="comment-reactions">
|
|
4555
4706
|
${[...i.entries()].map(
|
|
4556
4707
|
([o, r]) => {
|
|
4557
|
-
const
|
|
4558
|
-
return
|
|
4708
|
+
const a = r.some((l) => l.userId === t);
|
|
4709
|
+
return u`
|
|
4559
4710
|
<button
|
|
4560
|
-
class="reaction-pill ${
|
|
4711
|
+
class="reaction-pill ${a ? "own" : ""}"
|
|
4561
4712
|
@click=${() => this.toggleReaction(n.id, o)}
|
|
4562
4713
|
>
|
|
4563
4714
|
<span>${o}</span>
|
|
@@ -4574,26 +4725,26 @@ let P = class extends S {
|
|
|
4574
4725
|
title="Add reaction"
|
|
4575
4726
|
>
|
|
4576
4727
|
+
|
|
4577
|
-
${this.pickerOpenForComment === n.id ?
|
|
4728
|
+
${this.pickerOpenForComment === n.id ? u`
|
|
4578
4729
|
<div class="emoji-picker">
|
|
4579
|
-
${
|
|
4580
|
-
(o) =>
|
|
4730
|
+
${as.map(
|
|
4731
|
+
(o) => u`
|
|
4581
4732
|
<button @click=${(r) => {
|
|
4582
4733
|
r.stopPropagation(), this.toggleReaction(n.id, o);
|
|
4583
4734
|
}}>${o}</button>
|
|
4584
4735
|
`
|
|
4585
4736
|
)}
|
|
4586
4737
|
</div>
|
|
4587
|
-
` :
|
|
4738
|
+
` : b}
|
|
4588
4739
|
</button>
|
|
4589
4740
|
</div>
|
|
4590
4741
|
`;
|
|
4591
4742
|
}
|
|
4592
4743
|
renderTypingIndicator(n) {
|
|
4593
4744
|
const e = this.typingByThread.get(n) ?? [];
|
|
4594
|
-
if (e.length === 0) return
|
|
4745
|
+
if (e.length === 0) return b;
|
|
4595
4746
|
const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
|
|
4596
|
-
return
|
|
4747
|
+
return u`<div class="typing-indicator">${t}</div>`;
|
|
4597
4748
|
}
|
|
4598
4749
|
sortedThreads() {
|
|
4599
4750
|
return [...this.threads].sort((n, e) => {
|
|
@@ -4604,7 +4755,7 @@ let P = class extends S {
|
|
|
4604
4755
|
}
|
|
4605
4756
|
render() {
|
|
4606
4757
|
const n = this.sortedThreads();
|
|
4607
|
-
return
|
|
4758
|
+
return u`
|
|
4608
4759
|
<div class="panel">
|
|
4609
4760
|
<div class="panel-header">
|
|
4610
4761
|
<span class="panel-title">
|
|
@@ -4612,12 +4763,12 @@ let P = class extends S {
|
|
|
4612
4763
|
<span class="thread-count">${this.threads.length}</span>
|
|
4613
4764
|
</span>
|
|
4614
4765
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
4615
|
-
${C(
|
|
4766
|
+
${C(be, 16)}
|
|
4616
4767
|
</button>
|
|
4617
4768
|
</div>
|
|
4618
4769
|
|
|
4619
4770
|
<div class="panel-body pw-scrollable">
|
|
4620
|
-
${n.length === 0 ?
|
|
4771
|
+
${n.length === 0 ? u`<div class="empty">
|
|
4621
4772
|
<div class="empty-icon">💬</div>
|
|
4622
4773
|
No comments yet
|
|
4623
4774
|
</div>` : n.map((e) => this.renderThread(e))}
|
|
@@ -4630,55 +4781,57 @@ let P = class extends S {
|
|
|
4630
4781
|
`;
|
|
4631
4782
|
}
|
|
4632
4783
|
renderAttachments(n) {
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4784
|
+
if (!n || n.length === 0) return b;
|
|
4785
|
+
const e = n.filter((t) => t.type === "image").map((t) => t.url);
|
|
4786
|
+
return u`
|
|
4787
|
+
${n.map((t) => {
|
|
4788
|
+
if (t.type === "image") {
|
|
4789
|
+
const i = t.thumbnailUrl || t.url, s = e.indexOf(t.url);
|
|
4790
|
+
return u`
|
|
4638
4791
|
<div class="comment-attachment-media">
|
|
4639
4792
|
<img
|
|
4640
4793
|
class="comment-attachment-img"
|
|
4641
|
-
src=${
|
|
4642
|
-
alt=${
|
|
4643
|
-
@click=${() =>
|
|
4794
|
+
src=${i}
|
|
4795
|
+
alt=${t.filename}
|
|
4796
|
+
@click=${() => Te.open(t.url, e, s)}
|
|
4644
4797
|
/>
|
|
4645
4798
|
</div>
|
|
4646
4799
|
`;
|
|
4647
4800
|
}
|
|
4648
|
-
return
|
|
4649
|
-
<div class="comment-attachment-media" id="audio-${
|
|
4650
|
-
${this.renderAudioPlayer(
|
|
4801
|
+
return t.type === "audio" ? u`
|
|
4802
|
+
<div class="comment-attachment-media" id="audio-${t.id}">
|
|
4803
|
+
${this.renderAudioPlayer(t)}
|
|
4651
4804
|
</div>
|
|
4652
|
-
` :
|
|
4653
|
-
<div class="comment-attachment-media" id="video-${
|
|
4654
|
-
${this.renderVideoPlayer(
|
|
4805
|
+
` : t.type === "video" ? u`
|
|
4806
|
+
<div class="comment-attachment-media" id="video-${t.id}">
|
|
4807
|
+
${this.renderVideoPlayer(t)}
|
|
4655
4808
|
</div>
|
|
4656
|
-
` :
|
|
4809
|
+
` : b;
|
|
4657
4810
|
})}
|
|
4658
4811
|
`;
|
|
4659
4812
|
}
|
|
4660
4813
|
renderAudioPlayer(n) {
|
|
4661
|
-
const e = document.createElement("div"), t =
|
|
4662
|
-
return e.appendChild(t),
|
|
4814
|
+
const e = document.createElement("div"), t = je.render(n.url, n.durationMs);
|
|
4815
|
+
return e.appendChild(t), u`<div class="audio-player-host" data-url=${n.url} data-duration=${n.durationMs ?? ""}></div>`;
|
|
4663
4816
|
}
|
|
4664
4817
|
renderVideoPlayer(n) {
|
|
4665
|
-
return
|
|
4818
|
+
return u`<div class="video-player-host" data-url=${n.url} data-poster=${n.thumbnailUrl ?? ""}></div>`;
|
|
4666
4819
|
}
|
|
4667
4820
|
renderThread(n) {
|
|
4668
4821
|
const e = this.highlightThreadId === n.id;
|
|
4669
|
-
return
|
|
4822
|
+
return u`
|
|
4670
4823
|
<div
|
|
4671
4824
|
class="thread ${n.resolved ? "resolved" : ""} ${e ? "highlighted" : ""}"
|
|
4672
4825
|
data-thread-id=${n.id}
|
|
4673
4826
|
>
|
|
4674
|
-
${n.position ?
|
|
4675
|
-
${C(
|
|
4827
|
+
${n.position ? u`<div class="pin-badge">
|
|
4828
|
+
${C(At, 12)}
|
|
4676
4829
|
Pinned
|
|
4677
|
-
</div>` :
|
|
4830
|
+
</div>` : b}
|
|
4678
4831
|
${n.comments.map((t, i) => {
|
|
4679
4832
|
const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
|
|
4680
|
-
return
|
|
4681
|
-
${i > 0 ?
|
|
4833
|
+
return u`
|
|
4834
|
+
${i > 0 ? u`<div class="comment-divider"></div>` : b}
|
|
4682
4835
|
<div class="comment">
|
|
4683
4836
|
<div class="comment-header">
|
|
4684
4837
|
<div
|
|
@@ -4689,16 +4842,16 @@ let P = class extends S {
|
|
|
4689
4842
|
</div>
|
|
4690
4843
|
<span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
|
|
4691
4844
|
<span class="comment-time">${this.formatTime(t.createdAt)}</span>
|
|
4692
|
-
${t.editedAt ?
|
|
4845
|
+
${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : b}
|
|
4693
4846
|
</div>
|
|
4694
|
-
${r ? this.renderEditForm(t) :
|
|
4695
|
-
${t.body && t.body !== "(attachment)" ?
|
|
4847
|
+
${r ? this.renderEditForm(t) : u`
|
|
4848
|
+
${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : b}
|
|
4696
4849
|
${this.renderAttachments(t.attachments ?? [])}
|
|
4697
4850
|
`}
|
|
4698
|
-
${o && !r ?
|
|
4699
|
-
<button @click=${() => this.startEdit(t)} title="Edit">${C(
|
|
4700
|
-
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(
|
|
4701
|
-
</div>` :
|
|
4851
|
+
${o && !r ? u`<div class="comment-actions">
|
|
4852
|
+
<button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
|
|
4853
|
+
<button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
|
|
4854
|
+
</div>` : b}
|
|
4702
4855
|
${this.renderReactions(t)}
|
|
4703
4856
|
</div>
|
|
4704
4857
|
`;
|
|
@@ -4719,7 +4872,7 @@ let P = class extends S {
|
|
|
4719
4872
|
|
|
4720
4873
|
${this.renderTypingIndicator(n.id)}
|
|
4721
4874
|
|
|
4722
|
-
${this.replyingTo === n.id ?
|
|
4875
|
+
${this.replyingTo === n.id ? u`
|
|
4723
4876
|
<form
|
|
4724
4877
|
class="reply-form"
|
|
4725
4878
|
@submit=${(t) => this.handleReply(n.id, t)}
|
|
@@ -4738,22 +4891,22 @@ let P = class extends S {
|
|
|
4738
4891
|
class="reply-media-btn"
|
|
4739
4892
|
title="Attach image"
|
|
4740
4893
|
@click=${() => this.handleAttachImage()}
|
|
4741
|
-
>${C(
|
|
4894
|
+
>${C(Ii, 16)}</button>
|
|
4742
4895
|
<button
|
|
4743
4896
|
type="button"
|
|
4744
4897
|
class="reply-media-btn"
|
|
4745
4898
|
title="Record audio"
|
|
4746
4899
|
@click=${() => this.handleRecordAudio(n.id)}
|
|
4747
|
-
>${C(
|
|
4900
|
+
>${C(_i, 16)}</button>
|
|
4748
4901
|
<button
|
|
4749
4902
|
type="button"
|
|
4750
4903
|
class="reply-media-btn"
|
|
4751
4904
|
title="Record video"
|
|
4752
4905
|
@click=${() => this.handleRecordVideo(n.id)}
|
|
4753
|
-
>${C(
|
|
4906
|
+
>${C(ji, 16)}</button>
|
|
4754
4907
|
<div class="reply-preview">
|
|
4755
4908
|
${this.replyAttachmentIds.map(
|
|
4756
|
-
(t, i) =>
|
|
4909
|
+
(t, i) => u`<span class="reply-preview-badge">
|
|
4757
4910
|
Attached #${i + 1}
|
|
4758
4911
|
<button
|
|
4759
4912
|
type="button"
|
|
@@ -4765,15 +4918,15 @@ let P = class extends S {
|
|
|
4765
4918
|
</div>
|
|
4766
4919
|
</div>
|
|
4767
4920
|
</form>
|
|
4768
|
-
` :
|
|
4921
|
+
` : b}
|
|
4769
4922
|
</div>
|
|
4770
4923
|
`;
|
|
4771
4924
|
}
|
|
4772
4925
|
};
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4926
|
+
A.styles = [
|
|
4927
|
+
ie,
|
|
4928
|
+
ve,
|
|
4929
|
+
Ae,
|
|
4777
4930
|
M`
|
|
4778
4931
|
:host {
|
|
4779
4932
|
display: block;
|
|
@@ -5314,56 +5467,56 @@ P.styles = [
|
|
|
5314
5467
|
}
|
|
5315
5468
|
`
|
|
5316
5469
|
];
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
],
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
],
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
],
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
],
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
],
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
],
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
],
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
],
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
],
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
],
|
|
5348
|
-
var
|
|
5349
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
5470
|
+
A.MAX_ATTACHMENTS = 5;
|
|
5471
|
+
U([
|
|
5472
|
+
x({ attribute: !1 })
|
|
5473
|
+
], A.prototype, "client", 2);
|
|
5474
|
+
U([
|
|
5475
|
+
x()
|
|
5476
|
+
], A.prototype, "highlightThreadId", 2);
|
|
5477
|
+
U([
|
|
5478
|
+
$()
|
|
5479
|
+
], A.prototype, "threadsVersion", 2);
|
|
5480
|
+
U([
|
|
5481
|
+
$()
|
|
5482
|
+
], A.prototype, "replyingTo", 2);
|
|
5483
|
+
U([
|
|
5484
|
+
$()
|
|
5485
|
+
], A.prototype, "editingCommentId", 2);
|
|
5486
|
+
U([
|
|
5487
|
+
$()
|
|
5488
|
+
], A.prototype, "editBody", 2);
|
|
5489
|
+
U([
|
|
5490
|
+
$()
|
|
5491
|
+
], A.prototype, "pickerOpenForComment", 2);
|
|
5492
|
+
U([
|
|
5493
|
+
$()
|
|
5494
|
+
], A.prototype, "typingByThread", 2);
|
|
5495
|
+
U([
|
|
5496
|
+
$()
|
|
5497
|
+
], A.prototype, "reactionsVersion", 2);
|
|
5498
|
+
A = U([
|
|
5499
|
+
L("pulse-widget-comments-panel")
|
|
5500
|
+
], A);
|
|
5501
|
+
var ls = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, Xe = (n, e, t, i) => {
|
|
5502
|
+
for (var s = i > 1 ? void 0 : i ? cs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
5350
5503
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
5351
|
-
return i && s &&
|
|
5504
|
+
return i && s && ls(e, t, s), s;
|
|
5352
5505
|
};
|
|
5353
|
-
const
|
|
5506
|
+
const ds = {
|
|
5354
5507
|
"comment:created": "left a comment",
|
|
5355
5508
|
"comment:mention": "mentioned you",
|
|
5356
5509
|
"comment:reply": "replied to your comment",
|
|
5357
5510
|
"thread:resolved": "resolved a thread",
|
|
5358
5511
|
"reaction:added": "reacted to your comment"
|
|
5359
|
-
},
|
|
5512
|
+
}, hs = {
|
|
5360
5513
|
"comment:created": "💬",
|
|
5361
5514
|
"comment:mention": "📣",
|
|
5362
5515
|
"comment:reply": "↩️",
|
|
5363
5516
|
"thread:resolved": "✅",
|
|
5364
5517
|
"reaction:added": "🎉"
|
|
5365
5518
|
};
|
|
5366
|
-
let
|
|
5519
|
+
let pe = class extends P {
|
|
5367
5520
|
constructor() {
|
|
5368
5521
|
super(...arguments), this.notifications = [];
|
|
5369
5522
|
}
|
|
@@ -5407,38 +5560,38 @@ let de = class extends S {
|
|
|
5407
5560
|
}
|
|
5408
5561
|
render() {
|
|
5409
5562
|
const n = this.notifications.filter((e) => !e.read).length;
|
|
5410
|
-
return
|
|
5563
|
+
return u`
|
|
5411
5564
|
<div class="panel">
|
|
5412
5565
|
<div class="panel-header">
|
|
5413
5566
|
<span class="panel-title">
|
|
5414
5567
|
Notifications
|
|
5415
|
-
${n > 0 ?
|
|
5568
|
+
${n > 0 ? u`<span class="unread-badge">${n}</span>` : b}
|
|
5416
5569
|
</span>
|
|
5417
5570
|
<div style="display:flex;align-items:center;gap:4px;">
|
|
5418
|
-
${n > 0 ?
|
|
5571
|
+
${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
|
|
5419
5572
|
Mark all read
|
|
5420
|
-
</button>` :
|
|
5573
|
+
</button>` : b}
|
|
5421
5574
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
5422
|
-
${C(
|
|
5575
|
+
${C(be, 16)}
|
|
5423
5576
|
</button>
|
|
5424
5577
|
</div>
|
|
5425
5578
|
</div>
|
|
5426
5579
|
|
|
5427
5580
|
<div class="panel-body pw-scrollable">
|
|
5428
|
-
${this.notifications.length === 0 ?
|
|
5581
|
+
${this.notifications.length === 0 ? u`<div class="empty">
|
|
5429
5582
|
<div class="empty-icon">🔔</div>
|
|
5430
5583
|
No notifications
|
|
5431
5584
|
</div>` : this.notifications.map(
|
|
5432
|
-
(e) =>
|
|
5585
|
+
(e) => u`
|
|
5433
5586
|
<div
|
|
5434
5587
|
class="item ${e.read ? "" : "unread"}"
|
|
5435
5588
|
@click=${() => this.handleClick(e)}
|
|
5436
5589
|
>
|
|
5437
|
-
<span class="icon">${
|
|
5590
|
+
<span class="icon">${hs[e.type] ?? "🔔"}</span>
|
|
5438
5591
|
<div class="content">
|
|
5439
5592
|
<div class="text">
|
|
5440
5593
|
<span class="actor">${this.getActorName(e.actorId)}</span>
|
|
5441
|
-
${
|
|
5594
|
+
${ds[e.type] ?? e.type}
|
|
5442
5595
|
</div>
|
|
5443
5596
|
<div class="time">${this.formatTime(e.createdAt)}</div>
|
|
5444
5597
|
</div>
|
|
@@ -5451,10 +5604,10 @@ let de = class extends S {
|
|
|
5451
5604
|
`;
|
|
5452
5605
|
}
|
|
5453
5606
|
};
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5607
|
+
pe.styles = [
|
|
5608
|
+
ie,
|
|
5609
|
+
ve,
|
|
5610
|
+
Ae,
|
|
5458
5611
|
M`
|
|
5459
5612
|
:host {
|
|
5460
5613
|
display: block;
|
|
@@ -5648,17 +5801,17 @@ de.styles = [
|
|
|
5648
5801
|
}
|
|
5649
5802
|
`
|
|
5650
5803
|
];
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
],
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
],
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
],
|
|
5660
|
-
const
|
|
5661
|
-
class
|
|
5804
|
+
Xe([
|
|
5805
|
+
x({ attribute: !1 })
|
|
5806
|
+
], pe.prototype, "client", 2);
|
|
5807
|
+
Xe([
|
|
5808
|
+
$()
|
|
5809
|
+
], pe.prototype, "notifications", 2);
|
|
5810
|
+
pe = Xe([
|
|
5811
|
+
L("pulse-widget-notifications-panel")
|
|
5812
|
+
], pe);
|
|
5813
|
+
const ps = 3e3;
|
|
5814
|
+
class us {
|
|
5662
5815
|
constructor(e) {
|
|
5663
5816
|
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) => {
|
|
5664
5817
|
t.pointerType !== "touch" && this.client.moveCursor({
|
|
@@ -5710,7 +5863,7 @@ class as {
|
|
|
5710
5863
|
), this.setSending(!0), this.staleTimer = setInterval(() => {
|
|
5711
5864
|
const e = Date.now();
|
|
5712
5865
|
for (const [t, i] of this.cursorLastSeen)
|
|
5713
|
-
if (e - i >
|
|
5866
|
+
if (e - i > ps) {
|
|
5714
5867
|
this.cursors.delete(t);
|
|
5715
5868
|
const s = this.cursorEls.get(t);
|
|
5716
5869
|
s && s.remove(), this.cursorEls.delete(t), this.cursorLastSeen.delete(t);
|
|
@@ -5806,11 +5959,11 @@ class as {
|
|
|
5806
5959
|
i.style.transform = `translate(${t.position.x}px, ${t.position.y}px)`;
|
|
5807
5960
|
}
|
|
5808
5961
|
}
|
|
5809
|
-
class
|
|
5962
|
+
class fs {
|
|
5810
5963
|
constructor(e) {
|
|
5811
5964
|
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) => {
|
|
5812
|
-
var
|
|
5813
|
-
t.preventDefault(), (
|
|
5965
|
+
var a, l, d;
|
|
5966
|
+
t.preventDefault(), (l = (a = t.target) == null ? void 0 : a.setPointerCapture) == null || l.call(a, t.pointerId), this.currentPoints = [{ x: t.clientX, y: t.clientY }], this.lastPoint = { x: t.clientX, y: t.clientY };
|
|
5814
5967
|
const i = this.client.state.user, s = (i == null ? void 0 : i.color) ?? "#6366f1", r = 2 + (t.pressure > 0 ? t.pressure : 0.5) * 4;
|
|
5815
5968
|
this.currentPath = document.createElementNS(
|
|
5816
5969
|
"http://www.w3.org/2000/svg",
|
|
@@ -5818,7 +5971,7 @@ class ls {
|
|
|
5818
5971
|
), this.currentPath.setAttribute("fill", "none"), this.currentPath.setAttribute("stroke", s), this.currentPath.setAttribute("stroke-width", String(r)), this.currentPath.setAttribute("stroke-linecap", "round"), this.currentPath.setAttribute("stroke-linejoin", "round"), this.currentPath.setAttribute(
|
|
5819
5972
|
"points",
|
|
5820
5973
|
`${t.clientX},${t.clientY}`
|
|
5821
|
-
), (
|
|
5974
|
+
), (d = this.container) == null || d.appendChild(this.currentPath), document.addEventListener("pointermove", this.handlePointerMove), document.addEventListener("pointerup", this.handlePointerUp);
|
|
5822
5975
|
}, this.handlePointerMove = (t) => {
|
|
5823
5976
|
if (!this.currentPath || !this.lastPoint) return;
|
|
5824
5977
|
const i = t.clientX - this.lastPoint.x, s = t.clientY - this.lastPoint.y;
|
|
@@ -5889,9 +6042,9 @@ class ls {
|
|
|
5889
6042
|
this.fadeTimers.set(e, t);
|
|
5890
6043
|
}
|
|
5891
6044
|
}
|
|
5892
|
-
function
|
|
6045
|
+
function ms(n) {
|
|
5893
6046
|
if (!n.rangeCount || n.isCollapsed) return null;
|
|
5894
|
-
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s =
|
|
6047
|
+
const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = bt(t), o = bt(i);
|
|
5895
6048
|
return !s || !o ? null : {
|
|
5896
6049
|
startSelector: s,
|
|
5897
6050
|
startOffset: e.startOffset,
|
|
@@ -5899,29 +6052,29 @@ function cs(n) {
|
|
|
5899
6052
|
endOffset: e.endOffset
|
|
5900
6053
|
};
|
|
5901
6054
|
}
|
|
5902
|
-
function
|
|
6055
|
+
function gs(n) {
|
|
5903
6056
|
var e, t;
|
|
5904
6057
|
try {
|
|
5905
|
-
const i =
|
|
6058
|
+
const i = xt(n.startSelector), s = xt(n.endSelector);
|
|
5906
6059
|
if (!i || !s) return null;
|
|
5907
|
-
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length,
|
|
5908
|
-
return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset,
|
|
6060
|
+
const o = document.createRange(), r = i.nodeType === Node.TEXT_NODE ? ((e = i.textContent) == null ? void 0 : e.length) ?? 0 : i.childNodes.length, a = s.nodeType === Node.TEXT_NODE ? ((t = s.textContent) == null ? void 0 : t.length) ?? 0 : s.childNodes.length;
|
|
6061
|
+
return o.setStart(i, Math.min(n.startOffset, r)), o.setEnd(s, Math.min(n.endOffset, a)), o;
|
|
5909
6062
|
} catch {
|
|
5910
6063
|
return null;
|
|
5911
6064
|
}
|
|
5912
6065
|
}
|
|
5913
|
-
function
|
|
6066
|
+
function bt(n) {
|
|
5914
6067
|
if (n.nodeType === Node.TEXT_NODE) {
|
|
5915
6068
|
const e = n.parentElement;
|
|
5916
6069
|
if (!e) return null;
|
|
5917
|
-
const t =
|
|
6070
|
+
const t = vt(e);
|
|
5918
6071
|
if (!t) return null;
|
|
5919
6072
|
const i = Array.from(e.childNodes).indexOf(n);
|
|
5920
6073
|
return `${t}::text(${i})`;
|
|
5921
6074
|
}
|
|
5922
|
-
return n.nodeType === Node.ELEMENT_NODE ?
|
|
6075
|
+
return n.nodeType === Node.ELEMENT_NODE ? vt(n) : null;
|
|
5923
6076
|
}
|
|
5924
|
-
function
|
|
6077
|
+
function vt(n) {
|
|
5925
6078
|
if (!n || n === document.documentElement) return "html";
|
|
5926
6079
|
if (n === document.body) return "body";
|
|
5927
6080
|
if (n.id) return `#${CSS.escape(n.id)}`;
|
|
@@ -5930,14 +6083,14 @@ function mt(n) {
|
|
|
5930
6083
|
for (; t && t !== document.body && i < 10; ) {
|
|
5931
6084
|
const s = t.parentElement;
|
|
5932
6085
|
if (!s) break;
|
|
5933
|
-
const o = t.tagName.toLowerCase(), r = t.tagName,
|
|
5934
|
-
(
|
|
6086
|
+
const o = t.tagName.toLowerCase(), r = t.tagName, a = Array.from(s.children).filter(
|
|
6087
|
+
(l) => l.tagName === r
|
|
5935
6088
|
);
|
|
5936
|
-
if (
|
|
6089
|
+
if (a.length === 1)
|
|
5937
6090
|
e.unshift(o);
|
|
5938
6091
|
else {
|
|
5939
|
-
const
|
|
5940
|
-
e.unshift(`${o}:nth-of-type(${
|
|
6092
|
+
const l = a.indexOf(t) + 1;
|
|
6093
|
+
e.unshift(`${o}:nth-of-type(${l})`);
|
|
5941
6094
|
}
|
|
5942
6095
|
if (s.id) {
|
|
5943
6096
|
e.unshift(`#${CSS.escape(s.id)}`);
|
|
@@ -5947,7 +6100,7 @@ function mt(n) {
|
|
|
5947
6100
|
}
|
|
5948
6101
|
return e.length > 0 ? e.join(" > ") : null;
|
|
5949
6102
|
}
|
|
5950
|
-
function
|
|
6103
|
+
function xt(n) {
|
|
5951
6104
|
const e = n.match(/^(.+)::text\((\d+)\)$/);
|
|
5952
6105
|
if (e) {
|
|
5953
6106
|
const t = e[1], i = parseInt(e[2], 10);
|
|
@@ -5964,7 +6117,7 @@ function gt(n) {
|
|
|
5964
6117
|
return null;
|
|
5965
6118
|
}
|
|
5966
6119
|
}
|
|
5967
|
-
class
|
|
6120
|
+
class bs {
|
|
5968
6121
|
constructor(e) {
|
|
5969
6122
|
this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
|
|
5970
6123
|
}
|
|
@@ -6004,32 +6157,32 @@ class hs {
|
|
|
6004
6157
|
this.disable();
|
|
6005
6158
|
}
|
|
6006
6159
|
renderSelection(e, t) {
|
|
6007
|
-
var
|
|
6160
|
+
var a;
|
|
6008
6161
|
if (!this.container) return;
|
|
6009
|
-
const i = (
|
|
6162
|
+
const i = (a = this.client.state.user) == null ? void 0 : a.id;
|
|
6010
6163
|
if (e === i || (this.clearSelection(e), !t)) return;
|
|
6011
|
-
const s =
|
|
6164
|
+
const s = gs(t);
|
|
6012
6165
|
if (!s) return;
|
|
6013
6166
|
const o = this.client.state.presence.find(
|
|
6014
|
-
(
|
|
6167
|
+
(l) => l.user.id === e
|
|
6015
6168
|
), r = (o == null ? void 0 : o.user.color) ?? "#6366f1";
|
|
6016
6169
|
try {
|
|
6017
|
-
const
|
|
6018
|
-
for (let
|
|
6019
|
-
const
|
|
6020
|
-
Object.assign(
|
|
6170
|
+
const l = s.getClientRects(), d = [];
|
|
6171
|
+
for (let c = 0; c < l.length; c++) {
|
|
6172
|
+
const h = l[c], p = document.createElement("div");
|
|
6173
|
+
Object.assign(p.style, {
|
|
6021
6174
|
position: "absolute",
|
|
6022
|
-
left: `${
|
|
6023
|
-
top: `${
|
|
6024
|
-
width: `${
|
|
6025
|
-
height: `${
|
|
6175
|
+
left: `${h.left}px`,
|
|
6176
|
+
top: `${h.top}px`,
|
|
6177
|
+
width: `${h.width}px`,
|
|
6178
|
+
height: `${h.height}px`,
|
|
6026
6179
|
background: r,
|
|
6027
6180
|
opacity: "0.2",
|
|
6028
6181
|
borderRadius: "2px",
|
|
6029
6182
|
pointerEvents: "none"
|
|
6030
|
-
}), this.container.appendChild(
|
|
6183
|
+
}), this.container.appendChild(p), d.push(p);
|
|
6031
6184
|
}
|
|
6032
|
-
this.selectionEls.set(e,
|
|
6185
|
+
this.selectionEls.set(e, d);
|
|
6033
6186
|
} catch {
|
|
6034
6187
|
}
|
|
6035
6188
|
this.clearTimers.has(e) && clearTimeout(this.clearTimers.get(e)), this.clearTimers.set(
|
|
@@ -6047,12 +6200,12 @@ class hs {
|
|
|
6047
6200
|
}
|
|
6048
6201
|
}
|
|
6049
6202
|
}
|
|
6050
|
-
var
|
|
6051
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6203
|
+
var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
|
|
6204
|
+
for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6052
6205
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6053
|
-
return i && s &&
|
|
6206
|
+
return i && s && vs(e, t, s), s;
|
|
6054
6207
|
};
|
|
6055
|
-
let
|
|
6208
|
+
let ue = class extends P {
|
|
6056
6209
|
constructor() {
|
|
6057
6210
|
super(...arguments), this.roomId = "";
|
|
6058
6211
|
}
|
|
@@ -6072,7 +6225,7 @@ let he = class extends S {
|
|
|
6072
6225
|
);
|
|
6073
6226
|
}
|
|
6074
6227
|
renderToggle(n, e) {
|
|
6075
|
-
return
|
|
6228
|
+
return u`
|
|
6076
6229
|
<div class="setting-row">
|
|
6077
6230
|
<span class="setting-label">${n}</span>
|
|
6078
6231
|
<label class="toggle">
|
|
@@ -6088,12 +6241,12 @@ let he = class extends S {
|
|
|
6088
6241
|
}
|
|
6089
6242
|
render() {
|
|
6090
6243
|
const n = !this.settings.enabled;
|
|
6091
|
-
return
|
|
6244
|
+
return u`
|
|
6092
6245
|
<div class="panel">
|
|
6093
6246
|
<div class="panel-header">
|
|
6094
6247
|
<span class="panel-title">Settings</span>
|
|
6095
6248
|
<button class="close-btn" @click=${this.fireClose} title="Close">
|
|
6096
|
-
${C(
|
|
6249
|
+
${C(be, 16)}
|
|
6097
6250
|
</button>
|
|
6098
6251
|
</div>
|
|
6099
6252
|
|
|
@@ -6138,10 +6291,10 @@ let he = class extends S {
|
|
|
6138
6291
|
`;
|
|
6139
6292
|
}
|
|
6140
6293
|
};
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6294
|
+
ue.styles = [
|
|
6295
|
+
ie,
|
|
6296
|
+
ve,
|
|
6297
|
+
Ae,
|
|
6145
6298
|
M`
|
|
6146
6299
|
:host {
|
|
6147
6300
|
display: block;
|
|
@@ -6313,16 +6466,16 @@ he.styles = [
|
|
|
6313
6466
|
}
|
|
6314
6467
|
`
|
|
6315
6468
|
];
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
],
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
],
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
],
|
|
6325
|
-
const
|
|
6469
|
+
Ye([
|
|
6470
|
+
x({ attribute: !1 })
|
|
6471
|
+
], ue.prototype, "settings", 2);
|
|
6472
|
+
Ye([
|
|
6473
|
+
x()
|
|
6474
|
+
], ue.prototype, "roomId", 2);
|
|
6475
|
+
ue = Ye([
|
|
6476
|
+
L("pulse-widget-settings-panel")
|
|
6477
|
+
], ue);
|
|
6478
|
+
const $e = {
|
|
6326
6479
|
enabled: !0,
|
|
6327
6480
|
showMyCursor: !0,
|
|
6328
6481
|
showOthersCursors: !0,
|
|
@@ -6333,24 +6486,24 @@ const ye = {
|
|
|
6333
6486
|
showViewportIndicators: !0,
|
|
6334
6487
|
showSelections: !0,
|
|
6335
6488
|
showDrawings: !0
|
|
6336
|
-
},
|
|
6337
|
-
function
|
|
6489
|
+
}, _t = "pulse:settings:";
|
|
6490
|
+
function ys(n) {
|
|
6338
6491
|
try {
|
|
6339
|
-
const e = localStorage.getItem(`${
|
|
6340
|
-
return e ? {
|
|
6492
|
+
const e = localStorage.getItem(`${_t}${n}`);
|
|
6493
|
+
return e ? { ...$e, ...JSON.parse(e) } : { ...$e };
|
|
6341
6494
|
} catch {
|
|
6342
|
-
return {
|
|
6495
|
+
return { ...$e };
|
|
6343
6496
|
}
|
|
6344
6497
|
}
|
|
6345
|
-
function
|
|
6346
|
-
localStorage.setItem(`${
|
|
6498
|
+
function ws(n, e) {
|
|
6499
|
+
localStorage.setItem(`${_t}${n}`, JSON.stringify(e));
|
|
6347
6500
|
}
|
|
6348
|
-
var
|
|
6349
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6501
|
+
var $s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, j = (n, e, t, i) => {
|
|
6502
|
+
for (var s = i > 1 ? void 0 : i ? ks(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6350
6503
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6351
|
-
return i && s &&
|
|
6504
|
+
return i && s && $s(e, t, s), s;
|
|
6352
6505
|
};
|
|
6353
|
-
let
|
|
6506
|
+
let R = class extends P {
|
|
6354
6507
|
constructor() {
|
|
6355
6508
|
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;
|
|
6356
6509
|
}
|
|
@@ -6401,35 +6554,35 @@ let O = class extends S {
|
|
|
6401
6554
|
render() {
|
|
6402
6555
|
const n = this.display === "inline";
|
|
6403
6556
|
if (this.collapsed)
|
|
6404
|
-
return
|
|
6557
|
+
return u`
|
|
6405
6558
|
<div class="toolbar collapsed ${n ? "inline" : ""}" @click=${this.fireToggle}>
|
|
6406
|
-
<span class="fab-icon">${C(
|
|
6559
|
+
<span class="fab-icon">${C(zi, n ? 18 : 24)}</span>
|
|
6407
6560
|
</div>
|
|
6408
6561
|
`;
|
|
6409
6562
|
const e = this.users.slice(0, 3), t = this.users.length - 3;
|
|
6410
|
-
return
|
|
6563
|
+
return u`
|
|
6411
6564
|
<div class="toolbar ${n ? "inline" : ""}"
|
|
6412
6565
|
<!-- Presence avatars -->
|
|
6413
|
-
${this.users.length > 0 ?
|
|
6566
|
+
${this.users.length > 0 ? u`
|
|
6414
6567
|
<div class="presence">
|
|
6415
|
-
${t > 0 ?
|
|
6568
|
+
${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : b}
|
|
6416
6569
|
${e.map(
|
|
6417
|
-
(i) =>
|
|
6570
|
+
(i) => u`
|
|
6418
6571
|
<div
|
|
6419
6572
|
class="presence-avatar clickable ${this.followingUserId === i.user.id ? "following" : ""}"
|
|
6420
6573
|
style="background:${i.user.color}"
|
|
6421
6574
|
@click=${() => this.fireFollow(i.user.id)}
|
|
6422
6575
|
title="Click to follow ${i.user.name}"
|
|
6423
6576
|
>
|
|
6424
|
-
${i.user.avatar ?
|
|
6577
|
+
${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
|
|
6425
6578
|
<span class="presence-tooltip">${i.user.name}</span>
|
|
6426
|
-
${i.deviceType && i.deviceType !== "desktop" ?
|
|
6579
|
+
${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : b}
|
|
6427
6580
|
</div>
|
|
6428
6581
|
`
|
|
6429
6582
|
)}
|
|
6430
6583
|
</div>
|
|
6431
6584
|
<div class="separator"></div>
|
|
6432
|
-
` :
|
|
6585
|
+
` : b}
|
|
6433
6586
|
|
|
6434
6587
|
<!-- Pin comment (primary) -->
|
|
6435
6588
|
<button
|
|
@@ -6439,7 +6592,7 @@ let O = class extends S {
|
|
|
6439
6592
|
?disabled=${this.featuresDisabled}
|
|
6440
6593
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6441
6594
|
>
|
|
6442
|
-
${C(
|
|
6595
|
+
${C(At)}
|
|
6443
6596
|
</button>
|
|
6444
6597
|
|
|
6445
6598
|
<!-- View comments -->
|
|
@@ -6450,7 +6603,7 @@ let O = class extends S {
|
|
|
6450
6603
|
?disabled=${this.featuresDisabled}
|
|
6451
6604
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6452
6605
|
>
|
|
6453
|
-
${C(
|
|
6606
|
+
${C(Ai)}
|
|
6454
6607
|
</button>
|
|
6455
6608
|
|
|
6456
6609
|
<!-- Activity feed -->
|
|
@@ -6461,7 +6614,7 @@ let O = class extends S {
|
|
|
6461
6614
|
?disabled=${this.featuresDisabled}
|
|
6462
6615
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6463
6616
|
>
|
|
6464
|
-
${C(
|
|
6617
|
+
${C(Pi)}
|
|
6465
6618
|
</button>
|
|
6466
6619
|
|
|
6467
6620
|
<!-- Draw mode -->
|
|
@@ -6472,7 +6625,7 @@ let O = class extends S {
|
|
|
6472
6625
|
?disabled=${this.featuresDisabled}
|
|
6473
6626
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : ""}"
|
|
6474
6627
|
>
|
|
6475
|
-
${C(
|
|
6628
|
+
${C(Mi)}
|
|
6476
6629
|
</button>
|
|
6477
6630
|
|
|
6478
6631
|
<!-- Notifications -->
|
|
@@ -6483,8 +6636,8 @@ let O = class extends S {
|
|
|
6483
6636
|
?disabled=${this.featuresDisabled}
|
|
6484
6637
|
style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
|
|
6485
6638
|
>
|
|
6486
|
-
${C(
|
|
6487
|
-
${this.unreadCount > 0 ?
|
|
6639
|
+
${C(Si)}
|
|
6640
|
+
${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : b}
|
|
6488
6641
|
</button>
|
|
6489
6642
|
|
|
6490
6643
|
<!-- Settings -->
|
|
@@ -6493,7 +6646,7 @@ let O = class extends S {
|
|
|
6493
6646
|
@click=${() => this.fire("settings")}
|
|
6494
6647
|
title="Settings"
|
|
6495
6648
|
>
|
|
6496
|
-
${C(
|
|
6649
|
+
${C(Ri)}
|
|
6497
6650
|
</button>
|
|
6498
6651
|
|
|
6499
6652
|
<div class="separator"></div>
|
|
@@ -6504,15 +6657,15 @@ let O = class extends S {
|
|
|
6504
6657
|
@click=${this.fireToggle}
|
|
6505
6658
|
title="Collapse"
|
|
6506
6659
|
>
|
|
6507
|
-
${C(
|
|
6660
|
+
${C(be, 14)}
|
|
6508
6661
|
</button>
|
|
6509
6662
|
</div>
|
|
6510
6663
|
`;
|
|
6511
6664
|
}
|
|
6512
6665
|
};
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6666
|
+
R.styles = [
|
|
6667
|
+
ie,
|
|
6668
|
+
ve,
|
|
6516
6669
|
M`
|
|
6517
6670
|
:host {
|
|
6518
6671
|
display: block;
|
|
@@ -6725,40 +6878,40 @@ O.styles = [
|
|
|
6725
6878
|
}
|
|
6726
6879
|
`
|
|
6727
6880
|
];
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
],
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
],
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
],
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
],
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
],
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
],
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
],
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
],
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
],
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
],
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
],
|
|
6761
|
-
class
|
|
6881
|
+
j([
|
|
6882
|
+
x({ attribute: !1 })
|
|
6883
|
+
], R.prototype, "client", 2);
|
|
6884
|
+
j([
|
|
6885
|
+
x({ type: Boolean })
|
|
6886
|
+
], R.prototype, "collapsed", 2);
|
|
6887
|
+
j([
|
|
6888
|
+
x()
|
|
6889
|
+
], R.prototype, "activePanel", 2);
|
|
6890
|
+
j([
|
|
6891
|
+
x({ type: Boolean })
|
|
6892
|
+
], R.prototype, "pinModeActive", 2);
|
|
6893
|
+
j([
|
|
6894
|
+
x({ type: Boolean })
|
|
6895
|
+
], R.prototype, "featuresDisabled", 2);
|
|
6896
|
+
j([
|
|
6897
|
+
x({ type: Boolean })
|
|
6898
|
+
], R.prototype, "drawModeActive", 2);
|
|
6899
|
+
j([
|
|
6900
|
+
x()
|
|
6901
|
+
], R.prototype, "followingUserId", 2);
|
|
6902
|
+
j([
|
|
6903
|
+
x()
|
|
6904
|
+
], R.prototype, "display", 2);
|
|
6905
|
+
j([
|
|
6906
|
+
$()
|
|
6907
|
+
], R.prototype, "users", 2);
|
|
6908
|
+
j([
|
|
6909
|
+
$()
|
|
6910
|
+
], R.prototype, "unreadCount", 2);
|
|
6911
|
+
R = j([
|
|
6912
|
+
L("pulse-widget-toolbar")
|
|
6913
|
+
], R);
|
|
6914
|
+
class Es {
|
|
6762
6915
|
constructor(e) {
|
|
6763
6916
|
this.container = null, this.unsubs = [], this.enabled = !1, this.pillEls = /* @__PURE__ */ new Map(), this.client = e;
|
|
6764
6917
|
}
|
|
@@ -6792,30 +6945,30 @@ class vs {
|
|
|
6792
6945
|
var r;
|
|
6793
6946
|
if (!this.container) return;
|
|
6794
6947
|
if (document.documentElement.scrollHeight <= window.innerHeight) {
|
|
6795
|
-
for (const
|
|
6948
|
+
for (const a of this.pillEls.values()) a.remove();
|
|
6796
6949
|
this.pillEls.clear();
|
|
6797
6950
|
return;
|
|
6798
6951
|
}
|
|
6799
6952
|
const e = window.scrollY, t = window.innerHeight, i = document.documentElement.scrollHeight, s = (r = this.client.state.user) == null ? void 0 : r.id, o = /* @__PURE__ */ new Set();
|
|
6800
|
-
for (const [
|
|
6801
|
-
if (
|
|
6802
|
-
const
|
|
6803
|
-
if (
|
|
6804
|
-
const E = this.pillEls.get(
|
|
6953
|
+
for (const [a, l] of this.client.state.viewports) {
|
|
6954
|
+
if (a === s) continue;
|
|
6955
|
+
const d = l.scrollY, c = l.scrollY + l.viewportHeight, h = e, p = e + t;
|
|
6956
|
+
if (d >= h && c <= p) {
|
|
6957
|
+
const E = this.pillEls.get(a);
|
|
6805
6958
|
E && (E.style.display = "none");
|
|
6806
6959
|
continue;
|
|
6807
6960
|
}
|
|
6808
|
-
o.add(
|
|
6809
|
-
const
|
|
6810
|
-
(E) => E.user.id ===
|
|
6961
|
+
o.add(a);
|
|
6962
|
+
const m = this.client.state.presence.find(
|
|
6963
|
+
(E) => E.user.id === a
|
|
6811
6964
|
);
|
|
6812
|
-
if (!
|
|
6813
|
-
const
|
|
6965
|
+
if (!m) continue;
|
|
6966
|
+
const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, v = Math.max(
|
|
6814
6967
|
8,
|
|
6815
|
-
Math.min(t - 28,
|
|
6968
|
+
Math.min(t - 28, y * t)
|
|
6816
6969
|
);
|
|
6817
|
-
let
|
|
6818
|
-
|
|
6970
|
+
let w = this.pillEls.get(a);
|
|
6971
|
+
w || (w = document.createElement("div"), Object.assign(w.style, {
|
|
6819
6972
|
position: "absolute",
|
|
6820
6973
|
right: "8px",
|
|
6821
6974
|
padding: "2px 6px",
|
|
@@ -6827,23 +6980,23 @@ class vs {
|
|
|
6827
6980
|
whiteSpace: "nowrap",
|
|
6828
6981
|
pointerEvents: "none",
|
|
6829
6982
|
transition: "top 0.3s ease"
|
|
6830
|
-
}), this.container.appendChild(
|
|
6983
|
+
}), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${v}px`, w.textContent = this.getInitials(m.user.name);
|
|
6831
6984
|
}
|
|
6832
|
-
for (const [
|
|
6833
|
-
!o.has(
|
|
6985
|
+
for (const [a, l] of this.pillEls)
|
|
6986
|
+
!o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
|
|
6834
6987
|
}
|
|
6835
6988
|
getInitials(e) {
|
|
6836
6989
|
return e.split(" ").map((t) => t[0]).join("").toUpperCase().slice(0, 2);
|
|
6837
6990
|
}
|
|
6838
6991
|
}
|
|
6839
|
-
var
|
|
6840
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
6992
|
+
var Cs = Object.defineProperty, Ts = Object.getOwnPropertyDescriptor, _ = (n, e, t, i) => {
|
|
6993
|
+
for (var s = i > 1 ? void 0 : i ? Ts(e, t) : e, o = n.length - 1, r; o >= 0; o--)
|
|
6841
6994
|
(r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
|
|
6842
|
-
return i && s &&
|
|
6995
|
+
return i && s && Cs(e, t, s), s;
|
|
6843
6996
|
};
|
|
6844
|
-
let
|
|
6997
|
+
let T = class extends P {
|
|
6845
6998
|
constructor() {
|
|
6846
|
-
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 = {
|
|
6999
|
+
super(...arguments), this.apiKey = "", this.token = "", this.room = "", this.position = "bottom-right", this.display = "floating", this.collapsed = !0, this.activePanel = null, this.pinModeActive = !1, this.highlightThreadId = null, this.settings = { ...$e }, this.followingUserId = null, this.drawModeActive = !1, this.connectionState = "disconnected", this.showConnectedFlash = !1, this.unsubs = [], this.clientConfigKey = "", this._isFollowScrolling = !1, this._viewportThrottleTimer = null, this._selectionThrottleTimer = null, this._connectedFlashTimer = null, this._wasDisconnected = !1, this.handleScroll = () => {
|
|
6847
7000
|
!this.settings.enabled || !this.client || this._isFollowScrolling || (this.followingUserId && (this.followingUserId = null), !this._viewportThrottleTimer && (this._viewportThrottleTimer = setTimeout(() => {
|
|
6848
7001
|
var n;
|
|
6849
7002
|
this._viewportThrottleTimer = null, (n = this.client) == null || n.updateViewport({
|
|
@@ -6864,7 +7017,7 @@ let _ = class extends S {
|
|
|
6864
7017
|
(t = this.client) == null || t.updateSelection(null);
|
|
6865
7018
|
return;
|
|
6866
7019
|
}
|
|
6867
|
-
const e =
|
|
7020
|
+
const e = ms(n);
|
|
6868
7021
|
(i = this.client) == null || i.updateSelection(e);
|
|
6869
7022
|
}, 500));
|
|
6870
7023
|
}, this.handleDocumentClick = (n) => {
|
|
@@ -6896,11 +7049,11 @@ let _ = class extends S {
|
|
|
6896
7049
|
room: this.room,
|
|
6897
7050
|
endpoint: this.endpoint
|
|
6898
7051
|
};
|
|
6899
|
-
this.client = new
|
|
7052
|
+
this.client = new $t(n), this.clientConfigKey = this.getConfigKey(), this.cursorOverlay = new us(this.client), this.commentPins = new ns(this.client, {
|
|
6900
7053
|
onPinModeExit: () => {
|
|
6901
7054
|
this.pinModeActive = !1;
|
|
6902
7055
|
}
|
|
6903
|
-
}), this.viewportOverlay = new
|
|
7056
|
+
}), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new bs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
|
|
6904
7057
|
this.client.on("connection", (e) => {
|
|
6905
7058
|
this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
|
|
6906
7059
|
this.showConnectedFlash = !1, this._connectedFlashTimer = null;
|
|
@@ -6967,15 +7120,15 @@ let _ = class extends S {
|
|
|
6967
7120
|
}
|
|
6968
7121
|
handleSettingsChange(n) {
|
|
6969
7122
|
const e = n.detail;
|
|
6970
|
-
this.settings = e,
|
|
7123
|
+
this.settings = e, ws(this.room, e), this.applySettings(e);
|
|
6971
7124
|
}
|
|
6972
7125
|
applySettings(n) {
|
|
6973
|
-
var e, t, i, s, o, r, l,
|
|
7126
|
+
var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, v, w;
|
|
6974
7127
|
if (!n.enabled) {
|
|
6975
|
-
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (
|
|
7128
|
+
(e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
|
|
6976
7129
|
return;
|
|
6977
7130
|
}
|
|
6978
|
-
this.applyCursorSettings(n), (
|
|
7131
|
+
this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((v = this.drawingOverlay) == null || v.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
|
|
6979
7132
|
}
|
|
6980
7133
|
applyCursorSettings(n) {
|
|
6981
7134
|
if (!this.cursorOverlay) return;
|
|
@@ -6989,30 +7142,30 @@ let _ = class extends S {
|
|
|
6989
7142
|
* the trigger element, flipping vertically/horizontally as needed.
|
|
6990
7143
|
*/
|
|
6991
7144
|
positionPopups() {
|
|
6992
|
-
var
|
|
6993
|
-
const n = this.display === "inline", e = (
|
|
7145
|
+
var g, y, v, w;
|
|
7146
|
+
const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
|
|
6994
7147
|
if (!i) return;
|
|
6995
|
-
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight,
|
|
6996
|
-
if (
|
|
6997
|
-
Object.assign(
|
|
6998
|
-
const E =
|
|
6999
|
-
|
|
7000
|
-
}
|
|
7001
|
-
const
|
|
7148
|
+
const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".toolbar-popover");
|
|
7149
|
+
if (l) {
|
|
7150
|
+
Object.assign(l.style, { top: "auto", left: "auto" });
|
|
7151
|
+
const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
|
|
7152
|
+
l.style.top = `${I.top}px`, l.style.left = `${I.left}px`;
|
|
7153
|
+
}
|
|
7154
|
+
const d = (w = this.shadowRoot) == null ? void 0 : w.querySelector(".panel-container");
|
|
7155
|
+
if (!d) return;
|
|
7156
|
+
Object.assign(d.style, { top: "auto", left: "auto" });
|
|
7157
|
+
const c = l ?? t;
|
|
7002
7158
|
if (!c) return;
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
if (!h) return;
|
|
7006
|
-
const p = h.getBoundingClientRect(), u = c.getBoundingClientRect(), f = this.computePosition(p, u, o, r, l);
|
|
7007
|
-
c.style.top = `${f.top}px`, c.style.left = `${f.left}px`;
|
|
7159
|
+
const h = c.getBoundingClientRect(), p = d.getBoundingClientRect(), m = this.computePosition(h, p, o, r, a);
|
|
7160
|
+
d.style.top = `${m.top}px`, d.style.left = `${m.left}px`;
|
|
7008
7161
|
}
|
|
7009
7162
|
computePosition(n, e, t, i, s) {
|
|
7010
7163
|
const o = n.top, r = i - n.bottom;
|
|
7011
|
-
let l;
|
|
7012
|
-
o >= e.height + s ? l = n.top - e.height - s : r >= e.height + s ? l = n.bottom + s : l = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
|
|
7013
7164
|
let a;
|
|
7014
|
-
|
|
7015
|
-
|
|
7165
|
+
o >= e.height + s ? a = n.top - e.height - s : r >= e.height + s ? a = n.bottom + s : a = o >= r ? Math.max(s, n.top - e.height - s) : n.bottom + s;
|
|
7166
|
+
let l;
|
|
7167
|
+
const d = n.right - e.width;
|
|
7168
|
+
return d >= s ? l = d : n.left + e.width + s <= t ? l = n.left : l = Math.max(s, Math.min(t - e.width - s, n.left)), a = Math.max(s, Math.min(i - e.height - s, a)), l = Math.max(s, Math.min(t - e.width - s, l)), { top: a, left: l };
|
|
7016
7169
|
}
|
|
7017
7170
|
getFollowUserName() {
|
|
7018
7171
|
var e;
|
|
@@ -7023,13 +7176,13 @@ let _ = class extends S {
|
|
|
7023
7176
|
return (n == null ? void 0 : n.user.name) ?? "user";
|
|
7024
7177
|
}
|
|
7025
7178
|
renderConnectionBanner() {
|
|
7026
|
-
return this.showConnectedFlash ?
|
|
7179
|
+
return this.showConnectedFlash ? u`<div class="connection-banner connected">
|
|
7027
7180
|
<span class="connection-dot"></span>Connected
|
|
7028
|
-
</div>` : this.connectionState === "connecting" ?
|
|
7181
|
+
</div>` : this.connectionState === "connecting" ? u`<div class="connection-banner connecting">
|
|
7029
7182
|
<span class="connection-dot"></span>Reconnecting...
|
|
7030
|
-
</div>` : this.connectionState === "disconnected" && this.client ?
|
|
7183
|
+
</div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
|
|
7031
7184
|
<span class="connection-dot"></span>Disconnected
|
|
7032
|
-
</div>` :
|
|
7185
|
+
</div>` : b;
|
|
7033
7186
|
}
|
|
7034
7187
|
handleToolbarToggle() {
|
|
7035
7188
|
this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
|
|
@@ -7037,38 +7190,38 @@ let _ = class extends S {
|
|
|
7037
7190
|
render() {
|
|
7038
7191
|
const n = this.display === "inline";
|
|
7039
7192
|
if (n && this.collapsed)
|
|
7040
|
-
return
|
|
7193
|
+
return u`
|
|
7041
7194
|
<div class="widget-root">
|
|
7042
7195
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
7043
7196
|
<slot>Collaborate</slot>
|
|
7044
7197
|
</div>
|
|
7045
7198
|
</div>
|
|
7046
7199
|
`;
|
|
7047
|
-
const e = this.activePanel ?
|
|
7200
|
+
const e = this.activePanel ? u`
|
|
7048
7201
|
<div class="panel-container anchored" @panel-close=${this.handlePanelClose}>
|
|
7049
|
-
${this.activePanel === "comments" ?
|
|
7202
|
+
${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
|
|
7050
7203
|
.client=${this.client}
|
|
7051
7204
|
.highlightThreadId=${this.highlightThreadId}
|
|
7052
|
-
></pulse-widget-comments-panel>` :
|
|
7053
|
-
${this.activePanel === "settings" ?
|
|
7205
|
+
></pulse-widget-comments-panel>` : b}
|
|
7206
|
+
${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
|
|
7054
7207
|
.settings=${this.settings}
|
|
7055
7208
|
.roomId=${this.room}
|
|
7056
7209
|
@settings-change=${this.handleSettingsChange}
|
|
7057
|
-
></pulse-widget-settings-panel>` :
|
|
7058
|
-
${this.activePanel === "notifications" ?
|
|
7210
|
+
></pulse-widget-settings-panel>` : b}
|
|
7211
|
+
${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
|
|
7059
7212
|
.client=${this.client}
|
|
7060
|
-
></pulse-widget-notifications-panel>` :
|
|
7061
|
-
${this.activePanel === "activity" ?
|
|
7213
|
+
></pulse-widget-notifications-panel>` : b}
|
|
7214
|
+
${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
|
|
7062
7215
|
.client=${this.client}
|
|
7063
|
-
></pulse-widget-activity-panel>` :
|
|
7216
|
+
></pulse-widget-activity-panel>` : b}
|
|
7064
7217
|
</div>
|
|
7065
|
-
` :
|
|
7218
|
+
` : b, t = this.followingUserId ? u`<div class="follow-banner">
|
|
7066
7219
|
Following ${this.getFollowUserName()}
|
|
7067
7220
|
<button @click=${() => {
|
|
7068
7221
|
this.followingUserId = null;
|
|
7069
7222
|
}}>Stop</button>
|
|
7070
|
-
</div>` :
|
|
7071
|
-
return n ?
|
|
7223
|
+
</div>` : b;
|
|
7224
|
+
return n ? u`
|
|
7072
7225
|
${t}
|
|
7073
7226
|
<div class="widget-root">
|
|
7074
7227
|
<div class="inline-trigger" @click=${this.handleToolbarToggle}>
|
|
@@ -7092,7 +7245,7 @@ let _ = class extends S {
|
|
|
7092
7245
|
</div>
|
|
7093
7246
|
${e}
|
|
7094
7247
|
</div>
|
|
7095
|
-
` :
|
|
7248
|
+
` : u`
|
|
7096
7249
|
${t}
|
|
7097
7250
|
<div class="widget-root">
|
|
7098
7251
|
${e}
|
|
@@ -7114,8 +7267,8 @@ let _ = class extends S {
|
|
|
7114
7267
|
`;
|
|
7115
7268
|
}
|
|
7116
7269
|
};
|
|
7117
|
-
|
|
7118
|
-
|
|
7270
|
+
T.styles = [
|
|
7271
|
+
ie,
|
|
7119
7272
|
M`
|
|
7120
7273
|
:host {
|
|
7121
7274
|
display: block;
|
|
@@ -7292,60 +7445,60 @@ _.styles = [
|
|
|
7292
7445
|
}
|
|
7293
7446
|
`
|
|
7294
7447
|
];
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
],
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
],
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
],
|
|
7304
|
-
|
|
7305
|
-
|
|
7306
|
-
],
|
|
7307
|
-
|
|
7308
|
-
|
|
7309
|
-
],
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
],
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
],
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
],
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
],
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
],
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
],
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
],
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
],
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
],
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
],
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
],
|
|
7448
|
+
_([
|
|
7449
|
+
x({ attribute: "api-key" })
|
|
7450
|
+
], T.prototype, "apiKey", 2);
|
|
7451
|
+
_([
|
|
7452
|
+
x()
|
|
7453
|
+
], T.prototype, "token", 2);
|
|
7454
|
+
_([
|
|
7455
|
+
x()
|
|
7456
|
+
], T.prototype, "room", 2);
|
|
7457
|
+
_([
|
|
7458
|
+
x()
|
|
7459
|
+
], T.prototype, "endpoint", 2);
|
|
7460
|
+
_([
|
|
7461
|
+
x({ reflect: !0 })
|
|
7462
|
+
], T.prototype, "position", 2);
|
|
7463
|
+
_([
|
|
7464
|
+
x({ reflect: !0 })
|
|
7465
|
+
], T.prototype, "display", 2);
|
|
7466
|
+
_([
|
|
7467
|
+
$()
|
|
7468
|
+
], T.prototype, "collapsed", 2);
|
|
7469
|
+
_([
|
|
7470
|
+
$()
|
|
7471
|
+
], T.prototype, "activePanel", 2);
|
|
7472
|
+
_([
|
|
7473
|
+
$()
|
|
7474
|
+
], T.prototype, "pinModeActive", 2);
|
|
7475
|
+
_([
|
|
7476
|
+
$()
|
|
7477
|
+
], T.prototype, "highlightThreadId", 2);
|
|
7478
|
+
_([
|
|
7479
|
+
$()
|
|
7480
|
+
], T.prototype, "settings", 2);
|
|
7481
|
+
_([
|
|
7482
|
+
$()
|
|
7483
|
+
], T.prototype, "followingUserId", 2);
|
|
7484
|
+
_([
|
|
7485
|
+
$()
|
|
7486
|
+
], T.prototype, "drawModeActive", 2);
|
|
7487
|
+
_([
|
|
7488
|
+
$()
|
|
7489
|
+
], T.prototype, "connectionState", 2);
|
|
7490
|
+
_([
|
|
7491
|
+
$()
|
|
7492
|
+
], T.prototype, "showConnectedFlash", 2);
|
|
7493
|
+
T = _([
|
|
7494
|
+
L("pulse-widget")
|
|
7495
|
+
], T);
|
|
7343
7496
|
export {
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7497
|
+
Y as PulseComments,
|
|
7498
|
+
de as PulseCursors,
|
|
7499
|
+
he as PulseNotifications,
|
|
7500
|
+
Z as PulsePresence,
|
|
7501
|
+
X as PulseProvider,
|
|
7502
|
+
B as PulseReactions,
|
|
7503
|
+
T as PulseWidget
|
|
7351
7504
|
};
|