@open-wa/schema 5.9.7 → 5.11.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 (67) hide show
  1. package/dist/generated/index.cjs +1 -1
  2. package/dist/generated/index.cjs.map +1 -1
  3. package/dist/generated/index.d.cts +141 -583
  4. package/dist/generated/index.d.cts.map +1 -1
  5. package/dist/generated/index.d.mts +141 -583
  6. package/dist/generated/index.d.mts.map +1 -1
  7. package/dist/generated/index.mjs +1 -1
  8. package/dist/generated/index.mjs.map +1 -1
  9. package/dist/{index-j2GMQzWY.d.mts → index-DlfSVhzo.d.mts} +53 -234
  10. package/dist/index-DlfSVhzo.d.mts.map +1 -0
  11. package/dist/{index-BR61SSKs.d.cts → index-JLPIa9s-.d.cts} +53 -234
  12. package/dist/index-JLPIa9s-.d.cts.map +1 -0
  13. package/dist/index.cjs +20 -11
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.cts +3 -3
  16. package/dist/index.d.mts +3 -3
  17. package/dist/index.mjs +16 -10
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/{interactive-DxUwKpzK.d.cts → interactive-BE_M4nur.d.cts} +14 -6
  20. package/dist/interactive-BE_M4nur.d.cts.map +1 -0
  21. package/dist/{interactive-DxUwKpzK.d.mts → interactive-BE_M4nur.d.mts} +14 -6
  22. package/dist/interactive-BE_M4nur.d.mts.map +1 -0
  23. package/dist/interactive-ClvvgmVP.cjs +630 -0
  24. package/dist/interactive-ClvvgmVP.cjs.map +1 -0
  25. package/dist/interactive-Dec4HB2U.mjs +475 -0
  26. package/dist/interactive-Dec4HB2U.mjs.map +1 -0
  27. package/dist/interactive.cjs +26 -304
  28. package/dist/interactive.d.cts +2 -2
  29. package/dist/interactive.d.mts +2 -2
  30. package/dist/interactive.mjs +2 -283
  31. package/dist/methods/index.cjs +1 -1
  32. package/dist/methods/index.d.cts +1 -1
  33. package/dist/methods/index.d.mts +1 -1
  34. package/dist/methods/index.mjs +1 -1
  35. package/dist/{methods-D4XLSUxh.cjs → methods-CILSsPyT.cjs} +27 -93
  36. package/dist/methods-CILSsPyT.cjs.map +1 -0
  37. package/dist/{methods-CpeSpB2P.mjs → methods-L7ijqbZM.mjs} +19 -79
  38. package/dist/methods-L7ijqbZM.mjs.map +1 -0
  39. package/package.json +3 -3
  40. package/src/__tests__/booking-time.contract.test.ts +88 -0
  41. package/src/__tests__/generators.contract.test.ts +82 -45
  42. package/src/booking-time.ts +39 -0
  43. package/src/common-types.ts +1 -1
  44. package/src/effect-projection.ts +90 -47
  45. package/src/events/asyncapi.ts +2 -2
  46. package/src/events/contracts.ts +10 -3
  47. package/src/events/polls.ts +1 -1
  48. package/src/generated/BaseClient.ts +12 -12
  49. package/src/generated/asyncapi.json +206 -95
  50. package/src/generated/openapi.json +1702 -1337
  51. package/src/interactive.ts +12 -1
  52. package/src/methods/calls.ts +4 -4
  53. package/src/methods/contacts.ts +1 -1
  54. package/src/methods/groups.ts +2 -2
  55. package/src/methods/messaging.ts +7 -7
  56. package/src/methods/session.ts +1 -1
  57. package/src/methods/whatsapp-events.ts +1 -1
  58. package/src/parameters.ts +2 -2
  59. package/src/return-types.ts +1 -1
  60. package/dist/index-BR61SSKs.d.cts.map +0 -1
  61. package/dist/index-j2GMQzWY.d.mts.map +0 -1
  62. package/dist/interactive-DxUwKpzK.d.cts.map +0 -1
  63. package/dist/interactive-DxUwKpzK.d.mts.map +0 -1
  64. package/dist/interactive.cjs.map +0 -1
  65. package/dist/interactive.mjs.map +0 -1
  66. package/dist/methods-CpeSpB2P.mjs.map +0 -1
  67. package/dist/methods-D4XLSUxh.cjs.map +0 -1
