UNPKG

@konnectio/core

Version:

Konnectio Core Frontend Integration.

1,195 lines (1,194 loc) 49.5 kB
import { d as M, u as _, s as q, c as Y, r as Ae, a as v, b as l, g as e, w as b, q as K, e as n, i as r, f as h, n as ot, h as s, t as o, F as N, v as R, o as it, j as st, x as ue, y as rt, z as S, A as dt, S as ct, k as ut, _ as mt, l as vt, m as bt, p as gt } from "./mitt-CvmiLPAX.js"; import { G as ft } from "./style-CmiPhqCb.js"; import { a as Ee, f as oe, g as X, h as Se, B as kt, i as ae, l as yt, s as z, e as me, _ as G, I as le, j as ht, k as ve, u as Pe, m as pt, n as Dt, o as Pt, p as J, T as ce, O as Et, q as $t, r as xe, C as wt, t as Ot, v as xt } from "./SelectField.vue_vue_type_style_index_0_lang-C60Scz2U.js"; import { _ as Tt } from "./_.vue_vue_type_style_index_0_lang-CgwYyRP7.js"; import { B as Vt, _ as Ft, R as Nt, L as Re, S as Lt, M as Ct, T as Bt, C as It, V as At, a as St } from "./masonry.plugin-DF4HmGCq.js"; import { g as Rt, e as Mt, c as Ut, n as Ht, a as Te, b as Gt, m as Ve, d as Fe, f as Ne, h as Le, _ as zt } from "./AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_86730e88_lang-B2WBKN5Z.js"; import { C as qt, P as Yt, a as Ce } from "./CheckoutWindow-nL6eFQsJ.js"; import { E as jt } from "./EventAvailabilityForm-5KSyuCOP.js"; import "./Field.vue_vue_type_style_index_0_scoped_6ef33e68_lang-CRft4dYF.js"; import { f as Wt } from "./index-DNcHdiEm.js"; function Zt(t, i, a) { const E = Rt(), m = a?.locale ?? E.locale ?? Mt, f = Ut(t, i); if (isNaN(f)) throw new RangeError("Invalid time value"); const g = Object.assign({}, a, { addSuffix: a?.addSuffix, comparison: f }), [k, p] = Ht( a?.in, ...f > 0 ? [i, t] : [t, i] ), D = Gt("round"), $ = p.getTime() - k.getTime(), P = $ / Le, T = Te(p) - Te(k), w = ($ - T) / Le, x = a?.unit; let u; if (P < 1 ? u = "second" : P < 60 ? u = "minute" : P < Ve ? u = "hour" : w < Fe ? u = "day" : w < Ne ? u = "month" : u = "year", u === "second") { const y = D($ / 1e3); return m.formatDistance("xSeconds", y, g); } else if (u === "minute") { const y = D(P); return m.formatDistance("xMinutes", y, g); } else if (u === "hour") { const y = D(P / 60); return m.formatDistance("xHours", y, g); } else if (u === "day") { const y = D(w / Ve); return m.formatDistance("xDays", y, g); } else if (u === "month") { const y = D(w / Fe); return y === 12 && x !== "month" ? m.formatDistance("xYears", 1, g) : m.formatDistance("xMonths", y, g); } else { const y = D(w / Ne); return m.formatDistance("xYears", y, g); } } const Qt = { class: "konnectio-event-listing-action-button" }, Jt = /* @__PURE__ */ M({ __name: "_", props: { name: {}, description: {}, toDate: {}, listingId: {}, tableGroupId: {}, days: {}, length: {}, timeFrom: {}, timeTo: {}, maxOnlineReservationLimit: {}, minimumPersonCount: {}, maxGuests: {}, fromPrice: { default: 0 }, gallery: {}, soldOut: { type: Boolean, default: !1 }, useNumberOfProductsForPersons: { type: Boolean }, type: {}, trackingEnabled: { type: Boolean }, disableDeepLink: { type: Boolean, default: !1 }, callback: {} }, setup(t) { const { t: i } = _(), a = t, { display: E } = Ee(), { hideEventGuestAmount: m } = q(oe()), { maxNumberOfPeople: f, numberOfPeople: g, eventId: k, currentEventDate: p, tableGroupId: D } = q(X()), { getTemplateAvailability: $, getEventAvailability: P, isEventListingLoading: T } = X(), { addToCart: w } = Se(), x = Y(() => a.maxGuests || a.maxOnlineReservationLimit || f.value || 1 / 0), u = Ae(0), y = Y(() => T(a.listingId)), j = () => { if (!a.useNumberOfProductsForPersons && (u.value === 0 || isNaN(u.value))) { E({ type: "error", message: i("alert.error.selectPeople") }); return; } a.trackingEnabled && w({ id: a.listingId, name: a.name, value: a.fromPrice || 0 }), k.value = a.listingId, g.value = a.useNumberOfProductsForPersons ? NaN : u.value, $(a.callback); }, B = () => { if (!a.useNumberOfProductsForPersons && (u.value === 0 || isNaN(u.value))) { E({ type: "error", message: i("alert.error.selectPeople") }); return; } a.trackingEnabled && w({ id: a.listingId, name: a.name, value: a.fromPrice || 0 }), k.value = a.listingId, D.value = a.tableGroupId, g.value = a.useNumberOfProductsForPersons ? NaN : u.value, P(a.callback); }; return (C, U) => (l(), v(Vt, { type: "event", "listing-id": t.listingId, gallery: t.gallery, name: t.name, description: t.description, "prices-from": t.fromPrice, "to-date": t.toDate, layout: e(kt).Event, "disable-deep-link": t.disableDeepLink }, { description: b(() => [ K(C.$slots, "description", { maxNumberOfPeople: e(f) }, void 0, !0) ]), action: b(() => [ K(C.$slots, "action", {}, () => [ n("div", { class: ot([ "konnectio-event-listing-action", { "no-selectable-people": t.useNumberOfProductsForPersons } ]) }, [ t.useNumberOfProductsForPersons ? r("", !0) : (l(), v(ae, { key: 0, modelValue: u.value, "onUpdate:modelValue": U[0] || (U[0] = (Q) => u.value = Q), label: e(i)("event.numberOfGuests"), icon: "users", "icon-type": "fas", "icon-placement": "label", description: x.value <= 20 && !e(m) ? `${e(i)("general.availableFor")}: 1 - ${x.value} ${e(yt)(e(i)("general.guests"))}` : void 0, "min-value": 0, "max-value": x.value }, null, 8, ["modelValue", "label", "description", "max-value"])), n("div", Qt, [ h(me, { label: t.soldOut ? e(i)("event.soldOut") : e(i)("event.bookNowButton"), disabled: t.soldOut, "is-loading": y.value, "full-width": "", "sub-label": e(z)(e(p)), onClickEvent: U[1] || (U[1] = (Q) => t.type === "event" ? B() : j()) }, null, 8, ["label", "disabled", "is-loading", "sub-label"]) ]) ], 2) ], !0) ]), _: 3 }, 8, ["listing-id", "gallery", "name", "description", "prices-from", "to-date", "layout", "disable-deep-link"])); } }), Me = /* @__PURE__ */ G(Jt, [["__scopeId", "data-v-23ac9949"]]), Kt = { class: "konnectio-event-listing-information-new" }; const Xt = { key: 1, class: "konnectio-pill-button" }, _t = { key: 2, class: "konnectio-pill-button" }, en = { key: 0 }, tn = { key: 1 }, nn = /* @__PURE__ */ M({ __name: "Event", props: { name: {}, description: {}, fromDate: {}, toDate: {}, length: {}, timeFrom: {}, timeTo: {}, gallery: {}, days: {}, listingId: {}, tableGroupId: {}, maxOnlineReservationLimit: {}, minimumPersonCount: {}, fromPrice: { default: 0 }, soldOut: { type: Boolean }, useNumberOfProductsForPersons: { type: Boolean }, trackingEnabled: { type: Boolean }, callback: {} }, setup(t) { const i = t, { t: a } = _(), { hideEventLength: E, hideEventEndTime: m } = q(oe()), f = Y(() => { if (!i.length) return; const g = i.length.split(":"); return Zt( new Date(2e3, 0, 1, Number(g[0]), Number(g[1]), 0), new Date(2e3, 0, 1, 0, 0, 0) ); }); return (g, k) => (l(), v(Me, { "listing-id": t.listingId, name: t.name, description: t.description, gallery: t.gallery, "prices-from": t.fromPrice, "table-group-id": t.tableGroupId, "max-guests": t.maxOnlineReservationLimit, "use-number-of-products-for-persons": t.useNumberOfProductsForPersons, "to-date": t.toDate, "sold-out": t.soldOut, type: "event", "tracking-enabled": t.trackingEnabled, callback: t.callback }, { description: b(() => [ t.description ? (l(), v(Ft, { key: 0, text: t.description }, null, 8, ["text"])) : r("", !0), n("ul", Kt, [ r("", !0), !e(E) && f.value ? (l(), s("li", Xt, [ n("div", null, [ h(le, { icon: "calendar-clock", color: "header" }), n("span", null, o(e(a)("event.lengthOfEvent")), 1) ]), n("span", null, o(f.value), 1) ])) : r("", !0), t.timeFrom ? (l(), s("li", _t, [ n("div", null, [ h(le, { icon: "calendar-clock", color: "header" }), n("span", null, o(e(a)("event.startAndEndTime")), 1) ]), e(m) ? (l(), s("span", tn, o(e(ve)(t.timeFrom)), 1)) : (l(), s("span", en, o(e(ht)(t.timeFrom, t.timeTo)), 1)) ])) : r("", !0) ]) ]), action: b(() => [ K(g.$slots, "action", {}, void 0, !0) ]), _: 3 }, 8, ["listing-id", "name", "description", "gallery", "prices-from", "table-group-id", "max-guests", "use-number-of-products-for-persons", "to-date", "sold-out", "tracking-enabled", "callback"])); } }), be = /* @__PURE__ */ G(nn, [["__scopeId", "data-v-40cbbf2c"]]), an = { key: 0, class: "konnectio-event-grouped-listings-container" }, ln = { class: "konnectio-event-grouped-listings" }, on = /* @__PURE__ */ M({ __name: "Event", props: { name: {}, events: {}, trackingEnabled: { type: Boolean }, callback: { type: Function } }, setup(t) { return (i, a) => t.events && t.events.length > 1 ? (l(), s("div", an, [ r("", !0), n("ul", ln, [ (l(!0), s(N, null, R(t.events, ({ id: E, days: m, name: f, timeFrom: g, timeTo: k, tableGroupId: p, description: D, soldOut: $, length: P, images: T, maxOnlineReservationLimit: w, maxPaxPerReservation: x, useNumberOfProductsForPersons: u, maxTicketsLimit: y }) => (l(), v(be, { key: E, type: "event", "listing-id": E, "table-group-id": p, description: D, name: f, length: P, gallery: T, days: m, "max-online-reservation-limit": x || w || y || void 0, "time-from": g, "time-to": k, "sold-out": $, "use-number-of-products-for-persons": u, "tracking-enabled": t.trackingEnabled, callback: t.callback }, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"]))), 128)) ]) ])) : t.events ? (l(), v(be, { key: t.events[0].id, type: "event", "listing-id": t.events[0].id, "table-group-id": t.events[0].tableGroupId, description: t.events[0].description, name: t.events[0].name, length: t.events[0].length, gallery: t.events[0].images, days: t.events[0].days, "from-date": t.events[0].fromDate, "to-date": t.events[0].toDate, "max-online-reservation-limit": t.events[0].maxPaxPerReservation || t.events[0].maxOnlineReservationLimit || t.events[0].maxTicketsLimit || void 0, "time-from": t.events[0].timeFrom, "time-to": t.events[0].timeTo, "sold-out": t.events[0].soldOut, "use-number-of-products-for-persons": t.events[0].useNumberOfProductsForPersons, "tracking-enabled": t.trackingEnabled, callback: t.callback }, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "from-date", "to-date", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"])) : r("", !0); } }), sn = /* @__PURE__ */ G(on, [["__scopeId", "data-v-374ad034"]]), rn = { class: "konnectio-special-offer-availability" }, dn = { class: "konnectio-special-offer-availability-button" }, cn = { class: "konnectio-warning-notice" }, un = { key: 0 }, mn = { key: 1 }, vn = /* @__PURE__ */ M({ __name: "NextEvent", props: { name: {}, description: {}, fromDate: {}, toDate: {}, length: {}, timeFrom: {}, timeTo: {}, gallery: {}, days: {}, listingId: {}, tableGroupId: {}, maxOnlineReservationLimit: {}, minimumPersonCount: {}, soldOut: { type: Boolean }, useNumberOfProductsForPersons: { type: Boolean }, trackingEnabled: { type: Boolean }, callback: { type: Function } }, setup(t) { const { t: i } = _(), { updateEventDate: a } = Pe(), { display: E } = Ee(), m = Ae(), f = t; function g() { m.value ? a(m.value) : E({ message: i("alert.error.selectDate"), type: "error" }); } const k = Y(() => pt(f.fromDate, f.toDate) <= 1), p = Y(() => [0, 1, 2, 3, 4, 5, 6].filter((D) => !Dt(f.days).includes(D))); return it(() => { k.value && (m.value = new Date(f.fromDate)); }), (D, $) => (l(), v(be, { name: t.name, description: t.description, "from-date": t.fromDate, "to-date": t.toDate, length: t.length, "time-from": t.timeFrom, "time-to": t.timeTo, gallery: t.gallery, days: t.days, "listing-id": t.listingId, "table-group-id": t.tableGroupId, "max-online-reservation-limit": t.maxOnlineReservationLimit, "minimum-person-count": t.minimumPersonCount, "use-number-of-products-for-persons": t.useNumberOfProductsForPersons, "tracking-enabled": t.trackingEnabled, "sold-out": t.soldOut, callback: t.callback, "disable-deep-link": !0 }, { action: b(() => [ n("div", null, [ n("div", rn, [ h(zt, { modelValue: m.value, "onUpdate:modelValue": $[0] || ($[0] = (P) => m.value = P), label: `${e(i)("event.selectDate")}*`, placeholder: e(i)("event.selectDate"), "icon-type": "fas", "icon-placement": "label", readonly: k.value, "start-date": t.fromDate !== "0001-01-01T00:00:00Z" ? new Date(t.fromDate) : new Date(t.toDate), "min-date": t.fromDate !== "0001-01-01T00:00:00Z" ? new Date(t.fromDate) : new Date(t.toDate), "max-date": new Date(t.toDate), "disabled-week-days": p.value }, null, 8, ["modelValue", "label", "placeholder", "readonly", "start-date", "min-date", "max-date", "disabled-week-days"]), n("div", dn, [ h(me, { label: e(i)("availability.buttonLabel"), onClick: st(g, ["prevent"]) }, null, 8, ["label"]) ]) ]), n("div", cn, [ k.value ? (l(), s("span", un, [ ue("*" + o(e(i)("event.canBeBooked")) + " ", 1), n("u", null, o(e(z)(t.fromDate)), 1) ])) : (l(), s("span", mn, [ ue("*" + o(e(i)("event.canBeBooked")) + " ", 1), n("u", null, o(e(Pt)(t.days)), 1) ])) ]) ]) ]), _: 1 }, 8, ["name", "description", "from-date", "to-date", "length", "time-from", "time-to", "gallery", "days", "listing-id", "table-group-id", "max-online-reservation-limit", "minimum-person-count", "use-number-of-products-for-persons", "tracking-enabled", "sold-out", "callback"])); } }), Be = /* @__PURE__ */ G(vn, [["__scopeId", "data-v-f6aed3b0"]]), bn = { key: 0, class: "konnectio-event-grouped-listings-container" }, gn = { class: "konnectio-event-grouped-listings" }, fn = /* @__PURE__ */ M({ __name: "NextEvent", props: { name: {}, events: {}, trackingEnabled: { type: Boolean }, callback: { type: Function } }, setup(t) { return (i, a) => t.events && t.events.length > 1 ? (l(), s("div", bn, [ r("", !0), n("ul", gn, [ (l(!0), s(N, null, R(t.events, ({ id: E, days: m, name: f, timeFrom: g, timeTo: k, fromDate: p, toDate: D, tableGroupId: $, description: P, soldOut: T, length: w, images: x, maxOnlineReservationLimit: u, maxPaxPerReservation: y, useNumberOfProductsForPersons: j, maxTicketsLimit: B }) => (l(), v(Be, { key: E, type: "event", "listing-id": E, "table-group-id": $, description: P, name: f, length: w, gallery: x, days: m, "from-date": p, "to-date": D, "max-online-reservation-limit": y || u || B || void 0, "time-from": g, "time-to": k, "sold-out": T, "use-number-of-products-for-persons": j, "tracking-enabled": t.trackingEnabled, callback: t.callback }, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "from-date", "to-date", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"]))), 128)) ]) ])) : t.events ? (l(), v(Be, { key: t.events[0].id, type: "event", "listing-id": t.events[0].id, "table-group-id": t.events[0].tableGroupId, description: t.events[0].description, name: t.events[0].name, length: t.events[0].length, gallery: t.events[0].images, days: t.events[0].days, "from-date": t.events[0].fromDate, "to-date": t.events[0].toDate, "max-online-reservation-limit": t.events[0].maxPaxPerReservation || t.events[0].maxOnlineReservationLimit || t.events[0].maxTicketsLimit || void 0, "time-from": t.events[0].timeFrom, "time-to": t.events[0].timeTo, "sold-out": t.events[0].soldOut, "use-number-of-products-for-persons": t.events[0].useNumberOfProductsForPersons, "tracking-enabled": t.trackingEnabled, callback: t.callback }, null, 8, ["listing-id", "table-group-id", "description", "name", "length", "gallery", "days", "from-date", "to-date", "max-online-reservation-limit", "time-from", "time-to", "sold-out", "use-number-of-products-for-persons", "tracking-enabled", "callback"])) : r("", !0); } }), kn = /* @__PURE__ */ G(fn, [["__scopeId", "data-v-39263761"]]), yn = ["innerHTML"], hn = /* @__PURE__ */ M({ __name: "FallbackEvent", props: { name: {}, description: {}, fromDate: {}, gallery: {}, days: {}, listingId: {}, trackingEnabled: { type: Boolean }, callback: { type: Function } }, setup(t) { const { t: i } = _(); return (a, E) => (l(), v(be, { name: t.name, description: t.description, "from-date": t.fromDate, gallery: t.gallery, days: t.days, "listing-id": t.listingId, "tracking-enabled": t.trackingEnabled, callback: t.callback, "disable-deep-link": !0 }, { action: b(() => [ n("div", { class: "konnectio-filter-notice konnectio-top-message", innerHTML: e(i)("event.notAvailable", { name: `<b>${t.name}</b>` }) }, null, 8, yn) ]), _: 1 }, 8, ["name", "description", "from-date", "gallery", "days", "listing-id", "tracking-enabled", "callback"])); } }), pn = /* @__PURE__ */ G(hn, [["__scopeId", "data-v-0167deff"]]), Dn = /* @__PURE__ */ M({ __name: "Template", props: { name: {}, description: {}, fromDate: {}, toDate: {}, listingId: {}, tableGroupId: {}, maxOnlineReservationLimit: {}, minimumPersonCount: {}, fromPrice: { default: 0 }, images: {}, trackingEnabled: { type: Boolean }, callback: {} }, setup(t) { return (i, a) => (l(), v(Me, { "listing-id": t.listingId, gallery: t.images, name: t.name, description: t.description, "prices-from": t.fromPrice, "to-date": t.toDate, type: "template", "tracking-enabled": t.trackingEnabled, callback: t.callback }, null, 8, ["listing-id", "gallery", "name", "description", "prices-from", "to-date", "tracking-enabled", "callback"])); } }), Pn = { key: 0, class: "konnectio-panel konnectio-reservation-notice-mobile" }, En = ["innerHTML"], $n = { key: 0 }, wn = { key: 1 }, On = { key: 2 }, xn = { key: 0 }, Tn = { key: 4 }, Vn = { key: 5 }, Fn = { key: 6 }, Nn = { key: 0 }, Ln = { key: 0 }, Cn = { key: 1 }, Bn = { key: 0, class: "konnectio-capitalize" }, In = /* @__PURE__ */ M({ __name: "EventReservationForm", props: { showGiftCard: { type: Boolean, default: !1 }, showTermsNotice: { type: Boolean, default: !1 }, prevCallback: {} }, setup(t) { const { t: i } = _(), a = rt(), { areListingsAvailable: E, arrivalTime: m, numberOfPeople: f, numberOfRooms: g, numberOfTotalDays: k, isTemplateEvent: p, currentEventDate: D, length: $, fromDate: P, tableBasePrice: T, getTemplateData: w, basePrice: x, totalPrice: u, weekendFee: y, roomUpgrade: j, discountCode: B, totalSelectedProducts: C, discountValue: U, appliedDiscountCode: Q } = q(X()), { totalAddonPrice: ie, validateDiscountCode: ge } = X(), { currency: se, hideEventLength: fe } = q(oe()), ee = i("event.reservationNotice"); return (te, re) => (l(), v(Nt, { "discount-code": e(B), "onUpdate:discountCode": re[0] || (re[0] = (W) => S(B) ? B.value = W : null), "validate-discount-code": e(ge), "show-gift-card": t.showGiftCard, "show-terms-notice": t.showTermsNotice, "is-sidebar-loading": !e(E), "base-price": e(x), "total-price": e(u), "weekend-fee": e(y), "room-upgrade": e(j), notice: e(ee), "prev-callback": t.prevCallback }, dt({ form: b(() => [ K(te.$slots, "form", {}, void 0, !0), e(ee) ? (l(), s("div", Pn, [ n("p", { innerHTML: e(ee), class: "konnectio-wysiwyg" }, null, 8, En) ])) : r("", !0) ]), "reservation-summary": b(() => [ e(p) ? r("", !0) : (l(), s("li", $n, [ n("span", null, o(e(i)("general.date")), 1), n("b", null, o(e(z)(e(D))), 1) ])), e(f) > 0 ? (l(), s("li", wn, [ n("span", null, o(e(i)("event.numberOfGuests")), 1), n("b", null, o(e(f)), 1) ])) : r("", !0), !e(p) && e(C) > 0 ? (l(), s("li", On, [ n("span", null, o(e(i)("event.numberOfProducts")), 1), n("b", null, o(e(C)), 1) ])) : r("", !0), e(p) ? (l(), s(N, { key: 3 }, [ n("li", null, [ n("span", null, o(e(i)("booking.reservation.arrival")), 1), n("b", null, o(e(z)(e(P))), 1) ]), n("li", null, [ n("span", null, o(e(i)("booking.reservation.departure")), 1), n("b", null, o(e(z)(e(P), e(k))), 1) ]), n("li", null, [ n("span", null, o(e(i)("event.numberOfRooms")), 1), n("b", null, o(e(g)), 1) ]), e(k) > 0 ? (l(), s("li", xn, [ n("span", null, o(e(i)("event.numberOfDays")), 1), n("b", null, o(e(k)), 1) ])) : r("", !0) ], 64)) : r("", !0), !e(p) && e(m) ? (l(), s("li", Tn, [ n("span", null, o(e(i)("event.startOfEvent")), 1), n("b", null, o(e(ve)(e(m))), 1) ])) : r("", !0), !e(p) && e($) && !e(fe) ? (l(), s("li", Vn, [ n("span", null, o(e(i)("event.lengthOfEvent")), 1), n("b", null, o(e(ve)(e($))), 1) ])) : r("", !0), e(U) ? (l(), s("li", Fn, [ n("span", null, o(e(i)("general.discountCode")), 1), n("b", null, o(e(Q)), 1) ])) : r("", !0) ]), "price-summary": b(() => [ !e(p) && e(T) > 0 ? (l(), s("li", Nn, [ n("span", null, o(e(i)("booking.availability.basePrice")), 1), n("b", null, o(e(J)(e(T), e(se))), 1) ])) : r("", !0), e(w) ? (l(!0), s(N, { key: 1 }, R(e(w), ({ roomGroupId: W }, Z) => (l(), s(N, null, [ e(ie)(W, Z) > 0 ? (l(), s("li", { key: W }, [ n("span", null, o(e(i)("booking.reservation.addons")) + " - " + o(e(i)("booking.reservation.room")) + " #" + o(Z + 1), 1), n("b", null, o(e(J)(e(ie)(W, Z), e(se))), 1) ])) : r("", !0) ], 64))), 256)) : r("", !0) ]), navigation: b(() => [ K(te.$slots, "navigation", {}, void 0, !0) ]), "mobile-under-price": b(() => [ e(p) && e(k) > 0 ? (l(), s("div", Ln, [ n("span", null, o(e(z)(e(P))) + " - " + o(e(z)(e(P), e(k))), 1) ])) : (l(), s("div", Cn, [ n("span", null, o(e(z)(e(D))), 1) ])) ]), "mobile-summary": b(() => [ !e(p) && e(C) > 0 ? (l(), s("span", Bn, o(e(i)("event.numberOfProducts")) + ": " + o(e(C)), 1)) : r("", !0) ]), _: 2 }, [ e(a).sidebar ? { name: "sidebar", fn: b(() => [ K(te.$slots, "sidebar", {}, void 0, !0) ]), key: "0" } : void 0 ]), 1032, ["discount-code", "validate-discount-code", "show-gift-card", "show-terms-notice", "is-sidebar-loading", "base-price", "total-price", "weekend-fee", "room-upgrade", "notice", "prev-callback"])); } }), De = /* @__PURE__ */ G(In, [["__scopeId", "data-v-d2ff3f68"]]), An = { class: "event-skeleton" }, Sn = { class: "event-skeleton-content" }, Rn = { class: "event-skeleton-sidebar" }, Mn = /* @__PURE__ */ M({ __name: "EventSkeleton", setup(t) { return (i, a) => (l(), s("div", An, [ n("div", Sn, [ h(Re) ]), n("div", Rn, [ r("", !0), h(Lt) ]) ])); } }), Un = /* @__PURE__ */ G(Mn, [["__scopeId", "data-v-3e15c4e3"]]), Hn = { key: 0, id: "konnectio-event-listings-wrapper" }, Gn = { key: 1, class: "konnectio-hotel-availability-title" }, zn = { class: "konnectio-event-listings" }, qn = { class: "konnectio-hotel-availability-title" }, Yn = { class: "konnectio-event-listings" }, jn = ["innerHTML"], Wn = { class: "konnectio-panel" }, Zn = { key: 0, id: "konnectio-event-addons" }, Qn = { class: "konnectio-table with-lines" }, Jn = { class: "konnectio-event-addons-price" }, Kn = { class: "konnectio-event-addons-input" }, Xn = { class: "konnectio-event-addons-price" }, _n = { class: "konnectio-event-addons-price" }, ea = { key: 1, class: "konnectio-table with-lines without-header" }, ta = { class: "konnectio-table-addons-information" }, na = { key: 0 }, aa = { class: "konnectio-table-addons-option" }, la = { class: "konnectio-panel" }, oa = /* @__PURE__ */ M({ name: "EventLayout", __name: "Event", props: { accessToken: {}, onlyShow: { default: "everything" }, selectedLocation: {}, resetDate: { default: "no" }, hideLocations: { default: "no" }, hideRemarks: { default: "no" }, hideAllergies: { default: "no" }, showFlagOnTable: { default: "no" }, showHighChairs: {}, sortOrder: { default: "asc" }, styling: {} }, setup(t) { const i = t, { t: a } = _(), E = X(), { addons: m, products: f, numberOfDays: g, flagOnTable: k, numberOfHighChairs: p, name: D, phone: $, email: P, remark: T, allergies: w, arrivalTime: x, hasEvents: u, hasTemplates: y, getTemplates: j, getEventData: B, getTemplateData: C, getEventTableData: U, hasProducts: Q, eventRateType: ie, areListingsAvailable: ge, isAvailabilityDataAvailable: se, hasListingData: fe, isPaymentLoading: ee, isReservationFormFilled: te, requiresArrivalTime: re, hasSelectedRequiredProducts: W, getUnavailableEvents: Z, hasFallbackEvents: $e, getFallbackEvents: Ue } = q(E), we = Y(() => E.getSortedEvents(i.sortOrder)), { currency: de, enableTracking: ne } = q(oe()), { setActiveIdFilter: He } = oe(), { eventDate: Ge, eventLocation: ze } = q(Pe()), { isValidRestaurantId: qe } = Pe(), { initialize: Ye, fetchListings: je, createBooking: We, localAddonPrice: Ze, totalAddonPrice: Qe, reset: Je, goBack: Oe } = X(), { beginEventCheckout: Ke } = Se(), { display: ke } = Ee(), Xe = Y(() => [ { id: "availability", label: a("booking.availability.title"), icon: "search" }, { id: "addons", label: a("general.addons"), icon: "shopping-cart", hidden: !1 }, { id: "reservation", label: a("booking.reservation.title"), icon: "concierge-bell" }, { id: "payment", hidden: !0 }, { id: "confirmation", label: a("booking.confirmation.title"), icon: "calendar-check" } ]), _e = Y(() => { const L = []; return U.value && U.value.forEach((c) => { L.find((V) => V.value === c.time) || L.push({ label: ve(c.time), value: c.time }); }), L; }); function et() { Je(i.resetDate === "yes"); } function tt(L) { ne.value && Ke(), We(L); } function nt() { const L = Ot("history", { removeNullishValues: !0 }), c = parseInt(L.rid), V = L.d, O = parseInt(L.eid); if (V) if (xt(V)) { const d = new Date(V), I = d.setHours(12, 0, 0, 0), H = (/* @__PURE__ */ new Date()).setHours(12, 0, 0, 0); I >= H ? Ge.value = d : (ke({ message: a("alert.error.invalidDateRange"), type: "error" }), L.d = void 0); } else ke({ message: a("alert.error.wrongDateFormat"), type: "error" }); isNaN(c) || (qe(c) ? ze.value = c : (L.rid = void 0, ke({ message: a("alert.error.hotelIdNotFound"), type: "error" }))), isNaN(O) || He(O), je(); } return (L, c) => (l(), v(wt, { styling: t.styling }, { default: b(() => [ (l(), v(ct, { onResolve: nt }, { default: b(() => [ h(Tt, { id: "konnectio-event-module", "access-token": t.accessToken, callback: e(Ye) }, { default: b(() => [ h(Ct, { steps: Xe.value, onReset: et }, { availability: b(({ next: V }) => [ h(De, null, { sidebar: b(() => [ h(jt, { redirection: !1, "selected-location": Number(t.selectedLocation), "hide-locations": t.hideLocations === "yes" }, null, 8, ["selected-location", "hide-locations"]) ]), form: b(() => [ e(fe) && e(ge) ? (l(), s("div", Hn, [ e($e) ? (l(!0), s(N, { key: 0 }, R(e(Ue), ({ id: O, name: d, description: I, images: H }) => (l(), v(pn, { key: O, type: "event", "listing-id": O, description: I, name: d, gallery: H, "tracking-enabled": e(ne), callback: V }, null, 8, ["listing-id", "description", "name", "gallery", "tracking-enabled", "callback"]))), 128)) : r("", !0), we.value.length > 0 && e(Z).length > 0 ? (l(), s("h2", Gn, [ h(le, { icon: "calendar-clock", type: "fal", color: "header" }), n("span", null, o(e(a)("event.availableNow")), 1) ])) : r("", !0), n("ul", zn, [ e(u) && t.onlyShow !== "templates" ? (l(!0), s(N, { key: 0 }, R(we.value, (O) => (l(), v(sn, { name: O.name, events: O.events, "tracking-enabled": e(ne), callback: V }, null, 8, ["name", "events", "tracking-enabled", "callback"]))), 256)) : r("", !0), e(y) && t.onlyShow !== "events" ? (l(!0), s(N, { key: 1 }, R(e(j), ({ id: O, name: d, fromDate: I, toDate: H, minimumPersonCount: F, fromPrice: A, description: ye, images: he }) => (l(), v(Dn, { key: O, "listing-id": O, name: d, images: he, description: ye, "from-date": I, "to-date": H, "minimum-person-count": F, fromPrice: A, "tracking-enabled": e(ne), callback: V }, null, 8, ["listing-id", "name", "images", "description", "from-date", "to-date", "minimum-person-count", "fromPrice", "tracking-enabled", "callback"]))), 128)) : r("", !0) ]), e(Z).length > 0 && t.onlyShow !== "templates" ? (l(), s(N, { key: 2 }, [ n("h2", qn, [ h(le, { icon: "calendar-circle-exclamation", type: "fal", color: "header" }), n("span", null, o(e(a)("event.availableLater")), 1) ]), n("ul", Yn, [ (l(!0), s(N, null, R(e(Z), (O) => (l(), v(kn, { name: O.name, events: O.events, "tracking-enabled": e(ne), callback: V }, null, 8, ["name", "events", "tracking-enabled", "callback"]))), 256)) ]) ], 64)) : r("", !0), (!e(u) && !e(y) || !e(u) && t.onlyShow === "events" || !e(y) && t.onlyShow === "templates") && !e($e) ? (l(), s("div", { key: 3, class: "konnectio-panel", innerHTML: e(a)("event.nothingAvailable") }, null, 8, jn)) : r("", !0) ])) : (l(), v(Re, { key: 1 })) ]), _: 2 }, 1024) ]), addons: b(({ next: V, prev: O }) => [ e(se) ? (l(), v(De, { key: 0, "prev-callback": () => e(Oe)(O) }, { form: b(() => [ n("form", Wn, [ n("h2", null, [ n("span", null, o(e(a)("event.selectProducts")), 1) ]), e(C) && e(C).length > 0 ? (l(), s("ul", Zn, [ (l(!0), s(N, null, R(e(C), ({ roomGroupId: d, addons: I, adultPerRoom: H }, F) => (l(), s("li", { key: d }, [ n("h5", null, [ n("span", null, o(e(a)("booking.reservation.room")) + " #" + o(F + 1), 1), c[9] || (c[9] = ue(" (", -1)), h(le, { icon: "male", type: "fas", color: "header" }), ue(" " + o(H) + ") ", 1) ]), n("table", Qn, [ n("thead", null, [ n("tr", null, [ n("th", null, [ n("span", null, o(e(a)("booking.reservation.addons")), 1) ]), c[10] || (c[10] = n("th", { class: "konnectio-event-addons-input" }, null, -1)), n("th", Jn, [ n("span", null, o(e(a)("booking.availability.price")), 1) ]) ]) ]), n("tbody", null, [ (l(!0), s(N, null, R(I, ({ id: A, cardinality: ye, name: he, price: at, quantityStrategy: lt }) => (l(), s("tr", { key: A }, [ n("td", null, [ n("b", null, o(he), 1), c[11] || (c[11] = n("br", null, null, -1)), n("span", null, o(e(J)(at, e(de))) + " " + o(e($t)(lt)), 1) ]), n("td", Kn, [ ye === 3 ? (l(), v(ae, { key: 0, modelValue: e(m)[`${d}.${A}.${F}`], "onUpdate:modelValue": (pe) => e(m)[`${d}.${A}.${F}`] = pe, small: !0, "min-value": 0 }, null, 8, ["modelValue", "onUpdate:modelValue"])) : (l(), v(Ce, { key: 1, modelValue: e(m)[`${d}.${A}.${F}`], "onUpdate:modelValue": (pe) => e(m)[`${d}.${A}.${F}`] = pe, numeric: !0 }, null, 8, ["modelValue", "onUpdate:modelValue"])) ]), n("td", Xn, [ n("span", null, o(e(J)(e(Ze)(A, d, F), e(de))), 1) ]) ]))), 128)) ]), n("tfoot", null, [ n("tr", null, [ c[12] || (c[12] = n("td", null, null, -1)), c[13] || (c[13] = n("td", null, null, -1)), n("td", _n, [ n("u", null, [ n("span", null, o(e(J)(e(Qe)(d, F), e(de))), 1) ]) ]) ]) ]) ]) ]))), 128)) ])) : r("", !0), e(Q) ? (l(), s("table", ea, [ n("tbody", null, [ (l(!0), s(N, null, R(e(B).products, ({ id: d, name: I, price: H, description: F }) => (l(), s("tr", { key: d }, [ n("td", ta, [ n("b", null, [ n("span", null, o(e(xe)(I)), 1) ]), F && F !== I ? (l(), s("span", na, o(e(xe)(F)), 1)) : r("", !0), n("u", null, o(e(J)(H, e(de))), 1) ]), n("td", aa, [ h(ae, { modelValue: e(f)[d], "onUpdate:modelValue": (A) => e(f)[d] = A, small: !0, "min-value": 0 }, null, 8, ["modelValue", "onUpdate:modelValue"]) ]) ]))), 128)) ]) ])) : r("", !0) ]) ]), navigation: b(() => [ h(me, { label: e(a)("event.startReservation"), disabled: !e(W), "full-width": "", onClickEvent: V }, null, 8, ["label", "disabled", "onClickEvent"]) ]), _: 2 }, 1032, ["prev-callback"])) : r("", !0) ]), reservation: b(({ next: V, prev: O }) => [ h(De, { "show-terms-notice": !0, "show-gift-card": !0, "prev-callback": () => e(Oe)(O) }, { form: b(() => [ n("form", la, [ n("h2", null, [ n("span", null, o(e(a)("booking.reservation.detailsTitle")), 1) ]), h(ce, { modelValue: e(D), "onUpdate:modelValue": c[0] || (c[0] = (d) => S(D) ? D.value = d : null), type: "text", label: e(a)("booking.reservation.name"), icon: "user-alt", placeholder: e(a)("booking.reservation.namePlaceholder"), required: "" }, null, 8, ["modelValue", "label", "placeholder"]), h(ce, { modelValue: e(P), "onUpdate:modelValue": c[1] || (c[1] = (d) => S(P) ? P.value = d : null), label: e(a)("booking.reservation.email"), type: "email", name: "email", autocomplete: "email", icon: "at", placeholder: e(a)("booking.reservation.emailPlaceholder"), required: "" }, null, 8, ["modelValue", "label", "placeholder"]), h(Yt, { modelValue: e($), "onUpdate:modelValue": c[2] || (c[2] = (d) => S($) ? $.value = d : null), label: e(a)("booking.reservation.phone"), icon: "phone-office", placeholder: e(a)("booking.reservation.phonePlaceholder"), required: "" }, null, 8, ["modelValue", "label", "placeholder"]), e(re) ? (l(), v(It, { key: 0, modelValue: e(x), "onUpdate:modelValue": c[3] || (c[3] = (d) => S(x) ? x.value = d : null), label: e(a)("event.selectArrivalTime"), name: "eventTimeTable", checkboxes: _e.value, required: "" }, null, 8, ["modelValue", "label", "checkboxes"])) : r("", !0), e(ie) === e(Et).FullDayEvent ? (l(), v(ae, { key: 1, modelValue: e(g), "onUpdate:modelValue": c[4] || (c[4] = (d) => S(g) ? g.value = d : null), label: e(a)("event.numberOfDays"), "min-value": 1, required: "" }, null, 8, ["modelValue", "label"])) : r("", !0), t.showHighChairs === "yes" ? (l(), v(ae, { key: 2, modelValue: e(p), "onUpdate:modelValue": c[5] || (c[5] = (d) => S(p) ? p.value = d : null), label: e(a)("event.numberOfHighChairs"), icon: "baby", "no-optional-label": !1 }, null, 8, ["modelValue", "label"])) : r("", !0), t.showFlagOnTable === "yes" ? (l(), v(Ce, { key: 3, modelValue: e(k), "onUpdate:modelValue": c[6] || (c[6] = (d) => S(k) ? k.value = d : null), label: e(a)("event.flagOnTable") }, null, 8, ["modelValue", "label"])) : r("", !0), t.hideRemarks !== "yes" ? (l(), v(ce, { key: 4, modelValue: e(T), "onUpdate:modelValue": c[7] || (c[7] = (d) => S(T) ? T.value = d : null), type: "textarea", label: e(a)("booking.reservation.remark"), icon: "info-circle", placeholder: e(a)("booking.reservation.remarkPlaceholder") }, null, 8, ["modelValue", "label", "placeholder"])) : r("", !0), t.hideAllergies !== "yes" && e(B)?.showAllergyFoodFieldOnline ? (l(), v(ce, { key: 5, modelValue: e(w), "onUpdate:modelValue": c[8] || (c[8] = (d) => S(w) ? w.value = d : null), type: "textarea", label: e(a)("booking.reservation.allergies"), icon: "allergies", placeholder: e(a)("booking.reservation.allergiesPlaceholder") }, null, 8, ["modelValue", "label", "placeholder"])) : r("", !0) ]) ]), navigation: b(() => [ h(me, { label: e(a)("general.confirmReservation"), "is-loading": e(ee), disabled: !e(te), "full-width": "", onClickEvent: (d) => tt(V) }, null, 8, ["label", "is-loading", "disabled", "onClickEvent"]) ]), _: 2 }, 1032, ["prev-callback"]) ]), payment: b(() => [ h(qt) ]), confirmation: b(() => [ h(Bt, { message: e(a)("event.confirmationMessage") }, null, 8, ["message"]) ]), _: 1 }, 8, ["steps"]) ]), _: 1 }, 8, ["access-token", "callback"]) ]), fallback: b(() => [ h(Un) ]), _: 1 })) ]), _: 1 }, 8, ["styling"])); } }), Ie = /* @__PURE__ */ G(oa, [["__scopeId", "data-v-f58c56d6"]]), ia = ut(), sa = mt, ra = sa(); class da extends HTMLElement { vueApp; constructor() { super(); } disconnectedCallback() { this.vueApp.unmount(); } connectedCallback() { const i = vt(Ie, this.attributes); this.vueApp = bt(Ie, i), this.vueApp.provide("emitter", ra), this.vueApp.use(Wt), this.vueApp.use(gt), this.vueApp.use(ia), this.vueApp.use(At), this.vueApp.use(ft), this.vueApp.use(St); const a = document.createElement("div"); this.vueApp.mount(a), this.appendChild(a.children[0]); } } window.customElements.define("konnectio-event", da); export { da as default }; //# sourceMappingURL=event.js.map