@nanas-home/hub-common 0.6.233 → 0.10.265

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,1268 @@
1
+ import dayjs from 'dayjs';
2
+ import { Token, Container } from '@freshgum/typedi';
3
+ import { jwtDecode } from 'jwt-decode';
4
+
5
+ // src/contracts/generated/apiRoute.ts
6
+ var apiParams = {
7
+ general: {
8
+ segment: "segment"
9
+ },
10
+ user: {
11
+ id: "id"
12
+ }
13
+ };
14
+ var apiRoute = {
15
+ home: "/",
16
+ swagger: "/swagger",
17
+ common: {
18
+ auth: {
19
+ prefix: "/auth",
20
+ devJwt: "/jwt",
21
+ login: "/login",
22
+ signup: "/signup",
23
+ swagger: { name: "Auth", description: "Endpoints for login, sign up etc" },
24
+ token: {
25
+ prefix: "/token",
26
+ swagger: { name: "AuthToken", description: "Endpoints for creating an API token" }
27
+ }
28
+ },
29
+ version: "/version"
30
+ },
31
+ admin: {
32
+ activity: {
33
+ prefix: "/admin/activity",
34
+ swagger: {
35
+ name: "Activity",
36
+ description: "Endpoints for retrieving and managing activities"
37
+ }
38
+ },
39
+ address: {
40
+ prefix: "/admin/address",
41
+ byLink: "/link",
42
+ lookup: "/lookup",
43
+ swagger: { name: "Addresses", description: "Endpoints for managing addresses" }
44
+ },
45
+ answer: {
46
+ prefix: "/admin/answer",
47
+ swagger: { name: "Answers", description: "Endpoints for managing answers to signup questions" }
48
+ },
49
+ booking: {
50
+ prefix: "/admin/booking",
51
+ byUser: "/user",
52
+ swagger: { name: "Bookings", description: "Endpoints for managing bookings" }
53
+ },
54
+ comment: {
55
+ prefix: "/admin/comment",
56
+ byLink: "/link",
57
+ swagger: { name: "Comments", description: "Endpoints for managing Comments" }
58
+ },
59
+ membership: {
60
+ prefix: "/admin/membership",
61
+ swagger: { name: "Memberships", description: "Endpoints for managing Memberships" }
62
+ },
63
+ pet: {
64
+ prefix: "/admin/pet",
65
+ byUser: "/user",
66
+ swagger: { name: "Pets", description: "Endpoints for managing Pets" }
67
+ },
68
+ question: {
69
+ prefix: "/admin/question",
70
+ swagger: {
71
+ name: "Questions",
72
+ description: "Endpoints for managing questions that users need to answer in order to complete their profiles"
73
+ }
74
+ },
75
+ upload: {
76
+ prefix: "/admin/upload",
77
+ viewRaw: "/view-raw",
78
+ image: "/image",
79
+ swagger: { name: "Uploads", description: "Endpoints for managing Uploads" }
80
+ },
81
+ user: {
82
+ prefix: "/admin/user",
83
+ swagger: { name: "Users", description: "Endpoints for Admins to manage Users" }
84
+ },
85
+ userMembership: {
86
+ prefix: "/admin/user-membership",
87
+ byUser: "/user",
88
+ swagger: { name: "UserMemberships", description: "Endpoints for managing User's Memberships" }
89
+ },
90
+ userPermission: {
91
+ prefix: "/admin/user-permission",
92
+ swagger: { name: "UserPermissions", description: "Endpoints for getting and managing user permissions." }
93
+ }
94
+ },
95
+ client: {
96
+ answer: {
97
+ prefix: "/answer",
98
+ forProfile: "/profile",
99
+ forPet: "/pet",
100
+ swagger: { name: "Answers", description: "Endpoints for managing answers to signup questions" }
101
+ },
102
+ booking: {
103
+ prefix: "/booking",
104
+ swagger: { name: "Bookings", description: "Endpoints for User to manage their Bookings" }
105
+ },
106
+ membership: {
107
+ prefix: "/membership",
108
+ swagger: { name: "MembershipTiers", description: "Endpoints for public TierMemberships" }
109
+ },
110
+ pet: {
111
+ prefix: "/pet",
112
+ swagger: { name: "Pets", description: "Endpoints for User to manage their Pets" }
113
+ },
114
+ profile: {
115
+ prefix: "/profile",
116
+ avatar: "/avatar",
117
+ answers: "/answers",
118
+ swagger: { name: "Profile", description: "Endpoints for User to manage their Profile" }
119
+ },
120
+ upload: {
121
+ prefix: "/upload",
122
+ image: "/image",
123
+ swagger: { name: "Uploads", description: "Endpoints for managing Uploads" }
124
+ }
125
+ }
126
+ };
127
+
128
+ // src/contracts/generated/searchColumns.ts
129
+ var searchColumns = {
130
+ question: [{ "property": "forTypes", "type": 1 }, { "property": "transKey", "type": 2 }, { "property": "fallback", "type": 2 }, { "property": "type", "type": 0 }, { "property": "sortOrder", "type": 3 }, { "property": "visible", "type": 4 }, { "property": "notes", "type": 2 }],
131
+ pet: [{ "property": "type", "type": 1 }, { "property": "sex", "type": 2 }, { "property": "breed", "type": 2 }, { "property": "neutered", "type": 2 }, { "property": "name", "type": 2 }, { "property": "notes", "type": 2 }, { "property": "dateOfBirth", "type": 5 }],
132
+ user: [{ "property": "types", "type": 1 }, { "property": "firstName", "type": 2 }, { "property": "lastName", "type": 2 }, { "property": "email", "type": 2 }, { "property": "hubspotId", "type": 2 }, { "property": "flags", "type": 1 }, { "property": "dateCreated", "type": 5 }],
133
+ upload: [{ "property": "linkUuid", "type": 2 }, { "property": "linkType", "type": 2 }, { "property": "type", "type": 2 }, { "property": "fileName", "type": 2 }, { "property": "blobType", "type": 2 }, { "property": "sizeInKb", "type": 2 }, { "property": "dateCreated", "type": 5 }],
134
+ booking: [{ "property": "startDate", "type": 5 }, { "property": "endDate", "type": 5 }, { "property": "status", "type": 2 }, { "property": "notes", "type": 2 }],
135
+ address: [{ "property": "name", "type": 2 }, { "property": "street", "type": 2 }, { "property": "city", "type": 2 }, { "property": "postalCode", "type": 2 }, { "property": "country", "type": 2 }]
136
+ };
137
+
138
+ // src/contracts/generated/restrictions/permissionRestriction.ts
139
+ var PermissionRestriction = {
140
+ name: { maxLength: 50 }
141
+ };
142
+
143
+ // src/contracts/generated/restrictions/userRestriction.ts
144
+ var UserRestriction = {
145
+ firstName: { minLength: 3, maxLength: 80 },
146
+ lastName: { minLength: 3, maxLength: 80 },
147
+ email: { minLength: 5, maxLength: 150 },
148
+ password: { minLength: 5, maxLength: 50 },
149
+ hubspotId: { maxLength: 50 },
150
+ flags: { maxLength: 150 }
151
+ };
152
+
153
+ // src/contracts/generated/restrictions/unavailabilityRestriction.ts
154
+ var UnavailabilityRestriction = {
155
+ notes: { maxLength: 500 }
156
+ };
157
+
158
+ // src/contracts/generated/restrictions/activityRestriction.ts
159
+ var ActivityRestriction = {
160
+ details: { maxLength: 500 }
161
+ };
162
+
163
+ // src/contracts/generated/restrictions/answerRestriction.ts
164
+ var AnswerRestriction = {
165
+ answer: { minLength: 1, maxLength: 500 },
166
+ notes: { minLength: 0, maxLength: 1e3 }
167
+ };
168
+
169
+ // src/contracts/generated/restrictions/petRestriction.ts
170
+ var PetRestriction = {
171
+ name: { minLength: 3, maxLength: 80 },
172
+ breed: { minLength: 3, maxLength: 80 },
173
+ notes: { minLength: 0, maxLength: 1e3 }
174
+ };
175
+
176
+ // src/contracts/generated/restrictions/drivingRouteRestriction.ts
177
+ var DrivingRouteRestriction = {
178
+ notes: { maxLength: 500 }
179
+ };
180
+
181
+ // src/contracts/generated/restrictions/questionRestriction.ts
182
+ var QuestionRestriction = {
183
+ transKey: { minLength: 3, maxLength: 50 },
184
+ fallback: { minLength: 1, maxLength: 500 },
185
+ forTypes: { minLength: 0, maxLength: 100 },
186
+ notes: { minLength: 0, maxLength: 1e3 }
187
+ };
188
+
189
+ // src/contracts/generated/restrictions/commentRestriction.ts
190
+ var CommentRestriction = {
191
+ name: { maxLength: 80 },
192
+ comment: { maxLength: 1e3 }
193
+ };
194
+
195
+ // src/contracts/generated/restrictions/addressRestriction.ts
196
+ var AddressRestriction = {
197
+ name: { minLength: 3, maxLength: 50 },
198
+ street: { minLength: 3, maxLength: 150 },
199
+ city: { minLength: 3, maxLength: 80 },
200
+ postalCode: { minLength: 3, maxLength: 20 },
201
+ country: { minLength: 3, maxLength: 100 },
202
+ notes: { minLength: 0, maxLength: 1e3 }
203
+ };
204
+
205
+ // src/contracts/generated/restrictions/uploadRestriction.ts
206
+ var UploadRestriction = {
207
+ fileName: { minLength: 3, maxLength: 150 },
208
+ blobType: { minLength: 1, maxLength: 50 }
209
+ };
210
+
211
+ // src/contracts/generated/restrictions/bookingRestriction.ts
212
+ var BookingRestriction = {
213
+ notes: { maxLength: 250 }
214
+ };
215
+ var BookingAddonRestriction = {
216
+ notes: { maxLength: 250 }
217
+ };
218
+
219
+ // src/contracts/generated/enum/addressLinkType.ts
220
+ var AddressLinkType = /* @__PURE__ */ ((AddressLinkType2) => {
221
+ AddressLinkType2[AddressLinkType2["Unknown"] = 0] = "Unknown";
222
+ AddressLinkType2[AddressLinkType2["User"] = 1] = "User";
223
+ return AddressLinkType2;
224
+ })(AddressLinkType || {});
225
+
226
+ // src/contracts/generated/enum/membershipStatus.ts
227
+ var MembershipStatus = /* @__PURE__ */ ((MembershipStatus2) => {
228
+ MembershipStatus2[MembershipStatus2["Unknown"] = 0] = "Unknown";
229
+ MembershipStatus2[MembershipStatus2["Active"] = 1] = "Active";
230
+ MembershipStatus2[MembershipStatus2["PendingPayment"] = 2] = "PendingPayment";
231
+ MembershipStatus2[MembershipStatus2["Paused"] = 5] = "Paused";
232
+ MembershipStatus2[MembershipStatus2["Cancelled"] = 10] = "Cancelled";
233
+ MembershipStatus2[MembershipStatus2["Removed"] = 11] = "Removed";
234
+ return MembershipStatus2;
235
+ })(MembershipStatus || {});
236
+
237
+ // src/contracts/generated/enum/uploadLinkType.ts
238
+ var UploadLinkType = /* @__PURE__ */ ((UploadLinkType2) => {
239
+ UploadLinkType2[UploadLinkType2["Unknown"] = 0] = "Unknown";
240
+ UploadLinkType2[UploadLinkType2["User"] = 1] = "User";
241
+ UploadLinkType2[UploadLinkType2["Pet"] = 2] = "Pet";
242
+ return UploadLinkType2;
243
+ })(UploadLinkType || {});
244
+ var UploadType = /* @__PURE__ */ ((UploadType2) => {
245
+ UploadType2[UploadType2["Unknown"] = 0] = "Unknown";
246
+ UploadType2[UploadType2["UserProfilePic"] = 5] = "UserProfilePic";
247
+ UploadType2[UploadType2["PetProfilePic"] = 10] = "PetProfilePic";
248
+ UploadType2[UploadType2["PetExtraPic"] = 11] = "PetExtraPic";
249
+ UploadType2[UploadType2["HomePhoto"] = 20] = "HomePhoto";
250
+ return UploadType2;
251
+ })(UploadType || {});
252
+ var uploadsThatNeedEncryption = [];
253
+
254
+ // src/contracts/generated/enum/commentLinkType.ts
255
+ var CommentLinkType = /* @__PURE__ */ ((CommentLinkType2) => {
256
+ CommentLinkType2[CommentLinkType2["Unknown"] = 0] = "Unknown";
257
+ CommentLinkType2[CommentLinkType2["User"] = 1] = "User";
258
+ CommentLinkType2[CommentLinkType2["Pet"] = 2] = "Pet";
259
+ CommentLinkType2[CommentLinkType2["Booking"] = 3] = "Booking";
260
+ return CommentLinkType2;
261
+ })(CommentLinkType || {});
262
+
263
+ // src/contracts/generated/enum/networkState.ts
264
+ var NetworkState = /* @__PURE__ */ ((NetworkState2) => {
265
+ NetworkState2[NetworkState2["Pending"] = 0] = "Pending";
266
+ NetworkState2[NetworkState2["Loading"] = 1] = "Loading";
267
+ NetworkState2[NetworkState2["Success"] = 2] = "Success";
268
+ NetworkState2[NetworkState2["Error"] = 3] = "Error";
269
+ return NetworkState2;
270
+ })(NetworkState || {});
271
+
272
+ // src/contracts/generated/enum/userAccountFlagType.ts
273
+ var UserAccountFlagType = /* @__PURE__ */ ((UserAccountFlagType2) => {
274
+ UserAccountFlagType2[UserAccountFlagType2["Unknown"] = 0] = "Unknown";
275
+ UserAccountFlagType2[UserAccountFlagType2["ChangePassword"] = 1] = "ChangePassword";
276
+ return UserAccountFlagType2;
277
+ })(UserAccountFlagType || {});
278
+
279
+ // src/contracts/generated/enum/userType.ts
280
+ var UserType = /* @__PURE__ */ ((UserType2) => {
281
+ UserType2[UserType2["Unknown"] = 0] = "Unknown";
282
+ UserType2[UserType2["Owner"] = 1] = "Owner";
283
+ UserType2[UserType2["Host"] = 2] = "Host";
284
+ UserType2[UserType2["Driver"] = 3] = "Driver";
285
+ UserType2[UserType2["Admin"] = 50] = "Admin";
286
+ UserType2[UserType2["BotToken"] = 99] = "BotToken";
287
+ return UserType2;
288
+ })(UserType || {});
289
+
290
+ // src/contracts/generated/enum/permissionType.ts
291
+ var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
292
+ PermissionType2[PermissionType2["None"] = 0] = "None";
293
+ PermissionType2[PermissionType2["All"] = 1] = "All";
294
+ PermissionType2[PermissionType2["AdminLogin"] = 2] = "AdminLogin";
295
+ PermissionType2[PermissionType2["UserView"] = 20] = "UserView";
296
+ PermissionType2[PermissionType2["UserManage"] = 21] = "UserManage";
297
+ PermissionType2[PermissionType2["UserDelete"] = 22] = "UserDelete";
298
+ PermissionType2[PermissionType2["ActivitiesView"] = 30] = "ActivitiesView";
299
+ PermissionType2[PermissionType2["UserPermissionView"] = 40] = "UserPermissionView";
300
+ PermissionType2[PermissionType2["UserPermissionManage"] = 41] = "UserPermissionManage";
301
+ PermissionType2[PermissionType2["UserPermissionDelete"] = 42] = "UserPermissionDelete";
302
+ PermissionType2[PermissionType2["PetView"] = 60] = "PetView";
303
+ PermissionType2[PermissionType2["PetManage"] = 61] = "PetManage";
304
+ PermissionType2[PermissionType2["PetDelete"] = 62] = "PetDelete";
305
+ PermissionType2[PermissionType2["CommentView"] = 80] = "CommentView";
306
+ PermissionType2[PermissionType2["CommentManage"] = 81] = "CommentManage";
307
+ PermissionType2[PermissionType2["CommentDelete"] = 82] = "CommentDelete";
308
+ PermissionType2[PermissionType2["AddressView"] = 100] = "AddressView";
309
+ PermissionType2[PermissionType2["AddressManage"] = 101] = "AddressManage";
310
+ PermissionType2[PermissionType2["AddressDelete"] = 102] = "AddressDelete";
311
+ PermissionType2[PermissionType2["BookingView"] = 120] = "BookingView";
312
+ PermissionType2[PermissionType2["BookingManage"] = 121] = "BookingManage";
313
+ PermissionType2[PermissionType2["BookingDelete"] = 122] = "BookingDelete";
314
+ PermissionType2[PermissionType2["AnswerView"] = 140] = "AnswerView";
315
+ PermissionType2[PermissionType2["AnswerManage"] = 141] = "AnswerManage";
316
+ PermissionType2[PermissionType2["AnswerDelete"] = 142] = "AnswerDelete";
317
+ PermissionType2[PermissionType2["QuestionView"] = 150] = "QuestionView";
318
+ PermissionType2[PermissionType2["QuestionManage"] = 151] = "QuestionManage";
319
+ PermissionType2[PermissionType2["QuestionDelete"] = 152] = "QuestionDelete";
320
+ PermissionType2[PermissionType2["UploadView"] = 160] = "UploadView";
321
+ PermissionType2[PermissionType2["UploadManage"] = 161] = "UploadManage";
322
+ PermissionType2[PermissionType2["UploadDelete"] = 162] = "UploadDelete";
323
+ PermissionType2[PermissionType2["MembershipView"] = 170] = "MembershipView";
324
+ PermissionType2[PermissionType2["MembershipManage"] = 171] = "MembershipManage";
325
+ PermissionType2[PermissionType2["MembershipDelete"] = 172] = "MembershipDelete";
326
+ PermissionType2[PermissionType2["UserMembershipView"] = 180] = "UserMembershipView";
327
+ PermissionType2[PermissionType2["UserMembershipManage"] = 181] = "UserMembershipManage";
328
+ PermissionType2[PermissionType2["UserMembershipDelete"] = 182] = "UserMembershipDelete";
329
+ return PermissionType2;
330
+ })(PermissionType || {});
331
+
332
+ // src/contracts/generated/enum/questionType.ts
333
+ var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
334
+ QuestionType2[QuestionType2["Unknown"] = 0] = "Unknown";
335
+ QuestionType2[QuestionType2["ShortText"] = 1] = "ShortText";
336
+ QuestionType2[QuestionType2["LongText"] = 2] = "LongText";
337
+ QuestionType2[QuestionType2["YesNo"] = 3] = "YesNo";
338
+ QuestionType2[QuestionType2["YesNoUnknown"] = 4] = "YesNoUnknown";
339
+ QuestionType2[QuestionType2["StarRating5"] = 5] = "StarRating5";
340
+ return QuestionType2;
341
+ })(QuestionType || {});
342
+ var QuestionForType = /* @__PURE__ */ ((QuestionForType2) => {
343
+ QuestionForType2[QuestionForType2["Unknown"] = 0] = "Unknown";
344
+ QuestionForType2[QuestionForType2["Host"] = 1] = "Host";
345
+ QuestionForType2[QuestionForType2["Owner"] = 2] = "Owner";
346
+ QuestionForType2[QuestionForType2["Pet"] = 3] = "Pet";
347
+ return QuestionForType2;
348
+ })(QuestionForType || {});
349
+
350
+ // src/contracts/generated/enum/answerLinkType.ts
351
+ var AnswerLinkType = /* @__PURE__ */ ((AnswerLinkType2) => {
352
+ AnswerLinkType2[AnswerLinkType2["Unknown"] = 0] = "Unknown";
353
+ AnswerLinkType2[AnswerLinkType2["User"] = 1] = "User";
354
+ AnswerLinkType2[AnswerLinkType2["Pet"] = 2] = "Pet";
355
+ return AnswerLinkType2;
356
+ })(AnswerLinkType || {});
357
+
358
+ // src/contracts/generated/enum/bookingStatus.ts
359
+ var BookingStatusType = /* @__PURE__ */ ((BookingStatusType2) => {
360
+ BookingStatusType2[BookingStatusType2["Pending"] = 0] = "Pending";
361
+ BookingStatusType2[BookingStatusType2["Cancelled"] = 1] = "Cancelled";
362
+ BookingStatusType2[BookingStatusType2["FindPlacement"] = 2] = "FindPlacement";
363
+ BookingStatusType2[BookingStatusType2["Request"] = 3] = "Request";
364
+ BookingStatusType2[BookingStatusType2["PaidWithHostMatch"] = 4] = "PaidWithHostMatch";
365
+ BookingStatusType2[BookingStatusType2["Complete"] = 5] = "Complete";
366
+ BookingStatusType2[BookingStatusType2["CompleteWithHostFeedback"] = 6] = "CompleteWithHostFeedback";
367
+ return BookingStatusType2;
368
+ })(BookingStatusType || {});
369
+
370
+ // src/contracts/generated/enum/bookingAddonType.ts
371
+ var BookingAddonType = /* @__PURE__ */ ((BookingAddonType2) => {
372
+ BookingAddonType2[BookingAddonType2["None"] = 0] = "None";
373
+ BookingAddonType2[BookingAddonType2["PetTaxi"] = 1] = "PetTaxi";
374
+ return BookingAddonType2;
375
+ })(BookingAddonType || {});
376
+
377
+ // src/contracts/generated/enum/searchableColumnInfo.ts
378
+ var SearchableColumnType = /* @__PURE__ */ ((SearchableColumnType2) => {
379
+ SearchableColumnType2[SearchableColumnType2["STRING_ENUM"] = 0] = "STRING_ENUM";
380
+ SearchableColumnType2[SearchableColumnType2["STRING_OF_ENUMS"] = 1] = "STRING_OF_ENUMS";
381
+ SearchableColumnType2[SearchableColumnType2["STRING"] = 2] = "STRING";
382
+ SearchableColumnType2[SearchableColumnType2["NUMBER"] = 3] = "NUMBER";
383
+ SearchableColumnType2[SearchableColumnType2["BOOLEAN"] = 4] = "BOOLEAN";
384
+ SearchableColumnType2[SearchableColumnType2["DATE"] = 5] = "DATE";
385
+ return SearchableColumnType2;
386
+ })(SearchableColumnType || {});
387
+
388
+ // src/contracts/generated/enum/appType.ts
389
+ var AppType = /* @__PURE__ */ ((AppType2) => {
390
+ AppType2[AppType2["Admin"] = 0] = "Admin";
391
+ AppType2[AppType2["Client"] = 1] = "Client";
392
+ AppType2[AppType2["Api"] = 2] = "Api";
393
+ AppType2[AppType2["Test"] = 3] = "Test";
394
+ AppType2[AppType2["Interactive"] = 4] = "Interactive";
395
+ return AppType2;
396
+ })(AppType || {});
397
+ var webAppTypes = [
398
+ 0 /* Admin */,
399
+ //
400
+ 1 /* Client */
401
+ ];
402
+ var isWebApp = (appType) => webAppTypes.includes(appType);
403
+
404
+ // src/contracts/generated/enum/orderDirectionType.ts
405
+ var OrderDirectionType = /* @__PURE__ */ ((OrderDirectionType2) => {
406
+ OrderDirectionType2["ASC"] = "ASC";
407
+ OrderDirectionType2["DESC"] = "DESC";
408
+ return OrderDirectionType2;
409
+ })(OrderDirectionType || {});
410
+
411
+ // src/contracts/generated/enum/petSexType.ts
412
+ var PetSexType = /* @__PURE__ */ ((PetSexType2) => {
413
+ PetSexType2[PetSexType2["Other"] = 0] = "Other";
414
+ PetSexType2[PetSexType2["Male"] = 1] = "Male";
415
+ PetSexType2[PetSexType2["Female"] = 2] = "Female";
416
+ return PetSexType2;
417
+ })(PetSexType || {});
418
+
419
+ // src/contracts/generated/enum/activityType.ts
420
+ var ActivityType = /* @__PURE__ */ ((ActivityType2) => {
421
+ ActivityType2[ActivityType2["Unknown"] = 0] = "Unknown";
422
+ ActivityType2[ActivityType2["Create"] = 1] = "Create";
423
+ ActivityType2[ActivityType2["Read"] = 2] = "Read";
424
+ ActivityType2[ActivityType2["Update"] = 3] = "Update";
425
+ ActivityType2[ActivityType2["Delete"] = 4] = "Delete";
426
+ return ActivityType2;
427
+ })(ActivityType || {});
428
+
429
+ // src/contracts/generated/enum/petType.ts
430
+ var PetType = /* @__PURE__ */ ((PetType2) => {
431
+ PetType2[PetType2["Unknown"] = 0] = "Unknown";
432
+ PetType2[PetType2["Dog"] = 1] = "Dog";
433
+ PetType2[PetType2["Cat"] = 2] = "Cat";
434
+ return PetType2;
435
+ })(PetType || {});
436
+
437
+ // src/contracts/generated/enum/petStatusType.ts
438
+ var PetStatusType = /* @__PURE__ */ ((PetStatusType2) => {
439
+ PetStatusType2[PetStatusType2["Unknown"] = 0] = "Unknown";
440
+ PetStatusType2[PetStatusType2["Active"] = 1] = "Active";
441
+ PetStatusType2[PetStatusType2["Deceased"] = 2] = "Deceased";
442
+ PetStatusType2[PetStatusType2["Blacklisted"] = 3] = "Blacklisted";
443
+ return PetStatusType2;
444
+ })(PetStatusType || {});
445
+
446
+ // src/contracts/generated/enum/membershipType.ts
447
+ var MembershipType = /* @__PURE__ */ ((MembershipType2) => {
448
+ MembershipType2[MembershipType2["None"] = 0] = "None";
449
+ MembershipType2[MembershipType2["Club"] = 1] = "Club";
450
+ MembershipType2[MembershipType2["ClubPlus"] = 2] = "ClubPlus";
451
+ return MembershipType2;
452
+ })(MembershipType || {});
453
+
454
+ // src/helpers/arrayHelper.ts
455
+ var makeArrayOrDefault = (propsVal, defaultValue = []) => {
456
+ if (propsVal == null) return defaultValue;
457
+ if (Array.isArray(propsVal) == true) return [...propsVal];
458
+ return [propsVal];
459
+ };
460
+ var onlyUnique = (value, index, array) => {
461
+ return array.indexOf(value) === index;
462
+ };
463
+ var arrayOfNLength = (length) => Array.from(Array(length).keys());
464
+ var arrayContains = (arr, items, method = "AND") => {
465
+ for (const item of items) {
466
+ const hasItem = arr.includes(item);
467
+ if (method == "AND" && hasItem == false) return false;
468
+ if (method == "OR" && hasItem == true) return true;
469
+ }
470
+ return true;
471
+ };
472
+
473
+ // src/helpers/enumHelper.ts
474
+ var getArrFromEnum = (enumType, isNan = false) => {
475
+ const result = Object.values(enumType).filter((dt) => isNaN(dt) == isNan);
476
+ return result;
477
+ };
478
+
479
+ // src/validation/arrayValidation.ts
480
+ var minItems = (minLength2) => (values) => {
481
+ const safeArr = makeArrayOrDefault(values);
482
+ if (safeArr.length >= minLength2) {
483
+ return { isValid: true };
484
+ }
485
+ return {
486
+ isValid: false,
487
+ errorMessageTransKey: "min_item_validator",
488
+ errorMessageParams: { count: minLength2 },
489
+ errorMessage: `Minimum number of items that need to be selected is {count}`
490
+ };
491
+ };
492
+ var maxItems = (maxLength2) => (values) => {
493
+ const safeArr = makeArrayOrDefault(values);
494
+ if (safeArr.length <= maxLength2) {
495
+ return { isValid: true };
496
+ }
497
+ return {
498
+ isValid: false,
499
+ errorMessageTransKey: "max_item_validator",
500
+ errorMessageParams: { count: maxLength2 },
501
+ errorMessage: `Too many items selected! Maximum number of items allowed to be selected is {count}`
502
+ };
503
+ };
504
+ var selectedItemsExist = (validOptions) => (values) => {
505
+ const safeArr = makeArrayOrDefault(values);
506
+ for (const value of safeArr) {
507
+ let optionIsValid = false;
508
+ if (validOptions.includes(value)) {
509
+ optionIsValid = true;
510
+ continue;
511
+ }
512
+ if (optionIsValid == false) {
513
+ return {
514
+ isValid: false,
515
+ errorMessageTransKey: "item_does_not_exist_validator",
516
+ errorMessage: "Selected option is invalid"
517
+ };
518
+ }
519
+ }
520
+ return { isValid: true };
521
+ };
522
+ var selectedOptionIsInEnum = (enumType) => (values) => {
523
+ const safeArr = makeArrayOrDefault(values);
524
+ const validOptions = getArrFromEnum(enumType).map((v) => v);
525
+ for (const value of safeArr) {
526
+ let optionIsValid = false;
527
+ if (validOptions.includes(value)) {
528
+ optionIsValid = true;
529
+ continue;
530
+ }
531
+ if (optionIsValid == false) {
532
+ return {
533
+ isValid: false,
534
+ errorMessageTransKey: "item_does_not_exist_validator",
535
+ errorMessage: "Selected option is invalid"
536
+ };
537
+ }
538
+ }
539
+ return { isValid: true };
540
+ };
541
+
542
+ // src/validation/numberValidation.ts
543
+ var isNumber = (value) => {
544
+ if (value != null) {
545
+ if (isNaN(Number(value)) == false) {
546
+ return { isValid: true };
547
+ }
548
+ }
549
+ return {
550
+ isValid: false,
551
+ errorMessageTransKey: "is_number_validator",
552
+ errorMessage: `Must be a number`
553
+ };
554
+ };
555
+
556
+ // src/services/internal/config/commonConfigService.ts
557
+ var CommonConfigService = class {
558
+ _internalIsProd;
559
+ getHubApiUrl = () => this.get("VITE_HUB_API_URL");
560
+ getHubLandingUrl = () => this.get("VITE_HUB_LANDING_URL");
561
+ getHubClientUrl = () => this.get("VITE_HUB_CLIENT_URL");
562
+ getHubAdminUrl = () => this.get("VITE_HUB_ADMIN_URL");
563
+ getHubCoverageUrl = () => this.get("VITE_HUB_COVERAGE_URL");
564
+ getHubDocsUrl = () => this.get("VITE_HUB_DOCS_URL");
565
+ getHubStorybookUrl = () => this.get("VITE_HUB_STORYBOOK_URL");
566
+ getHubspotId = () => this.get("VITE_HUBSPOT_ID");
567
+ getFakeApiRequestDelay = () => this.getNumber("VITE_FAKE_API_REQUEST_DELAY");
568
+ getCaptchaEnabled = () => this.getBool("VITE_ENABLE_CAPTCHA");
569
+ getHCaptchaSecret = () => this.get("HCAPTCHA_SECRET");
570
+ getHCaptchaSiteKey = () => this.get("VITE_HCAPTCHA_SITE_KEY");
571
+ getTolgeeApiKey = () => this.get("VITE_TOLGEE_API_KEY");
572
+ getTolgeeApiUrl = () => this.get("VITE_TOLGEE_API_URL");
573
+ getTolgeeProjectId = () => this.getNumber("VITE_TOLGEE_PROJECT_ID");
574
+ /* Special case, available on UI & API */
575
+ isProd = () => {
576
+ if (this._internalIsProd == null) {
577
+ this._internalIsProd = this.get("NODE_ENV").toLocaleLowerCase() === "production" || this.get("MODE").toLocaleLowerCase() === "production";
578
+ }
579
+ return this._internalIsProd;
580
+ };
581
+ packageVersion = () => this.getWithFallback("PACKAGE_VERSION", "npm_package_version");
582
+ getConsoleLogLevels = () => {
583
+ const envVar = this.get("VITE_CONSOLE_LOGGING");
584
+ if (envVar?.length < 1) return ["trace", "log", "info", "debug", "warn", "error"];
585
+ return envVar.split(",").map((l) => l);
586
+ };
587
+ get(property, defaultValue) {
588
+ let value = void 0;
589
+ value = import.meta.env?.[property];
590
+ if (defaultValue != null) {
591
+ return value ?? defaultValue;
592
+ }
593
+ return value ?? "";
594
+ }
595
+ getWithFallback = (property, fallbackProperty, defaultValue) => {
596
+ const orig = this.get(property);
597
+ if (orig != null) return orig;
598
+ return this.get(fallbackProperty, defaultValue);
599
+ };
600
+ getBool = (property, defaultValue) => this.get(property, defaultValue).toLowerCase() == "true";
601
+ getNumber = (property, defaultValue) => Number(this.get(property, defaultValue?.toString?.()));
602
+ };
603
+ var formatDate = (date, format = "DD MMM YYYY HH:mm") => {
604
+ const dateStr = dayjs(date).format(format);
605
+ if (dateStr.includes("Invalid")) return "";
606
+ return dateStr;
607
+ };
608
+ var formatForDateLocal = (value) => formatDate(value, "YYYY-MM-DD HH:mm");
609
+ var formatForDateDropdown = (value) => formatDate(value, "YYYY-MM-DD");
610
+ var formatForDateOfBirth = (value) => formatDate(value, "DD MMM YYYY");
611
+ var formatForDateWithTime = (value) => formatDate(value, "DD MMM YYYY HH:mm");
612
+ var formatForDateLocalDetailed = (date) => dayjs(date).format("YYYY-MM-DDTHH:mm:ss");
613
+ var formatForBookingDate = (startDate, endDate) => `${formatDate(startDate, "DD MMM YYYY")} - ${dateDiffInDays(startDate, endDate)} nights`;
614
+ var addSeconds = (date, seconds) => dayjs(date).add(seconds, "seconds").toDate();
615
+ var addMinutes = (date, minutes) => dayjs(date).add(minutes, "minutes").toDate();
616
+ var addDays = (date, days) => dayjs(date).add(days, "days").toDate();
617
+ var addMonths = (date, months) => dayjs(date).add(months, "months").toDate();
618
+ var isBefore = (date, secondDate) => dayjs(date).isBefore(secondDate);
619
+ var isSameDay = (date, secondDate) => dayjs(date).isSame(secondDate, "day");
620
+ var dateDiffInDays = (date, secondDate) => {
621
+ const date1 = new Date(date);
622
+ const date2 = new Date(secondDate);
623
+ const diffTime = Math.abs(date2.getTime() - date1.getTime());
624
+ const diffDays = Math.floor(diffTime / (1e3 * 60 * 60 * 24));
625
+ return diffDays;
626
+ };
627
+ var getAgeInYears = (birthDateOrStr) => {
628
+ const now = /* @__PURE__ */ new Date();
629
+ const birthDate = new Date(birthDateOrStr);
630
+ let months = (now.getFullYear() - birthDate.getFullYear()) * 12;
631
+ months -= birthDate.getMonth();
632
+ months += now.getMonth();
633
+ return (months <= 0 ? 0 : months) / 12;
634
+ };
635
+ var getWeekNumber = (d) => {
636
+ var d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
637
+ var dayNum = d.getUTCDay() || 7;
638
+ d.setUTCDate(d.getUTCDate() + 4 - dayNum);
639
+ var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
640
+ return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
641
+ };
642
+
643
+ // src/services/internal/log/logService.ts
644
+ var LogService = class {
645
+ constructor(config, _numDaysToKeep = 100) {
646
+ this._numDaysToKeep = _numDaysToKeep;
647
+ this._logLevels = config.getConsoleLogLevels();
648
+ this._latestLogDate = addDays(/* @__PURE__ */ new Date(), -this._numDaysToKeep);
649
+ console.info("Log Levels: ", this._logLevels.join());
650
+ }
651
+ logs = [];
652
+ _logLevels;
653
+ _latestLogDate;
654
+ _logMessageToConsole = (log) => {
655
+ let logStyle = "";
656
+ switch (log.type) {
657
+ case "log":
658
+ case "info":
659
+ logStyle = "color: green; font-size: medium";
660
+ break;
661
+ case "warn":
662
+ logStyle = "color: orange; font-size: medium";
663
+ break;
664
+ case "error":
665
+ logStyle = "color: red; font-size: large";
666
+ break;
667
+ }
668
+ let messageString = `%c${log.message}`;
669
+ if ((log.optionalParams ?? []).length > 0) {
670
+ messageString += `
671
+ additional params:
672
+ ${(log.optionalParams ?? []).join("\n\r")}`;
673
+ }
674
+ if ((log.groups ?? []).length > 0) {
675
+ const groupString = (log.groups ?? []).map((g) => `[${g}]`).join();
676
+ messageString = `${groupString} - ${messageString}`;
677
+ }
678
+ const dateString = formatForDateLocalDetailed(/* @__PURE__ */ new Date());
679
+ const logFunc = console[log.type];
680
+ logFunc(`${dateString}: ${messageString}`, logStyle);
681
+ };
682
+ _track = (type, groups) => (message, ...optionalParams) => {
683
+ const log = {
684
+ type,
685
+ groups,
686
+ message,
687
+ date: /* @__PURE__ */ new Date(),
688
+ optionalParams: optionalParams.map((op) => JSON.stringify(op, null, 2))
689
+ };
690
+ this.logs = this.logs.filter((t) => t.date > this._latestLogDate);
691
+ this.logs.push(log);
692
+ if (this._logLevels.includes(log.type) === false) return;
693
+ else this._logMessageToConsole(log);
694
+ };
695
+ getLogger = (...groups) => ({
696
+ d: this._track("debug", groups),
697
+ i: this._track("info", groups),
698
+ w: this._track("warn", groups),
699
+ e: this._track("error", groups)
700
+ });
701
+ };
702
+ var dependencyInjectionSetup = (props) => {
703
+ setContainerToken(APP_TYPE, props.appType);
704
+ if (props.botPath != null) setContainerToken(BOT_PATH, props.botPath);
705
+ if (props.siteConfig != null) setContainerToken(SITE_CONFIG, props.siteConfig);
706
+ const configService = new CommonConfigService();
707
+ const logService = new LogService(configService);
708
+ setContainerToken(CommonConfigService, configService);
709
+ setContainerToken(LogService, logService);
710
+ return {
711
+ logService,
712
+ configService
713
+ };
714
+ };
715
+ var BOT_PATH = new Token("BOT_PATH");
716
+ var getBotPath = () => Container.get(BOT_PATH);
717
+ var APP_TYPE = new Token("APP_TYPE");
718
+ var getAppType = () => Container.get(APP_TYPE);
719
+ var SITE_CONFIG = new Token("SITE_CONFIG");
720
+ var setSiteConfig = (value) => Container.set({ id: SITE_CONFIG, value });
721
+ var getSiteConfig = () => {
722
+ try {
723
+ return Container.get(SITE_CONFIG);
724
+ } catch {
725
+ console.error("unable to get site config. Did you set the config on app startup?");
726
+ }
727
+ };
728
+ var setContainerToken = (id, value) => Container.set({ id, value });
729
+ var getCommonConfig = () => Container.get(CommonConfigService);
730
+ var getLog = () => Container.get(LogService);
731
+
732
+ // src/validation/baseValidation.ts
733
+ var noValidation = (_) => ({ isValid: true });
734
+ var notNull = (customTransKey, customErrMsg) => (value) => {
735
+ if (value != null) {
736
+ return { isValid: true };
737
+ }
738
+ return {
739
+ isValid: false,
740
+ errorMessageTransKey: customTransKey ?? "not_null_validator",
741
+ errorMessage: customErrMsg ?? `Field shouldn't be empty`
742
+ };
743
+ };
744
+ var multiValidation = (...validations) => (value) => {
745
+ for (const validation of validations) {
746
+ const result = validation(value);
747
+ if (result.isValid === false) return result;
748
+ }
749
+ return { isValid: true };
750
+ };
751
+ var separateValidation = (validators) => (value) => {
752
+ const appType = getAppType()?.toString?.();
753
+ const validatorForAppType = validators[AppType[appType]];
754
+ if (validatorForAppType == null) {
755
+ getLog().getLogger("separateValidation").w(`${appType} validator not found`);
756
+ return { isValid: true };
757
+ }
758
+ return validatorForAppType(value);
759
+ };
760
+ var validateForEach = (validation) => (values) => {
761
+ const safeArr = makeArrayOrDefault(values);
762
+ for (const value of safeArr) {
763
+ const result = validation(value);
764
+ if (result.isValid === false) return result;
765
+ }
766
+ return { isValid: true };
767
+ };
768
+
769
+ // src/validation/dateValidation.ts
770
+ var minDate = (minDate2) => (value) => {
771
+ if (isBefore(minDate2, value)) {
772
+ return { isValid: true };
773
+ }
774
+ return {
775
+ isValid: false,
776
+ errorMessageTransKey: "min_date_validator",
777
+ errorMessageParams: { date: formatDate(minDate2, "DD MMM YY") },
778
+ errorMessage: "Minimum date is {date}"
779
+ };
780
+ };
781
+ var maxDate = (maxDate2) => (value) => {
782
+ if (isBefore(value, maxDate2)) {
783
+ return { isValid: true };
784
+ }
785
+ return {
786
+ isValid: false,
787
+ errorMessageTransKey: "max_date_validator",
788
+ errorMessageParams: { date: formatDate(maxDate2, "DD MMM YY") },
789
+ errorMessage: "Maximum date is {date}"
790
+ };
791
+ };
792
+
793
+ // src/validation/textValidation.ts
794
+ var minLength = (minLengthVal) => (value) => {
795
+ if ((value?.length ?? 0) >= minLengthVal) {
796
+ return { isValid: true };
797
+ }
798
+ return {
799
+ isValid: false,
800
+ errorMessageTransKey: "min_length_validator",
801
+ errorMessageParams: { count: minLengthVal },
802
+ errorMessage: `Minimum length required is {count}`
803
+ };
804
+ };
805
+ var maxLength = (maxLengthVal) => (value) => {
806
+ if ((value?.length ?? 0) <= maxLengthVal) {
807
+ return { isValid: true };
808
+ }
809
+ return {
810
+ isValid: false,
811
+ errorMessageTransKey: "max_length_validator",
812
+ errorMessageParams: { count: maxLengthVal },
813
+ errorMessage: `Text is too long! Maximum length allowed is {count}`
814
+ };
815
+ };
816
+ var shouldBeUrl = (value) => {
817
+ const validationFailures = [];
818
+ const safeValue = `${value}`;
819
+ const numPeriods = safeValue.split("").filter((c) => c === ".").length;
820
+ const isLastCharPeriod = safeValue[safeValue.length - 1] === ".";
821
+ if (numPeriods < 1 || isLastCharPeriod) {
822
+ validationFailures.push("Should have at least one period in a sensible location.");
823
+ }
824
+ if (validationFailures.length > 0) {
825
+ return {
826
+ isValid: false,
827
+ errorMessageTransKey: "link_validator",
828
+ errorMessageParams: { current: value },
829
+ errorMessage: `Should be a valid link/url. ({current}) does not meet the requirements: ${validationFailures.join(
830
+ ". "
831
+ )}.`
832
+ };
833
+ }
834
+ return { isValid: true };
835
+ };
836
+ var shouldBeYoutubeUrl = (value) => {
837
+ const safeValue = `${value}`;
838
+ const youtubePartialUrl = "https://www.youtube.com/watch?v=";
839
+ if (safeValue.includes(youtubePartialUrl)) {
840
+ return { isValid: true };
841
+ }
842
+ return {
843
+ isValid: false,
844
+ errorMessageTransKey: "youtube_url_validator",
845
+ errorMessageParams: { startUrl: youtubePartialUrl },
846
+ errorMessage: `Youtube url should start with {startUrl}`
847
+ };
848
+ };
849
+
850
+ // src/helpers/performanceHelper.ts
851
+ var getPerformanceTimer = () => ({
852
+ start: performance.now(),
853
+ getTimeElapsed: (start) => performance.now() - start
854
+ });
855
+
856
+ // src/helpers/typescriptHacks.ts
857
+ var anyObject = () => ({});
858
+ var fakePromise = () => new Promise((res) => res({}));
859
+
860
+ // src/helpers/eventHelper.ts
861
+ var onTargetValue = (funcOnEvent) => (event) => {
862
+ const value = event.target?.value;
863
+ if (value == null) return;
864
+ funcOnEvent(value);
865
+ };
866
+ var onTargetFiles = (funcOnEvent) => (event) => {
867
+ const fileList = event.target.files;
868
+ if (fileList == null || fileList.length < 1) return;
869
+ funcOnEvent(fileList);
870
+ };
871
+ var preventDefault = (event) => {
872
+ event?.preventDefault?.();
873
+ return event;
874
+ };
875
+ var stopPropagation = (event) => {
876
+ event?.stopPropagation?.();
877
+ return event;
878
+ };
879
+
880
+ // src/helpers/asyncHelper.ts
881
+ var timeout = (ms) => {
882
+ return new Promise((resolve) => setTimeout(resolve, ms));
883
+ };
884
+ var addToParallelTasks = async (tasks, newTask, numTasksInParallel = 5) => {
885
+ if (tasks.length >= numTasksInParallel) {
886
+ const finishedTask = Promise.any(tasks);
887
+ const indexOfTask = tasks.indexOf(finishedTask);
888
+ tasks.splice(indexOfTask, 1);
889
+ await finishedTask;
890
+ }
891
+ tasks.push(newTask);
892
+ return tasks;
893
+ };
894
+
895
+ // src/helpers/permissionHelper.ts
896
+ var hasRequiredPermissions = (props) => {
897
+ if (props.userPermissions.includes(1 /* All */)) {
898
+ props.hasAdminPermission?.();
899
+ return true;
900
+ }
901
+ const missingPermissions = props.requiredPermissions.filter((p) => props.userPermissions.includes(p) == false);
902
+ if (missingPermissions.length > 0) {
903
+ props.doesNotHavePermission?.(missingPermissions);
904
+ return false;
905
+ }
906
+ return true;
907
+ };
908
+
909
+ // src/helpers/imageHelper.ts
910
+ var getImageParams = (file) => {
911
+ const fileExtension = file.name?.split?.(".")?.pop?.() ?? ".png";
912
+ return new Promise((resolve, reject) => {
913
+ const reader = new FileReader();
914
+ reader.onload = async (e) => {
915
+ const image = new Image();
916
+ if (e.target == null || e.target.result == null) {
917
+ reject("e.target.result is null");
918
+ return;
919
+ }
920
+ image.src = e.target.result;
921
+ await image.decode();
922
+ resolve({
923
+ name: file.name,
924
+ type: file.type,
925
+ width: image.width,
926
+ height: image.height,
927
+ fileSize: file.size,
928
+ fileExtension
929
+ });
930
+ };
931
+ reader.onerror = (e) => reject(e);
932
+ reader.readAsDataURL(file);
933
+ });
934
+ };
935
+
936
+ // src/assets/meta.json
937
+ var meta_default = {
938
+ packageVersion: "",
939
+ date: "2025-08-05",
940
+ gitCommitHash: "bb7afea7ccded0af7ec996aed9070642893fb9cc"
941
+ };
942
+
943
+ // src/assets/packagesUsed.json
944
+ var packagesUsed_default = {
945
+ generatedDate: "2025-08-05T10:59:26.739Z",
946
+ generatedDateFormat: "2025-08-05",
947
+ list: [
948
+ {
949
+ name: "@chromatic-com/storybook",
950
+ version: "4.0.1",
951
+ licenseType: "MIT",
952
+ repoUrl: "https://github.com/chromaui/addon-visual-tests.git",
953
+ licenceUrl: "https://github.com/chromaui/addon-visual-tests/blob/master/LICENSE"
954
+ },
955
+ {
956
+ name: "@kachurun/storybook-solid-vite",
957
+ version: "9.0.11",
958
+ licenseType: "MIT",
959
+ repoUrl: "https://github.com/solidjs-community/storybook.git",
960
+ licenceUrl: "https://github.com/solidjs-community/storybook/blob/master/LICENSE"
961
+ },
962
+ {
963
+ name: "@storybook/addon-a11y",
964
+ version: "9.0.18",
965
+ licenseType: "MIT",
966
+ repoUrl: "https://github.com/storybookjs/storybook.git"
967
+ },
968
+ {
969
+ name: "@storybook/addon-docs",
970
+ version: "9.0.18",
971
+ licenseType: "MIT",
972
+ repoUrl: "https://github.com/storybookjs/storybook.git"
973
+ },
974
+ {
975
+ name: "@storybook/addon-links",
976
+ version: "9.0.18",
977
+ licenseType: "MIT",
978
+ repoUrl: "https://github.com/storybookjs/storybook.git"
979
+ },
980
+ {
981
+ name: "@storybook/addon-onboarding",
982
+ version: "9.0.18",
983
+ licenseType: "MIT",
984
+ repoUrl: "https://github.com/storybookjs/storybook.git"
985
+ },
986
+ {
987
+ name: "@storybook/addon-vitest",
988
+ version: "9.0.18",
989
+ licenseType: "MIT",
990
+ repoUrl: "https://github.com/storybookjs/storybook.git"
991
+ },
992
+ {
993
+ name: "@types/node",
994
+ version: "24.1.0",
995
+ licenseType: "MIT",
996
+ repoUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
997
+ licenceUrl: "https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/LICENSE"
998
+ },
999
+ {
1000
+ name: "@vitest/browser",
1001
+ version: "3.2.4",
1002
+ licenseType: "MIT",
1003
+ repoUrl: "https://github.com/vitest-dev/vitest.git",
1004
+ licenceUrl: "https://github.com/vitest-dev/vitest/blob/master/LICENSE"
1005
+ },
1006
+ {
1007
+ name: "@vitest/coverage-v8",
1008
+ version: "3.2.4",
1009
+ licenseType: "MIT",
1010
+ repoUrl: "https://github.com/vitest-dev/vitest.git",
1011
+ licenceUrl: "https://github.com/vitest-dev/vitest/blob/master/LICENSE"
1012
+ },
1013
+ {
1014
+ name: "@vitest/ui",
1015
+ version: "3.2.4",
1016
+ licenseType: "MIT",
1017
+ repoUrl: "https://github.com/vitest-dev/vitest.git",
1018
+ licenceUrl: "https://github.com/vitest-dev/vitest/blob/master/LICENSE"
1019
+ },
1020
+ {
1021
+ name: "dotenv-cli",
1022
+ version: "9.0.0",
1023
+ licenseType: "MIT",
1024
+ repoUrl: "https://www.npmjs.com/package/dotenv-cli"
1025
+ },
1026
+ {
1027
+ name: "sass",
1028
+ version: "1.89.2",
1029
+ licenseType: "MIT",
1030
+ repoUrl: "https://github.com/sass/dart-sass",
1031
+ licenceUrl: "https://github.com/sass/dart-sass/blob/master/LICENSE"
1032
+ },
1033
+ {
1034
+ name: "storybook",
1035
+ version: "9.0.18",
1036
+ licenseType: "MIT",
1037
+ repoUrl: "https://github.com/storybookjs/storybook.git"
1038
+ },
1039
+ {
1040
+ name: "tsup",
1041
+ version: "8.5.0",
1042
+ licenseType: "MIT",
1043
+ repoUrl: "https://github.com/egoist/tsup.git",
1044
+ licenceUrl: "https://github.com/egoist/tsup/blob/master/LICENSE"
1045
+ },
1046
+ {
1047
+ name: "tsup-preset-solid",
1048
+ version: "2.2.0",
1049
+ licenseType: "MIT",
1050
+ repoUrl: "https://github.com/solidjs-community/tsup-preset-solid.git",
1051
+ licenceUrl: "https://github.com/solidjs-community/tsup-preset-solid/blob/master/LICENSE"
1052
+ },
1053
+ {
1054
+ name: "typescript",
1055
+ version: "5.8.3",
1056
+ licenseType: "Apache-2.0",
1057
+ repoUrl: "https://github.com/microsoft/TypeScript.git"
1058
+ },
1059
+ {
1060
+ name: "vite",
1061
+ version: "7.0.6",
1062
+ licenseType: "MIT",
1063
+ repoUrl: "https://github.com/vitejs/vite.git"
1064
+ },
1065
+ {
1066
+ name: "vite-plugin-solid",
1067
+ version: "2.11.7",
1068
+ licenseType: "MIT",
1069
+ repoUrl: "https://github.com/solidjs/vite-plugin-solid.git"
1070
+ },
1071
+ {
1072
+ name: "vitest",
1073
+ version: "3.2.4",
1074
+ licenseType: "MIT",
1075
+ repoUrl: "https://github.com/vitest-dev/vitest.git"
1076
+ }
1077
+ ]
1078
+ };
1079
+
1080
+ // src/helpers/metaHelper.ts
1081
+ var getMeta = () => meta_default;
1082
+ var getPackagesUsed = () => packagesUsed_default;
1083
+
1084
+ // src/helpers/stringHelper.ts
1085
+ var capitalizeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1086
+ var capitalizeFirstLetter = (orig) => {
1087
+ if ((orig?.length ?? 0) == 0) return orig;
1088
+ return [orig[0].toUpperCase(), ...orig.slice(1, orig.length)].join("");
1089
+ };
1090
+ var lowercaseFirstLetter = (orig) => {
1091
+ if (orig.length == 0) return orig;
1092
+ return [orig[0].toLowerCase(), ...orig.slice(1, orig.length)].join("");
1093
+ };
1094
+ var addSpacesForEnum = (orig) => {
1095
+ if (orig.length == 0) return orig;
1096
+ let result = "";
1097
+ for (const char of orig) {
1098
+ if (capitalizeAlphabet.includes(char)) {
1099
+ result += " ";
1100
+ }
1101
+ result += char;
1102
+ }
1103
+ return result;
1104
+ };
1105
+ var formatFileSize = (sizeInKb) => {
1106
+ const units = ["KB", "MB", "GB", "TB"];
1107
+ let size = sizeInKb;
1108
+ let unitIndex = 0;
1109
+ while (size >= 1024 && unitIndex < units.length - 1) {
1110
+ size /= 1024;
1111
+ unitIndex++;
1112
+ }
1113
+ const formatter = new Intl.NumberFormat("en-US", {
1114
+ minimumFractionDigits: 0,
1115
+ maximumFractionDigits: 0
1116
+ });
1117
+ return `${formatter.format(size)} ${units[unitIndex]}`;
1118
+ };
1119
+
1120
+ // src/helpers/hashHelper.ts
1121
+ var cyrb53 = (input, seed = 0) => {
1122
+ let h1 = 3735928559 ^ seed, h2 = 1103547991 ^ seed;
1123
+ for (let i = 0, ch; i < input.length; i++) {
1124
+ ch = input.charCodeAt(i);
1125
+ h1 = Math.imul(h1 ^ ch, 2654435761);
1126
+ h2 = Math.imul(h2 ^ ch, 1597334677);
1127
+ }
1128
+ h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507);
1129
+ h1 ^= Math.imul(h2 ^ h2 >>> 13, 3266489909);
1130
+ h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507);
1131
+ h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
1132
+ return 4294967296 * (2097151 & h2) + (h1 >>> 0);
1133
+ };
1134
+
1135
+ // src/helpers/debounceHelper.ts
1136
+ function debounceLeading(fn, ms) {
1137
+ let timer;
1138
+ const func = (args) => new Promise((resolve) => {
1139
+ if (timer) {
1140
+ clearTimeout(timer);
1141
+ }
1142
+ timer = setTimeout(() => {
1143
+ resolve(fn(args));
1144
+ }, ms);
1145
+ });
1146
+ const destroy = () => clearTimeout(timer);
1147
+ return { func, destroy };
1148
+ }
1149
+ var getPayloadFromJwt = (token) => {
1150
+ try {
1151
+ const decoded = jwtDecode(token);
1152
+ const timeStamp = (/* @__PURE__ */ new Date()).getTime() / 1e3;
1153
+ if (decoded.exp < timeStamp) {
1154
+ throw "JWT token expired";
1155
+ }
1156
+ return {
1157
+ isSuccess: true,
1158
+ value: ""
1159
+ };
1160
+ } catch (err) {
1161
+ return {
1162
+ isSuccess: false,
1163
+ errorMessage: err?.toString?.() ?? ""
1164
+ };
1165
+ }
1166
+ };
1167
+
1168
+ // src/helpers/propHelper.ts
1169
+ function nameof(key1, key2) {
1170
+ return key2 ?? key1;
1171
+ }
1172
+
1173
+ // src/helpers/randomHelper.ts
1174
+ var randomIntFromRange = (min, max) => {
1175
+ return Math.floor(Math.random() * (max - min) + min);
1176
+ };
1177
+ var randomItemFromArray = (items) => {
1178
+ const randomIndex = randomIntFromRange(0, items.length);
1179
+ return items[randomIndex];
1180
+ };
1181
+
1182
+ // src/helpers/mimeHelper.ts
1183
+ var mimeTypeLookup = {
1184
+ txt: "text/plain",
1185
+ html: "text/html",
1186
+ css: "text/css",
1187
+ js: "application/javascript",
1188
+ json: "application/json",
1189
+ png: "image/png",
1190
+ jpg: "image/jpeg",
1191
+ jpeg: "image/jpeg",
1192
+ gif: "image/gif"
1193
+ };
1194
+ var getMimeTypeFromExtension = (extension, logger) => {
1195
+ if (extension == null) return "application/octet-stream";
1196
+ const lowerCaseExtension = extension.toLowerCase();
1197
+ const knownMimeType = mimeTypeLookup[lowerCaseExtension];
1198
+ if (knownMimeType != null) return knownMimeType;
1199
+ logger.w(`Extension '${extension}' is not known`);
1200
+ return "application/octet-stream";
1201
+ };
1202
+
1203
+ // src/helpers/guidHelper.ts
1204
+ var uuidv4 = () => {
1205
+ var d = (/* @__PURE__ */ new Date()).getTime();
1206
+ var d2 = typeof performance !== "undefined" && performance.now && performance.now() * 1e3 || 0;
1207
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
1208
+ var r = Math.random() * 16;
1209
+ if (d > 0) {
1210
+ r = (d + r) % 16 | 0;
1211
+ d = Math.floor(d / 16);
1212
+ } else {
1213
+ r = (d2 + r) % 16 | 0;
1214
+ d2 = Math.floor(d2 / 16);
1215
+ }
1216
+ return (c === "x" ? r : r & 3 | 8).toString(16);
1217
+ });
1218
+ };
1219
+
1220
+ // src/helpers/commonHelper.ts
1221
+ var getUsersName = (details) => `${details?.firstName} ${details?.lastName}`;
1222
+
1223
+ // src/helpers/urlHelper.ts
1224
+ var urlRef = (url) => {
1225
+ const { ref } = getSiteConfig()?.ref ?? anyObject();
1226
+ if (ref == null) return url;
1227
+ if (url.includes("?")) {
1228
+ return url + `&ref=${ref}`;
1229
+ }
1230
+ return url + `?ref=${ref}`;
1231
+ };
1232
+
1233
+ // src/helpers/profileHelper.ts
1234
+ var getUserAvatarUrl = (userUuid) => {
1235
+ return `${getCommonConfig().getHubApiUrl()}${apiRoute.client.profile.prefix}/${userUuid}/profile.png`;
1236
+ };
1237
+ var getPetAvatarUrl = (petUuid) => {
1238
+ return `${getCommonConfig().getHubApiUrl()}${apiRoute.client.pet.prefix}/${petUuid}/profile.png`;
1239
+ };
1240
+
1241
+ // src/constants/validation.ts
1242
+ var minUrlLength = 5;
1243
+ var portalGlyphLength = 12;
1244
+ var validUuidChars = [
1245
+ "1",
1246
+ "2",
1247
+ "3",
1248
+ "4",
1249
+ "5",
1250
+ "6",
1251
+ "7",
1252
+ "8",
1253
+ "9",
1254
+ "0",
1255
+ "A",
1256
+ "B",
1257
+ "C",
1258
+ "D",
1259
+ "E",
1260
+ "F"
1261
+ ];
1262
+
1263
+ // src/constants/localStorageKeys.ts
1264
+ var LocalStorageKeys = {
1265
+ nanaHubProfile: 10
1266
+ };
1267
+
1268
+ export { APP_TYPE, ActivityRestriction, ActivityType, AddressLinkType, AddressRestriction, AnswerLinkType, AnswerRestriction, AppType, BOT_PATH, BookingAddonRestriction, BookingAddonType, BookingRestriction, BookingStatusType, CommentLinkType, CommentRestriction, CommonConfigService, DrivingRouteRestriction, LocalStorageKeys, LogService, MembershipStatus, MembershipType, NetworkState, OrderDirectionType, PermissionRestriction, PermissionType, PetRestriction, PetSexType, PetStatusType, PetType, QuestionForType, QuestionRestriction, QuestionType, SITE_CONFIG, SearchableColumnType, UnavailabilityRestriction, UploadLinkType, UploadRestriction, UploadType, UserAccountFlagType, UserRestriction, UserType, addDays, addMinutes, addMonths, addSeconds, addSpacesForEnum, addToParallelTasks, anyObject, apiParams, apiRoute, arrayContains, arrayOfNLength, capitalizeFirstLetter, cyrb53, dateDiffInDays, debounceLeading, dependencyInjectionSetup, fakePromise, formatDate, formatFileSize, formatForBookingDate, formatForDateDropdown, formatForDateLocal, formatForDateLocalDetailed, formatForDateOfBirth, formatForDateWithTime, getAgeInYears, getAppType, getArrFromEnum, getBotPath, getCommonConfig, getImageParams, getLog, getMeta, getMimeTypeFromExtension, getPackagesUsed, getPayloadFromJwt, getPerformanceTimer, getPetAvatarUrl, getSiteConfig, getUserAvatarUrl, getUsersName, getWeekNumber, hasRequiredPermissions, isBefore, isNumber, isSameDay, isWebApp, lowercaseFirstLetter, makeArrayOrDefault, maxDate, maxItems, maxLength, mimeTypeLookup, minDate, minItems, minLength, minUrlLength, multiValidation, nameof, noValidation, notNull, onTargetFiles, onTargetValue, onlyUnique, portalGlyphLength, preventDefault, randomIntFromRange, randomItemFromArray, searchColumns, selectedItemsExist, selectedOptionIsInEnum, separateValidation, setContainerToken, setSiteConfig, shouldBeUrl, shouldBeYoutubeUrl, stopPropagation, timeout, uploadsThatNeedEncryption, urlRef, uuidv4, validUuidChars, validateForEach, webAppTypes };