@lokalise/harmony 1.19.1 → 1.20.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.mjs +672 -630
- 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 +3 -2
- 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 p, 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 kt, forwardRef as rn } from "react";
|
7
|
+
import { Tooltip as B, Link as L, Menu as ce, MenuList as le, CaretUpIcon as an, UserIcon as At, 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 M, 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
|
+
}, k = {
|
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 fe, Qe;
|
34
34
|
function Be() {
|
35
|
-
if (Qe) return
|
35
|
+
if (Qe) return fe;
|
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 fe = e, fe;
|
42
42
|
}
|
43
|
-
var
|
44
|
-
function
|
45
|
-
if (
|
46
|
-
|
43
|
+
var pe, Ye;
|
44
|
+
function gn() {
|
45
|
+
if (Ye) return pe;
|
46
|
+
Ye = 1;
|
47
47
|
var e = typeof ae == "object" && ae && ae.Object === Object && ae;
|
48
|
-
return
|
48
|
+
return pe = e, pe;
|
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 fn() {
|
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 pn() {
|
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 = pn(), 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
151
|
var ke, it;
|
152
|
-
function
|
152
|
+
function En() {
|
153
153
|
if (it) return ke;
|
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
171
|
return ke = u, ke;
|
172
172
|
}
|
173
|
-
var
|
174
|
-
function
|
175
|
-
if (ct) return
|
173
|
+
var Ae, ct;
|
174
|
+
function Lt() {
|
175
|
+
if (ct) return Ae;
|
176
176
|
ct = 1;
|
177
|
-
var e = Be(), t =
|
177
|
+
var e = Be(), t = fn(), 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, f = !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) && (f = !!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), f ? 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 Ae = c, Ae;
|
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 kn =
|
247
|
-
const
|
246
|
+
var kn = Pn();
|
247
|
+
const An = /* @__PURE__ */ Nt(kn), 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 An(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]), f = 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(f), 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 = f).cancel) === null || C === void 0 || C.call(w);
|
329
329
|
};
|
330
|
-
}, [
|
330
|
+
}, [f, _]), 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__ */ p(
|
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
|
-
},
|
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
393
|
L,
|
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_ywskt_5", er = "_profileButton_ywskt_15", tr = "_profileImage_ywskt_28", nr = "_profileImageHighlight_ywskt_36", rr = "_profileImageUpgradeIcon_ywskt_40", ar = "_userIconWrapper_ywskt_46", O = {
|
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,28 +454,28 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
454
454
|
return /* @__PURE__ */ s(
|
455
455
|
ce,
|
456
456
|
{
|
457
|
-
menuButton: () => /* @__PURE__ */
|
457
|
+
menuButton: () => /* @__PURE__ */ p("button", { className: O.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:
|
463
|
-
[
|
462
|
+
className: j(O.profileImage, {
|
463
|
+
[O.profileImageHighlight]: a
|
464
464
|
}),
|
465
465
|
alt: "Team Logo"
|
466
466
|
}
|
467
467
|
) : /* @__PURE__ */ s(
|
468
468
|
"div",
|
469
469
|
{
|
470
|
-
className:
|
471
|
-
[
|
470
|
+
className: j(O.userIconWrapper, "flex-row", "align-center", "items-center", {
|
471
|
+
[O.profileImageHighlight]: a
|
472
472
|
}),
|
473
|
-
children: /* @__PURE__ */ s(
|
473
|
+
children: /* @__PURE__ */ s(At, { size: "25px" })
|
474
474
|
}
|
475
475
|
),
|
476
|
-
a && /* @__PURE__ */ s(
|
476
|
+
a && /* @__PURE__ */ s(Ut, { className: O.profileImageUpgradeIcon })
|
477
477
|
] }),
|
478
|
-
children: /* @__PURE__ */ s(le, { placement: "right-end", className:
|
478
|
+
children: /* @__PURE__ */ s(le, { placement: "right-end", className: O.menuContainer, children: e({
|
479
479
|
allowTeamCreation: i,
|
480
480
|
otherTeams: n,
|
481
481
|
canAccessTeamSettings: d,
|
@@ -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, qo = (e) => ir.includes(e), Bo = (e) => cr.includes(e), Do = (e) => lr.includes(e), $o = (e) => dr.includes(e), Go = (e) => e > qt && e < Bt, Fo = (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, fr = (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,138 @@ 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 = fr(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
|
+
}, pr = (e) => typeof e == "string" ? gt(e) : e.flatMap((t) => typeof t == "string" ? gt(t) : t, e), hr = (e, t = "PP") => Rt(e, t), Ko = (e, t, n = "PP") => Rt(_n(e, t), n), $e = (e) => {
|
502
|
+
J(e, []);
|
503
|
+
}, ft = {
|
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
|
+
}, pt = [
|
507
|
+
ft.biller,
|
508
|
+
ft.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((f) => f.id === a), l = n.filter((f) => f.id !== a), m = pt.includes(d), g = pt.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__ */ p(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__ */ p("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:
|
548
|
+
}, Er = "_wrapper_15d85_1", Cr = "_profileImage_15d85_14", wr = "_teamName_15d85_22", Pr = "_planLabel_15d85_29", kr = "_membership_15d85_38", Ar = "_defaultProfileImage_15d85_44", U = {
|
549
|
+
wrapper: Er,
|
550
|
+
profileImage: Cr,
|
551
551
|
teamName: wr,
|
552
|
-
planLabel:
|
552
|
+
planLabel: Pr,
|
553
553
|
membership: kr,
|
554
|
-
defaultProfileImage:
|
555
|
-
},
|
554
|
+
defaultProfileImage: Ar
|
555
|
+
}, $t = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
556
556
|
const { currentTeam: a, planId: o } = X(), i = e || a;
|
557
557
|
if (!i)
|
558
558
|
return null;
|
559
|
-
const c = De(o) ? "Free" :
|
560
|
-
return /* @__PURE__ */
|
561
|
-
t ?
|
559
|
+
const c = De(o) ? "Free" : Dt(o) ? "Trial" : void 0;
|
560
|
+
return /* @__PURE__ */ p(
|
561
|
+
t ? W : "div",
|
562
562
|
{
|
563
|
-
className: `flex-row gap-2 flex-nowrap items-center ${
|
563
|
+
className: `flex-row gap-2 flex-nowrap items-center ${U.wrapper}`,
|
564
564
|
...t && { onClick: () => t(i) },
|
565
565
|
children: [
|
566
|
-
i.logoUrl ? /* @__PURE__ */ s("img", { className:
|
567
|
-
/* @__PURE__ */
|
568
|
-
/* @__PURE__ */
|
569
|
-
/* @__PURE__ */ s("span", { title: i.name, className:
|
570
|
-
c && !n && /* @__PURE__ */ s("span", { className: `flex-row justify-center items-center ${
|
566
|
+
i.logoUrl ? /* @__PURE__ */ s("img", { className: U.profileImage, src: i.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ s("span", { className: `flex-row justify-center items-center ${U.defaultProfileImage}`, children: /* @__PURE__ */ s(At, { size: "25px" }) }),
|
567
|
+
/* @__PURE__ */ p("div", { className: "flex-col items-start", children: [
|
568
|
+
/* @__PURE__ */ p("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
569
|
+
/* @__PURE__ */ s("span", { title: i.name, className: U.teamName, children: i.name }),
|
570
|
+
c && !n && /* @__PURE__ */ s("span", { className: `flex-row justify-center items-center ${U.planLabel}`, children: c })
|
571
571
|
] }),
|
572
|
-
/* @__PURE__ */ s("span", { className:
|
572
|
+
/* @__PURE__ */ s("span", { className: U.membership, children: i.role })
|
573
573
|
] })
|
574
574
|
]
|
575
575
|
}
|
576
576
|
);
|
577
|
-
}, Ir = "_teamsContainer_1t68g_1",
|
577
|
+
}, Ir = "_teamsContainer_1t68g_1", Rr = {
|
578
578
|
teamsContainer: Ir
|
579
|
-
},
|
579
|
+
}, jr = ({ onSwitchTeam: e }) => {
|
580
580
|
const { otherTeams: t } = X();
|
581
581
|
return t.length === 0 ? null : /* @__PURE__ */ s(
|
582
582
|
"div",
|
583
583
|
{
|
584
584
|
"data-testid": "sidebar-team-switch",
|
585
|
-
className: `flex-col items-stretch ${
|
586
|
-
children: t.map((n) => /* @__PURE__ */ s(
|
585
|
+
className: `flex-col items-stretch ${Rr.teamsContainer}`,
|
586
|
+
children: t.map((n) => /* @__PURE__ */ s($t, { team: n, onClick: e, hidePlanLabel: !0 }, n.id))
|
587
587
|
}
|
588
588
|
);
|
589
|
-
}, Nr = "_container_1u995_1",
|
589
|
+
}, Nr = "_container_1u995_1", Or = "_planCta_1u995_15", xr = "_upgradeIconWrapper_1u995_19", Re = {
|
590
590
|
container: Nr,
|
591
|
-
planCta:
|
591
|
+
planCta: Or,
|
592
592
|
upgradeIconWrapper: xr
|
593
|
-
},
|
593
|
+
}, Lr = ({ upgradeOptionHref: e }) => {
|
594
594
|
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = X();
|
595
595
|
if (!a)
|
596
596
|
return null;
|
597
597
|
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
|
-
|
598
|
+
return /* @__PURE__ */ p(
|
599
|
+
W,
|
600
600
|
{
|
601
601
|
"data-testid": "sidebar-upgrade-menu-item",
|
602
602
|
href: e,
|
603
|
-
className: `flex-col gap-1 items-start ${
|
603
|
+
className: `flex-col gap-1 items-start ${Re.container}`,
|
604
604
|
children: [
|
605
|
-
/* @__PURE__ */ s("span", { className:
|
606
|
-
/* @__PURE__ */
|
607
|
-
/* @__PURE__ */ s(
|
605
|
+
/* @__PURE__ */ s("span", { className: Re.planCta, children: c }),
|
606
|
+
/* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${Re.upgradeIconWrapper}`, children: [
|
607
|
+
/* @__PURE__ */ s(Ut, {}),
|
608
608
|
/* @__PURE__ */ s("span", { children: "See upgrade options" })
|
609
609
|
] })
|
610
610
|
]
|
611
611
|
}
|
612
612
|
);
|
613
|
-
},
|
613
|
+
}, Mr = Math.min, Ur = Math.max;
|
614
614
|
function bt(e, t, n) {
|
615
|
-
return
|
615
|
+
return Ur(e, Mr(t, n));
|
616
616
|
}
|
617
|
-
function
|
617
|
+
function Gt(e, t) {
|
618
618
|
return typeof e == "function" ? e(t) : e;
|
619
619
|
}
|
620
620
|
function Ft(e) {
|
621
621
|
return e.split("-")[0];
|
622
622
|
}
|
623
|
-
function
|
623
|
+
function Hr(e) {
|
624
624
|
return e === "x" ? "y" : "x";
|
625
625
|
}
|
626
|
-
function
|
626
|
+
function qr(e) {
|
627
627
|
return ["top", "bottom"].includes(Ft(e)) ? "y" : "x";
|
628
628
|
}
|
629
|
-
function
|
629
|
+
function Br(e) {
|
630
630
|
return {
|
631
631
|
top: 0,
|
632
632
|
right: 0,
|
@@ -635,8 +635,8 @@ function qr(e) {
|
|
635
635
|
...e
|
636
636
|
};
|
637
637
|
}
|
638
|
-
function
|
639
|
-
return typeof e != "number" ?
|
638
|
+
function Dr(e) {
|
639
|
+
return typeof e != "number" ? Br(e) : {
|
640
640
|
top: e,
|
641
641
|
right: e,
|
642
642
|
bottom: e,
|
@@ -661,7 +661,7 @@ function vt(e) {
|
|
661
661
|
y: n
|
662
662
|
};
|
663
663
|
}
|
664
|
-
async function
|
664
|
+
async function $r(e, t) {
|
665
665
|
var n;
|
666
666
|
t === void 0 && (t = {});
|
667
667
|
const {
|
@@ -674,39 +674,39 @@ async function Dr(e, t) {
|
|
674
674
|
} = e, {
|
675
675
|
boundary: l = "clippingAncestors",
|
676
676
|
rootBoundary: m = "viewport",
|
677
|
-
elementContext:
|
677
|
+
elementContext: g = "floating",
|
678
678
|
altBoundary: T = !1,
|
679
679
|
padding: y = 0
|
680
|
-
} =
|
680
|
+
} = Gt(t, e), _ = Dr(y), b = d[T ? g === "floating" ? "reference" : "floating" : g], f = vt(await i.getClippingRect({
|
681
681
|
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
682
|
boundary: l,
|
683
683
|
rootBoundary: m,
|
684
684
|
strategy: u
|
685
|
-
})),
|
685
|
+
})), h = g === "floating" ? {
|
686
686
|
x: a,
|
687
687
|
y: o,
|
688
688
|
width: c.floating.width,
|
689
689
|
height: c.floating.height
|
690
|
-
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d.floating)),
|
690
|
+
} : 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
691
|
x: 1,
|
692
692
|
y: 1
|
693
693
|
} : {
|
694
694
|
x: 1,
|
695
695
|
y: 1
|
696
|
-
},
|
696
|
+
}, C = vt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
697
697
|
elements: d,
|
698
|
-
rect:
|
698
|
+
rect: h,
|
699
699
|
offsetParent: v,
|
700
700
|
strategy: u
|
701
|
-
}) :
|
701
|
+
}) : h);
|
702
702
|
return {
|
703
|
-
top: (
|
704
|
-
bottom: (
|
705
|
-
left: (
|
706
|
-
right: (
|
703
|
+
top: (f.top - C.top + _.top) / w.y,
|
704
|
+
bottom: (C.bottom - f.bottom + _.bottom) / w.y,
|
705
|
+
left: (f.left - C.left + _.left) / w.x,
|
706
|
+
right: (C.right - f.right + _.right) / w.x
|
707
707
|
};
|
708
708
|
}
|
709
|
-
const
|
709
|
+
const Gr = function(e) {
|
710
710
|
return e === void 0 && (e = {}), {
|
711
711
|
name: "shift",
|
712
712
|
options: e,
|
@@ -721,33 +721,33 @@ const $r = function(e) {
|
|
721
721
|
limiter: d = {
|
722
722
|
fn: (b) => {
|
723
723
|
let {
|
724
|
-
x:
|
725
|
-
y:
|
724
|
+
x: f,
|
725
|
+
y: h
|
726
726
|
} = b;
|
727
727
|
return {
|
728
|
-
x:
|
729
|
-
y:
|
728
|
+
x: f,
|
729
|
+
y: h
|
730
730
|
};
|
731
731
|
}
|
732
732
|
},
|
733
733
|
...u
|
734
|
-
} =
|
734
|
+
} = Gt(e, t), l = {
|
735
735
|
x: n,
|
736
736
|
y: a
|
737
|
-
}, m = await
|
738
|
-
let y = l[T],
|
737
|
+
}, m = await $r(t, u), g = qr(Ft(o)), T = Hr(g);
|
738
|
+
let y = l[T], _ = l[g];
|
739
739
|
if (i) {
|
740
|
-
const b = T === "y" ? "top" : "left",
|
741
|
-
y = bt(
|
740
|
+
const b = T === "y" ? "top" : "left", f = T === "y" ? "bottom" : "right", h = y + m[b], v = y - m[f];
|
741
|
+
y = bt(h, y, v);
|
742
742
|
}
|
743
743
|
if (c) {
|
744
|
-
const b =
|
745
|
-
|
744
|
+
const b = g === "y" ? "top" : "left", f = g === "y" ? "bottom" : "right", h = _ + m[b], v = _ - m[f];
|
745
|
+
_ = bt(h, _, v);
|
746
746
|
}
|
747
747
|
const E = d.fn({
|
748
748
|
...t,
|
749
749
|
[T]: y,
|
750
|
-
[
|
750
|
+
[g]: _
|
751
751
|
});
|
752
752
|
return {
|
753
753
|
...E,
|
@@ -756,56 +756,56 @@ const $r = function(e) {
|
|
756
756
|
y: E.y - a,
|
757
757
|
enabled: {
|
758
758
|
[T]: i,
|
759
|
-
[
|
759
|
+
[g]: c
|
760
760
|
}
|
761
761
|
}
|
762
762
|
};
|
763
763
|
}
|
764
764
|
};
|
765
|
-
}, Fr = "_navItem_1dudv_1",
|
765
|
+
}, Fr = "_navItem_1dudv_1", Kr = "_activeNavItem_1dudv_18", zr = "_badge_1dudv_23", je = {
|
766
766
|
navItem: Fr,
|
767
|
-
activeNavItem:
|
768
|
-
badge:
|
769
|
-
},
|
767
|
+
activeNavItem: Kr,
|
768
|
+
badge: zr
|
769
|
+
}, Kt = Pt({}), V = () => wt(Kt), Jr = (e) => {
|
770
770
|
const t = e.lastIndexOf("."), n = e.slice(0, t), a = e.slice(t + 1);
|
771
771
|
return { name: n, extension: a };
|
772
|
-
},
|
772
|
+
}, Wr = (e, t) => {
|
773
773
|
switch (e) {
|
774
|
-
case
|
774
|
+
case k.Completed:
|
775
775
|
return t < 100 ? "Closed" : "Completed";
|
776
|
-
case
|
776
|
+
case k.Created:
|
777
777
|
return t > 0 ? "In progress" : "Not started";
|
778
|
-
case
|
778
|
+
case k.InProgress:
|
779
779
|
return "In progress";
|
780
|
-
case
|
780
|
+
case k.Queued:
|
781
781
|
return "Queued";
|
782
|
-
case
|
782
|
+
case k.NotStarted:
|
783
783
|
return "Not started";
|
784
784
|
default:
|
785
785
|
return "-";
|
786
786
|
}
|
787
|
-
},
|
787
|
+
}, Qr = (e) => {
|
788
788
|
const t = e.progress ?? 0;
|
789
|
-
return e.status ===
|
790
|
-
},
|
789
|
+
return e.status === k.Created && t > 0 ? k.InProgress : e.status;
|
790
|
+
}, Yr = {
|
791
791
|
[re.translation]: "#0891B2",
|
792
792
|
[re.review]: "#16922D",
|
793
793
|
[re.lqa_by_ai]: "#8B5CF6",
|
794
794
|
[re.automatic_translation]: "#60A5FA"
|
795
795
|
}, Xr = (e) => {
|
796
796
|
const t = [
|
797
|
-
|
798
|
-
|
799
|
-
|
797
|
+
k.InProgress,
|
798
|
+
k.Created,
|
799
|
+
k.Completed
|
800
800
|
];
|
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 } =
|
801
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Qr(n) })).sort((n, a) => n.status === k.InProgress && n.progress === 100 ? -1 : a.status === k.InProgress && a.progress === 100 ? 1 : n.status === a.status ? n.name < a.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(a.status));
|
802
|
+
}, Tt = (e) => [Le.InProgress, Le.Created].includes(e), Vr = (e, t) => Tt(e.status) && Tt(t.status) && (t.progress ?? 0) >= 100, Zr = ({ task: e, language: t }) => {
|
803
|
+
const [n, a] = R(!1), [o, i] = R(!1), { onLanguageCompleteConfirm: c, fetchTasks: d } = V(), u = () => {
|
804
804
|
i(!1);
|
805
805
|
};
|
806
|
-
return /* @__PURE__ */
|
806
|
+
return /* @__PURE__ */ p(He, { children: [
|
807
807
|
o && /* @__PURE__ */ s(
|
808
|
-
|
808
|
+
on,
|
809
809
|
{
|
810
810
|
opened: !0,
|
811
811
|
loading: n,
|
@@ -816,7 +816,7 @@ const $r = function(e) {
|
|
816
816
|
onConfirm: async () => {
|
817
817
|
a(!0), await c({ task: e, language: t, closePrompt: u }), d();
|
818
818
|
},
|
819
|
-
children: /* @__PURE__ */
|
819
|
+
children: /* @__PURE__ */ p(sn, { status: "info", children: [
|
820
820
|
"Make sure you are finished and ",
|
821
821
|
/* @__PURE__ */ s("strong", { children: "mark it as done" }),
|
822
822
|
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
@@ -834,20 +834,20 @@ const $r = function(e) {
|
|
834
834
|
}
|
835
835
|
)
|
836
836
|
] });
|
837
|
-
},
|
838
|
-
langRowCompleted:
|
839
|
-
langCellSecondary:
|
840
|
-
langStatus:
|
841
|
-
},
|
842
|
-
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } =
|
843
|
-
return /* @__PURE__ */
|
837
|
+
}, ea = "_langRowCompleted_vpgdi_1", ta = "_langCellSecondary_vpgdi_15", na = "_langStatus_vpgdi_20", Ne = {
|
838
|
+
langRowCompleted: ea,
|
839
|
+
langCellSecondary: ta,
|
840
|
+
langStatus: na
|
841
|
+
}, ra = ({ language: e, task: t }) => {
|
842
|
+
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } = V(), i = e.progress ?? 0, c = e.status === k.Completed, d = Vr(t, e);
|
843
|
+
return /* @__PURE__ */ p(
|
844
844
|
"tr",
|
845
845
|
{
|
846
|
-
className:
|
846
|
+
className: j({
|
847
847
|
[Ne.langRowCompleted]: d
|
848
848
|
}),
|
849
849
|
children: [
|
850
|
-
/* @__PURE__ */ s("td", { children: /* @__PURE__ */ s(
|
850
|
+
/* @__PURE__ */ s("td", { children: /* @__PURE__ */ s(B, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ s(
|
851
851
|
L,
|
852
852
|
{
|
853
853
|
href: n({ task: t, language: e }),
|
@@ -857,7 +857,7 @@ const $r = function(e) {
|
|
857
857
|
children: e.name
|
858
858
|
}
|
859
859
|
) }) }),
|
860
|
-
/* @__PURE__ */ s("td", { className: Ne.langCellSecondary, children: d || c ? "0" : /* @__PURE__ */ s(
|
860
|
+
/* @__PURE__ */ s("td", { className: Ne.langCellSecondary, children: d || c ? "0" : /* @__PURE__ */ s(B, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ s(
|
861
861
|
L,
|
862
862
|
{
|
863
863
|
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
@@ -867,42 +867,42 @@ const $r = function(e) {
|
|
867
867
|
children: e.base_words_total - e.base_words_done
|
868
868
|
}
|
869
869
|
) }) }),
|
870
|
-
/* @__PURE__ */
|
870
|
+
/* @__PURE__ */ p("td", { children: [
|
871
871
|
i,
|
872
872
|
"%"
|
873
873
|
] }),
|
874
|
-
/* @__PURE__ */ s("td", { children: d ? /* @__PURE__ */ s(
|
874
|
+
/* @__PURE__ */ s("td", { children: d ? /* @__PURE__ */ s(Zr, { task: t, language: e }) : /* @__PURE__ */ s(
|
875
875
|
"span",
|
876
876
|
{
|
877
877
|
className: `${Ne.langStatus} flex-row items-center justify-start`,
|
878
878
|
"data-status": e.status,
|
879
|
-
children:
|
879
|
+
children: Wr(e.status, i)
|
880
880
|
}
|
881
881
|
) })
|
882
882
|
]
|
883
883
|
}
|
884
884
|
);
|
885
|
-
},
|
886
|
-
taskContainer:
|
887
|
-
taskTitle:
|
888
|
-
taskDescription:
|
889
|
-
languagesTable:
|
890
|
-
metadata:
|
891
|
-
},
|
892
|
-
const { getProjectUrl: t, taskTitleOnClick: n } =
|
885
|
+
}, aa = "_taskContainer_mt2or_1", oa = "_taskTitle_mt2or_21", sa = "_taskDescription_mt2or_28", ia = "_languagesTable_mt2or_35", ca = "_metadata_mt2or_87", H = {
|
886
|
+
taskContainer: aa,
|
887
|
+
taskTitle: oa,
|
888
|
+
taskDescription: sa,
|
889
|
+
languagesTable: ia,
|
890
|
+
metadata: ca
|
891
|
+
}, la = ({ task: e }) => {
|
892
|
+
const { getProjectUrl: t, taskTitleOnClick: n } = V(), a = Xr(e.langs), o = (i) => {
|
893
893
|
window.open(
|
894
894
|
`/style-guide/${e.team_id}/download/${i.id}/link`,
|
895
895
|
"_blank",
|
896
896
|
"noopener,noreferrer"
|
897
897
|
);
|
898
898
|
};
|
899
|
-
return /* @__PURE__ */
|
900
|
-
/* @__PURE__ */
|
901
|
-
/* @__PURE__ */
|
902
|
-
/* @__PURE__ */ s(
|
903
|
-
e.due_date && /* @__PURE__ */
|
899
|
+
return /* @__PURE__ */ p("div", { className: H.taskContainer, children: [
|
900
|
+
/* @__PURE__ */ p("div", { className: "flex-row gap-1 items-center", children: [
|
901
|
+
/* @__PURE__ */ p("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
902
|
+
/* @__PURE__ */ s(Oe, { color: Yr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
903
|
+
e.due_date && /* @__PURE__ */ p(Oe, { color: "#EAB308", children: [
|
904
904
|
"DUE ",
|
905
|
-
hr(
|
905
|
+
hr(un(e.due_date), "yyyy-MM-dd")
|
906
906
|
] })
|
907
907
|
] }),
|
908
908
|
e.style_guides.length > 0 && /* @__PURE__ */ s("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ s(
|
@@ -918,17 +918,17 @@ const $r = function(e) {
|
|
918
918
|
{
|
919
919
|
menuButton: /* @__PURE__ */ s(xe, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
920
920
|
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((i) => /* @__PURE__ */ s(
|
921
|
-
|
921
|
+
W,
|
922
922
|
{
|
923
923
|
onClick: () => o(i),
|
924
|
-
children:
|
924
|
+
children: Jr(i.name).name
|
925
925
|
},
|
926
926
|
i.id
|
927
927
|
)) })
|
928
928
|
}
|
929
929
|
) })
|
930
930
|
] }),
|
931
|
-
/* @__PURE__ */ s("h4", { className:
|
931
|
+
/* @__PURE__ */ s("h4", { className: H.taskTitle, children: /* @__PURE__ */ s(
|
932
932
|
L,
|
933
933
|
{
|
934
934
|
href: t({ task: e, view: "multi" }),
|
@@ -938,75 +938,75 @@ const $r = function(e) {
|
|
938
938
|
children: e.title
|
939
939
|
}
|
940
940
|
) }),
|
941
|
-
e.description && /* @__PURE__ */ s("div", { className:
|
942
|
-
/* @__PURE__ */
|
943
|
-
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */
|
941
|
+
e.description && /* @__PURE__ */ s("div", { className: H.taskDescription, children: _r(pr(e.description)) }),
|
942
|
+
/* @__PURE__ */ p("table", { className: H.languagesTable, children: [
|
943
|
+
/* @__PURE__ */ s("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
944
944
|
/* @__PURE__ */ s("th", { children: "Languages" }),
|
945
945
|
/* @__PURE__ */ s("th", { children: "Words to do" }),
|
946
946
|
/* @__PURE__ */ s("th", { children: "Progress" }),
|
947
947
|
/* @__PURE__ */ s("th", { children: "Status" })
|
948
948
|
] }) }),
|
949
|
-
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(
|
949
|
+
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(ra, { language: i, task: e }, i.lang_id)) })
|
950
950
|
] }),
|
951
|
-
/* @__PURE__ */
|
952
|
-
/* @__PURE__ */
|
951
|
+
/* @__PURE__ */ p("div", { "data-testid": "sidebar-task-overview-metadata", className: H.metadata, children: [
|
952
|
+
/* @__PURE__ */ p("span", { children: [
|
953
953
|
"Source: ",
|
954
954
|
e.source_lang_name
|
955
955
|
] }),
|
956
956
|
/* @__PURE__ */ s("span", { children: e.created_by_fullname }),
|
957
|
-
/* @__PURE__ */
|
957
|
+
/* @__PURE__ */ p("span", { children: [
|
958
958
|
"In ",
|
959
959
|
e.project_name,
|
960
|
-
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className:
|
960
|
+
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className: H.tag, children: e.branch_name ? e.branch_name : "master" })
|
961
961
|
] })
|
962
962
|
] })
|
963
963
|
] });
|
964
|
-
},
|
964
|
+
}, P = {
|
965
965
|
TaskCompleted: "task_completed",
|
966
966
|
TaskClosed: "task_closed",
|
967
967
|
Refresh: "refresh",
|
968
968
|
ShowDialog: "show_dialog"
|
969
|
-
},
|
970
|
-
loadingContainer:
|
971
|
-
noTasksContainer:
|
972
|
-
noTasksHeading:
|
973
|
-
noTasksText:
|
974
|
-
tasksContainer:
|
975
|
-
},
|
976
|
-
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } =
|
969
|
+
}, da = "_loadingContainer_19d6m_1", ua = "_noTasksContainer_19d6m_7", ma = "_noTasksHeading_19d6m_14", _a = "_noTasksText_19d6m_18", ga = "_tasksContainer_19d6m_23", F = {
|
970
|
+
loadingContainer: da,
|
971
|
+
noTasksContainer: ua,
|
972
|
+
noTasksHeading: ma,
|
973
|
+
noTasksText: _a,
|
974
|
+
tasksContainer: ga
|
975
|
+
}, fa = () => {
|
976
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } = V();
|
977
977
|
return $e(() => ((async () => {
|
978
978
|
const i = await a();
|
979
979
|
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(
|
980
|
+
})(), document.addEventListener(P.TaskCompleted, a), document.addEventListener(P.TaskClosed, a), document.addEventListener(P.Refresh, a), () => {
|
981
|
+
document.removeEventListener(P.TaskCompleted, a), document.removeEventListener(P.TaskClosed, a), document.removeEventListener(P.Refresh, a);
|
982
|
+
})), n ? /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-loading-popover", className: F.loadingContainer, children: /* @__PURE__ */ s(cn, {}) }) : e.length === 0 ? /* @__PURE__ */ p("div", { "data-testid": "sidebar-no-tasks-popover", className: F.noTasksContainer, children: [
|
983
983
|
/* @__PURE__ */ s("h3", { className: F.noTasksHeading, children: "No tasks" }),
|
984
|
-
/* @__PURE__ */
|
984
|
+
/* @__PURE__ */ p("div", { className: F.noTasksText, children: [
|
985
985
|
"Your incoming tasks will appear here.",
|
986
986
|
/* @__PURE__ */ s("br", {}),
|
987
987
|
/* @__PURE__ */ s(L, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
988
988
|
] })
|
989
|
-
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(
|
990
|
-
},
|
989
|
+
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(la, { task: o }, o.id)) });
|
990
|
+
}, pa = ({ children: e, config: t }) => {
|
991
991
|
const [n, a] = R([]), [o, i] = R(!0), [c, d] = R(0), {
|
992
992
|
getProjectUrl: u,
|
993
993
|
onLanguageCompleteConfirm: l,
|
994
994
|
onTasksWidgetOpen: m,
|
995
|
-
langNameOnClick:
|
995
|
+
langNameOnClick: g,
|
996
996
|
langProgressOnClick: T,
|
997
997
|
taskTitleOnClick: y
|
998
|
-
} = t, { getTasks:
|
998
|
+
} = t, { getTasks: _, getTasksCount: E } = t, b = async () => {
|
999
999
|
i(!0);
|
1000
|
-
const v = await
|
1000
|
+
const v = await _();
|
1001
1001
|
return a(v), i(!1), v;
|
1002
|
-
},
|
1002
|
+
}, f = async () => {
|
1003
1003
|
const v = await E();
|
1004
1004
|
d(v);
|
1005
1005
|
};
|
1006
|
-
$e(() => (
|
1007
|
-
document.removeEventListener(
|
1006
|
+
$e(() => (f(), document.addEventListener(P.TaskCompleted, f), document.addEventListener(P.TaskClosed, f), document.addEventListener(P.Refresh, f), () => {
|
1007
|
+
document.removeEventListener(P.TaskCompleted, f), document.removeEventListener(P.TaskClosed, f), document.removeEventListener(P.Refresh, f);
|
1008
1008
|
}));
|
1009
|
-
const
|
1009
|
+
const h = {
|
1010
1010
|
fetchTasks: b,
|
1011
1011
|
tasks: n,
|
1012
1012
|
tasksCount: c,
|
@@ -1014,32 +1014,32 @@ const $r = function(e) {
|
|
1014
1014
|
getProjectUrl: u,
|
1015
1015
|
onLanguageCompleteConfirm: l,
|
1016
1016
|
onTasksWidgetOpen: m,
|
1017
|
-
langNameOnClick:
|
1017
|
+
langNameOnClick: g,
|
1018
1018
|
langProgressOnClick: T,
|
1019
1019
|
taskTitleOnClick: y
|
1020
1020
|
};
|
1021
|
-
return /* @__PURE__ */ s(
|
1021
|
+
return /* @__PURE__ */ s(Kt.Provider, { value: h, children: e });
|
1022
1022
|
}, ha = (e) => function(n) {
|
1023
1023
|
const { config: a, ...o } = n;
|
1024
|
-
return /* @__PURE__ */ s(
|
1025
|
-
},
|
1026
|
-
const [e, t] = R(!1), { tasksCount: n } =
|
1024
|
+
return /* @__PURE__ */ s(pa, { config: a, children: /* @__PURE__ */ s(e, { ...o }) });
|
1025
|
+
}, ba = ha(() => {
|
1026
|
+
const [e, t] = R(!1), { tasksCount: n } = V();
|
1027
1027
|
return $e(() => {
|
1028
1028
|
const a = () => {
|
1029
1029
|
t(!0);
|
1030
1030
|
};
|
1031
|
-
return document.addEventListener(
|
1032
|
-
document.removeEventListener(
|
1031
|
+
return document.addEventListener(P.ShowDialog, a), () => {
|
1032
|
+
document.removeEventListener(P.ShowDialog, a);
|
1033
1033
|
};
|
1034
|
-
}), /* @__PURE__ */ s(
|
1035
|
-
|
1034
|
+
}), /* @__PURE__ */ s(B, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ s(
|
1035
|
+
ln,
|
1036
1036
|
{
|
1037
|
-
content: /* @__PURE__ */ s(
|
1037
|
+
content: /* @__PURE__ */ s(fa, {}),
|
1038
1038
|
placement: "right",
|
1039
1039
|
open: e,
|
1040
1040
|
onOpenChange: t,
|
1041
1041
|
middlewares: [
|
1042
|
-
|
1042
|
+
Gr({
|
1043
1043
|
// Adding some spacing to the top and bottom so the popover
|
1044
1044
|
// doesn't extend to the edges of the screen.
|
1045
1045
|
padding: {
|
@@ -1048,93 +1048,93 @@ const $r = function(e) {
|
|
1048
1048
|
}
|
1049
1049
|
})
|
1050
1050
|
],
|
1051
|
-
children: (a) => /* @__PURE__ */
|
1051
|
+
children: (a) => /* @__PURE__ */ p(
|
1052
1052
|
xe,
|
1053
1053
|
{
|
1054
1054
|
type: "button",
|
1055
1055
|
"data-testid": "sidebar-tasks-widget-button",
|
1056
1056
|
"aria-label": "Tasks",
|
1057
|
-
className:
|
1058
|
-
[
|
1057
|
+
className: j(je.navItem, {
|
1058
|
+
[je.activeNavItem]: a
|
1059
1059
|
}),
|
1060
1060
|
children: [
|
1061
|
-
/* @__PURE__ */ s(
|
1062
|
-
n > 0 && /* @__PURE__ */ s("div", { className:
|
1061
|
+
/* @__PURE__ */ s(dn, { size: "25px" }),
|
1062
|
+
n > 0 && /* @__PURE__ */ s("div", { className: je.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
1063
1063
|
]
|
1064
1064
|
}
|
1065
1065
|
)
|
1066
1066
|
}
|
1067
1067
|
) });
|
1068
|
-
}),
|
1069
|
-
|
1070
|
-
const
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
const
|
1082
|
-
breadcrumbsItem:
|
1083
|
-
breadcrumbs:
|
1084
|
-
},
|
1068
|
+
}), A = ({ children: e, ...t }) => /* @__PURE__ */ s("nav", { ...t, className: Dn.sidebarContainer, children: e }), va = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1069
|
+
A.Top = va;
|
1070
|
+
const Ta = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1071
|
+
A.Bottom = Ta;
|
1072
|
+
A.Avatar = Fn;
|
1073
|
+
A.IconLink = Jn;
|
1074
|
+
A.Menu = Yn;
|
1075
|
+
A.ProfileMenu = vr;
|
1076
|
+
A.TeamSwitch = jr;
|
1077
|
+
A.TeamMenuItem = $t;
|
1078
|
+
A.UpgradeMenuItem = Lr;
|
1079
|
+
A.ProfileSettingsMenuItem = Sr;
|
1080
|
+
A.Tasks = ba;
|
1081
|
+
const ya = "_breadcrumbsItem_1hm6a_1", Sa = "_breadcrumbs_1hm6a_1", yt = {
|
1082
|
+
breadcrumbsItem: ya,
|
1083
|
+
breadcrumbs: Sa
|
1084
|
+
}, zo = ({ items: e }) => /* @__PURE__ */ s("nav", { "aria-label": "breadcrumb", className: yt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ p(kt, { children: [
|
1085
1085
|
/* @__PURE__ */ s(L, { className: yt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1086
1086
|
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:
|
1087
|
+
] }, `${t.link}-${t.name}`)) }), Ea = ({ items: e }) => /* @__PURE__ */ s(He, { children: e.map((t, n) => /* @__PURE__ */ p(kt, { children: [
|
1088
|
+
!!n && t.some((a) => a.visible) && /* @__PURE__ */ s(It, {}),
|
1089
|
+
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))
|
1090
|
+
] }, t[0].label)) }), Ca = "_badge_1pc1v_1", wa = "_tag_1pc1v_15", Pa = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", ka = "_disabled_1pc1v_57", Aa = "_projectNavigationItem_1pc1v_61", Ia = "_projectNavigationItemDisabled_1pc1v_67", x = {
|
1091
|
+
badge: Ca,
|
1092
1092
|
tag: wa,
|
1093
|
-
withNavLinkStyle:
|
1093
|
+
withNavLinkStyle: Pa,
|
1094
1094
|
disabled: ka,
|
1095
|
-
projectNavigationItem:
|
1095
|
+
projectNavigationItem: Aa,
|
1096
1096
|
projectNavigationItemDisabled: Ia
|
1097
|
-
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */
|
1098
|
-
/* @__PURE__ */
|
1097
|
+
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ p("div", { className: "flex gap-1", children: [
|
1098
|
+
/* @__PURE__ */ p("div", { children: [
|
1099
1099
|
/* @__PURE__ */ s("span", { children: e }),
|
1100
|
-
!!t && /* @__PURE__ */ s("div", { className:
|
1100
|
+
!!t && /* @__PURE__ */ s("div", { className: x.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
1101
1101
|
] }),
|
1102
|
-
!!n && /* @__PURE__ */ s(
|
1103
|
-
] }),
|
1104
|
-
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: i }, c) => /* @__PURE__ */ s(
|
1102
|
+
!!n && /* @__PURE__ */ s(Oe, { className: x.tag, children: n })
|
1103
|
+
] }), Me = rn(
|
1104
|
+
({ 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
1105
|
"div",
|
1106
1106
|
{
|
1107
|
-
className: n ?
|
1107
|
+
className: n ? x.projectNavigationItemDisabled : x.projectNavigationItem,
|
1108
1108
|
children: o || n || !t ? /* @__PURE__ */ s(
|
1109
1109
|
"button",
|
1110
1110
|
{
|
1111
1111
|
type: "button",
|
1112
1112
|
ref: c,
|
1113
|
-
className:
|
1114
|
-
[
|
1113
|
+
className: j(x.withNavLinkStyle, {
|
1114
|
+
[x.disabled]: n
|
1115
1115
|
}),
|
1116
1116
|
disabled: n,
|
1117
1117
|
onClick: o,
|
1118
1118
|
children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i })
|
1119
1119
|
}
|
1120
|
-
) : /* @__PURE__ */ s("a", { href: t, className:
|
1120
|
+
) : /* @__PURE__ */ s("a", { href: t, className: x.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i }) })
|
1121
1121
|
}
|
1122
1122
|
) })
|
1123
1123
|
);
|
1124
|
-
|
1125
|
-
const
|
1124
|
+
Me.displayName = "NavigationTabsItem";
|
1125
|
+
const Ra = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, ja = (e) => e.visible && (!e.dropdown || Ra(e.dropdown)), Jo = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ s("nav", { "aria-label": "Project", children: /* @__PURE__ */ s("ul", { className: q.navigationTabList, "aria-orientation": "horizontal", children: e.filter(ja).map((n) => {
|
1126
1126
|
var a, o, i;
|
1127
1127
|
return n.dropdown ? /* @__PURE__ */ s(
|
1128
1128
|
"li",
|
1129
1129
|
{
|
1130
|
-
className:
|
1130
|
+
className: q.navigationTab,
|
1131
1131
|
"data-testid": n.key,
|
1132
1132
|
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
1133
1133
|
children: /* @__PURE__ */ s(
|
1134
1134
|
ce,
|
1135
1135
|
{
|
1136
|
-
menuButton: ({ opened: c }) => /* @__PURE__ */ s(
|
1137
|
-
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(
|
1136
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ s(Me, { label: n.label, disabled: n.disabled, active: c }),
|
1137
|
+
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(Ea, { items: n.dropdown }) })
|
1138
1138
|
}
|
1139
1139
|
)
|
1140
1140
|
},
|
@@ -1142,11 +1142,11 @@ const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1142
1142
|
) : /* @__PURE__ */ s(
|
1143
1143
|
"li",
|
1144
1144
|
{
|
1145
|
-
className:
|
1145
|
+
className: q.navigationTab,
|
1146
1146
|
"data-testid": n.key,
|
1147
1147
|
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
1148
1148
|
children: /* @__PURE__ */ s(
|
1149
|
-
|
1149
|
+
Me,
|
1150
1150
|
{
|
1151
1151
|
label: n.label,
|
1152
1152
|
href: n.link,
|
@@ -1161,7 +1161,7 @@ const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1161
1161
|
n.key
|
1162
1162
|
);
|
1163
1163
|
}) }) });
|
1164
|
-
class
|
1164
|
+
class I {
|
1165
1165
|
/**
|
1166
1166
|
* This constructor is private to prevent the creation of a HeaderBuilder, it's an implementation detail
|
1167
1167
|
* that users of this class should not be aware of. The only way to create a HeaderBuilder is through the
|
@@ -1173,7 +1173,7 @@ class A {
|
|
1173
1173
|
this.factories = t;
|
1174
1174
|
}
|
1175
1175
|
static create(t = {}) {
|
1176
|
-
return new
|
1176
|
+
return new I([() => t]);
|
1177
1177
|
}
|
1178
1178
|
/**
|
1179
1179
|
* Adds a single header to the builder by providing a key and a value.
|
@@ -1193,7 +1193,7 @@ class A {
|
|
1193
1193
|
* @param value - The value of the header
|
1194
1194
|
*/
|
1195
1195
|
add(t, n) {
|
1196
|
-
return new
|
1196
|
+
return new I([...this.factories, () => ({ [t]: n })]);
|
1197
1197
|
}
|
1198
1198
|
/**
|
1199
1199
|
* Adds multiple headers to the builder by providing an object or a promise of an object with the headers.
|
@@ -1217,7 +1217,7 @@ class A {
|
|
1217
1217
|
* @param extension - An object with the headers to add
|
1218
1218
|
*/
|
1219
1219
|
and(t) {
|
1220
|
-
return new
|
1220
|
+
return new I([...this.factories, () => t]);
|
1221
1221
|
}
|
1222
1222
|
/**
|
1223
1223
|
* Adds a factory function that returns a promise of headers to the builder.
|
@@ -1238,7 +1238,7 @@ class A {
|
|
1238
1238
|
* @param factory - A function that returns a promise of headers
|
1239
1239
|
*/
|
1240
1240
|
from(t) {
|
1241
|
-
return new
|
1241
|
+
return new I([...this.factories, t]);
|
1242
1242
|
}
|
1243
1243
|
/**
|
1244
1244
|
* Takes a middleware function that receives the current builder and returns a new, modified, builder.
|
@@ -1283,7 +1283,7 @@ class A {
|
|
1283
1283
|
* @param builder - The builder to merge with
|
1284
1284
|
*/
|
1285
1285
|
merge(t) {
|
1286
|
-
return new
|
1286
|
+
return new I([...this.factories, ...t.factories]);
|
1287
1287
|
}
|
1288
1288
|
/**
|
1289
1289
|
* Resolves the headers by waiting for all the promises to resolve and merging them together.
|
@@ -1301,7 +1301,7 @@ class A {
|
|
1301
1301
|
return Object.assign({}, ...n);
|
1302
1302
|
}
|
1303
1303
|
}
|
1304
|
-
function
|
1304
|
+
function zt(e) {
|
1305
1305
|
return new Na(e);
|
1306
1306
|
}
|
1307
1307
|
class Na {
|
@@ -1310,22 +1310,22 @@ class Na {
|
|
1310
1310
|
}
|
1311
1311
|
apply(t) {
|
1312
1312
|
return t.from(async () => {
|
1313
|
-
const n = this.middleware(
|
1313
|
+
const n = this.middleware(I.create());
|
1314
1314
|
return n instanceof Promise ? n.then((a) => a.resolve()) : n.resolve();
|
1315
1315
|
});
|
1316
1316
|
}
|
1317
1317
|
}
|
1318
|
-
const
|
1318
|
+
const Jt = r.union([
|
1319
1319
|
r.literal("owner"),
|
1320
1320
|
r.literal("admin"),
|
1321
1321
|
r.literal("biller"),
|
1322
1322
|
r.literal("member")
|
1323
|
-
]),
|
1323
|
+
]), Oa = r.object({
|
1324
1324
|
userId: r.number(),
|
1325
1325
|
userUuid: r.string().uuid(),
|
1326
1326
|
teamId: r.number(),
|
1327
1327
|
teamUuid: r.string().uuid(),
|
1328
|
-
userTeamRole:
|
1328
|
+
userTeamRole: Jt,
|
1329
1329
|
userEmail: r.string().email(),
|
1330
1330
|
userName: r.string(),
|
1331
1331
|
userCurrentTeamId: r.number(),
|
@@ -1335,10 +1335,10 @@ const zt = r.union([
|
|
1335
1335
|
isFullyAuthenticated: r.boolean(),
|
1336
1336
|
exp: r.number()
|
1337
1337
|
});
|
1338
|
-
function
|
1338
|
+
function Z(e) {
|
1339
1339
|
try {
|
1340
1340
|
const t = e.split(".")[1], n = atob(t);
|
1341
|
-
return
|
1341
|
+
return Oa.parse(JSON.parse(n));
|
1342
1342
|
} catch {
|
1343
1343
|
return;
|
1344
1344
|
}
|
@@ -1350,14 +1350,14 @@ class se extends Error {
|
|
1350
1350
|
ne(this, "status", 401);
|
1351
1351
|
}
|
1352
1352
|
}
|
1353
|
-
function
|
1354
|
-
return
|
1353
|
+
function Wo(e) {
|
1354
|
+
return zt(async (t) => {
|
1355
1355
|
var i, c;
|
1356
1356
|
const n = e.getCurrentToken() ?? await ((i = e.generateNewToken) == null ? void 0 : i.call(e));
|
1357
1357
|
if (!n)
|
1358
1358
|
throw new se();
|
1359
|
-
const { exp: a } =
|
1360
|
-
if (!
|
1359
|
+
const { exp: a } = Z(n.accessToken) ?? { exp: 0 };
|
1360
|
+
if (!mn(new Date(a)))
|
1361
1361
|
return t.add("authorization", `Bearer ${n.accessToken}`);
|
1362
1362
|
const o = await e.refreshToken(n);
|
1363
1363
|
if (!o)
|
@@ -1365,206 +1365,206 @@ function Go(e) {
|
|
1365
1365
|
return (c = e.onNewTokenIssued) == null || c.call(e, o), t.add("authorization", `Bearer ${o.accessToken}`);
|
1366
1366
|
});
|
1367
1367
|
}
|
1368
|
-
const
|
1368
|
+
const Qo = zt(
|
1369
1369
|
(e) => e.and({ "x-lokalise-plugin": "true" })
|
1370
1370
|
);
|
1371
|
-
function
|
1372
|
-
const e =
|
1371
|
+
function Wt() {
|
1372
|
+
const e = Ue(document.cookie, "accessToken"), t = Ue(document.cookie, "refreshToken");
|
1373
1373
|
return !e || !t ? null : { accessToken: e, refreshToken: t };
|
1374
1374
|
}
|
1375
1375
|
function xa() {
|
1376
|
-
return
|
1376
|
+
return Ue(document.cookie, "csrf_token") ?? null;
|
1377
1377
|
}
|
1378
|
-
function
|
1378
|
+
function Ue(e, t) {
|
1379
1379
|
var n, a;
|
1380
1380
|
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
1381
|
}
|
1382
|
-
function
|
1383
|
-
const e =
|
1382
|
+
function Yo() {
|
1383
|
+
const e = Wt();
|
1384
1384
|
if (!e)
|
1385
1385
|
return;
|
1386
|
-
const t =
|
1386
|
+
const t = Z(e.accessToken);
|
1387
1387
|
if (t)
|
1388
1388
|
return { ...e, payload: t };
|
1389
1389
|
}
|
1390
|
-
const
|
1390
|
+
const Qt = r.union([
|
1391
1391
|
r.object({ authorization: r.string() }),
|
1392
1392
|
r.object({ AUTHORIZATION: r.string() })
|
1393
|
-
]),
|
1393
|
+
]), La = r.union([
|
1394
1394
|
r.object({ "X-API-Token": r.string() }),
|
1395
1395
|
r.object({ "X-Api-Token": r.string() }),
|
1396
1396
|
r.object({ "x-api-token": r.string() }),
|
1397
1397
|
r.object({ "X-API-TOKEN": r.string() })
|
1398
|
-
]), La = r.union([
|
1399
|
-
Wt,
|
1400
|
-
Oa
|
1401
1398
|
]), Ma = r.union([
|
1399
|
+
Qt,
|
1400
|
+
La
|
1401
|
+
]), Ua = r.union([
|
1402
1402
|
r.object({ "X-Lokalise-Plugin": r.string() }),
|
1403
1403
|
r.object({ "x-lokalise-plugin": r.string() }),
|
1404
1404
|
r.object({ "X-LOKALISE-PLUGIN": r.string() })
|
1405
|
-
]),
|
1405
|
+
]), $ = Ma.and(Ua), Ha = r.object({
|
1406
1406
|
accessToken: r.string(),
|
1407
1407
|
refreshToken: r.string()
|
1408
|
-
}),
|
1408
|
+
}), qa = r.union([
|
1409
1409
|
r.object({ "X-Csrf-Token": r.string() }),
|
1410
1410
|
r.object({ "X-CSRF-Token": r.string() }),
|
1411
1411
|
r.object({ "x-csrf-token": r.string() }),
|
1412
1412
|
r.object({ "X-CSRF-TOKEN": r.string() })
|
1413
|
-
]),
|
1414
|
-
|
1415
|
-
|
1416
|
-
]),
|
1413
|
+
]), Ba = r.union([
|
1414
|
+
Qt,
|
1415
|
+
qa
|
1416
|
+
]), Ge = qe({
|
1417
1417
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
1418
1418
|
method: "post",
|
1419
1419
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
1420
1420
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
1421
|
-
requestHeaderSchema:
|
1421
|
+
requestHeaderSchema: Ba,
|
1422
1422
|
requestBodySchema: r.undefined(),
|
1423
1423
|
isEmptyResponseExpected: !0,
|
1424
|
-
successResponseBodySchema:
|
1424
|
+
successResponseBodySchema: Ha
|
1425
1425
|
});
|
1426
|
-
function
|
1426
|
+
function Xo(e, t, n) {
|
1427
1427
|
return async () => {
|
1428
1428
|
const a = t();
|
1429
1429
|
if (!a)
|
1430
1430
|
throw new se();
|
1431
|
-
return
|
1431
|
+
return M(e, Ge, {
|
1432
1432
|
pathParams: { teamId: Number(await n()) },
|
1433
|
-
headers: await
|
1433
|
+
headers: await I.create().add("x-csrf-token", a).resolve()
|
1434
1434
|
});
|
1435
1435
|
};
|
1436
1436
|
}
|
1437
|
-
function
|
1437
|
+
function Vo(e) {
|
1438
1438
|
return async ({ accessToken: t, refreshToken: n }) => {
|
1439
|
-
const a =
|
1439
|
+
const a = Z(t);
|
1440
1440
|
if (!a)
|
1441
1441
|
throw new se();
|
1442
|
-
return
|
1442
|
+
return M(e, Ge, {
|
1443
1443
|
pathParams: { teamId: a.teamId },
|
1444
|
-
headers: await
|
1444
|
+
headers: await I.create().add("authorization", `Bearer ${n}`).resolve()
|
1445
1445
|
});
|
1446
1446
|
};
|
1447
1447
|
}
|
1448
|
-
const
|
1448
|
+
const Da = {
|
1449
1449
|
teamKey: (e) => ["getUserToken", e]
|
1450
|
-
},
|
1450
|
+
}, $a = (e, t, n) => D({
|
1451
1451
|
...n,
|
1452
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1452
|
+
queryFn: async ({ queryKey: [a, o] }) => M(e, Ge, {
|
1453
1453
|
headers: await t.resolve(),
|
1454
1454
|
pathParams: { teamId: o }
|
1455
1455
|
})
|
1456
1456
|
}), ie = class ie extends CustomEvent {
|
1457
1457
|
constructor(t) {
|
1458
1458
|
super(ie.eventName, {
|
1459
|
-
detail: { token: t, payload:
|
1459
|
+
detail: { token: t, payload: Z(t.accessToken) }
|
1460
1460
|
});
|
1461
1461
|
}
|
1462
1462
|
};
|
1463
1463
|
ne(ie, "eventName", "new-jwt-issued");
|
1464
|
-
let
|
1465
|
-
function
|
1466
|
-
const a = xa(), o =
|
1467
|
-
queryKey:
|
1464
|
+
let z = ie;
|
1465
|
+
function Zo(e, t, n) {
|
1466
|
+
const a = xa(), o = $a(e, t.add("x-csrf-token", a ?? ""), {
|
1467
|
+
queryKey: Da.teamKey(n),
|
1468
1468
|
enabled: a !== void 0
|
1469
|
-
}), i =
|
1470
|
-
return
|
1471
|
-
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new
|
1469
|
+
}), i = Ct();
|
1470
|
+
return J(() => {
|
1471
|
+
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new z(o.data)), i.current = o.data.accessToken);
|
1472
1472
|
}, [o.data]), o;
|
1473
1473
|
}
|
1474
|
-
function
|
1474
|
+
function Yt() {
|
1475
1475
|
const [e, t] = R();
|
1476
|
-
return
|
1476
|
+
return J(() => {
|
1477
1477
|
const n = (o) => {
|
1478
1478
|
t(o.detail.payload);
|
1479
|
-
}, a =
|
1480
|
-
return t(a ?
|
1481
|
-
window.removeEventListener(
|
1479
|
+
}, a = Wt();
|
1480
|
+
return t(a ? Z(a.accessToken) : void 0), window.addEventListener(z.eventName, n), () => {
|
1481
|
+
window.removeEventListener(z.eventName, n);
|
1482
1482
|
};
|
1483
1483
|
}, []), e;
|
1484
1484
|
}
|
1485
|
-
const
|
1485
|
+
const Ga = $, Fa = r.object({
|
1486
1486
|
user_id: r.number(),
|
1487
1487
|
email: r.string().email(),
|
1488
1488
|
fullname: r.string(),
|
1489
1489
|
created_at: r.string(),
|
1490
1490
|
created_at_timestamp: r.number(),
|
1491
|
-
role:
|
1492
|
-
}),
|
1491
|
+
role: Jt
|
1492
|
+
}), Ka = r.object({
|
1493
1493
|
team_id: r.number(),
|
1494
1494
|
team_user: Fa
|
1495
|
-
}),
|
1495
|
+
}), za = Y({
|
1496
1496
|
description: "Get the details of a team user",
|
1497
|
-
requestHeaderSchema:
|
1497
|
+
requestHeaderSchema: Ga,
|
1498
1498
|
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
1499
1499
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
1500
|
-
successResponseBodySchema:
|
1501
|
-
}),
|
1500
|
+
successResponseBodySchema: Ka
|
1501
|
+
}), Ja = {
|
1502
1502
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
1503
|
-
},
|
1503
|
+
}, Wa = (e, t, n) => D({
|
1504
1504
|
...n,
|
1505
|
-
queryFn: async ({ queryKey: [a, o, i] }) =>
|
1505
|
+
queryFn: async ({ queryKey: [a, o, i] }) => Q(e, za, {
|
1506
1506
|
headers: await t.resolve(),
|
1507
1507
|
pathParams: { teamId: o, userId: i }
|
1508
1508
|
})
|
1509
1509
|
});
|
1510
|
-
function
|
1511
|
-
const n =
|
1512
|
-
return
|
1513
|
-
queryKey:
|
1510
|
+
function es(e, t) {
|
1511
|
+
const n = Yt();
|
1512
|
+
return Wa(e, t, {
|
1513
|
+
queryKey: Ja.teamUserKey((n == null ? void 0 : n.teamId) ?? 0, (n == null ? void 0 : n.userId) ?? 0),
|
1514
1514
|
enabled: (n == null ? void 0 : n.userId) !== void 0 && n.teamId !== void 0
|
1515
1515
|
});
|
1516
1516
|
}
|
1517
|
-
const
|
1517
|
+
const Qa = r.object({
|
1518
1518
|
lang_id: r.number(),
|
1519
1519
|
lang_iso: r.string(),
|
1520
1520
|
lang_name: r.string(),
|
1521
1521
|
is_writable: r.union([r.literal(0), r.literal(1)])
|
1522
|
-
}),
|
1522
|
+
}), Ya = r.object({
|
1523
1523
|
user_id: r.number(),
|
1524
1524
|
email: r.string().email(),
|
1525
1525
|
fullname: r.string(),
|
1526
1526
|
created_at: r.string(),
|
1527
1527
|
created_at_timestamp: r.number(),
|
1528
1528
|
admin_rights: r.array(r.string()),
|
1529
|
-
languages: r.array(
|
1529
|
+
languages: r.array(Qa),
|
1530
1530
|
is_admin: r.boolean(),
|
1531
1531
|
is_reviewer: r.boolean()
|
1532
1532
|
}), Xa = r.object({
|
1533
1533
|
project_id: r.string(),
|
1534
|
-
contributors: r.array(
|
1535
|
-
}),
|
1534
|
+
contributors: r.array(Ya)
|
1535
|
+
}), Va = Y({
|
1536
1536
|
description: "Get the details of a project contributor",
|
1537
|
-
requestHeaderSchema:
|
1537
|
+
requestHeaderSchema: $,
|
1538
1538
|
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
1539
1539
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
1540
1540
|
successResponseBodySchema: Xa
|
1541
|
-
}),
|
1541
|
+
}), Za = {
|
1542
1542
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
1543
|
-
},
|
1543
|
+
}, eo = (e, t, n) => D({
|
1544
1544
|
...n,
|
1545
|
-
queryFn: async ({ queryKey: [a, o, i] }) =>
|
1545
|
+
queryFn: async ({ queryKey: [a, o, i] }) => Q(e, Va, {
|
1546
1546
|
pathParams: { projectId: o, contributorId: i },
|
1547
1547
|
headers: await t.resolve()
|
1548
1548
|
})
|
1549
1549
|
});
|
1550
|
-
function
|
1551
|
-
const a =
|
1552
|
-
return
|
1553
|
-
queryKey:
|
1550
|
+
function ts(e, t, n) {
|
1551
|
+
const a = Yt();
|
1552
|
+
return eo(e, t, {
|
1553
|
+
queryKey: Za.projectUserKey(n, (a == null ? void 0 : a.userId) ?? 0),
|
1554
1554
|
enabled: a !== void 0
|
1555
1555
|
});
|
1556
1556
|
}
|
1557
|
-
const
|
1557
|
+
const to = r.object({
|
1558
1558
|
lang_iso: r.string(),
|
1559
1559
|
custom_iso: r.string().optional()
|
1560
|
-
}),
|
1560
|
+
}), no = r.object({
|
1561
1561
|
language_id: r.number(),
|
1562
1562
|
language_iso: r.string(),
|
1563
1563
|
progress: r.number(),
|
1564
1564
|
words_to_do: r.number()
|
1565
|
-
}), no = r.object({
|
1566
|
-
projectId: r.string()
|
1567
1565
|
}), ro = r.object({
|
1566
|
+
projectId: r.string()
|
1567
|
+
}), Xt = r.object({
|
1568
1568
|
lang_id: r.number(),
|
1569
1569
|
lang_iso: r.string(),
|
1570
1570
|
lang_name: r.string(),
|
@@ -1573,37 +1573,67 @@ const eo = r.object({
|
|
1573
1573
|
}), ao = r.object({
|
1574
1574
|
project_id: r.string(),
|
1575
1575
|
project_uuid: r.string().uuid(),
|
1576
|
-
languages: r.array(
|
1576
|
+
languages: r.array(Xt)
|
1577
1577
|
}), oo = r.object({
|
1578
1578
|
projectId: r.string()
|
1579
1579
|
}), so = r.object({
|
1580
|
+
languages: r.array(
|
1581
|
+
r.object({
|
1582
|
+
lang_iso: r.string(),
|
1583
|
+
custom_iso: r.string().optional(),
|
1584
|
+
custom_name: r.string().optional(),
|
1585
|
+
custom_plural_forms: r.array(r.string()).optional()
|
1586
|
+
})
|
1587
|
+
)
|
1588
|
+
}), io = r.object({
|
1589
|
+
project_id: r.string(),
|
1590
|
+
project_uuid: r.string().uuid(),
|
1591
|
+
languages: r.array(Xt),
|
1592
|
+
errors: r.array(
|
1593
|
+
r.object({
|
1594
|
+
message: r.string(),
|
1595
|
+
code: r.number(),
|
1596
|
+
lang_iso: r.string()
|
1597
|
+
})
|
1598
|
+
).optional()
|
1599
|
+
}), co = r.object({
|
1600
|
+
projectId: r.string()
|
1601
|
+
}), lo = r.object({
|
1580
1602
|
langs: r.array(
|
1581
1603
|
r.object({
|
1582
1604
|
lang_iso: r.string(),
|
1583
1605
|
base_lang: r.boolean()
|
1584
1606
|
})
|
1585
1607
|
)
|
1586
|
-
}),
|
1608
|
+
}), uo = r.object({
|
1587
1609
|
result: r.boolean()
|
1588
|
-
}),
|
1610
|
+
}), mo = Y({
|
1589
1611
|
description: "List of project languages",
|
1590
|
-
requestHeaderSchema:
|
1591
|
-
requestPathParamsSchema:
|
1612
|
+
requestHeaderSchema: $,
|
1613
|
+
requestPathParamsSchema: ro,
|
1592
1614
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1593
1615
|
successResponseBodySchema: ao
|
1594
|
-
}),
|
1595
|
-
description: "
|
1596
|
-
requestHeaderSchema:
|
1597
|
-
method: "
|
1616
|
+
}), _o = jt({
|
1617
|
+
description: "Add languages to existing project",
|
1618
|
+
requestHeaderSchema: $,
|
1619
|
+
method: "post",
|
1598
1620
|
requestPathParamsSchema: oo,
|
1599
|
-
pathResolver: ({ projectId: e }) => `/projects/${e}/languages
|
1621
|
+
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1600
1622
|
requestBodySchema: so,
|
1601
1623
|
successResponseBodySchema: io
|
1602
|
-
}),
|
1624
|
+
}), go = jt({
|
1625
|
+
description: "Bulk update project languages",
|
1626
|
+
requestHeaderSchema: $,
|
1627
|
+
method: "put",
|
1628
|
+
requestPathParamsSchema: co,
|
1629
|
+
pathResolver: ({ projectId: e }) => `/projects/${e}/languages/bulk-update`,
|
1630
|
+
requestBodySchema: lo,
|
1631
|
+
successResponseBodySchema: uo
|
1632
|
+
}), ue = $, Fe = r.union([
|
1603
1633
|
r.literal("localization_files"),
|
1604
1634
|
r.literal("paged_documents"),
|
1605
1635
|
r.literal("marketing")
|
1606
|
-
]),
|
1636
|
+
]), fo = r.object({
|
1607
1637
|
per_platform_key_names: r.boolean(),
|
1608
1638
|
reviewing: r.boolean(),
|
1609
1639
|
auto_toggle_unverified: r.boolean(),
|
@@ -1614,7 +1644,7 @@ const eo = r.object({
|
|
1614
1644
|
custom_translation_statuses_allow_multiple: r.boolean(),
|
1615
1645
|
segmentation: r.boolean(),
|
1616
1646
|
contributor_preview_download_enabled: r.boolean()
|
1617
|
-
}),
|
1647
|
+
}), po = r.object({
|
1618
1648
|
not_reviewed: r.number(),
|
1619
1649
|
unverified: r.number(),
|
1620
1650
|
spelling_grammar: r.number(),
|
@@ -1631,18 +1661,18 @@ const eo = r.object({
|
|
1631
1661
|
double_space: r.number(),
|
1632
1662
|
special_placeholder: r.number(),
|
1633
1663
|
unbalanced_brackets: r.number()
|
1634
|
-
}),
|
1664
|
+
}), ho = r.object({
|
1635
1665
|
progress_total: r.number(),
|
1636
1666
|
keys_total: r.number(),
|
1637
1667
|
team: r.number(),
|
1638
1668
|
base_words: r.number(),
|
1639
1669
|
qa_issues_total: r.number(),
|
1640
|
-
qa_issues:
|
1641
|
-
languages: r.array(
|
1642
|
-
}),
|
1670
|
+
qa_issues: po,
|
1671
|
+
languages: r.array(no)
|
1672
|
+
}), me = r.object({
|
1643
1673
|
project_id: r.string(),
|
1644
1674
|
uuid: r.string().uuid(),
|
1645
|
-
project_type:
|
1675
|
+
project_type: Fe,
|
1646
1676
|
name: r.string(),
|
1647
1677
|
description: r.string(),
|
1648
1678
|
created_at: r.string(),
|
@@ -1652,119 +1682,129 @@ const eo = r.object({
|
|
1652
1682
|
team_id: r.number(),
|
1653
1683
|
base_language_id: r.number(),
|
1654
1684
|
base_language_iso: r.string(),
|
1655
|
-
settings:
|
1656
|
-
statistics:
|
1657
|
-
}),
|
1685
|
+
settings: fo.optional(),
|
1686
|
+
statistics: ho.optional()
|
1687
|
+
}), bo = r.object({
|
1658
1688
|
name: r.string(),
|
1659
1689
|
team_id: r.string(),
|
1660
1690
|
base_lang_iso: r.string(),
|
1661
|
-
languages: r.array(
|
1662
|
-
project_type:
|
1691
|
+
languages: r.array(to),
|
1692
|
+
project_type: Fe,
|
1663
1693
|
is_segmentation_enabled: r.boolean()
|
1664
|
-
}), Et = r.union([r.literal(0), r.literal(1)]),
|
1665
|
-
filter_type:
|
1694
|
+
}), Et = r.union([r.literal(0), r.literal(1)]), vo = r.object({
|
1695
|
+
filter_type: Fe.optional(),
|
1666
1696
|
filter_team_id: r.number().optional(),
|
1667
1697
|
filter_names: r.string().optional(),
|
1668
1698
|
include_statistics: Et.optional(),
|
1669
1699
|
include_settings: Et.optional(),
|
1670
1700
|
limit: r.number().optional(),
|
1671
1701
|
page: r.number().optional()
|
1672
|
-
}),
|
1673
|
-
projects: r.array(
|
1674
|
-
}),
|
1702
|
+
}), To = r.object({
|
1703
|
+
projects: r.array(me)
|
1704
|
+
}), yo = r.object({
|
1675
1705
|
project_id: r.string()
|
1676
|
-
}),
|
1706
|
+
}), So = r.object({
|
1677
1707
|
project_id: r.string()
|
1678
|
-
}),
|
1708
|
+
}), Eo = r.object({
|
1679
1709
|
name: r.string().min(1),
|
1680
1710
|
description: r.string().optional()
|
1681
|
-
}),
|
1711
|
+
}), _e = () => "/projects", Co = qe({
|
1682
1712
|
description: "Create a new project",
|
1683
|
-
requestHeaderSchema:
|
1713
|
+
requestHeaderSchema: ue,
|
1684
1714
|
method: "post",
|
1685
|
-
pathResolver:
|
1686
|
-
requestBodySchema:
|
1687
|
-
successResponseBodySchema:
|
1688
|
-
}),
|
1715
|
+
pathResolver: _e,
|
1716
|
+
requestBodySchema: bo,
|
1717
|
+
successResponseBodySchema: me
|
1718
|
+
}), wo = Y({
|
1689
1719
|
description: "List all projects",
|
1690
|
-
requestHeaderSchema:
|
1691
|
-
pathResolver:
|
1692
|
-
requestQuerySchema:
|
1693
|
-
successResponseBodySchema:
|
1694
|
-
}),
|
1720
|
+
requestHeaderSchema: ue,
|
1721
|
+
pathResolver: _e,
|
1722
|
+
requestQuerySchema: vo,
|
1723
|
+
successResponseBodySchema: To
|
1724
|
+
}), Po = Y({
|
1695
1725
|
description: "Retrieve a project",
|
1696
|
-
requestHeaderSchema:
|
1697
|
-
requestPathParamsSchema:
|
1698
|
-
pathResolver: ({ project_id: e }) => `${
|
1699
|
-
successResponseBodySchema:
|
1700
|
-
}),
|
1726
|
+
requestHeaderSchema: ue,
|
1727
|
+
requestPathParamsSchema: yo,
|
1728
|
+
pathResolver: ({ project_id: e }) => `${_e()}/${e}`,
|
1729
|
+
successResponseBodySchema: me
|
1730
|
+
}), ko = qe({
|
1701
1731
|
description: "Update a project",
|
1702
|
-
requestHeaderSchema:
|
1732
|
+
requestHeaderSchema: ue,
|
1703
1733
|
method: "put",
|
1704
|
-
requestPathParamsSchema:
|
1705
|
-
pathResolver: ({ project_id: e }) => `${
|
1706
|
-
requestBodySchema:
|
1707
|
-
successResponseBodySchema:
|
1734
|
+
requestPathParamsSchema: So,
|
1735
|
+
pathResolver: ({ project_id: e }) => `${_e()}/${e}`,
|
1736
|
+
requestBodySchema: Eo,
|
1737
|
+
successResponseBodySchema: me
|
1708
1738
|
});
|
1709
|
-
function
|
1710
|
-
return
|
1739
|
+
function ns(e, t, n = {}) {
|
1740
|
+
return de({
|
1711
1741
|
...n,
|
1712
|
-
mutationFn: async (a) =>
|
1742
|
+
mutationFn: async (a) => M(e, Co, {
|
1713
1743
|
headers: await t.resolve(),
|
1714
1744
|
body: a
|
1715
1745
|
})
|
1716
1746
|
});
|
1717
1747
|
}
|
1718
|
-
const
|
1748
|
+
const rs = {
|
1719
1749
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1720
1750
|
};
|
1721
|
-
function
|
1751
|
+
function as(e, t, n) {
|
1722
1752
|
return D({
|
1723
1753
|
...n,
|
1724
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1754
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, mo, {
|
1725
1755
|
headers: await t.resolve(),
|
1726
1756
|
pathParams: { projectId: o }
|
1727
1757
|
})
|
1728
1758
|
});
|
1729
1759
|
}
|
1730
|
-
const
|
1760
|
+
const os = {
|
1731
1761
|
paramsKey: (e) => ["listProjects", e]
|
1732
1762
|
};
|
1733
|
-
function
|
1763
|
+
function ss(e, t, n) {
|
1734
1764
|
return D({
|
1735
1765
|
...n,
|
1736
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1766
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, wo, {
|
1737
1767
|
headers: await t.resolve(),
|
1738
1768
|
queryParams: o
|
1739
1769
|
})
|
1740
1770
|
});
|
1741
1771
|
}
|
1742
|
-
const
|
1772
|
+
const is = {
|
1743
1773
|
projectIdKey: (e) => ["retrieveProject", e]
|
1744
1774
|
};
|
1745
|
-
function
|
1775
|
+
function cs(e, t, n) {
|
1746
1776
|
return D({
|
1747
1777
|
...n,
|
1748
|
-
queryFn: async ({ queryKey: [a, o] }) =>
|
1778
|
+
queryFn: async ({ queryKey: [a, o] }) => Q(e, Po, {
|
1749
1779
|
headers: await t.resolve(),
|
1750
1780
|
pathParams: { project_id: o }
|
1751
1781
|
})
|
1752
1782
|
});
|
1753
1783
|
}
|
1754
|
-
function
|
1755
|
-
return
|
1784
|
+
function ls(e, t, n, a = {}) {
|
1785
|
+
return de({
|
1756
1786
|
...a,
|
1757
|
-
mutationFn: async (o) =>
|
1787
|
+
mutationFn: async (o) => M(e, ko, {
|
1758
1788
|
headers: await t.resolve(),
|
1759
1789
|
body: o,
|
1760
1790
|
pathParams: n
|
1761
1791
|
})
|
1762
1792
|
});
|
1763
1793
|
}
|
1764
|
-
function
|
1765
|
-
return
|
1794
|
+
function ds(e, t, n, a = {}) {
|
1795
|
+
return de({
|
1796
|
+
...a,
|
1797
|
+
mutationFn: async (o) => M(e, go, {
|
1798
|
+
pathParams: t,
|
1799
|
+
headers: await n.resolve(),
|
1800
|
+
body: o
|
1801
|
+
})
|
1802
|
+
});
|
1803
|
+
}
|
1804
|
+
function us(e, t, n, a = {}) {
|
1805
|
+
return de({
|
1766
1806
|
...a,
|
1767
|
-
mutationFn: async (o) =>
|
1807
|
+
mutationFn: async (o) => M(e, _o, {
|
1768
1808
|
pathParams: t,
|
1769
1809
|
headers: await n.resolve(),
|
1770
1810
|
body: o
|
@@ -1772,70 +1812,72 @@ function ss(e, t, n, a = {}) {
|
|
1772
1812
|
});
|
1773
1813
|
}
|
1774
1814
|
export {
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1815
|
+
zo as Breadcrumbs,
|
1816
|
+
Bt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1817
|
+
dr as ENTERPRISE_PLAN_IDS,
|
1818
|
+
cr as ESSENTIAL_PLAN_IDS,
|
1819
|
+
qt as FREE_PLAN_ID,
|
1820
|
+
I as HeaderBuilder,
|
1821
|
+
Wo as JwtAuthHeaderBuilderMiddleware,
|
1782
1822
|
oe as NavigationPanel,
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1823
|
+
Jo as NavigationTabs,
|
1824
|
+
lr as PRO_PLAN_IDS,
|
1825
|
+
Qo as PublicApiHeaderBuilderMiddleware,
|
1826
|
+
ir as START_PLAN_IDS,
|
1827
|
+
A as Sidebar,
|
1828
|
+
k as SidebarTaskLanguageStatuses,
|
1829
|
+
Le as SidebarTaskStatuses,
|
1790
1830
|
re as SidebarTaskTypeOptions,
|
1791
|
-
|
1831
|
+
sr as TRIAL_PLAN_ID,
|
1792
1832
|
se as UnauthorizedError,
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1833
|
+
_o as addLanguagesToProject,
|
1834
|
+
go as bulkUpdateProjectLanguages,
|
1835
|
+
_r as convertNewLineToBreakTag,
|
1836
|
+
zt as createHeaderBuilderMiddleware,
|
1837
|
+
Co as createProject,
|
1797
1838
|
hr as formatDate,
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1839
|
+
Ko as formatDateTz,
|
1840
|
+
Xo as generateTokenFromClassicSession,
|
1841
|
+
Yo as getAuthenticatedSessionDetailFromRequest,
|
1801
1842
|
xa as getCsrfTokenFromCookie,
|
1802
|
-
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1807
|
-
|
1808
|
-
|
1809
|
-
|
1843
|
+
Wt as getJwtTokenFromCookie,
|
1844
|
+
za as getTeamUser,
|
1845
|
+
Ja as getTeamUsersQueryKey,
|
1846
|
+
Ge as getUserToken,
|
1847
|
+
Da as getUserTokenKey,
|
1848
|
+
Fo as isEnterpriseOpenSourcePlan,
|
1849
|
+
$o as isEnterprisePlan,
|
1850
|
+
Bo as isEssentialPlan,
|
1810
1851
|
De as isFreePlan,
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1852
|
+
Go as isPaidPlan,
|
1853
|
+
Do as isProPlan,
|
1854
|
+
qo as isStartPlan,
|
1855
|
+
Dt as isTrialPlan,
|
1856
|
+
mo as listProjectLanguages,
|
1857
|
+
rs as listProjectLanguagesKey,
|
1858
|
+
wo as listProjects,
|
1859
|
+
os as listProjectsKey,
|
1860
|
+
pr as makeUrlClickable,
|
1861
|
+
Z as parseJwtTokenPayload,
|
1862
|
+
Vo as refreshExpiredToken,
|
1863
|
+
Va as retrieveContributor,
|
1864
|
+
Za as retrieveContributorKeys,
|
1865
|
+
Po as retrieveProject,
|
1866
|
+
is as retrieveProjectQueryKey,
|
1867
|
+
ko as updateProject,
|
1868
|
+
us as useAddLanguagesToProjectMutation,
|
1869
|
+
ts as useAuthenticatedProjectContributor,
|
1870
|
+
Yt as useAuthenticatedSessionPayload,
|
1871
|
+
es as useAuthenticatedUser,
|
1872
|
+
ds as useBulkUpdateProjectLanguagesMutation,
|
1873
|
+
ns as useCreateProjectMutation,
|
1832
1874
|
$e as useEffectOnce,
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1836
|
-
|
1837
|
-
|
1838
|
-
|
1839
|
-
|
1840
|
-
|
1875
|
+
Zo as useGetPromotedClassicSessionJwtQuery,
|
1876
|
+
Wa as useGetTeamUsersQuery,
|
1877
|
+
$a as useGetUserTokenQuery,
|
1878
|
+
as as useListProjectLanguagesQuery,
|
1879
|
+
ss as useListProjectsQuery,
|
1880
|
+
eo as useRetrieveContributorQuery,
|
1881
|
+
cs as useRetrieveProjectQuery,
|
1882
|
+
ls as useUpdateProjectMutation
|
1841
1883
|
};
|