@wix/stores 1.0.976 → 1.0.978
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.
- package/_sdk-exports/context-category-by-id/runtime.js +2 -2
- package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-category-info/runtime.js +2 -2
- package/_sdk-exports/context-product-by-id/runtime.js +2 -2
- package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-product-item/runtime.js +2 -2
- package/build/cjs/context-category-by-id.js +218 -207
- package/build/cjs/context-category-by-id.js.map +1 -1
- package/build/cjs/context-category-by-slug.js +1202 -1191
- package/build/cjs/context-category-by-slug.js.map +1 -1
- package/build/cjs/context-category-info.js +258 -248
- package/build/cjs/context-category-info.js.map +1 -1
- package/build/cjs/context-product-by-id.js +39 -31
- package/build/cjs/context-product-by-id.js.map +1 -1
- package/build/cjs/context-product-by-slug.js +48 -40
- package/build/cjs/context-product-by-slug.js.map +1 -1
- package/build/cjs/context-product-item.js +1042 -1034
- package/build/cjs/context-product-item.js.map +1 -1
- package/build/es/context-category-by-id.mjs +218 -207
- package/build/es/context-category-by-id.mjs.map +1 -1
- package/build/es/context-category-by-slug.mjs +1202 -1191
- package/build/es/context-category-by-slug.mjs.map +1 -1
- package/build/es/context-category-info.mjs +262 -252
- package/build/es/context-category-info.mjs.map +1 -1
- package/build/es/context-product-by-id.mjs +39 -31
- package/build/es/context-product-by-id.mjs.map +1 -1
- package/build/es/context-product-by-slug.mjs +48 -40
- package/build/es/context-product-by-slug.mjs.map +1 -1
- package/build/es/context-product-item.mjs +1042 -1034
- package/build/es/context-product-item.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// _sdk-exports/context-category-info/runtime.js
|
|
2
|
-
import { Suspense as e, createContext as t, useCallback as n, useContext as r, useMemo as i
|
|
3
|
-
import { useGetService as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
function
|
|
2
|
+
import { Suspense as e, createContext as t, useCallback as n, useContext as r, useMemo as i } from "react";
|
|
3
|
+
import { useGetService as a, useService as o } from "@wix/services-manager-react";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
var c = {};
|
|
6
|
+
function l(e2, t2 = false, n2 = (e3) => e3) {
|
|
7
7
|
return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var u = (e2) => {
|
|
10
10
|
switch (e2) {
|
|
11
11
|
case `get`:
|
|
12
12
|
case `GET`:
|
|
@@ -37,7 +37,7 @@ var ee = (e2) => (t2) => async (n2) => {
|
|
|
37
37
|
let r2, i2 = (t3) => {
|
|
38
38
|
if (r2 = e2(n2)(t3), r2.url === void 0) throw Error(`Url was not successfully created for this request, please reach out to support channels for assistance.`);
|
|
39
39
|
let { method: i3, url: a2, params: o2 } = r2;
|
|
40
|
-
return { ...r2, method:
|
|
40
|
+
return { ...r2, method: u(i3), url: a2, data: r2.data, params: o2 };
|
|
41
41
|
};
|
|
42
42
|
try {
|
|
43
43
|
let e3 = await t2.request(i2);
|
|
@@ -61,43 +61,43 @@ var ie = class extends Error {
|
|
|
61
61
|
}
|
|
62
62
|
async details() {
|
|
63
63
|
let e2 = await this.response.json();
|
|
64
|
-
return
|
|
64
|
+
return d(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var d = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
68
68
|
var ae = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
|
|
69
69
|
var oe = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
|
|
70
70
|
var se = (e2) => e2.__type === `host`;
|
|
71
71
|
function ce(e2, t2) {
|
|
72
72
|
return e2.create(t2);
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
function
|
|
76
|
-
return { [
|
|
74
|
+
var f = `x-wix-bi-gateway`;
|
|
75
|
+
function p(e2, t2, n2) {
|
|
76
|
+
return { [f]: m({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function m(e2) {
|
|
79
79
|
return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
|
|
80
80
|
}
|
|
81
81
|
function h(e2) {
|
|
82
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
83
|
-
globalThis.__wix_context__ = void 0,
|
|
82
|
+
let t2 = globalThis.__wix_context__, n2 = { client: c.client, elevatedClient: c.elevatedClient }, r2;
|
|
83
|
+
globalThis.__wix_context__ = void 0, c.client = void 0, c.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
84
84
|
try {
|
|
85
85
|
return e2();
|
|
86
86
|
} finally {
|
|
87
|
-
globalThis.__wix_context__ = t2,
|
|
87
|
+
globalThis.__wix_context__ = t2, c.client = n2.client, c.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var le = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
91
|
+
function g(e2) {
|
|
92
92
|
return pe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
93
93
|
}
|
|
94
94
|
var ue = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
95
95
|
var de = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
96
|
-
var
|
|
96
|
+
var _ = `$1\0$2`;
|
|
97
97
|
var fe = /[^\p{L}\d]+/giu;
|
|
98
98
|
function pe(e2) {
|
|
99
99
|
let t2 = e2.trim();
|
|
100
|
-
t2 = t2.replace(ue,
|
|
100
|
+
t2 = t2.replace(ue, _).replace(de, _), t2 = t2.replace(fe, `\0`);
|
|
101
101
|
let n2 = 0, r2 = t2.length;
|
|
102
102
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
103
103
|
if (n2 === r2) return [];
|
|
@@ -112,35 +112,35 @@ function _e(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {},
|
|
|
112
112
|
if (me(e2)) return ve(e2, t2, n2);
|
|
113
113
|
if (he(e2)) return ye(e2);
|
|
114
114
|
if (ge(e2)) {
|
|
115
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
116
|
-
return
|
|
115
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: g(n3), data: {} }, requestId: e2.requestId };
|
|
116
|
+
return v(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
117
117
|
}
|
|
118
118
|
return be(e2);
|
|
119
119
|
}
|
|
120
120
|
var ve = (e2, t2, n2) => {
|
|
121
121
|
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = xe(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
122
|
-
return
|
|
122
|
+
return v(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
123
123
|
};
|
|
124
|
-
var
|
|
124
|
+
var v = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
125
125
|
var ye = (e2) => {
|
|
126
|
-
let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ??
|
|
127
|
-
return
|
|
126
|
+
let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? g(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
|
|
127
|
+
return v(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
128
128
|
};
|
|
129
|
-
var be = (e2) =>
|
|
129
|
+
var be = (e2) => v(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: g(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
130
130
|
var xe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
131
131
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
132
132
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
133
133
|
let r3 = t2[e3.field];
|
|
134
|
-
if (r3) return { ...e3, field:
|
|
134
|
+
if (r3) return { ...e3, field: y(r3, i2) };
|
|
135
135
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
136
136
|
if (s2) {
|
|
137
137
|
let t3 = a2[s2];
|
|
138
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
138
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, y(t3, i2)) };
|
|
139
139
|
}
|
|
140
140
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
|
-
var
|
|
143
|
+
var y = (e2, t2) => {
|
|
144
144
|
let n2 = Se(e2);
|
|
145
145
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
146
146
|
};
|
|
@@ -155,7 +155,7 @@ function Ce(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
|
155
155
|
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? re : o3}${a3.url}`;
|
|
156
156
|
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
157
157
|
try {
|
|
158
|
-
let e4 =
|
|
158
|
+
let e4 = p(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
|
|
159
159
|
if (s3.status !== 200) {
|
|
160
160
|
let e5 = null;
|
|
161
161
|
try {
|
|
@@ -183,7 +183,7 @@ var Te = (e2, t2, n2, r2) => new we({ response: { data: { details: { ...!n2?.val
|
|
|
183
183
|
var Ee = `.`;
|
|
184
184
|
function De(e2, t2, n2) {
|
|
185
185
|
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
186
|
-
let r2 =
|
|
186
|
+
let r2 = Oe(t2), i2 = e2;
|
|
187
187
|
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
188
188
|
let t3 = r2[e3];
|
|
189
189
|
if (e3 === r2.length - 1) {
|
|
@@ -195,21 +195,21 @@ function De(e2, t2, n2) {
|
|
|
195
195
|
}
|
|
196
196
|
return e2;
|
|
197
197
|
}
|
|
198
|
-
function x(e2) {
|
|
199
|
-
return Array.isArray(e2) ? e2 : e2.split(Ee).map((e3) => Oe(e3) ? Number(e3) : e3);
|
|
200
|
-
}
|
|
201
198
|
function Oe(e2) {
|
|
202
|
-
return
|
|
199
|
+
return Array.isArray(e2) ? e2 : e2.split(Ee).map((e3) => ke(e3) ? Number(e3) : e3);
|
|
203
200
|
}
|
|
204
201
|
function ke(e2) {
|
|
202
|
+
return /^\d+$/.test(e2);
|
|
203
|
+
}
|
|
204
|
+
function Ae(e2) {
|
|
205
205
|
let t2 = {};
|
|
206
|
-
for (let [n2, r2] of Object.entries(e2))
|
|
206
|
+
for (let [n2, r2] of Object.entries(e2)) je(n2) || De(t2, Oe(n2), r2);
|
|
207
207
|
return t2;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function je(e2) {
|
|
210
210
|
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
211
211
|
}
|
|
212
|
-
var
|
|
212
|
+
var Me = class {
|
|
213
213
|
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
214
214
|
NUMERIC_PATTERN = /^\d+$/;
|
|
215
215
|
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
@@ -232,7 +232,7 @@ var je = class {
|
|
|
232
232
|
return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
233
233
|
}
|
|
234
234
|
unflatten() {
|
|
235
|
-
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])),
|
|
235
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), Ae(this.cleanedModifiedFields);
|
|
236
236
|
}
|
|
237
237
|
flatten(e2) {
|
|
238
238
|
let t2 = {};
|
|
@@ -252,12 +252,12 @@ var je = class {
|
|
|
252
252
|
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
253
253
|
r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
|
|
254
254
|
}, a2 = (e3, t3) => {
|
|
255
|
-
let i3 = e3 in
|
|
255
|
+
let i3 = e3 in le ? le[e3] : void 0;
|
|
256
256
|
if (i3 && i3 in t3) {
|
|
257
257
|
r2.push(i3), n2 = t3[i3];
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
let a3 =
|
|
260
|
+
let a3 = Ie(e3);
|
|
261
261
|
if (a3 && a3 in t3) {
|
|
262
262
|
r2.push(a3), n2 = t3[a3];
|
|
263
263
|
return;
|
|
@@ -288,28 +288,28 @@ var je = class {
|
|
|
288
288
|
return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
291
|
-
function
|
|
291
|
+
function Ne(e2, t2) {
|
|
292
292
|
let n2 = e2?.modifiedFields;
|
|
293
293
|
if (!n2) return null;
|
|
294
|
-
let r2 =
|
|
294
|
+
let r2 = Pe(n2);
|
|
295
295
|
if (!r2) return null;
|
|
296
296
|
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
297
297
|
e2 = { ...e2, modifiedFields: i2 };
|
|
298
298
|
let o2 = t2(e2), s2 = o2?.modifiedFields;
|
|
299
299
|
if (!s2) return null;
|
|
300
|
-
let c2 =
|
|
300
|
+
let c2 = Fe(s2, a2);
|
|
301
301
|
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Pe(e2) {
|
|
304
304
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
305
|
-
let t2 = new
|
|
305
|
+
let t2 = new Me(e2);
|
|
306
306
|
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
307
307
|
} catch {
|
|
308
308
|
return null;
|
|
309
309
|
}
|
|
310
310
|
return null;
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Fe(e2, t2) {
|
|
313
313
|
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
314
314
|
return t2.flatten(e2);
|
|
315
315
|
} catch {
|
|
@@ -317,10 +317,10 @@ function Pe(e2, t2) {
|
|
|
317
317
|
}
|
|
318
318
|
return null;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Ie(e2) {
|
|
321
321
|
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function b() {
|
|
324
324
|
return { emit(e2, ...t2) {
|
|
325
325
|
for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
326
326
|
}, events: {}, on(e2, t2) {
|
|
@@ -329,8 +329,8 @@ function S() {
|
|
|
329
329
|
};
|
|
330
330
|
} };
|
|
331
331
|
}
|
|
332
|
-
var
|
|
333
|
-
function
|
|
332
|
+
var Le = (e2) => e2.__type === `event-definition`;
|
|
333
|
+
function x(e2, t2, n2, r2) {
|
|
334
334
|
let i2;
|
|
335
335
|
if (e2.isDomainEvent) {
|
|
336
336
|
let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
@@ -341,14 +341,14 @@ function C(e2, t2, n2, r2) {
|
|
|
341
341
|
let e3 = s2.modifiedFields;
|
|
342
342
|
if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
|
|
343
343
|
o2 = structuredClone(i2);
|
|
344
|
-
let e4 =
|
|
344
|
+
let e4 = Ne(s2, a2);
|
|
345
345
|
if (e4) return t2(e4);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
return t2(a2(o2));
|
|
349
349
|
}
|
|
350
|
-
function
|
|
351
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
350
|
+
function Re(e2) {
|
|
351
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = b();
|
|
352
352
|
return { initModule(e3) {
|
|
353
353
|
return (r2) => {
|
|
354
354
|
let i2 = t2.get(e3.type) ?? [];
|
|
@@ -358,7 +358,7 @@ function Le(e2) {
|
|
|
358
358
|
let { eventType: r2, identity: i2, instanceId: a2, payload: o2, accountInfo: s2 } = await this.parseJWT(e3), c2 = [...n3.expectedEvents, ...Array.from(t2.keys()).map((e4) => ({ type: e4 }))];
|
|
359
359
|
if (c2.length > 0 && !c2.some(({ type: e4 }) => e4 === r2)) throw Error(`Unexpected event type: ${r2}. Expected one of: ${c2.map((e4) => e4.type).join(`, `)}`);
|
|
360
360
|
let l2 = t2.get(r2) ?? [];
|
|
361
|
-
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) =>
|
|
361
|
+
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => x(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
362
362
|
}, async processRequest(e3, t3) {
|
|
363
363
|
let n3 = await e3.text();
|
|
364
364
|
return this.process(n3, t3);
|
|
@@ -377,12 +377,12 @@ function Le(e2) {
|
|
|
377
377
|
let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
|
|
378
378
|
if (n3.length > 0 && !n3.some(({ type: t3 }) => t3 === e3.eventType)) throw Error(`Unexpected event type: ${e3.eventType}. Expected one of: ${n3.map((e4) => e4.type).join(`, `)}`);
|
|
379
379
|
let r2 = t2.get(e3.eventType) ?? [];
|
|
380
|
-
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) =>
|
|
381
|
-
}, apps: { AppInstalled:
|
|
380
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => x(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
381
|
+
}, apps: { AppInstalled: l(`AppInstalled`)(), AppRemoved: l(`AppRemoved`)() } } };
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let t2 = /* @__PURE__ */ new Map(), n2 =
|
|
383
|
+
var ze = (e2) => e2.__type === `service-plugin-definition`;
|
|
384
|
+
function Be(e2) {
|
|
385
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = b();
|
|
386
386
|
return { initModule(e3) {
|
|
387
387
|
return (r2) => {
|
|
388
388
|
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
@@ -423,33 +423,33 @@ function ze(e2) {
|
|
|
423
423
|
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
424
424
|
} } };
|
|
425
425
|
}
|
|
426
|
-
var
|
|
427
|
-
function
|
|
426
|
+
var S = `X-Wix-Consistent`;
|
|
427
|
+
function Ve(e2) {
|
|
428
428
|
let t2 = e2.headers || { Authorization: `` }, n2 = { getAuthHeaders: (e3) => Promise.resolve({ headers: {} }) }, r2 = e2.auth, i2 = typeof r2 == `function` ? r2 : () => r2 ?? n2, a2 = () => i2().getAuthHeaders(e2.host), o2 = () => e2.fetch ?? fetch, s2 = async (n3, r3) => {
|
|
429
|
-
let i3 = o2(), s3 = await a2(),
|
|
429
|
+
let i3 = o2(), s3 = await a2(), c2 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [S]: t2[S] } : {} }, l3 = e2.host?.getErrorHandler?.();
|
|
430
430
|
try {
|
|
431
431
|
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
432
|
-
let e3 = await i3(n3, { ...r3, headers:
|
|
433
|
-
|
|
434
|
-
let a3 =
|
|
435
|
-
return a3 && (t2[
|
|
432
|
+
let e3 = await i3(n3, { ...r3, headers: c2 });
|
|
433
|
+
l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
434
|
+
let a3 = C(e3);
|
|
435
|
+
return a3 && (t2[S] = a3), e3;
|
|
436
436
|
}
|
|
437
437
|
{
|
|
438
|
-
for (let [e4, t3] of Object.entries(
|
|
438
|
+
for (let [e4, t3] of Object.entries(c2)) typeof t3 == `string` && n3.headers.set(e4, t3);
|
|
439
439
|
let e3 = await i3(n3, r3);
|
|
440
|
-
|
|
441
|
-
let a3 =
|
|
442
|
-
return a3 && (t2[
|
|
440
|
+
l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
441
|
+
let a3 = C(e3);
|
|
442
|
+
return a3 && (t2[S] = a3), e3;
|
|
443
443
|
}
|
|
444
444
|
} catch (e3) {
|
|
445
|
-
throw
|
|
445
|
+
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
446
446
|
}
|
|
447
|
-
}, { client:
|
|
448
|
-
let i3 = o2(), s3 = await a2(),
|
|
449
|
-
return u3 && (t2[
|
|
447
|
+
}, { client: l2, initModule: u2 } = Be(i2), { client: re2, initModule: d2 } = Re(i2), f2 = async (n3, r3) => {
|
|
448
|
+
let i3 = o2(), s3 = await a2(), c2 = ae(r3), l3 = await i3(n3, { ...r3, headers: { ...c2, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [S]: t2[S] } : {} } }), u3 = C(l3);
|
|
449
|
+
return u3 && (t2[S] = u3), l3;
|
|
450
450
|
}, p2 = (t3, n3) => {
|
|
451
|
-
if (
|
|
452
|
-
if (
|
|
451
|
+
if (Le(t3)) return d2(t3);
|
|
452
|
+
if (ze(t3)) return u2(t3);
|
|
453
453
|
if (se(t3) && e2.host) return ce(t3, e2.host);
|
|
454
454
|
if (typeof t3 == `function`) {
|
|
455
455
|
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
@@ -467,7 +467,7 @@ function Be(e2) {
|
|
|
467
467
|
let t3 = i2();
|
|
468
468
|
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
|
|
469
469
|
}, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
|
|
470
|
-
e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ?
|
|
470
|
+
e3 === `global` ? globalThis.__wix_context__ == null ? t3.elevated ? globalThis.__wix_context__ = { elevatedClient: this } : globalThis.__wix_context__ = { client: this } : t3.elevated ? globalThis.__wix_context__.elevatedClient = this : globalThis.__wix_context__.client = this : t3.elevated ? c.elevatedClient = this : c.client = this;
|
|
471
471
|
}, fetch: (t3, n3) => {
|
|
472
472
|
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
473
473
|
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
@@ -476,23 +476,23 @@ function Be(e2) {
|
|
|
476
476
|
if (a3.status !== 200) throw new ie(`GraphQL request failed with status ${a3.status}`, a3);
|
|
477
477
|
let { data: o3, errors: s3 } = await a3.json();
|
|
478
478
|
return { data: o3 ?? {}, errors: s3 };
|
|
479
|
-
}, webhooks:
|
|
479
|
+
}, webhooks: re2, servicePlugins: l2 };
|
|
480
480
|
}
|
|
481
|
-
function
|
|
481
|
+
function C(e2) {
|
|
482
482
|
return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
|
|
483
483
|
}
|
|
484
|
-
var
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
function
|
|
484
|
+
var w = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
485
|
+
var He = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
486
|
+
var Ue = w;
|
|
487
|
+
function T(e2, t2) {
|
|
488
488
|
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
return t2 ?
|
|
490
|
+
function E(e2, { transformSystemFields: t2 = true } = {}) {
|
|
491
|
+
return t2 ? T(e2, Ue) : e2;
|
|
492
492
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
495
|
-
return (e2 ===
|
|
493
|
+
var D = `sort.fieldName`;
|
|
494
|
+
function We(e2, t2, n2) {
|
|
495
|
+
return (e2 === D || e2.endsWith(`.${D}`)) && typeof t2 == `string` ? T(t2, n2) : t2;
|
|
496
496
|
}
|
|
497
497
|
function O(e2, t2, n2) {
|
|
498
498
|
let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
|
|
@@ -504,22 +504,22 @@ function O(e2, t2, n2) {
|
|
|
504
504
|
Object.keys(a2).forEach((e4) => {
|
|
505
505
|
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
506
506
|
if (r2(o2)) return;
|
|
507
|
-
let s2 =
|
|
508
|
-
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] =
|
|
507
|
+
let s2 = Ge(e4, t2);
|
|
508
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = We(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
511
|
};
|
|
512
512
|
return i2(e2, ``), e2;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function Ge(e2, t2) {
|
|
515
515
|
let n2;
|
|
516
516
|
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
return O(e2,
|
|
518
|
+
function Ke(e2, t2 = []) {
|
|
519
|
+
return O(e2, w, t2);
|
|
520
520
|
}
|
|
521
521
|
function k(e2, t2 = []) {
|
|
522
|
-
return O(e2,
|
|
522
|
+
return O(e2, He, t2);
|
|
523
523
|
}
|
|
524
524
|
function A(e2) {
|
|
525
525
|
return e2 ? new Date(e2) : void 0;
|
|
@@ -528,12 +528,12 @@ var j = /* @__PURE__ */ new WeakMap();
|
|
|
528
528
|
function M() {
|
|
529
529
|
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function qe(e2, t2) {
|
|
532
532
|
let n2 = e2.get(t2);
|
|
533
533
|
return n2 || (n2 = M(), e2.set(t2, n2)), n2;
|
|
534
534
|
}
|
|
535
535
|
function Je(e2, t2) {
|
|
536
|
-
return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(),
|
|
536
|
+
return t2 === `*` ? (e2.anyField ??= M(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), qe(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), qe(e2.fields, t2));
|
|
537
537
|
}
|
|
538
538
|
function Ye(e2) {
|
|
539
539
|
let t2 = M();
|
|
@@ -547,47 +547,47 @@ function Xe(e2) {
|
|
|
547
547
|
let t2 = j.get(e2);
|
|
548
548
|
return t2 || (t2 = Ye(e2), j.set(e2, t2)), t2;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function N(e2) {
|
|
551
551
|
return typeof e2 == `object` && !!e2;
|
|
552
552
|
}
|
|
553
553
|
function Ze(e2, { isRepeated: t2, isMap: n2 }, r2) {
|
|
554
|
-
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ?
|
|
554
|
+
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? N(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
|
|
555
555
|
}
|
|
556
|
-
function
|
|
557
|
-
|
|
556
|
+
function P(e2, t2, n2) {
|
|
557
|
+
N(e2) && F(e2, t2, n2);
|
|
558
558
|
}
|
|
559
559
|
function Qe(e2, t2, n2) {
|
|
560
560
|
for (let [r2, i2] of t2) {
|
|
561
561
|
if (!(r2 in e2)) continue;
|
|
562
562
|
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = Ze(e2[r2], t4, n2);
|
|
563
563
|
let t3 = e2[r2];
|
|
564
|
-
Array.isArray(t3) ? t3.forEach((e3) =>
|
|
564
|
+
Array.isArray(t3) ? t3.forEach((e3) => P(e3, i2, n2)) : P(t3, i2, n2);
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
function $e(e2, t2, n2) {
|
|
568
568
|
for (let [r2, i2] of t2) {
|
|
569
569
|
let t3 = e2[r2];
|
|
570
|
-
|
|
570
|
+
N(t3) && Object.values(t3).forEach((e3) => P(e3, i2, n2));
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
-
function
|
|
574
|
-
t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) =>
|
|
573
|
+
function F(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
574
|
+
t2 && Qe(e2, t2, i2), n2 && $e(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => P(e3, r2, i2));
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
if (!
|
|
578
|
-
for (let { paths: n2, transformFn: r2 } of t2)
|
|
576
|
+
function I(e2, t2) {
|
|
577
|
+
if (!N(e2)) return e2;
|
|
578
|
+
for (let { paths: n2, transformFn: r2 } of t2) F(e2, Xe(n2), r2);
|
|
579
579
|
return e2;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function L(e2) {
|
|
582
582
|
return rt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
583
583
|
}
|
|
584
584
|
var et = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
585
585
|
var tt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
586
|
-
var
|
|
586
|
+
var R = `$1\0$2`;
|
|
587
587
|
var nt = /[^\p{L}\d]+/giu;
|
|
588
588
|
function rt(e2) {
|
|
589
589
|
let t2 = e2.trim();
|
|
590
|
-
t2 = t2.replace(et,
|
|
590
|
+
t2 = t2.replace(et, R).replace(tt, R), t2 = t2.replace(nt, `\0`);
|
|
591
591
|
let n2 = 0, r2 = t2.length;
|
|
592
592
|
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
593
593
|
if (n2 === r2) return [];
|
|
@@ -602,35 +602,35 @@ function st(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {},
|
|
|
602
602
|
if (it(e2)) return ct(e2, t2, n2);
|
|
603
603
|
if (at(e2)) return lt(e2);
|
|
604
604
|
if (ot(e2)) {
|
|
605
|
-
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code:
|
|
606
|
-
return
|
|
605
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: L(n3), data: {} }, requestId: e2.requestId };
|
|
606
|
+
return z(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
607
607
|
}
|
|
608
608
|
return ut(e2);
|
|
609
609
|
}
|
|
610
610
|
var ct = (e2, t2, n2) => {
|
|
611
611
|
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = dt(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
|
|
612
|
-
return
|
|
612
|
+
return z(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
613
613
|
};
|
|
614
|
-
var
|
|
614
|
+
var z = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
615
615
|
var lt = (e2) => {
|
|
616
|
-
let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ??
|
|
617
|
-
return
|
|
616
|
+
let t2 = e2.response?.status, n2 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n2, i2 = e2.response?.data?.details?.applicationError?.description ?? n2, a2 = e2.response?.data?.details?.applicationError?.code ?? L(n2), o2 = e2.response?.data?.details?.applicationError?.data ?? {}, s2 = r2 === i2 ? r2 : `${r2}: ${i2}`, c2 = { applicationError: { description: i2, code: a2, data: o2 }, requestId: e2.requestId };
|
|
617
|
+
return z(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
618
618
|
};
|
|
619
|
-
var ut = (e2) =>
|
|
619
|
+
var ut = (e2) => z(e2, { message: e2.requestId ? `System error occurred, request-id: ${e2.requestId}` : `System error occurred: ${JSON.stringify(e2)}`, extraProperties: { requestId: e2.requestId, status: e2.response?.status, code: L(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
620
620
|
var dt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
621
621
|
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
622
622
|
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
623
623
|
let r3 = t2[e3.field];
|
|
624
|
-
if (r3) return { ...e3, field:
|
|
624
|
+
if (r3) return { ...e3, field: B(r3, i2) };
|
|
625
625
|
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
626
626
|
if (s2) {
|
|
627
627
|
let t3 = a2[s2];
|
|
628
|
-
if (t3) return { ...e3, field: e3.field.replace(s2,
|
|
628
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, B(t3, i2)) };
|
|
629
629
|
}
|
|
630
630
|
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
631
631
|
});
|
|
632
632
|
};
|
|
633
|
-
var
|
|
633
|
+
var B = (e2, t2) => {
|
|
634
634
|
let n2 = ft(e2);
|
|
635
635
|
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
636
636
|
};
|
|
@@ -638,23 +638,23 @@ var ft = (e2) => {
|
|
|
638
638
|
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
639
639
|
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
640
640
|
};
|
|
641
|
-
function
|
|
641
|
+
function V() {
|
|
642
642
|
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
643
643
|
if (e2) return { initWixModules(t3, n3) {
|
|
644
|
-
return
|
|
644
|
+
return H(() => e2(t3, n3));
|
|
645
645
|
}, fetchWithAuth() {
|
|
646
646
|
throw Error(`fetchWithAuth is not available in this context`);
|
|
647
647
|
}, graphql() {
|
|
648
648
|
throw Error(`graphql is not available in this context`);
|
|
649
649
|
} };
|
|
650
|
-
let t2 = typeof $wixContext < `u` ? $wixContext.client :
|
|
650
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : c.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : c.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : c.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : c.elevatedClient;
|
|
651
651
|
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
652
652
|
if (r2) {
|
|
653
653
|
if (!n2) throw Error(`An elevated client is required to use elevated modules. Make sure to initialize the Wix context with an elevated client before using elevated SDK modules`);
|
|
654
|
-
return
|
|
654
|
+
return H(() => n2.use(e3));
|
|
655
655
|
}
|
|
656
656
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
657
|
-
return
|
|
657
|
+
return H(() => t2.use(e3));
|
|
658
658
|
}, fetchWithAuth: (e3, n3) => {
|
|
659
659
|
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
660
660
|
return t2.fetchWithAuth(e3, n3);
|
|
@@ -666,24 +666,24 @@ function H() {
|
|
|
666
666
|
return t2.graphql(e3, n3, r2);
|
|
667
667
|
} };
|
|
668
668
|
}
|
|
669
|
-
function
|
|
670
|
-
let t2 = globalThis.__wix_context__, n2 = { client:
|
|
671
|
-
globalThis.__wix_context__ = void 0,
|
|
669
|
+
function H(e2) {
|
|
670
|
+
let t2 = globalThis.__wix_context__, n2 = { client: c.client, elevatedClient: c.elevatedClient }, r2;
|
|
671
|
+
globalThis.__wix_context__ = void 0, c.client = void 0, c.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
672
672
|
try {
|
|
673
673
|
return e2();
|
|
674
674
|
} finally {
|
|
675
|
-
globalThis.__wix_context__ = t2,
|
|
675
|
+
globalThis.__wix_context__ = t2, c.client = n2.client, c.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
function pt(e2, t2) {
|
|
679
679
|
return (...n2) => {
|
|
680
|
-
let r2 =
|
|
680
|
+
let r2 = V();
|
|
681
681
|
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
682
682
|
};
|
|
683
683
|
}
|
|
684
684
|
function mt(e2) {
|
|
685
685
|
let t2 = (...t3) => {
|
|
686
|
-
let n2 =
|
|
686
|
+
let n2 = V();
|
|
687
687
|
return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
|
|
688
688
|
};
|
|
689
689
|
return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
|
|
@@ -692,7 +692,7 @@ function ht(e2, t2 = false) {
|
|
|
692
692
|
return pt(e2, t2);
|
|
693
693
|
}
|
|
694
694
|
function gt(e2, t2) {
|
|
695
|
-
let n2 =
|
|
695
|
+
let n2 = U(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
|
|
696
696
|
return t2 && r2 ? new URLSearchParams({ ".r": yt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
697
697
|
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
|
|
698
698
|
}), e3), new URLSearchParams());
|
|
@@ -701,12 +701,12 @@ function _t(e2) {
|
|
|
701
701
|
let t2 = Mt(At(e2.host), e2.domainToMappings);
|
|
702
702
|
return Vt(Rt(e2.protoPath, e2.data || {}), t2);
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function U(e2, t2 = ``) {
|
|
705
705
|
let n2 = {};
|
|
706
706
|
return Object.entries(e2).forEach(([e3, r2]) => {
|
|
707
707
|
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = vt(t2, e3);
|
|
708
708
|
if (i2) {
|
|
709
|
-
let e4 =
|
|
709
|
+
let e4 = U(r2, a2);
|
|
710
710
|
Object.assign(n2, e4);
|
|
711
711
|
} else n2[a2] = r2;
|
|
712
712
|
}), n2;
|
|
@@ -788,17 +788,17 @@ function Vt(e2, t2) {
|
|
|
788
788
|
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
789
789
|
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function W(e2) {
|
|
792
792
|
return mt(e2);
|
|
793
793
|
}
|
|
794
|
-
function
|
|
794
|
+
function G(e2) {
|
|
795
795
|
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
796
796
|
}
|
|
797
797
|
var Ht = `x-wix-linguist`;
|
|
798
798
|
var Ut = `00000000-0000-0000-0000-000000000000`;
|
|
799
799
|
var Wt = `false`;
|
|
800
800
|
var Gt = () => {
|
|
801
|
-
let e2 =
|
|
801
|
+
let e2 = K(`language`), t2 = K(`locale`);
|
|
802
802
|
if (e2) return { [Ht]: [e2, t2 || e2, Wt, Ut].join(`|`) };
|
|
803
803
|
};
|
|
804
804
|
function Kt() {
|
|
@@ -808,10 +808,10 @@ function Kt() {
|
|
|
808
808
|
}), resolve: e2, reject: t2 };
|
|
809
809
|
}
|
|
810
810
|
var qt = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
811
|
-
var
|
|
811
|
+
var K = (e2) => qt()?.[e2];
|
|
812
812
|
var Jt = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
813
813
|
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Xt();
|
|
814
|
-
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language:
|
|
814
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: K(`language`), locale: K(`locale`), get passThroughHeaders() {
|
|
815
815
|
return Gt();
|
|
816
816
|
} } };
|
|
817
817
|
}, auth: (e3) => {
|
|
@@ -841,15 +841,15 @@ var Zt = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace
|
|
|
841
841
|
throw Error(`Not implemented`);
|
|
842
842
|
}, observeState: () => ({ disconnect: () => {
|
|
843
843
|
} }) });
|
|
844
|
-
var
|
|
844
|
+
var q = Jt({ createHost: function(e2) {
|
|
845
845
|
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
846
846
|
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
847
847
|
return { channel: Zt({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
848
848
|
} };
|
|
849
849
|
} });
|
|
850
850
|
var Qt = (e2, t2) => {
|
|
851
|
-
let n2 =
|
|
852
|
-
return
|
|
851
|
+
let n2 = q.host({ applicationId: e2, componentId: t2 }), r2 = q.auth();
|
|
852
|
+
return Ve({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
853
853
|
};
|
|
854
854
|
var $t = (e2) => Qt(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
|
|
855
855
|
function en(e2) {
|
|
@@ -860,11 +860,21 @@ function en(e2) {
|
|
|
860
860
|
e2.status = `rejected`, e2.reason = t2;
|
|
861
861
|
}), e2);
|
|
862
862
|
}
|
|
863
|
-
function
|
|
863
|
+
function J(e2) {
|
|
864
864
|
return e2;
|
|
865
865
|
}
|
|
866
|
-
var tn =
|
|
867
|
-
|
|
866
|
+
var tn = J(`@wix/site-service-warmup-data`);
|
|
867
|
+
var nn = J(`@wix/site-service-locale`);
|
|
868
|
+
var rn = J(`@wix/viewer-service-multilingual`);
|
|
869
|
+
function an() {
|
|
870
|
+
let e2 = a(), t2 = o(nn), n2;
|
|
871
|
+
try {
|
|
872
|
+
n2 = e2(rn);
|
|
873
|
+
} catch {
|
|
874
|
+
}
|
|
875
|
+
return n2?.multilingualEnabled && n2.currentLocale?.languageCode || t2.language;
|
|
876
|
+
}
|
|
877
|
+
async function on(e2, t2, n2) {
|
|
868
878
|
let r2 = typeof window > `u`;
|
|
869
879
|
if (!r2 && e2) try {
|
|
870
880
|
let n3 = await e2.get(t2);
|
|
@@ -878,41 +888,41 @@ async function nn(e2, t2, n2) {
|
|
|
878
888
|
}
|
|
879
889
|
return i2;
|
|
880
890
|
}
|
|
881
|
-
function
|
|
882
|
-
let n2 =
|
|
883
|
-
|
|
891
|
+
function sn(e2, t2) {
|
|
892
|
+
let n2 = a(), r2 = an();
|
|
893
|
+
return i(() => {
|
|
894
|
+
let i2;
|
|
884
895
|
try {
|
|
885
|
-
|
|
896
|
+
i2 = n2(tn);
|
|
886
897
|
} catch {
|
|
887
|
-
|
|
898
|
+
i2 = null;
|
|
888
899
|
}
|
|
889
|
-
return
|
|
890
|
-
});
|
|
891
|
-
return r2;
|
|
900
|
+
return on(i2, `${e2}:${r2}`, t2);
|
|
901
|
+
}, [r2]);
|
|
892
902
|
}
|
|
893
|
-
function
|
|
903
|
+
function Y(e2) {
|
|
894
904
|
if (!e2) return;
|
|
895
905
|
let t2 = ``;
|
|
896
906
|
return (e2.filename || e2.altText) && (t2 = `/${encodeURIComponent(e2.filename || e2.altText)}`), e2.id ? `wix:image://v1/${e2.id}${t2}#originWidth=${e2.width}&originHeight=${e2.height}` : e2.url;
|
|
897
907
|
}
|
|
898
|
-
function
|
|
899
|
-
let r2 = (r3, i3) =>
|
|
908
|
+
function X(e2, t2, n2 = {}) {
|
|
909
|
+
let r2 = (r3, i3) => X(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [E(e2, t2)]: n2 };
|
|
900
910
|
return { get filter() {
|
|
901
911
|
return i2();
|
|
902
912
|
}, eq: (e3) => r2(`$eq`, e3), ne: (e3) => r2(`$ne`, e3), gt: (e3) => r2(`$gt`, e3), gte: (e3) => r2(`$gte`, e3), lt: (e3) => r2(`$lt`, e3), lte: (e3) => r2(`$lte`, e3), startsWith: (e3) => r2(`$startsWith`, e3), endsWith: (e3) => r2(`$endsWith`, e3), contains: (e3) => r2(`$contains`, e3), in: (e3) => r2(`$in`, e3), nin: (e3) => r2(`$nin`, e3), hasSome: (e3) => r2(`$hasSome`, e3), hasAll: (e3) => r2(`$hasAll`, e3), exists: (e3 = true) => r2(`$exists`, e3), isEmpty: (e3 = true) => r2(`$isEmpty`, e3), isNotEmpty: () => r2(`$ne`, null) };
|
|
903
913
|
}
|
|
904
|
-
function
|
|
905
|
-
return Object.assign((t2) =>
|
|
914
|
+
function cn(e2) {
|
|
915
|
+
return Object.assign((t2) => X(t2, e2), { and: (...e3) => ({ filter: { $and: e3.map((e4) => e4.filter) } }), or: (...e3) => ({ filter: { $or: e3.map((e4) => e4.filter) } }), not: (e3) => ({ filter: { $not: e3.filter } }) });
|
|
906
916
|
}
|
|
907
|
-
function
|
|
908
|
-
return (t2) => ({ asc: () => ({ sort: { fieldName:
|
|
917
|
+
function ln(e2) {
|
|
918
|
+
return (t2) => ({ asc: () => ({ sort: { fieldName: E(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: E(t2, e2), order: `DESC` } }) });
|
|
909
919
|
}
|
|
910
|
-
function
|
|
920
|
+
function un(e2) {
|
|
911
921
|
return () => {
|
|
912
922
|
let t2 = {}, n2 = { withFilter(e3) {
|
|
913
923
|
return t2 = { ...t2, filter: e3.filter }, n2;
|
|
914
924
|
}, withFields(...r2) {
|
|
915
|
-
return t2 = { ...t2, fields: r2.map((t3) =>
|
|
925
|
+
return t2 = { ...t2, fields: r2.map((t3) => E(t3, e2)) }, n2;
|
|
916
926
|
}, withSorting(...e3) {
|
|
917
927
|
return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
|
|
918
928
|
}, withPaging(e3) {
|
|
@@ -923,10 +933,10 @@ function cn(e2) {
|
|
|
923
933
|
return n2;
|
|
924
934
|
};
|
|
925
935
|
}
|
|
926
|
-
function
|
|
927
|
-
return { QueryBuilder:
|
|
936
|
+
function dn(e2) {
|
|
937
|
+
return { QueryBuilder: un(e2), Filter: cn(e2), Sort: ln(e2) };
|
|
928
938
|
}
|
|
929
|
-
function
|
|
939
|
+
function fn(e2) {
|
|
930
940
|
let t2 = {}, n2 = { get search() {
|
|
931
941
|
return t2;
|
|
932
942
|
}, expression(e3) {
|
|
@@ -934,19 +944,19 @@ function un(e2) {
|
|
|
934
944
|
}, mode(e3) {
|
|
935
945
|
return t2 = { ...t2, mode: e3 }, n2;
|
|
936
946
|
}, fields(r2) {
|
|
937
|
-
return t2 = { ...t2, fields: r2.map((t3) =>
|
|
947
|
+
return t2 = { ...t2, fields: r2.map((t3) => E(t3, e2)) }, n2;
|
|
938
948
|
}, fuzzy(e3 = true) {
|
|
939
949
|
return t2 = { ...t2, fuzzy: e3 }, n2;
|
|
940
950
|
} };
|
|
941
951
|
return n2;
|
|
942
952
|
}
|
|
943
|
-
function
|
|
953
|
+
function pn(e2) {
|
|
944
954
|
return (t2) => {
|
|
945
|
-
let n2 =
|
|
955
|
+
let n2 = fn(e2);
|
|
946
956
|
return t2 === void 0 ? n2 : n2.expression(t2);
|
|
947
957
|
};
|
|
948
958
|
}
|
|
949
|
-
function
|
|
959
|
+
function mn(e2) {
|
|
950
960
|
let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
|
|
951
961
|
return t2;
|
|
952
962
|
}, sortBy(e3, r2) {
|
|
@@ -962,7 +972,7 @@ function fn(e2) {
|
|
|
962
972
|
} };
|
|
963
973
|
return n2;
|
|
964
974
|
}
|
|
965
|
-
function
|
|
975
|
+
function hn(e2) {
|
|
966
976
|
let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
|
|
967
977
|
return t2;
|
|
968
978
|
}, withBuckets(...e3) {
|
|
@@ -970,7 +980,7 @@ function pn(e2) {
|
|
|
970
980
|
} };
|
|
971
981
|
return n2;
|
|
972
982
|
}
|
|
973
|
-
function
|
|
983
|
+
function gn(e2) {
|
|
974
984
|
let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
|
|
975
985
|
return t2;
|
|
976
986
|
}, interval(e3) {
|
|
@@ -978,7 +988,7 @@ function mn(e2) {
|
|
|
978
988
|
} };
|
|
979
989
|
return n2;
|
|
980
990
|
}
|
|
981
|
-
function
|
|
991
|
+
function _n(e2) {
|
|
982
992
|
let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
|
|
983
993
|
return t2;
|
|
984
994
|
}, type(e3) {
|
|
@@ -986,7 +996,7 @@ function hn(e2) {
|
|
|
986
996
|
} };
|
|
987
997
|
return n2;
|
|
988
998
|
}
|
|
989
|
-
function
|
|
999
|
+
function vn(e2) {
|
|
990
1000
|
let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
|
|
991
1001
|
return t2;
|
|
992
1002
|
}, addNestedAggregation(e3) {
|
|
@@ -995,30 +1005,30 @@ function gn(e2) {
|
|
|
995
1005
|
} };
|
|
996
1006
|
return n2;
|
|
997
1007
|
}
|
|
998
|
-
function
|
|
1008
|
+
function yn(e2, t2) {
|
|
999
1009
|
let n2 = { name: e2 }, r2 = { get aggregation() {
|
|
1000
1010
|
return n2;
|
|
1001
1011
|
}, ofType(e3) {
|
|
1002
1012
|
return n2 = { ...n2, type: e3 }, r2;
|
|
1003
1013
|
}, onField(e3) {
|
|
1004
|
-
return n2 = { ...n2, fieldPath:
|
|
1014
|
+
return n2 = { ...n2, fieldPath: E(e3, t2) }, r2;
|
|
1005
1015
|
}, asValueAggregation() {
|
|
1006
|
-
return
|
|
1016
|
+
return mn(n2);
|
|
1007
1017
|
}, asRangeAggregation() {
|
|
1008
|
-
return
|
|
1018
|
+
return hn(n2);
|
|
1009
1019
|
}, asDateHistogramAggregation() {
|
|
1010
|
-
return
|
|
1020
|
+
return gn(n2);
|
|
1011
1021
|
}, asScalarAggregation() {
|
|
1012
|
-
return
|
|
1022
|
+
return _n(n2);
|
|
1013
1023
|
}, asNestedAggregation() {
|
|
1014
|
-
return
|
|
1024
|
+
return vn(n2);
|
|
1015
1025
|
} };
|
|
1016
1026
|
return r2;
|
|
1017
1027
|
}
|
|
1018
|
-
function
|
|
1019
|
-
return (t2) =>
|
|
1028
|
+
function bn(e2) {
|
|
1029
|
+
return (t2) => yn(t2, e2);
|
|
1020
1030
|
}
|
|
1021
|
-
function
|
|
1031
|
+
function xn() {
|
|
1022
1032
|
return () => {
|
|
1023
1033
|
let e2 = {}, t2 = { withFilter(n2) {
|
|
1024
1034
|
return e2 = { ...e2, filter: n2.filter }, t2;
|
|
@@ -1038,96 +1048,96 @@ function yn() {
|
|
|
1038
1048
|
return t2;
|
|
1039
1049
|
};
|
|
1040
1050
|
}
|
|
1041
|
-
function
|
|
1042
|
-
return { SearchBuilder:
|
|
1051
|
+
function Sn(e2) {
|
|
1052
|
+
return { SearchBuilder: xn(), Filter: cn(e2), Sort: ln(e2), SearchParams: pn(e2), Aggregation: bn(e2) };
|
|
1043
1053
|
}
|
|
1044
|
-
function
|
|
1054
|
+
function Cn(e2) {
|
|
1045
1055
|
return _t(Object.assign(e2, { domainToMappings: { "*.dev.wix-code.com": [{ srcPath: `/_api/categories`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }], "manage._base_domain_": [{ srcPath: `/_api/categories`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/categories-service`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/categories-service`, destPath: `` }], _: [{ srcPath: `/categories/v1/bulk/categories`, destPath: `/v1/bulk/categories` }, { srcPath: `/categories/v1/categories`, destPath: `/v1/categories` }] } }));
|
|
1046
1056
|
}
|
|
1047
|
-
var
|
|
1048
|
-
function
|
|
1057
|
+
var wn = `@wix/auto_sdk_categories_categories`;
|
|
1058
|
+
function Tn(e2) {
|
|
1049
1059
|
function t2({ host: t3 }) {
|
|
1050
|
-
return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategory`, packageName:
|
|
1060
|
+
return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategory`, packageName: wn, migrationOptions: { optInTransformResponse: true }, url: Cn({ protoPath: `/v1/categories/{categoryId}`, data: e2, host: t3 }), params: gt(e2), transformResponse: (e3) => I(e3, [{ transformFn: A, paths: [{ path: `category.createdDate` }, { path: `category.updatedDate` }, { path: `category.image.urlExpirationDate` }, { path: `category.richContentDescription.metadata.createdTimestamp` }, { path: `category.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: G, paths: [{ path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `category.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `category.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `category.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `category.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `category.richContentDescription.nodes.imageData.image.duration` }, { path: `category.richContentDescription.nodes.imageData.crop.x` }, { path: `category.richContentDescription.nodes.imageData.crop.y` }, { path: `category.richContentDescription.nodes.imageData.crop.width` }, { path: `category.richContentDescription.nodes.imageData.crop.height` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `category.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `category.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `category.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `category.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `category.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `category.richContentDescription.nodes.videoData.video.duration` }, { path: `category.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `category.richContentDescription.nodes.audioData.audio.duration` }, { path: `category.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `category.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `category.richContentDescription.nodes.shapeData.shape.duration` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `category.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `category.richContentDescription.nodes.tocData.fontSize` }, { path: `category.richContentDescription.nodes.tocData.itemSpacing` }, { path: `category.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }]) };
|
|
1051
1061
|
}
|
|
1052
1062
|
return t2;
|
|
1053
1063
|
}
|
|
1054
1064
|
var Z = ((e2) => (e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.RICH_CONTENT_DESCRIPTION = `RICH_CONTENT_DESCRIPTION`, e2))(Z || {});
|
|
1055
|
-
async function
|
|
1056
|
-
let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 =
|
|
1065
|
+
async function En(e2, t2, n2) {
|
|
1066
|
+
let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 = Tn(Ke({ categoryId: e2, treeReference: t2, fields: n2?.fields }, []));
|
|
1057
1067
|
i2?.onSiteCall?.();
|
|
1058
1068
|
try {
|
|
1059
1069
|
let e3 = await r2.request(a2);
|
|
1060
|
-
return i2?.onSuccess?.(e3), k(
|
|
1070
|
+
return i2?.onSuccess?.(e3), k(I(e3.data, [{ transformFn: Y, paths: [{ path: `category.image` }] }]), [`category.richContentDescription`])?.category;
|
|
1061
1071
|
} catch (e3) {
|
|
1062
1072
|
let t3 = st(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]`, treeReference: `$[1]`, fields: `$[2].fields` }, singleArgumentUnchanged: false }, [`categoryId`, `treeReference`, `options`]);
|
|
1063
1073
|
throw i2?.onError?.(e3), t3;
|
|
1064
1074
|
}
|
|
1065
1075
|
}
|
|
1066
|
-
({ ...
|
|
1067
|
-
function
|
|
1068
|
-
return (t2, n2, r2) =>
|
|
1069
|
-
}
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1072
|
-
var
|
|
1073
|
-
var
|
|
1074
|
-
var
|
|
1075
|
-
var
|
|
1076
|
-
var
|
|
1077
|
-
var
|
|
1078
|
-
|
|
1079
|
-
function
|
|
1076
|
+
({ ...dn() }, { ...Sn() });
|
|
1077
|
+
function Dn(e2) {
|
|
1078
|
+
return (t2, n2, r2) => En(t2, n2, r2, { httpClient: e2 });
|
|
1079
|
+
}
|
|
1080
|
+
var On = l(`wix.categories.v1.category_category_moved`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
1081
|
+
var kn = l(`wix.categories.v1.category_created`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: Y, paths: [{ path: `entity.image` }] }, { transformFn: G, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
|
|
1082
|
+
var An = l(`wix.categories.v1.category_deleted`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `undefined.createdDate` }, { path: `undefined.updatedDate` }, { path: `undefined.richContentDescription.metadata.createdTimestamp` }, { path: `undefined.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: Y, paths: [{ path: `undefined.image` }] }, { transformFn: G, paths: [{ path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `undefined.richContentDescription.nodes.imageData.image.duration` }, { path: `undefined.richContentDescription.nodes.imageData.crop.x` }, { path: `undefined.richContentDescription.nodes.imageData.crop.y` }, { path: `undefined.richContentDescription.nodes.imageData.crop.width` }, { path: `undefined.richContentDescription.nodes.imageData.crop.height` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `undefined.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `undefined.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `undefined.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `undefined.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `undefined.richContentDescription.nodes.videoData.video.duration` }, { path: `undefined.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `undefined.richContentDescription.nodes.audioData.audio.duration` }, { path: `undefined.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.shapeData.shape.duration` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `undefined.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `undefined.richContentDescription.nodes.tocData.fontSize` }, { path: `undefined.richContentDescription.nodes.tocData.itemSpacing` }, { path: `undefined.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
|
|
1083
|
+
var jn = l(`wix.categories.v1.category_item_added_to_category`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
1084
|
+
var Mn = l(`wix.categories.v1.category_item_removed_from_category`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
1085
|
+
var Nn = l(`wix.categories.v1.category_items_arranged_in_category`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
1086
|
+
var Pn = l(`wix.categories.v1.category_updated`, true, (e2) => k(I(e2, [{ transformFn: A, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.richContentDescription.metadata.createdTimestamp` }, { path: `modifiedFields.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: Y, paths: [{ path: `entity.image` }, { path: `modifiedFields.image` }] }, { transformFn: G, paths: [{ path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `entity.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `entity.richContentDescription.nodes.imageData.image.duration` }, { path: `entity.richContentDescription.nodes.imageData.crop.x` }, { path: `entity.richContentDescription.nodes.imageData.crop.y` }, { path: `entity.richContentDescription.nodes.imageData.crop.width` }, { path: `entity.richContentDescription.nodes.imageData.crop.height` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `entity.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `entity.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `entity.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `entity.richContentDescription.nodes.videoData.video.duration` }, { path: `entity.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `entity.richContentDescription.nodes.audioData.audio.duration` }, { path: `entity.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.shapeData.shape.duration` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.richContentDescription.nodes.tocData.fontSize` }, { path: `entity.richContentDescription.nodes.tocData.itemSpacing` }, { path: `entity.richContentDescription.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.richContentDescription.nodes.imageData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.x` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.y` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.width` }, { path: `modifiedFields.richContentDescription.nodes.imageData.crop.height` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.richContentDescription.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.video.duration` }, { path: `modifiedFields.richContentDescription.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.audio.duration` }, { path: `modifiedFields.richContentDescription.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.shapeData.shape.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.richContentDescription.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.richContentDescription.nodes.tocData.fontSize` }, { path: `modifiedFields.richContentDescription.nodes.tocData.itemSpacing` }, { path: `modifiedFields.richContentDescription.nodes.smartBlockCellData.shape.duration` }] }])))();
|
|
1087
|
+
var Fn = ht(Dn);
|
|
1088
|
+
W(On), W(kn), W(An), W(jn), W(Mn), W(Nn), W(Pn);
|
|
1089
|
+
function In(e2) {
|
|
1080
1090
|
if (!e2) return null;
|
|
1081
1091
|
let t2 = e2.match(/image:\/\/v1\/([^/#]+)/);
|
|
1082
1092
|
return t2?.[1] ? t2[1] : e2.match(/\/media\/([^/]+)/)?.[1] ?? null;
|
|
1083
1093
|
}
|
|
1084
|
-
function
|
|
1094
|
+
function Ln(e2) {
|
|
1085
1095
|
if (!e2) return null;
|
|
1086
1096
|
let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
|
|
1087
1097
|
return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
|
|
1088
1098
|
}
|
|
1089
|
-
var
|
|
1090
|
-
var
|
|
1091
|
-
var
|
|
1099
|
+
var Rn = (e2) => `/category/${e2}`;
|
|
1100
|
+
var zn = (e2) => ({ ...e2, nodes: e2.nodes ?? [] });
|
|
1101
|
+
var Bn = (e2) => {
|
|
1092
1102
|
if (!e2) return;
|
|
1093
|
-
let t2 =
|
|
1094
|
-
return { uri:
|
|
1103
|
+
let t2 = Ln(e2);
|
|
1104
|
+
return { uri: In(e2) ?? void 0, url: e2, width: t2?.width, height: t2?.height };
|
|
1095
1105
|
};
|
|
1096
|
-
var
|
|
1106
|
+
var Vn = (e2) => e2.filter((e3) => e3.categoryId).map((e3) => {
|
|
1097
1107
|
let t2 = e3.categorySlug ?? ``;
|
|
1098
|
-
return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href:
|
|
1108
|
+
return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href: Rn(t2) };
|
|
1099
1109
|
});
|
|
1100
|
-
var
|
|
1101
|
-
var
|
|
1110
|
+
var Hn = (e2) => ({ type: e2.type, props: e2.props ?? void 0, meta: e2.meta ?? void 0, children: e2.children, custom: e2.custom, disabled: e2.disabled });
|
|
1111
|
+
var Un = (e2) => {
|
|
1102
1112
|
if (e2) return { preventAutoRedirect: e2.preventAutoRedirect, keywords: e2.keywords?.map((e3) => ({ term: e3.term, isMain: e3.isMain, origin: e3.origin ?? void 0 })) };
|
|
1103
1113
|
};
|
|
1104
|
-
var
|
|
1105
|
-
if (e2) return { tags: e2.tags?.map(
|
|
1114
|
+
var Wn = (e2) => {
|
|
1115
|
+
if (e2) return { tags: e2.tags?.map(Hn), settings: Un(e2.settings) };
|
|
1106
1116
|
};
|
|
1107
|
-
function
|
|
1108
|
-
return { id: e2._id ?? ``, name: e2.name ?? ``, slug: e2.slug ?? ``, description: e2.description ?? void 0, itemCounter: e2.itemCounter, parentCategoryId: e2.parentCategory?._id ?? void 0, seoData:
|
|
1117
|
+
function Gn(e2) {
|
|
1118
|
+
return { id: e2._id ?? ``, name: e2.name ?? ``, slug: e2.slug ?? ``, description: e2.description ?? void 0, itemCounter: e2.itemCounter, parentCategoryId: e2.parentCategory?._id ?? void 0, seoData: Wn(e2.seoData), richContentDescription: e2.richContentDescription ? zn(e2.richContentDescription) : void 0, image: Bn(e2.image), breadcrumbs: Vn(e2.breadcrumbsInfo?.breadcrumbs ?? []) };
|
|
1109
1119
|
}
|
|
1110
|
-
var
|
|
1111
|
-
var
|
|
1112
|
-
var
|
|
1120
|
+
var Kn = { appNamespace: `@wix/stores`, treeKey: null };
|
|
1121
|
+
var qn = [Z.BREADCRUMBS_INFO, Z.DESCRIPTION, Z.RICH_CONTENT_DESCRIPTION];
|
|
1122
|
+
var Jn = (e2, t2) => {
|
|
1113
1123
|
if (!e2?._id || e2.visible === false) throw Error(t2);
|
|
1114
|
-
return
|
|
1124
|
+
return Gn(e2);
|
|
1115
1125
|
};
|
|
1116
|
-
async function
|
|
1117
|
-
return
|
|
1126
|
+
async function Yn(e2) {
|
|
1127
|
+
return Jn(await Fn(e2, Kn, { fields: qn }), `Category not found for id: ${e2}`);
|
|
1118
1128
|
}
|
|
1119
|
-
var
|
|
1120
|
-
function
|
|
1121
|
-
return
|
|
1129
|
+
var Xn = `wixstores-storefront-builder:category-info-context-data`;
|
|
1130
|
+
function Zn(e2) {
|
|
1131
|
+
return sn(`${Xn}:${e2}`, () => Yn(e2));
|
|
1122
1132
|
}
|
|
1123
|
-
var
|
|
1133
|
+
var Qn = J(`@wix/site-service-url`);
|
|
1124
1134
|
var Q = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
|
|
1125
1135
|
`${Q}`, `${Q}`;
|
|
1126
|
-
var
|
|
1136
|
+
var $n = function(e2) {
|
|
1127
1137
|
return e2.SIDE_CART = `ecom_side_cart`, e2.CART = `shopping_cart`, e2.CHECKOUT = `checkout`, e2.PRODUCT_PAGE = `product-page-builder`, e2.CATEGORY_PAGE = `category-page-builder`, e2;
|
|
1128
1138
|
}({});
|
|
1129
|
-
var
|
|
1130
|
-
let e2 =
|
|
1139
|
+
var er = () => {
|
|
1140
|
+
let e2 = o(Qn), t2 = n((t3, n2) => {
|
|
1131
1141
|
let r2 = e2.appSectionRelativeUrl(Q, t3, true);
|
|
1132
1142
|
if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n2)}`;
|
|
1133
1143
|
}, [e2]);
|
|
@@ -1136,37 +1146,37 @@ var Qn = () => {
|
|
|
1136
1146
|
if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
|
|
1137
1147
|
}, [t2, e2]) };
|
|
1138
1148
|
};
|
|
1139
|
-
function
|
|
1140
|
-
let { getPageAbsoluteUrl: t2 } =
|
|
1149
|
+
function tr(e2) {
|
|
1150
|
+
let { getPageAbsoluteUrl: t2 } = er(), n2 = i(() => {
|
|
1141
1151
|
if (!e2.slug) return;
|
|
1142
|
-
let n3 = t2(
|
|
1152
|
+
let n3 = t2($n.CATEGORY_PAGE, e2.slug);
|
|
1143
1153
|
return n3 ? { href: n3 } : void 0;
|
|
1144
1154
|
}, [e2.slug, t2]);
|
|
1145
1155
|
return i(() => ({ id: e2.id, name: e2.name, slug: e2.slug, link: n2, description: e2.description, richContentDescription: e2.richContentDescription, image: e2.image, breadcrumbs: e2.breadcrumbs }), [e2, n2]);
|
|
1146
1156
|
}
|
|
1147
1157
|
var $ = t(null);
|
|
1148
1158
|
$.displayName = `CategoryInfoContext`;
|
|
1149
|
-
function
|
|
1159
|
+
function nr() {
|
|
1150
1160
|
let e2 = r($);
|
|
1151
1161
|
if (!e2) throw Error(`useCategoryInfoContext must be used within a category info context provider`);
|
|
1152
1162
|
return e2;
|
|
1153
1163
|
}
|
|
1154
|
-
function
|
|
1155
|
-
let n2 =
|
|
1156
|
-
return
|
|
1164
|
+
function rr({ categoryPromise: e2, children: t2 }) {
|
|
1165
|
+
let n2 = tr(en(e2));
|
|
1166
|
+
return s($.Provider, { value: n2, children: t2 });
|
|
1157
1167
|
}
|
|
1158
|
-
function
|
|
1159
|
-
let r2 =
|
|
1160
|
-
return
|
|
1168
|
+
function ir({ categoryId: t2, children: n2 }) {
|
|
1169
|
+
let r2 = Zn(t2);
|
|
1170
|
+
return s(e, { fallback: null, children: s(rr, { categoryPromise: r2, children: n2 }) });
|
|
1161
1171
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return t2 === void 0 ? n2 ?
|
|
1172
|
+
function ar({ children: e2, value: t2, categoryId: n2 }) {
|
|
1173
|
+
return t2 === void 0 ? n2 ? s(ir, { categoryId: n2, children: e2 }, n2) : null : s($.Provider, { value: t2, children: e2 });
|
|
1164
1174
|
}
|
|
1165
|
-
var
|
|
1175
|
+
var or = $t(`0d8869b2-7691-4ee2-9d0b-90d72f34edd0`);
|
|
1166
1176
|
export {
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1177
|
+
ar as CategoryInfoContextProvider,
|
|
1178
|
+
ar as default,
|
|
1179
|
+
or as injectAccessTokenGetter,
|
|
1180
|
+
nr as useCategoryInfoContext
|
|
1171
1181
|
};
|
|
1172
1182
|
//# sourceMappingURL=context-category-info.mjs.map
|