@pithy-sh/email 0.1.1 → 0.1.3

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 (176) hide show
  1. package/dist/analytics.d.ts +19 -0
  2. package/dist/analytics.d.ts.map +1 -0
  3. package/dist/analytics.js +13 -0
  4. package/dist/audit/actions.d.ts +45 -0
  5. package/dist/audit/actions.d.ts.map +1 -0
  6. package/dist/audit/actions.js +45 -0
  7. package/dist/bounce/classify.d.ts +38 -0
  8. package/dist/bounce/classify.d.ts.map +1 -0
  9. package/dist/bounce/classify.js +46 -0
  10. package/dist/bounce/handler.d.ts +32 -0
  11. package/dist/bounce/handler.d.ts.map +1 -0
  12. package/dist/bounce/handler.js +81 -0
  13. package/dist/capability.d.ts +158 -0
  14. package/dist/capability.d.ts.map +1 -0
  15. package/dist/capability.js +255 -0
  16. package/dist/crypto/signingKey.d.ts +36 -0
  17. package/dist/crypto/signingKey.d.ts.map +1 -0
  18. package/dist/crypto/signingKey.js +36 -0
  19. package/dist/crypto/token.d.ts +47 -0
  20. package/dist/crypto/token.d.ts.map +1 -0
  21. package/dist/crypto/token.js +99 -0
  22. package/dist/data/emailEvent.d.ts +28 -0
  23. package/dist/data/emailEvent.d.ts.map +1 -0
  24. package/dist/data/emailEvent.js +22 -0
  25. package/dist/data/emailJob.d.ts +76 -0
  26. package/dist/data/emailJob.d.ts.map +1 -0
  27. package/dist/data/emailJob.js +62 -0
  28. package/dist/data/emailSuppression.d.ts +23 -0
  29. package/dist/data/emailSuppression.d.ts.map +1 -0
  30. package/dist/data/emailSuppression.js +21 -0
  31. package/dist/data/enums.d.ts +76 -0
  32. package/dist/data/enums.d.ts.map +1 -0
  33. package/dist/data/enums.js +65 -0
  34. package/dist/data/tables.d.ts +114 -0
  35. package/dist/data/tables.d.ts.map +1 -0
  36. package/dist/data/tables.js +30 -0
  37. package/dist/error/errors.d.ts +60 -0
  38. package/dist/error/errors.d.ts.map +1 -0
  39. package/dist/error/errors.js +82 -0
  40. package/dist/http/callbacks.d.ts +21 -0
  41. package/dist/http/callbacks.d.ts.map +1 -0
  42. package/dist/http/callbacks.js +110 -0
  43. package/dist/http/guards.d.ts +99 -0
  44. package/dist/http/guards.d.ts.map +1 -0
  45. package/dist/http/guards.js +144 -0
  46. package/dist/http/responses.d.ts +295 -0
  47. package/dist/http/responses.d.ts.map +1 -0
  48. package/dist/http/responses.js +115 -0
  49. package/dist/http/routes.d.ts +71 -0
  50. package/dist/http/routes.d.ts.map +1 -0
  51. package/dist/http/routes.js +292 -0
  52. package/dist/http/schemas.d.ts +90 -0
  53. package/dist/http/schemas.d.ts.map +1 -0
  54. package/dist/http/schemas.js +91 -0
  55. package/dist/http/view.d.ts +78 -0
  56. package/dist/http/view.d.ts.map +1 -0
  57. package/dist/http/view.js +130 -0
  58. package/dist/index.d.ts +46 -0
  59. package/dist/index.d.ts.map +1 -0
  60. package/dist/index.js +11 -0
  61. package/dist/jobs/read.d.ts +191 -0
  62. package/dist/jobs/read.d.ts.map +1 -0
  63. package/dist/jobs/read.js +143 -0
  64. package/dist/jobs/retry.d.ts +99 -0
  65. package/dist/jobs/retry.d.ts.map +1 -0
  66. package/dist/jobs/retry.js +67 -0
  67. package/dist/migrations/0001_init.d.ts +32 -0
  68. package/dist/migrations/0001_init.d.ts.map +1 -0
  69. package/dist/migrations/0001_init.js +60 -0
  70. package/dist/migrations/0001_suppressions.d.ts +10 -0
  71. package/dist/migrations/0001_suppressions.d.ts.map +1 -0
  72. package/dist/migrations/0001_suppressions.js +20 -0
  73. package/dist/provision/devDelivery.d.ts +32 -0
  74. package/dist/provision/devDelivery.d.ts.map +1 -0
  75. package/dist/provision/devDelivery.js +37 -0
  76. package/dist/provision/hostCatalogs.d.ts +10 -0
  77. package/dist/provision/hostCatalogs.d.ts.map +1 -0
  78. package/dist/provision/hostCatalogs.js +78 -0
  79. package/dist/provision/provisionEmail.d.ts +143 -0
  80. package/dist/provision/provisionEmail.d.ts.map +1 -0
  81. package/dist/provision/provisionEmail.js +118 -0
  82. package/dist/provision/resolveEmailConfig.d.ts +122 -0
  83. package/dist/provision/resolveEmailConfig.d.ts.map +1 -0
  84. package/dist/provision/resolveEmailConfig.js +124 -0
  85. package/dist/provision/settingsCheck.d.ts +40 -0
  86. package/dist/provision/settingsCheck.d.ts.map +1 -0
  87. package/dist/provision/settingsCheck.js +138 -0
  88. package/dist/send/batchIdentity.d.ts +42 -0
  89. package/dist/send/batchIdentity.d.ts.map +1 -0
  90. package/dist/send/batchIdentity.js +46 -0
  91. package/dist/send/enqueue.d.ts +216 -0
  92. package/dist/send/enqueue.d.ts.map +1 -0
  93. package/dist/send/enqueue.js +153 -0
  94. package/dist/send/errorMapping.d.ts +27 -0
  95. package/dist/send/errorMapping.d.ts.map +1 -0
  96. package/dist/send/errorMapping.js +52 -0
  97. package/dist/send/events.d.ts +15 -0
  98. package/dist/send/events.d.ts.map +1 -0
  99. package/dist/send/events.js +17 -0
  100. package/dist/send/fromComposition.d.ts +47 -0
  101. package/dist/send/fromComposition.d.ts.map +1 -0
  102. package/dist/send/fromComposition.js +53 -0
  103. package/dist/send/retryPolicy.d.ts +32 -0
  104. package/dist/send/retryPolicy.d.ts.map +1 -0
  105. package/dist/send/retryPolicy.js +39 -0
  106. package/dist/send/runSend.d.ts +106 -0
  107. package/dist/send/runSend.d.ts.map +1 -0
  108. package/dist/send/runSend.js +218 -0
  109. package/dist/send/sendAt.d.ts +6 -0
  110. package/dist/send/sendAt.d.ts.map +1 -0
  111. package/dist/send/sendAt.js +62 -0
  112. package/dist/send/sender.d.ts +42 -0
  113. package/dist/send/sender.d.ts.map +1 -0
  114. package/dist/send/sender.js +0 -0
  115. package/dist/send/senderBinding.d.ts +44 -0
  116. package/dist/send/senderBinding.d.ts.map +1 -0
  117. package/dist/send/senderBinding.js +21 -0
  118. package/dist/send/suppression.d.ts +93 -0
  119. package/dist/send/suppression.d.ts.map +1 -0
  120. package/dist/send/suppression.js +132 -0
  121. package/dist/templates/engine.d.ts +109 -0
  122. package/dist/templates/engine.d.ts.map +1 -0
  123. package/dist/templates/engine.js +258 -0
  124. package/dist/templates/messages.d.ts +94 -0
  125. package/dist/templates/messages.d.ts.map +1 -0
  126. package/dist/templates/messages.es.d.ts +29 -0
  127. package/dist/templates/messages.es.d.ts.map +1 -0
  128. package/dist/templates/messages.es.js +82 -0
  129. package/dist/templates/messages.js +266 -0
  130. package/dist/templates/partials.d.ts +5 -0
  131. package/dist/templates/partials.d.ts.map +1 -0
  132. package/dist/templates/partials.js +59 -0
  133. package/dist/templates/precompiled.generated.d.ts +266 -0
  134. package/dist/templates/precompiled.generated.d.ts.map +1 -0
  135. package/dist/templates/precompiled.generated.js +4039 -0
  136. package/dist/templates/registry.d.ts +118 -0
  137. package/dist/templates/registry.d.ts.map +1 -0
  138. package/dist/templates/registry.js +323 -0
  139. package/dist/templates/samples.d.ts +7 -0
  140. package/dist/templates/samples.d.ts.map +1 -0
  141. package/dist/templates/samples.js +98 -0
  142. package/dist/templates/severity.d.ts +40 -0
  143. package/dist/templates/severity.d.ts.map +1 -0
  144. package/dist/templates/severity.js +81 -0
  145. package/dist/templates/theme.d.ts +193 -0
  146. package/dist/templates/theme.d.ts.map +1 -0
  147. package/dist/templates/theme.js +168 -0
  148. package/dist/version.generated.d.ts +5 -0
  149. package/dist/version.generated.d.ts.map +1 -0
  150. package/dist/version.generated.js +7 -0
  151. package/dist/workflows/hostApp.d.ts +33 -0
  152. package/dist/workflows/hostApp.d.ts.map +1 -0
  153. package/dist/workflows/hostApp.js +19 -0
  154. package/dist/workflows/hostEnv.d.ts +129 -0
  155. package/dist/workflows/hostEnv.d.ts.map +1 -0
  156. package/dist/workflows/hostEnv.js +147 -0
  157. package/dist/workflows/instanceLiveness.d.ts +3 -0
  158. package/dist/workflows/instanceLiveness.d.ts.map +1 -0
  159. package/dist/workflows/instanceLiveness.js +37 -0
  160. package/dist/workflows/instances.d.ts +18 -0
  161. package/dist/workflows/instances.d.ts.map +1 -0
  162. package/dist/workflows/instances.js +0 -0
  163. package/dist/workflows/params.d.ts +23 -0
  164. package/dist/workflows/params.d.ts.map +1 -0
  165. package/dist/workflows/params.js +21 -0
  166. package/dist/workflows/scheduler.d.ts +82 -0
  167. package/dist/workflows/scheduler.d.ts.map +1 -0
  168. package/dist/workflows/scheduler.js +111 -0
  169. package/dist/workflows/sendBatch.d.ts +85 -0
  170. package/dist/workflows/sendBatch.d.ts.map +1 -0
  171. package/dist/workflows/sendBatch.js +50 -0
  172. package/dist/workflows/worker.d.ts +100 -0
  173. package/dist/workflows/worker.d.ts.map +1 -0
  174. package/dist/workflows/worker.js +117 -0
  175. package/package.json +22 -11
  176. package/src/version.generated.ts +1 -1
