@wix/stores 1.0.958 → 1.0.960
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-context-provider/runtime.d.ts +4026 -0
- package/_sdk-exports/context-category-by-id-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-category-by-slug-context-provider/runtime.d.ts +4046 -0
- package/_sdk-exports/context-category-by-slug-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-category-info-context-provider/runtime.d.ts +3530 -0
- package/_sdk-exports/context-category-info-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-category-list-context-provider/runtime.d.ts +101 -0
- package/_sdk-exports/context-category-list-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-product-by-id-context-provider/runtime.d.ts +4221 -0
- package/_sdk-exports/context-product-by-id-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-product-by-slug-context-provider/runtime.d.ts +4217 -0
- package/_sdk-exports/context-product-by-slug-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-product-context-provider/runtime.d.ts +4449 -0
- package/_sdk-exports/context-product-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-product-item-context-provider/runtime.d.ts +4102 -0
- package/_sdk-exports/context-product-item-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-product-list-context-provider/runtime.d.ts +3969 -0
- package/_sdk-exports/context-product-list-context-provider/runtime.js +2 -0
- package/_sdk-exports/context-promotion-item-context-provider/runtime.d.ts +85 -0
- package/_sdk-exports/context-promotion-item-context-provider/runtime.js +2 -0
- package/build/cjs/context-category-by-id-context-provider.d.ts +4026 -0
- package/build/cjs/context-category-by-id-context-provider.js +3572 -0
- package/build/cjs/context-category-by-id-context-provider.js.map +1 -0
- package/build/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
- package/build/cjs/context-category-by-slug-context-provider.js +3674 -0
- package/build/cjs/context-category-by-slug-context-provider.js.map +1 -0
- package/build/cjs/context-category-info-context-provider.d.ts +3530 -0
- package/build/cjs/context-category-info-context-provider.js +1201 -0
- package/build/cjs/context-category-info-context-provider.js.map +1 -0
- package/build/cjs/context-category-list-context-provider.d.ts +101 -0
- package/build/cjs/context-category-list-context-provider.js +587 -0
- package/build/cjs/context-category-list-context-provider.js.map +1 -0
- package/build/cjs/context-product-by-id-context-provider.d.ts +4221 -0
- package/build/cjs/context-product-by-id-context-provider.js +3454 -0
- package/build/cjs/context-product-by-id-context-provider.js.map +1 -0
- package/build/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
- package/build/cjs/context-product-by-slug-context-provider.js +3477 -0
- package/build/cjs/context-product-by-slug-context-provider.js.map +1 -0
- package/build/cjs/context-product-context-provider.d.ts +4449 -0
- package/build/cjs/context-product-context-provider.js +587 -0
- package/build/cjs/context-product-context-provider.js.map +1 -0
- package/build/cjs/context-product-item-context-provider.d.ts +4102 -0
- package/build/cjs/context-product-item-context-provider.js +4396 -0
- package/build/cjs/context-product-item-context-provider.js.map +1 -0
- package/build/cjs/context-product-list-context-provider.d.ts +3970 -0
- package/build/cjs/context-product-list-context-provider.js +587 -0
- package/build/cjs/context-product-list-context-provider.js.map +1 -0
- package/build/cjs/context-promotion-item-context-provider.d.ts +85 -0
- package/build/cjs/context-promotion-item-context-provider.js +592 -0
- package/build/cjs/context-promotion-item-context-provider.js.map +1 -0
- package/build/es/context-category-by-id-context-provider.d.mts +4026 -0
- package/build/es/context-category-by-id-context-provider.mjs +3532 -0
- package/build/es/context-category-by-id-context-provider.mjs.map +1 -0
- package/build/es/context-category-by-slug-context-provider.d.mts +4046 -0
- package/build/es/context-category-by-slug-context-provider.mjs +3634 -0
- package/build/es/context-category-by-slug-context-provider.mjs.map +1 -0
- package/build/es/context-category-info-context-provider.d.mts +3530 -0
- package/build/es/context-category-info-context-provider.mjs +1172 -0
- package/build/es/context-category-info-context-provider.mjs.map +1 -0
- package/build/es/context-category-list-context-provider.d.mts +101 -0
- package/build/es/context-category-list-context-provider.mjs +558 -0
- package/build/es/context-category-list-context-provider.mjs.map +1 -0
- package/build/es/context-product-by-id-context-provider.d.mts +4221 -0
- package/build/es/context-product-by-id-context-provider.mjs +3415 -0
- package/build/es/context-product-by-id-context-provider.mjs.map +1 -0
- package/build/es/context-product-by-slug-context-provider.d.mts +4217 -0
- package/build/es/context-product-by-slug-context-provider.mjs +3437 -0
- package/build/es/context-product-by-slug-context-provider.mjs.map +1 -0
- package/build/es/context-product-context-provider.d.mts +4449 -0
- package/build/es/context-product-context-provider.mjs +558 -0
- package/build/es/context-product-context-provider.mjs.map +1 -0
- package/build/es/context-product-item-context-provider.d.mts +4102 -0
- package/build/es/context-product-item-context-provider.mjs +4356 -0
- package/build/es/context-product-item-context-provider.mjs.map +1 -0
- package/build/es/context-product-list-context-provider.d.mts +3970 -0
- package/build/es/context-product-list-context-provider.mjs +558 -0
- package/build/es/context-product-list-context-provider.mjs.map +1 -0
- package/build/es/context-promotion-item-context-provider.d.mts +85 -0
- package/build/es/context-promotion-item-context-provider.mjs +563 -0
- package/build/es/context-promotion-item-context-provider.mjs.map +1 -0
- package/build/internal/cjs/context-category-by-id-context-provider.d.ts +4026 -0
- package/build/internal/cjs/context-category-by-slug-context-provider.d.ts +4046 -0
- package/build/internal/cjs/context-category-info-context-provider.d.ts +3530 -0
- package/build/internal/cjs/context-category-list-context-provider.d.ts +101 -0
- package/build/internal/cjs/context-product-by-id-context-provider.d.ts +4221 -0
- package/build/internal/cjs/context-product-by-slug-context-provider.d.ts +4217 -0
- package/build/internal/cjs/context-product-context-provider.d.ts +4449 -0
- package/build/internal/cjs/context-product-item-context-provider.d.ts +4102 -0
- package/build/internal/cjs/context-product-list-context-provider.d.ts +3970 -0
- package/build/internal/cjs/context-promotion-item-context-provider.d.ts +85 -0
- package/build/internal/es/context-category-by-id-context-provider.d.mts +4026 -0
- package/build/internal/es/context-category-by-slug-context-provider.d.mts +4046 -0
- package/build/internal/es/context-category-info-context-provider.d.mts +3530 -0
- package/build/internal/es/context-category-list-context-provider.d.mts +101 -0
- package/build/internal/es/context-product-by-id-context-provider.d.mts +4221 -0
- package/build/internal/es/context-product-by-slug-context-provider.d.mts +4217 -0
- package/build/internal/es/context-product-context-provider.d.mts +4449 -0
- package/build/internal/es/context-product-item-context-provider.d.mts +4102 -0
- package/build/internal/es/context-product-list-context-provider.d.mts +3970 -0
- package/build/internal/es/context-promotion-item-context-provider.d.mts +85 -0
- package/category-by-id-context-provider/package.json +3 -0
- package/category-by-slug-context-provider/package.json +3 -0
- package/category-info-context-provider/package.json +3 -0
- package/category-list-context-provider/package.json +3 -0
- package/context/category-by-id-context-provider/package.json +3 -0
- package/context/category-by-slug-context-provider/package.json +3 -0
- package/context/category-info-context-provider/package.json +3 -0
- package/context/category-list-context-provider/package.json +3 -0
- package/context/product-by-id-context-provider/package.json +3 -0
- package/context/product-by-slug-context-provider/package.json +3 -0
- package/context/product-context-provider/package.json +3 -0
- package/context/product-item-context-provider/package.json +3 -0
- package/context/product-list-context-provider/package.json +3 -0
- package/context/promotion-item-context-provider/package.json +3 -0
- package/package.json +159 -24
- package/product-by-id-context-provider/package.json +3 -0
- package/product-by-slug-context-provider/package.json +3 -0
- package/product-context-provider/package.json +3 -0
- package/product-item-context-provider/package.json +3 -0
- package/product-list-context-provider/package.json +3 -0
- package/promotion-item-context-provider/package.json +3 -0
|
@@ -0,0 +1,3532 @@
|
|
|
1
|
+
// _sdk-exports/context-category-by-id-context-provider/runtime.js
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { Suspense as t, useCallback as n, useMemo as r, useState as i, useSyncExternalStore as a } from "react";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
import s from "@wix/stores/product-list-context-provider";
|
|
6
|
+
import c from "@wix/stores/category-info-context-provider";
|
|
7
|
+
import { useGetService as l, useService as u } from "@wix/services-manager-react";
|
|
8
|
+
var d = Object.create;
|
|
9
|
+
var f = Object.defineProperty;
|
|
10
|
+
var p = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var m = Object.getOwnPropertyNames;
|
|
12
|
+
var ee = Object.getPrototypeOf;
|
|
13
|
+
var h = Object.prototype.hasOwnProperty;
|
|
14
|
+
var g = (e2, t2) => () => (t2 || (e2((t2 = { exports: {} }).exports, t2), e2 = null), t2.exports);
|
|
15
|
+
var te = (e2, t2, n2, r2) => {
|
|
16
|
+
if (t2 && typeof t2 == `object` || typeof t2 == `function`) for (var i2 = m(t2), a2 = 0, o2 = i2.length, s2; a2 < o2; a2++) s2 = i2[a2], !h.call(e2, s2) && s2 !== n2 && f(e2, s2, { get: ((e3) => t2[e3]).bind(null, s2), enumerable: !(r2 = p(t2, s2)) || r2.enumerable });
|
|
17
|
+
return e2;
|
|
18
|
+
};
|
|
19
|
+
var ne = (e2, t2, n2) => (n2 = e2 == null ? {} : d(ee(e2)), te(t2 || !e2 || !e2.__esModule || !h.call(e2, `default`) ? f(n2, `default`, { value: e2, enumerable: true }) : n2, e2));
|
|
20
|
+
var _ = {};
|
|
21
|
+
function v(e2, t2 = false, n2 = (e3) => e3) {
|
|
22
|
+
return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
|
|
23
|
+
}
|
|
24
|
+
var re = (e2) => {
|
|
25
|
+
switch (e2) {
|
|
26
|
+
case `get`:
|
|
27
|
+
case `GET`:
|
|
28
|
+
return `GET`;
|
|
29
|
+
case `post`:
|
|
30
|
+
case `POST`:
|
|
31
|
+
return `POST`;
|
|
32
|
+
case `put`:
|
|
33
|
+
case `PUT`:
|
|
34
|
+
return `PUT`;
|
|
35
|
+
case `delete`:
|
|
36
|
+
case `DELETE`:
|
|
37
|
+
return `DELETE`;
|
|
38
|
+
case `patch`:
|
|
39
|
+
case `PATCH`:
|
|
40
|
+
return `PATCH`;
|
|
41
|
+
case `head`:
|
|
42
|
+
case `HEAD`:
|
|
43
|
+
return `HEAD`;
|
|
44
|
+
case `options`:
|
|
45
|
+
case `OPTIONS`:
|
|
46
|
+
return `OPTIONS`;
|
|
47
|
+
default:
|
|
48
|
+
throw Error(`Unknown method: ${e2}`);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var ie = (e2) => (t2) => async (n2) => {
|
|
52
|
+
let r2, i2 = (t3) => {
|
|
53
|
+
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.`);
|
|
54
|
+
let { method: i3, url: a2, params: o2 } = r2;
|
|
55
|
+
return { ...r2, method: re(i3), url: a2, data: r2.data, params: o2 };
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
let e3 = await t2.request(i2);
|
|
59
|
+
if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
|
|
60
|
+
let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
|
|
61
|
+
return n3.forEach((t3) => {
|
|
62
|
+
t3 && (a2 = t3(e3.data, e3.headers));
|
|
63
|
+
}), a2;
|
|
64
|
+
} catch (e3) {
|
|
65
|
+
throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var ae = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
|
|
69
|
+
var oe = `__metadata`;
|
|
70
|
+
var se = `edge.wixapis.com`;
|
|
71
|
+
var ce = class extends Error {
|
|
72
|
+
message;
|
|
73
|
+
response;
|
|
74
|
+
constructor(e2, t2) {
|
|
75
|
+
super(e2), this.message = e2, this.response = t2;
|
|
76
|
+
}
|
|
77
|
+
async details() {
|
|
78
|
+
let e2 = await this.response.json();
|
|
79
|
+
return le(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var le = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
|
|
83
|
+
var ue = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
|
|
84
|
+
var de = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
|
|
85
|
+
var fe = (e2) => e2.__type === `host`;
|
|
86
|
+
function pe(e2, t2) {
|
|
87
|
+
return e2.create(t2);
|
|
88
|
+
}
|
|
89
|
+
var me = `x-wix-bi-gateway`;
|
|
90
|
+
function he(e2, t2, n2) {
|
|
91
|
+
return { [me]: ge({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
|
|
92
|
+
}
|
|
93
|
+
function ge(e2) {
|
|
94
|
+
return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
|
|
95
|
+
}
|
|
96
|
+
function _e(e2) {
|
|
97
|
+
let t2 = globalThis.__wix_context__, n2 = { client: _.client, elevatedClient: _.elevatedClient }, r2;
|
|
98
|
+
globalThis.__wix_context__ = void 0, _.client = void 0, _.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
99
|
+
try {
|
|
100
|
+
return e2();
|
|
101
|
+
} finally {
|
|
102
|
+
globalThis.__wix_context__ = t2, _.client = n2.client, _.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
var ve = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
106
|
+
function ye(e2) {
|
|
107
|
+
return we(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
108
|
+
}
|
|
109
|
+
var be = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
110
|
+
var xe = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
111
|
+
var Se = `$1\0$2`;
|
|
112
|
+
var Ce = /[^\p{L}\d]+/giu;
|
|
113
|
+
function we(e2) {
|
|
114
|
+
let t2 = e2.trim();
|
|
115
|
+
t2 = t2.replace(be, Se).replace(xe, Se), t2 = t2.replace(Ce, `\0`);
|
|
116
|
+
let n2 = 0, r2 = t2.length;
|
|
117
|
+
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
118
|
+
if (n2 === r2) return [];
|
|
119
|
+
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
120
|
+
return t2.slice(n2, r2).split(/\0/g);
|
|
121
|
+
}
|
|
122
|
+
var Te = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
123
|
+
var Ee = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
124
|
+
var De = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
125
|
+
function Oe(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
126
|
+
if (typeof e2 != `object` || !e2) throw e2;
|
|
127
|
+
if (Te(e2)) return ke(e2, t2, n2);
|
|
128
|
+
if (Ee(e2)) return je(e2);
|
|
129
|
+
if (De(e2)) {
|
|
130
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: ye(n3), data: {} }, requestId: e2.requestId };
|
|
131
|
+
return Ae(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
132
|
+
}
|
|
133
|
+
return Me(e2);
|
|
134
|
+
}
|
|
135
|
+
var ke = (e2, t2, n2) => {
|
|
136
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Ne(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 };
|
|
137
|
+
return Ae(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
138
|
+
};
|
|
139
|
+
var Ae = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
140
|
+
var je = (e2) => {
|
|
141
|
+
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 ?? ye(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 };
|
|
142
|
+
return Ae(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
143
|
+
};
|
|
144
|
+
var Me = (e2) => Ae(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: ye(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
145
|
+
var Ne = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
146
|
+
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
147
|
+
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
148
|
+
let r3 = t2[e3.field];
|
|
149
|
+
if (r3) return { ...e3, field: Pe(r3, i2) };
|
|
150
|
+
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
151
|
+
if (s2) {
|
|
152
|
+
let t3 = a2[s2];
|
|
153
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, Pe(t3, i2)) };
|
|
154
|
+
}
|
|
155
|
+
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
var Pe = (e2, t2) => {
|
|
159
|
+
let n2 = Fe(e2);
|
|
160
|
+
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
161
|
+
};
|
|
162
|
+
var Fe = (e2) => {
|
|
163
|
+
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
164
|
+
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
165
|
+
};
|
|
166
|
+
function Ie(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
|
|
167
|
+
return _e(() => e2({ request: async (e3) => {
|
|
168
|
+
let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
|
|
169
|
+
a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
|
|
170
|
+
let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? se : o3}${a3.url}`;
|
|
171
|
+
a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
|
|
172
|
+
try {
|
|
173
|
+
let e4 = he(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
|
|
174
|
+
if (s3.status !== 200) {
|
|
175
|
+
let e5 = null;
|
|
176
|
+
try {
|
|
177
|
+
e5 = await s3.json();
|
|
178
|
+
} catch {
|
|
179
|
+
}
|
|
180
|
+
let t3 = Re(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = Oe(t3);
|
|
181
|
+
throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
|
|
182
|
+
}
|
|
183
|
+
let l3 = await s3.json();
|
|
184
|
+
return { data: a3.migrationOptions?.optInTransformResponse && a3.transformResponse ? Array.isArray(a3.transformResponse) ? a3.transformResponse[0](l3) : a3.transformResponse(l3) : l3, headers: s3.headers, status: s3.status, statusText: s3.statusText };
|
|
185
|
+
} catch (e4) {
|
|
186
|
+
throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
|
|
187
|
+
}
|
|
188
|
+
}, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
|
|
189
|
+
}
|
|
190
|
+
var Le = class extends Error {
|
|
191
|
+
response;
|
|
192
|
+
requestId;
|
|
193
|
+
constructor(e2) {
|
|
194
|
+
super(), this.response = e2.response, this.requestId = e2.requestId;
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
var Re = (e2, t2, n2, r2) => new Le({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
|
|
198
|
+
var ze = `.`;
|
|
199
|
+
function Be(e2, t2, n2) {
|
|
200
|
+
if (e2 == null) throw Error(`Cannot set value on null or undefined`);
|
|
201
|
+
let r2 = Ve(t2), i2 = e2;
|
|
202
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
203
|
+
let t3 = r2[e3];
|
|
204
|
+
if (e3 === r2.length - 1) {
|
|
205
|
+
i2[t3] = n2;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
let a2 = r2[e3 + 1];
|
|
209
|
+
(!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
|
|
210
|
+
}
|
|
211
|
+
return e2;
|
|
212
|
+
}
|
|
213
|
+
function Ve(e2) {
|
|
214
|
+
return Array.isArray(e2) ? e2 : e2.split(ze).map((e3) => He(e3) ? Number(e3) : e3);
|
|
215
|
+
}
|
|
216
|
+
function He(e2) {
|
|
217
|
+
return /^\d+$/.test(e2);
|
|
218
|
+
}
|
|
219
|
+
function Ue(e2) {
|
|
220
|
+
let t2 = {};
|
|
221
|
+
for (let [n2, r2] of Object.entries(e2)) We(n2) || Be(t2, Ve(n2), r2);
|
|
222
|
+
return t2;
|
|
223
|
+
}
|
|
224
|
+
function We(e2) {
|
|
225
|
+
return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
|
|
226
|
+
}
|
|
227
|
+
var Ge = class {
|
|
228
|
+
BRACKET_PATTERN = /\[(\d+)\]/g;
|
|
229
|
+
NUMERIC_PATTERN = /^\d+$/;
|
|
230
|
+
ESCAPED_DOT_PATTERN = /\\\./g;
|
|
231
|
+
ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
|
|
232
|
+
ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
|
|
233
|
+
SPLIT_PATTERN = /\.|\[(\d+)\]/g;
|
|
234
|
+
DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
|
|
235
|
+
ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
|
|
236
|
+
ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
|
|
237
|
+
ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
|
|
238
|
+
modifiedFields;
|
|
239
|
+
cleanedModifiedFields;
|
|
240
|
+
constructor(e2) {
|
|
241
|
+
this.modifiedFields = e2;
|
|
242
|
+
}
|
|
243
|
+
replaceEscapedCharacters(e2) {
|
|
244
|
+
return e2.replace(this.ESCAPED_DOT_PATTERN, this.ESCAPED_DOT_PLACEHOLDER).replace(this.ESCAPED_LEFT_BRACKET_PATTERN, this.ESCAPED_LEFT_BRACKET_PLACEHOLDER).replace(this.ESCAPED_RIGHT_BRACKET_PATTERN, this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER);
|
|
245
|
+
}
|
|
246
|
+
restoreEscapedCharacters(e2) {
|
|
247
|
+
return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
|
|
248
|
+
}
|
|
249
|
+
unflatten() {
|
|
250
|
+
return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), Ue(this.cleanedModifiedFields);
|
|
251
|
+
}
|
|
252
|
+
flatten(e2) {
|
|
253
|
+
let t2 = {};
|
|
254
|
+
for (let n2 of Object.keys(this.cleanedModifiedFields)) {
|
|
255
|
+
let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
|
|
256
|
+
t2 = { ...t2, ...i2 };
|
|
257
|
+
}
|
|
258
|
+
return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
|
|
259
|
+
}
|
|
260
|
+
splitPath(e2) {
|
|
261
|
+
let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
|
|
262
|
+
for (let i2 of r2) i2.index > n2 && t2.push(e2.substring(n2, i2.index)), i2[1] && t2.push(i2[1]), n2 = i2.index + i2[0].length;
|
|
263
|
+
return n2 < e2.length && t2.push(e2.substring(n2)), t2;
|
|
264
|
+
}
|
|
265
|
+
navigatePath(e2, t2) {
|
|
266
|
+
let n2 = e2, r2 = [], i2 = (e3) => {
|
|
267
|
+
if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
|
|
268
|
+
r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
|
|
269
|
+
}, a2 = (e3, t3) => {
|
|
270
|
+
let i3 = e3 in ve ? ve[e3] : void 0;
|
|
271
|
+
if (i3 && i3 in t3) {
|
|
272
|
+
r2.push(i3), n2 = t3[i3];
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
let a3 = Ye(e3);
|
|
276
|
+
if (a3 && a3 in t3) {
|
|
277
|
+
r2.push(a3), n2 = t3[a3];
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
|
|
281
|
+
}, o2 = (e3, t3) => {
|
|
282
|
+
r2.push(e3), n2 = t3[e3];
|
|
283
|
+
};
|
|
284
|
+
for (let e3 of t2) {
|
|
285
|
+
if (this.NUMERIC_PATTERN.test(e3)) {
|
|
286
|
+
i2(e3);
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
|
|
290
|
+
let t3 = n2;
|
|
291
|
+
if (e3 in n2) {
|
|
292
|
+
o2(e3, t3);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
a2(e3, t3);
|
|
296
|
+
}
|
|
297
|
+
return { [this.buildPathString(r2)]: n2 };
|
|
298
|
+
}
|
|
299
|
+
buildPathString(e2) {
|
|
300
|
+
return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
|
|
301
|
+
}
|
|
302
|
+
bracketToDotNotation(e2) {
|
|
303
|
+
return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
function Ke(e2, t2) {
|
|
307
|
+
let n2 = e2?.modifiedFields;
|
|
308
|
+
if (!n2) return null;
|
|
309
|
+
let r2 = qe(n2);
|
|
310
|
+
if (!r2) return null;
|
|
311
|
+
let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
|
|
312
|
+
e2 = { ...e2, modifiedFields: i2 };
|
|
313
|
+
let o2 = t2(e2), s2 = o2?.modifiedFields;
|
|
314
|
+
if (!s2) return null;
|
|
315
|
+
let c2 = Je(s2, a2);
|
|
316
|
+
return c2 === null ? null : (o2.modifiedFields = c2, o2);
|
|
317
|
+
}
|
|
318
|
+
function qe(e2) {
|
|
319
|
+
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
320
|
+
let t2 = new Ge(e2);
|
|
321
|
+
return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
|
|
322
|
+
} catch {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
function Je(e2, t2) {
|
|
328
|
+
if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
|
|
329
|
+
return t2.flatten(e2);
|
|
330
|
+
} catch {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
function Ye(e2) {
|
|
336
|
+
return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
|
|
337
|
+
}
|
|
338
|
+
function Xe() {
|
|
339
|
+
return { emit(e2, ...t2) {
|
|
340
|
+
for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
|
|
341
|
+
}, events: {}, on(e2, t2) {
|
|
342
|
+
return (this.events[e2] ||= []).push(t2), () => {
|
|
343
|
+
this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
|
|
344
|
+
};
|
|
345
|
+
} };
|
|
346
|
+
}
|
|
347
|
+
var Ze = (e2) => e2.__type === `event-definition`;
|
|
348
|
+
function Qe(e2, t2, n2, r2) {
|
|
349
|
+
let i2;
|
|
350
|
+
if (e2.isDomainEvent) {
|
|
351
|
+
let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
|
|
352
|
+
i2 = e3 ? e3?.deletedEntity ? { entity: e3?.deletedEntity, metadata: c2 } : { metadata: c2 } : t3 ? { data: t3.body, metadata: c2 } : o3 ? { entity: o3.currentEntity, metadata: c2, ...o3.modifiedFields ? { modifiedFields: o3.modifiedFields } : {} } : { entity: a3?.entity, metadata: c2 };
|
|
353
|
+
} else i2 = { data: n2, metadata: r2 };
|
|
354
|
+
let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
|
|
355
|
+
if (s2.modifiedFields) {
|
|
356
|
+
let e3 = s2.modifiedFields;
|
|
357
|
+
if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
|
|
358
|
+
o2 = structuredClone(i2);
|
|
359
|
+
let e4 = Ke(s2, a2);
|
|
360
|
+
if (e4) return t2(e4);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return t2(a2(o2));
|
|
364
|
+
}
|
|
365
|
+
function $e(e2) {
|
|
366
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Xe();
|
|
367
|
+
return { initModule(e3) {
|
|
368
|
+
return (r2) => {
|
|
369
|
+
let i2 = t2.get(e3.type) ?? [];
|
|
370
|
+
i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
|
|
371
|
+
};
|
|
372
|
+
}, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
|
|
373
|
+
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 }))];
|
|
374
|
+
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(`, `)}`);
|
|
375
|
+
let l2 = t2.get(r2) ?? [];
|
|
376
|
+
return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Qe(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
|
|
377
|
+
}, async processRequest(e3, t3) {
|
|
378
|
+
let n3 = await e3.text();
|
|
379
|
+
return this.process(n3, t3);
|
|
380
|
+
}, async parseJWT(t3) {
|
|
381
|
+
let n3 = e2();
|
|
382
|
+
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
383
|
+
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
|
|
384
|
+
if (!i2) throw Error(`JWT is not valid`);
|
|
385
|
+
if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
|
|
386
|
+
let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
|
|
387
|
+
return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
|
|
388
|
+
}, async parseRequest(e3) {
|
|
389
|
+
let t3 = await e3.text();
|
|
390
|
+
return this.parseJWT(t3);
|
|
391
|
+
}, async executeHandlers(e3) {
|
|
392
|
+
let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
|
|
393
|
+
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(`, `)}`);
|
|
394
|
+
let r2 = t2.get(e3.eventType) ?? [];
|
|
395
|
+
await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Qe(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
|
|
396
|
+
}, apps: { AppInstalled: v(`AppInstalled`)(), AppRemoved: v(`AppRemoved`)() } } };
|
|
397
|
+
}
|
|
398
|
+
var et = (e2) => e2.__type === `service-plugin-definition`;
|
|
399
|
+
function tt(e2) {
|
|
400
|
+
let t2 = /* @__PURE__ */ new Map(), n2 = Xe();
|
|
401
|
+
return { initModule(e3) {
|
|
402
|
+
return (r2) => {
|
|
403
|
+
let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
|
|
404
|
+
i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
|
|
405
|
+
};
|
|
406
|
+
}, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
|
|
407
|
+
let n3 = e2();
|
|
408
|
+
if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
|
|
409
|
+
let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
|
|
410
|
+
if (!i2) throw Error(`JWT is not valid`);
|
|
411
|
+
if (typeof r2.data != `object` || r2.data === null || !(`metadata` in r2.data) || typeof r2.data.metadata != `object` || r2.data.metadata === null || !(`appExtensionType` in r2.data.metadata) || typeof r2.data.metadata.appExtensionType != `string`) throw Error(`Unexpected JWT data: expected object with metadata.appExtensionType string`);
|
|
412
|
+
return r2.data;
|
|
413
|
+
}, async process(e3) {
|
|
414
|
+
let t3 = await this.parseJWT(e3.body);
|
|
415
|
+
return this.executeHandler(t3, e3.url);
|
|
416
|
+
}, async parseRequest(e3) {
|
|
417
|
+
let t3 = await e3.text();
|
|
418
|
+
return this.parseJWT(t3);
|
|
419
|
+
}, async processRequest(e3) {
|
|
420
|
+
let t3 = await this.parseRequest(e3);
|
|
421
|
+
return this.processParsedRequest(t3, e3.url);
|
|
422
|
+
}, async processParsedRequest(e3, t3) {
|
|
423
|
+
try {
|
|
424
|
+
let n3 = await this.executeHandler(e3, t3);
|
|
425
|
+
return Response.json(n3);
|
|
426
|
+
} catch (e4) {
|
|
427
|
+
if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
|
|
428
|
+
throw e4;
|
|
429
|
+
}
|
|
430
|
+
}, async executeHandler(e3, n3) {
|
|
431
|
+
let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
|
|
432
|
+
if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
|
|
433
|
+
if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
|
|
434
|
+
let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
|
|
435
|
+
if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
|
|
436
|
+
let c2 = a2[s2.name];
|
|
437
|
+
if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
|
|
438
|
+
return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
|
|
439
|
+
} } };
|
|
440
|
+
}
|
|
441
|
+
var y = `X-Wix-Consistent`;
|
|
442
|
+
function nt(e2) {
|
|
443
|
+
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) => {
|
|
444
|
+
let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [y]: t2[y] } : {} }, l3 = e2.host?.getErrorHandler?.();
|
|
445
|
+
try {
|
|
446
|
+
if (typeof n3 == `string` || n3 instanceof URL) {
|
|
447
|
+
let e3 = await i3(n3, { ...r3, headers: c3 });
|
|
448
|
+
l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
|
|
449
|
+
let a3 = rt(e3);
|
|
450
|
+
return a3 && (t2[y] = a3), e3;
|
|
451
|
+
}
|
|
452
|
+
{
|
|
453
|
+
for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
|
|
454
|
+
let e3 = await i3(n3, r3);
|
|
455
|
+
l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
|
|
456
|
+
let a3 = rt(e3);
|
|
457
|
+
return a3 && (t2[y] = a3), e3;
|
|
458
|
+
}
|
|
459
|
+
} catch (e3) {
|
|
460
|
+
throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
|
|
461
|
+
}
|
|
462
|
+
}, { client: c2, initModule: l2 } = tt(i2), { client: u2, initModule: d2 } = $e(i2), f2 = async (n3, r3) => {
|
|
463
|
+
let i3 = o2(), s3 = await a2(), c3 = ue(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [y]: t2[y] } : {} } }), u3 = rt(l3);
|
|
464
|
+
return u3 && (t2[y] = u3), l3;
|
|
465
|
+
}, p2 = (t3, n3) => {
|
|
466
|
+
if (Ze(t3)) return d2(t3);
|
|
467
|
+
if (et(t3)) return l2(t3);
|
|
468
|
+
if (fe(t3) && e2.host) return pe(t3, e2.host);
|
|
469
|
+
if (typeof t3 == `function`) {
|
|
470
|
+
if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
|
|
471
|
+
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
|
|
472
|
+
return Ie(_e(() => ae(t3)) ? ie(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
|
|
473
|
+
let n4 = new URL(e3, `https://${r3}`);
|
|
474
|
+
return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
|
|
475
|
+
}, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
|
|
476
|
+
}
|
|
477
|
+
return de(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[oe])])) : t3;
|
|
478
|
+
}, m2 = (e3) => {
|
|
479
|
+
for (let n3 in e3) t2[n3] = e3[n3];
|
|
480
|
+
};
|
|
481
|
+
return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
|
|
482
|
+
let t3 = i2();
|
|
483
|
+
return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
|
|
484
|
+
}, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
|
|
485
|
+
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 ? _.elevatedClient = this : _.client = this;
|
|
486
|
+
}, fetch: (t3, n3) => {
|
|
487
|
+
let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
|
|
488
|
+
return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
|
|
489
|
+
}, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
|
|
490
|
+
let i3 = e2?.host?.apiBaseUrl ?? `www.wixapis.com`, a3 = await f2(`https://${i3}/graphql/${r3.apiVersion}`, { method: `POST`, headers: { "Content-Type": `application/json` }, body: JSON.stringify({ query: t3, variables: n3 }) });
|
|
491
|
+
if (a3.status !== 200) throw new ce(`GraphQL request failed with status ${a3.status}`, a3);
|
|
492
|
+
let { data: o3, errors: s3 } = await a3.json();
|
|
493
|
+
return { data: o3 ?? {}, errors: s3 };
|
|
494
|
+
}, webhooks: u2, servicePlugins: c2 };
|
|
495
|
+
}
|
|
496
|
+
function rt(e2) {
|
|
497
|
+
return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
|
|
498
|
+
}
|
|
499
|
+
var it = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
|
|
500
|
+
var at = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
|
|
501
|
+
var ot = `items`;
|
|
502
|
+
var st = `pagingMetadata`;
|
|
503
|
+
var ct = it;
|
|
504
|
+
function lt(e2, t2) {
|
|
505
|
+
return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
|
|
506
|
+
}
|
|
507
|
+
function b(e2, { transformSystemFields: t2 = true } = {}) {
|
|
508
|
+
return t2 ? lt(e2, ct) : e2;
|
|
509
|
+
}
|
|
510
|
+
var ut = `sort.fieldName`;
|
|
511
|
+
function dt(e2, t2, n2) {
|
|
512
|
+
return (e2 === ut || e2.endsWith(`.${ut}`)) && typeof t2 == `string` ? lt(t2, n2) : t2;
|
|
513
|
+
}
|
|
514
|
+
function ft(e2, t2, n2) {
|
|
515
|
+
let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
|
|
516
|
+
if (Array.isArray(e3)) e3.forEach((e4) => {
|
|
517
|
+
i2(e4, n3);
|
|
518
|
+
});
|
|
519
|
+
else if (typeof e3 == `object` && e3) {
|
|
520
|
+
let a2 = e3;
|
|
521
|
+
Object.keys(a2).forEach((e4) => {
|
|
522
|
+
let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
|
|
523
|
+
if (r2(o2)) return;
|
|
524
|
+
let s2 = pt(e4, t2);
|
|
525
|
+
s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = dt(o2, a2[s2], t2), i2(a2[s2], o2);
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
return i2(e2, ``), e2;
|
|
530
|
+
}
|
|
531
|
+
function pt(e2, t2) {
|
|
532
|
+
let n2;
|
|
533
|
+
return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
|
|
534
|
+
}
|
|
535
|
+
function x(e2, t2 = []) {
|
|
536
|
+
return ft(e2, it, t2);
|
|
537
|
+
}
|
|
538
|
+
function S(e2, t2 = []) {
|
|
539
|
+
return ft(e2, at, t2);
|
|
540
|
+
}
|
|
541
|
+
function C(e2) {
|
|
542
|
+
return e2 ? new Date(e2) : void 0;
|
|
543
|
+
}
|
|
544
|
+
var mt = /* @__PURE__ */ new WeakMap();
|
|
545
|
+
function ht() {
|
|
546
|
+
return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
|
|
547
|
+
}
|
|
548
|
+
function gt(e2, t2) {
|
|
549
|
+
let n2 = e2.get(t2);
|
|
550
|
+
return n2 || (n2 = ht(), e2.set(t2, n2)), n2;
|
|
551
|
+
}
|
|
552
|
+
function _t(e2, t2) {
|
|
553
|
+
return t2 === `*` ? (e2.anyField ??= ht(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), gt(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), gt(e2.fields, t2));
|
|
554
|
+
}
|
|
555
|
+
function vt(e2) {
|
|
556
|
+
let t2 = ht();
|
|
557
|
+
for (let n2 of e2) {
|
|
558
|
+
let e3 = n2.path.split(`.`).reduce(_t, t2);
|
|
559
|
+
e3.leaves ??= [], e3.leaves.push(n2);
|
|
560
|
+
}
|
|
561
|
+
return t2;
|
|
562
|
+
}
|
|
563
|
+
function yt(e2) {
|
|
564
|
+
let t2 = mt.get(e2);
|
|
565
|
+
return t2 || (t2 = vt(e2), mt.set(e2, t2)), t2;
|
|
566
|
+
}
|
|
567
|
+
function bt(e2) {
|
|
568
|
+
return typeof e2 == `object` && !!e2;
|
|
569
|
+
}
|
|
570
|
+
function xt(e2, { isRepeated: t2, isMap: n2 }, r2) {
|
|
571
|
+
return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? bt(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
|
|
572
|
+
}
|
|
573
|
+
function St(e2, t2, n2) {
|
|
574
|
+
bt(e2) && Tt(e2, t2, n2);
|
|
575
|
+
}
|
|
576
|
+
function Ct(e2, t2, n2) {
|
|
577
|
+
for (let [r2, i2] of t2) {
|
|
578
|
+
if (!(r2 in e2)) continue;
|
|
579
|
+
if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = xt(e2[r2], t4, n2);
|
|
580
|
+
let t3 = e2[r2];
|
|
581
|
+
Array.isArray(t3) ? t3.forEach((e3) => St(e3, i2, n2)) : St(t3, i2, n2);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function wt(e2, t2, n2) {
|
|
585
|
+
for (let [r2, i2] of t2) {
|
|
586
|
+
let t3 = e2[r2];
|
|
587
|
+
bt(t3) && Object.values(t3).forEach((e3) => St(e3, i2, n2));
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
function Tt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
|
|
591
|
+
t2 && Ct(e2, t2, i2), n2 && wt(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => St(e3, r2, i2));
|
|
592
|
+
}
|
|
593
|
+
function w(e2, t2) {
|
|
594
|
+
if (!bt(e2)) return e2;
|
|
595
|
+
for (let { paths: n2, transformFn: r2 } of t2) Tt(e2, yt(n2), r2);
|
|
596
|
+
return e2;
|
|
597
|
+
}
|
|
598
|
+
function Et(e2) {
|
|
599
|
+
return jt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
|
|
600
|
+
}
|
|
601
|
+
var Dt = /([\p{Ll}\d])(\p{Lu})/gu;
|
|
602
|
+
var Ot = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
|
|
603
|
+
var kt = `$1\0$2`;
|
|
604
|
+
var At = /[^\p{L}\d]+/giu;
|
|
605
|
+
function jt(e2) {
|
|
606
|
+
let t2 = e2.trim();
|
|
607
|
+
t2 = t2.replace(Dt, kt).replace(Ot, kt), t2 = t2.replace(At, `\0`);
|
|
608
|
+
let n2 = 0, r2 = t2.length;
|
|
609
|
+
for (; t2.charAt(n2) === `\0`; ) n2++;
|
|
610
|
+
if (n2 === r2) return [];
|
|
611
|
+
for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
|
|
612
|
+
return t2.slice(n2, r2).split(/\0/g);
|
|
613
|
+
}
|
|
614
|
+
var Mt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
|
|
615
|
+
var Nt = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
|
|
616
|
+
var Pt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
|
|
617
|
+
function T(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
|
|
618
|
+
if (typeof e2 != `object` || !e2) throw e2;
|
|
619
|
+
if (Mt(e2)) return Ft(e2, t2, n2);
|
|
620
|
+
if (Nt(e2)) return Lt(e2);
|
|
621
|
+
if (Pt(e2)) {
|
|
622
|
+
let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: Et(n3), data: {} }, requestId: e2.requestId };
|
|
623
|
+
return It(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
|
|
624
|
+
}
|
|
625
|
+
return Rt(e2);
|
|
626
|
+
}
|
|
627
|
+
var Ft = (e2, t2, n2) => {
|
|
628
|
+
let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = zt(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 };
|
|
629
|
+
return It(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
|
|
630
|
+
};
|
|
631
|
+
var It = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
|
|
632
|
+
var Lt = (e2) => {
|
|
633
|
+
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 ?? Et(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 };
|
|
634
|
+
return It(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
|
|
635
|
+
};
|
|
636
|
+
var Rt = (e2) => It(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: Et(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
|
|
637
|
+
var zt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
|
|
638
|
+
let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
|
|
639
|
+
return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
|
|
640
|
+
let r3 = t2[e3.field];
|
|
641
|
+
if (r3) return { ...e3, field: Bt(r3, i2) };
|
|
642
|
+
let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
|
|
643
|
+
if (s2) {
|
|
644
|
+
let t3 = a2[s2];
|
|
645
|
+
if (t3) return { ...e3, field: e3.field.replace(s2, Bt(t3, i2)) };
|
|
646
|
+
}
|
|
647
|
+
return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
var Bt = (e2, t2) => {
|
|
651
|
+
let n2 = Vt(e2);
|
|
652
|
+
return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
|
|
653
|
+
};
|
|
654
|
+
var Vt = (e2) => {
|
|
655
|
+
let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
|
|
656
|
+
return t2 && t2.groups && Number(t2.groups.argIndex);
|
|
657
|
+
};
|
|
658
|
+
function Ht() {
|
|
659
|
+
let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
|
|
660
|
+
if (e2) return { initWixModules(t3, n3) {
|
|
661
|
+
return Ut(() => e2(t3, n3));
|
|
662
|
+
}, fetchWithAuth() {
|
|
663
|
+
throw Error(`fetchWithAuth is not available in this context`);
|
|
664
|
+
}, graphql() {
|
|
665
|
+
throw Error(`graphql is not available in this context`);
|
|
666
|
+
} };
|
|
667
|
+
let t2 = typeof $wixContext < `u` ? $wixContext.client : _.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : _.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : _.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : _.elevatedClient;
|
|
668
|
+
if (t2 || n2) return { initWixModules(e3, r2) {
|
|
669
|
+
if (r2) {
|
|
670
|
+
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`);
|
|
671
|
+
return Ut(() => n2.use(e3));
|
|
672
|
+
}
|
|
673
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
674
|
+
return Ut(() => t2.use(e3));
|
|
675
|
+
}, fetchWithAuth: (e3, n3) => {
|
|
676
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
677
|
+
return t2.fetchWithAuth(e3, n3);
|
|
678
|
+
}, getAuth() {
|
|
679
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
680
|
+
return t2.auth;
|
|
681
|
+
}, async graphql(e3, n3, r2) {
|
|
682
|
+
if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
|
|
683
|
+
return t2.graphql(e3, n3, r2);
|
|
684
|
+
} };
|
|
685
|
+
}
|
|
686
|
+
function Ut(e2) {
|
|
687
|
+
let t2 = globalThis.__wix_context__, n2 = { client: _.client, elevatedClient: _.elevatedClient }, r2;
|
|
688
|
+
globalThis.__wix_context__ = void 0, _.client = void 0, _.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
|
|
689
|
+
try {
|
|
690
|
+
return e2();
|
|
691
|
+
} finally {
|
|
692
|
+
globalThis.__wix_context__ = t2, _.client = n2.client, _.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
function Wt(e2, t2) {
|
|
696
|
+
return (...n2) => {
|
|
697
|
+
let r2 = Ht();
|
|
698
|
+
return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function Gt(e2) {
|
|
702
|
+
let t2 = (...t3) => {
|
|
703
|
+
let n2 = Ht();
|
|
704
|
+
return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
|
|
705
|
+
};
|
|
706
|
+
return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
|
|
707
|
+
}
|
|
708
|
+
function E(e2, t2 = false) {
|
|
709
|
+
return Wt(e2, t2);
|
|
710
|
+
}
|
|
711
|
+
function D(e2, t2) {
|
|
712
|
+
let n2 = Kt(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
|
|
713
|
+
return t2 && r2 ? new URLSearchParams({ ".r": Jt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
|
|
714
|
+
r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
|
|
715
|
+
}), e3), new URLSearchParams());
|
|
716
|
+
}
|
|
717
|
+
function O(e2) {
|
|
718
|
+
let t2 = cn(on(e2.host), e2.domainToMappings);
|
|
719
|
+
return _n(mn(e2.protoPath, e2.data || {}), t2);
|
|
720
|
+
}
|
|
721
|
+
function Kt(e2, t2 = ``) {
|
|
722
|
+
let n2 = {};
|
|
723
|
+
return Object.entries(e2).forEach(([e3, r2]) => {
|
|
724
|
+
let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = qt(t2, e3);
|
|
725
|
+
if (i2) {
|
|
726
|
+
let e4 = Kt(r2, a2);
|
|
727
|
+
Object.assign(n2, e4);
|
|
728
|
+
} else n2[a2] = r2;
|
|
729
|
+
}), n2;
|
|
730
|
+
}
|
|
731
|
+
function qt(e2, t2) {
|
|
732
|
+
return `${e2}${e2 ? `.` : ``}${t2}`;
|
|
733
|
+
}
|
|
734
|
+
var Jt = (e2) => {
|
|
735
|
+
let t2 = new TextEncoder().encode(e2);
|
|
736
|
+
return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
|
|
737
|
+
};
|
|
738
|
+
var Yt = [`wix.com`, `editorx.com`];
|
|
739
|
+
var Xt = `_`;
|
|
740
|
+
var Zt = `*.`;
|
|
741
|
+
var Qt = RegExp(`\\.(${Yt.join(`|`)})$`);
|
|
742
|
+
var $t = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
|
|
743
|
+
var en = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
|
|
744
|
+
var tn = `dev.wix-code.com`;
|
|
745
|
+
var nn = /{(.*)}/;
|
|
746
|
+
var rn = RegExp(`\\.(${$t.join(`|`)})$`);
|
|
747
|
+
var an = RegExp(`.*\\.${tn}$`);
|
|
748
|
+
function on(e2) {
|
|
749
|
+
return sn(e2).replace(Qt, `._base_domain_`).replace(rn, `._api_base_domain_`).replace(an, `*.dev.wix-code.com`);
|
|
750
|
+
}
|
|
751
|
+
function sn(e2) {
|
|
752
|
+
return en[e2] ?? e2;
|
|
753
|
+
}
|
|
754
|
+
function cn(e2, t2) {
|
|
755
|
+
let n2 = t2[e2];
|
|
756
|
+
if (n2) return n2;
|
|
757
|
+
let r2 = ln(e2, t2) ?? un(e2, t2);
|
|
758
|
+
if (!r2) {
|
|
759
|
+
if (fn(e2)) {
|
|
760
|
+
let e3 = t2[pn];
|
|
761
|
+
if (e3) return e3;
|
|
762
|
+
}
|
|
763
|
+
let n3 = t2[Xt];
|
|
764
|
+
if (n3) return n3;
|
|
765
|
+
}
|
|
766
|
+
return r2 ?? [];
|
|
767
|
+
}
|
|
768
|
+
function ln(e2, t2) {
|
|
769
|
+
return Object.entries(t2).find(([t3]) => {
|
|
770
|
+
let [, ...n2] = e2.split(`.`);
|
|
771
|
+
return n2.join(`.`) === t3;
|
|
772
|
+
})?.[1];
|
|
773
|
+
}
|
|
774
|
+
function un(e2, t2) {
|
|
775
|
+
let [n2] = Object.entries(t2).filter(([t3]) => dn(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
|
|
776
|
+
if (!n2) return;
|
|
777
|
+
let [, r2] = n2;
|
|
778
|
+
return r2;
|
|
779
|
+
}
|
|
780
|
+
function dn(e2, t2) {
|
|
781
|
+
if (!t2.startsWith(Zt)) return false;
|
|
782
|
+
let n2 = t2.slice(1);
|
|
783
|
+
return e2.length > n2.length && e2.endsWith(n2);
|
|
784
|
+
}
|
|
785
|
+
function fn(e2) {
|
|
786
|
+
return !!e2.match(/\._base_domain_$/);
|
|
787
|
+
}
|
|
788
|
+
var pn = `www._base_domain_`;
|
|
789
|
+
function mn(e2, t2) {
|
|
790
|
+
return e2.split(`/`).map((e3) => hn(e3, t2)).join(`/`);
|
|
791
|
+
}
|
|
792
|
+
function hn(e2, t2) {
|
|
793
|
+
let n2 = e2.match(nn) || [], r2 = n2[1];
|
|
794
|
+
return r2 ? gn(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
|
|
795
|
+
}
|
|
796
|
+
function gn(e2, t2, n2, r2) {
|
|
797
|
+
let i2 = e2;
|
|
798
|
+
for (let e3 of t2.split(`.`)) {
|
|
799
|
+
if (!i2) return n2;
|
|
800
|
+
i2 = i2[e3];
|
|
801
|
+
}
|
|
802
|
+
return `${i2}${r2}`;
|
|
803
|
+
}
|
|
804
|
+
function _n(e2, t2) {
|
|
805
|
+
let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
|
|
806
|
+
return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
|
|
807
|
+
}
|
|
808
|
+
function k(e2) {
|
|
809
|
+
return Gt(e2);
|
|
810
|
+
}
|
|
811
|
+
function vn(e2) {
|
|
812
|
+
return isFinite(e2) ? e2 : e2.toString();
|
|
813
|
+
}
|
|
814
|
+
function A(e2) {
|
|
815
|
+
return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
|
|
816
|
+
}
|
|
817
|
+
var yn = `x-wix-linguist`;
|
|
818
|
+
var bn = `00000000-0000-0000-0000-000000000000`;
|
|
819
|
+
var xn = `false`;
|
|
820
|
+
var Sn = () => {
|
|
821
|
+
let e2 = Tn(`language`), t2 = Tn(`locale`);
|
|
822
|
+
if (e2) return { [yn]: [e2, t2 || e2, xn, bn].join(`|`) };
|
|
823
|
+
};
|
|
824
|
+
function Cn() {
|
|
825
|
+
let e2 = null, t2 = null;
|
|
826
|
+
return { promise: new Promise((n2, r2) => {
|
|
827
|
+
e2 = n2, t2 = r2;
|
|
828
|
+
}), resolve: e2, reject: t2 };
|
|
829
|
+
}
|
|
830
|
+
var wn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
|
|
831
|
+
var Tn = (e2) => wn()?.[e2];
|
|
832
|
+
var En = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
|
|
833
|
+
let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = On();
|
|
834
|
+
return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: Tn(`language`), locale: Tn(`locale`), get passThroughHeaders() {
|
|
835
|
+
return Sn();
|
|
836
|
+
} } };
|
|
837
|
+
}, auth: (e3) => {
|
|
838
|
+
let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
|
|
839
|
+
!e3 && Dn() && (e3 = t2?.getAccessTokenFunction?.());
|
|
840
|
+
let n2 = false, { resolve: r2, promise: i2 } = Cn();
|
|
841
|
+
return { getAuthHeaders: async () => {
|
|
842
|
+
if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
|
|
843
|
+
return { headers: { Authorization: await e3() } };
|
|
844
|
+
}, getAccessTokenInjector: () => (n2 = true, (e4) => {
|
|
845
|
+
r2(e4);
|
|
846
|
+
}) };
|
|
847
|
+
} });
|
|
848
|
+
function Dn() {
|
|
849
|
+
return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
|
|
850
|
+
}
|
|
851
|
+
function On() {
|
|
852
|
+
let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
|
|
853
|
+
if (!e2) return;
|
|
854
|
+
let t2 = new URL(e2);
|
|
855
|
+
return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
|
|
856
|
+
}
|
|
857
|
+
var kn = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
|
|
858
|
+
if (!e2) throw Error(`Wix Site SDK only works in a Wix site environment. Learn more: https://dev.wix.com/docs/sdk/host-modules/site/introduction`);
|
|
859
|
+
return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
|
|
860
|
+
}, getAccessToken: () => {
|
|
861
|
+
throw Error(`Not implemented`);
|
|
862
|
+
}, observeState: () => ({ disconnect: () => {
|
|
863
|
+
} }) });
|
|
864
|
+
var An = En({ createHost: function(e2) {
|
|
865
|
+
let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
|
|
866
|
+
if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
|
|
867
|
+
return { channel: kn({ clientSdk: t2, applicationId: n2 }), close: () => {
|
|
868
|
+
} };
|
|
869
|
+
} });
|
|
870
|
+
var jn = (e2, t2) => {
|
|
871
|
+
let n2 = An.host({ applicationId: e2, componentId: t2 }), r2 = An.auth();
|
|
872
|
+
return nt({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
|
|
873
|
+
};
|
|
874
|
+
var Mn = (e2) => jn(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
|
|
875
|
+
var Nn = class {
|
|
876
|
+
constructor() {
|
|
877
|
+
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
878
|
+
}
|
|
879
|
+
subscribe(e2) {
|
|
880
|
+
return this.listeners.add(e2), this.onSubscribe(), () => {
|
|
881
|
+
this.listeners.delete(e2), this.onUnsubscribe();
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
hasListeners() {
|
|
885
|
+
return this.listeners.size > 0;
|
|
886
|
+
}
|
|
887
|
+
onSubscribe() {
|
|
888
|
+
}
|
|
889
|
+
onUnsubscribe() {
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
var Pn = new class extends Nn {
|
|
893
|
+
#e;
|
|
894
|
+
#t;
|
|
895
|
+
#n;
|
|
896
|
+
constructor() {
|
|
897
|
+
super(), this.#n = (e2) => {
|
|
898
|
+
if (typeof window < `u` && window.addEventListener) {
|
|
899
|
+
let t2 = () => e2();
|
|
900
|
+
return window.addEventListener(`visibilitychange`, t2, false), () => {
|
|
901
|
+
window.removeEventListener(`visibilitychange`, t2);
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
onSubscribe() {
|
|
907
|
+
this.#t || this.setEventListener(this.#n);
|
|
908
|
+
}
|
|
909
|
+
onUnsubscribe() {
|
|
910
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
911
|
+
}
|
|
912
|
+
setEventListener(e2) {
|
|
913
|
+
this.#n = e2, this.#t?.(), this.#t = e2((e3) => {
|
|
914
|
+
typeof e3 == `boolean` ? this.setFocused(e3) : this.onFocus();
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
setFocused(e2) {
|
|
918
|
+
this.#e !== e2 && (this.#e = e2, this.onFocus());
|
|
919
|
+
}
|
|
920
|
+
onFocus() {
|
|
921
|
+
let e2 = this.isFocused();
|
|
922
|
+
this.listeners.forEach((t2) => {
|
|
923
|
+
t2(e2);
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
isFocused() {
|
|
927
|
+
return typeof this.#e == `boolean` ? this.#e : globalThis.document?.visibilityState !== `hidden`;
|
|
928
|
+
}
|
|
929
|
+
}();
|
|
930
|
+
var Fn = { setTimeout: (e2, t2) => setTimeout(e2, t2), clearTimeout: (e2) => clearTimeout(e2), setInterval: (e2, t2) => setInterval(e2, t2), clearInterval: (e2) => clearInterval(e2) };
|
|
931
|
+
var j = new class {
|
|
932
|
+
#e = Fn;
|
|
933
|
+
setTimeoutProvider(e2) {
|
|
934
|
+
this.#e = e2;
|
|
935
|
+
}
|
|
936
|
+
setTimeout(e2, t2) {
|
|
937
|
+
return this.#e.setTimeout(e2, t2);
|
|
938
|
+
}
|
|
939
|
+
clearTimeout(e2) {
|
|
940
|
+
this.#e.clearTimeout(e2);
|
|
941
|
+
}
|
|
942
|
+
setInterval(e2, t2) {
|
|
943
|
+
return this.#e.setInterval(e2, t2);
|
|
944
|
+
}
|
|
945
|
+
clearInterval(e2) {
|
|
946
|
+
this.#e.clearInterval(e2);
|
|
947
|
+
}
|
|
948
|
+
}();
|
|
949
|
+
function In(e2) {
|
|
950
|
+
setTimeout(e2, 0);
|
|
951
|
+
}
|
|
952
|
+
var Ln = typeof window > `u` || `Deno` in globalThis;
|
|
953
|
+
function M() {
|
|
954
|
+
}
|
|
955
|
+
function Rn(e2, t2) {
|
|
956
|
+
return typeof e2 == `function` ? e2(t2) : e2;
|
|
957
|
+
}
|
|
958
|
+
function zn(e2) {
|
|
959
|
+
return typeof e2 == `number` && e2 >= 0 && e2 !== 1 / 0;
|
|
960
|
+
}
|
|
961
|
+
function Bn(e2, t2) {
|
|
962
|
+
return Math.max(e2 + (t2 || 0) - Date.now(), 0);
|
|
963
|
+
}
|
|
964
|
+
function N(e2, t2) {
|
|
965
|
+
return typeof e2 == `function` ? e2(t2) : e2;
|
|
966
|
+
}
|
|
967
|
+
function P(e2, t2) {
|
|
968
|
+
return typeof e2 == `function` ? e2(t2) : e2;
|
|
969
|
+
}
|
|
970
|
+
function Vn(e2, t2) {
|
|
971
|
+
let { type: n2 = `all`, exact: r2, fetchStatus: i2, predicate: a2, queryKey: o2, stale: s2 } = e2;
|
|
972
|
+
if (o2) {
|
|
973
|
+
if (r2) {
|
|
974
|
+
if (t2.queryHash !== Un(o2, t2.options)) return false;
|
|
975
|
+
} else if (!I(t2.queryKey, o2)) return false;
|
|
976
|
+
}
|
|
977
|
+
if (n2 !== `all`) {
|
|
978
|
+
let e3 = t2.isActive();
|
|
979
|
+
if (n2 === `active` && !e3 || n2 === `inactive` && e3) return false;
|
|
980
|
+
}
|
|
981
|
+
return !(typeof s2 == `boolean` && t2.isStale() !== s2 || i2 && i2 !== t2.state.fetchStatus || a2 && !a2(t2));
|
|
982
|
+
}
|
|
983
|
+
function Hn(e2, t2) {
|
|
984
|
+
let { exact: n2, status: r2, predicate: i2, mutationKey: a2 } = e2;
|
|
985
|
+
if (a2) {
|
|
986
|
+
if (!t2.options.mutationKey) return false;
|
|
987
|
+
if (n2) {
|
|
988
|
+
if (F(t2.options.mutationKey) !== F(a2)) return false;
|
|
989
|
+
} else if (!I(t2.options.mutationKey, a2)) return false;
|
|
990
|
+
}
|
|
991
|
+
return !(r2 && t2.state.status !== r2 || i2 && !i2(t2));
|
|
992
|
+
}
|
|
993
|
+
function Un(e2, t2) {
|
|
994
|
+
return (t2?.queryKeyHashFn || F)(e2);
|
|
995
|
+
}
|
|
996
|
+
function F(e2) {
|
|
997
|
+
return JSON.stringify(e2, (e3, t2) => Jn(t2) ? Object.keys(t2).sort().reduce((e4, n2) => (e4[n2] = t2[n2], e4), {}) : t2);
|
|
998
|
+
}
|
|
999
|
+
function I(e2, t2) {
|
|
1000
|
+
return e2 === t2 ? true : typeof e2 == typeof t2 && e2 && t2 && typeof e2 == `object` && typeof t2 == `object` ? Object.keys(t2).every((n2) => I(e2[n2], t2[n2])) : false;
|
|
1001
|
+
}
|
|
1002
|
+
var Wn = Object.prototype.hasOwnProperty;
|
|
1003
|
+
function Gn(e2, t2, n2 = 0) {
|
|
1004
|
+
if (e2 === t2) return e2;
|
|
1005
|
+
if (n2 > 500) return t2;
|
|
1006
|
+
let r2 = qn(e2) && qn(t2);
|
|
1007
|
+
if (!r2 && !(Jn(e2) && Jn(t2))) return t2;
|
|
1008
|
+
let i2 = (r2 ? e2 : Object.keys(e2)).length, a2 = r2 ? t2 : Object.keys(t2), o2 = a2.length, s2 = r2 ? Array(o2) : {}, c2 = 0;
|
|
1009
|
+
for (let l2 = 0; l2 < o2; l2++) {
|
|
1010
|
+
let o3 = r2 ? l2 : a2[l2], u2 = e2[o3], d2 = t2[o3];
|
|
1011
|
+
if (u2 === d2) {
|
|
1012
|
+
s2[o3] = u2, (r2 ? l2 < i2 : Wn.call(e2, o3)) && c2++;
|
|
1013
|
+
continue;
|
|
1014
|
+
}
|
|
1015
|
+
if (u2 === null || d2 === null || typeof u2 != `object` || typeof d2 != `object`) {
|
|
1016
|
+
s2[o3] = d2;
|
|
1017
|
+
continue;
|
|
1018
|
+
}
|
|
1019
|
+
let f2 = Gn(u2, d2, n2 + 1);
|
|
1020
|
+
s2[o3] = f2, f2 === u2 && c2++;
|
|
1021
|
+
}
|
|
1022
|
+
return i2 === o2 && c2 === i2 ? e2 : s2;
|
|
1023
|
+
}
|
|
1024
|
+
function Kn(e2, t2) {
|
|
1025
|
+
if (!t2 || Object.keys(e2).length !== Object.keys(t2).length) return false;
|
|
1026
|
+
for (let n2 in e2) if (e2[n2] !== t2[n2]) return false;
|
|
1027
|
+
return true;
|
|
1028
|
+
}
|
|
1029
|
+
function qn(e2) {
|
|
1030
|
+
return Array.isArray(e2) && e2.length === Object.keys(e2).length;
|
|
1031
|
+
}
|
|
1032
|
+
function Jn(e2) {
|
|
1033
|
+
if (!Yn(e2)) return false;
|
|
1034
|
+
let t2 = e2.constructor;
|
|
1035
|
+
if (t2 === void 0) return true;
|
|
1036
|
+
let n2 = t2.prototype;
|
|
1037
|
+
return !(!Yn(n2) || !n2.hasOwnProperty(`isPrototypeOf`) || Object.getPrototypeOf(e2) !== Object.prototype);
|
|
1038
|
+
}
|
|
1039
|
+
function Yn(e2) {
|
|
1040
|
+
return Object.prototype.toString.call(e2) === `[object Object]`;
|
|
1041
|
+
}
|
|
1042
|
+
function Xn(e2) {
|
|
1043
|
+
return new Promise((t2) => {
|
|
1044
|
+
j.setTimeout(t2, e2);
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
function Zn(e2, t2, n2) {
|
|
1048
|
+
return typeof n2.structuralSharing == `function` ? n2.structuralSharing(e2, t2) : n2.structuralSharing === false ? t2 : Gn(e2, t2);
|
|
1049
|
+
}
|
|
1050
|
+
function Qn(e2) {
|
|
1051
|
+
return e2;
|
|
1052
|
+
}
|
|
1053
|
+
function $n(e2, t2, n2 = 0) {
|
|
1054
|
+
let r2 = [...e2, t2];
|
|
1055
|
+
return n2 && r2.length > n2 ? r2.slice(1) : r2;
|
|
1056
|
+
}
|
|
1057
|
+
function er(e2, t2, n2 = 0) {
|
|
1058
|
+
let r2 = [t2, ...e2];
|
|
1059
|
+
return n2 && r2.length > n2 ? r2.slice(0, -1) : r2;
|
|
1060
|
+
}
|
|
1061
|
+
var tr = Symbol();
|
|
1062
|
+
function nr(e2, t2) {
|
|
1063
|
+
return !e2.queryFn && t2?.initialPromise ? () => t2.initialPromise : !e2.queryFn || e2.queryFn === tr ? () => Promise.reject(Error(`Missing queryFn: '${e2.queryHash}'`)) : e2.queryFn;
|
|
1064
|
+
}
|
|
1065
|
+
function rr(e2, t2) {
|
|
1066
|
+
return typeof e2 == `function` ? e2(...t2) : !!e2;
|
|
1067
|
+
}
|
|
1068
|
+
function ir(e2, t2, n2) {
|
|
1069
|
+
let r2 = false, i2;
|
|
1070
|
+
return Object.defineProperty(e2, "signal", { enumerable: true, get: () => (i2 ??= t2(), r2 ? i2 : (r2 = true, i2.aborted ? n2() : i2.addEventListener(`abort`, n2, { once: true }), i2)) }), e2;
|
|
1071
|
+
}
|
|
1072
|
+
var L = /* @__PURE__ */ (() => {
|
|
1073
|
+
let e2 = () => Ln;
|
|
1074
|
+
return { isServer() {
|
|
1075
|
+
return e2();
|
|
1076
|
+
}, setIsServer(t2) {
|
|
1077
|
+
e2 = t2;
|
|
1078
|
+
} };
|
|
1079
|
+
})();
|
|
1080
|
+
function ar() {
|
|
1081
|
+
let e2, t2, n2 = new Promise((n3, r3) => {
|
|
1082
|
+
e2 = n3, t2 = r3;
|
|
1083
|
+
});
|
|
1084
|
+
n2.status = `pending`, n2.catch(() => {
|
|
1085
|
+
});
|
|
1086
|
+
function r2(e3) {
|
|
1087
|
+
Object.assign(n2, e3), delete n2.resolve, delete n2.reject;
|
|
1088
|
+
}
|
|
1089
|
+
return n2.resolve = (t3) => {
|
|
1090
|
+
r2({ status: `fulfilled`, value: t3 }), e2(t3);
|
|
1091
|
+
}, n2.reject = (e3) => {
|
|
1092
|
+
r2({ status: `rejected`, reason: e3 }), t2(e3);
|
|
1093
|
+
}, n2;
|
|
1094
|
+
}
|
|
1095
|
+
var or = In;
|
|
1096
|
+
function sr() {
|
|
1097
|
+
let e2 = [], t2 = 0, n2 = (e3) => {
|
|
1098
|
+
e3();
|
|
1099
|
+
}, r2 = (e3) => {
|
|
1100
|
+
e3();
|
|
1101
|
+
}, i2 = or, a2 = (r3) => {
|
|
1102
|
+
t2 ? e2.push(r3) : i2(() => {
|
|
1103
|
+
n2(r3);
|
|
1104
|
+
});
|
|
1105
|
+
}, o2 = () => {
|
|
1106
|
+
let t3 = e2;
|
|
1107
|
+
e2 = [], t3.length && i2(() => {
|
|
1108
|
+
r2(() => {
|
|
1109
|
+
t3.forEach((e3) => {
|
|
1110
|
+
n2(e3);
|
|
1111
|
+
});
|
|
1112
|
+
});
|
|
1113
|
+
});
|
|
1114
|
+
};
|
|
1115
|
+
return { batch: (e3) => {
|
|
1116
|
+
let n3;
|
|
1117
|
+
t2++;
|
|
1118
|
+
try {
|
|
1119
|
+
n3 = e3();
|
|
1120
|
+
} finally {
|
|
1121
|
+
t2--, t2 || o2();
|
|
1122
|
+
}
|
|
1123
|
+
return n3;
|
|
1124
|
+
}, batchCalls: (e3) => (...t3) => {
|
|
1125
|
+
a2(() => {
|
|
1126
|
+
e3(...t3);
|
|
1127
|
+
});
|
|
1128
|
+
}, schedule: a2, setNotifyFunction: (e3) => {
|
|
1129
|
+
n2 = e3;
|
|
1130
|
+
}, setBatchNotifyFunction: (e3) => {
|
|
1131
|
+
r2 = e3;
|
|
1132
|
+
}, setScheduler: (e3) => {
|
|
1133
|
+
i2 = e3;
|
|
1134
|
+
} };
|
|
1135
|
+
}
|
|
1136
|
+
var R = sr();
|
|
1137
|
+
var cr = new class extends Nn {
|
|
1138
|
+
#e = true;
|
|
1139
|
+
#t;
|
|
1140
|
+
#n;
|
|
1141
|
+
constructor() {
|
|
1142
|
+
super(), this.#n = (e2) => {
|
|
1143
|
+
if (typeof window < `u` && window.addEventListener) {
|
|
1144
|
+
let t2 = () => e2(true), n2 = () => e2(false);
|
|
1145
|
+
return window.addEventListener(`online`, t2, false), window.addEventListener(`offline`, n2, false), () => {
|
|
1146
|
+
window.removeEventListener(`online`, t2), window.removeEventListener(`offline`, n2);
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
onSubscribe() {
|
|
1152
|
+
this.#t || this.setEventListener(this.#n);
|
|
1153
|
+
}
|
|
1154
|
+
onUnsubscribe() {
|
|
1155
|
+
this.hasListeners() || (this.#t?.(), this.#t = void 0);
|
|
1156
|
+
}
|
|
1157
|
+
setEventListener(e2) {
|
|
1158
|
+
this.#n = e2, this.#t?.(), this.#t = e2(this.setOnline.bind(this));
|
|
1159
|
+
}
|
|
1160
|
+
setOnline(e2) {
|
|
1161
|
+
this.#e !== e2 && (this.#e = e2, this.listeners.forEach((t2) => {
|
|
1162
|
+
t2(e2);
|
|
1163
|
+
}));
|
|
1164
|
+
}
|
|
1165
|
+
isOnline() {
|
|
1166
|
+
return this.#e;
|
|
1167
|
+
}
|
|
1168
|
+
}();
|
|
1169
|
+
function lr(e2) {
|
|
1170
|
+
return Math.min(1e3 * 2 ** e2, 3e4);
|
|
1171
|
+
}
|
|
1172
|
+
function ur(e2) {
|
|
1173
|
+
return (e2 ?? `online`) !== `online` || cr.isOnline();
|
|
1174
|
+
}
|
|
1175
|
+
var dr = class extends Error {
|
|
1176
|
+
constructor(e2) {
|
|
1177
|
+
super(`CancelledError`), this.revert = e2?.revert, this.silent = e2?.silent;
|
|
1178
|
+
}
|
|
1179
|
+
};
|
|
1180
|
+
function fr(e2) {
|
|
1181
|
+
let t2 = false, n2 = 0, r2, i2 = ar(), a2 = () => i2.status !== `pending`, o2 = (t3) => {
|
|
1182
|
+
if (!a2()) {
|
|
1183
|
+
let n3 = new dr(t3);
|
|
1184
|
+
f2(n3), e2.onCancel?.(n3);
|
|
1185
|
+
}
|
|
1186
|
+
}, s2 = () => {
|
|
1187
|
+
t2 = true;
|
|
1188
|
+
}, c2 = () => {
|
|
1189
|
+
t2 = false;
|
|
1190
|
+
}, l2 = () => Pn.isFocused() && (e2.networkMode === `always` || cr.isOnline()) && e2.canRun(), u2 = () => ur(e2.networkMode) && e2.canRun(), d2 = (e3) => {
|
|
1191
|
+
a2() || (r2?.(), i2.resolve(e3));
|
|
1192
|
+
}, f2 = (e3) => {
|
|
1193
|
+
a2() || (r2?.(), i2.reject(e3));
|
|
1194
|
+
}, p2 = () => new Promise((t3) => {
|
|
1195
|
+
r2 = (e3) => {
|
|
1196
|
+
(a2() || l2()) && t3(e3);
|
|
1197
|
+
}, e2.onPause?.();
|
|
1198
|
+
}).then(() => {
|
|
1199
|
+
r2 = void 0, a2() || e2.onContinue?.();
|
|
1200
|
+
}), m2 = () => {
|
|
1201
|
+
if (a2()) return;
|
|
1202
|
+
let r3, i3 = n2 === 0 ? e2.initialPromise : void 0;
|
|
1203
|
+
try {
|
|
1204
|
+
r3 = i3 ?? e2.fn();
|
|
1205
|
+
} catch (e3) {
|
|
1206
|
+
r3 = Promise.reject(e3);
|
|
1207
|
+
}
|
|
1208
|
+
Promise.resolve(r3).then(d2).catch((r4) => {
|
|
1209
|
+
if (a2()) return;
|
|
1210
|
+
let i4 = e2.retry ?? (L.isServer() ? 0 : 3), o3 = e2.retryDelay ?? lr, s3 = typeof o3 == `function` ? o3(n2, r4) : o3, c3 = i4 === true || typeof i4 == `number` && n2 < i4 || typeof i4 == `function` && i4(n2, r4);
|
|
1211
|
+
if (t2 || !c3) {
|
|
1212
|
+
f2(r4);
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
n2++, e2.onFail?.(n2, r4), Xn(s3).then(() => l2() ? void 0 : p2()).then(() => {
|
|
1216
|
+
t2 ? f2(r4) : m2();
|
|
1217
|
+
});
|
|
1218
|
+
});
|
|
1219
|
+
};
|
|
1220
|
+
return { promise: i2, status: () => i2.status, cancel: o2, continue: () => (r2?.(), i2), cancelRetry: s2, continueRetry: c2, canStart: u2, start: () => (u2() ? m2() : p2().then(m2), i2) };
|
|
1221
|
+
}
|
|
1222
|
+
var pr = class {
|
|
1223
|
+
#e;
|
|
1224
|
+
destroy() {
|
|
1225
|
+
this.clearGcTimeout();
|
|
1226
|
+
}
|
|
1227
|
+
scheduleGc() {
|
|
1228
|
+
this.clearGcTimeout(), zn(this.gcTime) && (this.#e = j.setTimeout(() => {
|
|
1229
|
+
this.optionalRemove();
|
|
1230
|
+
}, this.gcTime));
|
|
1231
|
+
}
|
|
1232
|
+
updateGcTime(e2) {
|
|
1233
|
+
this.gcTime = Math.max(this.gcTime || 0, e2 ?? (L.isServer() ? 1 / 0 : 3e5));
|
|
1234
|
+
}
|
|
1235
|
+
clearGcTimeout() {
|
|
1236
|
+
this.#e !== void 0 && (j.clearTimeout(this.#e), this.#e = void 0);
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
1239
|
+
function mr(e2) {
|
|
1240
|
+
return { onFetch: (t2, n2) => {
|
|
1241
|
+
let r2 = t2.options, i2 = t2.fetchOptions?.meta?.fetchMore?.direction, a2 = t2.state.data?.pages || [], o2 = t2.state.data?.pageParams || [], s2 = { pages: [], pageParams: [] }, c2 = 0, l2 = async () => {
|
|
1242
|
+
let n3 = false, l3 = (e3) => {
|
|
1243
|
+
ir(e3, () => t2.signal, () => n3 = true);
|
|
1244
|
+
}, u2 = nr(t2.options, t2.fetchOptions), d2 = async (e3, r3, i3) => {
|
|
1245
|
+
if (n3) return Promise.reject(t2.signal.reason);
|
|
1246
|
+
if (r3 == null && e3.pages.length) return Promise.resolve(e3);
|
|
1247
|
+
let a3 = (() => {
|
|
1248
|
+
let e4 = { client: t2.client, queryKey: t2.queryKey, pageParam: r3, direction: i3 ? `backward` : `forward`, meta: t2.options.meta };
|
|
1249
|
+
return l3(e4), e4;
|
|
1250
|
+
})(), o3 = await u2(a3), { maxPages: s3 } = t2.options, c3 = i3 ? er : $n;
|
|
1251
|
+
return { pages: c3(e3.pages, o3, s3), pageParams: c3(e3.pageParams, r3, s3) };
|
|
1252
|
+
};
|
|
1253
|
+
if (i2 && a2.length) {
|
|
1254
|
+
let e3 = i2 === `backward`, t3 = e3 ? gr : hr, n4 = { pages: a2, pageParams: o2 };
|
|
1255
|
+
s2 = await d2(n4, t3(r2, n4), e3);
|
|
1256
|
+
} else {
|
|
1257
|
+
let t3 = e2 ?? a2.length;
|
|
1258
|
+
do {
|
|
1259
|
+
let e3 = c2 === 0 ? o2[0] ?? r2.initialPageParam : hr(r2, s2);
|
|
1260
|
+
if (c2 > 0 && e3 == null) break;
|
|
1261
|
+
s2 = await d2(s2, e3), c2++;
|
|
1262
|
+
} while (c2 < t3);
|
|
1263
|
+
}
|
|
1264
|
+
return s2;
|
|
1265
|
+
};
|
|
1266
|
+
t2.fetchFn = t2.options.persister ? () => t2.options.persister?.(l2, { client: t2.client, queryKey: t2.queryKey, meta: t2.options.meta, signal: t2.signal }, n2) : l2;
|
|
1267
|
+
} };
|
|
1268
|
+
}
|
|
1269
|
+
function hr(e2, { pages: t2, pageParams: n2 }) {
|
|
1270
|
+
let r2 = t2.length - 1;
|
|
1271
|
+
return t2.length > 0 ? e2.getNextPageParam(t2[r2], t2, n2[r2], n2) : void 0;
|
|
1272
|
+
}
|
|
1273
|
+
function gr(e2, { pages: t2, pageParams: n2 }) {
|
|
1274
|
+
return t2.length > 0 ? e2.getPreviousPageParam?.(t2[0], t2, n2[0], n2) : void 0;
|
|
1275
|
+
}
|
|
1276
|
+
function _r(e2, t2) {
|
|
1277
|
+
return t2 ? hr(e2, t2) != null : false;
|
|
1278
|
+
}
|
|
1279
|
+
function vr(e2, t2) {
|
|
1280
|
+
return !t2 || !e2.getPreviousPageParam ? false : gr(e2, t2) != null;
|
|
1281
|
+
}
|
|
1282
|
+
var yr = class extends pr {
|
|
1283
|
+
#e;
|
|
1284
|
+
#t;
|
|
1285
|
+
#n;
|
|
1286
|
+
#r;
|
|
1287
|
+
#i;
|
|
1288
|
+
#a;
|
|
1289
|
+
#o;
|
|
1290
|
+
#s;
|
|
1291
|
+
constructor(e2) {
|
|
1292
|
+
super(), this.#s = false, this.#o = e2.defaultOptions, this.setOptions(e2.options), this.observers = [], this.#i = e2.client, this.#r = this.#i.getQueryCache(), this.queryKey = e2.queryKey, this.queryHash = e2.queryHash, this.#t = Sr(this.options), this.state = e2.state ?? this.#t, this.scheduleGc();
|
|
1293
|
+
}
|
|
1294
|
+
get meta() {
|
|
1295
|
+
return this.options.meta;
|
|
1296
|
+
}
|
|
1297
|
+
get queryType() {
|
|
1298
|
+
return this.#e;
|
|
1299
|
+
}
|
|
1300
|
+
get promise() {
|
|
1301
|
+
return this.#a?.promise;
|
|
1302
|
+
}
|
|
1303
|
+
setOptions(e2) {
|
|
1304
|
+
if (this.options = { ...this.#o, ...e2 }, e2?._type && (this.#e = e2._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
|
|
1305
|
+
let e3 = Sr(this.options);
|
|
1306
|
+
e3.data !== void 0 && (this.setState(xr(e3.data, e3.dataUpdatedAt)), this.#t = e3);
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
optionalRemove() {
|
|
1310
|
+
!this.observers.length && this.state.fetchStatus === `idle` && this.#r.remove(this);
|
|
1311
|
+
}
|
|
1312
|
+
setData(e2, t2) {
|
|
1313
|
+
let n2 = Zn(this.state.data, e2, this.options);
|
|
1314
|
+
return this.#l({ data: n2, type: `success`, dataUpdatedAt: t2?.updatedAt, manual: t2?.manual }), n2;
|
|
1315
|
+
}
|
|
1316
|
+
setState(e2) {
|
|
1317
|
+
this.#l({ type: `setState`, state: e2 });
|
|
1318
|
+
}
|
|
1319
|
+
cancel(e2) {
|
|
1320
|
+
let t2 = this.#a?.promise;
|
|
1321
|
+
return this.#a?.cancel(e2), t2 ? t2.then(M).catch(M) : Promise.resolve();
|
|
1322
|
+
}
|
|
1323
|
+
destroy() {
|
|
1324
|
+
super.destroy(), this.cancel({ silent: true });
|
|
1325
|
+
}
|
|
1326
|
+
get resetState() {
|
|
1327
|
+
return this.#t;
|
|
1328
|
+
}
|
|
1329
|
+
reset() {
|
|
1330
|
+
this.destroy(), this.setState(this.resetState);
|
|
1331
|
+
}
|
|
1332
|
+
isActive() {
|
|
1333
|
+
return this.observers.some((e2) => P(e2.options.enabled, this) !== false);
|
|
1334
|
+
}
|
|
1335
|
+
isDisabled() {
|
|
1336
|
+
return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === tr || !this.isFetched();
|
|
1337
|
+
}
|
|
1338
|
+
isFetched() {
|
|
1339
|
+
return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
|
|
1340
|
+
}
|
|
1341
|
+
isStatic() {
|
|
1342
|
+
return this.getObserversCount() > 0 && this.observers.some((e2) => N(e2.options.staleTime, this) === `static`);
|
|
1343
|
+
}
|
|
1344
|
+
isStale() {
|
|
1345
|
+
return this.getObserversCount() > 0 ? this.observers.some((e2) => e2.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
|
|
1346
|
+
}
|
|
1347
|
+
isStaleByTime(e2 = 0) {
|
|
1348
|
+
return this.state.data === void 0 ? true : e2 === `static` ? false : this.state.isInvalidated ? true : !Bn(this.state.dataUpdatedAt, e2);
|
|
1349
|
+
}
|
|
1350
|
+
onFocus() {
|
|
1351
|
+
this.observers.find((e2) => e2.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false }), this.#a?.continue();
|
|
1352
|
+
}
|
|
1353
|
+
onOnline() {
|
|
1354
|
+
this.observers.find((e2) => e2.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false }), this.#a?.continue();
|
|
1355
|
+
}
|
|
1356
|
+
addObserver(e2) {
|
|
1357
|
+
this.observers.includes(e2) || (this.observers.push(e2), this.clearGcTimeout(), this.#r.notify({ type: `observerAdded`, query: this, observer: e2 }));
|
|
1358
|
+
}
|
|
1359
|
+
removeObserver(e2) {
|
|
1360
|
+
this.observers.includes(e2) && (this.observers = this.observers.filter((t2) => t2 !== e2), this.observers.length || (this.#a && (this.#s || this.#c() ? this.#a.cancel({ revert: true }) : this.#a.cancelRetry()), this.scheduleGc()), this.#r.notify({ type: `observerRemoved`, query: this, observer: e2 }));
|
|
1361
|
+
}
|
|
1362
|
+
getObserversCount() {
|
|
1363
|
+
return this.observers.length;
|
|
1364
|
+
}
|
|
1365
|
+
#c() {
|
|
1366
|
+
return this.state.fetchStatus === `paused` && this.state.status === `pending`;
|
|
1367
|
+
}
|
|
1368
|
+
invalidate() {
|
|
1369
|
+
this.state.isInvalidated || this.#l({ type: `invalidate` });
|
|
1370
|
+
}
|
|
1371
|
+
async fetch(e2, t2) {
|
|
1372
|
+
if (this.state.fetchStatus !== `idle` && this.#a?.status() !== `rejected`) {
|
|
1373
|
+
if (this.state.data !== void 0 && t2?.cancelRefetch) this.cancel({ silent: true });
|
|
1374
|
+
else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
|
|
1375
|
+
}
|
|
1376
|
+
if (e2 && this.setOptions(e2), !this.options.queryFn) {
|
|
1377
|
+
let e3 = this.observers.find((e4) => e4.options.queryFn);
|
|
1378
|
+
e3 && this.setOptions(e3.options);
|
|
1379
|
+
}
|
|
1380
|
+
let n2 = new AbortController(), r2 = (e3) => {
|
|
1381
|
+
Object.defineProperty(e3, "signal", { enumerable: true, get: () => (this.#s = true, n2.signal) });
|
|
1382
|
+
}, i2 = () => {
|
|
1383
|
+
let e3 = nr(this.options, t2), n3 = (() => {
|
|
1384
|
+
let e4 = { client: this.#i, queryKey: this.queryKey, meta: this.meta };
|
|
1385
|
+
return r2(e4), e4;
|
|
1386
|
+
})();
|
|
1387
|
+
return this.#s = false, this.options.persister ? this.options.persister(e3, n3, this) : e3(n3);
|
|
1388
|
+
}, a2 = (() => {
|
|
1389
|
+
let e3 = { fetchOptions: t2, options: this.options, queryKey: this.queryKey, client: this.#i, state: this.state, fetchFn: i2 };
|
|
1390
|
+
return r2(e3), e3;
|
|
1391
|
+
})();
|
|
1392
|
+
(this.#e === `infinite` ? mr(this.options.pages) : this.options.behavior)?.onFetch(a2, this), this.#n = this.state, (this.state.fetchStatus === `idle` || this.state.fetchMeta !== a2.fetchOptions?.meta) && this.#l({ type: `fetch`, meta: a2.fetchOptions?.meta }), this.#a = fr({ initialPromise: t2?.initialPromise, fn: a2.fetchFn, onCancel: (e3) => {
|
|
1393
|
+
e3 instanceof dr && e3.revert && this.setState({ ...this.#n, fetchStatus: `idle` }), n2.abort();
|
|
1394
|
+
}, onFail: (e3, t3) => {
|
|
1395
|
+
this.#l({ type: `failed`, failureCount: e3, error: t3 });
|
|
1396
|
+
}, onPause: () => {
|
|
1397
|
+
this.#l({ type: `pause` });
|
|
1398
|
+
}, onContinue: () => {
|
|
1399
|
+
this.#l({ type: `continue` });
|
|
1400
|
+
}, retry: a2.options.retry, retryDelay: a2.options.retryDelay, networkMode: a2.options.networkMode, canRun: () => true });
|
|
1401
|
+
try {
|
|
1402
|
+
let e3 = await this.#a.start();
|
|
1403
|
+
if (e3 === void 0) throw Error(`${this.queryHash} data is undefined`);
|
|
1404
|
+
return this.setData(e3), this.#r.config.onSuccess?.(e3, this), this.#r.config.onSettled?.(e3, this.state.error, this), e3;
|
|
1405
|
+
} catch (e3) {
|
|
1406
|
+
if (e3 instanceof dr) {
|
|
1407
|
+
if (e3.silent) return this.#a.promise;
|
|
1408
|
+
if (e3.revert) {
|
|
1409
|
+
if (this.state.data === void 0) throw e3;
|
|
1410
|
+
return this.state.data;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
throw this.#l({ type: `error`, error: e3 }), this.#r.config.onError?.(e3, this), this.#r.config.onSettled?.(this.state.data, e3, this), e3;
|
|
1414
|
+
} finally {
|
|
1415
|
+
this.scheduleGc();
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
#l(e2) {
|
|
1419
|
+
let t2 = (t3) => {
|
|
1420
|
+
switch (e2.type) {
|
|
1421
|
+
case `failed`:
|
|
1422
|
+
return { ...t3, fetchFailureCount: e2.failureCount, fetchFailureReason: e2.error };
|
|
1423
|
+
case `pause`:
|
|
1424
|
+
return { ...t3, fetchStatus: `paused` };
|
|
1425
|
+
case `continue`:
|
|
1426
|
+
return { ...t3, fetchStatus: `fetching` };
|
|
1427
|
+
case `fetch`:
|
|
1428
|
+
return { ...t3, ...br(t3.data, this.options), fetchMeta: e2.meta ?? null };
|
|
1429
|
+
case `success`:
|
|
1430
|
+
let n2 = { ...t3, ...xr(e2.data, e2.dataUpdatedAt), dataUpdateCount: t3.dataUpdateCount + 1, ...!e2.manual && { fetchStatus: `idle`, fetchFailureCount: 0, fetchFailureReason: null } };
|
|
1431
|
+
return this.#n = e2.manual ? n2 : void 0, n2;
|
|
1432
|
+
case `error`:
|
|
1433
|
+
let r2 = e2.error;
|
|
1434
|
+
return { ...t3, error: r2, errorUpdateCount: t3.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: t3.fetchFailureCount + 1, fetchFailureReason: r2, fetchStatus: `idle`, status: `error`, isInvalidated: true };
|
|
1435
|
+
case `invalidate`:
|
|
1436
|
+
return { ...t3, isInvalidated: true };
|
|
1437
|
+
case `setState`:
|
|
1438
|
+
return { ...t3, ...e2.state };
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
this.state = t2(this.state), R.batch(() => {
|
|
1442
|
+
this.observers.forEach((e3) => {
|
|
1443
|
+
e3.onQueryUpdate();
|
|
1444
|
+
}), this.#r.notify({ query: this, type: `updated`, action: e2 });
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
};
|
|
1448
|
+
function br(e2, t2) {
|
|
1449
|
+
return { fetchFailureCount: 0, fetchFailureReason: null, fetchStatus: ur(t2.networkMode) ? `fetching` : `paused`, ...e2 === void 0 && { error: null, status: `pending` } };
|
|
1450
|
+
}
|
|
1451
|
+
function xr(e2, t2) {
|
|
1452
|
+
return { data: e2, dataUpdatedAt: t2 ?? Date.now(), error: null, isInvalidated: false, status: `success` };
|
|
1453
|
+
}
|
|
1454
|
+
function Sr(e2) {
|
|
1455
|
+
let t2 = typeof e2.initialData == `function` ? e2.initialData() : e2.initialData, n2 = t2 !== void 0, r2 = n2 ? typeof e2.initialDataUpdatedAt == `function` ? e2.initialDataUpdatedAt() : e2.initialDataUpdatedAt : 0;
|
|
1456
|
+
return { data: t2, dataUpdateCount: 0, dataUpdatedAt: n2 ? r2 ?? Date.now() : 0, error: null, errorUpdateCount: 0, errorUpdatedAt: 0, fetchFailureCount: 0, fetchFailureReason: null, fetchMeta: null, isInvalidated: false, status: n2 ? `success` : `pending`, fetchStatus: `idle` };
|
|
1457
|
+
}
|
|
1458
|
+
var Cr = class extends Nn {
|
|
1459
|
+
constructor(e2, t2) {
|
|
1460
|
+
super(), this.options = t2, this.#e = e2, this.#s = null, this.#o = ar(), this.bindMethods(), this.setOptions(t2);
|
|
1461
|
+
}
|
|
1462
|
+
#e;
|
|
1463
|
+
#t = void 0;
|
|
1464
|
+
#n = void 0;
|
|
1465
|
+
#r = void 0;
|
|
1466
|
+
#i;
|
|
1467
|
+
#a;
|
|
1468
|
+
#o;
|
|
1469
|
+
#s;
|
|
1470
|
+
#c;
|
|
1471
|
+
#l;
|
|
1472
|
+
#u;
|
|
1473
|
+
#d;
|
|
1474
|
+
#f;
|
|
1475
|
+
#p;
|
|
1476
|
+
#m = /* @__PURE__ */ new Set();
|
|
1477
|
+
bindMethods() {
|
|
1478
|
+
this.refetch = this.refetch.bind(this);
|
|
1479
|
+
}
|
|
1480
|
+
onSubscribe() {
|
|
1481
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), Tr(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
|
|
1482
|
+
}
|
|
1483
|
+
onUnsubscribe() {
|
|
1484
|
+
this.hasListeners() || this.destroy();
|
|
1485
|
+
}
|
|
1486
|
+
shouldFetchOnReconnect() {
|
|
1487
|
+
return Er(this.#t, this.options, this.options.refetchOnReconnect);
|
|
1488
|
+
}
|
|
1489
|
+
shouldFetchOnWindowFocus() {
|
|
1490
|
+
return Er(this.#t, this.options, this.options.refetchOnWindowFocus);
|
|
1491
|
+
}
|
|
1492
|
+
destroy() {
|
|
1493
|
+
this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
|
|
1494
|
+
}
|
|
1495
|
+
setOptions(e2) {
|
|
1496
|
+
let t2 = this.options, n2 = this.#t;
|
|
1497
|
+
if (this.options = this.#e.defaultQueryOptions(e2), this.options.enabled !== void 0 && typeof this.options.enabled != `boolean` && typeof this.options.enabled != `function` && typeof P(this.options.enabled, this.#t) != `boolean`) throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);
|
|
1498
|
+
this.#S(), this.#t.setOptions(this.options), t2._defaulted && !Kn(this.options, t2) && this.#e.getQueryCache().notify({ type: `observerOptionsUpdated`, query: this.#t, observer: this });
|
|
1499
|
+
let r2 = this.hasListeners();
|
|
1500
|
+
r2 && Dr(this.#t, n2, this.options, t2) && this.#h(), this.updateResult(), r2 && (this.#t !== n2 || P(this.options.enabled, this.#t) !== P(t2.enabled, this.#t) || N(this.options.staleTime, this.#t) !== N(t2.staleTime, this.#t)) && this.#g();
|
|
1501
|
+
let i2 = this.#_();
|
|
1502
|
+
r2 && (this.#t !== n2 || P(this.options.enabled, this.#t) !== P(t2.enabled, this.#t) || i2 !== this.#p) && this.#v(i2);
|
|
1503
|
+
}
|
|
1504
|
+
getOptimisticResult(e2) {
|
|
1505
|
+
let t2 = this.#e.getQueryCache().build(this.#e, e2), n2 = this.createResult(t2, e2);
|
|
1506
|
+
return kr(this, n2) && (this.#r = n2, this.#a = this.options, this.#i = this.#t.state), n2;
|
|
1507
|
+
}
|
|
1508
|
+
getCurrentResult() {
|
|
1509
|
+
return this.#r;
|
|
1510
|
+
}
|
|
1511
|
+
trackResult(e2, t2) {
|
|
1512
|
+
return new Proxy(e2, { get: (e3, n2) => (this.trackProp(n2), t2?.(n2), n2 === `promise` && (this.trackProp(`data`), !this.options.experimental_prefetchInRender && this.#o.status === `pending` && this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))), Reflect.get(e3, n2)) });
|
|
1513
|
+
}
|
|
1514
|
+
trackProp(e2) {
|
|
1515
|
+
this.#m.add(e2);
|
|
1516
|
+
}
|
|
1517
|
+
getCurrentQuery() {
|
|
1518
|
+
return this.#t;
|
|
1519
|
+
}
|
|
1520
|
+
refetch({ ...e2 } = {}) {
|
|
1521
|
+
return this.fetch({ ...e2 });
|
|
1522
|
+
}
|
|
1523
|
+
fetchOptimistic(e2) {
|
|
1524
|
+
let t2 = this.#e.defaultQueryOptions(e2), n2 = this.#e.getQueryCache().build(this.#e, t2);
|
|
1525
|
+
return n2.fetch().then(() => this.createResult(n2, t2));
|
|
1526
|
+
}
|
|
1527
|
+
fetch(e2) {
|
|
1528
|
+
return this.#h({ ...e2, cancelRefetch: e2.cancelRefetch ?? true }).then(() => (this.updateResult(), this.#r));
|
|
1529
|
+
}
|
|
1530
|
+
#h(e2) {
|
|
1531
|
+
this.#S();
|
|
1532
|
+
let t2 = this.#t.fetch(this.options, e2);
|
|
1533
|
+
return e2?.throwOnError || (t2 = t2.catch(M)), t2;
|
|
1534
|
+
}
|
|
1535
|
+
#g() {
|
|
1536
|
+
this.#b();
|
|
1537
|
+
let e2 = N(this.options.staleTime, this.#t);
|
|
1538
|
+
if (L.isServer() || this.#r.isStale || !zn(e2)) return;
|
|
1539
|
+
let t2 = Bn(this.#r.dataUpdatedAt, e2) + 1;
|
|
1540
|
+
this.#d = j.setTimeout(() => {
|
|
1541
|
+
this.#r.isStale || this.updateResult();
|
|
1542
|
+
}, t2);
|
|
1543
|
+
}
|
|
1544
|
+
#_() {
|
|
1545
|
+
return (typeof this.options.refetchInterval == `function` ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? false;
|
|
1546
|
+
}
|
|
1547
|
+
#v(e2) {
|
|
1548
|
+
this.#x(), this.#p = e2, !L.isServer() && P(this.options.enabled, this.#t) !== false && zn(this.#p) && this.#p !== 0 && (this.#f = j.setInterval(() => {
|
|
1549
|
+
(this.options.refetchIntervalInBackground || Pn.isFocused()) && this.#h();
|
|
1550
|
+
}, this.#p));
|
|
1551
|
+
}
|
|
1552
|
+
#y() {
|
|
1553
|
+
this.#g(), this.#v(this.#_());
|
|
1554
|
+
}
|
|
1555
|
+
#b() {
|
|
1556
|
+
this.#d !== void 0 && (j.clearTimeout(this.#d), this.#d = void 0);
|
|
1557
|
+
}
|
|
1558
|
+
#x() {
|
|
1559
|
+
this.#f !== void 0 && (j.clearInterval(this.#f), this.#f = void 0);
|
|
1560
|
+
}
|
|
1561
|
+
createResult(e2, t2) {
|
|
1562
|
+
let n2 = this.#t, r2 = this.options, i2 = this.#r, a2 = this.#i, o2 = this.#a, s2 = e2 === n2 ? this.#n : e2.state, { state: c2 } = e2, l2 = { ...c2 }, u2 = false, d2;
|
|
1563
|
+
if (t2._optimisticResults) {
|
|
1564
|
+
let i3 = this.hasListeners(), a3 = !i3 && Tr(e2, t2), o3 = i3 && Dr(e2, n2, t2, r2);
|
|
1565
|
+
(a3 || o3) && (l2 = { ...l2, ...br(c2.data, e2.options) }), t2._optimisticResults === `isRestoring` && (l2.fetchStatus = `idle`);
|
|
1566
|
+
}
|
|
1567
|
+
let { error: f2, errorUpdatedAt: p2, status: m2 } = l2;
|
|
1568
|
+
d2 = l2.data;
|
|
1569
|
+
let ee2 = false;
|
|
1570
|
+
if (t2.placeholderData !== void 0 && d2 === void 0 && m2 === `pending`) {
|
|
1571
|
+
let e3;
|
|
1572
|
+
i2?.isPlaceholderData && t2.placeholderData === o2?.placeholderData ? (e3 = i2.data, ee2 = true) : e3 = typeof t2.placeholderData == `function` ? t2.placeholderData(this.#u?.state.data, this.#u) : t2.placeholderData, e3 !== void 0 && (m2 = `success`, d2 = Zn(i2?.data, e3, t2), u2 = true);
|
|
1573
|
+
}
|
|
1574
|
+
if (t2.select && d2 !== void 0 && !ee2) {
|
|
1575
|
+
if (i2 && d2 === a2?.data && t2.select === this.#c) d2 = this.#l;
|
|
1576
|
+
else try {
|
|
1577
|
+
this.#c = t2.select, d2 = t2.select(d2), d2 = Zn(i2?.data, d2, t2), this.#l = d2, this.#s = null;
|
|
1578
|
+
} catch (e3) {
|
|
1579
|
+
this.#s = e3;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
this.#s && (f2 = this.#s, d2 = this.#l, p2 = Date.now(), m2 = `error`);
|
|
1583
|
+
let h2 = l2.fetchStatus === `fetching`, g2 = m2 === `pending`, te2 = m2 === `error`, ne2 = g2 && h2, _2 = d2 !== void 0, v2 = { status: m2, fetchStatus: l2.fetchStatus, isPending: g2, isSuccess: m2 === `success`, isError: te2, isInitialLoading: ne2, isLoading: ne2, data: d2, dataUpdatedAt: l2.dataUpdatedAt, error: f2, errorUpdatedAt: p2, failureCount: l2.fetchFailureCount, failureReason: l2.fetchFailureReason, errorUpdateCount: l2.errorUpdateCount, isFetched: e2.isFetched(), isFetchedAfterMount: l2.dataUpdateCount > s2.dataUpdateCount || l2.errorUpdateCount > s2.errorUpdateCount, isFetching: h2, isRefetching: h2 && !g2, isLoadingError: te2 && !_2, isPaused: l2.fetchStatus === `paused`, isPlaceholderData: u2, isRefetchError: te2 && _2, isStale: Or(e2, t2), refetch: this.refetch, promise: this.#o, isEnabled: P(t2.enabled, e2) !== false };
|
|
1584
|
+
if (this.options.experimental_prefetchInRender) {
|
|
1585
|
+
let t3 = v2.data !== void 0, r3 = v2.status === `error` && !t3, i3 = (e3) => {
|
|
1586
|
+
r3 ? e3.reject(v2.error) : t3 && e3.resolve(v2.data);
|
|
1587
|
+
}, a3 = () => {
|
|
1588
|
+
let e3 = this.#o = v2.promise = ar();
|
|
1589
|
+
i3(e3);
|
|
1590
|
+
}, o3 = this.#o;
|
|
1591
|
+
switch (o3.status) {
|
|
1592
|
+
case `pending`:
|
|
1593
|
+
e2.queryHash === n2.queryHash && i3(o3);
|
|
1594
|
+
break;
|
|
1595
|
+
case `fulfilled`:
|
|
1596
|
+
(r3 || v2.data !== o3.value) && a3();
|
|
1597
|
+
break;
|
|
1598
|
+
case `rejected`:
|
|
1599
|
+
(!r3 || v2.error !== o3.reason) && a3();
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
return v2;
|
|
1603
|
+
}
|
|
1604
|
+
updateResult() {
|
|
1605
|
+
let e2 = this.#r, t2 = this.createResult(this.#t, this.options);
|
|
1606
|
+
this.#i = this.#t.state, this.#a = this.options, this.#i.data !== void 0 && (this.#u = this.#t), !Kn(t2, e2) && (this.#r = t2, this.#C({ listeners: (() => {
|
|
1607
|
+
if (!e2) return true;
|
|
1608
|
+
let { notifyOnChangeProps: t3 } = this.options, n2 = typeof t3 == `function` ? t3() : t3;
|
|
1609
|
+
if (n2 === `all` || !n2 && !this.#m.size) return true;
|
|
1610
|
+
let r2 = new Set(n2 ?? this.#m);
|
|
1611
|
+
return this.options.throwOnError && r2.add(`error`), Object.keys(this.#r).some((t4) => {
|
|
1612
|
+
let n3 = t4;
|
|
1613
|
+
return this.#r[n3] !== e2[n3] && r2.has(n3);
|
|
1614
|
+
});
|
|
1615
|
+
})() }));
|
|
1616
|
+
}
|
|
1617
|
+
#S() {
|
|
1618
|
+
let e2 = this.#e.getQueryCache().build(this.#e, this.options);
|
|
1619
|
+
if (e2 === this.#t) return;
|
|
1620
|
+
let t2 = this.#t;
|
|
1621
|
+
this.#t = e2, this.#n = e2.state, this.hasListeners() && (t2?.removeObserver(this), e2.addObserver(this));
|
|
1622
|
+
}
|
|
1623
|
+
onQueryUpdate() {
|
|
1624
|
+
this.updateResult(), this.hasListeners() && this.#y();
|
|
1625
|
+
}
|
|
1626
|
+
#C(e2) {
|
|
1627
|
+
R.batch(() => {
|
|
1628
|
+
e2.listeners && this.listeners.forEach((e3) => {
|
|
1629
|
+
e3(this.#r);
|
|
1630
|
+
}), this.#e.getQueryCache().notify({ query: this.#t, type: `observerResultsUpdated` });
|
|
1631
|
+
});
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
function wr(e2, t2) {
|
|
1635
|
+
return P(t2.enabled, e2) !== false && e2.state.data === void 0 && (e2.state.status !== `error` || P(t2.retryOnMount, e2) !== false);
|
|
1636
|
+
}
|
|
1637
|
+
function Tr(e2, t2) {
|
|
1638
|
+
return wr(e2, t2) || e2.state.data !== void 0 && Er(e2, t2, t2.refetchOnMount);
|
|
1639
|
+
}
|
|
1640
|
+
function Er(e2, t2, n2) {
|
|
1641
|
+
if (P(t2.enabled, e2) !== false && N(t2.staleTime, e2) !== `static`) {
|
|
1642
|
+
let r2 = typeof n2 == `function` ? n2(e2) : n2;
|
|
1643
|
+
return r2 === `always` || r2 !== false && Or(e2, t2);
|
|
1644
|
+
}
|
|
1645
|
+
return false;
|
|
1646
|
+
}
|
|
1647
|
+
function Dr(e2, t2, n2, r2) {
|
|
1648
|
+
return (e2 !== t2 || P(r2.enabled, e2) === false) && (!n2.suspense || e2.state.status !== `error`) && Or(e2, n2);
|
|
1649
|
+
}
|
|
1650
|
+
function Or(e2, t2) {
|
|
1651
|
+
return P(t2.enabled, e2) !== false && e2.isStaleByTime(N(t2.staleTime, e2));
|
|
1652
|
+
}
|
|
1653
|
+
function kr(e2, t2) {
|
|
1654
|
+
return !Kn(e2.getCurrentResult(), t2);
|
|
1655
|
+
}
|
|
1656
|
+
var Ar = class extends Cr {
|
|
1657
|
+
constructor(e2, t2) {
|
|
1658
|
+
super(e2, t2);
|
|
1659
|
+
}
|
|
1660
|
+
bindMethods() {
|
|
1661
|
+
super.bindMethods(), this.fetchNextPage = this.fetchNextPage.bind(this), this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
1662
|
+
}
|
|
1663
|
+
setOptions(e2) {
|
|
1664
|
+
e2._type = `infinite`, super.setOptions(e2);
|
|
1665
|
+
}
|
|
1666
|
+
getOptimisticResult(e2) {
|
|
1667
|
+
return e2._type = `infinite`, super.getOptimisticResult(e2);
|
|
1668
|
+
}
|
|
1669
|
+
fetchNextPage(e2) {
|
|
1670
|
+
return this.fetch({ ...e2, meta: { fetchMore: { direction: `forward` } } });
|
|
1671
|
+
}
|
|
1672
|
+
fetchPreviousPage(e2) {
|
|
1673
|
+
return this.fetch({ ...e2, meta: { fetchMore: { direction: `backward` } } });
|
|
1674
|
+
}
|
|
1675
|
+
createResult(e2, t2) {
|
|
1676
|
+
let { state: n2 } = e2, r2 = super.createResult(e2, t2), { isFetching: i2, isRefetching: a2, isError: o2, isRefetchError: s2 } = r2, c2 = n2.fetchMeta?.fetchMore?.direction, l2 = o2 && c2 === `forward`, u2 = i2 && c2 === `forward`, d2 = o2 && c2 === `backward`, f2 = i2 && c2 === `backward`;
|
|
1677
|
+
return { ...r2, fetchNextPage: this.fetchNextPage, fetchPreviousPage: this.fetchPreviousPage, hasNextPage: _r(t2, n2.data), hasPreviousPage: vr(t2, n2.data), isFetchNextPageError: l2, isFetchingNextPage: u2, isFetchPreviousPageError: d2, isFetchingPreviousPage: f2, isRefetchError: s2 && !l2 && !d2, isRefetching: a2 && !u2 && !f2 };
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
var jr = class extends pr {
|
|
1681
|
+
#e;
|
|
1682
|
+
#t;
|
|
1683
|
+
#n;
|
|
1684
|
+
#r;
|
|
1685
|
+
constructor(e2) {
|
|
1686
|
+
super(), this.#e = e2.client, this.mutationId = e2.mutationId, this.#n = e2.mutationCache, this.#t = [], this.state = e2.state || Mr(), this.setOptions(e2.options), this.scheduleGc();
|
|
1687
|
+
}
|
|
1688
|
+
setOptions(e2) {
|
|
1689
|
+
this.options = e2, this.updateGcTime(this.options.gcTime);
|
|
1690
|
+
}
|
|
1691
|
+
get meta() {
|
|
1692
|
+
return this.options.meta;
|
|
1693
|
+
}
|
|
1694
|
+
addObserver(e2) {
|
|
1695
|
+
this.#t.includes(e2) || (this.#t.push(e2), this.clearGcTimeout(), this.#n.notify({ type: `observerAdded`, mutation: this, observer: e2 }));
|
|
1696
|
+
}
|
|
1697
|
+
removeObserver(e2) {
|
|
1698
|
+
this.#t = this.#t.filter((t2) => t2 !== e2), this.scheduleGc(), this.#n.notify({ type: `observerRemoved`, mutation: this, observer: e2 });
|
|
1699
|
+
}
|
|
1700
|
+
optionalRemove() {
|
|
1701
|
+
this.#t.length || (this.state.status === `pending` ? this.scheduleGc() : this.#n.remove(this));
|
|
1702
|
+
}
|
|
1703
|
+
continue() {
|
|
1704
|
+
return this.#r?.continue() ?? this.execute(this.state.variables);
|
|
1705
|
+
}
|
|
1706
|
+
async execute(e2) {
|
|
1707
|
+
let t2 = () => {
|
|
1708
|
+
this.#i({ type: `continue` });
|
|
1709
|
+
}, n2 = { client: this.#e, meta: this.options.meta, mutationKey: this.options.mutationKey };
|
|
1710
|
+
this.#r = fr({ fn: () => this.options.mutationFn ? this.options.mutationFn(e2, n2) : Promise.reject(Error(`No mutationFn found`)), onFail: (e3, t3) => {
|
|
1711
|
+
this.#i({ type: `failed`, failureCount: e3, error: t3 });
|
|
1712
|
+
}, onPause: () => {
|
|
1713
|
+
this.#i({ type: `pause` });
|
|
1714
|
+
}, onContinue: t2, retry: this.options.retry ?? 0, retryDelay: this.options.retryDelay, networkMode: this.options.networkMode, canRun: () => this.#n.canRun(this) });
|
|
1715
|
+
let r2 = this.state.status === `pending`, i2 = !this.#r.canStart();
|
|
1716
|
+
try {
|
|
1717
|
+
if (r2) t2();
|
|
1718
|
+
else {
|
|
1719
|
+
this.#i({ type: `pending`, variables: e2, isPaused: i2 }), this.#n.config.onMutate && await this.#n.config.onMutate(e2, this, n2);
|
|
1720
|
+
let t3 = await this.options.onMutate?.(e2, n2);
|
|
1721
|
+
t3 !== this.state.context && this.#i({ type: `pending`, context: t3, variables: e2, isPaused: i2 });
|
|
1722
|
+
}
|
|
1723
|
+
let a2 = await this.#r.start();
|
|
1724
|
+
return await this.#n.config.onSuccess?.(a2, e2, this.state.context, this, n2), await this.options.onSuccess?.(a2, e2, this.state.context, n2), await this.#n.config.onSettled?.(a2, null, this.state.variables, this.state.context, this, n2), await this.options.onSettled?.(a2, null, e2, this.state.context, n2), this.#i({ type: `success`, data: a2 }), a2;
|
|
1725
|
+
} catch (t3) {
|
|
1726
|
+
try {
|
|
1727
|
+
await this.#n.config.onError?.(t3, e2, this.state.context, this, n2);
|
|
1728
|
+
} catch (e3) {
|
|
1729
|
+
Promise.reject(e3);
|
|
1730
|
+
}
|
|
1731
|
+
try {
|
|
1732
|
+
await this.options.onError?.(t3, e2, this.state.context, n2);
|
|
1733
|
+
} catch (e3) {
|
|
1734
|
+
Promise.reject(e3);
|
|
1735
|
+
}
|
|
1736
|
+
try {
|
|
1737
|
+
await this.#n.config.onSettled?.(void 0, t3, this.state.variables, this.state.context, this, n2);
|
|
1738
|
+
} catch (e3) {
|
|
1739
|
+
Promise.reject(e3);
|
|
1740
|
+
}
|
|
1741
|
+
try {
|
|
1742
|
+
await this.options.onSettled?.(void 0, t3, e2, this.state.context, n2);
|
|
1743
|
+
} catch (e3) {
|
|
1744
|
+
Promise.reject(e3);
|
|
1745
|
+
}
|
|
1746
|
+
throw this.#i({ type: `error`, error: t3 }), t3;
|
|
1747
|
+
} finally {
|
|
1748
|
+
this.#n.runNext(this);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
#i(e2) {
|
|
1752
|
+
let t2 = (t3) => {
|
|
1753
|
+
switch (e2.type) {
|
|
1754
|
+
case `failed`:
|
|
1755
|
+
return { ...t3, failureCount: e2.failureCount, failureReason: e2.error };
|
|
1756
|
+
case `pause`:
|
|
1757
|
+
return { ...t3, isPaused: true };
|
|
1758
|
+
case `continue`:
|
|
1759
|
+
return { ...t3, isPaused: false };
|
|
1760
|
+
case `pending`:
|
|
1761
|
+
return { ...t3, context: e2.context, data: void 0, failureCount: 0, failureReason: null, error: null, isPaused: e2.isPaused, status: `pending`, variables: e2.variables, submittedAt: Date.now() };
|
|
1762
|
+
case `success`:
|
|
1763
|
+
return { ...t3, data: e2.data, failureCount: 0, failureReason: null, error: null, status: `success`, isPaused: false };
|
|
1764
|
+
case `error`:
|
|
1765
|
+
return { ...t3, data: void 0, error: e2.error, failureCount: t3.failureCount + 1, failureReason: e2.error, isPaused: false, status: `error` };
|
|
1766
|
+
}
|
|
1767
|
+
};
|
|
1768
|
+
this.state = t2(this.state), R.batch(() => {
|
|
1769
|
+
this.#t.forEach((t3) => {
|
|
1770
|
+
t3.onMutationUpdate(e2);
|
|
1771
|
+
}), this.#n.notify({ mutation: this, type: `updated`, action: e2 });
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
function Mr() {
|
|
1776
|
+
return { context: void 0, data: void 0, error: null, failureCount: 0, failureReason: null, isPaused: false, status: `idle`, variables: void 0, submittedAt: 0 };
|
|
1777
|
+
}
|
|
1778
|
+
var Nr = class extends Nn {
|
|
1779
|
+
constructor(e2 = {}) {
|
|
1780
|
+
super(), this.config = e2, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#n = 0;
|
|
1781
|
+
}
|
|
1782
|
+
#e;
|
|
1783
|
+
#t;
|
|
1784
|
+
#n;
|
|
1785
|
+
build(e2, t2, n2) {
|
|
1786
|
+
let r2 = new jr({ client: e2, mutationCache: this, mutationId: ++this.#n, options: e2.defaultMutationOptions(t2), state: n2 });
|
|
1787
|
+
return this.add(r2), r2;
|
|
1788
|
+
}
|
|
1789
|
+
add(e2) {
|
|
1790
|
+
this.#e.add(e2);
|
|
1791
|
+
let t2 = Pr(e2);
|
|
1792
|
+
if (typeof t2 == `string`) {
|
|
1793
|
+
let n2 = this.#t.get(t2);
|
|
1794
|
+
n2 ? n2.push(e2) : this.#t.set(t2, [e2]);
|
|
1795
|
+
}
|
|
1796
|
+
this.notify({ type: `added`, mutation: e2 });
|
|
1797
|
+
}
|
|
1798
|
+
remove(e2) {
|
|
1799
|
+
if (this.#e.delete(e2)) {
|
|
1800
|
+
let t2 = Pr(e2);
|
|
1801
|
+
if (typeof t2 == `string`) {
|
|
1802
|
+
let n2 = this.#t.get(t2);
|
|
1803
|
+
if (n2) {
|
|
1804
|
+
if (n2.length > 1) {
|
|
1805
|
+
let t3 = n2.indexOf(e2);
|
|
1806
|
+
t3 !== -1 && n2.splice(t3, 1);
|
|
1807
|
+
} else n2[0] === e2 && this.#t.delete(t2);
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}
|
|
1811
|
+
this.notify({ type: `removed`, mutation: e2 });
|
|
1812
|
+
}
|
|
1813
|
+
canRun(e2) {
|
|
1814
|
+
let t2 = Pr(e2);
|
|
1815
|
+
if (typeof t2 == `string`) {
|
|
1816
|
+
let n2 = this.#t.get(t2)?.find((e3) => e3.state.status === `pending`);
|
|
1817
|
+
return !n2 || n2 === e2;
|
|
1818
|
+
}
|
|
1819
|
+
return true;
|
|
1820
|
+
}
|
|
1821
|
+
runNext(e2) {
|
|
1822
|
+
let t2 = Pr(e2);
|
|
1823
|
+
return typeof t2 == `string` ? this.#t.get(t2)?.find((t3) => t3 !== e2 && t3.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
|
|
1824
|
+
}
|
|
1825
|
+
clear() {
|
|
1826
|
+
R.batch(() => {
|
|
1827
|
+
this.#e.forEach((e2) => {
|
|
1828
|
+
this.notify({ type: `removed`, mutation: e2 });
|
|
1829
|
+
}), this.#e.clear(), this.#t.clear();
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
getAll() {
|
|
1833
|
+
return Array.from(this.#e);
|
|
1834
|
+
}
|
|
1835
|
+
find(e2) {
|
|
1836
|
+
let t2 = { exact: true, ...e2 };
|
|
1837
|
+
return this.getAll().find((e3) => Hn(t2, e3));
|
|
1838
|
+
}
|
|
1839
|
+
findAll(e2 = {}) {
|
|
1840
|
+
return this.getAll().filter((t2) => Hn(e2, t2));
|
|
1841
|
+
}
|
|
1842
|
+
notify(e2) {
|
|
1843
|
+
R.batch(() => {
|
|
1844
|
+
this.listeners.forEach((t2) => {
|
|
1845
|
+
t2(e2);
|
|
1846
|
+
});
|
|
1847
|
+
});
|
|
1848
|
+
}
|
|
1849
|
+
resumePausedMutations() {
|
|
1850
|
+
let e2 = this.getAll().filter((e3) => e3.state.isPaused);
|
|
1851
|
+
return R.batch(() => Promise.all(e2.map((e3) => e3.continue().catch(M))));
|
|
1852
|
+
}
|
|
1853
|
+
};
|
|
1854
|
+
function Pr(e2) {
|
|
1855
|
+
return e2.options.scope?.id;
|
|
1856
|
+
}
|
|
1857
|
+
var Fr = class extends Nn {
|
|
1858
|
+
constructor(e2 = {}) {
|
|
1859
|
+
super(), this.config = e2, this.#e = /* @__PURE__ */ new Map();
|
|
1860
|
+
}
|
|
1861
|
+
#e;
|
|
1862
|
+
build(e2, t2, n2) {
|
|
1863
|
+
let r2 = t2.queryKey, i2 = t2.queryHash ?? Un(r2, t2), a2 = this.get(i2);
|
|
1864
|
+
return a2 || (a2 = new yr({ client: e2, queryKey: r2, queryHash: i2, options: e2.defaultQueryOptions(t2), state: n2, defaultOptions: e2.getQueryDefaults(r2) }), this.add(a2)), a2;
|
|
1865
|
+
}
|
|
1866
|
+
add(e2) {
|
|
1867
|
+
this.#e.has(e2.queryHash) || (this.#e.set(e2.queryHash, e2), this.notify({ type: `added`, query: e2 }));
|
|
1868
|
+
}
|
|
1869
|
+
remove(e2) {
|
|
1870
|
+
let t2 = this.#e.get(e2.queryHash);
|
|
1871
|
+
t2 && (e2.destroy(), t2 === e2 && this.#e.delete(e2.queryHash), this.notify({ type: `removed`, query: e2 }));
|
|
1872
|
+
}
|
|
1873
|
+
clear() {
|
|
1874
|
+
R.batch(() => {
|
|
1875
|
+
this.getAll().forEach((e2) => {
|
|
1876
|
+
this.remove(e2);
|
|
1877
|
+
});
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
get(e2) {
|
|
1881
|
+
return this.#e.get(e2);
|
|
1882
|
+
}
|
|
1883
|
+
getAll() {
|
|
1884
|
+
return [...this.#e.values()];
|
|
1885
|
+
}
|
|
1886
|
+
find(e2) {
|
|
1887
|
+
let t2 = { exact: true, ...e2 };
|
|
1888
|
+
return this.getAll().find((e3) => Vn(t2, e3));
|
|
1889
|
+
}
|
|
1890
|
+
findAll(e2 = {}) {
|
|
1891
|
+
let t2 = this.getAll();
|
|
1892
|
+
return Object.keys(e2).length > 0 ? t2.filter((t3) => Vn(e2, t3)) : t2;
|
|
1893
|
+
}
|
|
1894
|
+
notify(e2) {
|
|
1895
|
+
R.batch(() => {
|
|
1896
|
+
this.listeners.forEach((t2) => {
|
|
1897
|
+
t2(e2);
|
|
1898
|
+
});
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
onFocus() {
|
|
1902
|
+
R.batch(() => {
|
|
1903
|
+
this.getAll().forEach((e2) => {
|
|
1904
|
+
e2.onFocus();
|
|
1905
|
+
});
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
onOnline() {
|
|
1909
|
+
R.batch(() => {
|
|
1910
|
+
this.getAll().forEach((e2) => {
|
|
1911
|
+
e2.onOnline();
|
|
1912
|
+
});
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
};
|
|
1916
|
+
var Ir = class {
|
|
1917
|
+
#e;
|
|
1918
|
+
#t;
|
|
1919
|
+
#n;
|
|
1920
|
+
#r;
|
|
1921
|
+
#i;
|
|
1922
|
+
#a;
|
|
1923
|
+
#o;
|
|
1924
|
+
#s;
|
|
1925
|
+
constructor(e2 = {}) {
|
|
1926
|
+
this.#e = e2.queryCache || new Fr(), this.#t = e2.mutationCache || new Nr(), this.#n = e2.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
|
|
1927
|
+
}
|
|
1928
|
+
mount() {
|
|
1929
|
+
this.#a++, this.#a === 1 && (this.#o = Pn.subscribe(async (e2) => {
|
|
1930
|
+
e2 && (await this.resumePausedMutations(), this.#e.onFocus());
|
|
1931
|
+
}), this.#s = cr.subscribe(async (e2) => {
|
|
1932
|
+
e2 && (await this.resumePausedMutations(), this.#e.onOnline());
|
|
1933
|
+
}));
|
|
1934
|
+
}
|
|
1935
|
+
unmount() {
|
|
1936
|
+
this.#a--, this.#a === 0 && (this.#o?.(), this.#o = void 0, this.#s?.(), this.#s = void 0);
|
|
1937
|
+
}
|
|
1938
|
+
isFetching(e2) {
|
|
1939
|
+
return this.#e.findAll({ ...e2, fetchStatus: `fetching` }).length;
|
|
1940
|
+
}
|
|
1941
|
+
isMutating(e2) {
|
|
1942
|
+
return this.#t.findAll({ ...e2, status: `pending` }).length;
|
|
1943
|
+
}
|
|
1944
|
+
getQueryData(e2) {
|
|
1945
|
+
let t2 = this.defaultQueryOptions({ queryKey: e2 });
|
|
1946
|
+
return this.#e.get(t2.queryHash)?.state.data;
|
|
1947
|
+
}
|
|
1948
|
+
ensureQueryData(e2) {
|
|
1949
|
+
let t2 = this.defaultQueryOptions(e2), n2 = this.#e.build(this, t2), r2 = n2.state.data;
|
|
1950
|
+
return r2 === void 0 ? this.fetchQuery(e2) : (e2.revalidateIfStale && n2.isStaleByTime(N(t2.staleTime, n2)) && this.prefetchQuery(t2), Promise.resolve(r2));
|
|
1951
|
+
}
|
|
1952
|
+
getQueriesData(e2) {
|
|
1953
|
+
return this.#e.findAll(e2).map(({ queryKey: e3, state: t2 }) => [e3, t2.data]);
|
|
1954
|
+
}
|
|
1955
|
+
setQueryData(e2, t2, n2) {
|
|
1956
|
+
let r2 = this.defaultQueryOptions({ queryKey: e2 }), i2 = this.#e.get(r2.queryHash)?.state.data, a2 = Rn(t2, i2);
|
|
1957
|
+
if (a2 !== void 0) return this.#e.build(this, r2).setData(a2, { ...n2, manual: true });
|
|
1958
|
+
}
|
|
1959
|
+
setQueriesData(e2, t2, n2) {
|
|
1960
|
+
return R.batch(() => this.#e.findAll(e2).map(({ queryKey: e3 }) => [e3, this.setQueryData(e3, t2, n2)]));
|
|
1961
|
+
}
|
|
1962
|
+
getQueryState(e2) {
|
|
1963
|
+
let t2 = this.defaultQueryOptions({ queryKey: e2 });
|
|
1964
|
+
return this.#e.get(t2.queryHash)?.state;
|
|
1965
|
+
}
|
|
1966
|
+
removeQueries(e2) {
|
|
1967
|
+
let t2 = this.#e;
|
|
1968
|
+
R.batch(() => {
|
|
1969
|
+
t2.findAll(e2).forEach((e3) => {
|
|
1970
|
+
t2.remove(e3);
|
|
1971
|
+
});
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
resetQueries(e2, t2) {
|
|
1975
|
+
let n2 = this.#e;
|
|
1976
|
+
return R.batch(() => (n2.findAll(e2).forEach((e3) => {
|
|
1977
|
+
e3.reset();
|
|
1978
|
+
}), this.refetchQueries({ type: `active`, ...e2 }, t2)));
|
|
1979
|
+
}
|
|
1980
|
+
cancelQueries(e2, t2 = {}) {
|
|
1981
|
+
let n2 = { revert: true, ...t2 }, r2 = R.batch(() => this.#e.findAll(e2).map((e3) => e3.cancel(n2)));
|
|
1982
|
+
return Promise.all(r2).then(M).catch(M);
|
|
1983
|
+
}
|
|
1984
|
+
invalidateQueries(e2, t2 = {}) {
|
|
1985
|
+
return R.batch(() => (this.#e.findAll(e2).forEach((e3) => {
|
|
1986
|
+
e3.invalidate();
|
|
1987
|
+
}), e2?.refetchType === `none` ? Promise.resolve() : this.refetchQueries({ ...e2, type: e2?.refetchType ?? e2?.type ?? `active` }, t2)));
|
|
1988
|
+
}
|
|
1989
|
+
refetchQueries(e2, t2 = {}) {
|
|
1990
|
+
let n2 = { ...t2, cancelRefetch: t2.cancelRefetch ?? true }, r2 = R.batch(() => this.#e.findAll(e2).filter((e3) => !e3.isDisabled() && !e3.isStatic()).map((e3) => {
|
|
1991
|
+
let t3 = e3.fetch(void 0, n2);
|
|
1992
|
+
return n2.throwOnError || (t3 = t3.catch(M)), e3.state.fetchStatus === `paused` ? Promise.resolve() : t3;
|
|
1993
|
+
}));
|
|
1994
|
+
return Promise.all(r2).then(M);
|
|
1995
|
+
}
|
|
1996
|
+
fetchQuery(e2) {
|
|
1997
|
+
let t2 = this.defaultQueryOptions(e2);
|
|
1998
|
+
t2.retry === void 0 && (t2.retry = false);
|
|
1999
|
+
let n2 = this.#e.build(this, t2);
|
|
2000
|
+
return n2.isStaleByTime(N(t2.staleTime, n2)) ? n2.fetch(t2) : Promise.resolve(n2.state.data);
|
|
2001
|
+
}
|
|
2002
|
+
prefetchQuery(e2) {
|
|
2003
|
+
return this.fetchQuery(e2).then(M).catch(M);
|
|
2004
|
+
}
|
|
2005
|
+
fetchInfiniteQuery(e2) {
|
|
2006
|
+
return e2._type = `infinite`, this.fetchQuery(e2);
|
|
2007
|
+
}
|
|
2008
|
+
prefetchInfiniteQuery(e2) {
|
|
2009
|
+
return this.fetchInfiniteQuery(e2).then(M).catch(M);
|
|
2010
|
+
}
|
|
2011
|
+
ensureInfiniteQueryData(e2) {
|
|
2012
|
+
return e2._type = `infinite`, this.ensureQueryData(e2);
|
|
2013
|
+
}
|
|
2014
|
+
resumePausedMutations() {
|
|
2015
|
+
return cr.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
|
|
2016
|
+
}
|
|
2017
|
+
getQueryCache() {
|
|
2018
|
+
return this.#e;
|
|
2019
|
+
}
|
|
2020
|
+
getMutationCache() {
|
|
2021
|
+
return this.#t;
|
|
2022
|
+
}
|
|
2023
|
+
getDefaultOptions() {
|
|
2024
|
+
return this.#n;
|
|
2025
|
+
}
|
|
2026
|
+
setDefaultOptions(e2) {
|
|
2027
|
+
this.#n = e2;
|
|
2028
|
+
}
|
|
2029
|
+
setQueryDefaults(e2, t2) {
|
|
2030
|
+
this.#r.set(F(e2), { queryKey: e2, defaultOptions: t2 });
|
|
2031
|
+
}
|
|
2032
|
+
getQueryDefaults(e2) {
|
|
2033
|
+
let t2 = [...this.#r.values()], n2 = {};
|
|
2034
|
+
return t2.forEach((t3) => {
|
|
2035
|
+
I(e2, t3.queryKey) && Object.assign(n2, t3.defaultOptions);
|
|
2036
|
+
}), n2;
|
|
2037
|
+
}
|
|
2038
|
+
setMutationDefaults(e2, t2) {
|
|
2039
|
+
this.#i.set(F(e2), { mutationKey: e2, defaultOptions: t2 });
|
|
2040
|
+
}
|
|
2041
|
+
getMutationDefaults(e2) {
|
|
2042
|
+
let t2 = [...this.#i.values()], n2 = {};
|
|
2043
|
+
return t2.forEach((t3) => {
|
|
2044
|
+
I(e2, t3.mutationKey) && Object.assign(n2, t3.defaultOptions);
|
|
2045
|
+
}), n2;
|
|
2046
|
+
}
|
|
2047
|
+
defaultQueryOptions(e2) {
|
|
2048
|
+
if (e2._defaulted) return e2;
|
|
2049
|
+
let t2 = { ...this.#n.queries, ...this.getQueryDefaults(e2.queryKey), ...e2, _defaulted: true };
|
|
2050
|
+
return t2.queryHash ||= Un(t2.queryKey, t2), t2.refetchOnReconnect === void 0 && (t2.refetchOnReconnect = t2.networkMode !== `always`), t2.throwOnError === void 0 && (t2.throwOnError = !!t2.suspense), !t2.networkMode && t2.persister && (t2.networkMode = `offlineFirst`), t2.queryFn === tr && (t2.enabled = false), t2;
|
|
2051
|
+
}
|
|
2052
|
+
defaultMutationOptions(e2) {
|
|
2053
|
+
return e2?._defaulted ? e2 : { ...this.#n.mutations, ...e2?.mutationKey && this.getMutationDefaults(e2.mutationKey), ...e2, _defaulted: true };
|
|
2054
|
+
}
|
|
2055
|
+
clear() {
|
|
2056
|
+
this.#e.clear(), this.#t.clear();
|
|
2057
|
+
}
|
|
2058
|
+
};
|
|
2059
|
+
var Lr = e.createContext(void 0);
|
|
2060
|
+
var Rr = (t2) => {
|
|
2061
|
+
let n2 = e.useContext(Lr);
|
|
2062
|
+
if (t2) return t2;
|
|
2063
|
+
if (!n2) throw Error(`No QueryClient set, use QueryClientProvider to set one`);
|
|
2064
|
+
return n2;
|
|
2065
|
+
};
|
|
2066
|
+
var zr = ({ client: t2, children: n2 }) => (e.useEffect(() => (t2.mount(), () => {
|
|
2067
|
+
t2.unmount();
|
|
2068
|
+
}), [t2]), o(Lr.Provider, { value: t2, children: n2 }));
|
|
2069
|
+
var Br = e.createContext(false);
|
|
2070
|
+
var Vr = () => e.useContext(Br);
|
|
2071
|
+
Br.Provider;
|
|
2072
|
+
function Hr() {
|
|
2073
|
+
let e2 = false;
|
|
2074
|
+
return { clearReset: () => {
|
|
2075
|
+
e2 = false;
|
|
2076
|
+
}, reset: () => {
|
|
2077
|
+
e2 = true;
|
|
2078
|
+
}, isReset: () => e2 };
|
|
2079
|
+
}
|
|
2080
|
+
var Ur = e.createContext(Hr());
|
|
2081
|
+
var Wr = () => e.useContext(Ur);
|
|
2082
|
+
var Gr = (e2, t2, n2) => {
|
|
2083
|
+
let r2 = n2?.state.error && typeof e2.throwOnError == `function` ? rr(e2.throwOnError, [n2.state.error, n2]) : e2.throwOnError;
|
|
2084
|
+
(e2.suspense || e2.experimental_prefetchInRender || r2) && (t2.isReset() || (e2.retryOnMount = false));
|
|
2085
|
+
};
|
|
2086
|
+
var Kr = (t2) => {
|
|
2087
|
+
e.useEffect(() => {
|
|
2088
|
+
t2.clearReset();
|
|
2089
|
+
}, [t2]);
|
|
2090
|
+
};
|
|
2091
|
+
var qr = ({ result: e2, errorResetBoundary: t2, throwOnError: n2, query: r2, suspense: i2 }) => e2.isError && !t2.isReset() && !e2.isFetching && r2 && (i2 && e2.data === void 0 || rr(n2, [e2.error, r2]));
|
|
2092
|
+
var Jr = (e2) => {
|
|
2093
|
+
if (e2.suspense) {
|
|
2094
|
+
let t2 = 1e3, n2 = (e3) => e3 === `static` ? e3 : Math.max(e3 ?? t2, t2), r2 = e2.staleTime;
|
|
2095
|
+
e2.staleTime = typeof r2 == `function` ? (...e3) => n2(r2(...e3)) : n2(r2), typeof e2.gcTime == `number` && (e2.gcTime = Math.max(e2.gcTime, t2));
|
|
2096
|
+
}
|
|
2097
|
+
};
|
|
2098
|
+
var Yr = (e2, t2) => e2.isLoading && e2.isFetching && !t2;
|
|
2099
|
+
var Xr = (e2, t2) => e2?.suspense && t2.isPending;
|
|
2100
|
+
var Zr = (e2, t2, n2) => t2.fetchOptimistic(e2).catch(() => {
|
|
2101
|
+
n2.clearReset();
|
|
2102
|
+
});
|
|
2103
|
+
function Qr(t2, n2, r2) {
|
|
2104
|
+
let i2 = Vr(), a2 = Wr(), o2 = Rr(r2), s2 = o2.defaultQueryOptions(t2);
|
|
2105
|
+
o2.getDefaultOptions().queries?._experimental_beforeQuery?.(s2);
|
|
2106
|
+
let c2 = o2.getQueryCache().get(s2.queryHash), l2 = t2.subscribed !== false;
|
|
2107
|
+
s2._optimisticResults = i2 ? `isRestoring` : l2 ? `optimistic` : void 0, Jr(s2), Gr(s2, a2, c2), Kr(a2);
|
|
2108
|
+
let u2 = !o2.getQueryCache().get(s2.queryHash), [d2] = e.useState(() => new n2(o2, s2)), f2 = d2.getOptimisticResult(s2), p2 = !i2 && l2;
|
|
2109
|
+
if (e.useSyncExternalStore(e.useCallback((e2) => {
|
|
2110
|
+
let t3 = p2 ? d2.subscribe(R.batchCalls(e2)) : M;
|
|
2111
|
+
return d2.updateResult(), t3;
|
|
2112
|
+
}, [d2, p2]), () => d2.getCurrentResult(), () => d2.getCurrentResult()), e.useEffect(() => {
|
|
2113
|
+
d2.setOptions(s2);
|
|
2114
|
+
}, [s2, d2]), Xr(s2, f2)) throw Zr(s2, d2, a2);
|
|
2115
|
+
if (qr({ result: f2, errorResetBoundary: a2, throwOnError: s2.throwOnError, query: c2, suspense: s2.suspense })) throw f2.error;
|
|
2116
|
+
return o2.getDefaultOptions().queries?._experimental_afterQuery?.(s2, f2), s2.experimental_prefetchInRender && !L.isServer() && Yr(f2, i2) && (u2 ? Zr(s2, d2, a2) : c2?.promise)?.catch(M).finally(() => {
|
|
2117
|
+
d2.updateResult();
|
|
2118
|
+
}), s2.notifyOnChangeProps ? f2 : d2.trackResult(f2);
|
|
2119
|
+
}
|
|
2120
|
+
function $r(e2, t2) {
|
|
2121
|
+
return Qr(e2, Ar, t2);
|
|
2122
|
+
}
|
|
2123
|
+
function ei(e2) {
|
|
2124
|
+
return e2;
|
|
2125
|
+
}
|
|
2126
|
+
var ti = ei(`@wix/site-service-url`);
|
|
2127
|
+
var ni = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
|
|
2128
|
+
`${ni}`, `${ni}`;
|
|
2129
|
+
var ri = function(e2) {
|
|
2130
|
+
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;
|
|
2131
|
+
}({});
|
|
2132
|
+
var ii = () => {
|
|
2133
|
+
let e2 = u(ti), t2 = n((t3, n2) => {
|
|
2134
|
+
let r2 = e2.appSectionRelativeUrl(ni, t3, true);
|
|
2135
|
+
if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n2)}`;
|
|
2136
|
+
}, [e2]);
|
|
2137
|
+
return { getPageRelativeUrl: t2, getPageAbsoluteUrl: n((n2, r2) => {
|
|
2138
|
+
let i2 = t2(n2, r2);
|
|
2139
|
+
if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
|
|
2140
|
+
}, [t2, e2]) };
|
|
2141
|
+
};
|
|
2142
|
+
function ai(e2) {
|
|
2143
|
+
let { getPageAbsoluteUrl: t2 } = ii(), n2 = r(() => {
|
|
2144
|
+
if (!e2.slug) return;
|
|
2145
|
+
let n3 = t2(ri.CATEGORY_PAGE, e2.slug);
|
|
2146
|
+
return n3 ? { href: n3 } : void 0;
|
|
2147
|
+
}, [e2.slug, t2]);
|
|
2148
|
+
return r(() => ({ 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]);
|
|
2149
|
+
}
|
|
2150
|
+
function oi(e2) {
|
|
2151
|
+
let { category: t2 } = e2;
|
|
2152
|
+
return ai(t2);
|
|
2153
|
+
}
|
|
2154
|
+
function si(e2) {
|
|
2155
|
+
if (e2.status === `fulfilled`) return e2.value;
|
|
2156
|
+
throw e2.status === `rejected` ? e2.reason : e2.status === `pending` ? e2 : (e2.status = `pending`, e2.then((t2) => {
|
|
2157
|
+
e2.status = `fulfilled`, e2.value = t2;
|
|
2158
|
+
}, (t2) => {
|
|
2159
|
+
e2.status = `rejected`, e2.reason = t2;
|
|
2160
|
+
}), e2);
|
|
2161
|
+
}
|
|
2162
|
+
var ci = /* @__PURE__ */ new Set();
|
|
2163
|
+
function li(e2) {
|
|
2164
|
+
return ci.add(e2), () => {
|
|
2165
|
+
ci.delete(e2);
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
function ui(e2) {
|
|
2169
|
+
let t2 = globalThis.window;
|
|
2170
|
+
if (!t2?.history) return;
|
|
2171
|
+
let n2 = t2.location.href;
|
|
2172
|
+
t2.history.replaceState({ scrollY: t2.scrollY }, ``, e2.href), t2.location.href !== n2 && ci.forEach((e3) => e3());
|
|
2173
|
+
}
|
|
2174
|
+
function di() {
|
|
2175
|
+
let e2 = u(ti), t2 = n(() => e2.currentUrl, [e2]), i2 = a(li, t2, t2), o2 = r(() => new URL(i2), [i2]), s2 = n((t3) => {
|
|
2176
|
+
let n2 = new URL(e2.currentUrl);
|
|
2177
|
+
n2.search = t3, ui(n2);
|
|
2178
|
+
}, [e2]);
|
|
2179
|
+
return { url: o2, siteUrl: e2.siteUrl.replace(/\/$/, ``), search: o2.search, pushSearch: s2 };
|
|
2180
|
+
}
|
|
2181
|
+
function fi(e2) {
|
|
2182
|
+
return e2.priceMin === void 0 && e2.priceMax === void 0 && Object.values(e2.customizationIdToChoiceIds ?? {}).every((e3) => e3.length === 0);
|
|
2183
|
+
}
|
|
2184
|
+
function pi(e2, t2, n2) {
|
|
2185
|
+
let r2 = e2.customizationIdToChoiceIds ?? {}, i2 = r2[t2] ?? [];
|
|
2186
|
+
return i2.includes(n2) ? e2 : { ...e2, customizationIdToChoiceIds: { ...r2, [t2]: [...i2, n2] } };
|
|
2187
|
+
}
|
|
2188
|
+
function mi(e2, t2, n2) {
|
|
2189
|
+
let r2 = e2.customizationIdToChoiceIds ?? {}, i2 = r2[t2] ?? [];
|
|
2190
|
+
return i2.includes(n2) ? { ...e2, customizationIdToChoiceIds: { ...r2, [t2]: i2.filter((e3) => e3 !== n2) } } : e2;
|
|
2191
|
+
}
|
|
2192
|
+
function hi(e2, t2, n2) {
|
|
2193
|
+
return e2.priceMin === t2 && e2.priceMax === n2 ? e2 : { ...e2, priceMin: t2, priceMax: n2 };
|
|
2194
|
+
}
|
|
2195
|
+
function gi(e2) {
|
|
2196
|
+
return e2.priceMin === void 0 && e2.priceMax === void 0 ? e2 : { ...e2, priceMin: void 0, priceMax: void 0 };
|
|
2197
|
+
}
|
|
2198
|
+
function _i(e2) {
|
|
2199
|
+
return Object.keys(e2).length === 1 && `$and` in e2 && Array.isArray(e2.$and);
|
|
2200
|
+
}
|
|
2201
|
+
function vi(e2) {
|
|
2202
|
+
return Object.keys(e2).length === 1 && `$or` in e2 && Array.isArray(e2.$or);
|
|
2203
|
+
}
|
|
2204
|
+
function yi(e2) {
|
|
2205
|
+
return Object.keys(e2).length === 1 && `$not` in e2 && typeof e2.$not == `object`;
|
|
2206
|
+
}
|
|
2207
|
+
function z(e2, t2) {
|
|
2208
|
+
return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $and: [..._i(e2) ? e2.$and : [e2], ..._i(t2) ? t2.$and : [t2]] };
|
|
2209
|
+
}
|
|
2210
|
+
function bi(e2, t2) {
|
|
2211
|
+
return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $or: [...vi(e2) ? e2.$or : [e2], ...vi(t2) ? t2.$or : [t2]] };
|
|
2212
|
+
}
|
|
2213
|
+
function xi(e2) {
|
|
2214
|
+
if (e2 !== void 0 && Object.keys(e2).length !== 0) return yi(e2) ? e2.$not : { $not: e2 };
|
|
2215
|
+
}
|
|
2216
|
+
var Si = class {
|
|
2217
|
+
_items;
|
|
2218
|
+
_fetchNextPage;
|
|
2219
|
+
_fetchPrevPage;
|
|
2220
|
+
_originQuery;
|
|
2221
|
+
_limit;
|
|
2222
|
+
constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
|
|
2223
|
+
this._items = e2, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
|
|
2224
|
+
}
|
|
2225
|
+
get items() {
|
|
2226
|
+
return this._items;
|
|
2227
|
+
}
|
|
2228
|
+
get length() {
|
|
2229
|
+
return this._items.length;
|
|
2230
|
+
}
|
|
2231
|
+
get pageSize() {
|
|
2232
|
+
return this._limit;
|
|
2233
|
+
}
|
|
2234
|
+
get query() {
|
|
2235
|
+
return this._originQuery;
|
|
2236
|
+
}
|
|
2237
|
+
async next() {
|
|
2238
|
+
if (!this.hasNext()) throw Error(`No next page to fetch`);
|
|
2239
|
+
return await this._fetchNextPage();
|
|
2240
|
+
}
|
|
2241
|
+
async prev() {
|
|
2242
|
+
if (!this.hasPrev()) throw Error(`No previous page to fetch`);
|
|
2243
|
+
return await this._fetchPrevPage();
|
|
2244
|
+
}
|
|
2245
|
+
};
|
|
2246
|
+
var Ci = class extends Si {
|
|
2247
|
+
_nextCursor;
|
|
2248
|
+
_prevCursor;
|
|
2249
|
+
cursors;
|
|
2250
|
+
constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
|
|
2251
|
+
super({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
|
|
2252
|
+
}
|
|
2253
|
+
hasNext() {
|
|
2254
|
+
return !!this._nextCursor;
|
|
2255
|
+
}
|
|
2256
|
+
hasPrev() {
|
|
2257
|
+
return !!this._prevCursor;
|
|
2258
|
+
}
|
|
2259
|
+
};
|
|
2260
|
+
var wi = class extends Si {
|
|
2261
|
+
_totalCount;
|
|
2262
|
+
_offset;
|
|
2263
|
+
_tooManyToCount;
|
|
2264
|
+
constructor({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
|
|
2265
|
+
super({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
|
|
2266
|
+
}
|
|
2267
|
+
get currentPage() {
|
|
2268
|
+
return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
|
|
2269
|
+
}
|
|
2270
|
+
get totalPages() {
|
|
2271
|
+
return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
|
|
2272
|
+
}
|
|
2273
|
+
get totalCount() {
|
|
2274
|
+
return this._tooManyToCount ? void 0 : this._totalCount;
|
|
2275
|
+
}
|
|
2276
|
+
hasNext() {
|
|
2277
|
+
return this._limit !== 0 && this.currentPage !== void 0 && this.totalPages !== void 0 && this.currentPage < this.totalPages - 1;
|
|
2278
|
+
}
|
|
2279
|
+
hasPrev() {
|
|
2280
|
+
return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
|
|
2281
|
+
}
|
|
2282
|
+
};
|
|
2283
|
+
function Ti(e2) {
|
|
2284
|
+
let t2 = (n2) => ({ query: n2, async find() {
|
|
2285
|
+
try {
|
|
2286
|
+
let r2 = e2.requestTransformer(e2.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e2.func(r2), { [ot]: a2, [st]: o2 } = e2.responseTransformer(i2);
|
|
2287
|
+
if (e2.pagingMethod === `OFFSET`) {
|
|
2288
|
+
let e3 = n2;
|
|
2289
|
+
return new wi({ items: a2 ?? [], fetchNextPage: () => t2({ ...e3, paging: { offset: e3.paging.offset + e3.paging.limit, limit: e3.paging.limit } }).find(), fetchPrevPage: () => t2({ ...n2, paging: { offset: Math.max(e3.paging.offset - e3.paging.limit, 0), limit: e3.paging.limit } }).find(), offset: e3.paging.offset, limit: e3.paging.limit, totalCount: o2?.total, tooManyToCount: o2?.tooManyToCount, originQuery: this });
|
|
2290
|
+
}
|
|
2291
|
+
let s2 = n2.cursorPaging;
|
|
2292
|
+
return new Ci({ items: a2 ?? [], limit: s2.limit, originQuery: this, fetchNextPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.next ?? void 0, limit: s2.limit } }).find(), fetchPrevPage: () => t2({ ...n2, cursorPaging: { cursor: o2?.cursors?.prev ?? void 0, limit: s2.limit } }).find(), prevCursor: o2?.cursors?.prev ?? void 0, nextCursor: o2?.cursors?.next ?? void 0 });
|
|
2293
|
+
} catch (t3) {
|
|
2294
|
+
throw e2.errorTransformer(t3);
|
|
2295
|
+
}
|
|
2296
|
+
}, skipTo(e3) {
|
|
2297
|
+
return t2({ ...n2, cursorPaging: { cursor: e3, limit: n2.cursorPaging.limit } });
|
|
2298
|
+
}, eq(r2, i2) {
|
|
2299
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [B(e2.transformationPaths, r2)]: a2 };
|
|
2300
|
+
return t2({ ...n2, filter: z(n2.filter, o2) });
|
|
2301
|
+
}, ne(r2, i2) {
|
|
2302
|
+
let a2 = i2 === void 0 ? null : i2, o2 = { [B(e2.transformationPaths, r2)]: { $ne: a2 } };
|
|
2303
|
+
return t2({ ...n2, filter: z(n2.filter, o2) });
|
|
2304
|
+
}, ge(r2, i2) {
|
|
2305
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $gte: i2 } };
|
|
2306
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2307
|
+
}, gt(r2, i2) {
|
|
2308
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $gt: i2 } };
|
|
2309
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2310
|
+
}, le(r2, i2) {
|
|
2311
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $lte: i2 } };
|
|
2312
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2313
|
+
}, lt(r2, i2) {
|
|
2314
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $lt: i2 } };
|
|
2315
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2316
|
+
}, isNotEmpty(e3) {
|
|
2317
|
+
return this.ne(e3, null);
|
|
2318
|
+
}, isEmpty(e3) {
|
|
2319
|
+
return this.eq(e3, null);
|
|
2320
|
+
}, startsWith(r2, i2) {
|
|
2321
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $startsWith: i2 } };
|
|
2322
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2323
|
+
}, endsWith(r2, i2) {
|
|
2324
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $endsWith: i2 } };
|
|
2325
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2326
|
+
}, contains(r2, i2) {
|
|
2327
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $contains: i2 } };
|
|
2328
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2329
|
+
}, hasSome(r2, ...i2) {
|
|
2330
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
2331
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2332
|
+
}, hasAll(r2, ...i2) {
|
|
2333
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
|
|
2334
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2335
|
+
}, between(e3, t3, n3) {
|
|
2336
|
+
return this.ge(e3, t3).lt(e3, n3);
|
|
2337
|
+
}, in(r2, i2) {
|
|
2338
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $in: i2 } };
|
|
2339
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2340
|
+
}, exists(r2, i2 = true) {
|
|
2341
|
+
let a2 = { [B(e2.transformationPaths, r2)]: { $exists: i2 } };
|
|
2342
|
+
return t2({ ...n2, filter: z(n2.filter, a2) });
|
|
2343
|
+
}, or(e3) {
|
|
2344
|
+
return t2({ ...n2, filter: bi(n2.filter, e3.query.filter) });
|
|
2345
|
+
}, and(e3) {
|
|
2346
|
+
return t2({ ...n2, filter: z(n2.filter, e3.query.filter) });
|
|
2347
|
+
}, not(e3) {
|
|
2348
|
+
return t2({ ...n2, filter: xi(e3.query.filter) });
|
|
2349
|
+
}, ascending(...r2) {
|
|
2350
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: B(e2.transformationPaths, t3), order: `ASC` }))] });
|
|
2351
|
+
}, descending(...r2) {
|
|
2352
|
+
return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: B(e2.transformationPaths, t3), order: `DESC` }))] });
|
|
2353
|
+
}, skip(e3) {
|
|
2354
|
+
return t2({ ...n2, paging: { offset: e3, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
|
|
2355
|
+
}, limit(r2) {
|
|
2356
|
+
if (e2.pagingMethod === `CURSOR`) {
|
|
2357
|
+
let e3 = n2;
|
|
2358
|
+
return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e3.cursorPaging ? e3.cursorPaging.cursor : void 0 } });
|
|
2359
|
+
}
|
|
2360
|
+
let i2 = n2;
|
|
2361
|
+
return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
|
|
2362
|
+
} });
|
|
2363
|
+
return t2({ filter: {}, ...e2.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
|
|
2364
|
+
}
|
|
2365
|
+
function B(e2, t2) {
|
|
2366
|
+
let n2 = Object.entries(e2).find(([e3]) => e3 === t2 || t2.startsWith(`${e3}.`))?.[0];
|
|
2367
|
+
return n2 ? t2.replace(n2, e2[n2]) : lt(t2, { ...e2, ...ct });
|
|
2368
|
+
}
|
|
2369
|
+
function Ei(e2, t2, n2 = {}) {
|
|
2370
|
+
let r2 = (r3, i3) => Ei(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [b(e2, t2)]: n2 };
|
|
2371
|
+
return { get filter() {
|
|
2372
|
+
return i2();
|
|
2373
|
+
}, 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) };
|
|
2374
|
+
}
|
|
2375
|
+
function Di(e2) {
|
|
2376
|
+
return Object.assign((t2) => Ei(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 } }) });
|
|
2377
|
+
}
|
|
2378
|
+
function Oi(e2) {
|
|
2379
|
+
return (t2) => ({ asc: () => ({ sort: { fieldName: b(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: b(t2, e2), order: `DESC` } }) });
|
|
2380
|
+
}
|
|
2381
|
+
function ki(e2) {
|
|
2382
|
+
return () => {
|
|
2383
|
+
let t2 = {}, n2 = { withFilter(e3) {
|
|
2384
|
+
return t2 = { ...t2, filter: e3.filter }, n2;
|
|
2385
|
+
}, withFields(...r2) {
|
|
2386
|
+
return t2 = { ...t2, fields: r2.map((t3) => b(t3, e2)) }, n2;
|
|
2387
|
+
}, withSorting(...e3) {
|
|
2388
|
+
return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
|
|
2389
|
+
}, withPaging(e3) {
|
|
2390
|
+
return t2 = { ...t2, paging: e3 }, n2;
|
|
2391
|
+
}, build() {
|
|
2392
|
+
return t2;
|
|
2393
|
+
} };
|
|
2394
|
+
return n2;
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
function V(e2) {
|
|
2398
|
+
return { QueryBuilder: ki(e2), Filter: Di(e2), Sort: Oi(e2) };
|
|
2399
|
+
}
|
|
2400
|
+
var Ai = `filter`;
|
|
2401
|
+
var ji = `sort`;
|
|
2402
|
+
var Mi = `cursorPaging`;
|
|
2403
|
+
var Ni = `paging`;
|
|
2404
|
+
var Pi = [Ai, ji, Mi];
|
|
2405
|
+
var Fi = [Ai, ji, Ni];
|
|
2406
|
+
function Ii(e2, t2) {
|
|
2407
|
+
return !e2 || typeof e2 != `object` ? false : t2.some((t3) => e2.hasOwnProperty(t3));
|
|
2408
|
+
}
|
|
2409
|
+
function Li(e2) {
|
|
2410
|
+
return Ii(e2, Pi);
|
|
2411
|
+
}
|
|
2412
|
+
function Ri(e2) {
|
|
2413
|
+
return Ii(e2, Fi);
|
|
2414
|
+
}
|
|
2415
|
+
function zi(e2) {
|
|
2416
|
+
let { hasOptionsParameter: t2 } = e2;
|
|
2417
|
+
return function(...n2) {
|
|
2418
|
+
return t2 ? Vi(n2, e2) : Bi(n2, e2);
|
|
2419
|
+
};
|
|
2420
|
+
}
|
|
2421
|
+
function Bi(e2, t2) {
|
|
2422
|
+
return e2.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e2[0]);
|
|
2423
|
+
}
|
|
2424
|
+
function Vi(e2, t2) {
|
|
2425
|
+
switch (e2.length) {
|
|
2426
|
+
case 0:
|
|
2427
|
+
return t2.builderQueryFunction();
|
|
2428
|
+
case 1:
|
|
2429
|
+
return Li(e2[0]) || Ri(e2[0]) ? t2.typedQueryFunction(e2[0]) : t2.builderQueryFunction(e2[0]);
|
|
2430
|
+
default:
|
|
2431
|
+
return t2.typedQueryFunction(e2[0], e2[1]);
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
function H(e2) {
|
|
2435
|
+
if (!e2) return;
|
|
2436
|
+
let t2 = ``;
|
|
2437
|
+
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;
|
|
2438
|
+
}
|
|
2439
|
+
function Hi(e2) {
|
|
2440
|
+
if (!e2) return;
|
|
2441
|
+
let t2 = ``;
|
|
2442
|
+
e2?.filename && (t2 = `/${encodeURIComponent(e2.filename)}`);
|
|
2443
|
+
let n2 = ``;
|
|
2444
|
+
if (e2.posters?.length) {
|
|
2445
|
+
let [t3, r2] = e2.posters, i2 = r2 || t3, a2 = i2.id || ``;
|
|
2446
|
+
if (!a2 && i2.url) {
|
|
2447
|
+
let e3 = i2.url.lastIndexOf(`/`);
|
|
2448
|
+
e3 !== -1 && (a2 = i2.url.substring(e3 + 1));
|
|
2449
|
+
}
|
|
2450
|
+
a2 && (n2 = `#posterUri=${a2}&posterWidth=${i2.width}&posterHeight=${i2.height}`);
|
|
2451
|
+
}
|
|
2452
|
+
return e2.id ? `wix:video://v1/${e2.id}${t2}${n2}` : e2.url;
|
|
2453
|
+
}
|
|
2454
|
+
function Ui(e2) {
|
|
2455
|
+
return O(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/customization`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/customizations`, destPath: `/v3/customizations` }, { srcPath: `/stores/v3/bulk/customizations`, destPath: `/v3/bulk/customizations` }], "editor._base_domain_": [{ srcPath: `/_api/customization`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/customization`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/customization`, destPath: `` }], _: [{ srcPath: `/_api/customization`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/customization`, destPath: `` }] } }));
|
|
2456
|
+
}
|
|
2457
|
+
var Wi = `@wix/auto_sdk_stores_customizations-v-3`;
|
|
2458
|
+
function Gi(e2) {
|
|
2459
|
+
function t2({ host: t3 }) {
|
|
2460
|
+
return { entityFqdn: `wix.stores.catalog.v3.customization`, method: `GET`, methodFqn: `wix.stores.catalog.customization.v3.CustomizationService.QueryCustomizations`, packageName: Wi, migrationOptions: { optInTransformResponse: true }, url: Ui({ protoPath: `/v3/customizations/query`, data: e2, host: t3 }), params: D(e2, true), transformResponse: (e3) => w(e3, [{ transformFn: C, paths: [{ path: `customizations.createdDate` }, { path: `customizations.updatedDate` }, { path: `customizations.choicesSettings.choices.image.urlExpirationDate` }, { path: `customizations.choicesSettings.choices.displayImage.urlExpirationDate` }] }, { transformFn: A, paths: [{ path: `customizations.choicesSettings.choices.image.focalPoint.x` }, { path: `customizations.choicesSettings.choices.image.focalPoint.y` }] }]), fallback: [{ method: `POST`, url: Ui({ protoPath: `/v3/customizations/query`, data: e2, host: t3 }), data: e2 }] };
|
|
2461
|
+
}
|
|
2462
|
+
return t2;
|
|
2463
|
+
}
|
|
2464
|
+
var Ki = ((e2) => (e2.PRODUCT_OPTION = `PRODUCT_OPTION`, e2.MODIFIER = `MODIFIER`, e2))(Ki || {});
|
|
2465
|
+
var U = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(U || {});
|
|
2466
|
+
var W = ((e2) => (e2.DEFAULT = `DEFAULT`, e2.BY_NAME = `BY_NAME`, e2.BY_PRODUCT_COUNT = `BY_PRODUCT_COUNT`, e2.MANUAL = `MANUAL`, e2))(W || {});
|
|
2467
|
+
var qi = ((e2) => (e2.ASSIGNED_PRODUCTS_COUNT = `ASSIGNED_PRODUCTS_COUNT`, e2.CHOICE_DISPLAY_IMAGE = `CHOICE_DISPLAY_IMAGE`, e2))(qi || {});
|
|
2468
|
+
function Ji(e2) {
|
|
2469
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1];
|
|
2470
|
+
return Ti({ func: async (r2) => {
|
|
2471
|
+
let i2 = Gi({ ...r2, ...e2 ?? {} });
|
|
2472
|
+
n2?.onSiteCall?.();
|
|
2473
|
+
try {
|
|
2474
|
+
let e3 = await t2.request(i2);
|
|
2475
|
+
return n2?.onSuccess?.(e3), e3;
|
|
2476
|
+
} catch (e3) {
|
|
2477
|
+
throw n2?.onError?.(e3), e3;
|
|
2478
|
+
}
|
|
2479
|
+
}, requestTransformer: (t3) => {
|
|
2480
|
+
let n3 = [t3, e2];
|
|
2481
|
+
return x({ ...n3?.[1], query: n3?.[0] });
|
|
2482
|
+
}, responseTransformer: ({ data: e3 }) => {
|
|
2483
|
+
let t3 = S(w(e3, [{ transformFn: H, paths: [{ path: `customizations.choicesSettings.choices.image` }, { path: `customizations.choicesSettings.choices.displayImage` }] }]));
|
|
2484
|
+
return { items: t3?.customizations, pagingMetadata: t3?.pagingMetadata };
|
|
2485
|
+
}, errorTransformer: (e3) => {
|
|
2486
|
+
throw T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
2487
|
+
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
2488
|
+
}
|
|
2489
|
+
async function Yi(e2, t2) {
|
|
2490
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = Gi(x({ query: e2, ...t2 }));
|
|
2491
|
+
r2?.onSiteCall?.();
|
|
2492
|
+
try {
|
|
2493
|
+
let e3 = await n2.request(i2);
|
|
2494
|
+
return r2?.onSuccess?.(e3), S(w(e3.data, [{ transformFn: H, paths: [{ path: `customizations.choicesSettings.choices.image` }, { path: `customizations.choicesSettings.choices.displayImage` }] }]));
|
|
2495
|
+
} catch (e3) {
|
|
2496
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`, `options`]);
|
|
2497
|
+
throw r2?.onError?.(e3), t3;
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
({ ...V() });
|
|
2501
|
+
function Xi(e2) {
|
|
2502
|
+
return (t2) => Ji(t2, { httpClient: e2 });
|
|
2503
|
+
}
|
|
2504
|
+
function Zi(e2) {
|
|
2505
|
+
return (t2, n2) => Yi(t2, n2, { httpClient: e2 });
|
|
2506
|
+
}
|
|
2507
|
+
var Qi = v(`wix.stores.catalog.v3.customization_created`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }] }])))();
|
|
2508
|
+
var $i = v(`wix.stores.catalog.v3.customization_deleted`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }] }])))();
|
|
2509
|
+
var ea = v(`wix.stores.catalog.v3.customization_updated`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }, { transformFn: H, paths: [{ path: `entity.choicesSettings.choices.image` }, { path: `entity.choicesSettings.choices.displayImage` }, { path: `modifiedFields.choicesSettings.choices.image` }, { path: `modifiedFields.choicesSettings.choices.displayImage` }] }])))();
|
|
2510
|
+
function ta(e2) {
|
|
2511
|
+
let t2 = zi({ builderQueryFunction: (t3) => Xi(e2)(t3), typedQueryFunction: (t3, n3) => Zi(e2)(t3, n3), hasOptionsParameter: true });
|
|
2512
|
+
function n2(e3, n3) {
|
|
2513
|
+
return t2(...arguments);
|
|
2514
|
+
}
|
|
2515
|
+
return n2;
|
|
2516
|
+
}
|
|
2517
|
+
var na = E(ta);
|
|
2518
|
+
k(Qi), k($i), k(ea);
|
|
2519
|
+
function ra(e2) {
|
|
2520
|
+
let t2 = {}, n2 = { get search() {
|
|
2521
|
+
return t2;
|
|
2522
|
+
}, expression(e3) {
|
|
2523
|
+
return t2 = { ...t2, expression: e3 }, n2;
|
|
2524
|
+
}, mode(e3) {
|
|
2525
|
+
return t2 = { ...t2, mode: e3 }, n2;
|
|
2526
|
+
}, fields(r2) {
|
|
2527
|
+
return t2 = { ...t2, fields: r2.map((t3) => b(t3, e2)) }, n2;
|
|
2528
|
+
}, fuzzy(e3 = true) {
|
|
2529
|
+
return t2 = { ...t2, fuzzy: e3 }, n2;
|
|
2530
|
+
} };
|
|
2531
|
+
return n2;
|
|
2532
|
+
}
|
|
2533
|
+
function ia(e2) {
|
|
2534
|
+
return (t2) => {
|
|
2535
|
+
let n2 = ra(e2);
|
|
2536
|
+
return t2 === void 0 ? n2 : n2.expression(t2);
|
|
2537
|
+
};
|
|
2538
|
+
}
|
|
2539
|
+
function aa(e2) {
|
|
2540
|
+
let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
|
|
2541
|
+
return t2;
|
|
2542
|
+
}, sortBy(e3, r2) {
|
|
2543
|
+
return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
|
|
2544
|
+
}, limit(e3) {
|
|
2545
|
+
return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
|
|
2546
|
+
}, excludeMissingValues() {
|
|
2547
|
+
return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
|
|
2548
|
+
}, includeMissingValues() {
|
|
2549
|
+
return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
|
|
2550
|
+
}, includeValues(e3) {
|
|
2551
|
+
return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
|
|
2552
|
+
} };
|
|
2553
|
+
return n2;
|
|
2554
|
+
}
|
|
2555
|
+
function oa(e2) {
|
|
2556
|
+
let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
|
|
2557
|
+
return t2;
|
|
2558
|
+
}, withBuckets(...e3) {
|
|
2559
|
+
return t2 = { ...t2, range: { buckets: e3 } }, n2;
|
|
2560
|
+
} };
|
|
2561
|
+
return n2;
|
|
2562
|
+
}
|
|
2563
|
+
function sa(e2) {
|
|
2564
|
+
let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
|
|
2565
|
+
return t2;
|
|
2566
|
+
}, interval(e3) {
|
|
2567
|
+
return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
|
|
2568
|
+
} };
|
|
2569
|
+
return n2;
|
|
2570
|
+
}
|
|
2571
|
+
function ca(e2) {
|
|
2572
|
+
let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
|
|
2573
|
+
return t2;
|
|
2574
|
+
}, type(e3) {
|
|
2575
|
+
return t2 = { ...t2, scalar: { type: e3 } }, n2;
|
|
2576
|
+
} };
|
|
2577
|
+
return n2;
|
|
2578
|
+
}
|
|
2579
|
+
function la(e2) {
|
|
2580
|
+
let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
|
|
2581
|
+
return t2;
|
|
2582
|
+
}, addNestedAggregation(e3) {
|
|
2583
|
+
let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
|
|
2584
|
+
return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
|
|
2585
|
+
} };
|
|
2586
|
+
return n2;
|
|
2587
|
+
}
|
|
2588
|
+
function ua(e2, t2) {
|
|
2589
|
+
let n2 = { name: e2 }, r2 = { get aggregation() {
|
|
2590
|
+
return n2;
|
|
2591
|
+
}, ofType(e3) {
|
|
2592
|
+
return n2 = { ...n2, type: e3 }, r2;
|
|
2593
|
+
}, onField(e3) {
|
|
2594
|
+
return n2 = { ...n2, fieldPath: b(e3, t2) }, r2;
|
|
2595
|
+
}, asValueAggregation() {
|
|
2596
|
+
return aa(n2);
|
|
2597
|
+
}, asRangeAggregation() {
|
|
2598
|
+
return oa(n2);
|
|
2599
|
+
}, asDateHistogramAggregation() {
|
|
2600
|
+
return sa(n2);
|
|
2601
|
+
}, asScalarAggregation() {
|
|
2602
|
+
return ca(n2);
|
|
2603
|
+
}, asNestedAggregation() {
|
|
2604
|
+
return la(n2);
|
|
2605
|
+
} };
|
|
2606
|
+
return r2;
|
|
2607
|
+
}
|
|
2608
|
+
function da(e2) {
|
|
2609
|
+
return (t2) => ua(t2, e2);
|
|
2610
|
+
}
|
|
2611
|
+
function fa() {
|
|
2612
|
+
return () => {
|
|
2613
|
+
let e2 = {}, t2 = { withFilter(n2) {
|
|
2614
|
+
return e2 = { ...e2, filter: n2.filter }, t2;
|
|
2615
|
+
}, withSearchClause(n2) {
|
|
2616
|
+
return e2 = { ...e2, search: n2.search }, t2;
|
|
2617
|
+
}, withSorting(...n2) {
|
|
2618
|
+
return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
|
|
2619
|
+
}, withAggregation(...n2) {
|
|
2620
|
+
return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
|
|
2621
|
+
}, withPaging(n2) {
|
|
2622
|
+
return e2 = { ...e2, paging: n2 }, t2;
|
|
2623
|
+
}, withTimeZone(n2) {
|
|
2624
|
+
return e2 = { ...e2, timeZone: n2 }, t2;
|
|
2625
|
+
}, build() {
|
|
2626
|
+
return e2;
|
|
2627
|
+
} };
|
|
2628
|
+
return t2;
|
|
2629
|
+
};
|
|
2630
|
+
}
|
|
2631
|
+
function pa(e2) {
|
|
2632
|
+
return { SearchBuilder: fa(), Filter: Di(e2), Sort: Oi(e2), SearchParams: ia(e2), Aggregation: da(e2) };
|
|
2633
|
+
}
|
|
2634
|
+
function ma(e2) {
|
|
2635
|
+
if (e2) return e2.url;
|
|
2636
|
+
}
|
|
2637
|
+
function ha(e2) {
|
|
2638
|
+
return O(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/stores-catalog-orchestrator`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/stores`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/products`, destPath: `/v3/products` }, { srcPath: `/stores/v3/bulk/products`, destPath: `/v3/bulk/products` }, { srcPath: `/stores/v3/products-with-inventory`, destPath: `/v3/products-with-inventory` }, { srcPath: `/stores/v3/bulk/products-with-inventory`, destPath: `/v3/bulk/products-with-inventory` }, { srcPath: `/stores/v3/all-products-category`, destPath: `/v3/all-products-category` }], "www._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }], _: [{ srcPath: `/_api/stores-catalog-orchestrator`, destPath: `` }] } }));
|
|
2639
|
+
}
|
|
2640
|
+
var ga = `@wix/auto_sdk_stores_products-v-3`;
|
|
2641
|
+
function _a(e2) {
|
|
2642
|
+
function t2({ host: t3 }) {
|
|
2643
|
+
let n2 = w(e2, [{ transformFn: vn, paths: [{ path: `search.aggregations.range.buckets.from` }, { path: `search.aggregations.range.buckets.to` }, { path: `search.aggregations.nested.nestedAggregations.range.buckets.from` }, { path: `search.aggregations.nested.nestedAggregations.range.buckets.to` }] }]);
|
|
2644
|
+
return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.SearchProducts`, packageName: ga, migrationOptions: { optInTransformResponse: true }, url: ha({ protoPath: `/v3/products/search`, data: n2, host: t3 }), params: D(n2, true), transformResponse: (e3) => w(e3, [{ transformFn: C, paths: [{ path: `products.createdDate` }, { path: `products.updatedDate` }, { path: `products.description.metadata.createdTimestamp` }, { path: `products.description.metadata.updatedTimestamp` }, { path: `products.media.main.image.urlExpirationDate` }, { path: `products.media.main.video.urlExpirationDate` }, { path: `products.media.main.video.resolutions.urlExpirationDate` }, { path: `products.media.main.video.resolutions.poster.urlExpirationDate` }, { path: `products.media.main.video.posters.urlExpirationDate` }, { path: `products.media.itemsInfo.items.image.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.resolutions.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate` }, { path: `products.media.itemsInfo.items.video.posters.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.image.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `products.options.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.image.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `products.modifiers.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `products.infoSections.description.metadata.createdTimestamp` }, { path: `products.infoSections.description.metadata.updatedTimestamp` }, { path: `products.variantsInfo.variants.media.image.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.resolutions.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate` }, { path: `products.variantsInfo.variants.media.video.posters.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.image.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate` }, { path: `products.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate` }] }, { transformFn: A, paths: [{ path: `products.physicalProperties.pricePerUnit.quantity` }, { path: `products.physicalProperties.shippingWeightRange.minValue` }, { path: `products.physicalProperties.shippingWeightRange.maxValue` }, { path: `products.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `products.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `products.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `products.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `products.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `products.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `products.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `aggregationData.results.scalar.value` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.scalar.value` }, { path: `aggregationData.results.nested.results.results.*.scalar.value` }, { path: `products.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `products.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `products.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `products.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `products.description.nodes.galleryData.items.image.media.duration` }, { path: `products.description.nodes.galleryData.items.video.media.duration` }, { path: `products.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `products.description.nodes.galleryData.options.item.ratio` }, { path: `products.description.nodes.imageData.image.duration` }, { path: `products.description.nodes.imageData.crop.x` }, { path: `products.description.nodes.imageData.crop.y` }, { path: `products.description.nodes.imageData.crop.width` }, { path: `products.description.nodes.imageData.crop.height` }, { path: `products.description.nodes.mapData.mapSettings.lat` }, { path: `products.description.nodes.mapData.mapSettings.lng` }, { path: `products.description.nodes.pollData.poll.image.duration` }, { path: `products.description.nodes.pollData.poll.options.image.duration` }, { path: `products.description.nodes.pollData.design.poll.background.image.duration` }, { path: `products.description.nodes.appEmbedData.image.duration` }, { path: `products.description.nodes.videoData.video.duration` }, { path: `products.description.nodes.videoData.thumbnail.duration` }, { path: `products.description.nodes.audioData.audio.duration` }, { path: `products.description.nodes.audioData.coverImage.duration` }, { path: `products.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `products.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.layoutData.backdropImage.media.duration` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `products.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.layoutData.background.gradient.centerX` }, { path: `products.description.nodes.layoutData.background.gradient.centerY` }, { path: `products.description.nodes.layoutData.background.gradient.stops.position` }, { path: `products.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `products.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `products.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `products.description.nodes.shapeData.shape.duration` }, { path: `products.description.nodes.cardData.background.gradient.centerX` }, { path: `products.description.nodes.cardData.background.gradient.centerY` }, { path: `products.description.nodes.cardData.background.gradient.stops.position` }, { path: `products.description.nodes.cardData.backgroundImage.media.duration` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `products.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.description.nodes.tocData.fontSize` }, { path: `products.description.nodes.tocData.itemSpacing` }, { path: `products.description.nodes.smartBlockCellData.shape.duration` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `products.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `products.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `products.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `products.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `products.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `products.infoSections.description.nodes.imageData.image.duration` }, { path: `products.infoSections.description.nodes.imageData.crop.x` }, { path: `products.infoSections.description.nodes.imageData.crop.y` }, { path: `products.infoSections.description.nodes.imageData.crop.width` }, { path: `products.infoSections.description.nodes.imageData.crop.height` }, { path: `products.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `products.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `products.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `products.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `products.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `products.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `products.infoSections.description.nodes.videoData.video.duration` }, { path: `products.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `products.infoSections.description.nodes.audioData.audio.duration` }, { path: `products.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `products.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `products.infoSections.description.nodes.shapeData.shape.duration` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `products.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `products.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `products.infoSections.description.nodes.tocData.fontSize` }, { path: `products.infoSections.description.nodes.tocData.itemSpacing` }, { path: `products.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `products.variantsInfo.variants.physicalProperties.weight` }, { path: `products.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `products.minVariantPriceInfo.weight` }, { path: `aggregationData.results.ranges.results.from` }, { path: `aggregationData.results.ranges.results.to` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.ranges.results.from` }, { path: `aggregationData.results.groupedByValue.results.nestedResults.ranges.results.to` }, { path: `aggregationData.results.nested.results.results.*.range.from` }, { path: `aggregationData.results.nested.results.results.*.range.to` }] }]), fallback: [{ method: `POST`, url: ha({ protoPath: `/v3/products/search`, data: n2, host: t3 }), data: n2 }] };
|
|
2645
|
+
}
|
|
2646
|
+
return t2;
|
|
2647
|
+
}
|
|
2648
|
+
function va(e2) {
|
|
2649
|
+
function t2({ host: t3 }) {
|
|
2650
|
+
return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.CountProducts`, packageName: ga, migrationOptions: { optInTransformResponse: true }, url: ha({ protoPath: `/v3/products/count`, data: e2, host: t3 }), params: D(e2, true), fallback: [{ method: `POST`, url: ha({ protoPath: `/v3/products/count`, data: e2, host: t3 }), data: e2 }] };
|
|
2651
|
+
}
|
|
2652
|
+
return t2;
|
|
2653
|
+
}
|
|
2654
|
+
var ya = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(ya || {});
|
|
2655
|
+
var G = ((e2) => (e2.ASC = `ASC`, e2.DESC = `DESC`, e2))(G || {});
|
|
2656
|
+
var ba = ((e2) => (e2.COUNT = `COUNT`, e2.VALUE = `VALUE`, e2))(ba || {});
|
|
2657
|
+
var xa = ((e2) => (e2.DESC = `DESC`, e2.ASC = `ASC`, e2))(xa || {});
|
|
2658
|
+
var Sa = ((e2) => (e2.COUNT_DISTINCT = `COUNT_DISTINCT`, e2.MIN = `MIN`, e2.MAX = `MAX`, e2))(Sa || {});
|
|
2659
|
+
var Ca = ((e2) => (e2.VALUE = `VALUE`, e2.RANGE = `RANGE`, e2.SCALAR = `SCALAR`, e2.DATE_HISTOGRAM = `DATE_HISTOGRAM`, e2.NESTED = `NESTED`, e2))(Ca || {});
|
|
2660
|
+
var K = ((e2) => (e2.URL = `URL`, e2.CURRENCY = `CURRENCY`, e2.INFO_SECTION = `INFO_SECTION`, e2.MERCHANT_DATA = `MERCHANT_DATA`, e2.PLAIN_DESCRIPTION = `PLAIN_DESCRIPTION`, e2.INFO_SECTION_PLAIN_DESCRIPTION = `INFO_SECTION_PLAIN_DESCRIPTION`, e2.SUBSCRIPTION_PRICES_INFO = `SUBSCRIPTION_PRICES_INFO`, e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.WEIGHT_MEASUREMENT_UNIT_INFO = `WEIGHT_MEASUREMENT_UNIT_INFO`, e2.VARIANT_OPTION_CHOICE_NAMES = `VARIANT_OPTION_CHOICE_NAMES`, e2.MEDIA_ITEMS_INFO = `MEDIA_ITEMS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.DIRECT_CATEGORIES_INFO = `DIRECT_CATEGORIES_INFO`, e2.ALL_CATEGORIES_INFO = `ALL_CATEGORIES_INFO`, e2.INFO_SECTION_DESCRIPTION = `INFO_SECTION_DESCRIPTION`, e2.THUMBNAIL = `THUMBNAIL`, e2.PRODUCT_CHOICES_MEDIA_REFERENCES = `PRODUCT_CHOICES_MEDIA_REFERENCES`, e2.PRODUCT_CHOICES_DISPLAY_IMAGE = `PRODUCT_CHOICES_DISPLAY_IMAGE`, e2.MIN_PRICE_VARIANT = `MIN_PRICE_VARIANT`, e2.DISCOUNT_INFO = `DISCOUNT_INFO`, e2))(K || {});
|
|
2661
|
+
async function wa(e2, t2) {
|
|
2662
|
+
let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = _a(x({ search: e2, fields: t2?.fields }, []));
|
|
2663
|
+
r2?.onSiteCall?.();
|
|
2664
|
+
try {
|
|
2665
|
+
let e3 = await n2.request(i2);
|
|
2666
|
+
return r2?.onSuccess?.(e3), S(w(e3.data, [{ transformFn: ma, paths: [{ path: `products.url` }] }, { transformFn: H, paths: [{ path: `products.media.main.image` }, { path: `products.media.itemsInfo.items.image` }, { path: `products.options.choicesSettings.choices.image` }, { path: `products.options.choicesSettings.choices.displayImage` }, { path: `products.options.choicesSettings.choices.linkedMedia.image` }, { path: `products.modifiers.choicesSettings.choices.image` }, { path: `products.modifiers.choicesSettings.choices.displayImage` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `products.variantsInfo.variants.media.image` }, { path: `products.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Hi, paths: [{ path: `products.media.main.video` }, { path: `products.media.itemsInfo.items.video` }, { path: `products.options.choicesSettings.choices.linkedMedia.video` }, { path: `products.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `products.variantsInfo.variants.media.video` }, { path: `products.variantSummary.minPriceVariant.media.video` }] }]), [`products.description`, `products.infoSections.description`]);
|
|
2667
|
+
} catch (e3) {
|
|
2668
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { search: `$[0]`, fields: `$[1].fields` }, singleArgumentUnchanged: false }, [`search`, `options`]);
|
|
2669
|
+
throw r2?.onError?.(e3), t3;
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
({ ...pa() }, { ...V() });
|
|
2673
|
+
async function Ta(e2) {
|
|
2674
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = va(x({ filter: e2?.filter, search: e2?.search, returnNonVisibleProducts: e2?.returnNonVisibleProducts }, []));
|
|
2675
|
+
n2?.onSiteCall?.();
|
|
2676
|
+
try {
|
|
2677
|
+
let e3 = await t2.request(r2);
|
|
2678
|
+
return n2?.onSuccess?.(e3), S(e3.data, []);
|
|
2679
|
+
} catch (e3) {
|
|
2680
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { filter: `$[0].filter`, search: `$[0].search`, returnNonVisibleProducts: `$[0].returnNonVisibleProducts` }, singleArgumentUnchanged: false }, [`options`]);
|
|
2681
|
+
throw n2?.onError?.(e3), t3;
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
function Ea(e2) {
|
|
2685
|
+
return (t2, n2) => wa(t2, n2, { httpClient: e2 });
|
|
2686
|
+
}
|
|
2687
|
+
function Da(e2) {
|
|
2688
|
+
return (t2) => Ta(t2, { httpClient: e2 });
|
|
2689
|
+
}
|
|
2690
|
+
var Oa = v(`wix.stores.catalog.v3.product_created`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: ma, paths: [{ path: `entity.url` }] }, { transformFn: A, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }] }, { transformFn: H, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Hi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }] }])))();
|
|
2691
|
+
var ka = v(`wix.stores.catalog.v3.product_deleted`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: ma, paths: [{ path: `entity.url` }] }, { transformFn: A, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }] }, { transformFn: H, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Hi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }] }])))();
|
|
2692
|
+
var Aa = v(`wix.stores.catalog.v3.product_updated`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.description.metadata.createdTimestamp` }, { path: `entity.description.metadata.updatedTimestamp` }, { path: `entity.infoSections.description.metadata.createdTimestamp` }, { path: `entity.infoSections.description.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }, { path: `modifiedFields.description.metadata.createdTimestamp` }, { path: `modifiedFields.description.metadata.updatedTimestamp` }, { path: `modifiedFields.infoSections.description.metadata.createdTimestamp` }, { path: `modifiedFields.infoSections.description.metadata.updatedTimestamp` }] }, { transformFn: ma, paths: [{ path: `entity.url` }, { path: `modifiedFields.url` }] }, { transformFn: A, paths: [{ path: `entity.physicalProperties.pricePerUnit.quantity` }, { path: `entity.physicalProperties.shippingWeightRange.minValue` }, { path: `entity.physicalProperties.shippingWeightRange.maxValue` }, { path: `entity.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `entity.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `entity.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `entity.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `entity.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.description.nodes.galleryData.options.item.ratio` }, { path: `entity.description.nodes.imageData.image.duration` }, { path: `entity.description.nodes.imageData.crop.x` }, { path: `entity.description.nodes.imageData.crop.y` }, { path: `entity.description.nodes.imageData.crop.width` }, { path: `entity.description.nodes.imageData.crop.height` }, { path: `entity.description.nodes.mapData.mapSettings.lat` }, { path: `entity.description.nodes.mapData.mapSettings.lng` }, { path: `entity.description.nodes.pollData.poll.image.duration` }, { path: `entity.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.description.nodes.appEmbedData.image.duration` }, { path: `entity.description.nodes.videoData.video.duration` }, { path: `entity.description.nodes.videoData.thumbnail.duration` }, { path: `entity.description.nodes.audioData.audio.duration` }, { path: `entity.description.nodes.audioData.coverImage.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.description.nodes.shapeData.shape.duration` }, { path: `entity.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.description.nodes.tocData.fontSize` }, { path: `entity.description.nodes.tocData.itemSpacing` }, { path: `entity.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `entity.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `entity.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `entity.infoSections.description.nodes.imageData.image.duration` }, { path: `entity.infoSections.description.nodes.imageData.crop.x` }, { path: `entity.infoSections.description.nodes.imageData.crop.y` }, { path: `entity.infoSections.description.nodes.imageData.crop.width` }, { path: `entity.infoSections.description.nodes.imageData.crop.height` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `entity.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `entity.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `entity.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `entity.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `entity.infoSections.description.nodes.videoData.video.duration` }, { path: `entity.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `entity.infoSections.description.nodes.audioData.audio.duration` }, { path: `entity.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `entity.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.shapeData.shape.duration` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `entity.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `entity.infoSections.description.nodes.tocData.fontSize` }, { path: `entity.infoSections.description.nodes.tocData.itemSpacing` }, { path: `entity.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `entity.variantsInfo.variants.physicalProperties.weight` }, { path: `entity.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `entity.minVariantPriceInfo.weight` }, { path: `modifiedFields.physicalProperties.pricePerUnit.quantity` }, { path: `modifiedFields.physicalProperties.shippingWeightRange.minValue` }, { path: `modifiedFields.physicalProperties.shippingWeightRange.maxValue` }, { path: `modifiedFields.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `modifiedFields.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `modifiedFields.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `modifiedFields.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `modifiedFields.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `modifiedFields.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `modifiedFields.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.description.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.description.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.description.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.description.nodes.imageData.image.duration` }, { path: `modifiedFields.description.nodes.imageData.crop.x` }, { path: `modifiedFields.description.nodes.imageData.crop.y` }, { path: `modifiedFields.description.nodes.imageData.crop.width` }, { path: `modifiedFields.description.nodes.imageData.crop.height` }, { path: `modifiedFields.description.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.description.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.description.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.description.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.description.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.description.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.description.nodes.videoData.video.duration` }, { path: `modifiedFields.description.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.description.nodes.audioData.audio.duration` }, { path: `modifiedFields.description.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.description.nodes.shapeData.shape.duration` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.description.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.description.nodes.tocData.fontSize` }, { path: `modifiedFields.description.nodes.tocData.itemSpacing` }, { path: `modifiedFields.description.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `modifiedFields.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `modifiedFields.infoSections.description.nodes.imageData.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.x` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.y` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.width` }, { path: `modifiedFields.infoSections.description.nodes.imageData.crop.height` }, { path: `modifiedFields.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `modifiedFields.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `modifiedFields.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `modifiedFields.infoSections.description.nodes.videoData.video.duration` }, { path: `modifiedFields.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `modifiedFields.infoSections.description.nodes.audioData.audio.duration` }, { path: `modifiedFields.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.shapeData.shape.duration` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `modifiedFields.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `modifiedFields.infoSections.description.nodes.tocData.fontSize` }, { path: `modifiedFields.infoSections.description.nodes.tocData.itemSpacing` }, { path: `modifiedFields.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `modifiedFields.variantsInfo.variants.physicalProperties.weight` }, { path: `modifiedFields.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `modifiedFields.minVariantPriceInfo.weight` }] }, { transformFn: H, paths: [{ path: `entity.media.main.image` }, { path: `entity.media.itemsInfo.items.image` }, { path: `entity.options.choicesSettings.choices.image` }, { path: `entity.options.choicesSettings.choices.displayImage` }, { path: `entity.options.choicesSettings.choices.linkedMedia.image` }, { path: `entity.modifiers.choicesSettings.choices.image` }, { path: `entity.modifiers.choicesSettings.choices.displayImage` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `entity.variantsInfo.variants.media.image` }, { path: `entity.variantSummary.minPriceVariant.media.image` }, { path: `modifiedFields.media.main.image` }, { path: `modifiedFields.media.itemsInfo.items.image` }, { path: `modifiedFields.options.choicesSettings.choices.image` }, { path: `modifiedFields.options.choicesSettings.choices.displayImage` }, { path: `modifiedFields.options.choicesSettings.choices.linkedMedia.image` }, { path: `modifiedFields.modifiers.choicesSettings.choices.image` }, { path: `modifiedFields.modifiers.choicesSettings.choices.displayImage` }, { path: `modifiedFields.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `modifiedFields.variantsInfo.variants.media.image` }, { path: `modifiedFields.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Hi, paths: [{ path: `entity.media.main.video` }, { path: `entity.media.itemsInfo.items.video` }, { path: `entity.options.choicesSettings.choices.linkedMedia.video` }, { path: `entity.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `entity.variantsInfo.variants.media.video` }, { path: `entity.variantSummary.minPriceVariant.media.video` }, { path: `modifiedFields.media.main.video` }, { path: `modifiedFields.media.itemsInfo.items.video` }, { path: `modifiedFields.options.choicesSettings.choices.linkedMedia.video` }, { path: `modifiedFields.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `modifiedFields.variantsInfo.variants.media.video` }, { path: `modifiedFields.variantSummary.minPriceVariant.media.video` }] }])))();
|
|
2693
|
+
var ja = E(Ea);
|
|
2694
|
+
var Ma = E(Da);
|
|
2695
|
+
k(Oa), k(ka), k(Aa);
|
|
2696
|
+
function Na(e2) {
|
|
2697
|
+
return O(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/location`, destPath: `` }], _: [{ srcPath: `/_api/location`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/location`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/locations`, destPath: `/v3/locations` }] } }));
|
|
2698
|
+
}
|
|
2699
|
+
var Pa = `@wix/auto_sdk_stores_stores-locations-v-3`;
|
|
2700
|
+
function Fa(e2) {
|
|
2701
|
+
function t2({ host: t3 }) {
|
|
2702
|
+
return { entityFqdn: `wix.stores.catalog.v3.stores_location`, method: `POST`, methodFqn: `wix.stores.catalog.location.v3.StoresLocationService.QueryStoresLocations`, packageName: Pa, migrationOptions: { optInTransformResponse: true }, url: Na({ protoPath: `/v3/locations/query`, data: e2, host: t3 }), data: e2, transformResponse: (e3) => w(e3, [{ transformFn: C, paths: [{ path: `storesLocations.createdDate` }, { path: `storesLocations.updatedDate` }] }]) };
|
|
2703
|
+
}
|
|
2704
|
+
return t2;
|
|
2705
|
+
}
|
|
2706
|
+
function Ia() {
|
|
2707
|
+
let { httpClient: e2, sideEffects: t2 } = arguments[0];
|
|
2708
|
+
return Ti({ func: async (n2) => {
|
|
2709
|
+
let r2 = Fa(n2);
|
|
2710
|
+
t2?.onSiteCall?.();
|
|
2711
|
+
try {
|
|
2712
|
+
let n3 = await e2.request(r2);
|
|
2713
|
+
return t2?.onSuccess?.(n3), n3;
|
|
2714
|
+
} catch (e3) {
|
|
2715
|
+
throw t2?.onError?.(e3), e3;
|
|
2716
|
+
}
|
|
2717
|
+
}, requestTransformer: (e3) => {
|
|
2718
|
+
let t3 = [e3, {}];
|
|
2719
|
+
return x({ ...t3?.[1], query: t3?.[0] });
|
|
2720
|
+
}, responseTransformer: ({ data: e3 }) => {
|
|
2721
|
+
let t3 = S(w(e3, []));
|
|
2722
|
+
return { items: t3?.storesLocations, pagingMetadata: t3?.pagingMetadata };
|
|
2723
|
+
}, errorTransformer: (e3) => {
|
|
2724
|
+
throw T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
|
|
2725
|
+
}, pagingMethod: `CURSOR`, transformationPaths: {} });
|
|
2726
|
+
}
|
|
2727
|
+
async function La(e2) {
|
|
2728
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Fa(x({ query: e2 }));
|
|
2729
|
+
n2?.onSiteCall?.();
|
|
2730
|
+
try {
|
|
2731
|
+
let e3 = await t2.request(r2);
|
|
2732
|
+
return n2?.onSuccess?.(e3), S(e3.data);
|
|
2733
|
+
} catch (e3) {
|
|
2734
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`]);
|
|
2735
|
+
throw n2?.onError?.(e3), t3;
|
|
2736
|
+
}
|
|
2737
|
+
}
|
|
2738
|
+
({ ...V() });
|
|
2739
|
+
function Ra(e2) {
|
|
2740
|
+
return () => Ia({ httpClient: e2 });
|
|
2741
|
+
}
|
|
2742
|
+
function za(e2) {
|
|
2743
|
+
return (t2) => La(t2, { httpClient: e2 });
|
|
2744
|
+
}
|
|
2745
|
+
function Ba(e2) {
|
|
2746
|
+
let t2 = zi({ builderQueryFunction: () => Ra(e2)(), typedQueryFunction: (t3) => za(e2)(t3), hasOptionsParameter: false });
|
|
2747
|
+
function n2(e3) {
|
|
2748
|
+
return t2(...arguments);
|
|
2749
|
+
}
|
|
2750
|
+
return n2;
|
|
2751
|
+
}
|
|
2752
|
+
var Va = E(Ba);
|
|
2753
|
+
function Ha(e2) {
|
|
2754
|
+
return O(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/promotion`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/promotion`, destPath: `` }], _: [{ srcPath: `/_api/promotion`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/promotion`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/promotions`, destPath: `/v3/promotions` }, { srcPath: `/stores/v3/bulk/promotions`, destPath: `/v3/bulk/promotions` }], "*.dev.wix-code.com": [{ srcPath: `/_api/promotion`, destPath: `` }] } }));
|
|
2755
|
+
}
|
|
2756
|
+
var Ua = `@wix/auto_sdk_stores_promotions-v-3`;
|
|
2757
|
+
function Wa(e2) {
|
|
2758
|
+
function t2({ host: t3 }) {
|
|
2759
|
+
return { entityFqdn: `wix.stores.catalog.v3.promotion`, method: `GET`, methodFqn: `wix.stores.catalog.promotion.v3.PromotionsService.ResolvePromotions`, packageName: Ua, migrationOptions: { optInTransformResponse: true }, url: Ha({ protoPath: `/v3/promotions/resolve`, data: e2, host: t3 }), params: D(e2), transformResponse: (e3) => w(e3, [{ transformFn: C, paths: [{ path: `promotions.promotion.createdDate` }, { path: `promotions.promotion.updatedDate` }, { path: `promotions.promotion.media.image.urlExpirationDate` }] }]) };
|
|
2760
|
+
}
|
|
2761
|
+
return t2;
|
|
2762
|
+
}
|
|
2763
|
+
({ ...V() }, { ...pa() });
|
|
2764
|
+
async function Ga(e2) {
|
|
2765
|
+
let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Wa(x({ categoryId: e2 }));
|
|
2766
|
+
n2?.onSiteCall?.();
|
|
2767
|
+
try {
|
|
2768
|
+
let e3 = await t2.request(r2);
|
|
2769
|
+
return n2?.onSuccess?.(e3), S(w(e3.data, [{ transformFn: H, paths: [{ path: `promotions.promotion.media.image` }] }]));
|
|
2770
|
+
} catch (e3) {
|
|
2771
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]` }, singleArgumentUnchanged: false }, [`categoryId`]);
|
|
2772
|
+
throw n2?.onError?.(e3), t3;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
function Ka(e2) {
|
|
2776
|
+
return (t2) => Ga(t2, { httpClient: e2 });
|
|
2777
|
+
}
|
|
2778
|
+
var qa = v(`wix.stores.catalog.v3.promotion_created`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `entity.media.image` }] }])))();
|
|
2779
|
+
var Ja = v(`wix.stores.catalog.v3.promotion_deleted`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `entity.media.image` }] }])))();
|
|
2780
|
+
var Ya = v(`wix.stores.catalog.v3.promotion_tags_modified`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `data.promotion.createdDate` }, { path: `data.promotion.updatedDate` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `data.promotion.media.image` }] }])))();
|
|
2781
|
+
var Xa = v(`wix.stores.catalog.v3.promotion_updated`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }, { transformFn: H, paths: [{ path: `entity.media.image` }, { path: `modifiedFields.media.image` }] }])))();
|
|
2782
|
+
var Za = E(Ka);
|
|
2783
|
+
k(qa), k(Ja), k(Ya), k(Xa);
|
|
2784
|
+
var q = function(e2) {
|
|
2785
|
+
return e2.PRICE = `PRICE`, e2.TEXT_CHOICES = `${U.TEXT_CHOICES}`, e2.SWATCH_CHOICES = `${U.SWATCH_CHOICES}`, e2;
|
|
2786
|
+
}({});
|
|
2787
|
+
var Qa = function(e2) {
|
|
2788
|
+
return e2.TEXT_CHOICES = `Text Choices`, e2.SWATCH_CHOICES = `Swatch Choices`, e2.PRICE = `Price`, e2;
|
|
2789
|
+
}({});
|
|
2790
|
+
var $a = `minPrice`;
|
|
2791
|
+
var eo = `maxPrice`;
|
|
2792
|
+
var to = (e2, t2) => {
|
|
2793
|
+
let n2 = new Map(e2.values.map((e3) => [e3.name, e3.id]));
|
|
2794
|
+
return t2.map((e3) => n2.get(e3)).filter((e3) => e3 !== void 0);
|
|
2795
|
+
};
|
|
2796
|
+
var no = (e2) => {
|
|
2797
|
+
if (e2 === null || e2.trim() === ``) return;
|
|
2798
|
+
let t2 = Number(e2);
|
|
2799
|
+
return Number.isFinite(t2) ? t2 : void 0;
|
|
2800
|
+
};
|
|
2801
|
+
var ro = (e2, t2) => {
|
|
2802
|
+
let n2 = {};
|
|
2803
|
+
for (let r2 of t2) {
|
|
2804
|
+
let t3 = e2.get(r2.name), i2 = to(r2, t3 ? t3.split(`,`).filter(Boolean) : []);
|
|
2805
|
+
i2.length > 0 && (n2[r2.id] = i2);
|
|
2806
|
+
}
|
|
2807
|
+
return n2;
|
|
2808
|
+
};
|
|
2809
|
+
function io(e2, t2) {
|
|
2810
|
+
let n2 = new URLSearchParams(e2);
|
|
2811
|
+
return { customizationIdToChoiceIds: ro(n2, t2.filter((e3) => e3.type === q.TEXT_CHOICES || e3.type === q.SWATCH_CHOICES)), priceMin: no(n2.get($a)), priceMax: no(n2.get(eo)) };
|
|
2812
|
+
}
|
|
2813
|
+
var ao = (e2, t2) => {
|
|
2814
|
+
let n2 = new Map(e2.values.map((e3) => [e3.id, e3.name]));
|
|
2815
|
+
return t2.map((e3) => n2.get(e3)).filter((e3) => e3 !== void 0);
|
|
2816
|
+
};
|
|
2817
|
+
var oo = (e2, t2) => {
|
|
2818
|
+
t2.forEach((t3) => {
|
|
2819
|
+
e2.delete(t3.name);
|
|
2820
|
+
}), e2.delete($a), e2.delete(eo);
|
|
2821
|
+
};
|
|
2822
|
+
var so = (e2) => e2.map(encodeURIComponent).join(`,`);
|
|
2823
|
+
var co = (e2, t2) => {
|
|
2824
|
+
let n2 = new Map(e2.map((e3) => [e3.id, e3]));
|
|
2825
|
+
return Object.entries(t2 ?? {}).flatMap(([e3, t3]) => {
|
|
2826
|
+
let r2 = n2.get(e3);
|
|
2827
|
+
if (!r2) return [];
|
|
2828
|
+
let i2 = ao(r2, t3);
|
|
2829
|
+
return i2.length === 0 ? [] : [`${encodeURIComponent(r2.name)}=${so(i2)}`];
|
|
2830
|
+
});
|
|
2831
|
+
};
|
|
2832
|
+
var lo = (e2, t2, n2) => {
|
|
2833
|
+
t2.priceMin !== void 0 && t2.priceMin !== n2?.minPrice && e2.set($a, String(t2.priceMin)), t2.priceMax !== void 0 && t2.priceMax !== n2?.maxPrice && e2.set(eo, String(t2.priceMax));
|
|
2834
|
+
};
|
|
2835
|
+
function uo(e2, t2, n2) {
|
|
2836
|
+
let r2 = new URLSearchParams(e2), i2 = n2.filter((e3) => e3.type === q.TEXT_CHOICES || e3.type === q.SWATCH_CHOICES), a2 = n2.find((e3) => e3.type === q.PRICE);
|
|
2837
|
+
oo(r2, i2), lo(r2, t2, a2);
|
|
2838
|
+
let o2 = co(i2, t2.customizationIdToChoiceIds), s2 = [r2.toString(), ...o2].filter(Boolean).join(`&`);
|
|
2839
|
+
return s2 ? `?${s2}` : ``;
|
|
2840
|
+
}
|
|
2841
|
+
function fo(e2) {
|
|
2842
|
+
let { search: t2, pushSearch: n2 } = di(), i2 = r(() => io(t2, e2), [t2, e2]), a2 = (r2) => {
|
|
2843
|
+
r2 !== i2 && n2(uo(t2, r2, e2));
|
|
2844
|
+
};
|
|
2845
|
+
return { filterSelection: i2, selectFilterChoice: (e3, t3) => {
|
|
2846
|
+
a2(pi(i2, e3, t3));
|
|
2847
|
+
}, deselectFilterChoice: (e3, t3) => {
|
|
2848
|
+
a2(mi(i2, e3, t3));
|
|
2849
|
+
}, setPriceRange: (e3, t3) => {
|
|
2850
|
+
a2(hi(i2, e3, t3));
|
|
2851
|
+
}, clearPriceRange: () => {
|
|
2852
|
+
a2(gi(i2));
|
|
2853
|
+
}, clearAllFilters: () => {
|
|
2854
|
+
fi(i2) || a2({});
|
|
2855
|
+
} };
|
|
2856
|
+
}
|
|
2857
|
+
var J = function(e2) {
|
|
2858
|
+
return e2.createdDate = `createdDate`, e2.actualPriceRangeMinValueAmount = `actualPriceRange.minValue.amount`, e2.name = `name`, e2;
|
|
2859
|
+
}({});
|
|
2860
|
+
var Y = function(e2) {
|
|
2861
|
+
return e2.recommended = `recommended`, e2.newest = `newest`, e2.price_ascending = `price_ascending`, e2.price_descending = `price_descending`, e2.name_ascending = `name_ascending`, e2.name_descending = `name_descending`, e2;
|
|
2862
|
+
}({});
|
|
2863
|
+
var po = [{ type: Y.recommended }, { type: Y.newest, fieldName: J.createdDate, order: G.DESC }, { type: Y.price_ascending, fieldName: J.actualPriceRangeMinValueAmount, order: G.ASC }, { type: Y.price_descending, fieldName: J.actualPriceRangeMinValueAmount, order: G.DESC }, { type: Y.name_ascending, fieldName: J.name, order: G.ASC }, { type: Y.name_descending, fieldName: J.name, order: G.DESC }];
|
|
2864
|
+
function mo(e2) {
|
|
2865
|
+
return po.find((t2) => t2.type === e2);
|
|
2866
|
+
}
|
|
2867
|
+
var ho = Y.recommended;
|
|
2868
|
+
var go = po.map(({ type: e2 }) => e2);
|
|
2869
|
+
var _o = `sort`;
|
|
2870
|
+
function vo(e2) {
|
|
2871
|
+
let t2 = mo(new URLSearchParams(e2).get(_o));
|
|
2872
|
+
return t2 ? t2.type : ho;
|
|
2873
|
+
}
|
|
2874
|
+
function yo(e2, t2) {
|
|
2875
|
+
let n2 = new URLSearchParams(e2);
|
|
2876
|
+
return t2 === ho ? n2.delete(_o) : n2.set(_o, t2), n2.toString();
|
|
2877
|
+
}
|
|
2878
|
+
function bo() {
|
|
2879
|
+
let { search: e2, pushSearch: t2 } = di(), n2 = r(() => vo(e2), [e2]);
|
|
2880
|
+
return { sortTypes: go, selectedSortType: n2, selectSortType: (r2) => {
|
|
2881
|
+
r2 !== n2 && t2(yo(e2, r2));
|
|
2882
|
+
} };
|
|
2883
|
+
}
|
|
2884
|
+
var xo = `https://static.wixstatic.com/media`;
|
|
2885
|
+
var So = `https://video.wixstatic.com/video`;
|
|
2886
|
+
var Co = /image:\/\/v1\/([^/#]+)/;
|
|
2887
|
+
var wo = /^(?:wix:)?video:\/\/v1\/([^/#]+)(?:\/[^#]*)?(?:#(.*))?$/;
|
|
2888
|
+
function To(e2) {
|
|
2889
|
+
let t2 = e2?.match(wo);
|
|
2890
|
+
if (!t2) return null;
|
|
2891
|
+
let [, n2, r2] = t2, i2 = new URLSearchParams(r2 ?? ``), a2 = i2.get(`posterUri`);
|
|
2892
|
+
return { id: n2, url: `${So}/${n2}/file`, ...a2 ? { poster: { uri: a2, url: `${xo}/${a2}`, width: Number(i2.get(`posterWidth`)) || 0, height: Number(i2.get(`posterHeight`)) || 0 } } : {} };
|
|
2893
|
+
}
|
|
2894
|
+
function Eo(e2) {
|
|
2895
|
+
return e2 ? e2.match(Co)?.[1] ?? null : null;
|
|
2896
|
+
}
|
|
2897
|
+
function Do(e2) {
|
|
2898
|
+
if (!e2) return null;
|
|
2899
|
+
let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
|
|
2900
|
+
return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
|
|
2901
|
+
}
|
|
2902
|
+
function Oo(e2) {
|
|
2903
|
+
return e2.map((e3) => ({ id: e3._id, key: e3.key, name: e3.name ?? void 0, optionRenderType: e3.optionRenderType, choices: (e3.choicesSettings?.choices ?? []).map((e4) => {
|
|
2904
|
+
let t2 = Eo(e4.displayImage) ?? void 0;
|
|
2905
|
+
return { choiceId: e4.choiceId, key: e4.key, name: e4.name ?? void 0, colorCode: e4.colorCode, ...t2 ? { displayImageUri: t2 } : {}, inStock: e4.inStock, visible: e4.visible ?? void 0, mediaIds: ko(e4.media) };
|
|
2906
|
+
}) }));
|
|
2907
|
+
}
|
|
2908
|
+
var ko = (e2) => {
|
|
2909
|
+
let t2 = (e2?.items ?? []).map((e3) => e3.mediaId);
|
|
2910
|
+
return t2.length > 0 ? t2 : void 0;
|
|
2911
|
+
};
|
|
2912
|
+
function Ao(e2) {
|
|
2913
|
+
let t2 = e2.map((e3) => {
|
|
2914
|
+
let t3 = e3._id, n2 = e3.modifierRenderType === ya.FREE_TEXT;
|
|
2915
|
+
return [t3, { id: t3, key: e3.key, name: e3.name ?? void 0, mandatory: e3.mandatory !== false, modifierRenderType: e3.modifierRenderType, freeTextSettings: n2 ? e3.freeTextSettings : void 0, choices: n2 ? void 0 : (e3.choicesSettings?.choices ?? []).map((e4) => {
|
|
2916
|
+
let t4 = Eo(e4.displayImage) ?? void 0;
|
|
2917
|
+
return { choiceId: e4.choiceId, key: e4.key, name: e4.name ?? void 0, colorCode: e4.colorCode, ...t4 ? { displayImageUri: t4 } : {}, mediaIds: ko(e4.media) };
|
|
2918
|
+
}) }];
|
|
2919
|
+
});
|
|
2920
|
+
return Object.fromEntries(t2);
|
|
2921
|
+
}
|
|
2922
|
+
function jo(e2) {
|
|
2923
|
+
return e2.filter((e3) => e3.visible !== false).map(Mo);
|
|
2924
|
+
}
|
|
2925
|
+
var Mo = (e2) => {
|
|
2926
|
+
let t2 = Object.fromEntries((e2.choices ?? []).map((e3) => {
|
|
2927
|
+
let t3 = e3.optionChoiceIds;
|
|
2928
|
+
return [t3?.optionId, t3?.choiceId];
|
|
2929
|
+
}));
|
|
2930
|
+
return { id: e2._id, sku: e2.sku ?? void 0, choices: t2, price: Po(e2), subscriptionPrices: Fo(e2) };
|
|
2931
|
+
};
|
|
2932
|
+
function No(e2) {
|
|
2933
|
+
return e2?.description == null ? void 0 : { description: e2.description };
|
|
2934
|
+
}
|
|
2935
|
+
var Po = (e2) => {
|
|
2936
|
+
let t2 = e2.price;
|
|
2937
|
+
return { actualPrice: $o(t2?.actualPrice), compareAtPrice: X(t2?.compareAtPrice), priceAfterDiscount: X(t2?.priceAfterDiscount), pricePerUnit: No(e2.physicalProperties?.pricePerUnit) };
|
|
2938
|
+
};
|
|
2939
|
+
var Fo = (e2) => (e2.subscriptionPricesInfo?.subscriptionPrices ?? []).map((e3) => ({ subscriptionId: e3.subscriptionId, price: $o(e3.price) }));
|
|
2940
|
+
var Io = { nodes: [] };
|
|
2941
|
+
var Lo = `@stores/product-groups`;
|
|
2942
|
+
function Ro(e2) {
|
|
2943
|
+
let t2 = Oo(e2.options ?? []), n2 = Ao(e2.modifiers ?? []), r2 = Ho(e2.subscriptionDetails?.subscriptions ?? []), i2 = jo(e2.variantsInfo?.variants ?? []), a2 = { subscriptions: r2, allowOneTimePurchases: e2.subscriptionDetails?.allowOneTimePurchases ?? false }, o2 = e2.additionalRibbons ?? [], s2 = { primary: e2.ribbon?.name ?? void 0, additional: o2.map((e3) => e3.name ?? void 0).filter((e3) => !!e3) }, c2 = e2.description ? Uo(e2.description) : Io, l2 = e2.discountInfo?.discountRuleNames, u2 = Bo(e2);
|
|
2944
|
+
return { id: e2._id, slug: e2.slug ?? void 0, url: e2.url ? { href: e2.url } : void 0, name: e2.name, description: c2, media: Qo(e2), mainMedia: Zo(e2.media?.main), ribbons: s2, breadcrumbs: Wo(e2), mainCategoryId: e2.mainCategoryId ?? void 0, categories: Go(e2), infoSections: zo(e2), currency: e2.currency, options: t2, modifiers: n2, variants: i2, minPriceVariant: Yo(e2), priceRange: Xo(e2), subscriptionDetails: a2, inventory: { availabilityStatus: e2.inventory?.availabilityStatus, preorderAvailability: e2.inventory?.preorderAvailability }, discountRuleNames: l2, productGroupId: u2 };
|
|
2945
|
+
}
|
|
2946
|
+
function zo(e2) {
|
|
2947
|
+
return (e2.infoSections ?? []).map((e3) => ({ _id: e3.uniqueName ?? e3._id, name: e3.title, body: e3.description ? Uo(e3.description) : void 0 }));
|
|
2948
|
+
}
|
|
2949
|
+
function Bo(e2) {
|
|
2950
|
+
let t2 = e2.extendedFields?.namespaces?.[Lo]?.productGroupId;
|
|
2951
|
+
return typeof t2 == `string` ? t2 : void 0;
|
|
2952
|
+
}
|
|
2953
|
+
function Vo(e2) {
|
|
2954
|
+
return e2 === `WEEK` || e2 === `MONTH` || e2 === `YEAR` ? e2 : void 0;
|
|
2955
|
+
}
|
|
2956
|
+
function Ho(e2) {
|
|
2957
|
+
return e2.filter((e3) => e3.visible !== false).map((e3) => ({ id: e3._id, name: e3.title, description: e3.description ?? void 0, frequency: Vo(e3.frequency), interval: e3.interval, billingCycles: e3.billingCycles ?? void 0 }));
|
|
2958
|
+
}
|
|
2959
|
+
function Uo(e2) {
|
|
2960
|
+
return { ...e2, nodes: e2.nodes ?? [] };
|
|
2961
|
+
}
|
|
2962
|
+
function Wo(e2) {
|
|
2963
|
+
return (e2.breadcrumbsInfo?.breadcrumbs ?? []).map((e3) => ({ id: e3.categoryId, name: e3.categoryName, slug: e3.categorySlug }));
|
|
2964
|
+
}
|
|
2965
|
+
function Go(e2) {
|
|
2966
|
+
return (e2.directCategoriesInfo?.categories ?? []).flatMap((e3) => e3._id ? [{ id: e3._id }] : []);
|
|
2967
|
+
}
|
|
2968
|
+
function Ko(e2) {
|
|
2969
|
+
return { ...e2.displayName ? { title: e2.displayName } : {}, ...e2.altText ? { alt: e2.altText } : {} };
|
|
2970
|
+
}
|
|
2971
|
+
function qo(e2, t2) {
|
|
2972
|
+
let n2 = e2.image ?? e2.url;
|
|
2973
|
+
if (!n2) return;
|
|
2974
|
+
let r2 = Do(e2.image), { title: i2, alt: a2 } = Ko(e2);
|
|
2975
|
+
return { id: Eo(e2.image) ?? e2._id ?? t2, media: { type: `image`, src: n2, ...r2 ? { width: r2.width, height: r2.height } : {}, ...i2 ? { title: i2 } : {}, ...a2 ? { parameters: { alt: a2 } } : {} } };
|
|
2976
|
+
}
|
|
2977
|
+
function Jo(e2, t2) {
|
|
2978
|
+
let n2 = To(e2.video), r2 = n2?.url ?? e2.url;
|
|
2979
|
+
if (!r2) return;
|
|
2980
|
+
let i2 = n2?.poster?.url, a2 = n2?.poster?.width, o2 = n2?.poster?.height, { title: s2, alt: c2 } = Ko(e2);
|
|
2981
|
+
return { id: n2?.id ?? e2._id ?? t2, media: { type: `video`, src: r2, ...a2 === void 0 ? {} : { width: a2 }, ...o2 === void 0 ? {} : { height: o2 }, ...s2 ? { title: s2 } : {}, ...c2 || i2 ? { parameters: { ...c2 ? { alt: c2 } : {}, ...i2 ? { thumbnail: i2 } : {} } } : {} } };
|
|
2982
|
+
}
|
|
2983
|
+
function Yo(e2) {
|
|
2984
|
+
let t2 = e2.variantSummary?.minPriceVariant;
|
|
2985
|
+
return t2 ? jo([t2])[0] : void 0;
|
|
2986
|
+
}
|
|
2987
|
+
function Xo(e2) {
|
|
2988
|
+
return { minActualPrice: X(e2.actualPriceRange?.minValue), maxActualPrice: X(e2.actualPriceRange?.maxValue), minCompareAtPrice: X(e2.compareAtPriceRange?.minValue), maxCompareAtPrice: X(e2.compareAtPriceRange?.maxValue) };
|
|
2989
|
+
}
|
|
2990
|
+
function Zo(e2) {
|
|
2991
|
+
if (!e2) return;
|
|
2992
|
+
let { title: t2, alt: n2 } = Ko(e2);
|
|
2993
|
+
if (e2.mediaType === `VIDEO`) {
|
|
2994
|
+
let r3 = To(e2.video)?.poster;
|
|
2995
|
+
return r3 ? { ...r3, name: t2, alt: n2 } : void 0;
|
|
2996
|
+
}
|
|
2997
|
+
let r2 = e2.image ?? e2.url;
|
|
2998
|
+
if (!r2) return;
|
|
2999
|
+
let i2 = Do(e2.image);
|
|
3000
|
+
return { uri: Eo(e2.image) ?? void 0, url: r2, width: i2?.width, height: i2?.height, name: t2, alt: n2 };
|
|
3001
|
+
}
|
|
3002
|
+
function Qo(e2) {
|
|
3003
|
+
return (e2.media?.itemsInfo?.items ?? (e2.media?.main ? [e2.media.main] : [])).flatMap((e3, t2) => {
|
|
3004
|
+
let n2 = e3.mediaType === `VIDEO` ? Jo(e3, String(t2)) : qo(e3, String(t2));
|
|
3005
|
+
return n2 ? [n2] : [];
|
|
3006
|
+
});
|
|
3007
|
+
}
|
|
3008
|
+
var $o = (e2) => Number.parseFloat(e2?.amount);
|
|
3009
|
+
var X = (e2) => e2?.amount == null ? void 0 : $o(e2);
|
|
3010
|
+
var Z = function(e2) {
|
|
3011
|
+
return e2.PRICE = `PRICE`, e2.OPTIONS = `OPTIONS`, e2.MODIFIERS = `MODIFIERS`, e2;
|
|
3012
|
+
}({});
|
|
3013
|
+
var es = `allCategoriesInfo.categories`;
|
|
3014
|
+
var Q = { minPrice: `min_price`, maxPrice: `max_price`, optionsWithChoice: `options_with_choice`, modifiersWithChoice: `modifiers_with_choice`, options: `options`, modifiers: `modifiers` };
|
|
3015
|
+
var $ = { minPrice: `actualPriceRange.minValue.amount`, maxPrice: `actualPriceRange.maxValue.amount`, option: `options.id`, optionChoice: `options.choicesSettings.choices.choiceId`, modifier: `modifiers.id`, modifierChoice: `modifiers.choicesSettings.choices.choiceId` };
|
|
3016
|
+
var ts = { options: 1e3, modifiers: 1e3, choices: 2e4 };
|
|
3017
|
+
var ns = ({ priceMin: e2, priceMax: t2 }) => {
|
|
3018
|
+
let n2 = [];
|
|
3019
|
+
return e2 !== void 0 && n2.push({ [$.minPrice]: { $gte: e2 } }), t2 !== void 0 && n2.push({ [$.maxPrice]: { $lte: t2 } }), n2;
|
|
3020
|
+
};
|
|
3021
|
+
var rs = (e2, t2) => {
|
|
3022
|
+
let n2 = new Map(e2.values.map((e3) => [e3.id, e3]));
|
|
3023
|
+
return t2.flatMap((e3) => {
|
|
3024
|
+
let t3 = n2.get(e3);
|
|
3025
|
+
return t3 ? [t3.id, ...t3.childIds ?? []] : [e3];
|
|
3026
|
+
});
|
|
3027
|
+
};
|
|
3028
|
+
var is = (e2, t2) => ({ [e2.customizationType === Ki.MODIFIER ? $.modifierChoice : $.optionChoice]: { $hasSome: rs(e2, t2) } });
|
|
3029
|
+
var as = (e2, t2) => {
|
|
3030
|
+
let n2 = new Map(e2.filter((e3) => e3.type === q.TEXT_CHOICES || e3.type === q.SWATCH_CHOICES).map((e3) => [e3.id, e3]));
|
|
3031
|
+
return Object.entries(t2.customizationIdToChoiceIds ?? {}).flatMap(([e3, t3]) => {
|
|
3032
|
+
let r2 = n2.get(e3);
|
|
3033
|
+
return !r2 || t3.length === 0 ? [] : [is(r2, t3)];
|
|
3034
|
+
});
|
|
3035
|
+
};
|
|
3036
|
+
function os(e2, t2, n2) {
|
|
3037
|
+
let r2 = [{ [es]: { $matchItems: [{ id: e2 }] } }, ...ns(n2), ...as(t2, n2)];
|
|
3038
|
+
return r2.length === 1 ? r2[0] : { $and: r2 };
|
|
3039
|
+
}
|
|
3040
|
+
function ss(e2) {
|
|
3041
|
+
let t2 = mo(e2);
|
|
3042
|
+
if (t2?.fieldName) return [{ fieldName: t2.fieldName, order: t2.order }];
|
|
3043
|
+
}
|
|
3044
|
+
var cs = [K.URL, K.CURRENCY, K.MEDIA_ITEMS_INFO, K.MIN_PRICE_VARIANT, K.DISCOUNT_INFO, K.PRODUCT_CHOICES_MEDIA_REFERENCES, K.BREADCRUMBS_INFO];
|
|
3045
|
+
var ls = async (e2, t2) => {
|
|
3046
|
+
let n2 = await ja({ cursorPaging: { limit: t2, cursor: e2 } }, { fields: cs });
|
|
3047
|
+
return { products: (n2.products ?? []).map(Ro), nextCursor: n2.pagingMetadata?.cursors?.next ?? void 0, hasNext: n2.pagingMetadata?.hasNext ?? false };
|
|
3048
|
+
};
|
|
3049
|
+
async function us({ categoryId: e2, filters: t2, filterSelection: n2, sortType: r2, productsPerPage: i2, cursor: a2 }) {
|
|
3050
|
+
if (a2 !== void 0) return ls(a2, i2);
|
|
3051
|
+
let o2 = os(e2, t2, n2), s2 = ss(r2), c2 = { filter: o2, cursorPaging: { limit: i2 }, ...s2 && { sort: s2 } }, [l2, u2] = await Promise.all([ja(c2, { fields: cs }), Ma({ filter: o2 })]);
|
|
3052
|
+
return { products: (l2.products ?? []).map(Ro), productCount: u2?.count ?? 0, nextCursor: l2.pagingMetadata?.cursors?.next ?? void 0, hasNext: l2.pagingMetadata?.hasNext ?? false };
|
|
3053
|
+
}
|
|
3054
|
+
var ds = (e2, t2) => `${e2}:${[...t2].toSorted().join(`,`)}`;
|
|
3055
|
+
function fs(e2) {
|
|
3056
|
+
if (fi(e2)) return ``;
|
|
3057
|
+
let t2 = Object.entries(e2.customizationIdToChoiceIds ?? {}).filter(([, e3]) => e3.length > 0).map(([e3, t3]) => ds(e3, t3)).toSorted().join(`;`), n2 = [];
|
|
3058
|
+
return e2.priceMin !== void 0 && n2.push(`min:${e2.priceMin}`), e2.priceMax !== void 0 && n2.push(`max:${e2.priceMax}`), t2 && n2.push(t2), n2.join(`&`);
|
|
3059
|
+
}
|
|
3060
|
+
function ps(e2, t2, i2, a2, o2, s2) {
|
|
3061
|
+
let c2 = fs(i2), l2 = c2 === s2.filterSelectionKey && a2 === s2.sortType && o2 === s2.productsPerPage ? { pages: [s2.page], pageParams: [void 0] } : void 0, { data: u2, isFetching: d2, isError: f2, hasNextPage: p2, fetchNextPage: m2 } = $r({ queryKey: [`category-products`, e2, c2, a2, o2], queryFn: ({ pageParam: n2 }) => us({ categoryId: e2, filters: t2, filterSelection: i2, sortType: a2, productsPerPage: o2, cursor: n2 }), initialPageParam: void 0, getNextPageParam: (e3) => e3.hasNext ? e3.nextCursor : void 0, initialData: l2, staleTime: 1 / 0, placeholderData: Qn, retry: false }), ee2 = n(async () => {
|
|
3062
|
+
await m2({ cancelRefetch: false });
|
|
3063
|
+
}, [m2]);
|
|
3064
|
+
return { products: r(() => (u2?.pages ?? []).flatMap((e3) => e3.products), [u2]), productCount: u2?.pages[0]?.productCount ?? 0, isLoadingProducts: d2, hasProductsError: f2, hasMoreProducts: p2, loadMoreProducts: ee2 };
|
|
3065
|
+
}
|
|
3066
|
+
function ms(e2, t2) {
|
|
3067
|
+
let { category: n2, filters: i2, currency: a2, promotions: o2, initialProductList: s2, defaultLocationId: c2 } = e2, l2 = fo(i2), u2 = bo(), { products: d2, ...f2 } = ps(n2.id, i2, l2.filterSelection, u2.selectedSortType, t2, s2);
|
|
3068
|
+
return { filters: i2, currency: a2, productItems: r(() => d2.map((e3) => ({ product: e3, defaultLocationId: c2 })), [d2, c2]), promotionItems: r(() => o2.map((e3) => ({ promotion: e3 })), [o2]), ...l2, ...u2, ...f2 };
|
|
3069
|
+
}
|
|
3070
|
+
var hs = ei(`@wix/site-service-warmup-data`);
|
|
3071
|
+
async function gs(e2, t2, n2) {
|
|
3072
|
+
let r2 = typeof window > `u`;
|
|
3073
|
+
if (!r2 && e2) try {
|
|
3074
|
+
let n3 = await e2.get(t2);
|
|
3075
|
+
if (n3 !== null) return n3;
|
|
3076
|
+
} catch {
|
|
3077
|
+
}
|
|
3078
|
+
let i2 = await n2();
|
|
3079
|
+
if (r2 && e2) try {
|
|
3080
|
+
e2.set(t2, i2);
|
|
3081
|
+
} catch {
|
|
3082
|
+
}
|
|
3083
|
+
return i2;
|
|
3084
|
+
}
|
|
3085
|
+
function _s(e2, t2) {
|
|
3086
|
+
let n2 = l(), [r2] = i(() => {
|
|
3087
|
+
let r3;
|
|
3088
|
+
try {
|
|
3089
|
+
r3 = n2(hs);
|
|
3090
|
+
} catch {
|
|
3091
|
+
r3 = null;
|
|
3092
|
+
}
|
|
3093
|
+
return gs(r3, e2, t2);
|
|
3094
|
+
});
|
|
3095
|
+
return r2;
|
|
3096
|
+
}
|
|
3097
|
+
async function vs() {
|
|
3098
|
+
return (await Va().eq(`defaultLocation`, true).find()).items?.[0]?._id ?? void 0;
|
|
3099
|
+
}
|
|
3100
|
+
function ys(e2) {
|
|
3101
|
+
return O(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` }] } }));
|
|
3102
|
+
}
|
|
3103
|
+
var bs = `@wix/auto_sdk_categories_categories`;
|
|
3104
|
+
function xs(e2) {
|
|
3105
|
+
function t2({ host: t3 }) {
|
|
3106
|
+
return { entityFqdn: `wix.categories.v1.category`, method: `GET`, methodFqn: `com.wix.categories.api.v1.CategoriesService.GetCategory`, packageName: bs, migrationOptions: { optInTransformResponse: true }, url: ys({ protoPath: `/v1/categories/{categoryId}`, data: e2, host: t3 }), params: D(e2), transformResponse: (e3) => w(e3, [{ transformFn: C, paths: [{ path: `category.createdDate` }, { path: `category.updatedDate` }, { path: `category.image.urlExpirationDate` }, { path: `category.richContentDescription.metadata.createdTimestamp` }, { path: `category.richContentDescription.metadata.updatedTimestamp` }] }, { transformFn: A, 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` }] }]) };
|
|
3107
|
+
}
|
|
3108
|
+
return t2;
|
|
3109
|
+
}
|
|
3110
|
+
var Ss = ((e2) => (e2.BREADCRUMBS_INFO = `BREADCRUMBS_INFO`, e2.DESCRIPTION = `DESCRIPTION`, e2.RICH_CONTENT_DESCRIPTION = `RICH_CONTENT_DESCRIPTION`, e2))(Ss || {});
|
|
3111
|
+
async function Cs(e2, t2, n2) {
|
|
3112
|
+
let { httpClient: r2, sideEffects: i2 } = arguments[3], a2 = xs(x({ categoryId: e2, treeReference: t2, fields: n2?.fields }, []));
|
|
3113
|
+
i2?.onSiteCall?.();
|
|
3114
|
+
try {
|
|
3115
|
+
let e3 = await r2.request(a2);
|
|
3116
|
+
return i2?.onSuccess?.(e3), S(w(e3.data, [{ transformFn: H, paths: [{ path: `category.image` }] }]), [`category.richContentDescription`])?.category;
|
|
3117
|
+
} catch (e3) {
|
|
3118
|
+
let t3 = T(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { categoryId: `$[0]`, treeReference: `$[1]`, fields: `$[2].fields` }, singleArgumentUnchanged: false }, [`categoryId`, `treeReference`, `options`]);
|
|
3119
|
+
throw i2?.onError?.(e3), t3;
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
({ ...V() }, { ...pa() });
|
|
3123
|
+
function ws(e2) {
|
|
3124
|
+
return (t2, n2, r2) => Cs(t2, n2, r2, { httpClient: e2 });
|
|
3125
|
+
}
|
|
3126
|
+
var Ts = v(`wix.categories.v1.category_category_moved`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
3127
|
+
var Es = v(`wix.categories.v1.category_created`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `entity.richContentDescription.metadata.createdTimestamp` }, { path: `entity.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `entity.image` }] }, { transformFn: A, 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` }] }])))();
|
|
3128
|
+
var Ds = v(`wix.categories.v1.category_deleted`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `undefined.createdDate` }, { path: `undefined.updatedDate` }, { path: `undefined.richContentDescription.metadata.createdTimestamp` }, { path: `undefined.richContentDescription.metadata.updatedTimestamp` }, { path: `metadata.eventTime` }] }, { transformFn: H, paths: [{ path: `undefined.image` }] }, { transformFn: A, 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` }] }])))();
|
|
3129
|
+
var Os = v(`wix.categories.v1.category_item_added_to_category`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
3130
|
+
var ks = v(`wix.categories.v1.category_item_removed_from_category`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
3131
|
+
var As = v(`wix.categories.v1.category_items_arranged_in_category`, true, (e2) => S(w(e2, [{ transformFn: C, paths: [{ path: `metadata.eventTime` }] }])))();
|
|
3132
|
+
var js = v(`wix.categories.v1.category_updated`, true, (e2) => S(w(e2, [{ transformFn: C, 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: H, paths: [{ path: `entity.image` }, { path: `modifiedFields.image` }] }, { transformFn: A, 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` }] }])))();
|
|
3133
|
+
var Ms = E(ws);
|
|
3134
|
+
k(Ts), k(Es), k(Ds), k(Os), k(ks), k(As), k(js);
|
|
3135
|
+
function Ns(e2) {
|
|
3136
|
+
if (!e2) return null;
|
|
3137
|
+
let t2 = e2.match(/image:\/\/v1\/([^/#]+)/);
|
|
3138
|
+
return t2?.[1] ? t2[1] : e2.match(/\/media\/([^/]+)/)?.[1] ?? null;
|
|
3139
|
+
}
|
|
3140
|
+
function Ps(e2) {
|
|
3141
|
+
return `https://static.wixstatic.com/media/${e2}`;
|
|
3142
|
+
}
|
|
3143
|
+
function Fs(e2) {
|
|
3144
|
+
if (!e2) return null;
|
|
3145
|
+
let t2 = e2.match(/#originWidth=(\d+)&originHeight=(\d+)/);
|
|
3146
|
+
return t2 ? { width: parseInt(t2[1], 10), height: parseInt(t2[2], 10) } : null;
|
|
3147
|
+
}
|
|
3148
|
+
var Is = (e2) => `/category/${e2}`;
|
|
3149
|
+
var Ls = (e2) => ({ ...e2, nodes: e2.nodes ?? [] });
|
|
3150
|
+
var Rs = (e2) => {
|
|
3151
|
+
if (!e2) return;
|
|
3152
|
+
let t2 = Fs(e2);
|
|
3153
|
+
return { uri: Ns(e2) ?? void 0, url: e2, width: t2?.width, height: t2?.height };
|
|
3154
|
+
};
|
|
3155
|
+
var zs = (e2) => e2.filter((e3) => e3.categoryId).map((e3) => {
|
|
3156
|
+
let t2 = e3.categorySlug ?? ``;
|
|
3157
|
+
return { id: e3.categoryId ?? ``, name: e3.categoryName ?? ``, slug: t2, href: Is(t2) };
|
|
3158
|
+
});
|
|
3159
|
+
var Bs = (e2) => ({ type: e2.type, props: e2.props ?? void 0, meta: e2.meta ?? void 0, children: e2.children, custom: e2.custom, disabled: e2.disabled });
|
|
3160
|
+
var Vs = (e2) => {
|
|
3161
|
+
if (e2) return { preventAutoRedirect: e2.preventAutoRedirect, keywords: e2.keywords?.map((e3) => ({ term: e3.term, isMain: e3.isMain, origin: e3.origin ?? void 0 })) };
|
|
3162
|
+
};
|
|
3163
|
+
var Hs = (e2) => {
|
|
3164
|
+
if (e2) return { tags: e2.tags?.map(Bs), settings: Vs(e2.settings) };
|
|
3165
|
+
};
|
|
3166
|
+
function Us(e2) {
|
|
3167
|
+
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: Hs(e2.seoData), richContentDescription: e2.richContentDescription ? Ls(e2.richContentDescription) : void 0, image: Rs(e2.image), breadcrumbs: zs(e2.breadcrumbsInfo?.breadcrumbs ?? []) };
|
|
3168
|
+
}
|
|
3169
|
+
var Ws = { appNamespace: `@wix/stores`, treeKey: null };
|
|
3170
|
+
var Gs = [Ss.BREADCRUMBS_INFO, Ss.DESCRIPTION, Ss.RICH_CONTENT_DESCRIPTION];
|
|
3171
|
+
var Ks = (e2, t2) => {
|
|
3172
|
+
if (!e2?._id || e2.visible === false) throw Error(t2);
|
|
3173
|
+
return Us(e2);
|
|
3174
|
+
};
|
|
3175
|
+
async function qs(e2) {
|
|
3176
|
+
return Ks(await Ms(e2, Ws, { fields: Gs }), `Category not found for id: ${e2}`);
|
|
3177
|
+
}
|
|
3178
|
+
var Js = (e2, t2, n2) => {
|
|
3179
|
+
let r2 = [];
|
|
3180
|
+
for (let i2 of e2.keys()) if (!t2.has(i2)) {
|
|
3181
|
+
let e3 = n2.find((e4) => e4._id === i2);
|
|
3182
|
+
e3 && r2.push(ic(e3, 0));
|
|
3183
|
+
}
|
|
3184
|
+
return r2;
|
|
3185
|
+
};
|
|
3186
|
+
var Ys = (e2) => {
|
|
3187
|
+
let t2 = /* @__PURE__ */ new Map();
|
|
3188
|
+
for (let { _id: n2, primaryChoiceIds: r2 } of e2) if (n2) for (let e3 of r2 ?? []) {
|
|
3189
|
+
let r3 = t2.get(e3) ?? [];
|
|
3190
|
+
t2.set(e3, [...r3, n2]);
|
|
3191
|
+
}
|
|
3192
|
+
return t2;
|
|
3193
|
+
};
|
|
3194
|
+
var Xs = (e2, t2, n2) => {
|
|
3195
|
+
let r2 = Js(t2, new Set(e2.map((e3) => e3.id)), n2), i2 = [...e2, ...r2], a2 = new Map(i2.map((e3) => [e3.id, e3])), o2 = new Set([...t2.values()].flat());
|
|
3196
|
+
return i2.flatMap((e3) => {
|
|
3197
|
+
if (o2.has(e3.id)) return [];
|
|
3198
|
+
let n3 = t2.get(e3.id);
|
|
3199
|
+
if (!n3) return [e3];
|
|
3200
|
+
let r3 = n3.filter((e4) => a2.has(e4));
|
|
3201
|
+
if (r3.length === 0 && e3.count === 0) return [];
|
|
3202
|
+
let i3 = r3.reduce((e4, t3) => e4 + (a2.get(t3)?.count ?? 0), 0);
|
|
3203
|
+
return [{ ...e3, count: e3.count + i3, linkedChoiceIds: r3 }];
|
|
3204
|
+
});
|
|
3205
|
+
};
|
|
3206
|
+
function Zs(e2, t2) {
|
|
3207
|
+
return Xs(e2, Ys(t2), t2);
|
|
3208
|
+
}
|
|
3209
|
+
var Qs = (e2) => {
|
|
3210
|
+
let t2 = e2.trim();
|
|
3211
|
+
if (t2 === ``) return null;
|
|
3212
|
+
let n2 = Number(t2);
|
|
3213
|
+
return Number.isFinite(n2) ? n2 : null;
|
|
3214
|
+
};
|
|
3215
|
+
var $s = (e2, t2) => {
|
|
3216
|
+
let n2 = t2.choicesSettings?.choices ?? [], r2 = new Map(n2.map((e3, t3) => [e3._id ?? ``, t3])), i2 = (e3) => r2.get(e3.id) ?? 2 ** 53 - 1;
|
|
3217
|
+
return e2.toSorted((e3, t3) => i2(e3) - i2(t3));
|
|
3218
|
+
};
|
|
3219
|
+
var ec = (e2, t2, n2) => t2 === U.TEXT_CHOICES ? nc(e2, (e3) => e3.name) : n2 ? tc(e2, (e3) => e3.count) : [...e2];
|
|
3220
|
+
var tc = (e2, t2) => e2.toSorted((e3, n2) => t2(n2) - t2(e3));
|
|
3221
|
+
var nc = (e2, t2) => e2.toSorted((e3, n2) => {
|
|
3222
|
+
let r2 = Qs(t2(e3)), i2 = Qs(t2(n2));
|
|
3223
|
+
return r2 !== null && i2 !== null ? r2 - i2 : r2 === null ? i2 === null ? t2(e3).toLowerCase().localeCompare(t2(n2).toLowerCase()) : 1 : -1;
|
|
3224
|
+
});
|
|
3225
|
+
function rc(e2, t2, n2) {
|
|
3226
|
+
switch (t2.choicesSettings?.sortOrder) {
|
|
3227
|
+
case W.BY_NAME:
|
|
3228
|
+
return nc(e2, (e3) => e3.name);
|
|
3229
|
+
case W.BY_PRODUCT_COUNT:
|
|
3230
|
+
return tc(e2, (e3) => e3.count);
|
|
3231
|
+
case W.MANUAL:
|
|
3232
|
+
return $s(e2, t2);
|
|
3233
|
+
case W.DEFAULT:
|
|
3234
|
+
default:
|
|
3235
|
+
return ec(e2, t2.customizationRenderType, n2);
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
var ic = (e2, t2) => ({ id: e2._id ?? ``, name: e2.name ?? ``, type: e2.choiceType, values: e2.colorCode === void 0 ? [] : [e2.colorCode], count: t2, linkedChoiceIds: [], displayImage: e2.displayImage });
|
|
3239
|
+
function ac(e2, t2) {
|
|
3240
|
+
let n2 = e2.choicesSettings?.choices ?? [], r2 = new Map(n2.map((e3) => [e3._id, e3])), i2 = [...t2].flatMap(([e3, t3]) => {
|
|
3241
|
+
let n3 = r2.get(e3);
|
|
3242
|
+
return n3 ? [ic(n3, t3)] : [];
|
|
3243
|
+
}), a2 = n2.some((e3) => (e3.primaryChoiceIds?.length ?? 0) > 0);
|
|
3244
|
+
return rc(a2 ? Zs(i2, n2) : i2, e2, a2);
|
|
3245
|
+
}
|
|
3246
|
+
var oc = (e2) => {
|
|
3247
|
+
let t2 = Ns(e2);
|
|
3248
|
+
if (!t2) return;
|
|
3249
|
+
let n2 = Fs(e2);
|
|
3250
|
+
return { id: t2, url: Ps(t2), ...n2 ? { width: n2.width, height: n2.height } : {} };
|
|
3251
|
+
};
|
|
3252
|
+
var sc = (e2) => {
|
|
3253
|
+
let t2 = e2.displayImage === void 0 ? void 0 : oc(e2.displayImage);
|
|
3254
|
+
return { ...lc(e2), ...e2.values[0] === void 0 ? {} : { colorHexCode: e2.values[0] }, ...t2 ? { displayImage: t2 } : {} };
|
|
3255
|
+
};
|
|
3256
|
+
var cc = (e2) => ({ type: q.SWATCH_CHOICES, id: e2.id, customizationType: e2.type, name: e2.name, values: e2.choices.map(sc) });
|
|
3257
|
+
var lc = (e2) => ({ id: e2.id, name: e2.name, ...e2.linkedChoiceIds.length > 0 ? { childIds: e2.linkedChoiceIds } : {} });
|
|
3258
|
+
var uc = (e2) => ({ type: q.TEXT_CHOICES, id: e2.id, customizationType: e2.type, name: e2.name, values: e2.choices.map(lc) });
|
|
3259
|
+
var dc = (e2, t2, n2, r2) => {
|
|
3260
|
+
let i2 = new Map(t2.map((e3) => [e3._id, e3]));
|
|
3261
|
+
return n2.flatMap((t3) => {
|
|
3262
|
+
let n3 = i2.get(t3);
|
|
3263
|
+
return n3 ? [{ id: t3, name: n3.name ?? ``, renderType: n3.customizationRenderType, type: e2, choices: ac(n3, r2) }] : [];
|
|
3264
|
+
});
|
|
3265
|
+
};
|
|
3266
|
+
var fc = (e2) => nc(e2.filter((e3) => e3.renderType === U.SWATCH_CHOICES).map(cc), (e3) => e3.name);
|
|
3267
|
+
var pc = (e2) => nc(e2.filter((e3) => e3.renderType === U.TEXT_CHOICES).map(uc), (e3) => e3.name);
|
|
3268
|
+
function mc(e2, t2, n2, r2) {
|
|
3269
|
+
if (n2.length === 0) return [];
|
|
3270
|
+
let i2 = dc(e2, t2, n2, r2);
|
|
3271
|
+
return [...fc(i2), ...pc(i2)];
|
|
3272
|
+
}
|
|
3273
|
+
function hc(e2, t2) {
|
|
3274
|
+
if (!(e2 === void 0 || t2 === void 0 || e2 >= t2)) return { type: q.PRICE, name: Qa.PRICE, minPrice: e2, maxPrice: t2 };
|
|
3275
|
+
}
|
|
3276
|
+
var gc = g((e2, t2) => {
|
|
3277
|
+
function n2(e3, t3, n3) {
|
|
3278
|
+
var r2 = -1, i2 = e3.length;
|
|
3279
|
+
t3 < 0 && (t3 = -t3 > i2 ? 0 : i2 + t3), n3 = n3 > i2 ? i2 : n3, n3 < 0 && (n3 += i2), i2 = t3 > n3 ? 0 : n3 - t3 >>> 0, t3 >>>= 0;
|
|
3280
|
+
for (var a2 = Array(i2); ++r2 < i2; ) a2[r2] = e3[r2 + t3];
|
|
3281
|
+
return a2;
|
|
3282
|
+
}
|
|
3283
|
+
t2.exports = n2;
|
|
3284
|
+
});
|
|
3285
|
+
var _c = g((e2, t2) => {
|
|
3286
|
+
function n2(e3, t3) {
|
|
3287
|
+
return e3 === t3 || e3 !== e3 && t3 !== t3;
|
|
3288
|
+
}
|
|
3289
|
+
t2.exports = n2;
|
|
3290
|
+
});
|
|
3291
|
+
var vc = g((e2, t2) => {
|
|
3292
|
+
t2.exports = typeof window == `object` && window && window.Object === Object && window;
|
|
3293
|
+
});
|
|
3294
|
+
var yc = g((e2, t2) => {
|
|
3295
|
+
var n2 = vc(), r2 = typeof self == `object` && self && self.Object === Object && self;
|
|
3296
|
+
t2.exports = n2 || r2 || Function(`return this`)();
|
|
3297
|
+
});
|
|
3298
|
+
var bc = g((e2, t2) => {
|
|
3299
|
+
t2.exports = yc().Symbol;
|
|
3300
|
+
});
|
|
3301
|
+
var xc = g((e2, t2) => {
|
|
3302
|
+
var n2 = bc(), r2 = Object.prototype, i2 = r2.hasOwnProperty, a2 = r2.toString, o2 = n2 ? n2.toStringTag : void 0;
|
|
3303
|
+
function s2(e3) {
|
|
3304
|
+
var t3 = i2.call(e3, o2), n3 = e3[o2];
|
|
3305
|
+
try {
|
|
3306
|
+
e3[o2] = void 0;
|
|
3307
|
+
var r3 = true;
|
|
3308
|
+
} catch {
|
|
3309
|
+
}
|
|
3310
|
+
var s3 = a2.call(e3);
|
|
3311
|
+
return r3 && (t3 ? e3[o2] = n3 : delete e3[o2]), s3;
|
|
3312
|
+
}
|
|
3313
|
+
t2.exports = s2;
|
|
3314
|
+
});
|
|
3315
|
+
var Sc = g((e2, t2) => {
|
|
3316
|
+
var n2 = Object.prototype.toString;
|
|
3317
|
+
function r2(e3) {
|
|
3318
|
+
return n2.call(e3);
|
|
3319
|
+
}
|
|
3320
|
+
t2.exports = r2;
|
|
3321
|
+
});
|
|
3322
|
+
var Cc = g((e2, t2) => {
|
|
3323
|
+
var n2 = bc(), r2 = xc(), i2 = Sc(), a2 = `[object Null]`, o2 = `[object Undefined]`, s2 = n2 ? n2.toStringTag : void 0;
|
|
3324
|
+
function c2(e3) {
|
|
3325
|
+
return e3 == null ? e3 === void 0 ? o2 : a2 : s2 && s2 in Object(e3) ? r2(e3) : i2(e3);
|
|
3326
|
+
}
|
|
3327
|
+
t2.exports = c2;
|
|
3328
|
+
});
|
|
3329
|
+
var wc = g((e2, t2) => {
|
|
3330
|
+
function n2(e3) {
|
|
3331
|
+
var t3 = typeof e3;
|
|
3332
|
+
return e3 != null && (t3 == `object` || t3 == `function`);
|
|
3333
|
+
}
|
|
3334
|
+
t2.exports = n2;
|
|
3335
|
+
});
|
|
3336
|
+
var Tc = g((e2, t2) => {
|
|
3337
|
+
var n2 = Cc(), r2 = wc(), i2 = `[object AsyncFunction]`, a2 = `[object Function]`, o2 = `[object GeneratorFunction]`, s2 = `[object Proxy]`;
|
|
3338
|
+
function c2(e3) {
|
|
3339
|
+
if (!r2(e3)) return false;
|
|
3340
|
+
var t3 = n2(e3);
|
|
3341
|
+
return t3 == a2 || t3 == o2 || t3 == i2 || t3 == s2;
|
|
3342
|
+
}
|
|
3343
|
+
t2.exports = c2;
|
|
3344
|
+
});
|
|
3345
|
+
var Ec = g((e2, t2) => {
|
|
3346
|
+
function n2(e3) {
|
|
3347
|
+
return typeof e3 == `number` && e3 > -1 && e3 % 1 == 0 && e3 <= 9007199254740991;
|
|
3348
|
+
}
|
|
3349
|
+
t2.exports = n2;
|
|
3350
|
+
});
|
|
3351
|
+
var Dc = g((e2, t2) => {
|
|
3352
|
+
var n2 = Tc(), r2 = Ec();
|
|
3353
|
+
function i2(e3) {
|
|
3354
|
+
return e3 != null && r2(e3.length) && !n2(e3);
|
|
3355
|
+
}
|
|
3356
|
+
t2.exports = i2;
|
|
3357
|
+
});
|
|
3358
|
+
var Oc = g((e2, t2) => {
|
|
3359
|
+
var n2 = /^(?:0|[1-9]\d*)$/;
|
|
3360
|
+
function r2(e3, t3) {
|
|
3361
|
+
var r3 = typeof e3;
|
|
3362
|
+
return t3 ??= 9007199254740991, !!t3 && (r3 == `number` || r3 != `symbol` && n2.test(e3)) && e3 > -1 && e3 % 1 == 0 && e3 < t3;
|
|
3363
|
+
}
|
|
3364
|
+
t2.exports = r2;
|
|
3365
|
+
});
|
|
3366
|
+
var kc = g((e2, t2) => {
|
|
3367
|
+
var n2 = _c(), r2 = Dc(), i2 = Oc(), a2 = wc();
|
|
3368
|
+
function o2(e3, t3, o3) {
|
|
3369
|
+
if (!a2(o3)) return false;
|
|
3370
|
+
var s2 = typeof t3;
|
|
3371
|
+
return (s2 == `number` ? r2(o3) && i2(t3, o3.length) : s2 == `string` && t3 in o3) ? n2(o3[t3], e3) : false;
|
|
3372
|
+
}
|
|
3373
|
+
t2.exports = o2;
|
|
3374
|
+
});
|
|
3375
|
+
var Ac = g((e2, t2) => {
|
|
3376
|
+
var n2 = /\s/;
|
|
3377
|
+
function r2(e3) {
|
|
3378
|
+
for (var t3 = e3.length; t3-- && n2.test(e3.charAt(t3)); ) ;
|
|
3379
|
+
return t3;
|
|
3380
|
+
}
|
|
3381
|
+
t2.exports = r2;
|
|
3382
|
+
});
|
|
3383
|
+
var jc = g((e2, t2) => {
|
|
3384
|
+
var n2 = Ac(), r2 = /^\s+/;
|
|
3385
|
+
function i2(e3) {
|
|
3386
|
+
return e3 && e3.slice(0, n2(e3) + 1).replace(r2, ``);
|
|
3387
|
+
}
|
|
3388
|
+
t2.exports = i2;
|
|
3389
|
+
});
|
|
3390
|
+
var Mc = g((e2, t2) => {
|
|
3391
|
+
function n2(e3) {
|
|
3392
|
+
return typeof e3 == `object` && !!e3;
|
|
3393
|
+
}
|
|
3394
|
+
t2.exports = n2;
|
|
3395
|
+
});
|
|
3396
|
+
var Nc = g((e2, t2) => {
|
|
3397
|
+
var n2 = Cc(), r2 = Mc(), i2 = `[object Symbol]`;
|
|
3398
|
+
function a2(e3) {
|
|
3399
|
+
return typeof e3 == `symbol` || r2(e3) && n2(e3) == i2;
|
|
3400
|
+
}
|
|
3401
|
+
t2.exports = a2;
|
|
3402
|
+
});
|
|
3403
|
+
var Pc = g((e2, t2) => {
|
|
3404
|
+
var n2 = jc(), r2 = wc(), i2 = Nc(), a2 = NaN, o2 = /^[-+]0x[0-9a-f]+$/i, s2 = /^0b[01]+$/i, c2 = /^0o[0-7]+$/i, l2 = parseInt;
|
|
3405
|
+
function u2(e3) {
|
|
3406
|
+
if (typeof e3 == `number`) return e3;
|
|
3407
|
+
if (i2(e3)) return a2;
|
|
3408
|
+
if (r2(e3)) {
|
|
3409
|
+
var t3 = typeof e3.valueOf == `function` ? e3.valueOf() : e3;
|
|
3410
|
+
e3 = r2(t3) ? t3 + `` : t3;
|
|
3411
|
+
}
|
|
3412
|
+
if (typeof e3 != `string`) return e3 === 0 ? e3 : +e3;
|
|
3413
|
+
e3 = n2(e3);
|
|
3414
|
+
var u3 = s2.test(e3);
|
|
3415
|
+
return u3 || c2.test(e3) ? l2(e3.slice(2), u3 ? 2 : 8) : o2.test(e3) ? a2 : +e3;
|
|
3416
|
+
}
|
|
3417
|
+
t2.exports = u2;
|
|
3418
|
+
});
|
|
3419
|
+
var Fc = g((e2, t2) => {
|
|
3420
|
+
var n2 = Pc(), r2 = 1 / 0, i2 = 17976931348623157e292;
|
|
3421
|
+
function a2(e3) {
|
|
3422
|
+
return e3 ? (e3 = n2(e3), e3 === r2 || e3 === -r2 ? (e3 < 0 ? -1 : 1) * i2 : e3 === e3 ? e3 : 0) : e3 === 0 ? e3 : 0;
|
|
3423
|
+
}
|
|
3424
|
+
t2.exports = a2;
|
|
3425
|
+
});
|
|
3426
|
+
var Ic = g((e2, t2) => {
|
|
3427
|
+
var n2 = Fc();
|
|
3428
|
+
function r2(e3) {
|
|
3429
|
+
var t3 = n2(e3), r3 = t3 % 1;
|
|
3430
|
+
return t3 === t3 ? r3 ? t3 - r3 : t3 : 0;
|
|
3431
|
+
}
|
|
3432
|
+
t2.exports = r2;
|
|
3433
|
+
});
|
|
3434
|
+
var Lc = ne(g((e2, t2) => {
|
|
3435
|
+
var n2 = gc(), r2 = kc(), i2 = Ic(), a2 = Math.ceil, o2 = Math.max;
|
|
3436
|
+
function s2(e3, t3, s3) {
|
|
3437
|
+
t3 = (s3 ? r2(e3, t3, s3) : t3 === void 0) ? 1 : o2(i2(t3), 0);
|
|
3438
|
+
var c2 = e3 == null ? 0 : e3.length;
|
|
3439
|
+
if (!c2 || t3 < 1) return [];
|
|
3440
|
+
for (var l2 = 0, u2 = 0, d2 = Array(a2(c2 / t3)); l2 < c2; ) d2[u2++] = n2(e3, l2, l2 += t3);
|
|
3441
|
+
return d2;
|
|
3442
|
+
}
|
|
3443
|
+
t2.exports = s2;
|
|
3444
|
+
})(), 1);
|
|
3445
|
+
var Rc = [qi.CHOICE_DISPLAY_IMAGE];
|
|
3446
|
+
var zc = `customizationRenderType`;
|
|
3447
|
+
async function Bc(e2) {
|
|
3448
|
+
let t2 = (0, Lc.default)(e2, 100);
|
|
3449
|
+
return (await Promise.all(t2.map(Vc))).flat();
|
|
3450
|
+
}
|
|
3451
|
+
var Vc = async (e2) => (await na({ fields: Rc }).hasSome(`_id`, e2).ne(zc, U.FREE_TEXT).limit(100).find()).items;
|
|
3452
|
+
var Hc = (e2, t2, n2) => ({ name: e2, type: Ca.SCALAR, fieldPath: t2, scalar: { type: n2 } });
|
|
3453
|
+
var Uc = (e2, t2, n2) => ({ name: e2, type: Ca.VALUE, fieldPath: t2, value: { limit: n2, sortType: ba.COUNT, sortDirection: xa.DESC } });
|
|
3454
|
+
function Wc(e2) {
|
|
3455
|
+
let t2 = [];
|
|
3456
|
+
return e2.includes(Z.PRICE) && t2.push(Hc(Q.minPrice, $.minPrice, Sa.MIN), Hc(Q.maxPrice, $.maxPrice, Sa.MAX)), e2.includes(Z.OPTIONS) && t2.push(Uc(Q.options, $.option, ts.options), Uc(Q.optionsWithChoice, $.optionChoice, ts.choices)), e2.includes(Z.MODIFIERS) && t2.push(Uc(Q.modifiers, $.modifier, ts.modifiers), Uc(Q.modifiersWithChoice, $.modifierChoice, ts.choices)), t2;
|
|
3457
|
+
}
|
|
3458
|
+
var Gc = (e2) => {
|
|
3459
|
+
let t2 = e2?.values?.results ?? [], n2 = /* @__PURE__ */ new Map();
|
|
3460
|
+
for (let e3 of t2) e3.value !== void 0 && e3.count !== void 0 && n2.set(e3.value, e3.count);
|
|
3461
|
+
return n2;
|
|
3462
|
+
};
|
|
3463
|
+
var Kc = (e2) => (e2?.values?.results ?? []).flatMap((e3) => e3.value === void 0 ? [] : [e3.value]);
|
|
3464
|
+
var qc = (e2) => {
|
|
3465
|
+
let t2 = /* @__PURE__ */ new Map();
|
|
3466
|
+
for (let n2 of e2) n2.name !== void 0 && t2.set(n2.name, n2);
|
|
3467
|
+
return t2;
|
|
3468
|
+
};
|
|
3469
|
+
async function Jc(e2, t2) {
|
|
3470
|
+
let n2 = await ja({ filter: { [es]: { $matchItems: [{ id: e2 }] } }, cursorPaging: { limit: 1 }, aggregations: Wc(t2) }, { fields: [K.CURRENCY] }), r2 = qc(n2.aggregationData?.results ?? []);
|
|
3471
|
+
return { minPrice: r2.get(Q.minPrice)?.scalar?.value, maxPrice: r2.get(Q.maxPrice)?.scalar?.value, optionIds: Kc(r2.get(Q.options)), optionChoiceIdToCount: Gc(r2.get(Q.optionsWithChoice)), modifierIds: Kc(r2.get(Q.modifiers)), modifierChoiceIdToCount: Gc(r2.get(Q.modifiersWithChoice)), currency: n2.products?.[0]?.currency ?? void 0 };
|
|
3472
|
+
}
|
|
3473
|
+
var Yc = [Z.PRICE, Z.OPTIONS, Z.MODIFIERS];
|
|
3474
|
+
async function Xc(e2, t2 = Yc) {
|
|
3475
|
+
let n2 = await Jc(e2, t2), r2 = await Bc([...n2.optionIds, ...n2.modifierIds]);
|
|
3476
|
+
return { filters: [hc(n2.minPrice, n2.maxPrice), ...mc(Ki.PRODUCT_OPTION, r2, n2.optionIds, n2.optionChoiceIdToCount), ...mc(Ki.MODIFIER, r2, n2.modifierIds, n2.modifierChoiceIdToCount)].filter((e3) => e3 !== void 0), currency: n2.currency };
|
|
3477
|
+
}
|
|
3478
|
+
var Zc = (e2) => {
|
|
3479
|
+
let t2 = Ns(e2 ?? void 0);
|
|
3480
|
+
if (!t2) return;
|
|
3481
|
+
let n2 = Fs(e2);
|
|
3482
|
+
return { id: t2, url: Ps(t2), ...n2 ? { width: n2.width, height: n2.height } : {} };
|
|
3483
|
+
};
|
|
3484
|
+
var Qc = ({ promotion: e2, position: t2 }) => {
|
|
3485
|
+
if (e2?._id && t2 !== void 0) return { id: e2._id, name: e2.name, destinationUrl: e2.destinationUrl ? { href: e2.destinationUrl } : void 0, image: Zc(e2.media?.image), altText: e2.media?.altText ?? void 0, position: t2 };
|
|
3486
|
+
};
|
|
3487
|
+
async function $c(e2) {
|
|
3488
|
+
return ((await Za(e2)).promotions ?? []).map(Qc).filter((e3) => e3 !== void 0);
|
|
3489
|
+
}
|
|
3490
|
+
var el = async (e2, t2, n2, r2) => {
|
|
3491
|
+
let i2 = [...new URLSearchParams(n2).keys()].length > 0 ? (await t2).filters : [], a2 = io(n2, i2), o2 = vo(n2);
|
|
3492
|
+
return { page: await us({ categoryId: e2, filters: i2, filterSelection: a2, sortType: o2, productsPerPage: r2 }), filterSelectionKey: fs(a2), sortType: o2, productsPerPage: r2 };
|
|
3493
|
+
};
|
|
3494
|
+
async function tl(e2, t2, n2) {
|
|
3495
|
+
let r2 = Xc(e2), [i2, a2, o2] = await Promise.all([el(e2, r2, t2, n2), r2, $c(e2)]), { filters: s2, currency: c2 } = a2;
|
|
3496
|
+
return { filters: s2, currency: c2, promotions: o2, initialProductList: i2 };
|
|
3497
|
+
}
|
|
3498
|
+
var nl = `wixstores-storefront-builder:category-by-id-context-data`;
|
|
3499
|
+
async function rl(e2, t2, n2) {
|
|
3500
|
+
let [r2, i2, a2] = await Promise.all([qs(e2), vs(), tl(e2, t2, n2)]);
|
|
3501
|
+
return { category: r2, defaultLocationId: i2, ...a2 };
|
|
3502
|
+
}
|
|
3503
|
+
function il(e2, t2) {
|
|
3504
|
+
let { search: n2 } = di();
|
|
3505
|
+
return _s(`${nl}:${e2}:${t2}:${n2}`, () => rl(e2, n2, t2));
|
|
3506
|
+
}
|
|
3507
|
+
function al() {
|
|
3508
|
+
throw Error(`useCategoryByIdContext must not be used directly`);
|
|
3509
|
+
}
|
|
3510
|
+
function ol({ categoryValue: e2, productListValue: t2, children: n2 }) {
|
|
3511
|
+
return o(c, { value: e2, children: o(s, { value: t2, children: n2 }) });
|
|
3512
|
+
}
|
|
3513
|
+
var sl = ({ children: e2, dataPromise: t2, productsPerPage: n2 }) => {
|
|
3514
|
+
let r2 = si(t2), i2 = oi(r2), a2 = ms(r2, n2);
|
|
3515
|
+
return o(ol, { categoryValue: i2, productListValue: a2, children: e2 });
|
|
3516
|
+
};
|
|
3517
|
+
var cl = ({ children: e2, categoryId: n2, productsPerPage: r2 }) => {
|
|
3518
|
+
let [a2] = i(() => new Ir()), s2 = il(n2, r2);
|
|
3519
|
+
return o(zr, { client: a2, children: o(t, { fallback: null, children: o(sl, { dataPromise: s2, productsPerPage: r2, children: e2 }) }) });
|
|
3520
|
+
};
|
|
3521
|
+
function ll({ children: e2, categoryId: t2, productsPerPage: n2 = 20 }) {
|
|
3522
|
+
return t2 ? o(cl, { categoryId: t2, productsPerPage: n2, children: e2 }, t2) : null;
|
|
3523
|
+
}
|
|
3524
|
+
var ul = Mn(`733f4f74-23d2-4b03-a0b1-1efdd5e3825b`);
|
|
3525
|
+
export {
|
|
3526
|
+
ll as CategoryByIdContextProvider,
|
|
3527
|
+
ol as CategoryByIdContextValues,
|
|
3528
|
+
ll as default,
|
|
3529
|
+
ul as injectAccessTokenGetter,
|
|
3530
|
+
al as useCategoryByIdContext
|
|
3531
|
+
};
|
|
3532
|
+
//# sourceMappingURL=context-category-by-id-context-provider.mjs.map
|