choco-one-click-payment 1.1.39 → 1.1.40
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 +367 -353
- package/dist/index.js +31 -23
- package/index.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-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)}})();
|
|
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;background:#f1f2f7;border:none;border-radius:16px;font-size:16px;font-weight:600;font-family:inherit;color:#242424;cursor:pointer;transition:background .2s ease}.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
2
|
const bt = {
|
|
3
3
|
ru: {
|
|
4
4
|
paymentMethod: "Способ оплаты",
|
|
@@ -237,8 +237,8 @@ function wt() {
|
|
|
237
237
|
Object.defineProperty(l, "__esModule", {
|
|
238
238
|
value: !0
|
|
239
239
|
}), l.Centrifuge = void 0;
|
|
240
|
-
var C =
|
|
241
|
-
function
|
|
240
|
+
var C = Q(f(187)), P = Q(f(471)), _ = f(147), E = f(853);
|
|
241
|
+
function Q(g) {
|
|
242
242
|
return g && g.__esModule ? g : { default: g };
|
|
243
243
|
}
|
|
244
244
|
function T(g) {
|
|
@@ -249,7 +249,7 @@ function wt() {
|
|
|
249
249
|
return p && typeof Symbol == "function" && p.constructor === Symbol && p !== Symbol.prototype ? "symbol" : typeof p;
|
|
250
250
|
}, T(g);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function B(g, h) {
|
|
253
253
|
if (!(g instanceof h))
|
|
254
254
|
throw new TypeError("Cannot call a class as a function");
|
|
255
255
|
}
|
|
@@ -259,10 +259,10 @@ function wt() {
|
|
|
259
259
|
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(g, A.key, A);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function k(g, h, p) {
|
|
263
263
|
return h && w(g.prototype, h), g;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function b(g, h) {
|
|
266
266
|
if (typeof h != "function" && h !== null)
|
|
267
267
|
throw new TypeError("Super expression must either be null or a function");
|
|
268
268
|
g.prototype = Object.create(h && h.prototype, { constructor: { value: g, writable: !0, configurable: !0 } }), h && L(g, h);
|
|
@@ -312,11 +312,11 @@ function wt() {
|
|
|
312
312
|
}, J(g);
|
|
313
313
|
}
|
|
314
314
|
var x = "timeout", M = "connection closed", m = /* @__PURE__ */ (function(g) {
|
|
315
|
-
|
|
315
|
+
b(p, g);
|
|
316
316
|
var h = O(p);
|
|
317
317
|
function p(A, n) {
|
|
318
318
|
var r;
|
|
319
|
-
return
|
|
319
|
+
return B(this, p), r = h.call(this), r._url = A, r._websocket = null, r._sockjs = null, r._isSockjs = !1, r._xmlhttprequest = null, r._binary = !1, r._methodType = null, r._pushType = null, r._encoder = null, r._decoder = null, r._status = "disconnected", r._reconnect = !0, r._reconnecting = !1, r._transport = null, r._transportName = null, r._transportClosed = !0, r._messageId = 0, r._clientID = null, r._refreshRequired = !1, r._subs = {}, r._serverSubs = {}, r._lastSeq = {}, r._lastGen = {}, r._lastOffset = {}, r._lastEpoch = {}, r._messages = [], r._isBatching = !1, r._isSubscribeBatching = !1, r._privateChannels = {}, r._numRefreshFailed = 0, r._refreshTimeout = null, r._pingTimeout = null, r._pongTimeout = null, r._subRefreshTimeouts = {}, r._retries = 0, r._callbacks = {}, r._latency = null, r._latencyStart = null, r._connectData = null, r._token = null, r._xhrID = 0, r._xhrs = {}, r._dispatchPromise = Promise.resolve(), r._protocol = "", r._config = {
|
|
320
320
|
protocol: "",
|
|
321
321
|
debug: !1,
|
|
322
322
|
name: "js",
|
|
@@ -351,7 +351,7 @@ function wt() {
|
|
|
351
351
|
disableWithCredentials: !1
|
|
352
352
|
}, r._configure(n), r;
|
|
353
353
|
}
|
|
354
|
-
return
|
|
354
|
+
return k(p, [{
|
|
355
355
|
key: "setToken",
|
|
356
356
|
value: function(n) {
|
|
357
357
|
this._token = n;
|
|
@@ -389,24 +389,24 @@ function wt() {
|
|
|
389
389
|
}, {
|
|
390
390
|
key: "_ajax",
|
|
391
391
|
value: function(n, r, c, d, y) {
|
|
392
|
-
var
|
|
392
|
+
var v = this, S = "";
|
|
393
393
|
this._debug("sending AJAX request to", n, "with data", JSON.stringify(d));
|
|
394
|
-
var
|
|
395
|
-
this._xmlhttprequest !== null ?
|
|
394
|
+
var I;
|
|
395
|
+
this._xmlhttprequest !== null ? I = new this._xmlhttprequest() : I = f.g.XMLHttpRequest ? new f.g.XMLHttpRequest() : new f.g.ActiveXObject("Microsoft.XMLHTTP");
|
|
396
396
|
for (var R in r)
|
|
397
|
-
r.hasOwnProperty(R) && (
|
|
398
|
-
|
|
397
|
+
r.hasOwnProperty(R) && (S.length > 0 && (S += "&"), S += encodeURIComponent(R) + "=" + encodeURIComponent(r[R]));
|
|
398
|
+
S.length > 0 && (S = "?" + S), I.open("POST", n + S, !0), "withCredentials" in I && (I.withCredentials = !this._config.disableWithCredentials), I.setRequestHeader("X-Requested-With", "XMLHttpRequest"), I.setRequestHeader("Content-Type", "application/json");
|
|
399
399
|
for (var X in c)
|
|
400
|
-
c.hasOwnProperty(X) &&
|
|
401
|
-
return
|
|
402
|
-
if (
|
|
403
|
-
if (
|
|
400
|
+
c.hasOwnProperty(X) && I.setRequestHeader(X, c[X]);
|
|
401
|
+
return I.onreadystatechange = function() {
|
|
402
|
+
if (I.readyState === 4)
|
|
403
|
+
if (I.status === 200) {
|
|
404
404
|
var U, D = !1;
|
|
405
405
|
try {
|
|
406
|
-
U = JSON.parse(
|
|
406
|
+
U = JSON.parse(I.responseText), D = !0;
|
|
407
407
|
} catch {
|
|
408
408
|
y({
|
|
409
|
-
error: "Invalid JSON. Data was: " +
|
|
409
|
+
error: "Invalid JSON. Data was: " + I.responseText,
|
|
410
410
|
status: 200,
|
|
411
411
|
data: null
|
|
412
412
|
});
|
|
@@ -416,23 +416,23 @@ function wt() {
|
|
|
416
416
|
status: 200
|
|
417
417
|
});
|
|
418
418
|
} else
|
|
419
|
-
|
|
420
|
-
status:
|
|
419
|
+
v._log("wrong status code in AJAX response", I.status), y({
|
|
420
|
+
status: I.status,
|
|
421
421
|
data: null
|
|
422
422
|
});
|
|
423
423
|
}, setTimeout(function() {
|
|
424
|
-
return
|
|
425
|
-
}, 20),
|
|
424
|
+
return I.send(JSON.stringify(d));
|
|
425
|
+
}, 20), I;
|
|
426
426
|
}
|
|
427
427
|
}, {
|
|
428
428
|
key: "_log",
|
|
429
429
|
value: function() {
|
|
430
|
-
(0,
|
|
430
|
+
(0, E.log)("info", arguments);
|
|
431
431
|
}
|
|
432
432
|
}, {
|
|
433
433
|
key: "_debug",
|
|
434
434
|
value: function() {
|
|
435
|
-
this._config.debug === !0 && (0,
|
|
435
|
+
this._config.debug === !0 && (0, E.log)("debug", arguments);
|
|
436
436
|
}
|
|
437
437
|
}, {
|
|
438
438
|
key: "_websocketSupported",
|
|
@@ -458,9 +458,9 @@ function wt() {
|
|
|
458
458
|
value: function(n) {
|
|
459
459
|
if (!("Promise" in f.g))
|
|
460
460
|
throw new Error("Promise polyfill required");
|
|
461
|
-
if ((0,
|
|
461
|
+
if ((0, E.extend)(this._config, n || {}), this._debug("centrifuge config", this._config), !this._url)
|
|
462
462
|
throw new Error("url required");
|
|
463
|
-
var r = (0,
|
|
463
|
+
var r = (0, E.startsWith)(this._url, "ws") && this._url.indexOf("format=protobuf") > -1;
|
|
464
464
|
if (r || this._config.protocol === "protobuf")
|
|
465
465
|
this._setFormat("protobuf"), this._protocol = "protobuf";
|
|
466
466
|
else {
|
|
@@ -468,7 +468,7 @@ function wt() {
|
|
|
468
468
|
throw new Error("unsupported protocol " + this._config.protocol);
|
|
469
469
|
this._setFormat("json");
|
|
470
470
|
}
|
|
471
|
-
if ((0,
|
|
471
|
+
if ((0, E.startsWith)(this._url, "http"))
|
|
472
472
|
if (this._debug("client will try to connect to SockJS endpoint"), this._config.sockjs !== null)
|
|
473
473
|
this._debug("SockJS explicitly provided in options"), this._sockjs = this._config.sockjs;
|
|
474
474
|
else {
|
|
@@ -513,7 +513,7 @@ function wt() {
|
|
|
513
513
|
}, {
|
|
514
514
|
key: "_getRetryInterval",
|
|
515
515
|
value: function() {
|
|
516
|
-
var n = (0,
|
|
516
|
+
var n = (0, E.backoff)(this._retries, this._config.minRetry, this._config.maxRetry);
|
|
517
517
|
return this._retries += 1, n;
|
|
518
518
|
}
|
|
519
519
|
}, {
|
|
@@ -546,12 +546,12 @@ function wt() {
|
|
|
546
546
|
this._callbacks = {};
|
|
547
547
|
for (var y in this._subs)
|
|
548
548
|
if (this._subs.hasOwnProperty(y)) {
|
|
549
|
-
var
|
|
550
|
-
n ? (
|
|
549
|
+
var v = this._subs[y];
|
|
550
|
+
n ? (v._isSuccess() && (v._triggerUnsubscribe(), v._recover = !0), v._shouldResubscribe() && v._setSubscribing()) : v._setUnsubscribed();
|
|
551
551
|
}
|
|
552
552
|
this._abortInflightXHRs(), this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
553
|
-
for (var
|
|
554
|
-
this._subRefreshTimeouts.hasOwnProperty(
|
|
553
|
+
for (var S in this._subRefreshTimeouts)
|
|
554
|
+
this._subRefreshTimeouts.hasOwnProperty(S) && this._subRefreshTimeouts[S] && this._clearSubRefreshTimeout(S);
|
|
555
555
|
this._subRefreshTimeouts = {}, this._reconnect || (this._subs = {});
|
|
556
556
|
}
|
|
557
557
|
}, {
|
|
@@ -609,17 +609,17 @@ function wt() {
|
|
|
609
609
|
// method: this._methodType.CONNECT
|
|
610
610
|
};
|
|
611
611
|
(n._token || n._connectData || n._config.name || n._config.version) && (d.params = {}), n._token && (d.params.token = n._token), n._connectData && (d.params.data = n._connectData), n._config.name && (d.params.name = n._config.name), n._config.version && (d.params.version = n._config.version);
|
|
612
|
-
var y = {},
|
|
613
|
-
for (var
|
|
614
|
-
if (n._serverSubs.hasOwnProperty(
|
|
615
|
-
|
|
616
|
-
var
|
|
612
|
+
var y = {}, v = !1;
|
|
613
|
+
for (var S in n._serverSubs)
|
|
614
|
+
if (n._serverSubs.hasOwnProperty(S) && n._serverSubs[S].recoverable) {
|
|
615
|
+
v = !0;
|
|
616
|
+
var I = {
|
|
617
617
|
recover: !0
|
|
618
618
|
};
|
|
619
|
-
n._serverSubs[
|
|
619
|
+
n._serverSubs[S].seq || n._serverSubs[S].gen ? (n._serverSubs[S].seq && (I.seq = n._serverSubs[S].seq), n._serverSubs[S].gen && (I.gen = n._serverSubs[S].gen)) : n._serverSubs[S].offset && (I.offset = n._serverSubs[S].offset), n._serverSubs[S].epoch && (I.epoch = n._serverSubs[S].epoch), y[S] = I;
|
|
620
620
|
}
|
|
621
|
-
|
|
622
|
-
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, R.result),
|
|
621
|
+
v && (d.params || (d.params = {}), d.params.subs = y), n._latencyStart = /* @__PURE__ */ new Date(), n._call(d).then(function(R) {
|
|
622
|
+
n._connectResponse(n._decoder.decodeCommandResult(n._methodType.CONNECT, R.result), v), R.next && R.next();
|
|
623
623
|
}, function(R) {
|
|
624
624
|
var X = R.error;
|
|
625
625
|
X.code === 109 && (n._refreshRequired = !0), n._disconnect("connect error", !0), R.next && R.next();
|
|
@@ -628,24 +628,24 @@ function wt() {
|
|
|
628
628
|
n._debug("transport level error", d);
|
|
629
629
|
}, this._transport.onclose = function(d) {
|
|
630
630
|
n._transportClosed = !0;
|
|
631
|
-
var y = M,
|
|
631
|
+
var y = M, v = !0;
|
|
632
632
|
if (d && "reason" in d && d.reason)
|
|
633
633
|
try {
|
|
634
|
-
var
|
|
635
|
-
n._debug("reason is an advice object",
|
|
634
|
+
var S = JSON.parse(d.reason);
|
|
635
|
+
n._debug("reason is an advice object", S), y = S.reason, v = S.reconnect;
|
|
636
636
|
} catch {
|
|
637
637
|
y = d.reason, n._debug("reason is a plain string", y);
|
|
638
638
|
}
|
|
639
639
|
if (n._config.onTransportClose !== null && n._config.onTransportClose({
|
|
640
640
|
event: d,
|
|
641
641
|
reason: y,
|
|
642
|
-
reconnect:
|
|
643
|
-
}), n._disconnect(y,
|
|
642
|
+
reconnect: v
|
|
643
|
+
}), n._disconnect(y, v), n._reconnect === !0) {
|
|
644
644
|
n._reconnecting = !0;
|
|
645
|
-
var
|
|
646
|
-
n._debug("reconnect after " +
|
|
645
|
+
var I = n._getRetryInterval();
|
|
646
|
+
n._debug("reconnect after " + I + " milliseconds"), setTimeout(function() {
|
|
647
647
|
n._reconnect === !0 && (n._refreshRequired ? n._refresh() : n._connect());
|
|
648
|
-
},
|
|
648
|
+
}, I);
|
|
649
649
|
}
|
|
650
650
|
}, this._transport.onmessage = function(d) {
|
|
651
651
|
n._dataReceived(d.data);
|
|
@@ -705,10 +705,10 @@ function wt() {
|
|
|
705
705
|
value: function(n, r) {
|
|
706
706
|
var c = this;
|
|
707
707
|
return this.isConnected() ? new Promise(function(d, y) {
|
|
708
|
-
c._call(n).then(function(
|
|
709
|
-
d(r(c._decoder.decodeCommandResult(n.method,
|
|
710
|
-
}, function(
|
|
711
|
-
y(
|
|
708
|
+
c._call(n).then(function(v) {
|
|
709
|
+
d(r(c._decoder.decodeCommandResult(n.method, v.result))), v.next && v.next();
|
|
710
|
+
}, function(v) {
|
|
711
|
+
y(v.error), v.next && v.next();
|
|
712
712
|
});
|
|
713
713
|
}) : Promise.reject(this._createErrorObject(M, 0));
|
|
714
714
|
}
|
|
@@ -786,13 +786,13 @@ function wt() {
|
|
|
786
786
|
}, {
|
|
787
787
|
key: "_dispatchSynchronized",
|
|
788
788
|
value: function(n, r) {
|
|
789
|
-
var c = this, d = Promise.resolve(), y = function(
|
|
790
|
-
n.hasOwnProperty(
|
|
791
|
-
return c._dispatchReply(n[
|
|
789
|
+
var c = this, d = Promise.resolve(), y = function(I) {
|
|
790
|
+
n.hasOwnProperty(I) && (d = d.then(function() {
|
|
791
|
+
return c._dispatchReply(n[I]);
|
|
792
792
|
}));
|
|
793
793
|
};
|
|
794
|
-
for (var
|
|
795
|
-
y(
|
|
794
|
+
for (var v in n)
|
|
795
|
+
y(v);
|
|
796
796
|
d = d.then(function() {
|
|
797
797
|
r();
|
|
798
798
|
});
|
|
@@ -860,10 +860,10 @@ function wt() {
|
|
|
860
860
|
return;
|
|
861
861
|
}
|
|
862
862
|
this._refreshTimeout !== null && (clearTimeout(this._refreshTimeout), this._refreshTimeout = null);
|
|
863
|
-
var r = this._clientID, c = this._newXHRID(), d = function(
|
|
863
|
+
var r = this._clientID, c = this._newXHRID(), d = function(I) {
|
|
864
864
|
if (c in n._xhrs && delete n._xhrs[c], n._clientID === r) {
|
|
865
|
-
if (
|
|
866
|
-
if (
|
|
865
|
+
if (I.error || I.status !== 200) {
|
|
866
|
+
if (I.error ? n._debug("error refreshing connection token", I.error) : n._debug("error refreshing connection token: wrong status code", I.status), n._numRefreshFailed++, n._refreshTimeout !== null && (clearTimeout(n._refreshTimeout), n._refreshTimeout = null), n._config.refreshAttempts !== null && n._numRefreshFailed >= n._config.refreshAttempts) {
|
|
867
867
|
n._refreshFailed();
|
|
868
868
|
return;
|
|
869
869
|
}
|
|
@@ -873,7 +873,7 @@ function wt() {
|
|
|
873
873
|
}, X);
|
|
874
874
|
return;
|
|
875
875
|
}
|
|
876
|
-
if (n._numRefreshFailed = 0, n._token =
|
|
876
|
+
if (n._numRefreshFailed = 0, n._token = I.data.token, !n._token) {
|
|
877
877
|
n._refreshFailed();
|
|
878
878
|
return;
|
|
879
879
|
}
|
|
@@ -899,8 +899,8 @@ function wt() {
|
|
|
899
899
|
var y = {};
|
|
900
900
|
this._config.onRefresh(y, d);
|
|
901
901
|
} else {
|
|
902
|
-
var
|
|
903
|
-
this._xhrs[c] =
|
|
902
|
+
var v = this._ajax(this._config.refreshEndpoint, this._config.refreshParams, this._config.refreshHeaders, this._config.refreshData, d);
|
|
903
|
+
this._xhrs[c] = v;
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
}, {
|
|
@@ -958,17 +958,17 @@ function wt() {
|
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
|
-
},
|
|
961
|
+
}, v = {
|
|
962
962
|
client: this._clientID,
|
|
963
963
|
channels: [n]
|
|
964
964
|
};
|
|
965
965
|
if (this._config.onPrivateSubscribe !== null)
|
|
966
966
|
this._config.onPrivateSubscribe({
|
|
967
|
-
data:
|
|
967
|
+
data: v
|
|
968
968
|
}, y);
|
|
969
969
|
else {
|
|
970
|
-
var
|
|
971
|
-
this._xhrs[d] =
|
|
970
|
+
var S = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, v, y);
|
|
971
|
+
this._xhrs[d] = S;
|
|
972
972
|
}
|
|
973
973
|
}
|
|
974
974
|
}, {
|
|
@@ -983,10 +983,10 @@ function wt() {
|
|
|
983
983
|
this._debug("subscription refresh error", n, r), this._clearSubRefreshTimeout(n);
|
|
984
984
|
var d = this._getSub(n);
|
|
985
985
|
if (d !== null) {
|
|
986
|
-
var y = Math.round(Math.random() * 1e3),
|
|
986
|
+
var y = Math.round(Math.random() * 1e3), v = setTimeout(function() {
|
|
987
987
|
return c._subRefresh(n);
|
|
988
988
|
}, this._config.subRefreshInterval + y);
|
|
989
|
-
this._subRefreshTimeouts[n] =
|
|
989
|
+
this._subRefreshTimeouts[n] = v;
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
}, {
|
|
@@ -1019,15 +1019,15 @@ function wt() {
|
|
|
1019
1019
|
channel: d
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
if (n._subscribeData && (y.params.data = n._subscribeData), (0,
|
|
1022
|
+
if (n._subscribeData && (y.params.data = n._subscribeData), (0, E.startsWith)(d, this._config.privateChannelPrefix))
|
|
1023
1023
|
this._isSubscribeBatching ? this._privateChannels[d] = !0 : (this.startSubscribeBatching(), this._subscribe(n), this.stopSubscribeBatching());
|
|
1024
1024
|
else {
|
|
1025
|
-
var
|
|
1026
|
-
if (
|
|
1025
|
+
var v = n._needRecover();
|
|
1026
|
+
if (v === !0) {
|
|
1027
1027
|
y.params.recover = !0;
|
|
1028
|
-
var
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1028
|
+
var S = this._getLastSeq(d), I = this._getLastGen(d);
|
|
1029
|
+
if (S || I)
|
|
1030
|
+
S && (y.params.seq = S), I && (y.params.gen = I);
|
|
1031
1031
|
else {
|
|
1032
1032
|
var R = this._getLastOffset(d);
|
|
1033
1033
|
R && (y.params.offset = R);
|
|
@@ -1036,7 +1036,7 @@ function wt() {
|
|
|
1036
1036
|
X && (y.params.epoch = X);
|
|
1037
1037
|
}
|
|
1038
1038
|
this._call(y).then(function(U) {
|
|
1039
|
-
c._subscribeResponse(d,
|
|
1039
|
+
c._subscribeResponse(d, v, c._decoder.decodeCommandResult(c._methodType.SUBSCRIBE, U.result)), U.next && U.next();
|
|
1040
1040
|
}, function(U) {
|
|
1041
1041
|
c._subscribeError(d, U.error), U.next && U.next();
|
|
1042
1042
|
});
|
|
@@ -1083,16 +1083,16 @@ function wt() {
|
|
|
1083
1083
|
}, this._getTTLMilliseconds(n.ttl))), this.startBatching(), this.startSubscribeBatching();
|
|
1084
1084
|
for (var y in this._subs)
|
|
1085
1085
|
if (this._subs.hasOwnProperty(y)) {
|
|
1086
|
-
var
|
|
1087
|
-
|
|
1086
|
+
var v = this._subs[y];
|
|
1087
|
+
v._shouldResubscribe() && this._subscribe(v, d);
|
|
1088
1088
|
}
|
|
1089
1089
|
this.stopSubscribeBatching(), this.stopBatching(), this._startPing();
|
|
1090
|
-
var
|
|
1090
|
+
var S = {
|
|
1091
1091
|
client: n.client,
|
|
1092
1092
|
transport: this._transportName,
|
|
1093
1093
|
latency: this._latency
|
|
1094
1094
|
};
|
|
1095
|
-
n.data && (
|
|
1095
|
+
n.data && (S.data = n.data), this.emit("connect", S), n.subs && this._processServerSubs(n.subs);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
1098
|
}, {
|
|
@@ -1106,23 +1106,23 @@ function wt() {
|
|
|
1106
1106
|
};
|
|
1107
1107
|
y = this._expandSubscribeContext(y, c), this.emit("subscribe", y);
|
|
1108
1108
|
}
|
|
1109
|
-
for (var
|
|
1110
|
-
if (n.hasOwnProperty(
|
|
1111
|
-
var
|
|
1112
|
-
if (
|
|
1113
|
-
var
|
|
1114
|
-
if (
|
|
1115
|
-
|
|
1116
|
-
for (var R in
|
|
1117
|
-
|
|
1109
|
+
for (var v in n)
|
|
1110
|
+
if (n.hasOwnProperty(v)) {
|
|
1111
|
+
var S = n[v];
|
|
1112
|
+
if (S.recovered) {
|
|
1113
|
+
var I = S.publications;
|
|
1114
|
+
if (I && I.length > 0) {
|
|
1115
|
+
I.length > 1 && (!I[0].offset || I[0].offset > I[1].offset) && (I = I.reverse());
|
|
1116
|
+
for (var R in I)
|
|
1117
|
+
I.hasOwnProperty(R) && this._handlePublication(v, I[R]);
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
|
-
this._serverSubs[
|
|
1121
|
-
seq:
|
|
1122
|
-
gen:
|
|
1123
|
-
offset:
|
|
1124
|
-
epoch:
|
|
1125
|
-
recoverable:
|
|
1120
|
+
this._serverSubs[v] = {
|
|
1121
|
+
seq: S.seq,
|
|
1122
|
+
gen: S.gen,
|
|
1123
|
+
offset: S.offset,
|
|
1124
|
+
epoch: S.epoch,
|
|
1125
|
+
recoverable: S.recoverable
|
|
1126
1126
|
};
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
@@ -1171,9 +1171,9 @@ function wt() {
|
|
|
1171
1171
|
"positioned" in r && (d = r.positioned);
|
|
1172
1172
|
var y = "";
|
|
1173
1173
|
"epoch" in r && (y = r.epoch);
|
|
1174
|
-
var
|
|
1175
|
-
return "offset" in r && (
|
|
1176
|
-
offset:
|
|
1174
|
+
var v = 0;
|
|
1175
|
+
return "offset" in r && (v = r.offset), d && (n.streamPosition = {
|
|
1176
|
+
offset: v,
|
|
1177
1177
|
epoch: y
|
|
1178
1178
|
}), r.data && (n.data = r.data), n;
|
|
1179
1179
|
}
|
|
@@ -1183,17 +1183,17 @@ function wt() {
|
|
|
1183
1183
|
var d = this, y = this._getSub(n);
|
|
1184
1184
|
if (y && y._isSubscribing()) {
|
|
1185
1185
|
y._setSubscribeSuccess(c);
|
|
1186
|
-
var
|
|
1187
|
-
if (
|
|
1188
|
-
|
|
1189
|
-
for (var
|
|
1190
|
-
|
|
1186
|
+
var v = c.publications;
|
|
1187
|
+
if (v && v.length > 0) {
|
|
1188
|
+
v.length >= 2 && !v[0].offset && !v[1].offset && (v = v.reverse());
|
|
1189
|
+
for (var S in v)
|
|
1190
|
+
v.hasOwnProperty(S) && this._handlePublication(n, v[S]);
|
|
1191
1191
|
}
|
|
1192
1192
|
if (c.recoverable && (!r || !c.recovered) && (this._lastSeq[n] = c.seq || 0, this._lastGen[n] = c.gen || 0, this._lastOffset[n] = c.offset || 0), this._lastEpoch[n] = c.epoch || "", c.recoverable && (y._recoverable = !0), c.expires === !0) {
|
|
1193
|
-
var
|
|
1193
|
+
var I = setTimeout(function() {
|
|
1194
1194
|
return d._subRefresh(n);
|
|
1195
1195
|
}, this._getTTLMilliseconds(c.ttl));
|
|
1196
|
-
this._subRefreshTimeouts[n] =
|
|
1196
|
+
this._subRefreshTimeouts[n] = I;
|
|
1197
1197
|
}
|
|
1198
1198
|
}
|
|
1199
1199
|
}
|
|
@@ -1206,22 +1206,22 @@ function wt() {
|
|
|
1206
1206
|
return;
|
|
1207
1207
|
}
|
|
1208
1208
|
var y = this._callbacks[c];
|
|
1209
|
-
if (clearTimeout(this._callbacks[c].timeout), delete this._callbacks[c], (0,
|
|
1210
|
-
var
|
|
1211
|
-
if (!
|
|
1209
|
+
if (clearTimeout(this._callbacks[c].timeout), delete this._callbacks[c], (0, E.errorExists)(n)) {
|
|
1210
|
+
var S = y.errback;
|
|
1211
|
+
if (!S) {
|
|
1212
1212
|
r();
|
|
1213
1213
|
return;
|
|
1214
1214
|
}
|
|
1215
|
-
var
|
|
1216
|
-
|
|
1217
|
-
error:
|
|
1215
|
+
var I = n.error;
|
|
1216
|
+
S({
|
|
1217
|
+
error: I,
|
|
1218
1218
|
next: r
|
|
1219
1219
|
});
|
|
1220
1220
|
} else {
|
|
1221
|
-
var
|
|
1222
|
-
if (!
|
|
1221
|
+
var v = y.callback;
|
|
1222
|
+
if (!v)
|
|
1223
1223
|
return;
|
|
1224
|
-
|
|
1224
|
+
v({
|
|
1225
1225
|
result: d,
|
|
1226
1226
|
next: r
|
|
1227
1227
|
});
|
|
@@ -1304,14 +1304,14 @@ function wt() {
|
|
|
1304
1304
|
"type" in c && (d = c.type);
|
|
1305
1305
|
var y = c.channel;
|
|
1306
1306
|
if (d === this._pushType.PUBLICATION) {
|
|
1307
|
-
var
|
|
1308
|
-
this._handlePublication(y,
|
|
1307
|
+
var v = this._decoder.decodePushData(this._pushType.PUBLICATION, c.data);
|
|
1308
|
+
this._handlePublication(y, v);
|
|
1309
1309
|
} else if (d === this._pushType.MESSAGE) {
|
|
1310
|
-
var
|
|
1311
|
-
this._handleMessage(
|
|
1310
|
+
var S = this._decoder.decodePushData(this._pushType.MESSAGE, c.data);
|
|
1311
|
+
this._handleMessage(S);
|
|
1312
1312
|
} else if (d === this._pushType.JOIN) {
|
|
1313
|
-
var
|
|
1314
|
-
this._handleJoin(y,
|
|
1313
|
+
var I = this._decoder.decodePushData(this._pushType.JOIN, c.data);
|
|
1314
|
+
this._handleJoin(y, I);
|
|
1315
1315
|
} else if (d === this._pushType.LEAVE) {
|
|
1316
1316
|
var R = this._decoder.decodePushData(this._pushType.LEAVE, c.data);
|
|
1317
1317
|
this._handleLeave(y, R);
|
|
@@ -1389,7 +1389,7 @@ function wt() {
|
|
|
1389
1389
|
errback: c,
|
|
1390
1390
|
timeout: null
|
|
1391
1391
|
}, this._callbacks[n].timeout = setTimeout(function() {
|
|
1392
|
-
delete d._callbacks[n], (0,
|
|
1392
|
+
delete d._callbacks[n], (0, E.isFunction)(c) && c({
|
|
1393
1393
|
error: d._createErrorObject(x)
|
|
1394
1394
|
});
|
|
1395
1395
|
}, this._config.timeout);
|
|
@@ -1454,11 +1454,11 @@ function wt() {
|
|
|
1454
1454
|
this._debug("no private channels found, no need to make request");
|
|
1455
1455
|
return;
|
|
1456
1456
|
}
|
|
1457
|
-
var
|
|
1457
|
+
var v = {
|
|
1458
1458
|
client: this._clientID,
|
|
1459
1459
|
channels: c
|
|
1460
|
-
},
|
|
1461
|
-
if (
|
|
1460
|
+
}, S = this._clientID, I = this._newXHRID(), R = function(D) {
|
|
1461
|
+
if (I in n._xhrs && delete n._xhrs[I], n._clientID === S) {
|
|
1462
1462
|
if (D.error || D.status !== 200) {
|
|
1463
1463
|
n._debug("authorization request failed");
|
|
1464
1464
|
for (var re in c)
|
|
@@ -1518,11 +1518,11 @@ function wt() {
|
|
|
1518
1518
|
};
|
|
1519
1519
|
if (this._config.onPrivateSubscribe !== null)
|
|
1520
1520
|
this._config.onPrivateSubscribe({
|
|
1521
|
-
data:
|
|
1521
|
+
data: v
|
|
1522
1522
|
}, R);
|
|
1523
1523
|
else {
|
|
1524
|
-
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders,
|
|
1525
|
-
this._xhrs[
|
|
1524
|
+
var X = this._ajax(this._config.subscribeEndpoint, this._config.subscribeParams, this._config.subscribeHeaders, v, R);
|
|
1525
|
+
this._xhrs[I] = X;
|
|
1526
1526
|
}
|
|
1527
1527
|
}
|
|
1528
1528
|
}, {
|
|
@@ -1536,7 +1536,7 @@ function wt() {
|
|
|
1536
1536
|
var d = this._getSub(n);
|
|
1537
1537
|
if (d !== null)
|
|
1538
1538
|
return d._setEvents(r), d._isUnsubscribed() && d.subscribe(c), d;
|
|
1539
|
-
var y = new
|
|
1539
|
+
var y = new P.default(this, n, r);
|
|
1540
1540
|
return this._subs[n] = y, y.subscribe(c), y;
|
|
1541
1541
|
}
|
|
1542
1542
|
}]), p;
|
|
@@ -1551,8 +1551,8 @@ function wt() {
|
|
|
1551
1551
|
Object.defineProperty(l, "__esModule", {
|
|
1552
1552
|
value: !0
|
|
1553
1553
|
}), l.default = void 0;
|
|
1554
|
-
var C = f(382),
|
|
1555
|
-
l.default =
|
|
1554
|
+
var C = f(382), P = C.Centrifuge;
|
|
1555
|
+
l.default = P, a.exports = l.default;
|
|
1556
1556
|
})
|
|
1557
1557
|
),
|
|
1558
1558
|
/***/
|
|
@@ -1562,18 +1562,18 @@ function wt() {
|
|
|
1562
1562
|
Object.defineProperty(l, "__esModule", {
|
|
1563
1563
|
value: !0
|
|
1564
1564
|
}), l.JsonPushType = l.JsonMethodType = l.JsonEncoder = l.JsonDecoder = void 0;
|
|
1565
|
-
function f(
|
|
1566
|
-
if (!(
|
|
1565
|
+
function f(B, w) {
|
|
1566
|
+
if (!(B instanceof w))
|
|
1567
1567
|
throw new TypeError("Cannot call a class as a function");
|
|
1568
1568
|
}
|
|
1569
|
-
function C(
|
|
1570
|
-
for (var
|
|
1571
|
-
var
|
|
1572
|
-
|
|
1569
|
+
function C(B, w) {
|
|
1570
|
+
for (var k = 0; k < w.length; k++) {
|
|
1571
|
+
var b = w[k];
|
|
1572
|
+
b.enumerable = b.enumerable || !1, b.configurable = !0, "value" in b && (b.writable = !0), Object.defineProperty(B, b.key, b);
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1576
|
-
return w && C(
|
|
1575
|
+
function P(B, w, k) {
|
|
1576
|
+
return w && C(B.prototype, w), B;
|
|
1577
1577
|
}
|
|
1578
1578
|
var _ = {
|
|
1579
1579
|
CONNECT: 0,
|
|
@@ -1590,7 +1590,7 @@ function wt() {
|
|
|
1590
1590
|
SUB_REFRESH: 11
|
|
1591
1591
|
};
|
|
1592
1592
|
l.JsonMethodType = _;
|
|
1593
|
-
var
|
|
1593
|
+
var E = {
|
|
1594
1594
|
PUBLICATION: 0,
|
|
1595
1595
|
JOIN: 1,
|
|
1596
1596
|
LEAVE: 2,
|
|
@@ -1598,52 +1598,52 @@ function wt() {
|
|
|
1598
1598
|
MESSAGE: 4,
|
|
1599
1599
|
SUBSCRIBE: 5
|
|
1600
1600
|
};
|
|
1601
|
-
l.JsonPushType =
|
|
1602
|
-
var
|
|
1603
|
-
function
|
|
1604
|
-
f(this,
|
|
1601
|
+
l.JsonPushType = E;
|
|
1602
|
+
var Q = /* @__PURE__ */ (function() {
|
|
1603
|
+
function B() {
|
|
1604
|
+
f(this, B);
|
|
1605
1605
|
}
|
|
1606
|
-
return
|
|
1606
|
+
return P(B, [{
|
|
1607
1607
|
key: "encodeCommands",
|
|
1608
|
-
value: function(
|
|
1609
|
-
return
|
|
1610
|
-
return JSON.stringify(
|
|
1608
|
+
value: function(k) {
|
|
1609
|
+
return k.map(function(b) {
|
|
1610
|
+
return JSON.stringify(b);
|
|
1611
1611
|
}).join(`
|
|
1612
1612
|
`);
|
|
1613
1613
|
}
|
|
1614
|
-
}]),
|
|
1614
|
+
}]), B;
|
|
1615
1615
|
})();
|
|
1616
|
-
l.JsonEncoder =
|
|
1616
|
+
l.JsonEncoder = Q;
|
|
1617
1617
|
var T = /* @__PURE__ */ (function() {
|
|
1618
|
-
function
|
|
1619
|
-
f(this,
|
|
1618
|
+
function B() {
|
|
1619
|
+
f(this, B);
|
|
1620
1620
|
}
|
|
1621
|
-
return
|
|
1621
|
+
return P(B, [{
|
|
1622
1622
|
key: "decodeReplies",
|
|
1623
|
-
value: function(
|
|
1624
|
-
return
|
|
1625
|
-
`).filter(function(
|
|
1626
|
-
return
|
|
1627
|
-
}).map(function(
|
|
1628
|
-
return JSON.parse(
|
|
1623
|
+
value: function(k) {
|
|
1624
|
+
return k.split(`
|
|
1625
|
+
`).filter(function(b) {
|
|
1626
|
+
return b !== "";
|
|
1627
|
+
}).map(function(b) {
|
|
1628
|
+
return JSON.parse(b);
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
}, {
|
|
1632
1632
|
key: "decodeCommandResult",
|
|
1633
|
-
value: function(
|
|
1634
|
-
return
|
|
1633
|
+
value: function(k, b) {
|
|
1634
|
+
return b;
|
|
1635
1635
|
}
|
|
1636
1636
|
}, {
|
|
1637
1637
|
key: "decodePush",
|
|
1638
|
-
value: function(
|
|
1639
|
-
return
|
|
1638
|
+
value: function(k) {
|
|
1639
|
+
return k;
|
|
1640
1640
|
}
|
|
1641
1641
|
}, {
|
|
1642
1642
|
key: "decodePushData",
|
|
1643
|
-
value: function(
|
|
1644
|
-
return
|
|
1643
|
+
value: function(k, b) {
|
|
1644
|
+
return b;
|
|
1645
1645
|
}
|
|
1646
|
-
}]),
|
|
1646
|
+
}]), B;
|
|
1647
1647
|
})();
|
|
1648
1648
|
l.JsonDecoder = T;
|
|
1649
1649
|
})
|
|
@@ -1663,11 +1663,11 @@ function wt() {
|
|
|
1663
1663
|
Object.defineProperty(l, "__esModule", {
|
|
1664
1664
|
value: !0
|
|
1665
1665
|
}), l.default = void 0;
|
|
1666
|
-
var
|
|
1667
|
-
function
|
|
1666
|
+
var P = E(f(187)), _ = f(853);
|
|
1667
|
+
function E(h) {
|
|
1668
1668
|
return h && h.__esModule ? h : { default: h };
|
|
1669
1669
|
}
|
|
1670
|
-
function
|
|
1670
|
+
function Q(h, p) {
|
|
1671
1671
|
if (!(h instanceof p))
|
|
1672
1672
|
throw new TypeError("Cannot call a class as a function");
|
|
1673
1673
|
}
|
|
@@ -1677,20 +1677,20 @@ function wt() {
|
|
|
1677
1677
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(h, n.key, n);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
-
function
|
|
1680
|
+
function B(h, p, A) {
|
|
1681
1681
|
return p && T(h.prototype, p), h;
|
|
1682
1682
|
}
|
|
1683
1683
|
function w(h, p) {
|
|
1684
1684
|
if (typeof p != "function" && p !== null)
|
|
1685
1685
|
throw new TypeError("Super expression must either be null or a function");
|
|
1686
|
-
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p &&
|
|
1686
|
+
h.prototype = Object.create(p && p.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), p && k(h, p);
|
|
1687
1687
|
}
|
|
1688
|
-
function
|
|
1689
|
-
return
|
|
1688
|
+
function k(h, p) {
|
|
1689
|
+
return k = Object.setPrototypeOf || function(n, r) {
|
|
1690
1690
|
return n.__proto__ = r, n;
|
|
1691
|
-
},
|
|
1691
|
+
}, k(h, p);
|
|
1692
1692
|
}
|
|
1693
|
-
function
|
|
1693
|
+
function b(h) {
|
|
1694
1694
|
var p = F();
|
|
1695
1695
|
return function() {
|
|
1696
1696
|
var n = N(h), r;
|
|
@@ -1731,14 +1731,14 @@ function wt() {
|
|
|
1731
1731
|
}
|
|
1732
1732
|
var q = 0, J = 1, x = 2, M = 3, m = 4, g = /* @__PURE__ */ (function(h) {
|
|
1733
1733
|
w(A, h);
|
|
1734
|
-
var p =
|
|
1734
|
+
var p = b(A);
|
|
1735
1735
|
function A(n, r, c) {
|
|
1736
1736
|
var d;
|
|
1737
|
-
return
|
|
1737
|
+
return Q(this, A), d = p.call(this), d.channel = r, d._centrifuge = n, d._status = q, d._error = null, d._isResubscribe = !1, d._ready = !1, d._subscriptionPromise = null, d._noResubscribe = !1, d._recoverable = !1, d._recover = !1, d._setEvents(c), d._initializePromise(), d._promises = {}, d._promiseId = 0, d._subscribeData = null, d.on("error", function(y) {
|
|
1738
1738
|
this._centrifuge._debug("subscription error", y);
|
|
1739
1739
|
}), d;
|
|
1740
1740
|
}
|
|
1741
|
-
return
|
|
1741
|
+
return B(A, [{
|
|
1742
1742
|
key: "_nextPromiseId",
|
|
1743
1743
|
value: function() {
|
|
1744
1744
|
return ++this._promiseId;
|
|
@@ -1775,8 +1775,8 @@ function wt() {
|
|
|
1775
1775
|
this.on("publish", r);
|
|
1776
1776
|
else if (Object.prototype.toString.call(r) === Object.prototype.toString.call({}))
|
|
1777
1777
|
for (var c = ["publish", "join", "leave", "unsubscribe", "subscribe", "error"], d = 0, y = c.length; d < y; d++) {
|
|
1778
|
-
var
|
|
1779
|
-
|
|
1778
|
+
var v = c[d];
|
|
1779
|
+
v in r && this.on(v, r[v]);
|
|
1780
1780
|
}
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
@@ -1906,14 +1906,14 @@ function wt() {
|
|
|
1906
1906
|
if (this._isError())
|
|
1907
1907
|
return Promise.reject(this._error);
|
|
1908
1908
|
var c = new Promise(function(d, y) {
|
|
1909
|
-
var
|
|
1909
|
+
var v = setTimeout(function() {
|
|
1910
1910
|
y({
|
|
1911
1911
|
code: 0,
|
|
1912
1912
|
message: "timeout"
|
|
1913
1913
|
});
|
|
1914
1914
|
}, r._centrifuge._config.timeout);
|
|
1915
1915
|
r._promises[r._nextPromiseId()] = {
|
|
1916
|
-
timeout:
|
|
1916
|
+
timeout: v,
|
|
1917
1917
|
resolve: d,
|
|
1918
1918
|
reject: y
|
|
1919
1919
|
};
|
|
@@ -1953,7 +1953,7 @@ function wt() {
|
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
}]), A;
|
|
1956
|
-
})(
|
|
1956
|
+
})(P.default);
|
|
1957
1957
|
l.default = g, a.exports = l.default;
|
|
1958
1958
|
})
|
|
1959
1959
|
),
|
|
@@ -1963,30 +1963,30 @@ function wt() {
|
|
|
1963
1963
|
(function(a, l, f) {
|
|
1964
1964
|
Object.defineProperty(l, "__esModule", {
|
|
1965
1965
|
value: !0
|
|
1966
|
-
}), l.backoff =
|
|
1967
|
-
function C(
|
|
1968
|
-
return
|
|
1966
|
+
}), l.backoff = E, l.errorExists = Q, l.extend = T, l.isFunction = P, l.log = _, l.startsWith = C;
|
|
1967
|
+
function C(B, w) {
|
|
1968
|
+
return B.lastIndexOf(w, 0) === 0;
|
|
1969
1969
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1970
|
+
function P(B) {
|
|
1971
|
+
return B == null ? !1 : typeof B == "function";
|
|
1972
1972
|
}
|
|
1973
|
-
function _(
|
|
1973
|
+
function _(B, w) {
|
|
1974
1974
|
if (f.g.console) {
|
|
1975
|
-
var
|
|
1976
|
-
k
|
|
1975
|
+
var k = f.g.console[B];
|
|
1976
|
+
P(k) && k.apply(f.g.console, w);
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
|
-
function
|
|
1980
|
-
var
|
|
1981
|
-
return Math.floor((1 -
|
|
1979
|
+
function E(B, w, k) {
|
|
1980
|
+
var b = 0.5 * Math.random(), L = Math.min(k, w * Math.pow(2, B + 1));
|
|
1981
|
+
return Math.floor((1 - b) * L);
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1984
|
-
return "error" in
|
|
1983
|
+
function Q(B) {
|
|
1984
|
+
return "error" in B && B.error !== null;
|
|
1985
1985
|
}
|
|
1986
|
-
function T(
|
|
1987
|
-
for (var
|
|
1988
|
-
w.hasOwnProperty(
|
|
1989
|
-
return
|
|
1986
|
+
function T(B, w) {
|
|
1987
|
+
for (var k in w)
|
|
1988
|
+
w.hasOwnProperty(k) && (B[k] = w[k]);
|
|
1989
|
+
return B;
|
|
1990
1990
|
}
|
|
1991
1991
|
})
|
|
1992
1992
|
),
|
|
@@ -2002,44 +2002,44 @@ function wt() {
|
|
|
2002
2002
|
} : C = function(g) {
|
|
2003
2003
|
return Object.getOwnPropertyNames(g);
|
|
2004
2004
|
};
|
|
2005
|
-
function
|
|
2005
|
+
function P(m) {
|
|
2006
2006
|
console && console.warn && console.warn(m);
|
|
2007
2007
|
}
|
|
2008
2008
|
var _ = Number.isNaN || function(g) {
|
|
2009
2009
|
return g !== g;
|
|
2010
2010
|
};
|
|
2011
|
-
function
|
|
2012
|
-
|
|
2011
|
+
function E() {
|
|
2012
|
+
E.init.call(this);
|
|
2013
2013
|
}
|
|
2014
|
-
a.exports =
|
|
2015
|
-
var
|
|
2014
|
+
a.exports = E, a.exports.once = J, E.EventEmitter = E, E.prototype._events = void 0, E.prototype._eventsCount = 0, E.prototype._maxListeners = void 0;
|
|
2015
|
+
var Q = 10;
|
|
2016
2016
|
function T(m) {
|
|
2017
2017
|
if (typeof m != "function")
|
|
2018
2018
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof m);
|
|
2019
2019
|
}
|
|
2020
|
-
Object.defineProperty(
|
|
2020
|
+
Object.defineProperty(E, "defaultMaxListeners", {
|
|
2021
2021
|
enumerable: !0,
|
|
2022
2022
|
get: function() {
|
|
2023
|
-
return
|
|
2023
|
+
return Q;
|
|
2024
2024
|
},
|
|
2025
2025
|
set: function(m) {
|
|
2026
2026
|
if (typeof m != "number" || m < 0 || _(m))
|
|
2027
2027
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + m + ".");
|
|
2028
|
-
|
|
2028
|
+
Q = m;
|
|
2029
2029
|
}
|
|
2030
|
-
}),
|
|
2030
|
+
}), E.init = function() {
|
|
2031
2031
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
2032
|
-
},
|
|
2032
|
+
}, E.prototype.setMaxListeners = function(g) {
|
|
2033
2033
|
if (typeof g != "number" || g < 0 || _(g))
|
|
2034
2034
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + g + ".");
|
|
2035
2035
|
return this._maxListeners = g, this;
|
|
2036
2036
|
};
|
|
2037
|
-
function
|
|
2038
|
-
return m._maxListeners === void 0 ?
|
|
2037
|
+
function B(m) {
|
|
2038
|
+
return m._maxListeners === void 0 ? E.defaultMaxListeners : m._maxListeners;
|
|
2039
2039
|
}
|
|
2040
|
-
|
|
2041
|
-
return
|
|
2042
|
-
},
|
|
2040
|
+
E.prototype.getMaxListeners = function() {
|
|
2041
|
+
return B(this);
|
|
2042
|
+
}, E.prototype.emit = function(g) {
|
|
2043
2043
|
for (var h = [], p = 1; p < arguments.length; p++) h.push(arguments[p]);
|
|
2044
2044
|
var A = g === "error", n = this._events;
|
|
2045
2045
|
if (n !== void 0)
|
|
@@ -2059,8 +2059,8 @@ function wt() {
|
|
|
2059
2059
|
if (typeof d == "function")
|
|
2060
2060
|
f(d, this, h);
|
|
2061
2061
|
else
|
|
2062
|
-
for (var y = d.length,
|
|
2063
|
-
f(
|
|
2062
|
+
for (var y = d.length, v = F(d, y), p = 0; p < y; ++p)
|
|
2063
|
+
f(v[p], this, h);
|
|
2064
2064
|
return !0;
|
|
2065
2065
|
};
|
|
2066
2066
|
function w(m, g, h, p) {
|
|
@@ -2071,31 +2071,31 @@ function wt() {
|
|
|
2071
2071
|
h.listener ? h.listener : h
|
|
2072
2072
|
), n = m._events), r = n[g]), r === void 0)
|
|
2073
2073
|
r = n[g] = h, ++m._eventsCount;
|
|
2074
|
-
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A =
|
|
2074
|
+
else if (typeof r == "function" ? r = n[g] = p ? [h, r] : [r, h] : p ? r.unshift(h) : r.push(h), A = B(m), A > 0 && r.length > A && !r.warned) {
|
|
2075
2075
|
r.warned = !0;
|
|
2076
2076
|
var c = new Error("Possible EventEmitter memory leak detected. " + r.length + " " + String(g) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
2077
|
-
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length,
|
|
2077
|
+
c.name = "MaxListenersExceededWarning", c.emitter = m, c.type = g, c.count = r.length, P(c);
|
|
2078
2078
|
}
|
|
2079
2079
|
return m;
|
|
2080
2080
|
}
|
|
2081
|
-
|
|
2081
|
+
E.prototype.addListener = function(g, h) {
|
|
2082
2082
|
return w(this, g, h, !1);
|
|
2083
|
-
},
|
|
2083
|
+
}, E.prototype.on = E.prototype.addListener, E.prototype.prependListener = function(g, h) {
|
|
2084
2084
|
return w(this, g, h, !0);
|
|
2085
2085
|
};
|
|
2086
|
-
function
|
|
2086
|
+
function k() {
|
|
2087
2087
|
if (!this.fired)
|
|
2088
2088
|
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);
|
|
2089
2089
|
}
|
|
2090
|
-
function
|
|
2091
|
-
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A =
|
|
2090
|
+
function b(m, g, h) {
|
|
2091
|
+
var p = { fired: !1, wrapFn: void 0, target: m, type: g, listener: h }, A = k.bind(p);
|
|
2092
2092
|
return A.listener = h, p.wrapFn = A, A;
|
|
2093
2093
|
}
|
|
2094
|
-
|
|
2095
|
-
return T(h), this.on(g,
|
|
2096
|
-
},
|
|
2097
|
-
return T(h), this.prependListener(g,
|
|
2098
|
-
},
|
|
2094
|
+
E.prototype.once = function(g, h) {
|
|
2095
|
+
return T(h), this.on(g, b(this, g, h)), this;
|
|
2096
|
+
}, E.prototype.prependOnceListener = function(g, h) {
|
|
2097
|
+
return T(h), this.prependListener(g, b(this, g, h)), this;
|
|
2098
|
+
}, E.prototype.removeListener = function(g, h) {
|
|
2099
2099
|
var p, A, n, r, c;
|
|
2100
2100
|
if (T(h), A = this._events, A === void 0)
|
|
2101
2101
|
return this;
|
|
@@ -2114,7 +2114,7 @@ function wt() {
|
|
|
2114
2114
|
n === 0 ? p.shift() : N(p, n), p.length === 1 && (A[g] = p[0]), A.removeListener !== void 0 && this.emit("removeListener", g, c || h);
|
|
2115
2115
|
}
|
|
2116
2116
|
return this;
|
|
2117
|
-
},
|
|
2117
|
+
}, E.prototype.off = E.prototype.removeListener, E.prototype.removeAllListeners = function(g) {
|
|
2118
2118
|
var h, p, A;
|
|
2119
2119
|
if (p = this._events, p === void 0)
|
|
2120
2120
|
return this;
|
|
@@ -2140,13 +2140,13 @@ function wt() {
|
|
|
2140
2140
|
var A = p[g];
|
|
2141
2141
|
return A === void 0 ? [] : typeof A == "function" ? h ? [A.listener || A] : [A] : h ? q(A) : F(A, A.length);
|
|
2142
2142
|
}
|
|
2143
|
-
|
|
2143
|
+
E.prototype.listeners = function(g) {
|
|
2144
2144
|
return L(this, g, !0);
|
|
2145
|
-
},
|
|
2145
|
+
}, E.prototype.rawListeners = function(g) {
|
|
2146
2146
|
return L(this, g, !1);
|
|
2147
|
-
},
|
|
2147
|
+
}, E.listenerCount = function(m, g) {
|
|
2148
2148
|
return typeof m.listenerCount == "function" ? m.listenerCount(g) : O.call(m, g);
|
|
2149
|
-
},
|
|
2149
|
+
}, E.prototype.listenerCount = O;
|
|
2150
2150
|
function O(m) {
|
|
2151
2151
|
var g = this._events;
|
|
2152
2152
|
if (g !== void 0) {
|
|
@@ -2158,7 +2158,7 @@ function wt() {
|
|
|
2158
2158
|
}
|
|
2159
2159
|
return 0;
|
|
2160
2160
|
}
|
|
2161
|
-
|
|
2161
|
+
E.prototype.eventNames = function() {
|
|
2162
2162
|
return this._eventsCount > 0 ? C(this._events) : [];
|
|
2163
2163
|
};
|
|
2164
2164
|
function F(m, g) {
|
|
@@ -2314,9 +2314,9 @@ function Rt(e) {
|
|
|
2314
2314
|
};
|
|
2315
2315
|
}
|
|
2316
2316
|
function Ot(e, t, o = {}) {
|
|
2317
|
-
var w,
|
|
2318
|
-
const i = [], s = (w = e == null ? void 0 : e.kaspi) == null ? void 0 : w.data, u = ((
|
|
2319
|
-
return s != null && s.isKaspiOnly && l && !
|
|
2317
|
+
var w, k, b, L;
|
|
2318
|
+
const i = [], s = (w = e == null ? void 0 : e.kaspi) == null ? void 0 : w.data, u = ((k = e == null ? void 0 : e.cards_v2) == null ? void 0 : k.data) || [], a = ((L = (b = e == null ? void 0 : e.payment_methods) == null ? void 0 : b.data) == null ? void 0 : L.attributes) || {}, l = K(a.payment_method_kaspi), f = K(a.payment_method_card), C = typeof window < "u" && window.self === window.top, _ = Xe() === "ios", E = !!(o != null && o.onlyKaspiAvailable), Q = !!(o != null && o.disableKaspi);
|
|
2319
|
+
return s != null && s.isKaspiOnly && l && !Q ? [ee] : E ? s != null && s.isAvailable && l && !Q ? [ee] : [] : (K(a.payment_method_apple_pay) && !me("apple_pay") && (Ce() && C || ye() || _ || st() === 16) && i.push(it), s != null && s.isAvailable && l && !Q && i.push(ee), f && u.filter((O) => !O.isExpired).forEach((O) => {
|
|
2320
2320
|
i.push({
|
|
2321
2321
|
iconType: ge(O.attributes.mask),
|
|
2322
2322
|
type: "card",
|
|
@@ -2332,19 +2332,19 @@ function Ot(e, t, o = {}) {
|
|
|
2332
2332
|
}), i);
|
|
2333
2333
|
}
|
|
2334
2334
|
function Re(e, t = {}) {
|
|
2335
|
-
var
|
|
2336
|
-
const o = (
|
|
2335
|
+
var B, w, k, b;
|
|
2336
|
+
const o = (B = e == null ? void 0 : e.kaspi) == null ? void 0 : B.data, i = ((w = e == null ? void 0 : e.cards_v2) == null ? void 0 : w.data) || [], s = ((b = (k = e == null ? void 0 : e.payment_methods) == null ? void 0 : k.data) == null ? void 0 : b.attributes) || {}, u = K(s.payment_method_kaspi), a = K(s.payment_method_card), l = !!(t != null && t.disableKaspi), f = typeof window < "u" && window.self === window.top, P = Xe() === "ios", _ = K(s.payment_method_apple_pay) && !me("apple_pay") && (Ce() && f || ye() || P || st() === 16), E = K(s.payment_method_google_pay) && !me("google_pay") && !(t != null && t.disableGooglePay) && !Ce() && !ye();
|
|
2337
2337
|
if (o != null && o.isKaspiOnly && u && !l || t != null && t.onlyKaspiAvailable && (o != null && o.isAvailable) && u && !l)
|
|
2338
2338
|
return ee;
|
|
2339
|
-
const
|
|
2340
|
-
if ((
|
|
2339
|
+
const Q = Rt(e);
|
|
2340
|
+
if ((Q == null ? void 0 : Q.type) === "kaspi_pay" && (o != null && o.isAvailable) && u && !l)
|
|
2341
2341
|
return ee;
|
|
2342
|
-
if ((
|
|
2343
|
-
if ((
|
|
2344
|
-
if ((
|
|
2342
|
+
if ((Q == null ? void 0 : Q.type) === "apple_pay" && _) return it;
|
|
2343
|
+
if ((Q == null ? void 0 : Q.type) === "google_pay" && E) return at;
|
|
2344
|
+
if ((Q == null ? void 0 : Q.type) === "new_card" && K(s.payment_method_new_card))
|
|
2345
2345
|
return { iconType: "new_card", type: "new_card", label: "Оплата новой картой" };
|
|
2346
|
-
if ((
|
|
2347
|
-
const L =
|
|
2346
|
+
if ((Q == null ? void 0 : Q.type) === "card" && a) {
|
|
2347
|
+
const L = Q.cardId != null ? i.find((O) => !O.isExpired && String(O.id) === Q.cardId) : null;
|
|
2348
2348
|
if (L)
|
|
2349
2349
|
return {
|
|
2350
2350
|
iconType: ge(L.attributes.mask),
|
|
@@ -2434,7 +2434,8 @@ function Qe(e, t, o, i, s) {
|
|
|
2434
2434
|
payment_method: t,
|
|
2435
2435
|
...e.backlink && { backlink: e.backlink },
|
|
2436
2436
|
...i && { use_balance: !0 },
|
|
2437
|
-
...s && { voucher: s }
|
|
2437
|
+
...s && { voucher: s },
|
|
2438
|
+
...e.isFridge && { is_fridge: !0 }
|
|
2438
2439
|
};
|
|
2439
2440
|
}
|
|
2440
2441
|
async function Se(e, t, o, i, s) {
|
|
@@ -2452,7 +2453,7 @@ async function Se(e, t, o, i, s) {
|
|
|
2452
2453
|
return u.ok || await Z(u, s), u.json();
|
|
2453
2454
|
}
|
|
2454
2455
|
async function Nt(e, t, o) {
|
|
2455
|
-
var l, f, C,
|
|
2456
|
+
var l, f, C, P;
|
|
2456
2457
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2457
2458
|
method: "POST",
|
|
2458
2459
|
headers: {
|
|
@@ -2467,12 +2468,12 @@ async function Nt(e, t, o) {
|
|
|
2467
2468
|
})
|
|
2468
2469
|
});
|
|
2469
2470
|
i.ok || await Z(i, "Не удалось авторизоваться через track_id");
|
|
2470
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2471
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((P = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : P.refresh_token) ?? null;
|
|
2471
2472
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2472
2473
|
return { access_token: u, refresh_token: a };
|
|
2473
2474
|
}
|
|
2474
2475
|
async function Dt(e, t, o) {
|
|
2475
|
-
var l, f, C,
|
|
2476
|
+
var l, f, C, P;
|
|
2476
2477
|
const i = await fetch(`${e}/api/v2/oauth2/tokens`, {
|
|
2477
2478
|
method: "POST",
|
|
2478
2479
|
headers: { "Content-Type": "application/json" },
|
|
@@ -2483,7 +2484,7 @@ async function Dt(e, t, o) {
|
|
|
2483
2484
|
})
|
|
2484
2485
|
});
|
|
2485
2486
|
i.ok || await Z(i, "Не удалось обновить токен по refresh_token");
|
|
2486
|
-
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((
|
|
2487
|
+
const s = await i.json(), u = (s == null ? void 0 : s.access_token) ?? ((f = (l = s == null ? void 0 : s.data) == null ? void 0 : l.attributes) == null ? void 0 : f.access_token), a = (s == null ? void 0 : s.refresh_token) ?? ((P = (C = s == null ? void 0 : s.data) == null ? void 0 : C.attributes) == null ? void 0 : P.refresh_token) ?? null;
|
|
2487
2488
|
if (!u) throw new Error("В ответе отсутствует access_token");
|
|
2488
2489
|
return { access_token: u, refresh_token: a };
|
|
2489
2490
|
}
|
|
@@ -2669,6 +2670,7 @@ function jt(e) {
|
|
|
2669
2670
|
disableKaspi: !!e.disableKaspi,
|
|
2670
2671
|
disableGooglePay: !!e.disableGooglePay,
|
|
2671
2672
|
isNativeAndroid: !!e.isNativeAndroid,
|
|
2673
|
+
isFridge: !!e.isFridge,
|
|
2672
2674
|
bonuses: s
|
|
2673
2675
|
};
|
|
2674
2676
|
}
|
|
@@ -2917,30 +2919,38 @@ function cn(e) {
|
|
|
2917
2919
|
balanceFormatted: l,
|
|
2918
2920
|
useBalance: f,
|
|
2919
2921
|
bonuses: C,
|
|
2920
|
-
useBonuses:
|
|
2922
|
+
useBonuses: P,
|
|
2921
2923
|
coupon: _,
|
|
2922
|
-
useCoupon:
|
|
2923
|
-
couponDisabled:
|
|
2924
|
+
useCoupon: E,
|
|
2925
|
+
couponDisabled: Q,
|
|
2924
2926
|
cashbackFormatted: T,
|
|
2925
|
-
disabled:
|
|
2927
|
+
disabled: B,
|
|
2926
2928
|
paymentMethodDisabled: w = !1,
|
|
2927
|
-
loading:
|
|
2928
|
-
t:
|
|
2929
|
+
loading: k,
|
|
2930
|
+
t: b,
|
|
2929
2931
|
currency: L
|
|
2930
|
-
} = e, O = (s == null ? void 0 : s.label) ??
|
|
2932
|
+
} = e, O = (s == null ? void 0 : s.label) ?? b("selectMethod"), F = Ee(s), N = ut(u, a), q = sn(l, f, C, P, _, E, Q, b, L), J = an(T, b), x = (a == null ? void 0 : a.type) === "google_pay", M = (a == null ? void 0 : a.type) === "apple_pay", m = x || M;
|
|
2931
2933
|
return `
|
|
2932
|
-
<div class="choco-widget-bottom-bar" role="region" aria-label="${
|
|
2934
|
+
<div class="choco-widget-bottom-bar" role="region" aria-label="${b("paymentMethod")}">
|
|
2933
2935
|
${q}
|
|
2934
2936
|
<div class="choco-widget-payment-info">
|
|
2937
|
+
<button
|
|
2938
|
+
class="choco-widget-freedom-card-btn"
|
|
2939
|
+
data-action="freedom-card"
|
|
2940
|
+
type="button"
|
|
2941
|
+
${B || k ? "disabled" : ""}
|
|
2942
|
+
>
|
|
2943
|
+
карта Freedom
|
|
2944
|
+
</button>
|
|
2935
2945
|
<div class="choco-widget-payment-info-main">
|
|
2936
2946
|
<button
|
|
2937
2947
|
class="choco-widget-payment-method ${(s == null ? void 0 : s.type) || ""}"
|
|
2938
2948
|
data-action="change-method"
|
|
2939
|
-
aria-label="${
|
|
2949
|
+
aria-label="${b("paymentMethod")}: ${O}"
|
|
2940
2950
|
type="button"
|
|
2941
|
-
${w ||
|
|
2951
|
+
${w || B || k ? "disabled" : ""}
|
|
2942
2952
|
>
|
|
2943
|
-
<div class="choco-widget-method-label">${
|
|
2953
|
+
<div class="choco-widget-method-label">${b("paymentMethod")}</div>
|
|
2944
2954
|
<div class="choco-widget-method-value">
|
|
2945
2955
|
<div class="choco-widget-method-icon-wrapper ${s == null ? void 0 : s.type}" aria-hidden="true">${F}</div>
|
|
2946
2956
|
<div class="choco-widget-method-details">
|
|
@@ -2954,17 +2964,17 @@ function cn(e) {
|
|
|
2954
2964
|
</div>
|
|
2955
2965
|
</button>
|
|
2956
2966
|
<div class="choco-widget-google-pay-amount ${m ? "" : "choco-widget-google-pay-amount--hidden"}" aria-live="polite">
|
|
2957
|
-
<div class="choco-widget-google-pay-amount-label">${
|
|
2958
|
-
${i ? `<div class="choco-widget-google-pay-amount-value">${
|
|
2967
|
+
<div class="choco-widget-google-pay-amount-label">${b("total")} ${t}</div>
|
|
2968
|
+
${i ? `<div class="choco-widget-google-pay-amount-value">${b("instead")} <span class="choco-widget-google-pay-amount-value-number">${o || ""}</span></div>` : ""}
|
|
2959
2969
|
</div>
|
|
2960
2970
|
<button
|
|
2961
|
-
class="choco-widget-pay-button ${
|
|
2971
|
+
class="choco-widget-pay-button ${k ? "choco-widget-pay-button--loading" : ""} ${m ? "choco-widget-pay-button--hidden" : ""}"
|
|
2962
2972
|
data-action="pay"
|
|
2963
|
-
aria-label="${
|
|
2973
|
+
aria-label="${b("pay")} ${t}"
|
|
2964
2974
|
type="button"
|
|
2965
|
-
${
|
|
2975
|
+
${B || k ? "disabled" : ""}
|
|
2966
2976
|
>
|
|
2967
|
-
${
|
|
2977
|
+
${b("pay")} ${t}
|
|
2968
2978
|
</button>
|
|
2969
2979
|
</div>
|
|
2970
2980
|
<div class="choco-widget-google-pay-row ${x ? "" : "choco-widget-google-pay-row--hidden"}">
|
|
@@ -2996,7 +3006,7 @@ function cn(e) {
|
|
|
2996
3006
|
<path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2997
3007
|
</svg>
|
|
2998
3008
|
</button>
|
|
2999
|
-
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${
|
|
3009
|
+
<h3 class="choco-widget-sheet-title" id="choco-sheet-title">${b("paymentMethods")}</h3>
|
|
3000
3010
|
<button
|
|
3001
3011
|
class="choco-widget-sheet-button choco-widget-sheet-button--edit"
|
|
3002
3012
|
data-action="edit-sheet"
|
|
@@ -3011,7 +3021,7 @@ function cn(e) {
|
|
|
3011
3021
|
<button
|
|
3012
3022
|
class="choco-widget-sheet-button choco-widget-sheet-button--previous"
|
|
3013
3023
|
data-action="previous-sheet"
|
|
3014
|
-
aria-label="${
|
|
3024
|
+
aria-label="${b("back")}"
|
|
3015
3025
|
type="button"
|
|
3016
3026
|
style="display: none;"
|
|
3017
3027
|
>
|
|
@@ -3026,8 +3036,8 @@ function cn(e) {
|
|
|
3026
3036
|
</div>
|
|
3027
3037
|
<div class="choco-widget-sheet-delete-confirm" data-delete-confirm="content" aria-hidden="true">
|
|
3028
3038
|
<div class="choco-widget-sheet-delete-confirm-actions">
|
|
3029
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${
|
|
3030
|
-
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${
|
|
3039
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--cancel" data-action="confirm-delete-cancel">${b("cancel")}</button>
|
|
3040
|
+
<button type="button" class="choco-widget-delete-confirm-btn choco-widget-delete-confirm-btn--delete" data-action="confirm-delete-submit">${b("delete")}</button>
|
|
3031
3041
|
</div>
|
|
3032
3042
|
</div>
|
|
3033
3043
|
${J}
|
|
@@ -3037,10 +3047,10 @@ function cn(e) {
|
|
|
3037
3047
|
<div class="choco-widget-add-card-sheet choco-widget-payment-sheet" data-sheet="add-card" aria-hidden="true" style="display: none;">
|
|
3038
3048
|
<div class="choco-widget-sheet-content choco-widget-add-card-sheet-content">
|
|
3039
3049
|
<div class="choco-widget-sheet-header">
|
|
3040
|
-
<h3 class="choco-widget-sheet-title">${
|
|
3050
|
+
<h3 class="choco-widget-sheet-title">${b("addCard")}</h3>
|
|
3041
3051
|
</div>
|
|
3042
3052
|
<div class="choco-widget-add-card-iframe-wrapper">
|
|
3043
|
-
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${
|
|
3053
|
+
<iframe id="choco-widget-add-card-iframe" class="choco-widget-add-card-iframe" title="${b("addCard")}" sandbox="allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"></iframe>
|
|
3044
3054
|
</div>
|
|
3045
3055
|
</div>
|
|
3046
3056
|
</div>
|
|
@@ -3078,10 +3088,10 @@ function hn(e) {
|
|
|
3078
3088
|
lt(e) && (e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.innerHTML = An());
|
|
3079
3089
|
}
|
|
3080
3090
|
function fn(e) {
|
|
3081
|
-
var
|
|
3091
|
+
var P, _, E, Q, T;
|
|
3082
3092
|
if (e._destroyed || !lt(e)) return;
|
|
3083
3093
|
e.container.style.setProperty("--choco-widget-accent-color", e.config.color), e.container.classList.remove("choco-one-click-widget--visible");
|
|
3084
|
-
const t = e.getAvailablePaymentMethods(), o = (
|
|
3094
|
+
const t = e.getAvailablePaymentMethods(), o = (P = e.checkoutContext) == null ? void 0 : P.data, i = e.config.currency || "KZT", s = (Q = (E = (_ = o == null ? void 0 : o.balance) == null ? void 0 : _.data) == null ? void 0 : E.money) == null ? void 0 : Q[i], u = s > 0 ? V(s, e.config.locale, e.config.currency) : null, a = (T = o == null ? void 0 : o.cashback) == null ? void 0 : T.data, l = (a == null ? void 0 : a.cashbackAmount) > 0 ? V(a.cashbackAmount, e.config.locale, e.config.currency) : null, f = e._getPayableAmount(), C = f < e.config.amount;
|
|
3085
3095
|
e.container.innerHTML = cn({
|
|
3086
3096
|
amountFormatted: V(f, e.config.locale, e.config.currency),
|
|
3087
3097
|
originalAmountFormatted: V(
|
|
@@ -3104,7 +3114,7 @@ function fn(e) {
|
|
|
3104
3114
|
disabled: e.disabled,
|
|
3105
3115
|
paymentMethodDisabled: e.paymentMethodDisabled,
|
|
3106
3116
|
loading: e.loading,
|
|
3107
|
-
t: (
|
|
3117
|
+
t: (B, w) => e.t(B, w),
|
|
3108
3118
|
currency: i
|
|
3109
3119
|
}), e._attachEventListeners(), e.isOpen = !0, e._emitUserEvent("one_click_pay_cta_rendered", {
|
|
3110
3120
|
terminal_id: e.config.terminalId,
|
|
@@ -3113,8 +3123,8 @@ function fn(e) {
|
|
|
3113
3123
|
payment_method: e._getPaymentMethodForUserEvent()
|
|
3114
3124
|
}), requestAnimationFrame(() => {
|
|
3115
3125
|
requestAnimationFrame(() => {
|
|
3116
|
-
var
|
|
3117
|
-
e._destroyed || (
|
|
3126
|
+
var B;
|
|
3127
|
+
e._destroyed || (B = e.container) == null || B.classList.add("choco-one-click-widget--visible");
|
|
3118
3128
|
});
|
|
3119
3129
|
});
|
|
3120
3130
|
}
|
|
@@ -3153,13 +3163,13 @@ function dt(e) {
|
|
|
3153
3163
|
t && e.selectedPaymentMethod && (t.className = `choco-widget-payment-method ${e.selectedPaymentMethod.type}`), o && e.selectedPaymentMethod && (o.className = `choco-widget-method-name ${e.selectedPaymentMethod.type}`, o.textContent = e.selectedPaymentMethod.label), i && e.selectedPaymentMethod && (i.className = `choco-widget-method-icon-wrapper ${e.selectedPaymentMethod.type}`, i.innerHTML = ln(e.selectedPaymentMethod)), ht(e);
|
|
3154
3164
|
}
|
|
3155
3165
|
function pe(e) {
|
|
3156
|
-
var
|
|
3157
|
-
const t = (
|
|
3166
|
+
var P, _, E, Q, T;
|
|
3167
|
+
const t = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-pay-button"), o = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3158
3168
|
".choco-widget-google-pay-amount"
|
|
3159
|
-
), i = (
|
|
3169
|
+
), i = (E = e.container) == null ? void 0 : E.querySelector(
|
|
3160
3170
|
".choco-widget-google-pay-amount-label"
|
|
3161
3171
|
);
|
|
3162
|
-
let s = (
|
|
3172
|
+
let s = (Q = e.container) == null ? void 0 : Q.querySelector(
|
|
3163
3173
|
".choco-widget-google-pay-amount-value"
|
|
3164
3174
|
), u = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3165
3175
|
".choco-widget-google-pay-amount-value-number"
|
|
@@ -3178,38 +3188,38 @@ function pe(e) {
|
|
|
3178
3188
|
)), u ? u.textContent = C : s && (s.textContent = `${e.t("instead")} ${C}`);
|
|
3179
3189
|
}
|
|
3180
3190
|
function ht(e) {
|
|
3181
|
-
var f, C,
|
|
3182
|
-
const t = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "google_pay", o = ((C = e.selectedPaymentMethod) == null ? void 0 : C.type) === "apple_pay", i = t || o, s = (
|
|
3191
|
+
var f, C, P, _, E, Q, T, B, w, k;
|
|
3192
|
+
const t = ((f = e.selectedPaymentMethod) == null ? void 0 : f.type) === "google_pay", o = ((C = e.selectedPaymentMethod) == null ? void 0 : C.type) === "apple_pay", i = t || o, s = (P = e.container) == null ? void 0 : P.querySelector(".choco-widget-pay-button"), u = (_ = e.container) == null ? void 0 : _.querySelector(
|
|
3183
3193
|
".choco-widget-google-pay-amount"
|
|
3184
|
-
), a = (
|
|
3194
|
+
), a = (E = e.container) == null ? void 0 : E.querySelector(".choco-widget-google-pay-row"), l = (Q = e.container) == null ? void 0 : Q.querySelector(".choco-widget-apple-pay-row");
|
|
3185
3195
|
if (s == null || s.classList.toggle("choco-widget-pay-button--hidden", i), u == null || u.classList.toggle(
|
|
3186
3196
|
"choco-widget-google-pay-amount--hidden",
|
|
3187
3197
|
!i
|
|
3188
3198
|
), a == null || a.classList.toggle("choco-widget-google-pay-row--hidden", !t), l == null || l.classList.toggle("choco-widget-apple-pay-row--hidden", !o), t) {
|
|
3189
3199
|
gn(e);
|
|
3190
|
-
const
|
|
3200
|
+
const b = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3191
3201
|
'[data-action="apple-pay-button-slot"]'
|
|
3192
3202
|
);
|
|
3193
|
-
|
|
3203
|
+
b && (b.innerHTML = "");
|
|
3194
3204
|
} else if (o) {
|
|
3195
3205
|
e._googlePayButtonRenderVersion += 1;
|
|
3196
|
-
const
|
|
3206
|
+
const b = (B = e.container) == null ? void 0 : B.querySelector(
|
|
3197
3207
|
'[data-action="google-pay-button-slot"]'
|
|
3198
3208
|
);
|
|
3199
|
-
|
|
3209
|
+
b && (b.innerHTML = ""), pn(e);
|
|
3200
3210
|
} else {
|
|
3201
3211
|
e._googlePayButtonRenderVersion += 1;
|
|
3202
|
-
const
|
|
3212
|
+
const b = (w = e.container) == null ? void 0 : w.querySelector(
|
|
3203
3213
|
'[data-action="google-pay-button-slot"]'
|
|
3204
|
-
), L = (
|
|
3214
|
+
), L = (k = e.container) == null ? void 0 : k.querySelector(
|
|
3205
3215
|
'[data-action="apple-pay-button-slot"]'
|
|
3206
3216
|
);
|
|
3207
|
-
|
|
3217
|
+
b && (b.innerHTML = ""), L && (L.innerHTML = "");
|
|
3208
3218
|
}
|
|
3209
3219
|
pe(e), Y(e);
|
|
3210
3220
|
}
|
|
3211
3221
|
async function gn(e) {
|
|
3212
|
-
var a, l, f, C,
|
|
3222
|
+
var a, l, f, C, P;
|
|
3213
3223
|
const t = (a = e.container) == null ? void 0 : a.querySelector(
|
|
3214
3224
|
'[data-action="google-pay-button-slot"]'
|
|
3215
3225
|
);
|
|
@@ -3222,7 +3232,7 @@ async function gn(e) {
|
|
|
3222
3232
|
return;
|
|
3223
3233
|
}
|
|
3224
3234
|
if (o !== e._googlePayButtonRenderVersion) return;
|
|
3225
|
-
if (!((
|
|
3235
|
+
if (!((P = (C = (f = window.google) == null ? void 0 : f.payments) == null ? void 0 : C.api) != null && P.PaymentsClient)) {
|
|
3226
3236
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3227
3237
|
return;
|
|
3228
3238
|
}
|
|
@@ -3281,31 +3291,31 @@ function ne(e) {
|
|
|
3281
3291
|
e.loading = !0, Y(e);
|
|
3282
3292
|
}
|
|
3283
3293
|
function j(e) {
|
|
3284
|
-
var _,
|
|
3294
|
+
var _, E, Q, T, B, w, k, b;
|
|
3285
3295
|
e.loading = !1;
|
|
3286
|
-
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (
|
|
3296
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (E = e.container) == null ? void 0 : E.querySelector(".choco-widget-pay-button"), i = (Q = e.container) == null ? void 0 : Q.querySelector(
|
|
3287
3297
|
".choco-widget-google-pay-button-slot button"
|
|
3288
3298
|
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3289
3299
|
".choco-widget-apple-pay-button-slot button"
|
|
3290
|
-
), u = (
|
|
3300
|
+
), u = (B = e.container) == null ? void 0 : B.querySelector(
|
|
3291
3301
|
".choco-widget-google-pay-amount"
|
|
3292
|
-
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (
|
|
3302
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-apple-pay-row"), f = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3293
3303
|
".choco-widget-balance-section"
|
|
3294
|
-
), C = e._isInteractionBlocked(),
|
|
3295
|
-
t && (t.disabled =
|
|
3304
|
+
), C = e._isInteractionBlocked(), P = e.paymentMethodDisabled || C;
|
|
3305
|
+
t && (t.disabled = P), o && (o.disabled = C, o.classList.remove("choco-widget-pay-button--loading")), i && (i.disabled = C), s && (s.disabled = C), u == null || u.classList.toggle("choco-widget-wallet-blocked", C), u == null || u.setAttribute("aria-disabled", String(C)), a == null || a.classList.toggle("choco-widget-wallet-blocked", C), a == null || a.setAttribute("aria-disabled", String(C)), l == null || l.classList.toggle("choco-widget-wallet-blocked", C), l == null || l.setAttribute("aria-disabled", String(C)), f == null || f.classList.remove("disabled");
|
|
3296
3306
|
}
|
|
3297
3307
|
function Y(e) {
|
|
3298
|
-
var _,
|
|
3299
|
-
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (
|
|
3308
|
+
var _, E, Q, T, B, w, k, b;
|
|
3309
|
+
const t = (_ = e.container) == null ? void 0 : _.querySelector(".choco-widget-payment-method"), o = (E = e.container) == null ? void 0 : E.querySelector(".choco-widget-pay-button"), i = (Q = e.container) == null ? void 0 : Q.querySelector(
|
|
3300
3310
|
".choco-widget-google-pay-button-slot button"
|
|
3301
3311
|
), s = (T = e.container) == null ? void 0 : T.querySelector(
|
|
3302
3312
|
".choco-widget-apple-pay-button-slot button"
|
|
3303
|
-
), u = (
|
|
3313
|
+
), u = (B = e.container) == null ? void 0 : B.querySelector(
|
|
3304
3314
|
".choco-widget-google-pay-amount"
|
|
3305
|
-
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (
|
|
3315
|
+
), a = (w = e.container) == null ? void 0 : w.querySelector(".choco-widget-google-pay-row"), l = (k = e.container) == null ? void 0 : k.querySelector(".choco-widget-apple-pay-row"), f = (b = e.container) == null ? void 0 : b.querySelector(
|
|
3306
3316
|
".choco-widget-balance-section"
|
|
3307
|
-
), C = e._isInteractionBlocked(),
|
|
3308
|
-
f == null || f.classList.toggle("disabled", C), t && (t.disabled =
|
|
3317
|
+
), C = e._isInteractionBlocked(), P = e.paymentMethodDisabled || C;
|
|
3318
|
+
f == null || f.classList.toggle("disabled", C), t && (t.disabled = P), o && (o.disabled = C, o.classList.toggle("choco-widget-pay-button--loading", e.loading)), i && (i.disabled = C), s && (s.disabled = C), u == null || u.classList.toggle("choco-widget-wallet-blocked", C), u == null || u.setAttribute("aria-disabled", String(C)), a == null || a.classList.toggle("choco-widget-wallet-blocked", C), a == null || a.setAttribute("aria-disabled", String(C)), l == null || l.classList.toggle("choco-widget-wallet-blocked", C), l == null || l.setAttribute("aria-disabled", String(C));
|
|
3309
3319
|
}
|
|
3310
3320
|
function ft(e) {
|
|
3311
3321
|
var o;
|
|
@@ -3572,12 +3582,12 @@ async function vn(e) {
|
|
|
3572
3582
|
await rt(e);
|
|
3573
3583
|
const l = (a == null ? void 0 : a.id) ?? ((i = a == null ? void 0 : a.data) == null ? void 0 : i.id);
|
|
3574
3584
|
if (l && ce(e, String(l)), ((s = e.selectedPaymentMethod) == null ? void 0 : s.type) === "kaspi_pay") {
|
|
3575
|
-
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url,
|
|
3585
|
+
const f = (a == null ? void 0 : a.attributes) || ((u = a == null ? void 0 : a.data) == null ? void 0 : u.attributes) || {}, C = f.action_link || f.action_url, P = f.action_url_type || f.action_type || "redirect";
|
|
3576
3586
|
if (C)
|
|
3577
3587
|
return typeof e.config.onKaspiLink == "function" ? (e.config.onKaspiLink({
|
|
3578
3588
|
action_link: C,
|
|
3579
3589
|
action_url: C,
|
|
3580
|
-
action_type:
|
|
3590
|
+
action_type: P,
|
|
3581
3591
|
event: a
|
|
3582
3592
|
}), a) : (window.location.href = C, a);
|
|
3583
3593
|
}
|
|
@@ -3646,8 +3656,8 @@ async function In(e, t) {
|
|
|
3646
3656
|
e.apiUrl,
|
|
3647
3657
|
e._getApiConfig(),
|
|
3648
3658
|
u.validationURL
|
|
3649
|
-
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f,
|
|
3650
|
-
s.completeMerchantValidation(
|
|
3659
|
+
), C = ((l = (a = f == null ? void 0 : f.data) == null ? void 0 : a.attributes) == null ? void 0 : l.session) || f, P = JSON.parse(atob(C));
|
|
3660
|
+
s.completeMerchantValidation(P);
|
|
3651
3661
|
} catch (f) {
|
|
3652
3662
|
console.error("Apple Pay session error:", f), s.abort(), e.config.onError({ attributes: { message: e.t("errorApplePayInit") } });
|
|
3653
3663
|
}
|
|
@@ -3680,8 +3690,8 @@ async function In(e, t) {
|
|
|
3680
3690
|
}, s.begin();
|
|
3681
3691
|
}
|
|
3682
3692
|
async function Qn(e, t) {
|
|
3683
|
-
var w,
|
|
3684
|
-
const o = (w = e.checkoutContext) == null ? void 0 : w.data, i = ((
|
|
3693
|
+
var w, k, b, L, O, F;
|
|
3694
|
+
const o = (w = e.checkoutContext) == null ? void 0 : w.data, i = ((b = (k = o == null ? void 0 : o.payment_methods) == null ? void 0 : k.data) == null ? void 0 : b.attributes) || {}, s = i.google_pay_settings || {};
|
|
3685
3695
|
if (!(i.payment_method_google_pay === "enabled" || i.payment_method_google_pay === !0)) {
|
|
3686
3696
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3687
3697
|
return;
|
|
@@ -3693,8 +3703,8 @@ async function Qn(e, t) {
|
|
|
3693
3703
|
});
|
|
3694
3704
|
return;
|
|
3695
3705
|
}
|
|
3696
|
-
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco",
|
|
3697
|
-
if (f && !
|
|
3706
|
+
const f = e.config.environment === "production", C = (s == null ? void 0 : s.merchant_name) || "Choco", P = s == null ? void 0 : s.google_merchant_id;
|
|
3707
|
+
if (f && !P) {
|
|
3698
3708
|
e.config.onError({
|
|
3699
3709
|
attributes: { message: e.t("errorGooglePaySettingsUnavailable") }
|
|
3700
3710
|
});
|
|
@@ -3711,12 +3721,12 @@ async function Qn(e, t) {
|
|
|
3711
3721
|
console.error("Google Pay SDK load error:", N), e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3712
3722
|
return;
|
|
3713
3723
|
}
|
|
3714
|
-
const
|
|
3715
|
-
if (!(
|
|
3724
|
+
const E = window.google;
|
|
3725
|
+
if (!(E != null && E.payments)) {
|
|
3716
3726
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3717
3727
|
return;
|
|
3718
3728
|
}
|
|
3719
|
-
const
|
|
3729
|
+
const Q = [
|
|
3720
3730
|
{
|
|
3721
3731
|
type: "CARD",
|
|
3722
3732
|
parameters: {
|
|
@@ -3732,7 +3742,7 @@ async function Qn(e, t) {
|
|
|
3732
3742
|
], T = {
|
|
3733
3743
|
apiVersion: 2,
|
|
3734
3744
|
apiVersionMinor: 0,
|
|
3735
|
-
allowedPaymentMethods:
|
|
3745
|
+
allowedPaymentMethods: Q,
|
|
3736
3746
|
transactionInfo: {
|
|
3737
3747
|
totalPriceStatus: "FINAL",
|
|
3738
3748
|
totalPriceLabel: "Итого",
|
|
@@ -3740,22 +3750,22 @@ async function Qn(e, t) {
|
|
|
3740
3750
|
currencyCode: e.config.currency,
|
|
3741
3751
|
countryCode: e.config.currency === "GEL" ? "GE" : "KZ"
|
|
3742
3752
|
},
|
|
3743
|
-
merchantInfo: f ? { merchantId:
|
|
3744
|
-
},
|
|
3753
|
+
merchantInfo: f ? { merchantId: P, merchantName: C } : { merchantName: C }
|
|
3754
|
+
}, B = new E.payments.api.PaymentsClient({
|
|
3745
3755
|
environment: f ? "PRODUCTION" : "TEST"
|
|
3746
3756
|
});
|
|
3747
3757
|
try {
|
|
3748
|
-
const N = await
|
|
3758
|
+
const N = await B.isReadyToPay({
|
|
3749
3759
|
apiVersion: 2,
|
|
3750
3760
|
apiVersionMinor: 0,
|
|
3751
|
-
allowedPaymentMethods:
|
|
3761
|
+
allowedPaymentMethods: Q
|
|
3752
3762
|
});
|
|
3753
3763
|
if (!(N != null && N.result)) {
|
|
3754
3764
|
e.config.onError({ attributes: { message: e.t("errorGooglePayUnsupported") } });
|
|
3755
3765
|
return;
|
|
3756
3766
|
}
|
|
3757
3767
|
ne(e);
|
|
3758
|
-
const q = await
|
|
3768
|
+
const q = await B.loadPaymentData(T), J = (O = (L = q == null ? void 0 : q.paymentMethodData) == null ? void 0 : L.tokenizationData) == null ? void 0 : O.token;
|
|
3759
3769
|
if (!J) throw new Error(e.t("errorGooglePayPayment"));
|
|
3760
3770
|
const x = JSON.parse(J), M = await At(
|
|
3761
3771
|
e.apiUrl,
|
|
@@ -3802,42 +3812,46 @@ async function Sn(e, t, o) {
|
|
|
3802
3812
|
}
|
|
3803
3813
|
}
|
|
3804
3814
|
function Pn(e) {
|
|
3805
|
-
var a, l, f, C,
|
|
3815
|
+
var a, l, f, C, P, _, E, Q, T, B, w, k;
|
|
3806
3816
|
const t = e.container;
|
|
3807
|
-
(a = t.querySelector('[data-action="
|
|
3817
|
+
(a = t.querySelector('[data-action="freedom-card"]')) == null || a.addEventListener("click", () => {
|
|
3818
|
+
e._emitUserEvent("one_click_freedom_card_clicked", {
|
|
3819
|
+
terminal_id: e.config.terminalId
|
|
3820
|
+
});
|
|
3821
|
+
}), (l = t.querySelector('[data-action="pay"]')) == null || l.addEventListener("click", () => e.handlePayment()), (f = t.querySelector('[data-action="change-method"]')) == null || f.addEventListener("click", () => ft(e)), t.querySelectorAll('[data-action="close"]').forEach((b) => b.addEventListener("click", () => e.close())), (C = t.querySelector('[data-action="close-sheet"]')) == null || C.addEventListener("click", () => {
|
|
3808
3822
|
e._pendingDeleteMethod ? ve(e) : G(e);
|
|
3809
|
-
}), (
|
|
3823
|
+
}), (P = t.querySelector('[data-action="edit-sheet"]')) == null || P.addEventListener("click", () => {
|
|
3810
3824
|
e.isPaymentSheetEditMode = !0, Ae(e), ue(e);
|
|
3811
|
-
}), (
|
|
3825
|
+
}), (_ = t.querySelector('[data-action="previous-sheet"]')) == null || _.addEventListener("click", () => {
|
|
3812
3826
|
e.isPaymentSheetEditMode = !1, Ae(e), ue(e);
|
|
3813
|
-
}), (
|
|
3827
|
+
}), (E = t.querySelector('[data-action="close-add-card"]')) == null || E.addEventListener("click", () => ae(e)), (Q = t.querySelector('[data-action="confirm-delete-cancel"]')) == null || Q.addEventListener("click", () => ve(e)), (T = t.querySelector('[data-action="confirm-delete-submit"]')) == null || T.addEventListener("click", () => {
|
|
3814
3828
|
if (e._pendingDeleteMethod) {
|
|
3815
|
-
const
|
|
3816
|
-
De(e, !0), bn(e,
|
|
3829
|
+
const b = e._pendingDeleteMethod;
|
|
3830
|
+
De(e, !0), bn(e, b).then(() => G(e)).finally(() => De(e, !1));
|
|
3817
3831
|
}
|
|
3818
|
-
}), t.querySelectorAll(".choco-widget-method-item").forEach((
|
|
3819
|
-
|
|
3820
|
-
const
|
|
3821
|
-
|
|
3832
|
+
}), t.querySelectorAll(".choco-widget-method-item").forEach((b) => {
|
|
3833
|
+
b.addEventListener("click", (L) => {
|
|
3834
|
+
const O = JSON.parse(
|
|
3835
|
+
L.currentTarget.getAttribute("data-method") || "{}"
|
|
3822
3836
|
);
|
|
3823
|
-
gt(e,
|
|
3837
|
+
gt(e, O);
|
|
3824
3838
|
});
|
|
3825
3839
|
});
|
|
3826
3840
|
const o = t.querySelector('[data-sheet="payment"]');
|
|
3827
|
-
o && (o.addEventListener("click", (
|
|
3828
|
-
|
|
3841
|
+
o && (o.addEventListener("click", (b) => {
|
|
3842
|
+
b.target === o && G(e);
|
|
3829
3843
|
}), wn(e, o));
|
|
3830
3844
|
const i = t.querySelector('[data-action="toggle-balance"]');
|
|
3831
|
-
i && ((
|
|
3832
|
-
e.useBalance =
|
|
3845
|
+
i && ((B = i.querySelector("input[type='checkbox']")) == null || B.addEventListener("change", (b) => {
|
|
3846
|
+
e.useBalance = b.target.checked, tt(e), e._updatePayButtonAmount();
|
|
3833
3847
|
}));
|
|
3834
3848
|
const s = t.querySelector('[data-action="toggle-bonuses"]');
|
|
3835
|
-
s && ((
|
|
3836
|
-
e.useBonuses =
|
|
3849
|
+
s && ((w = s.querySelector("input[type='checkbox']")) == null || w.addEventListener("change", (b) => {
|
|
3850
|
+
e.useBonuses = b.target.checked, e.config.onAppliedBonus(e.useBonuses), tt(e), e._updatePayButtonAmount();
|
|
3837
3851
|
}));
|
|
3838
3852
|
const u = t.querySelector('[data-action="toggle-coupon"]');
|
|
3839
|
-
u && ((
|
|
3840
|
-
e.useCoupon =
|
|
3853
|
+
u && ((k = u.querySelector("input[type='checkbox']")) == null || k.addEventListener("change", (b) => {
|
|
3854
|
+
e.useCoupon = b.target.checked, e._updatePayButtonAmount();
|
|
3841
3855
|
})), document.removeEventListener("keydown", e._boundKeyDown), document.addEventListener("keydown", e._boundKeyDown), ht(e);
|
|
3842
3856
|
}
|
|
3843
3857
|
function kn(e, t) {
|
|
@@ -3851,12 +3865,12 @@ function wn(e, t) {
|
|
|
3851
3865
|
let u = 0, a = 0;
|
|
3852
3866
|
const l = (C) => {
|
|
3853
3867
|
a = C.clientY;
|
|
3854
|
-
const
|
|
3855
|
-
i.style.transform = `translateY(${
|
|
3868
|
+
const P = Math.max(0, a - u);
|
|
3869
|
+
i.style.transform = `translateY(${P}px)`;
|
|
3856
3870
|
}, f = (C) => {
|
|
3857
3871
|
o.releasePointerCapture(C.pointerId), o.removeEventListener("pointermove", l), o.removeEventListener("pointerup", f), o.removeEventListener("pointercancel", f);
|
|
3858
|
-
const
|
|
3859
|
-
if (i.classList.remove("choco-widget-sheet-content--dragging"),
|
|
3872
|
+
const P = Math.max(0, a - u);
|
|
3873
|
+
if (i.classList.remove("choco-widget-sheet-content--dragging"), P >= s) {
|
|
3860
3874
|
i.style.transform = "translateY(100%)";
|
|
3861
3875
|
const _ = () => {
|
|
3862
3876
|
i.removeEventListener("transitionend", _), i.style.transform = "", G(e);
|
|
@@ -3932,7 +3946,7 @@ class ie {
|
|
|
3932
3946
|
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
3933
3947
|
}
|
|
3934
3948
|
_getPaymentBreakdown() {
|
|
3935
|
-
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0),
|
|
3949
|
+
const t = this.config.amount, o = this._getBalanceAmount(), i = this.useBalance ? Math.min(o, t) : 0, s = t - i, u = this.useBalance && i >= t, a = this.useBonuses ? this._getAvailableBonus() : 0, l = Math.max(s - a, 0), f = this._getCouponDiscount(), C = Math.max(l - f, 0), P = this.useBalance ? t : C, _ = this.useBalance && !u, Q = this.useCoupon && this.selectedCoupon && !this._isCouponDisabled() ? {
|
|
3936
3950
|
id: this.selectedCoupon.voucher_id,
|
|
3937
3951
|
template_id: this.selectedCoupon.template_id,
|
|
3938
3952
|
type: this.selectedCoupon.type
|
|
@@ -3940,10 +3954,10 @@ class ie {
|
|
|
3940
3954
|
return {
|
|
3941
3955
|
payableAmount: C,
|
|
3942
3956
|
checkoutOptions: {
|
|
3943
|
-
checkoutAmount:
|
|
3957
|
+
checkoutAmount: P,
|
|
3944
3958
|
forceBalanceMethod: u,
|
|
3945
3959
|
useBalance: _,
|
|
3946
|
-
voucher:
|
|
3960
|
+
voucher: Q
|
|
3947
3961
|
}
|
|
3948
3962
|
};
|
|
3949
3963
|
}
|