@oneclick.dev/cms-core-modules 0.0.52 → 0.0.54

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 (128) hide show
  1. package/dist/CalendarDate-CRT2Viyt.mjs +830 -0
  2. package/dist/CalendarDate-CWtpXgpD.js +1 -0
  3. package/dist/Components-D9yIIosM.mjs +623 -0
  4. package/dist/Components-DXbx0RLV.js +1 -0
  5. package/dist/ContentEditor-DRJFQKCv.mjs +34915 -0
  6. package/dist/ContentEditor-DzTi8fSZ.js +290 -0
  7. package/dist/Create-BP8TX6rj.js +1 -0
  8. package/dist/Create-Bwf1RXdG.mjs +1248 -0
  9. package/dist/DateFormatter-BbcSwTs4.js +1 -0
  10. package/dist/DateFormatter-CbO0PVUK.mjs +99 -0
  11. package/dist/Detail-B-PnkcXD.mjs +3473 -0
  12. package/dist/Detail-BVlGSjOq.mjs +380 -0
  13. package/dist/Detail-C4E1T87K.mjs +26 -0
  14. package/dist/Detail-CNfTDUE5.js +1 -0
  15. package/dist/Detail-Cd5CBVN0.js +1 -0
  16. package/dist/Detail-CpfOQChd.mjs +585 -0
  17. package/dist/Detail-CwagT6gQ.mjs +650 -0
  18. package/dist/Detail-DUo6qKqO.js +1 -0
  19. package/dist/Detail-Dd_OkpcN.js +1 -0
  20. package/dist/Detail-mvSGbnFU.js +1 -0
  21. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +1 -0
  22. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +55 -0
  23. package/dist/Entries-DcpPvlYj.js +1 -0
  24. package/dist/Entries-QLMtTYLX.mjs +713 -0
  25. package/dist/Find-BPR0uU-Z.mjs +229 -0
  26. package/dist/Find-BidEQJxT.js +1 -0
  27. package/dist/GlobalStyling-CMzPRd18.js +17 -0
  28. package/dist/GlobalStyling-DoLHUJeV.mjs +988 -0
  29. package/dist/Overview-BDlBCUI_.js +1 -0
  30. package/dist/Overview-BH3NwvNX.mjs +26 -0
  31. package/dist/Overview-BLsZMHNW.mjs +178 -0
  32. package/dist/Overview-BNMZ9MUK.js +1 -0
  33. package/dist/Overview-BbvfH1u-.js +1 -0
  34. package/dist/Overview-CDN88OSM.mjs +190 -0
  35. package/dist/Overview-CEPodGCn.mjs +311 -0
  36. package/dist/Overview-CvquDPhB.js +1 -0
  37. package/dist/Overview-D54pjmI6.mjs +633 -0
  38. package/dist/Overview-D67UjG6n.mjs +947 -0
  39. package/dist/Overview-KT2Mgfh5.js +1 -0
  40. package/dist/Overview-T-lsy3UZ.js +1 -0
  41. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +1 -0
  42. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +392 -0
  43. package/dist/TableView-CpO53xcX.js +111 -0
  44. package/dist/TableView-D9J5rUls.mjs +72921 -0
  45. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
  46. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs +40 -0
  47. package/dist/View-DlHBZbFu.js +1 -0
  48. package/dist/View-Dv5QMrSn.mjs +25 -0
  49. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  50. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  51. package/dist/agenda-B49oKGeh.mjs +706 -0
  52. package/dist/agenda-DipQ5IWP.js +1 -0
  53. package/dist/availability-C7q9tq6l.js +1 -0
  54. package/dist/availability-DeCkqiu8.mjs +613 -0
  55. package/dist/cms-core-modules.css +1 -1
  56. package/dist/countries-BTPvmrsb.mjs +4 -0
  57. package/dist/countries-CgZ081No.js +1 -0
  58. package/dist/exceptions-D3b18TiY.mjs +647 -0
  59. package/dist/exceptions-DJ9zWX3k.js +1 -0
  60. package/dist/floating-ui.dom-C82nbomj.js +1 -0
  61. package/dist/floating-ui.dom-ouSgPqty.mjs +1133 -0
  62. package/dist/google-CvtuJwgk.mjs +4 -0
  63. package/dist/google-D4N3gb01.js +1 -0
  64. package/dist/index--jjEzba7.mjs +24 -0
  65. package/dist/index-9HVlmvK3.js +1 -0
  66. package/dist/index-BEGU8Kme.mjs +12 -0
  67. package/dist/index-Bwi1mtkq.mjs +24 -0
  68. package/dist/index-BzuHN-r8.mjs +24 -0
  69. package/dist/index-CImCyE3L.mjs +24 -0
  70. package/dist/index-CKPshlZ8-BQiiP6r_.mjs +1264 -0
  71. package/dist/index-CKPshlZ8-CIz1tDwX.js +1 -0
  72. package/dist/index-CQiY-oTN.mjs +24 -0
  73. package/dist/index-CSxYBeVA.js +1 -0
  74. package/dist/index-CkiNvRzs.js +1 -0
  75. package/dist/index-Co4ON2Di.js +1 -0
  76. package/dist/index-CwqrAU-H.js +1 -0
  77. package/dist/index-Cz-baGax.js +1 -0
  78. package/dist/index-D2a6wEPh.js +1 -0
  79. package/dist/index-DFQGVHTs.js +1 -0
  80. package/dist/index-DI6mydpm.mjs +138 -0
  81. package/dist/index-DMoyoaks.mjs +22 -0
  82. package/dist/index-DT1wWnUk.mjs +24 -0
  83. package/dist/index-DUeFrD-B.js +1 -0
  84. package/dist/index-DsnoK4ia.mjs +579 -0
  85. package/dist/index-R2oUDsjx.js +1 -0
  86. package/dist/index-RLz1QPrf.mjs +203 -0
  87. package/dist/index-UtjLbLw-.js +1 -0
  88. package/dist/index-_mG-aU3Z.mjs +87 -0
  89. package/dist/index-_sQDF1pH.js +1 -0
  90. package/dist/index-ijdf0d9-.js +1 -0
  91. package/dist/index-klI238nT.mjs +24 -0
  92. package/dist/index.cjs.js +1 -357
  93. package/dist/index.mjs +287 -69281
  94. package/dist/interpolation-BNUjI7LH.js +1 -0
  95. package/dist/interpolation-BpGXqOz8.mjs +59 -0
  96. package/dist/payment-kTjsV0Jj.js +1 -0
  97. package/dist/payment-zpCM0LD-.mjs +981 -0
  98. package/dist/regular-C4_3YXqx.mjs +602 -0
  99. package/dist/regular-DFwPEbZO.js +1 -0
  100. package/dist/regular-slots-4ooEpICB.mjs +67 -0
  101. package/dist/regular-slots-BAVGbomI.js +1 -0
  102. package/dist/resources-MpQkSstv.mjs +563 -0
  103. package/dist/resources-iM28T3dD.js +1 -0
  104. package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +12 -2
  105. package/dist/src/appointments/index.d.ts +4 -28
  106. package/dist/src/appointments/routes.d.ts +3 -9
  107. package/dist/src/content-manager/index.d.ts +5 -147
  108. package/dist/src/content-manager/routes.d.ts +4 -128
  109. package/dist/src/custom/index.d.ts +2 -2
  110. package/dist/src/custom/routes.d.ts +1 -1
  111. package/dist/src/lib/interpolation.d.ts +2 -2
  112. package/dist/src/mail-templates/index.d.ts +2 -30
  113. package/dist/src/mail-templates/routes.d.ts +1 -11
  114. package/dist/src/product-collections/index.d.ts +2 -30
  115. package/dist/src/product-collections/routes.d.ts +1 -11
  116. package/dist/src/products/index.d.ts +2 -30
  117. package/dist/src/products/routes.d.ts +1 -11
  118. package/dist/src/promo-codes/index.d.ts +2 -30
  119. package/dist/src/promo-codes/routes.d.ts +1 -11
  120. package/dist/src/shipping-options/index.d.ts +2 -30
  121. package/dist/src/shipping-options/routes.d.ts +1 -11
  122. package/dist/src/table/index.d.ts +2 -70
  123. package/dist/src/table/routes.d.ts +1 -51
  124. package/dist/utils-BVKy9S2J.mjs +29 -0
  125. package/dist/utils-D6CaKJbp.js +2 -0
  126. package/dist/vee-validate-zod-BPQyEfpF.js +1 -0
  127. package/dist/vee-validate-zod-IXkfh-6Q.mjs +4402 -0
  128. package/package.json +28 -29
