@konnectio/core 4.0.7 → 4.0.10

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 (164) hide show
  1. package/dist/{ActionField-5ecfc9dc.js → ActionField-68f65af4.js} +3 -3
  2. package/dist/ActionField-68f65af4.js.br +0 -0
  3. package/dist/{ActionField-ae9b1adf.cjs → ActionField-ab9c01ab.cjs} +1 -1
  4. package/dist/AvailabilitySkeleton-c48588e4.js +382 -0
  5. package/dist/AvailabilitySkeleton-c48588e4.js.br +0 -0
  6. package/dist/AvailabilitySkeleton-ca6cf6b6.cjs +1 -0
  7. package/dist/{payment-9e219e9b.js → DateField.vue_vue_type_style_index_0_lang-87ddfed8.js} +3201 -2937
  8. package/dist/DateField.vue_vue_type_style_index_0_lang-87ddfed8.js.br +0 -0
  9. package/dist/DateField.vue_vue_type_style_index_0_lang-b6694990.cjs +5 -0
  10. package/dist/Field-b76d82cb.js +42 -0
  11. package/dist/Field-b76d82cb.js.br +0 -0
  12. package/dist/Field-d926807f.cjs +1 -0
  13. package/dist/{applyGiftCard-c5e4aaad.js → NumberField.vue_vue_type_script_setup_true_lang-a32b2a11.js} +59 -59
  14. package/dist/NumberField.vue_vue_type_script_setup_true_lang-a32b2a11.js.br +0 -0
  15. package/dist/NumberField.vue_vue_type_script_setup_true_lang-a549c70e.cjs +1 -0
  16. package/dist/SelectField.vue_vue_type_style_index_0_lang-2bf82818.cjs +806 -0
  17. package/dist/SelectField.vue_vue_type_style_index_0_lang-c973d794.js +19169 -0
  18. package/dist/SelectField.vue_vue_type_style_index_0_lang-c973d794.js.br +0 -0
  19. package/dist/TextField-528ca68c.cjs +54 -0
  20. package/dist/TextField-8f6e5ef5.js +9345 -0
  21. package/dist/TextField-8f6e5ef5.js.br +0 -0
  22. package/dist/ThankYou-2f3c4efe.js +11777 -0
  23. package/dist/ThankYou-2f3c4efe.js.br +0 -0
  24. package/dist/ThankYou-8ae535bf.cjs +54 -0
  25. package/dist/_-3cff5490.cjs +1 -0
  26. package/dist/_-734c9d50.js +82 -0
  27. package/dist/_-734c9d50.js.br +0 -0
  28. package/dist/{_commonjsHelpers-aeeeeb92.js → _commonjsHelpers-c5d32002.js} +2 -2
  29. package/dist/assets/typescript/mixins.d.ts +1 -4
  30. package/dist/availability.cjs +2 -0
  31. package/dist/availability.js +188 -0
  32. package/dist/availability.js.br +0 -0
  33. package/dist/components/ErrorMessage.vue.d.ts +5 -0
  34. package/dist/components/ErrorMessage.vue.d.ts.map +1 -0
  35. package/dist/components/Icon.vue.d.ts +1 -1
  36. package/dist/components/forms/EventAvailabilityForm.vue.d.ts +1 -1
  37. package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
  38. package/dist/components/forms/HotelReservationForm.vue.d.ts +4 -0
  39. package/dist/components/forms/HotelReservationForm.vue.d.ts.map +1 -0
  40. package/dist/components/forms/MultiStepForm.vue.d.ts +1 -1
  41. package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
  42. package/dist/components/forms/_.vue.d.ts +4 -0
  43. package/dist/components/forms/_.vue.d.ts.map +1 -0
  44. package/dist/components/inputs/InputField.vue.d.ts +1 -1
  45. package/dist/components/inputs/grouped/CountryField.vue.d.ts +1 -1
  46. package/dist/components/listings/Base.vue.d.ts +1 -1
  47. package/dist/components/listings/Event.vue.d.ts +1 -1
  48. package/dist/components/listings/{Test.vue.d.ts → Hotel.vue.d.ts} +3 -3
  49. package/dist/components/listings/Hotel.vue.d.ts.map +1 -0
  50. package/dist/components/modals/Info.vue.d.ts +1 -1
  51. package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts +5 -0
  52. package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts.map +1 -0
  53. package/dist/components/{side-panels/Base.vue.d.ts → skeletons/Field.vue.d.ts} +3 -3
  54. package/dist/components/skeletons/Field.vue.d.ts.map +1 -0
  55. package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts +5 -0
  56. package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts.map +1 -0
  57. package/dist/components/skeletons/HotelSkeleton.vue.d.ts +5 -0
  58. package/dist/components/skeletons/HotelSkeleton.vue.d.ts.map +1 -0
  59. package/dist/components/skeletons/Listing.vue.d.ts +5 -0
  60. package/dist/components/skeletons/Listing.vue.d.ts.map +1 -0
  61. package/dist/components/skeletons/Sidebar.vue.d.ts +5 -0
  62. package/dist/components/skeletons/Sidebar.vue.d.ts.map +1 -0
  63. package/dist/components/skeletons/_.vue.d.ts +5 -0
  64. package/dist/components/skeletons/_.vue.d.ts.map +1 -0
  65. package/dist/components/views/CheckoutWindow.vue.d.ts +1 -1
  66. package/dist/components/views/TermsOfService.vue.d.ts +1 -1
  67. package/dist/components/views/ThankYou.vue.d.ts +1 -1
  68. package/dist/entries/availability.d.ts +3 -2
  69. package/dist/entries/gift-card.d.ts +1 -2
  70. package/dist/entries/hotel.d.ts +0 -2
  71. package/dist/event-4662e27c.cjs +1 -0
  72. package/dist/{event-a70cffeb.js → event-e08d0178.js} +101 -101
  73. package/dist/event-e08d0178.js.br +0 -0
  74. package/dist/event.cjs +1 -0
  75. package/dist/event.js +563 -0
  76. package/dist/event.js.br +0 -0
  77. package/dist/gift-card-validation.cjs +1 -0
  78. package/dist/gift-card-validation.js +116 -0
  79. package/dist/gift-card-validation.js.br +0 -0
  80. package/dist/gift-card.cjs +1 -0
  81. package/dist/gift-card.d.ts +0 -2
  82. package/dist/gift-card.js +502 -0
  83. package/dist/gift-card.js.br +0 -0
  84. package/dist/hotel.cjs +19 -0
  85. package/dist/hotel.d.ts +0 -2
  86. package/dist/hotel.js +2967 -0
  87. package/dist/hotel.js.br +0 -0
  88. package/dist/index-a46a0876.cjs +1 -0
  89. package/dist/{index-00262c16.js → index-c28f52d1.js} +32 -16
  90. package/dist/index-c28f52d1.js.br +0 -0
  91. package/dist/layouts/Availability.vue.d.ts +20 -242
  92. package/dist/layouts/Event.vue.d.ts +16 -242
  93. package/dist/layouts/GiftCard.vue.d.ts +31 -251
  94. package/dist/layouts/GiftCardValidation.vue.d.ts +16 -226
  95. package/dist/layouts/Hotel.vue.d.ts +36 -276
  96. package/dist/layouts/_.vue.d.ts +31 -20
  97. package/dist/polyfill.cjs +4 -0
  98. package/dist/polyfill.js +6826 -0
  99. package/dist/polyfill.js.br +0 -0
  100. package/dist/store/availability.d.ts +5 -2
  101. package/dist/store/giftCard.d.ts +3 -3
  102. package/dist/store/hotel.d.ts +318 -204
  103. package/dist/store/tracking.d.ts +6 -14
  104. package/dist/store/utilities.d.ts +87 -81
  105. package/dist/style.css +1 -1
  106. package/dist/style.css.br +0 -0
  107. package/dist/types/index.d.ts +44 -8
  108. package/package.json +30 -40
  109. package/dist/ActionField-5ecfc9dc.js.br +0 -0
  110. package/dist/HotelAvailabilityForm-0cd1abda.cjs +0 -1
  111. package/dist/HotelAvailabilityForm-a7b6f17e.js +0 -97
  112. package/dist/HotelAvailabilityForm-a7b6f17e.js.br +0 -0
  113. package/dist/NumberField.vue_vue_type_style_index_0_lang-0b6d48f1.cjs +0 -793
  114. package/dist/NumberField.vue_vue_type_style_index_0_lang-ab747739.js +0 -16403
  115. package/dist/NumberField.vue_vue_type_style_index_0_lang-ab747739.js.br +0 -0
  116. package/dist/ReCaptchaVuePlugin-05b8ec39.js +0 -376
  117. package/dist/ReCaptchaVuePlugin-05b8ec39.js.br +0 -0
  118. package/dist/ReCaptchaVuePlugin-08ee5d62.cjs +0 -1
  119. package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js +0 -10107
  120. package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js.br +0 -0
  121. package/dist/SelectField.vue_vue_type_style_index_0_lang-5f1087dc.cjs +0 -56
  122. package/dist/ThankYou-1866d8db.js +0 -8547
  123. package/dist/ThankYou-1866d8db.js.br +0 -0
  124. package/dist/ThankYou-5741bcb6.cjs +0 -15
  125. package/dist/applyGiftCard-c5e4aaad.js.br +0 -0
  126. package/dist/applyGiftCard-d9ab3dcf.cjs +0 -1
  127. package/dist/availability.cjs.js +0 -1
  128. package/dist/availability.cjs.js.br +0 -0
  129. package/dist/availability.es.js +0 -183
  130. package/dist/availability.es.js.br +0 -0
  131. package/dist/components/LoadingBlock.vue.d.ts +0 -4
  132. package/dist/components/LoadingBlock.vue.d.ts.map +0 -1
  133. package/dist/components/listings/Test.vue.d.ts.map +0 -1
  134. package/dist/components/side-panels/Base.vue.d.ts.map +0 -1
  135. package/dist/components/side-panels/Hotel.vue.d.ts +0 -4
  136. package/dist/components/side-panels/Hotel.vue.d.ts.map +0 -1
  137. package/dist/event-39706438.cjs +0 -1
  138. package/dist/event-a70cffeb.js.br +0 -0
  139. package/dist/event.cjs.js +0 -1
  140. package/dist/event.cjs.js.br +0 -0
  141. package/dist/event.es.js +0 -645
  142. package/dist/event.es.js.br +0 -0
  143. package/dist/gift-card-validation.cjs.js +0 -1
  144. package/dist/gift-card-validation.cjs.js.br +0 -0
  145. package/dist/gift-card-validation.es.js +0 -170
  146. package/dist/gift-card-validation.es.js.br +0 -0
  147. package/dist/gift-card.cjs.js +0 -1
  148. package/dist/gift-card.cjs.js.br +0 -0
  149. package/dist/gift-card.es.js +0 -584
  150. package/dist/gift-card.es.js.br +0 -0
  151. package/dist/hotel.cjs.js +0 -19
  152. package/dist/hotel.cjs.js.br +0 -0
  153. package/dist/hotel.es.js +0 -2394
  154. package/dist/hotel.es.js.br +0 -0
  155. package/dist/index-00262c16.js.br +0 -0
  156. package/dist/index-58f3b0cc.cjs +0 -1
  157. package/dist/payment-9e219e9b.js.br +0 -0
  158. package/dist/payment-fbffaa6d.cjs +0 -2
  159. package/dist/polyfill.cjs.js +0 -4
  160. package/dist/polyfill.cjs.js.br +0 -0
  161. package/dist/polyfill.es.js +0 -6764
  162. package/dist/polyfill.es.js.br +0 -0
  163. /package/dist/{navigation.cjs.js → navigation.cjs} +0 -0
  164. /package/dist/{navigation.es.js → navigation.js} +0 -0
