@c2n/switch 0.0.11 → 0.0.13

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.
@@ -0,0 +1 @@
1
+ {"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"src/switch.ts","declarations":[{"kind":"class","description":"On/off toggle built on a native `<input type=\"checkbox\" role=\"switch\">`, so keyboard activation (Space), form value\nand the `switch` role come from the browser. The thumb can also be dragged: it follows the pointer and the side it is\nreleased on decides the state. The whole row is the label: text in the default slot and an optional `description`\nsit beside the track, and clicking them toggles it. Icons for either state can ride inside the thumb.","name":"Switch","cssProperties":[{"type":{"text":"pixel"},"description":"Space between the track and the text.","name":"--c2-switch__container--gap","default":"8px"},{"type":{"text":"flex-direction-row"},"description":"`row-reverse` puts the text before the track.","name":"--c2-switch__container--flex-direction","default":"row"},{"type":{"text":"justify-content"},"description":"`space-between` with a fixed width pushes the track to the far edge.","name":"--c2-switch__container--justify-content","default":"flex-start"},{"type":{"text":"opacity"},"name":"--c2-switch__container__disabled--opacity","default":"0.38"},{"type":{"text":"pixel"},"name":"--c2-switch__track--width","default":"36px"},{"type":{"text":"pixel"},"name":"--c2-switch__track--height","default":"20px"},{"type":{"text":"border-radius"},"name":"--c2-switch__track--border-radius","default":"999px"},{"type":{"text":"border"},"description":"Set a colour for an outlined switch.","name":"--c2-switch__track--border","default":"1px solid transparent"},{"type":{"text":"color"},"description":"Track fill while off.","name":"--c2-switch__track--color","default":"#e4e4e7"},{"type":{"text":"color"},"name":"--c2-switch__track__hover--color","default":"#d4d4d8"},{"type":{"text":"color"},"description":"Track fill while on.","name":"--c2-switch__track__checked--color","default":"#0265dc"},{"type":{"text":"color"},"name":"--c2-switch__track__checked__hover--color","default":"#0154b8"},{"type":{"text":"border"},"name":"--c2-switch__track__checked--border"},{"type":{"text":"outline"},"name":"--c2-switch__track__focus--outline","default":"2px solid rgba(2, 101, 220, 0.4)"},{"type":{"text":"pixel"},"name":"--c2-switch__track__focus--outline-offset","default":"2px"},{"type":{"text":"pixel"},"name":"--c2-switch__thumb--size","default":"16px"},{"type":{"text":"pixel"},"description":"Gap between the thumb and the track edge.","name":"--c2-switch__thumb--offset","default":"2px"},{"type":{"text":"border-radius"},"name":"--c2-switch__thumb--border-radius","default":"999px"},{"type":{"text":"color"},"name":"--c2-switch__thumb--color","default":"#ffffff"},{"type":{"text":"color"},"description":"Thumb fill while on; falls back to the off colour.","name":"--c2-switch__thumb__checked--color"},{"type":{"text":"box-shadow"},"name":"--c2-switch__thumb--box-shadow","default":"0 1px 2px rgba(0, 0, 0, 0.2)"},{"type":{"text":"pixel"},"description":"Extra thumb width while pressed, for a squishy feel; `0px` disables it.","name":"--c2-switch__thumb__active--stretch","default":"4px"},{"type":{"text":"pixel"},"name":"--c2-switch__icon--size","default":"10px"},{"type":{"text":"color"},"description":"Colour of the `unchecked-icon`.","name":"--c2-switch__icon--color","default":"#71717a"},{"type":{"text":"color"},"description":"Colour of the `checked-icon`.","name":"--c2-switch__icon__checked--color","default":"#0265dc"},{"type":{"text":"color"},"name":"--c2-switch__label--color","default":"inherit"},{"type":{"text":"font-size"},"name":"--c2-switch__label--font-size","default":"inherit"},{"type":{"text":"font-weight"},"name":"--c2-switch__label--font-weight","default":"inherit"},{"type":{"text":"line-height"},"name":"--c2-switch__label--line-height","default":"inherit"},{"type":{"text":"color"},"name":"--c2-switch__description--color","default":"#71717a"},{"type":{"text":"font-size"},"name":"--c2-switch__description--font-size","default":"12px"},{"type":{"text":"pixel"},"name":"--c2-switch__description--margin-top","default":"2px"},{"type":{"text":"time"},"description":"Thumb slide and colour change.","name":"--c2-switch--transition-duration","default":"200ms"}],"cssParts":[{"name":"control","description":"Shadow DOM styling hook for the control element."},{"name":"track","description":"Shadow DOM styling hook for the track element."},{"name":"thumb","description":"Shadow DOM styling hook for the thumb element."},{"name":"unchecked-icon","description":"Shadow DOM styling hook for the unchecked icon element."},{"name":"checked-icon","description":"Shadow DOM styling hook for the checked icon element."},{"name":"label","description":"Shadow DOM styling hook for the label element."},{"name":"description","description":"Shadow DOM styling hook for the description element."}],"slots":[{"description":"Label text. Falls back to the `label` attribute.","name":""},{"description":"Supporting text shown under the label.","name":"description"},{"description":"Small icon shown inside the thumb while on (an inline SVG, a `c2-feather-*` icon or a `c2-mat-icon`).","name":"checked-icon"},{"description":"Small icon shown inside the thumb while off.","name":"unchecked-icon"}],"members":[{"kind":"field","name":"formAssociated","type":{"text":"boolean"},"static":true,"default":"true"},{"kind":"field","name":"internals","privacy":"private","readonly":true},{"kind":"field","name":"customValidityMessage","type":{"text":"string"},"privacy":"private","default":"''"},{"kind":"field","name":"disabledByForm","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"defaultChecked","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"defaultCheckedCaptured","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"formElement","type":{"text":"HTMLInputElement"},"privacy":"protected"},{"kind":"field","name":"trackElement","type":{"text":"HTMLElement"},"privacy":"private"},{"kind":"field","name":"thumbElement","type":{"text":"HTMLElement"},"privacy":"private"},{"kind":"field","name":"checked","type":{"text":"boolean"},"default":"false","description":"Whether the switch is on.","attribute":"checked","reflects":true},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the control: it no longer toggles and is rendered dimmed.","attribute":"disabled","reflects":true},{"kind":"field","name":"name","type":{"text":"string"},"default":"''","description":"Form field name forwarded to the inner input.","attribute":"name"},{"kind":"field","name":"value","type":{"text":"string"},"default":"'on'","description":"Form value submitted while on. Defaults to `on`, like a native checkbox.","attribute":"value"},{"kind":"field","name":"required","type":{"text":"boolean"},"default":"false","description":"Requires the switch to be on for the form to be valid.","attribute":"required","reflects":true},{"kind":"field","name":"label","type":{"text":"string"},"default":"''","description":"Label text when the default slot is empty.","attribute":"label"},{"kind":"field","name":"ariaLabel","type":{"text":"string"},"description":"Accessible name used when no visible label names the switch.","attribute":"aria-label"},{"kind":"field","name":"ariaLabelledBy","type":{"text":"undefined | string"},"description":"Id of the element that labels the switch.","attribute":"aria-labelledby"},{"kind":"field","name":"ariaDescribedBy","type":{"text":"undefined | string"},"description":"Id of the element that describes the switch.","attribute":"aria-describedby"},{"kind":"field","name":"hasDescription","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"dragging","type":{"text":"boolean"},"privacy":"private","default":"false","description":"True while the thumb follows the pointer; disables the slide transition."},{"kind":"field","name":"drag","type":{"text":"{ pointerId: number; startX: number; startPosition: number; travel: number; position: number; moved: boolean } | undefined"},"privacy":"private"},{"kind":"field","name":"suppressClick","type":{"text":"boolean"},"privacy":"private","default":"false","description":"The click that follows a drag must not toggle the input again."},{"kind":"field","name":"form","description":"The containing form, when this control is associated with one.","readonly":true},{"kind":"field","name":"labels","description":"Labels associated with this form control.","readonly":true},{"kind":"field","name":"validity","readonly":true},{"kind":"field","name":"validationMessage","readonly":true},{"kind":"field","name":"willValidate","readonly":true},{"kind":"method","name":"formResetCallback"},{"kind":"method","name":"formDisabledCallback","parameters":[{"name":"disabled","type":{"text":"boolean"}}]},{"kind":"method","name":"formStateRestoreCallback","parameters":[{"name":"state","type":{"text":"string | File | FormData | null"}}]},{"kind":"method","name":"checkValidity"},{"kind":"method","name":"reportValidity"},{"kind":"method","name":"setCustomValidity","parameters":[{"name":"message","type":{"text":"string"}}]},{"kind":"method","name":"focus","parameters":[{"name":"options","optional":true,"type":{"text":"FocusOptions"}}]},{"kind":"method","name":"toggle","parameters":[{"name":"force","optional":true,"type":{"text":"boolean"}}],"description":"Flips the state (or forces it) and fires `change`, as a click would."},{"kind":"field","name":"effectiveDisabled","privacy":"private","readonly":true},{"kind":"method","name":"handleDescriptionChange","privacy":"private","parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"updateDescription","privacy":"private","parameters":[{"name":"slot","type":{"text":"HTMLSlotElement"}}]},{"kind":"method","name":"handleChange","privacy":"private","parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"field","name":"rtl","type":{"text":"boolean"},"privacy":"private","readonly":true},{"kind":"method","name":"handlePointerDown","privacy":"private","parameters":[{"name":"event","type":{"text":"PointerEvent"}}]},{"kind":"method","name":"handlePointerMove","privacy":"private","parameters":[{"name":"event","type":{"text":"PointerEvent"}}]},{"kind":"method","name":"handlePointerUp","privacy":"private","parameters":[{"name":"event","type":{"text":"PointerEvent"}}]},{"kind":"method","name":"handlePointerCancel","privacy":"private","parameters":[{"name":"event","type":{"text":"PointerEvent"}}]},{"kind":"method","name":"endDrag","privacy":"private"},{"kind":"method","name":"handleClick","privacy":"private","parameters":[{"name":"event","type":{"text":"Event"}}]}],"events":[{"name":"change","type":{"text":"Event"},"description":"Re-dispatched from the inner input when the state changes."}],"attributes":[{"name":"checked","type":{"text":"boolean"},"default":"false","description":"Whether the switch is on.","fieldName":"checked"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the control: it no longer toggles and is rendered dimmed.","fieldName":"disabled"},{"name":"name","type":{"text":"string"},"default":"''","description":"Form field name forwarded to the inner input.","fieldName":"name"},{"name":"value","type":{"text":"string"},"default":"'on'","description":"Form value submitted while on. Defaults to `on`, like a native checkbox.","fieldName":"value"},{"name":"required","type":{"text":"boolean"},"default":"false","description":"Requires the switch to be on for the form to be valid.","fieldName":"required"},{"name":"label","type":{"text":"string"},"default":"''","description":"Label text when the default slot is empty.","fieldName":"label"},{"name":"aria-label","type":{"text":"string"},"description":"Accessible name used when no visible label names the switch.","fieldName":"ariaLabel"},{"name":"aria-labelledby","type":{"text":"undefined | string"},"description":"Id of the element that labels the switch.","fieldName":"ariaLabelledBy"},{"name":"aria-describedby","type":{"text":"undefined | string"},"description":"Id of the element that describes the switch.","fieldName":"ariaDescribedBy"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-switch","customElement":true}],"exports":[{"kind":"js","name":"Switch","declaration":{"name":"Switch","module":"src/switch.ts"}},{"kind":"custom-element-definition","name":"c2-switch","declaration":{"name":"Switch","module":"src/switch.ts"}}]}]}
package/dist/switch.js CHANGED
@@ -3,7 +3,7 @@ import { property, query, state } from "lit/decorators.js";
3
3
  import { customElement } from "@c2n/core/element-helper.js";
4
4
  import { classMap } from "lit/directives/class-map.js";
5
5
  import { ifDefined } from "lit/directives/if-defined.js";
6
- import { redispatchEvent } from "@c2n/core/dom-helper.js";
6
+ import { hasSlottedContent, redispatchEvent } from "@c2n/core/dom-helper.js";
7
7
  //#region src/switch.scss?inline
8
8
  var switch_default = "/* ex : var((width: 24px), width, c2-checkbox) returns var(--c2-checkbox-width, 24px) */\n:host {\n display: inline-flex;\n vertical-align: middle;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.c2-switch {\n display: inline-flex;\n align-items: center;\n flex: 1;\n min-width: 0;\n flex-direction: var(--c2-switch__container--flex-direction,row);\n justify-content: var(--c2-switch__container--justify-content,flex-start);\n gap: var(--c2-switch__container--gap,8px);\n cursor: pointer;\n}\n.c2-switch.has-description {\n align-items: flex-start;\n}\n.c2-switch:has(.c2-switch-input:disabled) {\n cursor: default;\n opacity: var(--c2-switch__container__disabled--opacity,0.38);\n}\n\n.c2-switch-control {\n position: relative;\n display: inline-flex;\n flex: none;\n line-height: 0;\n}\n\n.c2-switch-input {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n opacity: 0;\n cursor: inherit;\n z-index: 1;\n touch-action: pan-y;\n}\n\n.c2-switch-track {\n position: relative;\n display: inline-flex;\n align-items: center;\n box-sizing: border-box;\n width: var(--c2-switch__track--width,36px);\n height: var(--c2-switch__track--height,20px);\n padding: var(--c2-switch__thumb--offset,2px);\n border-radius: var(--c2-switch__track--border-radius,999px);\n border: var(--c2-switch__track--border,1px solid transparent);\n background-color: var(--c2-switch__track--color,#e4e4e7);\n transition: background-color var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1), border-color var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1);\n}\n\n.c2-switch-thumb {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--c2-switch__thumb--size,16px);\n height: var(--c2-switch__thumb--size,16px);\n border-radius: var(--c2-switch__thumb--border-radius,999px);\n background-color: var(--c2-switch__thumb--color,#ffffff);\n box-shadow: var(--c2-switch__thumb--box-shadow,0 1px 2px rgba(0, 0, 0, 0.2));\n transform: translateX(0);\n transition: transform var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1), width var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1), background-color var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1);\n}\n\n.c2-switch-icon {\n position: absolute;\n inset: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 0;\n color: var(--c2-switch__icon--color,#71717a);\n opacity: 1;\n transition: opacity var(--c2-switch--transition-duration,200ms) cubic-bezier(0.2, 0, 0, 1);\n --c2-feather-icon--size: var(--c2-switch__icon--size,10px);\n --c2-mat-icon--font-size: var(--c2-switch__icon--size,10px);\n}\n.c2-switch-icon ::slotted(*) {\n width: var(--c2-switch__icon--size,10px);\n height: var(--c2-switch__icon--size,10px);\n}\n\n.c2-switch-icon--checked {\n color: var(--c2-switch__icon__checked--color,#0265dc);\n opacity: 0;\n}\n\n.c2-switch-input:checked ~ .c2-switch-track {\n background-color: var(--c2-switch__track__checked--color,#0265dc);\n border: var(--c2-switch__track__checked--border,var(--c2-switch__track--border,1px solid transparent));\n}\n.c2-switch-input:checked ~ .c2-switch-track .c2-switch-thumb {\n transform: translateX(calc(var(--c2-switch__track--width,36px) - var(--c2-switch__thumb--size,16px) - 2 * var(--c2-switch__thumb--offset,2px)));\n background-color: var(--c2-switch__thumb__checked--color,var(--c2-switch__thumb--color,#ffffff));\n}\n.c2-switch-input:checked ~ .c2-switch-track .c2-switch-icon--unchecked {\n opacity: 0;\n}\n.c2-switch-input:checked ~ .c2-switch-track .c2-switch-icon--checked {\n opacity: 1;\n}\n\n.c2-switch-input:enabled:hover ~ .c2-switch-track {\n background-color: var(--c2-switch__track__hover--color,var(--c2-switch__track--color,#d4d4d8));\n}\n\n.c2-switch-input:enabled:checked:hover ~ .c2-switch-track {\n background-color: var(--c2-switch__track__checked__hover--color,var(--c2-switch__track__checked--color,#0154b8));\n}\n\n.c2-switch:not(.is-dragging) .c2-switch-input:enabled:active ~ .c2-switch-track .c2-switch-thumb {\n width: calc(var(--c2-switch__thumb--size,16px) + var(--c2-switch__thumb__active--stretch,4px));\n}\n\n.c2-switch:not(.is-dragging) .c2-switch-input:enabled:active:checked ~ .c2-switch-track .c2-switch-thumb {\n transform: translateX(calc(calc(var(--c2-switch__track--width,36px) - var(--c2-switch__thumb--size,16px) - 2 * var(--c2-switch__thumb--offset,2px)) - var(--c2-switch__thumb__active--stretch,4px)));\n}\n\n.c2-switch.is-dragging .c2-switch-input ~ .c2-switch-track .c2-switch-thumb {\n transition: none;\n width: var(--c2-switch__thumb--size,16px);\n transform: translateX(var(--_drag, 0px));\n}\n\n.c2-switch-input:focus-visible ~ .c2-switch-track {\n outline: var(--c2-switch__track__focus--outline,2px solid rgba(2, 101, 220, 0.4));\n outline-offset: var(--c2-switch__track__focus--outline-offset,2px);\n}\n\n.c2-switch-text {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.c2-switch-label {\n color: var(--c2-switch__label--color,inherit);\n font-size: var(--c2-switch__label--font-size,inherit);\n font-weight: var(--c2-switch__label--font-weight,inherit);\n line-height: var(--c2-switch__label--line-height,inherit);\n}\n\n.has-description .c2-switch-label {\n display: flex;\n align-items: center;\n min-height: var(--c2-switch__track--height,20px);\n}\n\n.c2-switch-description {\n color: var(--c2-switch__description--color,#71717a);\n font-size: var(--c2-switch__description--font-size,12px);\n margin-top: var(--c2-switch__description--margin-top,2px);\n line-height: 1.4;\n}\n.c2-switch-description[hidden] {\n display: none;\n}\n\n:host(:dir(rtl)) .c2-switch-input:checked ~ .c2-switch-track .c2-switch-thumb {\n transform: translateX(calc(-1 * calc(var(--c2-switch__track--width,36px) - var(--c2-switch__thumb--size,16px) - 2 * var(--c2-switch__thumb--offset,2px))));\n}\n\n:host(:dir(rtl)) .c2-switch:not(.is-dragging) .c2-switch-input:enabled:active:checked ~ .c2-switch-track .c2-switch-thumb {\n transform: translateX(calc(-1 * (calc(var(--c2-switch__track--width,36px) - var(--c2-switch__thumb--size,16px) - 2 * var(--c2-switch__thumb--offset,2px)) - var(--c2-switch__thumb__active--stretch,4px))));\n}\n\n@media (prefers-reduced-motion: reduce) {\n .c2-switch-track,\n .c2-switch-thumb,\n .c2-switch-icon {\n transition: none;\n }\n}";
9
9
  //#endregion
@@ -97,10 +97,8 @@ var Switch = class Switch extends LitElement {
97
97
  composed: true
98
98
  }));
