@wix/stores 1.0.9 → 1.0.10

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 (31) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/stores-v2-inventory.http.d.ts +6 -0
  5. package/build/cjs/src/stores-v2-inventory.http.js +151 -0
  6. package/build/cjs/src/stores-v2-inventory.http.js.map +1 -0
  7. package/build/cjs/src/stores-v2-inventory.public.d.ts +6 -0
  8. package/build/cjs/src/stores-v2-inventory.public.js +19 -0
  9. package/build/cjs/src/stores-v2-inventory.public.js.map +1 -0
  10. package/build/cjs/src/stores-v2-inventory.types.d.ts +252 -0
  11. package/build/cjs/src/stores-v2-inventory.types.js +11 -0
  12. package/build/cjs/src/stores-v2-inventory.types.js.map +1 -0
  13. package/build/cjs/src/stores-v2-inventory.universal.d.ts +272 -0
  14. package/build/cjs/src/stores-v2-inventory.universal.js +146 -0
  15. package/build/cjs/src/stores-v2-inventory.universal.js.map +1 -0
  16. package/build/es/index.d.ts +1 -0
  17. package/build/es/index.js +1 -0
  18. package/build/es/index.js.map +1 -1
  19. package/build/es/src/stores-v2-inventory.http.d.ts +6 -0
  20. package/build/es/src/stores-v2-inventory.http.js +146 -0
  21. package/build/es/src/stores-v2-inventory.http.js.map +1 -0
  22. package/build/es/src/stores-v2-inventory.public.d.ts +6 -0
  23. package/build/es/src/stores-v2-inventory.public.js +13 -0
  24. package/build/es/src/stores-v2-inventory.public.js.map +1 -0
  25. package/build/es/src/stores-v2-inventory.types.d.ts +252 -0
  26. package/build/es/src/stores-v2-inventory.types.js +8 -0
  27. package/build/es/src/stores-v2-inventory.types.js.map +1 -0
  28. package/build/es/src/stores-v2-inventory.universal.d.ts +272 -0
  29. package/build/es/src/stores-v2-inventory.universal.js +122 -0
  30. package/build/es/src/stores-v2-inventory.universal.js.map +1 -0
  31. package/package.json +2 -2
@@ -1,2 +1,3 @@
1
1
  export * as collections from './src/stores-catalog-v1-collection.public';
2
2
  export * as products from './src/stores-catalog-v1-product-products.public';
3
+ export * as catalog from './src/stores-v2-inventory.public';
@@ -19,7 +19,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
19
19
  return result;
20
20
  };
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.products = exports.collections = void 0;
22
+ exports.catalog = exports.products = exports.collections = void 0;
23
23
  exports.collections = __importStar(require("./src/stores-catalog-v1-collection.public"));
24
24
  exports.products = __importStar(require("./src/stores-catalog-v1-product-products.public"));
