@konnectio/core 4.0.56-rc35 → 4.0.56-rc37

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 (53) hide show
  1. package/dist/{ActionField-Bruv7ZZW.js → ActionField-BhYhC0aQ.js} +43 -34
  2. package/dist/ActionField-BhYhC0aQ.js.br +0 -0
  3. package/dist/AvailabilitySkeleton-CXRs2yLp.js +286 -0
  4. package/dist/AvailabilitySkeleton-CXRs2yLp.js.br +0 -0
  5. package/dist/{AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_17762b9b_lang-Z4h6wyqj.js → AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_17762b9b_lang-BZN97s2s.js} +2687 -2676
  6. package/dist/AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_17762b9b_lang-BZN97s2s.js.br +0 -0
  7. package/dist/{CheckoutWindow-Dn3fiFuv.js → CheckoutWindow-DPJ2GFqg.js} +143 -134
  8. package/dist/CheckoutWindow-DPJ2GFqg.js.br +0 -0
  9. package/dist/{ErrorMessage-VK8egk99.js → ErrorMessage-4DJnsYbI.js} +27 -18
  10. package/dist/ErrorMessage-4DJnsYbI.js.br +0 -0
  11. package/dist/EventAvailabilityForm-rUB2CJ24.js +432 -0
  12. package/dist/EventAvailabilityForm-rUB2CJ24.js.br +0 -0
  13. package/dist/Field-Dr6RF4JV.js +50 -0
  14. package/dist/Field-Dr6RF4JV.js.br +0 -0
  15. package/dist/Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-C8tvgzaO.js +21280 -0
  16. package/dist/Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-C8tvgzaO.js.br +0 -0
  17. package/dist/TermsOfService-B94i1jM5.js +35 -0
  18. package/dist/TermsOfService-B94i1jM5.js.br +0 -0
  19. package/dist/_commonjsHelpers-UWZO_9XV.js +11796 -0
  20. package/dist/_commonjsHelpers-UWZO_9XV.js.br +0 -0
  21. package/dist/availability.js +60 -50
  22. package/dist/availability.js.br +0 -0
  23. package/dist/event.js +279 -269
  24. package/dist/event.js.br +0 -0
  25. package/dist/gift-card-validation.js +80 -70
  26. package/dist/gift-card-validation.js.br +0 -0
  27. package/dist/gift-card.js +234 -224
  28. package/dist/gift-card.js.br +0 -0
  29. package/dist/hotel.js +696 -692
  30. package/dist/hotel.js.br +0 -0
  31. package/dist/{masonry.plugin-WFnnzw7L.js → masonry.plugin-DPkIO3nk.js} +58 -49
  32. package/dist/masonry.plugin-DPkIO3nk.js.br +0 -0
  33. package/dist/navigation.js +10 -1
  34. package/dist/polyfill.js +14757 -4715
  35. package/dist/polyfill.js.br +0 -0
  36. package/dist/style.css +1 -1
  37. package/dist/style.css.br +0 -0
  38. package/package.json +15 -13
  39. package/dist/ActionField-Bruv7ZZW.js.br +0 -0
  40. package/dist/AvailabilitySkeleton-DxVPZPw3.js +0 -277
  41. package/dist/AvailabilitySkeleton-DxVPZPw3.js.br +0 -0
  42. package/dist/AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_17762b9b_lang-Z4h6wyqj.js.br +0 -0
  43. package/dist/CheckoutWindow-Dn3fiFuv.js.br +0 -0
  44. package/dist/ErrorMessage-VK8egk99.js.br +0 -0
  45. package/dist/EventAvailabilityForm-DbkL5luy.js +0 -422
  46. package/dist/EventAvailabilityForm-DbkL5luy.js.br +0 -0
  47. package/dist/Field-fZ3Q2e9-.js +0 -41
  48. package/dist/Field-fZ3Q2e9-.js.br +0 -0
  49. package/dist/Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-CJgfqs-l.js +0 -30755
  50. package/dist/Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-CJgfqs-l.js.br +0 -0
  51. package/dist/TermsOfService-2g29W45E.js +0 -26
  52. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  53. package/dist/masonry.plugin-WFnnzw7L.js.br +0 -0
