@wisemen/wise-crm-web 1.0.0 → 1.2.0

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 (97) hide show
  1. package/dist/ActivityIcon-DNdtN-M_.js +19 -0
  2. package/dist/AppSkeletonLoader-Dq6pKznm.js +1112 -0
  3. package/dist/{AttachmentIcon-CsucE3yf.js → AttachmentIcon-BLUd7LaN.js} +9 -7
  4. package/dist/BoldIcon-WRYUWz15.js +16 -0
  5. package/dist/{BookIcon-DgT3flV5.js → BookIcon-Bb3r5y_J.js} +9 -7
  6. package/dist/{BuildingIcon-Bm18omgW.js → BuildingIcon-DFutRg8d.js} +9 -7
  7. package/dist/{BuildingsIcon-D4X7QciL.js → BuildingsIcon-BVHy6yoa.js} +9 -7
  8. package/dist/{BulletListIcon-CNCV-cOS.js → BulletListIcon-BhOXLSBa.js} +9 -7
  9. package/dist/BusinessDetailSidebarProvider-a6VeNUii.js +2946 -0
  10. package/dist/BusinessDetailView-Dz3wDSx5.js +24 -0
  11. package/dist/ChevronDownIcon-BmyTSPND.js +19 -0
  12. package/dist/ClockIcon-BYfZAvIE.js +23 -0
  13. package/dist/ClockPlusIcon-BcNi0Y9I.js +23 -0
  14. package/dist/{CopyIcon-CUomKXdn.js → CopyIcon-2eV8MRv_.js} +9 -7
  15. package/dist/CrmDetailHeaderCard-BkA0Z-Cu.js +2523 -0
  16. package/dist/CrmDetailView-BhZEQqUH.js +67 -0
  17. package/dist/DealCommunicationTabView-Drp9MEPu.js +140 -0
  18. package/dist/DealDetailView-DWLudchX.js +1049 -0
  19. package/dist/DealExternalAttachment-B6l0gDqF.js +179 -0
  20. package/dist/{DealIcon-CpO-DkyS.js → DealIcon-BwUWYDxo.js} +9 -7
  21. package/dist/DealSendMailDialog-Dqei4933.js +1566 -0
  22. package/dist/DownloadCloudIcon-BSrLGGrY.js +19 -0
  23. package/dist/{EditWithLineIcon-C0WMD50F.js → EditWithLineIcon-BKYDPJOY.js} +9 -7
  24. package/dist/{Error-X0deDY-N.js → Error-za-wClcU.js} +2591 -2462
  25. package/dist/{FileIcon-3FebXgYQ.js → FileIcon-DL1e1tAu.js} +9 -7
  26. package/dist/FilterLinesIcon-DgVMySAE.js +22 -0
  27. package/dist/H1Icon-B6NEsEbj.js +17 -0
  28. package/dist/{H2Icon-CuEmp9I0.js → H2Icon-CNof5Ohu.js} +9 -7
  29. package/dist/{H3Icon-wAPhdYIf.js → H3Icon-B2F2Tb6r.js} +9 -7
  30. package/dist/HashIcon-C_XttKfW.js +19 -0
  31. package/dist/HomeFilledIcon-DtZ2eXxt.js +16 -0
  32. package/dist/IndividualDetailSidebarProvider-jjRoK1Av.js +609 -0
  33. package/dist/IndividualDetailView-BqIRHn-0.js +24 -0
  34. package/dist/ItalicIcon-DqBns3yy.js +17 -0
  35. package/dist/{LayersTreeIcon-Ct-owndO.js → LayersTreeIcon-DZZCSCY9.js} +10 -8
  36. package/dist/{LinkBrokenIcon-CTlqmapl.js → LinkBrokenIcon-BNBpWSi7.js} +9 -7
  37. package/dist/{LinkExternalIcon-LOVtSqBT.js → LinkExternalIcon-B7SHeB1_.js} +9 -7
  38. package/dist/LinkIcon-8bCrZEv9.js +17 -0
  39. package/dist/{LocationPinIcon-Cp-wRgk2.js → LocationPinIcon-UySRqSfG.js} +9 -7
  40. package/dist/{MailIcon-CnTrB1k3.js → MailIcon-BT7gSIZb.js} +9 -7
  41. package/dist/{MobilePhoneIcon-B747hmpS.js → MobilePhoneIcon-_KQGnCSS.js} +9 -7
  42. package/dist/NumberedListIcon-B-JVTSAe.js +17 -0
  43. package/dist/{PhoneIcon-94MYVL85.js → PhoneIcon-DGGW_MNR.js} +9 -7
  44. package/dist/{RefreshIcon-DRe3coBc.js → RefreshIcon-D1QWfdPD.js} +9 -7
  45. package/dist/{SendIcon-MYItp1xI.js → SendIcon-BtJ-NCec.js} +9 -7
  46. package/dist/{SettingsIcon-C0qTAv0w.js → SettingsIcon-CWFwJelS.js} +10 -8
  47. package/dist/{StarOutlineIcon-CiFLgepk.js → StarOutlineIcon-C-ELTCDQ.js} +9 -7
  48. package/dist/{StarYellowIcon-C0v_XGwI.js → StarYellowIcon-7wuNWaQO.js} +9 -7
  49. package/dist/{ThreeDotsIcon-lujOTU3G.js → ThreeDotsIcon-C56RWk-0.js} +12 -10
  50. package/dist/TimeLineMarkerIcon-DLmPwfs6.js +18 -0
  51. package/dist/{TrashIcon-v4L9SEK_.js → TrashIcon-o4PWmcYe.js} +9 -7
  52. package/dist/UploadCloudIcon-D2tWB0NP.js +19 -0
  53. package/dist/{UserCircleIcon-BjUt_2C4.js → UserCircleIcon-DiDajcIH.js} +10 -8
  54. package/dist/UserIcon-Bv1eF7ln.js +22 -0
  55. package/dist/{VerticalDotsIcon-Y3m6tlQ2.js → VerticalDotsIcon-YcD73UqY.js} +9 -7
  56. package/dist/{WalletIcon-pPsKbzmh.js → WalletIcon-CUh92U5K.js} +9 -7
  57. package/dist/_plugin-vue_export-helper-D3hKq4w_.js +8 -0
  58. package/dist/client-9P6xe_5g.js +4188 -0
  59. package/dist/components/auto-focus/AutoFocus.vue.d.ts +13 -0
  60. package/dist/components/column-layout/ColumnLayout.vue.d.ts +1 -1
  61. package/dist/components/row-layout/RowLayout.vue.d.ts +1 -1
  62. package/dist/components/text/Text.vue.d.ts +1 -1
  63. package/dist/index.js +1881 -1693
  64. package/dist/style.css +2 -2
  65. package/dist/testing.js +102 -98
  66. package/dist/utils/color.util.d.ts +6 -0
  67. package/dist/{uuid.util-C1p-yuFc.js → uuid.util-DpiDKVoj.js} +4 -2
  68. package/package.json +30 -30
  69. package/dist/ActivityIcon-DFD9ZhO0.js +0 -17
  70. package/dist/AppSkeletonLoader-BAhoOmFD.js +0 -1106
  71. package/dist/BoldIcon-DY2FlAS0.js +0 -14
  72. package/dist/BusinessDetailSidebarProvider-Dm6Dd7Nq.js +0 -2899
  73. package/dist/BusinessDetailView-BHVUfCpV.js +0 -24
  74. package/dist/ChevronDownIcon-CfBAAAca.js +0 -17
  75. package/dist/ClockIcon-Ckr1IQBt.js +0 -21
  76. package/dist/ClockPlusIcon-CVN69pCS.js +0 -21
  77. package/dist/CrmDetailHeaderCard-CiVLyIuw.js +0 -2516
  78. package/dist/CrmDetailView-DaAuWeiB.js +0 -65
  79. package/dist/DealCommunicationTabView-xq_zOAsr.js +0 -137
  80. package/dist/DealDetailView-C54XpYN1.js +0 -1021
  81. package/dist/DealExternalAttachment-Dp44vkgt.js +0 -177
  82. package/dist/DealSendMailDialog-D11Tgd_A.js +0 -1552
  83. package/dist/DownloadCloudIcon-VMmB9vit.js +0 -17
  84. package/dist/FilterLinesIcon-DHpRPKJB.js +0 -20
  85. package/dist/H1Icon-CPVGTTtl.js +0 -15
  86. package/dist/HashIcon-C2kfHjTC.js +0 -17
  87. package/dist/HomeFilledIcon-CxIazF0B.js +0 -14
  88. package/dist/IndividualDetailSidebarProvider-BvjhFng9.js +0 -608
  89. package/dist/IndividualDetailView-Cq8iAwQv.js +0 -24
  90. package/dist/ItalicIcon-DfV3EOdk.js +0 -15
  91. package/dist/LinkIcon-DqBbVrvs.js +0 -15
  92. package/dist/NumberedListIcon-amJxDaaD.js +0 -15
  93. package/dist/TimeLineMarkerIcon-C4LfErbc.js +0 -16
  94. package/dist/UploadCloudIcon-j1-1Rvqb.js +0 -17
  95. package/dist/UserIcon-Cb2jFKLr.js +0 -20
  96. package/dist/_plugin-vue_export-helper-BSi1g3Lh.js +0 -6
  97. package/dist/client-S6BLV3Ct.js +0 -4191
