@lokalise/harmony 1.4.0-exp-sidebarComponent.6 → 1.5.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 (27) hide show
  1. package/dist/harmony.cjs +1 -1
  2. package/dist/harmony.css +1 -1
  3. package/dist/harmony.mjs +542 -883
  4. package/dist/types/src/components/Sidebar/Sidebar.d.ts +8 -6
  5. package/dist/types/src/components/Sidebar/Sidebar.stories.d.ts +85 -2
  6. package/dist/types/src/components/Sidebar/Widgets/IconLink/IconLink.d.ts +4 -3
  7. package/dist/types/src/components/Sidebar/Widgets/Menu/Menu.d.ts +7 -2
  8. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.d.ts +1 -1
  9. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileSettingsMenuItem/ProfileSettingsMenuItem.d.ts +2 -1
  10. package/dist/types/src/node.d.ts +2 -0
  11. package/dist/types/tests/mocks/sidebar/profileMenu.d.ts +2 -0
  12. package/package.json +4 -5
  13. package/dist/types/fixtures/sidebar/profileMenu.d.ts +0 -2
  14. package/dist/types/fixtures/sidebar/tasks.d.ts +0 -2
  15. package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +0 -6
  16. package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +0 -7
  17. package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +0 -5
  18. package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +0 -3
  19. package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +0 -2
  20. package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +0 -1
  21. package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +0 -10
  22. package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +0 -2
  23. package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +0 -85
  24. package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +0 -16
  25. package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +0 -23
  26. package/dist/types/src/components/Sidebar/Widgets/index.d.ts +0 -5
  27. package/dist/types/vite.config.d.ts +0 -2
