@wisemen/wise-crm-web 2.0.0-alpha.9 → 3.0.0-alpha.1

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.
package/README.md ADDED
@@ -0,0 +1,244 @@
1
+ # @wisemen/wise-crm-web
2
+
3
+ Vue 3 CRM package: business, individual and deal overviews, detail views, dialogs and widgets.
4
+
5
+ ## Tenant config
6
+
7
+ Everything in the CRM depends on the tenant config, fetched by `useWiseCrmConfig().init()`. When that call fails, only the CRM is unavailable: the rest of the host app keeps working.
8
+
9
+ - **Retries:** network errors, 5xx and gateway pages are retried 3 times (after 1s, 2s and 4s). A 4xx fails straight away.
10
+ - **Guarded components:** every exported component and dialog shows its own loading state, and an error state with a "Try again" button when the config is unavailable. A successful retry updates all of them at once.
11
+ - **Don't gate the host app on the CRM:** render your `RouterView` without waiting for the config.
12
+ - **Reporting:** pass `onError` to forward failures to your own logging. `init()` never rejects.
13
+
14
+ ```ts
15
+ const wiseCrm = useWiseCrmConfig()
16
+
17
+ wiseCrm.init({
18
+ // ...
19
+ onError: (error) => telemetry.recordException(error),
20
+ })
21
+
22
+ wiseCrm.status.value // 'loading' | 'ready' | 'error'
23
+ wiseCrm.error.value // the last fetch error, or null
24
+ wiseCrm.retry() // fetch the config once more
25
+ ```
26
+
27
+ Outside the guarded components, `getConfig()` throws until `status` is `'ready'`. Check `status` first, in a computed so it updates once the config arrives. `useWiseCrm().getEntityConfig()` returns `null` until then.
28
+
29
+ ## Extending the detail views
30
+
31
+ The detail views can be extended with content from the host app in three places.
32
+
33
+ ### Custom tabs
34
+
35
+ Tabs in the detail view are routes, registered through `useWiseCrmRoutes`. At least one tab is required for businesses and individuals. The tab component reads the entity uuid from the route params (`businessUuid` / `individualUuid` / `dealUuid`).
36
+
37
+ ```ts
38
+ useWiseCrmRoutes({
39
+ businessTabRoutes: [
40
+ {
41
+ label: computed<string>(() => t('crm.business.tabs.information')),
42
+ route: {
43
+ name: 'crm-business-information',
44
+ path: 'information',
45
+ component: (): Component => import('./CrmBusinessInformationTabView.vue'),
46
+ },
47
+ },
48
+ ],
49
+ dealTabRoutes: [...],
50
+ individualTabRoutes: [...],
51
+ })
52
+ ```
53
+
54
+ ### Custom sidebar sections
55
+
56
+ Widgets rendered at the end of the side column of the detail view's Overview tab, after the built-in widgets. Register them through the `business` / `individual` options of `useWiseCrmConfig().init()`:
57
+
58
+ ```ts
59
+ import type { WiseCrmSidebarSection } from '@wisemen/wise-crm-web'
60
+
61
+ useWiseCrmConfig().init({
62
+ // ...
63
+ options: {
64
+ business: {
65
+ sidebarSections: [
66
+ {
67
+ icon: ShoppingCart01Icon,
68
+ key: 'orders',
69
+ label: computed<string>(() => t('crm.business.sidebar.orders')),
70
+ component: defineAsyncComponent(() => import('./BusinessOrdersSidebarSection.vue')),
71
+ },
72
+ ],
73
+ },
74
+ individual: {
75
+ sidebarSections: [...],
76
+ },
77
+ // ...
78
+ },
79
+ })
80
+ ```
81
+
82
+ | Field | Description |
83
+ | -------------- | --------------------------------------------------------------------------------------------------------------------------------- |
84
+ | `key` | Unique per entity. |
85
+ | `label` | Widget title, a `ComputedRef<string>` so it follows the locale. |
86
+ | `icon` | Currently not shown; kept so existing configs keep working. |
87
+ | `component` | Section body. |
88
+ | `useIsVisible` | Optional. Receives the component's props as a `ComputedRef` and returns a `ComputedRef<boolean>`; the section is hidden while it is `false`. |
89
+
90
+ The component receives only the entity uuid. It fetches its own data and renders its own loading and empty state.
91
+
92
+ ```vue
93
+ <script setup lang="ts">
94
+ import type { WiseCrmBusinessUuid } from '@wisemen/wise-crm-web'
95
+
96
+ const props = defineProps<{
97
+ businessUuid: WiseCrmBusinessUuid
98
+ }>()
99
+ </script>
100
+ ```
101
+
102
+ Individual sections receive `individualUuid: WiseCrmIndividualUuid` instead. A component with the wrong props is a type error.
103
+
104
+ `useIsVisible` is called once in the Overview tab's setup, so it can use composables such as queries. Use it to hide a section that has nothing to show for this entity, rather than rendering an empty widget:
105
+
106
+ ```ts
107
+ {
108
+ key: 'parent',
109
+ // ...
110
+ useIsVisible: (props) => useBusinessHasParent(computed(() => props.value.businessUuid)),
111
+ }
112
+ ```
113
+
114
+ ### Custom header badges
115
+
116
+ Badges rendered in the header of the business, individual and deal detail views, after the built-in badges. Register them through `headerBadges` on the `business` / `individual` / `deals` options of `useWiseCrmConfig().init()`:
117
+
118
+ ```ts
119
+ useWiseCrmConfig().init({
120
+ // ...
121
+ options: {
122
+ business: {
123
+ headerBadges: [
124
+ {
125
+ key: 'open-invoices',
126
+ color: 'warning',
127
+ icon: FileAttachment01Icon,
128
+ getData: async ({ uuid }) => {
129
+ const count = await InvoiceService.getOpenCountForBusiness(uuid)
130
+
131
+ return count > 0 ? t('crm.business.badges.open_invoices', { count }) : null
132
+ },
133
+ },
134
+ ],
135
+ },
136
+ deals: {
137
+ // ...
138
+ headerBadges: [...],
139
+ },
140
+ individual: {
141
+ headerBadges: [...],
142
+ },
143
+ },
144
+ })
145
+ ```
146
+
147
+ | Field | Description |
148
+ | ------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
149
+ | `key` | Unique per entity; used to cache the badge's data. |
150
+ | `getData` | Receives `{ uuid }` and resolves to the badge label, or to `{ label, color?, variant?, icon?, dot? }` when the style depends on the data. Resolve to `null` or an empty label to hide the badge. |
151
+ | `color`, `variant`, `icon`, `dot` | Optional, passed to `UIBadge`. Defaults match the built-in badges (`gray`, `translucent`). |
152
+
153
+ Styles returned from `getData` override the ones on the badge, for example to color a score by its value:
154
+
155
+ ```ts
156
+ {
157
+ key: 'credit-score',
158
+ getData: async ({ uuid }) => {
159
+ const { score, isHealthy } = await CreditService.getForBusiness(uuid)
160
+
161
+ return {
162
+ label: t('crm.business.badges.credit_score', { score }),
163
+ color: isHealthy ? 'success' : 'error',
164
+ }
165
+ },
166
+ }
167
+ ```
168
+
169
+ Type the arrays with `WiseCrmBusinessHeaderBadge`, `WiseCrmIndividualHeaderBadge` or `WiseCrmDealHeaderBadge`; `uuid` is then a `WiseCrmBusinessUuid`, `WiseCrmIndividualUuid` or `WiseCrmDealUuid`.
170
+
171
+ - The label is rendered as is, so translate it in `getData`. Badges refetch when the locale changes. Long labels are truncated with a tooltip.
172
+ - A skeleton is shown while `getData` is pending.
173
+ - When `getData` throws, the badge is hidden and the error is logged; it is not retried.
174
+ - Badges are not refetched when the entity is edited in the CRM, since the host app's data usually only follows through an event. To refresh them, for example on a websocket event, invalidate the `wiseCrmHeaderBadge` query key.
175
+
176
+ ## Extending the overview tables
177
+
178
+ ### Host entity overview
179
+
180
+ `WiseCrmBusinessTable` and `WiseCrmIndividualTable` can show the host app's rows and columns instead of the CRM's, for example to show, filter or sort on data the host app owns. The package keeps the search field, infinite scroll, error state and the link to the detail view. Register it through `overview` on the `business` / `individual` options of `useWiseCrmConfig().init()`:
181
+
182
+ ```ts
183
+ import type {
184
+ WiseCrmBusinessOverviewOptions,
185
+ WiseCrmBusinessUuid,
186
+ } from '@wisemen/wise-crm-web'
187
+
188
+ interface CustomerRow {
189
+ uuid: WiseCrmBusinessUuid
190
+ name: string
191
+ blocking: CustomerBlocking
192
+ }
193
+
194
+ useWiseCrmConfig().init({
195
+ // ...
196
+ options: {
197
+ business: {
198
+ overview: {
199
+ getData: ({ pagination, search }) => CustomerService.getIndex({ pagination, search }),
200
+ columns: [
201
+ {
202
+ key: 'name',
203
+ headerLabel: computed<string>(() => t('crm.business.table.name')),
204
+ size: {
205
+ max: '20rem',
206
+ min: '12rem',
207
+ },
208
+ component: CustomerNameCell,
209
+ },
210
+ {
211
+ key: 'blocking',
212
+ headerLabel: computed<string>(() => t('crm.business.table.blocking')),
213
+ component: CustomerBlockingCell,
214
+ },
215
+ ],
216
+ } satisfies WiseCrmBusinessOverviewOptions<CustomerRow>,
217
+ },
218
+ individual: {
219
+ overview: {...},
220
+ },
221
+ },
222
+ })
223
+ ```
224
+
225
+ | Field | Description |
226
+ | --------- | ----------- |
227
+ | `getData` | Receives `{ pagination: { limit, offset }, search }` and resolves to `{ data, meta: { limit, offset, total } }`. `search` is trimmed, or `null` when empty. Called instead of the CRM index. |
228
+ | `columns` | Replace the built-in columns. Each has a `key` (unique per table), a `headerLabel` (`ComputedRef<string>`), an optional `size` (`{ min, max }`) and a `component`. |
229
+
230
+ The package only reads `uuid` from a row: the CRM business or individual uuid, used as the row key and for the link to the detail view. Everything else is up to the host app's columns.
231
+
232
+ The column component receives the whole row and renders only the cell content; the package wraps it in the table cell:
233
+
234
+ ```vue
235
+ <script setup lang="ts">
236
+ const props = defineProps<{
237
+ row: CustomerRow
238
+ }>()
239
+ </script>
240
+ ```
241
+
242
+ - When `getData` throws, the table shows its error state.
243
+ - The table is not refetched when an entity is edited in the CRM, since the host app's data usually only follows through an event. To refresh it, invalidate the `wiseCrmHostEntityOverview` query key (optionally with `{ entity: 'business' }`).
244
+ - Without `overview`, the tables show the CRM index and columns as before.
@@ -0,0 +1,163 @@
1
+ import { defineComponent as x, computed as w, openBlock as t, createElementBlock as a, Fragment as y, renderList as f, toDisplayString as p, createCommentVNode as u, createBlock as r, unref as s, withCtx as m, createTextVNode as V, createVNode as d, createElementVNode as _, resolveDynamicComponent as g } from "vue";
2
+ import { UITooltip as C, UIBadge as h, UITimeline as D, UITimelineItem as L } from "@wisemen/vue-core-design-system";
3
+ import { z, C as B, G as N, H as S, h as k, J as T, a as U } from "./index-BocNglY-.js";
4
+ import { useI18n as $ } from "vue-i18n";
5
+ import { f as A } from "./CrmDetailHeaderBadge.vue_vue_type_script_setup_true_lang-zlIXsu4c.js";
6
+ import { RouterLink as J } from "vue-router";
7
+ const P = { class: "flex flex-wrap items-center gap-xs" }, E = {
8
+ key: 0,
9
+ class: "shrink-0 text-sm text-primary"
10
+ }, F = { class: "flex flex-wrap items-center gap-md text-sm" }, O = { class: "text-brand text-xs" }, G = /* @__PURE__ */ x({
11
+ __name: "ActivityListItemMessage",
12
+ props: {
13
+ activity: {}
14
+ },
15
+ setup(c) {
16
+ const i = c;
17
+ function l(n) {
18
+ return n === null ? "" : typeof n == "object" ? JSON.stringify(n) : n.toString();
19
+ }
20
+ const o = w(() => i.activity.message.split(" ").map((n) => n === "[note]" ? {
21
+ text: i.activity.content?.note?.name ?? "",
22
+ type: "text"
23
+ } : n === "[contactPerson]" ? {
24
+ route: {
25
+ query: {
26
+ individualUuid: i.activity.content?.contactPerson?.uuid
27
+ }
28
+ },
29
+ text: i.activity.content?.contactPerson?.name ?? "",
30
+ type: "link"
31
+ } : {
32
+ text: n,
33
+ type: "text"
34
+ }));
35
+ return (n, b) => (t(), a("div", P, [
36
+ (t(!0), a(y, null, f(o.value, (e) => (t(), a(y, { key: e }, [
37
+ e.type === "text" ? (t(), a("span", E, p(e.text), 1)) : u("", !0),
38
+ e.type === "link" && e.route !== void 0 ? (t(), r(s(J), {
39
+ key: 1,
40
+ to: e.route,
41
+ class: "hover:text-brand text-sm font-medium text-primary hover:underline"
42
+ }, {
43
+ default: m(() => [
44
+ V(p(e.text), 1)
45
+ ]),
46
+ _: 2
47
+ }, 1032, ["to"])) : u("", !0)
48
+ ], 64))), 128)),
49
+ i.activity.changes.length > 0 ? (t(), r(s(C), { key: 0 }, {
50
+ trigger: m(() => [
51
+ (t(), r(g(s(N)), { class: "size-3 text-tertiary" }))
52
+ ]),
53
+ content: m(() => [
54
+ d(z, {
55
+ cols: 1,
56
+ class: "max-w-80 p-lg"
57
+ }, {
58
+ default: m(() => [
59
+ (t(!0), a(y, null, f(i.activity.changes, (e) => (t(), a("div", {
60
+ key: JSON.stringify(e),
61
+ class: "flex flex-col gap-sm"
62
+ }, [
63
+ _("div", F, [
64
+ _("p", O, p(e.key) + ": ", 1),
65
+ e.oldValue !== null ? (t(), r(s(h), {
66
+ key: 0,
67
+ "class-config": {
68
+ root: "rounded-sm border-none whitespace-pre-wrap"
69
+ },
70
+ label: l(e.oldValue),
71
+ size: "sm",
72
+ variant: "translucent",
73
+ color: "error"
74
+ }, null, 8, ["label"])) : u("", !0),
75
+ e.oldValue !== null && e.value !== null ? (t(), r(g(s(B)), {
76
+ key: 1,
77
+ class: "size-3"
78
+ })) : u("", !0),
79
+ d(s(h), {
80
+ "class-config": {
81
+ root: "rounded-sm border-none whitespace-pre-wrap"
82
+ },
83
+ label: l(e.value),
84
+ size: "sm",
85
+ variant: "translucent",
86
+ color: "success"
87
+ }, null, 8, ["label"])
88
+ ])
89
+ ]))), 128))
90
+ ]),
91
+ _: 1
92
+ })
93
+ ]),
94
+ _: 1
95
+ })) : u("", !0)
96
+ ]));
97
+ }
98
+ }), j = { class: "text-xs text-tertiary" }, q = /* @__PURE__ */ x({
99
+ __name: "ActivityListItem",
100
+ props: {
101
+ activity: {}
102
+ },
103
+ setup(c) {
104
+ const i = c;
105
+ function l(o) {
106
+ return S.isToday(o) ? k().fromNow(o.toInstant()) : k().toDate(o.toPlainDate());
107
+ }
108
+ return (o, n) => (t(), a(y, null, [
109
+ d(G, {
110
+ activity: i.activity
111
+ }, null, 8, ["activity"]),
112
+ _("p", j, p(l(i.activity.createdAt)) + " · " + p(i.activity.changedBy), 1)
113
+ ], 64));
114
+ }
115
+ }), X = /* @__PURE__ */ x({
116
+ __name: "ActivityList",
117
+ props: {
118
+ isLoading: { type: Boolean },
119
+ activities: {},
120
+ onNext: { type: Function }
121
+ },
122
+ setup(c) {
123
+ const i = c, l = $(), o = w(() => !i.isLoading && i.activities.length === 0);
124
+ async function n() {
125
+ await i.onNext();
126
+ }
127
+ return (b, e) => (t(), r(T, {
128
+ "on-next": n,
129
+ class: "h-full"
130
+ }, {
131
+ default: m(() => [
132
+ i.activities.length > 0 ? (t(), r(s(D), {
133
+ key: 0,
134
+ size: "md"
135
+ }, {
136
+ default: m(() => [
137
+ (t(!0), a(y, null, f(c.activities, (v, I) => (t(), r(s(L), {
138
+ key: JSON.stringify(v),
139
+ icon: s(N),
140
+ "is-last": I === c.activities.length - 1
141
+ }, {
142
+ default: m(() => [
143
+ d(q, { activity: v }, null, 8, ["activity"])
144
+ ]),
145
+ _: 2
146
+ }, 1032, ["icon", "is-last"]))), 128))
147
+ ]),
148
+ _: 1
149
+ })) : u("", !0),
150
+ o.value ? (t(), r(A, {
151
+ key: 1,
152
+ title: s(l).t("wise_crm.info_dialog.activity.empty_state.title"),
153
+ description: s(l).t("wise_crm.info_dialog.activity.empty_state.description"),
154
+ icon: s(U)
155
+ }, null, 8, ["title", "description", "icon"])) : u("", !0)
156
+ ]),
157
+ _: 1
158
+ }));
159
+ }
160
+ });
161
+ export {
162
+ X as _
163
+ };
@@ -0,0 +1,207 @@
1
+ import { defineComponent as f, computed as d, openBlock as u, createBlock as i, unref as n, ref as S, withCtx as b, createCommentVNode as v, createElementBlock as U, Fragment as I, renderList as C } from "vue";
2
+ import { useRouteParams as w } from "@vueuse/router";
3
+ import { useOverlay as A, UIBadge as D } from "@wisemen/vue-core-design-system";
4
+ import { B as $, u as V, a as E, y as Q, b as L, c as P, d as M, A as N, V as O } from "./index-BocNglY-.js";
5
+ import { useI18n as T } from "vue-i18n";
6
+ import { N as B, _ as q, u as F, a as K, b as R, c as j, d as z, e as G } from "./CrmDetailHeaderBadge.vue_vue_type_script_setup_true_lang-zlIXsu4c.js";
7
+ import { useKeysetInfiniteQuery as h, useMutation as H } from "@wisemen/vue-core-api-utils";
8
+ import { _ as J } from "./ActivityList.vue_vue_type_script_setup_true_lang-COJyIp2U.js";
9
+ import { bs as _ } from "./uuid.util-DUuuAgdg.js";
10
+ function W(t) {
11
+ return h("businessActivityIndex", {
12
+ queryFn: (s) => $.getActivity(t.value, s.key)
13
+ });
14
+ }
15
+ const X = /* @__PURE__ */ f({
16
+ __name: "BusinessDetailSidebarActivityContent",
17
+ props: {
18
+ business: {}
19
+ },
20
+ setup(t) {
21
+ const s = t, r = d(() => s.business.uuid), a = W(r), c = d(() => a.result.value.isOk() ? a.result.value.getValue().data : []);
22
+ async function l() {
23
+ await a.fetchNextPage();
24
+ }
25
+ return (e, o) => (u(), i(J, {
26
+ "on-next": l,
27
+ "is-loading": n(a).isLoading.value,
28
+ activities: c.value
29
+ }, null, 8, ["is-loading", "activities"]));
30
+ }
31
+ });
32
+ function Y() {
33
+ return H({
34
+ queryFn: async ({
35
+ body: t,
36
+ params: s
37
+ }) => await B.create(t, {
38
+ businessUuid: s.businessUuid
39
+ }),
40
+ queryKeysToInvalidate: {
41
+ noteBusinessIndex: {}
42
+ }
43
+ });
44
+ }
45
+ function Z(t, s) {
46
+ return h("noteBusinessIndex", {
47
+ params: {
48
+ params: s?.params
49
+ },
50
+ queryFn: (r) => B.getBusinessNotes({
51
+ pagination: r
52
+ }, t.value)
53
+ });
54
+ }
55
+ const ee = /* @__PURE__ */ f({
56
+ __name: "BusinessDetailSidebarNotesContent",
57
+ props: {
58
+ business: {}
59
+ },
60
+ setup(t) {
61
+ const s = t, a = A().create(q), c = V(), l = Y(), e = F(), o = Z(
62
+ d(() => s.business.uuid)
63
+ ), g = d(() => o.result.value.isOk() ? o.result.value.getValue().data : []);
64
+ async function x(m) {
65
+ await l.execute({
66
+ body: m,
67
+ params: {
68
+ businessUuid: s.business.uuid
69
+ }
70
+ });
71
+ }
72
+ async function p(m) {
73
+ try {
74
+ await e.execute({
75
+ params: {
76
+ noteUuid: m
77
+ }
78
+ });
79
+ } catch (y) {
80
+ c.show(y);
81
+ }
82
+ }
83
+ function k(m) {
84
+ a.open({
85
+ note: m
86
+ });
87
+ }
88
+ return (m, y) => (u(), i(K, {
89
+ "is-loading": n(o).isLoading.value,
90
+ notes: g.value,
91
+ "on-submit": x,
92
+ "has-next-page": n(o).hasNextPage.value,
93
+ onNext: y[0] || (y[0] = (te) => n(o).fetchNextPage()),
94
+ onDelete: p,
95
+ onUpdate: k
96
+ }, null, 8, ["is-loading", "notes", "has-next-page"]));
97
+ }
98
+ }), se = /* @__PURE__ */ f({
99
+ __name: "BusinessActivityNotesPane",
100
+ props: {
101
+ business: {}
102
+ },
103
+ setup(t) {
104
+ const s = t, r = T(), a = S(
105
+ "activity"
106
+ /* ACTIVITY */
107
+ ), c = d(() => [
108
+ {
109
+ icon: E,
110
+ label: r.t("wise_crm.shared.activity"),
111
+ value: "activity"
112
+ /* ACTIVITY */
113
+ },
114
+ {
115
+ icon: Q,
116
+ label: r.t("wise_crm.shared.notes"),
117
+ value: "notes"
118
+ /* NOTES */
119
+ }
120
+ ]);
121
+ return (l, e) => (u(), i(R, {
122
+ modelValue: a.value,
123
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => a.value = o),
124
+ tabs: c.value
125
+ }, {
126
+ default: b(() => [
127
+ a.value === "activity" ? (u(), i(X, {
128
+ key: 0,
129
+ business: s.business
130
+ }, null, 8, ["business"])) : v("", !0),
131
+ a.value === "notes" ? (u(), i(ee, {
132
+ key: 1,
133
+ business: s.business
134
+ }, null, 8, ["business"])) : v("", !0)
135
+ ]),
136
+ _: 1
137
+ }, 8, ["modelValue", "tabs"]));
138
+ }
139
+ }), me = /* @__PURE__ */ f({
140
+ __name: "BusinessDetailView",
141
+ props: {
142
+ tabs: {}
143
+ },
144
+ setup(t) {
145
+ const s = t, r = L(), a = P(), c = w("businessUuid"), l = M(
146
+ d(() => c.value)
147
+ ), e = d(() => l.result.value.isOk() ? l.result.value.getValue() : null), o = d(
148
+ () => a.getOptions().business?.headerBadges ?? []
149
+ );
150
+ return (g, x) => (u(), i(j, {
151
+ key: n(c),
152
+ tabs: s.tabs,
153
+ "entity-type": n(_).BUSINESS,
154
+ "created-at": e.value?.createdAt ?? null,
155
+ "last-activity-at": e.value?.updatedAt ?? null
156
+ }, {
157
+ header: b(() => [
158
+ n(l).isLoading.value ? (u(), i(N, {
159
+ key: 0,
160
+ class: "h-24 w-full"
161
+ })) : e.value ? (u(), i(z, {
162
+ key: 1,
163
+ "entity-type": n(_).BUSINESS,
164
+ "entity-label": n(r).getEntityConfig(n(_).BUSINESS)?.name ?? null,
165
+ name: e.value.name,
166
+ identifier: null,
167
+ status: null,
168
+ owner: null,
169
+ "created-at": e.value.createdAt,
170
+ address: e.value.address,
171
+ email: e.value.email,
172
+ "mobile-phone": e.value.mobilePhone,
173
+ phone: e.value.phone
174
+ }, {
175
+ badges: b(() => [
176
+ e.value.vatNumber !== null ? (u(), i(n(D), {
177
+ key: 0,
178
+ label: n(O).format(e.value.vatNumber),
179
+ variant: "outline",
180
+ color: "gray"
181
+ }, null, 8, ["label"])) : v("", !0),
182
+ (u(!0), U(I, null, C(o.value, (p) => (u(), i(G, {
183
+ key: p.key,
184
+ badge: p,
185
+ uuid: e.value.uuid,
186
+ entity: "business"
187
+ }, null, 8, ["badge", "uuid"]))), 128))
188
+ ]),
189
+ _: 1
190
+ }, 8, ["entity-type", "entity-label", "name", "created-at", "address", "email", "mobile-phone", "phone"])) : v("", !0)
191
+ ]),
192
+ sidebar: b(() => [
193
+ n(l).isLoading.value ? (u(), i(N, {
194
+ key: 0,
195
+ class: "h-full"
196
+ })) : e.value ? (u(), i(se, {
197
+ key: 1,
198
+ business: e.value
199
+ }, null, 8, ["business"])) : v("", !0)
200
+ ]),
201
+ _: 1
202
+ }, 8, ["tabs", "entity-type", "created-at", "last-activity-at"]));
203
+ }
204
+ });
205
+ export {
206
+ me as default
207
+ };