99
99
  }
100
- /** `slotchange` does not fire for server-rendered slots, so read the description once after the first render. */
101
- firstUpdated() {
102
- const slot = this.renderRoot.querySelector("slot[name=\"description\"]");
103
- if (slot) this.updateDescription(slot);
100
+ willUpdate(_changed) {
101
+ if (!this.hasUpdated) this.hasDescription = hasSlottedContent(this, "description");
104
102
  }
105
103
  update(changed) {
106
104
  if (changed.has("checked") && this.formElement) this.formElement.checked = this.checked;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/switch",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": "dist/switch.js",
6
6
  "exports": {
@@ -21,6 +21,7 @@
21
21
  "files": [
22
22
  "dist",
23
23
  "types",
24
+ "custom-elements.json",
24
25
  "react.d.ts",
25
26
  "react.js",
26
27
  "vue.d.ts",
@@ -62,12 +63,12 @@
62
63
  }
63
64
  },
64
65
  "dependencies": {
65
- "@c2n/core": "0.0.11",
66
+ "@c2n/core": "0.0.13",
66
67
  "lit": "3.3.3"
67
68
  },
68
69
  "devDependencies": {
69
70
  "@c2n/config": "*"
70
71
  },
71
72
  "customElements": "custom-elements.json",
72
- "gitHead": "bf962fba5e49a0ac7555a082584e262949d323a5"
73
+ "gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
73
74
  }
package/react.d.ts CHANGED
@@ -6,17 +6,27 @@
6
6
  //
7
7
  // Register the elements at module scope before React renders, or React writes an object prop as an
8
8
  // attribute and it stringifies.
9
+ //
10
+ // On a server-rendered page (Next.js, React Router SSR) write a camelCase property by its kebab-case attribute
11
+ // name ('row-key', not rowKey): the server emits props verbatim, HTML lowercases them, and hydration does not
12
+ // set properties. Those names are listed next to the properties below.
9
13
 
10
14
  import type { DetailedHTMLProps, HTMLAttributes } from 'react'
11
15
  import type { Switch } from '@c2n/switch'
12
16
 
13
17
  /** Standard React host-element attributes plus the element's own public properties. */
14
18
  type C2Props<T> = DetailedHTMLProps<HTMLAttributes<T>, T> & Partial<Omit<T, keyof HTMLElement>>
19
+ /** What React writes to a custom element's attribute: true becomes the empty string, false removes it. */
20
+ type Attribute = string | number | boolean
15
21
 
16
22
  declare module 'react' {
17
23
  namespace JSX {
18
24
  interface IntrinsicElements {
19
- 'c2-switch': C2Props<Switch>
25
+ 'c2-switch': C2Props<Switch> & {
26
+ 'aria-label'?: Attribute
27
+ 'aria-labelledby'?: Attribute
28
+ 'aria-describedby'?: Attribute
29
+ }
20
30
  }
21
31
  }
22
32
  }
@@ -114,8 +114,7 @@ export declare class Switch extends LitElement {
114
114
  focus(options?: FocusOptions): void;
115
115
  /** Flips the state (or forces it) and fires `change`, as a click would. */
116
116
  toggle(force?: boolean): void;
117
- /** `slotchange` does not fire for server-rendered slots, so read the description once after the first render. */
118
- firstUpdated(): void;
117
+ protected willUpdate(_changed: PropertyValues<this>): void;
119
118
  protected update(changed: PropertyValues<this>): void;
120
119
  protected updated(_changed: PropertyValues<this>): void;
121
120
  private get effectiveDisabled();
@@ -1 +1 @@
1
- {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/switch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,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