bitsnap-react 1.3.0 → 1.3.2

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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,308 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import z__default from 'zod';
4
+
5
+ type AppleButtonType = 'plain' | 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
6
+ type ColorType = 'black' | 'white' | 'white-outline';
7
+ type Props$1 = {
8
+ style?: {
9
+ width?: string;
10
+ height?: string;
11
+ borderRadius?: string;
12
+ padding?: string;
13
+ boxSizing?: string;
14
+ };
15
+ buttonType?: AppleButtonType;
16
+ colorType?: ColorType;
17
+ items: {
18
+ name: string;
19
+ id: string;
20
+ price: number;
21
+ quantity: number;
22
+ isDeliverable?: boolean;
23
+ metadata?: {
24
+ [key: string]: string | undefined;
25
+ };
26
+ }[];
27
+ onClick?: () => Promise<void>;
28
+ };
29
+ declare function Wrapper$2(props: Props$1): react_jsx_runtime.JSX.Element;
30
+
31
+ type Props = {
32
+ test?: boolean;
33
+ buttonSizeMode?: 'static' | 'fill';
34
+ buttonColor?: 'white' | 'black';
35
+ style?: {
36
+ width?: string;
37
+ };
38
+ items: {
39
+ name: string;
40
+ id: string;
41
+ price: number;
42
+ quantity: number;
43
+ isDeliverable?: boolean;
44
+ metadata?: {
45
+ [key: string]: string | undefined;
46
+ };
47
+ }[];
48
+ };
49
+ declare function Wrapper$1(props: Props): react_jsx_runtime.JSX.Element;
50
+
51
+ declare function BitsnapCart({ projectID, children, onVisibleChange, className, numberOfProductsInCartOptions, }: {
52
+ projectID: string;
53
+ children?: React.ReactNode;
54
+ onVisibleChange?: (isVisible: boolean) => void;
55
+ className?: string;
56
+ numberOfProductsInCartOptions?: {
57
+ style?: React.CSSProperties;
58
+ isVisible?: boolean;
59
+ };
60
+ }): react_jsx_runtime.JSX.Element;
61
+
62
+ type PublicNotificationGroup = {
63
+ id: string;
64
+ isOn?: boolean;
65
+ };
66
+ type NotificationGroup = {
67
+ id: string;
68
+ name: string;
69
+ description?: string;
70
+ howOften?: string;
71
+ isOn?: boolean;
72
+ };
73
+ interface CustomizationTexts {
74
+ title?: string | null;
75
+ description?: string | null;
76
+ managingDescription?: string;
77
+ formTitle?: string;
78
+ formEmailLabel?: string;
79
+ formPhoneLabel?: string;
80
+ formPhoneOptional?: string;
81
+ formEmailPlaceholder?: string;
82
+ formPhonePlaceholder?: string;
83
+ formSubmitButton?: string;
84
+ formSuccessMessage?: string;
85
+ agreementText?: string | ReactNode;
86
+ qrCodeTitle?: string;
87
+ qrCodeSubtitle?: string;
88
+ qrCodeScanText?: string;
89
+ groupsNoSelectionWarning?: string;
90
+ groupsTitle?: string;
91
+ groupsSelectAllButton?: string;
92
+ groupsUpdateButton?: string;
93
+ groupsUpdateSuccess?: string;
94
+ manageDataTitle?: string;
95
+ manageDataDescription?: string;
96
+ manageDataUnsubscribeButton?: string;
97
+ manageDataUnsubscribeDescription?: string;
98
+ manageDataUpdatedMessage?: string;
99
+ loginEmailLabel?: string;
100
+ loginEmailPlaceholder?: string;
101
+ loginSendCodeButton?: string;
102
+ loginIHaveCode?: string;
103
+ loginSendingButton?: string;
104
+ loginCodeLabel?: string;
105
+ loginCodeSentMessage?: string;
106
+ loginChangeEmailButton?: string;
107
+ loginResendCodeButton?: string;
108
+ loginInvalidEmailError?: string;
109
+ loginSlugRequiredError?: string;
110
+ loginVerificationFailedError?: string;
111
+ loginInvalidCodeError?: string;
112
+ loginSendEmailError?: string;
113
+ loginVerifyCodeError?: string;
114
+ loginResendEmailError?: string;
115
+ loginTitle?: string;
116
+ loginDescription?: string;
117
+ }
118
+ interface ComponentClassNames {
119
+ container?: string;
120
+ header?: string;
121
+ headerTitle?: string;
122
+ headerLogo?: string;
123
+ headerDescription?: string;
124
+ groupsContainer?: string;
125
+ groupsList?: string;
126
+ groupItem?: string;
127
+ qrCodeSection?: string;
128
+ qrCodeTitle?: string;
129
+ qrCodeContainer?: string;
130
+ formSection?: string;
131
+ formTitle?: string;
132
+ formContainer?: string;
133
+ manageDataSection?: string;
134
+ manageDataTitle?: string;
135
+ }
136
+ /**
137
+ * Props for the NotificationsComponentPublic component.
138
+ */
139
+ interface NotificationsComponentPublicProps {
140
+ /**
141
+ * Unique identifier for the project (if not provided, productID will be used via CartProvider).
142
+ */
143
+ slug?: string;
144
+ /**
145
+ * Unique identifier for the user.
146
+ */
147
+ userID?: string;
148
+ /**
149
+ * Project ID (alternative to slug, used if slug is not provided).
150
+ */
151
+ productID?: string;
152
+ /**
153
+ * Name of the project, displayed in the component.
154
+ */
155
+ projectName?: string;
156
+ /**
157
+ * URL or path to the project's logo (light mode).
158
+ */
159
+ projectLogo?: string;
160
+ /**
161
+ * URL or path to the project's logo (dark mode).
162
+ */
163
+ projectLogoDark?: string;
164
+ /**
165
+ * Array of notification groups that the user can subscribe to. If you will provide group, we will not show all possible public groups from dashboard.
166
+ */
167
+ groups?: PublicNotificationGroup[];
168
+ /**
169
+ * If true, the component is rendered in "manage my notifications" mode.
170
+ */
171
+ isManaging?: boolean;
172
+ /**
173
+ * Custom texts used throughout the component for i18n or personalisation.
174
+ */
175
+ texts?: CustomizationTexts;
176
+ /**
177
+ * If true, show the QR code section that allows users to get a mobile app.
178
+ */
179
+ showQRCode?: boolean;
180
+ /**
181
+ * If true, show the phone input in the notification form.
182
+ */
183
+ showPhoneInput?: boolean;
184
+ /**
185
+ * List of group IDs to hide from the selection interface.
186
+ */
187
+ hiddenGroupIds?: string[];
188
+ /**
189
+ * Custom CSS class names for various component sections (for easier styling).
190
+ */
191
+ className?: ComponentClassNames;
192
+ }
193
+
194
+ declare function Wrapper(props: NotificationsComponentPublicProps): react_jsx_runtime.JSX.Element;
195
+
196
+ type ErrTypes = 'internal' | 'badInput' | 'notFound';
197
+ type Err = {
198
+ ERR: true;
199
+ error: unknown;
200
+ type?: ErrTypes;
201
+ };
202
+ declare function Err(message: string, type?: ErrTypes): Err;
203
+
204
+ declare function setProjectID(projectID: string): void;
205
+
206
+ declare function setCustomHost(host: string): void;
207
+
208
+ declare enum BillingPeriod {
209
+ DAILY = "daily",
210
+ WEEKLY = "weekly",
211
+ MONTHLY = "monthly",
212
+ QUARTERLY = "quarterly",
213
+ SEMI_ANNUALLY = "semi-annually",
214
+ ANNUALLY = "annually"
215
+ }
216
+ type LinkRequest = z__default.infer<typeof linkRequestSchema>;
217
+ declare const linkRequestSchema: z__default.ZodObject<{
218
+ askForAddress: z__default.ZodOptional<z__default.ZodBoolean>;
219
+ askForPhone: z__default.ZodOptional<z__default.ZodBoolean>;
220
+ askForNote: z__default.ZodOptional<z__default.ZodBoolean>;
221
+ askForNip: z__default.ZodOptional<z__default.ZodBoolean>;
222
+ delivery: z__default.ZodOptional<z__default.ZodArray<z__default.ZodObject<{
223
+ name: z__default.ZodString;
224
+ desc: z__default.ZodOptional<z__default.ZodString>;
225
+ min: z__default.ZodNumber;
226
+ max: z__default.ZodNumber;
227
+ price: z__default.ZodPipe<z__default.ZodNumber, z__default.ZodTransform<number, number>>;
228
+ }, z__default.core.$strip>>>;
229
+ deliveryMethod: z__default.ZodOptional<z__default.ZodString>;
230
+ details: z__default.ZodOptional<z__default.ZodObject<{
231
+ email: z__default.ZodOptional<z__default.ZodString>;
232
+ name: z__default.ZodOptional<z__default.ZodString>;
233
+ lastName: z__default.ZodOptional<z__default.ZodString>;
234
+ phone: z__default.ZodOptional<z__default.ZodString>;
235
+ address: z__default.ZodOptional<z__default.ZodObject<{
236
+ name: z__default.ZodOptional<z__default.ZodString>;
237
+ line1: z__default.ZodOptional<z__default.ZodString>;
238
+ line2: z__default.ZodOptional<z__default.ZodString>;
239
+ city: z__default.ZodOptional<z__default.ZodString>;
240
+ zipCode: z__default.ZodOptional<z__default.ZodString>;
241
+ country: z__default.ZodOptional<z__default.ZodString>;
242
+ }, z__default.core.$strip>>;
243
+ billingAddress: z__default.ZodOptional<z__default.ZodObject<{
244
+ nip: z__default.ZodOptional<z__default.ZodString>;
245
+ name: z__default.ZodOptional<z__default.ZodString>;
246
+ line1: z__default.ZodOptional<z__default.ZodString>;
247
+ line2: z__default.ZodOptional<z__default.ZodString>;
248
+ city: z__default.ZodOptional<z__default.ZodString>;
249
+ zipCode: z__default.ZodOptional<z__default.ZodString>;
250
+ }, z__default.core.$strip>>;
251
+ }, z__default.core.$strip>>;
252
+ countries: z__default.ZodOptional<z__default.ZodArray<z__default.ZodString>>;
253
+ items: z__default.ZodArray<z__default.ZodObject<{
254
+ id: z__default.ZodString;
255
+ quantity: z__default.ZodNumber;
256
+ name: z__default.ZodOptional<z__default.ZodString>;
257
+ description: z__default.ZodOptional<z__default.ZodString>;
258
+ imageURL: z__default.ZodOptional<z__default.ZodString>;
259
+ price: z__default.ZodOptional<z__default.ZodNumber>;
260
+ currency: z__default.ZodOptional<z__default.ZodString>;
261
+ recurring: z__default.ZodOptional<z__default.ZodObject<{
262
+ billingPeriod: z__default.ZodEnum<{
263
+ daily: BillingPeriod.DAILY;
264
+ weekly: BillingPeriod.WEEKLY;
265
+ monthly: BillingPeriod.MONTHLY;
266
+ quarterly: BillingPeriod.QUARTERLY;
267
+ "semi-annually": BillingPeriod.SEMI_ANNUALLY;
268
+ annually: BillingPeriod.ANNUALLY;
269
+ }>;
270
+ trialDays: z__default.ZodOptional<z__default.ZodNumber>;
271
+ subscriptionSchedule: z__default.ZodOptional<z__default.ZodNumber>;
272
+ }, z__default.core.$strip>>;
273
+ }, z__default.core.$strip>>;
274
+ metadata: z__default.ZodOptional<z__default.ZodRecord<z__default.ZodString, z__default.ZodString>>;
275
+ additionalAgreements: z__default.ZodOptional<z__default.ZodArray<z__default.ZodObject<{
276
+ id: z__default.ZodOptional<z__default.ZodString>;
277
+ name: z__default.ZodString;
278
+ description: z__default.ZodOptional<z__default.ZodString>;
279
+ required: z__default.ZodDefault<z__default.ZodBoolean>;
280
+ answer: z__default.ZodOptional<z__default.ZodBoolean>;
281
+ }, z__default.core.$strip>>>;
282
+ blikCode: z__default.ZodOptional<z__default.ZodString>;
283
+ couponCode: z__default.ZodOptional<z__default.ZodString>;
284
+ redirect: z__default.ZodOptional<z__default.ZodObject<{
285
+ successURL: z__default.ZodOptional<z__default.ZodString>;
286
+ cancelURL: z__default.ZodOptional<z__default.ZodString>;
287
+ }, z__default.core.$strip>>;
288
+ }, z__default.core.$strip>;
289
+
290
+ declare namespace Bitsnap {
291
+ function addProductToCart(id: string, quantity?: number, metadata?: Record<string, string | undefined>): Promise<Err | undefined>;
292
+ function showCart(): void;
293
+ function hideCart(): void;
294
+ }
295
+ declare function createPaymentURL(request: LinkRequest): Promise<Err | {
296
+ url: string;
297
+ }>;
298
+ declare function createCheckout(request: LinkRequest & {
299
+ apiKey?: string;
300
+ testMode?: boolean;
301
+ }): Promise<{
302
+ status: string;
303
+ redirectURL: string;
304
+ }>;
305
+ declare function getReferenceIfPossible(): string | undefined;
306
+ declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
307
+
308
+ export { Wrapper$2 as ApplePayButton, Bitsnap, BitsnapCart as BitsnapCheckout, type ComponentClassNames, type CustomizationTexts, Wrapper$1 as GooglePayButton, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type NotificationsComponentPublicProps, type PublicNotificationGroup, createCheckout, createPaymentURL, getReferenceIfPossible, injectReferenceToRequestIfNeeded, setCustomHost, setProjectID };
@@ -0,0 +1,308 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+ import z__default from 'zod';
4
+
5
+ type AppleButtonType = 'plain' | 'add-money' | 'book' | 'buy' | 'check-out' | 'continue' | 'contribute' | 'donate' | 'order' | 'pay' | 'reload' | 'rent' | 'set-up' | 'subscribe' | 'support' | 'tip' | 'top-up';
6
+ type ColorType = 'black' | 'white' | 'white-outline';
7
+ type Props$1 = {
8
+ style?: {
9
+ width?: string;
10
+ height?: string;
11
+ borderRadius?: string;
12
+ padding?: string;
13
+ boxSizing?: string;
14
+ };
15
+ buttonType?: AppleButtonType;
16
+ colorType?: ColorType;
17
+ items: {
18
+ name: string;
19
+ id: string;
20
+ price: number;
21
+ quantity: number;
22
+ isDeliverable?: boolean;
23
+ metadata?: {
24
+ [key: string]: string | undefined;
25
+ };
26
+ }[];
27
+ onClick?: () => Promise<void>;
28
+ };
29
+ declare function Wrapper$2(props: Props$1): react_jsx_runtime.JSX.Element;
30
+
31
+ type Props = {
32
+ test?: boolean;
33
+ buttonSizeMode?: 'static' | 'fill';
34
+ buttonColor?: 'white' | 'black';
35
+ style?: {
36
+ width?: string;
37
+ };
38
+ items: {
39
+ name: string;
40
+ id: string;
41
+ price: number;
42
+ quantity: number;
43
+ isDeliverable?: boolean;
44
+ metadata?: {
45
+ [key: string]: string | undefined;
46
+ };
47
+ }[];
48
+ };
49
+ declare function Wrapper$1(props: Props): react_jsx_runtime.JSX.Element;
50
+
51
+ declare function BitsnapCart({ projectID, children, onVisibleChange, className, numberOfProductsInCartOptions, }: {
52
+ projectID: string;
53
+ children?: React.ReactNode;
54
+ onVisibleChange?: (isVisible: boolean) => void;
55
+ className?: string;
56
+ numberOfProductsInCartOptions?: {
57
+ style?: React.CSSProperties;
58
+ isVisible?: boolean;
59
+ };
60
+ }): react_jsx_runtime.JSX.Element;
61
+
62
+ type PublicNotificationGroup = {
63
+ id: string;
64
+ isOn?: boolean;
65
+ };
66
+ type NotificationGroup = {
67
+ id: string;
68
+ name: string;
69
+ description?: string;
70
+ howOften?: string;
71
+ isOn?: boolean;
72
+ };
73
+ interface CustomizationTexts {
74
+ title?: string | null;
75
+ description?: string | null;
76
+ managingDescription?: string;
77
+ formTitle?: string;
78
+ formEmailLabel?: string;
79
+ formPhoneLabel?: string;
80
+ formPhoneOptional?: string;
81
+ formEmailPlaceholder?: string;
82
+ formPhonePlaceholder?: string;
83
+ formSubmitButton?: string;
84
+ formSuccessMessage?: string;
85
+ agreementText?: string | ReactNode;
86
+ qrCodeTitle?: string;
87
+ qrCodeSubtitle?: string;
88
+ qrCodeScanText?: string;
89
+ groupsNoSelectionWarning?: string;
90
+ groupsTitle?: string;
91
+ groupsSelectAllButton?: string;
92
+ groupsUpdateButton?: string;
93
+ groupsUpdateSuccess?: string;
94
+ manageDataTitle?: string;
95
+ manageDataDescription?: string;
96
+ manageDataUnsubscribeButton?: string;
97
+ manageDataUnsubscribeDescription?: string;
98
+ manageDataUpdatedMessage?: string;
99
+ loginEmailLabel?: string;
100
+ loginEmailPlaceholder?: string;
101
+ loginSendCodeButton?: string;
102
+ loginIHaveCode?: string;
103
+ loginSendingButton?: string;
104
+ loginCodeLabel?: string;
105
+ loginCodeSentMessage?: string;
106
+ loginChangeEmailButton?: string;
107
+ loginResendCodeButton?: string;
108
+ loginInvalidEmailError?: string;
109
+ loginSlugRequiredError?: string;
110
+ loginVerificationFailedError?: string;
111
+ loginInvalidCodeError?: string;
112
+ loginSendEmailError?: string;
113
+ loginVerifyCodeError?: string;
114
+ loginResendEmailError?: string;
115
+ loginTitle?: string;
116
+ loginDescription?: string;
117
+ }
118
+ interface ComponentClassNames {
119
+ container?: string;
120
+ header?: string;
121
+ headerTitle?: string;
122
+ headerLogo?: string;
123
+ headerDescription?: string;
124
+ groupsContainer?: string;
125
+ groupsList?: string;
126
+ groupItem?: string;
127
+ qrCodeSection?: string;
128
+ qrCodeTitle?: string;
129
+ qrCodeContainer?: string;
130
+ formSection?: string;
131
+ formTitle?: string;
132
+ formContainer?: string;
133
+ manageDataSection?: string;
134
+ manageDataTitle?: string;
135
+ }
136
+ /**
137
+ * Props for the NotificationsComponentPublic component.
138
+ */
139
+ interface NotificationsComponentPublicProps {
140
+ /**
141
+ * Unique identifier for the project (if not provided, productID will be used via CartProvider).
142
+ */
143
+ slug?: string;
144
+ /**
145
+ * Unique identifier for the user.
146
+ */
147
+ userID?: string;
148
+ /**
149
+ * Project ID (alternative to slug, used if slug is not provided).
150
+ */
151
+ productID?: string;
152
+ /**
153
+ * Name of the project, displayed in the component.
154
+ */
155
+ projectName?: string;
156
+ /**
157
+ * URL or path to the project's logo (light mode).
158
+ */
159
+ projectLogo?: string;
160
+ /**
161
+ * URL or path to the project's logo (dark mode).
162
+ */
163
+ projectLogoDark?: string;
164
+ /**
165
+ * Array of notification groups that the user can subscribe to. If you will provide group, we will not show all possible public groups from dashboard.
166
+ */
167
+ groups?: PublicNotificationGroup[];
168
+ /**
169
+ * If true, the component is rendered in "manage my notifications" mode.
170
+ */
171
+ isManaging?: boolean;
172
+ /**
173
+ * Custom texts used throughout the component for i18n or personalisation.
174
+ */
175
+ texts?: CustomizationTexts;
176
+ /**
177
+ * If true, show the QR code section that allows users to get a mobile app.
178
+ */
179
+ showQRCode?: boolean;
180
+ /**
181
+ * If true, show the phone input in the notification form.
182
+ */
183
+ showPhoneInput?: boolean;
184
+ /**
185
+ * List of group IDs to hide from the selection interface.
186
+ */
187
+ hiddenGroupIds?: string[];
188
+ /**
189
+ * Custom CSS class names for various component sections (for easier styling).
190
+ */
191
+ className?: ComponentClassNames;
192
+ }
193
+
194
+ declare function Wrapper(props: NotificationsComponentPublicProps): react_jsx_runtime.JSX.Element;
195
+
196
+ type ErrTypes = 'internal' | 'badInput' | 'notFound';
197
+ type Err = {
198
+ ERR: true;
199
+ error: unknown;
200
+ type?: ErrTypes;
201
+ };
202
+ declare function Err(message: string, type?: ErrTypes): Err;
203
+
204
+ declare function setProjectID(projectID: string): void;
205
+
206
+ declare function setCustomHost(host: string): void;
207
+
208
+ declare enum BillingPeriod {
209
+ DAILY = "daily",
210
+ WEEKLY = "weekly",
211
+ MONTHLY = "monthly",
212
+ QUARTERLY = "quarterly",
213
+ SEMI_ANNUALLY = "semi-annually",
214
+ ANNUALLY = "annually"
215
+ }
216
+ type LinkRequest = z__default.infer<typeof linkRequestSchema>;
217
+ declare const linkRequestSchema: z__default.ZodObject<{
218
+ askForAddress: z__default.ZodOptional<z__default.ZodBoolean>;
219
+ askForPhone: z__default.ZodOptional<z__default.ZodBoolean>;
220
+ askForNote: z__default.ZodOptional<z__default.ZodBoolean>;
221
+ askForNip: z__default.ZodOptional<z__default.ZodBoolean>;
222
+ delivery: z__default.ZodOptional<z__default.ZodArray<z__default.ZodObject<{
223
+ name: z__default.ZodString;
224
+ desc: z__default.ZodOptional<z__default.ZodString>;
225
+ min: z__default.ZodNumber;
226
+ max: z__default.ZodNumber;
227
+ price: z__default.ZodPipe<z__default.ZodNumber, z__default.ZodTransform<number, number>>;
228
+ }, z__default.core.$strip>>>;
229
+ deliveryMethod: z__default.ZodOptional<z__default.ZodString>;
230
+ details: z__default.ZodOptional<z__default.ZodObject<{
231
+ email: z__default.ZodOptional<z__default.ZodString>;
232
+ name: z__default.ZodOptional<z__default.ZodString>;
233
+ lastName: z__default.ZodOptional<z__default.ZodString>;
234
+ phone: z__default.ZodOptional<z__default.ZodString>;
235
+ address: z__default.ZodOptional<z__default.ZodObject<{
236
+ name: z__default.ZodOptional<z__default.ZodString>;
237
+ line1: z__default.ZodOptional<z__default.ZodString>;
238
+ line2: z__default.ZodOptional<z__default.ZodString>;
239
+ city: z__default.ZodOptional<z__default.ZodString>;
240
+ zipCode: z__default.ZodOptional<z__default.ZodString>;
241
+ country: z__default.ZodOptional<z__default.ZodString>;
242
+ }, z__default.core.$strip>>;
243
+ billingAddress: z__default.ZodOptional<z__default.ZodObject<{
244
+ nip: z__default.ZodOptional<z__default.ZodString>;
245
+ name: z__default.ZodOptional<z__default.ZodString>;
246
+ line1: z__default.ZodOptional<z__default.ZodString>;
247
+ line2: z__default.ZodOptional<z__default.ZodString>;
248
+ city: z__default.ZodOptional<z__default.ZodString>;
249
+ zipCode: z__default.ZodOptional<z__default.ZodString>;
250
+ }, z__default.core.$strip>>;
251
+ }, z__default.core.$strip>>;
252
+ countries: z__default.ZodOptional<z__default.ZodArray<z__default.ZodString>>;
253
+ items: z__default.ZodArray<z__default.ZodObject<{
254
+ id: z__default.ZodString;
255
+ quantity: z__default.ZodNumber;
256
+ name: z__default.ZodOptional<z__default.ZodString>;
257
+ description: z__default.ZodOptional<z__default.ZodString>;
258
+ imageURL: z__default.ZodOptional<z__default.ZodString>;
259
+ price: z__default.ZodOptional<z__default.ZodNumber>;
260
+ currency: z__default.ZodOptional<z__default.ZodString>;
261
+ recurring: z__default.ZodOptional<z__default.ZodObject<{
262
+ billingPeriod: z__default.ZodEnum<{
263
+ daily: BillingPeriod.DAILY;
264
+ weekly: BillingPeriod.WEEKLY;
265
+ monthly: BillingPeriod.MONTHLY;
266
+ quarterly: BillingPeriod.QUARTERLY;
267
+ "semi-annually": BillingPeriod.SEMI_ANNUALLY;
268
+ annually: BillingPeriod.ANNUALLY;
269
+ }>;
270
+ trialDays: z__default.ZodOptional<z__default.ZodNumber>;
271
+ subscriptionSchedule: z__default.ZodOptional<z__default.ZodNumber>;
272
+ }, z__default.core.$strip>>;
273
+ }, z__default.core.$strip>>;
274
+ metadata: z__default.ZodOptional<z__default.ZodRecord<z__default.ZodString, z__default.ZodString>>;
275
+ additionalAgreements: z__default.ZodOptional<z__default.ZodArray<z__default.ZodObject<{
276
+ id: z__default.ZodOptional<z__default.ZodString>;
277
+ name: z__default.ZodString;
278
+ description: z__default.ZodOptional<z__default.ZodString>;
279
+ required: z__default.ZodDefault<z__default.ZodBoolean>;
280
+ answer: z__default.ZodOptional<z__default.ZodBoolean>;
281
+ }, z__default.core.$strip>>>;
282
+ blikCode: z__default.ZodOptional<z__default.ZodString>;
283
+ couponCode: z__default.ZodOptional<z__default.ZodString>;
284
+ redirect: z__default.ZodOptional<z__default.ZodObject<{
285
+ successURL: z__default.ZodOptional<z__default.ZodString>;
286
+ cancelURL: z__default.ZodOptional<z__default.ZodString>;
287
+ }, z__default.core.$strip>>;
288
+ }, z__default.core.$strip>;
289
+
290
+ declare namespace Bitsnap {
291
+ function addProductToCart(id: string, quantity?: number, metadata?: Record<string, string | undefined>): Promise<Err | undefined>;
292
+ function showCart(): void;
293
+ function hideCart(): void;
294
+ }
295
+ declare function createPaymentURL(request: LinkRequest): Promise<Err | {
296
+ url: string;
297
+ }>;
298
+ declare function createCheckout(request: LinkRequest & {
299
+ apiKey?: string;
300
+ testMode?: boolean;
301
+ }): Promise<{
302
+ status: string;
303
+ redirectURL: string;
304
+ }>;
305
+ declare function getReferenceIfPossible(): string | undefined;
306
+ declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
307
+
308
+ export { Wrapper$2 as ApplePayButton, Bitsnap, BitsnapCart as BitsnapCheckout, type ComponentClassNames, type CustomizationTexts, Wrapper$1 as GooglePayButton, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type NotificationsComponentPublicProps, type PublicNotificationGroup, createCheckout, createPaymentURL, getReferenceIfPossible, injectReferenceToRequestIfNeeded, setCustomHost, setProjectID };
package/dist/index.js CHANGED
@@ -4027,12 +4027,12 @@ function reducer(state, action) {
4027
4027
  return {
4028
4028
  ...state,
4029
4029
  groupsProvided: action.value,
4030
- groups: state.groups.filter(
4030
+ groups: action.value != null && action.value.length > 0 ? state.groups.filter(
4031
4031
  (group) => {
4032
4032
  var _a;
4033
4033
  return ((_a = action.value) == null ? void 0 : _a.find((g) => g.id === group.id)) != null;
4034
4034
  }
4035
- )
4035
+ ) : state.groups
4036
4036
  };
4037
4037
  }
4038
4038
  case "SET_GROUPS": {
@@ -4192,7 +4192,15 @@ function NotificationsComponentPublic(props) {
4192
4192
  }, [groupsDownloaded, isGroupsDownloading, props.groups]);
4193
4193
  const timeoutRef = (0, import_react19.useRef)(null);
4194
4194
  (0, import_react19.useEffect)(() => {
4195
- dispatch({ type: "SET_PUBLIC_GROUPS", value: props.groups });
4195
+ var _a2;
4196
+ let preparedGroups = (_a2 = props.groups) == null ? void 0 : _a2.map((el) => {
4197
+ if (el.id.startsWith("group_")) {
4198
+ return el;
4199
+ }
4200
+ el.id = `group_${el.id}`;
4201
+ return el;
4202
+ });
4203
+ dispatch({ type: "SET_PUBLIC_GROUPS", value: preparedGroups });
4196
4204
  }, [props.groups]);
4197
4205
  const {
4198
4206
  texts,