@lokalise/harmony 1.8.2 → 1.11.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 (52) hide show
  1. package/README.md +63 -0
  2. package/dist/harmony.cjs +1 -1
  3. package/dist/harmony.mjs +923 -507
  4. package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts +10 -0
  5. package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts +1 -0
  6. package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +7 -0
  7. package/dist/types/src/features/auth/core/jwtTokenPayload.test.d.ts +1 -0
  8. package/dist/types/src/features/auth/core/lokaliseAuthAddon.d.ts +14 -0
  9. package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +13 -0
  10. package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.test.d.ts +1 -0
  11. package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +5 -0
  12. package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +42 -0
  13. package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +27 -0
  14. package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -0
  15. package/dist/types/src/features/auth/core/utils/makeAuthHeader.test.d.ts +1 -0
  16. package/dist/types/src/features/auth/frontend/addon/lokaliseAuthBrowserAddon.d.ts +35 -0
  17. package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +20 -0
  18. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +28 -0
  19. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +18 -0
  20. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +18 -0
  21. package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +12 -0
  22. package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +14 -0
  23. package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts +1 -0
  24. package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +4 -0
  25. package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.test.d.ts +1 -0
  26. package/dist/types/src/features/auth/node.d.ts +9 -0
  27. package/dist/types/src/features/node.d.ts +2 -0
  28. package/dist/types/src/features/publicApi/contributors.d.ts +111 -0
  29. package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +76 -0
  30. package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +26 -0
  31. package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +20 -0
  32. package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +81 -0
  33. package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +34 -0
  34. package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +72 -0
  35. package/dist/types/src/features/publicApi/node.d.ts +16 -0
  36. package/dist/types/src/features/publicApi/projects.d.ts +1132 -0
  37. package/dist/types/src/features/publicApi/teamUsers.d.ts +61 -0
  38. package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +171 -0
  39. package/dist/types/src/features/publicApi/types/languageTypes.d.ts +29 -0
  40. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +1061 -0
  41. package/dist/types/src/features/publicApi/types/teamRoleTypes.d.ts +3 -0
  42. package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +70 -0
  43. package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +26 -0
  44. package/dist/types/src/features/publicApi/userToken.d.ts +35 -0
  45. package/dist/types/src/node.d.ts +2 -1
  46. package/dist/types/src/utils/testing/createMockFactoryWithDefaults.d.ts +2 -0
  47. package/dist/types/src/utils/testing/createMockFactoryWithDefaults.test.d.ts +1 -0
  48. package/dist/types/src/utils/testing/deepOverride.d.ts +4 -0
  49. package/dist/types/src/utils/testing/deepOverride.test.d.ts +1 -0
  50. package/dist/types/src/utils/types/apiMutationOverrides.d.ts +2 -0
  51. package/dist/types/src/utils/types/apiQueryOverrides.d.ts +2 -0
  52. package/package.json +13 -2
