@italia/accordion 0.1.0-alpha.2 → 1.0.0-alpha.4

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.
@@ -1,330 +0,0 @@
1
- import { B as BaseComponent, _ as __decorate, a as __metadata } from '../form-control-ddGGHusp.js';
2
- import { css, html } from 'lit';
3
- import { property, query, queryAssignedElements, customElement } from 'lit/decorators.js';
4
- import { when } from 'lit/directives/when.js';
5
- import { unsafeStatic } from 'lit/static-html.js';
6
- import 'lit/directive.js';
7
-
8
- var styles = css`/***************************** 1 ****************************************/
9
- /***************************** 2 ****************************************/
10
- /***************************** 1 ****************************************/
11
- /***************************** 2 ****************************************/
12
- /***************************** 1 ****************************************/
13
- /***************************** 2 ****************************************/
14
- /***************************** 3 ****************************************/
15
- /***************************** 1 ****************************************/
16
- /***************************** 2 ****************************************/
17
- /***************************** 3 ****************************************/
18
- /***************************** NEUTRAL 1 ****************************************/
19
- /***************************** NEUTRAL 2 ****************************************/
20
- /***************************** NEUTRAL 2 / 3 ****************************************/
21
- :host {
22
- display: block;
23
- }
24
-
25
- .collapse-wrapper {
26
- width: 100%;
27
- }
28
-
29
- .collapse-content {
30
- overflow: hidden;
31
- height: 0;
32
- }`;
33
-
34
- const isMouseEvent = (event) => event instanceof MouseEvent;
35
- const isKeyboardEvent = (event) => event instanceof KeyboardEvent;
36
-
37
- // TODO: quando si sviluppa collapse come componente standalone, decoupling dalle classi di accordion, e aggiornare il part name
38
- let ItCollapse = class ItCollapse extends BaseComponent {
39
- constructor() {
40
- super(...arguments);
41
- this.expanded = false;
42
- this.label = '';
43
- this.as = 'button';
44
- this.defaultOpen = false;
45
- this.isAnimating = false;
46
- this.animationDuration = 350; // ms
47
- this._triggerId = this.generateId('it-collapse-trigger');
48
- this._contentId = this.generateId('it-collapse-content');
49
- this.handleTriggerAction = (e) => {
50
- if (this.isAnimating) {
51
- e.preventDefault();
52
- e.stopPropagation();
53
- return;
54
- }
55
- if (isKeyboardEvent(e) && (e.key === 'Enter' || e.key === ' ')) {
56
- e.preventDefault();
57
- this.toggle();
58
- }
59
- else if (isMouseEvent(e)) {
60
- e.preventDefault();
61
- this.toggle();
62
- }
63
- };
64
- this._onTriggerSlotChange = () => {
65
- // Aggiorna gli attributi ARIA quando il contenuto dello slot cambia
66
- this.updateAriaAttributes();
67
- };
68
- }
69
- get triggerElement() {
70
- return this.triggerElements.length > 0 ? this.triggerElements[0] : null;
71
- }
72
- connectedCallback() {
73
- super.connectedCallback?.();
74
- // Initialize from default-open
75
- if (this.defaultOpen && !this.expanded) {
76
- this.expanded = this.defaultOpen;
77
- }
78
- }
79
- async toggle() {
80
- // Blocca toggle durante animazione
81
- if (this.isAnimating)
82
- return;
83
- const nextValue = !this.expanded;
84
- this.expanded = nextValue;
85
- this.dispatchEvent(new CustomEvent('it-collapse-toggle', {
86
- detail: {
87
- expanded: this.expanded,
88
- id: this.contentElement?.id,
89
- },
90
- bubbles: true,
91
- composed: true,
92
- cancelable: true,
93
- }));
94
- }
95
- setInitialState() {
96
- if (this.contentElement) {
97
- if (this.expanded) {
98
- this.contentElement.style.height = 'auto';
99
- this.contentElement.style.visibility = 'visible';
100
- }
101
- else {
102
- this.contentElement.style.height = '0px';
103
- this.contentElement.style.visibility = 'hidden';
104
- }
105
- }
106
- }
107
- cleanupAnimation() {
108
- if (this.animation) {
109
- try {
110
- this.animation.cancel();
111
- }
112
- catch {
113
- /* ignore */
114
- }
115
- this.animation = undefined;
116
- }
117
- this.isAnimating = false;
118
- }
119
- firstUpdated() {
120
- this.updateAriaAttributes();
121
- // Set initial state and ensure overflow is hidden
122
- this.setInitialState();
123
- }
124
- updated(changedProperties) {
125
- if (changedProperties.has('defaultOpen')) {
126
- if (this.defaultOpen && !this.expanded) {
127
- this.expanded = this.defaultOpen;
128
- }
129
- }
130
- if (changedProperties.has('expanded')) {
131
- this.updateAriaAttributes();
132
- this.updateBackgroundStyles();
133
- const prev = changedProperties.get('expanded');
134
- // React to expanded property changes
135
- if (!this.isAnimating && prev !== undefined && prev !== this.expanded) {
136
- if (this.expanded) {
137
- this.performExpand();
138
- }
139
- else {
140
- this.performCollapse();
141
- }
142
- }
143
- }
144
- // Se cambiano le proprietà di background, aggiorna gli stili
145
- if (changedProperties.has('backgroundActive') ||
146
- changedProperties.has('backgroundHover') ||
147
- changedProperties.has('leftIcon')) {
148
- this.updateBackgroundStyles();
149
- }
150
- }
151
- updateAriaAttributes() {
152
- // Se abbiamo il trigger di default, aggiorna quello
153
- const defaultButton = this.shadowRoot?.querySelector('.accordion-button');
154
- if (defaultButton) {
155
- defaultButton.setAttribute('aria-expanded', String(this.expanded));
156
- defaultButton.setAttribute('aria-controls', this._contentId);
157
- defaultButton.id = this._triggerId;
158
- }
159
- if (this.triggerElement) {
160
- if (this.triggerElement.tagName.toLowerCase() === 'button' ||
161
- this.triggerElement.getAttribute('role') === 'button') {
162
- const buttonElement = this.triggerElement;
163
- buttonElement.id = this._triggerId;
164
- buttonElement.setAttribute('aria-expanded', String(this.expanded));
165
- buttonElement.setAttribute('aria-controls', this._contentId);
166
- }
167
- else {
168
- // Cerca un button all'interno
169
- const nestedButton = this.triggerElement.querySelector('button, [role="button"]');
170
- if (nestedButton) {
171
- nestedButton.id = this._triggerId;
172
- nestedButton.setAttribute('aria-expanded', String(this.expanded));
173
- nestedButton.setAttribute('aria-controls', this._contentId);
174
- }
175
- }
176
- }
177
- // Aggiorna anche gli stili e le icone di chi implementa questo metodo via estensione
178
- this.updateBackgroundStyles();
179
- }
180
- // eslint-disable-next-line class-methods-use-this
181
- updateBackgroundStyles() { }
182
- performExpand() {
183
- if (!this.contentElement)
184
- return;
185
- this.cleanupAnimation();
186
- this.isAnimating = true;
187
- // Ensure overflow is hidden during animation
188
- this.contentElement.style.overflow = 'hidden';
189
- this.contentElement.style.visibility = 'visible';
190
- const startHeight = this.contentElement.offsetHeight;
191
- const endHeight = this.contentElement.scrollHeight;
192
- const duration = this.prefersReducedMotion ? 0 : this.animationDuration;
193
- this.animation = this.contentElement.animate([{ height: `${startHeight}px` }, { height: `${endHeight}px` }], {
194
- duration,
195
- easing: 'ease',
196
- });
197
- this.animation.finished
198
- .then(() => {
199
- this.contentElement.style.height = 'auto';
200
- // Keep overflow hidden as per CSS
201
- this.contentElement.style.overflow = 'hidden';
202
- })
203
- .catch(() => {
204
- // Animation cancelled
205
- })
206
- .finally(() => {
207
- this.cleanupAnimation();
208
- });
209
- }
210
- performCollapse() {
211
- if (!this.contentElement)
212
- return;
213
- this.cleanupAnimation();
214
- this.isAnimating = true;
215
- const el = this.contentElement;
216
- // Ensure overflow is hidden during animation
217
- el.style.overflow = 'hidden';
218
- const startHeight = el.scrollHeight;
219
- const endHeight = 0;
220
- const duration = this.prefersReducedMotion ? 0 : this.animationDuration;
221
- el.style.height = `${startHeight}px`;
222
- this.animation = el.animate([{ height: `${startHeight}px` }, { height: `${endHeight}px` }], {
223
- duration,
224
- easing: 'ease',
225
- });
226
- this.animation.finished
227
- .then(() => {
228
- el.style.height = '0px';
229
- el.style.visibility = 'hidden';
230
- el.style.overflow = 'hidden';
231
- })
232
- .catch(() => {
233
- // Animation cancelled
234
- })
235
- .finally(() => {
236
- this.cleanupAnimation();
237
- });
238
- }
239
- renderDefaultTrigger() {
240
- if (!this.label)
241
- return null;
242
- const buttonClasses = this.composeClass(!this.expanded && 'collapsed');
243
- const defaultButtonElement = html `<button
244
- type="button"
245
- part="trigger"
246
- class="${buttonClasses}"
247
- aria-expanded="${this.expanded}"
248
- aria-controls="${this._contentId}"
249
- id="${this._triggerId}"
250
- @click=${this.handleTriggerAction}
251
- @keydown=${this.handleTriggerAction}
252
- >
253
- ${this.label}
254
- </button>`;
255
- if (this.as === 'button') {
256
- return defaultButtonElement;
257
- }
258
- const tagName = this.isValidTag(this.as) ? this.as : 'div';
259
- const Tag = unsafeStatic(tagName);
260
- // eslint-disable-next-line lit/binding-positions, lit/no-invalid-html
261
- return html `<${Tag} part="trigger" role="button" aria-expanded="${this.expanded}" aria-controls="${this._contentId}" id="${this._triggerId}">${this.label}</${Tag}>`;
262
- }
263
- hasSlottedTrigger() {
264
- return !!this.triggerElement;
265
- }
266
- // eslint-disable-next-line class-methods-use-this
267
- isValidTag(tag) {
268
- return /^[a-z][a-z0-9-]+$/.test(tag); // semplice validazione
269
- }
270
- render() {
271
- // Nota sull'estensione: quando passi this.renderDefaultTrigger come callback a when
272
- // la funzione viene chiamata senza contesto (this viene perso) — devi chiamare il metodo tramite closure
273
- // che mantiene il contesto, es. () => this.renderDefaultTrigger().
274
- const hasCustomTrigger = this.hasSlottedTrigger();
275
- return html `
276
- <div class="accordion-item" part="accordion-item">
277
- <div class="collapse-wrapper">
278
- ${when(!hasCustomTrigger, () => this.renderDefaultTrigger())}
279
- <slot name="trigger" @slotchange=${this._onTriggerSlotChange} part="trigger"></slot>
280
- <div
281
- class="collapse-content"
282
- part="content"
283
- role="region"
284
- aria-labelledby="${this._triggerId}"
285
- id="${this._contentId}"
286
- >
287
- <div class="accordion-body">
288
- <slot name="content"></slot>
289
- </div>
290
- </div>
291
- </div>
292
- </div>
293
- `;
294
- }
295
- };
296
- ItCollapse.styles = styles;
297
- ItCollapse.shadowRootOptions = {
298
- ...BaseComponent.shadowRootOptions,
299
- delegatesFocus: true,
300
- };
301
- __decorate([
302
- property({ type: Boolean, reflect: true }),
303
- __metadata("design:type", Object)
304
- ], ItCollapse.prototype, "expanded", void 0);
305
- __decorate([
306
- property({ type: String }),
307
- __metadata("design:type", String)
308
- ], ItCollapse.prototype, "label", void 0);
309
- __decorate([
310
- property({ type: String }),
311
- __metadata("design:type", String)
312
- ], ItCollapse.prototype, "as", void 0);
313
- __decorate([
314
- property({ type: Boolean, attribute: 'default-open', reflect: true }),
315
- __metadata("design:type", Object)
316
- ], ItCollapse.prototype, "defaultOpen", void 0);
317
- __decorate([
318
- query('.collapse-content'),
319
- __metadata("design:type", HTMLElement)
320
- ], ItCollapse.prototype, "contentElement", void 0);
321
- __decorate([
322
- queryAssignedElements({ slot: 'trigger' }),
323
- __metadata("design:type", Array)
324
- ], ItCollapse.prototype, "triggerElements", void 0);
325
- ItCollapse = __decorate([
326
- customElement('it-collapse')
327
- ], ItCollapse);
328
-
329
- export { ItCollapse };
330
- //# sourceMappingURL=it-collapse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"it-collapse.js","sources":["../../../src/types.ts","../../../src/it-collapse.ts"],"sourcesContent":["export const HEADING_LEVELS = ['h2', 'h3', 'h4', 'h5', 'h6'] as const;\nexport const ACCORDION_MODES = ['single', 'multiple'] as const;\n\nexport type HeadingLevels = (typeof HEADING_LEVELS)[number];\nexport type TriggerTag = keyof HTMLElementTagNameMap;\nexport type PressEvent = MouseEvent | KeyboardEvent;\nexport const isMouseEvent = (event: PressEvent): event is MouseEvent => event instanceof MouseEvent;\nexport const isKeyboardEvent = (event: PressEvent): event is KeyboardEvent => event instanceof KeyboardEvent;\nexport type AccordionMode = (typeof ACCORDION_MODES)[number];\n","import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { when } from 'lit/directives/when.js';\nimport { unsafeStatic } from 'lit/static-html.js';\nimport styles from './collapse.scss';\nimport { isKeyboardEvent, isMouseEvent, PressEvent } from './types.js';\n\n// TODO: quando si sviluppa collapse come componente standalone, decoupling dalle classi di accordion, e aggiornare il part name\n@customElement('it-collapse')\nexport class ItCollapse extends BaseComponent {\n static styles = styles;\n\n static override shadowRootOptions = {\n ...BaseComponent.shadowRootOptions,\n delegatesFocus: true,\n };\n\n @property({ type: Boolean, reflect: true })\n expanded = false;\n\n @property({ type: String })\n label: string = '';\n\n @property({ type: String })\n as: string = 'button';\n\n @property({ type: Boolean, attribute: 'default-open', reflect: true })\n defaultOpen = false;\n\n @query('.collapse-content')\n contentElement!: HTMLElement;\n\n @queryAssignedElements({ slot: 'trigger' })\n private triggerElements!: HTMLElement[];\n\n get triggerElement(): HTMLElement | null {\n return this.triggerElements.length > 0 ? this.triggerElements[0] : null;\n }\n\n private isAnimating = false;\n\n private animation?: Animation;\n\n private readonly animationDuration = 350; // ms\n\n protected _triggerId = this.generateId('it-collapse-trigger');\n\n protected _contentId = this.generateId('it-collapse-content');\n\n override connectedCallback() {\n super.connectedCallback?.();\n // Initialize from default-open\n if (this.defaultOpen && !this.expanded) {\n this.expanded = this.defaultOpen;\n }\n }\n\n protected handleTriggerAction = (e: PressEvent) => {\n if (this.isAnimating) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (isKeyboardEvent(e) && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n this.toggle();\n } else if (isMouseEvent(e)) {\n e.preventDefault();\n this.toggle();\n }\n };\n\n async toggle() {\n // Blocca toggle durante animazione\n if (this.isAnimating) return;\n\n const nextValue = !this.expanded;\n this.expanded = nextValue;\n this.dispatchEvent(\n new CustomEvent('it-collapse-toggle', {\n detail: {\n expanded: this.expanded,\n id: this.contentElement?.id,\n },\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n }\n\n private setInitialState() {\n if (this.contentElement) {\n if (this.expanded) {\n this.contentElement.style.height = 'auto';\n this.contentElement.style.visibility = 'visible';\n } else {\n this.contentElement.style.height = '0px';\n this.contentElement.style.visibility = 'hidden';\n }\n }\n }\n\n private cleanupAnimation() {\n if (this.animation) {\n try {\n this.animation.cancel();\n } catch {\n /* ignore */\n }\n this.animation = undefined;\n }\n this.isAnimating = false;\n }\n\n override firstUpdated() {\n this.updateAriaAttributes();\n // Set initial state and ensure overflow is hidden\n this.setInitialState();\n }\n\n override updated(changedProperties: Map<string | number | symbol, unknown>): void {\n if (changedProperties.has('defaultOpen')) {\n if (this.defaultOpen && !this.expanded) {\n this.expanded = this.defaultOpen;\n }\n }\n\n if (changedProperties.has('expanded')) {\n this.updateAriaAttributes();\n this.updateBackgroundStyles();\n const prev = changedProperties.get('expanded') as boolean | undefined;\n\n // React to expanded property changes\n if (!this.isAnimating && prev !== undefined && prev !== this.expanded) {\n if (this.expanded) {\n this.performExpand();\n } else {\n this.performCollapse();\n }\n }\n }\n\n // Se cambiano le proprietà di background, aggiorna gli stili\n if (\n changedProperties.has('backgroundActive') ||\n changedProperties.has('backgroundHover') ||\n changedProperties.has('leftIcon')\n ) {\n this.updateBackgroundStyles();\n }\n }\n\n private updateAriaAttributes() {\n // Se abbiamo il trigger di default, aggiorna quello\n const defaultButton = this.shadowRoot?.querySelector('.accordion-button') as HTMLButtonElement;\n if (defaultButton) {\n defaultButton.setAttribute('aria-expanded', String(this.expanded));\n defaultButton.setAttribute('aria-controls', this._contentId);\n defaultButton.id = this._triggerId;\n }\n\n if (this.triggerElement) {\n if (\n this.triggerElement.tagName.toLowerCase() === 'button' ||\n this.triggerElement.getAttribute('role') === 'button'\n ) {\n const buttonElement = this.triggerElement as HTMLElement;\n buttonElement.id = this._triggerId;\n buttonElement.setAttribute('aria-expanded', String(this.expanded));\n buttonElement.setAttribute('aria-controls', this._contentId);\n } else {\n // Cerca un button all'interno\n const nestedButton = this.triggerElement.querySelector('button, [role=\"button\"]') as HTMLElement;\n if (nestedButton) {\n nestedButton.id = this._triggerId;\n nestedButton.setAttribute('aria-expanded', String(this.expanded));\n nestedButton.setAttribute('aria-controls', this._contentId);\n }\n }\n }\n // Aggiorna anche gli stili e le icone di chi implementa questo metodo via estensione\n this.updateBackgroundStyles();\n }\n\n // eslint-disable-next-line class-methods-use-this\n protected updateBackgroundStyles() {}\n\n private performExpand() {\n if (!this.contentElement) return;\n\n this.cleanupAnimation();\n this.isAnimating = true;\n\n // Ensure overflow is hidden during animation\n this.contentElement.style.overflow = 'hidden';\n this.contentElement.style.visibility = 'visible';\n const startHeight = this.contentElement.offsetHeight;\n const endHeight = this.contentElement.scrollHeight;\n const duration = this.prefersReducedMotion ? 0 : this.animationDuration;\n\n this.animation = this.contentElement.animate([{ height: `${startHeight}px` }, { height: `${endHeight}px` }], {\n duration,\n easing: 'ease',\n });\n\n this.animation.finished\n .then(() => {\n this.contentElement.style.height = 'auto';\n // Keep overflow hidden as per CSS\n this.contentElement.style.overflow = 'hidden';\n })\n .catch(() => {\n // Animation cancelled\n })\n .finally(() => {\n this.cleanupAnimation();\n });\n }\n\n private performCollapse() {\n if (!this.contentElement) return;\n\n this.cleanupAnimation();\n this.isAnimating = true;\n\n const el = this.contentElement;\n // Ensure overflow is hidden during animation\n el.style.overflow = 'hidden';\n const startHeight = el.scrollHeight;\n const endHeight = 0;\n const duration = this.prefersReducedMotion ? 0 : this.animationDuration;\n\n el.style.height = `${startHeight}px`;\n\n this.animation = el.animate([{ height: `${startHeight}px` }, { height: `${endHeight}px` }], {\n duration,\n easing: 'ease',\n });\n\n this.animation.finished\n .then(() => {\n el.style.height = '0px';\n el.style.visibility = 'hidden';\n el.style.overflow = 'hidden';\n })\n .catch(() => {\n // Animation cancelled\n })\n .finally(() => {\n this.cleanupAnimation();\n });\n }\n\n private _onTriggerSlotChange = () => {\n // Aggiorna gli attributi ARIA quando il contenuto dello slot cambia\n this.updateAriaAttributes();\n };\n\n protected renderDefaultTrigger() {\n if (!this.label) return null;\n\n const buttonClasses = this.composeClass(!this.expanded && 'collapsed');\n\n const defaultButtonElement = html`<button\n type=\"button\"\n part=\"trigger\"\n class=\"${buttonClasses}\"\n aria-expanded=\"${this.expanded}\"\n aria-controls=\"${this._contentId}\"\n id=\"${this._triggerId}\"\n @click=${this.handleTriggerAction}\n @keydown=${this.handleTriggerAction}\n >\n ${this.label}\n </button>`;\n\n if (this.as === 'button') {\n return defaultButtonElement;\n }\n const tagName = this.isValidTag(this.as) ? this.as : 'div';\n const Tag = unsafeStatic(tagName);\n // eslint-disable-next-line lit/binding-positions, lit/no-invalid-html\n return html`<${Tag} part=\"trigger\" role=\"button\" aria-expanded=\"${this.expanded}\" aria-controls=\"${this._contentId}\" id=\"${this._triggerId}\">${this.label}</${Tag}>`;\n }\n\n private hasSlottedTrigger(): boolean {\n return !!this.triggerElement;\n }\n\n // eslint-disable-next-line class-methods-use-this\n protected isValidTag(tag: string) {\n return /^[a-z][a-z0-9-]+$/.test(tag); // semplice validazione\n }\n\n render() {\n // Nota sull'estensione: quando passi this.renderDefaultTrigger come callback a when\n // la funzione viene chiamata senza contesto (this viene perso) — devi chiamare il metodo tramite closure\n // che mantiene il contesto, es. () => this.renderDefaultTrigger().\n const hasCustomTrigger = this.hasSlottedTrigger();\n return html`\n <div class=\"accordion-item\" part=\"accordion-item\">\n <div class=\"collapse-wrapper\">\n ${when(!hasCustomTrigger, () => this.renderDefaultTrigger())}\n <slot name=\"trigger\" @slotchange=${this._onTriggerSlotChange} part=\"trigger\"></slot>\n <div\n class=\"collapse-content\"\n part=\"content\"\n role=\"region\"\n aria-labelledby=\"${this._triggerId}\"\n id=\"${this._contentId}\"\n >\n <div class=\"accordion-body\">\n <slot name=\"content\"></slot>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-collapse': ItCollapse;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMO,MAAM,YAAY,GAAG,CAAC,KAAiB,KAA0B,KAAK,YAAY,UAAU;AAC5F,MAAM,eAAe,GAAG,CAAC,KAAiB,KAA6B,KAAK,YAAY,aAAa;;ACC5G;AAEO,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,aAAa,CAAA;AAAtC,IAAA,WAAA,GAAA;;QASL,IAAA,CAAA,QAAQ,GAAG,KAAK;QAGhB,IAAA,CAAA,KAAK,GAAW,EAAE;QAGlB,IAAA,CAAA,EAAE,GAAW,QAAQ;QAGrB,IAAA,CAAA,WAAW,GAAG,KAAK;QAYX,IAAA,CAAA,WAAW,GAAG,KAAK;AAIV,QAAA,IAAA,CAAA,iBAAiB,GAAG,GAAG,CAAC;AAE/B,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;AAEnD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,CAAC,UAAU,C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