@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.
- package/dist/{ActionField-5ecfc9dc.js → ActionField-68f65af4.js} +3 -3
- package/dist/ActionField-68f65af4.js.br +0 -0
- package/dist/{ActionField-ae9b1adf.cjs → ActionField-ab9c01ab.cjs} +1 -1
- package/dist/AvailabilitySkeleton-c48588e4.js +382 -0
- package/dist/AvailabilitySkeleton-c48588e4.js.br +0 -0
- package/dist/AvailabilitySkeleton-ca6cf6b6.cjs +1 -0
- package/dist/{payment-9e219e9b.js → DateField.vue_vue_type_style_index_0_lang-87ddfed8.js} +3201 -2937
- package/dist/DateField.vue_vue_type_style_index_0_lang-87ddfed8.js.br +0 -0
- package/dist/DateField.vue_vue_type_style_index_0_lang-b6694990.cjs +5 -0
- package/dist/Field-b76d82cb.js +42 -0
- package/dist/Field-b76d82cb.js.br +0 -0
- package/dist/Field-d926807f.cjs +1 -0
- package/dist/{applyGiftCard-c5e4aaad.js → NumberField.vue_vue_type_script_setup_true_lang-a32b2a11.js} +59 -59
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-a32b2a11.js.br +0 -0
- package/dist/NumberField.vue_vue_type_script_setup_true_lang-a549c70e.cjs +1 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-2bf82818.cjs +806 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-c973d794.js +19169 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-c973d794.js.br +0 -0
- package/dist/TextField-528ca68c.cjs +54 -0
- package/dist/TextField-8f6e5ef5.js +9345 -0
- package/dist/TextField-8f6e5ef5.js.br +0 -0
- package/dist/ThankYou-2f3c4efe.js +11777 -0
- package/dist/ThankYou-2f3c4efe.js.br +0 -0
- package/dist/ThankYou-8ae535bf.cjs +54 -0
- package/dist/_-3cff5490.cjs +1 -0
- package/dist/_-734c9d50.js +82 -0
- package/dist/_-734c9d50.js.br +0 -0
- package/dist/{_commonjsHelpers-aeeeeb92.js → _commonjsHelpers-c5d32002.js} +2 -2
- package/dist/assets/typescript/mixins.d.ts +1 -4
- package/dist/availability.cjs +2 -0
- package/dist/availability.js +188 -0
- package/dist/availability.js.br +0 -0
- package/dist/components/ErrorMessage.vue.d.ts +5 -0
- package/dist/components/ErrorMessage.vue.d.ts.map +1 -0
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/forms/EventAvailabilityForm.vue.d.ts +1 -1
- package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
- package/dist/components/forms/HotelReservationForm.vue.d.ts +4 -0
- package/dist/components/forms/HotelReservationForm.vue.d.ts.map +1 -0
- package/dist/components/forms/MultiStepForm.vue.d.ts +1 -1
- package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
- package/dist/components/forms/_.vue.d.ts +4 -0
- package/dist/components/forms/_.vue.d.ts.map +1 -0
- package/dist/components/inputs/InputField.vue.d.ts +1 -1
- package/dist/components/inputs/grouped/CountryField.vue.d.ts +1 -1
- package/dist/components/listings/Base.vue.d.ts +1 -1
- package/dist/components/listings/Event.vue.d.ts +1 -1
- package/dist/components/listings/{Test.vue.d.ts → Hotel.vue.d.ts} +3 -3
- package/dist/components/listings/Hotel.vue.d.ts.map +1 -0
- package/dist/components/modals/Info.vue.d.ts +1 -1
- package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/AvailabilitySkeleton.vue.d.ts.map +1 -0
- package/dist/components/{side-panels/Base.vue.d.ts → skeletons/Field.vue.d.ts} +3 -3
- package/dist/components/skeletons/Field.vue.d.ts.map +1 -0
- package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/GiftCardSkeleton.vue.d.ts.map +1 -0
- package/dist/components/skeletons/HotelSkeleton.vue.d.ts +5 -0
- package/dist/components/skeletons/HotelSkeleton.vue.d.ts.map +1 -0
- package/dist/components/skeletons/Listing.vue.d.ts +5 -0
- package/dist/components/skeletons/Listing.vue.d.ts.map +1 -0
- package/dist/components/skeletons/Sidebar.vue.d.ts +5 -0
- package/dist/components/skeletons/Sidebar.vue.d.ts.map +1 -0
- package/dist/components/skeletons/_.vue.d.ts +5 -0
- package/dist/components/skeletons/_.vue.d.ts.map +1 -0
- package/dist/components/views/CheckoutWindow.vue.d.ts +1 -1
- package/dist/components/views/TermsOfService.vue.d.ts +1 -1
- package/dist/components/views/ThankYou.vue.d.ts +1 -1
- package/dist/entries/availability.d.ts +3 -2
- package/dist/entries/gift-card.d.ts +1 -2
- package/dist/entries/hotel.d.ts +0 -2
- package/dist/event-4662e27c.cjs +1 -0
- package/dist/{event-a70cffeb.js → event-e08d0178.js} +101 -101
- package/dist/event-e08d0178.js.br +0 -0
- package/dist/event.cjs +1 -0
- package/dist/event.js +563 -0
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.cjs +1 -0
- package/dist/gift-card-validation.js +116 -0
- package/dist/gift-card-validation.js.br +0 -0
- package/dist/gift-card.cjs +1 -0
- package/dist/gift-card.d.ts +0 -2
- package/dist/gift-card.js +502 -0
- package/dist/gift-card.js.br +0 -0
- package/dist/hotel.cjs +19 -0
- package/dist/hotel.d.ts +0 -2
- package/dist/hotel.js +2967 -0
- package/dist/hotel.js.br +0 -0
- package/dist/index-a46a0876.cjs +1 -0
- package/dist/{index-00262c16.js → index-c28f52d1.js} +32 -16
- package/dist/index-c28f52d1.js.br +0 -0
- package/dist/layouts/Availability.vue.d.ts +20 -242
- package/dist/layouts/Event.vue.d.ts +16 -242
- package/dist/layouts/GiftCard.vue.d.ts +31 -251
- package/dist/layouts/GiftCardValidation.vue.d.ts +16 -226
- package/dist/layouts/Hotel.vue.d.ts +36 -276
- package/dist/layouts/_.vue.d.ts +31 -20
- package/dist/polyfill.cjs +4 -0
- package/dist/polyfill.js +6826 -0
- package/dist/polyfill.js.br +0 -0
- package/dist/store/availability.d.ts +5 -2
- package/dist/store/giftCard.d.ts +3 -3
- package/dist/store/hotel.d.ts +318 -204
- package/dist/store/tracking.d.ts +6 -14
- package/dist/store/utilities.d.ts +87 -81
- package/dist/style.css +1 -1
- package/dist/style.css.br +0 -0
- package/dist/types/index.d.ts +44 -8
- package/package.json +30 -40
- package/dist/ActionField-5ecfc9dc.js.br +0 -0
- package/dist/HotelAvailabilityForm-0cd1abda.cjs +0 -1
- package/dist/HotelAvailabilityForm-a7b6f17e.js +0 -97
- package/dist/HotelAvailabilityForm-a7b6f17e.js.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-0b6d48f1.cjs +0 -793
- package/dist/NumberField.vue_vue_type_style_index_0_lang-ab747739.js +0 -16403
- package/dist/NumberField.vue_vue_type_style_index_0_lang-ab747739.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-05b8ec39.js +0 -376
- package/dist/ReCaptchaVuePlugin-05b8ec39.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-08ee5d62.cjs +0 -1
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js +0 -10107
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-5f1087dc.cjs +0 -56
- package/dist/ThankYou-1866d8db.js +0 -8547
- package/dist/ThankYou-1866d8db.js.br +0 -0
- package/dist/ThankYou-5741bcb6.cjs +0 -15
- package/dist/applyGiftCard-c5e4aaad.js.br +0 -0
- package/dist/applyGiftCard-d9ab3dcf.cjs +0 -1
- package/dist/availability.cjs.js +0 -1
- package/dist/availability.cjs.js.br +0 -0
- package/dist/availability.es.js +0 -183
- package/dist/availability.es.js.br +0 -0
- package/dist/components/LoadingBlock.vue.d.ts +0 -4
- package/dist/components/LoadingBlock.vue.d.ts.map +0 -1
- package/dist/components/listings/Test.vue.d.ts.map +0 -1
- package/dist/components/side-panels/Base.vue.d.ts.map +0 -1
- package/dist/components/side-panels/Hotel.vue.d.ts +0 -4
- package/dist/components/side-panels/Hotel.vue.d.ts.map +0 -1
- package/dist/event-39706438.cjs +0 -1
- package/dist/event-a70cffeb.js.br +0 -0
- package/dist/event.cjs.js +0 -1
- package/dist/event.cjs.js.br +0 -0
- package/dist/event.es.js +0 -645
- package/dist/event.es.js.br +0 -0
- package/dist/gift-card-validation.cjs.js +0 -1
- package/dist/gift-card-validation.cjs.js.br +0 -0
- package/dist/gift-card-validation.es.js +0 -170
- package/dist/gift-card-validation.es.js.br +0 -0
- package/dist/gift-card.cjs.js +0 -1
- package/dist/gift-card.cjs.js.br +0 -0
- package/dist/gift-card.es.js +0 -584
- package/dist/gift-card.es.js.br +0 -0
- package/dist/hotel.cjs.js +0 -19
- package/dist/hotel.cjs.js.br +0 -0
- package/dist/hotel.es.js +0 -2394
- package/dist/hotel.es.js.br +0 -0
- package/dist/index-00262c16.js.br +0 -0
- package/dist/index-58f3b0cc.cjs +0 -1
- package/dist/payment-9e219e9b.js.br +0 -0
- package/dist/payment-fbffaa6d.cjs +0 -2
- package/dist/polyfill.cjs.js +0 -4
- package/dist/polyfill.cjs.js.br +0 -0
- package/dist/polyfill.es.js +0 -6764
- package/dist/polyfill.es.js.br +0 -0
- /package/dist/{navigation.cjs.js → navigation.cjs} +0 -0
- /package/dist/{navigation.es.js → navigation.js} +0 -0
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { h as v, q as R, s as C, a as T, k as m, l as z, w as c, m as d, x as n, B as l, n as t, z as h, v as P, D as g, F as W, G as L, y as X, H as x, J as w, K as I, L as A, M as D, _ as G, N, P as M, Q as H } from "./NumberField.vue_vue_type_style_index_0_lang-ab747739.js";
|
|
2
|
-
import { u as B } from "./applyGiftCard-c5e4aaad.js";
|
|
3
|
-
import { A as U } from "./ActionField-5ecfc9dc.js";
|
|
4
|
-
import "./SelectField.vue_vue_type_style_index_0_lang-5bdd7db9.js";
|
|
5
|
-
import "./_commonjsHelpers-aeeeeb92.js";
|
|
6
|
-
const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E = {
|
|
7
|
-
key: 0,
|
|
8
|
-
id: "fresh-booking-gift-card-validation-resume",
|
|
9
|
-
class: "fresh-booking-panel"
|
|
10
|
-
}, J = /* @__PURE__ */ $(() => /* @__PURE__ */ n("span", null, "Loading...", -1)), K = /* @__PURE__ */ v({
|
|
11
|
-
__name: "GiftCardValidation",
|
|
12
|
-
props: {
|
|
13
|
-
accessToken: {},
|
|
14
|
-
accentColor: {},
|
|
15
|
-
buttonBackground: {},
|
|
16
|
-
buttonBorder: {},
|
|
17
|
-
buttonBorderRadius: {},
|
|
18
|
-
buttonColor: {},
|
|
19
|
-
buttonFontFamily: {},
|
|
20
|
-
buttonFontSize: {},
|
|
21
|
-
buttonTextTransform: {},
|
|
22
|
-
buttonFontWeight: {},
|
|
23
|
-
fontColor: {},
|
|
24
|
-
fontFamily: {},
|
|
25
|
-
fontSize: {},
|
|
26
|
-
fontWeight: {},
|
|
27
|
-
grayColor: {},
|
|
28
|
-
headerColor: {},
|
|
29
|
-
headerFontSize: {},
|
|
30
|
-
inputBackground: {},
|
|
31
|
-
inputBorder: {},
|
|
32
|
-
inputBorderRadius: {},
|
|
33
|
-
inputFontColor: {},
|
|
34
|
-
labelFontWeight: {},
|
|
35
|
-
labelPadding: {},
|
|
36
|
-
loadingColor: {},
|
|
37
|
-
panelBackground: {},
|
|
38
|
-
panelBorder: {},
|
|
39
|
-
panelBorderRadius: {},
|
|
40
|
-
panelPadding: {}
|
|
41
|
-
},
|
|
42
|
-
setup(i) {
|
|
43
|
-
const o = i, { t: e } = R(), {
|
|
44
|
-
voucher: p,
|
|
45
|
-
isValid: y,
|
|
46
|
-
amount: F,
|
|
47
|
-
expirationDate: k,
|
|
48
|
-
productName: _,
|
|
49
|
-
isLoading: s
|
|
50
|
-
} = C(B()), { currency: S } = C(T()), { apply: b } = B(), V = {
|
|
51
|
-
"--accentColor": o.accentColor,
|
|
52
|
-
"--buttonBackground": o.buttonBackground,
|
|
53
|
-
"--buttonBorder": o.buttonBorder,
|
|
54
|
-
"--buttonBorderRadius": o.buttonBorderRadius,
|
|
55
|
-
"--buttonColor": o.buttonColor,
|
|
56
|
-
"--buttonFontFamily": o.buttonFontFamily,
|
|
57
|
-
"--buttonFontSize": o.buttonFontSize,
|
|
58
|
-
"--buttonTextTransform": o.buttonTextTransform,
|
|
59
|
-
"--buttonFontWeight": o.buttonFontWeight,
|
|
60
|
-
"--fontColor": o.fontColor,
|
|
61
|
-
"--fontFamily": o.fontFamily,
|
|
62
|
-
"--fontSize": o.fontSize,
|
|
63
|
-
"--fontWeight": o.fontWeight,
|
|
64
|
-
"--grayColor": o.grayColor,
|
|
65
|
-
"--headerColor": o.headerColor,
|
|
66
|
-
"--headerFontSize": o.headerFontSize,
|
|
67
|
-
"--inputBackground": o.inputBackground,
|
|
68
|
-
"--inputBorder": o.inputBorder,
|
|
69
|
-
"--inputBorderRadius": o.inputBorderRadius,
|
|
70
|
-
"--inputFontColor": o.inputFontColor,
|
|
71
|
-
"--labelFontWeight": o.labelFontWeight,
|
|
72
|
-
"--labelPadding": o.labelPadding,
|
|
73
|
-
"--loadingColor": o.loadingColor,
|
|
74
|
-
"--panelBackground": o.panelBackground,
|
|
75
|
-
"--panelBorder": o.panelBorder,
|
|
76
|
-
"--panelBorderRadius": o.panelBorderRadius,
|
|
77
|
-
"--panelPadding": o.panelPadding
|
|
78
|
-
};
|
|
79
|
-
return (u, a) => (m(), z(I, null, {
|
|
80
|
-
default: c(() => [
|
|
81
|
-
d(w, {
|
|
82
|
-
id: "fresh-booking-gift-card-validation-module",
|
|
83
|
-
class: "fresh-booking-app",
|
|
84
|
-
"access-token": u.accessToken,
|
|
85
|
-
type: "gift-card",
|
|
86
|
-
style: V
|
|
87
|
-
}, {
|
|
88
|
-
default: c(() => [
|
|
89
|
-
n("form", {
|
|
90
|
-
onSubmit: a[3] || (a[3] = x((r) => t(b)(), ["prevent"]))
|
|
91
|
-
}, [
|
|
92
|
-
n("h4", null, [
|
|
93
|
-
n("span", null, l(t(e)("giftCardValidation.title")), 1)
|
|
94
|
-
]),
|
|
95
|
-
n("p", {
|
|
96
|
-
innerHTML: t(e)("giftCardValidation.description")
|
|
97
|
-
}, null, 8, q),
|
|
98
|
-
d(U, {
|
|
99
|
-
modelValue: t(p),
|
|
100
|
-
"onUpdate:modelValue": a[0] || (a[0] = (r) => h(p) ? p.value = r : null),
|
|
101
|
-
icon: "gift-card",
|
|
102
|
-
label: t(e)("booking.reservation.giftCardCode"),
|
|
103
|
-
buttonLabel: t(e)("giftCardValidation.submitButton"),
|
|
104
|
-
placeholder: "XXXXXXXX",
|
|
105
|
-
"is-loading": t(s),
|
|
106
|
-
"onUpdate:isLoading": a[1] || (a[1] = (r) => h(s) ? s.value = r : null),
|
|
107
|
-
onAction: a[2] || (a[2] = (r) => t(b)())
|
|
108
|
-
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
109
|
-
!t(s) && t(y) ? (m(), P("table", E, [
|
|
110
|
-
n("thead", null, [
|
|
111
|
-
n("tr", null, [
|
|
112
|
-
n("th", null, [
|
|
113
|
-
n("span", null, l(t(e)("giftCardValidation.giftCard")), 1),
|
|
114
|
-
d(g, {
|
|
115
|
-
icon: "gift-card",
|
|
116
|
-
type: "fas",
|
|
117
|
-
"icon-color": u.headerColor
|
|
118
|
-
}, null, 8, ["icon-color"])
|
|
119
|
-
]),
|
|
120
|
-
n("th", null, [
|
|
121
|
-
n("span", null, l(t(e)("giftCardValidation.balance")), 1),
|
|
122
|
-
d(g, {
|
|
123
|
-
icon: "money-bill",
|
|
124
|
-
type: "fas",
|
|
125
|
-
"icon-color": u.headerColor
|
|
126
|
-
}, null, 8, ["icon-color"])
|
|
127
|
-
]),
|
|
128
|
-
n("th", null, [
|
|
129
|
-
n("span", null, l(t(e)("giftCardValidation.expirationDate")), 1),
|
|
130
|
-
d(g, {
|
|
131
|
-
icon: "timer",
|
|
132
|
-
type: "fas",
|
|
133
|
-
"icon-color": u.headerColor
|
|
134
|
-
}, null, 8, ["icon-color"])
|
|
135
|
-
])
|
|
136
|
-
])
|
|
137
|
-
]),
|
|
138
|
-
n("tbody", null, [
|
|
139
|
-
n("tr", null, [
|
|
140
|
-
n("td", null, [
|
|
141
|
-
n("span", null, l(t(_)), 1)
|
|
142
|
-
]),
|
|
143
|
-
n("td", null, [
|
|
144
|
-
n("span", null, l(t(W)(t(F), t(S))), 1)
|
|
145
|
-
]),
|
|
146
|
-
n("td", null, [
|
|
147
|
-
n("span", null, l(t(L)(t(k))), 1)
|
|
148
|
-
])
|
|
149
|
-
])
|
|
150
|
-
])
|
|
151
|
-
])) : X("", !0)
|
|
152
|
-
], 32)
|
|
153
|
-
]),
|
|
154
|
-
_: 1
|
|
155
|
-
}, 8, ["access-token"])
|
|
156
|
-
]),
|
|
157
|
-
fallback: c(() => [
|
|
158
|
-
J
|
|
159
|
-
]),
|
|
160
|
-
_: 1
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
const Q = /* @__PURE__ */ G(K, [["__scopeId", "data-v-72b6e39c"]]), f = N({ components: { GiftCardValidation: Q } }), j = M();
|
|
165
|
-
f.use(j);
|
|
166
|
-
f.use(H);
|
|
167
|
-
f.mount("#fresh-booking-gift-card-validation-app");
|
|
168
|
-
export {
|
|
169
|
-
f as default
|
|
170
|
-
};
|
|
Binary file
|
package/dist/gift-card.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./NumberField.vue_vue_type_style_index_0_lang-0b6d48f1.cjs"),V=require("./index-58f3b0cc.cjs"),I=require("./ReCaptchaVuePlugin-08ee5d62.cjs"),w=require("./SelectField.vue_vue_type_style_index_0_lang-5f1087dc.cjs");require("./_commonjsHelpers-6763f629.cjs");const U=e.defineStore("giftCard",()=>{const{display:c}=e.useAlertStore(),{bearerToken:t,metaData:o}=e.storeToRefs(e.useUtilityStore()),a=e.ref(e.GiftCardModuleState.InitialState),y=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),s=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),p=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),g=e.ref(""),b=e.ref(1),B=e.ref(!0),S=e.ref(""),m=e.ref({base64:"",type:"",name:""}),n=e.ref(void 0),d=e.ref(0),f=e.ref(!1),h=e.ref(0),v=e.computed(()=>a.value===e.GiftCardModuleState.InitialState||a.value===e.GiftCardModuleState.WaitingForResponse),k=e.computed(()=>a.value===e.GiftCardModuleState.ReadyToPay),N=e.computed(()=>a.value===e.GiftCardModuleState.PaymentSuccess),_=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},r=o.value.places;return r&&r.forEach(l=>{u[l.placeType].data.push(l)}),Object.fromEntries(Object.entries(u).filter(([,l])=>l.data.length>0))}),P=e.computed(()=>h.value!==0),C=e.computed(()=>{let u;if(P.value)u=_.value[h.value].data[0];else if(d.value!==0){const r=n.value,l=_.value[d.value].data;l.length===1?u=l[0]:r!==void 0&&l.forEach(R=>{String(R.id)===String(r)&&(u=R)})}return u}),T=e.computed(()=>!(!y.value||!s.value||!(p.value.length>=5)||!g.value||C.value===void 0)),z=e.computed(()=>!(a.value===e.GiftCardModuleState.InitialState&&f.value)),M=e.computed(()=>!!(a.value===e.GiftCardModuleState.WaitingForResponse&&f.value));async function x(){a.value=e.GiftCardModuleState.WaitingForResponse,f.value=!0,await e.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:g.value,quantity:b.value,freeText:S.value,showPrice:B.value,contactName:y.value,contactEmail:s.value,contactPhone:p.value,imageBase64:e.b2a(m.value.base64),imageName:m.value.name,imageFormat:m.value.type,placeType:C.value?C.value.placeType:void 0,placeID:C.value?C.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.6"}}).then(u=>{if(f.value=!1,u.data.easyPayment){a.value=e.GiftCardModuleState.ReadyToPay;const r=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});r.addEventHandler(e.ReepayEvent.Accept,()=>{a.value=e.GiftCardModuleState.PaymentSuccess,c({message:e.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),r.addEventHandler(e.ReepayEvent.Error,()=>{c({message:e.i18n.t("booking.other.errorMessage"),type:"warning"})})}else a.value=e.GiftCardModuleState.InitialState,c({message:`${e.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function E(u){h.value=u}return{moduleState:a,name:y,email:s,phone:p,value:g,remark:S,showValue:B,quantity:b,media:m,placeId:n,placeType:d,showFormPage:v,showPaymentPage:k,showConfirmationPage:N,places:_,hasFilledForm:T,hasForcedPlaceType:P,isWaitingForResponse:M,isMetaDataAvailable:z,orderGiftCard:x,initialize:E}}),D={class:"media-selector"},L=["accept"],W={class:"media-selector-wrapper"},A={class:"media-selector-tools"},H={key:0},j={key:1},O={key:2},K=["src"],Y=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(c,{emit:t}){const o=c,{t:a}=e.useI18n(),{display:y}=e.useAlertStore(),s=e.ref(),p=e.computed(()=>o.modelValue.base64!=="");function g(n){t("update:modelValue",n)}function b(){g({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function B(){s.value&&s.value.click()}function S(n,d){const[f,h]=[n.name,n.type],v=new FileReader;v.onload=function(k){if(k.target){const N=k.target.result;d({base64:N,name:f,type:h})}else y({message:a("imageUploadError"),type:"error"})},v.readAsDataURL(n)}async function m(){let n;(n=s.value.files)instanceof FileList&&S(n[0],g)}return(n,d)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",D,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:n.validation,single:"",onChange:d[0]||(d[0]=f=>m())},null,40,L),e.createBaseVNode("div",W,[e.createBaseVNode("ul",A,[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",H,[e.createVNode(e.Clickable,{label:e.unref(a)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:d[1]||(d[1]=f=>B())},null,8,["label","icon-color"])])),p.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(a)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:d[2]||(d[2]=f=>B())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(a)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:d[3]||(d[3]=f=>b())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:p.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,K)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function $(c){const t=c;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:a}=o;return a(["Upload billede"])},removeFile:o=>{const{normalize:a}=o;return a(["Fjern billede"])},replaceFile:o=>{const{normalize:a}=o;return a(["Ersat billede"])},imageUploadError:o=>{const{normalize:a}=o;return a(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:a}=o;return a(["Upload image"])},removeFile:o=>{const{normalize:a}=o;return a(["Remove image"])},replaceFile:o=>{const{normalize:a}=o;return a(["Replace image"])},imageUploadError:o=>{const{normalize:a}=o;return a(["An error occurred under image upload!"])}}}})}typeof $=="function"&&$(Y);const J=c=>(e.pushScopeId("data-v-259a8073"),c=c(),e.popScopeId(),c),Q={key:0,id:"fresh-booking-gift-card-wrapper"},X={id:"fresh-booking-gift-card-title"},Z={id:"fresh-booking-gift-card-content"},ee={id:"fresh-booking-gift-card-payment"},oe=["innerHTML"],te={key:0},ae={key:0,id:"fresh-booking-select-place-type"},le={class:e.normalizeClass(["fresh-booking-label","required"])},ne={id:"fresh-booking-select-place-type-input"},re=["innerHTML"],ie={key:0,id:"fresh-booking-gift-card-order"},de={class:"fresh-booking-panel"},ue={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},ce={id:"fresh-booking-gift-card-recaptcha"},pe=J(()=>e.createBaseVNode("span",null,"Loading...",-1)),fe=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},layout:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{},placeType:{},successColor:{}},setup(c){const t=c,{t:o}=e.useI18n(),{name:a,email:y,phone:s,value:p,remark:g,showValue:b,quantity:B,media:S,placeId:m,placeType:n,showFormPage:d,showPaymentPage:f,showConfirmationPage:h,places:v,hasFilledForm:k,hasForcedPlaceType:N,isWaitingForResponse:_,isMetaDataAvailable:P}=e.storeToRefs(U()),{initialize:C,orderGiftCard:T}=U(),{isRecaptchaEnabled:z,currency:M}=e.storeToRefs(e.useUtilityStore()),{display:x}=e.useAlertStore();async function E(){const r=I.useReCaptcha_1();if(z.value&&r){await r.recaptchaLoaded();const l=await r.executeRecaptcha("create_gift_card");(await e.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${l}`)).data.success?await T():x({message:o("alert.error.robot"),type:"error"})}else await T()}e.watch(n,()=>{m.value=void 0}),e.onMounted(()=>{C(parseInt(t.placeType))});const u={"--accentColor":t.accentColor,"--buttonBackground":t.buttonBackground,"--buttonBorder":t.buttonBorder,"--buttonBorderRadius":t.buttonBorderRadius,"--buttonFontFamily":t.buttonFontFamily,"--buttonColor":t.buttonColor,"--buttonFontSize":t.buttonFontSize,"--buttonTextTransform":t.buttonTextTransform,"--buttonFontWeight":t.buttonFontWeight,"--fontColor":t.fontColor,"--fontFamily":t.fontFamily,"--fontSize":t.fontSize,"--fontWeight":t.fontWeight,"--grayColor":t.grayColor,"--headerColor":t.headerColor,"--headerFontSize":t.headerFontSize,"--inputBackground":t.inputBackground,"--inputBorder":t.inputBorder,"--inputBorderRadius":t.inputBorderRadius,"--inputFontColor":t.inputFontColor,"--labelFontWeight":t.labelFontWeight,"--labelPadding":t.labelPadding,"--loadingColor":t.loadingColor,"--panelBackground":t.panelBackground,"--panelBorder":t.panelBorder,"--panelBorderRadius":t.panelBorderRadius,"--panelPadding":t.panelPadding,"--successColor":t.successColor};return(r,l)=>{const R=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":r.accessToken,"data-layout":r.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(P)?(e.openBlock(),e.createElementBlock("div",Q,[e.createBaseVNode("h4",X,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(o)("giftCard.title")),1)]),e.createBaseVNode("div",Z,[e.withDirectives(e.createBaseVNode("div",ee,null,512),[[e.vShow,e.unref(f)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(o)("giftCard.description")},null,8,oe),e.createBaseVNode("form",null,[e.createVNode(w.TextField,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=i=>e.isRef(a)?a.value=i:null),type:"text",name:"name",autocomplete:"name",label:e.unref(o)("giftCard.name"),icon:"user-alt","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(w.TextField,{modelValue:e.unref(y),"onUpdate:modelValue":l[1]||(l[1]=i=>e.isRef(y)?y.value=i:null),type:"email",name:"email",autocomplete:"email",label:e.unref(o)("giftCard.email"),icon:"at","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(V.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":l[2]||(l[2]=i=>e.isRef(s)?s.value=i:null),icon:"phone-office","icon-color":r.accentColor,label:e.unref(o)("giftCard.phone"),placeholder:e.unref(o)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(N)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(v)?(e.openBlock(),e.createElementBlock("div",ae,[e.createBaseVNode("label",le,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(o)("giftCard.selectType")),1)]),e.createBaseVNode("div",ne,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v),(i,q)=>(e.openBlock(),e.createElementBlock("li",{key:q},[e.createVNode(V.Checkbox,{modelValue:e.unref(n),"onUpdate:modelValue":l[3]||(l[3]=G=>e.isRef(n)?n.value=G:null),type:"radio",name:"placeType",val:q,label:i.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(v)[e.unref(n)]&&e.unref(v)[e.unref(n)].data.length>1?(e.openBlock(),e.createBlock(w._sfc_main,{key:0,modelValue:e.unref(m),"onUpdate:modelValue":l[4]||(l[4]=i=>e.isRef(m)?m.value=i:null),placeholder:e.unref(o)("giftCard.selectPlacePlaceholder"),options:e.unref(v)[e.unref(n)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:r.loadingColor},null,8,["color"]))])),e.createVNode(w.TextField,{modelValue:e.unref(p),"onUpdate:modelValue":l[5]||(l[5]=i=>e.isRef(p)?p.value=i:null),type:"number",name:"value",label:e.unref(o)("giftCard.value"),icon:"money-bill","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.valuePlaceholder"),suffix:e.unref(M),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(V.Checkbox,{modelValue:e.unref(b),"onUpdate:modelValue":l[6]||(l[6]=i=>e.isRef(b)?b.value=i:null),type:"checkbox",name:"showValue",label:e.unref(o)("giftCard.showValue"),checked:e.unref(b)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(d)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(o)("giftCard.thankYou")},null,8,re)],512),[[e.vShow,e.unref(h)]])]),r.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ie,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(o)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"is-loading":e.unref(_),"onUpdate:isLoading":l[9]||(l[9]=i=>e.isRef(_)?_.value=i:null),onClickEvent:E},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":l[10]||(l[10]=i=>e.isRef(g)?g.value=i:null),type:"textarea",name:"remark",label:e.unref(o)("giftCard.remark"),icon:"info-circle","icon-color":r.accentColor,placeholder:e.unref(o)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","icon-color","placeholder"])])):e.createCommentVNode("",!0),e.unref(d)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(o)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"data-test":"orderGiftCard","is-loading":e.unref(_),"onUpdate:isLoading":l[11]||(l[11]=i=>e.isRef(_)?_.value=i:null),onClickEvent:E},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",ce,[e.createVNode(V._sfc_main)],512),[[e.vShow,e.unref(z)]])])),[[R]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[pe]),_:1})}}});const me=e._export_sfc(fe,[["__scopeId","data-v-259a8073"]]),ge=e.createPinia(),F=e.createApp({components:{GiftCard:me}});F.use(ge);F.use(e.instance);F.use(V.StickyPlugin);F.use(V.install,{bootstrap:!1});F.mount("#fresh-booking-gift-card-app");module.exports=F;
|
package/dist/gift-card.cjs.js.br
DELETED
|
Binary file
|