@burdenoff/microfe-store 2026.801.1 → 2026.805.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.
|
@@ -3,16 +3,16 @@ import { useCallback as t, useEffect as n, useReducer as r, useState as i } from
|
|
|
3
3
|
import { AlertCircle as a, ArrowLeft as o, Building2 as s, CheckCircle as c, ChevronRight as l, Info as u, Loader2 as d, ShieldCheck as f } from "lucide-react";
|
|
4
4
|
import { graphqlFetch as p } from "@burdenoff/fe-libs/shared/graphql";
|
|
5
5
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
|
-
import { Dialog as _, DialogContent as v, DialogDescription as
|
|
6
|
+
import { Dialog as _, DialogContent as v, DialogDescription as y, DialogFooter as b, DialogHeader as x, DialogTitle as ee } from "@burdenoff/fe-libs/ui";
|
|
7
7
|
//#region src/components/InstallAppModal.tsx
|
|
8
|
-
var S = "query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }", C = "mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }", w = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }", T = "mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String
|
|
8
|
+
var S = "query MyWorkspaces { myWorkspaces { items { id name slug type status organizationId } total } }", C = "mutation InstallWorkspaceApps($workspaceIds: [ID!]!, $input: InstallWorkspaceAppInput!) { installWorkspaceApps(workspaceIds: $workspaceIds, input: $input) { successCount failedCount results { success workspaceId error } } }", w = "mutation RecordAppInstallation($input: RecordAppInstallationInput!) { recordAppInstallation(input: $input) { id status workspaceId version } }", T = "mutation InstallPurchasedApp($orderId: ID, $productId: String!, $workspaceId: String!, $version: String) { installPurchasedApp(orderId: $orderId, productId: $productId, workspaceId: $workspaceId, version: $version) { success alreadyInstalled installation { id productId workspaceId status version } error message } }", te = "mutation CreateProductEntitlement($input: CreateProductEntitlementInput!) { createProductEntitlement(input: $input) { id status productId workspaceId } }", ne = "mutation InstallAppDevportal($input: InstallAppInput!) { installApp(input: $input) { id status workspaceId application { oauthAuthUrl } } }", E = "query InstallableApplicationVersions($applicationId: ID!) { installableApplicationVersions(applicationId: $applicationId) { version status isLatest } }", D = new Set([
|
|
9
9
|
"VIBEMODULE",
|
|
10
10
|
"NODE",
|
|
11
11
|
"CONSOLE",
|
|
12
12
|
"DASHBOARD",
|
|
13
13
|
"PARSER",
|
|
14
14
|
"DATASINK"
|
|
15
|
-
]),
|
|
15
|
+
]), O = new Set(["INTEGRATION", "API_INTEGRATION"]), k = {
|
|
16
16
|
ALREADY_INSTALLED: "This app is already installed in the selected workspace.",
|
|
17
17
|
QUOTA_EXCEEDED: "Installation limit reached. Please upgrade your plan or contact support.",
|
|
18
18
|
PERMISSION_DENIED: "You do not have permission to install apps in this workspace.",
|
|
@@ -21,24 +21,29 @@ var S = "query MyWorkspaces { myWorkspaces { items { id name slug type status or
|
|
|
21
21
|
ENTITLEMENT_EXPIRED: "Your license for this app has expired.",
|
|
22
22
|
UNSUPPORTED_TYPE: "This product type cannot be installed in the selected workspace."
|
|
23
23
|
};
|
|
24
|
-
function
|
|
25
|
-
for (let [t, n] of Object.entries(
|
|
24
|
+
function A(e) {
|
|
25
|
+
for (let [t, n] of Object.entries(k)) if (e.toUpperCase().includes(t)) return n;
|
|
26
26
|
return "Installation failed. Please try again or contact support.";
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var j = {
|
|
29
29
|
step: "workspace",
|
|
30
30
|
selectedWorkspace: null,
|
|
31
|
+
selectedVersion: "",
|
|
31
32
|
installing: !1,
|
|
32
33
|
installError: null,
|
|
33
34
|
installInfo: null
|
|
34
35
|
};
|
|
35
|
-
function
|
|
36
|
+
function M(e, t) {
|
|
36
37
|
switch (t.type) {
|
|
37
|
-
case "reset": return
|
|
38
|
+
case "reset": return j;
|
|
38
39
|
case "selectWorkspace": return {
|
|
39
40
|
...e,
|
|
40
41
|
selectedWorkspace: t.workspaceId
|
|
41
42
|
};
|
|
43
|
+
case "selectVersion": return {
|
|
44
|
+
...e,
|
|
45
|
+
selectedVersion: t.version
|
|
46
|
+
};
|
|
42
47
|
case "advanceToConsent": return {
|
|
43
48
|
...e,
|
|
44
49
|
step: "consent",
|
|
@@ -70,7 +75,7 @@ function N(e, t) {
|
|
|
70
75
|
default: return e;
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
|
-
function
|
|
78
|
+
function N(r) {
|
|
74
79
|
let { authToken: a } = e(), [o, s] = i([]), [c, l] = i(!1), [u, d] = i(null), f = t(async () => {
|
|
75
80
|
if (!r) {
|
|
76
81
|
l(!0), d(null);
|
|
@@ -98,23 +103,60 @@ function P(r) {
|
|
|
98
103
|
refetch: f
|
|
99
104
|
};
|
|
100
105
|
}
|
|
101
|
-
|
|
102
|
-
let { authToken:
|
|
106
|
+
function P(t, r) {
|
|
107
|
+
let { authToken: a } = e(), [o, s] = i([]), [c, l] = i(!1);
|
|
108
|
+
return n(() => {
|
|
109
|
+
if (r || !t) {
|
|
110
|
+
s([]);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
let e = !1;
|
|
114
|
+
return l(!0), p({
|
|
115
|
+
gateway: "global",
|
|
116
|
+
query: E,
|
|
117
|
+
variables: { applicationId: t },
|
|
118
|
+
authToken: a || void 0
|
|
119
|
+
}).then((t) => {
|
|
120
|
+
if (!e) {
|
|
121
|
+
if (t.errors?.length) {
|
|
122
|
+
s([]);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
s(t.data?.installableApplicationVersions ?? []);
|
|
126
|
+
}
|
|
127
|
+
}).catch(() => {
|
|
128
|
+
e || s([]);
|
|
129
|
+
}).finally(() => {
|
|
130
|
+
e || l(!1);
|
|
131
|
+
}), () => {
|
|
132
|
+
e = !0;
|
|
133
|
+
};
|
|
134
|
+
}, [
|
|
135
|
+
t,
|
|
136
|
+
a,
|
|
137
|
+
r
|
|
138
|
+
]), {
|
|
139
|
+
versions: o,
|
|
140
|
+
loading: c
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
var F = ({ isOpen: t, onClose: i, app: S, orderId: E, purchaseState: k = "free", onInstallSuccess: F, onInstallError: I }) => {
|
|
144
|
+
let { authToken: L, user: re } = e(), [ie, R] = r(M, j), { step: z, selectedWorkspace: B, selectedVersion: V, installing: H, installError: U, installInfo: W } = ie, G = S.type?.toUpperCase() ?? "", K = O.has(G), q = D.has(G), { workspaces: J, loading: ae, error: Y } = N(!t), { versions: X } = P(S.applicationId, !t || !q);
|
|
103
145
|
n(() => {
|
|
104
|
-
t ||
|
|
146
|
+
t || R({ type: "reset" });
|
|
105
147
|
}, [t]);
|
|
106
|
-
let Z = J.filter((e) => e.status === "ACTIVE"),
|
|
107
|
-
if (!
|
|
108
|
-
let e = Z.find((e) => e.id ===
|
|
148
|
+
let Z = J.filter((e) => e.status === "ACTIVE"), oe = async () => {
|
|
149
|
+
if (!B) return;
|
|
150
|
+
let e = Z.find((e) => e.id === B);
|
|
109
151
|
if (!e) return;
|
|
110
|
-
let t =
|
|
111
|
-
|
|
152
|
+
let t = re?.id;
|
|
153
|
+
R({ type: "startInstall" });
|
|
112
154
|
try {
|
|
113
|
-
if (!
|
|
155
|
+
if (!E && k !== "purchased") {
|
|
114
156
|
if (!t) throw Error("Unable to identify the current user for license creation");
|
|
115
157
|
await p({
|
|
116
158
|
gateway: "global",
|
|
117
|
-
query:
|
|
159
|
+
query: te,
|
|
118
160
|
variables: { input: {
|
|
119
161
|
productId: S.id,
|
|
120
162
|
purchasedBy: t,
|
|
@@ -124,46 +166,47 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
124
166
|
productType: S.type
|
|
125
167
|
}
|
|
126
168
|
} },
|
|
127
|
-
authToken:
|
|
169
|
+
authToken: L || void 0
|
|
128
170
|
});
|
|
129
171
|
}
|
|
130
172
|
let n = await p({
|
|
131
173
|
gateway: "global",
|
|
132
174
|
query: T,
|
|
133
175
|
variables: {
|
|
134
|
-
orderId:
|
|
176
|
+
orderId: E ?? null,
|
|
135
177
|
productId: S.id,
|
|
136
|
-
workspaceId: e.id
|
|
178
|
+
workspaceId: e.id,
|
|
179
|
+
version: V || void 0
|
|
137
180
|
},
|
|
138
|
-
authToken:
|
|
181
|
+
authToken: L || void 0
|
|
139
182
|
});
|
|
140
183
|
if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Installation failed");
|
|
141
184
|
let r = n.data?.installPurchasedApp;
|
|
142
|
-
if (r?.success) r.alreadyInstalled ?
|
|
185
|
+
if (r?.success) r.alreadyInstalled ? R({
|
|
143
186
|
type: "setInfo",
|
|
144
187
|
info: r.message || "Already installed on this workspace"
|
|
145
|
-
}) : (
|
|
188
|
+
}) : (F?.(e.id, e.name), i());
|
|
146
189
|
else {
|
|
147
190
|
let e = r?.error || "Installation failed";
|
|
148
|
-
|
|
191
|
+
R({
|
|
149
192
|
type: "setError",
|
|
150
|
-
error:
|
|
151
|
-
}),
|
|
193
|
+
error: A(e)
|
|
194
|
+
}), I?.(Error(e));
|
|
152
195
|
}
|
|
153
196
|
} catch (e) {
|
|
154
197
|
let t = e instanceof Error ? e.message : "Installation failed";
|
|
155
|
-
|
|
198
|
+
R({
|
|
156
199
|
type: "setError",
|
|
157
|
-
error:
|
|
158
|
-
}),
|
|
200
|
+
error: A(t)
|
|
201
|
+
}), I?.(Error(t));
|
|
159
202
|
} finally {
|
|
160
|
-
|
|
203
|
+
R({ type: "finishInstall" });
|
|
161
204
|
}
|
|
162
|
-
},
|
|
163
|
-
if (!
|
|
164
|
-
let e = Z.find((e) => e.id ===
|
|
205
|
+
}, se = async () => {
|
|
206
|
+
if (!B) return;
|
|
207
|
+
let e = Z.find((e) => e.id === B);
|
|
165
208
|
if (e) {
|
|
166
|
-
|
|
209
|
+
R({ type: "startInstall" });
|
|
167
210
|
try {
|
|
168
211
|
let t = await p({
|
|
169
212
|
gateway: "workspace",
|
|
@@ -181,7 +224,7 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
181
224
|
}
|
|
182
225
|
}
|
|
183
226
|
},
|
|
184
|
-
authToken:
|
|
227
|
+
authToken: L || void 0,
|
|
185
228
|
workspaceId: e.id,
|
|
186
229
|
workspaceToken: !0
|
|
187
230
|
});
|
|
@@ -207,45 +250,45 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
207
250
|
type: S.type
|
|
208
251
|
}
|
|
209
252
|
} },
|
|
210
|
-
authToken:
|
|
253
|
+
authToken: L || void 0
|
|
211
254
|
});
|
|
212
255
|
} catch {}
|
|
213
|
-
|
|
256
|
+
F?.(e.id, e.name), i();
|
|
214
257
|
} else {
|
|
215
258
|
let e = n?.results?.[0]?.error || "Installation failed";
|
|
216
|
-
|
|
259
|
+
R({
|
|
217
260
|
type: "setError",
|
|
218
|
-
error:
|
|
219
|
-
}),
|
|
261
|
+
error: A(e)
|
|
262
|
+
}), I?.(Error(e));
|
|
220
263
|
}
|
|
221
264
|
} catch (e) {
|
|
222
265
|
let t = e instanceof Error ? e.message : "Installation failed";
|
|
223
|
-
|
|
266
|
+
R({
|
|
224
267
|
type: "setError",
|
|
225
|
-
error:
|
|
226
|
-
}),
|
|
268
|
+
error: A(t)
|
|
269
|
+
}), I?.(Error(t));
|
|
227
270
|
} finally {
|
|
228
|
-
|
|
271
|
+
R({ type: "finishInstall" });
|
|
229
272
|
}
|
|
230
273
|
}
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
if (!
|
|
235
|
-
let e = Z.find((e) => e.id ===
|
|
274
|
+
}, ce = () => {
|
|
275
|
+
K ? R({ type: "advanceToConsent" }) : Q();
|
|
276
|
+
}, le = async () => {
|
|
277
|
+
if (!B) return;
|
|
278
|
+
let e = Z.find((e) => e.id === B);
|
|
236
279
|
if (e) {
|
|
237
|
-
|
|
280
|
+
R({ type: "startInstall" });
|
|
238
281
|
try {
|
|
239
282
|
let t = await p({
|
|
240
283
|
gateway: "global",
|
|
241
|
-
query:
|
|
284
|
+
query: ne,
|
|
242
285
|
variables: { input: {
|
|
243
286
|
applicationId: S.applicationId ?? S.id,
|
|
244
287
|
scope: "WORKSPACE",
|
|
245
288
|
workspaceId: e.id,
|
|
246
289
|
consentedPermissions: S.permissions ?? []
|
|
247
290
|
} },
|
|
248
|
-
authToken:
|
|
291
|
+
authToken: L || void 0
|
|
249
292
|
});
|
|
250
293
|
if (t.errors?.length) throw Error(t.errors[0]?.message ?? "Installation failed");
|
|
251
294
|
let n = t.data?.installApp;
|
|
@@ -271,31 +314,31 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
271
314
|
installationId: n.id
|
|
272
315
|
}
|
|
273
316
|
} },
|
|
274
|
-
authToken:
|
|
317
|
+
authToken: L || void 0
|
|
275
318
|
});
|
|
276
319
|
} catch {}
|
|
277
320
|
let r = n.application?.oauthAuthUrl;
|
|
278
|
-
r && window.open(`${r}?installation_id=${n.id}`, "_blank"),
|
|
321
|
+
r && window.open(`${r}?installation_id=${n.id}`, "_blank"), F?.(e.id, e.name), i();
|
|
279
322
|
} catch (e) {
|
|
280
323
|
let t = e instanceof Error ? e.message : "Installation failed";
|
|
281
|
-
|
|
324
|
+
R({
|
|
282
325
|
type: "setError",
|
|
283
|
-
error:
|
|
284
|
-
}),
|
|
326
|
+
error: A(t)
|
|
327
|
+
}), I?.(Error(t));
|
|
285
328
|
} finally {
|
|
286
|
-
|
|
329
|
+
R({ type: "finishInstall" });
|
|
287
330
|
}
|
|
288
331
|
}
|
|
289
332
|
}, Q = async () => {
|
|
290
|
-
|
|
291
|
-
}, $ = Z.find((e) => e.id ===
|
|
333
|
+
O.has(G) ? await le() : k === "purchased" || E || D.has(G) ? await oe() : await se();
|
|
334
|
+
}, $ = Z.find((e) => e.id === B);
|
|
292
335
|
return /* @__PURE__ */ h(_, {
|
|
293
336
|
open: t,
|
|
294
337
|
onOpenChange: (e) => !e && i(),
|
|
295
338
|
children: /* @__PURE__ */ g(v, {
|
|
296
339
|
className: "mx-4 w-full max-w-lg gap-0 p-0",
|
|
297
340
|
children: [
|
|
298
|
-
/* @__PURE__ */ g(
|
|
341
|
+
/* @__PURE__ */ g(x, {
|
|
299
342
|
className: "flex flex-row items-center justify-between space-y-0 border-b border-border-default px-6 py-4 text-left",
|
|
300
343
|
children: [/* @__PURE__ */ g("div", {
|
|
301
344
|
className: "flex items-center gap-3",
|
|
@@ -306,88 +349,119 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
306
349
|
}) : /* @__PURE__ */ h("div", {
|
|
307
350
|
className: "flex size-10 items-center justify-center rounded-lg bg-bg-sunken text-lg font-bold text-text-muted",
|
|
308
351
|
children: S.name.charAt(0)
|
|
309
|
-
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(
|
|
352
|
+
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(ee, {
|
|
310
353
|
className: "text-lg font-semibold text-text-primary",
|
|
311
|
-
children:
|
|
312
|
-
}), /* @__PURE__ */ h(
|
|
354
|
+
children: z === "consent" ? "Review Permissions" : "Install App"
|
|
355
|
+
}), /* @__PURE__ */ h(y, {
|
|
313
356
|
className: "text-sm text-text-muted",
|
|
314
357
|
children: S.name
|
|
315
358
|
})] })]
|
|
316
|
-
}),
|
|
359
|
+
}), K && /* @__PURE__ */ g("div", {
|
|
317
360
|
className: "flex items-center gap-1.5 text-xs text-text-muted shrink-0",
|
|
318
361
|
children: [
|
|
319
362
|
/* @__PURE__ */ h("span", {
|
|
320
|
-
className:
|
|
363
|
+
className: z === "workspace" ? "font-semibold text-text-primary" : "",
|
|
321
364
|
children: "1"
|
|
322
365
|
}),
|
|
323
366
|
/* @__PURE__ */ h(l, { className: "size-3" }),
|
|
324
367
|
/* @__PURE__ */ h("span", {
|
|
325
|
-
className:
|
|
368
|
+
className: z === "consent" ? "font-semibold text-text-primary" : "",
|
|
326
369
|
children: "2"
|
|
327
370
|
})
|
|
328
371
|
]
|
|
329
372
|
})]
|
|
330
373
|
}),
|
|
331
|
-
|
|
374
|
+
z === "workspace" && /* @__PURE__ */ g("div", {
|
|
332
375
|
className: "px-6 py-4",
|
|
333
|
-
children: [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
className: "
|
|
340
|
-
children: /* @__PURE__ */ h(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
/* @__PURE__ */ h("p", {
|
|
346
|
-
className: "text-sm text-status-error-text",
|
|
347
|
-
children: "Failed to load workspaces"
|
|
348
|
-
}),
|
|
349
|
-
/* @__PURE__ */ h("p", {
|
|
350
|
-
className: "text-xs text-text-muted mt-1",
|
|
351
|
-
children: X.message
|
|
352
|
-
})
|
|
353
|
-
]
|
|
354
|
-
}) : Z.length === 0 ? /* @__PURE__ */ g("div", {
|
|
355
|
-
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
356
|
-
children: [/* @__PURE__ */ h(s, { className: "mb-2 size-8 text-text-muted" }), /* @__PURE__ */ h("p", {
|
|
357
|
-
className: "text-sm text-text-muted",
|
|
358
|
-
children: "No workspaces available"
|
|
359
|
-
})]
|
|
360
|
-
}) : /* @__PURE__ */ h("div", {
|
|
361
|
-
className: "divide-y divide-border-default",
|
|
362
|
-
children: Z.map((e) => /* @__PURE__ */ g("button", {
|
|
363
|
-
type: "button",
|
|
364
|
-
onClick: () => B({
|
|
365
|
-
type: "selectWorkspace",
|
|
366
|
-
workspaceId: e.id
|
|
367
|
-
}),
|
|
368
|
-
className: `w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${H === e.id ? "bg-action-primary-bg/10" : "hover:bg-bg-sunken"}`,
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ h("p", {
|
|
378
|
+
className: "mb-4 text-text-secondary",
|
|
379
|
+
children: "Select the workspace where you want to install this app:"
|
|
380
|
+
}),
|
|
381
|
+
/* @__PURE__ */ h("div", {
|
|
382
|
+
className: "max-h-72 overflow-y-auto rounded-lg border border-border-seam",
|
|
383
|
+
children: ae ? /* @__PURE__ */ h("div", {
|
|
384
|
+
className: "flex items-center justify-center py-12",
|
|
385
|
+
children: /* @__PURE__ */ h(d, { className: "size-8 animate-spin text-text-muted" })
|
|
386
|
+
}) : Y ? /* @__PURE__ */ g("div", {
|
|
387
|
+
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
369
388
|
children: [
|
|
370
|
-
/* @__PURE__ */ h("
|
|
371
|
-
|
|
372
|
-
|
|
389
|
+
/* @__PURE__ */ h(a, { className: "mb-2 size-8 text-status-error-text" }),
|
|
390
|
+
/* @__PURE__ */ h("p", {
|
|
391
|
+
className: "text-sm text-status-error-text",
|
|
392
|
+
children: "Failed to load workspaces"
|
|
373
393
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
className: "
|
|
376
|
-
children:
|
|
377
|
-
|
|
378
|
-
children: e.name
|
|
379
|
-
}), e.slug ? /* @__PURE__ */ g("p", {
|
|
380
|
-
className: "text-xs text-text-muted truncate",
|
|
381
|
-
children: ["/", e.slug]
|
|
382
|
-
}) : null]
|
|
383
|
-
}),
|
|
384
|
-
H === e.id && /* @__PURE__ */ h(c, { className: "size-5 flex-shrink-0 text-action-primary-bg" })
|
|
394
|
+
/* @__PURE__ */ h("p", {
|
|
395
|
+
className: "text-xs text-text-muted mt-1",
|
|
396
|
+
children: Y.message
|
|
397
|
+
})
|
|
385
398
|
]
|
|
386
|
-
},
|
|
399
|
+
}) : Z.length === 0 ? /* @__PURE__ */ g("div", {
|
|
400
|
+
className: "flex flex-col items-center justify-center py-12 text-center",
|
|
401
|
+
children: [/* @__PURE__ */ h(s, { className: "mb-2 size-8 text-text-muted" }), /* @__PURE__ */ h("p", {
|
|
402
|
+
className: "text-sm text-text-muted",
|
|
403
|
+
children: "No workspaces available"
|
|
404
|
+
})]
|
|
405
|
+
}) : /* @__PURE__ */ h("div", {
|
|
406
|
+
className: "divide-y divide-border-default",
|
|
407
|
+
children: Z.map((e) => /* @__PURE__ */ g("button", {
|
|
408
|
+
type: "button",
|
|
409
|
+
onClick: () => R({
|
|
410
|
+
type: "selectWorkspace",
|
|
411
|
+
workspaceId: e.id
|
|
412
|
+
}),
|
|
413
|
+
className: `w-full cursor-pointer flex items-center gap-3 px-4 py-3 text-left transition-colors ${B === e.id ? "bg-action-primary-bg/10" : "hover:bg-bg-sunken"}`,
|
|
414
|
+
children: [
|
|
415
|
+
/* @__PURE__ */ h("div", {
|
|
416
|
+
className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10 text-text-link",
|
|
417
|
+
children: /* @__PURE__ */ h(s, { className: "size-5" })
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ g("div", {
|
|
420
|
+
className: "flex-1 min-w-0",
|
|
421
|
+
children: [/* @__PURE__ */ h("p", {
|
|
422
|
+
className: "font-medium text-text-primary truncate",
|
|
423
|
+
children: e.name
|
|
424
|
+
}), e.slug ? /* @__PURE__ */ g("p", {
|
|
425
|
+
className: "text-xs text-text-muted truncate",
|
|
426
|
+
children: ["/", e.slug]
|
|
427
|
+
}) : null]
|
|
428
|
+
}),
|
|
429
|
+
B === e.id && /* @__PURE__ */ h(c, { className: "size-5 flex-shrink-0 text-action-primary-bg" })
|
|
430
|
+
]
|
|
431
|
+
}, e.id))
|
|
432
|
+
})
|
|
433
|
+
}),
|
|
434
|
+
q && X.length > 1 && /* @__PURE__ */ g("div", {
|
|
435
|
+
className: "mt-4",
|
|
436
|
+
children: [/* @__PURE__ */ h("label", {
|
|
437
|
+
htmlFor: "install-app-version",
|
|
438
|
+
className: "mb-1.5 block text-xs font-medium text-text-secondary",
|
|
439
|
+
children: "Version"
|
|
440
|
+
}), /* @__PURE__ */ g("select", {
|
|
441
|
+
id: "install-app-version",
|
|
442
|
+
value: V,
|
|
443
|
+
onChange: (e) => R({
|
|
444
|
+
type: "selectVersion",
|
|
445
|
+
version: e.target.value
|
|
446
|
+
}),
|
|
447
|
+
className: "w-full rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
448
|
+
children: [/* @__PURE__ */ g("option", {
|
|
449
|
+
value: "",
|
|
450
|
+
children: ["Latest", S.version ? ` (${S.version})` : ""]
|
|
451
|
+
}), X.filter((e) => !e.isLatest).map((e) => /* @__PURE__ */ g("option", {
|
|
452
|
+
value: e.version,
|
|
453
|
+
children: [
|
|
454
|
+
e.version,
|
|
455
|
+
" (",
|
|
456
|
+
e.status,
|
|
457
|
+
")"
|
|
458
|
+
]
|
|
459
|
+
}, e.version))]
|
|
460
|
+
})]
|
|
387
461
|
})
|
|
388
|
-
|
|
462
|
+
]
|
|
389
463
|
}),
|
|
390
|
-
|
|
464
|
+
z === "consent" && /* @__PURE__ */ g("div", {
|
|
391
465
|
className: "px-6 py-4",
|
|
392
466
|
children: [
|
|
393
467
|
$ && /* @__PURE__ */ g("div", {
|
|
@@ -454,43 +528,43 @@ var F = ({ isOpen: t, onClose: i, app: S, orderId: A, purchaseState: F = "free",
|
|
|
454
528
|
})
|
|
455
529
|
]
|
|
456
530
|
}),
|
|
457
|
-
/* @__PURE__ */ g(
|
|
531
|
+
/* @__PURE__ */ g(b, {
|
|
458
532
|
className: "block border-t border-border-default px-6 py-4 sm:flex-col sm:items-stretch sm:space-x-0",
|
|
459
533
|
children: [
|
|
460
|
-
|
|
534
|
+
W && /* @__PURE__ */ g("div", {
|
|
461
535
|
className: "mb-3 flex items-center gap-2 rounded-lg bg-status-info-bg-subtle px-3 py-2 text-sm text-status-info-text",
|
|
462
|
-
children: [/* @__PURE__ */ h(u, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children:
|
|
536
|
+
children: [/* @__PURE__ */ h(u, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children: W })]
|
|
463
537
|
}),
|
|
464
|
-
|
|
538
|
+
U && /* @__PURE__ */ g("div", {
|
|
465
539
|
className: "mb-3 flex items-center gap-2 rounded-lg bg-status-error-bg-subtle/10 px-3 py-2 text-sm text-status-error-text",
|
|
466
|
-
children: [/* @__PURE__ */ h(a, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children:
|
|
540
|
+
children: [/* @__PURE__ */ h(a, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children: U })]
|
|
467
541
|
}),
|
|
468
542
|
/* @__PURE__ */ h("div", {
|
|
469
543
|
className: "flex items-center justify-end gap-3",
|
|
470
|
-
children:
|
|
544
|
+
children: z === "consent" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("button", {
|
|
471
545
|
type: "button",
|
|
472
|
-
onClick: () =>
|
|
473
|
-
disabled:
|
|
546
|
+
onClick: () => R({ type: "backToWorkspace" }),
|
|
547
|
+
disabled: H,
|
|
474
548
|
className: "cursor-pointer inline-flex items-center gap-1.5 rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
|
|
475
549
|
children: [/* @__PURE__ */ h(o, { className: "size-4" }), "Back"]
|
|
476
550
|
}), /* @__PURE__ */ h("button", {
|
|
477
551
|
type: "button",
|
|
478
552
|
onClick: () => void Q(),
|
|
479
|
-
disabled:
|
|
553
|
+
disabled: H,
|
|
480
554
|
className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2",
|
|
481
|
-
children:
|
|
555
|
+
children: H ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(d, { className: "size-4 animate-spin" }), "Installing…"] }) : "Accept & Install"
|
|
482
556
|
})] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
|
|
483
557
|
type: "button",
|
|
484
558
|
onClick: i,
|
|
485
|
-
disabled:
|
|
559
|
+
disabled: H,
|
|
486
560
|
className: "cursor-pointer rounded-lg border border-border-default px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-50",
|
|
487
561
|
children: "Cancel"
|
|
488
562
|
}), /* @__PURE__ */ h("button", {
|
|
489
563
|
type: "button",
|
|
490
|
-
onClick:
|
|
491
|
-
disabled: !
|
|
564
|
+
onClick: ce,
|
|
565
|
+
disabled: !B || H,
|
|
492
566
|
className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2",
|
|
493
|
-
children:
|
|
567
|
+
children: H ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(d, { className: "size-4 animate-spin" }), "Installing…"] }) : K ? /* @__PURE__ */ g(m, { children: ["Continue", /* @__PURE__ */ h(l, { className: "size-4" })] }) : "Install App"
|
|
494
568
|
})] })
|
|
495
569
|
})
|
|
496
570
|
]
|