@@ -0,0 +1,630 @@
1
+ let zod = require("zod");
2
+ let effect = require("effect");
3
+ //#region src/effect-projection.ts
4
+ /** JSON Schema is presentation metadata; Effect remains the validation/codec authority. */
5
+ function projectDocument(document) {
6
+ const project = (node) => {
7
+ let value;
8
+ if (node.allOf) {
9
+ const { allOf, ...base } = node;
10
+ value = project(base);
11
+ for (const clause of allOf) value = Object.keys(clause).every((key) => [
12
+ "title",
13
+ "description",
14
+ "examples",
15
+ "format"
16
+ ].includes(key)) ? value.meta(clause) : zod.z.intersection(value, project({
17
+ type: node.type,
18
+ ...clause
19
+ }));
20
+ } else if (node.$ref) {
21
+ const key = node.$ref.split("/").at(-1);
22
+ value = project(document.definitions[key]);
23
+ } else if ("const" in node) value = zod.z.literal(node.const);
24
+ else if (node.enum) value = zod.z.union(node.enum.map((item) => zod.z.literal(item)));
25
+ else if (node.anyOf ?? node.oneOf) value = zod.z.union((node.anyOf ?? node.oneOf).map(project));
26
+ else switch (node.type) {
27
+ case "string": {
28
+ let string = zod.z.string();
29
+ if (node.minLength !== void 0) string = string.min(node.minLength);
30
+ if (node.maxLength !== void 0) string = string.max(node.maxLength);
31
+ if (node.pattern !== void 0) string = string.regex(new RegExp(node.pattern));
32
+ value = string;
33
+ break;
34
+ }
35
+ case "number":
36
+ case "integer": {
37
+ let number = node.type === "integer" ? zod.z.number().int() : zod.z.number();
38
+ if (node.minimum !== void 0) number = number.min(node.minimum);
39
+ if (node.maximum !== void 0) number = number.max(node.maximum);
40
+ if (node.exclusiveMinimum !== void 0) number = number.gt(node.exclusiveMinimum);
41
+ if (node.exclusiveMaximum !== void 0) number = number.lt(node.exclusiveMaximum);
42
+ value = number;
43
+ break;
44
+ }
45
+ case "boolean":
46
+ value = zod.z.boolean();
47
+ break;
48
+ case "null":
49
+ value = zod.z.null();
50
+ break;
51
+ case "array":
52
+ value = zod.z.array(project(node.items ?? {}));
53
+ break;
54
+ case "object": {
55
+ const properties = node.properties ?? {};
56
+ const values = typeof node.additionalProperties === "object" ? project(node.additionalProperties) : node.additionalProperties ? zod.z.unknown() : void 0;
57
+ if (!Object.keys(properties).length && values) {
58
+ value = zod.z.record(zod.z.string(), values);
59
+ break;
60
+ }
61
+ const required = new Set(node.required ?? []);
62
+ const object = zod.z.object(Object.fromEntries(Object.entries(properties).map(([key, field]) => {
63
+ const property = project(field);
64
+ return [key, required.has(key) ? property : property.optional()];
65
+ })));
66
+ value = values ? object.catchall(values) : object;
67
+ break;
68
+ }
69
+ default: value = zod.z.unknown();
70
+ }
71
+ const { title, description, examples, format } = node;
72
+ return value.meta({
73
+ ...title ? { title } : {},
74
+ ...description ? { description } : {},
75
+ ...examples ? { examples } : {},
76
+ ...format ? { format } : {}
77
+ });
78
+ };
79
+ return project(document.schema);
80
+ }
81
+ /** Project synchronous Effect contracts into the method/listener/OpenUI registry. */
82
+ function projectEffectSchema(schema) {
83
+ const decoded = effect.Schema.toType(schema);
84
+ const encoded = effect.Schema.toEncoded(schema);
85
+ if ("fields" in schema) {
86
+ const fields = schema.fields;
87
+ const shape = Object.fromEntries(Object.entries(fields).map(([name, field]) => {
88
+ const optional = field.ast.context?.isOptional === true;
89
+ const hasUndefined = field.ast._tag === "Union" && field.ast.types.some((member) => member._tag === "Undefined");
90
+ const value = projectEffectSchema(!optional ? field : hasUndefined ? effect.Schema.required(field) : effect.Schema.requiredKey(field));
91
+ return [name, optional ? value.optional() : value];
92
+ }));
93
+ return zod.z.object(shape).superRefine((value, ctx) => {
94
+ try {
95
+ effect.Schema.decodeUnknownSync(decoded)(value);
96
+ } catch (error) {
97
+ ctx.addIssue({
98
+ code: "custom",
99
+ message: String(error)
100
+ });
101
+ }
102
+ }).meta(effect.Schema.resolveAnnotations(schema) ?? {});
103
+ }
104
+ if (encoded.ast === decoded.ast) return projectDocument(effect.Schema.toJsonSchemaDocument(schema)).superRefine((value, ctx) => {
105
+ try {
106
+ effect.Schema.decodeUnknownSync(schema)(value);
107
+ } catch (error) {
108
+ ctx.addIssue({
109
+ code: "custom",
110
+ message: String(error)
111
+ });
112
+ }
113
+ }).meta(effect.Schema.resolveAnnotations(schema) ?? {});
114
+ return zod.z.codec(projectDocument(effect.Schema.toJsonSchemaDocument(encoded)), projectDocument(effect.Schema.toJsonSchemaDocument(decoded)), {
115
+ decode: (value, ctx) => {
116
+ try {
117
+ return effect.Schema.decodeUnknownSync(schema)(value);
118
+ } catch (error) {
119
+ ctx.issues.push({
120
+ code: "custom",
121
+ input: value,
122
+ message: String(error)
123
+ });
124
+ return zod.z.NEVER;
125
+ }
126
+ },
127
+ encode: (value, ctx) => {
128
+ try {
129
+ return effect.Schema.encodeSync(schema)(effect.Schema.decodeUnknownSync(decoded)(value));
130
+ } catch (error) {
131
+ ctx.issues.push({
132
+ code: "custom",
133
+ input: value,
134
+ message: String(error)
135
+ });
136
+ return zod.z.NEVER;
137
+ }
138
+ }
139
+ });
140
+ }
141
+ //#endregion
142
+ //#region src/booking-time.ts
143
+ const isoTimestamp = /^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/u;
144
+ const utcSeconds = /^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\dZ$/u;
145
+ const calendarDate = effect.Schema.makeFilter((value) => {
146
+ const year = Number(value.slice(0, 4));
147
+ const month = Number(value.slice(5, 7));
148
+ const day = Number(value.slice(8, 10));
149
+ const days = [
150
+ 31,
151
+ year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 29 : 28,
152
+ 31,
153
+ 30,
154
+ 31,
155
+ 30,
156
+ 31,
157
+ 31,
158
+ 30,
159
+ 31,
160
+ 30,
161
+ 31
162
+ ];
163
+ return month >= 1 && month <= 12 && day >= 1 && day <= days[month - 1] && Number.isFinite(Date.parse(value)) || "Use a real calendar date and an explicit UTC or numeric timezone";
164
+ }, { toJsonSchema: () => [{}, true] });
165
+ const canonicalTimestamp = effect.Schema.String.check(effect.Schema.isPattern(utcSeconds), calendarDate).annotate({
166
+ title: "BookingTimestamp",
167
+ description: "Validated native booking timestamp, encoded as UTC ISO 8601 with whole seconds and no fractional seconds.",
168
+ format: "date-time",
169
+ examples: ["2026-10-26T14:00:00Z"]
170
+ }).pipe(effect.Schema.brand("BookingTimestamp"));
171
+ /** Effect owns validation, normalization and encoding for native booking dates. */
172
+ const BookingTimestampSchema = effect.Schema.String.check(effect.Schema.isPattern(isoTimestamp), calendarDate).annotate({
173
+ description: "ISO 8601 booking timestamp with an explicit timezone. Decoding converts offsets and fractional seconds to UTC whole seconds for WhatsApp.",
174
+ format: "date-time",
175
+ examples: ["2026-10-26T14:00:00Z", "2026-07-26T14:00:00.000+01:00"]
176
+ }).pipe(effect.Schema.decodeTo(canonicalTimestamp, {
177
+ decode: effect.SchemaGetter.transform((value) => new Date(value).toISOString().replace(/\.\d{3}Z$/, "Z")),
178
+ encode: effect.SchemaGetter.transform((value) => value)
179
+ }));
180
+ /** Validate and normalize an external timestamp before constructing typed booking data. */
181
+ const normalizeBookingTimestamp = effect.Schema.decodeUnknownSync(BookingTimestampSchema);
182
+ //#endregion
183
+ //#region src/interactive.ts
184
+ /** Serving projection of the canonical Effect booking codec. */
185
+ const BookingTimestampRegistrySchema = projectEffectSchema(BookingTimestampSchema);
186
+ const JsonValueSchema = zod.z.lazy(() => zod.z.union([
187
+ zod.z.null(),
188
+ zod.z.boolean(),
189
+ zod.z.number().finite(),
190
+ zod.z.string(),
191
+ zod.z.array(JsonValueSchema),
192
+ zod.z.record(zod.z.string(), JsonValueSchema)
193
+ ]));
194
+ const JsonObjectSchema = zod.z.record(zod.z.string(), JsonValueSchema);
195
+ const text = zod.z.string().min(1);
196
+ const url = zod.z.url().refine((value) => /^https?:\/\//i.test(value), "Use an HTTP or HTTPS URL");
197
+ const id = text.describe("Stable application-defined ID returned when the recipient chooses this item");
198
+ const ReplyActionSchema = zod.z.object({
199
+ type: zod.z.literal("reply"),
200
+ id,
201
+ label: text
202
+ }).strict();
203
+ const LinkActionSchema = zod.z.object({
204
+ type: zod.z.literal("url"),
205
+ label: text,
206
+ url
207
+ }).strict();
208
+ const CallActionSchema = zod.z.object({
209
+ type: zod.z.literal("call"),
210
+ label: text,
211
+ phoneNumber: text
212
+ }).strict();
213
+ const CopyActionSchema = zod.z.object({
214
+ type: zod.z.literal("copy"),
215
+ label: text,
216
+ code: text
217
+ }).strict();
218
+ const InteractiveActionSchema = zod.z.discriminatedUnion("type", [
219
+ ReplyActionSchema,
220
+ LinkActionSchema,
221
+ CallActionSchema,
222
+ CopyActionSchema
223
+ ]);
224
+ const NativeActionSchema = zod.z.object({
225
+ name: text.describe("WhatsApp native action name; availability depends on the recipient and account"),
226
+ parameters: JsonObjectSchema.optional()
227
+ }).strict();
228
+ const actions = zod.z.array(InteractiveActionSchema).min(1).superRefine((items, ctx) => {
229
+ const replies = items.filter((item) => item.type === "reply");
230
+ if (replies.length && replies.length !== items.length) ctx.addIssue({
231
+ code: "custom",
232
+ message: "Reply actions cannot be mixed with URL, call or copy actions"
233
+ });
234
+ const ids = /* @__PURE__ */ new Set();
235
+ items.forEach((item, index) => {
236
+ if (item.type !== "reply") return;
237
+ if (ids.has(item.id)) ctx.addIssue({
238
+ code: "custom",
239
+ path: [index, "id"],
240
+ message: "Duplicate reply ID"
241
+ });
242
+ ids.add(item.id);
243
+ });
244
+ });
245
+ const media = {
246
+ source: text.describe("HTTP(S) URL, local file path or base64 data URL; resolved by the client before sending"),
247
+ filename: text.optional(),
248
+ title: zod.z.string().optional()
249
+ };
250
+ const InteractiveHeaderSchema = zod.z.discriminatedUnion("type", [
251
+ zod.z.object({
252
+ type: zod.z.literal("text"),
253
+ text
254
+ }).strict(),
255
+ zod.z.object({
256
+ type: zod.z.literal("image"),
257
+ ...media
258
+ }).strict(),
259
+ zod.z.object({
260
+ type: zod.z.literal("video"),
261
+ ...media
262
+ }).strict(),
263
+ zod.z.object({
264
+ type: zod.z.literal("document"),
265
+ ...media
266
+ }).strict()
267
+ ]);
268
+ const base = {
269
+ version: zod.z.literal(1).optional().describe("Document format version, defaults to 1; independent of WhatsApp protocol versions"),
270
+ body: text,
271
+ footer: zod.z.string().optional()
272
+ };
273
+ const ButtonsContentSchema = zod.z.object({
274
+ ...base,
275
+ type: zod.z.literal("buttons"),
276
+ header: InteractiveHeaderSchema.optional(),
277
+ actions
278
+ }).strict();
279
+ const ListRowSchema = zod.z.object({
280
+ id,
281
+ title: text,
282
+ description: zod.z.string().optional()
283
+ }).strict();
284
+ const ListContentSchema = zod.z.object({
285
+ ...base,
286
+ type: zod.z.literal("list"),
287
+ title: zod.z.string().optional(),
288
+ buttonLabel: text.default("Choose an option"),
289
+ sections: zod.z.array(zod.z.object({
290
+ title: zod.z.string().optional(),
291
+ rows: zod.z.array(ListRowSchema).min(1)
292
+ }).strict()).min(1)
293
+ }).strict();
294
+ const FormQuestionSchema = zod.z.object({
295
+ type: zod.z.enum(["singleSelect", "multiSelect"]),
296
+ id,
297
+ label: text,
298
+ options: zod.z.array(zod.z.object({
299
+ id,
300
+ label: text
301
+ }).strict()).min(1),
302
+ allowCustomAnswer: zod.z.boolean().optional()
303
+ }).strict();
304
+ const FormContentSchema = zod.z.object({
305
+ ...base,
306
+ type: zod.z.literal("form"),
307
+ title: zod.z.string().optional(),
308
+ questions: zod.z.array(FormQuestionSchema).min(1)
309
+ }).strict();
310
+ const CarouselCardSchema = zod.z.object({
311
+ body: text,
312
+ header: zod.z.object({
313
+ type: zod.z.literal("image"),
314
+ ...media
315
+ }).strict(),
316
+ actions
317
+ }).strict();
318
+ const CarouselContentSchema = zod.z.object({
319
+ ...base,
320
+ type: zod.z.literal("carousel"),
321
+ cards: zod.z.array(CarouselCardSchema).min(1)
322
+ }).strict();
323
+ const BookingContentSchema = zod.z.object({
324
+ ...base,
325
+ type: zod.z.literal("booking"),
326
+ title: zod.z.string().optional(),
327
+ buttonLabel: text.default("View booking"),
328
+ booking: zod.z.object({
329
+ startAt: BookingTimestampRegistrySchema,
330
+ endAt: BookingTimestampRegistrySchema.optional(),
331
+ location: zod.z.string().optional(),
332
+ url: url.optional(),
333
+ managementUrl: url.optional(),
334
+ phoneNumber: zod.z.string().optional(),
335
+ email: zod.z.email().optional(),
336
+ description: zod.z.string().optional(),
337
+ labels: zod.z.object({
338
+ language: zod.z.string().optional(),
339
+ meetingType: zod.z.string().optional(),
340
+ detailsTitle: zod.z.string().optional(),
341
+ addToCalendar: zod.z.string().optional(),
342
+ viewOnMap: zod.z.string().optional(),
343
+ manageBooking: zod.z.string().optional()
344
+ }).strict().optional()
345
+ }).strict(),
346
+ actions: zod.z.array(zod.z.discriminatedUnion("type", [
347
+ LinkActionSchema,
348
+ CallActionSchema,
349
+ CopyActionSchema
350
+ ])).optional()
351
+ }).strict();
352
+ const NativeContentSchema = zod.z.object({
353
+ ...base,
354
+ type: zod.z.literal("native"),
355
+ header: InteractiveHeaderSchema.optional(),
356
+ actions: zod.z.array(NativeActionSchema).min(1),
357
+ parameters: JsonObjectSchema.optional()
358
+ }).strict().describe("Advanced extension for new native action types; parameters are passed through without claiming recipient support");
359
+ const InteractiveContentSchema = zod.z.discriminatedUnion("type", [
360
+ ButtonsContentSchema,
361
+ ListContentSchema,
362
+ FormContentSchema,
363
+ CarouselContentSchema,
364
+ BookingContentSchema,
365
+ NativeContentSchema
366
+ ]).superRefine((content, ctx) => {
367
+ const unique = (items, path) => {
368
+ const seen = /* @__PURE__ */ new Set();
369
+ items.forEach((item, index) => {
370
+ if (seen.has(item.id)) ctx.addIssue({
371
+ code: "custom",
372
+ path: [
373
+ ...path,
374
+ index,
375
+ "id"
376
+ ],
377
+ message: "IDs must be unique"
378
+ });
379
+ seen.add(item.id);
380
+ });
381
+ };
382
+ if (content.type === "form") {
383
+ unique(content.questions, ["questions"]);
384
+ content.questions.forEach((q, index) => {
385
+ unique(q.options, [
386
+ "questions",
387
+ index,
388
+ "options"
389
+ ]);
390
+ if (q.id === "__openwa_form__") ctx.addIssue({
391
+ code: "custom",
392
+ path: [
393
+ "questions",
394
+ index,
395
+ "id"
396
+ ],
397
+ message: "This question ID is reserved"
398
+ });
399
+ });
400
+ }
401
+ if (content.type === "list") {
402
+ const seen = /* @__PURE__ */ new Set();
403
+ content.sections.forEach((section, s) => section.rows.forEach((row, r) => {
404
+ if (seen.has(row.id)) ctx.addIssue({
405
+ code: "custom",
406
+ path: [
407
+ "sections",
408
+ s,
409
+ "rows",
410
+ r,
411
+ "id"
412
+ ],
413
+ message: "Row IDs must be unique across sections"
414
+ });
415
+ seen.add(row.id);
416
+ }));
417
+ }
418
+ if (content.type === "booking" && content.booking.endAt && Date.parse(content.booking.endAt) <= Date.parse(content.booking.startAt)) ctx.addIssue({
419
+ code: "custom",
420
+ path: ["booking", "endAt"],
421
+ message: "Booking end must be after its start"
422
+ });
423
+ if (content.type === "booking" && ![
424
+ content.booking.location,
425
+ content.booking.url,
426
+ content.booking.phoneNumber
427
+ ].some((value) => value?.trim())) ctx.addIssue({
428
+ code: "custom",
429
+ path: ["booking", "location"],
430
+ message: "A booking needs a location, booking URL or phone number"
431
+ });
432
+ });
433
+ /** Validate a JSON document without sending it or loading media; suitable for UI builders. */
434
+ function defineInteractiveMessage(content) {
435
+ return InteractiveContentSchema.parse(content);
436
+ }
437
+ const responseBase = {
438
+ messageId: text,
439
+ chatId: text,
440
+ senderId: text,
441
+ originalMessageId: zod.z.string().optional().describe("Original WhatsApp stanza ID; may not be a full serialized message key"),
442
+ timestamp: zod.z.number().optional(),
443
+ raw: JsonObjectSchema
444
+ };
445
+ const FormResponseSchema = zod.z.object({
446
+ ...responseBase,
447
+ type: zod.z.literal("form"),
448
+ answers: zod.z.record(zod.z.string(), zod.z.union([zod.z.string(), zod.z.array(zod.z.string())]))
449
+ });
450
+ const InteractiveResponseSchema = zod.z.discriminatedUnion("type", [
451
+ FormResponseSchema,
452
+ zod.z.object({
453
+ ...responseBase,
454
+ type: zod.z.literal("reply"),
455
+ id: text,
456
+ label: zod.z.string().optional()
457
+ }),
458
+ zod.z.object({
459
+ ...responseBase,
460
+ type: zod.z.literal("list"),
461
+ id: text,
462
+ label: zod.z.string().optional()
463
+ }),
464
+ zod.z.object({
465
+ ...responseBase,
466
+ type: zod.z.literal("native"),
467
+ name: text,
468
+ parameters: JsonValueSchema.optional(),
469
+ parseError: zod.z.string().optional()
470
+ })
471
+ ]);
472
+ //#endregion
473
+ Object.defineProperty(exports, "BookingContentSchema", {
474
+ enumerable: true,
475
+ get: function() {
476
+ return BookingContentSchema;
477
+ }
478
+ });
479
+ Object.defineProperty(exports, "BookingTimestampRegistrySchema", {
480
+ enumerable: true,
481
+ get: function() {
482
+ return BookingTimestampRegistrySchema;
483
+ }
484
+ });
485
+ Object.defineProperty(exports, "BookingTimestampSchema", {
486
+ enumerable: true,
487
+ get: function() {
488
+ return BookingTimestampSchema;
489
+ }
490
+ });
491
+ Object.defineProperty(exports, "ButtonsContentSchema", {
492
+ enumerable: true,
493
+ get: function() {
494
+ return ButtonsContentSchema;
495
+ }
496
+ });
497
+ Object.defineProperty(exports, "CallActionSchema", {
498
+ enumerable: true,
499
+ get: function() {
500
+ return CallActionSchema;
501
+ }
502
+ });
503
+ Object.defineProperty(exports, "CarouselCardSchema", {
504
+ enumerable: true,
505
+ get: function() {
506
+ return CarouselCardSchema;
507
+ }
508
+ });
509
+ Object.defineProperty(exports, "CarouselContentSchema", {
510
+ enumerable: true,
511
+ get: function() {
512
+ return CarouselContentSchema;
513
+ }
514
+ });
515
+ Object.defineProperty(exports, "CopyActionSchema", {
516
+ enumerable: true,
517
+ get: function() {
518
+ return CopyActionSchema;
519
+ }
520
+ });
521
+ Object.defineProperty(exports, "FormContentSchema", {
522
+ enumerable: true,
523
+ get: function() {
524
+ return FormContentSchema;
525
+ }
526
+ });
527
+ Object.defineProperty(exports, "FormQuestionSchema", {
528
+ enumerable: true,
529
+ get: function() {
530
+ return FormQuestionSchema;
531
+ }
532
+ });
533
+ Object.defineProperty(exports, "FormResponseSchema", {
534
+ enumerable: true,
535
+ get: function() {
536
+ return FormResponseSchema;
537
+ }
538
+ });
539
+ Object.defineProperty(exports, "InteractiveActionSchema", {
540
+ enumerable: true,
541
+ get: function() {
542
+ return InteractiveActionSchema;
543
+ }
544
+ });
545
+ Object.defineProperty(exports, "InteractiveContentSchema", {
546
+ enumerable: true,
547
+ get: function() {
548
+ return InteractiveContentSchema;
549
+ }
550
+ });
551
+ Object.defineProperty(exports, "InteractiveHeaderSchema", {
552
+ enumerable: true,
553
+ get: function() {
554
+ return InteractiveHeaderSchema;
555
+ }
556
+ });
557
+ Object.defineProperty(exports, "InteractiveResponseSchema", {
558
+ enumerable: true,
559
+ get: function() {
560
+ return InteractiveResponseSchema;
561
+ }
562
+ });
563
+ Object.defineProperty(exports, "JsonObjectSchema", {
564
+ enumerable: true,
565
+ get: function() {
566
+ return JsonObjectSchema;
567
+ }
568
+ });
569
+ Object.defineProperty(exports, "JsonValueSchema", {
570
+ enumerable: true,
571
+ get: function() {
572
+ return JsonValueSchema;
573
+ }
574
+ });
575
+ Object.defineProperty(exports, "LinkActionSchema", {
576
+ enumerable: true,
577
+ get: function() {
578
+ return LinkActionSchema;
579
+ }
580
+ });
581
+ Object.defineProperty(exports, "ListContentSchema", {
582
+ enumerable: true,
583
+ get: function() {
584
+ return ListContentSchema;
585
+ }
586
+ });
587
+ Object.defineProperty(exports, "ListRowSchema", {
588
+ enumerable: true,
589
+ get: function() {
590
+ return ListRowSchema;
591
+ }
592
+ });
593
+ Object.defineProperty(exports, "NativeActionSchema", {
594
+ enumerable: true,
595
+ get: function() {
596
+ return NativeActionSchema;
597
+ }
598
+ });
599
+ Object.defineProperty(exports, "NativeContentSchema", {
600
+ enumerable: true,
601
+ get: function() {
602
+ return NativeContentSchema;
603
+ }
604
+ });
605
+ Object.defineProperty(exports, "ReplyActionSchema", {
606
+ enumerable: true,
607
+ get: function() {
608
+ return ReplyActionSchema;
609
+ }
610
+ });
611
+ Object.defineProperty(exports, "defineInteractiveMessage", {
612
+ enumerable: true,
613
+ get: function() {
614
+ return defineInteractiveMessage;
615
+ }
616
+ });
617
+ Object.defineProperty(exports, "normalizeBookingTimestamp", {
618
+ enumerable: true,
619
+ get: function() {
620
+ return normalizeBookingTimestamp;
621
+ }
622
+ });
623
+ Object.defineProperty(exports, "projectEffectSchema", {
624
+ enumerable: true,
625
+ get: function() {
626
+ return projectEffectSchema;
627
+ }
628
+ });
629
+
630
+ //# sourceMappingURL=interactive-ClvvgmVP.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-ClvvgmVP.cjs","names":["z","Schema","Schema","SchemaGetter","z"],"sources":["../src/effect-projection.ts","../src/booking-time.ts","../src/interactive.ts"],"sourcesContent":["import { Schema } from 'effect';\nimport { z } from 'zod';\n\ntype JsonSchema = { $ref?: string; type?: string; const?: unknown; enum?: unknown[]; anyOf?: JsonSchema[]; oneOf?: JsonSchema[]; allOf?: JsonSchema[]; properties?: Record<string, JsonSchema>; required?: string[]; items?: JsonSchema; additionalProperties?: boolean | JsonSchema; minimum?: number; maximum?: number; exclusiveMinimum?: number; exclusiveMaximum?: number; minLength?: number; maxLength?: number; pattern?: string; format?: string; title?: string; description?: string; examples?: unknown[] };\nexport type SyncEffectSchema = Schema.Top & Schema.ConstraintCodec<unknown, unknown>;\n\n/** JSON Schema is presentation metadata; Effect remains the validation/codec authority. */\nfunction projectDocument(document: ReturnType<typeof Schema.toJsonSchemaDocument>): z.ZodType {\n const project = (node: JsonSchema): z.ZodType => {\n let value: z.ZodType;\n if (node.allOf) {\n const { allOf, ...base } = node;\n value = project(base);\n for (const clause of allOf) {\n const metadataOnly = Object.keys(clause).every(key => ['title', 'description', 'examples', 'format'].includes(key));\n value = metadataOnly ? value.meta(clause) : z.intersection(value, project({ type: node.type, ...clause }));\n }\n } else if (node.$ref) {\n const key = node.$ref.split('/').at(-1)!;\n value = project(document.definitions[key] as JsonSchema);\n } else if ('const' in node) value = z.literal(node.const as string | number | boolean | null);\n else if (node.enum) value = z.union(node.enum.map(item => z.literal(item as string | number | boolean | null)));\n else if (node.anyOf ?? node.oneOf) value = z.union((node.anyOf ?? node.oneOf)!.map(project));\n else switch (node.type) {\n case 'string': {\n let string = z.string();\n if (node.minLength !== undefined) string = string.min(node.minLength);\n if (node.maxLength !== undefined) string = string.max(node.maxLength);\n if (node.pattern !== undefined) string = string.regex(new RegExp(node.pattern));\n value = string;\n break;\n }\n case 'number':\n case 'integer': {\n let number = node.type === 'integer' ? z.number().int() : z.number();\n if (node.minimum !== undefined) number = number.min(node.minimum);\n if (node.maximum !== undefined) number = number.max(node.maximum);\n if (node.exclusiveMinimum !== undefined) number = number.gt(node.exclusiveMinimum);\n if (node.exclusiveMaximum !== undefined) number = number.lt(node.exclusiveMaximum);\n value = number;\n break;\n }\n case 'boolean': value = z.boolean(); break;\n case 'null': value = z.null(); break;\n case 'array': value = z.array(project(node.items ?? {})); break;\n case 'object': {\n const properties = node.properties ?? {};\n const values = typeof node.additionalProperties === 'object' ? project(node.additionalProperties) : node.additionalProperties ? z.unknown() : undefined;\n if (!Object.keys(properties).length && values) { value = z.record(z.string(), values); break; }\n const required = new Set(node.required ?? []);\n const object = z.object(Object.fromEntries(Object.entries(properties).map(([key, field]) => {\n const property = project(field);\n return [key, required.has(key) ? property : property.optional()];\n })));\n value = values ? object.catchall(values) : object;\n break;\n }\n default: value = z.unknown();\n }\n const { title, description, examples, format } = node;\n return value.meta({ ...(title ? { title } : {}), ...(description ? { description } : {}), ...(examples ? { examples } : {}), ...(format ? { format } : {}) });\n };\n return project(document.schema as JsonSchema);\n}\n\n/** Project synchronous Effect contracts into the method/listener/OpenUI registry. */\nexport function projectEffectSchema<S extends SyncEffectSchema>(schema: S): z.ZodType<S['Type'], S['Encoded']> {\n const decoded = Schema.toType(schema);\n const encoded = Schema.toEncoded(schema);\n // Keep Struct.shape for the serving registry, while field codecs perform their\n // real transformations and decoded Struct checks remain authoritative.\n if ('fields' in schema) {\n const fields = schema.fields as Record<string, SyncEffectSchema>;\n const shape = Object.fromEntries(Object.entries(fields).map(([name, field]) => {\n const optional = field.ast.context?.isOptional === true;\n const hasUndefined = field.ast._tag === 'Union' && field.ast.types.some(member => member._tag === 'Undefined');\n const valueSchema = !optional ? field : hasUndefined\n ? Schema.required(field as Schema.optional<SyncEffectSchema>)\n : Schema.requiredKey(field as Schema.optionalKey<SyncEffectSchema>);\n const value = projectEffectSchema(valueSchema);\n return [name, optional ? value.optional() : value];\n }));\n return z.object(shape).superRefine((value, ctx) => {\n try { Schema.decodeUnknownSync(decoded)(value); }\n catch (error) { ctx.addIssue({ code: 'custom', message: String(error) }); }\n }).meta(Schema.resolveAnnotations(schema) ?? {}) as z.ZodType<S['Type'], S['Encoded']>;\n }\n // Identity schemas need Effect's checks but no transformation wrapper. This\n // retains native Zod kinds and input examples for registry documentation.\n if (encoded.ast === decoded.ast) {\n return projectDocument(Schema.toJsonSchemaDocument(schema)).superRefine((value, ctx) => {\n try { Schema.decodeUnknownSync(schema)(value); }\n catch (error) { ctx.addIssue({ code: 'custom', message: String(error) }); }\n }).meta(Schema.resolveAnnotations(schema) ?? {}) as z.ZodType<S['Type'], S['Encoded']>;\n }\n return z.codec(\n projectDocument(Schema.toJsonSchemaDocument(encoded)),\n projectDocument(Schema.toJsonSchemaDocument(decoded)),\n {\n decode: (value, ctx) => {\n try { return Schema.decodeUnknownSync(schema)(value); }\n catch (error) { ctx.issues.push({ code: 'custom', input: value, message: String(error) }); return z.NEVER; }\n },\n encode: (value, ctx) => {\n try { return Schema.encodeSync(schema)(Schema.decodeUnknownSync(decoded)(value)); }\n catch (error) { ctx.issues.push({ code: 'custom', input: value, message: String(error) }); return z.NEVER; }\n },\n },\n ) as z.ZodType<S['Type'], S['Encoded']>;\n}\n","import { Schema, SchemaGetter } from 'effect';\n\nconst isoTimestamp = /^\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|[+-](?:[01]\\d|2[0-3]):[0-5]\\d)$/u;\nconst utcSeconds = /^\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\dZ$/u;\nconst calendarDate = Schema.makeFilter<string>((value) => {\n const year = Number(value.slice(0, 4));\n const month = Number(value.slice(5, 7));\n const day = Number(value.slice(8, 10));\n const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n return month >= 1 && month <= 12 && day >= 1 && day <= days[month - 1] && Number.isFinite(Date.parse(value))\n || 'Use a real calendar date and an explicit UTC or numeric timezone';\n}, {\n // Calendar arithmetic has no exact JSON Schema equivalent; retain the other\n // constraints and let the Effect decoder enforce the complete calendar rule.\n toJsonSchema: () => [{}, true],\n});\n\nconst canonicalTimestamp = Schema.String.check(Schema.isPattern(utcSeconds), calendarDate).annotate({\n title: 'BookingTimestamp',\n description: 'Validated native booking timestamp, encoded as UTC ISO 8601 with whole seconds and no fractional seconds.',\n format: 'date-time',\n examples: ['2026-10-26T14:00:00Z'],\n}).pipe(Schema.brand('BookingTimestamp'));\n\n/** Effect owns validation, normalization and encoding for native booking dates. */\nexport const BookingTimestampSchema = Schema.String.check(Schema.isPattern(isoTimestamp), calendarDate).annotate({\n description: 'ISO 8601 booking timestamp with an explicit timezone. Decoding converts offsets and fractional seconds to UTC whole seconds for WhatsApp.',\n format: 'date-time',\n examples: ['2026-10-26T14:00:00Z', '2026-07-26T14:00:00.000+01:00'],\n}).pipe(Schema.decodeTo(canonicalTimestamp, {\n decode: SchemaGetter.transform((value) => new Date(value).toISOString().replace(/\\.\\d{3}Z$/, 'Z')),\n encode: SchemaGetter.transform((value) => value),\n}));\n\nexport type BookingTimestamp = typeof BookingTimestampSchema.Type;\n\n/** Validate and normalize an external timestamp before constructing typed booking data. */\nexport const normalizeBookingTimestamp = Schema.decodeUnknownSync(BookingTimestampSchema);\n","import { z } from 'zod';\nimport { BookingTimestampSchema } from './booking-time';\nimport { projectEffectSchema } from './effect-projection';\n\nexport { BookingTimestampSchema, normalizeBookingTimestamp, type BookingTimestamp } from './booking-time';\n/** Serving projection of the canonical Effect booking codec. */\nexport const BookingTimestampRegistrySchema = projectEffectSchema(BookingTimestampSchema);\n\n/** A portable JSON document shared by the SDK, HTTP API and message builders. */\nexport type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.lazy(() => z.union([\n z.null(), z.boolean(), z.number().finite(), z.string(),\n z.array(JsonValueSchema), z.record(z.string(), JsonValueSchema),\n]));\nexport const JsonObjectSchema = z.record(z.string(), JsonValueSchema);\nconst text = z.string().min(1);\nconst url = z.url().refine(value => /^https?:\\/\\//i.test(value), 'Use an HTTP or HTTPS URL');\nconst id = text.describe('Stable application-defined ID returned when the recipient chooses this item');\n\nexport const ReplyActionSchema = z.object({ type: z.literal('reply'), id, label: text }).strict();\nexport const LinkActionSchema = z.object({ type: z.literal('url'), label: text, url }).strict();\nexport const CallActionSchema = z.object({ type: z.literal('call'), label: text, phoneNumber: text }).strict();\nexport const CopyActionSchema = z.object({ type: z.literal('copy'), label: text, code: text }).strict();\nexport const InteractiveActionSchema = z.discriminatedUnion('type', [\n ReplyActionSchema, LinkActionSchema, CallActionSchema, CopyActionSchema,\n]);\nexport const NativeActionSchema = z.object({\n name: text.describe('WhatsApp native action name; availability depends on the recipient and account'),\n parameters: JsonObjectSchema.optional(),\n}).strict();\nconst actions = z.array(InteractiveActionSchema).min(1).superRefine((items, ctx) => {\n const replies = items.filter(item => item.type === 'reply');\n if (replies.length && replies.length !== items.length) {\n ctx.addIssue({ code: 'custom', message: 'Reply actions cannot be mixed with URL, call or copy actions' });\n }\n const ids = new Set<string>();\n items.forEach((item, index) => {\n if (item.type !== 'reply') return;\n if (ids.has(item.id)) ctx.addIssue({ code: 'custom', path: [index, 'id'], message: 'Duplicate reply ID' });\n ids.add(item.id);\n });\n});\n\nconst media = {\n source: text.describe('HTTP(S) URL, local file path or base64 data URL; resolved by the client before sending'),\n filename: text.optional(),\n title: z.string().optional(),\n};\nexport const InteractiveHeaderSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('text'), text }).strict(),\n z.object({ type: z.literal('image'), ...media }).strict(),\n z.object({ type: z.literal('video'), ...media }).strict(),\n z.object({ type: z.literal('document'), ...media }).strict(),\n]);\nconst base = {\n version: z.literal(1).optional().describe('Document format version, defaults to 1; independent of WhatsApp protocol versions'),\n body: text,\n footer: z.string().optional(),\n};\nexport const ButtonsContentSchema = z.object({\n ...base, type: z.literal('buttons'), header: InteractiveHeaderSchema.optional(), actions,\n}).strict();\nexport const ListRowSchema = z.object({ id, title: text, description: z.string().optional() }).strict();\nexport const ListContentSchema = z.object({\n ...base, type: z.literal('list'), title: z.string().optional(), buttonLabel: text.default('Choose an option'),\n sections: z.array(z.object({ title: z.string().optional(), rows: z.array(ListRowSchema).min(1) }).strict()).min(1),\n}).strict();\nexport const FormQuestionSchema = z.object({\n type: z.enum(['singleSelect', 'multiSelect']), id, label: text,\n options: z.array(z.object({ id, label: text }).strict()).min(1),\n allowCustomAnswer: z.boolean().optional(),\n}).strict();\nexport const FormContentSchema = z.object({\n ...base, type: z.literal('form'), title: z.string().optional(), questions: z.array(FormQuestionSchema).min(1),\n}).strict();\nexport const CarouselCardSchema = z.object({\n body: text,\n header: z.object({ type: z.literal('image'), ...media }).strict(),\n actions,\n}).strict();\nexport const CarouselContentSchema = z.object({\n ...base, type: z.literal('carousel'), cards: z.array(CarouselCardSchema).min(1),\n}).strict();\nexport const BookingContentSchema = z.object({\n ...base, type: z.literal('booking'), title: z.string().optional(), buttonLabel: text.default('View booking'),\n booking: z.object({\n startAt: BookingTimestampRegistrySchema, endAt: BookingTimestampRegistrySchema.optional(),\n location: z.string().optional(), url: url.optional(), managementUrl: url.optional(),\n phoneNumber: z.string().optional(), email: z.email().optional(), description: z.string().optional(),\n labels: z.object({\n language: z.string().optional(), meetingType: z.string().optional(), detailsTitle: z.string().optional(),\n addToCalendar: z.string().optional(), viewOnMap: z.string().optional(), manageBooking: z.string().optional(),\n }).strict().optional(),\n }).strict(),\n actions: z.array(z.discriminatedUnion('type', [LinkActionSchema, CallActionSchema, CopyActionSchema])).optional(),\n}).strict();\nexport const NativeContentSchema = z.object({\n ...base, type: z.literal('native'), header: InteractiveHeaderSchema.optional(),\n actions: z.array(NativeActionSchema).min(1), parameters: JsonObjectSchema.optional(),\n}).strict().describe('Advanced extension for new native action types; parameters are passed through without claiming recipient support');\n\nexport const InteractiveContentSchema = z.discriminatedUnion('type', [\n ButtonsContentSchema, ListContentSchema, FormContentSchema, CarouselContentSchema, BookingContentSchema, NativeContentSchema,\n]).superRefine((content, ctx) => {\n const unique = (items: { id: string }[], path: (string | number)[]) => {\n const seen = new Set<string>();\n items.forEach((item, index) => {\n if (seen.has(item.id)) ctx.addIssue({ code: 'custom', path: [...path, index, 'id'], message: 'IDs must be unique' });\n seen.add(item.id);\n });\n };\n if (content.type === 'form') {\n unique(content.questions, ['questions']);\n content.questions.forEach((q, index) => {\n unique(q.options, ['questions', index, 'options']);\n if (q.id === '__openwa_form__') ctx.addIssue({ code: 'custom', path: ['questions', index, 'id'], message: 'This question ID is reserved' });\n });\n }\n if (content.type === 'list') {\n const seen = new Set<string>();\n content.sections.forEach((section, s) => section.rows.forEach((row, r) => {\n if (seen.has(row.id)) ctx.addIssue({ code: 'custom', path: ['sections', s, 'rows', r, 'id'], message: 'Row IDs must be unique across sections' });\n seen.add(row.id);\n }));\n }\n if (content.type === 'booking' && content.booking.endAt && Date.parse(content.booking.endAt) <= Date.parse(content.booking.startAt)) {\n ctx.addIssue({ code: 'custom', path: ['booking', 'endAt'], message: 'Booking end must be after its start' });\n }\n if (content.type === 'booking' && ![content.booking.location, content.booking.url, content.booking.phoneNumber].some(value => value?.trim())) {\n ctx.addIssue({ code: 'custom', path: ['booking', 'location'], message: 'A booking needs a location, booking URL or phone number' });\n }\n});\n\nexport type InteractiveContent = z.input<typeof InteractiveContentSchema>;\n/** Parsed documents contain validated, normalized booking timestamps. */\nexport type DecodedInteractiveContent = z.output<typeof InteractiveContentSchema>;\nexport type InteractiveAction = z.infer<typeof InteractiveActionSchema>;\nexport type InteractiveHeader = z.infer<typeof InteractiveHeaderSchema>;\nexport type FormQuestion = z.infer<typeof FormQuestionSchema>;\n/** Validate a JSON document without sending it or loading media; suitable for UI builders. */\nexport function defineInteractiveMessage<T extends InteractiveContent>(content: T): Extract<z.output<typeof InteractiveContentSchema>, { type: T['type'] }> {\n return InteractiveContentSchema.parse(content) as Extract<z.output<typeof InteractiveContentSchema>, { type: T['type'] }>;\n}\n\nconst responseBase = {\n messageId: text, chatId: text, senderId: text,\n originalMessageId: z.string().optional().describe('Original WhatsApp stanza ID; may not be a full serialized message key'),\n timestamp: z.number().optional(),\n raw: JsonObjectSchema,\n};\nexport const FormResponseSchema = z.object({\n ...responseBase, type: z.literal('form'),\n answers: z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n});\nexport const InteractiveResponseSchema = z.discriminatedUnion('type', [\n FormResponseSchema,\n z.object({ ...responseBase, type: z.literal('reply'), id: text, label: z.string().optional() }),\n z.object({ ...responseBase, type: z.literal('list'), id: text, label: z.string().optional() }),\n z.object({ ...responseBase, type: z.literal('native'), name: text, parameters: JsonValueSchema.optional(), parseError: z.string().optional() }),\n]);\nexport type FormResponse = z.infer<typeof FormResponseSchema>;\nexport type InteractiveResponse = z.infer<typeof InteractiveResponseSchema>;\n"],"mappings":";;;;AAOA,SAAS,gBAAgB,UAAqE;CAC5F,MAAM,WAAW,SAAgC;EAC/C,IAAI;EACJ,IAAI,KAAK,OAAO;GACd,MAAM,EAAE,OAAO,GAAG,SAAS;GAC3B,QAAQ,QAAQ,IAAI;GACpB,KAAK,MAAM,UAAU,OAEnB,QADqB,OAAO,KAAK,MAAM,CAAC,CAAC,OAAM,QAAO;IAAC;IAAS;IAAe;IAAY;GAAQ,CAAC,CAAC,SAAS,GAAG,CAC9F,IAAI,MAAM,KAAK,MAAM,IAAIA,IAAAA,EAAE,aAAa,OAAO,QAAQ;IAAE,MAAM,KAAK;IAAM,GAAG;GAAO,CAAC,CAAC;EAE7G,OAAO,IAAI,KAAK,MAAM;GACpB,MAAM,MAAM,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE;GACtC,Q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