@cobaltcore-dev/aurora 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/client/{BucketToastNotifications-D2Cq2VrV.mjs → BucketToastNotifications-BGd2wVmh.mjs} +2 -2
  2. package/dist/client/{BucketToastNotifications-D2Cq2VrV.mjs.map → BucketToastNotifications-BGd2wVmh.mjs.map} +1 -1
  3. package/dist/client/DeletePcaModal-BU6kbKsw.mjs +80 -0
  4. package/dist/client/DeletePcaModal-BU6kbKsw.mjs.map +1 -0
  5. package/dist/client/DetailsInfo-BUyuYpJj.mjs +52 -0
  6. package/dist/client/DetailsInfo-BUyuYpJj.mjs.map +1 -0
  7. package/dist/client/{FloatingIpActionModals-sJlSFIsK.mjs → FloatingIpActionModals-DAtZoYGS.mjs} +22 -22
  8. package/dist/client/{FloatingIpActionModals-sJlSFIsK.mjs.map → FloatingIpActionModals-DAtZoYGS.mjs.map} +1 -1
  9. package/dist/client/{ImageToastNotifications-CISH3c_d.mjs → ImageToastNotifications-BhjU1bfT.mjs} +7 -7
  10. package/dist/client/{ImageToastNotifications-CISH3c_d.mjs.map → ImageToastNotifications-BhjU1bfT.mjs.map} +1 -1
  11. package/dist/client/{_flavorId-Cx5tf2KQ.mjs → _flavorId-BQY7YhNx.mjs} +2 -2
  12. package/dist/client/{_flavorId-Cx5tf2KQ.mjs.map → _flavorId-BQY7YhNx.mjs.map} +1 -1
  13. package/dist/client/{_flavorId-C6RJfhh8.mjs → _flavorId-sS1sg_DZ.mjs} +3 -3
  14. package/dist/client/{_flavorId-C6RJfhh8.mjs.map → _flavorId-sS1sg_DZ.mjs.map} +1 -1
  15. package/dist/client/{_floatingIpId-C4Sa8tMa.mjs → _floatingIpId-BHZGh8U8.mjs} +2 -2
  16. package/dist/client/{_floatingIpId-C4Sa8tMa.mjs.map → _floatingIpId-BHZGh8U8.mjs.map} +1 -1
  17. package/dist/client/{_floatingIpId-CAUBZ5WD2.mjs → _floatingIpId-CR3aD38l2.mjs} +5 -5
  18. package/dist/client/{_floatingIpId-CAUBZ5WD2.mjs.map → _floatingIpId-CR3aD38l2.mjs.map} +1 -1
  19. package/dist/client/{_imageId-DpXNAIbD.mjs → _imageId-Cf-Xdksv.mjs} +3 -3
  20. package/dist/client/{_imageId-DpXNAIbD.mjs.map → _imageId-Cf-Xdksv.mjs.map} +1 -1
  21. package/dist/client/_pcaId-B7j0sXnY.mjs +545 -0
  22. package/dist/client/_pcaId-B7j0sXnY.mjs.map +1 -0
  23. package/dist/client/{_projectId-fEA6fnFQ.mjs → _projectId-Cq9JnhRj.mjs} +3 -3
  24. package/dist/client/{_projectId-fEA6fnFQ.mjs.map → _projectId-Cq9JnhRj.mjs.map} +1 -1
  25. package/dist/client/{_projectId-w-tZz0FI.mjs → _projectId-D8FHe0gr.mjs} +2 -2
  26. package/dist/client/{_projectId-w-tZz0FI.mjs.map → _projectId-D8FHe0gr.mjs.map} +1 -1
  27. package/dist/client/{_projectId-qvINx3Dx.mjs → _projectId-Ig3QqYzt.mjs} +2 -2
  28. package/dist/client/{_projectId-qvINx3Dx.mjs.map → _projectId-Ig3QqYzt.mjs.map} +1 -1
  29. package/dist/client/{_projectId-BOaPmCuz.mjs → _projectId-b4NGeECR.mjs} +3 -3
  30. package/dist/client/{_projectId-BOaPmCuz.mjs.map → _projectId-b4NGeECR.mjs.map} +1 -1
  31. package/dist/client/{_securityGroupId-B6_lD8ry.mjs → _securityGroupId-BVSsCus9.mjs} +2 -2
  32. package/dist/client/{_securityGroupId-B6_lD8ry.mjs.map → _securityGroupId-BVSsCus9.mjs.map} +1 -1
  33. package/dist/client/{_securityGroupId-D9FHSkNU.mjs → _securityGroupId-gwV4eB0s.mjs} +16 -16
  34. package/dist/client/{_securityGroupId-D9FHSkNU.mjs.map → _securityGroupId-gwV4eB0s.mjs.map} +1 -1
  35. package/dist/client/{_storageType-ZFnIALny.mjs → _storageType-CH2khFcZ.mjs} +2 -2
  36. package/dist/client/{_storageType-ZFnIALny.mjs.map → _storageType-CH2khFcZ.mjs.map} +1 -1
  37. package/dist/client/{_storageType-MgntkZb6.mjs → _storageType-D-1H6SX1.mjs} +856 -856
  38. package/dist/client/{_storageType-MgntkZb6.mjs.map → _storageType-D-1H6SX1.mjs.map} +1 -1
  39. package/dist/client/build-DgeVmENN.mjs.map +1 -1
  40. package/dist/client/{floatingips-DOGKGGkC.mjs → floatingips-DyBEotB8.mjs} +10 -10
  41. package/dist/client/{floatingips-DOGKGGkC.mjs.map → floatingips-DyBEotB8.mjs.map} +1 -1
  42. package/dist/client/hooks-iGiEkLTp.mjs +12 -0
  43. package/dist/client/hooks-iGiEkLTp.mjs.map +1 -0
  44. package/dist/client/{images-B1wqMKYw.mjs → images-BklbSacK.mjs} +2 -2
  45. package/dist/client/{images-B1wqMKYw.mjs.map → images-BklbSacK.mjs.map} +1 -1
  46. package/dist/client/{images-D5UsQi8i.mjs → images-C3voJ3B1.mjs} +259 -259
  47. package/dist/client/{images-D5UsQi8i.mjs.map → images-C3voJ3B1.mjs.map} +1 -1
  48. package/dist/client/index.d.ts +2 -0
  49. package/dist/client/index.js +337 -344
  50. package/dist/client/index.js.map +1 -1
  51. package/dist/client/md-CyCflQee.mjs.map +1 -1
  52. package/dist/client/{objects-DpgXMFrG.mjs → objects-B3Z8h4RU.mjs} +2 -2
  53. package/dist/client/{objects-DpgXMFrG.mjs.map → objects-B3Z8h4RU.mjs.map} +1 -1
  54. package/dist/client/{objects-Deo1Ic1A.mjs → objects-CGOfO00N.mjs} +499 -475
  55. package/dist/client/objects-CGOfO00N.mjs.map +1 -0
  56. package/dist/client/{pca-DztTIs18.mjs → pca-72YR_Pk0.mjs} +3 -3
  57. package/dist/client/pca-72YR_Pk0.mjs.map +1 -0
  58. package/dist/client/pca-CsBx_IDO.mjs +251 -0
  59. package/dist/client/pca-CsBx_IDO.mjs.map +1 -0
  60. package/dist/client/pcaAccess-Br4kVjLQ.mjs +9 -0
  61. package/dist/client/pcaAccess-Br4kVjLQ.mjs.map +1 -0
  62. package/dist/client/{securitygroups-BRtHaTLm.mjs → securitygroups-8vRbXmBL.mjs} +3 -3
  63. package/dist/client/{securitygroups-BRtHaTLm.mjs.map → securitygroups-8vRbXmBL.mjs.map} +1 -1
  64. package/dist/client/trpcClient-BxcNKnhv.mjs +65 -0
  65. package/dist/client/trpcClient-BxcNKnhv.mjs.map +1 -0
  66. package/dist/client/trpcClient.d.ts +56 -49
  67. package/dist/server/index.d.ts +51 -49
  68. package/dist/server/index.js +53 -23
  69. package/package.json +4 -2
  70. package/dist/client/_pcaId-DY9GPV7t.mjs +0 -479
  71. package/dist/client/_pcaId-DY9GPV7t.mjs.map +0 -1
  72. package/dist/client/_pcaId-ldtkXsbp.mjs +0 -36
  73. package/dist/client/_pcaId-ldtkXsbp.mjs.map +0 -1
  74. package/dist/client/constants-COPE2ktv.mjs +0 -153
  75. package/dist/client/constants-COPE2ktv.mjs.map +0 -1
  76. package/dist/client/hooks-DvdvErNv.mjs +0 -2
  77. package/dist/client/objects-Deo1Ic1A.mjs.map +0 -1
  78. package/dist/client/pca-B7WldCGw.mjs +0 -202
  79. package/dist/client/pca-B7WldCGw.mjs.map +0 -1
  80. package/dist/client/pca-DztTIs18.mjs.map +0 -1
  81. package/dist/client/pcaAccess-BYUY700H.mjs +0 -9
  82. package/dist/client/pcaAccess-BYUY700H.mjs.map +0 -1
  83. package/dist/client/trpcClient-Dy_MP_Pv.mjs +0 -57
  84. package/dist/client/trpcClient-Dy_MP_Pv.mjs.map +0 -1
