@angular/material 21.0.0-next.8 → 21.0.0-rc.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.
Files changed (204) hide show
  1. package/core/tokens/_classes.scss +1 -1
  2. package/core/tokens/m2/_md-sys-color.scss +17 -17
  3. package/fesm2022/_animation-chunk.mjs +10 -16
  4. package/fesm2022/_animation-chunk.mjs.map +1 -1
  5. package/fesm2022/_date-formats-chunk.mjs +68 -164
  6. package/fesm2022/_date-formats-chunk.mjs.map +1 -1
  7. package/fesm2022/_date-range-input-harness-chunk.mjs +284 -463
  8. package/fesm2022/_date-range-input-harness-chunk.mjs.map +1 -1
  9. package/fesm2022/_error-options-chunk.mjs +56 -19
  10. package/fesm2022/_error-options-chunk.mjs.map +1 -1
  11. package/fesm2022/_error-state-chunk.mjs +24 -31
  12. package/fesm2022/_error-state-chunk.mjs.map +1 -1
  13. package/fesm2022/_form-field-chunk.mjs +1224 -1017
  14. package/fesm2022/_form-field-chunk.mjs.map +1 -1
  15. package/fesm2022/_icon-button-chunk.mjs +243 -187
  16. package/fesm2022/_icon-button-chunk.mjs.map +1 -1
  17. package/fesm2022/_icon-registry-chunk.mjs +350 -575
  18. package/fesm2022/_icon-registry-chunk.mjs.map +1 -1
  19. package/fesm2022/_input-harness-chunk.mjs +56 -107
  20. package/fesm2022/_input-harness-chunk.mjs.map +1 -1
  21. package/fesm2022/_input-value-accessor-chunk.mjs +0 -6
  22. package/fesm2022/_input-value-accessor-chunk.mjs.map +1 -1
  23. package/fesm2022/_internal-form-field-chunk.mjs +59 -19
  24. package/fesm2022/_internal-form-field-chunk.mjs.map +1 -1
  25. package/fesm2022/_line-chunk.mjs +83 -43
  26. package/fesm2022/_line-chunk.mjs.map +1 -1
  27. package/fesm2022/_option-chunk.mjs +348 -311
  28. package/fesm2022/_option-chunk.mjs.map +1 -1
  29. package/fesm2022/_option-harness-chunk.mjs +23 -39
  30. package/fesm2022/_option-harness-chunk.mjs.map +1 -1
  31. package/fesm2022/_option-module-chunk.mjs +36 -10
  32. package/fesm2022/_option-module-chunk.mjs.map +1 -1
  33. package/fesm2022/_pseudo-checkbox-chunk.mjs +79 -44
  34. package/fesm2022/_pseudo-checkbox-chunk.mjs.map +1 -1
  35. package/fesm2022/_pseudo-checkbox-module-chunk.mjs +36 -10
  36. package/fesm2022/_pseudo-checkbox-module-chunk.mjs.map +1 -1
  37. package/fesm2022/_public-api-chunk.mjs +71 -134
  38. package/fesm2022/_public-api-chunk.mjs.map +1 -1
  39. package/fesm2022/_ripple-chunk.mjs +504 -600
  40. package/fesm2022/_ripple-chunk.mjs.map +1 -1
  41. package/fesm2022/_ripple-loader-chunk.mjs +120 -138
  42. package/fesm2022/_ripple-loader-chunk.mjs.map +1 -1
  43. package/fesm2022/_ripple-module-chunk.mjs +36 -10
  44. package/fesm2022/_ripple-module-chunk.mjs.map +1 -1
  45. package/fesm2022/_structural-styles-chunk.mjs +37 -10
  46. package/fesm2022/_structural-styles-chunk.mjs.map +1 -1
  47. package/fesm2022/_tooltip-chunk.mjs +810 -888
  48. package/fesm2022/_tooltip-chunk.mjs.map +1 -1
  49. package/fesm2022/autocomplete-testing.mjs +62 -86
  50. package/fesm2022/autocomplete-testing.mjs.map +1 -1
  51. package/fesm2022/autocomplete.mjs +965 -1126
  52. package/fesm2022/autocomplete.mjs.map +1 -1
  53. package/fesm2022/badge-testing.mjs +38 -54
  54. package/fesm2022/badge-testing.mjs.map +1 -1
  55. package/fesm2022/badge.mjs +321 -272
  56. package/fesm2022/badge.mjs.map +1 -1
  57. package/fesm2022/bottom-sheet-testing.mjs +10 -24
  58. package/fesm2022/bottom-sheet-testing.mjs.map +1 -1
  59. package/fesm2022/bottom-sheet.mjs +349 -344
  60. package/fesm2022/bottom-sheet.mjs.map +1 -1
  61. package/fesm2022/button-testing.mjs +60 -94
  62. package/fesm2022/button-testing.mjs.map +1 -1
  63. package/fesm2022/button-toggle-testing.mjs +76 -125
  64. package/fesm2022/button-toggle-testing.mjs.map +1 -1
  65. package/fesm2022/button-toggle.mjs +752 -662
  66. package/fesm2022/button-toggle.mjs.map +1 -1
  67. package/fesm2022/button.mjs +263 -158
  68. package/fesm2022/button.mjs.map +1 -1
  69. package/fesm2022/card-testing.mjs +19 -33
  70. package/fesm2022/card-testing.mjs.map +1 -1
  71. package/fesm2022/card.mjs +576 -272
  72. package/fesm2022/card.mjs.map +1 -1
  73. package/fesm2022/checkbox-testing.mjs +71 -123
  74. package/fesm2022/checkbox-testing.mjs.map +1 -1
  75. package/fesm2022/checkbox.mjs +515 -477
  76. package/fesm2022/checkbox.mjs.map +1 -1
  77. package/fesm2022/chips-testing.mjs +201 -350
  78. package/fesm2022/chips-testing.mjs.map +1 -1
  79. package/fesm2022/chips.mjs +2552 -2289
  80. package/fesm2022/chips.mjs.map +1 -1
  81. package/fesm2022/core-testing.mjs +14 -28
  82. package/fesm2022/core-testing.mjs.map +1 -1
  83. package/fesm2022/core.mjs +357 -328
  84. package/fesm2022/core.mjs.map +1 -1
  85. package/fesm2022/datepicker-testing.mjs +15 -25
  86. package/fesm2022/datepicker-testing.mjs.map +1 -1
  87. package/fesm2022/datepicker.mjs +4826 -4563
  88. package/fesm2022/datepicker.mjs.map +1 -1
  89. package/fesm2022/dialog-testing.mjs +93 -129
  90. package/fesm2022/dialog-testing.mjs.map +1 -1
  91. package/fesm2022/dialog.mjs +810 -829
  92. package/fesm2022/dialog.mjs.map +1 -1
  93. package/fesm2022/divider-testing.mjs +10 -11
  94. package/fesm2022/divider-testing.mjs.map +1 -1
  95. package/fesm2022/divider.mjs +119 -43
  96. package/fesm2022/divider.mjs.map +1 -1
  97. package/fesm2022/expansion-testing.mjs +74 -130
  98. package/fesm2022/expansion-testing.mjs.map +1 -1
  99. package/fesm2022/expansion.mjs +703 -515
  100. package/fesm2022/expansion.mjs.map +1 -1
  101. package/fesm2022/form-field-testing-control.mjs +16 -33
  102. package/fesm2022/form-field-testing-control.mjs.map +1 -1
  103. package/fesm2022/form-field-testing.mjs +118 -179
  104. package/fesm2022/form-field-testing.mjs.map +1 -1
  105. package/fesm2022/form-field.mjs +36 -10
  106. package/fesm2022/form-field.mjs.map +1 -1
  107. package/fesm2022/grid-list-testing.mjs +65 -113
  108. package/fesm2022/grid-list-testing.mjs.map +1 -1
  109. package/fesm2022/grid-list.mjs +559 -494
  110. package/fesm2022/grid-list.mjs.map +1 -1
  111. package/fesm2022/icon-testing.mjs +148 -127
  112. package/fesm2022/icon-testing.mjs.map +1 -1
  113. package/fesm2022/icon.mjs +325 -351
  114. package/fesm2022/icon.mjs.map +1 -1
  115. package/fesm2022/input-testing.mjs +59 -99
  116. package/fesm2022/input-testing.mjs.map +1 -1
  117. package/fesm2022/input.mjs +457 -520
  118. package/fesm2022/input.mjs.map +1 -1
  119. package/fesm2022/list-testing.mjs +251 -434
  120. package/fesm2022/list-testing.mjs.map +1 -1
  121. package/fesm2022/list.mjs +1522 -1204
  122. package/fesm2022/list.mjs.map +1 -1
  123. package/fesm2022/material.mjs +0 -5
  124. package/fesm2022/material.mjs.map +1 -1
  125. package/fesm2022/menu-testing.mjs +159 -228
  126. package/fesm2022/menu-testing.mjs.map +1 -1
  127. package/fesm2022/menu.mjs +1338 -1343
  128. package/fesm2022/menu.mjs.map +1 -1
  129. package/fesm2022/paginator-testing.mjs +55 -79
  130. package/fesm2022/paginator-testing.mjs.map +1 -1
  131. package/fesm2022/paginator.mjs +381 -309
  132. package/fesm2022/paginator.mjs.map +1 -1
  133. package/fesm2022/progress-bar-testing.mjs +12 -21
  134. package/fesm2022/progress-bar-testing.mjs.map +1 -1
  135. package/fesm2022/progress-bar.mjs +224 -169
  136. package/fesm2022/progress-bar.mjs.map +1 -1
  137. package/fesm2022/progress-spinner-testing.mjs +13 -23
  138. package/fesm2022/progress-spinner-testing.mjs.map +1 -1
  139. package/fesm2022/progress-spinner.mjs +235 -160
  140. package/fesm2022/progress-spinner.mjs.map +1 -1
  141. package/fesm2022/radio-testing.mjs +133 -208
  142. package/fesm2022/radio-testing.mjs.map +1 -1
  143. package/fesm2022/radio.mjs +712 -679
  144. package/fesm2022/radio.mjs.map +1 -1
  145. package/fesm2022/select-testing.mjs +83 -117
  146. package/fesm2022/select-testing.mjs.map +1 -1
  147. package/fesm2022/select.mjs +1116 -1246
  148. package/fesm2022/select.mjs.map +1 -1
  149. package/fesm2022/sidenav-testing.mjs +54 -120
  150. package/fesm2022/sidenav-testing.mjs.map +1 -1
  151. package/fesm2022/sidenav.mjs +1078 -995
  152. package/fesm2022/sidenav.mjs.map +1 -1
  153. package/fesm2022/slide-toggle-testing.mjs +57 -92
  154. package/fesm2022/slide-toggle-testing.mjs.map +1 -1
  155. package/fesm2022/slide-toggle.mjs +369 -279
  156. package/fesm2022/slide-toggle.mjs.map +1 -1
  157. package/fesm2022/slider-testing.mjs +90 -138
  158. package/fesm2022/slider-testing.mjs.map +1 -1
  159. package/fesm2022/slider.mjs +1651 -1716
  160. package/fesm2022/slider.mjs.map +1 -1
  161. package/fesm2022/snack-bar-testing.mjs +40 -87
  162. package/fesm2022/snack-bar-testing.mjs.map +1 -1
  163. package/fesm2022/snack-bar.mjs +763 -714
  164. package/fesm2022/snack-bar.mjs.map +1 -1
  165. package/fesm2022/sort-testing.mjs +45 -66
  166. package/fesm2022/sort-testing.mjs.map +1 -1
  167. package/fesm2022/sort.mjs +419 -344
  168. package/fesm2022/sort.mjs.map +1 -1
  169. package/fesm2022/stepper-testing.mjs +78 -154
  170. package/fesm2022/stepper-testing.mjs.map +1 -1
  171. package/fesm2022/stepper.mjs +790 -498
  172. package/fesm2022/stepper.mjs.map +1 -1
  173. package/fesm2022/table-testing.mjs +125 -186
  174. package/fesm2022/table-testing.mjs.map +1 -1
  175. package/fesm2022/table.mjs +1026 -684
  176. package/fesm2022/table.mjs.map +1 -1
  177. package/fesm2022/tabs-testing.mjs +125 -197
  178. package/fesm2022/tabs-testing.mjs.map +1 -1
  179. package/fesm2022/tabs.mjs +2351 -2028
  180. package/fesm2022/tabs.mjs.map +1 -1
  181. package/fesm2022/timepicker-testing.mjs +113 -172
  182. package/fesm2022/timepicker-testing.mjs.map +1 -1
  183. package/fesm2022/timepicker.mjs +1019 -826
  184. package/fesm2022/timepicker.mjs.map +1 -1
  185. package/fesm2022/toolbar-testing.mjs +16 -27
  186. package/fesm2022/toolbar-testing.mjs.map +1 -1
  187. package/fesm2022/toolbar.mjs +163 -78
  188. package/fesm2022/toolbar.mjs.map +1 -1
  189. package/fesm2022/tooltip-testing.mjs +41 -52
  190. package/fesm2022/tooltip-testing.mjs.map +1 -1
  191. package/fesm2022/tooltip.mjs +36 -10
  192. package/fesm2022/tooltip.mjs.map +1 -1
  193. package/fesm2022/tree-testing.mjs +86 -162
  194. package/fesm2022/tree-testing.mjs.map +1 -1
  195. package/fesm2022/tree.mjs +638 -466
  196. package/fesm2022/tree.mjs.map +1 -1
  197. package/package.json +2 -2
  198. package/schematics/ng-add/index.js +1 -1
  199. package/types/expansion.d.ts +4 -2
  200. package/types/menu-testing.d.ts +2 -0
  201. package/types/select.d.ts +1 -1
  202. package/types/sort.d.ts +1 -1
  203. package/types/table-testing.d.ts +27 -1
  204. package/types/timepicker.d.ts +148 -128