@@ -0,0 +1,67 @@
1
+ import { defineComponent as C, ref as m, resolveComponent as f, createBlock as k, openBlock as w, withCtx as i, createElementVNode as t, createTextVNode as o, createVNode as r, unref as v, toDisplayString as y } from "vue";
2
+ import { _ as S } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
3
+ import { _ as V } from "./RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs";
4
+ import { useModuleRoute as N, useModule as B, useFirebaseIntegration as T } from "@oneclick.dev/cms-kit";
5
+ const $ = { class: "mb-6 text-muted-foreground text-sm" }, j = { class: "max-w-2xl" }, D = { class: "flex justify-end mt-6" }, O = /* @__PURE__ */ C({
6
+ __name: "regular-slots",
7
+ setup(L) {
8
+ const { params: n, resolvePath: p } = N(), { config: a } = B(), u = T(a.project), s = m({
9
+ 1: [],
10
+ 2: [],
11
+ 3: [],
12
+ 4: [],
13
+ 5: [],
14
+ 6: [],
15
+ 0: []
16
+ }), l = m(!1), c = async () => {
17
+ let d = await u.get(a.agendaCollection, n.value.id);
18
+ s.value = d.timeslots;
19
+ }, g = async () => {
20
+ l.value = !0, await u.update(a.agendaCollection, n.value.id, { timeslots: s.value }), l.value = !1;
21
+ };
22
+ return c(), (d, e) => {
23
+ const b = f("NuxtLink"), x = f("Button");
24
+ return w(), k(S, null, {
25
+ default: i(() => [
26
+ e[6] || (e[6] = t("h1", { class: "text-lg font-medium mb-2" }, "Slot Configuration", -1)),
27
+ t("p", $, [
28
+ e[2] || (e[2] = o(" Define the regular time slots for this service. These time slots will be available for booking on a recurring basis. ", -1)),
29
+ e[3] || (e[3] = t("br", null, null, -1)),
30
+ e[4] || (e[4] = o(' You can always override availability for specific dates in the "', -1)),
31
+ r(b, {
32
+ class: "font-medium underline cursor-pointer",
33
+ to: v(p)(`/edit/${v(n).id}/exceptions`)
34
+ }, {
35
+ default: i(() => [...e[1] || (e[1] = [
36
+ o("Override Slots", -1)
37
+ ])]),
38
+ _: 1
39
+ }, 8, ["to"]),
40
+ e[5] || (e[5] = o('" tab. ', -1))
41
+ ]),
42
+ t("div", j, [
43
+ r(V, {
44
+ modelValue: s.value,
45
+ "onUpdate:modelValue": e[0] || (e[0] = (_) => s.value = _)
46
+ }, null, 8, ["modelValue"]),
47
+ t("div", D, [
48
+ r(x, {
49
+ onClick: g,
50
+ disabled: l.value
51
+ }, {
52
+ default: i(() => [
53
+ o(y(l.value ? "Saving..." : "Save Changes"), 1)
54
+ ]),
55
+ _: 1
56
+ }, 8, ["disabled"])
57
+ ])
58
+ ])
59
+ ]),
60
+ _: 1
61
+ });
62
+ };
63
+ }
64
+ });
65
+ export {
66
+ O as default
67
+ };
@@ -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-BWuKVkvV.js"),_=require("./RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js"),a=require("@oneclick.dev/cms-kit"),g={class:"mb-6 text-muted-foreground text-sm"},x={class:"max-w-2xl"},V={class:"flex justify-end mt-6"},b=e.defineComponent({__name:"regular-slots",setup(N){const{params:n,resolvePath:u}=a.useModuleRoute(),{config:l}=a.useModule(),i=a.useFirebaseIntegration(l.project),o=e.ref({1:[],2:[],3:[],4:[],5:[],6:[],0:[]}),s=e.ref(!1),d=async()=>{let r=await i.get(l.agendaCollection,n.value.id);o.value=r.timeslots},c=async()=>{s.value=!0,await i.update(l.agendaCollection,n.value.id,{timeslots:o.value}),s.value=!1};return d(),(r,t)=>{const m=e.resolveComponent("NuxtLink"),v=e.resolveComponent("Button");return e.openBlock(),e.createBlock(p._sfc_main,null,{default:e.withCtx(()=>[t[6]||(t[6]=e.createElementVNode("h1",{class:"text-lg font-medium mb-2"},"Slot Configuration",-1)),e.createElementVNode("p",g,[t[2]||(t[2]=e.createTextVNode(" Define the regular time slots for this service. These time slots will be available for booking on a recurring basis. ",-1)),t[3]||(t[3]=e.createElementVNode("br",null,null,-1)),t[4]||(t[4]=e.createTextVNode(' You can always override availability for specific dates in the "',-1)),e.createVNode(m,{class:"font-medium underline cursor-pointer",to:e.unref(u)(`/edit/${e.unref(n).id}/exceptions`)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode("Override Slots",-1)])]),_:1},8,["to"]),t[5]||(t[5]=e.createTextVNode('" tab. ',-1))]),e.createElementVNode("div",x,[e.createVNode(_._sfc_main,{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=f=>o.value=f)},null,8,["modelValue"]),e.createElementVNode("div",V,[e.createVNode(v,{onClick:c,disabled:s.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value?"Saving...":"Save Changes"),1)]),_:1},8,["disabled"])])])]),_:1})}}});exports.default=b;
@@ -0,0 +1,563 @@
1
+ import { defineComponent as K, ref as C, reactive as de, computed as $, resolveComponent as s, createBlock as b, openBlock as m, withCtx as l, createVNode as t, createElementVNode as n, createTextVNode as d, toDisplayString as v, createElementBlock as _, Fragment as W, renderList as X, normalizeStyle as Z, normalizeClass as ee, createCommentVNode as A, unref as V } from "vue";
2
+ import { _ as ue } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
3
+ import { useModuleRoute as ce, useConfirmation as me, useModule as pe, useFirebaseIntegration as fe } from "@oneclick.dev/cms-kit";
4
+ import { Plus as G, Pencil as ve, Copy as ge, Trash2 as be, Users as xe } from "lucide-vue-next";
5
+ const _e = { class: "space-y-5 py-4" }, ye = { class: "flex flex-wrap gap-2 mt-2" }, we = ["onClick"], ke = { class: "flex items-center justify-between rounded-lg border p-4" }, Ce = { class: "space-y-0.5" }, De = { class: "text-xs text-muted-foreground" }, Re = { class: "w-full flex justify-between items-center" }, Ve = { class: "flex items-center gap-2 ml-auto" }, Ae = /* @__PURE__ */ K({
6
+ __name: "ResourceEditorDialog",
7
+ emits: ["add-resource", "update-resource", "remove-resource"],
8
+ setup(te, { expose: M, emit: F }) {
9
+ const y = F, g = C(!1), r = C("add"), L = ["#ef4444", "#f97316", "#f59e0b", "#eab308", "#84cc16", "#22c55e", "#10b981", "#14b8a6", "#06b6d4", "#0ea5e9", "#3b82f6", "#6366f1", "#8b5cf6", "#a855f7", "#d946ef", "#ec4899", "#f43f5e"], a = de({
10
+ id: "",
11
+ name: "",
12
+ publicLabel: "",
13
+ avatarLabel: "",
14
+ description: "",
15
+ capacity: 1,
16
+ color: "blue",
17
+ isActive: !0
18
+ }), h = (p) => {
19
+ r.value = p ? "edit" : "add", a.id = p?.id || "", a.name = p?.name || "", a.publicLabel = p?.publicLabel || "", a.avatarLabel = p?.avatarLabel || "", a.description = p?.description || "", a.capacity = p?.capacity || 1, a.color = p?.color || "blue", a.isActive = p?.isActive !== void 0 ? p.isActive : !0, g.value = !0;
20
+ }, D = () => {
21
+ g.value = !1;
22
+ }, S = () => {
23
+ y("add-resource", { ...a }), g.value = !1;
24
+ }, B = () => {
25
+ y("update-resource", { ...a }), g.value = !1;
26
+ }, w = () => {
27
+ y("remove-resource", a.id), g.value = !1;
28
+ }, N = $(() => a.name.trim().length > 0);
29
+ return M({
30
+ openDialog: h
31
+ }), (p, e) => {
32
+ const T = s("DialogTitle"), j = s("DialogDescription"), z = s("DialogHeader"), x = s("Label"), k = s("Input"), H = s("NumberFieldDecrement"), I = s("NumberFieldInput"), i = s("NumberFieldIncrement"), o = s("NumberFieldContent"), f = s("NumberField"), O = s("Textarea"), U = s("Switch"), R = s("Button"), P = s("DialogFooter"), E = s("DialogScrollContent"), q = s("Dialog");
33
+ return m(), b(q, {
34
+ open: g.value,
35
+ "onUpdate:open": e[6] || (e[6] = (c) => g.value = c)
36
+ }, {
37
+ default: l(() => [
38
+ t(E, { class: "sm:max-w-xl" }, {
39
+ default: l(() => [
40
+ t(z, null, {
41
+ default: l(() => [
42
+ t(T, null, {
43
+ default: l(() => [
44
+ d(v(r.value === "add" ? "Add New Resource" : "Edit Resource"), 1)
45
+ ]),
46
+ _: 1
47
+ }),
48
+ t(j, null, {
49
+ default: l(() => [
50
+ d(v(r.value === "add" ? "Define a new bookable resource such as staff member, room, or equipment." : "Update the details of this resource."), 1)
51
+ ]),
52
+ _: 1
53
+ })
54
+ ]),
55
+ _: 1
56
+ }),
57
+ n("div", _e, [
58
+ n("div", null, [
59
+ t(x, {
60
+ class: "text-sm font-normal mb-1.5",
61
+ for: "resource-name"
62
+ }, {
63
+ default: l(() => [...e[7] || (e[7] = [
64
+ d(" Resource Name ", -1),
65
+ n("span", { class: "text-destructive" }, "*", -1)
66
+ ])]),
67
+ _: 1
68
+ }),
69
+ t(k, {
70
+ modelValue: a.name,
71
+ "onUpdate:modelValue": e[0] || (e[0] = (c) => a.name = c),
72
+ id: "resource-name",
73
+ placeholder: "e.g., James, Box 1, Meeting Room A"
74
+ }, null, 8, ["modelValue"]),
75
+ e[8] || (e[8] = n("p", { class: "text-xs text-muted-foreground mt-1" }, " Internal name visible to your team. ", -1))
76
+ ]),
77
+ n("div", null, [
78
+ t(x, {
79
+ class: "text-sm font-normal mb-1.5",
80
+ for: "resource-public-label"
81
+ }, {
82
+ default: l(() => [...e[9] || (e[9] = [
83
+ d(" Public Label ", -1)
84
+ ])]),
85
+ _: 1
86
+ }),
87
+ t(k, {
88
+ modelValue: a.publicLabel,
89
+ "onUpdate:modelValue": e[1] || (e[1] = (c) => a.publicLabel = c),
90
+ id: "resource-public-label",
91
+ placeholder: "Name shown to customers"
92
+ }, null, 8, ["modelValue"]),
93
+ e[10] || (e[10] = n("p", { class: "text-xs text-muted-foreground mt-1" }, " If empty, the internal name will be displayed to customers. ", -1))
94
+ ]),
95
+ n("div", null, [
96
+ t(x, {
97
+ class: "text-sm font-normal mb-1.5",
98
+ for: "resource-avatar-label"
99
+ }, {
100
+ default: l(() => [...e[11] || (e[11] = [
101
+ d(" Avatar Label ", -1)
102
+ ])]),
103
+ _: 1
104
+ }),
105
+ t(k, {
106
+ modelValue: a.avatarLabel,
107
+ "onUpdate:modelValue": e[2] || (e[2] = (c) => a.avatarLabel = c),
108
+ id: "resource-avatar-label",
109
+ placeholder: "e.g., B1, 1, JD",
110
+ maxlength: "3"
111
+ }, null, 8, ["modelValue"]),
112
+ e[12] || (e[12] = n("p", { class: "text-xs text-muted-foreground mt-1" }, " Short text shown in the colored circle (max 3 characters). If empty, first letter of name is used. ", -1))
113
+ ]),
114
+ n("div", null, [
115
+ t(x, { class: "text-sm font-normal mb-1.5" }, {
116
+ default: l(() => [...e[13] || (e[13] = [
117
+ d("Color", -1)
118
+ ])]),
119
+ _: 1
120
+ }),
121
+ n("div", ye, [
122
+ (m(), _(W, null, X(L, (c) => n("button", {
123
+ key: c,
124
+ type: "button",
125
+ class: ee(["size-7 rounded-full transition-all ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", [
126
+ a.color === c ? "ring-2 ring-ring ring-offset-2" : "hover:scale-110"
127
+ ]]),
128
+ style: Z({ background: c }),
129
+ onClick: (J) => a.color = c
130
+ }, null, 14, we)), 64))
131
+ ]),
132
+ e[14] || (e[14] = n("p", { class: "text-xs text-muted-foreground mt-2" }, " Used for visual identification in the calendar. ", -1))
133
+ ]),
134
+ n("div", null, [
135
+ t(x, {
136
+ class: "text-sm font-normal mb-1.5",
137
+ for: "resource-capacity"
138
+ }, {
139
+ default: l(() => [...e[15] || (e[15] = [
140
+ d(" Capacity ", -1)
141
+ ])]),
142
+ _: 1
143
+ }),
144
+ t(f, {
145
+ id: "resource-capacity",
146
+ modelValue: a.capacity,
147
+ "onUpdate:modelValue": e[3] || (e[3] = (c) => a.capacity = c),
148
+ min: 1,
149
+ max: 999
150
+ }, {
151
+ default: l(() => [
152
+ t(o, null, {
153
+ default: l(() => [
154
+ t(H),
155
+ t(I),
156
+ t(i)
157
+ ]),
158
+ _: 1
159
+ })
160
+ ]),
161
+ _: 1
162
+ }, 8, ["modelValue"]),
163
+ e[16] || (e[16] = n("p", { class: "text-xs text-muted-foreground mt-1" }, " Maximum simultaneous bookings allowed for this resource. ", -1))
164
+ ]),
165
+ n("div", null, [
166
+ t(x, {
167
+ class: "text-sm font-normal mb-1.5",
168
+ for: "resource-description"
169
+ }, {
170
+ default: l(() => [...e[17] || (e[17] = [
171
+ d(" Description ", -1)
172
+ ])]),
173
+ _: 1
174
+ }),
175
+ t(O, {
176
+ modelValue: a.description,
177
+ "onUpdate:modelValue": e[4] || (e[4] = (c) => a.description = c),
178
+ id: "resource-description",
179
+ placeholder: "Internal notes about this resource...",
180
+ rows: "3"
181
+ }, null, 8, ["modelValue"]),
182
+ e[18] || (e[18] = n("p", { class: "text-xs text-muted-foreground mt-1" }, " Admin-only notes. Not shown to customers. ", -1))
183
+ ]),
184
+ n("div", ke, [
185
+ n("div", Ce, [
186
+ t(x, { class: "text-sm font-medium" }, {
187
+ default: l(() => [...e[19] || (e[19] = [
188
+ d("Active", -1)
189
+ ])]),
190
+ _: 1
191
+ }),
192
+ n("p", De, v(a.isActive ? "Resource can be used for new slots and bookings." : "Existing bookings stay, but no new ones can be created."), 1)
193
+ ]),
194
+ t(U, {
195
+ modelValue: a.isActive,
196
+ "onUpdate:modelValue": e[5] || (e[5] = (c) => a.isActive = c)
197
+ }, null, 8, ["modelValue"])
198
+ ])
199
+ ]),
200
+ t(P, { class: "gap-2" }, {
201
+ default: l(() => [
202
+ n("div", Re, [
203
+ r.value === "edit" ? (m(), b(R, {
204
+ key: 0,
205
+ variant: "destructive",
206
+ onClick: w
207
+ }, {
208
+ default: l(() => [...e[20] || (e[20] = [
209
+ d(" Delete Resource ", -1)
210
+ ])]),
211
+ _: 1
212
+ })) : A("", !0),
213
+ n("div", Ve, [
214
+ t(R, {
215
+ variant: "outline",
216
+ onClick: D
217
+ }, {
218
+ default: l(() => [...e[21] || (e[21] = [
219
+ d(" Cancel ", -1)
220
+ ])]),
221
+ _: 1
222
+ }),
223
+ r.value === "add" ? (m(), b(R, {
224
+ key: 0,
225
+ onClick: S,
226
+ disabled: !N.value
227
+ }, {
228
+ default: l(() => [...e[22] || (e[22] = [
229
+ d(" Add Resource ", -1)
230
+ ])]),
231
+ _: 1
232
+ }, 8, ["disabled"])) : (m(), b(R, {
233
+ key: 1,
234
+ onClick: B,
235
+ disabled: !N.value
236
+ }, {
237
+ default: l(() => [...e[23] || (e[23] = [
238
+ d(" Save Changes ", -1)
239
+ ])]),
240
+ _: 1
241
+ }, 8, ["disabled"]))
242
+ ])
243
+ ])
244
+ ]),
245
+ _: 1
246
+ })
247
+ ]),
248
+ _: 1
249
+ })
250
+ ]),
251
+ _: 1
252
+ }, 8, ["open"]);
253
+ };
254
+ }
255
+ }), Le = { class: "flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-4 mb-6" }, he = { class: "max-w-4xl space-y-6" }, Ee = {
256
+ key: 0,
257
+ class: "flex flex-col @md:flex-row gap-4 items-start @md:items-center justify-between"
258
+ }, Me = { class: "relative w-full @md:w-64" }, Se = { class: "text-sm text-muted-foreground" }, Ne = {
259
+ key: 1,
260
+ class: "space-y-3"
261
+ }, ze = { class: "flex items-start gap-4" }, Ie = { class: "flex-1 min-w-0" }, Ue = { class: "flex items-center gap-2 flex-wrap" }, $e = { class: "font-medium truncate" }, Fe = { class: "flex items-center gap-4 mt-1 text-sm text-muted-foreground" }, Be = { key: 0 }, Te = {
262
+ key: 0,
263
+ class: "text-sm text-muted-foreground mt-2 line-clamp-2"
264
+ }, je = { class: "flex items-center gap-1 flex-shrink-0" }, He = {
265
+ key: 2,
266
+ class: "text-center py-8 text-muted-foreground"
267
+ }, Oe = {
268
+ key: 3,
269
+ class: "flex justify-center py-12"
270
+ }, Pe = {
271
+ key: 5,
272
+ class: "fixed bottom-4 right-4 bg-background border rounded-lg px-4 py-2 shadow-lg flex items-center gap-2"
273
+ }, Ge = /* @__PURE__ */ K({
274
+ __name: "resources",
275
+ setup(te) {
276
+ const { params: M } = ce(), { confirm: F } = me(), { config: y } = pe(), g = fe(y.project), r = C([]), L = C(!1), a = C(!0), h = C(), D = C(""), S = () => Date.now().toString(36) + Math.random().toString(36).substr(2), B = async () => {
277
+ try {
278
+ a.value = !0;
279
+ const i = await g.get(y.agendaCollection, M.value.id);
280
+ r.value = i.resources || [];
281
+ } catch (i) {
282
+ console.error("Error loading resources:", i);
283
+ } finally {
284
+ a.value = !1;
285
+ }
286
+ }, w = async () => {
287
+ L.value = !0;
288
+ try {
289
+ await g.update(y.agendaCollection, M.value.id, {
290
+ resources: r.value
291
+ });
292
+ } catch (i) {
293
+ console.error("Error saving resources:", i);
294
+ } finally {
295
+ L.value = !1;
296
+ }
297
+ }, N = (i) => {
298
+ const o = {
299
+ ...i,
300
+ id: S()
301
+ };
302
+ r.value.push(o), w();
303
+ }, p = (i) => {
304
+ const o = r.value.findIndex((f) => f.id === i.id);
305
+ o !== -1 && (r.value[o] = i), w();
306
+ }, e = async (i) => {
307
+ await F("Are you sure you want to delete this resource? This action cannot be undone.", "Delete Resource", "Delete") && (r.value = r.value.filter((f) => f.id !== i), w());
308
+ }, T = async (i) => {
309
+ const o = r.value.findIndex((f) => f.id === i.id);
310
+ o !== -1 && (r.value[o].isActive = !r.value[o].isActive, await w());
311
+ }, j = (i) => {
312
+ const o = {
313
+ ...i,
314
+ id: S(),
315
+ name: `${i.name} (Copy)`,
316
+ publicLabel: i.publicLabel ? `${i.publicLabel} (Copy)` : ""
317
+ };
318
+ r.value.push(o), w();
319
+ }, z = () => {
320
+ h.value?.openDialog();
321
+ }, x = (i) => {
322
+ h.value?.openDialog(i);
323
+ }, k = $(() => {
324
+ if (!D.value.trim())
325
+ return r.value;
326
+ const i = D.value.toLowerCase();
327
+ return r.value.filter(
328
+ (o) => o.name.toLowerCase().includes(i) || o.publicLabel?.toLowerCase().includes(i)
329
+ );
330
+ }), H = $(() => r.value.filter((i) => i.isActive).length), I = $(() => r.value.length);
331
+ return B(), (i, o) => {
332
+ const f = s("Button"), O = s("Input"), U = s("Badge"), R = s("Switch"), P = s("DropdownMenuTrigger"), E = s("DropdownMenuItem"), q = s("DropdownMenuSeparator"), c = s("DropdownMenuContent"), J = s("DropdownMenu"), oe = s("Card"), Q = s("Spinner"), ne = s("EmptyMedia"), le = s("EmptyTitle"), se = s("EmptyDescription"), ae = s("EmptyHeader"), ie = s("EmptyContent"), re = s("Empty");
333
+ return m(), b(ue, null, {
334
+ default: l(() => [
335
+ n("div", Le, [
336
+ o[2] || (o[2] = n("div", null, [
337
+ n("h1", { class: "text-lg font-medium" }, "Resource Management"),
338
+ n("p", { class: "text-muted-foreground text-sm mt-1" }, " Define the rooms, boxes, or staff that can be booked in this agenda. ")
339
+ ], -1)),
340
+ r.value.length > 0 ? (m(), b(f, {
341
+ key: 0,
342
+ onClick: z
343
+ }, {
344
+ default: l(() => [
345
+ t(V(G), { class: "size-4 mr-1.5" }),
346
+ o[1] || (o[1] = d(" Add Resource ", -1))
347
+ ]),
348
+ _: 1
349
+ })) : A("", !0)
350
+ ]),
351
+ n("div", he, [
352
+ r.value.length > 0 ? (m(), _("div", Ee, [
353
+ n("div", Me, [
354
+ t(O, {
355
+ modelValue: D.value,
356
+ "onUpdate:modelValue": o[0] || (o[0] = (u) => D.value = u),
357
+ placeholder: "Search resources...",
358
+ class: "pl-9"
359
+ }, null, 8, ["modelValue"]),
360
+ o[3] || (o[3] = n("svg", {
361
+ class: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground",
362
+ xmlns: "http://www.w3.org/2000/svg",
363
+ fill: "none",
364
+ viewBox: "0 0 24 24",
365
+ stroke: "currentColor"
366
+ }, [
367
+ n("path", {
368
+ "stroke-linecap": "round",
369
+ "stroke-linejoin": "round",
370
+ "stroke-width": "2",
371
+ d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
372
+ })
373
+ ], -1))
374
+ ]),
375
+ n("div", Se, v(H.value) + " active of " + v(I.value) + " resource" + v(I.value !== 1 ? "s" : ""), 1)
376
+ ])) : A("", !0),
377
+ k.value.length > 0 ? (m(), _("div", Ne, [
378
+ (m(!0), _(W, null, X(k.value, (u) => (m(), b(oe, {
379
+ key: u.id,
380
+ class: ee(["p-4", u.isActive ? "" : "opacity-60"])
381
+ }, {
382
+ default: l(() => [
383
+ n("div", ze, [
384
+ n("div", {
385
+ class: "size-10 rounded-full flex-shrink-0 flex items-center justify-center text-white font-medium text-sm",
386
+ style: Z({ background: u.color })
387
+ }, v(u.avatarLabel || u.name.charAt(0).toUpperCase()), 5),
388
+ n("div", Ie, [
389
+ n("div", Ue, [
390
+ n("h3", $e, v(u.name), 1),
391
+ u.isActive ? (m(), b(U, {
392
+ key: 1,
393
+ class: "text-xs pointer-events-none"
394
+ }, {
395
+ default: l(() => [...o[5] || (o[5] = [
396
+ d(" Active ", -1)
397
+ ])]),
398
+ _: 1
399
+ })) : (m(), b(U, {
400
+ key: 0,
401
+ variant: "outline",
402
+ class: "text-xs pointer-events-none"
403
+ }, {
404
+ default: l(() => [...o[4] || (o[4] = [
405
+ d(" Inactive ", -1)
406
+ ])]),
407
+ _: 1
408
+ }))
409
+ ]),
410
+ n("div", Fe, [
411
+ u.publicLabel && u.publicLabel !== u.name ? (m(), _("span", Be, " Public: " + v(u.publicLabel), 1)) : A("", !0),
412
+ n("span", null, " Capacity: " + v(u.capacity), 1)
413
+ ]),
414
+ u.description ? (m(), _("p", Te, v(u.description), 1)) : A("", !0)
415
+ ]),
416
+ n("div", je, [
417
+ t(R, {
418
+ defaultValue: u.isActive,
419
+ "onUpdate:modelValue": (Y) => T(u),
420
+ class: "mr-2"
421
+ }, null, 8, ["defaultValue", "onUpdate:modelValue"]),
422
+ t(J, null, {
423
+ default: l(() => [
424
+ t(P, { "as-child": "" }, {
425
+ default: l(() => [
426
+ t(f, {
427
+ variant: "ghost",
428
+ size: "icon"
429
+ }, {
430
+ default: l(() => [...o[6] || (o[6] = [
431
+ n("svg", {
432
+ class: "size-4",
433
+ xmlns: "http://www.w3.org/2000/svg",
434
+ fill: "none",
435
+ viewBox: "0 0 24 24",
436
+ stroke: "currentColor"
437
+ }, [
438
+ n("path", {
439
+ "stroke-linecap": "round",
440
+ "stroke-linejoin": "round",
441
+ "stroke-width": "2",
442
+ d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
443
+ })
444
+ ], -1)
445
+ ])]),
446
+ _: 1
447
+ })
448
+ ]),
449
+ _: 1
450
+ }),
451
+ t(c, { align: "end" }, {
452
+ default: l(() => [
453
+ t(E, {
454
+ onClick: (Y) => x(u)
455
+ }, {
456
+ default: l(() => [
457
+ t(V(ve), { class: "size-4 mr-2" }),
458
+ o[7] || (o[7] = d(" Edit ", -1))
459
+ ]),
460
+ _: 1
461
+ }, 8, ["onClick"]),
462
+ t(E, {
463
+ onClick: (Y) => j(u)
464
+ }, {
465
+ default: l(() => [
466
+ t(V(ge), { class: "size-4 mr-2" }),
467
+ o[8] || (o[8] = d(" Duplicate ", -1))
468
+ ]),
469
+ _: 1
470
+ }, 8, ["onClick"]),
471
+ t(q),
472
+ t(E, {
473
+ variant: "destructive",
474
+ onClick: (Y) => e(u.id)
475
+ }, {
476
+ default: l(() => [
477
+ t(V(be), { class: "size-4 mr-2" }),
478
+ o[9] || (o[9] = d(" Delete ", -1))
479
+ ]),
480
+ _: 1
481
+ }, 8, ["onClick"])
482
+ ]),
483
+ _: 2
484
+ }, 1024)
485
+ ]),
486
+ _: 2
487
+ }, 1024)
488
+ ])
489
+ ])
490
+ ]),
491
+ _: 2
492
+ }, 1032, ["class"]))), 128))
493
+ ])) : r.value.length > 0 && k.value.length === 0 ? (m(), _("div", He, [...o[10] || (o[10] = [
494
+ n("p", null, "No resources match your search.", -1)
495
+ ])])) : a.value ? (m(), _("div", Oe, [
496
+ t(Q, { class: "size-8" })
497
+ ])) : (m(), b(re, {
498
+ key: 4,
499
+ class: "border border-dashed"
500
+ }, {
501
+ default: l(() => [
502
+ t(ae, null, {
503
+ default: l(() => [
504
+ t(ne, { variant: "icon" }, {
505
+ default: l(() => [
506
+ t(V(xe), { class: "size-6" })
507
+ ]),
508
+ _: 1
509
+ }),
510
+ t(le, null, {
511
+ default: l(() => [...o[11] || (o[11] = [
512
+ d("No Resources Yet", -1)
513
+ ])]),
514
+ _: 1
515
+ }),
516
+ t(se, null, {
517
+ default: l(() => [...o[12] || (o[12] = [
518
+ d(" You haven't added any bookable resources yet. Define your staff, rooms, or equipment to start configuring availability. ", -1)
519
+ ])]),
520
+ _: 1
521
+ })
522
+ ]),
523
+ _: 1
524
+ }),
525
+ t(ie, null, {
526
+ default: l(() => [
527
+ t(f, {
528
+ variant: "outline",
529
+ onClick: z
530
+ }, {
531
+ default: l(() => [
532
+ t(V(G), { class: "size-4 mr-1.5" }),
533
+ o[13] || (o[13] = d(" Add Your First Resource ", -1))
534
+ ]),
535
+ _: 1
536
+ })
537
+ ]),
538
+ _: 1
539
+ })
540
+ ]),
541
+ _: 1
542
+ })),
543
+ L.value ? (m(), _("div", Pe, [
544
+ t(Q, { class: "size-4" }),
545
+ o[14] || (o[14] = n("span", { class: "text-sm" }, "Saving...", -1))
546
+ ])) : A("", !0)
547
+ ]),
548
+ t(Ae, {
549
+ ref_key: "resourceDialogRef",
550
+ ref: h,
551
+ onAddResource: N,
552
+ onUpdateResource: p,
553
+ onRemoveResource: e
554
+ }, null, 512)
555
+ ]),
556
+ _: 1
557
+ });
558
+ };
559
+ }
560
+ });
561
+ export {
562
+ Ge as default
563
+ };