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