@konnectio/core 4.0.16 → 4.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/ActionField-25ef64cf.js +163 -0
  2. package/dist/ActionField-25ef64cf.js.br +0 -0
  3. package/dist/ActionField-86389dfe.cjs +1 -0
  4. package/dist/AvailabilitySkeleton-3bb4b572.js +200 -0
  5. package/dist/AvailabilitySkeleton-3bb4b572.js.br +0 -0
  6. package/dist/AvailabilitySkeleton-a72464a1.cjs +1 -0
  7. package/dist/{DateField.vue_vue_type_style_index_0_lang-f7e8a940.js → DateField.vue_vue_type_style_index_0_lang-d1a56eb0.js} +707 -701
  8. package/dist/DateField.vue_vue_type_style_index_0_lang-d1a56eb0.js.br +0 -0
  9. package/dist/DateField.vue_vue_type_style_index_0_lang-f99302dc.cjs +5 -0
  10. package/dist/{Field-c0c88ff7.js → Field-03e6b847.js} +5 -5
  11. package/dist/Field-03e6b847.js.br +0 -0
  12. package/dist/{Field-91254e17.cjs → Field-a7c1ed62.cjs} +1 -1
  13. package/dist/NumberField.vue_vue_type_style_index_0_lang-94fa5765.js +194 -0
  14. package/dist/NumberField.vue_vue_type_style_index_0_lang-94fa5765.js.br +0 -0
  15. package/dist/NumberField.vue_vue_type_style_index_0_lang-a779a531.cjs +1 -0
  16. package/dist/SelectField.vue_vue_type_style_index_0_lang-03794d02.cjs +855 -0
  17. package/dist/SelectField.vue_vue_type_style_index_0_lang-51defa22.js +28643 -0
  18. package/dist/SelectField.vue_vue_type_style_index_0_lang-51defa22.js.br +0 -0
  19. package/dist/{ThankYou-266a1340.cjs → ThankYou-3ab29b45.cjs} +2 -2
  20. package/dist/{ThankYou-b353b8e0.js → ThankYou-f4945877.js} +11 -10
  21. package/dist/ThankYou-f4945877.js.br +0 -0
  22. package/dist/{_-f8481bc2.js → _-0787261e.js} +12 -12
  23. package/dist/_-0787261e.js.br +0 -0
  24. package/dist/{_-0a59e9b5.cjs → _-917dcead.cjs} +1 -1
  25. package/dist/{_commonjsHelpers-c5d32002.js → _commonjsHelpers-aeeeeb92.js} +2 -2
  26. package/dist/applyGiftCard-ba1da572.cjs +1 -0
  27. package/dist/applyGiftCard-f2282bd2.js +53 -0
  28. package/dist/applyGiftCard-f2282bd2.js.br +0 -0
  29. package/dist/availability.cjs +2 -2
  30. package/dist/availability.d.ts +2 -0
  31. package/dist/availability.js +66 -58
  32. package/dist/availability.js.br +0 -0
  33. package/dist/components/Clickable.vue.d.ts +1 -1
  34. package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
  35. package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
  36. package/dist/components/listings/Base.vue.d.ts +1 -1
  37. package/dist/components/listings/Hotel.vue.d.ts +1 -1
  38. package/dist/components/skeletons/HotelSkeleton.vue.d.ts +1 -1
  39. package/dist/entries/availability.d.ts +5 -1
  40. package/dist/event-07ba3a0e.cjs +1 -0
  41. package/dist/{event-1b2cce27.js → event-208206cf.js} +9 -9
  42. package/dist/event-208206cf.js.br +0 -0
  43. package/dist/event.cjs +1 -1
  44. package/dist/event.js +153 -153
  45. package/dist/event.js.br +0 -0
  46. package/dist/gift-card-validation.cjs +1 -1
  47. package/dist/gift-card-validation.js +27 -27
  48. package/dist/gift-card-validation.js.br +0 -0
  49. package/dist/gift-card.cjs +1 -1
  50. package/dist/gift-card.js +38 -38
  51. package/dist/gift-card.js.br +0 -0
  52. package/dist/hotel.cjs +5 -5
  53. package/dist/hotel.js +954 -957
  54. package/dist/hotel.js.br +0 -0
  55. package/dist/{index-1532370f.js → index-5e1ea6f0.js} +1 -2
  56. package/dist/index-5e1ea6f0.js.br +0 -0
  57. package/dist/index-7ef3288b.cjs +1 -0
  58. package/dist/layouts/Availability.vue.d.ts +7 -4
  59. package/dist/polyfill.cjs +1 -1
  60. package/dist/polyfill.js +2 -2
  61. package/dist/polyfill.js.br +0 -0
  62. package/dist/style.css +1 -1
  63. package/dist/style.css.br +0 -0
  64. package/package.json +9 -9
  65. package/dist/ActionField-3450fcba.cjs +0 -1
  66. package/dist/ActionField-c1dc7f3e.js +0 -101
  67. package/dist/ActionField-c1dc7f3e.js.br +0 -0
  68. package/dist/AvailabilitySkeleton-454ad0ec.js +0 -190
  69. package/dist/AvailabilitySkeleton-454ad0ec.js.br +0 -0
  70. package/dist/AvailabilitySkeleton-f0e12cb1.cjs +0 -1
  71. package/dist/DateField.vue_vue_type_style_index_0_lang-4f2f4c47.cjs +0 -5
  72. package/dist/DateField.vue_vue_type_style_index_0_lang-f7e8a940.js.br +0 -0
  73. package/dist/Field-c0c88ff7.js.br +0 -0
  74. package/dist/NumberField.vue_vue_type_script_setup_true_lang-1aefdd0e.cjs +0 -1
  75. package/dist/NumberField.vue_vue_type_script_setup_true_lang-aad02565.js +0 -116
  76. package/dist/NumberField.vue_vue_type_script_setup_true_lang-aad02565.js.br +0 -0
  77. package/dist/SelectField.vue_vue_type_style_index_0_lang-2d4e943b.cjs +0 -802
  78. package/dist/SelectField.vue_vue_type_style_index_0_lang-ab6da587.js +0 -19549
  79. package/dist/SelectField.vue_vue_type_style_index_0_lang-ab6da587.js.br +0 -0
  80. package/dist/TextField-2ccfa48b.cjs +0 -54
  81. package/dist/TextField-45a6d0f3.js +0 -9271
  82. package/dist/TextField-45a6d0f3.js.br +0 -0
  83. package/dist/ThankYou-b353b8e0.js.br +0 -0
  84. package/dist/_-f8481bc2.js.br +0 -0
  85. package/dist/event-0a73d10e.cjs +0 -1
  86. package/dist/event-1b2cce27.js.br +0 -0
  87. package/dist/index-1532370f.js.br +0 -0
  88. package/dist/index-4a6e0dad.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-2d4e943b.cjs"),c=require("./NumberField.vue_vue_type_script_setup_true_lang-1aefdd0e.cjs"),_=require("./ActionField-3450fcba.cjs");require("./_commonjsHelpers-6763f629.cjs");require("./TextField-2ccfa48b.cjs");const y=o=>(e.pushScopeId("data-v-5d5827dc"),o=o(),e.popScopeId(),o),N=["innerHTML"],B={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},m=y(()=>e.createBaseVNode("span",null,"Loading...",-1)),C=e.defineComponent({name:"GiftCardValidationLayout",__name:"GiftCardValidation",props:{accessToken:{},styling:{}},setup(o){const{t:a}=e.useI18n(),{voucher:l,isValid:u,amount:p,expirationDate:f,productName:V,isLoading:i}=e.storeToRefs(c.useApplyGiftCardStore()),{currency:g}=e.storeToRefs(e.useUtilityStore()),{apply:s}=c.useApplyGiftCardStore();return(d,t)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main$1,{id:"fresh-booking-gift-card-validation-module","access-token":d.accessToken,type:"gift-card",styling:d.styling},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:t[3]||(t[3]=e.withModifiers(n=>e.unref(s)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(a)("giftCardValidation.description")},null,8,N),e.createVNode(_.ActionField,{modelValue:e.unref(l),"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(l)?l.value=n:null),icon:"gift-card",label:e.unref(a)("booking.reservation.giftCardCode"),buttonLabel:e.unref(a)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":t[1]||(t[1]=n=>e.isRef(i)?i.value=n:null),onAction:t[2]||(t[2]=n=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(u)?(e.openBlock(),e.createElementBlock("table",B,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas",color:"header"})])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(V)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showPrice)(e.unref(p),e.unref(g))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showDate)(e.unref(f))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token","styling"])]),fallback:e.withCtx(()=>[m]),_:1}))}});const b=e._export_sfc(C,[["__scopeId","data-v-5d5827dc"]]),r=e.createApp({components:{GiftCardValidation:b}}),v=e.createPinia();r.use(v);r.use(e.instance);r.mount("#konnectio-gift-card-validation-app");module.exports=r;