@@ -1,584 +0,0 @@
1
- import { d as fe, u as X, s as Z, a as se, r as k, a5 as y, b as J, c as P, i as I, S as Q, e as de, f as ge, a6 as ve, a7 as ae, h as ue, q as ce, k as u, l as L, w as O, x as s, v as b, m, n as e, C as W, y as C, A as pe, I as be, t as he, o as ye, a8 as ke, B as oe, a9 as M, aa as j, z as B, Y as Ce, Z as _e, $ as le, ab as te, J as Fe, K as Ve, L as Be, M as Pe, _ as Se, P as ze, N as Te, Q as we } from "./NumberField.vue_vue_type_style_index_0_lang-ab747739.js";
2
- import { P as Re, C as ne, _ as $e, S as Ue, i as Ee } from "./index-00262c16.js";
3
- import { u as qe } from "./ReCaptchaVuePlugin-05b8ec39.js";
4
- import { T as x, _ as Ie } from "./SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js";
5
- import "./_commonjsHelpers-aeeeeb92.js";
6
- const re = fe("giftCard", () => {
7
- const { display: f } = X(), { bearerToken: o, metaData: a } = Z(se()), l = k(y.InitialState), S = J("freshBookingName", "", void 0, { serializer: Q.string }), p = J("freshBookingEmail", "", void 0, { serializer: Q.string }), g = J("freshBookingPhone", "", void 0, { serializer: Q.string }), _ = k(""), z = k(1), $ = k(!0), U = k(""), h = k({
8
- base64: "",
9
- type: "",
10
- name: ""
11
- }), n = k(void 0), d = k(0), v = k(!1), T = k(0), F = P(() => l.value === y.InitialState || l.value === y.WaitingForResponse), w = P(() => l.value === y.ReadyToPay), E = P(() => l.value === y.PaymentSuccess), V = P(() => {
12
- const c = {
13
- 1: {
14
- label: I.t("giftCard.hotelType"),
15
- data: []
16
- },
17
- 2: {
18
- label: I.t("giftCard.restaurantType"),
19
- data: []
20
- }
21
- }, r = a.value.places;
22
- return r && r.forEach((t) => {
23
- c[t.placeType].data.push(t);
24
- }), Object.fromEntries(
25
- Object.entries(c).filter(([, t]) => t.data.length > 0)
26
- );
27
- }), A = P(() => T.value !== 0), R = P(() => {
28
- let c;
29
- if (A.value)
30
- c = V.value[T.value].data[0];
31
- else if (d.value !== 0) {
32
- const r = n.value, t = V.value[d.value].data;
33
- t.length === 1 ? c = t[0] : r !== void 0 && t.forEach((q) => {
34
- String(q.id) === String(r) && (c = q);
35
- });
36
- }
37
- return c;
38
- }), G = P(() => !(!S.value || !p.value || !(g.value.length >= 5) || !_.value || R.value === void 0)), N = P(() => !(l.value === y.InitialState && v.value)), K = P(() => !!(l.value === y.WaitingForResponse && v.value));
39
- async function Y() {
40
- l.value = y.WaitingForResponse, v.value = !0, await de.post("http://localhost:91/api/gift-card/create", {
41
- termsOfserviceURL: "https://freshbooking.dk",
42
- checkoutUrl: "https://freshbooking.dk",
43
- currencyID: a.value.currency.id,
44
- language: ge(),
45
- amount: _.value,
46
- quantity: z.value,
47
- freeText: U.value,
48
- showPrice: $.value,
49
- contactName: S.value,
50
- contactEmail: p.value,
51
- contactPhone: g.value,
52
- imageBase64: ve(h.value.base64),
53
- imageName: h.value.name,
54
- imageFormat: h.value.type,
55
- placeType: R.value ? R.value.placeType : void 0,
56
- placeID: R.value ? R.value.id : void 0
57
- }, {
58
- headers: {
59
- Authorization: o.value,
60
- Accept: "application/json",
61
- "Fresh-Booking-Ver": "4.0.6"
62
- }
63
- }).then((c) => {
64
- if (v.value = !1, c.data.easyPayment) {
65
- l.value = y.ReadyToPay;
66
- const r = new Reepay.EmbeddedCheckout(
67
- c.data.easyPayment.paymentID,
68
- { html_element: "fresh-booking-gift-card-payment" }
69
- );
70
- r.addEventHandler(ae.Accept, () => {
71
- l.value = y.PaymentSuccess, f({
72
- message: I.t("alert.success.giftCardOrdered"),
73
- type: "success"
74
- });
75
- }), r.addEventHandler(ae.Error, () => {
76
- f({
77
- message: I.t("booking.other.errorMessage"),
78
- type: "warning"
79
- });
80
- });
81
- } else
82
- l.value = y.InitialState, f({
83
- message: `${I.t("booking.other.errorMessage")} (HTTP: ${c.status})`,
84
- type: "warning"
85
- });
86
- });
87
- }
88
- function H(c) {
89
- T.value = c;
90
- }
91
- return {
92
- moduleState: l,
93
- name: S,
94
- email: p,
95
- phone: g,
96
- value: _,
97
- remark: U,
98
- showValue: $,
99
- quantity: z,
100
- media: h,
101
- placeId: n,
102
- placeType: d,
103
- showFormPage: F,
104
- showPaymentPage: w,
105
- showConfirmationPage: E,
106
- places: V,
107
- hasFilledForm: G,
108
- hasForcedPlaceType: A,
109
- isWaitingForResponse: K,
110
- isMetaDataAvailable: N,
111
- orderGiftCard: Y,
112
- initialize: H
113
- };
114
- }), Me = { class: "media-selector" }, Le = ["accept"], We = { class: "media-selector-wrapper" }, De = { class: "media-selector-tools" }, Ae = { key: 0 }, Ge = { key: 1 }, Ne = { key: 2 }, He = ["src"], je = /* @__PURE__ */ ue({
115
- __name: "MediaSelector",
116
- props: {
117
- modelValue: {},
118
- validation: { default: "image/*" },
119
- iconColor: { default: "#000" },
120
- label: {},
121
- required: { type: Boolean, default: !1 }
122
- },
123
- emits: ["update:modelValue"],
124
- setup(f, { emit: o }) {
125
- const a = f, { t: l } = ce(), { display: S } = X(), p = k(), g = P(() => a.modelValue.base64 !== "");
126
- function _(n) {
127
- o("update:modelValue", n);
128
- }
129
- function z() {
130
- _({
131
- base64: "",
132
- name: "",
133
- type: ""
134
- }), p.value && (p.value.value = "");
135
- }
136
- function $() {
137
- p.value && p.value.click();
138
- }
139
- function U(n, d) {
140
- const [v, T] = [n.name, n.type], F = new FileReader();
141
- F.onload = function(w) {
142
- if (w.target) {
143
- const E = w.target.result;
144
- d({ base64: E, name: v, type: T });
145
- } else
146
- S({
147
- message: l("imageUploadError"),
148
- type: "error"
149
- });
150
- }, F.readAsDataURL(n);
151
- }
152
- async function h() {
153
- let n;
154
- (n = p.value.files) instanceof FileList && U(n[0], _);
155
- }
156
- return (n, d) => (u(), L(be, {
157
- label: n.label,
158
- required: n.required,
159
- type: "media"
160
- }, {
161
- default: O(() => [
162
- s("div", Me, [
163
- s("input", {
164
- ref_key: "fileInput",
165
- ref: p,
166
- type: "file",
167
- class: "hidden",
168
- accept: n.validation,
169
- single: "",
170
- onChange: d[0] || (d[0] = (v) => h())
171
- }, null, 40, Le),
172
- s("div", We, [
173
- s("ul", De, [
174
- g.value ? C("", !0) : (u(), b("li", Ae, [
175
- m(W, {
176
- label: e(l)("uploadFile"),
177
- type: "button",
178
- icon: "upload",
179
- "icon-color": n.iconColor,
180
- onClickEvent: d[1] || (d[1] = (v) => $())
181
- }, null, 8, ["label", "icon-color"])
182
- ])),
183
- g.value ? (u(), b("li", Ge, [
184
- m(W, {
185
- label: e(l)("replaceFile"),
186
- type: "button",
187
- icon: "repeat-alt",
188
- "icon-color": n.iconColor,
189
- onClickEvent: d[2] || (d[2] = (v) => $())
190
- }, null, 8, ["label", "icon-color"])
191
- ])) : C("", !0),
192
- g.value ? (u(), b("li", Ne, [
193
- m(W, {
194
- label: e(l)("removeFile"),
195
- type: "button",
196
- icon: "trash-alt",
197
- "icon-color": n.iconColor,
198
- onClickEvent: d[3] || (d[3] = (v) => z())
199
- }, null, 8, ["label", "icon-color"])
200
- ])) : C("", !0)
201
- ]),
202
- s("div", {
203
- class: pe([
204
- "media-selector-previewer",
205
- { opened: g.value }
206
- ])
207
- }, [
208
- n.modelValue ? (u(), b("img", {
209
- key: 0,
210
- src: n.modelValue.base64
211
- }, null, 8, He)) : C("", !0)
212
- ], 2)
213
- ])
214
- ])
215
- ]),
216
- _: 1
217
- }, 8, ["label", "required"]));
218
- }
219
- });
220
- function ie(f) {
221
- const o = f;
222
- o.__i18n = o.__i18n || [], o.__i18n.push({
223
- locale: "",
224
- resource: {
225
- da: {
226
- uploadFile: (a) => {
227
- const { normalize: l } = a;
228
- return l(["Upload billede"]);
229
- },
230
- removeFile: (a) => {
231
- const { normalize: l } = a;
232
- return l(["Fjern billede"]);
233
- },
234
- replaceFile: (a) => {
235
- const { normalize: l } = a;
236
- return l(["Ersat billede"]);
237
- },
238
- imageUploadError: (a) => {
239
- const { normalize: l } = a;
240
- return l(["Der skete en fejl under billede upload!"]);
241
- }
242
- },
243
- en: {
244
- uploadFile: (a) => {
245
- const { normalize: l } = a;
246
- return l(["Upload image"]);
247
- },
248
- removeFile: (a) => {
249
- const { normalize: l } = a;
250
- return l(["Remove image"]);
251
- },
252
- replaceFile: (a) => {
253
- const { normalize: l } = a;
254
- return l(["Replace image"]);
255
- },
256
- imageUploadError: (a) => {
257
- const { normalize: l } = a;
258
- return l(["An error occurred under image upload!"]);
259
- }
260
- }
261
- }
262
- });
263
- }
264
- typeof ie == "function" && ie(je);
265
- const xe = (f) => (Be("data-v-259a8073"), f = f(), Pe(), f), Oe = {
266
- key: 0,
267
- id: "fresh-booking-gift-card-wrapper"
268
- }, Ke = { id: "fresh-booking-gift-card-title" }, Ye = { id: "fresh-booking-gift-card-content" }, Je = { id: "fresh-booking-gift-card-payment" }, Qe = ["innerHTML"], Ze = { key: 0 }, Xe = {
269
- key: 0,
270
- id: "fresh-booking-select-place-type"
271
- }, ea = {
272
- class: /* @__PURE__ */ pe(["fresh-booking-label", "required"])
273
- }, aa = { id: "fresh-booking-select-place-type-input" }, oa = ["innerHTML"], la = {
274
- key: 0,
275
- id: "fresh-booking-gift-card-order"
276
- }, ta = { class: "fresh-booking-panel" }, na = {
277
- key: 1,
278
- id: "fresh-booking-gift-card-remarks"
279
- }, ra = {
280
- key: 2,
281
- id: "fresh-booking-gift-card-order-minimal",
282
- "sticky-side": "bottom"
283
- }, ia = { id: "fresh-booking-gift-card-recaptcha" }, sa = /* @__PURE__ */ xe(() => /* @__PURE__ */ s("span", null, "Loading...", -1)), da = /* @__PURE__ */ ue({
284
- __name: "GiftCard",
285
- props: {
286
- accessToken: {},
287
- accentColor: {},
288
- buttonBackground: {},
289
- buttonBorder: {},
290
- buttonBorderRadius: {},
291
- buttonColor: {},
292
- buttonFontFamily: {},
293
- buttonFontSize: {},
294
- buttonTextTransform: {},
295
- buttonFontWeight: {},
296
- fontColor: {},
297
- fontFamily: {},
298
- fontSize: {},
299
- fontWeight: {},
300
- grayColor: {},
301
- headerColor: {},
302
- headerFontSize: {},
303
- inputBackground: {},
304
- inputBorder: {},
305
- inputBorderRadius: {},
306
- inputFontColor: {},
307
- labelFontWeight: {},
308
- labelPadding: {},
309
- layout: {},
310
- loadingColor: {},
311
- panelBackground: {},
312
- panelBorder: {},
313
- panelBorderRadius: {},
314
- panelPadding: {},
315
- placeType: {},
316
- successColor: {}
317
- },
318
- setup(f) {
319
- const o = f, { t: a } = ce(), {
320
- name: l,
321
- email: S,
322
- phone: p,
323
- value: g,
324
- remark: _,
325
- showValue: z,
326
- quantity: $,
327
- media: U,
328
- placeId: h,
329
- placeType: n,
330
- showFormPage: d,
331
- showPaymentPage: v,
332
- showConfirmationPage: T,
333
- places: F,
334
- hasFilledForm: w,
335
- hasForcedPlaceType: E,
336
- isWaitingForResponse: V,
337
- isMetaDataAvailable: A
338
- } = Z(re()), { initialize: R, orderGiftCard: G } = re(), { isRecaptchaEnabled: N, currency: K } = Z(se()), { display: Y } = X();
339
- async function H() {
340
- const r = qe();
341
- if (N.value && r) {
342
- await r.recaptchaLoaded();
343
- const t = await r.executeRecaptcha("create_gift_card");
344
- (await de.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${t}`)).data.success ? await G() : Y({
345
- message: a("alert.error.robot"),
346
- type: "error"
347
- });
348
- } else
349
- await G();
350
- }
351
- he(n, () => {
352
- h.value = void 0;
353
- }), ye(() => {
354
- R(parseInt(o.placeType));
355
- });
356
- const c = {
357
- "--accentColor": o.accentColor,
358
- "--buttonBackground": o.buttonBackground,
359
- "--buttonBorder": o.buttonBorder,
360
- "--buttonBorderRadius": o.buttonBorderRadius,
361
- "--buttonFontFamily": o.buttonFontFamily,
362
- "--buttonColor": o.buttonColor,
363
- "--buttonFontSize": o.buttonFontSize,
364
- "--buttonTextTransform": o.buttonTextTransform,
365
- "--buttonFontWeight": o.buttonFontWeight,
366
- "--fontColor": o.fontColor,
367
- "--fontFamily": o.fontFamily,
368
- "--fontSize": o.fontSize,
369
- "--fontWeight": o.fontWeight,
370
- "--grayColor": o.grayColor,
371
- "--headerColor": o.headerColor,
372
- "--headerFontSize": o.headerFontSize,
373
- "--inputBackground": o.inputBackground,
374
- "--inputBorder": o.inputBorder,
375
- "--inputBorderRadius": o.inputBorderRadius,
376
- "--inputFontColor": o.inputFontColor,
377
- "--labelFontWeight": o.labelFontWeight,
378
- "--labelPadding": o.labelPadding,
379
- "--loadingColor": o.loadingColor,
380
- "--panelBackground": o.panelBackground,
381
- "--panelBorder": o.panelBorder,
382
- "--panelBorderRadius": o.panelBorderRadius,
383
- "--panelPadding": o.panelPadding,
384
- "--successColor": o.successColor
385
- };
386
- return (r, t) => {
387
- const q = ke("sticky");
388
- return u(), L(Ve, null, {
389
- default: O(() => [
390
- m(Fe, {
391
- id: "fresh-booking-gift-card-module",
392
- class: "fresh-booking-app",
393
- type: "gift-card",
394
- "access-token": r.accessToken,
395
- "data-layout": r.layout,
396
- style: c,
397
- "sticky-container": ""
398
- }, {
399
- default: O(() => [
400
- e(A) ? (u(), b("div", Oe, [
401
- s("h4", Ke, [
402
- s("span", null, oe(e(a)("giftCard.title")), 1)
403
- ]),
404
- s("div", Ye, [
405
- M(s("div", Je, null, 512), [
406
- [j, e(v)]
407
- ]),
408
- M(s("div", null, [
409
- s("p", {
410
- id: "fresh-booking-gift-card-description",
411
- innerHTML: e(a)("giftCard.description")
412
- }, null, 8, Qe),
413
- s("form", null, [
414
- m(x, {
415
- modelValue: e(l),
416
- "onUpdate:modelValue": t[0] || (t[0] = (i) => B(l) ? l.value = i : null),
417
- type: "text",
418
- name: "name",
419
- autocomplete: "name",
420
- label: e(a)("giftCard.name"),
421
- icon: "user-alt",
422
- "icon-color": r.accentColor,
423
- placeholder: e(a)("giftCard.namePlaceholder"),
424
- required: ""
425
- }, null, 8, ["modelValue", "label", "icon-color", "placeholder"]),
426
- m(x, {
427
- modelValue: e(S),
428
- "onUpdate:modelValue": t[1] || (t[1] = (i) => B(S) ? S.value = i : null),
429
- type: "email",
430
- name: "email",
431
- autocomplete: "email",
432
- label: e(a)("giftCard.email"),
433
- icon: "at",
434
- "icon-color": r.accentColor,
435
- placeholder: e(a)("giftCard.emailPlaceholder"),
436
- required: ""
437
- }, null, 8, ["modelValue", "label", "icon-color", "placeholder"]),
438
- m(Re, {
439
- modelValue: e(p),
440
- "onUpdate:modelValue": t[2] || (t[2] = (i) => B(p) ? p.value = i : null),
441
- icon: "phone-office",
442
- "icon-color": r.accentColor,
443
- label: e(a)("giftCard.phone"),
444
- placeholder: e(a)("giftCard.phonePlaceholder"),
445
- required: ""
446
- }, null, 8, ["modelValue", "icon-color", "label", "placeholder"]),
447
- e(E) ? C("", !0) : (u(), b("div", Ze, [
448
- e(F) ? (u(), b("div", Xe, [
449
- s("label", ea, [
450
- s("span", null, oe(e(a)("giftCard.selectType")), 1)
451
- ]),
452
- s("div", aa, [
453
- s("ul", null, [
454
- (u(!0), b(Ce, null, _e(e(F), (i, ee) => (u(), b("li", { key: ee }, [
455
- m(ne, {
456
- modelValue: e(n),
457
- "onUpdate:modelValue": t[3] || (t[3] = (me) => B(n) ? n.value = me : null),
458
- type: "radio",
459
- name: "placeType",
460
- val: ee,
461
- label: i.label
462
- }, null, 8, ["modelValue", "val", "label"])
463
- ]))), 128))
464
- ]),
465
- e(F)[e(n)] && e(F)[e(n)].data.length > 1 ? (u(), L(Ie, {
466
- key: 0,
467
- modelValue: e(h),
468
- "onUpdate:modelValue": t[4] || (t[4] = (i) => B(h) ? h.value = i : null),
469
- placeholder: e(a)("giftCard.selectPlacePlaceholder"),
470
- options: e(F)[e(n)].data,
471
- labelKey: "name",
472
- valueKey: "id",
473
- required: ""
474
- }, null, 8, ["modelValue", "placeholder", "options"])) : C("", !0)
475
- ])
476
- ])) : (u(), L(le, {
477
- key: 1,
478
- color: r.loadingColor
479
- }, null, 8, ["color"]))
480
- ])),
481
- m(x, {
482
- modelValue: e(g),
483
- "onUpdate:modelValue": t[5] || (t[5] = (i) => B(g) ? g.value = i : null),
484
- type: "number",
485
- name: "value",
486
- label: e(a)("giftCard.value"),
487
- icon: "money-bill",
488
- "icon-color": r.accentColor,
489
- placeholder: e(a)("giftCard.valuePlaceholder"),
490
- suffix: e(K),
491
- required: ""
492
- }, null, 8, ["modelValue", "label", "icon-color", "placeholder", "suffix"]),
493
- m(ne, {
494
- modelValue: e(z),
495
- "onUpdate:modelValue": t[6] || (t[6] = (i) => B(z) ? z.value = i : null),
496
- type: "checkbox",
497
- name: "showValue",
498
- label: e(a)("giftCard.showValue"),
499
- checked: e(z)
500
- }, null, 8, ["modelValue", "label", "checked"]),
501
- C("", !0),
502
- C("", !0)
503
- ])
504
- ], 512), [
505
- [j, e(d)]
506
- ]),
507
- M(s("div", null, [
508
- s("div", {
509
- innerHTML: e(a)("giftCard.thankYou")
510
- }, null, 8, oa)
511
- ], 512), [
512
- [j, e(T)]
513
- ])
514
- ]),
515
- r.layout !== "minimal" && e(d) ? (u(), b("div", la, [
516
- s("div", ta, [
517
- m(W, {
518
- label: e(a)("giftCard.orderGiftCard"),
519
- style: te({
520
- background: r.successColor
521
- }),
522
- "full-width": !0,
523
- disabled: !e(w),
524
- "is-loading": e(V),
525
- "onUpdate:isLoading": t[9] || (t[9] = (i) => B(V) ? V.value = i : null),
526
- onClickEvent: H
527
- }, null, 8, ["label", "style", "disabled", "is-loading"])
528
- ])
529
- ])) : C("", !0),
530
- e(d) ? (u(), b("div", na, [
531
- m(x, {
532
- modelValue: e(_),
533
- "onUpdate:modelValue": t[10] || (t[10] = (i) => B(_) ? _.value = i : null),
534
- type: "textarea",
535
- name: "remark",
536
- label: e(a)("giftCard.remark"),
537
- icon: "info-circle",
538
- "icon-color": r.accentColor,
539
- placeholder: e(a)("giftCard.remarkPlaceholder")
540
- }, null, 8, ["modelValue", "label", "icon-color", "placeholder"])
541
- ])) : C("", !0),
542
- e(d) ? M((u(), b("div", ra, [
543
- m(W, {
544
- label: e(a)("giftCard.orderGiftCard"),
545
- style: te({
546
- background: r.successColor
547
- }),
548
- "full-width": !0,
549
- disabled: !e(w),
550
- "data-test": "orderGiftCard",
551
- "is-loading": e(V),
552
- "onUpdate:isLoading": t[11] || (t[11] = (i) => B(V) ? V.value = i : null),
553
- onClickEvent: H
554
- }, null, 8, ["label", "style", "disabled", "is-loading"]),
555
- M(s("div", ia, [
556
- m($e)
557
- ], 512), [
558
- [j, e(N)]
559
- ])
560
- ])), [
561
- [q]
562
- ]) : C("", !0)
563
- ])) : (u(), L(le, { key: 1 }))
564
- ]),
565
- _: 1
566
- }, 8, ["access-token", "data-layout"])
567
- ]),
568
- fallback: O(() => [
569
- sa
570
- ]),
571
- _: 1
572
- });
573
- };
574
- }
575
- });
576
- const ua = /* @__PURE__ */ Se(da, [["__scopeId", "data-v-259a8073"]]), ca = ze(), D = Te({ components: { GiftCard: ua } });
577
- D.use(ca);
578
- D.use(we);
579
- D.use(Ue);
580
- D.use(Ee, { bootstrap: !1 });
581
- D.mount("#fresh-booking-gift-card-app");
582
- export {
583
- D as default
584
- };
Binary file