@konnectio/core 4.0.56-rc22 → 4.0.56-rc24

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 (44) hide show
  1. package/dist/{ActionField-ZJdtBRXa.js → ActionField-h6vpGaYw.js} +10 -10
  2. package/dist/ActionField-h6vpGaYw.js.br +0 -0
  3. package/dist/{DateField.vue_vue_type_style_index_0_lang-KjvE2y5e.js → AvailabilitySkeleton-HUUimpaX.js} +2461 -2405
  4. package/dist/AvailabilitySkeleton-HUUimpaX.js.br +0 -0
  5. package/dist/CheckoutWindow-Dmg9JyZJ.js +710 -0
  6. package/dist/CheckoutWindow-Dmg9JyZJ.js.br +0 -0
  7. package/dist/{ErrorMessage-mUpn7ZBU.js → ErrorMessage-iVDG0uzJ.js} +1 -1
  8. package/dist/ErrorMessage-iVDG0uzJ.js.br +0 -0
  9. package/dist/EventAvailabilityForm-UmnEHYcV.js +325 -0
  10. package/dist/EventAvailabilityForm-UmnEHYcV.js.br +0 -0
  11. package/dist/{_-KavQ60qi.js → Field-wvMopAED.js} +13143 -12490
  12. package/dist/Field-wvMopAED.js.br +0 -0
  13. package/dist/HotelAvailabilityForm-GWIoGscc.js +164 -0
  14. package/dist/HotelAvailabilityForm-GWIoGscc.js.br +0 -0
  15. package/dist/availability.js +27 -26
  16. package/dist/availability.js.br +0 -0
  17. package/dist/event.js +578 -304
  18. package/dist/event.js.br +0 -0
  19. package/dist/gift-card-validation.js +46 -47
  20. package/dist/gift-card-validation.js.br +0 -0
  21. package/dist/gift-card.js +304 -291
  22. package/dist/gift-card.js.br +0 -0
  23. package/dist/hotel.js +1081 -2224
  24. package/dist/hotel.js.br +0 -0
  25. package/dist/{ThankYou-EiAxaHd8.js → masonry.plugin-UcfbgWN-.js} +4922 -4231
  26. package/dist/masonry.plugin-UcfbgWN-.js.br +0 -0
  27. package/dist/polyfill.js +3014 -2962
  28. package/dist/polyfill.js.br +0 -0
  29. package/dist/style.css +1 -1
  30. package/dist/style.css.br +0 -0
  31. package/package.json +9 -9
  32. package/dist/ActionField-ZJdtBRXa.js.br +0 -4
  33. package/dist/AvailabilitySkeleton-tfEBupNq.js +0 -234
  34. package/dist/AvailabilitySkeleton-tfEBupNq.js.br +0 -0
  35. package/dist/CheckoutWindow-orJD6dJy.js +0 -205
  36. package/dist/CheckoutWindow-orJD6dJy.js.br +0 -0
  37. package/dist/DateField.vue_vue_type_style_index_0_lang-KjvE2y5e.js.br +0 -0
  38. package/dist/ErrorMessage-mUpn7ZBU.js.br +0 -0
  39. package/dist/EventAvailabilityForm-cAOEZVnn.js +0 -366
  40. package/dist/EventAvailabilityForm-cAOEZVnn.js.br +0 -0
  41. package/dist/Field-Kwm-GcDa.js +0 -41
  42. package/dist/Field-Kwm-GcDa.js.br +0 -0
  43. package/dist/ThankYou-EiAxaHd8.js.br +0 -0
  44. package/dist/_-KavQ60qi.js.br +0 -0
