@colabcommerce/elements 0.0.4 → 0.9.1

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 (99) hide show
  1. package/.pnp.cjs +16484 -0
  2. package/.pnp.loader.mjs +2126 -0
  3. package/.yarn/install-state.gz +0 -0
  4. package/.yarn/releases/yarn-4.12.0.cjs +942 -0
  5. package/.yarnrc.yml +1 -0
  6. package/README.md +60 -41
  7. package/cypress/fixtures/example.json +5 -0
  8. package/cypress/support/commands.js +25 -0
  9. package/cypress/support/component-index.html +15 -0
  10. package/cypress/support/component.js +26 -0
  11. package/cypress.config.js +10 -0
  12. package/eslint.config.js +32 -0
  13. package/index.html +13 -0
  14. package/package.json +91 -67
  15. package/playground/index.html +14 -0
  16. package/playground/main.jsx +36 -0
  17. package/public/vite.svg +1 -0
  18. package/src/App.css +0 -0
  19. package/src/App.jsx +65 -0
  20. package/src/components/CollapsibleStoreHours/index.jsx +269 -0
  21. package/src/components/HoursList/index.jsx +225 -0
  22. package/src/components/LeadForm/index.jsx +241 -0
  23. package/src/components/MessageDialog/index.jsx +169 -0
  24. package/src/components/QuoteForm/index.jsx +82 -0
  25. package/src/components/QuoteFormSearch/index.jsx +276 -0
  26. package/src/components/QuoteFormStoreList/index.jsx +65 -0
  27. package/src/components/QuoteFormStoreListItem/index.jsx +134 -0
  28. package/src/components/QuoteLeadForm/index.jsx +16 -0
  29. package/src/components/QuoteMap/index.jsx +96 -0
  30. package/src/components/QuoteMapMarker/index.jsx +56 -0
  31. package/src/components/StaticMap/index.jsx +24 -0
  32. package/src/components/Store/index.jsx +44 -0
  33. package/src/components/StoreContact/index.jsx +96 -0
  34. package/src/components/StoreInfo/index.jsx +50 -0
  35. package/src/components/StoreList/index.jsx +59 -0
  36. package/src/components/StoreListItem/index.jsx +99 -0
  37. package/src/components/StoreListItem/indexStoreListItem.cy.jsx +30 -0
  38. package/src/components/StoreListNoneFound/index.jsx +16 -0
  39. package/src/components/StoreLocator/index.jsx +43 -0
  40. package/src/components/StoreLocatorMap/index.jsx +93 -0
  41. package/src/components/StoreLocatorMapMarker/index.jsx +55 -0
  42. package/src/components/StoreLocatorMessageDialog/index.jsx +20 -0
  43. package/src/components/StoreLocatorSearch/index.jsx +316 -0
  44. package/src/components/StoreMap/index.jsx +30 -0
  45. package/src/components/StoreMeta/index.jsx +7 -0
  46. package/src/components/StoreProducts/index.jsx +112 -0
  47. package/src/components/ui/Badge/index.jsx +46 -0
  48. package/src/components/ui/Button/index.jsx +56 -0
  49. package/src/components/ui/Button/indexButton.cy.jsx +9 -0
  50. package/src/components/ui/Card/index.jsx +90 -0
  51. package/src/components/ui/Input/index.jsx +19 -0
  52. package/src/components/ui/Input/indexInput.cy.jsx +9 -0
  53. package/src/components/ui/LoadingPuff/index.jsx +10 -0
  54. package/src/components/ui/Panel/index.jsx +23 -0
  55. package/src/components/ui/PhoneNumberInput/index.jsx +17 -0
  56. package/src/contexts/quote-form.jsx +94 -0
  57. package/src/contexts/store-locator.jsx +83 -0
  58. package/src/contexts/store.jsx +59 -0
  59. package/src/contexts/translations.jsx +11 -0
  60. package/src/dist.css +229 -0
  61. package/src/entries/QuoteForm.js +2 -0
  62. package/src/entries/Store.js +2 -0
  63. package/src/entries/StoreLocator.js +2 -0
  64. package/src/entries/StoreLocatorProvider.js +2 -0
  65. package/src/entries/styles.js +2 -0
  66. package/src/entries/useStoreLocator.js +2 -0
  67. package/src/i18n/defaultResources.js +19 -0
  68. package/src/i18n/index.js +44 -0
  69. package/src/i18n/mergeResources.js +22 -0
  70. package/src/index.css +214 -0
  71. package/src/lib/addressComponentsToAddress.js +43 -0
  72. package/src/lib/productSchema.js +6 -0
  73. package/src/lib/useGeolocation.js +266 -0
  74. package/src/lib/useHours.js +205 -0
  75. package/src/lib/usePlacesAutocomplete.js +288 -0
  76. package/src/lib/useProductAvailability.js +38 -0
  77. package/src/lib/useRudderAnalytics.js +50 -0
  78. package/src/lib/useSearchResults.js +102 -0
  79. package/src/lib/useStoreLocatorConfig.js +50 -0
  80. package/src/lib/utils/cn.js +6 -0
  81. package/src/lib/utils/measure.js +31 -0
  82. package/src/locales/en/default.json +58 -0
  83. package/src/locales/es/default.json +58 -0
  84. package/src/locales/fr/default.json +58 -0
  85. package/src/locales/it/default.json +58 -0
  86. package/src/main.jsx +10 -0
  87. package/vite.config.js +60 -53
  88. package/dist/CartForm.js +0 -617
  89. package/dist/Container-CU_WrBOi.js +0 -22
  90. package/dist/Modal-DTBKy_6d.js +0 -863
  91. package/dist/ProductForm.js +0 -343
  92. package/dist/Retailer.js +0 -3637
  93. package/dist/StoreLocator.js +0 -797
  94. package/dist/addressComponentsToAddress-DCL-K8mn.js +0 -1932
  95. package/dist/browser-ponyfill-DcK7_cJB.js +0 -339
  96. package/dist/globals-B8-hYoIU.js +0 -8518
  97. package/dist/index-CqSfhXDd.js +0 -137
  98. package/dist/index-FM02Uq_P.js +0 -100
  99. package/dist/style.css +0 -1
