@adminiumjs/i18n 0.1.2 → 0.2.2-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 (241) hide show
  1. package/dist/a11y-keys.d.ts +17 -0
  2. package/dist/a11y-keys.d.ts.map +1 -0
  3. package/dist/a11y-keys.js +479 -0
  4. package/dist/a11y-keys.js.map +1 -0
  5. package/dist/create-i18n.d.ts.map +1 -1
  6. package/dist/create-i18n.js +38 -4
  7. package/dist/create-i18n.js.map +1 -1
  8. package/dist/editing.d.ts +17 -0
  9. package/dist/editing.d.ts.map +1 -0
  10. package/dist/editing.js +17 -0
  11. package/dist/editing.js.map +1 -0
  12. package/dist/fallback.d.ts +24 -0
  13. package/dist/fallback.d.ts.map +1 -0
  14. package/dist/fallback.js +41 -0
  15. package/dist/fallback.js.map +1 -0
  16. package/dist/format/index.d.ts.map +1 -1
  17. package/dist/format/index.js +1 -0
  18. package/dist/format/index.js.map +1 -1
  19. package/dist/format-errors.d.ts +41 -0
  20. package/dist/format-errors.d.ts.map +1 -0
  21. package/dist/format-errors.js +64 -0
  22. package/dist/format-errors.js.map +1 -0
  23. package/dist/icu-format.d.ts +4 -0
  24. package/dist/icu-format.d.ts.map +1 -1
  25. package/dist/icu-format.js +44 -3
  26. package/dist/icu-format.js.map +1 -1
  27. package/dist/index.d.ts +10 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +15 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/keys.d.ts +33 -0
  32. package/dist/keys.d.ts.map +1 -0
  33. package/dist/keys.js +78 -0
  34. package/dist/keys.js.map +1 -0
  35. package/dist/locales.d.ts +106 -13
  36. package/dist/locales.d.ts.map +1 -1
  37. package/dist/locales.js +147 -17
  38. package/dist/locales.js.map +1 -1
  39. package/dist/overrides.d.ts +62 -0
  40. package/dist/overrides.d.ts.map +1 -0
  41. package/dist/overrides.js +113 -0
  42. package/dist/overrides.js.map +1 -0
  43. package/dist/react.d.ts +6 -0
  44. package/dist/react.d.ts.map +1 -1
  45. package/dist/react.js +18 -26
  46. package/dist/react.js.map +1 -1
  47. package/dist/resources/ar-eg/common.d.ts +786 -3
  48. package/dist/resources/ar-eg/common.d.ts.map +1 -1
  49. package/dist/resources/ar-eg/common.js +813 -29
  50. package/dist/resources/ar-eg/common.js.map +1 -1
  51. package/dist/resources/ar-eg/errors.d.ts +1 -0
  52. package/dist/resources/ar-eg/errors.d.ts.map +1 -1
  53. package/dist/resources/ar-eg/errors.js +2 -0
  54. package/dist/resources/ar-eg/errors.js.map +1 -1
  55. package/dist/resources/ar-eg/generated.d.ts.map +1 -1
  56. package/dist/resources/ar-eg/generated.js +1 -0
  57. package/dist/resources/ar-eg/generated.js.map +1 -1
  58. package/dist/resources/ar-eg/studio.d.ts.map +1 -1
  59. package/dist/resources/ar-eg/studio.js +1 -0
  60. package/dist/resources/ar-eg/studio.js.map +1 -1
  61. package/dist/resources/ar-eg/ui.d.ts +586 -586
  62. package/dist/resources/ar-eg/ui.d.ts.map +1 -1
  63. package/dist/resources/ar-eg/ui.js +587 -586
  64. package/dist/resources/ar-eg/ui.js.map +1 -1
  65. package/dist/resources/cs-cz/common.d.ts +786 -3
  66. package/dist/resources/cs-cz/common.d.ts.map +1 -1
  67. package/dist/resources/cs-cz/common.js +811 -27
  68. package/dist/resources/cs-cz/common.js.map +1 -1
  69. package/dist/resources/cs-cz/errors.d.ts +1 -0
  70. package/dist/resources/cs-cz/errors.d.ts.map +1 -1
  71. package/dist/resources/cs-cz/errors.js +2 -0
  72. package/dist/resources/cs-cz/errors.js.map +1 -1
  73. package/dist/resources/cs-cz/generated.d.ts.map +1 -1
  74. package/dist/resources/cs-cz/generated.js +1 -0
  75. package/dist/resources/cs-cz/generated.js.map +1 -1
  76. package/dist/resources/cs-cz/studio.d.ts.map +1 -1
  77. package/dist/resources/cs-cz/studio.js +1 -0
  78. package/dist/resources/cs-cz/studio.js.map +1 -1
  79. package/dist/resources/cs-cz/ui.d.ts +582 -582
  80. package/dist/resources/cs-cz/ui.d.ts.map +1 -1
  81. package/dist/resources/cs-cz/ui.js +583 -582
  82. package/dist/resources/cs-cz/ui.js.map +1 -1
  83. package/dist/resources/da-dk/common.d.ts +787 -4
  84. package/dist/resources/da-dk/common.d.ts.map +1 -1
  85. package/dist/resources/da-dk/common.js +814 -30
  86. package/dist/resources/da-dk/common.js.map +1 -1
  87. package/dist/resources/da-dk/errors.d.ts +1 -0
  88. package/dist/resources/da-dk/errors.d.ts.map +1 -1
  89. package/dist/resources/da-dk/errors.js +2 -0
  90. package/dist/resources/da-dk/errors.js.map +1 -1
  91. package/dist/resources/da-dk/generated.d.ts.map +1 -1
  92. package/dist/resources/da-dk/generated.js +1 -0
  93. package/dist/resources/da-dk/generated.js.map +1 -1
  94. package/dist/resources/da-dk/studio.d.ts.map +1 -1
  95. package/dist/resources/da-dk/studio.js +1 -0
  96. package/dist/resources/da-dk/studio.js.map +1 -1
  97. package/dist/resources/da-dk/ui.d.ts +568 -568
  98. package/dist/resources/da-dk/ui.d.ts.map +1 -1
  99. package/dist/resources/da-dk/ui.js +569 -568
  100. package/dist/resources/da-dk/ui.js.map +1 -1
  101. package/dist/resources/de-de/common.d.ts +790 -7
  102. package/dist/resources/de-de/common.d.ts.map +1 -1
  103. package/dist/resources/de-de/common.js +817 -33
  104. package/dist/resources/de-de/common.js.map +1 -1
  105. package/dist/resources/de-de/errors.d.ts +1 -0
  106. package/dist/resources/de-de/errors.d.ts.map +1 -1
  107. package/dist/resources/de-de/errors.js +2 -0
  108. package/dist/resources/de-de/errors.js.map +1 -1
  109. package/dist/resources/de-de/generated.d.ts.map +1 -1
  110. package/dist/resources/de-de/generated.js +1 -0
  111. package/dist/resources/de-de/generated.js.map +1 -1
  112. package/dist/resources/de-de/studio.d.ts.map +1 -1
  113. package/dist/resources/de-de/studio.js +1 -0
  114. package/dist/resources/de-de/studio.js.map +1 -1
  115. package/dist/resources/de-de/ui.d.ts +569 -569
  116. package/dist/resources/de-de/ui.d.ts.map +1 -1
  117. package/dist/resources/de-de/ui.js +570 -569
  118. package/dist/resources/de-de/ui.js.map +1 -1
  119. package/dist/resources/en-us/common.d.ts +786 -3
  120. package/dist/resources/en-us/common.d.ts.map +1 -1
  121. package/dist/resources/en-us/common.js +813 -29
  122. package/dist/resources/en-us/common.js.map +1 -1
  123. package/dist/resources/en-us/errors.d.ts +1 -0
  124. package/dist/resources/en-us/errors.d.ts.map +1 -1
  125. package/dist/resources/en-us/errors.js +2 -0
  126. package/dist/resources/en-us/errors.js.map +1 -1
  127. package/dist/resources/en-us/generated.d.ts.map +1 -1
  128. package/dist/resources/en-us/generated.js +1 -0
  129. package/dist/resources/en-us/generated.js.map +1 -1
  130. package/dist/resources/en-us/studio.d.ts.map +1 -1
  131. package/dist/resources/en-us/studio.js +1 -0
  132. package/dist/resources/en-us/studio.js.map +1 -1
  133. package/dist/resources/en-us/ui.d.ts.map +1 -1
  134. package/dist/resources/en-us/ui.js +1 -0
  135. package/dist/resources/en-us/ui.js.map +1 -1
  136. package/dist/resources/fr-fr/common.d.ts +788 -5
  137. package/dist/resources/fr-fr/common.d.ts.map +1 -1
  138. package/dist/resources/fr-fr/common.js +815 -31
  139. package/dist/resources/fr-fr/common.js.map +1 -1
  140. package/dist/resources/fr-fr/errors.d.ts +1 -0
  141. package/dist/resources/fr-fr/errors.d.ts.map +1 -1
  142. package/dist/resources/fr-fr/errors.js +2 -0
  143. package/dist/resources/fr-fr/errors.js.map +1 -1
  144. package/dist/resources/fr-fr/generated.d.ts.map +1 -1
  145. package/dist/resources/fr-fr/generated.js +1 -0
  146. package/dist/resources/fr-fr/generated.js.map +1 -1
  147. package/dist/resources/fr-fr/studio.d.ts.map +1 -1
  148. package/dist/resources/fr-fr/studio.js +1 -0
  149. package/dist/resources/fr-fr/studio.js.map +1 -1
  150. package/dist/resources/fr-fr/ui.d.ts +559 -559
  151. package/dist/resources/fr-fr/ui.d.ts.map +1 -1
  152. package/dist/resources/fr-fr/ui.js +560 -559
  153. package/dist/resources/fr-fr/ui.js.map +1 -1
  154. package/dist/resources/index.d.ts.map +1 -1
  155. package/dist/resources/index.js +1 -0
  156. package/dist/resources/index.js.map +1 -1
  157. package/dist/resources/lazy.d.ts.map +1 -1
  158. package/dist/resources/lazy.js.map +1 -1
  159. package/dist/resources/zh-cn/common.d.ts +787 -4
  160. package/dist/resources/zh-cn/common.d.ts.map +1 -1
  161. package/dist/resources/zh-cn/common.js +814 -30
  162. package/dist/resources/zh-cn/common.js.map +1 -1
  163. package/dist/resources/zh-cn/errors.d.ts +1 -0
  164. package/dist/resources/zh-cn/errors.d.ts.map +1 -1
  165. package/dist/resources/zh-cn/errors.js +2 -0
  166. package/dist/resources/zh-cn/errors.js.map +1 -1
  167. package/dist/resources/zh-cn/generated.d.ts.map +1 -1
  168. package/dist/resources/zh-cn/generated.js +1 -0
  169. package/dist/resources/zh-cn/generated.js.map +1 -1
  170. package/dist/resources/zh-cn/studio.d.ts.map +1 -1
  171. package/dist/resources/zh-cn/studio.js +1 -0
  172. package/dist/resources/zh-cn/studio.js.map +1 -1
  173. package/dist/resources/zh-cn/ui.d.ts +575 -575
  174. package/dist/resources/zh-cn/ui.d.ts.map +1 -1
  175. package/dist/resources/zh-cn/ui.js +576 -575
  176. package/dist/resources/zh-cn/ui.js.map +1 -1
  177. package/dist/resources/zh-tw/common.d.ts +786 -3
  178. package/dist/resources/zh-tw/common.d.ts.map +1 -1
  179. package/dist/resources/zh-tw/common.js +813 -29
  180. package/dist/resources/zh-tw/common.js.map +1 -1
  181. package/dist/resources/zh-tw/errors.d.ts +1 -0
  182. package/dist/resources/zh-tw/errors.d.ts.map +1 -1
  183. package/dist/resources/zh-tw/errors.js +2 -0
  184. package/dist/resources/zh-tw/errors.js.map +1 -1
  185. package/dist/resources/zh-tw/generated.d.ts.map +1 -1
  186. package/dist/resources/zh-tw/generated.js +1 -0
  187. package/dist/resources/zh-tw/generated.js.map +1 -1
  188. package/dist/resources/zh-tw/studio.d.ts.map +1 -1
  189. package/dist/resources/zh-tw/studio.js +1 -0
  190. package/dist/resources/zh-tw/studio.js.map +1 -1
  191. package/dist/resources/zh-tw/ui.d.ts +575 -575
  192. package/dist/resources/zh-tw/ui.d.ts.map +1 -1
  193. package/dist/resources/zh-tw/ui.js +576 -575
  194. package/dist/resources/zh-tw/ui.js.map +1 -1
  195. package/dist/review-status.d.ts +55 -0
  196. package/dist/review-status.d.ts.map +1 -0
  197. package/dist/review-status.js +60 -0
  198. package/dist/review-status.js.map +1 -0
  199. package/dist/revision.d.ts +35 -0
  200. package/dist/revision.d.ts.map +1 -0
  201. package/dist/revision.js +56 -0
  202. package/dist/revision.js.map +1 -0
  203. package/dist/server.d.ts +36 -0
  204. package/dist/server.d.ts.map +1 -0
  205. package/dist/server.js +36 -0
  206. package/dist/server.js.map +1 -0
  207. package/dist/validate-message.d.ts +57 -0
  208. package/dist/validate-message.d.ts.map +1 -0
  209. package/dist/validate-message.js +179 -0
  210. package/dist/validate-message.js.map +1 -0
  211. package/locales/ar-EG/.meta.json +13246 -0
  212. package/locales/ar-EG/common.json +812 -29
  213. package/locales/ar-EG/errors.json +1 -0
  214. package/locales/ar-EG/ui.json +586 -586
  215. package/locales/cs-CZ/.meta.json +13246 -0
  216. package/locales/cs-CZ/common.json +810 -27
  217. package/locales/cs-CZ/errors.json +1 -0
  218. package/locales/cs-CZ/ui.json +582 -582
  219. package/locales/da-DK/.meta.json +13246 -0
  220. package/locales/da-DK/common.json +813 -30
  221. package/locales/da-DK/errors.json +1 -0
  222. package/locales/da-DK/ui.json +568 -568
  223. package/locales/de-DE/.meta.json +13246 -0
  224. package/locales/de-DE/common.json +816 -33
  225. package/locales/de-DE/errors.json +1 -0
  226. package/locales/de-DE/ui.json +569 -569
  227. package/locales/en-US/common.json +812 -29
  228. package/locales/en-US/errors.json +1 -0
  229. package/locales/fr-FR/.meta.json +13246 -0
  230. package/locales/fr-FR/common.json +814 -31
  231. package/locales/fr-FR/errors.json +1 -0
  232. package/locales/fr-FR/ui.json +559 -559
  233. package/locales/zh-CN/.meta.json +13246 -0
  234. package/locales/zh-CN/common.json +813 -30
  235. package/locales/zh-CN/errors.json +1 -0
  236. package/locales/zh-CN/ui.json +575 -575
  237. package/locales/zh-TW/.meta.json +13246 -0
  238. package/locales/zh-TW/common.json +812 -29
  239. package/locales/zh-TW/errors.json +1 -0
  240. package/locales/zh-TW/ui.json +575 -575
  241. package/package.json +11 -3
