@storepecker/storefront-core 2.3.6 → 2.4.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 (91) hide show
  1. package/dist/api/index.cjs +28 -24
  2. package/dist/api/index.d.cts +8 -5
  3. package/dist/api/index.d.ts +8 -5
  4. package/dist/api/index.js +1 -1
  5. package/dist/{booking-CG6tul9l.d.ts → booking-BVWe8HHh.d.ts} +1 -1
  6. package/dist/{booking-DNVf5ZAS.d.cts → booking-DX9SU_qm.d.cts} +1 -1
  7. package/dist/cart-kJoawc_Z.d.cts +126 -0
  8. package/dist/cart-y-7RPmnQ.d.ts +126 -0
  9. package/dist/checkout/index.cjs +22 -22
  10. package/dist/checkout/index.d.cts +3 -1
  11. package/dist/checkout/index.d.ts +3 -1
  12. package/dist/checkout/index.js +2 -2
  13. package/dist/{chunk-BTT3XQ32.cjs → chunk-33TWVRZE.cjs} +6 -6
  14. package/dist/chunk-3YRSHPM6.cjs +34 -0
  15. package/dist/chunk-6DXB4O6P.cjs +121 -0
  16. package/dist/{chunk-ILVGYHNI.js → chunk-6Q7QMPOQ.js} +2 -1
  17. package/dist/{chunk-HTFVROIV.cjs → chunk-7UK3E7SL.cjs} +6 -0
  18. package/dist/chunk-B3BXKMQA.cjs +271 -0
  19. package/dist/chunk-BTR3HLL4.js +14 -0
  20. package/dist/chunk-EGFOTJPC.js +22 -0
  21. package/dist/{chunk-YUPBTD4M.js → chunk-F45S7UWC.js} +1 -139
  22. package/dist/chunk-HAQWCNDY.cjs +24 -0
  23. package/dist/{chunk-Y4NGR42Z.js → chunk-HUIT4JCR.js} +1 -1
  24. package/dist/{chunk-TF2KMTB6.js → chunk-JRYWZMNT.js} +1 -1
  25. package/dist/{chunk-JCOOINQF.cjs → chunk-KLNKIQQM.cjs} +4 -3
  26. package/dist/chunk-L43KF3AC.js +269 -0
  27. package/dist/chunk-LHF5BSWO.cjs +16 -0
  28. package/dist/chunk-LJUGNSQQ.cjs +149 -0
  29. package/dist/chunk-LLRSKDH5.js +115 -0
  30. package/dist/chunk-OSM73ETC.js +139 -0
  31. package/dist/{chunk-4CVKE6CC.cjs → chunk-OTMTHA5C.cjs} +0 -147
  32. package/dist/{chunk-JH4JJBXE.cjs → chunk-TTIQRDHX.cjs} +2 -2
  33. package/dist/chunk-U7EXLQCT.js +32 -0
  34. package/dist/{chunk-LW3V53WJ.js → chunk-UVU7H4E6.js} +6 -1
  35. package/dist/chunk-V447PVRV.cjs +308 -0
  36. package/dist/chunk-YK4M3SFP.js +301 -0
  37. package/dist/{collections-Bz9KD7Na.d.cts → collections-BDSVfRNo.d.ts} +1 -1
  38. package/dist/{collections-CkEUi3BR.d.ts → collections-WzvTO0OQ.d.cts} +1 -1
  39. package/dist/components/address-form.cjs +17 -0
  40. package/dist/components/address-form.css +329 -0
  41. package/dist/components/address-form.d.cts +33 -0
  42. package/dist/components/address-form.d.ts +33 -0
  43. package/dist/components/address-form.js +11 -0
  44. package/dist/components/digital-product-download-modal.cjs +8 -0
  45. package/dist/components/digital-product-download-modal.d.cts +15 -0
  46. package/dist/components/digital-product-download-modal.d.ts +15 -0
  47. package/dist/components/digital-product-download-modal.js +2 -0
  48. package/dist/components/index.cjs +35 -695
  49. package/dist/components/index.d.cts +14 -87
  50. package/dist/components/index.d.ts +14 -87
  51. package/dist/components/index.js +11 -688
  52. package/dist/components/search-dropdown.cjs +7 -0
  53. package/dist/components/search-dropdown.css +200 -0
  54. package/dist/components/search-dropdown.d.cts +28 -0
  55. package/dist/components/search-dropdown.d.ts +28 -0
  56. package/dist/components/search-dropdown.js +1 -0
  57. package/dist/components/share-button.cjs +9 -0
  58. package/dist/components/share-button.d.cts +11 -0
  59. package/dist/components/share-button.d.ts +11 -0
  60. package/dist/components/share-button.js +3 -0
  61. package/dist/components/share-icon.cjs +7 -0
  62. package/dist/components/share-icon.d.cts +9 -0
  63. package/dist/components/share-icon.d.ts +9 -0
  64. package/dist/components/share-icon.js +1 -0
  65. package/dist/components/theme-data-initializer.cjs +8 -0
  66. package/dist/components/theme-data-initializer.d.cts +12 -0
  67. package/dist/components/theme-data-initializer.d.ts +12 -0
  68. package/dist/components/theme-data-initializer.js +2 -0
  69. package/dist/hooks/index.cjs +18 -17
  70. package/dist/hooks/index.d.cts +4 -2
  71. package/dist/hooks/index.d.ts +4 -2
  72. package/dist/hooks/index.js +6 -5
  73. package/dist/models/index.d.cts +6 -4
  74. package/dist/models/index.d.ts +6 -4
  75. package/dist/orders-CjNmCY5I.d.cts +144 -0
  76. package/dist/orders-L_8eIkUS.d.ts +144 -0
  77. package/dist/{pixelEvents-OVIkPw-J.d.ts → pixelEvents-Bo-VjAx8.d.ts} +4 -2
  78. package/dist/{pixelEvents-DYkiTkb2.d.cts → pixelEvents-C1rFPOwb.d.cts} +4 -2
  79. package/dist/{orders-fIdANHSl.d.ts → product-DJMdi4D4.d.cts} +1 -265
  80. package/dist/{orders-fIdANHSl.d.cts → product-DJMdi4D4.d.ts} +1 -265
  81. package/dist/store/index.cjs +5 -5
  82. package/dist/store/index.d.cts +6 -4
  83. package/dist/store/index.d.ts +6 -4
  84. package/dist/store/index.js +2 -2
  85. package/dist/utils/index.cjs +44 -43
  86. package/dist/utils/index.d.cts +7 -5
  87. package/dist/utils/index.d.ts +7 -5
  88. package/dist/utils/index.js +3 -2
  89. package/dist/{wishlist-stNzfvIP.d.cts → wishlist-CUuCTSVJ.d.cts} +1 -1
  90. package/dist/{wishlist-_bd4gLyQ.d.ts → wishlist-DKYFZR0s.d.ts} +1 -1
  91. package/package.json +50 -6