25
+ exports.catalog = __importStar(require("./src/stores-v2-inventory.public"));
25
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yFAAyE;AACzE,4FAA4E"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,yFAAyE;AACzE,4FAA4E;AAC5E,4EAA4D"}
@@ -0,0 +1,6 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { DecrementInventoryRequest, DecrementInventoryResponse, IncrementInventoryRequest, IncrementInventoryResponse } from './stores-v2-inventory.types';
3
+ /** Subtracts a set number of items from inventory. */
4
+ export declare function decrementInventory(payload: DecrementInventoryRequest): RequestOptionsFactory<DecrementInventoryResponse>;
5
+ /** Adds a set number of items to inventory. */
6
+ export declare function incrementInventory(payload: IncrementInventoryRequest): RequestOptionsFactory<IncrementInventoryResponse>;
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.incrementInventory = exports.decrementInventory = void 0;
4
+ const ambassador_1 = require("@wix/metro-runtime/ambassador");
5
+ const metro_runtime_1 = require("@wix/metro-runtime");
6
+ const _decrementInventoryRequest = {};
7
+ const _decrementInventoryResponse = {};
8
+ const _incrementInventoryRequest = {};
9
+ const _incrementInventoryResponse = {};
10
+ function resolveWixInventoryApiV1InventoryWriteApiUrl(opts) {
11
+ const domainToMappings = {
12
+ 'api._api_base_domain_': [
13
+ {
14
+ srcPath: '/wix-ecommerce-catalog-web',
15
+ destPath: '',
16
+ },
17
+ ],
18
+ 'www._base_domain_': [
19
+ {
20
+ srcPath: '/_api/catalog-server',
21
+ destPath: '',
22
+ },
23
+ {
24
+ srcPath: '/wix-ecommerce-catalog',
25
+ destPath: '',
26
+ },
27
+ ],
28
+ _: [
29
+ {
30
+ srcPath: '/_api/catalog-server',
31
+ destPath: '',
32
+ },
33
+ ],
34
+ 'ecom._base_domain_': [
35
+ {
36
+ srcPath: '/_api/catalog-server',
37
+ destPath: '',
38
+ },
39
+ ],
40
+ '*.dev.wix-code.com': [
41
+ {
42
+ srcPath: '/_api/catalog-server',
43
+ destPath: '',
44
+ },
45
+ ],
46
+ '*.pub.wix-code.com': [
47
+ {
48
+ srcPath: '/_api/catalog-server',
49
+ destPath: '',
50
+ },
51
+ ],
52
+ 'www.wixapis.com': [
53
+ {
54
+ srcPath: '/stores/v1/collections',
55
+ destPath: '/v1/collections',
56
+ },
57
+ {
58
+ srcPath: '/stores/v1/products',
59
+ destPath: '/v1/products',
60
+ },
61
+ {
62
+ srcPath: '/stores/v1/inventoryItems',
63
+ destPath: '/v1/inventoryItems',
64
+ },
65
+ {
66
+ srcPath: '/stores/v2/inventoryItems',
67
+ destPath: '/v2/inventoryItems',
68
+ },
69
+ {
70
+ srcPath: '/stores/v1/variants',
71
+ destPath: '/v1/variants',
72
+ },
73
+ {
74
+ srcPath: '/stores/v1/bulk/products',
75
+ destPath: '/v1/bulk/products',
76
+ },
77
+ ],
78
+ 'manage._base_domain_': [
79
+ {
80
+ srcPath: '/wix-ecommerce-catalog',
81
+ destPath: '',
82
+ },
83
+ {
84
+ srcPath: '/_api/catalog-server',
85
+ destPath: '',
86
+ },
87
+ ],
88
+ 'editor.wixapps.net': [
89
+ {
90
+ srcPath: '/_api/catalog-server',
91
+ destPath: '',
92
+ },
93
+ ],
94
+ 'www.wixgateway.com': [
95
+ {
96
+ srcPath: '/stores/v1/products',
97
+ destPath: '/v1/products',
98
+ },
99
+ {
100
+ srcPath: '/stores/v1/collections',
101
+ destPath: '/v1/collections',
102
+ },
103
+ ],
104
+ };
105
+ return metro_runtime_1.resolveUrl(Object.assign(opts, { domainToMappings }));
106
+ }
107
+ /** Subtracts a set number of items from inventory. */
108
+ function decrementInventory(payload) {
109
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_decrementInventoryRequest, {});
110
+ const { fromJSON: fromRes } = ambassador_1.serializer(_decrementInventoryResponse, {});
111
+ function __decrementInventory({ host }) {
112
+ const serializedData = toReq(payload);
113
+ const metadata = {
114
+ method: 'POST',
115
+ url: resolveWixInventoryApiV1InventoryWriteApiUrl({
116
+ protoPath: '/v2/inventoryItems/decrement',
117
+ data: serializedData,
118
+ host,
119
+ }),
120
+ data: serializedData,
121
+ transformResponse: fromRes,
122
+ };
123
+ return metadata;
124
+ }
125
+ __decrementInventory.fromReq = fromReq;
126
+ return __decrementInventory;
127
+ }
128
+ exports.decrementInventory = decrementInventory;
129
+ /** Adds a set number of items to inventory. */
130
+ function incrementInventory(payload) {
131
+ const { toJSON: toReq, fromJSON: fromReq } = ambassador_1.serializer(_incrementInventoryRequest, {});
132
+ const { fromJSON: fromRes } = ambassador_1.serializer(_incrementInventoryResponse, {});
133
+ function __incrementInventory({ host }) {
134
+ const serializedData = toReq(payload);
135
+ const metadata = {
136
+ method: 'POST',
137
+ url: resolveWixInventoryApiV1InventoryWriteApiUrl({
138
+ protoPath: '/v2/inventoryItems/increment',
139
+ data: serializedData,
140
+ host,
141
+ }),
142
+ data: serializedData,
143
+ transformResponse: fromRes,
144
+ };
145
+ return metadata;
146
+ }
147
+ __incrementInventory.fromReq = fromReq;
148
+ return __incrementInventory;
149
+ }
150
+ exports.incrementInventory = incrementInventory;
151
+ //# sourceMappingURL=stores-v2-inventory.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores-v2-inventory.http.js","sourceRoot":"","sources":["../../../src/stores-v2-inventory.http.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,6 @@
1
+ import { HttpClient } from '@wix/sdk-types';
2
+ import { DecrementInventoryOptions, IncrementInventoryOptions } from './stores-v2-inventory.universal';
3
+ export declare function decrementInventory(httpClient: HttpClient): (options?: DecrementInventoryOptions | undefined) => Promise<void>;
4
+ export declare function incrementInventory(httpClient: HttpClient): (options?: IncrementInventoryOptions | undefined) => Promise<void>;
5
+ export { ReasonType } from './stores-v2-inventory.universal';
6
+ export { InventoryItemV2, InventoryVariantV2, PreorderInfo, InventoryItemChanged, InventoryVariantsChanged, ChangedInventoryVariant, ChangedInventoryVariantData, GetInventoryVariantsRequest, GetInventoryVariantsRequestIdOneOf, GetInventoryVariantsResponse, GetInventoryItemsRequest, GetInventoryItemsResponse, QueryInventoryRequest, Query, Paging, QueryInventoryResponse, PagingMetadata, UpdateInventoryVariantsRequest, UpdateInventoryVariantsResponse, BulkUpdateInventoryVariantsRequest, BulkUpdateInventoryVariantsRequestActionOneOf, BulkUpdateInventoryVariantsResponse, BulkUpdateInventoryItemsRequest, BulkUpdateInventoryItemsResponse, DecrementInventoryRequest, DecrementData, DecrementDataIdOneOf, DecrementInventoryResponse, IncrementInventoryRequest, IncrementData, IncrementDataIdOneOf, IncrementInventoryResponse, DecrementInventoryOptions, IncrementInventoryOptions, } from './stores-v2-inventory.universal';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReasonType = exports.incrementInventory = exports.decrementInventory = void 0;
4
+ const stores_v2_inventory_universal_1 = require("./stores-v2-inventory.universal");
5
+ function decrementInventory(httpClient) {
6
+ return (options) => stores_v2_inventory_universal_1.decrementInventory(options,
7
+ // @ts-ignore
8
+ { httpClient });
9
+ }
10
+ exports.decrementInventory = decrementInventory;
11
+ function incrementInventory(httpClient) {
12
+ return (options) => stores_v2_inventory_universal_1.incrementInventory(options,
13
+ // @ts-ignore
14
+ { httpClient });
15
+ }
16
+ exports.incrementInventory = incrementInventory;
17
+ var stores_v2_inventory_universal_2 = require("./stores-v2-inventory.universal");
18
+ Object.defineProperty(exports, "ReasonType", { enumerable: true, get: function () { return stores_v2_inventory_universal_2.ReasonType; } });
19
+ //# sourceMappingURL=stores-v2-inventory.public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores-v2-inventory.public.js","sourceRoot":"","sources":["../../../src/stores-v2-inventory.public.ts"],"names":[],"mappings":";;;AACA,mFAKyC;AAEzC,SAAgB,kBAAkB,CAAC,UAAsB;IACvD,OAAO,CAAC,OAAmC,EAAE,EAAE,CAC7C,kDAA2B,CACzB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gDAOC;AAED,SAAgB,kBAAkB,CAAC,UAAsB;IACvD,OAAO,CAAC,OAAmC,EAAE,EAAE,CAC7C,kDAA2B,CACzB,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAPD,gDAOC;AAED,iFAA6D;AAApD,2HAAA,UAAU,OAAA"}
@@ -0,0 +1,252 @@
1
+ export interface InventoryItemV2 {
2
+ /** Inventory item ID. */
3
+ id?: string | null;
4
+ /**
5
+ * Deprecated: use productId.
6
+ * @readonly
7
+ */
8
+ externalId?: string | null;
9
+ /**
10
+ * Product ID.
11
+ * @readonly
12
+ */
13
+ productId?: string | null;
14
+ /** Whether quantity is being tracked. */
15
+ trackQuantity?: boolean | null;
16
+ /** Variants associated with this inventory item. */
17
+ variants?: InventoryVariantV2[];
18
+ /**
19
+ * Last updated timestamp.
20
+ * @readonly
21
+ */
22
+ lastUpdated?: Date;
23
+ /**
24
+ * Inventory’s unique numeric ID (assigned in ascending order).
25
+ * Primarily for sorting and filtering when crawling all inventories.
26
+ * @readonly
27
+ */
28
+ numericId?: string;
29
+ /** preorder information. */
30
+ preorderInfo?: PreorderInfo;
31
+ }
32
+ export interface InventoryVariantV2 {
33
+ /** Variant ID. */
34
+ variantId?: string;
35
+ /** Whether the product is listed as in stock. */
36
+ inStock?: boolean | null;
37
+ /** Quantity currently left in inventory (only returned when inventory is being tracked). */
38
+ quantity?: number | null;
39
+ /**
40
+ * Indicates whether the variant is available for preorder, true when the variant is out of stock and pre order enabled on inventory level.
41
+ * @readonly
42
+ */
43
+ availableForPreorder?: boolean;
44
+ }
45
+ export interface PreorderInfo {
46
+ /** Whether the item is set to allow preordering. */
47
+ enabled?: boolean;
48
+ /** A message that buyer will see when the item is out of stock and preorder enabled */
49
+ message?: string | null;
50
+ /** Number of products that can be preordered after stock reaches zero. */
51
+ limit?: number | null;
52
+ }
53
+ export interface InventoryItemChanged {
54
+ /** Inventory item ID. */
55
+ inventoryItemId?: string;
56
+ /** Deprecated: use productId. */
57
+ externalId?: string;
58
+ /** Product ID. */
59
+ productId?: string;
60
+ /** Whether inventory is being tracked. */
61
+ trackInventory?: boolean;
62
+ /** preorder information. */
63
+ preorderInfo?: PreorderInfo;
64
+ /** Field mask of updated fields (required - passing an empty `fieldMask` will return an error). */
65
+ fieldMask?: string[];
66
+ }
67
+ export interface InventoryVariantsChanged {
68
+ /** Inventory item ID. */
69
+ inventoryItemId?: string;
70
+ /** Deprecated: use productId. */
71
+ externalId?: string;
72
+ /** Product ID. */
73
+ productId?: string;
74
+ /** Information about changed variants. */
75
+ variants?: ChangedInventoryVariant[];
76
+ }
77
+ export interface ChangedInventoryVariant {
78
+ /** Variant ID. */
79
+ id?: string;
80
+ /** Previous inventory variant data. */
81
+ oldValue?: ChangedInventoryVariantData;
82
+ /** Current inventory variant data. */
83
+ newValue?: ChangedInventoryVariantData;
84
+ }
85
+ export interface ChangedInventoryVariantData {
86
+ /** Inventory variant quantity. */
87
+ quantity?: number | null;
88
+ /** Whether the product variant is in stock. */
89
+ inStock?: boolean;
90
+ /** Indicates whether the variant is available for preorder, true when the variant is out of stock and pre order enabled on product level. */
91
+ availableForPreorder?: boolean;
92
+ }
93
+ export declare enum ReasonType {
94
+ UNKNOWN = "UNKNOWN",
95
+ ORDER = "ORDER",
96
+ MANUAL = "MANUAL",
97
+ REVERT_INVENTORY_CHANGE = "REVERT_INVENTORY_CHANGE"
98
+ }
99
+ export interface GetInventoryVariantsRequest extends GetInventoryVariantsRequestIdOneOf {
100
+ /** Variant IDs to query for this inventory item (optional). */
101
+ variantIds?: string[];
102
+ /** Inventory item ID. */
103
+ inventoryId?: string;
104
+ /** Deprecated (use productID instead). */
105
+ externalId?: string;
106
+ /** Product ID. */
107
+ productId?: string;
108
+ }
109
+ /** @oneof */
110
+ export interface GetInventoryVariantsRequestIdOneOf {
111
+ /** Inventory item ID. */
112
+ inventoryId?: string;
113
+ /** Deprecated (use productID instead). */
114
+ externalId?: string;
115
+ /** Product ID. */
116
+ productId?: string;
117
+ }
118
+ export interface GetInventoryVariantsResponse {
119
+ /** Inventory item. */
120
+ inventoryItem?: InventoryItemV2;
121
+ }
122
+ export interface GetInventoryItemsRequest {
123
+ /** Product IDs */
124
+ productIds?: string[];
125
+ }
126
+ export interface GetInventoryItemsResponse {
127
+ /** Inventory items. */
128
+ inventoryItems?: InventoryItemV2[];
129
+ }
130
+ export interface QueryInventoryRequest {
131
+ query?: Query;
132
+ }
133
+ export interface Query {
134
+ paging?: Paging;
135
+ /** Filter string */
136
+ filter?: string | null;
137
+ /** Sort string */
138
+ sort?: string | null;
139
+ }
140
+ export interface Paging {
141
+ /** Amount of items to load per page */
142
+ limit?: number | null;
143
+ /** Number of items to skip in the display (relevant for all pages after the first) */
144
+ offset?: number | null;
145
+ }
146
+ export interface QueryInventoryResponse {
147
+ /** Inventory items. */
148
+ inventoryItems?: InventoryItemV2[];
149
+ /** Display metadata. */
150
+ metadata?: PagingMetadata;
151
+ /** Number of total results. */
152
+ totalResults?: number;
153
+ }
154
+ export interface PagingMetadata {
155
+ /** Amount of items to load per page */
156
+ items?: number;
157
+ /** Number of items to skip in the display (relevant for all pages after the first) */
158
+ offset?: number;
159
+ }
160
+ export interface UpdateInventoryVariantsRequest {
161
+ /** Inventory item. */
162
+ inventoryItem?: InventoryItemV2;
163
+ }
164
+ export interface UpdateInventoryVariantsResponse {
165
+ }
166
+ export interface BulkUpdateInventoryVariantsRequest extends BulkUpdateInventoryVariantsRequestActionOneOf {
167
+ /** Variants filter. See documentation [here](https://bo.wix.com/wix-docs/rnd/platformization-guidelines/api-query-language#platformization-guidelines_api-query-language_defining-in-protobuf) */
168
+ filter?: Record<string, any> | null;
169
+ /** Change availability. */
170
+ setInStock?: boolean | null;
171
+ /** Set new quantity. */
172
+ setQuantity?: number | null;
173
+ /** Number to increment inventory by. */
174
+ incrementBy?: number | null;
175
+ /** Number to decrement inventory by. */
176
+ decrementBy?: number | null;
177
+ }
178
+ /** @oneof */
179
+ export interface BulkUpdateInventoryVariantsRequestActionOneOf {
180
+ /** Change availability. */
181
+ setInStock?: boolean | null;
182
+ /** Set new quantity. */
183
+ setQuantity?: number | null;
184
+ /** Number to increment inventory by. */
185
+ incrementBy?: number | null;
186
+ /** Number to decrement inventory by. */
187
+ decrementBy?: number | null;
188
+ }
189
+ export interface BulkUpdateInventoryVariantsResponse {
190
+ }
191
+ export interface BulkUpdateInventoryItemsRequest {
192
+ /** Variants filter */
193
+ variantsFilter?: Record<string, any> | null;
194
+ /** Whether inventory is being tracked. */
195
+ trackInventory?: boolean | null;
196
+ }
197
+ export interface BulkUpdateInventoryItemsResponse {
198
+ }
199
+ export interface DecrementInventoryRequest {
200
+ decrementData?: DecrementData[];
201
+ }
202
+ export interface DecrementData extends DecrementDataIdOneOf {
203
+ /** Variant ID. */
204
+ variantId?: string;
205
+ /** Number to decrement inventory by. */
206
+ decrementBy?: number;
207
+ /**
208
+ * Whether the request to decrement the item's inventory was made as part of a purchase that includes preorder items.
209
+ * If true and the item is available for preorder, we allow negative inventory.
210
+ * If false and the item is not available for preorder, we allow regular buy flow (no negative inventory).
211
+ */
212
+ preorderRequest?: boolean;
213
+ /** Inventory item ID. */
214
+ inventoryId?: string;
215
+ /** Deprecated: use productId. */
216
+ externalId?: string;
217
+ /** Product ID. */
218
+ productId?: string;
219
+ }
220
+ /** @oneof */
221
+ export interface DecrementDataIdOneOf {
222
+ /** Inventory item ID. */
223
+ inventoryId?: string;
224
+ /** Deprecated: use productId. */
225
+ externalId?: string;
226
+ /** Product ID. */
227
+ productId?: string;
228
+ }
229
+ export interface DecrementInventoryResponse {
230
+ }
231
+ export interface IncrementInventoryRequest {
232
+ incrementData?: IncrementData[];
233
+ }
234
+ export interface IncrementData extends IncrementDataIdOneOf {
235
+ /** Variant ID. */
236
+ variantId?: string;
237
+ /** Number to increment inventory by. */
238
+ incrementBy?: number;
239
+ /** Inventory item ID. */
240
+ inventoryId?: string;
241
+ /** Product ID. */
242
+ productId?: string;
243
+ }
244
+ /** @oneof */
245
+ export interface IncrementDataIdOneOf {
246
+ /** Inventory item ID. */
247
+ inventoryId?: string;
248
+ /** Product ID. */
249
+ productId?: string;
250
+ }
251
+ export interface IncrementInventoryResponse {
252
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReasonType = void 0;
4
+ var ReasonType;
5
+ (function (ReasonType) {
6
+ ReasonType["UNKNOWN"] = "UNKNOWN";
7
+ ReasonType["ORDER"] = "ORDER";
8
+ ReasonType["MANUAL"] = "MANUAL";
9
+ ReasonType["REVERT_INVENTORY_CHANGE"] = "REVERT_INVENTORY_CHANGE";
10
+ })(ReasonType = exports.ReasonType || (exports.ReasonType = {}));
11
+ //# sourceMappingURL=stores-v2-inventory.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores-v2-inventory.types.js","sourceRoot":"","sources":["../../../src/stores-v2-inventory.types.ts"],"names":[],"mappings":";;;AAmGA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,iEAAmD,CAAA;AACrD,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB"}