@wisemen/wise-crm-web 0.2.0 → 0.2.2

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/README.md +1037 -0
  2. package/dist/BusinessDetailSidebarProvider-BQMRbGHQ.js +2083 -0
  3. package/dist/{BusinessDetailView-DvhFfuGg.js → BusinessDetailView-BxGxWOme.js} +5 -5
  4. package/dist/{CrmDetailHeaderCard-e5332OkQ.js → CrmDetailHeaderCard-CCNJpMAK.js} +68 -67
  5. package/dist/{CrmDetailView-C-lsAhtD.js → CrmDetailView-ozCpuaX2.js} +14 -14
  6. package/dist/{DealCommunicationTabView-e7NkRy9r.js → DealCommunicationTabView-Df5EeolN.js} +2 -2
  7. package/dist/{DealDetailView-BDCbOBoo.js → DealDetailView-DdWHqaBr.js} +163 -163
  8. package/dist/{DealExternalAttachment-D1PznE3V.js → DealExternalAttachment-qHdh4yMI.js} +1 -1
  9. package/dist/{DealSendMailDialog-DVE2iYQC.js → DealSendMailDialog-BaYcWZP-.js} +65 -69
  10. package/dist/Error-BArv9rNb.js +12650 -0
  11. package/dist/IndividualDetailSidebarProvider-BXZH951l.js +608 -0
  12. package/dist/{IndividualDetailView-B7dX3hZ8.js → IndividualDetailView-DfYS31-e.js} +5 -5
  13. package/dist/LinkBrokenIcon-CTlqmapl.js +17 -0
  14. package/dist/api/mutations/deal/dealCreate.mutation.d.ts +1 -1
  15. package/dist/api/mutations/deal/dealUpdate.mutation.d.ts +3 -3
  16. package/dist/api/mutations/mail-template/mailTemplateUpdate.mutation.d.ts +1 -1
  17. package/dist/client/apiErrorCode.gen.d.ts +2 -2
  18. package/dist/client/sdk.gen.d.ts +20 -17
  19. package/dist/client/types.gen.d.ts +1057 -1376
  20. package/dist/client/zod.gen.d.ts +15453 -17750
  21. package/dist/{client-BP13IBbl.js → client-pCaNxE3C.js} +748 -1047
  22. package/dist/components/app/dialog/AppConfirmDialog.vue.d.ts +2 -2
  23. package/dist/components/crm-detail/CrmDetailHeaderCard.vue.d.ts +2 -0
  24. package/dist/components/crm-detail/CrmDetailSidebarAccordionContactPersonInfo.vue.d.ts +2 -2
  25. package/dist/components/crm-detail/CrmDetailSidebarAccordionGenericContactPersonInfo.vue.d.ts +2 -2
  26. package/dist/components/notes/NoteList.vue.d.ts +2 -2
  27. package/dist/deal/components/DealSendMailForm.vue.d.ts +2 -2
  28. package/dist/deal/components/DealSendMailFormFooter.vue.d.ts +1 -1
  29. package/dist/deal/components/DealSettingsDialogMailTemplateForm.vue.d.ts +2 -2
  30. package/dist/deal/components/DealSettingsDialogMailTemplateFormFields.vue.d.ts +2 -2
  31. package/dist/dialogs/contact-create/ContactCreateDialog.vue.d.ts +1 -1
  32. package/dist/dialogs/contact-create/components/ContactCreateDialogBusinessContactPersonSearch.vue.d.ts +2 -2
  33. package/dist/dialogs/contact-create/components/ContactCreateDialogBusinessGeneralInfo.vue.d.ts +2 -2
  34. package/dist/dialogs/contact-create/components/ContactCreateDialogFooter.vue.d.ts +2 -2
  35. package/dist/dialogs/contact-create/components/ContactCreateDialogFormSection.vue.d.ts +2 -2
  36. package/dist/dialogs/note/CrmDetailSidebarNotesView.vue.d.ts +2 -2
  37. package/dist/icons/LinkBrokenIcon.vue.d.ts +3 -0
  38. package/dist/icons/icon.d.ts +1 -0
  39. package/dist/index.d.ts +4 -0
  40. package/dist/index.js +448 -453
  41. package/dist/models/brand-colors/brandColor.model.d.ts +14 -0
  42. package/dist/models/brand-colors/brandColor.transformer.d.ts +5 -0
  43. package/dist/models/conent-locale/contentLocaleEnum.model.d.ts +3 -3
  44. package/dist/models/deal/create/dealCreateForm.model.d.ts +2 -2
  45. package/dist/models/deal/detail/dealDetail.model.d.ts +2 -2
  46. package/dist/models/deal/index/dealIndex.model.d.ts +2 -2
  47. package/dist/models/deal/update/dealUpdateForm.model.d.ts +2 -2
  48. package/dist/models/mail-template/detail/mailTemplateDetail.model.d.ts +2 -2
  49. package/dist/models/mail-template/update/mailTemplateUpdateForm.model.d.ts +3 -3
  50. package/dist/models/phone-number/phoneNumberForm.model.d.ts +3 -0
  51. package/dist/models/tenant-config/tenantConfig.model.d.ts +3 -0
  52. package/dist/plugins/i18n.plugin.d.ts +4 -0
  53. package/dist/style.css +1 -1
  54. package/dist/testing/factories/business.factory.d.ts +2 -1
  55. package/dist/testing.js +23 -2
  56. package/package.json +2 -1
  57. package/dist/BusinessDetailSidebarProvider-D11bjWFa.js +0 -2081
  58. package/dist/BusinessDetailSidebarProvider-DYY-Uzvx.js +0 -2081
  59. package/dist/BusinessDetailSidebarProvider-ZYGQoNHh.js +0 -2081
  60. package/dist/BusinessDetailView-BOCy7G-w.js +0 -24
  61. package/dist/BusinessDetailView-WaATSNQS.js +0 -24
  62. package/dist/CrmDetailHeaderCard-C-JNdi7s.js +0 -2515
  63. package/dist/CrmDetailHeaderCard-qkNK-2wR.js +0 -2515
  64. package/dist/CrmDetailView-C6Xm1Lp6.js +0 -65
  65. package/dist/CrmDetailView-DQehs8Fb.js +0 -65
  66. package/dist/DealDetailView-BfkDNvK4.js +0 -1021
  67. package/dist/DealDetailView-Cs5TDhih.js +0 -1021
  68. package/dist/DealSendMailDialog-D5Voyhhc.js +0 -1556
  69. package/dist/DealSendMailDialog-OAn6xjLq.js +0 -1556
  70. package/dist/Error-5vt6UD4m.js +0 -3708
  71. package/dist/Error-B4TwHEhb.js +0 -3706
  72. package/dist/Error-BPxDpKcI.js +0 -3706
  73. package/dist/IndividualDetailSidebarProvider-CvZQdjzp.js +0 -606
  74. package/dist/IndividualDetailSidebarProvider-DBITt-9W.js +0 -606
  75. package/dist/IndividualDetailSidebarProvider-vIu7Hv8O.js +0 -606
  76. package/dist/IndividualDetailView-B1vbJXGc.js +0 -24
  77. package/dist/IndividualDetailView-BKEs0XS5.js +0 -24
  78. /package/dist/{LinkExternalIcon-B9Qg55Oa.js → LinkExternalIcon-LOVtSqBT.js} +0 -0
  79. /package/dist/{LinkIcon-DCW5zjbQ.js → LinkIcon-DqBbVrvs.js} +0 -0
  80. /package/dist/{LocationPinIcon-DBc-wt2e.js → LocationPinIcon-Cp-wRgk2.js} +0 -0
  81. /package/dist/{MailIcon-Do4a7S2W.js → MailIcon-CnTrB1k3.js} +0 -0
  82. /package/dist/{MobilePhoneIcon-DSXyKwjd.js → MobilePhoneIcon-B747hmpS.js} +0 -0
  83. /package/dist/{NumberedListIcon-DUaSJSYu.js → NumberedListIcon-amJxDaaD.js} +0 -0
  84. /package/dist/{PhoneIcon-C8Cv1IiW.js → PhoneIcon-94MYVL85.js} +0 -0
  85. /package/dist/{RefreshIcon-CKZgHIZU.js → RefreshIcon-DRe3coBc.js} +0 -0
  86. /package/dist/{SendIcon-B-sQkQ3W.js → SendIcon-MYItp1xI.js} +0 -0
  87. /package/dist/{SettingsIcon-DzP-IQS5.js → SettingsIcon-C0qTAv0w.js} +0 -0
  88. /package/dist/{StarOutlineIcon-c0VfXRdQ.js → StarOutlineIcon-CiFLgepk.js} +0 -0
  89. /package/dist/{StarYellowIcon-CH0CnlSU.js → StarYellowIcon-C0v_XGwI.js} +0 -0
  90. /package/dist/{ThreeDotsIcon-C6PCFq5J.js → ThreeDotsIcon-lujOTU3G.js} +0 -0
  91. /package/dist/{TimeLineMarkerIcon-6B6SbwTN.js → TimeLineMarkerIcon-C4LfErbc.js} +0 -0
  92. /package/dist/{TrashIcon-BTPSVviz.js → TrashIcon-v4L9SEK_.js} +0 -0
  93. /package/dist/{UploadCloudIcon-1aMW5OJq.js → UploadCloudIcon-j1-1Rvqb.js} +0 -0
  94. /package/dist/{UserCircleIcon-D-19dc-2.js → UserCircleIcon-BjUt_2C4.js} +0 -0
  95. /package/dist/{UserIcon-D1H8TGlg.js → UserIcon-Cb2jFKLr.js} +0 -0
  96. /package/dist/{VerticalDotsIcon-DmPza4Jd.js → VerticalDotsIcon-Y3m6tlQ2.js} +0 -0
  97. /package/dist/{WalletIcon-BlI3D3v-.js → WalletIcon-pPsKbzmh.js} +0 -0
