@lokalise/harmony 1.19.2 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +703 -659
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.stories.d.ts +28 -0
- package/dist/types/src/features/publicApi/hooks/useAddLanguagesToProjectMutation.d.ts +36 -0
- package/dist/types/src/features/publicApi/languages.d.ts +159 -0
- package/dist/types/src/features/publicApi/node.d.ts +2 -1
- package/dist/types/src/features/publicApi/types/languageTypes.d.ts +108 -0
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var ne = (e, t, n) =>
|
4
|
-
import { jsx as s, jsxs as
|
5
|
-
import * as
|
6
|
-
import { useRef as
|
7
|
-
import { Tooltip as
|
8
|
-
import { format as Rt, parseISO as
|
9
|
-
import { toZonedTime as
|
1
|
+
var en = Object.defineProperty;
|
2
|
+
var tn = (e, t, n) => t in e ? en(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var ne = (e, t, n) => tn(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { jsx as s, jsxs as f, Fragment as He } from "react/jsx-runtime";
|
5
|
+
import * as K from "react";
|
6
|
+
import { useRef as Ct, useState as R, useCallback as We, useEffect as J, useContext as wt, createContext as Pt, cloneElement as nn, Fragment as At, forwardRef as rn } from "react";
|
7
|
+
import { Tooltip as B, Link as M, Menu as ce, MenuList as le, CaretUpIcon as an, UserIcon as kt, MenuItem as W, MenuDivider as It, ConfirmModal as on, Alert as sn, Tag as Oe, Button as xe, Loading as cn, Popover as ln, JobIcon as dn } from "@lokalise/louis";
|
8
|
+
import { format as Rt, parseISO as un, isThisSecond as mn } from "date-fns";
|
9
|
+
import { toZonedTime as _n } from "date-fns-tz";
|
10
10
|
import { z as r } from "zod";
|
11
|
-
import { buildPayloadRoute as
|
12
|
-
import { sendByPayloadRoute as
|
13
|
-
import { useQuery as D, useMutation as
|
14
|
-
import { buildGetRoute as
|
15
|
-
const
|
11
|
+
import { buildPayloadRoute as qe } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
12
|
+
import { sendByPayloadRoute as U, sendByGetRoute as Q } from "@lokalise/frontend-http-client";
|
13
|
+
import { useQuery as D, useMutation as de } from "@tanstack/react-query";
|
14
|
+
import { buildGetRoute as Y, buildPayloadRoute as jt } from "@lokalise/universal-ts-utils/node";
|
15
|
+
const Le = {
|
16
16
|
Completed: "completed",
|
17
17
|
InProgress: "in_progress",
|
18
18
|
Created: "created",
|
19
19
|
Queued: "queued"
|
20
|
-
},
|
21
|
-
...
|
20
|
+
}, A = {
|
21
|
+
...Le,
|
22
22
|
NotStarted: "not_started"
|
23
23
|
}, re = {
|
24
24
|
translation: "translation",
|
@@ -30,42 +30,42 @@ var ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
30
30
|
function Nt(e) {
|
31
31
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
32
32
|
}
|
33
|
-
var
|
33
|
+
var pe, Qe;
|
34
34
|
function Be() {
|
35
|
-
if (Qe) return
|
35
|
+
if (Qe) return pe;
|
36
36
|
Qe = 1;
|
37
37
|
function e(t) {
|
38
38
|
var n = typeof t;
|
39
39
|
return t != null && (n == "object" || n == "function");
|
40
40
|
}
|
41
|
-
return
|
41
|
+
return pe = e, pe;
|
42
42
|
}
|
43
|
-
var
|
44
|
-
function
|
45
|
-
if (
|
46
|
-
|
43
|
+
var fe, Ye;
|
44
|
+
function gn() {
|
45
|
+
if (Ye) return fe;
|
46
|
+
Ye = 1;
|
47
47
|
var e = typeof ae == "object" && ae && ae.Object === Object && ae;
|
48
|
-
return
|
48
|
+
return fe = e, fe;
|
49
49
|
}
|
50
|
-
var he,
|
51
|
-
function
|
52
|
-
if (
|
53
|
-
|
54
|
-
var e =
|
50
|
+
var he, Xe;
|
51
|
+
function Ot() {
|
52
|
+
if (Xe) return he;
|
53
|
+
Xe = 1;
|
54
|
+
var e = gn(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
55
55
|
return he = n, he;
|
56
56
|
}
|
57
|
-
var
|
58
|
-
function
|
59
|
-
if (Ve) return
|
57
|
+
var be, Ve;
|
58
|
+
function pn() {
|
59
|
+
if (Ve) return be;
|
60
60
|
Ve = 1;
|
61
|
-
var e =
|
61
|
+
var e = Ot(), t = function() {
|
62
62
|
return e.Date.now();
|
63
63
|
};
|
64
|
-
return
|
64
|
+
return be = t, be;
|
65
65
|
}
|
66
|
-
var
|
67
|
-
function
|
68
|
-
if (Ze) return
|
66
|
+
var ve, Ze;
|
67
|
+
function fn() {
|
68
|
+
if (Ze) return ve;
|
69
69
|
Ze = 1;
|
70
70
|
var e = /\s/;
|
71
71
|
function t(n) {
|
@@ -73,28 +73,28 @@ function gn() {
|
|
73
73
|
;
|
74
74
|
return a;
|
75
75
|
}
|
76
|
-
return
|
76
|
+
return ve = t, ve;
|
77
77
|
}
|
78
|
-
var
|
78
|
+
var Te, et;
|
79
79
|
function hn() {
|
80
|
-
if (et) return
|
80
|
+
if (et) return Te;
|
81
81
|
et = 1;
|
82
|
-
var e =
|
82
|
+
var e = fn(), t = /^\s+/;
|
83
83
|
function n(a) {
|
84
84
|
return a && a.slice(0, e(a) + 1).replace(t, "");
|
85
85
|
}
|
86
|
-
return
|
86
|
+
return Te = n, Te;
|
87
87
|
}
|
88
|
-
var
|
88
|
+
var ye, tt;
|
89
89
|
function xt() {
|
90
|
-
if (tt) return
|
90
|
+
if (tt) return ye;
|
91
91
|
tt = 1;
|
92
|
-
var e =
|
93
|
-
return
|
92
|
+
var e = Ot(), t = e.Symbol;
|
93
|
+
return ye = t, ye;
|
94
94
|
}
|
95
|
-
var
|
96
|
-
function
|
97
|
-
if (nt) return
|
95
|
+
var Se, nt;
|
96
|
+
function bn() {
|
97
|
+
if (nt) return Se;
|
98
98
|
nt = 1;
|
99
99
|
var e = xt(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
100
100
|
function i(c) {
|
@@ -107,30 +107,30 @@ function pn() {
|
|
107
107
|
var m = a.call(c);
|
108
108
|
return l && (d ? c[o] = u : delete c[o]), m;
|
109
109
|
}
|
110
|
-
return
|
110
|
+
return Se = i, Se;
|
111
111
|
}
|
112
|
-
var
|
113
|
-
function
|
114
|
-
if (rt) return
|
112
|
+
var Ee, rt;
|
113
|
+
function vn() {
|
114
|
+
if (rt) return Ee;
|
115
115
|
rt = 1;
|
116
116
|
var e = Object.prototype, t = e.toString;
|
117
117
|
function n(a) {
|
118
118
|
return t.call(a);
|
119
119
|
}
|
120
|
-
return
|
120
|
+
return Ee = n, Ee;
|
121
121
|
}
|
122
|
-
var
|
123
|
-
function
|
124
|
-
if (at) return
|
122
|
+
var Ce, at;
|
123
|
+
function Tn() {
|
124
|
+
if (at) return Ce;
|
125
125
|
at = 1;
|
126
|
-
var e = xt(), t =
|
126
|
+
var e = xt(), t = bn(), n = vn(), a = "[object Null]", o = "[object Undefined]", i = e ? e.toStringTag : void 0;
|
127
127
|
function c(d) {
|
128
128
|
return d == null ? d === void 0 ? o : a : i && i in Object(d) ? t(d) : n(d);
|
129
129
|
}
|
130
|
-
return
|
130
|
+
return Ce = c, Ce;
|
131
131
|
}
|
132
132
|
var we, ot;
|
133
|
-
function
|
133
|
+
function yn() {
|
134
134
|
if (ot) return we;
|
135
135
|
ot = 1;
|
136
136
|
function e(t) {
|
@@ -138,21 +138,21 @@ function Tn() {
|
|
138
138
|
}
|
139
139
|
return we = e, we;
|
140
140
|
}
|
141
|
-
var
|
142
|
-
function
|
143
|
-
if (st) return
|
141
|
+
var Pe, st;
|
142
|
+
function Sn() {
|
143
|
+
if (st) return Pe;
|
144
144
|
st = 1;
|
145
|
-
var e =
|
145
|
+
var e = Tn(), t = yn(), n = "[object Symbol]";
|
146
146
|
function a(o) {
|
147
147
|
return typeof o == "symbol" || t(o) && e(o) == n;
|
148
148
|
}
|
149
|
-
return
|
149
|
+
return Pe = a, Pe;
|
150
150
|
}
|
151
|
-
var
|
152
|
-
function
|
153
|
-
if (it) return
|
151
|
+
var Ae, it;
|
152
|
+
function En() {
|
153
|
+
if (it) return Ae;
|
154
154
|
it = 1;
|
155
|
-
var e = hn(), t = Be(), n =
|
155
|
+
var e = hn(), t = Be(), n = Sn(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, c = /^0o[0-7]+$/i, d = parseInt;
|
156
156
|
function u(l) {
|
157
157
|
if (typeof l == "number")
|
158
158
|
return l;
|
@@ -165,72 +165,72 @@ function Sn() {
|
|
165
165
|
if (typeof l != "string")
|
166
166
|
return l === 0 ? l : +l;
|
167
167
|
l = e(l);
|
168
|
-
var
|
169
|
-
return
|
168
|
+
var g = i.test(l);
|
169
|
+
return g || c.test(l) ? d(l.slice(2), g ? 2 : 8) : o.test(l) ? a : +l;
|
170
170
|
}
|
171
|
-
return
|
171
|
+
return Ae = u, Ae;
|
172
172
|
}
|
173
|
-
var
|
174
|
-
function
|
175
|
-
if (ct) return
|
173
|
+
var ke, ct;
|
174
|
+
function Lt() {
|
175
|
+
if (ct) return ke;
|
176
176
|
ct = 1;
|
177
|
-
var e = Be(), t =
|
177
|
+
var e = Be(), t = pn(), n = En(), a = "Expected a function", o = Math.max, i = Math.min;
|
178
178
|
function c(d, u, l) {
|
179
|
-
var m,
|
179
|
+
var m, g, T, y, _, E, b = 0, p = !1, h = !1, v = !0;
|
180
180
|
if (typeof d != "function")
|
181
181
|
throw new TypeError(a);
|
182
|
-
u = n(u) || 0, e(l) && (
|
183
|
-
function C(S) {
|
184
|
-
var j = m, $ = _;
|
185
|
-
return m = _ = void 0, b = S, y = d.apply($, j), y;
|
186
|
-
}
|
182
|
+
u = n(u) || 0, e(l) && (p = !!l.leading, h = "maxWait" in l, T = h ? o(n(l.maxWait) || 0, u) : T, v = "trailing" in l ? !!l.trailing : v);
|
187
183
|
function w(S) {
|
188
|
-
|
184
|
+
var N = m, G = g;
|
185
|
+
return m = g = void 0, b = S, y = d.apply(G, N), y;
|
186
|
+
}
|
187
|
+
function C(S) {
|
188
|
+
return b = S, _ = setTimeout(te, u), p ? w(S) : y;
|
189
189
|
}
|
190
190
|
function ee(S) {
|
191
|
-
var
|
192
|
-
return
|
191
|
+
var N = S - E, G = S - b, Je = u - N;
|
192
|
+
return h ? i(Je, T - G) : Je;
|
193
193
|
}
|
194
194
|
function Ke(S) {
|
195
|
-
var
|
196
|
-
return E === void 0 ||
|
195
|
+
var N = S - E, G = S - b;
|
196
|
+
return E === void 0 || N >= u || N < 0 || h && G >= T;
|
197
197
|
}
|
198
198
|
function te() {
|
199
199
|
var S = t();
|
200
200
|
if (Ke(S))
|
201
201
|
return ze(S);
|
202
|
-
|
202
|
+
_ = setTimeout(te, ee(S));
|
203
203
|
}
|
204
204
|
function ze(S) {
|
205
|
-
return
|
205
|
+
return _ = void 0, v && m ? w(S) : (m = g = void 0, y);
|
206
206
|
}
|
207
|
-
function
|
208
|
-
|
207
|
+
function Vt() {
|
208
|
+
_ !== void 0 && clearTimeout(_), b = 0, m = E = g = _ = void 0;
|
209
209
|
}
|
210
|
-
function
|
211
|
-
return
|
210
|
+
function Zt() {
|
211
|
+
return _ === void 0 ? y : ze(t());
|
212
212
|
}
|
213
|
-
function
|
214
|
-
var S = t(),
|
215
|
-
if (m = arguments,
|
216
|
-
if (
|
217
|
-
return
|
218
|
-
if (
|
219
|
-
return clearTimeout(
|
213
|
+
function ge() {
|
214
|
+
var S = t(), N = Ke(S);
|
215
|
+
if (m = arguments, g = this, E = S, N) {
|
216
|
+
if (_ === void 0)
|
217
|
+
return C(E);
|
218
|
+
if (h)
|
219
|
+
return clearTimeout(_), _ = setTimeout(te, u), w(E);
|
220
220
|
}
|
221
|
-
return
|
221
|
+
return _ === void 0 && (_ = setTimeout(te, u)), y;
|
222
222
|
}
|
223
|
-
return
|
223
|
+
return ge.cancel = Vt, ge.flush = Zt, ge;
|
224
224
|
}
|
225
|
-
return
|
225
|
+
return ke = c, ke;
|
226
226
|
}
|
227
|
-
var
|
228
|
-
const wn = /* @__PURE__ */ Nt(
|
227
|
+
var Cn = Lt();
|
228
|
+
const wn = /* @__PURE__ */ Nt(Cn);
|
229
229
|
var Ie, lt;
|
230
|
-
function
|
230
|
+
function Pn() {
|
231
231
|
if (lt) return Ie;
|
232
232
|
lt = 1;
|
233
|
-
var e =
|
233
|
+
var e = Lt(), t = Be(), n = "Expected a function";
|
234
234
|
function a(o, i, c) {
|
235
235
|
var d = !0, u = !0;
|
236
236
|
if (typeof o != "function")
|
@@ -243,34 +243,34 @@ function Cn() {
|
|
243
243
|
}
|
244
244
|
return Ie = a, Ie;
|
245
245
|
}
|
246
|
-
var
|
247
|
-
const
|
246
|
+
var An = Pn();
|
247
|
+
const kn = /* @__PURE__ */ Nt(An), In = (e, t, n, a) => {
|
248
248
|
switch (t) {
|
249
249
|
case "debounce":
|
250
250
|
return wn(e, n, a);
|
251
251
|
case "throttle":
|
252
|
-
return
|
252
|
+
return kn(e, n, a);
|
253
253
|
default:
|
254
254
|
return e;
|
255
255
|
}
|
256
|
-
},
|
256
|
+
}, Rn = (
|
257
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
258
258
|
(e) => {
|
259
|
-
const t =
|
260
|
-
return
|
259
|
+
const t = K.useRef(e);
|
260
|
+
return K.useEffect(() => {
|
261
261
|
t.current = e;
|
262
|
-
}),
|
262
|
+
}), K.useMemo(() => (...n) => {
|
263
263
|
var a;
|
264
264
|
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
265
265
|
}, []);
|
266
266
|
}
|
267
|
-
),
|
267
|
+
), jn = (
|
268
268
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
269
269
|
(e) => {
|
270
|
-
const [t, n] =
|
270
|
+
const [t, n] = K.useState((e == null ? void 0 : e.current) || null);
|
271
271
|
return e && setTimeout(() => {
|
272
272
|
e.current !== t && n(e.current);
|
273
|
-
}, 0), { refProxy:
|
273
|
+
}, 0), { refProxy: K.useMemo(() => new Proxy((o) => {
|
274
274
|
o !== t && n(o);
|
275
275
|
}, {
|
276
276
|
get(o, i) {
|
@@ -291,81 +291,81 @@ const Pn = /* @__PURE__ */ Nt(kn), In = (e, t, n, a) => {
|
|
291
291
|
width: e.contentRect.width,
|
292
292
|
height: e.contentRect.height
|
293
293
|
};
|
294
|
-
function
|
295
|
-
const l =
|
294
|
+
function On({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: i = !0, targetRef: c, observerOptions: d, onResize: u } = {}) {
|
295
|
+
const l = Ct(e), m = Rn(u), [g, T] = R({
|
296
296
|
width: void 0,
|
297
297
|
height: void 0
|
298
|
-
}), { refProxy: y, refElement:
|
298
|
+
}), { refProxy: y, refElement: _ } = jn(c), { box: E } = d || {}, b = We((h) => {
|
299
299
|
if (!o && !i)
|
300
300
|
return;
|
301
301
|
if (l.current) {
|
302
302
|
l.current = !1;
|
303
303
|
return;
|
304
304
|
}
|
305
|
-
const v = (
|
306
|
-
|
307
|
-
const
|
308
|
-
T((ee) => v(ee,
|
309
|
-
width:
|
310
|
-
height:
|
311
|
-
entry:
|
312
|
-
}),
|
305
|
+
const v = (w, C) => o && w.width !== C.width || i && w.height !== C.height;
|
306
|
+
h.forEach((w) => {
|
307
|
+
const C = Nn(w, E);
|
308
|
+
T((ee) => v(ee, C) ? (m == null || m({
|
309
|
+
width: C.width,
|
310
|
+
height: C.height,
|
311
|
+
entry: w
|
312
|
+
}), C) : ee);
|
313
313
|
});
|
314
|
-
}, [o, i, l, E]),
|
314
|
+
}, [o, i, l, E]), p = We(In(b, t, n, a), [
|
315
315
|
b,
|
316
316
|
t,
|
317
317
|
n,
|
318
318
|
a
|
319
319
|
]);
|
320
|
-
return
|
321
|
-
let
|
322
|
-
return
|
320
|
+
return J(() => {
|
321
|
+
let h;
|
322
|
+
return _ ? (h = new window.ResizeObserver(p), h.observe(_, d)) : (g.width || g.height) && (m == null || m({
|
323
323
|
width: null,
|
324
324
|
height: null,
|
325
325
|
entry: null
|
326
326
|
}), T({ width: void 0, height: void 0 })), () => {
|
327
|
-
var v,
|
328
|
-
(v =
|
327
|
+
var v, w, C;
|
328
|
+
(v = h == null ? void 0 : h.disconnect) === null || v === void 0 || v.call(h), (C = (w = p).cancel) === null || C === void 0 || C.call(w);
|
329
329
|
};
|
330
|
-
}, [
|
330
|
+
}, [p, _]), Object.assign({ ref: y }, g);
|
331
331
|
}
|
332
|
-
function
|
332
|
+
function Mt(e) {
|
333
333
|
var t, n, a = "";
|
334
334
|
if (typeof e == "string" || typeof e == "number") a += e;
|
335
335
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
336
336
|
var o = e.length;
|
337
|
-
for (t = 0; t < o; t++) e[t] && (n =
|
337
|
+
for (t = 0; t < o; t++) e[t] && (n = Mt(e[t])) && (a && (a += " "), a += n);
|
338
338
|
} else for (n in e) e[n] && (a && (a += " "), a += n);
|
339
339
|
return a;
|
340
340
|
}
|
341
|
-
function
|
342
|
-
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t =
|
341
|
+
function j() {
|
342
|
+
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Mt(e)) && (a && (a += " "), a += t);
|
343
343
|
return a;
|
344
344
|
}
|
345
|
-
const xn = "_headerContainer_1cubo_1",
|
345
|
+
const xn = "_headerContainer_1cubo_1", Ln = "_navigationTabList_1cubo_8", Mn = "_navigationTab_1cubo_8", Un = "_headerContent_1cubo_34", Hn = "_staticEnabled_1cubo_50", q = {
|
346
346
|
headerContainer: xn,
|
347
|
-
navigationTabList:
|
348
|
-
navigationTab:
|
349
|
-
headerContent:
|
350
|
-
staticEnabled:
|
351
|
-
},
|
352
|
-
const { ref: n, height: a } =
|
347
|
+
navigationTabList: Ln,
|
348
|
+
navigationTab: Mn,
|
349
|
+
headerContent: Un,
|
350
|
+
staticEnabled: Hn
|
351
|
+
}, qn = 77, oe = ({ sticky: e, children: t }) => {
|
352
|
+
const { ref: n, height: a } = On({
|
353
353
|
refreshMode: "debounce",
|
354
354
|
refreshRate: 0
|
355
355
|
}), [o, i] = R(!1), c = () => o ? !e : !0;
|
356
|
-
|
356
|
+
J(() => {
|
357
357
|
const u = () => {
|
358
358
|
i(window.scrollY > 0);
|
359
359
|
};
|
360
360
|
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
361
361
|
}, []);
|
362
|
-
const d = `${a ||
|
363
|
-
return /* @__PURE__ */ s("div", { style: { minHeight: d }, children: /* @__PURE__ */ s("div", { children: /* @__PURE__ */
|
362
|
+
const d = `${a || qn}px`;
|
363
|
+
return /* @__PURE__ */ s("div", { style: { minHeight: d }, children: /* @__PURE__ */ s("div", { children: /* @__PURE__ */ f(
|
364
364
|
"div",
|
365
365
|
{
|
366
366
|
ref: n,
|
367
|
-
className:
|
368
|
-
[
|
367
|
+
className: j(q.headerContent, {
|
368
|
+
[q.staticEnabled]: c()
|
369
369
|
}),
|
370
370
|
children: [
|
371
371
|
/* @__PURE__ */ s(oe.Header, {}),
|
@@ -375,40 +375,40 @@ const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "
|
|
375
375
|
}
|
376
376
|
) }) });
|
377
377
|
};
|
378
|
-
oe.Header = ({ children: e }) => /* @__PURE__ */ s("div", { className:
|
378
|
+
oe.Header = ({ children: e }) => /* @__PURE__ */ s("div", { className: q.headerContainer, children: e });
|
379
379
|
oe.Tabs = ({ children: e }) => /* @__PURE__ */ s("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
380
|
-
const
|
381
|
-
sidebarContainer:
|
382
|
-
},
|
383
|
-
logoLink:
|
380
|
+
const Bn = "_sidebarContainer_bmdti_1", Dn = {
|
381
|
+
sidebarContainer: Bn
|
382
|
+
}, $n = "_logoLink_1baxb_1", Gn = {
|
383
|
+
logoLink: $n
|
384
384
|
}, Fn = ({
|
385
385
|
src: e,
|
386
386
|
href: t = "/",
|
387
387
|
ariaLabel: n = "Lokalise App Home",
|
388
388
|
alt: a = "Lokalise Logo"
|
389
|
-
}) => /* @__PURE__ */ s("a", { className:
|
390
|
-
link:
|
391
|
-
active:
|
392
|
-
},
|
393
|
-
|
389
|
+
}) => /* @__PURE__ */ s("a", { className: Gn.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ s("img", { src: e, alt: a }) }), Kn = "_link_18vhx_1", zn = "_active_18vhx_18", dt = {
|
390
|
+
link: Kn,
|
391
|
+
active: zn
|
392
|
+
}, Jn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ s(B, { placement: "right", tooltip: e, children: /* @__PURE__ */ s(
|
393
|
+
M,
|
394
394
|
{
|
395
|
-
className:
|
395
|
+
className: j(dt.link, {
|
396
396
|
[dt.active]: window.location.pathname.startsWith(t)
|
397
397
|
}),
|
398
398
|
href: t,
|
399
399
|
children: /* @__PURE__ */ s(n, { size: "25px" })
|
400
400
|
}
|
401
|
-
) }),
|
402
|
-
dropdownButton:
|
403
|
-
dropdownButtonActive:
|
404
|
-
},
|
401
|
+
) }), Wn = "_dropdownButton_13l5r_1", Qn = "_dropdownButtonActive_13l5r_18", ut = {
|
402
|
+
dropdownButton: Wn,
|
403
|
+
dropdownButtonActive: Qn
|
404
|
+
}, Yn = ({ children: e, icon: t }) => /* @__PURE__ */ s(
|
405
405
|
ce,
|
406
406
|
{
|
407
|
-
menuButton: ({ opened: n }) => /* @__PURE__ */ s(
|
407
|
+
menuButton: ({ opened: n }) => /* @__PURE__ */ s(B, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ s(
|
408
408
|
"button",
|
409
409
|
{
|
410
410
|
type: "button",
|
411
|
-
className:
|
411
|
+
className: j(ut.dropdownButton, {
|
412
412
|
[ut.dropdownButtonActive]: n
|
413
413
|
}),
|
414
414
|
children: /* @__PURE__ */ s(t, { size: "25px" })
|
@@ -416,29 +416,29 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
416
416
|
) }),
|
417
417
|
children: /* @__PURE__ */ s(le, { placement: "right-start", children: e })
|
418
418
|
}
|
419
|
-
), Xn = "_iconContainer_nz34m_1",
|
419
|
+
), Xn = "_iconContainer_nz34m_1", Vn = {
|
420
420
|
iconContainer: Xn
|
421
|
-
},
|
421
|
+
}, Ut = ({ className: e = "" }) => /* @__PURE__ */ s(
|
422
422
|
"div",
|
423
423
|
{
|
424
424
|
"aria-label": "Upgrade Icon",
|
425
|
-
className:
|
426
|
-
|
425
|
+
className: j(
|
426
|
+
Vn.iconContainer,
|
427
427
|
"flex-row",
|
428
428
|
"items-center",
|
429
429
|
"justify-center",
|
430
430
|
e
|
431
431
|
),
|
432
|
-
children: /* @__PURE__ */ s(
|
432
|
+
children: /* @__PURE__ */ s(an, {})
|
433
433
|
}
|
434
|
-
),
|
435
|
-
menuContainer:
|
436
|
-
profileButton:
|
437
|
-
profileImage:
|
438
|
-
profileImageHighlight:
|
439
|
-
profileImageUpgradeIcon:
|
440
|
-
userIconWrapper:
|
441
|
-
},
|
434
|
+
), Zn = "_menuContainer_1phdw_10", er = "_profileButton_1phdw_20", tr = "_profileImage_1phdw_33", nr = "_profileImageHighlight_1phdw_41", rr = "_profileImageUpgradeIcon_1phdw_45", ar = "_userIconWrapper_1phdw_51", x = {
|
435
|
+
menuContainer: Zn,
|
436
|
+
profileButton: er,
|
437
|
+
profileImage: tr,
|
438
|
+
profileImageHighlight: nr,
|
439
|
+
profileImageUpgradeIcon: rr,
|
440
|
+
userIconWrapper: ar
|
441
|
+
}, Ht = Pt({}), X = () => wt(Ht), or = ({ children: e }) => {
|
442
442
|
const {
|
443
443
|
currentTeam: t,
|
444
444
|
otherTeams: n,
|
@@ -454,12 +454,12 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
454
454
|
return /* @__PURE__ */ s(
|
455
455
|
ce,
|
456
456
|
{
|
457
|
-
menuButton: () => /* @__PURE__ */
|
457
|
+
menuButton: () => /* @__PURE__ */ f("button", { className: x.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
458
458
|
t != null && t.logoUrl ? /* @__PURE__ */ s(
|
459
459
|
"img",
|
460
460
|
{
|
461
461
|
src: t.logoUrl,
|
462
|
-
className:
|
462
|
+
className: j(x.profileImage, {
|
463
463
|
[x.profileImageHighlight]: a
|
464
464
|
}),
|
465
465
|
alt: "Team Logo"
|
@@ -467,13 +467,13 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
467
467
|
) : /* @__PURE__ */ s(
|
468
468
|
"div",
|
469
469
|
{
|
470
|
-
className:
|
470
|
+
className: j(x.userIconWrapper, "flex-row", "align-center", "items-center", {
|
471
471
|
[x.profileImageHighlight]: a
|
472
472
|
}),
|
473
|
-
children: /* @__PURE__ */ s(
|
473
|
+
children: /* @__PURE__ */ s(kt, { size: "25px" })
|
474
474
|
}
|
475
475
|
),
|
476
|
-
a && /* @__PURE__ */ s(
|
476
|
+
a && /* @__PURE__ */ s(Ut, { className: x.profileImageUpgradeIcon })
|
477
477
|
] }),
|
478
478
|
children: /* @__PURE__ */ s(le, { placement: "right-end", className: x.menuContainer, children: e({
|
479
479
|
allowTeamCreation: i,
|
@@ -487,7 +487,7 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
487
487
|
}) })
|
488
488
|
}
|
489
489
|
);
|
490
|
-
},
|
490
|
+
}, qt = 0, sr = 9999, ir = [150, 151, 250, 251], cr = [152, 153, 252, 253], lr = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], dr = [156, 159, 160, 256, 259, 260], Bt = 9998, De = (e) => e === qt, Dt = (e) => e === sr, Do = (e) => ir.includes(e), $o = (e) => cr.includes(e), Go = (e) => lr.includes(e), Fo = (e) => dr.includes(e), Ko = (e) => e > qt && e < Bt, zo = (e) => e === Bt, ur = /\n/, mt = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [nn(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), mr = (e, t, n) => typeof e == "string" ? mt(e, t, n) : e.flatMap((a) => typeof a == "string" ? mt(a, t, n) : a), _r = (e) => mr(e, ur, /* @__PURE__ */ s("br", {})), gr = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, pr = (e) => e.match(gr) ?? [], _t = (e, t, n) => {
|
491
491
|
const a = e.split(t);
|
492
492
|
if (a.length === 1)
|
493
493
|
return e;
|
@@ -495,138 +495,140 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
495
495
|
return a[0] !== "" && o.push(a[0]), a.shift(), a[a.length - 1] === "" && a.pop(), o.push(
|
496
496
|
/* @__PURE__ */ s("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
497
497
|
), o.push(a.join(t)), o.filter((i) => i !== "");
|
498
|
-
},
|
499
|
-
const t =
|
500
|
-
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ?
|
501
|
-
},
|
502
|
-
|
503
|
-
},
|
498
|
+
}, gt = (e) => {
|
499
|
+
const t = pr(e);
|
500
|
+
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? _t(n, a, o) : n.flatMap((i) => typeof i == "string" ? _t(i, a, o) : i), e) : e;
|
501
|
+
}, fr = (e) => typeof e == "string" ? gt(e) : e.flatMap((t) => typeof t == "string" ? gt(t) : t, e), hr = (e, t = "PP") => Rt(e, t), Jo = (e, t, n = "PP") => Rt(_n(e, t), n), $e = (e) => {
|
502
|
+
J(e, []);
|
503
|
+
}, pt = {
|
504
504
|
biller: "biller",
|
505
505
|
owner: "owner"
|
506
|
-
},
|
507
|
-
|
508
|
-
|
509
|
-
],
|
510
|
-
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: d } = t, u = n.find((
|
506
|
+
}, ft = [
|
507
|
+
pt.biller,
|
508
|
+
pt.owner
|
509
|
+
], br = ({ children: e, config: t }) => {
|
510
|
+
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: d } = t, u = n.find((p) => p.id === a), l = n.filter((p) => p.id !== a), m = ft.includes(d), g = ft.includes(d), T = De(o) || Dt(o), b = {
|
511
511
|
...t,
|
512
512
|
currentTeam: u,
|
513
513
|
otherTeams: l,
|
514
514
|
canChangeBilling: m,
|
515
|
-
canAccessTeamSettings:
|
515
|
+
canAccessTeamSettings: g,
|
516
516
|
isOnFreeOrTrialPlan: T,
|
517
517
|
showUpgradeCta: c && T && m,
|
518
|
-
showBillingButton: c &&
|
518
|
+
showBillingButton: c && g && m,
|
519
519
|
allowTeamCreation: c && !i
|
520
520
|
};
|
521
|
-
return /* @__PURE__ */ s(
|
522
|
-
},
|
523
|
-
container:
|
524
|
-
profileEmail:
|
525
|
-
},
|
521
|
+
return /* @__PURE__ */ s(Ht.Provider, { value: b, children: e });
|
522
|
+
}, vr = ({ config: e, children: t }) => /* @__PURE__ */ s(br, { config: e, children: /* @__PURE__ */ s(or, { children: t }) }), Tr = "_container_q5pot_1", yr = "_profileEmail_q5pot_5", ht = {
|
523
|
+
container: Tr,
|
524
|
+
profileEmail: yr
|
525
|
+
}, Sr = ({
|
526
526
|
href: e,
|
527
527
|
onClick: t,
|
528
528
|
userEmail: n,
|
529
529
|
hideBottomDivider: a
|
530
530
|
}) => {
|
531
531
|
const { isEndOfTrialActive: o, isTeamSuspended: i } = X();
|
532
|
-
return o || i ? null : /* @__PURE__ */
|
532
|
+
return o || i ? null : /* @__PURE__ */ f(He, { children: [
|
533
533
|
/* @__PURE__ */ s(
|
534
|
-
|
534
|
+
W,
|
535
535
|
{
|
536
536
|
href: e,
|
537
537
|
onClick: () => {
|
538
538
|
t == null || t();
|
539
539
|
},
|
540
|
-
children: /* @__PURE__ */
|
540
|
+
children: /* @__PURE__ */ f("div", { className: `flex-col ${ht.container}`, children: [
|
541
541
|
/* @__PURE__ */ s("span", { children: "Profile Settings" }),
|
542
|
-
/* @__PURE__ */ s("span", { className:
|
542
|
+
/* @__PURE__ */ s("span", { className: ht.profileEmail, children: n })
|
543
543
|
] })
|
544
544
|
}
|
545
545
|
),
|
546
|
-
!a && /* @__PURE__ */ s(
|
546
|
+
!a && /* @__PURE__ */ s(It, {})
|
547
547
|
] });
|
548
|
-
},
|
549
|
-
wrapper:
|
550
|
-
profileImage:
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
548
|
+
}, Er = "_wrapper_1in7x_5", Cr = "_profileImage_1in7x_11", wr = "_teamDetails_1in7x_19", Pr = "_planWrapper_1in7x_28", Ar = "_teamName_1in7x_36", kr = "_planLabel_1in7x_45", Ir = "_membership_1in7x_53", Rr = "_defaultProfileImage_1in7x_59", O = {
|
549
|
+
wrapper: Er,
|
550
|
+
profileImage: Cr,
|
551
|
+
teamDetails: wr,
|
552
|
+
planWrapper: Pr,
|
553
|
+
teamName: Ar,
|
554
|
+
planLabel: kr,
|
555
|
+
membership: Ir,
|
556
|
+
defaultProfileImage: Rr
|
557
|
+
}, $t = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
556
558
|
const { currentTeam: a, planId: o } = X(), i = e || a;
|
557
559
|
if (!i)
|
558
560
|
return null;
|
559
|
-
const c = De(o) ? "Free" :
|
560
|
-
return /* @__PURE__ */
|
561
|
-
t ?
|
561
|
+
const c = De(o) ? "Free" : Dt(o) ? "Trial" : void 0;
|
562
|
+
return /* @__PURE__ */ f(
|
563
|
+
t ? W : "div",
|
562
564
|
{
|
563
|
-
className:
|
565
|
+
className: O.wrapper,
|
564
566
|
...t && { onClick: () => t(i) },
|
565
567
|
children: [
|
566
|
-
i.logoUrl ? /* @__PURE__ */ s("img", { className:
|
567
|
-
/* @__PURE__ */
|
568
|
-
/* @__PURE__ */
|
569
|
-
/* @__PURE__ */ s("span", {
|
570
|
-
c && !n && /* @__PURE__ */ s("span", { className:
|
568
|
+
i.logoUrl ? /* @__PURE__ */ s("img", { className: O.profileImage, src: i.logoUrl, alt: "" }) : /* @__PURE__ */ s("span", { className: `${O.defaultProfileImage}`, children: /* @__PURE__ */ s(kt, { size: "25px" }) }),
|
569
|
+
/* @__PURE__ */ f("div", { className: O.teamDetails, children: [
|
570
|
+
/* @__PURE__ */ f("div", { className: O.planWrapper, children: [
|
571
|
+
/* @__PURE__ */ s("span", { className: O.teamName, children: i.name }),
|
572
|
+
c && !n && /* @__PURE__ */ s("span", { className: `${O.planLabel}`, children: c })
|
571
573
|
] }),
|
572
|
-
/* @__PURE__ */ s("span", { className:
|
574
|
+
/* @__PURE__ */ s("span", { className: O.membership, children: i.role })
|
573
575
|
] })
|
574
576
|
]
|
575
577
|
}
|
576
578
|
);
|
577
|
-
},
|
578
|
-
teamsContainer:
|
579
|
-
},
|
579
|
+
}, jr = "_teamsContainer_1ncrr_5", Nr = {
|
580
|
+
teamsContainer: jr
|
581
|
+
}, Or = ({ onSwitchTeam: e }) => {
|
580
582
|
const { otherTeams: t } = X();
|
581
583
|
return t.length === 0 ? null : /* @__PURE__ */ s(
|
582
584
|
"div",
|
583
585
|
{
|
584
586
|
"data-testid": "sidebar-team-switch",
|
585
|
-
className: `flex-col items-stretch ${
|
586
|
-
children: t.map((n) => /* @__PURE__ */ s(
|
587
|
+
className: `flex-col items-stretch ${Nr.teamsContainer}`,
|
588
|
+
children: t.map((n) => /* @__PURE__ */ s($t, { team: n, onClick: e, hidePlanLabel: !0 }, n.id))
|
587
589
|
}
|
588
590
|
);
|
589
|
-
},
|
590
|
-
container:
|
591
|
-
planCta:
|
592
|
-
upgradeIconWrapper:
|
593
|
-
},
|
591
|
+
}, xr = "_container_1u995_1", Lr = "_planCta_1u995_15", Mr = "_upgradeIconWrapper_1u995_19", Re = {
|
592
|
+
container: xr,
|
593
|
+
planCta: Lr,
|
594
|
+
upgradeIconWrapper: Mr
|
595
|
+
}, Ur = ({ upgradeOptionHref: e }) => {
|
594
596
|
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = X();
|
595
597
|
if (!a)
|
596
598
|
return null;
|
597
599
|
const c = De(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
598
|
-
return /* @__PURE__ */
|
599
|
-
|
600
|
+
return /* @__PURE__ */ f(
|
601
|
+
W,
|
600
602
|
{
|
601
603
|
"data-testid": "sidebar-upgrade-menu-item",
|
602
604
|
href: e,
|
603
|
-
className: `flex-col gap-1 items-start ${
|
605
|
+
className: `flex-col gap-1 items-start ${Re.container}`,
|
604
606
|
children: [
|
605
|
-
/* @__PURE__ */ s("span", { className:
|
606
|
-
/* @__PURE__ */
|
607
|
-
/* @__PURE__ */ s(
|
607
|
+
/* @__PURE__ */ s("span", { className: Re.planCta, children: c }),
|
608
|
+
/* @__PURE__ */ f("div", { className: `flex-row items-center gap-1 ${Re.upgradeIconWrapper}`, children: [
|
609
|
+
/* @__PURE__ */ s(Ut, {}),
|
608
610
|
/* @__PURE__ */ s("span", { children: "See upgrade options" })
|
609
611
|
] })
|
610
612
|
]
|
611
613
|
}
|
612
614
|
);
|
613
|
-
},
|
615
|
+
}, Hr = Math.min, qr = Math.max;
|
614
616
|
function bt(e, t, n) {
|
615
|
-
return
|
617
|
+
return qr(e, Hr(t, n));
|
616
618
|
}
|
617
|
-
function
|
619
|
+
function Gt(e, t) {
|
618
620
|
return typeof e == "function" ? e(t) : e;
|
619
621
|
}
|
620
622
|
function Ft(e) {
|
621
623
|
return e.split("-")[0];
|
622
624
|
}
|
623
|
-
function
|
625
|
+
function Br(e) {
|
624
626
|
return e === "x" ? "y" : "x";
|
625
627
|
}
|
626
|
-
function
|
628
|
+
function Dr(e) {
|
627
629
|
return ["top", "bottom"].includes(Ft(e)) ? "y" : "x";
|
628
630
|
}
|
629
|
-
function
|
631
|
+
function $r(e) {
|
630
632
|
return {
|
631
633
|
top: 0,
|
632
634
|
right: 0,
|
@@ -635,8 +637,8 @@ function qr(e) {
|
|
635
637
|
...e
|
636
638
|
};
|
637
639
|
}
|
638
|
-
function
|
639
|
-
return typeof e != "number" ?
|
640
|
+
function Gr(e) {
|
641
|
+
return typeof e != "number" ? $r(e) : {
|
640
642
|
top: e,
|
641
643
|
right: e,
|
642
644
|
bottom: e,
|
@@ -661,7 +663,7 @@ function vt(e) {
|
|
661
663
|
y: n
|
662
664
|
};
|
663
665
|
}
|
664
|
-
async function
|
666
|
+
async function Fr(e, t) {
|
665
667
|
var n;
|
666
668
|
t === void 0 && (t = {});
|
667
669
|
const {
|
@@ -674,39 +676,39 @@ async function Dr(e, t) {
|
|
674
676
|
} = e, {
|
675
677
|
boundary: l = "clippingAncestors",
|
676
678
|
rootBoundary: m = "viewport",
|
677
|
-
elementContext:
|
679
|
+
elementContext: g = "floating",
|
678
680
|
altBoundary: T = !1,
|
679
681
|
padding: y = 0
|
680
|
-
} =
|
682
|
+
} = Gt(t, e), _ = Gr(y), b = d[T ? g === "floating" ? "reference" : "floating" : g], p = vt(await i.getClippingRect({
|
681
683
|
element: (n = await (i.isElement == null ? void 0 : i.isElement(b))) == null || n ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(d.floating)),
|
682
684
|
boundary: l,
|
683
685
|
rootBoundary: m,
|
684
686
|
strategy: u
|
685
|
-
})),
|
687
|
+
})), h = g === "floating" ? {
|
686
688
|
x: a,
|
687
689
|
y: o,
|
688
690
|
width: c.floating.width,
|
689
691
|
height: c.floating.height
|
690
|
-
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d.floating)),
|
692
|
+
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d.floating)), w = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
691
693
|
x: 1,
|
692
694
|
y: 1
|
693
695
|
} : {
|
694
696
|
x: 1,
|
695
697
|
y: 1
|
696
|
-
},
|
698
|
+
}, C = vt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
697
699
|
elements: d,
|
698
|
-
rect:
|
700
|
+
rect: h,
|
699
701
|
offsetParent: v,
|
700
702
|
strategy: u
|
701
|
-
}) :
|
703
|
+
}) : h);
|
702
704
|
return {
|
703
|
-
top: (
|
704
|
-
bottom: (
|
705
|
-
left: (
|
706
|
-
right: (
|
705
|
+
top: (p.top - C.top + _.top) / w.y,
|
706
|
+
bottom: (C.bottom - p.bottom + _.bottom) / w.y,
|
707
|
+
left: (p.left - C.left + _.left) / w.x,
|
708
|
+
right: (C.right - p.right + _.right) / w.x
|
707
709
|
};
|
708
710
|
}
|
709
|
-
const
|
711
|
+
const Kr = function(e) {
|
710
712
|
return e === void 0 && (e = {}), {
|
711
713
|
name: "shift",
|
712
714
|
options: e,
|
@@ -721,33 +723,33 @@ const $r = function(e) {
|
|
721
723
|
limiter: d = {
|
722
724
|
fn: (b) => {
|
723
725
|
let {
|
724
|
-
x:
|
725
|
-
y:
|
726
|
+
x: p,
|
727
|
+
y: h
|
726
728
|
} = b;
|
727
729
|
return {
|
728
|
-
x:
|
729
|
-
y:
|
730
|
+
x: p,
|
731
|
+
y: h
|
730
732
|
};
|
731
733
|
}
|
732
734
|
},
|
733
735
|
...u
|
734
|
-
} =
|
736
|
+
} = Gt(e, t), l = {
|
735
737
|
x: n,
|
736
738
|
y: a
|
737
|
-
}, m = await
|
738
|
-
let y = l[T],
|
739
|
+
}, m = await Fr(t, u), g = Dr(Ft(o)), T = Br(g);
|
740
|
+
let y = l[T], _ = l[g];
|
739
741
|
if (i) {
|
740
|
-
const b = T === "y" ? "top" : "left",
|
741
|
-
y = bt(
|
742
|
+
const b = T === "y" ? "top" : "left", p = T === "y" ? "bottom" : "right", h = y + m[b], v = y - m[p];
|
743
|
+
y = bt(h, y, v);
|
742
744
|
}
|
743
745
|
if (c) {
|
744
|
-
const b =
|
745
|
-
|
746
|
+
const b = g === "y" ? "top" : "left", p = g === "y" ? "bottom" : "right", h = _ + m[b], v = _ - m[p];
|
747
|
+
_ = bt(h, _, v);
|
746
748
|
}
|
747
749
|
const E = d.fn({
|
748
750
|
...t,
|
749
751
|
[T]: y,
|
750
|
-
[
|
752
|
+
[g]: _
|
751
753
|
});
|
752
754
|
return {
|
753
755
|
...E,
|
@@ -756,56 +758,56 @@ const $r = function(e) {
|
|
756
758
|
y: E.y - a,
|
757
759
|
enabled: {
|
758
760
|
[T]: i,
|
759
|
-
[
|
761
|
+
[g]: c
|
760
762
|
}
|
761
763
|
}
|
762
764
|
};
|
763
765
|
}
|
764
766
|
};
|
765
|
-
},
|
766
|
-
navItem:
|
767
|
-
activeNavItem:
|
768
|
-
badge:
|
769
|
-
},
|
767
|
+
}, zr = "_navItem_1dudv_1", Jr = "_activeNavItem_1dudv_18", Wr = "_badge_1dudv_23", je = {
|
768
|
+
navItem: zr,
|
769
|
+
activeNavItem: Jr,
|
770
|
+
badge: Wr
|
771
|
+
}, Kt = Pt({}), V = () => wt(Kt), Qr = (e) => {
|
770
772
|
const t = e.lastIndexOf("."), n = e.slice(0, t), a = e.slice(t + 1);
|
771
773
|
return { name: n, extension: a };
|
772
|
-
},
|
774
|
+
}, Yr = (e, t) => {
|
773
775
|
switch (e) {
|
774
|
-
case
|
776
|
+
case A.Completed:
|
775
777
|
return t < 100 ? "Closed" : "Completed";
|
776
|
-
case
|
778
|
+
case A.Created:
|
777
779
|
return t > 0 ? "In progress" : "Not started";
|
778
|
-
case
|
780
|
+
case A.InProgress:
|
779
781
|
return "In progress";
|
780
|
-
case
|
782
|
+
case A.Queued:
|
781
783
|
return "Queued";
|
782
|
-
case
|
784
|
+
case A.NotStarted:
|
783
785
|
return "Not started";
|
784
786
|
default:
|
785
787
|
return "-";
|
786
788
|
}
|
787
|
-
},
|
789
|
+
}, Xr = (e) => {
|
788
790
|
const t = e.progress ?? 0;
|
789
|
-
return e.status ===
|
790
|
-
},
|
791
|
+
return e.status === A.Created && t > 0 ? A.InProgress : e.status;
|
792
|
+
}, Vr = {
|
791
793
|
[re.translation]: "#0891B2",
|
792
794
|
[re.review]: "#16922D",
|
793
795
|
[re.lqa_by_ai]: "#8B5CF6",
|
794
796
|
[re.automatic_translation]: "#60A5FA"
|
795
|
-
},
|
797
|
+
}, Zr = (e) => {
|
796
798
|
const t = [
|
797
|
-
|
798
|
-
|
799
|
-
|
799
|
+
A.InProgress,
|
800
|
+
A.Created,
|
801
|
+
A.Completed
|
800
802
|
];
|
801
|
-
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status:
|
802
|
-
}, Tt = (e) => [
|
803
|
-
const [n, a] = R(!1), [o, i] = R(!1), { onLanguageCompleteConfirm: c, fetchTasks: d } =
|
803
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Xr(n) })).sort((n, a) => n.status === A.InProgress && n.progress === 100 ? -1 : a.status === A.InProgress && a.progress === 100 ? 1 : n.status === a.status ? n.name < a.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(a.status));
|
804
|
+
}, Tt = (e) => [Le.InProgress, Le.Created].includes(e), ea = (e, t) => Tt(e.status) && Tt(t.status) && (t.progress ?? 0) >= 100, ta = ({ task: e, language: t }) => {
|
805
|
+
const [n, a] = R(!1), [o, i] = R(!1), { onLanguageCompleteConfirm: c, fetchTasks: d } = V(), u = () => {
|
804
806
|
i(!1);
|
805
807
|
};
|
806
|
-
return /* @__PURE__ */
|
808
|
+
return /* @__PURE__ */ f(He, { children: [
|
807
809
|
o && /* @__PURE__ */ s(
|
808
|
-
|
810
|
+
on,
|
809
811
|
{
|
810
812
|
opened: !0,
|
811
813
|
loading: n,
|
@@ -816,7 +818,7 @@ const $r = function(e) {
|
|
816
818
|
onConfirm: async () => {
|
817
819
|
a(!0), await c({ task: e, language: t, closePrompt: u }), d();
|
818
820
|
},
|
819
|
-
children: /* @__PURE__ */
|
821
|
+
children: /* @__PURE__ */ f(sn, { status: "info", children: [
|
820
822
|
"Make sure you are finished and ",
|
821
823
|
/* @__PURE__ */ s("strong", { children: "mark it as done" }),
|
822
824
|
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
@@ -824,7 +826,7 @@ const $r = function(e) {
|
|
824
826
|
}
|
825
827
|
),
|
826
828
|
/* @__PURE__ */ s(
|
827
|
-
|
829
|
+
M,
|
828
830
|
{
|
829
831
|
disabled: n,
|
830
832
|
onClick: () => {
|
@@ -834,21 +836,21 @@ const $r = function(e) {
|
|
834
836
|
}
|
835
837
|
)
|
836
838
|
] });
|
837
|
-
},
|
838
|
-
langRowCompleted:
|
839
|
-
langCellSecondary:
|
840
|
-
langStatus:
|
841
|
-
},
|
842
|
-
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } =
|
843
|
-
return /* @__PURE__ */
|
839
|
+
}, na = "_langRowCompleted_vpgdi_1", ra = "_langCellSecondary_vpgdi_15", aa = "_langStatus_vpgdi_20", Ne = {
|
840
|
+
langRowCompleted: na,
|
841
|
+
langCellSecondary: ra,
|
842
|
+
langStatus: aa
|
843
|
+
}, oa = ({ language: e, task: t }) => {
|
844
|
+
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } = V(), i = e.progress ?? 0, c = e.status === A.Completed, d = ea(t, e);
|
845
|
+
return /* @__PURE__ */ f(
|
844
846
|
"tr",
|
845
847
|
{
|
846
|
-
className:
|
848
|
+
className: j({
|
847
849
|
[Ne.langRowCompleted]: d
|
848
850
|
}),
|
849
851
|
children: [
|
850
|
-
/* @__PURE__ */ s("td", { children: /* @__PURE__ */ s(
|
851
|
-
|
852
|
+
/* @__PURE__ */ s("td", { children: /* @__PURE__ */ s(B, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ s(
|
853
|
+
M,
|
852
854
|
{
|
853
855
|
href: n({ task: t, language: e }),
|
854
856
|
onClick: () => {
|
@@ -857,8 +859,8 @@ const $r = function(e) {
|
|
857
859
|
children: e.name
|
858
860
|
}
|
859
861
|
) }) }),
|
860
|
-
/* @__PURE__ */ s("td", { className: Ne.langCellSecondary, children: d || c ? "0" : /* @__PURE__ */ s(
|
861
|
-
|
862
|
+
/* @__PURE__ */ s("td", { className: Ne.langCellSecondary, children: d || c ? "0" : /* @__PURE__ */ s(B, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ s(
|
863
|
+
M,
|
862
864
|
{
|
863
865
|
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
864
866
|
onClick: () => {
|
@@ -867,42 +869,42 @@ const $r = function(e) {
|
|
867
869
|
children: e.base_words_total - e.base_words_done
|
868
870
|
}
|
869
871
|
) }) }),
|
870
|
-
/* @__PURE__ */
|
872
|
+
/* @__PURE__ */ f("td", { children: [
|
871
873
|
i,
|
872
874
|
"%"
|
873
875
|
] }),
|
874
|
-
/* @__PURE__ */ s("td", { children: d ? /* @__PURE__ */ s(
|
876
|
+
/* @__PURE__ */ s("td", { children: d ? /* @__PURE__ */ s(ta, { task: t, language: e }) : /* @__PURE__ */ s(
|
875
877
|
"span",
|
876
878
|
{
|
877
879
|
className: `${Ne.langStatus} flex-row items-center justify-start`,
|
878
880
|
"data-status": e.status,
|
879
|
-
children:
|
881
|
+
children: Yr(e.status, i)
|
880
882
|
}
|
881
883
|
) })
|
882
884
|
]
|
883
885
|
}
|
884
886
|
);
|
885
|
-
},
|
886
|
-
taskContainer:
|
887
|
-
taskTitle:
|
888
|
-
taskDescription:
|
889
|
-
languagesTable:
|
890
|
-
metadata:
|
891
|
-
},
|
892
|
-
const { getProjectUrl: t, taskTitleOnClick: n } =
|
887
|
+
}, sa = "_taskContainer_mt2or_1", ia = "_taskTitle_mt2or_21", ca = "_taskDescription_mt2or_28", la = "_languagesTable_mt2or_35", da = "_metadata_mt2or_87", H = {
|
888
|
+
taskContainer: sa,
|
889
|
+
taskTitle: ia,
|
890
|
+
taskDescription: ca,
|
891
|
+
languagesTable: la,
|
892
|
+
metadata: da
|
893
|
+
}, ua = ({ task: e }) => {
|
894
|
+
const { getProjectUrl: t, taskTitleOnClick: n } = V(), a = Zr(e.langs), o = (i) => {
|
893
895
|
window.open(
|
894
896
|
`/style-guide/${e.team_id}/download/${i.id}/link`,
|
895
897
|
"_blank",
|
896
898
|
"noopener,noreferrer"
|
897
899
|
);
|
898
900
|
};
|
899
|
-
return /* @__PURE__ */
|
900
|
-
/* @__PURE__ */
|
901
|
-
/* @__PURE__ */
|
902
|
-
/* @__PURE__ */ s(
|
903
|
-
e.due_date && /* @__PURE__ */
|
901
|
+
return /* @__PURE__ */ f("div", { className: H.taskContainer, children: [
|
902
|
+
/* @__PURE__ */ f("div", { className: "flex-row gap-1 items-center", children: [
|
903
|
+
/* @__PURE__ */ f("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
904
|
+
/* @__PURE__ */ s(Oe, { color: Vr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
905
|
+
e.due_date && /* @__PURE__ */ f(Oe, { color: "#EAB308", children: [
|
904
906
|
"DUE ",
|
905
|
-
hr(
|
907
|
+
hr(un(e.due_date), "yyyy-MM-dd")
|
906
908
|
] })
|
907
909
|
] }),
|
908
910
|
e.style_guides.length > 0 && /* @__PURE__ */ s("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ s(
|
@@ -918,18 +920,18 @@ const $r = function(e) {
|
|
918
920
|
{
|
919
921
|
menuButton: /* @__PURE__ */ s(xe, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
920
922
|
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((i) => /* @__PURE__ */ s(
|
921
|
-
|
923
|
+
W,
|
922
924
|
{
|
923
925
|
onClick: () => o(i),
|
924
|
-
children:
|
926
|
+
children: Qr(i.name).name
|
925
927
|
},
|
926
928
|
i.id
|
927
929
|
)) })
|
928
930
|
}
|
929
931
|
) })
|
930
932
|
] }),
|
931
|
-
/* @__PURE__ */ s("h4", { className:
|
932
|
-
|
933
|
+
/* @__PURE__ */ s("h4", { className: H.taskTitle, children: /* @__PURE__ */ s(
|
934
|
+
M,
|
933
935
|
{
|
934
936
|
href: t({ task: e, view: "multi" }),
|
935
937
|
onClick: () => {
|
@@ -938,75 +940,75 @@ const $r = function(e) {
|
|
938
940
|
children: e.title
|
939
941
|
}
|
940
942
|
) }),
|
941
|
-
e.description && /* @__PURE__ */ s("div", { className:
|
942
|
-
/* @__PURE__ */
|
943
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */
|
943
|
+
e.description && /* @__PURE__ */ s("div", { className: H.taskDescription, children: _r(fr(e.description)) }),
|
944
|
+
/* @__PURE__ */ f("table", { className: H.languagesTable, children: [
|
945
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ f("tr", { children: [
|
944
946
|
/* @__PURE__ */ s("th", { children: "Languages" }),
|
945
947
|
/* @__PURE__ */ s("th", { children: "Words to do" }),
|
946
948
|
/* @__PURE__ */ s("th", { children: "Progress" }),
|
947
949
|
/* @__PURE__ */ s("th", { children: "Status" })
|
948
950
|
] }) }),
|
949
|
-
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(
|
951
|
+
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(oa, { language: i, task: e }, i.lang_id)) })
|
950
952
|
] }),
|
951
|
-
/* @__PURE__ */
|
952
|
-
/* @__PURE__ */
|
953
|
+
/* @__PURE__ */ f("div", { "data-testid": "sidebar-task-overview-metadata", className: H.metadata, children: [
|
954
|
+
/* @__PURE__ */ f("span", { children: [
|
953
955
|
"Source: ",
|
954
956
|
e.source_lang_name
|
955
957
|
] }),
|
956
958
|
/* @__PURE__ */ s("span", { children: e.created_by_fullname }),
|
957
|
-
/* @__PURE__ */
|
959
|
+
/* @__PURE__ */ f("span", { children: [
|
958
960
|
"In ",
|
959
961
|
e.project_name,
|
960
|
-
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className:
|
962
|
+
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className: H.tag, children: e.branch_name ? e.branch_name : "master" })
|
961
963
|
] })
|
962
964
|
] })
|
963
965
|
] });
|
964
|
-
},
|
966
|
+
}, P = {
|
965
967
|
TaskCompleted: "task_completed",
|
966
968
|
TaskClosed: "task_closed",
|
967
969
|
Refresh: "refresh",
|
968
970
|
ShowDialog: "show_dialog"
|
969
|
-
},
|
970
|
-
loadingContainer:
|
971
|
-
noTasksContainer:
|
972
|
-
noTasksHeading:
|
973
|
-
noTasksText:
|
971
|
+
}, ma = "_loadingContainer_19d6m_1", _a = "_noTasksContainer_19d6m_7", ga = "_noTasksHeading_19d6m_14", pa = "_noTasksText_19d6m_18", fa = "_tasksContainer_19d6m_23", F = {
|
972
|
+
loadingContainer: ma,
|
973
|
+
noTasksContainer: _a,
|
974
|
+
noTasksHeading: ga,
|
975
|
+
noTasksText: pa,
|
974
976
|
tasksContainer: fa
|
975
|
-
},
|
976
|
-
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } =
|
977
|
+
}, ha = () => {
|
978
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } = V();
|
977
979
|
return $e(() => ((async () => {
|
978
980
|
const i = await a();
|
979
981
|
t == null || t({ tasks: i });
|
980
|
-
})(), document.addEventListener(
|
981
|
-
document.removeEventListener(
|
982
|
-
})), n ? /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-loading-popover", className: F.loadingContainer, children: /* @__PURE__ */ s(
|
982
|
+
})(), document.addEventListener(P.TaskCompleted, a), document.addEventListener(P.TaskClosed, a), document.addEventListener(P.Refresh, a), () => {
|
983
|
+
document.removeEventListener(P.TaskCompleted, a), document.removeEventListener(P.TaskClosed, a), document.removeEventListener(P.Refresh, a);
|
984
|
+
})), n ? /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-loading-popover", className: F.loadingContainer, children: /* @__PURE__ */ s(cn, {}) }) : e.length === 0 ? /* @__PURE__ */ f("div", { "data-testid": "sidebar-no-tasks-popover", className: F.noTasksContainer, children: [
|
983
985
|
/* @__PURE__ */ s("h3", { className: F.noTasksHeading, children: "No tasks" }),
|
984
|
-
/* @__PURE__ */
|
986
|
+
/* @__PURE__ */ f("div", { className: F.noTasksText, children: [
|
985
987
|
"Your incoming tasks will appear here.",
|
986
988
|
/* @__PURE__ */ s("br", {}),
|
987
|
-
/* @__PURE__ */ s(
|
989
|
+
/* @__PURE__ */ s(M, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
988
990
|
] })
|
989
|
-
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(
|
990
|
-
},
|
991
|
+
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(ua, { task: o }, o.id)) });
|
992
|
+
}, ba = ({ children: e, config: t }) => {
|
991
993
|
const [n, a] = R([]), [o, i] = R(!0), [c, d] = R(0), {
|
992
994
|
getProjectUrl: u,
|
993
995
|
onLanguageCompleteConfirm: l,
|
994
996
|
onTasksWidgetOpen: m,
|
995
|
-
langNameOnClick:
|
997
|
+
langNameOnClick: g,
|
996
998
|
langProgressOnClick: T,
|
997
999
|
taskTitleOnClick: y
|
998
|
-
} = t, { getTasks:
|
1000
|
+
} = t, { getTasks: _, getTasksCount: E } = t, b = async () => {
|
999
1001
|
i(!0);
|
1000
|
-
const v = await
|
1002
|
+
const v = await _();
|
1001
1003
|
return a(v), i(!1), v;
|
1002
|
-
},
|
1004
|
+
}, p = async () => {
|
1003
1005
|
const v = await E();
|
1004
1006
|
d(v);
|
1005
1007
|
};
|
1006
|
-
$e(() => (
|
1007
|
-
document.removeEventListener(
|
1008
|
+
$e(() => (p(), document.addEventListener(P.TaskCompleted, p), document.addEventListener(P.TaskClosed, p), document.addEventListener(P.Refresh, p), () => {
|
1009
|
+
document.removeEventListener(P.TaskCompleted, p), document.removeEventListener(P.TaskClosed, p), document.removeEventListener(P.Refresh, p);
|
1008
1010
|
}));
|
1009
|
-
const
|
1011
|
+
const h = {
|
1010
1012
|
fetchTasks: b,
|
1011
1013
|
tasks: n,
|
1012
1014
|
tasksCount: c,
|
@@ -1014,32 +1016,32 @@ const $r = function(e) {
|
|
1014
1016
|
getProjectUrl: u,
|
1015
1017
|
onLanguageCompleteConfirm: l,
|
1016
1018
|
onTasksWidgetOpen: m,
|
1017
|
-
langNameOnClick:
|
1019
|
+
langNameOnClick: g,
|
1018
1020
|
langProgressOnClick: T,
|
1019
1021
|
taskTitleOnClick: y
|
1020
1022
|
};
|
1021
|
-
return /* @__PURE__ */ s(
|
1022
|
-
},
|
1023
|
+
return /* @__PURE__ */ s(Kt.Provider, { value: h, children: e });
|
1024
|
+
}, va = (e) => function(n) {
|
1023
1025
|
const { config: a, ...o } = n;
|
1024
|
-
return /* @__PURE__ */ s(
|
1025
|
-
},
|
1026
|
-
const [e, t] = R(!1), { tasksCount: n } =
|
1026
|
+
return /* @__PURE__ */ s(ba, { config: a, children: /* @__PURE__ */ s(e, { ...o }) });
|
1027
|
+
}, Ta = va(() => {
|
1028
|
+
const [e, t] = R(!1), { tasksCount: n } = V();
|
1027
1029
|
return $e(() => {
|
1028
1030
|
const a = () => {
|
1029
1031
|
t(!0);
|
1030
1032
|
};
|
1031
|
-
return document.addEventListener(
|
1032
|
-
document.removeEventListener(
|
1033
|
+
return document.addEventListener(P.ShowDialog, a), () => {
|
1034
|
+
document.removeEventListener(P.ShowDialog, a);
|
1033
1035
|
};
|
1034
|
-
}), /* @__PURE__ */ s(
|
1035
|
-
|
1036
|
+
}), /* @__PURE__ */ s(B, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ s(
|
1037
|
+
ln,
|
1036
1038
|
{
|
1037
|
-
content: /* @__PURE__ */ s(
|
1039
|
+
content: /* @__PURE__ */ s(ha, {}),
|
1038
1040
|
placement: "right",
|
1039
1041
|
open: e,
|
1040
1042
|
onOpenChange: t,
|
1041
1043
|
middlewares: [
|
1042
|
-
|
1044
|
+
Kr({
|
1043
1045
|
// Adding some spacing to the top and bottom so the popover
|
1044
1046
|
// doesn't extend to the edges of the screen.
|
1045
1047
|
padding: {
|
@@ -1048,93 +1050,93 @@ const $r = function(e) {
|
|
1048
1050
|
}
|
1049
1051
|
})
|
1050
1052
|
],
|
1051
|
-
children: (a) => /* @__PURE__ */
|
1053
|
+
children: (a) => /* @__PURE__ */ f(
|
1052
1054
|
xe,
|
1053
1055
|
{
|
1054
1056
|
type: "button",
|
1055
1057
|
"data-testid": "sidebar-tasks-widget-button",
|
1056
1058
|
"aria-label": "Tasks",
|
1057
|
-
className:
|
1058
|
-
[
|
1059
|
+
className: j(je.navItem, {
|
1060
|
+
[je.activeNavItem]: a
|
1059
1061
|
}),
|
1060
1062
|
children: [
|
1061
|
-
/* @__PURE__ */ s(
|
1062
|
-
n > 0 && /* @__PURE__ */ s("div", { className:
|
1063
|
+
/* @__PURE__ */ s(dn, { size: "25px" }),
|
1064
|
+
n > 0 && /* @__PURE__ */ s("div", { className: je.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
1063
1065
|
]
|
1064
1066
|
}
|
1065
1067
|
)
|
1066
1068
|
}
|
1067
1069
|
) });
|
1068
|
-
}),
|
1069
|
-
|
1070
|
-
const
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
const
|
1082
|
-
breadcrumbsItem:
|
1083
|
-
breadcrumbs:
|
1084
|
-
},
|
1085
|
-
/* @__PURE__ */ s(
|
1070
|
+
}), k = ({ children: e, ...t }) => /* @__PURE__ */ s("nav", { ...t, className: Dn.sidebarContainer, children: e }), ya = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1071
|
+
k.Top = ya;
|
1072
|
+
const Sa = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1073
|
+
k.Bottom = Sa;
|
1074
|
+
k.Avatar = Fn;
|
1075
|
+
k.IconLink = Jn;
|
1076
|
+
k.Menu = Yn;
|
1077
|
+
k.ProfileMenu = vr;
|
1078
|
+
k.TeamSwitch = Or;
|
1079
|
+
k.TeamMenuItem = $t;
|
1080
|
+
k.UpgradeMenuItem = Ur;
|
1081
|
+
k.ProfileSettingsMenuItem = Sr;
|
1082
|
+
k.Tasks = Ta;
|
1083
|
+
const Ea = "_breadcrumbsItem_1hm6a_1", Ca = "_breadcrumbs_1hm6a_1", yt = {
|
1084
|
+
breadcrumbsItem: Ea,
|
1085
|
+
breadcrumbs: Ca
|
1086
|
+
}, Wo = ({ items: e }) => /* @__PURE__ */ s("nav", { "aria-label": "breadcrumb", className: yt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ f(At, { children: [
|
1087
|
+
/* @__PURE__ */ s(M, { className: yt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1086
1088
|
n < e.length - 1 && /* @__PURE__ */ s("span", { children: " — " })
|
1087
|
-
] }, `${t.link}-${t.name}`)) }),
|
1088
|
-
!!n && t.some((a) => a.visible) && /* @__PURE__ */ s(
|
1089
|
-
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: i }) => /* @__PURE__ */ s(
|
1090
|
-
] }, t[0].label)) }),
|
1091
|
-
badge:
|
1092
|
-
tag:
|
1093
|
-
withNavLinkStyle:
|
1094
|
-
disabled:
|
1095
|
-
projectNavigationItem:
|
1096
|
-
projectNavigationItemDisabled:
|
1097
|
-
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */
|
1098
|
-
/* @__PURE__ */
|
1089
|
+
] }, `${t.link}-${t.name}`)) }), wa = ({ items: e }) => /* @__PURE__ */ s(He, { children: e.map((t, n) => /* @__PURE__ */ f(At, { children: [
|
1090
|
+
!!n && t.some((a) => a.visible) && /* @__PURE__ */ s(It, {}),
|
1091
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: i }) => /* @__PURE__ */ s(W, { href: a || "#", "aria-label": o, onClick: i, children: o }, o))
|
1092
|
+
] }, t[0].label)) }), Pa = "_badge_1pc1v_1", Aa = "_tag_1pc1v_15", ka = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", Ia = "_disabled_1pc1v_57", Ra = "_projectNavigationItem_1pc1v_61", ja = "_projectNavigationItemDisabled_1pc1v_67", L = {
|
1093
|
+
badge: Pa,
|
1094
|
+
tag: Aa,
|
1095
|
+
withNavLinkStyle: ka,
|
1096
|
+
disabled: Ia,
|
1097
|
+
projectNavigationItem: Ra,
|
1098
|
+
projectNavigationItemDisabled: ja
|
1099
|
+
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ f("div", { className: "flex gap-1", children: [
|
1100
|
+
/* @__PURE__ */ f("div", { children: [
|
1099
1101
|
/* @__PURE__ */ s("span", { children: e }),
|
1100
|
-
!!t && /* @__PURE__ */ s("div", { className:
|
1102
|
+
!!t && /* @__PURE__ */ s("div", { className: L.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
1101
1103
|
] }),
|
1102
|
-
!!n && /* @__PURE__ */ s(
|
1103
|
-
] }),
|
1104
|
-
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: i }, c) => /* @__PURE__ */ s(
|
1104
|
+
!!n && /* @__PURE__ */ s(Oe, { className: L.tag, children: n })
|
1105
|
+
] }), Me = rn(
|
1106
|
+
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: i }, c) => /* @__PURE__ */ s(B, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ s(
|
1105
1107
|
"div",
|
1106
1108
|
{
|
1107
|
-
className: n ?
|
1109
|
+
className: n ? L.projectNavigationItemDisabled : L.projectNavigationItem,
|
1108
1110
|
children: o || n || !t ? /* @__PURE__ */ s(
|
1109
1111
|
"button",
|
1110
1112
|
{
|
1111
1113
|
type: "button",
|
1112
1114
|
ref: c,
|
1113
|
-
className:
|
1114
|
-
[
|
1115
|
+
className: j(L.withNavLinkStyle, {
|
1116
|
+
[L.disabled]: n
|
1115
1117
|
}),
|
1116
1118
|
disabled: n,
|
1117
1119
|
onClick: o,
|
1118
1120
|
children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i })
|
1119
1121
|
}
|
1120
|
-
) : /* @__PURE__ */ s("a", { href: t, className:
|
1122
|
+
) : /* @__PURE__ */ s("a", { href: t, className: L.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i }) })
|
1121
1123
|
}
|
1122
1124
|
) })
|
1123
1125
|
);
|
1124
|
-
|
1125
|
-
const
|
1126
|
+
Me.displayName = "NavigationTabsItem";
|
1127
|
+
const Na = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, Oa = (e) => e.visible && (!e.dropdown || Na(e.dropdown)), Qo = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ s("nav", { "aria-label": "Project", children: /* @__PURE__ */ s("ul", { className: q.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Oa).map((n) => {
|
1126
1128
|
var a, o, i;
|
1127
1129
|
return n.dropdown ? /* @__PURE__ */ s(
|
1128
1130
|
"li",
|
1129
1131
|
{
|
1130
|
-
className:
|
1132
|
+
className: q.navigationTab,
|
1131
1133
|
"data-testid": n.key,
|
1132
1134
|
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
1133
1135
|
children: /* @__PURE__ */ s(
|
1134
1136
|
ce,
|
1135
1137
|
{
|
1136
|
-
menuButton: ({ opened: c }) => /* @__PURE__ */ s(
|
1137
|
-
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(
|
1138
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ s(Me, { label: n.label, disabled: n.disabled, active: c }),
|
1139
|
+
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(wa, { items: n.dropdown }) })
|
1138
1140
|
}
|
1139
1141
|
)
|
1140
1142
|
},
|
@@ -1142,11 +1144,11 @@ const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1142
1144
|
) : /* @__PURE__ */ s(
|
1143
1145
|
"li",
|
1144
1146
|
{
|
1145
|
-
className:
|
1147
|
+
className: q.navigationTab,
|
1146
1148
|
"data-testid": n.key,
|
1147
1149
|
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
1148
1150
|
children: /* @__PURE__ */ s(
|
1149
|
-
|
1151
|
+
Me,
|
1150
1152
|
{
|
1151
1153
|
label: n.label,
|
1152
1154
|
href: n.link,
|
@@ -1161,7 +1163,7 @@ const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1161
1163
|
n.key
|
1162
1164
|
);
|
1163
1165
|
}) }) });
|
1164
|
-
class
|
1166
|
+
class I {
|
1165
1167
|
/**
|
1166
1168
|
* This constructor is private to prevent the creation of a HeaderBuilder, it's an implementation detail
|
1167
1169
|
* that users of this class should not be aware of. The only way to create a HeaderBuilder is through the
|
@@ -1173,7 +1175,7 @@ class A {
|
|
1173
1175
|
this.factories = t;
|
1174
1176
|
}
|
1175
1177
|
static create(t = {}) {
|
1176
|
-
return new
|
1178
|
+
return new I([() => t]);
|
1177
1179
|
}
|
1178
1180
|
/**
|
1179
1181
|
* Adds a single header to the builder by providing a key and a value.
|
@@ -1193,7 +1195,7 @@ class A {
|
|
1193
1195
|
* @param value - The value of the header
|
1194
1196
|
*/
|
1195
1197
|
add(t, n) {
|
1196
|
-
return new
|
1198
|
+
return new I([...this.factories, () => ({ [t]: n })]);
|
1197
1199
|
}
|
1198
1200
|
/**
|
1199
1201
|
* Adds multiple headers to the builder by providing an object or a promise of an object with the headers.
|
@@ -1217,7 +1219,7 @@ class A {
|
|
1217
1219
|
* @param extension - An object with the headers to add
|
1218
1220
|
*/
|
1219
1221
|
and(t) {
|
1220
|
-
return new
|
1222
|
+
return new I([...this.factories, () => t]);
|
1221
1223
|
}
|
1222
1224
|
/**
|
1223
1225
|
* Adds a factory function that returns a promise of headers to the builder.
|
@@ -1238,7 +1240,7 @@ class A {
|
|
1238
1240
|
* @param factory - A function that returns a promise of headers
|
1239
1241
|
*/
|
1240
1242
|
from(t) {
|
1241
|
-
return new
|
1243
|
+
return new I([...this.factories, t]);
|
1242
1244
|
}
|
1243
1245
|
/**
|
1244
1246
|
* Takes a middleware function that receives the current builder and returns a new, modified, builder.
|
@@ -1283,7 +1285,7 @@ class A {
|
|
1283
1285
|
* @param builder - The builder to merge with
|
1284
1286
|
*/
|
1285
1287
|
merge(t) {
|
1286
|
-
return new
|
1288
|
+
return new I([...this.factories, ...t.factories]);
|
1287
1289
|
}
|
1288
1290
|
/**
|
1289
1291
|
* Resolves the headers by waiting for all the promises to resolve and merging them together.
|
@@ -1301,31 +1303,31 @@ class A {
|
|
1301
1303
|
return Object.assign({}, ...n);
|
1302
1304
|
}
|
1303
1305
|
}
|
1304
|
-
function
|
1305
|
-
return new
|
1306
|
+
function zt(e) {
|
1307
|
+
return new xa(e);
|
1306
1308
|
}
|
1307
|
-
class
|
1309
|
+
class xa {
|
1308
1310
|
constructor(t) {
|
1309
1311
|
this.middleware = t;
|
1310
1312
|
}
|
1311
1313
|
apply(t) {
|
1312
1314
|
return t.from(async () => {
|
1313
|
-
const n = this.middleware(
|
1315
|
+
const n = this.middleware(I.create());
|
1314
1316
|
return n instanceof Promise ? n.then((a) => a.resolve()) : n.resolve();
|
1315
1317
|
});
|
1316
1318
|
}
|
1317
1319
|
}
|
1318
|
-
const
|
1320
|
+
const Jt = r.union([
|
1319
1321
|
r.literal("owner"),
|
1320
1322
|
r.literal("admin"),
|
1321
1323
|
r.literal("biller"),
|
1322
1324
|
r.literal("member")
|
1323
|
-
]),
|
1325
|
+
]), La = r.object({
|
1324
1326
|
userId: r.number(),
|
1325
1327
|
userUuid: r.string().uuid(),
|
1326
1328
|
teamId: r.number(),
|
1327
1329
|
teamUuid: r.string().uuid(),
|
1328
|
-
userTeamRole:
|
1330
|
+
userTeamRole: Jt,
|
1329
1331
|
userEmail: r.string().email(),
|
1330
1332
|
userName: r.string(),
|
1331
1333
|
userCurrentTeamId: r.number(),
|
@@ -1335,10 +1337,10 @@ const zt = r.union([
|
|
1335
1337
|
isFullyAuthenticated: r.boolean(),
|
1336
1338
|
exp: r.number()
|
1337
1339
|
});
|
1338
|
-
function
|
1340
|
+
function Z(e) {
|
1339
1341
|
try {
|
1340
1342
|
const t = e.split(".")[1], n = atob(t);
|
1341
|
-
return
|
1343
|
+
return La.parse(JSON.parse(n));
|
1342
1344
|
} catch {
|
1343
1345
|
return;
|
1344
1346
|
}
|
@@ -1350,14 +1352,14 @@ class se extends Error {
|
|
1350
1352
|
ne(this, "status", 401);
|
1351
1353
|
}
|
1352
1354
|
}
|
1353
|
-
function
|
1354
|
-
return
|
1355
|
+
function Yo(e) {
|
1356
|
+
return zt(async (t) => {
|
1355
1357
|
var i, c;
|
1356
1358
|
const n = e.getCurrentToken() ?? await ((i = e.generateNewToken) == null ? void 0 : i.call(e));
|
1357
1359
|
if (!n)
|
1358
1360
|
throw new se();
|
1359
|
-
const { exp: a } =
|
1360
|
-
if (!
|
1361
|
+
const { exp: a } = Z(n.accessToken) ?? { exp: 0 };
|
1362
|
+
if (!mn(new Date(a)))
|
1361
1363
|
return t.add("authorization", `Bearer ${n.accessToken}`);
|
1362
1364
|
const o = await e.refreshToken(n);
|
1363
1365
|
if (!o)
|
@@ -1365,245 +1367,275 @@ function Go(e) {
|
|
1365
1367
|
return (c = e.onNewTokenIssued) == null || c.call(e, o), t.add("authorization", `Bearer ${o.accessToken}`);
|
1366
1368
|
});
|
1367
1369
|
}
|
1368
|
-
const
|
1370
|
+
const Xo = zt(
|
1369
1371
|
(e) => e.and({ "x-lokalise-plugin": "true" })
|
1370
1372
|
);
|
1371
|
-
function
|
1372
|
-
const e =
|
1373
|
+
function Wt() {
|
1374
|
+
const e = Ue(document.cookie, "accessToken"), t = Ue(document.cookie, "refreshToken");
|
1373
1375
|
return !e || !t ? null : { accessToken: e, refreshToken: t };
|
1374
1376
|
}
|
1375
|
-
function
|
1376
|
-
return
|
1377
|
+
function Ma() {
|
1378
|
+
return Ue(document.cookie, "csrf_token") ?? null;
|
1377
1379
|
}
|
1378
|
-
function
|
1380
|
+
function Ue(e, t) {
|
1379
1381
|
var n, a;
|
1380
1382
|
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
1381
1383
|
}
|
1382
|
-
function
|
1383
|
-
const e =
|
1384
|
+
function Vo() {
|
1385
|
+
const e = Wt();
|
1384
1386
|
if (!e)
|
1385
1387
|
return;
|
1386
|
-
const t =
|
1388
|
+
const t = Z(e.accessToken);
|
1387
1389
|
if (t)
|
1388
1390
|
return { ...e, payload: t };
|
1389
1391
|
}
|
1390
|
-
const
|
1392
|
+
const Qt = r.union([
|
1391
1393
|
r.object({ authorization: r.string() }),
|
1392
1394
|
r.object({ AUTHORIZATION: r.string() })
|
1393
|
-
]),
|
1395
|
+
]), Ua = r.union([
|
1394
1396
|
r.object({ "X-API-Token": r.string() }),
|
1395
1397
|
r.object({ "X-Api-Token": r.string() }),
|
1396
1398
|
r.object({ "x-api-token": r.string() }),
|
1397
1399
|
r.object({ "X-API-TOKEN": r.string() })
|
1398
|
-
]),
|
1399
|
-
|
1400
|
-
|
1401
|
-
]),
|
1400
|
+
]), Ha = r.union([
|
1401
|
+
Qt,
|
1402
|
+
Ua
|
1403
|
+
]), qa = r.union([
|
1402
1404
|
r.object({ "X-Lokalise-Plugin": r.string() }),
|
1403
1405
|
r.object({ "x-lokalise-plugin": r.string() }),
|
1404
1406
|
r.object({ "X-LOKALISE-PLUGIN": r.string() })
|
1405
|
-
]),
|
1407
|
+
]), $ = Ha.and(qa), Ba = r.object({
|
1406
1408
|
accessToken: r.string(),
|
1407
1409
|
refreshToken: r.string()
|
1408
|
-
}),
|
1410
|
+
}), Da = r.union([
|
1409
1411
|
r.object({ "X-Csrf-Token": r.string() }),
|
1410
1412
|
r.object({ "X-CSRF-Token": r.string() }),
|
1411
1413
|
r.object({ "x-csrf-token": r.string() }),
|
1412
1414
|
r.object({ "X-CSRF-TOKEN": r.string() })
|
1413
|
-
]),
|
1414
|
-
|
1415
|
-
|
1416
|
-
]),
|
1415
|
+
]), $a = r.union([
|
1416
|
+
Qt,
|
1417
|
+
Da
|
1418
|
+
]), Ge = qe({
|
1417
1419
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
1418
1420
|
method: "post",
|
1419
1421
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
1420
1422
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
1421
|
-
requestHeaderSchema:
|
1423
|
+
requestHeaderSchema: $a,
|
1422
1424
|
requestBodySchema: r.undefined(),
|
1423
1425
|
isEmptyResponseExpected: !0,
|
1424
|
-
successResponseBodySchema:
|
1426
|
+
successResponseBodySchema: Ba
|
1425
1427
|
});
|
1426
|
-
function
|
1428
|
+
function Zo(e, t, n) {
|
1427
1429
|
return async () => {
|
1428
1430
|
const a = t();
|
1429
1431
|
if (!a)
|
1430
1432
|
throw new se();
|
1431
|
-
return
|
1433
|
+
return U(e, Ge, {
|
1432
1434
|
pathParams: { teamId: Number(await n()) },
|
1433
|
-
headers: await
|
1435
|
+
headers: await I.create().add("x-csrf-token", a).resolve()
|
1434
1436
|
});
|
1435
1437
|
};
|
1436
1438
|
}
|
1437
|
-
function
|
1439
|
+
function es(e) {
|
1438
1440
|
return async ({ accessToken: t, refreshToken: n }) => {
|
1439
|
-
const a =
|
1441
|
+
const a = Z(t);
|
1440
1442
|
if (!a)
|
1441
1443
|
throw new se();
|
1442
|
-
return
|
1444
|
+
return U(e, Ge, {
|
1443
1445
|
pathParams: { teamId: a.teamId },
|
1444
|
-
headers: await
|
1446
|
+
headers: await I.create().add("authorization", `Bearer ${n}`).resolve()
|
1445
1447
|
});
|
1446
1448
|
};
|
1447
1449
|
}
|
1448
|
-
const
|
1450
|
+
const Ga = {
|
1449
1451
|
teamKey: (e) => ["getUserToken", e]
|
1450
|
-
},
|
1452
|
+
}, Fa = (e, t, n) => D({
|
1451
1453
|
...n,
|
1452
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1454
|
+
queryFn: async ({ queryKey: [a, o] }) => U(e, Ge, {
|
1453
1455
|
headers: await t.resolve(),
|
1454
1456
|
pathParams: { teamId: o }
|
1455
1457
|
})
|
1456
1458
|
}), ie = class ie extends CustomEvent {
|
1457
1459
|
constructor(t) {
|
1458
1460
|
super(ie.eventName, {
|
1459
|
-
detail: { token: t, payload:
|
1461
|
+
detail: { token: t, payload: Z(t.accessToken) }
|
1460
1462
|
});
|
1461
1463
|
}
|
1462
1464
|
};
|
1463
1465
|
ne(ie, "eventName", "new-jwt-issued");
|
1464
|
-
let
|
1465
|
-
function
|
1466
|
-
const a =
|
1467
|
-
queryKey:
|
1466
|
+
let z = ie;
|
1467
|
+
function ts(e, t, n) {
|
1468
|
+
const a = Ma(), o = Fa(e, t.add("x-csrf-token", a ?? ""), {
|
1469
|
+
queryKey: Ga.teamKey(n),
|
1468
1470
|
enabled: a !== void 0
|
1469
|
-
}), i =
|
1470
|
-
return
|
1471
|
-
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new
|
1471
|
+
}), i = Ct();
|
1472
|
+
return J(() => {
|
1473
|
+
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new z(o.data)), i.current = o.data.accessToken);
|
1472
1474
|
}, [o.data]), o;
|
1473
1475
|
}
|
1474
|
-
function
|
1476
|
+
function Yt() {
|
1475
1477
|
const [e, t] = R();
|
1476
|
-
return
|
1478
|
+
return J(() => {
|
1477
1479
|
const n = (o) => {
|
1478
1480
|
t(o.detail.payload);
|
1479
|
-
}, a =
|
1480
|
-
return t(a ?
|
1481
|
-
window.removeEventListener(
|
1481
|
+
}, a = Wt();
|
1482
|
+
return t(a ? Z(a.accessToken) : void 0), window.addEventListener(z.eventName, n), () => {
|
1483
|
+
window.removeEventListener(z.eventName, n);
|
1482
1484
|
};
|
1483
1485
|
}, []), e;
|
1484
1486
|
}
|
1485
|
-
const
|
1487
|
+
const Ka = $, za = r.object({
|
1486
1488
|
user_id: r.number(),
|
1487
1489
|
email: r.string().email(),
|
1488
1490
|
fullname: r.string(),
|
1489
1491
|
created_at: r.string(),
|
1490
1492
|
created_at_timestamp: r.number(),
|
1491
|
-
role:
|
1492
|
-
}),
|
1493
|
+
role: Jt
|
1494
|
+
}), Ja = r.object({
|
1493
1495
|
team_id: r.number(),
|
1494
|
-
team_user:
|
1495
|
-
}),
|
1496
|
+
team_user: za
|
1497
|
+
}), Wa = Y({
|
1496
1498
|
description: "Get the details of a team user",
|
1497
|
-
requestHeaderSchema:
|
1499
|
+
requestHeaderSchema: Ka,
|
1498
1500
|
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
1499
1501
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
1500
|
-
successResponseBodySchema:
|
1501
|
-
}),
|
1502
|
+
successResponseBodySchema: Ja
|
1503
|
+
}), Qa = {
|
1502
1504
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
1503
|
-
},
|
1505
|
+
}, Ya = (e, t, n) => D({
|
1504
1506
|
...n,
|
1505
|
-
queryFn: async ({ queryKey: [a, o, i] }) =>
|
1507
|
+
queryFn: async ({ queryKey: [a, o, i] }) => Q(e, Wa, {
|
1506
1508
|
headers: await t.resolve(),
|
1507
1509
|
pathParams: { teamId: o, userId: i }
|
1508
1510
|
})
|
1509
1511
|
});
|
1510
|
-
function
|
1511
|
-
const n =
|
1512
|
-
return
|
1513
|
-
queryKey:
|
1512
|
+
function ns(e, t) {
|
1513
|
+
const n = Yt();
|
1514
|
+
return Ya(e, t, {
|
1515
|
+
queryKey: Qa.teamUserKey((n == null ? void 0 : n.teamId) ?? 0, (n == null ? void 0 : n.userId) ?? 0),
|
1514
1516
|
enabled: (n == null ? void 0 : n.userId) !== void 0 && n.teamId !== void 0
|
1515
1517
|
});
|
1516
1518
|
}
|
1517
|
-
const
|
1519
|
+
const Xa = r.object({
|
1518
1520
|
lang_id: r.number(),
|
1519
1521
|
lang_iso: r.string(),
|
1520
1522
|
lang_name: r.string(),
|
1521
1523
|
is_writable: r.union([r.literal(0), r.literal(1)])
|
1522
|
-
}),
|
1524
|
+
}), Va = r.object({
|
1523
1525
|
user_id: r.number(),
|
1524
1526
|
email: r.string().email(),
|
1525
1527
|
fullname: r.string(),
|
1526
1528
|
created_at: r.string(),
|
1527
1529
|
created_at_timestamp: r.number(),
|
1528
1530
|
admin_rights: r.array(r.string()),
|
1529
|
-
languages: r.array(
|
1531
|
+
languages: r.array(Xa),
|
1530
1532
|
is_admin: r.boolean(),
|
1531
1533
|
is_reviewer: r.boolean()
|
1532
|
-
}),
|
1534
|
+
}), Za = r.object({
|
1533
1535
|
project_id: r.string(),
|
1534
|
-
contributors: r.array(
|
1535
|
-
}),
|
1536
|
+
contributors: r.array(Va)
|
1537
|
+
}), eo = Y({
|
1536
1538
|
description: "Get the details of a project contributor",
|
1537
|
-
requestHeaderSchema:
|
1539
|
+
requestHeaderSchema: $,
|
1538
1540
|
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
1539
1541
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
1540
|
-
successResponseBodySchema:
|
1541
|
-
}),
|
1542
|
+
successResponseBodySchema: Za
|
1543
|
+
}), to = {
|
1542
1544
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
1543
|
-
},
|
1545
|
+
}, no = (e, t, n) => D({
|
1544
1546
|
...n,
|
1545
|
-
queryFn: async ({ queryKey: [a, o, i] }) =>
|
1547
|
+
queryFn: async ({ queryKey: [a, o, i] }) => Q(e, eo, {
|
1546
1548
|
pathParams: { projectId: o, contributorId: i },
|
1547
1549
|
headers: await t.resolve()
|
1548
1550
|
})
|
1549
1551
|
});
|
1550
|
-
function
|
1551
|
-
const a =
|
1552
|
-
return
|
1553
|
-
queryKey:
|
1552
|
+
function rs(e, t, n) {
|
1553
|
+
const a = Yt();
|
1554
|
+
return no(e, t, {
|
1555
|
+
queryKey: to.projectUserKey(n, (a == null ? void 0 : a.userId) ?? 0),
|
1554
1556
|
enabled: a !== void 0
|
1555
1557
|
});
|
1556
1558
|
}
|
1557
|
-
const
|
1559
|
+
const ro = r.object({
|
1558
1560
|
lang_iso: r.string(),
|
1559
1561
|
custom_iso: r.string().optional()
|
1560
|
-
}),
|
1562
|
+
}), ao = r.object({
|
1561
1563
|
language_id: r.number(),
|
1562
1564
|
language_iso: r.string(),
|
1563
1565
|
progress: r.number(),
|
1564
1566
|
words_to_do: r.number()
|
1565
|
-
}),
|
1567
|
+
}), oo = r.object({
|
1566
1568
|
projectId: r.string()
|
1567
|
-
}),
|
1569
|
+
}), Xt = r.object({
|
1568
1570
|
lang_id: r.number(),
|
1569
1571
|
lang_iso: r.string(),
|
1570
1572
|
lang_name: r.string(),
|
1571
1573
|
is_rtl: r.boolean(),
|
1572
1574
|
plural_forms: r.array(r.string().optional())
|
1573
|
-
}),
|
1575
|
+
}), so = r.object({
|
1574
1576
|
project_id: r.string(),
|
1575
1577
|
project_uuid: r.string().uuid(),
|
1576
|
-
languages: r.array(
|
1577
|
-
}),
|
1578
|
+
languages: r.array(Xt)
|
1579
|
+
}), io = r.object({
|
1578
1580
|
projectId: r.string()
|
1579
|
-
}),
|
1581
|
+
}), co = r.object({
|
1582
|
+
languages: r.array(
|
1583
|
+
r.object({
|
1584
|
+
lang_iso: r.string(),
|
1585
|
+
custom_iso: r.string().optional(),
|
1586
|
+
custom_name: r.string().optional(),
|
1587
|
+
custom_plural_forms: r.array(r.string()).optional()
|
1588
|
+
})
|
1589
|
+
)
|
1590
|
+
}), lo = r.object({
|
1591
|
+
project_id: r.string(),
|
1592
|
+
project_uuid: r.string().uuid(),
|
1593
|
+
languages: r.array(Xt),
|
1594
|
+
errors: r.array(
|
1595
|
+
r.object({
|
1596
|
+
message: r.string(),
|
1597
|
+
code: r.number(),
|
1598
|
+
lang_iso: r.string()
|
1599
|
+
})
|
1600
|
+
).optional()
|
1601
|
+
}), uo = r.object({
|
1602
|
+
projectId: r.string()
|
1603
|
+
}), mo = r.object({
|
1580
1604
|
langs: r.array(
|
1581
1605
|
r.object({
|
1582
1606
|
lang_iso: r.string(),
|
1583
1607
|
base_lang: r.boolean()
|
1584
1608
|
})
|
1585
1609
|
)
|
1586
|
-
}),
|
1610
|
+
}), _o = r.object({
|
1587
1611
|
result: r.boolean()
|
1588
|
-
}),
|
1612
|
+
}), go = Y({
|
1589
1613
|
description: "List of project languages",
|
1590
|
-
requestHeaderSchema:
|
1591
|
-
requestPathParamsSchema:
|
1614
|
+
requestHeaderSchema: $,
|
1615
|
+
requestPathParamsSchema: oo,
|
1592
1616
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1593
|
-
successResponseBodySchema:
|
1594
|
-
}),
|
1617
|
+
successResponseBodySchema: so
|
1618
|
+
}), po = jt({
|
1619
|
+
description: "Add languages to existing project",
|
1620
|
+
requestHeaderSchema: $,
|
1621
|
+
method: "post",
|
1622
|
+
requestPathParamsSchema: io,
|
1623
|
+
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1624
|
+
requestBodySchema: co,
|
1625
|
+
successResponseBodySchema: lo
|
1626
|
+
}), fo = jt({
|
1595
1627
|
description: "Bulk update project languages",
|
1596
|
-
requestHeaderSchema:
|
1628
|
+
requestHeaderSchema: $,
|
1597
1629
|
method: "put",
|
1598
|
-
requestPathParamsSchema:
|
1630
|
+
requestPathParamsSchema: uo,
|
1599
1631
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages/bulk-update`,
|
1600
|
-
requestBodySchema:
|
1601
|
-
successResponseBodySchema:
|
1602
|
-
}),
|
1632
|
+
requestBodySchema: mo,
|
1633
|
+
successResponseBodySchema: _o
|
1634
|
+
}), ue = $, Fe = r.union([
|
1603
1635
|
r.literal("localization_files"),
|
1604
1636
|
r.literal("paged_documents"),
|
1605
1637
|
r.literal("marketing")
|
1606
|
-
]),
|
1638
|
+
]), ho = r.object({
|
1607
1639
|
per_platform_key_names: r.boolean(),
|
1608
1640
|
reviewing: r.boolean(),
|
1609
1641
|
auto_toggle_unverified: r.boolean(),
|
@@ -1614,7 +1646,7 @@ const eo = r.object({
|
|
1614
1646
|
custom_translation_statuses_allow_multiple: r.boolean(),
|
1615
1647
|
segmentation: r.boolean(),
|
1616
1648
|
contributor_preview_download_enabled: r.boolean()
|
1617
|
-
}),
|
1649
|
+
}), bo = r.object({
|
1618
1650
|
not_reviewed: r.number(),
|
1619
1651
|
unverified: r.number(),
|
1620
1652
|
spelling_grammar: r.number(),
|
@@ -1631,18 +1663,18 @@ const eo = r.object({
|
|
1631
1663
|
double_space: r.number(),
|
1632
1664
|
special_placeholder: r.number(),
|
1633
1665
|
unbalanced_brackets: r.number()
|
1634
|
-
}),
|
1666
|
+
}), vo = r.object({
|
1635
1667
|
progress_total: r.number(),
|
1636
1668
|
keys_total: r.number(),
|
1637
1669
|
team: r.number(),
|
1638
1670
|
base_words: r.number(),
|
1639
1671
|
qa_issues_total: r.number(),
|
1640
|
-
qa_issues:
|
1641
|
-
languages: r.array(
|
1642
|
-
}),
|
1672
|
+
qa_issues: bo,
|
1673
|
+
languages: r.array(ao)
|
1674
|
+
}), me = r.object({
|
1643
1675
|
project_id: r.string(),
|
1644
1676
|
uuid: r.string().uuid(),
|
1645
|
-
project_type:
|
1677
|
+
project_type: Fe,
|
1646
1678
|
name: r.string(),
|
1647
1679
|
description: r.string(),
|
1648
1680
|
created_at: r.string(),
|
@@ -1652,119 +1684,129 @@ const eo = r.object({
|
|
1652
1684
|
team_id: r.number(),
|
1653
1685
|
base_language_id: r.number(),
|
1654
1686
|
base_language_iso: r.string(),
|
1655
|
-
settings:
|
1656
|
-
statistics:
|
1657
|
-
}),
|
1687
|
+
settings: ho.optional(),
|
1688
|
+
statistics: vo.optional()
|
1689
|
+
}), To = r.object({
|
1658
1690
|
name: r.string(),
|
1659
1691
|
team_id: r.string(),
|
1660
1692
|
base_lang_iso: r.string(),
|
1661
|
-
languages: r.array(
|
1662
|
-
project_type:
|
1693
|
+
languages: r.array(ro),
|
1694
|
+
project_type: Fe,
|
1663
1695
|
is_segmentation_enabled: r.boolean()
|
1664
|
-
}), Et = r.union([r.literal(0), r.literal(1)]),
|
1665
|
-
filter_type:
|
1696
|
+
}), Et = r.union([r.literal(0), r.literal(1)]), yo = r.object({
|
1697
|
+
filter_type: Fe.optional(),
|
1666
1698
|
filter_team_id: r.number().optional(),
|
1667
1699
|
filter_names: r.string().optional(),
|
1668
1700
|
include_statistics: Et.optional(),
|
1669
1701
|
include_settings: Et.optional(),
|
1670
1702
|
limit: r.number().optional(),
|
1671
1703
|
page: r.number().optional()
|
1672
|
-
}),
|
1673
|
-
projects: r.array(
|
1674
|
-
}),
|
1704
|
+
}), So = r.object({
|
1705
|
+
projects: r.array(me)
|
1706
|
+
}), Eo = r.object({
|
1675
1707
|
project_id: r.string()
|
1676
|
-
}),
|
1708
|
+
}), Co = r.object({
|
1677
1709
|
project_id: r.string()
|
1678
|
-
}),
|
1710
|
+
}), wo = r.object({
|
1679
1711
|
name: r.string().min(1),
|
1680
1712
|
description: r.string().optional()
|
1681
|
-
}),
|
1713
|
+
}), _e = () => "/projects", Po = qe({
|
1682
1714
|
description: "Create a new project",
|
1683
|
-
requestHeaderSchema:
|
1715
|
+
requestHeaderSchema: ue,
|
1684
1716
|
method: "post",
|
1685
|
-
pathResolver:
|
1686
|
-
requestBodySchema:
|
1687
|
-
successResponseBodySchema:
|
1688
|
-
}),
|
1717
|
+
pathResolver: _e,
|
1718
|
+
requestBodySchema: To,
|
1719
|
+
successResponseBodySchema: me
|
1720
|
+
}), Ao = Y({
|
1689
1721
|
description: "List all projects",
|
1690
|
-
requestHeaderSchema:
|
1691
|
-
pathResolver:
|
1692
|
-
requestQuerySchema:
|
1693
|
-
successResponseBodySchema:
|
1694
|
-
}),
|
1722
|
+
requestHeaderSchema: ue,
|
1723
|
+
pathResolver: _e,
|
1724
|
+
requestQuerySchema: yo,
|
1725
|
+
successResponseBodySchema: So
|
1726
|
+
}), ko = Y({
|
1695
1727
|
description: "Retrieve a project",
|
1696
|
-
requestHeaderSchema:
|
1697
|
-
requestPathParamsSchema:
|
1698
|
-
pathResolver: ({ project_id: e }) => `${
|
1699
|
-
successResponseBodySchema:
|
1700
|
-
}),
|
1728
|
+
requestHeaderSchema: ue,
|
1729
|
+
requestPathParamsSchema: Eo,
|
1730
|
+
pathResolver: ({ project_id: e }) => `${_e()}/${e}`,
|
1731
|
+
successResponseBodySchema: me
|
1732
|
+
}), Io = qe({
|
1701
1733
|
description: "Update a project",
|
1702
|
-
requestHeaderSchema:
|
1734
|
+
requestHeaderSchema: ue,
|
1703
1735
|
method: "put",
|
1704
|
-
requestPathParamsSchema:
|
1705
|
-
pathResolver: ({ project_id: e }) => `${
|
1706
|
-
requestBodySchema:
|
1707
|
-
successResponseBodySchema:
|
1736
|
+
requestPathParamsSchema: Co,
|
1737
|
+
pathResolver: ({ project_id: e }) => `${_e()}/${e}`,
|
1738
|
+
requestBodySchema: wo,
|
1739
|
+
successResponseBodySchema: me
|
1708
1740
|
});
|
1709
|
-
function
|
1710
|
-
return
|
1741
|
+
function as(e, t, n = {}) {
|
1742
|
+
return de({
|
1711
1743
|
...n,
|
1712
|
-
mutationFn: async (a) =>
|
1744
|
+
mutationFn: async (a) => U(e, Po, {
|
1713
1745
|
headers: await t.resolve(),
|
1714
1746
|
body: a
|
1715
1747
|
})
|
1716
1748
|
});
|
1717
1749
|
}
|
1718
|
-
const
|
1750
|
+
const os = {
|
1719
1751
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1720
1752
|
};
|
1721
|
-
function
|
1753
|
+
function ss(e, t, n) {
|
1722
1754
|
return D({
|
1723
1755
|
...n,
|
1724
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1756
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, go, {
|
1725
1757
|
headers: await t.resolve(),
|
1726
1758
|
pathParams: { projectId: o }
|
1727
1759
|
})
|
1728
1760
|
});
|
1729
1761
|
}
|
1730
|
-
const
|
1762
|
+
const is = {
|
1731
1763
|
paramsKey: (e) => ["listProjects", e]
|
1732
1764
|
};
|
1733
|
-
function
|
1765
|
+
function cs(e, t, n) {
|
1734
1766
|
return D({
|
1735
1767
|
...n,
|
1736
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1768
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, Ao, {
|
1737
1769
|
headers: await t.resolve(),
|
1738
1770
|
queryParams: o
|
1739
1771
|
})
|
1740
1772
|
});
|
1741
1773
|
}
|
1742
|
-
const
|
1774
|
+
const ls = {
|
1743
1775
|
projectIdKey: (e) => ["retrieveProject", e]
|
1744
1776
|
};
|
1745
|
-
function
|
1777
|
+
function ds(e, t, n) {
|
1746
1778
|
return D({
|
1747
1779
|
...n,
|
1748
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1780
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, ko, {
|
1749
1781
|
headers: await t.resolve(),
|
1750
1782
|
pathParams: { project_id: o }
|
1751
1783
|
})
|
1752
1784
|
});
|
1753
1785
|
}
|
1754
|
-
function
|
1755
|
-
return
|
1786
|
+
function us(e, t, n, a = {}) {
|
1787
|
+
return de({
|
1756
1788
|
...a,
|
1757
|
-
mutationFn: async (o) =>
|
1789
|
+
mutationFn: async (o) => U(e, Io, {
|
1758
1790
|
headers: await t.resolve(),
|
1759
1791
|
body: o,
|
1760
1792
|
pathParams: n
|
1761
1793
|
})
|
1762
1794
|
});
|
1763
1795
|
}
|
1764
|
-
function
|
1765
|
-
return
|
1796
|
+
function ms(e, t, n, a = {}) {
|
1797
|
+
return de({
|
1798
|
+
...a,
|
1799
|
+
mutationFn: async (o) => U(e, fo, {
|
1800
|
+
pathParams: t,
|
1801
|
+
headers: await n.resolve(),
|
1802
|
+
body: o
|
1803
|
+
})
|
1804
|
+
});
|
1805
|
+
}
|
1806
|
+
function _s(e, t, n, a = {}) {
|
1807
|
+
return de({
|
1766
1808
|
...a,
|
1767
|
-
mutationFn: async (o) =>
|
1809
|
+
mutationFn: async (o) => U(e, po, {
|
1768
1810
|
pathParams: t,
|
1769
1811
|
headers: await n.resolve(),
|
1770
1812
|
body: o
|
@@ -1772,70 +1814,72 @@ function ss(e, t, n, a = {}) {
|
|
1772
1814
|
});
|
1773
1815
|
}
|
1774
1816
|
export {
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1817
|
+
Wo as Breadcrumbs,
|
1818
|
+
Bt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1819
|
+
dr as ENTERPRISE_PLAN_IDS,
|
1820
|
+
cr as ESSENTIAL_PLAN_IDS,
|
1821
|
+
qt as FREE_PLAN_ID,
|
1822
|
+
I as HeaderBuilder,
|
1823
|
+
Yo as JwtAuthHeaderBuilderMiddleware,
|
1782
1824
|
oe as NavigationPanel,
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1825
|
+
Qo as NavigationTabs,
|
1826
|
+
lr as PRO_PLAN_IDS,
|
1827
|
+
Xo as PublicApiHeaderBuilderMiddleware,
|
1828
|
+
ir as START_PLAN_IDS,
|
1829
|
+
k as Sidebar,
|
1830
|
+
A as SidebarTaskLanguageStatuses,
|
1831
|
+
Le as SidebarTaskStatuses,
|
1790
1832
|
re as SidebarTaskTypeOptions,
|
1791
|
-
|
1833
|
+
sr as TRIAL_PLAN_ID,
|
1792
1834
|
se as UnauthorizedError,
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1835
|
+
po as addLanguagesToProject,
|
1836
|
+
fo as bulkUpdateProjectLanguages,
|
1837
|
+
_r as convertNewLineToBreakTag,
|
1838
|
+
zt as createHeaderBuilderMiddleware,
|
1839
|
+
Po as createProject,
|
1797
1840
|
hr as formatDate,
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1841
|
+
Jo as formatDateTz,
|
1842
|
+
Zo as generateTokenFromClassicSession,
|
1843
|
+
Vo as getAuthenticatedSessionDetailFromRequest,
|
1844
|
+
Ma as getCsrfTokenFromCookie,
|
1845
|
+
Wt as getJwtTokenFromCookie,
|
1846
|
+
Wa as getTeamUser,
|
1847
|
+
Qa as getTeamUsersQueryKey,
|
1848
|
+
Ge as getUserToken,
|
1849
|
+
Ga as getUserTokenKey,
|
1850
|
+
zo as isEnterpriseOpenSourcePlan,
|
1851
|
+
Fo as isEnterprisePlan,
|
1852
|
+
$o as isEssentialPlan,
|
1810
1853
|
De as isFreePlan,
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1854
|
+
Ko as isPaidPlan,
|
1855
|
+
Go as isProPlan,
|
1856
|
+
Do as isStartPlan,
|
1857
|
+
Dt as isTrialPlan,
|
1858
|
+
go as listProjectLanguages,
|
1859
|
+
os as listProjectLanguagesKey,
|
1860
|
+
Ao as listProjects,
|
1861
|
+
is as listProjectsKey,
|
1862
|
+
fr as makeUrlClickable,
|
1863
|
+
Z as parseJwtTokenPayload,
|
1864
|
+
es as refreshExpiredToken,
|
1865
|
+
eo as retrieveContributor,
|
1866
|
+
to as retrieveContributorKeys,
|
1867
|
+
ko as retrieveProject,
|
1868
|
+
ls as retrieveProjectQueryKey,
|
1869
|
+
Io as updateProject,
|
1870
|
+
_s as useAddLanguagesToProjectMutation,
|
1871
|
+
rs as useAuthenticatedProjectContributor,
|
1872
|
+
Yt as useAuthenticatedSessionPayload,
|
1873
|
+
ns as useAuthenticatedUser,
|
1874
|
+
ms as useBulkUpdateProjectLanguagesMutation,
|
1875
|
+
as as useCreateProjectMutation,
|
1832
1876
|
$e as useEffectOnce,
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1877
|
+
ts as useGetPromotedClassicSessionJwtQuery,
|
1878
|
+
Ya as useGetTeamUsersQuery,
|
1879
|
+
Fa as useGetUserTokenQuery,
|
1880
|
+
ss as useListProjectLanguagesQuery,
|
1881
|
+
cs as useListProjectsQuery,
|
1882
|
+
no as useRetrieveContributorQuery,
|
1883
|
+
ds as useRetrieveProjectQuery,
|
1884
|
+
us as useUpdateProjectMutation
|
1841
1885
|
};
|