@myop/react-native 0.0.4 → 0.0.6
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/README.md +148 -16
- package/dist/MyopComponent.d.ts +41 -2
- package/dist/MyopComponent.d.ts.map +1 -1
- package/dist/MyopComponent.js +230 -98
- package/dist/MyopComponent.js.map +1 -1
- package/dist/componentHost.html.d.ts +1 -1
- package/dist/componentHost.html.d.ts.map +1 -1
- package/dist/componentHost.html.js +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/MyopComponent.js
CHANGED
|
@@ -38,13 +38,72 @@ const react_1 = __importStar(require("react"));
|
|
|
38
38
|
const react_native_1 = require("react-native");
|
|
39
39
|
const react_native_webview_1 = require("react-native-webview");
|
|
40
40
|
const componentHost_html_js_1 = require("./componentHost.html.js");
|
|
41
|
-
const
|
|
41
|
+
const getHtml = (zoomEnabled, selectionEnabled) => {
|
|
42
|
+
let html = componentHost_html_js_1.HTML;
|
|
43
|
+
// Disable zoom
|
|
44
|
+
if (!zoomEnabled) {
|
|
45
|
+
html = html.replace('width=device-width, initial-scale=1.0', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no');
|
|
46
|
+
}
|
|
47
|
+
// Disable text selection for native feel
|
|
48
|
+
if (!selectionEnabled) {
|
|
49
|
+
const noSelectCSS = `
|
|
50
|
+
*, *::before, *::after {
|
|
51
|
+
-webkit-user-select: none !important;
|
|
52
|
+
-webkit-touch-callout: none !important;
|
|
53
|
+
-webkit-tap-highlight-color: transparent !important;
|
|
54
|
+
user-select: none !important;
|
|
55
|
+
}
|
|
56
|
+
input, textarea, [contenteditable="true"] {
|
|
57
|
+
-webkit-user-select: auto !important;
|
|
58
|
+
user-select: auto !important;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
html = html.replace('</style>', noSelectCSS + '</style>');
|
|
62
|
+
// Also inject into iframes via script
|
|
63
|
+
html = html.replace('</body>', `<script>
|
|
64
|
+
(function() {
|
|
65
|
+
const css = \`${noSelectCSS}\`;
|
|
66
|
+
function injectStyle(doc) {
|
|
67
|
+
try {
|
|
68
|
+
const style = doc.createElement('style');
|
|
69
|
+
style.textContent = css;
|
|
70
|
+
doc.head.appendChild(style);
|
|
71
|
+
} catch(e) {}
|
|
72
|
+
}
|
|
73
|
+
// Inject into any iframe that loads
|
|
74
|
+
const observer = new MutationObserver(function(mutations) {
|
|
75
|
+
document.querySelectorAll('iframe').forEach(function(iframe) {
|
|
76
|
+
try {
|
|
77
|
+
if (iframe.contentDocument && !iframe.contentDocument.__noSelectInjected) {
|
|
78
|
+
iframe.contentDocument.__noSelectInjected = true;
|
|
79
|
+
injectStyle(iframe.contentDocument);
|
|
80
|
+
// Also observe iframe for nested iframes
|
|
81
|
+
iframe.contentWindow.addEventListener('load', function() {
|
|
82
|
+
injectStyle(iframe.contentDocument);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
} catch(e) {}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
89
|
+
})();
|
|
90
|
+
</script></body>`);
|
|
91
|
+
}
|
|
92
|
+
return html;
|
|
93
|
+
};
|
|
42
94
|
const MyopFallback_1 = require("./MyopFallback");
|
|
95
|
+
const index_1 = require("./index");
|
|
43
96
|
const MyopComponent = (props) => {
|
|
44
|
-
var _a, _b;
|
|
97
|
+
var _a, _b, _c, _d, _e;
|
|
45
98
|
const webviewRef = (0, react_1.useRef)(null);
|
|
46
99
|
const loaderRef = (0, react_1.useRef)(null);
|
|
47
|
-
const
|
|
100
|
+
const isCancelled = (0, react_1.useRef)(false);
|
|
101
|
+
const pendingGetRequests = (0, react_1.useRef)(new Map());
|
|
102
|
+
// Don't show loader if component is already preloaded/cached
|
|
103
|
+
const componentIsPreloaded = props.componentId
|
|
104
|
+
? (0, index_1.isPreloaded)(props.componentId, props.environment, props.preview)
|
|
105
|
+
: false;
|
|
106
|
+
const [showLoader, setShowLoader] = (0, react_1.useState)(!componentIsPreloaded);
|
|
48
107
|
const [showFallback, setShowFallback] = (0, react_1.useState)(false);
|
|
49
108
|
const [isComponentLoaded, setIsComponentLoaded] = (0, react_1.useState)(false);
|
|
50
109
|
const fadeDuration = (_a = props.fadeDuration) !== null && _a !== void 0 ? _a : 200;
|
|
@@ -54,8 +113,8 @@ const MyopComponent = (props) => {
|
|
|
54
113
|
return;
|
|
55
114
|
const encoded = encodeURIComponent(JSON.stringify(data));
|
|
56
115
|
webviewRef.current.injectJavaScript(`
|
|
57
|
-
if (window.myopComponent
|
|
58
|
-
window.myopComponent.
|
|
116
|
+
if (window.myopComponent) {
|
|
117
|
+
window.myopComponent.props.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
|
|
59
118
|
}
|
|
60
119
|
true;
|
|
61
120
|
`);
|
|
@@ -78,12 +137,127 @@ const MyopComponent = (props) => {
|
|
|
78
137
|
setShowLoader(false);
|
|
79
138
|
}
|
|
80
139
|
}, [fadeDuration]);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
140
|
+
// Create proxy object for window.myopComponent
|
|
141
|
+
const createMyopComponentProxy = (0, react_1.useCallback)((componentId) => {
|
|
142
|
+
const injectJS = (js) => {
|
|
143
|
+
var _a;
|
|
144
|
+
(_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`${js}; true;`);
|
|
145
|
+
};
|
|
146
|
+
// Generate unique request ID for async get operations
|
|
147
|
+
const generateRequestId = () => `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
148
|
+
// Element proxy for DOM manipulation
|
|
149
|
+
const elementProxy = {
|
|
150
|
+
set: (path, value) => {
|
|
151
|
+
const encoded = encodeURIComponent(JSON.stringify(value));
|
|
152
|
+
injectJS(`
|
|
153
|
+
if (window.myopComponent && window.myopComponent.element) {
|
|
154
|
+
const parts = '${path}'.split('.');
|
|
155
|
+
let target = window.myopComponent.element;
|
|
156
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
157
|
+
target = target[parts[i]];
|
|
158
|
+
}
|
|
159
|
+
target[parts[parts.length - 1]] = JSON.parse(decodeURIComponent('${encoded}'));
|
|
160
|
+
}
|
|
161
|
+
`);
|
|
162
|
+
},
|
|
163
|
+
get: (path) => {
|
|
164
|
+
return new Promise((resolve) => {
|
|
165
|
+
const requestId = generateRequestId();
|
|
166
|
+
pendingGetRequests.current.set(requestId, resolve);
|
|
167
|
+
injectJS(`
|
|
168
|
+
if (window.myopComponent && window.myopComponent.element) {
|
|
169
|
+
const parts = '${path}'.split('.');
|
|
170
|
+
let value = window.myopComponent.element;
|
|
171
|
+
for (const part of parts) {
|
|
172
|
+
value = value[part];
|
|
173
|
+
}
|
|
174
|
+
window.ReactNativeWebView.postMessage('GET_RESULT:' + JSON.stringify({
|
|
175
|
+
requestId: '${requestId}',
|
|
176
|
+
value: value
|
|
177
|
+
}));
|
|
178
|
+
} else {
|
|
179
|
+
window.ReactNativeWebView.postMessage('GET_RESULT:' + JSON.stringify({
|
|
180
|
+
requestId: '${requestId}',
|
|
181
|
+
value: undefined
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
`);
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
style: {
|
|
188
|
+
set: (property, value) => {
|
|
189
|
+
injectJS(`
|
|
190
|
+
if (window.myopComponent && window.myopComponent.element) {
|
|
191
|
+
window.myopComponent.element.style['${property}'] = '${value}';
|
|
192
|
+
}
|
|
193
|
+
`);
|
|
194
|
+
},
|
|
195
|
+
get: (property) => {
|
|
196
|
+
return new Promise((resolve) => {
|
|
197
|
+
const requestId = generateRequestId();
|
|
198
|
+
pendingGetRequests.current.set(requestId, resolve);
|
|
199
|
+
injectJS(`
|
|
200
|
+
if (window.myopComponent && window.myopComponent.element) {
|
|
201
|
+
const value = window.myopComponent.element.style['${property}'];
|
|
202
|
+
window.ReactNativeWebView.postMessage('GET_RESULT:' + JSON.stringify({
|
|
203
|
+
requestId: '${requestId}',
|
|
204
|
+
value: value
|
|
205
|
+
}));
|
|
206
|
+
} else {
|
|
207
|
+
window.ReactNativeWebView.postMessage('GET_RESULT:' + JSON.stringify({
|
|
208
|
+
requestId: '${requestId}',
|
|
209
|
+
value: undefined
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
`);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
return {
|
|
218
|
+
id: componentId,
|
|
219
|
+
props: {
|
|
220
|
+
myop_init_interface: (data) => {
|
|
221
|
+
const encoded = encodeURIComponent(JSON.stringify(data));
|
|
222
|
+
injectJS(`
|
|
223
|
+
if (window.myopComponent && window.myopComponent.props.myop_init_interface) {
|
|
224
|
+
window.myopComponent.props.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
|
|
225
|
+
}
|
|
226
|
+
`);
|
|
227
|
+
},
|
|
228
|
+
myop_cta_handler: null // CTA is handled via message passing (props.on)
|
|
229
|
+
},
|
|
230
|
+
element: elementProxy,
|
|
231
|
+
dispose: () => {
|
|
232
|
+
injectJS(`
|
|
233
|
+
if (window.myopComponent && window.myopComponent.dispose) {
|
|
234
|
+
window.myopComponent.dispose();
|
|
235
|
+
}
|
|
236
|
+
`);
|
|
237
|
+
},
|
|
238
|
+
hide: () => {
|
|
239
|
+
injectJS(`
|
|
240
|
+
if (window.myopComponent && window.myopComponent.hide) {
|
|
241
|
+
window.myopComponent.hide();
|
|
242
|
+
}
|
|
243
|
+
`);
|
|
244
|
+
},
|
|
245
|
+
show: () => {
|
|
246
|
+
injectJS(`
|
|
247
|
+
if (window.myopComponent && window.myopComponent.show) {
|
|
248
|
+
window.myopComponent.show();
|
|
249
|
+
}
|
|
250
|
+
`);
|
|
251
|
+
},
|
|
252
|
+
inspect: () => {
|
|
253
|
+
injectJS(`
|
|
254
|
+
if (window.myopComponent && window.myopComponent.inspect) {
|
|
255
|
+
window.myopComponent.inspect();
|
|
256
|
+
}
|
|
257
|
+
`);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
}, []);
|
|
87
261
|
const handleError = (0, react_1.useCallback)((errorMsg) => {
|
|
88
262
|
console.error('[MyopComponent] Error:', errorMsg);
|
|
89
263
|
hideLoader();
|
|
@@ -93,101 +267,42 @@ const MyopComponent = (props) => {
|
|
|
93
267
|
}
|
|
94
268
|
}, [hideLoader, props.onError]);
|
|
95
269
|
const loadComponent = (0, react_1.useCallback)(async () => {
|
|
96
|
-
var _a
|
|
270
|
+
var _a;
|
|
271
|
+
isCancelled.current = false;
|
|
97
272
|
try {
|
|
98
273
|
let componentConfig = null;
|
|
99
274
|
if (props.componentConfig) {
|
|
100
275
|
componentConfig = props.componentConfig;
|
|
101
276
|
}
|
|
102
277
|
else if (props.componentId) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
handleError(`Component "${props.componentId}" not found`);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
componentConfig = json.item.components[0];
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// V2 mode (default): use consume endpoint
|
|
115
|
-
const env = props.environment || 'production';
|
|
116
|
-
let consumeUrl = `https://cloud.myop.dev/consume?id=${props.componentId}&env=${env}`;
|
|
117
|
-
if (props.preview) {
|
|
118
|
-
consumeUrl += '&preview=true';
|
|
119
|
-
}
|
|
120
|
-
const res = await fetch(consumeUrl);
|
|
121
|
-
const config = await res.json();
|
|
122
|
-
const variant = config.item;
|
|
123
|
-
if (!variant) {
|
|
124
|
-
handleError(`Component "${props.componentId}" not found`);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (!variant.consume_variant || !variant.consume_variant.length) {
|
|
128
|
-
handleError(`Component "${props.componentId}" has no implementation for environment "${env}"`);
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
// Build V2 component config
|
|
132
|
-
componentConfig = {
|
|
133
|
-
instance: {
|
|
134
|
-
id: 'auto',
|
|
135
|
-
componentId: variant.componentId,
|
|
136
|
-
componentName: variant.name,
|
|
137
|
-
skinSelector: {
|
|
138
|
-
type: 'Dedicated',
|
|
139
|
-
skin: { id: 'skin_auto_v2_converted' }
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
type: {
|
|
143
|
-
id: variant.id,
|
|
144
|
-
name: variant.name,
|
|
145
|
-
description: variant.description,
|
|
146
|
-
props: [
|
|
147
|
-
{
|
|
148
|
-
id: 'in_auto_v2_converted',
|
|
149
|
-
name: 'myop_init_interface',
|
|
150
|
-
type: 'any',
|
|
151
|
-
behavior: { type: 'code' }
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
id: 'out_auto_v2_converted',
|
|
155
|
-
name: 'myop_cta_handler',
|
|
156
|
-
type: 'any',
|
|
157
|
-
behavior: { type: 'code' }
|
|
158
|
-
}
|
|
159
|
-
],
|
|
160
|
-
refs: [],
|
|
161
|
-
skins: [{
|
|
162
|
-
id: 'skin_auto_v2_converted',
|
|
163
|
-
name: 'auto_v2_converted',
|
|
164
|
-
description: '',
|
|
165
|
-
loader: variant.consume_variant[0].loader
|
|
166
|
-
}],
|
|
167
|
-
defaultSkin: 0
|
|
168
|
-
},
|
|
169
|
-
name: variant.name
|
|
170
|
-
};
|
|
278
|
+
const env = props.environment || (0, index_1.getCloudRepository)().getDefaultEnvironment();
|
|
279
|
+
componentConfig = await (0, index_1.getCloudRepository)().fetchComponentV2(props.componentId, env, props.preview);
|
|
280
|
+
if (!componentConfig) {
|
|
281
|
+
handleError(`Component "${props.componentId}" not found`);
|
|
282
|
+
return;
|
|
171
283
|
}
|
|
172
284
|
}
|
|
173
285
|
if (!componentConfig) {
|
|
174
286
|
handleError('No component configuration provided');
|
|
175
287
|
return;
|
|
176
288
|
}
|
|
289
|
+
if (isCancelled.current)
|
|
290
|
+
return;
|
|
177
291
|
const encoded = encodeURIComponent(JSON.stringify(componentConfig));
|
|
178
|
-
(
|
|
292
|
+
(_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
|
|
179
293
|
loadMyopComponent(\`${encoded}\`);
|
|
180
|
-
true;
|
|
181
294
|
`);
|
|
182
295
|
}
|
|
183
296
|
catch (err) {
|
|
184
|
-
|
|
297
|
+
if (!isCancelled.current) {
|
|
298
|
+
handleError((err === null || err === void 0 ? void 0 : err.message) || 'Unknown error');
|
|
299
|
+
}
|
|
185
300
|
}
|
|
186
|
-
}, [props.componentConfig, props.componentId, props.
|
|
301
|
+
}, [props.componentConfig, props.componentId, props.environment, props.preview, handleError]);
|
|
187
302
|
const onMessage = (0, react_1.useCallback)((event) => {
|
|
188
|
-
var _a, _b, _c, _d;
|
|
303
|
+
var _a, _b, _c, _d, _e;
|
|
189
304
|
const message = event.nativeEvent.data;
|
|
190
|
-
console.log('[MyopComponent] Message from WebView:', message);
|
|
305
|
+
//console.log('[MyopComponent] Message from WebView:', message);
|
|
191
306
|
if (message === 'WEBVIEW_READY') {
|
|
192
307
|
// WebView is ready, now inject the component loading code
|
|
193
308
|
loadComponent();
|
|
@@ -199,14 +314,13 @@ const MyopComponent = (props) => {
|
|
|
199
314
|
if (props.data !== undefined) {
|
|
200
315
|
const encoded = encodeURIComponent(JSON.stringify(props.data));
|
|
201
316
|
(_a = webviewRef.current) === null || _a === void 0 ? void 0 : _a.injectJavaScript(`
|
|
202
|
-
if (window.myopComponent
|
|
203
|
-
window.myopComponent.
|
|
317
|
+
if (window.myopComponent) {
|
|
318
|
+
window.myopComponent.props.myop_init_interface(JSON.parse(decodeURIComponent('${encoded}')));
|
|
204
319
|
}
|
|
205
|
-
true;
|
|
206
320
|
`);
|
|
207
321
|
}
|
|
208
322
|
if (props.onLoad) {
|
|
209
|
-
props.onLoad(
|
|
323
|
+
props.onLoad(createMyopComponentProxy(props.componentId || 'unknown'));
|
|
210
324
|
}
|
|
211
325
|
}
|
|
212
326
|
else if (((_b = message === null || message === void 0 ? void 0 : message.startsWith) === null || _b === void 0 ? void 0 : _b.call(message, 'COMPONENT_ERROR:')) || ((_c = message === null || message === void 0 ? void 0 : message.startsWith) === null || _c === void 0 ? void 0 : _c.call(message, 'SDK_INIT_ERROR:'))) {
|
|
@@ -230,15 +344,33 @@ const MyopComponent = (props) => {
|
|
|
230
344
|
console.error('[MyopComponent] Failed to parse CTA message:', e);
|
|
231
345
|
}
|
|
232
346
|
}
|
|
233
|
-
|
|
347
|
+
else if ((_e = message === null || message === void 0 ? void 0 : message.startsWith) === null || _e === void 0 ? void 0 : _e.call(message, 'GET_RESULT:')) {
|
|
348
|
+
// Handle element.get() responses
|
|
349
|
+
try {
|
|
350
|
+
const result = JSON.parse(message.substring(11));
|
|
351
|
+
const resolver = pendingGetRequests.current.get(result.requestId);
|
|
352
|
+
if (resolver) {
|
|
353
|
+
resolver(result.value);
|
|
354
|
+
pendingGetRequests.current.delete(result.requestId);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
catch (e) {
|
|
358
|
+
console.error('[MyopComponent] Failed to parse GET_RESULT message:', e);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}, [loadComponent, props.onLoad, props.onError, props.on, hideLoader, createMyopComponentProxy]);
|
|
362
|
+
// Cleanup on unmount
|
|
363
|
+
(0, react_1.useEffect)(() => {
|
|
364
|
+
return () => {
|
|
365
|
+
isCancelled.current = true;
|
|
366
|
+
};
|
|
367
|
+
}, []);
|
|
234
368
|
return (react_1.default.createElement(react_native_1.View, { style: props.style ? props.style : styles.root },
|
|
235
|
-
react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html:
|
|
236
|
-
showLoader && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, props.loader
|
|
237
|
-
? (
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
: react_1.default.createElement(MyopLoader_1.MyopLoader, { ref: loaderRef }))),
|
|
241
|
-
showFallback && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, (_b = props.fallback) !== null && _b !== void 0 ? _b : react_1.default.createElement(MyopFallback_1.MyopFallback, null)))));
|
|
369
|
+
react_1.default.createElement(react_native_webview_1.WebView, { ref: webviewRef, originWhitelist: ['*'], source: { html: getHtml((_b = props.zoomEnabled) !== null && _b !== void 0 ? _b : false, (_c = props.selectionEnabled) !== null && _c !== void 0 ? _c : false) }, onMessage: onMessage, style: styles.webview, javaScriptEnabled: true, domStorageEnabled: true, mixedContentMode: "always", allowFileAccess: true, allowUniversalAccessFromFileURLs: true, overScrollMode: "never", scrollEnabled: (_d = props.scrollEnabled) !== null && _d !== void 0 ? _d : false }),
|
|
370
|
+
showLoader && props.loader !== undefined && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, (0, react_1.isValidElement)(props.loader)
|
|
371
|
+
? (0, react_1.cloneElement)(props.loader, { ref: loaderRef })
|
|
372
|
+
: props.loader)),
|
|
373
|
+
showFallback && (react_1.default.createElement(react_native_1.View, { style: styles.loaderContainer }, (_e = props.fallback) !== null && _e !== void 0 ? _e : react_1.default.createElement(MyopFallback_1.MyopFallback, null)))));
|
|
242
374
|
};
|
|
243
375
|
exports.MyopComponent = MyopComponent;
|
|
244
376
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+G;AAC/G,+CAA8C;AAC9C,+DAA6C;AAG7C,mEAA6C;
|
|
1
|
+
{"version":3,"file":"MyopComponent.js","sourceRoot":"","sources":["../src/MyopComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+G;AAC/G,+CAA8C;AAC9C,+DAA6C;AAG7C,mEA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