@@ -0,0 +1,1049 @@
1
+ import { $ as e, A as t, B as n, D as r, F as i, H as a, M as o, P as s, Q as c, R as l, T as u, U as d, V as f, Y as p, _ as m, a as h, c as g, d as _, et as v, f as y, g as b, h as ee, i as x, l as S, m as te, n as ne, o as C, p as re, r as ie, rt as w, s as ae, t as oe, u as se, x as ce } from "./Error-za-wClcU.js";
2
+ import { a as le, l as T, n as ue, t as de, u as E } from "./AppSkeletonLoader-Dq6pKznm.js";
3
+ import { ct as fe, ft as pe, mt as me, vt as he } from "./client-9P6xe_5g.js";
4
+ import { d as ge, f as D, g as _e, h as ve, n as ye, t as be, u as xe } from "./DealSendMailDialog-Dqei4933.js";
5
+ import { t as Se } from "./CrmDetailView-BhZEQqUH.js";
6
+ import O, { z as k } from "zod";
7
+ import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createTextVNode as I, createVNode as L, defineComponent as R, mergeModels as Ce, mergeProps as we, nextTick as Te, openBlock as z, ref as B, renderList as V, renderSlot as Ee, toDisplayString as H, unref as U, useModel as De, useTemplateRef as Oe, withCtx as W } from "vue";
8
+ import { useI18n as G } from "vue-i18n";
9
+ import { VcAutocomplete as ke, VcBadge as K, VcButton as Ae, VcDropdownMenu as je, VcDropdownMenuItem as q, VcFormFieldLabel as J, VcIconButton as Me, VcSelect as Y, VcSelectItem as X, VcTextField as Ne, useDialog as Z } from "@wisemen/vue-core-components";
10
+ import { useMutation as Pe, useQueryClient as Fe } from "@tanstack/vue-query";
11
+ import { useForm as Q } from "formango";
12
+ import { Motion as Ie } from "motion-v";
13
+ import { useRouteParams as Le } from "@vueuse/router";
14
+ //#region src/api/mutations/deal/dealUpdate.mutation.ts
15
+ function Re() {
16
+ return E({
17
+ queryFn: async ({ body: e, params: t }) => await D.update(t.dealUuid, { dealLanguage: e.dealLanguage }),
18
+ queryKeysToInvalidate: {
19
+ dealDetail: { dealUuid: (e) => e.dealUuid },
20
+ dealIndex: {}
21
+ }
22
+ });
23
+ }
24
+ function ze() {
25
+ return E({
26
+ queryFn: async ({ body: e, params: t }) => await D.update(t.dealUuid, { dealSource: e.dealSource }),
27
+ queryKeysToInvalidate: {
28
+ dealDetail: { dealUuid: (e) => e.dealUuid },
29
+ dealIndex: {}
30
+ }
31
+ });
32
+ }
33
+ function Be() {
34
+ return E({
35
+ queryFn: async ({ body: e, params: t }) => await D.update(t.dealUuid, { dealOwner: e.dealOwner }),
36
+ queryKeysToInvalidate: {
37
+ dealDetail: { dealUuid: (e) => e.dealUuid },
38
+ dealIndex: {}
39
+ }
40
+ });
41
+ }
42
+ function Ve() {
43
+ return E({
44
+ queryFn: async ({ body: e, params: t }) => await D.update(t.dealUuid, { name: e.name }),
45
+ queryKeysToInvalidate: {
46
+ dealDetail: { dealUuid: (e) => e.dealUuid },
47
+ dealIndex: {}
48
+ }
49
+ });
50
+ }
51
+ //#endregion
52
+ //#region src/deal/components/DealDetailSidebarNameField.vue?vue&type=script&setup=true&lang.ts
53
+ var He = {
54
+ key: 1,
55
+ class: "flex justify-between"
56
+ }, Ue = { class: "text-primary text-xl font-bold" }, We = /* @__PURE__ */ R({
57
+ __name: "DealDetailSidebarNameField",
58
+ props: { deal: {} },
59
+ setup(e) {
60
+ let t = e, n = G(), r = p(), i = B(!1), o = Oe("nameFieldContainerRef"), s = Ve(), c = Q({
61
+ schema: O.object({ name: O.string().min(1) }),
62
+ onSubmit: async (e) => {
63
+ try {
64
+ await s.execute({
65
+ body: { name: e.name },
66
+ params: { dealUuid: t.deal.uuid }
67
+ });
68
+ } catch (e) {
69
+ r.show(e);
70
+ } finally {
71
+ i.value = !1;
72
+ }
73
+ }
74
+ }), l = c.register("name", t.deal.name);
75
+ async function u() {
76
+ i.value = !0, await Te(), d();
77
+ }
78
+ function d() {
79
+ (o.value?.querySelector("input"))?.focus();
80
+ }
81
+ function m() {
82
+ if (!c.isDirty.value) {
83
+ i.value = !1;
84
+ return;
85
+ }
86
+ c.submit();
87
+ }
88
+ return (e, r) => (z(), P("div", {
89
+ ref_key: "nameFieldContainerRef",
90
+ ref: o
91
+ }, [i.value ? (z(), M(a, {
92
+ key: 0,
93
+ form: U(c)
94
+ }, {
95
+ default: W(() => [L(U(Ne), we(U(f)(U(l)), {
96
+ "class-config": { input: "text-xl font-bold" },
97
+ "is-loading": U(c).isSubmitting.value,
98
+ label: U(n).t("wise_crm.deal.detail.sidebar.name_field.label"),
99
+ onBlur: m
100
+ }), {
101
+ label: W(() => [L(U(J), { class: "sr-only" })]),
102
+ _: 1
103
+ }, 16, ["is-loading", "label"]), r[0] ||= F("button", {
104
+ type: "submit",
105
+ class: "sr-only"
106
+ }, null, -1)]),
107
+ _: 1
108
+ }, 8, ["form"])) : (z(), P("div", He, [F("h2", Ue, H(t.deal.name), 1), L(U(Me), {
109
+ label: U(n).t("wise_crm.deal.detail.sidebar.name_field.edit_label"),
110
+ icon: "editWithLine",
111
+ variant: "tertiary",
112
+ class: "shrink-0",
113
+ onClick: u
114
+ }, null, 8, ["label"])]))], 512));
115
+ }
116
+ });
117
+ //#endregion
118
+ //#region src/api/mutations/deal/dealSetPrimaryContactPerson.mutation.ts
119
+ function Ge() {
120
+ let e = Fe(), t = "dealDetail", n = Pe({
121
+ mutationFn: async (e) => await D.setPrimaryContactPerson(e.dealUuid, e.contactPersonUuid),
122
+ onError: (n, r, i) => {
123
+ e.setQueryData([t, { dealUuid: r.dealUuid }], i?.previousData);
124
+ },
125
+ onMutate: async (n) => {
126
+ await e.cancelQueries({ queryKey: [t] });
127
+ let r = e.getQueryData([t, { dealUuid: n.dealUuid }]);
128
+ return r === void 0 ? {} : (e.setQueryData([t, { dealUuid: n.dealUuid }], {
129
+ ...r,
130
+ contactPersons: r.contactPersons.map((e) => ({
131
+ ...e,
132
+ isPrimary: e.uuid === n.contactPersonUuid
133
+ }))
134
+ }), { previousData: r });
135
+ }
136
+ });
137
+ return {
138
+ isLoading: j(() => n.isPending.value),
139
+ data: j(() => n.data.value),
140
+ execute: async (e) => await n.mutateAsync(e.params)
141
+ };
142
+ }
143
+ //#endregion
144
+ //#region src/api/mutations/deal/dealUnlinkContactPerson.mutation.ts
145
+ function Ke() {
146
+ return E({
147
+ queryFn: async ({ body: e, params: t }) => await D.unlinkContactPerson(t.dealUuid, e.contactPersonUuid),
148
+ queryKeysToInvalidate: {
149
+ dealDetail: { dealUuid: (e) => e.dealUuid },
150
+ dealIndex: {}
151
+ }
152
+ });
153
+ }
154
+ //#endregion
155
+ //#region src/components/crm-detail/CrmDetailSidebarAccordionGenericContactPersonInfo.vue?vue&type=script&setup=true&lang.ts
156
+ var qe = { class: "flex items-start justify-between" }, Je = { class: "flex flex-col items-start" }, Ye = {
157
+ key: 1,
158
+ class: "text-brand-700"
159
+ }, Xe = { class: "-mt-2 -mr-2 flex items-center justify-end" }, Ze = { class: "gap-lg grid" }, Qe = /* @__PURE__ */ R({
160
+ __name: "CrmDetailSidebarAccordionGenericContactPersonInfo",
161
+ props: {
162
+ contactPerson: {},
163
+ description: { default: null },
164
+ onToggleIsPrimary: {}
165
+ },
166
+ emits: ["delete", "update"],
167
+ setup(e, { emit: t }) {
168
+ let n = e, r = t, i = G(), a = n.contactPerson.uuid ?? n.contactPerson.contactPersonUuid;
169
+ function o() {
170
+ r("update");
171
+ }
172
+ function s() {
173
+ r("delete");
174
+ }
175
+ function c() {
176
+ n.onToggleIsPrimary();
177
+ }
178
+ return (e, t) => (z(), M(C, { class: "gap-lg flex flex-col" }, {
179
+ default: W(() => [F("div", qe, [F("div", Je, [U(a) ? (z(), M(h, {
180
+ key: 0,
181
+ "class-config": { root: "bg-transparent border-none text-primary shadow-none h-auto w-auto hover:underline p-0 font-semibold" },
182
+ "entity-type": U(me).INDIVIDUAL,
183
+ uuid: U(a)
184
+ }, {
185
+ default: W(() => [I(H(n.contactPerson.firstName) + " " + H(n.contactPerson.lastName), 1)]),
186
+ _: 1
187
+ }, 8, ["entity-type", "uuid"])) : N("", !0), n.description ? (z(), P("p", Ye, H(n.description), 1)) : N("", !0)]), F("div", Xe, [L(x, {
188
+ icon: n.contactPerson.isPrimary ? "starYellow" : "starOutline",
189
+ label: U(i).t("wise_crm.info_dialog.sidebar.overview.contact_person_primary"),
190
+ onClick: c
191
+ }, null, 8, ["icon", "label"]), L(U(je), {
192
+ "class-config": { content: "min-w-fit p-sm" },
193
+ "popover-align": "end"
194
+ }, {
195
+ trigger: W(() => [L(U(Me), {
196
+ variant: "tertiary",
197
+ size: "sm",
198
+ label: "actionMenu",
199
+ icon: "threeDots"
200
+ })]),
201
+ content: W(() => [L(U(q), {
202
+ label: U(i).t("wise_crm.info_dialog.sidebar.overview.update_contact_person"),
203
+ icon: "editWithLine",
204
+ onSelect: o
205
+ }, null, 8, ["label"]), L(U(q), {
206
+ "is-destructive": !0,
207
+ "is-disabled": n.contactPerson.isPrimary,
208
+ label: U(i).t("wise_crm.info_dialog.sidebar.overview.delete_contact_person"),
209
+ icon: "linkBroken",
210
+ onSelect: s
211
+ }, null, 8, ["is-disabled", "label"])]),
212
+ _: 1
213
+ })])]), F("div", Ze, [
214
+ n.contactPerson.email === null ? N("", !0) : (z(), M(S, {
215
+ key: 0,
216
+ label: n.contactPerson.email,
217
+ icon: "mail"
218
+ }, null, 8, ["label"])),
219
+ n.contactPerson.mobilePhone === null ? N("", !0) : (z(), M(S, {
220
+ key: 1,
221
+ label: n.contactPerson.mobilePhone,
222
+ icon: "mobilePhone"
223
+ }, null, 8, ["label"])),
224
+ n.contactPerson.phone === null ? N("", !0) : (z(), M(S, {
225
+ key: 2,
226
+ label: n.contactPerson.phone,
227
+ icon: "phone"
228
+ }, null, 8, ["label"]))
229
+ ])]),
230
+ _: 1
231
+ }));
232
+ }
233
+ }), $e = { class: "p-lg" }, et = /* @__PURE__ */ R({
234
+ __name: "DealDetailSidebarGeneralInfo",
235
+ props: { deal: {} },
236
+ setup(e) {
237
+ let t = e, n = G(), r = p(), i = Re(), a = ze(), s = Be(), c = o({ persistInUrl: !1 }), l = ve({ params: { search: c.debouncedSearch } }), u = B(t.deal.dealLanguage), d = B(t.deal.dealSource), f = B(t.deal.owner ? {
238
+ uuid: t.deal.owner.uuid,
239
+ name: t.deal.owner.name
240
+ } : null), m = j(() => l.data.value?.data.map((e) => ({
241
+ uuid: e.uuid,
242
+ name: `${e.firstName} ${e.lastName}`
243
+ })) ?? []);
244
+ function h(e) {
245
+ return n.t(ge.getI18nKey(e));
246
+ }
247
+ function g(e) {
248
+ return n.t(xe.getI18nKey(e));
249
+ }
250
+ let _ = ue();
251
+ function v(e) {
252
+ c.updateSearch(e);
253
+ }
254
+ async function y(e) {
255
+ if (u.value = e, e !== null) try {
256
+ await i.execute({
257
+ body: { dealLanguage: e },
258
+ params: { dealUuid: t.deal.uuid }
259
+ });
260
+ } catch (e) {
261
+ r.show(e);
262
+ }
263
+ }
264
+ async function b(e) {
265
+ if (d.value = e, e !== null) try {
266
+ await a.execute({
267
+ body: { dealSource: e },
268
+ params: { dealUuid: t.deal.uuid }
269
+ });
270
+ } catch (e) {
271
+ r.show(e);
272
+ }
273
+ }
274
+ async function ee(e) {
275
+ if (f.value = e, e !== null) try {
276
+ await s.execute({
277
+ body: { dealOwner: e },
278
+ params: { dealUuid: t.deal.uuid }
279
+ });
280
+ } catch (e) {
281
+ r.show(e);
282
+ }
283
+ }
284
+ return (e, r) => (z(), P("div", null, [L(C, null, {
285
+ default: W(() => [F("form", null, [L(w, { cols: 1 }, {
286
+ default: W(() => [
287
+ L(U(ke), {
288
+ modelValue: f.value,
289
+ "onUpdate:modelValue": [r[0] ||= (e) => f.value = e, ee],
290
+ items: m.value,
291
+ "display-fn": (e) => e.name,
292
+ "is-loading": U(l).isLoading.value || U(s).isLoading.value,
293
+ placeholder: "Select deal owner",
294
+ label: "Deal owner",
295
+ onSearch: v
296
+ }, null, 8, [
297
+ "modelValue",
298
+ "items",
299
+ "display-fn",
300
+ "is-loading"
301
+ ]),
302
+ L(U(Y), {
303
+ modelValue: u.value,
304
+ "onUpdate:modelValue": [r[1] ||= (e) => u.value = e, y],
305
+ label: U(n).t("wise_crm.deal.form.fields.language"),
306
+ placeholder: U(n).t("wise_crm.deal.form.fields.language_placeholder"),
307
+ "display-fn": h,
308
+ "is-loading": U(i).isLoading.value
309
+ }, {
310
+ default: W(() => [(z(!0), P(A, null, V(Object.values(U(he)), (e) => (z(), M(U(X), {
311
+ key: e,
312
+ value: e
313
+ }, {
314
+ default: W(() => [I(H(h(e)), 1)]),
315
+ _: 2
316
+ }, 1032, ["value"]))), 128))]),
317
+ _: 1
318
+ }, 8, [
319
+ "modelValue",
320
+ "label",
321
+ "placeholder",
322
+ "is-loading"
323
+ ]),
324
+ L(U(Y), {
325
+ modelValue: d.value,
326
+ "onUpdate:modelValue": [r[2] ||= (e) => d.value = e, b],
327
+ "display-fn": g,
328
+ label: U(n).t("wise_crm.deal.form.fields.source"),
329
+ placeholder: U(n).t("wise_crm.deal.form.fields.source_placeholder"),
330
+ "is-loading": U(a).isLoading.value
331
+ }, {
332
+ default: W(() => [(z(!0), P(A, null, V(Object.values(U(pe)), (e) => (z(), M(U(X), {
333
+ key: e,
334
+ value: e
335
+ }, {
336
+ default: W(() => [I(H(g(e)), 1)]),
337
+ _: 2
338
+ }, 1032, ["value"]))), 128))]),
339
+ _: 1
340
+ }, 8, [
341
+ "modelValue",
342
+ "label",
343
+ "placeholder",
344
+ "is-loading"
345
+ ])
346
+ ]),
347
+ _: 1
348
+ })])]),
349
+ _: 1
350
+ }), F("div", $e, [L(S, {
351
+ label: U(n).t("wise_crm.deal.sidebar.created_at", { date: U(_).toDate(t.deal.createdAt.toPlainDate()) }),
352
+ icon: "clockPlus",
353
+ "text-color": "text-quaternary",
354
+ class: "text-sm"
355
+ }, null, 8, ["label"])])]));
356
+ }
357
+ });
358
+ //#endregion
359
+ //#region src/api/mutations/deal/dealLinkContactPerson.mutation.ts
360
+ function tt() {
361
+ return E({
362
+ queryFn: async ({ body: e, params: t }) => await D.linkContactPerson(t.dealUuid, e.contactPersonUuid, e.contactInfo),
363
+ queryKeysToInvalidate: {
364
+ dealDetail: { dealUuid: (e) => e.dealUuid },
365
+ dealIndex: {}
366
+ }
367
+ });
368
+ }
369
+ //#endregion
370
+ //#region src/deal/components/DealContactPersonCreateExistingForm.vue
371
+ var nt = /* @__PURE__ */ R({
372
+ __name: "DealContactPersonCreateExistingForm",
373
+ props: { form: {} },
374
+ emits: ["createNewContactPerson"],
375
+ setup(e, { emit: t }) {
376
+ let n = e, r = t, o = G(), c = n.form.register("email"), l = n.form.register("phone"), u = n.form.register("mobile"), d = n.form.register("existingContactPerson");
377
+ function f() {
378
+ r("createNewContactPerson");
379
+ }
380
+ return (e, t) => (z(), M(a, {
381
+ form: n.form,
382
+ class: "pb-xl flex h-full flex-1 flex-col justify-between"
383
+ }, {
384
+ default: W(() => [L(w, { cols: 2 }, {
385
+ default: W(() => [L(m, {
386
+ label: U(o).t("wise_crm.contact.create_dialog.form.fields.contact_person"),
387
+ "model-value": U(d).modelValue.value,
388
+ class: "col-span-2",
389
+ "onUpdate:modelValue": U(d).setValue,
390
+ onCreateNew: f
391
+ }, null, 8, [
392
+ "label",
393
+ "model-value",
394
+ "onUpdate:modelValue"
395
+ ]), L(y, {
396
+ email: U(c),
397
+ "mobile-phone": U(u),
398
+ phone: U(l)
399
+ }, null, 8, [
400
+ "email",
401
+ "mobile-phone",
402
+ "phone"
403
+ ])]),
404
+ _: 1
405
+ }), L(i, null, {
406
+ default: W(() => [L(s, {
407
+ "is-loading": n.form.isSubmitting.value,
408
+ label: U(o).t("wise_crm.shared.add"),
409
+ class: "col-span-2"
410
+ }, null, 8, ["is-loading", "label"])]),
411
+ _: 1
412
+ })]),
413
+ _: 1
414
+ }, 8, ["form"]));
415
+ }
416
+ }), rt = /* @__PURE__ */ R({
417
+ __name: "DealContactPersonCreateNewForm",
418
+ props: { form: {} },
419
+ setup(e) {
420
+ let t = e, n = t.form.register("firstName"), r = t.form.register("lastName"), i = t.form.register("email"), o = t.form.register("mobilePhone"), s = t.form.register("phone");
421
+ return (e, c) => (z(), M(a, {
422
+ form: t.form,
423
+ class: "pb-xl flex h-full flex-col justify-between"
424
+ }, {
425
+ default: W(() => [L(w, { cols: 2 }, {
426
+ default: W(() => [
427
+ L(_, {
428
+ "first-name": U(n),
429
+ "last-name": U(r)
430
+ }, null, 8, ["first-name", "last-name"]),
431
+ L(y, {
432
+ email: U(i),
433
+ "mobile-phone": U(o),
434
+ phone: U(s)
435
+ }, null, 8, [
436
+ "email",
437
+ "mobile-phone",
438
+ "phone"
439
+ ]),
440
+ L(ce, { form: t.form }, null, 8, ["form"])
441
+ ]),
442
+ _: 1
443
+ }), Ee(e.$slots, "actions")]),
444
+ _: 3
445
+ }, 8, ["form"]));
446
+ }
447
+ }), it = O.object({
448
+ email: O.email().nullable(),
449
+ existingContactPerson: se,
450
+ mobile: b.nullable(),
451
+ phone: b.nullable()
452
+ }), at = k.object({
453
+ email: k.email().min(1).nullable(),
454
+ firstName: k.string().min(1),
455
+ lastName: k.string().min(1),
456
+ mobilePhone: b.nullable(),
457
+ phone: b.nullable()
458
+ }).superRefine((e, t) => {
459
+ e.email !== null && e.email !== "" || e.mobilePhone !== null && e.mobilePhone !== "" || e.phone !== null && e.phone !== "" || t.addIssue({
460
+ code: k.ZodIssueCode.custom,
461
+ message: d.global.t("wise_crm.form.errors.at_least_one")
462
+ });
463
+ }), ot = /* @__PURE__ */ R({
464
+ __name: "DealContactPersonCreateDialog",
465
+ props: {
466
+ dealUuid: {},
467
+ isCreatingNewContactPerson: {
468
+ type: Boolean,
469
+ default: !1
470
+ }
471
+ },
472
+ emits: ["close", "createNewContactPerson"],
473
+ setup(e, { emit: t }) {
474
+ let n = e, r = t, a = G(), o = p(), c = tt(), l = ee(), u = B(n.isCreatingNewContactPerson), d = Q({
475
+ schema: at,
476
+ onSubmit: async (e) => {
477
+ try {
478
+ let t = await l.execute({ body: {
479
+ email: e.email,
480
+ firstName: e.firstName,
481
+ lastName: e.lastName,
482
+ mobilePhone: e.mobilePhone,
483
+ phone: e.phone
484
+ } });
485
+ n.isCreatingNewContactPerson || await c.execute({
486
+ body: {
487
+ contactPersonUuid: t,
488
+ contactInfo: {
489
+ email: e.email,
490
+ mobilePhone: e.mobilePhone,
491
+ phone: e.phone
492
+ }
493
+ },
494
+ params: { dealUuid: n.dealUuid }
495
+ }), g({
496
+ label: `${e.firstName} ${e.lastName}`,
497
+ value: t
498
+ });
499
+ } catch (e) {
500
+ o.show(e);
501
+ }
502
+ }
503
+ }), f = Q({
504
+ schema: it,
505
+ onSubmit: async (e) => {
506
+ await h(e.existingContactPerson.value, {
507
+ email: e.email,
508
+ mobilePhone: e.mobile,
509
+ phone: e.phone
510
+ });
511
+ }
512
+ });
513
+ function m() {
514
+ u.value = !0;
515
+ }
516
+ async function h(e, t) {
517
+ if (e !== null) try {
518
+ await c.execute({
519
+ body: {
520
+ contactPersonUuid: e,
521
+ contactInfo: t
522
+ },
523
+ params: { dealUuid: n.dealUuid }
524
+ }), g();
525
+ } catch (e) {
526
+ o.show(e);
527
+ }
528
+ }
529
+ function g(e) {
530
+ if (e === void 0) {
531
+ r("close");
532
+ return;
533
+ }
534
+ r("createNewContactPerson", e), r("close");
535
+ }
536
+ return (e, t) => (z(), M(te, {
537
+ title: U(a).t("wise_crm.info_dialog.contact_person_create.title"),
538
+ description: U(a).t("wise_crm.info_dialog.contact_person_create.description"),
539
+ onClose: g
540
+ }, {
541
+ default: W(() => [u.value ? (z(), M(rt, {
542
+ key: 0,
543
+ form: U(d)
544
+ }, {
545
+ actions: W(() => [L(i, null, {
546
+ default: W(() => [L(s, {
547
+ "is-loading": U(d).isSubmitting.value,
548
+ label: U(a).t("wise_crm.shared.create")
549
+ }, null, 8, ["is-loading", "label"])]),
550
+ _: 1
551
+ })]),
552
+ _: 1
553
+ }, 8, ["form"])) : (z(), M(nt, {
554
+ key: 1,
555
+ form: U(f),
556
+ onCreateNewContactPerson: m
557
+ }, null, 8, ["form"]))]),
558
+ _: 1
559
+ }, 8, ["title", "description"]));
560
+ }
561
+ });
562
+ //#endregion
563
+ //#region src/api/mutations/deal/dealContactPersonUpdate.mutation.ts
564
+ function st() {
565
+ return E({
566
+ queryFn: async ({ body: e, params: t }) => await D.updateContactPerson(t.dealUuid, t.contactPersonUuid, e.form),
567
+ queryKeysToInvalidate: {
568
+ dealContactPersonDetail: {
569
+ contactPersonUuid: (e) => e.contactPersonUuid,
570
+ dealUuid: (e) => e.dealUuid
571
+ },
572
+ dealDetail: { dealUuid: (e) => e.dealUuid },
573
+ dealIndex: {}
574
+ }
575
+ });
576
+ }
577
+ //#endregion
578
+ //#region src/api/queries/deal/dealContactPersonDetail.query.ts
579
+ function ct(e, t) {
580
+ return T({
581
+ queryFn: () => D.getContactPerson(e.value, t.value),
582
+ queryKey: { dealContactPersonDetail: {
583
+ contactPersonUuid: t,
584
+ dealUuid: e
585
+ } }
586
+ });
587
+ }
588
+ //#endregion
589
+ //#region src/models/deal/contact-person/dealContactPersonUpdateForm.model.ts
590
+ var lt = k.object({
591
+ email: k.email().min(1).nullable(),
592
+ firstName: k.string().min(1),
593
+ lastName: k.string().min(1),
594
+ mobilePhone: b.nullable(),
595
+ phone: b.nullable()
596
+ }).superRefine((e, t) => {
597
+ e.email !== null && e.email !== "" || e.mobilePhone !== null && e.mobilePhone !== "" || e.phone !== null && e.phone !== "" || t.addIssue({
598
+ code: k.ZodIssueCode.custom,
599
+ message: d.global.t("wise_crm.form.errors.at_least_one")
600
+ });
601
+ }), ut = /* @__PURE__ */ R({
602
+ __name: "DealContactPersonUpdateForm",
603
+ props: {
604
+ contactPerson: {},
605
+ onSubmit: { type: Function }
606
+ },
607
+ setup(e) {
608
+ let t = e, n = G(), r = Q({
609
+ initialState: {
610
+ email: t.contactPerson.email,
611
+ firstName: t.contactPerson.firstName,
612
+ lastName: t.contactPerson.lastName,
613
+ mobilePhone: t.contactPerson.mobilePhone,
614
+ phone: t.contactPerson.phone
615
+ },
616
+ schema: lt,
617
+ onSubmit: async (e) => {
618
+ await t.onSubmit(e);
619
+ }
620
+ }), o = r.register("firstName"), c = r.register("lastName"), l = r.register("email"), u = r.register("mobilePhone"), d = r.register("phone");
621
+ return (e, t) => (z(), M(a, {
622
+ form: U(r),
623
+ class: "flex h-full flex-col justify-between"
624
+ }, {
625
+ default: W(() => [L(w, { cols: 2 }, {
626
+ default: W(() => [
627
+ L(_, {
628
+ "first-name": U(o),
629
+ "last-name": U(c)
630
+ }, null, 8, ["first-name", "last-name"]),
631
+ L(y, {
632
+ email: U(l),
633
+ "mobile-phone": U(u),
634
+ phone: U(d)
635
+ }, null, 8, [
636
+ "email",
637
+ "mobile-phone",
638
+ "phone"
639
+ ]),
640
+ L(ce, { form: U(r) }, null, 8, ["form"])
641
+ ]),
642
+ _: 1
643
+ }), L(i, null, {
644
+ default: W(() => [L(s, {
645
+ "is-loading": U(r).isSubmitting.value,
646
+ label: U(n).t("wise_crm.shared.save_changes")
647
+ }, null, 8, ["is-loading", "label"])]),
648
+ _: 1
649
+ })]),
650
+ _: 1
651
+ }, 8, ["form"]));
652
+ }
653
+ }), dt = /* @__PURE__ */ R({
654
+ __name: "DealContactPersonUpdateDialog",
655
+ props: {
656
+ contactPersonUuid: {},
657
+ dealUuid: {}
658
+ },
659
+ emits: ["close"],
660
+ setup(e, { emit: t }) {
661
+ let n = e, r = t, i = G(), a = p(), o = st(), s = ct(j(() => n.dealUuid), j(() => n.contactPersonUuid));
662
+ async function c(e) {
663
+ try {
664
+ await o.execute({
665
+ body: { form: e },
666
+ params: {
667
+ contactPersonUuid: n.contactPersonUuid,
668
+ dealUuid: n.dealUuid
669
+ }
670
+ }), r("close");
671
+ } catch (e) {
672
+ a.show(e);
673
+ }
674
+ }
675
+ function l() {
676
+ r("close");
677
+ }
678
+ return (e, t) => (z(), M(te, {
679
+ title: U(i).t("wise_crm.info_dialog.contact_person_update.title"),
680
+ description: U(i).t("wise_crm.info_dialog.contact_person_create.description"),
681
+ onClose: l
682
+ }, {
683
+ default: W(() => [U(s).data.value ? (z(), M(ut, {
684
+ key: 0,
685
+ "on-submit": c,
686
+ "contact-person": U(s).data.value,
687
+ onClose: l
688
+ }, null, 8, ["contact-person"])) : N("", !0)]),
689
+ _: 1
690
+ }, 8, ["title", "description"]));
691
+ }
692
+ }), ft = /* @__PURE__ */ R({
693
+ __name: "DealDetailSidebarOverviewContent",
694
+ props: { deal: {} },
695
+ setup(e) {
696
+ let t = e, n = G(), r = p(), i = Ge(), a = Ke(), o = Z(ot), s = Z(dt), c = j(() => t.deal.contactPersons.length > 0);
697
+ function l() {
698
+ o.open({ dealUuid: t.deal.uuid });
699
+ }
700
+ function u(e) {
701
+ s.open({
702
+ contactPersonUuid: e,
703
+ dealUuid: t.deal.uuid
704
+ });
705
+ }
706
+ async function d(e) {
707
+ try {
708
+ await a.execute({
709
+ body: { contactPersonUuid: e },
710
+ params: { dealUuid: t.deal.uuid }
711
+ });
712
+ } catch (e) {
713
+ r.show(e);
714
+ }
715
+ }
716
+ function f(e) {
717
+ i.execute({ params: {
718
+ contactPersonUuid: e,
719
+ dealUuid: t.deal.uuid
720
+ } });
721
+ }
722
+ return (e, r) => (z(), M(g, { "default-values": ["general-info", "contact-persons"] }, {
723
+ default: W(() => [L(ae, {
724
+ label: U(n).t("wise_crm.deal.detail.sidebar.accordion.general_info"),
725
+ value: "general-info",
726
+ icon: "infoCircle"
727
+ }, {
728
+ default: W(() => [L(et, { deal: t.deal }, null, 8, ["deal"])]),
729
+ _: 1
730
+ }, 8, ["label"]), L(ae, {
731
+ "is-empty": !c.value,
732
+ label: U(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
733
+ value: "contact-persons",
734
+ icon: "userCircle",
735
+ onAdd: l
736
+ }, {
737
+ actions: W(() => [c.value ? N("", !0) : (z(), M(x, {
738
+ key: 0,
739
+ label: U(n).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
740
+ class: "z-1",
741
+ icon: "plus",
742
+ onClick: l
743
+ }, null, 8, ["label"]))]),
744
+ default: W(() => [(z(!0), P(A, null, V(t.deal.contactPersons, (e) => (z(), M(U(Ie), {
745
+ key: e.uuid,
746
+ "layout-id": e.uuid
747
+ }, {
748
+ default: W(() => [L(Qe, {
749
+ "contact-person": e,
750
+ "on-toggle-is-primary": () => f(e.uuid),
751
+ description: e.phone,
752
+ onUpdate: (t) => u(e.uuid),
753
+ onDelete: (t) => d(e.uuid)
754
+ }, null, 8, [
755
+ "contact-person",
756
+ "on-toggle-is-primary",
757
+ "description",
758
+ "onUpdate",
759
+ "onDelete"
760
+ ])]),
761
+ _: 2
762
+ }, 1032, ["layout-id"]))), 128)), c.value ? (z(), M(U(Ae), {
763
+ key: 0,
764
+ variant: "tertiary",
765
+ size: "sm",
766
+ "icon-left": "plus",
767
+ onClick: l
768
+ }, {
769
+ default: W(() => [I(H(U(n).t("wise_crm.shared.add")), 1)]),
770
+ _: 1
771
+ })) : N("", !0)]),
772
+ _: 1
773
+ }, 8, ["is-empty", "label"])]),
774
+ _: 1
775
+ }));
776
+ }
777
+ });
778
+ //#endregion
779
+ //#region src/api/mutations/deal/dealTransition.mutation.ts
780
+ function pt() {
781
+ return E({
782
+ queryFn: async ({ body: e, params: t }) => await D.transition(t.dealUuid, e.toBoardColumnUuid),
783
+ queryKeysToInvalidate: {
784
+ dealDetail: { dealUuid: (e) => e.dealUuid },
785
+ dealIndex: {}
786
+ }
787
+ });
788
+ }
789
+ //#endregion
790
+ //#region src/api/queries/board/boardColumnTransition.query.ts
791
+ function mt(e, t) {
792
+ return T({
793
+ queryFn: () => _e.getTransitions(e.value, t.value),
794
+ queryKey: { boardColumnsTransition: { boardColumnUuid: e } }
795
+ });
796
+ }
797
+ //#endregion
798
+ //#region src/deal/components/DealDetailSidebarTransitionSelect.vue
799
+ var ht = /* @__PURE__ */ R({
800
+ __name: "DealDetailSidebarTransitionSelect",
801
+ props: /* @__PURE__ */ Ce({ deal: {} }, {
802
+ modelValue: { required: !0 },
803
+ modelModifiers: {}
804
+ }),
805
+ emits: ["update:modelValue"],
806
+ setup(e) {
807
+ let n = e, i = G(), a = r(), o = Z(be), s = De(e, "modelValue"), c = p(), l = pt(), u = mt(j(() => s.value.toColumnUuid), j(() => a.getOptions().deals?.allowedTransitionTriggerTypes ?? [])), d = j(() => (u.data.value ?? []).flatMap((e) => e.triggers.length === 0 ? [e] : e.triggers.map((t) => ({
808
+ ...e,
809
+ toColumnDisplayName: e.toColumnDisplayName,
810
+ triggers: [t]
811
+ }))));
812
+ function f(e) {
813
+ return e?.toColumnDisplayName ?? "-";
814
+ }
815
+ async function m(e) {
816
+ if (e.triggers.length !== 0) {
817
+ if (e.triggers[0]?.triggerType === fe.EMAIL) {
818
+ o.open({
819
+ dealUuid: n.deal.uuid,
820
+ client: {
821
+ uuid: n.deal.client.uuid,
822
+ type: n.deal.client.type
823
+ },
824
+ templateKey: e.triggers[0].config.mailTemplateKey
825
+ });
826
+ return;
827
+ }
828
+ try {
829
+ s.value = e, await l.execute({
830
+ body: { toBoardColumnUuid: e.toColumnUuid },
831
+ params: { dealUuid: n.deal.uuid }
832
+ });
833
+ } catch (e) {
834
+ c.show(e);
835
+ }
836
+ }
837
+ }
838
+ return (e, n) => (z(), M(t, { color: s.value?.toColumnColor ?? null }, {
839
+ default: W(() => [d.value.length === 0 ? (z(), M(U(K), {
840
+ key: 0,
841
+ "class-config": { root: "text-nowrap" },
842
+ variant: "translucent",
843
+ color: "brand"
844
+ }, {
845
+ default: W(() => [I(H(s.value.toColumnDisplayName), 1)]),
846
+ _: 1
847
+ })) : (z(), M(U(Y), {
848
+ key: 1,
849
+ "model-value": s.value,
850
+ "is-loading": U(l).isLoading.value,
851
+ "display-fn": f,
852
+ "class-config": {
853
+ item: "text-sm",
854
+ baseSingle: "text-brand-700",
855
+ root: "border-brand-200 bg-brand-25 w-fit h-7 py-xxs",
856
+ iconRight: "size-3 text-brand-700",
857
+ loader: "text-brand-700 size-3"
858
+ },
859
+ placeholder: U(i).t("wise_crm.deal.transition.placeholder"),
860
+ label: U(i).t("wise_crm.deal.transition.label"),
861
+ "onUpdate:modelValue": m
862
+ }, {
863
+ label: W(() => [L(U(J), { class: "sr-only" })]),
864
+ default: W(() => [(z(!0), P(A, null, V(d.value, (e) => (z(), M(U(X), {
865
+ key: e.uuid,
866
+ value: {
867
+ uuid: e.uuid,
868
+ toColumnUuid: e.toColumnUuid,
869
+ toColumnColor: e.toColumnColor,
870
+ toColumnDisplayName: e.toColumnDisplayName,
871
+ triggers: e.triggers
872
+ }
873
+ }, {
874
+ default: W(() => [L(le, null, {
875
+ default: W(() => [L(t, { color: e.toColumnColor }, {
876
+ default: W(() => [...n[0] ||= [F("div", { class: "bg-brand-100 border-brand-400 size-3 rounded-full border" }, null, -1)]]),
877
+ _: 1
878
+ }, 8, ["color"]), F("span", null, H(e.toColumnDisplayName), 1)]),
879
+ _: 2
880
+ }, 1024)]),
881
+ _: 2
882
+ }, 1032, ["value"]))), 128))]),
883
+ _: 1
884
+ }, 8, [
885
+ "model-value",
886
+ "is-loading",
887
+ "placeholder",
888
+ "label"
889
+ ]))]),
890
+ _: 1
891
+ }, 8, ["color"]));
892
+ }
893
+ });
894
+ //#endregion
895
+ //#region src/api/mutations/noteDealCreate.mutation.ts
896
+ function gt() {
897
+ return E({
898
+ queryFn: async ({ body: e, params: t }) => await v.create(e, { dealUuid: t.dealUuid }),
899
+ queryKeysToInvalidate: { noteDealIndex: {} }
900
+ });
901
+ }
902
+ //#endregion
903
+ //#region src/api/queries/noteDealIndex.query.ts
904
+ function _t(e, t) {
905
+ return c({
906
+ queryFn: (t) => v.getDealNotes({ pagination: t }, e.value),
907
+ queryKey: { noteDealIndex: { params: t?.params } }
908
+ });
909
+ }
910
+ //#endregion
911
+ //#region src/deal/components/DealDialogSidebarNotesContent.vue
912
+ var vt = /* @__PURE__ */ R({
913
+ __name: "DealDialogSidebarNotesContent",
914
+ props: { deal: {} },
915
+ setup(t) {
916
+ let r = t, i = Z(l), a = p(), o = gt(), s = e(), c = _t(j(() => r.deal.uuid)), u = j(() => c.data?.value?.data ?? []);
917
+ async function d(e) {
918
+ await o.execute({
919
+ body: e,
920
+ params: { dealUuid: r.deal.uuid }
921
+ });
922
+ }
923
+ async function f(e) {
924
+ try {
925
+ await s.execute({ params: { noteUuid: e } });
926
+ } catch (e) {
927
+ a.show(e);
928
+ }
929
+ }
930
+ function m(e) {
931
+ i.open({ note: e });
932
+ }
933
+ return (e, t) => (z(), M(n, {
934
+ "is-loading": U(c).isLoading.value,
935
+ notes: u.value,
936
+ "on-submit": d,
937
+ "has-next-page": U(c).hasNextPage.value,
938
+ onNext: t[0] ||= (e) => U(c).fetchNextPage(),
939
+ onDelete: f,
940
+ onUpdate: m
941
+ }, null, 8, [
942
+ "is-loading",
943
+ "notes",
944
+ "has-next-page"
945
+ ]));
946
+ }
947
+ }), yt = { class: "flex h-full flex-1 flex-col" }, bt = { class: "gap-xl border-primary p-xl flex flex-col rounded-2xl border" }, xt = { class: "gap-sm flex w-full flex-wrap items-center" }, St = { class: "max-w-50 truncate" }, $ = /* @__PURE__ */ function(e) {
948
+ return e.ACTIVITY = "activity", e.NOTES = "notes", e.OVERVIEW = "overview", e;
949
+ }($ || {}), Ct = /* @__PURE__ */ R({
950
+ __name: "DealDetailSidebar",
951
+ props: { deal: {} },
952
+ setup(e) {
953
+ let t = e, n = G(), r = u(), i = B($.OVERVIEW), a = B({
954
+ uuid: "",
955
+ toColumnUuid: t.deal.boardColumn.uuid,
956
+ toColumnColor: t.deal.boardColumn.color,
957
+ toColumnDisplayName: t.deal.boardColumn.displayName,
958
+ toColumnKey: "",
959
+ triggers: []
960
+ }), o = j(() => [
961
+ {
962
+ icon: "infoCircle",
963
+ label: n.t("wise_crm.shared.overview"),
964
+ value: $.OVERVIEW
965
+ },
966
+ {
967
+ icon: "activity",
968
+ label: n.t("wise_crm.shared.activity"),
969
+ value: $.ACTIVITY
970
+ },
971
+ {
972
+ icon: "book",
973
+ label: n.t("wise_crm.shared.notes"),
974
+ value: $.NOTES
975
+ }
976
+ ]);
977
+ return (e, n) => (z(), P("div", yt, [F("div", bt, [L(We, { deal: t.deal }, null, 8, ["deal"]), F("div", xt, [L(re, { onClick: n[0] ||= (e) => U(r).openBusinessDetail(t.deal.client.uuid) }, {
978
+ default: W(() => [L(U(K), {
979
+ "class-config": {
980
+ icon: "shrink-0 size-4",
981
+ root: "text-nowrap"
982
+ },
983
+ variant: "translucent",
984
+ color: "brand",
985
+ icon: "building"
986
+ }, {
987
+ default: W(() => [F("span", St, H(t.deal.client.name ?? "-"), 1)]),
988
+ _: 1
989
+ })]),
990
+ _: 1
991
+ }), L(ht, {
992
+ modelValue: a.value,
993
+ "onUpdate:modelValue": n[1] ||= (e) => a.value = e,
994
+ deal: t.deal
995
+ }, null, 8, ["modelValue", "deal"])])]), L(ie, {
996
+ modelValue: i.value,
997
+ "onUpdate:modelValue": n[2] ||= (e) => i.value = e,
998
+ tabs: o.value
999
+ }, {
1000
+ default: W(() => [i.value === $.OVERVIEW ? (z(), M(ft, {
1001
+ key: 0,
1002
+ deal: t.deal
1003
+ }, null, 8, ["deal"])) : i.value === $.NOTES ? (z(), M(vt, {
1004
+ key: 1,
1005
+ deal: t.deal
1006
+ }, null, 8, ["deal"])) : N("", !0)]),
1007
+ _: 1
1008
+ }, 8, ["modelValue", "tabs"])]));
1009
+ }
1010
+ }), wt = /* @__PURE__ */ R({
1011
+ __name: "DealDetailSidebarProvider",
1012
+ props: { dealUuid: {} },
1013
+ setup(e) {
1014
+ let t = e, n = ye(j(() => t.dealUuid)), r = G();
1015
+ return (e, t) => (z(), M(ne, null, {
1016
+ default: W(() => [U(n).error.value ? (z(), M(oe, {
1017
+ key: 0,
1018
+ message: U(r).t("error.deal_details.description"),
1019
+ title: U(r).t("error.deal_details.title")
1020
+ }, null, 8, ["message", "title"])) : U(n).isLoading.value ? (z(), M(de, {
1021
+ key: 1,
1022
+ class: "h-full"
1023
+ })) : U(n).data.value ? (z(), M(Ct, {
1024
+ key: U(n).data.value.boardColumn.uuid,
1025
+ deal: U(n).data.value
1026
+ }, null, 8, ["deal"])) : N("", !0)]),
1027
+ _: 1
1028
+ }));
1029
+ }
1030
+ }), Tt = /* @__PURE__ */ R({
1031
+ __name: "DealDetailView",
1032
+ props: { tabs: {} },
1033
+ setup(e) {
1034
+ let t = e, n = G(), r = Le("dealUuid"), i = j(() => [...t.tabs, {
1035
+ label: j(() => n.t("wise_crm.deal.detail_view.communication_tab_label")),
1036
+ to: "deal-communication"
1037
+ }]);
1038
+ return (e, t) => (z(), M(Se, {
1039
+ key: U(r),
1040
+ "entity-type": U(me).BUSINESS,
1041
+ tabs: i.value
1042
+ }, {
1043
+ sidebar: W(() => [L(wt, { "deal-uuid": U(r) }, null, 8, ["deal-uuid"])]),
1044
+ _: 1
1045
+ }, 8, ["entity-type", "tabs"]));
1046
+ }
1047
+ });
1048
+ //#endregion
1049
+ export { Tt as default };