@lokalise/harmony 1.15.1 → 1.17.0-exp-jwtheaderfactorysharedauth.1
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/README.md +31 -21
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +1470 -847
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +6 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +7 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +5 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +10 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +2 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +86 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +16 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +24 -0
- package/dist/types/src/features/auth/core/headers/headerBuilder.d.ts +199 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthHeaderBuilderMiddleware.d.ts +10 -0
- package/dist/types/src/features/auth/core/middleware/publicApiHeaderBuilderMiddleware.d.ts +3 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +2 -2
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +3 -3
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -2
- package/dist/types/src/features/auth/errors/UnauthorizedError.d.ts +4 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +4 -1
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +1 -1
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +4 -1
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +4 -2
- package/dist/types/src/features/auth/frontend/services/generateTokenFromClassicSession.d.ts +5 -0
- package/dist/types/src/features/auth/frontend/services/refreshExpiredToken.d.ts +6 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +2 -2
- package/dist/types/src/features/auth/node.d.ts +6 -4
- package/dist/types/src/features/publicApi/contributors.d.ts +19 -1
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +6 -5
- package/dist/types/src/features/publicApi/hooks/useListProjectLanguagesQuery.d.ts +10 -1
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useUpdateProjectMutation.d.ts +4 -2
- package/dist/types/src/features/publicApi/languages.d.ts +19 -1
- package/dist/types/src/features/publicApi/node.d.ts +1 -1
- package/dist/types/src/features/publicApi/projects.d.ts +76 -4
- package/dist/types/src/features/publicApi/teamUsers.d.ts +22 -4
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/sharedTypes.d.ts +57 -0
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +2 -2
- package/dist/types/src/features/publicApi/userToken.d.ts +1 -1
- package/dist/types/src/node.d.ts +1 -0
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +2 -0
- package/package.json +1 -1
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +0 -17
- package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +0 -5
- package/dist/types/src/features/auth/frontend/middleware/clientSideJwtAuthMiddleware.d.ts +0 -9
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +0 -14
- /package/dist/types/src/{features/auth/core/middleware/jwtAuthMiddleware.test.d.ts → components/Sidebar/Widgets/Tasks/Tasks.test.d.ts} +0 -0
- /package/dist/types/src/features/auth/{frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts → core/headers/headerBuilder.test.d.ts} +0 -0
package/dist/harmony.mjs
CHANGED
@@ -1,273 +1,287 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var
|
4
|
-
import { jsx as
|
5
|
-
import * as
|
6
|
-
import { useRef as
|
7
|
-
import { Tooltip as
|
8
|
-
import { format as
|
9
|
-
import { toZonedTime as
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import { useQuery as
|
14
|
-
import { buildGetRoute as
|
15
|
-
|
16
|
-
|
1
|
+
var Zt = Object.defineProperty;
|
2
|
+
var en = (e, t, n) => t in e ? Zt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
3
|
+
var ee = (e, t, n) => en(e, typeof t != "symbol" ? t + "" : t, n);
|
4
|
+
import { jsx as a, jsxs as h, Fragment as Ue } from "react/jsx-runtime";
|
5
|
+
import * as F from "react";
|
6
|
+
import { useRef as Et, useState as N, useCallback as We, useEffect as G, useContext as wt, createContext as Ct, cloneElement as tn, Fragment as kt, forwardRef as nn } from "react";
|
7
|
+
import { Tooltip as H, Link as L, Menu as ae, MenuList as se, CaretUpIcon as rn, UserIcon as Pt, MenuItem as K, MenuDivider as It, ConfirmModal as on, Alert as an, Tag as Re, Button as je, Loading as sn, Popover as cn, JobIcon as ln } from "@lokalise/louis";
|
8
|
+
import { format as At, parseISO as dn } from "date-fns";
|
9
|
+
import { toZonedTime as un } from "date-fns-tz";
|
10
|
+
import { z as o } from "zod";
|
11
|
+
import { buildPayloadRoute as qe } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
12
|
+
import { sendByPayloadRoute as W, sendByGetRoute as J } from "@lokalise/frontend-http-client";
|
13
|
+
import { useQuery as B, useMutation as Nt } from "@tanstack/react-query";
|
14
|
+
import { buildGetRoute as Q } from "@lokalise/universal-ts-utils/node";
|
15
|
+
const xe = {
|
16
|
+
Completed: "completed",
|
17
|
+
InProgress: "in_progress",
|
18
|
+
Created: "created",
|
19
|
+
Queued: "queued"
|
20
|
+
}, P = {
|
21
|
+
...xe,
|
22
|
+
NotStarted: "not_started"
|
23
|
+
}, te = {
|
24
|
+
translation: "translation",
|
25
|
+
review: "review",
|
26
|
+
lqa_by_ai: "lqa_by_ai",
|
27
|
+
automatic_translation: "automatic_translation"
|
28
|
+
};
|
29
|
+
var ne = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
30
|
+
function Rt(e) {
|
17
31
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
18
32
|
}
|
19
|
-
var
|
20
|
-
function
|
21
|
-
if (
|
22
|
-
|
33
|
+
var fe, Je;
|
34
|
+
function He() {
|
35
|
+
if (Je) return fe;
|
36
|
+
Je = 1;
|
23
37
|
function e(t) {
|
24
38
|
var n = typeof t;
|
25
39
|
return t != null && (n == "object" || n == "function");
|
26
40
|
}
|
27
|
-
return
|
41
|
+
return fe = e, fe;
|
28
42
|
}
|
29
|
-
var
|
30
|
-
function
|
31
|
-
if (
|
32
|
-
|
33
|
-
var e = typeof
|
34
|
-
return
|
43
|
+
var _e, Qe;
|
44
|
+
function mn() {
|
45
|
+
if (Qe) return _e;
|
46
|
+
Qe = 1;
|
47
|
+
var e = typeof ne == "object" && ne && ne.Object === Object && ne;
|
48
|
+
return _e = e, _e;
|
35
49
|
}
|
36
|
-
var
|
37
|
-
function
|
38
|
-
if (
|
39
|
-
|
40
|
-
var e =
|
41
|
-
return
|
50
|
+
var ge, Ye;
|
51
|
+
function jt() {
|
52
|
+
if (Ye) return ge;
|
53
|
+
Ye = 1;
|
54
|
+
var e = mn(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
55
|
+
return ge = n, ge;
|
42
56
|
}
|
43
|
-
var
|
44
|
-
function
|
45
|
-
if (
|
46
|
-
|
47
|
-
var e =
|
57
|
+
var he, Ve;
|
58
|
+
function fn() {
|
59
|
+
if (Ve) return he;
|
60
|
+
Ve = 1;
|
61
|
+
var e = jt(), t = function() {
|
48
62
|
return e.Date.now();
|
49
63
|
};
|
50
|
-
return
|
64
|
+
return he = t, he;
|
51
65
|
}
|
52
|
-
var
|
53
|
-
function
|
54
|
-
if (
|
55
|
-
|
66
|
+
var pe, Xe;
|
67
|
+
function _n() {
|
68
|
+
if (Xe) return pe;
|
69
|
+
Xe = 1;
|
56
70
|
var e = /\s/;
|
57
71
|
function t(n) {
|
58
|
-
for (var
|
72
|
+
for (var r = n.length; r-- && e.test(n.charAt(r)); )
|
59
73
|
;
|
60
|
-
return
|
74
|
+
return r;
|
61
75
|
}
|
62
|
-
return
|
76
|
+
return pe = t, pe;
|
63
77
|
}
|
64
|
-
var
|
65
|
-
function
|
66
|
-
if (
|
67
|
-
|
68
|
-
var e =
|
69
|
-
function n(
|
70
|
-
return
|
78
|
+
var be, Ze;
|
79
|
+
function gn() {
|
80
|
+
if (Ze) return be;
|
81
|
+
Ze = 1;
|
82
|
+
var e = _n(), t = /^\s+/;
|
83
|
+
function n(r) {
|
84
|
+
return r && r.slice(0, e(r) + 1).replace(t, "");
|
71
85
|
}
|
72
|
-
return
|
86
|
+
return be = n, be;
|
73
87
|
}
|
74
|
-
var
|
75
|
-
function
|
76
|
-
if (
|
77
|
-
|
78
|
-
var e =
|
79
|
-
return
|
88
|
+
var ve, et;
|
89
|
+
function xt() {
|
90
|
+
if (et) return ve;
|
91
|
+
et = 1;
|
92
|
+
var e = jt(), t = e.Symbol;
|
93
|
+
return ve = t, ve;
|
80
94
|
}
|
81
|
-
var
|
82
|
-
function
|
83
|
-
if (
|
84
|
-
|
85
|
-
var e =
|
86
|
-
function
|
87
|
-
var
|
95
|
+
var Te, tt;
|
96
|
+
function hn() {
|
97
|
+
if (tt) return Te;
|
98
|
+
tt = 1;
|
99
|
+
var e = xt(), t = Object.prototype, n = t.hasOwnProperty, r = t.toString, s = e ? e.toStringTag : void 0;
|
100
|
+
function i(c) {
|
101
|
+
var l = n.call(c, s), u = c[s];
|
88
102
|
try {
|
89
|
-
c[
|
90
|
-
var
|
103
|
+
c[s] = void 0;
|
104
|
+
var d = !0;
|
91
105
|
} catch {
|
92
106
|
}
|
93
|
-
var m =
|
94
|
-
return
|
107
|
+
var m = r.call(c);
|
108
|
+
return d && (l ? c[s] = u : delete c[s]), m;
|
95
109
|
}
|
96
|
-
return
|
110
|
+
return Te = i, Te;
|
97
111
|
}
|
98
|
-
var
|
99
|
-
function
|
100
|
-
if (
|
101
|
-
|
112
|
+
var ye, nt;
|
113
|
+
function pn() {
|
114
|
+
if (nt) return ye;
|
115
|
+
nt = 1;
|
102
116
|
var e = Object.prototype, t = e.toString;
|
103
|
-
function n(
|
104
|
-
return t.call(
|
117
|
+
function n(r) {
|
118
|
+
return t.call(r);
|
105
119
|
}
|
106
|
-
return
|
120
|
+
return ye = n, ye;
|
107
121
|
}
|
108
|
-
var
|
109
|
-
function
|
110
|
-
if (
|
111
|
-
|
112
|
-
var e =
|
113
|
-
function c(
|
114
|
-
return
|
122
|
+
var Se, rt;
|
123
|
+
function bn() {
|
124
|
+
if (rt) return Se;
|
125
|
+
rt = 1;
|
126
|
+
var e = xt(), t = hn(), n = pn(), r = "[object Null]", s = "[object Undefined]", i = e ? e.toStringTag : void 0;
|
127
|
+
function c(l) {
|
128
|
+
return l == null ? l === void 0 ? s : r : i && i in Object(l) ? t(l) : n(l);
|
115
129
|
}
|
116
|
-
return
|
130
|
+
return Se = c, Se;
|
117
131
|
}
|
118
|
-
var
|
119
|
-
function
|
120
|
-
if (
|
121
|
-
|
132
|
+
var Ee, ot;
|
133
|
+
function vn() {
|
134
|
+
if (ot) return Ee;
|
135
|
+
ot = 1;
|
122
136
|
function e(t) {
|
123
137
|
return t != null && typeof t == "object";
|
124
138
|
}
|
125
|
-
return
|
139
|
+
return Ee = e, Ee;
|
126
140
|
}
|
127
|
-
var
|
128
|
-
function
|
129
|
-
if (
|
130
|
-
|
131
|
-
var e =
|
132
|
-
function
|
133
|
-
return typeof
|
141
|
+
var we, at;
|
142
|
+
function Tn() {
|
143
|
+
if (at) return we;
|
144
|
+
at = 1;
|
145
|
+
var e = bn(), t = vn(), n = "[object Symbol]";
|
146
|
+
function r(s) {
|
147
|
+
return typeof s == "symbol" || t(s) && e(s) == n;
|
134
148
|
}
|
135
|
-
return
|
149
|
+
return we = r, we;
|
136
150
|
}
|
137
|
-
var
|
138
|
-
function
|
139
|
-
if (
|
140
|
-
|
141
|
-
var e =
|
142
|
-
function d
|
143
|
-
if (typeof
|
144
|
-
return
|
145
|
-
if (n(
|
146
|
-
return
|
147
|
-
if (t(
|
148
|
-
var m = typeof
|
149
|
-
|
151
|
+
var Ce, st;
|
152
|
+
function yn() {
|
153
|
+
if (st) return Ce;
|
154
|
+
st = 1;
|
155
|
+
var e = gn(), t = He(), n = Tn(), r = NaN, s = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, c = /^0o[0-7]+$/i, l = parseInt;
|
156
|
+
function u(d) {
|
157
|
+
if (typeof d == "number")
|
158
|
+
return d;
|
159
|
+
if (n(d))
|
160
|
+
return r;
|
161
|
+
if (t(d)) {
|
162
|
+
var m = typeof d.valueOf == "function" ? d.valueOf() : d;
|
163
|
+
d = t(m) ? m + "" : m;
|
150
164
|
}
|
151
|
-
if (typeof
|
152
|
-
return
|
153
|
-
|
154
|
-
var
|
155
|
-
return
|
165
|
+
if (typeof d != "string")
|
166
|
+
return d === 0 ? d : +d;
|
167
|
+
d = e(d);
|
168
|
+
var _ = i.test(d);
|
169
|
+
return _ || c.test(d) ? l(d.slice(2), _ ? 2 : 8) : s.test(d) ? r : +d;
|
156
170
|
}
|
157
|
-
return
|
171
|
+
return Ce = u, Ce;
|
158
172
|
}
|
159
|
-
var
|
160
|
-
function
|
161
|
-
if (
|
162
|
-
|
163
|
-
var e =
|
164
|
-
function c(u, d
|
165
|
-
var m,
|
166
|
-
if (typeof
|
167
|
-
throw new TypeError(
|
168
|
-
|
169
|
-
function
|
170
|
-
var
|
171
|
-
return m =
|
173
|
+
var ke, it;
|
174
|
+
function Ot() {
|
175
|
+
if (it) return ke;
|
176
|
+
it = 1;
|
177
|
+
var e = He(), t = fn(), n = yn(), r = "Expected a function", s = Math.max, i = Math.min;
|
178
|
+
function c(l, u, d) {
|
179
|
+
var m, _, T, y, f, E, b = 0, g = !1, p = !1, v = !0;
|
180
|
+
if (typeof l != "function")
|
181
|
+
throw new TypeError(r);
|
182
|
+
u = n(u) || 0, e(d) && (g = !!d.leading, p = "maxWait" in d, T = p ? s(n(d.maxWait) || 0, u) : T, v = "trailing" in d ? !!d.trailing : v);
|
183
|
+
function C(S) {
|
184
|
+
var j = m, D = _;
|
185
|
+
return m = _ = void 0, b = S, y = l.apply(D, j), y;
|
172
186
|
}
|
173
|
-
function
|
174
|
-
return
|
187
|
+
function w(S) {
|
188
|
+
return b = S, f = setTimeout(Z, u), g ? C(S) : y;
|
175
189
|
}
|
176
|
-
function
|
177
|
-
var
|
178
|
-
return
|
190
|
+
function X(S) {
|
191
|
+
var j = S - E, D = S - b, Ke = u - j;
|
192
|
+
return p ? i(Ke, T - D) : Ke;
|
179
193
|
}
|
180
|
-
function
|
181
|
-
var
|
182
|
-
return
|
194
|
+
function ze(S) {
|
195
|
+
var j = S - E, D = S - b;
|
196
|
+
return E === void 0 || j >= u || j < 0 || p && D >= T;
|
183
197
|
}
|
184
|
-
function
|
185
|
-
var
|
186
|
-
if (
|
187
|
-
return
|
188
|
-
|
198
|
+
function Z() {
|
199
|
+
var S = t();
|
200
|
+
if (ze(S))
|
201
|
+
return Ge(S);
|
202
|
+
f = setTimeout(Z, X(S));
|
189
203
|
}
|
190
|
-
function
|
191
|
-
return
|
204
|
+
function Ge(S) {
|
205
|
+
return f = void 0, v && m ? C(S) : (m = _ = void 0, y);
|
192
206
|
}
|
193
|
-
function
|
194
|
-
|
207
|
+
function Vt() {
|
208
|
+
f !== void 0 && clearTimeout(f), b = 0, m = E = _ = f = void 0;
|
195
209
|
}
|
196
|
-
function
|
197
|
-
return
|
210
|
+
function Xt() {
|
211
|
+
return f === void 0 ? y : Ge(t());
|
198
212
|
}
|
199
|
-
function
|
200
|
-
var
|
201
|
-
if (m = arguments,
|
202
|
-
if (
|
203
|
-
return
|
204
|
-
if (
|
205
|
-
return clearTimeout(
|
213
|
+
function me() {
|
214
|
+
var S = t(), j = ze(S);
|
215
|
+
if (m = arguments, _ = this, E = S, j) {
|
216
|
+
if (f === void 0)
|
217
|
+
return w(E);
|
218
|
+
if (p)
|
219
|
+
return clearTimeout(f), f = setTimeout(Z, u), C(E);
|
206
220
|
}
|
207
|
-
return
|
221
|
+
return f === void 0 && (f = setTimeout(Z, u)), y;
|
208
222
|
}
|
209
|
-
return
|
223
|
+
return me.cancel = Vt, me.flush = Xt, me;
|
210
224
|
}
|
211
|
-
return
|
225
|
+
return ke = c, ke;
|
212
226
|
}
|
213
|
-
var
|
214
|
-
const
|
215
|
-
var
|
216
|
-
function
|
217
|
-
if (
|
218
|
-
|
219
|
-
var e =
|
220
|
-
function
|
221
|
-
var
|
222
|
-
if (typeof
|
227
|
+
var Sn = Ot();
|
228
|
+
const En = /* @__PURE__ */ Rt(Sn);
|
229
|
+
var Pe, ct;
|
230
|
+
function wn() {
|
231
|
+
if (ct) return Pe;
|
232
|
+
ct = 1;
|
233
|
+
var e = Ot(), t = He(), n = "Expected a function";
|
234
|
+
function r(s, i, c) {
|
235
|
+
var l = !0, u = !0;
|
236
|
+
if (typeof s != "function")
|
223
237
|
throw new TypeError(n);
|
224
|
-
return t(c) && (
|
225
|
-
leading:
|
226
|
-
maxWait:
|
227
|
-
trailing:
|
238
|
+
return t(c) && (l = "leading" in c ? !!c.leading : l, u = "trailing" in c ? !!c.trailing : u), e(s, i, {
|
239
|
+
leading: l,
|
240
|
+
maxWait: i,
|
241
|
+
trailing: u
|
228
242
|
});
|
229
243
|
}
|
230
|
-
return
|
244
|
+
return Pe = r, Pe;
|
231
245
|
}
|
232
|
-
var
|
233
|
-
const
|
246
|
+
var Cn = wn();
|
247
|
+
const kn = /* @__PURE__ */ Rt(Cn), Pn = (e, t, n, r) => {
|
234
248
|
switch (t) {
|
235
249
|
case "debounce":
|
236
|
-
return
|
250
|
+
return En(e, n, r);
|
237
251
|
case "throttle":
|
238
|
-
return
|
252
|
+
return kn(e, n, r);
|
239
253
|
default:
|
240
254
|
return e;
|
241
255
|
}
|
242
|
-
},
|
256
|
+
}, In = (
|
243
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
244
258
|
(e) => {
|
245
|
-
const t =
|
246
|
-
return
|
259
|
+
const t = F.useRef(e);
|
260
|
+
return F.useEffect(() => {
|
247
261
|
t.current = e;
|
248
|
-
}),
|
249
|
-
var
|
250
|
-
return (
|
262
|
+
}), F.useMemo(() => (...n) => {
|
263
|
+
var r;
|
264
|
+
return (r = t.current) === null || r === void 0 ? void 0 : r.call(t, ...n);
|
251
265
|
}, []);
|
252
266
|
}
|
253
|
-
),
|
267
|
+
), An = (
|
254
268
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
255
269
|
(e) => {
|
256
|
-
const [t, n] =
|
270
|
+
const [t, n] = F.useState((e == null ? void 0 : e.current) || null);
|
257
271
|
return e && setTimeout(() => {
|
258
272
|
e.current !== t && n(e.current);
|
259
|
-
}, 0), { refProxy:
|
260
|
-
|
273
|
+
}, 0), { refProxy: F.useMemo(() => new Proxy((s) => {
|
274
|
+
s !== t && n(s);
|
261
275
|
}, {
|
262
|
-
get(
|
263
|
-
return
|
276
|
+
get(s, i) {
|
277
|
+
return i === "current" ? t : s[i];
|
264
278
|
},
|
265
|
-
set(
|
266
|
-
return
|
279
|
+
set(s, i, c) {
|
280
|
+
return i === "current" ? n(c) : s[i] = c, !0;
|
267
281
|
}
|
268
282
|
}), [t]), refElement: t, setRefElement: n };
|
269
283
|
}
|
270
|
-
),
|
284
|
+
), Nn = (e, t) => t === "border-box" ? {
|
271
285
|
width: e.borderBoxSize[0].inlineSize,
|
272
286
|
height: e.borderBoxSize[0].blockSize
|
273
287
|
} : t === "content-box" ? {
|
@@ -277,386 +291,839 @@ const Vt = /* @__PURE__ */ mt(Yt), Zt = (e, t, n, o) => {
|
|
277
291
|
width: e.contentRect.width,
|
278
292
|
height: e.contentRect.height
|
279
293
|
};
|
280
|
-
function
|
281
|
-
const
|
294
|
+
function Rn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: r, handleWidth: s = !0, handleHeight: i = !0, targetRef: c, observerOptions: l, onResize: u } = {}) {
|
295
|
+
const d = Et(e), m = In(u), [_, T] = N({
|
282
296
|
width: void 0,
|
283
297
|
height: void 0
|
284
|
-
}), { refProxy:
|
285
|
-
if (!
|
298
|
+
}), { refProxy: y, refElement: f } = An(c), { box: E } = l || {}, b = We((p) => {
|
299
|
+
if (!s && !i)
|
286
300
|
return;
|
287
|
-
if (
|
288
|
-
|
301
|
+
if (d.current) {
|
302
|
+
d.current = !1;
|
289
303
|
return;
|
290
304
|
}
|
291
|
-
const
|
292
|
-
|
293
|
-
const
|
294
|
-
|
295
|
-
width:
|
296
|
-
height:
|
297
|
-
entry:
|
298
|
-
}),
|
305
|
+
const v = (C, w) => s && C.width !== w.width || i && C.height !== w.height;
|
306
|
+
p.forEach((C) => {
|
307
|
+
const w = Nn(C, E);
|
308
|
+
T((X) => v(X, w) ? (m == null || m({
|
309
|
+
width: w.width,
|
310
|
+
height: w.height,
|
311
|
+
entry: C
|
312
|
+
}), w) : X);
|
299
313
|
});
|
300
|
-
}, [
|
301
|
-
|
314
|
+
}, [s, i, d, E]), g = We(Pn(b, t, n, r), [
|
315
|
+
b,
|
302
316
|
t,
|
303
317
|
n,
|
304
|
-
|
318
|
+
r
|
305
319
|
]);
|
306
|
-
return
|
307
|
-
let
|
308
|
-
return
|
320
|
+
return G(() => {
|
321
|
+
let p;
|
322
|
+
return f ? (p = new window.ResizeObserver(g), p.observe(f, l)) : (_.width || _.height) && (m == null || m({
|
309
323
|
width: null,
|
310
324
|
height: null,
|
311
325
|
entry: null
|
312
|
-
}),
|
313
|
-
var
|
314
|
-
(
|
326
|
+
}), T({ width: void 0, height: void 0 })), () => {
|
327
|
+
var v, C, w;
|
328
|
+
(v = p == null ? void 0 : p.disconnect) === null || v === void 0 || v.call(p), (w = (C = g).cancel) === null || w === void 0 || w.call(C);
|
315
329
|
};
|
316
|
-
}, [
|
330
|
+
}, [g, f]), Object.assign({ ref: y }, _);
|
317
331
|
}
|
318
|
-
function
|
319
|
-
var t, n,
|
320
|
-
if (typeof e == "string" || typeof e == "number")
|
332
|
+
function Lt(e) {
|
333
|
+
var t, n, r = "";
|
334
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
321
335
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
322
|
-
var
|
323
|
-
for (t = 0; t <
|
324
|
-
} else for (n in e) e[n] && (
|
325
|
-
return
|
336
|
+
var s = e.length;
|
337
|
+
for (t = 0; t < s; t++) e[t] && (n = Lt(e[t])) && (r && (r += " "), r += n);
|
338
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
339
|
+
return r;
|
326
340
|
}
|
327
|
-
function
|
328
|
-
for (var e, t, n = 0,
|
329
|
-
return
|
341
|
+
function R() {
|
342
|
+
for (var e, t, n = 0, r = "", s = arguments.length; n < s; n++) (e = arguments[n]) && (t = Lt(e)) && (r && (r += " "), r += t);
|
343
|
+
return r;
|
330
344
|
}
|
331
|
-
const
|
332
|
-
headerContainer:
|
333
|
-
navigationTabList:
|
334
|
-
navigationTab:
|
335
|
-
headerContent:
|
336
|
-
staticEnabled:
|
337
|
-
},
|
338
|
-
const { ref: n, height:
|
345
|
+
const jn = "_headerContainer_1cubo_1", xn = "_navigationTabList_1cubo_8", On = "_navigationTab_1cubo_8", Ln = "_headerContent_1cubo_34", Mn = "_staticEnabled_1cubo_50", q = {
|
346
|
+
headerContainer: jn,
|
347
|
+
navigationTabList: xn,
|
348
|
+
navigationTab: On,
|
349
|
+
headerContent: Ln,
|
350
|
+
staticEnabled: Mn
|
351
|
+
}, Un = 77, re = ({ sticky: e, children: t }) => {
|
352
|
+
const { ref: n, height: r } = Rn({
|
339
353
|
refreshMode: "debounce",
|
340
354
|
refreshRate: 0
|
341
|
-
}), [
|
342
|
-
|
343
|
-
const
|
344
|
-
|
355
|
+
}), [s, i] = N(!1), c = () => s ? !e : !0;
|
356
|
+
G(() => {
|
357
|
+
const u = () => {
|
358
|
+
i(window.scrollY > 0);
|
345
359
|
};
|
346
|
-
return window.addEventListener("scroll",
|
360
|
+
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
347
361
|
}, []);
|
348
|
-
const
|
349
|
-
return /* @__PURE__ */
|
362
|
+
const l = `${r || Un}px`;
|
363
|
+
return /* @__PURE__ */ a("div", { style: { minHeight: l }, children: /* @__PURE__ */ a("div", { children: /* @__PURE__ */ h(
|
350
364
|
"div",
|
351
365
|
{
|
352
366
|
ref: n,
|
353
|
-
className:
|
354
|
-
[
|
367
|
+
className: R(q.headerContent, {
|
368
|
+
[q.staticEnabled]: c()
|
355
369
|
}),
|
356
370
|
children: [
|
357
|
-
/* @__PURE__ */
|
358
|
-
/* @__PURE__ */
|
371
|
+
/* @__PURE__ */ a(re.Header, {}),
|
372
|
+
/* @__PURE__ */ a(re.Tabs, {}),
|
359
373
|
t
|
360
374
|
]
|
361
375
|
}
|
362
376
|
) }) });
|
363
377
|
};
|
364
|
-
|
365
|
-
|
366
|
-
const
|
367
|
-
sidebarContainer:
|
368
|
-
},
|
369
|
-
logoLink:
|
370
|
-
},
|
371
|
-
link:
|
372
|
-
active:
|
373
|
-
},
|
374
|
-
|
378
|
+
re.Header = ({ children: e }) => /* @__PURE__ */ a("div", { className: q.headerContainer, children: e });
|
379
|
+
re.Tabs = ({ children: e }) => /* @__PURE__ */ a("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
380
|
+
const qn = "_sidebarContainer_bmdti_1", Hn = {
|
381
|
+
sidebarContainer: qn
|
382
|
+
}, Bn = "_logoLink_1baxb_1", Dn = {
|
383
|
+
logoLink: Bn
|
384
|
+
}, $n = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: r = "Lokalise" }) => /* @__PURE__ */ a("a", { className: Dn.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ a("img", { src: e, alt: r }) }), Fn = "_link_18vhx_1", zn = "_active_18vhx_18", lt = {
|
385
|
+
link: Fn,
|
386
|
+
active: zn
|
387
|
+
}, Gn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ a(H, { placement: "right", tooltip: e, children: /* @__PURE__ */ a(
|
388
|
+
L,
|
375
389
|
{
|
376
|
-
className:
|
377
|
-
[
|
390
|
+
className: R(lt.link, {
|
391
|
+
[lt.active]: window.location.pathname.startsWith(t)
|
378
392
|
}),
|
379
393
|
href: t,
|
380
|
-
children: /* @__PURE__ */
|
394
|
+
children: /* @__PURE__ */ a(n, { size: "25px" })
|
381
395
|
}
|
382
|
-
) }),
|
383
|
-
dropdownButton:
|
384
|
-
dropdownButtonActive:
|
385
|
-
},
|
386
|
-
|
396
|
+
) }), Kn = "_dropdownButton_13l5r_1", Wn = "_dropdownButtonActive_13l5r_18", dt = {
|
397
|
+
dropdownButton: Kn,
|
398
|
+
dropdownButtonActive: Wn
|
399
|
+
}, Jn = ({ children: e, icon: t }) => /* @__PURE__ */ a(
|
400
|
+
ae,
|
387
401
|
{
|
388
|
-
menuButton: ({ opened: n }) => /* @__PURE__ */
|
402
|
+
menuButton: ({ opened: n }) => /* @__PURE__ */ a(H, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ a(
|
389
403
|
"button",
|
390
404
|
{
|
391
405
|
type: "button",
|
392
|
-
className:
|
393
|
-
[
|
406
|
+
className: R(dt.dropdownButton, {
|
407
|
+
[dt.dropdownButtonActive]: n
|
394
408
|
}),
|
395
|
-
children: /* @__PURE__ */
|
409
|
+
children: /* @__PURE__ */ a(t, { size: "25px" })
|
396
410
|
}
|
397
411
|
) }),
|
398
|
-
children: /* @__PURE__ */
|
412
|
+
children: /* @__PURE__ */ a(se, { placement: "right-start", children: e })
|
399
413
|
}
|
400
|
-
),
|
401
|
-
iconContainer:
|
402
|
-
},
|
414
|
+
), Qn = "_iconContainer_nz34m_1", Yn = {
|
415
|
+
iconContainer: Qn
|
416
|
+
}, Mt = ({ className: e = "" }) => /* @__PURE__ */ a(
|
403
417
|
"div",
|
404
418
|
{
|
405
419
|
"aria-label": "Upgrade Icon",
|
406
|
-
className:
|
407
|
-
|
420
|
+
className: R(
|
421
|
+
Yn.iconContainer,
|
408
422
|
"flex-row",
|
409
423
|
"items-center",
|
410
424
|
"justify-center",
|
411
425
|
e
|
412
426
|
),
|
413
|
-
children: /* @__PURE__ */
|
427
|
+
children: /* @__PURE__ */ a(rn, {})
|
414
428
|
}
|
415
|
-
),
|
416
|
-
menuContainer:
|
417
|
-
profileButton:
|
418
|
-
profileImage:
|
419
|
-
profileImageHighlight:
|
420
|
-
profileImageUpgradeIcon:
|
421
|
-
userIconWrapper:
|
422
|
-
},
|
429
|
+
), Vn = "_menuContainer_ywskt_5", Xn = "_profileButton_ywskt_15", Zn = "_profileImage_ywskt_28", er = "_profileImageHighlight_ywskt_36", tr = "_profileImageUpgradeIcon_ywskt_40", nr = "_userIconWrapper_ywskt_46", x = {
|
430
|
+
menuContainer: Vn,
|
431
|
+
profileButton: Xn,
|
432
|
+
profileImage: Zn,
|
433
|
+
profileImageHighlight: er,
|
434
|
+
profileImageUpgradeIcon: tr,
|
435
|
+
userIconWrapper: nr
|
436
|
+
}, Ut = Ct({}), Y = () => wt(Ut), rr = ({ children: e }) => {
|
423
437
|
const {
|
424
438
|
currentTeam: t,
|
425
439
|
otherTeams: n,
|
426
|
-
showUpgradeCta:
|
427
|
-
showBillingButton:
|
428
|
-
allowTeamCreation:
|
440
|
+
showUpgradeCta: r,
|
441
|
+
showBillingButton: s,
|
442
|
+
allowTeamCreation: i,
|
429
443
|
isProviderAlpha: c,
|
430
|
-
canAccessTeamSettings:
|
431
|
-
isEndOfTrialActive:
|
432
|
-
isTeamSuspended:
|
444
|
+
canAccessTeamSettings: l,
|
445
|
+
isEndOfTrialActive: u,
|
446
|
+
isTeamSuspended: d,
|
433
447
|
isFullyAuthenticated: m
|
434
|
-
} =
|
435
|
-
return /* @__PURE__ */
|
436
|
-
|
448
|
+
} = Y();
|
449
|
+
return /* @__PURE__ */ a(
|
450
|
+
ae,
|
437
451
|
{
|
438
|
-
menuButton: () => /* @__PURE__ */
|
439
|
-
t != null && t.logoUrl ? /* @__PURE__ */
|
452
|
+
menuButton: () => /* @__PURE__ */ h("button", { className: x.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
453
|
+
t != null && t.logoUrl ? /* @__PURE__ */ a(
|
440
454
|
"img",
|
441
455
|
{
|
442
456
|
src: t.logoUrl,
|
443
|
-
className:
|
444
|
-
[
|
457
|
+
className: R(x.profileImage, {
|
458
|
+
[x.profileImageHighlight]: r
|
445
459
|
}),
|
446
460
|
alt: "Team Logo"
|
447
461
|
}
|
448
|
-
) : /* @__PURE__ */
|
462
|
+
) : /* @__PURE__ */ a(
|
449
463
|
"div",
|
450
464
|
{
|
451
|
-
className:
|
452
|
-
[
|
465
|
+
className: R(x.userIconWrapper, "flex-row", "align-center", "items-center", {
|
466
|
+
[x.profileImageHighlight]: r
|
453
467
|
}),
|
454
|
-
children: /* @__PURE__ */
|
468
|
+
children: /* @__PURE__ */ a(Pt, { size: "25px" })
|
455
469
|
}
|
456
470
|
),
|
457
|
-
|
471
|
+
r && /* @__PURE__ */ a(Mt, { className: x.profileImageUpgradeIcon })
|
458
472
|
] }),
|
459
|
-
children: /* @__PURE__ */
|
460
|
-
allowTeamCreation:
|
473
|
+
children: /* @__PURE__ */ a(se, { placement: "right-end", className: x.menuContainer, children: e({
|
474
|
+
allowTeamCreation: i,
|
461
475
|
otherTeams: n,
|
462
|
-
canAccessTeamSettings:
|
463
|
-
isEndOfTrialActive:
|
464
|
-
isTeamSuspended:
|
465
|
-
showBillingButton:
|
476
|
+
canAccessTeamSettings: l,
|
477
|
+
isEndOfTrialActive: u,
|
478
|
+
isTeamSuspended: d,
|
479
|
+
showBillingButton: s,
|
466
480
|
isProviderAlpha: c,
|
467
481
|
isFullyAuthenticated: m
|
468
482
|
}) })
|
469
483
|
}
|
470
484
|
);
|
471
|
-
},
|
472
|
-
const
|
473
|
-
if (
|
485
|
+
}, qt = 0, or = 9999, ar = [150, 151, 250, 251], sr = [152, 153, 252, 253], ir = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], cr = [156, 159, 160, 256, 259, 260], Ht = 9998, Be = (e) => e === qt, Bt = (e) => e === or, Na = (e) => ar.includes(e), Ra = (e) => sr.includes(e), ja = (e) => ir.includes(e), xa = (e) => cr.includes(e), Oa = (e) => e > qt && e < Ht, La = (e) => e === Ht, lr = /\n/, ut = (e, t, n) => e.split(t).flatMap((r, s) => s !== 0 ? [tn(n, { key: Math.random().toString(32).slice(0, 10) }), r] : r), dr = (e, t, n) => typeof e == "string" ? ut(e, t, n) : e.flatMap((r) => typeof r == "string" ? ut(r, t, n) : r), ur = (e) => dr(e, lr, /* @__PURE__ */ a("br", {})), mr = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, fr = (e) => e.match(mr) ?? [], mt = (e, t, n) => {
|
486
|
+
const r = e.split(t);
|
487
|
+
if (r.length === 1)
|
474
488
|
return e;
|
475
|
-
const
|
476
|
-
return
|
477
|
-
/* @__PURE__ */
|
478
|
-
),
|
479
|
-
},
|
480
|
-
const t =
|
481
|
-
return t != null && t.length ? t.reduce((n,
|
482
|
-
},
|
483
|
-
|
484
|
-
},
|
489
|
+
const s = [];
|
490
|
+
return r[0] !== "" && s.push(r[0]), r.shift(), r[r.length - 1] === "" && r.pop(), s.push(
|
491
|
+
/* @__PURE__ */ a("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
492
|
+
), s.push(r.join(t)), s.filter((i) => i !== "");
|
493
|
+
}, ft = (e) => {
|
494
|
+
const t = fr(e);
|
495
|
+
return t != null && t.length ? t.reduce((n, r, s) => typeof n == "string" ? mt(n, r, s) : n.flatMap((i) => typeof i == "string" ? mt(i, r, s) : i), e) : e;
|
496
|
+
}, _r = (e) => typeof e == "string" ? ft(e) : e.flatMap((t) => typeof t == "string" ? ft(t) : t, e), gr = (e, t = "PP") => At(e, t), Ma = (e, t, n = "PP") => At(un(e, t), n), De = (e) => {
|
497
|
+
G(e, []);
|
498
|
+
}, _t = {
|
485
499
|
biller: "biller",
|
486
500
|
owner: "owner"
|
487
|
-
},
|
488
|
-
|
489
|
-
|
490
|
-
],
|
491
|
-
const { teams: n, currentTeamId:
|
501
|
+
}, gt = [
|
502
|
+
_t.biller,
|
503
|
+
_t.owner
|
504
|
+
], hr = ({ children: e, config: t }) => {
|
505
|
+
const { teams: n, currentTeamId: r, planId: s, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: l } = t, u = n.find((g) => g.id === r), d = n.filter((g) => g.id !== r), m = gt.includes(l), _ = gt.includes(l), T = Be(s) || Bt(s), b = {
|
492
506
|
...t,
|
493
|
-
currentTeam:
|
494
|
-
otherTeams:
|
507
|
+
currentTeam: u,
|
508
|
+
otherTeams: d,
|
495
509
|
canChangeBilling: m,
|
496
|
-
canAccessTeamSettings:
|
497
|
-
isOnFreeOrTrialPlan:
|
498
|
-
showUpgradeCta: c &&
|
499
|
-
showBillingButton: c &&
|
500
|
-
allowTeamCreation: c && !
|
510
|
+
canAccessTeamSettings: _,
|
511
|
+
isOnFreeOrTrialPlan: T,
|
512
|
+
showUpgradeCta: c && T && m,
|
513
|
+
showBillingButton: c && _ && m,
|
514
|
+
allowTeamCreation: c && !i
|
501
515
|
};
|
502
|
-
return /* @__PURE__ */
|
503
|
-
},
|
504
|
-
container:
|
505
|
-
profileEmail:
|
506
|
-
},
|
516
|
+
return /* @__PURE__ */ a(Ut.Provider, { value: b, children: e });
|
517
|
+
}, pr = ({ config: e, children: t }) => /* @__PURE__ */ a(hr, { config: e, children: /* @__PURE__ */ a(rr, { children: t }) }), br = "_container_q5pot_1", vr = "_profileEmail_q5pot_5", ht = {
|
518
|
+
container: br,
|
519
|
+
profileEmail: vr
|
520
|
+
}, Tr = ({
|
507
521
|
href: e,
|
508
522
|
onClick: t,
|
509
523
|
userEmail: n,
|
510
|
-
hideBottomDivider:
|
524
|
+
hideBottomDivider: r
|
511
525
|
}) => {
|
512
|
-
const { isEndOfTrialActive:
|
513
|
-
return
|
514
|
-
/* @__PURE__ */
|
526
|
+
const { isEndOfTrialActive: s, isTeamSuspended: i } = Y();
|
527
|
+
return s || i ? null : /* @__PURE__ */ h(Ue, { children: [
|
528
|
+
/* @__PURE__ */ a(
|
515
529
|
K,
|
516
530
|
{
|
517
531
|
href: e,
|
518
532
|
onClick: () => {
|
519
533
|
t == null || t();
|
520
534
|
},
|
521
|
-
children: /* @__PURE__ */
|
522
|
-
/* @__PURE__ */
|
523
|
-
/* @__PURE__ */
|
535
|
+
children: /* @__PURE__ */ h("div", { className: `flex-col ${ht.container}`, children: [
|
536
|
+
/* @__PURE__ */ a("span", { children: "Profile Settings" }),
|
537
|
+
/* @__PURE__ */ a("span", { className: ht.profileEmail, children: n })
|
524
538
|
] })
|
525
539
|
}
|
526
540
|
),
|
527
|
-
!
|
541
|
+
!r && /* @__PURE__ */ a(It, {})
|
528
542
|
] });
|
529
|
-
},
|
530
|
-
wrapper:
|
531
|
-
profileImage:
|
532
|
-
teamName:
|
533
|
-
planLabel:
|
534
|
-
membership:
|
535
|
-
defaultProfileImage:
|
536
|
-
},
|
537
|
-
const { currentTeam:
|
538
|
-
if (!
|
543
|
+
}, yr = "_wrapper_15d85_1", Sr = "_profileImage_15d85_14", Er = "_teamName_15d85_22", wr = "_planLabel_15d85_29", Cr = "_membership_15d85_38", kr = "_defaultProfileImage_15d85_44", M = {
|
544
|
+
wrapper: yr,
|
545
|
+
profileImage: Sr,
|
546
|
+
teamName: Er,
|
547
|
+
planLabel: wr,
|
548
|
+
membership: Cr,
|
549
|
+
defaultProfileImage: kr
|
550
|
+
}, Dt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
551
|
+
const { currentTeam: r, planId: s } = Y(), i = e || r;
|
552
|
+
if (!i)
|
539
553
|
return null;
|
540
|
-
const c =
|
541
|
-
return /* @__PURE__ */
|
554
|
+
const c = Be(s) ? "Free" : Bt(s) ? "Trial" : void 0;
|
555
|
+
return /* @__PURE__ */ h(
|
542
556
|
t ? K : "div",
|
543
557
|
{
|
544
|
-
className: `flex-row gap-2 flex-nowrap items-center ${
|
545
|
-
...t && { onClick: () => t(
|
558
|
+
className: `flex-row gap-2 flex-nowrap items-center ${M.wrapper}`,
|
559
|
+
...t && { onClick: () => t(i) },
|
546
560
|
children: [
|
547
|
-
|
548
|
-
/* @__PURE__ */
|
549
|
-
/* @__PURE__ */
|
550
|
-
/* @__PURE__ */
|
551
|
-
c && !n && /* @__PURE__ */
|
561
|
+
i.logoUrl ? /* @__PURE__ */ a("img", { className: M.profileImage, src: i.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ a("span", { className: `flex-row justify-center items-center ${M.defaultProfileImage}`, children: /* @__PURE__ */ a(Pt, { size: "25px" }) }),
|
562
|
+
/* @__PURE__ */ h("div", { className: "flex-col items-start", children: [
|
563
|
+
/* @__PURE__ */ h("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
564
|
+
/* @__PURE__ */ a("span", { title: i.name, className: M.teamName, children: i.name }),
|
565
|
+
c && !n && /* @__PURE__ */ a("span", { className: `flex-row justify-center items-center ${M.planLabel}`, children: c })
|
552
566
|
] }),
|
553
|
-
/* @__PURE__ */
|
567
|
+
/* @__PURE__ */ a("span", { className: M.membership, children: i.role })
|
554
568
|
] })
|
555
569
|
]
|
556
570
|
}
|
557
571
|
);
|
558
|
-
},
|
559
|
-
teamsContainer:
|
560
|
-
},
|
561
|
-
const { otherTeams: t } =
|
562
|
-
return t.length === 0 ? null : /* @__PURE__ */
|
563
|
-
},
|
564
|
-
container:
|
565
|
-
planCta:
|
566
|
-
upgradeIconWrapper:
|
567
|
-
},
|
568
|
-
const { planId: t, trialDaysLeft: n, showUpgradeCta:
|
569
|
-
if (!
|
572
|
+
}, Pr = "_teamsContainer_1t68g_1", Ir = {
|
573
|
+
teamsContainer: Pr
|
574
|
+
}, Ar = ({ onSwitchTeam: e }) => {
|
575
|
+
const { otherTeams: t } = Y();
|
576
|
+
return t.length === 0 ? null : /* @__PURE__ */ a("div", { className: `flex-col items-stretch ${Ir.teamsContainer}`, children: t.map((n) => /* @__PURE__ */ a(Dt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id)) });
|
577
|
+
}, Nr = "_container_1u995_1", Rr = "_planCta_1u995_15", jr = "_upgradeIconWrapper_1u995_19", Ie = {
|
578
|
+
container: Nr,
|
579
|
+
planCta: Rr,
|
580
|
+
upgradeIconWrapper: jr
|
581
|
+
}, xr = ({ upgradeOptionHref: e }) => {
|
582
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: r } = Y();
|
583
|
+
if (!r)
|
570
584
|
return null;
|
571
|
-
const c =
|
572
|
-
return /* @__PURE__ */
|
573
|
-
/* @__PURE__ */
|
574
|
-
/* @__PURE__ */
|
575
|
-
/* @__PURE__ */
|
576
|
-
/* @__PURE__ */
|
585
|
+
const c = Be(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
586
|
+
return /* @__PURE__ */ h(K, { href: e, className: `flex-col gap-1 items-start ${Ie.container}`, children: [
|
587
|
+
/* @__PURE__ */ a("span", { className: Ie.planCta, children: c }),
|
588
|
+
/* @__PURE__ */ h("div", { className: `flex-row items-center gap-1 ${Ie.upgradeIconWrapper}`, children: [
|
589
|
+
/* @__PURE__ */ a(Mt, {}),
|
590
|
+
/* @__PURE__ */ a("span", { children: "See upgrade options" })
|
577
591
|
] })
|
578
592
|
] });
|
579
|
-
},
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
}
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
593
|
+
}, Or = Math.min, Lr = Math.max;
|
594
|
+
function pt(e, t, n) {
|
595
|
+
return Lr(e, Or(t, n));
|
596
|
+
}
|
597
|
+
function $t(e, t) {
|
598
|
+
return typeof e == "function" ? e(t) : e;
|
599
|
+
}
|
600
|
+
function Ft(e) {
|
601
|
+
return e.split("-")[0];
|
602
|
+
}
|
603
|
+
function Mr(e) {
|
604
|
+
return e === "x" ? "y" : "x";
|
605
|
+
}
|
606
|
+
function Ur(e) {
|
607
|
+
return ["top", "bottom"].includes(Ft(e)) ? "y" : "x";
|
608
|
+
}
|
609
|
+
function qr(e) {
|
610
|
+
return {
|
611
|
+
top: 0,
|
612
|
+
right: 0,
|
613
|
+
bottom: 0,
|
614
|
+
left: 0,
|
615
|
+
...e
|
616
|
+
};
|
617
|
+
}
|
618
|
+
function Hr(e) {
|
619
|
+
return typeof e != "number" ? qr(e) : {
|
620
|
+
top: e,
|
621
|
+
right: e,
|
622
|
+
bottom: e,
|
623
|
+
left: e
|
624
|
+
};
|
625
|
+
}
|
626
|
+
function bt(e) {
|
627
|
+
const {
|
628
|
+
x: t,
|
629
|
+
y: n,
|
630
|
+
width: r,
|
631
|
+
height: s
|
632
|
+
} = e;
|
633
|
+
return {
|
634
|
+
width: r,
|
635
|
+
height: s,
|
636
|
+
top: n,
|
637
|
+
left: t,
|
638
|
+
right: t + r,
|
639
|
+
bottom: n + s,
|
640
|
+
x: t,
|
641
|
+
y: n
|
642
|
+
};
|
643
|
+
}
|
644
|
+
async function Br(e, t) {
|
645
|
+
var n;
|
646
|
+
t === void 0 && (t = {});
|
647
|
+
const {
|
648
|
+
x: r,
|
649
|
+
y: s,
|
650
|
+
platform: i,
|
651
|
+
rects: c,
|
652
|
+
elements: l,
|
653
|
+
strategy: u
|
654
|
+
} = e, {
|
655
|
+
boundary: d = "clippingAncestors",
|
656
|
+
rootBoundary: m = "viewport",
|
657
|
+
elementContext: _ = "floating",
|
658
|
+
altBoundary: T = !1,
|
659
|
+
padding: y = 0
|
660
|
+
} = $t(t, e), f = Hr(y), b = l[T ? _ === "floating" ? "reference" : "floating" : _], g = bt(await i.getClippingRect({
|
661
|
+
element: (n = await (i.isElement == null ? void 0 : i.isElement(b))) == null || n ? b : b.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
|
662
|
+
boundary: d,
|
663
|
+
rootBoundary: m,
|
664
|
+
strategy: u
|
665
|
+
})), p = _ === "floating" ? {
|
666
|
+
x: r,
|
667
|
+
y: s,
|
668
|
+
width: c.floating.width,
|
669
|
+
height: c.floating.height
|
670
|
+
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), C = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
671
|
+
x: 1,
|
672
|
+
y: 1
|
673
|
+
} : {
|
674
|
+
x: 1,
|
675
|
+
y: 1
|
676
|
+
}, w = bt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
677
|
+
elements: l,
|
678
|
+
rect: p,
|
679
|
+
offsetParent: v,
|
680
|
+
strategy: u
|
681
|
+
}) : p);
|
682
|
+
return {
|
683
|
+
top: (g.top - w.top + f.top) / C.y,
|
684
|
+
bottom: (w.bottom - g.bottom + f.bottom) / C.y,
|
685
|
+
left: (g.left - w.left + f.left) / C.x,
|
686
|
+
right: (w.right - g.right + f.right) / C.x
|
687
|
+
};
|
688
|
+
}
|
689
|
+
const Dr = function(e) {
|
690
|
+
return e === void 0 && (e = {}), {
|
691
|
+
name: "shift",
|
692
|
+
options: e,
|
693
|
+
async fn(t) {
|
694
|
+
const {
|
695
|
+
x: n,
|
696
|
+
y: r,
|
697
|
+
placement: s
|
698
|
+
} = t, {
|
699
|
+
mainAxis: i = !0,
|
700
|
+
crossAxis: c = !1,
|
701
|
+
limiter: l = {
|
702
|
+
fn: (b) => {
|
703
|
+
let {
|
704
|
+
x: g,
|
705
|
+
y: p
|
706
|
+
} = b;
|
707
|
+
return {
|
708
|
+
x: g,
|
709
|
+
y: p
|
710
|
+
};
|
711
|
+
}
|
712
|
+
},
|
713
|
+
...u
|
714
|
+
} = $t(e, t), d = {
|
715
|
+
x: n,
|
716
|
+
y: r
|
717
|
+
}, m = await Br(t, u), _ = Ur(Ft(s)), T = Mr(_);
|
718
|
+
let y = d[T], f = d[_];
|
719
|
+
if (i) {
|
720
|
+
const b = T === "y" ? "top" : "left", g = T === "y" ? "bottom" : "right", p = y + m[b], v = y - m[g];
|
721
|
+
y = pt(p, y, v);
|
722
|
+
}
|
723
|
+
if (c) {
|
724
|
+
const b = _ === "y" ? "top" : "left", g = _ === "y" ? "bottom" : "right", p = f + m[b], v = f - m[g];
|
725
|
+
f = pt(p, f, v);
|
726
|
+
}
|
727
|
+
const E = l.fn({
|
728
|
+
...t,
|
729
|
+
[T]: y,
|
730
|
+
[_]: f
|
731
|
+
});
|
732
|
+
return {
|
733
|
+
...E,
|
734
|
+
data: {
|
735
|
+
x: E.x - n,
|
736
|
+
y: E.y - r,
|
737
|
+
enabled: {
|
738
|
+
[T]: i,
|
739
|
+
[_]: c
|
740
|
+
}
|
741
|
+
}
|
742
|
+
};
|
743
|
+
}
|
744
|
+
};
|
745
|
+
}, $r = "_navItem_1dudv_1", Fr = "_activeNavItem_1dudv_18", zr = "_badge_1dudv_23", Ae = {
|
746
|
+
navItem: $r,
|
747
|
+
activeNavItem: Fr,
|
748
|
+
badge: zr
|
749
|
+
}, zt = Ct({}), V = () => wt(zt), Gr = (e) => {
|
750
|
+
const t = e.lastIndexOf("."), n = e.slice(0, t), r = e.slice(t + 1);
|
751
|
+
return { name: n, extension: r };
|
752
|
+
}, Kr = (e, t) => {
|
753
|
+
switch (e) {
|
754
|
+
case P.Completed:
|
755
|
+
return t < 100 ? "Closed" : "Completed";
|
756
|
+
case P.Created:
|
757
|
+
return t > 0 ? "In progress" : "Not started";
|
758
|
+
case P.InProgress:
|
759
|
+
return "In progress";
|
760
|
+
case P.Queued:
|
761
|
+
return "Queued";
|
762
|
+
case P.NotStarted:
|
763
|
+
return "Not started";
|
764
|
+
default:
|
765
|
+
return "-";
|
766
|
+
}
|
767
|
+
}, Wr = (e) => {
|
768
|
+
const t = e.progress ?? 0;
|
769
|
+
return e.status === P.Created && t > 0 ? P.InProgress : e.status;
|
770
|
+
}, Jr = {
|
771
|
+
[te.translation]: "#0891B2",
|
772
|
+
[te.review]: "#16922D",
|
773
|
+
[te.lqa_by_ai]: "#8B5CF6",
|
774
|
+
[te.automatic_translation]: "#60A5FA"
|
775
|
+
}, Qr = (e) => {
|
776
|
+
const t = [
|
777
|
+
P.InProgress,
|
778
|
+
P.Created,
|
779
|
+
P.Completed
|
780
|
+
];
|
781
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Wr(n) })).sort((n, r) => n.status === P.InProgress && n.progress === 100 ? -1 : r.status === P.InProgress && r.progress === 100 ? 1 : n.status === r.status ? n.name < r.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(r.status));
|
782
|
+
}, vt = (e) => e in [xe.InProgress, xe.Created], Yr = (e, t) => vt(e.status) && vt(t.status) && (t.progress ?? 0) >= 100, Vr = ({ task: e, language: t }) => {
|
783
|
+
const [n, r] = N(!1), [s, i] = N(!1), { onLanguageCompleteConfirm: c, fetchTasks: l } = V(), u = () => {
|
784
|
+
i(!1);
|
785
|
+
};
|
786
|
+
return /* @__PURE__ */ h(Ue, { children: [
|
787
|
+
s && /* @__PURE__ */ a(
|
788
|
+
on,
|
789
|
+
{
|
790
|
+
opened: !0,
|
791
|
+
loading: n,
|
792
|
+
title: `Are you finished with ${t.name}?`,
|
793
|
+
confirmText: "Mark as done",
|
794
|
+
closeText: "Cancel",
|
795
|
+
onClose: u,
|
796
|
+
onConfirm: async () => {
|
797
|
+
r(!0), await c({ task: e, language: t, closePrompt: u }), l();
|
798
|
+
},
|
799
|
+
children: /* @__PURE__ */ h(an, { status: "info", children: [
|
800
|
+
"Make sure you are finished and ",
|
801
|
+
/* @__PURE__ */ a("strong", { children: "mark it as done" }),
|
802
|
+
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
803
|
+
] })
|
804
|
+
}
|
805
|
+
),
|
806
|
+
/* @__PURE__ */ a(
|
807
|
+
L,
|
808
|
+
{
|
809
|
+
disabled: n,
|
810
|
+
onClick: () => {
|
811
|
+
i(!0);
|
812
|
+
},
|
813
|
+
children: "Mark as done"
|
814
|
+
}
|
815
|
+
)
|
816
|
+
] });
|
817
|
+
}, Xr = "_langRowCompleted_vpgdi_1", Zr = "_langCellSecondary_vpgdi_15", eo = "_langStatus_vpgdi_20", Ne = {
|
818
|
+
langRowCompleted: Xr,
|
819
|
+
langCellSecondary: Zr,
|
820
|
+
langStatus: eo
|
821
|
+
}, to = ({ language: e, task: t }) => {
|
822
|
+
const { getProjectUrl: n, langNameOnClick: r, langProgressOnClick: s } = V(), i = e.progress ?? 0, c = e.status === P.Completed, l = Yr(t, e);
|
823
|
+
return /* @__PURE__ */ h(
|
824
|
+
"tr",
|
825
|
+
{
|
826
|
+
className: R({
|
827
|
+
[Ne.langRowCompleted]: l
|
828
|
+
}),
|
829
|
+
children: [
|
830
|
+
/* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(H, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ a(
|
831
|
+
L,
|
832
|
+
{
|
833
|
+
href: n({ task: t, language: e }),
|
834
|
+
onClick: () => {
|
835
|
+
r == null || r({ task: t, language: e });
|
836
|
+
},
|
837
|
+
children: e.name
|
838
|
+
}
|
839
|
+
) }) }),
|
840
|
+
/* @__PURE__ */ a("td", { className: Ne.langCellSecondary, children: l || c ? "0" : /* @__PURE__ */ a(H, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ a(
|
841
|
+
L,
|
842
|
+
{
|
843
|
+
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
844
|
+
onClick: () => {
|
845
|
+
s == null || s({ task: t, language: e });
|
846
|
+
},
|
847
|
+
children: e.base_words_total - e.base_words_done
|
848
|
+
}
|
849
|
+
) }) }),
|
850
|
+
/* @__PURE__ */ h("td", { children: [
|
851
|
+
i,
|
852
|
+
"%"
|
853
|
+
] }),
|
854
|
+
/* @__PURE__ */ a("td", { children: l ? /* @__PURE__ */ a(Vr, { task: t, language: e }) : /* @__PURE__ */ a(
|
855
|
+
"span",
|
856
|
+
{
|
857
|
+
className: `${Ne.langStatus} flex-row items-center justify-start`,
|
858
|
+
"data-status": e.status,
|
859
|
+
children: Kr(e.status, i)
|
860
|
+
}
|
861
|
+
) })
|
862
|
+
]
|
863
|
+
}
|
864
|
+
);
|
865
|
+
}, no = "_taskContainer_mt2or_1", ro = "_taskTitle_mt2or_21", oo = "_taskDescription_mt2or_28", ao = "_languagesTable_mt2or_35", so = "_metadata_mt2or_87", U = {
|
866
|
+
taskContainer: no,
|
867
|
+
taskTitle: ro,
|
868
|
+
taskDescription: oo,
|
869
|
+
languagesTable: ao,
|
870
|
+
metadata: so
|
871
|
+
}, io = ({ task: e }) => {
|
872
|
+
const { tasks: t, getProjectUrl: n, taskTitleOnClick: r } = V(), s = Qr(e.langs), i = (c) => {
|
873
|
+
c !== void 0 && window.open(
|
874
|
+
`/style-guide/${e.team_id}/download/${c.id}/link`,
|
875
|
+
"_blank",
|
876
|
+
"noopener,noreferrer"
|
877
|
+
);
|
878
|
+
};
|
879
|
+
return t ? /* @__PURE__ */ h("div", { className: U.taskContainer, children: [
|
880
|
+
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-center", children: [
|
881
|
+
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
882
|
+
/* @__PURE__ */ a(Re, { color: Jr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
883
|
+
e.due_date && /* @__PURE__ */ h(Re, { color: "#EAB308", children: [
|
884
|
+
"DUE ",
|
885
|
+
gr(dn(e.due_date), "yyyy-MM-dd")
|
886
|
+
] })
|
887
|
+
] }),
|
888
|
+
e.style_guides.length > 0 && /* @__PURE__ */ a("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ a(
|
889
|
+
je,
|
890
|
+
{
|
891
|
+
size: "sm",
|
892
|
+
variant: "secondary",
|
893
|
+
onClick: () => i(e.style_guides[0]),
|
894
|
+
children: "Download style guide"
|
895
|
+
}
|
896
|
+
) : /* @__PURE__ */ a(
|
897
|
+
ae,
|
898
|
+
{
|
899
|
+
menuButton: /* @__PURE__ */ a(je, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
900
|
+
children: /* @__PURE__ */ a(se, { children: e.style_guides.map((c) => /* @__PURE__ */ a(
|
901
|
+
K,
|
902
|
+
{
|
903
|
+
onClick: () => i(c),
|
904
|
+
children: Gr(c.name).name
|
905
|
+
},
|
906
|
+
c.id
|
907
|
+
)) })
|
908
|
+
}
|
909
|
+
) })
|
910
|
+
] }),
|
911
|
+
/* @__PURE__ */ a("h4", { className: U.taskTitle, children: /* @__PURE__ */ a(
|
912
|
+
L,
|
913
|
+
{
|
914
|
+
href: n({ task: e, view: "multi" }),
|
915
|
+
onClick: () => {
|
916
|
+
r == null || r({ task: e });
|
917
|
+
},
|
918
|
+
children: e.title
|
919
|
+
}
|
920
|
+
) }),
|
921
|
+
e.description && /* @__PURE__ */ a("div", { className: U.taskDescription, children: ur(_r(e.description)) }),
|
922
|
+
/* @__PURE__ */ h("table", { className: U.languagesTable, children: [
|
923
|
+
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
924
|
+
/* @__PURE__ */ a("th", { children: "Languages" }),
|
925
|
+
/* @__PURE__ */ a("th", { children: "Words to do" }),
|
926
|
+
/* @__PURE__ */ a("th", { children: "Progress" }),
|
927
|
+
/* @__PURE__ */ a("th", { children: "Status" })
|
928
|
+
] }) }),
|
929
|
+
/* @__PURE__ */ a("tbody", { children: s.map((c) => /* @__PURE__ */ a(to, { language: c, task: e }, c.lang_id)) })
|
930
|
+
] }),
|
931
|
+
/* @__PURE__ */ h("div", { className: U.metadata, children: [
|
932
|
+
/* @__PURE__ */ h("span", { children: [
|
933
|
+
"Source: ",
|
934
|
+
e.source_lang_name
|
935
|
+
] }),
|
936
|
+
/* @__PURE__ */ a("span", { children: e.created_by_fullname }),
|
937
|
+
/* @__PURE__ */ h("span", { children: [
|
938
|
+
"In ",
|
939
|
+
e.project_name,
|
940
|
+
e.master_branching_enabled === "1" && /* @__PURE__ */ a("div", { className: U.tag, children: e.branch_name ? e.branch_name : "master" })
|
941
|
+
] })
|
942
|
+
] })
|
943
|
+
] }) : null;
|
944
|
+
}, k = {
|
945
|
+
TaskCompleted: "task_completed",
|
946
|
+
TaskClosed: "task_closed",
|
947
|
+
Refresh: "refresh",
|
948
|
+
ShowDialog: "show_dialog"
|
949
|
+
}, co = "_loadingContainer_19d6m_1", lo = "_noTasksContainer_19d6m_7", uo = "_noTasksHeading_19d6m_14", mo = "_noTasksText_19d6m_18", fo = "_tasksContainer_19d6m_23", $ = {
|
950
|
+
loadingContainer: co,
|
951
|
+
noTasksContainer: lo,
|
952
|
+
noTasksHeading: uo,
|
953
|
+
noTasksText: mo,
|
954
|
+
tasksContainer: fo
|
955
|
+
}, _o = () => {
|
956
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: r } = V();
|
957
|
+
return De(() => (r(), t == null || t({ tasks: e }), document.addEventListener(k.TaskCompleted, r), document.addEventListener(k.TaskClosed, r), document.addEventListener(k.Refresh, r), () => {
|
958
|
+
document.removeEventListener(k.TaskCompleted, r), document.removeEventListener(k.TaskClosed, r), document.removeEventListener(k.Refresh, r);
|
959
|
+
})), n ? /* @__PURE__ */ a("div", { "data-testid": "sidebar-tasks-loading-popover", className: $.loadingContainer, children: /* @__PURE__ */ a(sn, {}) }) : e.length === 0 ? /* @__PURE__ */ h("div", { "data-testid": "sidebar-no-tasks-popover", className: $.noTasksContainer, children: [
|
960
|
+
/* @__PURE__ */ a("h3", { className: $.noTasksHeading, children: "No tasks" }),
|
961
|
+
/* @__PURE__ */ h("div", { className: $.noTasksText, children: [
|
962
|
+
"Your incoming tasks will appear here.",
|
963
|
+
/* @__PURE__ */ a("br", {}),
|
964
|
+
/* @__PURE__ */ a(L, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
965
|
+
] })
|
966
|
+
] }) : /* @__PURE__ */ a("div", { "data-testid": "sidebar-tasks-popover", className: $.tasksContainer, children: e.map((s) => /* @__PURE__ */ a(io, { task: s }, s.id)) });
|
967
|
+
}, go = ({ children: e, config: t }) => {
|
968
|
+
const [n, r] = N([]), [s, i] = N(!0), [c, l] = N(0), {
|
969
|
+
getProjectUrl: u,
|
970
|
+
onLanguageCompleteConfirm: d,
|
971
|
+
onTasksWidgetOpen: m,
|
972
|
+
langNameOnClick: _,
|
973
|
+
langProgressOnClick: T,
|
974
|
+
taskTitleOnClick: y
|
975
|
+
} = t, { getTasks: f, getTasksCount: E } = t, b = async () => {
|
976
|
+
i(!0);
|
977
|
+
const v = await f();
|
978
|
+
r(v), i(!1);
|
979
|
+
}, g = async () => {
|
980
|
+
const v = await E();
|
981
|
+
l(v);
|
982
|
+
};
|
983
|
+
De(() => (g(), document.addEventListener(k.TaskCompleted, g), document.addEventListener(k.TaskClosed, g), document.addEventListener(k.Refresh, g), () => {
|
984
|
+
document.removeEventListener(k.TaskCompleted, g), document.removeEventListener(k.TaskClosed, g), document.removeEventListener(k.Refresh, g);
|
985
|
+
}));
|
986
|
+
const p = {
|
987
|
+
fetchTasks: b,
|
988
|
+
tasks: n,
|
989
|
+
tasksCount: c,
|
990
|
+
loadingTasks: s,
|
991
|
+
getProjectUrl: u,
|
992
|
+
onLanguageCompleteConfirm: d,
|
993
|
+
onTasksWidgetOpen: m,
|
994
|
+
langNameOnClick: _,
|
995
|
+
langProgressOnClick: T,
|
996
|
+
taskTitleOnClick: y
|
997
|
+
};
|
998
|
+
return /* @__PURE__ */ a(zt.Provider, { value: p, children: e });
|
999
|
+
}, ho = (e) => function(n) {
|
1000
|
+
const { config: r, ...s } = n;
|
1001
|
+
return /* @__PURE__ */ a(go, { config: r, children: /* @__PURE__ */ a(e, { ...s }) });
|
1002
|
+
}, po = ho(() => {
|
1003
|
+
const [e, t] = N(!1), { tasksCount: n } = V();
|
1004
|
+
return De(() => {
|
1005
|
+
const r = () => {
|
1006
|
+
t(!0);
|
1007
|
+
};
|
1008
|
+
return document.addEventListener(k.ShowDialog, r), () => {
|
1009
|
+
document.removeEventListener(k.ShowDialog, r);
|
1010
|
+
};
|
1011
|
+
}), /* @__PURE__ */ a(H, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ a(
|
1012
|
+
cn,
|
1013
|
+
{
|
1014
|
+
content: /* @__PURE__ */ a(_o, {}),
|
1015
|
+
placement: "right",
|
1016
|
+
open: e,
|
1017
|
+
onOpenChange: t,
|
1018
|
+
middlewares: [
|
1019
|
+
Dr({
|
1020
|
+
// Adding some spacing to the top and bottom so the popover
|
1021
|
+
// doesn't extend to the edges of the screen.
|
1022
|
+
padding: {
|
1023
|
+
top: 32,
|
1024
|
+
bottom: 32
|
1025
|
+
}
|
1026
|
+
})
|
1027
|
+
],
|
1028
|
+
children: (r) => /* @__PURE__ */ h(
|
1029
|
+
je,
|
1030
|
+
{
|
1031
|
+
type: "button",
|
1032
|
+
"data-testid": "sidebar-tasks-widget-button",
|
1033
|
+
"aria-label": "Tasks",
|
1034
|
+
className: R(Ae.navItem, {
|
1035
|
+
[Ae.activeNavItem]: r
|
1036
|
+
}),
|
1037
|
+
children: [
|
1038
|
+
/* @__PURE__ */ a(ln, { size: "25px" }),
|
1039
|
+
n > 0 && /* @__PURE__ */ a("div", { className: Ae.badge, "aria-label": `${n} items requiring attention`, children: n > 9 ? "9+" : n })
|
1040
|
+
]
|
1041
|
+
}
|
1042
|
+
)
|
1043
|
+
}
|
1044
|
+
) });
|
1045
|
+
}), I = ({ children: e, ...t }) => /* @__PURE__ */ a("nav", { ...t, className: Hn.sidebarContainer, children: e }), bo = ({ children: e }) => /* @__PURE__ */ a("div", { children: e });
|
1046
|
+
I.Top = bo;
|
1047
|
+
const vo = ({ children: e }) => /* @__PURE__ */ a("div", { children: e });
|
1048
|
+
I.Bottom = vo;
|
1049
|
+
I.Avatar = $n;
|
1050
|
+
I.IconLink = Gn;
|
1051
|
+
I.Menu = Jn;
|
1052
|
+
I.ProfileMenu = pr;
|
1053
|
+
I.TeamSwitch = Ar;
|
1054
|
+
I.TeamMenuItem = Dt;
|
1055
|
+
I.UpgradeMenuItem = xr;
|
1056
|
+
I.ProfileSettingsMenuItem = Tr;
|
1057
|
+
I.Tasks = po;
|
1058
|
+
const To = "_breadcrumbsItem_1hm6a_1", yo = "_breadcrumbs_1hm6a_1", Tt = {
|
1059
|
+
breadcrumbsItem: To,
|
1060
|
+
breadcrumbs: yo
|
1061
|
+
}, Ua = ({ items: e }) => /* @__PURE__ */ a("nav", { "aria-label": "breadcrumb", className: Tt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ h(kt, { children: [
|
1062
|
+
/* @__PURE__ */ a(L, { className: Tt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1063
|
+
n < e.length - 1 && /* @__PURE__ */ a("span", { children: " — " })
|
1064
|
+
] }, `${t.link}-${t.name}`)) }), So = ({ items: e }) => /* @__PURE__ */ a(Ue, { children: e.map((t, n) => /* @__PURE__ */ h(kt, { children: [
|
1065
|
+
!!n && t.some((r) => r.visible) && /* @__PURE__ */ a(It, {}),
|
1066
|
+
t.filter(({ visible: r }) => r).map(({ link: r, label: s, onClick: i }) => /* @__PURE__ */ a(K, { href: r || "#", "aria-label": s, onClick: i, children: s }, s))
|
1067
|
+
] }, t[0].label)) }), Eo = "_badge_1pc1v_1", wo = "_tag_1pc1v_15", Co = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", ko = "_disabled_1pc1v_57", Po = "_projectNavigationItem_1pc1v_61", Io = "_projectNavigationItemDisabled_1pc1v_67", O = {
|
1068
|
+
badge: Eo,
|
1069
|
+
tag: wo,
|
1070
|
+
withNavLinkStyle: Co,
|
1071
|
+
disabled: ko,
|
1072
|
+
projectNavigationItem: Po,
|
1073
|
+
projectNavigationItemDisabled: Io
|
1074
|
+
}, yt = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ h("div", { className: "flex gap-1", children: [
|
1075
|
+
/* @__PURE__ */ h("div", { children: [
|
1076
|
+
/* @__PURE__ */ a("span", { children: e }),
|
1077
|
+
!!t && /* @__PURE__ */ a("div", { className: O.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
611
1078
|
] }),
|
612
|
-
!!n && /* @__PURE__ */
|
613
|
-
] }),
|
614
|
-
({ label: e, href: t = "", disabled: n = !1, badge:
|
1079
|
+
!!n && /* @__PURE__ */ a(Re, { className: O.tag, children: n })
|
1080
|
+
] }), Oe = nn(
|
1081
|
+
({ label: e, href: t = "", disabled: n = !1, badge: r, onClick: s, novel: i }, c) => /* @__PURE__ */ a(H, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ a(
|
615
1082
|
"div",
|
616
1083
|
{
|
617
|
-
className: n ?
|
618
|
-
children:
|
1084
|
+
className: n ? O.projectNavigationItemDisabled : O.projectNavigationItem,
|
1085
|
+
children: s || n || !t ? /* @__PURE__ */ a(
|
619
1086
|
"button",
|
620
1087
|
{
|
621
1088
|
type: "button",
|
622
1089
|
ref: c,
|
623
|
-
className:
|
624
|
-
[
|
1090
|
+
className: R(O.withNavLinkStyle, {
|
1091
|
+
[O.disabled]: n
|
625
1092
|
}),
|
626
1093
|
disabled: n,
|
627
|
-
onClick:
|
628
|
-
children: /* @__PURE__ */
|
1094
|
+
onClick: s,
|
1095
|
+
children: /* @__PURE__ */ a(yt, { label: e, badge: r, novel: i })
|
629
1096
|
}
|
630
|
-
) : /* @__PURE__ */
|
1097
|
+
) : /* @__PURE__ */ a("a", { href: t, className: O.withNavLinkStyle, children: /* @__PURE__ */ a(yt, { label: e, badge: r, novel: i }) })
|
631
1098
|
}
|
632
1099
|
) })
|
633
1100
|
);
|
634
|
-
|
635
|
-
const
|
636
|
-
var
|
637
|
-
return n.dropdown ? /* @__PURE__ */
|
1101
|
+
Oe.displayName = "NavigationTabsItem";
|
1102
|
+
const Ao = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, No = (e) => e.visible && (!e.dropdown || Ao(e.dropdown)), qa = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ a("nav", { "aria-label": "Project", children: /* @__PURE__ */ a("ul", { className: q.navigationTabList, "aria-orientation": "horizontal", children: e.filter(No).map((n) => {
|
1103
|
+
var r, s, i;
|
1104
|
+
return n.dropdown ? /* @__PURE__ */ a(
|
638
1105
|
"li",
|
639
1106
|
{
|
640
|
-
className:
|
1107
|
+
className: q.navigationTab,
|
641
1108
|
"data-testid": n.key,
|
642
|
-
"aria-selected": (
|
643
|
-
children: /* @__PURE__ */
|
644
|
-
|
1109
|
+
"aria-selected": (r = n.isActive) == null ? void 0 : r.call(n, t),
|
1110
|
+
children: /* @__PURE__ */ a(
|
1111
|
+
ae,
|
645
1112
|
{
|
646
|
-
menuButton: ({ opened: c }) => /* @__PURE__ */
|
647
|
-
children: /* @__PURE__ */
|
1113
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ a(Oe, { label: n.label, disabled: n.disabled, active: c }),
|
1114
|
+
children: /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(So, { items: n.dropdown }) })
|
648
1115
|
}
|
649
1116
|
)
|
650
1117
|
},
|
651
1118
|
n.key
|
652
|
-
) : /* @__PURE__ */
|
1119
|
+
) : /* @__PURE__ */ a(
|
653
1120
|
"li",
|
654
1121
|
{
|
655
|
-
className:
|
1122
|
+
className: q.navigationTab,
|
656
1123
|
"data-testid": n.key,
|
657
|
-
"aria-selected": (
|
658
|
-
children: /* @__PURE__ */
|
659
|
-
|
1124
|
+
"aria-selected": (s = n.isActive) == null ? void 0 : s.call(n, t),
|
1125
|
+
children: /* @__PURE__ */ a(
|
1126
|
+
Oe,
|
660
1127
|
{
|
661
1128
|
label: n.label,
|
662
1129
|
href: n.link,
|
@@ -664,484 +1131,640 @@ const _r = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
664
1131
|
disabled: n.disabled,
|
665
1132
|
badge: n.badge,
|
666
1133
|
novel: n.novel,
|
667
|
-
active: (
|
1134
|
+
active: (i = n.isActive) == null ? void 0 : i.call(n, t)
|
668
1135
|
}
|
669
1136
|
)
|
670
1137
|
},
|
671
1138
|
n.key
|
672
1139
|
);
|
673
|
-
}) }) })
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
}
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
1140
|
+
}) }) });
|
1141
|
+
class A {
|
1142
|
+
/**
|
1143
|
+
* This constructor is private to prevent the creation of a HeaderBuilder, it's an implementation detail
|
1144
|
+
* that users of this class should not be aware of. The only way to create a HeaderBuilder is through the
|
1145
|
+
* static create method.
|
1146
|
+
*
|
1147
|
+
* @private
|
1148
|
+
*/
|
1149
|
+
constructor(t) {
|
1150
|
+
this.factories = t;
|
1151
|
+
}
|
1152
|
+
static create(t = {}) {
|
1153
|
+
return new A([() => t]);
|
1154
|
+
}
|
1155
|
+
/**
|
1156
|
+
* Adds a single header to the builder by providing a key and a value.
|
1157
|
+
*
|
1158
|
+
* @example
|
1159
|
+
* ```typescript
|
1160
|
+
* const builder = HeaderBuilder.create()
|
1161
|
+
* .add('Content-Type', 'application/json')
|
1162
|
+
* .add('Authorization', 'Bearer token')
|
1163
|
+
*
|
1164
|
+
* const headers = await builder.resolve()
|
1165
|
+
* console.log(headers)
|
1166
|
+
* // { 'Content-Type': 'application/json', 'Authorization': 'Bearer token' }
|
1167
|
+
* ```
|
1168
|
+
*
|
1169
|
+
* @param key - The key of the header
|
1170
|
+
* @param value - The value of the header
|
1171
|
+
*/
|
1172
|
+
add(t, n) {
|
1173
|
+
return new A([...this.factories, () => ({ [t]: n })]);
|
1174
|
+
}
|
1175
|
+
/**
|
1176
|
+
* Adds multiple headers to the builder by providing an object or a promise of an object with the headers.
|
1177
|
+
*
|
1178
|
+
* @example
|
1179
|
+
* ```typescript
|
1180
|
+
* const builder = HeaderBuilder.create()
|
1181
|
+
* .and({ 'Content-Type': 'application/json', 'Authorization': 'Bearer token' })
|
1182
|
+
* .and(Promise.resolve({ 'X-Custom-Header': 'custom', 'X-Another-Header': 'another' }))
|
1183
|
+
*
|
1184
|
+
* const headers = await builder.resolve()
|
1185
|
+
* console.log(headers)
|
1186
|
+
* // Prints: {
|
1187
|
+
* // 'Content-Type': 'application/json',
|
1188
|
+
* // 'Authorization': 'Bearer token',
|
1189
|
+
* // 'X-Custom-Header': 'custom',
|
1190
|
+
* // 'X-Another-Header': 'another'
|
1191
|
+
* // }
|
1192
|
+
* ```
|
1193
|
+
*
|
1194
|
+
* @param extension - An object with the headers to add
|
1195
|
+
*/
|
1196
|
+
and(t) {
|
1197
|
+
return new A([...this.factories, () => t]);
|
1198
|
+
}
|
1199
|
+
/**
|
1200
|
+
* Adds a factory function that returns a promise of headers to the builder.
|
1201
|
+
* This is useful when you need to fetch some data asynchronously to build the headers.
|
1202
|
+
*
|
1203
|
+
* @example
|
1204
|
+
* ```typescript
|
1205
|
+
* const builder = HeaderBuilder.create()
|
1206
|
+
* .from(async () => {
|
1207
|
+
* const token = await fetchToken()
|
1208
|
+
* return { 'Authorization': `Bearer ${token}` }
|
1209
|
+
* })
|
1210
|
+
*
|
1211
|
+
* const headers = await builder.resolve()
|
1212
|
+
* console.log(headers) // { 'Authorization': 'Bearer <token>' }
|
1213
|
+
* ```
|
1214
|
+
*
|
1215
|
+
* @param factory - A function that returns a promise of headers
|
1216
|
+
*/
|
1217
|
+
from(t) {
|
1218
|
+
return new A([...this.factories, t]);
|
1219
|
+
}
|
1220
|
+
/**
|
1221
|
+
* Takes a middleware function that receives the current builder and returns a new, modified, builder.
|
1222
|
+
*
|
1223
|
+
* @example
|
1224
|
+
* ```typescript
|
1225
|
+
* const authMiddleware = createHeaderBuilderMiddleware(async (builder) => {
|
1226
|
+
* const token = await fetchToken()
|
1227
|
+
* return builder.add('Authorization', `Bearer ${token}`)
|
1228
|
+
* })
|
1229
|
+
*
|
1230
|
+
* const builder = HeaderBuilder.create()
|
1231
|
+
* .with(authMiddleware)
|
1232
|
+
*
|
1233
|
+
* const headers = await builder.resolve() // Type of headers is { 'Authorization': string }
|
1234
|
+
* console.log(headers) // { 'Authorization': 'Bearer <token>' }
|
1235
|
+
* ```
|
1236
|
+
*
|
1237
|
+
* @param middleware
|
1238
|
+
*/
|
1239
|
+
with(t) {
|
1240
|
+
return t.apply(this);
|
1241
|
+
}
|
1242
|
+
/**
|
1243
|
+
* Merges the current builder with another builder.
|
1244
|
+
*
|
1245
|
+
* @example
|
1246
|
+
* ```typescript
|
1247
|
+
* const builderA = HeaderBuilder.create()
|
1248
|
+
* .add('Content-Type', 'application/json')
|
1249
|
+
*
|
1250
|
+
* const builderB = HeaderBuilder.create()
|
1251
|
+
* .add('Authorization', 'Bearer token')
|
1252
|
+
*
|
1253
|
+
* const mergedBuilder = builderA.merge(builderB)
|
1254
|
+
*
|
1255
|
+
* const headers = await mergedBuilder.resolve()
|
1256
|
+
* console.log(headers)
|
1257
|
+
* // { 'Content-Type': 'application/json', 'Authorization': 'Bearer token' }
|
1258
|
+
* ```
|
1259
|
+
*
|
1260
|
+
* @param builder - The builder to merge with
|
1261
|
+
*/
|
1262
|
+
merge(t) {
|
1263
|
+
return new A([...this.factories, ...t.factories]);
|
1264
|
+
}
|
1265
|
+
/**
|
1266
|
+
* Resolves the headers by waiting for all the promises to resolve and merging them together.
|
1267
|
+
*
|
1268
|
+
* @example
|
1269
|
+
* ```typescript
|
1270
|
+
* const builder = HeaderBuilder.create()
|
1271
|
+
* .add('Content-Type', 'application/json')
|
1272
|
+
*
|
1273
|
+
* const headers = await builder.resolve()
|
1274
|
+
* console.log(headers) // { 'Content-Type': 'application/json' }
|
1275
|
+
*/
|
1276
|
+
async resolve() {
|
1277
|
+
const t = this.factories.map((r) => r()), n = await Promise.all(t);
|
1278
|
+
return Object.assign({}, ...n);
|
1279
|
+
}
|
1280
|
+
}
|
1281
|
+
class Ro {
|
1282
|
+
constructor(t) {
|
1283
|
+
this.middleware = t;
|
1284
|
+
}
|
1285
|
+
apply(t) {
|
1286
|
+
return t.from(async () => {
|
1287
|
+
const n = this.middleware(A.create());
|
1288
|
+
return n instanceof Promise ? n.then((r) => r.resolve()) : n.resolve();
|
1289
|
+
});
|
1290
|
+
}
|
1291
|
+
}
|
1292
|
+
function Gt(e) {
|
1293
|
+
return new Ro(e);
|
1294
|
+
}
|
1295
|
+
const Kt = o.union([
|
1296
|
+
o.literal("owner"),
|
1297
|
+
o.literal("admin"),
|
1298
|
+
o.literal("biller"),
|
1299
|
+
o.literal("member")
|
1300
|
+
]), jo = o.object({
|
1301
|
+
userId: o.number(),
|
1302
|
+
userUuid: o.string(),
|
1303
|
+
teamId: o.number(),
|
1304
|
+
userTeamRole: Kt,
|
1305
|
+
userEmail: o.string().email(),
|
1306
|
+
userName: o.string(),
|
1307
|
+
userCurrentTeamId: o.number(),
|
1308
|
+
planId: o.number(),
|
1309
|
+
planName: o.string(),
|
1310
|
+
isProviderAlpha: o.boolean(),
|
1311
|
+
isFullyAuthenticated: o.boolean(),
|
1312
|
+
exp: o.number()
|
705
1313
|
});
|
706
|
-
function
|
1314
|
+
function ie(e) {
|
707
1315
|
try {
|
708
1316
|
const t = e.split(".")[1], n = atob(t);
|
709
|
-
return
|
1317
|
+
return jo.parse(JSON.parse(n));
|
710
1318
|
} catch {
|
711
1319
|
return;
|
712
1320
|
}
|
713
1321
|
}
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
const a = await e.getCachedJwtToken();
|
721
|
-
if (a === void 0)
|
722
|
-
return t(n, o);
|
723
|
-
const s = await t(n, {
|
724
|
-
...o,
|
725
|
-
headers: { ...o.headers, ...F(a.accessToken) }
|
726
|
-
});
|
727
|
-
if (a && (s.status === 401 || s.status === 403)) {
|
728
|
-
const u = Q(a.accessToken);
|
729
|
-
if (!u)
|
730
|
-
return s;
|
731
|
-
const d = await B(e.authProviderWretchClient, Ie, {
|
732
|
-
pathParams: { teamId: u.teamId },
|
733
|
-
headers: F(a.refreshToken)
|
734
|
-
});
|
735
|
-
return await ((c = e.onNewJwtTokenIssued) == null ? void 0 : c.call(e, d)), t(n, {
|
736
|
-
...o,
|
737
|
-
headers: { ...o.headers, ...F(d.accessToken) }
|
738
|
-
});
|
739
|
-
}
|
740
|
-
return s;
|
741
|
-
};
|
1322
|
+
class Le extends Error {
|
1323
|
+
constructor() {
|
1324
|
+
super(...arguments);
|
1325
|
+
ee(this, "name", "UnauthorizedError");
|
1326
|
+
ee(this, "status", 401);
|
1327
|
+
}
|
742
1328
|
}
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
1329
|
+
const Wt = 1e3, xo = 60 * Wt;
|
1330
|
+
function Ha(e) {
|
1331
|
+
return Gt(async (t) => {
|
1332
|
+
var c, l;
|
1333
|
+
const n = e.getCurrentToken() ?? await ((c = e.generateNewToken) == null ? void 0 : c.call(e));
|
1334
|
+
if (!n)
|
1335
|
+
throw new Le();
|
1336
|
+
const { exp: r } = ie(n.accessToken) ?? { exp: 0 };
|
1337
|
+
if (!(r * Wt - Date.now() < xo))
|
1338
|
+
return t.add("Authorization", `Bearer ${n.accessToken}`);
|
1339
|
+
const i = await e.refreshToken(n);
|
1340
|
+
if (!i)
|
1341
|
+
throw new Le();
|
1342
|
+
return (l = e.onNewTokenIssued) == null || l.call(e, i), t.add("Authorization", `Bearer ${i.accessToken}`);
|
751
1343
|
});
|
752
1344
|
}
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
return he(document.cookie, "csrf_token");
|
760
|
-
}
|
761
|
-
function he(e, t) {
|
762
|
-
var n, o;
|
763
|
-
return (o = (n = e.split(";").find((a) => a.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : o.substring(t.length + 1);
|
764
|
-
}
|
765
|
-
function Io(e) {
|
766
|
-
return Tr({
|
767
|
-
authProviderWretchClient: e.authProviderWretchClient,
|
768
|
-
getCachedJwtToken: e.getCachedJwtToken ?? vr,
|
769
|
-
onNewJwtTokenIssued: e.onNewJwtTokenIssued
|
770
|
-
});
|
1345
|
+
const Ba = Gt(
|
1346
|
+
(e) => e.and({ "x-lokalise-plugin": "true" })
|
1347
|
+
);
|
1348
|
+
function Jt() {
|
1349
|
+
const e = Me(document.cookie, "accessToken"), t = Me(document.cookie, "refreshToken");
|
1350
|
+
return !e || !t ? null : { accessToken: e, refreshToken: t };
|
771
1351
|
}
|
772
|
-
function
|
773
|
-
return
|
1352
|
+
function Oo() {
|
1353
|
+
return Me(document.cookie, "csrf_token") ?? null;
|
774
1354
|
}
|
775
|
-
function
|
776
|
-
|
777
|
-
|
778
|
-
getCsrfToken: e.getCsrfToken ?? (async () => Et()),
|
779
|
-
getCachedJwtToken: e.getCachedJwtToken ?? (async () => Y()),
|
780
|
-
onNewJwtTokenIssued: e.onNewJwtTokenIssued,
|
781
|
-
getTeamId: e.getTeamId
|
782
|
-
};
|
783
|
-
return (n) => async (o, a) => {
|
784
|
-
var d;
|
785
|
-
if (await t.getCachedJwtToken() !== void 0)
|
786
|
-
return n(o, a);
|
787
|
-
const c = await t.getCsrfToken();
|
788
|
-
if (c === void 0)
|
789
|
-
return n(o, a);
|
790
|
-
const u = await B(t.authProviderWretchClient, Ie, {
|
791
|
-
pathParams: { teamId: await t.getTeamId() },
|
792
|
-
headers: { "x-csrf-token": c }
|
793
|
-
});
|
794
|
-
return await ((d = t.onNewJwtTokenIssued) == null ? void 0 : d.call(t, u)), n(o, {
|
795
|
-
...a,
|
796
|
-
headers: { ...a.headers, ...F(u.accessToken) }
|
797
|
-
});
|
798
|
-
};
|
1355
|
+
function Me(e, t) {
|
1356
|
+
var n, r;
|
1357
|
+
return (r = (n = e.split(";").find((s) => s.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : r.substring(t.length + 1);
|
799
1358
|
}
|
800
|
-
function
|
801
|
-
const e =
|
1359
|
+
function Da() {
|
1360
|
+
const e = Jt();
|
802
1361
|
if (!e)
|
803
1362
|
return;
|
804
|
-
const t =
|
1363
|
+
const t = ie(e.accessToken);
|
805
1364
|
if (t)
|
806
1365
|
return { ...e, payload: t };
|
807
1366
|
}
|
808
|
-
const
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
1367
|
+
const Qt = o.object({
|
1368
|
+
Authorization: o.string()
|
1369
|
+
}), Lo = o.object({
|
1370
|
+
"X-API-Token": o.string()
|
1371
|
+
}), Mo = o.union([
|
1372
|
+
Qt,
|
1373
|
+
Lo
|
1374
|
+
]), Uo = o.object({
|
1375
|
+
"X-Lokalise-Plugin": o.string()
|
1376
|
+
}), ce = Mo.and(Uo), qo = o.object({
|
1377
|
+
accessToken: o.string(),
|
1378
|
+
refreshToken: o.string()
|
1379
|
+
}), Ho = o.union([
|
1380
|
+
Qt,
|
1381
|
+
o.object({ "x-csrf-token": o.string() })
|
1382
|
+
]), $e = qe({
|
1383
|
+
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
1384
|
+
method: "post",
|
1385
|
+
requestPathParamsSchema: o.object({ teamId: o.number() }),
|
1386
|
+
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
1387
|
+
requestHeaderSchema: Ho,
|
1388
|
+
requestBodySchema: o.undefined(),
|
1389
|
+
isEmptyResponseExpected: !0,
|
1390
|
+
successResponseBodySchema: qo
|
1391
|
+
});
|
1392
|
+
function $a(e, t, n) {
|
1393
|
+
return async () => {
|
1394
|
+
const r = t();
|
1395
|
+
if (!r)
|
1396
|
+
throw new Le();
|
1397
|
+
return W(e, $e, {
|
1398
|
+
pathParams: { teamId: Number(await n()) },
|
1399
|
+
headers: await A.create().add("x-csrf-token", r).resolve()
|
1400
|
+
});
|
1401
|
+
};
|
1402
|
+
}
|
1403
|
+
function Fa(e, t) {
|
1404
|
+
return async ({ refreshToken: n }) => W(e, $e, {
|
1405
|
+
pathParams: { teamId: Number(await t()) },
|
1406
|
+
headers: await A.create().add("Authorization", `Bearer ${n}`).resolve()
|
1407
|
+
});
|
1408
|
+
}
|
1409
|
+
const Bo = {
|
1410
|
+
teamKey: (e) => ["getUserToken", e]
|
1411
|
+
}, Do = (e, t, n) => B({
|
1412
|
+
...n,
|
1413
|
+
queryFn: async ({ queryKey: [r, s] }) => W(e, $e, {
|
1414
|
+
headers: await t.resolve(),
|
1415
|
+
pathParams: { teamId: s }
|
816
1416
|
})
|
817
|
-
}),
|
1417
|
+
}), oe = class oe extends CustomEvent {
|
818
1418
|
constructor(t) {
|
819
|
-
super(
|
820
|
-
detail: { token: t, payload:
|
1419
|
+
super(oe.eventName, {
|
1420
|
+
detail: { token: t, payload: ie(t.accessToken) }
|
821
1421
|
});
|
822
1422
|
}
|
823
1423
|
};
|
824
|
-
|
825
|
-
let
|
826
|
-
function
|
827
|
-
const
|
828
|
-
queryKey:
|
829
|
-
enabled:
|
830
|
-
}),
|
831
|
-
return
|
832
|
-
|
833
|
-
}, [
|
1424
|
+
ee(oe, "eventName", "new-jwt-issued");
|
1425
|
+
let z = oe;
|
1426
|
+
function za(e, t, n) {
|
1427
|
+
const r = Oo(), s = Do(e, t.add("x-csrf-token", r ?? ""), {
|
1428
|
+
queryKey: Bo.teamKey(n),
|
1429
|
+
enabled: r !== void 0
|
1430
|
+
}), i = Et();
|
1431
|
+
return G(() => {
|
1432
|
+
s.data && s.data.accessToken !== i.current && (window.dispatchEvent(new z(s.data)), i.current = s.data.accessToken);
|
1433
|
+
}, [s.data]), s;
|
834
1434
|
}
|
835
|
-
function
|
836
|
-
const [e, t] =
|
837
|
-
return
|
838
|
-
const n = (
|
839
|
-
t(
|
840
|
-
},
|
841
|
-
return t(
|
842
|
-
window.removeEventListener(
|
1435
|
+
function Yt() {
|
1436
|
+
const [e, t] = N();
|
1437
|
+
return G(() => {
|
1438
|
+
const n = (s) => {
|
1439
|
+
t(s.detail.payload);
|
1440
|
+
}, r = Jt();
|
1441
|
+
return t(r ? ie(r.accessToken) : void 0), window.addEventListener(z.eventName, n), () => {
|
1442
|
+
window.removeEventListener(z.eventName, n);
|
843
1443
|
};
|
844
1444
|
}, []), e;
|
845
1445
|
}
|
846
|
-
const
|
847
|
-
user_id:
|
848
|
-
email:
|
849
|
-
fullname:
|
850
|
-
created_at:
|
851
|
-
created_at_timestamp:
|
852
|
-
role:
|
853
|
-
}),
|
854
|
-
team_id:
|
855
|
-
team_user:
|
856
|
-
}),
|
1446
|
+
const $o = ce, Fo = o.object({
|
1447
|
+
user_id: o.number(),
|
1448
|
+
email: o.string().email(),
|
1449
|
+
fullname: o.string(),
|
1450
|
+
created_at: o.string(),
|
1451
|
+
created_at_timestamp: o.number(),
|
1452
|
+
role: Kt
|
1453
|
+
}), zo = o.object({
|
1454
|
+
team_id: o.number(),
|
1455
|
+
team_user: Fo
|
1456
|
+
}), Go = Q({
|
857
1457
|
description: "Get the details of a team user",
|
858
|
-
|
1458
|
+
requestHeaderSchema: $o,
|
1459
|
+
requestPathParamsSchema: o.object({ teamId: o.number(), userId: o.number() }),
|
859
1460
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
860
|
-
successResponseBodySchema:
|
861
|
-
}),
|
1461
|
+
successResponseBodySchema: zo
|
1462
|
+
}), Ko = {
|
862
1463
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
863
|
-
},
|
864
|
-
...
|
865
|
-
queryFn: ({ queryKey: [
|
1464
|
+
}, Wo = (e, t, n) => B({
|
1465
|
+
...n,
|
1466
|
+
queryFn: async ({ queryKey: [r, s, i] }) => J(e, Go, {
|
1467
|
+
headers: await t.resolve(),
|
1468
|
+
pathParams: { teamId: s, userId: i }
|
1469
|
+
})
|
866
1470
|
});
|
867
|
-
function
|
868
|
-
const
|
869
|
-
return
|
870
|
-
queryKey:
|
871
|
-
enabled: (
|
1471
|
+
function Ga(e, t) {
|
1472
|
+
const n = Yt();
|
1473
|
+
return Wo(e, t, {
|
1474
|
+
queryKey: Ko.teamUserKey((n == null ? void 0 : n.teamId) ?? 0, (n == null ? void 0 : n.userId) ?? 0),
|
1475
|
+
enabled: (n == null ? void 0 : n.userId) !== void 0 && n.teamId !== void 0
|
872
1476
|
});
|
873
1477
|
}
|
874
|
-
const
|
875
|
-
lang_id:
|
876
|
-
lang_iso:
|
877
|
-
lang_name:
|
878
|
-
is_writable:
|
879
|
-
}),
|
880
|
-
user_id:
|
881
|
-
email:
|
882
|
-
fullname:
|
883
|
-
created_at:
|
884
|
-
created_at_timestamp:
|
885
|
-
admin_rights:
|
886
|
-
languages:
|
887
|
-
is_admin:
|
888
|
-
is_reviewer:
|
889
|
-
}),
|
890
|
-
project_id:
|
891
|
-
contributors:
|
892
|
-
}),
|
1478
|
+
const Jo = o.object({
|
1479
|
+
lang_id: o.number(),
|
1480
|
+
lang_iso: o.string(),
|
1481
|
+
lang_name: o.string(),
|
1482
|
+
is_writable: o.union([o.literal(0), o.literal(1)])
|
1483
|
+
}), Qo = o.object({
|
1484
|
+
user_id: o.number(),
|
1485
|
+
email: o.string().email(),
|
1486
|
+
fullname: o.string(),
|
1487
|
+
created_at: o.string(),
|
1488
|
+
created_at_timestamp: o.number(),
|
1489
|
+
admin_rights: o.array(o.string()),
|
1490
|
+
languages: o.array(Jo),
|
1491
|
+
is_admin: o.boolean(),
|
1492
|
+
is_reviewer: o.boolean()
|
1493
|
+
}), Yo = o.object({
|
1494
|
+
project_id: o.string(),
|
1495
|
+
contributors: o.array(Qo)
|
1496
|
+
}), Vo = Q({
|
893
1497
|
description: "Get the details of a project contributor",
|
894
|
-
|
1498
|
+
requestHeaderSchema: ce,
|
1499
|
+
requestPathParamsSchema: o.object({ projectId: o.string(), contributorId: o.number() }),
|
895
1500
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
896
|
-
successResponseBodySchema:
|
897
|
-
}),
|
1501
|
+
successResponseBodySchema: Yo
|
1502
|
+
}), Xo = {
|
898
1503
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
899
|
-
},
|
900
|
-
...
|
901
|
-
queryFn: ({ queryKey: [
|
902
|
-
pathParams: { projectId:
|
1504
|
+
}, Zo = (e, t, n) => B({
|
1505
|
+
...n,
|
1506
|
+
queryFn: async ({ queryKey: [r, s, i] }) => J(e, Vo, {
|
1507
|
+
pathParams: { projectId: s, contributorId: i },
|
1508
|
+
headers: await t.resolve()
|
903
1509
|
})
|
904
1510
|
});
|
905
|
-
function
|
906
|
-
const
|
907
|
-
return
|
908
|
-
queryKey:
|
909
|
-
enabled:
|
1511
|
+
function Ka(e, t, n) {
|
1512
|
+
const r = Yt();
|
1513
|
+
return Zo(e, t, {
|
1514
|
+
queryKey: Xo.projectUserKey(n, (r == null ? void 0 : r.userId) ?? 0),
|
1515
|
+
enabled: r !== void 0
|
910
1516
|
});
|
911
1517
|
}
|
912
|
-
const
|
913
|
-
lang_iso:
|
914
|
-
custom_iso:
|
915
|
-
}),
|
916
|
-
language_id:
|
917
|
-
language_iso:
|
918
|
-
progress:
|
919
|
-
words_to_do:
|
920
|
-
}),
|
921
|
-
projectId:
|
922
|
-
}),
|
923
|
-
lang_id:
|
924
|
-
lang_iso:
|
925
|
-
lang_name:
|
926
|
-
is_rtl:
|
927
|
-
plural_forms:
|
928
|
-
}),
|
929
|
-
project_id:
|
930
|
-
project_uuid:
|
931
|
-
languages:
|
932
|
-
}),
|
1518
|
+
const ea = o.object({
|
1519
|
+
lang_iso: o.string(),
|
1520
|
+
custom_iso: o.string().optional()
|
1521
|
+
}), ta = o.object({
|
1522
|
+
language_id: o.number(),
|
1523
|
+
language_iso: o.string(),
|
1524
|
+
progress: o.number(),
|
1525
|
+
words_to_do: o.number()
|
1526
|
+
}), na = o.object({
|
1527
|
+
projectId: o.string()
|
1528
|
+
}), ra = o.object({
|
1529
|
+
lang_id: o.number(),
|
1530
|
+
lang_iso: o.string(),
|
1531
|
+
lang_name: o.string(),
|
1532
|
+
is_rtl: o.boolean(),
|
1533
|
+
plural_forms: o.array(o.string().optional())
|
1534
|
+
}), oa = o.object({
|
1535
|
+
project_id: o.string(),
|
1536
|
+
project_uuid: o.string().uuid(),
|
1537
|
+
languages: o.array(ra)
|
1538
|
+
}), aa = Q({
|
933
1539
|
description: "List of project languages",
|
934
|
-
|
1540
|
+
requestHeaderSchema: ce,
|
1541
|
+
requestPathParamsSchema: na,
|
935
1542
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
936
|
-
successResponseBodySchema:
|
937
|
-
}),
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
]),
|
942
|
-
per_platform_key_names:
|
943
|
-
reviewing:
|
944
|
-
auto_toggle_unverified:
|
945
|
-
offline_translation:
|
946
|
-
key_editing:
|
947
|
-
inline_machine_translations:
|
948
|
-
custom_translation_statuses:
|
949
|
-
custom_translation_statuses_allow_multiple:
|
950
|
-
segmentation:
|
951
|
-
contributor_preview_download_enabled:
|
952
|
-
}),
|
953
|
-
not_reviewed:
|
954
|
-
unverified:
|
955
|
-
spelling_grammar:
|
956
|
-
inconsistent_placeholders:
|
957
|
-
inconsistent_html:
|
958
|
-
different_number_of_urls:
|
959
|
-
different_urls:
|
960
|
-
leading_whitespace:
|
961
|
-
trailing_whitespace:
|
962
|
-
different_number_of_email_address:
|
963
|
-
different_email_address:
|
964
|
-
different_brackets:
|
965
|
-
different_numbers:
|
966
|
-
double_space:
|
967
|
-
special_placeholder:
|
968
|
-
unbalanced_brackets:
|
969
|
-
}),
|
970
|
-
progress_total:
|
971
|
-
keys_total:
|
972
|
-
team:
|
973
|
-
base_words:
|
974
|
-
qa_issues_total:
|
975
|
-
qa_issues:
|
976
|
-
languages:
|
977
|
-
}),
|
978
|
-
project_id:
|
979
|
-
uuid:
|
980
|
-
project_type:
|
981
|
-
name:
|
982
|
-
description:
|
983
|
-
created_at:
|
984
|
-
created_at_timestamp:
|
985
|
-
created_by:
|
986
|
-
created_by_email:
|
987
|
-
team_id:
|
988
|
-
base_language_id:
|
989
|
-
base_language_iso:
|
990
|
-
settings:
|
991
|
-
statistics:
|
992
|
-
}),
|
993
|
-
name:
|
994
|
-
team_id:
|
995
|
-
base_lang_iso:
|
996
|
-
languages:
|
997
|
-
project_type:
|
998
|
-
is_segmentation_enabled:
|
999
|
-
}),
|
1000
|
-
filter_type:
|
1001
|
-
filter_team_id:
|
1002
|
-
filter_names:
|
1003
|
-
include_statistics:
|
1004
|
-
include_settings:
|
1005
|
-
limit:
|
1006
|
-
page:
|
1007
|
-
}),
|
1008
|
-
projects:
|
1009
|
-
}),
|
1010
|
-
project_id:
|
1011
|
-
}),
|
1012
|
-
project_id:
|
1013
|
-
}),
|
1014
|
-
name:
|
1015
|
-
description:
|
1016
|
-
}),
|
1543
|
+
successResponseBodySchema: oa
|
1544
|
+
}), le = ce, Fe = o.union([
|
1545
|
+
o.literal("localization_files"),
|
1546
|
+
o.literal("paged_documents"),
|
1547
|
+
o.literal("marketing")
|
1548
|
+
]), sa = o.object({
|
1549
|
+
per_platform_key_names: o.boolean(),
|
1550
|
+
reviewing: o.boolean(),
|
1551
|
+
auto_toggle_unverified: o.boolean(),
|
1552
|
+
offline_translation: o.boolean(),
|
1553
|
+
key_editing: o.boolean(),
|
1554
|
+
inline_machine_translations: o.boolean(),
|
1555
|
+
custom_translation_statuses: o.boolean(),
|
1556
|
+
custom_translation_statuses_allow_multiple: o.boolean(),
|
1557
|
+
segmentation: o.boolean(),
|
1558
|
+
contributor_preview_download_enabled: o.boolean()
|
1559
|
+
}), ia = o.object({
|
1560
|
+
not_reviewed: o.number(),
|
1561
|
+
unverified: o.number(),
|
1562
|
+
spelling_grammar: o.number(),
|
1563
|
+
inconsistent_placeholders: o.number(),
|
1564
|
+
inconsistent_html: o.number(),
|
1565
|
+
different_number_of_urls: o.number(),
|
1566
|
+
different_urls: o.number(),
|
1567
|
+
leading_whitespace: o.number(),
|
1568
|
+
trailing_whitespace: o.number(),
|
1569
|
+
different_number_of_email_address: o.number(),
|
1570
|
+
different_email_address: o.number(),
|
1571
|
+
different_brackets: o.number(),
|
1572
|
+
different_numbers: o.number(),
|
1573
|
+
double_space: o.number(),
|
1574
|
+
special_placeholder: o.number(),
|
1575
|
+
unbalanced_brackets: o.number()
|
1576
|
+
}), ca = o.object({
|
1577
|
+
progress_total: o.number(),
|
1578
|
+
keys_total: o.number(),
|
1579
|
+
team: o.number(),
|
1580
|
+
base_words: o.number(),
|
1581
|
+
qa_issues_total: o.number(),
|
1582
|
+
qa_issues: ia,
|
1583
|
+
languages: o.array(ta)
|
1584
|
+
}), de = o.object({
|
1585
|
+
project_id: o.string(),
|
1586
|
+
uuid: o.string().uuid(),
|
1587
|
+
project_type: Fe,
|
1588
|
+
name: o.string(),
|
1589
|
+
description: o.string(),
|
1590
|
+
created_at: o.string(),
|
1591
|
+
created_at_timestamp: o.number(),
|
1592
|
+
created_by: o.number(),
|
1593
|
+
created_by_email: o.string(),
|
1594
|
+
team_id: o.number(),
|
1595
|
+
base_language_id: o.number(),
|
1596
|
+
base_language_iso: o.string(),
|
1597
|
+
settings: sa.optional(),
|
1598
|
+
statistics: ca.optional()
|
1599
|
+
}), la = o.object({
|
1600
|
+
name: o.string(),
|
1601
|
+
team_id: o.string(),
|
1602
|
+
base_lang_iso: o.string(),
|
1603
|
+
languages: o.array(ea),
|
1604
|
+
project_type: Fe,
|
1605
|
+
is_segmentation_enabled: o.boolean()
|
1606
|
+
}), St = o.union([o.literal(0), o.literal(1)]), da = o.object({
|
1607
|
+
filter_type: Fe.optional(),
|
1608
|
+
filter_team_id: o.number().optional(),
|
1609
|
+
filter_names: o.string().optional(),
|
1610
|
+
include_statistics: St.optional(),
|
1611
|
+
include_settings: St.optional(),
|
1612
|
+
limit: o.number().optional(),
|
1613
|
+
page: o.number().optional()
|
1614
|
+
}), ua = o.object({
|
1615
|
+
projects: o.array(de)
|
1616
|
+
}), ma = o.object({
|
1617
|
+
project_id: o.string()
|
1618
|
+
}), fa = o.object({
|
1619
|
+
project_id: o.string()
|
1620
|
+
}), _a = o.object({
|
1621
|
+
name: o.string().min(1),
|
1622
|
+
description: o.string().optional()
|
1623
|
+
}), ue = () => "/projects", ga = qe({
|
1017
1624
|
description: "Create a new project",
|
1625
|
+
requestHeaderSchema: le,
|
1018
1626
|
method: "post",
|
1019
|
-
pathResolver:
|
1020
|
-
requestBodySchema:
|
1021
|
-
successResponseBodySchema:
|
1022
|
-
}),
|
1627
|
+
pathResolver: ue,
|
1628
|
+
requestBodySchema: la,
|
1629
|
+
successResponseBodySchema: de
|
1630
|
+
}), ha = Q({
|
1023
1631
|
description: "List all projects",
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1632
|
+
requestHeaderSchema: le,
|
1633
|
+
pathResolver: ue,
|
1634
|
+
requestQuerySchema: da,
|
1635
|
+
successResponseBodySchema: ua
|
1636
|
+
}), pa = Q({
|
1028
1637
|
description: "Retrieve a project",
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1638
|
+
requestHeaderSchema: le,
|
1639
|
+
requestPathParamsSchema: ma,
|
1640
|
+
pathResolver: ({ project_id: e }) => `${ue()}/${e}`,
|
1641
|
+
successResponseBodySchema: de
|
1642
|
+
}), ba = qe({
|
1033
1643
|
description: "Update a project",
|
1644
|
+
requestHeaderSchema: le,
|
1034
1645
|
method: "put",
|
1035
|
-
requestPathParamsSchema:
|
1036
|
-
pathResolver: ({ project_id: e }) => `${
|
1037
|
-
requestBodySchema:
|
1038
|
-
successResponseBodySchema:
|
1646
|
+
requestPathParamsSchema: fa,
|
1647
|
+
pathResolver: ({ project_id: e }) => `${ue()}/${e}`,
|
1648
|
+
requestBodySchema: _a,
|
1649
|
+
successResponseBodySchema: de
|
1039
1650
|
});
|
1040
|
-
function
|
1041
|
-
return
|
1042
|
-
...
|
1043
|
-
mutationFn: (
|
1044
|
-
|
1651
|
+
function Wa(e, t, n = {}) {
|
1652
|
+
return Nt({
|
1653
|
+
...n,
|
1654
|
+
mutationFn: async (r) => W(e, ga, {
|
1655
|
+
headers: await t.resolve(),
|
1656
|
+
body: r
|
1045
1657
|
})
|
1046
1658
|
});
|
1047
1659
|
}
|
1048
|
-
const
|
1660
|
+
const Ja = {
|
1049
1661
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1050
1662
|
};
|
1051
|
-
function
|
1052
|
-
return
|
1053
|
-
...
|
1054
|
-
queryFn: ({ queryKey: [
|
1055
|
-
|
1663
|
+
function Qa(e, t, n) {
|
1664
|
+
return B({
|
1665
|
+
...n,
|
1666
|
+
queryFn: async ({ queryKey: [r, s] }) => J(e, aa, {
|
1667
|
+
headers: await t.resolve(),
|
1668
|
+
pathParams: { projectId: s }
|
1056
1669
|
})
|
1057
1670
|
});
|
1058
1671
|
}
|
1059
|
-
const
|
1672
|
+
const Ya = {
|
1060
1673
|
paramsKey: (e) => ["listProjects", e]
|
1061
1674
|
};
|
1062
|
-
function
|
1063
|
-
return
|
1064
|
-
...
|
1065
|
-
queryFn: ({ queryKey: [
|
1066
|
-
|
1675
|
+
function Va(e, t, n) {
|
1676
|
+
return B({
|
1677
|
+
...n,
|
1678
|
+
queryFn: async ({ queryKey: [r, s] }) => J(e, ha, {
|
1679
|
+
headers: await t.resolve(),
|
1680
|
+
queryParams: s
|
1067
1681
|
})
|
1068
1682
|
});
|
1069
1683
|
}
|
1070
|
-
const
|
1684
|
+
const Xa = {
|
1071
1685
|
projectIdKey: (e) => ["retrieveProject", e]
|
1072
1686
|
};
|
1073
|
-
function
|
1074
|
-
return
|
1075
|
-
...
|
1076
|
-
queryFn: ({ queryKey: [
|
1077
|
-
|
1687
|
+
function Za(e, t, n) {
|
1688
|
+
return B({
|
1689
|
+
...n,
|
1690
|
+
queryFn: async ({ queryKey: [r, s] }) => J(e, pa, {
|
1691
|
+
headers: await t.resolve(),
|
1692
|
+
pathParams: { project_id: s }
|
1078
1693
|
})
|
1079
1694
|
});
|
1080
1695
|
}
|
1081
|
-
function
|
1082
|
-
return
|
1083
|
-
...
|
1084
|
-
mutationFn: (
|
1085
|
-
|
1086
|
-
|
1696
|
+
function es(e, t, n, r = {}) {
|
1697
|
+
return Nt({
|
1698
|
+
...r,
|
1699
|
+
mutationFn: async (s) => W(e, ba, {
|
1700
|
+
headers: await t.resolve(),
|
1701
|
+
body: s,
|
1702
|
+
pathParams: n
|
1087
1703
|
})
|
1088
1704
|
});
|
1089
1705
|
}
|
1090
1706
|
export {
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1707
|
+
Ua as Breadcrumbs,
|
1708
|
+
Ht as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1709
|
+
cr as ENTERPRISE_PLAN_IDS,
|
1710
|
+
sr as ESSENTIAL_PLAN_IDS,
|
1711
|
+
qt as FREE_PLAN_ID,
|
1712
|
+
A as HeaderBuilder,
|
1713
|
+
Ha as JwtAuthHeaderBuilderMiddleware,
|
1714
|
+
re as NavigationPanel,
|
1715
|
+
qa as NavigationTabs,
|
1716
|
+
ir as PRO_PLAN_IDS,
|
1717
|
+
Ba as PublicApiHeaderBuilderMiddleware,
|
1718
|
+
ar as START_PLAN_IDS,
|
1719
|
+
I as Sidebar,
|
1720
|
+
P as SidebarTaskLanguageStatuses,
|
1721
|
+
xe as SidebarTaskStatuses,
|
1722
|
+
te as SidebarTaskTypeOptions,
|
1723
|
+
or as TRIAL_PLAN_ID,
|
1724
|
+
ur as convertNewLineToBreakTag,
|
1725
|
+
Gt as createHeaderBuilderMiddleware,
|
1726
|
+
ga as createProject,
|
1727
|
+
gr as formatDate,
|
1728
|
+
Ma as formatDateTz,
|
1729
|
+
$a as generateTokenFromClassicSession,
|
1730
|
+
Da as getAuthenticatedSessionDetailFromRequest,
|
1731
|
+
Oo as getCsrfTokenFromCookie,
|
1732
|
+
Jt as getJwtTokenFromCookie,
|
1733
|
+
Go as getTeamUser,
|
1734
|
+
Ko as getTeamUsersQueryKey,
|
1735
|
+
$e as getUserToken,
|
1736
|
+
Bo as getUserTokenKey,
|
1737
|
+
La as isEnterpriseOpenSourcePlan,
|
1738
|
+
xa as isEnterprisePlan,
|
1739
|
+
Ra as isEssentialPlan,
|
1740
|
+
Be as isFreePlan,
|
1741
|
+
Oa as isPaidPlan,
|
1742
|
+
ja as isProPlan,
|
1743
|
+
Na as isStartPlan,
|
1744
|
+
Bt as isTrialPlan,
|
1745
|
+
aa as listProjectLanguages,
|
1746
|
+
Ja as listProjectLanguagesKey,
|
1747
|
+
ha as listProjects,
|
1748
|
+
Ya as listProjectsKey,
|
1749
|
+
_r as makeUrlClickable,
|
1750
|
+
ie as parseJwtTokenPayload,
|
1751
|
+
Fa as refreshExpiredToken,
|
1752
|
+
Vo as retrieveContributor,
|
1753
|
+
Xo as retrieveContributorKeys,
|
1754
|
+
pa as retrieveProject,
|
1755
|
+
Xa as retrieveProjectQueryKey,
|
1756
|
+
ba as updateProject,
|
1757
|
+
Ka as useAuthenticatedProjectContributor,
|
1758
|
+
Yt as useAuthenticatedSessionPayload,
|
1759
|
+
Ga as useAuthenticatedUser,
|
1760
|
+
Wa as useCreateProjectMutation,
|
1761
|
+
De as useEffectOnce,
|
1762
|
+
za as useGetPromotedClassicSessionJwtQuery,
|
1763
|
+
Wo as useGetTeamUsersQuery,
|
1764
|
+
Do as useGetUserTokenQuery,
|
1765
|
+
Qa as useListProjectLanguagesQuery,
|
1766
|
+
Va as useListProjectsQuery,
|
1767
|
+
Zo as useRetrieveContributorQuery,
|
1768
|
+
Za as useRetrieveProjectQuery,
|
1769
|
+
es as useUpdateProjectMutation
|
1147
1770
|
};
|