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