@cobaltcore-dev/aurora 1.3.0 → 2.0.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 (122) hide show
  1. package/dist/client/DeleteFlavorModal-C2MqUgGR.mjs +801 -0
  2. package/dist/client/DeleteFlavorModal-C2MqUgGR.mjs.map +1 -0
  3. package/dist/client/{FiltersInput-CKI6zWnm.mjs → FiltersInput-Becwxo_J.mjs} +36 -33
  4. package/dist/client/FiltersInput-Becwxo_J.mjs.map +1 -0
  5. package/dist/client/{FloatingIpActionModals-Ch8uozH9.mjs → FloatingIpActionModals-Cq10WljB.mjs} +2 -2
  6. package/dist/client/{FloatingIpActionModals-Ch8uozH9.mjs.map → FloatingIpActionModals-Cq10WljB.mjs.map} +1 -1
  7. package/dist/client/ImageToastNotifications-BWfzOUMc.mjs +1135 -0
  8. package/dist/client/ImageToastNotifications-BWfzOUMc.mjs.map +1 -0
  9. package/dist/client/RouteIdLevelDefaultError-CSseJ1yG.mjs +26 -0
  10. package/dist/client/RouteIdLevelDefaultError-CSseJ1yG.mjs.map +1 -0
  11. package/dist/client/{_flavorId-Dg7MS0Af.mjs → _flavorId-CaA4-Pnf.mjs} +4 -3
  12. package/dist/client/_flavorId-CaA4-Pnf.mjs.map +1 -0
  13. package/dist/client/_flavorId-DYv_StX22.mjs +276 -0
  14. package/dist/client/_flavorId-DYv_StX22.mjs.map +1 -0
  15. package/dist/client/_flavorId-YV3jCS5g.mjs +22 -0
  16. package/dist/client/_flavorId-YV3jCS5g.mjs.map +1 -0
  17. package/dist/client/{_floatingIpId-C9xfRWot.mjs → _floatingIpId-BeYElanB.mjs} +2 -2
  18. package/dist/client/{_floatingIpId-C9xfRWot.mjs.map → _floatingIpId-BeYElanB.mjs.map} +1 -1
  19. package/dist/client/{_floatingIpId-DNn6ABCB.mjs → _floatingIpId-Dpsc7GU4.mjs} +5 -5
  20. package/dist/client/{_floatingIpId-DNn6ABCB.mjs.map → _floatingIpId-Dpsc7GU4.mjs.map} +1 -1
  21. package/dist/client/_imageId-mfKp3JHn.mjs +558 -0
  22. package/dist/client/_imageId-mfKp3JHn.mjs.map +1 -0
  23. package/dist/client/_imageId-mpXUMCh_.mjs +22 -0
  24. package/dist/client/_imageId-mpXUMCh_.mjs.map +1 -0
  25. package/dist/client/{_imageId-8JIbFmGB.mjs → _imageId-pBSS0YcC.mjs} +4 -3
  26. package/dist/client/_imageId-pBSS0YcC.mjs.map +1 -0
  27. package/dist/client/{_projectId-B3wmSala.mjs → _projectId-AjgJX6Gl.mjs} +2 -2
  28. package/dist/client/_projectId-AjgJX6Gl.mjs.map +1 -0
  29. package/dist/client/{_projectId-DPzv0CCp.mjs → _projectId-BnTBxKfp.mjs} +4 -4
  30. package/dist/client/_projectId-BnTBxKfp.mjs.map +1 -0
  31. package/dist/client/{_projectId-DfeVJy0G.mjs → _projectId-CVrdJ52s.mjs} +2 -2
  32. package/dist/client/_projectId-CVrdJ52s.mjs.map +1 -0
  33. package/dist/client/_projectId-DgciZslU.mjs +92 -0
  34. package/dist/client/_projectId-DgciZslU.mjs.map +1 -0
  35. package/dist/client/{_securityGroupId-C6eHmrx_.mjs → _securityGroupId-AO3wnH8g.mjs} +2 -2
  36. package/dist/client/_securityGroupId-AO3wnH8g.mjs.map +1 -0
  37. package/dist/client/{_securityGroupId-DmplhDgt.mjs → _securityGroupId-Bq0ZyG6z.mjs} +750 -741
  38. package/dist/client/_securityGroupId-Bq0ZyG6z.mjs.map +1 -0
  39. package/dist/client/_storageType-c-DAu8qr.mjs +858 -0
  40. package/dist/client/_storageType-c-DAu8qr.mjs.map +1 -0
  41. package/dist/client/components/{Error → Errors}/RouteError.d.ts +5 -0
  42. package/dist/client/components/Errors/RouteIdLevelDefaultError.d.ts +17 -0
  43. package/dist/client/components/Errors/ServiceLevelDefaultError.d.ts +9 -0
  44. package/dist/client/components/ListToolbar/SelectedFilters.d.ts +7 -2
  45. package/dist/client/components/ListToolbar/types.d.ts +6 -0
  46. package/dist/client/components/ListToolbar/valueLabels.d.ts +11 -0
  47. package/dist/client/flavors-Bgq3KZmx.mjs +659 -0
  48. package/dist/client/flavors-Bgq3KZmx.mjs.map +1 -0
  49. package/dist/client/{flavors-B1SDOPDu.mjs → flavors-ZudiAiTU.mjs} +2 -2
  50. package/dist/client/{flavors-B1SDOPDu.mjs.map → flavors-ZudiAiTU.mjs.map} +1 -1
  51. package/dist/client/{floatingips-DrCvtXtT.mjs → floatingips-B1oLH8z6.mjs} +6 -6
  52. package/dist/client/{floatingips-DrCvtXtT.mjs.map → floatingips-B1oLH8z6.mjs.map} +1 -1
  53. package/dist/client/floatingips-BeQEkVH8.mjs +14 -0
  54. package/dist/client/floatingips-BeQEkVH8.mjs.map +1 -0
  55. package/dist/client/floatingips-BtLg3yEQ.mjs +22 -0
  56. package/dist/client/floatingips-BtLg3yEQ.mjs.map +1 -0
  57. package/dist/client/floatingips-Cz9k80cc.mjs.map +1 -1
  58. package/dist/client/{images-BGQv9kKT.mjs → images-CnTW3bpy.mjs} +810 -770
  59. package/dist/client/images-CnTW3bpy.mjs.map +1 -0
  60. package/dist/client/{images-CPmMa4SQ.mjs → images-DZHDYDQu.mjs} +2 -2
  61. package/dist/client/{images-CPmMa4SQ.mjs.map → images-DZHDYDQu.mjs.map} +1 -1
  62. package/dist/client/index.js +412 -409
  63. package/dist/client/index.js.map +1 -1
  64. package/dist/client/{objects-DVccbrL1.mjs → objects-25xsh4Ia.mjs} +2 -2
  65. package/dist/client/objects-25xsh4Ia.mjs.map +1 -0
  66. package/dist/client/objects-KXY6dgwq.mjs +82 -0
  67. package/dist/client/objects-KXY6dgwq.mjs.map +1 -0
  68. package/dist/client/objects-QryuClU3.mjs +82 -0
  69. package/dist/client/objects-QryuClU3.mjs.map +1 -0
  70. package/dist/client/{objects-BR3eeSNH.mjs → objects-jYQBFzwg.mjs} +4668 -4699
  71. package/dist/client/objects-jYQBFzwg.mjs.map +1 -0
  72. package/dist/client/projects-yiK0HGSA.mjs.map +1 -1
  73. package/dist/client/securitygroups--0PS2wbM.mjs +580 -0
  74. package/dist/client/securitygroups--0PS2wbM.mjs.map +1 -0
  75. package/dist/client/{securitygroups-DEJQBcxm.mjs → securitygroups-BRndk7wh.mjs} +2 -2
  76. package/dist/client/{securitygroups-DEJQBcxm.mjs.map → securitygroups-BRndk7wh.mjs.map} +1 -1
  77. package/dist/client/securitygroups-CdN4yAAw.mjs +14 -0
  78. package/dist/client/securitygroups-CdN4yAAw.mjs.map +1 -0
  79. package/dist/client/securitygroups-Cs2Op-tu.mjs +22 -0
  80. package/dist/client/securitygroups-Cs2Op-tu.mjs.map +1 -0
  81. package/dist/client/securitygroups-CtKne8UQ.mjs.map +1 -1
  82. package/dist/client/trpcClient.d.ts +6 -1
  83. package/dist/client/useModalTracking-BYd37pXm.mjs +37 -0
  84. package/dist/client/useModalTracking-BYd37pXm.mjs.map +1 -0
  85. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs +294 -0
  86. package/dist/client/useSecurityGroupPermissions--hK4aR8Y.mjs.map +1 -0
  87. package/dist/server/index.d.ts +6 -1
  88. package/dist/server/index.js +96 -30
  89. package/package.json +4 -4
  90. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs +0 -773
  91. package/dist/client/DeleteFlavorModal-V44QCJBd.mjs.map +0 -1
  92. package/dist/client/FiltersInput-CKI6zWnm.mjs.map +0 -1
  93. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs +0 -1152
  94. package/dist/client/ImageToastNotifications-m6c3tVPb.mjs.map +0 -1
  95. package/dist/client/_flavorId-Dg7MS0Af.mjs.map +0 -1
  96. package/dist/client/_flavorId-kHl-b8rI.mjs +0 -232
  97. package/dist/client/_flavorId-kHl-b8rI.mjs.map +0 -1
  98. package/dist/client/_imageId-8JIbFmGB.mjs.map +0 -1
  99. package/dist/client/_imageId-BBAlRioC.mjs +0 -574
  100. package/dist/client/_imageId-BBAlRioC.mjs.map +0 -1
  101. package/dist/client/_projectId-7Nl1MQTJ.mjs +0 -99
  102. package/dist/client/_projectId-7Nl1MQTJ.mjs.map +0 -1
  103. package/dist/client/_projectId-B3wmSala.mjs.map +0 -1
  104. package/dist/client/_projectId-DPzv0CCp.mjs.map +0 -1
  105. package/dist/client/_projectId-DfeVJy0G.mjs.map +0 -1
  106. package/dist/client/_securityGroupId-C6eHmrx_.mjs.map +0 -1
  107. package/dist/client/_securityGroupId-DmplhDgt.mjs.map +0 -1
  108. package/dist/client/_storageType-C5gS9eut.mjs +0 -845
  109. package/dist/client/_storageType-C5gS9eut.mjs.map +0 -1
  110. package/dist/client/flavors-D8_PzQUB.mjs +0 -628
  111. package/dist/client/flavors-D8_PzQUB.mjs.map +0 -1
  112. package/dist/client/images-BGQv9kKT.mjs.map +0 -1
  113. package/dist/client/objects-AERkhfiM.mjs +0 -66
  114. package/dist/client/objects-AERkhfiM.mjs.map +0 -1
  115. package/dist/client/objects-BR3eeSNH.mjs.map +0 -1
  116. package/dist/client/objects-DVccbrL1.mjs.map +0 -1
  117. package/dist/client/securitygroups-BjhgLBHm.mjs +0 -620
  118. package/dist/client/securitygroups-BjhgLBHm.mjs.map +0 -1
  119. package/dist/client/useModalTracking-BcOKTYRN.mjs +0 -33
  120. package/dist/client/useModalTracking-BcOKTYRN.mjs.map +0 -1
  121. package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs +0 -227
  122. package/dist/client/useSecurityGroupPermissions-BOyLQLdC.mjs.map +0 -1
