@konnectio/core 4.0.17 → 4.0.19

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 (90) hide show
  1. package/dist/ActionField-4cb5a734.js +100 -0
  2. package/dist/ActionField-4cb5a734.js.br +0 -0
  3. package/dist/ActionField-656d204b.cjs +1 -0
  4. package/dist/AvailabilitySkeleton-00f7fc68.js +223 -0
  5. package/dist/AvailabilitySkeleton-00f7fc68.js.br +0 -0
  6. package/dist/AvailabilitySkeleton-8fc17074.cjs +1 -0
  7. package/dist/{DateField.vue_vue_type_style_index_0_lang-d5a1efd5.js → DateField.vue_vue_type_style_index_0_lang-36b7ee9e.js} +2323 -2323
  8. package/dist/DateField.vue_vue_type_style_index_0_lang-36b7ee9e.js.br +0 -0
  9. package/dist/DateField.vue_vue_type_style_index_0_lang-ef9c83d6.cjs +5 -0
  10. package/dist/Field-4283160f.cjs +1 -0
  11. package/dist/{Field-7137ef85.js → Field-e1af1bbc.js} +11 -12
  12. package/dist/Field-e1af1bbc.js.br +0 -0
  13. package/dist/NumberField.vue_vue_type_script_setup_true_lang-a517b062.cjs +1 -0
  14. package/dist/NumberField.vue_vue_type_script_setup_true_lang-eb9876fc.js +116 -0
  15. package/dist/NumberField.vue_vue_type_script_setup_true_lang-eb9876fc.js.br +0 -0
  16. package/dist/SelectField.vue_vue_type_style_index_0_lang-1c999286.js +28840 -0
  17. package/dist/SelectField.vue_vue_type_style_index_0_lang-1c999286.js.br +0 -0
  18. package/dist/SelectField.vue_vue_type_style_index_0_lang-af7c016a.cjs +855 -0
  19. package/dist/ThankYou-01175a37.cjs +54 -0
  20. package/dist/{ThankYou-433bd249.js → ThankYou-0860a0ab.js} +436 -430
  21. package/dist/ThankYou-0860a0ab.js.br +0 -0
  22. package/dist/{_-048b5217.js → _-6db0e1a4.js} +16 -17
  23. package/dist/_-6db0e1a4.js.br +0 -0
  24. package/dist/_-b5842a21.cjs +1 -0
  25. package/dist/_commonjsHelpers-6763f629.cjs +1 -0
  26. package/dist/_commonjsHelpers-aeeeeb92.js +30 -0
  27. package/dist/assets/typescript/mixins.d.ts +1 -0
  28. package/dist/availability.cjs +2 -2
  29. package/dist/availability.js +30 -31
  30. package/dist/availability.js.br +0 -0
  31. package/dist/components/forms/HotelAvailabilityForm.vue.d.ts +1 -1
  32. package/dist/components/forms/MultiStepForm.vue.d.ts +1 -1
  33. package/dist/components/forms/ReservationForm.vue.d.ts +1 -1
  34. package/dist/components/listings/Base.vue.d.ts +1 -1
  35. package/dist/components/listings/Hotel.vue.d.ts +1 -1
  36. package/dist/{event-3ef40faf.js → event-52fce8cc.js} +29 -30
  37. package/dist/event-52fce8cc.js.br +0 -0
  38. package/dist/event-c717dc05.cjs +1 -0
  39. package/dist/event.cjs +1 -1
  40. package/dist/event.js +233 -235
  41. package/dist/event.js.br +0 -0
  42. package/dist/gift-card-validation.cjs +1 -1
  43. package/dist/gift-card-validation.js +53 -55
  44. package/dist/gift-card-validation.js.br +0 -0
  45. package/dist/gift-card.cjs +1 -1
  46. package/dist/gift-card.js +186 -188
  47. package/dist/gift-card.js.br +0 -0
  48. package/dist/hotel.cjs +5 -5
  49. package/dist/hotel.js +1462 -1328
  50. package/dist/hotel.js.br +0 -0
  51. package/dist/{index-36d9ed45.js → index-4aff7f4e.js} +14 -16
  52. package/dist/index-4aff7f4e.js.br +0 -0
  53. package/dist/index-5d223c1a.cjs +1 -0
  54. package/dist/polyfill.cjs +2 -2
  55. package/dist/polyfill.js +2 -2
  56. package/dist/polyfill.js.br +0 -0
  57. package/dist/store/hotel.d.ts +4 -1
  58. package/dist/style.css +1 -1
  59. package/dist/style.css.br +0 -0
  60. package/dist/types/index.d.ts +1 -0
  61. package/package.json +1 -1
  62. package/dist/ActionField-3184bffd.cjs +0 -1
  63. package/dist/ActionField-82ef422e.js +0 -164
  64. package/dist/ActionField-82ef422e.js.br +0 -0
  65. package/dist/AvailabilitySkeleton-528d40ef.cjs +0 -1
  66. package/dist/AvailabilitySkeleton-ec092c09.js +0 -203
  67. package/dist/AvailabilitySkeleton-ec092c09.js.br +0 -0
  68. package/dist/DateField.vue_vue_type_style_index_0_lang-5692c5b2.cjs +0 -5
  69. package/dist/DateField.vue_vue_type_style_index_0_lang-d5a1efd5.js.br +0 -0
  70. package/dist/Field-7137ef85.js.br +0 -0
  71. package/dist/Field-b1690485.cjs +0 -1
  72. package/dist/NumberField.vue_vue_type_style_index_0_lang-8c28c1dd.cjs +0 -1
  73. package/dist/NumberField.vue_vue_type_style_index_0_lang-eebde8cd.js +0 -194
  74. package/dist/NumberField.vue_vue_type_style_index_0_lang-eebde8cd.js.br +0 -0
  75. package/dist/SelectField.vue_vue_type_style_index_0_lang-5e1192e9.js +0 -19741
  76. package/dist/SelectField.vue_vue_type_style_index_0_lang-5e1192e9.js.br +0 -0
  77. package/dist/SelectField.vue_vue_type_style_index_0_lang-c0715ca3.cjs +0 -850
  78. package/dist/ThankYou-433bd249.js.br +0 -0
  79. package/dist/ThankYou-817b93d0.cjs +0 -54
  80. package/dist/_-048b5217.js.br +0 -0
  81. package/dist/_-120d9090.cjs +0 -1
  82. package/dist/_commonjsHelpers-10dfc225.js +0 -8
  83. package/dist/_commonjsHelpers-87b0abe8.cjs +0 -1
  84. package/dist/applyGiftCard-45cf782e.js +0 -54
  85. package/dist/applyGiftCard-45cf782e.js.br +0 -0
  86. package/dist/applyGiftCard-f1b620cc.cjs +0 -1
  87. package/dist/event-3ef40faf.js.br +0 -0
  88. package/dist/event-d531df9d.cjs +0 -1
  89. package/dist/index-36d9ed45.js.br +0 -0
  90. package/dist/index-8309eba2.cjs +0 -1
