@blotoutio/providers-blotout-wallet-sdk 0.67.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.cjs.js +1 -1
- package/core.js +1 -1
- package/core.mjs +1 -1
- package/index.cjs.js +27 -26
- package/index.js +27 -26
- package/index.mjs +27 -26
- package/package.json +1 -1
- package/stores/shopify/index.cjs.js +4 -2
- package/stores/shopify/index.js +4 -2
- package/stores/shopify/index.mjs +4 -2
- package/ui.cjs.js +26 -25
- package/ui.js +26 -25
- package/ui.mjs +26 -25
package/core.cjs.js
CHANGED
@@ -236,7 +236,7 @@ const createWalletAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, sto
|
|
236
236
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
237
237
|
}
|
238
238
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
239
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
239
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
240
240
|
};
|
241
241
|
const deleteCarts = async () => {
|
242
242
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
package/core.js
CHANGED
@@ -237,7 +237,7 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
237
237
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
238
238
|
}
|
239
239
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
240
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
240
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
241
241
|
};
|
242
242
|
const deleteCarts = async () => {
|
243
243
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
package/core.mjs
CHANGED
@@ -234,7 +234,7 @@ const createWalletAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, sto
|
|
234
234
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
235
235
|
}
|
236
236
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
237
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
237
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
238
238
|
};
|
239
239
|
const deleteCarts = async () => {
|
240
240
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
package/index.cjs.js
CHANGED
@@ -294,7 +294,7 @@ const createWalletAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, sto
|
|
294
294
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
295
295
|
}
|
296
296
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
297
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
297
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
298
298
|
};
|
299
299
|
const deleteCarts = async () => {
|
300
300
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
@@ -726,12 +726,14 @@ let BlotoutWallet = class BlotoutWallet extends s {
|
|
726
726
|
if (!this.lastExpiredCart) {
|
727
727
|
return;
|
728
728
|
}
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
729
|
+
if (!this.silentRestore) {
|
730
|
+
const email = this.email.value.trim().toLowerCase();
|
731
|
+
if (email) {
|
732
|
+
await this.walletAPI.saveEmail(email);
|
733
|
+
this.email.value = '';
|
734
|
+
this.hasEmail = true;
|
735
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
736
|
+
}
|
735
737
|
}
|
736
738
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
737
739
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -1116,29 +1118,28 @@ BlotoutWallet = __decorate([
|
|
1116
1118
|
t$1('blotout-wallet')
|
1117
1119
|
], BlotoutWallet);
|
1118
1120
|
|
1119
|
-
var _a;
|
1121
|
+
var _a, _b;
|
1122
|
+
var _c;
|
1120
1123
|
let wallet;
|
1121
1124
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
1122
1125
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
1123
1126
|
// if a custom implementation is already present, don't override it
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
};
|
1141
|
-
}
|
1127
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
1128
|
+
init(params) {
|
1129
|
+
if (wallet) {
|
1130
|
+
return;
|
1131
|
+
}
|
1132
|
+
wallet = document.createElement('blotout-wallet');
|
1133
|
+
if (params.theme) {
|
1134
|
+
wallet.style.cssText = Object.entries(params.theme)
|
1135
|
+
.filter(([name]) => name.startsWith('--'))
|
1136
|
+
.map(([name, value]) => `${name}:${value}`)
|
1137
|
+
.join(';');
|
1138
|
+
}
|
1139
|
+
Object.assign(wallet, params);
|
1140
|
+
document.body.append(wallet);
|
1141
|
+
},
|
1142
|
+
});
|
1142
1143
|
}
|
1143
1144
|
|
1144
1145
|
module.exports = data;
|
package/index.js
CHANGED
@@ -295,7 +295,7 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
295
295
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
296
296
|
}
|
297
297
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
298
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
298
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
299
299
|
};
|
300
300
|
const deleteCarts = async () => {
|
301
301
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
@@ -727,12 +727,14 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
727
727
|
if (!this.lastExpiredCart) {
|
728
728
|
return;
|
729
729
|
}
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
730
|
+
if (!this.silentRestore) {
|
731
|
+
const email = this.email.value.trim().toLowerCase();
|
732
|
+
if (email) {
|
733
|
+
await this.walletAPI.saveEmail(email);
|
734
|
+
this.email.value = '';
|
735
|
+
this.hasEmail = true;
|
736
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
737
|
+
}
|
736
738
|
}
|
737
739
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
738
740
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -1117,29 +1119,28 @@ var ProvidersBlotoutWalletSdk = (function () {
|
|
1117
1119
|
t$1('blotout-wallet')
|
1118
1120
|
], BlotoutWallet);
|
1119
1121
|
|
1120
|
-
var _a;
|
1122
|
+
var _a, _b;
|
1123
|
+
var _c;
|
1121
1124
|
let wallet;
|
1122
1125
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
1123
1126
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
1124
1127
|
// if a custom implementation is already present, don't override it
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
};
|
1142
|
-
}
|
1128
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
1129
|
+
init(params) {
|
1130
|
+
if (wallet) {
|
1131
|
+
return;
|
1132
|
+
}
|
1133
|
+
wallet = document.createElement('blotout-wallet');
|
1134
|
+
if (params.theme) {
|
1135
|
+
wallet.style.cssText = Object.entries(params.theme)
|
1136
|
+
.filter(([name]) => name.startsWith('--'))
|
1137
|
+
.map(([name, value]) => `${name}:${value}`)
|
1138
|
+
.join(';');
|
1139
|
+
}
|
1140
|
+
Object.assign(wallet, params);
|
1141
|
+
document.body.append(wallet);
|
1142
|
+
},
|
1143
|
+
});
|
1143
1144
|
}
|
1144
1145
|
|
1145
1146
|
return data;
|
package/index.mjs
CHANGED
@@ -292,7 +292,7 @@ const createWalletAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId, sto
|
|
292
292
|
throw new Error(`Could not update status in DB - ${response.status}: ${response.text}\n\n${await response.text()}`);
|
293
293
|
}
|
294
294
|
// Send the request as beacon as there could be a immediate redirect in the next step
|
295
|
-
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon' });
|
295
|
+
window.edgetag('tag', 'CartRecovery_CartRestored', { isSilent }, undefined, { method: 'beacon', destination: baseURL });
|
296
296
|
};
|
297
297
|
const deleteCarts = async () => {
|
298
298
|
const response = await fetchImpl(getURL('/cart/skip'), {
|
@@ -724,12 +724,14 @@ let BlotoutWallet = class BlotoutWallet extends s {
|
|
724
724
|
if (!this.lastExpiredCart) {
|
725
725
|
return;
|
726
726
|
}
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
727
|
+
if (!this.silentRestore) {
|
728
|
+
const email = this.email.value.trim().toLowerCase();
|
729
|
+
if (email) {
|
730
|
+
await this.walletAPI.saveEmail(email);
|
731
|
+
this.email.value = '';
|
732
|
+
this.hasEmail = true;
|
733
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
734
|
+
}
|
733
735
|
}
|
734
736
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
735
737
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -1114,29 +1116,28 @@ BlotoutWallet = __decorate([
|
|
1114
1116
|
t$1('blotout-wallet')
|
1115
1117
|
], BlotoutWallet);
|
1116
1118
|
|
1117
|
-
var _a;
|
1119
|
+
var _a, _b;
|
1120
|
+
var _c;
|
1118
1121
|
let wallet;
|
1119
1122
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
1120
1123
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
1121
1124
|
// if a custom implementation is already present, don't override it
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
};
|
1139
|
-
}
|
1125
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
1126
|
+
init(params) {
|
1127
|
+
if (wallet) {
|
1128
|
+
return;
|
1129
|
+
}
|
1130
|
+
wallet = document.createElement('blotout-wallet');
|
1131
|
+
if (params.theme) {
|
1132
|
+
wallet.style.cssText = Object.entries(params.theme)
|
1133
|
+
.filter(([name]) => name.startsWith('--'))
|
1134
|
+
.map(([name, value]) => `${name}:${value}`)
|
1135
|
+
.join(';');
|
1136
|
+
}
|
1137
|
+
Object.assign(wallet, params);
|
1138
|
+
document.body.append(wallet);
|
1139
|
+
},
|
1140
|
+
});
|
1140
1141
|
}
|
1141
1142
|
|
1142
1143
|
export { data as default };
|
package/package.json
CHANGED
@@ -81,7 +81,8 @@ const parseCookies = (cookie) => {
|
|
81
81
|
}));
|
82
82
|
};
|
83
83
|
|
84
|
-
var _a;
|
84
|
+
var _a, _b;
|
85
|
+
var _c;
|
85
86
|
const MAX_RETRY_COUNT = 3;
|
86
87
|
const RETRY_DELAY = 500;
|
87
88
|
const ERROR_PATTERNS = {
|
@@ -165,5 +166,6 @@ const createShopApi = (fetchOverride = window.fetch) => ({
|
|
165
166
|
});
|
166
167
|
if (typeof window != 'undefined') {
|
167
168
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
168
|
-
|
169
|
+
// if a custom implementation is already present, don't override it
|
170
|
+
(_b = (_c = window[registryKey]).storeAPIFactory) !== null && _b !== void 0 ? _b : (_c.storeAPIFactory = createShopApi);
|
169
171
|
}
|
package/stores/shopify/index.js
CHANGED
@@ -82,7 +82,8 @@
|
|
82
82
|
}));
|
83
83
|
};
|
84
84
|
|
85
|
-
var _a;
|
85
|
+
var _a, _b;
|
86
|
+
var _c;
|
86
87
|
const MAX_RETRY_COUNT = 3;
|
87
88
|
const RETRY_DELAY = 500;
|
88
89
|
const ERROR_PATTERNS = {
|
@@ -166,7 +167,8 @@
|
|
166
167
|
});
|
167
168
|
if (typeof window != 'undefined') {
|
168
169
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
169
|
-
|
170
|
+
// if a custom implementation is already present, don't override it
|
171
|
+
(_b = (_c = window[registryKey]).storeAPIFactory) !== null && _b !== void 0 ? _b : (_c.storeAPIFactory = createShopApi);
|
170
172
|
}
|
171
173
|
|
172
174
|
})();
|
package/stores/shopify/index.mjs
CHANGED
@@ -79,7 +79,8 @@ const parseCookies = (cookie) => {
|
|
79
79
|
}));
|
80
80
|
};
|
81
81
|
|
82
|
-
var _a;
|
82
|
+
var _a, _b;
|
83
|
+
var _c;
|
83
84
|
const MAX_RETRY_COUNT = 3;
|
84
85
|
const RETRY_DELAY = 500;
|
85
86
|
const ERROR_PATTERNS = {
|
@@ -163,5 +164,6 @@ const createShopApi = (fetchOverride = window.fetch) => ({
|
|
163
164
|
});
|
164
165
|
if (typeof window != 'undefined') {
|
165
166
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
166
|
-
|
167
|
+
// if a custom implementation is already present, don't override it
|
168
|
+
(_b = (_c = window[registryKey]).storeAPIFactory) !== null && _b !== void 0 ? _b : (_c.storeAPIFactory = createShopApi);
|
167
169
|
}
|
package/ui.cjs.js
CHANGED
@@ -451,12 +451,14 @@ let BlotoutWallet = class BlotoutWallet extends s {
|
|
451
451
|
if (!this.lastExpiredCart) {
|
452
452
|
return;
|
453
453
|
}
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
454
|
+
if (!this.silentRestore) {
|
455
|
+
const email = this.email.value.trim().toLowerCase();
|
456
|
+
if (email) {
|
457
|
+
await this.walletAPI.saveEmail(email);
|
458
|
+
this.email.value = '';
|
459
|
+
this.hasEmail = true;
|
460
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
461
|
+
}
|
460
462
|
}
|
461
463
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
462
464
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -841,27 +843,26 @@ BlotoutWallet = __decorate([
|
|
841
843
|
t$1('blotout-wallet')
|
842
844
|
], BlotoutWallet);
|
843
845
|
|
844
|
-
var _a;
|
846
|
+
var _a, _b;
|
847
|
+
var _c;
|
845
848
|
let wallet;
|
846
849
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
847
850
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
848
851
|
// if a custom implementation is already present, don't override it
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
};
|
866
|
-
}
|
852
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
853
|
+
init(params) {
|
854
|
+
if (wallet) {
|
855
|
+
return;
|
856
|
+
}
|
857
|
+
wallet = document.createElement('blotout-wallet');
|
858
|
+
if (params.theme) {
|
859
|
+
wallet.style.cssText = Object.entries(params.theme)
|
860
|
+
.filter(([name]) => name.startsWith('--'))
|
861
|
+
.map(([name, value]) => `${name}:${value}`)
|
862
|
+
.join(';');
|
863
|
+
}
|
864
|
+
Object.assign(wallet, params);
|
865
|
+
document.body.append(wallet);
|
866
|
+
},
|
867
|
+
});
|
867
868
|
}
|
package/ui.js
CHANGED
@@ -452,12 +452,14 @@
|
|
452
452
|
if (!this.lastExpiredCart) {
|
453
453
|
return;
|
454
454
|
}
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
455
|
+
if (!this.silentRestore) {
|
456
|
+
const email = this.email.value.trim().toLowerCase();
|
457
|
+
if (email) {
|
458
|
+
await this.walletAPI.saveEmail(email);
|
459
|
+
this.email.value = '';
|
460
|
+
this.hasEmail = true;
|
461
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
462
|
+
}
|
461
463
|
}
|
462
464
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
463
465
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -842,29 +844,28 @@
|
|
842
844
|
t$1('blotout-wallet')
|
843
845
|
], BlotoutWallet);
|
844
846
|
|
845
|
-
var _a;
|
847
|
+
var _a, _b;
|
848
|
+
var _c;
|
846
849
|
let wallet;
|
847
850
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
848
851
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
849
852
|
// if a custom implementation is already present, don't override it
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
};
|
867
|
-
}
|
853
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
854
|
+
init(params) {
|
855
|
+
if (wallet) {
|
856
|
+
return;
|
857
|
+
}
|
858
|
+
wallet = document.createElement('blotout-wallet');
|
859
|
+
if (params.theme) {
|
860
|
+
wallet.style.cssText = Object.entries(params.theme)
|
861
|
+
.filter(([name]) => name.startsWith('--'))
|
862
|
+
.map(([name, value]) => `${name}:${value}`)
|
863
|
+
.join(';');
|
864
|
+
}
|
865
|
+
Object.assign(wallet, params);
|
866
|
+
document.body.append(wallet);
|
867
|
+
},
|
868
|
+
});
|
868
869
|
}
|
869
870
|
|
870
871
|
})();
|
package/ui.mjs
CHANGED
@@ -449,12 +449,14 @@ let BlotoutWallet = class BlotoutWallet extends s {
|
|
449
449
|
if (!this.lastExpiredCart) {
|
450
450
|
return;
|
451
451
|
}
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
452
|
+
if (!this.silentRestore) {
|
453
|
+
const email = this.email.value.trim().toLowerCase();
|
454
|
+
if (email) {
|
455
|
+
await this.walletAPI.saveEmail(email);
|
456
|
+
this.email.value = '';
|
457
|
+
this.hasEmail = true;
|
458
|
+
this.dispatchEvent(new CustomEvent('blotout-wallet-email-saved', { bubbles: true }));
|
459
|
+
}
|
458
460
|
}
|
459
461
|
this.restoreResponse = await this.storeAPI.addItems(this.lastExpiredCart.items, this.lastExpiredCart.token);
|
460
462
|
const expiredCartId = this.lastExpiredCart.cartId;
|
@@ -839,27 +841,26 @@ BlotoutWallet = __decorate([
|
|
839
841
|
t$1('blotout-wallet')
|
840
842
|
], BlotoutWallet);
|
841
843
|
|
842
|
-
var _a;
|
844
|
+
var _a, _b;
|
845
|
+
var _c;
|
843
846
|
let wallet;
|
844
847
|
if (typeof window != 'undefined' && typeof document != 'undefined') {
|
845
848
|
(_a = window[registryKey]) !== null && _a !== void 0 ? _a : (window[registryKey] = {});
|
846
849
|
// if a custom implementation is already present, don't override it
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
};
|
864
|
-
}
|
850
|
+
(_b = (_c = window[registryKey]).ui) !== null && _b !== void 0 ? _b : (_c.ui = {
|
851
|
+
init(params) {
|
852
|
+
if (wallet) {
|
853
|
+
return;
|
854
|
+
}
|
855
|
+
wallet = document.createElement('blotout-wallet');
|
856
|
+
if (params.theme) {
|
857
|
+
wallet.style.cssText = Object.entries(params.theme)
|
858
|
+
.filter(([name]) => name.startsWith('--'))
|
859
|
+
.map(([name, value]) => `${name}:${value}`)
|
860
|
+
.join(';');
|
861
|
+
}
|
862
|
+
Object.assign(wallet, params);
|
863
|
+
document.body.append(wallet);
|
864
|
+
},
|
865
|
+
});
|
865
866
|
}
|