@@ -1,1152 +0,0 @@
1
- import { E as e, K as t, L as n, M as r, Q as i, R as a, S as o, T as s, U as c, X as l, ft as u, h as d, i as f, it as p, m, n as h, o as g, p as _, s as v, st as y, t as b } from "./build-WuxXRAqf.mjs";
2
- import { a as x } from "./trpcClient-D7gpR7YG.mjs";
3
- import { t as S } from "./useProjectId-DBc5lpoU.mjs";
4
- import { n as C } from "./formatBytes-CZv_XyCY.mjs";
5
- import { t as w } from "./useModalTracking-BcOKTYRN.mjs";
6
- import "./hooks-D0yKIumu.mjs";
7
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
8
- import O, { useEffect as k, useMemo as A, useState as j } from "react";
9
- import { Trans as M, useLingui as N } from "@lingui/react";
10
- import { z as P } from "zod";
11
- import { useForm as F, useStore as I } from "@tanstack/react-form";
12
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/SizeDisplay.tsx
13
- function L({ size: e }) {
14
- return e === void 0 ? /*#__PURE__*/ E("span", { children: "N/A" }) : /*#__PURE__*/ E("span", { children: C(e) });
15
- }
16
- //#endregion
17
- //#region src/client/routes/_auth/projects/$projectId/compute/-constants/filters.ts
18
- var R = {
19
- PENDING: "pending",
20
- ACCEPTED: "accepted",
21
- REJECTED: "rejected",
22
- ALL: "all"
23
- }, z = {
24
- QUEUED: "queued",
25
- SAVING: "saving",
26
- ACTIVE: "active",
27
- DEACTIVATED: "deactivated",
28
- KILLED: "killed",
29
- DELETED: "deleted",
30
- PENDING_DELETE: "pending_delete"
31
- }, B = {
32
- PUBLIC: "public",
33
- PRIVATE: "private",
34
- SHARED: "shared",
35
- COMMUNITY: "community",
36
- ALL: "all"
37
- }, V = {
38
- AMI: "ami",
39
- ARI: "ari",
40
- AKI: "aki",
41
- VHD: "vhd",
42
- VHDX: "vhdx",
43
- VMDK: "vmdk",
44
- RAW: "raw",
45
- QCOW2: "qcow2",
46
- VDI: "vdi",
47
- ISO: "iso",
48
- PLOOP: "ploop"
49
- }, H = {
50
- AMI: "ami",
51
- ARI: "ari",
52
- AKI: "aki",
53
- BARE: "bare",
54
- OVF: "ovf",
55
- OVA: "ova",
56
- DOCKER: "docker"
57
- }, U = ({ memberId: e, imageId: t, errors: n, isLoading: i, onMemberIdChange: a, onSave: o, onCancel: c }) => {
58
- let { i18n: l, _: u } = N();
59
- return /*#__PURE__*/ D(s, { children: [
60
- /*#__PURE__*/ E(b, {
61
- className: "break-all",
62
- children: t
63
- }),
64
- /*#__PURE__*/ E(b, {
65
- className: "pl-0",
66
- children: /*#__PURE__*/ E(m, {
67
- value: e,
68
- onChange: (e) => a(e.target.value),
69
- placeholder: l._({ id: "TpGxnq" }),
70
- errortext: n.memberId,
71
- required: !0
72
- })
73
- }),
74
- /*#__PURE__*/ E(b, {}),
75
- /*#__PURE__*/ E(b, { children: /*#__PURE__*/ D(r, { children: [/*#__PURE__*/ E(f, {
76
- icon: "check",
77
- onClick: o,
78
- variant: "primary",
79
- title: l._({ id: "3Qn0me" }),
80
- disabled: i
81
- }), /*#__PURE__*/ E(f, {
82
- icon: "cancel",
83
- onClick: c,
84
- title: l._({ id: "dEgA5A" }),
85
- disabled: i
86
- })] }) })
87
- ] });
88
- }, ee = ({ member: e, isDeleting: n, onDelete: r, canDelete: a }) => {
89
- let { i18n: o, _: c } = N(), [l, u] = j(!1);
90
- k(() => {
91
- if (l) {
92
- let e = setTimeout(() => {
93
- u(!1);
94
- }, 3e3);
95
- return () => clearTimeout(e);
96
- }
97
- }, [l]);
98
- let d = () => {
99
- u(!1), r();
100
- };
101
- return /*#__PURE__*/ D(s, { children: [
102
- /*#__PURE__*/ E(b, {
103
- className: "break-all",
104
- children: e.image_id
105
- }),
106
- /*#__PURE__*/ E(b, {
107
- className: "break-all",
108
- children: e.member_id
109
- }),
110
- /*#__PURE__*/ E(b, {
111
- className: `break-all text-theme-${((e) => {
112
- switch (e) {
113
- case R.PENDING: return "warning";
114
- case R.ACCEPTED: return "success";
115
- case R.REJECTED: return "danger";
116
- default: return "default";
117
- }
118
- })(e.status)}`,
119
- children: ((e) => {
120
- switch (e) {
121
- case R.PENDING: return o._({ id: "UbRKMZ" });
122
- case R.ACCEPTED: return o._({ id: "bzMKg7" });
123
- case R.REJECTED: return o._({ id: "ekCRTP" });
124
- default: return e;
125
- }
126
- })(e.status)
127
- }),
128
- /*#__PURE__*/ E(b, { children: n ? /*#__PURE__*/ E(i, {
129
- distribution: "center",
130
- alignment: "center",
131
- children: /*#__PURE__*/ E(t, { variant: "primary" })
132
- }) : /*#__PURE__*/ E(i, {
133
- distribution: "end",
134
- alignment: "end",
135
- children: (() => {
136
- if (!a) return /*#__PURE__*/ E(T, {});
137
- if (l) return /*#__PURE__*/ E(f, {
138
- variant: "primary-danger",
139
- onClick: d,
140
- title: o._({ id: "n9jJG6" }),
141
- "aria-label": o._({ id: "n9jJG6" }),
142
- "data-testid": "confirm-removal",
143
- disabled: n,
144
- children: o._({ id: "t/YqKh" })
145
- });
146
- {
147
- let t = e.member_id;
148
- return /*#__PURE__*/ E(f, {
149
- icon: "deleteForever",
150
- onClick: () => u(!0),
151
- title: o._({
152
- id: "pebLmQ",
153
- values: { memberIdDisplay: t }
154
- }),
155
- "aria-label": o._({
156
- id: "pebLmQ",
157
- values: { memberIdDisplay: t }
158
- }),
159
- "data-testid": `remove-${t}`,
160
- disabled: n
161
- });
162
- }
163
- })()
164
- }) })
165
- ] });
166
- };
167
- //#endregion
168
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/ImageMembersTable.tsx
169
- function te() {
170
- return /*#__PURE__*/ E(s, { children: /*#__PURE__*/ E(b, {
171
- colSpan: 4,
172
- children: /*#__PURE__*/ E(i, {
173
- distribution: "center",
174
- alignment: "center",
175
- children: /*#__PURE__*/ E(t, { variant: "primary" })
176
- })
177
- }) });
178
- }
179
- var W = ({ image: e, imageMembers: t, isMembersLoading: r, canAdd: a, canRemove: c, isAddingMember: l, setIsAddingMember: u, setMessage: d, projectId: p }) => {
180
- let { i18n: m, _: h } = N(), _ = x.useUtils(), [v, y] = j(""), [S, C] = j({}), [w, O] = j(/* @__PURE__ */ new Set()), k = x.compute.createImageMember.useMutation({ onSuccess: () => {
181
- _.compute.listImageMembers.invalidate({
182
- project_id: p,
183
- imageId: e.id
184
- });
185
- } }), A = x.compute.deleteImageMember.useMutation({ onSuccess: () => {
186
- _.compute.listImageMembers.invalidate({
187
- project_id: p,
188
- imageId: e.id
189
- });
190
- } }), M = e.visibility === "public", P = !t || t.length === 0, F = k.isPending || A.isPending, I = () => {
191
- let e = v.trim(), n = {};
192
- return e ? t?.some((t) => t.member_id === e) && (n.memberId = m._({ id: "jyqLKs" })) : n.memberId = m._({ id: "S5CUKP" }), C(n), Object.keys(n).length === 0;
193
- }, L = () => {
194
- y(""), C({});
195
- }, R = async () => {
196
- if (!I()) {
197
- d({
198
- text: m._({ id: "CBFSfX" }),
199
- type: "error"
200
- });
201
- return;
202
- }
203
- let t = v.trim();
204
- try {
205
- await k.mutateAsync({
206
- project_id: p,
207
- imageId: e.id,
208
- member: t
209
- }), d({
210
- text: m._({
211
- id: "Sgz1vJ",
212
- values: { trimmedMemberId: t }
213
- }),
214
- type: "info"
215
- }), L(), u(!1);
216
- } catch (e) {
217
- d({
218
- text: e?.message || m._({ id: "9doWrf" }),
219
- type: "error"
220
- });
221
- }
222
- }, z = async (t) => {
223
- O((e) => new Set(e).add(t));
224
- try {
225
- await A.mutateAsync({
226
- project_id: p,
227
- imageId: e.id,
228
- memberId: t
229
- }), d({
230
- text: m._({
231
- id: "4O2AH3",
232
- values: { memberIdToRemove: t }
233
- }),
234
- type: "info"
235
- });
236
- } catch (e) {
237
- d({
238
- text: e?.message || m._({ id: "n46oLW" }) || m._({
239
- id: "7T1fHv",
240
- values: { memberIdToRemove: t }
241
- }),
242
- type: "error"
243
- });
244
- } finally {
245
- O((e) => {
246
- let n = new Set(e);
247
- return n.delete(t), n;
248
- });
249
- }
250
- };
251
- return r ? /*#__PURE__*/ D(g, {
252
- columns: 4,
253
- children: [/*#__PURE__*/ D(s, { children: [
254
- /*#__PURE__*/ E(o, { children: m._({ id: "vrPCbw" }) }),
255
- /*#__PURE__*/ E(o, { children: m._({ id: "mSfwLL" }) }),
256
- /*#__PURE__*/ E(o, { children: m._({ id: "uAQUqI" }) }),
257
- /*#__PURE__*/ E(o, {})
258
- ] }), /*#__PURE__*/ E(te, {})]
259
- }) : M ? /*#__PURE__*/ E(n, {
260
- text: m._({ id: "6H/Lg1" }),
261
- variant: "info"
262
- }) : /*#__PURE__*/ D(T, { children: [a && /*#__PURE__*/ E(i, {
263
- direction: "horizontal",
264
- className: "bg-theme-background-lvl-1 justify-end p-2",
265
- children: /*#__PURE__*/ E(f, {
266
- label: m._({ id: "VCM3KS" }),
267
- "data-testid": "addMemberButton",
268
- onClick: () => u(!0),
269
- variant: "primary",
270
- disabled: l
271
- })
272
- }), /*#__PURE__*/ D(g, {
273
- columns: 4,
274
- children: [
275
- /*#__PURE__*/ D(s, { children: [
276
- /*#__PURE__*/ E(o, { children: m._({ id: "vrPCbw" }) }),
277
- /*#__PURE__*/ E(o, { children: m._({ id: "NRVSdy" }) }),
278
- /*#__PURE__*/ E(o, { children: m._({ id: "uAQUqI" }) }),
279
- /*#__PURE__*/ E(o, {})
280
- ] }),
281
- l && /*#__PURE__*/ E(U, {
282
- memberId: v,
283
- imageId: e.id,
284
- errors: S,
285
- isLoading: F,
286
- onMemberIdChange: (e) => {
287
- y(e), S.memberId && C((e) => ({
288
- ...e,
289
- memberId: void 0
290
- }));
291
- },
292
- onSave: R,
293
- onCancel: () => {
294
- L(), u(!1), d(null);
295
- }
296
- }),
297
- t?.map((e, t) => /*#__PURE__*/ E(ee, {
298
- member: e,
299
- isDeleting: w.has(e.member_id),
300
- onDelete: () => z(e.member_id),
301
- canDelete: c
302
- }, `${e.member_id}-${t}`)),
303
- P && !l && /*#__PURE__*/ E(s, { children: /*#__PURE__*/ E(b, {
304
- colSpan: 4,
305
- className: "text-theme-default py-4 text-center",
306
- children: m._({ id: "H7u085" })
307
- }) })
308
- ]
309
- })] });
310
- }, G = ({ image: e, isOpen: n, isLoading: r = !1, onClose: o, onSave: s }) => {
311
- let { i18n: h, _: g } = N(), [v, b] = j({
312
- name: e.name || "",
313
- tags: e.tags || [],
314
- visibility: e.visibility || B.PRIVATE,
315
- protected: e.protected || !1,
316
- min_disk: e.min_disk || 0,
317
- min_ram: e.min_ram || 0
318
- }), [x, S] = j(""), [C, w] = j({}), T = (e, t) => {
319
- if (e.length !== t.length) return !1;
320
- let n = [...e].sort(), r = [...t].sort();
321
- return n.every((e, t) => e === r[t]);
322
- }, O = e.name === v.name && T(e.tags || [], v.tags) && e.visibility === v.visibility && e.protected === v.protected && e.min_disk === v.min_disk && e.min_ram === v.min_ram, k = (e) => {
323
- let { name: t, value: n, type: r, checked: i } = e.target;
324
- b((e) => ({
325
- ...e,
326
- [t]: r === "checkbox" ? i : n
327
- })), C[t] && w((e) => {
328
- let n = { ...e };
329
- return delete n[t], n;
330
- });
331
- }, A = (e, t) => {
332
- b((n) => ({
333
- ...n,
334
- [e]: t
335
- })), C[e] && w((t) => {
336
- let n = { ...t };
337
- return delete n[e], n;
338
- });
339
- }, P = (e, t) => {
340
- let n = t === "" ? 0 : parseInt(t, 10);
341
- isNaN(n) || (b((t) => ({
342
- ...t,
343
- [e]: n
344
- })), C[e] && w((t) => {
345
- let n = { ...t };
346
- return delete n[e], n;
347
- }));
348
- }, F = (e) => {
349
- S(e.target.value);
350
- }, I = () => {
351
- let e = x.trim();
352
- if (e !== "") {
353
- if (v.tags.includes(e)) {
354
- S("");
355
- return;
356
- }
357
- b((t) => ({
358
- ...t,
359
- tags: [...t.tags, e]
360
- })), S("");
361
- }
362
- }, L = (e) => {
363
- e.key === "Enter" && (e.preventDefault(), I());
364
- }, R = (e) => {
365
- b((t) => ({
366
- ...t,
367
- tags: t.tags.filter((t) => t !== e)
368
- }));
369
- }, z = () => {
370
- let e = {};
371
- return (!v.name || v.name.trim() === "") && (e.name = h._({ id: "wyIOMP" })), v.min_disk < 0 && (e.min_disk = h._({ id: "K3bUTE" })), v.min_ram < 0 && (e.min_ram = h._({ id: "PEGvy+" })), w(e), Object.keys(e).length === 0;
372
- };
373
- return /*#__PURE__*/ D(l, {
374
- open: n,
375
- onCancel: () => {
376
- w({}), o();
377
- },
378
- size: "large",
379
- title: h._({ id: "M5Epeo" }),
380
- onConfirm: (t) => {
381
- t.preventDefault(), z() && s({
382
- ...e.name === v.name.trim() ? {} : { name: v.name.trim() },
383
- ...T(e.tags || [], v.tags) ? {} : { tags: v.tags },
384
- ...e.visibility === v.visibility ? {} : { visibility: v.visibility },
385
- ...e.protected === v.protected ? {} : { protected: v.protected },
386
- ...e.min_disk === v.min_disk ? {} : { min_disk: v.min_disk },
387
- ...e.min_ram === v.min_ram ? {} : { min_ram: v.min_ram }
388
- });
389
- },
390
- confirmButtonLabel: h._({ id: "IUwGEM" }),
391
- cancelButtonLabel: h._({ id: "dEgA5A" }),
392
- disableConfirmButton: r || O,
393
- children: [r && /*#__PURE__*/ E(i, {
394
- distribution: "center",
395
- alignment: "center",
396
- children: /*#__PURE__*/ E(t, { variant: "primary" })
397
- }), !r && /*#__PURE__*/ D(u, { children: [/*#__PURE__*/ D(_, {
398
- className: "mb-6",
399
- children: [
400
- /*#__PURE__*/ E(d, {
401
- className: "mb-4",
402
- children: /*#__PURE__*/ E(m, {
403
- id: "name",
404
- name: "name",
405
- label: h._({ id: "ExLULX" }),
406
- value: v.name,
407
- onChange: k,
408
- required: !0,
409
- errortext: C.name
410
- })
411
- }),
412
- /*#__PURE__*/ E(d, {
413
- className: "my-6",
414
- children: /*#__PURE__*/ D("div", {
415
- className: "w-full",
416
- children: [/*#__PURE__*/ D(i, {
417
- gap: "2",
418
- direction: "horizontal",
419
- alignment: "start",
420
- children: [/*#__PURE__*/ E("div", {
421
- className: "flex-1",
422
- children: /*#__PURE__*/ E(m, {
423
- id: "tags",
424
- name: "tags",
425
- label: h._({ id: "OYHzN1" }),
426
- value: x,
427
- onChange: F,
428
- onKeyDown: L,
429
- helptext: h._({ id: "MOug+V" }),
430
- placeholder: h._({ id: "y+KBOY" })
431
- })
432
- }), /*#__PURE__*/ E(f, {
433
- variant: "primary",
434
- onClick: I,
435
- disabled: r || x.trim() === "",
436
- children: /*#__PURE__*/ E(M, { id: "m16xKo" })
437
- })]
438
- }), v.tags.length > 0 && /*#__PURE__*/ E(i, {
439
- gap: "2",
440
- wrap: !0,
441
- alignment: "center",
442
- className: "mt-3",
443
- children: v.tags.map((e) => /*#__PURE__*/ E(c, {
444
- closeable: !0,
445
- pillKey: "",
446
- pillValue: e,
447
- onClose: () => R(e)
448
- }, e))
449
- })]
450
- })
451
- }),
452
- /*#__PURE__*/ E(d, {
453
- className: "mb-4",
454
- children: /*#__PURE__*/ D(p, {
455
- id: "visibility",
456
- name: "visibility",
457
- label: h._({ id: "2q/Q7x" }),
458
- value: v.visibility,
459
- onChange: (e) => A("visibility", e),
460
- children: [
461
- /*#__PURE__*/ E(a, {
462
- value: B.PUBLIC,
463
- label: h._({ id: "7d1a0d" })
464
- }),
465
- /*#__PURE__*/ E(a, {
466
- value: B.PRIVATE,
467
- label: h._({ id: "zwBp5t" })
468
- }),
469
- /*#__PURE__*/ E(a, {
470
- value: B.SHARED,
471
- label: h._({ id: "0Gd0NU" })
472
- }),
473
- /*#__PURE__*/ E(a, {
474
- value: B.COMMUNITY,
475
- label: h._({ id: "chL5IG" })
476
- })
477
- ]
478
- })
479
- }),
480
- /*#__PURE__*/ E(d, { children: /*#__PURE__*/ E(y, {
481
- id: "protected",
482
- name: "protected",
483
- label: h._({ id: "644xgx" }),
484
- checked: v.protected,
485
- onChange: k,
486
- helptext: h._({ id: "lAsm87" })
487
- }) })
488
- ]
489
- }), /*#__PURE__*/ D(_, {
490
- className: "mb-6",
491
- children: [/*#__PURE__*/ E(d, {
492
- className: "mb-4",
493
- children: /*#__PURE__*/ E(m, {
494
- id: "min_disk",
495
- name: "min_disk",
496
- label: h._({ id: "tbwGSx" }),
497
- type: "number",
498
- value: String(v.min_disk),
499
- onChange: (e) => P("min_disk", e.target.value),
500
- helptext: h._({ id: "RFDYCD" }),
501
- errortext: C.min_disk
502
- })
503
- }), /*#__PURE__*/ E(d, { children: /*#__PURE__*/ E(m, {
504
- id: "min_ram",
505
- name: "min_ram",
506
- label: h._({ id: "UYSopm" }),
507
- type: "number",
508
- value: String(v.min_ram),
509
- onChange: (e) => P("min_ram", e.target.value),
510
- helptext: h._({ id: "WErCZy" }),
511
- errortext: C.min_ram
512
- }) })]
513
- })] })]
514
- });
515
- };
516
- //#endregion
517
- //#region src/client/routes/_auth/projects/$projectId/compute/images/-components/EditImageMetadataModal.tsx
518
- function K(e) {
519
- return e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
520
- }
521
- function q(e, t) {
522
- return Object.entries(e).filter(([e]) => !t.has(e.toLowerCase())).map(([e, t]) => {
523
- let n = K(t);
524
- return {
525
- key: e,
526
- value: n,
527
- isNew: !1,
528
- isEditing: !1,
529
- originalKey: e,
530
- originalValue: n
531
- };
532
- });
533
- }
534
- function J({ isLoading: n, onClose: r, onSave: a, initialMetadata: o, excludedProperties: s }) {
535
- let { i18n: c, _: u } = N(), [d, p] = j(o), [g, _] = j({}), [y, b] = j(!1), [x, S] = j(""), [C, w] = j(""), [A, M] = j(null);
536
- k(() => {
537
- if (A !== null) {
538
- let e = setTimeout(() => M(null), 3e3);
539
- return () => clearTimeout(e);
540
- }
541
- }, [A]);
542
- let P = d.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue) && o.length === d.length, F = (e, t, n) => {
543
- let r = e?.trim().toLowerCase();
544
- return r ? s.has(r) ? c._({ id: "n3eQzA" }) : d.some((e, i) => e.key.trim().toLowerCase() === r && i !== n && e.originalKey !== t) ? c._({ id: "i6/ygf" }) : null : c._({ id: "QV1ZPO" });
545
- }, I = () => {
546
- let e = F(x, void 0, d.length);
547
- if (e) {
548
- _({ newKey: e });
549
- return;
550
- }
551
- if (!C.trim()) {
552
- _({ newValue: c._({ id: "hXUWyd" }) });
553
- return;
554
- }
555
- p([...d, {
556
- key: x.trim(),
557
- value: C.trim(),
558
- isNew: !0,
559
- isEditing: !1
560
- }]), S(""), w(""), b(!1), _({});
561
- }, L = () => {
562
- S(""), w(""), b(!1), _({});
563
- }, R = (e) => {
564
- M(null), p(d.map((t, n) => n === e ? {
565
- ...t,
566
- isEditing: !0
567
- } : {
568
- ...t,
569
- isEditing: !1
570
- })), b(!1);
571
- }, z = (e) => {
572
- let t = d[e], n = F(t.key, t.originalKey, e);
573
- if (n) {
574
- _({ [`edit-${e}`]: n });
575
- return;
576
- }
577
- if (!t.value.trim()) {
578
- _({ [`edit-${e}`]: c._({ id: "hXUWyd" }) });
579
- return;
580
- }
581
- p(d.map((t, n) => n === e ? {
582
- ...t,
583
- isEditing: !1,
584
- key: t.key.trim(),
585
- value: t.value.trim()
586
- } : t)), _({});
587
- }, B = (e) => {
588
- p(d.map((t, n) => n === e ? {
589
- ...t,
590
- isEditing: !1,
591
- key: t.originalKey ?? t.key,
592
- value: t.originalValue ?? t.value
593
- } : t)), _({});
594
- }, V = (e) => {
595
- p(d.filter((t, n) => n !== e)), M(null), _({});
596
- }, H = (e, t) => {
597
- p(d.map((n, r) => r === e ? {
598
- ...n,
599
- key: t
600
- } : n)), g[`edit-${e}`] && _((t) => {
601
- let n = { ...t };
602
- return delete n[`edit-${e}`], n;
603
- });
604
- }, U = (e, t) => {
605
- p(d.map((n, r) => r === e ? {
606
- ...n,
607
- value: t
608
- } : n)), g[`edit-${e}`] && _((t) => {
609
- let n = { ...t };
610
- return delete n[`edit-${e}`], n;
611
- });
612
- };
613
- return /*#__PURE__*/ E(l, {
614
- open: !0,
615
- onCancel: () => {
616
- p(o), b(!1), S(""), w(""), _({}), r();
617
- },
618
- size: "large",
619
- title: c._({ id: "yTtJTy" }),
620
- onConfirm: async () => {
621
- let e = {}, t = Object.fromEntries(o.filter((e) => !d.map((e) => e.originalKey).includes(e.originalKey) || !d.map((e) => e.key).includes(e.key)).map((e) => [e.key, null]));
622
- d.filter((e) => e.isNew || e.value !== e.originalValue || e.key !== e.originalKey).forEach((t) => {
623
- e[t.key] = t.value;
624
- }), await a({
625
- ...e,
626
- ...t
627
- }) && r();
628
- },
629
- confirmButtonLabel: c._({ id: "IUwGEM" }),
630
- cancelButtonLabel: c._({ id: "dEgA5A" }),
631
- disableConfirmButton: n || y || d.some((e) => e.isEditing) || P,
632
- children: n ? /*#__PURE__*/ E(i, {
633
- distribution: "center",
634
- alignment: "center",
635
- children: /*#__PURE__*/ E(t, { variant: "primary" })
636
- }) : /*#__PURE__*/ D("div", { children: [/*#__PURE__*/ E(i, {
637
- direction: "horizontal",
638
- className: "jn:bg-theme-background-lvl-1 mb-4 justify-end p-2",
639
- children: /*#__PURE__*/ E(f, {
640
- label: c._({ id: "sWBLli" }),
641
- onClick: () => b(!0),
642
- variant: "primary",
643
- disabled: y || d.some((e) => e.isEditing),
644
- icon: "addCircle"
645
- })
646
- }), d.length === 0 && !y ? /*#__PURE__*/ E("p", {
647
- className: "jn:text-theme-light py-8 text-center",
648
- children: c._({ id: "t1POAD" })
649
- }) : /*#__PURE__*/ D(v, {
650
- className: "mb-6",
651
- children: [
652
- /*#__PURE__*/ E(h, { children: c._({ id: "T8N6oi" }) }),
653
- /*#__PURE__*/ E(e, { children: c._({ id: "wMHvYH" }) }),
654
- /*#__PURE__*/ E(T, { children: y && /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E(h, { children: /*#__PURE__*/ E(m, {
655
- value: x,
656
- onChange: (e) => {
657
- S(e.target.value), g.newKey && _((e) => {
658
- let t = { ...e };
659
- return delete t.newKey, t;
660
- });
661
- },
662
- placeholder: c._({ id: "x9AdZ8" }),
663
- errortext: g.newKey,
664
- autoFocus: !0
665
- }) }), /*#__PURE__*/ E(e, { children: /*#__PURE__*/ D(i, {
666
- direction: "horizontal",
667
- gap: "2",
668
- alignment: "center",
669
- className: "justify-between",
670
- children: [/*#__PURE__*/ E(m, {
671
- value: C,
672
- onChange: (e) => {
673
- w(e.target.value), g.newValue && _((e) => {
674
- let t = { ...e };
675
- return delete t.newValue, t;
676
- });
677
- },
678
- placeholder: c._({ id: "wMHvYH" }),
679
- errortext: g.newValue
680
- }), /*#__PURE__*/ D(i, {
681
- direction: "horizontal",
682
- gap: "2",
683
- children: [/*#__PURE__*/ E(f, {
684
- size: "small",
685
- variant: "primary",
686
- onClick: I,
687
- icon: "check",
688
- title: c._({ id: "tfDRzk" })
689
- }), /*#__PURE__*/ E(f, {
690
- size: "small",
691
- variant: "subdued",
692
- onClick: L,
693
- icon: "close",
694
- title: c._({ id: "bzSI52" })
695
- })]
696
- })]
697
- }) })] }) }),
698
- /*#__PURE__*/ E(T, { children: d.map((t, n) => /*#__PURE__*/ D(O.Fragment, { children: [/*#__PURE__*/ E(h, { children: t.isEditing ? /*#__PURE__*/ E(m, {
699
- value: t.key,
700
- onChange: (e) => H(n, e.target.value),
701
- errortext: g[`edit-${n}`]
702
- }) : /*#__PURE__*/ E("span", {
703
- className: "jn:text-theme-high block max-w-xs truncate",
704
- title: t.key,
705
- children: t.key
706
- }) }), /*#__PURE__*/ E(e, {
707
- className: "flex items-center justify-between gap-2",
708
- children: t.isEditing ? /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E(m, {
709
- value: t.value,
710
- onChange: (e) => U(n, e.target.value)
711
- }), /*#__PURE__*/ D(i, {
712
- direction: "horizontal",
713
- gap: "2",
714
- children: [/*#__PURE__*/ E(f, {
715
- size: "small",
716
- variant: "primary",
717
- onClick: () => z(n),
718
- icon: "check",
719
- title: c._({ id: "tfDRzk" })
720
- }), /*#__PURE__*/ E(f, {
721
- size: "small",
722
- variant: "subdued",
723
- onClick: () => B(n),
724
- icon: "close",
725
- title: c._({ id: "bzSI52" })
726
- })]
727
- })] }) : /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E("span", {
728
- className: "jn:text-theme-default block max-w-md truncate",
729
- title: t.value,
730
- children: t.value
731
- }), /*#__PURE__*/ D(i, {
732
- direction: "horizontal",
733
- gap: "2",
734
- children: [A !== n && /*#__PURE__*/ E(f, {
735
- size: "small",
736
- variant: "subdued",
737
- onClick: () => R(n),
738
- icon: "edit",
739
- "data-testid": `edit-${t.key}`,
740
- title: c._({ id: "ePK91l" }),
741
- disabled: y || d.some((e) => e.isEditing)
742
- }), A === n ? /*#__PURE__*/ E(f, {
743
- size: "small",
744
- variant: "primary-danger",
745
- onClick: () => V(n),
746
- "data-testid": `confirm-delete-${t.key}`,
747
- title: c._({ id: "cnGeoo" }),
748
- disabled: y || d.some((e) => e.isEditing),
749
- children: c._({ id: "cnGeoo" })
750
- }) : /*#__PURE__*/ E(f, {
751
- size: "small",
752
- onClick: () => M(n),
753
- icon: "deleteForever",
754
- "data-testid": `delete-${t.key}`,
755
- title: c._({ id: "cnGeoo" }),
756
- disabled: y || d.some((e) => e.isEditing)
757
- })]
758
- })] })
759
- })] }, `${t.originalKey}-${n}`)) })
760
- ]
761
- })] })
762
- });
763
- }
764
- var Y = ({ image: e, isOpen: n, isLoading: r = !1, onClose: a, onSave: o }) => {
765
- let { i18n: s, _: c } = N(), u = S(), { data: d, isLoading: f, isError: p } = x.compute.getImageMetadataExcludedProperties.useQuery({ project_id: u }, { enabled: n }), m = A(() => new Set((d ?? []).map((e) => e.toLowerCase())), [d]), h = A(() => q(e, m), [
766
- e.id,
767
- e.updated_at,
768
- m
769
- ]);
770
- return n ? f ? /*#__PURE__*/ E(l, {
771
- open: !0,
772
- onCancel: a,
773
- size: "large",
774
- title: s._({ id: "yTtJTy" }),
775
- children: /*#__PURE__*/ E(i, {
776
- distribution: "center",
777
- alignment: "center",
778
- children: /*#__PURE__*/ E(t, { variant: "primary" })
779
- })
780
- }) : p ? /*#__PURE__*/ E(l, {
781
- open: !0,
782
- onCancel: a,
783
- size: "large",
784
- title: s._({ id: "yTtJTy" }),
785
- children: /*#__PURE__*/ E(i, {
786
- distribution: "center",
787
- alignment: "center",
788
- children: /*#__PURE__*/ E("span", { children: s._({ id: "PYQUjU" }) })
789
- })
790
- }) : /*#__PURE__*/ E(J, {
791
- isLoading: r,
792
- onClose: a,
793
- onSave: o,
794
- initialMetadata: h,
795
- excludedProperties: m
796
- }, `${e.id}-${e.updated_at}-${m.size}`) : null;
797
- }, X = ({ image: t, isOpen: n, isLoading: r, isDisabled: a, onClose: o, onDelete: s }) => {
798
- if (!t) return null;
799
- let { i18n: c, _: d } = N(), { trackClose: f, markSubmitted: p, resetTracking: g } = w({
800
- isOpen: n,
801
- actionPrefix: "compute.image.delete"
802
- }), y = P.object({ confirm: P.string().refine((e) => e === "delete", { message: c._({ id: "QytzQr" }) }) }), b = F({
803
- defaultValues: { confirm: "" },
804
- validators: { onSubmit: y },
805
- onSubmit: async () => {
806
- r || a || (p(), s(t), S());
807
- }
808
- }), x = I(b.store, (e) => e.isSubmitting || e.values.confirm !== "delete"), S = () => {
809
- f(), b.reset(), g(), o();
810
- }, C = r ? c._({ id: "EF2EU9" }) : c._({ id: "KWa0gi" }), T = t?.name || t?.id;
811
- return /*#__PURE__*/ E(l, {
812
- open: n,
813
- onCancel: S,
814
- size: "small",
815
- title: c._({
816
- id: "XbeFW9",
817
- values: { imageName: T }
818
- }),
819
- confirmButtonLabel: C,
820
- confirmButtonVariant: "primary-danger",
821
- onConfirm: b.handleSubmit,
822
- cancelButtonLabel: c._({ id: "dEgA5A" }),
823
- disableConfirmButton: x || r || a,
824
- disableCancelButton: r,
825
- disableCloseButton: r,
826
- children: /*#__PURE__*/ D(i, {
827
- direction: "vertical",
828
- gap: "4",
829
- children: [
830
- /*#__PURE__*/ E("p", {
831
- className: "text-theme-default",
832
- children: /*#__PURE__*/ E(M, { id: "2zceEg" })
833
- }),
834
- t && /*#__PURE__*/ D(v, { children: [
835
- /*#__PURE__*/ E(h, { children: c._({ id: "6YtxFj" }) }),
836
- /*#__PURE__*/ E(e, { children: t.name || c._({ id: "MEIAzV" }) }),
837
- /*#__PURE__*/ E(h, { children: c._({ id: "dFb5Nt" }) }),
838
- /*#__PURE__*/ E(e, { children: t.id }),
839
- /*#__PURE__*/ E(h, { children: c._({ id: "uAQUqI" }) }),
840
- /*#__PURE__*/ E(e, { children: t.status }),
841
- /*#__PURE__*/ E(h, { children: c._({ id: "2q/Q7x" }) }),
842
- /*#__PURE__*/ E(e, { children: t.visibility }),
843
- /*#__PURE__*/ E(h, { children: c._({ id: "Cj2Gtd" }) }),
844
- /*#__PURE__*/ E(e, { children: /*#__PURE__*/ E(L, { size: t.size }) }),
845
- /*#__PURE__*/ E(h, { children: c._({ id: "NopYGU" }) }),
846
- /*#__PURE__*/ E(e, { children: t.disk_format || c._({ id: "fj5byd" }) }),
847
- /*#__PURE__*/ E(h, { children: c._({ id: "d+F6q9" }) }),
848
- /*#__PURE__*/ E(e, { children: t.created_at ? new Date(t.created_at).toLocaleDateString() : c._({ id: "fj5byd" }) })
849
- ] }),
850
- /*#__PURE__*/ E(u, {
851
- className: "mb-0",
852
- id: "delete-image-form",
853
- onSubmit: (e) => {
854
- e.preventDefault(), b.handleSubmit();
855
- },
856
- children: /*#__PURE__*/ E(_, { children: /*#__PURE__*/ E(b.Field, {
857
- name: "confirm",
858
- children: (e) => /*#__PURE__*/ E(m, {
859
- id: e.name,
860
- name: e.name,
861
- label: c._({ id: "QytzQr" }),
862
- value: e.state.value,
863
- onChange: (t) => e.handleChange(t.target.value),
864
- placeholder: "delete",
865
- autoFocus: !0,
866
- disabled: r,
867
- required: !0
868
- })
869
- }) })
870
- })
871
- ]
872
- })
873
- });
874
- }, Z = ({ image: n, isOpen: r, isLoading: a, onClose: o, onActivate: s }) => {
875
- if (!n) return null;
876
- let { i18n: c, _: u } = N();
877
- return /*#__PURE__*/ D(l, {
878
- onCancel: o,
879
- size: "small",
880
- title: c._({ id: "RSFkXF" }),
881
- open: r,
882
- onConfirm: (e) => {
883
- e.preventDefault(), s(n);
884
- },
885
- confirmButtonLabel: c._({ id: "FQBaXG" }),
886
- cancelButtonLabel: c._({ id: "dEgA5A" }),
887
- disableConfirmButton: a,
888
- children: [a && /*#__PURE__*/ E(i, {
889
- distribution: "center",
890
- alignment: "center",
891
- children: /*#__PURE__*/ E(t, { variant: "primary" })
892
- }), !a && /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E("p", {
893
- className: "mb-4",
894
- children: c._({ id: "+NwLgN" })
895
- }), /*#__PURE__*/ D(v, { children: [
896
- /*#__PURE__*/ E(h, { children: c._({ id: "6YtxFj" }) }),
897
- /*#__PURE__*/ E(e, { children: n.name || c._({ id: "MEIAzV" }) }),
898
- /*#__PURE__*/ E(h, { children: c._({ id: "dFb5Nt" }) }),
899
- /*#__PURE__*/ E(e, { children: n.id }),
900
- /*#__PURE__*/ E(h, { children: c._({ id: "uAQUqI" }) }),
901
- /*#__PURE__*/ E(e, { children: n.status }),
902
- /*#__PURE__*/ E(h, { children: c._({ id: "2q/Q7x" }) }),
903
- /*#__PURE__*/ E(e, { children: n.visibility }),
904
- /*#__PURE__*/ E(h, { children: c._({ id: "Cj2Gtd" }) }),
905
- /*#__PURE__*/ E(e, { children: /*#__PURE__*/ E(L, { size: n.size }) }),
906
- /*#__PURE__*/ E(h, { children: c._({ id: "NopYGU" }) }),
907
- /*#__PURE__*/ E(e, { children: n.disk_format || c._({ id: "fj5byd" }) }),
908
- /*#__PURE__*/ E(h, { children: c._({ id: "d+F6q9" }) }),
909
- /*#__PURE__*/ E(e, { children: (() => {
910
- let e = new Date(n.created_at ?? "");
911
- return isNaN(e.getTime()) ? c._({ id: "fj5byd" }) : e.toLocaleDateString();
912
- })() })
913
- ] })] })]
914
- });
915
- }, Q = ({ image: n, isOpen: r, isLoading: a, onClose: o, onDeactivate: s }) => {
916
- if (!n) return null;
917
- let { i18n: c, _: u } = N();
918
- return /*#__PURE__*/ E(l, {
919
- onCancel: o,
920
- size: "small",
921
- title: c._({ id: "hQr1Cr" }),
922
- open: r,
923
- onConfirm: (e) => {
924
- e.preventDefault(), s(n);
925
- },
926
- confirmButtonLabel: c._({ id: "5y3O+A" }),
927
- cancelButtonLabel: c._({ id: "dEgA5A" }),
928
- disableConfirmButton: a,
929
- children: a ? /*#__PURE__*/ E(i, {
930
- distribution: "center",
931
- alignment: "center",
932
- children: /*#__PURE__*/ E(t, { variant: "primary" })
933
- }) : /*#__PURE__*/ D(T, { children: [/*#__PURE__*/ E("p", {
934
- className: "mb-4",
935
- children: c._({ id: "8TSI9h" })
936
- }), /*#__PURE__*/ D(v, { children: [
937
- /*#__PURE__*/ E(h, { children: c._({ id: "6YtxFj" }) }),
938
- /*#__PURE__*/ E(e, { children: n.name || c._({ id: "MEIAzV" }) }),
939
- /*#__PURE__*/ E(h, { children: c._({ id: "dFb5Nt" }) }),
940
- /*#__PURE__*/ E(e, { children: n.id }),
941
- /*#__PURE__*/ E(h, { children: c._({ id: "uAQUqI" }) }),
942
- /*#__PURE__*/ E(e, { children: n.status }),
943
- /*#__PURE__*/ E(h, { children: c._({ id: "2q/Q7x" }) }),
944
- /*#__PURE__*/ E(e, { children: n.visibility }),
945
- /*#__PURE__*/ E(h, { children: c._({ id: "Cj2Gtd" }) }),
946
- /*#__PURE__*/ E(e, { children: /*#__PURE__*/ E(L, { size: n.size }) }),
947
- /*#__PURE__*/ E(h, { children: c._({ id: "NopYGU" }) }),
948
- /*#__PURE__*/ E(e, { children: n.disk_format || c._({ id: "fj5byd" }) }),
949
- /*#__PURE__*/ E(h, { children: c._({ id: "d+F6q9" }) }),
950
- /*#__PURE__*/ E(e, { children: (() => {
951
- let e = new Date(n.created_at ?? "");
952
- return isNaN(e.getTime()) ? c._({ id: "fj5byd" }) : e.toLocaleDateString();
953
- })() })
954
- ] })] })
955
- });
956
- }, ne = (e) => ({
957
- message: /*#__PURE__*/ E(M, { id: "bM1O3m" }),
958
- description: /*#__PURE__*/ E(M, {
959
- id: "hHL/wm",
960
- values: { imageName: e }
961
- })
962
- }), re = (e, t) => ({
963
- message: /*#__PURE__*/ E(M, { id: "9iz2XW" }),
964
- description: /*#__PURE__*/ E(M, {
965
- id: "wODCcl",
966
- values: {
967
- imageName: e,
968
- errorMessage: t
969
- }
970
- })
971
- }), ie = (e) => ({
972
- message: /*#__PURE__*/ E(M, { id: "bM1O3m" }),
973
- description: /*#__PURE__*/ E(M, {
974
- id: "8AriEH",
975
- values: { imageName: e }
976
- })
977
- }), ae = (e, t) => ({
978
- message: /*#__PURE__*/ E(M, { id: "lWTy+Y" }),
979
- description: /*#__PURE__*/ E(M, {
980
- id: "lYC3YX",
981
- values: {
982
- imageName: e,
983
- errorMessage: t
984
- }
985
- })
986
- }), oe = (e, t) => ({
987
- message: /*#__PURE__*/ E(M, { id: "AGXLLY" }),
988
- description: /*#__PURE__*/ E(M, {
989
- id: "Vf3tzc",
990
- values: {
991
- fileName: e,
992
- errorMessage: t
993
- }
994
- })
995
- }), se = (e) => ({
996
- message: /*#__PURE__*/ E(M, { id: "bM1O3m" }),
997
- description: /*#__PURE__*/ E(M, {
998
- id: "S1iTXO",
999
- values: { imageName: e }
1000
- })
1001
- }), ce = (e, t) => ({
1002
- message: /*#__PURE__*/ E(M, { id: "o/VDOG" }),
1003
- description: /*#__PURE__*/ E(M, {
1004
- id: "lIlLtp",
1005
- values: {
1006
- imageId: e,
1007
- errorMessage: t
1008
- }
1009
- })
1010
- }), le = (e) => ({
1011
- message: /*#__PURE__*/ E(M, { id: "bM1O3m" }),
1012
- description: /*#__PURE__*/ E(M, {
1013
- id: "cj17eo",
1014
- values: { imageName: e }
1015
- })
1016
- }), ue = (e) => ({
1017
- message: /*#__PURE__*/ E(M, { id: "bM1O3m" }),
1018
- description: /*#__PURE__*/ E(M, {
1019
- id: "ZcWMT1",
1020
- values: { imageName: e }
1021
- })
1022
- }), de = (e, t) => ({
1023
- message: /*#__PURE__*/ E(M, { id: "tiflqy" }),
1024
- description: /*#__PURE__*/ E(M, {
1025
- id: "G/045D",
1026
- values: {
1027
- imageId: e,
1028
- errorMessage: t
1029
- }
1030
- })
1031
- }), fe = (e, t) => ({
1032
- message: /*#__PURE__*/ E(M, { id: "BYH/2L" }),
1033
- description: /*#__PURE__*/ E(M, {
1034
- id: "KYFkcz",
1035
- values: {
1036
- imageId: e,
1037
- errorMessage: t
1038
- }
1039
- })
1040
- }), pe = (e, t) => ({
1041
- message: /*#__PURE__*/ E(M, { id: "CFMxC8" }),
1042
- description: /*#__PURE__*/ E(M, {
1043
- id: "T7mgdd",
1044
- values: {
1045
- successCount: e,
1046
- totalCount: t
1047
- }
1048
- })
1049
- }), me = (e, t) => ({
1050
- message: /*#__PURE__*/ E(M, { id: "fIvd7X" }),
1051
- description: /*#__PURE__*/ E(M, {
1052
- id: "xNZKYy",
1053
- values: {
1054
- failedCount: e,
1055
- totalCount: t
1056
- }
1057
- })
1058
- }), he = (e, t) => ({
1059
- message: /*#__PURE__*/ E(M, { id: "Z5r9vC" }),
1060
- description: /*#__PURE__*/ E(M, {
1061
- id: "plnnns",
1062
- values: {
1063
- successCount: e,
1064
- failedCount: t
1065
- }
1066
- })
1067
- }), ge = (e, t) => ({
1068
- message: /*#__PURE__*/ E(M, { id: "ryf/ee" }),
1069
- description: /*#__PURE__*/ E(M, {
1070
- id: "J9QcnV",
1071
- values: {
1072
- successCount: e,
1073
- totalCount: t
1074
- }
1075
- })
1076
- }), _e = (e, t) => ({
1077
- message: /*#__PURE__*/ E(M, { id: "9njIiV" }),
1078
- description: /*#__PURE__*/ E(M, {
1079
- id: "R6u5CR",
1080
- values: {
1081
- failedCount: e,
1082
- totalCount: t
1083
- }
1084
- })
1085
- }), ve = (e, t) => ({
1086
- message: /*#__PURE__*/ E(M, { id: "YZmsaT" }),
1087
- description: /*#__PURE__*/ E(M, {
1088
- id: "GbKqnI",
1089
- values: {
1090
- successCount: e,
1091
- failedCount: t
1092
- }
1093
- })
1094
- }), ye = (e, t) => ({
1095
- message: /*#__PURE__*/ E(M, { id: "h8h6oz" }),
1096
- description: /*#__PURE__*/ E(M, {
1097
- id: "ZAy0zp",
1098
- values: {
1099
- successCount: e,
1100
- totalCount: t
1101
- }
1102
- })
1103
- }), $ = (e, t) => ({
1104
- message: /*#__PURE__*/ E(M, { id: "fJpv9x" }),
1105
- description: /*#__PURE__*/ E(M, {
1106
- id: "quU9wK",
1107
- values: {
1108
- failedCount: e,
1109
- totalCount: t
1110
- }
1111
- })
1112
- }), be = (e, t) => ({
1113
- message: /*#__PURE__*/ E(M, { id: "JfWCsP" }),
1114
- description: /*#__PURE__*/ E(M, {
1115
- id: "8t1+HU",
1116
- values: {
1117
- successCount: e,
1118
- failedCount: t
1119
- }
1120
- })
1121
- }), xe = (e) => ({
1122
- message: /*#__PURE__*/ E(M, { id: "V66Jih" }),
1123
- description: /*#__PURE__*/ E(M, {
1124
- id: "Vmojta",
1125
- values: { newStatus: e }
1126
- })
1127
- }), Se = (e) => ({
1128
- message: /*#__PURE__*/ E(M, { id: "V66Jih" }),
1129
- description: e || /*#__PURE__*/ E(M, { id: "QYiqYb" })
1130
- }), Ce = (e, t) => ({
1131
- message: /*#__PURE__*/ E(M, { id: "OSlLnz" }),
1132
- description: /*#__PURE__*/ E(M, {
1133
- id: "CA8ZeT",
1134
- values: {
1135
- imageName: e,
1136
- visibility: t
1137
- }
1138
- })
1139
- }), we = (e, t) => ({
1140
- message: /*#__PURE__*/ E(M, { id: "aqagJH" }),
1141
- description: /*#__PURE__*/ E(M, {
1142
- id: "FEfQAu",
1143
- values: {
1144
- imageName: e,
1145
- errorMessage: t
1146
- }
1147
- })
1148
- });
1149
- //#endregion
1150
- export { W as A, we as C, X as D, Z as E, R as F, L as I, V as M, z as N, Y as O, B as P, ne as S, Q as T, fe as _, be as a, oe as b, he as c, xe as d, le as f, ue as g, ie as h, $ as i, H as j, G as k, pe as l, ae as m, ve as n, ye as o, de as p, ge as r, me as s, _e as t, Se as u, ce as v, Ce as w, re as x, se as y };
1151
-
1152
- //# sourceMappingURL=ImageToastNotifications-m6c3tVPb.mjs.map