package/dist/gift-card.js CHANGED
@@ -1,99 +1,99 @@
1
- import { V as re, W as de, B as Q, D as oe, k as C, a9 as $, $ as Z, c as _, a4 as ee, a0 as J, a3 as ue, a2 as ce, aa as pe, d as X, j as ne, Y as me, o as c, a as I, w as G, b as s, h as g, f as i, u as e, C as B, i as V, n as ie, I as fe, E as ve, g as se, G as ge, l as he, S as be, t as ae, ab as D, ac as W, F as ye, J as ke, H as T, _ as Ce, L as _e, T as j, e as Ve, q as we, s as Fe, y as Pe, z as Te, A as Se, U as $e } from "./_-KavQ60qi.js";
2
- import { a as Ee, C as Ue, P as Ae, _ as Re } from "./CheckoutWindow-orJD6dJy.js";
3
- import { F as M } from "./Field-Kwm-GcDa.js";
4
- import { E as Ie } from "./ErrorMessage-mUpn7ZBU.js";
5
- const le = re("giftCard", () => {
6
- const { pay: S } = de(), { bearerToken: m, metaData: w, currencyId: o } = Q(oe()), r = C($.InitialState), h = Z("konnectio_name", "", void 0, { serializer: J.string }), d = Z("konnectio_email", "", void 0, { serializer: J.string }), f = Z("konnectio_phone", "", void 0, { serializer: J.string }), n = C(""), v = C(1), p = C(!0), L = C(""), y = C({
1
+ import { N as ue, O as pe, s as ee, c as ae, r as w, ag as T, U as Q, e as y, Y as ie, W as X, X as me, v as fe, ah as ve, d as Y, u as le, Q as he, f as d, n as M, z, h as o, g as k, k as n, j as e, C as D, m as F, q as de, I as ge, a0 as B, $ as be, x as ce, w as ye, o as ke, S as _e, A as se, ai as W, aj as N, F as Ce, ab as Ve, l as P, _ as we, ak as Fe, T as H, p as Pe, D as Se, E as Te, G as $e, H as Ee, J as Ue, K as Ae, L as Ie, af as Ge, M as Me } from "./Field-wvMopAED.js";
2
+ import { B as Re, a as Le, C as qe, P as xe, _ as Be } from "./CheckoutWindow-Dmg9JyZJ.js";
3
+ import { E as ze } from "./ErrorMessage-iVDG0uzJ.js";
4
+ const te = ue("giftCard", () => {
5
+ const { pay: v } = pe(), { bearerToken: c, metaData: _, currencyId: t } = ee(ae()), b = ae(), u = w(T.InitialState), r = Q("konnectio_name", "", void 0, { serializer: X.string }), f = Q("konnectio_email", "", void 0, { serializer: X.string }), i = Q("konnectio_phone", "", void 0, { serializer: X.string }), h = w(""), m = w(1), q = w(!0), S = w(""), a = w({
7
6
  base64: "",
8
7
  type: "",
9
8
  name: ""
10
- }), l = C(void 0), u = C(0), b = C(!1), U = C(0), F = _(() => r.value === $.InitialState || r.value === $.WaitingForResponse), A = _(() => r.value === $.ReadyToPay), q = _(() => r.value === $.PaymentSuccess), P = _(() => {
11
- const a = {
9
+ }), p = w(void 0), V = w(0), $ = w(!1), C = w(0), E = y(() => b.metaData.hotels[0]), x = y(() => E.value.termsOfService ? E.value.termsOfService : ""), U = y(() => u.value === T.InitialState || u.value === T.WaitingForResponse), oe = y(() => u.value === T.ReadyToPay), Z = y(() => u.value === T.PaymentSuccess), R = y(() => {
10
+ const g = {
12
11
  1: {
13
- label: ee.t("giftCard.hotelType"),
12
+ label: ie.t("giftCard.hotelType"),
14
13
  data: []
15
14
  },
16
15
  2: {
17
- label: ee.t("giftCard.restaurantType"),
16
+ label: ie.t("giftCard.restaurantType"),
18
17
  data: []
19
18
  }
20
- }, t = w.value.hotels[0].places;
21
- return t && t.forEach((k) => {
22
- a[k.placeType].data.push(k);
19
+ }, L = _.value.hotels[0].places;
20
+ return L && L.forEach((I) => {
21
+ g[I.placeType].data.push(I);
23
22
  }), Object.fromEntries(
24
- Object.entries(a).filter(([, k]) => k.data.length > 0)
23
+ Object.entries(g).filter(([, I]) => I.data.length > 0)
25
24
  );
26
- }), H = _(() => U.value !== 0), E = _(() => {
27
- let a;
28
- if (H.value)
29
- a = P.value[U.value].data[0];
30
- else if (u.value !== 0) {
31
- const t = l.value, k = P.value[u.value].data;
32
- k.length === 1 ? a = k[0] : t !== void 0 && k.forEach((z) => {
33
- String(z.id) === String(t) && (a = z);
25
+ }), O = y(() => C.value !== 0), A = y(() => {
26
+ let g;
27
+ if (O.value)
28
+ g = R.value[C.value].data[0];
29
+ else if (V.value !== 0) {
30
+ const L = p.value, I = R.value[V.value].data;
31
+ I.length === 1 ? g = I[0] : L !== void 0 && I.forEach((ne) => {
32
+ String(ne.id) === String(L) && (g = ne);
34
33
  });
35
34
  }
36
- return a;
37
- }), x = _(() => !(!h.value || !d.value || !(f.value.length >= 5) || !n.value || E.value === void 0)), N = _(() => !(r.value === $.InitialState && b.value)), K = _(() => !!(r.value === $.WaitingForResponse && b.value));
38
- async function Y() {
39
- r.value = $.WaitingForResponse, b.value = !0, await ue.post("https://production.hotel-service.konnectio.dk/api/gift-card/create", {
35
+ return g;
36
+ }), J = y(() => !(!r.value || !f.value || !(i.value.length >= 5) || !h.value || A.value === void 0)), G = y(() => !(u.value === T.InitialState && $.value)), s = y(() => !!(u.value === T.WaitingForResponse && $.value));
37
+ async function l() {
38
+ u.value = T.WaitingForResponse, $.value = !0, await me.post("https://production.hotel-service.konnectio.dk/api/gift-card/create", {
40
39
  termsOfserviceURL: window.location.origin,
41
40
  checkoutUrl: window.location.origin,
42
- currencyID: o.value,
43
- language: ce(),
44
- amount: n.value,
45
- quantity: v.value,
46
- freeText: L.value,
47
- showPrice: p.value,
48
- contactName: h.value,
49
- contactEmail: d.value,
50
- contactPhone: f.value,
51
- imageBase64: pe(y.value.base64),
52
- imageName: y.value.name,
53
- imageFormat: y.value.type,
54
- placeType: E.value ? E.value.placeType : void 0,
55
- placeID: E.value ? E.value.id : void 0
41
+ currencyID: t.value,
42
+ language: fe(),
43
+ amount: h.value,
44
+ quantity: m.value,
45
+ freeText: S.value,
46
+ showPrice: q.value,
47
+ contactName: r.value,
48
+ contactEmail: f.value,
49
+ contactPhone: i.value,
50
+ imageBase64: ve(a.value.base64),
51
+ imageName: a.value.name,
52
+ imageFormat: a.value.type,
53
+ placeType: A.value ? A.value.placeType : void 0,
54
+ placeID: A.value ? A.value.id : void 0
56
55
  }, {
57
56
  headers: {
58
- Authorization: m.value,
57
+ Authorization: c.value,
59
58
  Accept: "application/json",
60
- "Fresh-Booking-Ver": "4.0.56-rc22"
59
+ "Fresh-Booking-Ver": "4.0.56-rc24"
61
60
  }
62
- }).then((a) => {
63
- r.value = $.ReadyToPay, b.value = !1, S({
61
+ }).then((g) => {
62
+ u.value = T.ReadyToPay, $.value = !1, v({
64
63
  callback: () => console.log("Callback!"),
65
- response: a.data
64
+ response: g.data
66
65
  });
67
66
  });
68
67
  }
69
- function R(a) {
70
- a && (U.value = a);
68
+ function j(g) {
69
+ g && (C.value = g);
71
70
  }
72
71
  return {
73
- selectedPlace: E,
74
- moduleState: r,
75
- name: h,
76
- email: d,
77
- phone: f,
78
- value: n,
79
- remark: L,
80
- showValue: p,
81
- quantity: v,
82
- media: y,
83
- placeId: l,
84
- placeType: u,
85
- showFormPage: F,
86
- showPaymentPage: A,
87
- showConfirmationPage: q,
88
- places: P,
89
- hasFilledForm: x,
90
- hasForcedPlaceType: H,
91
- isWaitingForResponse: K,
92
- isMetaDataAvailable: N,
93
- orderGiftCard: Y,
94
- initialize: R
72
+ selectedPlace: A,
73
+ moduleState: u,
74
+ name: r,
75
+ email: f,
76
+ phone: i,
77
+ value: h,
78
+ remark: S,
79
+ showValue: q,
80
+ quantity: m,
81
+ media: a,
82
+ placeId: p,
83
+ placeType: V,
84
+ showFormPage: U,
85
+ showPaymentPage: oe,
86
+ showConfirmationPage: Z,
87
+ places: R,
88
+ hasFilledForm: J,
89
+ hasForcedPlaceType: O,
90
+ isWaitingForResponse: s,
91
+ isMetaDataAvailable: G,
92
+ termsOfService: x,
93
+ orderGiftCard: l,
94
+ initialize: j
95
95
  };
96
- }), Le = { class: "media-selector" }, qe = ["accept"], Me = { class: "media-selector-wrapper" }, Ge = { class: "media-selector-tools" }, Be = { key: 0 }, xe = { key: 1 }, ze = { key: 2 }, De = ["src"], We = /* @__PURE__ */ X({
96
+ }), De = { class: "media-selector" }, Oe = ["accept"], je = { class: "media-selector-wrapper" }, We = { class: "media-selector-tools" }, Ne = { key: 0 }, He = { key: 1 }, Ke = { key: 2 }, Ye = ["src"], Ze = /* @__PURE__ */ Y({
97
97
  __name: "MediaSelector",
98
98
  props: {
99
99
  modelValue: {},
@@ -103,94 +103,94 @@ const le = re("giftCard", () => {
103
103
  required: { type: Boolean, default: !1 }
104
104
  },
105
105
  emits: ["update:modelValue"],
106
- setup(S, { emit: m }) {
107
- const w = m, o = S, { t: r } = ne(), { display: h } = me(), d = C(), f = _(() => o.modelValue.base64 !== "");
108
- function n(l) {
109
- w("update:modelValue", l);
106
+ setup(v, { emit: c }) {
107
+ const _ = c, t = v, { t: b } = le(), { display: u } = he(), r = w(), f = y(() => t.modelValue.base64 !== "");
108
+ function i(a) {
109
+ _("update:modelValue", a);
110
110
  }
111
- function v() {
112
- n({
111
+ function h() {
112
+ i({
113
113
  base64: "",
114
114
  name: "",
115
115
  type: ""
116
- }), d.value && (d.value.value = "");
116
+ }), r.value && (r.value.value = "");
117
117
  }
118
- function p() {
119
- d.value && d.value.click();
118
+ function m() {
119
+ r.value && r.value.click();
120
120
  }
121
- function L(l, u) {
122
- const [b, U] = [l.name, l.type], F = new FileReader();
123
- F.onload = function(A) {
124
- if (A.target) {
125
- const q = A.target.result;
126
- u({ base64: q, name: b, type: U });
121
+ function q(a, p) {
122
+ const [V, $] = [a.name, a.type], C = new FileReader();
123
+ C.onload = function(E) {
124
+ if (E.target) {
125
+ const x = E.target.result;
126
+ p({ base64: x, name: V, type: $ });
127
127
  } else
128
- h({
129
- message: r("imageUploadError"),
128
+ u({
129
+ message: b("imageUploadError"),
130
130
  type: "error"
131
131
  });
132
- }, F.readAsDataURL(l);
132
+ }, C.readAsDataURL(a);
133
133
  }
134
- async function y() {
135
- let l;
136
- (l = d.value.files) instanceof FileList && L(l[0], n);
134
+ async function S() {
135
+ let a;
136
+ (a = r.value.files) instanceof FileList && q(a[0], i);
137
137
  }
138
- return (l, u) => (c(), I(fe, {
139
- label: l.label,
140
- required: l.required,
138
+ return (a, p) => (d(), M(ge, {
139
+ label: a.label,
140
+ required: a.required,
141
141
  type: "media"
142
142
  }, {
143
- default: G(() => [
144
- s("div", Le, [
145
- s("input", {
143
+ default: z(() => [
144
+ o("div", De, [
145
+ o("input", {
146
146
  ref_key: "fileInput",
147
- ref: d,
147
+ ref: r,
148
148
  type: "file",
149
149
  class: "hidden",
150
- accept: l.validation,
150
+ accept: a.validation,
151
151
  single: "",
152
- onChange: u[0] || (u[0] = (b) => y())
153
- }, null, 40, qe),
154
- s("div", Me, [
155
- s("ul", Ge, [
156
- f.value ? V("", !0) : (c(), g("li", Be, [
157
- i(B, {
158
- label: e(r)("uploadFile"),
152
+ onChange: p[0] || (p[0] = (V) => S())
153
+ }, null, 40, Oe),
154
+ o("div", je, [
155
+ o("ul", We, [
156
+ f.value ? F("", !0) : (d(), k("li", Ne, [
157
+ n(D, {
158
+ label: e(b)("uploadFile"),
159
159
  type: "button",
160
160
  icon: "upload",
161
- "icon-color": l.iconColor,
162
- onClickEvent: u[1] || (u[1] = (b) => p())
161
+ "icon-color": a.iconColor,
162
+ onClickEvent: p[1] || (p[1] = (V) => m())
163
163
  }, null, 8, ["label", "icon-color"])
164
164
  ])),
165
- f.value ? (c(), g("li", xe, [
166
- i(B, {
167
- label: e(r)("replaceFile"),
165
+ f.value ? (d(), k("li", He, [
166
+ n(D, {
167
+ label: e(b)("replaceFile"),
168
168
  type: "button",
169
169
  icon: "repeat-alt",
170
- "icon-color": l.iconColor,
171
- onClickEvent: u[2] || (u[2] = (b) => p())
170
+ "icon-color": a.iconColor,
171
+ onClickEvent: p[2] || (p[2] = (V) => m())
172
172
  }, null, 8, ["label", "icon-color"])
173
- ])) : V("", !0),
174
- f.value ? (c(), g("li", ze, [
175
- i(B, {
176
- label: e(r)("removeFile"),
173
+ ])) : F("", !0),
174
+ f.value ? (d(), k("li", Ke, [
175
+ n(D, {
176
+ label: e(b)("removeFile"),
177
177
  type: "button",
178
178
  icon: "trash-alt",
179
- "icon-color": l.iconColor,
180
- onClickEvent: u[3] || (u[3] = (b) => v())
179
+ "icon-color": a.iconColor,
180
+ onClickEvent: p[3] || (p[3] = (V) => h())
181
181
  }, null, 8, ["label", "icon-color"])
182
- ])) : V("", !0)
182
+ ])) : F("", !0)
183
183
  ]),
184
- s("div", {
185
- class: ie([
184
+ o("div", {
185
+ class: de([
186
186
  "media-selector-previewer",
187
187
  { opened: f.value }
188
188
  ])
189
189
  }, [
190
- l.modelValue ? (c(), g("img", {
190
+ a.modelValue ? (d(), k("img", {
191
191
  key: 0,
192
- src: l.modelValue.base64
193
- }, null, 8, De)) : V("", !0)
192
+ src: a.modelValue.base64
193
+ }, null, 8, Ye)) : F("", !0)
194
194
  ], 2)
195
195
  ])
196
196
  ])
@@ -199,9 +199,9 @@ const le = re("giftCard", () => {
199
199
  }, 8, ["label", "required"]));
200
200
  }
201
201
  });
202
- function te(S) {
203
- const m = S;
204
- m.__i18n = m.__i18n || [], m.__i18n.push({
202
+ function re(v) {
203
+ const c = v;
204
+ c.__i18n = c.__i18n || [], c.__i18n.push({
205
205
  locale: "",
206
206
  resource: {
207
207
  da: {
@@ -219,39 +219,48 @@ function te(S) {
219
219
  }
220
220
  });
221
221
  }
222
- typeof te == "function" && te(We);
223
- const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-form" }, He = /* @__PURE__ */ X({
222
+ typeof re == "function" && re(Ze);
223
+ const Je = { class: "gift-card-skeleton" }, Qe = { class: "gift-card-skeleton-form" }, Xe = /* @__PURE__ */ Y({
224
224
  __name: "GiftCardSkeleton",
225
- setup(S) {
226
- return (m, w) => (c(), g("div", je, [
227
- s("div", Oe, [
228
- i(M),
229
- i(M),
230
- i(M),
231
- i(M),
232
- i(M, { "is-text-area": "" }),
233
- i(ve, { height: "44px" })
225
+ setup(v) {
226
+ return (c, _) => (d(), k("div", Je, [
227
+ o("div", Qe, [
228
+ n(B),
229
+ n(B),
230
+ n(B),
231
+ n(B),
232
+ n(B, { "is-text-area": "" }),
233
+ n(be, { height: "44px" })
234
234
  ])
235
235
  ]));
236
236
  }
237
- }), Ne = /* @__PURE__ */ se(He, [["__scopeId", "data-v-ba3efaa1"]]), Ke = {
237
+ }), ea = /* @__PURE__ */ ce(Xe, [["__scopeId", "data-v-ba3efaa1"]]), aa = /* @__PURE__ */ Y({
238
+ __name: "GiftCard",
239
+ setup(v) {
240
+ const { t: c } = le(), _ = te();
241
+ return (t, b) => (d(), M(Re, {
242
+ content: e(_).termsOfService,
243
+ "button-label": e(c)("giftCard.orderGiftCard")
244
+ }, null, 8, ["content", "button-label"]));
245
+ }
246
+ }), ta = (v) => ($e("data-v-30c8e35c"), v = v(), Ee(), v), la = {
238
247
  key: 0,
239
248
  id: "konnectio-gift-card-wrapper"
240
- }, Ye = { id: "konnectio-gift-card-title" }, Ze = { id: "konnectio-gift-card-content" }, Je = { id: "konnectio-gift-card-payment" }, Qe = ["innerHTML"], Xe = { key: 0 }, ea = {
249
+ }, oa = { id: "konnectio-gift-card-title" }, na = { id: "konnectio-gift-card-content" }, ia = { id: "konnectio-gift-card-payment" }, sa = ["innerHTML"], ra = { key: 0 }, da = {
241
250
  key: 0,
242
251
  id: "fresh-booking-select-place-type"
243
- }, aa = {
244
- class: /* @__PURE__ */ ie(["fresh-booking-label", "required"])
245
- }, la = { id: "fresh-booking-select-place-type-input" }, ta = ["innerHTML"], oa = {
252
+ }, ca = {
253
+ class: /* @__PURE__ */ de(["fresh-booking-label", "required"])
254
+ }, ua = { id: "fresh-booking-select-place-type-input" }, pa = ["innerHTML"], ma = {
246
255
  key: 0,
247
256
  id: "konnectio-gift-card-order"
248
- }, na = { class: "fresh-booking-panel" }, ia = {
257
+ }, fa = { class: "fresh-booking-panel" }, va = {
249
258
  key: 1,
250
259
  id: "konnectio-gift-card-remarks"
251
- }, sa = {
260
+ }, ha = {
252
261
  key: 2,
253
262
  id: "konnectio-gift-card-order-minimal"
254
- }, ra = { id: "konnectio-gift-card-recaptcha" }, da = /* @__PURE__ */ X({
263
+ }, ga = /* @__PURE__ */ ta(() => /* @__PURE__ */ o("div", { class: "konnectio-divider" }, null, -1)), ba = { id: "konnectio-gift-card-recaptcha" }, ya = /* @__PURE__ */ Y({
255
264
  name: "GiftCardLayout",
256
265
  __name: "GiftCard",
257
266
  props: {
@@ -260,205 +269,209 @@ const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-fo
260
269
  placeType: {},
261
270
  styling: {}
262
271
  },
263
- setup(S) {
264
- const m = S, w = _(() => ({
272
+ setup(v) {
273
+ const c = v, _ = y(() => ({
265
274
  panelMaxWidth: "800px",
266
- ...m.styling
267
- })), { t: o } = ne(), {
268
- name: r,
269
- email: h,
270
- phone: d,
275
+ ...c.styling
276
+ })), { t } = le(), {
277
+ name: b,
278
+ email: u,
279
+ phone: r,
271
280
  value: f,
272
- remark: n,
273
- showValue: v,
274
- quantity: p,
275
- media: L,
276
- placeId: y,
277
- placeType: l,
278
- showFormPage: u,
279
- showPaymentPage: b,
280
- showConfirmationPage: U,
281
- places: F,
282
- hasFilledForm: A,
283
- hasForcedPlaceType: q,
284
- isWaitingForResponse: P,
285
- isMetaDataAvailable: H
286
- } = Q(le()), { initialize: E, orderGiftCard: x } = le(), { isRecaptchaEnabled: N, currency: K, hasError: Y } = Q(oe());
287
- return ge(l, () => {
288
- y.value = void 0;
289
- }), he(() => {
290
- const R = m.placeType ? parseInt(m.placeType) : void 0;
291
- E(R);
292
- }), (R, a) => (c(), I(Fe, { styling: w.value }, {
293
- default: G(() => [
294
- (c(), I(be, null, {
295
- default: G(() => [
296
- i(we, {
281
+ remark: i,
282
+ showValue: h,
283
+ quantity: m,
284
+ media: q,
285
+ placeId: S,
286
+ placeType: a,
287
+ showFormPage: p,
288
+ showPaymentPage: V,
289
+ showConfirmationPage: $,
290
+ places: C,
291
+ hasFilledForm: E,
292
+ hasForcedPlaceType: x,
293
+ isWaitingForResponse: U,
294
+ isMetaDataAvailable: oe
295
+ } = ee(te()), { initialize: Z, orderGiftCard: R } = te(), { isRecaptchaEnabled: O, currency: A, hasError: J } = ee(ae());
296
+ return ye(a, () => {
297
+ S.value = void 0;
298
+ }), ke(() => {
299
+ const G = c.placeType ? parseInt(c.placeType) : void 0;
300
+ Z(G);
301
+ }), (G, s) => (d(), M(Te, { styling: _.value }, {
302
+ default: z(() => [
303
+ (d(), M(_e, null, {
304
+ default: z(() => [
305
+ n(Se, {
297
306
  id: "konnectio-gift-card-module",
298
307
  type: "gift-card",
299
- "access-token": R.accessToken,
300
- "data-layout": R.layout
308
+ "access-token": G.accessToken,
309
+ "data-layout": G.layout
301
310
  }, {
302
- default: G(() => [
303
- e(Y) ? (c(), I(Ie, {
311
+ default: z(() => [
312
+ e(J) ? (d(), M(ze, {
304
313
  key: 1,
305
314
  title: "Unable to render Gift card module",
306
315
  description: "Gift card functionality hasn't been setup for this account. Please contact Octopus PMS for support."
307
- })) : (c(), g("div", Ke, [
308
- s("h2", Ye, [
309
- s("span", null, ae(e(o)("giftCard.title")), 1)
316
+ })) : (d(), k("div", la, [
317
+ o("h2", oa, [
318
+ o("span", null, se(e(t)("giftCard.title")), 1)
310
319
  ]),
311
- s("div", Ze, [
312
- D(s("div", Je, [
313
- i(Ee)
320
+ o("div", na, [
321
+ W(o("div", ia, [
322
+ n(Le)
314
323
  ], 512), [
315
- [W, e(b)]
324
+ [N, e(V)]
316
325
  ]),
317
- D(s("div", null, [
318
- s("p", {
326
+ W(o("div", null, [
327
+ o("p", {
319
328
  id: "konnectio-gift-card-description",
320
- innerHTML: e(o)("giftCard.description")
321
- }, null, 8, Qe),
322
- s("form", null, [
323
- e(q) ? V("", !0) : (c(), g("div", Xe, [
324
- e(F) ? (c(), g("div", ea, [
325
- s("label", aa, [
326
- s("span", null, ae(e(o)("giftCard.selectType")), 1)
329
+ innerHTML: e(t)("giftCard.description")
330
+ }, null, 8, sa),
331
+ o("form", null, [
332
+ e(x) ? F("", !0) : (d(), k("div", ra, [
333
+ e(C) ? (d(), k("div", da, [
334
+ o("label", ca, [
335
+ o("span", null, se(e(t)("giftCard.selectType")), 1)
327
336
  ]),
328
- s("div", la, [
329
- s("ul", null, [
330
- (c(!0), g(ye, null, ke(e(F), (t, k) => (c(), g("li", { key: k }, [
331
- i(Ue, {
332
- modelValue: e(l),
333
- "onUpdate:modelValue": a[0] || (a[0] = (z) => T(l) ? l.value = z : null),
337
+ o("div", ua, [
338
+ o("ul", null, [
339
+ (d(!0), k(Ce, null, Ve(e(C), (l, j) => (d(), k("li", { key: j }, [
340
+ n(qe, {
341
+ modelValue: e(a),
342
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => P(a) ? a.value = g : null),
334
343
  type: "radio",
335
344
  name: "placeType",
336
- val: k,
337
- label: t.label
345
+ val: j,
346
+ label: l.label
338
347
  }, null, 8, ["modelValue", "val", "label"])
339
348
  ]))), 128))
340
349
  ]),
341
- e(F)[e(l)] && e(F)[e(l)].data.length > 1 ? (c(), I(Ce, {
350
+ e(C)[e(a)] && e(C)[e(a)].data.length > 1 ? (d(), M(we, {
342
351
  key: 0,
343
- modelValue: e(y),
344
- "onUpdate:modelValue": a[1] || (a[1] = (t) => T(y) ? y.value = t : null),
345
- placeholder: e(o)("giftCard.selectPlacePlaceholder"),
346
- options: e(F)[e(l)].data,
352
+ modelValue: e(S),
353
+ "onUpdate:modelValue": s[1] || (s[1] = (l) => P(S) ? S.value = l : null),
354
+ placeholder: e(t)("giftCard.selectPlacePlaceholder"),
355
+ options: e(C)[e(a)].data,
347
356
  labelKey: "name",
348
357
  valueKey: "id",
349
358
  required: ""
350
- }, null, 8, ["modelValue", "placeholder", "options"])) : V("", !0)
359
+ }, null, 8, ["modelValue", "placeholder", "options"])) : F("", !0)
351
360
  ])
352
- ])) : (c(), I(_e, { key: 1 }))
361
+ ])) : (d(), M(Fe, { key: 1 }))
353
362
  ])),
354
- i(j, {
355
- modelValue: e(r),
356
- "onUpdate:modelValue": a[2] || (a[2] = (t) => T(r) ? r.value = t : null),
363
+ n(H, {
364
+ modelValue: e(b),
365
+ "onUpdate:modelValue": s[2] || (s[2] = (l) => P(b) ? b.value = l : null),
357
366
  type: "text",
358
367
  name: "name",
359
368
  autocomplete: "name",
360
- label: e(o)("giftCard.name"),
369
+ label: e(t)("giftCard.name"),
361
370
  icon: "user-alt",
362
- placeholder: e(o)("giftCard.namePlaceholder"),
371
+ placeholder: e(t)("giftCard.namePlaceholder"),
363
372
  required: ""
364
373
  }, null, 8, ["modelValue", "label", "placeholder"]),
365
- i(j, {
366
- modelValue: e(h),
367
- "onUpdate:modelValue": a[3] || (a[3] = (t) => T(h) ? h.value = t : null),
374
+ n(H, {
375
+ modelValue: e(u),
376
+ "onUpdate:modelValue": s[3] || (s[3] = (l) => P(u) ? u.value = l : null),
368
377
  type: "email",
369
378
  name: "email",
370
379
  autocomplete: "email",
371
- label: e(o)("giftCard.email"),
380
+ label: e(t)("giftCard.email"),
372
381
  icon: "at",
373
- placeholder: e(o)("giftCard.emailPlaceholder"),
382
+ placeholder: e(t)("giftCard.emailPlaceholder"),
374
383
  required: ""
375
384
  }, null, 8, ["modelValue", "label", "placeholder"]),
376
- i(Ae, {
377
- modelValue: e(d),
378
- "onUpdate:modelValue": a[4] || (a[4] = (t) => T(d) ? d.value = t : null),
385
+ n(xe, {
386
+ modelValue: e(r),
387
+ "onUpdate:modelValue": s[4] || (s[4] = (l) => P(r) ? r.value = l : null),
379
388
  icon: "phone-office",
380
- label: e(o)("giftCard.phone"),
381
- placeholder: e(o)("giftCard.phonePlaceholder"),
389
+ label: e(t)("giftCard.phone"),
390
+ placeholder: e(t)("giftCard.phonePlaceholder"),
382
391
  required: ""
383
392
  }, null, 8, ["modelValue", "label", "placeholder"]),
384
- i(j, {
393
+ n(H, {
385
394
  modelValue: e(f),
386
- "onUpdate:modelValue": a[5] || (a[5] = (t) => T(f) ? f.value = t : null),
395
+ "onUpdate:modelValue": s[5] || (s[5] = (l) => P(f) ? f.value = l : null),
387
396
  type: "number",
388
397
  name: "value",
389
- label: e(o)("giftCard.value"),
398
+ label: e(t)("giftCard.value"),
390
399
  icon: "money-bill",
391
- placeholder: e(o)("giftCard.valuePlaceholder"),
392
- suffix: e(K),
400
+ placeholder: e(t)("giftCard.valuePlaceholder"),
401
+ suffix: e(A),
393
402
  required: ""
394
403
  }, null, 8, ["modelValue", "label", "placeholder", "suffix"]),
395
- V("", !0),
396
- V("", !0),
397
- i(Ve, {
398
- modelValue: e(p),
399
- "onUpdate:modelValue": a[8] || (a[8] = (t) => T(p) ? p.value = t : null),
400
- label: e(o)("giftCard.quantity"),
404
+ F("", !0),
405
+ F("", !0),
406
+ n(Pe, {
407
+ modelValue: e(m),
408
+ "onUpdate:modelValue": s[8] || (s[8] = (l) => P(m) ? m.value = l : null),
409
+ label: e(t)("giftCard.quantity"),
401
410
  icon: "gift-card",
402
411
  required: ""
403
412
  }, null, 8, ["modelValue", "label"])
404
413
  ])
405
414
  ], 512), [
406
- [W, e(u)]
415
+ [N, e(p)]
407
416
  ]),
408
- D(s("div", null, [
409
- s("div", {
410
- innerHTML: e(o)("giftCard.thankYou")
411
- }, null, 8, ta)
417
+ W(o("div", null, [
418
+ o("div", {
419
+ innerHTML: e(t)("giftCard.thankYou")
420
+ }, null, 8, pa)
412
421
  ], 512), [
413
- [W, e(U)]
422
+ [N, e($)]
414
423
  ])
415
424
  ]),
416
- R.layout !== "minimal" && e(u) ? (c(), g("div", oa, [
417
- s("div", na, [
418
- i(B, {
419
- label: e(o)("giftCard.orderGiftCard"),
425
+ G.layout !== "minimal" && e(p) ? (d(), k("div", ma, [
426
+ o("div", fa, [
427
+ n(D, {
428
+ label: e(t)("giftCard.orderGiftCard"),
420
429
  "full-width": !0,
421
- disabled: !e(A),
422
- "is-loading": e(P),
423
- "onUpdate:isLoading": a[9] || (a[9] = (t) => T(P) ? P.value = t : null),
424
- onClickEvent: e(x)
430
+ disabled: !e(E),
431
+ "is-loading": e(U),
432
+ "onUpdate:isLoading": s[9] || (s[9] = (l) => P(U) ? U.value = l : null),
433
+ onClickEvent: e(R)
425
434
  }, null, 8, ["label", "disabled", "is-loading", "onClickEvent"])
426
435
  ])
427
- ])) : V("", !0),
428
- e(u) ? (c(), g("div", ia, [
429
- i(j, {
430
- modelValue: e(n),
431
- "onUpdate:modelValue": a[10] || (a[10] = (t) => T(n) ? n.value = t : null),
436
+ ])) : F("", !0),
437
+ e(p) ? (d(), k("div", va, [
438
+ n(H, {
439
+ modelValue: e(i),
440
+ "onUpdate:modelValue": s[10] || (s[10] = (l) => P(i) ? i.value = l : null),
432
441
  type: "textarea",
433
442
  name: "remark",
434
- label: e(o)("giftCard.remark"),
443
+ label: e(t)("giftCard.remark"),
435
444
  icon: "info-circle",
436
- placeholder: e(o)("giftCard.remarkPlaceholder")
445
+ placeholder: e(t)("giftCard.remarkPlaceholder")
437
446
  }, null, 8, ["modelValue", "label", "placeholder"])
438
- ])) : V("", !0),
439
- e(u) ? (c(), g("div", sa, [
440
- i(B, {
441
- label: e(o)("giftCard.orderGiftCard"),
447
+ ])) : F("", !0),
448
+ e(p) ? (d(), k("div", ha, [
449
+ n(D, {
450
+ label: e(t)("giftCard.orderGiftCard"),
442
451
  "full-width": !0,
443
- disabled: !e(A),
452
+ disabled: !e(E),
444
453
  "data-test": "orderGiftCard",
445
- "is-loading": e(P),
446
- "onUpdate:isLoading": a[11] || (a[11] = (t) => T(P) ? P.value = t : null),
447
- onClickEvent: e(x)
454
+ "is-loading": e(U),
455
+ "onUpdate:isLoading": s[11] || (s[11] = (l) => P(U) ? U.value = l : null),
456
+ onClickEvent: e(R)
448
457
  }, null, 8, ["label", "disabled", "is-loading", "onClickEvent"]),
449
- D(s("div", ra, [
450
- i(Re)
458
+ o("div", null, [
459
+ ga,
460
+ n(aa)
461
+ ]),
462
+ W(o("div", ba, [
463
+ n(Be)
451
464
  ], 512), [
452
- [W, e(N)]
465
+ [N, e(O)]
453
466
  ])
454
- ])) : V("", !0)
467
+ ])) : F("", !0)
455
468
  ]))
456
469
  ]),
457
470
  _: 1
458
471
  }, 8, ["access-token", "data-layout"])
459
472
  ]),
460
- fallback: G(() => [
461
- i(Ne)
473
+ fallback: z(() => [
474
+ n(ea)
462
475
  ]),
463
476
  _: 1
464
477
  }))
@@ -466,8 +479,8 @@ const je = { class: "gift-card-skeleton" }, Oe = { class: "gift-card-skeleton-fo
466
479
  _: 1
467
480
  }, 8, ["styling"]));
468
481
  }
469
- }), O = /* @__PURE__ */ se(da, [["__scopeId", "data-v-3a6862b8"]]), ua = Pe();
470
- class ca extends HTMLElement {
482
+ }), K = /* @__PURE__ */ ce(ya, [["__scopeId", "data-v-30c8e35c"]]), ka = Ue(), _a = Me();
483
+ class Ca extends HTMLElement {
471
484
  vueApp;
472
485
  constructor() {
473
486
  super();
@@ -476,25 +489,25 @@ class ca extends HTMLElement {
476
489
  this.vueApp.unmount();
477
490
  }
478
491
  connectedCallback() {
479
- const m = typeof O == "function" ? O.options : O;
480
- let w = Array.isArray(m.props) ? m.props : Object.keys(m.props || {});
481
- const o = (n) => n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (v, p) => (p ? "-" : "") + v.toLowerCase()), r = (n) => n.replace(/-./g, (v) => v[1].toUpperCase()), h = {};
482
- w = w.map(o);
483
- const d = {};
484
- for (const n of this.attributes) {
485
- const p = n.name.split(".");
486
- p.length > 1 && (d[p[0]] || (d[p[0]] = {}), d[p[0]][r(p[1])] = n.value);
492
+ const c = typeof K == "function" ? K.options : K;
493
+ let _ = Array.isArray(c.props) ? c.props : Object.keys(c.props || {});
494
+ const t = (i) => i.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (h, m) => (m ? "-" : "") + h.toLowerCase()), b = (i) => i.replace(/-./g, (h) => h[1].toUpperCase()), u = {};
495
+ _ = _.map(t);
496
+ const r = {};
497
+ for (const i of this.attributes) {
498
+ const m = i.name.split(".");
499
+ m.length > 1 && (r[m[0]] || (r[m[0]] = {}), r[m[0]][b(m[1])] = i.value);
487
500
  }
488
- for (const n of w) {
489
- let v = this.attributes.getNamedItem(n)?.value;
490
- d.hasOwnProperty(n) && (v = d[n]), h[n] = v;
501
+ for (const i of _) {
502
+ let h = this.attributes.getNamedItem(i)?.value;
503
+ r.hasOwnProperty(i) && (h = r[i]), u[i] = h;
491
504
  }
492
- this.vueApp = Te(O, h), this.vueApp.use(ua), this.vueApp.use(Se), this.vueApp.use($e, { bootstrap: !0 });
505
+ this.vueApp = Ae(K, u), this.vueApp.provide("emitter", _a), this.vueApp.use(ka), this.vueApp.use(Ie), this.vueApp.use(Ge, { bootstrap: !0 });
493
506
  const f = document.createElement("div");
494
507
  this.vueApp.mount(f), this.appendChild(f.children[0]);
495
508
  }
496
509
  }
497
- window.customElements.define("konnectio-gift-card", ca);
510
+ window.customElements.define("konnectio-gift-card", Ca);
498
511
  export {
499
- ca as default
512
+ Ca as default
500
513
  };