package/dist/harmony.mjs CHANGED
@@ -1,1032 +1,691 @@
1
- import { jsx as o, jsxs as g, Fragment as ht } from "react/jsx-runtime";
2
- import * as M from "react";
3
- import { useRef as pt, useState as E, useCallback as ue, useEffect as me, cloneElement as gt, createContext as Ye, useContext as Ze } from "react";
4
- import { Tooltip as q, Link as j, Menu as he, MenuList as pe, HelpCenterIcon as _t, ConfirmModal as vt, Alert as bt, Tag as we, Button as Ce, MenuItem as W, Spacer as Tt, Loading as yt, Popover as wt, DeprecatedTaskIcon as Ct, CaretUpIcon as kt, UserIcon as Xe } from "@lokalise/louis";
5
- import { format as Qe, parseISO as xt } from "date-fns";
6
- import { toZonedTime as St } from "date-fns-tz";
7
- var z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
8
- function Je(e) {
1
+ import { jsx as i, jsxs as b, Fragment as Be } from "react/jsx-runtime";
2
+ import * as k from "react";
3
+ import { useRef as rn, useState as Me, useCallback as me, useEffect as ie, useContext as an, createContext as on, cloneElement as sn, Fragment as $e, forwardRef as cn } from "react";
4
+ import { Tooltip as ae, Link as Ue, Menu as oe, MenuList as se, CaretUpIcon as ln, UserIcon as De, MenuItem as $, MenuDivider as ze, Tag as un } from "@lokalise/louis";
5
+ import { format as We } from "date-fns";
6
+ import { toZonedTime as dn } from "date-fns-tz";
7
+ var B = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
8
+ function Fe(e) {
9
9
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
10
10
  }
11
- var V, ke;
12
- function ge() {
13
- if (ke) return V;
14
- ke = 1;
15
- function e(t) {
16
- var r = typeof t;
17
- return t != null && (r == "object" || r == "function");
11
+ var D, ge;
12
+ function ce() {
13
+ if (ge) return D;
14
+ ge = 1;
15
+ function e(n) {
16
+ var t = typeof n;
17
+ return n != null && (t == "object" || t == "function");
18
18
  }
19
- return V = e, V;
19
+ return D = e, D;
20
20
  }
21
- var Y, xe;
22
- function It() {
23
- if (xe) return Y;
24
- xe = 1;
25
- var e = typeof z == "object" && z && z.Object === Object && z;
26
- return Y = e, Y;
21
+ var z, he;
22
+ function fn() {
23
+ if (he) return z;
24
+ he = 1;
25
+ var e = typeof B == "object" && B && B.Object === Object && B;
26
+ return z = e, z;
27
27
  }
28
- var Z, Se;
29
- function Ke() {
30
- if (Se) return Z;
31
- Se = 1;
32
- var e = It(), t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
33
- return Z = r, Z;
28
+ var W, pe;
29
+ function He() {
30
+ if (pe) return W;
31
+ pe = 1;
32
+ var e = fn(), n = typeof self == "object" && self && self.Object === Object && self, t = e || n || Function("return this")();
33
+ return W = t, W;
34
34
  }
35
- var X, Ie;
36
- function Et() {
37
- if (Ie) return X;
38
- Ie = 1;
39
- var e = Ke(), t = function() {
35
+ var F, be;
36
+ function mn() {
37
+ if (be) return F;
38
+ be = 1;
39
+ var e = He(), n = function() {
40
40
  return e.Date.now();
41
41
  };
42
- return X = t, X;
42
+ return F = n, F;
43
43
  }
44
- var Q, Ee;
45
- function Nt() {
46
- if (Ee) return Q;
47
- Ee = 1;
44
+ var H, _e;
45
+ function gn() {
46
+ if (_e) return H;
47
+ _e = 1;
48
48
  var e = /\s/;
49
- function t(r) {
50
- for (var n = r.length; n-- && e.test(r.charAt(n)); )
49
+ function n(t) {
50
+ for (var r = t.length; r-- && e.test(t.charAt(r)); )
51
51
  ;
52
- return n;
52
+ return r;
53
53
  }
54
- return Q = t, Q;
54
+ return H = n, H;
55
55
  }
56
- var J, Ne;
57
- function Pt() {
58
- if (Ne) return J;
59
- Ne = 1;
60
- var e = Nt(), t = /^\s+/;
61
- function r(n) {
62
- return n && n.slice(0, e(n) + 1).replace(t, "");
56
+ var G, ve;
57
+ function hn() {
58
+ if (ve) return G;
59
+ ve = 1;
60
+ var e = gn(), n = /^\s+/;
61
+ function t(r) {
62
+ return r && r.slice(0, e(r) + 1).replace(n, "");
63
63
  }
64
- return J = r, J;
64
+ return G = t, G;
65
65
  }
66
- var K, Pe;
67
- function et() {
68
- if (Pe) return K;
69
- Pe = 1;
70
- var e = Ke(), t = e.Symbol;
71
- return K = t, K;
66
+ var V, Te;
67
+ function Ge() {
68
+ if (Te) return V;
69
+ Te = 1;
70
+ var e = He(), n = e.Symbol;
71
+ return V = n, V;
72
72
  }
73
- var ee, Le;
74
- function Lt() {
75
- if (Le) return ee;
76
- Le = 1;
77
- var e = et(), t = Object.prototype, r = t.hasOwnProperty, n = t.toString, i = e ? e.toStringTag : void 0;
78
- function s(a) {
79
- var l = r.call(a, i), d = a[i];
73
+ var Y, we;
74
+ function pn() {
75
+ if (we) return Y;
76
+ we = 1;
77
+ var e = Ge(), n = Object.prototype, t = n.hasOwnProperty, r = n.toString, a = e ? e.toStringTag : void 0;
78
+ function o(c) {
79
+ var l = t.call(c, a), u = c[a];
80
80
  try {
81
- a[i] = void 0;
82
- var c = !0;
81
+ c[a] = void 0;
82
+ var s = !0;
83
83
  } catch {
84
84
  }
85
- var u = n.call(a);
86
- return c && (l ? a[i] = d : delete a[i]), u;
85
+ var d = r.call(c);
86
+ return s && (l ? c[a] = u : delete c[a]), d;
87
87
  }
88
- return ee = s, ee;
88
+ return Y = o, Y;
89
89
  }
90
- var te, Re;
91
- function Rt() {
92
- if (Re) return te;
93
- Re = 1;
94
- var e = Object.prototype, t = e.toString;
95
- function r(n) {
96
- return t.call(n);
90
+ var Z, Ie;
91
+ function bn() {
92
+ if (Ie) return Z;
93
+ Ie = 1;
94
+ var e = Object.prototype, n = e.toString;
95
+ function t(r) {
96
+ return n.call(r);
97
97
  }
98
- return te = r, te;
98
+ return Z = t, Z;
99
99
  }
100
- var ne, je;
101
- function jt() {
102
- if (je) return ne;
103
- je = 1;
104
- var e = et(), t = Lt(), r = Rt(), n = "[object Null]", i = "[object Undefined]", s = e ? e.toStringTag : void 0;
105
- function a(l) {
106
- return l == null ? l === void 0 ? i : n : s && s in Object(l) ? t(l) : r(l);
100
+ var X, ye;
101
+ function _n() {
102
+ if (ye) return X;
103
+ ye = 1;
104
+ var e = Ge(), n = pn(), t = bn(), r = "[object Null]", a = "[object Undefined]", o = e ? e.toStringTag : void 0;
105
+ function c(l) {
106
+ return l == null ? l === void 0 ? a : r : o && o in Object(l) ? n(l) : t(l);
107
107
  }
108
- return ne = a, ne;
108
+ return X = c, X;
109
109
  }
110
- var re, Oe;
111
- function Ot() {
112
- if (Oe) return re;
113
- Oe = 1;
114
- function e(t) {
115
- return t != null && typeof t == "object";
110
+ var J, Ne;
111
+ function vn() {
112
+ if (Ne) return J;
113
+ Ne = 1;
114
+ function e(n) {
115
+ return n != null && typeof n == "object";
116
116
  }
117
- return re = e, re;
117
+ return J = e, J;
118
118
  }
119
- var oe, Ae;
120
- function At() {
121
- if (Ae) return oe;
122
- Ae = 1;
123
- var e = jt(), t = Ot(), r = "[object Symbol]";
124
- function n(i) {
125
- return typeof i == "symbol" || t(i) && e(i) == r;
119
+ var K, Se;
120
+ function Tn() {
121
+ if (Se) return K;
122
+ Se = 1;
123
+ var e = _n(), n = vn(), t = "[object Symbol]";
124
+ function r(a) {
125
+ return typeof a == "symbol" || n(a) && e(a) == t;
126
126
  }
127
- return oe = n, oe;
127
+ return K = r, K;
128
128
  }
129
- var ie, Me;
130
- function Mt() {
131
- if (Me) return ie;
132
- Me = 1;
133
- var e = Pt(), t = ge(), r = At(), n = NaN, i = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, a = /^0o[0-7]+$/i, l = parseInt;
134
- function d(c) {
135
- if (typeof c == "number")
136
- return c;
137
- if (r(c))
138
- return n;
139
- if (t(c)) {
140
- var u = typeof c.valueOf == "function" ? c.valueOf() : c;
141
- c = t(u) ? u + "" : u;
129
+ var Q, Ee;
130
+ function wn() {
131
+ if (Ee) return Q;
132
+ Ee = 1;
133
+ var e = hn(), n = ce(), t = Tn(), r = NaN, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
134
+ function u(s) {
135
+ if (typeof s == "number")
136
+ return s;
137
+ if (t(s))
138
+ return r;
139
+ if (n(s)) {
140
+ var d = typeof s.valueOf == "function" ? s.valueOf() : s;
141
+ s = n(d) ? d + "" : d;
142
142
  }
143
- if (typeof c != "string")
144
- return c === 0 ? c : +c;
145
- c = e(c);
146
- var h = s.test(c);
147
- return h || a.test(c) ? l(c.slice(2), h ? 2 : 8) : i.test(c) ? n : +c;
143
+ if (typeof s != "string")
144
+ return s === 0 ? s : +s;
145
+ s = e(s);
146
+ var h = o.test(s);
147
+ return h || c.test(s) ? l(s.slice(2), h ? 2 : 8) : a.test(s) ? r : +s;
148
148
  }
149
- return ie = d, ie;
149
+ return Q = u, Q;
150
150
  }
151
- var se, qe;
152
- function tt() {
153
- if (qe) return se;
154
- qe = 1;
155
- var e = ge(), t = Et(), r = Mt(), n = "Expected a function", i = Math.max, s = Math.min;
156
- function a(l, d, c) {
157
- var u, h, _, v, f, w, b = 0, p = !1, m = !1, T = !0;
151
+ var ee, Pe;
152
+ function Ve() {
153
+ if (Pe) return ee;
154
+ Pe = 1;
155
+ var e = ce(), n = mn(), t = wn(), r = "Expected a function", a = Math.max, o = Math.min;
156
+ function c(l, u, s) {
157
+ var d, h, v, T, g, w, y = 0, S = !1, m = !1, N = !0;
158
158
  if (typeof l != "function")
159
- throw new TypeError(n);
160
- d = r(d) || 0, e(c) && (p = !!c.leading, m = "maxWait" in c, _ = m ? i(r(c.maxWait) || 0, d) : _, T = "trailing" in c ? !!c.trailing : T);
161
- function k(y) {
162
- var I = u, O = h;
163
- return u = h = void 0, b = y, v = l.apply(O, I), v;
159
+ throw new TypeError(r);
160
+ u = t(u) || 0, e(s) && (S = !!s.leading, m = "maxWait" in s, v = m ? a(t(s.maxWait) || 0, u) : v, N = "trailing" in s ? !!s.trailing : N);
161
+ function _(f) {
162
+ var E = d, R = h;
163
+ return d = h = void 0, y = f, T = l.apply(R, E), T;
164
164
  }
165
- function C(y) {
166
- return b = y, f = setTimeout(U, d), p ? k(y) : v;
165
+ function p(f) {
166
+ return y = f, g = setTimeout(q, u), S ? _(f) : T;
167
167
  }
168
- function $(y) {
169
- var I = y - w, O = y - b, ye = d - I;
170
- return m ? s(ye, _ - O) : ye;
168
+ function A(f) {
169
+ var E = f - w, R = f - y, fe = u - E;
170
+ return m ? o(fe, v - R) : fe;
171
171
  }
172
- function be(y) {
173
- var I = y - w, O = y - b;
174
- return w === void 0 || I >= d || I < 0 || m && O >= _;
172
+ function ue(f) {
173
+ var E = f - w, R = f - y;
174
+ return w === void 0 || E >= u || E < 0 || m && R >= v;
175
175
  }
176
- function U() {
177
- var y = t();
178
- if (be(y))
179
- return Te(y);
180
- f = setTimeout(U, $(y));
176
+ function q() {
177
+ var f = n();
178
+ if (ue(f))
179
+ return de(f);
180
+ g = setTimeout(q, A(f));
181
181
  }
182
- function Te(y) {
183
- return f = void 0, T && u ? k(y) : (u = h = void 0, v);
182
+ function de(f) {
183
+ return g = void 0, N && d ? _(f) : (d = h = void 0, T);
184
184
  }
185
- function ft() {
186
- f !== void 0 && clearTimeout(f), b = 0, u = w = h = f = void 0;
185
+ function nn() {
186
+ g !== void 0 && clearTimeout(g), y = 0, d = w = h = g = void 0;
187
187
  }
188
- function mt() {
189
- return f === void 0 ? v : Te(t());
188
+ function tn() {
189
+ return g === void 0 ? T : de(n());
190
190
  }
191
- function G() {
192
- var y = t(), I = be(y);
193
- if (u = arguments, h = this, w = y, I) {
194
- if (f === void 0)
195
- return C(w);
191
+ function U() {
192
+ var f = n(), E = ue(f);
193
+ if (d = arguments, h = this, w = f, E) {
194
+ if (g === void 0)
195
+ return p(w);
196
196
  if (m)
197
- return clearTimeout(f), f = setTimeout(U, d), k(w);
197
+ return clearTimeout(g), g = setTimeout(q, u), _(w);
198
198
  }
199
- return f === void 0 && (f = setTimeout(U, d)), v;
199
+ return g === void 0 && (g = setTimeout(q, u)), T;
200
200
  }
201
- return G.cancel = ft, G.flush = mt, G;
201
+ return U.cancel = nn, U.flush = tn, U;
202
202
  }
203
- return se = a, se;
203
+ return ee = c, ee;
204
204
  }
205
- var qt = tt();
206
- const Dt = /* @__PURE__ */ Je(qt);
207
- var ae, De;
208
- function Bt() {
209
- if (De) return ae;
210
- De = 1;
211
- var e = tt(), t = ge(), r = "Expected a function";
212
- function n(i, s, a) {
213
- var l = !0, d = !0;
214
- if (typeof i != "function")
215
- throw new TypeError(r);
216
- return t(a) && (l = "leading" in a ? !!a.leading : l, d = "trailing" in a ? !!a.trailing : d), e(i, s, {
205
+ var In = Ve();
206
+ const yn = /* @__PURE__ */ Fe(In);
207
+ var ne, je;
208
+ function Nn() {
209
+ if (je) return ne;
210
+ je = 1;
211
+ var e = Ve(), n = ce(), t = "Expected a function";
212
+ function r(a, o, c) {
213
+ var l = !0, u = !0;
214
+ if (typeof a != "function")
215
+ throw new TypeError(t);
216
+ return n(c) && (l = "leading" in c ? !!c.leading : l, u = "trailing" in c ? !!c.trailing : u), e(a, o, {
217
217
  leading: l,
218
- maxWait: s,
219
- trailing: d
218
+ maxWait: o,
219
+ trailing: u
220
220
  });
221
221
  }
222
- return ae = n, ae;
222
+ return ne = r, ne;
223
223
  }
224
- var $t = Bt();
225
- const Ut = /* @__PURE__ */ Je($t), zt = (e, t, r, n) => {
226
- switch (t) {
224
+ var Sn = Nn();
225
+ const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
226
+ switch (n) {
227
227
  case "debounce":
228
- return Dt(e, r, n);
228
+ return yn(e, t, r);
229
229
  case "throttle":
230
- return Ut(e, r, n);
230
+ return En(e, t, r);
231
231
  default:
232
232
  return e;
233
233
  }
234
- }, Ft = (
234
+ }, jn = (
235
235
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
236
236
  (e) => {
237
- const t = M.useRef(e);
238
- return M.useEffect(() => {
239
- t.current = e;
240
- }), M.useMemo(() => (...r) => {
241
- var n;
242
- return (n = t.current) === null || n === void 0 ? void 0 : n.call(t, ...r);
237
+ const n = k.useRef(e);
238
+ return k.useEffect(() => {
239
+ n.current = e;
240
+ }), k.useMemo(() => (...t) => {
241
+ var r;
242
+ return (r = n.current) === null || r === void 0 ? void 0 : r.call(n, ...t);
243
243
  }, []);
244
244
  }
245
- ), Ht = (
245
+ ), Ln = (
246
246
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
247
  (e) => {
248
- const [t, r] = M.useState((e == null ? void 0 : e.current) || null);
248
+ const [n, t] = k.useState((e == null ? void 0 : e.current) || null);
249
249
  return e && setTimeout(() => {
250
- e.current !== t && r(e.current);
251
- }, 0), { refProxy: M.useMemo(() => new Proxy((i) => {
252
- i !== t && r(i);
250
+ e.current !== n && t(e.current);
251
+ }, 0), { refProxy: k.useMemo(() => new Proxy((a) => {
252
+ a !== n && t(a);
253
253
  }, {
254
- get(i, s) {
255
- return s === "current" ? t : i[s];
254
+ get(a, o) {
255
+ return o === "current" ? n : a[o];
256
256
  },
257
- set(i, s, a) {
258
- return s === "current" ? r(a) : i[s] = a, !0;
257
+ set(a, o, c) {
258
+ return o === "current" ? t(c) : a[o] = c, !0;
259
259
  }
260
- }), [t]), refElement: t, setRefElement: r };
260
+ }), [n]), refElement: n, setRefElement: t };
261
261
  }
262
- ), Wt = (e, t) => t === "border-box" ? {
262
+ ), xn = (e, n) => n === "border-box" ? {
263
263
  width: e.borderBoxSize[0].inlineSize,
264
264
  height: e.borderBoxSize[0].blockSize
265
- } : t === "content-box" ? {
265
+ } : n === "content-box" ? {
266
266
  width: e.contentBoxSize[0].inlineSize,
267
267
  height: e.contentBoxSize[0].blockSize
268
268
  } : {
269
269
  width: e.contentRect.width,
270
270
  height: e.contentRect.height
271
271
  };
272
- function Gt({ skipOnMount: e = !1, refreshMode: t, refreshRate: r = 1e3, refreshOptions: n, handleWidth: i = !0, handleHeight: s = !0, targetRef: a, observerOptions: l, onResize: d } = {}) {
273
- const c = pt(e), u = Ft(d), [h, _] = E({
272
+ function Cn({ skipOnMount: e = !1, refreshMode: n, refreshRate: t = 1e3, refreshOptions: r, handleWidth: a = !0, handleHeight: o = !0, targetRef: c, observerOptions: l, onResize: u } = {}) {
273
+ const s = rn(e), d = jn(u), [h, v] = Me({
274
274
  width: void 0,
275
275
  height: void 0
276
- }), { refProxy: v, refElement: f } = Ht(a), { box: w } = l || {}, b = ue((m) => {
277
- if (!i && !s)
276
+ }), { refProxy: T, refElement: g } = Ln(c), { box: w } = l || {}, y = me((m) => {
277
+ if (!a && !o)
278
278
  return;
279
- if (c.current) {
280
- c.current = !1;
279
+ if (s.current) {
280
+ s.current = !1;
281
281
  return;
282
282
  }
283
- const T = (k, C) => i && k.width !== C.width || s && k.height !== C.height;
284
- m.forEach((k) => {
285
- const C = Wt(k, w);
286
- _(($) => T($, C) ? (u == null || u({
287
- width: C.width,
288
- height: C.height,
289
- entry: k
290
- }), C) : $);
283
+ const N = (_, p) => a && _.width !== p.width || o && _.height !== p.height;
284
+ m.forEach((_) => {
285
+ const p = xn(_, w);
286
+ v((A) => N(A, p) ? (d == null || d({
287
+ width: p.width,
288
+ height: p.height,
289
+ entry: _
290
+ }), p) : A);
291
291
  });
292
- }, [i, s, c, w]), p = ue(zt(b, t, r, n), [
293
- b,
292
+ }, [a, o, s, w]), S = me(Pn(y, n, t, r), [
293
+ y,
294
+ n,
294
295
  t,
295
- r,
296
- n
296
+ r
297
297
  ]);
298
- return me(() => {
298
+ return ie(() => {
299
299
  let m;
300
- return f ? (m = new window.ResizeObserver(p), m.observe(f, l)) : (h.width || h.height) && (u == null || u({
300
+ return g ? (m = new window.ResizeObserver(S), m.observe(g, l)) : (h.width || h.height) && (d == null || d({
301
301
  width: null,
302
302
  height: null,
303
303
  entry: null
304
- }), _({ width: void 0, height: void 0 })), () => {
305
- var T, k, C;
306
- (T = m == null ? void 0 : m.disconnect) === null || T === void 0 || T.call(m), (C = (k = p).cancel) === null || C === void 0 || C.call(k);
304
+ }), v({ width: void 0, height: void 0 })), () => {
305
+ var N, _, p;
306
+ (N = m == null ? void 0 : m.disconnect) === null || N === void 0 || N.call(m), (p = (_ = S).cancel) === null || p === void 0 || p.call(_);
307
307
  };
308
- }, [p, f]), Object.assign({ ref: v }, h);
308
+ }, [S, g]), Object.assign({ ref: T }, h);
309
309
  }
310
- function nt(e) {
311
- var t, r, n = "";
312
- if (typeof e == "string" || typeof e == "number") n += e;
310
+ function Ye(e) {
311
+ var n, t, r = "";
312
+ if (typeof e == "string" || typeof e == "number") r += e;
313
313
  else if (typeof e == "object") if (Array.isArray(e)) {
314
- var i = e.length;
315
- for (t = 0; t < i; t++) e[t] && (r = nt(e[t])) && (n && (n += " "), n += r);
316
- } else for (r in e) e[r] && (n && (n += " "), n += r);
317
- return n;
314
+ var a = e.length;
315
+ for (n = 0; n < a; n++) e[n] && (t = Ye(e[n])) && (r && (r += " "), r += t);
316
+ } else for (t in e) e[t] && (r && (r += " "), r += t);
317
+ return r;
318
318
  }
319
- function N() {
320
- for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = nt(e)) && (n && (n += " "), n += t);
321
- return n;
319
+ function L() {
320
+ for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n = Ye(e)) && (r && (r += " "), r += n);
321
+ return r;
322
322
  }
323
- const Vt = "_headerContainer_1cubo_1", Yt = "_headerContent_1cubo_34", Zt = "_staticEnabled_1cubo_50", fe = {
324
- headerContainer: Vt,
325
- headerContent: Yt,
326
- staticEnabled: Zt
327
- }, Xt = 77, H = ({ sticky: e, children: t }) => {
328
- const { ref: r, height: n } = Gt({
323
+ const Rn = "_headerContainer_1cubo_1", kn = "_navigationTabList_1cubo_8", On = "_navigationTab_1cubo_8", An = "_headerContent_1cubo_34", qn = "_staticEnabled_1cubo_50", C = {
324
+ headerContainer: Rn,
325
+ navigationTabList: kn,
326
+ navigationTab: On,
327
+ headerContent: An,
328
+ staticEnabled: qn
329
+ }, Bn = 77, M = ({ sticky: e, children: n }) => {
330
+ const { ref: t, height: r } = Cn({
329
331
  refreshMode: "debounce",
330
332
  refreshRate: 0
331
- }), [i, s] = E(!1), a = () => i ? !e : !0;
332
- me(() => {
333
- const d = () => {
334
- s(window.scrollY > 0);
333
+ }), [a, o] = Me(!1), c = () => a ? !e : !0;
334
+ ie(() => {
335
+ const u = () => {
336
+ o(window.scrollY > 0);
335
337
  };
336
- return window.addEventListener("scroll", d), () => window.removeEventListener("scroll", d);
338
+ return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
337
339
  }, []);
338
- const l = `${n || Xt}px`;
339
- return /* @__PURE__ */ o("div", { style: { minHeight: l }, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ g(
340
+ const l = `${r || Bn}px`;
341
+ return /* @__PURE__ */ i("div", { style: { minHeight: l }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ b(
340
342
  "div",
341
343
  {
342
- ref: r,
343
- className: N(fe.headerContent, {
344
- [fe.staticEnabled]: a()
344
+ ref: t,
345
+ className: L(C.headerContent, {
346
+ [C.staticEnabled]: c()
345
347
  }),
346
348
  children: [
347
- /* @__PURE__ */ o(H.Header, {}),
348
- /* @__PURE__ */ o(H.Tabs, {}),
349
- t
349
+ /* @__PURE__ */ i(M.Header, {}),
350
+ /* @__PURE__ */ i(M.Tabs, {}),
351
+ n
350
352
  ]
351
353
  }
352
354
  ) }) });
353
355
  };
354
- H.Header = ({ children: e }) => /* @__PURE__ */ o("div", { className: fe.headerContainer, children: e });
355
- H.Tabs = ({ children: e }) => /* @__PURE__ */ o("div", { className: "flex justify-between gap-2 nowrap", children: e });
356
- const Qt = "_sidebarContainer_1qc9v_1", Jt = {
357
- sidebarContainer: Qt
358
- }, Kt = "_logoLink_1tgpl_1", en = {
359
- logoLink: Kt
360
- }, tn = ({ src: e, href: t = "/", ariaLabel: r = "Home", alt: n = "Lokalise" }) => /* @__PURE__ */ o("a", { className: en.logoLink, href: t, "aria-label": r, children: /* @__PURE__ */ o("img", { src: e, alt: n }) }), nn = "_link_2ptl6_1", rn = "_active_2ptl6_18", Be = {
361
- link: nn,
362
- active: rn
363
- }, on = ({ label: e, to: t, icon: r }) => /* @__PURE__ */ o(q, { placement: "right", tooltip: e, children: /* @__PURE__ */ o(
364
- j,
356
+ M.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: C.headerContainer, children: e });
357
+ M.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
358
+ const Mn = "_sidebarContainer_bmdti_1", $n = {
359
+ sidebarContainer: Mn
360
+ }, Un = "_logoLink_1baxb_1", Dn = {
361
+ logoLink: Un
362
+ }, zn = ({ src: e, href: n = "/", ariaLabel: t = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ i("a", { className: Dn.logoLink, href: n, "aria-label": t, children: /* @__PURE__ */ i("img", { src: e, alt: r }) }), Wn = "_link_1weq1_1", Fn = "_active_1weq1_18", Le = {
363
+ link: Wn,
364
+ active: Fn
365
+ }, Hn = ({ label: e, to: n, icon: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
366
+ Ue,
365
367
  {
366
- className: N(Be.link, {
367
- [Be.active]: window.location.pathname.startsWith(t)
368
+ className: L(Le.link, {
369
+ [Le.active]: window.location.pathname.startsWith(n)
368
370
  }),
369
- href: t,
370
- children: r
371
+ href: n,
372
+ children: /* @__PURE__ */ i(t, { size: "25px" })
371
373
  }
372
- ) }), sn = "_dropdownButton_t7otz_1", an = "_dropdownButtonActive_t7otz_18", $e = {
373
- dropdownButton: sn,
374
- dropdownButtonActive: an
375
- }, cn = ({ children: e }) => /* @__PURE__ */ o(
376
- he,
374
+ ) }), Gn = "_dropdownButton_hwh0c_1", Vn = "_dropdownButtonActive_hwh0c_18", xe = {
375
+ dropdownButton: Gn,
376
+ dropdownButtonActive: Vn
377
+ }, Yn = ({ children: e, icon: n }) => /* @__PURE__ */ i(
378
+ oe,
377
379
  {
378
- menuButton: ({ opened: t }) => /* @__PURE__ */ o(q, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ o(
380
+ menuButton: ({ opened: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
379
381
  "button",
380
382
  {
381
- className: N($e.dropdownButton, {
382
- [$e.dropdownButtonActive]: t
383
+ type: "button",
384
+ className: L(xe.dropdownButton, {
385
+ [xe.dropdownButtonActive]: t
383
386
  }),
384
- children: /* @__PURE__ */ o(_t, { size: "24px" })
387
+ children: /* @__PURE__ */ i(n, { size: "25px" })
385
388
  }
386
389
  ) }),
387
- children: /* @__PURE__ */ o(pe, { placement: "right-start", children: e })
388
- }
389
- ), x = {
390
- TaskCompleted: "task_completed",
391
- TaskClosed: "task_closed",
392
- Refresh: "refresh",
393
- ShowDialog: "show_dialog"
394
- }, rt = 0, ln = 9999, dn = [150, 151, 250, 251], un = [152, 153, 252, 253], fn = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], mn = [156, 159, 160, 256, 259, 260], ot = 9998, _e = (e) => e === rt, it = (e) => e === ln, Ar = (e) => dn.includes(e), Mr = (e) => un.includes(e), qr = (e) => fn.includes(e), Dr = (e) => mn.includes(e), Br = (e) => e > rt && e < ot, $r = (e) => e === ot, hn = /\n/, Ue = (e, t, r) => e.split(t).flatMap((n, i) => i !== 0 ? [gt(r, { key: Math.random().toString(32).slice(0, 10) }), n] : n), pn = (e, t, r) => typeof e == "string" ? Ue(e, t, r) : e.flatMap((n) => typeof n == "string" ? Ue(n, t, r) : n), gn = (e) => pn(e, hn, /* @__PURE__ */ o("br", {})), _n = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, vn = (e) => e.match(_n) ?? [], ze = (e, t, r) => {
395
- const n = e.split(t);
396
- if (n.length === 1)
397
- return e;
398
- const i = [];
399
- return n[0] !== "" && i.push(n[0]), n.shift(), n[n.length - 1] === "" && n.pop(), i.push(
400
- /* @__PURE__ */ o("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + r)
401
- ), i.push(n.join(t)), i.filter((s) => s !== "");
402
- }, Fe = (e) => {
403
- const t = vn(e);
404
- return t != null && t.length ? t.reduce((r, n, i) => typeof r == "string" ? ze(r, n, i) : r.flatMap((s) => typeof s == "string" ? ze(s, n, i) : s), e) : e;
405
- }, bn = (e) => typeof e == "string" ? Fe(e) : e.flatMap((t) => typeof t == "string" ? Fe(t) : t, e), Tn = (e, t = "PP") => Qe(e, t), Ur = (e, t, r = "PP") => Qe(St(e, t), r), ve = (e) => {
406
- me(e, []);
407
- }, yn = Math.min, wn = Math.max;
408
- function He(e, t, r) {
409
- return wn(e, yn(t, r));
410
- }
411
- function st(e, t) {
412
- return typeof e == "function" ? e(t) : e;
413
- }
414
- function at(e) {
415
- return e.split("-")[0];
416
- }
417
- function Cn(e) {
418
- return e === "x" ? "y" : "x";
419
- }
420
- function kn(e) {
421
- return ["top", "bottom"].includes(at(e)) ? "y" : "x";
422
- }
423
- function xn(e) {
424
- return {
425
- top: 0,
426
- right: 0,
427
- bottom: 0,
428
- left: 0,
429
- ...e
430
- };
431
- }
432
- function Sn(e) {
433
- return typeof e != "number" ? xn(e) : {
434
- top: e,
435
- right: e,
436
- bottom: e,
437
- left: e
438
- };
439
- }
440
- function We(e) {
441
- const {
442
- x: t,
443
- y: r,
444
- width: n,
445
- height: i
446
- } = e;
447
- return {
448
- width: n,
449
- height: i,
450
- top: r,
451
- left: t,
452
- right: t + n,
453
- bottom: r + i,
454
- x: t,
455
- y: r
456
- };
457
- }
458
- async function In(e, t) {
459
- var r;
460
- t === void 0 && (t = {});
461
- const {
462
- x: n,
463
- y: i,
464
- platform: s,
465
- rects: a,
466
- elements: l,
467
- strategy: d
468
- } = e, {
469
- boundary: c = "clippingAncestors",
470
- rootBoundary: u = "viewport",
471
- elementContext: h = "floating",
472
- altBoundary: _ = !1,
473
- padding: v = 0
474
- } = st(t, e), f = Sn(v), b = l[_ ? h === "floating" ? "reference" : "floating" : h], p = We(await s.getClippingRect({
475
- element: (r = await (s.isElement == null ? void 0 : s.isElement(b))) == null || r ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
476
- boundary: c,
477
- rootBoundary: u,
478
- strategy: d
479
- })), m = h === "floating" ? {
480
- x: n,
481
- y: i,
482
- width: a.floating.width,
483
- height: a.floating.height
484
- } : a.reference, T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), k = await (s.isElement == null ? void 0 : s.isElement(T)) ? await (s.getScale == null ? void 0 : s.getScale(T)) || {
485
- x: 1,
486
- y: 1
487
- } : {
488
- x: 1,
489
- y: 1
490
- }, C = We(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
491
- elements: l,
492
- rect: m,
493
- offsetParent: T,
494
- strategy: d
495
- }) : m);
496
- return {
497
- top: (p.top - C.top + f.top) / k.y,
498
- bottom: (C.bottom - p.bottom + f.bottom) / k.y,
499
- left: (p.left - C.left + f.left) / k.x,
500
- right: (C.right - p.right + f.right) / k.x
501
- };
502
- }
503
- const En = function(e) {
504
- return e === void 0 && (e = {}), {
505
- name: "shift",
506
- options: e,
507
- async fn(t) {
508
- const {
509
- x: r,
510
- y: n,
511
- placement: i
512
- } = t, {
513
- mainAxis: s = !0,
514
- crossAxis: a = !1,
515
- limiter: l = {
516
- fn: (b) => {
517
- let {
518
- x: p,
519
- y: m
520
- } = b;
521
- return {
522
- x: p,
523
- y: m
524
- };
525
- }
526
- },
527
- ...d
528
- } = st(e, t), c = {
529
- x: r,
530
- y: n
531
- }, u = await In(t, d), h = kn(at(i)), _ = Cn(h);
532
- let v = c[_], f = c[h];
533
- if (s) {
534
- const b = _ === "y" ? "top" : "left", p = _ === "y" ? "bottom" : "right", m = v + u[b], T = v - u[p];
535
- v = He(m, v, T);
536
- }
537
- if (a) {
538
- const b = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", m = f + u[b], T = f - u[p];
539
- f = He(m, f, T);
540
- }
541
- const w = l.fn({
542
- ...t,
543
- [_]: v,
544
- [h]: f
545
- });
546
- return {
547
- ...w,
548
- data: {
549
- x: w.x - r,
550
- y: w.y - n,
551
- enabled: {
552
- [_]: s,
553
- [h]: a
554
- }
555
- }
556
- };
557
- }
558
- };
559
- }, Nn = "_navItem_1jmyj_1", Pn = "_activeNavItem_1jmyj_19", Ln = "_badge_1jmyj_24", ce = {
560
- navItem: Nn,
561
- activeNavItem: Pn,
562
- badge: Ln
563
- }, ct = Ye({}), D = () => Ze(ct), Rn = (e) => {
564
- const t = e.lastIndexOf("."), r = e.slice(0, t), n = e.slice(t + 1);
565
- return { name: r, extension: n };
566
- }, F = {
567
- translation: "translation",
568
- review: "review",
569
- lqa_by_ai: "lqa_by_ai",
570
- automatic_translation: "automatic_translation"
571
- }, jn = (e, t) => {
572
- switch (e) {
573
- case "completed":
574
- return t < 100 ? "Closed" : "Completed";
575
- case "created":
576
- return t > 0 ? "In progress" : "Not started";
577
- case "in_progress":
578
- return "In progress";
579
- case "queued":
580
- return "Queued";
581
- default:
582
- return "-";
390
+ children: /* @__PURE__ */ i(se, { placement: "right-start", children: e })
583
391
  }
584
- }, On = (e) => {
585
- const t = e.progress || 0;
586
- return e.status === "created" && t > 0 ? "in_progress" : e.status;
587
- }, Ge = ["in_progress", "created", "completed"], An = {
588
- [F.translation]: "#76BEDB",
589
- [F.review]: "#74B766",
590
- [F.lqa_by_ai]: "#F6F2FF",
591
- [F.automatic_translation]: "#F6F2FF"
592
- }, Mn = (e) => e.filter((t) => t.status !== "queued").map((t) => ({ ...t, status: On(t) })).sort((t, r) => t.status === "in_progress" && t.progress === 100 ? -1 : r.status === "in_progress" && r.progress === 100 ? 1 : t.status === r.status ? t.name < r.name ? 1 : -1 : Ge.indexOf(t.status) - Ge.indexOf(r.status)), qn = ({ task: e, language: t }) => {
593
- const [r, n] = E(!1), [i, s] = E(!1), { onLanguageCompleteConfirm: a, fetchTasks: l } = D(), d = () => {
594
- s(!1);
595
- };
596
- return /* @__PURE__ */ g(ht, { children: [
597
- i && /* @__PURE__ */ o(
598
- vt,
599
- {
600
- opened: i,
601
- loading: r,
602
- title: `Are you finished with ${t.name}?`,
603
- confirmText: "Mark as done",
604
- closeText: "Cancel",
605
- onClose: () => {
606
- s(!1);
607
- },
608
- onConfirm: async () => {
609
- n(!0), await a({ task: e, language: t, closePrompt: d }), l();
610
- },
611
- children: /* @__PURE__ */ g(bt, { status: "info", children: [
612
- "Make sure you are finished and ",
613
- /* @__PURE__ */ o("strong", { style: { display: "inline" }, children: "mark it as done" }),
614
- " to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
615
- ] })
616
- }
617
- ),
618
- /* @__PURE__ */ o(
619
- j,
620
- {
621
- disabled: r,
622
- onClick: () => {
623
- s(!0);
624
- },
625
- children: "Mark as done"
626
- }
627
- )
628
- ] });
629
- }, Dn = "_langRowCompleted_1aukv_1", Bn = "_langCellSecondary_1aukv_14", $n = "_langStatus_1aukv_19", le = {
630
- langRowCompleted: Dn,
631
- langCellSecondary: Bn,
632
- langStatus: $n
633
- }, Un = ({ language: e, task: t }) => {
634
- const { getProjectUrl: r, langNameOnClick: n, langProgressOnClick: i } = D(), s = e.progress || 0, a = e.status === "completed", l = [t.status, e.status].every((d) => ["in_progress", "created"].includes(d)) && s >= 100;
635
- return /* @__PURE__ */ g(
636
- "tr",
637
- {
638
- className: N({
639
- [le.langRowCompleted]: l
640
- }),
641
- children: [
642
- /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(q, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ o(
643
- j,
644
- {
645
- href: r({ task: t, language: e }),
646
- onClick: () => {
647
- n == null || n({ task: t, language: e });
648
- },
649
- children: e.name
650
- }
651
- ) }) }),
652
- /* @__PURE__ */ o("td", { className: le.langCellSecondary, children: l || a ? "0" : /* @__PURE__ */ o(q, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ o(
653
- j,
654
- {
655
- href: r({ task: t, language: e, taskUncompleted: !0 }),
656
- onClick: () => {
657
- i == null || i({ task: t, language: e });
658
- },
659
- children: Number.parseInt(e.base_words_total, 10) - Number.parseInt(e.base_words_done, 10)
660
- }
661
- ) }) }),
662
- /* @__PURE__ */ g("td", { children: [
663
- s,
664
- "%"
665
- ] }),
666
- /* @__PURE__ */ o("td", { children: l ? /* @__PURE__ */ o(qn, { task: t, language: e }) : /* @__PURE__ */ o(
667
- "span",
668
- {
669
- className: `${le.langStatus} flex-row items-center justify-start`,
670
- "data-status": e.status,
671
- children: jn(e.status, s)
672
- }
673
- ) })
674
- ]
675
- }
676
- );
677
- }, zn = "_taskContainer_1e51j_1", Fn = "_taskTitle_1e51j_21", Hn = "_taskDescription_1e51j_27", Wn = "_languagesTable_1e51j_33", Gn = "_metadata_1e51j_85", L = {
678
- taskContainer: zn,
679
- taskTitle: Fn,
680
- taskDescription: Hn,
681
- languagesTable: Wn,
682
- metadata: Gn
683
- }, Vn = ({ task: e }) => {
684
- const { tasks: t, getProjectUrl: r, taskTitleOnClick: n } = D(), i = Mn(e.langs), s = ue(
685
- (a) => {
686
- a !== void 0 && window.open(`/style-guide/${e.team_id}/download/${a.id}/link`, "_blank", "noopener,noreferrer");
687
- },
688
- [e.team_id]
689
- );
690
- return t ? /* @__PURE__ */ g("article", { className: L.taskContainer, children: [
691
- /* @__PURE__ */ g("div", { className: "flex-row gap-1 items-center", children: [
692
- /* @__PURE__ */ g("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
693
- /* @__PURE__ */ o(we, { color: An[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
694
- e.due_date && /* @__PURE__ */ g(we, { color: "#DEA829", children: [
695
- "DUE ",
696
- Tn(xt(e.due_date), "yyyy-MM-dd")
697
- ] })
698
- ] }),
699
- e.style_guides.length > 0 && /* @__PURE__ */ o("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ o(
700
- Ce,
701
- {
702
- size: "sm",
703
- variant: "secondary",
704
- onClick: () => s(e.style_guides[0]),
705
- children: "Download style guide"
706
- }
707
- ) : /* @__PURE__ */ o(
708
- he,
709
- {
710
- menuButton: /* @__PURE__ */ o(Ce, { variant: "secondary", size: "sm", children: "Download style guide" }),
711
- children: /* @__PURE__ */ o(pe, { children: e.style_guides.map((a) => /* @__PURE__ */ o(W, { onClick: () => s(a), children: Rn(a.name).name }, a.id)) })
712
- }
713
- ) })
714
- ] }),
715
- /* @__PURE__ */ g(Tt, { top: 1, children: [
716
- /* @__PURE__ */ o("h4", { className: L.taskTitle, children: /* @__PURE__ */ o(
717
- j,
718
- {
719
- href: r({ task: e, view: "multi" }),
720
- onClick: () => {
721
- n == null || n({ task: e });
722
- },
723
- children: e.title
724
- }
725
- ) }),
726
- e.description && /* @__PURE__ */ o("div", { className: L.taskDescription, children: gn(bn(e.description)) })
727
- ] }),
728
- /* @__PURE__ */ g("table", { className: L.languagesTable, children: [
729
- /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ g("tr", { children: [
730
- /* @__PURE__ */ o("th", { children: "Languages" }),
731
- /* @__PURE__ */ o("th", { children: "Words to do" }),
732
- /* @__PURE__ */ o("th", { children: "Progress" }),
733
- /* @__PURE__ */ o("th", { children: "Status" })
734
- ] }) }),
735
- /* @__PURE__ */ o("tbody", { children: i.map((a) => /* @__PURE__ */ o(Un, { language: a, task: e }, a.lang_id)) })
736
- ] }),
737
- /* @__PURE__ */ g("p", { className: L.metadata, children: [
738
- /* @__PURE__ */ g("span", { "data-test-id": "source-lang", children: [
739
- "Source: ",
740
- e.source_lang_name
741
- ] }),
742
- /* @__PURE__ */ o("span", { "data-test-id": "author-name", children: e.created_by_fullname }),
743
- /* @__PURE__ */ g("span", { "data-test-id": "project-name", children: [
744
- "In ",
745
- e.project_name,
746
- e.master_branching_enabled === "1" && /* @__PURE__ */ o("div", { className: L.tag, children: e.branch_name ? e.branch_name : "master" })
747
- ] })
748
- ] })
749
- ] }) : null;
750
- }, Yn = "_loadingContainer_1l6uh_1", Zn = "_noTasksContainer_1l6uh_6", Xn = "_noTasksHeading_1l6uh_12", Qn = "_noTasksText_1l6uh_16", Jn = "_tasksContainer_1l6uh_21", A = {
751
- loadingContainer: Yn,
752
- noTasksContainer: Zn,
753
- noTasksHeading: Xn,
754
- noTasksText: Qn,
755
- tasksContainer: Jn
756
- }, Kn = () => {
757
- const { tasks: e, onTasksWidgetOpen: t, loadingTasks: r, fetchTasks: n } = D();
758
- return ve(() => (n(), t == null || t({ tasks: e }), document.addEventListener(x.TaskCompleted, n), document.addEventListener(x.TaskClosed, n), document.addEventListener(x.Refresh, n), () => {
759
- document.removeEventListener(x.TaskCompleted, n), document.removeEventListener(x.TaskClosed, n), document.removeEventListener(x.Refresh, n);
760
- })), r ? /* @__PURE__ */ o("div", { className: A.loadingContainer, children: /* @__PURE__ */ o(yt, {}) }) : e.length === 0 ? /* @__PURE__ */ g("div", { className: A.noTasksContainer, children: [
761
- /* @__PURE__ */ o("h3", { className: A.noTasksHeading, children: "No tasks" }),
762
- /* @__PURE__ */ g("div", { className: A.noTasksText, children: [
763
- "Your incoming tasks will appear here.",
764
- /* @__PURE__ */ o("br", {}),
765
- /* @__PURE__ */ o(j, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
766
- ] })
767
- ] }) : /* @__PURE__ */ o("section", { className: A.tasksContainer, children: e.map((i) => /* @__PURE__ */ o(Vn, { task: i }, i.id)) });
768
- }, er = ({ children: e, config: t }) => {
769
- const [r, n] = E([]), [i, s] = E(!0), [a, l] = E(0), {
770
- getProjectUrl: d,
771
- onLanguageCompleteConfirm: c,
772
- onTasksWidgetOpen: u,
773
- langNameOnClick: h,
774
- langProgressOnClick: _,
775
- taskTitleOnClick: v
776
- } = t, { getTasks: f, getTasksCount: w } = t, b = async () => {
777
- s(!0);
778
- const T = await f();
779
- n(T), s(!1);
780
- }, p = async () => {
781
- const T = await w();
782
- l(T);
783
- };
784
- ve(() => (p(), document.addEventListener(x.TaskCompleted, p), document.addEventListener(x.TaskClosed, p), document.addEventListener(x.Refresh, p), () => {
785
- document.removeEventListener(x.TaskCompleted, p), document.removeEventListener(x.TaskClosed, p), document.removeEventListener(x.Refresh, p);
786
- }));
787
- const m = {
788
- fetchTasks: b,
789
- tasks: r,
790
- tasksCount: a,
791
- loadingTasks: i,
792
- getProjectUrl: d,
793
- onLanguageCompleteConfirm: c,
794
- onTasksWidgetOpen: u,
795
- langNameOnClick: h,
796
- langProgressOnClick: _,
797
- taskTitleOnClick: v
798
- };
799
- return /* @__PURE__ */ o(ct.Provider, { value: m, children: e });
800
- }, tr = (e) => function(r) {
801
- const { config: n, ...i } = r;
802
- return /* @__PURE__ */ o(er, { config: n, children: /* @__PURE__ */ o(e, { ...i }) });
803
- }, nr = tr(() => {
804
- const [e, t] = E(!1), { tasksCount: r } = D();
805
- return ve(() => {
806
- const n = () => {
807
- t(!0);
808
- };
809
- return document.addEventListener(x.ShowDialog, n), () => {
810
- document.removeEventListener(x.ShowDialog, n);
811
- };
812
- }), /* @__PURE__ */ o(q, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ o(
813
- wt,
814
- {
815
- content: /* @__PURE__ */ o(Kn, {}),
816
- placement: "right",
817
- open: e,
818
- onOpenChange: t,
819
- middlewares: [
820
- En({
821
- // Adding some spacing to the top and bottom so the popover
822
- // doesn't extend to the edges of the screen.
823
- padding: {
824
- top: 32,
825
- bottom: 32
826
- }
827
- })
828
- ],
829
- children: (n) => /* @__PURE__ */ g(
830
- "button",
831
- {
832
- type: "button",
833
- "aria-label": "Tasks",
834
- className: N(ce.navItem, {
835
- [ce.activeNavItem]: n
836
- }),
837
- children: [
838
- /* @__PURE__ */ o(Ct, { size: "24px" }),
839
- r > 0 && /* @__PURE__ */ o(
840
- "div",
841
- {
842
- className: ce.badge,
843
- "aria-label": `${r} items requiring attention`,
844
- children: r > 9 ? "9+" : r
845
- }
846
- )
847
- ]
848
- }
849
- )
850
- }
851
- ) });
852
- }), rr = "_iconContainer_18sqh_1", or = {
853
- iconContainer: rr
854
- }, lt = ({ className: e = "" }) => /* @__PURE__ */ o(
392
+ ), Zn = "_iconContainer_nz34m_1", Xn = {
393
+ iconContainer: Zn
394
+ }, Ze = ({ className: e = "" }) => /* @__PURE__ */ i(
855
395
  "div",
856
396
  {
857
397
  "aria-label": "Upgrade Icon",
858
- className: N(or.iconContainer, "flex-row", "items-center", "justify-center", e),
859
- children: /* @__PURE__ */ o(kt, {})
398
+ className: L(
399
+ Xn.iconContainer,
400
+ "flex-row",
401
+ "items-center",
402
+ "justify-center",
403
+ e
404
+ ),
405
+ children: /* @__PURE__ */ i(ln, {})
860
406
  }
861
- ), ir = "_menuContainer_1dcf5_5", sr = "_profileButton_1dcf5_16", ar = "_profileImage_1dcf5_29", cr = "_profileImageHighlight_1dcf5_37", lr = "_profileImageUpgradeIcon_1dcf5_41", dr = "_userIconWrapper_1dcf5_47", P = {
862
- menuContainer: ir,
863
- profileButton: sr,
864
- profileImage: ar,
865
- profileImageHighlight: cr,
866
- profileImageUpgradeIcon: lr,
867
- userIconWrapper: dr
868
- }, dt = Ye({}), B = () => Ze(dt), ur = ({ children: e }) => {
407
+ ), Jn = "_menuContainer_wbu3u_5", Kn = "_profileButton_wbu3u_16", Qn = "_profileImage_wbu3u_29", et = "_profileImageHighlight_wbu3u_37", nt = "_profileImageUpgradeIcon_wbu3u_41", tt = "_userIconWrapper_wbu3u_47", P = {
408
+ menuContainer: Jn,
409
+ profileButton: Kn,
410
+ profileImage: Qn,
411
+ profileImageHighlight: et,
412
+ profileImageUpgradeIcon: nt,
413
+ userIconWrapper: tt
414
+ }, Xe = on({}), O = () => an(Xe), rt = ({ children: e }) => {
869
415
  const {
870
- currentTeam: t,
871
- otherTeams: r,
872
- showUpgradeCta: n,
873
- showBillingButton: i,
874
- allowTeamCreation: s,
875
- isLimitedView: a,
416
+ currentTeam: n,
417
+ otherTeams: t,
418
+ showUpgradeCta: r,
419
+ showBillingButton: a,
420
+ allowTeamCreation: o,
421
+ isLimitedView: c,
876
422
  isProviderAlpha: l,
877
- canAccessTeamSettings: d,
878
- isEndOfTrialActive: c,
879
- isTeamSuspended: u
880
- } = B();
881
- return /* @__PURE__ */ o(
882
- he,
423
+ canAccessTeamSettings: u,
424
+ isEndOfTrialActive: s,
425
+ isTeamSuspended: d
426
+ } = O();
427
+ return /* @__PURE__ */ i(
428
+ oe,
883
429
  {
884
- menuButton: () => /* @__PURE__ */ g("button", { className: P.profileButton, "aria-label": "Profile menu", type: "button", children: [
885
- t != null && t.logoUrl ? /* @__PURE__ */ o(
430
+ menuButton: () => /* @__PURE__ */ b("button", { className: P.profileButton, "aria-label": "Profile menu", type: "button", children: [
431
+ n != null && n.logoUrl ? /* @__PURE__ */ i(
886
432
  "img",
887
433
  {
888
- src: t.logoUrl,
889
- className: N(P.profileImage, {
890
- [P.profileImageHighlight]: n
434
+ src: n.logoUrl,
435
+ className: L(P.profileImage, {
436
+ [P.profileImageHighlight]: r
891
437
  }),
892
438
  alt: "Team Logo"
893
439
  }
894
- ) : /* @__PURE__ */ o(
440
+ ) : /* @__PURE__ */ i(
895
441
  "div",
896
442
  {
897
- className: N(P.userIconWrapper, "flex-row", "align-center", "items-center", {
898
- [P.profileImageHighlight]: n
443
+ className: L(P.userIconWrapper, "flex-row", "align-center", "items-center", {
444
+ [P.profileImageHighlight]: r
899
445
  }),
900
- children: /* @__PURE__ */ o(Xe, { size: "24px" })
446
+ children: /* @__PURE__ */ i(De, { size: "25px" })
901
447
  }
902
448
  ),
903
- n && /* @__PURE__ */ o(lt, { className: P.profileImageUpgradeIcon })
449
+ r && /* @__PURE__ */ i(Ze, { className: P.profileImageUpgradeIcon })
904
450
  ] }),
905
- children: /* @__PURE__ */ o(pe, { placement: "right-end", className: P.menuContainer, children: e({
906
- allowTeamCreation: s,
907
- otherTeams: r,
908
- isLimitedView: a,
909
- canAccessTeamSettings: d,
910
- isEndOfTrialActive: c,
911
- isTeamSuspended: u,
912
- showBillingButton: i,
451
+ children: /* @__PURE__ */ i(se, { placement: "right-end", className: P.menuContainer, children: e({
452
+ allowTeamCreation: o,
453
+ otherTeams: t,
454
+ isLimitedView: c,
455
+ canAccessTeamSettings: u,
456
+ isEndOfTrialActive: s,
457
+ isTeamSuspended: d,
458
+ showBillingButton: a,
913
459
  isProviderAlpha: l
914
460
  }) })
915
461
  }
916
462
  );
917
- }, fr = ({ children: e, config: t }) => {
918
- const { teams: r, currentTeamId: n, planId: i, isLimitedView: s, isTeamSuspended: a, canAccessTeamSettings: l, isEndOfTrialActive: d } = t, c = r.find((m) => m.id === n), u = r.filter((m) => m.id !== n), h = (c == null ? void 0 : c.role) ?? "", _ = ["biller", "owner"].includes(h), v = _e(i) || it(i), p = {
919
- ...t,
920
- currentTeam: c,
921
- otherTeams: u,
922
- canChangeBilling: _,
923
- isOnFreeOrTrialPlan: v,
924
- showUpgradeCta: !s && v && _ && !a,
925
- showBillingButton: !s && l && _,
926
- allowTeamCreation: !s && !d
463
+ }, Je = 0, it = 9999, at = [150, 151, 250, 251], ot = [152, 153, 252, 253], st = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], ct = [156, 159, 160, 256, 259, 260], Ke = 9998, le = (e) => e === Je, Qe = (e) => e === it, Vt = (e) => at.includes(e), Yt = (e) => ot.includes(e), Zt = (e) => st.includes(e), Xt = (e) => ct.includes(e), Jt = (e) => e > Je && e < Ke, Kt = (e) => e === Ke, lt = /\n/, Ce = (e, n, t) => e.split(n).flatMap((r, a) => a !== 0 ? [sn(t, { key: Math.random().toString(32).slice(0, 10) }), r] : r), ut = (e, n, t) => typeof e == "string" ? Ce(e, n, t) : e.flatMap((r) => typeof r == "string" ? Ce(r, n, t) : r), Qt = (e) => ut(e, lt, /* @__PURE__ */ i("br", {})), dt = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, ft = (e) => e.match(dt) ?? [], Re = (e, n, t) => {
464
+ const r = e.split(n);
465
+ if (r.length === 1)
466
+ return e;
467
+ const a = [];
468
+ return r[0] !== "" && a.push(r[0]), r.shift(), r[r.length - 1] === "" && r.pop(), a.push(
469
+ /* @__PURE__ */ i("a", { href: n, target: "_blank", rel: "noreferrer noopener", children: n }, n + t)
470
+ ), a.push(r.join(n)), a.filter((o) => o !== "");
471
+ }, ke = (e) => {
472
+ const n = ft(e);
473
+ return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ? Re(t, r, a) : t.flatMap((o) => typeof o == "string" ? Re(o, r, a) : o), e) : e;
474
+ }, er = (e) => typeof e == "string" ? ke(e) : e.flatMap((n) => typeof n == "string" ? ke(n) : n, e), nr = (e, n = "PP") => We(e, n), tr = (e, n, t = "PP") => We(dn(e, n), t), rr = (e) => {
475
+ ie(e, []);
476
+ }, mt = ({ children: e, config: n }) => {
477
+ const {
478
+ teams: t,
479
+ currentTeamId: r,
480
+ planId: a,
481
+ isLimitedView: o,
482
+ isTeamSuspended: c,
483
+ canAccessTeamSettings: l,
484
+ isEndOfTrialActive: u
485
+ } = n, s = t.find((m) => m.id === r), d = t.filter((m) => m.id !== r), h = (s == null ? void 0 : s.role) ?? "", v = ["biller", "owner"].includes(h), T = le(a) || Qe(a), S = {
486
+ ...n,
487
+ currentTeam: s,
488
+ otherTeams: d,
489
+ canChangeBilling: v,
490
+ isOnFreeOrTrialPlan: T,
491
+ showUpgradeCta: !o && T && v && !c,
492
+ showBillingButton: !o && l && v,
493
+ allowTeamCreation: !o && !u
927
494
  };
928
- return /* @__PURE__ */ o(dt.Provider, { value: p, children: e });
929
- }, mr = ({ config: e, children: t }) => /* @__PURE__ */ o(fr, { config: e, children: /* @__PURE__ */ o(ur, { children: t }) }), hr = "_container_k7g5r_1", pr = "_profileEmail_k7g5r_5", Ve = {
930
- container: hr,
931
- profileEmail: pr
932
- }, gr = ({ href: e, onClick: t, userEmail: r }) => {
933
- const { isEndOfTrialActive: n, isTeamSuspended: i } = B();
934
- return n || i ? null : /* @__PURE__ */ o(
935
- W,
936
- {
937
- href: e,
938
- onClick: () => {
939
- t == null || t();
940
- },
941
- children: /* @__PURE__ */ g("div", { className: `flex-col ${Ve.container}`, children: [
942
- /* @__PURE__ */ o("span", { children: "Profile Settings" }),
943
- /* @__PURE__ */ o("span", { className: Ve.profileEmail, children: r })
944
- ] })
945
- }
946
- );
947
- }, _r = "_wrapper_1d834_1", vr = "_profileImage_1d834_14", br = "_teamName_1d834_22", Tr = "_planLabel_1d834_29", yr = "_membership_1d834_38", wr = "_defaultProfileImage_1d834_44", R = {
948
- wrapper: _r,
949
- profileImage: vr,
950
- teamName: br,
951
- planLabel: Tr,
952
- membership: yr,
953
- defaultProfileImage: wr
954
- }, ut = ({ team: e, onClick: t, hidePlanLabel: r }) => {
955
- const { currentTeam: n, planId: i } = B(), s = e || n;
956
- if (!s)
495
+ return /* @__PURE__ */ i(Xe.Provider, { value: S, children: e });
496
+ }, gt = ({ config: e, children: n }) => /* @__PURE__ */ i(mt, { config: e, children: /* @__PURE__ */ i(rt, { children: n }) }), ht = "_container_q5pot_1", pt = "_profileEmail_q5pot_5", Oe = {
497
+ container: ht,
498
+ profileEmail: pt
499
+ }, bt = ({
500
+ href: e,
501
+ onClick: n,
502
+ userEmail: t,
503
+ hideBottomDivider: r
504
+ }) => {
505
+ const { isEndOfTrialActive: a, isTeamSuspended: o } = O();
506
+ return a || o ? null : /* @__PURE__ */ b(Be, { children: [
507
+ /* @__PURE__ */ i(
508
+ $,
509
+ {
510
+ href: e,
511
+ onClick: () => {
512
+ n == null || n();
513
+ },
514
+ children: /* @__PURE__ */ b("div", { className: `flex-col ${Oe.container}`, children: [
515
+ /* @__PURE__ */ i("span", { children: "Profile Settings" }),
516
+ /* @__PURE__ */ i("span", { className: Oe.profileEmail, children: t })
517
+ ] })
518
+ }
519
+ ),
520
+ !r && /* @__PURE__ */ i(ze, {})
521
+ ] });
522
+ }, _t = "_wrapper_15d85_1", vt = "_profileImage_15d85_14", Tt = "_teamName_15d85_22", wt = "_planLabel_15d85_29", It = "_membership_15d85_38", yt = "_defaultProfileImage_15d85_44", x = {
523
+ wrapper: _t,
524
+ profileImage: vt,
525
+ teamName: Tt,
526
+ planLabel: wt,
527
+ membership: It,
528
+ defaultProfileImage: yt
529
+ }, en = ({ team: e, onClick: n, hidePlanLabel: t }) => {
530
+ const { currentTeam: r, planId: a } = O(), o = e || r;
531
+ if (!o)
957
532
  return null;
958
- const a = _e(i) ? "Free" : it(i) ? "Trial" : void 0;
959
- return /* @__PURE__ */ g(
960
- t ? W : "div",
533
+ const c = le(a) ? "Free" : Qe(a) ? "Trial" : void 0;
534
+ return /* @__PURE__ */ b(
535
+ n ? $ : "div",
961
536
  {
962
- className: `flex-row gap-2 flex-nowrap items-center ${R.wrapper}`,
963
- ...t && { onClick: () => t(s) },
537
+ className: `flex-row gap-2 flex-nowrap items-center ${x.wrapper}`,
538
+ ...n && { onClick: () => n(o) },
964
539
  children: [
965
- s.logoUrl ? /* @__PURE__ */ o("img", { className: R.profileImage, src: s.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ o("div", { className: `flex-row justify-center items-center ${R.defaultProfileImage}`, children: /* @__PURE__ */ o(Xe, { size: "24px" }) }),
966
- /* @__PURE__ */ g("div", { className: "flex-col items-start", children: [
967
- /* @__PURE__ */ g("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
968
- /* @__PURE__ */ o("span", { title: s.name, className: R.teamName, children: s.name }),
969
- a && !r && /* @__PURE__ */ o("span", { className: `flex-row justify-center items-center ${R.planLabel}`, children: a })
540
+ o.logoUrl ? /* @__PURE__ */ i("img", { className: x.profileImage, src: o.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.defaultProfileImage}`, children: /* @__PURE__ */ i(De, { size: "25px" }) }),
541
+ /* @__PURE__ */ b("div", { className: "flex-col items-start", children: [
542
+ /* @__PURE__ */ b("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
543
+ /* @__PURE__ */ i("span", { title: o.name, className: x.teamName, children: o.name }),
544
+ c && !t && /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.planLabel}`, children: c })
970
545
  ] }),
971
- /* @__PURE__ */ o("span", { className: R.membership, children: s.role })
546
+ /* @__PURE__ */ i("span", { className: x.membership, children: o.role })
972
547
  ] })
973
548
  ]
974
549
  }
975
550
  );
976
- }, Cr = "_teamsContainer_l4r3v_1", kr = {
977
- teamsContainer: Cr
978
- }, xr = ({ onSwitchTeam: e }) => {
979
- const { otherTeams: t } = B();
980
- return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: `flex-col items-stretch ${kr.teamsContainer}`, children: t.map((r) => /* @__PURE__ */ o(ut, { team: r, onClick: e, hidePlanLabel: !0 }, r.id)) });
981
- }, Sr = "_container_jmnsf_1", Ir = "_planCta_jmnsf_15", Er = "_upgradeIconWrapper_jmnsf_19", de = {
982
- container: Sr,
983
- planCta: Ir,
984
- upgradeIconWrapper: Er
985
- }, Nr = ({ upgradeOptionHref: e }) => {
986
- const { planId: t, trialDaysLeft: r, showUpgradeCta: n } = B();
987
- if (!n)
551
+ }, Nt = "_teamsContainer_1t68g_1", St = {
552
+ teamsContainer: Nt
553
+ }, Et = ({ onSwitchTeam: e }) => {
554
+ const { otherTeams: n } = O();
555
+ return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${St.teamsContainer}`, children: n.map((t) => /* @__PURE__ */ i(en, { team: t, onClick: e, hidePlanLabel: !0 }, t.id)) });
556
+ }, Pt = "_container_1u995_1", jt = "_planCta_1u995_15", Lt = "_upgradeIconWrapper_1u995_19", te = {
557
+ container: Pt,
558
+ planCta: jt,
559
+ upgradeIconWrapper: Lt
560
+ }, xt = ({ upgradeOptionHref: e }) => {
561
+ const { planId: n, trialDaysLeft: t, showUpgradeCta: r } = O();
562
+ if (!r)
988
563
  return null;
989
- const a = _e(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${r} ${r === 1 ? "day" : "days"}`;
990
- return /* @__PURE__ */ g(W, { href: e, className: `flex-col gap-1 items-start ${de.container}`, children: [
991
- /* @__PURE__ */ o("span", { className: de.planCta, children: a }),
992
- /* @__PURE__ */ g("div", { className: `flex-row items-center gap-1 ${de.upgradeIconWrapper}`, children: [
993
- /* @__PURE__ */ o(lt, {}),
994
- /* @__PURE__ */ o("span", { children: "See upgrade options" })
564
+ const c = le(n) ? "Your team is currently on the Free plan" : `Free trial ends in ${t} ${t === 1 ? "day" : "days"}`;
565
+ return /* @__PURE__ */ b($, { href: e, className: `flex-col gap-1 items-start ${te.container}`, children: [
566
+ /* @__PURE__ */ i("span", { className: te.planCta, children: c }),
567
+ /* @__PURE__ */ b("div", { className: `flex-row items-center gap-1 ${te.upgradeIconWrapper}`, children: [
568
+ /* @__PURE__ */ i(Ze, {}),
569
+ /* @__PURE__ */ i("span", { children: "See upgrade options" })
995
570
  ] })
996
571
  ] });
997
- }, S = ({ children: e, ...t }) => /* @__PURE__ */ o("nav", { ...t, className: Jt.sidebarContainer, children: e });
998
- S.Top = ({ children: e }) => /* @__PURE__ */ o("div", { children: e });
999
- S.Bottom = ({ children: e }) => /* @__PURE__ */ o("div", { children: e });
1000
- S.Avatar = tn;
1001
- S.IconLink = on;
1002
- S.Menu = cn;
1003
- S.Tasks = nr;
1004
- S.ProfileMenu = mr;
1005
- S.TeamSwitch = xr;
1006
- S.TeamMenuItem = ut;
1007
- S.UpgradeMenuItem = Nr;
1008
- S.ProfileSettingsMenuItem = gr;
572
+ }, I = ({ children: e, ...n }) => /* @__PURE__ */ i("nav", { ...n, className: $n.sidebarContainer, children: e });
573
+ I.Top = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
574
+ I.Bottom = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
575
+ I.Avatar = zn;
576
+ I.IconLink = Hn;
577
+ I.Menu = Yn;
578
+ I.ProfileMenu = gt;
579
+ I.TeamSwitch = Et;
580
+ I.TeamMenuItem = en;
581
+ I.UpgradeMenuItem = xt;
582
+ I.ProfileSettingsMenuItem = bt;
583
+ const Ct = "_breadcrumbsItem_1hm6a_1", Rt = "_breadcrumbs_1hm6a_1", Ae = {
584
+ breadcrumbsItem: Ct,
585
+ breadcrumbs: Rt
586
+ }, ir = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: Ae.breadcrumbs, children: e.map((n, t) => /* @__PURE__ */ b($e, { children: [
587
+ /* @__PURE__ */ i(Ue, { className: Ae.breadcrumbsItem, href: n.link, rel: "noreferrer", children: n.name }),
588
+ t < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
589
+ ] }, `${n.link}-${n.name}`)) }), kt = ({ items: e }) => /* @__PURE__ */ i(Be, { children: e.map((n, t) => /* @__PURE__ */ b($e, { children: [
590
+ !!t && n.some((r) => r.visible) && /* @__PURE__ */ i(ze, {}),
591
+ n.filter(({ visible: r }) => r).map(({ link: r, label: a, onClick: o }) => /* @__PURE__ */ i($, { href: r || "#", "aria-label": a, onClick: o, children: a }, a))
592
+ ] }, n[0].label)) }), Ot = "_badge_1pc1v_1", At = "_tag_1pc1v_15", qt = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", Bt = "_disabled_1pc1v_57", Mt = "_projectNavigationItem_1pc1v_61", $t = "_projectNavigationItemDisabled_1pc1v_67", j = {
593
+ badge: Ot,
594
+ tag: At,
595
+ withNavLinkStyle: qt,
596
+ disabled: Bt,
597
+ projectNavigationItem: Mt,
598
+ projectNavigationItemDisabled: $t
599
+ }, qe = ({ label: e, badge: n, novel: t }) => /* @__PURE__ */ b("div", { className: "flex gap-1", children: [
600
+ /* @__PURE__ */ b("div", { children: [
601
+ /* @__PURE__ */ i("span", { children: e }),
602
+ !!n && /* @__PURE__ */ i("div", { className: j.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
603
+ ] }),
604
+ !!t && /* @__PURE__ */ i(un, { className: j.tag, children: t })
605
+ ] }), re = cn(
606
+ ({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o }, c) => /* @__PURE__ */ i(ae, { tooltip: "You do not have access to this function", show: t, children: /* @__PURE__ */ i(
607
+ "div",
608
+ {
609
+ className: t ? j.projectNavigationItemDisabled : j.projectNavigationItem,
610
+ children: a || t || !n ? /* @__PURE__ */ i(
611
+ "button",
612
+ {
613
+ type: "button",
614
+ ref: c,
615
+ className: L(j.withNavLinkStyle, {
616
+ [j.disabled]: t
617
+ }),
618
+ disabled: t,
619
+ onClick: a,
620
+ children: /* @__PURE__ */ i(qe, { label: e, badge: r, novel: o })
621
+ }
622
+ ) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(qe, { label: e, badge: r, novel: o }) })
623
+ }
624
+ ) })
625
+ );
626
+ re.displayName = "NavigationTabsItem";
627
+ const Ut = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible))) ?? !1, Dt = (e) => e.visible && (!e.dropdown || Ut(e.dropdown)), ar = ({ navigation: e, activeItem: n }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: C.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Dt).map((t) => {
628
+ var r, a, o;
629
+ return t.dropdown ? /* @__PURE__ */ i(
630
+ "li",
631
+ {
632
+ className: C.navigationTab,
633
+ "data-testid": t.key,
634
+ "aria-selected": (r = t.isActive) == null ? void 0 : r.call(t, n),
635
+ children: /* @__PURE__ */ i(
636
+ oe,
637
+ {
638
+ menuButton: ({ opened: c }) => /* @__PURE__ */ i(re, { label: t.label, disabled: t.disabled, active: c }),
639
+ children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ i(kt, { items: t.dropdown }) })
640
+ }
641
+ )
642
+ },
643
+ t.key
644
+ ) : /* @__PURE__ */ i(
645
+ "li",
646
+ {
647
+ className: C.navigationTab,
648
+ "data-testid": t.key,
649
+ "aria-selected": (a = t.isActive) == null ? void 0 : a.call(t, n),
650
+ children: /* @__PURE__ */ i(
651
+ re,
652
+ {
653
+ label: t.label,
654
+ href: t.link,
655
+ onClick: t.onClick,
656
+ disabled: t.disabled,
657
+ badge: t.badge,
658
+ novel: t.novel,
659
+ active: (o = t.isActive) == null ? void 0 : o.call(t, n)
660
+ }
661
+ )
662
+ },
663
+ t.key
664
+ );
665
+ }) }) });
1009
666
  export {
1010
- ot as ENTERPRISE_OPENSOURCE_PLAN_ID,
1011
- mn as ENTERPRISE_PLAN_IDS,
1012
- un as ESSENTIAL_PLAN_IDS,
1013
- rt as FREE_PLAN_ID,
1014
- H as NavigationPanel,
1015
- fn as PRO_PLAN_IDS,
1016
- dn as START_PLAN_IDS,
1017
- S as Sidebar,
1018
- ln as TRIAL_PLAN_ID,
1019
- gn as convertNewLineToBreakTag,
1020
- Tn as formatDate,
1021
- Ur as formatDateTz,
1022
- $r as isEnterpriseOpenSourcePlan,
1023
- Dr as isEnterprisePlan,
1024
- Mr as isEssentialPlan,
1025
- _e as isFreePlan,
1026
- Br as isPaidPlan,
1027
- qr as isProPlan,
1028
- Ar as isStartPlan,
1029
- it as isTrialPlan,
1030
- bn as makeUrlClickable,
1031
- ve as useEffectOnce
667
+ ir as Breadcrumbs,
668
+ Ke as ENTERPRISE_OPENSOURCE_PLAN_ID,
669
+ ct as ENTERPRISE_PLAN_IDS,
670
+ ot as ESSENTIAL_PLAN_IDS,
671
+ Je as FREE_PLAN_ID,
672
+ M as NavigationPanel,
673
+ ar as NavigationTabs,
674
+ st as PRO_PLAN_IDS,
675
+ at as START_PLAN_IDS,
676
+ I as Sidebar,
677
+ it as TRIAL_PLAN_ID,
678
+ Qt as convertNewLineToBreakTag,
679
+ nr as formatDate,
680
+ tr as formatDateTz,
681
+ Kt as isEnterpriseOpenSourcePlan,
682
+ Xt as isEnterprisePlan,
683
+ Yt as isEssentialPlan,
684
+ le as isFreePlan,
685
+ Jt as isPaidPlan,
686
+ Zt as isProPlan,
687
+ Vt as isStartPlan,
688
+ Qe as isTrialPlan,
689
+ er as makeUrlClickable,
690
+ rr as useEffectOnce
1032
691
  };