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