@adminiumjs/add-on-contracts 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,155 @@
1
+ /**
2
+ * The `addOn` manifest block (24-marketplace-wave-4.md §5.3) and its validation
3
+ * rules. Lives here rather than in `@adminium/manifest` because the rules are
4
+ * assertions ABOUT the registries in this package — a slot id or a contract id
5
+ * is only meaningful against the closed lists in `slots.ts` / `contracts.ts`.
6
+ *
7
+ * `@adminium/manifest` imports this to build the `kind: "add-on"` branch of its
8
+ * discriminated union.
9
+ */
10
+ import { z } from 'zod';
11
+ /**
12
+ * Add-ons get their OWN closed category vocabulary (D2), because an add-on is
13
+ * not a vertical and forcing it into the app facet set would make a carrier a
14
+ * "commerce" product. Wave 4 uses two of the five; the other three exist so a
15
+ * second add-on wave does not have to reopen the vocabulary.
16
+ */
17
+ export declare const ADD_ON_CATEGORIES: readonly ["artwork", "delivery", "payments", "email", "data"];
18
+ export declare const addOnCategorySchema: z.ZodEnum<{
19
+ artwork: "artwork";
20
+ delivery: "delivery";
21
+ payments: "payments";
22
+ email: "email";
23
+ data: "data";
24
+ }>;
25
+ export type AddOnCategory = (typeof ADD_ON_CATEGORIES)[number];
26
+ /** How the shop supplies credentials, if at all (§5.6). */
27
+ export declare const CONNECT_KINDS: readonly ["none", "api-key", "oauth2"];
28
+ export declare const connectKindSchema: z.ZodEnum<{
29
+ none: "none";
30
+ "api-key": "api-key";
31
+ oauth2: "oauth2";
32
+ }>;
33
+ export type ConnectKind = (typeof CONNECT_KINDS)[number];
34
+ export declare const attachTargetSchema: z.ZodObject<{
35
+ app: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodString]>;
36
+ range: z.ZodOptional<z.ZodString>;
37
+ table: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>;
39
+ export declare const providesSchema: z.ZodObject<{
40
+ contract: z.ZodEnum<{
41
+ "artwork-source": "artwork-source";
42
+ "shipping-carrier": "shipping-carrier";
43
+ "product-personalizer": "product-personalizer";
44
+ }>;
45
+ version: z.ZodNumber;
46
+ server: z.ZodString;
47
+ }, z.core.$strict>;
48
+ export declare const consumesSchema: z.ZodObject<{
49
+ contract: z.ZodEnum<{
50
+ "artwork-source": "artwork-source";
51
+ "shipping-carrier": "shipping-carrier";
52
+ "product-personalizer": "product-personalizer";
53
+ }>;
54
+ version: z.ZodNumber;
55
+ }, z.core.$strict>;
56
+ export declare const slotFillSchema: z.ZodObject<{
57
+ slot: z.ZodEnum<{
58
+ "artwork.sources": "artwork.sources";
59
+ "checkout.delivery.methods": "checkout.delivery.methods";
60
+ "order.dispatch.panel": "order.dispatch.panel";
61
+ "order.dispatch.actions": "order.dispatch.actions";
62
+ "settings.add-on.panel": "settings.add-on.panel";
63
+ "nav.add-on.routes": "nav.add-on.routes";
64
+ "product.options.personalize": "product.options.personalize";
65
+ "cart.line.preview": "cart.line.preview";
66
+ "product.admin.panel": "product.admin.panel";
67
+ "order.line.actions": "order.line.actions";
68
+ "record.editor.panel": "record.editor.panel";
69
+ }>;
70
+ client: z.ZodString;
71
+ order: z.ZodNumber;
72
+ }, z.core.$strict>;
73
+ export declare const addOnEventSchema: z.ZodObject<{
74
+ on: z.ZodString;
75
+ server: z.ZodString;
76
+ }, z.core.$strict>;
77
+ export declare const addOnConnectSchema: z.ZodObject<{
78
+ kind: z.ZodEnum<{
79
+ none: "none";
80
+ "api-key": "api-key";
81
+ oauth2: "oauth2";
82
+ }>;
83
+ authorizeUrl: z.ZodOptional<z.ZodURL>;
84
+ tokenUrl: z.ZodOptional<z.ZodURL>;
85
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
86
+ }, z.core.$strict>;
87
+ export declare const addOnNetworkSchema: z.ZodObject<{
88
+ allow: z.ZodArray<z.ZodString>;
89
+ }, z.core.$strict>;
90
+ export declare const addOnBlockSchema: z.ZodObject<{
91
+ attaches: z.ZodArray<z.ZodObject<{
92
+ app: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodString]>;
93
+ range: z.ZodOptional<z.ZodString>;
94
+ table: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strict>>;
96
+ provides: z.ZodOptional<z.ZodArray<z.ZodObject<{
97
+ contract: z.ZodEnum<{
98
+ "artwork-source": "artwork-source";
99
+ "shipping-carrier": "shipping-carrier";
100
+ "product-personalizer": "product-personalizer";
101
+ }>;
102
+ version: z.ZodNumber;
103
+ server: z.ZodString;
104
+ }, z.core.$strict>>>;
105
+ consumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
106
+ contract: z.ZodEnum<{
107
+ "artwork-source": "artwork-source";
108
+ "shipping-carrier": "shipping-carrier";
109
+ "product-personalizer": "product-personalizer";
110
+ }>;
111
+ version: z.ZodNumber;
112
+ }, z.core.$strict>>>;
113
+ slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ slot: z.ZodEnum<{
115
+ "artwork.sources": "artwork.sources";
116
+ "checkout.delivery.methods": "checkout.delivery.methods";
117
+ "order.dispatch.panel": "order.dispatch.panel";
118
+ "order.dispatch.actions": "order.dispatch.actions";
119
+ "settings.add-on.panel": "settings.add-on.panel";
120
+ "nav.add-on.routes": "nav.add-on.routes";
121
+ "product.options.personalize": "product.options.personalize";
122
+ "cart.line.preview": "cart.line.preview";
123
+ "product.admin.panel": "product.admin.panel";
124
+ "order.line.actions": "order.line.actions";
125
+ "record.editor.panel": "record.editor.panel";
126
+ }>;
127
+ client: z.ZodString;
128
+ order: z.ZodNumber;
129
+ }, z.core.$strict>>>;
130
+ events: z.ZodOptional<z.ZodArray<z.ZodObject<{
131
+ on: z.ZodString;
132
+ server: z.ZodString;
133
+ }, z.core.$strict>>>;
134
+ connect: z.ZodObject<{
135
+ kind: z.ZodEnum<{
136
+ none: "none";
137
+ "api-key": "api-key";
138
+ oauth2: "oauth2";
139
+ }>;
140
+ authorizeUrl: z.ZodOptional<z.ZodURL>;
141
+ tokenUrl: z.ZodOptional<z.ZodURL>;
142
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
143
+ }, z.core.$strict>;
144
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
145
+ network: z.ZodOptional<z.ZodObject<{
146
+ allow: z.ZodArray<z.ZodString>;
147
+ }, z.core.$strict>>;
148
+ publicSettings: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ demoTransport: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strict>;
151
+ export type AddOnBlock = z.infer<typeof addOnBlockSchema>;
152
+ /** Issue codes the validators emit (13 §3.2 convention, extended by 24 §5.3). */
153
+ export declare const ADD_ON_ISSUE_CODES: readonly ["ATTACH_TARGET_UNKNOWN", "SLOT_UNKNOWN", "CONTRACT_UNKNOWN", "SCOPE_OUT_OF_RANGE", "NETWORK_ALLOW_REQUIRED", "CAPABILITY_CONFLICT", "FRONTEND_SECRET_LEAK", "SLOT_CONFLICT"];
154
+ export type AddOnIssueCode = (typeof ADD_ON_ISSUE_CODES)[number];
155
+ //# sourceMappingURL=add-on-block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-on-block.d.ts","sourceRoot":"","sources":["../src/add-on-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,+DAAgE,CAAC;AAC/F,eAAO,MAAM,mBAAmB;;;;;;EAA4B,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/D,2DAA2D;AAC3D,eAAO,MAAM,aAAa,wCAAyC,CAAC;AACpE,eAAO,MAAM,iBAAiB;;;;EAAwB,CAAC;AACvD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAazD,eAAO,MAAM,kBAAkB;;;;kBAQpB,CAAC;AAEZ,eAAO,MAAM,cAAc;;;;;;;;kBAMhB,CAAC;AAEZ,eAAO,MAAM,cAAc;;;;;;;kBAKhB,CAAC;AAEZ,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;kBAMhB,CAAC;AAEZ,eAAO,MAAM,gBAAgB;;;kBAKlB,CAAC;AAEZ,eAAO,MAAM,kBAAkB;;;;;;;;;kBAOpB,CAAC;AAEZ,eAAO,MAAM,kBAAkB;;kBAIpB,CAAC;AAEZ,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmC1B,CAAC;AAEJ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,wLASrB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,124 @@
1
+ /**
2
+ * The `addOn` manifest block (24-marketplace-wave-4.md §5.3) and its validation
3
+ * rules. Lives here rather than in `@adminium/manifest` because the rules are
4
+ * assertions ABOUT the registries in this package — a slot id or a contract id
5
+ * is only meaningful against the closed lists in `slots.ts` / `contracts.ts`.
6
+ *
7
+ * `@adminium/manifest` imports this to build the `kind: "add-on"` branch of its
8
+ * discriminated union.
9
+ */
10
+ import { z } from 'zod';
11
+ import { contractIdSchema, hasContractVersion } from './contracts.js';
12
+ import { slotIdSchema } from './slots.js';
13
+ /**
14
+ * Add-ons get their OWN closed category vocabulary (D2), because an add-on is
15
+ * not a vertical and forcing it into the app facet set would make a carrier a
16
+ * "commerce" product. Wave 4 uses two of the five; the other three exist so a
17
+ * second add-on wave does not have to reopen the vocabulary.
18
+ */
19
+ export const ADD_ON_CATEGORIES = ['artwork', 'delivery', 'payments', 'email', 'data'];
20
+ export const addOnCategorySchema = z.enum(ADD_ON_CATEGORIES);
21
+ /** How the shop supplies credentials, if at all (§5.6). */
22
+ export const CONNECT_KINDS = ['none', 'api-key', 'oauth2'];
23
+ export const connectKindSchema = z.enum(CONNECT_KINDS);
24
+ const SEMVER_RANGE = /^[\^~]?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$|^\*$/;
25
+ /**
26
+ * Exact hostname — no wildcards, no bare IPs, no ports, no scheme (D14).
27
+ *
28
+ * The final label is alphabetic on purpose: it is what makes `203.0.113.10`
29
+ * fail. Every real TLD is alphabetic, and an egress allow-list that quietly
30
+ * accepts a literal IP is an allow-list with a hole in it.
31
+ */
32
+ const HOSTNAME = /^(?!-)[a-z0-9-]{1,63}(?<!-)(\.(?!-)[a-z0-9-]{1,63}(?<!-))*\.[a-z]{2,63}$/;
33
+ export const attachTargetSchema = z
34
+ .object({
35
+ /** A known app key, or `"*"` when the contract is not host-specific. */
36
+ app: z.union([z.literal('*'), z.string().regex(/^[a-z][a-z0-9-]{1,79}$/)]),
37
+ range: z.string().regex(SEMVER_RANGE, 'range must be a simple semver range or "*"').optional(),
38
+ /** Only for `record.editor.panel`: which host tables the panel mounts on. */
39
+ table: z.string().regex(/^[a-z][a-z0-9_]*$/).optional(),
40
+ })
41
+ .strict();
42
+ export const providesSchema = z
43
+ .object({
44
+ contract: contractIdSchema,
45
+ version: z.number().int().positive(),
46
+ server: z.string().min(1),
47
+ })
48
+ .strict();
49
+ export const consumesSchema = z
50
+ .object({
51
+ contract: contractIdSchema,
52
+ version: z.number().int().positive(),
53
+ })
54
+ .strict();
55
+ export const slotFillSchema = z
56
+ .object({
57
+ slot: slotIdSchema,
58
+ client: z.string().min(1),
59
+ order: z.number().int(),
60
+ })
61
+ .strict();
62
+ export const addOnEventSchema = z
63
+ .object({
64
+ on: z.string().min(1).max(80),
65
+ server: z.string().min(1),
66
+ })
67
+ .strict();
68
+ export const addOnConnectSchema = z
69
+ .object({
70
+ kind: connectKindSchema,
71
+ authorizeUrl: z.url().optional(),
72
+ tokenUrl: z.url().optional(),
73
+ scopes: z.array(z.string().min(1)).optional(),
74
+ })
75
+ .strict();
76
+ export const addOnNetworkSchema = z
77
+ .object({
78
+ allow: z.array(z.string().regex(HOSTNAME, 'must be an exact https hostname')),
79
+ })
80
+ .strict();
81
+ export const addOnBlockSchema = z
82
+ .object({
83
+ attaches: z.array(attachTargetSchema).min(1),
84
+ provides: z.array(providesSchema).optional(),
85
+ consumes: z.array(consumesSchema).optional(),
86
+ slots: z.array(slotFillSchema).optional(),
87
+ events: z.array(addOnEventSchema).optional(),
88
+ connect: addOnConnectSchema,
89
+ /** Grants over host + own tables, checked against SCOPE_OUT_OF_RANGE. */
90
+ scopes: z.array(z.string().min(1)).optional(),
91
+ network: addOnNetworkSchema.optional(),
92
+ /** D15 — the only settings the client bundle may read. */
93
+ publicSettings: z.array(z.string().min(1)).optional(),
94
+ /** D11 — required to ship a demo that makes no real third-party call. */
95
+ demoTransport: z.string().min(1).optional(),
96
+ })
97
+ .strict()
98
+ // Every `provides[].contract` must be in the registry AT the declared version.
99
+ .refine((b) => (b.provides ?? []).every((p) => hasContractVersion(p.contract, p.version)), {
100
+ message: 'CONTRACT_UNKNOWN: a provided contract is not in the registry at that version',
101
+ path: ['provides'],
102
+ })
103
+ .refine((b) => (b.consumes ?? []).every((c) => hasContractVersion(c.contract, c.version)), {
104
+ message: 'CONTRACT_UNKNOWN: a consumed contract is not in the registry at that version',
105
+ path: ['consumes'],
106
+ })
107
+ // §5.6 — an oauth2 connect must name where it authorizes.
108
+ .refine((b) => b.connect.kind !== 'oauth2' ||
109
+ (b.connect.authorizeUrl !== undefined && b.connect.tokenUrl !== undefined), {
110
+ message: 'an oauth2 connect must declare authorizeUrl and tokenUrl',
111
+ path: ['connect'],
112
+ });
113
+ /** Issue codes the validators emit (13 §3.2 convention, extended by 24 §5.3). */
114
+ export const ADD_ON_ISSUE_CODES = [
115
+ 'ATTACH_TARGET_UNKNOWN',
116
+ 'SLOT_UNKNOWN',
117
+ 'CONTRACT_UNKNOWN',
118
+ 'SCOPE_OUT_OF_RANGE',
119
+ 'NETWORK_ALLOW_REQUIRED',
120
+ 'CAPABILITY_CONFLICT',
121
+ 'FRONTEND_SECRET_LEAK',
122
+ 'SLOT_CONFLICT',
123
+ ];
124
+ //# sourceMappingURL=add-on-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-on-block.js","sourceRoot":"","sources":["../src/add-on-block.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAC/F,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAG7D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AACpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAGvD,MAAM,YAAY,GAAG,uDAAuD,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,CAAC;IACN,wEAAwE;IACxE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KA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uB;IACvB,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,wBAAwB;IACxB,qBAAqB;IACrB,sBAAsB;IACtB,eAAe;CACP,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `artwork-source@1` (24 §5.5) — a way for a customer to supply artwork that is
3
+ * not a plain upload.
4
+ *
5
+ * The asymmetry that makes this contract worth having: the HOST, not the
6
+ * add-on, runs the artwork checks on the returned `ArtworkRef`. Design Studio's
7
+ * output passes by construction because it was built at the finished size with
8
+ * the bleed already on it; a design brought in from somewhere else routinely
9
+ * does not. Neither implementation marks its own homework.
10
+ */
11
+ import { z } from 'zod';
12
+ /** The job the customer is supplying artwork for. */
13
+ export interface JobSpec {
14
+ /** Product family key, e.g. `business-cards`. */
15
+ productKey: string;
16
+ /** Human label for the product, already localized by the host. */
17
+ productLabel: string;
18
+ /** Finished (trim) size in millimetres. */
19
+ trimWidthMm: number;
20
+ trimHeightMm: number;
21
+ /** Bleed the works needs on every edge, in millimetres. */
22
+ bleedMm: number;
23
+ sides: 1 | 2;
24
+ quantity: number;
25
+ }
26
+ /** What an artwork source hands back to the host. */
27
+ export interface ArtworkRef {
28
+ fileId: string;
29
+ /** The add-on key that produced it. */
30
+ source: string;
31
+ widthMm: number;
32
+ heightMm: number;
33
+ bleedMm: number;
34
+ dpi: number;
35
+ pages: number;
36
+ previewFileId?: string;
37
+ }
38
+ export interface ArtworkSource {
39
+ readonly key: string;
40
+ /** e.g. "Design it here" / "Bring it from Canva" — the host renders it. */
41
+ label(job: JobSpec): string;
42
+ available(job: JobSpec): AvailabilityVerdict;
43
+ /** Resolves to the artwork, or null when the customer backed out. */
44
+ start(job: JobSpec): Promise<ArtworkRef | null>;
45
+ }
46
+ export type AvailabilityVerdict = {
47
+ ok: true;
48
+ } | {
49
+ ok: false;
50
+ reason: string;
51
+ };
52
+ export declare const jobSpecSchema: z.ZodObject<{
53
+ productKey: z.ZodString;
54
+ productLabel: z.ZodString;
55
+ trimWidthMm: z.ZodNumber;
56
+ trimHeightMm: z.ZodNumber;
57
+ bleedMm: z.ZodNumber;
58
+ sides: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
59
+ quantity: z.ZodNumber;
60
+ }, z.core.$strict>;
61
+ export declare const artworkRefSchema: z.ZodObject<{
62
+ fileId: z.ZodString;
63
+ source: z.ZodString;
64
+ widthMm: z.ZodNumber;
65
+ heightMm: z.ZodNumber;
66
+ bleedMm: z.ZodNumber;
67
+ dpi: z.ZodNumber;
68
+ pages: z.ZodNumber;
69
+ previewFileId: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strict>;
71
+ //# sourceMappingURL=artwork-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artwork-source.d.ts","sourceRoot":"","sources":["../src/artwork-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qDAAqD;AACrD,MAAM,WAAW,OAAO;IACtB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,qDAAqD;AACrD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAAC;IAC7C,qEAAqE;IACrE,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,mBAAmB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,aAAa;;;;;;;;kBAUf,CAAC;AAEZ,eAAO,MAAM,gBAAgB;;;;;;;;;kBAWlB,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `artwork-source@1` (24 §5.5) — a way for a customer to supply artwork that is
3
+ * not a plain upload.
4
+ *
5
+ * The asymmetry that makes this contract worth having: the HOST, not the
6
+ * add-on, runs the artwork checks on the returned `ArtworkRef`. Design Studio's
7
+ * output passes by construction because it was built at the finished size with
8
+ * the bleed already on it; a design brought in from somewhere else routinely
9
+ * does not. Neither implementation marks its own homework.
10
+ */
11
+ import { z } from 'zod';
12
+ export const jobSpecSchema = z
13
+ .object({
14
+ productKey: z.string().min(1),
15
+ productLabel: z.string().min(1),
16
+ trimWidthMm: z.number().positive(),
17
+ trimHeightMm: z.number().positive(),
18
+ bleedMm: z.number().min(0),
19
+ sides: z.union([z.literal(1), z.literal(2)]),
20
+ quantity: z.number().int().positive(),
21
+ })
22
+ .strict();
23
+ export const artworkRefSchema = z
24
+ .object({
25
+ fileId: z.string().min(1),
26
+ source: z.string().min(1),
27
+ widthMm: z.number().positive(),
28
+ heightMm: z.number().positive(),
29
+ bleedMm: z.number().min(0),
30
+ dpi: z.number().positive(),
31
+ pages: z.number().int().positive(),
32
+ previewFileId: z.string().min(1).optional(),
33
+ })
34
+ .strict();
35
+ //# sourceMappingURL=artwork-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artwork-source.js","sourceRoot":"","sources":["../src/artwork-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyCxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Shapes shared by more than one contract. Kept in one place so a `FileRef`
3
+ * from a carrier label and a `FileRef` from a production file are the same
4
+ * type — the host stores both through one file seam.
5
+ */
6
+ import { z } from 'zod';
7
+ export interface FileRef {
8
+ fileId: string;
9
+ filename: string;
10
+ mediaType: string;
11
+ bytes: number;
12
+ }
13
+ export declare const fileRefSchema: z.ZodObject<{
14
+ fileId: z.ZodString;
15
+ filename: z.ZodString;
16
+ mediaType: z.ZodString;
17
+ bytes: z.ZodNumber;
18
+ }, z.core.$strict>;
19
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,aAAa;;;;;kBAOf,CAAC"}
package/dist/common.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Shapes shared by more than one contract. Kept in one place so a `FileRef`
3
+ * from a carrier label and a `FileRef` from a production file are the same
4
+ * type — the host stores both through one file seam.
5
+ */
6
+ import { z } from 'zod';
7
+ export const fileRefSchema = z
8
+ .object({
9
+ fileId: z.string().min(1),
10
+ filename: z.string().min(1),
11
+ mediaType: z.string().min(1),
12
+ bytes: z.number().int().positive(),
13
+ })
14
+ .strict();
15
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC;KACD,MAAM,EAAE,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Provider contract registry v1 — CLOSED (24-marketplace-wave-4.md §5.5).
3
+ *
4
+ * Three, not eight. A contract that has no implementation is a guess about a
5
+ * future add-on; the only way a contract gets in is alongside the add-on that
6
+ * implements it.
7
+ */
8
+ import { z } from 'zod';
9
+ export interface ContractDefinition {
10
+ readonly id: string;
11
+ readonly version: 1;
12
+ readonly summary: string;
13
+ /** How many add-ons implement it in wave 4 — the evidence the shape is real. */
14
+ readonly implementations: number;
15
+ }
16
+ export declare const CONTRACT_REGISTRY: readonly [{
17
+ readonly id: "artwork-source";
18
+ readonly version: 1;
19
+ readonly summary: "A way for a customer to supply artwork that is not an upload. The host runs the checks on what comes back, so no implementation marks its own homework.";
20
+ readonly implementations: 2;
21
+ }, {
22
+ readonly id: "shipping-carrier";
23
+ readonly version: 1;
24
+ readonly summary: "One delivery company: rates, booking, tracking, labels. Implemented so the second one is a copy.";
25
+ readonly implementations: 1;
26
+ }, {
27
+ readonly id: "product-personalizer";
28
+ readonly version: 1;
29
+ readonly summary: "Personalization spanning three surfaces — shopper, staff, dashboard — which is why it is a contract rather than a screen.";
30
+ readonly implementations: 1;
31
+ }];
32
+ export type ContractId = (typeof CONTRACT_REGISTRY)[number]['id'];
33
+ export declare const CONTRACT_IDS: readonly ContractId[];
34
+ export declare const contractIdSchema: z.ZodEnum<{
35
+ "artwork-source": "artwork-source";
36
+ "shipping-carrier": "shipping-carrier";
37
+ "product-personalizer": "product-personalizer";
38
+ }>;
39
+ export declare function isContractId(v: unknown): v is ContractId;
40
+ /** True when the registry carries this contract AT the declared version. */
41
+ export declare function hasContractVersion(id: string, version: number): boolean;
42
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAsBoB,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,eAAO,MAAM,YAAY,EAAyC,SAAS,UAAU,EAAE,CAAC;AAExF,eAAO,MAAM,gBAAgB;;;;EAE5B,CAAC;AAIF,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAExD;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGvE"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Provider contract registry v1 — CLOSED (24-marketplace-wave-4.md §5.5).
3
+ *
4
+ * Three, not eight. A contract that has no implementation is a guess about a
5
+ * future add-on; the only way a contract gets in is alongside the add-on that
6
+ * implements it.
7
+ */
8
+ import { z } from 'zod';
9
+ export const CONTRACT_REGISTRY = [
10
+ {
11
+ id: 'artwork-source',
12
+ version: 1,
13
+ summary: 'A way for a customer to supply artwork that is not an upload. The host runs the checks on what comes back, so no implementation marks its own homework.',
14
+ implementations: 2,
15
+ },
16
+ {
17
+ id: 'shipping-carrier',
18
+ version: 1,
19
+ summary: 'One delivery company: rates, booking, tracking, labels. Implemented so the second one is a copy.',
20
+ implementations: 1,
21
+ },
22
+ {
23
+ id: 'product-personalizer',
24
+ version: 1,
25
+ summary: 'Personalization spanning three surfaces — shopper, staff, dashboard — which is why it is a contract rather than a screen.',
26
+ implementations: 1,
27
+ },
28
+ ];
29
+ export const CONTRACT_IDS = CONTRACT_REGISTRY.map((c) => c.id);
30
+ export const contractIdSchema = z.enum(CONTRACT_IDS);
31
+ const BY_ID = new Map(CONTRACT_REGISTRY.map((c) => [c.id, c]));
32
+ export function isContractId(v) {
33
+ return typeof v === 'string' && BY_ID.has(v);
34
+ }
35
+ /** True when the registry carries this contract AT the declared version. */
36
+ export function hasContractVersion(id, version) {
37
+ const found = BY_ID.get(id);
38
+ return found !== undefined && found.version === version;
39
+ }
40
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B;QACE,EAAE,EAAE,gBAAgB;QACpB,OAAO,EAAE,CAAC;QACV,OAAO,EACL,yJAAyJ;QAC3J,eAAe,EAAE,CAAC;KACnB;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,OAAO,EAAE,CAAC;QACV,OAAO,EACL,kGAAkG;QACpG,eAAe,EAAE,CAAC;KACnB;IACD;QACE,EAAE,EAAE,sBAAsB;QAC1B,OAAO,EAAE,CAAC;QACV,OAAO,EACL,2HAA2H;QAC7H,eAAe,EAAE,CAAC;KACnB;CAC+C,CAAC;AAInD,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAA0B,CAAC;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CACpC,YAAwD,CACzD,CAAC;AAEF,MAAM,KAAK,GAAG,IAAI,GAAG,CAA6B,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3F,MAAM,UAAU,YAAY,CAAC,CAAU;IACrC,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB,CAAC,EAAU,EAAE,OAAe;IAC5D,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @adminium/add-on-contracts — the shapes an add-on is written against
3
+ * (24-marketplace-wave-4.md §5).
4
+ *
5
+ * Two halves, kept apart on purpose. THIS half is types, registries and Zod
6
+ * validators with zero `node:` imports, so the storefront, the example-app SPAs
7
+ * and Electron can all use it (01 §3). The conformance suites live behind
8
+ * `@adminium/add-on-contracts/testing`, which may import vitest.
9
+ */
10
+ export declare const PACKAGE_NAME = "@adminium/add-on-contracts";
11
+ export { fileRefSchema, type FileRef } from './common.js';
12
+ export { SLOT_REGISTRY, SLOT_IDS, SLOT_SURFACES, SLOT_FILLS, slotIdSchema, isSlotId, slotDefinition, type SlotId, type SlotDefinition, type SlotSurface, type SlotFill, } from './slots.js';
13
+ export { CONTRACT_REGISTRY, CONTRACT_IDS, contractIdSchema, isContractId, hasContractVersion, type ContractId, type ContractDefinition, } from './contracts.js';
14
+ export { ADD_ON_CATEGORIES, ADD_ON_ISSUE_CODES, CONNECT_KINDS, addOnBlockSchema, addOnCategorySchema, addOnConnectSchema, addOnEventSchema, addOnNetworkSchema, attachTargetSchema, connectKindSchema, consumesSchema, providesSchema, slotFillSchema, type AddOnBlock, type AddOnCategory, type AddOnIssueCode, type ConnectKind, } from './add-on-block.js';
15
+ export { artworkRefSchema, jobSpecSchema, type ArtworkRef, type ArtworkSource, type AvailabilityVerdict, type JobSpec, } from './artwork-source.js';
16
+ export { CarrierError, addressSchema, parcelSchema, rateSchema, shipmentSchema, trackEventSchema, type Address, type OrderRef, type Parcel, type Rate, type Shipment, type ShippingCarrier, type TrackEvent, } from './shipping-carrier.js';
17
+ export { personalizationSchema, templateSchema, zoneSchema, type Personalization, type PreviewRef, type ProductPersonalizer, type ProductRef, type Template, type Verdict, type Zone, type ZoneFinish, type ZoneKind, } from './product-personalizer.js';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,+BAA+B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACL,aAAa,EACb,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,QAAQ,GACd,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,EACd,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,OAAO,GACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,QAAQ,GACd,MAAM,2BAA2B,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @adminium/add-on-contracts — the shapes an add-on is written against
3
+ * (24-marketplace-wave-4.md §5).
4
+ *
5
+ * Two halves, kept apart on purpose. THIS half is types, registries and Zod
6
+ * validators with zero `node:` imports, so the storefront, the example-app SPAs
7
+ * and Electron can all use it (01 §3). The conformance suites live behind
8
+ * `@adminium/add-on-contracts/testing`, which may import vitest.
9
+ */
10
+ export const PACKAGE_NAME = '@adminium/add-on-contracts';
11
+ export { fileRefSchema } from './common.js';
12
+ export { SLOT_REGISTRY, SLOT_IDS, SLOT_SURFACES, SLOT_FILLS, slotIdSchema, isSlotId, slotDefinition, } from './slots.js';
13
+ export { CONTRACT_REGISTRY, CONTRACT_IDS, contractIdSchema, isContractId, hasContractVersion, } from './contracts.js';
14
+ export { ADD_ON_CATEGORIES, ADD_ON_ISSUE_CODES, CONNECT_KINDS, addOnBlockSchema, addOnCategorySchema, addOnConnectSchema, addOnEventSchema, addOnNetworkSchema, attachTargetSchema, connectKindSchema, consumesSchema, providesSchema, slotFillSchema, } from './add-on-block.js';
15
+ export { artworkRefSchema, jobSpecSchema, } from './artwork-source.js';
16
+ export { CarrierError, addressSchema, parcelSchema, rateSchema, shipmentSchema, trackEventSchema, } from './shipping-carrier.js';
17
+ export { personalizationSchema, templateSchema, zoneSchema, } from './product-personalizer.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,4BAA4B,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAgB,MAAM,aAAa,CAAC;AAE1D,OAAO,EACL,aAAa,EACb,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,GAKf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GAGnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,cAAc,GAKf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,EAChB,aAAa,GAKd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,gBAAgB,GAQjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,UAAU,GAUX,MAAM,2BAA2B,CAAC"}