@@ -3,184 +3,125 @@ import { MatOptionHarness } from './_option-harness-chunk.mjs';
3
3
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
4
4
 
5
5
  class MatTimepickerHarness extends ComponentHarness {
6
- _documentRootLocator = this.documentRootLocatorFactory();
7
- static hostSelector = 'mat-timepicker';
8
- /**
9
- * Gets a `HarnessPredicate` that can be used to search for a timepicker with specific
10
- * attributes.
11
- * @param options Options for filtering which timepicker instances are considered a match.
12
- * @return a `HarnessPredicate` configured with the given options.
13
- */
14
- static with(options = {}) {
15
- return new HarnessPredicate(this, options);
16
- }
17
- /** Whether the timepicker is open. */
18
- async isOpen() {
19
- const selector = await this._getPanelSelector();
20
- const panel = await this._documentRootLocator.locatorForOptional(selector)();
21
- return panel !== null;
22
- }
23
- /** Gets the options inside the timepicker panel. */
24
- async getOptions(filters) {
25
- if (!(await this.isOpen())) {
26
- throw new Error('Unable to retrieve options for timepicker. Timepicker panel is closed.');
27
- }
28
- return this._documentRootLocator.locatorForAll(MatOptionHarness.with({
29
- ...(filters || {}),
30
- ancestor: await this._getPanelSelector(),
31
- }))();
32
- }
33
- /** Selects the first option matching the given filters. */
34
- async selectOption(filters) {
35
- const options = await this.getOptions(filters);
36
- if (!options.length) {
37
- throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);
38
- }
39
- await options[0].click();
40
- }
41
- /** Gets the selector that can be used to find the timepicker's panel. */
42
- async _getPanelSelector() {
43
- return `#${await (await this.host()).getAttribute('mat-timepicker-panel-id')}`;
44
- }
6
+ _documentRootLocator = this.documentRootLocatorFactory();
7
+ static hostSelector = 'mat-timepicker';
8
+ static with(options = {}) {
9
+ return new HarnessPredicate(this, options);
10
+ }
11
+ async isOpen() {
12
+ const selector = await this._getPanelSelector();
13
+ const panel = await this._documentRootLocator.locatorForOptional(selector)();
14
+ return panel !== null;
15
+ }
16
+ async getOptions(filters) {
17
+ if (!(await this.isOpen())) {
18
+ throw new Error('Unable to retrieve options for timepicker. Timepicker panel is closed.');
19
+ }
20
+ return this._documentRootLocator.locatorForAll(MatOptionHarness.with({
21
+ ...(filters || {}),
22
+ ancestor: await this._getPanelSelector()
23
+ }))();
24
+ }
25
+ async selectOption(filters) {
26
+ const options = await this.getOptions(filters);
27
+ if (!options.length) {
28
+ throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);
29
+ }
30
+ await options[0].click();
31
+ }
32
+ async _getPanelSelector() {
33
+ return `#${await (await this.host()).getAttribute('mat-timepicker-panel-id')}`;
34
+ }
45
35
  }
