@konnectio/core 4.0.1 → 4.0.3
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-1b4171c7.mjs +103 -0
- package/dist/ActionField-1b4171c7.mjs.br +0 -0
- package/dist/ActionField-97c0c682.js +2 -0
- package/dist/ActionField-97c0c682.js.br +0 -0
- package/dist/Clickable-eb931b15.mjs +13899 -0
- package/dist/Clickable-eb931b15.mjs.br +0 -0
- package/dist/Clickable-f57e16ad.js +785 -0
- package/dist/Clickable-f57e16ad.js.br +0 -0
- package/dist/HotelAvailabilityForm-5750665b.js +2 -0
- package/dist/HotelAvailabilityForm-5750665b.js.br +0 -0
- package/dist/HotelAvailabilityForm-bab6ef4d.mjs +99 -0
- package/dist/HotelAvailabilityForm-bab6ef4d.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs +5917 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs.br +0 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js +56 -0
- package/dist/NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-36454b0f.js +2 -0
- package/dist/ReCaptchaVuePlugin-36454b0f.js.br +0 -0
- package/dist/ReCaptchaVuePlugin-e4f378b2.mjs +377 -0
- package/dist/ReCaptchaVuePlugin-e4f378b2.mjs.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a3371159.js +57 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a3371159.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs +10109 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs.br +0 -0
- package/dist/ThankYou-23531d13.js +16 -0
- package/dist/ThankYou-23531d13.js.br +0 -0
- package/dist/ThankYou-4299d606.mjs +8519 -0
- package/dist/ThankYou-4299d606.mjs.br +0 -0
- package/dist/_commonjsHelpers-6763f629.js +2 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +31 -0
- package/dist/applyGiftCard-9847fda1.js +2 -0
- package/dist/applyGiftCard-9847fda1.js.br +0 -0
- package/dist/applyGiftCard-eb7b85ee.mjs +118 -0
- package/dist/applyGiftCard-eb7b85ee.mjs.br +0 -0
- package/dist/availability.cjs.js +2 -0
- package/dist/availability.cjs.js.br +0 -0
- package/dist/availability.es.js +185 -0
- package/dist/availability.es.js.br +0 -0
- package/dist/event-1b888019.mjs +329 -0
- package/dist/event-1b888019.mjs.br +0 -0
- package/dist/event-e8e0c6a2.js +2 -0
- package/dist/event-e8e0c6a2.js.br +0 -0
- package/dist/event.cjs.js +2 -0
- package/dist/event.cjs.js.br +0 -0
- package/dist/event.es.js +647 -0
- package/dist/event.es.js.br +0 -0
- package/dist/gift-card-validation.cjs.js +2 -0
- package/dist/gift-card-validation.cjs.js.br +0 -0
- package/dist/gift-card-validation.es.js +172 -0
- package/dist/gift-card-validation.es.js.br +0 -0
- package/dist/gift-card.cjs.js +2 -0
- package/dist/gift-card.cjs.js.br +0 -0
- package/dist/gift-card.es.js +586 -0
- package/dist/gift-card.es.js.br +0 -0
- package/dist/hotel.cjs.js +20 -0
- package/dist/hotel.cjs.js.br +0 -0
- package/dist/hotel.es.js +2396 -0
- package/dist/hotel.es.js.br +0 -0
- package/dist/index-937554a9.mjs +654 -0
- package/dist/index-937554a9.mjs.br +0 -0
- package/dist/index-aa255eba.js +2 -0
- package/dist/index-aa255eba.js.br +0 -0
- package/dist/navigation.cjs.js +2 -0
- package/dist/navigation.cjs.js.br +0 -0
- package/dist/navigation.es.js +59 -0
- package/dist/navigation.es.js.br +0 -0
- package/dist/payment-3140b25e.js +3 -0
- package/dist/payment-3140b25e.js.br +0 -0
- package/dist/payment-b79997a8.mjs +8149 -0
- package/dist/payment-b79997a8.mjs.br +0 -0
- package/dist/polyfill.cjs.js +5 -0
- package/dist/polyfill.cjs.js.br +0 -0
- package/dist/polyfill.es.js +6766 -0
- package/dist/polyfill.es.js.br +0 -0
- package/dist/style.css +1 -0
- package/dist/style.css.br +0 -0
- package/package.json +3 -1
- package/dist/admin.js +0 -2
- package/dist/admin.js.br +0 -0
- package/dist/assets/ActionField-d1b315e3.js +0 -2
- package/dist/assets/ActionField-d1b315e3.js.br +0 -0
- package/dist/assets/Alert-2cd22061.js +0 -2
- package/dist/assets/Alert-2cd22061.js.br +0 -0
- package/dist/assets/Clickable-19c9ecdc.js +0 -2
- package/dist/assets/Clickable-19c9ecdc.js.br +0 -0
- package/dist/assets/GoogleNotice-83805aa2.js +0 -2
- package/dist/assets/GoogleNotice-83805aa2.js.br +0 -0
- package/dist/assets/HotelAvailabilityForm-53fa6ecb.js +0 -2
- package/dist/assets/HotelAvailabilityForm-53fa6ecb.js.br +0 -0
- package/dist/assets/Icon-6c933148.js +0 -2
- package/dist/assets/Icon-6c933148.js.br +0 -0
- package/dist/assets/NumberField.vue_vue_type_style_index_0_lang-9b1b90b2.js +0 -2
- package/dist/assets/NumberField.vue_vue_type_style_index_0_lang-9b1b90b2.js.br +0 -0
- package/dist/assets/SelectField.vue_vue_type_style_index_0_lang-c5d2bf7d.js +0 -2
- package/dist/assets/SelectField.vue_vue_type_style_index_0_lang-c5d2bf7d.js.br +0 -0
- package/dist/assets/ThankYou-29820212.js +0 -5
- package/dist/assets/ThankYou-29820212.js.br +0 -0
- package/dist/assets/applyGiftCard-39571f2e.js +0 -2
- package/dist/assets/applyGiftCard-39571f2e.js.br +0 -0
- package/dist/assets/event-79c562c0.js +0 -2
- package/dist/assets/event-79c562c0.js.br +0 -0
- package/dist/assets/payment-a3a9b5dd.js +0 -2
- package/dist/assets/payment-a3a9b5dd.js.br +0 -0
- package/dist/assets/style.css +0 -1
- package/dist/assets/style.css.br +0 -0
- package/dist/assets/vendor-65ee0d78.js +0 -889
- package/dist/assets/vendor-65ee0d78.js.br +0 -0
- package/dist/availability.js +0 -2
- package/dist/availability.js.br +0 -0
- package/dist/event.js +0 -2
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.js +0 -2
- package/dist/gift-card-validation.js.br +0 -0
- package/dist/gift-card.js +0 -2
- package/dist/gift-card.js.br +0 -0
- package/dist/hotel.js +0 -2
- package/dist/hotel.js.br +0 -0
- package/dist/manifest.json +0 -231
- package/dist/manifest.json.br +0 -0
- package/dist/navigation.js +0 -2
- package/dist/navigation.js.br +0 -0
- package/dist/polyfill.js +0 -2
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { d as v, o as m, h as T, w as f, a as d, b as t, t as i, u as n, i as C, c as z, I as g, k as R, j as W, S as X, p as I, l as P, _ as x, m as L } from "./Clickable-eb931b15.mjs";
|
|
2
|
+
import { u as w, s as h, k as A, j as E, n as N, _ as D, d as U, c as G, a as Z, i as $ } from "./NumberField.vue_vue_type_style_index_0_lang-737bf674.mjs";
|
|
3
|
+
import { u as B } from "./applyGiftCard-eb7b85ee.mjs";
|
|
4
|
+
import { A as M } from "./ActionField-1b4171c7.mjs";
|
|
5
|
+
import "./SelectField.vue_vue_type_style_index_0_lang-d7f0bf68.mjs";
|
|
6
|
+
import "./_commonjsHelpers-c5d32002.mjs";
|
|
7
|
+
const j = (l) => (I("data-v-64c7a8a4"), l = l(), P(), l), H = ["innerHTML"], O = {
|
|
8
|
+
key: 0,
|
|
9
|
+
id: "fresh-booking-gift-card-validation-resume",
|
|
10
|
+
class: "fresh-booking-panel"
|
|
11
|
+
}, Y = /* @__PURE__ */ j(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), J = /* @__PURE__ */ v({
|
|
12
|
+
__name: "GiftCardValidation",
|
|
13
|
+
props: {
|
|
14
|
+
accessToken: {},
|
|
15
|
+
accentColor: {},
|
|
16
|
+
buttonBackground: {},
|
|
17
|
+
buttonBorder: {},
|
|
18
|
+
buttonBorderRadius: {},
|
|
19
|
+
buttonColor: {},
|
|
20
|
+
buttonFontFamily: {},
|
|
21
|
+
buttonFontSize: {},
|
|
22
|
+
buttonTextTransform: {},
|
|
23
|
+
buttonFontWeight: {},
|
|
24
|
+
fontColor: {},
|
|
25
|
+
fontFamily: {},
|
|
26
|
+
fontSize: {},
|
|
27
|
+
fontWeight: {},
|
|
28
|
+
grayColor: {},
|
|
29
|
+
headerColor: {},
|
|
30
|
+
headerFontSize: {},
|
|
31
|
+
inputBackground: {},
|
|
32
|
+
inputBorder: {},
|
|
33
|
+
inputBorderRadius: {},
|
|
34
|
+
inputFontColor: {},
|
|
35
|
+
labelFontWeight: {},
|
|
36
|
+
labelPadding: {},
|
|
37
|
+
loadingColor: {},
|
|
38
|
+
panelBackground: {},
|
|
39
|
+
panelBorder: {},
|
|
40
|
+
panelBorderRadius: {},
|
|
41
|
+
panelPadding: {}
|
|
42
|
+
},
|
|
43
|
+
setup(l) {
|
|
44
|
+
const o = l, { t: e } = w(), {
|
|
45
|
+
voucher: c,
|
|
46
|
+
isValid: k,
|
|
47
|
+
amount: F,
|
|
48
|
+
expirationDate: y,
|
|
49
|
+
productName: _,
|
|
50
|
+
isLoading: s
|
|
51
|
+
} = h(B()), { currency: S } = h(A()), { apply: b } = B(), V = {
|
|
52
|
+
"--accentColor": o.accentColor,
|
|
53
|
+
"--buttonBackground": o.buttonBackground,
|
|
54
|
+
"--buttonBorder": o.buttonBorder,
|
|
55
|
+
"--buttonBorderRadius": o.buttonBorderRadius,
|
|
56
|
+
"--buttonColor": o.buttonColor,
|
|
57
|
+
"--buttonFontFamily": o.buttonFontFamily,
|
|
58
|
+
"--buttonFontSize": o.buttonFontSize,
|
|
59
|
+
"--buttonTextTransform": o.buttonTextTransform,
|
|
60
|
+
"--buttonFontWeight": o.buttonFontWeight,
|
|
61
|
+
"--fontColor": o.fontColor,
|
|
62
|
+
"--fontFamily": o.fontFamily,
|
|
63
|
+
"--fontSize": o.fontSize,
|
|
64
|
+
"--fontWeight": o.fontWeight,
|
|
65
|
+
"--grayColor": o.grayColor,
|
|
66
|
+
"--headerColor": o.headerColor,
|
|
67
|
+
"--headerFontSize": o.headerFontSize,
|
|
68
|
+
"--inputBackground": o.inputBackground,
|
|
69
|
+
"--inputBorder": o.inputBorder,
|
|
70
|
+
"--inputBorderRadius": o.inputBorderRadius,
|
|
71
|
+
"--inputFontColor": o.inputFontColor,
|
|
72
|
+
"--labelFontWeight": o.labelFontWeight,
|
|
73
|
+
"--labelPadding": o.labelPadding,
|
|
74
|
+
"--loadingColor": o.loadingColor,
|
|
75
|
+
"--panelBackground": o.panelBackground,
|
|
76
|
+
"--panelBorder": o.panelBorder,
|
|
77
|
+
"--panelBorderRadius": o.panelBorderRadius,
|
|
78
|
+
"--panelPadding": o.panelPadding
|
|
79
|
+
};
|
|
80
|
+
return (u, a) => (m(), T(X, null, {
|
|
81
|
+
default: f(() => [
|
|
82
|
+
d(D, {
|
|
83
|
+
id: "fresh-booking-gift-card-validation-module",
|
|
84
|
+
class: "fresh-booking-app",
|
|
85
|
+
"access-token": u.accessToken,
|
|
86
|
+
type: "gift-card",
|
|
87
|
+
style: V
|
|
88
|
+
}, {
|
|
89
|
+
default: f(() => [
|
|
90
|
+
t("form", {
|
|
91
|
+
onSubmit: a[3] || (a[3] = W((r) => n(b)(), ["prevent"]))
|
|
92
|
+
}, [
|
|
93
|
+
t("h4", null, [
|
|
94
|
+
t("span", null, i(n(e)("giftCardValidation.title")), 1)
|
|
95
|
+
]),
|
|
96
|
+
t("p", {
|
|
97
|
+
innerHTML: n(e)("giftCardValidation.description")
|
|
98
|
+
}, null, 8, H),
|
|
99
|
+
d(M, {
|
|
100
|
+
modelValue: n(c),
|
|
101
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => C(c) ? c.value = r : null),
|
|
102
|
+
icon: "gift-card",
|
|
103
|
+
label: n(e)("booking.reservation.giftCardCode"),
|
|
104
|
+
buttonLabel: n(e)("giftCardValidation.submitButton"),
|
|
105
|
+
placeholder: "XXXXXXXX",
|
|
106
|
+
"is-loading": n(s),
|
|
107
|
+
"onUpdate:isLoading": a[1] || (a[1] = (r) => C(s) ? s.value = r : null),
|
|
108
|
+
onAction: a[2] || (a[2] = (r) => n(b)())
|
|
109
|
+
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
110
|
+
!n(s) && n(k) ? (m(), z("table", O, [
|
|
111
|
+
t("thead", null, [
|
|
112
|
+
t("tr", null, [
|
|
113
|
+
t("th", null, [
|
|
114
|
+
t("span", null, i(n(e)("giftCardValidation.giftCard")), 1),
|
|
115
|
+
d(g, {
|
|
116
|
+
icon: "gift-card",
|
|
117
|
+
type: "fas",
|
|
118
|
+
"icon-color": u.headerColor
|
|
119
|
+
}, null, 8, ["icon-color"])
|
|
120
|
+
]),
|
|
121
|
+
t("th", null, [
|
|
122
|
+
t("span", null, i(n(e)("giftCardValidation.balance")), 1),
|
|
123
|
+
d(g, {
|
|
124
|
+
icon: "money-bill",
|
|
125
|
+
type: "fas",
|
|
126
|
+
"icon-color": u.headerColor
|
|
127
|
+
}, null, 8, ["icon-color"])
|
|
128
|
+
]),
|
|
129
|
+
t("th", null, [
|
|
130
|
+
t("span", null, i(n(e)("giftCardValidation.expirationDate")), 1),
|
|
131
|
+
d(g, {
|
|
132
|
+
icon: "timer",
|
|
133
|
+
type: "fas",
|
|
134
|
+
"icon-color": u.headerColor
|
|
135
|
+
}, null, 8, ["icon-color"])
|
|
136
|
+
])
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
t("tbody", null, [
|
|
140
|
+
t("tr", null, [
|
|
141
|
+
t("td", null, [
|
|
142
|
+
t("span", null, i(n(_)), 1)
|
|
143
|
+
]),
|
|
144
|
+
t("td", null, [
|
|
145
|
+
t("span", null, i(n(E)(n(F), n(S))), 1)
|
|
146
|
+
]),
|
|
147
|
+
t("td", null, [
|
|
148
|
+
t("span", null, i(n(N)(n(y))), 1)
|
|
149
|
+
])
|
|
150
|
+
])
|
|
151
|
+
])
|
|
152
|
+
])) : R("", !0)
|
|
153
|
+
], 32)
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["access-token"])
|
|
157
|
+
]),
|
|
158
|
+
fallback: f(() => [
|
|
159
|
+
Y
|
|
160
|
+
]),
|
|
161
|
+
_: 1
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const q = /* @__PURE__ */ x(J, [["__scopeId", "data-v-64c7a8a4"]]);
|
|
166
|
+
process.env.NODE_ENV === "production" && U.flare.light("rzAIZ4UzZcOlUo0F0ZcYWETY9Z6JXf82");
|
|
167
|
+
const p = L({ components: { GiftCardValidation: q } }), K = G();
|
|
168
|
+
p.use(Z.flareVue);
|
|
169
|
+
p.use(K);
|
|
170
|
+
p.use($);
|
|
171
|
+
p.mount("#fresh-booking-gift-card-validation-app");
|
|
172
|
+
//# sourceMappingURL=gift-card-validation.es.js.map
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("./Clickable-f57e16ad.js"),o=require("./NumberField.vue_vue_type_style_index_0_lang-e642c7f3.js"),F=require("./index-aa255eba.js"),x=require("./ReCaptchaVuePlugin-36454b0f.js"),P=require("./SelectField.vue_vue_type_style_index_0_lang-a3371159.js");require("./_commonjsHelpers-6763f629.js");const G=o.defineStore("giftCard",()=>{const{display:p}=o.useAlertStore(),{bearerToken:t,metaData:a}=o.storeToRefs(o.useUtilityStore()),l=e.ref(o.GiftCardModuleState.InitialState),k=o.useStorage("freshBookingName","",void 0,{serializer:o.StorageSerializers.string}),s=o.useStorage("freshBookingEmail","",void 0,{serializer:o.StorageSerializers.string}),f=o.useStorage("freshBookingPhone","",void 0,{serializer:o.StorageSerializers.string}),v=e.ref(""),y=e.ref(1),_=e.ref(!0),N=e.ref(""),g=e.ref({base64:"",type:"",name:""}),r=e.ref(void 0),d=e.ref(0),m=e.ref(!1),C=e.ref(0),b=e.computed(()=>l.value===o.GiftCardModuleState.InitialState||l.value===o.GiftCardModuleState.WaitingForResponse),B=e.computed(()=>l.value===o.GiftCardModuleState.ReadyToPay),R=e.computed(()=>l.value===o.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:o.i18n.t("giftCard.hotelType"),data:[]},2:{label:o.i18n.t("giftCard.restaurantType"),data:[]}},i=a.value.places;return i&&i.forEach(n=>{u[n.placeType].data.push(n)}),Object.fromEntries(Object.entries(u).filter(([,n])=>n.data.length>0))}),T=e.computed(()=>C.value!==0),V=e.computed(()=>{let u;if(T.value)u=h.value[C.value].data[0];else if(d.value!==0){const i=r.value,n=h.value[d.value].data;n.length===1?u=n[0]:i!==void 0&&n.forEach(w=>{String(w.id)===String(i)&&(u=w)})}return u}),z=e.computed(()=>!(!k.value||!s.value||!(f.value.length>=5)||!v.value||V.value===void 0)),E=e.computed(()=>!(l.value===o.GiftCardModuleState.InitialState&&m.value)),q=e.computed(()=>!!(l.value===o.GiftCardModuleState.WaitingForResponse&&m.value));async function U(){l.value=o.GiftCardModuleState.WaitingForResponse,m.value=!0,await o.axios.post("http://localhost:91/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:a.value.currency.id,language:o.getUserLanguage(),amount:v.value,quantity:y.value,freeText:N.value,showPrice:_.value,contactName:k.value,contactEmail:s.value,contactPhone:f.value,imageBase64:o.b2a(g.value.base64),imageName:g.value.name,imageFormat:g.value.type,placeType:V.value?V.value.placeType:void 0,placeID:V.value?V.value.id:void 0},{headers:{Authorization:t.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.3"}}).then(u=>{if(m.value=!1,u.data.easyPayment){l.value=o.GiftCardModuleState.ReadyToPay;const i=new Reepay.EmbeddedCheckout(u.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});i.addEventHandler(o.ReepayEvent.Accept,()=>{l.value=o.GiftCardModuleState.PaymentSuccess,p({message:o.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),i.addEventHandler(o.ReepayEvent.Error,()=>{p({message:o.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=o.GiftCardModuleState.InitialState,p({message:`${o.i18n.t("booking.other.errorMessage")} (HTTP: ${u.status})`,type:"warning"})})}function M(u){C.value=u}return{moduleState:l,name:k,email:s,phone:f,value:v,remark:N,showValue:_,quantity:y,media:g,placeId:r,placeType:d,showFormPage:b,showPaymentPage:B,showConfirmationPage:R,places:h,hasFilledForm:z,hasForcedPlaceType:T,isWaitingForResponse:q,isMetaDataAvailable:E,orderGiftCard:U,initialize:M}}),L={class:"media-selector"},W=["accept"],A={class:"media-selector-wrapper"},H={class:"media-selector-tools"},O={key:0},j={key:1},K={key:2},Y=["src"],J=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:t}){const a=p,{t:l}=o.useI18n(),{display:k}=o.useAlertStore(),s=e.ref(),f=e.computed(()=>a.modelValue.base64!=="");function v(r){t("update:modelValue",r)}function y(){v({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function _(){s.value&&s.value.click()}function N(r,d){const[m,C]=[r.name,r.type],b=new FileReader;b.onload=function(B){if(B.target){const R=B.target.result;d({base64:R,name:m,type:C})}else k({message:l("imageUploadError"),type:"error"})},b.readAsDataURL(r)}async function g(){let r;(r=s.value.files)instanceof FileList&&N(r[0],v)}return(r,d)=>(e.openBlock(),e.createBlock(o.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",L,[e.createBaseVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=m=>g())},null,40,W),e.createBaseVNode("div",A,[e.createBaseVNode("ul",H,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",O,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=m=>_())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=m=>_())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",K,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=m=>y())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,Y)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function I(p){const t=p;t.__i18n=t.__i18n||[],t.__i18n.push({locale:"",resource:{da:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload billede"])},removeFile:a=>{const{normalize:l}=a;return l(["Fjern billede"])},replaceFile:a=>{const{normalize:l}=a;return l(["Ersat billede"])},imageUploadError:a=>{const{normalize:l}=a;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:a=>{const{normalize:l}=a;return l(["Upload image"])},removeFile:a=>{const{normalize:l}=a;return l(["Remove image"])},replaceFile:a=>{const{normalize:l}=a;return l(["Replace image"])},imageUploadError:a=>{const{normalize:l}=a;return l(["An error occurred under image upload!"])}}}})}typeof I=="function"&&I(J);const Q=p=>(e.pushScopeId("data-v-10b51e8f"),p=p(),e.popScopeId(),p),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],te={key:0},le={key:0,id:"fresh-booking-select-place-type"},ne={class:e.normalizeClass(["fresh-booking-label","required"])},re={id:"fresh-booking-select-place-type-input"},ie=["innerHTML"],ce={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"},pe={id:"fresh-booking-gift-card-recaptcha"},fe=Q(()=>e.createBaseVNode("span",null,"Loading...",-1)),me=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(p){const t=p,{t:a}=o.useI18n(),{name:l,email:k,phone:s,value:f,remark:v,showValue:y,quantity:_,media:N,placeId:g,placeType:r,showFormPage:d,showPaymentPage:m,showConfirmationPage:C,places:b,hasFilledForm:B,hasForcedPlaceType:R,isWaitingForResponse:h,isMetaDataAvailable:T}=o.storeToRefs(G()),{initialize:V,orderGiftCard:z}=G(),{isRecaptchaEnabled:E,currency:q}=o.storeToRefs(o.useUtilityStore()),{display:U}=o.useAlertStore();async function M(){const i=x.useReCaptcha_1();if(E.value&&i){await i.recaptchaLoaded();const n=await i.executeRecaptcha("create_gift_card");(await o.axios.get(`/?rest_route=/freshcase-octopus/v1/recaptcha/${n}`)).data.success?await z():U({message:a("alert.error.robot"),type:"error"})}else await z()}e.watch(r,()=>{g.value=void 0}),e.onMounted(()=>{V(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(i,n)=>{const w=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(o._sfc_main,{id:"fresh-booking-gift-card-module",class:"fresh-booking-app",type:"gift-card","access-token":i.accessToken,"data-layout":i.layout,style:u,"sticky-container":""},{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(m)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(P.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":n[0]||(n[0]=c=>e.isRef(l)?l.value=c:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(P.TextField,{modelValue:e.unref(k),"onUpdate:modelValue":n[1]||(n[1]=c=>e.isRef(k)?k.value=c:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(s),"onUpdate:modelValue":n[2]||(n[2]=c=>e.isRef(s)?s.value=c:null),icon:"phone-office","icon-color":i.accentColor,label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(R)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",te,[e.unref(b)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(b),(c,$)=>(e.openBlock(),e.createElementBlock("li",{key:$},[e.createVNode(F.Checkbox,{modelValue:e.unref(r),"onUpdate:modelValue":n[3]||(n[3]=D=>e.isRef(r)?r.value=D:null),type:"radio",name:"placeType",val:$,label:c.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(b)[e.unref(r)]&&e.unref(b)[e.unref(r)].data.length>1?(e.openBlock(),e.createBlock(P._sfc_main,{key:0,modelValue:e.unref(g),"onUpdate:modelValue":n[4]||(n[4]=c=>e.isRef(g)?g.value=c:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(b)[e.unref(r)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1,color:i.loadingColor},null,8,["color"]))])),e.createVNode(P.TextField,{modelValue:e.unref(f),"onUpdate:modelValue":n[5]||(n[5]=c=>e.isRef(f)?f.value=c:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill","icon-color":i.accentColor,placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(y),"onUpdate:modelValue":n[6]||(n[6]=c=>e.isRef(y)?y.value=c:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(y)},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(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(C)]])]),i.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ce,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(h),"onUpdate:isLoading":n[9]||(n[9]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(P.TextField,{modelValue:e.unref(v),"onUpdate:modelValue":n[10]||(n[10]=c=>e.isRef(v)?v.value=c:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle","icon-color":i.accentColor,placeholder:e.unref(a)("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(a)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:i.successColor}),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(h),"onUpdate:isLoading":n[11]||(n[11]=c=>e.isRef(h)?h.value=c:null),onClickEvent:M},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[w]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[fe]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-10b51e8f"]]);process.env.NODE_ENV==="production"&&o.distExports.flare.light();const ve=o.createPinia(),S=e.createApp({components:{GiftCard:ge}});S.use(o.distExports$1.flareVue);S.use(ve);S.use(o.instance);S.use(F.StickyPlugin);S.use(F.install,{bootstrap:!1});S.mount("#fresh-booking-gift-card-app");
|
|
2
|
+
//# sourceMappingURL=gift-card.cjs.js.map
|
|
Binary file
|