@@ -0,0 +1,545 @@
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, K as c, P as l, R as u, Y as d, at as f, et as p, o as m, q as h, r as g, rt as _, tt as v, w as y, y as b } from "./build-DgeVmENN.mjs";
2
+ import { r as x } from "./trpcClient-BxcNKnhv.mjs";
3
+ import { n as S, t as C } from "./DetailsInfo-BUyuYpJj.mjs";
4
+ import { t as w } from "./useProjectId-DBc5lpoU.mjs";
5
+ import "./hooks-iGiEkLTp.mjs";
6
+ import { t as T } from "./useModal-DCs1OJh7.mjs";
7
+ import { t as E } from "./DeletePcaModal-BU6kbKsw.mjs";
8
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
9
+ import { Fragment as A, useRef as j, useState as M } from "react";
10
+ import { useNavigate as N } from "@tanstack/react-router";
11
+ import { useQuery as P } from "@tanstack/react-query";
12
+ import { Trans as F, useLingui as I } from "@lingui/react";
13
+ import { z as L } from "zod";
14
+ import { useForm as R, useStore as z } from "@tanstack/react-form";
15
+ import "reflect-metadata";
16
+ import { Pkcs10CertificateRequest as B, SubjectAlternativeNameExtension as V } from "@peculiar/x509";
17
+ //#region src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-modals/IssueSelfSignedCertificateModal.tsx
18
+ var H = 86400, U = ({ open: e, onClose: n, pca: r }) => {
19
+ let { i18n: i, _: a } = I(), o = w(), s = x.useUtils(), { isPending: l, ...u } = x.services.pca.createCertificate.useMutation({ onSettled: () => s.services.pca.listCertificates.invalidate() });
20
+ return /*#__PURE__*/ k(g, {
21
+ open: e,
22
+ title: i._({ id: "AirKNZ" }),
23
+ onCancel: () => {
24
+ l || (u.reset(), n());
25
+ },
26
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
27
+ confirmButtonLabel: i._({ id: "rx4T2i" }),
28
+ onConfirm: async () => {
29
+ l || !r.csr || (await u.mutateAsync({
30
+ project_id: o,
31
+ certificate_authority_id: r.id,
32
+ csr: r.csr,
33
+ configuration: { validity: { not_after: Math.floor(Date.now() / 1e3) + H } }
34
+ }), n());
35
+ },
36
+ disableConfirmButton: l || !r.csr,
37
+ children: [u.error && /*#__PURE__*/ O(t, {
38
+ dismissible: !1,
39
+ variant: "error",
40
+ className: "mb-4",
41
+ children: u.error?.message
42
+ }), l ? /*#__PURE__*/ k("div", {
43
+ className: "flex items-center justify-center gap-2",
44
+ children: [/*#__PURE__*/ O(c, { variant: "primary" }), /*#__PURE__*/ O("span", {
45
+ className: "text-theme-high text-sm",
46
+ children: /*#__PURE__*/ O(F, { id: "1DbiGM" })
47
+ })]
48
+ }) : /*#__PURE__*/ O(F, { id: "MI6aae" })]
49
+ });
50
+ }, W = (e) => {
51
+ let t = e.replace(/\\n/g, "\n").trim();
52
+ return t.includes("-----BEGIN") && !t.includes("\n") ? t.replace("-----BEGIN CERTIFICATE REQUEST-----", "-----BEGIN CERTIFICATE REQUEST-----\n").replace("-----END CERTIFICATE REQUEST-----", "\n-----END CERTIFICATE REQUEST-----") : t;
53
+ }, G = (e) => {
54
+ let t = e, n = e.name.toUpperCase(), r = e.name;
55
+ return [
56
+ "RSASSA-PKCS1-V1_5",
57
+ "RSA-PSS",
58
+ "RSA-OAEP"
59
+ ].includes(n) ? r = "RSA" : ["ECDSA", "ECDH"].includes(n) ? r = "EC" : ["ED25519", "EDDSA"].includes(n) && (r = "EdDSA"), typeof t.modulusLength == "number" ? `${r} ${t.modulusLength}-bit` : typeof t.namedCurve == "string" ? `${r} (${t.namedCurve})` : r;
60
+ }, K = (e) => {
61
+ if (!e) return "—";
62
+ let t = e.hash?.name ? ` with ${e.hash.name}` : "";
63
+ return `${e.name}${t}`;
64
+ }, q = async (e) => {
65
+ let t = new B(W(e)), n = [];
66
+ n.push({
67
+ label: "Subject",
68
+ value: t.subject || "—"
69
+ }), t.publicKey && n.push({
70
+ label: "Public Key Algorithm",
71
+ value: G(t.publicKey.algorithm)
72
+ }), n.push({
73
+ label: "Signature Algorithm",
74
+ value: K(t.signatureAlgorithm)
75
+ });
76
+ let r = t.extensions.find((e) => e.type === "2.5.29.17"), i = "—";
77
+ return r && (i = new V(r.rawData).names.items.map((e) => `${e.type}: ${e.value}`).join(", ") || "—"), n.push({
78
+ label: "Subject Alternative Names (SAN)",
79
+ value: i
80
+ }), n;
81
+ }, J = ({ csrCode: e }) => {
82
+ let t = e.trim().length > 0, { data: n } = P({
83
+ queryKey: ["parsed-certificate-info", e],
84
+ queryFn: async () => q(e),
85
+ enabled: t,
86
+ retry: !1
87
+ }), i = n ?? [];
88
+ return i.length ? /*#__PURE__*/ O(a, {
89
+ alignTerms: "right",
90
+ className: "mt-4 w-full",
91
+ children: i.map(({ label: e, value: t }) => /*#__PURE__*/ k(A, { children: [/*#__PURE__*/ O(h, {
92
+ className: "text-pretty",
93
+ children: e
94
+ }), /*#__PURE__*/ O(r, { children: t })] }, e))
95
+ }) : null;
96
+ }, Y = ({ open: e, onClose: n, pcaId: r }) => {
97
+ let { i18n: i, _: a } = I(), o = w(), l = x.useUtils(), { isPending: u, ...d } = x.services.pca.import.useMutation({ onSettled: () => l.services.pca.getById.invalidate() }), f = R({
98
+ defaultValues: { imported_certificate_chain: "" },
99
+ validators: { onSubmit: L.object({ imported_certificate_chain: L.string().trim().min(1) }) },
100
+ onSubmit: async () => {
101
+ u || (await d.mutateAsync({
102
+ project_id: o,
103
+ certificate_authority_id: r,
104
+ imported_certificate_chain: f.state.values.imported_certificate_chain
105
+ }), h());
106
+ }
107
+ }), h = () => {
108
+ u || (f.reset(), d.reset(), n());
109
+ }, _ = j(null), v = z(f.store, (e) => e.values.imported_certificate_chain);
110
+ return /*#__PURE__*/ k(g, {
111
+ open: e,
112
+ size: "large",
113
+ title: i._({ id: "+1rTEL" }),
114
+ onCancel: h,
115
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
116
+ confirmButtonLabel: i._({ id: "tfDRzk" }),
117
+ onConfirm: f.handleSubmit,
118
+ disableConfirmButton: u || !v.trim(),
119
+ children: [
120
+ d.error && /*#__PURE__*/ O(t, {
121
+ dismissible: !1,
122
+ variant: "error",
123
+ className: "mb-4",
124
+ children: d.error?.message
125
+ }),
126
+ u && /*#__PURE__*/ k("div", {
127
+ className: "mb-4 flex items-center justify-center gap-2",
128
+ children: [/*#__PURE__*/ O(c, { variant: "primary" }), /*#__PURE__*/ O("span", {
129
+ className: "text-theme-high text-sm",
130
+ children: /*#__PURE__*/ O(F, { id: "pYR76U" })
131
+ })]
132
+ }),
133
+ !u && /*#__PURE__*/ O(m, {
134
+ className: "mb-0",
135
+ id: "import-externally-signed-certificate-form",
136
+ onSubmit: (e) => {
137
+ e.preventDefault(), f.handleSubmit();
138
+ },
139
+ children: /*#__PURE__*/ k(s, { children: [
140
+ /*#__PURE__*/ k("div", {
141
+ className: "mb-2",
142
+ children: [/*#__PURE__*/ O(b, {
143
+ onClick: () => _.current?.click(),
144
+ children: i._({ id: "E7kdtm" })
145
+ }), /*#__PURE__*/ O("input", {
146
+ ref: _,
147
+ type: "file",
148
+ accept: ".pem,.crt,.cer,.json",
149
+ className: "sr-only",
150
+ onChange: (e) => {
151
+ let t = e.target.files?.[0];
152
+ if (!t) return;
153
+ let n = new FileReader();
154
+ n.onload = (e) => {
155
+ try {
156
+ let n = e.target?.result, r = n;
157
+ if (t.name.endsWith(".json")) try {
158
+ let e = JSON.parse(n);
159
+ r = typeof e.imported_certificate_chain == "string" ? e.imported_certificate_chain : n;
160
+ } catch {
161
+ r = n;
162
+ }
163
+ f.setFieldValue("imported_certificate_chain", r);
164
+ } catch (e) {
165
+ console.error("Failed to read certificate file:", e);
166
+ }
167
+ }, n.readAsText(t);
168
+ }
169
+ })]
170
+ }),
171
+ /*#__PURE__*/ O(f.Field, {
172
+ name: "imported_certificate_chain",
173
+ children: (e) => /*#__PURE__*/ O(p, {
174
+ id: e.name,
175
+ name: e.name,
176
+ value: e.state.value,
177
+ onBlur: e.handleBlur,
178
+ onChange: (t) => e.handleChange(t.target.value),
179
+ placeholder: i._({ id: "FAA/qW" }),
180
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
181
+ disabled: u
182
+ })
183
+ }),
184
+ /*#__PURE__*/ O(J, { csrCode: v })
185
+ ] })
186
+ })
187
+ ]
188
+ });
189
+ }, X = ({ open: e, onClose: n, pcaId: r }) => {
190
+ let { i18n: i, _: a } = I(), o = N(), l = w(), u = x.useUtils(), { isPending: d, ...f } = x.services.pca.createCertificate.useMutation({ onSettled: () => u.services.pca.listCertificates.invalidate() }), h = R({
191
+ defaultValues: { csr: "" },
192
+ validators: { onSubmit: L.object({ csr: L.string().trim().min(1) }) },
193
+ onSubmit: async ({ value: e }) => {
194
+ if (d) return;
195
+ let t = await f.mutateAsync({
196
+ project_id: l,
197
+ certificate_authority_id: r,
198
+ csr: e.csr.replace(/\\n/g, "\n"),
199
+ configuration: { validity: { not_after: Math.floor(Date.now() / 1e3) + 480 * 60 } }
200
+ });
201
+ _(), await o({
202
+ to: "/projects/$projectId/services/pca/$pcaId/$certificateId",
203
+ params: {
204
+ projectId: l,
205
+ pcaId: r,
206
+ certificateId: t.id
207
+ }
208
+ });
209
+ }
210
+ }), _ = () => {
211
+ d || (h.reset(), f.reset(), n());
212
+ }, v = z(h.store, (e) => e.values.csr);
213
+ return /*#__PURE__*/ k(g, {
214
+ open: e,
215
+ size: "large",
216
+ title: i._({ id: "9kDPaB" }),
217
+ onCancel: _,
218
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
219
+ confirmButtonLabel: i._({ id: "tfDRzk" }),
220
+ onConfirm: h.handleSubmit,
221
+ disableConfirmButton: d || !(v.trim().length > 0),
222
+ children: [
223
+ f.error && /*#__PURE__*/ O(t, {
224
+ dismissible: !1,
225
+ variant: "error",
226
+ className: "mb-4",
227
+ children: f.error?.message
228
+ }),
229
+ d && /*#__PURE__*/ k("div", {
230
+ className: "mb-4 flex items-center justify-center gap-2",
231
+ children: [/*#__PURE__*/ O(c, { variant: "primary" }), /*#__PURE__*/ O("span", {
232
+ className: "text-theme-high text-sm",
233
+ children: /*#__PURE__*/ O(F, { id: "NG+FZC" })
234
+ })]
235
+ }),
236
+ !d && /*#__PURE__*/ O(m, {
237
+ className: "mb-0",
238
+ id: "issue-end-entity-certificate-form",
239
+ onSubmit: (e) => {
240
+ e.preventDefault(), h.handleSubmit();
241
+ },
242
+ children: /*#__PURE__*/ k(s, { children: [/*#__PURE__*/ O(h.Field, {
243
+ name: "csr",
244
+ children: (e) => /*#__PURE__*/ O(p, {
245
+ id: e.name,
246
+ name: e.name,
247
+ value: e.state.value,
248
+ onBlur: e.handleBlur,
249
+ onChange: (t) => e.handleChange(t.target.value),
250
+ placeholder: i._({ id: "h6JDtI" }),
251
+ errortext: e.state.meta.errors.map((e) => e?.message).join(", "),
252
+ disabled: d
253
+ })
254
+ }), /*#__PURE__*/ O(J, { csrCode: v })] })
255
+ })
256
+ ]
257
+ });
258
+ }, Z = ({ certificate: t }) => {
259
+ let { i18n: n, _: r } = I(), a = N(), s = () => a({
260
+ from: "/projects/$projectId/services/pca/$pcaId/",
261
+ to: "$certificateId",
262
+ params: (e) => ({
263
+ ...e,
264
+ certificateId: t.id
265
+ })
266
+ });
267
+ return /*#__PURE__*/ k(i, {
268
+ "data-testid": `pca-certificate-row-${t.id}`,
269
+ onClick: s,
270
+ children: [
271
+ /*#__PURE__*/ O(o, { children: t.certificate_authority_id }),
272
+ /*#__PURE__*/ O(o, { children: t.id }),
273
+ /*#__PURE__*/ O(o, {
274
+ onClick: (e) => e.stopPropagation(),
275
+ className: "items-end pr-0",
276
+ children: /*#__PURE__*/ O(_, { children: /*#__PURE__*/ O(e, { children: /*#__PURE__*/ O(f, {
277
+ label: n._({ id: "v0hPHE" }),
278
+ onClick: s
279
+ }) }) })
280
+ })
281
+ ]
282
+ }, t.id);
283
+ }, Q = 50, $ = ({ pcaId: e, pcaState: t }) => {
284
+ let { i18n: r, _: a } = I(), s = w(), [f, p] = T(!1), [m, h] = M([void 0]), [g, _] = M(1), y = m[g - 1], { data: S, isLoading: C, isError: E, error: A } = x.services.pca.listCertificates.useQuery({
285
+ project_id: s,
286
+ certificate_authority_id: e,
287
+ limit: Q,
288
+ next_page_marker: y
289
+ }), j = S?.certificates ?? [], N = S?.next_page_marker, P = N ? g + 1 : g, L = Math.max(P, m.length), R = (e) => {
290
+ e < 1 || e > L || (e > g && N && h((t) => {
291
+ let n = [...t];
292
+ return n[e - 1] = N, n;
293
+ }), _(e));
294
+ };
295
+ if (C) return /*#__PURE__*/ k(v, {
296
+ className: "py-8",
297
+ distribution: "center",
298
+ alignment: "center",
299
+ direction: "vertical",
300
+ children: [/*#__PURE__*/ O(c, {
301
+ variant: "primary",
302
+ size: "large",
303
+ className: "mb-2"
304
+ }), /*#__PURE__*/ O(F, { id: "T9o/az" })]
305
+ });
306
+ if (E) return /*#__PURE__*/ O(v, {
307
+ className: "py-8",
308
+ distribution: "center",
309
+ alignment: "center",
310
+ direction: "vertical",
311
+ children: A?.message ?? r._({ id: "hz9da7" })
312
+ });
313
+ let z = [
314
+ r._({ id: "c1OE1x" }),
315
+ r._({ id: "S0kLOH" }),
316
+ ""
317
+ ], B = z.length;
318
+ return /*#__PURE__*/ k("div", {
319
+ className: "relative",
320
+ children: [t === "READY" && /*#__PURE__*/ k(D, { children: [/*#__PURE__*/ O(v, {
321
+ className: "pt-3 pb-2",
322
+ distribution: "end",
323
+ children: /*#__PURE__*/ O(b, {
324
+ variant: "primary",
325
+ label: r._({ id: "9kDPaB" }),
326
+ onClick: p
327
+ })
328
+ }), f && /*#__PURE__*/ O(X, {
329
+ open: f,
330
+ onClose: p,
331
+ pcaId: e
332
+ })] }), j.length === 0 && g === 1 ? /*#__PURE__*/ O(l, {
333
+ columns: B,
334
+ className: "pca-certificates",
335
+ "data-testid": "no-pcas-certificates",
336
+ children: /*#__PURE__*/ O(i, { children: /*#__PURE__*/ k(o, {
337
+ colSpan: B,
338
+ children: [/*#__PURE__*/ O(d, { children: /*#__PURE__*/ O(F, { id: "kNeZrV" }) }), /*#__PURE__*/ O("p", { children: /*#__PURE__*/ O(F, { id: "7huC4O" }) })]
339
+ }) })
340
+ }) : /*#__PURE__*/ k(D, { children: [/*#__PURE__*/ k(l, {
341
+ columns: B,
342
+ children: [/*#__PURE__*/ O(i, { children: z.map((e) => /*#__PURE__*/ O(u, { children: e }, e)) }), j.map((e) => /*#__PURE__*/ O(Z, { certificate: e }, e.id))]
343
+ }), L > 1 && /*#__PURE__*/ O("div", {
344
+ className: "flex justify-center py-4",
345
+ children: /*#__PURE__*/ O(n, {
346
+ variant: "input",
347
+ currentPage: g,
348
+ pages: L,
349
+ onPressPrevious: () => R(g - 1),
350
+ onPressNext: () => R(g + 1)
351
+ })
352
+ })] })]
353
+ });
354
+ }, ee = ({ pca: e }) => {
355
+ let { i18n: t, _: n } = I(), r = N(), i = w(), [a, o] = T(!1), [s, c] = T(!1), [l, u] = T(!1), d = e.configuration?.subject?.named_attributes?.cn ?? t._({ id: "Ef7StM" }), f = () => r({
356
+ to: "/projects/$projectId/services/pca",
357
+ params: { projectId: i }
358
+ }), p = [
359
+ {
360
+ label: t._({ id: "c1OE1x" }),
361
+ value: e.id
362
+ },
363
+ {
364
+ label: t._({ id: "mSfwLL" }),
365
+ value: e.project_id
366
+ },
367
+ {
368
+ label: t._({ id: "UJmAAK" }),
369
+ value: e.display_subject
370
+ },
371
+ {
372
+ label: t._({ id: "UbWeJA" }),
373
+ value: e.certificate?.validity.not_before !== void 0 && e.certificate?.validity.not_after !== void 0 ? `${Math.round((e.certificate.validity.not_after - e.certificate.validity.not_before) / (3600 * 24))} days` : void 0
374
+ }
375
+ ], m = {
376
+ CREATING: /*#__PURE__*/ O(y, {
377
+ icon: "bolt",
378
+ variant: "info",
379
+ text: t._({ id: "E9bKSA" })
380
+ }),
381
+ AWAITING_CERTIFICATE: /*#__PURE__*/ O(y, {
382
+ icon: "accessTime",
383
+ variant: "warning",
384
+ text: t._({ id: "mB4LB4" })
385
+ }),
386
+ READY: /*#__PURE__*/ O(y, {
387
+ icon: "checkCircle",
388
+ variant: "success",
389
+ text: t._({ id: "ckH3fT" })
390
+ }),
391
+ FAILED: /*#__PURE__*/ O(y, {
392
+ icon: "error",
393
+ variant: "error",
394
+ text: t._({ id: "7Bj3x9" })
395
+ }),
396
+ UNEXPECTED: /*#__PURE__*/ O(y, {
397
+ icon: "severityUnknown",
398
+ variant: "default",
399
+ text: t._({ id: "0s+JcW" })
400
+ })
401
+ };
402
+ return /*#__PURE__*/ k(D, { children: [
403
+ /*#__PURE__*/ k(v, {
404
+ direction: "vertical",
405
+ gap: "3",
406
+ children: [
407
+ /*#__PURE__*/ k(v, {
408
+ direction: "horizontal",
409
+ distribution: "between",
410
+ children: [/*#__PURE__*/ k(v, {
411
+ gap: "2",
412
+ alignment: "center",
413
+ children: [/*#__PURE__*/ O("div", {
414
+ className: "text-theme-default text-2xl font-semibold",
415
+ children: `${d} Certificate Authority Details`
416
+ }), m[e.state]]
417
+ }), /*#__PURE__*/ O(b, {
418
+ onClick: u,
419
+ children: /*#__PURE__*/ O(F, { id: "Blsc/x" })
420
+ })]
421
+ }),
422
+ /*#__PURE__*/ O("p", {
423
+ className: "text-theme-highest text-sm",
424
+ children: /*#__PURE__*/ O(F, { id: "dxMaZH" })
425
+ }),
426
+ e.state === "AWAITING_CERTIFICATE" && /*#__PURE__*/ k(v, {
427
+ direction: "vertical",
428
+ gap: "1",
429
+ className: "bg-dt-background mb-1 rounded-sm p-2",
430
+ children: [/*#__PURE__*/ k(v, {
431
+ direction: "vertical",
432
+ gap: "1",
433
+ children: [/*#__PURE__*/ O("div", {
434
+ className: "text-base font-bold",
435
+ children: /*#__PURE__*/ O(F, { id: "cUKFby" })
436
+ }), /*#__PURE__*/ O("div", { children: /*#__PURE__*/ O(F, { id: "+HVj+D" }) })]
437
+ }), /*#__PURE__*/ k(v, {
438
+ direction: "horizontal",
439
+ gap: "2",
440
+ distribution: "end",
441
+ children: [/*#__PURE__*/ O(b, {
442
+ onClick: o,
443
+ children: /*#__PURE__*/ O(F, { id: "AirKNZ" })
444
+ }), /*#__PURE__*/ O(b, {
445
+ onClick: c,
446
+ children: /*#__PURE__*/ O(F, { id: "3uDz8n" })
447
+ })]
448
+ })]
449
+ }),
450
+ /*#__PURE__*/ O(C, {
451
+ basicInfo: p,
452
+ heading: `Certificate ${d}`,
453
+ content: e?.csr ?? ""
454
+ })
455
+ ]
456
+ }),
457
+ s && /*#__PURE__*/ O(Y, {
458
+ pcaId: e.id,
459
+ open: s,
460
+ onClose: c
461
+ }),
462
+ a && /*#__PURE__*/ O(U, {
463
+ pca: e,
464
+ open: a,
465
+ onClose: o
466
+ }),
467
+ l && /*#__PURE__*/ O(E, {
468
+ pca: e,
469
+ open: l,
470
+ onClose: u,
471
+ onSuccess: f
472
+ }),
473
+ /*#__PURE__*/ O($, {
474
+ pcaId: e.id,
475
+ pcaState: e.state
476
+ })
477
+ ] });
478
+ };
479
+ //#endregion
480
+ //#region src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/index.tsx?tsr-split=component
481
+ function te() {
482
+ let e = N(), t = w(), { pcaId: n } = S.useParams(), { isLoading: r, isError: i, error: a, data: o } = x.services.pca.getById.useQuery({
483
+ project_id: t,
484
+ certificate_authority_id: n
485
+ });
486
+ if (r) return /*#__PURE__*/ k(v, {
487
+ className: "fixed inset-0",
488
+ distribution: "center",
489
+ alignment: "center",
490
+ direction: "vertical",
491
+ children: [/*#__PURE__*/ O(c, {
492
+ variant: "primary",
493
+ size: "large",
494
+ className: "mb-2"
495
+ }), /*#__PURE__*/ O(F, { id: "og1m+J" })]
496
+ });
497
+ let s = () => e({
498
+ to: "/projects/$projectId/services/pca",
499
+ params: { projectId: t }
500
+ });
501
+ if (i) {
502
+ let e = a?.message || "Unknown error";
503
+ return /*#__PURE__*/ k(v, {
504
+ className: "fixed inset-0",
505
+ distribution: "center",
506
+ alignment: "center",
507
+ direction: "vertical",
508
+ gap: "5",
509
+ children: [
510
+ /*#__PURE__*/ O("p", {
511
+ className: "text-theme-error font-semibold",
512
+ children: /*#__PURE__*/ O(F, { id: "IQSLN+" })
513
+ }),
514
+ /*#__PURE__*/ O("p", {
515
+ className: "text-theme-highest",
516
+ children: e
517
+ }),
518
+ /*#__PURE__*/ O(b, {
519
+ onClick: s,
520
+ variant: "primary",
521
+ children: /*#__PURE__*/ O(F, { id: "HG0uMz" })
522
+ })
523
+ ]
524
+ });
525
+ }
526
+ return o ? /*#__PURE__*/ O(ee, { pca: o }) : /*#__PURE__*/ k(v, {
527
+ className: "fixed inset-0",
528
+ distribution: "center",
529
+ alignment: "center",
530
+ direction: "vertical",
531
+ gap: "5",
532
+ children: [/*#__PURE__*/ O("p", {
533
+ className: "text-theme-secondary",
534
+ children: /*#__PURE__*/ O(F, { id: "Io2Dvq" })
535
+ }), /*#__PURE__*/ O(b, {
536
+ onClick: s,
537
+ variant: "primary",
538
+ children: /*#__PURE__*/ O(F, { id: "HG0uMz" })
539
+ })]
540
+ });
541
+ }
542
+ //#endregion
543
+ export { te as component };
544
+
545
+ //# sourceMappingURL=_pcaId-B7j0sXnY.mjs.map