@lokalise/harmony 1.6.0-exp-jwtutils.20 → 1.6.0-exp-jwtutils.21
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 +291 -286
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +202 -4
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +2 -1
- package/dist/types/src/features/publicApi/userToken.d.ts +11 -8
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
1
|
+
var Et = Object.defineProperty;
|
2
|
+
var kt = (e, t, n) => t in e ? Et(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var Ne = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { jsx as i, jsxs as p, Fragment as tt } from "react/jsx-runtime";
|
5
|
-
import * as
|
6
|
-
import { useRef as nt, useState as ge, useCallback as je, useEffect as
|
7
|
-
import { Tooltip as he, Link as at, Menu as pe, MenuList as ve, CaretUpIcon as
|
5
|
+
import * as M from "react";
|
6
|
+
import { useRef as nt, useState as ge, useCallback as je, useEffect as x, useContext as Pt, createContext as Ct, cloneElement as Nt, Fragment as rt, forwardRef as jt } from "react";
|
7
|
+
import { Tooltip as he, Link as at, Menu as pe, MenuList as ve, CaretUpIcon as Rt, UserIcon as ot, MenuItem as K, MenuDivider as it, Tag as At } from "@lokalise/louis";
|
8
8
|
import { z as r } from "zod";
|
9
|
-
import { sendByPayloadRoute as
|
9
|
+
import { sendByPayloadRoute as J, sendByGetRoute as W } from "@lokalise/frontend-http-client";
|
10
10
|
import { buildPayloadRoute as st } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
11
|
-
import { useMutation as
|
11
|
+
import { useMutation as Ot, useQuery as L } from "@tanstack/react-query";
|
12
12
|
import { buildGetRoute as Q } from "@lokalise/universal-ts-utils/node";
|
13
13
|
import { format as ct } from "date-fns";
|
14
|
-
import { toZonedTime as
|
14
|
+
import { toZonedTime as Lt } from "date-fns-tz";
|
15
15
|
var H = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
16
16
|
function lt(e) {
|
17
17
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
@@ -27,7 +27,7 @@ function Te() {
|
|
27
27
|
return Z = e, Z;
|
28
28
|
}
|
29
29
|
var X, Ae;
|
30
|
-
function
|
30
|
+
function qt() {
|
31
31
|
if (Ae) return X;
|
32
32
|
Ae = 1;
|
33
33
|
var e = typeof H == "object" && H && H.Object === Object && H;
|
@@ -37,11 +37,11 @@ var ee, Oe;
|
|
37
37
|
function ut() {
|
38
38
|
if (Oe) return ee;
|
39
39
|
Oe = 1;
|
40
|
-
var e =
|
40
|
+
var e = qt(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
41
41
|
return ee = n, ee;
|
42
42
|
}
|
43
43
|
var te, Le;
|
44
|
-
function
|
44
|
+
function Mt() {
|
45
45
|
if (Le) return te;
|
46
46
|
Le = 1;
|
47
47
|
var e = ut(), t = function() {
|
@@ -50,7 +50,7 @@ function qt() {
|
|
50
50
|
return te = t, te;
|
51
51
|
}
|
52
52
|
var ne, qe;
|
53
|
-
function
|
53
|
+
function xt() {
|
54
54
|
if (qe) return ne;
|
55
55
|
qe = 1;
|
56
56
|
var e = /\s/;
|
@@ -65,23 +65,23 @@ var re, Me;
|
|
65
65
|
function Ut() {
|
66
66
|
if (Me) return re;
|
67
67
|
Me = 1;
|
68
|
-
var e =
|
68
|
+
var e = xt(), t = /^\s+/;
|
69
69
|
function n(a) {
|
70
70
|
return a && a.slice(0, e(a) + 1).replace(t, "");
|
71
71
|
}
|
72
72
|
return re = n, re;
|
73
73
|
}
|
74
|
-
var ae,
|
74
|
+
var ae, xe;
|
75
75
|
function dt() {
|
76
|
-
if (
|
77
|
-
|
76
|
+
if (xe) return ae;
|
77
|
+
xe = 1;
|
78
78
|
var e = ut(), t = e.Symbol;
|
79
79
|
return ae = t, ae;
|
80
80
|
}
|
81
|
-
var oe,
|
82
|
-
function
|
83
|
-
if (
|
84
|
-
|
81
|
+
var oe, Ue;
|
82
|
+
function Bt() {
|
83
|
+
if (Ue) return oe;
|
84
|
+
Ue = 1;
|
85
85
|
var e = dt(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
86
86
|
function s(c) {
|
87
87
|
var u = n.call(c, o), d = c[o];
|
@@ -96,7 +96,7 @@ function xt() {
|
|
96
96
|
return oe = s, oe;
|
97
97
|
}
|
98
98
|
var ie, Be;
|
99
|
-
function
|
99
|
+
function $t() {
|
100
100
|
if (Be) return ie;
|
101
101
|
Be = 1;
|
102
102
|
var e = Object.prototype, t = e.toString;
|
@@ -106,17 +106,17 @@ function Bt() {
|
|
106
106
|
return ie = n, ie;
|
107
107
|
}
|
108
108
|
var se, $e;
|
109
|
-
function
|
109
|
+
function Ht() {
|
110
110
|
if ($e) return se;
|
111
111
|
$e = 1;
|
112
|
-
var e = dt(), t =
|
112
|
+
var e = dt(), t = Bt(), n = $t(), a = "[object Null]", o = "[object Undefined]", s = e ? e.toStringTag : void 0;
|
113
113
|
function c(u) {
|
114
114
|
return u == null ? u === void 0 ? o : a : s && s in Object(u) ? t(u) : n(u);
|
115
115
|
}
|
116
116
|
return se = c, se;
|
117
117
|
}
|
118
118
|
var ce, He;
|
119
|
-
function
|
119
|
+
function Ft() {
|
120
120
|
if (He) return ce;
|
121
121
|
He = 1;
|
122
122
|
function e(t) {
|
@@ -124,21 +124,21 @@ function Ht() {
|
|
124
124
|
}
|
125
125
|
return ce = e, ce;
|
126
126
|
}
|
127
|
-
var le,
|
128
|
-
function
|
129
|
-
if (
|
130
|
-
|
131
|
-
var e =
|
127
|
+
var le, Fe;
|
128
|
+
function zt() {
|
129
|
+
if (Fe) return le;
|
130
|
+
Fe = 1;
|
131
|
+
var e = Ht(), t = Ft(), n = "[object Symbol]";
|
132
132
|
function a(o) {
|
133
133
|
return typeof o == "symbol" || t(o) && e(o) == n;
|
134
134
|
}
|
135
135
|
return le = a, le;
|
136
136
|
}
|
137
137
|
var ue, ze;
|
138
|
-
function
|
138
|
+
function Dt() {
|
139
139
|
if (ze) return ue;
|
140
140
|
ze = 1;
|
141
|
-
var e = Ut(), t = Te(), n =
|
141
|
+
var e = Ut(), t = Te(), n = zt(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, u = parseInt;
|
142
142
|
function d(l) {
|
143
143
|
if (typeof l == "number")
|
144
144
|
return l;
|
@@ -156,49 +156,49 @@ function zt() {
|
|
156
156
|
}
|
157
157
|
return ue = d, ue;
|
158
158
|
}
|
159
|
-
var de,
|
159
|
+
var de, De;
|
160
160
|
function mt() {
|
161
|
-
if (
|
162
|
-
|
163
|
-
var e = Te(), t =
|
161
|
+
if (De) return de;
|
162
|
+
De = 1;
|
163
|
+
var e = Te(), t = Mt(), n = Dt(), a = "Expected a function", o = Math.max, s = Math.min;
|
164
164
|
function c(u, d, l) {
|
165
|
-
var m, g, T, y, b, w, I = 0,
|
165
|
+
var m, g, T, y, b, w, I = 0, k = !1, _ = !1, E = !0;
|
166
166
|
if (typeof u != "function")
|
167
167
|
throw new TypeError(a);
|
168
|
-
d = n(d) || 0, e(l) && (
|
168
|
+
d = n(d) || 0, e(l) && (k = !!l.leading, _ = "maxWait" in l, T = _ ? o(n(l.maxWait) || 0, d) : T, E = "trailing" in l ? !!l.trailing : E);
|
169
169
|
function v(f) {
|
170
|
-
var
|
171
|
-
return m = g = void 0, I = f, y = u.apply(
|
170
|
+
var P = m, q = g;
|
171
|
+
return m = g = void 0, I = f, y = u.apply(q, P), y;
|
172
172
|
}
|
173
173
|
function h(f) {
|
174
|
-
return I = f, b = setTimeout($, d),
|
174
|
+
return I = f, b = setTimeout($, d), k ? v(f) : y;
|
175
175
|
}
|
176
176
|
function B(f) {
|
177
|
-
var
|
178
|
-
return _ ? s(
|
177
|
+
var P = f - w, q = f - I, Ce = d - P;
|
178
|
+
return _ ? s(Ce, T - q) : Ce;
|
179
179
|
}
|
180
|
-
function
|
181
|
-
var
|
182
|
-
return w === void 0 ||
|
180
|
+
function ke(f) {
|
181
|
+
var P = f - w, q = f - I;
|
182
|
+
return w === void 0 || P >= d || P < 0 || _ && q >= T;
|
183
183
|
}
|
184
184
|
function $() {
|
185
185
|
var f = t();
|
186
|
-
if (
|
187
|
-
return
|
186
|
+
if (ke(f))
|
187
|
+
return Pe(f);
|
188
188
|
b = setTimeout($, B(f));
|
189
189
|
}
|
190
|
-
function
|
190
|
+
function Pe(f) {
|
191
191
|
return b = void 0, E && m ? v(f) : (m = g = void 0, y);
|
192
192
|
}
|
193
|
-
function
|
193
|
+
function St() {
|
194
194
|
b !== void 0 && clearTimeout(b), I = 0, m = w = g = b = void 0;
|
195
195
|
}
|
196
|
-
function
|
197
|
-
return b === void 0 ? y :
|
196
|
+
function It() {
|
197
|
+
return b === void 0 ? y : Pe(t());
|
198
198
|
}
|
199
199
|
function V() {
|
200
|
-
var f = t(),
|
201
|
-
if (m = arguments, g = this, w = f,
|
200
|
+
var f = t(), P = ke(f);
|
201
|
+
if (m = arguments, g = this, w = f, P) {
|
202
202
|
if (b === void 0)
|
203
203
|
return h(w);
|
204
204
|
if (_)
|
@@ -206,12 +206,12 @@ function mt() {
|
|
206
206
|
}
|
207
207
|
return b === void 0 && (b = setTimeout($, d)), y;
|
208
208
|
}
|
209
|
-
return V.cancel =
|
209
|
+
return V.cancel = St, V.flush = It, V;
|
210
210
|
}
|
211
211
|
return de = c, de;
|
212
212
|
}
|
213
|
-
var
|
214
|
-
const
|
213
|
+
var Gt = mt();
|
214
|
+
const Kt = /* @__PURE__ */ lt(Gt);
|
215
215
|
var me, Ge;
|
216
216
|
function Jt() {
|
217
217
|
if (Ge) return me;
|
@@ -229,34 +229,34 @@ function Jt() {
|
|
229
229
|
}
|
230
230
|
return me = a, me;
|
231
231
|
}
|
232
|
-
var
|
233
|
-
const
|
232
|
+
var Wt = Jt();
|
233
|
+
const Qt = /* @__PURE__ */ lt(Wt), Yt = (e, t, n, a) => {
|
234
234
|
switch (t) {
|
235
235
|
case "debounce":
|
236
|
-
return
|
236
|
+
return Kt(e, n, a);
|
237
237
|
case "throttle":
|
238
|
-
return
|
238
|
+
return Qt(e, n, a);
|
239
239
|
default:
|
240
240
|
return e;
|
241
241
|
}
|
242
|
-
},
|
242
|
+
}, Vt = (
|
243
243
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
244
|
(e) => {
|
245
|
-
const t =
|
246
|
-
return
|
245
|
+
const t = M.useRef(e);
|
246
|
+
return M.useEffect(() => {
|
247
247
|
t.current = e;
|
248
|
-
}),
|
248
|
+
}), M.useMemo(() => (...n) => {
|
249
249
|
var a;
|
250
250
|
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
251
251
|
}, []);
|
252
252
|
}
|
253
|
-
),
|
253
|
+
), Zt = (
|
254
254
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
255
255
|
(e) => {
|
256
|
-
const [t, n] =
|
256
|
+
const [t, n] = M.useState((e == null ? void 0 : e.current) || null);
|
257
257
|
return e && setTimeout(() => {
|
258
258
|
e.current !== t && n(e.current);
|
259
|
-
}, 0), { refProxy:
|
259
|
+
}, 0), { refProxy: M.useMemo(() => new Proxy((o) => {
|
260
260
|
o !== t && n(o);
|
261
261
|
}, {
|
262
262
|
get(o, s) {
|
@@ -267,7 +267,7 @@ const Wt = /* @__PURE__ */ lt(Kt), Qt = (e, t, n, a) => {
|
|
267
267
|
}
|
268
268
|
}), [t]), refElement: t, setRefElement: n };
|
269
269
|
}
|
270
|
-
),
|
270
|
+
), Xt = (e, t) => t === "border-box" ? {
|
271
271
|
width: e.borderBoxSize[0].inlineSize,
|
272
272
|
height: e.borderBoxSize[0].blockSize
|
273
273
|
} : t === "content-box" ? {
|
@@ -277,11 +277,11 @@ const Wt = /* @__PURE__ */ lt(Kt), Qt = (e, t, n, a) => {
|
|
277
277
|
width: e.contentRect.width,
|
278
278
|
height: e.contentRect.height
|
279
279
|
};
|
280
|
-
function
|
281
|
-
const l = nt(e), m =
|
280
|
+
function en({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: s = !0, targetRef: c, observerOptions: u, onResize: d } = {}) {
|
281
|
+
const l = nt(e), m = Vt(d), [g, T] = ge({
|
282
282
|
width: void 0,
|
283
283
|
height: void 0
|
284
|
-
}), { refProxy: y, refElement: b } =
|
284
|
+
}), { refProxy: y, refElement: b } = Zt(c), { box: w } = u || {}, I = je((_) => {
|
285
285
|
if (!o && !s)
|
286
286
|
return;
|
287
287
|
if (l.current) {
|
@@ -290,30 +290,30 @@ function Xt({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refresh
|
|
290
290
|
}
|
291
291
|
const E = (v, h) => o && v.width !== h.width || s && v.height !== h.height;
|
292
292
|
_.forEach((v) => {
|
293
|
-
const h =
|
293
|
+
const h = Xt(v, w);
|
294
294
|
T((B) => E(B, h) ? (m == null || m({
|
295
295
|
width: h.width,
|
296
296
|
height: h.height,
|
297
297
|
entry: v
|
298
298
|
}), h) : B);
|
299
299
|
});
|
300
|
-
}, [o, s, l, w]),
|
300
|
+
}, [o, s, l, w]), k = je(Yt(I, t, n, a), [
|
301
301
|
I,
|
302
302
|
t,
|
303
303
|
n,
|
304
304
|
a
|
305
305
|
]);
|
306
|
-
return
|
306
|
+
return x(() => {
|
307
307
|
let _;
|
308
|
-
return b ? (_ = new window.ResizeObserver(
|
308
|
+
return b ? (_ = new window.ResizeObserver(k), _.observe(b, u)) : (g.width || g.height) && (m == null || m({
|
309
309
|
width: null,
|
310
310
|
height: null,
|
311
311
|
entry: null
|
312
312
|
}), T({ width: void 0, height: void 0 })), () => {
|
313
313
|
var E, v, h;
|
314
|
-
(E = _ == null ? void 0 : _.disconnect) === null || E === void 0 || E.call(_), (h = (v =
|
314
|
+
(E = _ == null ? void 0 : _.disconnect) === null || E === void 0 || E.call(_), (h = (v = k).cancel) === null || h === void 0 || h.call(v);
|
315
315
|
};
|
316
|
-
}, [
|
316
|
+
}, [k, b]), Object.assign({ ref: y }, g);
|
317
317
|
}
|
318
318
|
function ft(e) {
|
319
319
|
var t, n, a = "";
|
@@ -328,24 +328,24 @@ function j() {
|
|
328
328
|
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = ft(e)) && (a && (a += " "), a += t);
|
329
329
|
return a;
|
330
330
|
}
|
331
|
-
const
|
332
|
-
headerContainer:
|
333
|
-
navigationTabList:
|
334
|
-
navigationTab:
|
335
|
-
headerContent:
|
336
|
-
staticEnabled:
|
337
|
-
},
|
338
|
-
const { ref: n, height: a } =
|
331
|
+
const tn = "_headerContainer_1cubo_1", nn = "_navigationTabList_1cubo_8", rn = "_navigationTab_1cubo_8", an = "_headerContent_1cubo_34", on = "_staticEnabled_1cubo_50", A = {
|
332
|
+
headerContainer: tn,
|
333
|
+
navigationTabList: nn,
|
334
|
+
navigationTab: rn,
|
335
|
+
headerContent: an,
|
336
|
+
staticEnabled: on
|
337
|
+
}, sn = 77, z = ({ sticky: e, children: t }) => {
|
338
|
+
const { ref: n, height: a } = en({
|
339
339
|
refreshMode: "debounce",
|
340
340
|
refreshRate: 0
|
341
341
|
}), [o, s] = ge(!1), c = () => o ? !e : !0;
|
342
|
-
|
342
|
+
x(() => {
|
343
343
|
const d = () => {
|
344
344
|
s(window.scrollY > 0);
|
345
345
|
};
|
346
346
|
return window.addEventListener("scroll", d), () => window.removeEventListener("scroll", d);
|
347
347
|
}, []);
|
348
|
-
const u = `${a ||
|
348
|
+
const u = `${a || sn}px`;
|
349
349
|
return /* @__PURE__ */ i("div", { style: { minHeight: u }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ p(
|
350
350
|
"div",
|
351
351
|
{
|
@@ -363,63 +363,63 @@ const en = "_headerContainer_1cubo_1", tn = "_navigationTabList_1cubo_8", nn = "
|
|
363
363
|
};
|
364
364
|
z.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: A.headerContainer, children: e });
|
365
365
|
z.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
366
|
-
const
|
367
|
-
sidebarContainer:
|
368
|
-
},
|
369
|
-
logoLink:
|
370
|
-
},
|
371
|
-
link:
|
372
|
-
active:
|
373
|
-
},
|
366
|
+
const cn = "_sidebarContainer_bmdti_1", ln = {
|
367
|
+
sidebarContainer: cn
|
368
|
+
}, un = "_logoLink_1baxb_1", dn = {
|
369
|
+
logoLink: un
|
370
|
+
}, mn = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: a = "Lokalise" }) => /* @__PURE__ */ i("a", { className: dn.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ i("img", { src: e, alt: a }) }), fn = "_link_1weq1_1", _n = "_active_1weq1_18", Ke = {
|
371
|
+
link: fn,
|
372
|
+
active: _n
|
373
|
+
}, bn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ i(he, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
374
374
|
at,
|
375
375
|
{
|
376
|
-
className: j(
|
377
|
-
[
|
376
|
+
className: j(Ke.link, {
|
377
|
+
[Ke.active]: window.location.pathname.startsWith(t)
|
378
378
|
}),
|
379
379
|
href: t,
|
380
380
|
children: /* @__PURE__ */ i(n, { size: "25px" })
|
381
381
|
}
|
382
|
-
) }),
|
383
|
-
dropdownButton:
|
384
|
-
dropdownButtonActive:
|
385
|
-
},
|
382
|
+
) }), gn = "_dropdownButton_hwh0c_1", hn = "_dropdownButtonActive_hwh0c_18", Je = {
|
383
|
+
dropdownButton: gn,
|
384
|
+
dropdownButtonActive: hn
|
385
|
+
}, pn = ({ children: e, icon: t }) => /* @__PURE__ */ i(
|
386
386
|
pe,
|
387
387
|
{
|
388
388
|
menuButton: ({ opened: n }) => /* @__PURE__ */ i(he, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
389
389
|
"button",
|
390
390
|
{
|
391
391
|
type: "button",
|
392
|
-
className: j(
|
393
|
-
[
|
392
|
+
className: j(Je.dropdownButton, {
|
393
|
+
[Je.dropdownButtonActive]: n
|
394
394
|
}),
|
395
395
|
children: /* @__PURE__ */ i(t, { size: "25px" })
|
396
396
|
}
|
397
397
|
) }),
|
398
398
|
children: /* @__PURE__ */ i(ve, { placement: "right-start", children: e })
|
399
399
|
}
|
400
|
-
),
|
401
|
-
iconContainer:
|
400
|
+
), vn = "_iconContainer_nz34m_1", Tn = {
|
401
|
+
iconContainer: vn
|
402
402
|
}, _t = ({ className: e = "" }) => /* @__PURE__ */ i(
|
403
403
|
"div",
|
404
404
|
{
|
405
405
|
"aria-label": "Upgrade Icon",
|
406
406
|
className: j(
|
407
|
-
|
407
|
+
Tn.iconContainer,
|
408
408
|
"flex-row",
|
409
409
|
"items-center",
|
410
410
|
"justify-center",
|
411
411
|
e
|
412
412
|
),
|
413
|
-
children: /* @__PURE__ */ i(
|
413
|
+
children: /* @__PURE__ */ i(Rt, {})
|
414
414
|
}
|
415
|
-
),
|
416
|
-
menuContainer:
|
417
|
-
profileButton:
|
418
|
-
profileImage:
|
419
|
-
profileImageHighlight:
|
420
|
-
profileImageUpgradeIcon:
|
421
|
-
userIconWrapper:
|
422
|
-
}, bt =
|
415
|
+
), yn = "_menuContainer_wbu3u_5", wn = "_profileButton_wbu3u_16", Sn = "_profileImage_wbu3u_29", In = "_profileImageHighlight_wbu3u_37", En = "_profileImageUpgradeIcon_wbu3u_41", kn = "_userIconWrapper_wbu3u_47", C = {
|
416
|
+
menuContainer: yn,
|
417
|
+
profileButton: wn,
|
418
|
+
profileImage: Sn,
|
419
|
+
profileImageHighlight: In,
|
420
|
+
profileImageUpgradeIcon: En,
|
421
|
+
userIconWrapper: kn
|
422
|
+
}, bt = Ct({}), U = () => Pt(bt), Pn = ({ children: e }) => {
|
423
423
|
const {
|
424
424
|
currentTeam: t,
|
425
425
|
otherTeams: n,
|
@@ -431,32 +431,32 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
431
431
|
canAccessTeamSettings: d,
|
432
432
|
isEndOfTrialActive: l,
|
433
433
|
isTeamSuspended: m
|
434
|
-
} =
|
434
|
+
} = U();
|
435
435
|
return /* @__PURE__ */ i(
|
436
436
|
pe,
|
437
437
|
{
|
438
|
-
menuButton: () => /* @__PURE__ */ p("button", { className:
|
438
|
+
menuButton: () => /* @__PURE__ */ p("button", { className: C.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
439
439
|
t != null && t.logoUrl ? /* @__PURE__ */ i(
|
440
440
|
"img",
|
441
441
|
{
|
442
442
|
src: t.logoUrl,
|
443
|
-
className: j(
|
444
|
-
[
|
443
|
+
className: j(C.profileImage, {
|
444
|
+
[C.profileImageHighlight]: a
|
445
445
|
}),
|
446
446
|
alt: "Team Logo"
|
447
447
|
}
|
448
448
|
) : /* @__PURE__ */ i(
|
449
449
|
"div",
|
450
450
|
{
|
451
|
-
className: j(
|
452
|
-
[
|
451
|
+
className: j(C.userIconWrapper, "flex-row", "align-center", "items-center", {
|
452
|
+
[C.profileImageHighlight]: a
|
453
453
|
}),
|
454
454
|
children: /* @__PURE__ */ i(ot, { size: "25px" })
|
455
455
|
}
|
456
456
|
),
|
457
|
-
a && /* @__PURE__ */ i(_t, { className:
|
457
|
+
a && /* @__PURE__ */ i(_t, { className: C.profileImageUpgradeIcon })
|
458
458
|
] }),
|
459
|
-
children: /* @__PURE__ */ i(ve, { placement: "right-end", className:
|
459
|
+
children: /* @__PURE__ */ i(ve, { placement: "right-end", className: C.menuContainer, children: e({
|
460
460
|
allowTeamCreation: s,
|
461
461
|
otherTeams: n,
|
462
462
|
isLimitedView: c,
|
@@ -468,7 +468,7 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
468
468
|
}) })
|
469
469
|
}
|
470
470
|
);
|
471
|
-
}, gt = 0,
|
471
|
+
}, gt = 0, Cn = 9999, Nn = [150, 151, 250, 251], jn = [152, 153, 252, 253], Rn = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], An = [156, 159, 160, 256, 259, 260], ht = 9998, ye = (e) => e === gt, pt = (e) => e === Cn, Xr = (e) => Nn.includes(e), ea = (e) => jn.includes(e), ta = (e) => Rn.includes(e), na = (e) => An.includes(e), ra = (e) => e > gt && e < ht, aa = (e) => e === ht, On = /\n/, We = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [Nt(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), Ln = (e, t, n) => typeof e == "string" ? We(e, t, n) : e.flatMap((a) => typeof a == "string" ? We(a, t, n) : a), oa = (e) => Ln(e, On, /* @__PURE__ */ i("br", {})), qn = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, Mn = (e) => e.match(qn) ?? [], Qe = (e, t, n) => {
|
472
472
|
const a = e.split(t);
|
473
473
|
if (a.length === 1)
|
474
474
|
return e;
|
@@ -477,11 +477,11 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
477
477
|
/* @__PURE__ */ i("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
478
478
|
), o.push(a.join(t)), o.filter((s) => s !== "");
|
479
479
|
}, Ye = (e) => {
|
480
|
-
const t =
|
480
|
+
const t = Mn(e);
|
481
481
|
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? Qe(n, a, o) : n.flatMap((s) => typeof s == "string" ? Qe(s, a, o) : s), e) : e;
|
482
|
-
}, ia = (e) => typeof e == "string" ? Ye(e) : e.flatMap((t) => typeof t == "string" ? Ye(t) : t, e), sa = (e, t = "PP") => ct(e, t), ca = (e, t, n = "PP") => ct(
|
483
|
-
|
484
|
-
},
|
482
|
+
}, ia = (e) => typeof e == "string" ? Ye(e) : e.flatMap((t) => typeof t == "string" ? Ye(t) : t, e), sa = (e, t = "PP") => ct(e, t), ca = (e, t, n = "PP") => ct(Lt(e, t), n), la = (e) => {
|
483
|
+
x(e, []);
|
484
|
+
}, xn = ({ children: e, config: t }) => {
|
485
485
|
const {
|
486
486
|
teams: n,
|
487
487
|
currentTeamId: a,
|
@@ -490,7 +490,7 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
490
490
|
isTeamSuspended: c,
|
491
491
|
canAccessTeamSettings: u,
|
492
492
|
isEndOfTrialActive: d
|
493
|
-
} = t, l = n.find((_) => _.id === a), m = n.filter((_) => _.id !== a), g = (l == null ? void 0 : l.role) ?? "", T = ["biller", "owner"].includes(g), y = ye(o) || pt(o),
|
493
|
+
} = t, l = n.find((_) => _.id === a), m = n.filter((_) => _.id !== a), g = (l == null ? void 0 : l.role) ?? "", T = ["biller", "owner"].includes(g), y = ye(o) || pt(o), k = {
|
494
494
|
...t,
|
495
495
|
currentTeam: l,
|
496
496
|
otherTeams: m,
|
@@ -500,20 +500,20 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
500
500
|
showBillingButton: !s && u && T,
|
501
501
|
allowTeamCreation: !s && !d
|
502
502
|
};
|
503
|
-
return /* @__PURE__ */ i(bt.Provider, { value:
|
504
|
-
}, Un = ({ config: e, children: t }) => /* @__PURE__ */ i(
|
505
|
-
container:
|
506
|
-
profileEmail:
|
507
|
-
},
|
503
|
+
return /* @__PURE__ */ i(bt.Provider, { value: k, children: e });
|
504
|
+
}, Un = ({ config: e, children: t }) => /* @__PURE__ */ i(xn, { config: e, children: /* @__PURE__ */ i(Pn, { children: t }) }), Bn = "_container_q5pot_1", $n = "_profileEmail_q5pot_5", Ve = {
|
505
|
+
container: Bn,
|
506
|
+
profileEmail: $n
|
507
|
+
}, Hn = ({
|
508
508
|
href: e,
|
509
509
|
onClick: t,
|
510
510
|
userEmail: n,
|
511
511
|
hideBottomDivider: a
|
512
512
|
}) => {
|
513
|
-
const { isEndOfTrialActive: o, isTeamSuspended: s } =
|
513
|
+
const { isEndOfTrialActive: o, isTeamSuspended: s } = U();
|
514
514
|
return o || s ? null : /* @__PURE__ */ p(tt, { children: [
|
515
515
|
/* @__PURE__ */ i(
|
516
|
-
|
516
|
+
K,
|
517
517
|
{
|
518
518
|
href: e,
|
519
519
|
onClick: () => {
|
@@ -527,20 +527,20 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
527
527
|
),
|
528
528
|
!a && /* @__PURE__ */ i(it, {})
|
529
529
|
] });
|
530
|
-
},
|
531
|
-
wrapper:
|
532
|
-
profileImage:
|
533
|
-
teamName:
|
534
|
-
planLabel:
|
535
|
-
membership:
|
530
|
+
}, Fn = "_wrapper_15d85_1", zn = "_profileImage_15d85_14", Dn = "_teamName_15d85_22", Gn = "_planLabel_15d85_29", Kn = "_membership_15d85_38", Jn = "_defaultProfileImage_15d85_44", R = {
|
531
|
+
wrapper: Fn,
|
532
|
+
profileImage: zn,
|
533
|
+
teamName: Dn,
|
534
|
+
planLabel: Gn,
|
535
|
+
membership: Kn,
|
536
536
|
defaultProfileImage: Jn
|
537
537
|
}, vt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
538
|
-
const { currentTeam: a, planId: o } =
|
538
|
+
const { currentTeam: a, planId: o } = U(), s = e || a;
|
539
539
|
if (!s)
|
540
540
|
return null;
|
541
541
|
const c = ye(o) ? "Free" : pt(o) ? "Trial" : void 0;
|
542
542
|
return /* @__PURE__ */ p(
|
543
|
-
t ?
|
543
|
+
t ? K : "div",
|
544
544
|
{
|
545
545
|
className: `flex-row gap-2 flex-nowrap items-center ${R.wrapper}`,
|
546
546
|
...t && { onClick: () => t(s) },
|
@@ -556,83 +556,83 @@ const sn = "_sidebarContainer_bmdti_1", cn = {
|
|
556
556
|
]
|
557
557
|
}
|
558
558
|
);
|
559
|
-
},
|
560
|
-
teamsContainer:
|
561
|
-
},
|
562
|
-
const { otherTeams: t } =
|
563
|
-
return t.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${
|
564
|
-
},
|
565
|
-
container:
|
566
|
-
planCta:
|
567
|
-
upgradeIconWrapper:
|
568
|
-
},
|
569
|
-
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } =
|
559
|
+
}, Wn = "_teamsContainer_1t68g_1", Qn = {
|
560
|
+
teamsContainer: Wn
|
561
|
+
}, Yn = ({ onSwitchTeam: e }) => {
|
562
|
+
const { otherTeams: t } = U();
|
563
|
+
return t.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${Qn.teamsContainer}`, children: t.map((n) => /* @__PURE__ */ i(vt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id)) });
|
564
|
+
}, Vn = "_container_1u995_1", Zn = "_planCta_1u995_15", Xn = "_upgradeIconWrapper_1u995_19", fe = {
|
565
|
+
container: Vn,
|
566
|
+
planCta: Zn,
|
567
|
+
upgradeIconWrapper: Xn
|
568
|
+
}, er = ({ upgradeOptionHref: e }) => {
|
569
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = U();
|
570
570
|
if (!a)
|
571
571
|
return null;
|
572
572
|
const c = ye(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
573
|
-
return /* @__PURE__ */ p(
|
573
|
+
return /* @__PURE__ */ p(K, { href: e, className: `flex-col gap-1 items-start ${fe.container}`, children: [
|
574
574
|
/* @__PURE__ */ i("span", { className: fe.planCta, children: c }),
|
575
575
|
/* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${fe.upgradeIconWrapper}`, children: [
|
576
576
|
/* @__PURE__ */ i(_t, {}),
|
577
577
|
/* @__PURE__ */ i("span", { children: "See upgrade options" })
|
578
578
|
] })
|
579
579
|
] });
|
580
|
-
}, S = ({ children: e, ...t }) => /* @__PURE__ */ i("nav", { ...t, className:
|
580
|
+
}, S = ({ children: e, ...t }) => /* @__PURE__ */ i("nav", { ...t, className: ln.sidebarContainer, children: e });
|
581
581
|
S.Top = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
582
582
|
S.Bottom = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
|
583
|
-
S.Avatar =
|
584
|
-
S.IconLink =
|
585
|
-
S.Menu =
|
583
|
+
S.Avatar = mn;
|
584
|
+
S.IconLink = bn;
|
585
|
+
S.Menu = pn;
|
586
586
|
S.ProfileMenu = Un;
|
587
|
-
S.TeamSwitch =
|
587
|
+
S.TeamSwitch = Yn;
|
588
588
|
S.TeamMenuItem = vt;
|
589
|
-
S.UpgradeMenuItem =
|
590
|
-
S.ProfileSettingsMenuItem =
|
591
|
-
const
|
592
|
-
breadcrumbsItem:
|
593
|
-
breadcrumbs:
|
589
|
+
S.UpgradeMenuItem = er;
|
590
|
+
S.ProfileSettingsMenuItem = Hn;
|
591
|
+
const tr = "_breadcrumbsItem_1hm6a_1", nr = "_breadcrumbs_1hm6a_1", Ze = {
|
592
|
+
breadcrumbsItem: tr,
|
593
|
+
breadcrumbs: nr
|
594
594
|
}, ua = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: Ze.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ p(rt, { children: [
|
595
595
|
/* @__PURE__ */ i(at, { className: Ze.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
596
596
|
n < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
|
597
|
-
] }, `${t.link}-${t.name}`)) }),
|
597
|
+
] }, `${t.link}-${t.name}`)) }), rr = ({ items: e }) => /* @__PURE__ */ i(tt, { children: e.map((t, n) => /* @__PURE__ */ p(rt, { children: [
|
598
598
|
!!n && t.some((a) => a.visible) && /* @__PURE__ */ i(it, {}),
|
599
|
-
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: s }) => /* @__PURE__ */ i(
|
600
|
-
] }, t[0].label)) }),
|
601
|
-
badge:
|
602
|
-
tag:
|
603
|
-
withNavLinkStyle:
|
604
|
-
disabled:
|
605
|
-
projectNavigationItem:
|
606
|
-
projectNavigationItemDisabled:
|
599
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: s }) => /* @__PURE__ */ i(K, { href: a || "#", "aria-label": o, onClick: s, children: o }, o))
|
600
|
+
] }, t[0].label)) }), ar = "_badge_1pc1v_1", or = "_tag_1pc1v_15", ir = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", sr = "_disabled_1pc1v_57", cr = "_projectNavigationItem_1pc1v_61", lr = "_projectNavigationItemDisabled_1pc1v_67", N = {
|
601
|
+
badge: ar,
|
602
|
+
tag: or,
|
603
|
+
withNavLinkStyle: ir,
|
604
|
+
disabled: sr,
|
605
|
+
projectNavigationItem: cr,
|
606
|
+
projectNavigationItemDisabled: lr
|
607
607
|
}, Xe = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ p("div", { className: "flex gap-1", children: [
|
608
608
|
/* @__PURE__ */ p("div", { children: [
|
609
609
|
/* @__PURE__ */ i("span", { children: e }),
|
610
|
-
!!t && /* @__PURE__ */ i("div", { className:
|
610
|
+
!!t && /* @__PURE__ */ i("div", { className: N.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
611
611
|
] }),
|
612
|
-
!!n && /* @__PURE__ */ i(
|
613
|
-
] }), _e =
|
612
|
+
!!n && /* @__PURE__ */ i(At, { className: N.tag, children: n })
|
613
|
+
] }), _e = jt(
|
614
614
|
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: s }, c) => /* @__PURE__ */ i(he, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ i(
|
615
615
|
"div",
|
616
616
|
{
|
617
|
-
className: n ?
|
617
|
+
className: n ? N.projectNavigationItemDisabled : N.projectNavigationItem,
|
618
618
|
children: o || n || !t ? /* @__PURE__ */ i(
|
619
619
|
"button",
|
620
620
|
{
|
621
621
|
type: "button",
|
622
622
|
ref: c,
|
623
|
-
className: j(
|
624
|
-
[
|
623
|
+
className: j(N.withNavLinkStyle, {
|
624
|
+
[N.disabled]: n
|
625
625
|
}),
|
626
626
|
disabled: n,
|
627
627
|
onClick: o,
|
628
628
|
children: /* @__PURE__ */ i(Xe, { label: e, badge: a, novel: s })
|
629
629
|
}
|
630
|
-
) : /* @__PURE__ */ i("a", { href: t, className:
|
630
|
+
) : /* @__PURE__ */ i("a", { href: t, className: N.withNavLinkStyle, children: /* @__PURE__ */ i(Xe, { label: e, badge: a, novel: s }) })
|
631
631
|
}
|
632
632
|
) })
|
633
633
|
);
|
634
634
|
_e.displayName = "NavigationTabsItem";
|
635
|
-
const
|
635
|
+
const ur = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, dr = (e) => e.visible && (!e.dropdown || ur(e.dropdown)), da = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: A.navigationTabList, "aria-orientation": "horizontal", children: e.filter(dr).map((n) => {
|
636
636
|
var a, o, s;
|
637
637
|
return n.dropdown ? /* @__PURE__ */ i(
|
638
638
|
"li",
|
@@ -644,7 +644,7 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
644
644
|
pe,
|
645
645
|
{
|
646
646
|
menuButton: ({ opened: c }) => /* @__PURE__ */ i(_e, { label: n.label, disabled: n.disabled, active: c }),
|
647
|
-
children: /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(
|
647
|
+
children: /* @__PURE__ */ i(ve, { children: /* @__PURE__ */ i(rr, { items: n.dropdown }) })
|
648
648
|
}
|
649
649
|
)
|
650
650
|
},
|
@@ -670,34 +670,34 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
670
670
|
},
|
671
671
|
n.key
|
672
672
|
);
|
673
|
-
}) }) }),
|
673
|
+
}) }) }), mr = r.object({
|
674
674
|
lang_id: r.number(),
|
675
675
|
lang_iso: r.string(),
|
676
676
|
lang_name: r.string(),
|
677
677
|
is_writable: r.union([r.literal(0), r.literal(1)])
|
678
|
-
}),
|
678
|
+
}), fr = r.object({
|
679
679
|
user_id: r.number(),
|
680
680
|
email: r.string().email(),
|
681
681
|
fullname: r.string(),
|
682
682
|
created_at: r.string(),
|
683
683
|
created_at_timestamp: r.number(),
|
684
684
|
admin_rights: r.array(r.string()),
|
685
|
-
languages: r.array(
|
685
|
+
languages: r.array(mr),
|
686
686
|
// TODO nic: Do I need this?
|
687
687
|
is_admin: r.boolean(),
|
688
688
|
is_reviewer: r.boolean()
|
689
|
-
}),
|
689
|
+
}), _r = r.object({
|
690
690
|
project_id: r.string(),
|
691
|
-
contributors: r.array(
|
692
|
-
}),
|
691
|
+
contributors: r.array(fr)
|
692
|
+
}), br = Q({
|
693
693
|
description: "Get the details of a project contributor",
|
694
694
|
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
695
695
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
696
|
-
successResponseBodySchema:
|
697
|
-
}),
|
696
|
+
successResponseBodySchema: _r
|
697
|
+
}), gr = r.object({
|
698
698
|
lang_iso: r.string(),
|
699
699
|
custom_iso: r.string().optional()
|
700
|
-
}),
|
700
|
+
}), hr = r.object({
|
701
701
|
language_id: r.number(),
|
702
702
|
language_iso: r.string(),
|
703
703
|
progress: r.number(),
|
@@ -706,7 +706,7 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
706
706
|
r.literal("localization_files"),
|
707
707
|
r.literal("paged_documents"),
|
708
708
|
r.literal("marketing")
|
709
|
-
]),
|
709
|
+
]), pr = r.object({
|
710
710
|
per_platform_key_names: r.boolean(),
|
711
711
|
reviewing: r.boolean(),
|
712
712
|
auto_toggle_unverified: r.boolean(),
|
@@ -717,7 +717,7 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
717
717
|
custom_translation_statuses_allow_multiple: r.boolean(),
|
718
718
|
segmentation: r.boolean(),
|
719
719
|
contributor_preview_download_enabled: r.boolean()
|
720
|
-
}),
|
720
|
+
}), vr = r.object({
|
721
721
|
not_reviewed: r.number(),
|
722
722
|
unverified: r.number(),
|
723
723
|
spelling_grammar: r.number(),
|
@@ -734,14 +734,14 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
734
734
|
double_space: r.number(),
|
735
735
|
special_placeholder: r.number(),
|
736
736
|
unbalanced_brackets: r.number()
|
737
|
-
}),
|
737
|
+
}), Tr = r.object({
|
738
738
|
progress_total: r.number(),
|
739
739
|
keys_total: r.number(),
|
740
740
|
team: r.number(),
|
741
741
|
base_words: r.number(),
|
742
742
|
qa_issues_total: r.number(),
|
743
|
-
qa_issues:
|
744
|
-
}),
|
743
|
+
qa_issues: vr
|
744
|
+
}), D = r.object({
|
745
745
|
project_id: r.string(),
|
746
746
|
uuid: r.string().uuid(),
|
747
747
|
project_type: we,
|
@@ -754,23 +754,23 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
754
754
|
team_id: r.number(),
|
755
755
|
base_language_id: r.number(),
|
756
756
|
base_language_iso: r.string(),
|
757
|
-
settings:
|
758
|
-
statistics:
|
759
|
-
languages: r.array(
|
760
|
-
}),
|
757
|
+
settings: pr,
|
758
|
+
statistics: Tr,
|
759
|
+
languages: r.array(hr)
|
760
|
+
}), yr = r.object({
|
761
761
|
name: r.string(),
|
762
762
|
team_id: r.string(),
|
763
763
|
base_lang_iso: r.string(),
|
764
|
-
languages: r.array(
|
764
|
+
languages: r.array(gr),
|
765
765
|
project_type: we,
|
766
766
|
is_segmentation_enabled: r.boolean()
|
767
|
-
}), Se = () => "/projects",
|
767
|
+
}), Se = () => "/projects", wr = st({
|
768
768
|
description: "Create a new project",
|
769
769
|
method: "post",
|
770
770
|
pathResolver: Se,
|
771
|
-
requestBodySchema:
|
772
|
-
successResponseBodySchema:
|
773
|
-
}),
|
771
|
+
requestBodySchema: yr,
|
772
|
+
successResponseBodySchema: D
|
773
|
+
}), Sr = r.object({
|
774
774
|
project_type: we.optional(),
|
775
775
|
filter_team_id: r.number().optional(),
|
776
776
|
filter_names: r.string().optional(),
|
@@ -778,29 +778,29 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
778
778
|
include_settings: r.boolean().optional(),
|
779
779
|
limit: r.number().optional(),
|
780
780
|
page: r.number().optional()
|
781
|
-
}),
|
781
|
+
}), Ir = r.array(
|
782
782
|
r.union([
|
783
|
-
|
784
|
-
|
783
|
+
D.omit({ statistics: !0, settings: !0 }),
|
784
|
+
D.pick({ settings: !0, statistics: !0 }).partial()
|
785
785
|
])
|
786
|
-
),
|
786
|
+
), Er = Q({
|
787
787
|
description: "List all projects",
|
788
788
|
pathResolver: Se,
|
789
|
-
requestQuerySchema:
|
790
|
-
successResponseBodySchema:
|
791
|
-
}),
|
789
|
+
requestQuerySchema: Sr,
|
790
|
+
successResponseBodySchema: Ir
|
791
|
+
}), kr = r.object({
|
792
792
|
project_id: r.string()
|
793
793
|
}), Pr = Q({
|
794
794
|
description: "Retrieve a project",
|
795
795
|
pathResolver: Se,
|
796
|
-
requestQuerySchema:
|
797
|
-
successResponseBodySchema:
|
796
|
+
requestQuerySchema: kr,
|
797
|
+
successResponseBodySchema: D
|
798
798
|
}), Tt = r.union([
|
799
799
|
r.literal("owner"),
|
800
800
|
r.literal("admin"),
|
801
801
|
r.literal("biller"),
|
802
802
|
r.literal("member")
|
803
|
-
]),
|
803
|
+
]), Cr = r.object({
|
804
804
|
user_id: r.number(),
|
805
805
|
email: r.string().email(),
|
806
806
|
fullname: r.string(),
|
@@ -809,13 +809,13 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
809
809
|
role: Tt
|
810
810
|
}), Nr = r.object({
|
811
811
|
team_id: r.number(),
|
812
|
-
team_user:
|
813
|
-
}),
|
812
|
+
team_user: Cr
|
813
|
+
}), jr = Q({
|
814
814
|
description: "Get the details of a team user",
|
815
815
|
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
816
816
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
817
817
|
successResponseBodySchema: Nr
|
818
|
-
}),
|
818
|
+
}), Rr = r.object({
|
819
819
|
accessToken: r.string(),
|
820
820
|
refreshToken: r.string()
|
821
821
|
}), Ie = st({
|
@@ -823,58 +823,59 @@ const lr = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
823
823
|
method: "post",
|
824
824
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
825
825
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
826
|
-
requestHeaderSchema: r.
|
827
|
-
Authorization: r.string().
|
828
|
-
"x-csrf-token": r.string()
|
829
|
-
|
826
|
+
requestHeaderSchema: r.union([
|
827
|
+
r.object({ Authorization: r.string().startsWith("Bearer ") }),
|
828
|
+
r.object({ "x-csrf-token": r.string() })
|
829
|
+
]),
|
830
830
|
requestBodySchema: r.undefined(),
|
831
|
-
successResponseBodySchema:
|
831
|
+
successResponseBodySchema: Rr
|
832
832
|
});
|
833
833
|
function ma(e, t = {}) {
|
834
|
-
return
|
834
|
+
return Ot({
|
835
835
|
...t,
|
836
|
-
mutationFn: (n) =>
|
836
|
+
mutationFn: (n) => J(e, wr, {
|
837
837
|
body: n
|
838
838
|
})
|
839
839
|
});
|
840
840
|
}
|
841
|
-
const
|
841
|
+
const Ar = {
|
842
842
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
843
|
-
},
|
843
|
+
}, Or = (e, t) => L({
|
844
844
|
...t,
|
845
|
-
queryFn: ({ queryKey: [n, a, o] }) => W(e,
|
846
|
-
}),
|
847
|
-
|
848
|
-
|
845
|
+
queryFn: ({ queryKey: [n, a, o] }) => W(e, jr, { pathParams: { teamId: a, userId: o } })
|
846
|
+
}), Lr = {
|
847
|
+
teamKeyCsrf: (e, t) => ["getUserToken", "x-csrf-token", t, e],
|
848
|
+
teamKeyJwt: (e, t) => ["getUserToken", "Authorization", `Bearer ${t}`, e]
|
849
|
+
}, qr = (e, t) => L({
|
849
850
|
...t,
|
850
|
-
queryFn: ({ queryKey: [n, a] }) =>
|
851
|
-
pathParams: { teamId:
|
852
|
-
headers: {}
|
851
|
+
queryFn: ({ queryKey: [n, a, o, s] }) => J(e, Ie, {
|
852
|
+
pathParams: { teamId: s },
|
853
|
+
headers: a === "x-csrf-token" ? { "x-csrf-token": o } : { Authorization: o }
|
853
854
|
})
|
854
855
|
}), fa = {
|
855
856
|
// TODO nic: Is there a better way to key this?
|
856
857
|
paramsKey: (e) => ["listProjects", e]
|
857
858
|
};
|
858
859
|
function _a(e, t) {
|
859
|
-
return
|
860
|
+
return L({
|
860
861
|
...t,
|
861
|
-
queryFn: ({ queryKey: [n, a] }) => W(e,
|
862
|
+
queryFn: ({ queryKey: [n, a] }) => W(e, Er, {
|
862
863
|
queryParams: a
|
863
864
|
})
|
864
865
|
});
|
865
866
|
}
|
866
|
-
const
|
867
|
+
const Mr = {
|
867
868
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
868
|
-
},
|
869
|
+
}, xr = (e, t) => L({
|
869
870
|
...t,
|
870
|
-
queryFn: ({ queryKey: [n, a, o] }) => W(e,
|
871
|
+
queryFn: ({ queryKey: [n, a, o] }) => W(e, br, {
|
871
872
|
pathParams: { projectId: a, contributorId: o }
|
872
873
|
})
|
873
874
|
}), ba = {
|
874
875
|
projectIdKey: (e) => ["retrieveProject", e]
|
875
876
|
};
|
876
877
|
function ga(e, t) {
|
877
|
-
return
|
878
|
+
return L({
|
878
879
|
...t,
|
879
880
|
queryFn: ({ queryKey: [n, a] }) => W(e, Pr, {
|
880
881
|
queryParams: { project_id: a }
|
@@ -910,30 +911,34 @@ const G = class G extends CustomEvent {
|
|
910
911
|
});
|
911
912
|
}
|
912
913
|
};
|
913
|
-
|
914
|
+
Ne(G, "eventName", "new-jwt-issued");
|
914
915
|
let O = G;
|
915
|
-
function ha(e, t) {
|
916
|
-
const n = Lr(e, {
|
917
|
-
queryKey: Or.teamKey(t)
|
918
|
-
}), a = nt();
|
919
|
-
return M(() => {
|
920
|
-
n.data && n.data.accessToken !== a.current && (window.dispatchEvent(new O(n.data)), a.current = n.data.accessToken);
|
921
|
-
}, [n.data]), n;
|
922
|
-
}
|
923
916
|
function Ee() {
|
924
917
|
const e = be(document.cookie, "accessToken"), t = be(document.cookie, "refreshToken");
|
925
918
|
return !e || !t ? Promise.resolve(void 0) : Promise.resolve({ accessToken: e, refreshToken: t });
|
926
919
|
}
|
927
|
-
function
|
920
|
+
function yt() {
|
928
921
|
return Promise.resolve(be(document.cookie, "csrf_token"));
|
929
922
|
}
|
930
923
|
function be(e, t) {
|
931
924
|
var n, a;
|
932
925
|
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
933
926
|
}
|
934
|
-
function
|
927
|
+
function ha(e, t) {
|
928
|
+
const { data: n, isFetching: a } = L({
|
929
|
+
queryKey: ["csrf-token"],
|
930
|
+
queryFn: yt
|
931
|
+
}), o = qr(e, {
|
932
|
+
queryKey: Lr.teamKeyCsrf(t, n ?? ""),
|
933
|
+
enabled: a || n !== void 0
|
934
|
+
}), s = nt();
|
935
|
+
return x(() => {
|
936
|
+
o.data && o.data.accessToken !== s.current && (window.dispatchEvent(new O(o.data)), s.current = o.data.accessToken);
|
937
|
+
}, [o.data]), { ...o, isFetching: o.isFetching || a };
|
938
|
+
}
|
939
|
+
function wt() {
|
935
940
|
const [e, t] = ge();
|
936
|
-
return
|
941
|
+
return x(() => {
|
937
942
|
let n = !1;
|
938
943
|
const a = (o) => {
|
939
944
|
t(o.detail.payload), n = !0;
|
@@ -946,15 +951,15 @@ function yt() {
|
|
946
951
|
}, []), e;
|
947
952
|
}
|
948
953
|
function pa(e) {
|
949
|
-
const t =
|
950
|
-
return
|
951
|
-
queryKey:
|
954
|
+
const t = wt();
|
955
|
+
return Or(e, {
|
956
|
+
queryKey: Ar.teamUserKey((t == null ? void 0 : t.teamId) ?? 0, (t == null ? void 0 : t.userId) ?? 0)
|
952
957
|
});
|
953
958
|
}
|
954
959
|
function va(e, t) {
|
955
|
-
const n =
|
956
|
-
return
|
957
|
-
queryKey:
|
960
|
+
const n = wt();
|
961
|
+
return xr(e, {
|
962
|
+
queryKey: Mr.projectUserKey(t, (n == null ? void 0 : n.userId) ?? 0),
|
958
963
|
enabled: n !== void 0
|
959
964
|
});
|
960
965
|
}
|
@@ -965,7 +970,7 @@ async function Ta() {
|
|
965
970
|
const t = Y(e.accessToken);
|
966
971
|
return t ? { ...e, payload: t } : Promise.resolve(void 0);
|
967
972
|
}
|
968
|
-
function
|
973
|
+
function F(e) {
|
969
974
|
return { Authorization: `Bearer ${e}` };
|
970
975
|
}
|
971
976
|
function Br(e, t) {
|
@@ -976,19 +981,19 @@ function Br(e, t) {
|
|
976
981
|
return n(a, o);
|
977
982
|
const c = await n(a, {
|
978
983
|
...o,
|
979
|
-
headers: { ...o.headers, ...
|
984
|
+
headers: { ...o.headers, ...F(s.accessToken) }
|
980
985
|
});
|
981
986
|
if (s && (c.status === 401 || c.status === 403)) {
|
982
987
|
const d = Y(s.accessToken);
|
983
988
|
if (!d)
|
984
989
|
return c;
|
985
|
-
const l = await
|
990
|
+
const l = await J(e, Ie, {
|
986
991
|
pathParams: { teamId: d.teamId },
|
987
|
-
headers:
|
992
|
+
headers: F(s.refreshToken)
|
988
993
|
});
|
989
994
|
return await ((u = t.onNewJwtTokenIssued) == null ? void 0 : u.call(t, l)), n(a, {
|
990
995
|
...o,
|
991
|
-
headers: { ...o.headers, ...
|
996
|
+
headers: { ...o.headers, ...F(l.accessToken) }
|
992
997
|
});
|
993
998
|
}
|
994
999
|
return c;
|
@@ -1009,13 +1014,13 @@ function Hr(e, t) {
|
|
1009
1014
|
const c = await t.getCsrfToken();
|
1010
1015
|
if (c === void 0)
|
1011
1016
|
return n(a, o);
|
1012
|
-
const u = await
|
1017
|
+
const u = await J(e, Ie, {
|
1013
1018
|
pathParams: { teamId: await t.getTeamId() },
|
1014
1019
|
headers: { "x-csrf-token": c }
|
1015
1020
|
});
|
1016
1021
|
return await ((d = t.onNewJwtTokenIssued) == null ? void 0 : d.call(t, u)), n(a, {
|
1017
1022
|
...o,
|
1018
|
-
headers: { ...o.headers, ...
|
1023
|
+
headers: { ...o.headers, ...F(u.accessToken) }
|
1019
1024
|
});
|
1020
1025
|
};
|
1021
1026
|
}
|
@@ -1034,7 +1039,7 @@ function et(e) {
|
|
1034
1039
|
return {
|
1035
1040
|
...e,
|
1036
1041
|
getCachedJwtToken: e.getCachedJwtToken ?? Ee,
|
1037
|
-
getCsrfToken: "getCsrfToken" in e ? e.getCsrfToken :
|
1042
|
+
getCsrfToken: "getCsrfToken" in e ? e.getCsrfToken : yt,
|
1038
1043
|
onNewJwtTokenIssued: (t) => {
|
1039
1044
|
var n;
|
1040
1045
|
return window.dispatchEvent(new O(t)), ((n = e.onNewJwtTokenIssued) == null ? void 0 : n.call(e, t)) ?? Promise.resolve();
|
@@ -1044,28 +1049,28 @@ function et(e) {
|
|
1044
1049
|
export {
|
1045
1050
|
ua as Breadcrumbs,
|
1046
1051
|
ht as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1047
|
-
|
1048
|
-
|
1052
|
+
An as ENTERPRISE_PLAN_IDS,
|
1053
|
+
jn as ESSENTIAL_PLAN_IDS,
|
1049
1054
|
gt as FREE_PLAN_ID,
|
1050
|
-
|
1055
|
+
Rr as JWT_TOKEN_SCHEMA,
|
1051
1056
|
$r as LokaliseAuthAddon,
|
1052
1057
|
ya as LokaliseAuthBrowserAddon,
|
1053
1058
|
z as NavigationPanel,
|
1054
1059
|
da as NavigationTabs,
|
1055
|
-
|
1060
|
+
Rn as PRO_PLAN_IDS,
|
1056
1061
|
Nn as START_PLAN_IDS,
|
1057
1062
|
S as Sidebar,
|
1058
|
-
|
1059
|
-
|
1063
|
+
Cr as TEAM_USER_SCHEMA,
|
1064
|
+
Cn as TRIAL_PLAN_ID,
|
1060
1065
|
oa as convertNewLineToBreakTag,
|
1061
|
-
|
1066
|
+
wr as createProject,
|
1062
1067
|
sa as formatDate,
|
1063
1068
|
ca as formatDateTz,
|
1064
1069
|
Ta as getAuthenticatedSessionDetailFromRequest,
|
1065
|
-
|
1066
|
-
|
1070
|
+
jr as getTeamUser,
|
1071
|
+
Ar as getTeamUsersQueryKey,
|
1067
1072
|
Ie as getUserToken,
|
1068
|
-
|
1073
|
+
Lr as getUserTokenKey,
|
1069
1074
|
aa as isEnterpriseOpenSourcePlan,
|
1070
1075
|
na as isEnterprisePlan,
|
1071
1076
|
ea as isEssentialPlan,
|
@@ -1074,23 +1079,23 @@ export {
|
|
1074
1079
|
ta as isProPlan,
|
1075
1080
|
Xr as isStartPlan,
|
1076
1081
|
pt as isTrialPlan,
|
1077
|
-
|
1082
|
+
Er as listProjects,
|
1078
1083
|
fa as listProjectsKey,
|
1079
1084
|
ia as makeUrlClickable,
|
1080
1085
|
Y as parseJwtTokenPayload,
|
1081
|
-
|
1082
|
-
|
1086
|
+
br as retrieveContributor,
|
1087
|
+
Mr as retrieveContributorKeys,
|
1083
1088
|
Pr as retrieveProject,
|
1084
1089
|
ba as retrieveProjectQueryKey,
|
1085
1090
|
va as useAuthenticatedProjectContributor,
|
1086
|
-
|
1091
|
+
wt as useAuthenticatedSessionPayload,
|
1087
1092
|
pa as useAuthenticatedUser,
|
1088
1093
|
ma as useCreateProjectMutation,
|
1089
1094
|
la as useEffectOnce,
|
1090
1095
|
ha as useGetPromotedClassicSessionJwtQuery,
|
1091
|
-
|
1092
|
-
|
1096
|
+
Or as useGetTeamUsersQuery,
|
1097
|
+
qr as useGetUserTokenQuery,
|
1093
1098
|
_a as useListProjectsQuery,
|
1094
|
-
|
1099
|
+
xr as useRetrieveContributorQuery,
|
1095
1100
|
ga as useRetrieveProjectQuery
|
1096
1101
|
};
|