@dynamic-labs-wallet/browser-wallet-client 0.0.103 → 0.0.104
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/index.cjs.js
CHANGED
|
@@ -1,48 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var core = require('@dynamic-labs-wallet/core');
|
|
3
4
|
var messageTransport = require('@dynamic-labs/message-transport');
|
|
4
5
|
var logger$1 = require('@dynamic-labs/logger');
|
|
5
|
-
var core = require('@dynamic-labs-wallet/core');
|
|
6
|
-
|
|
7
|
-
const setupMessageTransportBridge = (messageTransport$1, iframe, iframeOrigin)=>{
|
|
8
|
-
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
9
|
-
throw new Error('Iframe or contentWindow not available');
|
|
10
|
-
}
|
|
11
|
-
const logger = new logger$1.Logger('debug');
|
|
12
|
-
messageTransport$1.on((message)=>{
|
|
13
|
-
// Forward the message to webview via postMessage
|
|
14
|
-
if (message.origin === 'host') {
|
|
15
|
-
var _iframe_contentWindow;
|
|
16
|
-
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const handleIncomingMessage = (message)=>{
|
|
20
|
-
const { data } = message;
|
|
21
|
-
if (!data) return;
|
|
22
|
-
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (typeof data !== 'object') {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
const message = messageTransport.parseMessageTransportData(data);
|
|
30
|
-
messageTransport$1.emit(message);
|
|
31
|
-
} catch (error) {
|
|
32
|
-
if (!(error instanceof SyntaxError)) {
|
|
33
|
-
logger.error('Error handling incoming message:', error);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Handle incoming message from android client
|
|
39
|
-
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
40
|
-
// @ts-ignore
|
|
41
|
-
document.addEventListener('message', handleIncomingMessage);
|
|
42
|
-
/**
|
|
43
|
-
* Handle incoming message from iOS client
|
|
44
|
-
*/ window.addEventListener('message', handleIncomingMessage);
|
|
45
|
-
};
|
|
46
6
|
|
|
47
7
|
class iframeMessageHandler {
|
|
48
8
|
async getWallets(request) {
|
|
@@ -107,6 +67,9 @@ class iframeMessageHandler {
|
|
|
107
67
|
async offlineExportPrivateKey(request) {
|
|
108
68
|
return this.requestChannel.request('offlineExportPrivateKey', request);
|
|
109
69
|
}
|
|
70
|
+
async signTypedData(request) {
|
|
71
|
+
return this.requestChannel.request('signTypedData', request);
|
|
72
|
+
}
|
|
110
73
|
async cleanup() {
|
|
111
74
|
return this.requestChannel.request('cleanup');
|
|
112
75
|
}
|
|
@@ -117,6 +80,46 @@ class iframeMessageHandler {
|
|
|
117
80
|
|
|
118
81
|
const logger = new logger$1.Logger('DynamicWaasWalletClient');
|
|
119
82
|
|
|
83
|
+
const setupMessageTransportBridge = (messageTransport$1, iframe, iframeOrigin)=>{
|
|
84
|
+
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
85
|
+
throw new Error('Iframe or contentWindow not available');
|
|
86
|
+
}
|
|
87
|
+
const logger = new logger$1.Logger('debug');
|
|
88
|
+
messageTransport$1.on((message)=>{
|
|
89
|
+
// Forward the message to webview via postMessage
|
|
90
|
+
if (message.origin === 'host') {
|
|
91
|
+
var _iframe_contentWindow;
|
|
92
|
+
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
const handleIncomingMessage = (message)=>{
|
|
96
|
+
const { data } = message;
|
|
97
|
+
if (!data) return;
|
|
98
|
+
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (typeof data !== 'object') {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
try {
|
|
105
|
+
const message = messageTransport.parseMessageTransportData(data);
|
|
106
|
+
messageTransport$1.emit(message);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
if (!(error instanceof SyntaxError)) {
|
|
109
|
+
logger.error('Error handling incoming message:', error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Handle incoming message from android client
|
|
115
|
+
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
document.addEventListener('message', handleIncomingMessage);
|
|
118
|
+
/**
|
|
119
|
+
* Handle incoming message from iOS client
|
|
120
|
+
*/ window.addEventListener('message', handleIncomingMessage);
|
|
121
|
+
};
|
|
122
|
+
|
|
120
123
|
class DynamicWalletClient {
|
|
121
124
|
// Simply load the iframe from localhost
|
|
122
125
|
async initialize() {
|
|
@@ -402,6 +405,19 @@ class DynamicWalletClient {
|
|
|
402
405
|
signedSessionId
|
|
403
406
|
});
|
|
404
407
|
}
|
|
408
|
+
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId }) {
|
|
409
|
+
await this.initializeMessageTransport();
|
|
410
|
+
if (!this.iframeMessageHandler) {
|
|
411
|
+
throw new Error('Iframe message handler not initialized');
|
|
412
|
+
}
|
|
413
|
+
return this.iframeMessageHandler.signTypedData({
|
|
414
|
+
chainName: this.chainName,
|
|
415
|
+
accountAddress,
|
|
416
|
+
typedData: JSON.stringify(typedData),
|
|
417
|
+
password,
|
|
418
|
+
signedSessionId
|
|
419
|
+
});
|
|
420
|
+
}
|
|
405
421
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId }) {
|
|
406
422
|
await this.initializeMessageTransport();
|
|
407
423
|
if (!this.iframeMessageHandler) {
|
package/index.esm.js
CHANGED
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import { parseMessageTransportData, createRequestChannel, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
2
|
-
import { Logger } from '@dynamic-labs/logger';
|
|
3
1
|
import { WalletOperation, getEnvironmentFromUrl, IFRAME_DOMAIN_MAP } from '@dynamic-labs-wallet/core';
|
|
4
2
|
export { MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, ThresholdSignatureScheme, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
8
|
-
throw new Error('Iframe or contentWindow not available');
|
|
9
|
-
}
|
|
10
|
-
const logger = new Logger('debug');
|
|
11
|
-
messageTransport.on((message)=>{
|
|
12
|
-
// Forward the message to webview via postMessage
|
|
13
|
-
if (message.origin === 'host') {
|
|
14
|
-
var _iframe_contentWindow;
|
|
15
|
-
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
const handleIncomingMessage = (message)=>{
|
|
19
|
-
const { data } = message;
|
|
20
|
-
if (!data) return;
|
|
21
|
-
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (typeof data !== 'object') {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
try {
|
|
28
|
-
const message = parseMessageTransportData(data);
|
|
29
|
-
messageTransport.emit(message);
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (!(error instanceof SyntaxError)) {
|
|
32
|
-
logger.error('Error handling incoming message:', error);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Handle incoming message from android client
|
|
38
|
-
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
document.addEventListener('message', handleIncomingMessage);
|
|
41
|
-
/**
|
|
42
|
-
* Handle incoming message from iOS client
|
|
43
|
-
*/ window.addEventListener('message', handleIncomingMessage);
|
|
44
|
-
};
|
|
3
|
+
import { createRequestChannel, parseMessageTransportData, applyDefaultMessageOrigin, createMessageTransport } from '@dynamic-labs/message-transport';
|
|
4
|
+
import { Logger } from '@dynamic-labs/logger';
|
|
45
5
|
|
|
46
6
|
class iframeMessageHandler {
|
|
47
7
|
async getWallets(request) {
|
|
@@ -106,6 +66,9 @@ class iframeMessageHandler {
|
|
|
106
66
|
async offlineExportPrivateKey(request) {
|
|
107
67
|
return this.requestChannel.request('offlineExportPrivateKey', request);
|
|
108
68
|
}
|
|
69
|
+
async signTypedData(request) {
|
|
70
|
+
return this.requestChannel.request('signTypedData', request);
|
|
71
|
+
}
|
|
109
72
|
async cleanup() {
|
|
110
73
|
return this.requestChannel.request('cleanup');
|
|
111
74
|
}
|
|
@@ -116,6 +79,46 @@ class iframeMessageHandler {
|
|
|
116
79
|
|
|
117
80
|
const logger = new Logger('DynamicWaasWalletClient');
|
|
118
81
|
|
|
82
|
+
const setupMessageTransportBridge = (messageTransport, iframe, iframeOrigin)=>{
|
|
83
|
+
if (!(iframe == null ? void 0 : iframe.contentWindow)) {
|
|
84
|
+
throw new Error('Iframe or contentWindow not available');
|
|
85
|
+
}
|
|
86
|
+
const logger = new Logger('debug');
|
|
87
|
+
messageTransport.on((message)=>{
|
|
88
|
+
// Forward the message to webview via postMessage
|
|
89
|
+
if (message.origin === 'host') {
|
|
90
|
+
var _iframe_contentWindow;
|
|
91
|
+
iframe == null ? void 0 : (_iframe_contentWindow = iframe.contentWindow) == null ? void 0 : _iframe_contentWindow.postMessage(message, iframeOrigin);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const handleIncomingMessage = (message)=>{
|
|
95
|
+
const { data } = message;
|
|
96
|
+
if (!data) return;
|
|
97
|
+
if ((data == null ? void 0 : data.origin) !== 'webview') {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (typeof data !== 'object') {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
const message = parseMessageTransportData(data);
|
|
105
|
+
messageTransport.emit(message);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
if (!(error instanceof SyntaxError)) {
|
|
108
|
+
logger.error('Error handling incoming message:', error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Handle incoming message from android client
|
|
114
|
+
*/ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
document.addEventListener('message', handleIncomingMessage);
|
|
117
|
+
/**
|
|
118
|
+
* Handle incoming message from iOS client
|
|
119
|
+
*/ window.addEventListener('message', handleIncomingMessage);
|
|
120
|
+
};
|
|
121
|
+
|
|
119
122
|
class DynamicWalletClient {
|
|
120
123
|
// Simply load the iframe from localhost
|
|
121
124
|
async initialize() {
|
|
@@ -401,6 +404,19 @@ class DynamicWalletClient {
|
|
|
401
404
|
signedSessionId
|
|
402
405
|
});
|
|
403
406
|
}
|
|
407
|
+
async signTypedData({ accountAddress, typedData, password = undefined, signedSessionId }) {
|
|
408
|
+
await this.initializeMessageTransport();
|
|
409
|
+
if (!this.iframeMessageHandler) {
|
|
410
|
+
throw new Error('Iframe message handler not initialized');
|
|
411
|
+
}
|
|
412
|
+
return this.iframeMessageHandler.signTypedData({
|
|
413
|
+
chainName: this.chainName,
|
|
414
|
+
accountAddress,
|
|
415
|
+
typedData: JSON.stringify(typedData),
|
|
416
|
+
password,
|
|
417
|
+
signedSessionId
|
|
418
|
+
});
|
|
419
|
+
}
|
|
404
420
|
async backupKeySharesToGoogleDrive({ accountAddress, password = undefined, signedSessionId }) {
|
|
405
421
|
await this.initializeMessageTransport();
|
|
406
422
|
if (!this.iframeMessageHandler) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/browser-wallet-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.104",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@dynamic-labs-wallet/core": "0.0.
|
|
6
|
+
"@dynamic-labs-wallet/core": "0.0.104",
|
|
7
7
|
"@dynamic-labs/message-transport": "^4.9.9",
|
|
8
8
|
"@dynamic-labs/logger": "^4.9.9"
|
|
9
9
|
},
|
package/src/client/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, ExportClientKeysharesRequest, GetWalletResponse, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, SignMessageRequest, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest } from '@dynamic-labs-wallet/core';
|
|
2
|
+
import { WalletOperation } from '@dynamic-labs-wallet/core';
|
|
1
3
|
import { type MessageTransportWithDefaultOrigin } from '@dynamic-labs/message-transport';
|
|
2
4
|
import { iframeMessageHandler } from '../services/iframeMessageHandler';
|
|
3
|
-
import type { GetWalletResponse, CreateWalletAccountResponse, RequiresPasswordForOperationRequest, SignMessageRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, CreateWalletAccountRequest, SignTransactionRequest, RefreshWalletAccountSharesRequest, ReshareRequest } from '@dynamic-labs-wallet/core';
|
|
4
|
-
import { WalletOperation } from '@dynamic-labs-wallet/core';
|
|
5
5
|
export declare class DynamicWalletClient {
|
|
6
6
|
protected chainName: string;
|
|
7
7
|
protected logger: import("@dynamic-labs/logger").Logger;
|
|
@@ -91,6 +91,7 @@ export declare class DynamicWalletClient {
|
|
|
91
91
|
* const txString = Buffer.from(txBytes).toString("hex");
|
|
92
92
|
*/
|
|
93
93
|
signTransaction({ senderAddress, transaction, password, signedSessionId, }: Omit<SignTransactionRequest, 'chainName'>): Promise<string>;
|
|
94
|
+
signTypedData({ accountAddress, typedData, password, signedSessionId, }: Omit<SignTypedDataRequest, 'chainName'>): Promise<string>;
|
|
94
95
|
backupKeySharesToGoogleDrive({ accountAddress, password, signedSessionId, }: Omit<BackupKeySharesToGoogleDriveRequest, 'chainName'>): Promise<void>;
|
|
95
96
|
restoreBackupFromGoogleDrive({ accountAddress, displayContainer, password, signedSessionId, }: {
|
|
96
97
|
accountAddress: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,EAC/B,iCAAiC,EACjC,mCAAmC,EACnC,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAIxE,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,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,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAerD,gBAAgB,CAAC,EACrB,UAAU,EACV,wBAAwB,EACxB,eAAe,GAChB,EAAE,IAAI,CACL,uBAAuB,EACvB,WAAW,CACZ,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAclC,qBAAqB,CAAC,EAC1B,cAAc,EACd,QAAQ,EACR,eAAe,GAChB,EAAE,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAclE;;OAEG;IACG,uBAAuB,CAAC,EAC5B,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAqB/B,OAAO;CAqBrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { BackupKeySharesToGoogleDriveRequest, CreateWalletAccountRequest, CreateWalletAccountResponse, ExportClientKeysharesRequest, ExportPrivateKeyRequest, GetWalletResponse, GetWalletsRequest, IframeRequestMessages, ImportPrivateKeyRequest, IsPasswordEncryptedRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, RefreshWalletAccountSharesRequest, RequiresPasswordForOperationRequest, ReshareRequest, RestoreBackupFromGoogleDriveRequest, SignMessageRequest, SignRawMessageRequest, SignTransactionRequest, SignTypedDataRequest, UpdatePasswordRequest, VerifyPasswordRequest, WalletOperation } from '@dynamic-labs-wallet/core';
|
|
1
2
|
import { type MessageTransportWithDefaultOrigin, type RequestChannel } from '@dynamic-labs/message-transport';
|
|
2
|
-
import type { IframeRequestMessages, WalletOperation, GetWalletResponse, CreateWalletAccountResponse, SignMessageRequest, RequiresPasswordForOperationRequest, SignTransactionRequest, IsPasswordEncryptedRequest, BackupKeySharesToGoogleDriveRequest, RestoreBackupFromGoogleDriveRequest, RefreshWalletAccountSharesRequest, ReshareRequest, ExportPrivateKeyRequest, VerifyPasswordRequest, UpdatePasswordRequest, ImportPrivateKeyRequest, ExportClientKeysharesRequest, OfflineExportPrivateKeyRequest, OfflineExportPrivateKeyResponse, SignRawMessageRequest, GetWalletsRequest, CreateWalletAccountRequest } from '@dynamic-labs-wallet/core';
|
|
3
3
|
export declare class iframeMessageHandler {
|
|
4
4
|
requestChannel: RequestChannel<IframeRequestMessages>;
|
|
5
5
|
constructor(messageTransport: MessageTransportWithDefaultOrigin);
|
|
@@ -27,6 +27,7 @@ export declare class iframeMessageHandler {
|
|
|
27
27
|
sendAuthToken(token: string): Promise<void>;
|
|
28
28
|
exportClientKeyshares(request: ExportClientKeysharesRequest): Promise<void>;
|
|
29
29
|
offlineExportPrivateKey(request: OfflineExportPrivateKeyRequest): Promise<OfflineExportPrivateKeyResponse>;
|
|
30
|
+
signTypedData(request: SignTypedDataRequest): Promise<string>;
|
|
30
31
|
cleanup(): Promise<void>;
|
|
31
32
|
}
|
|
32
33
|
//# sourceMappingURL=iframeMessageHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"iframeMessageHandler.d.ts","sourceRoot":"","sources":["../../src/services/iframeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,EACjC,mCAAmC,EACnC,cAAc,EACd,mCAAmC,EACnC,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe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