@lokalise/harmony 1.6.0-exp-jwtutils.22 → 1.8.0

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