@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,4356 @@
1
+ // _sdk-exports/context-product-item-context-provider/runtime.js
2
+ import * as e from "react";
3
+ import { useCallback as t, useMemo as n, useState as r } from "react";
4
+ import { Fragment as i, jsx as a } from "react/jsx-runtime";
5
+ import o, { useProductContext as s } from "@wix/stores/product-context-provider";
6
+ import { useGetService as c, useService as l } from "@wix/services-manager-react";
7
+ var u = Object.create;
8
+ var d = Object.defineProperty;
9
+ var f = Object.getOwnPropertyDescriptor;
10
+ var p = Object.getOwnPropertyNames;
11
+ var m = Object.getPrototypeOf;
12
+ var h = Object.prototype.hasOwnProperty;
13
+ var g = (e2, t2) => () => (t2 || (e2((t2 = { exports: {} }).exports, t2), e2 = null), t2.exports);
14
+ var _ = (e2, t2, n2, r2) => {
15
+ if (t2 && typeof t2 == `object` || typeof t2 == `function`) for (var i2 = p(t2), a2 = 0, o2 = i2.length, s2; a2 < o2; a2++) s2 = i2[a2], !h.call(e2, s2) && s2 !== n2 && d(e2, s2, { get: ((e3) => t2[e3]).bind(null, s2), enumerable: !(r2 = f(t2, s2)) || r2.enumerable });
16
+ return e2;
17
+ };
18
+ var v = (e2, t2, n2) => (n2 = e2 == null ? {} : u(m(e2)), _(t2 || !e2 || !e2.__esModule || !h.call(e2, `default`) ? d(n2, `default`, { value: e2, enumerable: true }) : n2, e2));
19
+ var y = {};
20
+ function b(e2, t2 = false, n2 = (e3) => e3) {
21
+ return () => ({ __type: `event-definition`, type: e2, isDomainEvent: t2, transformations: n2 });
22
+ }
23
+ var x = (e2) => {
24
+ switch (e2) {
25
+ case `get`:
26
+ case `GET`:
27
+ return `GET`;
28
+ case `post`:
29
+ case `POST`:
30
+ return `POST`;
31
+ case `put`:
32
+ case `PUT`:
33
+ return `PUT`;
34
+ case `delete`:
35
+ case `DELETE`:
36
+ return `DELETE`;
37
+ case `patch`:
38
+ case `PATCH`:
39
+ return `PATCH`;
40
+ case `head`:
41
+ case `HEAD`:
42
+ return `HEAD`;
43
+ case `options`:
44
+ case `OPTIONS`:
45
+ return `OPTIONS`;
46
+ default:
47
+ throw Error(`Unknown method: ${e2}`);
48
+ }
49
+ };
50
+ var S = (e2) => (t2) => async (n2) => {
51
+ let r2, i2 = (t3) => {
52
+ 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.`);
53
+ let { method: i3, url: a2, params: o2 } = r2;
54
+ return { ...r2, method: x(i3), url: a2, data: r2.data, params: o2 };
55
+ };
56
+ try {
57
+ let e3 = await t2.request(i2);
58
+ if (r2 === void 0) throw Error(`Request options were not created for this request, please reach out to support channels for assistance.`);
59
+ let n3 = Array.isArray(r2.transformResponse) ? r2.transformResponse : [r2.transformResponse], a2 = e3.data;
60
+ return n3.forEach((t3) => {
61
+ t3 && (a2 = t3(e3.data, e3.headers));
62
+ }), a2;
63
+ } catch (e3) {
64
+ throw typeof e3 == `object` && e3 && `response` in e3 && typeof e3.response == `object` && e3.response !== null && `data` in e3.response ? e3.response.data : e3;
65
+ }
66
+ };
67
+ var C = (e2) => e2.__isAmbassador ? true : !!e2().__isAmbassador;
68
+ var w = `__metadata`;
69
+ var T = `edge.wixapis.com`;
70
+ var E = class extends Error {
71
+ message;
72
+ response;
73
+ constructor(e2, t2) {
74
+ super(e2), this.message = e2, this.response = t2;
75
+ }
76
+ async details() {
77
+ let e2 = await this.response.json();
78
+ return D(this.response.status, e2?.message, e2?.details, { requestId: this.response.headers.get(`X-Wix-Request-Id`), details: e2 });
79
+ }
80
+ };
81
+ var D = (e2, t2, n2, r2) => ({ details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2, requestId: r2?.requestId });
82
+ var O = (e2) => e2?.method && [`post`, `put`, `patch`].includes(e2.method.toLocaleLowerCase()) && e2.body ? { "Content-Type": `application/json` } : {};
83
+ var k = (e2) => e2 && typeof e2 == `object` && !Array.isArray(e2);
84
+ var ee = (e2) => e2.__type === `host`;
85
+ function te(e2, t2) {
86
+ return e2.create(t2);
87
+ }
88
+ var ne = `x-wix-bi-gateway`;
89
+ function re(e2, t2, n2) {
90
+ return { [ne]: ie({ environment: `js-sdk${n2 ? `-${n2}` : ``}`, "package-name": e2.packageName ?? t2?.PACKAGE_NAME, "method-fqn": e2.methodFqn, entity: e2.entityFqdn }) };
91
+ }
92
+ function ie(e2) {
93
+ return Object.entries(e2).filter(([e3, t2]) => !!t2).map(([e3, t2]) => `${e3}=${t2}`).join(`,`);
94
+ }
95
+ function ae(e2) {
96
+ let t2 = globalThis.__wix_context__, n2 = { client: y.client, elevatedClient: y.elevatedClient }, r2;
97
+ globalThis.__wix_context__ = void 0, y.client = void 0, y.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
98
+ try {
99
+ return e2();
100
+ } finally {
101
+ globalThis.__wix_context__ = t2, y.client = n2.client, y.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
102
+ }
103
+ }
104
+ var oe = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
105
+ function se(e2) {
106
+ return fe(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
107
+ }
108
+ var ce = /([\p{Ll}\d])(\p{Lu})/gu;
109
+ var le = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
110
+ var ue = `$1\0$2`;
111
+ var de = /[^\p{L}\d]+/giu;
112
+ function fe(e2) {
113
+ let t2 = e2.trim();
114
+ t2 = t2.replace(ce, ue).replace(le, ue), t2 = t2.replace(de, `\0`);
115
+ let n2 = 0, r2 = t2.length;
116
+ for (; t2.charAt(n2) === `\0`; ) n2++;
117
+ if (n2 === r2) return [];
118
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
119
+ return t2.slice(n2, r2).split(/\0/g);
120
+ }
121
+ var pe = (e2) => `validationError` in (e2.response?.data?.details ?? {});
122
+ var me = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
123
+ var he = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
124
+ function ge(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
125
+ if (typeof e2 != `object` || !e2) throw e2;
126
+ if (pe(e2)) return _e(e2, t2, n2);
127
+ if (me(e2)) return ye(e2);
128
+ if (he(e2)) {
129
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: se(n3), data: {} }, requestId: e2.requestId };
130
+ return ve(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
131
+ }
132
+ return be(e2);
133
+ }
134
+ var _e = (e2, t2, n2) => {
135
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = xe(t2, a2, n2)?.sort((e3, t3) => e3.field < t3.field ? -1 : 1), s2 = `INVALID_ARGUMENT: ${o2?.map(({ field: e3, description: t3 }) => `"${e3}" ${t3}`)?.join(`, `)}`, c2 = { validationError: { fieldViolations: o2 }, requestId: i2 };
136
+ return ve(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
137
+ };
138
+ var ve = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
139
+ var ye = (e2) => {
140
+ 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 ?? se(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 };
141
+ return ve(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
142
+ };
143
+ var be = (e2) => ve(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: se(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
144
+ var xe = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
145
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
146
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
147
+ let r3 = t2[e3.field];
148
+ if (r3) return { ...e3, field: Se(r3, i2) };
149
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
150
+ if (s2) {
151
+ let t3 = a2[s2];
152
+ if (t3) return { ...e3, field: e3.field.replace(s2, Se(t3, i2)) };
153
+ }
154
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
155
+ });
156
+ };
157
+ var Se = (e2, t2) => {
158
+ let n2 = Ce(e2);
159
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
160
+ };
161
+ var Ce = (e2) => {
162
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
163
+ return t2 && t2.groups && Number(t2.groups.argIndex);
164
+ };
165
+ function we(e2, t2, n2, r2, i2, a2, o2, s2, c2, l2, u2) {
166
+ return ae(() => e2({ request: async (e3) => {
167
+ let i3 = e3({ host: s2?.HTTPHost || `www.wixapis.com` }), a3 = i3;
168
+ a3.method === `GET` && a3.fallback?.length && (a3.params?.toString().length ?? 0) > 4e3 && (a3 = i3.fallback[0]);
169
+ let o3 = s2?.HTTPHost ?? `www.wixapis.com`, u3 = `https://${l2 ? T : o3}${a3.url}`;
170
+ a3.params && a3.params.toString() && (u3 += `?${a3.params.toString()}`);
171
+ try {
172
+ let e4 = re(i3, t2, c2), o4 = { method: a3.method, ...a3.data && { body: JSON.stringify(a3.data) }, headers: { ...e4 } }, s3 = await n2(u3, o4);
173
+ if (s3.status !== 200) {
174
+ let e5 = null;
175
+ try {
176
+ e5 = await s3.json();
177
+ } catch {
178
+ }
179
+ let t3 = Ee(s3.status, e5?.message ?? s3.statusText, e5?.details, { requestId: s3.headers.get(`X-Wix-Request-Id`), details: e5 }), n3 = ge(t3);
180
+ throw r2?.handleError(n3, { requestOptions: { url: a3.url, method: a3.method, entityFqdn: i3.entityFqdn, methodFqn: i3.methodFqn } }), t3;
181
+ }
182
+ let l3 = await s3.json();
183
+ 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 };
184
+ } catch (e4) {
185
+ throw e4.message?.includes(`fetch is not defined`) && console.error(`Node.js v18+ is required`), e4;
186
+ }
187
+ }, fetchWithAuth: n2, wixAPIFetch: i2, getActiveToken: a2, getAuthHeaders: o2 }, { validateRequestSchema: u2 }));
188
+ }
189
+ var Te = class extends Error {
190
+ response;
191
+ requestId;
192
+ constructor(e2) {
193
+ super(), this.response = e2.response, this.requestId = e2.requestId;
194
+ }
195
+ };
196
+ var Ee = (e2, t2, n2, r2) => new Te({ response: { data: { details: { ...!n2?.validationError && { applicationError: { description: t2, code: e2, data: r2 } }, ...n2 }, message: t2 }, status: e2 }, requestId: r2?.requestId });
197
+ var De = `.`;
198
+ function Oe(e2, t2, n2) {
199
+ if (e2 == null) throw Error(`Cannot set value on null or undefined`);
200
+ let r2 = ke(t2), i2 = e2;
201
+ for (let e3 = 0; e3 < r2.length; e3++) {
202
+ let t3 = r2[e3];
203
+ if (e3 === r2.length - 1) {
204
+ i2[t3] = n2;
205
+ break;
206
+ }
207
+ let a2 = r2[e3 + 1];
208
+ (!(t3 in i2) || i2[t3] == null || typeof i2[t3] != `object` || i2[t3] === null) && (i2[t3] = typeof a2 == `number` ? [] : {}), i2 = i2[t3];
209
+ }
210
+ return e2;
211
+ }
212
+ function ke(e2) {
213
+ return Array.isArray(e2) ? e2 : e2.split(De).map((e3) => Ae(e3) ? Number(e3) : e3);
214
+ }
215
+ function Ae(e2) {
216
+ return /^\d+$/.test(e2);
217
+ }
218
+ function je(e2) {
219
+ let t2 = {};
220
+ for (let [n2, r2] of Object.entries(e2)) Me(n2) || Oe(t2, ke(n2), r2);
221
+ return t2;
222
+ }
223
+ function Me(e2) {
224
+ return e2 === `__proto__` || e2 === `constructor` || e2 === `prototype`;
225
+ }
226
+ var Ne = class {
227
+ BRACKET_PATTERN = /\[(\d+)\]/g;
228
+ NUMERIC_PATTERN = /^\d+$/;
229
+ ESCAPED_DOT_PATTERN = /\\\./g;
230
+ ESCAPED_LEFT_BRACKET_PATTERN = /\\\[/g;
231
+ ESCAPED_RIGHT_BRACKET_PATTERN = /\\\]/g;
232
+ SPLIT_PATTERN = /\.|\[(\d+)\]/g;
233
+ DOT_BEFORE_BRACKET_PATTERN = /\.\[/g;
234
+ ESCAPED_DOT_PLACEHOLDER = `__DOT__`;
235
+ ESCAPED_RIGHT_BRACKET_PLACEHOLDER = `__RB__`;
236
+ ESCAPED_LEFT_BRACKET_PLACEHOLDER = `__LB__`;
237
+ modifiedFields;
238
+ cleanedModifiedFields;
239
+ constructor(e2) {
240
+ this.modifiedFields = e2;
241
+ }
242
+ replaceEscapedCharacters(e2) {
243
+ 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);
244
+ }
245
+ restoreEscapedCharacters(e2) {
246
+ return e2.replace(this.ESCAPED_DOT_PLACEHOLDER, `\\.`).replace(this.ESCAPED_RIGHT_BRACKET_PLACEHOLDER, `\\]`).replace(this.ESCAPED_LEFT_BRACKET_PLACEHOLDER, `\\[`);
247
+ }
248
+ unflatten() {
249
+ return this.cleanedModifiedFields = Object.fromEntries(Object.entries(this.modifiedFields).map(([e2, t2]) => [this.replaceEscapedCharacters(this.bracketToDotNotation(e2)), t2])), je(this.cleanedModifiedFields);
250
+ }
251
+ flatten(e2) {
252
+ let t2 = {};
253
+ for (let n2 of Object.keys(this.cleanedModifiedFields)) {
254
+ let r2 = this.splitPath(n2), i2 = this.navigatePath(e2, r2);
255
+ t2 = { ...t2, ...i2 };
256
+ }
257
+ return Object.fromEntries(Object.entries(t2).map(([e3, t3]) => [this.restoreEscapedCharacters(e3), t3]));
258
+ }
259
+ splitPath(e2) {
260
+ let t2 = [], n2 = 0, r2 = Array.from(e2.matchAll(this.SPLIT_PATTERN));
261
+ 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;
262
+ return n2 < e2.length && t2.push(e2.substring(n2)), t2;
263
+ }
264
+ navigatePath(e2, t2) {
265
+ let n2 = e2, r2 = [], i2 = (e3) => {
266
+ if (!Array.isArray(n2)) throw Error(`Expected array at path ${this.buildPathString(r2)}, but got ${typeof n2}`);
267
+ r2.push(`[${e3}]`), n2 = n2[parseInt(e3, 10)];
268
+ }, a2 = (e3, t3) => {
269
+ let i3 = e3 in oe ? oe[e3] : void 0;
270
+ if (i3 && i3 in t3) {
271
+ r2.push(i3), n2 = t3[i3];
272
+ return;
273
+ }
274
+ let a3 = Le(e3);
275
+ if (a3 && a3 in t3) {
276
+ r2.push(a3), n2 = t3[a3];
277
+ return;
278
+ }
279
+ throw Error(`Cannot find key '${e3}' or its transformations at path ${this.buildPathString(r2)}`);
280
+ }, o2 = (e3, t3) => {
281
+ r2.push(e3), n2 = t3[e3];
282
+ };
283
+ for (let e3 of t2) {
284
+ if (this.NUMERIC_PATTERN.test(e3)) {
285
+ i2(e3);
286
+ continue;
287
+ }
288
+ if (typeof n2 != `object` || !n2) throw Error(`Cannot access property '${e3}' on ${typeof n2} at path ${this.buildPathString(r2)}`);
289
+ let t3 = n2;
290
+ if (e3 in n2) {
291
+ o2(e3, t3);
292
+ continue;
293
+ }
294
+ a2(e3, t3);
295
+ }
296
+ return { [this.buildPathString(r2)]: n2 };
297
+ }
298
+ buildPathString(e2) {
299
+ return e2.join(`.`).replace(this.DOT_BEFORE_BRACKET_PATTERN, `[`);
300
+ }
301
+ bracketToDotNotation(e2) {
302
+ return e2.replace(this.BRACKET_PATTERN, (t2, n2, r2) => r2 > 0 && e2[r2 - 1] === `\\` ? t2 : `.` + n2);
303
+ }
304
+ };
305
+ function Pe(e2, t2) {
306
+ let n2 = e2?.modifiedFields;
307
+ if (!n2) return null;
308
+ let r2 = Fe(n2);
309
+ if (!r2) return null;
310
+ let { unflattenedModifiedFields: i2, modifiedFieldsManipulator: a2 } = r2;
311
+ e2 = { ...e2, modifiedFields: i2 };
312
+ let o2 = t2(e2), s2 = o2?.modifiedFields;
313
+ if (!s2) return null;
314
+ let c2 = Ie(s2, a2);
315
+ return c2 === null ? null : (o2.modifiedFields = c2, o2);
316
+ }
317
+ function Fe(e2) {
318
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
319
+ let t2 = new Ne(e2);
320
+ return { unflattenedModifiedFields: t2.unflatten(), modifiedFieldsManipulator: t2 };
321
+ } catch {
322
+ return null;
323
+ }
324
+ return null;
325
+ }
326
+ function Ie(e2, t2) {
327
+ if (typeof e2 == `object` && e2 && !Array.isArray(e2)) try {
328
+ return t2.flatten(e2);
329
+ } catch {
330
+ return null;
331
+ }
332
+ return null;
333
+ }
334
+ function Le(e2) {
335
+ return e2.replace(/[-_\s]+(.)?/g, (e3, t2) => t2 ? t2.toUpperCase() : ``).replace(/^./, (e3) => e3.toLowerCase());
336
+ }
337
+ function Re() {
338
+ return { emit(e2, ...t2) {
339
+ for (let n2 = 0, r2 = this.events[e2] || [], i2 = r2.length; n2 < i2; n2++) r2[n2](...t2);
340
+ }, events: {}, on(e2, t2) {
341
+ return (this.events[e2] ||= []).push(t2), () => {
342
+ this.events[e2] = this.events[e2]?.filter((e3) => t2 !== e3);
343
+ };
344
+ } };
345
+ }
346
+ var ze = (e2) => e2.__type === `event-definition`;
347
+ function Be(e2, t2, n2, r2) {
348
+ let i2;
349
+ if (e2.isDomainEvent) {
350
+ let { deletedEvent: e3, actionEvent: t3, createdEvent: a3, updatedEvent: o3, ...s3 } = n2, c2 = { ...r2, ...s3 };
351
+ 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 };
352
+ } else i2 = { data: n2, metadata: r2 };
353
+ let a2 = e2.transformations ?? ((e3) => e3), o2 = i2, s2 = i2;
354
+ if (s2.modifiedFields) {
355
+ let e3 = s2.modifiedFields;
356
+ if (typeof e3 == `object` && e3 && !Array.isArray(e3)) {
357
+ o2 = structuredClone(i2);
358
+ let e4 = Pe(s2, a2);
359
+ if (e4) return t2(e4);
360
+ }
361
+ }
362
+ return t2(a2(o2));
363
+ }
364
+ function Ve(e2) {
365
+ let t2 = /* @__PURE__ */ new Map(), n2 = Re();
366
+ return { initModule(e3) {
367
+ return (r2) => {
368
+ let i2 = t2.get(e3.type) ?? [];
369
+ i2.push({ eventDefinition: e3, handler: r2 }), t2.set(e3.type, i2), n2.emit(`registered`, e3);
370
+ };
371
+ }, client: { ...n2, getRegisteredEvents: () => t2, async process(e3, n3 = { expectedEvents: [] }) {
372
+ 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 }))];
373
+ 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(`, `)}`);
374
+ let l2 = t2.get(r2) ?? [];
375
+ return await Promise.all(l2.map(({ eventDefinition: e4, handler: t3 }) => Be(e4, t3, o2, { instanceId: a2, identity: i2, accountInfo: s2 }))), { instanceId: a2, eventType: r2, payload: o2, identity: i2, accountInfo: s2 };
376
+ }, async processRequest(e3, t3) {
377
+ let n3 = await e3.text();
378
+ return this.process(n3, t3);
379
+ }, async parseJWT(t3) {
380
+ let n3 = e2();
381
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
382
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3);
383
+ if (!i2) throw Error(`JWT is not valid`);
384
+ if (typeof r2.data != `string`) throw Error(`Unexpected type of JWT data: expected string, got ${typeof r2.data}`);
385
+ let a2 = JSON.parse(r2.data), o2 = a2.eventType, s2 = a2.accountInfo, c2 = a2.instanceId, l2 = a2.identity ? JSON.parse(a2.identity) : void 0;
386
+ return { instanceId: c2, eventType: o2, payload: JSON.parse(a2.data), identity: l2, accountInfo: s2 };
387
+ }, async parseRequest(e3) {
388
+ let t3 = await e3.text();
389
+ return this.parseJWT(t3);
390
+ }, async executeHandlers(e3) {
391
+ let n3 = Array.from(t2.keys()).map((e4) => ({ type: e4 }));
392
+ 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(`, `)}`);
393
+ let r2 = t2.get(e3.eventType) ?? [];
394
+ await Promise.all(r2.map(({ eventDefinition: t3, handler: n4 }) => Be(t3, n4, e3.payload, { instanceId: e3.instanceId, identity: e3.identity })));
395
+ }, apps: { AppInstalled: b(`AppInstalled`)(), AppRemoved: b(`AppRemoved`)() } } };
396
+ }
397
+ var He = (e2) => e2.__type === `service-plugin-definition`;
398
+ function Ue(e2) {
399
+ let t2 = /* @__PURE__ */ new Map(), n2 = Re();
400
+ return { initModule(e3) {
401
+ return (r2) => {
402
+ let i2 = t2.get(e3.componentType.toLowerCase()) ?? [];
403
+ i2.push({ servicePluginDefinition: e3, implementation: r2 }), t2.set(e3.componentType.toLowerCase(), i2), n2.emit(`registered`, e3);
404
+ };
405
+ }, client: { ...n2, getRegisteredServicePlugins: () => t2, async parseJWT(t3) {
406
+ let n3 = e2();
407
+ if (!n3.decodeJWT) throw Error(`decodeJWT is not supported by the authentication strategy`);
408
+ let { decoded: r2, valid: i2 } = await n3.decodeJWT(t3, true);
409
+ if (!i2) throw Error(`JWT is not valid`);
410
+ 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`);
411
+ return r2.data;
412
+ }, async process(e3) {
413
+ let t3 = await this.parseJWT(e3.body);
414
+ return this.executeHandler(t3, e3.url);
415
+ }, async parseRequest(e3) {
416
+ let t3 = await e3.text();
417
+ return this.parseJWT(t3);
418
+ }, async processRequest(e3) {
419
+ let t3 = await this.parseRequest(e3);
420
+ return this.processParsedRequest(t3, e3.url);
421
+ }, async processParsedRequest(e3, t3) {
422
+ try {
423
+ let n3 = await this.executeHandler(e3, t3);
424
+ return Response.json(n3);
425
+ } catch (e4) {
426
+ if (e4.errorType === `SPI` && e4.applicationCode && e4.httpCode) return Response.json({ applicationError: { code: e4.applicationCode, data: e4.data } }, { status: e4.httpCode });
427
+ throw e4;
428
+ }
429
+ }, async executeHandler(e3, n3) {
430
+ let r2 = e3.metadata.appExtensionType.toLowerCase(), i2 = t2.get(r2) ?? [];
431
+ if (i2.length === 0) throw Error(`No service plugin implementations found for component type ${r2}`);
432
+ if (i2.length > 1) throw Error(`Multiple service plugin implementations found for component type ${r2}. This is currently not supported`);
433
+ let { implementation: a2, servicePluginDefinition: o2 } = i2[0], s2 = o2.methods.find((e4) => n3.endsWith(e4.primaryHttpMappingPath));
434
+ if (!s2) throw Error(`Unexpect request: request url did not match any method: ` + n3);
435
+ let c2 = a2[s2.name];
436
+ if (!c2) throw Error(`Got request for service plugin method ${s2.name} but no implementation was provided. Available methods: ${Object.keys(a2).join(`, `)}`);
437
+ return s2.transformations.toREST(await c2(s2.transformations.fromREST(e3)));
438
+ } } };
439
+ }
440
+ var A = `X-Wix-Consistent`;
441
+ function We(e2) {
442
+ 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) => {
443
+ let i3 = o2(), s3 = await a2(), c3 = { ...r3?.headers ?? {}, ...s3.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} }, l3 = e2.host?.getErrorHandler?.();
444
+ try {
445
+ if (typeof n3 == `string` || n3 instanceof URL) {
446
+ let e3 = await i3(n3, { ...r3, headers: c3 });
447
+ l3?.handleError(e3, { requestOptions: { url: n3.toString(), method: r3?.method } });
448
+ let a3 = Ge(e3);
449
+ return a3 && (t2[A] = a3), e3;
450
+ }
451
+ {
452
+ for (let [e4, t3] of Object.entries(c3)) typeof t3 == `string` && n3.headers.set(e4, t3);
453
+ let e3 = await i3(n3, r3);
454
+ l3?.handleError(e3, { requestOptions: { url: n3.url, method: r3?.method } });
455
+ let a3 = Ge(e3);
456
+ return a3 && (t2[A] = a3), e3;
457
+ }
458
+ } catch (e3) {
459
+ throw l3?.handleError(e3, { requestOptions: { url: typeof n3 == `string` || n3 instanceof URL ? n3.toString() : n3.url, method: r3?.method } }), e3;
460
+ }
461
+ }, { client: c2, initModule: l2 } = Ue(i2), { client: u2, initModule: d2 } = Ve(i2), f2 = async (n3, r3) => {
462
+ let i3 = o2(), s3 = await a2(), c3 = O(r3), l3 = await i3(n3, { ...r3, headers: { ...c3, ...t2, ...s3?.headers, ...r3?.headers, ...e2.host?.essentials?.passThroughHeaders, ...t2[`X-Wix-Consistent`] ? { [A]: t2[A] } : {} } }), u3 = Ge(l3);
463
+ return u3 && (t2[A] = u3), l3;
464
+ }, p2 = (t3, n3) => {
465
+ if (ze(t3)) return d2(t3);
466
+ if (He(t3)) return l2(t3);
467
+ if (ee(t3) && e2.host) return te(t3, e2.host);
468
+ if (typeof t3 == `function`) {
469
+ if (`__type` in t3 && t3.__type === `wix_spi_error`) return t3;
470
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, o3 = e2.useCDN === void 0 ? i2().shouldUseCDN : e2.useCDN;
471
+ return we(ae(() => C(t3)) ? S(t3) : t3, n3 ?? {}, f2, e2.host?.getErrorHandler?.(), (e3, t4) => {
472
+ let n4 = new URL(e3, `https://${r3}`);
473
+ return n4.host = r3, n4.protocol = `https`, f2(n4.toString(), t4);
474
+ }, i2().getActiveToken, async () => a2(), { HTTPHost: r3 }, e2.host?.name, o3, e2.validateRequestSchema);
475
+ }
476
+ return k(t3) ? Object.fromEntries(Object.entries(t3).map(([e3, n4]) => [e3, p2(n4, t3[w])])) : t3;
477
+ }, m2 = (e3) => {
478
+ for (let n3 in e3) t2[n3] = e3[n3];
479
+ };
480
+ return { ...e2.modules ? p2(e2.modules) : {}, get auth() {
481
+ let t3 = i2();
482
+ return t3.getAuthHeaders = t3.getAuthHeaders.bind(void 0, e2.host), t3;
483
+ }, setHeaders: m2, use: p2, enableContext(e3, t3 = { elevated: false }) {
484
+ 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 ? y.elevatedClient = this : y.client = this;
485
+ }, fetch: (t3, n3) => {
486
+ let r3 = e2.host?.apiBaseUrl ?? `www.wixapis.com`, i3 = new URL(t3, `https://${r3}`);
487
+ return i3.host = r3, i3.protocol = `https`, f2(i3.toString(), n3);
488
+ }, fetchWithAuth: s2, async graphql(t3, n3, r3 = { apiVersion: `alpha` }) {
489
+ 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 }) });
490
+ if (a3.status !== 200) throw new E(`GraphQL request failed with status ${a3.status}`, a3);
491
+ let { data: o3, errors: s3 } = await a3.json();
492
+ return { data: o3 ?? {}, errors: s3 };
493
+ }, webhooks: u2, servicePlugins: c2 };
494
+ }
495
+ function Ge(e2) {
496
+ return e2.headers?.get(`X-Wix-Consistent`) ?? e2.headers?.get(`x-wix-consistent`);
497
+ }
498
+ var Ke = `wix:`;
499
+ var qe = { _id: `id`, _createdDate: `createdDate`, _updatedDate: `updatedDate` };
500
+ var Je = { id: `_id`, createdDate: `_createdDate`, updatedDate: `_updatedDate` };
501
+ var Ye = `items`;
502
+ var Xe = `pagingMetadata`;
503
+ var Ze = qe;
504
+ function Qe(e2, t2) {
505
+ return e2?.split(`.`).map((e3) => t2?.[e3] ?? e3).join(`.`);
506
+ }
507
+ function $e(e2, { transformSystemFields: t2 = true } = {}) {
508
+ return t2 ? Qe(e2, Ze) : e2;
509
+ }
510
+ var et = `sort.fieldName`;
511
+ function tt(e2, t2, n2) {
512
+ return (e2 === et || e2.endsWith(`.${et}`)) && typeof t2 == `string` ? Qe(t2, n2) : t2;
513
+ }
514
+ function nt(e2, t2, n2) {
515
+ let r2 = (e3) => n2.includes(e3), i2 = (e3, n3) => {
516
+ if (Array.isArray(e3)) e3.forEach((e4) => {
517
+ i2(e4, n3);
518
+ });
519
+ else if (typeof e3 == `object` && e3) {
520
+ let a2 = e3;
521
+ Object.keys(a2).forEach((e4) => {
522
+ let o2 = n3 === `` ? e4 : `${n3}.${e4}`;
523
+ if (r2(o2)) return;
524
+ let s2 = rt(e4, t2);
525
+ s2 !== e4 && !(s2 in a2) && (a2[s2] = a2[e4], delete a2[e4]), a2[s2] = tt(o2, a2[s2], t2), i2(a2[s2], o2);
526
+ });
527
+ }
528
+ };
529
+ return i2(e2, ``), e2;
530
+ }
531
+ function rt(e2, t2) {
532
+ let n2;
533
+ return n2 = e2.includes(`.`) ? e2.split(`.`).map((e3) => t2[e3] ?? e3).join(`.`) : t2[e2] ?? e2, n2;
534
+ }
535
+ function j(e2, t2 = []) {
536
+ return nt(e2, qe, t2);
537
+ }
538
+ function M(e2, t2 = []) {
539
+ return nt(e2, Je, t2);
540
+ }
541
+ function it(e2) {
542
+ return e2?.toISOString();
543
+ }
544
+ function N(e2) {
545
+ return e2 ? new Date(e2) : void 0;
546
+ }
547
+ var at = /* @__PURE__ */ new WeakMap();
548
+ function ot() {
549
+ return { leaves: void 0, fields: void 0, mapFields: void 0, anyField: void 0 };
550
+ }
551
+ function st(e2, t2) {
552
+ let n2 = e2.get(t2);
553
+ return n2 || (n2 = ot(), e2.set(t2, n2)), n2;
554
+ }
555
+ function ct(e2, t2) {
556
+ return t2 === `*` ? (e2.anyField ??= ot(), e2.anyField) : t2.endsWith(`{}`) ? (e2.mapFields ??= /* @__PURE__ */ new Map(), st(e2.mapFields, t2.slice(0, -2))) : (e2.fields ??= /* @__PURE__ */ new Map(), st(e2.fields, t2));
557
+ }
558
+ function lt(e2) {
559
+ let t2 = ot();
560
+ for (let n2 of e2) {
561
+ let e3 = n2.path.split(`.`).reduce(ct, t2);
562
+ e3.leaves ??= [], e3.leaves.push(n2);
563
+ }
564
+ return t2;
565
+ }
566
+ function ut(e2) {
567
+ let t2 = at.get(e2);
568
+ return t2 || (t2 = lt(e2), at.set(e2, t2)), t2;
569
+ }
570
+ function dt(e2) {
571
+ return typeof e2 == `object` && !!e2;
572
+ }
573
+ function ft(e2, { isRepeated: t2, isMap: n2 }, r2) {
574
+ return t2 ? Array.isArray(e2) ? e2.map(r2) : e2 : n2 ? dt(e2) ? Object.fromEntries(Object.entries(e2).map(([e3, t3]) => [e3, r2(t3)])) : e2 : r2(e2);
575
+ }
576
+ function pt(e2, t2, n2) {
577
+ dt(e2) && gt(e2, t2, n2);
578
+ }
579
+ function mt(e2, t2, n2) {
580
+ for (let [r2, i2] of t2) {
581
+ if (!(r2 in e2)) continue;
582
+ if (i2.leaves) for (let t4 of i2.leaves) e2[r2] = ft(e2[r2], t4, n2);
583
+ let t3 = e2[r2];
584
+ Array.isArray(t3) ? t3.forEach((e3) => pt(e3, i2, n2)) : pt(t3, i2, n2);
585
+ }
586
+ }
587
+ function ht(e2, t2, n2) {
588
+ for (let [r2, i2] of t2) {
589
+ let t3 = e2[r2];
590
+ dt(t3) && Object.values(t3).forEach((e3) => pt(e3, i2, n2));
591
+ }
592
+ }
593
+ function gt(e2, { fields: t2, mapFields: n2, anyField: r2 }, i2) {
594
+ t2 && mt(e2, t2, i2), n2 && ht(e2, n2, i2), r2 && Object.values(e2).forEach((e3) => pt(e3, r2, i2));
595
+ }
596
+ function P(e2, t2) {
597
+ if (!dt(e2)) return e2;
598
+ for (let { paths: n2, transformFn: r2 } of t2) gt(e2, ut(n2), r2);
599
+ return e2;
600
+ }
601
+ function _t(e2, t2) {
602
+ let { protocol: n2 } = new URL(e2);
603
+ return n2 === `${t2}:` ? `${Ke}${e2}` : e2;
604
+ }
605
+ function vt(e2) {
606
+ return Object.fromEntries(Object.entries(e2).filter(([, e3]) => e3 !== void 0));
607
+ }
608
+ function yt(e2) {
609
+ return wt(e2).map((e3) => e3.toLocaleUpperCase()).join(`_`);
610
+ }
611
+ var bt = /([\p{Ll}\d])(\p{Lu})/gu;
612
+ var xt = /(\p{Lu})([\p{Lu}][\p{Ll}])/gu;
613
+ var St = `$1\0$2`;
614
+ var Ct = /[^\p{L}\d]+/giu;
615
+ function wt(e2) {
616
+ let t2 = e2.trim();
617
+ t2 = t2.replace(bt, St).replace(xt, St), t2 = t2.replace(Ct, `\0`);
618
+ let n2 = 0, r2 = t2.length;
619
+ for (; t2.charAt(n2) === `\0`; ) n2++;
620
+ if (n2 === r2) return [];
621
+ for (; t2.charAt(r2 - 1) === `\0`; ) r2--;
622
+ return t2.slice(n2, r2).split(/\0/g);
623
+ }
624
+ var Tt = (e2) => `validationError` in (e2.response?.data?.details ?? {});
625
+ var Et = (e2) => `applicationError` in (e2.response?.data?.details ?? {});
626
+ var Dt = (e2) => (e2.response?.status ?? -1) >= 400 && (e2.response?.status ?? -1) < 500;
627
+ function F(e2, t2 = { explicitPathsToArguments: {}, spreadPathsToArguments: {}, singleArgumentUnchanged: false }, n2 = []) {
628
+ if (typeof e2 != `object` || !e2) throw e2;
629
+ if (Tt(e2)) return Ot(e2, t2, n2);
630
+ if (Et(e2)) return At(e2);
631
+ if (Dt(e2)) {
632
+ let t3 = e2.response?.status, n3 = e2.response?.statusText ?? `UNKNOWN`, r2 = e2.response?.data?.message ?? n3, i2 = { applicationError: { description: n3, code: yt(n3), data: {} }, requestId: e2.requestId };
633
+ return kt(e2, { message: JSON.stringify({ message: r2, details: i2 }, null, 2), extraProperties: { details: i2, status: t3 } });
634
+ }
635
+ return jt(e2);
636
+ }
637
+ var Ot = (e2, t2, n2) => {
638
+ let r2 = e2.response?.data, i2 = e2.requestId, { fieldViolations: a2 } = r2.details.validationError, o2 = Mt(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 };
639
+ return kt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: e2.response?.status, requestId: i2 } });
640
+ };
641
+ var kt = (e2, { message: t2, extraProperties: n2 }) => Object.assign(e2, { ...n2, message: t2 });
642
+ var At = (e2) => {
643
+ 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 ?? yt(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 };
644
+ return kt(e2, { message: JSON.stringify({ message: s2, details: c2 }, null, 2), extraProperties: { details: c2, status: t2, requestId: e2.requestId } });
645
+ };
646
+ var jt = (e2) => kt(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: yt(e2.response?.statusText ?? `UNKNOWN`), ...!e2.response && { runtimeError: e2 } } });
647
+ var Mt = ({ spreadPathsToArguments: e2, explicitPathsToArguments: t2, singleArgumentUnchanged: n2 }, r2, i2) => {
648
+ let a2 = { ...e2, ...t2 }, o2 = Object.keys(a2);
649
+ return r2?.filter((e3) => !r2.some((t3) => t3.field.length > e3.field.length && t3.field.startsWith(e3.field) && o2.includes(t3.field))).map((e3) => {
650
+ let r3 = t2[e3.field];
651
+ if (r3) return { ...e3, field: Nt(r3, i2) };
652
+ let s2 = o2?.sort((e4, t3) => t3.length - e4.length)?.find((t3) => e3.field.startsWith(t3));
653
+ if (s2) {
654
+ let t3 = a2[s2];
655
+ if (t3) return { ...e3, field: e3.field.replace(s2, Nt(t3, i2)) };
656
+ }
657
+ return n2 ? { ...e3, field: `${i2[0]}.${e3.field}` } : e3;
658
+ });
659
+ };
660
+ var Nt = (e2, t2) => {
661
+ let n2 = Pt(e2);
662
+ return n2 == null ? e2 : e2.replace(`$[${n2}]`, t2[n2]);
663
+ };
664
+ var Pt = (e2) => {
665
+ let t2 = e2.match(/\$\[(?<argIndex>\d+)\]/);
666
+ return t2 && t2.groups && Number(t2.groups.argIndex);
667
+ };
668
+ function Ft() {
669
+ let e2 = typeof $wixContext < `u` && $wixContext.initWixModules ? $wixContext.initWixModules : globalThis.__wix_context__ !== void 0 && globalThis.__wix_context__.initWixModules ? globalThis.__wix_context__.initWixModules : void 0;
670
+ if (e2) return { initWixModules(t3, n3) {
671
+ return It(() => e2(t3, n3));
672
+ }, fetchWithAuth() {
673
+ throw Error(`fetchWithAuth is not available in this context`);
674
+ }, graphql() {
675
+ throw Error(`graphql is not available in this context`);
676
+ } };
677
+ let t2 = typeof $wixContext < `u` ? $wixContext.client : y.client === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.client : y.client, n2 = typeof $wixContext < `u` ? $wixContext.elevatedClient : y.elevatedClient === void 0 ? globalThis.__wix_context__ === void 0 ? void 0 : globalThis.__wix_context__.elevatedClient : y.elevatedClient;
678
+ if (t2 || n2) return { initWixModules(e3, r2) {
679
+ if (r2) {
680
+ 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`);
681
+ return It(() => n2.use(e3));
682
+ }
683
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
684
+ return It(() => t2.use(e3));
685
+ }, fetchWithAuth: (e3, n3) => {
686
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
687
+ return t2.fetchWithAuth(e3, n3);
688
+ }, getAuth() {
689
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
690
+ return t2.auth;
691
+ }, async graphql(e3, n3, r2) {
692
+ if (!t2) throw Error(`Wix context is not available. Make sure to initialize the Wix context before using SDK modules`);
693
+ return t2.graphql(e3, n3, r2);
694
+ } };
695
+ }
696
+ function It(e2) {
697
+ let t2 = globalThis.__wix_context__, n2 = { client: y.client, elevatedClient: y.elevatedClient }, r2;
698
+ globalThis.__wix_context__ = void 0, y.client = void 0, y.elevatedClient = void 0, typeof $wixContext < `u` && (r2 = { client: $wixContext?.client, elevatedClient: $wixContext?.elevatedClient }, delete $wixContext.client, delete $wixContext.elevatedClient);
699
+ try {
700
+ return e2();
701
+ } finally {
702
+ globalThis.__wix_context__ = t2, y.client = n2.client, y.elevatedClient = n2.elevatedClient, typeof $wixContext < `u` && ($wixContext.client = r2.client, $wixContext.elevatedClient = r2.elevatedClient);
703
+ }
704
+ }
705
+ function Lt(e2, t2) {
706
+ return (...n2) => {
707
+ let r2 = Ft();
708
+ return r2 ? r2.initWixModules(e2, t2).apply(void 0, n2) : e2.apply(void 0, n2);
709
+ };
710
+ }
711
+ function Rt(e2) {
712
+ let t2 = (...t3) => {
713
+ let n2 = Ft();
714
+ return n2 ? n2.initWixModules(e2).apply(void 0, t3) : () => ({ slug: e2.type });
715
+ };
716
+ return t2.__type = e2.__type, t2.type = e2.type, t2.isDomainEvent = e2.isDomainEvent, t2.transformations = e2.transformations, t2;
717
+ }
718
+ function zt(e2, t2 = false) {
719
+ return Lt(e2, t2);
720
+ }
721
+ function Bt(e2, t2) {
722
+ let n2 = Ht(e2), r2 = Object.entries(n2).some(([e3, t3]) => e3.includes(`.`) || Array.isArray(t3) && t3.some((e4) => typeof e4 == `object`));
723
+ return t2 && r2 ? new URLSearchParams({ ".r": Wt(JSON.stringify(e2)) }) : Object.entries(n2).reduce((e3, [t3, n3]) => ((Array.isArray(n3) ? n3 : [n3]).forEach((r3) => {
724
+ r3 == null || Array.isArray(n3) && typeof r3 == `object` || e3.append(t3, r3);
725
+ }), e3), new URLSearchParams());
726
+ }
727
+ function Vt(e2) {
728
+ let t2 = rn(tn(e2.host), e2.domainToMappings);
729
+ return pn(un(e2.protoPath, e2.data || {}), t2);
730
+ }
731
+ function Ht(e2, t2 = ``) {
732
+ let n2 = {};
733
+ return Object.entries(e2).forEach(([e3, r2]) => {
734
+ let i2 = typeof r2 == `object` && !!r2 && !Array.isArray(r2), a2 = Ut(t2, e3);
735
+ if (i2) {
736
+ let e4 = Ht(r2, a2);
737
+ Object.assign(n2, e4);
738
+ } else n2[a2] = r2;
739
+ }), n2;
740
+ }
741
+ function Ut(e2, t2) {
742
+ return `${e2}${e2 ? `.` : ``}${t2}`;
743
+ }
744
+ var Wt = (e2) => {
745
+ let t2 = new TextEncoder().encode(e2);
746
+ return (typeof btoa < `u` ? btoa(String.fromCodePoint(...t2)) : Buffer.from(e2, `utf-8`).toString(`base64`)).replace(/=/g, ``).replace(/\+/g, `-`).replace(/\//g, `_`);
747
+ };
748
+ var Gt = [`wix.com`, `editorx.com`];
749
+ var Kt = `_`;
750
+ var qt = `*.`;
751
+ var Jt = RegExp(`\\.(${Gt.join(`|`)})$`);
752
+ var Yt = [`42.wixprod.net`, `uw2-edt-1.wixprod.net`, `virginia-edt.wixprod.net`];
753
+ var Xt = { "payments.base44.com": `manage.wix.com`, "create.editorx.com": `editor.editorx.com` };
754
+ var Zt = `dev.wix-code.com`;
755
+ var Qt = /{(.*)}/;
756
+ var $t = RegExp(`\\.(${Yt.join(`|`)})$`);
757
+ var en = RegExp(`.*\\.${Zt}$`);
758
+ function tn(e2) {
759
+ return nn(e2).replace(Jt, `._base_domain_`).replace($t, `._api_base_domain_`).replace(en, `*.dev.wix-code.com`);
760
+ }
761
+ function nn(e2) {
762
+ return Xt[e2] ?? e2;
763
+ }
764
+ function rn(e2, t2) {
765
+ let n2 = t2[e2];
766
+ if (n2) return n2;
767
+ let r2 = an(e2, t2) ?? on(e2, t2);
768
+ if (!r2) {
769
+ if (cn(e2)) {
770
+ let e3 = t2[ln];
771
+ if (e3) return e3;
772
+ }
773
+ let n3 = t2[Kt];
774
+ if (n3) return n3;
775
+ }
776
+ return r2 ?? [];
777
+ }
778
+ function an(e2, t2) {
779
+ return Object.entries(t2).find(([t3]) => {
780
+ let [, ...n2] = e2.split(`.`);
781
+ return n2.join(`.`) === t3;
782
+ })?.[1];
783
+ }
784
+ function on(e2, t2) {
785
+ let [n2] = Object.entries(t2).filter(([t3]) => sn(e2, t3)).sort(([e3], [t3]) => t3.length - e3.length);
786
+ if (!n2) return;
787
+ let [, r2] = n2;
788
+ return r2;
789
+ }
790
+ function sn(e2, t2) {
791
+ if (!t2.startsWith(qt)) return false;
792
+ let n2 = t2.slice(1);
793
+ return e2.length > n2.length && e2.endsWith(n2);
794
+ }
795
+ function cn(e2) {
796
+ return !!e2.match(/\._base_domain_$/);
797
+ }
798
+ var ln = `www._base_domain_`;
799
+ function un(e2, t2) {
800
+ return e2.split(`/`).map((e3) => dn(e3, t2)).join(`/`);
801
+ }
802
+ function dn(e2, t2) {
803
+ let n2 = e2.match(Qt) || [], r2 = n2[1];
804
+ return r2 ? fn(t2, r2, e2, e2.replace(n2[0], ``)) : e2;
805
+ }
806
+ function fn(e2, t2, n2, r2) {
807
+ let i2 = e2;
808
+ for (let e3 of t2.split(`.`)) {
809
+ if (!i2) return n2;
810
+ i2 = i2[e3];
811
+ }
812
+ return `${i2}${r2}`;
813
+ }
814
+ function pn(e2, t2) {
815
+ let n2 = t2?.find((t3) => e2.startsWith(t3.destPath));
816
+ return n2 ? n2.srcPath + e2.slice(n2.destPath.length) : e2;
817
+ }
818
+ function I(e2) {
819
+ return Rt(e2);
820
+ }
821
+ function mn(e2) {
822
+ return isFinite(e2) ? e2 : e2.toString();
823
+ }
824
+ function hn(e2) {
825
+ return e2 === `NaN` ? NaN : e2 === `Infinity` ? 1 / 0 : e2 === `-Infinity` ? -1 / 0 : e2;
826
+ }
827
+ function gn(e2) {
828
+ return e2 && vt({ city: e2.city, hint: e2.hint, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, formattedAddress: e2.formatted, geocode: e2.location, addressLine: e2.addressLine1, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine } });
829
+ }
830
+ function _n(e2) {
831
+ return e2 && vt({ formatted: e2.formattedAddress, location: e2.geocode, addressLine1: e2.addressLine, addressLine2: e2.addressLine2, streetAddress: e2.streetAddress && { name: e2.streetAddress.name, number: e2.streetAddress.number, apt: e2.streetAddress.apt, formattedAddressLine: e2.streetAddress.formattedAddressLine }, hint: e2.hint, city: e2.city, subdivision: e2.subdivision, country: e2.country, postalCode: e2.postalCode, countryFullname: e2.countryFullname, subdivisionFullname: e2.subdivisionFullname });
832
+ }
833
+ var vn = `x-wix-linguist`;
834
+ var yn = `00000000-0000-0000-0000-000000000000`;
835
+ var bn = `false`;
836
+ var xn = () => {
837
+ let e2 = wn(`language`), t2 = wn(`locale`);
838
+ if (e2) return { [vn]: [e2, t2 || e2, bn, yn].join(`|`) };
839
+ };
840
+ function Sn() {
841
+ let e2 = null, t2 = null;
842
+ return { promise: new Promise((n2, r2) => {
843
+ e2 = n2, t2 = r2;
844
+ }), resolve: e2, reject: t2 };
845
+ }
846
+ var Cn = () => (typeof window < `u` ? window.commonConfig : void 0) ?? globalThis.commonConfig;
847
+ var wn = (e2) => Cn()?.[e2];
848
+ var Tn = ({ createHost: e2 }) => ({ __type: `host`, create: (e3) => ({}), host: (t2) => {
849
+ let { applicationId: n2, componentId: r2 } = t2 ?? {}, i2 = typeof window < `u` ? window.wixEmbedsAPI : void 0, a2 = e2(t2), o2 = Dn();
850
+ return { ...a2, apiBaseUrl: o2, getMonitoringClient: i2?.getMonitoringClientFunction?.(n2, r2), essentials: { language: wn(`language`), locale: wn(`locale`), get passThroughHeaders() {
851
+ return xn();
852
+ } } };
853
+ }, auth: (e3) => {
854
+ let t2 = typeof window < `u` ? window.wixEmbedsAPI : void 0;
855
+ !e3 && En() && (e3 = t2?.getAccessTokenFunction?.());
856
+ let n2 = false, { resolve: r2, promise: i2 } = Sn();
857
+ return { getAuthHeaders: async () => {
858
+ if (!e3 && n2 && (e3 = await i2), !e3) throw Error(`Failed to resolve auth token`);
859
+ return { headers: { Authorization: await e3() } };
860
+ }, getAccessTokenInjector: () => (n2 = true, (e4) => {
861
+ r2(e4);
862
+ }) };
863
+ } });
864
+ function En() {
865
+ return typeof document < `u` && document.currentScript?.tagName === `SCRIPT`;
866
+ }
867
+ function Dn() {
868
+ let e2 = (typeof window < `u` ? window.wixEmbedsAPI : void 0)?.getExternalBaseUrl?.();
869
+ if (!e2) return;
870
+ let t2 = new URL(e2);
871
+ return t2?.pathname && t2.pathname !== `/` ? `${t2.hostname}${t2.pathname}` : t2.hostname;
872
+ }
873
+ var On = ({ clientSdk: e2, applicationId: t2 }) => ({ invoke: async ({ namespace: n2, method: r2, args: i2 }) => {
874
+ 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`);
875
+ return e2.invoke({ namespace: n2, method: r2, args: i2, applicationId: t2, accessToken: `accessToken` });
876
+ }, getAccessToken: () => {
877
+ throw Error(`Not implemented`);
878
+ }, observeState: () => ({ disconnect: () => {
879
+ } }) });
880
+ var kn = Tn({ createHost: function(e2) {
881
+ let t2 = (typeof $wixContext < `u` ? $wixContext.clientSdk : void 0) ?? e2?.clientSdk ?? (typeof window < `u` ? window?.clientSdk : void 0), { applicationId: n2 } = e2 || {};
882
+ if (!n2) throw Error(`"createHost" was called without a required field "applicationId"`);
883
+ return { channel: On({ clientSdk: t2, applicationId: n2 }), close: () => {
884
+ } };
885
+ } });
886
+ var An = (e2, t2) => {
887
+ let n2 = kn.host({ applicationId: e2, componentId: t2 }), r2 = kn.auth();
888
+ return We({ auth: r2, host: n2 }).enableContext(`module`), r2.getAccessTokenInjector();
889
+ };
890
+ var jn = (e2) => An(`215238eb-22a5-4c36-9e7b-e7c08025e04e`, e2);
891
+ var Mn = class {
892
+ constructor() {
893
+ this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
894
+ }
895
+ subscribe(e2) {
896
+ return this.listeners.add(e2), this.onSubscribe(), () => {
897
+ this.listeners.delete(e2), this.onUnsubscribe();
898
+ };
899
+ }
900
+ hasListeners() {
901
+ return this.listeners.size > 0;
902
+ }
903
+ onSubscribe() {
904
+ }
905
+ onUnsubscribe() {
906
+ }
907
+ };
908
+ var Nn = new class extends Mn {
909
+ #e;
910
+ #t;
911
+ #n;
912
+ constructor() {
913
+ super(), this.#n = (e2) => {
914
+ if (typeof window < `u` && window.addEventListener) {
915
+ let t2 = () => e2();
916
+ return window.addEventListener(`visibilitychange`, t2, false), () => {
917
+ window.removeEventListener(`visibilitychange`, t2);
918
+ };
919
+ }
920
+ };
921
+ }
922
+ onSubscribe() {
923
+ this.#t || this.setEventListener(this.#n);
924
+ }
925
+ onUnsubscribe() {
926
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
927
+ }
928
+ setEventListener(e2) {
929
+ this.#n = e2, this.#t?.(), this.#t = e2((e3) => {
930
+ typeof e3 == `boolean` ? this.setFocused(e3) : this.onFocus();
931
+ });
932
+ }
933
+ setFocused(e2) {
934
+ this.#e !== e2 && (this.#e = e2, this.onFocus());
935
+ }
936
+ onFocus() {
937
+ let e2 = this.isFocused();
938
+ this.listeners.forEach((t2) => {
939
+ t2(e2);
940
+ });
941
+ }
942
+ isFocused() {
943
+ return typeof this.#e == `boolean` ? this.#e : globalThis.document?.visibilityState !== `hidden`;
944
+ }
945
+ }();
946
+ var Pn = { setTimeout: (e2, t2) => setTimeout(e2, t2), clearTimeout: (e2) => clearTimeout(e2), setInterval: (e2, t2) => setInterval(e2, t2), clearInterval: (e2) => clearInterval(e2) };
947
+ var L = new class {
948
+ #e = Pn;
949
+ setTimeoutProvider(e2) {
950
+ this.#e = e2;
951
+ }
952
+ setTimeout(e2, t2) {
953
+ return this.#e.setTimeout(e2, t2);
954
+ }
955
+ clearTimeout(e2) {
956
+ this.#e.clearTimeout(e2);
957
+ }
958
+ setInterval(e2, t2) {
959
+ return this.#e.setInterval(e2, t2);
960
+ }
961
+ clearInterval(e2) {
962
+ this.#e.clearInterval(e2);
963
+ }
964
+ }();
965
+ function Fn(e2) {
966
+ setTimeout(e2, 0);
967
+ }
968
+ var In = typeof window > `u` || `Deno` in globalThis;
969
+ function R() {
970
+ }
971
+ function Ln(e2, t2) {
972
+ return typeof e2 == `function` ? e2(t2) : e2;
973
+ }
974
+ function Rn(e2) {
975
+ return typeof e2 == `number` && e2 >= 0 && e2 !== 1 / 0;
976
+ }
977
+ function zn(e2, t2) {
978
+ return Math.max(e2 + (t2 || 0) - Date.now(), 0);
979
+ }
980
+ function z(e2, t2) {
981
+ return typeof e2 == `function` ? e2(t2) : e2;
982
+ }
983
+ function B(e2, t2) {
984
+ return typeof e2 == `function` ? e2(t2) : e2;
985
+ }
986
+ function Bn(e2, t2) {
987
+ let { type: n2 = `all`, exact: r2, fetchStatus: i2, predicate: a2, queryKey: o2, stale: s2 } = e2;
988
+ if (o2) {
989
+ if (r2) {
990
+ if (t2.queryHash !== Hn(o2, t2.options)) return false;
991
+ } else if (!Wn(t2.queryKey, o2)) return false;
992
+ }
993
+ if (n2 !== `all`) {
994
+ let e3 = t2.isActive();
995
+ if (n2 === `active` && !e3 || n2 === `inactive` && e3) return false;
996
+ }
997
+ return !(typeof s2 == `boolean` && t2.isStale() !== s2 || i2 && i2 !== t2.state.fetchStatus || a2 && !a2(t2));
998
+ }
999
+ function Vn(e2, t2) {
1000
+ let { exact: n2, status: r2, predicate: i2, mutationKey: a2 } = e2;
1001
+ if (a2) {
1002
+ if (!t2.options.mutationKey) return false;
1003
+ if (n2) {
1004
+ if (Un(t2.options.mutationKey) !== Un(a2)) return false;
1005
+ } else if (!Wn(t2.options.mutationKey, a2)) return false;
1006
+ }
1007
+ return !(r2 && t2.state.status !== r2 || i2 && !i2(t2));
1008
+ }
1009
+ function Hn(e2, t2) {
1010
+ return (t2?.queryKeyHashFn || Un)(e2);
1011
+ }
1012
+ function Un(e2) {
1013
+ return JSON.stringify(e2, (e3, t2) => Yn(t2) ? Object.keys(t2).sort().reduce((e4, n2) => (e4[n2] = t2[n2], e4), {}) : t2);
1014
+ }
1015
+ function Wn(e2, t2) {
1016
+ return e2 === t2 ? true : typeof e2 == typeof t2 && e2 && t2 && typeof e2 == `object` && typeof t2 == `object` ? Object.keys(t2).every((n2) => Wn(e2[n2], t2[n2])) : false;
1017
+ }
1018
+ var Gn = Object.prototype.hasOwnProperty;
1019
+ function Kn(e2, t2, n2 = 0) {
1020
+ if (e2 === t2) return e2;
1021
+ if (n2 > 500) return t2;
1022
+ let r2 = Jn(e2) && Jn(t2);
1023
+ if (!r2 && !(Yn(e2) && Yn(t2))) return t2;
1024
+ let i2 = (r2 ? e2 : Object.keys(e2)).length, a2 = r2 ? t2 : Object.keys(t2), o2 = a2.length, s2 = r2 ? Array(o2) : {}, c2 = 0;
1025
+ for (let l2 = 0; l2 < o2; l2++) {
1026
+ let o3 = r2 ? l2 : a2[l2], u2 = e2[o3], d2 = t2[o3];
1027
+ if (u2 === d2) {
1028
+ s2[o3] = u2, (r2 ? l2 < i2 : Gn.call(e2, o3)) && c2++;
1029
+ continue;
1030
+ }
1031
+ if (u2 === null || d2 === null || typeof u2 != `object` || typeof d2 != `object`) {
1032
+ s2[o3] = d2;
1033
+ continue;
1034
+ }
1035
+ let f2 = Kn(u2, d2, n2 + 1);
1036
+ s2[o3] = f2, f2 === u2 && c2++;
1037
+ }
1038
+ return i2 === o2 && c2 === i2 ? e2 : s2;
1039
+ }
1040
+ function qn(e2, t2) {
1041
+ if (!t2 || Object.keys(e2).length !== Object.keys(t2).length) return false;
1042
+ for (let n2 in e2) if (e2[n2] !== t2[n2]) return false;
1043
+ return true;
1044
+ }
1045
+ function Jn(e2) {
1046
+ return Array.isArray(e2) && e2.length === Object.keys(e2).length;
1047
+ }
1048
+ function Yn(e2) {
1049
+ if (!Xn(e2)) return false;
1050
+ let t2 = e2.constructor;
1051
+ if (t2 === void 0) return true;
1052
+ let n2 = t2.prototype;
1053
+ return !(!Xn(n2) || !n2.hasOwnProperty(`isPrototypeOf`) || Object.getPrototypeOf(e2) !== Object.prototype);
1054
+ }
1055
+ function Xn(e2) {
1056
+ return Object.prototype.toString.call(e2) === `[object Object]`;
1057
+ }
1058
+ function Zn(e2) {
1059
+ return new Promise((t2) => {
1060
+ L.setTimeout(t2, e2);
1061
+ });
1062
+ }
1063
+ function Qn(e2, t2, n2) {
1064
+ return typeof n2.structuralSharing == `function` ? n2.structuralSharing(e2, t2) : n2.structuralSharing === false ? t2 : Kn(e2, t2);
1065
+ }
1066
+ function $n(e2, t2, n2 = 0) {
1067
+ let r2 = [...e2, t2];
1068
+ return n2 && r2.length > n2 ? r2.slice(1) : r2;
1069
+ }
1070
+ function er(e2, t2, n2 = 0) {
1071
+ let r2 = [t2, ...e2];
1072
+ return n2 && r2.length > n2 ? r2.slice(0, -1) : r2;
1073
+ }
1074
+ var tr = Symbol();
1075
+ function nr(e2, t2) {
1076
+ return !e2.queryFn && t2?.initialPromise ? () => t2.initialPromise : !e2.queryFn || e2.queryFn === tr ? () => Promise.reject(Error(`Missing queryFn: '${e2.queryHash}'`)) : e2.queryFn;
1077
+ }
1078
+ function rr(e2, t2) {
1079
+ return typeof e2 == `function` ? e2(...t2) : !!e2;
1080
+ }
1081
+ function ir(e2, t2, n2) {
1082
+ let r2 = false, i2;
1083
+ 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;
1084
+ }
1085
+ var ar = /* @__PURE__ */ (() => {
1086
+ let e2 = () => In;
1087
+ return { isServer() {
1088
+ return e2();
1089
+ }, setIsServer(t2) {
1090
+ e2 = t2;
1091
+ } };
1092
+ })();
1093
+ function or() {
1094
+ let e2, t2, n2 = new Promise((n3, r3) => {
1095
+ e2 = n3, t2 = r3;
1096
+ });
1097
+ n2.status = `pending`, n2.catch(() => {
1098
+ });
1099
+ function r2(e3) {
1100
+ Object.assign(n2, e3), delete n2.resolve, delete n2.reject;
1101
+ }
1102
+ return n2.resolve = (t3) => {
1103
+ r2({ status: `fulfilled`, value: t3 }), e2(t3);
1104
+ }, n2.reject = (e3) => {
1105
+ r2({ status: `rejected`, reason: e3 }), t2(e3);
1106
+ }, n2;
1107
+ }
1108
+ var sr = Fn;
1109
+ function cr() {
1110
+ let e2 = [], t2 = 0, n2 = (e3) => {
1111
+ e3();
1112
+ }, r2 = (e3) => {
1113
+ e3();
1114
+ }, i2 = sr, a2 = (r3) => {
1115
+ t2 ? e2.push(r3) : i2(() => {
1116
+ n2(r3);
1117
+ });
1118
+ }, o2 = () => {
1119
+ let t3 = e2;
1120
+ e2 = [], t3.length && i2(() => {
1121
+ r2(() => {
1122
+ t3.forEach((e3) => {
1123
+ n2(e3);
1124
+ });
1125
+ });
1126
+ });
1127
+ };
1128
+ return { batch: (e3) => {
1129
+ let n3;
1130
+ t2++;
1131
+ try {
1132
+ n3 = e3();
1133
+ } finally {
1134
+ t2--, t2 || o2();
1135
+ }
1136
+ return n3;
1137
+ }, batchCalls: (e3) => (...t3) => {
1138
+ a2(() => {
1139
+ e3(...t3);
1140
+ });
1141
+ }, schedule: a2, setNotifyFunction: (e3) => {
1142
+ n2 = e3;
1143
+ }, setBatchNotifyFunction: (e3) => {
1144
+ r2 = e3;
1145
+ }, setScheduler: (e3) => {
1146
+ i2 = e3;
1147
+ } };
1148
+ }
1149
+ var V = cr();
1150
+ var lr = new class extends Mn {
1151
+ #e = true;
1152
+ #t;
1153
+ #n;
1154
+ constructor() {
1155
+ super(), this.#n = (e2) => {
1156
+ if (typeof window < `u` && window.addEventListener) {
1157
+ let t2 = () => e2(true), n2 = () => e2(false);
1158
+ return window.addEventListener(`online`, t2, false), window.addEventListener(`offline`, n2, false), () => {
1159
+ window.removeEventListener(`online`, t2), window.removeEventListener(`offline`, n2);
1160
+ };
1161
+ }
1162
+ };
1163
+ }
1164
+ onSubscribe() {
1165
+ this.#t || this.setEventListener(this.#n);
1166
+ }
1167
+ onUnsubscribe() {
1168
+ this.hasListeners() || (this.#t?.(), this.#t = void 0);
1169
+ }
1170
+ setEventListener(e2) {
1171
+ this.#n = e2, this.#t?.(), this.#t = e2(this.setOnline.bind(this));
1172
+ }
1173
+ setOnline(e2) {
1174
+ this.#e !== e2 && (this.#e = e2, this.listeners.forEach((t2) => {
1175
+ t2(e2);
1176
+ }));
1177
+ }
1178
+ isOnline() {
1179
+ return this.#e;
1180
+ }
1181
+ }();
1182
+ function ur(e2) {
1183
+ return Math.min(1e3 * 2 ** e2, 3e4);
1184
+ }
1185
+ function dr(e2) {
1186
+ return (e2 ?? `online`) !== `online` || lr.isOnline();
1187
+ }
1188
+ var fr = class extends Error {
1189
+ constructor(e2) {
1190
+ super(`CancelledError`), this.revert = e2?.revert, this.silent = e2?.silent;
1191
+ }
1192
+ };
1193
+ function pr(e2) {
1194
+ let t2 = false, n2 = 0, r2, i2 = or(), a2 = () => i2.status !== `pending`, o2 = (t3) => {
1195
+ if (!a2()) {
1196
+ let n3 = new fr(t3);
1197
+ f2(n3), e2.onCancel?.(n3);
1198
+ }
1199
+ }, s2 = () => {
1200
+ t2 = true;
1201
+ }, c2 = () => {
1202
+ t2 = false;
1203
+ }, l2 = () => Nn.isFocused() && (e2.networkMode === `always` || lr.isOnline()) && e2.canRun(), u2 = () => dr(e2.networkMode) && e2.canRun(), d2 = (e3) => {
1204
+ a2() || (r2?.(), i2.resolve(e3));
1205
+ }, f2 = (e3) => {
1206
+ a2() || (r2?.(), i2.reject(e3));
1207
+ }, p2 = () => new Promise((t3) => {
1208
+ r2 = (e3) => {
1209
+ (a2() || l2()) && t3(e3);
1210
+ }, e2.onPause?.();
1211
+ }).then(() => {
1212
+ r2 = void 0, a2() || e2.onContinue?.();
1213
+ }), m2 = () => {
1214
+ if (a2()) return;
1215
+ let r3, i3 = n2 === 0 ? e2.initialPromise : void 0;
1216
+ try {
1217
+ r3 = i3 ?? e2.fn();
1218
+ } catch (e3) {
1219
+ r3 = Promise.reject(e3);
1220
+ }
1221
+ Promise.resolve(r3).then(d2).catch((r4) => {
1222
+ if (a2()) return;
1223
+ let i4 = e2.retry ?? (ar.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);
1224
+ if (t2 || !c3) {
1225
+ f2(r4);
1226
+ return;
1227
+ }
1228
+ n2++, e2.onFail?.(n2, r4), Zn(s3).then(() => l2() ? void 0 : p2()).then(() => {
1229
+ t2 ? f2(r4) : m2();
1230
+ });
1231
+ });
1232
+ };
1233
+ return { promise: i2, status: () => i2.status, cancel: o2, continue: () => (r2?.(), i2), cancelRetry: s2, continueRetry: c2, canStart: u2, start: () => (u2() ? m2() : p2().then(m2), i2) };
1234
+ }
1235
+ var mr = class {
1236
+ #e;
1237
+ destroy() {
1238
+ this.clearGcTimeout();
1239
+ }
1240
+ scheduleGc() {
1241
+ this.clearGcTimeout(), Rn(this.gcTime) && (this.#e = L.setTimeout(() => {
1242
+ this.optionalRemove();
1243
+ }, this.gcTime));
1244
+ }
1245
+ updateGcTime(e2) {
1246
+ this.gcTime = Math.max(this.gcTime || 0, e2 ?? (ar.isServer() ? 1 / 0 : 3e5));
1247
+ }
1248
+ clearGcTimeout() {
1249
+ this.#e !== void 0 && (L.clearTimeout(this.#e), this.#e = void 0);
1250
+ }
1251
+ };
1252
+ function hr(e2) {
1253
+ return { onFetch: (t2, n2) => {
1254
+ 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 () => {
1255
+ let n3 = false, l3 = (e3) => {
1256
+ ir(e3, () => t2.signal, () => n3 = true);
1257
+ }, u2 = nr(t2.options, t2.fetchOptions), d2 = async (e3, r3, i3) => {
1258
+ if (n3) return Promise.reject(t2.signal.reason);
1259
+ if (r3 == null && e3.pages.length) return Promise.resolve(e3);
1260
+ let a3 = (() => {
1261
+ let e4 = { client: t2.client, queryKey: t2.queryKey, pageParam: r3, direction: i3 ? `backward` : `forward`, meta: t2.options.meta };
1262
+ return l3(e4), e4;
1263
+ })(), o3 = await u2(a3), { maxPages: s3 } = t2.options, c3 = i3 ? er : $n;
1264
+ return { pages: c3(e3.pages, o3, s3), pageParams: c3(e3.pageParams, r3, s3) };
1265
+ };
1266
+ if (i2 && a2.length) {
1267
+ let e3 = i2 === `backward`, t3 = e3 ? _r : gr, n4 = { pages: a2, pageParams: o2 };
1268
+ s2 = await d2(n4, t3(r2, n4), e3);
1269
+ } else {
1270
+ let t3 = e2 ?? a2.length;
1271
+ do {
1272
+ let e3 = c2 === 0 ? o2[0] ?? r2.initialPageParam : gr(r2, s2);
1273
+ if (c2 > 0 && e3 == null) break;
1274
+ s2 = await d2(s2, e3), c2++;
1275
+ } while (c2 < t3);
1276
+ }
1277
+ return s2;
1278
+ };
1279
+ t2.fetchFn = t2.options.persister ? () => t2.options.persister?.(l2, { client: t2.client, queryKey: t2.queryKey, meta: t2.options.meta, signal: t2.signal }, n2) : l2;
1280
+ } };
1281
+ }
1282
+ function gr(e2, { pages: t2, pageParams: n2 }) {
1283
+ let r2 = t2.length - 1;
1284
+ return t2.length > 0 ? e2.getNextPageParam(t2[r2], t2, n2[r2], n2) : void 0;
1285
+ }
1286
+ function _r(e2, { pages: t2, pageParams: n2 }) {
1287
+ return t2.length > 0 ? e2.getPreviousPageParam?.(t2[0], t2, n2[0], n2) : void 0;
1288
+ }
1289
+ var vr = class extends mr {
1290
+ #e;
1291
+ #t;
1292
+ #n;
1293
+ #r;
1294
+ #i;
1295
+ #a;
1296
+ #o;
1297
+ #s;
1298
+ constructor(e2) {
1299
+ 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 = xr(this.options), this.state = e2.state ?? this.#t, this.scheduleGc();
1300
+ }
1301
+ get meta() {
1302
+ return this.options.meta;
1303
+ }
1304
+ get queryType() {
1305
+ return this.#e;
1306
+ }
1307
+ get promise() {
1308
+ return this.#a?.promise;
1309
+ }
1310
+ setOptions(e2) {
1311
+ if (this.options = { ...this.#o, ...e2 }, e2?._type && (this.#e = e2._type), this.updateGcTime(this.options.gcTime), this.state && this.state.data === void 0) {
1312
+ let e3 = xr(this.options);
1313
+ e3.data !== void 0 && (this.setState(br(e3.data, e3.dataUpdatedAt)), this.#t = e3);
1314
+ }
1315
+ }
1316
+ optionalRemove() {
1317
+ !this.observers.length && this.state.fetchStatus === `idle` && this.#r.remove(this);
1318
+ }
1319
+ setData(e2, t2) {
1320
+ let n2 = Qn(this.state.data, e2, this.options);
1321
+ return this.#l({ data: n2, type: `success`, dataUpdatedAt: t2?.updatedAt, manual: t2?.manual }), n2;
1322
+ }
1323
+ setState(e2) {
1324
+ this.#l({ type: `setState`, state: e2 });
1325
+ }
1326
+ cancel(e2) {
1327
+ let t2 = this.#a?.promise;
1328
+ return this.#a?.cancel(e2), t2 ? t2.then(R).catch(R) : Promise.resolve();
1329
+ }
1330
+ destroy() {
1331
+ super.destroy(), this.cancel({ silent: true });
1332
+ }
1333
+ get resetState() {
1334
+ return this.#t;
1335
+ }
1336
+ reset() {
1337
+ this.destroy(), this.setState(this.resetState);
1338
+ }
1339
+ isActive() {
1340
+ return this.observers.some((e2) => B(e2.options.enabled, this) !== false);
1341
+ }
1342
+ isDisabled() {
1343
+ return this.getObserversCount() > 0 ? !this.isActive() : this.options.queryFn === tr || !this.isFetched();
1344
+ }
1345
+ isFetched() {
1346
+ return this.state.dataUpdateCount + this.state.errorUpdateCount > 0;
1347
+ }
1348
+ isStatic() {
1349
+ return this.getObserversCount() > 0 && this.observers.some((e2) => z(e2.options.staleTime, this) === `static`);
1350
+ }
1351
+ isStale() {
1352
+ return this.getObserversCount() > 0 ? this.observers.some((e2) => e2.getCurrentResult().isStale) : this.state.data === void 0 || this.state.isInvalidated;
1353
+ }
1354
+ isStaleByTime(e2 = 0) {
1355
+ return this.state.data === void 0 ? true : e2 === `static` ? false : this.state.isInvalidated ? true : !zn(this.state.dataUpdatedAt, e2);
1356
+ }
1357
+ onFocus() {
1358
+ this.observers.find((e2) => e2.shouldFetchOnWindowFocus())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1359
+ }
1360
+ onOnline() {
1361
+ this.observers.find((e2) => e2.shouldFetchOnReconnect())?.refetch({ cancelRefetch: false }), this.#a?.continue();
1362
+ }
1363
+ addObserver(e2) {
1364
+ this.observers.includes(e2) || (this.observers.push(e2), this.clearGcTimeout(), this.#r.notify({ type: `observerAdded`, query: this, observer: e2 }));
1365
+ }
1366
+ removeObserver(e2) {
1367
+ 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 }));
1368
+ }
1369
+ getObserversCount() {
1370
+ return this.observers.length;
1371
+ }
1372
+ #c() {
1373
+ return this.state.fetchStatus === `paused` && this.state.status === `pending`;
1374
+ }
1375
+ invalidate() {
1376
+ this.state.isInvalidated || this.#l({ type: `invalidate` });
1377
+ }
1378
+ async fetch(e2, t2) {
1379
+ if (this.state.fetchStatus !== `idle` && this.#a?.status() !== `rejected`) {
1380
+ if (this.state.data !== void 0 && t2?.cancelRefetch) this.cancel({ silent: true });
1381
+ else if (this.#a) return this.#a.continueRetry(), this.#a.promise;
1382
+ }
1383
+ if (e2 && this.setOptions(e2), !this.options.queryFn) {
1384
+ let e3 = this.observers.find((e4) => e4.options.queryFn);
1385
+ e3 && this.setOptions(e3.options);
1386
+ }
1387
+ let n2 = new AbortController(), r2 = (e3) => {
1388
+ Object.defineProperty(e3, "signal", { enumerable: true, get: () => (this.#s = true, n2.signal) });
1389
+ }, i2 = () => {
1390
+ let e3 = nr(this.options, t2), n3 = (() => {
1391
+ let e4 = { client: this.#i, queryKey: this.queryKey, meta: this.meta };
1392
+ return r2(e4), e4;
1393
+ })();
1394
+ return this.#s = false, this.options.persister ? this.options.persister(e3, n3, this) : e3(n3);
1395
+ }, a2 = (() => {
1396
+ let e3 = { fetchOptions: t2, options: this.options, queryKey: this.queryKey, client: this.#i, state: this.state, fetchFn: i2 };
1397
+ return r2(e3), e3;
1398
+ })();
1399
+ (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) => {
1400
+ e3 instanceof fr && e3.revert && this.setState({ ...this.#n, fetchStatus: `idle` }), n2.abort();
1401
+ }, onFail: (e3, t3) => {
1402
+ this.#l({ type: `failed`, failureCount: e3, error: t3 });
1403
+ }, onPause: () => {
1404
+ this.#l({ type: `pause` });
1405
+ }, onContinue: () => {
1406
+ this.#l({ type: `continue` });
1407
+ }, retry: a2.options.retry, retryDelay: a2.options.retryDelay, networkMode: a2.options.networkMode, canRun: () => true });
1408
+ try {
1409
+ let e3 = await this.#a.start();
1410
+ if (e3 === void 0) throw Error(`${this.queryHash} data is undefined`);
1411
+ return this.setData(e3), this.#r.config.onSuccess?.(e3, this), this.#r.config.onSettled?.(e3, this.state.error, this), e3;
1412
+ } catch (e3) {
1413
+ if (e3 instanceof fr) {
1414
+ if (e3.silent) return this.#a.promise;
1415
+ if (e3.revert) {
1416
+ if (this.state.data === void 0) throw e3;
1417
+ return this.state.data;
1418
+ }
1419
+ }
1420
+ throw this.#l({ type: `error`, error: e3 }), this.#r.config.onError?.(e3, this), this.#r.config.onSettled?.(this.state.data, e3, this), e3;
1421
+ } finally {
1422
+ this.scheduleGc();
1423
+ }
1424
+ }
1425
+ #l(e2) {
1426
+ let t2 = (t3) => {
1427
+ switch (e2.type) {
1428
+ case `failed`:
1429
+ return { ...t3, fetchFailureCount: e2.failureCount, fetchFailureReason: e2.error };
1430
+ case `pause`:
1431
+ return { ...t3, fetchStatus: `paused` };
1432
+ case `continue`:
1433
+ return { ...t3, fetchStatus: `fetching` };
1434
+ case `fetch`:
1435
+ return { ...t3, ...yr(t3.data, this.options), fetchMeta: e2.meta ?? null };
1436
+ case `success`:
1437
+ let n2 = { ...t3, ...br(e2.data, e2.dataUpdatedAt), dataUpdateCount: t3.dataUpdateCount + 1, ...!e2.manual && { fetchStatus: `idle`, fetchFailureCount: 0, fetchFailureReason: null } };
1438
+ return this.#n = e2.manual ? n2 : void 0, n2;
1439
+ case `error`:
1440
+ let r2 = e2.error;
1441
+ return { ...t3, error: r2, errorUpdateCount: t3.errorUpdateCount + 1, errorUpdatedAt: Date.now(), fetchFailureCount: t3.fetchFailureCount + 1, fetchFailureReason: r2, fetchStatus: `idle`, status: `error`, isInvalidated: true };
1442
+ case `invalidate`:
1443
+ return { ...t3, isInvalidated: true };
1444
+ case `setState`:
1445
+ return { ...t3, ...e2.state };
1446
+ }
1447
+ };
1448
+ this.state = t2(this.state), V.batch(() => {
1449
+ this.observers.forEach((e3) => {
1450
+ e3.onQueryUpdate();
1451
+ }), this.#r.notify({ query: this, type: `updated`, action: e2 });
1452
+ });
1453
+ }
1454
+ };
1455
+ function yr(e2, t2) {
1456
+ return { fetchFailureCount: 0, fetchFailureReason: null, fetchStatus: dr(t2.networkMode) ? `fetching` : `paused`, ...e2 === void 0 && { error: null, status: `pending` } };
1457
+ }
1458
+ function br(e2, t2) {
1459
+ return { data: e2, dataUpdatedAt: t2 ?? Date.now(), error: null, isInvalidated: false, status: `success` };
1460
+ }
1461
+ function xr(e2) {
1462
+ 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;
1463
+ 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` };
1464
+ }
1465
+ var Sr = class extends Mn {
1466
+ constructor(e2, t2) {
1467
+ super(), this.options = t2, this.#e = e2, this.#s = null, this.#o = or(), this.bindMethods(), this.setOptions(t2);
1468
+ }
1469
+ #e;
1470
+ #t = void 0;
1471
+ #n = void 0;
1472
+ #r = void 0;
1473
+ #i;
1474
+ #a;
1475
+ #o;
1476
+ #s;
1477
+ #c;
1478
+ #l;
1479
+ #u;
1480
+ #d;
1481
+ #f;
1482
+ #p;
1483
+ #m = /* @__PURE__ */ new Set();
1484
+ bindMethods() {
1485
+ this.refetch = this.refetch.bind(this);
1486
+ }
1487
+ onSubscribe() {
1488
+ this.listeners.size === 1 && (this.#t.addObserver(this), wr(this.#t, this.options) ? this.#h() : this.updateResult(), this.#y());
1489
+ }
1490
+ onUnsubscribe() {
1491
+ this.hasListeners() || this.destroy();
1492
+ }
1493
+ shouldFetchOnReconnect() {
1494
+ return Tr(this.#t, this.options, this.options.refetchOnReconnect);
1495
+ }
1496
+ shouldFetchOnWindowFocus() {
1497
+ return Tr(this.#t, this.options, this.options.refetchOnWindowFocus);
1498
+ }
1499
+ destroy() {
1500
+ this.listeners = /* @__PURE__ */ new Set(), this.#b(), this.#x(), this.#t.removeObserver(this);
1501
+ }
1502
+ setOptions(e2) {
1503
+ let t2 = this.options, n2 = this.#t;
1504
+ if (this.options = this.#e.defaultQueryOptions(e2), this.options.enabled !== void 0 && typeof this.options.enabled != `boolean` && typeof this.options.enabled != `function` && typeof B(this.options.enabled, this.#t) != `boolean`) throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);
1505
+ this.#S(), this.#t.setOptions(this.options), t2._defaulted && !qn(this.options, t2) && this.#e.getQueryCache().notify({ type: `observerOptionsUpdated`, query: this.#t, observer: this });
1506
+ let r2 = this.hasListeners();
1507
+ r2 && Er(this.#t, n2, this.options, t2) && this.#h(), this.updateResult(), r2 && (this.#t !== n2 || B(this.options.enabled, this.#t) !== B(t2.enabled, this.#t) || z(this.options.staleTime, this.#t) !== z(t2.staleTime, this.#t)) && this.#g();
1508
+ let i2 = this.#_();
1509
+ r2 && (this.#t !== n2 || B(this.options.enabled, this.#t) !== B(t2.enabled, this.#t) || i2 !== this.#p) && this.#v(i2);
1510
+ }
1511
+ getOptimisticResult(e2) {
1512
+ let t2 = this.#e.getQueryCache().build(this.#e, e2), n2 = this.createResult(t2, e2);
1513
+ return Or(this, n2) && (this.#r = n2, this.#a = this.options, this.#i = this.#t.state), n2;
1514
+ }
1515
+ getCurrentResult() {
1516
+ return this.#r;
1517
+ }
1518
+ trackResult(e2, t2) {
1519
+ 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)) });
1520
+ }
1521
+ trackProp(e2) {
1522
+ this.#m.add(e2);
1523
+ }
1524
+ getCurrentQuery() {
1525
+ return this.#t;
1526
+ }
1527
+ refetch({ ...e2 } = {}) {
1528
+ return this.fetch({ ...e2 });
1529
+ }
1530
+ fetchOptimistic(e2) {
1531
+ let t2 = this.#e.defaultQueryOptions(e2), n2 = this.#e.getQueryCache().build(this.#e, t2);
1532
+ return n2.fetch().then(() => this.createResult(n2, t2));
1533
+ }
1534
+ fetch(e2) {
1535
+ return this.#h({ ...e2, cancelRefetch: e2.cancelRefetch ?? true }).then(() => (this.updateResult(), this.#r));
1536
+ }
1537
+ #h(e2) {
1538
+ this.#S();
1539
+ let t2 = this.#t.fetch(this.options, e2);
1540
+ return e2?.throwOnError || (t2 = t2.catch(R)), t2;
1541
+ }
1542
+ #g() {
1543
+ this.#b();
1544
+ let e2 = z(this.options.staleTime, this.#t);
1545
+ if (ar.isServer() || this.#r.isStale || !Rn(e2)) return;
1546
+ let t2 = zn(this.#r.dataUpdatedAt, e2) + 1;
1547
+ this.#d = L.setTimeout(() => {
1548
+ this.#r.isStale || this.updateResult();
1549
+ }, t2);
1550
+ }
1551
+ #_() {
1552
+ return (typeof this.options.refetchInterval == `function` ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? false;
1553
+ }
1554
+ #v(e2) {
1555
+ this.#x(), this.#p = e2, !ar.isServer() && B(this.options.enabled, this.#t) !== false && Rn(this.#p) && this.#p !== 0 && (this.#f = L.setInterval(() => {
1556
+ (this.options.refetchIntervalInBackground || Nn.isFocused()) && this.#h();
1557
+ }, this.#p));
1558
+ }
1559
+ #y() {
1560
+ this.#g(), this.#v(this.#_());
1561
+ }
1562
+ #b() {
1563
+ this.#d !== void 0 && (L.clearTimeout(this.#d), this.#d = void 0);
1564
+ }
1565
+ #x() {
1566
+ this.#f !== void 0 && (L.clearInterval(this.#f), this.#f = void 0);
1567
+ }
1568
+ createResult(e2, t2) {
1569
+ 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;
1570
+ if (t2._optimisticResults) {
1571
+ let i3 = this.hasListeners(), a3 = !i3 && wr(e2, t2), o3 = i3 && Er(e2, n2, t2, r2);
1572
+ (a3 || o3) && (l2 = { ...l2, ...yr(c2.data, e2.options) }), t2._optimisticResults === `isRestoring` && (l2.fetchStatus = `idle`);
1573
+ }
1574
+ let { error: f2, errorUpdatedAt: p2, status: m2 } = l2;
1575
+ d2 = l2.data;
1576
+ let h2 = false;
1577
+ if (t2.placeholderData !== void 0 && d2 === void 0 && m2 === `pending`) {
1578
+ let e3;
1579
+ i2?.isPlaceholderData && t2.placeholderData === o2?.placeholderData ? (e3 = i2.data, h2 = 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);
1580
+ }
1581
+ if (t2.select && d2 !== void 0 && !h2) {
1582
+ if (i2 && d2 === a2?.data && t2.select === this.#c) d2 = this.#l;
1583
+ else try {
1584
+ this.#c = t2.select, d2 = t2.select(d2), d2 = Qn(i2?.data, d2, t2), this.#l = d2, this.#s = null;
1585
+ } catch (e3) {
1586
+ this.#s = e3;
1587
+ }
1588
+ }
1589
+ this.#s && (f2 = this.#s, d2 = this.#l, p2 = Date.now(), m2 = `error`);
1590
+ let g2 = l2.fetchStatus === `fetching`, _2 = m2 === `pending`, v2 = m2 === `error`, y2 = _2 && g2, b2 = d2 !== void 0, x2 = { status: m2, fetchStatus: l2.fetchStatus, isPending: _2, isSuccess: m2 === `success`, isError: v2, isInitialLoading: y2, isLoading: y2, 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: g2, isRefetching: g2 && !_2, isLoadingError: v2 && !b2, isPaused: l2.fetchStatus === `paused`, isPlaceholderData: u2, isRefetchError: v2 && b2, isStale: Dr(e2, t2), refetch: this.refetch, promise: this.#o, isEnabled: B(t2.enabled, e2) !== false };
1591
+ if (this.options.experimental_prefetchInRender) {
1592
+ let t3 = x2.data !== void 0, r3 = x2.status === `error` && !t3, i3 = (e3) => {
1593
+ r3 ? e3.reject(x2.error) : t3 && e3.resolve(x2.data);
1594
+ }, a3 = () => {
1595
+ let e3 = this.#o = x2.promise = or();
1596
+ i3(e3);
1597
+ }, o3 = this.#o;
1598
+ switch (o3.status) {
1599
+ case `pending`:
1600
+ e2.queryHash === n2.queryHash && i3(o3);
1601
+ break;
1602
+ case `fulfilled`:
1603
+ (r3 || x2.data !== o3.value) && a3();
1604
+ break;
1605
+ case `rejected`:
1606
+ (!r3 || x2.error !== o3.reason) && a3();
1607
+ }
1608
+ }
1609
+ return x2;
1610
+ }
1611
+ updateResult() {
1612
+ let e2 = this.#r, t2 = this.createResult(this.#t, this.options);
1613
+ 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: (() => {
1614
+ if (!e2) return true;
1615
+ let { notifyOnChangeProps: t3 } = this.options, n2 = typeof t3 == `function` ? t3() : t3;
1616
+ if (n2 === `all` || !n2 && !this.#m.size) return true;
1617
+ let r2 = new Set(n2 ?? this.#m);
1618
+ return this.options.throwOnError && r2.add(`error`), Object.keys(this.#r).some((t4) => {
1619
+ let n3 = t4;
1620
+ return this.#r[n3] !== e2[n3] && r2.has(n3);
1621
+ });
1622
+ })() }));
1623
+ }
1624
+ #S() {
1625
+ let e2 = this.#e.getQueryCache().build(this.#e, this.options);
1626
+ if (e2 === this.#t) return;
1627
+ let t2 = this.#t;
1628
+ this.#t = e2, this.#n = e2.state, this.hasListeners() && (t2?.removeObserver(this), e2.addObserver(this));
1629
+ }
1630
+ onQueryUpdate() {
1631
+ this.updateResult(), this.hasListeners() && this.#y();
1632
+ }
1633
+ #C(e2) {
1634
+ V.batch(() => {
1635
+ e2.listeners && this.listeners.forEach((e3) => {
1636
+ e3(this.#r);
1637
+ }), this.#e.getQueryCache().notify({ query: this.#t, type: `observerResultsUpdated` });
1638
+ });
1639
+ }
1640
+ };
1641
+ function Cr(e2, t2) {
1642
+ return B(t2.enabled, e2) !== false && e2.state.data === void 0 && (e2.state.status !== `error` || B(t2.retryOnMount, e2) !== false);
1643
+ }
1644
+ function wr(e2, t2) {
1645
+ return Cr(e2, t2) || e2.state.data !== void 0 && Tr(e2, t2, t2.refetchOnMount);
1646
+ }
1647
+ function Tr(e2, t2, n2) {
1648
+ if (B(t2.enabled, e2) !== false && z(t2.staleTime, e2) !== `static`) {
1649
+ let r2 = typeof n2 == `function` ? n2(e2) : n2;
1650
+ return r2 === `always` || r2 !== false && Dr(e2, t2);
1651
+ }
1652
+ return false;
1653
+ }
1654
+ function Er(e2, t2, n2, r2) {
1655
+ return (e2 !== t2 || B(r2.enabled, e2) === false) && (!n2.suspense || e2.state.status !== `error`) && Dr(e2, n2);
1656
+ }
1657
+ function Dr(e2, t2) {
1658
+ return B(t2.enabled, e2) !== false && e2.isStaleByTime(z(t2.staleTime, e2));
1659
+ }
1660
+ function Or(e2, t2) {
1661
+ return !qn(e2.getCurrentResult(), t2);
1662
+ }
1663
+ var kr = class extends mr {
1664
+ #e;
1665
+ #t;
1666
+ #n;
1667
+ #r;
1668
+ constructor(e2) {
1669
+ super(), this.#e = e2.client, this.mutationId = e2.mutationId, this.#n = e2.mutationCache, this.#t = [], this.state = e2.state || Ar(), this.setOptions(e2.options), this.scheduleGc();
1670
+ }
1671
+ setOptions(e2) {
1672
+ this.options = e2, this.updateGcTime(this.options.gcTime);
1673
+ }
1674
+ get meta() {
1675
+ return this.options.meta;
1676
+ }
1677
+ addObserver(e2) {
1678
+ this.#t.includes(e2) || (this.#t.push(e2), this.clearGcTimeout(), this.#n.notify({ type: `observerAdded`, mutation: this, observer: e2 }));
1679
+ }
1680
+ removeObserver(e2) {
1681
+ this.#t = this.#t.filter((t2) => t2 !== e2), this.scheduleGc(), this.#n.notify({ type: `observerRemoved`, mutation: this, observer: e2 });
1682
+ }
1683
+ optionalRemove() {
1684
+ this.#t.length || (this.state.status === `pending` ? this.scheduleGc() : this.#n.remove(this));
1685
+ }
1686
+ continue() {
1687
+ return this.#r?.continue() ?? this.execute(this.state.variables);
1688
+ }
1689
+ async execute(e2) {
1690
+ let t2 = () => {
1691
+ this.#i({ type: `continue` });
1692
+ }, n2 = { client: this.#e, meta: this.options.meta, mutationKey: this.options.mutationKey };
1693
+ this.#r = pr({ fn: () => this.options.mutationFn ? this.options.mutationFn(e2, n2) : Promise.reject(Error(`No mutationFn found`)), onFail: (e3, t3) => {
1694
+ this.#i({ type: `failed`, failureCount: e3, error: t3 });
1695
+ }, onPause: () => {
1696
+ this.#i({ type: `pause` });
1697
+ }, onContinue: t2, retry: this.options.retry ?? 0, retryDelay: this.options.retryDelay, networkMode: this.options.networkMode, canRun: () => this.#n.canRun(this) });
1698
+ let r2 = this.state.status === `pending`, i2 = !this.#r.canStart();
1699
+ try {
1700
+ if (r2) t2();
1701
+ else {
1702
+ this.#i({ type: `pending`, variables: e2, isPaused: i2 }), this.#n.config.onMutate && await this.#n.config.onMutate(e2, this, n2);
1703
+ let t3 = await this.options.onMutate?.(e2, n2);
1704
+ t3 !== this.state.context && this.#i({ type: `pending`, context: t3, variables: e2, isPaused: i2 });
1705
+ }
1706
+ let a2 = await this.#r.start();
1707
+ 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;
1708
+ } catch (t3) {
1709
+ try {
1710
+ await this.#n.config.onError?.(t3, e2, this.state.context, this, n2);
1711
+ } catch (e3) {
1712
+ Promise.reject(e3);
1713
+ }
1714
+ try {
1715
+ await this.options.onError?.(t3, e2, this.state.context, n2);
1716
+ } catch (e3) {
1717
+ Promise.reject(e3);
1718
+ }
1719
+ try {
1720
+ await this.#n.config.onSettled?.(void 0, t3, this.state.variables, this.state.context, this, n2);
1721
+ } catch (e3) {
1722
+ Promise.reject(e3);
1723
+ }
1724
+ try {
1725
+ await this.options.onSettled?.(void 0, t3, e2, this.state.context, n2);
1726
+ } catch (e3) {
1727
+ Promise.reject(e3);
1728
+ }
1729
+ throw this.#i({ type: `error`, error: t3 }), t3;
1730
+ } finally {
1731
+ this.#n.runNext(this);
1732
+ }
1733
+ }
1734
+ #i(e2) {
1735
+ let t2 = (t3) => {
1736
+ switch (e2.type) {
1737
+ case `failed`:
1738
+ return { ...t3, failureCount: e2.failureCount, failureReason: e2.error };
1739
+ case `pause`:
1740
+ return { ...t3, isPaused: true };
1741
+ case `continue`:
1742
+ return { ...t3, isPaused: false };
1743
+ case `pending`:
1744
+ 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() };
1745
+ case `success`:
1746
+ return { ...t3, data: e2.data, failureCount: 0, failureReason: null, error: null, status: `success`, isPaused: false };
1747
+ case `error`:
1748
+ return { ...t3, data: void 0, error: e2.error, failureCount: t3.failureCount + 1, failureReason: e2.error, isPaused: false, status: `error` };
1749
+ }
1750
+ };
1751
+ this.state = t2(this.state), V.batch(() => {
1752
+ this.#t.forEach((t3) => {
1753
+ t3.onMutationUpdate(e2);
1754
+ }), this.#n.notify({ mutation: this, type: `updated`, action: e2 });
1755
+ });
1756
+ }
1757
+ };
1758
+ function Ar() {
1759
+ return { context: void 0, data: void 0, error: null, failureCount: 0, failureReason: null, isPaused: false, status: `idle`, variables: void 0, submittedAt: 0 };
1760
+ }
1761
+ var jr = class extends Mn {
1762
+ constructor(e2 = {}) {
1763
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#n = 0;
1764
+ }
1765
+ #e;
1766
+ #t;
1767
+ #n;
1768
+ build(e2, t2, n2) {
1769
+ let r2 = new kr({ client: e2, mutationCache: this, mutationId: ++this.#n, options: e2.defaultMutationOptions(t2), state: n2 });
1770
+ return this.add(r2), r2;
1771
+ }
1772
+ add(e2) {
1773
+ this.#e.add(e2);
1774
+ let t2 = Mr(e2);
1775
+ if (typeof t2 == `string`) {
1776
+ let n2 = this.#t.get(t2);
1777
+ n2 ? n2.push(e2) : this.#t.set(t2, [e2]);
1778
+ }
1779
+ this.notify({ type: `added`, mutation: e2 });
1780
+ }
1781
+ remove(e2) {
1782
+ if (this.#e.delete(e2)) {
1783
+ let t2 = Mr(e2);
1784
+ if (typeof t2 == `string`) {
1785
+ let n2 = this.#t.get(t2);
1786
+ if (n2) {
1787
+ if (n2.length > 1) {
1788
+ let t3 = n2.indexOf(e2);
1789
+ t3 !== -1 && n2.splice(t3, 1);
1790
+ } else n2[0] === e2 && this.#t.delete(t2);
1791
+ }
1792
+ }
1793
+ }
1794
+ this.notify({ type: `removed`, mutation: e2 });
1795
+ }
1796
+ canRun(e2) {
1797
+ let t2 = Mr(e2);
1798
+ if (typeof t2 == `string`) {
1799
+ let n2 = this.#t.get(t2)?.find((e3) => e3.state.status === `pending`);
1800
+ return !n2 || n2 === e2;
1801
+ }
1802
+ return true;
1803
+ }
1804
+ runNext(e2) {
1805
+ let t2 = Mr(e2);
1806
+ return typeof t2 == `string` ? this.#t.get(t2)?.find((t3) => t3 !== e2 && t3.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
1807
+ }
1808
+ clear() {
1809
+ V.batch(() => {
1810
+ this.#e.forEach((e2) => {
1811
+ this.notify({ type: `removed`, mutation: e2 });
1812
+ }), this.#e.clear(), this.#t.clear();
1813
+ });
1814
+ }
1815
+ getAll() {
1816
+ return Array.from(this.#e);
1817
+ }
1818
+ find(e2) {
1819
+ let t2 = { exact: true, ...e2 };
1820
+ return this.getAll().find((e3) => Vn(t2, e3));
1821
+ }
1822
+ findAll(e2 = {}) {
1823
+ return this.getAll().filter((t2) => Vn(e2, t2));
1824
+ }
1825
+ notify(e2) {
1826
+ V.batch(() => {
1827
+ this.listeners.forEach((t2) => {
1828
+ t2(e2);
1829
+ });
1830
+ });
1831
+ }
1832
+ resumePausedMutations() {
1833
+ let e2 = this.getAll().filter((e3) => e3.state.isPaused);
1834
+ return V.batch(() => Promise.all(e2.map((e3) => e3.continue().catch(R))));
1835
+ }
1836
+ };
1837
+ function Mr(e2) {
1838
+ return e2.options.scope?.id;
1839
+ }
1840
+ var Nr = class extends Mn {
1841
+ constructor(e2 = {}) {
1842
+ super(), this.config = e2, this.#e = /* @__PURE__ */ new Map();
1843
+ }
1844
+ #e;
1845
+ build(e2, t2, n2) {
1846
+ let r2 = t2.queryKey, i2 = t2.queryHash ?? Hn(r2, t2), a2 = this.get(i2);
1847
+ return a2 || (a2 = new vr({ client: e2, queryKey: r2, queryHash: i2, options: e2.defaultQueryOptions(t2), state: n2, defaultOptions: e2.getQueryDefaults(r2) }), this.add(a2)), a2;
1848
+ }
1849
+ add(e2) {
1850
+ this.#e.has(e2.queryHash) || (this.#e.set(e2.queryHash, e2), this.notify({ type: `added`, query: e2 }));
1851
+ }
1852
+ remove(e2) {
1853
+ let t2 = this.#e.get(e2.queryHash);
1854
+ t2 && (e2.destroy(), t2 === e2 && this.#e.delete(e2.queryHash), this.notify({ type: `removed`, query: e2 }));
1855
+ }
1856
+ clear() {
1857
+ V.batch(() => {
1858
+ this.getAll().forEach((e2) => {
1859
+ this.remove(e2);
1860
+ });
1861
+ });
1862
+ }
1863
+ get(e2) {
1864
+ return this.#e.get(e2);
1865
+ }
1866
+ getAll() {
1867
+ return [...this.#e.values()];
1868
+ }
1869
+ find(e2) {
1870
+ let t2 = { exact: true, ...e2 };
1871
+ return this.getAll().find((e3) => Bn(t2, e3));
1872
+ }
1873
+ findAll(e2 = {}) {
1874
+ let t2 = this.getAll();
1875
+ return Object.keys(e2).length > 0 ? t2.filter((t3) => Bn(e2, t3)) : t2;
1876
+ }
1877
+ notify(e2) {
1878
+ V.batch(() => {
1879
+ this.listeners.forEach((t2) => {
1880
+ t2(e2);
1881
+ });
1882
+ });
1883
+ }
1884
+ onFocus() {
1885
+ V.batch(() => {
1886
+ this.getAll().forEach((e2) => {
1887
+ e2.onFocus();
1888
+ });
1889
+ });
1890
+ }
1891
+ onOnline() {
1892
+ V.batch(() => {
1893
+ this.getAll().forEach((e2) => {
1894
+ e2.onOnline();
1895
+ });
1896
+ });
1897
+ }
1898
+ };
1899
+ var Pr = class {
1900
+ #e;
1901
+ #t;
1902
+ #n;
1903
+ #r;
1904
+ #i;
1905
+ #a;
1906
+ #o;
1907
+ #s;
1908
+ constructor(e2 = {}) {
1909
+ this.#e = e2.queryCache || new Nr(), this.#t = e2.mutationCache || new jr(), this.#n = e2.defaultOptions || {}, this.#r = /* @__PURE__ */ new Map(), this.#i = /* @__PURE__ */ new Map(), this.#a = 0;
1910
+ }
1911
+ mount() {
1912
+ this.#a++, this.#a === 1 && (this.#o = Nn.subscribe(async (e2) => {
1913
+ e2 && (await this.resumePausedMutations(), this.#e.onFocus());
1914
+ }), this.#s = lr.subscribe(async (e2) => {
1915
+ e2 && (await this.resumePausedMutations(), this.#e.onOnline());
1916
+ }));
1917
+ }
1918
+ unmount() {
1919
+ this.#a--, this.#a === 0 && (this.#o?.(), this.#o = void 0, this.#s?.(), this.#s = void 0);
1920
+ }
1921
+ isFetching(e2) {
1922
+ return this.#e.findAll({ ...e2, fetchStatus: `fetching` }).length;
1923
+ }
1924
+ isMutating(e2) {
1925
+ return this.#t.findAll({ ...e2, status: `pending` }).length;
1926
+ }
1927
+ getQueryData(e2) {
1928
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
1929
+ return this.#e.get(t2.queryHash)?.state.data;
1930
+ }
1931
+ ensureQueryData(e2) {
1932
+ let t2 = this.defaultQueryOptions(e2), n2 = this.#e.build(this, t2), r2 = n2.state.data;
1933
+ return r2 === void 0 ? this.fetchQuery(e2) : (e2.revalidateIfStale && n2.isStaleByTime(z(t2.staleTime, n2)) && this.prefetchQuery(t2), Promise.resolve(r2));
1934
+ }
1935
+ getQueriesData(e2) {
1936
+ return this.#e.findAll(e2).map(({ queryKey: e3, state: t2 }) => [e3, t2.data]);
1937
+ }
1938
+ setQueryData(e2, t2, n2) {
1939
+ let r2 = this.defaultQueryOptions({ queryKey: e2 }), i2 = this.#e.get(r2.queryHash)?.state.data, a2 = Ln(t2, i2);
1940
+ if (a2 !== void 0) return this.#e.build(this, r2).setData(a2, { ...n2, manual: true });
1941
+ }
1942
+ setQueriesData(e2, t2, n2) {
1943
+ return V.batch(() => this.#e.findAll(e2).map(({ queryKey: e3 }) => [e3, this.setQueryData(e3, t2, n2)]));
1944
+ }
1945
+ getQueryState(e2) {
1946
+ let t2 = this.defaultQueryOptions({ queryKey: e2 });
1947
+ return this.#e.get(t2.queryHash)?.state;
1948
+ }
1949
+ removeQueries(e2) {
1950
+ let t2 = this.#e;
1951
+ V.batch(() => {
1952
+ t2.findAll(e2).forEach((e3) => {
1953
+ t2.remove(e3);
1954
+ });
1955
+ });
1956
+ }
1957
+ resetQueries(e2, t2) {
1958
+ let n2 = this.#e;
1959
+ return V.batch(() => (n2.findAll(e2).forEach((e3) => {
1960
+ e3.reset();
1961
+ }), this.refetchQueries({ type: `active`, ...e2 }, t2)));
1962
+ }
1963
+ cancelQueries(e2, t2 = {}) {
1964
+ let n2 = { revert: true, ...t2 }, r2 = V.batch(() => this.#e.findAll(e2).map((e3) => e3.cancel(n2)));
1965
+ return Promise.all(r2).then(R).catch(R);
1966
+ }
1967
+ invalidateQueries(e2, t2 = {}) {
1968
+ return V.batch(() => (this.#e.findAll(e2).forEach((e3) => {
1969
+ e3.invalidate();
1970
+ }), e2?.refetchType === `none` ? Promise.resolve() : this.refetchQueries({ ...e2, type: e2?.refetchType ?? e2?.type ?? `active` }, t2)));
1971
+ }
1972
+ refetchQueries(e2, t2 = {}) {
1973
+ let n2 = { ...t2, cancelRefetch: t2.cancelRefetch ?? true }, r2 = V.batch(() => this.#e.findAll(e2).filter((e3) => !e3.isDisabled() && !e3.isStatic()).map((e3) => {
1974
+ let t3 = e3.fetch(void 0, n2);
1975
+ return n2.throwOnError || (t3 = t3.catch(R)), e3.state.fetchStatus === `paused` ? Promise.resolve() : t3;
1976
+ }));
1977
+ return Promise.all(r2).then(R);
1978
+ }
1979
+ fetchQuery(e2) {
1980
+ let t2 = this.defaultQueryOptions(e2);
1981
+ t2.retry === void 0 && (t2.retry = false);
1982
+ let n2 = this.#e.build(this, t2);
1983
+ return n2.isStaleByTime(z(t2.staleTime, n2)) ? n2.fetch(t2) : Promise.resolve(n2.state.data);
1984
+ }
1985
+ prefetchQuery(e2) {
1986
+ return this.fetchQuery(e2).then(R).catch(R);
1987
+ }
1988
+ fetchInfiniteQuery(e2) {
1989
+ return e2._type = `infinite`, this.fetchQuery(e2);
1990
+ }
1991
+ prefetchInfiniteQuery(e2) {
1992
+ return this.fetchInfiniteQuery(e2).then(R).catch(R);
1993
+ }
1994
+ ensureInfiniteQueryData(e2) {
1995
+ return e2._type = `infinite`, this.ensureQueryData(e2);
1996
+ }
1997
+ resumePausedMutations() {
1998
+ return lr.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
1999
+ }
2000
+ getQueryCache() {
2001
+ return this.#e;
2002
+ }
2003
+ getMutationCache() {
2004
+ return this.#t;
2005
+ }
2006
+ getDefaultOptions() {
2007
+ return this.#n;
2008
+ }
2009
+ setDefaultOptions(e2) {
2010
+ this.#n = e2;
2011
+ }
2012
+ setQueryDefaults(e2, t2) {
2013
+ this.#r.set(Un(e2), { queryKey: e2, defaultOptions: t2 });
2014
+ }
2015
+ getQueryDefaults(e2) {
2016
+ let t2 = [...this.#r.values()], n2 = {};
2017
+ return t2.forEach((t3) => {
2018
+ Wn(e2, t3.queryKey) && Object.assign(n2, t3.defaultOptions);
2019
+ }), n2;
2020
+ }
2021
+ setMutationDefaults(e2, t2) {
2022
+ this.#i.set(Un(e2), { mutationKey: e2, defaultOptions: t2 });
2023
+ }
2024
+ getMutationDefaults(e2) {
2025
+ let t2 = [...this.#i.values()], n2 = {};
2026
+ return t2.forEach((t3) => {
2027
+ Wn(e2, t3.mutationKey) && Object.assign(n2, t3.defaultOptions);
2028
+ }), n2;
2029
+ }
2030
+ defaultQueryOptions(e2) {
2031
+ if (e2._defaulted) return e2;
2032
+ let t2 = { ...this.#n.queries, ...this.getQueryDefaults(e2.queryKey), ...e2, _defaulted: true };
2033
+ return t2.queryHash ||= Hn(t2.queryKey, t2), t2.refetchOnReconnect === void 0 && (t2.refetchOnReconnect = t2.networkMode !== `always`), t2.throwOnError === void 0 && (t2.throwOnError = !!t2.suspense), !t2.networkMode && t2.persister && (t2.networkMode = `offlineFirst`), t2.queryFn === tr && (t2.enabled = false), t2;
2034
+ }
2035
+ defaultMutationOptions(e2) {
2036
+ return e2?._defaulted ? e2 : { ...this.#n.mutations, ...e2?.mutationKey && this.getMutationDefaults(e2.mutationKey), ...e2, _defaulted: true };
2037
+ }
2038
+ clear() {
2039
+ this.#e.clear(), this.#t.clear();
2040
+ }
2041
+ };
2042
+ var Fr = e.createContext(void 0);
2043
+ var Ir = (t2) => {
2044
+ let n2 = e.useContext(Fr);
2045
+ if (t2) return t2;
2046
+ if (!n2) throw Error(`No QueryClient set, use QueryClientProvider to set one`);
2047
+ return n2;
2048
+ };
2049
+ var Lr = ({ client: t2, children: n2 }) => (e.useEffect(() => (t2.mount(), () => {
2050
+ t2.unmount();
2051
+ }), [t2]), a(Fr.Provider, { value: t2, children: n2 }));
2052
+ var Rr = e.createContext(false);
2053
+ var zr = () => e.useContext(Rr);
2054
+ Rr.Provider;
2055
+ function Br() {
2056
+ let e2 = false;
2057
+ return { clearReset: () => {
2058
+ e2 = false;
2059
+ }, reset: () => {
2060
+ e2 = true;
2061
+ }, isReset: () => e2 };
2062
+ }
2063
+ var Vr = e.createContext(Br());
2064
+ var Hr = () => e.useContext(Vr);
2065
+ var Ur = (e2, t2, n2) => {
2066
+ let r2 = n2?.state.error && typeof e2.throwOnError == `function` ? rr(e2.throwOnError, [n2.state.error, n2]) : e2.throwOnError;
2067
+ (e2.suspense || e2.experimental_prefetchInRender || r2) && (t2.isReset() || (e2.retryOnMount = false));
2068
+ };
2069
+ var Wr = (t2) => {
2070
+ e.useEffect(() => {
2071
+ t2.clearReset();
2072
+ }, [t2]);
2073
+ };
2074
+ var Gr = ({ result: e2, errorResetBoundary: t2, throwOnError: n2, query: r2, suspense: i2 }) => e2.isError && !t2.isReset() && !e2.isFetching && r2 && (i2 && e2.data === void 0 || rr(n2, [e2.error, r2]));
2075
+ var Kr = (e2) => {
2076
+ if (e2.suspense) {
2077
+ let t2 = 1e3, n2 = (e3) => e3 === `static` ? e3 : Math.max(e3 ?? t2, t2), r2 = e2.staleTime;
2078
+ e2.staleTime = typeof r2 == `function` ? (...e3) => n2(r2(...e3)) : n2(r2), typeof e2.gcTime == `number` && (e2.gcTime = Math.max(e2.gcTime, t2));
2079
+ }
2080
+ };
2081
+ var qr = (e2, t2) => e2.isLoading && e2.isFetching && !t2;
2082
+ var Jr = (e2, t2) => e2?.suspense && t2.isPending;
2083
+ var Yr = (e2, t2, n2) => t2.fetchOptimistic(e2).catch(() => {
2084
+ n2.clearReset();
2085
+ });
2086
+ function Xr(t2, n2, r2) {
2087
+ let i2 = zr(), a2 = Hr(), o2 = Ir(r2), s2 = o2.defaultQueryOptions(t2);
2088
+ o2.getDefaultOptions().queries?._experimental_beforeQuery?.(s2);
2089
+ let c2 = o2.getQueryCache().get(s2.queryHash), l2 = t2.subscribed !== false;
2090
+ s2._optimisticResults = i2 ? `isRestoring` : l2 ? `optimistic` : void 0, Kr(s2), Ur(s2, a2, c2), Wr(a2);
2091
+ let u2 = !o2.getQueryCache().get(s2.queryHash), [d2] = e.useState(() => new n2(o2, s2)), f2 = d2.getOptimisticResult(s2), p2 = !i2 && l2;
2092
+ if (e.useSyncExternalStore(e.useCallback((e2) => {
2093
+ let t3 = p2 ? d2.subscribe(V.batchCalls(e2)) : R;
2094
+ return d2.updateResult(), t3;
2095
+ }, [d2, p2]), () => d2.getCurrentResult(), () => d2.getCurrentResult()), e.useEffect(() => {
2096
+ d2.setOptions(s2);
2097
+ }, [s2, d2]), Jr(s2, f2)) throw Yr(s2, d2, a2);
2098
+ if (Gr({ result: f2, errorResetBoundary: a2, throwOnError: s2.throwOnError, query: c2, suspense: s2.suspense })) throw f2.error;
2099
+ return o2.getDefaultOptions().queries?._experimental_afterQuery?.(s2, f2), s2.experimental_prefetchInRender && !ar.isServer() && qr(f2, i2) && (u2 ? Yr(s2, d2, a2) : c2?.promise)?.catch(R).finally(() => {
2100
+ d2.updateResult();
2101
+ }), s2.notifyOnChangeProps ? f2 : d2.trackResult(f2);
2102
+ }
2103
+ function Zr(e2, t2) {
2104
+ return Xr(e2, Sr, t2);
2105
+ }
2106
+ function H(e2) {
2107
+ return e2;
2108
+ }
2109
+ var Qr = H(`@wix/site-service-url`);
2110
+ var $r = `215238eb-22a5-4c36-9e7b-e7c08025e04e`;
2111
+ var ei = `1380b703-ce81-ff05-f115-39571d94dfcd`;
2112
+ `${$r}`, `${$r}`;
2113
+ var U = function(e2) {
2114
+ 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;
2115
+ }({});
2116
+ var ti = () => {
2117
+ let e2 = l(Qr), n2 = t((t2, n3) => {
2118
+ let r2 = e2.appSectionRelativeUrl($r, t2, true);
2119
+ if (r2) return `./${r2.replace(/^\//, ``).replace(/\/$/, ``)}/${encodeURIComponent(n3)}`;
2120
+ }, [e2]);
2121
+ return { getPageRelativeUrl: n2, getPageAbsoluteUrl: t((t2, r2) => {
2122
+ let i2 = n2(t2, r2);
2123
+ if (i2) return new URL(i2, `${e2.siteUrl.replace(/\/$/, ``)}/`).href;
2124
+ }, [n2, e2]) };
2125
+ };
2126
+ var ni = g((e2, t2) => {
2127
+ t2.exports = typeof window == `object` && window && window.Object === Object && window;
2128
+ });
2129
+ var W = g((e2, t2) => {
2130
+ var n2 = ni(), r2 = typeof self == `object` && self && self.Object === Object && self;
2131
+ t2.exports = n2 || r2 || Function(`return this`)();
2132
+ });
2133
+ var ri = g((e2, t2) => {
2134
+ t2.exports = W().Symbol;
2135
+ });
2136
+ var ii = g((e2, t2) => {
2137
+ var n2 = ri(), r2 = Object.prototype, i2 = r2.hasOwnProperty, a2 = r2.toString, o2 = n2 ? n2.toStringTag : void 0;
2138
+ function s2(e3) {
2139
+ var t3 = i2.call(e3, o2), n3 = e3[o2];
2140
+ try {
2141
+ e3[o2] = void 0;
2142
+ var r3 = true;
2143
+ } catch {
2144
+ }
2145
+ var s3 = a2.call(e3);
2146
+ return r3 && (t3 ? e3[o2] = n3 : delete e3[o2]), s3;
2147
+ }
2148
+ t2.exports = s2;
2149
+ });
2150
+ var ai = g((e2, t2) => {
2151
+ var n2 = Object.prototype.toString;
2152
+ function r2(e3) {
2153
+ return n2.call(e3);
2154
+ }
2155
+ t2.exports = r2;
2156
+ });
2157
+ var oi = g((e2, t2) => {
2158
+ var n2 = ri(), r2 = ii(), i2 = ai(), a2 = `[object Null]`, o2 = `[object Undefined]`, s2 = n2 ? n2.toStringTag : void 0;
2159
+ function c2(e3) {
2160
+ return e3 == null ? e3 === void 0 ? o2 : a2 : s2 && s2 in Object(e3) ? r2(e3) : i2(e3);
2161
+ }
2162
+ t2.exports = c2;
2163
+ });
2164
+ var si = g((e2, t2) => {
2165
+ function n2(e3) {
2166
+ return typeof e3 == `object` && !!e3;
2167
+ }
2168
+ t2.exports = n2;
2169
+ });
2170
+ var ci = g((e2, t2) => {
2171
+ var n2 = oi(), r2 = si(), i2 = `[object Symbol]`;
2172
+ function a2(e3) {
2173
+ return typeof e3 == `symbol` || r2(e3) && n2(e3) == i2;
2174
+ }
2175
+ t2.exports = a2;
2176
+ });
2177
+ var li = g((e2, t2) => {
2178
+ var n2 = ci();
2179
+ function r2(e3, t3, r3) {
2180
+ for (var i2 = -1, a2 = e3.length; ++i2 < a2; ) {
2181
+ var o2 = e3[i2], s2 = t3(o2);
2182
+ if (s2 != null && (c2 === void 0 ? s2 === s2 && !n2(s2) : r3(s2, c2))) var c2 = s2, l2 = o2;
2183
+ }
2184
+ return l2;
2185
+ }
2186
+ t2.exports = r2;
2187
+ });
2188
+ var ui = g((e2, t2) => {
2189
+ function n2(e3, t3) {
2190
+ return e3 > t3;
2191
+ }
2192
+ t2.exports = n2;
2193
+ });
2194
+ var di = g((e2, t2) => {
2195
+ function n2(e3) {
2196
+ return e3;
2197
+ }
2198
+ t2.exports = n2;
2199
+ });
2200
+ var fi = g((e2, t2) => {
2201
+ var n2 = li(), r2 = ui(), i2 = di();
2202
+ function a2(e3) {
2203
+ return e3 && e3.length ? n2(e3, i2, r2) : void 0;
2204
+ }
2205
+ t2.exports = a2;
2206
+ });
2207
+ var pi = g((e2, t2) => {
2208
+ function n2() {
2209
+ this.__data__ = [], this.size = 0;
2210
+ }
2211
+ t2.exports = n2;
2212
+ });
2213
+ var mi = g((e2, t2) => {
2214
+ function n2(e3, t3) {
2215
+ return e3 === t3 || e3 !== e3 && t3 !== t3;
2216
+ }
2217
+ t2.exports = n2;
2218
+ });
2219
+ var hi = g((e2, t2) => {
2220
+ var n2 = mi();
2221
+ function r2(e3, t3) {
2222
+ for (var r3 = e3.length; r3--; ) if (n2(e3[r3][0], t3)) return r3;
2223
+ return -1;
2224
+ }
2225
+ t2.exports = r2;
2226
+ });
2227
+ var gi = g((e2, t2) => {
2228
+ var n2 = hi(), r2 = Array.prototype.splice;
2229
+ function i2(e3) {
2230
+ var t3 = this.__data__, i3 = n2(t3, e3);
2231
+ return i3 < 0 ? false : (i3 == t3.length - 1 ? t3.pop() : r2.call(t3, i3, 1), --this.size, true);
2232
+ }
2233
+ t2.exports = i2;
2234
+ });
2235
+ var _i = g((e2, t2) => {
2236
+ var n2 = hi();
2237
+ function r2(e3) {
2238
+ var t3 = this.__data__, r3 = n2(t3, e3);
2239
+ return r3 < 0 ? void 0 : t3[r3][1];
2240
+ }
2241
+ t2.exports = r2;
2242
+ });
2243
+ var vi = g((e2, t2) => {
2244
+ var n2 = hi();
2245
+ function r2(e3) {
2246
+ return n2(this.__data__, e3) > -1;
2247
+ }
2248
+ t2.exports = r2;
2249
+ });
2250
+ var yi = g((e2, t2) => {
2251
+ var n2 = hi();
2252
+ function r2(e3, t3) {
2253
+ var r3 = this.__data__, i2 = n2(r3, e3);
2254
+ return i2 < 0 ? (++this.size, r3.push([e3, t3])) : r3[i2][1] = t3, this;
2255
+ }
2256
+ t2.exports = r2;
2257
+ });
2258
+ var bi = g((e2, t2) => {
2259
+ var n2 = pi(), r2 = gi(), i2 = _i(), a2 = vi(), o2 = yi();
2260
+ function s2(e3) {
2261
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2262
+ for (this.clear(); ++t3 < n3; ) {
2263
+ var r3 = e3[t3];
2264
+ this.set(r3[0], r3[1]);
2265
+ }
2266
+ }
2267
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2268
+ });
2269
+ var xi = g((e2, t2) => {
2270
+ var n2 = bi();
2271
+ function r2() {
2272
+ this.__data__ = new n2(), this.size = 0;
2273
+ }
2274
+ t2.exports = r2;
2275
+ });
2276
+ var Si = g((e2, t2) => {
2277
+ function n2(e3) {
2278
+ var t3 = this.__data__, n3 = t3.delete(e3);
2279
+ return this.size = t3.size, n3;
2280
+ }
2281
+ t2.exports = n2;
2282
+ });
2283
+ var Ci = g((e2, t2) => {
2284
+ function n2(e3) {
2285
+ return this.__data__.get(e3);
2286
+ }
2287
+ t2.exports = n2;
2288
+ });
2289
+ var wi = g((e2, t2) => {
2290
+ function n2(e3) {
2291
+ return this.__data__.has(e3);
2292
+ }
2293
+ t2.exports = n2;
2294
+ });
2295
+ var Ti = g((e2, t2) => {
2296
+ function n2(e3) {
2297
+ var t3 = typeof e3;
2298
+ return e3 != null && (t3 == `object` || t3 == `function`);
2299
+ }
2300
+ t2.exports = n2;
2301
+ });
2302
+ var Ei = g((e2, t2) => {
2303
+ var n2 = oi(), r2 = Ti(), i2 = `[object AsyncFunction]`, a2 = `[object Function]`, o2 = `[object GeneratorFunction]`, s2 = `[object Proxy]`;
2304
+ function c2(e3) {
2305
+ if (!r2(e3)) return false;
2306
+ var t3 = n2(e3);
2307
+ return t3 == a2 || t3 == o2 || t3 == i2 || t3 == s2;
2308
+ }
2309
+ t2.exports = c2;
2310
+ });
2311
+ var Di = g((e2, t2) => {
2312
+ t2.exports = W()[`__core-js_shared__`];
2313
+ });
2314
+ var Oi = g((e2, t2) => {
2315
+ var n2 = Di(), r2 = function() {
2316
+ var e3 = /[^.]+$/.exec(n2 && n2.keys && n2.keys.IE_PROTO || ``);
2317
+ return e3 ? `Symbol(src)_1.` + e3 : ``;
2318
+ }();
2319
+ function i2(e3) {
2320
+ return !!r2 && r2 in e3;
2321
+ }
2322
+ t2.exports = i2;
2323
+ });
2324
+ var ki = g((e2, t2) => {
2325
+ var n2 = Function.prototype.toString;
2326
+ function r2(e3) {
2327
+ if (e3 != null) {
2328
+ try {
2329
+ return n2.call(e3);
2330
+ } catch {
2331
+ }
2332
+ try {
2333
+ return e3 + ``;
2334
+ } catch {
2335
+ }
2336
+ }
2337
+ return ``;
2338
+ }
2339
+ t2.exports = r2;
2340
+ });
2341
+ var Ai = g((e2, t2) => {
2342
+ var n2 = Ei(), r2 = Oi(), i2 = Ti(), a2 = ki(), o2 = /[\\^$.*+?()[\]{}|]/g, s2 = /^\[object .+?Constructor\]$/, c2 = Function.prototype, l2 = Object.prototype, u2 = c2.toString, d2 = l2.hasOwnProperty, f2 = RegExp(`^` + u2.call(d2).replace(o2, `\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, `$1.*?`) + `$`);
2343
+ function p2(e3) {
2344
+ return !i2(e3) || r2(e3) ? false : (n2(e3) ? f2 : s2).test(a2(e3));
2345
+ }
2346
+ t2.exports = p2;
2347
+ });
2348
+ var ji = g((e2, t2) => {
2349
+ function n2(e3, t3) {
2350
+ return e3?.[t3];
2351
+ }
2352
+ t2.exports = n2;
2353
+ });
2354
+ var G = g((e2, t2) => {
2355
+ var n2 = Ai(), r2 = ji();
2356
+ function i2(e3, t3) {
2357
+ var i3 = r2(e3, t3);
2358
+ return n2(i3) ? i3 : void 0;
2359
+ }
2360
+ t2.exports = i2;
2361
+ });
2362
+ var Mi = g((e2, t2) => {
2363
+ t2.exports = G()(W(), `Map`);
2364
+ });
2365
+ var Ni = g((e2, t2) => {
2366
+ t2.exports = G()(Object, `create`);
2367
+ });
2368
+ var Pi = g((e2, t2) => {
2369
+ var n2 = Ni();
2370
+ function r2() {
2371
+ this.__data__ = n2 ? n2(null) : {}, this.size = 0;
2372
+ }
2373
+ t2.exports = r2;
2374
+ });
2375
+ var Fi = g((e2, t2) => {
2376
+ function n2(e3) {
2377
+ var t3 = this.has(e3) && delete this.__data__[e3];
2378
+ return this.size -= +!!t3, t3;
2379
+ }
2380
+ t2.exports = n2;
2381
+ });
2382
+ var Ii = g((e2, t2) => {
2383
+ var n2 = Ni(), r2 = `__lodash_hash_undefined__`, i2 = Object.prototype.hasOwnProperty;
2384
+ function a2(e3) {
2385
+ var t3 = this.__data__;
2386
+ if (n2) {
2387
+ var a3 = t3[e3];
2388
+ return a3 === r2 ? void 0 : a3;
2389
+ }
2390
+ return i2.call(t3, e3) ? t3[e3] : void 0;
2391
+ }
2392
+ t2.exports = a2;
2393
+ });
2394
+ var Li = g((e2, t2) => {
2395
+ var n2 = Ni(), r2 = Object.prototype.hasOwnProperty;
2396
+ function i2(e3) {
2397
+ var t3 = this.__data__;
2398
+ return n2 ? t3[e3] !== void 0 : r2.call(t3, e3);
2399
+ }
2400
+ t2.exports = i2;
2401
+ });
2402
+ var Ri = g((e2, t2) => {
2403
+ var n2 = Ni(), r2 = `__lodash_hash_undefined__`;
2404
+ function i2(e3, t3) {
2405
+ var i3 = this.__data__;
2406
+ return this.size += +!this.has(e3), i3[e3] = n2 && t3 === void 0 ? r2 : t3, this;
2407
+ }
2408
+ t2.exports = i2;
2409
+ });
2410
+ var zi = g((e2, t2) => {
2411
+ var n2 = Pi(), r2 = Fi(), i2 = Ii(), a2 = Li(), o2 = Ri();
2412
+ function s2(e3) {
2413
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2414
+ for (this.clear(); ++t3 < n3; ) {
2415
+ var r3 = e3[t3];
2416
+ this.set(r3[0], r3[1]);
2417
+ }
2418
+ }
2419
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2420
+ });
2421
+ var Bi = g((e2, t2) => {
2422
+ var n2 = zi(), r2 = bi(), i2 = Mi();
2423
+ function a2() {
2424
+ this.size = 0, this.__data__ = { hash: new n2(), map: new (i2 || r2)(), string: new n2() };
2425
+ }
2426
+ t2.exports = a2;
2427
+ });
2428
+ var Vi = g((e2, t2) => {
2429
+ function n2(e3) {
2430
+ var t3 = typeof e3;
2431
+ return t3 == `string` || t3 == `number` || t3 == `symbol` || t3 == `boolean` ? e3 !== `__proto__` : e3 === null;
2432
+ }
2433
+ t2.exports = n2;
2434
+ });
2435
+ var Hi = g((e2, t2) => {
2436
+ var n2 = Vi();
2437
+ function r2(e3, t3) {
2438
+ var r3 = e3.__data__;
2439
+ return n2(t3) ? r3[typeof t3 == `string` ? `string` : `hash`] : r3.map;
2440
+ }
2441
+ t2.exports = r2;
2442
+ });
2443
+ var Ui = g((e2, t2) => {
2444
+ var n2 = Hi();
2445
+ function r2(e3) {
2446
+ var t3 = n2(this, e3).delete(e3);
2447
+ return this.size -= +!!t3, t3;
2448
+ }
2449
+ t2.exports = r2;
2450
+ });
2451
+ var Wi = g((e2, t2) => {
2452
+ var n2 = Hi();
2453
+ function r2(e3) {
2454
+ return n2(this, e3).get(e3);
2455
+ }
2456
+ t2.exports = r2;
2457
+ });
2458
+ var Gi = g((e2, t2) => {
2459
+ var n2 = Hi();
2460
+ function r2(e3) {
2461
+ return n2(this, e3).has(e3);
2462
+ }
2463
+ t2.exports = r2;
2464
+ });
2465
+ var Ki = g((e2, t2) => {
2466
+ var n2 = Hi();
2467
+ function r2(e3, t3) {
2468
+ var r3 = n2(this, e3), i2 = r3.size;
2469
+ return r3.set(e3, t3), this.size += r3.size == i2 ? 0 : 1, this;
2470
+ }
2471
+ t2.exports = r2;
2472
+ });
2473
+ var qi = g((e2, t2) => {
2474
+ var n2 = Bi(), r2 = Ui(), i2 = Wi(), a2 = Gi(), o2 = Ki();
2475
+ function s2(e3) {
2476
+ var t3 = -1, n3 = e3 == null ? 0 : e3.length;
2477
+ for (this.clear(); ++t3 < n3; ) {
2478
+ var r3 = e3[t3];
2479
+ this.set(r3[0], r3[1]);
2480
+ }
2481
+ }
2482
+ s2.prototype.clear = n2, s2.prototype.delete = r2, s2.prototype.get = i2, s2.prototype.has = a2, s2.prototype.set = o2, t2.exports = s2;
2483
+ });
2484
+ var Ji = g((e2, t2) => {
2485
+ var n2 = bi(), r2 = Mi(), i2 = qi(), a2 = 200;
2486
+ function o2(e3, t3) {
2487
+ var o3 = this.__data__;
2488
+ if (o3 instanceof n2) {
2489
+ var s2 = o3.__data__;
2490
+ if (!r2 || s2.length < a2 - 1) return s2.push([e3, t3]), this.size = ++o3.size, this;
2491
+ o3 = this.__data__ = new i2(s2);
2492
+ }
2493
+ return o3.set(e3, t3), this.size = o3.size, this;
2494
+ }
2495
+ t2.exports = o2;
2496
+ });
2497
+ var Yi = g((e2, t2) => {
2498
+ var n2 = bi(), r2 = xi(), i2 = Si(), a2 = Ci(), o2 = wi(), s2 = Ji();
2499
+ function c2(e3) {
2500
+ var t3 = this.__data__ = new n2(e3);
2501
+ this.size = t3.size;
2502
+ }
2503
+ c2.prototype.clear = r2, c2.prototype.delete = i2, c2.prototype.get = a2, c2.prototype.has = o2, c2.prototype.set = s2, t2.exports = c2;
2504
+ });
2505
+ var Xi = g((e2, t2) => {
2506
+ function n2(e3) {
2507
+ return this.__data__.set(e3, `__lodash_hash_undefined__`), this;
2508
+ }
2509
+ t2.exports = n2;
2510
+ });
2511
+ var Zi = g((e2, t2) => {
2512
+ function n2(e3) {
2513
+ return this.__data__.has(e3);
2514
+ }
2515
+ t2.exports = n2;
2516
+ });
2517
+ var Qi = g((e2, t2) => {
2518
+ var n2 = qi(), r2 = Xi(), i2 = Zi();
2519
+ function a2(e3) {
2520
+ var t3 = -1, r3 = e3 == null ? 0 : e3.length;
2521
+ for (this.__data__ = new n2(); ++t3 < r3; ) this.add(e3[t3]);
2522
+ }
2523
+ a2.prototype.add = a2.prototype.push = r2, a2.prototype.has = i2, t2.exports = a2;
2524
+ });
2525
+ var $i = g((e2, t2) => {
2526
+ function n2(e3, t3) {
2527
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length; ++n3 < r2; ) if (t3(e3[n3], n3, e3)) return true;
2528
+ return false;
2529
+ }
2530
+ t2.exports = n2;
2531
+ });
2532
+ var ea = g((e2, t2) => {
2533
+ function n2(e3, t3) {
2534
+ return e3.has(t3);
2535
+ }
2536
+ t2.exports = n2;
2537
+ });
2538
+ var ta = g((e2, t2) => {
2539
+ var n2 = Qi(), r2 = $i(), i2 = ea(), a2 = 1, o2 = 2;
2540
+ function s2(e3, t3, s3, c2, l2, u2) {
2541
+ var d2 = s3 & a2, f2 = e3.length, p2 = t3.length;
2542
+ if (f2 != p2 && !(d2 && p2 > f2)) return false;
2543
+ var m2 = u2.get(e3), h2 = u2.get(t3);
2544
+ if (m2 && h2) return m2 == t3 && h2 == e3;
2545
+ var g2 = -1, _2 = true, v2 = s3 & o2 ? new n2() : void 0;
2546
+ for (u2.set(e3, t3), u2.set(t3, e3); ++g2 < f2; ) {
2547
+ var y2 = e3[g2], b2 = t3[g2];
2548
+ if (c2) var x2 = d2 ? c2(b2, y2, g2, t3, e3, u2) : c2(y2, b2, g2, e3, t3, u2);
2549
+ if (x2 !== void 0) {
2550
+ if (x2) continue;
2551
+ _2 = false;
2552
+ break;
2553
+ }
2554
+ if (v2) {
2555
+ if (!r2(t3, function(e4, t4) {
2556
+ if (!i2(v2, t4) && (y2 === e4 || l2(y2, e4, s3, c2, u2))) return v2.push(t4);
2557
+ })) {
2558
+ _2 = false;
2559
+ break;
2560
+ }
2561
+ } else if (!(y2 === b2 || l2(y2, b2, s3, c2, u2))) {
2562
+ _2 = false;
2563
+ break;
2564
+ }
2565
+ }
2566
+ return u2.delete(e3), u2.delete(t3), _2;
2567
+ }
2568
+ t2.exports = s2;
2569
+ });
2570
+ var na = g((e2, t2) => {
2571
+ t2.exports = W().Uint8Array;
2572
+ });
2573
+ var ra = g((e2, t2) => {
2574
+ function n2(e3) {
2575
+ var t3 = -1, n3 = Array(e3.size);
2576
+ return e3.forEach(function(e4, r2) {
2577
+ n3[++t3] = [r2, e4];
2578
+ }), n3;
2579
+ }
2580
+ t2.exports = n2;
2581
+ });
2582
+ var ia = g((e2, t2) => {
2583
+ function n2(e3) {
2584
+ var t3 = -1, n3 = Array(e3.size);
2585
+ return e3.forEach(function(e4) {
2586
+ n3[++t3] = e4;
2587
+ }), n3;
2588
+ }
2589
+ t2.exports = n2;
2590
+ });
2591
+ var aa = g((e2, t2) => {
2592
+ var n2 = ri(), r2 = na(), i2 = mi(), a2 = ta(), o2 = ra(), s2 = ia(), c2 = 1, l2 = 2, u2 = `[object Boolean]`, d2 = `[object Date]`, f2 = `[object Error]`, p2 = `[object Map]`, m2 = `[object Number]`, h2 = `[object RegExp]`, g2 = `[object Set]`, _2 = `[object String]`, v2 = `[object Symbol]`, y2 = `[object ArrayBuffer]`, b2 = `[object DataView]`, x2 = n2 ? n2.prototype : void 0, S2 = x2 ? x2.valueOf : void 0;
2593
+ function C2(e3, t3, n3, x3, C3, w2, T2) {
2594
+ switch (n3) {
2595
+ case b2:
2596
+ if (e3.byteLength != t3.byteLength || e3.byteOffset != t3.byteOffset) return false;
2597
+ e3 = e3.buffer, t3 = t3.buffer;
2598
+ case y2:
2599
+ return !(e3.byteLength != t3.byteLength || !w2(new r2(e3), new r2(t3)));
2600
+ case u2:
2601
+ case d2:
2602
+ case m2:
2603
+ return i2(+e3, +t3);
2604
+ case f2:
2605
+ return e3.name == t3.name && e3.message == t3.message;
2606
+ case h2:
2607
+ case _2:
2608
+ return e3 == t3 + ``;
2609
+ case p2:
2610
+ var E2 = o2;
2611
+ case g2:
2612
+ var D2 = x3 & c2;
2613
+ if (E2 ||= s2, e3.size != t3.size && !D2) return false;
2614
+ var O2 = T2.get(e3);
2615
+ if (O2) return O2 == t3;
2616
+ x3 |= l2, T2.set(e3, t3);
2617
+ var k2 = a2(E2(e3), E2(t3), x3, C3, w2, T2);
2618
+ return T2.delete(e3), k2;
2619
+ case v2:
2620
+ if (S2) return S2.call(e3) == S2.call(t3);
2621
+ }
2622
+ return false;
2623
+ }
2624
+ t2.exports = C2;
2625
+ });
2626
+ var oa = g((e2, t2) => {
2627
+ function n2(e3, t3) {
2628
+ for (var n3 = -1, r2 = t3.length, i2 = e3.length; ++n3 < r2; ) e3[i2 + n3] = t3[n3];
2629
+ return e3;
2630
+ }
2631
+ t2.exports = n2;
2632
+ });
2633
+ var K = g((e2, t2) => {
2634
+ t2.exports = Array.isArray;
2635
+ });
2636
+ var sa = g((e2, t2) => {
2637
+ var n2 = oa(), r2 = K();
2638
+ function i2(e3, t3, i3) {
2639
+ var a2 = t3(e3);
2640
+ return r2(e3) ? a2 : n2(a2, i3(e3));
2641
+ }
2642
+ t2.exports = i2;
2643
+ });
2644
+ var ca = g((e2, t2) => {
2645
+ function n2(e3, t3) {
2646
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length, i2 = 0, a2 = []; ++n3 < r2; ) {
2647
+ var o2 = e3[n3];
2648
+ t3(o2, n3, e3) && (a2[i2++] = o2);
2649
+ }
2650
+ return a2;
2651
+ }
2652
+ t2.exports = n2;
2653
+ });
2654
+ var la = g((e2, t2) => {
2655
+ function n2() {
2656
+ return [];
2657
+ }
2658
+ t2.exports = n2;
2659
+ });
2660
+ var ua = g((e2, t2) => {
2661
+ var n2 = ca(), r2 = la(), i2 = Object.prototype.propertyIsEnumerable, a2 = Object.getOwnPropertySymbols;
2662
+ t2.exports = a2 ? function(e3) {
2663
+ return e3 == null ? [] : (e3 = Object(e3), n2(a2(e3), function(t3) {
2664
+ return i2.call(e3, t3);
2665
+ }));
2666
+ } : r2;
2667
+ });
2668
+ var da = g((e2, t2) => {
2669
+ function n2(e3, t3) {
2670
+ for (var n3 = -1, r2 = Array(e3); ++n3 < e3; ) r2[n3] = t3(n3);
2671
+ return r2;
2672
+ }
2673
+ t2.exports = n2;
2674
+ });
2675
+ var fa = g((e2, t2) => {
2676
+ var n2 = oi(), r2 = si(), i2 = `[object Arguments]`;
2677
+ function a2(e3) {
2678
+ return r2(e3) && n2(e3) == i2;
2679
+ }
2680
+ t2.exports = a2;
2681
+ });
2682
+ var pa = g((e2, t2) => {
2683
+ var n2 = fa(), r2 = si(), i2 = Object.prototype, a2 = i2.hasOwnProperty, o2 = i2.propertyIsEnumerable;
2684
+ t2.exports = n2(/* @__PURE__ */ function() {
2685
+ return arguments;
2686
+ }()) ? n2 : function(e3) {
2687
+ return r2(e3) && a2.call(e3, `callee`) && !o2.call(e3, `callee`);
2688
+ };
2689
+ });
2690
+ var ma = g((e2, t2) => {
2691
+ function n2() {
2692
+ return false;
2693
+ }
2694
+ t2.exports = n2;
2695
+ });
2696
+ var ha = g((e2, t2) => {
2697
+ var n2 = W(), r2 = ma(), i2 = typeof e2 == `object` && e2 && !e2.nodeType && e2, a2 = i2 && typeof t2 == `object` && t2 && !t2.nodeType && t2, o2 = a2 && a2.exports === i2 ? n2.Buffer : void 0;
2698
+ t2.exports = (o2 ? o2.isBuffer : void 0) || r2;
2699
+ });
2700
+ var ga = g((e2, t2) => {
2701
+ var n2 = /^(?:0|[1-9]\d*)$/;
2702
+ function r2(e3, t3) {
2703
+ var r3 = typeof e3;
2704
+ return t3 ??= 9007199254740991, !!t3 && (r3 == `number` || r3 != `symbol` && n2.test(e3)) && e3 > -1 && e3 % 1 == 0 && e3 < t3;
2705
+ }
2706
+ t2.exports = r2;
2707
+ });
2708
+ var _a = g((e2, t2) => {
2709
+ function n2(e3) {
2710
+ return typeof e3 == `number` && e3 > -1 && e3 % 1 == 0 && e3 <= 9007199254740991;
2711
+ }
2712
+ t2.exports = n2;
2713
+ });
2714
+ var va = g((e2, t2) => {
2715
+ var n2 = oi(), r2 = _a(), i2 = si(), a2 = `[object Arguments]`, o2 = `[object Array]`, s2 = `[object Boolean]`, c2 = `[object Date]`, l2 = `[object Error]`, u2 = `[object Function]`, d2 = `[object Map]`, f2 = `[object Number]`, p2 = `[object Object]`, m2 = `[object RegExp]`, h2 = `[object Set]`, g2 = `[object String]`, _2 = `[object WeakMap]`, v2 = `[object ArrayBuffer]`, y2 = `[object DataView]`, b2 = `[object Float32Array]`, x2 = `[object Float64Array]`, S2 = `[object Int8Array]`, C2 = `[object Int16Array]`, w2 = `[object Int32Array]`, T2 = `[object Uint8Array]`, E2 = `[object Uint8ClampedArray]`, D2 = `[object Uint16Array]`, O2 = `[object Uint32Array]`, k2 = {};
2716
+ k2[b2] = k2[x2] = k2[S2] = k2[C2] = k2[w2] = k2[T2] = k2[E2] = k2[D2] = k2[O2] = true, k2[a2] = k2[o2] = k2[v2] = k2[s2] = k2[y2] = k2[c2] = k2[l2] = k2[u2] = k2[d2] = k2[f2] = k2[p2] = k2[m2] = k2[h2] = k2[g2] = k2[_2] = false;
2717
+ function ee2(e3) {
2718
+ return i2(e3) && r2(e3.length) && !!k2[n2(e3)];
2719
+ }
2720
+ t2.exports = ee2;
2721
+ });
2722
+ var ya = g((e2, t2) => {
2723
+ function n2(e3) {
2724
+ return function(t3) {
2725
+ return e3(t3);
2726
+ };
2727
+ }
2728
+ t2.exports = n2;
2729
+ });
2730
+ var ba = g((e2, t2) => {
2731
+ var n2 = ni(), r2 = typeof e2 == `object` && e2 && !e2.nodeType && e2, i2 = r2 && typeof t2 == `object` && t2 && !t2.nodeType && t2, a2 = i2 && i2.exports === r2 && n2.process;
2732
+ t2.exports = function() {
2733
+ try {
2734
+ return i2 && i2.require && i2.require(`util`).types || a2 && a2.binding && a2.binding(`util`);
2735
+ } catch {
2736
+ }
2737
+ }();
2738
+ });
2739
+ var xa = g((e2, t2) => {
2740
+ var n2 = va(), r2 = ya(), i2 = ba(), a2 = i2 && i2.isTypedArray;
2741
+ t2.exports = a2 ? r2(a2) : n2;
2742
+ });
2743
+ var Sa = g((e2, t2) => {
2744
+ var n2 = da(), r2 = pa(), i2 = K(), a2 = ha(), o2 = ga(), s2 = xa(), c2 = Object.prototype.hasOwnProperty;
2745
+ function l2(e3, t3) {
2746
+ var l3 = i2(e3), u2 = !l3 && r2(e3), d2 = !l3 && !u2 && a2(e3), f2 = !l3 && !u2 && !d2 && s2(e3), p2 = l3 || u2 || d2 || f2, m2 = p2 ? n2(e3.length, String) : [], h2 = m2.length;
2747
+ for (var g2 in e3) (t3 || c2.call(e3, g2)) && !(p2 && (g2 == `length` || d2 && (g2 == `offset` || g2 == `parent`) || f2 && (g2 == `buffer` || g2 == `byteLength` || g2 == `byteOffset`) || o2(g2, h2))) && m2.push(g2);
2748
+ return m2;
2749
+ }
2750
+ t2.exports = l2;
2751
+ });
2752
+ var Ca = g((e2, t2) => {
2753
+ var n2 = Object.prototype;
2754
+ function r2(e3) {
2755
+ var t3 = e3 && e3.constructor;
2756
+ return e3 === (typeof t3 == `function` && t3.prototype || n2);
2757
+ }
2758
+ t2.exports = r2;
2759
+ });
2760
+ var wa = g((e2, t2) => {
2761
+ function n2(e3, t3) {
2762
+ return function(n3) {
2763
+ return e3(t3(n3));
2764
+ };
2765
+ }
2766
+ t2.exports = n2;
2767
+ });
2768
+ var Ta = g((e2, t2) => {
2769
+ t2.exports = wa()(Object.keys, Object);
2770
+ });
2771
+ var Ea = g((e2, t2) => {
2772
+ var n2 = Ca(), r2 = Ta(), i2 = Object.prototype.hasOwnProperty;
2773
+ function a2(e3) {
2774
+ if (!n2(e3)) return r2(e3);
2775
+ var t3 = [];
2776
+ for (var a3 in Object(e3)) i2.call(e3, a3) && a3 != `constructor` && t3.push(a3);
2777
+ return t3;
2778
+ }
2779
+ t2.exports = a2;
2780
+ });
2781
+ var Da = g((e2, t2) => {
2782
+ var n2 = Ei(), r2 = _a();
2783
+ function i2(e3) {
2784
+ return e3 != null && r2(e3.length) && !n2(e3);
2785
+ }
2786
+ t2.exports = i2;
2787
+ });
2788
+ var Oa = g((e2, t2) => {
2789
+ var n2 = Sa(), r2 = Ea(), i2 = Da();
2790
+ function a2(e3) {
2791
+ return i2(e3) ? n2(e3) : r2(e3);
2792
+ }
2793
+ t2.exports = a2;
2794
+ });
2795
+ var ka = g((e2, t2) => {
2796
+ var n2 = sa(), r2 = ua(), i2 = Oa();
2797
+ function a2(e3) {
2798
+ return n2(e3, i2, r2);
2799
+ }
2800
+ t2.exports = a2;
2801
+ });
2802
+ var Aa = g((e2, t2) => {
2803
+ var n2 = ka(), r2 = 1, i2 = Object.prototype.hasOwnProperty;
2804
+ function a2(e3, t3, a3, o2, s2, c2) {
2805
+ var l2 = a3 & r2, u2 = n2(e3), d2 = u2.length;
2806
+ if (d2 != n2(t3).length && !l2) return false;
2807
+ for (var f2 = d2; f2--; ) {
2808
+ var p2 = u2[f2];
2809
+ if (!(l2 ? p2 in t3 : i2.call(t3, p2))) return false;
2810
+ }
2811
+ var m2 = c2.get(e3), h2 = c2.get(t3);
2812
+ if (m2 && h2) return m2 == t3 && h2 == e3;
2813
+ var g2 = true;
2814
+ c2.set(e3, t3), c2.set(t3, e3);
2815
+ for (var _2 = l2; ++f2 < d2; ) {
2816
+ p2 = u2[f2];
2817
+ var v2 = e3[p2], y2 = t3[p2];
2818
+ if (o2) var b2 = l2 ? o2(y2, v2, p2, t3, e3, c2) : o2(v2, y2, p2, e3, t3, c2);
2819
+ if (!(b2 === void 0 ? v2 === y2 || s2(v2, y2, a3, o2, c2) : b2)) {
2820
+ g2 = false;
2821
+ break;
2822
+ }
2823
+ _2 ||= p2 == `constructor`;
2824
+ }
2825
+ if (g2 && !_2) {
2826
+ var x2 = e3.constructor, S2 = t3.constructor;
2827
+ x2 != S2 && `constructor` in e3 && `constructor` in t3 && !(typeof x2 == `function` && x2 instanceof x2 && typeof S2 == `function` && S2 instanceof S2) && (g2 = false);
2828
+ }
2829
+ return c2.delete(e3), c2.delete(t3), g2;
2830
+ }
2831
+ t2.exports = a2;
2832
+ });
2833
+ var ja = g((e2, t2) => {
2834
+ t2.exports = G()(W(), `DataView`);
2835
+ });
2836
+ var Ma = g((e2, t2) => {
2837
+ t2.exports = G()(W(), `Promise`);
2838
+ });
2839
+ var Na = g((e2, t2) => {
2840
+ t2.exports = G()(W(), `Set`);
2841
+ });
2842
+ var Pa = g((e2, t2) => {
2843
+ t2.exports = G()(W(), `WeakMap`);
2844
+ });
2845
+ var Fa = g((e2, t2) => {
2846
+ var n2 = ja(), r2 = Mi(), i2 = Ma(), a2 = Na(), o2 = Pa(), s2 = oi(), c2 = ki(), l2 = `[object Map]`, u2 = `[object Object]`, d2 = `[object Promise]`, f2 = `[object Set]`, p2 = `[object WeakMap]`, m2 = `[object DataView]`, h2 = c2(n2), g2 = c2(r2), _2 = c2(i2), v2 = c2(a2), y2 = c2(o2), b2 = s2;
2847
+ (n2 && b2(new n2(new ArrayBuffer(1))) != m2 || r2 && b2(new r2()) != l2 || i2 && b2(i2.resolve()) != d2 || a2 && b2(new a2()) != f2 || o2 && b2(new o2()) != p2) && (b2 = function(e3) {
2848
+ var t3 = s2(e3), n3 = t3 == u2 ? e3.constructor : void 0, r3 = n3 ? c2(n3) : ``;
2849
+ if (r3) switch (r3) {
2850
+ case h2:
2851
+ return m2;
2852
+ case g2:
2853
+ return l2;
2854
+ case _2:
2855
+ return d2;
2856
+ case v2:
2857
+ return f2;
2858
+ case y2:
2859
+ return p2;
2860
+ }
2861
+ return t3;
2862
+ }), t2.exports = b2;
2863
+ });
2864
+ var Ia = g((e2, t2) => {
2865
+ var n2 = Yi(), r2 = ta(), i2 = aa(), a2 = Aa(), o2 = Fa(), s2 = K(), c2 = ha(), l2 = xa(), u2 = 1, d2 = `[object Arguments]`, f2 = `[object Array]`, p2 = `[object Object]`, m2 = Object.prototype.hasOwnProperty;
2866
+ function h2(e3, t3, h3, g2, _2, v2) {
2867
+ var y2 = s2(e3), b2 = s2(t3), x2 = y2 ? f2 : o2(e3), S2 = b2 ? f2 : o2(t3);
2868
+ x2 = x2 == d2 ? p2 : x2, S2 = S2 == d2 ? p2 : S2;
2869
+ var C2 = x2 == p2, w2 = S2 == p2, T2 = x2 == S2;
2870
+ if (T2 && c2(e3)) {
2871
+ if (!c2(t3)) return false;
2872
+ y2 = true, C2 = false;
2873
+ }
2874
+ if (T2 && !C2) return v2 ||= new n2(), y2 || l2(e3) ? r2(e3, t3, h3, g2, _2, v2) : i2(e3, t3, x2, h3, g2, _2, v2);
2875
+ if (!(h3 & u2)) {
2876
+ var E2 = C2 && m2.call(e3, `__wrapped__`), D2 = w2 && m2.call(t3, `__wrapped__`);
2877
+ if (E2 || D2) {
2878
+ var O2 = E2 ? e3.value() : e3, k2 = D2 ? t3.value() : t3;
2879
+ return v2 ||= new n2(), _2(O2, k2, h3, g2, v2);
2880
+ }
2881
+ }
2882
+ return T2 ? (v2 ||= new n2(), a2(e3, t3, h3, g2, _2, v2)) : false;
2883
+ }
2884
+ t2.exports = h2;
2885
+ });
2886
+ var La = g((e2, t2) => {
2887
+ var n2 = Ia(), r2 = si();
2888
+ function i2(e3, t3, a2, o2, s2) {
2889
+ return e3 === t3 ? true : e3 == null || t3 == null || !r2(e3) && !r2(t3) ? e3 !== e3 && t3 !== t3 : n2(e3, t3, a2, o2, i2, s2);
2890
+ }
2891
+ t2.exports = i2;
2892
+ });
2893
+ var Ra = g((e2, t2) => {
2894
+ var n2 = Yi(), r2 = La(), i2 = 1, a2 = 2;
2895
+ function o2(e3, t3, o3, s2) {
2896
+ var c2 = o3.length, l2 = c2, u2 = !s2;
2897
+ if (e3 == null) return !l2;
2898
+ for (e3 = Object(e3); c2--; ) {
2899
+ var d2 = o3[c2];
2900
+ if (u2 && d2[2] ? d2[1] !== e3[d2[0]] : !(d2[0] in e3)) return false;
2901
+ }
2902
+ for (; ++c2 < l2; ) {
2903
+ d2 = o3[c2];
2904
+ var f2 = d2[0], p2 = e3[f2], m2 = d2[1];
2905
+ if (u2 && d2[2]) {
2906
+ if (p2 === void 0 && !(f2 in e3)) return false;
2907
+ } else {
2908
+ var h2 = new n2();
2909
+ if (s2) var g2 = s2(p2, m2, f2, e3, t3, h2);
2910
+ if (!(g2 === void 0 ? r2(m2, p2, i2 | a2, s2, h2) : g2)) return false;
2911
+ }
2912
+ }
2913
+ return true;
2914
+ }
2915
+ t2.exports = o2;
2916
+ });
2917
+ var za = g((e2, t2) => {
2918
+ var n2 = Ti();
2919
+ function r2(e3) {
2920
+ return e3 === e3 && !n2(e3);
2921
+ }
2922
+ t2.exports = r2;
2923
+ });
2924
+ var Ba = g((e2, t2) => {
2925
+ var n2 = za(), r2 = Oa();
2926
+ function i2(e3) {
2927
+ for (var t3 = r2(e3), i3 = t3.length; i3--; ) {
2928
+ var a2 = t3[i3], o2 = e3[a2];
2929
+ t3[i3] = [a2, o2, n2(o2)];
2930
+ }
2931
+ return t3;
2932
+ }
2933
+ t2.exports = i2;
2934
+ });
2935
+ var Va = g((e2, t2) => {
2936
+ function n2(e3, t3) {
2937
+ return function(n3) {
2938
+ return n3 != null && n3[e3] === t3 && (t3 !== void 0 || e3 in Object(n3));
2939
+ };
2940
+ }
2941
+ t2.exports = n2;
2942
+ });
2943
+ var Ha = g((e2, t2) => {
2944
+ var n2 = Ra(), r2 = Ba(), i2 = Va();
2945
+ function a2(e3) {
2946
+ var t3 = r2(e3);
2947
+ return t3.length == 1 && t3[0][2] ? i2(t3[0][0], t3[0][1]) : function(r3) {
2948
+ return r3 === e3 || n2(r3, e3, t3);
2949
+ };
2950
+ }
2951
+ t2.exports = a2;
2952
+ });
2953
+ var Ua = g((e2, t2) => {
2954
+ var n2 = K(), r2 = ci(), i2 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a2 = /^\w*$/;
2955
+ function o2(e3, t3) {
2956
+ if (n2(e3)) return false;
2957
+ var o3 = typeof e3;
2958
+ return o3 == `number` || o3 == `symbol` || o3 == `boolean` || e3 == null || r2(e3) ? true : a2.test(e3) || !i2.test(e3) || t3 != null && e3 in Object(t3);
2959
+ }
2960
+ t2.exports = o2;
2961
+ });
2962
+ var Wa = g((e2, t2) => {
2963
+ var n2 = qi(), r2 = `Expected a function`;
2964
+ function i2(e3, t3) {
2965
+ if (typeof e3 != `function` || t3 != null && typeof t3 != `function`) throw TypeError(r2);
2966
+ var a2 = function() {
2967
+ var n3 = arguments, r3 = t3 ? t3.apply(this, n3) : n3[0], i3 = a2.cache;
2968
+ if (i3.has(r3)) return i3.get(r3);
2969
+ var o2 = e3.apply(this, n3);
2970
+ return a2.cache = i3.set(r3, o2) || i3, o2;
2971
+ };
2972
+ return a2.cache = new (i2.Cache || n2)(), a2;
2973
+ }
2974
+ i2.Cache = n2, t2.exports = i2;
2975
+ });
2976
+ var Ga = g((e2, t2) => {
2977
+ var n2 = Wa(), r2 = 500;
2978
+ function i2(e3) {
2979
+ var t3 = n2(e3, function(e4) {
2980
+ return i3.size === r2 && i3.clear(), e4;
2981
+ }), i3 = t3.cache;
2982
+ return t3;
2983
+ }
2984
+ t2.exports = i2;
2985
+ });
2986
+ var Ka = g((e2, t2) => {
2987
+ var n2 = Ga(), r2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i2 = /\\(\\)?/g;
2988
+ t2.exports = n2(function(e3) {
2989
+ var t3 = [];
2990
+ return e3.charCodeAt(0) === 46 && t3.push(``), e3.replace(r2, function(e4, n3, r3, a2) {
2991
+ t3.push(r3 ? a2.replace(i2, `$1`) : n3 || e4);
2992
+ }), t3;
2993
+ });
2994
+ });
2995
+ var qa = g((e2, t2) => {
2996
+ function n2(e3, t3) {
2997
+ for (var n3 = -1, r2 = e3 == null ? 0 : e3.length, i2 = Array(r2); ++n3 < r2; ) i2[n3] = t3(e3[n3], n3, e3);
2998
+ return i2;
2999
+ }
3000
+ t2.exports = n2;
3001
+ });
3002
+ var Ja = g((e2, t2) => {
3003
+ var n2 = ri(), r2 = qa(), i2 = K(), a2 = ci(), o2 = 1 / 0, s2 = n2 ? n2.prototype : void 0, c2 = s2 ? s2.toString : void 0;
3004
+ function l2(e3) {
3005
+ if (typeof e3 == `string`) return e3;
3006
+ if (i2(e3)) return r2(e3, l2) + ``;
3007
+ if (a2(e3)) return c2 ? c2.call(e3) : ``;
3008
+ var t3 = e3 + ``;
3009
+ return t3 == `0` && 1 / e3 == -o2 ? `-0` : t3;
3010
+ }
3011
+ t2.exports = l2;
3012
+ });
3013
+ var Ya = g((e2, t2) => {
3014
+ var n2 = Ja();
3015
+ function r2(e3) {
3016
+ return e3 == null ? `` : n2(e3);
3017
+ }
3018
+ t2.exports = r2;
3019
+ });
3020
+ var Xa = g((e2, t2) => {
3021
+ var n2 = K(), r2 = Ua(), i2 = Ka(), a2 = Ya();
3022
+ function o2(e3, t3) {
3023
+ return n2(e3) ? e3 : r2(e3, t3) ? [e3] : i2(a2(e3));
3024
+ }
3025
+ t2.exports = o2;
3026
+ });
3027
+ var Za = g((e2, t2) => {
3028
+ var n2 = ci(), r2 = 1 / 0;
3029
+ function i2(e3) {
3030
+ if (typeof e3 == `string` || n2(e3)) return e3;
3031
+ var t3 = e3 + ``;
3032
+ return t3 == `0` && 1 / e3 == -r2 ? `-0` : t3;
3033
+ }
3034
+ t2.exports = i2;
3035
+ });
3036
+ var Qa = g((e2, t2) => {
3037
+ var n2 = Xa(), r2 = Za();
3038
+ function i2(e3, t3) {
3039
+ t3 = n2(t3, e3);
3040
+ for (var i3 = 0, a2 = t3.length; e3 != null && i3 < a2; ) e3 = e3[r2(t3[i3++])];
3041
+ return i3 && i3 == a2 ? e3 : void 0;
3042
+ }
3043
+ t2.exports = i2;
3044
+ });
3045
+ var $a = g((e2, t2) => {
3046
+ var n2 = Qa();
3047
+ function r2(e3, t3, r3) {
3048
+ var i2 = e3 == null ? void 0 : n2(e3, t3);
3049
+ return i2 === void 0 ? r3 : i2;
3050
+ }
3051
+ t2.exports = r2;
3052
+ });
3053
+ var eo = g((e2, t2) => {
3054
+ function n2(e3, t3) {
3055
+ return e3 != null && t3 in Object(e3);
3056
+ }
3057
+ t2.exports = n2;
3058
+ });
3059
+ var to = g((e2, t2) => {
3060
+ var n2 = Xa(), r2 = pa(), i2 = K(), a2 = ga(), o2 = _a(), s2 = Za();
3061
+ function c2(e3, t3, c3) {
3062
+ t3 = n2(t3, e3);
3063
+ for (var l2 = -1, u2 = t3.length, d2 = false; ++l2 < u2; ) {
3064
+ var f2 = s2(t3[l2]);
3065
+ if (!(d2 = e3 != null && c3(e3, f2))) break;
3066
+ e3 = e3[f2];
3067
+ }
3068
+ return d2 || ++l2 != u2 ? d2 : (u2 = e3 == null ? 0 : e3.length, !!u2 && o2(u2) && a2(f2, u2) && (i2(e3) || r2(e3)));
3069
+ }
3070
+ t2.exports = c2;
3071
+ });
3072
+ var no = g((e2, t2) => {
3073
+ var n2 = eo(), r2 = to();
3074
+ function i2(e3, t3) {
3075
+ return e3 != null && r2(e3, t3, n2);
3076
+ }
3077
+ t2.exports = i2;
3078
+ });
3079
+ var ro = g((e2, t2) => {
3080
+ var n2 = La(), r2 = $a(), i2 = no(), a2 = Ua(), o2 = za(), s2 = Va(), c2 = Za(), l2 = 1, u2 = 2;
3081
+ function d2(e3, t3) {
3082
+ return a2(e3) && o2(t3) ? s2(c2(e3), t3) : function(a3) {
3083
+ var o3 = r2(a3, e3);
3084
+ return o3 === void 0 && o3 === t3 ? i2(a3, e3) : n2(t3, o3, l2 | u2);
3085
+ };
3086
+ }
3087
+ t2.exports = d2;
3088
+ });
3089
+ var io = g((e2, t2) => {
3090
+ function n2(e3) {
3091
+ return function(t3) {
3092
+ return t3?.[e3];
3093
+ };
3094
+ }
3095
+ t2.exports = n2;
3096
+ });
3097
+ var ao = g((e2, t2) => {
3098
+ var n2 = Qa();
3099
+ function r2(e3) {
3100
+ return function(t3) {
3101
+ return n2(t3, e3);
3102
+ };
3103
+ }
3104
+ t2.exports = r2;
3105
+ });
3106
+ var oo = g((e2, t2) => {
3107
+ var n2 = io(), r2 = ao(), i2 = Ua(), a2 = Za();
3108
+ function o2(e3) {
3109
+ return i2(e3) ? n2(a2(e3)) : r2(e3);
3110
+ }
3111
+ t2.exports = o2;
3112
+ });
3113
+ var so = g((e2, t2) => {
3114
+ var n2 = Ha(), r2 = ro(), i2 = di(), a2 = K(), o2 = oo();
3115
+ function s2(e3) {
3116
+ return typeof e3 == `function` ? e3 : e3 == null ? i2 : typeof e3 == `object` ? a2(e3) ? r2(e3[0], e3[1]) : n2(e3) : o2(e3);
3117
+ }
3118
+ t2.exports = s2;
3119
+ });
3120
+ var co = g((e2, t2) => {
3121
+ var n2 = li(), r2 = ui(), i2 = so();
3122
+ function a2(e3, t3) {
3123
+ return e3 && e3.length ? n2(e3, i2(t3, 2), r2) : void 0;
3124
+ }
3125
+ t2.exports = a2;
3126
+ });
3127
+ var lo = g((e2, t2) => {
3128
+ function n2(e3, t3) {
3129
+ return e3 < t3;
3130
+ }
3131
+ t2.exports = n2;
3132
+ });
3133
+ var uo = g((e2, t2) => {
3134
+ var n2 = li(), r2 = lo(), i2 = di();
3135
+ function a2(e3) {
3136
+ return e3 && e3.length ? n2(e3, i2, r2) : void 0;
3137
+ }
3138
+ t2.exports = a2;
3139
+ });
3140
+ var fo = g((e2, t2) => {
3141
+ var n2 = li(), r2 = so(), i2 = lo();
3142
+ function a2(e3, t3) {
3143
+ return e3 && e3.length ? n2(e3, r2(t3, 2), i2) : void 0;
3144
+ }
3145
+ t2.exports = a2;
3146
+ });
3147
+ var po = v(fi(), 1);
3148
+ var mo = v(co(), 1);
3149
+ var ho = v(uo(), 1);
3150
+ var go = v(fo(), 1);
3151
+ var _o = ({ price: e2 }) => e2.actualPrice;
3152
+ function vo(e2) {
3153
+ return e2.priceAfterDiscount === void 0 ? { currentSellingPrice: e2.actualPrice, priceBeforeDiscount: e2.compareAtPrice, pricePerUnit: e2.pricePerUnit } : { currentSellingPrice: e2.priceAfterDiscount, priceBeforeDiscount: e2.actualPrice, pricePerUnit: e2.pricePerUnit };
3154
+ }
3155
+ function yo(e2, t2) {
3156
+ let n2 = e2.subscriptionPrices.find((e3) => e3.subscriptionId === t2);
3157
+ if (!n2) throw Error(`Missing subscription price for plan ${t2} on variant ${e2.id}`);
3158
+ let r2 = n2.price;
3159
+ return { currentSellingPrice: r2, priceBeforeDiscount: r2 < e2.price.actualPrice ? e2.price.actualPrice : void 0 };
3160
+ }
3161
+ function bo(e2) {
3162
+ let t2 = (0, go.default)(e2, _o), n2 = (0, mo.default)(e2, _o), r2 = e2.map(({ price: e3 }) => vo(e3)), i2 = vo(t2.price), a2 = vo(n2.price), o2 = r2.flatMap(({ priceBeforeDiscount: e3 }) => e3 === void 0 ? [] : [e3]);
3163
+ return { minCurrentSellingPrice: i2.currentSellingPrice, maxCurrentSellingPrice: a2.currentSellingPrice, minPriceBeforeDiscount: (0, ho.default)(o2), maxPriceBeforeDiscount: (0, po.default)(o2), minPricePerUnit: i2.pricePerUnit, maxPricePerUnit: a2.pricePerUnit };
3164
+ }
3165
+ function xo(e2, t2) {
3166
+ return e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: yo(t2, e3.id) }));
3167
+ }
3168
+ function So(e2) {
3169
+ return { productPrice: { currentSellingPrice: void 0 }, subscriptionPlanPrices: e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: { currentSellingPrice: void 0 } })), productPriceRange: { minCurrentSellingPrice: void 0, maxCurrentSellingPrice: void 0 } };
3170
+ }
3171
+ function Co(e2) {
3172
+ if (!e2.minPriceVariant) return So(e2);
3173
+ let t2 = vo(e2.minPriceVariant.price), n2 = e2.minPriceVariant.price.priceAfterDiscount !== void 0;
3174
+ return { productPrice: t2, subscriptionPlanPrices: e2.subscriptionDetails.subscriptions.map((e3) => ({ subscription: e3, price: {} })), productPriceRange: { minCurrentSellingPrice: t2.currentSellingPrice, maxCurrentSellingPrice: n2 ? void 0 : e2.priceRange.maxActualPrice, minPriceBeforeDiscount: t2.priceBeforeDiscount, maxPriceBeforeDiscount: n2 ? e2.priceRange.maxActualPrice : e2.priceRange.maxCompareAtPrice, minPricePerUnit: t2.pricePerUnit } };
3175
+ }
3176
+ function wo(e2, t2, n2) {
3177
+ if (!n2) return Co(e2);
3178
+ let r2 = (0, go.default)(e2.variants, _o), i2 = t2 ?? r2;
3179
+ return i2 ? { productPrice: vo(i2.price), subscriptionPlanPrices: xo(e2, i2), productPriceRange: bo(e2.variants) } : So(e2);
3180
+ }
3181
+ function To(e2, t2) {
3182
+ let n2 = e2.subscriptionPlanPrices.find(({ subscription: e3 }) => e3.id === t2);
3183
+ return n2 ? { currentSellingPrice: n2.price.currentSellingPrice, priceBeforeDiscount: n2.price.priceBeforeDiscount, pricePerUnit: e2.productPrice.pricePerUnit } : e2.productPrice;
3184
+ }
3185
+ function Eo(e2) {
3186
+ return vo(e2.price).currentSellingPrice;
3187
+ }
3188
+ function Do(e2) {
3189
+ return Object.keys(e2).length === 1 && `$and` in e2 && Array.isArray(e2.$and);
3190
+ }
3191
+ function Oo(e2) {
3192
+ return Object.keys(e2).length === 1 && `$or` in e2 && Array.isArray(e2.$or);
3193
+ }
3194
+ function ko(e2) {
3195
+ return Object.keys(e2).length === 1 && `$not` in e2 && typeof e2.$not == `object`;
3196
+ }
3197
+ function q(e2, t2) {
3198
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $and: [...Do(e2) ? e2.$and : [e2], ...Do(t2) ? t2.$and : [t2]] };
3199
+ }
3200
+ function Ao(e2, t2) {
3201
+ return e2 === void 0 || Object.keys(e2).length === 0 ? t2 : t2 === void 0 || Object.keys(t2).length === 0 ? e2 : { $or: [...Oo(e2) ? e2.$or : [e2], ...Oo(t2) ? t2.$or : [t2]] };
3202
+ }
3203
+ function jo(e2) {
3204
+ if (e2 !== void 0 && Object.keys(e2).length !== 0) return ko(e2) ? e2.$not : { $not: e2 };
3205
+ }
3206
+ var Mo = class {
3207
+ _items;
3208
+ _fetchNextPage;
3209
+ _fetchPrevPage;
3210
+ _originQuery;
3211
+ _limit;
3212
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }) {
3213
+ this._items = e2, this._fetchNextPage = n2, this._fetchPrevPage = r2, this._originQuery = t2, this._limit = i2;
3214
+ }
3215
+ get items() {
3216
+ return this._items;
3217
+ }
3218
+ get length() {
3219
+ return this._items.length;
3220
+ }
3221
+ get pageSize() {
3222
+ return this._limit;
3223
+ }
3224
+ get query() {
3225
+ return this._originQuery;
3226
+ }
3227
+ async next() {
3228
+ if (!this.hasNext()) throw Error(`No next page to fetch`);
3229
+ return await this._fetchNextPage();
3230
+ }
3231
+ async prev() {
3232
+ if (!this.hasPrev()) throw Error(`No previous page to fetch`);
3233
+ return await this._fetchPrevPage();
3234
+ }
3235
+ };
3236
+ var No = class extends Mo {
3237
+ _nextCursor;
3238
+ _prevCursor;
3239
+ cursors;
3240
+ constructor({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2, nextCursor: a2, prevCursor: o2 }) {
3241
+ super({ items: e2, originQuery: t2, fetchNextPage: n2, fetchPrevPage: r2, limit: i2 }), this._nextCursor = a2, this._prevCursor = o2, this.cursors = { next: a2, prev: o2 };
3242
+ }
3243
+ hasNext() {
3244
+ return !!this._nextCursor;
3245
+ }
3246
+ hasPrev() {
3247
+ return !!this._prevCursor;
3248
+ }
3249
+ };
3250
+ var Po = class extends Mo {
3251
+ _totalCount;
3252
+ _offset;
3253
+ _tooManyToCount;
3254
+ constructor({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, offset: r2, originQuery: i2, limit: a2, totalCount: o2, tooManyToCount: s2 }) {
3255
+ super({ items: e2, fetchNextPage: t2, fetchPrevPage: n2, originQuery: i2, limit: a2 }), this._totalCount = o2, this._offset = r2, this._tooManyToCount = s2;
3256
+ }
3257
+ get currentPage() {
3258
+ return this._limit === 0 ? void 0 : Math.floor(this._offset / this._limit);
3259
+ }
3260
+ get totalPages() {
3261
+ return this._tooManyToCount || this._limit === 0 ? void 0 : Math.ceil(this._totalCount / this._limit);
3262
+ }
3263
+ get totalCount() {
3264
+ return this._tooManyToCount ? void 0 : this._totalCount;
3265
+ }
3266
+ hasNext() {
3267
+ return this._limit !== 0 && this.currentPage !== void 0 && this.totalPages !== void 0 && this.currentPage < this.totalPages - 1;
3268
+ }
3269
+ hasPrev() {
3270
+ return !!(this._limit !== 0 && this.currentPage && this.currentPage > 0);
3271
+ }
3272
+ };
3273
+ function Fo(e2) {
3274
+ let t2 = (n2) => ({ query: n2, async find() {
3275
+ try {
3276
+ let r2 = e2.requestTransformer(e2.pagingMethod === `CURSOR` && n2.cursorPaging.cursor ? { cursorPaging: n2.cursorPaging } : n2), i2 = await e2.func(r2), { [Ye]: a2, [Xe]: o2 } = e2.responseTransformer(i2);
3277
+ if (e2.pagingMethod === `OFFSET`) {
3278
+ let e3 = n2;
3279
+ return new Po({ 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 });
3280
+ }
3281
+ let s2 = n2.cursorPaging;
3282
+ return new No({ 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 });
3283
+ } catch (t3) {
3284
+ throw e2.errorTransformer(t3);
3285
+ }
3286
+ }, skipTo(e3) {
3287
+ return t2({ ...n2, cursorPaging: { cursor: e3, limit: n2.cursorPaging.limit } });
3288
+ }, eq(r2, i2) {
3289
+ let a2 = i2 === void 0 ? null : i2, o2 = { [J(e2.transformationPaths, r2)]: a2 };
3290
+ return t2({ ...n2, filter: q(n2.filter, o2) });
3291
+ }, ne(r2, i2) {
3292
+ let a2 = i2 === void 0 ? null : i2, o2 = { [J(e2.transformationPaths, r2)]: { $ne: a2 } };
3293
+ return t2({ ...n2, filter: q(n2.filter, o2) });
3294
+ }, ge(r2, i2) {
3295
+ let a2 = { [J(e2.transformationPaths, r2)]: { $gte: i2 } };
3296
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3297
+ }, gt(r2, i2) {
3298
+ let a2 = { [J(e2.transformationPaths, r2)]: { $gt: i2 } };
3299
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3300
+ }, le(r2, i2) {
3301
+ let a2 = { [J(e2.transformationPaths, r2)]: { $lte: i2 } };
3302
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3303
+ }, lt(r2, i2) {
3304
+ let a2 = { [J(e2.transformationPaths, r2)]: { $lt: i2 } };
3305
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3306
+ }, isNotEmpty(e3) {
3307
+ return this.ne(e3, null);
3308
+ }, isEmpty(e3) {
3309
+ return this.eq(e3, null);
3310
+ }, startsWith(r2, i2) {
3311
+ let a2 = { [J(e2.transformationPaths, r2)]: { $startsWith: i2 } };
3312
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3313
+ }, endsWith(r2, i2) {
3314
+ let a2 = { [J(e2.transformationPaths, r2)]: { $endsWith: i2 } };
3315
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3316
+ }, contains(r2, i2) {
3317
+ let a2 = { [J(e2.transformationPaths, r2)]: { $contains: i2 } };
3318
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3319
+ }, hasSome(r2, ...i2) {
3320
+ let a2 = { [J(e2.transformationPaths, r2)]: { $hasSome: Array.isArray(i2[0]) ? i2[0] : i2 } };
3321
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3322
+ }, hasAll(r2, ...i2) {
3323
+ let a2 = { [J(e2.transformationPaths, r2)]: { $hasAll: Array.isArray(i2[0]) ? i2[0] : i2 } };
3324
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3325
+ }, between(e3, t3, n3) {
3326
+ return this.ge(e3, t3).lt(e3, n3);
3327
+ }, in(r2, i2) {
3328
+ let a2 = { [J(e2.transformationPaths, r2)]: { $in: i2 } };
3329
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3330
+ }, exists(r2, i2 = true) {
3331
+ let a2 = { [J(e2.transformationPaths, r2)]: { $exists: i2 } };
3332
+ return t2({ ...n2, filter: q(n2.filter, a2) });
3333
+ }, or(e3) {
3334
+ return t2({ ...n2, filter: Ao(n2.filter, e3.query.filter) });
3335
+ }, and(e3) {
3336
+ return t2({ ...n2, filter: q(n2.filter, e3.query.filter) });
3337
+ }, not(e3) {
3338
+ return t2({ ...n2, filter: jo(e3.query.filter) });
3339
+ }, ascending(...r2) {
3340
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: J(e2.transformationPaths, t3), order: `ASC` }))] });
3341
+ }, descending(...r2) {
3342
+ return t2({ ...n2, sort: [...n2.sort ?? [], ...r2.map((t3) => ({ fieldName: J(e2.transformationPaths, t3), order: `DESC` }))] });
3343
+ }, skip(e3) {
3344
+ return t2({ ...n2, paging: { offset: e3, limit: `limit` in n2.paging ? n2.paging.limit : 50 } });
3345
+ }, limit(r2) {
3346
+ if (e2.pagingMethod === `CURSOR`) {
3347
+ let e3 = n2;
3348
+ return t2({ ...n2, cursorPaging: { limit: r2, cursor: `cursor` in e3.cursorPaging ? e3.cursorPaging.cursor : void 0 } });
3349
+ }
3350
+ let i2 = n2;
3351
+ return t2({ ...n2, paging: { limit: r2, offset: `offset` in i2.paging ? i2.paging.offset : 0 } });
3352
+ } });
3353
+ return t2({ filter: {}, ...e2.pagingMethod === `OFFSET` ? { paging: { offset: 0, limit: 50 } } : { cursorPaging: { limit: 50 } } });
3354
+ }
3355
+ function J(e2, t2) {
3356
+ let n2 = Object.entries(e2).find(([e3]) => e3 === t2 || t2.startsWith(`${e3}.`))?.[0];
3357
+ return n2 ? t2.replace(n2, e2[n2]) : Qe(t2, { ...e2, ...Ze });
3358
+ }
3359
+ function Io(e2, t2, n2 = {}) {
3360
+ let r2 = (r3, i3) => Io(e2, t2, { ...n2, [r3]: i3 }), i2 = () => Object.keys(n2).length === 0 ? {} : { [$e(e2, t2)]: n2 };
3361
+ return { get filter() {
3362
+ return i2();
3363
+ }, 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) };
3364
+ }
3365
+ function Lo(e2) {
3366
+ return Object.assign((t2) => Io(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 } }) });
3367
+ }
3368
+ function Ro(e2) {
3369
+ return (t2) => ({ asc: () => ({ sort: { fieldName: $e(t2, e2), order: `ASC` } }), desc: () => ({ sort: { fieldName: $e(t2, e2), order: `DESC` } }) });
3370
+ }
3371
+ function zo(e2) {
3372
+ return () => {
3373
+ let t2 = {}, n2 = { withFilter(e3) {
3374
+ return t2 = { ...t2, filter: e3.filter }, n2;
3375
+ }, withFields(...r2) {
3376
+ return t2 = { ...t2, fields: r2.map((t3) => $e(t3, e2)) }, n2;
3377
+ }, withSorting(...e3) {
3378
+ return t2 = { ...t2, sort: e3.map((e4) => e4.sort) }, n2;
3379
+ }, withPaging(e3) {
3380
+ return t2 = { ...t2, paging: e3 }, n2;
3381
+ }, build() {
3382
+ return t2;
3383
+ } };
3384
+ return n2;
3385
+ };
3386
+ }
3387
+ function Bo(e2) {
3388
+ return { QueryBuilder: zo(e2), Filter: Lo(e2), Sort: Ro(e2) };
3389
+ }
3390
+ var Vo = `filter`;
3391
+ var Ho = `sort`;
3392
+ var Uo = `cursorPaging`;
3393
+ var Wo = `paging`;
3394
+ var Go = [Vo, Ho, Uo];
3395
+ var Ko = [Vo, Ho, Wo];
3396
+ function qo(e2, t2) {
3397
+ return !e2 || typeof e2 != `object` ? false : t2.some((t3) => e2.hasOwnProperty(t3));
3398
+ }
3399
+ function Jo(e2) {
3400
+ return qo(e2, Go);
3401
+ }
3402
+ function Yo(e2) {
3403
+ return qo(e2, Ko);
3404
+ }
3405
+ function Xo(e2) {
3406
+ let { hasOptionsParameter: t2 } = e2;
3407
+ return function(...n2) {
3408
+ return t2 ? Qo(n2, e2) : Zo(n2, e2);
3409
+ };
3410
+ }
3411
+ function Zo(e2, t2) {
3412
+ return e2.length === 0 ? t2.builderQueryFunction() : t2.typedQueryFunction(e2[0]);
3413
+ }
3414
+ function Qo(e2, t2) {
3415
+ switch (e2.length) {
3416
+ case 0:
3417
+ return t2.builderQueryFunction();
3418
+ case 1:
3419
+ return Jo(e2[0]) || Yo(e2[0]) ? t2.typedQueryFunction(e2[0]) : t2.builderQueryFunction(e2[0]);
3420
+ default:
3421
+ return t2.typedQueryFunction(e2[0], e2[1]);
3422
+ }
3423
+ }
3424
+ function $o(e2) {
3425
+ if (!e2) return;
3426
+ let t2 = _t(e2, `image`), { protocol: n2, hash: r2, pathname: i2 } = new URL(t2), a2 = new URLSearchParams(r2.replace(`#`, ``)), o2 = a2.get(`originHeight`), s2 = a2.get(`originWidth`), [c2, l2] = i2.replace(`image://v1/`, ``).split(`/`), u2 = decodeURIComponent(l2);
3427
+ if (n2 === `wix:`) {
3428
+ let t3 = { id: c2, height: Number(o2), width: Number(s2) };
3429
+ return u2 ? { ...t3, altText: u2, filename: u2, url: e2 } : t3;
3430
+ }
3431
+ return { url: e2 };
3432
+ }
3433
+ function Y(e2) {
3434
+ if (!e2) return;
3435
+ let t2 = ``;
3436
+ 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;
3437
+ }
3438
+ function es(e2) {
3439
+ let t2 = {}, n2 = { get search() {
3440
+ return t2;
3441
+ }, expression(e3) {
3442
+ return t2 = { ...t2, expression: e3 }, n2;
3443
+ }, mode(e3) {
3444
+ return t2 = { ...t2, mode: e3 }, n2;
3445
+ }, fields(r2) {
3446
+ return t2 = { ...t2, fields: r2.map((t3) => $e(t3, e2)) }, n2;
3447
+ }, fuzzy(e3 = true) {
3448
+ return t2 = { ...t2, fuzzy: e3 }, n2;
3449
+ } };
3450
+ return n2;
3451
+ }
3452
+ function ts(e2) {
3453
+ return (t2) => {
3454
+ let n2 = es(e2);
3455
+ return t2 === void 0 ? n2 : n2.expression(t2);
3456
+ };
3457
+ }
3458
+ function ns(e2) {
3459
+ let t2 = { ...e2, type: `VALUE`, value: { ...e2.value } }, n2 = { get aggregation() {
3460
+ return t2;
3461
+ }, sortBy(e3, r2) {
3462
+ return t2 = { ...t2, value: { ...t2.value, sortType: e3, sortDirection: r2 } }, n2;
3463
+ }, limit(e3) {
3464
+ return t2 = { ...t2, value: { ...t2.value, limit: e3 } }, n2;
3465
+ }, excludeMissingValues() {
3466
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `EXCLUDE` } }, n2;
3467
+ }, includeMissingValues() {
3468
+ return t2 = { ...t2, value: { ...t2.value, missingValues: `INCLUDE` } }, n2;
3469
+ }, includeValues(e3) {
3470
+ return t2 = { ...t2, value: { ...t2.value, includeOptions: { addToBucket: e3 } } }, n2;
3471
+ } };
3472
+ return n2;
3473
+ }
3474
+ function rs(e2) {
3475
+ let t2 = { ...e2, type: `RANGE`, range: { buckets: [] } }, n2 = { get aggregation() {
3476
+ return t2;
3477
+ }, withBuckets(...e3) {
3478
+ return t2 = { ...t2, range: { buckets: e3 } }, n2;
3479
+ } };
3480
+ return n2;
3481
+ }
3482
+ function is(e2) {
3483
+ let t2 = { ...e2, type: `DATE_HISTOGRAM`, dateHistogram: {} }, n2 = { get aggregation() {
3484
+ return t2;
3485
+ }, interval(e3) {
3486
+ return t2 = { ...t2, dateHistogram: { interval: e3 } }, n2;
3487
+ } };
3488
+ return n2;
3489
+ }
3490
+ function as(e2) {
3491
+ let t2 = { ...e2, type: `SCALAR`, scalar: {} }, n2 = { get aggregation() {
3492
+ return t2;
3493
+ }, type(e3) {
3494
+ return t2 = { ...t2, scalar: { type: e3 } }, n2;
3495
+ } };
3496
+ return n2;
3497
+ }
3498
+ function os(e2) {
3499
+ let t2 = { ...e2, type: `NESTED`, nested: { nestedAggregations: [] } }, n2 = { get aggregation() {
3500
+ return t2;
3501
+ }, addNestedAggregation(e3) {
3502
+ let r2 = e3.aggregation, i2 = [...t2.nested?.nestedAggregations ?? [], r2];
3503
+ return t2 = { ...t2, nested: { nestedAggregations: i2 } }, n2;
3504
+ } };
3505
+ return n2;
3506
+ }
3507
+ function ss(e2, t2) {
3508
+ let n2 = { name: e2 }, r2 = { get aggregation() {
3509
+ return n2;
3510
+ }, ofType(e3) {
3511
+ return n2 = { ...n2, type: e3 }, r2;
3512
+ }, onField(e3) {
3513
+ return n2 = { ...n2, fieldPath: $e(e3, t2) }, r2;
3514
+ }, asValueAggregation() {
3515
+ return ns(n2);
3516
+ }, asRangeAggregation() {
3517
+ return rs(n2);
3518
+ }, asDateHistogramAggregation() {
3519
+ return is(n2);
3520
+ }, asScalarAggregation() {
3521
+ return as(n2);
3522
+ }, asNestedAggregation() {
3523
+ return os(n2);
3524
+ } };
3525
+ return r2;
3526
+ }
3527
+ function cs(e2) {
3528
+ return (t2) => ss(t2, e2);
3529
+ }
3530
+ function ls() {
3531
+ return () => {
3532
+ let e2 = {}, t2 = { withFilter(n2) {
3533
+ return e2 = { ...e2, filter: n2.filter }, t2;
3534
+ }, withSearchClause(n2) {
3535
+ return e2 = { ...e2, search: n2.search }, t2;
3536
+ }, withSorting(...n2) {
3537
+ return e2 = { ...e2, sort: n2.map((e3) => e3.sort) }, t2;
3538
+ }, withAggregation(...n2) {
3539
+ return e2 = { ...e2, aggregations: n2.map((e3) => e3.aggregation) }, t2;
3540
+ }, withPaging(n2) {
3541
+ return e2 = { ...e2, paging: n2 }, t2;
3542
+ }, withTimeZone(n2) {
3543
+ return e2 = { ...e2, timeZone: n2 }, t2;
3544
+ }, build() {
3545
+ return e2;
3546
+ } };
3547
+ return t2;
3548
+ };
3549
+ }
3550
+ function us(e2) {
3551
+ return { SearchBuilder: ls(), Filter: Lo(e2), Sort: Ro(e2), SearchParams: ts(e2), Aggregation: cs(e2) };
3552
+ }
3553
+ function ds(e2) {
3554
+ return Vt(Object.assign(e2, { domainToMappings: { "bo._base_domain_": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "wixbo.ai": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "wix-bo.com": [{ srcPath: `/back-in-stock-service`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/back-in-stock-service`, destPath: `` }], _: [{ srcPath: `/v1/back-in-stock-notification-requests`, destPath: `/v1/back-in-stock-notification-requests` }], "*.dev.wix-code.com": [{ srcPath: `/v1/back-in-stock-notification-requests`, destPath: `/v1/back-in-stock-notification-requests` }] } }));
3555
+ }
3556
+ var fs = `@wix/auto_sdk_ecom_back-in-stock-notifications`;
3557
+ function ps(e2) {
3558
+ function t2({ host: t3 }) {
3559
+ let n2 = P(e2, [{ transformFn: it, paths: [{ path: `request.createdDate` }, { path: `itemDetails.image.urlExpirationDate` }] }, { transformFn: mn, paths: [{ path: `itemDetails.image.focalPoint.x` }, { path: `itemDetails.image.focalPoint.y` }] }]);
3560
+ return { entityFqdn: `wix.ecom.v1.back_in_stock_notification_request`, method: `POST`, methodFqn: `com.wixpress.ecom.back.in.stock.BackInStockNotificationRequestService.CreateBackInStockNotificationRequest`, packageName: fs, migrationOptions: { optInTransformResponse: true }, url: ds({ protoPath: `/v1/back-in-stock-notification-requests`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `request.createdDate` }] }]) };
3561
+ }
3562
+ return t2;
3563
+ }
3564
+ async function ms(e2, t2) {
3565
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = ps(P(j({ request: e2, itemDetails: t2 }), [{ transformFn: $o, paths: [{ path: `itemDetails.image` }] }]));
3566
+ r2?.onSiteCall?.();
3567
+ try {
3568
+ let e3 = await n2.request(i2);
3569
+ return r2?.onSuccess?.(e3), M(e3.data)?.request;
3570
+ } catch (e3) {
3571
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { request: `$[0]`, itemDetails: `$[1]` }, singleArgumentUnchanged: false }, [`request`, `itemDetails`]);
3572
+ throw r2?.onError?.(e3), t3;
3573
+ }
3574
+ }
3575
+ ({ ...Bo() });
3576
+ function hs(e2) {
3577
+ return (t2, n2) => ms(t2, n2, { httpClient: e2 });
3578
+ }
3579
+ var gs = b(`wix.ecom.v1.back_in_stock_notification_request_created`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `metadata.eventTime` }] }])))();
3580
+ var _s = b(`wix.ecom.v1.back_in_stock_notification_request_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `undefined.createdDate` }, { path: `metadata.eventTime` }] }])))();
3581
+ var vs = b(`wix.ecom.v1.back_in_stock_notification_request_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `metadata.eventTime` }] }])))();
3582
+ var ys = zt(hs);
3583
+ I(gs), I(_s), I(vs);
3584
+ function bs(e2) {
3585
+ if (!e2) return;
3586
+ let { pathname: t2 } = new URL(e2);
3587
+ return { relativePath: t2, url: e2 };
3588
+ }
3589
+ function X(e2) {
3590
+ if (e2) return e2.url;
3591
+ }
3592
+ function xs(e2) {
3593
+ return Vt(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/cart-v2`, destPath: `` }], _: [{ srcPath: `/_api/cart-v2`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "bo._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wixbo.ai": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wix-bo.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/ecom/v2/carts`, destPath: `/v2/carts` }], "editor.wixapps.net": [{ srcPath: `/_api/cart-v2`, destPath: `` }] } }));
3594
+ }
3595
+ var Ss = `@wix/auto_sdk_ecom_cart-v-2`;
3596
+ function Cs(e2) {
3597
+ function t2({ host: t3 }) {
3598
+ let n2 = P(e2, [{ transformFn: it, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }, { path: `catalogItems.catalogOverrideFields.image.urlExpirationDate` }, { path: `customItems.attributes.image.urlExpirationDate` }, { path: `customItems.attributes.serviceProperties.scheduledDate` }, { path: `customItems.attributes.serviceProperties.endDate` }, { path: `customItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }] }, { transformFn: mn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }, { path: `catalogItems.catalogOverrideFields.physicalProperties.weight` }, { path: `customItems.attributes.physicalProperties.weight` }] }]);
3599
+ return { entityFqdn: `wix.ecom.v2.cart`, method: `POST`, methodFqn: `wix.ecom.cart.v2.CartService.CreateCart`, packageName: Ss, migrationOptions: { optInTransformResponse: true }, url: xs({ protoPath: `/v2/carts`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }] }, { transformFn: hn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }] }]) };
3600
+ }
3601
+ return t2;
3602
+ }
3603
+ var ws = ((e2) => (e2.UNSPECIFIED = `UNSPECIFIED`, e2.WEB = `WEB`, e2.POS = `POS`, e2.EBAY = `EBAY`, e2.AMAZON = `AMAZON`, e2.OTHER_PLATFORM = `OTHER_PLATFORM`, e2.WIX_APP_STORE = `WIX_APP_STORE`, e2.WIX_INVOICES = `WIX_INVOICES`, e2.BACKOFFICE_MERCHANT = `BACKOFFICE_MERCHANT`, e2.WISH = `WISH`, e2.CLASS_PASS = `CLASS_PASS`, e2.GLOBAL_E = `GLOBAL_E`, e2.FACEBOOK = `FACEBOOK`, e2.ETSY = `ETSY`, e2.TIKTOK = `TIKTOK`, e2.FAIRE_COM = `FAIRE_COM`, e2.PAYPAL_AGENTIC_CHECKOUT = `PAYPAL_AGENTIC_CHECKOUT`, e2.STRIPE_AGENTIC_CHECKOUT = `STRIPE_AGENTIC_CHECKOUT`, e2.WIX_INVOICES_PLATFORM = `WIX_INVOICES_PLATFORM`, e2.UCP_AGENTIC_CHECKOUT = `UCP_AGENTIC_CHECKOUT`, e2))(ws || {});
3604
+ async function Ts(e2) {
3605
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Cs(P(j({ cart: e2?.cart, catalogItems: e2?.catalogItems, customItems: e2?.customItems, coupons: e2?.coupons, deliveryMethod: e2?.deliveryMethod, giftCards: e2?.giftCards }), [{ transformFn: $o, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }, { path: `catalogItems.catalogOverrideFields.image` }, { path: `customItems.attributes.image` }] }, { transformFn: bs, paths: [{ path: `cart.lineItems.attributes.url` }, { path: `customItems.attributes.url` }] }, { transformFn: gn, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]));
3606
+ n2?.onSiteCall?.();
3607
+ try {
3608
+ let e3 = await t2.request(r2);
3609
+ return n2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: Y, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }] }, { transformFn: X, paths: [{ path: `cart.lineItems.attributes.url` }] }, { transformFn: _n, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]))?.cart;
3610
+ } catch (e3) {
3611
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { cart: `$[0].cart`, catalogItems: `$[0].catalogItems`, customItems: `$[0].customItems`, coupons: `$[0].coupons`, deliveryMethod: `$[0].deliveryMethod`, giftCards: `$[0].giftCards` }, singleArgumentUnchanged: false }, [`options`]);
3612
+ throw n2?.onError?.(e3), t3;
3613
+ }
3614
+ }
3615
+ function Es(e2) {
3616
+ return (t2) => Ts(t2, { httpClient: e2 });
3617
+ }
3618
+ var Ds = zt(Es);
3619
+ function Os(e2) {
3620
+ return Vt(Object.assign(e2, { domainToMappings: { "api._api_base_domain_": [{ srcPath: `/cart-v2`, destPath: `` }], _: [{ srcPath: `/_api/cart-v2`, destPath: `` }], "*.dev.wix-code.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "apps._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "manage._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "bo._base_domain_": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wixbo.ai": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "wix-bo.com": [{ srcPath: `/_api/cart-v2`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/ecom/v2/carts`, destPath: `/v2/carts` }], "editor.wixapps.net": [{ srcPath: `/_api/cart-v2`, destPath: `` }] } }));
3621
+ }
3622
+ var ks = `@wix/auto_sdk_ecom_current-cart-v-2`;
3623
+ function As(e2) {
3624
+ function t2({ host: t3 }) {
3625
+ let n2 = P(e2, [{ transformFn: mn, paths: [{ path: `catalogItems.catalogOverrideFields.physicalProperties.weight` }, { path: `customItems.attributes.physicalProperties.weight` }] }, { transformFn: it, paths: [{ path: `catalogItems.catalogOverrideFields.image.urlExpirationDate` }, { path: `customItems.attributes.image.urlExpirationDate` }, { path: `customItems.attributes.serviceProperties.scheduledDate` }, { path: `customItems.attributes.serviceProperties.endDate` }, { path: `customItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }] }]);
3626
+ return { entityFqdn: `wix.ecom.v2.cart`, method: `POST`, methodFqn: `wix.ecom.cart.v2.CurrentCartService.AddLineItemsToCurrentCart`, packageName: ks, migrationOptions: { optInTransformResponse: true }, url: Os({ protoPath: `/v2/carts/current/add-line-items`, data: n2, host: t3 }), data: n2, transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `cart.createdDate` }, { path: `cart.updatedDate` }, { path: `cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.image.urlExpirationDate` }, { path: `cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate` }, { path: `cart.lineItems.attributes.serviceProperties.scheduledDate` }, { path: `cart.lineItems.attributes.serviceProperties.endDate` }] }, { transformFn: hn, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.physicalProperties.weight` }, { path: `cart.lineItems.attributes.physicalProperties.weight` }, { path: `cart.deliveryInfo.address.geocode.latitude` }, { path: `cart.deliveryInfo.address.geocode.longitude` }, { path: `cart.paymentInfo.billingAddress.geocode.latitude` }, { path: `cart.paymentInfo.billingAddress.geocode.longitude` }, { path: `cart.legacyFields.discounts.merchantDiscount.percentage` }, { path: `cart.tcAppliedDiscounts.merchantDiscount.percentage` }] }]) };
3627
+ }
3628
+ return t2;
3629
+ }
3630
+ async function js(e2) {
3631
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = As(P(j({ catalogItems: e2?.catalogItems, customItems: e2?.customItems }), [{ transformFn: $o, paths: [{ path: `catalogItems.catalogOverrideFields.image` }, { path: `customItems.attributes.image` }] }, { transformFn: bs, paths: [{ path: `customItems.attributes.url` }] }]));
3632
+ n2?.onSiteCall?.();
3633
+ try {
3634
+ let e3 = await t2.request(r2);
3635
+ return n2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: Y, paths: [{ path: `cart.lineItems.source.catalogOverrideFields.image` }, { path: `cart.lineItems.attributes.image` }] }, { transformFn: X, paths: [{ path: `cart.lineItems.attributes.url` }] }, { transformFn: _n, paths: [{ path: `cart.deliveryInfo.address` }, { path: `cart.paymentInfo.billingAddress` }] }]));
3636
+ } catch (e3) {
3637
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { catalogItems: `$[0].catalogItems`, customItems: `$[0].customItems` }, singleArgumentUnchanged: false }, [`options`]);
3638
+ throw n2?.onError?.(e3), t3;
3639
+ }
3640
+ }
3641
+ function Ms(e2) {
3642
+ return (t2) => js(t2, { httpClient: e2 });
3643
+ }
3644
+ var Ns = zt(Ms);
3645
+ var Ps = `BACK_IN_STOCK_NOTIFICATION_REQUEST_ALREADY_EXISTS`;
3646
+ function Fs(e2) {
3647
+ return e2?.details?.applicationError?.code ?? `UNKNOWN`;
3648
+ }
3649
+ function Is(e2) {
3650
+ return { code: Fs(e2), message: e2?.message };
3651
+ }
3652
+ async function Ls(e2) {
3653
+ let { productId: t2, variantId: n2, email: r2, name: i2, price: a2, imageUrl: o2 } = e2;
3654
+ try {
3655
+ return await ys({ catalogReference: { catalogItemId: t2, appId: $r, ...n2 ? { options: { variantId: n2 } } : {} }, email: r2 }, { name: i2, price: String(a2), ...o2 ? { image: o2 } : {} }), `created`;
3656
+ } catch (e3) {
3657
+ if (Fs(e3) === Ps) return `already-subscribed`;
3658
+ throw Is(e3);
3659
+ }
3660
+ }
3661
+ var Rs = `https://static.wixstatic.com/media`;
3662
+ var zs = /image:\/\/v1\/([^/#]+)/;
3663
+ function Bs(e2) {
3664
+ return e2 ? e2.match(zs)?.[1] ?? null : null;
3665
+ }
3666
+ function Vs(e2) {
3667
+ if (!e2) return;
3668
+ if (/^https?:\/\//i.test(e2)) return e2;
3669
+ let t2 = Bs(e2);
3670
+ return t2 ? `${Rs}/${t2}` : void 0;
3671
+ }
3672
+ var Hs = (e2) => e2.media.type === `image`;
3673
+ function Us(e2, t2) {
3674
+ let n2 = t2.choices[e2.id];
3675
+ return e2.choices.find((e3) => e3.choiceId === n2);
3676
+ }
3677
+ function Ws(e2, t2) {
3678
+ let n2 = e2.options.map((e3) => Us(e3, t2)?.mediaIds).filter((e3) => !!(e3 && e3.length > 0));
3679
+ if (n2.length === 0) return;
3680
+ let r2 = n2.reduce((e3, t3) => e3.filter((e4) => t3.includes(e4))), i2 = r2.length > 0 ? r2 : n2.flat(), a2 = /* @__PURE__ */ new Map();
3681
+ for (let t3 of e2.media ?? []) Hs(t3) && a2.set(t3.id, t3);
3682
+ for (let e3 of i2) {
3683
+ let t3 = a2.get(e3)?.media.src;
3684
+ if (t3) return t3;
3685
+ }
3686
+ }
3687
+ function Gs(e2, t2) {
3688
+ let n2 = [t2 ? Ws(e2, t2) : void 0, e2.media?.find(Hs)?.media.src];
3689
+ for (let e3 of n2) {
3690
+ let t3 = Vs(e3);
3691
+ if (t3) return t3;
3692
+ }
3693
+ }
3694
+ function Ks(e2, r2) {
3695
+ let i2 = t((t2) => r2 ? Ls({ productId: e2.id, variantId: r2.id, email: t2, name: e2.name ?? ``, price: Eo(r2), imageUrl: Gs(e2, r2) }) : Promise.reject(Error(`Cannot create a back-in-stock notification without a selected variant`)), [e2, r2]);
3696
+ return n(() => ({ handleNotifyMe: i2 }), [i2]);
3697
+ }
3698
+ function qs(e2, t2) {
3699
+ return n(() => ({ id: e2.id, name: e2.name, description: e2.description, ribbons: e2.ribbons, breadcrumbs: e2.breadcrumbs, mainCategoryId: e2.mainCategoryId, categories: e2.categories, infoSections: e2.infoSections, sku: t2?.sku, discountRules: e2.discountRuleNames?.map((e3) => ({ name: e3 })) }), [e2, t2]);
3700
+ }
3701
+ function Js(e2) {
3702
+ if (!e2) return;
3703
+ let t2 = ``;
3704
+ e2?.filename && (t2 = `/${encodeURIComponent(e2.filename)}`);
3705
+ let n2 = ``;
3706
+ if (e2.posters?.length) {
3707
+ let [t3, r2] = e2.posters, i2 = r2 || t3, a2 = i2.id || ``;
3708
+ if (!a2 && i2.url) {
3709
+ let e3 = i2.url.lastIndexOf(`/`);
3710
+ e3 !== -1 && (a2 = i2.url.substring(e3 + 1));
3711
+ }
3712
+ a2 && (n2 = `#posterUri=${a2}&posterWidth=${i2.width}&posterHeight=${i2.height}`);
3713
+ }
3714
+ return e2.id ? `wix:video://v1/${e2.id}${t2}${n2}` : e2.url;
3715
+ }
3716
+ function Ys(e2) {
3717
+ return Vt(Object.assign(e2, { domainToMappings: { "manage._base_domain_": [{ srcPath: `/inventory`, destPath: `` }], "api._api_base_domain_": [{ srcPath: `/inventory`, destPath: `` }], _: [{ srcPath: `/_api/inventory`, destPath: `` }], "editor._base_domain_": [{ srcPath: `/_api/inventory`, destPath: `` }], "blocks._base_domain_": [{ srcPath: `/_api/inventory`, destPath: `` }], "create.editorx": [{ srcPath: `/_api/inventory`, destPath: `` }], "www.wixapis.com": [{ srcPath: `/stores/v3/inventory-items`, destPath: `/v3/inventory-items` }, { srcPath: `/stores/v3/bulk/inventory-items`, destPath: `/v3/bulk/inventory-items` }], "*.dev.wix-code.com": [{ srcPath: `/_api/inventory`, destPath: `` }], "editor.wixapps.net": [{ srcPath: `/_api/inventory`, destPath: `` }] } }));
3718
+ }
3719
+ var Xs = `@wix/auto_sdk_stores_inventory-items-v-3`;
3720
+ function Zs(e2) {
3721
+ function t2({ host: t3 }) {
3722
+ return { entityFqdn: `wix.stores.catalog.v3.inventory_item`, method: `GET`, methodFqn: `com.wix.stores.catalog.inventory.api.v3.InventoryService.QueryInventoryItems`, packageName: Xs, migrationOptions: { optInTransformResponse: true }, url: Ys({ protoPath: `/v3/inventory-items/query`, data: e2, host: t3 }), params: Bt(e2, true), transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `inventoryItems.createdDate` }, { path: `inventoryItems.updatedDate` }] }]), fallback: [{ method: `POST`, url: Ys({ protoPath: `/v3/inventory-items/query`, data: e2, host: t3 }), data: e2 }] };
3723
+ }
3724
+ return t2;
3725
+ }
3726
+ var Z = ((e2) => (e2.OUT_OF_STOCK = `OUT_OF_STOCK`, e2.IN_STOCK = `IN_STOCK`, e2.PREORDER = `PREORDER`, e2))(Z || {});
3727
+ function Qs() {
3728
+ let { httpClient: e2, sideEffects: t2 } = arguments[0];
3729
+ return Fo({ func: async (n2) => {
3730
+ let r2 = Zs(n2);
3731
+ t2?.onSiteCall?.();
3732
+ try {
3733
+ let n3 = await e2.request(r2);
3734
+ return t2?.onSuccess?.(n3), n3;
3735
+ } catch (e3) {
3736
+ throw t2?.onError?.(e3), e3;
3737
+ }
3738
+ }, requestTransformer: (e3) => {
3739
+ let t3 = [e3, {}];
3740
+ return j({ ...t3?.[1], query: t3?.[0] });
3741
+ }, responseTransformer: ({ data: e3 }) => {
3742
+ let t3 = M(P(e3, []));
3743
+ return { items: t3?.inventoryItems, pagingMetadata: t3?.pagingMetadata };
3744
+ }, errorTransformer: (e3) => {
3745
+ throw F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false });
3746
+ }, pagingMethod: `CURSOR`, transformationPaths: {} });
3747
+ }
3748
+ async function $s(e2) {
3749
+ let { httpClient: t2, sideEffects: n2 } = arguments[1], r2 = Zs(j({ query: e2 }));
3750
+ n2?.onSiteCall?.();
3751
+ try {
3752
+ let e3 = await t2.request(r2);
3753
+ return n2?.onSuccess?.(e3), M(e3.data);
3754
+ } catch (e3) {
3755
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { query: `$[0]` }, singleArgumentUnchanged: false }, [`query`]);
3756
+ throw n2?.onError?.(e3), t3;
3757
+ }
3758
+ }
3759
+ ({ ...Bo() }, { ...us() });
3760
+ function ec(e2) {
3761
+ return () => Qs({ httpClient: e2 });
3762
+ }
3763
+ function tc(e2) {
3764
+ return (t2) => $s(t2, { httpClient: e2 });
3765
+ }
3766
+ var nc = b(`wix.stores.catalog.v3.inventory_item_created`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3767
+ var rc = b(`wix.stores.catalog.v3.inventory_item_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3768
+ var ic = b(`wix.stores.catalog.v3.inventory_item_stock_status_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `metadata.eventTime` }] }])))();
3769
+ var ac = b(`wix.stores.catalog.v3.inventory_item_updated`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `entity.createdDate` }, { path: `entity.updatedDate` }, { path: `metadata.eventTime` }, { path: `modifiedFields.createdDate` }, { path: `modifiedFields.updatedDate` }] }])))();
3770
+ var oc = b(`wix.stores.catalog.v3.inventory_item_updated_with_reason`, true, (e2) => M(P(e2, [{ transformFn: N, paths: [{ path: `data.currentEntity.createdDate` }, { path: `data.currentEntity.updatedDate` }, { path: `metadata.eventTime` }] }])))();
3771
+ function sc(e2) {
3772
+ let t2 = Xo({ builderQueryFunction: () => ec(e2)(), typedQueryFunction: (t3) => tc(e2)(t3), hasOptionsParameter: false });
3773
+ function n2(e3) {
3774
+ return t2(...arguments);
3775
+ }
3776
+ return n2;
3777
+ }
3778
+ var cc = zt(sc);
3779
+ I(nc), I(rc), I(ic), I(ac), I(oc);
3780
+ function lc(e2) {
3781
+ return Vt(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: `` }] } }));
3782
+ }
3783
+ var uc = `@wix/auto_sdk_stores_products-v-3`;
3784
+ function dc(e2) {
3785
+ function t2({ host: t3 }) {
3786
+ return { entityFqdn: `wix.stores.catalog.v3.product`, method: `GET`, methodFqn: `wix.stores.catalog.v3.CatalogApi.GetProduct`, packageName: uc, migrationOptions: { optInTransformResponse: true }, url: lc({ protoPath: `/v3/products/{productId}`, data: e2, host: t3 }), params: Bt(e2), transformResponse: (e3) => P(e3, [{ transformFn: N, paths: [{ path: `product.createdDate` }, { path: `product.updatedDate` }, { path: `product.description.metadata.createdTimestamp` }, { path: `product.description.metadata.updatedTimestamp` }, { path: `product.media.main.image.urlExpirationDate` }, { path: `product.media.main.video.urlExpirationDate` }, { path: `product.media.main.video.resolutions.urlExpirationDate` }, { path: `product.media.main.video.resolutions.poster.urlExpirationDate` }, { path: `product.media.main.video.posters.urlExpirationDate` }, { path: `product.media.itemsInfo.items.image.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.resolutions.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.resolutions.poster.urlExpirationDate` }, { path: `product.media.itemsInfo.items.video.posters.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.image.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `product.options.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.image.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.image.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.resolutions.poster.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video.posters.urlExpirationDate` }, { path: `product.modifiers.choicesSettings.choices.displayImage.urlExpirationDate` }, { path: `product.infoSections.description.metadata.createdTimestamp` }, { path: `product.infoSections.description.metadata.updatedTimestamp` }, { path: `product.variantsInfo.variants.media.image.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.resolutions.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.resolutions.poster.urlExpirationDate` }, { path: `product.variantsInfo.variants.media.video.posters.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.image.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.resolutions.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.resolutions.poster.urlExpirationDate` }, { path: `product.variantSummary.minPriceVariant.media.video.posters.urlExpirationDate` }] }, { transformFn: hn, paths: [{ path: `product.physicalProperties.pricePerUnit.quantity` }, { path: `product.physicalProperties.shippingWeightRange.minValue` }, { path: `product.physicalProperties.shippingWeightRange.maxValue` }, { path: `product.variantsInfo.variants.physicalProperties.pricePerUnit.settings.quantity` }, { path: `product.variantsInfo.variants.revenueDetails.profitMargin` }, { path: `product.subscriptionDetails.subscriptions.discount.percentOff` }, { path: `product.variantSummary.minPriceVariant.physicalProperties.pricePerUnit.settings.quantity` }, { path: `product.variantSummary.minPriceVariant.revenueDetails.profitMargin` }, { path: `product.minVariantPriceInfo.pricePerUnitData.settings.quantity` }, { path: `product.minVariantPriceInfo.revenueDetails.profitMargin` }, { path: `product.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `product.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `product.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `product.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `product.description.nodes.galleryData.items.image.media.duration` }, { path: `product.description.nodes.galleryData.items.video.media.duration` }, { path: `product.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `product.description.nodes.galleryData.options.item.ratio` }, { path: `product.description.nodes.imageData.image.duration` }, { path: `product.description.nodes.imageData.crop.x` }, { path: `product.description.nodes.imageData.crop.y` }, { path: `product.description.nodes.imageData.crop.width` }, { path: `product.description.nodes.imageData.crop.height` }, { path: `product.description.nodes.mapData.mapSettings.lat` }, { path: `product.description.nodes.mapData.mapSettings.lng` }, { path: `product.description.nodes.pollData.poll.image.duration` }, { path: `product.description.nodes.pollData.poll.options.image.duration` }, { path: `product.description.nodes.pollData.design.poll.background.image.duration` }, { path: `product.description.nodes.appEmbedData.image.duration` }, { path: `product.description.nodes.videoData.video.duration` }, { path: `product.description.nodes.videoData.thumbnail.duration` }, { path: `product.description.nodes.audioData.audio.duration` }, { path: `product.description.nodes.audioData.coverImage.duration` }, { path: `product.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `product.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.layoutData.backdropImage.media.duration` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `product.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.layoutData.background.gradient.centerX` }, { path: `product.description.nodes.layoutData.background.gradient.centerY` }, { path: `product.description.nodes.layoutData.background.gradient.stops.position` }, { path: `product.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `product.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `product.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `product.description.nodes.shapeData.shape.duration` }, { path: `product.description.nodes.cardData.background.gradient.centerX` }, { path: `product.description.nodes.cardData.background.gradient.centerY` }, { path: `product.description.nodes.cardData.background.gradient.stops.position` }, { path: `product.description.nodes.cardData.backgroundImage.media.duration` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `product.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.description.nodes.tocData.fontSize` }, { path: `product.description.nodes.tocData.itemSpacing` }, { path: `product.description.nodes.smartBlockCellData.shape.duration` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.buttonData.styles.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerX` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.centerY` }, { path: `product.infoSections.description.nodes.buttonData.styles.backgroundHover.gradient.stops.position` }, { path: `product.infoSections.description.nodes.galleryData.items.image.media.duration` }, { path: `product.infoSections.description.nodes.galleryData.items.video.media.duration` }, { path: `product.infoSections.description.nodes.galleryData.items.video.thumbnail.duration` }, { path: `product.infoSections.description.nodes.galleryData.options.item.ratio` }, { path: `product.infoSections.description.nodes.imageData.image.duration` }, { path: `product.infoSections.description.nodes.imageData.crop.x` }, { path: `product.infoSections.description.nodes.imageData.crop.y` }, { path: `product.infoSections.description.nodes.imageData.crop.width` }, { path: `product.infoSections.description.nodes.imageData.crop.height` }, { path: `product.infoSections.description.nodes.mapData.mapSettings.lat` }, { path: `product.infoSections.description.nodes.mapData.mapSettings.lng` }, { path: `product.infoSections.description.nodes.pollData.poll.image.duration` }, { path: `product.infoSections.description.nodes.pollData.poll.options.image.duration` }, { path: `product.infoSections.description.nodes.pollData.design.poll.background.image.duration` }, { path: `product.infoSections.description.nodes.appEmbedData.image.duration` }, { path: `product.infoSections.description.nodes.videoData.video.duration` }, { path: `product.infoSections.description.nodes.videoData.thumbnail.duration` }, { path: `product.infoSections.description.nodes.audioData.audio.duration` }, { path: `product.infoSections.description.nodes.audioData.coverImage.duration` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.media.duration` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.media.duration` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backdropImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.centerX` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.centerY` }, { path: `product.infoSections.description.nodes.layoutData.backdrop.gradient.stops.position` }, { path: `product.infoSections.description.nodes.shapeData.shape.duration` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.centerX` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.centerY` }, { path: `product.infoSections.description.nodes.cardData.background.gradient.stops.position` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.media.duration` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerX` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.centerY` }, { path: `product.infoSections.description.nodes.cardData.backgroundImage.overlay.gradient.stops.position` }, { path: `product.infoSections.description.nodes.tocData.fontSize` }, { path: `product.infoSections.description.nodes.tocData.itemSpacing` }, { path: `product.infoSections.description.nodes.smartBlockCellData.shape.duration` }, { path: `product.variantsInfo.variants.physicalProperties.weight` }, { path: `product.variantSummary.minPriceVariant.physicalProperties.weight` }, { path: `product.minVariantPriceInfo.weight` }] }]) };
3787
+ }
3788
+ return t2;
3789
+ }
3790
+ var fc = ((e2) => (e2.FREE_TEXT = `FREE_TEXT`, e2.TEXT_CHOICES = `TEXT_CHOICES`, e2.SWATCH_CHOICES = `SWATCH_CHOICES`, e2))(fc || {});
3791
+ var pc = ((e2) => (e2.IN_STOCK = `IN_STOCK`, e2.OUT_OF_STOCK = `OUT_OF_STOCK`, e2.PARTIALLY_OUT_OF_STOCK = `PARTIALLY_OUT_OF_STOCK`, e2))(pc || {});
3792
+ var mc = ((e2) => (e2.ALL_VARIANTS = `ALL_VARIANTS`, e2.NO_VARIANTS = `NO_VARIANTS`, e2.SOME_VARIANTS = `SOME_VARIANTS`, e2))(mc || {});
3793
+ var hc = ((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))(hc || {});
3794
+ async function gc(e2, t2) {
3795
+ let { httpClient: n2, sideEffects: r2 } = arguments[2], i2 = dc(j({ productId: e2, fields: t2?.fields }, []));
3796
+ r2?.onSiteCall?.();
3797
+ try {
3798
+ let e3 = await n2.request(i2);
3799
+ return r2?.onSuccess?.(e3), M(P(e3.data, [{ transformFn: X, paths: [{ path: `product.url` }] }, { transformFn: Y, paths: [{ path: `product.media.main.image` }, { path: `product.media.itemsInfo.items.image` }, { path: `product.options.choicesSettings.choices.image` }, { path: `product.options.choicesSettings.choices.displayImage` }, { path: `product.options.choicesSettings.choices.linkedMedia.image` }, { path: `product.modifiers.choicesSettings.choices.image` }, { path: `product.modifiers.choicesSettings.choices.displayImage` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.image` }, { path: `product.variantsInfo.variants.media.image` }, { path: `product.variantSummary.minPriceVariant.media.image` }] }, { transformFn: Js, paths: [{ path: `product.media.main.video` }, { path: `product.media.itemsInfo.items.video` }, { path: `product.options.choicesSettings.choices.linkedMedia.video` }, { path: `product.modifiers.choicesSettings.choices.linkedMedia.video` }, { path: `product.variantsInfo.variants.media.video` }, { path: `product.variantSummary.minPriceVariant.media.video` }] }]), [`product.description`, `product.infoSections.description`])?.product;
3800
+ } catch (e3) {
3801
+ let t3 = F(e3, { spreadPathsToArguments: {}, explicitPathsToArguments: { productId: `$[0]`, fields: `$[1].fields` }, singleArgumentUnchanged: false }, [`productId`, `options`]);
3802
+ throw r2?.onError?.(e3), t3;
3803
+ }
3804
+ }
3805
+ ({ ...us() }, { ...Bo() });
3806
+ function _c(e2) {
3807
+ return (t2, n2) => gc(t2, n2, { httpClient: e2 });
3808
+ }
3809
+ var vc = b(`wix.stores.catalog.v3.product_created`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3810
+ var yc = b(`wix.stores.catalog.v3.product_deleted`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3811
+ var bc = b(`wix.stores.catalog.v3.product_updated`, true, (e2) => M(P(e2, [{ transformFn: N, 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: X, paths: [{ path: `entity.url` }, { path: `modifiedFields.url` }] }, { transformFn: hn, 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: Y, 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: Js, 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` }] }])))();
3812
+ var xc = zt(_c);
3813
+ I(vc), I(yc), I(bc);
3814
+ function Sc(e2) {
3815
+ return wc(e2) ?? 99999;
3816
+ }
3817
+ function Cc(e2, t2) {
3818
+ return Math.min(e2, Math.max(t2, 1));
3819
+ }
3820
+ function wc(e2) {
3821
+ if (!e2 || !e2.trackQuantity) return;
3822
+ let { availabilityStatus: t2, inventoryQuantity: n2, preorderInfo: r2 } = e2, i2 = t2 === `PREORDER` ? r2?.quantity : n2;
3823
+ if (i2 != null) return Math.max(0, i2);
3824
+ }
3825
+ function Tc(e2) {
3826
+ let { availabilityStatus: t2, preorderAvailability: n2 } = e2 ?? {}, r2 = t2 !== pc.OUT_OF_STOCK;
3827
+ return { isInStock: r2, isPreOrderState: n2 === mc.ALL_VARIANTS || n2 === mc.SOME_VARIANTS && !r2 };
3828
+ }
3829
+ function Ec(e2, t2) {
3830
+ return t2 ? { isInStock: t2.availabilityStatus === Z.IN_STOCK, isPreOrderState: t2.availabilityStatus === Z.PREORDER } : Tc(e2.inventory);
3831
+ }
3832
+ function Dc(e2, t2) {
3833
+ return n(() => {
3834
+ let { isInStock: n2, isPreOrderState: r2 } = Ec(e2, t2);
3835
+ return { isInStock: n2, isPreOrderState: r2, preOrderMessage: r2 ? t2?.preorderInfo?.message : void 0, remainingItemCount: wc(t2) };
3836
+ }, [e2.inventory, t2]);
3837
+ }
3838
+ function Oc(e2) {
3839
+ return { type: `image`, src: e2.url, width: e2.width, height: e2.height, ...e2.name === void 0 ? {} : { title: e2.name }, ...e2.alt === void 0 ? {} : { parameters: { alt: e2.alt } } };
3840
+ }
3841
+ var kc = `11062b_7b9f1e3756b64285ad5cf5e244b4ae77~mv2.png`;
3842
+ var Ac = { uri: kc, url: `https://static.wixstatic.com/media/${kc}`, width: 460, height: 460 };
3843
+ var jc = [Oc(Ac)];
3844
+ function Mc(e2, t2, n2) {
3845
+ let r2 = Fc(e2, Nc(e2, t2, n2));
3846
+ return r2.length > 0 ? r2 : e2.media ?? [];
3847
+ }
3848
+ function Nc(e2, t2, n2) {
3849
+ let r2 = e2.options.flatMap((e3) => Pc(e3.choices, t2[e3.id])), i2 = Object.values(e2.modifiers).flatMap((e3) => Pc(e3.choices, n2[e3.id]));
3850
+ return [.../* @__PURE__ */ new Set([...r2, ...i2])];
3851
+ }
3852
+ function Pc(e2, t2) {
3853
+ return e2?.find((e3) => e3.choiceId === t2)?.mediaIds ?? [];
3854
+ }
3855
+ function Fc(e2, t2) {
3856
+ let n2 = new Map((e2.media ?? []).map((e3) => [e3.id, e3]));
3857
+ return t2.flatMap((e3) => {
3858
+ let t3 = n2.get(e3);
3859
+ return t3 ? [t3] : [];
3860
+ });
3861
+ }
3862
+ function Ic(e2) {
3863
+ return e2.map((e3) => e3.id).join(`|`);
3864
+ }
3865
+ function Lc(e2) {
3866
+ return e2.length > 0 ? e2.map((e3) => e3.media) : jc;
3867
+ }
3868
+ function Rc({ product: e2, selectedOptions: i2, selectedModifiers: a2 }) {
3869
+ let o2 = n(() => Lc(e2.media ?? []), [e2.media]), s2 = e2.mainMedia ?? Ac, c2 = n(() => Mc(e2, i2, a2), [e2, i2, a2]), l2 = n(() => Lc(c2), [c2]), u2 = Ic(c2), [d2, f2] = r(u2), [p2, m2] = r(0);
3870
+ d2 !== u2 && (f2(u2), m2(0));
3871
+ let h2 = t((e3) => m2(e3), []);
3872
+ return n(() => ({ allMedia: o2, mainMedia: s2, media: l2, selectedMediaIndex: p2, selectMedia: h2 }), [o2, s2, l2, p2, h2]);
3873
+ }
3874
+ function zc(e2) {
3875
+ return Object.entries(e2).map(([e3, t2]) => ({ optionId: e3, choiceId: t2 }));
3876
+ }
3877
+ function Bc(e2) {
3878
+ return Object.entries(e2).map(([e3, t2]) => ({ modifierId: e3, value: t2 }));
3879
+ }
3880
+ function Vc(e2, t2, r2, i2 = false) {
3881
+ let { selectedVariant: a2 } = t2, o2 = qs(e2, a2), s2 = Dc(e2, a2), c2 = Rc({ product: e2, selectedOptions: t2.selectedOptions, selectedModifiers: t2.selectedModifiers }), l2 = Ks(e2, a2), { getPageAbsoluteUrl: u2 } = ti(), d2 = n(() => {
3882
+ if (!e2.slug) return;
3883
+ let t3 = u2(U.PRODUCT_PAGE, e2.slug);
3884
+ return t3 ? { href: t3 } : void 0;
3885
+ }, [e2.slug, u2]);
3886
+ return n(() => {
3887
+ let { selectedVariant: e3, setHasAttemptedSubmit: n2, isSelectionValid: a3, selectedOptions: u3, selectedModifiers: f2, selectedSubscriptionPlanId: p2, quantity: m2, ...h2 } = t2;
3888
+ return { ...o2, link: d2, ...r2, ...h2, buyerSelections: { options: zc(u3), modifiers: Bc(f2), subscriptionPlanId: p2, quantity: m2 }, ...s2, ...c2, ...l2, isBackInStockEnabled: i2 };
3889
+ }, [o2, d2, r2, t2, s2, c2, l2, i2]);
3890
+ }
3891
+ var Hc = `one-time`;
3892
+ var Uc = H(`@wix/viewer-service-environment`);
3893
+ function Wc() {
3894
+ return l(Uc).language;
3895
+ }
3896
+ var Gc = (e2) => {
3897
+ let t2 = e2?.maximumFractionDigits ?? 2;
3898
+ return (e3) => e3?.toFixed(t2);
3899
+ };
3900
+ var Kc = (e2, t2, n2) => {
3901
+ let r2 = new Intl.NumberFormat(t2, { style: `currency`, currency: e2, ...n2 });
3902
+ return (e3) => {
3903
+ if (e3 != null) return r2.format(e3);
3904
+ };
3905
+ };
3906
+ function qc(e2, t2, n2) {
3907
+ return e2 ? Kc(e2, t2, n2) : Gc(n2);
3908
+ }
3909
+ function Jc(e2, t2) {
3910
+ let r2 = Wc();
3911
+ return n(() => qc(e2, r2, t2), [e2, r2, t2]);
3912
+ }
3913
+ function Q(e2, t2) {
3914
+ return e2 === void 0 ? void 0 : { amount: e2, formattedAmount: t2(e2) };
3915
+ }
3916
+ function Yc(e2, t2, n2) {
3917
+ return { id: e2.id, name: e2.name, isOneTimePurchase: false, description: e2.description, currentPrice: Q(t2.currentSellingPrice, n2), originalPrice: Q(t2.priceBeforeDiscount, n2), frequency: e2.frequency, interval: e2.interval, duration: e2.billingCycles };
3918
+ }
3919
+ function Xc(e2) {
3920
+ return e2 === void 0 ? void 0 : { description: e2.description };
3921
+ }
3922
+ function Zc(e2, t2) {
3923
+ return { currentSellingPrice: Q(e2.currentSellingPrice, t2), priceBeforeDiscount: Q(e2.priceBeforeDiscount, t2), pricePerUnit: Xc(e2.pricePerUnit) };
3924
+ }
3925
+ function Qc(e2, t2) {
3926
+ return { minCurrentSellingPrice: Q(e2.minCurrentSellingPrice, t2), maxCurrentSellingPrice: Q(e2.maxCurrentSellingPrice, t2), minPriceBeforeDiscount: Q(e2.minPriceBeforeDiscount, t2), maxPriceBeforeDiscount: Q(e2.maxPriceBeforeDiscount, t2), minPricePerUnit: Xc(e2.minPricePerUnit), maxPricePerUnit: Xc(e2.maxPricePerUnit) };
3927
+ }
3928
+ function $c(e2, t2, n2, r2) {
3929
+ if (e2.length === 0) return [];
3930
+ let i2 = e2.map(({ subscription: e3, price: t3 }) => Yc(e3, t3, r2));
3931
+ return t2 ? [{ id: Hc, name: `One-time purchase`, isOneTimePurchase: true, currentPrice: Q(n2.currentSellingPrice, r2) }, ...i2] : i2;
3932
+ }
3933
+ function el({ product: e2, userInputs: t2, hasLoadedVariants: r2 }) {
3934
+ let { selectedVariant: i2, selectedSubscriptionPlanId: a2 } = t2, o2 = Jc(e2.currency);
3935
+ return n(() => {
3936
+ let t3 = wo(e2, i2, r2), n2 = { ...Zc(To(t3, a2), o2), ...Qc(t3.productPriceRange, o2) }, s2 = $c(t3.subscriptionPlanPrices, e2.subscriptionDetails.allowOneTimePurchases, t3.productPrice, o2);
3937
+ return { currency: e2.currency, pricing: n2, subscriptionPlans: s2 };
3938
+ }, [e2, i2, a2, r2, o2]);
3939
+ }
3940
+ var tl = function(e2) {
3941
+ return e2.PRODUCT_BY_SLUG = `product-by-slug`, e2.PRODUCT_BY_ID = `product-by-id`, e2.PRODUCT_ITEM = `product-item`, e2;
3942
+ }({});
3943
+ function nl(e2) {
3944
+ let { isInStock: t2, isPreOrderState: n2 } = Tc(e2);
3945
+ return n2 ? Z.PREORDER : t2 ? Z.IN_STOCK : Z.OUT_OF_STOCK;
3946
+ }
3947
+ function rl(e2) {
3948
+ let { minPriceVariant: t2 } = e2, n2 = e2.options.length === 0;
3949
+ return !t2 || !n2 ? { variants: [], inventoryItems: [] } : { variants: [t2], inventoryItems: [{ variantId: t2.id, availabilityStatus: nl(e2.inventory), trackQuantity: false }] };
3950
+ }
3951
+ var il = (e2) => Number.parseFloat(e2?.amount);
3952
+ var al = (e2) => e2?.amount == null ? void 0 : il(e2);
3953
+ function ol(e2) {
3954
+ return e2.filter((e3) => e3.visible !== false).map(sl);
3955
+ }
3956
+ var sl = (e2) => {
3957
+ let t2 = Object.fromEntries((e2.choices ?? []).map((e3) => {
3958
+ let t3 = e3.optionChoiceIds;
3959
+ return [t3?.optionId, t3?.choiceId];
3960
+ }));
3961
+ return { id: e2._id, sku: e2.sku ?? void 0, choices: t2, price: ll(e2), subscriptionPrices: ul(e2) };
3962
+ };
3963
+ function cl(e2) {
3964
+ return e2?.description == null ? void 0 : { description: e2.description };
3965
+ }
3966
+ var ll = (e2) => {
3967
+ let t2 = e2.price;
3968
+ return { actualPrice: il(t2?.actualPrice), compareAtPrice: al(t2?.compareAtPrice), priceAfterDiscount: al(t2?.priceAfterDiscount), pricePerUnit: cl(e2.physicalProperties?.pricePerUnit) };
3969
+ };
3970
+ var ul = (e2) => (e2.subscriptionPricesInfo?.subscriptionPrices ?? []).map((e3) => ({ subscriptionId: e3.subscriptionId, price: il(e3.price) }));
3971
+ function dl(e2) {
3972
+ return e2.map((e3) => ({ variantId: e3.variantId ?? ``, availabilityStatus: e3.availabilityStatus, quantity: e3.quantity ?? void 0, trackQuantity: e3.trackQuantity ?? false, preorderInfo: e3.preorderInfo ? { message: e3.preorderInfo.message ?? void 0, quantity: e3.preorderInfo.quantity ?? void 0 } : void 0 }));
3973
+ }
3974
+ async function fl(e2, t2) {
3975
+ return dl((await cc().eq(`productId`, e2).eq(`locationId`, t2).find()).items ?? []);
3976
+ }
3977
+ var pl = [hc.SUBSCRIPTION_PRICES_INFO, hc.DISCOUNT_INFO];
3978
+ async function ml(e2, t2) {
3979
+ let [n2, r2] = await Promise.all([xc(e2, { fields: pl }), fl(e2, t2)]);
3980
+ return { variants: ol(n2.variantsInfo?.variants ?? []), inventoryItems: r2 };
3981
+ }
3982
+ function hl(e2, n2) {
3983
+ let [i2, a2] = r(false), { data: o2, isFetching: s2 } = Zr({ queryKey: [`product-variants`, e2, n2], queryFn: () => ml(e2, n2), enabled: i2, staleTime: 1 / 0, retry: false });
3984
+ return { variantsData: o2, isLoadingVariants: s2, requestVariants: t(() => {
3985
+ a2(true);
3986
+ }, []) };
3987
+ }
3988
+ function gl(e2, t2) {
3989
+ let { variantsData: r2, isLoadingVariants: i2, requestVariants: a2 } = hl(e2.id, t2), { variants: o2, inventoryItems: s2 } = n(() => r2 ?? rl(e2), [r2, e2]);
3990
+ return { product: n(() => ({ ...e2, variants: o2 }), [e2, o2]), inventoryItems: s2, hasLoadedVariants: n(() => r2 !== void 0, [r2]), isLoadingVariants: i2, requestVariants: a2 };
3991
+ }
3992
+ var _l = { type: `invalid-purchase`, message: `This item can't be purchased.` };
3993
+ function vl(e2) {
3994
+ let t2 = e2;
3995
+ return { type: `cart`, message: t2?.message, details: t2?.details };
3996
+ }
3997
+ var yl = H(`@wix/viewer-service-router`);
3998
+ var bl = H(`@wix/site-service-editor-context`);
3999
+ var xl = H(`@wix/site-service-pages`);
4000
+ var Sl = (e2) => {
4001
+ if (!e2) return ``;
4002
+ let t2 = new URLSearchParams(e2).toString();
4003
+ return t2 ? `?${t2}` : ``;
4004
+ };
4005
+ var Cl = (e2, t2, n2) => {
4006
+ let r2 = `./${e2.replace(/^\//, ``)}`;
4007
+ return n2 ? r2 : new URL(r2, `${t2.replace(/\/$/, ``)}/`).href;
4008
+ };
4009
+ var wl = () => {
4010
+ let e2 = l(yl), n2 = l(Qr), r2 = l(bl), i2 = l(xl), { getPageRelativeUrl: a2, getPageAbsoluteUrl: o2 } = ti();
4011
+ return { navigateToPage: t(async (t2, i3) => {
4012
+ try {
4013
+ let a3 = n2.appSectionRelativeUrl(ei, t2);
4014
+ if (!a3) return false;
4015
+ let o3 = `${a3}${Sl(i3)}`;
4016
+ return await e2.navigateTo({ href: Cl(o3, n2.siteUrl, r2.previewMode) }), true;
4017
+ } catch {
4018
+ return false;
4019
+ }
4020
+ }, [e2, n2, r2]), navigateToProductPage: t(async (t2) => {
4021
+ try {
4022
+ let n3 = r2.previewMode ? a2(U.PRODUCT_PAGE, t2) : o2(U.PRODUCT_PAGE, t2);
4023
+ if (!n3) throw Error(`Failed to resolve app section relative URL for the product page`);
4024
+ await e2.navigateTo({ href: n3 });
4025
+ } catch (e3) {
4026
+ console.error(`navigateToProductPage: failed to navigate to product "${t2}"`, e3);
4027
+ }
4028
+ }, [e2, r2, a2, o2]), openLightbox: t(async (t2) => {
4029
+ try {
4030
+ let n3 = Object.entries(i2.pages).find(([, e3]) => e3.popup && e3.appPageId === t2)?.[0];
4031
+ return n3 ? (await e2.navigateTo({ linkPopupId: n3 }), true) : false;
4032
+ } catch {
4033
+ return false;
4034
+ }
4035
+ }, [e2, i2]) };
4036
+ };
4037
+ async function Tl(e2) {
4038
+ await Ns({ catalogItems: [e2] });
4039
+ }
4040
+ var El = H(`@wix/site-service-public-api-caller`);
4041
+ var Dl = () => {
4042
+ let e2 = c();
4043
+ return { reloadCart: t(async () => {
4044
+ if (typeof window < `u`) try {
4045
+ await e2(El).callPublicApi(ei, `cart.reloadCart`, []);
4046
+ } catch {
4047
+ }
4048
+ }, [e2]) };
4049
+ };
4050
+ var Ol = function(e2) {
4051
+ return e2.IDLE = `idle`, e2.IN_PROGRESS = `in-progress`, e2.SUCCESS = `success`, e2;
4052
+ }({});
4053
+ var kl = function(e2) {
4054
+ return e2.NONE = `none`, e2.NAVIGATE_TO_CART = `navigate-to-cart`, e2.OPEN_SIDE_CART = `open-side-cart`, e2;
4055
+ }({});
4056
+ var Al = () => {
4057
+ let [e2, n2] = r(Ol.IDLE), { navigateToPage: i2, openLightbox: a2 } = wl(), { reloadCart: o2 } = Dl(), s2 = t(async (e3) => {
4058
+ switch (e3) {
4059
+ case kl.NAVIGATE_TO_CART:
4060
+ await i2(U.CART);
4061
+ return;
4062
+ case kl.OPEN_SIDE_CART:
4063
+ await a2(U.SIDE_CART);
4064
+ return;
4065
+ case kl.NONE:
4066
+ default:
4067
+ return;
4068
+ }
4069
+ }, [i2, a2]);
4070
+ return { addToCart: t(async (e3, t2) => {
4071
+ n2(Ol.IN_PROGRESS);
4072
+ try {
4073
+ await Tl(e3);
4074
+ } catch (e4) {
4075
+ return n2(Ol.IDLE), { ok: false, error: vl(e4) };
4076
+ }
4077
+ try {
4078
+ await o2(), n2(Ol.SUCCESS), await s2(t2), setTimeout(() => n2(Ol.IDLE), 2e3);
4079
+ } catch {
4080
+ n2(Ol.IDLE);
4081
+ }
4082
+ return { ok: true };
4083
+ }, [o2, s2]), addToCartState: e2, reloadCart: o2 };
4084
+ };
4085
+ async function jl(e2) {
4086
+ let t2 = await Ds({ cart: { source: { channelType: ws.WEB } }, catalogItems: [e2] });
4087
+ if (!t2._id) throw Error(`missing checkout id`);
4088
+ return t2._id;
4089
+ }
4090
+ var Ml = function(e2) {
4091
+ return e2.IDLE = `idle`, e2.IN_PROGRESS = `in-progress`, e2;
4092
+ }({});
4093
+ var Nl = () => {
4094
+ let { navigateToPage: e2 } = wl(), [n2, i2] = r(Ml.IDLE);
4095
+ return { buyNowState: n2, buyNow: t(async (t2) => {
4096
+ i2(Ml.IN_PROGRESS);
4097
+ try {
4098
+ let n3 = await jl(t2);
4099
+ return await e2(U.CHECKOUT, { checkoutId: n3 }) ? { ok: true } : { ok: false, error: vl(Error(`Failed to navigate to checkout`)) };
4100
+ } catch (e3) {
4101
+ return { ok: false, error: vl(e3) };
4102
+ } finally {
4103
+ i2(Ml.IDLE);
4104
+ }
4105
+ }, [e2]) };
4106
+ };
4107
+ function Pl(e2) {
4108
+ let { product: t2, selectedVariant: n2, userSelections: r2, isPreOrder: i2 } = e2;
4109
+ return { catalogReference: { appId: $r, catalogItemId: t2.id, options: Fl({ product: t2, selectedVariant: n2, userSelections: r2, isPreOrder: i2 }) }, quantity: r2.quantity };
4110
+ }
4111
+ var Fl = ({ product: e2, selectedVariant: t2, userSelections: n2, isPreOrder: r2 }) => {
4112
+ let i2 = Il(e2, t2.choices), { choiceBasedModifiers: a2, customTextFields: o2 } = Ll(e2, n2.selectedModifiers), s2 = { ...i2, ...a2 }, { selectedSubscriptionPlanId: c2 } = n2, l2 = { variantId: t2.id, options: s2 };
4113
+ return Object.keys(o2).length > 0 && (l2.customTextFields = o2), Rl(c2) && (l2.subscriptionOptionId = c2), r2 && (l2.preOrderRequested = true), l2;
4114
+ };
4115
+ var Il = (e2, t2) => {
4116
+ let n2 = {};
4117
+ for (let [r2, i2] of Object.entries(t2)) {
4118
+ let t3 = e2.options.find((e3) => e3.id === r2), a2 = t3?.choices.find((e3) => e3.choiceId === i2);
4119
+ t3 && a2 && (n2[t3.key] = a2.key);
4120
+ }
4121
+ return n2;
4122
+ };
4123
+ var Ll = (e2, t2) => {
4124
+ let n2 = {}, r2 = {};
4125
+ for (let i2 of Object.values(e2.modifiers)) if (i2.modifierRenderType === fc.FREE_TEXT) {
4126
+ let e3 = i2.freeTextSettings?.key;
4127
+ e3 && (r2[e3] = t2[i2.id] ?? ``);
4128
+ } else {
4129
+ let e3 = t2[i2.id], r3 = i2.choices?.find((t3) => t3.choiceId === e3);
4130
+ r3 && (n2[i2.key] = r3.key);
4131
+ }
4132
+ return { choiceBasedModifiers: n2, customTextFields: r2 };
4133
+ };
4134
+ var Rl = (e2) => e2 !== void 0 && e2 !== `one-time`;
4135
+ function zl(e2, r2, i2) {
4136
+ let { selectedVariant: a2, selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2, isSelectionValid: l2, setHasAttemptedSubmit: u2 } = r2, { addToCart: d2, addToCartState: f2 } = Al(), { buyNow: p2, buyNowState: m2 } = Nl(), h2 = i2.isPreOrderState || i2.isInStock, g2 = t(async (t2) => !h2 || (u2(true), !l2 || !a2) ? { ok: false, error: _l } : d2(Pl({ product: e2, selectedVariant: a2, userSelections: { selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2 }, isPreOrder: i2.isPreOrderState }), t2 ?? kl.NONE), [h2, i2.isPreOrderState, l2, u2, e2, a2, o2, s2, c2, d2]), _2 = t(async () => !h2 || (u2(true), !l2 || !a2) ? { ok: false, error: _l } : p2(Pl({ product: e2, selectedVariant: a2, userSelections: { selectedModifiers: o2, selectedSubscriptionPlanId: s2, quantity: c2 }, isPreOrder: i2.isPreOrderState })), [h2, i2.isPreOrderState, l2, u2, e2, a2, o2, s2, c2, p2]);
4137
+ return n(() => ({ addToCartState: f2, buyNowState: m2, handleAddToCart: g2, handleBuyNow: _2 }), [f2, m2, g2, _2]);
4138
+ }
4139
+ var Bl = (e2, t2) => e2.every((e3) => !e3.mandatory || Vl(e3, t2[e3.id]));
4140
+ var Vl = (e2, t2) => e2.modifierRenderType === fc.FREE_TEXT ? !!t2 : e2.choices?.some((e3) => e3.choiceId === t2);
4141
+ var Hl = function(e2) {
4142
+ return e2.DIRECT_ADD = `direct-add`, e2.NAVIGATE_TO_PRODUCT_PAGE = `navigate-to-product-page`, e2;
4143
+ }({});
4144
+ function Ul(e2, t2) {
4145
+ return Wl(e2, t2) ? Hl.NAVIGATE_TO_PRODUCT_PAGE : Hl.DIRECT_ADD;
4146
+ }
4147
+ var Wl = (e2, t2) => e2.subscriptionDetails.subscriptions.length > 0 || !Gl(e2, t2);
4148
+ var Gl = (e2, t2) => e2.options.length === 0 && Object.keys(e2.modifiers).length === 0 || t2.selectedVariant !== null && Bl(Object.values(t2.modifiers), t2.selectedModifiers);
4149
+ function Kl(e2, r2) {
4150
+ let { navigateToProductPage: i2 } = wl(), { addToCartState: a2, buyNowState: o2, handleAddToCart: s2, handleBuyNow: c2 } = zl(e2, r2, Dc(e2, r2.selectedVariant)), l2 = Ul(e2, r2), u2 = t(async () => e2.slug ? (await i2(e2.slug), { ok: true }) : { ok: false, error: _l }, [e2.slug, i2]), d2 = t((e3) => {
4151
+ switch (l2) {
4152
+ case Hl.DIRECT_ADD:
4153
+ return s2(e3);
4154
+ case Hl.NAVIGATE_TO_PRODUCT_PAGE:
4155
+ return u2();
4156
+ }
4157
+ }, [l2, s2, u2]), f2 = t(() => {
4158
+ switch (l2) {
4159
+ case Hl.DIRECT_ADD:
4160
+ return c2();
4161
+ case Hl.NAVIGATE_TO_PRODUCT_PAGE:
4162
+ return u2();
4163
+ }
4164
+ }, [l2, c2, u2]);
4165
+ return n(() => ({ addToCartState: a2, buyNowState: o2, handleAddToCart: d2, handleBuyNow: f2 }), [a2, o2, d2, f2]);
4166
+ }
4167
+ function ql(e2) {
4168
+ return Object.values(e2).toSorted().join(`_`);
4169
+ }
4170
+ function Jl(e2) {
4171
+ let t2 = /* @__PURE__ */ new Map();
4172
+ for (let n2 of e2) t2.set(ql(n2.choices), n2);
4173
+ return t2;
4174
+ }
4175
+ function Yl(e2, t2, n2) {
4176
+ let r2 = Object.keys(n2).length > 0, i2 = {};
4177
+ for (let a2 of e2) {
4178
+ i2[a2.id] = {};
4179
+ for (let e3 of a2.choices) {
4180
+ if (!r2) {
4181
+ i2[a2.id][e3.choiceId] = { isInStock: e3.inStock ?? true, isVisible: e3.visible ?? true };
4182
+ continue;
4183
+ }
4184
+ if (e3.inStock === false && e3.visible === false) {
4185
+ i2[a2.id][e3.choiceId] = { isInStock: false, isVisible: false };
4186
+ continue;
4187
+ }
4188
+ let { isInStock: o2, isVisible: s2 } = Xl({ ...n2, [a2.id]: e3.choiceId }, t2);
4189
+ i2[a2.id][e3.choiceId] = { isInStock: o2, isVisible: s2 };
4190
+ }
4191
+ }
4192
+ return i2;
4193
+ }
4194
+ function Xl(e2, t2) {
4195
+ let n2 = false, r2 = false;
4196
+ for (let i2 of t2.values()) if (Object.entries(e2).every(([e3, t3]) => i2.choices[e3] === t3) && (r2 = true, (i2.availabilityStatus === Z.IN_STOCK || i2.availabilityStatus === Z.PREORDER) && (n2 = true), n2)) break;
4197
+ return { isInStock: n2, isVisible: r2 };
4198
+ }
4199
+ function Zl(e2, t2) {
4200
+ let n2 = /* @__PURE__ */ new Map();
4201
+ for (let e3 of t2) n2.set(e3.variantId, e3);
4202
+ return e2.map((e3) => {
4203
+ let t3 = n2.get(e3.id);
4204
+ return { ...e3, availabilityStatus: t3?.availabilityStatus, preorderInfo: t3?.preorderInfo, inventoryQuantity: t3?.quantity, trackQuantity: t3?.trackQuantity };
4205
+ });
4206
+ }
4207
+ function Ql({ product: e2, selections: t2, selectedVariant: n2 }) {
4208
+ let r2 = { options: $l(e2.options, t2.selectedOptions, n2), modifiers: tu(e2.modifiers, t2.selectedModifiers), quantity: eu(t2.quantity, n2), subscriptionPlanId: nu(e2.subscriptionDetails, t2.selectedSubscriptionPlanId) };
4209
+ return { valid: Object.values(r2.options).length === 0 && Object.values(r2.modifiers).length === 0 && !r2.quantity && !r2.subscriptionPlanId, fields: r2 };
4210
+ }
4211
+ function $l(e2, t2, n2) {
4212
+ if (n2 !== null) return {};
4213
+ let r2 = {};
4214
+ for (let n3 of e2) t2[n3.id] || (r2[n3.id] = `missing`);
4215
+ return r2;
4216
+ }
4217
+ function eu(e2, t2) {
4218
+ if (e2 < 1) return `below-min`;
4219
+ if (e2 > Sc(t2)) return `above-max`;
4220
+ }
4221
+ function tu(e2, t2) {
4222
+ let n2 = Object.values(e2).filter((e3) => e3.mandatory && !Vl(e3, t2[e3.id]));
4223
+ return Object.fromEntries(n2.map((e3) => [e3.id, `missing`]));
4224
+ }
4225
+ function nu(e2, t2) {
4226
+ if (e2.subscriptions.length !== 0) return t2 ? t2 === `one-time` ? e2.allowOneTimePurchases ? void 0 : `missing` : ru(e2, t2) ? void 0 : `missing` : `missing`;
4227
+ }
4228
+ function ru(e2, t2) {
4229
+ return e2.subscriptions.some((e3) => e3.id === t2);
4230
+ }
4231
+ var $ = function(e2) {
4232
+ return e2.PRODUCT_OPTION = `PRODUCT_OPTION`, e2.MODIFIER = `MODIFIER`, e2;
4233
+ }({});
4234
+ function iu(e2, t2) {
4235
+ if (!t2) return;
4236
+ let n2 = t2.members.find((t3) => t3.productId === e2.id);
4237
+ if (!n2) return;
4238
+ let r2 = { groupingCustomizationId: t2.groupingCustomizationId, currentProductChoiceId: n2.choice.choiceId, members: t2.members };
4239
+ if (t2.customizationType === $.PRODUCT_OPTION) return e2.options.find(({ id: e3 }) => e3 === t2.groupingCustomizationId) ? { ...r2, customizationType: $.PRODUCT_OPTION } : void 0;
4240
+ if (e2.modifiers[t2.groupingCustomizationId]) return { ...r2, customizationType: $.MODIFIER };
4241
+ }
4242
+ function au(e2, t2) {
4243
+ return e2.members.find((e3) => e3.choice.choiceId === t2);
4244
+ }
4245
+ function ou(e2, t2, n2) {
4246
+ return !!e2 && t2 === e2.groupingCustomizationId && n2 !== e2.currentProductChoiceId;
4247
+ }
4248
+ function su(e2, t2) {
4249
+ if (!t2) return;
4250
+ if (t2.customizationType === $.PRODUCT_OPTION) {
4251
+ let n3 = e2.options.find(({ id: e3 }) => e3 === t2.groupingCustomizationId);
4252
+ if (!n3) return;
4253
+ let r3 = cu(n3, t2);
4254
+ return { options: e2.options.map((e3) => e3.id === n3.id ? r3 : e3) };
4255
+ }
4256
+ let n2 = e2.modifiers[t2.groupingCustomizationId];
4257
+ if (!n2) return;
4258
+ let r2 = lu(n2, t2);
4259
+ return { modifiers: { ...e2.modifiers, [t2.groupingCustomizationId]: r2 } };
4260
+ }
4261
+ function cu(e2, t2) {
4262
+ return { ...e2, isGroupedOption: true, choices: t2.members.map((e3) => ({ ...e3.choice, inStock: e3.inventoryAvailabilityStatus !== `OUT_OF_STOCK` })) };
4263
+ }
4264
+ function lu(e2, t2) {
4265
+ return { ...e2, choices: t2.members.map(({ choice: e3 }) => e3) };
4266
+ }
4267
+ function uu(e2, t2) {
4268
+ if (!t2 || t2.customizationType !== $.PRODUCT_OPTION) return e2;
4269
+ let n2 = Object.fromEntries(t2.members.map((e3) => [e3.choice.choiceId, { isInStock: e3.inventoryAvailabilityStatus !== `OUT_OF_STOCK`, isVisible: true }]));
4270
+ return { ...e2, [t2.groupingCustomizationId]: { ...n2, ...e2[t2.groupingCustomizationId] } };
4271
+ }
4272
+ function du(e2, r2) {
4273
+ let { navigateToProductPage: i2 } = wl(), a2 = n(() => iu(e2, r2), [e2, r2]);
4274
+ return { productGrouping: a2, selectGroupSiblingChoice: t((e3) => {
4275
+ if (!a2) return;
4276
+ let t2 = au(a2, e3);
4277
+ t2 && i2(t2.slug);
4278
+ }, [a2, i2]), productCustomizations: n(() => su(e2, a2), [e2, a2]), addGroupChoicesAvailability: t((e3) => uu(e3, a2), [a2]), initialSelection: n(() => {
4279
+ if (!a2) return { options: {}, modifiers: {} };
4280
+ let { customizationType: t2, groupingCustomizationId: n2, currentProductChoiceId: r3 } = a2;
4281
+ if (t2 === $.MODIFIER && e2.modifiers[n2].mandatory === false) return { options: {}, modifiers: {} };
4282
+ let i3 = { [n2]: r3 };
4283
+ return t2 === $.PRODUCT_OPTION ? { options: i3, modifiers: {} } : { options: {}, modifiers: i3 };
4284
+ }, [a2, e2.modifiers]) };
4285
+ }
4286
+ function fu(e2, i2, a2) {
4287
+ let o2 = du(e2, a2), { productGrouping: s2, selectGroupSiblingChoice: c2, addGroupChoicesAvailability: l2 } = o2, [u2, d2] = r(() => o2.initialSelection.options), [f2, p2] = r(() => o2.initialSelection.modifiers), [m2, h2] = r(void 0), [g2, _2] = r(1), [v2, y2] = r(false), b2 = n(() => Jl(Zl(e2.variants, i2)), [e2.variants, i2]), x2 = n(() => {
4288
+ let t2 = /* @__PURE__ */ new Map();
4289
+ return (n2) => {
4290
+ let r2 = ql(n2), i3 = t2.get(r2);
4291
+ if (i3) return i3;
4292
+ let a3 = l2(Yl(e2.options, b2, n2));
4293
+ return t2.set(r2, a3), a3;
4294
+ };
4295
+ }, [b2, e2.options, l2]), S2 = n(() => x2(u2), [x2, u2]), C2 = n(() => Object.keys(u2).length === e2.options.length ? b2.get(ql(u2)) ?? null : null, [b2, u2, e2.options.length]), w2 = t((e3, t2) => {
4296
+ if (u2[e3] !== t2) {
4297
+ if (ou(s2, e3, t2)) {
4298
+ c2(t2);
4299
+ return;
4300
+ }
4301
+ d2((n2) => ({ ...n2, [e3]: t2 })), _2(1);
4302
+ }
4303
+ }, [u2, s2, c2]), T2 = t((e3, t2) => {
4304
+ if (ou(s2, e3, t2)) {
4305
+ c2(t2);
4306
+ return;
4307
+ }
4308
+ p2((n2) => n2[e3] === t2 ? n2 : { ...n2, [e3]: t2 });
4309
+ }, [s2, c2]), E2 = t((e3) => {
4310
+ p2((t2) => {
4311
+ if (!(e3 in t2)) return t2;
4312
+ let { [e3]: n2, ...r2 } = t2;
4313
+ return r2;
4314
+ });
4315
+ }, []), D2 = t((e3) => {
4316
+ h2(e3);
4317
+ }, []), O2 = n(() => Sc(C2), [C2]), k2 = n(() => Cc(g2, O2), [g2, O2]), ee2 = t((e3) => {
4318
+ _2(e3);
4319
+ }, []), te2 = n(() => Ql({ product: e2, selections: { selectedOptions: u2, selectedModifiers: f2, selectedSubscriptionPlanId: m2, quantity: k2 }, selectedVariant: C2 }), [e2, u2, f2, m2, k2, C2]), ne2 = o2.productCustomizations?.options ?? e2.options, re2 = o2.productCustomizations?.modifiers ?? e2.modifiers;
4320
+ return n(() => ({ options: ne2, modifiers: re2, quantity: k2, selectedOptions: u2, selectedModifiers: f2, selectedSubscriptionPlanId: m2, selectedVariant: C2, selectedVariantId: C2?.id ?? null, selectionsAvailability: S2, maxPurchasableQuantity: O2, isSelectionValid: te2.valid, selectionValidationErrors: te2.fields, hasAttemptedSubmit: v2, setHasAttemptedSubmit: y2, selectOption: w2, selectModifier: T2, clearModifierSelection: E2, selectSubscriptionPlan: D2, selectQuantity: ee2 }), [ne2, re2, k2, u2, f2, m2, C2, S2, O2, te2, v2, w2, T2, E2, D2, ee2]);
4321
+ }
4322
+ function pu({ product: e2, inventoryItems: r2, hasLoadedVariants: i2, requestVariants: a2 }) {
4323
+ let o2 = fu(e2, r2), { selectOption: s2, selectModifier: c2, selectSubscriptionPlan: l2, selectQuantity: u2, selectionsAvailability: d2, ...f2 } = o2, p2 = t((e3, t2) => {
4324
+ a2(), s2(e3, t2);
4325
+ }, [a2, s2]), m2 = t((e3, t2) => {
4326
+ a2(), c2(e3, t2);
4327
+ }, [a2, c2]), h2 = t((e3) => {
4328
+ a2(), u2(e3);
4329
+ }, [a2, u2]), g2 = n(() => i2 ? d2 : Yl(e2.options, /* @__PURE__ */ new Map(), {}), [i2, d2, e2.options]);
4330
+ return n(() => ({ ...f2, selectOption: p2, selectModifier: m2, selectSubscriptionPlan: l2, selectQuantity: h2, selectionsAvailability: g2 }), [o2, p2, m2, l2, h2, g2]);
4331
+ }
4332
+ var mu = { subscriptionPlans: null, description: null, infoSections: null };
4333
+ function hu() {
4334
+ return s();
4335
+ }
4336
+ function gu({ product: e2, defaultLocationId: t2 }) {
4337
+ let r2 = gl(e2, t2), i2 = pu(r2), a2 = Kl(r2.product, i2), o2 = el({ product: r2.product, userInputs: i2, hasLoadedVariants: r2.hasLoadedVariants }), s2 = Vc(r2.product, i2, o2);
4338
+ return n(() => ({ source: tl.PRODUCT_ITEM, ...s2, ...a2, ...mu }), [s2, a2]);
4339
+ }
4340
+ function _u({ productItem: e2, children: t2 }) {
4341
+ let n2 = gu(e2);
4342
+ return a(o, { value: n2, children: t2 });
4343
+ }
4344
+ function vu({ productItem: e2, children: t2 }) {
4345
+ let [n2] = r(() => new Pr());
4346
+ return e2 === void 0 ? a(i, { children: t2 }) : a(Lr, { client: n2, children: a(_u, { productItem: e2, children: t2 }, e2.product.id) });
4347
+ }
4348
+ var yu = jn(`890cc5ff-b951-47bc-86ed-4dc139f4ff0d`);
4349
+ export {
4350
+ vu as ProductItemContextProvider,
4351
+ vu as default,
4352
+ yu as injectAccessTokenGetter,
4353
+ hu as useProductItemContext,
4354
+ gu as useProductItemContextValue
4355
+ };
4356
+ //# sourceMappingURL=context-product-item-context-provider.mjs.map