@@ -1,706 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunkBBRB475I_cjs = require('../chunk-BBRB475I.cjs');
4
- var chunkJCOOINQF_cjs = require('../chunk-JCOOINQF.cjs');
3
+ var chunkB3BXKMQA_cjs = require('../chunk-B3BXKMQA.cjs');
4
+ var chunkV447PVRV_cjs = require('../chunk-V447PVRV.cjs');
5
+ var chunkHAQWCNDY_cjs = require('../chunk-HAQWCNDY.cjs');
6
+ var chunk3YRSHPM6_cjs = require('../chunk-3YRSHPM6.cjs');
7
+ var chunk6DXB4O6P_cjs = require('../chunk-6DXB4O6P.cjs');
8
+ var chunkLHF5BSWO_cjs = require('../chunk-LHF5BSWO.cjs');
9
+ require('../chunk-BBRB475I.cjs');
10
+ require('../chunk-KLNKIQQM.cjs');
5
11
  require('../chunk-RDUT4W3B.cjs');
6
- var chunk4CVKE6CC_cjs = require('../chunk-4CVKE6CC.cjs');
7
- var chunkDODFO744_cjs = require('../chunk-DODFO744.cjs');
12
+ require('../chunk-LJUGNSQQ.cjs');
13
+ require('../chunk-OTMTHA5C.cjs');
14
+ require('../chunk-DODFO744.cjs');
8
15
  require('../chunk-TB72NPRM.cjs');
9
16
  require('../chunk-ECHV2JSY.cjs');
10
17
  require('../chunk-BBRXE57K.cjs');
11
18
  require('../chunk-NE3ZHELZ.cjs');
12
19
  require('../chunk-N3CTXRFT.cjs');
13
- var react = require('react');
14
- var clsx = require('clsx');
15
- var jsxRuntime = require('react/jsx-runtime');
16
- var Modal = require('react-responsive-modal');
17
- require('react-responsive-modal/styles.css');
18
20
 
19
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
20
21
 
21
- var clsx__default = /*#__PURE__*/_interopDefault(clsx);
22
- var Modal__default = /*#__PURE__*/_interopDefault(Modal);
23
22
 
