@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.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +542 -883
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +8 -6
- package/dist/types/src/components/Sidebar/Sidebar.stories.d.ts +85 -2
- package/dist/types/src/components/Sidebar/Widgets/IconLink/IconLink.d.ts +4 -3
- package/dist/types/src/components/Sidebar/Widgets/Menu/Menu.d.ts +7 -2
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileSettingsMenuItem/ProfileSettingsMenuItem.d.ts +2 -1
- package/dist/types/src/node.d.ts +2 -0
- package/dist/types/tests/mocks/sidebar/profileMenu.d.ts +2 -0
- package/package.json +4 -5
- package/dist/types/fixtures/sidebar/profileMenu.d.ts +0 -2
- package/dist/types/fixtures/sidebar/tasks.d.ts +0 -2
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +0 -6
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +0 -7
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +0 -5
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +0 -3
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +0 -2
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +0 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +0 -10
- package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +0 -2
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +0 -85
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +0 -16
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +0 -23
- package/dist/types/src/components/Sidebar/Widgets/index.d.ts +0 -5
- package/dist/types/vite.config.d.ts +0 -2
package/dist/harmony.mjs
CHANGED
|
@@ -1,1032 +1,691 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { format as
|
|
6
|
-
import { toZonedTime as
|
|
7
|
-
var
|
|
8
|
-
function
|
|
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
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
function e(
|
|
16
|
-
var
|
|
17
|
-
return
|
|
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
|
|
19
|
+
return D = e, D;
|
|
20
20
|
}
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
var e = typeof
|
|
26
|
-
return
|
|
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
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
var e =
|
|
33
|
-
return
|
|
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
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
var e =
|
|
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
|
|
42
|
+
return F = n, F;
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
47
|
-
|
|
44
|
+
var H, _e;
|
|
45
|
+
function gn() {
|
|
46
|
+
if (_e) return H;
|
|
47
|
+
_e = 1;
|
|
48
48
|
var e = /\s/;
|
|
49
|
-
function t
|
|
50
|
-
for (var
|
|
49
|
+
function n(t) {
|
|
50
|
+
for (var r = t.length; r-- && e.test(t.charAt(r)); )
|
|
51
51
|
;
|
|
52
|
-
return
|
|
52
|
+
return r;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return H = n, H;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
var e =
|
|
61
|
-
function r
|
|
62
|
-
return
|
|
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
|
|
64
|
+
return G = t, G;
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
var e =
|
|
71
|
-
return
|
|
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
|
|
74
|
-
function
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
var e =
|
|
78
|
-
function
|
|
79
|
-
var l =
|
|
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
|
|
82
|
-
var
|
|
81
|
+
c[a] = void 0;
|
|
82
|
+
var s = !0;
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
|
-
var
|
|
86
|
-
return
|
|
85
|
+
var d = r.call(c);
|
|
86
|
+
return s && (l ? c[a] = u : delete c[a]), d;
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return Y = o, Y;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
var e = Object.prototype,
|
|
95
|
-
function r
|
|
96
|
-
return
|
|
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
|
|
98
|
+
return Z = t, Z;
|
|
99
99
|
}
|
|
100
|
-
var
|
|
101
|
-
function
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
var e =
|
|
105
|
-
function
|
|
106
|
-
return l == null ? l === void 0 ?
|
|
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
|
|
108
|
+
return X = c, X;
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
function e(
|
|
115
|
-
return
|
|
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
|
|
117
|
+
return J = e, J;
|
|
118
118
|
}
|
|
119
|
-
var
|
|
120
|
-
function
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
var e =
|
|
124
|
-
function
|
|
125
|
-
return typeof
|
|
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
|
|
127
|
+
return K = r, K;
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
var e =
|
|
134
|
-
function
|
|
135
|
-
if (typeof
|
|
136
|
-
return
|
|
137
|
-
if (
|
|
138
|
-
return
|
|
139
|
-
if (
|
|
140
|
-
var
|
|
141
|
-
|
|
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
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
var h =
|
|
147
|
-
return h ||
|
|
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
|
|
149
|
+
return Q = u, Q;
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function
|
|
153
|
-
if (
|
|
154
|
-
|
|
155
|
-
var e =
|
|
156
|
-
function
|
|
157
|
-
var
|
|
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(
|
|
160
|
-
|
|
161
|
-
function
|
|
162
|
-
var
|
|
163
|
-
return
|
|
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
|
|
166
|
-
return
|
|
165
|
+
function p(f) {
|
|
166
|
+
return y = f, g = setTimeout(q, u), S ? _(f) : T;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
return m ?
|
|
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
|
|
173
|
-
var
|
|
174
|
-
return w === void 0 ||
|
|
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
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
179
|
-
return
|
|
180
|
-
|
|
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
|
|
183
|
-
return
|
|
182
|
+
function de(f) {
|
|
183
|
+
return g = void 0, N && d ? _(f) : (d = h = void 0, T);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
185
|
+
function nn() {
|
|
186
|
+
g !== void 0 && clearTimeout(g), y = 0, d = w = h = g = void 0;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
return
|
|
188
|
+
function tn() {
|
|
189
|
+
return g === void 0 ? T : de(n());
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
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(
|
|
197
|
+
return clearTimeout(g), g = setTimeout(q, u), _(w);
|
|
198
198
|
}
|
|
199
|
-
return
|
|
199
|
+
return g === void 0 && (g = setTimeout(q, u)), T;
|
|
200
200
|
}
|
|
201
|
-
return
|
|
201
|
+
return U.cancel = nn, U.flush = tn, U;
|
|
202
202
|
}
|
|
203
|
-
return
|
|
203
|
+
return ee = c, ee;
|
|
204
204
|
}
|
|
205
|
-
var
|
|
206
|
-
const
|
|
207
|
-
var
|
|
208
|
-
function
|
|
209
|
-
if (
|
|
210
|
-
|
|
211
|
-
var e =
|
|
212
|
-
function
|
|
213
|
-
var l = !0,
|
|
214
|
-
if (typeof
|
|
215
|
-
throw new TypeError(
|
|
216
|
-
return
|
|
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:
|
|
219
|
-
trailing:
|
|
218
|
+
maxWait: o,
|
|
219
|
+
trailing: u
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
-
return
|
|
222
|
+
return ne = r, ne;
|
|
223
223
|
}
|
|
224
|
-
var
|
|
225
|
-
const
|
|
226
|
-
switch (
|
|
224
|
+
var Sn = Nn();
|
|
225
|
+
const En = /* @__PURE__ */ Fe(Sn), Pn = (e, n, t, r) => {
|
|
226
|
+
switch (n) {
|
|
227
227
|
case "debounce":
|
|
228
|
-
return
|
|
228
|
+
return yn(e, t, r);
|
|
229
229
|
case "throttle":
|
|
230
|
-
return
|
|
230
|
+
return En(e, t, r);
|
|
231
231
|
default:
|
|
232
232
|
return e;
|
|
233
233
|
}
|
|
234
|
-
},
|
|
234
|
+
}, jn = (
|
|
235
235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
236
236
|
(e) => {
|
|
237
|
-
const
|
|
238
|
-
return
|
|
239
|
-
|
|
240
|
-
}),
|
|
241
|
-
var
|
|
242
|
-
return (
|
|
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
|
-
),
|
|
245
|
+
), Ln = (
|
|
246
246
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
247
247
|
(e) => {
|
|
248
|
-
const [
|
|
248
|
+
const [n, t] = k.useState((e == null ? void 0 : e.current) || null);
|
|
249
249
|
return e && setTimeout(() => {
|
|
250
|
-
e.current !==
|
|
251
|
-
}, 0), { refProxy:
|
|
252
|
-
|
|
250
|
+
e.current !== n && t(e.current);
|
|
251
|
+
}, 0), { refProxy: k.useMemo(() => new Proxy((a) => {
|
|
252
|
+
a !== n && t(a);
|
|
253
253
|
}, {
|
|
254
|
-
get(
|
|
255
|
-
return
|
|
254
|
+
get(a, o) {
|
|
255
|
+
return o === "current" ? n : a[o];
|
|
256
256
|
},
|
|
257
|
-
set(
|
|
258
|
-
return
|
|
257
|
+
set(a, o, c) {
|
|
258
|
+
return o === "current" ? t(c) : a[o] = c, !0;
|
|
259
259
|
}
|
|
260
|
-
}), [
|
|
260
|
+
}), [n]), refElement: n, setRefElement: t };
|
|
261
261
|
}
|
|
262
|
-
),
|
|
262
|
+
), xn = (e, n) => n === "border-box" ? {
|
|
263
263
|
width: e.borderBoxSize[0].inlineSize,
|
|
264
264
|
height: e.borderBoxSize[0].blockSize
|
|
265
|
-
} :
|
|
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
|
|
273
|
-
const
|
|
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:
|
|
277
|
-
if (!
|
|
276
|
+
}), { refProxy: T, refElement: g } = Ln(c), { box: w } = l || {}, y = me((m) => {
|
|
277
|
+
if (!a && !o)
|
|
278
278
|
return;
|
|
279
|
-
if (
|
|
280
|
-
|
|
279
|
+
if (s.current) {
|
|
280
|
+
s.current = !1;
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
const
|
|
284
|
-
m.forEach((
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
width:
|
|
288
|
-
height:
|
|
289
|
-
entry:
|
|
290
|
-
}),
|
|
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
|
-
}, [
|
|
293
|
-
|
|
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
|
|
298
|
+
return ie(() => {
|
|
299
299
|
let m;
|
|
300
|
-
return
|
|
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
|
-
}),
|
|
305
|
-
var
|
|
306
|
-
(
|
|
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
|
-
}, [
|
|
308
|
+
}, [S, g]), Object.assign({ ref: T }, h);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
var t, r
|
|
312
|
-
if (typeof e == "string" || typeof e == "number")
|
|
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
|
|
315
|
-
for (
|
|
316
|
-
} else for (
|
|
317
|
-
return
|
|
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
|
|
320
|
-
for (var e,
|
|
321
|
-
return
|
|
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
|
|
324
|
-
headerContainer:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
}), [
|
|
332
|
-
|
|
333
|
-
const
|
|
334
|
-
|
|
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",
|
|
338
|
+
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
|
337
339
|
}, []);
|
|
338
|
-
const l = `${
|
|
339
|
-
return /* @__PURE__ */
|
|
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:
|
|
343
|
-
className:
|
|
344
|
-
[
|
|
344
|
+
ref: t,
|
|
345
|
+
className: L(C.headerContent, {
|
|
346
|
+
[C.staticEnabled]: c()
|
|
345
347
|
}),
|
|
346
348
|
children: [
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
|
|
349
|
+
/* @__PURE__ */ i(M.Header, {}),
|
|
350
|
+
/* @__PURE__ */ i(M.Tabs, {}),
|
|
351
|
+
n
|
|
350
352
|
]
|
|
351
353
|
}
|
|
352
354
|
) }) });
|
|
353
355
|
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
sidebarContainer:
|
|
358
|
-
},
|
|
359
|
-
logoLink:
|
|
360
|
-
},
|
|
361
|
-
link:
|
|
362
|
-
active:
|
|
363
|
-
},
|
|
364
|
-
|
|
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:
|
|
367
|
-
[
|
|
368
|
+
className: L(Le.link, {
|
|
369
|
+
[Le.active]: window.location.pathname.startsWith(n)
|
|
368
370
|
}),
|
|
369
|
-
href:
|
|
370
|
-
children:
|
|
371
|
+
href: n,
|
|
372
|
+
children: /* @__PURE__ */ i(t, { size: "25px" })
|
|
371
373
|
}
|
|
372
|
-
) }),
|
|
373
|
-
dropdownButton:
|
|
374
|
-
dropdownButtonActive:
|
|
375
|
-
},
|
|
376
|
-
|
|
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__ */
|
|
380
|
+
menuButton: ({ opened: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
|
379
381
|
"button",
|
|
380
382
|
{
|
|
381
|
-
|
|
382
|
-
|
|
383
|
+
type: "button",
|
|
384
|
+
className: L(xe.dropdownButton, {
|
|
385
|
+
[xe.dropdownButtonActive]: t
|
|
383
386
|
}),
|
|
384
|
-
children: /* @__PURE__ */
|
|
387
|
+
children: /* @__PURE__ */ i(n, { size: "25px" })
|
|
385
388
|
}
|
|
386
389
|
) }),
|
|
387
|
-
children: /* @__PURE__ */
|
|
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
|
-
|
|
585
|
-
|
|
586
|
-
|
|
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:
|
|
859
|
-
|
|
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
|
-
),
|
|
862
|
-
menuContainer:
|
|
863
|
-
profileButton:
|
|
864
|
-
profileImage:
|
|
865
|
-
profileImageHighlight:
|
|
866
|
-
profileImageUpgradeIcon:
|
|
867
|
-
userIconWrapper:
|
|
868
|
-
},
|
|
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:
|
|
871
|
-
otherTeams:
|
|
872
|
-
showUpgradeCta:
|
|
873
|
-
showBillingButton:
|
|
874
|
-
allowTeamCreation:
|
|
875
|
-
isLimitedView:
|
|
416
|
+
currentTeam: n,
|
|
417
|
+
otherTeams: t,
|
|
418
|
+
showUpgradeCta: r,
|
|
419
|
+
showBillingButton: a,
|
|
420
|
+
allowTeamCreation: o,
|
|
421
|
+
isLimitedView: c,
|
|
876
422
|
isProviderAlpha: l,
|
|
877
|
-
canAccessTeamSettings:
|
|
878
|
-
isEndOfTrialActive:
|
|
879
|
-
isTeamSuspended:
|
|
880
|
-
} =
|
|
881
|
-
return /* @__PURE__ */
|
|
882
|
-
|
|
423
|
+
canAccessTeamSettings: u,
|
|
424
|
+
isEndOfTrialActive: s,
|
|
425
|
+
isTeamSuspended: d
|
|
426
|
+
} = O();
|
|
427
|
+
return /* @__PURE__ */ i(
|
|
428
|
+
oe,
|
|
883
429
|
{
|
|
884
|
-
menuButton: () => /* @__PURE__ */
|
|
885
|
-
|
|
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:
|
|
889
|
-
className:
|
|
890
|
-
[P.profileImageHighlight]:
|
|
434
|
+
src: n.logoUrl,
|
|
435
|
+
className: L(P.profileImage, {
|
|
436
|
+
[P.profileImageHighlight]: r
|
|
891
437
|
}),
|
|
892
438
|
alt: "Team Logo"
|
|
893
439
|
}
|
|
894
|
-
) : /* @__PURE__ */
|
|
440
|
+
) : /* @__PURE__ */ i(
|
|
895
441
|
"div",
|
|
896
442
|
{
|
|
897
|
-
className:
|
|
898
|
-
[P.profileImageHighlight]:
|
|
443
|
+
className: L(P.userIconWrapper, "flex-row", "align-center", "items-center", {
|
|
444
|
+
[P.profileImageHighlight]: r
|
|
899
445
|
}),
|
|
900
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ i(De, { size: "25px" })
|
|
901
447
|
}
|
|
902
448
|
),
|
|
903
|
-
|
|
449
|
+
r && /* @__PURE__ */ i(Ze, { className: P.profileImageUpgradeIcon })
|
|
904
450
|
] }),
|
|
905
|
-
children: /* @__PURE__ */
|
|
906
|
-
allowTeamCreation:
|
|
907
|
-
otherTeams:
|
|
908
|
-
isLimitedView:
|
|
909
|
-
canAccessTeamSettings:
|
|
910
|
-
isEndOfTrialActive:
|
|
911
|
-
isTeamSuspended:
|
|
912
|
-
showBillingButton:
|
|
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
|
-
},
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
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__ */
|
|
929
|
-
},
|
|
930
|
-
container:
|
|
931
|
-
profileEmail:
|
|
932
|
-
},
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
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
|
|
959
|
-
return /* @__PURE__ */
|
|
960
|
-
|
|
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 ${
|
|
963
|
-
...
|
|
537
|
+
className: `flex-row gap-2 flex-nowrap items-center ${x.wrapper}`,
|
|
538
|
+
...n && { onClick: () => n(o) },
|
|
964
539
|
children: [
|
|
965
|
-
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
/* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
|
|
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__ */
|
|
546
|
+
/* @__PURE__ */ i("span", { className: x.membership, children: o.role })
|
|
972
547
|
] })
|
|
973
548
|
]
|
|
974
549
|
}
|
|
975
550
|
);
|
|
976
|
-
},
|
|
977
|
-
teamsContainer:
|
|
978
|
-
},
|
|
979
|
-
const { otherTeams:
|
|
980
|
-
return
|
|
981
|
-
},
|
|
982
|
-
container:
|
|
983
|
-
planCta:
|
|
984
|
-
upgradeIconWrapper:
|
|
985
|
-
},
|
|
986
|
-
const { planId:
|
|
987
|
-
if (!
|
|
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
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
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
|
-
},
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
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
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
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
|
};
|