@talkjs/core 0.0.3 → 0.0.4
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/README.md +3 -3
- package/dist/talkSession.cjs +2 -0
- package/dist/talkSession.d.ts +24 -1
- package/dist/talkSession.js +475 -486
- package/package.json +2 -1
package/dist/talkSession.js
CHANGED
|
@@ -88,80 +88,7 @@ function o() {
|
|
|
88
88
|
});
|
|
89
89
|
return e2.promise = t2, e2;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
var _a2;
|
|
93
|
-
(!r2 || r2 <= 0) && (r2 = 1);
|
|
94
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-03-28T14:07:08.582Z" };
|
|
95
|
-
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
96
|
-
return a(r2, () => __async(this, null, function* () {
|
|
97
|
-
if (o2) {
|
|
98
|
-
const e3 = yield o2.getToken();
|
|
99
|
-
u2.Authorization = `Bearer ${e3}`;
|
|
100
|
-
}
|
|
101
|
-
return fetch(t2, { method: e2, headers: u2, body: s2 }).then((e3) => {
|
|
102
|
-
if (e3.ok) return e3;
|
|
103
|
-
throw e3;
|
|
104
|
-
});
|
|
105
|
-
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
106
|
-
return o2 && 401 === s3.status ? (g.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
107
|
-
}) }).catch((s3) => {
|
|
108
|
-
if (!t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
109
|
-
const n3 = `Network Error for ${e2} ${t2}`;
|
|
110
|
-
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
111
|
-
s3.clone().text().then((e3) => g.log(`${n3} ${s3.status} ${e3}`));
|
|
112
|
-
} else g.log(`${n3} ${s3}`);
|
|
113
|
-
console.error("[TalkJS]", n3);
|
|
114
|
-
}
|
|
115
|
-
throw s3;
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
const { cdnHost: c, appHost: l, restHost: h, realtimeHost: d, appProtocol: p, appWsProtocol: f } = function() {
|
|
119
|
-
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
120
|
-
const e2 = function() {
|
|
121
|
-
if (document.currentScript) return document.currentScript.src;
|
|
122
|
-
try {
|
|
123
|
-
throw new Error();
|
|
124
|
-
} catch (e3) {
|
|
125
|
-
const t3 = e3.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);
|
|
126
|
-
return t3 ? t3[0] : "";
|
|
127
|
-
}
|
|
128
|
-
}(), t2 = document.createElement("a");
|
|
129
|
-
t2.href = e2;
|
|
130
|
-
const s2 = t2.host, n2 = function(e3) {
|
|
131
|
-
if (e3.match(/^cdn[.-]/)) return e3.replace(/^cdn/, "app");
|
|
132
|
-
if ("talkjs.com" === e3) return "app.talkjs.com";
|
|
133
|
-
return e3;
|
|
134
|
-
}(s2), r2 = function(e3) {
|
|
135
|
-
if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "api");
|
|
136
|
-
return e3 + "/public_api";
|
|
137
|
-
}(n2), i2 = function(e3) {
|
|
138
|
-
if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "realtime");
|
|
139
|
-
return e3 + "/public_api";
|
|
140
|
-
}(n2), a2 = t2.protocol;
|
|
141
|
-
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
142
|
-
}();
|
|
143
|
-
const m = l.startsWith("app.talkjs.com");
|
|
144
|
-
const g = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
145
|
-
} } : new class {
|
|
146
|
-
constructor(e2) {
|
|
147
|
-
this._timeCreated = Date.now(), this._enabled = m, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-03-28T14:07:08.582Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-03-28T14:07:08.582Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
148
|
-
}
|
|
149
|
-
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
150
|
-
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
151
|
-
}
|
|
152
|
-
log(e2) {
|
|
153
|
-
return __async(this, null, function* () {
|
|
154
|
-
try {
|
|
155
|
-
if (!this._enabled) return Promise.resolve();
|
|
156
|
-
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
157
|
-
yield u({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
158
|
-
} catch (e3) {
|
|
159
|
-
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
}("970cd0be0fb74630b75c8451051299dc");
|
|
164
|
-
class v {
|
|
91
|
+
class u {
|
|
165
92
|
constructor(e2, t2, s2) {
|
|
166
93
|
this.layer = e2, this.states = t2, this.transitions = s2, this.key = void 0, this._state = t2[0];
|
|
167
94
|
}
|
|
@@ -170,20 +97,10 @@ class v {
|
|
|
170
97
|
}
|
|
171
98
|
transition(e2, t2) {
|
|
172
99
|
const s2 = this.transitions[e2];
|
|
173
|
-
if (!s2)
|
|
174
|
-
|
|
175
|
-
return void g.log(t3).catch(() => {
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
if (!this.canTransition(e2, t2)) {
|
|
179
|
-
const t3 = `Realtime State Machine tried to take ${e2.toString()} transition while in ${this.state}`;
|
|
180
|
-
return void g.log(t3).catch(() => {
|
|
181
|
-
});
|
|
182
|
-
}
|
|
100
|
+
if (!s2) return;
|
|
101
|
+
if (!this.canTransition(e2, t2)) return;
|
|
183
102
|
const n2 = this.state, r2 = this.key;
|
|
184
|
-
this._state = s2.to, "LOCK" === s2.keyRequired ? this.key = t2 : "UNLOCK" === s2.keyRequired && (this.key = void 0),
|
|
185
|
-
const e3 = { stack: new Error().stack || "no stack trace available" };
|
|
186
|
-
}(this.states), s2.afterTransition({ from: n2, to: this.state, fromKey: r2, toKey: this.key });
|
|
103
|
+
this._state = s2.to, "LOCK" === s2.keyRequired ? this.key = t2 : "UNLOCK" === s2.keyRequired && (this.key = void 0), s2.afterTransition({ from: n2, to: this.state, fromKey: r2, toKey: this.key });
|
|
187
104
|
}
|
|
188
105
|
canTransition(e2, t2) {
|
|
189
106
|
const s2 = this.transitions[e2];
|
|
@@ -192,30 +109,30 @@ class v {
|
|
|
192
109
|
return !(void 0 !== r2 && !t2) && (("UNLOCK" !== r2 || void 0 === this.key || t2 === this.key) && ("ANY" === n2 || n2.includes(this.state)));
|
|
193
110
|
}
|
|
194
111
|
}
|
|
195
|
-
function
|
|
112
|
+
function c(e2) {
|
|
196
113
|
return { ok: true, value: e2 };
|
|
197
114
|
}
|
|
198
|
-
function
|
|
115
|
+
function l(e2) {
|
|
199
116
|
return { ok: false, where: "client", value: e2 };
|
|
200
117
|
}
|
|
201
|
-
function
|
|
118
|
+
function h(e2) {
|
|
202
119
|
return { ok: false, where: "server", value: e2 };
|
|
203
120
|
}
|
|
204
|
-
function
|
|
121
|
+
function d() {
|
|
205
122
|
const e2 = {}, t2 = new Promise((t3) => {
|
|
206
123
|
e2.ok = (e3) => __async(this, null, function* () {
|
|
207
|
-
return t3(
|
|
208
|
-
}), e2.clientErr = (e3) => t3(
|
|
124
|
+
return t3(c(e3));
|
|
125
|
+
}), e2.clientErr = (e3) => t3(l(e3)), e2.serverErr = (e3) => t3(h(e3)), e2.resolve = (e3) => t3(e3);
|
|
209
126
|
});
|
|
210
127
|
return e2.promise = t2, e2;
|
|
211
128
|
}
|
|
212
|
-
let
|
|
213
|
-
function
|
|
214
|
-
|
|
129
|
+
let p = null;
|
|
130
|
+
function f({ WebSocket: e2 }) {
|
|
131
|
+
p = e2;
|
|
215
132
|
}
|
|
216
|
-
class
|
|
133
|
+
class m {
|
|
217
134
|
constructor(e2, t2) {
|
|
218
|
-
this.realtimeUrl = e2, this.handlers = t2, this.socket = null, this.throttler = new
|
|
135
|
+
this.realtimeUrl = e2, this.handlers = t2, this.socket = null, this.throttler = new g(), this.stateMachine = new u("ReconnectingSocket", ["STOPPED", "WAITING_FOR_THROTTLER", "CONNECTING", "READY", "TERMINATED"], { queueAutoReconnect: { from: ["READY", "CONNECTING"], to: "WAITING_FOR_THROTTLER", afterTransition: ({ from: e3 }) => {
|
|
219
136
|
"READY" === e3 && this.handlers.onClose(), this.throttler.request(() => {
|
|
220
137
|
this.stateMachine.transition("connect");
|
|
221
138
|
});
|
|
@@ -236,8 +153,10 @@ class E {
|
|
|
236
153
|
this.stateMachine.canTransition("connect") && this.stateMachine.transition("connect");
|
|
237
154
|
}
|
|
238
155
|
createWebSocket() {
|
|
156
|
+
var _a2;
|
|
157
|
+
(_a2 = this == null ? void 0 : this.socket) == null ? void 0 : _a2.close(1e3);
|
|
239
158
|
const e2 = new (function() {
|
|
240
|
-
if (
|
|
159
|
+
if (p) return p;
|
|
241
160
|
if (globalThis.WebSocket) return globalThis.WebSocket;
|
|
242
161
|
throw new Error("Missing WebSocket implementation");
|
|
243
162
|
}())(this.realtimeUrl);
|
|
@@ -250,7 +169,7 @@ class E {
|
|
|
250
169
|
e2.addEventListener("close", s2);
|
|
251
170
|
}
|
|
252
171
|
send(e2) {
|
|
253
|
-
return "READY" === this.stateMachine.state ? (this.socket.send(e2),
|
|
172
|
+
return "READY" === this.stateMachine.state ? (this.socket.send(e2), c(void 0)) : l("SOCKET_NOT_READY");
|
|
254
173
|
}
|
|
255
174
|
terminate() {
|
|
256
175
|
if (this.socket) if ("terminate" in this.socket) this.socket.terminate();
|
|
@@ -264,7 +183,7 @@ class E {
|
|
|
264
183
|
this.stateMachine.transition("destroy");
|
|
265
184
|
}
|
|
266
185
|
}
|
|
267
|
-
let
|
|
186
|
+
let g = class {
|
|
268
187
|
constructor() {
|
|
269
188
|
this.initialDelayMs = 200 + 200 * Math.random(), this.exponentialFactor = 1.2, this.maxDelayMs = 1e4, this.currentDelayMs = this.initialDelayMs;
|
|
270
189
|
}
|
|
@@ -276,9 +195,9 @@ let x = class {
|
|
|
276
195
|
this.currentDelayMs = this.initialDelayMs;
|
|
277
196
|
}
|
|
278
197
|
};
|
|
279
|
-
class
|
|
198
|
+
class v {
|
|
280
199
|
constructor(e2, t2) {
|
|
281
|
-
this.handlers = t2, this.socket = new
|
|
200
|
+
this.handlers = t2, this.socket = new m(e2, { onOpen: () => this.handlers.onOpen(), onClose: () => this.handlers.onClose(), onMessage: (e3) => this.onWebSocketMessage(e3) });
|
|
282
201
|
}
|
|
283
202
|
call(e2, t2, s2, n2) {
|
|
284
203
|
const r2 = `/${s2.map((e3) => encodeURIComponent(e3)).join("/")}`, i2 = JSON.stringify([e2, t2, r2, n2]);
|
|
@@ -315,7 +234,7 @@ class T {
|
|
|
315
234
|
else this.handlers.onAuthExpired();
|
|
316
235
|
}
|
|
317
236
|
}
|
|
318
|
-
class
|
|
237
|
+
class b {
|
|
319
238
|
constructor(e2) {
|
|
320
239
|
this.delayMs = e2, this.timeout = void 0;
|
|
321
240
|
}
|
|
@@ -328,7 +247,7 @@ class S {
|
|
|
328
247
|
void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
|
|
329
248
|
}
|
|
330
249
|
}
|
|
331
|
-
class
|
|
250
|
+
class y {
|
|
332
251
|
constructor() {
|
|
333
252
|
this.i = -1;
|
|
334
253
|
}
|
|
@@ -339,9 +258,9 @@ class D {
|
|
|
339
258
|
this.i = -1;
|
|
340
259
|
}
|
|
341
260
|
}
|
|
342
|
-
class
|
|
261
|
+
class w {
|
|
343
262
|
constructor(e2, t2) {
|
|
344
|
-
this.handlers = t2, this.seqCounter = new
|
|
263
|
+
this.handlers = t2, this.seqCounter = new y(), this.responseHandlers = {}, this.heartbeats = new A(this), this.socket = new v(e2, { onUpstreamRestarting: () => {
|
|
345
264
|
this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
|
|
346
265
|
}, onOpen: () => {
|
|
347
266
|
this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
|
|
@@ -358,7 +277,7 @@ class I {
|
|
|
358
277
|
} });
|
|
359
278
|
}
|
|
360
279
|
call(e2, t2, s2) {
|
|
361
|
-
const n2 = this.seqCounter.next(), r2 =
|
|
280
|
+
const n2 = this.seqCounter.next(), r2 = d();
|
|
362
281
|
this.responseHandlers[n2] = r2;
|
|
363
282
|
const i2 = this.socket.call(n2, e2, t2, s2);
|
|
364
283
|
return i2.ok || r2.resolve(i2), this.heartbeats.clientActive(), r2.promise;
|
|
@@ -384,9 +303,9 @@ class I {
|
|
|
384
303
|
this.socket.terminate();
|
|
385
304
|
}
|
|
386
305
|
}
|
|
387
|
-
class
|
|
306
|
+
class A {
|
|
388
307
|
constructor(e2) {
|
|
389
|
-
this.connection = e2, this.clientInactivityTimer = new
|
|
308
|
+
this.connection = e2, this.clientInactivityTimer = new b(25e3), this.serverInactivityTimer = new b(1e4), this.serverTimeoutTimer = new b(5e3);
|
|
390
309
|
}
|
|
391
310
|
clientActive() {
|
|
392
311
|
this.clientInactivityTimer.schedule(() => {
|
|
@@ -408,9 +327,9 @@ class F {
|
|
|
408
327
|
});
|
|
409
328
|
}
|
|
410
329
|
}
|
|
411
|
-
class
|
|
330
|
+
class C {
|
|
412
331
|
constructor(e2, t2, s2) {
|
|
413
|
-
this.authProvider = t2, this.handlers = s2, this.stateMachine = new
|
|
332
|
+
this.authProvider = t2, this.handlers = s2, this.stateMachine = new u("AuthenticatedConnection", ["WAITING_FOR_WS", "WAITING_FOR_TOKEN", "WAITING_FOR_SESSION", "READY", "TERMINATED"], { getAuthToken: { from: ["WAITING_FOR_WS"], to: "WAITING_FOR_TOKEN", afterTransition: () => __async(this, null, function* () {
|
|
414
333
|
const e3 = yield this.authProvider.getToken();
|
|
415
334
|
"WAITING_FOR_TOKEN" === this.stateMachine.state && this.stateMachine.transition("sendAuthToken", e3);
|
|
416
335
|
}) }, sendAuthToken: { from: ["WAITING_FOR_TOKEN", "WAITING_FOR_SESSION", "READY"], to: "WAITING_FOR_SESSION", keyRequired: "LOCK", afterTransition: ({ from: e3, fromKey: t3, toKey: s3 }) => {
|
|
@@ -423,7 +342,7 @@ class B {
|
|
|
423
342
|
"READY" === e3 && this.handlers.onNotReady();
|
|
424
343
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
425
344
|
this.connection.destroy();
|
|
426
|
-
} } }), this.connection = new
|
|
345
|
+
} } }), this.connection = new w(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("getAuthToken"), onNotReady: () => {
|
|
427
346
|
this.authProvider.clearScheduledRefresh(), this.stateMachine.transition("notReady");
|
|
428
347
|
}, onAuthExpired: () => {
|
|
429
348
|
this.authProvider.clearScheduledRefresh(), "READY" === this.stateMachine.state && (this.stateMachine.transition("refreshAuthToken"), this.handlers.onNotReady());
|
|
@@ -468,21 +387,21 @@ class B {
|
|
|
468
387
|
});
|
|
469
388
|
}
|
|
470
389
|
}
|
|
471
|
-
class
|
|
390
|
+
class E {
|
|
472
391
|
constructor(e2, t2, s2) {
|
|
473
|
-
this.handlers = s2, this.stateMachine = new
|
|
392
|
+
this.handlers = s2, this.stateMachine = new u("StopStartConnection", ["STOPPED", "WAITING_FOR_WS", "READY", "TERMINATED"], { unexpectedDisconnect: { from: ["READY"], to: "WAITING_FOR_WS", afterTransition: () => {
|
|
474
393
|
this.inactivityTimer.stop(), this.handlers.onNotReady();
|
|
475
394
|
} }, stop: { from: ["WAITING_FOR_WS", "READY"], to: "STOPPED", afterTransition: () => {
|
|
476
395
|
this.connection.stopWs(), this.inactivityTimer.stop(), this.handlers.onNotReady();
|
|
477
396
|
} }, start: { from: ["STOPPED"], to: "WAITING_FOR_WS", afterTransition: () => {
|
|
478
397
|
this.connection.startWs();
|
|
479
398
|
} }, ready: { from: ["WAITING_FOR_WS"], to: "READY", afterTransition: () => {
|
|
480
|
-
this.pendingCalls = 0, this.activeSubscriptions = 0, this.
|
|
399
|
+
this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer.schedule(() => {
|
|
481
400
|
this.stateMachine.transition("stop");
|
|
482
|
-
});
|
|
401
|
+
}), this.handlers.onReady();
|
|
483
402
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
484
403
|
this.inactivityTimer.stop(), this.connection.destroy();
|
|
485
|
-
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new
|
|
404
|
+
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new b(3e3), this.connection = new C(e2, t2, { onUpstreamRestarting: () => {
|
|
486
405
|
this.handlers.onUpstreamRestarting();
|
|
487
406
|
}, onReady: () => {
|
|
488
407
|
this.stateMachine.transition("ready");
|
|
@@ -514,9 +433,9 @@ class M {
|
|
|
514
433
|
return "READY" === this.stateMachine.state;
|
|
515
434
|
}
|
|
516
435
|
}
|
|
517
|
-
class
|
|
436
|
+
class k {
|
|
518
437
|
constructor(e2, t2, s2) {
|
|
519
|
-
this.handlers = s2, this.stateMachine = new
|
|
438
|
+
this.handlers = s2, this.stateMachine = new u("QueuedConnection", ["NOT_READY", "PROCESSING_QUEUE", "READY", "TERMINATED"], { processQueue: { from: ["NOT_READY"], to: "PROCESSING_QUEUE", afterTransition: () => {
|
|
520
439
|
this.sendQueuedCalls();
|
|
521
440
|
} }, ready: { from: ["PROCESSING_QUEUE"], to: "READY", afterTransition: () => {
|
|
522
441
|
this.handlers.onReady();
|
|
@@ -529,7 +448,7 @@ class R {
|
|
|
529
448
|
e3 == null ? void 0 : e3.clientErr("SESSION_DESTROYED");
|
|
530
449
|
}
|
|
531
450
|
this.connection.destroy();
|
|
532
|
-
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new
|
|
451
|
+
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new E(e2, t2, { onUpstreamRestarting: () => {
|
|
533
452
|
this.handlers.onUpstreamRestarting();
|
|
534
453
|
}, onReady: () => {
|
|
535
454
|
this.stateMachine.transition("processQueue");
|
|
@@ -546,11 +465,11 @@ class R {
|
|
|
546
465
|
const n2 = t2.join("/"), r2 = this.subscribeQueue[n2];
|
|
547
466
|
if (r2 && r2.method === e2) return r2.deferred.promise;
|
|
548
467
|
r2 && r2.method !== e2 && (r2.deferred.ok({ status: 200, data: {} }), delete this.subscribeQueue[n2]);
|
|
549
|
-
const i2 = { deferred:
|
|
468
|
+
const i2 = { deferred: d(), method: e2, path: t2, data: s2 };
|
|
550
469
|
return this.subscribeQueue[n2] = i2, i2.deferred.promise;
|
|
551
470
|
}
|
|
552
471
|
_call(e2, t2, s2) {
|
|
553
|
-
const n2 = { deferred:
|
|
472
|
+
const n2 = { deferred: d(), method: e2, path: t2, data: s2 };
|
|
554
473
|
return this.callQueue.push(n2), n2.deferred.promise;
|
|
555
474
|
}
|
|
556
475
|
dequeue() {
|
|
@@ -575,13 +494,13 @@ class R {
|
|
|
575
494
|
});
|
|
576
495
|
}
|
|
577
496
|
isConnected() {
|
|
578
|
-
return "READY" === this.stateMachine.state;
|
|
497
|
+
return "READY" === this.stateMachine.state || "PROCESSING_QUEUE" === this.stateMachine.state;
|
|
579
498
|
}
|
|
580
499
|
}
|
|
581
|
-
const
|
|
582
|
-
class
|
|
500
|
+
const x = "undefined" != typeof window ? (_a = window.queueMicrotask) != null ? _a : setTimeout : setTimeout;
|
|
501
|
+
class T {
|
|
583
502
|
constructor(e2, t2) {
|
|
584
|
-
this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false,
|
|
503
|
+
this.clearPendingBatch = e2, this.sendCalls = t2, this.sent = false, x(() => this.send());
|
|
585
504
|
}
|
|
586
505
|
send() {
|
|
587
506
|
this.sent || (this.sent = true, this.clearPendingBatch(), this.sendCalls());
|
|
@@ -590,20 +509,20 @@ class _ {
|
|
|
590
509
|
this.sent = true;
|
|
591
510
|
}
|
|
592
511
|
}
|
|
593
|
-
class
|
|
512
|
+
class S extends T {
|
|
594
513
|
constructor(e2, t2) {
|
|
595
514
|
super(t2, () => {
|
|
596
515
|
this.sendSubscribe(), this.sendGet();
|
|
597
516
|
}), this.connection = e2, this.getCalls = [], this.subscribeCalls = [];
|
|
598
517
|
}
|
|
599
518
|
canPush(e2, t2) {
|
|
600
|
-
return
|
|
519
|
+
return S.isCorrectBatchTypeFor(e2, t2);
|
|
601
520
|
}
|
|
602
521
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
603
522
|
return s(t2, ["users", "*"]) && ("GET" === e2 || "SUBSCRIBE" === e2);
|
|
604
523
|
}
|
|
605
524
|
push(e2, t2, s2) {
|
|
606
|
-
const n2 = t2[1], r2 =
|
|
525
|
+
const n2 = t2[1], r2 = d();
|
|
607
526
|
return "GET" === e2 ? this.getCalls.push({ userId: n2, deferred: r2 }) : this.subscribeCalls.push({ userId: n2, deferred: r2 }), 1e3 !== this.getCalls.length && 1e3 !== this.subscribeCalls.length || this.send(), r2.promise;
|
|
608
527
|
}
|
|
609
528
|
sendGet() {
|
|
@@ -623,18 +542,18 @@ class N extends _ {
|
|
|
623
542
|
this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
624
543
|
}
|
|
625
544
|
}
|
|
626
|
-
class
|
|
545
|
+
class D extends T {
|
|
627
546
|
constructor(e2, t2, s2) {
|
|
628
547
|
super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
629
548
|
}
|
|
630
549
|
canPush(e2, t2) {
|
|
631
|
-
return !!
|
|
550
|
+
return !!D.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
|
|
632
551
|
}
|
|
633
552
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
634
553
|
return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
|
|
635
554
|
}
|
|
636
555
|
push(e2, t2, s2) {
|
|
637
|
-
const n2 = t2[3], r2 =
|
|
556
|
+
const n2 = t2[3], r2 = d();
|
|
638
557
|
return this.calls.push({ action: { id: n2, method: e2, params: s2 }, deferred: r2 }), 100 === this.calls.length && this.send(), r2.promise;
|
|
639
558
|
}
|
|
640
559
|
sendMutate() {
|
|
@@ -649,9 +568,9 @@ class P extends _ {
|
|
|
649
568
|
});
|
|
650
569
|
}
|
|
651
570
|
}
|
|
652
|
-
class
|
|
571
|
+
class I {
|
|
653
572
|
constructor(e2, t2, s2) {
|
|
654
|
-
this.pendingBatch = null, this.connection = new
|
|
573
|
+
this.pendingBatch = null, this.connection = new k(e2, t2, s2);
|
|
655
574
|
}
|
|
656
575
|
call(e2, t2, s2) {
|
|
657
576
|
return __async(this, null, function* () {
|
|
@@ -670,18 +589,18 @@ class U {
|
|
|
670
589
|
return this.connection.isConnected();
|
|
671
590
|
}
|
|
672
591
|
createEmptyBatchFor(e2, t2) {
|
|
673
|
-
if (
|
|
674
|
-
if (
|
|
592
|
+
if (S.isCorrectBatchTypeFor(e2, t2)) return new S(this.connection, () => this.pendingBatch = null);
|
|
593
|
+
if (D.isCorrectBatchTypeFor(e2, t2)) {
|
|
675
594
|
const e3 = t2[1];
|
|
676
|
-
return new
|
|
595
|
+
return new D(e3, this.connection, () => this.pendingBatch = null);
|
|
677
596
|
}
|
|
678
597
|
return null;
|
|
679
598
|
}
|
|
680
599
|
}
|
|
681
|
-
const
|
|
682
|
-
class
|
|
600
|
+
const F = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
|
|
601
|
+
class B {
|
|
683
602
|
constructor(e2, t2, s2) {
|
|
684
|
-
this.throttler = new
|
|
603
|
+
this.throttler = new M(), this.alive = true, this.connection = new I(e2, t2, s2);
|
|
685
604
|
}
|
|
686
605
|
call(e2, t2, s2) {
|
|
687
606
|
return __async(this, null, function* () {
|
|
@@ -690,7 +609,7 @@ class $ {
|
|
|
690
609
|
const r2 = yield this.connection.call(e2, t2, s2);
|
|
691
610
|
if ((r2.ok || "client" !== r2.where || "SOCKET_NOT_READY" !== r2.value) && (r2.ok || "server" !== r2.where || 500 !== r2.value.status) || n2++, 10 === n2) return r2;
|
|
692
611
|
if (r2.ok || "client" !== r2.where) {
|
|
693
|
-
const e3 = r2.value, t3 = e3.status, s3 =
|
|
612
|
+
const e3 = r2.value, t3 = e3.status, s3 = F[t3];
|
|
694
613
|
if ("RESOLVE" === s3) return this.throttler.resetDelay(), r2;
|
|
695
614
|
if ("RETRY" === s3) continue;
|
|
696
615
|
if ("DELAY" === s3) {
|
|
@@ -699,10 +618,10 @@ class $ {
|
|
|
699
618
|
}
|
|
700
619
|
return console.warn("[TalkJS] Unexpected status code", t3), e3;
|
|
701
620
|
}
|
|
702
|
-
if ("SESSION_DESTROYED" === r2.value) return
|
|
621
|
+
if ("SESSION_DESTROYED" === r2.value) return l("SESSION_DESTROYED");
|
|
703
622
|
"WEBSOCKET_DISCONNECTED" !== r2.value && ("SOCKET_NOT_READY" !== r2.value ? r2.value : yield this.throttler.wait());
|
|
704
623
|
}
|
|
705
|
-
return
|
|
624
|
+
return l("SESSION_DESTROYED");
|
|
706
625
|
});
|
|
707
626
|
}
|
|
708
627
|
destroy() {
|
|
@@ -712,7 +631,7 @@ class $ {
|
|
|
712
631
|
return this.connection.isConnected();
|
|
713
632
|
}
|
|
714
633
|
}
|
|
715
|
-
class
|
|
634
|
+
class M {
|
|
716
635
|
constructor() {
|
|
717
636
|
this.initialDelayMs = 200, this.exponentialFactor = 1.2, this.maxDelayMs = 3e4, this.currentDelayMs = this.initialDelayMs, this.lastCall = 0;
|
|
718
637
|
}
|
|
@@ -727,21 +646,21 @@ class W {
|
|
|
727
646
|
this.currentDelayMs = this.initialDelayMs;
|
|
728
647
|
}
|
|
729
648
|
}
|
|
730
|
-
function
|
|
649
|
+
function R(e2) {
|
|
731
650
|
return e2.map((e3) => encodeURIComponent(e3)).join();
|
|
732
651
|
}
|
|
733
|
-
class
|
|
652
|
+
class O {
|
|
734
653
|
constructor() {
|
|
735
654
|
this.paths = {};
|
|
736
655
|
}
|
|
737
656
|
add(e2) {
|
|
738
|
-
this.paths[
|
|
657
|
+
this.paths[R(e2)] = e2;
|
|
739
658
|
}
|
|
740
659
|
delete(e2) {
|
|
741
|
-
delete this.paths[
|
|
660
|
+
delete this.paths[R(e2)];
|
|
742
661
|
}
|
|
743
662
|
has(e2) {
|
|
744
|
-
return Object.hasOwnProperty.call(this.paths,
|
|
663
|
+
return Object.hasOwnProperty.call(this.paths, R(e2));
|
|
745
664
|
}
|
|
746
665
|
clear() {
|
|
747
666
|
this.paths = {};
|
|
@@ -750,9 +669,9 @@ class H {
|
|
|
750
669
|
Object.values(this.paths).forEach((t2) => e2(t2));
|
|
751
670
|
}
|
|
752
671
|
}
|
|
753
|
-
class
|
|
672
|
+
class _ {
|
|
754
673
|
constructor(e2, t2, s2) {
|
|
755
|
-
this.handlers = s2, this.targetSubscriptions = new
|
|
674
|
+
this.handlers = s2, this.targetSubscriptions = new O(), this.connection = new B(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
|
|
756
675
|
this.targetSubscriptions.forEach((e3) => {
|
|
757
676
|
this.resubscribe(e3);
|
|
758
677
|
}), this.handlers.onResubscribeSent();
|
|
@@ -786,10 +705,10 @@ class L {
|
|
|
786
705
|
return this.connection.isConnected();
|
|
787
706
|
}
|
|
788
707
|
}
|
|
789
|
-
function
|
|
708
|
+
function N(e2, t2) {
|
|
790
709
|
return void 0 === t2 ? e2 : t2;
|
|
791
710
|
}
|
|
792
|
-
function
|
|
711
|
+
function P(e2, t2) {
|
|
793
712
|
if (void 0 === t2) return e2;
|
|
794
713
|
if (null === t2) return {};
|
|
795
714
|
const s2 = __spreadValues({}, e2);
|
|
@@ -799,25 +718,25 @@ function G(e2, t2) {
|
|
|
799
718
|
}
|
|
800
719
|
return s2;
|
|
801
720
|
}
|
|
802
|
-
function
|
|
721
|
+
function U(e2, t2) {
|
|
803
722
|
if (e2 === t2) return true;
|
|
804
723
|
if (!e2 || !t2) return false;
|
|
805
724
|
if ("object" != typeof e2 || "object" != typeof t2) return false;
|
|
806
725
|
if (e2.constructor !== t2.constructor) return false;
|
|
807
726
|
if (Array.isArray(e2) && Array.isArray(t2)) {
|
|
808
727
|
if (e2.length !== t2.length) return false;
|
|
809
|
-
for (let s2 = 0; s2 < e2.length; s2++) if (!
|
|
728
|
+
for (let s2 = 0; s2 < e2.length; s2++) if (!U(e2[s2], t2[s2])) return false;
|
|
810
729
|
} else {
|
|
811
730
|
const s2 = Object.keys(e2);
|
|
812
731
|
if (s2.length !== Object.keys(t2).length) return false;
|
|
813
732
|
for (const n2 of s2) {
|
|
814
733
|
if (!Object.hasOwnProperty.call(t2, n2)) return false;
|
|
815
|
-
if (!
|
|
734
|
+
if (!U(e2[n2], t2[n2])) return false;
|
|
816
735
|
}
|
|
817
736
|
}
|
|
818
737
|
return true;
|
|
819
738
|
}
|
|
820
|
-
class
|
|
739
|
+
class j {
|
|
821
740
|
constructor() {
|
|
822
741
|
this.prev = Promise.resolve();
|
|
823
742
|
}
|
|
@@ -828,14 +747,14 @@ class Y {
|
|
|
828
747
|
});
|
|
829
748
|
}
|
|
830
749
|
}
|
|
831
|
-
class
|
|
750
|
+
class W {
|
|
832
751
|
constructor(e2, t2) {
|
|
833
|
-
this.onTeardown = t2, this.error = null, this.lastLoadedState = void 0, this.lastGoodState = Promise.resolve(void 0), this.initialised = false, this.getDeepMutex = new
|
|
834
|
-
const s2 = new Promise((e3) => setTimeout(e3)).then(() => __async(this, null, function* () {
|
|
835
|
-
const
|
|
836
|
-
return this.initialised = true,
|
|
837
|
-
}))
|
|
838
|
-
this.lastState =
|
|
752
|
+
this.onTeardown = t2, this.error = null, this.lastLoadedState = void 0, this.lastGoodState = Promise.resolve(void 0), this.initialised = false, this.getDeepMutex = new j(), this.lastDeep = void 0;
|
|
753
|
+
const s2 = { seq: 0, resultPromise: new Promise((e3) => setTimeout(e3)).then(() => __async(this, null, function* () {
|
|
754
|
+
const e3 = yield this.fetchInitial(0);
|
|
755
|
+
return this.initialised = true, e3;
|
|
756
|
+
})) };
|
|
757
|
+
this.lastState = s2, this.states = [s2], this.lastLoadedState = void 0;
|
|
839
758
|
}
|
|
840
759
|
set lastState(e2) {
|
|
841
760
|
const t2 = this.lastGoodState;
|
|
@@ -851,7 +770,7 @@ class K {
|
|
|
851
770
|
const t2 = this.lastGoodState, s2 = this.fetchInitial(e2), [n2, r2] = yield Promise.all([t2, s2]);
|
|
852
771
|
if (void 0 === n2) return r2;
|
|
853
772
|
if (!r2.ok) return r2;
|
|
854
|
-
return this.equal(n2, r2.value) ?
|
|
773
|
+
return this.equal(n2, r2.value) ? c(n2) : r2;
|
|
855
774
|
});
|
|
856
775
|
}
|
|
857
776
|
refetch(e2) {
|
|
@@ -871,15 +790,12 @@ class K {
|
|
|
871
790
|
return this.getDeepMutex.runExclusive(() => __async(this, null, function* () {
|
|
872
791
|
if (this.error) return this.error;
|
|
873
792
|
if (this.lastLoadedState && e2 < this.lastLoadedState.seq) throw `Trying to load state ${e2} when we have previously loaded ${this.lastLoadedState.seq}`;
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
t2
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
if (!n2.ok) return n2;
|
|
881
|
-
const r2 = yield this.loadNested(e2, n2.value);
|
|
882
|
-
return r2.ok && this.lastDeep && r2.value.lastChanged === this.lastDeep.value.lastChanged ? this.lastDeep : (r2.ok ? this.lastDeep = r2 : this.setError(r2), r2);
|
|
793
|
+
for (; this.states.length && this.states[0].seq <= e2; ) this.lastLoadedState = this.states.shift();
|
|
794
|
+
if (void 0 === this.lastLoadedState) throw `[TalkJS] Tried to load state ${e2} which is before the store was created`;
|
|
795
|
+
const t2 = yield this.lastLoadedState.resultPromise;
|
|
796
|
+
if (!t2.ok) return t2;
|
|
797
|
+
const s2 = yield this.loadNested(e2, t2.value);
|
|
798
|
+
return s2.ok && this.lastDeep && s2.value.lastChanged === this.lastDeep.value.lastChanged ? this.lastDeep : (s2.ok ? this.lastDeep = s2 : this.setError(s2), s2);
|
|
883
799
|
}));
|
|
884
800
|
});
|
|
885
801
|
}
|
|
@@ -890,9 +806,9 @@ class K {
|
|
|
890
806
|
}));
|
|
891
807
|
}
|
|
892
808
|
}
|
|
893
|
-
class
|
|
809
|
+
class $ extends W {
|
|
894
810
|
constructor(e2, t2, s2) {
|
|
895
|
-
super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new
|
|
811
|
+
super(e2, s2), this.emitMutex = t2, this.unsubscribeTimer = new q(), this.referencedByOtherStores = 0, this.listeners = [], this.lastEmitSeq = void 0, this.lastEmitResult = void 0, t2.runExclusive(() => __async(this, null, function* () {
|
|
896
812
|
yield this.emit(e2);
|
|
897
813
|
}));
|
|
898
814
|
}
|
|
@@ -913,7 +829,7 @@ class Q extends K {
|
|
|
913
829
|
}
|
|
914
830
|
startUnsubscribeTimerIfOrphan() {
|
|
915
831
|
0 === this.referencedByOtherStores && 0 === this.listeners.length && this.unsubscribeTimer.restart(() => {
|
|
916
|
-
this.setError(
|
|
832
|
+
this.setError(l("UNSUBSCRIBED"));
|
|
917
833
|
}, this.unsubscribeDebounceMs);
|
|
918
834
|
}
|
|
919
835
|
emit(e2) {
|
|
@@ -928,7 +844,7 @@ class Q extends K {
|
|
|
928
844
|
});
|
|
929
845
|
}
|
|
930
846
|
}
|
|
931
|
-
class
|
|
847
|
+
class q {
|
|
932
848
|
constructor() {
|
|
933
849
|
this.timerId = void 0;
|
|
934
850
|
}
|
|
@@ -939,45 +855,45 @@ class V {
|
|
|
939
855
|
clearTimeout(this.timerId);
|
|
940
856
|
}
|
|
941
857
|
}
|
|
942
|
-
class
|
|
858
|
+
class H extends $ {
|
|
943
859
|
constructor(e2, t2, s2, n2, r2) {
|
|
944
860
|
super(e2, n2, r2), this.userId = t2, this.realtimeClient = s2, this.unsubscribeDebounceMs = 1e4;
|
|
945
861
|
}
|
|
946
862
|
fetchInitial(e2) {
|
|
947
863
|
return __async(this, null, function* () {
|
|
948
864
|
const t2 = yield this.realtimeClient.call("GET", ["users", this.userId], { includePrivateFields: false }, { bypassCache: true });
|
|
949
|
-
return t2.ok ?
|
|
865
|
+
return t2.ok ? c({ snapshot: this.realtimeClient.createUserSnapshot(t2.value.data), lastChanged: e2 }) : "server" === t2.where && 404 === t2.value.status ? c({ snapshot: null, lastChanged: e2 }) : t2;
|
|
950
866
|
});
|
|
951
867
|
}
|
|
952
868
|
equal(e2, t2) {
|
|
953
|
-
return
|
|
869
|
+
return U(e2.snapshot, t2.snapshot);
|
|
954
870
|
}
|
|
955
871
|
loadNested(e2, t2) {
|
|
956
872
|
return __async(this, null, function* () {
|
|
957
|
-
return
|
|
873
|
+
return c(t2);
|
|
958
874
|
});
|
|
959
875
|
}
|
|
960
876
|
userCreated(e2, t2) {
|
|
961
|
-
this.mutate(e2, () =>
|
|
877
|
+
this.mutate(e2, () => c({ snapshot: this.realtimeClient.createUserSnapshot(t2.state), lastChanged: e2 }));
|
|
962
878
|
}
|
|
963
879
|
userEdited(e2, t2) {
|
|
964
880
|
this.mutate(e2, (s2) => {
|
|
965
881
|
const n2 = s2.value.snapshot;
|
|
966
882
|
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
967
|
-
return
|
|
883
|
+
return c({ snapshot: { id: n2.id, name: N(n2.name, t2.diff.name), custom: P(n2.custom, t2.diff.custom), locale: N(n2.locale, t2.diff.locale), photoUrl: N(n2.photoUrl, t2.diff.photoUrl), role: N(n2.role, t2.diff.role), welcomeMessage: N(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
|
|
968
884
|
});
|
|
969
885
|
}
|
|
970
886
|
getFromCache() {
|
|
971
887
|
return __async(this, null, function* () {
|
|
972
888
|
const e2 = yield this.lastState.resultPromise;
|
|
973
|
-
return e2.ok ? null === e2.value.snapshot ?
|
|
889
|
+
return e2.ok ? null === e2.value.snapshot ? h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["That user does not exist yet"] }) : c({ status: 200, data: { id: e2.value.snapshot.id, name: e2.value.snapshot.name, custom: e2.value.snapshot.custom, locale: e2.value.snapshot.locale, photoUrl: e2.value.snapshot.photoUrl, role: e2.value.snapshot.role, welcomeMessage: e2.value.snapshot.welcomeMessage } }) : l("NOT_IN_CACHE");
|
|
974
890
|
});
|
|
975
891
|
}
|
|
976
892
|
teardownNested(e2) {
|
|
977
893
|
}
|
|
978
894
|
}
|
|
979
|
-
const
|
|
980
|
-
function
|
|
895
|
+
const L = /\uFE0F/g, G = String.fromCharCode(8205);
|
|
896
|
+
function z(e2) {
|
|
981
897
|
if (":arslan:" === e2.text) return ":arslan:";
|
|
982
898
|
const t2 = function({ text: e3, kind: t3 }) {
|
|
983
899
|
var _a2;
|
|
@@ -986,44 +902,44 @@ function te(e2) {
|
|
|
986
902
|
let s3 = 0, n2 = 0, r2 = 0;
|
|
987
903
|
for (; r2 < e4.length; ) s3 = e4.charCodeAt(r2++), n2 ? (t4.push((65536 + (n2 - 55296 << 10) + (s3 - 56320)).toString(16)), n2 = 0) : 55296 <= s3 && s3 <= 56319 ? n2 = s3 : t4.push(s3.toString(16));
|
|
988
904
|
return t4.join("-");
|
|
989
|
-
}((s2 = e3).indexOf(
|
|
905
|
+
}((s2 = e3).indexOf(G) < 0 ? s2.replace(L, "") : s2) : (_a2 = Y[e3]) != null ? _a2 : function(e4) {
|
|
990
906
|
if (/;-?\)/.test(e4)) return "1f609";
|
|
991
907
|
if (e4 = e4.replace(/;/g, ":"), /:-o/i.test(e4)) return "1f631";
|
|
992
|
-
return e4 = e4.replace(/-/g, "").toLowerCase(),
|
|
908
|
+
return e4 = e4.replace(/-/g, "").toLowerCase(), J[e4];
|
|
993
909
|
}(e3);
|
|
994
910
|
var s2;
|
|
995
911
|
}(e2);
|
|
996
912
|
return t2 ? String.fromCodePoint(parseInt(t2, 16)) : e2.text;
|
|
997
913
|
}
|
|
998
|
-
const
|
|
999
|
-
var
|
|
1000
|
-
function
|
|
914
|
+
const J = { ":)": "1f642", ":o": "1f62e", ":]": "1f60f", ":d": "1f600", xd: "1f61d", ":p": "1f61c", ":@": "1f621", ":[": "1f621", ":(": "1f626", ":'(": "1f62d", ":’(": "1f62d", ":*": "1f618", ":/": "1f614", ":s": "1f616", ":|": "1f633", ":$": "263a", ":x": "1f637", "<3": "2764", "</3": "1f494" }, Y = { ":thumbsup:": "1f44d", ":thumbsdown:": "1f44e", ":poop:": "1f4a9" };
|
|
915
|
+
var Q, K = {};
|
|
916
|
+
function V(e2, t2) {
|
|
1001
917
|
const s2 = t2.lastIndex;
|
|
1002
918
|
let n2;
|
|
1003
919
|
const r2 = [];
|
|
1004
920
|
for (; null !== (n2 = t2.exec(e2)); ) r2.push(n2);
|
|
1005
921
|
return t2.lastIndex = s2, r2;
|
|
1006
922
|
}
|
|
1007
|
-
function
|
|
923
|
+
function Z(e2) {
|
|
1008
924
|
const t2 = e2.replace(/%2F/g, "/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/, "$1");
|
|
1009
925
|
return decodeURIComponent(t2);
|
|
1010
926
|
}
|
|
1011
|
-
function
|
|
927
|
+
function X(e2, t2) {
|
|
1012
928
|
if (!e2() && !t2) {
|
|
1013
929
|
t2 = e2.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/, "`$1`") + " was not true";
|
|
1014
930
|
}
|
|
1015
931
|
}
|
|
1016
932
|
!function() {
|
|
1017
|
-
if (
|
|
933
|
+
if (Q) return K;
|
|
1018
934
|
function e2(e3) {
|
|
1019
935
|
return String.fromCharCode(parseInt(e3.slice(1), 16));
|
|
1020
936
|
}
|
|
1021
937
|
function t2(e3) {
|
|
1022
938
|
return `%${`00${e3.charCodeAt(0).toString(16)}`.slice(-2)}`;
|
|
1023
939
|
}
|
|
1024
|
-
|
|
940
|
+
Q = 1, Object.defineProperty(K, "__esModule", { value: true }), K.encode = function(t3) {
|
|
1025
941
|
return btoa(encodeURIComponent(t3).replace(/%[0-9A-F]{2}/g, e2));
|
|
1026
|
-
},
|
|
942
|
+
}, K.decode = function(e3) {
|
|
1027
943
|
return decodeURIComponent(Array.from(atob(e3), t2).join(""));
|
|
1028
944
|
};
|
|
1029
945
|
}(), ((e2) => {
|
|
@@ -1055,53 +971,53 @@ function ue(e2, t2) {
|
|
|
1055
971
|
}, e2.optional = function(e3, t3) {
|
|
1056
972
|
void 0 !== e3 && s2(e3, t3);
|
|
1057
973
|
}, e2.falsy = function(e3) {
|
|
1058
|
-
}, e2.never = function() {
|
|
974
|
+
}, e2.never = function(e3) {
|
|
1059
975
|
};
|
|
1060
|
-
})(
|
|
1061
|
-
const
|
|
1062
|
-
function
|
|
1063
|
-
if (!
|
|
1064
|
-
return !
|
|
976
|
+
})(X || (X = {}));
|
|
977
|
+
const ee = X, te = /^\/.*[^\\]\/[im]*$/;
|
|
978
|
+
function se(e2) {
|
|
979
|
+
if (!te.test(e2)) return false;
|
|
980
|
+
return !ne(e2).test("");
|
|
1065
981
|
}
|
|
1066
|
-
function
|
|
982
|
+
function ne(e2) {
|
|
1067
983
|
const t2 = e2.match(/^\/(.*[^\\])\/(.*)$/);
|
|
1068
984
|
if (!t2) throw new Error(`Expected ${e2} to be a (non-empty) regex`);
|
|
1069
985
|
let s2 = t2[2] || "";
|
|
1070
986
|
return s2 = s2.replace(/[^im]/g, "") + "g", new RegExp(t2[1], s2);
|
|
1071
987
|
}
|
|
1072
|
-
class
|
|
988
|
+
class re {
|
|
1073
989
|
constructor({ mode: e2, allowedHostnames: t2, allowedPhoneNrs: s2, allowedMatches: n2, forbiddenMatches: r2, suppressLinks: i2, suppressEmailAddresses: a2, suppressPhoneNumbers: o2, replacement: u2 }) {
|
|
1074
|
-
|
|
990
|
+
ee.oneOf(e2, ["all", "otherOnly", "off"]), this.mode = e2, this.suppressLinks = false !== i2, this.suppressEmailAddresses = false !== a2, this.suppressPhoneNumbers = false !== o2, this.allowedHostnames = t2 || [], this.allowedPhoneNrs = (s2 || []).filter((e3) => e3).map((e3) => e3.replace(/[^0-9]/g, "")), this.allowedMatches = (n2 || []).filter(se).map((e3) => ne(e3)), this.forbiddenMatches = (r2 || []).filter(se).map((e3) => ne(e3)), ee(() => this.allowedMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"), ee(() => this.forbiddenMatches.every((e3) => e3.flags.includes("g")), "All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"), u2 = u2 == null ? void 0 : u2.trim(), this.replacement = u2 && u2.length > 0 ? u2 : void 0;
|
|
1075
991
|
}
|
|
1076
992
|
shouldSuppress({ isContentBySender: e2 }) {
|
|
1077
993
|
return "all" === this.mode || "otherOnly" === this.mode && !e2;
|
|
1078
994
|
}
|
|
1079
995
|
}
|
|
1080
|
-
function
|
|
996
|
+
function ie(e2, t2) {
|
|
1081
997
|
const s2 = e2.map((e3) => function(e4, t3) {
|
|
1082
998
|
if ("text" === e4.type) return function(e5, t4) {
|
|
1083
999
|
const s3 = function(e6) {
|
|
1084
1000
|
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l;
|
|
1085
1001
|
let t5 = "";
|
|
1086
|
-
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], emojis: (_e2 = e6.emojis) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new
|
|
1002
|
+
return e6.t && (t5 = `(${e6.t("CONTACT_INFORMATION_HIDDEN")})`), { formattedLinks: (_a2 = e6.formattedLinks) != null ? _a2 : "plaintext", markup: (_b = e6.markup) != null ? _b : false, useFallbackMentions: (_c = e6.useFallbackMentions) != null ? _c : false, sameTabLinkRules: (_d = e6.sameTabLinkRules) != null ? _d : [], emojis: (_e2 = e6.emojis) != null ? _e2 : false, highlight: (_f = e6.highlight) != null ? _f : [], contactInfo: (_g = e6.contactInfo) != null ? _g : false, suppression: (_h = e6.suppression) != null ? _h : new re({ mode: "off" }), contactInfoHiddenText: (_k = (_j = e6.contactInfoHiddenText) != null ? _j : (_i = e6.suppression) == null ? void 0 : _i.replacement) != null ? _k : t5, customEmojiUrls: (_l = e6.customEmojiUrls) != null ? _l : {} };
|
|
1087
1003
|
}(t4);
|
|
1088
|
-
return
|
|
1004
|
+
return ae(e5, s3);
|
|
1089
1005
|
}(e4.children, t3);
|
|
1090
|
-
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${
|
|
1091
|
-
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${
|
|
1092
|
-
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${
|
|
1006
|
+
if ("file" === e4.type && "video" === e4.subtype) return `🎥 ${Z(e4.url)}`;
|
|
1007
|
+
if ("file" === e4.type && "image" === e4.subtype) return `📷 ${Z(e4.url)}`;
|
|
1008
|
+
if ("file" === e4.type && "audio" === e4.subtype) return `🎧 ${Z(e4.url)}`;
|
|
1093
1009
|
if ("file" === e4.type && "voice" === e4.subtype) {
|
|
1094
1010
|
const t4 = e4.duration;
|
|
1095
1011
|
if (void 0 === t4) return "🎙️";
|
|
1096
1012
|
return `🎙️ (${Math.floor(t4 / 60)}:${Math.floor(t4 % 60).toString().padStart(2, "0")})`;
|
|
1097
1013
|
}
|
|
1098
|
-
if ("file" === e4.type) return e4.subtype, `📎 ${
|
|
1014
|
+
if ("file" === e4.type) return e4.subtype, `📎 ${Z(e4.url)}`;
|
|
1099
1015
|
if ("location" === e4.type) return "📍";
|
|
1100
1016
|
return "";
|
|
1101
1017
|
}(e3, t2));
|
|
1102
1018
|
return s2.join("\n\n");
|
|
1103
1019
|
}
|
|
1104
|
-
function
|
|
1020
|
+
function ae(e2, t2) {
|
|
1105
1021
|
return e2.flatMap((e3) => {
|
|
1106
1022
|
if ("string" == typeof e3) return e3;
|
|
1107
1023
|
switch (e3.type) {
|
|
@@ -1114,13 +1030,13 @@ function me(e2, t2) {
|
|
|
1114
1030
|
case "actionLink":
|
|
1115
1031
|
case "actionbutton":
|
|
1116
1032
|
case "actionButton":
|
|
1117
|
-
return
|
|
1033
|
+
return ae(e3.children, t2);
|
|
1118
1034
|
case "bulletlist":
|
|
1119
1035
|
case "bulletList":
|
|
1120
|
-
return "\n" +
|
|
1036
|
+
return "\n" + ae(e3.children, t2);
|
|
1121
1037
|
case "bulletpoint":
|
|
1122
1038
|
case "bulletPoint":
|
|
1123
|
-
return "- " +
|
|
1039
|
+
return "- " + ae(e3.children, t2) + "\n";
|
|
1124
1040
|
case "autolink":
|
|
1125
1041
|
case "autoLink":
|
|
1126
1042
|
case "codeblock":
|
|
@@ -1135,11 +1051,11 @@ function me(e2, t2) {
|
|
|
1135
1051
|
case "mention":
|
|
1136
1052
|
return `@${e3.text}`;
|
|
1137
1053
|
case "emoji":
|
|
1138
|
-
return "images" === t2.emojis ? "" : "unicode" === t2.emojis ?
|
|
1054
|
+
return "images" === t2.emojis ? "" : "unicode" === t2.emojis ? z(e3) : e3.text;
|
|
1139
1055
|
}
|
|
1140
1056
|
}).join("");
|
|
1141
1057
|
}
|
|
1142
|
-
class
|
|
1058
|
+
class oe extends W {
|
|
1143
1059
|
constructor(e2, t2, s2, n2) {
|
|
1144
1060
|
super(e2), this.conversationId = t2, this.message = s2, this.realtimeClient = n2;
|
|
1145
1061
|
}
|
|
@@ -1155,14 +1071,14 @@ class ge extends K {
|
|
|
1155
1071
|
if (!e3.ok) return e3;
|
|
1156
1072
|
t2 = e3.value.data;
|
|
1157
1073
|
}
|
|
1158
|
-
return
|
|
1074
|
+
return c({ lastChanged: e2, sender: null === t2.senderId ? null : this.realtimeClient.internalSubscribe(["users", t2.senderId]), data: { id: t2.id, type: t2.type, custom: t2.custom, createdAt: t2.createdAt, editedAt: t2.editedAt, referencedMessageId: t2.referencedMessageId, origin: t2.origin, plaintext: ie(t2.content, {}), content: t2.content } });
|
|
1159
1075
|
});
|
|
1160
1076
|
}
|
|
1161
1077
|
refetch(e2) {
|
|
1162
1078
|
throw "Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead";
|
|
1163
1079
|
}
|
|
1164
1080
|
equal(e2, t2) {
|
|
1165
|
-
return
|
|
1081
|
+
return U(e2.data, t2.data);
|
|
1166
1082
|
}
|
|
1167
1083
|
teardownNested(e2) {
|
|
1168
1084
|
var _a2;
|
|
@@ -1173,34 +1089,34 @@ class ge extends K {
|
|
|
1173
1089
|
var _a2, _b, _c, _d;
|
|
1174
1090
|
const s2 = yield (_b = (_a2 = t2.sender) == null ? void 0 : _a2.store) == null ? void 0 : _b.getDeep(e2);
|
|
1175
1091
|
if (false === (s2 == null ? void 0 : s2.ok)) return s2;
|
|
1176
|
-
if (null === t2.data) return
|
|
1092
|
+
if (null === t2.data) return c({ lastChanged: t2.lastChanged, snapshot: null });
|
|
1177
1093
|
const n2 = s2 == null ? void 0 : s2.value;
|
|
1178
|
-
return
|
|
1094
|
+
return c({ lastChanged: Math.max(t2.lastChanged, (_c = n2 == null ? void 0 : n2.lastChanged) != null ? _c : 0), snapshot: { sender: (_d = n2 == null ? void 0 : n2.snapshot) != null ? _d : null, id: t2.data.id, type: t2.data.type, custom: t2.data.custom, createdAt: t2.data.createdAt, editedAt: t2.data.editedAt, origin: t2.data.origin, plaintext: ie(t2.data.content, {}), content: t2.data.content, referencedMessageId: t2.data.referencedMessageId } });
|
|
1179
1095
|
});
|
|
1180
1096
|
}
|
|
1181
1097
|
messageEdited(e2, t2) {
|
|
1182
1098
|
this.mutate(e2, (s2) => {
|
|
1183
1099
|
if (null === s2.value.data) return s2;
|
|
1184
|
-
return
|
|
1100
|
+
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: N(s2.value.data.editedAt, t2.diff.editedAt), custom: P(s2.value.data.custom, t2.diff.custom), content: N(s2.value.data.content, t2.diff.content) } });
|
|
1185
1101
|
});
|
|
1186
1102
|
}
|
|
1187
1103
|
messageDeleted(e2, t2) {
|
|
1188
|
-
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ?
|
|
1104
|
+
this.mutate(e2, (s2) => null === s2.value.data ? s2 : this.messageId === t2.messageId ? c({ lastChanged: e2, sender: null, data: null }) : s2.value.data.referencedMessageId === t2.messageId ? c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: null, editedAt: s2.value.data.editedAt, custom: s2.value.data.custom, content: s2.value.data.content } }) : s2);
|
|
1189
1105
|
}
|
|
1190
1106
|
getFromCache() {
|
|
1191
1107
|
return __async(this, null, function* () {
|
|
1192
1108
|
var _b;
|
|
1193
1109
|
const e2 = yield this.lastState.resultPromise;
|
|
1194
|
-
if (!e2.ok) return
|
|
1110
|
+
if (!e2.ok) return l("NOT_IN_CACHE");
|
|
1195
1111
|
if (null === e2.value.data) {
|
|
1196
|
-
return
|
|
1112
|
+
return h({ status: 404, errorCode: "MESSAGE_NOT_FOUND", reasons: ["No message with that ID exists"] });
|
|
1197
1113
|
}
|
|
1198
1114
|
const _a2 = e2.value, { sender: t2 } = _a2, s2 = __objRest(_a2, ["sender"]);
|
|
1199
|
-
return
|
|
1115
|
+
return c({ status: 200, data: __spreadProps(__spreadValues({}, s2.data), { senderId: (_b = t2 == null ? void 0 : t2.store.userId) != null ? _b : null }) });
|
|
1200
1116
|
});
|
|
1201
1117
|
}
|
|
1202
1118
|
}
|
|
1203
|
-
class
|
|
1119
|
+
class ue extends W {
|
|
1204
1120
|
constructor(e2, t2, s2, n2) {
|
|
1205
1121
|
super(e2), this.createdAt = t2, this.dataStore = s2, this.referencedDataStore = n2;
|
|
1206
1122
|
}
|
|
@@ -1209,7 +1125,7 @@ class ve extends K {
|
|
|
1209
1125
|
}
|
|
1210
1126
|
fetchInitial(e2) {
|
|
1211
1127
|
return __async(this, null, function* () {
|
|
1212
|
-
return
|
|
1128
|
+
return c({ lastChanged: e2, dataStore: this.dataStore, referencedDataStore: this.referencedDataStore });
|
|
1213
1129
|
});
|
|
1214
1130
|
}
|
|
1215
1131
|
refetch(e2) {
|
|
@@ -1226,15 +1142,15 @@ class ve extends K {
|
|
|
1226
1142
|
const s2 = yield t2.dataStore.getDeep(e2);
|
|
1227
1143
|
if (!s2.ok) return s2;
|
|
1228
1144
|
const n2 = s2.value;
|
|
1229
|
-
if (null === n2.snapshot) return
|
|
1145
|
+
if (null === n2.snapshot) return c({ lastChanged: s2.value.lastChanged, snapshot: null });
|
|
1230
1146
|
const r2 = yield (_a2 = t2.referencedDataStore) == null ? void 0 : _a2.getDeep(e2);
|
|
1231
1147
|
if (r2 && !r2.ok) return r2;
|
|
1232
1148
|
const i2 = (_b = r2 == null ? void 0 : r2.value) != null ? _b : null, a2 = (_c = i2 == null ? void 0 : i2.snapshot) != null ? _c : null;
|
|
1233
|
-
return
|
|
1149
|
+
return c({ lastChanged: Math.max(n2.lastChanged, (_d = i2 == null ? void 0 : i2.lastChanged) != null ? _d : 0), snapshot: { id: n2.snapshot.id, type: n2.snapshot.type, sender: n2.snapshot.sender, custom: n2.snapshot.custom, createdAt: n2.snapshot.createdAt, editedAt: n2.snapshot.editedAt, referencedMessage: a2, origin: n2.snapshot.origin, plaintext: n2.snapshot.plaintext, content: n2.snapshot.content } });
|
|
1234
1150
|
});
|
|
1235
1151
|
}
|
|
1236
1152
|
}
|
|
1237
|
-
class
|
|
1153
|
+
class ce extends $ {
|
|
1238
1154
|
constructor(e2, t2, s2, n2, r2) {
|
|
1239
1155
|
super(e2, t2, r2), this.conversationId = s2, this.realtimeClient = n2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1240
1156
|
}
|
|
@@ -1248,23 +1164,23 @@ class be extends Q {
|
|
|
1248
1164
|
}
|
|
1249
1165
|
fetchInitial(e2) {
|
|
1250
1166
|
return __async(this, null, function* () {
|
|
1251
|
-
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield
|
|
1252
|
-
return s2.ok ? null === s2.value.messages ?
|
|
1167
|
+
const t2 = this.onlyUsedInternally ? 1 : 30, s2 = yield le({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: t2 });
|
|
1168
|
+
return s2.ok ? null === s2.value.messages ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : he({ seq: e2, messages: s2.value.messages, cursor: s2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : s2;
|
|
1253
1169
|
});
|
|
1254
1170
|
}
|
|
1255
1171
|
teardownNested(e2) {
|
|
1256
|
-
|
|
1172
|
+
de(e2);
|
|
1257
1173
|
}
|
|
1258
1174
|
equal(e2, t2) {
|
|
1259
|
-
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!
|
|
1175
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!U(Object.keys(e2.stores), Object.keys(t2.stores)) && (!!U(e2.inWindow.map((e3) => e3.messageId), t2.inWindow.map((e3) => e3.messageId)) && U(e2.windowEnd, t2.windowEnd)));
|
|
1260
1176
|
}
|
|
1261
1177
|
loadNested(e2, t2) {
|
|
1262
1178
|
return __async(this, null, function* () {
|
|
1263
|
-
if (null === t2.stores) return
|
|
1179
|
+
if (null === t2.stores) return c({ snapshot: null, loadedAll: true, lastChanged: t2.lastChanged });
|
|
1264
1180
|
const s2 = yield Promise.all(t2.inWindow.map((t3) => t3.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1265
1181
|
if (n2) return n2;
|
|
1266
1182
|
const r2 = s2, i2 = r2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot), a2 = Math.max(t2.lastChanged, ...r2.map((e3) => e3.value.lastChanged));
|
|
1267
|
-
return
|
|
1183
|
+
return c({ snapshot: i2, loadedAll: null === t2.windowEnd, lastChanged: a2 });
|
|
1268
1184
|
});
|
|
1269
1185
|
}
|
|
1270
1186
|
loadMore(e2) {
|
|
@@ -1279,8 +1195,8 @@ class be extends Q {
|
|
|
1279
1195
|
const t2 = yield this.lastState.resultPromise;
|
|
1280
1196
|
if (!t2.ok) return;
|
|
1281
1197
|
if (null === t2.value.windowEnd) return;
|
|
1282
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1283
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1198
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield le({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.lastState.seq + 1e-6;
|
|
1199
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.messages ? (console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."), e3) : he({ seq: r2, prevState: e3.value, messages: n2.value.messages, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1284
1200
|
});
|
|
1285
1201
|
}
|
|
1286
1202
|
messageCreated(e2, t2) {
|
|
@@ -1288,14 +1204,14 @@ class be extends Q {
|
|
|
1288
1204
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."), s2;
|
|
1289
1205
|
if (s2.value.windowEnd && t2.state.createdAt < s2.value.windowEnd.oldestMessageTs) return s2;
|
|
1290
1206
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1291
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1207
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new oe(e2, this.conversationId, t2.state, this.realtimeClient);
|
|
1292
1208
|
n2[t2.state.id] = r2;
|
|
1293
1209
|
const i2 = t2.state.referencedMessageId;
|
|
1294
1210
|
let a2;
|
|
1295
|
-
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new
|
|
1296
|
-
const o2 = new
|
|
1211
|
+
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new oe(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1212
|
+
const o2 = new ue(e2, t2.state.createdAt, r2, a2), u2 = [...s2.value.inWindow, o2];
|
|
1297
1213
|
u2.sort((e3, t3) => t3.createdAt - e3.createdAt);
|
|
1298
|
-
return
|
|
1214
|
+
return c({ lastChanged: e2, stores: n2, inWindow: u2, windowEnd: s2.value.windowEnd });
|
|
1299
1215
|
});
|
|
1300
1216
|
}
|
|
1301
1217
|
messageEdited(e2, t2) {
|
|
@@ -1312,74 +1228,74 @@ class be extends Q {
|
|
|
1312
1228
|
delete n2[t2.messageId];
|
|
1313
1229
|
const r2 = s2.value.inWindow.filter((e3) => e3.messageId !== t2.messageId);
|
|
1314
1230
|
if (t2.newLastMessage && 0 === r2.length) {
|
|
1315
|
-
const s3 = new
|
|
1231
|
+
const s3 = new oe(e2, this.conversationId, t2.newLastMessage, this.realtimeClient);
|
|
1316
1232
|
n2[s3.messageId] = s3;
|
|
1317
1233
|
const i2 = t2.newLastMessage.referencedMessageId;
|
|
1318
1234
|
let a2;
|
|
1319
|
-
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new
|
|
1320
|
-
const o2 = new
|
|
1235
|
+
null === i2 ? a2 = null : i2 in n2 ? a2 = n2[i2] : (a2 = new oe(e2, this.conversationId, i2, this.realtimeClient), n2[i2] = a2);
|
|
1236
|
+
const o2 = new ue(e2, t2.newLastMessage.createdAt, s3, a2);
|
|
1321
1237
|
r2.push(o2);
|
|
1322
1238
|
}
|
|
1323
|
-
return
|
|
1239
|
+
return c({ lastChanged: e2, stores: n2, inWindow: r2, windowEnd: s2.value.windowEnd });
|
|
1324
1240
|
});
|
|
1325
1241
|
}
|
|
1326
1242
|
conversationCleared(e2, t2) {
|
|
1327
|
-
this.mutate(e2, (t3) => (
|
|
1243
|
+
this.mutate(e2, (t3) => (de(t3.value), c({ lastChanged: e2, stores: {}, inWindow: [], windowEnd: null })));
|
|
1328
1244
|
}
|
|
1329
1245
|
sideCreated(e2, t2) {
|
|
1330
1246
|
const s2 = this.fetchInitial(e2);
|
|
1331
1247
|
this.mutate(e2, (e3) => null !== e3.value.stores ? (s2.then((e4) => {
|
|
1332
|
-
e4.ok &&
|
|
1248
|
+
e4.ok && de(e4.value);
|
|
1333
1249
|
}), e3) : s2);
|
|
1334
1250
|
}
|
|
1335
1251
|
sideDeleted(e2, t2) {
|
|
1336
|
-
this.mutate(e2, (t3) => (
|
|
1252
|
+
this.mutate(e2, (t3) => (de(t3.value), c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null })));
|
|
1337
1253
|
}
|
|
1338
1254
|
getMessageFromCache(e2) {
|
|
1339
1255
|
return __async(this, null, function* () {
|
|
1340
1256
|
const t2 = yield this.lastState.resultPromise;
|
|
1341
|
-
if (!t2.ok) return
|
|
1342
|
-
if (null === t2.value.stores) return
|
|
1257
|
+
if (!t2.ok) return l("NOT_IN_CACHE");
|
|
1258
|
+
if (null === t2.value.stores) return l("NOT_IN_CACHE");
|
|
1343
1259
|
const s2 = t2.value.stores[e2];
|
|
1344
|
-
return void 0 === s2 ?
|
|
1260
|
+
return void 0 === s2 ? l("NOT_IN_CACHE") : s2.getFromCache();
|
|
1345
1261
|
});
|
|
1346
1262
|
}
|
|
1347
1263
|
}
|
|
1348
|
-
function
|
|
1264
|
+
function le(_0) {
|
|
1349
1265
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1350
1266
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "messages"], r2, { bypassCache: true });
|
|
1351
1267
|
if (i2.ok) {
|
|
1352
1268
|
const { data: e3, cursor: t3 } = i2.value.data;
|
|
1353
|
-
return
|
|
1269
|
+
return c({ messages: e3, nextCursor: t3 });
|
|
1354
1270
|
}
|
|
1355
|
-
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 :
|
|
1271
|
+
return (i2.ok || "server" !== i2.where || 404 !== i2.value.status) && (i2.ok || "server" !== i2.where || 403 !== i2.value.status || "NOT_A_PARTICIPANT" !== i2.value.errorCode) ? i2 : c({ messages: null, nextCursor: null });
|
|
1356
1272
|
});
|
|
1357
1273
|
}
|
|
1358
|
-
function
|
|
1274
|
+
function he({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1359
1275
|
const a2 = t2 ? __spreadValues({}, t2.stores) : {};
|
|
1360
1276
|
for (const t3 of s2) if (void 0 === a2[t3.id]) {
|
|
1361
|
-
const s3 = new
|
|
1277
|
+
const s3 = new oe(e2, r2, t3, i2);
|
|
1362
1278
|
a2[s3.messageId] = s3;
|
|
1363
1279
|
}
|
|
1364
1280
|
for (const t3 of s2) {
|
|
1365
1281
|
const s3 = t3.referencedMessageId;
|
|
1366
1282
|
if (s3 && void 0 === a2[s3]) {
|
|
1367
|
-
const t4 = new
|
|
1283
|
+
const t4 = new oe(e2, r2, s3, i2);
|
|
1368
1284
|
a2[t4.messageId] = t4;
|
|
1369
1285
|
}
|
|
1370
1286
|
}
|
|
1371
1287
|
const o2 = t2 ? [...t2.inWindow] : [];
|
|
1372
|
-
for (const t3 of s2) o2.push(new
|
|
1373
|
-
if (o2.sort((e3, t3) => t3.createdAt - e3.createdAt), null === n2) return
|
|
1374
|
-
return
|
|
1288
|
+
for (const t3 of s2) o2.push(new ue(e2, t3.createdAt, a2[t3.id], t3.referencedMessageId ? a2[t3.referencedMessageId] : null));
|
|
1289
|
+
if (o2.sort((e3, t3) => t3.createdAt - e3.createdAt), null === n2) return c({ lastChanged: e2, stores: a2, inWindow: o2, windowEnd: null });
|
|
1290
|
+
return c({ lastChanged: e2, stores: a2, inWindow: o2, windowEnd: { cursor: n2, oldestMessageTs: s2[s2.length - 1].createdAt } });
|
|
1375
1291
|
}
|
|
1376
|
-
function
|
|
1292
|
+
function de(e2) {
|
|
1377
1293
|
if (e2.stores) {
|
|
1378
|
-
const t2 =
|
|
1294
|
+
const t2 = l("TERMINATED");
|
|
1379
1295
|
Object.values(e2.stores).forEach((e3) => e3.setError(t2)), e2.inWindow.forEach((e3) => e3.setError(t2));
|
|
1380
1296
|
}
|
|
1381
1297
|
}
|
|
1382
|
-
class
|
|
1298
|
+
class pe extends $ {
|
|
1383
1299
|
constructor(e2, t2, s2, n2, r2) {
|
|
1384
1300
|
super(e2, t2, r2), this.conversationId = s2, this.realtimeClient = n2, this.unsubscribeDebounceMs = 5e3;
|
|
1385
1301
|
}
|
|
@@ -1393,7 +1309,7 @@ class Ce extends Q {
|
|
|
1393
1309
|
if ("server" !== s2.where || 403 !== s2.value.status || "NOT_A_PARTICIPANT" !== s2.value.errorCode) return t2.unsubscribe(), s2;
|
|
1394
1310
|
n2 = null;
|
|
1395
1311
|
}
|
|
1396
|
-
return
|
|
1312
|
+
return c({ lastChanged: e2, snapshot: n2, messageWindowStore: t2 });
|
|
1397
1313
|
});
|
|
1398
1314
|
}
|
|
1399
1315
|
teardownNested(e2) {
|
|
@@ -1401,47 +1317,47 @@ class Ce extends Q {
|
|
|
1401
1317
|
(_a2 = e2.messageWindowStore) == null ? void 0 : _a2.unsubscribe();
|
|
1402
1318
|
}
|
|
1403
1319
|
equal(e2, t2) {
|
|
1404
|
-
return
|
|
1320
|
+
return U(e2.snapshot, t2.snapshot);
|
|
1405
1321
|
}
|
|
1406
1322
|
loadNested(e2, t2) {
|
|
1407
1323
|
return __async(this, null, function* () {
|
|
1408
1324
|
var _a2;
|
|
1409
|
-
if (!t2.snapshot) return
|
|
1325
|
+
if (!t2.snapshot) return c({ lastChanged: t2.lastChanged, snapshot: null, loadedAll: true });
|
|
1410
1326
|
const s2 = yield t2.messageWindowStore.store.getDeep(e2);
|
|
1411
1327
|
if (!s2.ok) return s2;
|
|
1412
1328
|
const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1413
|
-
return
|
|
1329
|
+
return c({ lastChanged: Math.max(t2.lastChanged, s2.value.lastChanged), snapshot: __spreadProps(__spreadValues({}, t2.snapshot), { lastMessage: r2 }) });
|
|
1414
1330
|
});
|
|
1415
1331
|
}
|
|
1416
1332
|
participantEdited(e2, t2) {
|
|
1417
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) :
|
|
1333
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: fe(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1418
1334
|
}
|
|
1419
1335
|
conversationEdited(e2, t2) {
|
|
1420
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) :
|
|
1336
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: fe(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1421
1337
|
}
|
|
1422
1338
|
sideEdited(e2, t2) {
|
|
1423
|
-
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) :
|
|
1339
|
+
this.mutate(e2, (s2) => null === s2.value.snapshot ? (console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."), s2) : c({ lastChanged: e2, snapshot: fe(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1424
1340
|
}
|
|
1425
1341
|
sideCreated(e2, t2) {
|
|
1426
|
-
this.mutate(e2, (s2) => s2.value.snapshot ? s2 :
|
|
1342
|
+
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
1427
1343
|
}
|
|
1428
1344
|
sideDeleted(e2, t2) {
|
|
1429
|
-
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 :
|
|
1345
|
+
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 : c({ lastChanged: e2, snapshot: null, messageWindowStore: t3.value.messageWindowStore }));
|
|
1430
1346
|
}
|
|
1431
1347
|
getFromCache() {
|
|
1432
1348
|
return __async(this, null, function* () {
|
|
1433
1349
|
const e2 = yield this.lastState.resultPromise;
|
|
1434
|
-
return e2.ok && e2.value.snapshot ?
|
|
1350
|
+
return e2.ok && e2.value.snapshot ? c({ status: 200, data: e2.value.snapshot }) : l("NOT_IN_CACHE");
|
|
1435
1351
|
});
|
|
1436
1352
|
}
|
|
1437
1353
|
}
|
|
1438
|
-
function
|
|
1354
|
+
function fe(e2, t2) {
|
|
1439
1355
|
const s2 = t2;
|
|
1440
|
-
return { id: e2.id, createdAt: e2.createdAt, subject:
|
|
1356
|
+
return { id: e2.id, createdAt: e2.createdAt, subject: N(e2.subject, s2.subject), photoUrl: N(e2.photoUrl, s2.photoUrl), welcomeMessages: N(e2.welcomeMessages, s2.welcomeMessages), custom: P(e2.custom, s2.custom), lastMessageAt: N(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: N(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: N(e2.isUnread, s2.isUnread), access: N(e2.access, s2.access), notify: N(e2.notify, s2.notify), joinedAt: e2.joinedAt };
|
|
1441
1357
|
}
|
|
1442
|
-
class
|
|
1358
|
+
class me {
|
|
1443
1359
|
constructor(e2, t2, s2) {
|
|
1444
|
-
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.emitMutex = new
|
|
1360
|
+
this.realtimeClient = s2, this.userStores = {}, this.messageWindowStores = {}, this.conversationStores = {}, this.emitMutex = new j(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new _(e2, t2, { onUpstreamRestarting: () => {
|
|
1445
1361
|
this.refetchOnNextNetworkLoss = false;
|
|
1446
1362
|
}, onReady: () => {
|
|
1447
1363
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1612,7 +1528,7 @@ class Ee {
|
|
|
1612
1528
|
this.connection.subscribe(["users", t2]).then((e4) => {
|
|
1613
1529
|
e4.ok || s2.setError(e4);
|
|
1614
1530
|
});
|
|
1615
|
-
const e3 = this.seq, s2 = new
|
|
1531
|
+
const e3 = this.seq, s2 = new H(e3, t2, this.realtimeClient, this.emitMutex, () => {
|
|
1616
1532
|
delete this.userStores[t2], this.connection.unsubscribe(["users", t2]);
|
|
1617
1533
|
});
|
|
1618
1534
|
return this.userStores[t2] = s2, s2;
|
|
@@ -1625,7 +1541,7 @@ class Ee {
|
|
|
1625
1541
|
this.connection.subscribe(["me", "conversations", t2]).then((t3) => {
|
|
1626
1542
|
t3.ok || e3.setError(t3);
|
|
1627
1543
|
});
|
|
1628
|
-
const e3 = new
|
|
1544
|
+
const e3 = new pe(this.seq, this.emitMutex, t2, this.realtimeClient, () => {
|
|
1629
1545
|
delete this.conversationStores[t2], this.connection.unsubscribe(["me", "conversations", t2]);
|
|
1630
1546
|
});
|
|
1631
1547
|
return this.conversationStores[t2] = e3, e3;
|
|
@@ -1638,7 +1554,7 @@ class Ee {
|
|
|
1638
1554
|
this.connection.subscribe(["me", "conversations", t2, "messages"]).then((t3) => {
|
|
1639
1555
|
t3.ok || e3.setError(t3);
|
|
1640
1556
|
});
|
|
1641
|
-
const e3 = new
|
|
1557
|
+
const e3 = new ce(this.seq, this.emitMutex, t2, this.realtimeClient, () => {
|
|
1642
1558
|
delete this.messageWindowStores[t2], this.connection.unsubscribe(["me", "conversations", t2, "messages"]);
|
|
1643
1559
|
});
|
|
1644
1560
|
return this.messageWindowStores[t2] = e3, e3;
|
|
@@ -1665,15 +1581,15 @@ class Ee {
|
|
|
1665
1581
|
return this.connection.isConnected();
|
|
1666
1582
|
}
|
|
1667
1583
|
}
|
|
1668
|
-
class
|
|
1584
|
+
class ge {
|
|
1669
1585
|
constructor(e2, t2, s2) {
|
|
1670
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
1586
|
+
this.userId = t2, this.alive = true, this.connection = new me(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
1671
1587
|
this.destroy();
|
|
1672
1588
|
});
|
|
1673
1589
|
}
|
|
1674
1590
|
call(_0, _1, _2) {
|
|
1675
1591
|
return __async(this, arguments, function* (e2, t2, s2, n2 = {}) {
|
|
1676
|
-
return this.alive ? this.connection.call(e2, t2, s2, n2) :
|
|
1592
|
+
return this.alive ? this.connection.call(e2, t2, s2, n2) : l("SESSION_DESTROYED");
|
|
1677
1593
|
});
|
|
1678
1594
|
}
|
|
1679
1595
|
subscribe(e2, t2) {
|
|
@@ -1692,10 +1608,10 @@ class xe {
|
|
|
1692
1608
|
listMessages(e2, t2) {
|
|
1693
1609
|
return __async(this, null, function* () {
|
|
1694
1610
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
1695
|
-
if (!s2.ok) return
|
|
1611
|
+
if (!s2.ok) return ve(s2, "Listing messages in " + e2);
|
|
1696
1612
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
1697
1613
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
1698
|
-
return
|
|
1614
|
+
return c(r2.map(({ value: e3 }) => e3));
|
|
1699
1615
|
});
|
|
1700
1616
|
}
|
|
1701
1617
|
createConversationSnapshotPreloaded(e2, t2) {
|
|
@@ -1709,49 +1625,49 @@ class xe {
|
|
|
1709
1625
|
}
|
|
1710
1626
|
createMessageSnapshot(e2, t2) {
|
|
1711
1627
|
return __async(this, null, function* () {
|
|
1712
|
-
const s2 = null === e2.senderId ? Promise.resolve(
|
|
1628
|
+
const s2 = null === e2.senderId ? Promise.resolve(c(null)) : this.getUser(e2.senderId), n2 = null === e2.referencedMessageId ? Promise.resolve(c(null)) : this.getReferencedMessage(t2, e2.referencedMessageId), r2 = yield s2;
|
|
1713
1629
|
if (!r2.ok) return r2;
|
|
1714
1630
|
const i2 = yield n2;
|
|
1715
1631
|
if (!i2.ok) return i2;
|
|
1716
|
-
return
|
|
1632
|
+
return c(this.createMessageSnapshotPreloaded(e2, r2.value, i2.value));
|
|
1717
1633
|
});
|
|
1718
1634
|
}
|
|
1719
1635
|
getReferencedMessage(e2, t2) {
|
|
1720
1636
|
return __async(this, null, function* () {
|
|
1721
1637
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
1722
|
-
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return
|
|
1723
|
-
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return
|
|
1724
|
-
if (!s2.ok) return
|
|
1638
|
+
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
1639
|
+
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
1640
|
+
if (!s2.ok) return ve(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
1725
1641
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
1726
1642
|
if (!r2.ok) return r2;
|
|
1727
1643
|
const i2 = r2.value;
|
|
1728
|
-
return
|
|
1644
|
+
return c(this.createReferencedMessageSnapshotPreloaded(n2, i2));
|
|
1729
1645
|
});
|
|
1730
1646
|
}
|
|
1731
1647
|
getUser(e2) {
|
|
1732
1648
|
return __async(this, null, function* () {
|
|
1733
1649
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
1734
|
-
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return
|
|
1735
|
-
if (!t2.ok) return
|
|
1736
|
-
return
|
|
1650
|
+
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
1651
|
+
if (!t2.ok) return ve(t2, "Get user " + e2);
|
|
1652
|
+
return c(this.createUserSnapshot(t2.value.data));
|
|
1737
1653
|
});
|
|
1738
1654
|
}
|
|
1739
1655
|
createMessageSnapshotPreloaded(e2, t2, s2) {
|
|
1740
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1656
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessage: s2, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: ie(e2.content, {}) };
|
|
1741
1657
|
}
|
|
1742
1658
|
createReferencedMessageSnapshotPreloaded(e2, t2) {
|
|
1743
|
-
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext:
|
|
1659
|
+
return { id: e2.id, type: e2.type, sender: t2, referencedMessageId: e2.referencedMessageId, custom: e2.custom, createdAt: e2.createdAt, editedAt: e2.editedAt, origin: e2.origin, content: e2.content, plaintext: ie(e2.content, {}) };
|
|
1744
1660
|
}
|
|
1745
1661
|
}
|
|
1746
|
-
function
|
|
1747
|
-
return "server" === e2.where ?
|
|
1662
|
+
function ve(e2, t2) {
|
|
1663
|
+
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
1748
1664
|
}
|
|
1749
|
-
function
|
|
1665
|
+
function be(e2, s2) {
|
|
1750
1666
|
var _a2;
|
|
1751
1667
|
if (s2.ok) return s2.value;
|
|
1752
1668
|
throw "SESSION_DESTROYED" === s2.value ? new Error(`${e2} failed because the session was destroyed`) : new Error(t((_a2 = s2.value.operation) != null ? _a2 : e2, s2.value));
|
|
1753
1669
|
}
|
|
1754
|
-
class
|
|
1670
|
+
class ye {
|
|
1755
1671
|
constructor(e2, t2) {
|
|
1756
1672
|
this.id = e2, this._realtimeClient = t2;
|
|
1757
1673
|
}
|
|
@@ -1761,7 +1677,7 @@ class De {
|
|
|
1761
1677
|
get() {
|
|
1762
1678
|
return __async(this, null, function* () {
|
|
1763
1679
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
1764
|
-
return
|
|
1680
|
+
return be("Get user " + this.id, e2);
|
|
1765
1681
|
});
|
|
1766
1682
|
}
|
|
1767
1683
|
set(t2) {
|
|
@@ -1782,7 +1698,7 @@ class De {
|
|
|
1782
1698
|
return this._realtimeClient.subscribe(["users", this.brandedId], e2);
|
|
1783
1699
|
}
|
|
1784
1700
|
}
|
|
1785
|
-
class
|
|
1701
|
+
class we {
|
|
1786
1702
|
constructor(e2, t2, s2) {
|
|
1787
1703
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
1788
1704
|
}
|
|
@@ -1826,7 +1742,7 @@ class Ie {
|
|
|
1826
1742
|
});
|
|
1827
1743
|
}
|
|
1828
1744
|
}
|
|
1829
|
-
function
|
|
1745
|
+
function Ae(e2) {
|
|
1830
1746
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
1831
1747
|
let s2 = 0;
|
|
1832
1748
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -1844,7 +1760,7 @@ function Fe(e2) {
|
|
|
1844
1760
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
1845
1761
|
return a2;
|
|
1846
1762
|
}
|
|
1847
|
-
const
|
|
1763
|
+
const Ce = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
1848
1764
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
1849
1765
|
}(e2, (e3) => {
|
|
1850
1766
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -1857,14 +1773,14 @@ const Be = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1857
1773
|
case "bulletList":
|
|
1858
1774
|
case "bulletpoint":
|
|
1859
1775
|
case "bulletPoint":
|
|
1860
|
-
return [{ type: e3.type, children:
|
|
1776
|
+
return [{ type: e3.type, children: Ce(e3.children, t2, e3.type) }];
|
|
1861
1777
|
case "link":
|
|
1862
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
1778
|
+
return [{ type: e3.type, url: e3.url, children: Ce(e3.children, t2, e3.type) }];
|
|
1863
1779
|
case "actionlink":
|
|
1864
1780
|
case "actionLink":
|
|
1865
1781
|
case "actionbutton":
|
|
1866
1782
|
case "actionButton":
|
|
1867
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
1783
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: Ce(e3.children, t2, e3.type) }];
|
|
1868
1784
|
case "mention":
|
|
1869
1785
|
case "autolink":
|
|
1870
1786
|
case "autoLink":
|
|
@@ -1879,12 +1795,12 @@ const Be = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
1879
1795
|
return [e3];
|
|
1880
1796
|
}
|
|
1881
1797
|
});
|
|
1882
|
-
function
|
|
1798
|
+
function Ee(e2, t2) {
|
|
1883
1799
|
return (s2) => {
|
|
1884
1800
|
const n2 = s2;
|
|
1885
1801
|
let r2 = 0;
|
|
1886
1802
|
const i2 = [];
|
|
1887
|
-
for (const a2 of
|
|
1803
|
+
for (const a2 of V(s2, e2)) {
|
|
1888
1804
|
a2.index - r2 > 0 && i2.push(n2.substring(r2, a2.index));
|
|
1889
1805
|
const e3 = t2(a2);
|
|
1890
1806
|
Array.isArray(e3) ? i2.push(...e3) : i2.push(e3), r2 = a2.index + a2[0].length;
|
|
@@ -1892,29 +1808,29 @@ function Me(e2, t2) {
|
|
|
1892
1808
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
1893
1809
|
};
|
|
1894
1810
|
}
|
|
1895
|
-
const
|
|
1896
|
-
var
|
|
1897
|
-
const
|
|
1811
|
+
const ke = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
1812
|
+
var xe = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(xe || {});
|
|
1813
|
+
const Te = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
1898
1814
|
const t2 = [];
|
|
1899
1815
|
return 1 & e2 || t2.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/), 2 & e2 || t2.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/), 4 & e2 || t2.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/), new RegExp(t2.map((e3) => e3.source).join("|"), "g");
|
|
1900
|
-
}),
|
|
1901
|
-
function
|
|
1902
|
-
return
|
|
1816
|
+
}), Se = { _: 1, "*": 4, "~": 2 };
|
|
1817
|
+
function De(e2) {
|
|
1818
|
+
return Ie(e2, 0);
|
|
1903
1819
|
}
|
|
1904
|
-
function
|
|
1905
|
-
const s2 =
|
|
1906
|
-
const t3 =
|
|
1820
|
+
function Ie(e2, t2 = 0) {
|
|
1821
|
+
const s2 = Te[t2], n2 = s2 ? function(e3) {
|
|
1822
|
+
const t3 = Fe.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${ke}])(?:${e3.source})(?=[\\s${ke}]|$)`, "g")), s3 = Ee(t3, (e4) => {
|
|
1907
1823
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
1908
|
-
return [" ", { type:
|
|
1824
|
+
return [" ", { type: xe[Se[t4]], children: [s4] }];
|
|
1909
1825
|
});
|
|
1910
1826
|
return (e4) => {
|
|
1911
1827
|
const [t4, ...n3] = s3(" " + e4);
|
|
1912
1828
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
1913
1829
|
};
|
|
1914
1830
|
}(s2) : () => [e2];
|
|
1915
|
-
return
|
|
1831
|
+
return Ce(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Ie(e3, t2 | xe[s3]) : [e3]);
|
|
1916
1832
|
}
|
|
1917
|
-
const
|
|
1833
|
+
const Fe = function() {
|
|
1918
1834
|
const e2 = function() {
|
|
1919
1835
|
try {
|
|
1920
1836
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -1930,18 +1846,18 @@ const je = function() {
|
|
|
1930
1846
|
return e2.set(t2, n2), n2;
|
|
1931
1847
|
} };
|
|
1932
1848
|
}();
|
|
1933
|
-
function
|
|
1849
|
+
function Be(e2, t2) {
|
|
1934
1850
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
1935
1851
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
1936
1852
|
return -1;
|
|
1937
1853
|
}
|
|
1938
|
-
function
|
|
1854
|
+
function Me(e2, t2) {
|
|
1939
1855
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
1940
1856
|
}
|
|
1941
|
-
function
|
|
1857
|
+
function Re(e2) {
|
|
1942
1858
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
1943
1859
|
}
|
|
1944
|
-
var
|
|
1860
|
+
var Oe = function() {
|
|
1945
1861
|
function e2(e3) {
|
|
1946
1862
|
void 0 === e3 && (e3 = {}), this.tagName = "", this.attrs = {}, this.innerHTML = "", this.whitespaceRegex = /\s+/, this.tagName = e3.tagName || "", this.attrs = e3.attrs || {}, this.innerHTML = e3.innerHtml || e3.innerHTML || "";
|
|
1947
1863
|
}
|
|
@@ -1960,11 +1876,11 @@ var He = function() {
|
|
|
1960
1876
|
}, e2.prototype.setClass = function(e3) {
|
|
1961
1877
|
return this.setAttr("class", e3);
|
|
1962
1878
|
}, e2.prototype.addClass = function(e3) {
|
|
1963
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
1879
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Be(r2, t2) && r2.push(t2);
|
|
1964
1880
|
return this.getAttrs().class = r2.join(" "), this;
|
|
1965
1881
|
}, e2.prototype.removeClass = function(e3) {
|
|
1966
1882
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
1967
|
-
var a2 =
|
|
1883
|
+
var a2 = Be(r2, t2);
|
|
1968
1884
|
-1 !== a2 && r2.splice(a2, 1);
|
|
1969
1885
|
}
|
|
1970
1886
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -1990,12 +1906,12 @@ var He = function() {
|
|
|
1990
1906
|
return t2.join(" ");
|
|
1991
1907
|
}, e2;
|
|
1992
1908
|
}();
|
|
1993
|
-
var
|
|
1909
|
+
var _e = function() {
|
|
1994
1910
|
function e2(e3) {
|
|
1995
1911
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
1996
1912
|
}
|
|
1997
1913
|
return e2.prototype.build = function(e3) {
|
|
1998
|
-
return new
|
|
1914
|
+
return new Oe({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
1999
1915
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2000
1916
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2001
1917
|
return s2 && (t2.class = s2), this.newWindow && (t2.target = "_blank", t2.rel = "noopener noreferrer"), this.truncate && this.truncate.length && this.truncate.length < e3.getAnchorText().length && (t2.title = e3.getAnchorHref()), t2;
|
|
@@ -2065,7 +1981,7 @@ var Le = function() {
|
|
|
2065
1981
|
}(e4, t3, s3);
|
|
2066
1982
|
}(e3, s2);
|
|
2067
1983
|
}, e2;
|
|
2068
|
-
}(),
|
|
1984
|
+
}(), Ne = function() {
|
|
2069
1985
|
function e2(e3) {
|
|
2070
1986
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2071
1987
|
}
|
|
@@ -2080,30 +1996,30 @@ var Le = function() {
|
|
|
2080
1996
|
}, e2.prototype.buildTag = function() {
|
|
2081
1997
|
return this.tagBuilder.build(this);
|
|
2082
1998
|
}, e2;
|
|
2083
|
-
}(),
|
|
2084
|
-
return
|
|
1999
|
+
}(), Pe = function(e2, t2) {
|
|
2000
|
+
return Pe = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2085
2001
|
e3.__proto__ = t3;
|
|
2086
2002
|
} || function(e3, t3) {
|
|
2087
2003
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2088
|
-
},
|
|
2004
|
+
}, Pe(e2, t2);
|
|
2089
2005
|
};
|
|
2090
|
-
function
|
|
2006
|
+
function Ue(e2, t2) {
|
|
2091
2007
|
function s2() {
|
|
2092
2008
|
this.constructor = e2;
|
|
2093
2009
|
}
|
|
2094
|
-
|
|
2010
|
+
Pe(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2095
2011
|
}
|
|
2096
|
-
var
|
|
2097
|
-
return
|
|
2012
|
+
var je, We = function() {
|
|
2013
|
+
return We = Object.assign || function(e2) {
|
|
2098
2014
|
for (var t2, s2 = 1, n2 = arguments.length; s2 < n2; s2++) for (var r2 in t2 = arguments[s2]) Object.prototype.hasOwnProperty.call(t2, r2) && (e2[r2] = t2[r2]);
|
|
2099
2015
|
return e2;
|
|
2100
|
-
},
|
|
2101
|
-
},
|
|
2016
|
+
}, We.apply(this, arguments);
|
|
2017
|
+
}, $e = function(e2) {
|
|
2102
2018
|
function t2(t3) {
|
|
2103
2019
|
var s2 = e2.call(this, t3) || this;
|
|
2104
2020
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2105
2021
|
}
|
|
2106
|
-
return
|
|
2022
|
+
return Ue(t2, e2), t2.prototype.getType = function() {
|
|
2107
2023
|
return "email";
|
|
2108
2024
|
}, t2.prototype.getEmail = function() {
|
|
2109
2025
|
return this.email;
|
|
@@ -2112,12 +2028,12 @@ var Ye, Ke = function() {
|
|
|
2112
2028
|
}, t2.prototype.getAnchorText = function() {
|
|
2113
2029
|
return this.email;
|
|
2114
2030
|
}, t2;
|
|
2115
|
-
}(
|
|
2031
|
+
}(Ne), qe = function(e2) {
|
|
2116
2032
|
function t2(t3) {
|
|
2117
2033
|
var s2 = e2.call(this, t3) || this;
|
|
2118
2034
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2119
2035
|
}
|
|
2120
|
-
return
|
|
2036
|
+
return Ue(t2, e2), t2.prototype.getType = function() {
|
|
2121
2037
|
return "hashtag";
|
|
2122
2038
|
}, t2.prototype.getServiceName = function() {
|
|
2123
2039
|
return this.serviceName;
|
|
@@ -2138,12 +2054,12 @@ var Ye, Ke = function() {
|
|
|
2138
2054
|
}, t2.prototype.getAnchorText = function() {
|
|
2139
2055
|
return "#" + this.hashtag;
|
|
2140
2056
|
}, t2;
|
|
2141
|
-
}(
|
|
2057
|
+
}(Ne), He = function(e2) {
|
|
2142
2058
|
function t2(t3) {
|
|
2143
2059
|
var s2 = e2.call(this, t3) || this;
|
|
2144
2060
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2145
2061
|
}
|
|
2146
|
-
return
|
|
2062
|
+
return Ue(t2, e2), t2.prototype.getType = function() {
|
|
2147
2063
|
return "mention";
|
|
2148
2064
|
}, t2.prototype.getMention = function() {
|
|
2149
2065
|
return this.mention;
|
|
@@ -2166,12 +2082,12 @@ var Ye, Ke = function() {
|
|
|
2166
2082
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2167
2083
|
return s2 && t3.push(s2), t3;
|
|
2168
2084
|
}, t2;
|
|
2169
|
-
}(
|
|
2085
|
+
}(Ne), Le = function(e2) {
|
|
2170
2086
|
function t2(t3) {
|
|
2171
2087
|
var s2 = e2.call(this, t3) || this;
|
|
2172
2088
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2173
2089
|
}
|
|
2174
|
-
return
|
|
2090
|
+
return Ue(t2, e2), t2.prototype.getType = function() {
|
|
2175
2091
|
return "phone";
|
|
2176
2092
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2177
2093
|
return this.number;
|
|
@@ -2182,12 +2098,12 @@ var Ye, Ke = function() {
|
|
|
2182
2098
|
}, t2.prototype.getAnchorText = function() {
|
|
2183
2099
|
return this.matchedText;
|
|
2184
2100
|
}, t2;
|
|
2185
|
-
}(
|
|
2101
|
+
}(Ne), Ge = function(e2) {
|
|
2186
2102
|
function t2(t3) {
|
|
2187
2103
|
var s2 = e2.call(this, t3) || this;
|
|
2188
2104
|
return s2.url = "", s2.urlMatchType = "scheme", s2.protocolUrlMatch = false, s2.protocolRelativeMatch = false, s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.schemePrefixRegex = /^(https?:\/\/)?/i, s2.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i, s2.protocolRelativeRegex = /^\/\//, s2.protocolPrepended = false, s2.urlMatchType = t3.urlMatchType, s2.url = t3.url, s2.protocolUrlMatch = t3.protocolUrlMatch, s2.protocolRelativeMatch = t3.protocolRelativeMatch, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2189
2105
|
}
|
|
2190
|
-
return
|
|
2106
|
+
return Ue(t2, e2), t2.prototype.getType = function() {
|
|
2191
2107
|
return "url";
|
|
2192
2108
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2193
2109
|
return this.urlMatchType;
|
|
@@ -2215,19 +2131,19 @@ var Ye, Ke = function() {
|
|
|
2215
2131
|
return t3;
|
|
2216
2132
|
}
|
|
2217
2133
|
}, t2;
|
|
2218
|
-
}(
|
|
2134
|
+
}(Ne), ze = function(e2) {
|
|
2219
2135
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2220
|
-
},
|
|
2221
|
-
return "(?=(" +
|
|
2222
|
-
},
|
|
2223
|
-
return "(?:" +
|
|
2224
|
-
}, vt = new RegExp("[" + dt + "]"), bt = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, yt = new RegExp("[" + dt + "!#$%&'*+/=?^_`{|}~-]"), wt = new RegExp("^" + bt.source + "$"), At = function(e2) {
|
|
2136
|
+
}, Je = /[A-Za-z]/, Ye = /[\d]/, Qe = /[\D]/, Ke = /\s/, Ve = /['"]/, Ze = /[\x00-\x1F\x7F]/, Xe = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source, et = Xe + /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source + /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source, tt = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source, st = et + tt, nt = et + tt, rt = "(?:[" + tt + "]{1,3}\\.){3}[" + tt + "]{1,3}", it = "[" + nt + "](?:[" + nt + "\\-]{0,61}[" + nt + "])?", at = function(e2) {
|
|
2137
|
+
return "(?=(" + it + "))\\" + e2;
|
|
2138
|
+
}, ot = function(e2) {
|
|
2139
|
+
return "(?:" + at(e2) + "(?:\\." + at(e2 + 1) + "){0,126}|" + rt + ")";
|
|
2140
|
+
}, ut = new RegExp("[" + nt + "]"), ct = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, lt = new RegExp("[" + nt + "!#$%&'*+/=?^_`{|}~-]"), ht = new RegExp("^" + ct.source + "$"), dt = function(e2) {
|
|
2225
2141
|
function t2() {
|
|
2226
2142
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2227
|
-
return t3.localPartCharRegex =
|
|
2143
|
+
return t3.localPartCharRegex = lt, t3.strictTldRegex = ht, t3;
|
|
2228
2144
|
}
|
|
2229
|
-
return
|
|
2230
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2145
|
+
return Ue(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2146
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new pt(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2231
2147
|
var h2 = e3.charAt(u2);
|
|
2232
2148
|
switch (c2) {
|
|
2233
2149
|
case 0:
|
|
@@ -2255,7 +2171,7 @@ var Ye, Ke = function() {
|
|
|
2255
2171
|
y2(h2);
|
|
2256
2172
|
break;
|
|
2257
2173
|
default:
|
|
2258
|
-
|
|
2174
|
+
Re(c2);
|
|
2259
2175
|
}
|
|
2260
2176
|
u2++;
|
|
2261
2177
|
}
|
|
@@ -2264,7 +2180,7 @@ var Ye, Ke = function() {
|
|
|
2264
2180
|
"m" === e4 ? w2(1) : s2.test(e4) && w2();
|
|
2265
2181
|
}
|
|
2266
2182
|
function p2(e4, t4) {
|
|
2267
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2183
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new pt(We(We({}, l2), { hasMailtoPrefix: true }))) : A2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : A2());
|
|
2268
2184
|
}
|
|
2269
2185
|
function f2(e4) {
|
|
2270
2186
|
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || A2();
|
|
@@ -2273,19 +2189,19 @@ var Ye, Ke = function() {
|
|
|
2273
2189
|
"." === e4 || "@" === e4 ? A2() : s2.test(e4) ? c2 = 2 : A2();
|
|
2274
2190
|
}
|
|
2275
2191
|
function g2(e4) {
|
|
2276
|
-
|
|
2192
|
+
ut.test(e4) ? c2 = 5 : A2();
|
|
2277
2193
|
}
|
|
2278
2194
|
function v2(e4) {
|
|
2279
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2195
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : ut.test(e4) || C2();
|
|
2280
2196
|
}
|
|
2281
2197
|
function b2(e4) {
|
|
2282
|
-
"-" === e4 || "." === e4 ? C2() :
|
|
2198
|
+
"-" === e4 || "." === e4 ? C2() : ut.test(e4) ? c2 = 5 : C2();
|
|
2283
2199
|
}
|
|
2284
2200
|
function y2(e4) {
|
|
2285
|
-
"." === e4 || "-" === e4 ? C2() :
|
|
2201
|
+
"." === e4 || "-" === e4 ? C2() : ut.test(e4) ? (c2 = 5, l2 = new pt(We(We({}, l2), { hasDomainDot: true }))) : C2();
|
|
2286
2202
|
}
|
|
2287
2203
|
function w2(e4) {
|
|
2288
|
-
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new
|
|
2204
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new pt({ idx: u2 });
|
|
2289
2205
|
}
|
|
2290
2206
|
function A2() {
|
|
2291
2207
|
c2 = 0, l2 = a2;
|
|
@@ -2298,14 +2214,14 @@ var Ye, Ke = function() {
|
|
|
2298
2214
|
(function(e4) {
|
|
2299
2215
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2300
2216
|
return n2.test(s4);
|
|
2301
|
-
})(i3) && r2.push(new
|
|
2217
|
+
})(i3) && r2.push(new $e({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2302
2218
|
}
|
|
2303
2219
|
A2();
|
|
2304
2220
|
}
|
|
2305
2221
|
}, t2;
|
|
2306
|
-
}(
|
|
2222
|
+
}(ze), pt = function(e2) {
|
|
2307
2223
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2308
|
-
},
|
|
2224
|
+
}, ft = function() {
|
|
2309
2225
|
function e2() {
|
|
2310
2226
|
}
|
|
2311
2227
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2323,16 +2239,16 @@ var Ye, Ke = function() {
|
|
|
2323
2239
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2324
2240
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2325
2241
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2326
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2327
|
-
}(),
|
|
2242
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + Xe + "]"), e2.ipRegex = /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/, e2;
|
|
2243
|
+
}(), mt = (je = new RegExp("[/?#](?:[" + nt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + nt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, ot(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, ot(6), ")", "|", "(", "(//)?", ot(10) + "\\.", ct.source, "(?![-" + st + "])", ")", ")", "(?::[0-9]+)?", "(?:" + je.source + ")?"].join(""), "gi")), gt = new RegExp("[" + nt + "]"), vt = function(e2) {
|
|
2328
2244
|
function t2(t3) {
|
|
2329
2245
|
var s2 = e2.call(this, t3) || this;
|
|
2330
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2246
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = mt, s2.wordCharRegExp = gt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2331
2247
|
}
|
|
2332
|
-
return
|
|
2248
|
+
return Ue(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2333
2249
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2334
2250
|
var s3 = t3[0], u3 = t3[1], l2 = t3[4], h2 = t3[5], d2 = t3[9], p2 = t3.index, f2 = h2 || d2, m2 = e3.charAt(p2 - 1);
|
|
2335
|
-
if (!
|
|
2251
|
+
if (!ft.isValid(s3, u3)) return "continue";
|
|
2336
2252
|
if (p2 > 0 && "@" === m2) return "continue";
|
|
2337
2253
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
|
|
2338
2254
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2348,7 +2264,7 @@ var Ye, Ke = function() {
|
|
|
2348
2264
|
s3 = s3.substr(b2), u3 = u3.substr(b2), p2 += b2;
|
|
2349
2265
|
}
|
|
2350
2266
|
var y2 = u3 ? "scheme" : l2 ? "www" : "tld", w2 = !!u3;
|
|
2351
|
-
o2.push(new
|
|
2267
|
+
o2.push(new Ge({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: y2, url: s3, protocolUrlMatch: w2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2352
2268
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2353
2269
|
return o2;
|
|
2354
2270
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2368,58 +2284,58 @@ var Ye, Ke = function() {
|
|
|
2368
2284
|
if (!e3) return -1;
|
|
2369
2285
|
var s2 = 0;
|
|
2370
2286
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2371
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2287
|
+
var n2 = new RegExp("^((.?//)?[-." + nt + "]*[-" + nt + "]\\.[-" + nt + "]+)").exec(e3);
|
|
2372
2288
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2373
2289
|
}, t2;
|
|
2374
|
-
}(
|
|
2290
|
+
}(ze), bt = new RegExp("#[_" + nt + "]{1,139}(?![_" + nt + "])", "g"), yt = new RegExp("[^" + nt + "]"), wt = function(e2) {
|
|
2375
2291
|
function t2(t3) {
|
|
2376
2292
|
var s2 = e2.call(this, t3) || this;
|
|
2377
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2293
|
+
return s2.serviceName = "twitter", s2.matcherRegex = bt, s2.nonWordCharRegex = yt, s2.serviceName = t3.serviceName, s2;
|
|
2378
2294
|
}
|
|
2379
|
-
return
|
|
2295
|
+
return Ue(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2380
2296
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2381
2297
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2382
2298
|
if (0 === o2 || n2.test(u2)) {
|
|
2383
2299
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2384
|
-
a2.push(new
|
|
2300
|
+
a2.push(new qe({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2385
2301
|
}
|
|
2386
2302
|
}
|
|
2387
2303
|
return a2;
|
|
2388
2304
|
}, t2;
|
|
2389
|
-
}(
|
|
2305
|
+
}(ze), At = new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source + "|" + /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source, "g"), Ct = function(e2) {
|
|
2390
2306
|
function t2() {
|
|
2391
2307
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2392
|
-
return t3.matcherRegex =
|
|
2308
|
+
return t3.matcherRegex = At, t3;
|
|
2393
2309
|
}
|
|
2394
|
-
return
|
|
2310
|
+
return Ue(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2395
2311
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2396
2312
|
var i2 = t3[0], a2 = i2.replace(/[^0-9,;#]/g, ""), o2 = !(!t3[1] && !t3[2]), u2 = 0 == t3.index ? "" : e3.substr(t3.index - 1, 1), c2 = e3.substr(t3.index + i2.length, 1), l2 = !u2.match(/\d/) && !c2.match(/\d/);
|
|
2397
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2313
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new Le({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2398
2314
|
}
|
|
2399
2315
|
return r2;
|
|
2400
2316
|
}, t2.prototype.testMatch = function(e3) {
|
|
2401
|
-
return
|
|
2317
|
+
return Qe.test(e3);
|
|
2402
2318
|
}, t2;
|
|
2403
|
-
}(
|
|
2319
|
+
}(ze), Et = new RegExp("@[_" + nt + "]{1,50}(?![_" + nt + "])", "g"), kt = new RegExp("@[_." + nt + "]{1,30}(?![_" + nt + "])", "g"), xt = new RegExp("@[-_." + nt + "]{1,50}(?![-_" + nt + "])", "g"), Tt = new RegExp("[^" + nt + "]"), St = function(e2) {
|
|
2404
2320
|
function t2(t3) {
|
|
2405
2321
|
var s2 = e2.call(this, t3) || this;
|
|
2406
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2322
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Et, instagram: kt, soundcloud: xt }, s2.nonWordCharRegex = Tt, s2.serviceName = t3.serviceName, s2;
|
|
2407
2323
|
}
|
|
2408
|
-
return
|
|
2324
|
+
return Ue(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2409
2325
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2410
2326
|
if (!n2) return a2;
|
|
2411
2327
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2412
2328
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2413
2329
|
if (0 === o2 || r2.test(u2)) {
|
|
2414
2330
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2415
|
-
a2.push(new
|
|
2331
|
+
a2.push(new He({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2416
2332
|
}
|
|
2417
2333
|
}
|
|
2418
2334
|
return a2;
|
|
2419
2335
|
}, t2;
|
|
2420
|
-
}(
|
|
2421
|
-
function
|
|
2422
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2336
|
+
}(ze);
|
|
2337
|
+
function Dt(e2, t2) {
|
|
2338
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new It(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2423
2339
|
var f2 = e2.charAt(c2);
|
|
2424
2340
|
switch (h2) {
|
|
2425
2341
|
case 0:
|
|
@@ -2447,10 +2363,10 @@ function Pt(e2, t2) {
|
|
|
2447
2363
|
C2(f2);
|
|
2448
2364
|
break;
|
|
2449
2365
|
case 8:
|
|
2450
|
-
|
|
2366
|
+
E2(f2);
|
|
2451
2367
|
break;
|
|
2452
2368
|
case 9:
|
|
2453
|
-
|
|
2369
|
+
k2(f2);
|
|
2454
2370
|
break;
|
|
2455
2371
|
case 10:
|
|
2456
2372
|
x2(f2);
|
|
@@ -2486,7 +2402,7 @@ function Pt(e2, t2) {
|
|
|
2486
2402
|
_2(f2);
|
|
2487
2403
|
break;
|
|
2488
2404
|
default:
|
|
2489
|
-
|
|
2405
|
+
Re(h2);
|
|
2490
2406
|
}
|
|
2491
2407
|
c2++;
|
|
2492
2408
|
}
|
|
@@ -2494,43 +2410,43 @@ function Pt(e2, t2) {
|
|
|
2494
2410
|
"<" === e3 && P2();
|
|
2495
2411
|
}
|
|
2496
2412
|
function g2(e3) {
|
|
2497
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2413
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new It(We(We({}, p2), { isClosing: true }))) : "<" === e3 ? P2() : Je.test(e3) ? (h2 = 3, p2 = new It(We(We({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2498
2414
|
}
|
|
2499
2415
|
function v2(e3) {
|
|
2500
|
-
|
|
2416
|
+
Ke.test(e3) ? (p2 = new It(We(We({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? P2() : "/" === e3 ? (p2 = new It(We(We({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new It(We(We({}, p2), { name: j2() })), U2()) : Je.test(e3) || Ye.test(e3) || ":" === e3 || N2();
|
|
2501
2417
|
}
|
|
2502
2418
|
function b2(e3) {
|
|
2503
|
-
">" === e3 ? N2() :
|
|
2419
|
+
">" === e3 ? N2() : Je.test(e3) ? h2 = 3 : N2();
|
|
2504
2420
|
}
|
|
2505
2421
|
function y2(e3) {
|
|
2506
|
-
|
|
2422
|
+
Ke.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : "=" === e3 || Ve.test(e3) || Ze.test(e3) ? N2() : h2 = 5);
|
|
2507
2423
|
}
|
|
2508
2424
|
function w2(e3) {
|
|
2509
|
-
|
|
2425
|
+
Ke.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : Ve.test(e3) && N2();
|
|
2510
2426
|
}
|
|
2511
2427
|
function A2(e3) {
|
|
2512
|
-
|
|
2428
|
+
Ke.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? P2() : Ve.test(e3) ? N2() : h2 = 5);
|
|
2513
2429
|
}
|
|
2514
2430
|
function C2(e3) {
|
|
2515
|
-
|
|
2431
|
+
Ke.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? N2() : "<" === e3 ? P2() : h2 = 10);
|
|
2516
2432
|
}
|
|
2517
|
-
function
|
|
2433
|
+
function E2(e3) {
|
|
2518
2434
|
'"' === e3 && (h2 = 11);
|
|
2519
2435
|
}
|
|
2520
|
-
function
|
|
2436
|
+
function k2(e3) {
|
|
2521
2437
|
"'" === e3 && (h2 = 11);
|
|
2522
2438
|
}
|
|
2523
2439
|
function x2(e3) {
|
|
2524
|
-
|
|
2440
|
+
Ke.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && P2();
|
|
2525
2441
|
}
|
|
2526
2442
|
function T2(e3) {
|
|
2527
|
-
|
|
2443
|
+
Ke.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? P2() : (h2 = 4, c2--);
|
|
2528
2444
|
}
|
|
2529
2445
|
function S2(e3) {
|
|
2530
|
-
">" === e3 ? (p2 = new
|
|
2446
|
+
">" === e3 ? (p2 = new It(We(We({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2531
2447
|
}
|
|
2532
2448
|
function D2(t3) {
|
|
2533
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2449
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new It(We(We({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new It(We(We({}, p2), { type: "doctype" })), h2 = 20) : N2();
|
|
2534
2450
|
}
|
|
2535
2451
|
function I2(e3) {
|
|
2536
2452
|
"-" === e3 ? h2 = 15 : ">" === e3 ? N2() : h2 = 16;
|
|
@@ -2557,7 +2473,7 @@ function Pt(e2, t2) {
|
|
|
2557
2473
|
h2 = 0, p2 = u2;
|
|
2558
2474
|
}
|
|
2559
2475
|
function P2() {
|
|
2560
|
-
h2 = 1, p2 = new
|
|
2476
|
+
h2 = 1, p2 = new It({ idx: c2 });
|
|
2561
2477
|
}
|
|
2562
2478
|
function U2() {
|
|
2563
2479
|
var t3 = e2.slice(d2, p2.idx);
|
|
@@ -2569,9 +2485,9 @@ function Pt(e2, t2) {
|
|
|
2569
2485
|
}
|
|
2570
2486
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2571
2487
|
}
|
|
2572
|
-
var
|
|
2488
|
+
var It = function(e2) {
|
|
2573
2489
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.type = e2.type || "tag", this.name = e2.name || "", this.isOpening = !!e2.isOpening, this.isClosing = !!e2.isClosing;
|
|
2574
|
-
},
|
|
2490
|
+
}, Ft = function() {
|
|
2575
2491
|
function e2(t2) {
|
|
2576
2492
|
void 0 === t2 && (t2 = {}), this.version = e2.version, this.urls = {}, this.email = true, this.phone = true, this.hashtag = false, this.mention = false, this.newWindow = true, this.stripPrefix = { scheme: true, www: true }, this.stripTrailingSlash = true, this.decodePercentEncoding = true, this.truncate = { length: 0, location: "end" }, this.className = "", this.replaceFn = null, this.context = void 0, this.sanitizeHtml = false, this.matchers = null, this.tagBuilder = null, this.urls = this.normalizeUrlsCfg(t2.urls), this.email = "boolean" == typeof t2.email ? t2.email : this.email, this.phone = "boolean" == typeof t2.phone ? t2.phone : this.phone, this.hashtag = t2.hashtag || this.hashtag, this.mention = t2.mention || this.mention, this.newWindow = "boolean" == typeof t2.newWindow ? t2.newWindow : this.newWindow, this.stripPrefix = this.normalizeStripPrefixCfg(t2.stripPrefix), this.stripTrailingSlash = "boolean" == typeof t2.stripTrailingSlash ? t2.stripTrailingSlash : this.stripTrailingSlash, this.decodePercentEncoding = "boolean" == typeof t2.decodePercentEncoding ? t2.decodePercentEncoding : this.decodePercentEncoding, this.sanitizeHtml = t2.sanitizeHtml || false;
|
|
2577
2493
|
var s2 = this.mention;
|
|
@@ -2595,7 +2511,7 @@ var Ut = function(e2) {
|
|
|
2595
2511
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2596
2512
|
}, e2.prototype.parse = function(e3) {
|
|
2597
2513
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2598
|
-
return
|
|
2514
|
+
return Dt(e3, { onOpenTag: function(e4) {
|
|
2599
2515
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2600
2516
|
}, onText: function(e4, s3) {
|
|
2601
2517
|
if (0 === n2) {
|
|
@@ -2634,19 +2550,19 @@ var Ut = function(e2) {
|
|
|
2634
2550
|
}
|
|
2635
2551
|
return e3;
|
|
2636
2552
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
2637
|
-
return this.hashtag ||
|
|
2553
|
+
return this.hashtag || Me(e3, function(e4) {
|
|
2638
2554
|
return "hashtag" === e4.getType();
|
|
2639
|
-
}), this.email ||
|
|
2555
|
+
}), this.email || Me(e3, function(e4) {
|
|
2640
2556
|
return "email" === e4.getType();
|
|
2641
|
-
}), this.phone ||
|
|
2557
|
+
}), this.phone || Me(e3, function(e4) {
|
|
2642
2558
|
return "phone" === e4.getType();
|
|
2643
|
-
}), this.mention ||
|
|
2559
|
+
}), this.mention || Me(e3, function(e4) {
|
|
2644
2560
|
return "mention" === e4.getType();
|
|
2645
|
-
}), this.urls.schemeMatches ||
|
|
2561
|
+
}), this.urls.schemeMatches || Me(e3, function(e4) {
|
|
2646
2562
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
2647
|
-
}), this.urls.wwwMatches ||
|
|
2563
|
+
}), this.urls.wwwMatches || Me(e3, function(e4) {
|
|
2648
2564
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
2649
|
-
}), this.urls.tldMatches ||
|
|
2565
|
+
}), this.urls.tldMatches || Me(e3, function(e4) {
|
|
2650
2566
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
2651
2567
|
}), e3;
|
|
2652
2568
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -2666,102 +2582,102 @@ var Ut = function(e2) {
|
|
|
2666
2582
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
2667
2583
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
2668
2584
|
var t2;
|
|
2669
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
2585
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof Oe ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
2670
2586
|
}, e2.prototype.getMatchers = function() {
|
|
2671
2587
|
if (this.matchers) return this.matchers;
|
|
2672
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
2588
|
+
var e3 = this.getTagBuilder(), t2 = [new wt({ tagBuilder: e3, serviceName: this.hashtag }), new dt({ tagBuilder: e3 }), new Ct({ tagBuilder: e3 }), new St({ tagBuilder: e3, serviceName: this.mention }), new vt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
2673
2589
|
return this.matchers = t2;
|
|
2674
2590
|
}, e2.prototype.getTagBuilder = function() {
|
|
2675
2591
|
var e3 = this.tagBuilder;
|
|
2676
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
2677
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
2592
|
+
return e3 || (e3 = this.tagBuilder = new _e({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
2593
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = _e, e2.HtmlTag = Oe, e2.matcher = { Email: dt, Hashtag: wt, Matcher: ze, Mention: St, Phone: Ct, Url: vt }, e2.match = { Email: $e, Hashtag: qe, Match: Ne, Mention: He, Phone: Le, Url: Ge }, e2;
|
|
2678
2594
|
}();
|
|
2679
|
-
function
|
|
2595
|
+
function Bt(e2, t2 = e2) {
|
|
2680
2596
|
return { type: "autolink", url: e2, text: t2 };
|
|
2681
2597
|
}
|
|
2682
2598
|
Object.assign(function(e2, t2) {
|
|
2683
2599
|
return { type: "emoji", kind: e2, text: t2 };
|
|
2684
2600
|
}, { emoticon: (e2) => ({ type: "emoji", kind: "emoticon", text: e2 }), unicode: (e2) => ({ type: "emoji", kind: "unicode", text: e2 }) });
|
|
2685
|
-
const
|
|
2601
|
+
const Mt = Ee(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2686
2602
|
return { type: "mention", id: e3, text: t3 };
|
|
2687
|
-
}(decodeURIComponent(t2), s2)),
|
|
2603
|
+
}(decodeURIComponent(t2), s2)), Rt = Ee(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
2688
2604
|
return { type: "customemoji", text: e3 };
|
|
2689
|
-
}(t2)),
|
|
2605
|
+
}(t2)), Ot = Ee(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
2690
2606
|
return { type: "link", url: e3, children: t3 };
|
|
2691
|
-
}(t2, [s2])),
|
|
2692
|
-
const { action: n2, params: r2 } =
|
|
2607
|
+
}(t2, [s2])), _t = Ee(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2608
|
+
const { action: n2, params: r2 } = Pt(t2);
|
|
2693
2609
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2694
2610
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
2695
2611
|
}(n2, r2, [s2]);
|
|
2696
|
-
}),
|
|
2697
|
-
const { action: n2, params: r2 } =
|
|
2612
|
+
}), Nt = Ee(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
2613
|
+
const { action: n2, params: r2 } = Pt(t2);
|
|
2698
2614
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2699
2615
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
2700
2616
|
}(n2, r2, [s2]);
|
|
2701
2617
|
});
|
|
2702
|
-
function
|
|
2618
|
+
function Pt(e2) {
|
|
2703
2619
|
const t2 = e2.indexOf("?");
|
|
2704
2620
|
if (-1 === t2) return { action: e2, params: {} };
|
|
2705
2621
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
2706
2622
|
}
|
|
2707
|
-
const
|
|
2623
|
+
const Ut = Ee(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
2708
2624
|
return { type: "bulletlist", children: e3 };
|
|
2709
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
2625
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), jt = Ee(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Wt = (e2) => {
|
|
2710
2626
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
2711
2627
|
let s2 = 0;
|
|
2712
2628
|
const n2 = [];
|
|
2713
|
-
for (const r2 of
|
|
2629
|
+
for (const r2 of V(e2, t2)) {
|
|
2714
2630
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
2715
2631
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
2716
|
-
const o2 =
|
|
2632
|
+
const o2 = Bt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
2717
2633
|
n2.push(o2), s2 = a2 + i2.length;
|
|
2718
2634
|
}
|
|
2719
2635
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
2720
|
-
},
|
|
2721
|
-
const t2 =
|
|
2636
|
+
}, $t = (e2) => Ot(e2).flatMap((e3) => "string" == typeof e3 ? qt(e3) : ["<", ...qt(e3.url), ...qt("|" + e3.children[0] + ">")]), qt = (e2) => {
|
|
2637
|
+
const t2 = Ft.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
2722
2638
|
let n2 = 0;
|
|
2723
2639
|
for (const r2 of t2) {
|
|
2724
2640
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
2725
2641
|
let o2 = i2;
|
|
2726
|
-
r2 instanceof
|
|
2642
|
+
r2 instanceof $e ? o2 = "mailto:" + r2.getEmail() : r2 instanceof Ge && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Bt(o2, i2)), n2 = t3 + a2;
|
|
2727
2643
|
}
|
|
2728
2644
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
2729
|
-
},
|
|
2730
|
-
function
|
|
2645
|
+
}, Ht = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
2646
|
+
function Lt(e2 = { except: [] }) {
|
|
2731
2647
|
var _a2;
|
|
2732
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
2733
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
2648
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Ht.filter((t3) => !e2.only.includes(t3));
|
|
2649
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Ut, jt), s2.includes("Mention") || t2.singlelineSteps.push(Mt), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Rt), s2.includes("Codespan") || t2.multilineSteps.push(Ee(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Ot), s2.includes("Actions") || (t2.singlelineSteps.push(_t), t2.singlelineSteps.push(Nt)), s2.includes("Wikitext") || t2.singlelineSteps.push(De), s2.includes("Autolink") || t2.singlelineSteps.push($t, Wt), t2;
|
|
2734
2650
|
}
|
|
2735
|
-
const
|
|
2651
|
+
const Gt = function(e2) {
|
|
2736
2652
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
2737
2653
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
2738
2654
|
}("\n");
|
|
2739
|
-
function
|
|
2655
|
+
function zt(e2, t2 = { except: [] }) {
|
|
2740
2656
|
let s2 = function(e3, t3) {
|
|
2741
2657
|
let s3 = [e3];
|
|
2742
|
-
return s3 =
|
|
2743
|
-
}(e2,
|
|
2744
|
-
return s2 =
|
|
2658
|
+
return s3 = Jt(s3, t3.multilineSteps), s3 = Jt(s3, [Gt]), s3 = Jt(s3, t3.singlelineSteps), s3 = Yt(s3), s3;
|
|
2659
|
+
}(e2, Lt(t2));
|
|
2660
|
+
return s2 = Qt(s2, false), s2;
|
|
2745
2661
|
}
|
|
2746
|
-
function
|
|
2747
|
-
return t2.reduce((e3, t3) =>
|
|
2662
|
+
function Jt(e2, t2) {
|
|
2663
|
+
return t2.reduce((e3, t3) => Ce(e3, t3), e2);
|
|
2748
2664
|
}
|
|
2749
|
-
function
|
|
2665
|
+
function Yt(e2) {
|
|
2750
2666
|
const t2 = [];
|
|
2751
2667
|
let s2 = -1;
|
|
2752
|
-
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children:
|
|
2668
|
+
for (const n2 of e2) "string" == typeof n2 ? "string" == typeof t2[s2] ? t2[s2] += n2 : t2[++s2] = n2 : t2[++s2] = "children" in n2 ? __spreadProps(__spreadValues({}, n2), { children: Yt(n2.children) }) : n2;
|
|
2753
2669
|
return t2;
|
|
2754
2670
|
}
|
|
2755
|
-
function
|
|
2671
|
+
function Qt(e2, t2) {
|
|
2756
2672
|
const s2 = [];
|
|
2757
2673
|
let n2 = [];
|
|
2758
2674
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2759
2675
|
const i2 = e2[r2];
|
|
2760
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
2676
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = Qt(i2.children, t2 || "link" === i2.type || "actionbutton" === i2.type || "actionlink" === i2.type), s2.push(i2)) : "autolink" === i2.type && t2 ? n2.push(i2.text) : (n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2.push(i2));
|
|
2761
2677
|
}
|
|
2762
2678
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
2763
2679
|
}
|
|
2764
|
-
class
|
|
2680
|
+
class Kt {
|
|
2765
2681
|
constructor(e2, t2, s2) {
|
|
2766
2682
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2767
2683
|
}
|
|
@@ -2777,12 +2693,12 @@ class is {
|
|
|
2777
2693
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
2778
2694
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
2779
2695
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
2780
|
-
return
|
|
2696
|
+
return be("Get message " + this.id, n2);
|
|
2781
2697
|
});
|
|
2782
2698
|
}
|
|
2783
2699
|
edit(t2) {
|
|
2784
2700
|
return __async(this, null, function* () {
|
|
2785
|
-
const s2 = { content:
|
|
2701
|
+
const s2 = { content: Vt(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
2786
2702
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
2787
2703
|
});
|
|
2788
2704
|
}
|
|
@@ -2793,16 +2709,16 @@ class is {
|
|
|
2793
2709
|
});
|
|
2794
2710
|
}
|
|
2795
2711
|
}
|
|
2796
|
-
function
|
|
2712
|
+
function Vt(e2) {
|
|
2797
2713
|
if ("string" == typeof e2) {
|
|
2798
|
-
return [{ type: "text", children:
|
|
2714
|
+
return [{ type: "text", children: zt(e2) }];
|
|
2799
2715
|
}
|
|
2800
2716
|
if ("text" in e2 && e2.text) {
|
|
2801
|
-
return [{ type: "text", children:
|
|
2717
|
+
return [{ type: "text", children: zt(e2.text) }];
|
|
2802
2718
|
}
|
|
2803
2719
|
if ("content" in e2 && e2.content) return e2.content;
|
|
2804
2720
|
}
|
|
2805
|
-
class
|
|
2721
|
+
class Zt {
|
|
2806
2722
|
constructor(e2, t2) {
|
|
2807
2723
|
this.id = e2, this._realtimeClient = t2;
|
|
2808
2724
|
}
|
|
@@ -2813,16 +2729,16 @@ class os {
|
|
|
2813
2729
|
return this._realtimeClient.userId;
|
|
2814
2730
|
}
|
|
2815
2731
|
participant(e2) {
|
|
2816
|
-
return new
|
|
2732
|
+
return new we("string" == typeof e2 ? e2 : e2.id, this.id, this._realtimeClient);
|
|
2817
2733
|
}
|
|
2818
2734
|
message(e2) {
|
|
2819
|
-
return new
|
|
2735
|
+
return new Kt(e2, this.brandedId, this._realtimeClient);
|
|
2820
2736
|
}
|
|
2821
2737
|
get() {
|
|
2822
2738
|
return __async(this, null, function* () {
|
|
2823
2739
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
2824
2740
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
2825
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
2741
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = be("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
2826
2742
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
2827
2743
|
});
|
|
2828
2744
|
}
|
|
@@ -2865,8 +2781,8 @@ class os {
|
|
|
2865
2781
|
}
|
|
2866
2782
|
send(t2) {
|
|
2867
2783
|
return __async(this, null, function* () {
|
|
2868
|
-
const s2 = { content:
|
|
2869
|
-
return new
|
|
2784
|
+
const s2 = { content: Xt(t2), referencedMessageId: es(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Ae((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
2785
|
+
return new Kt("string" == typeof r2 ? r2 : r2.id, this.brandedId, this._realtimeClient);
|
|
2870
2786
|
});
|
|
2871
2787
|
}
|
|
2872
2788
|
subscribeMessages(e2) {
|
|
@@ -2876,21 +2792,21 @@ class os {
|
|
|
2876
2792
|
return this._realtimeClient.subscribe(["me", "conversations", this.brandedId], e2);
|
|
2877
2793
|
}
|
|
2878
2794
|
}
|
|
2879
|
-
function
|
|
2795
|
+
function Xt(e2) {
|
|
2880
2796
|
if ("string" == typeof e2) {
|
|
2881
|
-
return [{ type: "text", children:
|
|
2797
|
+
return [{ type: "text", children: zt(e2) }];
|
|
2882
2798
|
}
|
|
2883
2799
|
if ("text" in e2) {
|
|
2884
|
-
return [{ type: "text", children:
|
|
2800
|
+
return [{ type: "text", children: zt(e2.text) }];
|
|
2885
2801
|
}
|
|
2886
2802
|
return e2.content;
|
|
2887
2803
|
}
|
|
2888
|
-
function
|
|
2804
|
+
function es(e2) {
|
|
2889
2805
|
if ("string" == typeof e2) return;
|
|
2890
2806
|
const t2 = e2.referencedMessage;
|
|
2891
2807
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
2892
2808
|
}
|
|
2893
|
-
class
|
|
2809
|
+
class ts {
|
|
2894
2810
|
constructor(e2, t2, s2) {
|
|
2895
2811
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
2896
2812
|
}
|
|
@@ -2902,6 +2818,79 @@ class ls {
|
|
|
2902
2818
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${r2}?talkjs-client-build=${n2 != null ? n2 : "standalone"}&talkjs-core=${s2}`;
|
|
2903
2819
|
}
|
|
2904
2820
|
}
|
|
2821
|
+
function ss({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
2822
|
+
var _a2;
|
|
2823
|
+
(!r2 || r2 <= 0) && (r2 = 1);
|
|
2824
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-04-07T12:04:27.175Z" };
|
|
2825
|
+
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
2826
|
+
return a(r2, () => __async(this, null, function* () {
|
|
2827
|
+
if (o2) {
|
|
2828
|
+
const e3 = yield o2.getToken();
|
|
2829
|
+
u2.Authorization = `Bearer ${e3}`;
|
|
2830
|
+
}
|
|
2831
|
+
return fetch(t2, { method: e2, headers: u2, body: s2 }).then((e3) => {
|
|
2832
|
+
if (e3.ok) return e3;
|
|
2833
|
+
throw e3;
|
|
2834
|
+
});
|
|
2835
|
+
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
2836
|
+
return o2 && 401 === s3.status ? (ls.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
2837
|
+
}) }).catch((s3) => {
|
|
2838
|
+
if (!t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
2839
|
+
const n3 = `Network Error for ${e2} ${t2}`;
|
|
2840
|
+
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
2841
|
+
s3.clone().text().then((e3) => ls.log(`${n3} ${s3.status} ${e3}`));
|
|
2842
|
+
} else ls.log(`${n3} ${s3}`);
|
|
2843
|
+
console.error("[TalkJS]", n3);
|
|
2844
|
+
}
|
|
2845
|
+
throw s3;
|
|
2846
|
+
});
|
|
2847
|
+
}
|
|
2848
|
+
const { cdnHost: ns, appHost: rs, restHost: is, realtimeHost: as, appProtocol: os, appWsProtocol: us } = function() {
|
|
2849
|
+
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
2850
|
+
const e2 = function() {
|
|
2851
|
+
if (document.currentScript) return document.currentScript.src;
|
|
2852
|
+
try {
|
|
2853
|
+
throw new Error();
|
|
2854
|
+
} catch (e3) {
|
|
2855
|
+
const t3 = e3.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);
|
|
2856
|
+
return t3 ? t3[0] : "";
|
|
2857
|
+
}
|
|
2858
|
+
}(), t2 = document.createElement("a");
|
|
2859
|
+
t2.href = e2;
|
|
2860
|
+
const s2 = t2.host, n2 = function(e3) {
|
|
2861
|
+
if (e3.match(/^cdn[.-]/)) return e3.replace(/^cdn/, "app");
|
|
2862
|
+
if ("talkjs.com" === e3) return "app.talkjs.com";
|
|
2863
|
+
return e3;
|
|
2864
|
+
}(s2), r2 = function(e3) {
|
|
2865
|
+
if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "api");
|
|
2866
|
+
return e3 + "/public_api";
|
|
2867
|
+
}(n2), i2 = function(e3) {
|
|
2868
|
+
if (e3.match(/^app[.-]/)) return e3.replace(/^app/, "realtime");
|
|
2869
|
+
return e3 + "/public_api";
|
|
2870
|
+
}(n2), a2 = t2.protocol;
|
|
2871
|
+
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
2872
|
+
}();
|
|
2873
|
+
const cs = rs.startsWith("app.talkjs.com");
|
|
2874
|
+
const ls = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
2875
|
+
} } : new class {
|
|
2876
|
+
constructor(e2) {
|
|
2877
|
+
this._timeCreated = Date.now(), this._enabled = cs, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-04-07T12:04:27.175Z" }, entry: "direct", environment: { age: Date.now() - this._timeCreated, dependencies: {}, originalUrl: window.location.href, referrer: document.referrer, userAgent: window.navigator.userAgent }, metadata: [], nav: [], network: [], url: window.location.href, stack: "", timestamp: (/* @__PURE__ */ new Date()).toISOString(), version: "dev-2025-04-07T12:04:27.175Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
2878
|
+
}
|
|
2879
|
+
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
2880
|
+
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
2881
|
+
}
|
|
2882
|
+
log(e2) {
|
|
2883
|
+
return __async(this, null, function* () {
|
|
2884
|
+
try {
|
|
2885
|
+
if (!this._enabled) return Promise.resolve();
|
|
2886
|
+
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
2887
|
+
yield ss({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
2888
|
+
} catch (e3) {
|
|
2889
|
+
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
2890
|
+
}
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
}("970cd0be0fb74630b75c8451051299dc");
|
|
2905
2894
|
class hs {
|
|
2906
2895
|
constructor(e2, t2 = {}) {
|
|
2907
2896
|
this._onSubscription = t2, this._handlers = {};
|
|
@@ -3054,7 +3043,7 @@ class ds {
|
|
|
3054
3043
|
const e3 = this.checkJwtPayload(r2);
|
|
3055
3044
|
t2.push(...e3);
|
|
3056
3045
|
}
|
|
3057
|
-
if (t2.length) if (this.usingBokens)
|
|
3046
|
+
if (t2.length) if (this.usingBokens) ls.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3058
3047
|
else {
|
|
3059
3048
|
console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");
|
|
3060
3049
|
const s3 = t2.length > 1;
|
|
@@ -3082,7 +3071,7 @@ class ds {
|
|
|
3082
3071
|
}
|
|
3083
3072
|
sendBokenRequest(e2, t2) {
|
|
3084
3073
|
return __async(this, null, function* () {
|
|
3085
|
-
const s2 = e2.getBokensUrl(this.appId, this.userId, t2), n2 = yield
|
|
3074
|
+
const s2 = e2.getBokensUrl(this.appId, this.userId, t2), n2 = yield ss({ method: "GET", url: s2, attempts: 1 });
|
|
3086
3075
|
if (401 === n2.status) throw n2;
|
|
3087
3076
|
return (yield n2.json()).boken;
|
|
3088
3077
|
});
|
|
@@ -3096,7 +3085,7 @@ function ps(e2) {
|
|
|
3096
3085
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3097
3086
|
}
|
|
3098
3087
|
}
|
|
3099
|
-
const fs = new
|
|
3088
|
+
const fs = new ts("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3100
3089
|
class ms {
|
|
3101
3090
|
constructor(e2) {
|
|
3102
3091
|
this.target = e2;
|
|
@@ -3136,12 +3125,12 @@ class bs {
|
|
|
3136
3125
|
t3(e3 && "object" == typeof e3, "Expected an object argument in TalkSession#constructor."), t3(e3.appId && "string" == typeof e3.appId, "The `appId` property of TalkSession#constructor is required and it must be a non-empty string."), t3("string" == typeof e3.userId, "The `userId` property of TalkSession#constructor is required and it must be a string."), void 0 !== e3.token && t3(e3.token && "string" == typeof e3.token, "The `token` property of TalkSession#constructor must be a non-empty string.");
|
|
3137
3126
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3138
3127
|
}(e2);
|
|
3139
|
-
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2 } = e2;
|
|
3140
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3128
|
+
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3129
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new ts(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : fs, this._authProvider = new ds(this._apiUrls, t2, s2, n2, r2, i2), this._realtimeClient = new ge(this._apiUrls.getRealtimeWsUrl(t2, s2, "0.0.4", e2.clientBuild), s2, this._authProvider), this.currentUser = new ye(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3141
3130
|
console.error(`[TalkSession] ${e3}`);
|
|
3142
3131
|
}), function(e3, t3, s3) {
|
|
3143
3132
|
return __async(this, null, function* () {
|
|
3144
|
-
return
|
|
3133
|
+
return ss({ method: "GET", url: `${t3}/${e3}/app`, authProvider: s3 }).then((e4) => 200 === e4.status || 404 !== e4.status && (console.warn(`[TalkJS] Received unexpected ${e4.status} status code when validating app ID. Assuming that the app ID is valid.`), true)).catch((e4) => {
|
|
3145
3134
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3146
3135
|
const t4 = e4;
|
|
3147
3136
|
return 200 === t4.status || 404 !== t4.status && (console.warn(`[TalkJS] Received unexpected ${t4.status} status code when validating app ID. Assuming that the app ID is valid.`), true);
|
|
@@ -3159,13 +3148,13 @@ class bs {
|
|
|
3159
3148
|
const t2 = o();
|
|
3160
3149
|
return Promise.race([t2.promise, this._terminationReason.promise]).then((t3) => {
|
|
3161
3150
|
"UNSUBSCRIBED" !== t3 && e2(t3);
|
|
3162
|
-
}), () => t2.resolve("UNSUBSCRIBED");
|
|
3151
|
+
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3163
3152
|
}
|
|
3164
3153
|
user(e2) {
|
|
3165
|
-
return new
|
|
3154
|
+
return new ye(e2, this._realtimeClient);
|
|
3166
3155
|
}
|
|
3167
3156
|
conversation(e2) {
|
|
3168
|
-
return new
|
|
3157
|
+
return new Zt(e2, this._realtimeClient);
|
|
3169
3158
|
}
|
|
3170
3159
|
terminate(e2) {
|
|
3171
3160
|
gs.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
@@ -3190,11 +3179,11 @@ class bs {
|
|
|
3190
3179
|
}
|
|
3191
3180
|
}
|
|
3192
3181
|
function ys(e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3193
|
-
const
|
|
3194
|
-
return
|
|
3182
|
+
const u2 = new FormData();
|
|
3183
|
+
return u2.set("file", s2, r2), void 0 !== n2 && u2.set("subtype", n2), void 0 !== i2 && u2.set("width", i2.toString()), void 0 !== a2 && u2.set("height", a2.toString()), void 0 !== o2 && u2.set("duration", o2.toString()), ss({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken);
|
|
3195
3184
|
}
|
|
3196
3185
|
export {
|
|
3197
3186
|
vs as getTalkSession,
|
|
3198
|
-
|
|
3187
|
+
f as registerPolyfills
|
|
3199
3188
|
};
|
|
3200
3189
|
//# sourceMappingURL=talkSession.js.map
|