choco-one-click-payment 1.1.51 → 1.1.53
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 +8 -3
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -17,6 +17,7 @@ const br = {
|
|
|
17
17
|
total: "Итого",
|
|
18
18
|
instead: "вместо",
|
|
19
19
|
coupon: "Списать купон",
|
|
20
|
+
couponSuppressesCashback: "При применении купона бонусы не начисляются",
|
|
20
21
|
couponUntil: "до {date}",
|
|
21
22
|
addCard: "Добавление карты",
|
|
22
23
|
editCards: "Редактировать карты",
|
|
@@ -57,6 +58,7 @@ const br = {
|
|
|
57
58
|
total: "Total",
|
|
58
59
|
instead: "instead",
|
|
59
60
|
coupon: "Apply coupon",
|
|
61
|
+
couponSuppressesCashback: "Bonuses are not credited when the coupon is applied",
|
|
60
62
|
couponUntil: "until {date}",
|
|
61
63
|
addCard: "Add card",
|
|
62
64
|
editCards: "Edit cards",
|
|
@@ -97,6 +99,7 @@ const br = {
|
|
|
97
99
|
total: "Барлығы",
|
|
98
100
|
instead: "орнына",
|
|
99
101
|
coupon: "Купонды пайдалану",
|
|
102
|
+
couponSuppressesCashback: "Купон қолданылғанда бонустар есептелмейді",
|
|
100
103
|
couponUntil: "{date} дейін",
|
|
101
104
|
addCard: "Картаны қосу",
|
|
102
105
|
editCards: "Карталарды өңдеу",
|
|
@@ -137,6 +140,7 @@ const br = {
|
|
|
137
140
|
total: "ჯამი",
|
|
138
141
|
instead: "ნაცვლად",
|
|
139
142
|
coupon: "კუპონის გამოყენება",
|
|
143
|
+
couponSuppressesCashback: "კუპონის გამოყენებისას ბონუსები არ დაირიცხება",
|
|
140
144
|
couponUntil: "{date}-მდე",
|
|
141
145
|
addCard: "ბარათის დამატება",
|
|
142
146
|
editCards: "ბარათების რედაქტირება",
|
|
@@ -5276,7 +5280,7 @@ function Bi(e) {
|
|
|
5276
5280
|
transport: ui,
|
|
5277
5281
|
stackParser: vi,
|
|
5278
5282
|
integrations: [],
|
|
5279
|
-
release: "1.1.
|
|
5283
|
+
release: "1.1.53",
|
|
5280
5284
|
environment: e.environment || "production"
|
|
5281
5285
|
}), n = new ce();
|
|
5282
5286
|
n.setClient(t), n.setTags(e), t.init(), wt = n;
|
|
@@ -5480,6 +5484,7 @@ function Mi(e, t, n, r, o) {
|
|
|
5480
5484
|
<div class="choco-widget-balance-info">
|
|
5481
5485
|
<div class="choco-widget-balance-text">
|
|
5482
5486
|
<div class="choco-widget-balance-label">${r("coupon")}${u ? ` <span style="color:#767485">(${u})</span>` : ""}</div>
|
|
5487
|
+
${e.suppresses_cashback && !n ? `<div class="choco-widget-balance-sublabel">${r("couponSuppressesCashback")}</div>` : ""}
|
|
5483
5488
|
</div>
|
|
5484
5489
|
</div>
|
|
5485
5490
|
<div class="choco-widget-balance-label-wrapper">
|
|
@@ -5750,7 +5755,7 @@ function zi(e) {
|
|
|
5750
5755
|
loading: e.loading,
|
|
5751
5756
|
showFreedomBtn: !e.config.isFridge && e.config.onFreedomLink !== null,
|
|
5752
5757
|
freedomAmountFormatted: $(
|
|
5753
|
-
Math.round(l * 0.
|
|
5758
|
+
Math.round(l * 0.94),
|
|
5754
5759
|
e.config.locale,
|
|
5755
5760
|
e.config.currency
|
|
5756
5761
|
),
|
|
@@ -5824,7 +5829,7 @@ function Je(e) {
|
|
|
5824
5829
|
t.textContent = P, t.setAttribute("aria-label", P);
|
|
5825
5830
|
}
|
|
5826
5831
|
const y = (S = e.container) == null ? void 0 : S.querySelector(".choco-widget-freedom-card-btn");
|
|
5827
|
-
if (y && (y.textContent = `от ${$(Math.round(c * 0.
|
|
5832
|
+
if (y && (y.textContent = `от ${$(Math.round(c * 0.94), e.config.locale, e.config.currency)} по карте Freedom`), r && (r.textContent = `${e.t("total")} ${u}`), !l) {
|
|
5828
5833
|
o == null || o.remove();
|
|
5829
5834
|
return;
|
|
5830
5835
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.choco-one-click-widget{position:fixed;top:0;left:0;right:0;bottom:0;z-index:999999;font-family:Sirius,sans-serif;--choco-widget-accent-color: #2F2F2F;pointer-events:none}.choco-one-click-widget--embedded{position:static;top:auto;left:auto;right:auto;bottom:auto;z-index:auto;pointer-events:auto;min-height:1px}.choco-one-click-widget--embedded .choco-widget-bottom-bar{position:static;box-shadow:none;border-radius:24px}.choco-one-click-widget--embedded .choco-widget-payment-sheet{position:fixed}.choco-one-click-widget *{box-sizing:border-box;font-family:Sirius,sans-serif}.choco-one-click-widget .choco-widget-bottom-bar{opacity:0;transform:translateY(16px)}.choco-one-click-widget .choco-widget-balance-section,.choco-one-click-widget .choco-widget-payment-info{opacity:0;transform:translateY(8px)}.choco-one-click-widget--visible .choco-widget-bottom-bar,.choco-one-click-widget--visible .choco-widget-balance-section,.choco-one-click-widget--visible .choco-widget-payment-info{opacity:1;transform:translateY(0)}.choco-widget-bottom-bar{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;padding:16px;box-shadow:0 -4px 20px #0000001a;transition:transform .24s cubic-bezier(.4,0,.2,1),opacity .2s ease;pointer-events:auto}.choco-widget-payment-info{display:flex;flex-direction:column;gap:12px;align-items:stretch;transition:transform .22s ease,opacity .2s ease}.choco-widget-payment-info-main{display:flex;gap:12px;align-items:center}.choco-widget-payment-method{gap:12px;background:#f1f2f7;border-radius:16px;padding:5px 8px;cursor:pointer;transition:background .2s ease;border:none;font-family:inherit;text-align:left;width:100%;position:relative;height:46px}.choco-widget-payment-method:disabled{cursor:not-allowed;pointer-events:none;opacity:.5}.choco-widget-payment-method.google_pay,.choco-widget-payment-method.apple_pay{max-width:140px}.choco-widget-method-icon-placeholder{font-size:24px}.choco-widget-method-details{flex:1}.choco-widget-method-label{font-size:14px;color:#000}.choco-widget-method-value{font-size:14px;font-weight:600;color:#000;display:flex;align-items:center;gap:4px}.choco-widget-method-icon-wrapper svg{display:block;width:100%;max-width:29px;max-height:18px;margin-top:2px}.choco-widget-method-icon-wrapper:empty{display:none}.choco-widget-method-icon-wrapper.google_pay svg{height:17px;max-width:35px;border:1px solid #3C4043;padding:3px 4px 2px;border-radius:8px}.choco-widget-method-name{font-size:14px;font-weight:700}.choco-widget-method-name.google_pay,.choco-widget-method-name.apple_pay{display:none}.choco-widget-method-chevron{position:absolute;right:5px;top:0;bottom:0;margin:auto 0;width:24px;height:24px}.choco-widget-freedom-card-btn{width:100%;height:46px;padding:0 13px;background:linear-gradient(to right,#17678d,#00ca82);border:none;border-radius:16px;font-size:16px;font-weight:700;font-family:inherit;color:#fff;cursor:pointer}.choco-widget-freedom-card-btn:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button{background:var(--choco-widget-accent-color);color:#fff;border:none;border-radius:16px;height:46px;padding:0 16px;font-size:16px;font-weight:600;cursor:pointer;transition:all .2s ease;white-space:nowrap;width:100%;overflow:hidden}.choco-widget-pay-button--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-pay-button--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-pay-button--loading:after{content:"";display:block;width:100%;height:100%;background:#2f2f2f;position:absolute;left:0;top:0}.choco-widget-pay-button:disabled{opacity:.5;pointer-events:none}.choco-widget-pay-button--hidden{display:none}.choco-widget-google-pay-amount{min-width:124px;height:46px;display:flex;flex-direction:column;justify-content:center;text-align:right;width:100%}.choco-widget-google-pay-amount--hidden{display:none}.choco-widget-google-pay-amount-label{font-size:20px;font-weight:700;line-height:24px;color:#1d1d1d}.choco-widget-google-pay-amount-value{font-size:14px;line-height:18px;color:#1d1d1d;white-space:nowrap;opacity:.5}.choco-widget-google-pay-amount-value--hidden{display:none}.choco-widget-google-pay-amount-value-number{text-decoration:line-through}.choco-widget-google-pay-row--hidden{display:none}.choco-widget-wallet-blocked{pointer-events:none;opacity:.6}.choco-widget-google-pay-button-slot{width:100%}.choco-widget-google-pay-button-slot>button{width:100%!important;height:52px;min-height:52px;border-radius:12px!important;font-size:16px!important}.choco-widget-apple-pay-row--hidden{display:none}.choco-widget-apple-pay-button-slot{width:100%}.choco-widget-apple-pay-button-wrapper{position:relative;width:100%;height:52px}.choco-widget-apple-pay-button{width:100%;height:52px;min-height:52px;border:0;border-radius:12px;cursor:pointer;background:#000;color:#fff;font-size:16px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 16px}.choco-widget-apple-pay-button--native{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:52px;opacity:.01;z-index:2}.choco-widget-apple-pay-button-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;gap:8px;background:#000;border-radius:12px;pointer-events:none;z-index:1}.choco-widget-apple-pay-button-text{font-size:16px;line-height:20px;font-weight:600;color:#fff}.choco-widget-apple-pay-button-icon{display:inline-flex;align-items:center;justify-content:center}.choco-widget-payment-sheet{position:absolute;bottom:0;left:0;right:0;top:0;background:#00000080;display:flex;align-items:flex-end;opacity:0;pointer-events:none;transition:opacity .3s ease}.choco-widget-payment-sheet--open{opacity:1;pointer-events:auto}.choco-widget-payment-sheet--open .choco-widget-sheet-content{transform:translateY(0)}.choco-widget-sheet-content{background:#fff;border-radius:24px 24px 0 0;width:100%;max-height:70vh;overflow-y:auto;transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);padding:8px 16px 16px;position:relative;will-change:transform}.choco-widget-sheet-content--dragging{transition:none}.choco-widget-sheet-grabber{flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;margin-bottom:8px;-webkit-user-select:none;user-select:none}.choco-widget-sheet-grabber:active{cursor:grabbing}.choco-widget-sheet-grabber:before{content:"";width:72px;height:6px;background:#e5e5e7;border-radius:42px}.choco-widget-sheet-content{-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.choco-widget-sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;position:relative}.choco-widget-sheet-title{font-size:20px;font-weight:700;color:#000;margin:0;flex:1;text-align:center}.choco-widget-payment-sheet--edit .choco-widget-sheet-title{padding-left:30px}.choco-widget-payment-sheet--no-cards .choco-widget-sheet-title{padding-right:30px}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-title{padding:0}.choco-widget-sheet-button{background:none;border:none;width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}.choco-widget-sheet-button svg{color:#000}.choco-widget-sheet-delete-confirm{display:none;padding-top:16px}.choco-widget-payment-sheet--delete-confirm .choco-widget-payment-methods,.choco-widget-payment-sheet--delete-confirm .choco-widget-cashback-section{display:none!important}.choco-widget-payment-sheet--delete-confirm .choco-widget-sheet-delete-confirm{display:block}.choco-widget-sheet-delete-confirm-text{margin:0 0 24px;font-size:16px;line-height:1.4;color:#242424;text-align:center}.choco-widget-sheet-delete-confirm-actions{display:flex;gap:12px}.choco-widget-delete-confirm-btn{flex:1;padding:14px 20px;font-size:16px;font-weight:600;font-family:inherit;border-radius:16px;border:none;cursor:pointer;transition:background .2s ease,opacity .2s ease}.choco-widget-delete-confirm-btn--cancel{background:#f1f2f7;color:#242424}.choco-widget-delete-confirm-btn--delete{background:var(--choco-widget-accent-color);color:#fff}.choco-widget-delete-confirm-btn--loading{cursor:not-allowed;pointer-events:none;position:relative}.choco-widget-sheet-delete-confirm-actions.choco-widget-sheet-delete-confirm-actions--loading .choco-widget-delete-confirm-btn{pointer-events:none;cursor:not-allowed;opacity:.7}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:before{content:"";display:block;width:16px;height:16px;border:2px solid #ffffff;border-top:2px solid transparent;border-radius:50%;animation:choco-spin 1s linear infinite;position:absolute;left:0;right:0;margin:0 auto;z-index:2}.choco-widget-delete-confirm-btn--delete.choco-widget-delete-confirm-btn--loading:after{content:"";display:block;width:100%;height:100%;background:#cc3434;position:absolute;left:0;top:0;border-radius:16px}.choco-widget-add-card-sheet{align-items:stretch}.choco-widget-add-card-sheet .choco-widget-add-card-sheet-content{max-height:none;height:100%;display:flex;flex-direction:column;transform:none;border-radius:0;padding:0}.choco-widget-add-card-sheet--open .choco-widget-add-card-sheet-content{transform:none}.choco-widget-add-card-sheet .choco-widget-sheet-header{flex-shrink:0;margin-bottom:0;padding:12px 0;border-bottom:1px solid #eee}.choco-widget-add-card-iframe-wrapper{flex:1;min-height:0;background:#fff}.choco-widget-add-card-iframe{width:100%;height:100%;border:none;display:block}.choco-widget-balance-section{margin-bottom:12px;padding:12px 8px;background:#f1f2f7;border-radius:12px;transition:transform .22s ease,opacity .2s ease}.choco-widget-balance-section.disabled{opacity:.5;pointer-events:none}.choco-widget-balance-toggle{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;padding:4px 0}.choco-widget-balance-toggle:last-child{margin-bottom:0}.choco-widget-balance-toggle--disabled{opacity:.5;pointer-events:none}.choco-widget-balance-info{display:flex;align-items:center;gap:12px}.choco-widget-balance-text{display:flex;flex-direction:column}.choco-widget-balance-label-wrapper{display:flex;align-items:center;gap:8px}.choco-widget-balance-label{font-size:16px;font-weight:500}.choco-widget-balance-sublabel{font-size:12px;color:#767485;margin-top:2px}.choco-widget-balance-icon{width:22px;height:22px}.choco-widget-balance-amount{font-size:16px;font-weight:500;color:#000;white-space:nowrap}.choco-widget-toggle{position:relative;display:inline-block;width:42px;height:26px}.choco-widget-toggle input{opacity:0;width:0;height:0}.choco-widget-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#d4d3df;transition:.3s;border-radius:28px}.choco-widget-toggle-slider:before{position:absolute;content:"";height:22px;width:22px;left:2px;bottom:0;top:0;margin:auto;background-color:#fff;transition:.3s;border-radius:50%}.choco-widget-toggle input:checked+.choco-widget-toggle-slider{background-color:var(--choco-widget-accent-color)}.choco-widget-toggle input:checked+.choco-widget-toggle-slider:before{transform:translate(16px)}.choco-widget-cashback-section{margin-top:20px;padding-top:20px;border-top:1px solid #f0f0f0}.choco-widget-cashback-info{display:flex;align-items:center;gap:8px;padding:12px 16px;background:#fff5ee;border-radius:12px;font-size:14px;color:#ff6b00}.choco-widget-cashback-icon{font-size:20px}.choco-widget-cashback-text strong{font-weight:700}.choco-widget-payment-methods{display:flex;flex-direction:column;gap:8px}.choco-widget-method-item{display:flex;align-items:center;gap:12px;padding:10px 0;cursor:pointer;transition:all .2s ease;border:2px solid transparent;width:100%;border:0;background:none;text-align:left;font-family:inherit;font-size:inherit}.choco-widget-method-item-icon-wrapper{width:37px}.choco-widget-method-item-icon-wrapper svg{display:block;width:100%;max-width:29px;height:29px;margin:0 auto}.choco-widget-method-item-icon-wrapper.google_pay{outline:1px solid #3C4043;padding:3px 5px 2px;border-radius:15px}.choco-widget-method-item-icon-wrapper.google_pay svg{height:15px;max-width:29px}.choco-widget-method-item-label{flex:1;font-size:16px;color:#000}.choco-widget-method-item-check,.choco-widget-method-item-trash-btn{flex-shrink:0;display:flex;align-items:center;justify-content:center;padding:6px;margin:-6px 0 -6px 6px;background:none;border:none;cursor:pointer;border-radius:8px;-webkit-tap-highlight-color:transparent}.choco-widget-method-item-check{height:30px;width:30px}.choco-widget-method-item-trash-btn:hover{background:#cc343414}.choco-widget-method-item-trash{flex-shrink:0;width:20px;height:20px}.choco-widget-bottom-bar-prerender{position:absolute;bottom:0;left:0;right:0;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -4px 20px #0000001a;transition:transform .3s cubic-bezier(.4,0,.2,1);height:78px}.choco-widget-payment-loading{width:30px;height:30px;animation:choco-spin 1s linear infinite;border:3px solid var(--choco-widget-accent-color);border-top:3px solid transparent;border-radius:50%;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}@keyframes choco-spin{to{transform:rotate(360deg)}}@keyframes choco-fade-in{0%{opacity:0;transform:translate(-50%,-50%) scale(.9)}to{opacity:1;transform:translate(-50%,-50%) scale(1)}}@media(max-width:768px){.choco-widget-bottom-bar{padding:16px 16px 20px}.choco-widget-sheet-content{max-height:80vh}.choco-widget-sheet-title{font-size:18px}.choco-widget-method-item-label{font-size:17px}}@media(max-width:768px)and (min-height:812px){.choco-widget-bottom-bar,.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom,20px))}}@supports (padding: env(safe-area-inset-bottom)){.choco-widget-bottom-bar{padding-bottom:calc(16px + env(safe-area-inset-bottom))}.choco-widget-sheet-content{padding-bottom:calc(20px + env(safe-area-inset-bottom))}}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
(function(Be,Se){typeof exports=="object"&&typeof module<"u"?module.exports=Se():typeof define=="function"&&define.amd?define(Se):(Be=typeof globalThis<"u"?globalThis:Be||self,Be.ChocoOneClickWidget=Se())})(this,(function(){"use strict";const Be={ru:{paymentMethod:"Способ оплаты",selectMethod:"Выберите метод",pay:"Оплатить",login:"Войти",paymentSuccess:"Оплата прошла успешно!",paymentError:"Ошибка оплаты",paymentMethods:"Способ оплаты",newCard:"Оплата новой картой",balance:"Списать баланс",bonus:"Списать бонусы",bonusText:"Можно оплатить до {amount}%",cashback:"Кешбэк",willGet:"Получите",total:"Итого",instead:"вместо",coupon:"Списать купон",couponUntil:"до {date}",addCard:"Добавление карты",editCards:"Редактировать карты",cardDeleted:"Карта успешно удалена",confirmDeleteCard:"Вы действительно хотите удалить карту?",cancel:"Отмена",delete:"Удалить",back:"Назад",errorMissingTrackClient:"Укажите trackId и clientId",errorNoServerResponseRetry:"Нет ответа от сервера, попробуйте заново",errorNoServerResponse:"Нет ответа от сервера",errorPaymentMethodNotSelected:"Метод оплаты не выбран",errorApplePayUnsupported:"Apple Pay не поддерживается в этом браузере",errorApplePayInit:"Ошибка инициализации Apple Pay",errorApplePayPayment:"Ошибка оплаты через Apple Pay",errorApplePayInterrupted:"Пожалуйста, подтвердите оплату после полной загрузки окна Apple Pay",errorGooglePayUnsupported:"Google Pay не поддерживается в этом браузере",errorGooglePaySettingsUnavailable:"Настройки Google Pay недоступны",errorGooglePayPayment:"Ошибка оплаты через Google Pay",errorActionUrlMissing:"action_url отсутствует в событии order.action_required",errorWidgetInit:"Ошибка инициализации виджета",errorPaymentProcess:"Ошибка оплаты"},en:{paymentMethod:"Payment method",selectMethod:"Select method",pay:"Pay",login:"Sign in",paymentSuccess:"Payment successful!",paymentError:"Payment error",paymentMethods:"Payment method",newCard:"Pay with new card",balance:"Use balance",bonus:"Use bonuses",bonusText:"You can pay up to {amount}%",cashback:"Cashback",willGet:"You will get",total:"Total",instead:"instead",coupon:"Apply coupon",couponUntil:"until {date}",addCard:"Add card",editCards:"Edit cards",cardDeleted:"Card successfully deleted",confirmDeleteCard:"Are you sure you want to delete this card?",cancel:"Cancel",delete:"Delete",back:"Back",errorMissingTrackClient:"Provide trackId and clientId",errorNoServerResponseRetry:"No response from server, please try again",errorNoServerResponse:"No response from server",errorPaymentMethodNotSelected:"Payment method is not selected",errorApplePayUnsupported:"Apple Pay is not supported in this browser",errorApplePayInit:"Apple Pay initialization error",errorApplePayPayment:"Apple Pay payment error",errorApplePayInterrupted:"Please confirm payment after the Apple Pay sheet fully loads",errorGooglePayUnsupported:"Google Pay is not supported in this browser",errorGooglePaySettingsUnavailable:"Google Pay settings are unavailable",errorGooglePayPayment:"Google Pay payment error",errorActionUrlMissing:"action_url is missing in order.action_required event",errorWidgetInit:"Widget initialization error",errorPaymentProcess:"Payment error"},kk:{paymentMethod:"Төлем әдісі",selectMethod:"Әдісті таңдаңыз",pay:"Төлеу",login:"Кіру",paymentSuccess:"Төлем сәтті өтті!",paymentError:"Төлем қатесі",paymentMethods:"Төлем әдісі",newCard:"Жаңа картамен төлеу",balance:"Балансты пайдалану",bonus:"Бонусдарды пайдалану",bonusText:"{amount}%-ге дейін төлеуге болады",cashback:"Кэшбэк",willGet:"Аласыз",total:"Барлығы",instead:"орнына",coupon:"Купонды пайдалану",couponUntil:"{date} дейін",addCard:"Картаны қосу",editCards:"Карталарды өңдеу",cardDeleted:"Карта жойылды",confirmDeleteCard:"Картаны жойғыңыз келетініне сенімдісіз бе?",cancel:"Болдырмау",delete:"Жою",back:"Артқа",errorMissingTrackClient:"trackId пен clientId көрсетіңіз",errorNoServerResponseRetry:"Серверден жауап жоқ, қайтадан көріңіз",errorNoServerResponse:"Серверден жауап жоқ",errorPaymentMethodNotSelected:"Төлем әдісі таңдалмаған",errorApplePayUnsupported:"Бұл браузерде Apple Pay қолдау көрсетілмейді",errorApplePayInit:"Apple Pay инициализация қатесі",errorApplePayPayment:"Apple Pay арқылы төлем қатесі",errorApplePayInterrupted:"Өтінеміз, төлемді Apple Pay терезесі толық жүктелгеннен кейін растаңыз",errorGooglePayUnsupported:"Бұл браузерде Google Pay қолдау көрсетілмейді",errorGooglePaySettingsUnavailable:"Google Pay баптаулары қолжетімсіз",errorGooglePayPayment:"Google Pay арқылы төлем қатесі",errorActionUrlMissing:"order.action_required оқиғасында action_url жоқ",errorWidgetInit:"Виджетті инициализациялау қатесі",errorPaymentProcess:"Төлем қатесі"},ka:{paymentMethod:"გადახდის მეთოდი",selectMethod:"აირჩიეთ მეთოდი",pay:"გადახდა",login:"შესვლა",paymentSuccess:"გადახდა წარმატებით შესრულდა!",paymentError:"გადახდის შეცდომა",paymentMethods:"გადახდის მეთოდი",newCard:"ახალი ბარათით გადახდა",balance:"ბალანსის გამოყენება",bonus:"ბონუსების გამოყენება",bonusText:"{amount}%-ზე გადახდა შესაძლებელია",cashback:"ქეშბექი",willGet:"მიიღებთ",total:"ჯამი",instead:"ნაცვლად",coupon:"კუპონის გამოყენება",couponUntil:"{date}-მდე",addCard:"ბარათის დამატება",editCards:"ბარათების რედაქტირება",cardDeleted:"ბარათი წაშლილია",confirmDeleteCard:"დარწმუნებული ხართ, რომ გსურთ ამ ბარათის წაშლა?",cancel:"გაუქმება",delete:"წაშლა",back:"უკან",errorMissingTrackClient:"მიუთითეთ trackId და clientId",errorNoServerResponseRetry:"სერვერის პასუხი არ არის, სცადეთ თავიდან",errorNoServerResponse:"სერვერის პასუხი არ არის",errorPaymentMethodNotSelected:"გადახდის მეთოდი არ არის არჩეული",errorApplePayUnsupported:"ამ ბრაუზერში Apple Pay არ არის მხარდაჭერილი",errorApplePayInit:"Apple Pay-ის ინიციალიზაციის შეცდომა",errorApplePayPayment:"Apple Pay-ით გადახდის შეცდომა",errorApplePayInterrupted:"გთხოვთ, დაადასტუროთ გადახდა Apple Pay-ის ფანჯრის სრულად ჩატვირთვის შემდეგ",errorGooglePayUnsupported:"ამ ბრაუზერში Google Pay არ არის მხარდაჭერილი",errorGooglePaySettingsUnavailable:"Google Pay-ის პარამეტრები მიუწვდომელია",errorGooglePayPayment:"Google Pay-ით გადახდის შეცდომა",errorActionUrlMissing:"order.action_required მოვლენაში action_url არ არის",errorWidgetInit:"ვიჯეტის ინიციალიზაციის შეცდომა",errorPaymentProcess:"გადახდის შეცდომა"}},Se={KZT:"₸",GEL:"₾"};function Er(e){return e==="production"?"https://api-proxy.choco.kz":"https://api-proxy.chocodev.kz"}let Re;const vr=new Uint8Array(16);function Ir(){if(!Re&&(Re=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Re))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Re(vr)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function Br(e,t=0){return F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]}const qt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Oe(e,t,n){if(qt.randomUUID&&!e)return qt.randomUUID();e=e||{};const r=e.random||(e.rng||Ir)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Br(r)}const zt="choco_device_id";function Z(e,t="ru",n="KZT"){const r=Number(e),o=t==="ru"?"ru-RU":"en-US";return`${r.toLocaleString(o)} ${Se[n]}`}function Kt(){let e=localStorage.getItem(zt);return e||(e=Oe(),localStorage.setItem(zt,e)),e}function Ne(){if(typeof window>"u")return!1;const e=window.safari!==void 0,t=window.navigator.userAgent||"",n=!!t.match(/iPad/i)||!!t.match(/iPhone/i),r=!!t.match(/WebKit/i),o=n&&r&&!t.match(/CriOS/i);return e||o}function Gt(){if(typeof navigator>"u")return 0;const e=navigator.userAgent||"",t=e.indexOf("OS");return(e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1)&&t>-1?Number(e.substring(t+3,t+6).replace("_",".")):0}function dt(){var i;if(typeof navigator>"u")return"unknown";const e=(navigator.userAgent||navigator.vendor||"").toLowerCase(),t=(navigator.platform||"").toLowerCase(),n=(((i=navigator.userAgentData)==null?void 0:i.platform)||"").toLowerCase(),r=`${e} ${t} ${n}`;return/iphone|ipad|ipod/.test(r)||r.includes("macintosh")&&typeof document<"u"&&"ontouchend"in document?"ios":r.includes("android")?"android":r.includes("windows")?"windows":r.includes("mac")?"macos":"other"}function De(){if(typeof navigator>"u")return!1;const e=navigator.userAgentData;return e!=null&&e.platform&&["iOS","iPadOS"].includes(e.platform)||dt()==="ios"?!0:(navigator.userAgent||"").includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Me(e){if(typeof sessionStorage>"u")return!1;const t=e==="apple_pay"?"disableApplePay":e==="google_pay"?"disableGooglePay":null;return t?sessionStorage.getItem(t)==="true":!1}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe={exports:{}},_r=xe.exports,Wt;function Qr(){return Wt||(Wt=1,(function(e,t){(function(r,o){e.exports=o()})(_r,function(){return(function(){var n={382:(function(c,u,l){Object.defineProperty(u,"__esModule",{value:!0}),u.Centrifuge=void 0;var h=I(l(187)),y=I(l(471)),m=l(147),b=l(853);function I(g){return g&&g.__esModule?g:{default:g}}function B(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(C){return typeof C}:B=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},B(g)}function Q(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function S(g,p){for(var C=0;C<p.length;C++){var d=p[C];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}}function P(g,p,C){return p&&S(g.prototype,p),g}function k(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),p&&R(g,p)}function R(g,p){return R=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},R(g,p)}function L(g){var p=G();return function(){var d=K(g),s;if(p){var a=K(this).constructor;s=Reflect.construct(d,arguments,a)}else s=d.apply(this,arguments);return z(this,s)}}function z(g,p){if(p&&(B(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(g)}function D(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function G(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function K(g){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},K(g)}var J="timeout",M="connection closed",v=(function(g){k(C,g);var p=L(C);function C(d,s){var a;return Q(this,C),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={protocol:"",debug:!1,name:"js",version:"",websocket:null,sockjs:null,xmlhttprequest:null,minRetry:1e3,maxRetry:2e4,timeout:5e3,ping:!0,pingInterval:25e3,pongWaitTimeout:5e3,privateChannelPrefix:"$",onTransportClose:null,sockjsServer:null,sockjsTimeout:null,sockjsTransports:["websocket","xdr-streaming","xhr-streaming","eventsource","iframe-eventsource","iframe-htmlfile","xdr-polling","xhr-polling","iframe-xhr-polling","jsonp-polling"],refreshEndpoint:"/centrifuge/refresh",refreshHeaders:{},refreshParams:{},refreshData:{},refreshAttempts:null,refreshInterval:1e3,onRefreshFailed:null,onRefresh:null,subscribeEndpoint:"/centrifuge/subscribe",subscribeHeaders:{},subscribeParams:{},subRefreshInterval:1e3,onPrivateSubscribe:null,disableWithCredentials:!1},a._configure(s),a}return P(C,[{key:"setToken",value:function(s){this._token=s}},{key:"setConnectData",value:function(s){this._connectData=s}},{key:"setRefreshHeaders",value:function(s){this._config.refreshHeaders=s}},{key:"setRefreshParams",value:function(s){this._config.refreshParams=s}},{key:"setRefreshData",value:function(s){this._config.refreshData=s}},{key:"setSubscribeHeaders",value:function(s){this._config.subscribeHeaders=s}},{key:"setSubscribeParams",value:function(s){this._config.subscribeParams=s}},{key:"_ajax",value:function(s,a,A,f,E){var _=this,T="";this._debug("sending AJAX request to",s,"with data",JSON.stringify(f));var w;this._xmlhttprequest!==null?w=new this._xmlhttprequest:w=l.g.XMLHttpRequest?new l.g.XMLHttpRequest:new l.g.ActiveXObject("Microsoft.XMLHTTP");for(var O in a)a.hasOwnProperty(O)&&(T.length>0&&(T+="&"),T+=encodeURIComponent(O)+"="+encodeURIComponent(a[O]));T.length>0&&(T="?"+T),w.open("POST",s+T,!0),"withCredentials"in w&&(w.withCredentials=!this._config.disableWithCredentials),w.setRequestHeader("X-Requested-With","XMLHttpRequest"),w.setRequestHeader("Content-Type","application/json");for(var X in A)A.hasOwnProperty(X)&&w.setRequestHeader(X,A[X]);return w.onreadystatechange=function(){if(w.readyState===4)if(w.status===200){var H,x=!1;try{H=JSON.parse(w.responseText),x=!0}catch{E({error:"Invalid JSON. Data was: "+w.responseText,status:200,data:null})}x&&E({data:H,status:200})}else _._log("wrong status code in AJAX response",w.status),E({status:w.status,data:null})},setTimeout(function(){return w.send(JSON.stringify(f))},20),w}},{key:"_log",value:function(){(0,b.log)("info",arguments)}},{key:"_debug",value:function(){this._config.debug===!0&&(0,b.log)("debug",arguments)}},{key:"_websocketSupported",value:function(){return this._config.websocket!==null?!0:!(typeof WebSocket!="function"&&(typeof WebSocket>"u"?"undefined":B(WebSocket))!=="object")}},{key:"_setFormat",value:function(s){if(!this._formatOverride(s)){if(s==="protobuf")throw new Error("not implemented by JSON only Centrifuge client – use client with Protobuf");this._binary=!1,this._methodType=m.JsonMethodType,this._pushType=m.JsonPushType,this._encoder=new m.JsonEncoder,this._decoder=new m.JsonDecoder}}},{key:"_formatOverride",value:function(s){return!1}},{key:"_configure",value:function(s){if(!("Promise"in l.g))throw new Error("Promise polyfill required");if((0,b.extend)(this._config,s||{}),this._debug("centrifuge config",this._config),!this._url)throw new Error("url required");var a=(0,b.startsWith)(this._url,"ws")&&this._url.indexOf("format=protobuf")>-1;if(a||this._config.protocol==="protobuf")this._setFormat("protobuf"),this._protocol="protobuf";else{if(this._config.protocol!==""&&this._config.protocol!=="json")throw new Error("unsupported protocol "+this._config.protocol);this._setFormat("json")}if((0,b.startsWith)(this._url,"http"))if(this._debug("client will try to connect to SockJS endpoint"),this._config.sockjs!==null)this._debug("SockJS explicitly provided in options"),this._sockjs=this._config.sockjs;else{if(typeof l.g.SockJS>"u")throw new Error("SockJS not found, use ws:// in url or include SockJS");this._debug("use globally defined SockJS"),this._sockjs=l.g.SockJS}else this._debug("client will connect to websocket endpoint");this._xmlhttprequest=this._config.xmlhttprequest}},{key:"_setStatus",value:function(s){this._status!==s&&(this._debug("Status",this._status,"->",s),this._status=s)}},{key:"_isDisconnected",value:function(){return this._status==="disconnected"}},{key:"_isConnecting",value:function(){return this._status==="connecting"}},{key:"_isConnected",value:function(){return this._status==="connected"}},{key:"_nextMessageId",value:function(){return++this._messageId}},{key:"_resetRetry",value:function(){this._debug("reset retries count to 0"),this._retries=0}},{key:"_getRetryInterval",value:function(){var s=(0,b.backoff)(this._retries,this._config.minRetry,this._config.maxRetry);return this._retries+=1,s}},{key:"_abortInflightXHRs",value:function(){for(var s in this._xhrs){try{this._xhrs[s].abort()}catch(a){this._debug("error aborting xhr",a)}delete this._xhrs[s]}}},{key:"_clearConnectedState",value:function(s){this._clientID=null,this._stopPing();for(var a in this._callbacks)if(this._callbacks.hasOwnProperty(a)){var A=this._callbacks[a];clearTimeout(A.timeout);var f=A.errback;if(!f)continue;f({error:this._createErrorObject("disconnected")})}this._callbacks={};for(var E in this._subs)if(this._subs.hasOwnProperty(E)){var _=this._subs[E];s?(_._isSuccess()&&(_._triggerUnsubscribe(),_._recover=!0),_._shouldResubscribe()&&_._setSubscribing()):_._setUnsubscribed()}this._abortInflightXHRs(),this._refreshTimeout!==null&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);for(var T in this._subRefreshTimeouts)this._subRefreshTimeouts.hasOwnProperty(T)&&this._subRefreshTimeouts[T]&&this._clearSubRefreshTimeout(T);this._subRefreshTimeouts={},this._reconnect||(this._subs={})}},{key:"_isTransportOpen",value:function(){return this._isSockjs?this._transport&&this._transport.transport&&this._transport.transport.readyState===this._transport.transport.OPEN:this._transport&&this._transport.readyState===this._transport.OPEN}},{key:"_transportSend",value:function(s){if(!s.length)return!0;if(!this._isTransportOpen()){for(var a in s){var A=a.id;if(A in this._callbacks){var f=this._callbacks[A];clearTimeout(this._callbacks[A].timeout),delete this._callbacks[A];var E=f.errback;E({error:this._createErrorObject(M,0)})}}return!1}return this._transport.send(this._encoder.encodeCommands(s)),!0}},{key:"_getSubProtocol",value:function(){return this._protocol?"centrifuge-"+this._protocol:""}},{key:"_setupTransport",value:function(){var s=this;if(this._isSockjs=!1,this._sockjs!==null){var a={transports:this._config.sockjsTransports};this._config.sockjsServer!==null&&(a.server=this._config.sockjsServer),this._config.sockjsTimeout!==null&&(a.timeout=this._config.sockjsTimeout),this._isSockjs=!0,this._transport=new this._sockjs(this._url,null,a)}else{if(!this._websocketSupported())throw this._debug("No Websocket support and no SockJS configured, can not connect"),new Error("No Websocket support and no SockJS configured, can not connect");this._config.websocket!==null?this._websocket=this._config.websocket:this._websocket=WebSocket;var A=this._getSubProtocol();A!==""?this._transport=new this._websocket(this._url,A):this._transport=new this._websocket(this._url),this._binary===!0&&(this._transport.binaryType="arraybuffer")}this._transport.onopen=function(){s._transportClosed=!1,s._isSockjs?(s._transportName="sockjs-"+s._transport.transport,s._transport.onheartbeat=function(){return s._restartPing()}):s._transportName="websocket";var f={};(s._token||s._connectData||s._config.name||s._config.version)&&(f.params={}),s._token&&(f.params.token=s._token),s._connectData&&(f.params.data=s._connectData),s._config.name&&(f.params.name=s._config.name),s._config.version&&(f.params.version=s._config.version);var E={},_=!1;for(var T in s._serverSubs)if(s._serverSubs.hasOwnProperty(T)&&s._serverSubs[T].recoverable){_=!0;var w={recover:!0};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}_&&(f.params||(f.params={}),f.params.subs=E),s._latencyStart=new Date,s._call(f).then(function(O){s._connectResponse(s._decoder.decodeCommandResult(s._methodType.CONNECT,O.result),_),O.next&&O.next()},function(O){var X=O.error;X.code===109&&(s._refreshRequired=!0),s._disconnect("connect error",!0),O.next&&O.next()})},this._transport.onerror=function(f){s._debug("transport level error",f)},this._transport.onclose=function(f){s._transportClosed=!0;var E=M,_=!0;if(f&&"reason"in f&&f.reason)try{var T=JSON.parse(f.reason);s._debug("reason is an advice object",T),E=T.reason,_=T.reconnect}catch{E=f.reason,s._debug("reason is a plain string",E)}if(s._config.onTransportClose!==null&&s._config.onTransportClose({event:f,reason:E,reconnect:_}),s._disconnect(E,_),s._reconnect===!0){s._reconnecting=!0;var w=s._getRetryInterval();s._debug("reconnect after "+w+" milliseconds"),setTimeout(function(){s._reconnect===!0&&(s._refreshRequired?s._refresh():s._connect())},w)}},this._transport.onmessage=function(f){s._dataReceived(f.data)}}},{key:"rpc",value:function(s){return this._rpc("",s)}},{key:"namedRPC",value:function(s,a){return this._rpc(s,a)}},{key:"_rpc",value:function(s,a){var A={data:a};s!==""&&(A.method=s);var f={method:this._methodType.RPC,params:A};return this._methodCall(f,function(E){return E})}},{key:"send",value:function(s){var a={method:this._methodType.SEND,params:{data:s}};if(!this.isConnected())return Promise.reject(this._createErrorObject(M,0));var A=this._transportSend([a]);return A?Promise.resolve({}):Promise.reject(this._createErrorObject(M,0))}},{key:"_getHistoryParams",value:function(s,a){var A={channel:s};return a!==void 0&&(a.since&&(A.since={offset:a.since.offset},a.since.epoch&&(A.since.epoch=a.since.epoch)),a.limit!==void 0&&(A.limit=a.limit),a.reverse===!0&&(A.reverse=!0)),A}},{key:"_methodCall",value:function(s,a){var A=this;return this.isConnected()?new Promise(function(f,E){A._call(s).then(function(_){f(a(A._decoder.decodeCommandResult(s.method,_.result))),_.next&&_.next()},function(_){E(_.error),_.next&&_.next()})}):Promise.reject(this._createErrorObject(M,0))}},{key:"publish",value:function(s,a){var A={method:this._methodType.PUBLISH,params:{channel:s,data:a}};return this._methodCall(A,function(){return{}})}},{key:"history",value:function(s,a){var A=this._getHistoryParams(s,a),f={method:this._methodType.HISTORY,params:A};return this._methodCall(f,function(E){return{publications:E.publications,epoch:E.epoch||"",offset:E.offset||0}})}},{key:"presence",value:function(s){var a={method:this._methodType.PRESENCE,params:{channel:s}};return this._methodCall(a,function(A){return{presence:A.presence}})}},{key:"presenceStats",value:function(s){var a={method:this._methodType.PRESENCE_STATS,params:{channel:s}};return this._methodCall(a,function(A){return{num_users:A.num_users,num_clients:A.num_clients}})}},{key:"_dataReceived",value:function(s){var a=this,A=this._decoder.decodeReplies(s);this._dispatchPromise=this._dispatchPromise.then(function(){var f;a._dispatchPromise=new Promise(function(E){f=E}),a._dispatchSynchronized(A,f)}),this._restartPing()}},{key:"_dispatchSynchronized",value:function(s,a){var A=this,f=Promise.resolve(),E=function(w){s.hasOwnProperty(w)&&(f=f.then(function(){return A._dispatchReply(s[w])}))};for(var _ in s)E(_);f=f.then(function(){a()})}},{key:"_dispatchReply",value:function(s){var a,A=new Promise(function(E){a=E});if(s==null)return this._debug("dispatch: got undefined or null reply"),a(),A;var f=s.id;return f&&f>0?this._handleReply(s,a):this._handlePush(s.result,a),A}},{key:"_call",value:function(s){var a=this;return new Promise(function(A,f){var E=a._addMessage(s);a._registerCall(E,A,f)})}},{key:"_connect",value:function(){if(this.isConnected()){this._debug("connect called when already connected");return}this._status!=="connecting"&&(this._debug("start connecting"),this._setStatus("connecting"),this._clientID=null,this._reconnect=!0,this._setupTransport())}},{key:"_disconnect",value:function(s,a){var A=a||!1;if(A===!1&&(this._reconnect=!1),this._isDisconnected()){A||this._clearConnectedState(A);return}if(this._clearConnectedState(A),this._debug("disconnected:",s,a),this._setStatus("disconnected"),this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),this._reconnecting===!1){for(var f in this._serverSubs)this._serverSubs.hasOwnProperty(f)&&this.emit("unsubscribe",{channel:f});this.emit("disconnect",{reason:s,reconnect:A})}A===!1&&(this._subs={},this._serverSubs={}),this._transportClosed||this._transport.close()}},{key:"_refreshFailed",value:function(){this._numRefreshFailed=0,this._isDisconnected()||this._disconnect("refresh failed",!1),this._config.onRefreshFailed!==null&&this._config.onRefreshFailed()}},{key:"_refresh",value:function(){var s=this;if(this._debug("refresh token"),this._config.refreshAttempts===0){this._debug("refresh attempts set to 0, do not send refresh request at all"),this._refreshFailed();return}this._refreshTimeout!==null&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);var a=this._clientID,A=this._newXHRID(),f=function(w){if(A in s._xhrs&&delete s._xhrs[A],s._clientID===a){if(w.error||w.status!==200){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){s._refreshFailed();return}var O=Math.round(Math.random()*1e3*Math.max(s._numRefreshFailed,20)),X=s._config.refreshInterval+O;s._refreshTimeout=setTimeout(function(){return s._refresh()},X);return}if(s._numRefreshFailed=0,s._token=w.data.token,!s._token){s._refreshFailed();return}if(s._isDisconnected()&&s._reconnect)s._debug("token refreshed, connect from scratch"),s._connect();else{s._debug("send refreshed token");var H={method:s._methodType.REFRESH,params:{token:s._token}};s._call(H).then(function(x){s._refreshResponse(s._decoder.decodeCommandResult(s._methodType.REFRESH,x.result)),x.next&&x.next()},function(x){s._refreshError(x.error),x.next&&x.next()})}}};if(this._config.onRefresh!==null){var E={};this._config.onRefresh(E,f)}else{var _=this._ajax(this._config.refreshEndpoint,this._config.refreshParams,this._config.refreshHeaders,this._config.refreshData,f);this._xhrs[A]=_}}},{key:"_refreshError",value:function(s){var a=this;this._debug("refresh error",s),this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);var A=this._config.refreshInterval+Math.round(Math.random()*1e3);this._refreshTimeout=setTimeout(function(){return a._refresh()},A)}},{key:"_refreshResponse",value:function(s){var a=this;this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),s.expires&&(this._clientID=s.client,this._refreshTimeout=setTimeout(function(){return a._refresh()},this._getTTLMilliseconds(s.ttl)))}},{key:"_newXHRID",value:function(){return this._xhrID++,this._xhrID}},{key:"_subRefresh",value:function(s){var a=this;if(this._debug("refresh subscription token for channel",s),this._subRefreshTimeouts[s]!==void 0)this._clearSubRefreshTimeout(s);else return;var A=this._clientID,f=this._newXHRID(),E=function(O){if(f in a._xhrs&&delete a._xhrs[f],!(O.error||O.status!==200||a._clientID!==A)){var X={};if(O.data.channels)for(var H in O.data.channels){var x=O.data.channels[H];x.channel&&(X[x.channel]=x.token)}var ve=X[s];if(ve){var Xt={method:a._methodType.SUB_REFRESH,params:{channel:s,token:ve}},At=a._getSub(s);At!==null&&a._call(Xt).then(function(se){a._subRefreshResponse(s,a._decoder.decodeCommandResult(a._methodType.SUB_REFRESH,se.result)),se.next&&se.next()},function(se){a._subRefreshError(s,se.error),se.next&&se.next()})}}},_={client:this._clientID,channels:[s]};if(this._config.onPrivateSubscribe!==null)this._config.onPrivateSubscribe({data:_},E);else{var T=this._ajax(this._config.subscribeEndpoint,this._config.subscribeParams,this._config.subscribeHeaders,_,E);this._xhrs[f]=T}}},{key:"_clearSubRefreshTimeout",value:function(s){this._subRefreshTimeouts[s]!==void 0&&(clearTimeout(this._subRefreshTimeouts[s]),delete this._subRefreshTimeouts[s])}},{key:"_subRefreshError",value:function(s,a){var A=this;this._debug("subscription refresh error",s,a),this._clearSubRefreshTimeout(s);var f=this._getSub(s);if(f!==null){var E=Math.round(Math.random()*1e3),_=setTimeout(function(){return A._subRefresh(s)},this._config.subRefreshInterval+E);this._subRefreshTimeouts[s]=_}}},{key:"_subRefreshResponse",value:function(s,a){var A=this;this._debug("subscription refresh success",s),this._clearSubRefreshTimeout(s);var f=this._getSub(s);if(f!==null&&a.expires===!0){var E=setTimeout(function(){return A._subRefresh(s)},this._getTTLMilliseconds(a.ttl));this._subRefreshTimeouts[s]=E}}},{key:"_subscribe",value:function(s,a){var A=this;this._debug("subscribing on",s.channel);var f=s.channel;if(f in this._subs||(this._subs[f]=s),!this.isConnected()){s._setNew();return}s._setSubscribing(a);var E={method:this._methodType.SUBSCRIBE,params:{channel:f}};if(s._subscribeData&&(E.params.data=s._subscribeData),(0,b.startsWith)(f,this._config.privateChannelPrefix))this._isSubscribeBatching?this._privateChannels[f]=!0:(this.startSubscribeBatching(),this._subscribe(s),this.stopSubscribeBatching());else{var _=s._needRecover();if(_===!0){E.params.recover=!0;var T=this._getLastSeq(f),w=this._getLastGen(f);if(T||w)T&&(E.params.seq=T),w&&(E.params.gen=w);else{var O=this._getLastOffset(f);O&&(E.params.offset=O)}var X=this._getLastEpoch(f);X&&(E.params.epoch=X)}this._call(E).then(function(H){A._subscribeResponse(f,_,A._decoder.decodeCommandResult(A._methodType.SUBSCRIBE,H.result)),H.next&&H.next()},function(H){A._subscribeError(f,H.error),H.next&&H.next()})}}},{key:"_unsubscribe",value:function(s){delete this._subs[s.channel],delete this._lastOffset[s.channel],delete this._lastSeq[s.channel],delete this._lastGen[s.channel],this.isConnected()&&this._addMessage({method:this._methodType.UNSUBSCRIBE,params:{channel:s.channel}})}},{key:"_getTTLMilliseconds",value:function(s){return Math.min(s*1e3,2147483647)}},{key:"getSub",value:function(s){return this._getSub(s)}},{key:"_getSub",value:function(s){var a=this._subs[s];return a||null}},{key:"_isServerSub",value:function(s){return this._serverSubs[s]!==void 0}},{key:"_connectResponse",value:function(s,a){var A=this,f=this._reconnecting;if(this._reconnecting=!1,this._resetRetry(),this._refreshRequired=!1,!this.isConnected()){this._latencyStart!==null&&(this._latency=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(){return A._refresh()},this._getTTLMilliseconds(s.ttl))),this.startBatching(),this.startSubscribeBatching();for(var E in this._subs)if(this._subs.hasOwnProperty(E)){var _=this._subs[E];_._shouldResubscribe()&&this._subscribe(_,f)}this.stopSubscribeBatching(),this.stopBatching(),this._startPing();var T={client:s.client,transport:this._transportName,latency:this._latency};s.data&&(T.data=s.data),this.emit("connect",T),s.subs&&this._processServerSubs(s.subs)}}},{key:"_processServerSubs",value:function(s){for(var a in s)if(s.hasOwnProperty(a)){var A=s[a],f=this._serverSubs[a]!==void 0,E={channel:a,isResubscribe:f};E=this._expandSubscribeContext(E,A),this.emit("subscribe",E)}for(var _ in s)if(s.hasOwnProperty(_)){var T=s[_];if(T.recovered){var w=T.publications;if(w&&w.length>0){w.length>1&&(!w[0].offset||w[0].offset>w[1].offset)&&(w=w.reverse());for(var O in w)w.hasOwnProperty(O)&&this._handlePublication(_,w[O])}}this._serverSubs[_]={seq:T.seq,gen:T.gen,offset:T.offset,epoch:T.epoch,recoverable:T.recoverable}}}},{key:"_stopPing",value:function(){this._pongTimeout!==null&&(clearTimeout(this._pongTimeout),this._pongTimeout=null),this._pingTimeout!==null&&(clearTimeout(this._pingTimeout),this._pingTimeout=null)}},{key:"_startPing",value:function(){var s=this;this._config.ping!==!0||this._config.pingInterval<=0||this.isConnected()&&(this._pingTimeout=setTimeout(function(){if(!s.isConnected()){s._stopPing();return}s.ping(),s._pongTimeout=setTimeout(function(){s._disconnect("no ping",!0)},s._config.pongWaitTimeout)},this._config.pingInterval))}},{key:"_restartPing",value:function(){this._stopPing(),this._startPing()}},{key:"_subscribeError",value:function(s,a){var A=this._getSub(s);if(A&&A._isSubscribing()){if(a.code===0&&a.message===J){this._disconnect("timeout",!0);return}A._setSubscribeError(a)}}},{key:"_expandSubscribeContext",value:function(s,a){var A=!1;"recovered"in a&&(A=a.recovered),s.recovered=A;var f=!1;"positioned"in a&&(f=a.positioned);var E="";"epoch"in a&&(E=a.epoch);var _=0;return"offset"in a&&(_=a.offset),f&&(s.streamPosition={offset:_,epoch:E}),a.data&&(s.data=a.data),s}},{key:"_subscribeResponse",value:function(s,a,A){var f=this,E=this._getSub(s);if(E&&E._isSubscribing()){E._setSubscribeSuccess(A);var _=A.publications;if(_&&_.length>0){_.length>=2&&!_[0].offset&&!_[1].offset&&(_=_.reverse());for(var T in _)_.hasOwnProperty(T)&&this._handlePublication(s,_[T])}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){var w=setTimeout(function(){return f._subRefresh(s)},this._getTTLMilliseconds(A.ttl));this._subRefreshTimeouts[s]=w}}}},{key:"_handleReply",value:function(s,a){var A=s.id,f=s.result;if(!(A in this._callbacks)){a();return}var E=this._callbacks[A];if(clearTimeout(this._callbacks[A].timeout),delete this._callbacks[A],(0,b.errorExists)(s)){var T=E.errback;if(!T){a();return}var w=s.error;T({error:w,next:a})}else{var _=E.callback;if(!_)return;_({result:f,next:a})}}},{key:"_handleJoin",value:function(s,a){var A={info:a.info},f=this._getSub(s);if(!f){this._isServerSub(s)&&(A.channel=s,this.emit("join",A));return}f.emit("join",A)}},{key:"_handleLeave",value:function(s,a){var A={info:a.info},f=this._getSub(s);if(!f){this._isServerSub(s)&&(A.channel=s,this.emit("leave",A));return}f.emit("leave",A)}},{key:"_handleUnsub",value:function(s,a){var A={},f=this._getSub(s);if(!f){this._isServerSub(s)&&(delete this._serverSubs[s],A.channel=s,this.emit("unsubscribe",A));return}f.unsubscribe(),a.resubscribe===!0&&f.subscribe()}},{key:"_handleSub",value:function(s,a){this._serverSubs[s]={seq:a.seq,gen:a.gen,offset:a.offset,epoch:a.epoch,recoverable:a.recoverable};var A={channel:s,isResubscribe:!1};A=this._expandSubscribeContext(A,a),this.emit("subscribe",A)}},{key:"_handlePublication",value:function(s,a){var A=this._getSub(s),f={data:a.data,seq:a.seq,gen:a.gen,offset:a.offset};if(a.info&&(f.info=a.info),!A){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),f.channel=s,this.emit("publish",f));return}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",f)}},{key:"_handleMessage",value:function(s){this.emit("message",s.data)}},{key:"_handlePush",value:function(s,a){var A=this._decoder.decodePush(s),f=0;"type"in A&&(f=A.type);var E=A.channel;if(f===this._pushType.PUBLICATION){var _=this._decoder.decodePushData(this._pushType.PUBLICATION,A.data);this._handlePublication(E,_)}else if(f===this._pushType.MESSAGE){var T=this._decoder.decodePushData(this._pushType.MESSAGE,A.data);this._handleMessage(T)}else if(f===this._pushType.JOIN){var w=this._decoder.decodePushData(this._pushType.JOIN,A.data);this._handleJoin(E,w)}else if(f===this._pushType.LEAVE){var O=this._decoder.decodePushData(this._pushType.LEAVE,A.data);this._handleLeave(E,O)}else if(f===this._pushType.UNSUBSCRIBE){var X=this._decoder.decodePushData(this._pushType.UNSUBSCRIBE,A.data);this._handleUnsub(E,X)}else if(f===this._pushType.SUBSCRIBE){var H=this._decoder.decodePushData(this._pushType.UNSUBSCRIBE,A.data);this._handleSub(E,H)}a()}},{key:"_flush",value:function(){var s=this._messages.slice(0);this._messages=[],this._transportSend(s)}},{key:"_ping",value:function(){var s=this,a={method:this._methodType.PING};this._call(a).then(function(A){s._pingResponse(s._decoder.decodeCommandResult(s._methodType.PING,A.result)),A.next&&A.next()},function(A){s._debug("ping error",A.error),A.next&&A.next()})}},{key:"_pingResponse",value:function(s){this.isConnected()&&(this._stopPing(),this._startPing())}},{key:"_getLastSeq",value:function(s){var a=this._lastSeq[s];return a||0}},{key:"_getLastOffset",value:function(s){var a=this._lastOffset[s];return a||0}},{key:"_getLastGen",value:function(s){var a=this._lastGen[s];return a||0}},{key:"_getLastEpoch",value:function(s){var a=this._lastEpoch[s];return a||""}},{key:"_createErrorObject",value:function(s,a){var A={message:s,code:a||0};return A}},{key:"_registerCall",value:function(s,a,A){var f=this;this._callbacks[s]={callback:a,errback:A,timeout:null},this._callbacks[s].timeout=setTimeout(function(){delete f._callbacks[s],(0,b.isFunction)(A)&&A({error:f._createErrorObject(J)})},this._config.timeout)}},{key:"_addMessage",value:function(s){var a=this._nextMessageId();return s.id=a,this._isBatching===!0?this._messages.push(s):this._transportSend([s]),a}},{key:"isConnected",value:function(){return this._isConnected()}},{key:"connect",value:function(){this._connect()}},{key:"disconnect",value:function(){this._disconnect("client",!1)}},{key:"ping",value:function(){return this._ping()}},{key:"startBatching",value:function(){this._isBatching=!0}},{key:"stopBatching",value:function(){this._isBatching=!1,this._flush()}},{key:"startSubscribeBatching",value:function(){this._isSubscribeBatching=!0}},{key:"stopSubscribeBatching",value:function(){var s=this;this._isSubscribeBatching=!1;var a=this._privateChannels;this._privateChannels={};var A=[];for(var f in a)if(a.hasOwnProperty(f)){var E=this._getSub(f);if(!E)continue;A.push(f)}if(A.length===0){this._debug("no private channels found, no need to make request");return}var _={client:this._clientID,channels:A},T=this._clientID,w=this._newXHRID(),O=function(x){if(w in s._xhrs&&delete s._xhrs[w],s._clientID===T){if(x.error||x.status!==200){s._debug("authorization request failed");for(var ve in A)if(A.hasOwnProperty(ve)){var Xt=A[ve];s._subscribeError(Xt,s._createErrorObject("authorization request failed"))}return}var At={};if(x.data.channels)for(var se in x.data.channels){var Ht=x.data.channels[se];Ht.channel&&(At[Ht.channel]=Ht.token)}var hr=!1;s._isBatching||(s.startBatching(),hr=!0);for(var pr in A)if(A.hasOwnProperty(pr)){var Yi=(function(){var te=A[pr],gr=At[te];if(gr){var Ie={method:s._methodType.SUBSCRIBE,params:{channel:te,token:gr}},yr=s._getSub(te);if(yr===null)return"continue";var mr=yr._needRecover();if(mr===!0){Ie.params.recover=!0;var jt=s._getLastSeq(te),Jt=s._getLastGen(te);if(jt||Jt)jt&&(Ie.params.seq=jt),Jt&&(Ie.params.gen=Jt);else{var Cr=s._getLastOffset(te);Cr&&(Ie.params.offset=Cr)}var br=s._getLastEpoch(te);br&&(Ie.params.epoch=br)}s._call(Ie).then(function(ge){s._subscribeResponse(te,mr,s._decoder.decodeCommandResult(s._methodType.SUBSCRIBE,ge.result)),ge.next&&ge.next()},function(ge){s._subscribeError(te,ge.error),ge.next&&ge.next()})}else return s._subscribeError(te,s._createErrorObject("permission denied",103)),"continue"})();if(Yi==="continue")continue}hr&&s.stopBatching()}};if(this._config.onPrivateSubscribe!==null)this._config.onPrivateSubscribe({data:_},O);else{var X=this._ajax(this._config.subscribeEndpoint,this._config.subscribeParams,this._config.subscribeHeaders,_,O);this._xhrs[w]=X}}},{key:"_setSubscribeSince",value:function(s,a){this._lastOffset[s.channel]=a.offset,this._lastEpoch[s.channel]=a.epoch,s._setNeedRecover(!0)}},{key:"subscribe",value:function(s,a,A){var f=this._getSub(s);if(f!==null)return f._setEvents(a),f._isUnsubscribed()&&f.subscribe(A),f;var E=new y.default(this,s,a);return this._subs[s]=E,E.subscribe(A),E}}]),C})(h.default);u.Centrifuge=v}),579:(function(c,u,l){Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var h=l(382),y=h.Centrifuge;u.default=y,c.exports=u.default}),147:(function(c,u){Object.defineProperty(u,"__esModule",{value:!0}),u.JsonPushType=u.JsonMethodType=u.JsonEncoder=u.JsonDecoder=void 0;function l(Q,S){if(!(Q instanceof S))throw new TypeError("Cannot call a class as a function")}function h(Q,S){for(var P=0;P<S.length;P++){var k=S[P];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(Q,k.key,k)}}function y(Q,S,P){return S&&h(Q.prototype,S),Q}var m={CONNECT:0,SUBSCRIBE:1,UNSUBSCRIBE:2,PUBLISH:3,PRESENCE:4,PRESENCE_STATS:5,HISTORY:6,PING:7,SEND:8,RPC:9,REFRESH:10,SUB_REFRESH:11};u.JsonMethodType=m;var b={PUBLICATION:0,JOIN:1,LEAVE:2,UNSUBSCRIBE:3,MESSAGE:4,SUBSCRIBE:5};u.JsonPushType=b;var I=(function(){function Q(){l(this,Q)}return y(Q,[{key:"encodeCommands",value:function(P){return P.map(function(k){return JSON.stringify(k)}).join(`
|
|
2
|
+
(function(Be,Se){typeof exports=="object"&&typeof module<"u"?module.exports=Se():typeof define=="function"&&define.amd?define(Se):(Be=typeof globalThis<"u"?globalThis:Be||self,Be.ChocoOneClickWidget=Se())})(this,(function(){"use strict";const Be={ru:{paymentMethod:"Способ оплаты",selectMethod:"Выберите метод",pay:"Оплатить",login:"Войти",paymentSuccess:"Оплата прошла успешно!",paymentError:"Ошибка оплаты",paymentMethods:"Способ оплаты",newCard:"Оплата новой картой",balance:"Списать баланс",bonus:"Списать бонусы",bonusText:"Можно оплатить до {amount}%",cashback:"Кешбэк",willGet:"Получите",total:"Итого",instead:"вместо",coupon:"Списать купон",couponSuppressesCashback:"При применении купона бонусы не начисляются",couponUntil:"до {date}",addCard:"Добавление карты",editCards:"Редактировать карты",cardDeleted:"Карта успешно удалена",confirmDeleteCard:"Вы действительно хотите удалить карту?",cancel:"Отмена",delete:"Удалить",back:"Назад",errorMissingTrackClient:"Укажите trackId и clientId",errorNoServerResponseRetry:"Нет ответа от сервера, попробуйте заново",errorNoServerResponse:"Нет ответа от сервера",errorPaymentMethodNotSelected:"Метод оплаты не выбран",errorApplePayUnsupported:"Apple Pay не поддерживается в этом браузере",errorApplePayInit:"Ошибка инициализации Apple Pay",errorApplePayPayment:"Ошибка оплаты через Apple Pay",errorApplePayInterrupted:"Пожалуйста, подтвердите оплату после полной загрузки окна Apple Pay",errorGooglePayUnsupported:"Google Pay не поддерживается в этом браузере",errorGooglePaySettingsUnavailable:"Настройки Google Pay недоступны",errorGooglePayPayment:"Ошибка оплаты через Google Pay",errorActionUrlMissing:"action_url отсутствует в событии order.action_required",errorWidgetInit:"Ошибка инициализации виджета",errorPaymentProcess:"Ошибка оплаты"},en:{paymentMethod:"Payment method",selectMethod:"Select method",pay:"Pay",login:"Sign in",paymentSuccess:"Payment successful!",paymentError:"Payment error",paymentMethods:"Payment method",newCard:"Pay with new card",balance:"Use balance",bonus:"Use bonuses",bonusText:"You can pay up to {amount}%",cashback:"Cashback",willGet:"You will get",total:"Total",instead:"instead",coupon:"Apply coupon",couponSuppressesCashback:"Bonuses are not credited when the coupon is applied",couponUntil:"until {date}",addCard:"Add card",editCards:"Edit cards",cardDeleted:"Card successfully deleted",confirmDeleteCard:"Are you sure you want to delete this card?",cancel:"Cancel",delete:"Delete",back:"Back",errorMissingTrackClient:"Provide trackId and clientId",errorNoServerResponseRetry:"No response from server, please try again",errorNoServerResponse:"No response from server",errorPaymentMethodNotSelected:"Payment method is not selected",errorApplePayUnsupported:"Apple Pay is not supported in this browser",errorApplePayInit:"Apple Pay initialization error",errorApplePayPayment:"Apple Pay payment error",errorApplePayInterrupted:"Please confirm payment after the Apple Pay sheet fully loads",errorGooglePayUnsupported:"Google Pay is not supported in this browser",errorGooglePaySettingsUnavailable:"Google Pay settings are unavailable",errorGooglePayPayment:"Google Pay payment error",errorActionUrlMissing:"action_url is missing in order.action_required event",errorWidgetInit:"Widget initialization error",errorPaymentProcess:"Payment error"},kk:{paymentMethod:"Төлем әдісі",selectMethod:"Әдісті таңдаңыз",pay:"Төлеу",login:"Кіру",paymentSuccess:"Төлем сәтті өтті!",paymentError:"Төлем қатесі",paymentMethods:"Төлем әдісі",newCard:"Жаңа картамен төлеу",balance:"Балансты пайдалану",bonus:"Бонусдарды пайдалану",bonusText:"{amount}%-ге дейін төлеуге болады",cashback:"Кэшбэк",willGet:"Аласыз",total:"Барлығы",instead:"орнына",coupon:"Купонды пайдалану",couponSuppressesCashback:"Купон қолданылғанда бонустар есептелмейді",couponUntil:"{date} дейін",addCard:"Картаны қосу",editCards:"Карталарды өңдеу",cardDeleted:"Карта жойылды",confirmDeleteCard:"Картаны жойғыңыз келетініне сенімдісіз бе?",cancel:"Болдырмау",delete:"Жою",back:"Артқа",errorMissingTrackClient:"trackId пен clientId көрсетіңіз",errorNoServerResponseRetry:"Серверден жауап жоқ, қайтадан көріңіз",errorNoServerResponse:"Серверден жауап жоқ",errorPaymentMethodNotSelected:"Төлем әдісі таңдалмаған",errorApplePayUnsupported:"Бұл браузерде Apple Pay қолдау көрсетілмейді",errorApplePayInit:"Apple Pay инициализация қатесі",errorApplePayPayment:"Apple Pay арқылы төлем қатесі",errorApplePayInterrupted:"Өтінеміз, төлемді Apple Pay терезесі толық жүктелгеннен кейін растаңыз",errorGooglePayUnsupported:"Бұл браузерде Google Pay қолдау көрсетілмейді",errorGooglePaySettingsUnavailable:"Google Pay баптаулары қолжетімсіз",errorGooglePayPayment:"Google Pay арқылы төлем қатесі",errorActionUrlMissing:"order.action_required оқиғасында action_url жоқ",errorWidgetInit:"Виджетті инициализациялау қатесі",errorPaymentProcess:"Төлем қатесі"},ka:{paymentMethod:"გადახდის მეთოდი",selectMethod:"აირჩიეთ მეთოდი",pay:"გადახდა",login:"შესვლა",paymentSuccess:"გადახდა წარმატებით შესრულდა!",paymentError:"გადახდის შეცდომა",paymentMethods:"გადახდის მეთოდი",newCard:"ახალი ბარათით გადახდა",balance:"ბალანსის გამოყენება",bonus:"ბონუსების გამოყენება",bonusText:"{amount}%-ზე გადახდა შესაძლებელია",cashback:"ქეშბექი",willGet:"მიიღებთ",total:"ჯამი",instead:"ნაცვლად",coupon:"კუპონის გამოყენება",couponSuppressesCashback:"კუპონის გამოყენებისას ბონუსები არ დაირიცხება",couponUntil:"{date}-მდე",addCard:"ბარათის დამატება",editCards:"ბარათების რედაქტირება",cardDeleted:"ბარათი წაშლილია",confirmDeleteCard:"დარწმუნებული ხართ, რომ გსურთ ამ ბარათის წაშლა?",cancel:"გაუქმება",delete:"წაშლა",back:"უკან",errorMissingTrackClient:"მიუთითეთ trackId და clientId",errorNoServerResponseRetry:"სერვერის პასუხი არ არის, სცადეთ თავიდან",errorNoServerResponse:"სერვერის პასუხი არ არის",errorPaymentMethodNotSelected:"გადახდის მეთოდი არ არის არჩეული",errorApplePayUnsupported:"ამ ბრაუზერში Apple Pay არ არის მხარდაჭერილი",errorApplePayInit:"Apple Pay-ის ინიციალიზაციის შეცდომა",errorApplePayPayment:"Apple Pay-ით გადახდის შეცდომა",errorApplePayInterrupted:"გთხოვთ, დაადასტუროთ გადახდა Apple Pay-ის ფანჯრის სრულად ჩატვირთვის შემდეგ",errorGooglePayUnsupported:"ამ ბრაუზერში Google Pay არ არის მხარდაჭერილი",errorGooglePaySettingsUnavailable:"Google Pay-ის პარამეტრები მიუწვდომელია",errorGooglePayPayment:"Google Pay-ით გადახდის შეცდომა",errorActionUrlMissing:"order.action_required მოვლენაში action_url არ არის",errorWidgetInit:"ვიჯეტის ინიციალიზაციის შეცდომა",errorPaymentProcess:"გადახდის შეცდომა"}},Se={KZT:"₸",GEL:"₾"};function Er(e){return e==="production"?"https://api-proxy.choco.kz":"https://api-proxy.chocodev.kz"}let Re;const vr=new Uint8Array(16);function Ir(){if(!Re&&(Re=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Re))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Re(vr)}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));function Br(e,t=0){return F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]}const qt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Oe(e,t,n){if(qt.randomUUID&&!e)return qt.randomUUID();e=e||{};const r=e.random||(e.rng||Ir)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Br(r)}const zt="choco_device_id";function Z(e,t="ru",n="KZT"){const r=Number(e),o=t==="ru"?"ru-RU":"en-US";return`${r.toLocaleString(o)} ${Se[n]}`}function Kt(){let e=localStorage.getItem(zt);return e||(e=Oe(),localStorage.setItem(zt,e)),e}function Ne(){if(typeof window>"u")return!1;const e=window.safari!==void 0,t=window.navigator.userAgent||"",n=!!t.match(/iPad/i)||!!t.match(/iPhone/i),r=!!t.match(/WebKit/i),o=n&&r&&!t.match(/CriOS/i);return e||o}function Gt(){if(typeof navigator>"u")return 0;const e=navigator.userAgent||"",t=e.indexOf("OS");return(e.indexOf("iPhone")>-1||e.indexOf("iPad")>-1)&&t>-1?Number(e.substring(t+3,t+6).replace("_",".")):0}function dt(){var i;if(typeof navigator>"u")return"unknown";const e=(navigator.userAgent||navigator.vendor||"").toLowerCase(),t=(navigator.platform||"").toLowerCase(),n=(((i=navigator.userAgentData)==null?void 0:i.platform)||"").toLowerCase(),r=`${e} ${t} ${n}`;return/iphone|ipad|ipod/.test(r)||r.includes("macintosh")&&typeof document<"u"&&"ontouchend"in document?"ios":r.includes("android")?"android":r.includes("windows")?"windows":r.includes("mac")?"macos":"other"}function De(){if(typeof navigator>"u")return!1;const e=navigator.userAgentData;return e!=null&&e.platform&&["iOS","iPadOS"].includes(e.platform)||dt()==="ios"?!0:(navigator.userAgent||"").includes("Macintosh")&&typeof document<"u"&&"ontouchend"in document}function Me(e){if(typeof sessionStorage>"u")return!1;const t=e==="apple_pay"?"disableApplePay":e==="google_pay"?"disableGooglePay":null;return t?sessionStorage.getItem(t)==="true":!1}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xe={exports:{}},_r=xe.exports,Wt;function Qr(){return Wt||(Wt=1,(function(e,t){(function(r,o){e.exports=o()})(_r,function(){return(function(){var n={382:(function(c,u,l){Object.defineProperty(u,"__esModule",{value:!0}),u.Centrifuge=void 0;var h=I(l(187)),y=I(l(471)),m=l(147),b=l(853);function I(g){return g&&g.__esModule?g:{default:g}}function B(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(C){return typeof C}:B=function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},B(g)}function Q(g,p){if(!(g instanceof p))throw new TypeError("Cannot call a class as a function")}function S(g,p){for(var C=0;C<p.length;C++){var d=p[C];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(g,d.key,d)}}function P(g,p,C){return p&&S(g.prototype,p),g}function k(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(p&&p.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),p&&R(g,p)}function R(g,p){return R=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d},R(g,p)}function L(g){var p=G();return function(){var d=K(g),s;if(p){var a=K(this).constructor;s=Reflect.construct(d,arguments,a)}else s=d.apply(this,arguments);return z(this,s)}}function z(g,p){if(p&&(B(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return D(g)}function D(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function G(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function K(g){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},K(g)}var J="timeout",M="connection closed",v=(function(g){k(C,g);var p=L(C);function C(d,s){var a;return Q(this,C),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={protocol:"",debug:!1,name:"js",version:"",websocket:null,sockjs:null,xmlhttprequest:null,minRetry:1e3,maxRetry:2e4,timeout:5e3,ping:!0,pingInterval:25e3,pongWaitTimeout:5e3,privateChannelPrefix:"$",onTransportClose:null,sockjsServer:null,sockjsTimeout:null,sockjsTransports:["websocket","xdr-streaming","xhr-streaming","eventsource","iframe-eventsource","iframe-htmlfile","xdr-polling","xhr-polling","iframe-xhr-polling","jsonp-polling"],refreshEndpoint:"/centrifuge/refresh",refreshHeaders:{},refreshParams:{},refreshData:{},refreshAttempts:null,refreshInterval:1e3,onRefreshFailed:null,onRefresh:null,subscribeEndpoint:"/centrifuge/subscribe",subscribeHeaders:{},subscribeParams:{},subRefreshInterval:1e3,onPrivateSubscribe:null,disableWithCredentials:!1},a._configure(s),a}return P(C,[{key:"setToken",value:function(s){this._token=s}},{key:"setConnectData",value:function(s){this._connectData=s}},{key:"setRefreshHeaders",value:function(s){this._config.refreshHeaders=s}},{key:"setRefreshParams",value:function(s){this._config.refreshParams=s}},{key:"setRefreshData",value:function(s){this._config.refreshData=s}},{key:"setSubscribeHeaders",value:function(s){this._config.subscribeHeaders=s}},{key:"setSubscribeParams",value:function(s){this._config.subscribeParams=s}},{key:"_ajax",value:function(s,a,A,f,E){var _=this,T="";this._debug("sending AJAX request to",s,"with data",JSON.stringify(f));var w;this._xmlhttprequest!==null?w=new this._xmlhttprequest:w=l.g.XMLHttpRequest?new l.g.XMLHttpRequest:new l.g.ActiveXObject("Microsoft.XMLHTTP");for(var O in a)a.hasOwnProperty(O)&&(T.length>0&&(T+="&"),T+=encodeURIComponent(O)+"="+encodeURIComponent(a[O]));T.length>0&&(T="?"+T),w.open("POST",s+T,!0),"withCredentials"in w&&(w.withCredentials=!this._config.disableWithCredentials),w.setRequestHeader("X-Requested-With","XMLHttpRequest"),w.setRequestHeader("Content-Type","application/json");for(var X in A)A.hasOwnProperty(X)&&w.setRequestHeader(X,A[X]);return w.onreadystatechange=function(){if(w.readyState===4)if(w.status===200){var H,x=!1;try{H=JSON.parse(w.responseText),x=!0}catch{E({error:"Invalid JSON. Data was: "+w.responseText,status:200,data:null})}x&&E({data:H,status:200})}else _._log("wrong status code in AJAX response",w.status),E({status:w.status,data:null})},setTimeout(function(){return w.send(JSON.stringify(f))},20),w}},{key:"_log",value:function(){(0,b.log)("info",arguments)}},{key:"_debug",value:function(){this._config.debug===!0&&(0,b.log)("debug",arguments)}},{key:"_websocketSupported",value:function(){return this._config.websocket!==null?!0:!(typeof WebSocket!="function"&&(typeof WebSocket>"u"?"undefined":B(WebSocket))!=="object")}},{key:"_setFormat",value:function(s){if(!this._formatOverride(s)){if(s==="protobuf")throw new Error("not implemented by JSON only Centrifuge client – use client with Protobuf");this._binary=!1,this._methodType=m.JsonMethodType,this._pushType=m.JsonPushType,this._encoder=new m.JsonEncoder,this._decoder=new m.JsonDecoder}}},{key:"_formatOverride",value:function(s){return!1}},{key:"_configure",value:function(s){if(!("Promise"in l.g))throw new Error("Promise polyfill required");if((0,b.extend)(this._config,s||{}),this._debug("centrifuge config",this._config),!this._url)throw new Error("url required");var a=(0,b.startsWith)(this._url,"ws")&&this._url.indexOf("format=protobuf")>-1;if(a||this._config.protocol==="protobuf")this._setFormat("protobuf"),this._protocol="protobuf";else{if(this._config.protocol!==""&&this._config.protocol!=="json")throw new Error("unsupported protocol "+this._config.protocol);this._setFormat("json")}if((0,b.startsWith)(this._url,"http"))if(this._debug("client will try to connect to SockJS endpoint"),this._config.sockjs!==null)this._debug("SockJS explicitly provided in options"),this._sockjs=this._config.sockjs;else{if(typeof l.g.SockJS>"u")throw new Error("SockJS not found, use ws:// in url or include SockJS");this._debug("use globally defined SockJS"),this._sockjs=l.g.SockJS}else this._debug("client will connect to websocket endpoint");this._xmlhttprequest=this._config.xmlhttprequest}},{key:"_setStatus",value:function(s){this._status!==s&&(this._debug("Status",this._status,"->",s),this._status=s)}},{key:"_isDisconnected",value:function(){return this._status==="disconnected"}},{key:"_isConnecting",value:function(){return this._status==="connecting"}},{key:"_isConnected",value:function(){return this._status==="connected"}},{key:"_nextMessageId",value:function(){return++this._messageId}},{key:"_resetRetry",value:function(){this._debug("reset retries count to 0"),this._retries=0}},{key:"_getRetryInterval",value:function(){var s=(0,b.backoff)(this._retries,this._config.minRetry,this._config.maxRetry);return this._retries+=1,s}},{key:"_abortInflightXHRs",value:function(){for(var s in this._xhrs){try{this._xhrs[s].abort()}catch(a){this._debug("error aborting xhr",a)}delete this._xhrs[s]}}},{key:"_clearConnectedState",value:function(s){this._clientID=null,this._stopPing();for(var a in this._callbacks)if(this._callbacks.hasOwnProperty(a)){var A=this._callbacks[a];clearTimeout(A.timeout);var f=A.errback;if(!f)continue;f({error:this._createErrorObject("disconnected")})}this._callbacks={};for(var E in this._subs)if(this._subs.hasOwnProperty(E)){var _=this._subs[E];s?(_._isSuccess()&&(_._triggerUnsubscribe(),_._recover=!0),_._shouldResubscribe()&&_._setSubscribing()):_._setUnsubscribed()}this._abortInflightXHRs(),this._refreshTimeout!==null&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);for(var T in this._subRefreshTimeouts)this._subRefreshTimeouts.hasOwnProperty(T)&&this._subRefreshTimeouts[T]&&this._clearSubRefreshTimeout(T);this._subRefreshTimeouts={},this._reconnect||(this._subs={})}},{key:"_isTransportOpen",value:function(){return this._isSockjs?this._transport&&this._transport.transport&&this._transport.transport.readyState===this._transport.transport.OPEN:this._transport&&this._transport.readyState===this._transport.OPEN}},{key:"_transportSend",value:function(s){if(!s.length)return!0;if(!this._isTransportOpen()){for(var a in s){var A=a.id;if(A in this._callbacks){var f=this._callbacks[A];clearTimeout(this._callbacks[A].timeout),delete this._callbacks[A];var E=f.errback;E({error:this._createErrorObject(M,0)})}}return!1}return this._transport.send(this._encoder.encodeCommands(s)),!0}},{key:"_getSubProtocol",value:function(){return this._protocol?"centrifuge-"+this._protocol:""}},{key:"_setupTransport",value:function(){var s=this;if(this._isSockjs=!1,this._sockjs!==null){var a={transports:this._config.sockjsTransports};this._config.sockjsServer!==null&&(a.server=this._config.sockjsServer),this._config.sockjsTimeout!==null&&(a.timeout=this._config.sockjsTimeout),this._isSockjs=!0,this._transport=new this._sockjs(this._url,null,a)}else{if(!this._websocketSupported())throw this._debug("No Websocket support and no SockJS configured, can not connect"),new Error("No Websocket support and no SockJS configured, can not connect");this._config.websocket!==null?this._websocket=this._config.websocket:this._websocket=WebSocket;var A=this._getSubProtocol();A!==""?this._transport=new this._websocket(this._url,A):this._transport=new this._websocket(this._url),this._binary===!0&&(this._transport.binaryType="arraybuffer")}this._transport.onopen=function(){s._transportClosed=!1,s._isSockjs?(s._transportName="sockjs-"+s._transport.transport,s._transport.onheartbeat=function(){return s._restartPing()}):s._transportName="websocket";var f={};(s._token||s._connectData||s._config.name||s._config.version)&&(f.params={}),s._token&&(f.params.token=s._token),s._connectData&&(f.params.data=s._connectData),s._config.name&&(f.params.name=s._config.name),s._config.version&&(f.params.version=s._config.version);var E={},_=!1;for(var T in s._serverSubs)if(s._serverSubs.hasOwnProperty(T)&&s._serverSubs[T].recoverable){_=!0;var w={recover:!0};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}_&&(f.params||(f.params={}),f.params.subs=E),s._latencyStart=new Date,s._call(f).then(function(O){s._connectResponse(s._decoder.decodeCommandResult(s._methodType.CONNECT,O.result),_),O.next&&O.next()},function(O){var X=O.error;X.code===109&&(s._refreshRequired=!0),s._disconnect("connect error",!0),O.next&&O.next()})},this._transport.onerror=function(f){s._debug("transport level error",f)},this._transport.onclose=function(f){s._transportClosed=!0;var E=M,_=!0;if(f&&"reason"in f&&f.reason)try{var T=JSON.parse(f.reason);s._debug("reason is an advice object",T),E=T.reason,_=T.reconnect}catch{E=f.reason,s._debug("reason is a plain string",E)}if(s._config.onTransportClose!==null&&s._config.onTransportClose({event:f,reason:E,reconnect:_}),s._disconnect(E,_),s._reconnect===!0){s._reconnecting=!0;var w=s._getRetryInterval();s._debug("reconnect after "+w+" milliseconds"),setTimeout(function(){s._reconnect===!0&&(s._refreshRequired?s._refresh():s._connect())},w)}},this._transport.onmessage=function(f){s._dataReceived(f.data)}}},{key:"rpc",value:function(s){return this._rpc("",s)}},{key:"namedRPC",value:function(s,a){return this._rpc(s,a)}},{key:"_rpc",value:function(s,a){var A={data:a};s!==""&&(A.method=s);var f={method:this._methodType.RPC,params:A};return this._methodCall(f,function(E){return E})}},{key:"send",value:function(s){var a={method:this._methodType.SEND,params:{data:s}};if(!this.isConnected())return Promise.reject(this._createErrorObject(M,0));var A=this._transportSend([a]);return A?Promise.resolve({}):Promise.reject(this._createErrorObject(M,0))}},{key:"_getHistoryParams",value:function(s,a){var A={channel:s};return a!==void 0&&(a.since&&(A.since={offset:a.since.offset},a.since.epoch&&(A.since.epoch=a.since.epoch)),a.limit!==void 0&&(A.limit=a.limit),a.reverse===!0&&(A.reverse=!0)),A}},{key:"_methodCall",value:function(s,a){var A=this;return this.isConnected()?new Promise(function(f,E){A._call(s).then(function(_){f(a(A._decoder.decodeCommandResult(s.method,_.result))),_.next&&_.next()},function(_){E(_.error),_.next&&_.next()})}):Promise.reject(this._createErrorObject(M,0))}},{key:"publish",value:function(s,a){var A={method:this._methodType.PUBLISH,params:{channel:s,data:a}};return this._methodCall(A,function(){return{}})}},{key:"history",value:function(s,a){var A=this._getHistoryParams(s,a),f={method:this._methodType.HISTORY,params:A};return this._methodCall(f,function(E){return{publications:E.publications,epoch:E.epoch||"",offset:E.offset||0}})}},{key:"presence",value:function(s){var a={method:this._methodType.PRESENCE,params:{channel:s}};return this._methodCall(a,function(A){return{presence:A.presence}})}},{key:"presenceStats",value:function(s){var a={method:this._methodType.PRESENCE_STATS,params:{channel:s}};return this._methodCall(a,function(A){return{num_users:A.num_users,num_clients:A.num_clients}})}},{key:"_dataReceived",value:function(s){var a=this,A=this._decoder.decodeReplies(s);this._dispatchPromise=this._dispatchPromise.then(function(){var f;a._dispatchPromise=new Promise(function(E){f=E}),a._dispatchSynchronized(A,f)}),this._restartPing()}},{key:"_dispatchSynchronized",value:function(s,a){var A=this,f=Promise.resolve(),E=function(w){s.hasOwnProperty(w)&&(f=f.then(function(){return A._dispatchReply(s[w])}))};for(var _ in s)E(_);f=f.then(function(){a()})}},{key:"_dispatchReply",value:function(s){var a,A=new Promise(function(E){a=E});if(s==null)return this._debug("dispatch: got undefined or null reply"),a(),A;var f=s.id;return f&&f>0?this._handleReply(s,a):this._handlePush(s.result,a),A}},{key:"_call",value:function(s){var a=this;return new Promise(function(A,f){var E=a._addMessage(s);a._registerCall(E,A,f)})}},{key:"_connect",value:function(){if(this.isConnected()){this._debug("connect called when already connected");return}this._status!=="connecting"&&(this._debug("start connecting"),this._setStatus("connecting"),this._clientID=null,this._reconnect=!0,this._setupTransport())}},{key:"_disconnect",value:function(s,a){var A=a||!1;if(A===!1&&(this._reconnect=!1),this._isDisconnected()){A||this._clearConnectedState(A);return}if(this._clearConnectedState(A),this._debug("disconnected:",s,a),this._setStatus("disconnected"),this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),this._reconnecting===!1){for(var f in this._serverSubs)this._serverSubs.hasOwnProperty(f)&&this.emit("unsubscribe",{channel:f});this.emit("disconnect",{reason:s,reconnect:A})}A===!1&&(this._subs={},this._serverSubs={}),this._transportClosed||this._transport.close()}},{key:"_refreshFailed",value:function(){this._numRefreshFailed=0,this._isDisconnected()||this._disconnect("refresh failed",!1),this._config.onRefreshFailed!==null&&this._config.onRefreshFailed()}},{key:"_refresh",value:function(){var s=this;if(this._debug("refresh token"),this._config.refreshAttempts===0){this._debug("refresh attempts set to 0, do not send refresh request at all"),this._refreshFailed();return}this._refreshTimeout!==null&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);var a=this._clientID,A=this._newXHRID(),f=function(w){if(A in s._xhrs&&delete s._xhrs[A],s._clientID===a){if(w.error||w.status!==200){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){s._refreshFailed();return}var O=Math.round(Math.random()*1e3*Math.max(s._numRefreshFailed,20)),X=s._config.refreshInterval+O;s._refreshTimeout=setTimeout(function(){return s._refresh()},X);return}if(s._numRefreshFailed=0,s._token=w.data.token,!s._token){s._refreshFailed();return}if(s._isDisconnected()&&s._reconnect)s._debug("token refreshed, connect from scratch"),s._connect();else{s._debug("send refreshed token");var H={method:s._methodType.REFRESH,params:{token:s._token}};s._call(H).then(function(x){s._refreshResponse(s._decoder.decodeCommandResult(s._methodType.REFRESH,x.result)),x.next&&x.next()},function(x){s._refreshError(x.error),x.next&&x.next()})}}};if(this._config.onRefresh!==null){var E={};this._config.onRefresh(E,f)}else{var _=this._ajax(this._config.refreshEndpoint,this._config.refreshParams,this._config.refreshHeaders,this._config.refreshData,f);this._xhrs[A]=_}}},{key:"_refreshError",value:function(s){var a=this;this._debug("refresh error",s),this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null);var A=this._config.refreshInterval+Math.round(Math.random()*1e3);this._refreshTimeout=setTimeout(function(){return a._refresh()},A)}},{key:"_refreshResponse",value:function(s){var a=this;this._refreshTimeout&&(clearTimeout(this._refreshTimeout),this._refreshTimeout=null),s.expires&&(this._clientID=s.client,this._refreshTimeout=setTimeout(function(){return a._refresh()},this._getTTLMilliseconds(s.ttl)))}},{key:"_newXHRID",value:function(){return this._xhrID++,this._xhrID}},{key:"_subRefresh",value:function(s){var a=this;if(this._debug("refresh subscription token for channel",s),this._subRefreshTimeouts[s]!==void 0)this._clearSubRefreshTimeout(s);else return;var A=this._clientID,f=this._newXHRID(),E=function(O){if(f in a._xhrs&&delete a._xhrs[f],!(O.error||O.status!==200||a._clientID!==A)){var X={};if(O.data.channels)for(var H in O.data.channels){var x=O.data.channels[H];x.channel&&(X[x.channel]=x.token)}var ve=X[s];if(ve){var Xt={method:a._methodType.SUB_REFRESH,params:{channel:s,token:ve}},At=a._getSub(s);At!==null&&a._call(Xt).then(function(se){a._subRefreshResponse(s,a._decoder.decodeCommandResult(a._methodType.SUB_REFRESH,se.result)),se.next&&se.next()},function(se){a._subRefreshError(s,se.error),se.next&&se.next()})}}},_={client:this._clientID,channels:[s]};if(this._config.onPrivateSubscribe!==null)this._config.onPrivateSubscribe({data:_},E);else{var T=this._ajax(this._config.subscribeEndpoint,this._config.subscribeParams,this._config.subscribeHeaders,_,E);this._xhrs[f]=T}}},{key:"_clearSubRefreshTimeout",value:function(s){this._subRefreshTimeouts[s]!==void 0&&(clearTimeout(this._subRefreshTimeouts[s]),delete this._subRefreshTimeouts[s])}},{key:"_subRefreshError",value:function(s,a){var A=this;this._debug("subscription refresh error",s,a),this._clearSubRefreshTimeout(s);var f=this._getSub(s);if(f!==null){var E=Math.round(Math.random()*1e3),_=setTimeout(function(){return A._subRefresh(s)},this._config.subRefreshInterval+E);this._subRefreshTimeouts[s]=_}}},{key:"_subRefreshResponse",value:function(s,a){var A=this;this._debug("subscription refresh success",s),this._clearSubRefreshTimeout(s);var f=this._getSub(s);if(f!==null&&a.expires===!0){var E=setTimeout(function(){return A._subRefresh(s)},this._getTTLMilliseconds(a.ttl));this._subRefreshTimeouts[s]=E}}},{key:"_subscribe",value:function(s,a){var A=this;this._debug("subscribing on",s.channel);var f=s.channel;if(f in this._subs||(this._subs[f]=s),!this.isConnected()){s._setNew();return}s._setSubscribing(a);var E={method:this._methodType.SUBSCRIBE,params:{channel:f}};if(s._subscribeData&&(E.params.data=s._subscribeData),(0,b.startsWith)(f,this._config.privateChannelPrefix))this._isSubscribeBatching?this._privateChannels[f]=!0:(this.startSubscribeBatching(),this._subscribe(s),this.stopSubscribeBatching());else{var _=s._needRecover();if(_===!0){E.params.recover=!0;var T=this._getLastSeq(f),w=this._getLastGen(f);if(T||w)T&&(E.params.seq=T),w&&(E.params.gen=w);else{var O=this._getLastOffset(f);O&&(E.params.offset=O)}var X=this._getLastEpoch(f);X&&(E.params.epoch=X)}this._call(E).then(function(H){A._subscribeResponse(f,_,A._decoder.decodeCommandResult(A._methodType.SUBSCRIBE,H.result)),H.next&&H.next()},function(H){A._subscribeError(f,H.error),H.next&&H.next()})}}},{key:"_unsubscribe",value:function(s){delete this._subs[s.channel],delete this._lastOffset[s.channel],delete this._lastSeq[s.channel],delete this._lastGen[s.channel],this.isConnected()&&this._addMessage({method:this._methodType.UNSUBSCRIBE,params:{channel:s.channel}})}},{key:"_getTTLMilliseconds",value:function(s){return Math.min(s*1e3,2147483647)}},{key:"getSub",value:function(s){return this._getSub(s)}},{key:"_getSub",value:function(s){var a=this._subs[s];return a||null}},{key:"_isServerSub",value:function(s){return this._serverSubs[s]!==void 0}},{key:"_connectResponse",value:function(s,a){var A=this,f=this._reconnecting;if(this._reconnecting=!1,this._resetRetry(),this._refreshRequired=!1,!this.isConnected()){this._latencyStart!==null&&(this._latency=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(){return A._refresh()},this._getTTLMilliseconds(s.ttl))),this.startBatching(),this.startSubscribeBatching();for(var E in this._subs)if(this._subs.hasOwnProperty(E)){var _=this._subs[E];_._shouldResubscribe()&&this._subscribe(_,f)}this.stopSubscribeBatching(),this.stopBatching(),this._startPing();var T={client:s.client,transport:this._transportName,latency:this._latency};s.data&&(T.data=s.data),this.emit("connect",T),s.subs&&this._processServerSubs(s.subs)}}},{key:"_processServerSubs",value:function(s){for(var a in s)if(s.hasOwnProperty(a)){var A=s[a],f=this._serverSubs[a]!==void 0,E={channel:a,isResubscribe:f};E=this._expandSubscribeContext(E,A),this.emit("subscribe",E)}for(var _ in s)if(s.hasOwnProperty(_)){var T=s[_];if(T.recovered){var w=T.publications;if(w&&w.length>0){w.length>1&&(!w[0].offset||w[0].offset>w[1].offset)&&(w=w.reverse());for(var O in w)w.hasOwnProperty(O)&&this._handlePublication(_,w[O])}}this._serverSubs[_]={seq:T.seq,gen:T.gen,offset:T.offset,epoch:T.epoch,recoverable:T.recoverable}}}},{key:"_stopPing",value:function(){this._pongTimeout!==null&&(clearTimeout(this._pongTimeout),this._pongTimeout=null),this._pingTimeout!==null&&(clearTimeout(this._pingTimeout),this._pingTimeout=null)}},{key:"_startPing",value:function(){var s=this;this._config.ping!==!0||this._config.pingInterval<=0||this.isConnected()&&(this._pingTimeout=setTimeout(function(){if(!s.isConnected()){s._stopPing();return}s.ping(),s._pongTimeout=setTimeout(function(){s._disconnect("no ping",!0)},s._config.pongWaitTimeout)},this._config.pingInterval))}},{key:"_restartPing",value:function(){this._stopPing(),this._startPing()}},{key:"_subscribeError",value:function(s,a){var A=this._getSub(s);if(A&&A._isSubscribing()){if(a.code===0&&a.message===J){this._disconnect("timeout",!0);return}A._setSubscribeError(a)}}},{key:"_expandSubscribeContext",value:function(s,a){var A=!1;"recovered"in a&&(A=a.recovered),s.recovered=A;var f=!1;"positioned"in a&&(f=a.positioned);var E="";"epoch"in a&&(E=a.epoch);var _=0;return"offset"in a&&(_=a.offset),f&&(s.streamPosition={offset:_,epoch:E}),a.data&&(s.data=a.data),s}},{key:"_subscribeResponse",value:function(s,a,A){var f=this,E=this._getSub(s);if(E&&E._isSubscribing()){E._setSubscribeSuccess(A);var _=A.publications;if(_&&_.length>0){_.length>=2&&!_[0].offset&&!_[1].offset&&(_=_.reverse());for(var T in _)_.hasOwnProperty(T)&&this._handlePublication(s,_[T])}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){var w=setTimeout(function(){return f._subRefresh(s)},this._getTTLMilliseconds(A.ttl));this._subRefreshTimeouts[s]=w}}}},{key:"_handleReply",value:function(s,a){var A=s.id,f=s.result;if(!(A in this._callbacks)){a();return}var E=this._callbacks[A];if(clearTimeout(this._callbacks[A].timeout),delete this._callbacks[A],(0,b.errorExists)(s)){var T=E.errback;if(!T){a();return}var w=s.error;T({error:w,next:a})}else{var _=E.callback;if(!_)return;_({result:f,next:a})}}},{key:"_handleJoin",value:function(s,a){var A={info:a.info},f=this._getSub(s);if(!f){this._isServerSub(s)&&(A.channel=s,this.emit("join",A));return}f.emit("join",A)}},{key:"_handleLeave",value:function(s,a){var A={info:a.info},f=this._getSub(s);if(!f){this._isServerSub(s)&&(A.channel=s,this.emit("leave",A));return}f.emit("leave",A)}},{key:"_handleUnsub",value:function(s,a){var A={},f=this._getSub(s);if(!f){this._isServerSub(s)&&(delete this._serverSubs[s],A.channel=s,this.emit("unsubscribe",A));return}f.unsubscribe(),a.resubscribe===!0&&f.subscribe()}},{key:"_handleSub",value:function(s,a){this._serverSubs[s]={seq:a.seq,gen:a.gen,offset:a.offset,epoch:a.epoch,recoverable:a.recoverable};var A={channel:s,isResubscribe:!1};A=this._expandSubscribeContext(A,a),this.emit("subscribe",A)}},{key:"_handlePublication",value:function(s,a){var A=this._getSub(s),f={data:a.data,seq:a.seq,gen:a.gen,offset:a.offset};if(a.info&&(f.info=a.info),!A){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),f.channel=s,this.emit("publish",f));return}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",f)}},{key:"_handleMessage",value:function(s){this.emit("message",s.data)}},{key:"_handlePush",value:function(s,a){var A=this._decoder.decodePush(s),f=0;"type"in A&&(f=A.type);var E=A.channel;if(f===this._pushType.PUBLICATION){var _=this._decoder.decodePushData(this._pushType.PUBLICATION,A.data);this._handlePublication(E,_)}else if(f===this._pushType.MESSAGE){var T=this._decoder.decodePushData(this._pushType.MESSAGE,A.data);this._handleMessage(T)}else if(f===this._pushType.JOIN){var w=this._decoder.decodePushData(this._pushType.JOIN,A.data);this._handleJoin(E,w)}else if(f===this._pushType.LEAVE){var O=this._decoder.decodePushData(this._pushType.LEAVE,A.data);this._handleLeave(E,O)}else if(f===this._pushType.UNSUBSCRIBE){var X=this._decoder.decodePushData(this._pushType.UNSUBSCRIBE,A.data);this._handleUnsub(E,X)}else if(f===this._pushType.SUBSCRIBE){var H=this._decoder.decodePushData(this._pushType.UNSUBSCRIBE,A.data);this._handleSub(E,H)}a()}},{key:"_flush",value:function(){var s=this._messages.slice(0);this._messages=[],this._transportSend(s)}},{key:"_ping",value:function(){var s=this,a={method:this._methodType.PING};this._call(a).then(function(A){s._pingResponse(s._decoder.decodeCommandResult(s._methodType.PING,A.result)),A.next&&A.next()},function(A){s._debug("ping error",A.error),A.next&&A.next()})}},{key:"_pingResponse",value:function(s){this.isConnected()&&(this._stopPing(),this._startPing())}},{key:"_getLastSeq",value:function(s){var a=this._lastSeq[s];return a||0}},{key:"_getLastOffset",value:function(s){var a=this._lastOffset[s];return a||0}},{key:"_getLastGen",value:function(s){var a=this._lastGen[s];return a||0}},{key:"_getLastEpoch",value:function(s){var a=this._lastEpoch[s];return a||""}},{key:"_createErrorObject",value:function(s,a){var A={message:s,code:a||0};return A}},{key:"_registerCall",value:function(s,a,A){var f=this;this._callbacks[s]={callback:a,errback:A,timeout:null},this._callbacks[s].timeout=setTimeout(function(){delete f._callbacks[s],(0,b.isFunction)(A)&&A({error:f._createErrorObject(J)})},this._config.timeout)}},{key:"_addMessage",value:function(s){var a=this._nextMessageId();return s.id=a,this._isBatching===!0?this._messages.push(s):this._transportSend([s]),a}},{key:"isConnected",value:function(){return this._isConnected()}},{key:"connect",value:function(){this._connect()}},{key:"disconnect",value:function(){this._disconnect("client",!1)}},{key:"ping",value:function(){return this._ping()}},{key:"startBatching",value:function(){this._isBatching=!0}},{key:"stopBatching",value:function(){this._isBatching=!1,this._flush()}},{key:"startSubscribeBatching",value:function(){this._isSubscribeBatching=!0}},{key:"stopSubscribeBatching",value:function(){var s=this;this._isSubscribeBatching=!1;var a=this._privateChannels;this._privateChannels={};var A=[];for(var f in a)if(a.hasOwnProperty(f)){var E=this._getSub(f);if(!E)continue;A.push(f)}if(A.length===0){this._debug("no private channels found, no need to make request");return}var _={client:this._clientID,channels:A},T=this._clientID,w=this._newXHRID(),O=function(x){if(w in s._xhrs&&delete s._xhrs[w],s._clientID===T){if(x.error||x.status!==200){s._debug("authorization request failed");for(var ve in A)if(A.hasOwnProperty(ve)){var Xt=A[ve];s._subscribeError(Xt,s._createErrorObject("authorization request failed"))}return}var At={};if(x.data.channels)for(var se in x.data.channels){var Ht=x.data.channels[se];Ht.channel&&(At[Ht.channel]=Ht.token)}var hr=!1;s._isBatching||(s.startBatching(),hr=!0);for(var pr in A)if(A.hasOwnProperty(pr)){var Yi=(function(){var te=A[pr],gr=At[te];if(gr){var Ie={method:s._methodType.SUBSCRIBE,params:{channel:te,token:gr}},yr=s._getSub(te);if(yr===null)return"continue";var mr=yr._needRecover();if(mr===!0){Ie.params.recover=!0;var jt=s._getLastSeq(te),Jt=s._getLastGen(te);if(jt||Jt)jt&&(Ie.params.seq=jt),Jt&&(Ie.params.gen=Jt);else{var Cr=s._getLastOffset(te);Cr&&(Ie.params.offset=Cr)}var br=s._getLastEpoch(te);br&&(Ie.params.epoch=br)}s._call(Ie).then(function(ge){s._subscribeResponse(te,mr,s._decoder.decodeCommandResult(s._methodType.SUBSCRIBE,ge.result)),ge.next&&ge.next()},function(ge){s._subscribeError(te,ge.error),ge.next&&ge.next()})}else return s._subscribeError(te,s._createErrorObject("permission denied",103)),"continue"})();if(Yi==="continue")continue}hr&&s.stopBatching()}};if(this._config.onPrivateSubscribe!==null)this._config.onPrivateSubscribe({data:_},O);else{var X=this._ajax(this._config.subscribeEndpoint,this._config.subscribeParams,this._config.subscribeHeaders,_,O);this._xhrs[w]=X}}},{key:"_setSubscribeSince",value:function(s,a){this._lastOffset[s.channel]=a.offset,this._lastEpoch[s.channel]=a.epoch,s._setNeedRecover(!0)}},{key:"subscribe",value:function(s,a,A){var f=this._getSub(s);if(f!==null)return f._setEvents(a),f._isUnsubscribed()&&f.subscribe(A),f;var E=new y.default(this,s,a);return this._subs[s]=E,E.subscribe(A),E}}]),C})(h.default);u.Centrifuge=v}),579:(function(c,u,l){Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var h=l(382),y=h.Centrifuge;u.default=y,c.exports=u.default}),147:(function(c,u){Object.defineProperty(u,"__esModule",{value:!0}),u.JsonPushType=u.JsonMethodType=u.JsonEncoder=u.JsonDecoder=void 0;function l(Q,S){if(!(Q instanceof S))throw new TypeError("Cannot call a class as a function")}function h(Q,S){for(var P=0;P<S.length;P++){var k=S[P];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(Q,k.key,k)}}function y(Q,S,P){return S&&h(Q.prototype,S),Q}var m={CONNECT:0,SUBSCRIBE:1,UNSUBSCRIBE:2,PUBLISH:3,PRESENCE:4,PRESENCE_STATS:5,HISTORY:6,PING:7,SEND:8,RPC:9,REFRESH:10,SUB_REFRESH:11};u.JsonMethodType=m;var b={PUBLICATION:0,JOIN:1,LEAVE:2,UNSUBSCRIBE:3,MESSAGE:4,SUBSCRIBE:5};u.JsonPushType=b;var I=(function(){function Q(){l(this,Q)}return y(Q,[{key:"encodeCommands",value:function(P){return P.map(function(k){return JSON.stringify(k)}).join(`
|
|
3
3
|
`)}}]),Q})();u.JsonEncoder=I;var B=(function(){function Q(){l(this,Q)}return y(Q,[{key:"decodeReplies",value:function(P){return P.split(`
|
|
4
4
|
`).filter(function(k){return k!==""}).map(function(k){return JSON.parse(k)})}},{key:"decodeCommandResult",value:function(P,k){return k}},{key:"decodePush",value:function(P){return P}},{key:"decodePushData",value:function(P,k){return k}}]),Q})();u.JsonDecoder=B}),471:(function(c,u,l){function h(p){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?h=function(d){return typeof d}:h=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},h(p)}Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0;var y=b(l(187)),m=l(853);function b(p){return p&&p.__esModule?p:{default:p}}function I(p,C){if(!(p instanceof C))throw new TypeError("Cannot call a class as a function")}function B(p,C){for(var d=0;d<C.length;d++){var s=C[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(p,s.key,s)}}function Q(p,C,d){return C&&B(p.prototype,C),p}function S(p,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(C&&C.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),C&&P(p,C)}function P(p,C){return P=Object.setPrototypeOf||function(s,a){return s.__proto__=a,s},P(p,C)}function k(p){var C=z();return function(){var s=D(p),a;if(C){var A=D(this).constructor;a=Reflect.construct(s,arguments,A)}else a=s.apply(this,arguments);return R(this,a)}}function R(p,C){if(C&&(h(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return L(p)}function L(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function D(p){return D=Object.setPrototypeOf?Object.getPrototypeOf:function(d){return d.__proto__||Object.getPrototypeOf(d)},D(p)}var G=0,K=1,J=2,M=3,v=4,g=(function(p){S(d,p);var C=k(d);function d(s,a,A){var f;return I(this,d),f=C.call(this),f.channel=a,f._centrifuge=s,f._status=G,f._error=null,f._isResubscribe=!1,f._ready=!1,f._subscriptionPromise=null,f._noResubscribe=!1,f._recoverable=!1,f._recover=!1,f._setEvents(A),f._initializePromise(),f._promises={},f._promiseId=0,f._subscribeData=null,f.on("error",function(E){this._centrifuge._debug("subscription error",E)}),f}return Q(d,[{key:"_nextPromiseId",value:function(){return++this._promiseId}},{key:"_initializePromise",value:function(){var a=this;this._ready=!1,this._subscriptionPromise=new Promise(function(A,f){a._resolve=function(E){a._ready=!0,A(E)},a._reject=function(E){a._ready=!0,f(E)}}).then(function(){},function(){})}},{key:"_setNeedRecover",value:function(a){this._recoverable=a,this._recover=a}},{key:"_needRecover",value:function(){return this._recoverable===!0&&this._recover===!0}},{key:"_setEvents",value:function(a){if(a){if((0,m.isFunction)(a))this.on("publish",a);else if(Object.prototype.toString.call(a)===Object.prototype.toString.call({}))for(var A=["publish","join","leave","unsubscribe","subscribe","error"],f=0,E=A.length;f<E;f++){var _=A[f];_ in a&&this.on(_,a[_])}}}},{key:"_isNew",value:function(){return this._status===G}},{key:"_isUnsubscribed",value:function(){return this._status===v}},{key:"_isSubscribing",value:function(){return this._status===K}},{key:"_isReady",value:function(){return this._status===J||this._status===M}},{key:"_isSuccess",value:function(){return this._status===J}},{key:"_isError",value:function(){return this._status===M}},{key:"_setNew",value:function(){this._status=G}},{key:"_setSubscribing",value:function(a){this._isResubscribe=a||!1,this._ready===!0&&this._initializePromise(),this._status=K}},{key:"_setSubscribeSuccess",value:function(a){if(this._status!==J){this._status=J;var A=this._getSubscribeSuccessContext(a);this._recover=!1,this.emit("subscribe",A),this._resolve(A);for(var f in this._promises)clearTimeout(this._promises[f].timeout),this._promises[f].resolve(),delete this._promises[f]}}},{key:"_setSubscribeError",value:function(a){if(this._status!==M){this._status=M,this._error=a;var A=this._getSubscribeErrorContext();this.emit("error",A),this._reject(A);for(var f in this._promises)clearTimeout(this._promises[f].timeout),this._promises[f].reject(a),delete this._promises[f]}}},{key:"_triggerUnsubscribe",value:function(){this.emit("unsubscribe",{channel:this.channel})}},{key:"_setUnsubscribed",value:function(a){if(this._centrifuge._clearSubRefreshTimeout(this.channel),this._status!==v){var A=this._status===J;this._status=v,a===!0&&(this._recover=!1,this._noResubscribe=!0,delete this._centrifuge._lastSeq[this.channel],delete this._centrifuge._lastGen[this.channel],delete this._centrifuge._lastEpoch[this.channel]),A&&this._triggerUnsubscribe()}}},{key:"_shouldResubscribe",value:function(){return!this._noResubscribe}},{key:"_getSubscribeSuccessContext",value:function(a){var A={channel:this.channel,isResubscribe:this._isResubscribe};return a&&(A=this._centrifuge._expandSubscribeContext(A,a)),A}},{key:"_getSubscribeErrorContext",value:function(){var a=this._error;return a.channel=this.channel,a.isResubscribe=this._isResubscribe,a}},{key:"_setSubscribeData",value:function(a){this._subscribeData=a}},{key:"ready",value:function(a,A){this._ready&&(this._isSuccess()?a(this._getSubscribeSuccessContext()):A(this._getSubscribeErrorContext()))}},{key:"subscribe",value:function(a){this._status!==J&&(a&&a.since&&this._centrifuge._setSubscribeSince(this,a.since),a&&a.data&&this._setSubscribeData(a.data),this._noResubscribe=!1,this._centrifuge._subscribe(this))}},{key:"unsubscribe",value:function(){this._setUnsubscribed(!0),this._centrifuge._unsubscribe(this)}},{key:"_methodCall",value:function(){var a=this;if(this._isSuccess())return Promise.resolve();if(this._isError())return Promise.reject(this._error);var A=new Promise(function(f,E){var _=setTimeout(function(){E({code:0,message:"timeout"})},a._centrifuge._config.timeout);a._promises[a._nextPromiseId()]={timeout:_,resolve:f,reject:E}});return A}},{key:"publish",value:function(a){var A=this;return this._methodCall().then(function(){return A._centrifuge.publish(A.channel,a)})}},{key:"presence",value:function(){var a=this;return this._methodCall().then(function(){return a._centrifuge.presence(a.channel)})}},{key:"presenceStats",value:function(){var a=this;return this._methodCall().then(function(){return a._centrifuge.presenceStats(a.channel)})}},{key:"history",value:function(a){var A=this;return this._methodCall().then(function(){return A._centrifuge.history(A.channel,a)})}}]),d})(y.default);u.default=g,c.exports=u.default}),853:(function(c,u,l){Object.defineProperty(u,"__esModule",{value:!0}),u.backoff=b,u.errorExists=I,u.extend=B,u.isFunction=y,u.log=m,u.startsWith=h;function h(Q,S){return Q.lastIndexOf(S,0)===0}function y(Q){return Q==null?!1:typeof Q=="function"}function m(Q,S){if(l.g.console){var P=l.g.console[Q];y(P)&&P.apply(l.g.console,S)}}function b(Q,S,P){var k=.5*Math.random(),R=Math.min(P,S*Math.pow(2,Q+1));return Math.floor((1-k)*R)}function I(Q){return"error"in Q&&Q.error!==null}function B(Q,S){for(var P in S)S.hasOwnProperty(P)&&(Q[P]=S[P]);return Q}}),187:(function(c){var u=typeof Reflect=="object"?Reflect:null,l=u&&typeof u.apply=="function"?u.apply:function(g,p,C){return Function.prototype.apply.call(g,p,C)},h;u&&typeof u.ownKeys=="function"?h=u.ownKeys:Object.getOwnPropertySymbols?h=function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:h=function(g){return Object.getOwnPropertyNames(g)};function y(v){console&&console.warn&&console.warn(v)}var m=Number.isNaN||function(g){return g!==g};function b(){b.init.call(this)}c.exports=b,c.exports.once=K,b.EventEmitter=b,b.prototype._events=void 0,b.prototype._eventsCount=0,b.prototype._maxListeners=void 0;var I=10;function B(v){if(typeof v!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof v)}Object.defineProperty(b,"defaultMaxListeners",{enumerable:!0,get:function(){return I},set:function(v){if(typeof v!="number"||v<0||m(v))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+v+".");I=v}}),b.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},b.prototype.setMaxListeners=function(g){if(typeof g!="number"||g<0||m(g))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+g+".");return this._maxListeners=g,this};function Q(v){return v._maxListeners===void 0?b.defaultMaxListeners:v._maxListeners}b.prototype.getMaxListeners=function(){return Q(this)},b.prototype.emit=function(g){for(var p=[],C=1;C<arguments.length;C++)p.push(arguments[C]);var d=g==="error",s=this._events;if(s!==void 0)d=d&&s.error===void 0;else if(!d)return!1;if(d){var a;if(p.length>0&&(a=p[0]),a instanceof Error)throw a;var A=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw A.context=a,A}var f=s[g];if(f===void 0)return!1;if(typeof f=="function")l(f,this,p);else for(var E=f.length,_=z(f,E),C=0;C<E;++C)l(_[C],this,p);return!0};function S(v,g,p,C){var d,s,a;if(B(p),s=v._events,s===void 0?(s=v._events=Object.create(null),v._eventsCount=0):(s.newListener!==void 0&&(v.emit("newListener",g,p.listener?p.listener:p),s=v._events),a=s[g]),a===void 0)a=s[g]=p,++v._eventsCount;else if(typeof a=="function"?a=s[g]=C?[p,a]:[a,p]:C?a.unshift(p):a.push(p),d=Q(v),d>0&&a.length>d&&!a.warned){a.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=v,A.type=g,A.count=a.length,y(A)}return v}b.prototype.addListener=function(g,p){return S(this,g,p,!1)},b.prototype.on=b.prototype.addListener,b.prototype.prependListener=function(g,p){return S(this,g,p,!0)};function P(){if(!this.fired)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)}function k(v,g,p){var C={fired:!1,wrapFn:void 0,target:v,type:g,listener:p},d=P.bind(C);return d.listener=p,C.wrapFn=d,d}b.prototype.once=function(g,p){return B(p),this.on(g,k(this,g,p)),this},b.prototype.prependOnceListener=function(g,p){return B(p),this.prependListener(g,k(this,g,p)),this},b.prototype.removeListener=function(g,p){var C,d,s,a,A;if(B(p),d=this._events,d===void 0)return this;if(C=d[g],C===void 0)return this;if(C===p||C.listener===p)--this._eventsCount===0?this._events=Object.create(null):(delete d[g],d.removeListener&&this.emit("removeListener",g,C.listener||p));else if(typeof C!="function"){for(s=-1,a=C.length-1;a>=0;a--)if(C[a]===p||C[a].listener===p){A=C[a].listener,s=a;break}if(s<0)return this;s===0?C.shift():D(C,s),C.length===1&&(d[g]=C[0]),d.removeListener!==void 0&&this.emit("removeListener",g,A||p)}return this},b.prototype.off=b.prototype.removeListener,b.prototype.removeAllListeners=function(g){var p,C,d;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[g]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[g]),this;if(arguments.length===0){var s=Object.keys(C),a;for(d=0;d<s.length;++d)a=s[d],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(p=C[g],typeof p=="function")this.removeListener(g,p);else if(p!==void 0)for(d=p.length-1;d>=0;d--)this.removeListener(g,p[d]);return this};function R(v,g,p){var C=v._events;if(C===void 0)return[];var d=C[g];return d===void 0?[]:typeof d=="function"?p?[d.listener||d]:[d]:p?G(d):z(d,d.length)}b.prototype.listeners=function(g){return R(this,g,!0)},b.prototype.rawListeners=function(g){return R(this,g,!1)},b.listenerCount=function(v,g){return typeof v.listenerCount=="function"?v.listenerCount(g):L.call(v,g)},b.prototype.listenerCount=L;function L(v){var g=this._events;if(g!==void 0){var p=g[v];if(typeof p=="function")return 1;if(p!==void 0)return p.length}return 0}b.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function z(v,g){for(var p=new Array(g),C=0;C<g;++C)p[C]=v[C];return p}function D(v,g){for(;g+1<v.length;g++)v[g]=v[g+1];v.pop()}function G(v){for(var g=new Array(v.length),p=0;p<g.length;++p)g[p]=v[p].listener||v[p];return g}function K(v,g){return new Promise(function(p,C){function d(a){v.removeListener(g,s),C(a)}function s(){typeof v.removeListener=="function"&&v.removeListener("error",d),p([].slice.call(arguments))}M(v,g,s,{once:!0}),g!=="error"&&J(v,d,{once:!0})})}function J(v,g,p){typeof v.on=="function"&&M(v,"error",g,p)}function M(v,g,p,C){if(typeof v.on=="function")C.once?v.once(g,p):v.on(g,p);else if(typeof v.addEventListener=="function")v.addEventListener(g,function d(s){C.once&&v.removeEventListener(g,d),p(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof v)}})},r={};function o(c){var u=r[c];if(u!==void 0)return u.exports;var l=r[c]={exports:{}};return n[c](l,l.exports,o),l.exports}(function(){o.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}})()})();var i=o(579);return i})()})})(xe)),xe.exports}var kr=Qr();const Pr=Sr(kr);let Ue=null;function Yt(e,t){if(!(e!=null&&e.client_url)||!(e!=null&&e.token)||!(e!=null&&e.channel))return console.error("[Centrifuge] Invalid socket_connections"),null;const{client_url:n,token:r,channel:o}=e;if(o.includes("#")||console.warn("[Centrifuge] Channel should contain #user_id"),Ue){try{console.log("[Centrifuge] Disconnecting previous instance..."),Ue.disconnect()}catch(c){console.error("[Centrifuge] Error while disconnecting previous instance:",c)}Ue=null}console.log("[Centrifuge] Creating new instance:",n);const i=new Pr(n);return i.setToken(r),i.on("connect",c=>{console.log("[Centrifuge] Connected",c),console.log("[Centrifuge] Subscribing to channel:",o);const u=i.subscribe(o);u.on("publish",l=>{console.log("[Centrifuge] Publish event received:",l);const h=wr(l);h&&t(h)}),u.on("subscribe",l=>{console.log("[Centrifuge] ✅ Channel subscribed successfully:",o,l)}),u.on("error",l=>{console.error("[Centrifuge] ❌ Subscription error:",l)}),u.on("unsubscribe",l=>{console.log("[Centrifuge] Channel unsubscribed:",l)})}),i.on("disconnect",c=>console.log("[Centrifuge] Disconnected",c)),i.on("error",c=>console.error("[Centrifuge] Error",c)),console.log("[Centrifuge] Calling connect()..."),i.connect(),Ue=i,{centrifuge:i}}function wr(e){var n,r,o;if(console.log("[Centrifuge] Raw message received:",JSON.stringify(e)),!(e!=null&&e.data))return console.warn("[Centrifuge] Empty or invalid response"),null;let t=e.data;return(n=t.data)!=null&&n.type?t=t.data:(o=(r=t.data)==null?void 0:r.data)!=null&&o.type&&(t=t.data.data),console.log("[Centrifuge] Parsed message:",t),t.type?t:(console.warn("[Centrifuge] Message has no type:",t),null)}function Fe(e){return/^4[0-9]/.test(e)?"visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"mastercard":"card"}const le={iconType:"kaspi_pay",label:"Kaspi.kz",type:"kaspi_pay"},Vt={iconType:"apple_pay",label:"Apple Pay",type:"apple_pay"},Zt={iconType:"google_pay",label:"Google Pay",type:"google_pay"};function $(e){return e==="enabled"||e===!0}function $t(e){if(!e)return null;let t=String(e).trim().toLowerCase();return t.startsWith("payment_method_")&&(t=t.replace("payment_method_","")),t==="kaspi"?"kaspi_pay":t==="apple"?"apple_pay":t==="google"?"google_pay":t==="newcard"?"new_card":t==="card"?"card":["kaspi_pay","apple_pay","google_pay","new_card"].includes(t)?t:null}function Tr(e){var i,c,u;const t=e,n=((i=t==null?void 0:t.context)==null?void 0:i.last_payment_method)??(t==null?void 0:t.last_payment_method)??((c=t==null?void 0:t.attributes)==null?void 0:c.last_payment_method);if(!n)return null;if(typeof n=="string")return{type:$t(n),cardId:null};if(typeof n!="object")return null;const r=n.type??n.payment_method??n.method,o=n.card_id??n.cardId??n.id??((u=n.card)==null?void 0:u.id)??null;return{type:$t(r),cardId:o!=null?String(o):null}}function Lr(e,t,n={}){var S,P,k,R;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=$(c.payment_method_kaspi),l=$(c.payment_method_card),h=typeof window<"u"&&window.self===window.top,m=dt()==="ios",b=!!(n!=null&&n.onlyKaspiAvailable),I=!!(n!=null&&n.disableKaspi);return o!=null&&o.isKaspiOnly&&u&&!I?[le]:b?o!=null&&o.isAvailable&&u&&!I?[le]:[]:($(c.payment_method_apple_pay)&&!Me("apple_pay")&&(Ne()&&h||De()||m||Gt()===16)&&r.push(Vt),o!=null&&o.isAvailable&&u&&!I&&r.push(le),l&&i.filter(L=>!L.isExpired).forEach(L=>{r.push({iconType:Fe(L.attributes.mask),type:"card",cardId:L.id,label:`•••• ${L.attributes.mask.slice(-4)}`,cardType:L.type,isDefault:L.attributes.isDefault})}),$(c.payment_method_google_pay)&&!Me("google_pay")&&!(n!=null&&n.disableGooglePay)&&!Ne()&&!De()&&r.push(Zt),$(c.payment_method_new_card)&&r.push({iconType:"new_card",type:"new_card",label:t?t("newCard"):"Оплата новой картой"}),r)}function ft(e,t={}){var Q,S,P,k;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=$(o.payment_method_kaspi),c=$(o.payment_method_card),u=!!(t!=null&&t.disableKaspi),l=typeof window<"u"&&window.self===window.top,y=dt()==="ios",m=$(o.payment_method_apple_pay)&&!Me("apple_pay")&&(Ne()&&l||De()||y||Gt()===16),b=$(o.payment_method_google_pay)&&!Me("google_pay")&&!(t!=null&&t.disableGooglePay)&&!Ne()&&!De();if(n!=null&&n.isKaspiOnly&&i&&!u||t!=null&&t.onlyKaspiAvailable&&(n!=null&&n.isAvailable)&&i&&!u)return le;const I=Tr(e);if((I==null?void 0:I.type)==="kaspi_pay"&&(n!=null&&n.isAvailable)&&i&&!u)return le;if((I==null?void 0:I.type)==="apple_pay"&&m)return Vt;if((I==null?void 0:I.type)==="google_pay"&&b)return Zt;if((I==null?void 0:I.type)==="new_card"&&$(o.payment_method_new_card))return{iconType:"new_card",type:"new_card",label:"Оплата новой картой"};if((I==null?void 0:I.type)==="card"&&c){const R=I.cardId!=null?r.find(L=>!L.isExpired&&String(L.id)===I.cardId):null;if(R)return{iconType:Fe(R.attributes.mask),type:"card",cardId:R.id,label:`•••• ${R.attributes.mask.slice(-4)}`,cardType:R.type}}if(c){const R=r.find(L=>{var z;return((z=L.attributes)==null?void 0:z.isDefault)&&!L.isExpired});if(R)return{iconType:Fe(R.attributes.mask),type:"card",cardId:R.id,label:`•••• ${R.attributes.mask.slice(-4)}`,cardType:R.type}}if(n!=null&&n.isAvailable&&i&&!u)return le;const B=c?r.find(R=>!R.isExpired):null;return B?{iconType:Fe(B.attributes.mask),type:"card",cardId:B.id,label:`••••${B.attributes.mask.slice(-4)}`,cardType:B.type}:null}function en(e){if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}}function ht(e,t){if(!(typeof localStorage>"u"))try{localStorage.setItem(e,t)}catch{}}function Xe(e){if(!(typeof localStorage>"u"))try{localStorage.removeItem(e)}catch{}}async function Rr(e,t){var n;try{const r=await e.json(),o=(n=r==null?void 0:r.errors)==null?void 0:n[0];return(o==null?void 0:o.title)||(o==null?void 0:o.detail)||(r==null?void 0:r.message)||(r==null?void 0:r.error)||t}catch{return`HTTP ${e.status}: ${e.statusText}`}}async function ie(e,t){const n=await Rr(e,t);throw Object.assign(new Error(n),{status:e.status})}function He(e,t,n={}){const r=Number.isFinite(n.checkoutAmount)&&n.checkoutAmount>=0?Number(n.checkoutAmount):e.amount,o=!!n.forceBalanceMethod,i=!!n.useBalance,c=n.voucher;return{checkoutAmount:r,checkoutPaymentMethod:o?{type:"balance"}:t,useBalanceFlag:i,voucher:c}}function je(e,t,n,r,o){return{preorder_id:e.preorderId,terminal_id:e.terminalId,merchant_order_id:e.merchantOrderId,money:{amount:String(n),currency:e.currency},payment_method:t,...e.backlink&&{backlink:e.backlink},...r&&{use_balance:!0},...o&&{voucher:o},...e.isFridge&&{is_fridge:!0}}}async function Je(e,t,n,r,o){const i=await fetch(`${e}/orders/v1/checkout`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`,"X-Idempotency-Key":t.idempotencyKey??Oe(),"X-Device-Id":n,"X-OS":"WEB"},body:JSON.stringify(r)});return i.ok||await ie(i,o),i.json()}async function tn(e,t,n){var u,l,h,y;const r=await fetch(`${e}/api/v2/oauth2/tokens`,{method:"POST",headers:{"Content-Type":"application/json","X-Idempotency-Key":Oe(),"X-Fingerprint":Kt()},body:JSON.stringify({client_id:t,grant_type:"authorization_track_id",track_id:n})});r.ok||await ie(r,"Не удалось авторизоваться через track_id");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=(h=o==null?void 0:o.data)==null?void 0:h.attributes)==null?void 0:y.refresh_token)??null;if(!i)throw new Error("В ответе отсутствует access_token");return{access_token:i,refresh_token:c}}async function Or(e,t,n){var u,l,h,y;const r=await fetch(`${e}/api/v2/oauth2/tokens`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,grant_type:"refresh_token",refresh_token:n})});r.ok||await ie(r,"Не удалось обновить токен по refresh_token");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=(h=o==null?void 0:o.data)==null?void 0:h.attributes)==null?void 0:y.refresh_token)??null;if(!i)throw new Error("В ответе отсутствует access_token");return{access_token:i,refresh_token:c}}async function pt(e,t){const n=await fetch(`${e}/orders/v1/checkout/context`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`,"X-Idempotency-Key":Oe()},body:JSON.stringify({terminal_id:t.terminalId,include:["cards","payment_methods","balance","cashback"],money:{amount:String(t.amount),currency:t.currency}})});return n.ok||await ie(n,"Ошибка получения контекста оплаты"),n.json()}async function Nr(e,t,n){const r=await fetch(`${e}/payment-gateway/v1/cards/${n}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`}});return r.ok||await ie(r,"Не удалось удалить карту"),r.json().catch(()=>({}))}async function Dr(e,t,n){const r=await fetch(`${e}/payment-gateway/v1/cards/${n}/mark_as_default`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`}});return r.ok||await ie(r,"Не удалось отметить карту как основную"),r.json().catch(()=>({}))}async function Mr(e,t,n){const r=await fetch(`${e}/orders/v1/orders/${n}/status`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`}});if(!r.ok)throw Object.assign(new Error(`Ошибка проверки статуса заказа: ${r.status} ${r.statusText}`),{status:r.status});const o=await r.json(),i=(o==null?void 0:o.data)??o;return{data:{status:i==null?void 0:i.status,payload:(i==null?void 0:i.payload)??{}}}}async function nn(e,t,n,r,o={}){const{checkoutAmount:i,checkoutPaymentMethod:c,useBalanceFlag:u,voucher:l}=He(t,{type:r.type,...r.cardId&&{card_id:r.cardId}},o);return Je(e,t,n,je(t,c,i,u,l),"Ошибка создания заказа")}async function xr(e,t,n,r={}){const{checkoutAmount:o,checkoutPaymentMethod:i,useBalanceFlag:c,voucher:u}=He(t,{type:"new_card"},r);return Je(e,t,n,je(t,i,o,c,u),"Ошибка создания заказа для новой карты")}async function Ur(e,t){const n=await fetch(`${e}/loyalty/v6/coupons/by_terminal/${t.terminalId}/at_payment?order_pay_amount=${t.amount}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.accessToken}`}});return n.ok||await ie(n,"Ошибка получения купонов"),n.json()}async function rn(e,t,n){const r=window.location.hostname,o=await fetch(`${e}/payment-gateway/v1/apple/session`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/vnd.api+json",Authorization:`Bearer ${t.accessToken}`},body:JSON.stringify({validationUrl:n,domainName:r})});return o.ok||await ie(o,"Ошибка получения Apple Pay сессии"),o.json()}async function Fr(e,t,n,r,o={}){const{checkoutAmount:i,checkoutPaymentMethod:c,useBalanceFlag:u,voucher:l}=He(t,{type:"apple_pay",data:r},o);return Je(e,t,n,je(t,c,i,u,l),"Ошибка создания заказа с Apple Pay")}async function on(e,t,n,r,o={}){const{checkoutAmount:i,checkoutPaymentMethod:c,useBalanceFlag:u,voucher:l}=He(t,{type:"google_pay",data:r},o);return Je(e,t,n,je(t,c,i,u,l),"Ошибка создания заказа с Google Pay")}function Xr(e){const t=typeof e.color=="string"?e.color.trim():"",n=t&&/^[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/.test(t)?`#${t}`:t,r=e.bonuses,o=r&&typeof r=="object"&&Number.isFinite(r.amount)&&Number.isFinite(r.percent)?{availableBonus:Number.isFinite(r.availableBonus)?Number(r.availableBonus):0,amount:Number(r.amount),percent:Number(r.percent)}:null;return{preorderId:e.preorderId,trackId:e.trackId,clientId:e.clientId,projectId:e.projectId,terminalId:e.terminalId,merchantOrderId:e.merchantOrderId,amount:e.amount,currency:e.currency||"KZT",environment:e.environment||"production",backlink:e.backlink,onSuccess:e.onSuccess||(()=>{}),onAppliedBonus:e.onAppliedBonus||(()=>{}),onError:e.onError||(()=>{}),onCancel:e.onCancel||(()=>{}),onCardDeleted:typeof e.onCardDeleted=="function"?e.onCardDeleted:null,onConfirmPay:typeof e.onConfirmPay=="function"?e.onConfirmPay:null,onPaymentMethodSelected:typeof e.onPaymentMethodSelected=="function"?e.onPaymentMethodSelected:null,onKaspiLink:typeof e.onKaspiLink=="function"?e.onKaspiLink:null,onPayWithGooglePay:typeof e.onPayWithGooglePay=="function"?e.onPayWithGooglePay:null,onUserEvent:typeof e.onUserEvent=="function"?e.onUserEvent:null,onBeforeCheckout:typeof e.onBeforeCheckout=="function"?e.onBeforeCheckout:null,onFreedomLink:typeof e.onFreedomLink=="function"?e.onFreedomLink:null,onRequestNewTrackId:typeof e.onRequestNewTrackId=="function"?e.onRequestNewTrackId:null,idempotencyKey:e.idempotencyKey,locale:e.locale||"ru",containerSelector:typeof e.containerSelector=="string"?e.containerSelector.trim():"",color:n||"#2F2F2F",onlyKaspiAvailable:!!e.onlyKaspiAvailable,disableKaspi:!!e.disableKaspi,disableGooglePay:!!e.disableGooglePay,disableUseBalance:!!e.disableUseBalance,isNativeAndroid:!!e.isNativeAndroid,isFridge:!!e.isFridge,bonuses:o}}const U=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ae="8.55.2",j=globalThis;function qe(e,t,n){const r=n||j,o=r.__SENTRY__=r.__SENTRY__||{},i=o[Ae]=o[Ae]||{};return i[e]||(i[e]=t())}const gt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Hr="Sentry Logger ",sn=["debug","info","warn","error","log","assert","trace"],an={};function ze(e){if(!("console"in j))return e();const t=j.console,n={},r=Object.keys(an);r.forEach(o=>{const i=an[o];n[o]=t[o],t[o]=i});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function jr(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return gt?sn.forEach(n=>{t[n]=(...r)=>{e&&ze(()=>{j.console[n](`${Hr}[${n}]:`,...r)})}}):sn.forEach(n=>{t[n]=()=>{}}),t}const N=qe("logger",jr),cn=50,ye="?",un=/\(error: (.*)\)/,ln=/captureMessage|captureException/;function Jr(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const i=[],c=n.split(`
|
|
5
5
|
`);for(let u=r;u<c.length;u++){const l=c[u];if(l.length>1024)continue;const h=un.test(l)?l.replace(un,"$1"):l;if(!h.match(/\S*Error: /)){for(const y of t){const m=y(h);if(m){i.push(m);break}}if(i.length>=cn+o)break}}return qr(i.slice(o))}}function qr(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Ke(t).function||"")&&t.pop(),t.reverse(),ln.test(Ke(t).function||"")&&(t.pop(),ln.test(Ke(t).function||"")&&t.pop()),t.slice(0,cn).map(n=>({...n,filename:n.filename||Ke(t).filename,function:n.function||ye}))}function Ke(e){return e[e.length-1]||{}}const yt="<anonymous>";function zr(e){try{return!e||typeof e!="function"?yt:e.name||yt}catch{return yt}}function mt(){return Ct(j),j}function Ct(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ae,t[Ae]=t[Ae]||{}}const An=Object.prototype.toString;function dn(e){switch(An.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ye(e,Error)}}function _e(e,t){return An.call(e)===`[object ${t}]`}function fn(e){return _e(e,"ErrorEvent")}function hn(e){return _e(e,"DOMError")}function Kr(e){return _e(e,"DOMException")}function pn(e){return _e(e,"String")}function bt(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Gr(e){return e===null||bt(e)||typeof e!="object"&&typeof e!="function"}function me(e){return _e(e,"Object")}function Ge(e){return typeof Event<"u"&&Ye(e,Event)}function Wr(e){return typeof Element<"u"&&Ye(e,Element)}function We(e){return!!(e&&e.then&&typeof e.then=="function")}function Yr(e){return me(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ye(e,t){try{return e instanceof t}catch{return!1}}function Vr(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}const Zr=j,$r=80;function eo(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,c=0;const u=" > ",l=u.length;let h;const y=Array.isArray(t)?t:t.keyAttrs,m=!Array.isArray(t)&&t.maxStringLength||$r;for(;n&&i++<r&&(h=to(n,y),!(h==="html"||i>1&&c+o.length*l+h.length>=m));)o.push(h),c+=h.length,n=n.parentNode;return o.reverse().join(u)}catch{return"<unknown>"}}function to(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(Zr.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t&&t.length?t.filter(c=>n.getAttribute(c)).map(c=>[c,n.getAttribute(c)]):null;if(o&&o.length)o.forEach(c=>{r.push(`[${c[0]}="${c[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const c=n.className;if(c&&pn(c)){const u=c.split(/\s+/);for(const l of u)r.push(`.${l}`)}}const i=["aria-label","type","name","title","alt"];for(const c of i){const u=n.getAttribute(c);u&&r.push(`[${c}="${u}"]`)}return r.join("")}function Qe(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function gn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{gt&&N.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function yn(e){if(dn(e))return{message:e.message,name:e.name,stack:e.stack,...Cn(e)};if(Ge(e)){const t={type:e.type,target:mn(e.target),currentTarget:mn(e.currentTarget),...Cn(e)};return typeof CustomEvent<"u"&&Ye(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function mn(e){try{return Wr(e)?eo(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Cn(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function no(e,t=40){const n=Object.keys(yn(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return Qe(r,t);for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(!(i.length>t))return o===n.length?i:Qe(i,t)}return""}function Y(e){return Et(e,new Map)}function Et(e,t){if(ro(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const o of Object.getOwnPropertyNames(e))typeof e[o]<"u"&&(r[o]=Et(e[o],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(o=>{r.push(Et(o,t))}),r}return e}function ro(e){if(!me(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const bn=1e3;function Ve(){return Date.now()/bn}function oo(){const{performance:e}=j;if(!e||!e.now)return Ve;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/bn}const En=oo();(()=>{const{performance:e}=j;if(!e||!e.now)return;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,h=l<t;return i||h?o<=l?e.timeOrigin:c:r})();function ee(){const e=j,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function so(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function vn(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function ke(e,t){const n=so(e);if(!n)return;const r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){const i={...o&&o.data,...t.data};n.mechanism.data=i}}function In(e){if(io(e))return!0;try{gn(e,"__sentry_captured__",!0)}catch{}return!1}function io(e){try{return e.__sentry_captured__}catch{}}var ne;(function(e){e[e.PENDING=0]="PENDING";const n=1;e[e.RESOLVED=n]="RESOLVED";const r=2;e[e.REJECTED=r]="REJECTED"})(ne||(ne={}));function de(e){return new W(t=>{t(e)})}function Ze(e){return new W((t,n)=>{n(e)})}class W{constructor(t){W.prototype.__init.call(this),W.prototype.__init2.call(this),W.prototype.__init3.call(this),W.prototype.__init4.call(this),this._state=ne.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new W((r,o)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(c){o(c)}},i=>{if(!n)o(i);else try{r(n(i))}catch(c){o(c)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new W((n,r)=>{let o,i;return this.then(c=>{i=!1,o=c,t&&t()},c=>{i=!0,o=c,t&&t()}).then(()=>{if(i){r(o);return}n(o)})})}__init(){this._resolve=t=>{this._setResult(ne.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(ne.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===ne.PENDING){if(We(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===ne.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===ne.RESOLVED&&n[1](this._value),this._state===ne.REJECTED&&n[2](this._value),n[0]=!0)})}}}function vt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||En(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:ee()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Bn(){return ee()}function It(){return ee().substring(16)}function $e(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&t&&Object.keys(t).length===0)return e;const r={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=$e(r[o],t[o],n-1));return r}const Bt="_sentrySpan";function Sn(e,t){t?gn(e,Bt,t):delete e[Bt]}function _n(e){return e[Bt]}const ao=100;class St{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Bn(),spanId:It()}}clone(){const t=new St;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,Sn(t,_n(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&vt(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,[r,o]=n instanceof ae?[n.getScopeData(),n.getRequestSession()]:me(n)?[t,t.requestSession]:[],{tags:i,extra:c,user:u,contexts:l,level:h,fingerprint:y=[],propagationContext:m}=r||{};return this._tags={...this._tags,...i},this._extra={...this._extra,...c},this._contexts={...this._contexts,...l},u&&Object.keys(u).length&&(this._user=u),h&&(this._level=h),y.length&&(this._fingerprint=y),m&&(this._propagationContext=m),o&&(this._requestSession=o),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,Sn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Bn()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:ao;if(r<=0)return this;const o={timestamp:Ve(),...t};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_n(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=$e(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:It(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:ee();if(!this._client)return N.warn("No client configured on scope - will not capture exception!"),r;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){const o=r&&r.event_id?r.event_id:ee();if(!this._client)return N.warn("No client configured on scope - will not capture message!"),o;const i=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:o},this),o}captureEvent(t,n){const r=n&&n.event_id?n.event_id:ee();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(N.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}const ae=St;function co(){return qe("defaultCurrentScope",()=>new ae)}function uo(){return qe("defaultIsolationScope",()=>new ae)}class lo{constructor(t,n){let r;t?r=t:r=new ae;let o;n?o=n:o=new ae,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(o){throw this._popScope(),o}return We(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Ce(){const e=mt(),t=Ct(e);return t.stack=t.stack||new lo(co(),uo())}function Ao(e){return Ce().withScope(e)}function fo(e,t){const n=Ce();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Qn(e){return Ce().withScope(()=>e(Ce().getIsolationScope()))}function ho(){return{withIsolationScope:Qn,withScope:Ao,withSetScope:fo,withSetIsolationScope:(e,t)=>Qn(t),getCurrentScope:()=>Ce().getScope(),getIsolationScope:()=>Ce().getIsolationScope()}}function kn(e){const t=Ct(e);return t.acs?t.acs:ho()}function Pn(){const e=mt();return kn(e).getCurrentScope()}function po(){const e=mt();return kn(e).getIsolationScope()}function go(){return qe("globalScope",()=>new ae)}function _t(){return Pn().getClient()}function yo(e){const t=e.getPropagationContext(),{traceId:n,spanId:r,parentSpanId:o}=t;return Y({trace_id:n,span_id:r,parent_span_id:o})}const mo="_sentryMetrics";function Co(e){const t=e[mo];if(!t)return;const n={};for(const[,[r,o]]of t)(n[r]||(n[r]=[])).push(Y(o));return n}const bo="sentry.source",Eo="sentry.sample_rate",vo="sentry.op",Io="sentry.origin",Bo=0,So=1,_o="sentry-",Qo=/^sentry-/;function ko(e){const t=Po(e);if(!t)return;const n=Object.entries(t).reduce((r,[o,i])=>{if(o.match(Qo)){const c=o.slice(_o.length);r[c]=i}return r},{});if(Object.keys(n).length>0)return n}function Po(e){if(!(!e||!pn(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=wn(n);return Object.entries(r).forEach(([o,i])=>{t[o]=i}),t},{}):wn(e)}function wn(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}const wo=1;let Tn=!1;function To(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Qt(e).parent_span_id,i=r?It():t;return Y({parent_span_id:o,span_id:i,trace_id:n})}function Ln(e){return typeof e=="number"?Rn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Rn(e.getTime()):En()}function Rn(e){return e>9999999999?e/1e3:e}function Qt(e){if(Ro(e))return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(Lo(e)){const{attributes:r,startTime:o,name:i,endTime:c,parentSpanId:u,status:l}=e;return Y({span_id:t,trace_id:n,data:r,description:i,parent_span_id:u,start_timestamp:Ln(o),timestamp:Ln(c)||void 0,status:No(l),op:r[vo],origin:r[Io],_metrics_summary:Co(e)})}return{span_id:t,trace_id:n}}catch{return{}}}function Lo(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ro(e){return typeof e.getSpanJSON=="function"}function Oo(e){const{traceFlags:t}=e.spanContext();return t===wo}function No(e){if(!(!e||e.code===Bo))return e.code===So?"ok":e.message||"unknown_error"}const Do="_sentryRootSpan";function On(e){return e[Do]||e}function Mo(){Tn||(ze(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),Tn=!0)}function xo(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=_t(),n=t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}const Nn="production",Uo="_frozenDsc";function Dn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o=Y({environment:n.environment||Nn,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",o),o}function Fo(e,t){const n=t.getPropagationContext();return n.dsc||Dn(n.traceId,e)}function Xo(e){const t=_t();if(!t)return{};const n=On(e),r=n[Uo];if(r)return r;const o=n.spanContext().traceState,i=o&&o.get("sentry.dsc"),c=i&&ko(i);if(c)return c;const u=Dn(e.spanContext().traceId,t),l=Qt(n),h=l.data||{},y=h[Eo];y!=null&&(u.sample_rate=`${y}`);const m=h[bo],b=l.description;return m!=="url"&&b&&(u.transaction=b),xo()&&(u.sampled=String(Oo(n))),t.emit("createDsc",u,n),u}function Ho(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(typeof t!="number"||isNaN(t)||t<0||t>1){U&&N.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}const jo=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Jo(e){return e==="http"||e==="https"}function et(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:c,protocol:u,publicKey:l}=e;return`${u}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${c}`}function qo(e){const t=jo.exec(e);if(!t){ze(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,o="",i="",c="",u=""]=t.slice(1);let l="",h=u;const y=h.split("/");if(y.length>1&&(l=y.slice(0,-1).join("/"),h=y.pop()),h){const m=h.match(/^\d+/);m&&(h=m[0])}return Mn({host:i,pass:o,path:l,projectId:h,port:c,protocol:n,publicKey:r})}function Mn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function zo(e){if(!gt)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(c=>e[c]?!1:(N.error(`Invalid Sentry Dsn: ${c} missing`),!0))?!1:n.match(/^\d+$/)?Jo(r)?t&&isNaN(parseInt(t,10))?(N.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(N.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(N.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ko(e){const t=typeof e=="string"?qo(e):Mn(e);if(!(!t||!zo(t)))return t}function Go(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(o){if(e)return t.has(o)?!0:(t.add(o),!1);for(let i=0;i<t.length;i++)if(t[i]===o)return!0;return t.push(o),!1}function r(o){if(e)t.delete(o);else for(let i=0;i<t.length;i++)if(t[i]===o){t.splice(i,1);break}}return[n,r]}function re(e,t=100,n=1/0){try{return kt("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function xn(e,t=3,n=100*1024){const r=re(e,t);return Zo(r)>n?xn(e,t-1,n):r}function kt(e,t,n=1/0,r=1/0,o=Go()){const[i,c]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const u=Wo(e,t);if(!u.startsWith("[object "))return u;if(t.__sentry_skip_normalization__)return t;const l=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(l===0)return u.replace("object ","");if(i(t))return"[Circular ~]";const h=t;if(h&&typeof h.toJSON=="function")try{const I=h.toJSON();return kt("",I,l-1,r,o)}catch{}const y=Array.isArray(t)?[]:{};let m=0;const b=yn(t);for(const I in b){if(!Object.prototype.hasOwnProperty.call(b,I))continue;if(m>=r){y[I]="[MaxProperties ~]";break}const B=b[I];y[I]=kt(I,B,l-1,r,o),m++}return c(t),y}function Wo(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Vr(t))return"[VueViewModel]";if(Yr(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${zr(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Yo(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Yo(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Vo(e){return~-encodeURI(e).split(/%..|./).length}function Zo(e){return Vo(JSON.stringify(e))}function Pe(e,t=[]){return[e,t]}function $o(e,t){const[n,r]=e;return[n,[...r,t]]}function Un(e,t){const n=e[1];for(const r of n){const o=r[0].type;if(t(r,o))return!0}return!1}function Pt(e){return j.__SENTRY__&&j.__SENTRY__.encodePolyfill?j.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function es(e){const[t,n]=e;let r=JSON.stringify(t);function o(i){typeof r=="string"?r=typeof i=="string"?r+i:[Pt(r),i]:r.push(typeof i=="string"?Pt(i):i)}for(const i of n){const[c,u]=i;if(o(`
|
|
6
6
|
${JSON.stringify(c)}
|
|
7
7
|
`),typeof u=="string"||u instanceof Uint8Array)o(u);else{let l;try{l=JSON.stringify(u)}catch{l=JSON.stringify(re(u))}o(l)}}return typeof r=="string"?r:ts(r)}function ts(e){const t=e.reduce((o,i)=>o+i.length,0),n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function ns(e){const t=typeof e.data=="string"?Pt(e.data):e.data;return[Y({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const rs={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket",raw_security:"security"};function Fn(e){return rs[e]}function Xn(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function os(e,t,n,r){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:et(r)},...o&&{trace:Y({...o})}}}function ss(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function is(e,t,n,r){const o=Xn(n),i={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:et(t)}},c="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Pe(i,[c])}function as(e,t,n,r){const o=Xn(n),i=e.type&&e.type!=="replay_event"?e.type:"event";ss(e,n&&n.sdk);const c=os(e,o,r,t);return delete e.sdkProcessingMetadata,Pe(c,[[{type:i},e]])}function wt(e,t,n,r=0){return new W((o,i)=>{const c=e[r];if(t===null||typeof c!="function")o(t);else{const u=c({...t},n);U&&c.id&&u===null&&N.log(`Event processor "${c.id}" dropped event`),We(u)?u.then(l=>wt(e,l,n,r+1).then(o)).then(null,i):wt(e,u,n,r+1).then(o).then(null,i)}})}let tt,Hn,nt;function cs(e){const t=j._sentryDebugIds;if(!t)return{};const n=Object.keys(t);return nt&&n.length===Hn||(Hn=n.length,nt=n.reduce((r,o)=>{tt||(tt={});const i=tt[o];if(i)r[i[0]]=i[1];else{const c=e(o);for(let u=c.length-1;u>=0;u--){const l=c[u],h=l&&l.filename,y=t[o];if(h&&y){r[h]=y,tt[o]=[h,y];break}}}return r},{})),nt}function us(e,t){const{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:i}=t;ls(e,t),r&&fs(e,r),hs(e,n),As(e,o),ds(e,i)}function jn(e,t){const{extra:n,tags:r,user:o,contexts:i,level:c,sdkProcessingMetadata:u,breadcrumbs:l,fingerprint:h,eventProcessors:y,attachments:m,propagationContext:b,transactionName:I,span:B}=t;rt(e,"extra",n),rt(e,"tags",r),rt(e,"user",o),rt(e,"contexts",i),e.sdkProcessingMetadata=$e(e.sdkProcessingMetadata,u,2),c&&(e.level=c),I&&(e.transactionName=I),B&&(e.span=B),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),h.length&&(e.fingerprint=[...e.fingerprint,...h]),y.length&&(e.eventProcessors=[...e.eventProcessors,...y]),m.length&&(e.attachments=[...e.attachments,...m]),e.propagationContext={...e.propagationContext,...b}}function rt(e,t,n){e[t]=$e(e[t],n,1)}function ls(e,t){const{extra:n,tags:r,user:o,contexts:i,level:c,transactionName:u}=t,l=Y(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const h=Y(r);h&&Object.keys(h).length&&(e.tags={...h,...e.tags});const y=Y(o);y&&Object.keys(y).length&&(e.user={...y,...e.user});const m=Y(i);m&&Object.keys(m).length&&(e.contexts={...m,...e.contexts}),c&&(e.level=c),u&&e.type!=="transaction"&&(e.transaction=u)}function As(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function ds(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function fs(e,t){e.contexts={trace:To(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Xo(t),...e.sdkProcessingMetadata};const n=On(t),r=Qt(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function hs(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}function ps(e,t,n,r,o,i){const{normalizeDepth:c=3,normalizeMaxBreadth:u=1e3}=e,l={...t,event_id:t.event_id||n.event_id||ee(),timestamp:t.timestamp||Ve()},h=n.integrations||e.integrations.map(S=>S.name);gs(l,e),Cs(l,h),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&ys(l,e.stackParser);const y=Es(r,n.captureContext);n.mechanism&&ke(l,n.mechanism);const m=o?o.getEventProcessors():[],b=go().getScopeData();if(i){const S=i.getScopeData();jn(b,S)}if(y){const S=y.getScopeData();jn(b,S)}const I=[...n.attachments||[],...b.attachments];I.length&&(n.attachments=I),us(l,b);const B=[...m,...b.eventProcessors];return wt(B,l,n).then(S=>(S&&ms(S),typeof c=="number"&&c>0?bs(S,c,u):S))}function gs(e,t){const{environment:n,release:r,dist:o,maxValueLength:i=250}=t;e.environment=e.environment||n||Nn,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o),e.message&&(e.message=Qe(e.message,i));const c=e.exception&&e.exception.values&&e.exception.values[0];c&&c.value&&(c.value=Qe(c.value,i));const u=e.request;u&&u.url&&(u.url=Qe(u.url,i))}function ys(e,t){const n=cs(t);try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(o=>{n&&o.filename&&(o.debug_id=n[o.filename])})})}catch{}}function ms(e){const t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Cs(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function bs(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:re(o.data,t,n)}}))},...e.user&&{user:re(e.user,t,n)},...e.contexts&&{contexts:re(e.contexts,t,n)},...e.extra&&{extra:re(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=re(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:re(o.data,t,n)}}))),e.contexts&&e.contexts.flags&&r.contexts&&(r.contexts.flags=re(e.contexts.flags,3,n)),r}function Es(e,t){if(!t)return e;const n=e?e.clone():new ae;return n.update(t),n}const vs="7";function Is(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Bs(e){return`${Is(e)}${e.projectId}/envelope/`}function Ss(e,t){const n={sentry_version:vs};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function _s(e,t,n){return t||`${Bs(e)}?${Ss(e,n)}`}const Jn=[];function Qs(e,t){const n={};return t.forEach(r=>{r&&zn(e,r,n)}),n}function qn(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function zn(e,t,n){if(n[t.name]){U&&N.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,Jn.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),Jn.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,i)=>r(o,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),o=Object.assign((i,c)=>r(i,c,e),{id:t.name});e.addEventProcessor(o)}U&&N.log(`Integration installed: ${t.name}`)}function ks(e,t,n){const r=[{type:"client_report"},{timestamp:Ve(),discarded_events:e}];return Pe(t?{dsn:t}:{},[r])}class V extends Error{constructor(t,n="warn"){super(t),this.message=t,this.logLevel=n}}const Kn="Not capturing exception because it's already been captured.";class Ps{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=Ko(t.dsn):U&&N.warn("No DSN provided, client will not send events."),this._dsn){const o=_s(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}const r=["enableTracing","tracesSampleRate","tracesSampler"].find(o=>o in t&&t[o]==null);r&&ze(()=>{console.warn(`[Sentry] Deprecation warning: \`${r}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`)})}captureException(t,n,r){const o=ee();if(In(t))return U&&N.log(Kn),o;const i={event_id:o,...n};return this._process(this.eventFromException(t,i).then(c=>this._captureEvent(c,i,r))),i.event_id}captureMessage(t,n,r,o){const i={event_id:ee(),...r},c=bt(t)?t:String(t),u=Gr(t)?this.eventFromMessage(c,n,i):this.eventFromException(t,i);return this._process(u.then(l=>this._captureEvent(l,i,o))),i.event_id}captureEvent(t,n,r){const o=ee();if(n&&n.originalException&&In(n.originalException))return U&&N.log(Kn),o;const i={event_id:o,...n},u=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(t,i,u||r)),i.event_id}captureSession(t){typeof t.release!="string"?U&&N.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),vt(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(t).then(r=>n.flush(t).then(o=>r&&o))):de(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];zn(this,t,this._integrations),n||qn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=as(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])r=$o(r,ns(i));const o=this.sendEnvelope(r);o&&o.then(i=>this.emit("afterSendEvent",t,i),null)}sendSession(t){const n=is(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){const o=typeof r=="number"?r:1,i=`${t}:${n}`;U&&N.log(`Recording outcome: "${i}"${o>1?` (${o} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+o}}on(t,n){const r=this._hooks[t]=this._hooks[t]||[];return r.push(n),()=>{const o=r.indexOf(n);o>-1&&r.splice(o,1)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(o=>o(...n))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,n=>(U&&N.error("Error while sending envelope:",n),n)):(U&&N.error("Transport disabled"),de({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Qs(this,t),qn(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1;const i=n.exception&&n.exception.values;if(i){o=!0;for(const l of i){const h=l.mechanism;if(h&&h.handled===!1){r=!0;break}}}const c=t.status==="ok";(c&&t.errors===0||c&&r)&&(vt(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new W(n=>{let r=0;const o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=o,t&&r>=t&&(clearInterval(i),n(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r=Pn(),o=po()){const i=this.getOptions(),c=Object.keys(this._integrations);return!n.integrations&&c.length>0&&(n.integrations=c),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),ps(i,t,n,r,this,o).then(u=>{if(u===null)return u;u.contexts={trace:yo(r),...u.contexts};const l=Fo(this,r);return u.sdkProcessingMetadata={dynamicSamplingContext:l,...u.sdkProcessingMetadata},u})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(o=>o.event_id,o=>{U&&(o instanceof V&&o.logLevel==="log"?N.log(o.message):N.warn(o))})}_processEvent(t,n,r){const o=this.getOptions(),{sampleRate:i}=o,c=Wn(t),u=Gn(t),l=t.type||"error",h=`before send for type \`${l}\``,y=typeof i>"u"?void 0:Ho(i);if(u&&typeof y=="number"&&Math.random()>y)return this.recordDroppedEvent("sample_rate","error",t),Ze(new V(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const m=l==="replay_event"?"replay":l,I=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(t,n,r,I).then(B=>{if(B===null)throw this.recordDroppedEvent("event_processor",m,t),new V("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return B;const S=Ts(this,o,B,n);return ws(S,h)}).then(B=>{if(B===null){if(this.recordDroppedEvent("before_send",m,t),c){const k=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",k)}throw new V(`${h} returned \`null\`, will not send event.`,"log")}const Q=r&&r.getSession();if(!c&&Q&&this._updateSessionFromEvent(Q,B),c){const P=B.sdkProcessingMetadata&&B.sdkProcessingMetadata.spanCountBeforeProcessing||0,k=B.spans?B.spans.length:0,R=P-k;R>0&&this.recordDroppedEvent("before_send","span",R)}const S=B.transaction_info;if(c&&S&&B.transaction!==t.transaction){const P="custom";B.transaction_info={...S,source:P}}return this.sendEvent(B,n),B}).then(null,B=>{throw B instanceof V?B:(this.captureException(B,{data:{__sentry__:!0},originalException:B}),new V(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
-
Reason: ${B}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){U&&N.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){U&&N.log("No outcomes to send");return}if(!this._dsn){U&&N.log("No dsn provided, will not send outcomes");return}U&&N.log("Sending outcomes:",t);const n=ks(t,this._options.tunnel&&et(this._dsn));this.sendEnvelope(n)}}function ws(e,t){const n=`${t} must return \`null\` or a valid event.`;if(We(e))return e.then(r=>{if(!me(r)&&r!==null)throw new V(n);return r},r=>{throw new V(`${t} rejected with ${r}`)});if(!me(e)&&e!==null)throw new V(n);return e}function Ts(e,t,n,r){const{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:c}=t;if(Gn(n)&&o)return o(n,r);if(Wn(n)){if(n.spans&&c){const u=[];for(const l of n.spans){const h=c(l);h?u.push(h):(Mo(),e.recordDroppedEvent("before_send","span"))}n.spans=u}if(i){if(n.spans){const u=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(n,r)}}return n}function Gn(e){return e.type===void 0}function Wn(e){return e.type==="transaction"}function Ls(e){const t=[];function n(){return e===void 0||t.length<e}function r(c){return t.splice(t.indexOf(c),1)[0]||Promise.resolve(void 0)}function o(c){if(!n())return Ze(new V("Not adding Promise because buffer limit was reached."));const u=c();return t.indexOf(u)===-1&&t.push(u),u.then(()=>r(u)).then(null,()=>r(u).then(null,()=>{})),u}function i(c){return new W((u,l)=>{let h=t.length;if(!h)return u(!0);const y=setTimeout(()=>{c&&c>0&&u(!1)},c);t.forEach(m=>{de(m).then(()=>{--h||(clearTimeout(y),u(!0))},l)})})}return{$:t,add:o,drain:i}}const Rs=60*1e3;function Os(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Rs:r-t}function Ns(e,t){return e[t]||e.all||0}function Ds(e,t,n=Date.now()){return Ns(e,t)>n}function Ms(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n&&n["x-sentry-rate-limits"],c=n&&n["retry-after"];if(i)for(const u of i.trim().split(",")){const[l,h,,,y]=u.split(":",5),m=parseInt(l,10),b=(isNaN(m)?60:m)*1e3;if(!h)o.all=r+b;else for(const I of h.split(";"))I==="metric_bucket"?(!y||y.split(";").includes("custom"))&&(o[I]=r+b):o[I]=r+b}else c?o.all=r+Os(c,r):t===429&&(o.all=r+60*1e3);return o}const xs=64;function Us(e,t,n=Ls(e.bufferSize||xs)){let r={};const o=c=>n.drain(c);function i(c){const u=[];if(Un(c,(m,b)=>{const I=Fn(b);if(Ds(r,I)){const B=Yn(m,b);e.recordDroppedEvent("ratelimit_backoff",I,B)}else u.push(m)}),u.length===0)return de({});const l=Pe(c[0],u),h=m=>{Un(l,(b,I)=>{const B=Yn(b,I);e.recordDroppedEvent(m,Fn(I),B)})},y=()=>t({body:es(l)}).then(m=>(m.statusCode!==void 0&&(m.statusCode<200||m.statusCode>=300)&&U&&N.warn(`Sentry responded with status code ${m.statusCode} to sent event.`),r=Ms(r,m),m),m=>{throw h("network_error"),m});return n.add(y).then(m=>m,m=>{if(m instanceof V)return U&&N.error("Skipped sending event because buffer is full."),h("queue_overflow"),de({});throw m})}return{send:i,flush:o}}function Yn(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function Fs(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:Ae})),version:Ae}),e._metadata=o}function Xs(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Hs(){return"npm"}const ot=j,js=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Vn(e,t){const n=Lt(e,t),r={type:Gs(t),value:Ws(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Js(e,t,n,r){const o=_t(),i=o&&o.getOptions().normalizeDepth,c=ti(t),u={__serialized__:xn(t,i)};if(c)return{exception:{values:[Vn(e,c)]},extra:u};const l={exception:{values:[{type:Ge(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:$s(t,{isUnhandledRejection:r})}]},extra:u};if(n){const h=Lt(e,n);h.length&&(l.exception.values[0].stacktrace={frames:h})}return l}function Tt(e,t){return{exception:{values:[Vn(e,t)]}}}function Lt(e,t){const n=t.stacktrace||t.stack||"",r=zs(t),o=Ks(t);try{return e(n,r,o)}catch{}return[]}const qs=/Minified React error #\d+;/i;function zs(e){return e&&qs.test(e.message)?1:0}function Ks(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Zn(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Gs(e){const t=e&&e.name;return!t&&Zn(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Ws(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:Zn(e)&&Array.isArray(e.message)&&e.message.length==2?e.message[1]:t:"No error message"}function Ys(e,t,n,r){const o=n&&n.syntheticException||void 0,i=Zs(e,t,o,r);return ke(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),de(i)}function Vs(e,t,n="info",r,o){const i=r&&r.syntheticException||void 0,c=Rt(e,t,i,o);return c.level=n,r&&r.event_id&&(c.event_id=r.event_id),de(c)}function Zs(e,t,n,r,o){let i;if(fn(t)&&t.error)return Tt(e,t.error);if(hn(t)||Kr(t)){const c=t;if("stack"in t)i=Tt(e,t);else{const u=c.name||(hn(c)?"DOMError":"DOMException"),l=c.message?`${u}: ${c.message}`:u;i=Rt(e,l,n,r),vn(i,l)}return"code"in c&&(i.tags={...i.tags,"DOMException.code":`${c.code}`}),i}return dn(t)?Tt(e,t):me(t)||Ge(t)?(i=Js(e,t,n,o),ke(i,{synthetic:!0}),i):(i=Rt(e,t,n,r),vn(i,`${t}`),ke(i,{synthetic:!0}),i)}function Rt(e,t,n,r){const o={};if(r&&n){const i=Lt(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),ke(o,{synthetic:!0})}if(bt(t)){const{__sentry_template_string__:i,__sentry_template_values__:c}=t;return o.logentry={message:i,params:c},o}return o.message=t,o}function $s(e,{isUnhandledRejection:t}){const n=no(e),r="exception";return fn(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Ge(e)?`Event \`${ei(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function ei(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ti(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}function ni(e,{metadata:t,tunnel:n,dsn:r}){const o={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:et(r)}},i=ri(e);return Pe(o,[i])}function ri(e){return[{type:"user_report"},e]}class oi extends Ps{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t},r=ot.SENTRY_SDK_SOURCE||Hs();Fs(n,"browser",["browser"],r),super(n),n.sendClientReports&&ot.document&&ot.document.addEventListener("visibilitychange",()=>{ot.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return Ys(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Vs(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){js&&N.warn("SDK not enabled, will not capture user feedback.");return}const n=ni(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const si=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,st=j,it={};function ii(e){const t=it[e];if(t)return t;let n=st[e];if(Xs(n))return it[e]=n.bind(st);const r=st.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){si&&N.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(it[e]=n.bind(st))}function $n(e){it[e]=void 0}function ai(e,t=ii("fetch")){let n=0,r=0;function o(i){const c=i.body.length;n+=c,r++;const u={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return $n("fetch"),Ze("No fetch implementation available");try{return t(e.url,u).then(l=>(n-=c,r--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return $n("fetch"),n-=c,r--,Ze(l)}}return Us(e,o)}const ci=30,ui=50;function Ot(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?ye:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const li=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ai=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,di=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=[ci,e=>{const t=li.exec(e);if(t){const[,r,o,i]=t;return Ot(r,ye,+o,+i)}const n=Ai.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){const c=di.exec(n[2]);c&&(n[2]=c[1],n[3]=c[2],n[4]=c[3])}const[o,i]=er(n[1]||ye,n[2]);return Ot(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],hi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gi=Jr(...[fi,[ui,e=>{const t=hi.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=pi.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||ye;return[o,r]=er(o,r),Ot(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),er=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:ye,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},yi="https://bbed26c9265c425abb56ff9d3728183e@sentry.chocodev.kz/302";let Nt=null;function mi(e){const t=new oi({dsn:yi,transport:ai,stackParser:gi,integrations:[],release:"1.1.51",environment:e.environment||"production"}),n=new ae;n.setClient(t),n.setTags(e),t.init(),Nt=n}function oe(e,t){Nt&&Nt.captureException(e,t?{captureContext:{extra:t}}:void 0)}function at(e,t){ht("webPayToken",e),t&&ht("webPayRefreshToken",t)}function tr(){Xe("webPayToken"),Xe("webPayRefreshToken")}async function Ci(e){const t=en("webPayRefreshToken");if(t&&e.config.clientId)try{const n=await Or(e.apiUrl,e.config.clientId,t);at(n.access_token,n.refresh_token),e.accessToken=n.access_token;return}catch{Xe("webPayRefreshToken")}if(!e.config.clientId){e.config.onError({attributes:{message:e.t("errorMissingTrackClient")}});return}if(!e.config.trackId&&typeof e.config.onRequestNewTrackId=="function"&&(e.config.trackId=await e.config.onRequestNewTrackId()),!e.config.trackId){e.config.onError({attributes:{message:e.t("errorMissingTrackClient")}});return}try{const n=await tn(e.apiUrl,e.config.clientId,e.config.trackId);at(n.access_token,n.refresh_token),e.accessToken=n.access_token}catch(n){if(typeof e.config.onRequestNewTrackId=="function"){e.config.trackId=await e.config.onRequestNewTrackId();const r=await tn(e.apiUrl,e.config.clientId,e.config.trackId);at(r.access_token,r.refresh_token),e.accessToken=r.access_token}else throw n}}const bi={kaspi_pay:`<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8
|
+
Reason: ${B}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[o,i]=n.split(":");return{reason:o,category:i,quantity:r}})}_flushOutcomes(){U&&N.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){U&&N.log("No outcomes to send");return}if(!this._dsn){U&&N.log("No dsn provided, will not send outcomes");return}U&&N.log("Sending outcomes:",t);const n=ks(t,this._options.tunnel&&et(this._dsn));this.sendEnvelope(n)}}function ws(e,t){const n=`${t} must return \`null\` or a valid event.`;if(We(e))return e.then(r=>{if(!me(r)&&r!==null)throw new V(n);return r},r=>{throw new V(`${t} rejected with ${r}`)});if(!me(e)&&e!==null)throw new V(n);return e}function Ts(e,t,n,r){const{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:c}=t;if(Gn(n)&&o)return o(n,r);if(Wn(n)){if(n.spans&&c){const u=[];for(const l of n.spans){const h=c(l);h?u.push(h):(Mo(),e.recordDroppedEvent("before_send","span"))}n.spans=u}if(i){if(n.spans){const u=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(n,r)}}return n}function Gn(e){return e.type===void 0}function Wn(e){return e.type==="transaction"}function Ls(e){const t=[];function n(){return e===void 0||t.length<e}function r(c){return t.splice(t.indexOf(c),1)[0]||Promise.resolve(void 0)}function o(c){if(!n())return Ze(new V("Not adding Promise because buffer limit was reached."));const u=c();return t.indexOf(u)===-1&&t.push(u),u.then(()=>r(u)).then(null,()=>r(u).then(null,()=>{})),u}function i(c){return new W((u,l)=>{let h=t.length;if(!h)return u(!0);const y=setTimeout(()=>{c&&c>0&&u(!1)},c);t.forEach(m=>{de(m).then(()=>{--h||(clearTimeout(y),u(!0))},l)})})}return{$:t,add:o,drain:i}}const Rs=60*1e3;function Os(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?Rs:r-t}function Ns(e,t){return e[t]||e.all||0}function Ds(e,t,n=Date.now()){return Ns(e,t)>n}function Ms(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n&&n["x-sentry-rate-limits"],c=n&&n["retry-after"];if(i)for(const u of i.trim().split(",")){const[l,h,,,y]=u.split(":",5),m=parseInt(l,10),b=(isNaN(m)?60:m)*1e3;if(!h)o.all=r+b;else for(const I of h.split(";"))I==="metric_bucket"?(!y||y.split(";").includes("custom"))&&(o[I]=r+b):o[I]=r+b}else c?o.all=r+Os(c,r):t===429&&(o.all=r+60*1e3);return o}const xs=64;function Us(e,t,n=Ls(e.bufferSize||xs)){let r={};const o=c=>n.drain(c);function i(c){const u=[];if(Un(c,(m,b)=>{const I=Fn(b);if(Ds(r,I)){const B=Yn(m,b);e.recordDroppedEvent("ratelimit_backoff",I,B)}else u.push(m)}),u.length===0)return de({});const l=Pe(c[0],u),h=m=>{Un(l,(b,I)=>{const B=Yn(b,I);e.recordDroppedEvent(m,Fn(I),B)})},y=()=>t({body:es(l)}).then(m=>(m.statusCode!==void 0&&(m.statusCode<200||m.statusCode>=300)&&U&&N.warn(`Sentry responded with status code ${m.statusCode} to sent event.`),r=Ms(r,m),m),m=>{throw h("network_error"),m});return n.add(y).then(m=>m,m=>{if(m instanceof V)return U&&N.error("Skipped sending event because buffer is full."),h("queue_overflow"),de({});throw m})}return{send:i,flush:o}}function Yn(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function Fs(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(i=>({name:`${r}:@sentry/${i}`,version:Ae})),version:Ae}),e._metadata=o}function Xs(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Hs(){return"npm"}const ot=j,js=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Vn(e,t){const n=Lt(e,t),r={type:Gs(t),value:Ws(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Js(e,t,n,r){const o=_t(),i=o&&o.getOptions().normalizeDepth,c=ti(t),u={__serialized__:xn(t,i)};if(c)return{exception:{values:[Vn(e,c)]},extra:u};const l={exception:{values:[{type:Ge(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:$s(t,{isUnhandledRejection:r})}]},extra:u};if(n){const h=Lt(e,n);h.length&&(l.exception.values[0].stacktrace={frames:h})}return l}function Tt(e,t){return{exception:{values:[Vn(e,t)]}}}function Lt(e,t){const n=t.stacktrace||t.stack||"",r=zs(t),o=Ks(t);try{return e(n,r,o)}catch{}return[]}const qs=/Minified React error #\d+;/i;function zs(e){return e&&qs.test(e.message)?1:0}function Ks(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Zn(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function Gs(e){const t=e&&e.name;return!t&&Zn(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Ws(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:Zn(e)&&Array.isArray(e.message)&&e.message.length==2?e.message[1]:t:"No error message"}function Ys(e,t,n,r){const o=n&&n.syntheticException||void 0,i=Zs(e,t,o,r);return ke(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),de(i)}function Vs(e,t,n="info",r,o){const i=r&&r.syntheticException||void 0,c=Rt(e,t,i,o);return c.level=n,r&&r.event_id&&(c.event_id=r.event_id),de(c)}function Zs(e,t,n,r,o){let i;if(fn(t)&&t.error)return Tt(e,t.error);if(hn(t)||Kr(t)){const c=t;if("stack"in t)i=Tt(e,t);else{const u=c.name||(hn(c)?"DOMError":"DOMException"),l=c.message?`${u}: ${c.message}`:u;i=Rt(e,l,n,r),vn(i,l)}return"code"in c&&(i.tags={...i.tags,"DOMException.code":`${c.code}`}),i}return dn(t)?Tt(e,t):me(t)||Ge(t)?(i=Js(e,t,n,o),ke(i,{synthetic:!0}),i):(i=Rt(e,t,n,r),vn(i,`${t}`),ke(i,{synthetic:!0}),i)}function Rt(e,t,n,r){const o={};if(r&&n){const i=Lt(e,n);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]}),ke(o,{synthetic:!0})}if(bt(t)){const{__sentry_template_string__:i,__sentry_template_values__:c}=t;return o.logentry={message:i,params:c},o}return o.message=t,o}function $s(e,{isUnhandledRejection:t}){const n=no(e),r="exception";return fn(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:Ge(e)?`Event \`${ei(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function ei(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function ti(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}function ni(e,{metadata:t,tunnel:n,dsn:r}){const o={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:et(r)}},i=ri(e);return Pe(o,[i])}function ri(e){return[{type:"user_report"},e]}class oi extends Ps{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t},r=ot.SENTRY_SDK_SOURCE||Hs();Fs(n,"browser",["browser"],r),super(n),n.sendClientReports&&ot.document&&ot.document.addEventListener("visibilitychange",()=>{ot.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return Ys(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Vs(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){js&&N.warn("SDK not enabled, will not capture user feedback.");return}const n=ni(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const si=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,st=j,it={};function ii(e){const t=it[e];if(t)return t;let n=st[e];if(Xs(n))return it[e]=n.bind(st);const r=st.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[e]&&(n=i[e]),r.head.removeChild(o)}catch(o){si&&N.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(it[e]=n.bind(st))}function $n(e){it[e]=void 0}function ai(e,t=ii("fetch")){let n=0,r=0;function o(i){const c=i.body.length;n+=c,r++;const u={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return $n("fetch"),Ze("No fetch implementation available");try{return t(e.url,u).then(l=>(n-=c,r--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return $n("fetch"),n-=c,r--,Ze(l)}}return Us(e,o)}const ci=30,ui=50;function Ot(e,t,n,r){const o={filename:e,function:t==="<anonymous>"?ye:t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const li=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ai=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,di=/\((\S*)(?::(\d+))(?::(\d+))\)/,fi=[ci,e=>{const t=li.exec(e);if(t){const[,r,o,i]=t;return Ot(r,ye,+o,+i)}const n=Ai.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){const c=di.exec(n[2]);c&&(n[2]=c[1],n[3]=c[2],n[4]=c[3])}const[o,i]=er(n[1]||ye,n[2]);return Ot(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],hi=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gi=Jr(...[fi,[ui,e=>{const t=hi.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=pi.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],o=t[1]||ye;return[o,r]=er(o,r),Ot(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]]),er=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:ye,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},yi="https://bbed26c9265c425abb56ff9d3728183e@sentry.chocodev.kz/302";let Nt=null;function mi(e){const t=new oi({dsn:yi,transport:ai,stackParser:gi,integrations:[],release:"1.1.53",environment:e.environment||"production"}),n=new ae;n.setClient(t),n.setTags(e),t.init(),Nt=n}function oe(e,t){Nt&&Nt.captureException(e,t?{captureContext:{extra:t}}:void 0)}function at(e,t){ht("webPayToken",e),t&&ht("webPayRefreshToken",t)}function tr(){Xe("webPayToken"),Xe("webPayRefreshToken")}async function Ci(e){const t=en("webPayRefreshToken");if(t&&e.config.clientId)try{const n=await Or(e.apiUrl,e.config.clientId,t);at(n.access_token,n.refresh_token),e.accessToken=n.access_token;return}catch{Xe("webPayRefreshToken")}if(!e.config.clientId){e.config.onError({attributes:{message:e.t("errorMissingTrackClient")}});return}if(!e.config.trackId&&typeof e.config.onRequestNewTrackId=="function"&&(e.config.trackId=await e.config.onRequestNewTrackId()),!e.config.trackId){e.config.onError({attributes:{message:e.t("errorMissingTrackClient")}});return}try{const n=await tn(e.apiUrl,e.config.clientId,e.config.trackId);at(n.access_token,n.refresh_token),e.accessToken=n.access_token}catch(n){if(typeof e.config.onRequestNewTrackId=="function"){e.config.trackId=await e.config.onRequestNewTrackId();const r=await tn(e.apiUrl,e.config.clientId,e.config.trackId);at(r.access_token,r.refresh_token),e.accessToken=r.access_token}else throw n}}const bi={kaspi_pay:`<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
9
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.89711 8.50443C10.4185 8.72365 10.6242 9.56386 10.7471 10.3459L10.7816 10.5699L10.8557 11.0301C11.0006 11.9088 11.303 13.7327 11.303 14.6845C11.303 14.9224 11.2806 15.105 11.2396 15.2053C11.1713 15.3599 10.9724 15.5082 10.6978 15.6319C10.0332 15.7846 9.33863 15.8671 8.62315 15.8671C8.54739 15.8671 8.47285 15.8637 8.39805 15.8616C8.10889 15.785 7.89156 15.657 7.77649 15.4821C7.42905 14.9542 7.40812 13.7781 7.40116 12.4037L7.40037 12.2443L7.39755 11.8324C7.38623 10.3774 7.37651 9.1229 7.94288 8.67272C8.16223 8.49957 8.47392 8.44225 8.89711 8.50443ZM5.58009 11.6722C5.90978 11.6548 6.12181 13.1684 6.16441 14.3162C6.19427 15.1152 6.10438 15.4439 5.96084 15.5619C5.79833 15.5113 5.63864 15.4565 5.48128 15.397C5.3763 15.219 5.29607 14.9389 5.2451 14.5721C5.08947 13.4193 5.22466 11.6925 5.58009 11.6722ZM13.8455 13.934C13.825 14.0391 13.796 14.1204 13.7602 14.1889C13.4783 14.4 13.1821 14.5938 12.872 14.7682C12.7733 14.7837 12.6856 14.7729 12.6427 14.7053C12.2318 14.0314 12.0775 11.9173 12.4752 11.7333C12.9936 11.4995 13.9224 13.5685 13.8455 13.934ZM8.50042 0C13.1296 0 16.8941 3.42166 16.9979 7.67934L17 7.82651V7.89454C16.9915 9.81778 16.2332 11.5773 14.9839 12.9392C14.9386 12.918 14.8559 12.8486 14.7062 12.6395C14.5512 12.4293 13.2148 10.5096 13.2148 8.30946C13.2148 7.87768 13.8816 7.20318 14.4717 6.61114C14.9128 6.16562 15.3306 5.74539 15.4845 5.4151C15.6804 4.98892 15.5433 4.69134 15.3265 4.59047C15.1302 4.50082 14.8355 4.56621 14.6287 4.90904C14.2893 5.46389 14.1805 5.56758 13.6855 5.93882C13.1984 6.30986 12.424 6.68338 12.424 6.19988C12.424 5.93882 12.8553 5.34757 13.0684 4.93314C13.286 4.51408 13.0515 4.21072 12.6022 4.21072C11.7198 4.21072 11.1341 5.2598 11.1341 5.62326C11.1341 5.98642 11.3229 6.03813 11.3229 6.46104C11.3229 6.88713 10.3548 7.4398 9.44281 7.4398C8.56481 7.4398 8.05566 7.27394 7.8447 6.80665L7.81777 6.74105L7.75678 6.57266C7.54046 5.98255 7.38528 5.55458 7.11514 5.10733C6.9717 4.87081 6.75038 4.70684 6.55897 4.56257C6.30881 4.38121 6.17902 4.21421 6.15193 4.08967C6.12696 3.96611 6.11352 3.73326 6.54117 3.19648C6.96793 2.66277 7.02775 2.25958 6.81418 2.05153C6.73678 1.97752 6.60482 1.93011 6.43535 1.93011C6.13562 1.93011 5.71912 2.07834 5.2899 2.48551C4.62267 3.12364 5.00146 3.72951 5.00146 3.99548C5.00146 4.26127 4.87922 4.41162 4.47882 4.77323C4.07547 5.13644 3.93627 5.44783 3.89014 6.69935C3.87247 7.3442 3.75079 7.71539 3.64156 8.04453C3.54718 8.33302 3.46038 8.60425 3.45569 8.99611C3.44822 9.43038 3.52566 9.71023 3.61604 10.0331C3.70477 10.3316 3.79902 10.6736 3.8594 11.2456C3.95544 12.1312 3.92205 12.8792 3.74744 13.6437L3.70084 13.8353L3.68995 13.8903C3.65419 14.0247 3.61168 14.1879 3.55423 14.249C1.4029 12.8228 0 10.4936 0 7.86072C0 3.51974 3.80561 0 8.50042 0Z" fill="#F14635"/>
|
|
10
10
|
</svg>
|
|
11
11
|
`,new_card:`<svg width="21" height="12" viewBox="0 0 21 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -119,6 +119,7 @@ Reason: ${B}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessi
|
|
|
119
119
|
<div class="choco-widget-balance-info">
|
|
120
120
|
<div class="choco-widget-balance-text">
|
|
121
121
|
<div class="choco-widget-balance-label">${r("coupon")}${u?` <span style="color:#767485">(${u})</span>`:""}</div>
|
|
122
|
+
${e.suppresses_cashback&&!n?`<div class="choco-widget-balance-sublabel">${r("couponSuppressesCashback")}</div>`:""}
|
|
122
123
|
</div>
|
|
123
124
|
</div>
|
|
124
125
|
<div class="choco-widget-balance-label-wrapper">
|
|
@@ -297,7 +298,7 @@ Reason: ${B}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessi
|
|
|
297
298
|
<div class="choco-widget-bottom-bar-prerender">
|
|
298
299
|
<div class="choco-widget-payment-loading"></div>
|
|
299
300
|
</div>
|
|
300
|
-
`}function wi(e,t,n,r={}){return nr(e,t,n,r)}function Ti(e){return ct(e)}function Li(e){if(typeof document>"u")return{mountTarget:null,isEmbedded:!1};const t=e.config.containerSelector;if(t){const n=document.querySelector(t);if(n instanceof HTMLElement)return{mountTarget:n,isEmbedded:!0}}return{mountTarget:document.body,isEmbedded:!1}}function rr(e){if(typeof document>"u")return!1;e.container||(e.container=document.createElement("div"),e.container.id="choco-one-click-widget",e.container.className="choco-one-click-widget");const{mountTarget:t,isEmbedded:n}=Li(e);return t?(e.container.parentElement!==t&&t.appendChild(e.container),e.container.classList.toggle("choco-one-click-widget--embedded",n),!0):!1}function Ri(e){rr(e)&&(e.container.style.setProperty("--choco-widget-accent-color",e.config.color),e.container.innerHTML=Pi())}function Oi(e){var y,m,b,I,B;if(e._destroyed||!rr(e))return;e.container.style.setProperty("--choco-widget-accent-color",e.config.color),e.container.classList.remove("choco-one-click-widget--visible");const t=e.getAvailablePaymentMethods(),n=(y=e.checkoutContext)==null?void 0:y.data,r=e.config.currency||"KZT",o=(I=(b=(m=n==null?void 0:n.balance)==null?void 0:m.data)==null?void 0:b.money)==null?void 0:I[r],i=!e.config.disableUseBalance&&o>0?Z(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?Z(c.cashbackAmount,e.config.locale,e.config.currency):null,l=e._getPayableAmount(),h=l<e.config.amount;e.container.innerHTML=ki({amountFormatted:Z(l,e.config.locale,e.config.currency),originalAmountFormatted:Z(e.config.amount,e.config.locale,e.config.currency),showOriginalAmount:h,paymentMethod:e.selectedPaymentMethod,methods:t,selectedMethod:e.selectedPaymentMethod,balanceFormatted:i,useBalance:e.useBalance,bonuses:e.config.bonuses,useBonuses:e.useBonuses,coupon:e.selectedCoupon,useCoupon:e.useCoupon,couponDisabled:e._isCouponDisabled(),cashbackFormatted:u,disabled:e.disabled,paymentMethodDisabled:e.paymentMethodDisabled,loading:e.loading,showFreedomBtn:!e.config.isFridge&&e.config.onFreedomLink!==null,freedomAmountFormatted:Z(Math.round(l*.
|
|
301
|
+
`}function wi(e,t,n,r={}){return nr(e,t,n,r)}function Ti(e){return ct(e)}function Li(e){if(typeof document>"u")return{mountTarget:null,isEmbedded:!1};const t=e.config.containerSelector;if(t){const n=document.querySelector(t);if(n instanceof HTMLElement)return{mountTarget:n,isEmbedded:!0}}return{mountTarget:document.body,isEmbedded:!1}}function rr(e){if(typeof document>"u")return!1;e.container||(e.container=document.createElement("div"),e.container.id="choco-one-click-widget",e.container.className="choco-one-click-widget");const{mountTarget:t,isEmbedded:n}=Li(e);return t?(e.container.parentElement!==t&&t.appendChild(e.container),e.container.classList.toggle("choco-one-click-widget--embedded",n),!0):!1}function Ri(e){rr(e)&&(e.container.style.setProperty("--choco-widget-accent-color",e.config.color),e.container.innerHTML=Pi())}function Oi(e){var y,m,b,I,B;if(e._destroyed||!rr(e))return;e.container.style.setProperty("--choco-widget-accent-color",e.config.color),e.container.classList.remove("choco-one-click-widget--visible");const t=e.getAvailablePaymentMethods(),n=(y=e.checkoutContext)==null?void 0:y.data,r=e.config.currency||"KZT",o=(I=(b=(m=n==null?void 0:n.balance)==null?void 0:m.data)==null?void 0:b.money)==null?void 0:I[r],i=!e.config.disableUseBalance&&o>0?Z(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?Z(c.cashbackAmount,e.config.locale,e.config.currency):null,l=e._getPayableAmount(),h=l<e.config.amount;e.container.innerHTML=ki({amountFormatted:Z(l,e.config.locale,e.config.currency),originalAmountFormatted:Z(e.config.amount,e.config.locale,e.config.currency),showOriginalAmount:h,paymentMethod:e.selectedPaymentMethod,methods:t,selectedMethod:e.selectedPaymentMethod,balanceFormatted:i,useBalance:e.useBalance,bonuses:e.config.bonuses,useBonuses:e.useBonuses,coupon:e.selectedCoupon,useCoupon:e.useCoupon,couponDisabled:e._isCouponDisabled(),cashbackFormatted:u,disabled:e.disabled,paymentMethodDisabled:e.paymentMethodDisabled,loading:e.loading,showFreedomBtn:!e.config.isFridge&&e.config.onFreedomLink!==null,freedomAmountFormatted:Z(Math.round(l*.94),e.config.locale,e.config.currency),t:(Q,S)=>e.t(Q,S),currency:r}),e._attachEventListeners(),e.isOpen=!0,e._emitUserEvent("one_click_pay_cta_rendered",{terminal_id:e.config.terminalId,project_id:e.config.projectId??e.config.clientId}),e._emitUserEvent("one_click_pay_method_resolved",{payment_method:e._getPaymentMethodForUserEvent()}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var Q;e._destroyed||(Q=e.container)==null||Q.classList.add("choco-one-click-widget--visible")})})}function we(e){var r;const t=(r=e.container)==null?void 0:r.querySelector(".choco-widget-payment-methods");if(!t)return;const n=e.getAvailablePaymentMethods();t.innerHTML=wi(n,e.selectedPaymentMethod,o=>e.t(o),{editMode:e.isPaymentSheetEditMode}),t.querySelectorAll("[data-action='delete-card']").forEach(o=>{o.addEventListener("click",i=>{i.stopPropagation();const c=JSON.parse(o.getAttribute("data-method")||"{}");Ui(e,c)})}),t.querySelectorAll("[data-action='select-method']").forEach(o=>{o.addEventListener("click",i=>{const c=JSON.parse(i.currentTarget.getAttribute("data-method")||"{}");cr(e,c)})})}function or(e){var o,i,c;const t=(o=e.container)==null?void 0:o.querySelector(".choco-widget-payment-method"),n=(i=e.container)==null?void 0:i.querySelector(".choco-widget-method-name"),r=(c=e.container)==null?void 0:c.querySelector(".choco-widget-method-icon-wrapper");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=Ti(e.selectedPaymentMethod)),sr(e)}function ut(e){var m,b,I,B,Q,S;const t=(m=e.container)==null?void 0:m.querySelector(".choco-widget-pay-button"),n=(b=e.container)==null?void 0:b.querySelector(".choco-widget-google-pay-amount"),r=(I=e.container)==null?void 0:I.querySelector(".choco-widget-google-pay-amount-label");let o=(B=e.container)==null?void 0:B.querySelector(".choco-widget-google-pay-amount-value"),i=(Q=e.container)==null?void 0:Q.querySelector(".choco-widget-google-pay-amount-value-number");const c=e._getPayableAmount(),u=Z(c,e.config.locale,e.config.currency),l=c<e.config.amount,h=Z(e.config.amount,e.config.locale,e.config.currency);if(t){const P=e.paymentMethodDisabled?e.t("login"):`${e.t("pay")} ${u}`;t.textContent=P,t.setAttribute("aria-label",P)}const y=(S=e.container)==null?void 0:S.querySelector(".choco-widget-freedom-card-btn");if(y&&(y.textContent=`от ${Z(Math.round(c*.94),e.config.locale,e.config.currency)} по карте Freedom`),r&&(r.textContent=`${e.t("total")} ${u}`),!l){o==null||o.remove();return}!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(".choco-widget-google-pay-amount-value-number")),i?i.textContent=h:o&&(o.textContent=`${e.t("instead")} ${h}`)}function sr(e){var l,h,y,m,b,I,B,Q,S,P;const t=((l=e.selectedPaymentMethod)==null?void 0:l.type)==="google_pay",n=((h=e.selectedPaymentMethod)==null?void 0:h.type)==="apple_pay",r=t||n,o=(y=e.container)==null?void 0:y.querySelector(".choco-widget-pay-button"),i=(m=e.container)==null?void 0:m.querySelector(".choco-widget-google-pay-amount"),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");if(o==null||o.classList.toggle("choco-widget-pay-button--hidden",r),i==null||i.classList.toggle("choco-widget-google-pay-amount--hidden",!r),c==null||c.classList.toggle("choco-widget-google-pay-row--hidden",!t),u==null||u.classList.toggle("choco-widget-apple-pay-row--hidden",!n),t){Ni(e);const k=(B=e.container)==null?void 0:B.querySelector('[data-action="apple-pay-button-slot"]');k&&(k.innerHTML="")}else if(n){e._googlePayButtonRenderVersion+=1;const k=(Q=e.container)==null?void 0:Q.querySelector('[data-action="google-pay-button-slot"]');k&&(k.innerHTML=""),Di(e)}else{e._googlePayButtonRenderVersion+=1;const k=(S=e.container)==null?void 0:S.querySelector('[data-action="google-pay-button-slot"]'),R=(P=e.container)==null?void 0:P.querySelector('[data-action="apple-pay-button-slot"]');k&&(k.innerHTML=""),R&&(R.innerHTML="")}ut(e),ce(e)}async function Ni(e){var c,u,l,h,y;const t=(c=e.container)==null?void 0:c.querySelector('[data-action="google-pay-button-slot"]');if(!t||(t.innerHTML="",((u=e.selectedPaymentMethod)==null?void 0:u.type)!=="google_pay"))return;const n=++e._googlePayButtonRenderVersion;try{await e._loadGooglePaySdk()}catch{e.config.onError({attributes:{message:e.t("errorGooglePayUnsupported")}});return}if(n!==e._googlePayButtonRenderVersion)return;if(!((y=(h=(l=window.google)==null?void 0:l.payments)==null?void 0:h.api)!=null&&y.PaymentsClient)){e.config.onError({attributes:{message:e.t("errorGooglePayUnsupported")}});return}const r=e.config.environment==="production",i=new window.google.payments.api.PaymentsClient({environment:r?"PRODUCTION":"TEST"}).createButton({onClick:()=>e.handlePayment(),buttonType:"pay",buttonColor:"black",buttonLocale:e.config.locale||"ru",buttonSizeMode:"fill"});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(m=>{m.style.setProperty("border-radius","12px","important"),m.style.setProperty("font-weight","bold","important"),m.style.setProperty("font-size","16px","important")}),t.appendChild(i),ce(e)}function Di(e){var i,c;const t=(i=e.container)==null?void 0:i.querySelector('[data-action="apple-pay-button-slot"]');if(!t||(t.innerHTML="",((c=e.selectedPaymentMethod)==null?void 0:c.type)!=="apple_pay"))return;const n=document.createElement("div");n.className="choco-widget-apple-pay-button-wrapper";const r=document.createElement("button");r.type="button",r.className="choco-widget-apple-pay-button choco-widget-apple-pay-button--native",r.setAttribute("aria-label","Оплатить с Apple Pay"),r.style.setProperty("width","100%","important"),r.style.setProperty("height","52px","important"),r.style.setProperty("min-height","52px","important"),r.style.setProperty("border-radius","12px","important"),r.style.setProperty("-webkit-appearance","-apple-pay-button"),r.style.setProperty("-apple-pay-button-type","buy"),r.style.setProperty("-apple-pay-button-style","black"),r.addEventListener("click",()=>e.handlePayment());const o=document.createElement("div");o.className="choco-widget-apple-pay-button-overlay",o.setAttribute("aria-hidden","true"),o.innerHTML=`
|
|
301
302
|
<span class="choco-widget-apple-pay-button-text">Оплатить с</span>
|
|
302
303
|
<span class="choco-widget-apple-pay-button-icon">
|
|
303
304
|
<svg width="52" height="24" viewBox="0 0 52 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|