1
+ "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-03794d02.cjs"),c=require("./applyGiftCard-ba1da572.cjs"),y=require("./ActionField-86389dfe.cjs");require("./_commonjsHelpers-6763f629.cjs");require("./NumberField.vue_vue_type_style_index_0_lang-a779a531.cjs");const _=o=>(e.pushScopeId("data-v-5d5827dc"),o=o(),e.popScopeId(),o),N=["innerHTML"],B={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},m=_(()=>e.createBaseVNode("span",null,"Loading...",-1)),C=e.defineComponent({name:"GiftCardValidationLayout",__name:"GiftCardValidation",props:{accessToken:{},styling:{}},setup(o){const{t:a}=e.useI18n(),{voucher:l,isValid:u,amount:p,expirationDate:f,productName:V,isLoading:i}=e.storeToRefs(c.useApplyGiftCardStore()),{currency:g}=e.storeToRefs(e.useUtilityStore()),{apply:s}=c.useApplyGiftCardStore();return(d,t)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main,{id:"fresh-booking-gift-card-validation-module","access-token":d.accessToken,type:"gift-card",styling:d.styling},{default:e.withCtx(()=>[e.createBaseVNode("form",{onSubmit:t[3]||(t[3]=e.withModifiers(n=>e.unref(s)(),["prevent"]))},[e.createBaseVNode("h4",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.title")),1)]),e.createBaseVNode("p",{innerHTML:e.unref(a)("giftCardValidation.description")},null,8,N),e.createVNode(y.ActionField,{modelValue:e.unref(l),"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(l)?l.value=n:null),icon:"gift-card",label:e.unref(a)("booking.reservation.giftCardCode"),buttonLabel:e.unref(a)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":t[1]||(t[1]=n=>e.isRef(i)?i.value=n:null),onAction:t[2]||(t[2]=n=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(u)?(e.openBlock(),e.createElementBlock("table",B,[e.createBaseVNode("thead",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.giftCard")),1),e.createVNode(e.Icon,{icon:"gift-card",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.balance")),1),e.createVNode(e.Icon,{icon:"money-bill",type:"fas",color:"header"})]),e.createBaseVNode("th",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(a)("giftCardValidation.expirationDate")),1),e.createVNode(e.Icon,{icon:"timer",type:"fas",color:"header"})])])]),e.createBaseVNode("tbody",null,[e.createBaseVNode("tr",null,[e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(V)),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showPrice)(e.unref(p),e.unref(g))),1)]),e.createBaseVNode("td",null,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(e.showDate)(e.unref(f))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token","styling"])]),fallback:e.withCtx(()=>[m]),_:1}))}});const b=e._export_sfc(C,[["__scopeId","data-v-5d5827dc"]]),r=e.createApp({components:{GiftCardValidation:b}}),h=e.createPinia();r.use(h);r.use(e.instance);r.mount("#konnectio-gift-card-validation-app");module.exports=r;
@@ -1,13 +1,13 @@
1
- import { h as L, z as S, s as g, a as X, k as _, l as w, w as u, m as l, x as a, A as o, n as t, B as y, q as x, D as p, F as A, G as B, t as G, H as I, J as D, K as N, L as T, M, _ as H, N as P, P as U, Q as $ } from "./SelectField.vue_vue_type_style_index_0_lang-ab6da587.js";
2
- import { u as b } from "./NumberField.vue_vue_type_script_setup_true_lang-aad02565.js";
3
- import { A as F } from "./ActionField-c1dc7f3e.js";
4
- import "./_commonjsHelpers-c5d32002.js";
5
- import "./TextField-45a6d0f3.js";
6
- const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z = {
1
+ import { h as L, t as S, s as g, a as X, o as _, p as I, w as p, q as l, l as a, v as o, x as t, y, j as w, I as u, z as x, A, k as B, B as G, C as D, D as T, F as N, G as H, _ as M, H as U, J as $, K as F } from "./SelectField.vue_vue_type_style_index_0_lang-51defa22.js";
2
+ import { u as C } from "./applyGiftCard-f2282bd2.js";
3
+ import { A as P } from "./ActionField-25ef64cf.js";
4
+ import "./_commonjsHelpers-aeeeeb92.js";
5
+ import "./NumberField.vue_vue_type_style_index_0_lang-94fa5765.js";
6
+ const R = (s) => (N("data-v-5d5827dc"), s = s(), H(), s), j = ["innerHTML"], q = {
7
7
  key: 0,
8
8
  id: "fresh-booking-gift-card-validation-resume",
9
9
  class: "fresh-booking-panel"
10
- }, E = /* @__PURE__ */ R(() => /* @__PURE__ */ a("span", null, "Loading...", -1)), J = /* @__PURE__ */ L({
10
+ }, z = /* @__PURE__ */ R(() => /* @__PURE__ */ a("span", null, "Loading...", -1)), E = /* @__PURE__ */ L({
11
11
  name: "GiftCardValidationLayout",
12
12
  __name: "GiftCardValidation",
13
13
  props: {
@@ -17,31 +17,31 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
17
17
  setup(s) {
18
18
  const { t: e } = S(), {
19
19
  voucher: r,
20
- isValid: C,
20
+ isValid: b,
21
21
  amount: V,
22
22
  expirationDate: h,
23
23
  productName: k,
24
24
  isLoading: d
25
- } = g(b()), { currency: v } = g(X()), { apply: f } = b();
26
- return (m, n) => (_(), w(N, null, {
27
- default: u(() => [
25
+ } = g(C()), { currency: v } = g(X()), { apply: f } = C();
26
+ return (m, n) => (_(), I(T, null, {
27
+ default: p(() => [
28
28
  l(D, {
29
29
  id: "fresh-booking-gift-card-validation-module",
30
30
  "access-token": m.accessToken,
31
31
  type: "gift-card",
32
32
  styling: m.styling
33
33
  }, {
34
- default: u(() => [
34
+ default: p(() => [
35
35
  a("form", {
36
- onSubmit: n[3] || (n[3] = I((i) => t(f)(), ["prevent"]))
36
+ onSubmit: n[3] || (n[3] = G((i) => t(f)(), ["prevent"]))
37
37
  }, [
38
38
  a("h4", null, [
39
39
  a("span", null, o(t(e)("giftCardValidation.title")), 1)
40
40
  ]),
41
41
  a("p", {
42
42
  innerHTML: t(e)("giftCardValidation.description")
43
- }, null, 8, q),
44
- l(F, {
43
+ }, null, 8, j),
44
+ l(P, {
45
45
  modelValue: t(r),
46
46
  "onUpdate:modelValue": n[0] || (n[0] = (i) => y(r) ? r.value = i : null),
47
47
  icon: "gift-card",
@@ -52,12 +52,12 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
52
52
  "onUpdate:isLoading": n[1] || (n[1] = (i) => y(d) ? d.value = i : null),
53
53
  onAction: n[2] || (n[2] = (i) => t(f)())
54
54
  }, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
55
- !t(d) && t(C) ? (_(), x("table", z, [
55
+ !t(d) && t(b) ? (_(), w("table", q, [
56
56
  a("thead", null, [
57
57
  a("tr", null, [
58
58
  a("th", null, [
59
59
  a("span", null, o(t(e)("giftCardValidation.giftCard")), 1),
60
- l(p, {
60
+ l(u, {
61
61
  icon: "gift-card",
62
62
  type: "fas",
63
63
  color: "header"
@@ -65,7 +65,7 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
65
65
  ]),
66
66
  a("th", null, [
67
67
  a("span", null, o(t(e)("giftCardValidation.balance")), 1),
68
- l(p, {
68
+ l(u, {
69
69
  icon: "money-bill",
70
70
  type: "fas",
71
71
  color: "header"
@@ -73,7 +73,7 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
73
73
  ]),
74
74
  a("th", null, [
75
75
  a("span", null, o(t(e)("giftCardValidation.expirationDate")), 1),
76
- l(p, {
76
+ l(u, {
77
77
  icon: "timer",
78
78
  type: "fas",
79
79
  color: "header"
@@ -87,29 +87,29 @@ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z =
87
87
  a("span", null, o(t(k)), 1)
88
88
  ]),
89
89
  a("td", null, [
90
- a("span", null, o(t(A)(t(V), t(v))), 1)
90
+ a("span", null, o(t(x)(t(V), t(v))), 1)
91
91
  ]),
92
92
  a("td", null, [
93
- a("span", null, o(t(B)(t(h))), 1)
93
+ a("span", null, o(t(A)(t(h))), 1)
94
94
  ])
95
95
  ])
96
96
  ])
97
- ])) : G("", !0)
97
+ ])) : B("", !0)
98
98
  ], 32)
99
99
  ]),
100
100
  _: 1
101
101
  }, 8, ["access-token", "styling"])
102
102
  ]),
103
- fallback: u(() => [
104
- E
103
+ fallback: p(() => [
104
+ z
105
105
  ]),
106
106
  _: 1
107
107
  }));
108
108
  }
109
109
  });
110
- const K = /* @__PURE__ */ H(J, [["__scopeId", "data-v-5d5827dc"]]), c = P({ components: { GiftCardValidation: K } }), Q = U();
111
- c.use(Q);
112
- c.use($);
110
+ const J = /* @__PURE__ */ M(E, [["__scopeId", "data-v-5d5827dc"]]), c = U({ components: { GiftCardValidation: J } }), K = $();
111
+ c.use(K);
112
+ c.use(F);
113
113
  c.mount("#konnectio-gift-card-validation-app");
114
114
  export {
115
115
  c as default
Binary file
@@ -1 +1 @@
1
- "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-2d4e943b.cjs"),V=require("./index-4a6e0dad.cjs"),$=require("./_-0a59e9b5.cjs"),P=require("./TextField-2ccfa48b.cjs"),x=require("./Field-91254e17.cjs");require("./_commonjsHelpers-6763f629.cjs");const U=e.defineStore("giftCard",()=>{e.useAlertStore();const{pay:y}=$.usePaymentStore(),{bearerToken:l,metaData:o}=e.storeToRefs(e.useUtilityStore()),t=e.ref(e.GiftCardModuleState.InitialState),p=e.useStorage("konnectio_name","",void 0,{serializer:e.StorageSerializers.string}),g=e.useStorage("konnectio_email","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("konnectio_phone","",void 0,{serializer:e.StorageSerializers.string}),f=e.ref(""),C=e.ref(1),w=e.ref(!0),v=e.ref(""),s=e.ref({base64:"",type:"",name:""}),k=e.ref(void 0),n=e.ref(0),i=e.ref(!1),d=e.ref(0),B=e.computed(()=>t.value===e.GiftCardModuleState.InitialState||t.value===e.GiftCardModuleState.WaitingForResponse),S=e.computed(()=>t.value===e.GiftCardModuleState.ReadyToPay),m=e.computed(()=>t.value===e.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=o.value.places;return a&&a.forEach(_=>{u[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(u).filter(([,_])=>_.data.length>0))}),R=e.computed(()=>d.value!==0),b=e.computed(()=>{let u;if(R.value)u=h.value[d.value].data[0];else if(n.value!==0){const a=k.value,_=h.value[n.value].data;_.length===1?u=_[0]:a!==void 0&&_.forEach(z=>{String(z.id)===String(a)&&(u=z)})}return u}),E=e.computed(()=>!(!p.value||!g.value||!(c.value.length>=5)||!f.value||b.value===void 0)),q=e.computed(()=>!(t.value===e.GiftCardModuleState.InitialState&&i.value)),T=e.computed(()=>!!(t.value===e.GiftCardModuleState.WaitingForResponse&&i.value));async function N(){t.value=e.GiftCardModuleState.WaitingForResponse,i.value=!0,await e.axios.post("https://stage.hotel-service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:f.value,quantity:C.value,freeText:v.value,showPrice:w.value,contactName:p.value,contactEmail:g.value,contactPhone:c.value,imageBase64:e.b2a(s.value.base64),imageName:s.value.name,imageFormat:s.value.type,placeType:b.value?b.value.placeType:void 0,placeID:b.value?b.value.id:void 0},{headers:{Authorization:l.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.16"}}).then(u=>{t.value=e.GiftCardModuleState.ReadyToPay,i.value=!1,y({callback:()=>console.log("Callback!"),response:u.data})})}function r(u){u&&(d.value=u)}return{moduleState:t,name:p,email:g,phone:c,value:f,remark:v,showValue:w,quantity:C,media:s,placeId:k,placeType:n,showFormPage:B,showPaymentPage:S,showConfirmationPage:m,places:h,hasFilledForm:E,hasForcedPlaceType:R,isWaitingForResponse:T,isMetaDataAvailable:q,orderGiftCard:N,initialize:r}}),M={class:"media-selector"},D=["accept"],I={class:"media-selector-wrapper"},L={class:"media-selector-tools"},A={key:0},W={key:1},j={key:2},H=["src"],O=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(y,{emit:l}){const o=l,t=y,{t:p}=e.useI18n(),{display:g}=e.useAlertStore(),c=e.ref(),f=e.computed(()=>t.modelValue.base64!=="");function C(n){o("update:modelValue",n)}function w(){C({base64:"",name:"",type:""}),c.value&&(c.value.value="")}function v(){c.value&&c.value.click()}function s(n,i){const[d,B]=[n.name,n.type],S=new FileReader;S.onload=function(m){if(m.target){const h=m.target.result;i({base64:h,name:d,type:B})}else g({message:p("imageUploadError"),type:"error"})},S.readAsDataURL(n)}async function k(){let n;(n=c.value.files)instanceof FileList&&s(n[0],C)}return(n,i)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",M,[e.createBaseVNode("input",{ref_key:"fileInput",ref:c,type:"file",class:"hidden",accept:n.validation,single:"",onChange:i[0]||(i[0]=d=>k())},null,40,D),e.createBaseVNode("div",I,[e.createBaseVNode("ul",L,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(p)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:i[1]||(i[1]=d=>v())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(e.Clickable,{label:e.unref(p)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:i[2]||(i[2]=d=>v())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(e.Clickable,{label:e.unref(p)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:i[3]||(i[3]=d=>w())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,H)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function G(y){const l=y;l.__i18n=l.__i18n||[],l.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload billede"])},removeFile:o=>{const{normalize:t}=o;return t(["Fjern billede"])},replaceFile:o=>{const{normalize:t}=o;return t(["Ersat billede"])},imageUploadError:o=>{const{normalize:t}=o;return t(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload image"])},removeFile:o=>{const{normalize:t}=o;return t(["Remove image"])},replaceFile:o=>{const{normalize:t}=o;return t(["Replace image"])},imageUploadError:o=>{const{normalize:t}=o;return t(["An error occurred under image upload!"])}}}})}typeof G=="function"&&G(O);const K={class:"gift-card-skeleton"},Y={class:"gift-card-skeleton-form"},J=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(l,o)=>(e.openBlock(),e.createElementBlock("div",K,[e.createBaseVNode("div",Y,[e.createVNode(x.Field),e.createVNode(x.Field),e.createVNode(x.Field),e.createVNode(x.Field),e.createVNode(x.Field,{"is-text-area":""}),e.createVNode($.Element,{height:"44px"})])]))}});const Q=e._export_sfc(J,[["__scopeId","data-v-2600a731"]]),X={key:0,id:"fresh-booking-gift-card-wrapper"},Z={id:"fresh-booking-gift-card-title"},ee={id:"fresh-booking-gift-card-content"},te={id:"fresh-booking-gift-card-payment"},ae=["innerHTML"],le={key:0},oe={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"],de={key:0,id:"fresh-booking-gift-card-order"},ce={class:"fresh-booking-panel"},se={key:1,id:"fresh-booking-gift-card-remarks"},ue={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},fe={id:"fresh-booking-gift-card-recaptcha"},pe=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:l}=e.useI18n(),{name:o,email:t,phone:p,value:g,remark:c,showValue:f,quantity:C,media:w,placeId:v,placeType:s,showFormPage:k,showPaymentPage:n,showConfirmationPage:i,places:d,hasFilledForm:B,hasForcedPlaceType:S,isWaitingForResponse:m,isMetaDataAvailable:h}=e.storeToRefs(U()),{initialize:R,orderGiftCard:b}=U(),{isRecaptchaEnabled:E,currency:q}=e.storeToRefs(e.useUtilityStore());async function T(){await b()}return e.watch(s,()=>{v.value=void 0}),e.onMounted(()=>{R()}),(N,r)=>{const u=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(e._sfc_main$1,{id:"fresh-booking-gift-card-module",type:"gift-card","access-token":N.accessToken,"data-layout":N.layout,styling:N.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(h)?(e.openBlock(),e.createElementBlock("div",X,[e.createBaseVNode("h4",Z,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.title")),1)]),e.createBaseVNode("div",ee,[e.withDirectives(e.createBaseVNode("div",te,[e.createVNode(V.CheckoutWindow)],512),[[e.vShow,e.unref(n)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(l)("giftCard.description")},null,8,ae),e.createBaseVNode("form",null,[e.createVNode(P.TextField,{modelValue:e.unref(o),"onUpdate:modelValue":r[0]||(r[0]=a=>e.isRef(o)?o.value=a:null),type:"text",name:"name",autocomplete:"name",label:e.unref(l)("giftCard.name"),icon:"user-alt",placeholder:e.unref(l)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(P.TextField,{modelValue:e.unref(t),"onUpdate:modelValue":r[1]||(r[1]=a=>e.isRef(t)?t.value=a:null),type:"email",name:"email",autocomplete:"email",label:e.unref(l)("giftCard.email"),icon:"at",placeholder:e.unref(l)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(V.PhoneField,{modelValue:e.unref(p),"onUpdate:modelValue":r[2]||(r[2]=a=>e.isRef(p)?p.value=a:null),icon:"phone-office",label:e.unref(l)("giftCard.phone"),placeholder:e.unref(l)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",oe,[e.createBaseVNode("label",ne,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.selectType")),1)]),e.createBaseVNode("div",re,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(a,_)=>(e.openBlock(),e.createElementBlock("li",{key:_},[e.createVNode(V.Checkbox,{modelValue:e.unref(s),"onUpdate:modelValue":r[3]||(r[3]=z=>e.isRef(s)?s.value=z:null),type:"radio",name:"placeType",val:_,label:a.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(d)[e.unref(s)]&&e.unref(d)[e.unref(s)].data.length>1?(e.openBlock(),e.createBlock(e._sfc_main,{key:0,modelValue:e.unref(v),"onUpdate:modelValue":r[4]||(r[4]=a=>e.isRef(v)?v.value=a:null),placeholder:e.unref(l)("giftCard.selectPlacePlaceholder"),options:e.unref(d)[e.unref(s)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))])),e.createVNode(P.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":r[5]||(r[5]=a=>e.isRef(g)?g.value=a:null),type:"number",name:"value",label:e.unref(l)("giftCard.value"),icon:"money-bill",placeholder:e.unref(l)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(V.Checkbox,{modelValue:e.unref(f),"onUpdate:modelValue":r[6]||(r[6]=a=>e.isRef(f)?f.value=a:null),type:"checkbox",name:"showValue",label:e.unref(l)("giftCard.showValue"),checked:e.unref(f)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(k)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(l)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(i)]])]),N.layout!=="minimal"&&e.unref(k)?(e.openBlock(),e.createElementBlock("div",de,[e.createBaseVNode("div",ce,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(m),"onUpdate:isLoading":r[9]||(r[9]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(P.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":r[10]||(r[10]=a=>e.isRef(c)?c.value=a:null),type:"textarea",name:"remark",label:e.unref(l)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(l)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(k)?e.withDirectives((e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(m),"onUpdate:isLoading":r[11]||(r[11]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",fe,[e.createVNode(V._sfc_main)],512),[[e.vShow,e.unref(E)]])])),[[u]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(Q)]),_:1})}}});const me=e._export_sfc(pe,[["__scopeId","data-v-e4aa1e4c"]]),_e=e.createPinia(),ve=e.zo(),F=e.createApp({components:{GiftCard:me}});F.use(_e);F.use(e.instance);F.use(ve);F.use(V.StickyPlugin);F.use(V.install,{bootstrap:!1});F.mount("#konnectio-gift-card-app");
1
+ "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-03794d02.cjs"),V=require("./index-7ef3288b.cjs"),G=require("./_-917dcead.cjs");require("./NumberField.vue_vue_type_style_index_0_lang-a779a531.cjs");const R=require("./Field-a7c1ed62.cjs");require("./_commonjsHelpers-6763f629.cjs");const q=e.defineStore("giftCard",()=>{e.useAlertStore();const{pay:y}=G.usePaymentStore(),{bearerToken:l,metaData:o}=e.storeToRefs(e.useUtilityStore()),t=e.ref(e.GiftCardModuleState.InitialState),p=e.useStorage("konnectio_name","",void 0,{serializer:e.StorageSerializers.string}),g=e.useStorage("konnectio_email","",void 0,{serializer:e.StorageSerializers.string}),c=e.useStorage("konnectio_phone","",void 0,{serializer:e.StorageSerializers.string}),f=e.ref(""),C=e.ref(1),w=e.ref(!0),v=e.ref(""),s=e.ref({base64:"",type:"",name:""}),k=e.ref(void 0),n=e.ref(0),i=e.ref(!1),d=e.ref(0),B=e.computed(()=>t.value===e.GiftCardModuleState.InitialState||t.value===e.GiftCardModuleState.WaitingForResponse),S=e.computed(()=>t.value===e.GiftCardModuleState.ReadyToPay),m=e.computed(()=>t.value===e.GiftCardModuleState.PaymentSuccess),h=e.computed(()=>{const u={1:{label:e.i18n.t("giftCard.hotelType"),data:[]},2:{label:e.i18n.t("giftCard.restaurantType"),data:[]}},a=o.value.places;return a&&a.forEach(_=>{u[_.placeType].data.push(_)}),Object.fromEntries(Object.entries(u).filter(([,_])=>_.data.length>0))}),x=e.computed(()=>d.value!==0),b=e.computed(()=>{let u;if(x.value)u=h.value[d.value].data[0];else if(n.value!==0){const a=k.value,_=h.value[n.value].data;_.length===1?u=_[0]:a!==void 0&&_.forEach(z=>{String(z.id)===String(a)&&(u=z)})}return u}),P=e.computed(()=>!(!p.value||!g.value||!(c.value.length>=5)||!f.value||b.value===void 0)),E=e.computed(()=>!(t.value===e.GiftCardModuleState.InitialState&&i.value)),T=e.computed(()=>!!(t.value===e.GiftCardModuleState.WaitingForResponse&&i.value));async function N(){t.value=e.GiftCardModuleState.WaitingForResponse,i.value=!0,await e.axios.post("https://stage.hotel-service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:o.value.currency.id,language:e.getUserLanguage(),amount:f.value,quantity:C.value,freeText:v.value,showPrice:w.value,contactName:p.value,contactEmail:g.value,contactPhone:c.value,imageBase64:e.b2a(s.value.base64),imageName:s.value.name,imageFormat:s.value.type,placeType:b.value?b.value.placeType:void 0,placeID:b.value?b.value.id:void 0},{headers:{Authorization:l.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.18"}}).then(u=>{t.value=e.GiftCardModuleState.ReadyToPay,i.value=!1,y({callback:()=>console.log("Callback!"),response:u.data})})}function r(u){u&&(d.value=u)}return{moduleState:t,name:p,email:g,phone:c,value:f,remark:v,showValue:w,quantity:C,media:s,placeId:k,placeType:n,showFormPage:B,showPaymentPage:S,showConfirmationPage:m,places:h,hasFilledForm:P,hasForcedPlaceType:x,isWaitingForResponse:T,isMetaDataAvailable:E,orderGiftCard:N,initialize:r}}),$={class:"media-selector"},M=["accept"],D={class:"media-selector-wrapper"},I={class:"media-selector-tools"},L={key:0},A={key:1},W={key:2},j=["src"],H=e.defineComponent({__name:"MediaSelector",props:{modelValue:{},validation:{default:"image/*"},iconColor:{default:"#000"},label:{},required:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(y,{emit:l}){const o=l,t=y,{t:p}=e.useI18n(),{display:g}=e.useAlertStore(),c=e.ref(),f=e.computed(()=>t.modelValue.base64!=="");function C(n){o("update:modelValue",n)}function w(){C({base64:"",name:"",type:""}),c.value&&(c.value.value="")}function v(){c.value&&c.value.click()}function s(n,i){const[d,B]=[n.name,n.type],S=new FileReader;S.onload=function(m){if(m.target){const h=m.target.result;i({base64:h,name:d,type:B})}else g({message:p("imageUploadError"),type:"error"})},S.readAsDataURL(n)}async function k(){let n;(n=c.value.files)instanceof FileList&&s(n[0],C)}return(n,i)=>(e.openBlock(),e.createBlock(e.InputField,{label:n.label,required:n.required,type:"media"},{default:e.withCtx(()=>[e.createBaseVNode("div",$,[e.createBaseVNode("input",{ref_key:"fileInput",ref:c,type:"file",class:"hidden",accept:n.validation,single:"",onChange:i[0]||(i[0]=d=>k())},null,40,M),e.createBaseVNode("div",D,[e.createBaseVNode("ul",I,[f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",L,[e.createVNode(e.Clickable,{label:e.unref(p)("uploadFile"),type:"button",icon:"upload","icon-color":n.iconColor,onClickEvent:i[1]||(i[1]=d=>v())},null,8,["label","icon-color"])])),f.value?(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(e.Clickable,{label:e.unref(p)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":n.iconColor,onClickEvent:i[2]||(i[2]=d=>v())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(e.Clickable,{label:e.unref(p)("removeFile"),type:"button",icon:"trash-alt","icon-color":n.iconColor,onClickEvent:i[3]||(i[3]=d=>w())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createBaseVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:f.value}])},[n.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.modelValue.base64},null,8,j)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function U(y){const l=y;l.__i18n=l.__i18n||[],l.__i18n.push({locale:"",resource:{da:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload billede"])},removeFile:o=>{const{normalize:t}=o;return t(["Fjern billede"])},replaceFile:o=>{const{normalize:t}=o;return t(["Ersat billede"])},imageUploadError:o=>{const{normalize:t}=o;return t(["Der skete en fejl under billede upload!"])}},en:{uploadFile:o=>{const{normalize:t}=o;return t(["Upload image"])},removeFile:o=>{const{normalize:t}=o;return t(["Remove image"])},replaceFile:o=>{const{normalize:t}=o;return t(["Replace image"])},imageUploadError:o=>{const{normalize:t}=o;return t(["An error occurred under image upload!"])}}}})}typeof U=="function"&&U(H);const O={class:"gift-card-skeleton"},K={class:"gift-card-skeleton-form"},Y=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(l,o)=>(e.openBlock(),e.createElementBlock("div",O,[e.createBaseVNode("div",K,[e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field),e.createVNode(R.Field,{"is-text-area":""}),e.createVNode(G.Element,{height:"44px"})])]))}});const J=e._export_sfc(Y,[["__scopeId","data-v-2600a731"]]),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"},te=["innerHTML"],ae={key:0},le={key:0,id:"fresh-booking-select-place-type"},oe={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"},ce={key:1,id:"fresh-booking-gift-card-remarks"},se={key:2,id:"fresh-booking-gift-card-order-minimal","sticky-side":"bottom"},ue={id:"fresh-booking-gift-card-recaptcha"},fe=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:l}=e.useI18n(),{name:o,email:t,phone:p,value:g,remark:c,showValue:f,quantity:C,media:w,placeId:v,placeType:s,showFormPage:k,showPaymentPage:n,showConfirmationPage:i,places:d,hasFilledForm:B,hasForcedPlaceType:S,isWaitingForResponse:m,isMetaDataAvailable:h}=e.storeToRefs(q()),{initialize:x,orderGiftCard:b}=q(),{isRecaptchaEnabled:P,currency:E}=e.storeToRefs(e.useUtilityStore());async function T(){await b()}return e.watch(s,()=>{v.value=void 0}),e.onMounted(()=>{x()}),(N,r)=>{const u=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",type:"gift-card","access-token":N.accessToken,"data-layout":N.layout,styling:N.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(h)?(e.openBlock(),e.createElementBlock("div",Q,[e.createBaseVNode("h4",X,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.title")),1)]),e.createBaseVNode("div",Z,[e.withDirectives(e.createBaseVNode("div",ee,[e.createVNode(V.CheckoutWindow)],512),[[e.vShow,e.unref(n)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(l)("giftCard.description")},null,8,te),e.createBaseVNode("form",null,[e.createVNode(e.TextField,{modelValue:e.unref(o),"onUpdate:modelValue":r[0]||(r[0]=a=>e.isRef(o)?o.value=a:null),type:"text",name:"name",autocomplete:"name",label:e.unref(l)("giftCard.name"),icon:"user-alt",placeholder:e.unref(l)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(e.TextField,{modelValue:e.unref(t),"onUpdate:modelValue":r[1]||(r[1]=a=>e.isRef(t)?t.value=a:null),type:"email",name:"email",autocomplete:"email",label:e.unref(l)("giftCard.email"),icon:"at",placeholder:e.unref(l)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(V.PhoneField,{modelValue:e.unref(p),"onUpdate:modelValue":r[2]||(r[2]=a=>e.isRef(p)?p.value=a:null),icon:"phone-office",label:e.unref(l)("giftCard.phone"),placeholder:e.unref(l)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",le,[e.createBaseVNode("label",oe,[e.createBaseVNode("span",null,e.toDisplayString(e.unref(l)("giftCard.selectType")),1)]),e.createBaseVNode("div",ne,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(a,_)=>(e.openBlock(),e.createElementBlock("li",{key:_},[e.createVNode(V.Checkbox,{modelValue:e.unref(s),"onUpdate:modelValue":r[3]||(r[3]=z=>e.isRef(s)?s.value=z:null),type:"radio",name:"placeType",val:_,label:a.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(d)[e.unref(s)]&&e.unref(d)[e.unref(s)].data.length>1?(e.openBlock(),e.createBlock(e._sfc_main$1,{key:0,modelValue:e.unref(v),"onUpdate:modelValue":r[4]||(r[4]=a=>e.isRef(v)?v.value=a:null),placeholder:e.unref(l)("giftCard.selectPlacePlaceholder"),options:e.unref(d)[e.unref(s)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))])),e.createVNode(e.TextField,{modelValue:e.unref(g),"onUpdate:modelValue":r[5]||(r[5]=a=>e.isRef(g)?g.value=a:null),type:"number",name:"value",label:e.unref(l)("giftCard.value"),icon:"money-bill",placeholder:e.unref(l)("giftCard.valuePlaceholder"),suffix:e.unref(E),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(V.Checkbox,{modelValue:e.unref(f),"onUpdate:modelValue":r[6]||(r[6]=a=>e.isRef(f)?f.value=a:null),type:"checkbox",name:"showValue",label:e.unref(l)("giftCard.showValue"),checked:e.unref(f)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(k)]]),e.withDirectives(e.createBaseVNode("div",null,[e.createBaseVNode("div",{innerHTML:e.unref(l)("giftCard.thankYou")},null,8,re)],512),[[e.vShow,e.unref(i)]])]),N.layout!=="minimal"&&e.unref(k)?(e.openBlock(),e.createElementBlock("div",ie,[e.createBaseVNode("div",de,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(B),"is-loading":e.unref(m),"onUpdate:isLoading":r[9]||(r[9]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(k)?(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(e.TextField,{modelValue:e.unref(c),"onUpdate:modelValue":r[10]||(r[10]=a=>e.isRef(c)?c.value=a:null),type:"textarea",name:"remark",label:e.unref(l)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(l)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(k)?e.withDirectives((e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.Clickable,{label:e.unref(l)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(B),"data-test":"orderGiftCard","is-loading":e.unref(m),"onUpdate:isLoading":r[11]||(r[11]=a=>e.isRef(m)?m.value=a:null),onClickEvent:T},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createBaseVNode("div",ue,[e.createVNode(V._sfc_main)],512),[[e.vShow,e.unref(P)]])])),[[u]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(e.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(J)]),_:1})}}});const pe=e._export_sfc(fe,[["__scopeId","data-v-e4aa1e4c"]]),me=e.createPinia(),_e=e.zo(),F=e.createApp({components:{GiftCard:pe}});F.use(me);F.use(e.instance);F.use(_e);F.use(V.StickyPlugin);F.use(V.install,{bootstrap:!1});F.mount("#konnectio-gift-card-app");
package/dist/gift-card.js CHANGED
@@ -1,9 +1,9 @@
1
- import { d as ue, u as ne, s as Y, a as ie, r as b, aa as w, b as J, c as F, i as Z, S as Q, e as ce, f as pe, ab as me, h as X, z as se, k as d, l as M, w as H, x as r, q as g, m as s, n as e, C as x, t as k, v as re, I as fe, _ as de, a0 as ve, o as ge, ac as he, A as ee, ad as B, ae as W, B as V, a1 as ye, a2 as _e, y as be, a3 as ae, J as ke, K as Ce, P as Ve, a7 as Fe, N as Pe, Q as Se } from "./SelectField.vue_vue_type_style_index_0_lang-ab6da587.js";
2
- import { a as we, P as ze, C as le, _ as Te, S as $e, i as Ue } from "./index-1532370f.js";
3
- import { u as qe, E as Re } from "./_-f8481bc2.js";
4
- import { T as j } from "./TextField-45a6d0f3.js";
5
- import { F as L } from "./Field-c0c88ff7.js";
6
- import "./_commonjsHelpers-c5d32002.js";
1
+ import { d as ue, u as ne, s as Y, a as ie, r as b, ab as w, b as J, c as F, i as Z, S as Q, e as ce, f as pe, ac as me, h as X, t as se, o as d, p as B, w as H, l as r, j as g, q as s, x as e, V as D, k, n as re, Q as fe, _ as de, a1 as ve, N as ge, ad as he, v as ee, ae as L, af as W, U as j, y as V, a2 as ye, a3 as _e, T as be, a4 as ae, C as ke, D as Ce, J as Ve, a8 as Fe, H as Pe, K as Se } from "./SelectField.vue_vue_type_style_index_0_lang-51defa22.js";
2
+ import { a as we, P as ze, C as le, _ as Te, S as $e, i as Ue } from "./index-5e1ea6f0.js";
3
+ import { u as qe, E as Re } from "./_-0787261e.js";
4
+ import "./NumberField.vue_vue_type_style_index_0_lang-94fa5765.js";
5
+ import { F as M } from "./Field-03e6b847.js";
6
+ import "./_commonjsHelpers-aeeeeb92.js";
7
7
  const te = ue("giftCard", () => {
8
8
  ne();
9
9
  const { pay: z } = qe(), { bearerToken: t, metaData: o } = Y(ie()), a = b(w.InitialState), h = J("konnectio_name", "", void 0, { serializer: Q.string }), P = J("konnectio_email", "", void 0, { serializer: Q.string }), p = J("konnectio_phone", "", void 0, { serializer: Q.string }), v = b(""), U = b(1), I = b(!0), C = b(""), m = b({
@@ -26,9 +26,9 @@ const te = ue("giftCard", () => {
26
26
  }), Object.fromEntries(
27
27
  Object.entries(f).filter(([, _]) => _.data.length > 0)
28
28
  );
29
- }), D = F(() => c.value !== 0), $ = F(() => {
29
+ }), x = F(() => c.value !== 0), $ = F(() => {
30
30
  let f;
31
- if (D.value)
31
+ if (x.value)
32
32
  f = T.value[c.value].data[0];
33
33
  else if (n.value !== 0) {
34
34
  const l = S.value, _ = T.value[n.value].data;
@@ -60,7 +60,7 @@ const te = ue("giftCard", () => {
60
60
  headers: {
61
61
  Authorization: t.value,
62
62
  Accept: "application/json",
63
- "Fresh-Booking-Ver": "4.0.16"
63
+ "Fresh-Booking-Ver": "4.0.18"
64
64
  }
65
65
  }).then((f) => {
66
66
  a.value = w.ReadyToPay, u.value = !1, z({
@@ -89,13 +89,13 @@ const te = ue("giftCard", () => {
89
89
  showConfirmationPage: y,
90
90
  places: T,
91
91
  hasFilledForm: K,
92
- hasForcedPlaceType: D,
92
+ hasForcedPlaceType: x,
93
93
  isWaitingForResponse: A,
94
94
  isMetaDataAvailable: O,
95
95
  orderGiftCard: E,
96
96
  initialize: i
97
97
  };
98
- }), Ee = { class: "media-selector" }, Ge = ["accept"], Ie = { class: "media-selector-wrapper" }, Be = { class: "media-selector-tools" }, Le = { key: 0 }, Me = { key: 1 }, xe = { key: 2 }, De = ["src"], Ae = /* @__PURE__ */ X({
98
+ }), Ee = { class: "media-selector" }, Ge = ["accept"], Ie = { class: "media-selector-wrapper" }, Le = { class: "media-selector-tools" }, Me = { key: 0 }, Be = { key: 1 }, De = { key: 2 }, xe = ["src"], Ae = /* @__PURE__ */ X({
99
99
  __name: "MediaSelector",
100
100
  props: {
101
101
  modelValue: {},
@@ -137,7 +137,7 @@ const te = ue("giftCard", () => {
137
137
  let n;
138
138
  (n = p.value.files) instanceof FileList && m(n[0], U);
139
139
  }
140
- return (n, u) => (d(), M(fe, {
140
+ return (n, u) => (d(), B(fe, {
141
141
  label: n.label,
142
142
  required: n.required,
143
143
  type: "media"
@@ -154,9 +154,9 @@ const te = ue("giftCard", () => {
154
154
  onChange: u[0] || (u[0] = (c) => S())
155
155
  }, null, 40, Ge),
156
156
  r("div", Ie, [
157
- r("ul", Be, [
158
- v.value ? k("", !0) : (d(), g("li", Le, [
159
- s(x, {
157
+ r("ul", Le, [
158
+ v.value ? k("", !0) : (d(), g("li", Me, [
159
+ s(D, {
160
160
  label: e(h)("uploadFile"),
161
161
  type: "button",
162
162
  icon: "upload",
@@ -164,8 +164,8 @@ const te = ue("giftCard", () => {
164
164
  onClickEvent: u[1] || (u[1] = (c) => C())
165
165
  }, null, 8, ["label", "icon-color"])
166
166
  ])),
167
- v.value ? (d(), g("li", Me, [
168
- s(x, {
167
+ v.value ? (d(), g("li", Be, [
168
+ s(D, {
169
169
  label: e(h)("replaceFile"),
170
170
  type: "button",
171
171
  icon: "repeat-alt",
@@ -173,8 +173,8 @@ const te = ue("giftCard", () => {
173
173
  onClickEvent: u[2] || (u[2] = (c) => C())
174
174
  }, null, 8, ["label", "icon-color"])
175
175
  ])) : k("", !0),
176
- v.value ? (d(), g("li", xe, [
177
- s(x, {
176
+ v.value ? (d(), g("li", De, [
177
+ s(D, {
178
178
  label: e(h)("removeFile"),
179
179
  type: "button",
180
180
  icon: "trash-alt",
@@ -192,7 +192,7 @@ const te = ue("giftCard", () => {
192
192
  n.modelValue ? (d(), g("img", {
193
193
  key: 0,
194
194
  src: n.modelValue.base64
195
- }, null, 8, De)) : k("", !0)
195
+ }, null, 8, xe)) : k("", !0)
196
196
  ], 2)
197
197
  ])
198
198
  ])
@@ -251,11 +251,11 @@ const Ne = { class: "gift-card-skeleton" }, We = { class: "gift-card-skeleton-fo
251
251
  setup(z) {
252
252
  return (t, o) => (d(), g("div", Ne, [
253
253
  r("div", We, [
254
- s(L),
255
- s(L),
256
- s(L),
257
- s(L),
258
- s(L, { "is-text-area": "" }),
254
+ s(M),
255
+ s(M),
256
+ s(M),
257
+ s(M),
258
+ s(M, { "is-text-area": "" }),
259
259
  s(Re, { height: "44px" })
260
260
  ])
261
261
  ]));
@@ -308,17 +308,17 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
308
308
  hasForcedPlaceType: R,
309
309
  isWaitingForResponse: y,
310
310
  isMetaDataAvailable: T
311
- } = Y(te()), { initialize: D, orderGiftCard: $ } = te(), { isRecaptchaEnabled: K, currency: O } = Y(ie());
311
+ } = Y(te()), { initialize: x, orderGiftCard: $ } = te(), { isRecaptchaEnabled: K, currency: O } = Y(ie());
312
312
  async function A() {
313
313
  await $();
314
314
  }
315
315
  return ve(m, () => {
316
316
  C.value = void 0;
317
317
  }), ge(() => {
318
- D();
318
+ x();
319
319
  }), (E, i) => {
320
320
  const f = he("sticky");
321
- return d(), M(Ce, null, {
321
+ return d(), B(Ce, null, {
322
322
  default: H(() => [
323
323
  s(ke, {
324
324
  id: "fresh-booking-gift-card-module",
@@ -334,12 +334,12 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
334
334
  r("span", null, ee(e(t)("giftCard.title")), 1)
335
335
  ]),
336
336
  r("div", Je, [
337
- B(r("div", Qe, [
337
+ L(r("div", Qe, [
338
338
  s(we)
339
339
  ], 512), [
340
340
  [W, e(n)]
341
341
  ]),
342
- B(r("div", null, [
342
+ L(r("div", null, [
343
343
  r("p", {
344
344
  id: "fresh-booking-gift-card-description",
345
345
  innerHTML: e(t)("giftCard.description")
@@ -393,7 +393,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
393
393
  }, null, 8, ["modelValue", "val", "label"])
394
394
  ]))), 128))
395
395
  ]),
396
- e(c)[e(m)] && e(c)[e(m)].data.length > 1 ? (d(), M(be, {
396
+ e(c)[e(m)] && e(c)[e(m)].data.length > 1 ? (d(), B(be, {
397
397
  key: 0,
398
398
  modelValue: e(C),
399
399
  "onUpdate:modelValue": i[4] || (i[4] = (l) => V(C) ? C.value = l : null),
@@ -404,7 +404,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
404
404
  required: ""
405
405
  }, null, 8, ["modelValue", "placeholder", "options"])) : k("", !0)
406
406
  ])
407
- ])) : (d(), M(ae, { key: 1 }))
407
+ ])) : (d(), B(ae, { key: 1 }))
408
408
  ])),
409
409
  s(j, {
410
410
  modelValue: e(P),
@@ -431,7 +431,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
431
431
  ], 512), [
432
432
  [W, e(S)]
433
433
  ]),
434
- B(r("div", null, [
434
+ L(r("div", null, [
435
435
  r("div", {
436
436
  innerHTML: e(t)("giftCard.thankYou")
437
437
  }, null, 8, la)
@@ -441,7 +441,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
441
441
  ]),
442
442
  E.layout !== "minimal" && e(S) ? (d(), g("div", ta, [
443
443
  r("div", oa, [
444
- s(x, {
444
+ s(D, {
445
445
  label: e(t)("giftCard.orderGiftCard"),
446
446
  "full-width": !0,
447
447
  disabled: !e(q),
@@ -462,8 +462,8 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
462
462
  placeholder: e(t)("giftCard.remarkPlaceholder")
463
463
  }, null, 8, ["modelValue", "label", "placeholder"])
464
464
  ])) : k("", !0),
465
- e(S) ? B((d(), g("div", ia, [
466
- s(x, {
465
+ e(S) ? L((d(), g("div", ia, [
466
+ s(D, {
467
467
  label: e(t)("giftCard.orderGiftCard"),
468
468
  "full-width": !0,
469
469
  disabled: !e(q),
@@ -472,7 +472,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
472
472
  "onUpdate:isLoading": i[11] || (i[11] = (l) => V(y) ? y.value = l : null),
473
473
  onClickEvent: A
474
474
  }, null, 8, ["label", "disabled", "is-loading"]),
475
- B(r("div", sa, [
475
+ L(r("div", sa, [
476
476
  s(Te)
477
477
  ], 512), [
478
478
  [W, e(K)]
@@ -480,7 +480,7 @@ const He = /* @__PURE__ */ de(je, [["__scopeId", "data-v-2600a731"]]), Ke = {
480
480
  ])), [
481
481
  [f]
482
482
  ]) : k("", !0)
483
- ])) : (d(), M(ae, { key: 1 }))
483
+ ])) : (d(), B(ae, { key: 1 }))
484
484
  ]),
485
485
  _: 1
486
486
  }, 8, ["access-token", "data-layout", "styling"])
Binary file