@talkjs/core 1.2.0 → 1.3.0
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 +5 -0
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +102 -0
- package/dist/talkSession.js +526 -354
- package/package.json +1 -1
package/dist/talkSession.js
CHANGED
|
@@ -229,7 +229,7 @@ class v {
|
|
|
229
229
|
void 0 !== this.timeout && (clearTimeout(this.timeout), this.timeout = void 0);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class w {
|
|
233
233
|
constructor() {
|
|
234
234
|
this.i = -1;
|
|
235
235
|
}
|
|
@@ -240,9 +240,9 @@ class b {
|
|
|
240
240
|
this.i = -1;
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
class
|
|
243
|
+
class b {
|
|
244
244
|
constructor(e2, t2) {
|
|
245
|
-
this.handlers = t2, this.seqCounter = new
|
|
245
|
+
this.handlers = t2, this.seqCounter = new w(), this.responseHandlers = {}, this.heartbeats = new y(this), this.socket = new g(e2, { onUpstreamRestarting: () => {
|
|
246
246
|
this.heartbeats.serverActive(), this.handlers.onUpstreamRestarting();
|
|
247
247
|
}, onOpen: () => {
|
|
248
248
|
this.heartbeats.clientActive(), this.heartbeats.serverActive(), this.handlers.onReady();
|
|
@@ -309,7 +309,7 @@ class y {
|
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class C {
|
|
313
313
|
constructor(e2, t2, s2) {
|
|
314
314
|
this.authProvider = t2, this.handlers = s2, this.stateMachine = new u("AuthenticatedConnection", ["WAITING_FOR_WS", "LOGGING_IN", "RENEWING_SESSION", "READY", "TERMINATED"], { logIn: { from: ["WAITING_FOR_WS"], to: "LOGGING_IN", afterTransition: () => __async(this, null, function* () {
|
|
315
315
|
yield this.renewSession();
|
|
@@ -327,7 +327,7 @@ class A {
|
|
|
327
327
|
"READY" !== e3 && "RENEWING_SESSION" !== e3 || this.handlers.onNotReady(), this.authProvider.clearScheduledRefresh();
|
|
328
328
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
329
329
|
this.authProvider.clearScheduledRefresh(), this.connection.destroy();
|
|
330
|
-
} } }), this.connection = new
|
|
330
|
+
} } }), this.connection = new b(e2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onReady: () => this.stateMachine.transition("logIn"), onNotReady: () => {
|
|
331
331
|
this.stateMachine.transition("wsDisconnected");
|
|
332
332
|
}, onAuthExpired: () => {
|
|
333
333
|
this.stateMachine.transition("authExpired");
|
|
@@ -372,7 +372,7 @@ class A {
|
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
class
|
|
375
|
+
class A {
|
|
376
376
|
constructor(e2, t2, s2) {
|
|
377
377
|
this.handlers = s2, this.stateMachine = new u("StopStartConnection", ["STOPPED", "WAITING_FOR_WS", "READY", "TERMINATED"], { unexpectedDisconnect: { from: ["READY"], to: "WAITING_FOR_WS", afterTransition: () => {
|
|
378
378
|
this.inactivityTimer.stop(), this.handlers.onNotReady();
|
|
@@ -386,7 +386,7 @@ class C {
|
|
|
386
386
|
}), this.handlers.onReady();
|
|
387
387
|
} }, destroy: { from: "ANY", to: "TERMINATED", afterTransition: () => {
|
|
388
388
|
this.inactivityTimer.stop(), this.connection.destroy();
|
|
389
|
-
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new
|
|
389
|
+
} } }), this.pendingCalls = 0, this.activeSubscriptions = 0, this.inactivityTimer = new v(3e3), this.connection = new C(e2, t2, { onUpstreamRestarting: () => {
|
|
390
390
|
this.handlers.onUpstreamRestarting();
|
|
391
391
|
}, onReady: () => {
|
|
392
392
|
this.stateMachine.transition("ready");
|
|
@@ -433,7 +433,7 @@ class E {
|
|
|
433
433
|
e3 == null ? void 0 : e3.clientErr("SESSION_DESTROYED");
|
|
434
434
|
}
|
|
435
435
|
this.connection.destroy();
|
|
436
|
-
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new
|
|
436
|
+
} } }), this.subscribeQueue = {}, this.callQueue = [], this.connection = new A(e2, t2, { onUpstreamRestarting: () => {
|
|
437
437
|
this.handlers.onUpstreamRestarting();
|
|
438
438
|
}, onReady: () => {
|
|
439
439
|
this.stateMachine.transition("processQueue");
|
|
@@ -529,12 +529,12 @@ class T extends x {
|
|
|
529
529
|
this.connection.call("SUBSCRIBE", ["users"], { ids: e2 }).then((e3) => this.subscribeCalls.forEach((t2) => t2.deferred.resolve(e3)));
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
class
|
|
532
|
+
class S extends x {
|
|
533
533
|
constructor(e2, t2, s2) {
|
|
534
534
|
super(s2, () => this.sendMutate()), this.conversationId = e2, this.connection = t2, this.calls = [];
|
|
535
535
|
}
|
|
536
536
|
canPush(e2, t2) {
|
|
537
|
-
return !!
|
|
537
|
+
return !!S.isCorrectBatchTypeFor(e2, t2) && t2[1] === this.conversationId;
|
|
538
538
|
}
|
|
539
539
|
static isCorrectBatchTypeFor(e2, t2) {
|
|
540
540
|
return s(t2, ["conversations", "*", "participants", "*"]) && ("PUT" === e2 || "POST" === e2 || "PATCH" === e2);
|
|
@@ -555,7 +555,7 @@ class I extends x {
|
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
class
|
|
558
|
+
class I {
|
|
559
559
|
constructor(e2, t2, s2) {
|
|
560
560
|
this.pendingBatch = null, this.connection = new E(e2, t2, s2);
|
|
561
561
|
}
|
|
@@ -577,17 +577,17 @@ class S {
|
|
|
577
577
|
}
|
|
578
578
|
createEmptyBatchFor(e2, t2) {
|
|
579
579
|
if (T.isCorrectBatchTypeFor(e2, t2)) return new T(this.connection, () => this.pendingBatch = null);
|
|
580
|
-
if (
|
|
580
|
+
if (S.isCorrectBatchTypeFor(e2, t2)) {
|
|
581
581
|
const e3 = t2[1];
|
|
582
|
-
return new
|
|
582
|
+
return new S(e3, this.connection, () => this.pendingBatch = null);
|
|
583
583
|
}
|
|
584
584
|
return null;
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
const D = { 200: "RESOLVE", 400: "RESOLVE", 401: "RETRY", 402: "RESOLVE", 403: "RESOLVE", 404: "RESOLVE", 405: "RESOLVE", 409: "RESOLVE", 429: "DELAY", 500: "DELAY" };
|
|
588
|
-
class
|
|
588
|
+
class M {
|
|
589
589
|
constructor(e2, t2, s2) {
|
|
590
|
-
this.throttler = new
|
|
590
|
+
this.throttler = new F(), this.alive = true, this.connection = new I(e2, t2, s2);
|
|
591
591
|
}
|
|
592
592
|
call(e2, t2, s2) {
|
|
593
593
|
return __async(this, null, function* () {
|
|
@@ -618,7 +618,7 @@ class F {
|
|
|
618
618
|
return this.connection.isConnected();
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
class
|
|
621
|
+
class F {
|
|
622
622
|
constructor() {
|
|
623
623
|
this.initialDelayMs = 200, this.exponentialFactor = 1.2, this.maxDelayMs = 3e4, this.currentDelayMs = this.initialDelayMs, this.lastCall = 0;
|
|
624
624
|
}
|
|
@@ -658,7 +658,7 @@ class R {
|
|
|
658
658
|
}
|
|
659
659
|
class N {
|
|
660
660
|
constructor(e2, t2, s2) {
|
|
661
|
-
this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new
|
|
661
|
+
this.handlers = s2, this.targetSubscriptions = new R(), this.connection = new M(e2, t2, { onUpstreamRestarting: () => this.handlers.onUpstreamRestarting(), onSubscriptionsLost: () => {
|
|
662
662
|
this.targetSubscriptions.forEach((e3) => {
|
|
663
663
|
this.resubscribe(e3);
|
|
664
664
|
}), this.handlers.onResubscribeSent();
|
|
@@ -734,7 +734,7 @@ class U {
|
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
class
|
|
737
|
+
class j {
|
|
738
738
|
constructor(e2) {
|
|
739
739
|
this.initialised = false, this.getPointer = void 0, this.pendingStates = [e2], e2.resultPromise.then(() => this.initialised = true);
|
|
740
740
|
}
|
|
@@ -768,7 +768,7 @@ class $ {
|
|
|
768
768
|
return this.getPointer;
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
|
-
class
|
|
771
|
+
class $ extends j {
|
|
772
772
|
constructor(e2, t2) {
|
|
773
773
|
super(e2), this.onTeardown = t2, this._error = null, this._lastGoodState = Promise.resolve(void 0);
|
|
774
774
|
}
|
|
@@ -797,7 +797,7 @@ class j extends $ {
|
|
|
797
797
|
}));
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
class W extends
|
|
800
|
+
class W extends $ {
|
|
801
801
|
constructor(e2) {
|
|
802
802
|
super({ seq: 0, resultPromise: new Promise((e3) => setTimeout(e3)).then(() => this.fetchInitial(0)) }, e2), this.getDeepMutex = new U(), this.lastDeep = void 0;
|
|
803
803
|
}
|
|
@@ -1360,82 +1360,48 @@ function oe({ seq: e2, prevState: t2, messages: s2, cursor: n2, conversationId:
|
|
|
1360
1360
|
}
|
|
1361
1361
|
class ue extends q {
|
|
1362
1362
|
constructor(e2, t2, s2, n2) {
|
|
1363
|
-
super(s2, n2), this.
|
|
1363
|
+
super(s2, n2), this.convDataStore = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 0;
|
|
1364
1364
|
}
|
|
1365
1365
|
fetchInitial(e2) {
|
|
1366
1366
|
return __async(this, null, function* () {
|
|
1367
|
-
|
|
1368
|
-
let n2;
|
|
1369
|
-
if (s2.ok) n2 = s2.value.data;
|
|
1370
|
-
else if ("server" === s2.where && 404 === s2.value.status) n2 = null;
|
|
1371
|
-
else {
|
|
1372
|
-
if ("server" !== s2.where || 403 !== s2.value.status || "NOT_A_PARTICIPANT" !== s2.value.errorCode) return t2.unsubscribe(), s2;
|
|
1373
|
-
n2 = null;
|
|
1374
|
-
}
|
|
1375
|
-
return c({ lastChanged: e2, snapshot: n2, messageWindowStore: t2 });
|
|
1367
|
+
return c({ lastChanged: e2, store: this.convDataStore });
|
|
1376
1368
|
});
|
|
1377
1369
|
}
|
|
1378
1370
|
teardownNested(e2) {
|
|
1379
|
-
|
|
1380
|
-
(_a2 = e2.messageWindowStore) == null ? void 0 : _a2.unsubscribe();
|
|
1371
|
+
e2.store.unsubscribe();
|
|
1381
1372
|
}
|
|
1382
1373
|
anyChildChanged(e2, t2, s2) {
|
|
1383
1374
|
return __async(this, null, function* () {
|
|
1384
|
-
return
|
|
1375
|
+
return s2.store.store.changedBetween(e2, t2);
|
|
1385
1376
|
});
|
|
1386
1377
|
}
|
|
1387
1378
|
equal(e2, t2) {
|
|
1388
|
-
return
|
|
1379
|
+
return true;
|
|
1389
1380
|
}
|
|
1390
1381
|
loadNested(e2, t2) {
|
|
1391
1382
|
return __async(this, null, function* () {
|
|
1392
|
-
|
|
1393
|
-
if (!t2.snapshot) return c({ snapshot: null, loadedAll: true });
|
|
1394
|
-
const s2 = yield t2.messageWindowStore.store.getDeep(e2);
|
|
1395
|
-
if (!s2.ok) return s2;
|
|
1396
|
-
const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1397
|
-
return c({ snapshot: __spreadProps(__spreadValues({}, t2.snapshot), { lastMessage: r2 }) });
|
|
1383
|
+
return t2.store.store.getDeep(e2);
|
|
1398
1384
|
});
|
|
1399
1385
|
}
|
|
1400
|
-
participantEdited(e2, t2) {
|
|
1401
|
-
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1402
|
-
}
|
|
1403
|
-
conversationEdited(e2, t2) {
|
|
1404
|
-
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1405
|
-
}
|
|
1406
|
-
sideEdited(e2, t2) {
|
|
1407
|
-
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: ce(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1408
|
-
}
|
|
1409
|
-
sideCreated(e2, t2) {
|
|
1410
|
-
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
1411
|
-
}
|
|
1412
|
-
sideDeleted(e2, t2) {
|
|
1413
|
-
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 : c({ lastChanged: e2, snapshot: null, messageWindowStore: t3.value.messageWindowStore }));
|
|
1414
|
-
}
|
|
1415
1386
|
getFromCache() {
|
|
1416
1387
|
return __async(this, null, function* () {
|
|
1417
|
-
|
|
1418
|
-
return e2.ok && e2.value.snapshot ? c({ status: 200, data: e2.value.snapshot }) : l("NOT_IN_CACHE");
|
|
1388
|
+
return this.convDataStore.store.getFromCache();
|
|
1419
1389
|
});
|
|
1420
1390
|
}
|
|
1421
1391
|
}
|
|
1422
1392
|
function ce(e2, t2) {
|
|
1423
|
-
const s2 = t2;
|
|
1424
|
-
return { id: e2.id, createdAt: e2.createdAt, subject: P(e2.subject, s2.subject), photoUrl: P(e2.photoUrl, s2.photoUrl), welcomeMessages: P(e2.welcomeMessages, s2.welcomeMessages), custom: _(e2.custom, s2.custom), lastMessageAt: P(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: P(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: P(e2.isUnread, s2.isUnread), access: P(e2.access, s2.access), notify: P(e2.notify, s2.notify), readUntil: P(e2.readUntil, s2.readUntil), everyoneReadUntil: P(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1425
|
-
}
|
|
1426
|
-
function le(e2, t2) {
|
|
1427
1393
|
for (let s2 in e2) Object.prototype.hasOwnProperty.call(e2, s2) && t2(e2[s2], s2);
|
|
1428
1394
|
}
|
|
1429
|
-
function
|
|
1395
|
+
function le(e2, t2) {
|
|
1430
1396
|
return function(e3, t3) {
|
|
1431
1397
|
let s2 = {}, n2 = 0;
|
|
1432
|
-
return
|
|
1398
|
+
return ce(e3, (e4, r2) => {
|
|
1433
1399
|
const [i2, a2] = t3([r2, e4], n2++);
|
|
1434
1400
|
s2[i2] = a2;
|
|
1435
1401
|
}), s2;
|
|
1436
1402
|
}(e2, ([e3, s2]) => [e3, t2(s2, e3)]);
|
|
1437
1403
|
}
|
|
1438
|
-
class
|
|
1404
|
+
class he extends q {
|
|
1439
1405
|
constructor(e2, t2, s2, n2) {
|
|
1440
1406
|
super(s2, n2), this.conversationId = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e4;
|
|
1441
1407
|
}
|
|
@@ -1447,7 +1413,7 @@ class de extends q {
|
|
|
1447
1413
|
if (!t2.ok) return t2;
|
|
1448
1414
|
const s2 = t2.value.data;
|
|
1449
1415
|
if (s2.many) return c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1450
|
-
return c({ data: s2, userSubscriptions:
|
|
1416
|
+
return c({ data: s2, userSubscriptions: le(s2.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 });
|
|
1451
1417
|
});
|
|
1452
1418
|
}
|
|
1453
1419
|
equal(e2, t2) {
|
|
@@ -1464,7 +1430,7 @@ class de extends q {
|
|
|
1464
1430
|
});
|
|
1465
1431
|
}
|
|
1466
1432
|
typingAvailable(e2, t2) {
|
|
1467
|
-
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} :
|
|
1433
|
+
this.mutate(e2, () => c({ data: t2.state, userSubscriptions: t2.state.many ? {} : le(t2.state.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3])), lastChanged: e2 }));
|
|
1468
1434
|
}
|
|
1469
1435
|
typingChanged(e2, t2) {
|
|
1470
1436
|
this.mutate(e2, (s2) => {
|
|
@@ -1472,7 +1438,7 @@ class de extends q {
|
|
|
1472
1438
|
if (void 0 === t2.diff.many) {
|
|
1473
1439
|
if (true === s2.value.data.many) return s2;
|
|
1474
1440
|
const n2 = __spreadValues({}, s2.value.data.usersTyping), r2 = __spreadValues({}, s2.value.userSubscriptions);
|
|
1475
|
-
return
|
|
1441
|
+
return ce(t2.diff.usersTyping, (e3, t3) => {
|
|
1476
1442
|
var _a2;
|
|
1477
1443
|
"number" == typeof e3 ? (n2[t3] = e3, r2[t3] = this.realtimeClient.internalSubscribe(["users", t3])) : null === e3 && (delete n2[t3], (_a2 = r2[t3]) == null ? void 0 : _a2.unsubscribe(), delete r2[t3]);
|
|
1478
1444
|
}), c({ data: { usersTyping: n2, many: false }, userSubscriptions: r2, lastChanged: e2 });
|
|
@@ -1480,7 +1446,7 @@ class de extends q {
|
|
|
1480
1446
|
if (true === t2.diff.many) return s2.value.data.many ? s2 : c({ data: { usersTyping: null, many: true }, userSubscriptions: {}, lastChanged: e2 });
|
|
1481
1447
|
if (false === t2.diff.many) {
|
|
1482
1448
|
if (false === s2.value.data.many) return s2;
|
|
1483
|
-
const n2 =
|
|
1449
|
+
const n2 = le(t2.diff.usersTyping, (e3, t3) => this.realtimeClient.internalSubscribe(["users", t3]));
|
|
1484
1450
|
return c({ data: t2.diff, userSubscriptions: n2, lastChanged: e2 });
|
|
1485
1451
|
}
|
|
1486
1452
|
throw t2.diff, "Unreachable";
|
|
@@ -1490,7 +1456,7 @@ class de extends q {
|
|
|
1490
1456
|
this.mutate(e2, (t3) => null === t3.value.data ? t3 : c({ data: null, lastChanged: e2 }));
|
|
1491
1457
|
}
|
|
1492
1458
|
teardownNested(e2) {
|
|
1493
|
-
e2.data &&
|
|
1459
|
+
e2.data && ce(e2.userSubscriptions, (e3) => e3.unsubscribe());
|
|
1494
1460
|
}
|
|
1495
1461
|
anyChildChanged(e2, t2, s2) {
|
|
1496
1462
|
return __async(this, null, function* () {
|
|
@@ -1504,7 +1470,7 @@ class de extends q {
|
|
|
1504
1470
|
});
|
|
1505
1471
|
}
|
|
1506
1472
|
}
|
|
1507
|
-
class
|
|
1473
|
+
class de extends W {
|
|
1508
1474
|
constructor(e2, t2, s2) {
|
|
1509
1475
|
super(), this.conversationId = e2, this.participantData = t2, this.realtimeClient = s2;
|
|
1510
1476
|
}
|
|
@@ -1560,14 +1526,14 @@ class pe extends W {
|
|
|
1560
1526
|
});
|
|
1561
1527
|
}
|
|
1562
1528
|
}
|
|
1563
|
-
class
|
|
1529
|
+
class pe extends q {
|
|
1564
1530
|
constructor(e2, t2, s2, n2) {
|
|
1565
1531
|
super(s2, n2), this.conversationId = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1566
1532
|
}
|
|
1567
1533
|
fetchInitial(e2) {
|
|
1568
1534
|
return __async(this, null, function* () {
|
|
1569
|
-
const t2 = yield
|
|
1570
|
-
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) :
|
|
1535
|
+
const t2 = yield fe({ realtimeClient: this.realtimeClient, conversationId: this.conversationId, count: 10 });
|
|
1536
|
+
return t2.ok ? null === t2.value.participants ? c({ lastChanged: e2, stores: null, inWindow: null, windowEnd: null }) : me({ seq: e2, participants: t2.value.participants, cursor: t2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : t2;
|
|
1571
1537
|
});
|
|
1572
1538
|
}
|
|
1573
1539
|
teardownNested(e2) {
|
|
@@ -1609,8 +1575,8 @@ class fe extends q {
|
|
|
1609
1575
|
const t2 = yield this.mostRecentState.resultPromise;
|
|
1610
1576
|
if (!t2.ok) return;
|
|
1611
1577
|
if (null === t2.value.windowEnd) return;
|
|
1612
|
-
const s2 = t2.value.windowEnd.cursor, n2 = yield
|
|
1613
|
-
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), e3) :
|
|
1578
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield fe({ count: e2, cursor: s2, conversationId: this.conversationId, realtimeClient: this.realtimeClient }), r2 = this.getLoadMoreSeq();
|
|
1579
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.participants ? (console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."), e3) : me({ seq: r2, prevStores: e3.value.stores, participants: n2.value.participants, cursor: n2.value.nextCursor, conversationId: this.conversationId, realtimeClient: this.realtimeClient }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1614
1580
|
});
|
|
1615
1581
|
}
|
|
1616
1582
|
participantCreated(e2, t2) {
|
|
@@ -1618,7 +1584,7 @@ class fe extends q {
|
|
|
1618
1584
|
if (null === s2.value.stores) return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."), s2;
|
|
1619
1585
|
if (s2.value.windowEnd && t2.state.joinedAt < s2.value.windowEnd.oldestParticipantTs) return s2;
|
|
1620
1586
|
if (Object.hasOwnProperty.call(s2.value.stores, t2.state.id)) return s2;
|
|
1621
|
-
const n2 = __spreadValues({}, s2.value.stores), r2 = new
|
|
1587
|
+
const n2 = __spreadValues({}, s2.value.stores), r2 = new de(this.conversationId, t2.state, this.realtimeClient);
|
|
1622
1588
|
n2[t2.state.id] = r2;
|
|
1623
1589
|
return c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1624
1590
|
});
|
|
@@ -1658,7 +1624,7 @@ class fe extends q {
|
|
|
1658
1624
|
});
|
|
1659
1625
|
}
|
|
1660
1626
|
}
|
|
1661
|
-
function
|
|
1627
|
+
function fe(_0) {
|
|
1662
1628
|
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, conversationId: s2, count: n2 }) {
|
|
1663
1629
|
const r2 = { limit: n2, cursor: e2 }, i2 = yield t2.call("GET", ["me", "conversations", s2, "participants"], r2, { bypassCache: true });
|
|
1664
1630
|
if (i2.ok) {
|
|
@@ -1668,18 +1634,202 @@ function me(_0) {
|
|
|
1668
1634
|
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({ participants: null, nextCursor: null });
|
|
1669
1635
|
});
|
|
1670
1636
|
}
|
|
1671
|
-
function
|
|
1637
|
+
function me({ seq: e2, prevStores: t2, participants: s2, cursor: n2, conversationId: r2, realtimeClient: i2 }) {
|
|
1672
1638
|
const a2 = t2 ? __spreadValues({}, t2) : {};
|
|
1673
1639
|
for (const e3 of s2) if (void 0 === a2[e3.id]) {
|
|
1674
|
-
const t3 = new
|
|
1640
|
+
const t3 = new de(r2, e3, i2);
|
|
1675
1641
|
a2[e3.id] = t3;
|
|
1676
1642
|
}
|
|
1677
1643
|
if (null === n2) return c({ lastChanged: e2, stores: a2, windowEnd: null });
|
|
1678
1644
|
return c({ lastChanged: e2, stores: a2, windowEnd: { cursor: n2, oldestParticipantTs: s2[s2.length - 1].joinedAt } });
|
|
1679
1645
|
}
|
|
1680
|
-
class
|
|
1646
|
+
class ge extends q {
|
|
1647
|
+
constructor(e2, t2, s2, n2) {
|
|
1648
|
+
super(s2, n2), this.getConvDataStore = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e3, this.pendingLoadMore = void 0;
|
|
1649
|
+
}
|
|
1650
|
+
fetchInitial(e2) {
|
|
1651
|
+
return __async(this, null, function* () {
|
|
1652
|
+
const t2 = yield ve({ realtimeClient: this.realtimeClient, count: 20 });
|
|
1653
|
+
return t2.ok ? null === t2.value.conversations ? c({ lastChanged: e2, stores: null, windowEnd: null }) : we({ seq: e2, conversations: t2.value.conversations, cursor: t2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : t2;
|
|
1654
|
+
});
|
|
1655
|
+
}
|
|
1656
|
+
teardownNested(e2) {
|
|
1657
|
+
null !== e2.stores && Object.values(e2.stores).forEach((e3) => e3.unsubscribe());
|
|
1658
|
+
}
|
|
1659
|
+
anyChildChanged(e2, t2, s2) {
|
|
1660
|
+
return __async(this, null, function* () {
|
|
1661
|
+
var _a2;
|
|
1662
|
+
for (const n2 in s2.stores) {
|
|
1663
|
+
const r2 = s2.stores[n2];
|
|
1664
|
+
if (true === (yield (_a2 = r2 == null ? void 0 : r2.store) == null ? void 0 : _a2.changedBetween(e2, t2))) return true;
|
|
1665
|
+
}
|
|
1666
|
+
return false;
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
equal(e2, t2) {
|
|
1670
|
+
return null === e2.stores && null === t2.stores || null !== e2.stores && null !== t2.stores && (!!O(Object.keys(e2.stores), Object.keys(t2.stores)) && O(e2.windowEnd, t2.windowEnd));
|
|
1671
|
+
}
|
|
1672
|
+
loadNested(e2, t2) {
|
|
1673
|
+
return __async(this, null, function* () {
|
|
1674
|
+
if (null === t2.stores) return c({ snapshot: [], loadedAll: true });
|
|
1675
|
+
const s2 = yield Promise.all(Object.values(t2.stores).map((t3) => t3.store.getDeep(e2))), n2 = s2.find((e3) => !e3.ok);
|
|
1676
|
+
if (n2) return n2;
|
|
1677
|
+
const r2 = s2.filter((e3) => null !== e3.value.snapshot).map((e3) => e3.value.snapshot);
|
|
1678
|
+
return r2.sort((e3, t3) => {
|
|
1679
|
+
var _a2, _b, _c, _d;
|
|
1680
|
+
const s3 = (_b = (_a2 = e3.lastMessage) == null ? void 0 : _a2.createdAt) != null ? _b : e3.joinedAt;
|
|
1681
|
+
return ((_d = (_c = t3.lastMessage) == null ? void 0 : _c.createdAt) != null ? _d : t3.joinedAt) - s3;
|
|
1682
|
+
}), c({ snapshot: r2, loadedAll: null === t2.windowEnd });
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
loadMore(e2) {
|
|
1686
|
+
return __async(this, null, function* () {
|
|
1687
|
+
if (this.pendingLoadMore) return this.pendingLoadMore;
|
|
1688
|
+
const t2 = o();
|
|
1689
|
+
this.pendingLoadMore = t2.promise, yield this._loadMoreConversations(e2), t2.resolve(), this.pendingLoadMore = void 0;
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1692
|
+
_loadMoreConversations(e2 = 20) {
|
|
1693
|
+
return __async(this, null, function* () {
|
|
1694
|
+
const t2 = yield this.mostRecentState.resultPromise;
|
|
1695
|
+
if (!t2.ok) return;
|
|
1696
|
+
if (null === t2.value.windowEnd) return;
|
|
1697
|
+
const s2 = t2.value.windowEnd.cursor, n2 = yield ve({ count: e2, cursor: s2, realtimeClient: this.realtimeClient }), r2 = this.getLoadMoreSeq();
|
|
1698
|
+
this.mutate(r2, (e3) => null === e3.value.windowEnd || s2 !== e3.value.windowEnd.cursor ? e3 : n2.ok ? null === n2.value.conversations ? (console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."), e3) : we({ seq: r2, prevStores: e3.value.stores, conversations: n2.value.conversations, cursor: n2.value.nextCursor, getConvDataStore: this.getConvDataStore }) : n2), yield this.emitMutex.runExclusive(() => this.emit(r2));
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
getConvFromCache(e2) {
|
|
1702
|
+
return __async(this, null, function* () {
|
|
1703
|
+
const t2 = yield this.mostRecentState.resultPromise;
|
|
1704
|
+
if (!t2.ok) return l("NOT_IN_CACHE");
|
|
1705
|
+
if (null === t2.value.stores) return h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["No user with that ID exists"] });
|
|
1706
|
+
const s2 = t2.value.stores[e2];
|
|
1707
|
+
return void 0 === s2 ? l("NOT_IN_CACHE") : s2.store.getFromCache();
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
userCreated(e2, t2) {
|
|
1711
|
+
this.mutate(e2, (e3) => null !== e3.value.stores ? e3 : c({ lastChanged: e3.value.lastChanged, stores: {}, windowEnd: null }));
|
|
1712
|
+
}
|
|
1713
|
+
sideCreated(e2, t2) {
|
|
1714
|
+
const s2 = this.getConvDataStore(t2.state);
|
|
1715
|
+
this.mutate(e2, (n2) => Object.hasOwnProperty.call(n2.value.stores, t2.conversationId) ? (s2.unsubscribe(), n2) : c({ lastChanged: e2, stores: __spreadProps(__spreadValues({}, n2.value.stores), { [t2.conversationId]: s2 }), windowEnd: n2.value.windowEnd }));
|
|
1716
|
+
}
|
|
1717
|
+
sideDeleted(e2, t2) {
|
|
1718
|
+
this.mutate(e2, (s2) => {
|
|
1719
|
+
var _a2;
|
|
1720
|
+
if (!Object.hasOwnProperty.call(s2.value.stores, t2.conversationId)) return s2;
|
|
1721
|
+
const n2 = __spreadValues({}, s2.value.stores);
|
|
1722
|
+
return (_a2 = n2[t2.conversationId]) == null ? void 0 : _a2.unsubscribe(), delete n2[t2.conversationId], c({ lastChanged: e2, stores: n2, windowEnd: s2.value.windowEnd });
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
sideEdited(e2, t2) {
|
|
1726
|
+
const s2 = t2.diff.lastMessageAt;
|
|
1727
|
+
void 0 !== s2 && this.mutate(e2, (n2) => {
|
|
1728
|
+
var _a2;
|
|
1729
|
+
if (null === n2.value.stores) return console.warn("[TalkJS] Received a 'side.edited' event when we thought your user didn't exist."), n2;
|
|
1730
|
+
if (null === n2.value.windowEnd) return n2;
|
|
1731
|
+
const r2 = Object.hasOwnProperty.call(n2.value.stores, t2.conversationId);
|
|
1732
|
+
if (r2 && s2 < n2.value.windowEnd.oldestMessageTs) {
|
|
1733
|
+
const s3 = __spreadValues({}, n2.value.stores);
|
|
1734
|
+
return (_a2 = s3[t2.conversationId]) == null ? void 0 : _a2.unsubscribe(), delete s3[t2.conversationId], c({ lastChanged: e2, stores: s3, windowEnd: n2.value.windowEnd });
|
|
1735
|
+
}
|
|
1736
|
+
if (!r2 && s2 >= n2.value.windowEnd.oldestMessageTs) {
|
|
1737
|
+
const s3 = this.getConvDataStore(t2.conversationId);
|
|
1738
|
+
return c({ lastChanged: e2, stores: __spreadProps(__spreadValues({}, n2.value.stores), { [t2.conversationId]: s3 }), windowEnd: n2.value.windowEnd });
|
|
1739
|
+
}
|
|
1740
|
+
return n2;
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
function ve(_0) {
|
|
1745
|
+
return __async(this, arguments, function* ({ cursor: e2, realtimeClient: t2, count: s2 }) {
|
|
1746
|
+
const n2 = { limit: s2, cursor: e2 }, r2 = yield t2.call("GET", ["me", "conversations"], n2, { bypassCache: true });
|
|
1747
|
+
if (r2.ok) {
|
|
1748
|
+
const { data: e3, cursor: t3 } = r2.value.data;
|
|
1749
|
+
return c({ conversations: e3, nextCursor: t3 });
|
|
1750
|
+
}
|
|
1751
|
+
return r2.ok || "server" !== r2.where || 404 !== r2.value.status || "USER_NOT_FOUND" !== r2.value.errorCode ? r2 : c({ conversations: null, nextCursor: null });
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
function we({ seq: e2, prevStores: t2, conversations: s2, cursor: n2, getConvDataStore: r2 }) {
|
|
1755
|
+
const i2 = t2 ? __spreadValues({}, t2) : {};
|
|
1756
|
+
for (const e3 of s2) void 0 === i2[e3.id] && (i2[e3.id] = r2(e3));
|
|
1757
|
+
if (null === n2) return c({ lastChanged: e2, stores: i2, windowEnd: null });
|
|
1758
|
+
return c({ lastChanged: e2, stores: i2, windowEnd: { cursor: n2, oldestMessageTs: Math.min(...s2.map((e3) => e3.lastMessageAt)) } });
|
|
1759
|
+
}
|
|
1760
|
+
class be extends q {
|
|
1761
|
+
constructor(e2, t2, s2, n2) {
|
|
1762
|
+
super(s2, n2), this.conversation = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 5e3;
|
|
1763
|
+
}
|
|
1764
|
+
get conversationId() {
|
|
1765
|
+
return "string" == typeof this.conversation ? this.conversation : this.conversation.id;
|
|
1766
|
+
}
|
|
1767
|
+
fetchInitial(e2) {
|
|
1768
|
+
return __async(this, null, function* () {
|
|
1769
|
+
const t2 = this.realtimeClient.internalSubscribe(["me", "conversations", this.conversationId, "messages"]);
|
|
1770
|
+
if ("object" == typeof this.conversation) return c({ lastChanged: e2, snapshot: this.conversation, messageWindowStore: t2 });
|
|
1771
|
+
const s2 = yield this.realtimeClient.call("GET", ["me", "conversations", this.conversationId], {}, { bypassCache: true });
|
|
1772
|
+
let n2;
|
|
1773
|
+
if (s2.ok) n2 = s2.value.data;
|
|
1774
|
+
else if ("server" === s2.where && 404 === s2.value.status) n2 = null;
|
|
1775
|
+
else {
|
|
1776
|
+
if ("server" !== s2.where || 403 !== s2.value.status || "NOT_A_PARTICIPANT" !== s2.value.errorCode) return t2.unsubscribe(), s2;
|
|
1777
|
+
n2 = null;
|
|
1778
|
+
}
|
|
1779
|
+
return c({ lastChanged: e2, snapshot: n2, messageWindowStore: t2 });
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
teardownNested(e2) {
|
|
1783
|
+
var _a2;
|
|
1784
|
+
(_a2 = e2.messageWindowStore) == null ? void 0 : _a2.unsubscribe();
|
|
1785
|
+
}
|
|
1786
|
+
anyChildChanged(e2, t2, s2) {
|
|
1787
|
+
return __async(this, null, function* () {
|
|
1788
|
+
return true === (yield s2.messageWindowStore.store.lastMessageChangedBetween(e2, t2));
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
equal(e2, t2) {
|
|
1792
|
+
return O(e2.snapshot, t2.snapshot);
|
|
1793
|
+
}
|
|
1794
|
+
loadNested(e2, t2) {
|
|
1795
|
+
return __async(this, null, function* () {
|
|
1796
|
+
var _a2;
|
|
1797
|
+
if (!t2.snapshot) return c({ snapshot: null, loadedAll: true });
|
|
1798
|
+
const s2 = yield t2.messageWindowStore.store.getDeep(e2);
|
|
1799
|
+
if (!s2.ok) return s2;
|
|
1800
|
+
const n2 = s2.value.snapshot, r2 = (_a2 = n2 == null ? void 0 : n2[0]) != null ? _a2 : null;
|
|
1801
|
+
return c({ snapshot: __spreadProps(__spreadValues({}, t2.snapshot), { lastMessage: r2 }) });
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
participantEdited(e2, t2) {
|
|
1805
|
+
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: ye(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1806
|
+
}
|
|
1807
|
+
conversationEdited(e2, t2) {
|
|
1808
|
+
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: ye(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1809
|
+
}
|
|
1810
|
+
sideEdited(e2, t2) {
|
|
1811
|
+
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: ye(s2.value.snapshot, t2.diff), messageWindowStore: s2.value.messageWindowStore }));
|
|
1812
|
+
}
|
|
1813
|
+
sideCreated(e2, t2) {
|
|
1814
|
+
this.mutate(e2, (s2) => s2.value.snapshot ? s2 : c({ lastChanged: e2, snapshot: t2.state, messageWindowStore: s2.value.messageWindowStore }));
|
|
1815
|
+
}
|
|
1816
|
+
sideDeleted(e2, t2) {
|
|
1817
|
+
this.mutate(e2, (t3) => null === t3.value.snapshot ? t3 : c({ lastChanged: e2, snapshot: null, messageWindowStore: t3.value.messageWindowStore }));
|
|
1818
|
+
}
|
|
1819
|
+
getFromCache() {
|
|
1820
|
+
return __async(this, null, function* () {
|
|
1821
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
1822
|
+
return e2.ok && e2.value.snapshot ? c({ status: 200, data: e2.value.snapshot }) : l("NOT_IN_CACHE");
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
function ye(e2, t2) {
|
|
1827
|
+
const s2 = t2;
|
|
1828
|
+
return { id: e2.id, createdAt: e2.createdAt, subject: P(e2.subject, s2.subject), photoUrl: P(e2.photoUrl, s2.photoUrl), welcomeMessages: P(e2.welcomeMessages, s2.welcomeMessages), custom: _(e2.custom, s2.custom), lastMessageAt: P(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: P(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: P(e2.isUnread, s2.isUnread), access: P(e2.access, s2.access), notify: P(e2.notify, s2.notify), readUntil: P(e2.readUntil, s2.readUntil), everyoneReadUntil: P(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1829
|
+
}
|
|
1830
|
+
class Ce {
|
|
1681
1831
|
constructor(e2, t2, s2) {
|
|
1682
|
-
this.realtimeClient = s2, this.storeMap = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
|
|
1832
|
+
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new N(e2, t2, { onUpstreamRestarting: () => {
|
|
1683
1833
|
this.refetchOnNextNetworkLoss = false;
|
|
1684
1834
|
}, onReady: () => {
|
|
1685
1835
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1691,7 +1841,7 @@ class ve {
|
|
|
1691
1841
|
}
|
|
1692
1842
|
}, onResubscribeError: (e3, t3) => {
|
|
1693
1843
|
var _a2;
|
|
1694
|
-
(_a2 = this.storeMap[
|
|
1844
|
+
(_a2 = this.storeMap[Ae(e3)]) == null ? void 0 : _a2.setError(t3);
|
|
1695
1845
|
}, onPublish: (e3, t3) => {
|
|
1696
1846
|
this.seqInThisConnection = e3;
|
|
1697
1847
|
const s3 = this.seq;
|
|
@@ -1703,53 +1853,53 @@ class ve {
|
|
|
1703
1853
|
return this.seqOffset + this.seqInThisConnection;
|
|
1704
1854
|
}
|
|
1705
1855
|
refetchAll(e2) {
|
|
1706
|
-
Object.values(this.storeMap).forEach((t2) => t2.refetch(e2));
|
|
1856
|
+
Object.values(this.storeMap).forEach((t2) => t2 == null ? void 0 : t2.refetch(e2));
|
|
1707
1857
|
}
|
|
1708
1858
|
emitAll(e2) {
|
|
1709
1859
|
return this.emitMutex.runExclusive(() => __async(this, null, function* () {
|
|
1710
|
-
const t2 = Object.values(this.storeMap).map((t3) => t3.emit(e2));
|
|
1860
|
+
const t2 = Object.values(this.storeMap).map((t3) => t3 == null ? void 0 : t3.emit(e2));
|
|
1711
1861
|
yield Promise.all(t2);
|
|
1712
1862
|
}));
|
|
1713
1863
|
}
|
|
1714
1864
|
handlePublish(e2, t2) {
|
|
1715
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u;
|
|
1865
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t2, _u, _v, _w, _x, _y;
|
|
1716
1866
|
switch (t2.type) {
|
|
1717
1867
|
case "user.created":
|
|
1718
|
-
return
|
|
1868
|
+
return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), void ((_b = this.storeMap["/me/conversations"]) == null ? void 0 : _b.userCreated(e2, t2));
|
|
1719
1869
|
case "user.edited":
|
|
1720
|
-
return void ((
|
|
1870
|
+
return void ((_c = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _c.userEdited(e2, t2));
|
|
1721
1871
|
case "side.created":
|
|
1722
|
-
return (
|
|
1872
|
+
return (_d = this.convDataStores[t2.conversationId]) == null ? void 0 : _d.sideCreated(e2, t2), (_e2 = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _e2.sideCreated(e2, t2), (_f = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _f.sideCreated(e2, t2), void ((_g = this.storeMap["/me/conversations"]) == null ? void 0 : _g.sideCreated(e2, t2));
|
|
1723
1873
|
case "side.edited":
|
|
1724
|
-
return void ((
|
|
1874
|
+
return (_h = this.convDataStores[t2.conversationId]) == null ? void 0 : _h.sideEdited(e2, t2), void ((_i = this.storeMap["/me/conversations"]) == null ? void 0 : _i.sideEdited(e2, t2));
|
|
1725
1875
|
case "side.deleted":
|
|
1726
|
-
return (
|
|
1876
|
+
return (_j = this.convDataStores[t2.conversationId]) == null ? void 0 : _j.sideDeleted(e2, t2), (_k = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _k.sideDeleted(e2, t2), (_l = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _l.sideDeleted(e2, t2), (_m = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _m.sideDeleted(e2, t2), void ((_n = this.storeMap["/me/conversations"]) == null ? void 0 : _n.sideDeleted(e2, t2));
|
|
1727
1877
|
case "conversation.edited":
|
|
1728
|
-
return void ((
|
|
1878
|
+
return void ((_o = this.convDataStores[t2.conversationId]) == null ? void 0 : _o.conversationEdited(e2, t2));
|
|
1729
1879
|
case "message.created":
|
|
1730
|
-
return void ((
|
|
1880
|
+
return void ((_p = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _p.messageCreated(e2, t2));
|
|
1731
1881
|
case "message.edited":
|
|
1732
|
-
return void ((
|
|
1882
|
+
return void ((_q = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _q.messageEdited(e2, t2));
|
|
1733
1883
|
case "message.deleted":
|
|
1734
|
-
return void ((
|
|
1884
|
+
return void ((_r = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _r.messageDeleted(e2, t2));
|
|
1735
1885
|
case "typing.available":
|
|
1736
|
-
return void ((
|
|
1886
|
+
return void ((_s = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _s.typingAvailable(e2, t2));
|
|
1737
1887
|
case "typing.changed":
|
|
1738
|
-
return void ((
|
|
1888
|
+
return void ((_t2 = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _t2.typingChanged(e2, t2));
|
|
1739
1889
|
case "conversation.cleared":
|
|
1740
|
-
return void ((
|
|
1890
|
+
return void ((_u = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _u.conversationCleared(e2, t2));
|
|
1741
1891
|
case "participant.edited":
|
|
1742
|
-
return (
|
|
1892
|
+
return (_v = this.convDataStores[t2.conversationId]) == null ? void 0 : _v.participantEdited(e2, t2), void ((_w = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _w.participantEdited(e2, t2));
|
|
1743
1893
|
case "participant.created":
|
|
1744
|
-
return void ((
|
|
1894
|
+
return void ((_x = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _x.participantCreated(e2, t2));
|
|
1745
1895
|
case "participant.deleted":
|
|
1746
|
-
return void ((
|
|
1896
|
+
return void ((_y = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _y.participantDeleted(e2, t2));
|
|
1747
1897
|
}
|
|
1748
1898
|
}
|
|
1749
1899
|
call(e2, t2, n2, r2) {
|
|
1750
1900
|
return __async(this, null, function* () {
|
|
1751
1901
|
if (!r2.bypassCache && "GET" === e2) {
|
|
1752
|
-
const e3 =
|
|
1902
|
+
const e3 = Ae(t2);
|
|
1753
1903
|
if (e3 in this.storeMap) {
|
|
1754
1904
|
const t3 = e3, s2 = this.storeMap[t3];
|
|
1755
1905
|
if (s2 && "getFromCache" in s2) {
|
|
@@ -1768,6 +1918,12 @@ class ve {
|
|
|
1768
1918
|
const s2 = yield e4.getParticipantFromCache(t2[4]);
|
|
1769
1919
|
if ("NOT_IN_CACHE" !== s2.value) return s2;
|
|
1770
1920
|
}
|
|
1921
|
+
} else if (s(t2, ["me", "conversations", "*"])) {
|
|
1922
|
+
const e4 = this.storeMap["/me/conversations"];
|
|
1923
|
+
if (e4) {
|
|
1924
|
+
const s2 = yield e4.getConvFromCache(t2[2]);
|
|
1925
|
+
if ("NOT_IN_CACHE" !== s2.value) return s2;
|
|
1926
|
+
}
|
|
1771
1927
|
}
|
|
1772
1928
|
}
|
|
1773
1929
|
return this.connection.call(e2, t2, n2);
|
|
@@ -1808,36 +1964,49 @@ class ve {
|
|
|
1808
1964
|
}, a2;
|
|
1809
1965
|
}
|
|
1810
1966
|
getOrCreateStore(e2) {
|
|
1811
|
-
const t2 =
|
|
1967
|
+
const t2 = Ae(e2);
|
|
1812
1968
|
if (t2 in this.storeMap) return this.storeMap[t2];
|
|
1813
1969
|
this.connection.subscribe(e2).then((e3) => {
|
|
1814
|
-
e3.ok ||
|
|
1815
|
-
});
|
|
1816
|
-
const
|
|
1817
|
-
if (s(e3, ["users", "*"])) return new G(e3[1], t3, n3, r2);
|
|
1818
|
-
if (s(e3, ["me", "conversations", "*"])) return new ue(e3[2], t3, n3, r2);
|
|
1819
|
-
if (s(e3, ["me", "conversations", "*", "messages"])) return new ie(e3[2], t3, n3, r2);
|
|
1820
|
-
if (s(e3, ["me", "conversations", "*", "participants"])) return new fe(e3[2], t3, n3, r2);
|
|
1821
|
-
if (s(e3, ["me", "conversations", "*", "typing"])) return new de(e3[2], t3, n3, r2);
|
|
1822
|
-
throw "Unreachable";
|
|
1823
|
-
}(e2, this.realtimeClient, this.emitMutex, () => {
|
|
1970
|
+
e3.ok || s2.setError(e3);
|
|
1971
|
+
});
|
|
1972
|
+
const s2 = this.instantiateStore(e2, () => {
|
|
1824
1973
|
delete this.storeMap[t2], this.connection.unsubscribe(e2);
|
|
1825
1974
|
});
|
|
1826
|
-
return this.storeMap[t2] =
|
|
1975
|
+
return this.storeMap[t2] = s2, s2;
|
|
1827
1976
|
}
|
|
1828
1977
|
destroy() {
|
|
1829
|
-
this.storeMap = {}, this.connection.destroy();
|
|
1978
|
+
this.storeMap = {}, this.convDataStores = {}, this.connection.destroy();
|
|
1830
1979
|
}
|
|
1831
1980
|
isConnected() {
|
|
1832
1981
|
return this.connection.isConnected();
|
|
1833
1982
|
}
|
|
1983
|
+
instantiateStore(e2, t2) {
|
|
1984
|
+
if (s(e2, ["users", "*"])) return new G(e2[1], this.realtimeClient, this.emitMutex, t2);
|
|
1985
|
+
if (s(e2, ["me", "conversations", "*"])) return new ue(this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, t2);
|
|
1986
|
+
if (s(e2, ["me", "conversations", "*", "messages"])) return new ie(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
1987
|
+
if (s(e2, ["me", "conversations", "*", "participants"])) return new pe(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
1988
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) return new he(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
1989
|
+
if (s(e2, ["me", "conversations"])) return new ge((e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, t2);
|
|
1990
|
+
throw "Unreachable";
|
|
1991
|
+
}
|
|
1992
|
+
subscribeConvData(e2) {
|
|
1993
|
+
const t2 = "string" == typeof e2 ? e2 : e2.id;
|
|
1994
|
+
if (Object.hasOwnProperty.call(this.convDataStores, t2)) {
|
|
1995
|
+
const e3 = this.convDataStores[t2];
|
|
1996
|
+
return { store: e3, unsubscribe: e3.registerInternalSubscription() };
|
|
1997
|
+
}
|
|
1998
|
+
const s2 = new be(e2, this.realtimeClient, this.emitMutex, () => {
|
|
1999
|
+
delete this.convDataStores[t2];
|
|
2000
|
+
});
|
|
2001
|
+
return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
|
|
2002
|
+
}
|
|
1834
2003
|
}
|
|
1835
|
-
function
|
|
2004
|
+
function Ae(e2) {
|
|
1836
2005
|
return `/${e2.join("/")}`;
|
|
1837
2006
|
}
|
|
1838
|
-
class
|
|
2007
|
+
class Ee {
|
|
1839
2008
|
constructor(e2, t2, s2) {
|
|
1840
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
2009
|
+
this.userId = t2, this.alive = true, this.connection = new Ce(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
1841
2010
|
this.destroy();
|
|
1842
2011
|
});
|
|
1843
2012
|
}
|
|
@@ -1862,7 +2031,7 @@ class we {
|
|
|
1862
2031
|
listMessages(e2, t2) {
|
|
1863
2032
|
return __async(this, null, function* () {
|
|
1864
2033
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
1865
|
-
if (!s2.ok) return
|
|
2034
|
+
if (!s2.ok) return ke(s2, "Listing messages in " + e2);
|
|
1866
2035
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
1867
2036
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
1868
2037
|
return c(r2.map(({ value: e3 }) => e3));
|
|
@@ -1891,7 +2060,7 @@ class we {
|
|
|
1891
2060
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
1892
2061
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
1893
2062
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
1894
|
-
if (!s2.ok) return
|
|
2063
|
+
if (!s2.ok) return ke(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
1895
2064
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
1896
2065
|
if (!r2.ok) return r2;
|
|
1897
2066
|
const i2 = r2.value;
|
|
@@ -1902,7 +2071,7 @@ class we {
|
|
|
1902
2071
|
return __async(this, null, function* () {
|
|
1903
2072
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
1904
2073
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
1905
|
-
if (!t2.ok) return
|
|
2074
|
+
if (!t2.ok) return ke(t2, "Get user " + e2);
|
|
1906
2075
|
return c(this.createUserSnapshot(t2.value.data));
|
|
1907
2076
|
});
|
|
1908
2077
|
}
|
|
@@ -1913,15 +2082,15 @@ class we {
|
|
|
1913
2082
|
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: te(e2.content, {}) };
|
|
1914
2083
|
}
|
|
1915
2084
|
}
|
|
1916
|
-
function
|
|
2085
|
+
function ke(e2, t2) {
|
|
1917
2086
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
1918
2087
|
}
|
|
1919
|
-
function
|
|
2088
|
+
function xe(e2, s2) {
|
|
1920
2089
|
var _a2;
|
|
1921
2090
|
if (s2.ok) return s2.value;
|
|
1922
2091
|
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));
|
|
1923
2092
|
}
|
|
1924
|
-
class
|
|
2093
|
+
class Te {
|
|
1925
2094
|
constructor(e2, t2) {
|
|
1926
2095
|
this.id = e2, this._realtimeClient = t2;
|
|
1927
2096
|
}
|
|
@@ -1931,7 +2100,7 @@ class Ce {
|
|
|
1931
2100
|
get() {
|
|
1932
2101
|
return __async(this, null, function* () {
|
|
1933
2102
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
1934
|
-
return
|
|
2103
|
+
return xe("Get user " + this.id, e2);
|
|
1935
2104
|
});
|
|
1936
2105
|
}
|
|
1937
2106
|
set(t2) {
|
|
@@ -1952,7 +2121,7 @@ class Ce {
|
|
|
1952
2121
|
return this._realtimeClient.subscribe(["users", this.brandedId], e2);
|
|
1953
2122
|
}
|
|
1954
2123
|
}
|
|
1955
|
-
class
|
|
2124
|
+
class Se {
|
|
1956
2125
|
constructor(e2, t2, s2) {
|
|
1957
2126
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
1958
2127
|
}
|
|
@@ -1996,7 +2165,7 @@ class Ee {
|
|
|
1996
2165
|
});
|
|
1997
2166
|
}
|
|
1998
2167
|
}
|
|
1999
|
-
function
|
|
2168
|
+
function Ie(e2) {
|
|
2000
2169
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
2001
2170
|
let s2 = 0;
|
|
2002
2171
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -2014,7 +2183,7 @@ function ke(e2) {
|
|
|
2014
2183
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
2015
2184
|
return a2;
|
|
2016
2185
|
}
|
|
2017
|
-
const
|
|
2186
|
+
const De = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
2018
2187
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
2019
2188
|
}(e2, (e3) => {
|
|
2020
2189
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -2027,14 +2196,14 @@ const xe = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2027
2196
|
case "bulletList":
|
|
2028
2197
|
case "bulletpoint":
|
|
2029
2198
|
case "bulletPoint":
|
|
2030
|
-
return [{ type: e3.type, children:
|
|
2199
|
+
return [{ type: e3.type, children: De(e3.children, t2, e3.type) }];
|
|
2031
2200
|
case "link":
|
|
2032
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
2201
|
+
return [{ type: e3.type, url: e3.url, children: De(e3.children, t2, e3.type) }];
|
|
2033
2202
|
case "actionlink":
|
|
2034
2203
|
case "actionLink":
|
|
2035
2204
|
case "actionbutton":
|
|
2036
2205
|
case "actionButton":
|
|
2037
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
2206
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: De(e3.children, t2, e3.type) }];
|
|
2038
2207
|
case "mention":
|
|
2039
2208
|
case "autolink":
|
|
2040
2209
|
case "autoLink":
|
|
@@ -2049,7 +2218,7 @@ const xe = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2049
2218
|
return [e3];
|
|
2050
2219
|
}
|
|
2051
2220
|
});
|
|
2052
|
-
function
|
|
2221
|
+
function Me(e2, t2) {
|
|
2053
2222
|
return (s2) => {
|
|
2054
2223
|
const n2 = s2;
|
|
2055
2224
|
let r2 = 0;
|
|
@@ -2062,29 +2231,29 @@ function Te(e2, t2) {
|
|
|
2062
2231
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
2063
2232
|
};
|
|
2064
2233
|
}
|
|
2065
|
-
const
|
|
2066
|
-
var
|
|
2067
|
-
const
|
|
2234
|
+
const Fe = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2235
|
+
var Be = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(Be || {});
|
|
2236
|
+
const Re = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
2068
2237
|
const t2 = [];
|
|
2069
2238
|
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");
|
|
2070
|
-
}),
|
|
2071
|
-
function
|
|
2072
|
-
return
|
|
2239
|
+
}), Ne = { _: 1, "*": 4, "~": 2 };
|
|
2240
|
+
function Pe(e2) {
|
|
2241
|
+
return _e(e2, 0);
|
|
2073
2242
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const s2 =
|
|
2076
|
-
const t3 =
|
|
2243
|
+
function _e(e2, t2 = 0) {
|
|
2244
|
+
const s2 = Re[t2], n2 = s2 ? function(e3) {
|
|
2245
|
+
const t3 = Oe.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Fe}])(?:${e3.source})(?=[\\s${Fe}]|$)`, "g")), s3 = Me(t3, (e4) => {
|
|
2077
2246
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
2078
|
-
return [" ", { type:
|
|
2247
|
+
return [" ", { type: Be[Ne[t4]], children: [s4] }];
|
|
2079
2248
|
});
|
|
2080
2249
|
return (e4) => {
|
|
2081
2250
|
const [t4, ...n3] = s3(" " + e4);
|
|
2082
2251
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
2083
2252
|
};
|
|
2084
2253
|
}(s2) : () => [e2];
|
|
2085
|
-
return
|
|
2254
|
+
return De(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? _e(e3, t2 | Be[s3]) : [e3]);
|
|
2086
2255
|
}
|
|
2087
|
-
const
|
|
2256
|
+
const Oe = function() {
|
|
2088
2257
|
const e2 = function() {
|
|
2089
2258
|
try {
|
|
2090
2259
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -2100,18 +2269,18 @@ const Re = function() {
|
|
|
2100
2269
|
return e2.set(t2, n2), n2;
|
|
2101
2270
|
} };
|
|
2102
2271
|
}();
|
|
2103
|
-
function
|
|
2272
|
+
function Ue(e2, t2) {
|
|
2104
2273
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
2105
2274
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
2106
2275
|
return -1;
|
|
2107
2276
|
}
|
|
2108
|
-
function
|
|
2277
|
+
function je(e2, t2) {
|
|
2109
2278
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
2110
2279
|
}
|
|
2111
|
-
function
|
|
2280
|
+
function $e(e2) {
|
|
2112
2281
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
2113
2282
|
}
|
|
2114
|
-
var
|
|
2283
|
+
var We = function() {
|
|
2115
2284
|
function e2(e3) {
|
|
2116
2285
|
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 || "";
|
|
2117
2286
|
}
|
|
@@ -2130,11 +2299,11 @@ var Oe = function() {
|
|
|
2130
2299
|
}, e2.prototype.setClass = function(e3) {
|
|
2131
2300
|
return this.setAttr("class", e3);
|
|
2132
2301
|
}, e2.prototype.addClass = function(e3) {
|
|
2133
|
-
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 ===
|
|
2302
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === Ue(r2, t2) && r2.push(t2);
|
|
2134
2303
|
return this.getAttrs().class = r2.join(" "), this;
|
|
2135
2304
|
}, e2.prototype.removeClass = function(e3) {
|
|
2136
2305
|
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); r2.length && (t2 = i2.shift()); ) {
|
|
2137
|
-
var a2 =
|
|
2306
|
+
var a2 = Ue(r2, t2);
|
|
2138
2307
|
-1 !== a2 && r2.splice(a2, 1);
|
|
2139
2308
|
}
|
|
2140
2309
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -2160,12 +2329,12 @@ var Oe = function() {
|
|
|
2160
2329
|
return t2.join(" ");
|
|
2161
2330
|
}, e2;
|
|
2162
2331
|
}();
|
|
2163
|
-
var
|
|
2332
|
+
var qe = function() {
|
|
2164
2333
|
function e2(e3) {
|
|
2165
2334
|
void 0 === e3 && (e3 = {}), this.newWindow = false, this.truncate = {}, this.className = "", this.newWindow = e3.newWindow || false, this.truncate = e3.truncate || {}, this.className = e3.className || "";
|
|
2166
2335
|
}
|
|
2167
2336
|
return e2.prototype.build = function(e3) {
|
|
2168
|
-
return new
|
|
2337
|
+
return new We({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
2169
2338
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2170
2339
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2171
2340
|
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;
|
|
@@ -2235,7 +2404,7 @@ var Ue = function() {
|
|
|
2235
2404
|
}(e4, t3, s3);
|
|
2236
2405
|
}(e3, s2);
|
|
2237
2406
|
}, e2;
|
|
2238
|
-
}(),
|
|
2407
|
+
}(), He = function() {
|
|
2239
2408
|
function e2(e3) {
|
|
2240
2409
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2241
2410
|
}
|
|
@@ -2250,30 +2419,30 @@ var Ue = function() {
|
|
|
2250
2419
|
}, e2.prototype.buildTag = function() {
|
|
2251
2420
|
return this.tagBuilder.build(this);
|
|
2252
2421
|
}, e2;
|
|
2253
|
-
}(),
|
|
2254
|
-
return
|
|
2422
|
+
}(), Ge = function(e2, t2) {
|
|
2423
|
+
return Ge = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2255
2424
|
e3.__proto__ = t3;
|
|
2256
2425
|
} || function(e3, t3) {
|
|
2257
2426
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2258
|
-
},
|
|
2427
|
+
}, Ge(e2, t2);
|
|
2259
2428
|
};
|
|
2260
|
-
function
|
|
2429
|
+
function Le(e2, t2) {
|
|
2261
2430
|
function s2() {
|
|
2262
2431
|
this.constructor = e2;
|
|
2263
2432
|
}
|
|
2264
|
-
|
|
2433
|
+
Ge(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2265
2434
|
}
|
|
2266
|
-
var
|
|
2267
|
-
return
|
|
2435
|
+
var ze, Je = function() {
|
|
2436
|
+
return Je = Object.assign || function(e2) {
|
|
2268
2437
|
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]);
|
|
2269
2438
|
return e2;
|
|
2270
|
-
},
|
|
2271
|
-
},
|
|
2439
|
+
}, Je.apply(this, arguments);
|
|
2440
|
+
}, Ye = function(e2) {
|
|
2272
2441
|
function t2(t3) {
|
|
2273
2442
|
var s2 = e2.call(this, t3) || this;
|
|
2274
2443
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2275
2444
|
}
|
|
2276
|
-
return
|
|
2445
|
+
return Le(t2, e2), t2.prototype.getType = function() {
|
|
2277
2446
|
return "email";
|
|
2278
2447
|
}, t2.prototype.getEmail = function() {
|
|
2279
2448
|
return this.email;
|
|
@@ -2282,12 +2451,12 @@ var qe, He = function() {
|
|
|
2282
2451
|
}, t2.prototype.getAnchorText = function() {
|
|
2283
2452
|
return this.email;
|
|
2284
2453
|
}, t2;
|
|
2285
|
-
}(
|
|
2454
|
+
}(He), Qe = function(e2) {
|
|
2286
2455
|
function t2(t3) {
|
|
2287
2456
|
var s2 = e2.call(this, t3) || this;
|
|
2288
2457
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2289
2458
|
}
|
|
2290
|
-
return
|
|
2459
|
+
return Le(t2, e2), t2.prototype.getType = function() {
|
|
2291
2460
|
return "hashtag";
|
|
2292
2461
|
}, t2.prototype.getServiceName = function() {
|
|
2293
2462
|
return this.serviceName;
|
|
@@ -2308,12 +2477,12 @@ var qe, He = function() {
|
|
|
2308
2477
|
}, t2.prototype.getAnchorText = function() {
|
|
2309
2478
|
return "#" + this.hashtag;
|
|
2310
2479
|
}, t2;
|
|
2311
|
-
}(
|
|
2480
|
+
}(He), Ve = function(e2) {
|
|
2312
2481
|
function t2(t3) {
|
|
2313
2482
|
var s2 = e2.call(this, t3) || this;
|
|
2314
2483
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2315
2484
|
}
|
|
2316
|
-
return
|
|
2485
|
+
return Le(t2, e2), t2.prototype.getType = function() {
|
|
2317
2486
|
return "mention";
|
|
2318
2487
|
}, t2.prototype.getMention = function() {
|
|
2319
2488
|
return this.mention;
|
|
@@ -2336,12 +2505,12 @@ var qe, He = function() {
|
|
|
2336
2505
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2337
2506
|
return s2 && t3.push(s2), t3;
|
|
2338
2507
|
}, t2;
|
|
2339
|
-
}(
|
|
2508
|
+
}(He), Ze = function(e2) {
|
|
2340
2509
|
function t2(t3) {
|
|
2341
2510
|
var s2 = e2.call(this, t3) || this;
|
|
2342
2511
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2343
2512
|
}
|
|
2344
|
-
return
|
|
2513
|
+
return Le(t2, e2), t2.prototype.getType = function() {
|
|
2345
2514
|
return "phone";
|
|
2346
2515
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2347
2516
|
return this.number;
|
|
@@ -2352,12 +2521,12 @@ var qe, He = function() {
|
|
|
2352
2521
|
}, t2.prototype.getAnchorText = function() {
|
|
2353
2522
|
return this.matchedText;
|
|
2354
2523
|
}, t2;
|
|
2355
|
-
}(
|
|
2524
|
+
}(He), Ke = function(e2) {
|
|
2356
2525
|
function t2(t3) {
|
|
2357
2526
|
var s2 = e2.call(this, t3) || this;
|
|
2358
2527
|
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;
|
|
2359
2528
|
}
|
|
2360
|
-
return
|
|
2529
|
+
return Le(t2, e2), t2.prototype.getType = function() {
|
|
2361
2530
|
return "url";
|
|
2362
2531
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2363
2532
|
return this.urlMatchType;
|
|
@@ -2385,19 +2554,19 @@ var qe, He = function() {
|
|
|
2385
2554
|
return t3;
|
|
2386
2555
|
}
|
|
2387
2556
|
}, t2;
|
|
2388
|
-
}(
|
|
2557
|
+
}(He), Xe = function(e2) {
|
|
2389
2558
|
this.__jsduckDummyDocProp = null, this.tagBuilder = e2.tagBuilder;
|
|
2390
|
-
},
|
|
2391
|
-
return "(?=(" +
|
|
2392
|
-
},
|
|
2393
|
-
return "(?:" +
|
|
2394
|
-
}, ht = new RegExp("[" + at + "]"), dt = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, pt = new RegExp("[" + at + "!#$%&'*+/=?^_`{|}~-]"), ft = new RegExp("^" + dt.source + "$"), mt = function(e2) {
|
|
2559
|
+
}, et = /[A-Za-z]/, tt = /[\d]/, st = /[\D]/, nt = /\s/, rt = /['"]/, it = /[\x00-\x1F\x7F]/, at = /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, ot = at + /\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, ut = /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, ct = ot + ut, lt = ot + ut, ht = "(?:[" + ut + "]{1,3}\\.){3}[" + ut + "]{1,3}", dt = "[" + lt + "](?:[" + lt + "\\-]{0,61}[" + lt + "])?", pt = function(e2) {
|
|
2560
|
+
return "(?=(" + dt + "))\\" + e2;
|
|
2561
|
+
}, ft = function(e2) {
|
|
2562
|
+
return "(?:" + pt(e2) + "(?:\\." + pt(e2 + 1) + "){0,126}|" + ht + ")";
|
|
2563
|
+
}, mt = new RegExp("[" + lt + "]"), gt = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, vt = new RegExp("[" + lt + "!#$%&'*+/=?^_`{|}~-]"), wt = new RegExp("^" + gt.source + "$"), bt = function(e2) {
|
|
2395
2564
|
function t2() {
|
|
2396
2565
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2397
|
-
return t3.localPartCharRegex =
|
|
2566
|
+
return t3.localPartCharRegex = vt, t3.strictTldRegex = wt, t3;
|
|
2398
2567
|
}
|
|
2399
|
-
return
|
|
2400
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2568
|
+
return Le(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2569
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new yt(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2401
2570
|
var h2 = e3.charAt(u2);
|
|
2402
2571
|
switch (c2) {
|
|
2403
2572
|
case 0:
|
|
@@ -2419,48 +2588,48 @@ var qe, He = function() {
|
|
|
2419
2588
|
v2(h2);
|
|
2420
2589
|
break;
|
|
2421
2590
|
case 6:
|
|
2422
|
-
|
|
2591
|
+
w2(h2);
|
|
2423
2592
|
break;
|
|
2424
2593
|
case 7:
|
|
2425
|
-
|
|
2594
|
+
b2(h2);
|
|
2426
2595
|
break;
|
|
2427
2596
|
default:
|
|
2428
|
-
|
|
2597
|
+
$e(c2);
|
|
2429
2598
|
}
|
|
2430
2599
|
u2++;
|
|
2431
2600
|
}
|
|
2432
|
-
return
|
|
2601
|
+
return A2(), r2;
|
|
2433
2602
|
function d2(e4) {
|
|
2434
2603
|
"m" === e4 ? y2(1) : s2.test(e4) && y2();
|
|
2435
2604
|
}
|
|
2436
2605
|
function p2(e4, t4) {
|
|
2437
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2606
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new yt(Je(Je({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
|
|
2438
2607
|
}
|
|
2439
2608
|
function f2(e4) {
|
|
2440
|
-
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) ||
|
|
2609
|
+
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
|
|
2441
2610
|
}
|
|
2442
2611
|
function m2(e4) {
|
|
2443
|
-
"." === e4 || "@" === e4 ?
|
|
2612
|
+
"." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
|
|
2444
2613
|
}
|
|
2445
2614
|
function g2(e4) {
|
|
2446
|
-
|
|
2615
|
+
mt.test(e4) ? c2 = 5 : C2();
|
|
2447
2616
|
}
|
|
2448
2617
|
function v2(e4) {
|
|
2449
|
-
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 :
|
|
2450
|
-
}
|
|
2451
|
-
function b2(e4) {
|
|
2452
|
-
"-" === e4 || "." === e4 ? C2() : ht.test(e4) ? c2 = 5 : C2();
|
|
2618
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : mt.test(e4) || A2();
|
|
2453
2619
|
}
|
|
2454
2620
|
function w2(e4) {
|
|
2455
|
-
"
|
|
2621
|
+
"-" === e4 || "." === e4 ? A2() : mt.test(e4) ? c2 = 5 : A2();
|
|
2622
|
+
}
|
|
2623
|
+
function b2(e4) {
|
|
2624
|
+
"." === e4 || "-" === e4 ? A2() : mt.test(e4) ? (c2 = 5, l2 = new yt(Je(Je({}, l2), { hasDomainDot: true }))) : A2();
|
|
2456
2625
|
}
|
|
2457
2626
|
function y2(e4) {
|
|
2458
|
-
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new
|
|
2627
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new yt({ idx: u2 });
|
|
2459
2628
|
}
|
|
2460
|
-
function
|
|
2629
|
+
function C2() {
|
|
2461
2630
|
c2 = 0, l2 = a2;
|
|
2462
2631
|
}
|
|
2463
|
-
function
|
|
2632
|
+
function A2() {
|
|
2464
2633
|
if (l2.hasDomainDot) {
|
|
2465
2634
|
var s3 = e3.slice(l2.idx, u2);
|
|
2466
2635
|
/[-.]$/.test(s3) && (s3 = s3.slice(0, -1));
|
|
@@ -2468,14 +2637,14 @@ var qe, He = function() {
|
|
|
2468
2637
|
(function(e4) {
|
|
2469
2638
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2470
2639
|
return n2.test(s4);
|
|
2471
|
-
})(i3) && r2.push(new
|
|
2640
|
+
})(i3) && r2.push(new Ye({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2472
2641
|
}
|
|
2473
|
-
|
|
2642
|
+
C2();
|
|
2474
2643
|
}
|
|
2475
2644
|
}, t2;
|
|
2476
|
-
}(
|
|
2645
|
+
}(Xe), yt = function(e2) {
|
|
2477
2646
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2478
|
-
},
|
|
2647
|
+
}, Ct = function() {
|
|
2479
2648
|
function e2() {
|
|
2480
2649
|
}
|
|
2481
2650
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2493,16 +2662,16 @@ var qe, He = function() {
|
|
|
2493
2662
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2494
2663
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2495
2664
|
return !(!e3 || !t2) && (!this.hasFullProtocolRegex.test(t2) && !this.hasWordCharAfterProtocolRegex.test(e3));
|
|
2496
|
-
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" +
|
|
2497
|
-
}(),
|
|
2665
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + at + "]"), 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;
|
|
2666
|
+
}(), At = (ze = new RegExp("[/?#](?:[" + lt + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + lt + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, ft(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, ft(6), ")", "|", "(", "(//)?", ft(10) + "\\.", gt.source, "(?![-" + ct + "])", ")", ")", "(?::[0-9]+)?", "(?:" + ze.source + ")?"].join(""), "gi")), Et = new RegExp("[" + lt + "]"), kt = function(e2) {
|
|
2498
2667
|
function t2(t3) {
|
|
2499
2668
|
var s2 = e2.call(this, t3) || this;
|
|
2500
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2669
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = At, s2.wordCharRegExp = Et, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2501
2670
|
}
|
|
2502
|
-
return
|
|
2671
|
+
return Le(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2503
2672
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2504
2673
|
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);
|
|
2505
|
-
if (!
|
|
2674
|
+
if (!Ct.isValid(s3, u3)) return "continue";
|
|
2506
2675
|
if (p2 > 0 && "@" === m2) return "continue";
|
|
2507
2676
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
|
|
2508
2677
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2514,11 +2683,11 @@ var qe, He = function() {
|
|
|
2514
2683
|
return !!u3 && -1 !== u3.indexOf(e4);
|
|
2515
2684
|
});
|
|
2516
2685
|
if (v2) {
|
|
2517
|
-
var
|
|
2518
|
-
s3 = s3.substr(
|
|
2686
|
+
var w2 = s3.indexOf(v2);
|
|
2687
|
+
s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
|
|
2519
2688
|
}
|
|
2520
|
-
var
|
|
2521
|
-
o2.push(new
|
|
2689
|
+
var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
|
|
2690
|
+
o2.push(new Ke({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2522
2691
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2523
2692
|
return o2;
|
|
2524
2693
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2538,58 +2707,58 @@ var qe, He = function() {
|
|
|
2538
2707
|
if (!e3) return -1;
|
|
2539
2708
|
var s2 = 0;
|
|
2540
2709
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2541
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2710
|
+
var n2 = new RegExp("^((.?//)?[-." + lt + "]*[-" + lt + "]\\.[-" + lt + "]+)").exec(e3);
|
|
2542
2711
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2543
2712
|
}, t2;
|
|
2544
|
-
}(
|
|
2713
|
+
}(Xe), xt = new RegExp("#[_" + lt + "]{1,139}(?![_" + lt + "])", "g"), Tt = new RegExp("[^" + lt + "]"), St = function(e2) {
|
|
2545
2714
|
function t2(t3) {
|
|
2546
2715
|
var s2 = e2.call(this, t3) || this;
|
|
2547
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2716
|
+
return s2.serviceName = "twitter", s2.matcherRegex = xt, s2.nonWordCharRegex = Tt, s2.serviceName = t3.serviceName, s2;
|
|
2548
2717
|
}
|
|
2549
|
-
return
|
|
2718
|
+
return Le(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2550
2719
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2551
2720
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2552
2721
|
if (0 === o2 || n2.test(u2)) {
|
|
2553
2722
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2554
|
-
a2.push(new
|
|
2723
|
+
a2.push(new Qe({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2555
2724
|
}
|
|
2556
2725
|
}
|
|
2557
2726
|
return a2;
|
|
2558
2727
|
}, t2;
|
|
2559
|
-
}(
|
|
2728
|
+
}(Xe), It = 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"), Dt = function(e2) {
|
|
2560
2729
|
function t2() {
|
|
2561
2730
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2562
|
-
return t3.matcherRegex =
|
|
2731
|
+
return t3.matcherRegex = It, t3;
|
|
2563
2732
|
}
|
|
2564
|
-
return
|
|
2733
|
+
return Le(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2565
2734
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2566
2735
|
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/);
|
|
2567
|
-
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new
|
|
2736
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new Ze({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2568
2737
|
}
|
|
2569
2738
|
return r2;
|
|
2570
2739
|
}, t2.prototype.testMatch = function(e3) {
|
|
2571
|
-
return
|
|
2740
|
+
return st.test(e3);
|
|
2572
2741
|
}, t2;
|
|
2573
|
-
}(
|
|
2742
|
+
}(Xe), Mt = new RegExp("@[_" + lt + "]{1,50}(?![_" + lt + "])", "g"), Ft = new RegExp("@[_." + lt + "]{1,30}(?![_" + lt + "])", "g"), Bt = new RegExp("@[-_." + lt + "]{1,50}(?![-_" + lt + "])", "g"), Rt = new RegExp("[^" + lt + "]"), Nt = function(e2) {
|
|
2574
2743
|
function t2(t3) {
|
|
2575
2744
|
var s2 = e2.call(this, t3) || this;
|
|
2576
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2745
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Mt, instagram: Ft, soundcloud: Bt }, s2.nonWordCharRegex = Rt, s2.serviceName = t3.serviceName, s2;
|
|
2577
2746
|
}
|
|
2578
|
-
return
|
|
2747
|
+
return Le(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2579
2748
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2580
2749
|
if (!n2) return a2;
|
|
2581
2750
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2582
2751
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2583
2752
|
if (0 === o2 || r2.test(u2)) {
|
|
2584
2753
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2585
|
-
a2.push(new
|
|
2754
|
+
a2.push(new Ve({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2586
2755
|
}
|
|
2587
2756
|
}
|
|
2588
2757
|
return a2;
|
|
2589
2758
|
}, t2;
|
|
2590
|
-
}(
|
|
2591
|
-
function
|
|
2592
|
-
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new
|
|
2759
|
+
}(Xe);
|
|
2760
|
+
function Pt(e2, t2) {
|
|
2761
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new _t(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2593
2762
|
var f2 = e2.charAt(c2);
|
|
2594
2763
|
switch (h2) {
|
|
2595
2764
|
case 0:
|
|
@@ -2599,22 +2768,22 @@ function Mt(e2, t2) {
|
|
|
2599
2768
|
g2(f2);
|
|
2600
2769
|
break;
|
|
2601
2770
|
case 2:
|
|
2602
|
-
|
|
2771
|
+
w2(f2);
|
|
2603
2772
|
break;
|
|
2604
2773
|
case 3:
|
|
2605
2774
|
v2(f2);
|
|
2606
2775
|
break;
|
|
2607
2776
|
case 4:
|
|
2608
|
-
|
|
2777
|
+
b2(f2);
|
|
2609
2778
|
break;
|
|
2610
2779
|
case 5:
|
|
2611
2780
|
y2(f2);
|
|
2612
2781
|
break;
|
|
2613
2782
|
case 6:
|
|
2614
|
-
|
|
2783
|
+
C2(f2);
|
|
2615
2784
|
break;
|
|
2616
2785
|
case 7:
|
|
2617
|
-
|
|
2786
|
+
A2(f2);
|
|
2618
2787
|
break;
|
|
2619
2788
|
case 8:
|
|
2620
2789
|
E2(f2);
|
|
@@ -2629,19 +2798,19 @@ function Mt(e2, t2) {
|
|
|
2629
2798
|
T2(f2);
|
|
2630
2799
|
break;
|
|
2631
2800
|
case 12:
|
|
2632
|
-
|
|
2801
|
+
S2(f2);
|
|
2633
2802
|
break;
|
|
2634
2803
|
case 13:
|
|
2635
|
-
|
|
2804
|
+
I2();
|
|
2636
2805
|
break;
|
|
2637
2806
|
case 14:
|
|
2638
2807
|
D2(f2);
|
|
2639
2808
|
break;
|
|
2640
2809
|
case 15:
|
|
2641
|
-
|
|
2810
|
+
M2(f2);
|
|
2642
2811
|
break;
|
|
2643
2812
|
case 16:
|
|
2644
|
-
|
|
2813
|
+
F2(f2);
|
|
2645
2814
|
break;
|
|
2646
2815
|
case 17:
|
|
2647
2816
|
B2(f2);
|
|
@@ -2656,7 +2825,7 @@ function Mt(e2, t2) {
|
|
|
2656
2825
|
P2(f2);
|
|
2657
2826
|
break;
|
|
2658
2827
|
default:
|
|
2659
|
-
|
|
2828
|
+
$e(h2);
|
|
2660
2829
|
}
|
|
2661
2830
|
c2++;
|
|
2662
2831
|
}
|
|
@@ -2664,25 +2833,25 @@ function Mt(e2, t2) {
|
|
|
2664
2833
|
"<" === e3 && O2();
|
|
2665
2834
|
}
|
|
2666
2835
|
function g2(e3) {
|
|
2667
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2836
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new _t(Je(Je({}, p2), { isClosing: true }))) : "<" === e3 ? O2() : et.test(e3) ? (h2 = 3, p2 = new _t(Je(Je({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2668
2837
|
}
|
|
2669
2838
|
function v2(e3) {
|
|
2670
|
-
|
|
2671
|
-
}
|
|
2672
|
-
function b2(e3) {
|
|
2673
|
-
">" === e3 ? _2() : Ve.test(e3) ? h2 = 3 : _2();
|
|
2839
|
+
nt.test(e3) ? (p2 = new _t(Je(Je({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? O2() : "/" === e3 ? (p2 = new _t(Je(Je({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new _t(Je(Je({}, p2), { name: j2() })), U2()) : et.test(e3) || tt.test(e3) || ":" === e3 || _2();
|
|
2674
2840
|
}
|
|
2675
2841
|
function w2(e3) {
|
|
2676
|
-
|
|
2842
|
+
">" === e3 ? _2() : et.test(e3) ? h2 = 3 : _2();
|
|
2677
2843
|
}
|
|
2678
|
-
function
|
|
2679
|
-
|
|
2844
|
+
function b2(e3) {
|
|
2845
|
+
nt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || rt.test(e3) || it.test(e3) ? _2() : h2 = 5);
|
|
2680
2846
|
}
|
|
2681
|
-
function
|
|
2682
|
-
|
|
2847
|
+
function y2(e3) {
|
|
2848
|
+
nt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : rt.test(e3) && _2();
|
|
2683
2849
|
}
|
|
2684
2850
|
function C2(e3) {
|
|
2685
|
-
|
|
2851
|
+
nt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : rt.test(e3) ? _2() : h2 = 5);
|
|
2852
|
+
}
|
|
2853
|
+
function A2(e3) {
|
|
2854
|
+
nt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? _2() : "<" === e3 ? O2() : h2 = 10);
|
|
2686
2855
|
}
|
|
2687
2856
|
function E2(e3) {
|
|
2688
2857
|
'"' === e3 && (h2 = 11);
|
|
@@ -2691,24 +2860,24 @@ function Mt(e2, t2) {
|
|
|
2691
2860
|
"'" === e3 && (h2 = 11);
|
|
2692
2861
|
}
|
|
2693
2862
|
function x2(e3) {
|
|
2694
|
-
|
|
2863
|
+
nt.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && O2();
|
|
2695
2864
|
}
|
|
2696
2865
|
function T2(e3) {
|
|
2697
|
-
|
|
2866
|
+
nt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2698
2867
|
}
|
|
2699
|
-
function
|
|
2700
|
-
">" === e3 ? (p2 = new
|
|
2868
|
+
function S2(e3) {
|
|
2869
|
+
">" === e3 ? (p2 = new _t(Je(Je({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2701
2870
|
}
|
|
2702
|
-
function
|
|
2703
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2871
|
+
function I2(t3) {
|
|
2872
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new _t(Je(Je({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new _t(Je(Je({}, p2), { type: "doctype" })), h2 = 20) : _2();
|
|
2704
2873
|
}
|
|
2705
2874
|
function D2(e3) {
|
|
2706
2875
|
"-" === e3 ? h2 = 15 : ">" === e3 ? _2() : h2 = 16;
|
|
2707
2876
|
}
|
|
2708
|
-
function
|
|
2877
|
+
function M2(e3) {
|
|
2709
2878
|
"-" === e3 ? h2 = 18 : ">" === e3 ? _2() : h2 = 16;
|
|
2710
2879
|
}
|
|
2711
|
-
function
|
|
2880
|
+
function F2(e3) {
|
|
2712
2881
|
"-" === e3 && (h2 = 17);
|
|
2713
2882
|
}
|
|
2714
2883
|
function B2(e3) {
|
|
@@ -2727,21 +2896,21 @@ function Mt(e2, t2) {
|
|
|
2727
2896
|
h2 = 0, p2 = u2;
|
|
2728
2897
|
}
|
|
2729
2898
|
function O2() {
|
|
2730
|
-
h2 = 1, p2 = new
|
|
2899
|
+
h2 = 1, p2 = new _t({ idx: c2 });
|
|
2731
2900
|
}
|
|
2732
2901
|
function U2() {
|
|
2733
2902
|
var t3 = e2.slice(d2, p2.idx);
|
|
2734
2903
|
t3 && i2(t3, d2), "comment" === p2.type ? a2(p2.idx) : "doctype" === p2.type ? o2(p2.idx) : (p2.isOpening && n2(p2.name, p2.idx), p2.isClosing && r2(p2.name, p2.idx)), _2(), d2 = c2 + 1;
|
|
2735
2904
|
}
|
|
2736
|
-
function
|
|
2905
|
+
function j2() {
|
|
2737
2906
|
var t3 = p2.idx + (p2.isClosing ? 2 : 1);
|
|
2738
2907
|
return e2.slice(t3, c2).toLowerCase();
|
|
2739
2908
|
}
|
|
2740
2909
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2741
2910
|
}
|
|
2742
|
-
var
|
|
2911
|
+
var _t = function(e2) {
|
|
2743
2912
|
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;
|
|
2744
|
-
},
|
|
2913
|
+
}, Ot = function() {
|
|
2745
2914
|
function e2(t2) {
|
|
2746
2915
|
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;
|
|
2747
2916
|
var s2 = this.mention;
|
|
@@ -2765,7 +2934,7 @@ var Bt = function(e2) {
|
|
|
2765
2934
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2766
2935
|
}, e2.prototype.parse = function(e3) {
|
|
2767
2936
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2768
|
-
return
|
|
2937
|
+
return Pt(e3, { onOpenTag: function(e4) {
|
|
2769
2938
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2770
2939
|
}, onText: function(e4, s3) {
|
|
2771
2940
|
if (0 === n2) {
|
|
@@ -2804,19 +2973,19 @@ var Bt = function(e2) {
|
|
|
2804
2973
|
}
|
|
2805
2974
|
return e3;
|
|
2806
2975
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
2807
|
-
return this.hashtag ||
|
|
2976
|
+
return this.hashtag || je(e3, function(e4) {
|
|
2808
2977
|
return "hashtag" === e4.getType();
|
|
2809
|
-
}), this.email ||
|
|
2978
|
+
}), this.email || je(e3, function(e4) {
|
|
2810
2979
|
return "email" === e4.getType();
|
|
2811
|
-
}), this.phone ||
|
|
2980
|
+
}), this.phone || je(e3, function(e4) {
|
|
2812
2981
|
return "phone" === e4.getType();
|
|
2813
|
-
}), this.mention ||
|
|
2982
|
+
}), this.mention || je(e3, function(e4) {
|
|
2814
2983
|
return "mention" === e4.getType();
|
|
2815
|
-
}), this.urls.schemeMatches ||
|
|
2984
|
+
}), this.urls.schemeMatches || je(e3, function(e4) {
|
|
2816
2985
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
2817
|
-
}), this.urls.wwwMatches ||
|
|
2986
|
+
}), this.urls.wwwMatches || je(e3, function(e4) {
|
|
2818
2987
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
2819
|
-
}), this.urls.tldMatches ||
|
|
2988
|
+
}), this.urls.tldMatches || je(e3, function(e4) {
|
|
2820
2989
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
2821
2990
|
}), e3;
|
|
2822
2991
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -2836,99 +3005,99 @@ var Bt = function(e2) {
|
|
|
2836
3005
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
2837
3006
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
2838
3007
|
var t2;
|
|
2839
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
3008
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof We ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
2840
3009
|
}, e2.prototype.getMatchers = function() {
|
|
2841
3010
|
if (this.matchers) return this.matchers;
|
|
2842
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
3011
|
+
var e3 = this.getTagBuilder(), t2 = [new St({ tagBuilder: e3, serviceName: this.hashtag }), new bt({ tagBuilder: e3 }), new Dt({ tagBuilder: e3 }), new Nt({ tagBuilder: e3, serviceName: this.mention }), new kt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
2843
3012
|
return this.matchers = t2;
|
|
2844
3013
|
}, e2.prototype.getTagBuilder = function() {
|
|
2845
3014
|
var e3 = this.tagBuilder;
|
|
2846
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
2847
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
3015
|
+
return e3 || (e3 = this.tagBuilder = new qe({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
3016
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = qe, e2.HtmlTag = We, e2.matcher = { Email: bt, Hashtag: St, Matcher: Xe, Mention: Nt, Phone: Dt, Url: kt }, e2.match = { Email: Ye, Hashtag: Qe, Match: He, Mention: Ve, Phone: Ze, Url: Ke }, e2;
|
|
2848
3017
|
}();
|
|
2849
|
-
function
|
|
3018
|
+
function Ut(e2, t2 = e2) {
|
|
2850
3019
|
return { type: "autolink", url: e2, text: t2 };
|
|
2851
3020
|
}
|
|
2852
|
-
const
|
|
3021
|
+
const jt = Me(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2853
3022
|
return { type: "mention", id: e3, text: t3 };
|
|
2854
|
-
}(decodeURIComponent(t2), s2)),
|
|
3023
|
+
}(decodeURIComponent(t2), s2)), $t = Me(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
2855
3024
|
return { type: "customemoji", text: e3 };
|
|
2856
|
-
}(t2)),
|
|
3025
|
+
}(t2)), Wt = Me(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
2857
3026
|
return { type: "link", url: e3, children: t3 };
|
|
2858
|
-
}(t2, [s2])),
|
|
2859
|
-
const { action: n2, params: r2 } =
|
|
3027
|
+
}(t2, [s2])), qt = Me(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3028
|
+
const { action: n2, params: r2 } = Gt(t2);
|
|
2860
3029
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2861
3030
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
2862
3031
|
}(n2, r2, [s2]);
|
|
2863
|
-
}),
|
|
2864
|
-
const { action: n2, params: r2 } =
|
|
3032
|
+
}), Ht = Me(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3033
|
+
const { action: n2, params: r2 } = Gt(t2);
|
|
2865
3034
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2866
3035
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
2867
3036
|
}(n2, r2, [s2]);
|
|
2868
3037
|
});
|
|
2869
|
-
function
|
|
3038
|
+
function Gt(e2) {
|
|
2870
3039
|
const t2 = e2.indexOf("?");
|
|
2871
3040
|
if (-1 === t2) return { action: e2, params: {} };
|
|
2872
3041
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
2873
3042
|
}
|
|
2874
|
-
const
|
|
3043
|
+
const Lt = Me(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
2875
3044
|
return { type: "bulletlist", children: e3 };
|
|
2876
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
3045
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), zt = Me(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Jt = (e2) => {
|
|
2877
3046
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
2878
3047
|
let s2 = 0;
|
|
2879
3048
|
const n2 = [];
|
|
2880
3049
|
for (const r2 of J(e2, t2)) {
|
|
2881
3050
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
2882
3051
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
2883
|
-
const o2 =
|
|
3052
|
+
const o2 = Ut("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
2884
3053
|
n2.push(o2), s2 = a2 + i2.length;
|
|
2885
3054
|
}
|
|
2886
3055
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
2887
|
-
},
|
|
2888
|
-
const t2 =
|
|
3056
|
+
}, Yt = (e2) => Wt(e2).flatMap((e3) => "string" == typeof e3 ? Qt(e3) : ["<", ...Qt(e3.url), ...Qt("|" + e3.children[0] + ">")]), Qt = (e2) => {
|
|
3057
|
+
const t2 = Ot.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
2889
3058
|
let n2 = 0;
|
|
2890
3059
|
for (const r2 of t2) {
|
|
2891
3060
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
2892
3061
|
let o2 = i2;
|
|
2893
|
-
r2 instanceof
|
|
3062
|
+
r2 instanceof Ye ? o2 = "mailto:" + r2.getEmail() : r2 instanceof Ke && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(Ut(o2, i2)), n2 = t3 + a2;
|
|
2894
3063
|
}
|
|
2895
3064
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
2896
|
-
},
|
|
2897
|
-
function
|
|
3065
|
+
}, Vt = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
3066
|
+
function Zt(e2 = { except: [] }) {
|
|
2898
3067
|
var _a2;
|
|
2899
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
2900
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
3068
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Vt.filter((t3) => !e2.only.includes(t3));
|
|
3069
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(Lt, zt), s2.includes("Mention") || t2.singlelineSteps.push(jt), s2.includes("CustomEmoji") || t2.singlelineSteps.push($t), s2.includes("Codespan") || t2.multilineSteps.push(Me(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(Wt), s2.includes("Actions") || (t2.singlelineSteps.push(qt), t2.singlelineSteps.push(Ht)), s2.includes("Wikitext") || t2.singlelineSteps.push(Pe), s2.includes("Autolink") || t2.singlelineSteps.push(Yt, Jt), t2;
|
|
2901
3070
|
}
|
|
2902
|
-
const
|
|
3071
|
+
const Kt = function(e2) {
|
|
2903
3072
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
2904
3073
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
2905
3074
|
}("\n");
|
|
2906
|
-
function
|
|
3075
|
+
function Xt(e2, t2 = { except: [] }) {
|
|
2907
3076
|
let s2 = function(e3, t3) {
|
|
2908
3077
|
let s3 = [e3];
|
|
2909
|
-
return s3 =
|
|
2910
|
-
}(e2,
|
|
2911
|
-
return s2 =
|
|
3078
|
+
return s3 = es(s3, t3.multilineSteps), s3 = es(s3, [Kt]), s3 = es(s3, t3.singlelineSteps), s3 = ts(s3), s3;
|
|
3079
|
+
}(e2, Zt(t2));
|
|
3080
|
+
return s2 = ss(s2, false), s2;
|
|
2912
3081
|
}
|
|
2913
|
-
function
|
|
2914
|
-
return t2.reduce((e3, t3) =>
|
|
3082
|
+
function es(e2, t2) {
|
|
3083
|
+
return t2.reduce((e3, t3) => De(e3, t3), e2);
|
|
2915
3084
|
}
|
|
2916
|
-
function
|
|
3085
|
+
function ts(e2) {
|
|
2917
3086
|
const t2 = [];
|
|
2918
3087
|
let s2 = -1;
|
|
2919
|
-
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:
|
|
3088
|
+
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: ts(n2.children) }) : n2;
|
|
2920
3089
|
return t2;
|
|
2921
3090
|
}
|
|
2922
|
-
function
|
|
3091
|
+
function ss(e2, t2) {
|
|
2923
3092
|
const s2 = [];
|
|
2924
3093
|
let n2 = [];
|
|
2925
3094
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2926
3095
|
const i2 = e2[r2];
|
|
2927
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
3096
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = ss(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));
|
|
2928
3097
|
}
|
|
2929
3098
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
2930
3099
|
}
|
|
2931
|
-
class
|
|
3100
|
+
class ns {
|
|
2932
3101
|
constructor(e2, t2, s2) {
|
|
2933
3102
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2934
3103
|
}
|
|
@@ -2944,12 +3113,12 @@ class Xt {
|
|
|
2944
3113
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
2945
3114
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
2946
3115
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
2947
|
-
return
|
|
3116
|
+
return xe("Get message " + this.id, n2);
|
|
2948
3117
|
});
|
|
2949
3118
|
}
|
|
2950
3119
|
edit(t2) {
|
|
2951
3120
|
return __async(this, null, function* () {
|
|
2952
|
-
const s2 = { content:
|
|
3121
|
+
const s2 = { content: rs(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
2953
3122
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
2954
3123
|
});
|
|
2955
3124
|
}
|
|
@@ -2960,16 +3129,16 @@ class Xt {
|
|
|
2960
3129
|
});
|
|
2961
3130
|
}
|
|
2962
3131
|
}
|
|
2963
|
-
function
|
|
3132
|
+
function rs(e2) {
|
|
2964
3133
|
if ("string" == typeof e2) {
|
|
2965
|
-
return [{ type: "text", children:
|
|
3134
|
+
return [{ type: "text", children: Xt(e2) }];
|
|
2966
3135
|
}
|
|
2967
3136
|
if ("text" in e2 && e2.text) {
|
|
2968
|
-
return [{ type: "text", children:
|
|
3137
|
+
return [{ type: "text", children: Xt(e2.text) }];
|
|
2969
3138
|
}
|
|
2970
3139
|
if ("content" in e2 && e2.content) return e2.content;
|
|
2971
3140
|
}
|
|
2972
|
-
class
|
|
3141
|
+
class is {
|
|
2973
3142
|
constructor(e2, t2) {
|
|
2974
3143
|
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
2975
3144
|
}
|
|
@@ -2980,16 +3149,16 @@ class ts {
|
|
|
2980
3149
|
return this._realtimeClient.userId;
|
|
2981
3150
|
}
|
|
2982
3151
|
participant(e2) {
|
|
2983
|
-
return new
|
|
3152
|
+
return new Se("string" == typeof e2 ? e2 : e2.id, this.id, this._realtimeClient);
|
|
2984
3153
|
}
|
|
2985
3154
|
message(e2) {
|
|
2986
|
-
return new
|
|
3155
|
+
return new ns(e2, this.brandedId, this._realtimeClient);
|
|
2987
3156
|
}
|
|
2988
3157
|
get() {
|
|
2989
3158
|
return __async(this, null, function* () {
|
|
2990
3159
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
2991
3160
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
2992
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
3161
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = xe("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
2993
3162
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
2994
3163
|
});
|
|
2995
3164
|
}
|
|
@@ -3032,8 +3201,8 @@ class ts {
|
|
|
3032
3201
|
}
|
|
3033
3202
|
send(t2) {
|
|
3034
3203
|
return __async(this, null, function* () {
|
|
3035
|
-
const s2 = { content:
|
|
3036
|
-
return new
|
|
3204
|
+
const s2 = { content: as(t2), referencedMessageId: os(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: Ie((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
3205
|
+
return new ns(r2.id, this.brandedId, this._realtimeClient);
|
|
3037
3206
|
});
|
|
3038
3207
|
}
|
|
3039
3208
|
subscribeMessages(e2) {
|
|
@@ -3055,21 +3224,21 @@ class ts {
|
|
|
3055
3224
|
});
|
|
3056
3225
|
}
|
|
3057
3226
|
}
|
|
3058
|
-
function
|
|
3227
|
+
function as(e2) {
|
|
3059
3228
|
if ("string" == typeof e2) {
|
|
3060
|
-
return [{ type: "text", children:
|
|
3229
|
+
return [{ type: "text", children: Xt(e2) }];
|
|
3061
3230
|
}
|
|
3062
3231
|
if ("text" in e2) {
|
|
3063
|
-
return [{ type: "text", children:
|
|
3232
|
+
return [{ type: "text", children: Xt(e2.text) }];
|
|
3064
3233
|
}
|
|
3065
3234
|
return e2.content;
|
|
3066
3235
|
}
|
|
3067
|
-
function
|
|
3236
|
+
function os(e2) {
|
|
3068
3237
|
if ("string" == typeof e2) return;
|
|
3069
3238
|
const t2 = e2.referencedMessage;
|
|
3070
3239
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
3071
3240
|
}
|
|
3072
|
-
class
|
|
3241
|
+
class us {
|
|
3073
3242
|
constructor(e2, t2, s2) {
|
|
3074
3243
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
3075
3244
|
}
|
|
@@ -3081,10 +3250,10 @@ class rs {
|
|
|
3081
3250
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${i2}?talkjs-client-build=${r2 != null ? r2 : "standalone"}&talkjs-core=${s2}&talkjs-client-id=${n2}`;
|
|
3082
3251
|
}
|
|
3083
3252
|
}
|
|
3084
|
-
function
|
|
3253
|
+
function cs({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
3085
3254
|
var _a2;
|
|
3086
3255
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
3087
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-06-
|
|
3256
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-06-17T08:01:14.864Z" };
|
|
3088
3257
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
3089
3258
|
return a(r2, () => __async(this, null, function* () {
|
|
3090
3259
|
if (o2) {
|
|
@@ -3096,19 +3265,19 @@ function is({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
3096
3265
|
throw e3;
|
|
3097
3266
|
});
|
|
3098
3267
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
3099
|
-
return o2 && 401 === s3.status ? (
|
|
3268
|
+
return o2 && 401 === s3.status ? (vs.log(`401 error from ${e2} ${t2}, ${yield o2.getToken()}`), o2.refreshToken(), true) : i2 ? i2(s3) : !("status" in s3 && s3.status >= 400 && s3.status < 500);
|
|
3100
3269
|
}) }).catch((s3) => {
|
|
3101
3270
|
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
3102
3271
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
3103
3272
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
3104
|
-
s3.clone().text().then((e3) =>
|
|
3105
|
-
} else
|
|
3273
|
+
s3.clone().text().then((e3) => vs.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
3274
|
+
} else vs.log(`${n3} ${s3} (10% logged)`);
|
|
3106
3275
|
console.error("[TalkJS]", n3);
|
|
3107
3276
|
}
|
|
3108
3277
|
throw s3;
|
|
3109
3278
|
});
|
|
3110
3279
|
}
|
|
3111
|
-
const { cdnHost:
|
|
3280
|
+
const { cdnHost: ls, appHost: hs, restHost: ds, realtimeHost: ps, appProtocol: fs, appWsProtocol: ms } = function() {
|
|
3112
3281
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
3113
3282
|
const e2 = function() {
|
|
3114
3283
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -3133,11 +3302,11 @@ const { cdnHost: as, appHost: os, restHost: us, realtimeHost: cs, appProtocol: l
|
|
|
3133
3302
|
}(n2), a2 = t2.protocol;
|
|
3134
3303
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
3135
3304
|
}();
|
|
3136
|
-
const
|
|
3137
|
-
const
|
|
3305
|
+
const gs = hs.startsWith("app.talkjs.com");
|
|
3306
|
+
const vs = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
3138
3307
|
} } : new class {
|
|
3139
3308
|
constructor(e2) {
|
|
3140
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
3309
|
+
this._timeCreated = Date.now(), this._enabled = gs, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-06-17T08:01:14.864Z" }, 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-06-17T08:01:14.864Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
3141
3310
|
}
|
|
3142
3311
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
3143
3312
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -3147,14 +3316,14 @@ const ps = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
3147
3316
|
try {
|
|
3148
3317
|
if (!this._enabled) return Promise.resolve();
|
|
3149
3318
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
3150
|
-
yield
|
|
3319
|
+
yield cs({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
3151
3320
|
} catch (e3) {
|
|
3152
3321
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
3153
3322
|
}
|
|
3154
3323
|
});
|
|
3155
3324
|
}
|
|
3156
3325
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
3157
|
-
class
|
|
3326
|
+
class ws {
|
|
3158
3327
|
constructor(e2, t2 = {}) {
|
|
3159
3328
|
this._onSubscription = t2, this._handlers = {};
|
|
3160
3329
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -3199,9 +3368,9 @@ class fs {
|
|
|
3199
3368
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
3200
3369
|
}
|
|
3201
3370
|
}
|
|
3202
|
-
class
|
|
3371
|
+
class bs {
|
|
3203
3372
|
constructor(e2, t2, s2, n2, r2, i2) {
|
|
3204
|
-
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new
|
|
3373
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new ws({ tokenChanged(e3) {
|
|
3205
3374
|
}, tokenRefreshFailed(e3) {
|
|
3206
3375
|
}, tokenAccepted(e3) {
|
|
3207
3376
|
} }), this.sessionExpiryWarningTimeoutId = void 0, i2 && (n2 || r2)) throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");
|
|
@@ -3293,7 +3462,7 @@ class ms {
|
|
|
3293
3462
|
const e3 = function(e4) {
|
|
3294
3463
|
const t3 = e4.split(".");
|
|
3295
3464
|
if (3 !== t3.length) throw "Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";
|
|
3296
|
-
return { header:
|
|
3465
|
+
return { header: ys(t3[0]), payload: ys(t3[1]) };
|
|
3297
3466
|
}(s2);
|
|
3298
3467
|
n2 = e3.header, r2 = e3.payload;
|
|
3299
3468
|
} catch (e3) {
|
|
@@ -3307,7 +3476,7 @@ class ms {
|
|
|
3307
3476
|
const e3 = this.checkJwtPayload(r2);
|
|
3308
3477
|
t2.push(...e3);
|
|
3309
3478
|
}
|
|
3310
|
-
if (t2.length) if (this.usingBokens)
|
|
3479
|
+
if (t2.length) if (this.usingBokens) vs.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3311
3480
|
else {
|
|
3312
3481
|
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.");
|
|
3313
3482
|
const s3 = t2.length > 1;
|
|
@@ -3336,7 +3505,7 @@ class ms {
|
|
|
3336
3505
|
sendBokenRequest(e2, t2) {
|
|
3337
3506
|
return __async(this, null, function* () {
|
|
3338
3507
|
let s2 = 0;
|
|
3339
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3508
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield cs({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3340
3509
|
if (e3 instanceof Error) return true;
|
|
3341
3510
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3342
3511
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3349,7 +3518,7 @@ class ms {
|
|
|
3349
3518
|
});
|
|
3350
3519
|
}
|
|
3351
3520
|
}
|
|
3352
|
-
function
|
|
3521
|
+
function ys(e2) {
|
|
3353
3522
|
try {
|
|
3354
3523
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3355
3524
|
return JSON.parse(s2);
|
|
@@ -3357,8 +3526,8 @@ function gs(e2) {
|
|
|
3357
3526
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3358
3527
|
}
|
|
3359
3528
|
}
|
|
3360
|
-
const
|
|
3361
|
-
class
|
|
3529
|
+
const Cs = new us("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3530
|
+
class As {
|
|
3362
3531
|
constructor(e2) {
|
|
3363
3532
|
this.target = e2;
|
|
3364
3533
|
}
|
|
@@ -3366,7 +3535,7 @@ class bs {
|
|
|
3366
3535
|
return this.target;
|
|
3367
3536
|
}
|
|
3368
3537
|
}
|
|
3369
|
-
const
|
|
3538
|
+
const Es = new class {
|
|
3370
3539
|
constructor() {
|
|
3371
3540
|
this.registry = {};
|
|
3372
3541
|
}
|
|
@@ -3374,7 +3543,7 @@ const ws = new class {
|
|
|
3374
3543
|
var _a2;
|
|
3375
3544
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3376
3545
|
if (s2) return s2;
|
|
3377
|
-
const n2 = new
|
|
3546
|
+
const n2 = new xs(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new As(n2);
|
|
3378
3547
|
return this.registry[t2] = r2, n2;
|
|
3379
3548
|
}
|
|
3380
3549
|
deregister(e2, t2) {
|
|
@@ -3385,10 +3554,10 @@ const ws = new class {
|
|
|
3385
3554
|
return `${e2}:${t2}`;
|
|
3386
3555
|
}
|
|
3387
3556
|
}();
|
|
3388
|
-
function
|
|
3389
|
-
return e2.forceCreateNew ? new
|
|
3557
|
+
function ks(e2) {
|
|
3558
|
+
return e2.forceCreateNew ? new xs(e2) : Es.getOrCreate(e2);
|
|
3390
3559
|
}
|
|
3391
|
-
class
|
|
3560
|
+
class xs {
|
|
3392
3561
|
constructor(e2) {
|
|
3393
3562
|
!function(e3) {
|
|
3394
3563
|
function t3(e4, t4) {
|
|
@@ -3398,13 +3567,13 @@ class As {
|
|
|
3398
3567
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3399
3568
|
}(e2);
|
|
3400
3569
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3401
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3570
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new us(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : Cs, this._authProvider = new bs(this._apiUrls, t2, s2, n2, r2, i2);
|
|
3402
3571
|
const a2 = Math.random().toString().split(".")[1];
|
|
3403
|
-
this._realtimeClient = new
|
|
3572
|
+
this._realtimeClient = new Ee(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.2.0", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new Te(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3404
3573
|
console.error(`[TalkSession] ${e3}`);
|
|
3405
3574
|
}), function(e3, t3, s3) {
|
|
3406
3575
|
return __async(this, null, function* () {
|
|
3407
|
-
return
|
|
3576
|
+
return cs({ 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) => {
|
|
3408
3577
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3409
3578
|
const t4 = e4;
|
|
3410
3579
|
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);
|
|
@@ -3425,37 +3594,40 @@ class As {
|
|
|
3425
3594
|
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3426
3595
|
}
|
|
3427
3596
|
user(e2) {
|
|
3428
|
-
return new
|
|
3597
|
+
return new Te(e2, this._realtimeClient);
|
|
3429
3598
|
}
|
|
3430
3599
|
conversation(e2) {
|
|
3431
|
-
return new
|
|
3600
|
+
return new is(e2, this._realtimeClient);
|
|
3601
|
+
}
|
|
3602
|
+
subscribeConversations(e2) {
|
|
3603
|
+
return this._realtimeClient.subscribe(["me", "conversations"], e2);
|
|
3432
3604
|
}
|
|
3433
3605
|
terminate(e2) {
|
|
3434
|
-
|
|
3606
|
+
Es.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3435
3607
|
}
|
|
3436
3608
|
_isConnected() {
|
|
3437
3609
|
return this._realtimeClient.isConnected();
|
|
3438
3610
|
}
|
|
3439
3611
|
uploadFile(e2, t2) {
|
|
3440
|
-
return
|
|
3612
|
+
return Ts(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3441
3613
|
}
|
|
3442
3614
|
uploadImage(e2, t2) {
|
|
3443
|
-
return
|
|
3615
|
+
return Ts(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3444
3616
|
}
|
|
3445
3617
|
uploadVideo(e2, t2) {
|
|
3446
|
-
return
|
|
3618
|
+
return Ts(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3447
3619
|
}
|
|
3448
3620
|
uploadAudio(e2, t2) {
|
|
3449
|
-
return
|
|
3621
|
+
return Ts(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3450
3622
|
}
|
|
3451
3623
|
uploadVoice(e2, t2) {
|
|
3452
|
-
return
|
|
3624
|
+
return Ts(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3453
3625
|
}
|
|
3454
3626
|
}
|
|
3455
|
-
function
|
|
3627
|
+
function Ts(_0, _1, _2, _3) {
|
|
3456
3628
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3457
3629
|
const u2 = new FormData();
|
|
3458
|
-
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()),
|
|
3630
|
+
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()), cs({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
|
|
3459
3631
|
if (e3 instanceof Response) {
|
|
3460
3632
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3461
3633
|
throw new Error(s3);
|
|
@@ -3465,7 +3637,7 @@ function Cs(_0, _1, _2, _3) {
|
|
|
3465
3637
|
});
|
|
3466
3638
|
}
|
|
3467
3639
|
export {
|
|
3468
|
-
|
|
3640
|
+
ks as getTalkSession,
|
|
3469
3641
|
f as registerPolyfills
|
|
3470
3642
|
};
|
|
3471
3643
|
//# sourceMappingURL=talkSession.js.map
|