@@ -1,422 +0,0 @@
1
- import { H as Ke, J as He, K as ee, L as Qe, M as Je, N as me, l as te, m as s, i as a, O as p, P as W, Q as fe, R as X, U as We, V as R, W as _, X as N, Y as Xe, d as Ye, u as Ze, p as et, o as Y, c as ge, e as Z, w as tt, g as z, a as at, j as nt, b as he, C as ot, Z as lt, n as st, q as it, _ as rt } from "./Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-CJgfqs-l.js";
2
- import { _ as ut } from "./AvailabilitySkeleton.vue_vue_type_style_index_0_scoped_17762b9b_lang-Z4h6wyqj.js";
3
- const ct = Ke("event", () => {
4
- const U = He(), { voucher: i } = ee(Qe()), { display: y } = Je(), { bearerToken: I, metaData: V } = ee(me()), j = me(), b = te(), m = s({}), x = a(() => Object.keys(m.value).length > 0), t = s(void 0), o = s(!0), r = s(p.InitialState), A = s(NaN), C = s(1), k = s(NaN), $ = s(NaN), D = s(""), P = W("konnectio_name", "", void 0, { serializer: X.string }), F = W("konnectio_phone", "", void 0, { serializer: X.string }), G = W("konnectio_email", "", void 0, { serializer: X.string }), u = s(""), f = s({}), d = s({}), B = s("");
5
- function l(e) {
6
- return e ? e.templateId !== void 0 : !1;
7
- }
8
- const ye = a(() => j.metaData.hotels.findIndex((e) => e.id === b.eventLocation) || 0), T = a(() => j.metaData.hotels[ye.value]), be = a(() => T.value.maxNumberPerBooking ? T.value.maxNumberPerBooking : 1 / 0), ke = a(() => T.value.name ? T.value.name : ""), De = a(() => T.value.subtitle ? T.value.subtitle : ""), M = a(() => b.searchDate.toISOString()), Ie = a(() => l(t.value)), q = a(() => l(t.value) ? t.value.numberOfDays : C.value), Ae = a(() => l(t.value) ? t.value.packageCount : 0), we = a(() => l(t.value) ? t.value.fromDate : ""), L = a(() => m.value.events !== void 0 ? m.value.events.find((e) => e.id === k.value) : void 0), Se = a(() => L.value ? L.value.length : void 0), ae = a(() => l(t.value) ? t.value.templateId : 0), Pe = a(() => m.value.events), Le = a(() => m.value.templates), Ee = a(() => m.value.events.length > 0), Ne = a(() => m.value.templates.length > 0), ne = a(() => L.value && L.value.eventRateType ? L.value.eventRateType : fe.None), K = a(() => {
9
- if (!l(t.value))
10
- return t.value;
11
- }), oe = a(() => {
12
- if (K.value !== void 0) {
13
- const e = K.value.find(
14
- (n) => n.time === D.value
15
- );
16
- if (e && e.price)
17
- return e.price;
18
- }
19
- return 0;
20
- }), le = a(() => {
21
- if (l(t.value))
22
- return t.value.rooms;
23
- });
24
- function H(e, n, c) {
25
- let g = 0;
26
- if (l(t.value)) {
27
- const v = t.value.rooms[c];
28
- if (v) {
29
- const E = v.addons, w = f.value[`${n}.${e}.${c}`] || 0;
30
- if (w > 0) {
31
- const S = E?.find((O) => O.id === e), h = typeof w == "boolean" ? 1 : w;
32
- g += We(S?.price, S?.quantityStrategy, q.value, v.adultPerRoom) * h;
33
- }
34
- }
35
- } else {
36
- const v = d.value[e] || 0;
37
- if (v > 0) {
38
- const E = L.value?.products?.find((w) => w.productID === e);
39
- E && (g += E.price * v);
40
- }
41
- }
42
- return g;
43
- }
44
- function Q(e, n) {
45
- let c = 0;
46
- if (l(t.value))
47
- for (const g in f.value) {
48
- const v = g.split(".");
49
- parseInt(v[0]) === e && parseInt(v[2]) === n && (c += H(parseInt(v[1]), e, n));
50
- }
51
- else
52
- for (const g in d.value)
53
- c += H(parseInt(g)) * C.value;
54
- return c;
55
- }
56
- const se = a(() => l(t.value) && t.value.totalPrice || 0), _e = a(() => {
57
- if (l(t.value))
58
- return t.value.rooms === void 0 ? NaN : t.value.rooms.flatMap((e) => e.roomGroupId).reduce(
59
- (e, n, c) => e + Q(n, c),
60
- se.value
61
- ) || 0;
62
- {
63
- let e = Q();
64
- return e += oe.value, e;
65
- }
66
- }), Ce = a(() => l(t.value) && t.value.rooms !== void 0 && t.value.rooms.flatMap((e) => e.weekendFee).reduce((e, n) => e + n, 0) || 0), Te = a(() => l(t.value) && t.value.rooms !== void 0 && t.value.rooms.flatMap((e) => e.roomUpgrade).reduce((e, n) => e + n, 0) || 0), Me = a(() => {
67
- const e = d.value;
68
- let n = 0;
69
- for (const c in e)
70
- n += Number.isNaN(e[c]) ? 0 : e[c];
71
- return n > 0;
72
- }), ie = a(() => l(t.value) ? !1 : Object.keys(d.value).length > 0), Oe = a(() => !!(P.value !== "" && G.value !== "" && F.value.length >= 5 && (!ie.value || Me.value) && (!(!l(t.value) && ne.value !== fe.FullDayEvent) || D.value !== "")));
73
- function Re(e) {
74
- return r.value === p.ReservationState && k.value === e && o.value;
75
- }
76
- const ze = a(() => !(r.value === p.InitialState && o.value)), Ve = a(() => !(r.value === p.AvailabilityState && o.value)), $e = a(() => t.value !== void 0), Fe = a(() => r.value === p.PaymentState && o.value);
77
- async function re() {
78
- try {
79
- const e = (await R.get("https://production.hotel-service.konnectio.dk/api/event/metadata", {
80
- params: {
81
- language: _()
82
- },
83
- headers: {
84
- Authorization: I.value,
85
- Accept: "application/json"
86
- }
87
- })).data;
88
- V.value = e, ue();
89
- } catch {
90
- y({
91
- message: N.t("alert.error.couldntFetchMetadata"),
92
- type: "warning"
93
- });
94
- }
95
- }
96
- async function ue() {
97
- r.value = p.AvailabilityState, o.value = !0;
98
- try {
99
- const e = (await R.get("https://production.hotel-service.konnectio.dk/api/event/get", {
100
- params: {
101
- language: _(),
102
- restaurantId: b.eventLocation,
103
- date: M.value
104
- },
105
- headers: {
106
- Authorization: I.value,
107
- Accept: "application/json"
108
- }
109
- })).data;
110
- m.value = e, o.value = !1;
111
- } catch {
112
- y({
113
- message: N.t("alert.error.couldntFetchListings"),
114
- type: "warning"
115
- });
116
- }
117
- }
118
- async function Ge(e) {
119
- r.value = p.ReservationState, o.value = !0;
120
- try {
121
- const n = (await R.get("https://production.hotel-service.konnectio.dk/api/event/get-template", {
122
- params: {
123
- language: _(),
124
- date: M.value,
125
- templateId: k.value,
126
- restaurantId: b.eventLocation,
127
- numberOfPeople: A.value
128
- },
129
- headers: {
130
- Authorization: I.value,
131
- Accept: "application/json"
132
- }
133
- })).data;
134
- n.rooms.length === 0 ? y({
135
- message: N.t("alert.error.eventNotAvailable"),
136
- type: "warning"
137
- }) : (t.value = n, e()), o.value = !1;
138
- } catch {
139
- o.value = !1, r.value = p.AvailabilityState, y({
140
- message: N.t("alert.error.couldntFetchEvent"),
141
- type: "warning"
142
- });
143
- }
144
- }
145
- async function je(e) {
146
- r.value = p.ReservationState, o.value = !0;
147
- try {
148
- const n = (await R.get("https://production.hotel-service.konnectio.dk/api/event/vacant-times", {
149
- params: {
150
- language: _(),
151
- date: M.value,
152
- numberOfPeople: A.value,
153
- eventId: k.value,
154
- tableGroupId: $.value,
155
- restaurantId: b.eventLocation
156
- },
157
- headers: {
158
- Authorization: I.value,
159
- Accept: "application/json"
160
- }
161
- })).data;
162
- t.value = n, o.value = !1, e();
163
- } catch {
164
- o.value = !1, r.value = p.AvailabilityState, y({
165
- message: N.t("alert.error.couldntFetchEvent"),
166
- type: "warning"
167
- });
168
- }
169
- }
170
- async function Ue() {
171
- try {
172
- const e = (await R.post("https://production.hotel-service.konnectio.dk/api/event/validate-discount-code", {
173
- language: _(),
174
- date: M.value,
175
- discountCode: B.value,
176
- restaurantId: b.eventLocation
177
- }, {
178
- headers: {
179
- Authorization: I.value,
180
- Accept: "application/json"
181
- }
182
- })).data;
183
- console.log(e);
184
- } catch (e) {
185
- console.log(e), y({
186
- message: N.t("alert.error.discountCodeValidation"),
187
- type: "warning"
188
- });
189
- }
190
- }
191
- async function xe(e) {
192
- r.value = p.PaymentState, o.value = !0;
193
- const n = () => {
194
- o.value = !1, r.value = p.ReservationState, y({
195
- message: N.t("booking.other.errorMessage"),
196
- type: "warning"
197
- });
198
- };
199
- let c, g, v;
200
- const E = [];
201
- if (l(t.value))
202
- le.value?.forEach((h, O) => {
203
- const ce = [];
204
- let ve = 0;
205
- for (const de in f.value) {
206
- const J = de.split("."), pe = f.value[de];
207
- parseInt(J[0]) === h.roomGroupId && parseInt(J[2]) === O && pe > 0 && (ce.push({
208
- id: ve,
209
- addonID: parseInt(J[1]),
210
- quantity: pe
211
- }), ve++);
212
- }
213
- E.push({
214
- adultPerRoom: h.adultPerRoom,
215
- count: h.count,
216
- roomGroupID: h.roomGroupId,
217
- addons: ce
218
- });
219
- }), c = {
220
- templateID: ae.value,
221
- numberOfDays: C.value,
222
- templateCounts: E
223
- };
224
- else {
225
- g = [], v = D.value;
226
- for (const h in d.value) {
227
- const O = d.value[parseInt(h)];
228
- O > 0 && g.push({
229
- id: parseInt(h),
230
- quantity: O
231
- });
232
- }
233
- }
234
- let w = "https://production.hotel-service.konnectio.dk/api/event/book-template";
235
- const S = {
236
- language: _(),
237
- restaurantId: b.eventLocation,
238
- date: Xe(M.value),
239
- name: P.value,
240
- email: G.value,
241
- phone: F.value,
242
- remark: u.value,
243
- numberOfPeople: A.value,
244
- days: q.value,
245
- discountCode: B.value,
246
- giftCardCode: i.value,
247
- checkoutUrl: window.location.origin,
248
- privacyUrl: window.location.origin
249
- };
250
- l(t.value) ? S.templateGroup = c : (S.time = v, S.eventId = k.value, S.products = g, w = "https://production.hotel-service.konnectio.dk/api/event/book-event"), await R.post(w, S, {
251
- headers: {
252
- Authorization: I.value,
253
- Accept: "application/json"
254
- }
255
- }).then((h) => {
256
- o.value = !1, U.pay({
257
- callback: e,
258
- response: h.data
259
- });
260
- }).catch(() => n());
261
- }
262
- function Be(e) {
263
- f.value = {}, d.value = {}, D.value = "", e();
264
- }
265
- function qe() {
266
- re();
267
- }
268
- return {
269
- fetchMetaData: re,
270
- metaData: V,
271
- listingData: m,
272
- tableBasePrice: oe,
273
- availabilityData: t,
274
- isLoading: o,
275
- moduleState: r,
276
- numberOfPeople: A,
277
- numberOfDays: C,
278
- eventId: k,
279
- tableGroupId: $,
280
- arrivalTime: D,
281
- addons: f,
282
- products: d,
283
- discountCode: B,
284
- name: P,
285
- phone: F,
286
- email: G,
287
- remark: u,
288
- isTemplateEvent: Ie,
289
- maxNumberOfPeople: be,
290
- title: ke,
291
- subtitle: De,
292
- date: M,
293
- numberOfTotalDays: q,
294
- numberOfRooms: Ae,
295
- fromDate: we,
296
- getEventData: L,
297
- length: Se,
298
- templateId: ae,
299
- getEvents: Pe,
300
- getTemplates: Le,
301
- hasEvents: Ee,
302
- hasTemplates: Ne,
303
- basePrice: se,
304
- totalPrice: _e,
305
- getTemplateData: le,
306
- getEventTableData: K,
307
- roomUpgrade: Te,
308
- weekendFee: Ce,
309
- hasProducts: ie,
310
- eventRateType: ne,
311
- isReservationFormFilled: Oe,
312
- isMetaDataAvailable: ze,
313
- areListingsAvailable: Ve,
314
- isAvailabilityDataAvailable: $e,
315
- isPaymentLoading: Fe,
316
- isEventListingLoading: Re,
317
- // fetchMetaData,
318
- fetchListings: ue,
319
- getTemplateAvailability: Ge,
320
- getEventAvailability: je,
321
- validateDiscountCode: Ue,
322
- localAddonPrice: H,
323
- totalAddonPrice: Q,
324
- createBooking: xe,
325
- reset: Be,
326
- initialize: qe,
327
- hasListingData: x
328
- };
329
- }), vt = {
330
- class: "konnectio-search-button",
331
- key: "search"
332
- }, dt = /* @__PURE__ */ Ye({
333
- __name: "EventAvailabilityForm",
334
- props: {
335
- link: {},
336
- redirection: { type: Boolean, default: !0 }
337
- },
338
- setup(U) {
339
- const i = U, {
340
- eventLocation: y,
341
- eventLocations: I,
342
- hasEventLocations: V,
343
- eventLocationControl: j,
344
- searchDate: b,
345
- isExpired: m
346
- } = ee(te()), { reset: x, fetchMetadata: t, updateEventAvailability: o } = te(), { fetchListings: r } = ct(), { t: A } = Ze(), C = () => new Date(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 1)).setHours(12, 0, 0, 0)), k = s(j.value), $ = s(C()), D = a({
347
- get: () => i.redirection ? k.value : y.value,
348
- set: (u) => {
349
- i.redirection ? k.value = Number(u) : y.value = Number(u);
350
- }
351
- }), P = a({
352
- get: () => i.redirection ? $.value : b.value,
353
- set: (u) => {
354
- i.redirection ? $.value = u : b.value = u;
355
- }
356
- }), F = a(() => typeof i.link != "string");
357
- function G() {
358
- if (i.redirection === !0)
359
- if (o({
360
- date: P.value,
361
- location: D.value
362
- }), F.value) {
363
- const u = _();
364
- i.link[u] ? window.location.replace(i.link[u]) : i.link.en && window.location.replace(i.link.en);
365
- } else
366
- window.location.replace(i.link);
367
- else
368
- r();
369
- }
370
- return et(() => {
371
- m.value && x(), i.redirection === !1 && t();
372
- }), (u, f) => (Y(), ge("form", {
373
- class: st([
374
- "konnectio-event-search-form",
375
- { "has-locations": z(V) },
376
- { "auto-search": !u.redirection }
377
- ]),
378
- onSubmit: it(G, ["prevent"])
379
- }, [
380
- Z(lt, {
381
- class: "konnectio-event-search-form-content",
382
- tag: "ul"
383
- }, {
384
- default: tt(() => [
385
- z(V) ? (Y(), at(nt, {
386
- modelValue: D.value,
387
- "onUpdate:modelValue": f[0] || (f[0] = (d) => D.value = d),
388
- key: "location",
389
- label: z(A)("general.location"),
390
- icon: "location-dot",
391
- "icon-type": "fas",
392
- "icon-placement": "label",
393
- "label-key": "name",
394
- "value-key": "id",
395
- options: z(I),
396
- searchable: !1
397
- }, null, 8, ["modelValue", "label", "options"])) : he("", !0),
398
- Z(ut, {
399
- modelValue: P.value,
400
- "onUpdate:modelValue": f[1] || (f[1] = (d) => P.value = d),
401
- key: "date",
402
- label: z(A)("event.selectDate"),
403
- "icon-type": "fas",
404
- "icon-placement": "label",
405
- "min-date": /* @__PURE__ */ new Date()
406
- }, null, 8, ["modelValue", "label", "min-date"]),
407
- u.redirection ? (Y(), ge("li", vt, [
408
- Z(ot, {
409
- type: "submit",
410
- label: z(A)("availability.buttonLabel")
411
- }, null, 8, ["label"])
412
- ])) : he("", !0)
413
- ]),
414
- _: 1
415
- })
416
- ], 34));
417
- }
418
- }), ft = /* @__PURE__ */ rt(dt, [["__scopeId", "data-v-0440a795"]]);
419
- export {
420
- ft as E,
421
- ct as u
422
- };
@@ -1,41 +0,0 @@
1
- import { d as l, o as a, c as t, a as n, b as i, e as s, E as o, n as d, _ as r } from "./Field.vue_vue_type_style_index_0_scoped_992f78a1_lang-CJgfqs-l.js";
2
- const p = {
3
- key: 0,
4
- class: "skeleton-field-label"
5
- }, c = { key: 1 }, h = /* @__PURE__ */ l({
6
- __name: "Field",
7
- props: {
8
- withIcon: { type: Boolean, default: !1 },
9
- noLabel: { type: Boolean, default: !1 },
10
- isTextArea: { type: Boolean, default: !1 }
11
- },
12
- setup(f) {
13
- return (e, _) => (a(), t("div", {
14
- class: d([
15
- "skeleton-field",
16
- { "is-text-area": e.isTextArea },
17
- { "no-label": e.noLabel }
18
- ])
19
- }, [
20
- e.noLabel ? (a(), t("div", c)) : (a(), t("div", p, [
21
- e.withIcon ? (a(), n(o, {
22
- key: 0,
23
- height: "15px",
24
- width: "15px"
25
- })) : i("", !0),
26
- s(o, {
27
- height: "15px",
28
- width: "30%"
29
- })
30
- ])),
31
- s(o, {
32
- height: e.isTextArea ? "82px" : "44px",
33
- width: "100%",
34
- "border-radius": "6px"
35
- }, null, 8, ["height"])
36
- ], 2));
37
- }
38
- }), u = /* @__PURE__ */ r(h, [["__scopeId", "data-v-992f78a1"]]);
39
- export {
40
- u as F
41
- };
Binary file