@grapadigital/shared-app-modules 0.0.181 → 0.0.183

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.
@@ -1,24 +1,28 @@
1
- import { l as x, V as v, c, $ as C, B as f, aI as z, aJ as I, aK as M, bf as F, ac as H, ad as _, ah as w, ag as L, ae as j, ai as A } from "./chuncks/switch.BF6I8Lqo.js";
2
- import { s as Ne, t as ve, x as Ce, K as ze, y as Ie, z as Me, F as Te, D as Se, E as Fe, G as He, H as _e, J as Le, r as je, u as Ae, L as De, M as $e, m as Pe, n as Ee, o as Be, p as Re, q as qe, N as Oe, v as Ke, w as Ve, O as Xe, X as Je, Y as Ye } from "./chuncks/youtube-icon.component.DBqPyuqe.js";
3
- import { jsx as e, jsxs as o, Fragment as D } from "react/jsx-runtime";
4
- import { useState as $, useRef as P, useEffect as E } from "react";
5
- import { parseISO as k, differenceInCalendarDays as B, format as R } from "date-fns";
6
- import { c as q, T as O, a as K, b as V, S as u } from "./chuncks/tooltip.BR6kaw4f.js";
7
- const X = [
1
+ import { aZ as p, w as S, c, F as z, B as k, aq as _, ar as M, as as I, bf as H, W as L, X as D, $ as N, _ as $, Y as j, a0 as B } from "./chuncks/switch.D4GUsewk.js";
2
+ import { jsx as e, jsxs as d, Fragment as T } from "react/jsx-runtime";
3
+ import { QueryErrorResetBoundary as O, useQuery as P } from "@tanstack/react-query";
4
+ import { Suspense as q, useState as F, useRef as A, useEffect as R, useMemo as K } from "react";
5
+ import { n as U, o as X, M as Q, p as V } from "./chuncks/youtube-icon.component.Dasmq5T5.js";
6
+ import { w as Ve, x as Ge, E as We, Q as Ye, G as Ze, H as Je, F as et, J as tt, K as nt, L as at, N as rt, O as st, v as it, y as lt, R as ot, U as dt, q as ct, r as gt, s as ut, t as xt, u as mt, V as bt, z as ht, D as pt, W as ft, X as yt, Y as wt } from "./chuncks/youtube-icon.component.Dasmq5T5.js";
7
+ import { S as w, c as G, T as W, a as Y, b as Z, B as J } from "./chuncks/badge.Cur4Mrd7.js";
8
+ import { parseISO as v, differenceInCalendarDays as ee, format as te } from "date-fns";
9
+ import { a as ne, u as ae } from "./chuncks/use-shared-app-modules.hook.jCQwZaT8.js";
10
+ import "./chuncks/shared-app-modules.provider.DRJ7n4Cj.js";
11
+ const re = [
8
12
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
9
13
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
10
14
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
11
- ], J = x("circle-alert", X);
12
- const Y = [
15
+ ], se = p("circle-alert", re);
16
+ const ie = [
13
17
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
14
18
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
15
19
  ["path", { d: "M12 17h.01", key: "p32p05" }]
16
- ], G = x("circle-question-mark", Y);
17
- const Q = [
20
+ ], le = p("circle-question-mark", ie);
21
+ const oe = [
18
22
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
19
23
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
20
- ], W = x("copy", Q);
21
- const U = [
24
+ ], de = p("copy", oe);
25
+ const ce = [
22
26
  [
23
27
  "path",
24
28
  {
@@ -30,14 +34,14 @@ const U = [
30
34
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
31
35
  ["path", { d: "M16 13H8", key: "t4e002" }],
32
36
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
33
- ], Z = x("file-text", U);
34
- const ee = [
37
+ ], ge = p("file-text", ce);
38
+ const ue = [
35
39
  ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
36
40
  ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
37
41
  ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
38
42
  ["path", { d: "M8 16H3v5", key: "1cv678" }]
39
- ], te = x("refresh-cw", ee);
40
- const ae = [
43
+ ], xe = p("refresh-cw", ue);
44
+ const me = [
41
45
  [
42
46
  "path",
43
47
  {
@@ -47,44 +51,61 @@ const ae = [
47
51
  ],
48
52
  ["path", { d: "M12 9v4", key: "juzpu7" }],
49
53
  ["path", { d: "M12 17h.01", key: "p32p05" }]
50
- ], re = x("triangle-alert", ae);
51
- function ge({
52
- icon: r = re,
53
- title: a,
54
- description: n,
55
- onRetry: l,
56
- tip: s,
57
- className: t,
58
- ...i
54
+ ], be = p("triangle-alert", me);
55
+ function he({
56
+ icon: a = be,
57
+ title: t = "Algo deu errado",
58
+ description: r = "Não foi possível concluir esta operação no momento. Tente novamente em alguns instantes. Se o problema persistir, entre em contato com o suporte.",
59
+ onRetry: s,
60
+ tip: i,
61
+ className: n,
62
+ ...l
59
63
  }) {
60
- return /* @__PURE__ */ e(v, { className: c(t), ...i, children: /* @__PURE__ */ o(C, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
61
- /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(r, { "aria-hidden": "true", className: "text-destructive/60 size-16" }) }),
62
- /* @__PURE__ */ e("h3", { className: "text-foreground mb-2 text-lg font-semibold", children: a }),
63
- /* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: n }),
64
- l && /* @__PURE__ */ o(f, { onClick: l, variant: "outline", className: "mt-6", children: [
65
- /* @__PURE__ */ e(te, {}),
64
+ return /* @__PURE__ */ e(S, { className: c(n), ...l, children: /* @__PURE__ */ d(z, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
65
+ /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(a, { "aria-hidden": "true", className: "text-destructive/60 size-16" }) }),
66
+ /* @__PURE__ */ e("h3", { className: "text-foreground mb-2 text-lg font-semibold", children: t }),
67
+ /* @__PURE__ */ e("p", { className: "text-muted-foreground max-w-md text-sm leading-relaxed", children: r }),
68
+ s && /* @__PURE__ */ d(k, { onClick: s, variant: "outline", className: "mt-6", children: [
69
+ /* @__PURE__ */ e(xe, {}),
66
70
  "Tentar novamente"
67
71
  ] }),
68
- s && /* @__PURE__ */ e("div", { className: "bg-destructive/5 border-destructive/20 mt-6 rounded-lg border border-dashed px-4 py-2", children: /* @__PURE__ */ e("p", { className: "text-muted-foreground text-xs", children: s }) })
72
+ i && /* @__PURE__ */ e("div", { className: "bg-destructive/5 border-destructive/20 mt-6 rounded-lg border border-dashed px-4 py-2", children: /* @__PURE__ */ e("p", { className: "text-muted-foreground text-xs", children: i }) })
69
73
  ] }) });
70
74
  }
71
- function xe({
72
- content: r,
73
- align: a,
74
- asChild: n,
75
- className: l,
76
- openDelay: s = 0,
77
- closeDelay: t = 0,
78
- children: i,
79
- disabled: d = !1,
80
- ...b
75
+ function Ee({
76
+ suspenseFallback: a = pe,
77
+ errorFallback: t = he,
78
+ children: r
79
+ }) {
80
+ return /* @__PURE__ */ e(q, { fallback: /* @__PURE__ */ e(a, {}), children: /* @__PURE__ */ e(O, { children: ({ reset: s }) => /* @__PURE__ */ e(
81
+ U,
82
+ {
83
+ onReset: s,
84
+ fallbackRender: ({ resetErrorBoundary: i, error: n }) => /* @__PURE__ */ e(t, { error: n, onRetry: i }),
85
+ children: r
86
+ }
87
+ ) }) });
88
+ }
89
+ function pe() {
90
+ return /* @__PURE__ */ e(w, { className: "h-[13.75625rem]" });
91
+ }
92
+ function He({
93
+ content: a,
94
+ align: t,
95
+ asChild: r,
96
+ className: s,
97
+ openDelay: i = 0,
98
+ closeDelay: n = 0,
99
+ children: l,
100
+ disabled: o = !1,
101
+ ...x
81
102
  }) {
82
- return /* @__PURE__ */ e(D, { children: d === !0 ? i : /* @__PURE__ */ o(z, { openDelay: s, closeDelay: t, ...b, children: [
83
- /* @__PURE__ */ e(I, { asChild: n, children: i }),
84
- /* @__PURE__ */ e(M, { align: a, className: l, children: r })
103
+ return /* @__PURE__ */ e(T, { children: o === !0 ? l : /* @__PURE__ */ d(_, { openDelay: i, closeDelay: n, ...x, children: [
104
+ /* @__PURE__ */ e(M, { asChild: r, children: l }),
105
+ /* @__PURE__ */ e(I, { align: t, className: s, children: a })
85
106
  ] }) });
86
107
  }
87
- const ne = {
108
+ const fe = {
88
109
  red: { bg: "bg-red-50", text: "text-red-600" },
89
110
  orange: { bg: "bg-orange-50", text: "text-orange-600" },
90
111
  amber: { bg: "bg-amber-50", text: "text-amber-600" },
@@ -107,7 +128,7 @@ const ne = {
107
128
  zinc: { bg: "bg-zinc-200", text: "text-zinc-800" },
108
129
  neutral: { bg: "bg-neutral-200", text: "text-neutral-800" },
109
130
  stone: { bg: "bg-stone-200", text: "text-stone-800" }
110
- }, le = {
131
+ }, ye = {
111
132
  red: { bg: "bg-red-500", text: "text-white" },
112
133
  orange: { bg: "bg-orange-500", text: "text-white" },
113
134
  amber: { bg: "bg-amber-500", text: "text-white" },
@@ -131,265 +152,387 @@ const ne = {
131
152
  neutral: { bg: "bg-neutral-500", text: "text-white" },
132
153
  stone: { bg: "bg-stone-500", text: "text-white" },
133
154
  black: { bg: "bg-black", text: "text-white" }
134
- }, N = {
155
+ }, C = {
135
156
  xs: "size-3",
136
157
  sm: "size-4",
137
158
  md: "size-5",
138
159
  lg: "size-6",
139
160
  xl: "size-7"
140
161
  };
141
- function be({
142
- size: r,
143
- color: a,
144
- className: n,
145
- icon: l,
146
- filled: s
162
+ function Le({
163
+ size: a,
164
+ color: t,
165
+ className: r,
166
+ icon: s,
167
+ filled: i
147
168
  }) {
148
- const t = s ? le[a] : ne[a], i = r ? N[r] : N.md;
149
- return /* @__PURE__ */ e("div", { className: c("w-fit p-2 rounded-lg", t?.bg, n), children: /* @__PURE__ */ e(l, { className: c(i, t?.text) }) });
169
+ const n = i ? ye[t] : fe[t], l = a ? C[a] : C.md;
170
+ return /* @__PURE__ */ e("div", { className: c("w-fit p-2 rounded-lg", n?.bg, r), children: /* @__PURE__ */ e(s, { className: c(l, n?.text) }) });
150
171
  }
151
- function me({ className: r, ...a }) {
152
- return /* @__PURE__ */ e("div", { className: c("divide-y", r), ...a });
172
+ function De({ className: a, ...t }) {
173
+ return /* @__PURE__ */ e("div", { className: c("divide-y", a), ...t });
153
174
  }
154
- function he({
155
- label: r,
156
- value: a,
157
- tooltip: n,
158
- highlight: l = !1,
159
- negative: s = !1,
160
- positive: t = !1,
161
- isPercentage: i = !1,
162
- isDate: d = !1,
163
- isText: b = !1,
164
- isInvoiced: p = !1,
165
- hasCopyButton: m = !1,
166
- enableHoverableContent: T = !1,
167
- handleCopy: y
175
+ function $e({
176
+ label: a,
177
+ value: t,
178
+ tooltip: r,
179
+ highlight: s = !1,
180
+ negative: i = !1,
181
+ positive: n = !1,
182
+ isPercentage: l = !1,
183
+ isDate: o = !1,
184
+ isText: x = !1,
185
+ isInvoiced: f = !1,
186
+ hasCopyButton: b = !1,
187
+ enableHoverableContent: y = !1,
188
+ handleCopy: h
168
189
  }) {
169
- let g = "";
170
- if (d && typeof a == "string" && !p && l) {
171
- const S = k(a), h = B(S, /* @__PURE__ */ new Date());
172
- h > 15 ? g = "bg-yellow-100 font-bold" : h > 7 ? g = "bg-yellow-300 font-bold" : h >= 0 ? g = "bg-red-300 font-bold" : g = "bg-red-500 text-white font-bold";
173
- } else l && (g = "bg-[#ffe0b2] font-bold");
174
- return /* @__PURE__ */ e("div", { className: c("px-2 py-1 text-sm", g), children: /* @__PURE__ */ o(z, { openDelay: 0, closeDelay: 0, children: [
175
- /* @__PURE__ */ e(I, { children: /* @__PURE__ */ o("div", { className: "flex justify-between", children: [
176
- /* @__PURE__ */ o(
190
+ let m = "";
191
+ if (o && typeof t == "string" && !f && s) {
192
+ const u = v(t), g = ee(u, /* @__PURE__ */ new Date());
193
+ g > 15 ? m = "bg-yellow-100 font-bold" : g > 7 ? m = "bg-yellow-300 font-bold" : g >= 0 ? m = "bg-red-300 font-bold" : m = "bg-red-500 text-white font-bold";
194
+ } else s && (m = "bg-[#ffe0b2] font-bold");
195
+ return /* @__PURE__ */ e("div", { className: c("px-2 py-1 text-sm", m), children: /* @__PURE__ */ d(_, { openDelay: 0, closeDelay: 0, children: [
196
+ /* @__PURE__ */ e(M, { children: /* @__PURE__ */ d("div", { className: "flex justify-between", children: [
197
+ /* @__PURE__ */ d(
177
198
  "span",
178
199
  {
179
200
  className: c(
180
201
  "flex flex-row gap-1",
181
- s ? "text-red-600" : t ? "text-green-600" : ""
202
+ i ? "text-red-600" : n ? "text-green-600" : ""
182
203
  ),
183
204
  children: [
184
- r,
205
+ a,
185
206
  " ",
186
- /* @__PURE__ */ e(J, { className: "size-3.5" })
207
+ /* @__PURE__ */ e(se, { className: "size-3.5" })
187
208
  ]
188
209
  }
189
210
  ),
190
- /* @__PURE__ */ o(
211
+ /* @__PURE__ */ d(
191
212
  "span",
192
213
  {
193
214
  className: c(
194
215
  "flex flex-row justify-end gap-2 text-right",
195
- s ? "text-red-600" : t ? "text-green-600" : ""
216
+ i ? "text-red-600" : n ? "text-green-600" : ""
196
217
  ),
197
218
  children: [
198
- i && typeof a == "number" ? `${a.toFixed(2)}%` : d && typeof a == "string" ? R(k(a), "dd/MM/yyyy") : b && typeof a == "string" ? a : `R$ ${a.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`,
199
- m && y && /* @__PURE__ */ e(W, { size: 15, onClick: () => y(a) })
219
+ l && typeof t == "number" ? `${t.toFixed(2)}%` : o && typeof t == "string" ? te(v(t), "dd/MM/yyyy") : x && typeof t == "string" ? t : `R$ ${t.toLocaleString("pt-BR", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`,
220
+ b && h && /* @__PURE__ */ e(de, { size: 15, onClick: () => h(t) })
200
221
  ]
201
222
  }
202
223
  )
203
224
  ] }) }),
204
225
  /* @__PURE__ */ e(
205
- M,
226
+ I,
206
227
  {
207
228
  align: "start",
208
- className: c(!T && "pointer-events-none"),
209
- children: /* @__PURE__ */ o("div", { className: "space-y-0.5", children: [
210
- /* @__PURE__ */ e("div", { className: "font-medium", children: r }),
211
- /* @__PURE__ */ e("div", { className: "font-normal opacity-80", children: n })
229
+ className: c(!y && "pointer-events-none"),
230
+ children: /* @__PURE__ */ d("div", { className: "space-y-0.5", children: [
231
+ /* @__PURE__ */ e("div", { className: "font-medium", children: a }),
232
+ /* @__PURE__ */ e("div", { className: "font-normal opacity-80", children: r })
212
233
  ] })
213
234
  }
214
235
  )
215
236
  ] }) });
216
237
  }
217
- function ue({
218
- icon: r = Z,
219
- title: a,
220
- description: n,
221
- tip: l,
222
- className: s,
223
- ...t
238
+ function je({
239
+ icon: a = ge,
240
+ title: t,
241
+ description: r,
242
+ tip: s,
243
+ className: i,
244
+ ...n
224
245
  }) {
225
- return /* @__PURE__ */ e(v, { className: c(s), ...t, children: /* @__PURE__ */ o(C, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
246
+ return /* @__PURE__ */ e(S, { className: c(i), ...n, children: /* @__PURE__ */ d(z, { className: "flex flex-col items-center justify-center px-6 py-12 text-center", children: [
226
247
  /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(
227
- r,
248
+ a,
228
249
  {
229
250
  "aria-hidden": "true",
230
251
  className: "size-16 text-muted-foreground/40"
231
252
  }
232
253
  ) }),
233
- /* @__PURE__ */ e("h3", { className: "mb-2 text-lg font-semibold text-foreground", children: a }),
234
- /* @__PURE__ */ e("p", { className: "max-w-md text-sm leading-relaxed text-muted-foreground", children: n }),
235
- l && /* @__PURE__ */ e("div", { className: "mt-6 rounded-lg border border-dashed border-muted-foreground/20 bg-muted/50 px-4 py-2", children: /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: l }) })
254
+ /* @__PURE__ */ e("h3", { className: "mb-2 text-lg font-semibold text-foreground", children: t }),
255
+ /* @__PURE__ */ e("p", { className: "max-w-md text-sm leading-relaxed text-muted-foreground", children: r }),
256
+ s && /* @__PURE__ */ e("div", { className: "mt-6 rounded-lg border border-dashed border-muted-foreground/20 bg-muted/50 px-4 py-2", children: /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: s }) })
236
257
  ] }) });
237
258
  }
238
- function fe({
239
- actions: r,
240
- icon: a = G
259
+ function Be({
260
+ actions: a,
261
+ icon: t = le
241
262
  }) {
242
- const [n, l] = $(!1), s = P(null);
243
- return E(() => {
244
- if (!n) return;
245
- const t = (d) => {
246
- s.current?.contains(d.target) || l(!1);
247
- }, i = (d) => {
248
- d.key === "Escape" && l(!1);
263
+ const [r, s] = F(!1), i = A(null);
264
+ return R(() => {
265
+ if (!r) return;
266
+ const n = (o) => {
267
+ i.current?.contains(o.target) || s(!1);
268
+ }, l = (o) => {
269
+ o.key === "Escape" && s(!1);
249
270
  };
250
- return document.addEventListener("mousedown", t), document.addEventListener("keydown", i), () => {
251
- document.removeEventListener("mousedown", t), document.removeEventListener("keydown", i);
271
+ return document.addEventListener("mousedown", n), document.addEventListener("keydown", l), () => {
272
+ document.removeEventListener("mousedown", n), document.removeEventListener("keydown", l);
252
273
  };
253
- }, [n]), /* @__PURE__ */ e(q, { children: /* @__PURE__ */ o(
274
+ }, [r]), /* @__PURE__ */ e(G, { children: /* @__PURE__ */ d(
254
275
  "div",
255
276
  {
256
- ref: s,
277
+ ref: i,
257
278
  className: "fixed bottom-6 right-6 z-50 flex flex-col items-end gap-3",
258
279
  children: [
259
- /* @__PURE__ */ e("div", { className: "flex flex-col items-end gap-3", children: r.map((t, i) => /* @__PURE__ */ e(
280
+ /* @__PURE__ */ e("div", { className: "flex flex-col items-end gap-3", children: a.map((n, l) => /* @__PURE__ */ e(
260
281
  "div",
261
282
  {
262
283
  className: c(
263
284
  "transition-all duration-200 ease-out",
264
- n ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
285
+ r ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0"
265
286
  ),
266
- style: { transitionDelay: n ? `${i * 30}ms` : "0ms" },
267
- children: /* @__PURE__ */ o(O, { children: [
268
- /* @__PURE__ */ e(K, { asChild: !0, children: /* @__PURE__ */ e(
269
- f,
287
+ style: { transitionDelay: r ? `${l * 30}ms` : "0ms" },
288
+ children: /* @__PURE__ */ d(W, { children: [
289
+ /* @__PURE__ */ e(Y, { asChild: !0, children: /* @__PURE__ */ e(
290
+ k,
270
291
  {
271
292
  size: "icon",
272
293
  variant: "outline",
273
- disabled: t.disabled,
274
- "aria-disabled": t.disabled,
294
+ disabled: n.disabled,
295
+ "aria-disabled": n.disabled,
275
296
  className: c(
276
297
  "size-11 rounded-full shadow-md",
277
- t.disabled && "opacity-50"
298
+ n.disabled && "opacity-50"
278
299
  ),
279
300
  onClick: () => {
280
- t.disabled || (t.onClick(), l(!1));
301
+ n.disabled || (n.onClick(), s(!1));
281
302
  },
282
- children: /* @__PURE__ */ e(t.icon, { className: "size-5" })
303
+ children: /* @__PURE__ */ e(n.icon, { className: "size-5" })
283
304
  }
284
305
  ) }),
285
- /* @__PURE__ */ e(V, { side: "left", children: t.label })
306
+ /* @__PURE__ */ e(Z, { side: "left", children: n.label })
286
307
  ] })
287
308
  },
288
- t.label
309
+ n.label
289
310
  )) }),
290
311
  /* @__PURE__ */ e(
291
- f,
312
+ k,
292
313
  {
293
314
  size: "icon",
294
315
  variant: "outline",
295
316
  className: "size-11 rounded-full shadow-md",
296
- "aria-label": n ? "Fechar menu de ajuda" : "Abrir menu de ajuda",
297
- "aria-expanded": n,
298
- onClick: () => l((t) => !t),
299
- children: n ? /* @__PURE__ */ e(F, { className: "size-5" }) : /* @__PURE__ */ e(a, { className: "size-5" })
317
+ "aria-label": r ? "Fechar menu de ajuda" : "Abrir menu de ajuda",
318
+ "aria-expanded": r,
319
+ onClick: () => s((n) => !n),
320
+ children: r ? /* @__PURE__ */ e(H, { className: "size-5" }) : /* @__PURE__ */ e(t, { className: "size-5" })
300
321
  }
301
322
  )
302
323
  ]
303
324
  }
304
325
  ) });
305
326
  }
306
- function pe({
307
- columns: r = 9,
308
- rows: a = 20,
309
- hasActions: n = !1,
310
- actionsCount: l = 1
327
+ function Oe({
328
+ columns: a = 9,
329
+ rows: t = 20,
330
+ hasActions: r = !1,
331
+ actionsCount: s = 1
311
332
  }) {
312
- return /* @__PURE__ */ o(H, { children: [
313
- /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(w, { children: Array.from({ length: r }).map((s, t) => {
314
- const i = n && t === r - 1;
333
+ return /* @__PURE__ */ d(L, { children: [
334
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(N, { children: Array.from({ length: a }).map((i, n) => {
335
+ const l = r && n === a - 1;
315
336
  return /* @__PURE__ */ e(
316
- L,
337
+ $,
317
338
  {
318
- className: i ? "w-0 text-right" : "",
339
+ className: l ? "w-0 text-right" : "",
319
340
  children: /* @__PURE__ */ e(
320
- u,
341
+ w,
321
342
  {
322
- className: i ? "ml-auto h-4 w-8" : "h-4 w-[60%]"
343
+ className: l ? "ml-auto h-4 w-8" : "h-4 w-[60%]"
323
344
  }
324
345
  )
325
346
  },
326
- t
347
+ n
327
348
  );
328
349
  }) }) }),
329
- /* @__PURE__ */ e(j, { children: Array.from({ length: a }).map((s, t) => /* @__PURE__ */ e(w, { className: "h-[3.05rem]", children: Array.from({ length: r }).map((i, d) => {
330
- const b = n && d === r - 1;
331
- return /* @__PURE__ */ e(A, { children: b ? /* @__PURE__ */ e("div", { className: "flex gap-2", children: Array.from({ length: l }).map((p, m) => /* @__PURE__ */ e(u, { className: "ml-auto size-8" }, m)) }) : /* @__PURE__ */ e(u, { className: "h-4 w-full" }) }, d);
332
- }) }, t)) })
350
+ /* @__PURE__ */ e(j, { children: Array.from({ length: t }).map((i, n) => /* @__PURE__ */ e(N, { className: "h-[3.05rem]", children: Array.from({ length: a }).map((l, o) => {
351
+ const x = r && o === a - 1;
352
+ return /* @__PURE__ */ e(B, { children: x ? /* @__PURE__ */ e("div", { className: "flex gap-2", children: Array.from({ length: s }).map((f, b) => /* @__PURE__ */ e(w, { className: "ml-auto size-8" }, b)) }) : /* @__PURE__ */ e(w, { className: "h-4 w-full" }) }, o);
353
+ }) }, n)) })
333
354
  ] });
334
355
  }
335
- function ye({
336
- size: r = 24,
337
- color: a = "currentColor",
338
- ...n
356
+ const we = "@[__display__](__id__)", E = /@\[([^\]]+)\]\(([^)]+)\)/g;
357
+ function Pe(a) {
358
+ const t = [], r = new RegExp(E);
359
+ let s;
360
+ for (; (s = r.exec(a)) !== null; )
361
+ t.push({ display: s[1], id: s[2] });
362
+ return t;
363
+ }
364
+ const ke = async ({
365
+ organizationId: a,
366
+ search: t,
367
+ environment: r
368
+ }) => (await X(r).get(`/organizations/${a}/users`, {
369
+ params: { q: t }
370
+ })).data;
371
+ function Ne(a, t) {
372
+ const { environments: r } = ne();
373
+ return P({
374
+ queryKey: ["organization-users", a, t],
375
+ queryFn: () => ke({
376
+ organizationId: a,
377
+ search: t,
378
+ environment: r.VITE_BACKEND_API_ORGANIZATION_URL ?? ""
379
+ }),
380
+ enabled: a.length > 0 && t.length > 0
381
+ });
382
+ }
383
+ const ve = {
384
+ control: {
385
+ fontSize: 14,
386
+ minHeight: 36
387
+ },
388
+ input: {
389
+ padding: "8px 12px",
390
+ border: "1px solid var(--border, #d4d4d8)",
391
+ borderRadius: 6,
392
+ outline: "none"
393
+ },
394
+ highlighter: {
395
+ padding: "8px 12px",
396
+ border: "1px solid transparent"
397
+ },
398
+ suggestions: {
399
+ list: {
400
+ backgroundColor: "var(--popover, #fff)",
401
+ border: "1px solid var(--border, #d4d4d8)",
402
+ borderRadius: 6,
403
+ fontSize: 14,
404
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.12)",
405
+ overflow: "hidden"
406
+ },
407
+ item: {
408
+ padding: "6px 12px",
409
+ "&focused": {
410
+ backgroundColor: "var(--accent, #f4f4f5)"
411
+ }
412
+ }
413
+ }
414
+ }, Ce = {
415
+ backgroundColor: "var(--accent, #e4e4e7)",
416
+ borderRadius: 4
417
+ };
418
+ function qe({
419
+ value: a,
420
+ onChange: t,
421
+ onBlur: r,
422
+ organizationId: s,
423
+ placeholder: i,
424
+ disabled: n,
425
+ singleLine: l = !0
426
+ }) {
427
+ const [o, x] = F(""), f = ae(o, 200), { data: b } = Ne(s, f), y = A(void 0), h = K(
428
+ () => b?.map((u) => ({ id: u._id, display: u.username })) ?? [],
429
+ [b]
430
+ );
431
+ return R(() => {
432
+ y.current?.(h);
433
+ }, [h]), /* @__PURE__ */ e(
434
+ Q,
435
+ {
436
+ value: a,
437
+ onChange: (u, g) => t(g),
438
+ onBlur: r,
439
+ placeholder: i,
440
+ disabled: n,
441
+ singleLine: l,
442
+ allowSuggestionsAboveCursor: !0,
443
+ style: ve,
444
+ children: /* @__PURE__ */ e(
445
+ V,
446
+ {
447
+ trigger: "@",
448
+ markup: we,
449
+ data: (u, g) => {
450
+ y.current = g, x(u), g(h);
451
+ },
452
+ displayTransform: (u, g) => `@${g}`,
453
+ appendSpaceOnAdd: !0,
454
+ style: Ce
455
+ }
456
+ )
457
+ }
458
+ );
459
+ }
460
+ function Ke({ text: a, className: t }) {
461
+ const r = new RegExp(E), s = [];
462
+ let i = 0, n, l = 0;
463
+ for (; (n = r.exec(a)) !== null; )
464
+ n.index > i && s.push(
465
+ /* @__PURE__ */ e("span", { children: a.slice(i, n.index) }, l++)
466
+ ), s.push(
467
+ /* @__PURE__ */ d(J, { variant: "secondary", className: t, children: [
468
+ "@",
469
+ n[1]
470
+ ] }, l++)
471
+ ), i = n.index + n[0].length;
472
+ return i < a.length && s.push(/* @__PURE__ */ e("span", { children: a.slice(i) }, l++)), /* @__PURE__ */ e(T, { children: s });
473
+ }
474
+ function Ue({
475
+ size: a = 24,
476
+ color: t = "currentColor",
477
+ ...r
339
478
  }) {
340
479
  return /* @__PURE__ */ e(
341
480
  "svg",
342
481
  {
343
482
  xmlns: "http://www.w3.org/2000/svg",
344
- width: r,
345
- height: r,
483
+ width: a,
484
+ height: a,
346
485
  viewBox: "0 0 24 24",
347
486
  fill: "none",
348
- stroke: a,
487
+ stroke: t,
349
488
  "stroke-width": "2",
350
489
  "stroke-linecap": "round",
351
490
  "stroke-linejoin": "round",
352
491
  className: "lucide lucide-twitter-icon lucide-twitter",
353
- ...n,
492
+ ...r,
354
493
  children: /* @__PURE__ */ e("path", { d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" })
355
494
  }
356
495
  );
357
496
  }
358
497
  export {
359
- Ne as CampaignsSelectInput,
360
- ve as ClientSelectInput,
361
- ge as ErrorCard,
362
- Ce as FieldCalendar,
363
- ze as FieldCheckbox,
364
- Ie as FieldClientSelectInput,
365
- Me as FieldInput,
366
- Te as FieldLabelWithAsterisk,
367
- Se as FieldProfileSelectInput,
368
- Fe as FieldSaleSelectInput,
369
- He as FieldSelect,
370
- _e as FieldSwitch,
371
- Le as FieldTextarea,
372
- xe as HoverContent,
373
- be as IconBadge,
374
- je as Image,
375
- Ae as InfluencerSelectInput,
376
- De as InstagramIcon,
377
- $e as LinkedInIcon,
378
- me as List,
379
- he as ListRow,
380
- ue as NotFoundCard,
381
- Pe as PageHeader,
382
- Ee as PageHeaderActions,
383
- Be as PageHeaderContent,
384
- Re as PageHeaderDescription,
385
- qe as PageHeaderTitle,
386
- Oe as PinterestIcon,
387
- Ke as ProfileSelectInput,
388
- Ve as SaleSelectInput,
389
- fe as SpeedDialButton,
390
- pe as TableSkeleton,
391
- Xe as TikTokIcon,
392
- ye as TwitterIcon,
393
- Je as XIcon,
394
- Ye as YoutubeIcon
498
+ Ee as AsyncBoundary,
499
+ Ve as CampaignsSelectInput,
500
+ Ge as ClientSelectInput,
501
+ he as ErrorCard,
502
+ We as FieldCalendar,
503
+ Ye as FieldCheckbox,
504
+ Ze as FieldClientSelectInput,
505
+ Je as FieldInput,
506
+ et as FieldLabelWithAsterisk,
507
+ tt as FieldProfileSelectInput,
508
+ nt as FieldSaleSelectInput,
509
+ at as FieldSelect,
510
+ rt as FieldSwitch,
511
+ st as FieldTextarea,
512
+ He as HoverContent,
513
+ Le as IconBadge,
514
+ it as Image,
515
+ lt as InfluencerSelectInput,
516
+ ot as InstagramIcon,
517
+ dt as LinkedInIcon,
518
+ De as List,
519
+ $e as ListRow,
520
+ qe as MentionInput,
521
+ Ke as MentionText,
522
+ je as NotFoundCard,
523
+ ct as PageHeader,
524
+ gt as PageHeaderActions,
525
+ ut as PageHeaderContent,
526
+ xt as PageHeaderDescription,
527
+ mt as PageHeaderTitle,
528
+ bt as PinterestIcon,
529
+ ht as ProfileSelectInput,
530
+ pt as SaleSelectInput,
531
+ Be as SpeedDialButton,
532
+ Oe as TableSkeleton,
533
+ ft as TikTokIcon,
534
+ Ue as TwitterIcon,
535
+ yt as XIcon,
536
+ wt as YoutubeIcon,
537
+ Pe as parseMentions
395
538
  };