@gomusdev/web-components 1.7.0 → 1.8.0

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 (175) hide show
  1. package/dist-js/components/auth/entry.d.ts +0 -0
  2. package/dist-js/components/auth/signIn/SignIn.spec.d.ts +1 -0
  3. package/dist-js/components/auth/signIn/SignIn.svelte.d.ts +1 -0
  4. package/dist-js/components/auth/signIn/lib.d.ts +7 -0
  5. package/dist-js/components/auth/signUp/SignUp.svelte.d.ts +1 -0
  6. package/dist-js/components/auth/signUp/specs/SignUp.spec.d.ts +1 -0
  7. package/dist-js/components/cart/components/Cart.spec.d.ts +1 -0
  8. package/dist-js/components/cart/components/Cart.svelte.d.ts +1 -0
  9. package/dist-js/components/cart/entry.d.ts +0 -0
  10. package/dist-js/components/cart/lib/CartItem.d.ts +135 -0
  11. package/dist-js/components/cart/lib/cart.svelte.d.ts +616 -0
  12. package/dist-js/components/cart/lib/cart.svelte.spec.d.ts +1 -0
  13. package/dist-js/components/cart/lib/localStorage.spec.d.ts +1 -0
  14. package/dist-js/components/cart/lib/localStorage.svelte.d.ts +146 -0
  15. package/dist-js/components/cart/mocks/gomusTicketMocks.d.ts +112 -0
  16. package/dist-js/components/cart/mocks/testCart.d.ts +306 -0
  17. package/dist-js/components/checkoutForm/CheckoutForm.spec.d.ts +1 -0
  18. package/dist-js/components/checkoutForm/CheckoutForm.svelte.d.ts +1 -0
  19. package/dist-js/components/checkoutForm/entry.d.ts +0 -0
  20. package/dist-js/components/checkoutForm/lib.d.ts +1 -0
  21. package/dist-js/components/donations/lib/donation.spec.d.ts +1 -0
  22. package/dist-js/components/donations/lib/donation.svelte.d.ts +9 -0
  23. package/dist-js/components/entry.d.ts +0 -0
  24. package/dist-js/components/forms/entry.d.ts +0 -0
  25. package/dist-js/components/forms/lib/Field.spec.d.ts +1 -0
  26. package/dist-js/components/forms/lib/Field.svelte.d.ts +28 -0
  27. package/dist-js/components/forms/lib/Forms.svelte.d.ts +31 -0
  28. package/dist-js/components/forms/lib/allFields.d.ts +3 -0
  29. package/dist-js/components/forms/lib/forms.spec.d.ts +1 -0
  30. package/dist-js/components/forms/ui/generic/AllFields.svelte.d.ts +1 -0
  31. package/dist-js/components/forms/ui/generic/ErrorsFeedback.svelte.d.ts +1 -0
  32. package/dist-js/components/forms/ui/generic/Field.spec.d.ts +1 -0
  33. package/dist-js/components/forms/ui/generic/Field.svelte.d.ts +1 -0
  34. package/dist-js/components/forms/ui/generic/Form.svelte.d.ts +1 -0
  35. package/dist-js/components/forms/ui/generic/FormDetails.spec.d.ts +1 -0
  36. package/dist-js/components/forms/ui/generic/FormDetails.svelte.d.ts +25 -0
  37. package/dist-js/components/forms/ui/generic/FormFeedback.svelte.d.ts +1 -0
  38. package/dist-js/components/forms/ui/generic/InputAndLabel.svelte.d.ts +1 -0
  39. package/dist-js/components/forms/ui/generic/Submit.spec.d.ts +1 -0
  40. package/dist-js/components/forms/ui/generic/Submit.svelte.d.ts +1 -0
  41. package/dist-js/components/forms/ui/generic/SuccessFeedback.svelte.d.ts +1 -0
  42. package/dist-js/components/forms/ui/specs/IfInForm.spec.d.ts +1 -0
  43. package/dist-js/components/forms/ui/specs/TestForm.spec.d.ts +1 -0
  44. package/dist-js/components/graveyard/event/entry.d.ts +0 -0
  45. package/dist-js/components/graveyard/event/lib.svelte.d.ts +43 -0
  46. package/dist-js/components/graveyard/events/entry.d.ts +0 -0
  47. package/dist-js/components/if/If.svelte.d.ts +1 -0
  48. package/dist-js/components/if/If.svelte.spec.d.ts +1 -0
  49. package/dist-js/components/if/entry.d.ts +0 -0
  50. package/dist-js/components/if/expression.d.ts +1 -0
  51. package/dist-js/components/if/expression.spec.d.ts +1 -0
  52. package/dist-js/components/init/GomusInit.svelte.d.ts +1 -0
  53. package/dist-js/components/init/GomusInit.test.d.ts +1 -0
  54. package/dist-js/components/init/Init.svelte.d.ts +1 -0
  55. package/dist-js/components/init/entry.d.ts +0 -0
  56. package/dist-js/components/mainnav/components/MainNav.spec.d.ts +1 -0
  57. package/dist-js/components/mainnav/fixtures/fixtures.d.ts +2 -0
  58. package/dist-js/components/mainnav/lib/generators/generate.d.ts +4 -0
  59. package/dist-js/components/mainnav/lib/generators/generate.spec.d.ts +1 -0
  60. package/dist-js/components/mainnav/lib/generators/labelGenerators.d.ts +2 -0
  61. package/dist-js/components/mainnav/lib/generators/navGenerators.d.ts +2 -0
  62. package/dist-js/components/mainnav/lib/generators/subNavGenerators.d.ts +7 -0
  63. package/dist-js/components/mainnav/lib/generators/urlGenerators.d.ts +2 -0
  64. package/dist-js/components/mainnav/lib/navigation.d.ts +32 -0
  65. package/dist-js/components/mainnav/lib/navigation.spec.d.ts +1 -0
  66. package/dist-js/components/mainnav/lib/states/OpenedDropdown.svelte.d.ts +20 -0
  67. package/dist-js/components/mainnav/lib/states/pageState.svelte.d.ts +7 -0
  68. package/dist-js/components/paypal/lib/PaymentError.d.ts +3 -0
  69. package/dist-js/components/paypal/lib/approvePaypalOrder.d.ts +4 -0
  70. package/dist-js/components/paypal/lib/getPaypalOrder.d.ts +1 -0
  71. package/dist-js/components/paypal/payment-method-component/paymentIcons.d.ts +14 -0
  72. package/dist-js/components/paypal/payment-method-component/paymentMethodStore.svelte.d.ts +3 -0
  73. package/dist-js/components/paypal/payment-methods/apm.d.ts +3 -0
  74. package/dist-js/components/paypal/payment-methods/applepay/applePay.d.ts +2 -0
  75. package/dist-js/components/paypal/payment-methods/currentOrder.svelte.d.ts +3 -0
  76. package/dist-js/components/paypal/payment-methods/defaults.d.ts +28 -0
  77. package/dist-js/components/paypal/payment-methods/googlepay/googlePay.d.ts +2 -0
  78. package/dist-js/components/paypal/payment-methods/loadPaypalScript.d.ts +5 -0
  79. package/dist-js/components/ticketSelection/SpecUtils.d.ts +3 -0
  80. package/dist-js/components/ticketSelection/TicketSelection.spec.d.ts +1 -0
  81. package/dist-js/components/ticketSelection/TicketSelection.svelte.d.ts +1 -0
  82. package/dist-js/components/ticketSelection/TicketSelectionDetails.spec.d.ts +1 -0
  83. package/dist-js/components/ticketSelection/TicketSelectionDetails.svelte.d.ts +27 -0
  84. package/dist-js/components/ticketSelection/entry.d.ts +0 -0
  85. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.spec.d.ts +1 -0
  86. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.d.ts +6 -0
  87. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.spec.d.ts +1 -0
  88. package/dist-js/components/ticketSelection/subcomponents/addToCartButton/entry.d.ts +0 -0
  89. package/dist-js/components/ticketSelection/subcomponents/calendar/components/Calendar.svelte.d.ts +1 -0
  90. package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.spec.d.ts +1 -0
  91. package/dist-js/components/ticketSelection/subcomponents/calendar/components/CalendarUI.svelte.d.ts +1 -0
  92. package/dist-js/components/ticketSelection/subcomponents/calendar/entry.d.ts +0 -0
  93. package/dist-js/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +35 -0
  94. package/dist-js/components/ticketSelection/subcomponents/calendar/mocks/datesMock.d.ts +33 -0
  95. package/dist-js/components/ticketSelection/subcomponents/tickets/Tickets.spec.d.ts +1 -0
  96. package/dist-js/components/ticketSelection/subcomponents/tickets/Tickets.svelte.d.ts +1 -0
  97. package/dist-js/components/ticketSelection/subcomponents/tickets/entry.d.ts +0 -0
  98. package/dist-js/components/ticketSelection/subcomponents/tickets/fixtures/ticketFixtures.d.ts +191 -0
  99. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/GroupBody.svelte.d.ts +1 -0
  100. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/GroupSum.svelte.d.ts +1 -0
  101. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketGroup.svelte.d.ts +764 -0
  102. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/TicketsSum.svelte.d.ts +1 -0
  103. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/addToCartButton/entry.d.ts +0 -0
  104. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.spec.d.ts +1 -0
  105. package/dist-js/components/ticketSelection/subcomponents/tickets/subcomponents/utils.svelte.d.ts +9 -0
  106. package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.spec.d.ts +1 -0
  107. package/dist-js/components/ticketSelection/subcomponents/timeslots/Timeslots.svelte.d.ts +1 -0
  108. package/dist-js/components/ticketSelection/subcomponents/timeslots/entry.d.ts +1 -0
  109. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/__mocks__/generateAvailableTimeSlots.d.ts +8 -0
  110. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.d.ts +50 -0
  111. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/generateAvailableTimeSlots.specs.d.ts +1 -0
  112. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.spec.d.ts +1 -0
  113. package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +6 -0
  114. package/dist-js/config/config.d.ts +8 -0
  115. package/dist-js/config/config.spec.d.ts +1 -0
  116. package/dist-js/config/defaultConfig.d.ts +16 -0
  117. package/dist-js/e2e/APMs.e2e.spec.d.ts +1 -0
  118. package/dist-js/e2e/Card.e2e.spec.d.ts +1 -0
  119. package/dist-js/e2e/testApm.d.ts +7 -0
  120. package/dist-js/go.svelte.d.ts +1 -0
  121. package/dist-js/gomus-webcomponents.css +1255 -0
  122. package/dist-js/gomus-webcomponents.iife.js +18826 -0
  123. package/dist-js/gomus-webcomponents.js +18825 -0
  124. package/dist-js/lib/annual-ticket-personalization/index.d.ts +1 -0
  125. package/dist-js/lib/annual-ticket-personalization/stores.d.ts +3 -0
  126. package/dist-js/lib/gomusTicket.spec.d.ts +1 -0
  127. package/dist-js/lib/gomusTicket.svelte.d.ts +122 -0
  128. package/dist-js/lib/helpers/DataHolder.d.ts +3 -0
  129. package/dist-js/lib/helpers/Events.d.ts +6 -0
  130. package/dist-js/lib/helpers/PropertyTracker.d.ts +9 -0
  131. package/dist-js/lib/helpers/PropertyTracker.spec.d.ts +1 -0
  132. package/dist-js/lib/helpers/ShadowStyles.svelte.d.ts +7 -0
  133. package/dist-js/lib/helpers/Wrapper.svelte.d.ts +1 -0
  134. package/dist-js/lib/helpers/context.spec.d.ts +1 -0
  135. package/dist-js/lib/helpers/context.svelte.d.ts +2 -0
  136. package/dist-js/lib/helpers/cookies.d.ts +7 -0
  137. package/dist-js/lib/helpers/cookies.spec.d.ts +1 -0
  138. package/dist-js/lib/helpers/dataAttr.d.ts +9 -0
  139. package/dist-js/lib/helpers/dataAttr.spec.d.ts +1 -0
  140. package/dist-js/lib/helpers/fixtures/context/lib.d.ts +5 -0
  141. package/dist-js/lib/helpers/shopCart.d.ts +34 -0
  142. package/dist-js/lib/helpers/translations.d.ts +752 -0
  143. package/dist-js/lib/helpers/urls.d.ts +64 -0
  144. package/dist-js/lib/helpers/utils.d.ts +24 -0
  145. package/dist-js/lib/helpers/wrapInElement.d.ts +1 -0
  146. package/dist-js/lib/helpers/wrapInElement.spec.d.ts +1 -0
  147. package/dist-js/lib/middlewares/AuthMiddleware.d.ts +23 -0
  148. package/dist-js/lib/middlewares/AuthMiddleware.spec.d.ts +1 -0
  149. package/dist-js/lib/stores/__mocks__/shop.svelte.d.ts +2 -0
  150. package/dist-js/lib/stores/auth.svelte.d.ts +25 -0
  151. package/dist-js/lib/stores/auth.svelte.spec.d.ts +1 -0
  152. package/dist-js/lib/stores/shop.svelte.d.ts +412 -0
  153. package/dist-js/lib/stores/shop.svelte.test.d.ts +1 -0
  154. package/dist-js/lib/stores/user.svelte.d.ts +16 -0
  155. package/dist-js/lib/stores/user.svelte.test.d.ts +1 -0
  156. package/dist-js/lib/storybook/WrapperComponent.d.ts +1 -0
  157. package/dist-js/lib/storybook/sbGlobals.svelte.d.ts +9 -0
  158. package/dist-js/lib/types/types.d.ts +1 -0
  159. package/dist-js/lib/utils.d.ts +16 -0
  160. package/dist-js/lib/vitest/mockedCookies.d.ts +2 -0
  161. package/dist-js/lib/vitest/msw/RequestLogger.d.ts +1 -0
  162. package/dist-js/lib/vitest/msw/basicHandlers.d.ts +3 -0
  163. package/dist-js/lib/vitest/msw/handlers.d.ts +1758 -0
  164. package/dist-js/lib/vitest/msw/vitestMSWSetup.d.ts +3 -0
  165. package/dist-js/lib/vitest/snapshotSerializer.d.ts +1 -0
  166. package/dist-js/main.d.ts +5 -0
  167. package/dist-js/mocks/MSWMocks.d.ts +11 -0
  168. package/dist-js/mocks/ShopMocks.d.ts +179 -0
  169. package/dist-js/mocks/mocks.d.ts +2049 -0
  170. package/dist-js/sveltekit/app/environment.d.ts +1 -0
  171. package/dist-js/sveltekit/app/forms.d.ts +23 -0
  172. package/dist-js/sveltekit/app/navigation.d.ts +4 -0
  173. package/dist-js/sveltekit/app/stores.d.ts +2 -0
  174. package/dist-js/vitest-setup.d.ts +0 -0
  175. package/package.json +1 -1