24
- // src/components/search-dropdown/search-dropdown.module.css
25
- var search_dropdown_default = {};
26
- function DownChevron({
27
- width = 24,
28
- height = 24,
29
- className
30
- }) {
31
- return /* @__PURE__ */ jsxRuntime.jsx(
32
- "svg",
33
- {
34
- fill: "currentColor",
35
- height,
36
- width,
37
- xmlns: "http://www.w3.org/2000/svg",
38
- xmlnsXlink: "http://www.w3.org/1999/xlink",
39
- viewBox: "0 0 407.437 407.437",
40
- xmlSpace: "preserve",
41
- className,
42
- children: /* @__PURE__ */ jsxRuntime.jsx(
43
- "polygon",
44
- {
45
- points: "386.258,91.567 203.718,273.512 21.179,91.567 0,112.815 203.718,315.87 407.437,112.815 ",
46
- strokeWidth: "2"
47
- }
48
- )
49
- }
50
- );
51
- }
52
- function SearchIcon({
53
- width = 24,
54
- height = 24,
55
- className
56
- }) {
57
- return /* @__PURE__ */ jsxRuntime.jsxs(
58
- "svg",
59
- {
60
- width,
61
- height,
62
- viewBox: "0 0 24 24",
63
- fill: "none",
64
- xmlns: "http://www.w3.org/2000/svg",
65
- className,
66
- children: [
67
- /* @__PURE__ */ jsxRuntime.jsx(
68
- "path",
69
- {
70
- d: "M17.5 17.5L22 22",
71
- stroke: "currentColor",
72
- strokeWidth: "1.5",
73
- strokeLinecap: "round",
74
- strokeLinejoin: "round"
75
- }
76
- ),
77
- /* @__PURE__ */ jsxRuntime.jsx(
78
- "path",
79
- {
80
- d: "M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11Z",
81
- stroke: "currentColor",
82
- strokeWidth: "1.5",
83
- strokeLinejoin: "round"
84
- }
85
- )
86
- ]
87
- }
88
- );
89
- }
90
- var SearchDropdown = ({
91
- options,
92
- value,
93
- onChange,
94
- placeholder = "Select an option",
95
- searchPlaceholder = "Search...",
96
- className,
97
- disabled = false,
98
- error,
99
- label,
100
- name,
101
- renderOption,
102
- renderSelected,
103
- filterFunction,
104
- emptyMessage = "No options found",
105
- maxHeight = "300px"
106
- }) => {
107
- const [isOpen, setIsOpen] = react.useState(false);
108
- const [searchTerm, setSearchTerm] = react.useState("");
109
- const [focusedIndex, setFocusedIndex] = react.useState(-1);
110
- const dropdownRef = react.useRef(null);
111
- const searchInputRef = react.useRef(null);
112
- const optionsListRef = react.useRef(null);
113
- const selectedOption = react.useMemo(
114
- () => options.find((opt) => opt.value === value) || null,
115
- [options, value]
116
- );
117
- const defaultFilter = react.useCallback(
118
- (option, term) => {
119
- return option.label.toLowerCase().includes(term.toLowerCase());
120
- },
121
- []
122
- );
123
- const filter = filterFunction || defaultFilter;
124
- const filteredOptions = react.useMemo(() => {
125
- if (!searchTerm.trim()) return options;
126
- return options.filter((option) => filter(option, searchTerm));
127
- }, [options, searchTerm, filter]);
128
- react.useEffect(() => {
129
- function handleClickOutside(event) {
130
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
131
- setIsOpen(false);
132
- setSearchTerm("");
133
- setFocusedIndex(-1);
134
- }
135
- }
136
- if (isOpen) {
137
- document.addEventListener("mousedown", handleClickOutside);
138
- setTimeout(() => {
139
- searchInputRef.current?.focus();
140
- }, 0);
141
- }
142
- return () => {
143
- document.removeEventListener("mousedown", handleClickOutside);
144
- };
145
- }, [isOpen]);
146
- const handleSelect = react.useCallback(
147
- (option) => {
148
- if (option.disabled) return;
149
- onChange?.(option.value, option);
150
- setIsOpen(false);
151
- setSearchTerm("");
152
- setFocusedIndex(-1);
153
- },
154
- [onChange]
155
- );
156
- react.useEffect(() => {
157
- function handleKeyDown(event) {
158
- if (!isOpen) return;
159
- switch (event.key) {
160
- case "ArrowDown":
161
- event.preventDefault();
162
- setFocusedIndex(
163
- (prev) => prev < filteredOptions.length - 1 ? prev + 1 : prev
164
- );
165
- break;
166
- case "ArrowUp":
167
- event.preventDefault();
168
- setFocusedIndex((prev) => prev > 0 ? prev - 1 : -1);
169
- break;
170
- case "Enter":
171
- event.preventDefault();
172
- if (focusedIndex >= 0 && focusedIndex < filteredOptions.length) {
173
- handleSelect(filteredOptions[focusedIndex]);
174
- }
175
- break;
176
- case "Escape":
177
- event.preventDefault();
178
- setIsOpen(false);
179
- setSearchTerm("");
180
- setFocusedIndex(-1);
181
- break;
182
- }
183
- }
184
- if (isOpen) {
185
- document.addEventListener("keydown", handleKeyDown);
186
- }
187
- return () => {
188
- document.removeEventListener("keydown", handleKeyDown);
189
- };
190
- }, [isOpen, filteredOptions, focusedIndex, handleSelect]);
191
- react.useEffect(() => {
192
- if (focusedIndex >= 0 && optionsListRef.current) {
193
- const focusedElement = optionsListRef.current.children[focusedIndex];
194
- if (focusedElement) {
195
- focusedElement.scrollIntoView({
196
- behavior: "smooth",
197
- block: "nearest"
198
- });
199
- }
200
- }
201
- }, [focusedIndex]);
202
- const handleToggle = () => {
203
- if (disabled) return;
204
- setIsOpen((prev) => !prev);
205
- if (!isOpen) {
206
- setSearchTerm("");
207
- setFocusedIndex(-1);
208
- }
209
- };
210
- const handleSearchChange = (e) => {
211
- setSearchTerm(e.target.value);
212
- setFocusedIndex(-1);
213
- };
214
- const handleOptionMouseEnter = (index) => {
215
- setFocusedIndex(index);
216
- };
217
- return /* @__PURE__ */ jsxRuntime.jsxs(
218
- "div",
219
- {
220
- ref: dropdownRef,
221
- className: clsx__default.default(search_dropdown_default.searchDropdown, className, {
222
- [search_dropdown_default.disabled]: disabled,
223
- [search_dropdown_default.error]: error,
224
- [search_dropdown_default.open]: isOpen
225
- }),
226
- children: [
227
- label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: search_dropdown_default.label, htmlFor: name, children: label }),
228
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: search_dropdown_default.dropdownContainer, children: [
229
- /* @__PURE__ */ jsxRuntime.jsxs(
230
- "button",
231
- {
232
- type: "button",
233
- className: search_dropdown_default.dropdownButton,
234
- onClick: handleToggle,
235
- disabled,
236
- "aria-expanded": isOpen,
237
- "aria-haspopup": "listbox",
238
- "aria-label": label || placeholder,
239
- id: name,
240
- children: [
241
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: search_dropdown_default.selectedValue, children: selectedOption ? renderSelected ? renderSelected(selectedOption) : selectedOption.label : placeholder }),
242
- /* @__PURE__ */ jsxRuntime.jsx(
243
- DownChevron,
244
- {
245
- width: 16,
246
- height: 16,
247
- className: clsx__default.default(search_dropdown_default.chevron, {
248
- [search_dropdown_default.chevronOpen]: isOpen
249
- })
250
- }
251
- )
252
- ]
253
- }
254
- ),
255
- isOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: search_dropdown_default.dropdownMenu, style: { maxHeight }, children: [
256
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: search_dropdown_default.searchContainer, children: [
257
- /* @__PURE__ */ jsxRuntime.jsx(
258
- SearchIcon,
259
- {
260
- width: 16,
261
- height: 16,
262
- className: search_dropdown_default.searchIcon
263
- }
264
- ),
265
- /* @__PURE__ */ jsxRuntime.jsx(
266
- "input",
267
- {
268
- ref: searchInputRef,
269
- type: "text",
270
- className: search_dropdown_default.searchInput,
271
- placeholder: searchPlaceholder,
272
- value: searchTerm,
273
- onChange: handleSearchChange,
274
- onClick: (e) => e.stopPropagation(),
275
- onKeyDown: (e) => {
276
- if (e.key === "Enter" && filteredOptions.length === 1) {
277
- e.preventDefault();
278
- handleSelect(filteredOptions[0]);
279
- }
280
- },
281
- autoComplete: "off"
282
- }
283
- )
284
- ] }),
285
- /* @__PURE__ */ jsxRuntime.jsx(
286
- "ul",
287
- {
288
- ref: optionsListRef,
289
- className: search_dropdown_default.optionsList,
290
- role: "listbox",
291
- children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
292
- "li",
293
- {
294
- className: clsx__default.default(search_dropdown_default.option, {
295
- [search_dropdown_default.optionSelected]: option.value === value,
296
- [search_dropdown_default.optionFocused]: index === focusedIndex,
297
- [search_dropdown_default.optionDisabled]: option.disabled
298
- }),
299
- onClick: () => handleSelect(option),
300
- onMouseEnter: () => handleOptionMouseEnter(index),
301
- role: "option",
302
- "aria-selected": option.value === value,
303
- children: renderOption ? renderOption(option) : option.label
304
- },
305
- option.value
306
- )) : /* @__PURE__ */ jsxRuntime.jsx("li", { className: search_dropdown_default.emptyMessage, children: emptyMessage })
307
- }
308
- )
309
- ] })
310
- ] }),
311
- error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: search_dropdown_default.errorMessage, children: error })
312
- ]
313
- }
314
- );
315
- };
316
- var search_dropdown_default2 = SearchDropdown;
317
-
318
- // src/components/address-form/address-form.module.css
319
- var address_form_default = {};
320
- var AddressForm = react.forwardRef(
321
- ({
322
- address,
323
- onSuccess,
324
- onError,
325
- locationCacheKey,
326
- defaultCountryId,
327
- renderButton,
328
- onFormikReady,
329
- onCancel,
330
- showCancel = true,
331
- showDefaultCheckbox = true,
332
- className,
333
- submitLabel = "Save"
334
- }, ref) => {
335
- const {
336
- formik,
337
- states,
338
- supportedCountries,
339
- selectedCountry,
340
- countryCodeOptions,
341
- addressMeta,
342
- handlePhoneCountryChange,
343
- handleCountryCodeChange,
344
- handlePhoneChange,
345
- isSubmitting,
346
- isEditing
347
- } = chunkJCOOINQF_cjs.useAddressForm({
348
- address,
349
- onSuccess,
350
- onError,
351
- locationCacheKey,
352
- defaultCountryId
353
- });
354
- react.useImperativeHandle(
355
- ref,
356
- () => ({
357
- formik,
358
- resetForm: () => formik.resetForm()
359
- }),
360
- [formik]
361
- );
362
- react.useEffect(() => {
363
- onFormikReady?.(formik);
364
- }, [formik, onFormikReady]);
365
- return /* @__PURE__ */ jsxRuntime.jsxs(
366
- "form",
367
- {
368
- name: "address-form",
369
- className: `${address_form_default.addressForm} ${className || ""}`,
370
- onSubmit: formik.handleSubmit,
371
- children: [
372
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formBody, children: [
373
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
374
- /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Name *" }),
375
- /* @__PURE__ */ jsxRuntime.jsx(
376
- "input",
377
- {
378
- className: address_form_default.formControl,
379
- type: "text",
380
- placeholder: "Name",
381
- "aria-label": "name",
382
- autoFocus: true,
383
- ...formik.getFieldProps("customer_name")
384
- }
385
- ),
386
- formik.touched.customer_name && formik.errors.customer_name && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_name })
387
- ] }),
388
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
389
- /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Email *" }),
390
- /* @__PURE__ */ jsxRuntime.jsx(
391
- "input",
392
- {
393
- className: address_form_default.formControl,
394
- type: "email",
395
- placeholder: "Email",
396
- "aria-label": "email",
397
- ...formik.getFieldProps("customer_email")
398
- }
399
- ),
400
- formik.touched.customer_email && formik.errors.customer_email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_email })
401
- ] }),
402
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
403
- /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Phone *" }),
404
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.phoneRow, children: [
405
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.phoneCodeCol, children: /* @__PURE__ */ jsxRuntime.jsx(
406
- search_dropdown_default2,
407
- {
408
- options: countryCodeOptions,
409
- value: formik.values.customer_country_code,
410
- onChange: handlePhoneCountryChange,
411
- placeholder: "Country",
412
- searchPlaceholder: "Search country...",
413
- maxHeight: "250px"
414
- }
415
- ) }),
416
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.phoneInputCol, children: /* @__PURE__ */ jsxRuntime.jsx(
417
- "input",
418
- {
419
- className: address_form_default.formControl,
420
- type: "tel",
421
- placeholder: "Phone",
422
- "aria-label": "phone",
423
- name: "customer_phone",
424
- value: formik.values.customer_phone,
425
- onBlur: formik.handleBlur,
426
- onChange: handlePhoneChange
427
- }
428
- ) })
429
- ] }),
430
- formik.touched.customer_phone && formik.errors.customer_phone && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.customer_phone })
431
- ] }),
432
- /* @__PURE__ */ jsxRuntime.jsx("hr", { className: address_form_default.divider }),
433
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
434
- /* @__PURE__ */ jsxRuntime.jsx("label", { children: "Address (House No, Building, Street, Area) *" }),
435
- /* @__PURE__ */ jsxRuntime.jsx(
436
- "input",
437
- {
438
- className: address_form_default.formControl,
439
- type: "text",
440
- placeholder: "E.g. 1st Cross, 2nd Main, 3rd Stage",
441
- "aria-label": "address",
442
- ...formik.getFieldProps("address")
443
- }
444
- ),
445
- formik.touched.address && formik.errors.address && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.address })
446
- ] }),
447
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.row, children: [
448
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
449
- /* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-capitalize", children: "Country *" }),
450
- /* @__PURE__ */ jsxRuntime.jsx(
451
- search_dropdown_default2,
452
- {
453
- options: countryCodeOptions,
454
- value: selectedCountry?.tld_code,
455
- onChange: handleCountryCodeChange,
456
- placeholder: "Select country",
457
- searchPlaceholder: "Search country...",
458
- maxHeight: "250px",
459
- name: "country_obj"
460
- }
461
- )
462
- ] }) }),
463
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
464
- /* @__PURE__ */ jsxRuntime.jsxs("label", { style: { textTransform: "capitalize" }, children: [
465
- addressMeta?.regionLabel || "State",
466
- " *"
467
- ] }),
468
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.selectWrapper, children: [
469
- /* @__PURE__ */ jsxRuntime.jsxs(
470
- "select",
471
- {
472
- className: address_form_default.formControl,
473
- "aria-label": "state",
474
- "data-select": "",
475
- ...formik.getFieldProps("state_obj"),
476
- children: [
477
- /* @__PURE__ */ jsxRuntime.jsxs("option", { value: "", children: [
478
- "Select ",
479
- addressMeta?.regionLabel || "State"
480
- ] }),
481
- states.map((state) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: state.id, children: state.name }, state.id))
482
- ]
483
- }
484
- ),
485
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.selectArrow, children: /* @__PURE__ */ jsxRuntime.jsx(DownChevron, { width: 12, height: 12 }) })
486
- ] }),
487
- formik.touched.state_obj && formik.errors.state_obj && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.state_obj })
488
- ] }) })
489
- ] }),
490
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.row, children: [
491
- addressMeta?.hasPostal && /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
492
- /* @__PURE__ */ jsxRuntime.jsxs("label", { children: [
493
- addressMeta?.postalLabel || "Postal Code",
494
- " *"
495
- ] }),
496
- /* @__PURE__ */ jsxRuntime.jsx(
497
- "input",
498
- {
499
- className: address_form_default.formControl,
500
- type: "tel",
501
- placeholder: addressMeta?.postalLabel || "Postal Code",
502
- "aria-label": "pincode",
503
- ...formik.getFieldProps("pincode")
504
- }
505
- ),
506
- formik.touched.pincode && formik.errors.pincode && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.pincode })
507
- ] }) }),
508
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.col, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formGroup, children: [
509
- /* @__PURE__ */ jsxRuntime.jsx("label", { children: "City/District *" }),
510
- /* @__PURE__ */ jsxRuntime.jsx(
511
- "input",
512
- {
513
- className: address_form_default.formControl,
514
- type: "text",
515
- placeholder: "E.g. Kochi, Bangalore",
516
- "aria-label": "city",
517
- ...formik.getFieldProps("city")
518
- }
519
- ),
520
- formik.touched.city && formik.errors.city && /* @__PURE__ */ jsxRuntime.jsx("span", { className: address_form_default.error, children: formik.errors.city })
521
- ] }) })
522
- ] }),
523
- /* @__PURE__ */ jsxRuntime.jsx("hr", { className: address_form_default.divider }),
524
- showDefaultCheckbox && /* @__PURE__ */ jsxRuntime.jsx("div", { className: address_form_default.formGroup, children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: address_form_default.checkboxLabel, children: [
525
- /* @__PURE__ */ jsxRuntime.jsx(
526
- "input",
527
- {
528
- type: "checkbox",
529
- className: address_form_default.checkboxInput,
530
- checked: formik.values.is_default || false,
531
- onChange: (e) => {
532
- formik.setFieldValue("is_default", e.target.checked);
533
- }
534
- }
535
- ),
536
- "Make this your default address"
537
- ] }) })
538
- ] }),
539
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: address_form_default.formFooter, children: [
540
- showCancel && onCancel && /* @__PURE__ */ jsxRuntime.jsx(
541
- "button",
542
- {
543
- type: "button",
544
- className: address_form_default.cancelBtn,
545
- onClick: onCancel,
546
- children: "Cancel"
547
- }
548
- ),
549
- renderButton ? renderButton({
550
- type: "submit",
551
- disabled: !formik.isValid || isSubmitting,
552
- loading: isSubmitting,
553
- children: isEditing ? submitLabel : submitLabel
554
- }) : /* @__PURE__ */ jsxRuntime.jsx(
555
- "button",
556
- {
557
- type: "submit",
558
- disabled: !formik.isValid || isSubmitting,
559
- className: address_form_default.formControl,
560
- style: {
561
- width: "auto",
562
- cursor: !formik.isValid || isSubmitting ? "not-allowed" : "pointer",
563
- backgroundColor: "var(--primary, #003d29)",
564
- color: "var(--btn-text, #fff)",
565
- border: "none",
566
- padding: "0.5rem 1.5rem",
567
- opacity: !formik.isValid || isSubmitting ? 0.6 : 1
568
- },
569
- children: isSubmitting ? "Saving..." : submitLabel
570
- }
571
- )
572
- ] })
573
- ]
574
- }
575
- );
576
- }
577
- );
578
- AddressForm.displayName = "AddressForm";
579
- var address_form_default2 = AddressForm;
580
- function ShareIcon({
581
- width = 20,
582
- height = 23,
583
- className
584
- }) {
585
- return /* @__PURE__ */ jsxRuntime.jsx(
586
- "svg",
587
- {
588
- width,
589
- height,
590
- viewBox: "0 0 20 23",
591
- fill: "none",
592
- xmlns: "http://www.w3.org/2000/svg",
593
- className,
594
- children: /* @__PURE__ */ jsxRuntime.jsx(
595
- "path",
596
- {
597
- d: "M5.0745 10.357C4.82568 9.90934 4.43524 9.55692 3.96446 9.35513C3.49369 9.15333 2.96923 9.11357 2.47341 9.24209C1.97759 9.37061 1.53848 9.66013 1.22501 10.0652C0.911539 10.4703 0.741455 10.968 0.741455 11.4802C0.741455 11.9924 0.911539 12.4901 1.22501 12.8952C1.53848 13.3003 1.97759 13.5898 2.47341 13.7183C2.96923 13.8469 3.49369 13.8071 3.96446 13.6053C4.43524 13.4035 4.82568 13.0511 5.0745 12.6034M5.0745 10.357C5.25947 10.69 5.36531 11.0723 5.36531 11.4802C5.36531 11.8882 5.25947 12.2715 5.0745 12.6034M5.0745 10.357L14.9045 4.89641M5.0745 12.6034L14.9045 18.064M14.9045 4.89641C15.0486 5.16783 15.2454 5.4078 15.4833 5.60229C15.7213 5.79678 15.9956 5.94187 16.2903 6.0291C16.585 6.11633 16.8941 6.14393 17.1996 6.1103C17.5051 6.07667 17.8008 5.98247 18.0694 5.83323C18.338 5.68398 18.5742 5.48267 18.7642 5.24108C18.9541 4.99948 19.094 4.72244 19.1756 4.42616C19.2572 4.12988 19.279 3.8203 19.2395 3.51552C19.2001 3.21074 19.1003 2.91687 18.946 2.65111C18.6419 2.12739 18.1445 1.74388 17.5606 1.58304C16.9768 1.4222 16.3531 1.49685 15.8237 1.79096C15.2943 2.08507 14.9014 2.57515 14.7295 3.15586C14.5577 3.73656 14.6205 4.36152 14.9045 4.89641ZM14.9045 18.064C14.757 18.3295 14.6632 18.6215 14.6286 18.9232C14.5939 19.225 14.619 19.5306 14.7025 19.8226C14.7859 20.1146 14.9261 20.3874 15.1149 20.6253C15.3038 20.8631 15.5376 21.0615 15.8031 21.209C16.0686 21.3565 16.3606 21.4502 16.6623 21.4849C16.9641 21.5196 17.2697 21.4944 17.5617 21.411C17.8537 21.3276 18.1265 21.1874 18.3644 20.9986C18.6022 20.8097 18.8006 20.5758 18.9481 20.3103C19.246 19.7741 19.3186 19.1415 19.1501 18.5517C18.9816 17.962 18.5857 17.4633 18.0494 17.1654C17.5132 16.8675 16.8806 16.7948 16.2908 16.9634C15.7011 17.1319 15.2024 17.5278 14.9045 18.064Z",
598
- stroke: "currentColor",
599
- strokeWidth: "1.5",
600
- strokeLinecap: "round",
601
- strokeLinejoin: "round"
602
- }
603
- )
604
- }
605
- );
606
- }
607
- var ShareButton = ({
608
- product,
609
- className = "flex space-x-2 items-center hover:text-textSecondary transition-all duration-100",
610
- iconSize = 22
611
- }) => {
612
- const _handleShare = () => {
613
- chunk4CVKE6CC_cjs.shareLink(
614
- `Buy ${product.name} at ${chunk4CVKE6CC_cjs.convertToCurrency(
615
- Number(product.selling_price)
616
- )}`,
617
- product.name
618
- );
619
- };
620
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start gap-4", children: /* @__PURE__ */ jsxRuntime.jsx("button", { className, onClick: _handleShare, children: /* @__PURE__ */ jsxRuntime.jsx(ShareIcon, { width: iconSize, height: iconSize }) }) });
621
- };
622
- var share_button_default = ShareButton;
623
- var checkIfLimitReached = (attribute) => {
624
- return chunkBBRB475I_cjs.isExpired(attribute.expiry_date) || attribute.download_count === 0;
625
- };
626
- var DigitalProductDownloadModal = ({ open, onClose, product, downloadAttribute, onDownload, loading }) => {
627
- return /* @__PURE__ */ jsxRuntime.jsx(
628
- Modal__default.default,
629
- {
630
- classNames: {
631
- modal: "modal modal-lg modal-confirm",
632
- closeButton: "modal-close"
633
- },
634
- open,
635
- onClose,
636
- center: true,
637
- closeIcon: null,
638
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "modal-body px-4 py-2", children: [
639
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-2xl block mb-2 fw-regular", children: [
640
- "Download links for ",
641
- product?.product_name
642
- ] }),
643
- /* @__PURE__ */ jsxRuntime.jsx("hr", { className: "mb-4 mt-2" }),
644
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "download-links", children: loading ? Array.from({ length: 3 }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-100 rounded-1 mb-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
645
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-100", children: [
646
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shine line w-75" }),
647
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shine line w-50 mt-2" })
648
- ] }),
649
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shine w-160 h-32 rounded-1" })
650
- ] }) }, index)) : downloadAttribute.map((attribute, index) => /* @__PURE__ */ jsxRuntime.jsxs(
651
- "div",
652
- {
653
- className: "flex items-center justify-between mt-3",
654
- children: [
655
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
656
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "block text-md lh-1", children: [
657
- "Download link ",
658
- index + 1
659
- ] }),
660
- checkIfLimitReached(attribute) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-danger text-sm lh-1", children: "Download link expired." }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-textSecondary text-sm lh-1", children: [
661
- "Remaining tries: ",
662
- attribute.download_count,
663
- " ",
664
- "\u2022\xA0 Expires",
665
- " ",
666
- chunkBBRB475I_cjs.timeFromNow(attribute.expiry_date)
667
- ] })
668
- ] }),
669
- /* @__PURE__ */ jsxRuntime.jsx(
670
- "button",
671
- {
672
- className: "btn btn-text btn-medium",
673
- onClick: () => onDownload(attribute),
674
- disabled: checkIfLimitReached(attribute),
675
- children: "Download"
676
- }
677
- )
678
- ]
679
- },
680
- `${attribute.download_link}-${index}`
681
- )) }),
682
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-textSecondary text-sm fw-regular p-2 bg-warning-light rounded-2 mt-4", children: [
683
- /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-textSecondary", children: "Warning:" }),
684
- " The download link is time-sensitive and will expire after a set period. You are limited to a specific number of download attempts, with each attempt reducing the remaining tries. To avoid any disruptions, please ensure a stable internet connection before proceeding with the download."
685
- ] })
686
- ] })
687
- }
688
- );
689
- };
690
- var digital_product_download_modal_default = DigitalProductDownloadModal;
691
- function ThemeDataInitializer({
692
- themeData
693
- }) {
694
- const setThemeData = chunkDODFO744_cjs.useThemeData((state) => state.setThemeData);
695
- react.useEffect(() => {
696
- setThemeData(themeData);
697
- }, [themeData]);
698
- return null;
699
- }
700
-
701
- exports.AddressForm = address_form_default2;
702
- exports.DigitalProductDownloadModal = digital_product_download_modal_default;
703
- exports.SearchDropdown = search_dropdown_default2;
704
- exports.ShareButton = share_button_default;
705
- exports.ShareIcon = ShareIcon;
706
- exports.ThemeDataInitializer = ThemeDataInitializer;
23
+ Object.defineProperty(exports, "AddressForm", {
24
+ enumerable: true,
25
+ get: function () { return chunkB3BXKMQA_cjs.address_form_default; }
26
+ });
27
+ Object.defineProperty(exports, "SearchDropdown", {
28
+ enumerable: true,
29
+ get: function () { return chunkV447PVRV_cjs.search_dropdown_default; }
30
+ });
31
+ Object.defineProperty(exports, "ShareButton", {
32
+ enumerable: true,
33
+ get: function () { return chunkHAQWCNDY_cjs.share_button_default; }
34
+ });
35
+ Object.defineProperty(exports, "ShareIcon", {
36
+ enumerable: true,
37
+ get: function () { return chunk3YRSHPM6_cjs.ShareIcon; }
38
+ });
39
+ Object.defineProperty(exports, "DigitalProductDownloadModal", {
40
+ enumerable: true,
41
+ get: function () { return chunk6DXB4O6P_cjs.digital_product_download_modal_default; }
42
+ });
43
+ Object.defineProperty(exports, "ThemeDataInitializer", {
44
+ enumerable: true,
45
+ get: function () { return chunkLHF5BSWO_cjs.ThemeDataInitializer; }
46
+ });