package/dist/harmony.mjs CHANGED
@@ -1,691 +1,1107 @@
1
- import { jsx as i, jsxs as b, Fragment as $e } from "react/jsx-runtime";
2
- import * as k from "react";
3
- import { useRef as on, useState as Ue, useCallback as me, useEffect as ie, useContext as sn, createContext as cn, cloneElement as ln, Fragment as De, forwardRef as un } from "react";
4
- import { Tooltip as ae, Link as ze, Menu as oe, MenuList as se, CaretUpIcon as dn, UserIcon as Fe, MenuItem as $, MenuDivider as We, Tag as fn } from "@lokalise/louis";
5
- import { format as He } from "date-fns";
6
- import { toZonedTime as mn } from "date-fns-tz";
7
- var B = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
8
- function Ge(e) {
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";
10
+ import { z as r } from "zod";
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";
14
+ import { buildGetRoute as Q } from "@lokalise/universal-ts-utils/node";
15
+ var H = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
16
+ function dt(e) {
9
17
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
10
18
  }
11
- var D, he;
12
- function ce() {
13
- if (he) return D;
14
- he = 1;
15
- function e(n) {
16
- var t = typeof n;
17
- return n != null && (t == "object" || t == "function");
19
+ var Z, Pe;
20
+ function Te() {
21
+ if (Pe) return Z;
22
+ Pe = 1;
23
+ function e(t) {
24
+ var n = typeof t;
25
+ return t != null && (n == "object" || n == "function");
18
26
  }
19
- return D = e, D;
20
- }
21
- var z, ge;
22
- function hn() {
23
- if (ge) return z;
24
- ge = 1;
25
- var e = typeof B == "object" && B && B.Object === Object && B;
26
- return z = e, z;
27
- }
28
- var F, pe;
29
- function Ve() {
30
- if (pe) return F;
31
- pe = 1;
32
- var e = hn(), n = typeof self == "object" && self && self.Object === Object && self, t = e || n || Function("return this")();
33
- return F = t, F;
34
- }
35
- var W, be;
36
- function gn() {
37
- if (be) return W;
38
- be = 1;
39
- var e = Ve(), n = function() {
27
+ return Z = e, Z;
28
+ }
29
+ var X, Ae;
30
+ function xt() {
31
+ if (Ae) return X;
32
+ Ae = 1;
33
+ var e = typeof H == "object" && H && H.Object === Object && H;
34
+ return X = e, X;
35
+ }
36
+ var ee, Oe;
37
+ function mt() {
38
+ if (Oe) return ee;
39
+ Oe = 1;
40
+ var e = xt(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
41
+ return ee = n, ee;
42
+ }
43
+ var te, Le;
44
+ function Ut() {
45
+ if (Le) return te;
46
+ Le = 1;
47
+ var e = mt(), t = function() {
40
48
  return e.Date.now();
41
49
  };
42
- return W = n, W;
50
+ return te = t, te;
43
51
  }
44
- var H, _e;
45
- function pn() {
46
- if (_e) return H;
47
- _e = 1;
52
+ var ne, qe;
53
+ function Bt() {
54
+ if (qe) return ne;
55
+ qe = 1;
48
56
  var e = /\s/;
49
- function n(t) {
50
- for (var r = t.length; r-- && e.test(t.charAt(r)); )
57
+ function t(n) {
58
+ for (var a = n.length; a-- && e.test(n.charAt(a)); )
51
59
  ;
52
- return r;
60
+ return a;
53
61
  }
54
- return H = n, H;
55
- }
56
- var G, ve;
57
- function bn() {
58
- if (ve) return G;
59
- ve = 1;
60
- var e = pn(), n = /^\s+/;
61
- function t(r) {
62
- return r && r.slice(0, e(r) + 1).replace(n, "");
62
+ return ne = t, ne;
63
+ }
64
+ var re, Me;
65
+ function $t() {
66
+ if (Me) return re;
67
+ Me = 1;
68
+ var e = Bt(), t = /^\s+/;
69
+ function n(a) {
70
+ return a && a.slice(0, e(a) + 1).replace(t, "");
63
71
  }
64
- return G = t, G;
65
- }
66
- var V, Te;
67
- function Ye() {
68
- if (Te) return V;
69
- Te = 1;
70
- var e = Ve(), n = e.Symbol;
71
- return V = n, V;
72
- }
73
- var Y, we;
74
- function _n() {
75
- if (we) return Y;
76
- we = 1;
77
- var e = Ye(), n = Object.prototype, t = n.hasOwnProperty, r = n.toString, a = e ? e.toStringTag : void 0;
78
- function o(s) {
79
- var l = t.call(s, a), u = s[a];
72
+ return re = n, re;
73
+ }
74
+ var ae, xe;
75
+ function ft() {
76
+ if (xe) return ae;
77
+ xe = 1;
78
+ var e = mt(), t = e.Symbol;
79
+ return ae = t, ae;
80
+ }
81
+ var oe, Ue;
82
+ function Ht() {
83
+ if (Ue) return oe;
84
+ Ue = 1;
85
+ var e = ft(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
86
+ function s(c) {
87
+ var u = n.call(c, o), d = c[o];
80
88
  try {
81
- s[a] = void 0;
82
- var c = !0;
89
+ c[o] = void 0;
90
+ var l = !0;
83
91
  } catch {
84
92
  }
85
- var d = r.call(s);
86
- return c && (l ? s[a] = u : delete s[a]), d;
93
+ var m = a.call(c);
94
+ return l && (u ? c[o] = d : delete c[o]), m;
87
95
  }
88
- return Y = o, Y;
89
- }
90
- var Z, Ie;
91
- function vn() {
92
- if (Ie) return Z;
93
- Ie = 1;
94
- var e = Object.prototype, n = e.toString;
95
- function t(r) {
96
- return n.call(r);
96
+ return oe = s, oe;
97
+ }
98
+ var ie, Be;
99
+ function Dt() {
100
+ if (Be) return ie;
101
+ Be = 1;
102
+ var e = Object.prototype, t = e.toString;
103
+ function n(a) {
104
+ return t.call(a);
97
105
  }
98
- return Z = t, Z;
99
- }
100
- var X, ye;
101
- function Tn() {
102
- if (ye) return X;
103
- ye = 1;
104
- var e = Ye(), n = _n(), t = vn(), r = "[object Null]", a = "[object Undefined]", o = e ? e.toStringTag : void 0;
105
- function s(l) {
106
- return l == null ? l === void 0 ? a : r : o && o in Object(l) ? n(l) : t(l);
106
+ return ie = n, ie;
107
+ }
108
+ var se, $e;
109
+ function zt() {
110
+ if ($e) return se;
111
+ $e = 1;
112
+ var e = ft(), t = Ht(), n = Dt(), a = "[object Null]", o = "[object Undefined]", s = e ? e.toStringTag : void 0;
113
+ function c(u) {
114
+ return u == null ? u === void 0 ? o : a : s && s in Object(u) ? t(u) : n(u);
107
115
  }
108
- return X = s, X;
109
- }
110
- var J, Ne;
111
- function wn() {
112
- if (Ne) return J;
113
- Ne = 1;
114
- function e(n) {
115
- return n != null && typeof n == "object";
116
+ return se = c, se;
117
+ }
118
+ var ce, He;
119
+ function Ft() {
120
+ if (He) return ce;
121
+ He = 1;
122
+ function e(t) {
123
+ return t != null && typeof t == "object";
116
124
  }
117
- return J = e, J;
118
- }
119
- var K, Se;
120
- function In() {
121
- if (Se) return K;
122
- Se = 1;
123
- var e = Tn(), n = wn(), t = "[object Symbol]";
124
- function r(a) {
125
- return typeof a == "symbol" || n(a) && e(a) == t;
125
+ return ce = e, ce;
126
+ }
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
+ function a(o) {
133
+ return typeof o == "symbol" || t(o) && e(o) == n;
126
134
  }
127
- return K = r, K;
128
- }
129
- var Q, Ee;
130
- function yn() {
131
- if (Ee) return Q;
132
- Ee = 1;
133
- var e = bn(), n = ce(), t = In(), r = NaN, a = /^[-+]0x[0-9a-f]+$/i, o = /^0b[01]+$/i, s = /^0o[0-7]+$/i, l = parseInt;
134
- function u(c) {
135
- if (typeof c == "number")
136
- return c;
137
- if (t(c))
138
- return r;
139
- if (n(c)) {
140
- var d = typeof c.valueOf == "function" ? c.valueOf() : c;
141
- c = n(d) ? d + "" : d;
135
+ return le = a, le;
136
+ }
137
+ var ue, ze;
138
+ function Jt() {
139
+ if (ze) return ue;
140
+ ze = 1;
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
+ function d(l) {
143
+ if (typeof l == "number")
144
+ return l;
145
+ if (n(l))
146
+ return a;
147
+ if (t(l)) {
148
+ var m = typeof l.valueOf == "function" ? l.valueOf() : l;
149
+ l = t(m) ? m + "" : m;
142
150
  }
143
- if (typeof c != "string")
144
- return c === 0 ? c : +c;
145
- c = e(c);
146
- var h = o.test(c);
147
- return h || s.test(c) ? l(c.slice(2), h ? 2 : 8) : a.test(c) ? r : +c;
151
+ if (typeof l != "string")
152
+ return l === 0 ? l : +l;
153
+ l = e(l);
154
+ var _ = s.test(l);
155
+ return _ || c.test(l) ? u(l.slice(2), _ ? 2 : 8) : o.test(l) ? a : +l;
148
156
  }
149
- return Q = u, Q;
157
+ return ue = d, ue;
150
158
  }
151
- var ee, Pe;
152
- function Ze() {
153
- if (Pe) return ee;
154
- Pe = 1;
155
- var e = ce(), n = gn(), t = yn(), r = "Expected a function", a = Math.max, o = Math.min;
156
- function s(l, u, c) {
157
- var d, h, T, N, m, v, w = 0, I = !1, g = !1, S = !0;
158
- if (typeof l != "function")
159
- throw new TypeError(r);
160
- u = t(u) || 0, e(c) && (I = !!c.leading, g = "maxWait" in c, T = g ? a(t(c.maxWait) || 0, u) : T, S = "trailing" in c ? !!c.trailing : S);
161
- function _(f) {
162
- var E = d, L = h;
163
- return d = h = void 0, w = f, N = l.apply(L, E), N;
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
+ function c(u, d, l) {
165
+ var m, _, y, E, b, T, w = 0, S = !1, g = !1, k = !0;
166
+ if (typeof u != "function")
167
+ throw new TypeError(a);
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
+ function v(f) {
170
+ var C = m, L = _;
171
+ return m = _ = void 0, w = f, E = u.apply(L, C), E;
164
172
  }
165
- function p(f) {
166
- return w = f, m = setTimeout(q, u), I ? _(f) : N;
173
+ function h(f) {
174
+ return w = f, b = setTimeout($, d), S ? v(f) : E;
167
175
  }
168
- function A(f) {
169
- var E = f - v, L = f - w, fe = u - E;
170
- return g ? o(fe, T - L) : fe;
176
+ function B(f) {
177
+ var C = f - T, L = f - w, Ne = d - C;
178
+ return g ? s(Ne, y - L) : Ne;
171
179
  }
172
- function ue(f) {
173
- var E = f - v, L = f - w;
174
- return v === void 0 || E >= u || E < 0 || g && L >= T;
180
+ function ke(f) {
181
+ var C = f - T, L = f - w;
182
+ return T === void 0 || C >= d || C < 0 || g && L >= y;
175
183
  }
176
- function q() {
177
- var f = n();
178
- if (ue(f))
179
- return de(f);
180
- m = setTimeout(q, A(f));
184
+ function $() {
185
+ var f = t();
186
+ if (ke(f))
187
+ return Ce(f);
188
+ b = setTimeout($, B(f));
181
189
  }
182
- function de(f) {
183
- return m = void 0, S && d ? _(f) : (d = h = void 0, N);
190
+ function Ce(f) {
191
+ return b = void 0, k && m ? v(f) : (m = _ = void 0, E);
184
192
  }
185
- function rn() {
186
- m !== void 0 && clearTimeout(m), w = 0, d = v = h = m = void 0;
193
+ function Et() {
194
+ b !== void 0 && clearTimeout(b), w = 0, m = T = _ = b = void 0;
187
195
  }
188
- function an() {
189
- return m === void 0 ? N : de(n());
196
+ function kt() {
197
+ return b === void 0 ? E : Ce(t());
190
198
  }
191
- function U() {
192
- var f = n(), E = ue(f);
193
- if (d = arguments, h = this, v = f, E) {
194
- if (m === void 0)
195
- return p(v);
199
+ function V() {
200
+ var f = t(), C = ke(f);
201
+ if (m = arguments, _ = this, T = f, C) {
202
+ if (b === void 0)
203
+ return h(T);
196
204
  if (g)
197
- return clearTimeout(m), m = setTimeout(q, u), _(v);
205
+ return clearTimeout(b), b = setTimeout($, d), v(T);
198
206
  }
199
- return m === void 0 && (m = setTimeout(q, u)), N;
207
+ return b === void 0 && (b = setTimeout($, d)), E;
200
208
  }
201
- return U.cancel = rn, U.flush = an, U;
209
+ return V.cancel = Et, V.flush = kt, V;
202
210
  }
203
- return ee = s, ee;
204
- }
205
- var Nn = Ze();
206
- const Sn = /* @__PURE__ */ Ge(Nn);
207
- var ne, je;
208
- function En() {
209
- if (je) return ne;
210
- je = 1;
211
- var e = Ze(), n = ce(), t = "Expected a function";
212
- function r(a, o, s) {
213
- var l = !0, u = !0;
214
- if (typeof a != "function")
215
- throw new TypeError(t);
216
- return n(s) && (l = "leading" in s ? !!s.leading : l, u = "trailing" in s ? !!s.trailing : u), e(a, o, {
217
- leading: l,
218
- maxWait: o,
219
- trailing: u
211
+ return de = c, de;
212
+ }
213
+ var Kt = bt();
214
+ const Wt = /* @__PURE__ */ dt(Kt);
215
+ var me, Ge;
216
+ function Qt() {
217
+ if (Ge) return me;
218
+ Ge = 1;
219
+ var e = bt(), t = Te(), n = "Expected a function";
220
+ function a(o, s, c) {
221
+ var u = !0, d = !0;
222
+ if (typeof o != "function")
223
+ throw new TypeError(n);
224
+ return t(c) && (u = "leading" in c ? !!c.leading : u, d = "trailing" in c ? !!c.trailing : d), e(o, s, {
225
+ leading: u,
226
+ maxWait: s,
227
+ trailing: d
220
228
  });
221
229
  }
222
- return ne = r, ne;
230
+ return me = a, me;
223
231
  }
224
- var Pn = En();
225
- const jn = /* @__PURE__ */ Ge(Pn), Rn = (e, n, t, r) => {
226
- switch (n) {
232
+ var Yt = Qt();
233
+ const Vt = /* @__PURE__ */ dt(Yt), Zt = (e, t, n, a) => {
234
+ switch (t) {
227
235
  case "debounce":
228
- return Sn(e, t, r);
236
+ return Wt(e, n, a);
229
237
  case "throttle":
230
- return jn(e, t, r);
238
+ return Vt(e, n, a);
231
239
  default:
232
240
  return e;
233
241
  }
234
- }, xn = (
242
+ }, Xt = (
235
243
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
236
244
  (e) => {
237
- const n = k.useRef(e);
238
- return k.useEffect(() => {
239
- n.current = e;
240
- }), k.useMemo(() => (...t) => {
241
- var r;
242
- return (r = n.current) === null || r === void 0 ? void 0 : r.call(n, ...t);
245
+ const t = q.useRef(e);
246
+ return q.useEffect(() => {
247
+ t.current = e;
248
+ }), q.useMemo(() => (...n) => {
249
+ var a;
250
+ return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
243
251
  }, []);
244
252
  }
245
- ), Cn = (
253
+ ), en = (
246
254
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
247
255
  (e) => {
248
- const [n, t] = k.useState((e == null ? void 0 : e.current) || null);
256
+ const [t, n] = q.useState((e == null ? void 0 : e.current) || null);
249
257
  return e && setTimeout(() => {
250
- e.current !== n && t(e.current);
251
- }, 0), { refProxy: k.useMemo(() => new Proxy((a) => {
252
- a !== n && t(a);
258
+ e.current !== t && n(e.current);
259
+ }, 0), { refProxy: q.useMemo(() => new Proxy((o) => {
260
+ o !== t && n(o);
253
261
  }, {
254
- get(a, o) {
255
- return o === "current" ? n : a[o];
262
+ get(o, s) {
263
+ return s === "current" ? t : o[s];
256
264
  },
257
- set(a, o, s) {
258
- return o === "current" ? t(s) : a[o] = s, !0;
265
+ set(o, s, c) {
266
+ return s === "current" ? n(c) : o[s] = c, !0;
259
267
  }
260
- }), [n]), refElement: n, setRefElement: t };
268
+ }), [t]), refElement: t, setRefElement: n };
261
269
  }
262
- ), Ln = (e, n) => n === "border-box" ? {
270
+ ), tn = (e, t) => t === "border-box" ? {
263
271
  width: e.borderBoxSize[0].inlineSize,
264
272
  height: e.borderBoxSize[0].blockSize
265
- } : n === "content-box" ? {
273
+ } : t === "content-box" ? {
266
274
  width: e.contentBoxSize[0].inlineSize,
267
275
  height: e.contentBoxSize[0].blockSize
268
276
  } : {
269
277
  width: e.contentRect.width,
270
278
  height: e.contentRect.height
271
279
  };
272
- function kn({ skipOnMount: e = !1, refreshMode: n, refreshRate: t = 1e3, refreshOptions: r, handleWidth: a = !0, handleHeight: o = !0, targetRef: s, observerOptions: l, onResize: u } = {}) {
273
- const c = on(e), d = xn(u), [h, T] = Ue({
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({
274
282
  width: void 0,
275
283
  height: void 0
276
- }), { refProxy: N, refElement: m } = Cn(s), { box: v } = l || {}, w = me((g) => {
277
- if (!a && !o)
284
+ }), { refProxy: E, refElement: b } = en(c), { box: T } = u || {}, w = je((g) => {
285
+ if (!o && !s)
278
286
  return;
279
- if (c.current) {
280
- c.current = !1;
287
+ if (l.current) {
288
+ l.current = !1;
281
289
  return;
282
290
  }
283
- const S = (_, p) => a && _.width !== p.width || o && _.height !== p.height;
284
- g.forEach((_) => {
285
- const p = Ln(_, v);
286
- T((A) => S(A, p) ? (d == null || d({
287
- width: p.width,
288
- height: p.height,
289
- entry: _
290
- }), p) : A);
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
+ width: h.width,
296
+ height: h.height,
297
+ entry: v
298
+ }), h) : B);
291
299
  });
292
- }, [a, o, c, v]), I = me(Rn(w, n, t, r), [
300
+ }, [o, s, l, T]), S = je(Zt(w, t, n, a), [
293
301
  w,
294
- n,
295
302
  t,
296
- r
303
+ n,
304
+ a
297
305
  ]);
298
- return ie(() => {
306
+ return M(() => {
299
307
  let g;
300
- return m ? (g = new window.ResizeObserver(I), g.observe(m, l)) : (h.width || h.height) && (d == null || d({
308
+ return b ? (g = new window.ResizeObserver(S), g.observe(b, u)) : (_.width || _.height) && (m == null || m({
301
309
  width: null,
302
310
  height: null,
303
311
  entry: null
304
- }), T({ width: void 0, height: void 0 })), () => {
305
- var S, _, p;
306
- (S = g == null ? void 0 : g.disconnect) === null || S === void 0 || S.call(g), (p = (_ = I).cancel) === null || p === void 0 || p.call(_);
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);
307
315
  };
308
- }, [I, m]), Object.assign({ ref: N }, h);
316
+ }, [S, b]), Object.assign({ ref: E }, _);
309
317
  }
310
- function Xe(e) {
311
- var n, t, r = "";
312
- if (typeof e == "string" || typeof e == "number") r += e;
318
+ function _t(e) {
319
+ var t, n, a = "";
320
+ if (typeof e == "string" || typeof e == "number") a += e;
313
321
  else if (typeof e == "object") if (Array.isArray(e)) {
314
- var a = e.length;
315
- for (n = 0; n < a; n++) e[n] && (t = Xe(e[n])) && (r && (r += " "), r += t);
316
- } else for (t in e) e[t] && (r && (r += " "), r += t);
317
- return r;
318
- }
319
- function R() {
320
- for (var e, n, t = 0, r = "", a = arguments.length; t < a; t++) (e = arguments[t]) && (n = Xe(e)) && (r && (r += " "), r += n);
321
- return r;
322
- }
323
- const On = "_headerContainer_1cubo_1", An = "_navigationTabList_1cubo_8", qn = "_navigationTab_1cubo_8", Bn = "_headerContent_1cubo_34", Mn = "_staticEnabled_1cubo_50", C = {
324
- headerContainer: On,
325
- navigationTabList: An,
326
- navigationTab: qn,
327
- headerContent: Bn,
328
- staticEnabled: Mn
329
- }, $n = 77, M = ({ sticky: e, children: n }) => {
330
- const { ref: t, height: r } = kn({
322
+ var o = e.length;
323
+ for (t = 0; t < o; t++) e[t] && (n = _t(e[t])) && (a && (a += " "), a += n);
324
+ } else for (n in e) e[n] && (a && (a += " "), a += n);
325
+ return a;
326
+ }
327
+ function j() {
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
+ return a;
330
+ }
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({
331
339
  refreshMode: "debounce",
332
340
  refreshRate: 0
333
- }), [a, o] = Ue(!1), s = () => a ? !e : !0;
334
- ie(() => {
335
- const u = () => {
336
- o(window.scrollY > 0);
341
+ }), [o, s] = ge(!1), c = () => o ? !e : !0;
342
+ M(() => {
343
+ const d = () => {
344
+ s(window.scrollY > 0);
337
345
  };
338
- return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
346
+ return window.addEventListener("scroll", d), () => window.removeEventListener("scroll", d);
339
347
  }, []);
340
- const l = `${r || $n}px`;
341
- return /* @__PURE__ */ i("div", { style: { minHeight: l }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ b(
348
+ const u = `${a || ln}px`;
349
+ return /* @__PURE__ */ i("div", { style: { minHeight: u }, children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ p(
342
350
  "div",
343
351
  {
344
- ref: t,
345
- className: R(C.headerContent, {
346
- [C.staticEnabled]: s()
352
+ ref: n,
353
+ className: j(A.headerContent, {
354
+ [A.staticEnabled]: c()
347
355
  }),
348
356
  children: [
349
- /* @__PURE__ */ i(M.Header, {}),
350
- /* @__PURE__ */ i(M.Tabs, {}),
351
- n
357
+ /* @__PURE__ */ i(z.Header, {}),
358
+ /* @__PURE__ */ i(z.Tabs, {}),
359
+ t
352
360
  ]
353
361
  }
354
362
  ) }) });
355
363
  };
356
- M.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: C.headerContainer, children: e });
357
- M.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
358
- const Un = "_sidebarContainer_bmdti_1", Dn = {
359
- sidebarContainer: Un
360
- }, zn = "_logoLink_1baxb_1", Fn = {
361
- logoLink: zn
362
- }, Wn = ({ src: e, href: n = "/", ariaLabel: t = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ i("a", { className: Fn.logoLink, href: n, "aria-label": t, children: /* @__PURE__ */ i("img", { src: e, alt: r }) }), Hn = "_link_1weq1_1", Gn = "_active_1weq1_18", Re = {
363
- link: Hn,
364
- active: Gn
365
- }, Vn = ({ label: e, to: n, icon: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
366
- ze,
364
+ z.Header = ({ children: e }) => /* @__PURE__ */ i("div", { className: A.headerContainer, children: e });
365
+ z.Tabs = ({ children: e }) => /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 nowrap", children: e });
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,
367
375
  {
368
- className: R(Re.link, {
369
- [Re.active]: window.location.pathname.startsWith(n)
376
+ className: j(Je.link, {
377
+ [Je.active]: window.location.pathname.startsWith(t)
370
378
  }),
371
- href: n,
372
- children: /* @__PURE__ */ i(t, { size: "25px" })
379
+ href: t,
380
+ children: /* @__PURE__ */ i(n, { size: "25px" })
373
381
  }
374
- ) }), Yn = "_dropdownButton_hwh0c_1", Zn = "_dropdownButtonActive_hwh0c_18", xe = {
375
- dropdownButton: Yn,
376
- dropdownButtonActive: Zn
377
- }, Xn = ({ children: e, icon: n }) => /* @__PURE__ */ i(
378
- oe,
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
+ pe,
379
387
  {
380
- menuButton: ({ opened: t }) => /* @__PURE__ */ i(ae, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
388
+ menuButton: ({ opened: n }) => /* @__PURE__ */ i(he, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
381
389
  "button",
382
390
  {
383
391
  type: "button",
384
- className: R(xe.dropdownButton, {
385
- [xe.dropdownButtonActive]: t
392
+ className: j(Ke.dropdownButton, {
393
+ [Ke.dropdownButtonActive]: n
386
394
  }),
387
- children: /* @__PURE__ */ i(n, { size: "25px" })
395
+ children: /* @__PURE__ */ i(t, { size: "25px" })
388
396
  }
389
397
  ) }),
390
- children: /* @__PURE__ */ i(se, { placement: "right-start", children: e })
398
+ children: /* @__PURE__ */ i(ve, { placement: "right-start", children: e })
391
399
  }
392
- ), Jn = "_iconContainer_nz34m_1", Kn = {
393
- iconContainer: Jn
394
- }, Je = ({ className: e = "" }) => /* @__PURE__ */ i(
400
+ ), yn = "_iconContainer_nz34m_1", wn = {
401
+ iconContainer: yn
402
+ }, gt = ({ className: e = "" }) => /* @__PURE__ */ i(
395
403
  "div",
396
404
  {
397
405
  "aria-label": "Upgrade Icon",
398
- className: R(
399
- Kn.iconContainer,
406
+ className: j(
407
+ wn.iconContainer,
400
408
  "flex-row",
401
409
  "items-center",
402
410
  "justify-center",
403
411
  e
404
412
  ),
405
- children: /* @__PURE__ */ i(dn, {})
413
+ children: /* @__PURE__ */ i(Ot, {})
406
414
  }
407
- ), Qn = "_menuContainer_wbu3u_5", et = "_profileButton_wbu3u_16", nt = "_profileImage_wbu3u_29", tt = "_profileImageHighlight_wbu3u_37", rt = "_profileImageUpgradeIcon_wbu3u_41", it = "_userIconWrapper_wbu3u_47", P = {
408
- menuContainer: Qn,
409
- profileButton: et,
410
- profileImage: nt,
411
- profileImageHighlight: tt,
412
- profileImageUpgradeIcon: rt,
413
- userIconWrapper: it
414
- }, Ke = cn({}), O = () => sn(Ke), at = ({ 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 }) => {
415
423
  const {
416
- currentTeam: n,
417
- otherTeams: t,
418
- showUpgradeCta: r,
419
- showBillingButton: a,
420
- allowTeamCreation: o,
421
- isProviderAlpha: s,
422
- canAccessTeamSettings: l,
423
- isEndOfTrialActive: u,
424
- isTeamSuspended: c,
425
- isFullyAuthenticated: d
426
- } = O();
424
+ currentTeam: t,
425
+ otherTeams: n,
426
+ showUpgradeCta: a,
427
+ showBillingButton: o,
428
+ allowTeamCreation: s,
429
+ isProviderAlpha: c,
430
+ canAccessTeamSettings: u,
431
+ isEndOfTrialActive: d,
432
+ isTeamSuspended: l,
433
+ isFullyAuthenticated: m
434
+ } = U();
427
435
  return /* @__PURE__ */ i(
428
- oe,
436
+ pe,
429
437
  {
430
- menuButton: () => /* @__PURE__ */ b("button", { className: P.profileButton, "aria-label": "Profile menu", type: "button", children: [
431
- n != null && n.logoUrl ? /* @__PURE__ */ i(
438
+ menuButton: () => /* @__PURE__ */ p("button", { className: N.profileButton, "aria-label": "Profile menu", type: "button", children: [
439
+ t != null && t.logoUrl ? /* @__PURE__ */ i(
432
440
  "img",
433
441
  {
434
- src: n.logoUrl,
435
- className: R(P.profileImage, {
436
- [P.profileImageHighlight]: r
442
+ src: t.logoUrl,
443
+ className: j(N.profileImage, {
444
+ [N.profileImageHighlight]: a
437
445
  }),
438
446
  alt: "Team Logo"
439
447
  }
440
448
  ) : /* @__PURE__ */ i(
441
449
  "div",
442
450
  {
443
- className: R(P.userIconWrapper, "flex-row", "align-center", "items-center", {
444
- [P.profileImageHighlight]: r
451
+ className: j(N.userIconWrapper, "flex-row", "align-center", "items-center", {
452
+ [N.profileImageHighlight]: a
445
453
  }),
446
- children: /* @__PURE__ */ i(Fe, { size: "25px" })
454
+ children: /* @__PURE__ */ i(st, { size: "25px" })
447
455
  }
448
456
  ),
449
- r && /* @__PURE__ */ i(Je, { className: P.profileImageUpgradeIcon })
457
+ a && /* @__PURE__ */ i(gt, { className: N.profileImageUpgradeIcon })
450
458
  ] }),
451
- children: /* @__PURE__ */ i(se, { placement: "right-end", className: P.menuContainer, children: e({
452
- allowTeamCreation: o,
453
- otherTeams: t,
454
- canAccessTeamSettings: l,
455
- isEndOfTrialActive: u,
456
- isTeamSuspended: c,
457
- showBillingButton: a,
458
- isProviderAlpha: s,
459
- isFullyAuthenticated: d
459
+ children: /* @__PURE__ */ i(ve, { placement: "right-end", className: N.menuContainer, children: e({
460
+ allowTeamCreation: s,
461
+ otherTeams: n,
462
+ canAccessTeamSettings: u,
463
+ isEndOfTrialActive: d,
464
+ isTeamSuspended: l,
465
+ showBillingButton: o,
466
+ isProviderAlpha: c,
467
+ isFullyAuthenticated: m
460
468
  }) })
461
469
  }
462
470
  );
463
- }, Qe = 0, ot = 9999, st = [150, 151, 250, 251], ct = [152, 153, 252, 253], lt = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], ut = [156, 159, 160, 256, 259, 260], en = 9998, le = (e) => e === Qe, nn = (e) => e === ot, Jt = (e) => st.includes(e), Kt = (e) => ct.includes(e), Qt = (e) => lt.includes(e), er = (e) => ut.includes(e), nr = (e) => e > Qe && e < en, tr = (e) => e === en, dt = /\n/, Ce = (e, n, t) => e.split(n).flatMap((r, a) => a !== 0 ? [ln(t, { key: Math.random().toString(32).slice(0, 10) }), r] : r), ft = (e, n, t) => typeof e == "string" ? Ce(e, n, t) : e.flatMap((r) => typeof r == "string" ? Ce(r, n, t) : r), rr = (e) => ft(e, dt, /* @__PURE__ */ i("br", {})), mt = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, ht = (e) => e.match(mt) ?? [], Le = (e, n, t) => {
464
- const r = e.split(n);
465
- if (r.length === 1)
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
+ const a = e.split(t);
473
+ if (a.length === 1)
466
474
  return e;
467
- const a = [];
468
- return r[0] !== "" && a.push(r[0]), r.shift(), r[r.length - 1] === "" && r.pop(), a.push(
469
- /* @__PURE__ */ i("a", { href: n, target: "_blank", rel: "noreferrer noopener", children: n }, n + t)
470
- ), a.push(r.join(n)), a.filter((o) => o !== "");
471
- }, ke = (e) => {
472
- const n = ht(e);
473
- return n != null && n.length ? n.reduce((t, r, a) => typeof t == "string" ? Le(t, r, a) : t.flatMap((o) => typeof o == "string" ? Le(o, r, a) : o), e) : e;
474
- }, ir = (e) => typeof e == "string" ? ke(e) : e.flatMap((n) => typeof n == "string" ? ke(n) : n, e), ar = (e, n = "PP") => He(e, n), or = (e, n, t = "PP") => He(mn(e, n), t), sr = (e) => {
475
- ie(e, []);
476
- }, Oe = {
475
+ const o = [];
476
+ return a[0] !== "" && o.push(a[0]), a.shift(), a[a.length - 1] === "" && a.pop(), o.push(
477
+ /* @__PURE__ */ i("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
478
+ ), o.push(a.join(t)), o.filter((s) => s !== "");
479
+ }, Ye = (e) => {
480
+ const t = Un(e);
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
+ }, 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 = {
477
485
  biller: "biller",
478
486
  owner: "owner"
479
- }, Ae = [
480
- Oe.biller,
481
- Oe.owner
482
- ], gt = ({ children: e, config: n }) => {
483
- const { teams: t, currentTeamId: r, planId: a, isEndOfTrialActive: o, isFullyAuthenticated: s, userTeamRole: l } = n, u = t.find((I) => I.id === r), c = t.filter((I) => I.id !== r), d = Ae.includes(l), h = Ae.includes(l), T = le(a) || nn(a), w = {
484
- ...n,
485
- currentTeam: u,
486
- otherTeams: c,
487
- canChangeBilling: d,
488
- canAccessTeamSettings: h,
489
- isOnFreeOrTrialPlan: T,
490
- showUpgradeCta: s && T && d,
491
- showBillingButton: s && h && d,
492
- allowTeamCreation: s && !o
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 = {
492
+ ...t,
493
+ currentTeam: d,
494
+ otherTeams: l,
495
+ canChangeBilling: m,
496
+ canAccessTeamSettings: _,
497
+ isOnFreeOrTrialPlan: y,
498
+ showUpgradeCta: c && y && m,
499
+ showBillingButton: c && _ && m,
500
+ allowTeamCreation: c && !s
493
501
  };
494
- return /* @__PURE__ */ i(Ke.Provider, { value: w, children: e });
495
- }, pt = ({ config: e, children: n }) => /* @__PURE__ */ i(gt, { config: e, children: /* @__PURE__ */ i(at, { children: n }) }), bt = "_container_q5pot_1", _t = "_profileEmail_q5pot_5", qe = {
496
- container: bt,
497
- profileEmail: _t
498
- }, vt = ({
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 = ({
499
507
  href: e,
500
- onClick: n,
501
- userEmail: t,
502
- hideBottomDivider: r
508
+ onClick: t,
509
+ userEmail: n,
510
+ hideBottomDivider: a
503
511
  }) => {
504
- const { isEndOfTrialActive: a, isTeamSuspended: o } = O();
505
- return a || o ? null : /* @__PURE__ */ b($e, { children: [
512
+ const { isEndOfTrialActive: o, isTeamSuspended: s } = U();
513
+ return o || s ? null : /* @__PURE__ */ p(rt, { children: [
506
514
  /* @__PURE__ */ i(
507
- $,
515
+ J,
508
516
  {
509
517
  href: e,
510
518
  onClick: () => {
511
- n == null || n();
519
+ t == null || t();
512
520
  },
513
- children: /* @__PURE__ */ b("div", { className: `flex-col ${qe.container}`, children: [
521
+ children: /* @__PURE__ */ p("div", { className: `flex-col ${Xe.container}`, children: [
514
522
  /* @__PURE__ */ i("span", { children: "Profile Settings" }),
515
- /* @__PURE__ */ i("span", { className: qe.profileEmail, children: t })
523
+ /* @__PURE__ */ i("span", { className: Xe.profileEmail, children: n })
516
524
  ] })
517
525
  }
518
526
  ),
519
- !r && /* @__PURE__ */ i(We, {})
527
+ !a && /* @__PURE__ */ i(ct, {})
520
528
  ] });
521
- }, Tt = "_wrapper_15d85_1", wt = "_profileImage_15d85_14", It = "_teamName_15d85_22", yt = "_planLabel_15d85_29", Nt = "_membership_15d85_38", St = "_defaultProfileImage_15d85_44", x = {
522
- wrapper: Tt,
523
- profileImage: wt,
524
- teamName: It,
525
- planLabel: yt,
526
- membership: Nt,
527
- defaultProfileImage: St
528
- }, tn = ({ team: e, onClick: n, hidePlanLabel: t }) => {
529
- const { currentTeam: r, planId: a } = O(), o = e || r;
530
- if (!o)
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 = {
530
+ wrapper: Fn,
531
+ profileImage: Gn,
532
+ teamName: Jn,
533
+ planLabel: Kn,
534
+ membership: Wn,
535
+ defaultProfileImage: Qn
536
+ }, yt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
537
+ const { currentTeam: a, planId: o } = U(), s = e || a;
538
+ if (!s)
531
539
  return null;
532
- const s = le(a) ? "Free" : nn(a) ? "Trial" : void 0;
533
- return /* @__PURE__ */ b(
534
- n ? $ : "div",
540
+ const c = ye(o) ? "Free" : Tt(o) ? "Trial" : void 0;
541
+ return /* @__PURE__ */ p(
542
+ t ? J : "div",
535
543
  {
536
- className: `flex-row gap-2 flex-nowrap items-center ${x.wrapper}`,
537
- ...n && { onClick: () => n(o) },
544
+ className: `flex-row gap-2 flex-nowrap items-center ${P.wrapper}`,
545
+ ...t && { onClick: () => t(s) },
538
546
  children: [
539
- o.logoUrl ? /* @__PURE__ */ i("img", { className: x.profileImage, src: o.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.defaultProfileImage}`, children: /* @__PURE__ */ i(Fe, { size: "25px" }) }),
540
- /* @__PURE__ */ b("div", { className: "flex-col items-start", children: [
541
- /* @__PURE__ */ b("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
542
- /* @__PURE__ */ i("span", { title: o.name, className: x.teamName, children: o.name }),
543
- s && !t && /* @__PURE__ */ i("span", { className: `flex-row justify-center items-center ${x.planLabel}`, children: s })
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" }) }),
548
+ /* @__PURE__ */ p("div", { className: "flex-col items-start", children: [
549
+ /* @__PURE__ */ p("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
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 })
544
552
  ] }),
545
- /* @__PURE__ */ i("span", { className: x.membership, children: o.role })
553
+ /* @__PURE__ */ i("span", { className: P.membership, children: s.role })
546
554
  ] })
547
555
  ]
548
556
  }
549
557
  );
550
- }, Et = "_teamsContainer_1t68g_1", Pt = {
551
- teamsContainer: Et
552
- }, jt = ({ onSwitchTeam: e }) => {
553
- const { otherTeams: n } = O();
554
- return n.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${Pt.teamsContainer}`, children: n.map((t) => /* @__PURE__ */ i(tn, { team: t, onClick: e, hidePlanLabel: !0 }, t.id)) });
555
- }, Rt = "_container_1u995_1", xt = "_planCta_1u995_15", Ct = "_upgradeIconWrapper_1u995_19", te = {
556
- container: Rt,
557
- planCta: xt,
558
- upgradeIconWrapper: Ct
559
- }, Lt = ({ upgradeOptionHref: e }) => {
560
- const { planId: n, trialDaysLeft: t, showUpgradeCta: r } = O();
561
- if (!r)
558
+ }, Yn = "_teamsContainer_1t68g_1", Vn = {
559
+ teamsContainer: Yn
560
+ }, Zn = ({ onSwitchTeam: e }) => {
561
+ const { otherTeams: t } = U();
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 }) => {
568
+ const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = U();
569
+ if (!a)
562
570
  return null;
563
- const s = le(n) ? "Your team is currently on the Free plan" : `Free trial ends in ${t} ${t === 1 ? "day" : "days"}`;
564
- return /* @__PURE__ */ b($, { href: e, className: `flex-col gap-1 items-start ${te.container}`, children: [
565
- /* @__PURE__ */ i("span", { className: te.planCta, children: s }),
566
- /* @__PURE__ */ b("div", { className: `flex-row items-center gap-1 ${te.upgradeIconWrapper}`, children: [
567
- /* @__PURE__ */ i(Je, {}),
571
+ const c = ye(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
572
+ return /* @__PURE__ */ p(J, { href: e, className: `flex-col gap-1 items-start ${fe.container}`, children: [
573
+ /* @__PURE__ */ i("span", { className: fe.planCta, children: c }),
574
+ /* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${fe.upgradeIconWrapper}`, children: [
575
+ /* @__PURE__ */ i(gt, {}),
568
576
  /* @__PURE__ */ i("span", { children: "See upgrade options" })
569
577
  ] })
570
578
  ] });
571
- }, y = ({ children: e, ...n }) => /* @__PURE__ */ i("nav", { ...n, className: Dn.sidebarContainer, children: e }), kt = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
572
- y.Top = kt;
573
- const Ot = ({ children: e }) => /* @__PURE__ */ i("div", { children: e });
574
- y.Bottom = Ot;
575
- y.Avatar = Wn;
576
- y.IconLink = Vn;
577
- y.Menu = Xn;
578
- y.ProfileMenu = pt;
579
- y.TeamSwitch = jt;
580
- y.TeamMenuItem = tn;
581
- y.UpgradeMenuItem = Lt;
582
- y.ProfileSettingsMenuItem = vt;
583
- const At = "_breadcrumbsItem_1hm6a_1", qt = "_breadcrumbs_1hm6a_1", Be = {
584
- breadcrumbsItem: At,
585
- breadcrumbs: qt
586
- }, cr = ({ items: e }) => /* @__PURE__ */ i("nav", { "aria-label": "breadcrumb", className: Be.breadcrumbs, children: e.map((n, t) => /* @__PURE__ */ b(De, { children: [
587
- /* @__PURE__ */ i(ze, { className: Be.breadcrumbsItem, href: n.link, rel: "noreferrer", children: n.name }),
588
- t < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
589
- ] }, `${n.link}-${n.name}`)) }), Bt = ({ items: e }) => /* @__PURE__ */ i($e, { children: e.map((n, t) => /* @__PURE__ */ b(De, { children: [
590
- !!t && n.some((r) => r.visible) && /* @__PURE__ */ i(We, {}),
591
- n.filter(({ visible: r }) => r).map(({ link: r, label: a, onClick: o }) => /* @__PURE__ */ i($, { href: r || "#", "aria-label": a, onClick: o, children: a }, a))
592
- ] }, n[0].label)) }), Mt = "_badge_1pc1v_1", $t = "_tag_1pc1v_15", Ut = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", Dt = "_disabled_1pc1v_57", zt = "_projectNavigationItem_1pc1v_61", Ft = "_projectNavigationItemDisabled_1pc1v_67", j = {
593
- badge: Mt,
594
- tag: $t,
595
- withNavLinkStyle: Ut,
596
- disabled: Dt,
597
- projectNavigationItem: zt,
598
- projectNavigationItemDisabled: Ft
599
- }, Me = ({ label: e, badge: n, novel: t }) => /* @__PURE__ */ b("div", { className: "flex gap-1", children: [
600
- /* @__PURE__ */ b("div", { children: [
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
+ n < e.length - 1 && /* @__PURE__ */ i("span", { 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
+ /* @__PURE__ */ p("div", { children: [
601
609
  /* @__PURE__ */ i("span", { children: e }),
602
- !!n && /* @__PURE__ */ i("div", { className: j.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
610
+ !!t && /* @__PURE__ */ i("div", { className: R.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
603
611
  ] }),
604
- !!t && /* @__PURE__ */ i(fn, { className: j.tag, children: t })
605
- ] }), re = un(
606
- ({ label: e, href: n = "", disabled: t = !1, badge: r, onClick: a, novel: o }, s) => /* @__PURE__ */ i(ae, { tooltip: "You do not have access to this function", show: t, children: /* @__PURE__ */ i(
612
+ !!n && /* @__PURE__ */ i(Lt, { className: R.tag, children: n })
613
+ ] }), be = At(
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(
607
615
  "div",
608
616
  {
609
- className: t ? j.projectNavigationItemDisabled : j.projectNavigationItem,
610
- children: a || t || !n ? /* @__PURE__ */ i(
617
+ className: n ? R.projectNavigationItemDisabled : R.projectNavigationItem,
618
+ children: o || n || !t ? /* @__PURE__ */ i(
611
619
  "button",
612
620
  {
613
621
  type: "button",
614
- ref: s,
615
- className: R(j.withNavLinkStyle, {
616
- [j.disabled]: t
622
+ ref: c,
623
+ className: j(R.withNavLinkStyle, {
624
+ [R.disabled]: n
617
625
  }),
618
- disabled: t,
619
- onClick: a,
620
- children: /* @__PURE__ */ i(Me, { label: e, badge: r, novel: o })
626
+ disabled: n,
627
+ onClick: o,
628
+ children: /* @__PURE__ */ i(tt, { label: e, badge: a, novel: s })
621
629
  }
622
- ) : /* @__PURE__ */ i("a", { href: n, className: j.withNavLinkStyle, children: /* @__PURE__ */ i(Me, { label: e, badge: r, novel: o }) })
630
+ ) : /* @__PURE__ */ i("a", { href: t, className: R.withNavLinkStyle, children: /* @__PURE__ */ i(tt, { label: e, badge: a, novel: s }) })
623
631
  }
624
632
  ) })
625
633
  );
626
- re.displayName = "NavigationTabsItem";
627
- const Wt = (e) => (e == null ? void 0 : e.some((n) => n.some((t) => t.visible))) ?? !1, Ht = (e) => e.visible && (!e.dropdown || Wt(e.dropdown)), lr = ({ navigation: e, activeItem: n }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: C.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Ht).map((t) => {
628
- var r, a, o;
629
- return t.dropdown ? /* @__PURE__ */ i(
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
+ var a, o, s;
637
+ return n.dropdown ? /* @__PURE__ */ i(
630
638
  "li",
631
639
  {
632
- className: C.navigationTab,
633
- "data-testid": t.key,
634
- "aria-selected": (r = t.isActive) == null ? void 0 : r.call(t, n),
640
+ className: A.navigationTab,
641
+ "data-testid": n.key,
642
+ "aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
635
643
  children: /* @__PURE__ */ i(
636
- oe,
644
+ pe,
637
645
  {
638
- menuButton: ({ opened: s }) => /* @__PURE__ */ i(re, { label: t.label, disabled: t.disabled, active: s }),
639
- children: /* @__PURE__ */ i(se, { children: /* @__PURE__ */ i(Bt, { items: t.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 }) })
640
648
  }
641
649
  )
642
650
  },
643
- t.key
651
+ n.key
644
652
  ) : /* @__PURE__ */ i(
645
653
  "li",
646
654
  {
647
- className: C.navigationTab,
648
- "data-testid": t.key,
649
- "aria-selected": (a = t.isActive) == null ? void 0 : a.call(t, n),
655
+ className: A.navigationTab,
656
+ "data-testid": n.key,
657
+ "aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
650
658
  children: /* @__PURE__ */ i(
651
- re,
659
+ be,
652
660
  {
653
- label: t.label,
654
- href: t.link,
655
- onClick: t.onClick,
656
- disabled: t.disabled,
657
- badge: t.badge,
658
- novel: t.novel,
659
- active: (o = t.isActive) == null ? void 0 : o.call(t, n)
661
+ label: n.label,
662
+ href: n.link,
663
+ onClick: n.onClick,
664
+ disabled: n.disabled,
665
+ badge: n.badge,
666
+ novel: n.novel,
667
+ active: (s = n.isActive) == null ? void 0 : s.call(n, t)
660
668
  }
661
669
  )
662
670
  },
663
- t.key
671
+ n.key
664
672
  );
665
- }) }) });
673
+ }) }) }), gr = r.object({
674
+ accessToken: r.string(),
675
+ refreshToken: r.string()
676
+ }), hr = r.union([
677
+ r.object({ Authorization: r.string().startsWith("Bearer ") }),
678
+ r.object({ "x-csrf-token": r.string() })
679
+ ]), we = ut({
680
+ description: "Takes a teamId and returns a JWT token access and refresh token for the user",
681
+ method: "post",
682
+ requestPathParamsSchema: r.object({ teamId: r.number() }),
683
+ pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
684
+ requestHeaderSchema: hr,
685
+ requestBodySchema: r.undefined(),
686
+ successResponseBodySchema: gr
687
+ }), pr = {
688
+ teamKeyCsrf: (e, t) => ["getUserToken", "x-csrf-token", t, e],
689
+ teamKeyJwt: (e, t) => ["getUserToken", "Authorization", `Bearer ${t}`, e]
690
+ }, vr = (e, t) => x({
691
+ ...t,
692
+ queryFn: ({ queryKey: [n, a, o, s] }) => K(e, we, {
693
+ pathParams: { teamId: s },
694
+ headers: a === "x-csrf-token" ? { "x-csrf-token": o } : { Authorization: o }
695
+ })
696
+ }), wt = r.union([
697
+ r.literal("owner"),
698
+ r.literal("admin"),
699
+ r.literal("biller"),
700
+ r.literal("member")
701
+ ]), Tr = r.object({
702
+ userId: r.number(),
703
+ userUuid: r.string(),
704
+ teamId: r.number(),
705
+ userTeamRole: wt,
706
+ userEmail: r.string().email(),
707
+ userName: r.string(),
708
+ userCurrentTeamId: r.number(),
709
+ planId: r.number(),
710
+ planName: r.string(),
711
+ isProviderAlpha: r.boolean(),
712
+ isFullyAuthenticated: r.boolean(),
713
+ exp: r.number()
714
+ });
715
+ function Y(e) {
716
+ try {
717
+ const t = e.split(".")[1], n = atob(t);
718
+ return Tr.parse(JSON.parse(n));
719
+ } catch {
720
+ return;
721
+ }
722
+ }
723
+ const G = class G extends CustomEvent {
724
+ constructor(t) {
725
+ super(G.eventName, {
726
+ detail: { token: t, payload: Y(t.accessToken) }
727
+ });
728
+ }
729
+ };
730
+ Re(G, "eventName", "new-jwt-issued");
731
+ let O = G;
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 };
736
+ }
737
+ function St() {
738
+ return _e(document.cookie, "csrf_token");
739
+ }
740
+ function _e(e, t) {
741
+ var n, a;
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);
743
+ }
744
+ function ha(e, t) {
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;
752
+ }
753
+ function It() {
754
+ const [e, t] = ge();
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);
761
+ };
762
+ }, []), e;
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
+ });
785
+ function pa(e) {
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
790
+ });
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
+ });
823
+ function va(e, t) {
824
+ const n = It();
825
+ return Pr(e, {
826
+ queryKey: jr.projectUserKey(t, (n == null ? void 0 : n.userId) ?? 0),
827
+ enabled: n !== void 0
828
+ });
829
+ }
830
+ function Ta() {
831
+ const e = Se();
832
+ if (!e)
833
+ return;
834
+ const t = Y(e.accessToken);
835
+ if (t)
836
+ return { ...e, payload: t };
837
+ }
838
+ function ya() {
839
+ return (e) => (t, n) => e(t, {
840
+ ...n,
841
+ headers: {
842
+ ...n.headers,
843
+ "x-lokalise-plugin": "true"
844
+ },
845
+ credentials: "omit"
846
+ });
847
+ }
848
+ function D(e) {
849
+ return { Authorization: `Bearer ${e}` };
850
+ }
851
+ function Ar(e, t) {
852
+ return (n) => async (a, o) => {
853
+ var u;
854
+ const s = await t.getCachedJwtToken();
855
+ if (s === void 0)
856
+ return n(a, o);
857
+ const c = await n(a, {
858
+ ...o,
859
+ headers: { ...o.headers, ...D(s.accessToken) }
860
+ });
861
+ if (s && (c.status === 401 || c.status === 403)) {
862
+ const d = Y(s.accessToken);
863
+ if (!d)
864
+ return c;
865
+ const l = await K(e, we, {
866
+ pathParams: { teamId: d.teamId },
867
+ headers: D(s.refreshToken)
868
+ });
869
+ return await ((u = t.onNewJwtTokenIssued) == null ? void 0 : u.call(t, l)), n(a, {
870
+ ...o,
871
+ headers: { ...o.headers, ...D(l.accessToken) }
872
+ });
873
+ }
874
+ return c;
875
+ };
876
+ }
877
+ const Or = {
878
+ wretch: {
879
+ lokaliseAuth(e) {
880
+ return this.middlewares([Ar(this, e)]);
881
+ }
882
+ }
883
+ };
884
+ function Lr(e, t) {
885
+ return (n) => async (a, o) => {
886
+ var d;
887
+ if (await t.getCachedJwtToken() !== void 0)
888
+ return n(a, o);
889
+ const c = await t.getCsrfToken();
890
+ if (c === void 0)
891
+ return n(a, o);
892
+ const u = await K(e, we, {
893
+ pathParams: { teamId: await t.getTeamId() },
894
+ headers: { "x-csrf-token": c }
895
+ });
896
+ return await ((d = t.onNewJwtTokenIssued) == null ? void 0 : d.call(t, u)), n(a, {
897
+ ...o,
898
+ headers: { ...o.headers, ...D(u.accessToken) }
899
+ });
900
+ };
901
+ }
902
+ const wa = {
903
+ wretch: {
904
+ lokaliseAuth(e = {}) {
905
+ return this.addon(Or).lokaliseAuth(nt(e));
906
+ },
907
+ promoteClassicSession(e) {
908
+ const t = nt(e);
909
+ return this.middlewares([Lr(this, t)]);
910
+ }
911
+ }
912
+ };
913
+ function nt(e) {
914
+ return {
915
+ ...e,
916
+ getCachedJwtToken: e.getCachedJwtToken ?? (async () => Se()),
917
+ getCsrfToken: "getCsrfToken" in e ? e.getCsrfToken : async () => St(),
918
+ onNewJwtTokenIssued: (t) => {
919
+ var n;
920
+ return window.dispatchEvent(new O(t)), ((n = e.onNewJwtTokenIssued) == null ? void 0 : n.call(e, t)) ?? Promise.resolve();
921
+ }
922
+ };
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
+ }
666
1056
  export {
667
- cr as Breadcrumbs,
668
- en as ENTERPRISE_OPENSOURCE_PLAN_ID,
669
- ut as ENTERPRISE_PLAN_IDS,
670
- ct as ESSENTIAL_PLAN_IDS,
671
- Qe as FREE_PLAN_ID,
672
- M as NavigationPanel,
673
- lr as NavigationTabs,
674
- lt as PRO_PLAN_IDS,
675
- st as START_PLAN_IDS,
676
- y as Sidebar,
677
- ot as TRIAL_PLAN_ID,
678
- rr as convertNewLineToBreakTag,
679
- ar as formatDate,
680
- or as formatDateTz,
681
- tr as isEnterpriseOpenSourcePlan,
682
- er as isEnterprisePlan,
683
- Kt as isEssentialPlan,
684
- le as isFreePlan,
685
- nr as isPaidPlan,
686
- Qt as isProPlan,
687
- Jt as isStartPlan,
688
- nn as isTrialPlan,
689
- ir as makeUrlClickable,
690
- sr as useEffectOnce
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,
1063
+ wa as LokaliseAuthBrowserAddon,
1064
+ z as NavigationPanel,
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,
1074
+ Ta as getAuthenticatedSessionDetailFromRequest,
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,
1082
+ ye as isFreePlan,
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,
1090
+ Y as parseJwtTokenPayload,
1091
+ ya as publicApiHeadersMiddleware,
1092
+ Rr as retrieveContributor,
1093
+ jr as retrieveContributorKeys,
1094
+ Jr as retrieveProject,
1095
+ ka as retrieveProjectQueryKey,
1096
+ va as useAuthenticatedProjectContributor,
1097
+ It as useAuthenticatedSessionPayload,
1098
+ pa as useAuthenticatedUser,
1099
+ Sa as useCreateProjectMutation,
1100
+ ba as useEffectOnce,
1101
+ ha as useGetPromotedClassicSessionJwtQuery,
1102
+ Er as useGetTeamUsersQuery,
1103
+ vr as useGetUserTokenQuery,
1104
+ Ea as useListProjectsQuery,
1105
+ Pr as useRetrieveContributorQuery,
1106
+ Ca as useRetrieveProjectQuery
691
1107
  };