appium-uiautomator2-driver 6.7.4 → 6.7.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/CHANGELOG.md +12 -0
- package/build/lib/commands/element.d.ts +35 -69
- package/build/lib/commands/element.d.ts.map +1 -1
- package/build/lib/commands/element.js +35 -84
- package/build/lib/commands/element.js.map +1 -1
- package/build/lib/commands/gestures.d.ts +24 -189
- package/build/lib/commands/gestures.d.ts.map +1 -1
- package/build/lib/commands/gestures.js +14 -204
- package/build/lib/commands/gestures.js.map +1 -1
- package/build/lib/commands/misc.d.ts +15 -35
- package/build/lib/commands/misc.d.ts.map +1 -1
- package/build/lib/commands/misc.js +11 -30
- package/build/lib/commands/misc.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/lib/commands/element.ts +151 -0
- package/lib/commands/gestures.ts +234 -0
- package/lib/commands/misc.ts +63 -0
- package/npm-shrinkwrap.json +17 -47
- package/package.json +2 -2
- package/lib/commands/element.js +0 -261
- package/lib/commands/gestures.js +0 -446
- package/lib/commands/misc.js +0 -109
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [6.7.6](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.5...v6.7.6) (2025-12-23)
|
|
2
|
+
|
|
3
|
+
### Miscellaneous Chores
|
|
4
|
+
|
|
5
|
+
* Migrate various command modules to typescript (part 2) ([#970](https://github.com/appium/appium-uiautomator2-driver/issues/970)) ([976d79d](https://github.com/appium/appium-uiautomator2-driver/commit/976d79dcb122f5ba28128d16c7b90a5d37dc868f))
|
|
6
|
+
|
|
7
|
+
## [6.7.5](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.4...v6.7.5) (2025-12-22)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **deps:** bump teen_process from 3.0.6 to 4.0.4 ([#969](https://github.com/appium/appium-uiautomator2-driver/issues/969)) ([ff5d39f](https://github.com/appium/appium-uiautomator2-driver/commit/ff5d39f24bba4295729e5ff3a1ed114dd6a349c0))
|
|
12
|
+
|
|
1
13
|
## [6.7.4](https://github.com/appium/appium-uiautomator2-driver/compare/v6.7.3...v6.7.4) (2025-12-22)
|
|
2
14
|
|
|
3
15
|
### Miscellaneous Chores
|
|
@@ -1,102 +1,68 @@
|
|
|
1
|
+
import type { DoSetElementValueOpts } from 'appium-android-driver';
|
|
2
|
+
import type { Element as AppiumElement, Position, Rect, Size } from '@appium/types';
|
|
3
|
+
import type { AndroidUiautomator2Driver } from '../driver';
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @returns {Promise<import('@appium/types').Element>}
|
|
5
|
+
* Gets the currently active element.
|
|
4
6
|
*/
|
|
5
|
-
export function active(this:
|
|
7
|
+
export declare function active(this: AndroidUiautomator2Driver): Promise<AppiumElement>;
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {string} attribute
|
|
9
|
-
* @param {string} elementId
|
|
10
|
-
* @returns {Promise<string?>}
|
|
9
|
+
* Gets an element attribute value.
|
|
11
10
|
*/
|
|
12
|
-
export function getAttribute(this:
|
|
11
|
+
export declare function getAttribute(this: AndroidUiautomator2Driver, attribute: string, elementId: string): Promise<string>;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @param {string} elementId
|
|
16
|
-
* @returns {Promise<boolean>}
|
|
13
|
+
* Returns whether the element is displayed.
|
|
17
14
|
*/
|
|
18
|
-
export function elementDisplayed(this:
|
|
15
|
+
export declare function elementDisplayed(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
|
|
19
16
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param {string} elementId
|
|
22
|
-
* @returns {Promise<boolean>}
|
|
17
|
+
* Returns whether the element is enabled.
|
|
23
18
|
*/
|
|
24
|
-
export function elementEnabled(this:
|
|
19
|
+
export declare function elementEnabled(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
|
|
25
20
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {string} elementId
|
|
28
|
-
* @returns {Promise<boolean>}
|
|
21
|
+
* Returns whether the element is selected.
|
|
29
22
|
*/
|
|
30
|
-
export function elementSelected(this:
|
|
23
|
+
export declare function elementSelected(this: AndroidUiautomator2Driver, elementId: string): Promise<boolean>;
|
|
31
24
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @param {string} elementId
|
|
34
|
-
* @returns {Promise<string>}
|
|
25
|
+
* Gets the element tag name.
|
|
35
26
|
*/
|
|
36
|
-
export function getName(this:
|
|
27
|
+
export declare function getName(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
|
|
37
28
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param {string} elementId
|
|
40
|
-
* @returns {Promise<import('@appium/types').Position>}
|
|
29
|
+
* Gets the element location.
|
|
41
30
|
*/
|
|
42
|
-
export function getLocation(this:
|
|
31
|
+
export declare function getLocation(this: AndroidUiautomator2Driver, elementId: string): Promise<Position>;
|
|
43
32
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param {string} elementId
|
|
46
|
-
* @returns {Promise<import('@appium/types').Size>}
|
|
33
|
+
* Gets the element size.
|
|
47
34
|
*/
|
|
48
|
-
export function getSize(this:
|
|
35
|
+
export declare function getSize(this: AndroidUiautomator2Driver, elementId: string): Promise<Size>;
|
|
49
36
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {import('appium-android-driver').DoSetElementValueOpts} params
|
|
52
|
-
* @returns {Promise<void>}
|
|
37
|
+
* Sets the value of an element using the upstream driver API.
|
|
53
38
|
*/
|
|
54
|
-
export function doSetElementValue(this:
|
|
39
|
+
export declare function doSetElementValue(this: AndroidUiautomator2Driver, params: DoSetElementValueOpts): Promise<void>;
|
|
55
40
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param {string|string[]} keys
|
|
58
|
-
* @param {string} elementId
|
|
59
|
-
* @returns {Promise<void>}
|
|
41
|
+
* Sends text to an element without replacement.
|
|
60
42
|
*/
|
|
61
|
-
export function setValueImmediate(this:
|
|
43
|
+
export declare function setValueImmediate(this: AndroidUiautomator2Driver, keys: string | string[], elementId: string): Promise<void>;
|
|
62
44
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param {string} elementId
|
|
65
|
-
* @returns {Promise<string>}
|
|
45
|
+
* Gets the element text.
|
|
66
46
|
*/
|
|
67
|
-
export function getText(this:
|
|
47
|
+
export declare function getText(this: AndroidUiautomator2Driver, elementId: string): Promise<string>;
|
|
68
48
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @param {string} element
|
|
71
|
-
* @returns {Promise<void>}
|
|
49
|
+
* Clicks the given element.
|
|
72
50
|
*/
|
|
73
|
-
export function click(this:
|
|
51
|
+
export declare function click(this: AndroidUiautomator2Driver, element: string): Promise<void>;
|
|
74
52
|
/**
|
|
75
|
-
*
|
|
76
|
-
* @param {string} element
|
|
77
|
-
* @returns {Promise<string>}
|
|
53
|
+
* Takes a screenshot of the element.
|
|
78
54
|
*/
|
|
79
|
-
export function getElementScreenshot(this:
|
|
55
|
+
export declare function getElementScreenshot(this: AndroidUiautomator2Driver, element: string): Promise<string>;
|
|
80
56
|
/**
|
|
81
|
-
*
|
|
82
|
-
* @param {string} elementId
|
|
83
|
-
* @returns {Promise<void>}
|
|
57
|
+
* Clears the element text.
|
|
84
58
|
*/
|
|
85
|
-
export function clear(this:
|
|
59
|
+
export declare function clear(this: AndroidUiautomator2Driver, elementId: string): Promise<void>;
|
|
86
60
|
/**
|
|
87
|
-
*
|
|
88
|
-
* @param {string} elementId
|
|
89
|
-
* @returns {Promise<import('@appium/types').Rect>}
|
|
61
|
+
* Gets the element rectangle.
|
|
90
62
|
*/
|
|
91
|
-
export function getElementRect(this:
|
|
63
|
+
export declare function getElementRect(this: AndroidUiautomator2Driver, elementId: string): Promise<Rect>;
|
|
92
64
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @this {AndroidUiautomator2Driver}
|
|
95
|
-
* @param {string} elementId The id of the element whose content will be replaced.
|
|
96
|
-
* @param {string} text The actual text to set.
|
|
97
|
-
* @throws {Error} If there was a faulre while setting the text
|
|
98
|
-
* @returns {Promise<void>}
|
|
65
|
+
* Replaces the element text.
|
|
99
66
|
*/
|
|
100
|
-
export function mobileReplaceElementValue(this:
|
|
101
|
-
export type AndroidUiautomator2Driver = import("../driver").AndroidUiautomator2Driver;
|
|
67
|
+
export declare function mobileReplaceElementValue(this: AndroidUiautomator2Driver, elementId: string, text: string): Promise<void>;
|
|
102
68
|
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../lib/commands/element.
|
|
1
|
+
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAC,OAAO,IAAI,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,WAAW,CAAC;AAGzD;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC,CAEpF;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzH;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3G;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEzG;AAED;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AE7F;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CActG;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,yBAAyB,EAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -19,86 +19,65 @@ exports.getElementScreenshot = getElementScreenshot;
|
|
|
19
19
|
exports.clear = clear;
|
|
20
20
|
exports.getElementRect = getElementRect;
|
|
21
21
|
exports.mobileReplaceElementValue = mobileReplaceElementValue;
|
|
22
|
+
const driver_1 = require("appium/driver");
|
|
22
23
|
const bluebird_1 = __importDefault(require("bluebird"));
|
|
23
24
|
const lodash_1 = __importDefault(require("lodash"));
|
|
24
|
-
const driver_1 = require("appium/driver");
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @returns {Promise<import('@appium/types').Element>}
|
|
26
|
+
* Gets the currently active element.
|
|
28
27
|
*/
|
|
29
28
|
async function active() {
|
|
30
|
-
return
|
|
29
|
+
return (await this.uiautomator2.jwproxy.command('/element/active', 'GET'));
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @param {string} attribute
|
|
35
|
-
* @param {string} elementId
|
|
36
|
-
* @returns {Promise<string?>}
|
|
32
|
+
* Gets an element attribute value.
|
|
37
33
|
*/
|
|
38
34
|
async function getAttribute(attribute, elementId) {
|
|
39
35
|
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/attribute/${attribute}`, 'GET', {}));
|
|
40
36
|
}
|
|
41
37
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @param {string} elementId
|
|
44
|
-
* @returns {Promise<boolean>}
|
|
38
|
+
* Returns whether the element is displayed.
|
|
45
39
|
*/
|
|
46
40
|
async function elementDisplayed(elementId) {
|
|
47
41
|
return toBool(await this.getAttribute('displayed', elementId));
|
|
48
42
|
}
|
|
49
43
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param {string} elementId
|
|
52
|
-
* @returns {Promise<boolean>}
|
|
44
|
+
* Returns whether the element is enabled.
|
|
53
45
|
*/
|
|
54
46
|
async function elementEnabled(elementId) {
|
|
55
47
|
return toBool(await this.getAttribute('enabled', elementId));
|
|
56
48
|
}
|
|
57
49
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param {string} elementId
|
|
60
|
-
* @returns {Promise<boolean>}
|
|
50
|
+
* Returns whether the element is selected.
|
|
61
51
|
*/
|
|
62
52
|
async function elementSelected(elementId) {
|
|
63
53
|
return toBool(await this.getAttribute('selected', elementId));
|
|
64
54
|
}
|
|
65
55
|
/**
|
|
66
|
-
*
|
|
67
|
-
* @param {string} elementId
|
|
68
|
-
* @returns {Promise<string>}
|
|
56
|
+
* Gets the element tag name.
|
|
69
57
|
*/
|
|
70
58
|
async function getName(elementId) {
|
|
71
|
-
return
|
|
59
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/name`, 'GET', {}));
|
|
72
60
|
}
|
|
73
61
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param {string} elementId
|
|
76
|
-
* @returns {Promise<import('@appium/types').Position>}
|
|
62
|
+
* Gets the element location.
|
|
77
63
|
*/
|
|
78
64
|
async function getLocation(elementId) {
|
|
79
|
-
return
|
|
65
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/location`, 'GET', {}));
|
|
80
66
|
}
|
|
81
67
|
/**
|
|
82
|
-
*
|
|
83
|
-
* @param {string} elementId
|
|
84
|
-
* @returns {Promise<import('@appium/types').Size>}
|
|
68
|
+
* Gets the element size.
|
|
85
69
|
*/
|
|
86
70
|
async function getSize(elementId) {
|
|
87
|
-
return
|
|
71
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/size`, 'GET', {}));
|
|
88
72
|
}
|
|
89
73
|
/**
|
|
90
|
-
*
|
|
91
|
-
* @param {import('appium-android-driver').DoSetElementValueOpts} params
|
|
92
|
-
* @returns {Promise<void>}
|
|
74
|
+
* Sets the value of an element using the upstream driver API.
|
|
93
75
|
*/
|
|
94
76
|
async function doSetElementValue(params) {
|
|
95
77
|
await this.uiautomator2.jwproxy.command(`/element/${params.elementId}/value`, 'POST', params);
|
|
96
78
|
}
|
|
97
79
|
/**
|
|
98
|
-
*
|
|
99
|
-
* @param {string|string[]} keys
|
|
100
|
-
* @param {string} elementId
|
|
101
|
-
* @returns {Promise<void>}
|
|
80
|
+
* Sends text to an element without replacement.
|
|
102
81
|
*/
|
|
103
82
|
async function setValueImmediate(keys, elementId) {
|
|
104
83
|
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
@@ -108,67 +87,48 @@ async function setValueImmediate(keys, elementId) {
|
|
|
108
87
|
});
|
|
109
88
|
}
|
|
110
89
|
/**
|
|
111
|
-
*
|
|
112
|
-
* @param {string} elementId
|
|
113
|
-
* @returns {Promise<string>}
|
|
90
|
+
* Gets the element text.
|
|
114
91
|
*/
|
|
115
92
|
async function getText(elementId) {
|
|
116
93
|
return String(await this.uiautomator2.jwproxy.command(`/element/${elementId}/text`, 'GET', {}));
|
|
117
94
|
}
|
|
118
95
|
/**
|
|
119
|
-
*
|
|
120
|
-
* @param {string} element
|
|
121
|
-
* @returns {Promise<void>}
|
|
96
|
+
* Clicks the given element.
|
|
122
97
|
*/
|
|
123
98
|
async function click(element) {
|
|
124
99
|
await this.uiautomator2.jwproxy.command(`/element/${element}/click`, 'POST', { element });
|
|
125
100
|
}
|
|
126
101
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @param {string} element
|
|
129
|
-
* @returns {Promise<string>}
|
|
102
|
+
* Takes a screenshot of the element.
|
|
130
103
|
*/
|
|
131
104
|
async function getElementScreenshot(element) {
|
|
132
105
|
return String(await this.uiautomator2.jwproxy.command(`/element/${element}/screenshot`, 'GET', {}));
|
|
133
106
|
}
|
|
134
107
|
/**
|
|
135
|
-
*
|
|
136
|
-
* @param {string} elementId
|
|
137
|
-
* @returns {Promise<void>}
|
|
108
|
+
* Clears the element text.
|
|
138
109
|
*/
|
|
139
110
|
async function clear(elementId) {
|
|
140
|
-
await this.uiautomator2.jwproxy.command(`/element/${elementId}/clear`, 'POST', {
|
|
141
|
-
elementId,
|
|
142
|
-
});
|
|
111
|
+
await this.uiautomator2.jwproxy.command(`/element/${elementId}/clear`, 'POST', { elementId });
|
|
143
112
|
}
|
|
144
113
|
/**
|
|
145
|
-
*
|
|
146
|
-
* @param {string} elementId
|
|
147
|
-
* @returns {Promise<import('@appium/types').Rect>}
|
|
114
|
+
* Gets the element rectangle.
|
|
148
115
|
*/
|
|
149
116
|
async function getElementRect(elementId) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
return /** @type {import('@appium/types').Rect} */ (await chromedriver.jwproxy.command(`/element/${elementId}/rect`, 'GET'));
|
|
117
|
+
if (!this.isWebContext()) {
|
|
118
|
+
return (await this.uiautomator2.jwproxy.command(`/element/${elementId}/rect`, 'GET'));
|
|
119
|
+
}
|
|
120
|
+
const chromedriver = this.chromedriver;
|
|
121
|
+
if (chromedriver.jwproxy.downstreamProtocol === driver_1.PROTOCOLS.MJSONWP) {
|
|
122
|
+
const [{ x, y }, { width, height }] = (await bluebird_1.default.all([
|
|
123
|
+
chromedriver.jwproxy.command(`/element/${elementId}/location`, 'GET'),
|
|
124
|
+
chromedriver.jwproxy.command(`/element/${elementId}/size`, 'GET'),
|
|
125
|
+
]));
|
|
126
|
+
return { x, y, width, height };
|
|
162
127
|
}
|
|
163
|
-
return
|
|
128
|
+
return (await chromedriver.jwproxy.command(`/element/${elementId}/rect`, 'GET'));
|
|
164
129
|
}
|
|
165
130
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @this {AndroidUiautomator2Driver}
|
|
168
|
-
* @param {string} elementId The id of the element whose content will be replaced.
|
|
169
|
-
* @param {string} text The actual text to set.
|
|
170
|
-
* @throws {Error} If there was a faulre while setting the text
|
|
171
|
-
* @returns {Promise<void>}
|
|
131
|
+
* Replaces the element text.
|
|
172
132
|
*/
|
|
173
133
|
async function mobileReplaceElementValue(elementId, text) {
|
|
174
134
|
await this.uiautomator2.jwproxy.command(`/element/${elementId}/value`, 'POST', {
|
|
@@ -176,16 +136,7 @@ async function mobileReplaceElementValue(elementId, text) {
|
|
|
176
136
|
replace: true,
|
|
177
137
|
});
|
|
178
138
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
* @param {any} s
|
|
182
|
-
* @returns {boolean}
|
|
183
|
-
*/
|
|
184
|
-
function toBool(s) {
|
|
185
|
-
return lodash_1.default.isString(s) ? s.toLowerCase() === 'true' : !!s;
|
|
139
|
+
function toBool(value) {
|
|
140
|
+
return lodash_1.default.isString(value) ? value.toLowerCase() === 'true' : !!value;
|
|
186
141
|
}
|
|
187
|
-
// #endregion
|
|
188
|
-
/**
|
|
189
|
-
* @typedef {import('../driver').AndroidUiautomator2Driver} AndroidUiautomator2Driver
|
|
190
|
-
*/
|
|
191
142
|
//# sourceMappingURL=element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../lib/commands/element.
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../../lib/commands/element.ts"],"names":[],"mappings":";;;;;AAWA,wBAEC;AAKD,oCAEC;AAKD,4CAEC;AAKD,wCAEC;AAKD,0CAEC;AAKD,0BAEC;AAKD,kCAEC;AAKD,0BAEC;AAKD,8CAEC;AAKD,8CAUC;AAKD,0BAEC;AAKD,sBAEC;AAKD,oDAEC;AAKD,sBAEC;AAKD,wCAcC;AAKD,8DASC;AAjJD,0CAAwC;AACxC,wDAAyB;AACzB,oDAAuB;AAMvB;;GAEG;AACI,KAAK,UAAU,MAAM;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