@oneclick.dev/cms-core-modules 0.0.59 → 0.0.60

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 (147) hide show
  1. package/dist/{Components-D9yIIosM.mjs → Components-C83O-xlF.mjs} +1 -1
  2. package/dist/{ContentEditor-DCmt_y_R.js → ContentEditor-BAepN3Yd.js} +51 -34
  3. package/dist/{ContentEditor-CtGeIzC4.mjs → ContentEditor-BPjWW3d1.mjs} +12341 -10099
  4. package/dist/Create-Bh4g6QW4.js +1 -0
  5. package/dist/{Create-Bwf1RXdG.mjs → Create-Cf7pvh5G.mjs} +38 -39
  6. package/dist/DateFormatter-BPPBZp1j.js +1 -0
  7. package/dist/{CalendarDate-CRT2Viyt.mjs → DateFormatter-DsmlAuYV.mjs} +353 -256
  8. package/dist/{Detail-CpfOQChd.mjs → Detail-B4b_FLDa.mjs} +2 -2
  9. package/dist/{Detail-B-PnkcXD.mjs → Detail-BGD75ul4.mjs} +2 -2
  10. package/dist/{Detail-Dd_OkpcN.js → Detail-BayNaAg9.js} +1 -1
  11. package/dist/{Detail-C4E1T87K.mjs → Detail-Byk781b4.mjs} +3 -3
  12. package/dist/{Detail-Cd5CBVN0.js → Detail-CnK-qbhE.js} +1 -1
  13. package/dist/Detail-CtbWzq-R.js +1 -0
  14. package/dist/{Detail-CNfTDUE5.js → Detail-Cxd2VMOl.js} +1 -1
  15. package/dist/{Detail-BVlGSjOq.mjs → Detail-D10shmpK.mjs} +6 -7
  16. package/dist/{Detail-CwagT6gQ.mjs → Detail-U0mgLKt6.mjs} +2 -2
  17. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs +75 -0
  18. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js +1 -0
  19. package/dist/{Entries-zyhycw1M.mjs → Entries-C6Di46My.mjs} +1 -1
  20. package/dist/{Find-BPR0uU-Z.mjs → Find-B4sAEx0B.mjs} +2 -2
  21. package/dist/{Find-BidEQJxT.js → Find-Ds6OvuH6.js} +1 -1
  22. package/dist/{GlobalStyling-BLQ_1W2y.mjs → GlobalStyling-C9VthHWK.mjs} +1 -1
  23. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs +396 -0
  24. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +1 -0
  25. package/dist/Overview-B-8TLLjh.js +1 -0
  26. package/dist/{Overview-CDN88OSM.mjs → Overview-BCpJNiEB.mjs} +1 -1
  27. package/dist/Overview-B_99j5eA.js +1 -0
  28. package/dist/{Overview-BLsZMHNW.mjs → Overview-CIa1E-HH.mjs} +1 -1
  29. package/dist/{Overview-D1nJLBe1.mjs → Overview-CgViRnNc.mjs} +1 -1
  30. package/dist/Overview-DtWvKB3W.mjs +327 -0
  31. package/dist/Overview-HvlDEgqi.mjs +862 -0
  32. package/dist/{Overview-BH3NwvNX.mjs → Overview-Su8ZUbMs.mjs} +3 -3
  33. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +345 -0
  34. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +2093 -0
  35. package/dist/{TableView-CS13LLxk.mjs → TableView-B8iLWWcP.mjs} +48394 -36321
  36. package/dist/TableView-BxK6R8v3.js +312 -0
  37. package/dist/{TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs → TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs} +5 -5
  38. package/dist/{View-C7axVP9t.mjs → View-DDXN0tKD.mjs} +7 -7
  39. package/dist/View-DfzaVOzS.js +1 -0
  40. package/dist/agenda-D81m29_4.mjs +1135 -0
  41. package/dist/agenda-uzPPxgsW.js +1 -0
  42. package/dist/availability-B-tRp8hB.mjs +629 -0
  43. package/dist/availability-BiBbzEIM.js +1 -0
  44. package/dist/{exceptions-D3b18TiY.mjs → exceptions-BFchkR06.mjs} +70 -71
  45. package/dist/exceptions-C-DPRNQa.js +1 -0
  46. package/dist/index-4tjmIans.js +1 -0
  47. package/dist/index-AmUV8LZQ.mjs +176 -0
  48. package/dist/index-BDaVYdkD.mjs +7763 -0
  49. package/dist/{index-DT1wWnUk.mjs → index-BWDwEd8D.mjs} +1 -1
  50. package/dist/{index-CImCyE3L.mjs → index-BfBBm9uY.mjs} +1 -1
  51. package/dist/{index-DMoyoaks.mjs → index-Bkq58CeQ.mjs} +2 -2
  52. package/dist/{index-DI6mydpm.mjs → index-CABh6Qn6.mjs} +2 -2
  53. package/dist/{index-CQiY-oTN.mjs → index-CQkOH2_3.mjs} +1 -1
  54. package/dist/{index-Bwi1mtkq.mjs → index-CU-tbS5W.mjs} +1 -1
  55. package/dist/{index-BzuHN-r8.mjs → index-Cpnn_Pxd.mjs} +1 -1
  56. package/dist/index-CxETuRsG.js +1 -0
  57. package/dist/{index-DyCHxFp3.mjs → index-DRqJOqUR.mjs} +502 -449
  58. package/dist/index-DTago6vW-Bhr8E1Y6.js +88 -0
  59. package/dist/index-DTago6vW-CnomHQ_S.mjs +4123 -0
  60. package/dist/index-DfV8-6ON.js +245 -0
  61. package/dist/index-Dnn2SCSl.js +1 -0
  62. package/dist/{index-BEGU8Kme.mjs → index-Dpl9sU6a.mjs} +2 -2
  63. package/dist/index-Uf7TwBuW.mjs +110 -0
  64. package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
  65. package/dist/{index-CKPshlZ8-BQiiP6r_.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +399 -363
  66. package/dist/{index--jjEzba7.mjs → index-cOnxXTbF.mjs} +1 -1
  67. package/dist/index-hlylYYgy.mjs +24 -0
  68. package/dist/index.cjs.js +1 -1
  69. package/dist/index.mjs +98 -81
  70. package/dist/orders-Bh8w0ueq.mjs +346 -0
  71. package/dist/orders-Dt0zMz97.js +1 -0
  72. package/dist/payment-BQaAqQ5q.js +1 -0
  73. package/dist/payment-BbWByERf.mjs +1080 -0
  74. package/dist/regular-1LXNPviB.js +1 -0
  75. package/dist/regular-_05oq5Tx.mjs +1101 -0
  76. package/dist/regular-slots-Bs3WJB3U.js +1 -0
  77. package/dist/regular-slots-C2NYxLPn.mjs +222 -0
  78. package/dist/resources-DgPnEv76.mjs +811 -0
  79. package/dist/resources-eb0pivDL.js +1 -0
  80. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +2 -2
  81. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +92 -0
  82. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
  83. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +10 -0
  84. package/dist/src/appointments/components/edit/{EventDialog.vue.d.ts → EventDialog/ResendConfirmationDialog.vue.d.ts} +1 -1
  85. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +51 -0
  86. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
  87. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
  88. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +15 -7
  89. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +2 -0
  90. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +68 -0
  91. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +15 -0
  92. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
  93. package/dist/src/appointments/config.d.ts +30 -0
  94. package/dist/src/appointments/index.d.ts +32 -5
  95. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +1 -1
  96. package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -1
  97. package/dist/src/appointments/pages/edit/index.vue.d.ts +1 -1
  98. package/dist/src/appointments/pages/edit/orders.vue.d.ts +64 -0
  99. package/dist/src/appointments/pages/edit/payment.vue.d.ts +1 -1
  100. package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +1 -1
  101. package/dist/src/appointments/pages/edit/resources.vue.d.ts +1 -1
  102. package/dist/src/appointments/routes.d.ts +2 -5
  103. package/dist/src/appointments/types.d.ts +16 -0
  104. package/dist/src/appointments/utils/printReservation.d.ts +45 -0
  105. package/dist/src/content-manager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
  106. package/dist/src/content-manager/components/content-editor/PageSettings.vue.d.ts +2 -0
  107. package/dist/src/content-manager/components/content-editor/SidebarSectionWrapper.vue.d.ts +11 -1
  108. package/dist/src/content-manager/types.d.ts +5 -0
  109. package/dist/{vee-validate-zod-BPQyEfpF.js → vee-validate-zod-ByykgYKJ.js} +1 -1
  110. package/dist/{vee-validate-zod-IXkfh-6Q.mjs → vee-validate-zod-CcOwoF6y.mjs} +4 -4
  111. package/package.json +4 -2
  112. package/dist/CalendarDate-CWtpXgpD.js +0 -1
  113. package/dist/Create-BP8TX6rj.js +0 -1
  114. package/dist/DateFormatter-BbcSwTs4.js +0 -1
  115. package/dist/DateFormatter-CbO0PVUK.mjs +0 -99
  116. package/dist/Detail-DUo6qKqO.js +0 -1
  117. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +0 -1
  118. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +0 -55
  119. package/dist/Overview-BNMZ9MUK.js +0 -1
  120. package/dist/Overview-CEPodGCn.mjs +0 -311
  121. package/dist/Overview-CvquDPhB.js +0 -1
  122. package/dist/Overview-D67UjG6n.mjs +0 -947
  123. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +0 -1
  124. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +0 -392
  125. package/dist/TableView-Dv4YXBD1.js +0 -111
  126. package/dist/View-7qb_ohVo.js +0 -1
  127. package/dist/agenda-B49oKGeh.mjs +0 -706
  128. package/dist/agenda-DipQ5IWP.js +0 -1
  129. package/dist/availability-C7q9tq6l.js +0 -1
  130. package/dist/availability-DeCkqiu8.mjs +0 -613
  131. package/dist/exceptions-DJ9zWX3k.js +0 -1
  132. package/dist/index-CKPshlZ8-CIz1tDwX.js +0 -1
  133. package/dist/index-DUeFrD-B.js +0 -1
  134. package/dist/index-DsnoK4ia.mjs +0 -579
  135. package/dist/index-WL1P6d3j.js +0 -1
  136. package/dist/index-_mG-aU3Z.mjs +0 -87
  137. package/dist/index-_sQDF1pH.js +0 -1
  138. package/dist/index-klI238nT.mjs +0 -24
  139. package/dist/payment-kTjsV0Jj.js +0 -1
  140. package/dist/payment-zpCM0LD-.mjs +0 -981
  141. package/dist/regular-C4_3YXqx.mjs +0 -602
  142. package/dist/regular-DFwPEbZO.js +0 -1
  143. package/dist/regular-slots-4ooEpICB.mjs +0 -67
  144. package/dist/regular-slots-BAVGbomI.js +0 -1
  145. package/dist/resources-MpQkSstv.mjs +0 -563
  146. package/dist/resources-iM28T3dD.js +0 -1
  147. package/dist/src/appointments/components/edit/RegularSlotEditor.vue.d.ts +0 -16
@@ -0,0 +1,629 @@
1
+ import { defineComponent as K, ref as k, reactive as Q, resolveComponent as s, openBlock as u, createBlock as v, withCtx as o, createVNode as t, createTextVNode as d, createElementVNode as a, createElementBlock as f, Fragment as R, renderList as L, toDisplayString as w, createCommentVNode as N, unref as A } from "vue";
2
+ import { _ as ee } from "./EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs";
3
+ import { Pencil as te, Eye as ie, EyeOff as oe, Trash2 as le, PlusCircle as ne } from "lucide-vue-next";
4
+ import { useModuleRoute as se, useModule as ae, useFirebaseIntegration as de } from "@oneclick.dev/cms-kit";
5
+ const re = { class: "space-y-6 py-4" }, ue = { key: 0 }, me = { key: 1 }, pe = { class: "flex items-center gap-3" }, fe = {
6
+ key: 2,
7
+ class: "grid gap-2"
8
+ }, ce = { class: "w-full flex justify-between items-center" }, ve = { class: "flex items-center gap-2 ml-auto" }, ge = /* @__PURE__ */ K({
9
+ __name: "CustomerInformationFieldEditorDialog",
10
+ emits: ["add-field", "update-field", "remove-field"],
11
+ setup(X, { expose: D, emit: F }) {
12
+ const I = F, c = k(!1), l = k("add"), n = Q({
13
+ id: "",
14
+ fieldName: "",
15
+ fieldDescription: "",
16
+ fieldType: "text",
17
+ required: !1,
18
+ isNativeField: !1,
19
+ visible: !0,
20
+ options: []
21
+ }), M = [
22
+ { value: "text", label: "Text Box" },
23
+ { value: "checkbox", label: "Checkbox" },
24
+ { value: "radio", label: "Radio Button" },
25
+ { value: "select", label: "Select" }
26
+ ], T = (i) => {
27
+ l.value = i ? "edit" : "add", g.value = [], n.id = i?.id || "", n.fieldName = i?.fieldName || "", n.fieldDescription = i?.fieldDescription || "", n.fieldType = i?.fieldType || "text", n.required = i?.required || !1, n.isNativeField = i?.isNativeField || !1, n.options = i?.options || [], n.visible = i?.visible !== void 0 ? i.visible : !0, c.value = !0;
28
+ }, U = () => {
29
+ c.value = !1, g.value = [];
30
+ }, q = () => {
31
+ $() && (I("add-field", { ...n }), c.value = !1);
32
+ }, E = () => {
33
+ $() && (I("update-field", { ...n }), c.value = !1);
34
+ }, P = () => {
35
+ I("remove-field", n.id), c.value = !1;
36
+ }, g = k([]), $ = () => (g.value = [], n.fieldName = n.fieldName.trim(), n.fieldName ? !0 : (g.value.push("Field name is required."), !1));
37
+ return D({
38
+ openDialog: T
39
+ }), (i, e) => {
40
+ const p = s("DialogTitle"), V = s("DialogHeader"), b = s("Label"), y = s("Input"), z = s("SelectValue"), G = s("SelectTrigger"), S = s("SelectItem"), j = s("SelectContent"), O = s("Select"), H = s("TagsInputItemText"), C = s("TagsInputItemDelete"), B = s("TagsInputItem"), W = s("TagsInputInput"), x = s("TagsInput"), r = s("Checkbox"), _ = s("Button"), J = s("DialogFooter"), Y = s("DialogScrollContent"), Z = s("Dialog");
41
+ return u(), v(Z, {
42
+ open: c.value,
43
+ "onUpdate:open": e[5] || (e[5] = (m) => c.value = m)
44
+ }, {
45
+ default: o(() => [
46
+ t(Y, { class: "sm:max-w-2xl" }, {
47
+ default: o(() => [
48
+ t(V, null, {
49
+ default: o(() => [
50
+ t(p, null, {
51
+ default: o(() => [...e[6] || (e[6] = [
52
+ d("Customer Information", -1)
53
+ ])]),
54
+ _: 1
55
+ })
56
+ ]),
57
+ _: 1
58
+ }),
59
+ a("div", re, [
60
+ a("div", null, [
61
+ t(b, {
62
+ class: "text-bsmase font-normal mb-1.5",
63
+ for: "customer-info-field-dialog-fieldname"
64
+ }, {
65
+ default: o(() => [...e[7] || (e[7] = [
66
+ d("Field Name", -1)
67
+ ])]),
68
+ _: 1
69
+ }),
70
+ t(y, {
71
+ modelValue: n.fieldName,
72
+ "onUpdate:modelValue": e[0] || (e[0] = (m) => n.fieldName = m),
73
+ id: "customer-info-field-dialog-fieldname"
74
+ }, null, 8, ["modelValue"])
75
+ ]),
76
+ a("div", null, [
77
+ t(b, {
78
+ class: "text-sm font-normal mb-1.5",
79
+ for: "customer-info-field-dialog-field-description"
80
+ }, {
81
+ default: o(() => [...e[8] || (e[8] = [
82
+ d("Field Description", -1)
83
+ ])]),
84
+ _: 1
85
+ }),
86
+ t(y, {
87
+ modelValue: n.fieldDescription,
88
+ "onUpdate:modelValue": e[1] || (e[1] = (m) => n.fieldDescription = m),
89
+ id: "customer-info-field-dialog-field-description"
90
+ }, null, 8, ["modelValue"])
91
+ ]),
92
+ n.isNativeField ? N("", !0) : (u(), f("div", ue, [
93
+ t(b, { class: "text-sm font-normal mb-1.5" }, {
94
+ default: o(() => [...e[9] || (e[9] = [
95
+ d("Field Type", -1)
96
+ ])]),
97
+ _: 1
98
+ }),
99
+ t(O, {
100
+ modelValue: n.fieldType,
101
+ "onUpdate:modelValue": e[2] || (e[2] = (m) => n.fieldType = m)
102
+ }, {
103
+ default: o(() => [
104
+ t(G, null, {
105
+ default: o(() => [
106
+ t(z, { placeholder: "Select field type" })
107
+ ]),
108
+ _: 1
109
+ }),
110
+ t(j, null, {
111
+ default: o(() => [
112
+ (u(), f(R, null, L(M, (m) => t(S, {
113
+ key: m.value,
114
+ value: m.value
115
+ }, {
116
+ default: o(() => [
117
+ d(w(m.label), 1)
118
+ ]),
119
+ _: 2
120
+ }, 1032, ["value"])), 64))
121
+ ]),
122
+ _: 1
123
+ })
124
+ ]),
125
+ _: 1
126
+ }, 8, ["modelValue"])
127
+ ])),
128
+ n.fieldType === "select" || n.fieldType === "radio" ? (u(), f("div", me, [
129
+ t(b, {
130
+ class: "text-sm font-normal mb-1.5",
131
+ for: "customer-info-field-dialog-field-new-option"
132
+ }, {
133
+ default: o(() => [...e[10] || (e[10] = [
134
+ d("Options", -1)
135
+ ])]),
136
+ _: 1
137
+ }),
138
+ t(x, {
139
+ modelValue: n.options,
140
+ "onUpdate:modelValue": e[3] || (e[3] = (m) => n.options = m)
141
+ }, {
142
+ default: o(() => [
143
+ (u(!0), f(R, null, L(n.options, (m) => (u(), v(B, {
144
+ key: m,
145
+ value: m
146
+ }, {
147
+ default: o(() => [
148
+ t(H),
149
+ t(C)
150
+ ]),
151
+ _: 1
152
+ }, 8, ["value"]))), 128)),
153
+ t(W, {
154
+ placeholder: "New option...",
155
+ id: "customer-info-field-dialog-field-new-option"
156
+ })
157
+ ]),
158
+ _: 1
159
+ }, 8, ["modelValue"])
160
+ ])) : N("", !0),
161
+ a("div", pe, [
162
+ t(r, {
163
+ id: "customer-info-field-dialog-field-required",
164
+ modelValue: n.required,
165
+ "onUpdate:modelValue": e[4] || (e[4] = (m) => n.required = m)
166
+ }, null, 8, ["modelValue"]),
167
+ t(b, {
168
+ for: "customer-info-field-dialog-field-required",
169
+ class: "text-base font-normal cursor-pointer"
170
+ }, {
171
+ default: o(() => [...e[11] || (e[11] = [
172
+ d(" Is this field mandatory? ", -1)
173
+ ])]),
174
+ _: 1
175
+ })
176
+ ]),
177
+ g.value.length > 0 ? (u(), f("p", fe, [
178
+ (u(!0), f(R, null, L(g.value, (m, h) => (u(), f("span", {
179
+ key: h,
180
+ class: "text-sm text-red-600 block"
181
+ }, w(m), 1))), 128))
182
+ ])) : N("", !0)
183
+ ]),
184
+ t(J, { class: "gap-2" }, {
185
+ default: o(() => [
186
+ a("div", ce, [
187
+ l.value === "edit" && !n.isNativeField ? (u(), v(_, {
188
+ key: 0,
189
+ variant: "destructive",
190
+ onClick: P
191
+ }, {
192
+ default: o(() => [...e[12] || (e[12] = [
193
+ d(" Remove Field ", -1)
194
+ ])]),
195
+ _: 1
196
+ })) : N("", !0),
197
+ a("div", ve, [
198
+ t(_, {
199
+ variant: "outline",
200
+ onClick: U
201
+ }, {
202
+ default: o(() => [...e[13] || (e[13] = [
203
+ d(" Cancel ", -1)
204
+ ])]),
205
+ _: 1
206
+ }),
207
+ l.value === "add" ? (u(), v(_, {
208
+ key: 0,
209
+ onClick: q
210
+ }, {
211
+ default: o(() => [...e[14] || (e[14] = [
212
+ d(" Add Field ", -1)
213
+ ])]),
214
+ _: 1
215
+ })) : (u(), v(_, {
216
+ key: 1,
217
+ onClick: E
218
+ }, {
219
+ default: o(() => [...e[15] || (e[15] = [
220
+ d(" Update Field ", -1)
221
+ ])]),
222
+ _: 1
223
+ }))
224
+ ])
225
+ ])
226
+ ]),
227
+ _: 1
228
+ })
229
+ ]),
230
+ _: 1
231
+ })
232
+ ]),
233
+ _: 1
234
+ }, 8, ["open"]);
235
+ };
236
+ }
237
+ }), be = {
238
+ key: 0,
239
+ class: "max-w-2xl"
240
+ }, ye = {
241
+ key: 0,
242
+ class: "text-sm text-orange-500 mt-2"
243
+ }, xe = { class: "space-y-3" }, _e = { class: "flex items-center justify-between rounded-lg border p-4 bg-card" }, Ie = { class: "space-y-2" }, Ne = { class: "border rounded-md p-4 mb-4" }, ke = { class: "font-medium text-sm" }, Fe = { class: "flex justify-start mt-8" }, Ae = /* @__PURE__ */ K({
244
+ __name: "availability",
245
+ setup(X) {
246
+ const { params: D } = se(), { config: F } = ae(), I = de(F.project), c = [
247
+ {
248
+ id: "firstName",
249
+ fieldName: "First Name",
250
+ fieldType: "text",
251
+ required: !0,
252
+ visible: !0,
253
+ isNativeField: !0
254
+ },
255
+ {
256
+ id: "lastName",
257
+ fieldName: "Last Name",
258
+ fieldType: "text",
259
+ required: !0,
260
+ visible: !0,
261
+ isNativeField: !0
262
+ },
263
+ {
264
+ id: "phone",
265
+ fieldName: "Phone No",
266
+ fieldType: "tel",
267
+ required: !0,
268
+ visible: !0,
269
+ isNativeField: !0
270
+ },
271
+ {
272
+ id: "email",
273
+ fieldName: "Email",
274
+ fieldType: "email",
275
+ required: !0,
276
+ visible: !0,
277
+ isNativeField: !0
278
+ }
279
+ ], l = Q({
280
+ minimumAdvanceNotice: {
281
+ value: 0,
282
+ unit: "minutes"
283
+ },
284
+ serviceVisibility: 60,
285
+ maxTicketsPerReservation: "",
286
+ customerInformationFields: [...c],
287
+ needsApproval: !1
288
+ }), n = k(!1), M = k(!0), T = k(null), U = async () => {
289
+ n.value = !0;
290
+ try {
291
+ const i = D.value.id;
292
+ if (!i) throw new Error("Missing agenda ID");
293
+ await I.update(F.agendaCollection, i, {
294
+ minimumAdvanceNotice: {
295
+ value: Number(l.minimumAdvanceNotice?.value) || 0,
296
+ unit: l.minimumAdvanceNotice?.unit ?? "minutes"
297
+ },
298
+ serviceVisibility: Math.max(Number(l.serviceVisibility) || 1, 1),
299
+ maxTicketsPerReservation: Math.max(Number(l.maxTicketsPerReservation) || 0, 0),
300
+ customerInformationFields: l.customerInformationFields ?? [],
301
+ needsApproval: l.needsApproval || !1
302
+ });
303
+ } catch (i) {
304
+ console.error("Error saving changes:", i);
305
+ } finally {
306
+ n.value = !1;
307
+ }
308
+ }, q = async (i) => {
309
+ delete i.isNativeField, i.fieldType !== "radio" && i.fieldType !== "select" && delete i.options;
310
+ let e = Math.random().toString(36).substr(2, 9);
311
+ for (; l.customerInformationFields.find((p) => p.id === e); )
312
+ e = Math.random().toString(36).substr(2, 9);
313
+ l.customerInformationFields.push({ ...i, id: e });
314
+ }, E = async (i) => {
315
+ i.isNativeField || delete i.isNativeField, i.fieldType !== "radio" && i.fieldType !== "select" && delete i.options;
316
+ const e = l.customerInformationFields.findIndex((p) => p.id === i.id);
317
+ e !== -1 && (l.customerInformationFields[e] = { ...i });
318
+ }, P = async (i) => {
319
+ l.customerInformationFields = l.customerInformationFields.filter((e) => e.id !== i);
320
+ }, g = async () => {
321
+ try {
322
+ const i = await I.get(F.agendaCollection, D.value.id);
323
+ i && (console.log("Loaded agenda data:", i), l.minimumAdvanceNotice = i.minimumAdvanceNotice || { value: 0, unit: "minutes" }, l.serviceVisibility = i.serviceVisibility || 60, l.maxTicketsPerReservation = Number(i.maxTicketsPerReservation) && i.maxTicketsPerReservation > 0 ? parseInt(i.maxTicketsPerReservation) : "", l.customerInformationFields = i.customerInformationFields || [...c], l.needsApproval = i.needsApproval || !1);
324
+ } catch (i) {
325
+ console.error("Error loading agenda data:", i);
326
+ } finally {
327
+ M.value = !1;
328
+ }
329
+ }, $ = () => {
330
+ let i = Math.abs(l.minimumAdvanceNotice.value), e = l.minimumAdvanceNotice.unit;
331
+ return i === 1 ? (e.endsWith("s") && (e = e.slice(0, -1)), `Lead time is negative. Bookings remain open for 1 ${e} after the slot has started.`) : `Lead time is negative. Bookings remain open for ${i} ${e} after the slot has started.`;
332
+ };
333
+ return g(), (i, e) => {
334
+ const p = s("Label"), V = s("InputGroupInput"), b = s("Search"), y = s("InputGroupAddon"), z = s("SelectValue"), G = s("SelectTrigger"), S = s("SelectItem"), j = s("SelectGroup"), O = s("SelectContent"), H = s("Select"), C = s("InputGroup"), B = s("Badge"), W = s("Switch"), x = s("Button");
335
+ return u(), v(ee, null, {
336
+ default: o(() => [
337
+ e[31] || (e[31] = a("h1", { class: "text-lg font-medium mb-8" }, "Availability Settings", -1)),
338
+ M.value ? N("", !0) : (u(), f("div", be, [
339
+ a("div", null, [
340
+ t(p, {
341
+ for: "lead-time",
342
+ class: "text-base font-medium mb-2"
343
+ }, {
344
+ default: o(() => [...e[7] || (e[7] = [
345
+ d(" Minimum Advance Notice - Lead Time (Optional) ", -1)
346
+ ])]),
347
+ _: 1
348
+ }),
349
+ t(C, { class: "max-w-md" }, {
350
+ default: o(() => [
351
+ t(V, {
352
+ placeholder: "0",
353
+ id: "lead-time",
354
+ modelValue: l.minimumAdvanceNotice.value,
355
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => l.minimumAdvanceNotice.value = r),
356
+ modelModifiers: { value: !0 },
357
+ type: "number",
358
+ class: "no-spinner"
359
+ }, null, 8, ["modelValue"]),
360
+ t(y, null, {
361
+ default: o(() => [
362
+ t(b)
363
+ ]),
364
+ _: 1
365
+ }),
366
+ t(y, { align: "inline-end" }, {
367
+ default: o(() => [
368
+ t(H, {
369
+ modelValue: l.minimumAdvanceNotice.unit,
370
+ "onUpdate:modelValue": e[1] || (e[1] = (r) => l.minimumAdvanceNotice.unit = r)
371
+ }, {
372
+ default: o(() => [
373
+ t(G, { class: "w-[180px] border-0 bg-transparent -mr-1.5" }, {
374
+ default: o(() => [
375
+ t(z)
376
+ ]),
377
+ _: 1
378
+ }),
379
+ t(O, null, {
380
+ default: o(() => [
381
+ t(j, null, {
382
+ default: o(() => [
383
+ t(S, { value: "minutes" }, {
384
+ default: o(() => [...e[8] || (e[8] = [
385
+ d(" Minutes ", -1)
386
+ ])]),
387
+ _: 1
388
+ }),
389
+ t(S, { value: "hours" }, {
390
+ default: o(() => [...e[9] || (e[9] = [
391
+ d(" Hours ", -1)
392
+ ])]),
393
+ _: 1
394
+ }),
395
+ t(S, { value: "days" }, {
396
+ default: o(() => [...e[10] || (e[10] = [
397
+ d(" Days ", -1)
398
+ ])]),
399
+ _: 1
400
+ })
401
+ ]),
402
+ _: 1
403
+ })
404
+ ]),
405
+ _: 1
406
+ })
407
+ ]),
408
+ _: 1
409
+ }, 8, ["modelValue"])
410
+ ]),
411
+ _: 1
412
+ })
413
+ ]),
414
+ _: 1
415
+ }),
416
+ e[11] || (e[11] = a("p", { class: "text-sm text-muted-foreground mt-2" }, " Set how far in advance a customer must book your slot. ", -1)),
417
+ l.minimumAdvanceNotice.value < 0 ? (u(), f("p", ye, w($()), 1)) : N("", !0)
418
+ ]),
419
+ e[27] || (e[27] = a("hr", { class: "my-8" }, null, -1)),
420
+ a("div", null, [
421
+ t(p, {
422
+ for: "service-visibility",
423
+ class: "text-base font-medium mb-2"
424
+ }, {
425
+ default: o(() => [...e[12] || (e[12] = [
426
+ d(" Service Visibility ", -1)
427
+ ])]),
428
+ _: 1
429
+ }),
430
+ t(C, { class: "max-w-md" }, {
431
+ default: o(() => [
432
+ t(V, {
433
+ id: "service-visibility",
434
+ modelValue: l.serviceVisibility,
435
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => l.serviceVisibility = r),
436
+ modelModifiers: { number: !0 },
437
+ placeholder: "1",
438
+ type: "number",
439
+ class: "no-spinner",
440
+ min: "1",
441
+ onBlur: e[3] || (e[3] = (r) => l.serviceVisibility = Math.max(l.serviceVisibility, 1))
442
+ }, null, 8, ["modelValue"]),
443
+ t(y, { align: "inline-end" }, {
444
+ default: o(() => [...e[13] || (e[13] = [
445
+ d(" days ", -1)
446
+ ])]),
447
+ _: 1
448
+ })
449
+ ]),
450
+ _: 1
451
+ }),
452
+ e[14] || (e[14] = a("p", { class: "text-sm text-muted-foreground mt-2" }, " Set how many days in advance the service is visible to customers. ", -1))
453
+ ]),
454
+ e[28] || (e[28] = a("hr", { class: "my-8" }, null, -1)),
455
+ a("div", null, [
456
+ t(p, {
457
+ for: "max-capacity",
458
+ class: "text-base font-medium mb-2"
459
+ }, {
460
+ default: o(() => [...e[15] || (e[15] = [
461
+ d(" Maximum Tickets Per Booking ", -1)
462
+ ])]),
463
+ _: 1
464
+ }),
465
+ t(C, { class: "max-w-md" }, {
466
+ default: o(() => [
467
+ t(V, {
468
+ placeholder: "∞",
469
+ type: "number",
470
+ id: "max-capacity",
471
+ class: "no-spinner",
472
+ min: "1",
473
+ modelValue: l.maxTicketsPerReservation,
474
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => l.maxTicketsPerReservation = r),
475
+ modelModifiers: { number: !0 }
476
+ }, null, 8, ["modelValue"]),
477
+ t(y, { align: "inline-end" }, {
478
+ default: o(() => [...e[16] || (e[16] = [
479
+ d(" spots ", -1)
480
+ ])]),
481
+ _: 1
482
+ })
483
+ ]),
484
+ _: 1
485
+ }),
486
+ e[17] || (e[17] = a("p", { class: "text-sm text-muted-foreground mt-2" }, " Limit how many spots a customer can book in a single reservation. ", -1))
487
+ ]),
488
+ e[29] || (e[29] = a("hr", { class: "my-8" }, null, -1)),
489
+ a("div", xe, [
490
+ a("div", null, [
491
+ t(p, { class: "text-base font-medium" }, {
492
+ default: o(() => [...e[18] || (e[18] = [
493
+ d("Booking Approval", -1)
494
+ ])]),
495
+ _: 1
496
+ }),
497
+ e[19] || (e[19] = a("p", { class: "text-sm text-muted-foreground" }, " Choose whether you want to confirm booking requests manually or accept them automatically. ", -1))
498
+ ]),
499
+ a("div", _e, [
500
+ a("div", Ie, [
501
+ t(p, { class: "text-sm font-semibold" }, {
502
+ default: o(() => [...e[20] || (e[20] = [
503
+ d("Enable Manual Approval", -1)
504
+ ])]),
505
+ _: 1
506
+ }),
507
+ e[23] || (e[23] = a("p", { class: "text-xs text-muted-foreground max-w-[300px]" }, " When enabled, you must approve bookings within your dashboard before they are finalized. ", -1)),
508
+ l.needsApproval ? (u(), v(B, { key: 0 }, {
509
+ default: o(() => [...e[21] || (e[21] = [
510
+ d("Status: Manual Review", -1)
511
+ ])]),
512
+ _: 1
513
+ })) : (u(), v(B, {
514
+ key: 1,
515
+ variant: "secondary"
516
+ }, {
517
+ default: o(() => [...e[22] || (e[22] = [
518
+ d("Status: Auto-Confirm", -1)
519
+ ])]),
520
+ _: 1
521
+ }))
522
+ ]),
523
+ t(W, {
524
+ modelValue: l.needsApproval,
525
+ "onUpdate:modelValue": e[5] || (e[5] = (r) => l.needsApproval = r)
526
+ }, null, 8, ["modelValue"])
527
+ ])
528
+ ]),
529
+ e[30] || (e[30] = a("hr", { class: "my-8" }, null, -1)),
530
+ a("div", null, [
531
+ t(p, { class: "text-base font-medium" }, {
532
+ default: o(() => [...e[24] || (e[24] = [
533
+ d(" Customer Information (Optional) ", -1)
534
+ ])]),
535
+ _: 1
536
+ }),
537
+ e[26] || (e[26] = a("p", { class: "text-sm text-muted-foreground mb-2" }, " Collect additional details about your customer. ", -1)),
538
+ a("div", Ne, [
539
+ (u(!0), f(R, null, L(l.customerInformationFields, (r) => (u(), f("div", {
540
+ key: r.id,
541
+ class: "flex items-center justify-between hover:bg-input/50 px-2 rounded"
542
+ }, [
543
+ a("div", null, [
544
+ a("p", ke, w(r.fieldName), 1)
545
+ ]),
546
+ a("div", null, [
547
+ t(x, {
548
+ variant: "ghost",
549
+ size: "icon",
550
+ onClick: (_) => T.value.openDialog(r),
551
+ class: "active:scale-90 transition-transform duration-150"
552
+ }, {
553
+ default: o(() => [
554
+ t(A(te), { class: "size-4" })
555
+ ]),
556
+ _: 1
557
+ }, 8, ["onClick"]),
558
+ t(x, {
559
+ variant: "ghost",
560
+ size: "icon",
561
+ onClick: (_) => r.visible = !r.visible,
562
+ class: "active:scale-90 transition-transform duration-150"
563
+ }, {
564
+ default: o(() => [
565
+ r.visible ? (u(), v(A(ie), {
566
+ key: 0,
567
+ class: "size-4"
568
+ })) : (u(), v(A(oe), {
569
+ key: 1,
570
+ class: "size-4"
571
+ }))
572
+ ]),
573
+ _: 2
574
+ }, 1032, ["onClick"]),
575
+ t(x, {
576
+ variant: "ghost",
577
+ size: "icon",
578
+ disabled: r.isNativeField,
579
+ onClick: (_) => l.customerInformationFields = l.customerInformationFields.filter((J) => J.id !== r.id),
580
+ class: "active:scale-90 transition-transform duration-150"
581
+ }, {
582
+ default: o(() => [
583
+ t(A(le), { class: "size-4" })
584
+ ]),
585
+ _: 1
586
+ }, 8, ["disabled", "onClick"])
587
+ ])
588
+ ]))), 128)),
589
+ t(x, {
590
+ variant: "outline",
591
+ class: "mt-4",
592
+ onClick: e[6] || (e[6] = (r) => T.value.openDialog())
593
+ }, {
594
+ default: o(() => [
595
+ t(A(ne), { class: "size-4" }),
596
+ e[25] || (e[25] = d(" Add New Field ", -1))
597
+ ]),
598
+ _: 1
599
+ })
600
+ ]),
601
+ t(ge, {
602
+ ref_key: "customerInfoFieldDialog",
603
+ ref: T,
604
+ onAddField: q,
605
+ onUpdateField: E,
606
+ onRemoveField: P
607
+ }, null, 512)
608
+ ]),
609
+ a("div", Fe, [
610
+ t(x, {
611
+ onClick: U,
612
+ disabled: n.value
613
+ }, {
614
+ default: o(() => [
615
+ d(w(n.value ? "Saving..." : "Save Changes"), 1)
616
+ ]),
617
+ _: 1
618
+ }, 8, ["disabled"])
619
+ ])
620
+ ]))
621
+ ]),
622
+ _: 1
623
+ });
624
+ };
625
+ }
626
+ });
627
+ export {
628
+ Ae as default
629
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),P=require("./EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js"),g=require("lucide-vue-next"),M=require("@oneclick.dev/cms-kit"),z={class:"space-y-6 py-4"},G={key:0},j={key:1},O={class:"flex items-center gap-3"},H={key:2,class:"grid gap-2"},W={class:"w-full flex justify-between items-center"},K={class:"flex items-center gap-2 ml-auto"},J=e.defineComponent({__name:"CustomerInformationFieldEditorDialog",emits:["add-field","update-field","remove-field"],setup(q,{expose:y,emit:f}){const v=f,s=e.ref(!1),n=e.ref("add"),l=e.reactive({id:"",fieldName:"",fieldDescription:"",fieldType:"text",required:!1,isNativeField:!1,visible:!0,options:[]}),b=[{value:"text",label:"Text Box"},{value:"checkbox",label:"Checkbox"},{value:"radio",label:"Radio Button"},{value:"select",label:"Select"}],N=o=>{n.value=o?"edit":"add",d.value=[],l.id=o?.id||"",l.fieldName=o?.fieldName||"",l.fieldDescription=o?.fieldDescription||"",l.fieldType=o?.fieldType||"text",l.required=o?.required||!1,l.isNativeField=o?.isNativeField||!1,l.options=o?.options||[],l.visible=o?.visible!==void 0?o.visible:!0,s.value=!0},T=()=>{s.value=!1,d.value=[]},_=()=>{k()&&(v("add-field",{...l}),s.value=!1)},I=()=>{k()&&(v("update-field",{...l}),s.value=!1)},F=()=>{v("remove-field",l.id),s.value=!1},d=e.ref([]),k=()=>(d.value=[],l.fieldName=l.fieldName.trim(),l.fieldName?!0:(d.value.push("Field name is required."),!1));return y({openDialog:N}),(o,t)=>{const r=e.resolveComponent("DialogTitle"),V=e.resolveComponent("DialogHeader"),m=e.resolveComponent("Label"),u=e.resolveComponent("Input"),B=e.resolveComponent("SelectValue"),E=e.resolveComponent("SelectTrigger"),x=e.resolveComponent("SelectItem"),S=e.resolveComponent("SelectContent"),h=e.resolveComponent("Select"),A=e.resolveComponent("TagsInputItemText"),C=e.resolveComponent("TagsInputItemDelete"),w=e.resolveComponent("TagsInputItem"),D=e.resolveComponent("TagsInputInput"),c=e.resolveComponent("TagsInput"),i=e.resolveComponent("Checkbox"),p=e.resolveComponent("Button"),L=e.resolveComponent("DialogFooter"),R=e.resolveComponent("DialogScrollContent"),$=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock($,{open:s.value,"onUpdate:open":t[5]||(t[5]=a=>s.value=a)},{default:e.withCtx(()=>[e.createVNode(R,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(V,null,{default:e.withCtx(()=>[e.createVNode(r,null,{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("Customer Information",-1)])]),_:1})]),_:1}),e.createElementVNode("div",z,[e.createElementVNode("div",null,[e.createVNode(m,{class:"text-bsmase font-normal mb-1.5",for:"customer-info-field-dialog-fieldname"},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Field Name",-1)])]),_:1}),e.createVNode(u,{modelValue:l.fieldName,"onUpdate:modelValue":t[0]||(t[0]=a=>l.fieldName=a),id:"customer-info-field-dialog-fieldname"},null,8,["modelValue"])]),e.createElementVNode("div",null,[e.createVNode(m,{class:"text-sm font-normal mb-1.5",for:"customer-info-field-dialog-field-description"},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("Field Description",-1)])]),_:1}),e.createVNode(u,{modelValue:l.fieldDescription,"onUpdate:modelValue":t[1]||(t[1]=a=>l.fieldDescription=a),id:"customer-info-field-dialog-field-description"},null,8,["modelValue"])]),l.isNativeField?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(m,{class:"text-sm font-normal mb-1.5"},{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("Field Type",-1)])]),_:1}),e.createVNode(h,{modelValue:l.fieldType,"onUpdate:modelValue":t[2]||(t[2]=a=>l.fieldType=a)},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(B,{placeholder:"Select field type"})]),_:1}),e.createVNode(S,null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,a=>e.createVNode(x,{key:a.value,value:a.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])])),l.fieldType==="select"||l.fieldType==="radio"?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(m,{class:"text-sm font-normal mb-1.5",for:"customer-info-field-dialog-field-new-option"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("Options",-1)])]),_:1}),e.createVNode(c,{modelValue:l.options,"onUpdate:modelValue":t[3]||(t[3]=a=>l.options=a)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,a=>(e.openBlock(),e.createBlock(w,{key:a,value:a},{default:e.withCtx(()=>[e.createVNode(A),e.createVNode(C)]),_:1},8,["value"]))),128)),e.createVNode(D,{placeholder:"New option...",id:"customer-info-field-dialog-field-new-option"})]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createElementVNode("div",O,[e.createVNode(i,{id:"customer-info-field-dialog-field-required",modelValue:l.required,"onUpdate:modelValue":t[4]||(t[4]=a=>l.required=a)},null,8,["modelValue"]),e.createVNode(m,{for:"customer-info-field-dialog-field-required",class:"text-base font-normal cursor-pointer"},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode(" Is this field mandatory? ",-1)])]),_:1})]),d.value.length>0?(e.openBlock(),e.createElementBlock("p",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,U)=>(e.openBlock(),e.createElementBlock("span",{key:U,class:"text-sm text-red-600 block"},e.toDisplayString(a),1))),128))])):e.createCommentVNode("",!0)]),e.createVNode(L,{class:"gap-2"},{default:e.withCtx(()=>[e.createElementVNode("div",W,[n.value==="edit"&&!l.isNativeField?(e.openBlock(),e.createBlock(p,{key:0,variant:"destructive",onClick:F},{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode(" Remove Field ",-1)])]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createVNode(p,{variant:"outline",onClick:T},{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),n.value==="add"?(e.openBlock(),e.createBlock(p,{key:0,onClick:_},{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode(" Add Field ",-1)])]),_:1})):(e.openBlock(),e.createBlock(p,{key:1,onClick:I},{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode(" Update Field ",-1)])]),_:1}))])])]),_:1})]),_:1})]),_:1},8,["open"])}}}),Q={key:0,class:"max-w-2xl"},X={key:0,class:"text-sm text-orange-500 mt-2"},Y={class:"space-y-3"},Z={class:"flex items-center justify-between rounded-lg border p-4 bg-card"},ee={class:"space-y-2"},te={class:"border rounded-md p-4 mb-4"},oe={class:"font-medium text-sm"},ne={class:"flex justify-start mt-8"},le=e.defineComponent({__name:"availability",setup(q){const{params:y}=M.useModuleRoute(),{config:f}=M.useModule(),v=M.useFirebaseIntegration(f.project),s=[{id:"firstName",fieldName:"First Name",fieldType:"text",required:!0,visible:!0,isNativeField:!0},{id:"lastName",fieldName:"Last Name",fieldType:"text",required:!0,visible:!0,isNativeField:!0},{id:"phone",fieldName:"Phone No",fieldType:"tel",required:!0,visible:!0,isNativeField:!0},{id:"email",fieldName:"Email",fieldType:"email",required:!0,visible:!0,isNativeField:!0}],n=e.reactive({minimumAdvanceNotice:{value:0,unit:"minutes"},serviceVisibility:60,maxTicketsPerReservation:"",customerInformationFields:[...s],needsApproval:!1}),l=e.ref(!1),b=e.ref(!0),N=e.ref(null),T=async()=>{l.value=!0;try{const o=y.value.id;if(!o)throw new Error("Missing agenda ID");await v.update(f.agendaCollection,o,{minimumAdvanceNotice:{value:Number(n.minimumAdvanceNotice?.value)||0,unit:n.minimumAdvanceNotice?.unit??"minutes"},serviceVisibility:Math.max(Number(n.serviceVisibility)||1,1),maxTicketsPerReservation:Math.max(Number(n.maxTicketsPerReservation)||0,0),customerInformationFields:n.customerInformationFields??[],needsApproval:n.needsApproval||!1})}catch(o){console.error("Error saving changes:",o)}finally{l.value=!1}},_=async o=>{delete o.isNativeField,o.fieldType!=="radio"&&o.fieldType!=="select"&&delete o.options;let t=Math.random().toString(36).substr(2,9);for(;n.customerInformationFields.find(r=>r.id===t);)t=Math.random().toString(36).substr(2,9);n.customerInformationFields.push({...o,id:t})},I=async o=>{o.isNativeField||delete o.isNativeField,o.fieldType!=="radio"&&o.fieldType!=="select"&&delete o.options;const t=n.customerInformationFields.findIndex(r=>r.id===o.id);t!==-1&&(n.customerInformationFields[t]={...o})},F=async o=>{n.customerInformationFields=n.customerInformationFields.filter(t=>t.id!==o)},d=async()=>{try{const o=await v.get(f.agendaCollection,y.value.id);o&&(console.log("Loaded agenda data:",o),n.minimumAdvanceNotice=o.minimumAdvanceNotice||{value:0,unit:"minutes"},n.serviceVisibility=o.serviceVisibility||60,n.maxTicketsPerReservation=Number(o.maxTicketsPerReservation)&&o.maxTicketsPerReservation>0?parseInt(o.maxTicketsPerReservation):"",n.customerInformationFields=o.customerInformationFields||[...s],n.needsApproval=o.needsApproval||!1)}catch(o){console.error("Error loading agenda data:",o)}finally{b.value=!1}},k=()=>{let o=Math.abs(n.minimumAdvanceNotice.value),t=n.minimumAdvanceNotice.unit;return o===1?(t.endsWith("s")&&(t=t.slice(0,-1)),`Lead time is negative. Bookings remain open for 1 ${t} after the slot has started.`):`Lead time is negative. Bookings remain open for ${o} ${t} after the slot has started.`};return d(),(o,t)=>{const r=e.resolveComponent("Label"),V=e.resolveComponent("InputGroupInput"),m=e.resolveComponent("Search"),u=e.resolveComponent("InputGroupAddon"),B=e.resolveComponent("SelectValue"),E=e.resolveComponent("SelectTrigger"),x=e.resolveComponent("SelectItem"),S=e.resolveComponent("SelectGroup"),h=e.resolveComponent("SelectContent"),A=e.resolveComponent("Select"),C=e.resolveComponent("InputGroup"),w=e.resolveComponent("Badge"),D=e.resolveComponent("Switch"),c=e.resolveComponent("Button");return e.openBlock(),e.createBlock(P._sfc_main,null,{default:e.withCtx(()=>[t[31]||(t[31]=e.createElementVNode("h1",{class:"text-lg font-medium mb-8"},"Availability Settings",-1)),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("div",null,[e.createVNode(r,{for:"lead-time",class:"text-base font-medium mb-2"},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Minimum Advance Notice - Lead Time (Optional) ",-1)])]),_:1}),e.createVNode(C,{class:"max-w-md"},{default:e.withCtx(()=>[e.createVNode(V,{placeholder:"0",id:"lead-time",modelValue:n.minimumAdvanceNotice.value,"onUpdate:modelValue":t[0]||(t[0]=i=>n.minimumAdvanceNotice.value=i),modelModifiers:{value:!0},type:"number",class:"no-spinner"},null,8,["modelValue"]),e.createVNode(u,null,{default:e.withCtx(()=>[e.createVNode(m)]),_:1}),e.createVNode(u,{align:"inline-end"},{default:e.withCtx(()=>[e.createVNode(A,{modelValue:n.minimumAdvanceNotice.unit,"onUpdate:modelValue":t[1]||(t[1]=i=>n.minimumAdvanceNotice.unit=i)},{default:e.withCtx(()=>[e.createVNode(E,{class:"w-[180px] border-0 bg-transparent -mr-1.5"},{default:e.withCtx(()=>[e.createVNode(B)]),_:1}),e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(S,null,{default:e.withCtx(()=>[e.createVNode(x,{value:"minutes"},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode(" Minutes ",-1)])]),_:1}),e.createVNode(x,{value:"hours"},{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode(" Hours ",-1)])]),_:1}),e.createVNode(x,{value:"days"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode(" Days ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),t[11]||(t[11]=e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-2"}," Set how far in advance a customer must book your slot. ",-1)),n.minimumAdvanceNotice.value<0?(e.openBlock(),e.createElementBlock("p",X,e.toDisplayString(k()),1)):e.createCommentVNode("",!0)]),t[27]||(t[27]=e.createElementVNode("hr",{class:"my-8"},null,-1)),e.createElementVNode("div",null,[e.createVNode(r,{for:"service-visibility",class:"text-base font-medium mb-2"},{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode(" Service Visibility ",-1)])]),_:1}),e.createVNode(C,{class:"max-w-md"},{default:e.withCtx(()=>[e.createVNode(V,{id:"service-visibility",modelValue:n.serviceVisibility,"onUpdate:modelValue":t[2]||(t[2]=i=>n.serviceVisibility=i),modelModifiers:{number:!0},placeholder:"1",type:"number",class:"no-spinner",min:"1",onBlur:t[3]||(t[3]=i=>n.serviceVisibility=Math.max(n.serviceVisibility,1))},null,8,["modelValue"]),e.createVNode(u,{align:"inline-end"},{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode(" days ",-1)])]),_:1})]),_:1}),t[14]||(t[14]=e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-2"}," Set how many days in advance the service is visible to customers. ",-1))]),t[28]||(t[28]=e.createElementVNode("hr",{class:"my-8"},null,-1)),e.createElementVNode("div",null,[e.createVNode(r,{for:"max-capacity",class:"text-base font-medium mb-2"},{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode(" Maximum Tickets Per Booking ",-1)])]),_:1}),e.createVNode(C,{class:"max-w-md"},{default:e.withCtx(()=>[e.createVNode(V,{placeholder:"∞",type:"number",id:"max-capacity",class:"no-spinner",min:"1",modelValue:n.maxTicketsPerReservation,"onUpdate:modelValue":t[4]||(t[4]=i=>n.maxTicketsPerReservation=i),modelModifiers:{number:!0}},null,8,["modelValue"]),e.createVNode(u,{align:"inline-end"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode(" spots ",-1)])]),_:1})]),_:1}),t[17]||(t[17]=e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-2"}," Limit how many spots a customer can book in a single reservation. ",-1))]),t[29]||(t[29]=e.createElementVNode("hr",{class:"my-8"},null,-1)),e.createElementVNode("div",Y,[e.createElementVNode("div",null,[e.createVNode(r,{class:"text-base font-medium"},{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode("Booking Approval",-1)])]),_:1}),t[19]||(t[19]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"}," Choose whether you want to confirm booking requests manually or accept them automatically. ",-1))]),e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createVNode(r,{class:"text-sm font-semibold"},{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("Enable Manual Approval",-1)])]),_:1}),t[23]||(t[23]=e.createElementVNode("p",{class:"text-xs text-muted-foreground max-w-[300px]"}," When enabled, you must approve bookings within your dashboard before they are finalized. ",-1)),n.needsApproval?(e.openBlock(),e.createBlock(w,{key:0},{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode("Status: Manual Review",-1)])]),_:1})):(e.openBlock(),e.createBlock(w,{key:1,variant:"secondary"},{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createTextVNode("Status: Auto-Confirm",-1)])]),_:1}))]),e.createVNode(D,{modelValue:n.needsApproval,"onUpdate:modelValue":t[5]||(t[5]=i=>n.needsApproval=i)},null,8,["modelValue"])])]),t[30]||(t[30]=e.createElementVNode("hr",{class:"my-8"},null,-1)),e.createElementVNode("div",null,[e.createVNode(r,{class:"text-base font-medium"},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createTextVNode(" Customer Information (Optional) ",-1)])]),_:1}),t[26]||(t[26]=e.createElementVNode("p",{class:"text-sm text-muted-foreground mb-2"}," Collect additional details about your customer. ",-1)),e.createElementVNode("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.customerInformationFields,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,class:"flex items-center justify-between hover:bg-input/50 px-2 rounded"},[e.createElementVNode("div",null,[e.createElementVNode("p",oe,e.toDisplayString(i.fieldName),1)]),e.createElementVNode("div",null,[e.createVNode(c,{variant:"ghost",size:"icon",onClick:p=>N.value.openDialog(i),class:"active:scale-90 transition-transform duration-150"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Pencil),{class:"size-4"})]),_:1},8,["onClick"]),e.createVNode(c,{variant:"ghost",size:"icon",onClick:p=>i.visible=!i.visible,class:"active:scale-90 transition-transform duration-150"},{default:e.withCtx(()=>[i.visible?(e.openBlock(),e.createBlock(e.unref(g.Eye),{key:0,class:"size-4"})):(e.openBlock(),e.createBlock(e.unref(g.EyeOff),{key:1,class:"size-4"}))]),_:2},1032,["onClick"]),e.createVNode(c,{variant:"ghost",size:"icon",disabled:i.isNativeField,onClick:p=>n.customerInformationFields=n.customerInformationFields.filter(L=>L.id!==i.id),class:"active:scale-90 transition-transform duration-150"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.Trash2),{class:"size-4"})]),_:1},8,["disabled","onClick"])])]))),128)),e.createVNode(c,{variant:"outline",class:"mt-4",onClick:t[6]||(t[6]=i=>N.value.openDialog())},{default:e.withCtx(()=>[e.createVNode(e.unref(g.PlusCircle),{class:"size-4"}),t[25]||(t[25]=e.createTextVNode(" Add New Field ",-1))]),_:1})]),e.createVNode(J,{ref_key:"customerInfoFieldDialog",ref:N,onAddField:_,onUpdateField:I,onRemoveField:F},null,512)]),e.createElementVNode("div",ne,[e.createVNode(c,{onClick:T,disabled:l.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value?"Saving...":"Save Changes"),1)]),_:1},8,["disabled"])])]))]),_:1})}}});exports.default=le;