46
36
 
47
- /** Harness for interacting with a standard Material timepicker inputs in tests. */
48
37
  class MatTimepickerInputHarness extends ComponentHarness {
49
- _documentRootLocator = this.documentRootLocatorFactory();
50
- static hostSelector = '.mat-timepicker-input';
51
- /**
52
- * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerInputHarness`
53
- * that meets certain criteria.
54
- * @param options Options for filtering which input instances are considered a match.
55
- * @return a `HarnessPredicate` configured with the given options.
56
- */
57
- static with(options = {}) {
58
- return new HarnessPredicate(this, options)
59
- .addOption('value', options.value, (harness, value) => {
60
- return HarnessPredicate.stringMatches(harness.getValue(), value);
61
- })
62
- .addOption('placeholder', options.placeholder, (harness, placeholder) => {
63
- return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);
64
- });
65
- }
66
- /** Gets whether the timepicker associated with the input is open. */
67
- async isTimepickerOpen() {
68
- const host = await this.host();
69
- return (await host.getAttribute('aria-expanded')) === 'true';
70
- }
71
- /** Opens the timepicker associated with the input and returns the timepicker instance. */
72
- async openTimepicker() {
73
- if (!(await this.isDisabled())) {
74
- const host = await this.host();
75
- await host.sendKeys(TestKey.DOWN_ARROW);
76
- }
77
- return this.getTimepicker();
78
- }
79
- /** Closes the timepicker associated with the input. */
80
- async closeTimepicker() {
81
- await this._documentRootLocator.rootElement.click();
82
- // This is necessary so that we wait for the closing animation.
83
- await this.forceStabilize();
84
- }
85
- /**
86
- * Gets the `MatTimepickerHarness` that is associated with the input.
87
- * @param filter Optionally filters which timepicker is included.
88
- */
89
- async getTimepicker(filter = {}) {
90
- const host = await this.host();
91
- const timepickerId = await host.getAttribute('mat-timepicker-id');
92
- if (!timepickerId) {
93
- throw Error('Element is not associated with a timepicker');
94
- }
95
- return this._documentRootLocator.locatorFor(MatTimepickerHarness.with({
96
- ...filter,
97
- selector: `[mat-timepicker-panel-id="${timepickerId}"]`,
98
- }))();
99
- }
100
- /** Whether the input is disabled. */
101
- async isDisabled() {
102
- return (await this.host()).getProperty('disabled');
103
- }
104
- /** Whether the input is required. */
105
- async isRequired() {
106
- return (await this.host()).getProperty('required');
107
- }
108
- /** Gets the value of the input. */
109
- async getValue() {
110
- // The "value" property of the native input is always defined.
111
- return await (await this.host()).getProperty('value');
112
- }
113
- /**
114
- * Sets the value of the input. The value will be set by simulating
115
- * keypresses that correspond to the given value.
116
- */
117
- async setValue(newValue) {
118
- const inputEl = await this.host();
119
- await inputEl.clear();
120
- // We don't want to send keys for the value if the value is an empty
121
- // string in order to clear the value. Sending keys with an empty string
122
- // still results in unnecessary focus events.
123
- if (newValue) {
124
- await inputEl.sendKeys(newValue);
125
- }
126
- }
127
- /** Gets the placeholder of the input. */
128
- async getPlaceholder() {
129
- return await (await this.host()).getProperty('placeholder');
130
- }
131
- /**
132
- * Focuses the input and returns a promise that indicates when the
133
- * action is complete.
134
- */
135
- async focus() {
136
- return (await this.host()).focus();
137
- }
138
- /**
139
- * Blurs the input and returns a promise that indicates when the
140
- * action is complete.
141
- */
142
- async blur() {
143
- return (await this.host()).blur();
144
- }
145
- /** Whether the input is focused. */
146
- async isFocused() {
147
- return (await this.host()).isFocused();
148
- }
38
+ _documentRootLocator = this.documentRootLocatorFactory();
39
+ static hostSelector = '.mat-timepicker-input';
40
+ static with(options = {}) {
41
+ return new HarnessPredicate(this, options).addOption('value', options.value, (harness, value) => {
42
+ return HarnessPredicate.stringMatches(harness.getValue(), value);
43
+ }).addOption('placeholder', options.placeholder, (harness, placeholder) => {
44
+ return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);
45
+ });
46
+ }
47
+ async isTimepickerOpen() {
48
+ const host = await this.host();
49
+ return (await host.getAttribute('aria-expanded')) === 'true';
50
+ }
51
+ async openTimepicker() {
52
+ if (!(await this.isDisabled())) {
53
+ const host = await this.host();
54
+ await host.sendKeys(TestKey.DOWN_ARROW);
55
+ }
56
+ return this.getTimepicker();
57
+ }
58
+ async closeTimepicker() {
59
+ await this._documentRootLocator.rootElement.click();
60
+ await this.forceStabilize();
61
+ }
62
+ async getTimepicker(filter = {}) {
63
+ const host = await this.host();
64
+ const timepickerId = await host.getAttribute('mat-timepicker-id');
65
+ if (!timepickerId) {
66
+ throw Error('Element is not associated with a timepicker');
67
+ }
68
+ return this._documentRootLocator.locatorFor(MatTimepickerHarness.with({
69
+ ...filter,
70
+ selector: `[mat-timepicker-panel-id="${timepickerId}"]`
71
+ }))();
72
+ }
73
+ async isDisabled() {
74
+ return (await this.host()).getProperty('disabled');
75
+ }
76
+ async isRequired() {
77
+ return (await this.host()).getProperty('required');
78
+ }
79
+ async getValue() {
80
+ return await (await this.host()).getProperty('value');
81
+ }
82
+ async setValue(newValue) {
83
+ const inputEl = await this.host();
84
+ await inputEl.clear();
85
+ if (newValue) {
86
+ await inputEl.sendKeys(newValue);
87
+ }
88
+ }
89
+ async getPlaceholder() {
90
+ return await (await this.host()).getProperty('placeholder');
91
+ }
92
+ async focus() {
93
+ return (await this.host()).focus();
94
+ }
95
+ async blur() {
96
+ return (await this.host()).blur();
97
+ }
98
+ async isFocused() {
99
+ return (await this.host()).isFocused();
100
+ }
149
101
  }
