choco-one-click-payment 1.1.49 → 1.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +384 -372
- package/dist/index.js +13 -13
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -32,6 +32,7 @@ const br = {
|
|
|
32
32
|
errorApplePayUnsupported: "Apple Pay не поддерживается в этом браузере",
|
|
33
33
|
errorApplePayInit: "Ошибка инициализации Apple Pay",
|
|
34
34
|
errorApplePayPayment: "Ошибка оплаты через Apple Pay",
|
|
35
|
+
errorApplePayInterrupted: "Пожалуйста, подтвердите оплату после полной загрузки окна Apple Pay",
|
|
35
36
|
errorGooglePayUnsupported: "Google Pay не поддерживается в этом браузере",
|
|
36
37
|
errorGooglePaySettingsUnavailable: "Настройки Google Pay недоступны",
|
|
37
38
|
errorGooglePayPayment: "Ошибка оплаты через Google Pay",
|
|
@@ -71,6 +72,7 @@ const br = {
|
|
|
71
72
|
errorApplePayUnsupported: "Apple Pay is not supported in this browser",
|
|
72
73
|
errorApplePayInit: "Apple Pay initialization error",
|
|
73
74
|
errorApplePayPayment: "Apple Pay payment error",
|
|
75
|
+
errorApplePayInterrupted: "Please confirm payment after the Apple Pay sheet fully loads",
|
|
74
76
|
errorGooglePayUnsupported: "Google Pay is not supported in this browser",
|
|
75
77
|
errorGooglePaySettingsUnavailable: "Google Pay settings are unavailable",
|
|
76
78
|
errorGooglePayPayment: "Google Pay payment error",
|
|
@@ -110,6 +112,7 @@ const br = {
|
|
|
110
112
|
errorApplePayUnsupported: "Бұл браузерде Apple Pay қолдау көрсетілмейді",
|
|
111
113
|
errorApplePayInit: "Apple Pay инициализация қатесі",
|
|
112
114
|
errorApplePayPayment: "Apple Pay арқылы төлем қатесі",
|
|
115
|
+
errorApplePayInterrupted: "Өтінеміз, төлемді Apple Pay терезесі толық жүктелгеннен кейін растаңыз",
|
|
113
116
|
errorGooglePayUnsupported: "Бұл браузерде Google Pay қолдау көрсетілмейді",
|
|
114
117
|
errorGooglePaySettingsUnavailable: "Google Pay баптаулары қолжетімсіз",
|
|
115
118
|
errorGooglePayPayment: "Google Pay арқылы төлем қатесі",
|
|
@@ -149,6 +152,7 @@ const br = {
|
|
|
149
152
|
errorApplePayUnsupported: "ამ ბრაუზერში Apple Pay არ არის მხარდაჭერილი",
|
|
150
153
|
errorApplePayInit: "Apple Pay-ის ინიციალიზაციის შეცდომა",
|
|
151
154
|
errorApplePayPayment: "Apple Pay-ით გადახდის შეცდომა",
|
|
155
|
+
errorApplePayInterrupted: "გთხოვთ, დაადასტუროთ გადახდა Apple Pay-ის ფანჯრის სრულად ჩატვირთვის შემდეგ",
|
|
152
156
|
errorGooglePayUnsupported: "ამ ბრაუზერში Google Pay არ არის მხარდაჭერილი",
|
|
153
157
|
errorGooglePaySettingsUnavailable: "Google Pay-ის პარამეტრები მიუწვდომელია",
|
|
154
158
|
errorGooglePayPayment: "Google Pay-ით გადახდის შეცდომა",
|
|
@@ -241,16 +245,16 @@ function Pr() {
|
|
|
241
245
|
Object.defineProperty(u, "__esModule", {
|
|
242
246
|
value: !0
|
|
243
247
|
}), u.Centrifuge = void 0;
|
|
244
|
-
var
|
|
248
|
+
var f = I(l(187)), y = I(l(471)), C = l(147), b = l(853);
|
|
245
249
|
function I(g) {
|
|
246
250
|
return g && g.__esModule ? g : { default: g };
|
|
247
251
|
}
|
|
248
252
|
function B(g) {
|
|
249
253
|
"@babel/helpers - typeof";
|
|
250
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? B = function(
|
|
251
|
-
return typeof
|
|
252
|
-
} : B = function(
|
|
253
|
-
return
|
|
254
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? B = function(m) {
|
|
255
|
+
return typeof m;
|
|
256
|
+
} : B = function(m) {
|
|
257
|
+
return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m;
|
|
254
258
|
}, B(g);
|
|
255
259
|
}
|
|
256
260
|
function Q(g, p) {
|
|
@@ -258,12 +262,12 @@ function Pr() {
|
|
|
258
262
|
throw new TypeError("Cannot call a class as a function");
|
|
259
263
|
}
|
|
260
264
|
function S(g, p) {
|
|
261
|
-
for (var
|
|
262
|
-
var d = p[
|
|
265
|
+
for (var m = 0; m < p.length; m++) {
|
|
266
|
+
var d = p[m];
|
|
263
267
|
d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(g, d.key, d);
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
|
-
function P(g, p,
|
|
270
|
+
function P(g, p, m) {
|
|
267
271
|
return p && S(g.prototype, p), g;
|
|
268
272
|
}
|
|
269
273
|
function k(g, p) {
|
|
@@ -311,16 +315,16 @@ function Pr() {
|
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
317
|
function z(g) {
|
|
314
|
-
return z = Object.setPrototypeOf ? Object.getPrototypeOf : function(
|
|
315
|
-
return
|
|
318
|
+
return z = Object.setPrototypeOf ? Object.getPrototypeOf : function(m) {
|
|
319
|
+
return m.__proto__ || Object.getPrototypeOf(m);
|
|
316
320
|
}, z(g);
|
|
317
321
|
}
|
|
318
322
|
var J = "timeout", M = "connection closed", v = /* @__PURE__ */ (function(g) {
|
|
319
|
-
k(
|
|
320
|
-
var p = L(
|
|
321
|
-
function
|
|
323
|
+
k(m, g);
|
|
324
|
+
var p = L(m);
|
|
325
|
+
function m(d, s) {
|
|
322
326
|
var a;
|
|
323
|
-
return Q(this,
|
|
327
|
+
return Q(this, m), a = p.call(this), a._url = d, a._websocket = null, a._sockjs = null, a._isSockjs = !1, a._xmlhttprequest = null, a._binary = !1, a._methodType = null, a._pushType = null, a._encoder = null, a._decoder = null, a._status = "disconnected", a._reconnect = !0, a._reconnecting = !1, a._transport = null, a._transportName = null, a._transportClosed = !0, a._messageId = 0, a._clientID = null, a._refreshRequired = !1, a._subs = {}, a._serverSubs = {}, a._lastSeq = {}, a._lastGen = {}, a._lastOffset = {}, a._lastEpoch = {}, a._messages = [], a._isBatching = !1, a._isSubscribeBatching = !1, a._privateChannels = {}, a._numRefreshFailed = 0, a._refreshTimeout = null, a._pingTimeout = null, a._pongTimeout = null, a._subRefreshTimeouts = {}, a._retries = 0, a._callbacks = {}, a._latency = null, a._latencyStart = null, a._connectData = null, a._token = null, a._xhrID = 0, a._xhrs = {}, a._dispatchPromise = Promise.resolve(), a._protocol = "", a._config = {
|
|
324
328
|
protocol: "",
|
|
325
329
|
debug: !1,
|
|
326
330
|
name: "js",
|
|
@@ -355,7 +359,7 @@ function Pr() {
|
|
|
355
359
|
disableWithCredentials: !1
|
|
356
360
|
}, a._configure(s), a;
|
|
357
361
|
}
|
|
358
|
-
return P(
|
|
362
|
+
return P(m, [{
|
|
359
363
|
key: "setToken",
|
|
360
364
|
value: function(s) {
|
|
361
365
|
this._token = s;
|
|
@@ -392,9 +396,9 @@ function Pr() {
|
|
|
392
396
|
}
|
|
393
397
|
}, {
|
|
394
398
|
key: "_ajax",
|
|
395
|
-
value: function(s, a, A,
|
|
399
|
+
value: function(s, a, A, h, E) {
|
|
396
400
|
var _ = this, T = "";
|
|
397
|
-
this._debug("sending AJAX request to", s, "with data", JSON.stringify(
|
|
401
|
+
this._debug("sending AJAX request to", s, "with data", JSON.stringify(h));
|
|
398
402
|
var w;
|
|
399
403
|
this._xmlhttprequest !== null ? w = new this._xmlhttprequest() : w = l.g.XMLHttpRequest ? new l.g.XMLHttpRequest() : new l.g.ActiveXObject("Microsoft.XMLHTTP");
|
|
400
404
|
for (var O in a)
|
|
@@ -425,7 +429,7 @@ function Pr() {
|
|
|
425
429
|
data: null
|
|
426
430
|
});
|
|
427
431
|
}, setTimeout(function() {
|
|
428
|
-
return w.send(JSON.stringify(
|
|
432
|
+
return w.send(JSON.stringify(h));
|
|
429
433
|
}, 20), w;
|
|
430
434
|
}
|
|
431
435
|
}, {
|
|
@@ -449,7 +453,7 @@ function Pr() {
|
|
|
449
453
|
if (!this._formatOverride(s)) {
|
|
450
454
|
if (s === "protobuf")
|
|
451
455
|
throw new Error("not implemented by JSON only Centrifuge client – use client with Protobuf");
|
|
452
|
-
this._binary = !1, this._methodType =
|
|
456
|
+
this._binary = !1, this._methodType = C.JsonMethodType, this._pushType = C.JsonPushType, this._encoder = new C.JsonEncoder(), this._decoder = new C.JsonDecoder();
|
|
453
457
|
}
|
|
454
458
|
}
|
|
455
459
|
}, {
|
|
@@ -540,10 +544,10 @@ function Pr() {
|
|
|
540
544
|
if (this._callbacks.hasOwnProperty(a)) {
|
|
541
545
|
var A = this._callbacks[a];
|
|
542
546
|
clearTimeout(A.timeout);
|
|
543
|
-
var
|
|
544
|
-
if (!
|
|
547
|
+
var h = A.errback;
|
|
548
|
+
if (!h)
|
|
545
549
|
continue;
|
|
546
|
-
|
|
550
|
+
h({
|
|
547
551
|
error: this._createErrorObject("disconnected")
|
|
548
552
|
});
|
|
549
553
|
}
|
|
@@ -572,9 +576,9 @@ function Pr() {
|
|
|
572
576
|
for (var a in s) {
|
|
573
577
|
var A = a.id;
|
|
574
578
|
if (A in this._callbacks) {
|
|
575
|
-
var
|
|
579
|
+
var h = this._callbacks[A];
|
|
576
580
|
clearTimeout(this._callbacks[A].timeout), delete this._callbacks[A];
|
|
577
|
-
var E =
|
|
581
|
+
var E = h.errback;
|
|
578
582
|
E({
|
|
579
583
|
error: this._createErrorObject(M, 0)
|
|
580
584
|
});
|
|
@@ -609,10 +613,10 @@ function Pr() {
|
|
|
609
613
|
s._transportClosed = !1, s._isSockjs ? (s._transportName = "sockjs-" + s._transport.transport, s._transport.onheartbeat = function() {
|
|
610
614
|
return s._restartPing();
|
|
611
615
|
}) : s._transportName = "websocket";
|
|
612
|
-
var
|
|
616
|
+
var h = {
|
|
613
617
|
// method: this._methodType.CONNECT
|
|
614
618
|
};
|
|
615
|
-
(s._token || s._connectData || s._config.name || s._config.version) && (
|
|
619
|
+
(s._token || s._connectData || s._config.name || s._config.version) && (h.params = {}), s._token && (h.params.token = s._token), s._connectData && (h.params.data = s._connectData), s._config.name && (h.params.name = s._config.name), s._config.version && (h.params.version = s._config.version);
|
|
616
620
|
var E = {}, _ = !1;
|
|
617
621
|
for (var T in s._serverSubs)
|
|
618
622
|
if (s._serverSubs.hasOwnProperty(T) && s._serverSubs[T].recoverable) {
|
|
@@ -622,26 +626,26 @@ function Pr() {
|
|
|
622
626
|
};
|
|
623
627
|
s._serverSubs[T].seq || s._serverSubs[T].gen ? (s._serverSubs[T].seq && (w.seq = s._serverSubs[T].seq), s._serverSubs[T].gen && (w.gen = s._serverSubs[T].gen)) : s._serverSubs[T].offset && (w.offset = s._serverSubs[T].offset), s._serverSubs[T].epoch && (w.epoch = s._serverSubs[T].epoch), E[T] = w;
|
|
624
628
|
}
|
|
625
|
-
_ && (
|
|
629
|
+
_ && (h.params || (h.params = {}), h.params.subs = E), s._latencyStart = /* @__PURE__ */ new Date(), s._call(h).then(function(O) {
|
|
626
630
|
s._connectResponse(s._decoder.decodeCommandResult(s._methodType.CONNECT, O.result), _), O.next && O.next();
|
|
627
631
|
}, function(O) {
|
|
628
632
|
var F = O.error;
|
|
629
633
|
F.code === 109 && (s._refreshRequired = !0), s._disconnect("connect error", !0), O.next && O.next();
|
|
630
634
|
});
|
|
631
|
-
}, this._transport.onerror = function(
|
|
632
|
-
s._debug("transport level error",
|
|
633
|
-
}, this._transport.onclose = function(
|
|
635
|
+
}, this._transport.onerror = function(h) {
|
|
636
|
+
s._debug("transport level error", h);
|
|
637
|
+
}, this._transport.onclose = function(h) {
|
|
634
638
|
s._transportClosed = !0;
|
|
635
639
|
var E = M, _ = !0;
|
|
636
|
-
if (
|
|
640
|
+
if (h && "reason" in h && h.reason)
|
|
637
641
|
try {
|
|
638
|
-
var T = JSON.parse(
|
|
642
|
+
var T = JSON.parse(h.reason);
|
|
639
643
|
s._debug("reason is an advice object", T), E = T.reason, _ = T.reconnect;
|
|
640
644
|
} catch {
|
|
641
|
-
E =
|
|
645
|
+
E = h.reason, s._debug("reason is a plain string", E);
|
|
642
646
|
}
|
|
643
647
|
if (s._config.onTransportClose !== null && s._config.onTransportClose({
|
|
644
|
-
event:
|
|
648
|
+
event: h,
|
|
645
649
|
reason: E,
|
|
646
650
|
reconnect: _
|
|
647
651
|
}), s._disconnect(E, _), s._reconnect === !0) {
|
|
@@ -651,8 +655,8 @@ function Pr() {
|
|
|
651
655
|
s._reconnect === !0 && (s._refreshRequired ? s._refresh() : s._connect());
|
|
652
656
|
}, w);
|
|
653
657
|
}
|
|
654
|
-
}, this._transport.onmessage = function(
|
|
655
|
-
s._dataReceived(
|
|
658
|
+
}, this._transport.onmessage = function(h) {
|
|
659
|
+
s._dataReceived(h.data);
|
|
656
660
|
};
|
|
657
661
|
}
|
|
658
662
|
}, {
|
|
@@ -672,11 +676,11 @@ function Pr() {
|
|
|
672
676
|
data: a
|
|
673
677
|
};
|
|
674
678
|
s !== "" && (A.method = s);
|
|
675
|
-
var
|
|
679
|
+
var h = {
|
|
676
680
|
method: this._methodType.RPC,
|
|
677
681
|
params: A
|
|
678
682
|
};
|
|
679
|
-
return this._methodCall(
|
|
683
|
+
return this._methodCall(h, function(E) {
|
|
680
684
|
return E;
|
|
681
685
|
});
|
|
682
686
|
}
|
|
@@ -708,9 +712,9 @@ function Pr() {
|
|
|
708
712
|
key: "_methodCall",
|
|
709
713
|
value: function(s, a) {
|
|
710
714
|
var A = this;
|
|
711
|
-
return this.isConnected() ? new Promise(function(
|
|
715
|
+
return this.isConnected() ? new Promise(function(h, E) {
|
|
712
716
|
A._call(s).then(function(_) {
|
|
713
|
-
|
|
717
|
+
h(a(A._decoder.decodeCommandResult(s.method, _.result))), _.next && _.next();
|
|
714
718
|
}, function(_) {
|
|
715
719
|
E(_.error), _.next && _.next();
|
|
716
720
|
});
|
|
@@ -733,11 +737,11 @@ function Pr() {
|
|
|
733
737
|
}, {
|
|
734
738
|
key: "history",
|
|
735
739
|
value: function(s, a) {
|
|
736
|
-
var A = this._getHistoryParams(s, a),
|
|
740
|
+
var A = this._getHistoryParams(s, a), h = {
|
|
737
741
|
method: this._methodType.HISTORY,
|
|
738
742
|
params: A
|
|
739
743
|
};
|
|
740
|
-
return this._methodCall(
|
|
744
|
+
return this._methodCall(h, function(E) {
|
|
741
745
|
return {
|
|
742
746
|
publications: E.publications,
|
|
743
747
|
epoch: E.epoch || "",
|
|
@@ -781,23 +785,23 @@ function Pr() {
|
|
|
781
785
|
value: function(s) {
|
|
782
786
|
var a = this, A = this._decoder.decodeReplies(s);
|
|
783
787
|
this._dispatchPromise = this._dispatchPromise.then(function() {
|
|
784
|
-
var
|
|
788
|
+
var h;
|
|
785
789
|
a._dispatchPromise = new Promise(function(E) {
|
|
786
|
-
|
|
787
|
-
}), a._dispatchSynchronized(A,
|
|
790
|
+
h = E;
|
|
791
|
+
}), a._dispatchSynchronized(A, h);
|
|
788
792
|
}), this._restartPing();
|
|
789
793
|
}
|
|
790
794
|
}, {
|
|
791
795
|
key: "_dispatchSynchronized",
|
|
792
796
|
value: function(s, a) {
|
|
793
|
-
var A = this,
|
|
794
|
-
s.hasOwnProperty(w) && (
|
|
797
|
+
var A = this, h = Promise.resolve(), E = function(w) {
|
|
798
|
+
s.hasOwnProperty(w) && (h = h.then(function() {
|
|
795
799
|
return A._dispatchReply(s[w]);
|
|
796
800
|
}));
|
|
797
801
|
};
|
|
798
802
|
for (var _ in s)
|
|
799
803
|
E(_);
|
|
800
|
-
|
|
804
|
+
h = h.then(function() {
|
|
801
805
|
a();
|
|
802
806
|
});
|
|
803
807
|
}
|
|
@@ -809,16 +813,16 @@ function Pr() {
|
|
|
809
813
|
});
|
|
810
814
|
if (s == null)
|
|
811
815
|
return this._debug("dispatch: got undefined or null reply"), a(), A;
|
|
812
|
-
var
|
|
813
|
-
return
|
|
816
|
+
var h = s.id;
|
|
817
|
+
return h && h > 0 ? this._handleReply(s, a) : this._handlePush(s.result, a), A;
|
|
814
818
|
}
|
|
815
819
|
}, {
|
|
816
820
|
key: "_call",
|
|
817
821
|
value: function(s) {
|
|
818
822
|
var a = this;
|
|
819
|
-
return new Promise(function(A,
|
|
823
|
+
return new Promise(function(A, h) {
|
|
820
824
|
var E = a._addMessage(s);
|
|
821
|
-
a._registerCall(E, A,
|
|
825
|
+
a._registerCall(E, A, h);
|
|
822
826
|
});
|
|
823
827
|
}
|
|
824
828
|
}, {
|
|
@@ -839,9 +843,9 @@ function Pr() {
|
|
|
839
843
|
return;
|
|
840
844
|
}
|
|
841
845
|
if (this._clearConnectedState(A), this._debug("disconnected:", s, a), this._setStatus("disconnected"), this._refreshTimeout && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null), this._reconnecting === !1) {
|
|
842
|
-
for (var
|
|
843
|
-
this._serverSubs.hasOwnProperty(
|
|
844
|
-
channel:
|
|
846
|
+
for (var h in this._serverSubs)
|
|
847
|
+
this._serverSubs.hasOwnProperty(h) && this.emit("unsubscribe", {
|
|
848
|
+
channel: h
|
|
845
849
|
});
|
|
846
850
|
this.emit("disconnect", {
|
|
847
851
|
reason: s,
|
|
@@ -864,7 +868,7 @@ function Pr() {
|
|
|
864
868
|
return;
|
|
865
869
|
}
|
|
866
870
|
this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
867
|
-
var a = this._clientID, A = this._newXHRID(),
|
|
871
|
+
var a = this._clientID, A = this._newXHRID(), h = function(w) {
|
|
868
872
|
if (A in s._xhrs && delete s._xhrs[A], s._clientID === a) {
|
|
869
873
|
if (w.error || w.status !== 200) {
|
|
870
874
|
if (w.error ? s._debug("error refreshing connection token", w.error) : s._debug("error refreshing connection token: wrong status code", w.status), s._numRefreshFailed++, s._refreshTimeout !== null && (clearTimeout(s._refreshTimeout), s._refreshTimeout = null), s._config.refreshAttempts !== null && s._numRefreshFailed >= s._config.refreshAttempts) {
|
|
@@ -901,9 +905,9 @@ function Pr() {
|
|
|
901
905
|
};
|
|
902
906
|
if (this._config.onRefresh !== null) {
|
|
903
907
|
var E = {};
|
|
904
|
-
this._config.onRefresh(E,
|
|
908
|
+
this._config.onRefresh(E, h);
|
|
905
909
|
} else {
|
|
906
|
-
var _ = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData,
|
|
910
|
+
var _ = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData, h);
|
|
907
911
|
this._xhrs[A] = _;
|
|
908
912
|
}
|
|
909
913
|
}
|
|
@@ -938,8 +942,8 @@ function Pr() {
|
|
|
938
942
|
this._clearSubRefreshTimeout(s);
|
|
939
943
|
else
|
|
940
944
|
return;
|
|
941
|
-
var A = this._clientID,
|
|
942
|
-
if (
|
|
945
|
+
var A = this._clientID, h = this._newXHRID(), E = function(O) {
|
|
946
|
+
if (h in a._xhrs && delete a._xhrs[h], !(O.error || O.status !== 200 || a._clientID !== A)) {
|
|
943
947
|
var F = {};
|
|
944
948
|
if (O.data.channels)
|
|
945
949
|
for (var X in O.data.channels) {
|
|
@@ -972,7 +976,7 @@ function Pr() {
|
|
|
972
976
|
}, E);
|
|
973
977
|
else {
|
|
974
978
|
var T = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, _, E);
|
|
975
|
-
this._xhrs[
|
|
979
|
+
this._xhrs[h] = T;
|
|
976
980
|
}
|
|
977
981
|
}
|
|
978
982
|
}, {
|
|
@@ -985,8 +989,8 @@ function Pr() {
|
|
|
985
989
|
value: function(s, a) {
|
|
986
990
|
var A = this;
|
|
987
991
|
this._debug("subscription refresh error", s, a), this._clearSubRefreshTimeout(s);
|
|
988
|
-
var
|
|
989
|
-
if (
|
|
992
|
+
var h = this._getSub(s);
|
|
993
|
+
if (h !== null) {
|
|
990
994
|
var E = Math.round(Math.random() * 1e3), _ = setTimeout(function() {
|
|
991
995
|
return A._subRefresh(s);
|
|
992
996
|
}, this._config.subRefreshInterval + E);
|
|
@@ -998,8 +1002,8 @@ function Pr() {
|
|
|
998
1002
|
value: function(s, a) {
|
|
999
1003
|
var A = this;
|
|
1000
1004
|
this._debug("subscription refresh success", s), this._clearSubRefreshTimeout(s);
|
|
1001
|
-
var
|
|
1002
|
-
if (
|
|
1005
|
+
var h = this._getSub(s);
|
|
1006
|
+
if (h !== null && a.expires === !0) {
|
|
1003
1007
|
var E = setTimeout(function() {
|
|
1004
1008
|
return A._subRefresh(s);
|
|
1005
1009
|
}, this._getTTLMilliseconds(a.ttl));
|
|
@@ -1011,8 +1015,8 @@ function Pr() {
|
|
|
1011
1015
|
value: function(s, a) {
|
|
1012
1016
|
var A = this;
|
|
1013
1017
|
this._debug("subscribing on", s.channel);
|
|
1014
|
-
var
|
|
1015
|
-
if (
|
|
1018
|
+
var h = s.channel;
|
|
1019
|
+
if (h in this._subs || (this._subs[h] = s), !this.isConnected()) {
|
|
1016
1020
|
s._setNew();
|
|
1017
1021
|
return;
|
|
1018
1022
|
}
|
|
@@ -1020,29 +1024,29 @@ function Pr() {
|
|
|
1020
1024
|
var E = {
|
|
1021
1025
|
method: this._methodType.SUBSCRIBE,
|
|
1022
1026
|
params: {
|
|
1023
|
-
channel:
|
|
1027
|
+
channel: h
|
|
1024
1028
|
}
|
|
1025
1029
|
};
|
|
1026
|
-
if (s._subscribeData && (E.params.data = s._subscribeData), (0, b.startsWith)(
|
|
1027
|
-
this._isSubscribeBatching ? this._privateChannels[
|
|
1030
|
+
if (s._subscribeData && (E.params.data = s._subscribeData), (0, b.startsWith)(h, this._config.privateChannelPrefix))
|
|
1031
|
+
this._isSubscribeBatching ? this._privateChannels[h] = !0 : (this.startSubscribeBatching(), this._subscribe(s), this.stopSubscribeBatching());
|
|
1028
1032
|
else {
|
|
1029
1033
|
var _ = s._needRecover();
|
|
1030
1034
|
if (_ === !0) {
|
|
1031
1035
|
E.params.recover = !0;
|
|
1032
|
-
var T = this._getLastSeq(
|
|
1036
|
+
var T = this._getLastSeq(h), w = this._getLastGen(h);
|
|
1033
1037
|
if (T || w)
|
|
1034
1038
|
T && (E.params.seq = T), w && (E.params.gen = w);
|
|
1035
1039
|
else {
|
|
1036
|
-
var O = this._getLastOffset(
|
|
1040
|
+
var O = this._getLastOffset(h);
|
|
1037
1041
|
O && (E.params.offset = O);
|
|
1038
1042
|
}
|
|
1039
|
-
var F = this._getLastEpoch(
|
|
1043
|
+
var F = this._getLastEpoch(h);
|
|
1040
1044
|
F && (E.params.epoch = F);
|
|
1041
1045
|
}
|
|
1042
1046
|
this._call(E).then(function(X) {
|
|
1043
|
-
A._subscribeResponse(
|
|
1047
|
+
A._subscribeResponse(h, _, A._decoder.decodeCommandResult(A._methodType.SUBSCRIBE, X.result)), X.next && X.next();
|
|
1044
1048
|
}, function(X) {
|
|
1045
|
-
A._subscribeError(
|
|
1049
|
+
A._subscribeError(h, X.error), X.next && X.next();
|
|
1046
1050
|
});
|
|
1047
1051
|
}
|
|
1048
1052
|
}
|
|
@@ -1080,7 +1084,7 @@ function Pr() {
|
|
|
1080
1084
|
}, {
|
|
1081
1085
|
key: "_connectResponse",
|
|
1082
1086
|
value: function(s, a) {
|
|
1083
|
-
var A = this,
|
|
1087
|
+
var A = this, h = this._reconnecting;
|
|
1084
1088
|
if (this._reconnecting = !1, this._resetRetry(), this._refreshRequired = !1, !this.isConnected()) {
|
|
1085
1089
|
this._latencyStart !== null && (this._latency = (/* @__PURE__ */ new Date()).getTime() - this._latencyStart.getTime(), this._latencyStart = null), this._clientID = s.client, this._setStatus("connected"), this._refreshTimeout && clearTimeout(this._refreshTimeout), s.expires && (this._refreshTimeout = setTimeout(function() {
|
|
1086
1090
|
return A._refresh();
|
|
@@ -1088,7 +1092,7 @@ function Pr() {
|
|
|
1088
1092
|
for (var E in this._subs)
|
|
1089
1093
|
if (this._subs.hasOwnProperty(E)) {
|
|
1090
1094
|
var _ = this._subs[E];
|
|
1091
|
-
_._shouldResubscribe() && this._subscribe(_,
|
|
1095
|
+
_._shouldResubscribe() && this._subscribe(_, h);
|
|
1092
1096
|
}
|
|
1093
1097
|
this.stopSubscribeBatching(), this.stopBatching(), this._startPing();
|
|
1094
1098
|
var T = {
|
|
@@ -1104,9 +1108,9 @@ function Pr() {
|
|
|
1104
1108
|
value: function(s) {
|
|
1105
1109
|
for (var a in s)
|
|
1106
1110
|
if (s.hasOwnProperty(a)) {
|
|
1107
|
-
var A = s[a],
|
|
1111
|
+
var A = s[a], h = this._serverSubs[a] !== void 0, E = {
|
|
1108
1112
|
channel: a,
|
|
1109
|
-
isResubscribe:
|
|
1113
|
+
isResubscribe: h
|
|
1110
1114
|
};
|
|
1111
1115
|
E = this._expandSubscribeContext(E, A), this.emit("subscribe", E);
|
|
1112
1116
|
}
|
|
@@ -1171,12 +1175,12 @@ function Pr() {
|
|
|
1171
1175
|
value: function(s, a) {
|
|
1172
1176
|
var A = !1;
|
|
1173
1177
|
"recovered" in a && (A = a.recovered), s.recovered = A;
|
|
1174
|
-
var
|
|
1175
|
-
"positioned" in a && (
|
|
1178
|
+
var h = !1;
|
|
1179
|
+
"positioned" in a && (h = a.positioned);
|
|
1176
1180
|
var E = "";
|
|
1177
1181
|
"epoch" in a && (E = a.epoch);
|
|
1178
1182
|
var _ = 0;
|
|
1179
|
-
return "offset" in a && (_ = a.offset),
|
|
1183
|
+
return "offset" in a && (_ = a.offset), h && (s.streamPosition = {
|
|
1180
1184
|
offset: _,
|
|
1181
1185
|
epoch: E
|
|
1182
1186
|
}), a.data && (s.data = a.data), s;
|
|
@@ -1184,7 +1188,7 @@ function Pr() {
|
|
|
1184
1188
|
}, {
|
|
1185
1189
|
key: "_subscribeResponse",
|
|
1186
1190
|
value: function(s, a, A) {
|
|
1187
|
-
var
|
|
1191
|
+
var h = this, E = this._getSub(s);
|
|
1188
1192
|
if (E && E._isSubscribing()) {
|
|
1189
1193
|
E._setSubscribeSuccess(A);
|
|
1190
1194
|
var _ = A.publications;
|
|
@@ -1195,7 +1199,7 @@ function Pr() {
|
|
|
1195
1199
|
}
|
|
1196
1200
|
if (A.recoverable && (!a || !A.recovered) && (this._lastSeq[s] = A.seq || 0, this._lastGen[s] = A.gen || 0, this._lastOffset[s] = A.offset || 0), this._lastEpoch[s] = A.epoch || "", A.recoverable && (E._recoverable = !0), A.expires === !0) {
|
|
1197
1201
|
var w = setTimeout(function() {
|
|
1198
|
-
return
|
|
1202
|
+
return h._subRefresh(s);
|
|
1199
1203
|
}, this._getTTLMilliseconds(A.ttl));
|
|
1200
1204
|
this._subRefreshTimeouts[s] = w;
|
|
1201
1205
|
}
|
|
@@ -1204,7 +1208,7 @@ function Pr() {
|
|
|
1204
1208
|
}, {
|
|
1205
1209
|
key: "_handleReply",
|
|
1206
1210
|
value: function(s, a) {
|
|
1207
|
-
var A = s.id,
|
|
1211
|
+
var A = s.id, h = s.result;
|
|
1208
1212
|
if (!(A in this._callbacks)) {
|
|
1209
1213
|
a();
|
|
1210
1214
|
return;
|
|
@@ -1226,7 +1230,7 @@ function Pr() {
|
|
|
1226
1230
|
if (!_)
|
|
1227
1231
|
return;
|
|
1228
1232
|
_({
|
|
1229
|
-
result:
|
|
1233
|
+
result: h,
|
|
1230
1234
|
next: a
|
|
1231
1235
|
});
|
|
1232
1236
|
}
|
|
@@ -1236,34 +1240,34 @@ function Pr() {
|
|
|
1236
1240
|
value: function(s, a) {
|
|
1237
1241
|
var A = {
|
|
1238
1242
|
info: a.info
|
|
1239
|
-
},
|
|
1240
|
-
if (!
|
|
1243
|
+
}, h = this._getSub(s);
|
|
1244
|
+
if (!h) {
|
|
1241
1245
|
this._isServerSub(s) && (A.channel = s, this.emit("join", A));
|
|
1242
1246
|
return;
|
|
1243
1247
|
}
|
|
1244
|
-
|
|
1248
|
+
h.emit("join", A);
|
|
1245
1249
|
}
|
|
1246
1250
|
}, {
|
|
1247
1251
|
key: "_handleLeave",
|
|
1248
1252
|
value: function(s, a) {
|
|
1249
1253
|
var A = {
|
|
1250
1254
|
info: a.info
|
|
1251
|
-
},
|
|
1252
|
-
if (!
|
|
1255
|
+
}, h = this._getSub(s);
|
|
1256
|
+
if (!h) {
|
|
1253
1257
|
this._isServerSub(s) && (A.channel = s, this.emit("leave", A));
|
|
1254
1258
|
return;
|
|
1255
1259
|
}
|
|
1256
|
-
|
|
1260
|
+
h.emit("leave", A);
|
|
1257
1261
|
}
|
|
1258
1262
|
}, {
|
|
1259
1263
|
key: "_handleUnsub",
|
|
1260
1264
|
value: function(s, a) {
|
|
1261
|
-
var A = {},
|
|
1262
|
-
if (!
|
|
1265
|
+
var A = {}, h = this._getSub(s);
|
|
1266
|
+
if (!h) {
|
|
1263
1267
|
this._isServerSub(s) && (delete this._serverSubs[s], A.channel = s, this.emit("unsubscribe", A));
|
|
1264
1268
|
return;
|
|
1265
1269
|
}
|
|
1266
|
-
|
|
1270
|
+
h.unsubscribe(), a.resubscribe === !0 && h.subscribe();
|
|
1267
1271
|
}
|
|
1268
1272
|
}, {
|
|
1269
1273
|
key: "_handleSub",
|
|
@@ -1284,17 +1288,17 @@ function Pr() {
|
|
|
1284
1288
|
}, {
|
|
1285
1289
|
key: "_handlePublication",
|
|
1286
1290
|
value: function(s, a) {
|
|
1287
|
-
var A = this._getSub(s),
|
|
1291
|
+
var A = this._getSub(s), h = {
|
|
1288
1292
|
data: a.data,
|
|
1289
1293
|
seq: a.seq,
|
|
1290
1294
|
gen: a.gen,
|
|
1291
1295
|
offset: a.offset
|
|
1292
1296
|
};
|
|
1293
|
-
if (a.info && (
|
|
1294
|
-
this._isServerSub(s) && (a.seq !== void 0 && (this._serverSubs[s].seq = a.seq), a.gen !== void 0 && (this._serverSubs[s].gen = a.gen), a.offset !== void 0 && (this._serverSubs[s].offset = a.offset),
|
|
1297
|
+
if (a.info && (h.info = a.info), !A) {
|
|
1298
|
+
this._isServerSub(s) && (a.seq !== void 0 && (this._serverSubs[s].seq = a.seq), a.gen !== void 0 && (this._serverSubs[s].gen = a.gen), a.offset !== void 0 && (this._serverSubs[s].offset = a.offset), h.channel = s, this.emit("publish", h));
|
|
1295
1299
|
return;
|
|
1296
1300
|
}
|
|
1297
|
-
a.seq !== void 0 && (this._lastSeq[s] = a.seq), a.gen !== void 0 && (this._lastGen[s] = a.gen), a.offset !== void 0 && (this._lastOffset[s] = a.offset), A.emit("publish",
|
|
1301
|
+
a.seq !== void 0 && (this._lastSeq[s] = a.seq), a.gen !== void 0 && (this._lastGen[s] = a.gen), a.offset !== void 0 && (this._lastOffset[s] = a.offset), A.emit("publish", h);
|
|
1298
1302
|
}
|
|
1299
1303
|
}, {
|
|
1300
1304
|
key: "_handleMessage",
|
|
@@ -1304,25 +1308,25 @@ function Pr() {
|
|
|
1304
1308
|
}, {
|
|
1305
1309
|
key: "_handlePush",
|
|
1306
1310
|
value: function(s, a) {
|
|
1307
|
-
var A = this._decoder.decodePush(s),
|
|
1308
|
-
"type" in A && (
|
|
1311
|
+
var A = this._decoder.decodePush(s), h = 0;
|
|
1312
|
+
"type" in A && (h = A.type);
|
|
1309
1313
|
var E = A.channel;
|
|
1310
|
-
if (
|
|
1314
|
+
if (h === this._pushType.PUBLICATION) {
|
|
1311
1315
|
var _ = this._decoder.decodePushData(this._pushType.PUBLICATION, A.data);
|
|
1312
1316
|
this._handlePublication(E, _);
|
|
1313
|
-
} else if (
|
|
1317
|
+
} else if (h === this._pushType.MESSAGE) {
|
|
1314
1318
|
var T = this._decoder.decodePushData(this._pushType.MESSAGE, A.data);
|
|
1315
1319
|
this._handleMessage(T);
|
|
1316
|
-
} else if (
|
|
1320
|
+
} else if (h === this._pushType.JOIN) {
|
|
1317
1321
|
var w = this._decoder.decodePushData(this._pushType.JOIN, A.data);
|
|
1318
1322
|
this._handleJoin(E, w);
|
|
1319
|
-
} else if (
|
|
1323
|
+
} else if (h === this._pushType.LEAVE) {
|
|
1320
1324
|
var O = this._decoder.decodePushData(this._pushType.LEAVE, A.data);
|
|
1321
1325
|
this._handleLeave(E, O);
|
|
1322
|
-
} else if (
|
|
1326
|
+
} else if (h === this._pushType.UNSUBSCRIBE) {
|
|
1323
1327
|
var F = this._decoder.decodePushData(this._pushType.UNSUBSCRIBE, A.data);
|
|
1324
1328
|
this._handleUnsub(E, F);
|
|
1325
|
-
} else if (
|
|
1329
|
+
} else if (h === this._pushType.SUBSCRIBE) {
|
|
1326
1330
|
var X = this._decoder.decodePushData(this._pushType.UNSUBSCRIBE, A.data);
|
|
1327
1331
|
this._handleSub(E, X);
|
|
1328
1332
|
}
|
|
@@ -1387,14 +1391,14 @@ function Pr() {
|
|
|
1387
1391
|
}, {
|
|
1388
1392
|
key: "_registerCall",
|
|
1389
1393
|
value: function(s, a, A) {
|
|
1390
|
-
var
|
|
1394
|
+
var h = this;
|
|
1391
1395
|
this._callbacks[s] = {
|
|
1392
1396
|
callback: a,
|
|
1393
1397
|
errback: A,
|
|
1394
1398
|
timeout: null
|
|
1395
1399
|
}, this._callbacks[s].timeout = setTimeout(function() {
|
|
1396
|
-
delete
|
|
1397
|
-
error:
|
|
1400
|
+
delete h._callbacks[s], (0, b.isFunction)(A) && A({
|
|
1401
|
+
error: h._createErrorObject(J)
|
|
1398
1402
|
});
|
|
1399
1403
|
}, this._config.timeout);
|
|
1400
1404
|
}
|
|
@@ -1447,12 +1451,12 @@ function Pr() {
|
|
|
1447
1451
|
var a = this._privateChannels;
|
|
1448
1452
|
this._privateChannels = {};
|
|
1449
1453
|
var A = [];
|
|
1450
|
-
for (var
|
|
1451
|
-
if (a.hasOwnProperty(
|
|
1452
|
-
var E = this._getSub(
|
|
1454
|
+
for (var h in a)
|
|
1455
|
+
if (a.hasOwnProperty(h)) {
|
|
1456
|
+
var E = this._getSub(h);
|
|
1453
1457
|
if (!E)
|
|
1454
1458
|
continue;
|
|
1455
|
-
A.push(
|
|
1459
|
+
A.push(h);
|
|
1456
1460
|
}
|
|
1457
1461
|
if (A.length === 0) {
|
|
1458
1462
|
this._debug("no private channels found, no need to make request");
|
|
@@ -1537,14 +1541,14 @@ function Pr() {
|
|
|
1537
1541
|
}, {
|
|
1538
1542
|
key: "subscribe",
|
|
1539
1543
|
value: function(s, a, A) {
|
|
1540
|
-
var
|
|
1541
|
-
if (
|
|
1542
|
-
return
|
|
1544
|
+
var h = this._getSub(s);
|
|
1545
|
+
if (h !== null)
|
|
1546
|
+
return h._setEvents(a), h._isUnsubscribed() && h.subscribe(A), h;
|
|
1543
1547
|
var E = new y.default(this, s, a);
|
|
1544
1548
|
return this._subs[s] = E, E.subscribe(A), E;
|
|
1545
1549
|
}
|
|
1546
|
-
}]),
|
|
1547
|
-
})(
|
|
1550
|
+
}]), m;
|
|
1551
|
+
})(f.default);
|
|
1548
1552
|
u.Centrifuge = v;
|
|
1549
1553
|
})
|
|
1550
1554
|
),
|
|
@@ -1555,7 +1559,7 @@ function Pr() {
|
|
|
1555
1559
|
Object.defineProperty(u, "__esModule", {
|
|
1556
1560
|
value: !0
|
|
1557
1561
|
}), u.default = void 0;
|
|
1558
|
-
var
|
|
1562
|
+
var f = l(382), y = f.Centrifuge;
|
|
1559
1563
|
u.default = y, c.exports = u.default;
|
|
1560
1564
|
})
|
|
1561
1565
|
),
|
|
@@ -1570,16 +1574,16 @@ function Pr() {
|
|
|
1570
1574
|
if (!(Q instanceof S))
|
|
1571
1575
|
throw new TypeError("Cannot call a class as a function");
|
|
1572
1576
|
}
|
|
1573
|
-
function
|
|
1577
|
+
function f(Q, S) {
|
|
1574
1578
|
for (var P = 0; P < S.length; P++) {
|
|
1575
1579
|
var k = S[P];
|
|
1576
1580
|
k.enumerable = k.enumerable || !1, k.configurable = !0, "value" in k && (k.writable = !0), Object.defineProperty(Q, k.key, k);
|
|
1577
1581
|
}
|
|
1578
1582
|
}
|
|
1579
1583
|
function y(Q, S, P) {
|
|
1580
|
-
return S &&
|
|
1584
|
+
return S && f(Q.prototype, S), Q;
|
|
1581
1585
|
}
|
|
1582
|
-
var
|
|
1586
|
+
var C = {
|
|
1583
1587
|
CONNECT: 0,
|
|
1584
1588
|
SUBSCRIBE: 1,
|
|
1585
1589
|
UNSUBSCRIBE: 2,
|
|
@@ -1593,7 +1597,7 @@ function Pr() {
|
|
|
1593
1597
|
REFRESH: 10,
|
|
1594
1598
|
SUB_REFRESH: 11
|
|
1595
1599
|
};
|
|
1596
|
-
u.JsonMethodType =
|
|
1600
|
+
u.JsonMethodType = C;
|
|
1597
1601
|
var b = {
|
|
1598
1602
|
PUBLICATION: 0,
|
|
1599
1603
|
JOIN: 1,
|
|
@@ -1656,49 +1660,49 @@ function Pr() {
|
|
|
1656
1660
|
471: (
|
|
1657
1661
|
/***/
|
|
1658
1662
|
(function(c, u, l) {
|
|
1659
|
-
function
|
|
1663
|
+
function f(p) {
|
|
1660
1664
|
"@babel/helpers - typeof";
|
|
1661
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
1665
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? f = function(d) {
|
|
1662
1666
|
return typeof d;
|
|
1663
|
-
} :
|
|
1667
|
+
} : f = function(d) {
|
|
1664
1668
|
return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d;
|
|
1665
|
-
},
|
|
1669
|
+
}, f(p);
|
|
1666
1670
|
}
|
|
1667
1671
|
Object.defineProperty(u, "__esModule", {
|
|
1668
1672
|
value: !0
|
|
1669
1673
|
}), u.default = void 0;
|
|
1670
|
-
var y = b(l(187)),
|
|
1674
|
+
var y = b(l(187)), C = l(853);
|
|
1671
1675
|
function b(p) {
|
|
1672
1676
|
return p && p.__esModule ? p : { default: p };
|
|
1673
1677
|
}
|
|
1674
|
-
function I(p,
|
|
1675
|
-
if (!(p instanceof
|
|
1678
|
+
function I(p, m) {
|
|
1679
|
+
if (!(p instanceof m))
|
|
1676
1680
|
throw new TypeError("Cannot call a class as a function");
|
|
1677
1681
|
}
|
|
1678
|
-
function B(p,
|
|
1679
|
-
for (var d = 0; d <
|
|
1680
|
-
var s =
|
|
1682
|
+
function B(p, m) {
|
|
1683
|
+
for (var d = 0; d < m.length; d++) {
|
|
1684
|
+
var s = m[d];
|
|
1681
1685
|
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(p, s.key, s);
|
|
1682
1686
|
}
|
|
1683
1687
|
}
|
|
1684
|
-
function Q(p,
|
|
1685
|
-
return
|
|
1688
|
+
function Q(p, m, d) {
|
|
1689
|
+
return m && B(p.prototype, m), p;
|
|
1686
1690
|
}
|
|
1687
|
-
function S(p,
|
|
1688
|
-
if (typeof
|
|
1691
|
+
function S(p, m) {
|
|
1692
|
+
if (typeof m != "function" && m !== null)
|
|
1689
1693
|
throw new TypeError("Super expression must either be null or a function");
|
|
1690
|
-
p.prototype = Object.create(
|
|
1694
|
+
p.prototype = Object.create(m && m.prototype, { constructor: { value: p, writable: !0, configurable: !0 } }), m && P(p, m);
|
|
1691
1695
|
}
|
|
1692
|
-
function P(p,
|
|
1696
|
+
function P(p, m) {
|
|
1693
1697
|
return P = Object.setPrototypeOf || function(s, a) {
|
|
1694
1698
|
return s.__proto__ = a, s;
|
|
1695
|
-
}, P(p,
|
|
1699
|
+
}, P(p, m);
|
|
1696
1700
|
}
|
|
1697
1701
|
function k(p) {
|
|
1698
|
-
var
|
|
1702
|
+
var m = q();
|
|
1699
1703
|
return function() {
|
|
1700
1704
|
var s = D(p), a;
|
|
1701
|
-
if (
|
|
1705
|
+
if (m) {
|
|
1702
1706
|
var A = D(this).constructor;
|
|
1703
1707
|
a = Reflect.construct(s, arguments, A);
|
|
1704
1708
|
} else
|
|
@@ -1706,10 +1710,10 @@ function Pr() {
|
|
|
1706
1710
|
return R(this, a);
|
|
1707
1711
|
};
|
|
1708
1712
|
}
|
|
1709
|
-
function R(p,
|
|
1710
|
-
if (
|
|
1711
|
-
return
|
|
1712
|
-
if (
|
|
1713
|
+
function R(p, m) {
|
|
1714
|
+
if (m && (f(m) === "object" || typeof m == "function"))
|
|
1715
|
+
return m;
|
|
1716
|
+
if (m !== void 0)
|
|
1713
1717
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
1714
1718
|
return L(p);
|
|
1715
1719
|
}
|
|
@@ -1735,12 +1739,12 @@ function Pr() {
|
|
|
1735
1739
|
}
|
|
1736
1740
|
var G = 0, z = 1, J = 2, M = 3, v = 4, g = /* @__PURE__ */ (function(p) {
|
|
1737
1741
|
S(d, p);
|
|
1738
|
-
var
|
|
1742
|
+
var m = k(d);
|
|
1739
1743
|
function d(s, a, A) {
|
|
1740
|
-
var
|
|
1741
|
-
return I(this, d),
|
|
1744
|
+
var h;
|
|
1745
|
+
return I(this, d), h = m.call(this), h.channel = a, h._centrifuge = s, h._status = G, h._error = null, h._isResubscribe = !1, h._ready = !1, h._subscriptionPromise = null, h._noResubscribe = !1, h._recoverable = !1, h._recover = !1, h._setEvents(A), h._initializePromise(), h._promises = {}, h._promiseId = 0, h._subscribeData = null, h.on("error", function(E) {
|
|
1742
1746
|
this._centrifuge._debug("subscription error", E);
|
|
1743
|
-
}),
|
|
1747
|
+
}), h;
|
|
1744
1748
|
}
|
|
1745
1749
|
return Q(d, [{
|
|
1746
1750
|
key: "_nextPromiseId",
|
|
@@ -1751,11 +1755,11 @@ function Pr() {
|
|
|
1751
1755
|
key: "_initializePromise",
|
|
1752
1756
|
value: function() {
|
|
1753
1757
|
var a = this;
|
|
1754
|
-
this._ready = !1, this._subscriptionPromise = new Promise(function(A,
|
|
1758
|
+
this._ready = !1, this._subscriptionPromise = new Promise(function(A, h) {
|
|
1755
1759
|
a._resolve = function(E) {
|
|
1756
1760
|
a._ready = !0, A(E);
|
|
1757
1761
|
}, a._reject = function(E) {
|
|
1758
|
-
a._ready = !0,
|
|
1762
|
+
a._ready = !0, h(E);
|
|
1759
1763
|
};
|
|
1760
1764
|
}).then(function() {
|
|
1761
1765
|
}, function() {
|
|
@@ -1775,11 +1779,11 @@ function Pr() {
|
|
|
1775
1779
|
key: "_setEvents",
|
|
1776
1780
|
value: function(a) {
|
|
1777
1781
|
if (a) {
|
|
1778
|
-
if ((0,
|
|
1782
|
+
if ((0, C.isFunction)(a))
|
|
1779
1783
|
this.on("publish", a);
|
|
1780
1784
|
else if (Object.prototype.toString.call(a) === Object.prototype.toString.call({}))
|
|
1781
|
-
for (var A = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"],
|
|
1782
|
-
var _ = A[
|
|
1785
|
+
for (var A = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], h = 0, E = A.length; h < E; h++) {
|
|
1786
|
+
var _ = A[h];
|
|
1783
1787
|
_ in a && this.on(_, a[_]);
|
|
1784
1788
|
}
|
|
1785
1789
|
}
|
|
@@ -1831,8 +1835,8 @@ function Pr() {
|
|
|
1831
1835
|
this._status = J;
|
|
1832
1836
|
var A = this._getSubscribeSuccessContext(a);
|
|
1833
1837
|
this._recover = !1, this.emit("subscribe", A), this._resolve(A);
|
|
1834
|
-
for (var
|
|
1835
|
-
clearTimeout(this._promises[
|
|
1838
|
+
for (var h in this._promises)
|
|
1839
|
+
clearTimeout(this._promises[h].timeout), this._promises[h].resolve(), delete this._promises[h];
|
|
1836
1840
|
}
|
|
1837
1841
|
}
|
|
1838
1842
|
}, {
|
|
@@ -1842,8 +1846,8 @@ function Pr() {
|
|
|
1842
1846
|
this._status = M, this._error = a;
|
|
1843
1847
|
var A = this._getSubscribeErrorContext();
|
|
1844
1848
|
this.emit("error", A), this._reject(A);
|
|
1845
|
-
for (var
|
|
1846
|
-
clearTimeout(this._promises[
|
|
1849
|
+
for (var h in this._promises)
|
|
1850
|
+
clearTimeout(this._promises[h].timeout), this._promises[h].reject(a), delete this._promises[h];
|
|
1847
1851
|
}
|
|
1848
1852
|
}
|
|
1849
1853
|
}, {
|
|
@@ -1909,7 +1913,7 @@ function Pr() {
|
|
|
1909
1913
|
return Promise.resolve();
|
|
1910
1914
|
if (this._isError())
|
|
1911
1915
|
return Promise.reject(this._error);
|
|
1912
|
-
var A = new Promise(function(
|
|
1916
|
+
var A = new Promise(function(h, E) {
|
|
1913
1917
|
var _ = setTimeout(function() {
|
|
1914
1918
|
E({
|
|
1915
1919
|
code: 0,
|
|
@@ -1918,7 +1922,7 @@ function Pr() {
|
|
|
1918
1922
|
}, a._centrifuge._config.timeout);
|
|
1919
1923
|
a._promises[a._nextPromiseId()] = {
|
|
1920
1924
|
timeout: _,
|
|
1921
|
-
resolve:
|
|
1925
|
+
resolve: h,
|
|
1922
1926
|
reject: E
|
|
1923
1927
|
};
|
|
1924
1928
|
});
|
|
@@ -1967,14 +1971,14 @@ function Pr() {
|
|
|
1967
1971
|
(function(c, u, l) {
|
|
1968
1972
|
Object.defineProperty(u, "__esModule", {
|
|
1969
1973
|
value: !0
|
|
1970
|
-
}), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log =
|
|
1971
|
-
function
|
|
1974
|
+
}), u.backoff = b, u.errorExists = I, u.extend = B, u.isFunction = y, u.log = C, u.startsWith = f;
|
|
1975
|
+
function f(Q, S) {
|
|
1972
1976
|
return Q.lastIndexOf(S, 0) === 0;
|
|
1973
1977
|
}
|
|
1974
1978
|
function y(Q) {
|
|
1975
1979
|
return Q == null ? !1 : typeof Q == "function";
|
|
1976
1980
|
}
|
|
1977
|
-
function
|
|
1981
|
+
function C(Q, S) {
|
|
1978
1982
|
if (l.g.console) {
|
|
1979
1983
|
var P = l.g.console[Q];
|
|
1980
1984
|
y(P) && P.apply(l.g.console, S);
|
|
@@ -1998,18 +2002,18 @@ function Pr() {
|
|
|
1998
2002
|
187: (
|
|
1999
2003
|
/***/
|
|
2000
2004
|
(function(c) {
|
|
2001
|
-
var u = typeof Reflect == "object" ? Reflect : null, l = u && typeof u.apply == "function" ? u.apply : function(g, p,
|
|
2002
|
-
return Function.prototype.apply.call(g, p,
|
|
2003
|
-
},
|
|
2004
|
-
u && typeof u.ownKeys == "function" ?
|
|
2005
|
+
var u = typeof Reflect == "object" ? Reflect : null, l = u && typeof u.apply == "function" ? u.apply : function(g, p, m) {
|
|
2006
|
+
return Function.prototype.apply.call(g, p, m);
|
|
2007
|
+
}, f;
|
|
2008
|
+
u && typeof u.ownKeys == "function" ? f = u.ownKeys : Object.getOwnPropertySymbols ? f = function(g) {
|
|
2005
2009
|
return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g));
|
|
2006
|
-
} :
|
|
2010
|
+
} : f = function(g) {
|
|
2007
2011
|
return Object.getOwnPropertyNames(g);
|
|
2008
2012
|
};
|
|
2009
2013
|
function y(v) {
|
|
2010
2014
|
console && console.warn && console.warn(v);
|
|
2011
2015
|
}
|
|
2012
|
-
var
|
|
2016
|
+
var C = Number.isNaN || function(g) {
|
|
2013
2017
|
return g !== g;
|
|
2014
2018
|
};
|
|
2015
2019
|
function b() {
|
|
@@ -2027,14 +2031,14 @@ function Pr() {
|
|
|
2027
2031
|
return I;
|
|
2028
2032
|
},
|
|
2029
2033
|
set: function(v) {
|
|
2030
|
-
if (typeof v != "number" || v < 0 ||
|
|
2034
|
+
if (typeof v != "number" || v < 0 || C(v))
|
|
2031
2035
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + v + ".");
|
|
2032
2036
|
I = v;
|
|
2033
2037
|
}
|
|
2034
2038
|
}), b.init = function() {
|
|
2035
2039
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2036
2040
|
}, b.prototype.setMaxListeners = function(g) {
|
|
2037
|
-
if (typeof g != "number" || g < 0 ||
|
|
2041
|
+
if (typeof g != "number" || g < 0 || C(g))
|
|
2038
2042
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + g + ".");
|
|
2039
2043
|
return this._maxListeners = g, this;
|
|
2040
2044
|
};
|
|
@@ -2044,7 +2048,7 @@ function Pr() {
|
|
|
2044
2048
|
b.prototype.getMaxListeners = function() {
|
|
2045
2049
|
return Q(this);
|
|
2046
2050
|
}, b.prototype.emit = function(g) {
|
|
2047
|
-
for (var p = [],
|
|
2051
|
+
for (var p = [], m = 1; m < arguments.length; m++) p.push(arguments[m]);
|
|
2048
2052
|
var d = g === "error", s = this._events;
|
|
2049
2053
|
if (s !== void 0)
|
|
2050
2054
|
d = d && s.error === void 0;
|
|
@@ -2057,17 +2061,17 @@ function Pr() {
|
|
|
2057
2061
|
var A = new Error("Unhandled error." + (a ? " (" + a.message + ")" : ""));
|
|
2058
2062
|
throw A.context = a, A;
|
|
2059
2063
|
}
|
|
2060
|
-
var
|
|
2061
|
-
if (
|
|
2064
|
+
var h = s[g];
|
|
2065
|
+
if (h === void 0)
|
|
2062
2066
|
return !1;
|
|
2063
|
-
if (typeof
|
|
2064
|
-
l(
|
|
2067
|
+
if (typeof h == "function")
|
|
2068
|
+
l(h, this, p);
|
|
2065
2069
|
else
|
|
2066
|
-
for (var E =
|
|
2067
|
-
l(_[
|
|
2070
|
+
for (var E = h.length, _ = q(h, E), m = 0; m < E; ++m)
|
|
2071
|
+
l(_[m], this, p);
|
|
2068
2072
|
return !0;
|
|
2069
2073
|
};
|
|
2070
|
-
function S(v, g, p,
|
|
2074
|
+
function S(v, g, p, m) {
|
|
2071
2075
|
var d, s, a;
|
|
2072
2076
|
if (B(p), s = v._events, s === void 0 ? (s = v._events = /* @__PURE__ */ Object.create(null), v._eventsCount = 0) : (s.newListener !== void 0 && (v.emit(
|
|
2073
2077
|
"newListener",
|
|
@@ -2075,7 +2079,7 @@ function Pr() {
|
|
|
2075
2079
|
p.listener ? p.listener : p
|
|
2076
2080
|
), s = v._events), a = s[g]), a === void 0)
|
|
2077
2081
|
a = s[g] = p, ++v._eventsCount;
|
|
2078
|
-
else if (typeof a == "function" ? a = s[g] =
|
|
2082
|
+
else if (typeof a == "function" ? a = s[g] = m ? [p, a] : [a, p] : m ? a.unshift(p) : a.push(p), d = Q(v), d > 0 && a.length > d && !a.warned) {
|
|
2079
2083
|
a.warned = !0;
|
|
2080
2084
|
var A = new Error("Possible EventEmitter memory leak detected. " + a.length + " " + String(g) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2081
2085
|
A.name = "MaxListenersExceededWarning", A.emitter = v, A.type = g, A.count = a.length, y(A);
|
|
@@ -2092,45 +2096,45 @@ function Pr() {
|
|
|
2092
2096
|
return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
2093
2097
|
}
|
|
2094
2098
|
function k(v, g, p) {
|
|
2095
|
-
var
|
|
2096
|
-
return d.listener = p,
|
|
2099
|
+
var m = { fired: !1, wrapFn: void 0, target: v, type: g, listener: p }, d = P.bind(m);
|
|
2100
|
+
return d.listener = p, m.wrapFn = d, d;
|
|
2097
2101
|
}
|
|
2098
2102
|
b.prototype.once = function(g, p) {
|
|
2099
2103
|
return B(p), this.on(g, k(this, g, p)), this;
|
|
2100
2104
|
}, b.prototype.prependOnceListener = function(g, p) {
|
|
2101
2105
|
return B(p), this.prependListener(g, k(this, g, p)), this;
|
|
2102
2106
|
}, b.prototype.removeListener = function(g, p) {
|
|
2103
|
-
var
|
|
2107
|
+
var m, d, s, a, A;
|
|
2104
2108
|
if (B(p), d = this._events, d === void 0)
|
|
2105
2109
|
return this;
|
|
2106
|
-
if (
|
|
2110
|
+
if (m = d[g], m === void 0)
|
|
2107
2111
|
return this;
|
|
2108
|
-
if (
|
|
2109
|
-
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete d[g], d.removeListener && this.emit("removeListener", g,
|
|
2110
|
-
else if (typeof
|
|
2111
|
-
for (s = -1, a =
|
|
2112
|
-
if (
|
|
2113
|
-
A =
|
|
2112
|
+
if (m === p || m.listener === p)
|
|
2113
|
+
--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete d[g], d.removeListener && this.emit("removeListener", g, m.listener || p));
|
|
2114
|
+
else if (typeof m != "function") {
|
|
2115
|
+
for (s = -1, a = m.length - 1; a >= 0; a--)
|
|
2116
|
+
if (m[a] === p || m[a].listener === p) {
|
|
2117
|
+
A = m[a].listener, s = a;
|
|
2114
2118
|
break;
|
|
2115
2119
|
}
|
|
2116
2120
|
if (s < 0)
|
|
2117
2121
|
return this;
|
|
2118
|
-
s === 0 ?
|
|
2122
|
+
s === 0 ? m.shift() : D(m, s), m.length === 1 && (d[g] = m[0]), d.removeListener !== void 0 && this.emit("removeListener", g, A || p);
|
|
2119
2123
|
}
|
|
2120
2124
|
return this;
|
|
2121
2125
|
}, b.prototype.off = b.prototype.removeListener, b.prototype.removeAllListeners = function(g) {
|
|
2122
|
-
var p,
|
|
2123
|
-
if (
|
|
2126
|
+
var p, m, d;
|
|
2127
|
+
if (m = this._events, m === void 0)
|
|
2124
2128
|
return this;
|
|
2125
|
-
if (
|
|
2126
|
-
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) :
|
|
2129
|
+
if (m.removeListener === void 0)
|
|
2130
|
+
return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : m[g] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete m[g]), this;
|
|
2127
2131
|
if (arguments.length === 0) {
|
|
2128
|
-
var s = Object.keys(
|
|
2132
|
+
var s = Object.keys(m), a;
|
|
2129
2133
|
for (d = 0; d < s.length; ++d)
|
|
2130
2134
|
a = s[d], a !== "removeListener" && this.removeAllListeners(a);
|
|
2131
2135
|
return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
|
|
2132
2136
|
}
|
|
2133
|
-
if (p =
|
|
2137
|
+
if (p = m[g], typeof p == "function")
|
|
2134
2138
|
this.removeListener(g, p);
|
|
2135
2139
|
else if (p !== void 0)
|
|
2136
2140
|
for (d = p.length - 1; d >= 0; d--)
|
|
@@ -2138,10 +2142,10 @@ function Pr() {
|
|
|
2138
2142
|
return this;
|
|
2139
2143
|
};
|
|
2140
2144
|
function R(v, g, p) {
|
|
2141
|
-
var
|
|
2142
|
-
if (
|
|
2145
|
+
var m = v._events;
|
|
2146
|
+
if (m === void 0)
|
|
2143
2147
|
return [];
|
|
2144
|
-
var d =
|
|
2148
|
+
var d = m[g];
|
|
2145
2149
|
return d === void 0 ? [] : typeof d == "function" ? p ? [d.listener || d] : [d] : p ? G(d) : q(d, d.length);
|
|
2146
2150
|
}
|
|
2147
2151
|
b.prototype.listeners = function(g) {
|
|
@@ -2163,11 +2167,11 @@ function Pr() {
|
|
|
2163
2167
|
return 0;
|
|
2164
2168
|
}
|
|
2165
2169
|
b.prototype.eventNames = function() {
|
|
2166
|
-
return this._eventsCount > 0 ?
|
|
2170
|
+
return this._eventsCount > 0 ? f(this._events) : [];
|
|
2167
2171
|
};
|
|
2168
2172
|
function q(v, g) {
|
|
2169
|
-
for (var p = new Array(g),
|
|
2170
|
-
p[
|
|
2173
|
+
for (var p = new Array(g), m = 0; m < g; ++m)
|
|
2174
|
+
p[m] = v[m];
|
|
2171
2175
|
return p;
|
|
2172
2176
|
}
|
|
2173
2177
|
function D(v, g) {
|
|
@@ -2181,9 +2185,9 @@ function Pr() {
|
|
|
2181
2185
|
return g;
|
|
2182
2186
|
}
|
|
2183
2187
|
function z(v, g) {
|
|
2184
|
-
return new Promise(function(p,
|
|
2188
|
+
return new Promise(function(p, m) {
|
|
2185
2189
|
function d(a) {
|
|
2186
|
-
v.removeListener(g, s),
|
|
2190
|
+
v.removeListener(g, s), m(a);
|
|
2187
2191
|
}
|
|
2188
2192
|
function s() {
|
|
2189
2193
|
typeof v.removeListener == "function" && v.removeListener("error", d), p([].slice.call(arguments));
|
|
@@ -2194,12 +2198,12 @@ function Pr() {
|
|
|
2194
2198
|
function J(v, g, p) {
|
|
2195
2199
|
typeof v.on == "function" && M(v, "error", g, p);
|
|
2196
2200
|
}
|
|
2197
|
-
function M(v, g, p,
|
|
2201
|
+
function M(v, g, p, m) {
|
|
2198
2202
|
if (typeof v.on == "function")
|
|
2199
|
-
|
|
2203
|
+
m.once ? v.once(g, p) : v.on(g, p);
|
|
2200
2204
|
else if (typeof v.addEventListener == "function")
|
|
2201
2205
|
v.addEventListener(g, function d(s) {
|
|
2202
|
-
|
|
2206
|
+
m.once && v.removeEventListener(g, d), p(s);
|
|
2203
2207
|
});
|
|
2204
2208
|
else
|
|
2205
2209
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof v);
|
|
@@ -2262,8 +2266,8 @@ function $t(e, t) {
|
|
|
2262
2266
|
const u = i.subscribe(o);
|
|
2263
2267
|
u.on("publish", (l) => {
|
|
2264
2268
|
console.log("[Centrifuge] Publish event received:", l);
|
|
2265
|
-
const
|
|
2266
|
-
|
|
2269
|
+
const f = Lr(l);
|
|
2270
|
+
f && t(f);
|
|
2267
2271
|
}), u.on("subscribe", (l) => {
|
|
2268
2272
|
console.log("[Centrifuge] ✅ Channel subscribed successfully:", o, l);
|
|
2269
2273
|
}), u.on("error", (l) => {
|
|
@@ -2319,8 +2323,8 @@ function Rr(e) {
|
|
|
2319
2323
|
}
|
|
2320
2324
|
function Or(e, t, n = {}) {
|
|
2321
2325
|
var S, P, k, R;
|
|
2322
|
-
const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((R = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : R.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card),
|
|
2323
|
-
return o != null && o.isKaspiOnly && u && !I ? [Ae] : b ? o != null && o.isAvailable && u && !I ? [Ae] : [] : (ee(c.payment_method_apple_pay) && !Ke("apple_pay") && (qe() &&
|
|
2326
|
+
const r = [], o = (S = e == null ? void 0 : e.kaspi) == null ? void 0 : S.data, i = ((P = e == null ? void 0 : e.cards_v2) == null ? void 0 : P.data) || [], c = ((R = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : R.attributes) || {}, u = ee(c.payment_method_kaspi), l = ee(c.payment_method_card), f = typeof window < "u" && window.self === window.top, C = Lt() === "ios", b = !!(n != null && n.onlyKaspiAvailable), I = !!(n != null && n.disableKaspi);
|
|
2327
|
+
return o != null && o.isKaspiOnly && u && !I ? [Ae] : b ? o != null && o.isAvailable && u && !I ? [Ae] : [] : (ee(c.payment_method_apple_pay) && !Ke("apple_pay") && (qe() && f || ze() || C || Dn() === 16) && r.push(Mn), o != null && o.isAvailable && u && !I && r.push(Ae), l && i.filter((L) => !L.isExpired).forEach((L) => {
|
|
2324
2328
|
r.push({
|
|
2325
2329
|
iconType: Xe(L.attributes.mask),
|
|
2326
2330
|
type: "card",
|
|
@@ -2337,13 +2341,13 @@ function Or(e, t, n = {}) {
|
|
|
2337
2341
|
}
|
|
2338
2342
|
function mt(e, t = {}) {
|
|
2339
2343
|
var Q, S, P, k;
|
|
2340
|
-
const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Lt() === "ios",
|
|
2344
|
+
const n = (Q = e == null ? void 0 : e.kaspi) == null ? void 0 : Q.data, r = ((S = e == null ? void 0 : e.cards_v2) == null ? void 0 : S.data) || [], o = ((k = (P = e == null ? void 0 : e.payment_methods) == null ? void 0 : P.data) == null ? void 0 : k.attributes) || {}, i = ee(o.payment_method_kaspi), c = ee(o.payment_method_card), u = !!(t != null && t.disableKaspi), l = typeof window < "u" && window.self === window.top, y = Lt() === "ios", C = ee(o.payment_method_apple_pay) && !Ke("apple_pay") && (qe() && l || ze() || y || Dn() === 16), b = ee(o.payment_method_google_pay) && !Ke("google_pay") && !(t != null && t.disableGooglePay) && !qe() && !ze();
|
|
2341
2345
|
if (n != null && n.isKaspiOnly && i && !u || t != null && t.onlyKaspiAvailable && (n != null && n.isAvailable) && i && !u)
|
|
2342
2346
|
return Ae;
|
|
2343
2347
|
const I = Rr(e);
|
|
2344
2348
|
if ((I == null ? void 0 : I.type) === "kaspi_pay" && (n != null && n.isAvailable) && i && !u)
|
|
2345
2349
|
return Ae;
|
|
2346
|
-
if ((I == null ? void 0 : I.type) === "apple_pay" &&
|
|
2350
|
+
if ((I == null ? void 0 : I.type) === "apple_pay" && C) return Mn;
|
|
2347
2351
|
if ((I == null ? void 0 : I.type) === "google_pay" && b) return xn;
|
|
2348
2352
|
if ((I == null ? void 0 : I.type) === "new_card" && ee(o.payment_method_new_card))
|
|
2349
2353
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
@@ -2457,7 +2461,7 @@ async function tt(e, t, n, r, o) {
|
|
|
2457
2461
|
return i.ok || await ue(i, o), i.json();
|
|
2458
2462
|
}
|
|
2459
2463
|
async function tn(e, t, n) {
|
|
2460
|
-
var u, l,
|
|
2464
|
+
var u, l, f, y;
|
|
2461
2465
|
const r = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2462
2466
|
method: "POST",
|
|
2463
2467
|
headers: {
|
|
@@ -2472,12 +2476,12 @@ async function tn(e, t, n) {
|
|
|
2472
2476
|
})
|
|
2473
2477
|
});
|
|
2474
2478
|
r.ok || await ue(r, "Не удалось авторизоваться через track_id");
|
|
2475
|
-
const o = await r.json(), i = (o == null ? void 0 : o.access_token) ?? ((l = (u = o == null ? void 0 : o.data) == null ? void 0 : u.attributes) == null ? void 0 : l.access_token), c = (o == null ? void 0 : o.refresh_token) ?? ((y = (
|
|
2479
|
+
const o = await r.json(), i = (o == null ? void 0 : o.access_token) ?? ((l = (u = o == null ? void 0 : o.data) == null ? void 0 : u.attributes) == null ? void 0 : l.access_token), c = (o == null ? void 0 : o.refresh_token) ?? ((y = (f = o == null ? void 0 : o.data) == null ? void 0 : f.attributes) == null ? void 0 : y.refresh_token) ?? null;
|
|
2476
2480
|
if (!i) throw new Error("В ответе отсутствует access_token");
|
|
2477
2481
|
return { access_token: i, refresh_token: c };
|
|
2478
2482
|
}
|
|
2479
2483
|
async function Dr(e, t, n) {
|
|
2480
|
-
var u, l,
|
|
2484
|
+
var u, l, f, y;
|
|
2481
2485
|
const r = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2482
2486
|
method: "POST",
|
|
2483
2487
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2488,7 +2492,7 @@ async function Dr(e, t, n) {
|
|
|
2488
2492
|
})
|
|
2489
2493
|
});
|
|
2490
2494
|
r.ok || await ue(r, "Не удалось обновить токен по refresh_token");
|
|
2491
|
-
const o = await r.json(), i = (o == null ? void 0 : o.access_token) ?? ((l = (u = o == null ? void 0 : o.data) == null ? void 0 : u.attributes) == null ? void 0 : l.access_token), c = (o == null ? void 0 : o.refresh_token) ?? ((y = (
|
|
2495
|
+
const o = await r.json(), i = (o == null ? void 0 : o.access_token) ?? ((l = (u = o == null ? void 0 : o.data) == null ? void 0 : u.attributes) == null ? void 0 : l.access_token), c = (o == null ? void 0 : o.refresh_token) ?? ((y = (f = o == null ? void 0 : o.data) == null ? void 0 : f.attributes) == null ? void 0 : y.refresh_token) ?? null;
|
|
2492
2496
|
if (!i) throw new Error("В ответе отсутствует access_token");
|
|
2493
2497
|
return { access_token: i, refresh_token: c };
|
|
2494
2498
|
}
|
|
@@ -2743,12 +2747,12 @@ function zr(...e) {
|
|
|
2743
2747
|
const l = c[u];
|
|
2744
2748
|
if (l.length > 1024)
|
|
2745
2749
|
continue;
|
|
2746
|
-
const
|
|
2747
|
-
if (!
|
|
2750
|
+
const f = an.test(l) ? l.replace(an, "$1") : l;
|
|
2751
|
+
if (!f.match(/\S*Error: /)) {
|
|
2748
2752
|
for (const y of t) {
|
|
2749
|
-
const
|
|
2750
|
-
if (
|
|
2751
|
-
i.push(
|
|
2753
|
+
const C = y(f);
|
|
2754
|
+
if (C) {
|
|
2755
|
+
i.push(C);
|
|
2752
2756
|
break;
|
|
2753
2757
|
}
|
|
2754
2758
|
}
|
|
@@ -2854,10 +2858,10 @@ function no(e, t = {}) {
|
|
|
2854
2858
|
const r = 5, o = [];
|
|
2855
2859
|
let i = 0, c = 0;
|
|
2856
2860
|
const u = " > ", l = u.length;
|
|
2857
|
-
let
|
|
2858
|
-
const y = Array.isArray(t) ? t : t.keyAttrs,
|
|
2859
|
-
for (; n && i++ < r && (
|
|
2860
|
-
o.push(
|
|
2861
|
+
let f;
|
|
2862
|
+
const y = Array.isArray(t) ? t : t.keyAttrs, C = !Array.isArray(t) && t.maxStringLength || to;
|
|
2863
|
+
for (; n && i++ < r && (f = ro(n, y), !(f === "html" || i > 1 && c + o.length * l + f.length >= C)); )
|
|
2864
|
+
o.push(f), c += f.length, n = n.parentNode;
|
|
2861
2865
|
return o.reverse().join(u);
|
|
2862
2866
|
} catch {
|
|
2863
2867
|
return "<unknown>";
|
|
@@ -3011,8 +3015,8 @@ const Wn = io();
|
|
|
3011
3015
|
const { performance: e } = j;
|
|
3012
3016
|
if (!e || !e.now)
|
|
3013
3017
|
return;
|
|
3014
|
-
const t = 3600 * 1e3, n = e.now(), r = Date.now(), o = e.timeOrigin ? Math.abs(e.timeOrigin + n - r) : t, i = o < t, c = e.timing && e.timing.navigationStart, l = typeof c == "number" ? Math.abs(c + n - r) : t,
|
|
3015
|
-
return i ||
|
|
3018
|
+
const t = 3600 * 1e3, n = e.now(), r = Date.now(), o = e.timeOrigin ? Math.abs(e.timeOrigin + n - r) : t, i = o < t, c = e.timing && e.timing.navigationStart, l = typeof c == "number" ? Math.abs(c + n - r) : t, f = l < t;
|
|
3019
|
+
return i || f ? o <= l ? e.timeOrigin : c : r;
|
|
3016
3020
|
})();
|
|
3017
3021
|
function te() {
|
|
3018
3022
|
const e = j, t = e.crypto || e.msCrypto;
|
|
@@ -3410,8 +3414,8 @@ class Mt {
|
|
|
3410
3414
|
const n = typeof t == "function" ? t(this) : t, [r, o] = n instanceof ce ? (
|
|
3411
3415
|
// eslint-disable-next-line deprecation/deprecation
|
|
3412
3416
|
[n.getScopeData(), n.getRequestSession()]
|
|
3413
|
-
) : be(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level:
|
|
3414
|
-
return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u),
|
|
3417
|
+
) : be(n) ? [t, t.requestSession] : [], { tags: i, extra: c, user: u, contexts: l, level: f, fingerprint: y = [], propagationContext: C } = r || {};
|
|
3418
|
+
return this._tags = { ...this._tags, ...i }, this._extra = { ...this._extra, ...c }, this._contexts = { ...this._contexts, ...l }, u && Object.keys(u).length && (this._user = u), f && (this._level = f), y.length && (this._fingerprint = y), C && (this._propagationContext = C), o && (this._requestSession = o), this;
|
|
3415
3419
|
}
|
|
3416
3420
|
/**
|
|
3417
3421
|
* @inheritDoc
|
|
@@ -3813,10 +3817,10 @@ function jo(e) {
|
|
|
3813
3817
|
const o = n.spanContext().traceState, i = o && o.get("sentry.dsc"), c = i && wo(i);
|
|
3814
3818
|
if (c)
|
|
3815
3819
|
return c;
|
|
3816
|
-
const u = er(e.spanContext().traceId, t), l = Ut(n),
|
|
3820
|
+
const u = er(e.spanContext().traceId, t), l = Ut(n), f = l.data || {}, y = f[Io];
|
|
3817
3821
|
y != null && (u.sample_rate = `${y}`);
|
|
3818
|
-
const
|
|
3819
|
-
return
|
|
3822
|
+
const C = f[vo], b = l.description;
|
|
3823
|
+
return C !== "url" && b && (u.transaction = b), Fo() && (u.sampled = String(Do(n))), t.emit("createDsc", u, n), u;
|
|
3820
3824
|
}
|
|
3821
3825
|
function Jo(e) {
|
|
3822
3826
|
if (typeof e == "boolean")
|
|
@@ -3849,13 +3853,13 @@ function Ko(e) {
|
|
|
3849
3853
|
return;
|
|
3850
3854
|
}
|
|
3851
3855
|
const [n, r, o = "", i = "", c = "", u = ""] = t.slice(1);
|
|
3852
|
-
let l = "",
|
|
3853
|
-
const y =
|
|
3854
|
-
if (y.length > 1 && (l = y.slice(0, -1).join("/"),
|
|
3855
|
-
const
|
|
3856
|
-
|
|
3856
|
+
let l = "", f = u;
|
|
3857
|
+
const y = f.split("/");
|
|
3858
|
+
if (y.length > 1 && (l = y.slice(0, -1).join("/"), f = y.pop()), f) {
|
|
3859
|
+
const C = f.match(/^\d+/);
|
|
3860
|
+
C && (f = C[0]);
|
|
3857
3861
|
}
|
|
3858
|
-
return tr({ host: i, pass: o, path: l, projectId:
|
|
3862
|
+
return tr({ host: i, pass: o, path: l, projectId: f, port: c, protocol: n, publicKey: r });
|
|
3859
3863
|
}
|
|
3860
3864
|
function tr(e) {
|
|
3861
3865
|
return {
|
|
@@ -3927,25 +3931,25 @@ function St(e, t, n = 1 / 0, r = 1 / 0, o = Yo()) {
|
|
|
3927
3931
|
return u.replace("object ", "");
|
|
3928
3932
|
if (i(t))
|
|
3929
3933
|
return "[Circular ~]";
|
|
3930
|
-
const
|
|
3931
|
-
if (
|
|
3934
|
+
const f = t;
|
|
3935
|
+
if (f && typeof f.toJSON == "function")
|
|
3932
3936
|
try {
|
|
3933
|
-
const I =
|
|
3937
|
+
const I = f.toJSON();
|
|
3934
3938
|
return St("", I, l - 1, r, o);
|
|
3935
3939
|
} catch {
|
|
3936
3940
|
}
|
|
3937
3941
|
const y = Array.isArray(t) ? [] : {};
|
|
3938
|
-
let
|
|
3942
|
+
let C = 0;
|
|
3939
3943
|
const b = Kn(t);
|
|
3940
3944
|
for (const I in b) {
|
|
3941
3945
|
if (!Object.prototype.hasOwnProperty.call(b, I))
|
|
3942
3946
|
continue;
|
|
3943
|
-
if (
|
|
3947
|
+
if (C >= r) {
|
|
3944
3948
|
y[I] = "[MaxProperties ~]";
|
|
3945
3949
|
break;
|
|
3946
3950
|
}
|
|
3947
3951
|
const B = b[I];
|
|
3948
|
-
y[I] = St(I, B, l - 1, r, o),
|
|
3952
|
+
y[I] = St(I, B, l - 1, r, o), C++;
|
|
3949
3953
|
}
|
|
3950
3954
|
return c(t), y;
|
|
3951
3955
|
}
|
|
@@ -4133,9 +4137,9 @@ function ls(e) {
|
|
|
4133
4137
|
else {
|
|
4134
4138
|
const c = e(o);
|
|
4135
4139
|
for (let u = c.length - 1; u >= 0; u--) {
|
|
4136
|
-
const l = c[u],
|
|
4137
|
-
if (
|
|
4138
|
-
r[
|
|
4140
|
+
const l = c[u], f = l && l.filename, y = t[o];
|
|
4141
|
+
if (f && y) {
|
|
4142
|
+
r[f] = y, Ne[o] = [f, y];
|
|
4139
4143
|
break;
|
|
4140
4144
|
}
|
|
4141
4145
|
}
|
|
@@ -4156,14 +4160,14 @@ function Sn(e, t) {
|
|
|
4156
4160
|
level: c,
|
|
4157
4161
|
sdkProcessingMetadata: u,
|
|
4158
4162
|
breadcrumbs: l,
|
|
4159
|
-
fingerprint:
|
|
4163
|
+
fingerprint: f,
|
|
4160
4164
|
eventProcessors: y,
|
|
4161
|
-
attachments:
|
|
4165
|
+
attachments: C,
|
|
4162
4166
|
propagationContext: b,
|
|
4163
4167
|
transactionName: I,
|
|
4164
4168
|
span: B
|
|
4165
4169
|
} = t;
|
|
4166
|
-
Me(e, "extra", n), Me(e, "tags", r), Me(e, "user", o), Me(e, "contexts", i), e.sdkProcessingMetadata = ct(e.sdkProcessingMetadata, u, 2), c && (e.level = c), I && (e.transactionName = I), B && (e.span = B), l.length && (e.breadcrumbs = [...e.breadcrumbs, ...l]),
|
|
4170
|
+
Me(e, "extra", n), Me(e, "tags", r), Me(e, "user", o), Me(e, "contexts", i), e.sdkProcessingMetadata = ct(e.sdkProcessingMetadata, u, 2), c && (e.level = c), I && (e.transactionName = I), B && (e.span = B), l.length && (e.breadcrumbs = [...e.breadcrumbs, ...l]), f.length && (e.fingerprint = [...e.fingerprint, ...f]), y.length && (e.eventProcessors = [...e.eventProcessors, ...y]), C.length && (e.attachments = [...e.attachments, ...C]), e.propagationContext = { ...e.propagationContext, ...b };
|
|
4167
4171
|
}
|
|
4168
4172
|
function Me(e, t, n) {
|
|
4169
4173
|
e[t] = ct(e[t], n, 1);
|
|
@@ -4171,12 +4175,12 @@ function Me(e, t, n) {
|
|
|
4171
4175
|
function ds(e, t) {
|
|
4172
4176
|
const { extra: n, tags: r, user: o, contexts: i, level: c, transactionName: u } = t, l = V(n);
|
|
4173
4177
|
l && Object.keys(l).length && (e.extra = { ...l, ...e.extra });
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4178
|
+
const f = V(r);
|
|
4179
|
+
f && Object.keys(f).length && (e.tags = { ...f, ...e.tags });
|
|
4176
4180
|
const y = V(o);
|
|
4177
4181
|
y && Object.keys(y).length && (e.user = { ...y, ...e.user });
|
|
4178
|
-
const
|
|
4179
|
-
|
|
4182
|
+
const C = V(i);
|
|
4183
|
+
C && Object.keys(C).length && (e.contexts = { ...C, ...e.contexts }), c && (e.level = c), u && e.type !== "transaction" && (e.transaction = u);
|
|
4180
4184
|
}
|
|
4181
4185
|
function fs(e, t) {
|
|
4182
4186
|
const n = [...e.breadcrumbs || [], ...t];
|
|
@@ -4207,11 +4211,11 @@ function ys(e, t, n, r, o, i) {
|
|
|
4207
4211
|
...t,
|
|
4208
4212
|
event_id: t.event_id || n.event_id || te(),
|
|
4209
4213
|
timestamp: t.timestamp || at()
|
|
4210
|
-
},
|
|
4211
|
-
ms(l, e), Es(l,
|
|
4214
|
+
}, f = n.integrations || e.integrations.map((S) => S.name);
|
|
4215
|
+
ms(l, e), Es(l, f), o && o.emit("applyFrameMetadata", t), t.type === void 0 && Cs(l, e.stackParser);
|
|
4212
4216
|
const y = Is(r, n.captureContext);
|
|
4213
4217
|
n.mechanism && _e(l, n.mechanism);
|
|
4214
|
-
const
|
|
4218
|
+
const C = o ? o.getEventProcessors() : [], b = mo().getScopeData();
|
|
4215
4219
|
if (i) {
|
|
4216
4220
|
const S = i.getScopeData();
|
|
4217
4221
|
Sn(b, S);
|
|
@@ -4223,7 +4227,7 @@ function ys(e, t, n, r, o, i) {
|
|
|
4223
4227
|
const I = [...n.attachments || [], ...b.attachments];
|
|
4224
4228
|
I.length && (n.attachments = I), As(l, b);
|
|
4225
4229
|
const B = [
|
|
4226
|
-
...
|
|
4230
|
+
...C,
|
|
4227
4231
|
// Run scope event processors _after_ all other processors
|
|
4228
4232
|
...b.eventProcessors
|
|
4229
4233
|
];
|
|
@@ -4583,8 +4587,8 @@ class Ts {
|
|
|
4583
4587
|
if (i) {
|
|
4584
4588
|
o = !0;
|
|
4585
4589
|
for (const l of i) {
|
|
4586
|
-
const
|
|
4587
|
-
if (
|
|
4590
|
+
const f = l.mechanism;
|
|
4591
|
+
if (f && f.handled === !1) {
|
|
4588
4592
|
r = !0;
|
|
4589
4593
|
break;
|
|
4590
4594
|
}
|
|
@@ -4676,7 +4680,7 @@ class Ts {
|
|
|
4676
4680
|
* @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
|
|
4677
4681
|
*/
|
|
4678
4682
|
_processEvent(t, n, r) {
|
|
4679
|
-
const o = this.getOptions(), { sampleRate: i } = o, c = ir(t), u = sr(t), l = t.type || "error",
|
|
4683
|
+
const o = this.getOptions(), { sampleRate: i } = o, c = ir(t), u = sr(t), l = t.type || "error", f = `before send for type \`${l}\``, y = typeof i > "u" ? void 0 : Jo(i);
|
|
4680
4684
|
if (u && typeof y == "number" && Math.random() > y)
|
|
4681
4685
|
return this.recordDroppedEvent("sample_rate", "error", t), We(
|
|
4682
4686
|
new Y(
|
|
@@ -4684,21 +4688,21 @@ class Ts {
|
|
|
4684
4688
|
"log"
|
|
4685
4689
|
)
|
|
4686
4690
|
);
|
|
4687
|
-
const
|
|
4691
|
+
const C = l === "replay_event" ? "replay" : l, I = (t.sdkProcessingMetadata || {}).capturedSpanIsolationScope;
|
|
4688
4692
|
return this._prepareEvent(t, n, r, I).then((B) => {
|
|
4689
4693
|
if (B === null)
|
|
4690
|
-
throw this.recordDroppedEvent("event_processor",
|
|
4694
|
+
throw this.recordDroppedEvent("event_processor", C, t), new Y("An event processor returned `null`, will not send event.", "log");
|
|
4691
4695
|
if (n.data && n.data.__sentry__ === !0)
|
|
4692
4696
|
return B;
|
|
4693
4697
|
const S = Rs(this, o, B, n);
|
|
4694
|
-
return Ls(S,
|
|
4698
|
+
return Ls(S, f);
|
|
4695
4699
|
}).then((B) => {
|
|
4696
4700
|
if (B === null) {
|
|
4697
|
-
if (this.recordDroppedEvent("before_send",
|
|
4701
|
+
if (this.recordDroppedEvent("before_send", C, t), c) {
|
|
4698
4702
|
const k = 1 + (t.spans || []).length;
|
|
4699
4703
|
this.recordDroppedEvent("before_send", "span", k);
|
|
4700
4704
|
}
|
|
4701
|
-
throw new Y(`${
|
|
4705
|
+
throw new Y(`${f} returned \`null\`, will not send event.`, "log");
|
|
4702
4706
|
}
|
|
4703
4707
|
const Q = r && r.getSession();
|
|
4704
4708
|
if (!c && Q && this._updateSessionFromEvent(Q, B), c) {
|
|
@@ -4796,8 +4800,8 @@ function Rs(e, t, n, r) {
|
|
|
4796
4800
|
if (n.spans && c) {
|
|
4797
4801
|
const u = [];
|
|
4798
4802
|
for (const l of n.spans) {
|
|
4799
|
-
const
|
|
4800
|
-
|
|
4803
|
+
const f = c(l);
|
|
4804
|
+
f ? u.push(f) : (Uo(), e.recordDroppedEvent("before_send", "span"));
|
|
4801
4805
|
}
|
|
4802
4806
|
n.spans = u;
|
|
4803
4807
|
}
|
|
@@ -4840,15 +4844,15 @@ function Os(e) {
|
|
|
4840
4844
|
}
|
|
4841
4845
|
function i(c) {
|
|
4842
4846
|
return new W((u, l) => {
|
|
4843
|
-
let
|
|
4844
|
-
if (!
|
|
4847
|
+
let f = t.length;
|
|
4848
|
+
if (!f)
|
|
4845
4849
|
return u(!0);
|
|
4846
4850
|
const y = setTimeout(() => {
|
|
4847
4851
|
c && c > 0 && u(!1);
|
|
4848
4852
|
}, c);
|
|
4849
|
-
t.forEach((
|
|
4850
|
-
he(
|
|
4851
|
-
--
|
|
4853
|
+
t.forEach((C) => {
|
|
4854
|
+
he(C).then(() => {
|
|
4855
|
+
--f || (clearTimeout(y), u(!0));
|
|
4852
4856
|
}, l);
|
|
4853
4857
|
});
|
|
4854
4858
|
});
|
|
@@ -4879,11 +4883,11 @@ function Us(e, { statusCode: t, headers: n }, r = Date.now()) {
|
|
|
4879
4883
|
}, i = n && n["x-sentry-rate-limits"], c = n && n["retry-after"];
|
|
4880
4884
|
if (i)
|
|
4881
4885
|
for (const u of i.trim().split(",")) {
|
|
4882
|
-
const [l,
|
|
4883
|
-
if (!
|
|
4886
|
+
const [l, f, , , y] = u.split(":", 5), C = parseInt(l, 10), b = (isNaN(C) ? 60 : C) * 1e3;
|
|
4887
|
+
if (!f)
|
|
4884
4888
|
o.all = r + b;
|
|
4885
4889
|
else
|
|
4886
|
-
for (const I of
|
|
4890
|
+
for (const I of f.split(";"))
|
|
4887
4891
|
I === "metric_bucket" ? (!y || y.split(";").includes("custom")) && (o[I] = r + b) : o[I] = r + b;
|
|
4888
4892
|
}
|
|
4889
4893
|
else c ? o.all = r + Ds(c, r) : t === 429 && (o.all = r + 60 * 1e3);
|
|
@@ -4897,32 +4901,32 @@ function Xs(e, t, n = Os(
|
|
|
4897
4901
|
const o = (c) => n.drain(c);
|
|
4898
4902
|
function i(c) {
|
|
4899
4903
|
const u = [];
|
|
4900
|
-
if (vn(c, (
|
|
4904
|
+
if (vn(c, (C, b) => {
|
|
4901
4905
|
const I = In(b);
|
|
4902
4906
|
if (xs(r, I)) {
|
|
4903
|
-
const B = Pn(
|
|
4907
|
+
const B = Pn(C, b);
|
|
4904
4908
|
e.recordDroppedEvent("ratelimit_backoff", I, B);
|
|
4905
4909
|
} else
|
|
4906
|
-
u.push(
|
|
4910
|
+
u.push(C);
|
|
4907
4911
|
}), u.length === 0)
|
|
4908
4912
|
return he({});
|
|
4909
|
-
const l = we(c[0], u),
|
|
4913
|
+
const l = we(c[0], u), f = (C) => {
|
|
4910
4914
|
vn(l, (b, I) => {
|
|
4911
4915
|
const B = Pn(b, I);
|
|
4912
|
-
e.recordDroppedEvent(
|
|
4916
|
+
e.recordDroppedEvent(C, In(I), B);
|
|
4913
4917
|
});
|
|
4914
4918
|
}, y = () => t({ body: ns(l) }).then(
|
|
4915
|
-
(
|
|
4916
|
-
(
|
|
4917
|
-
throw
|
|
4919
|
+
(C) => (C.statusCode !== void 0 && (C.statusCode < 200 || C.statusCode >= 300) && U && N.warn(`Sentry responded with status code ${C.statusCode} to sent event.`), r = Us(r, C), C),
|
|
4920
|
+
(C) => {
|
|
4921
|
+
throw f("network_error"), C;
|
|
4918
4922
|
}
|
|
4919
4923
|
);
|
|
4920
4924
|
return n.add(y).then(
|
|
4921
|
-
(
|
|
4922
|
-
(
|
|
4923
|
-
if (
|
|
4924
|
-
return U && N.error("Skipped sending event because buffer is full."),
|
|
4925
|
-
throw
|
|
4925
|
+
(C) => C,
|
|
4926
|
+
(C) => {
|
|
4927
|
+
if (C instanceof Y)
|
|
4928
|
+
return U && N.error("Skipped sending event because buffer is full."), f("queue_overflow"), he({});
|
|
4929
|
+
throw C;
|
|
4926
4930
|
}
|
|
4927
4931
|
);
|
|
4928
4932
|
}
|
|
@@ -4983,8 +4987,8 @@ function zs(e, t, n, r) {
|
|
|
4983
4987
|
extra: u
|
|
4984
4988
|
};
|
|
4985
4989
|
if (n) {
|
|
4986
|
-
const
|
|
4987
|
-
|
|
4990
|
+
const f = Ft(e, n);
|
|
4991
|
+
f.length && (l.exception.values[0].stacktrace = { frames: f });
|
|
4988
4992
|
}
|
|
4989
4993
|
return l;
|
|
4990
4994
|
}
|
|
@@ -5272,7 +5276,7 @@ function Bi(e) {
|
|
|
5272
5276
|
transport: ui,
|
|
5273
5277
|
stackParser: vi,
|
|
5274
5278
|
integrations: [],
|
|
5275
|
-
release: "1.1.
|
|
5279
|
+
release: "1.1.50",
|
|
5276
5280
|
environment: e.environment || "production"
|
|
5277
5281
|
}), n = new ce();
|
|
5278
5282
|
n.setClient(t), n.setTags(e), t.init(), wt = n;
|
|
@@ -5470,7 +5474,7 @@ function Di(e, t, n, r) {
|
|
|
5470
5474
|
}
|
|
5471
5475
|
function Mi(e, t, n, r, o) {
|
|
5472
5476
|
if (!e) return "";
|
|
5473
|
-
const i = new Date(e.expires_at), c = isNaN(i.getTime()) ? "" : `${String(i.getDate()).padStart(2, "0")}.${String(i.getMonth() + 1).padStart(2, "0")}`, u = c ? r("couponUntil", { date: c }) : "", l = Number(e.reward_amount),
|
|
5477
|
+
const i = new Date(e.expires_at), c = isNaN(i.getTime()) ? "" : `${String(i.getDate()).padStart(2, "0")}.${String(i.getMonth() + 1).padStart(2, "0")}`, u = c ? r("couponUntil", { date: c }) : "", l = Number(e.reward_amount), f = Number.isFinite(l) && l > 0 ? $(l, "ru", o) : null;
|
|
5474
5478
|
return `
|
|
5475
5479
|
<div class="choco-widget-balance-toggle${n ? " choco-widget-balance-toggle--disabled" : ""}" data-action="toggle-coupon">
|
|
5476
5480
|
<div class="choco-widget-balance-info">
|
|
@@ -5479,11 +5483,11 @@ function Mi(e, t, n, r, o) {
|
|
|
5479
5483
|
</div>
|
|
5480
5484
|
</div>
|
|
5481
5485
|
<div class="choco-widget-balance-label-wrapper">
|
|
5482
|
-
${
|
|
5486
|
+
${f ? `
|
|
5483
5487
|
<div class="choco-widget-balance-icon">
|
|
5484
5488
|
${Xt}
|
|
5485
5489
|
</div>
|
|
5486
|
-
<div class="choco-widget-balance-amount">${
|
|
5490
|
+
<div class="choco-widget-balance-amount">${f}</div>
|
|
5487
5491
|
` : ""}
|
|
5488
5492
|
<label class="choco-widget-toggle">
|
|
5489
5493
|
<input type="checkbox" ${t && !n ? "checked" : ""} ${n ? "disabled" : ""} />
|
|
@@ -5495,7 +5499,7 @@ function Mi(e, t, n, r, o) {
|
|
|
5495
5499
|
}
|
|
5496
5500
|
function xi(e, t, n, r, o, i, c, u, l) {
|
|
5497
5501
|
if (!e && !n && !o) return "";
|
|
5498
|
-
const
|
|
5502
|
+
const f = e ? `
|
|
5499
5503
|
<div class="choco-widget-balance-toggle" data-action="toggle-balance">
|
|
5500
5504
|
<div class="choco-widget-balance-info">
|
|
5501
5505
|
<div class="choco-widget-balance-text">
|
|
@@ -5517,7 +5521,7 @@ function xi(e, t, n, r, o, i, c, u, l) {
|
|
|
5517
5521
|
return `
|
|
5518
5522
|
<div class="choco-widget-balance-section">
|
|
5519
5523
|
${Mi(o, i, c, u, l)}
|
|
5520
|
-
${
|
|
5524
|
+
${f}
|
|
5521
5525
|
${Di(n, r, u, l)}
|
|
5522
5526
|
</div>
|
|
5523
5527
|
`;
|
|
@@ -5544,9 +5548,9 @@ function Fi(e) {
|
|
|
5544
5548
|
selectedMethod: c,
|
|
5545
5549
|
balanceFormatted: u,
|
|
5546
5550
|
useBalance: l,
|
|
5547
|
-
bonuses:
|
|
5551
|
+
bonuses: f,
|
|
5548
5552
|
useBonuses: y,
|
|
5549
|
-
coupon:
|
|
5553
|
+
coupon: C,
|
|
5550
5554
|
useCoupon: b,
|
|
5551
5555
|
couponDisabled: I,
|
|
5552
5556
|
cashbackFormatted: B,
|
|
@@ -5557,7 +5561,7 @@ function Fi(e) {
|
|
|
5557
5561
|
freedomAmountFormatted: R,
|
|
5558
5562
|
t: L,
|
|
5559
5563
|
currency: q
|
|
5560
|
-
} = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), G = Ye(o), z = lr(i, c), J = xi(u, l,
|
|
5564
|
+
} = e, D = (o == null ? void 0 : o.label) ?? L("selectMethod"), G = Ye(o), z = lr(i, c), J = xi(u, l, f, y, C, b, I, L, q), M = Ui(B, L), v = (c == null ? void 0 : c.type) === "google_pay", g = (c == null ? void 0 : c.type) === "apple_pay", p = v || g;
|
|
5561
5565
|
return `
|
|
5562
5566
|
<div class="choco-widget-bottom-bar" role="region" aria-label="${L("paymentMethod")}">
|
|
5563
5567
|
${J}
|
|
@@ -5718,10 +5722,10 @@ function qi(e) {
|
|
|
5718
5722
|
Ar(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = Xi());
|
|
5719
5723
|
}
|
|
5720
5724
|
function zi(e) {
|
|
5721
|
-
var y,
|
|
5725
|
+
var y, C, b, I, B;
|
|
5722
5726
|
if (e._destroyed || !Ar(e)) return;
|
|
5723
5727
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
5724
|
-
const t = e.getAvailablePaymentMethods(), n = (y = e.checkoutContext) == null ? void 0 : y.data, r = e.config.currency || "KZT", o = (I = (b = (
|
|
5728
|
+
const t = e.getAvailablePaymentMethods(), n = (y = e.checkoutContext) == null ? void 0 : y.data, r = e.config.currency || "KZT", o = (I = (b = (C = n == null ? void 0 : n.balance) == null ? void 0 : C.data) == null ? void 0 : b.money) == null ? void 0 : I[r], i = !e.config.disableUseBalance && o > 0 ? $(o, e.config.locale, e.config.currency) : null, c = (B = n == null ? void 0 : n.cashback) == null ? void 0 : B.data, u = (c == null ? void 0 : c.cashbackAmount) > 0 ? $(c.cashbackAmount, e.config.locale, e.config.currency) : null, l = e._getPayableAmount(), f = l < e.config.amount;
|
|
5725
5729
|
e.container.innerHTML = Fi({
|
|
5726
5730
|
amountFormatted: $(l, e.config.locale, e.config.currency),
|
|
5727
5731
|
originalAmountFormatted: $(
|
|
@@ -5729,7 +5733,7 @@ function zi(e) {
|
|
|
5729
5733
|
e.config.locale,
|
|
5730
5734
|
e.config.currency
|
|
5731
5735
|
),
|
|
5732
|
-
showOriginalAmount:
|
|
5736
|
+
showOriginalAmount: f,
|
|
5733
5737
|
paymentMethod: e.selectedPaymentMethod,
|
|
5734
5738
|
methods: t,
|
|
5735
5739
|
selectedMethod: e.selectedPaymentMethod,
|
|
@@ -5799,8 +5803,8 @@ function dr(e) {
|
|
|
5799
5803
|
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), n && e.selectedPaymentMethod && (n.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, n.textContent = e.selectedPaymentMethod.label), r && e.selectedPaymentMethod && (r.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, r.innerHTML = ji(e.selectedPaymentMethod)), fr(e);
|
|
5800
5804
|
}
|
|
5801
5805
|
function Je(e) {
|
|
5802
|
-
var
|
|
5803
|
-
const t = (
|
|
5806
|
+
var C, b, I, B, Q, S;
|
|
5807
|
+
const t = (C = e.container) == null ? void 0 : C.querySelector(".choco-widget-pay-button"), n = (b = e.container) == null ? void 0 : b.querySelector(
|
|
5804
5808
|
".choco-widget-google-pay-amount"
|
|
5805
5809
|
), r = (I = e.container) == null ? void 0 : I.querySelector(
|
|
5806
5810
|
".choco-widget-google-pay-amount-label"
|
|
@@ -5810,7 +5814,7 @@ function Je(e) {
|
|
|
5810
5814
|
), i = (Q = e.container) == null ? void 0 : Q.querySelector(
|
|
5811
5815
|
".choco-widget-google-pay-amount-value-number"
|
|
5812
5816
|
);
|
|
5813
|
-
const c = e._getPayableAmount(), u = $(c, e.config.locale, e.config.currency), l = c < e.config.amount,
|
|
5817
|
+
const c = e._getPayableAmount(), u = $(c, e.config.locale, e.config.currency), l = c < e.config.amount, f = $(
|
|
5814
5818
|
e.config.amount,
|
|
5815
5819
|
e.config.locale,
|
|
5816
5820
|
e.config.currency
|
|
@@ -5826,11 +5830,11 @@ function Je(e) {
|
|
|
5826
5830
|
}
|
|
5827
5831
|
!o && n && (o = document.createElement("div"), o.className = "choco-widget-google-pay-amount-value", o.innerHTML = `${e.t("instead")} <span class="choco-widget-google-pay-amount-value-number"></span>`, n.appendChild(o), i = o.querySelector(
|
|
5828
5832
|
".choco-widget-google-pay-amount-value-number"
|
|
5829
|
-
)), i ? i.textContent =
|
|
5833
|
+
)), i ? i.textContent = f : o && (o.textContent = `${e.t("instead")} ${f}`);
|
|
5830
5834
|
}
|
|
5831
5835
|
function fr(e) {
|
|
5832
|
-
var l,
|
|
5833
|
-
const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((
|
|
5836
|
+
var l, f, y, C, b, I, B, Q, S, P;
|
|
5837
|
+
const t = ((l = e.selectedPaymentMethod) == null ? void 0 : l.type) === "google_pay", n = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "apple_pay", r = t || n, o = (y = e.container) == null ? void 0 : y.querySelector(".choco-widget-pay-button"), i = (C = e.container) == null ? void 0 : C.querySelector(
|
|
5834
5838
|
".choco-widget-google-pay-amount"
|
|
5835
5839
|
), c = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-google-pay-row"), u = (I = e.container) == null ? void 0 : I.querySelector(".choco-widget-apple-pay-row");
|
|
5836
5840
|
if (o == null || o.classList.toggle("choco-widget-pay-button--hidden", r), i == null || i.classList.toggle(
|
|
@@ -5860,7 +5864,7 @@ function fr(e) {
|
|
|
5860
5864
|
Je(e), ie(e);
|
|
5861
5865
|
}
|
|
5862
5866
|
async function Ki(e) {
|
|
5863
|
-
var c, u, l,
|
|
5867
|
+
var c, u, l, f, y;
|
|
5864
5868
|
const t = (c = e.container) == null ? void 0 : c.querySelector(
|
|
5865
5869
|
'[data-action="google-pay-button-slot"]'
|
|
5866
5870
|
);
|
|
@@ -5873,7 +5877,7 @@ async function Ki(e) {
|
|
|
5873
5877
|
return;
|
|
5874
5878
|
}
|
|
5875
5879
|
if (n !== e._googlePayButtonRenderVersion) return;
|
|
5876
|
-
if (!((y = (
|
|
5880
|
+
if (!((y = (f = (l = window.google) == null ? void 0 : l.payments) == null ? void 0 : f.api) != null && y.PaymentsClient)) {
|
|
5877
5881
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
5878
5882
|
return;
|
|
5879
5883
|
}
|
|
@@ -5886,8 +5890,8 @@ async function Ki(e) {
|
|
|
5886
5890
|
buttonLocale: e.config.locale || "ru",
|
|
5887
5891
|
buttonSizeMode: "fill"
|
|
5888
5892
|
});
|
|
5889
|
-
i.classList.add("choco-widget-google-pay-button"), i.style.setProperty("width", "100%", "important"), i.style.setProperty("height", "52px", "important"), i.style.setProperty("min-height", "52px", "important"), i.style.setProperty("border-radius", "12px", "important"), i.style.setProperty("font-size", "16px", "important"), i.style.setProperty("font-weight", "bold", "important"), i.querySelectorAll("*").forEach((
|
|
5890
|
-
|
|
5893
|
+
i.classList.add("choco-widget-google-pay-button"), i.style.setProperty("width", "100%", "important"), i.style.setProperty("height", "52px", "important"), i.style.setProperty("min-height", "52px", "important"), i.style.setProperty("border-radius", "12px", "important"), i.style.setProperty("font-size", "16px", "important"), i.style.setProperty("font-weight", "bold", "important"), i.querySelectorAll("*").forEach((C) => {
|
|
5894
|
+
C.style.setProperty("border-radius", "12px", "important"), C.style.setProperty("font-weight", "bold", "important"), C.style.setProperty("font-size", "16px", "important");
|
|
5891
5895
|
}), t.appendChild(i), ie(e);
|
|
5892
5896
|
}
|
|
5893
5897
|
function Gi(e) {
|
|
@@ -5932,9 +5936,9 @@ function pe(e) {
|
|
|
5932
5936
|
e.loading = !0, ie(e);
|
|
5933
5937
|
}
|
|
5934
5938
|
function K(e) {
|
|
5935
|
-
var
|
|
5939
|
+
var C, b, I, B, Q, S, P, k;
|
|
5936
5940
|
e.loading = !1;
|
|
5937
|
-
const t = (
|
|
5941
|
+
const t = (C = e.container) == null ? void 0 : C.querySelector(".choco-widget-payment-method"), n = (b = e.container) == null ? void 0 : b.querySelector(".choco-widget-pay-button"), r = (I = e.container) == null ? void 0 : I.querySelector(
|
|
5938
5942
|
".choco-widget-google-pay-button-slot button"
|
|
5939
5943
|
), o = (B = e.container) == null ? void 0 : B.querySelector(
|
|
5940
5944
|
".choco-widget-apple-pay-button-slot button"
|
|
@@ -5942,8 +5946,8 @@ function K(e) {
|
|
|
5942
5946
|
".choco-widget-google-pay-amount"
|
|
5943
5947
|
), c = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-google-pay-row"), u = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-apple-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(
|
|
5944
5948
|
".choco-widget-balance-section"
|
|
5945
|
-
),
|
|
5946
|
-
t && (t.disabled = y), n && (n.disabled =
|
|
5949
|
+
), f = e._isInteractionBlocked(), y = e.paymentMethodDisabled || f;
|
|
5950
|
+
t && (t.disabled = y), n && (n.disabled = f, n.classList.remove("choco-widget-pay-button--loading")), r && (r.disabled = f), o && (o.disabled = f), i == null || i.classList.toggle("choco-widget-wallet-blocked", f), i == null || i.setAttribute("aria-disabled", String(f)), c == null || c.classList.toggle("choco-widget-wallet-blocked", f), c == null || c.setAttribute("aria-disabled", String(f)), u == null || u.classList.toggle("choco-widget-wallet-blocked", f), u == null || u.setAttribute("aria-disabled", String(f)), l == null || l.classList.remove("disabled");
|
|
5947
5951
|
}
|
|
5948
5952
|
function ie(e) {
|
|
5949
5953
|
var b, I, B, Q, S, P, k, R, L;
|
|
@@ -5953,10 +5957,10 @@ function ie(e) {
|
|
|
5953
5957
|
".choco-widget-apple-pay-button-slot button"
|
|
5954
5958
|
), c = (P = e.container) == null ? void 0 : P.querySelector(
|
|
5955
5959
|
".choco-widget-google-pay-amount"
|
|
5956
|
-
), u = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"),
|
|
5960
|
+
), u = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-google-pay-row"), l = (R = e.container) == null ? void 0 : R.querySelector(".choco-widget-apple-pay-row"), f = (L = e.container) == null ? void 0 : L.querySelector(
|
|
5957
5961
|
".choco-widget-balance-section"
|
|
5958
|
-
), y = e._isInteractionBlocked(),
|
|
5959
|
-
|
|
5962
|
+
), y = e._isInteractionBlocked(), C = e.paymentMethodDisabled || y;
|
|
5963
|
+
f == null || f.classList.toggle("disabled", y), t && (t.disabled = C), n && (n.disabled = y, n.classList.toggle("choco-widget-pay-button--loading", e.loading)), r && (r.disabled = y), o && (o.disabled = y), i && (i.disabled = y), c == null || c.classList.toggle("choco-widget-wallet-blocked", y), c == null || c.setAttribute("aria-disabled", String(y)), u == null || u.classList.toggle("choco-widget-wallet-blocked", y), u == null || u.setAttribute("aria-disabled", String(y)), l == null || l.classList.toggle("choco-widget-wallet-blocked", y), l == null || l.setAttribute("aria-disabled", String(y));
|
|
5960
5964
|
}
|
|
5961
5965
|
function hr(e) {
|
|
5962
5966
|
var n;
|
|
@@ -5977,7 +5981,7 @@ function ke(e) {
|
|
|
5977
5981
|
var l;
|
|
5978
5982
|
const t = (l = e.container) == null ? void 0 : l.querySelector('[data-sheet="payment"]');
|
|
5979
5983
|
if (!t) return;
|
|
5980
|
-
const n = t.querySelector(".choco-widget-sheet-title"), r = t.querySelector('[data-action="close-sheet"]'), o = t.querySelector('[data-action="edit-sheet"]'), i = t.querySelector('[data-action="previous-sheet"]'), u = e.getAvailablePaymentMethods().some((
|
|
5984
|
+
const n = t.querySelector(".choco-widget-sheet-title"), r = t.querySelector('[data-action="close-sheet"]'), o = t.querySelector('[data-action="edit-sheet"]'), i = t.querySelector('[data-action="previous-sheet"]'), u = e.getAvailablePaymentMethods().some((f) => f.type === "card");
|
|
5981
5985
|
e.isPaymentSheetEditMode ? (t.classList.add("choco-widget-payment-sheet--edit"), n && (n.textContent = e.t("editCards")), r && (r.style.display = "none"), o && (o.style.display = "none"), i && (i.style.display = "")) : (t.classList.remove("choco-widget-payment-sheet--edit"), t.classList.toggle("choco-widget-payment-sheet--no-cards", !u), n && (n.textContent = e.t("paymentMethods")), r && (r.style.display = ""), o && (o.style.display = u ? "" : "none"), i && (i.style.display = "none"));
|
|
5982
5986
|
}
|
|
5983
5987
|
function gt(e) {
|
|
@@ -6223,12 +6227,12 @@ async function ea(e) {
|
|
|
6223
6227
|
await On(e);
|
|
6224
6228
|
const l = (u == null ? void 0 : u.id) ?? ((r = u == null ? void 0 : u.data) == null ? void 0 : r.id);
|
|
6225
6229
|
if (l && Ie(e, String(l)), ((o = e.selectedPaymentMethod) == null ? void 0 : o.type) === "kaspi_pay") {
|
|
6226
|
-
const
|
|
6230
|
+
const f = (u == null ? void 0 : u.attributes) || ((i = u == null ? void 0 : u.data) == null ? void 0 : i.attributes) || {}, y = f.action_link || f.action_url, C = f.action_url_type || f.action_type || "redirect";
|
|
6227
6231
|
if (y)
|
|
6228
6232
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
6229
6233
|
action_link: y,
|
|
6230
6234
|
action_url: y,
|
|
6231
|
-
action_type:
|
|
6235
|
+
action_type: C,
|
|
6232
6236
|
event: u
|
|
6233
6237
|
}), u) : (window.location.href = y, u);
|
|
6234
6238
|
}
|
|
@@ -6285,57 +6289,65 @@ async function na(e, t) {
|
|
|
6285
6289
|
type: "final"
|
|
6286
6290
|
}
|
|
6287
6291
|
}, o = new n(3, r);
|
|
6288
|
-
Be = o
|
|
6289
|
-
|
|
6292
|
+
Be = o;
|
|
6293
|
+
let i = !1;
|
|
6294
|
+
o.onvalidatemerchant = async (c) => {
|
|
6295
|
+
var u, l;
|
|
6290
6296
|
try {
|
|
6291
|
-
let
|
|
6297
|
+
let f;
|
|
6292
6298
|
try {
|
|
6293
|
-
|
|
6299
|
+
f = await rn(
|
|
6294
6300
|
e.apiUrl,
|
|
6295
6301
|
e._getApiConfig(),
|
|
6296
|
-
|
|
6302
|
+
c.validationURL
|
|
6297
6303
|
);
|
|
6298
|
-
} catch (
|
|
6299
|
-
if (
|
|
6300
|
-
await e._obtainTokenByRefreshOrTrackId(),
|
|
6304
|
+
} catch (b) {
|
|
6305
|
+
if (b.status === 401)
|
|
6306
|
+
await e._obtainTokenByRefreshOrTrackId(), f = await rn(
|
|
6301
6307
|
e.apiUrl,
|
|
6302
6308
|
e._getApiConfig(),
|
|
6303
|
-
|
|
6309
|
+
c.validationURL
|
|
6304
6310
|
);
|
|
6305
6311
|
else
|
|
6306
|
-
throw
|
|
6312
|
+
throw b;
|
|
6307
6313
|
}
|
|
6308
|
-
const
|
|
6309
|
-
o.completeMerchantValidation(
|
|
6310
|
-
} catch (
|
|
6311
|
-
console.error("Apple Pay session error:",
|
|
6314
|
+
const y = ((l = (u = f == null ? void 0 : f.data) == null ? void 0 : u.attributes) == null ? void 0 : l.session) || f, C = JSON.parse(atob(y));
|
|
6315
|
+
o.completeMerchantValidation(C), i = !0;
|
|
6316
|
+
} catch (f) {
|
|
6317
|
+
console.error("Apple Pay session error:", f), se(f, { paymentMethod: "apple_pay", phase: "merchant_validation" }), K(e), o.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
6312
6318
|
}
|
|
6313
|
-
}, o.onpaymentauthorized = async (
|
|
6314
|
-
var
|
|
6319
|
+
}, o.onpaymentauthorized = async (c) => {
|
|
6320
|
+
var u;
|
|
6315
6321
|
try {
|
|
6316
6322
|
if (typeof e.config.onBeforeCheckout == "function") {
|
|
6317
|
-
const
|
|
6318
|
-
|
|
6323
|
+
const y = await e.config.onBeforeCheckout();
|
|
6324
|
+
y && typeof y == "object" && Object.assign(e.config, y);
|
|
6319
6325
|
}
|
|
6320
|
-
const
|
|
6326
|
+
const l = await Hr(
|
|
6321
6327
|
e.apiUrl,
|
|
6322
6328
|
e._getApiConfig(),
|
|
6323
6329
|
e.deviceId,
|
|
6324
|
-
|
|
6330
|
+
c.payment,
|
|
6325
6331
|
t
|
|
6326
6332
|
);
|
|
6327
6333
|
o.completePayment(n.STATUS_SUCCESS), Be = null;
|
|
6328
|
-
const
|
|
6329
|
-
|
|
6330
|
-
} catch (
|
|
6331
|
-
console.error("Apple Pay payment error:",
|
|
6334
|
+
const f = (l == null ? void 0 : l.id) ?? ((u = l == null ? void 0 : l.data) == null ? void 0 : u.id);
|
|
6335
|
+
f && !e._orderStatusResolved && Ie(e, String(f));
|
|
6336
|
+
} catch (l) {
|
|
6337
|
+
console.error("Apple Pay payment error:", l), se(l, { paymentMethod: "apple_pay", phase: "payment_authorized" }), o.completePayment(n.STATUS_FAILURE), Be = null, K(e), e.config.onError({
|
|
6332
6338
|
attributes: {
|
|
6333
|
-
message: e._resolveErrorMessage(
|
|
6339
|
+
message: e._resolveErrorMessage(l, "errorApplePayPayment")
|
|
6334
6340
|
}
|
|
6335
6341
|
});
|
|
6336
6342
|
}
|
|
6337
6343
|
}, o.oncancel = () => {
|
|
6338
|
-
Be = null, K(e),
|
|
6344
|
+
if (Be = null, K(e), !i) {
|
|
6345
|
+
e.config.onError({
|
|
6346
|
+
attributes: { message: e.t("errorApplePayInterrupted") }
|
|
6347
|
+
});
|
|
6348
|
+
return;
|
|
6349
|
+
}
|
|
6350
|
+
e.config.onCancel();
|
|
6339
6351
|
}, o.begin();
|
|
6340
6352
|
}
|
|
6341
6353
|
async function ra(e, t) {
|
|
@@ -6352,7 +6364,7 @@ async function ra(e, t) {
|
|
|
6352
6364
|
});
|
|
6353
6365
|
return;
|
|
6354
6366
|
}
|
|
6355
|
-
const l = e.config.environment === "production",
|
|
6367
|
+
const l = e.config.environment === "production", f = (o == null ? void 0 : o.merchant_name) || "Choco", y = o == null ? void 0 : o.google_merchant_id;
|
|
6356
6368
|
if (l && !y) {
|
|
6357
6369
|
e.config.onError({
|
|
6358
6370
|
attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
|
|
@@ -6363,7 +6375,7 @@ async function ra(e, t) {
|
|
|
6363
6375
|
await oa(e, t, { gateway: c, gatewayMerchantId: u });
|
|
6364
6376
|
return;
|
|
6365
6377
|
}
|
|
6366
|
-
const
|
|
6378
|
+
const C = Number(e._getCheckoutAmount()).toFixed(2);
|
|
6367
6379
|
try {
|
|
6368
6380
|
await e._loadGooglePaySdk();
|
|
6369
6381
|
} catch (D) {
|
|
@@ -6395,11 +6407,11 @@ async function ra(e, t) {
|
|
|
6395
6407
|
transactionInfo: {
|
|
6396
6408
|
totalPriceStatus: "FINAL",
|
|
6397
6409
|
totalPriceLabel: "Итого",
|
|
6398
|
-
totalPrice:
|
|
6410
|
+
totalPrice: C,
|
|
6399
6411
|
currencyCode: e.config.currency,
|
|
6400
6412
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
6401
6413
|
},
|
|
6402
|
-
merchantInfo: l ? { merchantId: y, merchantName:
|
|
6414
|
+
merchantInfo: l ? { merchantId: y, merchantName: f } : { merchantName: f }
|
|
6403
6415
|
}, Q = new b.payments.api.PaymentsClient({
|
|
6404
6416
|
environment: l ? "PRODUCTION" : "TEST"
|
|
6405
6417
|
});
|
|
@@ -6461,15 +6473,15 @@ async function oa(e, t, n) {
|
|
|
6461
6473
|
}
|
|
6462
6474
|
}
|
|
6463
6475
|
function sa(e) {
|
|
6464
|
-
var c, u, l,
|
|
6476
|
+
var c, u, l, f, y, C, b, I, B, Q, S, P;
|
|
6465
6477
|
const t = e.container;
|
|
6466
6478
|
(c = t.querySelector('[data-action="freedom-card"]')) == null || c.addEventListener("click", () => {
|
|
6467
6479
|
e.config.onFreedomLink && e.config.onFreedomLink();
|
|
6468
|
-
}), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => hr(e)), t.querySelectorAll('[data-action="close"]').forEach((k) => k.addEventListener("click", () => e.close())), (
|
|
6480
|
+
}), (u = t.querySelector('[data-action="pay"]')) == null || u.addEventListener("click", () => e.handlePayment()), (l = t.querySelector('[data-action="change-method"]')) == null || l.addEventListener("click", () => hr(e)), t.querySelectorAll('[data-action="close"]').forEach((k) => k.addEventListener("click", () => e.close())), (f = t.querySelector('[data-action="close-sheet"]')) == null || f.addEventListener("click", () => {
|
|
6469
6481
|
e._pendingDeleteMethod ? Ve(e) : ae(e);
|
|
6470
6482
|
}), (y = t.querySelector('[data-action="edit-sheet"]')) == null || y.addEventListener("click", () => {
|
|
6471
6483
|
e.isPaymentSheetEditMode = !0, Qe(e), ke(e);
|
|
6472
|
-
}), (
|
|
6484
|
+
}), (C = t.querySelector('[data-action="previous-sheet"]')) == null || C.addEventListener("click", () => {
|
|
6473
6485
|
e.isPaymentSheetEditMode = !1, Qe(e), ke(e);
|
|
6474
6486
|
}), (b = t.querySelector('[data-action="close-add-card"]')) == null || b.addEventListener("click", () => ve(e)), (I = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || I.addEventListener("click", () => Ve(e)), (B = t.querySelector('[data-action="confirm-delete-submit"]')) == null || B.addEventListener("click", () => {
|
|
6475
6487
|
if (e._pendingDeleteMethod) {
|
|
@@ -6510,24 +6522,24 @@ function aa(e, t) {
|
|
|
6510
6522
|
if (!n || !r) return;
|
|
6511
6523
|
const o = 80;
|
|
6512
6524
|
let i = 0, c = 0;
|
|
6513
|
-
const u = (
|
|
6514
|
-
c =
|
|
6525
|
+
const u = (f) => {
|
|
6526
|
+
c = f.clientY;
|
|
6515
6527
|
const y = Math.max(0, c - i);
|
|
6516
6528
|
r.style.transform = `translateY(${y}px)`;
|
|
6517
|
-
}, l = (
|
|
6518
|
-
n.releasePointerCapture(
|
|
6529
|
+
}, l = (f) => {
|
|
6530
|
+
n.releasePointerCapture(f.pointerId), n.removeEventListener("pointermove", u), n.removeEventListener("pointerup", l), n.removeEventListener("pointercancel", l);
|
|
6519
6531
|
const y = Math.max(0, c - i);
|
|
6520
6532
|
if (r.classList.remove("choco-widget-sheet-content--dragging"), y >= o) {
|
|
6521
6533
|
r.style.transform = "translateY(100%)";
|
|
6522
|
-
const
|
|
6523
|
-
r.removeEventListener("transitionend",
|
|
6534
|
+
const C = () => {
|
|
6535
|
+
r.removeEventListener("transitionend", C), r.style.transform = "", ae(e);
|
|
6524
6536
|
};
|
|
6525
|
-
r.addEventListener("transitionend",
|
|
6537
|
+
r.addEventListener("transitionend", C);
|
|
6526
6538
|
} else
|
|
6527
6539
|
r.style.transform = "";
|
|
6528
6540
|
};
|
|
6529
|
-
n.addEventListener("pointerdown", (
|
|
6530
|
-
!e.isPaymentSheetOpen ||
|
|
6541
|
+
n.addEventListener("pointerdown", (f) => {
|
|
6542
|
+
!e.isPaymentSheetOpen || f.button !== 0 || (f.preventDefault(), i = f.clientY, c = f.clientY, r.classList.add("choco-widget-sheet-content--dragging"), n.setPointerCapture(f.pointerId), n.addEventListener("pointermove", u), n.addEventListener("pointerup", l), n.addEventListener("pointercancel", l));
|
|
6531
6543
|
});
|
|
6532
6544
|
}
|
|
6533
6545
|
class me {
|
|
@@ -6597,17 +6609,17 @@ class me {
|
|
|
6597
6609
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
6598
6610
|
}
|
|
6599
6611
|
_getPaymentBreakdown() {
|
|
6600
|
-
const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(),
|
|
6612
|
+
const t = this.config.amount, n = this._getBalanceAmount(), r = this.useBalance ? Math.min(n, t) : 0, o = t - r, i = this.useBalance && r >= t, c = this.useBonuses ? this._getAvailableBonus() : 0, u = Math.max(o - c, 0), l = this._getCouponDiscount(), f = Math.max(u - l, 0), y = this.useBalance ? t : f, C = this.useBalance && !i, I = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
6601
6613
|
id: this.selectedCoupon.voucher_id,
|
|
6602
6614
|
template_id: this.selectedCoupon.template_id,
|
|
6603
6615
|
type: this.selectedCoupon.type
|
|
6604
6616
|
} : void 0;
|
|
6605
6617
|
return {
|
|
6606
|
-
payableAmount:
|
|
6618
|
+
payableAmount: f,
|
|
6607
6619
|
checkoutOptions: {
|
|
6608
6620
|
checkoutAmount: y,
|
|
6609
6621
|
forceBalanceMethod: i,
|
|
6610
|
-
useBalance:
|
|
6622
|
+
useBalance: C,
|
|
6611
6623
|
voucher: I
|
|
6612
6624
|
}
|
|
6613
6625
|
};
|