@@ -0,0 +1,608 @@
1
+ import { $ as NoteService, J as useApiErrorToast, L as NoteUpdateDialog_default, N as AppSidebarFormSubmitButton_default, P as AppSidebarFormFooter_default, Q as useNoteDeleteMutation, T as useCrm, U as AppConfirmDialog_default, Z as useKeysetInfiniteQuery, c as CrmDetailAccordionRoot_default, h as useContactPersonCreateMutation, i as CrmDetailSidebarAccordionHeaderIconButton_default, k as AppColorProvider_default, l as AppIconLabelPair_default, m as AppDialog_default, n as CrmDetailContainer_default, o as CrmDetailSidebarCard_default, r as CrmDetailSidebarTabs_default, s as CrmDetailSidebarAccordionItem_default, t as Error_default, y as IndividualService, z as CrmDetailSidebarNotesView_default } from "./Error-BArv9rNb.js";
2
+ import { a as contactPersonUpdateFormSchema, i as CrmDetailSidebarMapCard_default, l as ActivityList_default, n as CrmDetailSidebarAccordionContactPersonInfo_default, o as ContactPersonCreateForm_default, r as CrmDetailSidebarAccordionBillingInformation_default, s as ContactPersonCreateNewForm_default, t as CrmDetailHeaderCard_default, u as assert } from "./CrmDetailHeaderCard-CCNJpMAK.js";
3
+ import { c as Be, l as He, n as useDateTimeFormat, t as AppSkeletonLoader_default, u as ze } from "./AppSkeletonLoader-BAhoOmFD.js";
4
+ import { ht as EntityType } from "./client-pCaNxE3C.js";
5
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, ref, renderList, toDisplayString, unref, withCtx } from "vue";
6
+ import { useI18n } from "vue-i18n";
7
+ import { VcButton, VcIconButton, VcRouterLinkButton, useDialog, usePagination, useToast } from "@wisemen/vue-core-components";
8
+ import { useMutation, useQueryClient } from "@tanstack/vue-query";
9
+ import { useForm } from "formango";
10
+ import { Motion } from "motion-v";
11
+ function useIndividualDetailQuery(r) {
12
+ return He({
13
+ isEnabled: computed(() => r.value !== null),
14
+ queryFn: () => (assert(r.value !== null, "individualUuid is null"), IndividualService.getByUuid(r.value)),
15
+ queryKey: { wiseCrmIndividualDetail: { individualUuid: r } }
16
+ });
17
+ }
18
+ function useIndividualGrantMutation() {
19
+ return ze({
20
+ queryFn: async ({ body: r, params: M }) => await IndividualService.grantUser(M.individualUuid, r),
21
+ queryKeysToInvalidate: { wiseCrmIndividualDetail: { individualUuid: (r) => r.individualUuid } }
22
+ });
23
+ }
24
+ function useActivityIndividualIndexQuery(r, M) {
25
+ return Be({
26
+ paginationOptions: M,
27
+ queryFn: async (M) => await IndividualService.getActivity(r.value, M),
28
+ queryKey: { individualActivityIndex: { paginationOptions: M } }
29
+ });
30
+ }
31
+ var IndividualDetailSidebarActivityContent_default = /* @__PURE__ */ defineComponent({
32
+ __name: "IndividualDetailSidebarActivityContent",
33
+ props: { individual: {} },
34
+ setup(r) {
35
+ let M = r, N = usePagination({
36
+ isRouteQueryEnabled: !1,
37
+ type: "keyset"
38
+ }), P = useActivityIndividualIndexQuery(computed(() => M.individual.uuid), N.paginationOptions), F = computed(() => P.data.value.data ?? []);
39
+ async function I() {
40
+ await P.getNextPage();
41
+ }
42
+ return (r, M) => (openBlock(), createBlock(ActivityList_default, {
43
+ "on-next": I,
44
+ "is-loading": unref(P).isLoading.value,
45
+ activities: F.value
46
+ }, null, 8, ["is-loading", "activities"]));
47
+ }
48
+ });
49
+ function useNoteIndividualCreateMutation() {
50
+ return ze({
51
+ queryFn: async ({ body: M, params: N }) => await NoteService.create(M, { individualUuid: N.individualUuid }),
52
+ queryKeysToInvalidate: { noteIndividualIndex: {} }
53
+ });
54
+ }
55
+ function useNoteIndividualIndexQuery(M, N) {
56
+ return useKeysetInfiniteQuery({
57
+ queryFn: (N) => NoteService.getIndividualNotes({ pagination: N }, M.value),
58
+ queryKey: { noteIndividualIndex: { params: N?.params } }
59
+ });
60
+ }
61
+ var IndividualDetailSidebarNotesContent_default = /* @__PURE__ */ defineComponent({
62
+ __name: "IndividualDetailSidebarNotesContent",
63
+ props: { individual: {} },
64
+ setup(r) {
65
+ let P = r, F = useApiErrorToast(), L = useNoteIndividualCreateMutation(), R = useNoteDeleteMutation(), z = useDialog(NoteUpdateDialog_default), B = useNoteIndividualIndexQuery(computed(() => P.individual.uuid)), V = computed(() => B.data?.value?.data ?? []);
66
+ async function H(r) {
67
+ try {
68
+ await L.execute({
69
+ body: r,
70
+ params: { individualUuid: P.individual.uuid }
71
+ });
72
+ } catch (r) {
73
+ F.show(r);
74
+ }
75
+ }
76
+ async function U(r) {
77
+ try {
78
+ await R.execute({ params: { noteUuid: r } });
79
+ } catch (r) {
80
+ F.show(r);
81
+ }
82
+ }
83
+ function W(r) {
84
+ z.open({ note: r });
85
+ }
86
+ return (r, M) => (openBlock(), createBlock(CrmDetailSidebarNotesView_default, {
87
+ "is-loading": unref(B).isLoading.value,
88
+ notes: V.value,
89
+ "on-submit": H,
90
+ "has-next-page": unref(B).hasNextPage.value,
91
+ onNext: M[0] ||= (r) => unref(B).fetchNextPage(),
92
+ onDelete: U,
93
+ onUpdate: W
94
+ }, null, 8, [
95
+ "is-loading",
96
+ "notes",
97
+ "has-next-page"
98
+ ]));
99
+ }
100
+ });
101
+ function useIndividualSetPrimaryContactPersonMutation() {
102
+ let r = useQueryClient(), M = "wiseCrmIndividualDetail", N = useMutation({
103
+ mutationFn: async (r) => {
104
+ await IndividualService.setPrimaryContactPerson(r.individualUuid, r.contactPersonUuid);
105
+ },
106
+ onError: (N, P, F) => {
107
+ r.setQueryData([M, { individualUuid: P.individualUuid }], F?.previousData);
108
+ },
109
+ onMutate: async (N) => {
110
+ await r.cancelQueries({ queryKey: [M] });
111
+ let P = r.getQueryData([M, { individualUuid: N.individualUuid }]);
112
+ return P === void 0 ? {} : (r.setQueryData([M, { individualUuid: N.individualUuid }], {
113
+ ...P,
114
+ contactPersons: P.contactPersons.map((r) => r.uuid === N.contactPersonUuid ? {
115
+ ...r,
116
+ isPrimary: !r.isPrimary
117
+ } : {
118
+ ...r,
119
+ isPrimary: !1
120
+ })
121
+ }), { previousData: P });
122
+ },
123
+ onSettled: (N, P, F, I) => {
124
+ F !== void 0 && r.invalidateQueries({ queryKey: [M, { individualUuid: F.individualUuid }] });
125
+ }
126
+ });
127
+ return {
128
+ isLoading: computed(() => N.isPending.value),
129
+ data: computed(() => N.data.value),
130
+ execute: async (r) => {
131
+ await N.mutateAsync(r.params);
132
+ }
133
+ };
134
+ }
135
+ function useIndividualUnlinkContactPersonMutation() {
136
+ return ze({
137
+ queryFn: async ({ body: r, params: M }) => await IndividualService.unlinkContactPerson(M.individualUuid, r.contactPersonUuid),
138
+ queryKeysToInvalidate: {
139
+ individualIndex: {},
140
+ wiseCrmIndividualDetail: { individualUuid: (r) => r.individualUuid }
141
+ }
142
+ });
143
+ }
144
+ var _hoisted_1$1 = { class: "gap-md flex flex-col" }, CrmDetailSidebarAccordionCustomerInfo_default = /* @__PURE__ */ defineComponent({
145
+ __name: "CrmDetailSidebarAccordionCustomerInfo",
146
+ props: { individual: {} },
147
+ setup(r) {
148
+ let M = r, N = useI18n();
149
+ return (r, P) => (openBlock(), createElementBlock("div", _hoisted_1$1, [createVNode(CrmDetailSidebarCard_default, null, {
150
+ default: withCtx(() => [createVNode(AppIconLabelPair_default, {
151
+ label: unref(N).t("wise_crm.info_dialog.sidebar.overview.created_at_label", { value: M.individual.createdAt ? unref(useDateTimeFormat)().toDateTime(M.individual.createdAt) : "-" }),
152
+ icon: "clockPlus"
153
+ }, null, 8, ["label"])]),
154
+ _: 1
155
+ }), createVNode(CrmDetailSidebarMapCard_default, { address: M.individual.address }, null, 8, ["address"])]));
156
+ }
157
+ });
158
+ function useIndividualLinkContactPersonMutation() {
159
+ return ze({
160
+ queryFn: async ({ body: r, params: M }) => await IndividualService.linkContactPerson(M.individualUuid, r.contactPersonUuid, r.position, r.contactInfo),
161
+ queryKeysToInvalidate: {
162
+ individualIndex: {},
163
+ wiseCrmIndividualDetail: { individualUuid: (r) => r.individualUuid }
164
+ }
165
+ });
166
+ }
167
+ var IndividualContactPersonCreateDialog_default = /* @__PURE__ */ defineComponent({
168
+ __name: "IndividualContactPersonCreateDialog",
169
+ props: {
170
+ individualUuid: {},
171
+ isCreatingNewContactPerson: {
172
+ type: Boolean,
173
+ default: !1
174
+ }
175
+ },
176
+ emits: ["close", "createNewContactPerson"],
177
+ setup(r, { emit: N }) {
178
+ let P = r, F = N, I = useI18n(), L = useApiErrorToast(), R = useIndividualLinkContactPersonMutation(), z = useContactPersonCreateMutation();
179
+ async function B(r) {
180
+ try {
181
+ let M = await z.execute({ body: {
182
+ email: r.email,
183
+ firstName: r.firstName,
184
+ lastName: r.lastName,
185
+ mobilePhone: r.mobilePhone,
186
+ phone: r.phone
187
+ } });
188
+ P.isCreatingNewContactPerson || await R.execute({
189
+ body: {
190
+ contactPersonUuid: M,
191
+ contactInfo: {
192
+ email: r.email,
193
+ mobilePhone: r.mobilePhone,
194
+ phone: r.phone
195
+ },
196
+ position: r.position
197
+ },
198
+ params: { individualUuid: P.individualUuid }
199
+ }), U({
200
+ label: `${r.firstName} ${r.lastName}`,
201
+ value: M
202
+ });
203
+ } catch (r) {
204
+ L.show(r);
205
+ }
206
+ }
207
+ async function H(r, M, N) {
208
+ if (r !== null) try {
209
+ await R.execute({
210
+ body: {
211
+ contactPersonUuid: r,
212
+ contactInfo: M,
213
+ position: N
214
+ },
215
+ params: { individualUuid: P.individualUuid }
216
+ }), U();
217
+ } catch (r) {
218
+ L.show(r);
219
+ }
220
+ }
221
+ function U(r) {
222
+ if (r === void 0) {
223
+ F("close");
224
+ return;
225
+ }
226
+ F("createNewContactPerson", r), F("close");
227
+ }
228
+ return (r, M) => (openBlock(), createBlock(AppDialog_default, {
229
+ title: unref(I).t("wise_crm.info_dialog.contact_person_create.title"),
230
+ description: unref(I).t("wise_crm.info_dialog.contact_person_create.description"),
231
+ onClose: U
232
+ }, {
233
+ default: withCtx(() => [createVNode(ContactPersonCreateForm_default, {
234
+ "on-submit": B,
235
+ "on-link-contact-person": H,
236
+ "is-creating-new-contact-person": P.isCreatingNewContactPerson,
237
+ onClose: U
238
+ }, null, 8, ["is-creating-new-contact-person"])]),
239
+ _: 1
240
+ }, 8, ["title", "description"]));
241
+ }
242
+ });
243
+ function useIndividualContactPersonUpdateMutation() {
244
+ return ze({
245
+ queryFn: async ({ body: r, params: M }) => await IndividualService.updateContactPerson(M.individualUuid, M.contactPersonUuid, r),
246
+ queryKeysToInvalidate: {
247
+ contactPersonDetail: { contactPersonUuid: (r) => r.contactPersonUuid },
248
+ individualIndex: {},
249
+ wiseCrmIndividualDetail: { individualUuid: (r) => r.individualUuid }
250
+ }
251
+ });
252
+ }
253
+ function useIndividualContactPersonDetailQuery(r, M) {
254
+ return He({
255
+ isEnabled: computed(() => r.value !== null && M.value !== null),
256
+ queryFn: () => {
257
+ if (r.value === null) throw Error("Individual UUID is null");
258
+ if (M.value === null) throw Error("Contact Person UUID is null");
259
+ return IndividualService.getContactPerson(r.value, M.value);
260
+ },
261
+ queryKey: { contactPersonDetail: { contactPersonUuid: M } }
262
+ });
263
+ }
264
+ var IndividualContactPersonUpdateForm_default = /* @__PURE__ */ defineComponent({
265
+ __name: "IndividualContactPersonUpdateForm",
266
+ props: {
267
+ individualUuid: {},
268
+ contactPerson: {},
269
+ onSubmit: { type: Function }
270
+ },
271
+ setup(r) {
272
+ let M = r, N = useI18n(), I = useForm({
273
+ initialState: {
274
+ email: M.contactPerson.email,
275
+ firstName: M.contactPerson.firstName,
276
+ lastName: M.contactPerson.lastName,
277
+ mobilePhone: M.contactPerson.mobilePhone,
278
+ phone: M.contactPerson.phone,
279
+ position: M.contactPerson.position
280
+ },
281
+ schema: contactPersonUpdateFormSchema,
282
+ onSubmit: async (r) => {
283
+ await M.onSubmit(r);
284
+ }
285
+ });
286
+ return (r, M) => (openBlock(), createBlock(ContactPersonCreateNewForm_default, { form: unref(I) }, {
287
+ actions: withCtx(() => [createVNode(AppSidebarFormFooter_default, null, {
288
+ default: withCtx(() => [createVNode(AppSidebarFormSubmitButton_default, {
289
+ "is-loading": unref(I).isSubmitting.value,
290
+ label: unref(N).t("wise_crm.shared.save_changes")
291
+ }, null, 8, ["is-loading", "label"])]),
292
+ _: 1
293
+ })]),
294
+ _: 1
295
+ }, 8, ["form"]));
296
+ }
297
+ }), IndividualContactPersonUpdateDialog_default = /* @__PURE__ */ defineComponent({
298
+ __name: "IndividualContactPersonUpdateDialog",
299
+ props: {
300
+ contactPersonUuid: {},
301
+ individualUuid: {}
302
+ },
303
+ emits: ["close"],
304
+ setup(r, { emit: N }) {
305
+ let P = r, F = N, I = useI18n(), L = useApiErrorToast(), R = useIndividualContactPersonDetailQuery(computed(() => P.individualUuid), computed(() => P.contactPersonUuid)), z = useIndividualContactPersonUpdateMutation();
306
+ async function B(r) {
307
+ try {
308
+ await z.execute({
309
+ body: r,
310
+ params: {
311
+ contactPersonUuid: P.contactPersonUuid,
312
+ individualUuid: P.individualUuid
313
+ }
314
+ }), F("close");
315
+ } catch (r) {
316
+ L.show(r);
317
+ }
318
+ }
319
+ function V() {
320
+ F("close");
321
+ }
322
+ return (r, M) => (openBlock(), createBlock(AppDialog_default, {
323
+ title: unref(I).t("wise_crm.info_dialog.contact_person_update.title"),
324
+ description: unref(I).t("wise_crm.info_dialog.contact_person_create.description"),
325
+ onClose: V
326
+ }, {
327
+ default: withCtx(() => [unref(R).data.value ? (openBlock(), createBlock(IndividualContactPersonUpdateForm_default, {
328
+ key: 0,
329
+ "individual-uuid": P.individualUuid,
330
+ "on-submit": B,
331
+ "contact-person": unref(R).data.value,
332
+ onClose: V
333
+ }, null, 8, ["individual-uuid", "contact-person"])) : createCommentVNode("", !0)]),
334
+ _: 1
335
+ }, 8, ["title", "description"]));
336
+ }
337
+ }), _hoisted_1 = { class: "gap-sm flex" }, _hoisted_2 = { class: "font-regular flex flex-col items-start" }, _hoisted_3 = { class: "font-semibold" }, _hoisted_4 = { class: "font-regular text-brand-500 text-xs" }, IndividualDetailSidebarOverviewContent_default = /* @__PURE__ */ defineComponent({
338
+ __name: "IndividualDetailSidebarOverviewContent",
339
+ props: { individual: {} },
340
+ setup(r) {
341
+ let N = r, P = useI18n(), F = useApiErrorToast(), I = useCrm(), z = useDialog(IndividualContactPersonCreateDialog_default), V = useDialog(IndividualContactPersonUpdateDialog_default), U = useDialog(AppConfirmDialog_default), G = useIndividualSetPrimaryContactPersonMutation(), K = useIndividualUnlinkContactPersonMutation(), q = computed(() => N.individual.contactPersons.length > 0), J = computed(() => N.individual.billingInformationDetail !== null), Y = computed(() => I.getEntityConfig(EntityType.BUSINESS)?.name.toLowerCase() ?? "");
342
+ function X() {
343
+ z.open({ individualUuid: N.individual.uuid });
344
+ }
345
+ function Z(r) {
346
+ V.open({
347
+ contactPersonUuid: r,
348
+ individualUuid: N.individual.uuid
349
+ });
350
+ }
351
+ function Q(r) {
352
+ U.open({
353
+ title: P.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_title"),
354
+ isDestructive: !0,
355
+ isLoading: K.isLoading.value,
356
+ confirmText: P.t("shared.delete"),
357
+ description: P.t("wise_crm.info_dialog.sidebar.overview.delete_contact_person_description"),
358
+ onConfirm: async () => {
359
+ try {
360
+ await K.execute({
361
+ body: { contactPersonUuid: r },
362
+ params: { individualUuid: N.individual.uuid }
363
+ });
364
+ } catch (r) {
365
+ F.show(r);
366
+ } finally {
367
+ U.close();
368
+ }
369
+ }
370
+ });
371
+ }
372
+ function $(r) {
373
+ G.execute({ params: {
374
+ contactPersonUuid: r,
375
+ individualUuid: N.individual.uuid
376
+ } });
377
+ }
378
+ return (M, F) => (openBlock(), createBlock(CrmDetailAccordionRoot_default, { "default-values": [
379
+ "customer",
380
+ "invoice",
381
+ "contact-persons",
382
+ "linked-businesses"
383
+ ] }, {
384
+ default: withCtx(() => [
385
+ createVNode(CrmDetailSidebarAccordionItem_default, {
386
+ label: unref(P).t("wise_crm.info_dialog.sidebar.overview.customer_info_label"),
387
+ value: "customer",
388
+ icon: "infoCircle"
389
+ }, {
390
+ default: withCtx(() => [createVNode(CrmDetailSidebarAccordionCustomerInfo_default, { individual: r.individual }, null, 8, ["individual"])]),
391
+ _: 1
392
+ }, 8, ["label"]),
393
+ createVNode(CrmDetailSidebarAccordionItem_default, {
394
+ label: unref(P).t("wise_crm.info_dialog.sidebar.overview.invoice_label"),
395
+ "is-empty": !J.value,
396
+ value: "invoice",
397
+ icon: "wallet"
398
+ }, {
399
+ default: withCtx(() => [N.individual.billingInformationDetail ? (openBlock(), createBlock(CrmDetailSidebarAccordionBillingInformation_default, {
400
+ key: 0,
401
+ "invoice-address": N.individual.billingInformationDetail.location?.address ?? null,
402
+ "invoice-email": N.individual.billingInformationDetail.invoiceEmail
403
+ }, null, 8, ["invoice-address", "invoice-email"])) : createCommentVNode("", !0)]),
404
+ _: 1
405
+ }, 8, ["label", "is-empty"]),
406
+ createVNode(CrmDetailSidebarAccordionItem_default, {
407
+ "is-empty": !q.value,
408
+ label: unref(P).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
409
+ value: "contact-persons",
410
+ icon: "userCircle",
411
+ onAdd: X
412
+ }, {
413
+ actions: withCtx(() => [q.value ? createCommentVNode("", !0) : (openBlock(), createBlock(CrmDetailSidebarAccordionHeaderIconButton_default, {
414
+ key: 0,
415
+ label: unref(P).t("wise_crm.info_dialog.sidebar.overview.contact_persons_label"),
416
+ class: "z-1",
417
+ icon: "plus",
418
+ onClick: X
419
+ }, null, 8, ["label"]))]),
420
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.contactPersons, (r) => (openBlock(), createBlock(unref(Motion), {
421
+ key: r.uuid,
422
+ "layout-id": r.uuid
423
+ }, {
424
+ default: withCtx(() => [createVNode(CrmDetailSidebarAccordionContactPersonInfo_default, {
425
+ "contact-person": r,
426
+ "on-toggle-is-primary": () => $(r.uuid),
427
+ onUpdate: (M) => Z(r.uuid),
428
+ onDelete: (M) => Q(r.uuid)
429
+ }, null, 8, [
430
+ "contact-person",
431
+ "on-toggle-is-primary",
432
+ "onUpdate",
433
+ "onDelete"
434
+ ])]),
435
+ _: 2
436
+ }, 1032, ["layout-id"]))), 128)), q.value ? (openBlock(), createBlock(unref(VcButton), {
437
+ key: 0,
438
+ size: "sm",
439
+ variant: "tertiary",
440
+ "icon-left": "plus",
441
+ onClick: X
442
+ }, {
443
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(P).t("wise_crm.shared.add")), 1)]),
444
+ _: 1
445
+ })) : createCommentVNode("", !0)]),
446
+ _: 1
447
+ }, 8, ["is-empty", "label"]),
448
+ N.individual.linkedBusinesses.length > 0 ? (openBlock(), createBlock(CrmDetailSidebarAccordionItem_default, {
449
+ key: 0,
450
+ "is-edit-button-hidden": !0,
451
+ label: unref(P).t("wise_crm.info_dialog.sidebar.overview.linked_business_label", { label: Y.value }),
452
+ value: "linked-businesses",
453
+ icon: "building"
454
+ }, {
455
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(N.individual.linkedBusinesses, (r) => (openBlock(), createBlock(CrmDetailSidebarCard_default, {
456
+ key: r.uuid,
457
+ class: "gap-lg flex flex-col"
458
+ }, {
459
+ default: withCtx(() => [
460
+ createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createVNode(unref(VcRouterLinkButton), {
461
+ to: {
462
+ name: "business-detail",
463
+ params: { businessUuid: r.uuid }
464
+ },
465
+ "class-config": { root: "p-0 bg-transparent! h-min hover:underline" },
466
+ variant: "tertiary"
467
+ }, {
468
+ default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(r.name), 1)]),
469
+ _: 2
470
+ }, 1032, ["to"]), createElementVNode("p", _hoisted_4, toDisplayString(r.position), 1)])]),
471
+ createVNode(AppIconLabelPair_default, {
472
+ label: r.email ?? "-",
473
+ icon: "mail"
474
+ }, null, 8, ["label"]),
475
+ createVNode(AppIconLabelPair_default, {
476
+ label: r.mobilePhone ?? r.phone ?? "-",
477
+ icon: "phone"
478
+ }, null, 8, ["label"])
479
+ ]),
480
+ _: 2
481
+ }, 1024))), 128))]),
482
+ _: 1
483
+ }, 8, ["label"])) : createCommentVNode("", !0)
484
+ ]),
485
+ _: 1
486
+ }));
487
+ }
488
+ }), InfoTab = /* @__PURE__ */ function(r) {
489
+ return r.ACTIVITY = "activity", r.NOTES = "notes", r.OVERVIEW = "overview", r;
490
+ }(InfoTab || {}), IndividualDetailSidebar_default = /* @__PURE__ */ defineComponent({
491
+ __name: "IndividualDetailSidebar",
492
+ props: { individual: {} },
493
+ setup(r) {
494
+ let N = r, P = useI18n(), F = useToast(), I = useCrm(), R = useApiErrorToast(), z = useIndividualGrantMutation(), B = ref(InfoTab.OVERVIEW), V = computed(() => [
495
+ {
496
+ icon: "infoCircle",
497
+ label: P.t("wise_crm.shared.overview"),
498
+ value: InfoTab.OVERVIEW
499
+ },
500
+ {
501
+ icon: "activity",
502
+ label: P.t("wise_crm.shared.activity"),
503
+ value: InfoTab.ACTIVITY
504
+ },
505
+ {
506
+ icon: "book",
507
+ label: P.t("wise_crm.shared.notes"),
508
+ value: InfoTab.NOTES
509
+ }
510
+ ]), H = computed(() => I.getEntityConfig(EntityType.INDIVIDUAL));
511
+ async function W() {
512
+ if (N.individual.email !== null) try {
513
+ await z.execute({
514
+ body: {
515
+ email: N.individual.email,
516
+ firstName: N.individual.firstName,
517
+ lastName: N.individual.lastName
518
+ },
519
+ params: { individualUuid: N.individual.uuid }
520
+ }), F.success({
521
+ title: P.t("toast.success.general_title"),
522
+ description: P.t("wise_crm.info_dialog.sidebar.grant_customer_zone_access_success")
523
+ });
524
+ } catch (r) {
525
+ R.show(r);
526
+ }
527
+ }
528
+ return (M, F) => (openBlock(), createBlock(AppColorProvider_default, {
529
+ color: unref(I).getEntityConfig(unref(EntityType).INDIVIDUAL)?.color ?? null,
530
+ class: "flex h-full flex-col"
531
+ }, {
532
+ default: withCtx(() => [createVNode(CrmDetailHeaderCard_default, {
533
+ "entity-type": unref(EntityType).INDIVIDUAL,
534
+ name: `${N.individual.firstName} ${N.individual.lastName}`,
535
+ address: N.individual.address,
536
+ email: N.individual.email,
537
+ "mobile-phone": N.individual.mobilePhone,
538
+ "entity-name": H.value?.name ?? null,
539
+ phone: N.individual.phone
540
+ }, {
541
+ actions: withCtx(() => [createVNode(unref(VcIconButton), {
542
+ disabled: N.individual.email === null || unref(z).isLoading.value,
543
+ "is-loading": unref(z).isLoading.value,
544
+ label: unref(P).t("wise_crm.info_dialog.sidebar.grant_customer_zone_access"),
545
+ "class-config": {
546
+ root: "bg-gray-50/50 dark:bg-brand-950 border-none shadow-none w-auto h-auto p-xs data-[loading=false]:not-disabled:hover:bg-gray-50/30 rounded-full size-8 duration-300",
547
+ icon: "text-brand-700 size-4 dark:text-brand-200"
548
+ },
549
+ size: "sm",
550
+ icon: "user",
551
+ variant: "secondary",
552
+ onClick: W
553
+ }, null, 8, [
554
+ "disabled",
555
+ "is-loading",
556
+ "label"
557
+ ])]),
558
+ _: 1
559
+ }, 8, [
560
+ "entity-type",
561
+ "name",
562
+ "address",
563
+ "email",
564
+ "mobile-phone",
565
+ "entity-name",
566
+ "phone"
567
+ ]), createVNode(CrmDetailSidebarTabs_default, {
568
+ modelValue: B.value,
569
+ "onUpdate:modelValue": F[0] ||= (r) => B.value = r,
570
+ tabs: V.value
571
+ }, {
572
+ default: withCtx(() => [B.value === InfoTab.OVERVIEW ? (openBlock(), createBlock(IndividualDetailSidebarOverviewContent_default, {
573
+ key: 0,
574
+ individual: r.individual
575
+ }, null, 8, ["individual"])) : B.value === InfoTab.ACTIVITY ? (openBlock(), createBlock(IndividualDetailSidebarActivityContent_default, {
576
+ key: 1,
577
+ individual: r.individual
578
+ }, null, 8, ["individual"])) : createCommentVNode("", !0), B.value === InfoTab.NOTES ? (openBlock(), createBlock(IndividualDetailSidebarNotesContent_default, {
579
+ key: 2,
580
+ individual: N.individual
581
+ }, null, 8, ["individual"])) : createCommentVNode("", !0)]),
582
+ _: 1
583
+ }, 8, ["modelValue", "tabs"])]),
584
+ _: 1
585
+ }, 8, ["color"]));
586
+ }
587
+ }), IndividualDetailSidebarProvider_default = /* @__PURE__ */ defineComponent({
588
+ __name: "IndividualDetailSidebarProvider",
589
+ props: { individualUuid: {} },
590
+ setup(r) {
591
+ let M = r, N = useI18n(), P = useIndividualDetailQuery(computed(() => M.individualUuid)), F = computed(() => P.data.value ?? null);
592
+ return (r, M) => (openBlock(), createBlock(CrmDetailContainer_default, null, {
593
+ default: withCtx(() => [unref(P).isError.value ? (openBlock(), createBlock(Error_default, {
594
+ key: 0,
595
+ message: unref(N).t("error.business_details.description"),
596
+ title: unref(N).t("error.business_details.title")
597
+ }, null, 8, ["message", "title"])) : unref(P).isLoading.value ? (openBlock(), createBlock(AppSkeletonLoader_default, {
598
+ key: 1,
599
+ class: "h-full"
600
+ })) : F.value ? (openBlock(), createBlock(IndividualDetailSidebar_default, {
601
+ key: 2,
602
+ individual: F.value
603
+ }, null, 8, ["individual"])) : createCommentVNode("", !0)]),
604
+ _: 1
605
+ }));
606
+ }
607
+ });
608
+ export { useIndividualDetailQuery as n, IndividualDetailSidebarProvider_default as t };
@@ -1,9 +1,9 @@
1
- import "./Error-BPxDpKcI.js";
2
- import "./CrmDetailHeaderCard-e5332OkQ.js";
1
+ import "./Error-BArv9rNb.js";
2
+ import "./CrmDetailHeaderCard-CCNJpMAK.js";
3
3
  import "./AppSkeletonLoader-BAhoOmFD.js";
