@talkjs/core 1.2.0 → 1.4.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 +10 -0
- package/dist/talkSession.cjs +1 -1
- package/dist/talkSession.d.ts +217 -11
- package/dist/talkSession.js +590 -362
- package/package.json +2 -2
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");
|
|
@@ -585,9 +585,9 @@ class S {
|
|
|
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 S(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
|
}
|
|
@@ -636,7 +636,7 @@ class M {
|
|
|
636
636
|
function B(e2) {
|
|
637
637
|
return e2.map((e3) => encodeURIComponent(e3)).join();
|
|
638
638
|
}
|
|
639
|
-
class
|
|
639
|
+
class N {
|
|
640
640
|
constructor() {
|
|
641
641
|
this.paths = {};
|
|
642
642
|
}
|
|
@@ -656,9 +656,9 @@ class R {
|
|
|
656
656
|
Object.values(this.paths).forEach((t2) => e2(t2));
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
class
|
|
659
|
+
class R {
|
|
660
660
|
constructor(e2, t2, s2) {
|
|
661
|
-
this.handlers = s2, this.targetSubscriptions = new
|
|
661
|
+
this.handlers = s2, this.targetSubscriptions = new N(), 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();
|
|
@@ -692,10 +692,10 @@ class N {
|
|
|
692
692
|
return this.connection.isConnected();
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function _(e2, t2) {
|
|
696
696
|
return void 0 === t2 ? e2 : t2;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function P(e2, t2) {
|
|
699
699
|
if (void 0 === t2) return e2;
|
|
700
700
|
if (null === t2) return {};
|
|
701
701
|
const s2 = __spreadValues({}, e2);
|
|
@@ -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
|
}
|
|
@@ -921,7 +921,7 @@ class G extends q {
|
|
|
921
921
|
this.mutate(e2, (s2) => {
|
|
922
922
|
const n2 = s2.value.snapshot;
|
|
923
923
|
if (null === n2) return console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."), s2;
|
|
924
|
-
return c({ snapshot: { id: n2.id, name:
|
|
924
|
+
return c({ snapshot: { id: n2.id, name: _(n2.name, t2.diff.name), custom: P(n2.custom, t2.diff.custom), locale: _(n2.locale, t2.diff.locale), photoUrl: _(n2.photoUrl, t2.diff.photoUrl), role: _(n2.role, t2.diff.role), welcomeMessage: _(n2.welcomeMessage, t2.diff.welcomeMessage) }, lastChanged: e2 });
|
|
925
925
|
});
|
|
926
926
|
}
|
|
927
927
|
getFromCache() {
|
|
@@ -1129,7 +1129,7 @@ class ne extends W {
|
|
|
1129
1129
|
messageEdited(e2, t2) {
|
|
1130
1130
|
this.mutate(e2, (s2) => {
|
|
1131
1131
|
if (null === s2.value.data) return s2;
|
|
1132
|
-
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt:
|
|
1132
|
+
return c({ lastChanged: e2, sender: s2.value.sender, data: { id: s2.value.data.id, type: s2.value.data.type, createdAt: s2.value.data.createdAt, origin: s2.value.data.origin, referencedMessageId: s2.value.data.referencedMessageId, editedAt: _(s2.value.data.editedAt, t2.diff.editedAt), custom: P(s2.value.data.custom, t2.diff.custom), content: _(s2.value.data.content, t2.diff.content) } });
|
|
1133
1133
|
});
|
|
1134
1134
|
}
|
|
1135
1135
|
messageDeleted(e2, t2) {
|
|
@@ -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
|
}
|
|
@@ -1543,7 +1509,7 @@ class pe extends W {
|
|
|
1543
1509
|
participantEdited(e2, t2) {
|
|
1544
1510
|
this.mutate(e2, (s2) => {
|
|
1545
1511
|
if (null === s2.value.data) return s2;
|
|
1546
|
-
return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access:
|
|
1512
|
+
return c({ lastChanged: e2, user: s2.value.user, data: { id: s2.value.data.id, access: _(s2.value.data.access, t2.diff.access), notify: _(s2.value.data.notify, t2.diff.notify), joinedAt: s2.value.data.joinedAt } });
|
|
1547
1513
|
});
|
|
1548
1514
|
}
|
|
1549
1515
|
participantDeleted(e2, t2) {
|
|
@@ -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,252 @@ 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: _(e2.subject, s2.subject), photoUrl: _(e2.photoUrl, s2.photoUrl), welcomeMessages: _(e2.welcomeMessages, s2.welcomeMessages), custom: P(e2.custom, s2.custom), lastMessageAt: _(e2.lastMessageAt, s2.lastMessageAt), unreadMessageCount: _(e2.unreadMessageCount, s2.unreadMessageCount), isUnread: _(e2.isUnread, s2.isUnread), access: _(e2.access, s2.access), notify: _(e2.notify, s2.notify), readUntil: _(e2.readUntil, s2.readUntil), everyoneReadUntil: _(e2.everyoneReadUntil, s2.everyoneReadUntil), joinedAt: e2.joinedAt };
|
|
1829
|
+
}
|
|
1830
|
+
class Ce extends q {
|
|
1831
|
+
constructor(e2, t2, s2, n2) {
|
|
1832
|
+
super(s2, n2), this.userId = e2, this.realtimeClient = t2, this.unsubscribeDebounceMs = 1e3;
|
|
1833
|
+
}
|
|
1834
|
+
fetchInitial(e2) {
|
|
1835
|
+
return __async(this, null, function* () {
|
|
1836
|
+
const t2 = this.realtimeClient.internalSubscribe(["users", this.userId]), s2 = yield this.realtimeClient.call("GET", ["users", this.userId, "online"], {}, { bypassCache: true });
|
|
1837
|
+
return s2.ok || "server" !== s2.where || 404 !== s2.value.status || "USER_NOT_FOUND" !== s2.value.errorCode ? s2.ok ? c({ lastChanged: e2, user: t2, data: s2.value.data }) : s2 : c({ lastChanged: e2, user: t2, data: null });
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
equal(e2, t2) {
|
|
1841
|
+
return O(e2.data, t2.data);
|
|
1842
|
+
}
|
|
1843
|
+
teardownNested(e2) {
|
|
1844
|
+
e2.user.unsubscribe();
|
|
1845
|
+
}
|
|
1846
|
+
anyChildChanged(e2, t2, s2) {
|
|
1847
|
+
return __async(this, null, function* () {
|
|
1848
|
+
return s2.user.store.changedBetween(e2, t2);
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
loadNested(e2, t2) {
|
|
1852
|
+
return __async(this, null, function* () {
|
|
1853
|
+
const s2 = yield t2.user.store.getDeep(e2);
|
|
1854
|
+
if (!s2.ok) return s2;
|
|
1855
|
+
const n2 = s2.value.snapshot;
|
|
1856
|
+
return null === t2.data || null === n2 ? c({ snapshot: null }) : c({ snapshot: __spreadValues({ user: n2 }, t2.data) });
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
userCreated(e2, t2) {
|
|
1860
|
+
const s2 = this.fetchInitial(e2);
|
|
1861
|
+
this.mutate(e2, (e3) => null !== e3.value.data ? (s2.then((e4) => {
|
|
1862
|
+
e4.ok && this.teardownNested(e4.value);
|
|
1863
|
+
}), e3) : s2);
|
|
1864
|
+
}
|
|
1865
|
+
userOnlineChanged(e2, t2) {
|
|
1866
|
+
this.mutate(e2, (s2) => null === s2.value.data ? s2 : c({ lastChanged: e2, user: s2.value.user, data: t2.diff }));
|
|
1867
|
+
}
|
|
1868
|
+
getFromCache() {
|
|
1869
|
+
return __async(this, null, function* () {
|
|
1870
|
+
const e2 = yield this.mostRecentState.resultPromise;
|
|
1871
|
+
if (!e2.ok) return l("NOT_IN_CACHE");
|
|
1872
|
+
if (null === e2.value.data) {
|
|
1873
|
+
return h({ status: 404, errorCode: "USER_NOT_FOUND", reasons: ["No user with that ID exists"] });
|
|
1874
|
+
}
|
|
1875
|
+
const _a2 = e2.value, { user: t2 } = _a2, s2 = __objRest(_a2, ["user"]);
|
|
1876
|
+
return c({ status: 200, data: __spreadValues({}, s2.data) });
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
class Ae {
|
|
1681
1881
|
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
|
|
1882
|
+
this.realtimeClient = s2, this.convDataStores = {}, this.storeMap = {}, this.emitMutex = new U(), this.seqOffset = 0, this.seqInThisConnection = 0, this.refetchOnNextNetworkLoss = true, this.connection = new R(e2, t2, { onUpstreamRestarting: () => {
|
|
1683
1883
|
this.refetchOnNextNetworkLoss = false;
|
|
1684
1884
|
}, onReady: () => {
|
|
1685
1885
|
this.refetchOnNextNetworkLoss = true;
|
|
@@ -1691,7 +1891,7 @@ class ve {
|
|
|
1691
1891
|
}
|
|
1692
1892
|
}, onResubscribeError: (e3, t3) => {
|
|
1693
1893
|
var _a2;
|
|
1694
|
-
(_a2 = this.storeMap[
|
|
1894
|
+
(_a2 = this.storeMap[Ee(e3)]) == null ? void 0 : _a2.setError(t3);
|
|
1695
1895
|
}, onPublish: (e3, t3) => {
|
|
1696
1896
|
this.seqInThisConnection = e3;
|
|
1697
1897
|
const s3 = this.seq;
|
|
@@ -1703,53 +1903,55 @@ class ve {
|
|
|
1703
1903
|
return this.seqOffset + this.seqInThisConnection;
|
|
1704
1904
|
}
|
|
1705
1905
|
refetchAll(e2) {
|
|
1706
|
-
Object.values(this.storeMap).forEach((t2) => t2.refetch(e2));
|
|
1906
|
+
Object.values(this.storeMap).forEach((t2) => t2 == null ? void 0 : t2.refetch(e2));
|
|
1707
1907
|
}
|
|
1708
1908
|
emitAll(e2) {
|
|
1709
1909
|
return this.emitMutex.runExclusive(() => __async(this, null, function* () {
|
|
1710
|
-
const t2 = Object.values(this.storeMap).map((t3) => t3.emit(e2));
|
|
1910
|
+
const t2 = Object.values(this.storeMap).map((t3) => t3 == null ? void 0 : t3.emit(e2));
|
|
1711
1911
|
yield Promise.all(t2);
|
|
1712
1912
|
}));
|
|
1713
1913
|
}
|
|
1714
1914
|
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;
|
|
1915
|
+
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, _z, _A;
|
|
1716
1916
|
switch (t2.type) {
|
|
1717
1917
|
case "user.created":
|
|
1718
|
-
return void ((
|
|
1918
|
+
return (_a2 = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _a2.userCreated(e2, t2), (_b = this.storeMap["/me/conversations"]) == null ? void 0 : _b.userCreated(e2, t2), void ((_c = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _c.userCreated(e2, t2));
|
|
1719
1919
|
case "user.edited":
|
|
1720
|
-
return void ((
|
|
1920
|
+
return void ((_d = this.storeMap[`/users/${t2.userId}`]) == null ? void 0 : _d.userEdited(e2, t2));
|
|
1721
1921
|
case "side.created":
|
|
1722
|
-
return (
|
|
1922
|
+
return (_e2 = this.convDataStores[t2.conversationId]) == null ? void 0 : _e2.sideCreated(e2, t2), (_f = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _f.sideCreated(e2, t2), (_g = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _g.sideCreated(e2, t2), void ((_h = this.storeMap["/me/conversations"]) == null ? void 0 : _h.sideCreated(e2, t2));
|
|
1723
1923
|
case "side.edited":
|
|
1724
|
-
return void ((
|
|
1924
|
+
return (_i = this.convDataStores[t2.conversationId]) == null ? void 0 : _i.sideEdited(e2, t2), void ((_j = this.storeMap["/me/conversations"]) == null ? void 0 : _j.sideEdited(e2, t2));
|
|
1725
1925
|
case "side.deleted":
|
|
1726
|
-
return (
|
|
1926
|
+
return (_k = this.convDataStores[t2.conversationId]) == null ? void 0 : _k.sideDeleted(e2, t2), (_l = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _l.sideDeleted(e2, t2), (_m = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _m.sideDeleted(e2, t2), (_n = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _n.sideDeleted(e2, t2), void ((_o = this.storeMap["/me/conversations"]) == null ? void 0 : _o.sideDeleted(e2, t2));
|
|
1727
1927
|
case "conversation.edited":
|
|
1728
|
-
return void ((
|
|
1928
|
+
return void ((_p = this.convDataStores[t2.conversationId]) == null ? void 0 : _p.conversationEdited(e2, t2));
|
|
1729
1929
|
case "message.created":
|
|
1730
|
-
return void ((
|
|
1930
|
+
return void ((_q = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _q.messageCreated(e2, t2));
|
|
1731
1931
|
case "message.edited":
|
|
1732
|
-
return void ((
|
|
1932
|
+
return void ((_r = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _r.messageEdited(e2, t2));
|
|
1733
1933
|
case "message.deleted":
|
|
1734
|
-
return void ((
|
|
1934
|
+
return void ((_s = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _s.messageDeleted(e2, t2));
|
|
1735
1935
|
case "typing.available":
|
|
1736
|
-
return void ((
|
|
1936
|
+
return void ((_t2 = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _t2.typingAvailable(e2, t2));
|
|
1737
1937
|
case "typing.changed":
|
|
1738
|
-
return void ((
|
|
1938
|
+
return void ((_u = this.storeMap[`/me/conversations/${t2.conversationId}/typing`]) == null ? void 0 : _u.typingChanged(e2, t2));
|
|
1739
1939
|
case "conversation.cleared":
|
|
1740
|
-
return void ((
|
|
1940
|
+
return void ((_v = this.storeMap[`/me/conversations/${t2.conversationId}/messages`]) == null ? void 0 : _v.conversationCleared(e2, t2));
|
|
1741
1941
|
case "participant.edited":
|
|
1742
|
-
return (
|
|
1942
|
+
return (_w = this.convDataStores[t2.conversationId]) == null ? void 0 : _w.participantEdited(e2, t2), void ((_x = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _x.participantEdited(e2, t2));
|
|
1743
1943
|
case "participant.created":
|
|
1744
|
-
return void ((
|
|
1944
|
+
return void ((_y = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _y.participantCreated(e2, t2));
|
|
1745
1945
|
case "participant.deleted":
|
|
1746
|
-
return void ((
|
|
1946
|
+
return void ((_z = this.storeMap[`/me/conversations/${t2.conversationId}/participants`]) == null ? void 0 : _z.participantDeleted(e2, t2));
|
|
1947
|
+
case "user.online.changed":
|
|
1948
|
+
return void ((_A = this.storeMap[`/users/${t2.userId}/online`]) == null ? void 0 : _A.userOnlineChanged(e2, t2));
|
|
1747
1949
|
}
|
|
1748
1950
|
}
|
|
1749
1951
|
call(e2, t2, n2, r2) {
|
|
1750
1952
|
return __async(this, null, function* () {
|
|
1751
1953
|
if (!r2.bypassCache && "GET" === e2) {
|
|
1752
|
-
const e3 =
|
|
1954
|
+
const e3 = Ee(t2);
|
|
1753
1955
|
if (e3 in this.storeMap) {
|
|
1754
1956
|
const t3 = e3, s2 = this.storeMap[t3];
|
|
1755
1957
|
if (s2 && "getFromCache" in s2) {
|
|
@@ -1768,6 +1970,12 @@ class ve {
|
|
|
1768
1970
|
const s2 = yield e4.getParticipantFromCache(t2[4]);
|
|
1769
1971
|
if ("NOT_IN_CACHE" !== s2.value) return s2;
|
|
1770
1972
|
}
|
|
1973
|
+
} else if (s(t2, ["me", "conversations", "*"])) {
|
|
1974
|
+
const e4 = this.storeMap["/me/conversations"];
|
|
1975
|
+
if (e4) {
|
|
1976
|
+
const s2 = yield e4.getConvFromCache(t2[2]);
|
|
1977
|
+
if ("NOT_IN_CACHE" !== s2.value) return s2;
|
|
1978
|
+
}
|
|
1771
1979
|
}
|
|
1772
1980
|
}
|
|
1773
1981
|
return this.connection.call(e2, t2, n2);
|
|
@@ -1808,36 +2016,50 @@ class ve {
|
|
|
1808
2016
|
}, a2;
|
|
1809
2017
|
}
|
|
1810
2018
|
getOrCreateStore(e2) {
|
|
1811
|
-
const t2 =
|
|
2019
|
+
const t2 = Ee(e2);
|
|
1812
2020
|
if (t2 in this.storeMap) return this.storeMap[t2];
|
|
1813
2021
|
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, () => {
|
|
2022
|
+
e3.ok || s2.setError(e3);
|
|
2023
|
+
});
|
|
2024
|
+
const s2 = this.instantiateStore(e2, () => {
|
|
1824
2025
|
delete this.storeMap[t2], this.connection.unsubscribe(e2);
|
|
1825
2026
|
});
|
|
1826
|
-
return this.storeMap[t2] =
|
|
2027
|
+
return this.storeMap[t2] = s2, s2;
|
|
1827
2028
|
}
|
|
1828
2029
|
destroy() {
|
|
1829
|
-
this.storeMap = {}, this.connection.destroy();
|
|
2030
|
+
this.storeMap = {}, this.convDataStores = {}, this.connection.destroy();
|
|
1830
2031
|
}
|
|
1831
2032
|
isConnected() {
|
|
1832
2033
|
return this.connection.isConnected();
|
|
1833
2034
|
}
|
|
2035
|
+
instantiateStore(e2, t2) {
|
|
2036
|
+
if (s(e2, ["users", "*"])) return new G(e2[1], this.realtimeClient, this.emitMutex, t2);
|
|
2037
|
+
if (s(e2, ["me", "conversations", "*"])) return new ue(this.subscribeConvData(e2[2]), this.realtimeClient, this.emitMutex, t2);
|
|
2038
|
+
if (s(e2, ["me", "conversations", "*", "messages"])) return new ie(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2039
|
+
if (s(e2, ["me", "conversations", "*", "participants"])) return new pe(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2040
|
+
if (s(e2, ["me", "conversations", "*", "typing"])) return new he(e2[2], this.realtimeClient, this.emitMutex, t2);
|
|
2041
|
+
if (s(e2, ["me", "conversations"])) return new ge((e3) => this.subscribeConvData(e3), this.realtimeClient, this.emitMutex, t2);
|
|
2042
|
+
if (s(e2, ["users", "*", "online"])) return new Ce(e2[1], this.realtimeClient, this.emitMutex, t2);
|
|
2043
|
+
throw "Unreachable";
|
|
2044
|
+
}
|
|
2045
|
+
subscribeConvData(e2) {
|
|
2046
|
+
const t2 = "string" == typeof e2 ? e2 : e2.id;
|
|
2047
|
+
if (Object.hasOwnProperty.call(this.convDataStores, t2)) {
|
|
2048
|
+
const e3 = this.convDataStores[t2];
|
|
2049
|
+
return { store: e3, unsubscribe: e3.registerInternalSubscription() };
|
|
2050
|
+
}
|
|
2051
|
+
const s2 = new be(e2, this.realtimeClient, this.emitMutex, () => {
|
|
2052
|
+
delete this.convDataStores[t2];
|
|
2053
|
+
});
|
|
2054
|
+
return this.convDataStores[t2] = s2, { store: s2, unsubscribe: s2.registerInternalSubscription() };
|
|
2055
|
+
}
|
|
1834
2056
|
}
|
|
1835
|
-
function
|
|
2057
|
+
function Ee(e2) {
|
|
1836
2058
|
return `/${e2.join("/")}`;
|
|
1837
2059
|
}
|
|
1838
|
-
class
|
|
2060
|
+
class ke {
|
|
1839
2061
|
constructor(e2, t2, s2) {
|
|
1840
|
-
this.userId = t2, this.alive = true, this.connection = new
|
|
2062
|
+
this.userId = t2, this.alive = true, this.connection = new Ae(e2, s2, this), s2.onTokenRefreshFailed(() => {
|
|
1841
2063
|
this.destroy();
|
|
1842
2064
|
});
|
|
1843
2065
|
}
|
|
@@ -1862,7 +2084,7 @@ class we {
|
|
|
1862
2084
|
listMessages(e2, t2) {
|
|
1863
2085
|
return __async(this, null, function* () {
|
|
1864
2086
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages"], t2);
|
|
1865
|
-
if (!s2.ok) return
|
|
2087
|
+
if (!s2.ok) return xe(s2, "Listing messages in " + e2);
|
|
1866
2088
|
const n2 = s2.value.data.data, r2 = yield Promise.all(n2.map((t3) => this.createMessageSnapshot(t3, e2))), i2 = r2.find((e3) => !e3.ok);
|
|
1867
2089
|
if (void 0 !== i2 && !i2.ok) return i2;
|
|
1868
2090
|
return c(r2.map(({ value: e3 }) => e3));
|
|
@@ -1891,7 +2113,7 @@ class we {
|
|
|
1891
2113
|
const s2 = yield this.call("GET", ["me", "conversations", e2, "messages", t2], {});
|
|
1892
2114
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return c(null);
|
|
1893
2115
|
if (!s2.ok && "server" === s2.where && 403 === s2.value.status && "NOT_A_PARTICIPANT" === s2.value.errorCode) return c(null);
|
|
1894
|
-
if (!s2.ok) return
|
|
2116
|
+
if (!s2.ok) return xe(s2, `Fetching referenced message ${t2} in conversation ${e2}`);
|
|
1895
2117
|
const n2 = s2.value.data, r2 = yield this.getUser(n2.senderId);
|
|
1896
2118
|
if (!r2.ok) return r2;
|
|
1897
2119
|
const i2 = r2.value;
|
|
@@ -1902,7 +2124,7 @@ class we {
|
|
|
1902
2124
|
return __async(this, null, function* () {
|
|
1903
2125
|
const t2 = yield this.call("GET", ["users", e2], { includePrivateFields: false });
|
|
1904
2126
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return c(null);
|
|
1905
|
-
if (!t2.ok) return
|
|
2127
|
+
if (!t2.ok) return xe(t2, "Get user " + e2);
|
|
1906
2128
|
return c(this.createUserSnapshot(t2.value.data));
|
|
1907
2129
|
});
|
|
1908
2130
|
}
|
|
@@ -1913,15 +2135,15 @@ class we {
|
|
|
1913
2135
|
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
2136
|
}
|
|
1915
2137
|
}
|
|
1916
|
-
function
|
|
2138
|
+
function xe(e2, t2) {
|
|
1917
2139
|
return "server" === e2.where ? h(__spreadProps(__spreadValues({}, e2.value), { operation: t2 })) : e2;
|
|
1918
2140
|
}
|
|
1919
|
-
function
|
|
2141
|
+
function Te(e2, s2) {
|
|
1920
2142
|
var _a2;
|
|
1921
2143
|
if (s2.ok) return s2.value;
|
|
1922
2144
|
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
2145
|
}
|
|
1924
|
-
class
|
|
2146
|
+
class Ie {
|
|
1925
2147
|
constructor(e2, t2) {
|
|
1926
2148
|
this.id = e2, this._realtimeClient = t2;
|
|
1927
2149
|
}
|
|
@@ -1931,7 +2153,7 @@ class Ce {
|
|
|
1931
2153
|
get() {
|
|
1932
2154
|
return __async(this, null, function* () {
|
|
1933
2155
|
const e2 = yield this._realtimeClient.getUser(this.brandedId);
|
|
1934
|
-
return
|
|
2156
|
+
return Te("Get user " + this.id, e2);
|
|
1935
2157
|
});
|
|
1936
2158
|
}
|
|
1937
2159
|
set(t2) {
|
|
@@ -1951,8 +2173,11 @@ class Ce {
|
|
|
1951
2173
|
subscribe(e2) {
|
|
1952
2174
|
return this._realtimeClient.subscribe(["users", this.brandedId], e2);
|
|
1953
2175
|
}
|
|
2176
|
+
subscribeOnline(e2) {
|
|
2177
|
+
return this._realtimeClient.subscribe(["users", this.brandedId, "online"], e2);
|
|
2178
|
+
}
|
|
1954
2179
|
}
|
|
1955
|
-
class
|
|
2180
|
+
class Se {
|
|
1956
2181
|
constructor(e2, t2, s2) {
|
|
1957
2182
|
this.userId = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
1958
2183
|
}
|
|
@@ -1996,7 +2221,7 @@ class Ee {
|
|
|
1996
2221
|
});
|
|
1997
2222
|
}
|
|
1998
2223
|
}
|
|
1999
|
-
function
|
|
2224
|
+
function De(e2) {
|
|
2000
2225
|
const t2 = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";
|
|
2001
2226
|
let s2 = 0;
|
|
2002
2227
|
const n2 = [], r2 = e2 === s2;
|
|
@@ -2014,7 +2239,7 @@ function ke(e2) {
|
|
|
2014
2239
|
if (20 != a2.length) throw new Error("Length should be 20.");
|
|
2015
2240
|
return a2;
|
|
2016
2241
|
}
|
|
2017
|
-
const
|
|
2242
|
+
const Me = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
2018
2243
|
return e3.reduce((e4, s3, n2) => e4.concat(t3(s3, n2)), []);
|
|
2019
2244
|
}(e2, (e3) => {
|
|
2020
2245
|
if ("string" == typeof e3) return t2(e3, s2);
|
|
@@ -2027,14 +2252,14 @@ const xe = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2027
2252
|
case "bulletList":
|
|
2028
2253
|
case "bulletpoint":
|
|
2029
2254
|
case "bulletPoint":
|
|
2030
|
-
return [{ type: e3.type, children:
|
|
2255
|
+
return [{ type: e3.type, children: Me(e3.children, t2, e3.type) }];
|
|
2031
2256
|
case "link":
|
|
2032
|
-
return [{ type: e3.type, url: e3.url, children:
|
|
2257
|
+
return [{ type: e3.type, url: e3.url, children: Me(e3.children, t2, e3.type) }];
|
|
2033
2258
|
case "actionlink":
|
|
2034
2259
|
case "actionLink":
|
|
2035
2260
|
case "actionbutton":
|
|
2036
2261
|
case "actionButton":
|
|
2037
|
-
return [{ type: e3.type, action: e3.action, params: e3.params, children:
|
|
2262
|
+
return [{ type: e3.type, action: e3.action, params: e3.params, children: Me(e3.children, t2, e3.type) }];
|
|
2038
2263
|
case "mention":
|
|
2039
2264
|
case "autolink":
|
|
2040
2265
|
case "autoLink":
|
|
@@ -2049,7 +2274,7 @@ const xe = (e2, t2, s2 = void 0) => function(e3, t3) {
|
|
|
2049
2274
|
return [e3];
|
|
2050
2275
|
}
|
|
2051
2276
|
});
|
|
2052
|
-
function
|
|
2277
|
+
function Fe(e2, t2) {
|
|
2053
2278
|
return (s2) => {
|
|
2054
2279
|
const n2 = s2;
|
|
2055
2280
|
let r2 = 0;
|
|
@@ -2062,29 +2287,29 @@ function Te(e2, t2) {
|
|
|
2062
2287
|
return r2 < s2.length && i2.push(s2.substring(r2)), i2;
|
|
2063
2288
|
};
|
|
2064
2289
|
}
|
|
2065
|
-
const
|
|
2066
|
-
var
|
|
2067
|
-
const
|
|
2290
|
+
const Be = "’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
2291
|
+
var Ne = ((e2) => (e2[e2.italic = 1] = "italic", e2[e2.strikethrough = 2] = "strikethrough", e2[e2.bold = 4] = "bold", e2))(Ne || {});
|
|
2292
|
+
const Re = [0, 1, 2, 3, 4, 5, 6].map((e2) => {
|
|
2068
2293
|
const t2 = [];
|
|
2069
2294
|
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
|
|
2295
|
+
}), _e = { _: 1, "*": 4, "~": 2 };
|
|
2296
|
+
function Pe(e2) {
|
|
2297
|
+
return Oe(e2, 0);
|
|
2073
2298
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const s2 =
|
|
2076
|
-
const t3 =
|
|
2299
|
+
function Oe(e2, t2 = 0) {
|
|
2300
|
+
const s2 = Re[t2], n2 = s2 ? function(e3) {
|
|
2301
|
+
const t3 = Ue.getOrCompute(e3, () => new RegExp(`(?:^|[\\s${Be}])(?:${e3.source})(?=[\\s${Be}]|$)`, "g")), s3 = Fe(t3, (e4) => {
|
|
2077
2302
|
const t4 = e4[0][1], s4 = e4[1] || e4[2] || e4[3] || e4[4] || e4[5] || e4[6];
|
|
2078
|
-
return [" ", { type:
|
|
2303
|
+
return [" ", { type: Ne[_e[t4]], children: [s4] }];
|
|
2079
2304
|
});
|
|
2080
2305
|
return (e4) => {
|
|
2081
2306
|
const [t4, ...n3] = s3(" " + e4);
|
|
2082
2307
|
return t4.length > 1 && n3.unshift(t4.substring(1)), n3;
|
|
2083
2308
|
};
|
|
2084
2309
|
}(s2) : () => [e2];
|
|
2085
|
-
return
|
|
2310
|
+
return Me(n2(e2), (e3, s3) => "bold" === s3 || "italic" === s3 || "strikethrough" === s3 ? Oe(e3, t2 | Ne[s3]) : [e3]);
|
|
2086
2311
|
}
|
|
2087
|
-
const
|
|
2312
|
+
const Ue = function() {
|
|
2088
2313
|
const e2 = function() {
|
|
2089
2314
|
try {
|
|
2090
2315
|
return /* @__PURE__ */ new WeakMap();
|
|
@@ -2100,18 +2325,18 @@ const Re = function() {
|
|
|
2100
2325
|
return e2.set(t2, n2), n2;
|
|
2101
2326
|
} };
|
|
2102
2327
|
}();
|
|
2103
|
-
function
|
|
2328
|
+
function je(e2, t2) {
|
|
2104
2329
|
if (Array.prototype.indexOf) return e2.indexOf(t2);
|
|
2105
2330
|
for (var s2 = 0, n2 = e2.length; s2 < n2; s2++) if (e2[s2] === t2) return s2;
|
|
2106
2331
|
return -1;
|
|
2107
2332
|
}
|
|
2108
|
-
function
|
|
2333
|
+
function $e(e2, t2) {
|
|
2109
2334
|
for (var s2 = e2.length - 1; s2 >= 0; s2--) true === t2(e2[s2]) && e2.splice(s2, 1);
|
|
2110
2335
|
}
|
|
2111
|
-
function
|
|
2336
|
+
function We(e2) {
|
|
2112
2337
|
throw new Error("Unhandled case for value: '" + e2 + "'");
|
|
2113
2338
|
}
|
|
2114
|
-
var
|
|
2339
|
+
var qe = function() {
|
|
2115
2340
|
function e2(e3) {
|
|
2116
2341
|
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
2342
|
}
|
|
@@ -2130,11 +2355,11 @@ var Oe = function() {
|
|
|
2130
2355
|
}, e2.prototype.setClass = function(e3) {
|
|
2131
2356
|
return this.setAttr("class", e3);
|
|
2132
2357
|
}, 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 ===
|
|
2358
|
+
for (var t2, s2 = this.getClass(), n2 = this.whitespaceRegex, r2 = s2 ? s2.split(n2) : [], i2 = e3.split(n2); t2 = i2.shift(); ) -1 === je(r2, t2) && r2.push(t2);
|
|
2134
2359
|
return this.getAttrs().class = r2.join(" "), this;
|
|
2135
2360
|
}, e2.prototype.removeClass = function(e3) {
|
|
2136
2361
|
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 =
|
|
2362
|
+
var a2 = je(r2, t2);
|
|
2138
2363
|
-1 !== a2 && r2.splice(a2, 1);
|
|
2139
2364
|
}
|
|
2140
2365
|
return this.getAttrs().class = r2.join(" "), this;
|
|
@@ -2160,12 +2385,12 @@ var Oe = function() {
|
|
|
2160
2385
|
return t2.join(" ");
|
|
2161
2386
|
}, e2;
|
|
2162
2387
|
}();
|
|
2163
|
-
var
|
|
2388
|
+
var He = function() {
|
|
2164
2389
|
function e2(e3) {
|
|
2165
2390
|
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
2391
|
}
|
|
2167
2392
|
return e2.prototype.build = function(e3) {
|
|
2168
|
-
return new
|
|
2393
|
+
return new qe({ tagName: "a", attrs: this.createAttrs(e3), innerHtml: this.processAnchorText(e3.getAnchorText()) });
|
|
2169
2394
|
}, e2.prototype.createAttrs = function(e3) {
|
|
2170
2395
|
var t2 = { href: e3.getAnchorHref() }, s2 = this.createCssClass(e3);
|
|
2171
2396
|
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 +2460,7 @@ var Ue = function() {
|
|
|
2235
2460
|
}(e4, t3, s3);
|
|
2236
2461
|
}(e3, s2);
|
|
2237
2462
|
}, e2;
|
|
2238
|
-
}(),
|
|
2463
|
+
}(), Ge = function() {
|
|
2239
2464
|
function e2(e3) {
|
|
2240
2465
|
this.__jsduckDummyDocProp = null, this.matchedText = "", this.offset = 0, this.tagBuilder = e3.tagBuilder, this.matchedText = e3.matchedText, this.offset = e3.offset;
|
|
2241
2466
|
}
|
|
@@ -2250,30 +2475,30 @@ var Ue = function() {
|
|
|
2250
2475
|
}, e2.prototype.buildTag = function() {
|
|
2251
2476
|
return this.tagBuilder.build(this);
|
|
2252
2477
|
}, e2;
|
|
2253
|
-
}(),
|
|
2254
|
-
return
|
|
2478
|
+
}(), Le = function(e2, t2) {
|
|
2479
|
+
return Le = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e3, t3) {
|
|
2255
2480
|
e3.__proto__ = t3;
|
|
2256
2481
|
} || function(e3, t3) {
|
|
2257
2482
|
for (var s2 in t3) t3.hasOwnProperty(s2) && (e3[s2] = t3[s2]);
|
|
2258
|
-
},
|
|
2483
|
+
}, Le(e2, t2);
|
|
2259
2484
|
};
|
|
2260
|
-
function
|
|
2485
|
+
function ze(e2, t2) {
|
|
2261
2486
|
function s2() {
|
|
2262
2487
|
this.constructor = e2;
|
|
2263
2488
|
}
|
|
2264
|
-
|
|
2489
|
+
Le(e2, t2), e2.prototype = null === t2 ? Object.create(t2) : (s2.prototype = t2.prototype, new s2());
|
|
2265
2490
|
}
|
|
2266
|
-
var
|
|
2267
|
-
return
|
|
2491
|
+
var Je, Ye = function() {
|
|
2492
|
+
return Ye = Object.assign || function(e2) {
|
|
2268
2493
|
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
2494
|
return e2;
|
|
2270
|
-
},
|
|
2271
|
-
},
|
|
2495
|
+
}, Ye.apply(this, arguments);
|
|
2496
|
+
}, Qe = function(e2) {
|
|
2272
2497
|
function t2(t3) {
|
|
2273
2498
|
var s2 = e2.call(this, t3) || this;
|
|
2274
2499
|
return s2.email = "", s2.email = t3.email, s2;
|
|
2275
2500
|
}
|
|
2276
|
-
return
|
|
2501
|
+
return ze(t2, e2), t2.prototype.getType = function() {
|
|
2277
2502
|
return "email";
|
|
2278
2503
|
}, t2.prototype.getEmail = function() {
|
|
2279
2504
|
return this.email;
|
|
@@ -2282,12 +2507,12 @@ var qe, He = function() {
|
|
|
2282
2507
|
}, t2.prototype.getAnchorText = function() {
|
|
2283
2508
|
return this.email;
|
|
2284
2509
|
}, t2;
|
|
2285
|
-
}(
|
|
2510
|
+
}(Ge), Ve = function(e2) {
|
|
2286
2511
|
function t2(t3) {
|
|
2287
2512
|
var s2 = e2.call(this, t3) || this;
|
|
2288
2513
|
return s2.serviceName = "", s2.hashtag = "", s2.serviceName = t3.serviceName, s2.hashtag = t3.hashtag, s2;
|
|
2289
2514
|
}
|
|
2290
|
-
return
|
|
2515
|
+
return ze(t2, e2), t2.prototype.getType = function() {
|
|
2291
2516
|
return "hashtag";
|
|
2292
2517
|
}, t2.prototype.getServiceName = function() {
|
|
2293
2518
|
return this.serviceName;
|
|
@@ -2308,12 +2533,12 @@ var qe, He = function() {
|
|
|
2308
2533
|
}, t2.prototype.getAnchorText = function() {
|
|
2309
2534
|
return "#" + this.hashtag;
|
|
2310
2535
|
}, t2;
|
|
2311
|
-
}(
|
|
2536
|
+
}(Ge), Ze = function(e2) {
|
|
2312
2537
|
function t2(t3) {
|
|
2313
2538
|
var s2 = e2.call(this, t3) || this;
|
|
2314
2539
|
return s2.serviceName = "twitter", s2.mention = "", s2.mention = t3.mention, s2.serviceName = t3.serviceName, s2;
|
|
2315
2540
|
}
|
|
2316
|
-
return
|
|
2541
|
+
return ze(t2, e2), t2.prototype.getType = function() {
|
|
2317
2542
|
return "mention";
|
|
2318
2543
|
}, t2.prototype.getMention = function() {
|
|
2319
2544
|
return this.mention;
|
|
@@ -2336,12 +2561,12 @@ var qe, He = function() {
|
|
|
2336
2561
|
var t3 = e2.prototype.getCssClassSuffixes.call(this), s2 = this.getServiceName();
|
|
2337
2562
|
return s2 && t3.push(s2), t3;
|
|
2338
2563
|
}, t2;
|
|
2339
|
-
}(
|
|
2564
|
+
}(Ge), Ke = function(e2) {
|
|
2340
2565
|
function t2(t3) {
|
|
2341
2566
|
var s2 = e2.call(this, t3) || this;
|
|
2342
2567
|
return s2.number = "", s2.plusSign = false, s2.number = t3.number, s2.plusSign = t3.plusSign, s2;
|
|
2343
2568
|
}
|
|
2344
|
-
return
|
|
2569
|
+
return ze(t2, e2), t2.prototype.getType = function() {
|
|
2345
2570
|
return "phone";
|
|
2346
2571
|
}, t2.prototype.getPhoneNumber = function() {
|
|
2347
2572
|
return this.number;
|
|
@@ -2352,12 +2577,12 @@ var qe, He = function() {
|
|
|
2352
2577
|
}, t2.prototype.getAnchorText = function() {
|
|
2353
2578
|
return this.matchedText;
|
|
2354
2579
|
}, t2;
|
|
2355
|
-
}(
|
|
2580
|
+
}(Ge), Xe = function(e2) {
|
|
2356
2581
|
function t2(t3) {
|
|
2357
2582
|
var s2 = e2.call(this, t3) || this;
|
|
2358
2583
|
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
2584
|
}
|
|
2360
|
-
return
|
|
2585
|
+
return ze(t2, e2), t2.prototype.getType = function() {
|
|
2361
2586
|
return "url";
|
|
2362
2587
|
}, t2.prototype.getUrlMatchType = function() {
|
|
2363
2588
|
return this.urlMatchType;
|
|
@@ -2385,19 +2610,19 @@ var qe, He = function() {
|
|
|
2385
2610
|
return t3;
|
|
2386
2611
|
}
|
|
2387
2612
|
}, t2;
|
|
2388
|
-
}(
|
|
2613
|
+
}(Ge), et = function(e2) {
|
|
2389
2614
|
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) {
|
|
2615
|
+
}, tt = /[A-Za-z]/, st = /[\d]/, nt = /[\D]/, rt = /\s/, it = /['"]/, at = /[\x00-\x1F\x7F]/, ot = /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, ut = ot + /\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, ct = /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, lt = ut + ct, ht = ut + ct, dt = "(?:[" + ct + "]{1,3}\\.){3}[" + ct + "]{1,3}", pt = "[" + ht + "](?:[" + ht + "\\-]{0,61}[" + ht + "])?", ft = function(e2) {
|
|
2616
|
+
return "(?=(" + pt + "))\\" + e2;
|
|
2617
|
+
}, mt = function(e2) {
|
|
2618
|
+
return "(?:" + ft(e2) + "(?:\\." + ft(e2 + 1) + "){0,126}|" + dt + ")";
|
|
2619
|
+
}, gt = new RegExp("[" + ht + "]"), vt = /(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/, wt = new RegExp("[" + ht + "!#$%&'*+/=?^_`{|}~-]"), bt = new RegExp("^" + vt.source + "$"), yt = function(e2) {
|
|
2395
2620
|
function t2() {
|
|
2396
2621
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2397
|
-
return t3.localPartCharRegex =
|
|
2622
|
+
return t3.localPartCharRegex = wt, t3.strictTldRegex = bt, t3;
|
|
2398
2623
|
}
|
|
2399
|
-
return
|
|
2400
|
-
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new
|
|
2624
|
+
return ze(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2625
|
+
for (var t3 = this.tagBuilder, s2 = this.localPartCharRegex, n2 = this.strictTldRegex, r2 = [], i2 = e3.length, a2 = new Ct(), o2 = { m: "a", a: "i", i: "l", l: "t", t: "o", o: ":" }, u2 = 0, c2 = 0, l2 = a2; u2 < i2; ) {
|
|
2401
2626
|
var h2 = e3.charAt(u2);
|
|
2402
2627
|
switch (c2) {
|
|
2403
2628
|
case 0:
|
|
@@ -2419,48 +2644,48 @@ var qe, He = function() {
|
|
|
2419
2644
|
v2(h2);
|
|
2420
2645
|
break;
|
|
2421
2646
|
case 6:
|
|
2422
|
-
|
|
2647
|
+
w2(h2);
|
|
2423
2648
|
break;
|
|
2424
2649
|
case 7:
|
|
2425
|
-
|
|
2650
|
+
b2(h2);
|
|
2426
2651
|
break;
|
|
2427
2652
|
default:
|
|
2428
|
-
|
|
2653
|
+
We(c2);
|
|
2429
2654
|
}
|
|
2430
2655
|
u2++;
|
|
2431
2656
|
}
|
|
2432
|
-
return
|
|
2657
|
+
return A2(), r2;
|
|
2433
2658
|
function d2(e4) {
|
|
2434
2659
|
"m" === e4 ? y2(1) : s2.test(e4) && y2();
|
|
2435
2660
|
}
|
|
2436
2661
|
function p2(e4, t4) {
|
|
2437
|
-
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new
|
|
2662
|
+
":" === e4 ? s2.test(t4) ? (c2 = 2, l2 = new Ct(Ye(Ye({}, l2), { hasMailtoPrefix: true }))) : C2() : o2[e4] === t4 || (s2.test(t4) ? c2 = 2 : "." === t4 ? c2 = 3 : "@" === t4 ? c2 = 4 : C2());
|
|
2438
2663
|
}
|
|
2439
2664
|
function f2(e4) {
|
|
2440
|
-
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) ||
|
|
2665
|
+
"." === e4 ? c2 = 3 : "@" === e4 ? c2 = 4 : s2.test(e4) || C2();
|
|
2441
2666
|
}
|
|
2442
2667
|
function m2(e4) {
|
|
2443
|
-
"." === e4 || "@" === e4 ?
|
|
2668
|
+
"." === e4 || "@" === e4 ? C2() : s2.test(e4) ? c2 = 2 : C2();
|
|
2444
2669
|
}
|
|
2445
2670
|
function g2(e4) {
|
|
2446
|
-
|
|
2671
|
+
gt.test(e4) ? c2 = 5 : C2();
|
|
2447
2672
|
}
|
|
2448
2673
|
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();
|
|
2674
|
+
"." === e4 ? c2 = 7 : "-" === e4 ? c2 = 6 : gt.test(e4) || A2();
|
|
2453
2675
|
}
|
|
2454
2676
|
function w2(e4) {
|
|
2455
|
-
"
|
|
2677
|
+
"-" === e4 || "." === e4 ? A2() : gt.test(e4) ? c2 = 5 : A2();
|
|
2678
|
+
}
|
|
2679
|
+
function b2(e4) {
|
|
2680
|
+
"." === e4 || "-" === e4 ? A2() : gt.test(e4) ? (c2 = 5, l2 = new Ct(Ye(Ye({}, l2), { hasDomainDot: true }))) : A2();
|
|
2456
2681
|
}
|
|
2457
2682
|
function y2(e4) {
|
|
2458
|
-
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new
|
|
2683
|
+
void 0 === e4 && (e4 = 2), c2 = e4, l2 = new Ct({ idx: u2 });
|
|
2459
2684
|
}
|
|
2460
|
-
function
|
|
2685
|
+
function C2() {
|
|
2461
2686
|
c2 = 0, l2 = a2;
|
|
2462
2687
|
}
|
|
2463
|
-
function
|
|
2688
|
+
function A2() {
|
|
2464
2689
|
if (l2.hasDomainDot) {
|
|
2465
2690
|
var s3 = e3.slice(l2.idx, u2);
|
|
2466
2691
|
/[-.]$/.test(s3) && (s3 = s3.slice(0, -1));
|
|
@@ -2468,14 +2693,14 @@ var qe, He = function() {
|
|
|
2468
2693
|
(function(e4) {
|
|
2469
2694
|
var t4 = e4.split(".").pop() || "", s4 = t4.toLowerCase();
|
|
2470
2695
|
return n2.test(s4);
|
|
2471
|
-
})(i3) && r2.push(new
|
|
2696
|
+
})(i3) && r2.push(new Qe({ tagBuilder: t3, matchedText: s3, offset: l2.idx, email: i3 }));
|
|
2472
2697
|
}
|
|
2473
|
-
|
|
2698
|
+
C2();
|
|
2474
2699
|
}
|
|
2475
2700
|
}, t2;
|
|
2476
|
-
}(
|
|
2701
|
+
}(et), Ct = function(e2) {
|
|
2477
2702
|
void 0 === e2 && (e2 = {}), this.idx = void 0 !== e2.idx ? e2.idx : -1, this.hasMailtoPrefix = !!e2.hasMailtoPrefix, this.hasDomainDot = !!e2.hasDomainDot;
|
|
2478
|
-
},
|
|
2703
|
+
}, At = function() {
|
|
2479
2704
|
function e2() {
|
|
2480
2705
|
}
|
|
2481
2706
|
return e2.isValid = function(e3, t2) {
|
|
@@ -2493,16 +2718,16 @@ var qe, He = function() {
|
|
|
2493
2718
|
return !(!e3 || t2 && this.hasFullProtocolRegex.test(t2) || -1 !== e3.indexOf("."));
|
|
2494
2719
|
}, e2.urlMatchDoesNotHaveAtLeastOneWordChar = function(e3, t2) {
|
|
2495
2720
|
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
|
-
}(),
|
|
2721
|
+
}, e2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//, e2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/, e2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + ot + "]"), 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;
|
|
2722
|
+
}(), Et = (Je = new RegExp("[/?#](?:[" + ht + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*[" + ht + "\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"), new RegExp(["(?:", "(", /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source, mt(2), ")", "|", "(", "(//)?", /(?:www\.)/.source, mt(6), ")", "|", "(", "(//)?", mt(10) + "\\.", vt.source, "(?![-" + lt + "])", ")", ")", "(?::[0-9]+)?", "(?:" + Je.source + ")?"].join(""), "gi")), kt = new RegExp("[" + ht + "]"), xt = function(e2) {
|
|
2498
2723
|
function t2(t3) {
|
|
2499
2724
|
var s2 = e2.call(this, t3) || this;
|
|
2500
|
-
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex =
|
|
2725
|
+
return s2.stripPrefix = { scheme: true, www: true }, s2.stripTrailingSlash = true, s2.decodePercentEncoding = true, s2.matcherRegex = Et, s2.wordCharRegExp = kt, s2.stripPrefix = t3.stripPrefix, s2.stripTrailingSlash = t3.stripTrailingSlash, s2.decodePercentEncoding = t3.decodePercentEncoding, s2;
|
|
2501
2726
|
}
|
|
2502
|
-
return
|
|
2727
|
+
return ze(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2503
2728
|
for (var t3, s2 = this.matcherRegex, n2 = this.stripPrefix, r2 = this.stripTrailingSlash, i2 = this.decodePercentEncoding, a2 = this.tagBuilder, o2 = [], u2 = function() {
|
|
2504
2729
|
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 (!
|
|
2730
|
+
if (!At.isValid(s3, u3)) return "continue";
|
|
2506
2731
|
if (p2 > 0 && "@" === m2) return "continue";
|
|
2507
2732
|
if (p2 > 0 && f2 && c2.wordCharRegExp.test(m2)) return "continue";
|
|
2508
2733
|
if (/\?$/.test(s3) && (s3 = s3.substr(0, s3.length - 1)), c2.matchHasUnbalancedClosingParen(s3)) s3 = s3.substr(0, s3.length - 1);
|
|
@@ -2514,11 +2739,11 @@ var qe, He = function() {
|
|
|
2514
2739
|
return !!u3 && -1 !== u3.indexOf(e4);
|
|
2515
2740
|
});
|
|
2516
2741
|
if (v2) {
|
|
2517
|
-
var
|
|
2518
|
-
s3 = s3.substr(
|
|
2742
|
+
var w2 = s3.indexOf(v2);
|
|
2743
|
+
s3 = s3.substr(w2), u3 = u3.substr(w2), p2 += w2;
|
|
2519
2744
|
}
|
|
2520
|
-
var
|
|
2521
|
-
o2.push(new
|
|
2745
|
+
var b2 = u3 ? "scheme" : l2 ? "www" : "tld", y2 = !!u3;
|
|
2746
|
+
o2.push(new Xe({ tagBuilder: a2, matchedText: s3, offset: p2, urlMatchType: b2, url: s3, protocolUrlMatch: y2, protocolRelativeMatch: !!f2, stripPrefix: n2, stripTrailingSlash: r2, decodePercentEncoding: i2 }));
|
|
2522
2747
|
}, c2 = this; null !== (t3 = s2.exec(e3)); ) u2();
|
|
2523
2748
|
return o2;
|
|
2524
2749
|
}, t2.prototype.matchHasUnbalancedClosingParen = function(e3) {
|
|
@@ -2538,58 +2763,58 @@ var qe, He = function() {
|
|
|
2538
2763
|
if (!e3) return -1;
|
|
2539
2764
|
var s2 = 0;
|
|
2540
2765
|
t3 && (s2 = e3.indexOf(":"), e3 = e3.slice(s2));
|
|
2541
|
-
var n2 = new RegExp("^((.?//)?[-." +
|
|
2766
|
+
var n2 = new RegExp("^((.?//)?[-." + ht + "]*[-" + ht + "]\\.[-" + ht + "]+)").exec(e3);
|
|
2542
2767
|
return null === n2 ? -1 : (s2 += n2[1].length, e3 = e3.slice(n2[1].length), /^[^-.A-Za-z0-9:\/?#]/.test(e3) ? s2 : -1);
|
|
2543
2768
|
}, t2;
|
|
2544
|
-
}(
|
|
2769
|
+
}(et), Tt = new RegExp("#[_" + ht + "]{1,139}(?![_" + ht + "])", "g"), It = new RegExp("[^" + ht + "]"), St = function(e2) {
|
|
2545
2770
|
function t2(t3) {
|
|
2546
2771
|
var s2 = e2.call(this, t3) || this;
|
|
2547
|
-
return s2.serviceName = "twitter", s2.matcherRegex =
|
|
2772
|
+
return s2.serviceName = "twitter", s2.matcherRegex = Tt, s2.nonWordCharRegex = It, s2.serviceName = t3.serviceName, s2;
|
|
2548
2773
|
}
|
|
2549
|
-
return
|
|
2774
|
+
return ze(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2550
2775
|
for (var t3, s2 = this.matcherRegex, n2 = this.nonWordCharRegex, r2 = this.serviceName, i2 = this.tagBuilder, a2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2551
2776
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2552
2777
|
if (0 === o2 || n2.test(u2)) {
|
|
2553
2778
|
var c2 = t3[0], l2 = t3[0].slice(1);
|
|
2554
|
-
a2.push(new
|
|
2779
|
+
a2.push(new Ve({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: r2, hashtag: l2 }));
|
|
2555
2780
|
}
|
|
2556
2781
|
}
|
|
2557
2782
|
return a2;
|
|
2558
2783
|
}, t2;
|
|
2559
|
-
}(
|
|
2784
|
+
}(et), Dt = 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"), Mt = function(e2) {
|
|
2560
2785
|
function t2() {
|
|
2561
2786
|
var t3 = null !== e2 && e2.apply(this, arguments) || this;
|
|
2562
|
-
return t3.matcherRegex =
|
|
2787
|
+
return t3.matcherRegex = Dt, t3;
|
|
2563
2788
|
}
|
|
2564
|
-
return
|
|
2789
|
+
return ze(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2565
2790
|
for (var t3, s2 = this.matcherRegex, n2 = this.tagBuilder, r2 = []; null !== (t3 = s2.exec(e3)); ) {
|
|
2566
2791
|
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
|
|
2792
|
+
this.testMatch(t3[3]) && this.testMatch(i2) && l2 && r2.push(new Ke({ tagBuilder: n2, matchedText: i2, offset: t3.index, number: a2, plusSign: o2 }));
|
|
2568
2793
|
}
|
|
2569
2794
|
return r2;
|
|
2570
2795
|
}, t2.prototype.testMatch = function(e3) {
|
|
2571
|
-
return
|
|
2796
|
+
return nt.test(e3);
|
|
2572
2797
|
}, t2;
|
|
2573
|
-
}(
|
|
2798
|
+
}(et), Ft = new RegExp("@[_" + ht + "]{1,50}(?![_" + ht + "])", "g"), Bt = new RegExp("@[_." + ht + "]{1,30}(?![_" + ht + "])", "g"), Nt = new RegExp("@[-_." + ht + "]{1,50}(?![-_" + ht + "])", "g"), Rt = new RegExp("[^" + ht + "]"), _t = function(e2) {
|
|
2574
2799
|
function t2(t3) {
|
|
2575
2800
|
var s2 = e2.call(this, t3) || this;
|
|
2576
|
-
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter:
|
|
2801
|
+
return s2.serviceName = "twitter", s2.matcherRegexes = { twitter: Ft, instagram: Bt, soundcloud: Nt }, s2.nonWordCharRegex = Rt, s2.serviceName = t3.serviceName, s2;
|
|
2577
2802
|
}
|
|
2578
|
-
return
|
|
2803
|
+
return ze(t2, e2), t2.prototype.parseMatches = function(e3) {
|
|
2579
2804
|
var t3, s2 = this.serviceName, n2 = this.matcherRegexes[this.serviceName], r2 = this.nonWordCharRegex, i2 = this.tagBuilder, a2 = [];
|
|
2580
2805
|
if (!n2) return a2;
|
|
2581
2806
|
for (; null !== (t3 = n2.exec(e3)); ) {
|
|
2582
2807
|
var o2 = t3.index, u2 = e3.charAt(o2 - 1);
|
|
2583
2808
|
if (0 === o2 || r2.test(u2)) {
|
|
2584
2809
|
var c2 = t3[0].replace(/\.+$/g, ""), l2 = c2.slice(1);
|
|
2585
|
-
a2.push(new
|
|
2810
|
+
a2.push(new Ze({ tagBuilder: i2, matchedText: c2, offset: o2, serviceName: s2, mention: l2 }));
|
|
2586
2811
|
}
|
|
2587
2812
|
}
|
|
2588
2813
|
return a2;
|
|
2589
2814
|
}, 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
|
|
2815
|
+
}(et);
|
|
2816
|
+
function Pt(e2, t2) {
|
|
2817
|
+
for (var s2, n2 = t2.onOpenTag, r2 = t2.onCloseTag, i2 = t2.onText, a2 = t2.onComment, o2 = t2.onDoctype, u2 = new Ot(), c2 = 0, l2 = e2.length, h2 = 0, d2 = 0, p2 = u2; c2 < l2; ) {
|
|
2593
2818
|
var f2 = e2.charAt(c2);
|
|
2594
2819
|
switch (h2) {
|
|
2595
2820
|
case 0:
|
|
@@ -2599,22 +2824,22 @@ function Mt(e2, t2) {
|
|
|
2599
2824
|
g2(f2);
|
|
2600
2825
|
break;
|
|
2601
2826
|
case 2:
|
|
2602
|
-
|
|
2827
|
+
w2(f2);
|
|
2603
2828
|
break;
|
|
2604
2829
|
case 3:
|
|
2605
2830
|
v2(f2);
|
|
2606
2831
|
break;
|
|
2607
2832
|
case 4:
|
|
2608
|
-
|
|
2833
|
+
b2(f2);
|
|
2609
2834
|
break;
|
|
2610
2835
|
case 5:
|
|
2611
2836
|
y2(f2);
|
|
2612
2837
|
break;
|
|
2613
2838
|
case 6:
|
|
2614
|
-
|
|
2839
|
+
C2(f2);
|
|
2615
2840
|
break;
|
|
2616
2841
|
case 7:
|
|
2617
|
-
|
|
2842
|
+
A2(f2);
|
|
2618
2843
|
break;
|
|
2619
2844
|
case 8:
|
|
2620
2845
|
E2(f2);
|
|
@@ -2638,25 +2863,25 @@ function Mt(e2, t2) {
|
|
|
2638
2863
|
D2(f2);
|
|
2639
2864
|
break;
|
|
2640
2865
|
case 15:
|
|
2641
|
-
|
|
2866
|
+
M2(f2);
|
|
2642
2867
|
break;
|
|
2643
2868
|
case 16:
|
|
2644
|
-
|
|
2869
|
+
F2(f2);
|
|
2645
2870
|
break;
|
|
2646
2871
|
case 17:
|
|
2647
2872
|
B2(f2);
|
|
2648
2873
|
break;
|
|
2649
2874
|
case 18:
|
|
2650
|
-
|
|
2875
|
+
N2(f2);
|
|
2651
2876
|
break;
|
|
2652
2877
|
case 19:
|
|
2653
|
-
|
|
2878
|
+
R2(f2);
|
|
2654
2879
|
break;
|
|
2655
2880
|
case 20:
|
|
2656
|
-
|
|
2881
|
+
_2(f2);
|
|
2657
2882
|
break;
|
|
2658
2883
|
default:
|
|
2659
|
-
|
|
2884
|
+
We(h2);
|
|
2660
2885
|
}
|
|
2661
2886
|
c2++;
|
|
2662
2887
|
}
|
|
@@ -2664,25 +2889,25 @@ function Mt(e2, t2) {
|
|
|
2664
2889
|
"<" === e3 && O2();
|
|
2665
2890
|
}
|
|
2666
2891
|
function g2(e3) {
|
|
2667
|
-
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new
|
|
2892
|
+
"!" === e3 ? h2 = 13 : "/" === e3 ? (h2 = 2, p2 = new Ot(Ye(Ye({}, p2), { isClosing: true }))) : "<" === e3 ? O2() : tt.test(e3) ? (h2 = 3, p2 = new Ot(Ye(Ye({}, p2), { isOpening: true }))) : (h2 = 0, p2 = u2);
|
|
2668
2893
|
}
|
|
2669
2894
|
function v2(e3) {
|
|
2670
|
-
|
|
2671
|
-
}
|
|
2672
|
-
function b2(e3) {
|
|
2673
|
-
">" === e3 ? _2() : Ve.test(e3) ? h2 = 3 : _2();
|
|
2895
|
+
rt.test(e3) ? (p2 = new Ot(Ye(Ye({}, p2), { name: j2() })), h2 = 4) : "<" === e3 ? O2() : "/" === e3 ? (p2 = new Ot(Ye(Ye({}, p2), { name: j2() })), h2 = 12) : ">" === e3 ? (p2 = new Ot(Ye(Ye({}, p2), { name: j2() })), U2()) : tt.test(e3) || st.test(e3) || ":" === e3 || P2();
|
|
2674
2896
|
}
|
|
2675
2897
|
function w2(e3) {
|
|
2676
|
-
|
|
2898
|
+
">" === e3 ? P2() : tt.test(e3) ? h2 = 3 : P2();
|
|
2677
2899
|
}
|
|
2678
|
-
function
|
|
2679
|
-
|
|
2900
|
+
function b2(e3) {
|
|
2901
|
+
rt.test(e3) || ("/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : "=" === e3 || it.test(e3) || at.test(e3) ? P2() : h2 = 5);
|
|
2680
2902
|
}
|
|
2681
|
-
function
|
|
2682
|
-
|
|
2903
|
+
function y2(e3) {
|
|
2904
|
+
rt.test(e3) ? h2 = 6 : "/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : it.test(e3) && P2();
|
|
2683
2905
|
}
|
|
2684
2906
|
function C2(e3) {
|
|
2685
|
-
|
|
2907
|
+
rt.test(e3) || ("/" === e3 ? h2 = 12 : "=" === e3 ? h2 = 7 : ">" === e3 ? U2() : "<" === e3 ? O2() : it.test(e3) ? P2() : h2 = 5);
|
|
2908
|
+
}
|
|
2909
|
+
function A2(e3) {
|
|
2910
|
+
rt.test(e3) || ('"' === e3 ? h2 = 8 : "'" === e3 ? h2 = 9 : /[>=`]/.test(e3) ? P2() : "<" === e3 ? O2() : h2 = 10);
|
|
2686
2911
|
}
|
|
2687
2912
|
function E2(e3) {
|
|
2688
2913
|
'"' === e3 && (h2 = 11);
|
|
@@ -2691,57 +2916,57 @@ function Mt(e2, t2) {
|
|
|
2691
2916
|
"'" === e3 && (h2 = 11);
|
|
2692
2917
|
}
|
|
2693
2918
|
function x2(e3) {
|
|
2694
|
-
|
|
2919
|
+
rt.test(e3) ? h2 = 4 : ">" === e3 ? U2() : "<" === e3 && O2();
|
|
2695
2920
|
}
|
|
2696
2921
|
function T2(e3) {
|
|
2697
|
-
|
|
2922
|
+
rt.test(e3) ? h2 = 4 : "/" === e3 ? h2 = 12 : ">" === e3 ? U2() : "<" === e3 ? O2() : (h2 = 4, c2--);
|
|
2698
2923
|
}
|
|
2699
2924
|
function I2(e3) {
|
|
2700
|
-
">" === e3 ? (p2 = new
|
|
2925
|
+
">" === e3 ? (p2 = new Ot(Ye(Ye({}, p2), { isClosing: true })), U2()) : h2 = 4;
|
|
2701
2926
|
}
|
|
2702
2927
|
function S2(t3) {
|
|
2703
|
-
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new
|
|
2928
|
+
"--" === e2.substr(c2, 2) ? (c2 += 2, p2 = new Ot(Ye(Ye({}, p2), { type: "comment" })), h2 = 14) : "DOCTYPE" === e2.substr(c2, 7).toUpperCase() ? (c2 += 7, p2 = new Ot(Ye(Ye({}, p2), { type: "doctype" })), h2 = 20) : P2();
|
|
2704
2929
|
}
|
|
2705
2930
|
function D2(e3) {
|
|
2706
|
-
"-" === e3 ? h2 = 15 : ">" === e3 ?
|
|
2707
|
-
}
|
|
2708
|
-
function F2(e3) {
|
|
2709
|
-
"-" === e3 ? h2 = 18 : ">" === e3 ? _2() : h2 = 16;
|
|
2931
|
+
"-" === e3 ? h2 = 15 : ">" === e3 ? P2() : h2 = 16;
|
|
2710
2932
|
}
|
|
2711
2933
|
function M2(e3) {
|
|
2934
|
+
"-" === e3 ? h2 = 18 : ">" === e3 ? P2() : h2 = 16;
|
|
2935
|
+
}
|
|
2936
|
+
function F2(e3) {
|
|
2712
2937
|
"-" === e3 && (h2 = 17);
|
|
2713
2938
|
}
|
|
2714
2939
|
function B2(e3) {
|
|
2715
2940
|
h2 = "-" === e3 ? 18 : 16;
|
|
2716
2941
|
}
|
|
2717
|
-
function
|
|
2942
|
+
function N2(e3) {
|
|
2718
2943
|
">" === e3 ? U2() : "!" === e3 ? h2 = 19 : "-" === e3 || (h2 = 16);
|
|
2719
2944
|
}
|
|
2720
|
-
function
|
|
2945
|
+
function R2(e3) {
|
|
2721
2946
|
"-" === e3 ? h2 = 17 : ">" === e3 ? U2() : h2 = 16;
|
|
2722
2947
|
}
|
|
2723
|
-
function
|
|
2948
|
+
function _2(e3) {
|
|
2724
2949
|
">" === e3 ? U2() : "<" === e3 && O2();
|
|
2725
2950
|
}
|
|
2726
|
-
function
|
|
2951
|
+
function P2() {
|
|
2727
2952
|
h2 = 0, p2 = u2;
|
|
2728
2953
|
}
|
|
2729
2954
|
function O2() {
|
|
2730
|
-
h2 = 1, p2 = new
|
|
2955
|
+
h2 = 1, p2 = new Ot({ idx: c2 });
|
|
2731
2956
|
}
|
|
2732
2957
|
function U2() {
|
|
2733
2958
|
var t3 = e2.slice(d2, p2.idx);
|
|
2734
|
-
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)),
|
|
2959
|
+
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)), P2(), d2 = c2 + 1;
|
|
2735
2960
|
}
|
|
2736
|
-
function
|
|
2961
|
+
function j2() {
|
|
2737
2962
|
var t3 = p2.idx + (p2.isClosing ? 2 : 1);
|
|
2738
2963
|
return e2.slice(t3, c2).toLowerCase();
|
|
2739
2964
|
}
|
|
2740
2965
|
d2 < c2 && (s2 = e2.slice(d2, c2), i2(s2, d2), d2 = c2 + 1);
|
|
2741
2966
|
}
|
|
2742
|
-
var
|
|
2967
|
+
var Ot = function(e2) {
|
|
2743
2968
|
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
|
-
},
|
|
2969
|
+
}, Ut = function() {
|
|
2745
2970
|
function e2(t2) {
|
|
2746
2971
|
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
2972
|
var s2 = this.mention;
|
|
@@ -2765,7 +2990,7 @@ var Bt = function(e2) {
|
|
|
2765
2990
|
}(e3 || {}, { length: Number.POSITIVE_INFINITY, location: "end" });
|
|
2766
2991
|
}, e2.prototype.parse = function(e3) {
|
|
2767
2992
|
var t2 = this, s2 = ["a", "style", "script"], n2 = 0, r2 = [];
|
|
2768
|
-
return
|
|
2993
|
+
return Pt(e3, { onOpenTag: function(e4) {
|
|
2769
2994
|
s2.indexOf(e4) >= 0 && n2++;
|
|
2770
2995
|
}, onText: function(e4, s3) {
|
|
2771
2996
|
if (0 === n2) {
|
|
@@ -2804,19 +3029,19 @@ var Bt = function(e2) {
|
|
|
2804
3029
|
}
|
|
2805
3030
|
return e3;
|
|
2806
3031
|
}, e2.prototype.removeUnwantedMatches = function(e3) {
|
|
2807
|
-
return this.hashtag ||
|
|
3032
|
+
return this.hashtag || $e(e3, function(e4) {
|
|
2808
3033
|
return "hashtag" === e4.getType();
|
|
2809
|
-
}), this.email ||
|
|
3034
|
+
}), this.email || $e(e3, function(e4) {
|
|
2810
3035
|
return "email" === e4.getType();
|
|
2811
|
-
}), this.phone ||
|
|
3036
|
+
}), this.phone || $e(e3, function(e4) {
|
|
2812
3037
|
return "phone" === e4.getType();
|
|
2813
|
-
}), this.mention ||
|
|
3038
|
+
}), this.mention || $e(e3, function(e4) {
|
|
2814
3039
|
return "mention" === e4.getType();
|
|
2815
|
-
}), this.urls.schemeMatches ||
|
|
3040
|
+
}), this.urls.schemeMatches || $e(e3, function(e4) {
|
|
2816
3041
|
return "url" === e4.getType() && "scheme" === e4.getUrlMatchType();
|
|
2817
|
-
}), this.urls.wwwMatches ||
|
|
3042
|
+
}), this.urls.wwwMatches || $e(e3, function(e4) {
|
|
2818
3043
|
return "url" === e4.getType() && "www" === e4.getUrlMatchType();
|
|
2819
|
-
}), this.urls.tldMatches ||
|
|
3044
|
+
}), this.urls.tldMatches || $e(e3, function(e4) {
|
|
2820
3045
|
return "url" === e4.getType() && "tld" === e4.getUrlMatchType();
|
|
2821
3046
|
}), e3;
|
|
2822
3047
|
}, e2.prototype.parseText = function(e3, t2) {
|
|
@@ -2836,99 +3061,99 @@ var Bt = function(e2) {
|
|
|
2836
3061
|
return s2.push(e3.substring(n2)), s2.join("");
|
|
2837
3062
|
}, e2.prototype.createMatchReturnVal = function(e3) {
|
|
2838
3063
|
var t2;
|
|
2839
|
-
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof
|
|
3064
|
+
return this.replaceFn && (t2 = this.replaceFn.call(this.context, e3)), "string" == typeof t2 ? t2 : false === t2 ? e3.getMatchedText() : t2 instanceof qe ? t2.toAnchorString() : e3.buildTag().toAnchorString();
|
|
2840
3065
|
}, e2.prototype.getMatchers = function() {
|
|
2841
3066
|
if (this.matchers) return this.matchers;
|
|
2842
|
-
var e3 = this.getTagBuilder(), t2 = [new
|
|
3067
|
+
var e3 = this.getTagBuilder(), t2 = [new St({ tagBuilder: e3, serviceName: this.hashtag }), new yt({ tagBuilder: e3 }), new Mt({ tagBuilder: e3 }), new _t({ tagBuilder: e3, serviceName: this.mention }), new xt({ tagBuilder: e3, stripPrefix: this.stripPrefix, stripTrailingSlash: this.stripTrailingSlash, decodePercentEncoding: this.decodePercentEncoding })];
|
|
2843
3068
|
return this.matchers = t2;
|
|
2844
3069
|
}, e2.prototype.getTagBuilder = function() {
|
|
2845
3070
|
var e3 = this.tagBuilder;
|
|
2846
|
-
return e3 || (e3 = this.tagBuilder = new
|
|
2847
|
-
}, e2.version = "3.14.3", e2.AnchorTagBuilder =
|
|
3071
|
+
return e3 || (e3 = this.tagBuilder = new He({ newWindow: this.newWindow, truncate: this.truncate, className: this.className })), e3;
|
|
3072
|
+
}, e2.version = "3.14.3", e2.AnchorTagBuilder = He, e2.HtmlTag = qe, e2.matcher = { Email: yt, Hashtag: St, Matcher: et, Mention: _t, Phone: Mt, Url: xt }, e2.match = { Email: Qe, Hashtag: Ve, Match: Ge, Mention: Ze, Phone: Ke, Url: Xe }, e2;
|
|
2848
3073
|
}();
|
|
2849
|
-
function
|
|
3074
|
+
function jt(e2, t2 = e2) {
|
|
2850
3075
|
return { type: "autolink", url: e2, text: t2 };
|
|
2851
3076
|
}
|
|
2852
|
-
const
|
|
3077
|
+
const $t = Fe(/<!!mention:([^>\s]*?)\|(.*?)>/gm, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3) {
|
|
2853
3078
|
return { type: "mention", id: e3, text: t3 };
|
|
2854
|
-
}(decodeURIComponent(t2), s2)),
|
|
3079
|
+
}(decodeURIComponent(t2), s2)), Wt = Fe(/<!!customemoji:(.*?)>/gm, ([e2, t2]) => /* @__PURE__ */ function(e3) {
|
|
2855
3080
|
return { type: "customemoji", text: e3 };
|
|
2856
|
-
}(t2)),
|
|
3081
|
+
}(t2)), qt = Fe(/<((?:https?|mailto):.*?)\|(.*?)>/gi, ([e2, t2, s2]) => /* @__PURE__ */ function(e3, t3 = []) {
|
|
2857
3082
|
return { type: "link", url: e3, children: t3 };
|
|
2858
|
-
}(t2, [s2])),
|
|
2859
|
-
const { action: n2, params: r2 } =
|
|
3083
|
+
}(t2, [s2])), Ht = Fe(/<actionlink:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3084
|
+
const { action: n2, params: r2 } = Lt(t2);
|
|
2860
3085
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2861
3086
|
return { type: "actionlink", action: e3, params: t3, children: s3 };
|
|
2862
3087
|
}(n2, r2, [s2]);
|
|
2863
|
-
}),
|
|
2864
|
-
const { action: n2, params: r2 } =
|
|
3088
|
+
}), Gt = Fe(/<actionbutton:([^|]+)[|]([^>]*)>/gi, ([e2, t2, s2]) => {
|
|
3089
|
+
const { action: n2, params: r2 } = Lt(t2);
|
|
2865
3090
|
return /* @__PURE__ */ function(e3, t3, s3 = []) {
|
|
2866
3091
|
return { type: "actionbutton", action: e3, params: t3, children: s3 };
|
|
2867
3092
|
}(n2, r2, [s2]);
|
|
2868
3093
|
});
|
|
2869
|
-
function
|
|
3094
|
+
function Lt(e2) {
|
|
2870
3095
|
const t2 = e2.indexOf("?");
|
|
2871
3096
|
if (-1 === t2) return { action: e2, params: {} };
|
|
2872
3097
|
return { action: e2.slice(0, t2), params: Object.fromEntries(new URLSearchParams(e2.slice(t2))) };
|
|
2873
3098
|
}
|
|
2874
|
-
const
|
|
3099
|
+
const zt = Fe(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g, ([e2]) => /* @__PURE__ */ function(e3 = []) {
|
|
2875
3100
|
return { type: "bulletlist", children: e3 };
|
|
2876
|
-
}([e2.startsWith("\n") ? e2.slice(1) : e2])),
|
|
3101
|
+
}([e2.startsWith("\n") ? e2.slice(1) : e2])), Jt = Fe(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm, ([e2, t2]) => ({ type: "bulletpoint", children: [t2] })), Yt = (e2) => {
|
|
2877
3102
|
const t2 = /(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;
|
|
2878
3103
|
let s2 = 0;
|
|
2879
3104
|
const n2 = [];
|
|
2880
3105
|
for (const r2 of J(e2, t2)) {
|
|
2881
3106
|
const t3 = r2[0], i2 = r2[1], a2 = t3.startsWith(i2) ? r2.index : r2.index + 1;
|
|
2882
3107
|
a2 - s2 > 0 && n2.push(e2.substring(s2, a2));
|
|
2883
|
-
const o2 =
|
|
3108
|
+
const o2 = jt("tel:" + i2.replace(/[^0-9+]/g, ""), i2);
|
|
2884
3109
|
n2.push(o2), s2 = a2 + i2.length;
|
|
2885
3110
|
}
|
|
2886
3111
|
return s2 < e2.length && n2.push(e2.substring(s2)), n2;
|
|
2887
|
-
},
|
|
2888
|
-
const t2 =
|
|
3112
|
+
}, Qt = (e2) => qt(e2).flatMap((e3) => "string" == typeof e3 ? Vt(e3) : ["<", ...Vt(e3.url), ...Vt("|" + e3.children[0] + ">")]), Vt = (e2) => {
|
|
3113
|
+
const t2 = Ut.parse(e2, { urls: true, email: true, phone: false, hashtag: false, mention: false }), s2 = [];
|
|
2889
3114
|
let n2 = 0;
|
|
2890
3115
|
for (const r2 of t2) {
|
|
2891
3116
|
const t3 = r2.getOffset(), i2 = r2.getMatchedText(), a2 = i2.length;
|
|
2892
3117
|
let o2 = i2;
|
|
2893
|
-
r2 instanceof
|
|
3118
|
+
r2 instanceof Qe ? o2 = "mailto:" + r2.getEmail() : r2 instanceof Xe && (o2 = r2.getUrl()), t3 > n2 && s2.push(e2.substring(n2, t3)), s2.push(jt(o2, i2)), n2 = t3 + a2;
|
|
2894
3119
|
}
|
|
2895
3120
|
return n2 < e2.length && s2.push(e2.substring(n2)), s2;
|
|
2896
|
-
},
|
|
2897
|
-
function
|
|
3121
|
+
}, Zt = ["Codeblock", "Codespan", "FormattedLink", "Wikitext", "Autolink", "Actions", "Mention", "Mention", "BulletPoint", "CustomEmoji"];
|
|
3122
|
+
function Kt(e2 = { except: [] }) {
|
|
2898
3123
|
var _a2;
|
|
2899
|
-
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 :
|
|
2900
|
-
return s2.includes("BulletPoint") || t2.multilineSteps.push(
|
|
3124
|
+
const t2 = { multilineSteps: [], singlelineSteps: [] }, s2 = (_a2 = e2.except) != null ? _a2 : Zt.filter((t3) => !e2.only.includes(t3));
|
|
3125
|
+
return s2.includes("BulletPoint") || t2.multilineSteps.push(zt, Jt), s2.includes("Mention") || t2.singlelineSteps.push($t), s2.includes("CustomEmoji") || t2.singlelineSteps.push(Wt), s2.includes("Codespan") || t2.multilineSteps.push(Fe(/```([^]+?)```/g, ([e3, t3]) => ({ type: "codespan", text: t3 }))), s2.includes("FormattedLink") || t2.singlelineSteps.push(qt), s2.includes("Actions") || (t2.singlelineSteps.push(Ht), t2.singlelineSteps.push(Gt)), s2.includes("Wikitext") || t2.singlelineSteps.push(Pe), s2.includes("Autolink") || t2.singlelineSteps.push(Qt, Yt), t2;
|
|
2901
3126
|
}
|
|
2902
|
-
const
|
|
3127
|
+
const Xt = function(e2) {
|
|
2903
3128
|
const t2 = RegExp(`[^${e2}]+${e2}?|${e2}`, "g");
|
|
2904
3129
|
return (e3) => Array.from(e3.match(t2) || []);
|
|
2905
3130
|
}("\n");
|
|
2906
|
-
function
|
|
3131
|
+
function es(e2, t2 = { except: [] }) {
|
|
2907
3132
|
let s2 = function(e3, t3) {
|
|
2908
3133
|
let s3 = [e3];
|
|
2909
|
-
return s3 =
|
|
2910
|
-
}(e2,
|
|
2911
|
-
return s2 =
|
|
3134
|
+
return s3 = ts(s3, t3.multilineSteps), s3 = ts(s3, [Xt]), s3 = ts(s3, t3.singlelineSteps), s3 = ss(s3), s3;
|
|
3135
|
+
}(e2, Kt(t2));
|
|
3136
|
+
return s2 = ns(s2, false), s2;
|
|
2912
3137
|
}
|
|
2913
|
-
function
|
|
2914
|
-
return t2.reduce((e3, t3) =>
|
|
3138
|
+
function ts(e2, t2) {
|
|
3139
|
+
return t2.reduce((e3, t3) => Me(e3, t3), e2);
|
|
2915
3140
|
}
|
|
2916
|
-
function
|
|
3141
|
+
function ss(e2) {
|
|
2917
3142
|
const t2 = [];
|
|
2918
3143
|
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:
|
|
3144
|
+
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: ss(n2.children) }) : n2;
|
|
2920
3145
|
return t2;
|
|
2921
3146
|
}
|
|
2922
|
-
function
|
|
3147
|
+
function ns(e2, t2) {
|
|
2923
3148
|
const s2 = [];
|
|
2924
3149
|
let n2 = [];
|
|
2925
3150
|
for (let r2 = 0; r2 < e2.length; r2++) {
|
|
2926
3151
|
const i2 = e2[r2];
|
|
2927
|
-
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children =
|
|
3152
|
+
"string" == typeof i2 ? n2.push(i2) : "children" in i2 ? (n2.length > 0 && (s2.push(n2.join("")), n2 = []), i2.children = ns(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
3153
|
}
|
|
2929
3154
|
return n2.length > 0 && (s2.push(n2.join("")), n2 = []), s2;
|
|
2930
3155
|
}
|
|
2931
|
-
class
|
|
3156
|
+
class rs {
|
|
2932
3157
|
constructor(e2, t2, s2) {
|
|
2933
3158
|
this.id = e2, this.conversationId = t2, this._realtimeClient = s2;
|
|
2934
3159
|
}
|
|
@@ -2944,12 +3169,12 @@ class Xt {
|
|
|
2944
3169
|
if (!t2.ok && "server" === t2.where && 404 === t2.value.status) return null;
|
|
2945
3170
|
if (!t2.ok && "server" === t2.where && 403 === t2.value.status && "NOT_A_PARTICIPANT" === t2.value.errorCode) return null;
|
|
2946
3171
|
const s2 = e("Get message " + this.id, t2), n2 = yield this._realtimeClient.createMessageSnapshot(s2, this.brandedConversationId);
|
|
2947
|
-
return
|
|
3172
|
+
return Te("Get message " + this.id, n2);
|
|
2948
3173
|
});
|
|
2949
3174
|
}
|
|
2950
3175
|
edit(t2) {
|
|
2951
3176
|
return __async(this, null, function* () {
|
|
2952
|
-
const s2 = { content:
|
|
3177
|
+
const s2 = { content: is(t2), custom: "string" == typeof t2 ? void 0 : t2.custom }, n2 = yield this._realtimeClient.call("PATCH", ["conversations", this.brandedConversationId, "messages", this.brandedId], s2);
|
|
2953
3178
|
e(`Edit message ${this.id} in conversation ${this.conversationId}`, n2);
|
|
2954
3179
|
});
|
|
2955
3180
|
}
|
|
@@ -2960,16 +3185,16 @@ class Xt {
|
|
|
2960
3185
|
});
|
|
2961
3186
|
}
|
|
2962
3187
|
}
|
|
2963
|
-
function
|
|
3188
|
+
function is(e2) {
|
|
2964
3189
|
if ("string" == typeof e2) {
|
|
2965
|
-
return [{ type: "text", children:
|
|
3190
|
+
return [{ type: "text", children: es(e2) }];
|
|
2966
3191
|
}
|
|
2967
3192
|
if ("text" in e2 && e2.text) {
|
|
2968
|
-
return [{ type: "text", children:
|
|
3193
|
+
return [{ type: "text", children: es(e2.text) }];
|
|
2969
3194
|
}
|
|
2970
3195
|
if ("content" in e2 && e2.content) return e2.content;
|
|
2971
3196
|
}
|
|
2972
|
-
class
|
|
3197
|
+
class as {
|
|
2973
3198
|
constructor(e2, t2) {
|
|
2974
3199
|
this.id = e2, this._realtimeClient = t2, this.uselessObjForTypeCheck = { subject: null, photoUrl: null, welcomeMessages: null, custom: null, access: null, notify: null };
|
|
2975
3200
|
}
|
|
@@ -2980,16 +3205,16 @@ class ts {
|
|
|
2980
3205
|
return this._realtimeClient.userId;
|
|
2981
3206
|
}
|
|
2982
3207
|
participant(e2) {
|
|
2983
|
-
return new
|
|
3208
|
+
return new Se("string" == typeof e2 ? e2 : e2.id, this.id, this._realtimeClient);
|
|
2984
3209
|
}
|
|
2985
3210
|
message(e2) {
|
|
2986
|
-
return new
|
|
3211
|
+
return new rs(e2, this.brandedId, this._realtimeClient);
|
|
2987
3212
|
}
|
|
2988
3213
|
get() {
|
|
2989
3214
|
return __async(this, null, function* () {
|
|
2990
3215
|
const t2 = this._realtimeClient.listMessages(this.brandedId, { limit: 1 }), s2 = yield this._realtimeClient.call("GET", ["me", "conversations", this.brandedId], {});
|
|
2991
3216
|
if (!s2.ok && "server" === s2.where && 404 === s2.value.status) return null;
|
|
2992
|
-
const n2 = e("Get conversation " + this.id, s2), r2 =
|
|
3217
|
+
const n2 = e("Get conversation " + this.id, s2), r2 = Te("Get last message in conversation " + this.id, yield t2), i2 = 0 === r2.length ? null : r2[0];
|
|
2993
3218
|
return this._realtimeClient.createConversationSnapshotPreloaded(n2, i2);
|
|
2994
3219
|
});
|
|
2995
3220
|
}
|
|
@@ -3032,8 +3257,8 @@ class ts {
|
|
|
3032
3257
|
}
|
|
3033
3258
|
send(t2) {
|
|
3034
3259
|
return __async(this, null, function* () {
|
|
3035
|
-
const s2 = { content:
|
|
3036
|
-
return new
|
|
3260
|
+
const s2 = { content: os(t2), referencedMessageId: us(t2), custom: "string" == typeof t2 ? void 0 : t2.custom, idempotencyKey: De((/* @__PURE__ */ new Date()).getTime()) }, n2 = yield this._realtimeClient.call("POST", ["conversations", this.brandedId, "messages"], s2), r2 = e("Send message to conversation " + this.id, n2);
|
|
3261
|
+
return new rs(r2.id, this.brandedId, this._realtimeClient);
|
|
3037
3262
|
});
|
|
3038
3263
|
}
|
|
3039
3264
|
subscribeMessages(e2) {
|
|
@@ -3055,21 +3280,21 @@ class ts {
|
|
|
3055
3280
|
});
|
|
3056
3281
|
}
|
|
3057
3282
|
}
|
|
3058
|
-
function
|
|
3283
|
+
function os(e2) {
|
|
3059
3284
|
if ("string" == typeof e2) {
|
|
3060
|
-
return [{ type: "text", children:
|
|
3285
|
+
return [{ type: "text", children: es(e2) }];
|
|
3061
3286
|
}
|
|
3062
3287
|
if ("text" in e2) {
|
|
3063
|
-
return [{ type: "text", children:
|
|
3288
|
+
return [{ type: "text", children: es(e2.text) }];
|
|
3064
3289
|
}
|
|
3065
3290
|
return e2.content;
|
|
3066
3291
|
}
|
|
3067
|
-
function
|
|
3292
|
+
function us(e2) {
|
|
3068
3293
|
if ("string" == typeof e2) return;
|
|
3069
3294
|
const t2 = e2.referencedMessage;
|
|
3070
3295
|
return void 0 !== t2 ? "string" == typeof t2 ? t2 : t2.id : void 0;
|
|
3071
3296
|
}
|
|
3072
|
-
class
|
|
3297
|
+
class cs {
|
|
3073
3298
|
constructor(e2, t2, s2) {
|
|
3074
3299
|
this.realtimeWsApiUrl = e2, this.internalHttpApiUrl = t2, this.restApiHttpUrl = s2;
|
|
3075
3300
|
}
|
|
@@ -3081,10 +3306,10 @@ class rs {
|
|
|
3081
3306
|
return this.realtimeWsApiUrl + `/${e2}/realtime/${i2}?talkjs-client-build=${r2 != null ? r2 : "standalone"}&talkjs-core=${s2}&talkjs-client-id=${n2}`;
|
|
3082
3307
|
}
|
|
3083
3308
|
}
|
|
3084
|
-
function
|
|
3309
|
+
function ls({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRetry: i2, authProvider: o2 }) {
|
|
3085
3310
|
var _a2;
|
|
3086
3311
|
(!r2 || r2 <= 0) && (r2 = 1);
|
|
3087
|
-
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-
|
|
3312
|
+
const u2 = { "x-talkjs-client-build": "jssdk-dev", "x-talkjs-client-date": "2025-07-08T10:01:42.871Z" };
|
|
3088
3313
|
s2 instanceof FormData || (u2["Content-Type"] = (_a2 = n2 == null ? void 0 : n2.contentType) != null ? _a2 : "application/json");
|
|
3089
3314
|
return a(r2, () => __async(this, null, function* () {
|
|
3090
3315
|
if (o2) {
|
|
@@ -3096,19 +3321,19 @@ function is({ method: e2, url: t2, data: s2, options: n2, attempts: r2, shouldRe
|
|
|
3096
3321
|
throw e3;
|
|
3097
3322
|
});
|
|
3098
3323
|
}), { initialDelay: 0.2, log: void 0, shouldRetry: (s3) => __async(this, null, function* () {
|
|
3099
|
-
return o2 && 401 === s3.status ? (
|
|
3324
|
+
return o2 && 401 === s3.status ? (ws.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
3325
|
}) }).catch((s3) => {
|
|
3101
3326
|
if (Math.random() < 0.1 && !t2.toString().startsWith("https://capture.trackjs.com")) {
|
|
3102
3327
|
const n3 = `Network Error for ${e2} ${t2}`;
|
|
3103
3328
|
if ("undefined" != typeof window) if (s3 instanceof Response) {
|
|
3104
|
-
s3.clone().text().then((e3) =>
|
|
3105
|
-
} else
|
|
3329
|
+
s3.clone().text().then((e3) => ws.log(`${n3} ${s3.status} ${e3} (10% logged)`));
|
|
3330
|
+
} else ws.log(`${n3} ${s3} (10% logged)`);
|
|
3106
3331
|
console.error("[TalkJS]", n3);
|
|
3107
3332
|
}
|
|
3108
3333
|
throw s3;
|
|
3109
3334
|
});
|
|
3110
3335
|
}
|
|
3111
|
-
const { cdnHost:
|
|
3336
|
+
const { cdnHost: hs, appHost: ds, restHost: ps, realtimeHost: fs, appProtocol: ms, appWsProtocol: gs } = function() {
|
|
3112
3337
|
if ("undefined" == typeof window) return { cdnHost: "test-hostname", appHost: "test-hostname", appProtocol: "http:", appWsProtocol: "ws:" };
|
|
3113
3338
|
const e2 = function() {
|
|
3114
3339
|
if (document.currentScript) return document.currentScript.src;
|
|
@@ -3133,11 +3358,11 @@ const { cdnHost: as, appHost: os, restHost: us, realtimeHost: cs, appProtocol: l
|
|
|
3133
3358
|
}(n2), a2 = t2.protocol;
|
|
3134
3359
|
return { cdnHost: s2, appHost: n2, restHost: r2, realtimeHost: i2, appProtocol: a2, appWsProtocol: "https:" === a2 ? "wss:" : "ws:" };
|
|
3135
3360
|
}();
|
|
3136
|
-
const
|
|
3137
|
-
const
|
|
3361
|
+
const vs = ds.startsWith("app.talkjs.com");
|
|
3362
|
+
const ws = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setData: (e2) => {
|
|
3138
3363
|
} } : new class {
|
|
3139
3364
|
constructor(e2) {
|
|
3140
|
-
this._timeCreated = Date.now(), this._enabled =
|
|
3365
|
+
this._timeCreated = Date.now(), this._enabled = vs, this._trackJSData = { customer: { application: "", correlationId: "", sessionId: "", token: "", userId: "", version: "dev-2025-07-08T10:01:42.871Z" }, 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-07-08T10:01:42.871Z", throttled: 0 }, this._url = `https://capture.trackjs.com/capture?token=${e2}`, this._trackJSData.customer.token = e2;
|
|
3141
3366
|
}
|
|
3142
3367
|
setData({ appId: e2, meId: t2, sessionId: s2 }) {
|
|
3143
3368
|
this._trackJSData.customer.userId = e2, this._trackJSData.customer.sessionId = `${e2}/${t2}`, this._trackJSData.customer.correlationId = s2;
|
|
@@ -3147,14 +3372,14 @@ const ps = "undefined" == typeof window ? { log: (e2) => Promise.resolve(), setD
|
|
|
3147
3372
|
try {
|
|
3148
3373
|
if (!this._enabled) return Promise.resolve();
|
|
3149
3374
|
const t2 = __spreadProps(__spreadValues({}, this._trackJSData), { message: e2 });
|
|
3150
|
-
yield
|
|
3375
|
+
yield ls({ method: "POST", url: this._url, data: JSON.stringify(t2), options: { contentType: "text/plain" } });
|
|
3151
3376
|
} catch (e3) {
|
|
3152
3377
|
console.error("[TalkJS] Failed when sending an error report. Error: ", e3);
|
|
3153
3378
|
}
|
|
3154
3379
|
});
|
|
3155
3380
|
}
|
|
3156
3381
|
}("970cd0be0fb74630b75c8451051299dc");
|
|
3157
|
-
class
|
|
3382
|
+
class bs {
|
|
3158
3383
|
constructor(e2, t2 = {}) {
|
|
3159
3384
|
this._onSubscription = t2, this._handlers = {};
|
|
3160
3385
|
for (const t3 in e2) Object.hasOwnProperty.call(e2, t3) && (this._handlers[t3] = []);
|
|
@@ -3199,9 +3424,9 @@ class fs {
|
|
|
3199
3424
|
return this.on(e2, t2), { unsubscribe: () => this.off(e2, t2) };
|
|
3200
3425
|
}
|
|
3201
3426
|
}
|
|
3202
|
-
class
|
|
3427
|
+
class ys {
|
|
3203
3428
|
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
|
|
3429
|
+
if (this.appId = t2, this.userId = s2, this.tokenFetcher = r2, this.usingBokens = false, this.requestInProgress = false, this.eventEmitter = new bs({ tokenChanged(e3) {
|
|
3205
3430
|
}, tokenRefreshFailed(e3) {
|
|
3206
3431
|
}, tokenAccepted(e3) {
|
|
3207
3432
|
} }), 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 +3518,7 @@ class ms {
|
|
|
3293
3518
|
const e3 = function(e4) {
|
|
3294
3519
|
const t3 = e4.split(".");
|
|
3295
3520
|
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:
|
|
3521
|
+
return { header: Cs(t3[0]), payload: Cs(t3[1]) };
|
|
3297
3522
|
}(s2);
|
|
3298
3523
|
n2 = e3.header, r2 = e3.payload;
|
|
3299
3524
|
} catch (e3) {
|
|
@@ -3307,7 +3532,7 @@ class ms {
|
|
|
3307
3532
|
const e3 = this.checkJwtPayload(r2);
|
|
3308
3533
|
t2.push(...e3);
|
|
3309
3534
|
}
|
|
3310
|
-
if (t2.length) if (this.usingBokens)
|
|
3535
|
+
if (t2.length) if (this.usingBokens) ws.log(`JWT Errors detected by AuthProvider when using bokens: ${t2.join("\n")}`);
|
|
3311
3536
|
else {
|
|
3312
3537
|
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
3538
|
const s3 = t2.length > 1;
|
|
@@ -3336,7 +3561,7 @@ class ms {
|
|
|
3336
3561
|
sendBokenRequest(e2, t2) {
|
|
3337
3562
|
return __async(this, null, function* () {
|
|
3338
3563
|
let s2 = 0;
|
|
3339
|
-
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield
|
|
3564
|
+
const n2 = e2.getBokensUrl(this.appId, this.userId, t2), r2 = yield ls({ method: "GET", url: n2, attempts: 1e4, shouldRetry: (e3) => {
|
|
3340
3565
|
if (e3 instanceof Error) return true;
|
|
3341
3566
|
if (401 === e3.status) throw "Check that you provided a valid signature.";
|
|
3342
3567
|
if (404 === e3.status) throw "Check that you specified the correct App ID.";
|
|
@@ -3349,7 +3574,7 @@ class ms {
|
|
|
3349
3574
|
});
|
|
3350
3575
|
}
|
|
3351
3576
|
}
|
|
3352
|
-
function
|
|
3577
|
+
function Cs(e2) {
|
|
3353
3578
|
try {
|
|
3354
3579
|
const t2 = e2.replace(/-/g, "+").replace(/_/g, "/"), s2 = decodeURIComponent(atob(t2).split("").map((e3) => "%" + ("00" + e3.charCodeAt(0).toString(16)).slice(-2)).join(""));
|
|
3355
3580
|
return JSON.parse(s2);
|
|
@@ -3357,8 +3582,8 @@ function gs(e2) {
|
|
|
3357
3582
|
throw `Could not base64-decode and JSON-parse token section: ${e2}. Check that you base-64 encoded the section correctly.`;
|
|
3358
3583
|
}
|
|
3359
3584
|
}
|
|
3360
|
-
const
|
|
3361
|
-
class
|
|
3585
|
+
const As = new cs("wss://realtime.talkjs.com/v1", "https://app.talkjs.com/api/v0", "https://api.talkjs.com/v1");
|
|
3586
|
+
class Es {
|
|
3362
3587
|
constructor(e2) {
|
|
3363
3588
|
this.target = e2;
|
|
3364
3589
|
}
|
|
@@ -3366,7 +3591,7 @@ class bs {
|
|
|
3366
3591
|
return this.target;
|
|
3367
3592
|
}
|
|
3368
3593
|
}
|
|
3369
|
-
const
|
|
3594
|
+
const ks = new class {
|
|
3370
3595
|
constructor() {
|
|
3371
3596
|
this.registry = {};
|
|
3372
3597
|
}
|
|
@@ -3374,7 +3599,7 @@ const ws = new class {
|
|
|
3374
3599
|
var _a2;
|
|
3375
3600
|
const t2 = this.key(e2), s2 = (_a2 = this.registry[t2]) == null ? void 0 : _a2.deref();
|
|
3376
3601
|
if (s2) return s2;
|
|
3377
|
-
const n2 = new
|
|
3602
|
+
const n2 = new Ts(e2), r2 = globalThis.WeakRef ? new WeakRef(n2) : new Es(n2);
|
|
3378
3603
|
return this.registry[t2] = r2, n2;
|
|
3379
3604
|
}
|
|
3380
3605
|
deregister(e2, t2) {
|
|
@@ -3385,10 +3610,10 @@ const ws = new class {
|
|
|
3385
3610
|
return `${e2}:${t2}`;
|
|
3386
3611
|
}
|
|
3387
3612
|
}();
|
|
3388
|
-
function
|
|
3389
|
-
return e2.forceCreateNew ? new
|
|
3613
|
+
function xs(e2) {
|
|
3614
|
+
return e2.forceCreateNew ? new Ts(e2) : ks.getOrCreate(e2);
|
|
3390
3615
|
}
|
|
3391
|
-
class
|
|
3616
|
+
class Ts {
|
|
3392
3617
|
constructor(e2) {
|
|
3393
3618
|
!function(e3) {
|
|
3394
3619
|
function t3(e4, t4) {
|
|
@@ -3398,13 +3623,13 @@ class As {
|
|
|
3398
3623
|
void 0 !== e3.tokenFetcher && t3("function" == typeof e3.tokenFetcher, "The `tokenFetcher` property of TalkSession#constructor must be a function.");
|
|
3399
3624
|
}(e2);
|
|
3400
3625
|
const { appId: t2, userId: s2, token: n2, tokenFetcher: r2, signature: i2 } = e2;
|
|
3401
|
-
this._appId = t2, this._apiUrls = e2.apiUrls ? new
|
|
3626
|
+
this._appId = t2, this._apiUrls = e2.apiUrls ? new cs(e2.apiUrls.realtimeWsApiUrl, e2.apiUrls.internalHttpApiUrl, e2.apiUrls.restApiHttpUrl) : As, this._authProvider = new ys(this._apiUrls, t2, s2, n2, r2, i2);
|
|
3402
3627
|
const a2 = Math.random().toString().split(".")[1];
|
|
3403
|
-
this._realtimeClient = new
|
|
3628
|
+
this._realtimeClient = new ke(this._apiUrls.getRealtimeWsUrl(t2, s2, "1.3.0", a2, e2.clientBuild), s2, this._authProvider), this.currentUser = new Ie(this._realtimeClient.userId, this._realtimeClient), this._terminationReason = o(), this._terminationReason.promise.then((e3) => {
|
|
3404
3629
|
console.error(`[TalkSession] ${e3}`);
|
|
3405
3630
|
}), function(e3, t3, s3) {
|
|
3406
3631
|
return __async(this, null, function* () {
|
|
3407
|
-
return
|
|
3632
|
+
return ls({ 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
3633
|
if ("string" != typeof e4 && "status" in e4) {
|
|
3409
3634
|
const t4 = e4;
|
|
3410
3635
|
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 +3650,40 @@ class As {
|
|
|
3425
3650
|
}), { unsubscribe: () => t2.resolve("UNSUBSCRIBED") };
|
|
3426
3651
|
}
|
|
3427
3652
|
user(e2) {
|
|
3428
|
-
return new
|
|
3653
|
+
return new Ie(e2, this._realtimeClient);
|
|
3429
3654
|
}
|
|
3430
3655
|
conversation(e2) {
|
|
3431
|
-
return new
|
|
3656
|
+
return new as(e2, this._realtimeClient);
|
|
3657
|
+
}
|
|
3658
|
+
subscribeConversations(e2) {
|
|
3659
|
+
return this._realtimeClient.subscribe(["me", "conversations"], e2);
|
|
3432
3660
|
}
|
|
3433
3661
|
terminate(e2) {
|
|
3434
|
-
|
|
3662
|
+
ks.deregister(this._appId, this.currentUser.id), this._terminationReason.resolve(e2), this._realtimeClient.destroy();
|
|
3435
3663
|
}
|
|
3436
3664
|
_isConnected() {
|
|
3437
3665
|
return this._realtimeClient.isConnected();
|
|
3438
3666
|
}
|
|
3439
3667
|
uploadFile(e2, t2) {
|
|
3440
|
-
return
|
|
3668
|
+
return Is(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, t2);
|
|
3441
3669
|
}
|
|
3442
3670
|
uploadImage(e2, t2) {
|
|
3443
|
-
return
|
|
3671
|
+
return Is(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "image" }, t2));
|
|
3444
3672
|
}
|
|
3445
3673
|
uploadVideo(e2, t2) {
|
|
3446
|
-
return
|
|
3674
|
+
return Is(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "video" }, t2));
|
|
3447
3675
|
}
|
|
3448
3676
|
uploadAudio(e2, t2) {
|
|
3449
|
-
return
|
|
3677
|
+
return Is(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "audio" }, t2));
|
|
3450
3678
|
}
|
|
3451
3679
|
uploadVoice(e2, t2) {
|
|
3452
|
-
return
|
|
3680
|
+
return Is(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`, this._authProvider, e2, __spreadValues({ subtype: "voice" }, t2));
|
|
3453
3681
|
}
|
|
3454
3682
|
}
|
|
3455
|
-
function
|
|
3683
|
+
function Is(_0, _1, _2, _3) {
|
|
3456
3684
|
return __async(this, arguments, function* (e2, t2, s2, { subtype: n2, filename: r2, width: i2, height: a2, duration: o2 }) {
|
|
3457
3685
|
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()),
|
|
3686
|
+
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()), ls({ method: "POST", url: e2, data: u2, authProvider: t2 }).then((e3) => e3.json()).then((e3) => e3.attachmentToken).catch((e3) => __async(this, null, function* () {
|
|
3459
3687
|
if (e3 instanceof Response) {
|
|
3460
3688
|
const t3 = yield e3.json(), s3 = `Unexpected response when uploading file, status code ${e3.status} ${t3.errorCode}, ${t3.reasons}`;
|
|
3461
3689
|
throw new Error(s3);
|
|
@@ -3465,7 +3693,7 @@ function Cs(_0, _1, _2, _3) {
|
|
|
3465
3693
|
});
|
|
3466
3694
|
}
|
|
3467
3695
|
export {
|
|
3468
|
-
|
|
3696
|
+
xs as getTalkSession,
|
|
3469
3697
|
f as registerPolyfills
|
|
3470
3698
|
};
|
|
3471
3699
|
//# sourceMappingURL=talkSession.js.map
|