@@ -1,1932 +0,0 @@
1
- import { jsx as E, jsxs as J } from "react/jsx-runtime";
2
- import yt, { useMemo as me, createContext as hr, useContext as mr, useState as $, useEffect as ne, useRef as fn } from "react";
3
- import { T as pn, r as yn, t as dn, q as vn, y as Ut, G as hn, v as mn, E as gn, s as Sn, S as wn, d as Ge, u as dt, f as vt, U as _n, V as Gt, W as bn, a as ye, c as T, F as gr, n as En, o as ge, b as An, B as On } from "./globals-B8-hYoIU.js";
4
- function Se(...t) {
5
- return t.filter((e) => e != null).reduce((e, r) => {
6
- if (typeof r != "function")
7
- throw new Error("Invalid Argument Type, must only provide functions, undefined, or null.");
8
- return e === null ? r : function(...o) {
9
- e.apply(this, o), r.apply(this, o);
10
- };
11
- }, null);
12
- }
13
- const $n = {
14
- height: ["marginTop", "marginBottom"],
15
- width: ["marginLeft", "marginRight"]
16
- };
17
- function Pn(t, e) {
18
- const r = `offset${t[0].toUpperCase()}${t.slice(1)}`, n = e[r], o = $n[t];
19
- return n + // @ts-expect-error TODO
20
- parseInt(Ut(e, o[0]), 10) + // @ts-expect-error TODO
21
- parseInt(Ut(e, o[1]), 10);
22
- }
23
- const xn = {
24
- [wn]: "collapse",
25
- [Sn]: "collapsing",
26
- [gn]: "collapsing",
27
- [mn]: "collapse show"
28
- }, bt = /* @__PURE__ */ yt.forwardRef(({
29
- onEnter: t,
30
- onEntering: e,
31
- onEntered: r,
32
- onExit: n,
33
- onExiting: o,
34
- className: a,
35
- children: i,
36
- dimension: c = "height",
37
- in: s = !1,
38
- timeout: l = 300,
39
- mountOnEnter: f = !1,
40
- unmountOnExit: p = !1,
41
- appear: u = !1,
42
- getDimensionValue: y = Pn,
43
- ...v
44
- }, g) => {
45
- const h = typeof c == "function" ? c() : c, S = me(() => Se((_) => {
46
- _.style[h] = "0";
47
- }, t), [h, t]), b = me(() => Se((_) => {
48
- const x = `scroll${h[0].toUpperCase()}${h.slice(1)}`;
49
- _.style[h] = `${_[x]}px`;
50
- }, e), [h, e]), d = me(() => Se((_) => {
51
- _.style[h] = null;
52
- }, r), [h, r]), I = me(() => Se((_) => {
53
- _.style[h] = `${y(h, _)}px`, hn(_);
54
- }, n), [n, y, h]), O = me(() => Se((_) => {
55
- _.style[h] = null;
56
- }, o), [h, o]);
57
- return /* @__PURE__ */ E(pn, {
58
- ref: g,
59
- addEndListener: dn,
60
- ...v,
61
- "aria-expanded": v.role ? s : null,
62
- onEnter: S,
63
- onEntering: b,
64
- onEntered: d,
65
- onExit: I,
66
- onExiting: O,
67
- childRef: yn(i),
68
- in: s,
69
- timeout: l,
70
- mountOnEnter: f,
71
- unmountOnExit: p,
72
- appear: u,
73
- children: (_, x) => /* @__PURE__ */ yt.cloneElement(i, {
74
- ...x,
75
- className: vn(a, i.props.className, xn[_], h === "width" && "collapse-horizontal")
76
- })
77
- });
78
- });
79
- bt.displayName = "Collapse";
80
- /**
81
- * @license lucide-react v0.542.0 - ISC
82
- *
83
- * This source code is licensed under the ISC license.
84
- * See the LICENSE file in the root directory of this source tree.
85
- */
86
- const In = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Cn = Ge("chevron-down", In);
87
- /**
88
- * @license lucide-react v0.542.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */
93
- const Rn = [
94
- ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
95
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
96
- ], Fn = Ge("clock", Rn);
97
- /**
98
- * @license lucide-react v0.542.0 - ISC
99
- *
100
- * This source code is licensed under the ISC license.
101
- * See the LICENSE file in the root directory of this source tree.
102
- */
103
- const Nn = [
104
- ["line", { x1: "2", x2: "5", y1: "12", y2: "12", key: "bvdh0s" }],
105
- ["line", { x1: "19", x2: "22", y1: "12", y2: "12", key: "1tbv5k" }],
106
- ["line", { x1: "12", x2: "12", y1: "2", y2: "5", key: "11lu5j" }],
107
- ["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }],
108
- ["circle", { cx: "12", cy: "12", r: "7", key: "fim9np" }]
109
- ], Dn = Ge("locate", Nn);
110
- /**
111
- * @license lucide-react v0.542.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */
116
- const Mn = [
117
- ["line", { x1: "21", x2: "14", y1: "4", y2: "4", key: "obuewd" }],
118
- ["line", { x1: "10", x2: "3", y1: "4", y2: "4", key: "1q6298" }],
119
- ["line", { x1: "21", x2: "12", y1: "12", y2: "12", key: "1iu8h1" }],
120
- ["line", { x1: "8", x2: "3", y1: "12", y2: "12", key: "ntss68" }],
121
- ["line", { x1: "21", x2: "16", y1: "20", y2: "20", key: "14d8ph" }],
122
- ["line", { x1: "12", x2: "3", y1: "20", y2: "20", key: "m0wm8r" }],
123
- ["line", { x1: "14", x2: "14", y1: "2", y2: "6", key: "14e1ph" }],
124
- ["line", { x1: "8", x2: "8", y1: "10", y2: "14", key: "1i6ji0" }],
125
- ["line", { x1: "16", x2: "16", y1: "18", y2: "22", key: "1lctlv" }]
126
- ], Tn = Ge("sliders-horizontal", Mn), Sr = hr(), Al = ({ id: t, children: e }) => {
127
- var S, b, d, I, O, _, x, U, F, C, G, B, m;
128
- const { data: r } = dt([`https://api.colabcommerce.com/widget_api/store_locator/${t}`], vt), n = ((S = r == null ? void 0 : r.entity) == null ? void 0 : S.store_locator_default_center) || { lat: 49.8954, lng: -97.1385 }, o = ((b = r == null ? void 0 : r.entity) == null ? void 0 : b.store_locator_default_center_name) || "San Francisco, CA", a = (d = r == null ? void 0 : r.entity) == null ? void 0 : d.store_locator_center_icon, i = (I = r == null ? void 0 : r.entity) == null ? void 0 : I.store_locator_css, c = ((O = r == null ? void 0 : r.entity) == null ? void 0 : O.store_locator_default_radius) || "30000mi", s = ((_ = r == null ? void 0 : r.entity) == null ? void 0 : _.store_locator_default_zoom) || 4, l = (x = r == null ? void 0 : r.entity) == null ? void 0 : x.store_locator_store_icon, f = (U = r == null ? void 0 : r.entity) == null ? void 0 : U.store_type_icons, p = (F = r == null ? void 0 : r.entity) == null ? void 0 : F.store_types, u = ((C = r == null ? void 0 : r.entity) == null ? void 0 : C.store_locator_default_lat) || 49.8954, y = ((G = r == null ? void 0 : r.entity) == null ? void 0 : G.store_locator_default_lng) || -97.1385, v = ((B = r == null ? void 0 : r.entity) == null ? void 0 : B.store_locator_default_name) || null, g = ((m = r == null ? void 0 : r.entity) == null ? void 0 : m.cc_company_retailer_location_id) || null, h = {
129
- id: t,
130
- defaultCenter: n,
131
- defaultCenterName: o,
132
- centerIcon: a,
133
- css: i,
134
- defaultRadius: c,
135
- defaultZoom: s,
136
- storeIcon: l,
137
- storeTypes: p,
138
- defaultLat: u,
139
- defaultLng: y,
140
- defaultName: v,
141
- storeIcons: f,
142
- cc_company_retailer_location_id: g
143
- };
144
- return /* @__PURE__ */ E(Sr.Provider, { value: h, children: e });
145
- }, Ol = () => {
146
- const t = mr(Sr);
147
- if (!t)
148
- throw new Error("useStoreLocatorSettings must be used within a StoreLocatorSettingsProvider");
149
- return t;
150
- };
151
- var de = TypeError;
152
- const Ln = {}, kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
153
- __proto__: null,
154
- default: Ln
155
- }, Symbol.toStringTag, { value: "Module" })), Bn = /* @__PURE__ */ _n(kn);
156
- var Et = typeof Map == "function" && Map.prototype, je = Object.getOwnPropertyDescriptor && Et ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ke = Et && je && typeof je.get == "function" ? je.get : null, Ht = Et && Map.prototype.forEach, At = typeof Set == "function" && Set.prototype, Je = Object.getOwnPropertyDescriptor && At ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, Be = At && Je && typeof Je.get == "function" ? Je.get : null, qt = At && Set.prototype.forEach, Wn = typeof WeakMap == "function" && WeakMap.prototype, _e = Wn ? WeakMap.prototype.has : null, Un = typeof WeakSet == "function" && WeakSet.prototype, be = Un ? WeakSet.prototype.has : null, Gn = typeof WeakRef == "function" && WeakRef.prototype, zt = Gn ? WeakRef.prototype.deref : null, Hn = Boolean.prototype.valueOf, qn = Object.prototype.toString, zn = Function.prototype.toString, Vn = String.prototype.match, Ot = String.prototype.slice, Z = String.prototype.replace, Kn = String.prototype.toUpperCase, Vt = String.prototype.toLowerCase, wr = RegExp.prototype.test, Kt = Array.prototype.concat, K = Array.prototype.join, Qn = Array.prototype.slice, Qt = Math.floor, ht = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Xe = Object.getOwnPropertySymbols, mt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, fe = typeof Symbol == "function" && typeof Symbol.iterator == "object", Ee = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === fe || !0) ? Symbol.toStringTag : null, _r = Object.prototype.propertyIsEnumerable, jt = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
157
- return t.__proto__;
158
- } : null);
159
- function Jt(t, e) {
160
- if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || wr.call(/e/, e))
161
- return e;
162
- var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
163
- if (typeof t == "number") {
164
- var n = t < 0 ? -Qt(-t) : Qt(t);
165
- if (n !== t) {
166
- var o = String(n), a = Ot.call(e, o.length + 1);
167
- return Z.call(o, r, "$&_") + "." + Z.call(Z.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
168
- }
169
- }
170
- return Z.call(e, r, "$&_");
171
- }
172
- var gt = Bn, Xt = gt.custom, Zt = Ar(Xt) ? Xt : null, br = {
173
- __proto__: null,
174
- double: '"',
175
- single: "'"
176
- }, jn = {
177
- __proto__: null,
178
- double: /(["\\])/g,
179
- single: /(['\\])/g
180
- }, He = function t(e, r, n, o) {
181
- var a = r || {};
182
- if (j(a, "quoteStyle") && !j(br, a.quoteStyle))
183
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
184
- if (j(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
185
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
186
- var i = j(a, "customInspect") ? a.customInspect : !0;
187
- if (typeof i != "boolean" && i !== "symbol")
188
- throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
189
- if (j(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
190
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
191
- if (j(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
192
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
193
- var c = a.numericSeparator;
194
- if (typeof e > "u")
195
- return "undefined";
196
- if (e === null)
197
- return "null";
198
- if (typeof e == "boolean")
199
- return e ? "true" : "false";
200
- if (typeof e == "string")
201
- return $r(e, a);
202
- if (typeof e == "number") {
203
- if (e === 0)
204
- return 1 / 0 / e > 0 ? "0" : "-0";
205
- var s = String(e);
206
- return c ? Jt(e, s) : s;
207
- }
208
- if (typeof e == "bigint") {
209
- var l = String(e) + "n";
210
- return c ? Jt(e, l) : l;
211
- }
212
- var f = typeof a.depth > "u" ? 5 : a.depth;
213
- if (typeof n > "u" && (n = 0), n >= f && f > 0 && typeof e == "object")
214
- return St(e) ? "[Array]" : "[Object]";
215
- var p = yo(a, n);
216
- if (typeof o > "u")
217
- o = [];
218
- else if (Or(o, e) >= 0)
219
- return "[Circular]";
220
- function u(m, A, H) {
221
- if (A && (o = Qn.call(o), o.push(A)), H) {
222
- var Q = {
223
- depth: a.depth
224
- };
225
- return j(a, "quoteStyle") && (Q.quoteStyle = a.quoteStyle), t(m, Q, n + 1, o);
226
- }
227
- return t(m, a, n + 1, o);
228
- }
229
- if (typeof e == "function" && !Yt(e)) {
230
- var y = oo(e), v = Re(e, u);
231
- return "[Function" + (y ? ": " + y : " (anonymous)") + "]" + (v.length > 0 ? " { " + K.call(v, ", ") + " }" : "");
232
- }
233
- if (Ar(e)) {
234
- var g = fe ? Z.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : mt.call(e);
235
- return typeof e == "object" && !fe ? we(g) : g;
236
- }
237
- if (uo(e)) {
238
- for (var h = "<" + Vt.call(String(e.nodeName)), S = e.attributes || [], b = 0; b < S.length; b++)
239
- h += " " + S[b].name + "=" + Er(Jn(S[b].value), "double", a);
240
- return h += ">", e.childNodes && e.childNodes.length && (h += "..."), h += "</" + Vt.call(String(e.nodeName)) + ">", h;
241
- }
242
- if (St(e)) {
243
- if (e.length === 0)
244
- return "[]";
245
- var d = Re(e, u);
246
- return p && !po(d) ? "[" + wt(d, p) + "]" : "[ " + K.call(d, ", ") + " ]";
247
- }
248
- if (Zn(e)) {
249
- var I = Re(e, u);
250
- return !("cause" in Error.prototype) && "cause" in e && !_r.call(e, "cause") ? "{ [" + String(e) + "] " + K.call(Kt.call("[cause]: " + u(e.cause), I), ", ") + " }" : I.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + K.call(I, ", ") + " }";
251
- }
252
- if (typeof e == "object" && i) {
253
- if (Zt && typeof e[Zt] == "function" && gt)
254
- return gt(e, { depth: f - n });
255
- if (i !== "symbol" && typeof e.inspect == "function")
256
- return e.inspect();
257
- }
258
- if (ao(e)) {
259
- var O = [];
260
- return Ht && Ht.call(e, function(m, A) {
261
- O.push(u(A, e, !0) + " => " + u(m, e));
262
- }), er("Map", ke.call(e), O, p);
263
- }
264
- if (co(e)) {
265
- var _ = [];
266
- return qt && qt.call(e, function(m) {
267
- _.push(u(m, e));
268
- }), er("Set", Be.call(e), _, p);
269
- }
270
- if (io(e))
271
- return Ze("WeakMap");
272
- if (so(e))
273
- return Ze("WeakSet");
274
- if (lo(e))
275
- return Ze("WeakRef");
276
- if (eo(e))
277
- return we(u(Number(e)));
278
- if (ro(e))
279
- return we(u(ht.call(e)));
280
- if (to(e))
281
- return we(Hn.call(e));
282
- if (Yn(e))
283
- return we(u(String(e)));
284
- if (typeof window < "u" && e === window)
285
- return "{ [object Window] }";
286
- if (typeof globalThis < "u" && e === globalThis || typeof Gt < "u" && e === Gt)
287
- return "{ [object globalThis] }";
288
- if (!Xn(e) && !Yt(e)) {
289
- var x = Re(e, u), U = jt ? jt(e) === Object.prototype : e instanceof Object || e.constructor === Object, F = e instanceof Object ? "" : "null prototype", C = !U && Ee && Object(e) === e && Ee in e ? Ot.call(Y(e), 8, -1) : F ? "Object" : "", G = U || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", B = G + (C || F ? "[" + K.call(Kt.call([], C || [], F || []), ": ") + "] " : "");
290
- return x.length === 0 ? B + "{}" : p ? B + "{" + wt(x, p) + "}" : B + "{ " + K.call(x, ", ") + " }";
291
- }
292
- return String(e);
293
- };
294
- function Er(t, e, r) {
295
- var n = r.quoteStyle || e, o = br[n];
296
- return o + t + o;
297
- }
298
- function Jn(t) {
299
- return Z.call(String(t), /"/g, "&quot;");
300
- }
301
- function ie(t) {
302
- return !Ee || !(typeof t == "object" && (Ee in t || typeof t[Ee] < "u"));
303
- }
304
- function St(t) {
305
- return Y(t) === "[object Array]" && ie(t);
306
- }
307
- function Xn(t) {
308
- return Y(t) === "[object Date]" && ie(t);
309
- }
310
- function Yt(t) {
311
- return Y(t) === "[object RegExp]" && ie(t);
312
- }
313
- function Zn(t) {
314
- return Y(t) === "[object Error]" && ie(t);
315
- }
316
- function Yn(t) {
317
- return Y(t) === "[object String]" && ie(t);
318
- }
319
- function eo(t) {
320
- return Y(t) === "[object Number]" && ie(t);
321
- }
322
- function to(t) {
323
- return Y(t) === "[object Boolean]" && ie(t);
324
- }
325
- function Ar(t) {
326
- if (fe)
327
- return t && typeof t == "object" && t instanceof Symbol;
328
- if (typeof t == "symbol")
329
- return !0;
330
- if (!t || typeof t != "object" || !mt)
331
- return !1;
332
- try {
333
- return mt.call(t), !0;
334
- } catch {
335
- }
336
- return !1;
337
- }
338
- function ro(t) {
339
- if (!t || typeof t != "object" || !ht)
340
- return !1;
341
- try {
342
- return ht.call(t), !0;
343
- } catch {
344
- }
345
- return !1;
346
- }
347
- var no = Object.prototype.hasOwnProperty || function(t) {
348
- return t in this;
349
- };
350
- function j(t, e) {
351
- return no.call(t, e);
352
- }
353
- function Y(t) {
354
- return qn.call(t);
355
- }
356
- function oo(t) {
357
- if (t.name)
358
- return t.name;
359
- var e = Vn.call(zn.call(t), /^function\s*([\w$]+)/);
360
- return e ? e[1] : null;
361
- }
362
- function Or(t, e) {
363
- if (t.indexOf)
364
- return t.indexOf(e);
365
- for (var r = 0, n = t.length; r < n; r++)
366
- if (t[r] === e)
367
- return r;
368
- return -1;
369
- }
370
- function ao(t) {
371
- if (!ke || !t || typeof t != "object")
372
- return !1;
373
- try {
374
- ke.call(t);
375
- try {
376
- Be.call(t);
377
- } catch {
378
- return !0;
379
- }
380
- return t instanceof Map;
381
- } catch {
382
- }
383
- return !1;
384
- }
385
- function io(t) {
386
- if (!_e || !t || typeof t != "object")
387
- return !1;
388
- try {
389
- _e.call(t, _e);
390
- try {
391
- be.call(t, be);
392
- } catch {
393
- return !0;
394
- }
395
- return t instanceof WeakMap;
396
- } catch {
397
- }
398
- return !1;
399
- }
400
- function lo(t) {
401
- if (!zt || !t || typeof t != "object")
402
- return !1;
403
- try {
404
- return zt.call(t), !0;
405
- } catch {
406
- }
407
- return !1;
408
- }
409
- function co(t) {
410
- if (!Be || !t || typeof t != "object")
411
- return !1;
412
- try {
413
- Be.call(t);
414
- try {
415
- ke.call(t);
416
- } catch {
417
- return !0;
418
- }
419
- return t instanceof Set;
420
- } catch {
421
- }
422
- return !1;
423
- }
424
- function so(t) {
425
- if (!be || !t || typeof t != "object")
426
- return !1;
427
- try {
428
- be.call(t, be);
429
- try {
430
- _e.call(t, _e);
431
- } catch {
432
- return !0;
433
- }
434
- return t instanceof WeakSet;
435
- } catch {
436
- }
437
- return !1;
438
- }
439
- function uo(t) {
440
- return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
441
- }
442
- function $r(t, e) {
443
- if (t.length > e.maxStringLength) {
444
- var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
445
- return $r(Ot.call(t, 0, e.maxStringLength), e) + n;
446
- }
447
- var o = jn[e.quoteStyle || "single"];
448
- o.lastIndex = 0;
449
- var a = Z.call(Z.call(t, o, "\\$1"), /[\x00-\x1f]/g, fo);
450
- return Er(a, "single", e);
451
- }
452
- function fo(t) {
453
- var e = t.charCodeAt(0), r = {
454
- 8: "b",
455
- 9: "t",
456
- 10: "n",
457
- 12: "f",
458
- 13: "r"
459
- }[e];
460
- return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Kn.call(e.toString(16));
461
- }
462
- function we(t) {
463
- return "Object(" + t + ")";
464
- }
465
- function Ze(t) {
466
- return t + " { ? }";
467
- }
468
- function er(t, e, r, n) {
469
- var o = n ? wt(r, n) : K.call(r, ", ");
470
- return t + " (" + e + ") {" + o + "}";
471
- }
472
- function po(t) {
473
- for (var e = 0; e < t.length; e++)
474
- if (Or(t[e], `
475
- `) >= 0)
476
- return !1;
477
- return !0;
478
- }
479
- function yo(t, e) {
480
- var r;
481
- if (t.indent === " ")
482
- r = " ";
483
- else if (typeof t.indent == "number" && t.indent > 0)
484
- r = K.call(Array(t.indent + 1), " ");
485
- else
486
- return null;
487
- return {
488
- base: r,
489
- prev: K.call(Array(e + 1), r)
490
- };
491
- }
492
- function wt(t, e) {
493
- if (t.length === 0)
494
- return "";
495
- var r = `
496
- ` + e.prev + e.base;
497
- return r + K.call(t, "," + r) + `
498
- ` + e.prev;
499
- }
500
- function Re(t, e) {
501
- var r = St(t), n = [];
502
- if (r) {
503
- n.length = t.length;
504
- for (var o = 0; o < t.length; o++)
505
- n[o] = j(t, o) ? e(t[o], t) : "";
506
- }
507
- var a = typeof Xe == "function" ? Xe(t) : [], i;
508
- if (fe) {
509
- i = {};
510
- for (var c = 0; c < a.length; c++)
511
- i["$" + a[c]] = a[c];
512
- }
513
- for (var s in t)
514
- j(t, s) && (r && String(Number(s)) === s && s < t.length || fe && i["$" + s] instanceof Symbol || (wr.call(/[^\w$]/, s) ? n.push(e(s, t) + ": " + e(t[s], t)) : n.push(s + ": " + e(t[s], t))));
515
- if (typeof Xe == "function")
516
- for (var l = 0; l < a.length; l++)
517
- _r.call(t, a[l]) && n.push("[" + e(a[l]) + "]: " + e(t[a[l]], t));
518
- return n;
519
- }
520
- var vo = He, ho = de, qe = function(t, e, r) {
521
- for (var n = t, o; (o = n.next) != null; n = o)
522
- if (o.key === e)
523
- return n.next = o.next, r || (o.next = /** @type {NonNullable<typeof list.next>} */
524
- t.next, t.next = o), o;
525
- }, mo = function(t, e) {
526
- if (t) {
527
- var r = qe(t, e);
528
- return r && r.value;
529
- }
530
- }, go = function(t, e, r) {
531
- var n = qe(t, e);
532
- n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
533
- {
534
- // eslint-disable-line no-param-reassign, no-extra-parens
535
- key: e,
536
- next: t.next,
537
- value: r
538
- };
539
- }, So = function(t, e) {
540
- return t ? !!qe(t, e) : !1;
541
- }, wo = function(t, e) {
542
- if (t)
543
- return qe(t, e, !0);
544
- }, _o = function() {
545
- var e, r = {
546
- assert: function(n) {
547
- if (!r.has(n))
548
- throw new ho("Side channel does not contain " + vo(n));
549
- },
550
- delete: function(n) {
551
- var o = e && e.next, a = wo(e, n);
552
- return a && o && o === a && (e = void 0), !!a;
553
- },
554
- get: function(n) {
555
- return mo(e, n);
556
- },
557
- has: function(n) {
558
- return So(e, n);
559
- },
560
- set: function(n, o) {
561
- e || (e = {
562
- next: void 0
563
- }), go(
564
- /** @type {NonNullable<typeof $o>} */
565
- e,
566
- n,
567
- o
568
- );
569
- }
570
- };
571
- return r;
572
- }, Pr = Object, bo = Error, Eo = EvalError, Ao = RangeError, Oo = ReferenceError, $o = SyntaxError, Po = URIError, xo = Math.abs, Io = Math.floor, Co = Math.max, Ro = Math.min, Fo = Math.pow, No = Math.round, Do = Number.isNaN || function(e) {
573
- return e !== e;
574
- }, Mo = Do, To = function(e) {
575
- return Mo(e) || e === 0 ? e : e < 0 ? -1 : 1;
576
- }, Lo = Object.getOwnPropertyDescriptor, Me = Lo;
577
- if (Me)
578
- try {
579
- Me([], "length");
580
- } catch {
581
- Me = null;
582
- }
583
- var xr = Me, Te = Object.defineProperty || !1;
584
- if (Te)
585
- try {
586
- Te({}, "a", { value: 1 });
587
- } catch {
588
- Te = !1;
589
- }
590
- var ko = Te, Ye, tr;
591
- function Bo() {
592
- return tr || (tr = 1, Ye = function() {
593
- if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
594
- return !1;
595
- if (typeof Symbol.iterator == "symbol")
596
- return !0;
597
- var e = {}, r = Symbol("test"), n = Object(r);
598
- if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
599
- return !1;
600
- var o = 42;
601
- e[r] = o;
602
- for (var a in e)
603
- return !1;
604
- if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
605
- return !1;
606
- var i = Object.getOwnPropertySymbols(e);
607
- if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
608
- return !1;
609
- if (typeof Object.getOwnPropertyDescriptor == "function") {
610
- var c = (
611
- /** @type {PropertyDescriptor} */
612
- Object.getOwnPropertyDescriptor(e, r)
613
- );
614
- if (c.value !== o || c.enumerable !== !0)
615
- return !1;
616
- }
617
- return !0;
618
- }), Ye;
619
- }
620
- var et, rr;
621
- function Wo() {
622
- if (rr) return et;
623
- rr = 1;
624
- var t = typeof Symbol < "u" && Symbol, e = Bo();
625
- return et = function() {
626
- return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
627
- }, et;
628
- }
629
- var tt, nr;
630
- function Ir() {
631
- return nr || (nr = 1, tt = typeof Reflect < "u" && Reflect.getPrototypeOf || null), tt;
632
- }
633
- var rt, or;
634
- function Cr() {
635
- if (or) return rt;
636
- or = 1;
637
- var t = Pr;
638
- return rt = t.getPrototypeOf || null, rt;
639
- }
640
- var Uo = "Function.prototype.bind called on incompatible ", Go = Object.prototype.toString, Ho = Math.max, qo = "[object Function]", ar = function(e, r) {
641
- for (var n = [], o = 0; o < e.length; o += 1)
642
- n[o] = e[o];
643
- for (var a = 0; a < r.length; a += 1)
644
- n[a + e.length] = r[a];
645
- return n;
646
- }, zo = function(e, r) {
647
- for (var n = [], o = r, a = 0; o < e.length; o += 1, a += 1)
648
- n[a] = e[o];
649
- return n;
650
- }, Vo = function(t, e) {
651
- for (var r = "", n = 0; n < t.length; n += 1)
652
- r += t[n], n + 1 < t.length && (r += e);
653
- return r;
654
- }, Ko = function(e) {
655
- var r = this;
656
- if (typeof r != "function" || Go.apply(r) !== qo)
657
- throw new TypeError(Uo + r);
658
- for (var n = zo(arguments, 1), o, a = function() {
659
- if (this instanceof o) {
660
- var f = r.apply(
661
- this,
662
- ar(n, arguments)
663
- );
664
- return Object(f) === f ? f : this;
665
- }
666
- return r.apply(
667
- e,
668
- ar(n, arguments)
669
- );
670
- }, i = Ho(0, r.length - n.length), c = [], s = 0; s < i; s++)
671
- c[s] = "$" + s;
672
- if (o = Function("binder", "return function (" + Vo(c, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
673
- var l = function() {
674
- };
675
- l.prototype = r.prototype, o.prototype = new l(), l.prototype = null;
676
- }
677
- return o;
678
- }, Qo = Ko, ze = Function.prototype.bind || Qo, $t = Function.prototype.call, nt, ir;
679
- function Rr() {
680
- return ir || (ir = 1, nt = Function.prototype.apply), nt;
681
- }
682
- var jo = typeof Reflect < "u" && Reflect && Reflect.apply, Jo = ze, Xo = Rr(), Zo = $t, Yo = jo, ea = Yo || Jo.call(Zo, Xo), ta = ze, ra = de, na = $t, oa = ea, Fr = function(e) {
683
- if (e.length < 1 || typeof e[0] != "function")
684
- throw new ra("a function is required");
685
- return oa(ta, na, e);
686
- }, ot, lr;
687
- function aa() {
688
- if (lr) return ot;
689
- lr = 1;
690
- var t = Fr, e = xr, r;
691
- try {
692
- r = /** @type {{ __proto__?: typeof Array.prototype }} */
693
- [].__proto__ === Array.prototype;
694
- } catch (i) {
695
- if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
696
- throw i;
697
- }
698
- var n = !!r && e && e(
699
- Object.prototype,
700
- /** @type {keyof typeof Object.prototype} */
701
- "__proto__"
702
- ), o = Object, a = o.getPrototypeOf;
703
- return ot = n && typeof n.get == "function" ? t([n.get]) : typeof a == "function" ? (
704
- /** @type {import('./get')} */
705
- function(c) {
706
- return a(c == null ? c : o(c));
707
- }
708
- ) : !1, ot;
709
- }
710
- var at, cr;
711
- function ia() {
712
- if (cr) return at;
713
- cr = 1;
714
- var t = Ir(), e = Cr(), r = aa();
715
- return at = t ? function(o) {
716
- return t(o);
717
- } : e ? function(o) {
718
- if (!o || typeof o != "object" && typeof o != "function")
719
- throw new TypeError("getProto: not an object");
720
- return e(o);
721
- } : r ? function(o) {
722
- return r(o);
723
- } : null, at;
724
- }
725
- var it, sr;
726
- function la() {
727
- if (sr) return it;
728
- sr = 1;
729
- var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = ze;
730
- return it = r.call(t, e), it;
731
- }
732
- var w, ca = Pr, sa = bo, ua = Eo, fa = Ao, pa = Oo, pe = $o, ue = de, ya = Po, da = xo, va = Io, ha = Co, ma = Ro, ga = Fo, Sa = No, wa = To, Nr = Function, lt = function(t) {
733
- try {
734
- return Nr('"use strict"; return (' + t + ").constructor;")();
735
- } catch {
736
- }
737
- }, Oe = xr, _a = ko, ct = function() {
738
- throw new ue();
739
- }, ba = Oe ? function() {
740
- try {
741
- return arguments.callee, ct;
742
- } catch {
743
- try {
744
- return Oe(arguments, "callee").get;
745
- } catch {
746
- return ct;
747
- }
748
- }
749
- }() : ct, le = Wo()(), D = ia(), Ea = Cr(), Aa = Ir(), Dr = Rr(), $e = $t, se = {}, Oa = typeof Uint8Array > "u" || !D ? w : D(Uint8Array), oe = {
750
- __proto__: null,
751
- "%AggregateError%": typeof AggregateError > "u" ? w : AggregateError,
752
- "%Array%": Array,
753
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? w : ArrayBuffer,
754
- "%ArrayIteratorPrototype%": le && D ? D([][Symbol.iterator]()) : w,
755
- "%AsyncFromSyncIteratorPrototype%": w,
756
- "%AsyncFunction%": se,
757
- "%AsyncGenerator%": se,
758
- "%AsyncGeneratorFunction%": se,
759
- "%AsyncIteratorPrototype%": se,
760
- "%Atomics%": typeof Atomics > "u" ? w : Atomics,
761
- "%BigInt%": typeof BigInt > "u" ? w : BigInt,
762
- "%BigInt64Array%": typeof BigInt64Array > "u" ? w : BigInt64Array,
763
- "%BigUint64Array%": typeof BigUint64Array > "u" ? w : BigUint64Array,
764
- "%Boolean%": Boolean,
765
- "%DataView%": typeof DataView > "u" ? w : DataView,
766
- "%Date%": Date,
767
- "%decodeURI%": decodeURI,
768
- "%decodeURIComponent%": decodeURIComponent,
769
- "%encodeURI%": encodeURI,
770
- "%encodeURIComponent%": encodeURIComponent,
771
- "%Error%": sa,
772
- "%eval%": eval,
773
- // eslint-disable-line no-eval
774
- "%EvalError%": ua,
775
- "%Float16Array%": typeof Float16Array > "u" ? w : Float16Array,
776
- "%Float32Array%": typeof Float32Array > "u" ? w : Float32Array,
777
- "%Float64Array%": typeof Float64Array > "u" ? w : Float64Array,
778
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? w : FinalizationRegistry,
779
- "%Function%": Nr,
780
- "%GeneratorFunction%": se,
781
- "%Int8Array%": typeof Int8Array > "u" ? w : Int8Array,
782
- "%Int16Array%": typeof Int16Array > "u" ? w : Int16Array,
783
- "%Int32Array%": typeof Int32Array > "u" ? w : Int32Array,
784
- "%isFinite%": isFinite,
785
- "%isNaN%": isNaN,
786
- "%IteratorPrototype%": le && D ? D(D([][Symbol.iterator]())) : w,
787
- "%JSON%": typeof JSON == "object" ? JSON : w,
788
- "%Map%": typeof Map > "u" ? w : Map,
789
- "%MapIteratorPrototype%": typeof Map > "u" || !le || !D ? w : D((/* @__PURE__ */ new Map())[Symbol.iterator]()),
790
- "%Math%": Math,
791
- "%Number%": Number,
792
- "%Object%": ca,
793
- "%Object.getOwnPropertyDescriptor%": Oe,
794
- "%parseFloat%": parseFloat,
795
- "%parseInt%": parseInt,
796
- "%Promise%": typeof Promise > "u" ? w : Promise,
797
- "%Proxy%": typeof Proxy > "u" ? w : Proxy,
798
- "%RangeError%": fa,
799
- "%ReferenceError%": pa,
800
- "%Reflect%": typeof Reflect > "u" ? w : Reflect,
801
- "%RegExp%": RegExp,
802
- "%Set%": typeof Set > "u" ? w : Set,
803
- "%SetIteratorPrototype%": typeof Set > "u" || !le || !D ? w : D((/* @__PURE__ */ new Set())[Symbol.iterator]()),
804
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? w : SharedArrayBuffer,
805
- "%String%": String,
806
- "%StringIteratorPrototype%": le && D ? D(""[Symbol.iterator]()) : w,
807
- "%Symbol%": le ? Symbol : w,
808
- "%SyntaxError%": pe,
809
- "%ThrowTypeError%": ba,
810
- "%TypedArray%": Oa,
811
- "%TypeError%": ue,
812
- "%Uint8Array%": typeof Uint8Array > "u" ? w : Uint8Array,
813
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? w : Uint8ClampedArray,
814
- "%Uint16Array%": typeof Uint16Array > "u" ? w : Uint16Array,
815
- "%Uint32Array%": typeof Uint32Array > "u" ? w : Uint32Array,
816
- "%URIError%": ya,
817
- "%WeakMap%": typeof WeakMap > "u" ? w : WeakMap,
818
- "%WeakRef%": typeof WeakRef > "u" ? w : WeakRef,
819
- "%WeakSet%": typeof WeakSet > "u" ? w : WeakSet,
820
- "%Function.prototype.call%": $e,
821
- "%Function.prototype.apply%": Dr,
822
- "%Object.defineProperty%": _a,
823
- "%Object.getPrototypeOf%": Ea,
824
- "%Math.abs%": da,
825
- "%Math.floor%": va,
826
- "%Math.max%": ha,
827
- "%Math.min%": ma,
828
- "%Math.pow%": ga,
829
- "%Math.round%": Sa,
830
- "%Math.sign%": wa,
831
- "%Reflect.getPrototypeOf%": Aa
832
- };
833
- if (D)
834
- try {
835
- null.error;
836
- } catch (t) {
837
- var $a = D(D(t));
838
- oe["%Error.prototype%"] = $a;
839
- }
840
- var Pa = function t(e) {
841
- var r;
842
- if (e === "%AsyncFunction%")
843
- r = lt("async function () {}");
844
- else if (e === "%GeneratorFunction%")
845
- r = lt("function* () {}");
846
- else if (e === "%AsyncGeneratorFunction%")
847
- r = lt("async function* () {}");
848
- else if (e === "%AsyncGenerator%") {
849
- var n = t("%AsyncGeneratorFunction%");
850
- n && (r = n.prototype);
851
- } else if (e === "%AsyncIteratorPrototype%") {
852
- var o = t("%AsyncGenerator%");
853
- o && D && (r = D(o.prototype));
854
- }
855
- return oe[e] = r, r;
856
- }, ur = {
857
- __proto__: null,
858
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
859
- "%ArrayPrototype%": ["Array", "prototype"],
860
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
861
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
862
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
863
- "%ArrayProto_values%": ["Array", "prototype", "values"],
864
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
865
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
866
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
867
- "%BooleanPrototype%": ["Boolean", "prototype"],
868
- "%DataViewPrototype%": ["DataView", "prototype"],
869
- "%DatePrototype%": ["Date", "prototype"],
870
- "%ErrorPrototype%": ["Error", "prototype"],
871
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
872
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
873
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
874
- "%FunctionPrototype%": ["Function", "prototype"],
875
- "%Generator%": ["GeneratorFunction", "prototype"],
876
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
877
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
878
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
879
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
880
- "%JSONParse%": ["JSON", "parse"],
881
- "%JSONStringify%": ["JSON", "stringify"],
882
- "%MapPrototype%": ["Map", "prototype"],
883
- "%NumberPrototype%": ["Number", "prototype"],
884
- "%ObjectPrototype%": ["Object", "prototype"],
885
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
886
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
887
- "%PromisePrototype%": ["Promise", "prototype"],
888
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
889
- "%Promise_all%": ["Promise", "all"],
890
- "%Promise_reject%": ["Promise", "reject"],
891
- "%Promise_resolve%": ["Promise", "resolve"],
892
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
893
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
894
- "%RegExpPrototype%": ["RegExp", "prototype"],
895
- "%SetPrototype%": ["Set", "prototype"],
896
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
897
- "%StringPrototype%": ["String", "prototype"],
898
- "%SymbolPrototype%": ["Symbol", "prototype"],
899
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
900
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
901
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
902
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
903
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
904
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
905
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
906
- "%URIErrorPrototype%": ["URIError", "prototype"],
907
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
908
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
909
- }, Pe = ze, We = la(), xa = Pe.call($e, Array.prototype.concat), Ia = Pe.call(Dr, Array.prototype.splice), fr = Pe.call($e, String.prototype.replace), Ue = Pe.call($e, String.prototype.slice), Ca = Pe.call($e, RegExp.prototype.exec), Ra = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Fa = /\\(\\)?/g, Na = function(e) {
910
- var r = Ue(e, 0, 1), n = Ue(e, -1);
911
- if (r === "%" && n !== "%")
912
- throw new pe("invalid intrinsic syntax, expected closing `%`");
913
- if (n === "%" && r !== "%")
914
- throw new pe("invalid intrinsic syntax, expected opening `%`");
915
- var o = [];
916
- return fr(e, Ra, function(a, i, c, s) {
917
- o[o.length] = c ? fr(s, Fa, "$1") : i || a;
918
- }), o;
919
- }, Da = function(e, r) {
920
- var n = e, o;
921
- if (We(ur, n) && (o = ur[n], n = "%" + o[0] + "%"), We(oe, n)) {
922
- var a = oe[n];
923
- if (a === se && (a = Pa(n)), typeof a > "u" && !r)
924
- throw new ue("intrinsic " + e + " exists, but is not available. Please file an issue!");
925
- return {
926
- alias: o,
927
- name: n,
928
- value: a
929
- };
930
- }
931
- throw new pe("intrinsic " + e + " does not exist!");
932
- }, Pt = function(e, r) {
933
- if (typeof e != "string" || e.length === 0)
934
- throw new ue("intrinsic name must be a non-empty string");
935
- if (arguments.length > 1 && typeof r != "boolean")
936
- throw new ue('"allowMissing" argument must be a boolean');
937
- if (Ca(/^%?[^%]*%?$/, e) === null)
938
- throw new pe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
939
- var n = Na(e), o = n.length > 0 ? n[0] : "", a = Da("%" + o + "%", r), i = a.name, c = a.value, s = !1, l = a.alias;
940
- l && (o = l[0], Ia(n, xa([0, 1], l)));
941
- for (var f = 1, p = !0; f < n.length; f += 1) {
942
- var u = n[f], y = Ue(u, 0, 1), v = Ue(u, -1);
943
- if ((y === '"' || y === "'" || y === "`" || v === '"' || v === "'" || v === "`") && y !== v)
944
- throw new pe("property names with quotes must have matching quotes");
945
- if ((u === "constructor" || !p) && (s = !0), o += "." + u, i = "%" + o + "%", We(oe, i))
946
- c = oe[i];
947
- else if (c != null) {
948
- if (!(u in c)) {
949
- if (!r)
950
- throw new ue("base intrinsic for " + e + " exists, but the property is not available.");
951
- return;
952
- }
953
- if (Oe && f + 1 >= n.length) {
954
- var g = Oe(c, u);
955
- p = !!g, p && "get" in g && !("originalValue" in g.get) ? c = g.get : c = c[u];
956
- } else
957
- p = We(c, u), c = c[u];
958
- p && !s && (oe[i] = c);
959
- }
960
- }
961
- return c;
962
- }, Mr = Pt, Tr = Fr, Ma = Tr([Mr("%String.prototype.indexOf%")]), Lr = function(e, r) {
963
- var n = (
964
- /** @type {(this: unknown, ...args: unknown[]) => unknown} */
965
- Mr(e, !!r)
966
- );
967
- return typeof n == "function" && Ma(e, ".prototype.") > -1 ? Tr(
968
- /** @type {const} */
969
- [n]
970
- ) : n;
971
- }, Ta = Pt, xe = Lr, La = He, ka = de, pr = Ta("%Map%", !0), Ba = xe("Map.prototype.get", !0), Wa = xe("Map.prototype.set", !0), Ua = xe("Map.prototype.has", !0), Ga = xe("Map.prototype.delete", !0), Ha = xe("Map.prototype.size", !0), kr = !!pr && /** @type {Exclude<import('.'), false>} */
972
- function() {
973
- var e, r = {
974
- assert: function(n) {
975
- if (!r.has(n))
976
- throw new ka("Side channel does not contain " + La(n));
977
- },
978
- delete: function(n) {
979
- if (e) {
980
- var o = Ga(e, n);
981
- return Ha(e) === 0 && (e = void 0), o;
982
- }
983
- return !1;
984
- },
985
- get: function(n) {
986
- if (e)
987
- return Ba(e, n);
988
- },
989
- has: function(n) {
990
- return e ? Ua(e, n) : !1;
991
- },
992
- set: function(n, o) {
993
- e || (e = new pr()), Wa(e, n, o);
994
- }
995
- };
996
- return r;
997
- }, qa = Pt, Ve = Lr, za = He, Fe = kr, Va = de, ce = qa("%WeakMap%", !0), Ka = Ve("WeakMap.prototype.get", !0), Qa = Ve("WeakMap.prototype.set", !0), ja = Ve("WeakMap.prototype.has", !0), Ja = Ve("WeakMap.prototype.delete", !0), Xa = ce ? (
998
- /** @type {Exclude<import('.'), false>} */
999
- function() {
1000
- var e, r, n = {
1001
- assert: function(o) {
1002
- if (!n.has(o))
1003
- throw new Va("Side channel does not contain " + za(o));
1004
- },
1005
- delete: function(o) {
1006
- if (ce && o && (typeof o == "object" || typeof o == "function")) {
1007
- if (e)
1008
- return Ja(e, o);
1009
- } else if (Fe && r)
1010
- return r.delete(o);
1011
- return !1;
1012
- },
1013
- get: function(o) {
1014
- return ce && o && (typeof o == "object" || typeof o == "function") && e ? Ka(e, o) : r && r.get(o);
1015
- },
1016
- has: function(o) {
1017
- return ce && o && (typeof o == "object" || typeof o == "function") && e ? ja(e, o) : !!r && r.has(o);
1018
- },
1019
- set: function(o, a) {
1020
- ce && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new ce()), Qa(e, o, a)) : Fe && (r || (r = Fe()), r.set(o, a));
1021
- }
1022
- };
1023
- return n;
1024
- }
1025
- ) : Fe, Za = de, Ya = He, ei = _o, ti = kr, ri = Xa, ni = ri || ti || ei, oi = function() {
1026
- var e, r = {
1027
- assert: function(n) {
1028
- if (!r.has(n))
1029
- throw new Za("Side channel does not contain " + Ya(n));
1030
- },
1031
- delete: function(n) {
1032
- return !!e && e.delete(n);
1033
- },
1034
- get: function(n) {
1035
- return e && e.get(n);
1036
- },
1037
- has: function(n) {
1038
- return !!e && e.has(n);
1039
- },
1040
- set: function(n, o) {
1041
- e || (e = ni()), e.set(n, o);
1042
- }
1043
- };
1044
- return r;
1045
- }, ai = String.prototype.replace, ii = /%20/g, st = {
1046
- RFC1738: "RFC1738",
1047
- RFC3986: "RFC3986"
1048
- }, xt = {
1049
- default: st.RFC3986,
1050
- formatters: {
1051
- RFC1738: function(t) {
1052
- return ai.call(t, ii, "+");
1053
- },
1054
- RFC3986: function(t) {
1055
- return String(t);
1056
- }
1057
- },
1058
- RFC1738: st.RFC1738,
1059
- RFC3986: st.RFC3986
1060
- }, li = xt, ut = Object.prototype.hasOwnProperty, re = Array.isArray, z = function() {
1061
- for (var t = [], e = 0; e < 256; ++e)
1062
- t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
1063
- return t;
1064
- }(), ci = function(e) {
1065
- for (; e.length > 1; ) {
1066
- var r = e.pop(), n = r.obj[r.prop];
1067
- if (re(n)) {
1068
- for (var o = [], a = 0; a < n.length; ++a)
1069
- typeof n[a] < "u" && o.push(n[a]);
1070
- r.obj[r.prop] = o;
1071
- }
1072
- }
1073
- }, Br = function(e, r) {
1074
- for (var n = r && r.plainObjects ? { __proto__: null } : {}, o = 0; o < e.length; ++o)
1075
- typeof e[o] < "u" && (n[o] = e[o]);
1076
- return n;
1077
- }, si = function t(e, r, n) {
1078
- if (!r)
1079
- return e;
1080
- if (typeof r != "object" && typeof r != "function") {
1081
- if (re(e))
1082
- e.push(r);
1083
- else if (e && typeof e == "object")
1084
- (n && (n.plainObjects || n.allowPrototypes) || !ut.call(Object.prototype, r)) && (e[r] = !0);
1085
- else
1086
- return [e, r];
1087
- return e;
1088
- }
1089
- if (!e || typeof e != "object")
1090
- return [e].concat(r);
1091
- var o = e;
1092
- return re(e) && !re(r) && (o = Br(e, n)), re(e) && re(r) ? (r.forEach(function(a, i) {
1093
- if (ut.call(e, i)) {
1094
- var c = e[i];
1095
- c && typeof c == "object" && a && typeof a == "object" ? e[i] = t(c, a, n) : e.push(a);
1096
- } else
1097
- e[i] = a;
1098
- }), e) : Object.keys(r).reduce(function(a, i) {
1099
- var c = r[i];
1100
- return ut.call(a, i) ? a[i] = t(a[i], c, n) : a[i] = c, a;
1101
- }, o);
1102
- }, ui = function(e, r) {
1103
- return Object.keys(r).reduce(function(n, o) {
1104
- return n[o] = r[o], n;
1105
- }, e);
1106
- }, fi = function(t, e, r) {
1107
- var n = t.replace(/\+/g, " ");
1108
- if (r === "iso-8859-1")
1109
- return n.replace(/%[0-9a-f]{2}/gi, unescape);
1110
- try {
1111
- return decodeURIComponent(n);
1112
- } catch {
1113
- return n;
1114
- }
1115
- }, ft = 1024, pi = function(e, r, n, o, a) {
1116
- if (e.length === 0)
1117
- return e;
1118
- var i = e;
1119
- if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
1120
- return escape(i).replace(/%u[0-9a-f]{4}/gi, function(y) {
1121
- return "%26%23" + parseInt(y.slice(2), 16) + "%3B";
1122
- });
1123
- for (var c = "", s = 0; s < i.length; s += ft) {
1124
- for (var l = i.length >= ft ? i.slice(s, s + ft) : i, f = [], p = 0; p < l.length; ++p) {
1125
- var u = l.charCodeAt(p);
1126
- if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || a === li.RFC1738 && (u === 40 || u === 41)) {
1127
- f[f.length] = l.charAt(p);
1128
- continue;
1129
- }
1130
- if (u < 128) {
1131
- f[f.length] = z[u];
1132
- continue;
1133
- }
1134
- if (u < 2048) {
1135
- f[f.length] = z[192 | u >> 6] + z[128 | u & 63];
1136
- continue;
1137
- }
1138
- if (u < 55296 || u >= 57344) {
1139
- f[f.length] = z[224 | u >> 12] + z[128 | u >> 6 & 63] + z[128 | u & 63];
1140
- continue;
1141
- }
1142
- p += 1, u = 65536 + ((u & 1023) << 10 | l.charCodeAt(p) & 1023), f[f.length] = z[240 | u >> 18] + z[128 | u >> 12 & 63] + z[128 | u >> 6 & 63] + z[128 | u & 63];
1143
- }
1144
- c += f.join("");
1145
- }
1146
- return c;
1147
- }, yi = function(e) {
1148
- for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o)
1149
- for (var a = r[o], i = a.obj[a.prop], c = Object.keys(i), s = 0; s < c.length; ++s) {
1150
- var l = c[s], f = i[l];
1151
- typeof f == "object" && f !== null && n.indexOf(f) === -1 && (r.push({ obj: i, prop: l }), n.push(f));
1152
- }
1153
- return ci(r), e;
1154
- }, di = function(e) {
1155
- return Object.prototype.toString.call(e) === "[object RegExp]";
1156
- }, vi = function(e) {
1157
- return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
1158
- }, hi = function(e, r) {
1159
- return [].concat(e, r);
1160
- }, mi = function(e, r) {
1161
- if (re(e)) {
1162
- for (var n = [], o = 0; o < e.length; o += 1)
1163
- n.push(r(e[o]));
1164
- return n;
1165
- }
1166
- return r(e);
1167
- }, Wr = {
1168
- arrayToObject: Br,
1169
- assign: ui,
1170
- combine: hi,
1171
- compact: yi,
1172
- decode: fi,
1173
- encode: pi,
1174
- isBuffer: vi,
1175
- isRegExp: di,
1176
- maybeMap: mi,
1177
- merge: si
1178
- }, Ur = oi, Le = Wr, Ae = xt, gi = Object.prototype.hasOwnProperty, Gr = {
1179
- brackets: function(e) {
1180
- return e + "[]";
1181
- },
1182
- comma: "comma",
1183
- indices: function(e, r) {
1184
- return e + "[" + r + "]";
1185
- },
1186
- repeat: function(e) {
1187
- return e;
1188
- }
1189
- }, V = Array.isArray, Si = Array.prototype.push, Hr = function(t, e) {
1190
- Si.apply(t, V(e) ? e : [e]);
1191
- }, wi = Date.prototype.toISOString, yr = Ae.default, R = {
1192
- addQueryPrefix: !1,
1193
- allowDots: !1,
1194
- allowEmptyArrays: !1,
1195
- arrayFormat: "indices",
1196
- charset: "utf-8",
1197
- charsetSentinel: !1,
1198
- commaRoundTrip: !1,
1199
- delimiter: "&",
1200
- encode: !0,
1201
- encodeDotInKeys: !1,
1202
- encoder: Le.encode,
1203
- encodeValuesOnly: !1,
1204
- filter: void 0,
1205
- format: yr,
1206
- formatter: Ae.formatters[yr],
1207
- // deprecated
1208
- indices: !1,
1209
- serializeDate: function(e) {
1210
- return wi.call(e);
1211
- },
1212
- skipNulls: !1,
1213
- strictNullHandling: !1
1214
- }, _i = function(e) {
1215
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
1216
- }, pt = {}, bi = function t(e, r, n, o, a, i, c, s, l, f, p, u, y, v, g, h, S, b) {
1217
- for (var d = e, I = b, O = 0, _ = !1; (I = I.get(pt)) !== void 0 && !_; ) {
1218
- var x = I.get(e);
1219
- if (O += 1, typeof x < "u") {
1220
- if (x === O)
1221
- throw new RangeError("Cyclic object value");
1222
- _ = !0;
1223
- }
1224
- typeof I.get(pt) > "u" && (O = 0);
1225
- }
1226
- if (typeof f == "function" ? d = f(r, d) : d instanceof Date ? d = y(d) : n === "comma" && V(d) && (d = Le.maybeMap(d, function(ve) {
1227
- return ve instanceof Date ? y(ve) : ve;
1228
- })), d === null) {
1229
- if (i)
1230
- return l && !h ? l(r, R.encoder, S, "key", v) : r;
1231
- d = "";
1232
- }
1233
- if (_i(d) || Le.isBuffer(d)) {
1234
- if (l) {
1235
- var U = h ? r : l(r, R.encoder, S, "key", v);
1236
- return [g(U) + "=" + g(l(d, R.encoder, S, "value", v))];
1237
- }
1238
- return [g(r) + "=" + g(String(d))];
1239
- }
1240
- var F = [];
1241
- if (typeof d > "u")
1242
- return F;
1243
- var C;
1244
- if (n === "comma" && V(d))
1245
- h && l && (d = Le.maybeMap(d, l)), C = [{ value: d.length > 0 ? d.join(",") || null : void 0 }];
1246
- else if (V(f))
1247
- C = f;
1248
- else {
1249
- var G = Object.keys(d);
1250
- C = p ? G.sort(p) : G;
1251
- }
1252
- var B = s ? String(r).replace(/\./g, "%2E") : String(r), m = o && V(d) && d.length === 1 ? B + "[]" : B;
1253
- if (a && V(d) && d.length === 0)
1254
- return m + "[]";
1255
- for (var A = 0; A < C.length; ++A) {
1256
- var H = C[A], Q = typeof H == "object" && H && typeof H.value < "u" ? H.value : d[H];
1257
- if (!(c && Q === null)) {
1258
- var ee = u && s ? String(H).replace(/\./g, "%2E") : String(H), Qe = V(d) ? typeof n == "function" ? n(m, ee) : m : m + (u ? "." + ee : "[" + ee + "]");
1259
- b.set(e, O);
1260
- var Ie = Ur();
1261
- Ie.set(pt, b), Hr(F, t(
1262
- Q,
1263
- Qe,
1264
- n,
1265
- o,
1266
- a,
1267
- i,
1268
- c,
1269
- s,
1270
- n === "comma" && h && V(d) ? null : l,
1271
- f,
1272
- p,
1273
- u,
1274
- y,
1275
- v,
1276
- g,
1277
- h,
1278
- S,
1279
- Ie
1280
- ));
1281
- }
1282
- }
1283
- return F;
1284
- }, Ei = function(e) {
1285
- if (!e)
1286
- return R;
1287
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1288
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1289
- if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
1290
- throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1291
- if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
1292
- throw new TypeError("Encoder has to be a function.");
1293
- var r = e.charset || R.charset;
1294
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1295
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1296
- var n = Ae.default;
1297
- if (typeof e.format < "u") {
1298
- if (!gi.call(Ae.formatters, e.format))
1299
- throw new TypeError("Unknown format option provided.");
1300
- n = e.format;
1301
- }
1302
- var o = Ae.formatters[n], a = R.filter;
1303
- (typeof e.filter == "function" || V(e.filter)) && (a = e.filter);
1304
- var i;
1305
- if (e.arrayFormat in Gr ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = R.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
1306
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1307
- var c = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : R.allowDots : !!e.allowDots;
1308
- return {
1309
- addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : R.addQueryPrefix,
1310
- allowDots: c,
1311
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : R.allowEmptyArrays,
1312
- arrayFormat: i,
1313
- charset: r,
1314
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : R.charsetSentinel,
1315
- commaRoundTrip: !!e.commaRoundTrip,
1316
- delimiter: typeof e.delimiter > "u" ? R.delimiter : e.delimiter,
1317
- encode: typeof e.encode == "boolean" ? e.encode : R.encode,
1318
- encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : R.encodeDotInKeys,
1319
- encoder: typeof e.encoder == "function" ? e.encoder : R.encoder,
1320
- encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : R.encodeValuesOnly,
1321
- filter: a,
1322
- format: n,
1323
- formatter: o,
1324
- serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : R.serializeDate,
1325
- skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : R.skipNulls,
1326
- sort: typeof e.sort == "function" ? e.sort : null,
1327
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : R.strictNullHandling
1328
- };
1329
- }, Ai = function(t, e) {
1330
- var r = t, n = Ei(e), o, a;
1331
- typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : V(n.filter) && (a = n.filter, o = a);
1332
- var i = [];
1333
- if (typeof r != "object" || r === null)
1334
- return "";
1335
- var c = Gr[n.arrayFormat], s = c === "comma" && n.commaRoundTrip;
1336
- o || (o = Object.keys(r)), n.sort && o.sort(n.sort);
1337
- for (var l = Ur(), f = 0; f < o.length; ++f) {
1338
- var p = o[f], u = r[p];
1339
- n.skipNulls && u === null || Hr(i, bi(
1340
- u,
1341
- p,
1342
- c,
1343
- s,
1344
- n.allowEmptyArrays,
1345
- n.strictNullHandling,
1346
- n.skipNulls,
1347
- n.encodeDotInKeys,
1348
- n.encode ? n.encoder : null,
1349
- n.filter,
1350
- n.sort,
1351
- n.allowDots,
1352
- n.serializeDate,
1353
- n.format,
1354
- n.formatter,
1355
- n.encodeValuesOnly,
1356
- n.charset,
1357
- l
1358
- ));
1359
- }
1360
- var y = i.join(n.delimiter), v = n.addQueryPrefix === !0 ? "?" : "";
1361
- return n.charsetSentinel && (n.charset === "iso-8859-1" ? v += "utf8=%26%2310003%3B&" : v += "utf8=%E2%9C%93&"), y.length > 0 ? v + y : "";
1362
- }, ae = Wr, _t = Object.prototype.hasOwnProperty, dr = Array.isArray, P = {
1363
- allowDots: !1,
1364
- allowEmptyArrays: !1,
1365
- allowPrototypes: !1,
1366
- allowSparse: !1,
1367
- arrayLimit: 20,
1368
- charset: "utf-8",
1369
- charsetSentinel: !1,
1370
- comma: !1,
1371
- decodeDotInKeys: !1,
1372
- decoder: ae.decode,
1373
- delimiter: "&",
1374
- depth: 5,
1375
- duplicates: "combine",
1376
- ignoreQueryPrefix: !1,
1377
- interpretNumericEntities: !1,
1378
- parameterLimit: 1e3,
1379
- parseArrays: !0,
1380
- plainObjects: !1,
1381
- strictDepth: !1,
1382
- strictNullHandling: !1,
1383
- throwOnLimitExceeded: !1
1384
- }, Oi = function(t) {
1385
- return t.replace(/&#(\d+);/g, function(e, r) {
1386
- return String.fromCharCode(parseInt(r, 10));
1387
- });
1388
- }, qr = function(t, e, r) {
1389
- if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
1390
- return t.split(",");
1391
- if (e.throwOnLimitExceeded && r >= e.arrayLimit)
1392
- throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1393
- return t;
1394
- }, $i = "utf8=%26%2310003%3B", Pi = "utf8=%E2%9C%93", xi = function(e, r) {
1395
- var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
1396
- o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1397
- var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(
1398
- r.delimiter,
1399
- r.throwOnLimitExceeded ? a + 1 : a
1400
- );
1401
- if (r.throwOnLimitExceeded && i.length > a)
1402
- throw new RangeError("Parameter limit exceeded. Only " + a + " parameter" + (a === 1 ? "" : "s") + " allowed.");
1403
- var c = -1, s, l = r.charset;
1404
- if (r.charsetSentinel)
1405
- for (s = 0; s < i.length; ++s)
1406
- i[s].indexOf("utf8=") === 0 && (i[s] === Pi ? l = "utf-8" : i[s] === $i && (l = "iso-8859-1"), c = s, s = i.length);
1407
- for (s = 0; s < i.length; ++s)
1408
- if (s !== c) {
1409
- var f = i[s], p = f.indexOf("]="), u = p === -1 ? f.indexOf("=") : p + 1, y, v;
1410
- u === -1 ? (y = r.decoder(f, P.decoder, l, "key"), v = r.strictNullHandling ? null : "") : (y = r.decoder(f.slice(0, u), P.decoder, l, "key"), v = ae.maybeMap(
1411
- qr(
1412
- f.slice(u + 1),
1413
- r,
1414
- dr(n[y]) ? n[y].length : 0
1415
- ),
1416
- function(h) {
1417
- return r.decoder(h, P.decoder, l, "value");
1418
- }
1419
- )), v && r.interpretNumericEntities && l === "iso-8859-1" && (v = Oi(String(v))), f.indexOf("[]=") > -1 && (v = dr(v) ? [v] : v);
1420
- var g = _t.call(n, y);
1421
- g && r.duplicates === "combine" ? n[y] = ae.combine(n[y], v) : (!g || r.duplicates === "last") && (n[y] = v);
1422
- }
1423
- return n;
1424
- }, Ii = function(t, e, r, n) {
1425
- var o = 0;
1426
- if (t.length > 0 && t[t.length - 1] === "[]") {
1427
- var a = t.slice(0, -1).join("");
1428
- o = Array.isArray(e) && e[a] ? e[a].length : 0;
1429
- }
1430
- for (var i = n ? e : qr(e, r, o), c = t.length - 1; c >= 0; --c) {
1431
- var s, l = t[c];
1432
- if (l === "[]" && r.parseArrays)
1433
- s = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : ae.combine([], i);
1434
- else {
1435
- s = r.plainObjects ? { __proto__: null } : {};
1436
- var f = l.charAt(0) === "[" && l.charAt(l.length - 1) === "]" ? l.slice(1, -1) : l, p = r.decodeDotInKeys ? f.replace(/%2E/g, ".") : f, u = parseInt(p, 10);
1437
- !r.parseArrays && p === "" ? s = { 0: i } : !isNaN(u) && l !== p && String(u) === p && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (s = [], s[u] = i) : p !== "__proto__" && (s[p] = i);
1438
- }
1439
- i = s;
1440
- }
1441
- return i;
1442
- }, Ci = function(e, r, n, o) {
1443
- if (e) {
1444
- var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, c = /(\[[^[\]]*])/g, s = n.depth > 0 && i.exec(a), l = s ? a.slice(0, s.index) : a, f = [];
1445
- if (l) {
1446
- if (!n.plainObjects && _t.call(Object.prototype, l) && !n.allowPrototypes)
1447
- return;
1448
- f.push(l);
1449
- }
1450
- for (var p = 0; n.depth > 0 && (s = c.exec(a)) !== null && p < n.depth; ) {
1451
- if (p += 1, !n.plainObjects && _t.call(Object.prototype, s[1].slice(1, -1)) && !n.allowPrototypes)
1452
- return;
1453
- f.push(s[1]);
1454
- }
1455
- if (s) {
1456
- if (n.strictDepth === !0)
1457
- throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true");
1458
- f.push("[" + a.slice(s.index) + "]");
1459
- }
1460
- return Ii(f, r, n, o);
1461
- }
1462
- }, Ri = function(e) {
1463
- if (!e)
1464
- return P;
1465
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1466
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1467
- if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
1468
- throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1469
- if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
1470
- throw new TypeError("Decoder has to be a function.");
1471
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1472
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1473
- if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
1474
- throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1475
- var r = typeof e.charset > "u" ? P.charset : e.charset, n = typeof e.duplicates > "u" ? P.duplicates : e.duplicates;
1476
- if (n !== "combine" && n !== "first" && n !== "last")
1477
- throw new TypeError("The duplicates option must be either combine, first, or last");
1478
- var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : P.allowDots : !!e.allowDots;
1479
- return {
1480
- allowDots: o,
1481
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : P.allowEmptyArrays,
1482
- allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : P.allowPrototypes,
1483
- allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : P.allowSparse,
1484
- arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : P.arrayLimit,
1485
- charset: r,
1486
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : P.charsetSentinel,
1487
- comma: typeof e.comma == "boolean" ? e.comma : P.comma,
1488
- decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : P.decodeDotInKeys,
1489
- decoder: typeof e.decoder == "function" ? e.decoder : P.decoder,
1490
- delimiter: typeof e.delimiter == "string" || ae.isRegExp(e.delimiter) ? e.delimiter : P.delimiter,
1491
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1492
- depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : P.depth,
1493
- duplicates: n,
1494
- ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
1495
- interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : P.interpretNumericEntities,
1496
- parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : P.parameterLimit,
1497
- parseArrays: e.parseArrays !== !1,
1498
- plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : P.plainObjects,
1499
- strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : P.strictDepth,
1500
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : P.strictNullHandling,
1501
- throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
1502
- };
1503
- }, Fi = function(t, e) {
1504
- var r = Ri(e);
1505
- if (t === "" || t === null || typeof t > "u")
1506
- return r.plainObjects ? { __proto__: null } : {};
1507
- for (var n = typeof t == "string" ? xi(t, r) : t, o = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
1508
- var c = a[i], s = Ci(c, n[c], r, typeof t == "string");
1509
- o = ae.merge(o, s, r);
1510
- }
1511
- return r.allowSparse === !0 ? o : ae.compact(o);
1512
- }, Ni = Ai, Di = Fi, Mi = xt, Ti = {
1513
- formats: Mi,
1514
- parse: Di,
1515
- stringify: Ni
1516
- };
1517
- const Li = /* @__PURE__ */ bn(Ti);
1518
- var zr = {};
1519
- Object.defineProperty(zr, "__esModule", { value: !0 });
1520
- var ki = zr.useGeolocated = Bi;
1521
- const M = yt;
1522
- function Bi(t = {}) {
1523
- const { positionOptions: e = {
1524
- enableHighAccuracy: !0,
1525
- maximumAge: 0,
1526
- timeout: 1 / 0
1527
- }, isOptimisticGeolocationEnabled: r = !0, userDecisionTimeout: n = void 0, suppressLocationOnMount: o = !1, watchPosition: a = !1, geolocationProvider: i = typeof navigator < "u" ? navigator.geolocation : void 0, watchLocationPermissionChange: c = !1, onError: s, onSuccess: l } = t, f = (0, M.useRef)(0), p = (0, M.useRef)(!0), u = (0, M.useRef)(0), [y, v] = (0, M.useState)(r), [g, h] = (0, M.useState)(), [S, b] = (0, M.useState)(), [d, I] = (0, M.useState)(), [O, _] = (0, M.useState)(), x = (0, M.useCallback)((m, A) => m === A ? !0 : !m || !A ? !1 : m.accuracy === A.accuracy && m.altitude === A.altitude && m.altitudeAccuracy === A.altitudeAccuracy && m.heading === A.heading && m.latitude === A.latitude && m.longitude === A.longitude && m.speed === A.speed, []), U = (0, M.useCallback)((m) => {
1528
- h((A) => x(A, m) ? A : m);
1529
- }, [x]), F = (0, M.useCallback)(() => {
1530
- f.current && window.clearTimeout(f.current);
1531
- }, []), C = (0, M.useCallback)((m) => {
1532
- F(), p.current && (h(() => {
1533
- }), v(!1), I(m)), s == null || s(m);
1534
- }, [s, F]), G = (0, M.useCallback)((m) => {
1535
- F(), p.current && (U(m.coords), b(m.timestamp), v(!0), I(() => {
1536
- })), l == null || l(m);
1537
- }, [l, F, U]), B = (0, M.useCallback)(() => {
1538
- if (!(i != null && i.getCurrentPosition) || // we really want to check if the watchPosition is available
1539
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1540
- !i.watchPosition)
1541
- throw new Error("The provided geolocation provider is invalid");
1542
- n && O !== "granted" && (f.current = window.setTimeout(() => {
1543
- C();
1544
- }, n)), a ? u.current = i.watchPosition(G, C, e) : i.getCurrentPosition(G, C, e);
1545
- }, [
1546
- i,
1547
- a,
1548
- n,
1549
- C,
1550
- G,
1551
- e,
1552
- O
1553
- ]);
1554
- return (0, M.useEffect)(() => {
1555
- let m;
1556
- return c && i && "permissions" in navigator && navigator.permissions.query({ name: "geolocation" }).then((A) => {
1557
- m = A, m.onchange = () => {
1558
- m && _(m.state);
1559
- };
1560
- }).catch((A) => {
1561
- console.error("Error updating the permissions", A);
1562
- }), () => {
1563
- m && (m.onchange = null);
1564
- };
1565
- }, []), (0, M.useEffect)(() => (o || B(), () => {
1566
- F(), a && u.current && (i == null || i.clearWatch(u.current));
1567
- }), [O]), {
1568
- getPosition: B,
1569
- coords: g,
1570
- timestamp: S,
1571
- isGeolocationEnabled: y,
1572
- isGeolocationAvailable: !!i,
1573
- positionError: d
1574
- };
1575
- }
1576
- const Wi = "https://maps.googleapis.com/maps/api/geocode";
1577
- let Vr = {
1578
- outputFormat: "json"
1579
- /* JSON */
1580
- };
1581
- async function Ui(t) {
1582
- const { outputFormat: e, ...r } = t, n = new URLSearchParams(
1583
- r
1584
- ).toString(), o = `${Wi}/${e}?${n}`;
1585
- try {
1586
- const a = await (await fetch(o)).json(), { status: i, error_message: c } = a;
1587
- if (i === "OK")
1588
- return a;
1589
- throw new Error(
1590
- `Geocoding failed: ${c}. Server returned status code ${i}.`
1591
- );
1592
- } catch (a) {
1593
- throw a instanceof Error ? new Error(`Geocoding request failed: ${a.message}`) : new Error(`Geocoding request failed with unknown error: ${a}`);
1594
- }
1595
- }
1596
- function Gi(t) {
1597
- Vr.key = t;
1598
- }
1599
- function Hi(t, e, r) {
1600
- if (typeof e != "string")
1601
- throw new Error(
1602
- `Both requestType and value are required and must be of type string.
1603
- requestType: ${typeof t}, value: ${typeof e}`
1604
- );
1605
- const n = {
1606
- ...Vr,
1607
- ...r,
1608
- [t]: e
1609
- };
1610
- return Ui(n);
1611
- }
1612
- function vr(t, e, r, n, o, a) {
1613
- const i = {
1614
- outputFormat: "json"
1615
- /* JSON */
1616
- };
1617
- return r && (i.key = r), n && (i.language = n), o && (i.region = o), a && (i.location_type = a), Hi("latlng", `${t},${e}`, i);
1618
- }
1619
- const qi = () => {
1620
- const t = [
1621
- "country",
1622
- "province",
1623
- "city"
1624
- ], [e, r] = $({
1625
- type: null,
1626
- value: null
1627
- }), [n, o] = $(!0), [a, i] = $(null);
1628
- return ne(() => {
1629
- if (!window.location.pathname.includes("/l/")) {
1630
- o(!1);
1631
- return;
1632
- }
1633
- const s = window.location.pathname.split("/l/").at(-1).split("/"), l = t[s.length - 1], f = s[s.length - 1];
1634
- l && f ? (r({ type: l, value: f }), o(!1)) : (i(new Error("Invalid location")), o(!1));
1635
- }, []), {
1636
- location: e,
1637
- isLoading: n,
1638
- error: a
1639
- };
1640
- }, Kr = hr(), $l = ({ id: t, locale: e, autoLocate: r = !0, products: n = [], filterRetailerByStockedProduct: o = !1, filterRetailerByAvailableProduct: a = !1, children: i }) => {
1641
- var Ct, Rt, Ft, Nt, Dt, Mt, Tt, Lt, kt;
1642
- const [c, s] = $(e);
1643
- ne(() => {
1644
- e && s(e);
1645
- }, [e]);
1646
- const { data: l, isLoading: f } = dt([`https://api.colabcommerce.com/widget_api/store_locator/${t}`], vt);
1647
- Gi("AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M");
1648
- const [p, u] = $(!1), { coords: y, isGeolocationAvailable: v, isGeolocationEnabled: g, getPosition: h } = ki({
1649
- suppressLocationOnMount: !r,
1650
- onError: () => u(!1),
1651
- onSuccess: () => u(!1),
1652
- positionOptions: { enableHighAccuracy: !1 },
1653
- userDecisionTimeout: 5e3
1654
- }), { location: S } = qi(), [b, d] = $(((Ct = l == null ? void 0 : l.entity) == null ? void 0 : Ct.store_locator_default_center_lat) || null), [I, O] = $(((Rt = l == null ? void 0 : l.entity) == null ? void 0 : Rt.store_locator_default_center_lng) || null), [_, x] = $(((Ft = l == null ? void 0 : l.entity) == null ? void 0 : Ft.store_locator_default_name) || null), [U, F] = $(null), [C, G] = $(null), [B, m] = $({ lat: ((Nt = l == null ? void 0 : l.entity) == null ? void 0 : Nt.store_locator_default_center_lat) * 1 || null, lng: ((Dt = l == null ? void 0 : l.entity) == null ? void 0 : Dt.store_locator_default_center_lng) * 1 || null }), [A, H] = $(((Mt = l == null ? void 0 : l.entity) == null ? void 0 : Mt.store_locator_default_center_lat) * 1 || null), [Q, ee] = $(((Tt = l == null ? void 0 : l.entity) == null ? void 0 : Tt.store_locator_default_center_lng) * 1 || null), [Qe, Ie] = $(9), [ve, Qr] = $("300mi"), [jr, Jr] = $("km"), [It, Xr] = $([]), [Zr, Yr] = $(!1), [en, tn] = $(!1), [rn, nn] = $(!0), [on, an] = $(!1), { data: q, error: ln, isLoading: cn } = dt(() => {
1655
- var L;
1656
- if (A && Q) {
1657
- const W = {
1658
- latitude: A * 1,
1659
- longitude: Q * 1,
1660
- radius: "300mi"
1661
- }, X = n == null ? void 0 : n.map((k) => k == null ? void 0 : k.sku), Ce = n == null ? void 0 : n.map((k) => k == null ? void 0 : k.external_id), Bt = n == null ? void 0 : n.map((k) => k == null ? void 0 : k.collection_id);
1662
- o && (W.stocked_product_skus = X, W.stocked_product_external_ids = Ce, W.stocked_product_collection_ids = Bt), a && (W.available_product_skus = X, W.available_product_external_ids = Ce, W.available_product_collection_ids = Bt);
1663
- let he = `https://api.colabcommerce.com/widget_api/store_locator?${Li.stringify(W, { arrayFormat: "brackets" })}`;
1664
- const Wt = (L = It.find((k) => k.bucket === "store_type")) == null ? void 0 : L.values;
1665
- if (Wt) {
1666
- const k = Wt.map((un) => `store_type[]=${un}`).join("&");
1667
- he = `${he}&${k}`;
1668
- }
1669
- return S.type && S.value && (he = `${he}&${S.type}=${S.value}`), [`${he}`, { "X-Cc-Id": t }];
1670
- } else
1671
- throw new Error("No search center");
1672
- }, vt);
1673
- ne(() => {
1674
- if (y) {
1675
- vr(y.latitude, y.longitude).then((W) => {
1676
- const X = W.results.find((Ce) => Ce.types.includes("postal_code"));
1677
- X && x(X.formatted_address);
1678
- }), H(y.latitude * 1), ee(y.longitude * 1), m({ lat: y.latitude * 1, lng: y.longitude * 1 });
1679
- const L = new URLSearchParams(window.location.search);
1680
- L.set("lat", y.latitude * 1), L.set("lng", y.longitude * 1), window.history.replaceState({}, "", `?${L.toString()}`);
1681
- }
1682
- }, [y, vr]), ne(() => {
1683
- var L, W, X;
1684
- (L = l == null ? void 0 : l.entity) != null && L.store_locator_default_center_lat && ((W = l == null ? void 0 : l.entity) != null && W.store_locator_default_center_lng) && ((X = l == null ? void 0 : l.entity) != null && X.store_locator_default_name) && r && (d(l.entity.store_locator_default_center_lat * 1), O(l.entity.store_locator_default_center_lng * 1), H(l.entity.store_locator_default_center_lat * 1), ee(l.entity.store_locator_default_center_lng * 1), m({ lat: l.entity.store_locator_default_center_lat * 1, lng: l.entity.store_locator_default_center_lng * 1 }), x(l.entity.store_locator_default_name));
1685
- }, [l, r]);
1686
- const sn = {
1687
- id: t,
1688
- settings: l,
1689
- locations: (q == null ? void 0 : q.results) || [],
1690
- meta: (q == null ? void 0 : q.meta) || {},
1691
- isLoading: cn,
1692
- isError: ln,
1693
- focusedLocationId: C,
1694
- setFocusedLocationId: G,
1695
- focusedLocation: (Lt = q == null ? void 0 : q.results) == null ? void 0 : Lt.find((L) => L.id === C),
1696
- selectedLocationId: U,
1697
- setSelectedLocationId: F,
1698
- selectedLocation: (kt = q == null ? void 0 : q.results) == null ? void 0 : kt.find((L) => L.id === U),
1699
- radius: ve,
1700
- setRadius: Qr,
1701
- mapCenter: B,
1702
- setMapCenter: m,
1703
- searchCenter: { lat: A, lng: Q },
1704
- setSearchCenter: ({ lat: L, lng: W }) => {
1705
- H(L * 1), ee(W * 1);
1706
- },
1707
- locationName: _,
1708
- setLocationName: x,
1709
- distanceUnit: jr,
1710
- setDistanceUnit: Jr,
1711
- getPosition: h,
1712
- isGeolocationAvailable: v,
1713
- isGeolocationEnabled: g,
1714
- loadingGeo: p,
1715
- setLoadingGeo: u,
1716
- activeFilters: It,
1717
- setActiveFilters: Xr,
1718
- messageModalOpen: Zr,
1719
- setMessageModalOpen: Yr,
1720
- showMap: rn,
1721
- setShowMap: nn,
1722
- showDetails: en,
1723
- setShowDetails: tn,
1724
- zoom: Qe,
1725
- setZoom: Ie,
1726
- showFilters: on,
1727
- setShowFilters: an,
1728
- searchLocation: S,
1729
- locale: c,
1730
- products: n
1731
- };
1732
- return /* @__PURE__ */ E(Kr.Provider, { value: sn, children: i });
1733
- }, Ke = () => {
1734
- const t = mr(Kr);
1735
- if (!t)
1736
- throw new Error("useStoreLocator must be used within a StoreLocatorContext");
1737
- return t;
1738
- }, zi = "EbQBd", Ne = {
1739
- icon: zi
1740
- }, Vi = ({ storeType: t, name: e }) => {
1741
- var y, v, g, h;
1742
- const { activeFilters: r, setActiveFilters: n, meta: o } = Ke(), { t: a, locale: i } = ye();
1743
- ne(() => {
1744
- r.find((S) => (S == null ? void 0 : S.bucket) === "store_type") || n([...r, { bucket: "store_type", operator: "in", values: [] }]);
1745
- }, [r, e]);
1746
- const c = r.find((S) => (S == null ? void 0 : S.bucket) === "store_type"), s = (y = c == null ? void 0 : c.values) == null ? void 0 : y.includes(e), l = ((h = (g = (v = o == null ? void 0 : o.aggs) == null ? void 0 : v.store_type.buckets) == null ? void 0 : g.find((S) => S.key === e)) == null ? void 0 : h.doc_count) || 0, f = () => {
1747
- var S;
1748
- if (s) {
1749
- const b = (S = c == null ? void 0 : c.values) == null ? void 0 : S.filter((d) => d !== e);
1750
- n(r.map((d) => (d == null ? void 0 : d.bucket) === "store_type" ? { bucket: "store_type", values: b } : d));
1751
- } else
1752
- n(r.map((b) => (b == null ? void 0 : b.bucket) === "store_type" ? { bucket: "store_type", values: [...b.values, e] } : b));
1753
- }, p = s ? Ne.active : Ne.inactive, u = t != null && t.icon ? /* @__PURE__ */ J("span", { children: [
1754
- /* @__PURE__ */ E("img", { src: t.icon.url, alt: e, className: T(Ne.icon) }),
1755
- " ",
1756
- a(`store_types.${e}`, e)
1757
- ] }) : a(`store_types.${e}`, e);
1758
- return /* @__PURE__ */ E(
1759
- gr.Check,
1760
- {
1761
- type: "checkbox",
1762
- id: `filter-${e}`,
1763
- label: u,
1764
- className: T(Ne.wrapper, p),
1765
- disabled: l === 0,
1766
- checked: s,
1767
- onChange: f
1768
- }
1769
- );
1770
- }, Ki = "ttF7M", Qi = "mrH0z", ji = "Sx2fb", Ji = "ndAJC", Xi = "mrB--", Zi = "G9KVo", te = {
1771
- searchWrapper: Ki,
1772
- wrapper: Qi,
1773
- locateToggle: ji,
1774
- input: Ji,
1775
- filterToggle: Xi,
1776
- filtersWrapper: Zi
1777
- }, Pl = ({ locationName: t, setLocationName: e, setSearchCenter: r, setMapCenter: n, handleLocate: o }) => {
1778
- var v;
1779
- const { t: a } = ye(), { settings: i } = Ke(), c = ((v = i == null ? void 0 : i.entity) == null ? void 0 : v.store_type_icons) || [], [s, l] = $(!1), f = fn(null), [p, u] = $(null), y = En("places");
1780
- return ne(() => {
1781
- var S;
1782
- if (!y || !f.current || !((S = f == null ? void 0 : f.current) != null && S.checkVisibility())) return;
1783
- const g = {
1784
- fields: ["geometry", "name", "formatted_address"]
1785
- }, h = new y.Autocomplete(f.current, g);
1786
- u(h);
1787
- }, [y, f.current]), ne(() => {
1788
- p && p.addListener("place_changed", () => {
1789
- const g = p.getPlace();
1790
- if (!g.geometry) {
1791
- console.log("Returned place contains no geometry");
1792
- return;
1793
- }
1794
- const h = { lat: g.geometry.location.lat(), lng: g.geometry.location.lng() };
1795
- n(h), r(h), e(g.formatted_address);
1796
- });
1797
- }, [p, e]), /* @__PURE__ */ J("div", { children: [
1798
- /* @__PURE__ */ E("div", { className: ge("searchWrapper", te, "location-search"), children: /* @__PURE__ */ J("div", { className: ge("wrapper", te, "location-search"), children: [
1799
- /* @__PURE__ */ E(
1800
- "button",
1801
- {
1802
- variant: "primary",
1803
- className: ge("locateToggle", te, "location-search"),
1804
- onClick: o,
1805
- children: /* @__PURE__ */ E(Dn, { size: 20 })
1806
- }
1807
- ),
1808
- /* @__PURE__ */ E(
1809
- gr.Control,
1810
- {
1811
- type: "text",
1812
- id: "location-search-input",
1813
- placeholder: t || a("search.placeholder"),
1814
- className: ge("input", te, "location-search"),
1815
- ref: f
1816
- }
1817
- ),
1818
- /* @__PURE__ */ E(
1819
- "button",
1820
- {
1821
- variant: "primary",
1822
- className: ge("filterToggle", te, "location-search"),
1823
- onClick: () => l(!s),
1824
- children: /* @__PURE__ */ E(Tn, { size: 20 })
1825
- }
1826
- )
1827
- ] }) }),
1828
- /* @__PURE__ */ E(bt, { in: s, children: /* @__PURE__ */ E("div", { children: c && c.length > 0 && /* @__PURE__ */ E("div", { className: T(te.filtersWrapper), children: /* @__PURE__ */ E("div", { className: T(te.filterOptions), children: c.map((g) => /* @__PURE__ */ E(Vi, { storeType: g, name: g.name }, g.name)) }) }) }) })
1829
- ] });
1830
- }, Yi = "pPXOE", el = "WFut0", tl = "Vwghe", rl = "RK0kk", nl = "gHzpV", ol = "S-6Tm", al = "_2bPVX", il = "BXMg-", ll = "n-B3P", cl = "K-iBJ", sl = "uh8I9", ul = "j5fbV", fl = "ysYvV", N = {
1831
- wrapper: Yi,
1832
- title: el,
1833
- clockIcon: tl,
1834
- hours: rl,
1835
- open: nl,
1836
- closed: ol,
1837
- soon: al,
1838
- subHoursWrapper: il,
1839
- subHours: ll,
1840
- today: cl,
1841
- toggle: sl,
1842
- shown: ul,
1843
- shownHours: fl
1844
- }, pl = ({ i: t, hour: e }) => {
1845
- const { t: r, locale: n } = ye(), o = e.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone || "America/Los_Angeles", a = /* @__PURE__ */ new Date();
1846
- a.setUTCHours(e.open_at_hour - e.utc_offset_minute / 60, e.open_at_minute, 0, 0);
1847
- const i = /* @__PURE__ */ new Date();
1848
- i.setUTCHours(e.close_at_hour - e.utc_offset_minute / 60, e.close_at_minute, 0, 0);
1849
- const c = a.getUTCMinutes() === 0 ? new Intl.DateTimeFormat(n, { hour: "numeric", timeZone: o }) : new Intl.DateTimeFormat(n, { hour: "numeric", minute: "2-digit", timeZone: o }), s = i.getUTCMinutes() === 0 ? new Intl.DateTimeFormat(n, { hour: "numeric", timeZone: o }) : new Intl.DateTimeFormat(n, { hour: "numeric", minute: "2-digit", timeZone: o });
1850
- return /* @__PURE__ */ J("div", { className: `${N.subHours} ${e.day === (/* @__PURE__ */ new Date()).getDay() ? N.today : ""}`, children: [
1851
- /* @__PURE__ */ E("div", { children: r(`store.days.${e.day}`) }),
1852
- /* @__PURE__ */ J("div", { children: [
1853
- c.format(a),
1854
- " - ",
1855
- s.format(i)
1856
- ] })
1857
- ] }, e.day);
1858
- }, xl = ({ hours: t, defaultOpen: e = !1 }) => {
1859
- const { t: r, locale: n } = ye(), { isOpen: o, openingSoon: a, closingSoon: i, openAt: c, closeAt: s, openFormatter: l, closeAtFormatter: f } = An(t), [p, u] = $(e), v = (/* @__PURE__ */ new Date()).getDay();
1860
- if (!(t == null ? void 0 : t.find((O) => O.day === v))) return null;
1861
- const h = o, S = t.sort((O, _) => O.day - _.day);
1862
- let b = null, d = null;
1863
- h ? i ? (d = T(N.hours, N.soon), b = /* @__PURE__ */ E("span", { children: r("store.closingSoon") })) : (d = T(N.hours, N.open), b = /* @__PURE__ */ E("span", { children: r("store.openNow") })) : a ? (d = T(N.hours, N.soon), b = /* @__PURE__ */ E("span", { children: r("store.openingSoon") })) : (d = T(N.hours, N.closed), b = /* @__PURE__ */ E("span", { children: r("store.closedNow") }));
1864
- const I = (O) => {
1865
- O.stopPropagation(), u(!p);
1866
- };
1867
- return /* @__PURE__ */ J("div", { "data-cy-id": "wrapper", className: p ? T(N.wrapper, N.shown) : T(N.wrapper), children: [
1868
- /* @__PURE__ */ J("div", { className: T(N.title), onClick: I, children: [
1869
- /* @__PURE__ */ J("span", { className: d, children: [
1870
- /* @__PURE__ */ E(Fn, { size: 16, className: T(N.clockIcon) }),
1871
- b
1872
- ] }),
1873
- /* @__PURE__ */ J("span", { className: N.shownHours, children: [
1874
- l.format(c),
1875
- " - ",
1876
- f.format(s)
1877
- ] }),
1878
- /* @__PURE__ */ E(Cn, { className: T(N.toggle) })
1879
- ] }),
1880
- /* @__PURE__ */ E(bt, { in: p, children: /* @__PURE__ */ E("div", { "data-cy-id": "sub-hours-wrapper", children: /* @__PURE__ */ E("div", { className: T(N.subHoursWrapper), children: S.map((O, _) => /* @__PURE__ */ E(pl, { i: _, hour: O }, O.day)) }) }) })
1881
- ] });
1882
- }, yl = (t, e) => {
1883
- var r = 6371, n = De(e.lat - t.lat), o = De(e.lng - t.lng), a = Math.sin(n / 2) * Math.sin(n / 2) + Math.cos(De(t.lat)) * Math.cos(De(e.lat)) * Math.sin(o / 2) * Math.sin(o / 2), i = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), c = r * i;
1884
- return c;
1885
- }, dl = (t) => t * 0.621371, De = (t) => t * (Math.PI / 180), vl = (t) => ["en-US", "es-US"].includes(t) ? "mi" : "km", Il = (t, e) => vl(e) === "mi" ? dl(t) : t, hl = "OWaSe", ml = {
1886
- icon: hl
1887
- }, Cl = ({ type: t }) => {
1888
- var o, a, i;
1889
- const { t: e } = ye(), { settings: r } = Ke(), n = (a = (o = r == null ? void 0 : r.entity) == null ? void 0 : o.store_type_icons) == null ? void 0 : a.find((c) => c.name === t);
1890
- return n ? /* @__PURE__ */ E("div", { children: /* @__PURE__ */ E("img", { src: (i = n == null ? void 0 : n.icon) == null ? void 0 : i.url, className: T(ml.icon), alt: t }) }) : null;
1891
- }, gl = "r9Xb-", Sl = {
1892
- btn: gl
1893
- }, Rl = () => {
1894
- const { setSearchCenter: t, mapCenter: e, searchCenter: r, locale: n } = Ke(), { t: o } = ye("default", { lng: n }), a = () => {
1895
- t(e);
1896
- };
1897
- return r && yl(e, r) > 100 ? /* @__PURE__ */ E(On, { className: T(Sl.btn), variant: "light", onClick: a, children: o("store_locator.search_here") }) : null;
1898
- };
1899
- function Fl(t) {
1900
- var y;
1901
- const e = (v) => {
1902
- var g;
1903
- return ((g = t.find((h) => h.types.includes(v))) == null ? void 0 : g.long_name) || "";
1904
- }, r = e("street_number"), n = e("route"), o = [r, n].filter(Boolean).join(" "), a = e("subpremise"), i = a ? `Unit ${a}` : "", c = e("locality") || e("postal_town") || e("sublocality") || "", s = e("administrative_area_level_1"), l = e("postal_code"), f = e("country"), u = ((y = t.find((v) => v.types.includes("country"))) == null ? void 0 : y.short_name) || f;
1905
- return {
1906
- addressLine1: o,
1907
- addressLine2: i,
1908
- city: c,
1909
- province: s,
1910
- postalCode: l,
1911
- country: u
1912
- };
1913
- }
1914
- export {
1915
- vr as A,
1916
- bt as C,
1917
- Pl as L,
1918
- Cl as S,
1919
- Il as a,
1920
- xl as b,
1921
- Fl as c,
1922
- yl as d,
1923
- $l as e,
1924
- Rl as f,
1925
- Ol as g,
1926
- Al as h,
1927
- ki as i,
1928
- dl as k,
1929
- vl as l,
1930
- Ke as u,
1931
- Gi as w
1932
- };