@@ -0,0 +1,266 @@
1
+ import { EMAIL_ES } from "./messages.es.js";
2
+ import { parseLocale } from "@pithy-sh/core/src/i18n/locale";
3
+ import { MessageCatalog } from "@pithy-sh/core/src/i18n/catalog";
4
+ import { DEFAULT_LOCALE, createTranslator } from "@pithy-sh/core/src/i18n/translator";
5
+ //#region src/templates/messages.ts
6
+ /**
7
+ * The words this capability writes, in the language it writes them in.
8
+ *
9
+ * ## Why the words live here and not in the template source
10
+ *
11
+ * The obvious way to make an email speak a second language is to precompile the template twice. It is
12
+ * also the expensive way, and the expense is not the part that varies. `precompiled.generated.ts` is
13
+ * 132KB for 38 specs, and almost none of that is prose: it is a Gmail-safe table shell, a VML button
14
+ * fallback, an inline color on every cell, and a `prefers-color-scheme` block — markup that is
15
+ * byte-identical in every language and would be duplicated wholesale per locale, into a Worker bundle
16
+ * that has no lazy loading to hide it behind.
17
+ *
18
+ * It also cannot be done without breaking something structural. The engine registers `emailHead` and
19
+ * `emailFoot` **once, by bare name, on one `Handlebars.create()`**, and caches a compiled entry per
20
+ * template **id**. Per-locale sources force one of two changes: locale-qualified partial names
21
+ * (`emailHead:es`), which means every template body has to know its own locale before it can name its
22
+ * own shell, or one engine instance per locale, which multiplies the partial registry and the compiled
23
+ * cache by the locale count for a document shell that never changes. Neither buys anything, because
24
+ * `engine.test.ts` pins the sorted template id list — so a locale variant could never be an id anyway.
25
+ *
26
+ * So the split is: **the layout is the template's, the words are the catalog's.** One precompiled
27
+ * template per id, one partial registry, one engine, and `{{t}}` / `{{tn}}` join them at render. Adding
28
+ * a locale then costs a catalog and nothing else — no rebuild of the specs, no growth in the shipped
29
+ * artifact beyond the sentences themselves.
30
+ *
31
+ * ## Escaping
32
+ *
33
+ * A catalog value reaching the HTML body goes through an ordinary `{{t …}}` mustache, so Handlebars
34
+ * escapes it exactly as it escapes a payload value — the helpers return plain strings and **never** a
35
+ * `SafeString`, which is what keeps that true. `subject` and `text` are precompiled with
36
+ * `noEscape: true`, so a value substituted there is unescaped; that is correct for those parts (a
37
+ * subject line and a plain-text body are not HTML contexts) and it is why nothing in this file, and
38
+ * nothing an adopter overrides it with, may carry markup. Interpolated parameters are escaped with the
39
+ * sentence that carries them, so `{{t "email/welcome.body" name=name}}` escapes `name` exactly as
40
+ * `{{name}}` did.
41
+ *
42
+ * ## Only the kit's own copy
43
+ *
44
+ * Seven templates are here. The five whose words arrive as payload — `testerNudge`, `supportReply`,
45
+ * `operationalNotice`, `newsletter`, `marketingCampaign` — are the adopter's copy, chosen by a human
46
+ * for one message, and a catalog cannot translate a sentence it has never seen. Their **shell** still
47
+ * follows the job's locale (the severity word, the footer, the document's `lang` and `dir`), so a
48
+ * notice at locale `es` reads its severity in Spanish and its summary in whatever the caller wrote.
49
+ */
50
+ /** The kit's English for every string the seven kit-authored templates and the shared shell render. */
51
+ const EMAIL_EN = {
52
+ "email/shell.greeting": "Hi,",
53
+ "email/shell.greeting_named": "Hi {name},",
54
+ "email/shell.unsubscribe": "Unsubscribe",
55
+ "email/severity.info": "Notice",
56
+ "email/severity.warning": "Action needed",
57
+ "email/severity.critical": "Critical",
58
+ "email/magic_link.subject": "Your sign-in link",
59
+ "email/magic_link.heading": "Sign in",
60
+ "email/magic_link.instruction": "use the button below to sign in.",
61
+ "email/magic_link.expiry.one": "It expires in {count} minute.",
62
+ "email/magic_link.expiry.other": "It expires in {count} minutes.",
63
+ "email/magic_link.cta": "Sign in",
64
+ "email/magic_link.ignore": "If you didn't request this, you can ignore this email.",
65
+ "email/magic_link.text_instruction.one": "Use this link to sign in (expires in {count} minute):",
66
+ "email/magic_link.text_instruction.other": "Use this link to sign in (expires in {count} minutes):",
67
+ "email/magic_link.text_ignore": "If you didn't request this, ignore this email.",
68
+ "email/otp.subject": "Your verification code",
69
+ "email/otp.heading": "Your code",
70
+ "email/otp.lead": "your verification code is:",
71
+ "email/otp.expiry.one": "It expires in {count} minute.",
72
+ "email/otp.expiry.other": "It expires in {count} minutes.",
73
+ "email/otp.text_body.one": "Your verification code is {code}. It expires in {count} minute.",
74
+ "email/otp.text_body.other": "Your verification code is {code}. It expires in {count} minutes.",
75
+ "email/welcome.subject": "Welcome to {app}",
76
+ "email/welcome.heading": "Welcome to {app}",
77
+ "email/welcome.body": "Hi {name}, welcome to {app}. We're glad you're here.",
78
+ "email/welcome.text_body": "Welcome to {app}. We're glad you're here.",
79
+ "email/security_alert.subject": "Security alert: {event}",
80
+ "email/security_alert.heading": "Security alert",
81
+ "email/security_alert.body": "{event} on {when}.",
82
+ "email/security_alert.ip": "IP address: {ip}.",
83
+ "email/security_alert.text_ip": "IP: {ip}.",
84
+ "email/security_alert.reassure": "If this was you, no action is needed.",
85
+ "email/security_alert.cta": "Review activity",
86
+ "email/security_alert.text_action": "If this wasn't you, secure your account:",
87
+ "email/invite.subject": "{inviter} invited you to {organization}",
88
+ "email/invite.heading": "You're invited",
89
+ "email/invite.body": "{inviter} invited you to join {organization} on {app}.",
90
+ "email/invite.cta": "Accept invitation",
91
+ "email/invite.text_accept": "Accept:",
92
+ "email/password_changed.subject": "Your password was changed",
93
+ "email/password_changed.heading": "Your password was changed",
94
+ "email/password_changed.body": "your account credentials were changed on {when}.",
95
+ "email/password_changed.warn": "If this wasn't you, contact support immediately.",
96
+ "email/password_changed.cta": "Contact support",
97
+ "email/password_changed.text_body": "Your account credentials were changed on {when}. If this wasn't you, contact support:",
98
+ "email/lead_capture.subject": "Your download: {asset}",
99
+ "email/lead_capture.heading": "Your download is ready",
100
+ "email/lead_capture.ready": "Your copy of {asset} is ready.",
101
+ "email/lead_capture.cta": "Download now",
102
+ "email/lead_capture.text_ready": "Your copy of {asset} is ready:"
103
+ };
104
+ /**
105
+ * Every language this capability's own copy is written in.
106
+ *
107
+ * **Bundled, not stamped.** The send Worker is deployed with this map inside it, so adding a language
108
+ * to the kit costs an adopter a package upgrade and no configuration at all — which is the whole of
109
+ * #442. What still travels as a variable is the adopter's diff against this: usually nothing, and at
110
+ * most the sentences they changed.
111
+ */
112
+ const EMAIL_MESSAGES = {
113
+ en: EMAIL_EN,
114
+ es: EMAIL_ES
115
+ };
116
+ /** The layers a project that composed no i18n capability walks: this package's own English, and nothing else. */
117
+ const kitEmailLayers = (locale) => [bundledFor(locale), EMAIL_EN];
118
+ /** The primary language subtag of a tag — `es` of `es-AR`. Null when it is not a tag at all. */
119
+ function languageOf(tag) {
120
+ return parseLocale(tag)?.language ?? null;
121
+ }
122
+ /**
123
+ * This package's own copy for `locale`, reduced to the language when the region was not written for.
124
+ *
125
+ * **The reduction has to happen here too, and not only over the stamped catalogs.** It did not, and
126
+ * that was a regression the moment #442 bundled the kit's translations: the stamped catalog used to
127
+ * *be* the kit's Spanish, so reducing `es-AR` to `es` over it found the words. With the kit's copy
128
+ * bundled here instead, the stamped catalog is empty for a project that overrode nothing, and an
129
+ * exact-tag lookup on `es-AR` answered `undefined` — so a reader whose `pithy_auth_users.locale` is
130
+ * `es-AR` or `es-MX` got an English letter from a project that ships Spanish.
131
+ */
132
+ function bundledFor(locale) {
133
+ const language = languageOf(locale);
134
+ return EMAIL_MESSAGES[locale] ?? (language ? EMAIL_MESSAGES[language] : void 0);
135
+ }
136
+ /**
137
+ * The layers behind a serialized catalog set — what the prebuilt email host worker uses.
138
+ *
139
+ * That worker is standalone: nothing composes capabilities inside it, so it cannot be handed a
140
+ * composed project's `layersFor`. It reads the catalogs as one JSON var instead, and this turns them
141
+ * into the same seam. English stays last, so a locale that translated nine sentences out of ten still
142
+ * renders the tenth rather than its key.
143
+ */
144
+ /**
145
+ * The prefix every per-locale catalog variable carries on the email and testers hosts.
146
+ *
147
+ * **One variable per locale, not one variable holding every locale.** Cloudflare's 5 KB ceiling is per
148
+ * variable, and a Worker gets 64 of them on the free plan and 128 on paid — so a project shipping
149
+ * twenty languages has twenty 3 KB values, each comfortably inside the limit, rather than one 62 KB
150
+ * value that is refused outright.
151
+ *
152
+ * It was one variable at first, and the ceiling that produced was absurd on inspection: every language
153
+ * pack fits with 2 KB to spare, and the project still could not deploy a second one. Nothing about the
154
+ * data was near a limit — the limit was manufactured by concatenating packs that are read one at a
155
+ * time. The host renders one email, in one locale, from the job's row; it never needs the other
156
+ * nineteen. Splitting the transport is the whole fix, and the in-memory shape is unchanged.
157
+ */
158
+ const EMAIL_CATALOG_VAR_PREFIX = "EMAIL_MESSAGES_";
159
+ /**
160
+ * The variable name a locale's catalog travels under — `es-AR` becomes `EMAIL_MESSAGES_ES_AR`.
161
+ *
162
+ * Upper-cased with dashes as underscores, which is the shape a Worker variable name takes. The mapping
163
+ * is injective because `Locale` forbids `_` in a tag, so no two tags can collide on one name.
164
+ */
165
+ function emailCatalogVarName(locale) {
166
+ return `${EMAIL_CATALOG_VAR_PREFIX}${locale.replaceAll("-", "_").toUpperCase()}`;
167
+ }
168
+ /**
169
+ * The locale a variable name carries, or `null` when the name is not one of ours.
170
+ *
171
+ * **Canonicalized through `Intl`, not merely lower-cased.** A variable name has one case and a tag has
172
+ * three — `pt-BR`, `zh-Hant-TW`, `es-419` — so the name alone cannot say which. `Intl.Locale` restores
173
+ * it: `pt_br` reads back as `pt-BR`, script subtags title-cased and regions upper-cased, which is the
174
+ * spelling `catalogLayers` looks the catalog up under. Lower-cased instead, a `pt-BR` job would miss a
175
+ * `pt-br` catalog and silently render the kit's English.
176
+ */
177
+ function localeFromCatalogVar(name) {
178
+ if (!name.startsWith("EMAIL_MESSAGES_")) return null;
179
+ const tag = name.slice(15).replaceAll("_", "-").toLowerCase();
180
+ if (tag.length === 0) return null;
181
+ return parseLocale(tag)?.baseName ?? null;
182
+ }
183
+ /**
184
+ * Every catalog this host was deployed with, collected off the raw env.
185
+ *
186
+ * **Read from the raw env rather than declared on `EmailHostEnv`**, because the variable *names* are
187
+ * the project's locales and a Zod object can only declare names known when it was written. The values
188
+ * are still validated — each one is parsed through `LocaleCatalogs`' own `MessageCatalog`, so a
189
+ * variable holding something that is not a catalog is a boot failure rather than a render failure.
190
+ *
191
+ * A locale whose value will not parse is skipped rather than fatal: the render falls through to the
192
+ * kit's English for that language and every other language still works. One unreadable variable
193
+ * should not stop a host from sending mail.
194
+ */
195
+ function catalogsFromEnv(env) {
196
+ const catalogs = {};
197
+ for (const [name, raw] of Object.entries(env)) {
198
+ const locale = localeFromCatalogVar(name);
199
+ if (locale === null || typeof raw !== "string" || raw.trim().length === 0) continue;
200
+ try {
201
+ const parsed = MessageCatalog.safeParse(JSON.parse(raw));
202
+ if (parsed.success) catalogs[locale] = parsed.data;
203
+ } catch {}
204
+ }
205
+ return catalogs;
206
+ }
207
+ function catalogLayers(catalogs) {
208
+ return (locale) => {
209
+ const language = languageOf(locale);
210
+ return [
211
+ catalogs[locale] ?? (language ? catalogs[language] : void 0),
212
+ bundledFor(locale),
213
+ EMAIL_EN
214
+ ];
215
+ };
216
+ }
217
+ /**
218
+ * The tag this render will actually be written in — the one it was asked for, or the kit's default.
219
+ *
220
+ * **The guard is here because this is the last place before `Intl`.** `Translator.plural` builds an
221
+ * `Intl.PluralRules` on the catalog locale, and `Intl` refuses tags that look perfectly well formed:
222
+ * `en-x`, `en-t`, `en-u`, `en-1`, `en-US-x` and `en-a-bbb-a-ccc` are a singleton subtag with nothing
223
+ * after it, or a repeated extension, and every one of them raises `RangeError`. `magicLink` and `otp`
224
+ * — the two sends the whole of authentication rests on — render `{{tn}}`, so that throw lands inside
225
+ * `renderEmail`: at enqueue it is a raw `RangeError` out of a request handler rather than a
226
+ * `PithyError`, and at send it is one inside the send Workflow, where `classifySendError` sees no code
227
+ * it knows and the job burns its retries and wedges.
228
+ *
229
+ * `@pithy-sh/core`'s `Locale` refuses the same six on the way into D1, and that is the repair that
230
+ * matters — a tag `Intl` will not take should never reach `pithy_email_jobs.locale`. This is the
231
+ * belt: the two callers here (`enqueueEmail`, `runSend`) take a bare `string`, one of them *before*
232
+ * anything has been validated, and a row written by an adopter's own SQL or by a build that predates
233
+ * that refinement is still a row this Worker has to render. Falling back costs a message in the wrong
234
+ * language; not falling back costs the message.
235
+ */
236
+ function renderLocale(locale) {
237
+ const tag = locale?.trim();
238
+ if (!tag) return DEFAULT_LOCALE;
239
+ return parseLocale(tag) === null ? DEFAULT_LOCALE : tag;
240
+ }
241
+ /**
242
+ * The translator one email renders through.
243
+ *
244
+ * **Built per render from the job's own locale, never from the request's.** A send happens inside a
245
+ * Workflow hours or days after the enqueue, in a Worker with no request on it at all, so `c.var.t` —
246
+ * the seam every HTTP surface uses — does not exist at the moment that matters. The locale is on the
247
+ * row for exactly that reason, and this is what turns it back into words.
248
+ *
249
+ * **The two locales stay apart.** `catalogLocale` is the tag as stored — it is what the document
250
+ * declares itself as and what decides text direction — and `formattingLocale` is the same tag handed to
251
+ * `Intl`, so an Argentine reading Spanish still gets Argentine numbers and dates. Collapsing them is
252
+ * the bug `Translator` carries two fields to prevent. Which *catalog* answers a regional tag is
253
+ * {@link catalogLayers}'s question, not this one's.
254
+ *
255
+ * Both of them come from {@link renderLocale}, so a tag `Intl` refuses can reach neither.
256
+ */
257
+ function emailTranslator(locale, layersFor) {
258
+ const tag = renderLocale(locale);
259
+ return createTranslator({
260
+ catalogLocale: tag,
261
+ formattingLocale: tag,
262
+ layers: layersFor(tag)
263
+ });
264
+ }
265
+ //#endregion
266
+ export { EMAIL_CATALOG_VAR_PREFIX, EMAIL_MESSAGES, catalogLayers, catalogsFromEnv, emailCatalogVarName, emailTranslator, kitEmailLayers, localeFromCatalogVar };
@@ -0,0 +1,5 @@
1
+ /** Doctype, head (with the dark-mode style block), body open, the branded masthead, and the content cell. */
2
+ export declare const emailHead: string;
3
+ /** Closes the content cell, renders the footer (logo, links, address, optional unsubscribe), and the document. */
4
+ export declare const emailFoot = "</td>\n </tr>\n <tr role=\"separator\"><td style=\"line-height: 40px\">&zwj;</td></tr>\n <tr>\n <td class=\"t-subtle\" style=\"padding: 0 24px; text-align: center; font-size: 12px; line-height: 18px; color: {{theme.light.textSubtle}}\">\n <p class=\"t-subtle\" style=\"margin: 0; color: {{theme.light.textSubtle}}\">{{theme.appName}}</p>\n {{#if theme.links.length}}<p style=\"margin: 12px 0 0\">{{#each theme.links}}{{#unless @first}} &middot; {{/unless}}<a href=\"{{href}}\" class=\"hover-underline t-muted\" style=\"color: {{../theme.light.textMuted}}; text-decoration: none\">{{label}}</a>{{/each}}</p>{{/if}}\n {{#if theme.footerAddress}}<p class=\"t-subtle\" style=\"margin: 14px 0 0; color: {{theme.light.textSubtle}}\">{{theme.footerAddress}}</p>{{/if}}\n {{#if unsubscribeUrl}}<p style=\"margin: 12px 0 0\"><a href=\"{{unsubscribeUrl}}\" class=\"hover-underline t-subtle\" style=\"color: {{theme.light.textSubtle}}; text-decoration: underline\">{{t \"email/shell.unsubscribe\"}}</a></p>{{/if}}\n </td>\n </tr>\n <tr role=\"separator\"><td style=\"line-height: 40px\">&zwj;</td></tr>\n </table>\n </td></tr>\n </table>\n</div>\n</div>\n</body>\n</html>";
5
+ //# sourceMappingURL=partials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partials.d.ts","sourceRoot":"","sources":["../../src/templates/partials.ts"],"names":[],"mappings":"AA+BA,6GAA6G;AAC7G,eAAO,MAAM,SAAS,QAkC2Q,CAAC;AAElS,kHAAkH;AAClH,eAAO,MAAM,SAAS,uvCAkBd,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { severityDarkModeCss } from "./severity.js";
2
+ /** Doctype, head (with the dark-mode style block), body open, the branded masthead, and the content cell. */
3
+ const emailHead = `<!DOCTYPE html>
4
+ <html lang="{{lang}}" dir="{{dir}}" xmlns:v="urn:schemas-microsoft-com:vml">
5
+ <head>
6
+ <meta charset="utf-8">
7
+ <meta name="x-apple-disable-message-reformatting">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1">
9
+ <meta name="color-scheme" content="light dark">
10
+ <meta name="supported-color-schemes" content="light dark">
11
+ <style>
12
+ .hover-underline:hover { text-decoration: underline !important }
13
+ @media (prefers-color-scheme: dark) {
14
+ .email-bg { background-color: {{theme.dark.background}} !important; }
15
+ .email-card { background-color: {{theme.dark.cardBackground}} !important; box-shadow: none !important; }
16
+ .t-ink { color: {{theme.dark.text}} !important; }
17
+ .t-muted { color: {{theme.dark.textMuted}} !important; }
18
+ .t-subtle { color: {{theme.dark.textSubtle}} !important; }
19
+ .sep { background-color: {{theme.dark.separator}} !important; }
20
+ .logo-light { display: none !important; }
21
+ .logo-dark { display: inline-block !important; max-height: none !important; overflow: visible !important; }
22
+ ${severityDarkModeCss}
23
+ }
24
+ </style>
25
+ </head>
26
+ <body class="email-bg" style="margin: 0; width: 100%; background-color: {{theme.light.background}}; padding: 0; -webkit-font-smoothing: antialiased; word-break: break-word">
27
+ <div role="article" aria-roledescription="email" lang="{{lang}}" dir="{{dir}}">
28
+ {{#if openPixelUrl}}<img src="{{openPixelUrl}}" width="1" height="1" alt="" style="position: absolute; left: 0; top: 0; max-width: 1px; max-height: 1px; opacity: 0; border: 0">{{/if}}
29
+ <div class="email-bg" style="background-color: {{theme.light.background}}; font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; padding: 0 16px">
30
+ <table align="center" cellpadding="0" cellspacing="0" role="none" style="width: {{layoutWidth}}px; max-width: {{layoutWidth}}px">
31
+ <tr><td>
32
+ <div style="margin-top: 40px; margin-bottom: 32px; text-align: center">
33
+ {{#if theme.logoUrl}}<img src="{{theme.logoUrl}}" width="150" alt="{{theme.appName}}" class="logo-light" style="max-width: 100%; vertical-align: middle; border: 0">{{#if theme.logoDarkUrl}}<img src="{{theme.logoDarkUrl}}" width="150" alt="{{theme.appName}}" class="logo-dark" style="display: none; max-height: 0; overflow: hidden; max-width: 100%; vertical-align: middle; border: 0">{{/if}}{{else}}<span class="t-ink" style="font-size: 22px; font-weight: 700; color: {{theme.accent}}">{{theme.appName}}</span>{{/if}}
34
+ </div>
35
+ <table style="width: 100%" cellpadding="0" cellspacing="0" role="none">
36
+ <tr>
37
+ <td class="email-card t-muted" style="border-radius: 8px; background-color: {{theme.light.cardBackground}}; padding: 44px; font-size: 16px; line-height: 26px; color: {{theme.light.textMuted}}; box-shadow: 0 1px 2px 0 rgba(17,17,17,0.06); border-top: 3px solid {{theme.accent}}">`;
38
+ /** Closes the content cell, renders the footer (logo, links, address, optional unsubscribe), and the document. */
39
+ const emailFoot = `</td>
40
+ </tr>
41
+ <tr role="separator"><td style="line-height: 40px">&zwj;</td></tr>
42
+ <tr>
43
+ <td class="t-subtle" style="padding: 0 24px; text-align: center; font-size: 12px; line-height: 18px; color: {{theme.light.textSubtle}}">
44
+ <p class="t-subtle" style="margin: 0; color: {{theme.light.textSubtle}}">{{theme.appName}}</p>
45
+ {{#if theme.links.length}}<p style="margin: 12px 0 0">{{#each theme.links}}{{#unless @first}} &middot; {{/unless}}<a href="{{href}}" class="hover-underline t-muted" style="color: {{../theme.light.textMuted}}; text-decoration: none">{{label}}</a>{{/each}}</p>{{/if}}
46
+ {{#if theme.footerAddress}}<p class="t-subtle" style="margin: 14px 0 0; color: {{theme.light.textSubtle}}">{{theme.footerAddress}}</p>{{/if}}
47
+ {{#if unsubscribeUrl}}<p style="margin: 12px 0 0"><a href="{{unsubscribeUrl}}" class="hover-underline t-subtle" style="color: {{theme.light.textSubtle}}; text-decoration: underline">{{t "email/shell.unsubscribe"}}</a></p>{{/if}}
48
+ </td>
49
+ </tr>
50
+ <tr role="separator"><td style="line-height: 40px">&zwj;</td></tr>
51
+ </table>
52
+ </td></tr>
53
+ </table>
54
+ </div>
55
+ </div>
56
+ </body>
57
+ </html>`;
58
+ //#endregion
59
+ export { emailFoot, emailHead };
@@ -0,0 +1,266 @@
1
+ export declare const precompiledPartials: {
2
+ emailHead: {
3
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
4
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
5
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
6
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
7
+ compiler: (string | number)[];
8
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
9
+ useData: boolean;
10
+ };
11
+ emailFoot: {
12
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
13
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
14
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
15
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
16
+ "4": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
17
+ compiler: (string | number)[];
18
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
19
+ useData: boolean;
20
+ useDepths: boolean;
21
+ };
22
+ };
23
+ export declare const precompiledTemplates: {
24
+ "magicLink:subject": {
25
+ compiler: (string | number)[];
26
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
27
+ useData: boolean;
28
+ };
29
+ "magicLink:html": {
30
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
31
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
32
+ compiler: (string | number)[];
33
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
34
+ usePartial: boolean;
35
+ useData: boolean;
36
+ };
37
+ "magicLink:text": {
38
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
39
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
40
+ compiler: (string | number)[];
41
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
42
+ useData: boolean;
43
+ };
44
+ "otp:subject": {
45
+ compiler: (string | number)[];
46
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
47
+ useData: boolean;
48
+ };
49
+ "otp:html": {
50
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
51
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
52
+ compiler: (string | number)[];
53
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
54
+ usePartial: boolean;
55
+ useData: boolean;
56
+ };
57
+ "otp:text": {
58
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
59
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
60
+ compiler: (string | number)[];
61
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
62
+ useData: boolean;
63
+ };
64
+ "welcome:subject": {
65
+ compiler: (string | number)[];
66
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
67
+ useData: boolean;
68
+ };
69
+ "welcome:html": {
70
+ compiler: (string | number)[];
71
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
72
+ usePartial: boolean;
73
+ useData: boolean;
74
+ };
75
+ "welcome:text": {
76
+ compiler: (string | number)[];
77
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
78
+ useData: boolean;
79
+ };
80
+ "securityAlert:subject": {
81
+ compiler: (string | number)[];
82
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
83
+ useData: boolean;
84
+ };
85
+ "securityAlert:html": {
86
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
87
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
88
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
89
+ compiler: (string | number)[];
90
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
91
+ usePartial: boolean;
92
+ useData: boolean;
93
+ };
94
+ "securityAlert:text": {
95
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
96
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
97
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
98
+ compiler: (string | number)[];
99
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
100
+ useData: boolean;
101
+ };
102
+ "invite:subject": {
103
+ compiler: (string | number)[];
104
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
105
+ useData: boolean;
106
+ };
107
+ "invite:html": {
108
+ compiler: (string | number)[];
109
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
110
+ usePartial: boolean;
111
+ useData: boolean;
112
+ };
113
+ "invite:text": {
114
+ compiler: (string | number)[];
115
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
116
+ useData: boolean;
117
+ };
118
+ "testerNudge:subject": {
119
+ compiler: (string | number)[];
120
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
121
+ useData: boolean;
122
+ };
123
+ "testerNudge:html": {
124
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
125
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
126
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
127
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
128
+ "4": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
129
+ compiler: (string | number)[];
130
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
131
+ usePartial: boolean;
132
+ useData: boolean;
133
+ };
134
+ "testerNudge:text": {
135
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
136
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
137
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
138
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
139
+ compiler: (string | number)[];
140
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
141
+ useData: boolean;
142
+ };
143
+ "passwordChanged:subject": {
144
+ compiler: (string | number)[];
145
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
146
+ useData: boolean;
147
+ };
148
+ "passwordChanged:html": {
149
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
150
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
151
+ compiler: (string | number)[];
152
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
153
+ usePartial: boolean;
154
+ useData: boolean;
155
+ };
156
+ "passwordChanged:text": {
157
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
158
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
159
+ compiler: (string | number)[];
160
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
161
+ useData: boolean;
162
+ };
163
+ "operationalNotice:subject": {
164
+ compiler: (string | number)[];
165
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
166
+ useData: boolean;
167
+ };
168
+ "operationalNotice:html": {
169
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
170
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
171
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
172
+ "3": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
173
+ compiler: (string | number)[];
174
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
175
+ usePartial: boolean;
176
+ useData: boolean;
177
+ useDepths: boolean;
178
+ };
179
+ "operationalNotice:text": {
180
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
181
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
182
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
183
+ compiler: (string | number)[];
184
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
185
+ useData: boolean;
186
+ };
187
+ "supportReply:subject": {
188
+ compiler: (string | number)[];
189
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
190
+ useData: boolean;
191
+ };
192
+ "supportReply:html": {
193
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
194
+ compiler: (string | number)[];
195
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
196
+ usePartial: boolean;
197
+ useData: boolean;
198
+ };
199
+ "supportReply:text": {
200
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
201
+ compiler: (string | number)[];
202
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
203
+ useData: boolean;
204
+ };
205
+ "newsletter:subject": {
206
+ compiler: (string | number)[];
207
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
208
+ useData: boolean;
209
+ };
210
+ "newsletter:html": {
211
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
212
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
213
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
214
+ compiler: (string | number)[];
215
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any, blockParams: any, depths: any) => string;
216
+ usePartial: boolean;
217
+ useData: boolean;
218
+ useDepths: boolean;
219
+ };
220
+ "newsletter:text": {
221
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
222
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
223
+ compiler: (string | number)[];
224
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
225
+ useData: boolean;
226
+ };
227
+ "leadCapture:subject": {
228
+ compiler: (string | number)[];
229
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
230
+ useData: boolean;
231
+ };
232
+ "leadCapture:html": {
233
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
234
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
235
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
236
+ compiler: (string | number)[];
237
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
238
+ usePartial: boolean;
239
+ useData: boolean;
240
+ };
241
+ "leadCapture:text": {
242
+ "0": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
243
+ "1": (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
244
+ "2": (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
245
+ compiler: (string | number)[];
246
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
247
+ useData: boolean;
248
+ };
249
+ "marketingCampaign:subject": {
250
+ compiler: (string | number)[];
251
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => any;
252
+ useData: boolean;
253
+ };
254
+ "marketingCampaign:html": {
255
+ compiler: (string | number)[];
256
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
257
+ usePartial: boolean;
258
+ useData: boolean;
259
+ };
260
+ "marketingCampaign:text": {
261
+ compiler: (string | number)[];
262
+ main: (container: any, depth0: any, helpers: any, partials: any, data: any) => string;
263
+ useData: boolean;
264
+ };
265
+ };
266
+ //# sourceMappingURL=precompiled.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"precompiled.generated.d.ts","sourceRoot":"","sources":["../../src/templates/precompiled.generated.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAmL/B,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAioChC,CAAC"}