@@ -0,0 +1,64 @@
1
+ export type ShopUrls = typeof ANGULAR_URLS;
2
+ declare const ANGULAR_URLS: {
3
+ account: () => string;
4
+ annualTickets: () => string;
5
+ checkoutFailure: (errorMessage: string) => string;
6
+ checkoutSuccess: (token: string) => string;
7
+ checkoutForm: () => string;
8
+ coupons: () => string;
9
+ combiTickets: () => string;
10
+ combiTicketGroup: (slug: string) => string;
11
+ dayTickets: () => string;
12
+ eventGroup: typeof eventGroupUrl;
13
+ event: (id: number) => string;
14
+ events: () => string;
15
+ exhibition: (id: number) => string;
16
+ exhibitions: () => string;
17
+ home: () => string;
18
+ login: () => string;
19
+ merchandise: (id: number) => string;
20
+ merchandises: () => string;
21
+ museum: (id: number) => string;
22
+ museums: () => string;
23
+ publicTours: () => string;
24
+ register: () => string;
25
+ tickets: () => string;
26
+ ticketGroup: (slug: string) => string;
27
+ tour: (id: number) => string;
28
+ tours: () => string;
29
+ toursGroup: typeof toursGroupUrl;
30
+ cart: () => string;
31
+ };
32
+ export declare function shopUrlProvider(type: 'angular' | 'jmb'): {
33
+ account: () => string;
34
+ annualTickets: () => string;
35
+ checkoutFailure: (errorMessage: string) => string;
36
+ checkoutSuccess: (token: string) => string;
37
+ checkoutForm: () => string;
38
+ coupons: () => string;
39
+ combiTickets: () => string;
40
+ combiTicketGroup: (slug: string) => string;
41
+ dayTickets: () => string;
42
+ eventGroup: typeof eventGroupUrl;
43
+ event: (id: number) => string;
44
+ events: () => string;
45
+ exhibition: (id: number) => string;
46
+ exhibitions: () => string;
47
+ home: () => string;
48
+ login: () => string;
49
+ merchandise: (id: number) => string;
50
+ merchandises: () => string;
51
+ museum: (id: number) => string;
52
+ museums: () => string;
53
+ publicTours: () => string;
54
+ register: () => string;
55
+ tickets: () => string;
56
+ ticketGroup: (slug: string) => string;
57
+ tour: (id: number) => string;
58
+ tours: () => string;
59
+ toursGroup: typeof toursGroupUrl;
60
+ cart: () => string;
61
+ };
62
+ declare function eventGroupUrl(id: number): string;
63
+ declare function toursGroupUrl(id: number): string;
64
+ export {};
@@ -0,0 +1,24 @@
1
+ export declare function currency(value: number, currency: string): string;
2
+ /**
3
+ * Parses a comma-separated string of IDs into an array of positive numbers.
4
+ *
5
+ * This function takes a string containing comma-separated values and converts
6
+ * them into an array of positive integers. Invalid values (non-numeric, zero,
7
+ * or negative numbers) are filtered out.
8
+ *
9
+ * @param ids - A comma-separated string of IDs (e.g., "1,2,3" or "10, 20, 30")
10
+ * @returns An array of positive numbers if valid IDs are found, undefined otherwise
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * parseIds("1,2,3") // Returns [1, 2, 3]
15
+ * parseIds("10, 20, 30") // Returns [10, 20, 30] (handles whitespace)
16
+ * parseIds("1,abc,3") // Returns [1, 3] (filters out invalid values)
17
+ * parseIds("0,-1,2") // Returns [2] (filters out zero and negative numbers)
18
+ * parseIds("") // Returns undefined
19
+ * parseIds(undefined) // Returns undefined
20
+ * parseIds("abc,def") // Returns undefined (no valid IDs)
21
+ * ```
22
+ */
23
+ export declare function parseIds(ids: string | undefined): number[] | undefined;
24
+ export declare function parseTokens<ValidToken>(tokens: string | undefined, possibleTokens: readonly ValidToken[]): ValidToken[] | undefined;
@@ -0,0 +1 @@
1
+ export declare function wrapInElement(host: HTMLElement, tag: string, props?: Record<string, string | boolean>): HTMLElement;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { Middleware } from 'openapi-fetch';
2
+ import { Auth } from '../stores/auth.svelte.ts';
3
+ type MiddlewareLike = {
4
+ onRequest?: Middleware['onRequest'];
5
+ onResponse?: Middleware['onResponse'];
6
+ };
7
+ export declare class AuthMiddleware implements MiddlewareLike {
8
+ private readonly auth;
9
+ constructor(auth: Auth);
10
+ /**
11
+ * Intercepts and modifies outgoing HTTP requests by adding authentication headers.
12
+ */
13
+ onRequest({ request }: {
14
+ request: Request;
15
+ }): void;
16
+ /**
17
+ * Intercepts HTTP responses and updates authentication state if new credentials are received.
18
+ */
19
+ onResponse({ response }: {
20
+ response: Response;
21
+ }): Response;
22
+ }
23
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const shop: Record<string, any>;
2
+ export type MockedShop = typeof shop;
@@ -0,0 +1,25 @@
1
+ export declare class Auth {
2
+ #private;
3
+ constructor();
4
+ customerLevel(): 20 | 10 | undefined;
5
+ isAuthenticated(): boolean;
6
+ isLoggedIn(): boolean;
7
+ isGuest(): boolean;
8
+ signOut(): void;
9
+ signIn(options: {
10
+ uid: string;
11
+ client: string;
12
+ accessToken: string;
13
+ expiry: number;
14
+ }): void;
15
+ get data(): {
16
+ uid: string;
17
+ client: string;
18
+ accessToken: string;
19
+ expiry: number;
20
+ };
21
+ toString(): string;
22
+ save(): void;
23
+ load(): void;
24
+ }
25
+ export declare const auth: Auth;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,412 @@
1
+ import { CalendarDates } from '../../components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts';
2
+ import { ShopUrls } from '../helpers/urls';
3
+ import { User } from './user.svelte.ts';
4
+ import { OpenApiClient } from '@gomus/api';
5
+ import { TicketsAndQuotasParams, TicketsCalendarParams, TicketsParams } from '@gomus/api/lib/types.ts';
6
+ import { CheckoutParams, CheckoutResponse, Country, Event, Exhibition, Merchandise, Museum, Salutation, ShopType, SignInParams, SignInResponse, SignUpParams, SignUpResponse, Tour } from '@gomus/types';
7
+ export type ShopKind = 'angular' | 'jmb';
8
+ export declare class Shop {
9
+ #private;
10
+ type: ShopKind;
11
+ constructor();
12
+ load(apiUrl: string, shopDomain: string, locale: string, type?: ShopKind): Promise<void>;
13
+ get currentUser(): User | undefined;
14
+ get slug(): string | undefined;
15
+ get client(): OpenApiClient | undefined;
16
+ get name(): string;
17
+ get config(): {
18
+ url: string;
19
+ success_link: string;
20
+ pending_link: string;
21
+ fail_link: string;
22
+ back_link: string;
23
+ confirmation_link: string;
24
+ password_reset_link: string;
25
+ personalization_link: string;
26
+ registration: boolean;
27
+ guest: {
28
+ enabled: boolean;
29
+ limit: number | null;
30
+ };
31
+ min_total: number | null;
32
+ max_total: number | null;
33
+ defaults: {
34
+ price_target_audience_id: number | null;
35
+ };
36
+ currency: string;
37
+ time_zone: string;
38
+ locale: string;
39
+ custom_css: string | null;
40
+ custom_js: string | null;
41
+ donations?: {
42
+ enabled: boolean;
43
+ campaigns?: {
44
+ id: number;
45
+ name: string;
46
+ options: number[];
47
+ guest_limit: number;
48
+ free_donations: boolean;
49
+ translations: {
50
+ [key: string]: string;
51
+ };
52
+ picture: {
53
+ original?: string | null;
54
+ thumbnail?: string | null;
55
+ };
56
+ }[];
57
+ };
58
+ dynamic_pricing: boolean;
59
+ tickets: {
60
+ zip_file: boolean;
61
+ };
62
+ };
63
+ get payment_modes(): {
64
+ [key: string]: {
65
+ id: number;
66
+ name: string;
67
+ icons: string[];
68
+ };
69
+ };
70
+ get content(): {
71
+ [key: string]: string;
72
+ };
73
+ get settings(): import('@gomus/types').Settings;
74
+ get donations(): {
75
+ enabled: boolean;
76
+ campaigns?: {
77
+ id: number;
78
+ name: string;
79
+ options: number[];
80
+ guest_limit: number;
81
+ free_donations: boolean;
82
+ translations: {
83
+ [key: string]: string;
84
+ };
85
+ picture: {
86
+ original?: string | null;
87
+ thumbnail?: string | null;
88
+ };
89
+ }[];
90
+ } | undefined;
91
+ get translations(): {
92
+ [key: string]: string;
93
+ };
94
+ get currency(): string;
95
+ t(key: string, values?: {
96
+ [key: string]: string | number;
97
+ }): string;
98
+ translate(key: string, values?: {
99
+ [key: string]: string | number;
100
+ }): string;
101
+ get apiUrl(): string | undefined;
102
+ get shopDomain(): string | undefined;
103
+ get baseUrl(): string;
104
+ get locale(): string | undefined;
105
+ get shop(): ShopType;
106
+ get _data(): {
107
+ apiUrl?: string;
108
+ client?: OpenApiClient;
109
+ currentUser?: User;
110
+ exhibitions?: Exhibition[];
111
+ events?: Event[];
112
+ locale?: string;
113
+ merchandises?: Merchandise[];
114
+ museums?: Museum[];
115
+ shop?: ShopType;
116
+ shopDomain?: string;
117
+ tours?: Tour[];
118
+ urls?: ShopUrls;
119
+ customerSalutations?: Salutation[];
120
+ countries?: Country[];
121
+ };
122
+ ticketsCalendar(params: TicketsCalendarParams): CalendarDates;
123
+ ticketsAndQuotas(params: TicketsAndQuotasParams): {
124
+ tickets: {
125
+ [key: string]: import('@gomus/types').components["schemas"]["shop_v4_ticket_capacity"];
126
+ };
127
+ quotas: {
128
+ [key: string]: import('@gomus/types').components["schemas"]["quota"];
129
+ };
130
+ meta: import('@gomus/types').components["schemas"]["meta"];
131
+ };
132
+ tickets(params: TicketsParams): {
133
+ [key: string]: {
134
+ id: number;
135
+ title: string;
136
+ ticket_type: "time_slot" | "annual" | "normal";
137
+ bookable: boolean;
138
+ museum_ids: number[];
139
+ exhibition_ids: number[];
140
+ price_cents: number;
141
+ discount: number;
142
+ vat_pct: number;
143
+ tax_included: boolean;
144
+ entry_duration: number | null;
145
+ min_persons: number;
146
+ max_persons: number;
147
+ quota_ids: number[];
148
+ first_entry: number;
149
+ last_entry: number;
150
+ personalizeable: boolean;
151
+ attendees: boolean | string;
152
+ identification: boolean | string;
153
+ free_timing: boolean;
154
+ is_collective: boolean;
155
+ is_upgrade: boolean;
156
+ is_mantle: boolean;
157
+ description: string | null;
158
+ sub_ticket_ids: number[];
159
+ sub_tickets: {
160
+ [key: string]: {
161
+ title?: string;
162
+ min_persons?: number;
163
+ max_persons?: number;
164
+ description?: string | null;
165
+ };
166
+ } | null;
167
+ is_sub_ticket: boolean;
168
+ created_at: string;
169
+ updated_at: string;
170
+ shop_order: number;
171
+ shipped_with_merchandise_id: number | null;
172
+ restricted_shop_account: boolean;
173
+ cash_point_order: number;
174
+ capacities: {
175
+ [key: string]: number;
176
+ };
177
+ total_capacities: {
178
+ [key: string]: number;
179
+ };
180
+ max_capacity: number;
181
+ max_total_capacity: number;
182
+ dynamic_prices: {
183
+ [key: string]: number;
184
+ } | null;
185
+ };
186
+ };
187
+ signIn(params: SignInParams): Promise<SignInResponse>;
188
+ signUp(params: SignUpParams, asGuest?: boolean): Promise<SignUpResponse>;
189
+ checkout(params: CheckoutParams): Promise<CheckoutResponse>;
190
+ /**
191
+ * Returns a reactive value that will contain the fetched data, no need to await.
192
+ *
193
+ * @param {`/api${string}`} endpoint - The API endpoint to fetch data from. Must start with `/api`.
194
+ * @param {string} dataKey - The key where the fetched data will be stored in `shop.#data`.
195
+ * @param {string} responseKey - The key in the API response that contains the desired data.
196
+ * @param [options]
197
+ * - query: A record of query parameters to include in the API request.
198
+ * - cache: The cache duration (in seconds) before data is considered expired. Defaults to 1000 seconds if not provided.
199
+ * @return {T} The data fetched from the API or the cached data if it is still valid.
200
+ */
201
+ fetchAndCache<T>(endpoint: `/api${string}`, dataKey: string, responseKey: string, options?: {
202
+ query?: Record<string, unknown>;
203
+ cache?: number | undefined;
204
+ }): T;
205
+ get museums(): {
206
+ id: number;
207
+ title: string;
208
+ sub_title: string | null;
209
+ created_at: string;
210
+ updated_at: string;
211
+ picture: import('@gomus/types').components["schemas"]["picture"];
212
+ }[];
213
+ get exhibitions(): {
214
+ id: number;
215
+ museum_id: number;
216
+ foreign_id: string | null;
217
+ title: string;
218
+ sub_title: string | null;
219
+ created_at: string;
220
+ updated_at: string;
221
+ featured: boolean;
222
+ description: string | null;
223
+ picture: import('@gomus/types').components["schemas"]["picture"];
224
+ time_frames: {
225
+ start_at?: string;
226
+ end_at?: string;
227
+ }[];
228
+ location: import('@gomus/types').components["schemas"]["location"];
229
+ }[];
230
+ getEvent(id: number): {
231
+ id: number;
232
+ description: string | null;
233
+ museum_id: number;
234
+ exhibition_id: number | null;
235
+ foreign_id: string | null;
236
+ title: string;
237
+ sub_title: string | null;
238
+ created_at: string;
239
+ updated_at: string;
240
+ featured: boolean;
241
+ bookable: boolean;
242
+ registerable: boolean;
243
+ picture: import('@gomus/types').components["schemas"]["picture"];
244
+ duration: number;
245
+ location: import('@gomus/types').components["schemas"]["location"];
246
+ age_groups: import('@gomus/types').components["schemas"]["name_id_pair"];
247
+ audiences: import('@gomus/types').components["schemas"]["name_id_pair"];
248
+ catch_words: import('@gomus/types').components["schemas"]["name_id_pair"];
249
+ disablements: import('@gomus/types').components["schemas"]["name_id_pair"];
250
+ grades: import('@gomus/types').components["schemas"]["name_id_pair"];
251
+ proposal_categories: import('@gomus/types').components["schemas"]["name_id_pair"];
252
+ languages: import('@gomus/types').components["schemas"]["language"][];
253
+ category: import('@gomus/types').components["schemas"]["category"];
254
+ upcoming_bookings_start_times: string[];
255
+ tickets: number[];
256
+ quotas: number[];
257
+ ticket_sales_in_shop: boolean;
258
+ dates: {
259
+ first: string;
260
+ last: string;
261
+ count: number;
262
+ };
263
+ sellabilities: import('@gomus/types').components["schemas"]["time_frame"][];
264
+ documents: import('@gomus/types').components["schemas"]["document"][];
265
+ content: Record<string, never>;
266
+ };
267
+ get events(): {
268
+ id: number;
269
+ description: string | null;
270
+ museum_id: number;
271
+ exhibition_id: number | null;
272
+ foreign_id: string | null;
273
+ title: string;
274
+ sub_title: string | null;
275
+ created_at: string;
276
+ updated_at: string;
277
+ featured: boolean;
278
+ bookable: boolean;
279
+ registerable: boolean;
280
+ picture: import('@gomus/types').components["schemas"]["picture"];
281
+ duration: number;
282
+ location: import('@gomus/types').components["schemas"]["location"];
283
+ age_groups: import('@gomus/types').components["schemas"]["name_id_pair"];
284
+ audiences: import('@gomus/types').components["schemas"]["name_id_pair"];
285
+ catch_words: import('@gomus/types').components["schemas"]["name_id_pair"];
286
+ disablements: import('@gomus/types').components["schemas"]["name_id_pair"];
287
+ grades: import('@gomus/types').components["schemas"]["name_id_pair"];
288
+ proposal_categories: import('@gomus/types').components["schemas"]["name_id_pair"];
289
+ languages: import('@gomus/types').components["schemas"]["language"][];
290
+ category: import('@gomus/types').components["schemas"]["category"];
291
+ upcoming_bookings_start_times: string[];
292
+ }[];
293
+ get upcomingEvents(): {
294
+ id: number;
295
+ description: string | null;
296
+ museum_id: number;
297
+ exhibition_id: number | null;
298
+ foreign_id: string | null;
299
+ title: string;
300
+ sub_title: string | null;
301
+ created_at: string;
302
+ updated_at: string;
303
+ featured: boolean;
304
+ bookable: boolean;
305
+ registerable: boolean;
306
+ picture: import('@gomus/types').components["schemas"]["picture"];
307
+ duration: number;
308
+ location: import('@gomus/types').components["schemas"]["location"];
309
+ age_groups: import('@gomus/types').components["schemas"]["name_id_pair"];
310
+ audiences: import('@gomus/types').components["schemas"]["name_id_pair"];
311
+ catch_words: import('@gomus/types').components["schemas"]["name_id_pair"];
312
+ disablements: import('@gomus/types').components["schemas"]["name_id_pair"];
313
+ grades: import('@gomus/types').components["schemas"]["name_id_pair"];
314
+ proposal_categories: import('@gomus/types').components["schemas"]["name_id_pair"];
315
+ languages: import('@gomus/types').components["schemas"]["language"][];
316
+ category: import('@gomus/types').components["schemas"]["category"];
317
+ upcoming_bookings_start_times: string[];
318
+ }[];
319
+ get tours(): {
320
+ id: number;
321
+ exhibition_id?: number | null;
322
+ museum_id: number;
323
+ foreign_id?: number | null;
324
+ min_persons?: number;
325
+ max_persons?: number;
326
+ title: string;
327
+ sub_title?: string | null;
328
+ bookable: boolean;
329
+ registerable: boolean;
330
+ featured: boolean;
331
+ category: {
332
+ id: number;
333
+ name: string;
334
+ filtername: string | null;
335
+ };
336
+ equipment: boolean;
337
+ picture: import('@gomus/types').components["schemas"]["picture"];
338
+ created_at?: string;
339
+ updated_at?: string;
340
+ duration?: number;
341
+ location: import('@gomus/types').components["schemas"]["location"];
342
+ age_groups: Record<string, never>[];
343
+ audiences: Record<string, never>[];
344
+ catch_words: Record<string, never>[];
345
+ disablements: Record<string, never>[];
346
+ grades: Record<string, never>[];
347
+ proposal_categories: import('@gomus/types').components["schemas"]["name_id_pair"];
348
+ languages: import('@gomus/types').components["schemas"]["language"][];
349
+ }[];
350
+ get merchandises(): {
351
+ merchandise?: {
352
+ id?: number;
353
+ title?: string;
354
+ sub_title?: string | null;
355
+ description?: string | null;
356
+ price_cents?: number;
357
+ vat_pct?: number;
358
+ tax_included?: boolean;
359
+ sellable?: boolean;
360
+ content?: import('@gomus/types').components["schemas"]["object_content"];
361
+ picture?: import('@gomus/types').components["schemas"]["picture"];
362
+ created_at?: string;
363
+ updated_at?: string;
364
+ shipped_with_merchandise_id?: number | null;
365
+ is_shipping_article?: boolean;
366
+ };
367
+ }[];
368
+ get customerSalutations(): {
369
+ id: number;
370
+ salutation: string;
371
+ }[];
372
+ get countries(): {
373
+ id: number;
374
+ name: string;
375
+ }[];
376
+ get urls(): {
377
+ account: () => string;
378
+ annualTickets: () => string;
379
+ checkoutFailure: (errorMessage: string) => string;
380
+ checkoutSuccess: (token: string) => string;
381
+ checkoutForm: () => string;
382
+ coupons: () => string;
383
+ combiTickets: () => string;
384
+ combiTicketGroup: (slug: string) => string;
385
+ dayTickets: () => string;
386
+ eventGroup: (id: number) => string;
387
+ event: (id: number) => string;
388
+ events: () => string;
389
+ exhibition: (id: number) => string;
390
+ exhibitions: () => string;
391
+ home: () => string;
392
+ login: () => string;
393
+ merchandise: (id: number) => string;
394
+ merchandises: () => string;
395
+ museum: (id: number) => string;
396
+ museums: () => string;
397
+ publicTours: () => string;
398
+ register: () => string;
399
+ tickets: () => string;
400
+ ticketGroup: (slug: string) => string;
401
+ tour: (id: number) => string;
402
+ tours: () => string;
403
+ toursGroup: (id: number) => string;
404
+ cart: () => string;
405
+ } | undefined;
406
+ apiPost<T>(path: string, { body }: {
407
+ body: Record<string, any>;
408
+ }): Promise<T>;
409
+ waitForAllFetches(...variables: unknown[]): Promise<void>;
410
+ apiGet(path: `/api${string}`, query?: Record<string, unknown>): Promise<unknown>;
411
+ }
412
+ export declare const shop: Shop;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { ShopKind } from './shop.svelte';
2
+ export declare abstract class User {
3
+ abstract get isLoggedIn(): boolean;
4
+ abstract get isGuest(): boolean;
5
+ get isAuthenticated(): boolean;
6
+ }
7
+ export declare class AngularUser extends User {
8
+ constructor();
9
+ get isLoggedIn(): boolean;
10
+ get isGuest(): boolean;
11
+ }
12
+ export declare class JMBUser extends User {
13
+ get isGuest(): boolean;
14
+ get isLoggedIn(): boolean;
15
+ }
16
+ export declare const getUserProvider: (type: ShopKind) => User;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const sbGlobals: {
2
+ shop: string;
3
+ env: string;
4
+ locale: string;
5
+ styles: string;
6
+ };
7
+ export declare const onStoryBook: {
8
+ value: boolean;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ export declare function wait(ms: number): Promise<unknown>;
2
+ export declare function isEmail(email: string): boolean;
3
+ export declare function isBoolean(value: unknown): value is boolean;
4
+ /**
5
+ * Repeatedly invokes a callback function at regular intervals until it returns a truthy value,
6
+ * or until a timeout is reached. Resolves with the truthy result or `undefined` if the timeout expires.
7
+ * If the callback throws an error at any point, the promise will be rejected with that error.
8
+ *
9
+ * @param {Function} callback A function to be repeatedly invoked. It should return a value
10
+ * which will be checked for truthiness. If it throws an error,
11
+ * the polling will stop, and the returned promise will be rejected.
12
+ * @return {Promise<any>} A promise that resolves with the first truthy value returned by the callback,
13
+ * `undefined` if the timeout is reached without any truthy value,
14
+ * or rejects if the callback throws an error.
15
+ */
16
+ export declare function pollUntilTruthy(callback: () => any): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import { Cookies } from '@sveltejs/kit';
2
+ export declare const mockedCookies: Cookies;
@@ -0,0 +1 @@
1
+ export declare function attachMswLogger(server: any): void;
@@ -0,0 +1,3 @@
1
+ /** Monitors an incoming request, perform it and log the response */
2
+ export declare const monitor: import('msw').HttpHandler;
3
+ export declare const networkError: import('msw').HttpHandler;