@coras-io/embed 0.1.0 → 0.1.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.
- package/CHANGELOG.md +60 -1
- package/README.md +1 -1
- package/dist/components/accordion/accordion-item/accordion-item.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/alert/alert.component.d.ts +2 -2
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +3 -3
- package/dist/components/attraction-card/base/attraction-card.mixin.js +1 -1
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +2 -2
- package/dist/components/attraction-card/long/attraction-long-card.component.d.ts +1 -1
- package/dist/components/attraction-card/long/attraction-long-card.component.js +1 -1
- package/dist/components/attraction-card/short/attraction-short-card.component.d.ts +1 -1
- package/dist/components/attraction-card/short/attraction-short-card.component.js +1 -1
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +1 -1
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +1 -1
- package/dist/components/attraction-header/attraction-header.component.d.ts +3 -3
- package/dist/components/attraction-header/attraction-header.utils.d.ts +3 -3
- package/dist/components/attraction-option/attraction-option.component.d.ts +1 -1
- package/dist/components/basket/basket.component.d.ts +2 -2
- package/dist/components/basket-empty/basket-empty.component.d.ts +1 -1
- package/dist/components/basket-item/basket-item.component.d.ts +1 -1
- package/dist/components/basket-item-ticket/basket-item-ticket.component.d.ts +1 -1
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +1 -1
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +1 -1
- package/dist/components/better-carousel/better-carousel-item/better-carousel-item.component.d.ts +1 -1
- package/dist/components/better-carousel/better-carousel.component.d.ts +1 -1
- package/dist/components/bottom-drawer/bottom-drawer.component.d.ts +1 -1
- package/dist/components/bottom-drawer/bottom-drawer.component.js +1 -1
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.d.ts +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +1 -1
- package/dist/components/button/button.component.d.ts +2 -2
- package/dist/components/calendar/base/calendar.mixin.d.ts +2 -2
- package/dist/components/calendar/base/calendar.types.d.ts +2 -2
- package/dist/components/calendar/dual/dual.component.d.ts +1 -1
- package/dist/components/calendar/month/month.component.d.ts +1 -1
- package/dist/components/calendar/month/month.component.js +1 -1
- package/dist/components/calendar/multi/multi.component.d.ts +1 -1
- package/dist/components/carousel/carousel-item/carousel-item.component.d.ts +1 -1
- package/dist/components/carousel/carousel-item/carousel-item.component.js +1 -1
- package/dist/components/carousel/carousel.component.d.ts +1 -1
- package/dist/components/carousel/carousel.component.js +2 -2
- package/dist/components/carousel/carousel.styles.js +10 -0
- package/dist/components/categories-tree/categories-tree.component.d.ts +2 -2
- package/dist/components/category-tag/category-tag.component.d.ts +2 -2
- package/dist/components/category-tag/category-tag.types.d.ts +1 -1
- package/dist/components/checkbox/checkbox.component.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.component.d.ts +1 -1
- package/dist/components/checkbox-group/checkbox-group.types.d.ts +1 -1
- package/dist/components/chip/chip.component.d.ts +2 -2
- package/dist/components/collect-fida/collect-fida.component.d.ts +1 -1
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +2 -2
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +2 -2
- package/dist/components/currencies-list/currencies-list.component.d.ts +2 -2
- package/dist/components/currencies-list/currencies-list.component.js +1 -1
- package/dist/components/dialog/dialog.component.d.ts +2 -2
- package/dist/components/drawer/drawer.component.d.ts +1 -1
- package/dist/components/drawer/drawer.component.js +1 -1
- package/dist/components/dropdown/dropdown.component.d.ts +1 -1
- package/dist/components/dropdown/dropdown.component.js +1 -1
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +1 -1
- package/dist/components/explore-card/explore-card.component.d.ts +1 -1
- package/dist/components/explore-card/explore-card.component.js +1 -1
- package/dist/components/explore-card/explore-card.styles.js +23 -0
- package/dist/components/filter-chip/filter-chip.component.d.ts +2 -2
- package/dist/components/filter-chip/filter-chip.component.js +1 -1
- package/dist/components/filters-drawer/filters-drawer.component.d.ts +1 -1
- package/dist/components/flag-icon/flag-icon.component.d.ts +2 -2
- package/dist/components/footer-menu/footer-menu-item/footer-menu-item.component.d.ts +1 -1
- package/dist/components/footer-menu/footer-menu.component.d.ts +1 -1
- package/dist/components/icon/icon.component.d.ts +2 -2
- package/dist/components/icon/icon.component.js +1 -1
- package/dist/components/icon-list/icon-list-item/icon-list-item.component.d.ts +2 -2
- package/dist/components/icon-list/icon-list.component.d.ts +1 -1
- package/dist/components/image/image.component.d.ts +3 -3
- package/dist/components/image/image.component.js +1 -1
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +1 -1
- package/dist/components/image-carousel/image-carousel.component.d.ts +1 -1
- package/dist/components/image-chip/image-chip.component.d.ts +1 -1
- package/dist/components/image-viewer/image-viewer.component.d.ts +1 -1
- package/dist/components/input-field/input-field.component.d.ts +2 -2
- package/dist/components/input-field/input-field.types.d.ts +2 -0
- package/dist/components/input-field/input-field.types.js +1 -0
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +1 -1
- package/dist/components/itinerary/itinerary.component.d.ts +1 -1
- package/dist/components/joined-fields/joined-fields.component.d.ts +1 -1
- package/dist/components/joined-fields/joined-fields.component.js +1 -1
- package/dist/components/layout/layout.component.d.ts +1 -1
- package/dist/components/list/list-item/list-item.component.d.ts +2 -2
- package/dist/components/list/list.component.d.ts +1 -1
- package/dist/components/loading-spinner/loading-spinner.component.d.ts +2 -2
- package/dist/components/locales-list/locales-list.component.d.ts +2 -2
- package/dist/components/locales-list/locales-list.component.js +1 -1
- package/dist/components/locales-list/locales-list.constants.d.ts +1 -1
- package/dist/components/location-image/location-image.component.d.ts +2 -2
- package/dist/components/location-image/location-image.component.js +1 -1
- package/dist/components/locations-results/locations-results.component.d.ts +2 -2
- package/dist/components/locations-results/locations-results.component.js +1 -1
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +1 -1
- package/dist/components/message-card/message-card.component.d.ts +2 -2
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +1 -1
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +1 -1
- package/dist/components/option-group/option-chip/option-chip.component.js +1 -1
- package/dist/components/option-group/option-group.component.d.ts +1 -1
- package/dist/components/order-confirmation/order-confirmation-item/order-confirmation-item.component.d.ts +1 -1
- package/dist/components/order-confirmation/order-confirmation.component.d.ts +1 -1
- package/dist/components/order-confirmation/order-confirmation.component.js +1 -1
- package/dist/components/otp/otp.component.d.ts +1 -1
- package/dist/components/overlay/overlay.component.d.ts +1 -1
- package/dist/components/pay-in/pay-in.component.d.ts +2 -2
- package/dist/components/payment-fiat-method/payment-fiat-method.component.d.ts +3 -2
- package/dist/components/payment-fiat-method/payment-fiat-method.types.d.ts +1 -0
- package/dist/components/payment-fiat-method/payment-fiat-method.types.js +1 -0
- package/dist/components/payment-option/payment-option.component.d.ts +2 -2
- package/dist/components/payment-option/payment-option.component.js +1 -1
- package/dist/components/performance-time/performance-time.component.d.ts +1 -1
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +1 -1
- package/dist/components/phone-country-codes/phone-country-codes.component.d.ts +2 -2
- package/dist/components/phone-field/phone-field.component.d.ts +3 -3
- package/dist/components/phone-field/phone-field.utils.d.ts +1 -1
- package/dist/components/points/points.component.d.ts +1 -1
- package/dist/components/price/price.component.d.ts +2 -2
- package/dist/components/reservation-preview/reservation-preview.component.d.ts +1 -1
- package/dist/components/reservation-preview-item/reservation-preview-item.component.d.ts +1 -1
- package/dist/components/reviews/review/review.component.d.ts +1 -1
- package/dist/components/reviews/reviews.component.d.ts +1 -1
- package/dist/components/search-button/search-button.component.d.ts +1 -1
- package/dist/components/search-results-item/search-results-item.d.ts +3 -3
- package/dist/components/seated-selector/seated-selector.component.d.ts +1 -1
- package/dist/components/seated-selector/seated-selector.component.js +3 -3
- package/dist/components/seats-io/seats-io.component.d.ts +4 -4
- package/dist/components/seats-io/seats-io.component.js +1 -1
- package/dist/components/seats-io/seats-io.transform.d.ts +2 -2
- package/dist/components/select-list/select-list.component.d.ts +1 -1
- package/dist/components/select-list/select-option/select-option.component.d.ts +1 -1
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +1 -1
- package/dist/components/sort-dropdown/sort-dropdown.component.d.ts +1 -1
- package/dist/components/sort-list/sort-list.component.d.ts +1 -1
- package/dist/components/sport-options/sport-option/sport-option.component.d.ts +1 -1
- package/dist/components/sport-options/sport-options.component.d.ts +1 -1
- package/dist/components/star-rating/star-rating.component.d.ts +1 -1
- package/dist/components/star-rating/star-rating.component.js +1 -1
- package/dist/components/tab/tab.component.d.ts +1 -1
- package/dist/components/tab/tab.component.js +1 -1
- package/dist/components/tab-panel/tab-panel.component.d.ts +1 -1
- package/dist/components/tab-panel/tab-panel.component.js +1 -1
- package/dist/components/tabs/tabs.component.d.ts +1 -1
- package/dist/components/tag/tag.component.d.ts +2 -2
- package/dist/components/text-section/text-section.component.d.ts +1 -1
- package/dist/components/time-tag/time-tag.component.d.ts +2 -2
- package/dist/components/tooltip/tooltip.component.d.ts +1 -1
- package/dist/components/tour-ticket-type-selector/tour-ticket-counter-button/tour-ticket-counter-button.component.d.ts +1 -1
- package/dist/components/tour-ticket-type-selector/tour-ticket-type/tour-ticket-type.component.d.ts +1 -1
- package/dist/components/tour-ticket-type-selector/tour-ticket-type-selector.component.d.ts +1 -1
- package/dist/components/transfer-modal/transfer-modal.component.d.ts +1 -1
- package/dist/components/transfer-modal/transfer-modal.component.js +1 -1
- package/dist/containers/footer/footer.component.d.ts +1 -1
- package/dist/containers/navbar/navbar.component.d.ts +6 -6
- package/dist/containers/navbar/navbar.utils.d.ts +2 -2
- package/dist/contexts/basket/basket.context.d.ts +1 -1
- package/dist/contexts/basket/basket.provider.d.ts +4 -4
- package/dist/contexts/basket/basket.provider.js +1 -1
- package/dist/contexts/basket/basket.types.d.ts +2 -2
- package/dist/contexts/client.context.d.ts +2 -2
- package/dist/contexts/current-page.context.d.ts +1 -1
- package/dist/contexts/events.context.d.ts +3 -3
- package/dist/contexts/types.d.ts +2 -2
- package/dist/controllers/time-expiration.d.ts +1 -1
- package/dist/core/api/middlewares/booking-session/booking-session.d.ts +1 -1
- package/dist/core/api/middlewares/error-handler/error-handler.d.ts +1 -1
- package/dist/core/api/queries.d.ts +2 -2
- package/dist/core/currency/constants.d.ts +1 -1
- package/dist/core/currency/index.d.ts +3 -5
- package/dist/core/currency/index.js +16 -6
- package/dist/core/events.d.ts +2 -2
- package/dist/core/i18n/date.d.ts +2 -2
- package/dist/core/i18n/localization.js +1 -1
- package/dist/core/images/constants.d.ts +1 -1
- package/dist/core/images/constants.js +1 -1
- package/dist/core/images/filters.d.ts +2 -2
- package/dist/core/images/filters.js +2 -2
- package/dist/core/images/selection.d.ts +3 -3
- package/dist/core/images/selection.js +3 -3
- package/dist/core/images/srcset.d.ts +1 -1
- package/dist/core/images/srcset.js +6 -6
- package/dist/core/images/url.d.ts +1 -1
- package/dist/core/images/url.js +1 -1
- package/dist/core/pages.d.ts +1 -1
- package/dist/core/storybook/cssprops.d.ts +1 -1
- package/dist/core/types/core/base.d.ts +2 -2
- package/dist/core/types/core/category.d.ts +1 -1
- package/dist/core/types/core/currency.d.ts +1 -1
- package/dist/core/types/core/locale.d.ts +1 -1
- package/dist/core/types/core/sorting.d.ts +1 -1
- package/dist/core/types/currencies.d.ts +1 -1
- package/dist/core/types/locales.d.ts +2 -2
- package/dist/core/types/seats-config.d.ts +1 -1
- package/dist/core/utils/datetime.d.ts +1 -1
- package/dist/core/utils/locale.d.ts +2 -2
- package/dist/core/utils/scroll-lock.d.ts +2 -2
- package/dist/core/utils/scroll-lock.js +3 -3
- package/dist/core/utils/time.d.ts +1 -1
- package/dist/custom-elements.json +444 -355
- package/dist/helpers/helpers.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mixins/base.mixin.d.ts +6 -6
- package/dist/mixins/base.mixin.js +2 -2
- package/dist/mixins/coinbase-chains.d.ts +1 -0
- package/dist/mixins/coinbase-chains.js +7 -0
- package/dist/mixins/coinbase.mixin.d.ts +4 -4
- package/dist/mixins/coinbase.mixin.js +19 -7
- package/dist/mixins/error-modal.mixin.d.ts +2 -2
- package/dist/mixins/location-search/location-search.d.ts +3 -3
- package/dist/mixins/location-search/location-search.js +1 -1
- package/dist/mixins/location-search/types.d.ts +2 -2
- package/dist/mixins/overlay/overlay-mixin.d.ts +2 -2
- package/dist/mixins/overlay/types.d.ts +1 -1
- package/dist/mixins/points/points.d.ts +2 -2
- package/dist/mixins/points/types.d.ts +1 -1
- package/dist/mixins/search-mixin/search-mixin.d.ts +3 -3
- package/dist/mixins/search-mixin/types.d.ts +2 -2
- package/dist/sdk/chrome.js +9 -5
- package/dist/sdk/diagnostics.d.ts +9 -0
- package/dist/sdk/diagnostics.js +25 -0
- package/dist/sdk/mount.js +42 -0
- package/dist/sdk/once.d.ts +9 -0
- package/dist/sdk/once.js +18 -0
- package/dist/sdk/page-registry.d.ts +2 -2
- package/dist/sdk/page-registry.js +10 -10
- package/dist/sdk/theme.js +1 -1
- package/dist/sdk/types.d.ts +11 -11
- package/dist/sdk/validation.d.ts +2 -2
- package/dist/sdk/validation.js +7 -6
- package/dist/styles/tokens.css +1 -1
- package/dist/styles/tokens.d.ts +1 -1
- package/dist/styles/tokens.generated.d.ts +1 -1
- package/dist/styles/tokens.generated.js +2 -2
- package/dist/views/constants.d.ts +1 -1
- package/dist/views/details-page/details-page.component.d.ts +4 -4
- package/dist/views/details-page/details-page.component.js +2 -2
- package/dist/views/details-page/details-page.utilts.d.ts +2 -2
- package/dist/views/details-page/partials/theater-description/theater-description.component.d.ts +3 -3
- package/dist/views/details-page/partials/tour-description/tour-description.component.d.ts +4 -4
- package/dist/views/help-page/help-page.component.d.ts +2 -2
- package/dist/views/help-page/help-page.component.js +1 -1
- package/dist/views/help-page/help-page.types.d.ts +1 -1
- package/dist/views/help-page/help-page.utils.d.ts +2 -2
- package/dist/views/landing-page/landing-page.component.d.ts +4 -4
- package/dist/views/landing-page/landing-page.component.js +1 -1
- package/dist/views/landing-page/landing-page.types.d.ts +1 -1
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +3 -3
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +3 -3
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +1 -1
- package/dist/views/payment-page/controllers/form-validation.controller.d.ts +5 -5
- package/dist/views/payment-page/controllers/layout.controller.d.ts +1 -1
- package/dist/views/payment-page/controllers/layout.controller.js +1 -1
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +1 -1
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +3 -3
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +5 -5
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +4 -4
- package/dist/views/payment-page/partials/confirmation/confirmation.component.d.ts +2 -2
- package/dist/views/payment-page/partials/country-field/country-field.component.d.ts +2 -2
- package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
- package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.component.d.ts +3 -3
- package/dist/views/payment-page/partials/hotel-pickup-list/hotel-pickup-list.component.d.ts +2 -2
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.d.ts +3 -3
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +1 -1
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +1 -1
- package/dist/views/payment-page/partials/stripe/stripe.component.js +1 -1
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +1 -1
- package/dist/views/payment-page/payment-page.component.d.ts +3 -3
- package/dist/views/payment-page/payment-page.component.js +7 -7
- package/dist/views/payment-page/payment-page.types.d.ts +3 -3
- package/dist/views/payment-page/payment-page.utils.d.ts +8 -8
- package/dist/views/payment-page/payment-page.utils.js +5 -5
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +1 -1
- package/dist/views/payment-page/services/payment-api.service.d.ts +2 -2
- package/dist/views/payment-page/services/payment-api.service.js +1 -1
- package/dist/views/search-page/search-page.component.d.ts +4 -4
- package/dist/views/search-page/search-page.component.js +1 -1
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +10 -5
- package/dist/views/suggestion-widget/suggestion-widget.component.js +118 -42
- package/dist/views/suggestion-widget/suggestion-widget.styles.js +57 -4
- package/package.json +9 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, TemplateResult } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, type TemplateResult } from "lit";
|
|
2
2
|
import "../../../../components/dropdown/dropdown.js";
|
|
3
3
|
import "../../../../components/input-field/input-field.js";
|
|
4
4
|
import "../../../../components/icon/icon.js";
|
|
5
5
|
import "../../../../components/select-list/select-list.js";
|
|
6
6
|
import "../../../../components/select-list/select-option/select-option.js";
|
|
7
|
-
import { components } from "../../../../core/types/api-schema.js";
|
|
7
|
+
import type { components } from "../../../../core/types/api-schema.js";
|
|
8
8
|
/**
|
|
9
9
|
* @fires value-changed - Dispatched when a country is selected
|
|
10
10
|
*/
|
|
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var CorasCountryField_1;
|
|
8
|
-
import { LitElement, html } from "lit";
|
|
8
|
+
import { LitElement, html, } from "lit";
|
|
9
9
|
import { property, state } from "lit/decorators.js";
|
|
10
10
|
import { localized, msg } from "@lit/localize";
|
|
11
11
|
import "../../../../components/dropdown/dropdown.js";
|
package/dist/views/payment-page/partials/hotel-pickup-field/hotel-pickup-field.component.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, nothing } from "lit";
|
|
2
|
-
import { components } from "../../../../core/types/api-schema.js";
|
|
1
|
+
import { type CSSResultGroup, LitElement, nothing } from "lit";
|
|
2
|
+
import type { components } from "../../../../core/types/api-schema.js";
|
|
3
3
|
import "../../../../components/dropdown/dropdown.js";
|
|
4
4
|
import "../../../../components/input-field/input-field.js";
|
|
5
5
|
import "../../../../components/icon/icon.js";
|
|
@@ -15,5 +15,5 @@ export declare class CorasHotelPickupField extends LitElement {
|
|
|
15
15
|
hasError: boolean;
|
|
16
16
|
private dropdownOpen;
|
|
17
17
|
private getSelectedPickupName;
|
|
18
|
-
render(): import("lit").TemplateResult<1
|
|
18
|
+
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
19
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement } from "lit";
|
|
2
2
|
import "@lit-labs/virtualizer";
|
|
3
|
-
import { components } from "../../../../core/types/api-schema.js";
|
|
3
|
+
import type { components } from "../../../../core/types/api-schema.js";
|
|
4
4
|
export declare class CorasHotelPickupList extends LitElement {
|
|
5
5
|
static styles: CSSResultGroup;
|
|
6
6
|
options: components["schemas"]["OptionPickupPoint"][];
|
package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import "../../../../components/payment-option/payment-option.js";
|
|
3
3
|
import "../../../../components/payment-fiat-method/payment-fiat-method.js";
|
|
4
4
|
import "../../../../components/message-card/message-card.js";
|
|
5
|
-
import { SupportedCurrencies } from "../../../../core/types/index.js";
|
|
6
|
-
import { PaymentFiatMethodType } from "../../../../components/payment-fiat-method/payment-fiat-method.component.js";
|
|
5
|
+
import type { SupportedCurrencies } from "../../../../core/types/index.js";
|
|
6
|
+
import type { PaymentFiatMethodType } from "../../../../components/payment-fiat-method/payment-fiat-method.component.js";
|
|
7
7
|
/**
|
|
8
8
|
* A payment type selector component that displays payment options for Stripe and crypto.
|
|
9
9
|
*
|
package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js
CHANGED
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, LitElement, nothing } from "lit";
|
|
7
|
+
import { html, LitElement, nothing, } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { localized, msg, str } from "@lit/localize";
|
|
10
10
|
import "../../../../components/payment-option/payment-option.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement } from "lit";
|
|
2
2
|
import type { Stripe, StripeCardNumberElement, StripeElements, PaymentRequest } from "@stripe/stripe-js";
|
|
3
3
|
import "../../../../components/joined-fields/joined-fields.js";
|
|
4
4
|
import "../../../../components/input-field/input-field.js";
|
|
@@ -188,7 +188,7 @@ let CorasStripe = class CorasStripe extends LitElement {
|
|
|
188
188
|
this.stripe = await loadStripe(this.stripeKey, options);
|
|
189
189
|
if (this.stripe) {
|
|
190
190
|
// Theme the hosted card iframe to match the embed's surface, brand, and
|
|
191
|
-
// colour scheme (light/dark)
|
|
191
|
+
// colour scheme (light/dark) - the per-element style only sets text.
|
|
192
192
|
this.elements = this.stripe.elements({
|
|
193
193
|
appearance: buildStripeAppearance(getComputedStyle(this)),
|
|
194
194
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import "../../components/alert/alert.js";
|
|
3
3
|
import "../../components/button/button.js";
|
|
4
4
|
import "../../components/checkbox/checkbox.js";
|
|
@@ -16,7 +16,7 @@ import "../../components/select-list/select-list.js";
|
|
|
16
16
|
import "../../components/select-list/select-option/select-option.js";
|
|
17
17
|
import "../../components/transfer-modal/transfer-modal.js";
|
|
18
18
|
import "../../components/crypto-auth-modal/crypto-auth-modal.js";
|
|
19
|
-
import { PaymentPageParamsEvent } from "../../core/pages.js";
|
|
19
|
+
import type { PaymentPageParamsEvent } from "../../core/pages.js";
|
|
20
20
|
import "../../components/bottom-drawer/bottom-drawer.js";
|
|
21
21
|
import "../../components/expiration-timer/expiration-timer.js";
|
|
22
22
|
import "./partials/stripe/stripe.js";
|
|
@@ -26,7 +26,7 @@ import "./partials/confirmation/confirmation.js";
|
|
|
26
26
|
import "./partials/payment-type-selector/payment-type-selector.js";
|
|
27
27
|
import "./partials/activity-details/activity-details.js";
|
|
28
28
|
import "./partials/billing-address/billing-address.js";
|
|
29
|
-
import { PageName } from "../../core/types/shared.js";
|
|
29
|
+
import type { PageName } from "../../core/types/shared.js";
|
|
30
30
|
declare const CorasPaymentPage_base: import("../../contexts/utils.js").Constructor<import("../../mixins/coinbase.mixin.js").CoinbaseMixinInterface> & import("../../contexts/utils.js").Constructor<import("../../mixins/error-modal.mixin.js").ErrorModalMixinInterface> & import("../../contexts/utils.js").Constructor<{
|
|
31
31
|
apiHost: string;
|
|
32
32
|
distributorID: string;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { html, LitElement, nothing } from "lit";
|
|
7
|
+
import { html, LitElement, nothing, } from "lit";
|
|
8
8
|
import { property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { localized, msg } from "@lit/localize";
|
|
10
10
|
import { fireEvent } from "../../core/events.js";
|
|
@@ -227,7 +227,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
227
227
|
return null;
|
|
228
228
|
}
|
|
229
229
|
const balance = await this.getTokenBalance(smartAccountAddress);
|
|
230
|
-
// Success
|
|
230
|
+
// Success - reset backoff
|
|
231
231
|
this.balanceBackoffMs = BALANCE_BACKOFF_INITIAL_MS;
|
|
232
232
|
this.clearBalanceBackoff();
|
|
233
233
|
return balance;
|
|
@@ -686,7 +686,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
686
686
|
getFieldVisibility() {
|
|
687
687
|
const data = this.reservationsCheckTask.value;
|
|
688
688
|
// In preview with no booking session there are no requirements to drive the
|
|
689
|
-
// form, so show every general field
|
|
689
|
+
// form, so show every general field - the studio brands the full form.
|
|
690
690
|
if (this.preview && !data?.general?.requirements?.length) {
|
|
691
691
|
return {
|
|
692
692
|
hasNameField: true,
|
|
@@ -853,7 +853,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
853
853
|
this._resetMfaPhoneState();
|
|
854
854
|
// Only switch away from crypto if user hasn't logged in yet.
|
|
855
855
|
// If they're logged in but closed the MFA modal, keep them on crypto
|
|
856
|
-
//
|
|
856
|
+
// - the pay button will remain disabled until MFA is enrolled.
|
|
857
857
|
if (!this.coinbaseSession) {
|
|
858
858
|
this.paymentType = "stripe";
|
|
859
859
|
}
|
|
@@ -875,7 +875,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
875
875
|
this.formController.selectedPhoneCode;
|
|
876
876
|
const mfaLocalNumber = this.cryptoAuthController.localPhoneNumber;
|
|
877
877
|
if (mfaPhoneCode && mfaLocalNumber) {
|
|
878
|
-
// Phone from MFA modal
|
|
878
|
+
// Phone from MFA modal - sync back to the main form
|
|
879
879
|
this.formController.selectedPhoneCode = { ...mfaPhoneCode };
|
|
880
880
|
this.handleFormValueChange("phone", mfaLocalNumber);
|
|
881
881
|
}
|
|
@@ -1084,7 +1084,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
1084
1084
|
});
|
|
1085
1085
|
}
|
|
1086
1086
|
catch {
|
|
1087
|
-
// Fire-and-forget
|
|
1087
|
+
// Fire-and-forget - consent failure should not block the login flow
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
1090
|
/**
|
|
@@ -1510,7 +1510,7 @@ let CorasPaymentPage = class CorasPaymentPage extends CoinbaseMixin(ErrorModalMi
|
|
|
1510
1510
|
renderReservationsTask() {
|
|
1511
1511
|
// The check task gates the form: it surfaces API failures and supplies the
|
|
1512
1512
|
// field requirements. Basket emptiness, though, is decided by the actual
|
|
1513
|
-
// reservations below
|
|
1513
|
+
// reservations below - the check response only carries requirements, and a
|
|
1514
1514
|
// basket of plain tickets returns no per-reservation entries.
|
|
1515
1515
|
return this.reservationsCheckTask.render({
|
|
1516
1516
|
pending: () => html `<div class="loading">${msg("Loading...")}</div>`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { components } from "../../core/types/api-schema.js";
|
|
1
|
+
import type { components } from "../../core/types/api-schema.js";
|
|
2
2
|
import type { Stripe, StripeCardNumberElement, StripeElements, PaymentRequest } from "@stripe/stripe-js";
|
|
3
3
|
export type PaymentOption = "fida" | "card" | "google" | "apple";
|
|
4
4
|
export type { PhoneCodeSelection } from "../../components/phone-field/phone-field.types.js";
|
|
@@ -24,8 +24,8 @@ export interface StripeComponent extends HTMLElement {
|
|
|
24
24
|
getCardNumberElement: () => StripeCardNumberElement | null;
|
|
25
25
|
updatePortals: () => void;
|
|
26
26
|
}
|
|
27
|
-
export type InputFieldType
|
|
28
|
-
|
|
27
|
+
export type { InputFieldType, InputFieldAutocomplete, } from "../../components/input-field/input-field.types.js";
|
|
28
|
+
import type { InputFieldType, InputFieldAutocomplete } from "../../components/input-field/input-field.types.js";
|
|
29
29
|
export interface FieldConfig {
|
|
30
30
|
label: () => string;
|
|
31
31
|
placeholder?: () => string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { components, paths } from "../../core/types/api-schema.js";
|
|
2
|
-
import { ReservationSummary } from "../../contexts/basket/basket.types.js";
|
|
3
|
-
import { FormValues, PhoneCodeSelection, FieldsConfig, ApiError, InputFieldType, InputFieldAutocomplete } from "./payment-page.types.js";
|
|
4
|
-
import { Client } from "openapi-fetch";
|
|
5
|
-
import { SupportedLocales } from "../../core/types/index.js";
|
|
6
|
-
import { ValidatorContext } from "./payment-page.validators.js";
|
|
1
|
+
import type { components, paths } from "../../core/types/api-schema.js";
|
|
2
|
+
import type { ReservationSummary } from "../../contexts/basket/basket.types.js";
|
|
3
|
+
import type { FormValues, PhoneCodeSelection, FieldsConfig, ApiError, InputFieldType, InputFieldAutocomplete } from "./payment-page.types.js";
|
|
4
|
+
import type { Client } from "openapi-fetch";
|
|
5
|
+
import type { SupportedLocales } from "../../core/types/index.js";
|
|
6
|
+
import type { ValidatorContext } from "./payment-page.validators.js";
|
|
7
7
|
/**
|
|
8
8
|
* Capitalizes the first letter of a string and replaces underscores with spaces
|
|
9
9
|
*/
|
|
@@ -163,7 +163,7 @@ export declare const isValidEmail: (email: string) => boolean;
|
|
|
163
163
|
export declare const validateWalletEmail: (email: string) => string;
|
|
164
164
|
/**
|
|
165
165
|
* Finds a country code for a country name.
|
|
166
|
-
* PP-007: Returns a strict ISO alpha-2 code
|
|
166
|
+
* PP-007: Returns a strict ISO alpha-2 code - never a raw country name.
|
|
167
167
|
* Falls back to DEFAULT_COUNTRY_CODE when no match is found.
|
|
168
168
|
*/
|
|
169
169
|
export declare const findCountryCode: (countryName: string, countries?: components["schemas"]["Country"][]) => string;
|
|
@@ -232,7 +232,7 @@ export declare function isValidPendingTransferPayload(data: unknown): data is Pe
|
|
|
232
232
|
export declare function computeTransferChecksum(transactionHash: string, amount: string, timestamp: number): Promise<string>;
|
|
233
233
|
/**
|
|
234
234
|
* Verifies the integrity checksum of a pending transfer payload.
|
|
235
|
-
* PP-006: Hardened
|
|
235
|
+
* PP-006: Hardened - legacy entries without checksums are no longer trusted
|
|
236
236
|
* when crypto.subtle is available. Returns true only if checksums match
|
|
237
237
|
* or crypto.subtle is completely unavailable (cannot verify at all).
|
|
238
238
|
*/
|
|
@@ -693,7 +693,7 @@ const ISO_ALPHA2_REGEX = /^[A-Z]{2}$/;
|
|
|
693
693
|
const DEFAULT_COUNTRY_CODE = "US";
|
|
694
694
|
/**
|
|
695
695
|
* Finds a country code for a country name.
|
|
696
|
-
* PP-007: Returns a strict ISO alpha-2 code
|
|
696
|
+
* PP-007: Returns a strict ISO alpha-2 code - never a raw country name.
|
|
697
697
|
* Falls back to DEFAULT_COUNTRY_CODE when no match is found.
|
|
698
698
|
*/
|
|
699
699
|
export const findCountryCode = (countryName, countries = []) => {
|
|
@@ -824,7 +824,7 @@ export function formatPhoneWithPlus(phone) {
|
|
|
824
824
|
return `+${cleaned}`;
|
|
825
825
|
}
|
|
826
826
|
// ────────────────────────────────────────────────────────────────────────────
|
|
827
|
-
// Pending crypto transfer recovery
|
|
827
|
+
// Pending crypto transfer recovery - validation & integrity
|
|
828
828
|
// ────────────────────────────────────────────────────────────────────────────
|
|
829
829
|
/**
|
|
830
830
|
* Ethereum transaction hash format: 0x followed by exactly 64 hex characters.
|
|
@@ -884,19 +884,19 @@ export async function computeTransferChecksum(transactionHash, amount, timestamp
|
|
|
884
884
|
return hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
885
885
|
}
|
|
886
886
|
catch {
|
|
887
|
-
// crypto.subtle unavailable (e.g., non-HTTPS, older browser)
|
|
887
|
+
// crypto.subtle unavailable (e.g., non-HTTPS, older browser) - skip checksum
|
|
888
888
|
return "";
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
/**
|
|
892
892
|
* Verifies the integrity checksum of a pending transfer payload.
|
|
893
|
-
* PP-006: Hardened
|
|
893
|
+
* PP-006: Hardened - legacy entries without checksums are no longer trusted
|
|
894
894
|
* when crypto.subtle is available. Returns true only if checksums match
|
|
895
895
|
* or crypto.subtle is completely unavailable (cannot verify at all).
|
|
896
896
|
*/
|
|
897
897
|
export async function verifyTransferChecksum(payload) {
|
|
898
898
|
const computed = await computeTransferChecksum(payload.transactionHash, payload.amount, payload.timestamp);
|
|
899
|
-
// If crypto.subtle is unavailable, we cannot verify at all
|
|
899
|
+
// If crypto.subtle is unavailable, we cannot verify at all - accept cautiously
|
|
900
900
|
if (!computed)
|
|
901
901
|
return true;
|
|
902
902
|
// PP-006: Reject entries without a checksum when we can verify
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Payment API Service
|
|
2
|
+
* Payment API Service - wraps API calls specific to the payment domain.
|
|
3
3
|
*
|
|
4
4
|
* Provides a stable interface for payment-related API operations,
|
|
5
5
|
* decoupling controllers from the raw API query functions.
|
|
6
6
|
* Currently delegates to apiGet/apiPut/apiPatch from core/api/queries.
|
|
7
7
|
*/
|
|
8
|
-
import { SupportedLocales } from "../../../core/types/index.js";
|
|
8
|
+
import type { SupportedLocales } from "../../../core/types/index.js";
|
|
9
9
|
import type { paths, components } from "../../../core/types/api-schema.js";
|
|
10
10
|
import type { Client } from "openapi-fetch";
|
|
11
11
|
export interface PaymentApiConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Payment API Service
|
|
2
|
+
* Payment API Service - wraps API calls specific to the payment domain.
|
|
3
3
|
*
|
|
4
4
|
* Provides a stable interface for payment-related API operations,
|
|
5
5
|
* decoupling controllers from the raw API query functions.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement, PropertyValues } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import "../../components/attraction-card/long/attraction-long-card.js";
|
|
3
3
|
import "../../components/button/button.js";
|
|
4
4
|
import "../../components/loading-spinner/loading-spinner.js";
|
|
5
5
|
import "../../components/layout/layout.js";
|
|
6
6
|
import "../../components/breadcrumbs/breadcrumbs.js";
|
|
7
7
|
import "../../components/breadcrumbs/breadcrumb-item/breadcrumb-item.js";
|
|
8
|
-
import { Client } from "openapi-fetch";
|
|
9
|
-
import { paths } from "../../core/types/api-schema.js";
|
|
10
|
-
import { SearchPageParamsEvent } from "../../core/pages.js";
|
|
8
|
+
import type { Client } from "openapi-fetch";
|
|
9
|
+
import type { paths } from "../../core/types/api-schema.js";
|
|
10
|
+
import type { SearchPageParamsEvent } from "../../core/pages.js";
|
|
11
11
|
export type AttractionsApiResponse = paths["/{api_version}/attractions"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
12
12
|
declare const CorasSearchPage_base: import("../../contexts/utils.js").Constructor<import("../../mixins/error-modal.mixin.js").ErrorModalMixinInterface> & import("../../contexts/utils.js").Constructor<import("../../mixins/location-search/types.js").LocationSearchMixinInterface> & import("../../contexts/utils.js").Constructor<{
|
|
13
13
|
apiHost: string;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, html, nothing } from "lit";
|
|
7
|
+
import { LitElement, html, nothing, } from "lit";
|
|
8
8
|
import { property, state } from "lit/decorators.js";
|
|
9
9
|
import { consume } from "@lit/context";
|
|
10
10
|
import { msg, str, localized } from "@lit/localize";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { CSSResultGroup, LitElement } from "lit";
|
|
1
|
+
import { type CSSResultGroup, LitElement } from "lit";
|
|
2
2
|
import "../../components/explore-card/explore-card.js";
|
|
3
3
|
import "../../components/button/button.js";
|
|
4
4
|
import "../../components/carousel/carousel.js";
|
|
5
|
-
import
|
|
5
|
+
import "../../components/attraction-card/short/attraction-short-card.js";
|
|
6
|
+
import type { PageParamsEvent } from "../../core/pages.js";
|
|
6
7
|
declare const CorasSuggestionWidget_base: import("../../contexts/utils.js").Constructor<{
|
|
7
8
|
apiHost: string;
|
|
8
9
|
distributorID: string;
|
|
@@ -23,11 +24,15 @@ export declare class CorasSuggestionWidget extends CorasSuggestionWidget_base {
|
|
|
23
24
|
showExploreCard: boolean;
|
|
24
25
|
country: string;
|
|
25
26
|
city: string;
|
|
26
|
-
|
|
27
|
+
/** Turn a location slug ("gran-canaria") into a display name ("Gran Canaria"). */
|
|
28
|
+
private humanize;
|
|
29
|
+
private suggestionsTask;
|
|
27
30
|
private handleCardClick;
|
|
28
31
|
private handleExploreCardClick;
|
|
29
|
-
private
|
|
32
|
+
private renderCard;
|
|
30
33
|
private renderExploreCard;
|
|
31
|
-
|
|
34
|
+
private renderContent;
|
|
35
|
+
private renderSkeleton;
|
|
36
|
+
render(): symbol | import("lit").TemplateResult<1> | undefined;
|
|
32
37
|
}
|
|
33
38
|
export {};
|
|
@@ -4,25 +4,41 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { LitElement, html } from "lit";
|
|
7
|
+
import { LitElement, html, nothing } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { localized, msg, str } from "@lit/localize";
|
|
10
|
+
import { Task } from "@lit/task";
|
|
11
|
+
import { formatISO, parseISO } from "date-fns";
|
|
10
12
|
import { ExploreCardVariants } from "../../components/explore-card/explore-card.constants.js";
|
|
11
13
|
import styles from "./suggestion-widget.styles.js";
|
|
12
14
|
import "../../components/explore-card/explore-card.js";
|
|
13
15
|
import "../../components/button/button.js";
|
|
14
16
|
import "../../components/carousel/carousel.js";
|
|
17
|
+
import "../../components/attraction-card/short/attraction-short-card.js";
|
|
15
18
|
import { getLocationImageURL } from "../../core/images/helpers.js";
|
|
16
19
|
import { IMAGE_BASE_URL } from "../../core/images/constants.js";
|
|
17
20
|
import { BaseMixin } from "../../mixins/base.mixin.js";
|
|
21
|
+
import { apiGet, withErrorHandling } from "../../core/api/queries.js";
|
|
22
|
+
import { convertToLocaleCurrency } from "../../core/currency/index.js";
|
|
18
23
|
let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitElement) {
|
|
19
24
|
constructor() {
|
|
20
25
|
super(...arguments);
|
|
21
26
|
this.limit = 4;
|
|
22
|
-
this.showExploreCard =
|
|
27
|
+
this.showExploreCard = true;
|
|
23
28
|
this.country = "";
|
|
24
29
|
this.city = "";
|
|
25
|
-
this.
|
|
30
|
+
this.suggestionsTask = new Task(this, {
|
|
31
|
+
task: async ([locale, country, city, currency]) => {
|
|
32
|
+
return withErrorHandling(apiGet({
|
|
33
|
+
client: this.client,
|
|
34
|
+
distributorID: this.distributorID,
|
|
35
|
+
locale,
|
|
36
|
+
endpoint: "/{api_version}/landing",
|
|
37
|
+
query: { country, city, currency },
|
|
38
|
+
}));
|
|
39
|
+
},
|
|
40
|
+
args: () => [this.locale, this.country, this.city, this.currency],
|
|
41
|
+
});
|
|
26
42
|
}
|
|
27
43
|
static { this.styles = styles; }
|
|
28
44
|
getPageProperties() {
|
|
@@ -34,64 +50,124 @@ let CorasSuggestionWidget = class CorasSuggestionWidget extends BaseMixin(LitEle
|
|
|
34
50
|
city: this.city,
|
|
35
51
|
};
|
|
36
52
|
}
|
|
37
|
-
|
|
53
|
+
/** Turn a location slug ("gran-canaria") into a display name ("Gran Canaria"). */
|
|
54
|
+
humanize(slug) {
|
|
55
|
+
return slug
|
|
56
|
+
.split(/[-_]/)
|
|
57
|
+
.filter(Boolean)
|
|
58
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
59
|
+
.join(" ");
|
|
60
|
+
}
|
|
61
|
+
handleCardClick(card) {
|
|
38
62
|
this.dispatchPageUpdate({
|
|
39
63
|
page: "details",
|
|
40
|
-
id:
|
|
64
|
+
id: card.id,
|
|
65
|
+
date: formatISO(parseISO(card.date), { representation: "date" }),
|
|
41
66
|
locale: this.locale,
|
|
42
67
|
currency: this.currency,
|
|
43
68
|
});
|
|
44
69
|
}
|
|
45
|
-
handleExploreCardClick(city) {
|
|
70
|
+
handleExploreCardClick(country, city) {
|
|
46
71
|
this.dispatchPageUpdate({
|
|
47
72
|
page: "landing",
|
|
73
|
+
country,
|
|
48
74
|
city,
|
|
49
75
|
locale: this.locale,
|
|
50
76
|
currency: this.currency,
|
|
51
77
|
});
|
|
52
78
|
}
|
|
53
|
-
|
|
54
|
-
|
|
79
|
+
renderCard(card) {
|
|
80
|
+
const price = card.price[this.currency];
|
|
81
|
+
return html `
|
|
82
|
+
<coras-attraction-short-card
|
|
83
|
+
.images=${card.images}
|
|
84
|
+
?label=${false}
|
|
85
|
+
name=${card.title}
|
|
86
|
+
rating=${card.rating || 0}
|
|
87
|
+
price=${price !== undefined
|
|
88
|
+
? convertToLocaleCurrency({
|
|
89
|
+
value: price,
|
|
90
|
+
locale: this.locale,
|
|
91
|
+
currency: this.currency,
|
|
92
|
+
})
|
|
93
|
+
: ""}
|
|
94
|
+
category=${card.category.slug}
|
|
95
|
+
date=${card.date}
|
|
96
|
+
timezone=${card.timezone}
|
|
97
|
+
locale=${this.locale}
|
|
98
|
+
@click=${() => this.handleCardClick(card)}
|
|
99
|
+
></coras-attraction-short-card>
|
|
100
|
+
`;
|
|
55
101
|
}
|
|
56
|
-
renderExploreCard() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const imageUrl = getLocationImageURL({
|
|
60
|
-
baseURL: IMAGE_BASE_URL,
|
|
61
|
-
country: this.country,
|
|
62
|
-
city: this.city,
|
|
63
|
-
imageExtension: "png",
|
|
64
|
-
params: {
|
|
65
|
-
auto: "compress,format",
|
|
66
|
-
ar: "2:3",
|
|
67
|
-
fit: "crop",
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
return html `
|
|
71
|
-
<coras-explore-card
|
|
72
|
-
image=${imageUrl}
|
|
73
|
-
label=${msg(str `Explore ${locationName}`)}
|
|
74
|
-
variant=${ExploreCardVariants.FULL_SIZE_BG}
|
|
75
|
-
>
|
|
76
|
-
<coras-button
|
|
77
|
-
slot="button"
|
|
78
|
-
variant="outlined"
|
|
79
|
-
@click=${() => this.handleExploreCardClick(this.locationName)}
|
|
80
|
-
>
|
|
81
|
-
${msg("See all activities")}
|
|
82
|
-
</coras-button>
|
|
83
|
-
</coras-explore-card>
|
|
84
|
-
`;
|
|
102
|
+
renderExploreCard(country, city) {
|
|
103
|
+
if (!this.showExploreCard) {
|
|
104
|
+
return nothing;
|
|
85
105
|
}
|
|
86
|
-
|
|
106
|
+
const name = this.humanize(city || country);
|
|
107
|
+
const imageUrl = getLocationImageURL({
|
|
108
|
+
baseURL: IMAGE_BASE_URL,
|
|
109
|
+
country,
|
|
110
|
+
city,
|
|
111
|
+
imageExtension: "png",
|
|
112
|
+
params: { auto: "compress,format", ar: "2:3", fit: "crop" },
|
|
113
|
+
});
|
|
114
|
+
return html `
|
|
115
|
+
<coras-explore-card
|
|
116
|
+
image=${imageUrl}
|
|
117
|
+
label=${name ? msg(str `Explore ${name}`) : msg("Tickets & Tours")}
|
|
118
|
+
variant=${ExploreCardVariants.FULL_SIZE_BG}
|
|
119
|
+
>
|
|
120
|
+
<coras-button
|
|
121
|
+
slot="button"
|
|
122
|
+
variant="outlined"
|
|
123
|
+
@click=${() => this.handleExploreCardClick(country, city)}
|
|
124
|
+
>
|
|
125
|
+
${msg("See all activities")}
|
|
126
|
+
</coras-button>
|
|
127
|
+
</coras-explore-card>
|
|
128
|
+
`;
|
|
87
129
|
}
|
|
88
|
-
|
|
89
|
-
|
|
130
|
+
renderContent() {
|
|
131
|
+
return this.suggestionsTask.render({
|
|
132
|
+
pending: () => this.renderSkeleton(),
|
|
133
|
+
error: () => nothing,
|
|
134
|
+
complete: (result) => {
|
|
135
|
+
const section = result.data?.find((candidate) => candidate.type === "short-card");
|
|
136
|
+
const cards = (section?.items ?? []);
|
|
137
|
+
if (!cards.length) {
|
|
138
|
+
return nothing;
|
|
139
|
+
}
|
|
140
|
+
// Prefer the host-provided location; fall back to the location the feed
|
|
141
|
+
// itself is about so the explore card and title stay meaningful even
|
|
142
|
+
// when the widget is mounted without country/city params.
|
|
143
|
+
const country = this.country || String(section?.params.country ?? "");
|
|
144
|
+
const city = this.city || String(section?.params.city ?? "");
|
|
145
|
+
return html `
|
|
146
|
+
<h3>
|
|
147
|
+
${section?.title ??
|
|
148
|
+
msg(str `Book top-rated activities for ${this.humanize(city || country)}`)}
|
|
149
|
+
</h3>
|
|
150
|
+
<coras-carousel assets-url=${this.assetsURL}>
|
|
151
|
+
${cards.slice(0, this.limit).map((card) => this.renderCard(card))}
|
|
152
|
+
${this.renderExploreCard(country, city)}
|
|
153
|
+
</coras-carousel>
|
|
154
|
+
`;
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
renderSkeleton() {
|
|
90
159
|
return html `
|
|
91
|
-
<
|
|
92
|
-
|
|
160
|
+
<div class="skeleton" aria-hidden="true">
|
|
161
|
+
<div class="skeleton-title"></div>
|
|
162
|
+
<div class="skeleton-cards">
|
|
163
|
+
${Array.from({ length: this.limit }, () => html `<div class="skeleton-card"></div>`)}
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
93
166
|
`;
|
|
94
167
|
}
|
|
168
|
+
render() {
|
|
169
|
+
return this.renderContent();
|
|
170
|
+
}
|
|
95
171
|
};
|
|
96
172
|
__decorate([
|
|
97
173
|
property({ type: Number })
|