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