@konnectio/core 4.0.7 → 4.0.9
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-b87d2fd7.cjs +1 -0
- package/dist/{ActionField-5ecfc9dc.js → ActionField-f3d5b218.js} +4 -4
- package/dist/ActionField-f3d5b218.js.br +0 -0
- package/dist/AvailabilitySkeleton-019ec202.js +150 -0
- package/dist/AvailabilitySkeleton-019ec202.js.br +0 -0
- package/dist/AvailabilitySkeleton-e288f5be.cjs +1 -0
- package/dist/Field-21bb32d7.cjs +1 -0
- package/dist/Field-6bfeedce.js +59 -0
- package/dist/Field-6bfeedce.js.br +0 -0
- package/dist/{NumberField.vue_vue_type_style_index_0_lang-ab747739.js → SelectField.vue_vue_type_style_index_0_lang-701aecad.js} +7743 -6953
- package/dist/SelectField.vue_vue_type_style_index_0_lang-701aecad.js.br +0 -0
- package/dist/SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs +797 -0
- package/dist/TextField-99e69631.cjs +54 -0
- package/dist/TextField-b8f4462a.js +9343 -0
- package/dist/TextField-b8f4462a.js.br +0 -0
- package/dist/ThankYou-add684c1.cjs +66 -0
- package/dist/ThankYou-edbf753b.js +14279 -0
- package/dist/ThankYou-edbf753b.js.br +0 -0
- package/dist/{_commonjsHelpers-aeeeeb92.js → _commonjsHelpers-c5d32002.js} +2 -2
- package/dist/{applyGiftCard-d9ab3dcf.cjs → applyGiftCard-c21f13ac.cjs} +1 -1
- package/dist/{applyGiftCard-c5e4aaad.js → applyGiftCard-dea77ba6.js} +7 -7
- package/dist/applyGiftCard-dea77ba6.js.br +0 -0
- package/dist/availability.cjs +2 -0
- package/dist/availability.js +236 -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/MultiStepForm.vue.d.ts +1 -1
- package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
- package/dist/components/forms/ReservationFormTest.vue.d.ts +5 -0
- package/dist/components/forms/ReservationFormTest.vue.d.ts.map +1 -0
- 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/Test.vue.d.ts +1 -1
- package/dist/components/side-panels/Base.vue.d.ts +1 -1
- package/dist/components/side-panels/Hotel.vue.d.ts +3 -2
- package/dist/components/side-panels/Hotel.vue.d.ts.map +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/skeletons/Field.vue.d.ts +5 -0
- 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/_.vue.d.ts +5 -0
- package/dist/components/skeletons/_.vue.d.ts.map +1 -0
- 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-2c6a2138.cjs +1 -0
- package/dist/{event-a70cffeb.js → event-a9067cf5.js} +91 -91
- package/dist/event-a9067cf5.js.br +0 -0
- package/dist/event.cjs +2 -0
- package/dist/event.js +867 -0
- package/dist/event.js.br +0 -0
- package/dist/gift-card-validation.cjs +1 -0
- package/dist/{gift-card-validation.es.js → gift-card-validation.js} +42 -42
- 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 +590 -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 +2981 -0
- package/dist/hotel.js.br +0 -0
- package/dist/{index-00262c16.js → index-d080b5a0.js} +5 -7
- package/dist/index-d080b5a0.js.br +0 -0
- package/dist/index-ec04c269.cjs +1 -0
- package/dist/layouts/Availability.vue.d.ts +42 -217
- package/dist/layouts/GiftCard.vue.d.ts +130 -99
- package/dist/layouts/Hotel.vue.d.ts +162 -57
- package/dist/{payment-fbffaa6d.cjs → payment-95b2392a.cjs} +2 -2
- package/dist/{payment-9e219e9b.js → payment-cce506b8.js} +930 -929
- package/dist/payment-cce506b8.js.br +0 -0
- package/dist/polyfill.cjs +4 -0
- package/dist/polyfill.js +6815 -0
- package/dist/polyfill.js.br +0 -0
- package/dist/store/availability.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/style.css.br +0 -0
- package/package.json +11 -21
- package/dist/ActionField-5ecfc9dc.js.br +0 -0
- package/dist/ActionField-ae9b1adf.cjs +0 -1
- 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.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/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/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.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/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
package/dist/event.js.br
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs"),c=require("./applyGiftCard-c21f13ac.cjs"),V=require("./ActionField-b87d2fd7.cjs");require("./TextField-99e69631.cjs");require("./_commonjsHelpers-6763f629.cjs");const y=a=>(e.pushScopeId("data-v-72b6e39c"),a=a(),e.popScopeId(),a),h=["innerHTML"],m={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},N=y(()=>e.createBaseVNode("span",null,"Loading...",-1)),F=e.defineComponent({__name:"GiftCardValidation",props:{accessToken:{},accentColor:{},buttonBackground:{},buttonBorder:{},buttonBorderRadius:{},buttonColor:{},buttonFontFamily:{},buttonFontSize:{},buttonTextTransform:{},buttonFontWeight:{},fontColor:{},fontFamily:{},fontSize:{},fontWeight:{},grayColor:{},headerColor:{},headerFontSize:{},inputBackground:{},inputBorder:{},inputBorderRadius:{},inputFontColor:{},labelFontWeight:{},labelPadding:{},loadingColor:{},panelBackground:{},panelBorder:{},panelBorderRadius:{},panelPadding:{}},setup(a){const o=a,{t:n}=e.useI18n(),{voucher:u,isValid:p,amount:f,expirationDate:g,productName:B,isLoading:i}=e.storeToRefs(c.useApplyGiftCardStore()),{currency:b}=e.storeToRefs(e.useUtilityStore()),{apply:s}=c.useApplyGiftCardStore(),C={"--accentColor":o.accentColor,"--buttonBackground":o.buttonBackground,"--buttonBorder":o.buttonBorder,"--buttonBorderRadius":o.buttonBorderRadius,"--buttonColor":o.buttonColor,"--buttonFontFamily":o.buttonFontFamily,"--buttonFontSize":o.buttonFontSize,"--buttonTextTransform":o.buttonTextTransform,"--buttonFontWeight":o.buttonFontWeight,"--fontColor":o.fontColor,"--fontFamily":o.fontFamily,"--fontSize":o.fontSize,"--fontWeight":o.fontWeight,"--grayColor":o.grayColor,"--headerColor":o.headerColor,"--headerFontSize":o.headerFontSize,"--inputBackground":o.inputBackground,"--inputBorder":o.inputBorder,"--inputBorderRadius":o.inputBorderRadius,"--inputFontColor":o.inputFontColor,"--labelFontWeight":o.labelFontWeight,"--labelPadding":o.labelPadding,"--loadingColor":o.loadingColor,"--panelBackground":o.panelBackground,"--panelBorder":o.panelBorder,"--panelBorderRadius":o.panelBorderRadius,"--panelPadding":o.panelPadding};return(l,t)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-validation-module",class:"fresh-booking-app","access-token":l.accessToken,type:"gift-card",style:C},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:t[3]||(t[3]=e.withModifiers(r=>e.unref(s)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(n)("giftCardValidation.description")},null,8,h),e.createVNode(V.ActionField,{modelValue:e.unref(u),"onUpdate:modelValue":t[0]||(t[0]=r=>e.isRef(u)?u.value=r:null),icon:"gift-card",label:e.unref(n)("booking.reservation.giftCardCode"),buttonLabel:e.unref(n)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":t[1]||(t[1]=r=>e.isRef(i)?i.value=r:null),onAction:t[2]||(t[2]=r=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(p)?(e.openBlock(),e.createElementBlock("table",m,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(n)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas","icon-color":l.headerColor},null,8,["icon-color"])])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(B)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showPrice)(e.unref(f),e.unref(b))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showDate)(e.unref(g))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token"])]),fallback:e.withCtx(()=>[N]),_:1}))}});const k=e._export_sfc(F,[["__scopeId","data-v-72b6e39c"]]),d=e.createApp({components:{GiftCardValidation:k}}),S=e.createPinia();d.use(S);d.use(e.instance);d.mount("#konnectio-gift-card-validation-app");module.exports=d;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { h as v,
|
|
2
|
-
import { u as
|
|
3
|
-
import { A as U } from "./ActionField-
|
|
4
|
-
import "./
|
|
5
|
-
import "./_commonjsHelpers-
|
|
6
|
-
const $ = (i) => (
|
|
1
|
+
import { h as v, t as R, s as C, a as T, k as m, l as z, w as c, m as d, q as t, v as l, n, x as B, y as W, z as g, A as L, B as P, D as X, F as x, G as w, H as A, J as I, K as D, _ as G, L as N, M, N as H } from "./SelectField.vue_vue_type_style_index_0_lang-701aecad.js";
|
|
2
|
+
import { u as h } from "./applyGiftCard-dea77ba6.js";
|
|
3
|
+
import { A as U } from "./ActionField-f3d5b218.js";
|
|
4
|
+
import "./TextField-b8f4462a.js";
|
|
5
|
+
import "./_commonjsHelpers-c5d32002.js";
|
|
6
|
+
const $ = (i) => (I("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E = {
|
|
7
7
|
key: 0,
|
|
8
8
|
id: "fresh-booking-gift-card-validation-resume",
|
|
9
9
|
class: "fresh-booking-panel"
|
|
10
|
-
}, J = /* @__PURE__ */ $(() => /* @__PURE__ */
|
|
10
|
+
}, J = /* @__PURE__ */ $(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), K = /* @__PURE__ */ v({
|
|
11
11
|
__name: "GiftCardValidation",
|
|
12
12
|
props: {
|
|
13
13
|
accessToken: {},
|
|
@@ -47,7 +47,7 @@ const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E =
|
|
|
47
47
|
expirationDate: k,
|
|
48
48
|
productName: _,
|
|
49
49
|
isLoading: s
|
|
50
|
-
} = C(
|
|
50
|
+
} = C(h()), { currency: S } = C(T()), { apply: b } = h(), V = {
|
|
51
51
|
"--accentColor": o.accentColor,
|
|
52
52
|
"--buttonBackground": o.buttonBackground,
|
|
53
53
|
"--buttonBorder": o.buttonBorder,
|
|
@@ -76,7 +76,7 @@ const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E =
|
|
|
76
76
|
"--panelBorderRadius": o.panelBorderRadius,
|
|
77
77
|
"--panelPadding": o.panelPadding
|
|
78
78
|
};
|
|
79
|
-
return (u, a) => (m(), z(
|
|
79
|
+
return (u, a) => (m(), z(A, null, {
|
|
80
80
|
default: c(() => [
|
|
81
81
|
d(w, {
|
|
82
82
|
id: "fresh-booking-gift-card-validation-module",
|
|
@@ -86,47 +86,47 @@ const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E =
|
|
|
86
86
|
style: V
|
|
87
87
|
}, {
|
|
88
88
|
default: c(() => [
|
|
89
|
-
|
|
90
|
-
onSubmit: a[3] || (a[3] = x((r) =>
|
|
89
|
+
t("form", {
|
|
90
|
+
onSubmit: a[3] || (a[3] = x((r) => n(b)(), ["prevent"]))
|
|
91
91
|
}, [
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
t("h4", null, [
|
|
93
|
+
t("span", null, l(n(e)("giftCardValidation.title")), 1)
|
|
94
94
|
]),
|
|
95
|
-
|
|
96
|
-
innerHTML:
|
|
95
|
+
t("p", {
|
|
96
|
+
innerHTML: n(e)("giftCardValidation.description")
|
|
97
97
|
}, null, 8, q),
|
|
98
98
|
d(U, {
|
|
99
|
-
modelValue:
|
|
100
|
-
"onUpdate:modelValue": a[0] || (a[0] = (r) =>
|
|
99
|
+
modelValue: n(p),
|
|
100
|
+
"onUpdate:modelValue": a[0] || (a[0] = (r) => B(p) ? p.value = r : null),
|
|
101
101
|
icon: "gift-card",
|
|
102
|
-
label:
|
|
103
|
-
buttonLabel:
|
|
102
|
+
label: n(e)("booking.reservation.giftCardCode"),
|
|
103
|
+
buttonLabel: n(e)("giftCardValidation.submitButton"),
|
|
104
104
|
placeholder: "XXXXXXXX",
|
|
105
|
-
"is-loading":
|
|
106
|
-
"onUpdate:isLoading": a[1] || (a[1] = (r) =>
|
|
107
|
-
onAction: a[2] || (a[2] = (r) =>
|
|
105
|
+
"is-loading": n(s),
|
|
106
|
+
"onUpdate:isLoading": a[1] || (a[1] = (r) => B(s) ? s.value = r : null),
|
|
107
|
+
onAction: a[2] || (a[2] = (r) => n(b)())
|
|
108
108
|
}, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
|
|
109
|
-
!
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
!n(s) && n(y) ? (m(), W("table", E, [
|
|
110
|
+
t("thead", null, [
|
|
111
|
+
t("tr", null, [
|
|
112
|
+
t("th", null, [
|
|
113
|
+
t("span", null, l(n(e)("giftCardValidation.giftCard")), 1),
|
|
114
114
|
d(g, {
|
|
115
115
|
icon: "gift-card",
|
|
116
116
|
type: "fas",
|
|
117
117
|
"icon-color": u.headerColor
|
|
118
118
|
}, null, 8, ["icon-color"])
|
|
119
119
|
]),
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
t("th", null, [
|
|
121
|
+
t("span", null, l(n(e)("giftCardValidation.balance")), 1),
|
|
122
122
|
d(g, {
|
|
123
123
|
icon: "money-bill",
|
|
124
124
|
type: "fas",
|
|
125
125
|
"icon-color": u.headerColor
|
|
126
126
|
}, null, 8, ["icon-color"])
|
|
127
127
|
]),
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
t("th", null, [
|
|
129
|
+
t("span", null, l(n(e)("giftCardValidation.expirationDate")), 1),
|
|
130
130
|
d(g, {
|
|
131
131
|
icon: "timer",
|
|
132
132
|
type: "fas",
|
|
@@ -135,16 +135,16 @@ const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E =
|
|
|
135
135
|
])
|
|
136
136
|
])
|
|
137
137
|
]),
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
t("tbody", null, [
|
|
139
|
+
t("tr", null, [
|
|
140
|
+
t("td", null, [
|
|
141
|
+
t("span", null, l(n(_)), 1)
|
|
142
142
|
]),
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
t("td", null, [
|
|
144
|
+
t("span", null, l(n(L)(n(F), n(S))), 1)
|
|
145
145
|
]),
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
t("td", null, [
|
|
147
|
+
t("span", null, l(n(P)(n(k))), 1)
|
|
148
148
|
])
|
|
149
149
|
])
|
|
150
150
|
])
|
|
@@ -161,10 +161,10 @@ const $ = (i) => (A("data-v-72b6e39c"), i = i(), D(), i), q = ["innerHTML"], E =
|
|
|
161
161
|
}));
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
-
const
|
|
165
|
-
f.use(
|
|
164
|
+
const j = /* @__PURE__ */ G(K, [["__scopeId", "data-v-72b6e39c"]]), f = N({ components: { GiftCardValidation: j } }), O = M();
|
|
165
|
+
f.use(O);
|
|
166
166
|
f.use(H);
|
|
167
|
-
f.mount("#
|
|
167
|
+
f.mount("#konnectio-gift-card-validation-app");
|
|
168
168
|
export {
|
|
169
169
|
f as default
|
|
170
170
|
};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-a370e66d.cjs"),F=require("./index-ec04c269.cjs"),R=require("./TextField-99e69631.cjs"),V=require("./Field-21bb32d7.cjs");require("./_commonjsHelpers-6763f629.cjs");const G=e.defineStore("giftCard",()=>{const{display:p}=e.useAlertStore(),{bearerToken:o,metaData:t}=e.storeToRefs(e.useUtilityStore()),l=e.ref(e.GiftCardModuleState.InitialState),y=e.useStorage("freshBookingName","",void 0,{serializer:e.StorageSerializers.string}),u=e.useStorage("freshBookingEmail","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("freshBookingPhone","",void 0,{serializer:e.StorageSerializers.string}),m=e.ref(""),b=e.ref(1),B=e.ref(!0),S=e.ref(""),f=e.ref({base64:"",type:"",name:""}),n=e.ref(void 0),d=e.ref(0),s=e.ref(!1),h=e.ref(0),g=e.computed(()=>l.value===e.GiftCardModuleState.InitialState||l.value===e.GiftCardModuleState.WaitingForResponse),k=e.computed(()=>l.value===e.GiftCardModuleState.ReadyToPay),N=e.computed(()=>l.value===e.GiftCardModuleState.PaymentSuccess),v=e.computed(()=>{const r={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=t.value.places;return a&&a.forEach(_=>{r[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(r).filter(([,_])=>_.data.length>0))}),z=e.computed(()=>h.value!==0),C=e.computed(()=>{let r;if(z.value)r=v.value[h.value].data[0];else if(d.value!==0){const a=n.value,_=v.value[d.value].data;_.length===1?r=_[0]:a!==void 0&&_.forEach(i=>{String(i.id)===String(a)&&(r=i)})}return r}),w=e.computed(()=>!(!y.value||!u.value||!(c.value.length>=5)||!m.value||C.value===void 0)),x=e.computed(()=>!(l.value===e.GiftCardModuleState.InitialState&&s.value)),E=e.computed(()=>!!(l.value===e.GiftCardModuleState.WaitingForResponse&&s.value));async function P(){l.value=e.GiftCardModuleState.WaitingForResponse,s.value=!0,await e.axios.post("https://stage.hotel-service.freshbooking.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:t.value.currency.id,language:e.getUserLanguage(),amount:m.value,quantity:b.value,freeText:S.value,showPrice:B.value,contactName:y.value,contactEmail:u.value,contactPhone:c.value,imageBase64:e.b2a(f.value.base64),imageName:f.value.name,imageFormat:f.value.type,placeType:C.value?C.value.placeType:void 0,placeID:C.value?C.value.id:void 0},{headers:{Authorization:o.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.9"}}).then(r=>{if(s.value=!1,r.data.easyPayment){l.value=e.GiftCardModuleState.ReadyToPay;const a=new Reepay.EmbeddedCheckout(r.data.easyPayment.paymentID,{html_element:"fresh-booking-gift-card-payment"});a.addEventHandler(e.ReepayEvent.Accept,()=>{l.value=e.GiftCardModuleState.PaymentSuccess,p({message:e.i18n.t("alert.success.giftCardOrdered"),type:"success"})}),a.addEventHandler(e.ReepayEvent.Error,()=>{p({message:e.i18n.t("booking.other.errorMessage"),type:"warning"})})}else l.value=e.GiftCardModuleState.InitialState,p({message:`${e.i18n.t("booking.other.errorMessage")} (HTTP: ${r.status})`,type:"warning"})})}function M(r){h.value=r}return{moduleState:l,name:y,email:u,phone:c,value:m,remark:S,showValue:B,quantity:b,media:f,placeId:n,placeType:d,showFormPage:g,showPaymentPage:k,showConfirmationPage:N,places:v,hasFilledForm:w,hasForcedPlaceType:z,isWaitingForResponse:E,isMetaDataAvailable:x,orderGiftCard:P,initialize:M}}),I={class:"media-selector"},W=["accept"],D={class:"media-selector-wrapper"},L={class:"media-selector-tools"},A={key:0},H={key:1},j={key:2},O=["src"],K=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(p,{emit:o}){const t=p,{t:l}=e.useI18n(),{display:y}=e.useAlertStore(),u=e.ref(),c=e.computed(()=>t.modelValue.base64!=="");function m(n){o("update:modelValue",n)}function b(){m({base64:"",name:"",type:""}),u.value&&(u.value.value="")}function B(){u.value&&u.value.click()}function S(n,d){const[s,h]=[n.name,n.type],g=new FileReader;g.onload=function(k){if(k.target){const N=k.target.result;d({base64:N,name:s,type:h})}else y({message:l("imageUploadError"),type:"error"})},g.readAsDataURL(n)}async function f(){let n;(n=u.value.files)instanceof FileList&&S(n[0],m)}return(n,d)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",I,[e.createBaseVNode("input",{ref_key:"fileInput",ref:u,type:"file",class:"hidden",accept:n.validation,single:"",onChange:d[0]||(d[0]=s=>f())},null,40,W),e.createBaseVNode("div",D,[e.createBaseVNode("ul",L,[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(l)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:d[1]||(d[1]=s=>B())},null,8,["label","icon-color"])])),c.value?(e.openBlock(),e.createElementBlock("li",H,[e.createVNode(e.Clickable,{label:e.unref(l)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:d[2]||(d[2]=s=>B())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(l)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:d[3]||(d[3]=s=>b())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:c.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,O)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function U(p){const o=p;o.__i18n=o.__i18n||[],o.__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 U=="function"&&U(K);const Y={class:"gift-card-skeleton"},J={class:"gift-card-skeleton-form"},Q=e.defineComponent({__name:"GiftCardSkeleton",setup(p){return(o,t)=>(e.openBlock(),e.createElementBlock("div",Y,[e.createBaseVNode("div",J,[e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field),e.createVNode(V.Field,{"is-text-area":""}),e.createVNode(V.Element,{height:"44px"})])]))}});const X=e._export_sfc(Q,[["__scopeId","data-v-2600a731"]]),Z={key:0,id:"fresh-booking-gift-card-wrapper"},ee={id:"fresh-booking-gift-card-title"},te={id:"fresh-booking-gift-card-content"},oe={id:"fresh-booking-gift-card-payment"},le=["innerHTML"],ae={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"},ce={class:"fresh-booking-panel"},se={key:1,id:"fresh-booking-gift-card-remarks"},fe={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},pe={id:"fresh-booking-gift-card-recaptcha"},me=e.defineComponent({__name:"GiftCard",props:{accessToken:{},accentColor:{default:"#6ab1e6"},buttonBackground:{default:"#068175"},buttonBorder:{default:null},buttonBorderRadius:{default:"4px"},buttonColor:{default:"#FFF"},buttonFontFamily:{default:"inherit"},buttonFontSize:{default:"14px"},buttonTextTransform:{default:"uppercase"},buttonFontWeight:{default:"400"},fontColor:{default:"#3b3b3b"},fontFamily:{default:"inherit"},fontSize:{default:"16px"},fontWeight:{},grayColor:{default:"grey"},headerColor:{default:"#000"},headerFontSize:{},inputBackground:{default:"#fff"},inputBorder:{default:"1px solid rgba(0, 0, 0, 0.15)"},inputBorderRadius:{default:"0px"},inputBorderWidth:{default:"1px"},inputFontColor:{default:"#000000"},labelFontWeight:{default:"bold"},labelPadding:{default:"6px"},layout:{default:"minimal"},loadingColor:{default:"#000"},panelBackground:{default:"#ffffff"},panelBorder:{default:null},panelBorderRadius:{default:"8px"},panelPadding:{default:"24px"},placeType:{},successColor:{default:"green"}},setup(p){const o=p,{t}=e.useI18n(),{name:l,email:y,phone:u,value:c,remark:m,showValue:b,quantity:B,media:S,placeId:f,placeType:n,showFormPage:d,showPaymentPage:s,showConfirmationPage:h,places:g,hasFilledForm:k,hasForcedPlaceType:N,isWaitingForResponse:v,isMetaDataAvailable:z}=e.storeToRefs(G()),{initialize:C,orderGiftCard:w}=G(),{isRecaptchaEnabled:x,currency:E}=e.storeToRefs(e.useUtilityStore());e.useAlertStore();async function P(){await w()}e.watch(n,()=>{f.value=void 0}),e.onMounted(()=>{C(parseInt(o.placeType))});const M={"--accentColor":o.accentColor,"--buttonBackground":o.buttonBackground,"--buttonBorder":o.buttonBorder,"--buttonBorderRadius":o.buttonBorderRadius,"--buttonFontFamily":o.buttonFontFamily,"--buttonColor":o.buttonColor,"--buttonFontSize":o.buttonFontSize,"--buttonTextTransform":o.buttonTextTransform,"--buttonFontWeight":o.buttonFontWeight,"--fontColor":o.fontColor,"--fontFamily":o.fontFamily,"--fontSize":o.fontSize,"--fontWeight":o.fontWeight,"--grayColor":o.grayColor,"--headerColor":o.headerColor,"--headerFontSize":o.headerFontSize,"--inputBackground":o.inputBackground,"--inputBorder":o.inputBorder,"--inputBorderRadius":o.inputBorderRadius,"--inputFontColor":o.inputFontColor,"--inputBorderWidth":o.inputBorderWidth,"--labelFontWeight":o.labelFontWeight,"--labelPadding":o.labelPadding,"--loadingColor":o.loadingColor,"--panelBackground":o.panelBackground,"--panelBorder":o.panelBorder,"--panelBorderRadius":o.panelBorderRadius,"--panelPadding":o.panelPadding,"--successColor":o.successColor};return(r,a)=>{const _=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:M,"sticky-container":""},{default:e.withCtx(()=>[e.unref(z)?(e.openBlock(),e.createElementBlock("div",Z,[e.createBaseVNode("h4",ee,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.title")),1)]),e.createBaseVNode("div",te,[e.withDirectives(e.createBaseVNode("div",oe,null,512),[[e.vShow,e.unref(s)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(t)("giftCard.description")},null,8,le),e.createBaseVNode("form",null,[e.createVNode(R.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":a[0]||(a[0]=i=>e.isRef(l)?l.value=i:null),type:"text",name:"name",autocomplete:"name",label:e.unref(t)("giftCard.name"),icon:"user-alt","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(R.TextField,{modelValue:e.unref(y),"onUpdate:modelValue":a[1]||(a[1]=i=>e.isRef(y)?y.value=i:null),type:"email",name:"email",autocomplete:"email",label:e.unref(t)("giftCard.email"),icon:"at","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","icon-color","placeholder"]),e.createVNode(F.PhoneField,{modelValue:e.unref(u),"onUpdate:modelValue":a[2]||(a[2]=i=>e.isRef(u)?u.value=i:null),icon:"phone-office","icon-color":r.accentColor,label:e.unref(t)("giftCard.phone"),placeholder:e.unref(t)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","icon-color","label","placeholder"]),e.unref(N)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(g)?(e.openBlock(),e.createElementBlock("div",ne,[e.createBaseVNode("label",re,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(t)("giftCard.selectType")),1)]),e.createBaseVNode("div",ie,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(i,q)=>(e.openBlock(),e.createElementBlock("li",{key:q},[e.createVNode(F.Checkbox,{modelValue:e.unref(n),"onUpdate:modelValue":a[3]||(a[3]=$=>e.isRef(n)?n.value=$:null),type:"radio",name:"placeType",val:q,label:i.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(g)[e.unref(n)]&&e.unref(g)[e.unref(n)].data.length>1?(e.openBlock(),e.createBlock(R._sfc_main,{key:0,modelValue:e.unref(f),"onUpdate:modelValue":a[4]||(a[4]=i=>e.isRef(f)?f.value=i:null),placeholder:e.unref(t)("giftCard.selectPlacePlaceholder"),options:e.unref(g)[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(R.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":a[5]||(a[5]=i=>e.isRef(c)?c.value=i:null),type:"number",name:"value",label:e.unref(t)("giftCard.value"),icon:"money-bill","icon-color":r.accentColor,placeholder:e.unref(t)("giftCard.valuePlaceholder"),suffix:e.unref(E),required:""},null,8,["modelValue","label","icon-color","placeholder","suffix"]),e.createVNode(F.Checkbox,{modelValue:e.unref(b),"onUpdate:modelValue":a[6]||(a[6]=i=>e.isRef(b)?b.value=i:null),type:"checkbox",name:"showValue",label:e.unref(t)("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(t)("giftCard.thankYou")},null,8,de)],512),[[e.vShow,e.unref(h)]])]),r.layout!=="minimal"&&e.unref(d)?(e.openBlock(),e.createElementBlock("div",ue,[e.createBaseVNode("div",ce,[e.createVNode(e.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"is-loading":e.unref(v),"onUpdate:isLoading":a[9]||(a[9]=i=>e.isRef(v)?v.value=i:null),onClickEvent:P},null,8,["label","style","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(d)?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(R.TextField,{modelValue:e.unref(m),"onUpdate:modelValue":a[10]||(a[10]=i=>e.isRef(m)?m.value=i:null),type:"textarea",name:"remark",label:e.unref(t)("giftCard.remark"),icon:"info-circle","icon-color":r.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",fe,[e.createVNode(e.Clickable,{label:e.unref(t)("giftCard.orderGiftCard"),style:e.normalizeStyle({background:r.successColor}),"full-width":!0,disabled:!e.unref(k),"data-test":"orderGiftCard","is-loading":e.unref(v),"onUpdate:isLoading":a[11]||(a[11]=i=>e.isRef(v)?v.value=i:null),onClickEvent:P},null,8,["label","style","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",pe,[e.createVNode(F._sfc_main)],512),[[e.vShow,e.unref(x)]])])),[[_]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout"])]),fallback:e.withCtx(()=>[e.createVNode(X)]),_:1})}}});const ge=e._export_sfc(me,[["__scopeId","data-v-05b676e9"]]),ve=e.createPinia(),T=e.createApp({components:{GiftCard:ge}});T.use(ve);T.use(e.instance);T.use(F.StickyPlugin);T.use(F.install,{bootstrap:!1});T.mount("#konnectio-gift-card-app");
|
package/dist/gift-card.d.ts
CHANGED