@@ -0,0 +1,179 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * Write-time validation for admin-authored messages
4
+ * (23-runtime-translations.md §6.3).
5
+ *
6
+ * This is the ONLY thing standing between an admin's typing and every user's
7
+ * screen, because once a message comes from the meta store the build-time
8
+ * gates cannot see it (23 §10). It runs in the browser (live editor feedback)
9
+ * and on the server (the real boundary) from this one module, so the two can
10
+ * never disagree about what is acceptable.
11
+ *
12
+ * It parses with `IntlMessageFormat(...).getAst()` — the exact mechanism both
13
+ * `IcuFormat` and the parity gate use — rather than a second parser that
14
+ * could accept what the renderer rejects.
15
+ *
16
+ * The rules are deliberately STRICTER than the compiled-bundle parity gate on
17
+ * one axis: argument TYPE must match the source, not just argument name. That
18
+ * is not pedantry, it is the fix for a real hazard — 48 call sites in this
19
+ * repo do their own `.replace('{count}', …)` on the `t()` result and pass no
20
+ * ICU args at all. For those keys, `format()` throws on the missing variable,
21
+ * the raw string is returned, and the literal `{count}` token is what the
22
+ * `.replace` finds. An override that turned `{count}` into `{count, number}`
23
+ * would pass every name-based check and then render raw ICU to users. Types
24
+ * matching means it cannot.
25
+ */
26
+ import { IntlMessageFormat } from 'intl-messageformat';
27
+ import { intlTagForLocale, pluralCategoriesForLocale } from './locales.js';
28
+ function walk(nodes, shape) {
29
+ for (const node of nodes) {
30
+ if (node.type >= 1 && node.type <= 6 && typeof node.value === 'string') {
31
+ shape.args.set(node.value, node.type);
32
+ }
33
+ if ((node.type === 5 || node.type === 6) && node.options !== undefined) {
34
+ if (node.type === 6 && typeof node.value === 'string') {
35
+ shape.plurals.set(node.value, Object.keys(node.options).sort());
36
+ }
37
+ for (const option of Object.values(node.options))
38
+ walk(option.value, shape);
39
+ }
40
+ if (node.children !== undefined)
41
+ walk(node.children, shape);
42
+ }
43
+ }
44
+ /** Parse + extract, keeping the parser's reason so the admin gets a real message. */
45
+ function shapeOf(message, intlTag) {
46
+ const shape = { args: new Map(), plurals: new Map() };
47
+ try {
48
+ const ast = new IntlMessageFormat(message, intlTag, undefined, {
49
+ ignoreTag: true,
50
+ }).getAst();
51
+ walk(ast, shape);
52
+ }
53
+ catch (error) {
54
+ return { ok: false, reason: error instanceof Error ? error.message : String(error) };
55
+ }
56
+ return { ok: true, shape };
57
+ }
58
+ /**
59
+ * The parser rejects some things before the shape checks below can run — most
60
+ * importantly a plural or select with no `other` branch, which it reports as
61
+ * `MISSING_OTHER_CLAUSE`. Translating its machine reason into an admin-facing
62
+ * sentence matters: "this is not valid ICU" tells someone editing German copy
63
+ * nothing about which branch they forgot.
64
+ */
65
+ function explainParseFailure(reason) {
66
+ if (reason.includes('MISSING_OTHER_CLAUSE')) {
67
+ return {
68
+ code: 'PLURAL_MISSING_OTHER',
69
+ message: 'Every plural and select needs an "other" branch — it is the fallback used when no other case matches.',
70
+ };
71
+ }
72
+ if (reason.includes('CLOSING_BRACE') || reason.includes('EXPECT_ARGUMENT')) {
73
+ return {
74
+ code: 'ICU_SYNTAX',
75
+ message: 'Unbalanced braces — every { needs a matching }.',
76
+ };
77
+ }
78
+ return {
79
+ code: 'ICU_SYNTAX',
80
+ message: `This is not valid ICU MessageFormat (${reason}).`,
81
+ };
82
+ }
83
+ const ARG_TYPE_NAMES = {
84
+ 1: 'plain',
85
+ 2: 'number',
86
+ 3: 'date',
87
+ 4: 'time',
88
+ 5: 'select',
89
+ 6: 'plural',
90
+ };
91
+ function typeName(type) {
92
+ return type === undefined ? 'absent' : (ARG_TYPE_NAMES[type] ?? `type ${String(type)}`);
93
+ }
94
+ /**
95
+ * Validate one admin-authored override against its en-US source.
96
+ * Collects every failure rather than stopping at the first, so the editor can
97
+ * show an admin all of what is wrong in one pass.
98
+ */
99
+ export function validateMessage(opts) {
100
+ const { candidate, source, locale } = opts;
101
+ const errors = [];
102
+ // An empty override is the third state, not a malformed message.
103
+ if (candidate === '') {
104
+ return opts.allowEmpty === true
105
+ ? { ok: true }
106
+ : { ok: false, errors: [{ code: 'ICU_SYNTAX', message: 'This message may not be blank.' }] };
107
+ }
108
+ const intlTag = intlTagForLocale(locale);
109
+ const parsed = shapeOf(candidate, intlTag);
110
+ if (!parsed.ok)
111
+ return { ok: false, errors: [explainParseFailure(parsed.reason)] };
112
+ const candidateShape = parsed.shape;
113
+ // The source is en-US by definition; parse it under en-US so a locale with
114
+ // unusual plural rules cannot make a perfectly good source look invalid.
115
+ const parsedSource = shapeOf(source, 'en-US');
116
+ // A broken SOURCE is a repo bug, not an admin's fault — accept the override
117
+ // rather than blocking an admin on something they cannot fix.
118
+ if (!parsedSource.ok)
119
+ return { ok: true };
120
+ const sourceShape = parsedSource.shape;
121
+ const sourceArgs = [...sourceShape.args.keys()].sort();
122
+ const candidateArgs = [...candidateShape.args.keys()].sort();
123
+ const missing = sourceArgs.filter((a) => !candidateShape.args.has(a));
124
+ const extra = candidateArgs.filter((a) => !sourceShape.args.has(a));
125
+ if (missing.length > 0 || extra.length > 0) {
126
+ const parts = [];
127
+ if (missing.length > 0)
128
+ parts.push(`missing {${missing.join('}, {')}}`);
129
+ if (extra.length > 0)
130
+ parts.push(`unexpected {${extra.join('}, {')}}`);
131
+ errors.push({
132
+ code: 'ARG_MISMATCH',
133
+ message: `Placeholders must match the English source exactly — ${parts.join('; ')}.`,
134
+ });
135
+ }
136
+ // Argument TYPE parity — the literal-token guard (see the file header).
137
+ for (const [name, sourceType] of sourceShape.args) {
138
+ const candidateType = candidateShape.args.get(name);
139
+ if (candidateType !== undefined && candidateType !== sourceType) {
140
+ errors.push({
141
+ code: 'ARG_TYPE_MISMATCH',
142
+ message: `{${name}} must stay a ${typeName(sourceType)} placeholder — it was changed to ${typeName(candidateType)}.`,
143
+ });
144
+ }
145
+ }
146
+ // Plural parity is BIDIRECTIONAL, matching the compiled parity gate: an
147
+ // override may neither drop a plural the source has nor invent one it does
148
+ // not, because the call site's arguments are fixed by the source.
149
+ const sourcePlurals = [...sourceShape.plurals.keys()].sort();
150
+ const candidatePlurals = [...candidateShape.plurals.keys()].sort();
151
+ if (sourcePlurals.join(',') !== candidatePlurals.join(',')) {
152
+ errors.push({
153
+ code: 'PLURAL_MISMATCH',
154
+ message: sourcePlurals.length === 0
155
+ ? `The English source has no plural, so this override may not add one (${candidatePlurals.join(', ')}).`
156
+ : `Plural placeholders must match the English source exactly (expected ${sourcePlurals.join(', ') || 'none'}).`,
157
+ });
158
+ }
159
+ // Every selector must be a category this locale actually has, and `other`
160
+ // is mandatory — it is the branch ICU falls back to.
161
+ const categories = new Set(pluralCategoriesForLocale(locale));
162
+ for (const [name, selectors] of candidateShape.plurals) {
163
+ const unknown = selectors.filter((s) => !categories.has(s) && !s.startsWith('=') && s !== 'other');
164
+ if (unknown.length > 0) {
165
+ errors.push({
166
+ code: 'PLURAL_CATEGORY',
167
+ message: `{${name}} uses plural categories this language does not have: ${unknown.join(', ')}. Available: ${[...categories].join(', ')}.`,
168
+ });
169
+ }
170
+ if (!selectors.includes('other')) {
171
+ errors.push({
172
+ code: 'PLURAL_MISSING_OTHER',
173
+ message: `{${name}} must include an "other" branch — it is the fallback every language needs.`,
174
+ });
175
+ }
176
+ }
177
+ return errors.length === 0 ? { ok: true } : { ok: false, errors };
178
+ }
179
+ //# sourceMappingURL=validate-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-message.js","sourceRoot":"","sources":["../src/validate-message.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,g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