package/dist/event.js.br CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),t=require("./SelectField.vue_vue_type_style_index_0_lang-c0715ca3.cjs"),u=require("./applyGiftCard-f1b620cc.cjs"),y=require("./ActionField-3184bffd.cjs");require("./_commonjsHelpers-87b0abe8.cjs");require("./NumberField.vue_vue_type_style_index_0_lang-8c28c1dd.cjs");const _=l=>(e.pushScopeId("data-v-5d5827dc"),l=l(),e.popScopeId(),l),N=["innerHTML"],E={key:0,id:"fresh-booking-gift-card-validation-resume",class:"fresh-booking-panel"},C=_(()=>e.createElementVNode("span",null,"Loading...",-1)),b=e.defineComponent({name:"GiftCardValidationLayout",__name:"GiftCardValidation",props:{accessToken:{},styling:{}},setup(l){const{t:o}=t.useI18n(),{voucher:d,isValid:p,amount:f,expirationDate:m,productName:V,isLoading:i}=t.storeToRefs(u.useApplyGiftCardStore()),{currency:g}=t.storeToRefs(t.useUtilityStore()),{apply:s}=u.useApplyGiftCardStore();return(c,n)=>(e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(t._sfc_main,{id:"fresh-booking-gift-card-validation-module","access-token":c.accessToken,type:"gift-card",styling:c.styling},{default:e.withCtx(()=>[e.createElementVNode("form",{onSubmit:n[3]||(n[3]=e.withModifiers(a=>e.unref(s)(),["prevent"]))},[e.createElementVNode("h4",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("giftCardValidation.title")),1)]),e.createElementVNode("p",{innerHTML:e.unref(o)("giftCardValidation.description")},null,8,N),e.createVNode(y.ActionField,{modelValue:e.unref(d),"onUpdate:modelValue":n[0]||(n[0]=a=>e.isRef(d)?d.value=a:null),icon:"gift-card",label:e.unref(o)("booking.reservation.giftCardCode"),buttonLabel:e.unref(o)("giftCardValidation.submitButton"),placeholder:"XXXXXXXX","is-loading":e.unref(i),"onUpdate:isLoading":n[1]||(n[1]=a=>e.isRef(i)?i.value=a:null),onAction:n[2]||(n[2]=a=>e.unref(s)())},null,8,["modelValue","label","buttonLabel","is-loading"]),!e.unref(i)&&e.unref(p)?(e.openBlock(),e.createElementBlock("table",E,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("giftCardValidation.giftCard")),1),e.createVNode(t.Icon,{icon:"gift-card",type:"fas",color:"header"})]),e.createElementVNode("th",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("giftCardValidation.balance")),1),e.createVNode(t.Icon,{icon:"money-bill",type:"fas",color:"header"})]),e.createElementVNode("th",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(o)("giftCardValidation.expirationDate")),1),e.createVNode(t.Icon,{icon:"timer",type:"fas",color:"header"})])])]),e.createElementVNode("tbody",null,[e.createElementVNode("tr",null,[e.createElementVNode("td",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(V)),1)]),e.createElementVNode("td",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(t.showPrice)(e.unref(f),e.unref(g))),1)]),e.createElementVNode("td",null,[e.createElementVNode("span",null,e.toDisplayString(e.unref(t.showDate)(e.unref(m))),1)])])])])):e.createCommentVNode("",!0)],32)]),_:1},8,["access-token","styling"])]),fallback:e.withCtx(()=>[C]),_:1}))}});const h=t._export_sfc(b,[["__scopeId","data-v-5d5827dc"]]),r=e.createApp({components:{GiftCardValidation:h}}),v=t.createPinia();r.use(v);r.use(t.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-af7c016a.cjs"),c=require("./NumberField.vue_vue_type_script_setup_true_lang-a517b062.cjs"),_=require("./ActionField-656d204b.cjs");require("./_commonjsHelpers-6763f629.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,14 +1,12 @@
1
- import { defineComponent as L, openBlock as g, createBlock as S, Suspense as X, withCtx as p, createVNode as l, createElementVNode as t, withModifiers as I, unref as a, toDisplayString as o, isRef as _, createElementBlock as w, createCommentVNode as x, pushScopeId as A, popScopeId as G, createApp as T } from "vue";
2
- import { f as B, s as y, a as D, h as N, I as u, j as M, k as U, _ as $, l as E, m as H } from "./SelectField.vue_vue_type_style_index_0_lang-5e1192e9.js";
3
- import { u as b } from "./applyGiftCard-45cf782e.js";
4
- import { A as P } from "./ActionField-82ef422e.js";
5
- import "./_commonjsHelpers-10dfc225.js";
6
- import "./NumberField.vue_vue_type_style_index_0_lang-eebde8cd.js";
7
- const R = (s) => (A("data-v-5d5827dc"), s = s(), G(), s), j = ["innerHTML"], F = {
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-1c999286.js";
2
+ import { u as b } from "./NumberField.vue_vue_type_script_setup_true_lang-eb9876fc.js";
3
+ import { A as F } from "./ActionField-4cb5a734.js";
4
+ import "./_commonjsHelpers-aeeeeb92.js";
5
+ const R = (s) => (T("data-v-5d5827dc"), s = s(), M(), s), q = ["innerHTML"], z = {
8
6
  key: 0,
9
7
  id: "fresh-booking-gift-card-validation-resume",
10
8
  class: "fresh-booking-panel"
11
- }, q = /* @__PURE__ */ R(() => /* @__PURE__ */ t("span", null, "Loading...", -1)), z = /* @__PURE__ */ L({
9
+ }, E = /* @__PURE__ */ R(() => /* @__PURE__ */ a("span", null, "Loading...", -1)), J = /* @__PURE__ */ L({
12
10
  name: "GiftCardValidationLayout",
13
11
  __name: "GiftCardValidation",
14
12
  props: {
@@ -16,65 +14,65 @@ const R = (s) => (A("data-v-5d5827dc"), s = s(), G(), s), j = ["innerHTML"], F =
16
14
  styling: {}
17
15
  },
18
16
  setup(s) {
19
- const { t: e } = B(), {
17
+ const { t: e } = S(), {
20
18
  voucher: r,
21
19
  isValid: C,
22
20
  amount: V,
23
21
  expirationDate: h,
24
22
  productName: k,
25
23
  isLoading: d
26
- } = y(b()), { currency: v } = y(D()), { apply: f } = b();
27
- return (m, n) => (g(), S(X, null, {
28
- default: p(() => [
29
- l(N, {
24
+ } = g(b()), { currency: v } = g(X()), { apply: f } = b();
25
+ return (m, n) => (_(), w(N, null, {
26
+ default: u(() => [
27
+ l(D, {
30
28
  id: "fresh-booking-gift-card-validation-module",
31
29
  "access-token": m.accessToken,
32
30
  type: "gift-card",
33
31
  styling: m.styling
34
32
  }, {
35
- default: p(() => [
36
- t("form", {
37
- onSubmit: n[3] || (n[3] = I((i) => a(f)(), ["prevent"]))
33
+ default: u(() => [
34
+ a("form", {
35
+ onSubmit: n[3] || (n[3] = I((i) => t(f)(), ["prevent"]))
38
36
  }, [
39
- t("h4", null, [
40
- t("span", null, o(a(e)("giftCardValidation.title")), 1)
37
+ a("h4", null, [
38
+ a("span", null, o(t(e)("giftCardValidation.title")), 1)
41
39
  ]),
42
- t("p", {
43
- innerHTML: a(e)("giftCardValidation.description")
44
- }, null, 8, j),
45
- l(P, {
46
- modelValue: a(r),
47
- "onUpdate:modelValue": n[0] || (n[0] = (i) => _(r) ? r.value = i : null),
40
+ a("p", {
41
+ innerHTML: t(e)("giftCardValidation.description")
42
+ }, null, 8, q),
43
+ l(F, {
44
+ modelValue: t(r),
45
+ "onUpdate:modelValue": n[0] || (n[0] = (i) => y(r) ? r.value = i : null),
48
46
  icon: "gift-card",
49
- label: a(e)("booking.reservation.giftCardCode"),
50
- buttonLabel: a(e)("giftCardValidation.submitButton"),
47
+ label: t(e)("booking.reservation.giftCardCode"),
48
+ buttonLabel: t(e)("giftCardValidation.submitButton"),
51
49
  placeholder: "XXXXXXXX",
52
- "is-loading": a(d),
53
- "onUpdate:isLoading": n[1] || (n[1] = (i) => _(d) ? d.value = i : null),
54
- onAction: n[2] || (n[2] = (i) => a(f)())
50
+ "is-loading": t(d),
51
+ "onUpdate:isLoading": n[1] || (n[1] = (i) => y(d) ? d.value = i : null),
52
+ onAction: n[2] || (n[2] = (i) => t(f)())
55
53
  }, null, 8, ["modelValue", "label", "buttonLabel", "is-loading"]),
56
- !a(d) && a(C) ? (g(), w("table", F, [
57
- t("thead", null, [
58
- t("tr", null, [
59
- t("th", null, [
60
- t("span", null, o(a(e)("giftCardValidation.giftCard")), 1),
61
- l(u, {
54
+ !t(d) && t(C) ? (_(), x("table", z, [
55
+ a("thead", null, [
56
+ a("tr", null, [
57
+ a("th", null, [
58
+ a("span", null, o(t(e)("giftCardValidation.giftCard")), 1),
59
+ l(p, {
62
60
  icon: "gift-card",
63
61
  type: "fas",
64
62
  color: "header"
65
63
  })
66
64
  ]),
67
- t("th", null, [
68
- t("span", null, o(a(e)("giftCardValidation.balance")), 1),
69
- l(u, {
65
+ a("th", null, [
66
+ a("span", null, o(t(e)("giftCardValidation.balance")), 1),
67
+ l(p, {
70
68
  icon: "money-bill",
71
69
  type: "fas",
72
70
  color: "header"
73
71
  })
74
72
  ]),
75
- t("th", null, [
76
- t("span", null, o(a(e)("giftCardValidation.expirationDate")), 1),
77
- l(u, {
73
+ a("th", null, [
74
+ a("span", null, o(t(e)("giftCardValidation.expirationDate")), 1),
75
+ l(p, {
78
76
  icon: "timer",
79
77
  type: "fas",
80
78
  color: "header"
@@ -82,35 +80,35 @@ const R = (s) => (A("data-v-5d5827dc"), s = s(), G(), s), j = ["innerHTML"], F =
82
80
  ])
83
81
  ])
84
82
  ]),
85
- t("tbody", null, [
86
- t("tr", null, [
87
- t("td", null, [
88
- t("span", null, o(a(k)), 1)
83
+ a("tbody", null, [
84
+ a("tr", null, [
85
+ a("td", null, [
86
+ a("span", null, o(t(k)), 1)
89
87
  ]),
90
- t("td", null, [
91
- t("span", null, o(a(M)(a(V), a(v))), 1)
88
+ a("td", null, [
89
+ a("span", null, o(t(A)(t(V), t(v))), 1)
92
90
  ]),
93
- t("td", null, [
94
- t("span", null, o(a(U)(a(h))), 1)
91
+ a("td", null, [
92
+ a("span", null, o(t(B)(t(h))), 1)
95
93
  ])
96
94
  ])
97
95
  ])
98
- ])) : x("", !0)
96
+ ])) : G("", !0)
99
97
  ], 32)
100
98
  ]),
101
99
  _: 1
102
100
  }, 8, ["access-token", "styling"])
103
101
  ]),
104
- fallback: p(() => [
105
- q
102
+ fallback: u(() => [
103
+ E
106
104
  ]),
107
105
  _: 1
108
106
  }));
109
107
  }
110
108
  });
111
- const J = /* @__PURE__ */ $(z, [["__scopeId", "data-v-5d5827dc"]]), c = T({ components: { GiftCardValidation: J } }), K = E();
112
- c.use(K);
113
- c.use(H);
109
+ const K = /* @__PURE__ */ H(J, [["__scopeId", "data-v-5d5827dc"]]), c = P({ components: { GiftCardValidation: K } }), Q = U();
110
+ c.use(Q);
111
+ c.use($);
114
112
  c.mount("#konnectio-gift-card-validation-app");
115
113
  export {
116
114
  c as default
Binary file
@@ -1 +1 @@
1
- "use strict";const e=require("vue"),t=require("./SelectField.vue_vue_type_style_index_0_lang-c0715ca3.cjs"),C=require("./index-8309eba2.cjs"),x=require("./_-120d9090.cjs");require("./NumberField.vue_vue_type_style_index_0_lang-8c28c1dd.cjs");const T=require("./Field-b1690485.cjs");require("./_commonjsHelpers-87b0abe8.cjs");const U=t.defineStore("giftCard",()=>{t.useAlertStore();const{pay:y}=x.usePaymentStore(),{bearerToken:a,metaData:n}=t.storeToRefs(t.useUtilityStore()),l=e.ref(t.GiftCardModuleState.InitialState),p=t.useStorage("konnectio_name","",void 0,{serializer:t.StorageSerializers.string}),h=t.useStorage("konnectio_email","",void 0,{serializer:t.StorageSerializers.string}),s=t.useStorage("konnectio_phone","",void 0,{serializer:t.StorageSerializers.string}),m=e.ref(""),N=e.ref(1),w=e.ref(!0),k=e.ref(""),u=e.ref({base64:"",type:"",name:""}),_=e.ref(void 0),r=e.ref(0),d=e.ref(!1),c=e.ref(0),E=e.computed(()=>l.value===t.GiftCardModuleState.InitialState||l.value===t.GiftCardModuleState.WaitingForResponse),S=e.computed(()=>l.value===t.GiftCardModuleState.ReadyToPay),v=e.computed(()=>l.value===t.GiftCardModuleState.PaymentSuccess),b=e.computed(()=>{const f={1:{label:t.i18n.t("giftCard.hotelType"),data:[]},2:{label:t.i18n.t("giftCard.restaurantType"),data:[]}},o=n.value.places;return o&&o.forEach(g=>{f[g.placeType].data.push(g)}),Object.fromEntries(Object.entries(f).filter(([,g])=>g.data.length>0))}),z=e.computed(()=>c.value!==0),V=e.computed(()=>{let f;if(z.value)f=b.value[c.value].data[0];else if(r.value!==0){const o=_.value,g=b.value[r.value].data;g.length===1?f=g[0]:o!==void 0&&g.forEach(R=>{String(R.id)===String(o)&&(f=R)})}return f}),G=e.computed(()=>!(!p.value||!h.value||!(s.value.length>=5)||!m.value||V.value===void 0)),q=e.computed(()=>!(l.value===t.GiftCardModuleState.InitialState&&d.value)),P=e.computed(()=>!!(l.value===t.GiftCardModuleState.WaitingForResponse&&d.value));async function F(){l.value=t.GiftCardModuleState.WaitingForResponse,d.value=!0,await t.axios.post("https://stage.hotel-service.konnectio.dk/api/gift-card/create",{termsOfserviceURL:"https://freshbooking.dk",checkoutUrl:"https://freshbooking.dk",currencyID:n.value.currency.id,language:t.getUserLanguage(),amount:m.value,quantity:N.value,freeText:k.value,showPrice:w.value,contactName:p.value,contactEmail:h.value,contactPhone:s.value,imageBase64:t.b2a(u.value.base64),imageName:u.value.name,imageFormat:u.value.type,placeType:V.value?V.value.placeType:void 0,placeID:V.value?V.value.id:void 0},{headers:{Authorization:a.value,Accept:"application/json","Fresh-Booking-Ver":"4.0.17"}}).then(f=>{l.value=t.GiftCardModuleState.ReadyToPay,d.value=!1,y({callback:()=>console.log("Callback!"),response:f.data})})}function i(f){f&&(c.value=f)}return{moduleState:l,name:p,email:h,phone:s,value:m,remark:k,showValue:w,quantity:N,media:u,placeId:_,placeType:r,showFormPage:E,showPaymentPage:S,showConfirmationPage:v,places:b,hasFilledForm:G,hasForcedPlaceType:z,isWaitingForResponse:P,isMetaDataAvailable:q,orderGiftCard:F,initialize:i}}),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:a}){const n=a,l=y,{t:p}=t.useI18n(),{display:h}=t.useAlertStore(),s=e.ref(),m=e.computed(()=>l.modelValue.base64!=="");function N(r){n("update:modelValue",r)}function w(){N({base64:"",name:"",type:""}),s.value&&(s.value.value="")}function k(){s.value&&s.value.click()}function u(r,d){const[c,E]=[r.name,r.type],S=new FileReader;S.onload=function(v){if(v.target){const b=v.target.result;d({base64:b,name:c,type:E})}else h({message:p("imageUploadError"),type:"error"})},S.readAsDataURL(r)}async function _(){let r;(r=s.value.files)instanceof FileList&&u(r[0],N)}return(r,d)=>(e.openBlock(),e.createBlock(t.InputField,{label:r.label,required:r.required,type:"media"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[e.createElementVNode("input",{ref_key:"fileInput",ref:s,type:"file",class:"hidden",accept:r.validation,single:"",onChange:d[0]||(d[0]=c=>_())},null,40,D),e.createElementVNode("div",I,[e.createElementVNode("ul",L,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("li",A,[e.createVNode(t.Clickable,{label:e.unref(p)("uploadFile"),type:"button",icon:"upload","icon-color":r.iconColor,onClickEvent:d[1]||(d[1]=c=>k())},null,8,["label","icon-color"])])),m.value?(e.openBlock(),e.createElementBlock("li",W,[e.createVNode(t.Clickable,{label:e.unref(p)("replaceFile"),type:"button",icon:"repeat-alt","icon-color":r.iconColor,onClickEvent:d[2]||(d[2]=c=>k())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("li",j,[e.createVNode(t.Clickable,{label:e.unref(p)("removeFile"),type:"button",icon:"trash-alt","icon-color":r.iconColor,onClickEvent:d[3]||(d[3]=c=>w())},null,8,["label","icon-color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["media-selector-previewer",{opened:m.value}])},[r.modelValue?(e.openBlock(),e.createElementBlock("img",{key:0,src:r.modelValue.base64},null,8,H)):e.createCommentVNode("",!0)],2)])])]),_:1},8,["label","required"]))}});function $(y){const a=y;a.__i18n=a.__i18n||[],a.__i18n.push({locale:"",resource:{da:{uploadFile:n=>{const{normalize:l}=n;return l(["Upload billede"])},removeFile:n=>{const{normalize:l}=n;return l(["Fjern billede"])},replaceFile:n=>{const{normalize:l}=n;return l(["Ersat billede"])},imageUploadError:n=>{const{normalize:l}=n;return l(["Der skete en fejl under billede upload!"])}},en:{uploadFile:n=>{const{normalize:l}=n;return l(["Upload image"])},removeFile:n=>{const{normalize:l}=n;return l(["Remove image"])},replaceFile:n=>{const{normalize:l}=n;return l(["Replace image"])},imageUploadError:n=>{const{normalize:l}=n;return l(["An error occurred under image upload!"])}}}})}typeof $=="function"&&$(O);const K={class:"gift-card-skeleton"},Y={class:"gift-card-skeleton-form"},J=e.defineComponent({__name:"GiftCardSkeleton",setup(y){return(a,n)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Y,[e.createVNode(T.Field),e.createVNode(T.Field),e.createVNode(T.Field),e.createVNode(T.Field),e.createVNode(T.Field,{"is-text-area":""}),e.createVNode(x.Element,{height:"44px"})])]))}});const Q=t._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"},le=["innerHTML"],ae={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"},me=e.defineComponent({name:"GiftCardLayout",__name:"GiftCard",props:{accessToken:{},layout:{default:"minimal"},placeType:{},styling:{}},setup(y){const{t:a}=t.useI18n(),{name:n,email:l,phone:p,value:h,remark:s,showValue:m,quantity:N,media:w,placeId:k,placeType:u,showFormPage:_,showPaymentPage:r,showConfirmationPage:d,places:c,hasFilledForm:E,hasForcedPlaceType:S,isWaitingForResponse:v,isMetaDataAvailable:b}=t.storeToRefs(U()),{initialize:z,orderGiftCard:V}=U(),{isRecaptchaEnabled:G,currency:q}=t.storeToRefs(t.useUtilityStore());async function P(){await V()}return e.watch(u,()=>{k.value=void 0}),e.onMounted(()=>{z()}),(F,i)=>{const f=e.resolveDirective("sticky");return e.openBlock(),e.createBlock(e.Suspense,null,{default:e.withCtx(()=>[e.createVNode(t._sfc_main,{id:"fresh-booking-gift-card-module",type:"gift-card","access-token":F.accessToken,"data-layout":F.layout,styling:F.styling,"sticky-container":""},{default:e.withCtx(()=>[e.unref(b)?(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("h4",Z,[e.createElementVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.title")),1)]),e.createElementVNode("div",ee,[e.withDirectives(e.createElementVNode("div",te,[e.createVNode(C.CheckoutWindow)],512),[[e.vShow,e.unref(r)]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("p",{id:"fresh-booking-gift-card-description",innerHTML:e.unref(a)("giftCard.description")},null,8,le),e.createElementVNode("form",null,[e.createVNode(t.TextField,{modelValue:e.unref(n),"onUpdate:modelValue":i[0]||(i[0]=o=>e.isRef(n)?n.value=o:null),type:"text",name:"name",autocomplete:"name",label:e.unref(a)("giftCard.name"),icon:"user-alt",placeholder:e.unref(a)("giftCard.namePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(t.TextField,{modelValue:e.unref(l),"onUpdate:modelValue":i[1]||(i[1]=o=>e.isRef(l)?l.value=o:null),type:"email",name:"email",autocomplete:"email",label:e.unref(a)("giftCard.email"),icon:"at",placeholder:e.unref(a)("giftCard.emailPlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.createVNode(C.PhoneField,{modelValue:e.unref(p),"onUpdate:modelValue":i[2]||(i[2]=o=>e.isRef(p)?p.value=o:null),icon:"phone-office",label:e.unref(a)("giftCard.phone"),placeholder:e.unref(a)("giftCard.phonePlaceholder"),required:""},null,8,["modelValue","label","placeholder"]),e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ae,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("label",ne,[e.createElementVNode("span",null,e.toDisplayString(e.unref(a)("giftCard.selectType")),1)]),e.createElementVNode("div",re,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(o,g)=>(e.openBlock(),e.createElementBlock("li",{key:g},[e.createVNode(C.Checkbox,{modelValue:e.unref(u),"onUpdate:modelValue":i[3]||(i[3]=R=>e.isRef(u)?u.value=R:null),type:"radio",name:"placeType",val:g,label:o.label},null,8,["modelValue","val","label"])]))),128))]),e.unref(c)[e.unref(u)]&&e.unref(c)[e.unref(u)].data.length>1?(e.openBlock(),e.createBlock(t._sfc_main$1,{key:0,modelValue:e.unref(k),"onUpdate:modelValue":i[4]||(i[4]=o=>e.isRef(k)?k.value=o:null),placeholder:e.unref(a)("giftCard.selectPlacePlaceholder"),options:e.unref(c)[e.unref(u)].data,labelKey:"name",valueKey:"id",required:""},null,8,["modelValue","placeholder","options"])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createBlock(t.Loading,{key:1}))])),e.createVNode(t.TextField,{modelValue:e.unref(h),"onUpdate:modelValue":i[5]||(i[5]=o=>e.isRef(h)?h.value=o:null),type:"number",name:"value",label:e.unref(a)("giftCard.value"),icon:"money-bill",placeholder:e.unref(a)("giftCard.valuePlaceholder"),suffix:e.unref(q),required:""},null,8,["modelValue","label","placeholder","suffix"]),e.createVNode(C.Checkbox,{modelValue:e.unref(m),"onUpdate:modelValue":i[6]||(i[6]=o=>e.isRef(m)?m.value=o:null),type:"checkbox",name:"showValue",label:e.unref(a)("giftCard.showValue"),checked:e.unref(m)},null,8,["modelValue","label","checked"]),e.createCommentVNode("",!0),e.createCommentVNode("",!0)])],512),[[e.vShow,e.unref(_)]]),e.withDirectives(e.createElementVNode("div",null,[e.createElementVNode("div",{innerHTML:e.unref(a)("giftCard.thankYou")},null,8,ie)],512),[[e.vShow,e.unref(d)]])]),F.layout!=="minimal"&&e.unref(_)?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",ce,[e.createVNode(t.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(E),"is-loading":e.unref(v),"onUpdate:isLoading":i[9]||(i[9]=o=>e.isRef(v)?v.value=o:null),onClickEvent:P},null,8,["label","disabled","is-loading"])])])):e.createCommentVNode("",!0),e.unref(_)?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(t.TextField,{modelValue:e.unref(s),"onUpdate:modelValue":i[10]||(i[10]=o=>e.isRef(s)?s.value=o:null),type:"textarea",name:"remark",label:e.unref(a)("giftCard.remark"),icon:"info-circle",placeholder:e.unref(a)("giftCard.remarkPlaceholder")},null,8,["modelValue","label","placeholder"])])):e.createCommentVNode("",!0),e.unref(_)?e.withDirectives((e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(t.Clickable,{label:e.unref(a)("giftCard.orderGiftCard"),"full-width":!0,disabled:!e.unref(E),"data-test":"orderGiftCard","is-loading":e.unref(v),"onUpdate:isLoading":i[11]||(i[11]=o=>e.isRef(v)?v.value=o:null),onClickEvent:P},null,8,["label","disabled","is-loading"]),e.withDirectives(e.createElementVNode("div",fe,[e.createVNode(C._sfc_main)],512),[[e.vShow,e.unref(G)]])])),[[f]]):e.createCommentVNode("",!0)])):(e.openBlock(),e.createBlock(t.Loading,{key:1}))]),_:1},8,["access-token","data-layout","styling"])]),fallback:e.withCtx(()=>[e.createVNode(Q)]),_:1})}}});const pe=t._export_sfc(me,[["__scopeId","data-v-e4aa1e4c"]]),ve=t.createPinia(),ge=t.zo(),B=e.createApp({components:{GiftCard:pe}});B.use(ve);B.use(t.instance);B.use(ge);B.use(C.StickyPlugin);B.use(C.install,{bootstrap:!1});B.mount("#konnectio-gift-card-app");
1
+ "use strict";const e=require("./SelectField.vue_vue_type_style_index_0_lang-af7c016a.cjs"),V=require("./index-5d223c1a.cjs"),G=require("./_-b5842a21.cjs"),R=require("./Field-4283160f.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.19"}}).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$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",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,{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");