4
- import { gt as EntityType } from "./client-BP13IBbl.js";
5
- import { t as IndividualDetailSidebarProvider_default } from "./IndividualDetailSidebarProvider-CvZQdjzp.js";
6
- import { t as CrmDetailView_default } from "./CrmDetailView-C-lsAhtD.js";
4
+ import { ht as EntityType } from "./client-pCaNxE3C.js";
5
+ import { t as IndividualDetailSidebarProvider_default } from "./IndividualDetailSidebarProvider-BXZH951l.js";
6
+ import { t as CrmDetailView_default } from "./CrmDetailView-ozCpuaX2.js";
7
7
  import { createBlock, createVNode, defineComponent, openBlock, unref, withCtx } from "vue";
8
8
  import { useRouteParams } from "@vueuse/router";
9
9
  var IndividualDetailView_default = /* @__PURE__ */ defineComponent({
@@ -0,0 +1,17 @@
1
+ import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BSi1g3Lh.js";
2
+ import { createElementBlock, createElementVNode, openBlock } from "vue";
3
+ var _sfc_main = {}, _hoisted_1 = {
4
+ viewBox: "0 0 22 22",
5
+ fill: "none"
6
+ };
7
+ function _sfc_render(e, s) {
8
+ return openBlock(), createElementBlock("svg", _hoisted_1, [...s[0] ||= [createElementVNode("path", {
9
+ d: "M7.5 14.5L14.5 7.49998M8 3V1M14 19V21M3 8H1M19 14H21M3.91421 3.91421L2.5 2.5M18.0858 18.0857L19.5 19.4999M11 16.6568L8.87871 18.7781C7.31662 20.3402 4.78396 20.3402 3.22186 18.7781C1.65976 17.216 1.65976 14.6833 3.22186 13.1212L5.34318 10.9999M16.6569 10.9999L18.7782 8.87859C20.3403 7.31649 20.3403 4.78383 18.7782 3.22174C17.2161 1.65964 14.6835 1.65964 13.1214 3.22174L11 5.34306",
10
+ stroke: "currentColor",
11
+ "stroke-width": "2",
12
+ "stroke-linecap": "round",
13
+ "stroke-linejoin": "round"
14
+ }, null, -1)]]);
15
+ }
16
+ var LinkBrokenIcon_default = /* @__PURE__ */ __plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
17
+ export { LinkBrokenIcon_default as default };
@@ -5,6 +5,6 @@ export declare function useDealCreateMutation(): import("@wisemen/vue-core-query
5
5
  type: import("../../../client").ClientType;
6
6
  };
7
7
  name: string;
8
- dealLanguage: import("../../../client").ContentLocale;
8
+ dealLanguage: import("../../../client").SdkContentLocale;
9
9
  dealSource: import("../../../client").DealSource;
10
10
  }, string & import("zod").$brand<"DealUuid">, void>;
@@ -1,11 +1,11 @@
1
- import type { ContentLocale, DealSource } from '@/client';
1
+ import type { DealSource, SdkContentLocale } from '@/client';
2
2
  import type { DealUuid } from '@/models/deal/dealUuid.model.ts';
3
3
  interface DealUpdateParams {
4
4
  dealUuid: DealUuid;
5
5
  }
6
6
  export declare function useDealUpdateMutation(): import("@wisemen/vue-core-query").UseMutationReturnType<{
7
7
  name: string | null;
8
- dealLanguage: ContentLocale | null;
8
+ dealLanguage: SdkContentLocale | null;
9
9
  dealOwner: {
10
10
  uuid: string;
11
11
  name: string;
@@ -13,7 +13,7 @@ export declare function useDealUpdateMutation(): import("@wisemen/vue-core-query
13
13
  dealSource: DealSource | null;
14
14
  }, void, DealUpdateParams>;
15
15
  export declare function useDealUpdateLanguageMutation(): import("@wisemen/vue-core-query").UseMutationReturnType<{
16
- dealLanguage: ContentLocale;
16
+ dealLanguage: SdkContentLocale;
17
17
  }, void, DealUpdateParams>;
18
18
  export declare function useDealUpdateSourceMutation(): import("@wisemen/vue-core-query").UseMutationReturnType<{
19
19
  dealSource: DealSource;
@@ -14,7 +14,7 @@ export declare function useMailTemplateUpdateMutation(): import("@wisemen/vue-co
14
14
  order: number;
15
15
  url: string | null;
16
16
  }[];
17
- language: import("../../../client").ContentLocale;
17
+ language: import("../../../client").SdkContentLocale;
18
18
  message: string;
19
19
  replyTo: string | null;
20
20
  subject: string;