150
102
 
151
- /** Harness for interacting with a standard Material timepicker toggle in tests. */
152
103
  class MatTimepickerToggleHarness extends ComponentHarness {
153
- static hostSelector = '.mat-timepicker-toggle';
154
- /** The clickable button inside the toggle. */
155
- _button = this.locatorFor('button');
156
- /**
157
- * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerToggleHarness` that
158
- * meets certain criteria.
159
- * @param options Options for filtering which timepicker toggle instances are considered a match.
160
- * @return a `HarnessPredicate` configured with the given options.
161
- */
162
- static with(options = {}) {
163
- return new HarnessPredicate(MatTimepickerToggleHarness, options);
164
- }
165
- /** Opens the timepicker associated with the toggle. */
166
- async openTimepicker() {
167
- const isOpen = await this.isTimepickerOpen();
168
- if (!isOpen) {
169
- const button = await this._button();
170
- await button.click();
171
- }
172
- }
173
- /** Gets whether the timepicker associated with the toggle is open. */
174
- async isTimepickerOpen() {
175
- const button = await this._button();
176
- const ariaExpanded = await button.getAttribute('aria-expanded');
177
- return ariaExpanded === 'true';
178
- }
179
- /** Whether the toggle is disabled. */
180
- async isDisabled() {
181
- const button = await this._button();
182
- return coerceBooleanProperty(await button.getAttribute('disabled'));
183
- }
104
+ static hostSelector = '.mat-timepicker-toggle';
105
+ _button = this.locatorFor('button');
106
+ static with(options = {}) {
107
+ return new HarnessPredicate(MatTimepickerToggleHarness, options);
108
+ }
109
+ async openTimepicker() {
110
+ const isOpen = await this.isTimepickerOpen();
111
+ if (!isOpen) {
112
+ const button = await this._button();
113
+ await button.click();
114
+ }
115
+ }
116
+ async isTimepickerOpen() {
117
+ const button = await this._button();
118
+ const ariaExpanded = await button.getAttribute('aria-expanded');
119
+ return ariaExpanded === 'true';
120
+ }
121
+ async isDisabled() {
122
+ const button = await this._button();
123
+ return coerceBooleanProperty(await button.getAttribute('disabled'));
124
+ }
184
125
  }
185
126
 
186
127
  export { MatTimepickerHarness, MatTimepickerInputHarness, MatTimepickerToggleHarness };
@@ -1 +1 @@
1
- {"version":3,"file":"timepicker-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-input-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-toggle-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {MatOptionHarness, OptionHarnessFilters} from '../../core/testing';\nimport {TimepickerHarnessFilters} from './timepicker-harness-filters';\n\nexport class MatTimepickerHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n static hostSelector = 'mat-timepicker';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a timepicker with specific\n * attributes.\n * @param options Options for filtering which timepicker instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTimepickerHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TimepickerHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Whether the timepicker is open. */\n async isOpen(): Promise<boolean> {\n const selector = await this._getPanelSelector();\n const panel = await this._documentRootLocator.locatorForOptional(selector)();\n return panel !== null;\n }\n\n /** Gets the options inside the timepicker panel. */\n async getOptions(filters?: Omit<OptionHarnessFilters, 'ancestor'>): Promise<MatOptionHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error('Unable to retrieve options for timepicker. Timepicker panel is closed.');\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptionHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptionHarnessFilters),\n )();\n }\n\n /** Selects the first option matching the given filters. */\n async selectOption(filters: OptionHarnessFilters): Promise<void> {\n const options = await this.getOptions(filters);\n if (!options.length) {\n throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);\n }\n await options[0].click();\n }\n\n /** Gets the selector that can be used to find the timepicker's panel. */\n protected async _getPanelSelector(): Promise<string> {\n return `#${await (await this.host()).getAttribute('mat-timepicker-panel-id')}`;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n TestKey,\n} from '@angular/cdk/testing';\nimport {MatTimepickerHarness} from './timepicker-harness';\nimport {\n TimepickerHarnessFilters,\n TimepickerInputHarnessFilters,\n} from './timepicker-harness-filters';\n\n/** Harness for interacting with a standard Material timepicker inputs in tests. */\nexport class MatTimepickerInputHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n static hostSelector = '.mat-timepicker-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTimepickerInputHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TimepickerInputHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('value', options.value, (harness, value) => {\n return HarnessPredicate.stringMatches(harness.getValue(), value);\n })\n .addOption('placeholder', options.placeholder, (harness, placeholder) => {\n return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);\n });\n }\n\n /** Gets whether the timepicker associated with the input is open. */\n async isTimepickerOpen(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Opens the timepicker associated with the input and returns the timepicker instance. */\n async openTimepicker(): Promise<MatTimepickerHarness> {\n if (!(await this.isDisabled())) {\n const host = await this.host();\n await host.sendKeys(TestKey.DOWN_ARROW);\n }\n\n return this.getTimepicker();\n }\n\n /** Closes the timepicker associated with the input. */\n async closeTimepicker(): Promise<void> {\n await this._documentRootLocator.rootElement.click();\n\n // This is necessary so that we wait for the closing animation.\n await this.forceStabilize();\n }\n\n /**\n * Gets the `MatTimepickerHarness` that is associated with the input.\n * @param filter Optionally filters which timepicker is included.\n */\n async getTimepicker(filter: TimepickerHarnessFilters = {}): Promise<MatTimepickerHarness> {\n const host = await this.host();\n const timepickerId = await host.getAttribute('mat-timepicker-id');\n\n if (!timepickerId) {\n throw Error('Element is not associated with a timepicker');\n }\n\n return this._documentRootLocator.locatorFor(\n MatTimepickerHarness.with({\n ...filter,\n selector: `[mat-timepicker-panel-id=\"${timepickerId}\"]`,\n }),\n )();\n }\n\n /** Whether the input is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Whether the input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('required');\n }\n\n /** Gets the value of the input. */\n async getValue(): Promise<string> {\n // The \"value\" property of the native input is always defined.\n return await (await this.host()).getProperty<string>('value');\n }\n\n /**\n * Sets the value of the input. The value will be set by simulating\n * keypresses that correspond to the given value.\n */\n async setValue(newValue: string): Promise<void> {\n const inputEl = await this.host();\n await inputEl.clear();\n\n // We don't want to send keys for the value if the value is an empty\n // string in order to clear the value. Sending keys with an empty string\n // still results in unnecessary focus events.\n if (newValue) {\n await inputEl.sendKeys(newValue);\n }\n }\n\n /** Gets the placeholder of the input. */\n async getPlaceholder(): Promise<string> {\n return await (await this.host()).getProperty<string>('placeholder');\n }\n\n /**\n * Focuses the input and returns a promise that indicates when the\n * action is complete.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Blurs the input and returns a promise that indicates when the\n * action is complete.\n */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {TimepickerToggleHarnessFilters} from './timepicker-harness-filters';\n\n/** Harness for interacting with a standard Material timepicker toggle in tests. */\nexport class MatTimepickerToggleHarness extends ComponentHarness {\n static hostSelector = '.mat-timepicker-toggle';\n\n /** The clickable button inside the toggle. */\n private _button = this.locatorFor('button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerToggleHarness` that\n * meets certain criteria.\n * @param options Options for filtering which timepicker toggle instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: TimepickerToggleHarnessFilters = {},\n ): HarnessPredicate<MatTimepickerToggleHarness> {\n return new HarnessPredicate(MatTimepickerToggleHarness, options);\n }\n\n /** Opens the timepicker associated with the toggle. */\n async openTimepicker(): Promise<void> {\n const isOpen = await this.isTimepickerOpen();\n\n if (!isOpen) {\n const button = await this._button();\n await button.click();\n }\n }\n\n /** Gets whether the timepicker associated with the toggle is open. */\n async isTimepickerOpen(): Promise<boolean> {\n const button = await this._button();\n const ariaExpanded = await button.getAttribute('aria-expanded');\n return ariaExpanded === 'true';\n }\n\n /** Whether the toggle is disabled. */\n async isDisabled(): Promise<boolean> {\n const button = await this._button();\n return coerceBooleanProperty(await button.getAttribute('disabled'));\n }\n}\n"],"names":[],"mappings":";;;;AAgBM,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AAChD,IAAA,oBAAoB,GAAG,IAAI,CAAC,0BAA0B,EAAE;AAChE,IAAA,OAAO,YAAY,GAAG,gBAAgB;AAEtC;;;;;AAKG;AACH,IAAA,OAAO,IAAI,CAET,OAAA,GAAoC,EAAE,EAAA;AAEtC,QAAA,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC;;;AAI5C,IAAA,MAAM,MAAM,GAAA;AACV,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,EAAE;AAC/C,QAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE;QAC5E,OAAO,KAAK,KAAK,IAAI;;;IAIvB,MAAM,UAAU,CAAC,OAAgD,EAAA;QAC/D,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AAC1B,YAAA,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC;;QAG3F,OAAO,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAC5C,gBAAgB,CAAC,IAAI,CAAC;AACpB,YAAA,IAAI,OAAO,IAAI,EAAE,CAAC;AAClB,YAAA,QAAQ,EAAE,MAAM,IAAI,CAAC,iBAAiB,EAAE;SACjB,CAAC,CAC3B,EAAE;;;IAIL,MAAM,YAAY,CAAC,OAA6B,EAAA;QAC9C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;AAC9C,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,MAAM,KAAK,CAAC,CAAA,qCAAA,EAAwC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OAAO,YAAY,KAAK,MAAM;;;AAIhC,IAAA,MAAM,UAAU,GAAA;AACd,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE;QACnC,OAAO,qBAAqB,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;;;;;;"}
1
+ {"version":3,"file":"timepicker-testing.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-input-harness.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/material/timepicker/testing/timepicker-toggle-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {MatOptionHarness, OptionHarnessFilters} from '../../core/testing';\nimport {TimepickerHarnessFilters} from './timepicker-harness-filters';\n\nexport class MatTimepickerHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n static hostSelector = 'mat-timepicker';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a timepicker with specific\n * attributes.\n * @param options Options for filtering which timepicker instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTimepickerHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TimepickerHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options);\n }\n\n /** Whether the timepicker is open. */\n async isOpen(): Promise<boolean> {\n const selector = await this._getPanelSelector();\n const panel = await this._documentRootLocator.locatorForOptional(selector)();\n return panel !== null;\n }\n\n /** Gets the options inside the timepicker panel. */\n async getOptions(filters?: Omit<OptionHarnessFilters, 'ancestor'>): Promise<MatOptionHarness[]> {\n if (!(await this.isOpen())) {\n throw new Error('Unable to retrieve options for timepicker. Timepicker panel is closed.');\n }\n\n return this._documentRootLocator.locatorForAll(\n MatOptionHarness.with({\n ...(filters || {}),\n ancestor: await this._getPanelSelector(),\n } as OptionHarnessFilters),\n )();\n }\n\n /** Selects the first option matching the given filters. */\n async selectOption(filters: OptionHarnessFilters): Promise<void> {\n const options = await this.getOptions(filters);\n if (!options.length) {\n throw Error(`Could not find a mat-option matching ${JSON.stringify(filters)}`);\n }\n await options[0].click();\n }\n\n /** Gets the selector that can be used to find the timepicker's panel. */\n protected async _getPanelSelector(): Promise<string> {\n return `#${await (await this.host()).getAttribute('mat-timepicker-panel-id')}`;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ComponentHarnessConstructor,\n HarnessPredicate,\n TestKey,\n} from '@angular/cdk/testing';\nimport {MatTimepickerHarness} from './timepicker-harness';\nimport {\n TimepickerHarnessFilters,\n TimepickerInputHarnessFilters,\n} from './timepicker-harness-filters';\n\n/** Harness for interacting with a standard Material timepicker inputs in tests. */\nexport class MatTimepickerInputHarness extends ComponentHarness {\n private _documentRootLocator = this.documentRootLocatorFactory();\n static hostSelector = '.mat-timepicker-input';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerInputHarness`\n * that meets certain criteria.\n * @param options Options for filtering which input instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with<T extends MatTimepickerInputHarness>(\n this: ComponentHarnessConstructor<T>,\n options: TimepickerInputHarnessFilters = {},\n ): HarnessPredicate<T> {\n return new HarnessPredicate(this, options)\n .addOption('value', options.value, (harness, value) => {\n return HarnessPredicate.stringMatches(harness.getValue(), value);\n })\n .addOption('placeholder', options.placeholder, (harness, placeholder) => {\n return HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder);\n });\n }\n\n /** Gets whether the timepicker associated with the input is open. */\n async isTimepickerOpen(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Opens the timepicker associated with the input and returns the timepicker instance. */\n async openTimepicker(): Promise<MatTimepickerHarness> {\n if (!(await this.isDisabled())) {\n const host = await this.host();\n await host.sendKeys(TestKey.DOWN_ARROW);\n }\n\n return this.getTimepicker();\n }\n\n /** Closes the timepicker associated with the input. */\n async closeTimepicker(): Promise<void> {\n await this._documentRootLocator.rootElement.click();\n\n // This is necessary so that we wait for the closing animation.\n await this.forceStabilize();\n }\n\n /**\n * Gets the `MatTimepickerHarness` that is associated with the input.\n * @param filter Optionally filters which timepicker is included.\n */\n async getTimepicker(filter: TimepickerHarnessFilters = {}): Promise<MatTimepickerHarness> {\n const host = await this.host();\n const timepickerId = await host.getAttribute('mat-timepicker-id');\n\n if (!timepickerId) {\n throw Error('Element is not associated with a timepicker');\n }\n\n return this._documentRootLocator.locatorFor(\n MatTimepickerHarness.with({\n ...filter,\n selector: `[mat-timepicker-panel-id=\"${timepickerId}\"]`,\n }),\n )();\n }\n\n /** Whether the input is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n /** Whether the input is required. */\n async isRequired(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('required');\n }\n\n /** Gets the value of the input. */\n async getValue(): Promise<string> {\n // The \"value\" property of the native input is always defined.\n return await (await this.host()).getProperty<string>('value');\n }\n\n /**\n * Sets the value of the input. The value will be set by simulating\n * keypresses that correspond to the given value.\n */\n async setValue(newValue: string): Promise<void> {\n const inputEl = await this.host();\n await inputEl.clear();\n\n // We don't want to send keys for the value if the value is an empty\n // string in order to clear the value. Sending keys with an empty string\n // still results in unnecessary focus events.\n if (newValue) {\n await inputEl.sendKeys(newValue);\n }\n }\n\n /** Gets the placeholder of the input. */\n async getPlaceholder(): Promise<string> {\n return await (await this.host()).getProperty<string>('placeholder');\n }\n\n /**\n * Focuses the input and returns a promise that indicates when the\n * action is complete.\n */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Blurs the input and returns a promise that indicates when the\n * action is complete.\n */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether the input is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {TimepickerToggleHarnessFilters} from './timepicker-harness-filters';\n\n/** Harness for interacting with a standard Material timepicker toggle in tests. */\nexport class MatTimepickerToggleHarness extends ComponentHarness {\n static hostSelector = '.mat-timepicker-toggle';\n\n /** The clickable button inside the toggle. */\n private _button = this.locatorFor('button');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a `MatTimepickerToggleHarness` that\n * meets certain criteria.\n * @param options Options for filtering which timepicker toggle instances are considered a match.\n * @return a `HarnessPredicate` configured with the given options.\n */\n static with(\n options: TimepickerToggleHarnessFilters = {},\n ): HarnessPredicate<MatTimepickerToggleHarness> {\n return new HarnessPredicate(MatTimepickerToggleHarness, options);\n }\n\n /** Opens the timepicker associated with the toggle. */\n async openTimepicker(): Promise<void> {\n const isOpen = await this.isTimepickerOpen();\n\n if (!isOpen) {\n const button = await this._button();\n await button.click();\n }\n }\n\n /** Gets whether the timepicker associated with the toggle is open. */\n async isTimepickerOpen(): Promise<boolean> {\n const button = await this._button();\n const ariaExpanded = await button.getAttribute('aria-expanded');\n return ariaExpanded === 'true';\n }\n\n /** Whether the toggle is disabled. */\n async isDisabled(): Promise<boolean> {\n const button = await this._button();\n return coerceBooleanProperty(await button.getAttribute('disabled'));\n }\n}\n"],"names":["with","options","panel","getOptions","filters","isOpen","Error","_documentRootLocator","locatorForAll","MatOptionHarness","ancestor","_getPanelSelector","isTimepickerOpen","host","getAttribute","isDisabled","sendKeys","DOWN_ARROW","getTimepicker","closeTimepicker","rootElement","click","forceStabilize","filter","timepickerId","locatorFor","MatTimepickerHarness","selector","getProperty","isRequired","getValue","setValue","newValue","inputEl","_button","button"],"mappings":";;;;;;;SAqCWA,IAAAA,CAAAC,OAAU,GAAA,EAAA,EAAA;;;;;;AAWb,IAAA,OAAAC,UAGD,IAAA;;AAMH,EAAA,MAAAC,WAAAC,OAAA,EAAA;gBACQ,KAAAC,MAAA,EAAA,CAAA,EAAA;YACR,IAAAC,KAAA,CAAA,wEAAA,CAAA;AACA;AACF,IAAA,OAAA,KAAAC,oBAAA,CAAAC,aAAA,CAAAC,gBAAA,CAAAT,IAAA,CAAA;;AAIEU,MAAAA,QAAA,aAAAC,iBAAA;KACF,CAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;ECpBE,OAAAX,IAAAA,CAAAC,OAAa,GAAA,EAAA,EAAA;;;;;KASb,CAAA;;wBAS+DW,GAAA;IAC/D,MAAAC,IAAA,cAAAA,IAAA,EAAA;AACF,IAAA,OAAA,CAAA,MAAAA,IAAA,CAAAC,YAAA,CAAA,eAAA,OAAA,MAAA;;;AAMA,IAAA,IAAA,EAAA,MAAA,IAAA,CAAAC,UAAA,EAAA,CAAA,EAAA;MACE,MAAAF,IAAA,GAAa,MAAA,IAAA,CAAAA,IAAA,EAAA;YACPA,IAAA,CAAAG,gBAAqB,CAAAC,UAAA,CAAA;;AAGzB,IAAA,OAAA,IAAA,CAAAC,aAAA,EAAA;;uBAMUC,GAAA;mCAET,CAAAC,WAAA,CAAAC,KAAA,EAAA;AAGL,IAAA,MAAqC,KAAAC,cAAA,EAAA;;AAWrCJ,EAAAA,MAAAA,aAAAA,CAAAK,MAAA,GAAA,EAAA,EAAA;UACgEV,IAAA,GAAA,MAAA,IAAA,CAAAA,IAAA,EAAA;AAC9D,IAAA,MAAAW,YAAA,GAAA,MAAAX,IAAA,CAAAC,YAAA,CAAA,mB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