@cobaltcore-dev/aurora 0.10.0 → 0.12.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/README.md +2 -1
  2. package/dist/client/AuroraApp.d.ts +2 -0
  3. package/dist/client/AuthProvider-DZqOvceF.mjs +64 -0
  4. package/dist/client/AuthProvider-DZqOvceF.mjs.map +1 -0
  5. package/dist/client/ContentHeader-D2nIdJKJ.mjs +110 -0
  6. package/dist/client/ContentHeader-D2nIdJKJ.mjs.map +1 -0
  7. package/dist/client/{DeleteFlavorModal-C3m7bQJu.mjs → DeleteFlavorModal-Dwm0Hh84.mjs} +158 -158
  8. package/dist/client/{DeleteFlavorModal-C3m7bQJu.mjs.map → DeleteFlavorModal-Dwm0Hh84.mjs.map} +1 -1
  9. package/dist/client/{DeleteVersionsModal-CyYZfB8d.mjs → DeleteVersionsModal-DQO8lGmS.mjs} +58 -58
  10. package/dist/client/{DeleteVersionsModal-CyYZfB8d.mjs.map → DeleteVersionsModal-DQO8lGmS.mjs.map} +1 -1
  11. package/dist/client/{EditSecurityGroupModal-DKusxfta.mjs → EditSecurityGroupModal-BGPXglju.mjs} +16 -16
  12. package/dist/client/{EditSecurityGroupModal-DKusxfta.mjs.map → EditSecurityGroupModal-BGPXglju.mjs.map} +1 -1
  13. package/dist/client/{FiltersInput-GzR4D0q6.mjs → FiltersInput-cOaaRpcQ.mjs} +20 -20
  14. package/dist/client/{FiltersInput-GzR4D0q6.mjs.map → FiltersInput-cOaaRpcQ.mjs.map} +1 -1
  15. package/dist/client/{FloatingIpActionModals-CRvROJ3H.mjs → FloatingIpActionModals-RCvaamOg.mjs} +51 -51
  16. package/dist/client/{FloatingIpActionModals-CRvROJ3H.mjs.map → FloatingIpActionModals-RCvaamOg.mjs.map} +1 -1
  17. package/dist/client/{ImageToastNotifications-BuDXpTkl.mjs → ImageToastNotifications-ClO-1yOH.mjs} +341 -341
  18. package/dist/client/{ImageToastNotifications-BuDXpTkl.mjs.map → ImageToastNotifications-ClO-1yOH.mjs.map} +1 -1
  19. package/dist/client/{RouteError-DVAiT0mT.mjs → RouteError-BmZRk_ss.mjs} +2 -2
  20. package/dist/client/{RouteError-DVAiT0mT.mjs.map → RouteError-BmZRk_ss.mjs.map} +1 -1
  21. package/dist/client/{SortInput-DLcusjGZ.mjs → SortInput-DjaEHvcO.mjs} +6 -6
  22. package/dist/client/{SortInput-DLcusjGZ.mjs.map → SortInput-DjaEHvcO.mjs.map} +1 -1
  23. package/dist/client/{_auth-DXJkv9QO.mjs → _auth-DnImOqR-.mjs} +2 -2
  24. package/dist/client/_auth-DnImOqR-.mjs.map +1 -0
  25. package/dist/client/{_flavorId-Dy7EYQum.mjs → _flavorId-CtQEd28h.mjs} +9 -9
  26. package/dist/client/{_flavorId-Dy7EYQum.mjs.map → _flavorId-CtQEd28h.mjs.map} +1 -1
  27. package/dist/client/{_flavorId-DsD2VTKA.mjs → _flavorId-DVsGdXUf.mjs} +42 -42
  28. package/dist/client/{_flavorId-DsD2VTKA.mjs.map → _flavorId-DVsGdXUf.mjs.map} +1 -1
  29. package/dist/client/{_floatingIpId-j17rCQqG2.mjs → _floatingIpId-CKMq7-4p2.mjs} +32 -32
  30. package/dist/client/{_floatingIpId-j17rCQqG2.mjs.map → _floatingIpId-CKMq7-4p2.mjs.map} +1 -1
  31. package/dist/client/{_floatingIpId-BjVbeNw_.mjs → _floatingIpId-DvTh6vdB.mjs} +2 -2
  32. package/dist/client/{_floatingIpId-BjVbeNw_.mjs.map → _floatingIpId-DvTh6vdB.mjs.map} +1 -1
  33. package/dist/client/{_imageId-BjfhqAje.mjs → _imageId-xG8hC49j.mjs} +129 -129
  34. package/dist/client/_imageId-xG8hC49j.mjs.map +1 -0
  35. package/dist/client/{_pcaId-Bo7yHkNW.mjs → _pcaId-Db_t0x6O.mjs} +149 -149
  36. package/dist/client/{_pcaId-Bo7yHkNW.mjs.map → _pcaId-Db_t0x6O.mjs.map} +1 -1
  37. package/dist/client/{_pcaId-CKkCVC7b.mjs → _pcaId-WCJoukIk.mjs} +2 -2
  38. package/dist/client/{_pcaId-CKkCVC7b.mjs.map → _pcaId-WCJoukIk.mjs.map} +1 -1
  39. package/dist/client/{_projectId-B_2sZKk-.mjs → _projectId-B2cvskLV.mjs} +2 -2
  40. package/dist/client/_projectId-B2cvskLV.mjs.map +1 -0
  41. package/dist/client/{_projectId-Dbck_MFa.mjs → _projectId-BCMkaH_h.mjs} +85 -85
  42. package/dist/client/_projectId-BCMkaH_h.mjs.map +1 -0
  43. package/dist/client/{_projectId-CARHuZTU.mjs → _projectId-BdqRntcN.mjs} +15 -14
  44. package/dist/client/_projectId-BdqRntcN.mjs.map +1 -0
  45. package/dist/client/{_projectId-CY8W0IF6.mjs → _projectId-C8RGOqZb.mjs} +3 -3
  46. package/dist/client/{_projectId-CY8W0IF6.mjs.map → _projectId-C8RGOqZb.mjs.map} +1 -1
  47. package/dist/client/{_securityGroupId-gSEZbBII.mjs → _securityGroupId-CyQ3XmpB.mjs} +2 -2
  48. package/dist/client/{_securityGroupId-gSEZbBII.mjs.map → _securityGroupId-CyQ3XmpB.mjs.map} +1 -1
  49. package/dist/client/{_securityGroupId-CkN0CGVg.mjs → _securityGroupId-DMi7YRux.mjs} +352 -352
  50. package/dist/client/{_securityGroupId-CkN0CGVg.mjs.map → _securityGroupId-DMi7YRux.mjs.map} +1 -1
  51. package/dist/client/_storageType-Bb6YZgXf.mjs +3002 -0
  52. package/dist/client/_storageType-Bb6YZgXf.mjs.map +1 -0
  53. package/dist/client/{_storageType-6k8lUnQo.mjs → _storageType-g1zkFFRh.mjs} +2 -2
  54. package/dist/client/{_storageType-6k8lUnQo.mjs.map → _storageType-g1zkFFRh.mjs.map} +1 -1
  55. package/dist/client/_storageType-zeSZe--V.mjs.map +1 -1
  56. package/dist/client/{about-Nsxkyh9U.mjs → about-B4sGnxeW.mjs} +8 -8
  57. package/dist/client/about-B4sGnxeW.mjs.map +1 -0
  58. package/dist/client/{aurora-DDzsst74.mjs → aurora-6RsAZtnz.mjs} +2 -2
  59. package/dist/client/aurora-6RsAZtnz.mjs.map +1 -0
  60. package/dist/client/{build-BdRRmNf5.mjs → build-DgeVmENN.mjs} +3632 -3159
  61. package/dist/client/{build-BdRRmNf5.mjs.map → build-DgeVmENN.mjs.map} +1 -1
  62. package/dist/client/{constants-PMXUGI4Q.mjs → constants-D6IO9bPs.mjs} +17 -17
  63. package/dist/client/{constants-PMXUGI4Q.mjs.map → constants-D6IO9bPs.mjs.map} +1 -1
  64. package/dist/client/{flavors-p2TKcqP-.mjs → flavors-CO5l_6d0.mjs} +164 -164
  65. package/dist/client/{flavors-p2TKcqP-.mjs.map → flavors-CO5l_6d0.mjs.map} +1 -1
  66. package/dist/client/{flavors-BclEwobO.mjs → flavors-D4nGSs0r.mjs} +2 -2
  67. package/dist/client/{flavors-BclEwobO.mjs.map → flavors-D4nGSs0r.mjs.map} +1 -1
  68. package/dist/client/flavors-DWMZ6TuJ.mjs.map +1 -1
  69. package/dist/client/{floatingips-ph0ZxJw8.mjs → floatingips-ClkRV7a7.mjs} +115 -115
  70. package/dist/client/floatingips-ClkRV7a7.mjs.map +1 -0
  71. package/dist/client/{hooks-dSArr2Ca.mjs → hooks-CMgoYcDG.mjs} +1 -1
  72. package/dist/client/{images-Dbjo4yKn.mjs → images-B5ktfqg6.mjs} +2 -2
  73. package/dist/client/images-B5ktfqg6.mjs.map +1 -0
  74. package/dist/client/{images-BblnyWJq.mjs → images-C_OYLPqv.mjs} +425 -425
  75. package/dist/client/{images-BblnyWJq.mjs.map → images-C_OYLPqv.mjs.map} +1 -1
  76. package/dist/client/{images-CXdghaMW.mjs → images-CvPxoPC0.mjs} +2 -2
  77. package/dist/client/{images-CXdghaMW.mjs.map → images-CvPxoPC0.mjs.map} +1 -1
  78. package/dist/client/images-NBf2bV43.mjs.map +1 -1
  79. package/dist/client/index.js +337 -337
  80. package/dist/client/index.js.map +1 -1
  81. package/dist/client/network-DuZm76BZ.mjs.map +1 -1
  82. package/dist/client/{objects-Bw25cE1m.mjs → objects-D0grS6pk.mjs} +1645 -1617
  83. package/dist/client/objects-D0grS6pk.mjs.map +1 -0
  84. package/dist/client/{objects-B9Jh3SMG.mjs → objects-UQyUQxBj.mjs} +2 -2
  85. package/dist/client/{objects-B9Jh3SMG.mjs.map → objects-UQyUQxBj.mjs.map} +1 -1
  86. package/dist/client/objects-o2Cj_ndZ.mjs.map +1 -1
  87. package/dist/client/{pca-CiLPHmK7.mjs → pca-BJPxOIgq.mjs} +68 -68
  88. package/dist/client/{pca-CiLPHmK7.mjs.map → pca-BJPxOIgq.mjs.map} +1 -1
  89. package/dist/client/{pca-DUrQ_tIg.mjs → pca-C9MKOi3Z.mjs} +2 -2
  90. package/dist/client/{pca-DUrQ_tIg.mjs.map → pca-C9MKOi3Z.mjs.map} +1 -1
  91. package/dist/client/{projects-DNd3UTas.mjs → projects-C3wR-lvM.mjs} +6 -9
  92. package/dist/client/projects-C3wR-lvM.mjs.map +1 -0
  93. package/dist/client/{projects-B5topuei.mjs → projects-CGjBlG2w.mjs} +2 -2
  94. package/dist/client/{projects-B5topuei.mjs.map → projects-CGjBlG2w.mjs.map} +1 -1
  95. package/dist/client/{projects-CHYn7L5e.mjs → projects-DvSiI5Vg.mjs} +2 -2
  96. package/dist/client/projects-DvSiI5Vg.mjs.map +1 -0
  97. package/dist/client/{securitygroups-CcA2TpAt.mjs → securitygroups-n8ujBpJP.mjs} +119 -119
  98. package/dist/client/securitygroups-n8ujBpJP.mjs.map +1 -0
  99. package/dist/client/{useListWithFiltering-CVzhMyEA.mjs → useListWithFiltering-BuhE81I6.mjs} +12 -12
  100. package/dist/client/{useListWithFiltering-CVzhMyEA.mjs.map → useListWithFiltering-BuhE81I6.mjs.map} +1 -1
  101. package/dist/server/index.d.ts +6 -2
  102. package/dist/server/index.js +701 -423
  103. package/package.json +4 -4
  104. package/dist/client/AuthProvider-Co4d0WzB.mjs +0 -100
  105. package/dist/client/AuthProvider-Co4d0WzB.mjs.map +0 -1
  106. package/dist/client/ContentHeader-D4jlOG-9.mjs +0 -96
  107. package/dist/client/ContentHeader-D4jlOG-9.mjs.map +0 -1
  108. package/dist/client/_auth-DXJkv9QO.mjs.map +0 -1
  109. package/dist/client/_imageId-BjfhqAje.mjs.map +0 -1
  110. package/dist/client/_projectId-B_2sZKk-.mjs.map +0 -1
  111. package/dist/client/_projectId-CARHuZTU.mjs.map +0 -1
  112. package/dist/client/_projectId-Dbck_MFa.mjs.map +0 -1
  113. package/dist/client/_storageType-CLTxXjQZ.mjs +0 -3048
  114. package/dist/client/_storageType-CLTxXjQZ.mjs.map +0 -1
  115. package/dist/client/about-Nsxkyh9U.mjs.map +0 -1
  116. package/dist/client/aurora-DDzsst74.mjs.map +0 -1
  117. package/dist/client/floatingips-ph0ZxJw8.mjs.map +0 -1
  118. package/dist/client/images-Dbjo4yKn.mjs.map +0 -1
  119. package/dist/client/objects-Bw25cE1m.mjs.map +0 -1
  120. package/dist/client/projects-CHYn7L5e.mjs.map +0 -1
  121. package/dist/client/projects-DNd3UTas.mjs.map +0 -1
  122. package/dist/client/securitygroups-CcA2TpAt.mjs.map +0 -1
@@ -0,0 +1,3002 @@
1
+ import { $ as e, A as t, B as n, D as r, E as i, F as a, G as o, K as s, L as c, N as l, P as u, R as d, U as f, X as p, at as m, ct as h, et as g, f as _, g as v, l as y, lt as b, n as x, ot as S, q as C, r as w, rt as T, s as E, st as D, tt as O, ut as k, w as A, y as j } from "./build-DgeVmENN.mjs";
2
+ import { r as M } from "./trpcClient-BzPUgiM2.mjs";
3
+ import { t as N } from "./_storageType-g1zkFFRh.mjs";
4
+ import { t as P } from "./ContentHeader-D2nIdJKJ.mjs";
5
+ import { t as ee } from "./SortInput-DjaEHvcO.mjs";
6
+ import { t as F } from "./formatBytes-CZv_XyCY.mjs";
7
+ import { t as I } from "./useProjectId-DBc5lpoU.mjs";
8
+ import { n as te, r as L } from "./DeleteVersionsModal-DQO8lGmS.mjs";
9
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
10
+ import { Fragment as ne, startTransition as re, useCallback as V, useEffect as ie, useRef as ae, useState as H } from "react";
11
+ import { useNavigate as U, useParams as oe } from "@tanstack/react-router";
12
+ import { Trans as W, useLingui as G } from "@lingui/react";
13
+ import { i18n as K } from "@lingui/core";
14
+ import { ErrorBoundary as se } from "react-error-boundary";
15
+ import { useVirtualizer as q } from "@tanstack/react-virtual";
16
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/CreateContainerModal.tsx
17
+ var ce = ({ isOpen: e, onClose: t, onSuccess: n, onError: r, maxContainerNameLength: i = 256 }) => {
18
+ let { i18n: a, _: o } = G(), s = I(), [c, l] = H(""), [u, d] = H(null), p = M.useUtils(), m = M.storage.swift.createContainer.useMutation({
19
+ onSuccess: () => {
20
+ p.storage.swift.listContainers.invalidate();
21
+ let e = c.trim();
22
+ n?.(e);
23
+ },
24
+ onError: (e) => {
25
+ r?.(c.trim(), e.message);
26
+ },
27
+ onSettled: () => {
28
+ h();
29
+ }
30
+ }), h = () => {
31
+ l(""), d(null), m.reset(), t();
32
+ }, g = (e) => e.trim() ? e.length > i ? (d(a._({
33
+ id: "r5SQFW",
34
+ values: { maxContainerNameLength: i }
35
+ })), !1) : e.includes("/") ? (d(a._({ id: "9J93Xr" })), !1) : (d(null), !0) : (d(a._({ id: "JNGYAW" })), !1), _ = (e) => {
36
+ let t = e.target.value;
37
+ l(t), u && g(t);
38
+ }, v = () => {
39
+ g(c) && m.mutate({
40
+ project_id: s,
41
+ container: c.trim()
42
+ });
43
+ };
44
+ return e ? /*#__PURE__*/ z(w, {
45
+ title: a._({ id: "vTh35P" }),
46
+ open: e,
47
+ onCancel: h,
48
+ confirmButtonLabel: a._({ id: "hYgDIe" }),
49
+ onConfirm: v,
50
+ cancelButtonLabel: a._({ id: "dEgA5A" }),
51
+ size: "small",
52
+ disableConfirmButton: m.isPending || !c.trim(),
53
+ children: /*#__PURE__*/ B(O, {
54
+ direction: "vertical",
55
+ gap: "6",
56
+ children: [/*#__PURE__*/ z("p", {
57
+ className: "text-theme-default",
58
+ children: /*#__PURE__*/ z(W, { id: "ne/GWZ" })
59
+ }), /*#__PURE__*/ z(f, {
60
+ label: a._({ id: "SUSS9i" }),
61
+ required: !0,
62
+ value: c,
63
+ onChange: _,
64
+ onKeyDown: (e) => {
65
+ e.key === "Enter" && v();
66
+ },
67
+ invalid: !!u,
68
+ errortext: u || void 0,
69
+ disabled: m.isPending,
70
+ autoFocus: !0,
71
+ placeholder: a._({ id: "W5FkH9" })
72
+ })]
73
+ })
74
+ }) : null;
75
+ }, J = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: a }) => {
76
+ let { i18n: c, _: l } = G(), p = I(), [m, h] = H(""), [g, y] = H(null), [b, x] = H(!1), S = ae(""), C = () => {
77
+ t && navigator.clipboard.writeText(t.name).then(() => {
78
+ x(!0), setTimeout(() => x(!1), 2e3);
79
+ });
80
+ }, T = M.useUtils(), { data: E, isLoading: D, error: A } = M.storage.swift.listObjects.useQuery({
81
+ project_id: p,
82
+ container: t?.name ?? "",
83
+ format: "json",
84
+ limit: 100
85
+ }, { enabled: e && t !== null }), N = M.storage.swift.emptyContainer.useMutation({
86
+ onSuccess: (e) => {
87
+ T.storage.swift.listContainers.invalidate(), T.storage.swift.listObjects.invalidate({
88
+ project_id: p,
89
+ container: S.current
90
+ }), r?.(S.current, e);
91
+ },
92
+ onError: (e) => {
93
+ a?.(S.current, e.message);
94
+ },
95
+ onSettled: () => {
96
+ P();
97
+ }
98
+ }), P = () => {
99
+ h(""), y(null), N.reset(), n();
100
+ }, ee = (e) => {
101
+ let t = e.target.value;
102
+ h(t), g && y(null);
103
+ }, te = () => {
104
+ if (t) {
105
+ if (m.trim() !== t.name) {
106
+ y(c._({ id: "jS4B2+" }));
107
+ return;
108
+ }
109
+ S.current = t.name, N.mutate({
110
+ project_id: p,
111
+ container: t.name
112
+ });
113
+ }
114
+ }, L = (e) => {
115
+ e.key === "Enter" && te();
116
+ };
117
+ if (!e || !t) return null;
118
+ let R = E?.length ?? 0, ne = !D && t.count === 0 && R === 0, re = !D && t.count > 0 && R === 0, V = ne || re;
119
+ return /*#__PURE__*/ B(w, {
120
+ title: /* @__PURE__ */ B("span", {
121
+ className: "flex max-w-[400px] items-center gap-2",
122
+ children: [
123
+ /*#__PURE__*/ z("span", {
124
+ className: "shrink-0",
125
+ children: /*#__PURE__*/ z(W, { id: "5Okch2" })
126
+ }),
127
+ /*#__PURE__*/ z("span", {
128
+ className: "truncate",
129
+ title: t.name,
130
+ children: t.name
131
+ }),
132
+ !D && !V && /*#__PURE__*/ z("button", {
133
+ type: "button",
134
+ onClick: C,
135
+ title: b ? c._({ id: "PiH3UR" }) : c._({ id: "NQU1Nn" }),
136
+ className: "text-theme-light hover:text-theme-default inline-flex items-center transition-colors",
137
+ children: /*#__PURE__*/ z(_, {
138
+ icon: b ? "checkCircle" : "contentCopy",
139
+ size: "16"
140
+ })
141
+ })
142
+ ]
143
+ }),
144
+ open: e,
145
+ onCancel: P,
146
+ confirmButtonLabel: V ? void 0 : c._({ id: "N2S1rs" }),
147
+ confirmButtonVariant: "primary-danger",
148
+ onConfirm: V ? void 0 : te,
149
+ cancelButtonLabel: V ? void 0 : c._({ id: "dEgA5A" }),
150
+ modalFooter: V ? /*#__PURE__*/ z(v, {
151
+ className: "flex justify-end",
152
+ children: /*#__PURE__*/ z(k, { children: /*#__PURE__*/ z(j, {
153
+ variant: "primary",
154
+ onClick: P,
155
+ "data-testid": "empty-info-close-button",
156
+ children: /*#__PURE__*/ z(W, { id: "yz7wBu" })
157
+ }) })
158
+ }) : void 0,
159
+ size: "small",
160
+ disableConfirmButton: D || N.isPending || !V && !m.trim() || !V && m.trim() !== t.name,
161
+ children: [A && /*#__PURE__*/ z("p", {
162
+ className: "text-theme-error mb-4",
163
+ children: (() => {
164
+ let e = A.message;
165
+ return /*#__PURE__*/ z(W, {
166
+ id: "56IxdF",
167
+ values: { errorMessage: e }
168
+ });
169
+ })()
170
+ }), D ? /*#__PURE__*/ B(O, {
171
+ direction: "horizontal",
172
+ alignment: "center",
173
+ gap: "2",
174
+ className: "py-4",
175
+ children: [/*#__PURE__*/ z(s, { size: "small" }), /*#__PURE__*/ z(W, { id: "ujK/QN" })]
176
+ }) : V && !A ? /*#__PURE__*/ z("p", {
177
+ className: "text-theme-default py-2",
178
+ children: ne ? /*#__PURE__*/ z(W, { id: "jNm/qL" }) : /*#__PURE__*/ z(W, { id: "WefafP" })
179
+ }) : A ? null : /*#__PURE__*/ B(O, {
180
+ direction: "vertical",
181
+ gap: "6",
182
+ children: [
183
+ /*#__PURE__*/ B("p", {
184
+ className: "text-theme-default",
185
+ children: [
186
+ /*#__PURE__*/ z(W, { id: "Ioblgz" }),
187
+ /*#__PURE__*/ z("br", {}),
188
+ /*#__PURE__*/ z(W, {
189
+ id: "kiRrtv",
190
+ components: {
191
+ 0: /*#__PURE__*/ z("strong", {}),
192
+ 1: /*#__PURE__*/ z("strong", {}),
193
+ 2: /*#__PURE__*/ z("strong", {})
194
+ }
195
+ })
196
+ ]
197
+ }),
198
+ /*#__PURE__*/ B("div", {
199
+ className: "border-theme-background-lvl-3 overflow-hidden rounded border",
200
+ children: [
201
+ t.count > R && /*#__PURE__*/ z("p", {
202
+ className: "text-theme-light px-3 py-2 text-xs",
203
+ children: (() => {
204
+ let e = t.count;
205
+ return /*#__PURE__*/ z(W, {
206
+ id: "1iQtS2",
207
+ values: {
208
+ actualObjectCount: R,
209
+ total: e
210
+ }
211
+ });
212
+ })()
213
+ }),
214
+ /*#__PURE__*/ z(u, {
215
+ columns: 3,
216
+ className: "text-sm",
217
+ children: /*#__PURE__*/ B(i, { children: [
218
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "6YtxFj" }) }),
219
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "Cj2Gtd" }) }),
220
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) })
221
+ ] })
222
+ }),
223
+ /*#__PURE__*/ z("div", {
224
+ className: "max-h-48 overflow-y-auto",
225
+ children: /*#__PURE__*/ z(u, {
226
+ columns: 3,
227
+ className: "text-sm",
228
+ children: E.map((e) => /*#__PURE__*/ B(i, { children: [
229
+ /*#__PURE__*/ z(o, {
230
+ className: "max-w-[200px] truncate",
231
+ title: e.name,
232
+ children: e.name
233
+ }),
234
+ /*#__PURE__*/ z(o, { children: F(e.bytes) }),
235
+ /*#__PURE__*/ z(o, { children: e.last_modified ? new Date(e.last_modified).toLocaleString() : c._({ id: "fj5byd" }) })
236
+ ] }, e.name))
237
+ })
238
+ })
239
+ ]
240
+ }),
241
+ /*#__PURE__*/ z(f, {
242
+ label: c._({ id: "33F2A+" }),
243
+ required: !0,
244
+ value: m,
245
+ onChange: ee,
246
+ onKeyDown: L,
247
+ invalid: !!g,
248
+ errortext: g || void 0,
249
+ disabled: N.isPending,
250
+ autoFocus: !0,
251
+ placeholder: t.name
252
+ })
253
+ ]
254
+ })]
255
+ });
256
+ }, le = ({ isOpen: e, container: t, onClose: n, onSuccess: r, onError: i }) => {
257
+ let { i18n: a, _: o } = G(), c = I(), [l, u] = H(""), [d, p] = H(null), [m, h] = H(!1), g = M.useUtils(), { data: _, isLoading: y, error: x } = M.storage.swift.listObjects.useQuery({
258
+ project_id: c,
259
+ container: t?.name ?? "",
260
+ format: "json",
261
+ limit: 1
262
+ }, { enabled: e && t !== null }), { data: S, error: C } = M.storage.swift.getContainerMetadata.useQuery({
263
+ project_id: c,
264
+ container: t?.name ?? ""
265
+ }, { enabled: e && t !== null }), T = !!(S?.versionsEnabled || S?.versionsLocation || S?.historyLocation), E = M.storage.swift.deleteContainer.useMutation({
266
+ onSuccess: () => {
267
+ g.storage.swift.listContainers.invalidate(), r?.(t.name);
268
+ },
269
+ onError: (e) => {
270
+ i?.(t.name, e.message);
271
+ },
272
+ onSettled: () => {
273
+ D();
274
+ }
275
+ });
276
+ ie(() => {
277
+ e || (u(""), p(null), h(!1), E.reset());
278
+ }, [e, t?.name]);
279
+ let D = () => {
280
+ u(""), p(null), h(!1), E.reset(), n();
281
+ }, A = (e) => {
282
+ let t = e.target.value;
283
+ u(t), d && p(null);
284
+ }, N = () => {
285
+ if (t && !(x || C)) {
286
+ if (l.trim() !== "delete") {
287
+ p(a._({ id: "b5aNMO" }));
288
+ return;
289
+ }
290
+ T && !m || E.mutate({
291
+ project_id: c,
292
+ container: t.name
293
+ });
294
+ }
295
+ }, P = (e) => {
296
+ e.key === "Enter" && N();
297
+ };
298
+ if (!e || !t) return null;
299
+ let ee = _?.length ?? 0, F = !y && (ee > 0 || t.count > 0), te = !y && t.count > 0 && ee === 0, L = !!(x || C);
300
+ return /*#__PURE__*/ B(w, {
301
+ title: /* @__PURE__ */ B("span", {
302
+ className: "flex max-w-[400px] items-center gap-2",
303
+ children: [/*#__PURE__*/ z("span", {
304
+ className: "shrink-0",
305
+ children: /*#__PURE__*/ z(W, { id: "Vzlopx" })
306
+ }), /*#__PURE__*/ z("span", {
307
+ className: "truncate",
308
+ title: t.name,
309
+ children: t.name
310
+ })]
311
+ }),
312
+ open: e,
313
+ onCancel: D,
314
+ confirmButtonLabel: F ? void 0 : a._({ id: "cnGeoo" }),
315
+ confirmButtonVariant: F ? void 0 : "primary-danger",
316
+ onConfirm: F ? void 0 : N,
317
+ cancelButtonLabel: F ? void 0 : a._({ id: "dEgA5A" }),
318
+ modalFooter: F ? /*#__PURE__*/ z(v, {
319
+ className: "flex justify-end",
320
+ children: /*#__PURE__*/ z(k, { children: /*#__PURE__*/ z(j, {
321
+ variant: "primary",
322
+ onClick: D,
323
+ "data-testid": "delete-has-objects-close-button",
324
+ children: /*#__PURE__*/ z(W, { id: "yz7wBu" })
325
+ }) })
326
+ }) : void 0,
327
+ size: "small",
328
+ disableConfirmButton: y || L || E.isPending || !F && l.trim() !== "delete" || !F && T && !m,
329
+ children: [(x || C) && /*#__PURE__*/ B(O, {
330
+ direction: "vertical",
331
+ gap: "2",
332
+ className: "mb-4",
333
+ role: "alert",
334
+ "aria-live": "assertive",
335
+ children: [x && /*#__PURE__*/ z("p", {
336
+ className: "text-theme-error",
337
+ children: (() => {
338
+ let e = x.message;
339
+ return /*#__PURE__*/ z(W, {
340
+ id: "56IxdF",
341
+ values: { errorMessage: e }
342
+ });
343
+ })()
344
+ }), C && /*#__PURE__*/ z("p", {
345
+ className: "text-theme-error",
346
+ children: (() => {
347
+ let e = C.message;
348
+ return /*#__PURE__*/ z(W, {
349
+ id: "BCXapL",
350
+ values: { errorMessage: e }
351
+ });
352
+ })()
353
+ })]
354
+ }), y ? /*#__PURE__*/ B(O, {
355
+ direction: "horizontal",
356
+ alignment: "center",
357
+ gap: "2",
358
+ className: "py-4",
359
+ children: [/*#__PURE__*/ z(s, { size: "small" }), /*#__PURE__*/ z(W, { id: "Z3FXyt" })]
360
+ }) : F ? /*#__PURE__*/ B(O, {
361
+ direction: "vertical",
362
+ gap: "3",
363
+ children: [/*#__PURE__*/ z("p", {
364
+ className: "text-theme-default",
365
+ children: /*#__PURE__*/ z(W, { id: "3dBmvU" })
366
+ }), te && /*#__PURE__*/ z("p", {
367
+ className: "text-theme-default",
368
+ children: /*#__PURE__*/ z(W, { id: "x3T4pq" })
369
+ })]
370
+ }) : /*#__PURE__*/ B(O, {
371
+ direction: "vertical",
372
+ gap: "6",
373
+ children: [
374
+ /*#__PURE__*/ B("p", {
375
+ className: "text-theme-default",
376
+ children: [
377
+ /*#__PURE__*/ z(W, { id: "Y8M9Uc" }),
378
+ /*#__PURE__*/ z("br", {}),
379
+ /*#__PURE__*/ z(W, {
380
+ id: "YzUoh9",
381
+ components: { 0: /*#__PURE__*/ z("strong", {}) }
382
+ })
383
+ ]
384
+ }),
385
+ T && /*#__PURE__*/ z(b, {
386
+ label: a._({ id: "V/8B9A" }),
387
+ checked: m,
388
+ onChange: (e) => h(e.target.checked),
389
+ invalid: !m
390
+ }),
391
+ /*#__PURE__*/ z(f, {
392
+ label: a._({ id: "QytzQr" }),
393
+ required: !0,
394
+ value: l,
395
+ onChange: A,
396
+ onKeyDown: P,
397
+ invalid: !!d,
398
+ errortext: d || void 0,
399
+ disabled: E.isPending,
400
+ autoFocus: !0,
401
+ placeholder: a._({ id: "HNlEFZ" })
402
+ })
403
+ ]
404
+ })]
405
+ });
406
+ }, ue = new Set([
407
+ "quota-bytes",
408
+ "quota-count",
409
+ "web-index",
410
+ "web-listings",
411
+ "web-listings-css",
412
+ "web-error"
413
+ ]), de = 50, fe = /^[a-zA-Z0-9!#$%&'*+\-.^_`|~]+$/, Y = ({ isOpen: t, container: n, onClose: r, onSuccess: a, onError: l }) => {
414
+ let { i18n: p, _: m } = G(), h = I(), { data: g, isLoading: v, isError: x, error: C } = M.storage.swift.getContainerMetadata.useQuery({
415
+ project_id: h,
416
+ container: n?.name ?? ""
417
+ }, { enabled: t && n !== null }), T = g?.read === ".r:*,.rlistings", { data: D } = M.storage.swift.getContainerPublicUrl.useQuery({
418
+ project_id: h,
419
+ container: n?.name ?? ""
420
+ }, { enabled: t && n !== null && T }), { data: k } = M.storage.swift.listContainers.useQuery({ project_id: h }, { enabled: t }), [A, N] = H(""), [P, ee] = H(""), F = ae(null), te = V((e) => {
421
+ let t = e.target.value;
422
+ N(t), F.current && clearTimeout(F.current), F.current = setTimeout(() => ee(t), 300);
423
+ }, []), L = P.trim().length > 0 ? (k ?? []).filter((e) => e.name !== n?.name && e.name.toLowerCase().includes(P.toLowerCase())) : [], R = L.slice(0, de), ne = L.length - R.length, re = M.useUtils(), [U, oe] = H(""), [K, se] = H(null), [q, ce] = H(""), [J, le] = H(null), [Y, pe] = H(""), [me, he] = H(!1), [ge, _e] = H(!1), [ve, ye] = H(""), [X, Z] = H([]), [be, xe] = H({}), [Q, Se] = H(!1), [Ce, we] = H(""), [Te, Ee] = H(""), [De, Oe] = H(null), [ke, Ae] = H(null);
424
+ ie(() => {
425
+ if (!g) return;
426
+ oe(g.quotaBytes == null ? "" : String(g.quotaBytes)), ce(g.quotaCount == null ? "" : String(g.quotaCount)), _e(!!(g.versionsEnabled || g.versionsLocation || g.historyLocation)), ye(g.versionsLocation || g.historyLocation || "");
427
+ let e = g.metadata ?? {};
428
+ pe(e["web-index"] ?? ""), he(e["web-listings"] === "1" || e["web-listings"] === "true");
429
+ let t = g.metadata ?? {};
430
+ Z(Object.entries(t).filter(([e]) => !ue.has(e)).map(([e, t]) => ({
431
+ key: e,
432
+ value: t,
433
+ isNew: !1,
434
+ isEditing: !1,
435
+ originalKey: e,
436
+ originalValue: t
437
+ })));
438
+ }, [g]), ie(() => {
439
+ t || je();
440
+ }, [t]);
441
+ let je = () => {
442
+ oe(""), se(null), ce(""), le(null), pe(""), he(!1), _e(!1), ye(""), N(""), ee(""), F.current && clearTimeout(F.current), Z([]), xe({}), Se(!1), we(""), Ee(""), Oe(null), Ae(null), Me.reset();
443
+ }, Me = M.storage.swift.updateContainerMetadata.useMutation({
444
+ onSuccess: () => {
445
+ re.storage.swift.getContainerMetadata.invalidate({ container: n.name }), re.storage.swift.listContainers.invalidate(), a?.(n.name), Ue();
446
+ },
447
+ onError: (e) => {
448
+ l?.(n.name, e.message);
449
+ }
450
+ }), $ = () => {
451
+ let e = !0;
452
+ return U !== "" && (isNaN(Number(U)) || Number(U) < 0) ? (se(p._({ id: "AuQtzx" })), e = !1) : se(null), q !== "" && (isNaN(Number(q)) || Number(q) < 0) ? (le(p._({ id: "AuQtzx" })), e = !1) : le(null), e;
453
+ }, Ne = (e, t) => e.trim() ? fe.test(e) ? /[a-zA-Z0-9]/.test(e) ? ue.has(e.toLowerCase()) ? p._({ id: "JeRXll" }) : X.some((n) => n.key.toLowerCase() === e.toLowerCase() && n.originalKey !== t) ? p._({ id: "i6/ygf" }) : null : p._({ id: "dTNzBI" }) : p._({ id: "XYZLy9" }) : p._({ id: "QV1ZPO" }), Pe = () => {
454
+ let e = Ne(Ce);
455
+ if (e) {
456
+ Oe(e);
457
+ return;
458
+ }
459
+ if (!Te.trim()) {
460
+ Ae(p._({ id: "hXUWyd" }));
461
+ return;
462
+ }
463
+ Z([...X, {
464
+ key: Ce.trim(),
465
+ value: Te.trim(),
466
+ isNew: !0,
467
+ isEditing: !1
468
+ }]), we(""), Ee(""), Se(!1), Oe(null), Ae(null);
469
+ }, Fe = () => {
470
+ we(""), Ee(""), Se(!1), Oe(null), Ae(null);
471
+ }, Ie = (e) => {
472
+ Z(X.map((t, n) => n === e ? {
473
+ ...t,
474
+ isEditing: !0
475
+ } : {
476
+ ...t,
477
+ isEditing: !1
478
+ })), Se(!1);
479
+ }, Le = (e) => {
480
+ let t = X[e], n = Ne(t.key, t.originalKey);
481
+ if (n) {
482
+ xe({ [`edit-${e}`]: n });
483
+ return;
484
+ }
485
+ if (!t.value.trim()) {
486
+ xe({ [`edit-${e}`]: p._({ id: "hXUWyd" }) });
487
+ return;
488
+ }
489
+ Z(X.map((t, n) => n === e ? {
490
+ ...t,
491
+ isEditing: !1,
492
+ key: t.key.trim(),
493
+ value: t.value.trim()
494
+ } : t)), xe({});
495
+ }, Re = (e) => {
496
+ Z(X.map((t, n) => n === e ? {
497
+ ...t,
498
+ isEditing: !1,
499
+ key: t.originalKey ?? t.key,
500
+ value: t.originalValue ?? t.value
501
+ } : t)), xe({});
502
+ }, ze = (e) => {
503
+ Z(X.filter((t, n) => n !== e)), xe({});
504
+ }, Be = (e, t) => {
505
+ Z(X.map((n, r) => r === e ? {
506
+ ...n,
507
+ key: t
508
+ } : n)), xe((t) => {
509
+ let n = { ...t };
510
+ return delete n[`edit-${e}`], n;
511
+ });
512
+ }, Ve = (e, t) => {
513
+ Z(X.map((n, r) => r === e ? {
514
+ ...n,
515
+ value: t
516
+ } : n)), xe((t) => {
517
+ let n = { ...t };
518
+ return delete n[`edit-${e}`], n;
519
+ });
520
+ }, He = () => {
521
+ if (!n || !$()) return;
522
+ let e = g?.metadata ?? {}, t = {}, r = [];
523
+ X.forEach((e) => {
524
+ (e.isNew || e.value !== e.originalValue || e.key !== e.originalKey) && (t[e.key] = e.value, !e.isNew && e.originalKey && e.key !== e.originalKey && r.push(e.originalKey));
525
+ });
526
+ let i = Object.keys(e).filter((e) => !ue.has(e)), a = X.map((e) => e.originalKey).filter(Boolean);
527
+ i.forEach((e) => {
528
+ !a.includes(e) && !r.includes(e) && r.push(e);
529
+ }), T && (Y ? t["web-index"] = Y : g?.metadata?.["web-index"] && r.push("web-index"), me ? t["web-listings"] = "1" : g?.metadata?.["web-listings"] && r.push("web-listings"));
530
+ let o = !!(g?.versionsEnabled || g?.versionsLocation || g?.historyLocation), s = g?.versionsLocation || g?.historyLocation || "";
531
+ Me.mutate({
532
+ project_id: h,
533
+ container: n.name,
534
+ metadata: t,
535
+ removeMetadata: r.length ? r : void 0,
536
+ quotaBytes: U === "" ? void 0 : Number(U),
537
+ quotaCount: q === "" ? void 0 : Number(q),
538
+ versionsLocation: ge && (!o || ve !== s) && ve ? ve : void 0,
539
+ removeVersionsLocation: !ge && o ? !0 : void 0
540
+ });
541
+ }, Ue = () => {
542
+ je(), r();
543
+ };
544
+ if (!t || !n) return null;
545
+ let We = v || Me.isPending, Ge = x && !v, Ke = X.some((e) => e.isEditing), qe = g?.quotaBytes == null ? "" : String(g.quotaBytes), Je = g?.quotaCount == null ? "" : String(g.quotaCount), Ye = !!g?.versionsEnabled, Xe = g?.versionsLocation || g?.historyLocation || "", Ze = g?.metadata?.["web-index"] ?? "", Qe = g?.metadata?.["web-listings"] === "1" || g?.metadata?.["web-listings"] === "true", $e = Object.keys(g?.metadata ?? {}).filter((e) => !ue.has(e)), et = X.length === $e.length && X.every((e) => !e.isNew && e.key === e.originalKey && e.value === e.originalValue), tt = U === qe && q === Je && ge === Ye && ve === Xe && Y === Ze && me === Qe && et, nt = g?.quotaBytes == null ? null : `${g.quotaBytes} B`;
546
+ return /*#__PURE__*/ B(w, {
547
+ title: /*#__PURE__*/ B("span", {
548
+ className: "flex max-w-[500px] items-center gap-2",
549
+ children: [/*#__PURE__*/ z("span", {
550
+ className: "shrink-0",
551
+ children: /*#__PURE__*/ z(W, { id: "y02Bu1" })
552
+ }), /*#__PURE__*/ z("span", {
553
+ className: "truncate",
554
+ title: n.name,
555
+ children: n.name
556
+ })]
557
+ }),
558
+ open: t,
559
+ onCancel: Ue,
560
+ confirmButtonLabel: p._({ id: "tfDRzk" }),
561
+ onConfirm: He,
562
+ cancelButtonLabel: p._({ id: "dEgA5A" }),
563
+ size: "large",
564
+ disableConfirmButton: We || Q || Ke || tt || Ge,
565
+ children: [Me.isError && /*#__PURE__*/ z("p", {
566
+ className: "text-theme-error mb-4",
567
+ children: (() => {
568
+ let e = Me.error.message;
569
+ return /*#__PURE__*/ z(W, {
570
+ id: "nUuaq8",
571
+ values: { errorMessage: e }
572
+ });
573
+ })()
574
+ }), v ? /*#__PURE__*/ B(O, {
575
+ direction: "horizontal",
576
+ alignment: "center",
577
+ gap: "2",
578
+ className: "py-8",
579
+ children: [/*#__PURE__*/ z(s, { size: "small" }), /*#__PURE__*/ z(W, { id: "WRZ3Mt" })]
580
+ }) : Ge ? /*#__PURE__*/ z("p", {
581
+ className: "text-theme-error py-8 text-center",
582
+ children: /*#__PURE__*/ z(W, {
583
+ id: "BCXapL",
584
+ values: { errorMessage: C?.message ?? "Unknown error" }
585
+ })
586
+ }) : /*#__PURE__*/ z("div", {
587
+ className: "max-h-[65vh] overflow-y-auto pr-1 pl-1",
588
+ children: /*#__PURE__*/ B(O, {
589
+ direction: "vertical",
590
+ gap: "6",
591
+ children: [
592
+ /*#__PURE__*/ B("div", {
593
+ className: "grid grid-cols-2 gap-4",
594
+ children: [/*#__PURE__*/ z(f, {
595
+ label: p._({ id: "z45o5B" }),
596
+ value: String(n.count),
597
+ disabled: !0,
598
+ readOnly: !0
599
+ }), /*#__PURE__*/ z(f, {
600
+ label: p._({ id: "/InK0O" }),
601
+ value: g?.bytesUsed == null ? `${n.bytes.toLocaleString()} B` : `${g.bytesUsed.toLocaleString()} B`,
602
+ disabled: !0,
603
+ readOnly: !0
604
+ })]
605
+ }),
606
+ /*#__PURE__*/ B("div", {
607
+ className: "grid grid-cols-2 gap-4",
608
+ children: [/*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(f, {
609
+ label: p._({ id: "k0vAWv" }),
610
+ value: q,
611
+ onChange: (e) => {
612
+ ce(e.target.value), J && le(null);
613
+ },
614
+ placeholder: p._({ id: "qtoOYG" }),
615
+ invalid: !!J,
616
+ errortext: J ?? void 0,
617
+ disabled: We
618
+ }) }), /*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(f, {
619
+ label: p._({ id: "KOpPMt" }),
620
+ value: U,
621
+ onChange: (e) => {
622
+ oe(e.target.value), K && se(null);
623
+ },
624
+ placeholder: p._({ id: "qtoOYG" }),
625
+ invalid: !!K,
626
+ errortext: K ?? void 0,
627
+ disabled: We,
628
+ helptext: U && nt ? nt : void 0
629
+ }) })]
630
+ }),
631
+ T && D && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ B("p", {
632
+ className: "text-theme-default mb-1 text-sm font-semibold",
633
+ children: [
634
+ /*#__PURE__*/ z(W, { id: "mvz5Eo" }),
635
+ " ",
636
+ /*#__PURE__*/ z("a", {
637
+ href: D,
638
+ target: "_blank",
639
+ rel: "noopener noreferrer",
640
+ className: "text-theme-info text-xs font-normal underline",
641
+ children: /*#__PURE__*/ z(W, { id: "Alx2/L" })
642
+ })
643
+ ]
644
+ }), /*#__PURE__*/ z(f, {
645
+ value: D,
646
+ disabled: !0,
647
+ readOnly: !0
648
+ })] }),
649
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
650
+ className: "text-theme-default mb-3 text-sm font-semibold",
651
+ children: /*#__PURE__*/ z(W, { id: "6CDYXS" })
652
+ }), T ? /*#__PURE__*/ B(O, {
653
+ direction: "vertical",
654
+ gap: "4",
655
+ children: [/*#__PURE__*/ B(O, {
656
+ direction: "vertical",
657
+ gap: "1",
658
+ children: [/*#__PURE__*/ z(b, {
659
+ label: p._({ id: "6+7EwD" }),
660
+ checked: !!Y,
661
+ onChange: (e) => {
662
+ e.target.checked ? Y || pe("index.html") : pe("");
663
+ },
664
+ disabled: We
665
+ }), /*#__PURE__*/ z("div", {
666
+ className: "pl-6",
667
+ children: /*#__PURE__*/ z(f, {
668
+ value: Y,
669
+ onChange: (e) => pe(e.target.value),
670
+ placeholder: "index.html",
671
+ disabled: We || !Y,
672
+ className: "flex-1"
673
+ })
674
+ })]
675
+ }), /*#__PURE__*/ B(O, {
676
+ direction: "horizontal",
677
+ alignment: "start",
678
+ gap: "2",
679
+ children: [/*#__PURE__*/ z(b, {
680
+ label: p._({ id: "NeUjqc" }),
681
+ checked: me,
682
+ onChange: (e) => he(e.target.checked),
683
+ disabled: We
684
+ }), /*#__PURE__*/ B(S, {
685
+ triggerEvent: "hover",
686
+ children: [/*#__PURE__*/ z(E, { children: /*#__PURE__*/ z(_, {
687
+ icon: "help",
688
+ size: "16",
689
+ className: "text-theme-light cursor-help"
690
+ }) }), /*#__PURE__*/ z(y, {
691
+ className: "z-10 max-w-[220px]",
692
+ children: /*#__PURE__*/ z(W, { id: "Oxl1UN" })
693
+ })]
694
+ })]
695
+ })]
696
+ }) : /*#__PURE__*/ z("p", {
697
+ className: "text-theme-default text-sm",
698
+ children: /*#__PURE__*/ z(W, {
699
+ id: "aSsVD3",
700
+ components: { 0: /*#__PURE__*/ z("strong", {}) }
701
+ })
702
+ })] }),
703
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
704
+ className: "text-theme-default mb-2 text-sm font-semibold",
705
+ children: /*#__PURE__*/ z(W, { id: "jNzyQo" })
706
+ }), Ye && !ve ? /*#__PURE__*/ z(b, {
707
+ label: p._({ id: "Nvfd2b" }),
708
+ checked: !0,
709
+ onChange: (e) => {
710
+ e.target.checked || (_e(!1), ye(""), N(""), ee(""));
711
+ },
712
+ disabled: !0
713
+ }) : !ge && !ve ? /*#__PURE__*/ z(b, {
714
+ label: p._({ id: "WyKwnD" }),
715
+ checked: !1,
716
+ onChange: (e) => _e(e.target.checked),
717
+ disabled: We
718
+ }) : /*#__PURE__*/ B(O, {
719
+ direction: "vertical",
720
+ gap: "1",
721
+ children: [/*#__PURE__*/ z(b, {
722
+ label: p._({ id: "b0uU1G" }),
723
+ checked: ge,
724
+ onChange: (e) => {
725
+ _e(e.target.checked), e.target.checked || (ye(""), N(""), ee(""));
726
+ },
727
+ disabled: We
728
+ }), ge && /*#__PURE__*/ z("div", {
729
+ className: "pl-6",
730
+ children: /*#__PURE__*/ z(e, {
731
+ value: ve,
732
+ onChange: (e) => ye(e),
733
+ onInputChange: te,
734
+ placeholder: p._({ id: "a13wDR" }),
735
+ helptext: (() => {
736
+ if (A.trim().length === 0) return p._({ id: "c+fUtV" });
737
+ if (ne > 0) {
738
+ let e = de, t = L.length;
739
+ return p._({
740
+ id: "qzhUb9",
741
+ values: {
742
+ maxOptions: e,
743
+ totalCount: t
744
+ }
745
+ });
746
+ }
747
+ })(),
748
+ disabled: We,
749
+ children: R.map((e) => /*#__PURE__*/ z(c, {
750
+ value: e.name,
751
+ children: e.name
752
+ }, e.name))
753
+ })
754
+ })]
755
+ })] }),
756
+ /*#__PURE__*/ B("div", { children: [
757
+ /*#__PURE__*/ B(O, {
758
+ direction: "horizontal",
759
+ alignment: "center",
760
+ distribution: "between",
761
+ className: "mb-3",
762
+ children: [/*#__PURE__*/ z("p", {
763
+ className: "text-theme-default text-sm font-semibold",
764
+ children: /*#__PURE__*/ z(W, { id: "6GBt0m" })
765
+ }), /*#__PURE__*/ z("p", {
766
+ className: "text-theme-light text-xs",
767
+ children: /*#__PURE__*/ z(W, { id: "kuYWaD" })
768
+ })]
769
+ }),
770
+ /*#__PURE__*/ z(O, {
771
+ direction: "horizontal",
772
+ className: "jn:bg-theme-background-lvl-1 justify-end p-2",
773
+ children: /*#__PURE__*/ z(j, {
774
+ label: p._({ id: "sWBLli" }),
775
+ onClick: () => Se(!0),
776
+ variant: "primary",
777
+ icon: "addCircle",
778
+ size: "small",
779
+ disabled: Q || Ke || We
780
+ })
781
+ }),
782
+ /*#__PURE__*/ B(u, {
783
+ columns: 3,
784
+ children: [
785
+ /*#__PURE__*/ B(i, { children: [
786
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "7sMeHQ" }) }),
787
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "wMHvYH" }) }),
788
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "7L01XJ" }) })
789
+ ] }),
790
+ Q && /*#__PURE__*/ B(i, { children: [
791
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ z(f, {
792
+ value: Ce,
793
+ onChange: (e) => {
794
+ we(e.target.value), De && Oe(null);
795
+ },
796
+ placeholder: p._({ id: "x9AdZ8" }),
797
+ errortext: De ?? void 0,
798
+ invalid: !!De,
799
+ autoFocus: !0
800
+ }) }),
801
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ z(f, {
802
+ value: Te,
803
+ onChange: (e) => {
804
+ Ee(e.target.value), ke && Ae(null);
805
+ },
806
+ placeholder: p._({ id: "wMHvYH" }),
807
+ errortext: ke ?? void 0,
808
+ invalid: !!ke
809
+ }) }),
810
+ /*#__PURE__*/ z(o, { children: /*#__PURE__*/ B(O, {
811
+ direction: "horizontal",
812
+ gap: "2",
813
+ children: [/*#__PURE__*/ z(j, {
814
+ size: "small",
815
+ variant: "primary",
816
+ onClick: Pe,
817
+ icon: "check",
818
+ title: p._({ id: "tfDRzk" })
819
+ }), /*#__PURE__*/ z(j, {
820
+ size: "small",
821
+ variant: "subdued",
822
+ onClick: Fe,
823
+ icon: "close",
824
+ title: p._({ id: "bzSI52" })
825
+ })]
826
+ }) })
827
+ ] }),
828
+ X.map((e, t) => /*#__PURE__*/ B(i, { children: [
829
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ z(f, {
830
+ value: e.key,
831
+ onChange: (e) => Be(t, e.target.value),
832
+ errortext: be[`edit-${t}`],
833
+ invalid: !!be[`edit-${t}`]
834
+ }) : /*#__PURE__*/ z("span", {
835
+ className: "block max-w-xs truncate text-sm",
836
+ title: e.key,
837
+ children: e.key
838
+ }) }),
839
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ z(f, {
840
+ value: e.value,
841
+ onChange: (e) => Ve(t, e.target.value)
842
+ }) : /*#__PURE__*/ z("span", {
843
+ className: "block max-w-md truncate text-sm",
844
+ title: e.value,
845
+ children: e.value
846
+ }) }),
847
+ /*#__PURE__*/ z(o, { children: e.isEditing ? /*#__PURE__*/ B(O, {
848
+ direction: "horizontal",
849
+ gap: "2",
850
+ children: [/*#__PURE__*/ z(j, {
851
+ size: "small",
852
+ variant: "primary",
853
+ onClick: () => Le(t),
854
+ icon: "check",
855
+ title: p._({ id: "tfDRzk" })
856
+ }), /*#__PURE__*/ z(j, {
857
+ size: "small",
858
+ variant: "subdued",
859
+ onClick: () => Re(t),
860
+ icon: "close",
861
+ title: p._({ id: "bzSI52" })
862
+ })]
863
+ }) : /*#__PURE__*/ B(O, {
864
+ direction: "horizontal",
865
+ gap: "2",
866
+ children: [/*#__PURE__*/ z(j, {
867
+ size: "small",
868
+ variant: "subdued",
869
+ onClick: () => Ie(t),
870
+ icon: "edit",
871
+ title: p._({ id: "ePK91l" }),
872
+ disabled: Q || Ke || We
873
+ }), /*#__PURE__*/ z(j, {
874
+ size: "small",
875
+ variant: "primary-danger",
876
+ onClick: () => ze(t),
877
+ icon: "deleteForever",
878
+ title: p._({ id: "cnGeoo" }),
879
+ disabled: Q || Ke || We
880
+ })]
881
+ }) })
882
+ ] }, t)),
883
+ X.length === 0 && !Q && /*#__PURE__*/ z(i, { children: /*#__PURE__*/ z(o, {
884
+ colSpan: 3,
885
+ className: "py-6 text-center",
886
+ children: /*#__PURE__*/ z(O, {
887
+ alignment: "center",
888
+ children: /*#__PURE__*/ z("span", {
889
+ className: "text-theme-light text-sm",
890
+ children: /*#__PURE__*/ z(W, { id: "F02e8I" })
891
+ })
892
+ })
893
+ }) })
894
+ ]
895
+ })
896
+ ] })
897
+ ]
898
+ })
899
+ })]
900
+ });
901
+ };
902
+ //#endregion
903
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ManageContainerAccessModal.tsx
904
+ function pe(e) {
905
+ let t = e.trim();
906
+ if (t === ".r:*") return {
907
+ raw: t,
908
+ type: "any-referrer",
909
+ description: "",
910
+ requiresToken: !1
911
+ };
912
+ if (t.startsWith(".r:")) {
913
+ let e = t.slice(3), n = e.startsWith("-"), r = n ? e.slice(1) : e;
914
+ return {
915
+ raw: t,
916
+ type: n ? "denied-referrer" : "specific-referrer",
917
+ host: r,
918
+ description: "",
919
+ requiresToken: !1
920
+ };
921
+ }
922
+ if (t === ".rlistings") return {
923
+ raw: t,
924
+ type: "listing-access",
925
+ description: "",
926
+ requiresToken: !1
927
+ };
928
+ if (/^[^:]+:\*$/.test(t) && !t.startsWith("*")) {
929
+ let [e] = t.split(":");
930
+ return {
931
+ raw: t,
932
+ type: "all-project-users",
933
+ projectId: e,
934
+ description: "",
935
+ requiresToken: !0
936
+ };
937
+ }
938
+ if (t.startsWith("*:")) return {
939
+ raw: t,
940
+ type: "specific-user-any-project",
941
+ userId: t.slice(2),
942
+ description: "",
943
+ requiresToken: !0
944
+ };
945
+ if (t.includes(":")) {
946
+ let [e, n] = t.split(":");
947
+ return {
948
+ raw: t,
949
+ type: "specific-user",
950
+ projectId: e,
951
+ userId: n,
952
+ description: "",
953
+ requiresToken: !0
954
+ };
955
+ }
956
+ return {
957
+ raw: t,
958
+ type: "unknown",
959
+ description: "",
960
+ requiresToken: !0
961
+ };
962
+ }
963
+ function me(e) {
964
+ return e.trim() ? e.split(",").map((e) => e.trim()).filter(Boolean).map(pe) : [];
965
+ }
966
+ var he = [".r:*", ".rlistings"];
967
+ function ge(e) {
968
+ let t = e.split(",").map((e) => e.trim()).filter(Boolean);
969
+ return he.every((e) => t.includes(e));
970
+ }
971
+ function _e(e) {
972
+ let t = e.split(",").map((e) => e.trim()).filter(Boolean);
973
+ return [...new Set([...he, ...t])].join(",");
974
+ }
975
+ function ve(e) {
976
+ return e.split(",").map((e) => e.trim()).filter((e) => !he.includes(e)).join(",");
977
+ }
978
+ function ye(e) {
979
+ switch (e.type) {
980
+ case "any-referrer": return K._({ id: "HVdrr1" });
981
+ case "denied-referrer": {
982
+ let t = e.host || "";
983
+ return K._({
984
+ id: "7XQ3QJ",
985
+ values: { host: t }
986
+ });
987
+ }
988
+ case "specific-referrer": {
989
+ let t = e.host || "";
990
+ return K._({
991
+ id: "Dqnh7K",
992
+ values: { host: t }
993
+ });
994
+ }
995
+ case "listing-access": return K._({ id: "ntNlXu" });
996
+ case "all-project-users": {
997
+ let t = e.projectId || "";
998
+ return K._({
999
+ id: "sa4CV6",
1000
+ values: { projectId: t }
1001
+ });
1002
+ }
1003
+ case "specific-user-any-project": {
1004
+ let t = e.userId || "";
1005
+ return K._({
1006
+ id: "izMhIO",
1007
+ values: { userId: t }
1008
+ });
1009
+ }
1010
+ case "specific-user": {
1011
+ let t = e.projectId || "", n = e.userId || "";
1012
+ return K._({
1013
+ id: "cXuXkb",
1014
+ values: {
1015
+ userId: n,
1016
+ projectId: t
1017
+ }
1018
+ });
1019
+ }
1020
+ default: return e.raw;
1021
+ }
1022
+ }
1023
+ var X = ({ isOpen: e, container: t, onClose: i, onSuccess: o, onError: c }) => {
1024
+ let { i18n: l, _: u } = G(), d = I(), [f, p] = H(""), [m, h] = H(""), [_, v] = H(!1), [y, x] = H(!1);
1025
+ ie(() => {
1026
+ !f.trim() && !m.trim() && x(!1);
1027
+ }, [f, m]);
1028
+ let { data: S, isLoading: T, isError: E, error: D } = M.storage.swift.getContainerMetadata.useQuery({
1029
+ project_id: d,
1030
+ container: t?.name ?? ""
1031
+ }, { enabled: e && t !== null });
1032
+ ie(() => {
1033
+ if (!S) return;
1034
+ let e = S.read ?? "", t = S.write ?? "";
1035
+ p(e), h(t), v(ge(e));
1036
+ }, [S]);
1037
+ let k = M.useUtils(), A = M.storage.swift.updateContainerMetadata.useMutation({
1038
+ onSuccess: () => {
1039
+ k.storage.swift.getContainerMetadata.invalidate({
1040
+ project_id: d,
1041
+ container: t.name
1042
+ }), k.storage.swift.listContainers.invalidate(), o?.(t.name), P();
1043
+ },
1044
+ onError: (e) => {
1045
+ c?.(t.name, e.message);
1046
+ }
1047
+ }), N = ae(A.reset);
1048
+ N.current = A.reset;
1049
+ let P = () => {
1050
+ p(""), h(""), v(!1), x(!1), A.reset(), i();
1051
+ };
1052
+ ie(() => {
1053
+ e || (p(""), h(""), v(!1), N.current());
1054
+ }, [e]);
1055
+ let ee = (e) => {
1056
+ let t = e.target.checked;
1057
+ v(t), p((e) => t ? _e(e) : ve(e));
1058
+ }, F = (e) => {
1059
+ let t = e.target.value;
1060
+ p(t), v(ge(t));
1061
+ }, te = () => {
1062
+ t && A.mutate({
1063
+ project_id: d,
1064
+ container: t.name,
1065
+ read: f.trim(),
1066
+ write: m.trim()
1067
+ });
1068
+ };
1069
+ if (!e || !t) return null;
1070
+ let L = T || A.isPending, re = f.trim().length > 0 || m.trim().length > 0, V = me(f), U = me(m);
1071
+ return /*#__PURE__*/ B(w, {
1072
+ title: /* @__PURE__ */ B("span", {
1073
+ className: "flex items-center gap-2",
1074
+ children: [/*#__PURE__*/ z(W, { id: "EdxcAN" }), /*#__PURE__*/ z("span", {
1075
+ className: "max-w-[250px] truncate",
1076
+ title: t.name,
1077
+ children: t.name
1078
+ })]
1079
+ }),
1080
+ open: e,
1081
+ onCancel: P,
1082
+ confirmButtonLabel: l._({ id: "tfDRzk" }),
1083
+ onConfirm: te,
1084
+ cancelButtonLabel: l._({ id: "dEgA5A" }),
1085
+ size: "xl",
1086
+ disableConfirmButton: L || E,
1087
+ children: [A.isError && /*#__PURE__*/ z("p", {
1088
+ className: "text-theme-error mb-4",
1089
+ children: (() => {
1090
+ let e = A.error.message;
1091
+ return /*#__PURE__*/ z(W, {
1092
+ id: "u2xIeO",
1093
+ values: { errorMessage: e }
1094
+ });
1095
+ })()
1096
+ }), /*#__PURE__*/ B("div", {
1097
+ className: "max-h-[70vh] overflow-y-auto pr-1 pl-1",
1098
+ children: [
1099
+ /*#__PURE__*/ z("div", {
1100
+ className: "mb-4",
1101
+ children: /*#__PURE__*/ z(n, {
1102
+ variant: "warning",
1103
+ className: "mb-4",
1104
+ children: /*#__PURE__*/ z(W, { id: "wH0MtN" })
1105
+ })
1106
+ }),
1107
+ T ? /*#__PURE__*/ B(O, {
1108
+ direction: "horizontal",
1109
+ alignment: "center",
1110
+ gap: "2",
1111
+ className: "py-6",
1112
+ children: [/*#__PURE__*/ z(s, { size: "small" }), /*#__PURE__*/ z(W, { id: "poCbZw" })]
1113
+ }) : E ? /*#__PURE__*/ z("p", {
1114
+ className: "text-theme-error py-2",
1115
+ children: /*#__PURE__*/ z(W, {
1116
+ id: "QNHur0",
1117
+ values: { errorMessage: D?.message ?? "" }
1118
+ })
1119
+ }) : /*#__PURE__*/ z(R, { children: /*#__PURE__*/ B("div", {
1120
+ className: "flex gap-6",
1121
+ children: [/*#__PURE__*/ z("div", {
1122
+ className: "min-w-0 flex-1",
1123
+ children: /*#__PURE__*/ B(O, {
1124
+ direction: "vertical",
1125
+ gap: "6",
1126
+ children: [
1127
+ /*#__PURE__*/ B("div", { children: [
1128
+ /*#__PURE__*/ z(be, { label: l._({ id: "SBGiGm" }) }),
1129
+ /*#__PURE__*/ z(g, {
1130
+ value: f,
1131
+ onChange: F,
1132
+ disabled: L || _,
1133
+ placeholder: l._({ id: "FKL6Jv" }),
1134
+ className: "text-sm",
1135
+ rows: 3
1136
+ }),
1137
+ /*#__PURE__*/ z(b, {
1138
+ label: l._({ id: "23wBCX" }),
1139
+ checked: _,
1140
+ onChange: ee,
1141
+ disabled: L,
1142
+ className: "mt-2"
1143
+ })
1144
+ ] }),
1145
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(be, { label: l._({ id: "6qzsuS" }) }), /*#__PURE__*/ z(g, {
1146
+ value: m,
1147
+ onChange: (e) => {
1148
+ let t = e.target.value;
1149
+ h(t);
1150
+ },
1151
+ disabled: L,
1152
+ placeholder: l._({ id: "UVFHGY" }),
1153
+ className: "text-sm",
1154
+ rows: 3
1155
+ })] }),
1156
+ re && /*#__PURE__*/ z(j, {
1157
+ label: y ? l._({ id: "we28Pq" }) : l._({ id: "YiMCKk" }),
1158
+ onClick: () => x((e) => !e),
1159
+ variant: "subdued",
1160
+ disabled: L,
1161
+ className: "self-start"
1162
+ }),
1163
+ y && (V.length > 0 || U.length > 0) && /*#__PURE__*/ B(O, {
1164
+ direction: "vertical",
1165
+ gap: "4",
1166
+ children: [V.length > 0 && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
1167
+ className: "text-theme-default mb-2 text-sm font-semibold",
1168
+ children: /*#__PURE__*/ z(W, { id: "x7SF89" })
1169
+ }), /*#__PURE__*/ z("div", {
1170
+ className: "border-theme-background-lvl-3 rounded border p-3",
1171
+ children: /*#__PURE__*/ z(a, {
1172
+ className: "grid-cols-2",
1173
+ alignTerms: "left",
1174
+ children: V.map((e, t) => /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(C, {
1175
+ className: "col-span-1",
1176
+ children: /*#__PURE__*/ z("span", {
1177
+ className: "block truncate text-xs",
1178
+ title: e.raw,
1179
+ children: e.raw
1180
+ })
1181
+ }), /*#__PURE__*/ B(r, {
1182
+ className: "col-span-1",
1183
+ children: [/*#__PURE__*/ z("span", {
1184
+ className: "block truncate text-sm",
1185
+ title: ye(e),
1186
+ children: ye(e)
1187
+ }), /*#__PURE__*/ z("span", {
1188
+ className: "text-theme-light block text-xs",
1189
+ children: e.requiresToken ? /*#__PURE__*/ z(W, { id: "z+zpLP" }) : /*#__PURE__*/ z(W, { id: "t7ff15" })
1190
+ })]
1191
+ })] }, t))
1192
+ })
1193
+ })] }), U.length > 0 && /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
1194
+ className: "text-theme-default mb-2 text-sm font-semibold",
1195
+ children: /*#__PURE__*/ z(W, { id: "lRRkwQ" })
1196
+ }), /*#__PURE__*/ z("div", {
1197
+ className: "border-theme-background-lvl-3 rounded border p-3",
1198
+ children: /*#__PURE__*/ z(a, {
1199
+ className: "grid-cols-2",
1200
+ alignTerms: "left",
1201
+ children: U.map((e, t) => /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(C, {
1202
+ className: "col-span-1",
1203
+ children: /*#__PURE__*/ z("span", {
1204
+ className: "block truncate text-xs",
1205
+ title: e.raw,
1206
+ children: e.raw
1207
+ })
1208
+ }), /*#__PURE__*/ B(r, {
1209
+ className: "col-span-1",
1210
+ children: [/*#__PURE__*/ z("span", {
1211
+ className: "block truncate text-sm",
1212
+ title: ye(e),
1213
+ children: ye(e)
1214
+ }), /*#__PURE__*/ z("span", {
1215
+ className: "text-theme-light block text-xs",
1216
+ children: e.requiresToken ? /*#__PURE__*/ z(W, { id: "z+zpLP" }) : /*#__PURE__*/ z(W, { id: "t7ff15" })
1217
+ })]
1218
+ })] }, t))
1219
+ })
1220
+ })] })]
1221
+ })
1222
+ ]
1223
+ })
1224
+ }), /*#__PURE__*/ B("div", {
1225
+ className: "border-theme-background-lvl-3 w-72 shrink-0 border-l pl-6",
1226
+ children: [
1227
+ /*#__PURE__*/ z("p", {
1228
+ className: "text-theme-light mb-3 text-xs",
1229
+ children: /*#__PURE__*/ z(W, { id: "dd2ndz" })
1230
+ }),
1231
+ /*#__PURE__*/ B(O, {
1232
+ direction: "vertical",
1233
+ gap: "4",
1234
+ children: [
1235
+ /*#__PURE__*/ z(Z, {
1236
+ code: ".r:*",
1237
+ description: l._({ id: "VV1fdg" })
1238
+ }),
1239
+ /*#__PURE__*/ z(Z, {
1240
+ code: ".rlistings",
1241
+ description: l._({ id: "s/s1lz" })
1242
+ }),
1243
+ /*#__PURE__*/ z(Z, {
1244
+ code: "PROJECT_ID:USER_ID",
1245
+ description: l._({ id: "zhM8FP" })
1246
+ }),
1247
+ /*#__PURE__*/ z(Z, {
1248
+ code: "PROJECT_ID:*",
1249
+ description: l._({ id: "BCJPTn" })
1250
+ }),
1251
+ /*#__PURE__*/ z(Z, {
1252
+ code: "*:USER_ID",
1253
+ description: l._({ id: "/xnbdQ" })
1254
+ })
1255
+ ]
1256
+ }),
1257
+ /*#__PURE__*/ z("p", {
1258
+ className: "text-theme-light mt-4 text-xs",
1259
+ children: /*#__PURE__*/ z(W, {
1260
+ id: "rrjuul",
1261
+ components: { 0: /*#__PURE__*/ z("a", {
1262
+ href: "https://docs.openstack.org/swift/latest/overview_acl.html",
1263
+ target: "_blank",
1264
+ rel: "noopener noreferrer",
1265
+ className: "text-theme-link underline"
1266
+ }) }
1267
+ })
1268
+ })
1269
+ ]
1270
+ })]
1271
+ }) }),
1272
+ !T && !E && /*#__PURE__*/ z("p", {
1273
+ className: "text-theme-light mt-4 text-xs",
1274
+ children: /*#__PURE__*/ z(W, { id: "j9lCXl" })
1275
+ })
1276
+ ]
1277
+ })]
1278
+ });
1279
+ };
1280
+ function Z({ code: e, description: t }) {
1281
+ return /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(A, {
1282
+ variant: "info",
1283
+ className: "mb-1 text-xs",
1284
+ children: e
1285
+ }), /*#__PURE__*/ z("p", {
1286
+ className: "text-theme-light text-xs leading-relaxed",
1287
+ children: t
1288
+ })] });
1289
+ }
1290
+ function be({ label: e }) {
1291
+ return /*#__PURE__*/ B("div", {
1292
+ className: "mb-1 flex items-center gap-1",
1293
+ children: [/*#__PURE__*/ z("label", {
1294
+ className: "text-theme-default text-sm font-semibold",
1295
+ children: e
1296
+ }), /*#__PURE__*/ B(S, {
1297
+ triggerEvent: "hover",
1298
+ children: [/*#__PURE__*/ z(E, { children: /*#__PURE__*/ z(_, {
1299
+ icon: "info",
1300
+ size: "14",
1301
+ className: "text-theme-light cursor-help"
1302
+ }) }), /*#__PURE__*/ z(y, {
1303
+ className: "z-10 max-w-[350px]",
1304
+ children: /*#__PURE__*/ z(W, { id: "AdtLNV" })
1305
+ })]
1306
+ })]
1307
+ });
1308
+ }
1309
+ //#endregion
1310
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerTableView.tsx
1311
+ var xe = ({ containers: e, createModalOpen: n, setCreateModalOpen: r, maxContainerNameLength: a, onCreateSuccess: s, onCreateError: c, onEmptySuccess: l, onEmptyError: f, onDeleteSuccess: p, onDeleteError: h, onPropertiesSuccess: g, onPropertiesError: _, onAclSuccess: v, onAclError: y, selectedContainers: x, setSelectedContainers: S, hasAnyBulkAction: C = !0 }) => {
1312
+ let { projectId: w, provider: E, storageType: D } = oe({ from: "/_auth/projects/$projectId/storage/$provider/$storageType/" }), { i18n: O, _: k } = G(), A = U(), j = ae(null), [M, N] = H(0), [P, ee] = H(null), [I, te] = H(null), [L, ne] = H(null), [re, V] = H(null);
1313
+ ie(() => {
1314
+ j.current && N(j.current.offsetWidth - j.current.clientWidth);
1315
+ }, [e.length]);
1316
+ let K = (e) => {
1317
+ try {
1318
+ return new Date(e).toLocaleString();
1319
+ } catch {
1320
+ return O._({ id: "fj5byd" });
1321
+ }
1322
+ }, se = q({
1323
+ count: e.length,
1324
+ getScrollElement: () => j.current,
1325
+ estimateSize: () => 48,
1326
+ overscan: 10
1327
+ }), ue = (e) => {
1328
+ x.includes(e) ? S(x.filter((t) => t !== e)) : S([...x, e]);
1329
+ };
1330
+ if (!e || e.length === 0) return /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z(u, {
1331
+ columns: 4,
1332
+ className: "containers",
1333
+ "data-testid": "no-containers",
1334
+ children: /*#__PURE__*/ z(i, { children: /*#__PURE__*/ z(o, {
1335
+ colSpan: 4,
1336
+ children: /*#__PURE__*/ B("div", {
1337
+ className: "py-8 text-center",
1338
+ children: [/*#__PURE__*/ z("h3", {
1339
+ className: "text-lg font-semibold",
1340
+ children: /*#__PURE__*/ z(W, { id: "Hiw1Ha" })
1341
+ }), /*#__PURE__*/ z("p", {
1342
+ className: "text-theme-light mt-2",
1343
+ children: /*#__PURE__*/ z(W, { id: "x1bK0h" })
1344
+ })]
1345
+ })
1346
+ }) })
1347
+ }), /*#__PURE__*/ z(ce, {
1348
+ isOpen: n,
1349
+ onClose: () => r(!1),
1350
+ onSuccess: s,
1351
+ onError: c,
1352
+ maxContainerNameLength: a
1353
+ })] });
1354
+ let de = C ? 6 : 5, fe = C ? "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px" : "minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
1355
+ return /*#__PURE__*/ B(R, { children: [
1356
+ /*#__PURE__*/ B("div", {
1357
+ className: "relative",
1358
+ children: [/*#__PURE__*/ z("div", {
1359
+ style: { paddingRight: `${M}px` },
1360
+ children: /*#__PURE__*/ z(u, {
1361
+ columns: de,
1362
+ gridColumnTemplate: fe,
1363
+ className: "containers",
1364
+ "data-testid": "containers-table-header",
1365
+ children: /*#__PURE__*/ B(i, { children: [
1366
+ C && /*#__PURE__*/ z(d, {}),
1367
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "t0X9+8" }) }),
1368
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "sxbP3b" }) }),
1369
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) }),
1370
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "hgpMHD" }) }),
1371
+ /*#__PURE__*/ z(d, { style: { marginRight: `-${M}px` } })
1372
+ ] })
1373
+ })
1374
+ }), /*#__PURE__*/ z("div", {
1375
+ ref: j,
1376
+ className: "overflow-auto",
1377
+ style: { height: "calc(100vh - 490px)" },
1378
+ "data-testid": "containers-table-body",
1379
+ children: /*#__PURE__*/ z("div", {
1380
+ style: {
1381
+ height: `${se.getTotalSize()}px`,
1382
+ width: "100%",
1383
+ position: "relative"
1384
+ },
1385
+ children: se.getVirtualItems().map((n) => {
1386
+ let r = e[n.index], i = x.includes(r.name), a = () => A({
1387
+ to: "/projects/$projectId/storage/$provider/$storageType/$containerName/objects",
1388
+ params: {
1389
+ projectId: w,
1390
+ provider: E,
1391
+ storageType: D,
1392
+ containerName: r.name
1393
+ }
1394
+ });
1395
+ return /*#__PURE__*/ B("div", {
1396
+ "data-index": n.index,
1397
+ ref: se.measureElement,
1398
+ className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
1399
+ style: {
1400
+ position: "absolute",
1401
+ top: 0,
1402
+ left: 0,
1403
+ width: "100%",
1404
+ transform: `translateY(${n.start}px)`,
1405
+ display: "grid",
1406
+ gridTemplateColumns: fe,
1407
+ alignItems: "stretch"
1408
+ },
1409
+ "data-testid": `container-row-${r.name}`,
1410
+ role: "link",
1411
+ tabIndex: 0,
1412
+ onClick: a,
1413
+ onKeyDown: (e) => {
1414
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
1415
+ },
1416
+ children: [
1417
+ C && /*#__PURE__*/ z(o, {
1418
+ onClick: (e) => e.stopPropagation(),
1419
+ onKeyDown: (e) => {
1420
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
1421
+ },
1422
+ children: /*#__PURE__*/ z(b, {
1423
+ checked: i,
1424
+ onChange: () => ue(r.name),
1425
+ "data-testid": `select-container-${r.name}`
1426
+ })
1427
+ }),
1428
+ /*#__PURE__*/ z(o, {
1429
+ className: "min-w-0 overflow-hidden",
1430
+ children: /*#__PURE__*/ z("span", {
1431
+ className: "block truncate",
1432
+ title: r.name,
1433
+ children: r.name
1434
+ })
1435
+ }),
1436
+ /*#__PURE__*/ z(o, { children: r.count.toLocaleString() }),
1437
+ /*#__PURE__*/ z(o, { children: r.last_modified ? K(r.last_modified) : O._({ id: "fj5byd" }) }),
1438
+ /*#__PURE__*/ z(o, { children: F(r.bytes) }),
1439
+ /*#__PURE__*/ z(o, {
1440
+ onClick: (e) => e.stopPropagation(),
1441
+ children: /*#__PURE__*/ z(T, { children: /*#__PURE__*/ B(t, { children: [
1442
+ /*#__PURE__*/ z(m, {
1443
+ label: O._({ id: "cWbW6w" }),
1444
+ onClick: () => V(r),
1445
+ "data-testid": `access-control-action-${r.name}`
1446
+ }),
1447
+ /*#__PURE__*/ z(m, {
1448
+ label: O._({ id: "Oc8Aqv" }),
1449
+ onClick: () => ne(r),
1450
+ "data-testid": `properties-action-${r.name}`
1451
+ }),
1452
+ /*#__PURE__*/ z(m, {
1453
+ label: O._({ id: "N2S1rs" }),
1454
+ onClick: () => ee(r),
1455
+ "data-testid": `empty-action-${r.name}`
1456
+ }),
1457
+ /*#__PURE__*/ z(m, {
1458
+ label: O._({ id: "cnGeoo" }),
1459
+ onClick: () => te(r),
1460
+ "data-testid": `delete-action-${r.name}`
1461
+ })
1462
+ ] }) })
1463
+ })
1464
+ ]
1465
+ }, r.name);
1466
+ })
1467
+ })
1468
+ })]
1469
+ }),
1470
+ /*#__PURE__*/ z(ce, {
1471
+ isOpen: n,
1472
+ onClose: () => r(!1),
1473
+ onSuccess: s,
1474
+ onError: c,
1475
+ maxContainerNameLength: a
1476
+ }),
1477
+ /*#__PURE__*/ z(J, {
1478
+ isOpen: P !== null,
1479
+ container: P,
1480
+ onClose: () => ee(null),
1481
+ onSuccess: l,
1482
+ onError: f
1483
+ }),
1484
+ /*#__PURE__*/ z(le, {
1485
+ isOpen: I !== null,
1486
+ container: I,
1487
+ onClose: () => te(null),
1488
+ onSuccess: p,
1489
+ onError: h
1490
+ }),
1491
+ /*#__PURE__*/ z(Y, {
1492
+ isOpen: L !== null,
1493
+ container: L,
1494
+ onClose: () => ne(null),
1495
+ onSuccess: g,
1496
+ onError: _
1497
+ }),
1498
+ /*#__PURE__*/ z(X, {
1499
+ isOpen: re !== null,
1500
+ container: re,
1501
+ onClose: () => V(null),
1502
+ onSuccess: v,
1503
+ onError: y
1504
+ })
1505
+ ] });
1506
+ };
1507
+ //#endregion
1508
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Swift/Containers/ContainerToastNotifications.tsx
1509
+ function Q({ title: e, description: t }) {
1510
+ return /*#__PURE__*/ B(O, {
1511
+ direction: "vertical",
1512
+ gap: "1.5",
1513
+ children: [/*#__PURE__*/ z("span", { children: e }), /*#__PURE__*/ z("span", {
1514
+ className: "text-theme-light",
1515
+ children: t
1516
+ })]
1517
+ });
1518
+ }
1519
+ var Se = (e, t) => ({
1520
+ variant: "success",
1521
+ children: /*#__PURE__*/ z(Q, {
1522
+ title: /*#__PURE__*/ z(W, { id: "6w+VnM" }),
1523
+ description: /*#__PURE__*/ z(W, {
1524
+ id: "XwxJJB",
1525
+ values: { containerName: e }
1526
+ })
1527
+ }),
1528
+ onDismiss: t.onDismiss
1529
+ }), Ce = (e, t, n) => ({
1530
+ variant: "error",
1531
+ children: /*#__PURE__*/ z(Q, {
1532
+ title: /*#__PURE__*/ z(W, { id: "Vj8XFg" }),
1533
+ description: /*#__PURE__*/ z(W, {
1534
+ id: "Vz+7ZA",
1535
+ values: {
1536
+ containerName: e,
1537
+ errorMessage: t
1538
+ }
1539
+ })
1540
+ }),
1541
+ onDismiss: n.onDismiss
1542
+ }), we = (e, t, n) => ({
1543
+ variant: "success",
1544
+ children: /*#__PURE__*/ z(Q, {
1545
+ title: /*#__PURE__*/ z(W, { id: "6OopEX" }),
1546
+ description: t === 0 ? /*#__PURE__*/ z(W, {
1547
+ id: "nkpZyk",
1548
+ values: { containerName: e }
1549
+ }) : t === 1 ? /*#__PURE__*/ z(W, {
1550
+ id: "TZJiVf",
1551
+ values: {
1552
+ containerName: e,
1553
+ deletedCount: t
1554
+ }
1555
+ }) : /*#__PURE__*/ z(W, {
1556
+ id: "Sb/VT5",
1557
+ values: {
1558
+ containerName: e,
1559
+ deletedCount: t
1560
+ }
1561
+ })
1562
+ }),
1563
+ onDismiss: n.onDismiss
1564
+ }), Te = (e, t, n) => ({
1565
+ variant: "error",
1566
+ children: /*#__PURE__*/ z(Q, {
1567
+ title: /*#__PURE__*/ z(W, { id: "S8/j2h" }),
1568
+ description: /*#__PURE__*/ z(W, {
1569
+ id: "1rLu3+",
1570
+ values: {
1571
+ containerName: e,
1572
+ errorMessage: t
1573
+ }
1574
+ })
1575
+ }),
1576
+ onDismiss: n.onDismiss
1577
+ }), Ee = (e, t) => ({
1578
+ variant: "success",
1579
+ children: /*#__PURE__*/ z(Q, {
1580
+ title: /*#__PURE__*/ z(W, { id: "odVI9Y" }),
1581
+ description: /*#__PURE__*/ z(W, {
1582
+ id: "V1TzeS",
1583
+ values: { containerName: e }
1584
+ })
1585
+ }),
1586
+ onDismiss: t.onDismiss
1587
+ }), De = (e, t, n) => ({
1588
+ variant: "error",
1589
+ children: /*#__PURE__*/ z(Q, {
1590
+ title: /*#__PURE__*/ z(W, { id: "BJt+PJ" }),
1591
+ description: /*#__PURE__*/ z(W, {
1592
+ id: "RGrgxg",
1593
+ values: {
1594
+ containerName: e,
1595
+ errorMessage: t
1596
+ }
1597
+ })
1598
+ }),
1599
+ onDismiss: n.onDismiss
1600
+ }), Oe = (e, t) => ({
1601
+ variant: "success",
1602
+ children: /*#__PURE__*/ z(Q, {
1603
+ title: /*#__PURE__*/ z(W, { id: "a7C4YS" }),
1604
+ description: /*#__PURE__*/ z(W, {
1605
+ id: "/NeNjH",
1606
+ values: { containerName: e }
1607
+ })
1608
+ }),
1609
+ onDismiss: t.onDismiss
1610
+ }), ke = (e, t, n) => ({
1611
+ variant: "error",
1612
+ children: /*#__PURE__*/ z(Q, {
1613
+ title: /*#__PURE__*/ z(W, { id: "5MF8U2" }),
1614
+ description: /*#__PURE__*/ z(W, {
1615
+ id: "uLtFAr",
1616
+ values: {
1617
+ containerName: e,
1618
+ errorMessage: t
1619
+ }
1620
+ })
1621
+ }),
1622
+ onDismiss: n.onDismiss
1623
+ }), Ae = (e, t) => ({
1624
+ variant: "success",
1625
+ children: /*#__PURE__*/ z(Q, {
1626
+ title: /*#__PURE__*/ z(W, { id: "olfSYj" }),
1627
+ description: /*#__PURE__*/ z(W, {
1628
+ id: "tM5SEI",
1629
+ values: { containerName: e }
1630
+ })
1631
+ }),
1632
+ onDismiss: t.onDismiss
1633
+ }), je = (e, t, n) => ({
1634
+ variant: "error",
1635
+ children: /*#__PURE__*/ z(Q, {
1636
+ title: /*#__PURE__*/ z(W, { id: "p7DzCB" }),
1637
+ description: /*#__PURE__*/ z(W, {
1638
+ id: "DcMIiu",
1639
+ values: {
1640
+ containerName: e,
1641
+ errorMessage: t
1642
+ }
1643
+ })
1644
+ }),
1645
+ onDismiss: n.onDismiss
1646
+ }), Me = (e, t, n, r) => {
1647
+ let i = n.length > 0, a = e > 0, o = i && a;
1648
+ return {
1649
+ variant: o ? "warning" : i ? "error" : "success",
1650
+ children: /*#__PURE__*/ z(Q, {
1651
+ title: o ? /*#__PURE__*/ z(W, { id: "q44uUq" }) : i ? /*#__PURE__*/ z(W, { id: "wFaT8w" }) : /*#__PURE__*/ z(W, { id: "0WsqO0" }),
1652
+ description: /*#__PURE__*/ B(O, {
1653
+ direction: "vertical",
1654
+ gap: "1",
1655
+ children: [a && /*#__PURE__*/ z("span", { children: /*#__PURE__*/ z(W, {
1656
+ id: "1NS3nd",
1657
+ values: {
1658
+ emptiedCount: e,
1659
+ totalDeleted: t
1660
+ }
1661
+ }) }), i && /*#__PURE__*/ z("span", {
1662
+ className: "whitespace-pre-line",
1663
+ children: /*#__PURE__*/ z(W, {
1664
+ id: "JrmKyf",
1665
+ values: { errorDetails: n.join("\n") }
1666
+ })
1667
+ })]
1668
+ })
1669
+ }),
1670
+ onDismiss: r.onDismiss
1671
+ };
1672
+ }, $ = ({ label: e, value: t }) => t == null ? null : /*#__PURE__*/ B("span", {
1673
+ className: "flex items-start gap-1.5",
1674
+ children: [/*#__PURE__*/ z(_, {
1675
+ icon: "check",
1676
+ size: "16px",
1677
+ className: "text-theme-success mt-0.5 shrink-0"
1678
+ }), /*#__PURE__*/ B("span", { children: [
1679
+ /*#__PURE__*/ B("span", {
1680
+ className: "font-medium",
1681
+ children: [e, ":"]
1682
+ }),
1683
+ " ",
1684
+ t
1685
+ ] })]
1686
+ }), Ne = ({ label: e }) => /*#__PURE__*/ B("span", {
1687
+ className: "flex items-start gap-1.5",
1688
+ children: [/*#__PURE__*/ z(_, {
1689
+ icon: "check",
1690
+ size: "16px",
1691
+ className: "text-theme-success mt-0.5 shrink-0"
1692
+ }), /*#__PURE__*/ z("span", { children: e })]
1693
+ }), Pe = ({ title: e, children: t }) => /*#__PURE__*/ B("span", {
1694
+ className: "flex flex-col gap-1.5",
1695
+ children: [/*#__PURE__*/ z("span", {
1696
+ className: "text-theme-default block font-semibold",
1697
+ children: e
1698
+ }), t]
1699
+ }), Fe = ({ serviceInfo: e, accountInfo: t, open: n }) => {
1700
+ let { i18n: r, _: i } = G(), a = e?.swift, o = {
1701
+ account_quotas: r._({ id: "DJT9tB" }),
1702
+ container_quotas: r._({ id: "USiuNX" }),
1703
+ bulk_delete: r._({ id: "F6YIQe" }),
1704
+ bulk_upload: r._({ id: "2Inn83" }),
1705
+ slo: r._({ id: "cpw++p" }),
1706
+ container_sync: r._({ id: "ezT9KW" }),
1707
+ tempurl: r._({ id: "UO3hJ2" }),
1708
+ symlink: r._({ id: "Q2xmVl" }),
1709
+ versioned_writes: r._({ id: "8jLXs3" })
1710
+ }, s = Object.entries(o).filter(([e]) => a?.[e]).map(([, e]) => e);
1711
+ return /*#__PURE__*/ B(S, {
1712
+ triggerEvent: "hover",
1713
+ placement: "bottom-end",
1714
+ open: n,
1715
+ children: [/*#__PURE__*/ z(E, {
1716
+ asChild: !0,
1717
+ children: /*#__PURE__*/ z(_, {
1718
+ icon: "info",
1719
+ size: "20px",
1720
+ className: "text-theme-light hover:text-theme-default cursor-pointer"
1721
+ })
1722
+ }), /*#__PURE__*/ z(y, {
1723
+ className: "z-10 w-72 text-sm",
1724
+ children: /*#__PURE__*/ B("span", {
1725
+ className: "flex flex-col gap-3 p-1",
1726
+ children: [
1727
+ t && /*#__PURE__*/ B(Pe, {
1728
+ title: /*#__PURE__*/ z(W, { id: "AeXO77" }),
1729
+ children: [
1730
+ /*#__PURE__*/ z($, {
1731
+ label: r._({ id: "ClGcRq" }),
1732
+ value: t.containerCount.toLocaleString()
1733
+ }),
1734
+ /*#__PURE__*/ z($, {
1735
+ label: r._({ id: "B3toQF" }),
1736
+ value: t.objectCount.toLocaleString()
1737
+ }),
1738
+ /*#__PURE__*/ z($, {
1739
+ label: r._({ id: "aL1w5Z" }),
1740
+ value: F(t.bytesUsed)
1741
+ }),
1742
+ t.quotaBytes !== void 0 && /*#__PURE__*/ z($, {
1743
+ label: r._({ id: "vEkTR9" }),
1744
+ value: F(t.quotaBytes)
1745
+ })
1746
+ ]
1747
+ }),
1748
+ a && /*#__PURE__*/ B(Pe, {
1749
+ title: /*#__PURE__*/ z(W, { id: "6BDqha" }),
1750
+ children: [
1751
+ /*#__PURE__*/ z($, {
1752
+ label: r._({ id: "wTg+FY" }),
1753
+ value: a.max_file_size === void 0 ? void 0 : F(a.max_file_size)
1754
+ }),
1755
+ /*#__PURE__*/ z($, {
1756
+ label: r._({ id: "Rih53k" }),
1757
+ value: a.max_container_name_length
1758
+ }),
1759
+ /*#__PURE__*/ z($, {
1760
+ label: r._({ id: "qAkkjP" }),
1761
+ value: a.max_object_name_length
1762
+ }),
1763
+ /*#__PURE__*/ z($, {
1764
+ label: r._({ id: "OZImTR" }),
1765
+ value: a.container_listing_limit?.toLocaleString()
1766
+ }),
1767
+ /*#__PURE__*/ z($, {
1768
+ label: r._({ id: "a4A2uB" }),
1769
+ value: a.account_listing_limit?.toLocaleString()
1770
+ }),
1771
+ /*#__PURE__*/ z($, {
1772
+ label: r._({ id: "zWb/Nn" }),
1773
+ value: a.max_header_size
1774
+ }),
1775
+ /*#__PURE__*/ z($, {
1776
+ label: r._({ id: "RGwfoL" }),
1777
+ value: a.max_meta_count
1778
+ }),
1779
+ /*#__PURE__*/ z($, {
1780
+ label: r._({ id: "8c3/77" }),
1781
+ value: a.max_meta_name_length
1782
+ }),
1783
+ /*#__PURE__*/ z($, {
1784
+ label: r._({ id: "5JDSvn" }),
1785
+ value: a.max_meta_value_length
1786
+ }),
1787
+ /*#__PURE__*/ z($, {
1788
+ label: r._({ id: "ZAx+d1" }),
1789
+ value: a.max_meta_overall_size
1790
+ }),
1791
+ a.bulk_delete && /*#__PURE__*/ z($, {
1792
+ label: r._({ id: "lQ3EIe" }),
1793
+ value: a.bulk_delete.max_deletes_per_request.toLocaleString()
1794
+ }),
1795
+ a.bulk_upload && /*#__PURE__*/ z($, {
1796
+ label: r._({ id: "STc+7E" }),
1797
+ value: a.bulk_upload.max_containers_per_extraction.toLocaleString()
1798
+ }),
1799
+ a.slo && /*#__PURE__*/ z($, {
1800
+ label: r._({ id: "RNBvdl" }),
1801
+ value: a.slo.max_manifest_segments.toLocaleString()
1802
+ })
1803
+ ]
1804
+ }),
1805
+ s.length > 0 && /*#__PURE__*/ z(Pe, {
1806
+ title: /*#__PURE__*/ z(W, { id: "Qx7DM7" }),
1807
+ children: s.map((e) => /*#__PURE__*/ z(Ne, { label: e }, e))
1808
+ })
1809
+ ]
1810
+ })
1811
+ })]
1812
+ });
1813
+ }, Ie = 20, Le = "empty", Re = ({ isOpen: e, containers: t, onClose: i, onComplete: o }) => {
1814
+ let { i18n: c, i18n: l, _: u } = G(), d = I(), [p, m] = H(null), [h, g] = H(""), _ = h.trim() === Le, v = M.useUtils(), y = M.storage.swift.emptyContainer.useMutation(), b = () => {
1815
+ y.reset(), m(null), g(""), i();
1816
+ }, x = async () => {
1817
+ let e = 0, n = 0, r = [], i = t.length;
1818
+ for (let a = 0; a < t.length; a++) {
1819
+ m({
1820
+ current: a + 1,
1821
+ total: i
1822
+ });
1823
+ let o = t[a];
1824
+ try {
1825
+ let t = await y.mutateAsync({
1826
+ project_id: d,
1827
+ container: o.name
1828
+ });
1829
+ n += t, e++;
1830
+ } catch (e) {
1831
+ let t = e instanceof Error ? e.message : String(e);
1832
+ r.push(`${o.name}: ${t}`);
1833
+ }
1834
+ }
1835
+ e > 0 && await v.storage.swift.listContainers.invalidate(), o?.({
1836
+ emptiedCount: e,
1837
+ totalDeleted: n,
1838
+ errors: r
1839
+ }), b();
1840
+ };
1841
+ if (!e || t.length === 0) return null;
1842
+ let S = t.length, T = t.slice(0, Ie), E = S - T.length, D = y.isPending || p !== null, k = p?.current, A = p?.total;
1843
+ return /*#__PURE__*/ z(w, {
1844
+ title: /*#__PURE__*/ z(W, {
1845
+ id: "0efWir",
1846
+ values: { totalCount: S }
1847
+ }),
1848
+ open: e,
1849
+ onCancel: b,
1850
+ confirmButtonLabel: D ? c._({ id: "s4Vnq2" }) : c._({ id: "N2S1rs" }),
1851
+ confirmButtonVariant: "primary-danger",
1852
+ cancelButtonLabel: c._({ id: "dEgA5A" }),
1853
+ onConfirm: x,
1854
+ disableConfirmButton: D || !_,
1855
+ disableCancelButton: D,
1856
+ disableCloseButton: D,
1857
+ size: "small",
1858
+ children: D ? /*#__PURE__*/ B(O, {
1859
+ direction: "vertical",
1860
+ distribution: "center",
1861
+ alignment: "center",
1862
+ gap: "2",
1863
+ className: "py-4",
1864
+ children: [/*#__PURE__*/ z(s, { variant: "primary" }), p && /*#__PURE__*/ z("p", {
1865
+ className: "text-theme-light text-sm",
1866
+ children: /*#__PURE__*/ z(W, {
1867
+ id: "7NSdfG",
1868
+ values: {
1869
+ progressCurrent: k,
1870
+ progressTotal: A
1871
+ }
1872
+ })
1873
+ })]
1874
+ }) : /*#__PURE__*/ B("div", {
1875
+ className: "my-6",
1876
+ children: [
1877
+ /*#__PURE__*/ z(n, {
1878
+ variant: "danger",
1879
+ className: "mb-6",
1880
+ children: /*#__PURE__*/ z(W, { id: "JuOpPY" })
1881
+ }),
1882
+ /*#__PURE__*/ z("p", {
1883
+ className: "text-theme-default mb-6 text-sm",
1884
+ children: /*#__PURE__*/ z(W, {
1885
+ id: "XXjbEV",
1886
+ components: {
1887
+ 0: /*#__PURE__*/ z("strong", {}),
1888
+ 1: /*#__PURE__*/ z("strong", {})
1889
+ }
1890
+ })
1891
+ }),
1892
+ /*#__PURE__*/ B("div", {
1893
+ className: "mb-6",
1894
+ children: [/*#__PURE__*/ z("h3", {
1895
+ className: "jn:text-theme-high mb-3 font-semibold",
1896
+ children: /*#__PURE__*/ z(W, {
1897
+ id: "VKmlZ+",
1898
+ values: { totalCount: S }
1899
+ })
1900
+ }), /*#__PURE__*/ B("div", {
1901
+ className: "jn:bg-theme-background-lvl-1 max-h-48 overflow-y-auto rounded p-4",
1902
+ children: [/*#__PURE__*/ z(a, {
1903
+ className: "grid-cols-2",
1904
+ alignTerms: "left",
1905
+ children: T.map((e) => {
1906
+ let t = e.count;
1907
+ return /*#__PURE__*/ B(ne, { children: [/*#__PURE__*/ z(C, {
1908
+ className: "col-span-1",
1909
+ children: /*#__PURE__*/ z("span", {
1910
+ className: "block truncate",
1911
+ title: e.name,
1912
+ children: e.name
1913
+ })
1914
+ }), /*#__PURE__*/ z(r, {
1915
+ className: "col-span-1",
1916
+ children: /*#__PURE__*/ z("span", {
1917
+ className: "whitespace-nowrap",
1918
+ children: t == null ? "" : l._(c._({
1919
+ id: "7Ocn0b",
1920
+ values: { count: t }
1921
+ }))
1922
+ })
1923
+ })] }, e.name);
1924
+ })
1925
+ }), E > 0 && /*#__PURE__*/ z("p", {
1926
+ className: "text-theme-light mt-2 text-xs",
1927
+ children: /*#__PURE__*/ z(W, {
1928
+ id: "yqPflB",
1929
+ values: { hiddenCount: E }
1930
+ })
1931
+ })]
1932
+ })]
1933
+ }),
1934
+ /*#__PURE__*/ z(f, {
1935
+ label: c._({ id: "Ghp863" }),
1936
+ placeholder: Le,
1937
+ value: h,
1938
+ onChange: (e) => g(e.target.value)
1939
+ })
1940
+ ]
1941
+ })
1942
+ });
1943
+ }, ze = () => {
1944
+ let { i18n: e, i18n: n, _: r } = G(), i = I(), a = U({ from: N.fullPath }), { sortBy: o, sortDirection: c, search: l = "" } = N.useSearch(), [u, d] = H(!1), [f, g] = H(!1), [_, v] = H([]), [y, S] = H(null), [C, w] = H(l), E = ae(void 0);
1945
+ ie(() => () => clearTimeout(E.current), []), ie(() => {
1946
+ w(l);
1947
+ }, [l]);
1948
+ let k = () => S(null), A = (e) => {
1949
+ S(Se(e, { onDismiss: k }));
1950
+ }, P = (e, t) => {
1951
+ S(Ce(e, t, { onDismiss: k }));
1952
+ }, te = (e, t) => {
1953
+ S(we(e, t, { onDismiss: k }));
1954
+ }, L = (e, t) => {
1955
+ S(Te(e, t, { onDismiss: k }));
1956
+ }, ne = (e) => {
1957
+ S(Ee(e, { onDismiss: k }));
1958
+ }, V = (e, t) => {
1959
+ S(De(e, t, { onDismiss: k }));
1960
+ }, oe = (e) => {
1961
+ S(Oe(e, { onDismiss: k }));
1962
+ }, K = (e, t) => {
1963
+ S(ke(e, t, { onDismiss: k }));
1964
+ }, se = (e) => {
1965
+ S(Ae(e, { onDismiss: k }));
1966
+ }, q = (e, t) => {
1967
+ S(je(e, t, { onDismiss: k }));
1968
+ }, ce = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
1969
+ if (n.length === 0) v([]);
1970
+ else {
1971
+ let e = new Set(n.map((e) => e.split(": ")[0]));
1972
+ v((t) => t.filter((t) => e.has(t)));
1973
+ }
1974
+ S(Me(e, t, n, { onDismiss: k }));
1975
+ }, J = {
1976
+ options: [
1977
+ {
1978
+ label: e._({ id: "6YtxFj" }),
1979
+ value: "name"
1980
+ },
1981
+ {
1982
+ label: e._({ id: "sxbP3b" }),
1983
+ value: "count"
1984
+ },
1985
+ {
1986
+ label: e._({ id: "hgpMHD" }),
1987
+ value: "bytes"
1988
+ },
1989
+ {
1990
+ label: e._({ id: "sjMCOP" }),
1991
+ value: "last_modified"
1992
+ }
1993
+ ],
1994
+ sortBy: o ?? "name",
1995
+ sortDirection: c ?? "asc"
1996
+ }, { data: le, isLoading: ue, error: de } = M.storage.swift.listContainers.useQuery({
1997
+ project_id: i,
1998
+ format: "json"
1999
+ }), { data: fe } = M.storage.swift.getAccountMetadata.useQuery({ project_id: i }), { data: Y } = M.storage.swift.getServiceInfo.useQuery(), pe = (e) => [...e].sort((e, t) => {
2000
+ let n;
2001
+ switch (o ?? "name") {
2002
+ case "name":
2003
+ n = e.name.localeCompare(t.name);
2004
+ break;
2005
+ case "count":
2006
+ n = e.count - t.count;
2007
+ break;
2008
+ case "bytes":
2009
+ n = e.bytes - t.bytes;
2010
+ break;
2011
+ case "last_modified":
2012
+ if (!e.last_modified || !t.last_modified) return e.last_modified ? -1 : 1;
2013
+ n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
2014
+ break;
2015
+ default: n = e.name.localeCompare(t.name);
2016
+ }
2017
+ return (c ?? "asc") === "desc" ? -n : n;
2018
+ }), me = (le || []).filter((e) => e.name.toLowerCase().includes(l.toLowerCase())), he = pe(me), ge = (e) => {
2019
+ let t = typeof e == "string" ? e : "";
2020
+ re(() => {
2021
+ a({ search: (e) => ({
2022
+ ...e,
2023
+ search: t || void 0
2024
+ }) });
2025
+ });
2026
+ }, _e = (e) => {
2027
+ let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2028
+ re(() => {
2029
+ a({ search: (e) => ({
2030
+ ...e,
2031
+ sortBy: t,
2032
+ sortDirection: n
2033
+ }) });
2034
+ });
2035
+ };
2036
+ if (ue) return /*#__PURE__*/ B(O, {
2037
+ className: "absolute inset-0",
2038
+ distribution: "center",
2039
+ alignment: "center",
2040
+ direction: "vertical",
2041
+ children: [/*#__PURE__*/ z(s, {
2042
+ variant: "primary",
2043
+ size: "large",
2044
+ className: "mb-2"
2045
+ }), /*#__PURE__*/ z(W, { id: "WYiUDa" })]
2046
+ });
2047
+ if (de) {
2048
+ let e = de.message;
2049
+ return /*#__PURE__*/ z(O, {
2050
+ className: "absolute inset-0",
2051
+ distribution: "center",
2052
+ alignment: "center",
2053
+ direction: "vertical",
2054
+ children: /*#__PURE__*/ z(W, {
2055
+ id: "dLFiER",
2056
+ values: { errorMessage: e }
2057
+ })
2058
+ });
2059
+ }
2060
+ let ve = fe?.bytesUsed || 0, ye = fe?.quotaBytes || 0, X = ye > 0 ? ye - ve : 0, Z = (le || []).filter((e) => _.includes(e.name)), be = Z.length > 0, Q = Z.length, $ = (le || []).length, Ne = me.length, Pe = Ne !== $, Ie = he.map((e) => e.name), Le = Ie.length > 0 && Ie.every((e) => _.includes(e)), ze = Ie.some((e) => _.includes(e));
2061
+ return /*#__PURE__*/ B("div", {
2062
+ className: "relative",
2063
+ children: [
2064
+ /*#__PURE__*/ B(O, {
2065
+ direction: "vertical",
2066
+ children: [
2067
+ /*#__PURE__*/ B(O, {
2068
+ distribution: "end",
2069
+ alignment: "center",
2070
+ gap: "2",
2071
+ className: "pb-2",
2072
+ children: [/*#__PURE__*/ z(O, {
2073
+ gap: "0.5",
2074
+ alignment: "center",
2075
+ children: /*#__PURE__*/ z(ee, {
2076
+ options: J.options,
2077
+ sortBy: J.sortBy,
2078
+ sortDirection: J.sortDirection ?? "asc",
2079
+ onSortByChange: (e) => _e({
2080
+ ...J,
2081
+ sortBy: e,
2082
+ sortDirection: J.sortDirection
2083
+ }),
2084
+ onSortDirectionChange: (e) => _e({
2085
+ ...J,
2086
+ sortDirection: e
2087
+ })
2088
+ })
2089
+ }), /*#__PURE__*/ z(j, {
2090
+ variant: "primary",
2091
+ className: "whitespace-nowrap",
2092
+ onClick: () => d(!0),
2093
+ children: /*#__PURE__*/ z(W, { id: "vTh35P" })
2094
+ })]
2095
+ }),
2096
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(O, {
2097
+ direction: "vertical",
2098
+ gap: "2",
2099
+ children: /*#__PURE__*/ z(O, {
2100
+ distribution: "end",
2101
+ alignment: "center",
2102
+ children: /*#__PURE__*/ z(x, {
2103
+ placeholder: e._({ id: "TipzDp" }),
2104
+ "data-testid": "searchbar",
2105
+ value: C,
2106
+ onInput: (e) => {
2107
+ let t = e.currentTarget.value;
2108
+ w(t), clearTimeout(E.current), E.current = window.setTimeout(() => ge(t), 500);
2109
+ },
2110
+ onSearch: (e) => {
2111
+ clearTimeout(E.current), ge(typeof e == "string" ? e : "");
2112
+ },
2113
+ onClear: () => {
2114
+ clearTimeout(E.current), w(""), ge("");
2115
+ }
2116
+ })
2117
+ })
2118
+ }) }),
2119
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ B(O, {
2120
+ distribution: "start",
2121
+ gap: "2",
2122
+ alignment: "center",
2123
+ className: "text-sm",
2124
+ children: [/*#__PURE__*/ B(O, {
2125
+ gap: "2",
2126
+ alignment: "center",
2127
+ children: [/*#__PURE__*/ z(b, {
2128
+ checked: Le,
2129
+ indeterminate: ze && !Le,
2130
+ onChange: () => {
2131
+ v(Le ? (e) => e.filter((e) => !Ie.includes(e)) : (e) => [...new Set([...e, ...Ie])]);
2132
+ }
2133
+ }), /*#__PURE__*/ B(T, {
2134
+ className: "flex items-center",
2135
+ children: [/*#__PURE__*/ z(D, {
2136
+ as: "div",
2137
+ children: /*#__PURE__*/ z(j, {
2138
+ disabled: !be,
2139
+ size: "small",
2140
+ icon: "moreVert",
2141
+ label: e._({ id: "7L01XJ" })
2142
+ })
2143
+ }), be && /*#__PURE__*/ z(t, { children: /*#__PURE__*/ z(m, {
2144
+ disabled: !be,
2145
+ label: n._(e._({
2146
+ id: "0Th0CH",
2147
+ values: { selectedCount: Q }
2148
+ })),
2149
+ onClick: () => g(!0)
2150
+ }) })]
2151
+ })]
2152
+ }), /*#__PURE__*/ B("div", {
2153
+ className: "text-theme-light flex items-center gap-1",
2154
+ "data-testid": "containers-info-block",
2155
+ children: [
2156
+ Pe ? /*#__PURE__*/ z(W, {
2157
+ id: "8uPTwT",
2158
+ values: {
2159
+ filteredCount: Ne,
2160
+ totalCount: $
2161
+ }
2162
+ }) : /*#__PURE__*/ z(W, {
2163
+ id: "ywe1H/",
2164
+ values: { totalCount: $ }
2165
+ }),
2166
+ ye > 0 && /*#__PURE__*/ B(R, { children: [/*#__PURE__*/ z("span", { children: "," }), /*#__PURE__*/ B("span", { children: [
2167
+ /*#__PURE__*/ z(W, { id: "kKK8AH" }),
2168
+ " ",
2169
+ /*#__PURE__*/ z("span", {
2170
+ className: "text-theme-default font-semibold",
2171
+ children: F(X)
2172
+ })
2173
+ ] })] }),
2174
+ /*#__PURE__*/ z(Fe, {
2175
+ serviceInfo: Y,
2176
+ accountInfo: fe
2177
+ })
2178
+ ]
2179
+ })]
2180
+ }) })
2181
+ ]
2182
+ }),
2183
+ /*#__PURE__*/ z(xe, {
2184
+ containers: he,
2185
+ createModalOpen: u,
2186
+ setCreateModalOpen: d,
2187
+ maxContainerNameLength: Y?.swift?.max_container_name_length,
2188
+ onCreateSuccess: A,
2189
+ onCreateError: P,
2190
+ onEmptySuccess: te,
2191
+ onEmptyError: L,
2192
+ onDeleteSuccess: ne,
2193
+ onDeleteError: V,
2194
+ onPropertiesSuccess: oe,
2195
+ onPropertiesError: K,
2196
+ onAclSuccess: se,
2197
+ onAclError: q,
2198
+ selectedContainers: _,
2199
+ setSelectedContainers: v,
2200
+ hasAnyBulkAction: !0
2201
+ }),
2202
+ /*#__PURE__*/ z(Re, {
2203
+ isOpen: f,
2204
+ containers: Z,
2205
+ onClose: () => g(!1),
2206
+ onComplete: ce
2207
+ }),
2208
+ y && /*#__PURE__*/ z(p, {
2209
+ ...y,
2210
+ className: "border-theme-light fixed top-5 right-5 z-50 rounded-lg border shadow-lg"
2211
+ })
2212
+ ]
2213
+ });
2214
+ }, Be = /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/, Ve = /^(\d{1,3}\.){3}\d{1,3}$/, He = [
2215
+ "xn--",
2216
+ "sthree-",
2217
+ "amzn-s3-demo-"
2218
+ ], Ue = [
2219
+ "-s3alias",
2220
+ "--ol-s3",
2221
+ ".mrap",
2222
+ "--x-s3",
2223
+ "--table-s3"
2224
+ ], We = ({ isOpen: e, onClose: t, onSuccess: n, onError: r }) => {
2225
+ let { i18n: i, _: a } = G(), o = I(), [s, c] = H(""), [l, u] = H(null), [d, p] = H(!1), m = M.useUtils(), h = M.storage.ceph.containers.create.useMutation({
2226
+ onSuccess: () => {
2227
+ m.storage.ceph.containers.list.invalidate();
2228
+ let e = s.trim();
2229
+ n?.(e);
2230
+ },
2231
+ onError: (e) => {
2232
+ r?.(s.trim(), e.message);
2233
+ },
2234
+ onSettled: () => {
2235
+ g();
2236
+ }
2237
+ }), g = () => {
2238
+ c(""), u(null), p(!1), h.reset(), t();
2239
+ }, _ = (e) => {
2240
+ let t = e.trim();
2241
+ if (!t) return u(i._({ id: "48bMai" })), !1;
2242
+ if (t.length < 3) return u(i._({ id: "gjop1H" })), !1;
2243
+ if (t.length > 63) return u(i._({ id: "is0Bhk" })), !1;
2244
+ if (!Be.test(t)) return u(i._({ id: "IQldU4" })), !1;
2245
+ if (!/^[a-z0-9]/.test(t) || !/[a-z0-9]$/.test(t)) return u(i._({ id: "VG2a+x" })), !1;
2246
+ if (t.includes("..")) return u(i._({ id: "V8/eES" })), !1;
2247
+ if (Ve.test(t)) return u(i._({ id: "W8Rb/w" })), !1;
2248
+ for (let e of He) if (t.startsWith(e)) return u(i._({
2249
+ id: "B2SpR8",
2250
+ values: { prefix: e }
2251
+ })), !1;
2252
+ for (let e of Ue) if (t.endsWith(e)) return u(i._({
2253
+ id: "QRlXaL",
2254
+ values: { suffix: e }
2255
+ })), !1;
2256
+ return u(null), !0;
2257
+ }, v = (e) => {
2258
+ let t = e.target.value;
2259
+ c(t), l && _(t);
2260
+ }, y = () => {
2261
+ _(s) && h.mutate({
2262
+ project_id: o,
2263
+ bucketName: s.trim(),
2264
+ enableVersioning: d
2265
+ });
2266
+ };
2267
+ return e ? /*#__PURE__*/ z(w, {
2268
+ title: i._({ id: "HiDAFk" }),
2269
+ open: e,
2270
+ onCancel: g,
2271
+ confirmButtonLabel: i._({ id: "hYgDIe" }),
2272
+ onConfirm: y,
2273
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
2274
+ size: "small",
2275
+ disableConfirmButton: h.isPending || !s.trim(),
2276
+ children: /*#__PURE__*/ B(O, {
2277
+ direction: "vertical",
2278
+ gap: "6",
2279
+ children: [
2280
+ /*#__PURE__*/ z("p", {
2281
+ className: "text-theme-default",
2282
+ children: /*#__PURE__*/ z(W, { id: "ASJMIw" })
2283
+ }),
2284
+ /*#__PURE__*/ z(f, {
2285
+ label: i._({ id: "NNpgo3" }),
2286
+ required: !0,
2287
+ value: s,
2288
+ onChange: v,
2289
+ onKeyDown: (e) => {
2290
+ e.key === "Enter" && y();
2291
+ },
2292
+ invalid: !!l,
2293
+ errortext: l || void 0,
2294
+ disabled: h.isPending,
2295
+ autoFocus: !0,
2296
+ placeholder: i._({ id: "yDHGP+" })
2297
+ }),
2298
+ /*#__PURE__*/ z(b, {
2299
+ label: i._({ id: "ifQSTI" }),
2300
+ helptext: i._({ id: "WM+Nm7" }),
2301
+ checked: d,
2302
+ onChange: (e) => p(e.target.checked),
2303
+ disabled: h.isPending
2304
+ })
2305
+ ]
2306
+ })
2307
+ }) : null;
2308
+ }, Ge = ({ buckets: e, createModalOpen: n, setCreateModalOpen: r, onCreateSuccess: a, onCreateError: s, onEmptySuccess: c, onEmptyError: l, onDeleteSuccess: f, onDeleteError: p, selectedBuckets: h, setSelectedBuckets: g, hasAnyBulkAction: _ = !0 }) => {
2309
+ let { projectId: v, provider: y, storageType: x } = oe({ strict: !1 }), { i18n: S, _: C } = G(), w = U(), E = ae(null), [D, O] = H(0), [k, A] = H(null), [j, M] = H(null);
2310
+ ie(() => {
2311
+ E.current && O(E.current.offsetWidth - E.current.clientWidth);
2312
+ }, [e.length]);
2313
+ let N = (e) => {
2314
+ try {
2315
+ return new Date(e).toLocaleString();
2316
+ } catch {
2317
+ return S._({ id: "fj5byd" });
2318
+ }
2319
+ }, P = q({
2320
+ count: e.length,
2321
+ getScrollElement: () => E.current,
2322
+ estimateSize: () => 48,
2323
+ overscan: 10
2324
+ }), ee = (e) => {
2325
+ h.includes(e) ? g(h.filter((t) => t !== e)) : g([...h, e]);
2326
+ };
2327
+ if (!e || e.length === 0) return /*#__PURE__*/ z(u, {
2328
+ columns: 4,
2329
+ className: "buckets",
2330
+ "data-testid": "no-buckets",
2331
+ children: /*#__PURE__*/ z(i, { children: /*#__PURE__*/ z(o, {
2332
+ colSpan: 4,
2333
+ children: /*#__PURE__*/ B("div", {
2334
+ className: "py-8 text-center",
2335
+ children: [/*#__PURE__*/ z("h3", {
2336
+ className: "text-lg font-semibold",
2337
+ children: /*#__PURE__*/ z(W, { id: "ih2lfP" })
2338
+ }), /*#__PURE__*/ z("p", {
2339
+ className: "text-theme-light mt-2",
2340
+ children: /*#__PURE__*/ z(W, { id: "emkxJa" })
2341
+ })]
2342
+ })
2343
+ }) })
2344
+ });
2345
+ let I = _ ? 6 : 5, ne = _ ? "40px minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px" : "minmax(200px, 2fr) minmax(100px, 1fr) minmax(180px, 2fr) minmax(100px, 1fr) 60px";
2346
+ return /*#__PURE__*/ B(R, { children: [
2347
+ /*#__PURE__*/ B("div", {
2348
+ className: "relative",
2349
+ children: [/*#__PURE__*/ z("div", {
2350
+ style: { paddingRight: `${D}px` },
2351
+ children: /*#__PURE__*/ z(u, {
2352
+ columns: I,
2353
+ gridColumnTemplate: ne,
2354
+ className: "buckets",
2355
+ "data-testid": "buckets-table-header",
2356
+ children: /*#__PURE__*/ B(i, { children: [
2357
+ _ && /*#__PURE__*/ z(d, {}),
2358
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "BTsbBe" }) }),
2359
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "sxbP3b" }) }),
2360
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "sjMCOP" }) }),
2361
+ /*#__PURE__*/ z(d, { children: /*#__PURE__*/ z(W, { id: "hgpMHD" }) }),
2362
+ /*#__PURE__*/ z(d, { style: { marginRight: `-${D}px` } })
2363
+ ] })
2364
+ })
2365
+ }), /*#__PURE__*/ z("div", {
2366
+ ref: E,
2367
+ className: "overflow-auto",
2368
+ style: { height: "calc(100vh - 490px)" },
2369
+ "data-testid": "buckets-table-body",
2370
+ children: /*#__PURE__*/ z("div", {
2371
+ style: {
2372
+ height: `${P.getTotalSize()}px`,
2373
+ width: "100%",
2374
+ position: "relative"
2375
+ },
2376
+ children: P.getVirtualItems().map((n) => {
2377
+ let r = e[n.index], i = h.includes(r.name), a = () => w({
2378
+ to: "/projects/$projectId/storage/$provider/$storageType/$containerName/objects",
2379
+ params: {
2380
+ projectId: v ?? "",
2381
+ provider: y ?? "ceph",
2382
+ storageType: x ?? "buckets",
2383
+ containerName: r.name
2384
+ }
2385
+ });
2386
+ return /*#__PURE__*/ B("div", {
2387
+ "data-index": n.index,
2388
+ ref: P.measureElement,
2389
+ className: "juno-datagrid group hover:bg-theme-background-lvl-1 cursor-pointer",
2390
+ style: {
2391
+ position: "absolute",
2392
+ top: 0,
2393
+ left: 0,
2394
+ width: "100%",
2395
+ transform: `translateY(${n.start}px)`,
2396
+ display: "grid",
2397
+ gridTemplateColumns: ne,
2398
+ alignItems: "stretch"
2399
+ },
2400
+ "data-testid": `bucket-row-${r.name}`,
2401
+ role: "link",
2402
+ tabIndex: 0,
2403
+ onClick: a,
2404
+ onKeyDown: (e) => {
2405
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), a());
2406
+ },
2407
+ children: [
2408
+ _ && /*#__PURE__*/ z(o, {
2409
+ onClick: (e) => e.stopPropagation(),
2410
+ onKeyDown: (e) => {
2411
+ (e.key === "Enter" || e.key === " ") && e.stopPropagation();
2412
+ },
2413
+ children: /*#__PURE__*/ z(b, {
2414
+ checked: i,
2415
+ onChange: () => ee(r.name),
2416
+ "data-testid": `select-bucket-${r.name}`
2417
+ })
2418
+ }),
2419
+ /*#__PURE__*/ z(o, {
2420
+ className: "min-w-0 overflow-hidden",
2421
+ children: /*#__PURE__*/ z("span", {
2422
+ className: "block truncate",
2423
+ title: r.name,
2424
+ children: r.name
2425
+ })
2426
+ }),
2427
+ /*#__PURE__*/ z(o, { children: r.count.toLocaleString() }),
2428
+ /*#__PURE__*/ z(o, { children: N(r.last_modified || r.creationDate || "") }),
2429
+ /*#__PURE__*/ z(o, { children: F(r.bytes) }),
2430
+ /*#__PURE__*/ z(o, {
2431
+ onClick: (e) => e.stopPropagation(),
2432
+ children: /*#__PURE__*/ z(T, { children: /*#__PURE__*/ B(t, { children: [
2433
+ /*#__PURE__*/ z(m, {
2434
+ label: S._({ id: "v0hPHE" }),
2435
+ onClick: a,
2436
+ "data-testid": `show-details-action-${r.name}`
2437
+ }),
2438
+ /*#__PURE__*/ z(m, {
2439
+ label: S._({ id: "N2S1rs" }),
2440
+ onClick: () => A(r),
2441
+ "data-testid": `empty-action-${r.name}`
2442
+ }),
2443
+ /*#__PURE__*/ z(m, {
2444
+ label: S._({ id: "cnGeoo" }),
2445
+ onClick: () => M(r),
2446
+ "data-testid": `delete-action-${r.name}`
2447
+ })
2448
+ ] }) })
2449
+ })
2450
+ ]
2451
+ }, r.name);
2452
+ })
2453
+ })
2454
+ })]
2455
+ }),
2456
+ /*#__PURE__*/ z(We, {
2457
+ isOpen: n,
2458
+ onClose: () => r(!1),
2459
+ onSuccess: a,
2460
+ onError: s
2461
+ }),
2462
+ /*#__PURE__*/ z(L, {
2463
+ isOpen: k !== null,
2464
+ bucket: k,
2465
+ onClose: () => A(null),
2466
+ onSuccess: c,
2467
+ onError: l
2468
+ }),
2469
+ /*#__PURE__*/ z(te, {
2470
+ isOpen: j !== null,
2471
+ bucket: j,
2472
+ onClose: () => M(null),
2473
+ onSuccess: f,
2474
+ onError: p
2475
+ })
2476
+ ] });
2477
+ }, Ke = (e) => ({
2478
+ message: /*#__PURE__*/ z(W, { id: "M3bysB" }),
2479
+ description: /*#__PURE__*/ z(W, {
2480
+ id: "VKCkZH",
2481
+ values: { bucketName: e }
2482
+ })
2483
+ }), qe = (e, t) => ({
2484
+ message: /*#__PURE__*/ z(W, { id: "UaP7Th" }),
2485
+ description: /*#__PURE__*/ z(W, {
2486
+ id: "boefwq",
2487
+ values: {
2488
+ bucketName: e,
2489
+ errorMessage: t
2490
+ }
2491
+ })
2492
+ }), Je = (e, t) => ({
2493
+ message: /*#__PURE__*/ z(W, { id: "b95YH9" }),
2494
+ description: t === 0 ? /*#__PURE__*/ z(W, {
2495
+ id: "8erw15",
2496
+ values: { bucketName: e }
2497
+ }) : t === 1 ? /*#__PURE__*/ z(W, {
2498
+ id: "QpbWpf",
2499
+ values: {
2500
+ bucketName: e,
2501
+ deletedCount: t
2502
+ }
2503
+ }) : /*#__PURE__*/ z(W, {
2504
+ id: "JPWqr2",
2505
+ values: {
2506
+ bucketName: e,
2507
+ deletedCount: t
2508
+ }
2509
+ })
2510
+ }), Ye = (e, t) => ({
2511
+ message: /*#__PURE__*/ z(W, { id: "66YUKF" }),
2512
+ description: /*#__PURE__*/ z(W, {
2513
+ id: "t7ewhH",
2514
+ values: {
2515
+ bucketName: e,
2516
+ errorMessage: t
2517
+ }
2518
+ })
2519
+ }), Xe = (e) => ({
2520
+ message: /*#__PURE__*/ z(W, { id: "bHUarC" }),
2521
+ description: /*#__PURE__*/ z(W, {
2522
+ id: "hQdfmR",
2523
+ values: { bucketName: e }
2524
+ })
2525
+ }), Ze = (e, t) => ({
2526
+ message: /*#__PURE__*/ z(W, { id: "1NFtQz" }),
2527
+ description: /*#__PURE__*/ z(W, {
2528
+ id: "CongmL",
2529
+ values: {
2530
+ bucketName: e,
2531
+ errorMessage: t
2532
+ }
2533
+ })
2534
+ }), Qe = (e, t, n) => {
2535
+ let r = n.length > 0, i = e + n.length, a = n.length;
2536
+ return {
2537
+ message: r ? /*#__PURE__*/ z(W, { id: "6fuDFZ" }) : /*#__PURE__*/ z(W, { id: "BOoOLQ" }),
2538
+ description: r ? /*#__PURE__*/ z(W, {
2539
+ id: "pD/2BQ",
2540
+ values: {
2541
+ emptiedCount: e,
2542
+ totalBuckets: i,
2543
+ totalDeleted: t,
2544
+ errorsLength: a
2545
+ }
2546
+ }) : /*#__PURE__*/ z(W, {
2547
+ id: "YVLcyI",
2548
+ values: {
2549
+ emptiedCount: e,
2550
+ totalDeleted: t
2551
+ }
2552
+ })
2553
+ };
2554
+ }, $e = 20, et = ({ isOpen: e, buckets: t, onClose: n, onComplete: r }) => {
2555
+ let { i18n: i, _: a } = G(), o = I(), [c, l] = H(null), [u, d] = H(""), p = M.useUtils(), m = M.storage.ceph.objects.deleteAll.useMutation(), h = () => {
2556
+ m.reset(), l(null), d(""), n();
2557
+ }, g = async () => {
2558
+ let e = 0, n = 0, i = [], a = t.length;
2559
+ for (let r = 0; r < t.length; r++) {
2560
+ l({
2561
+ current: r + 1,
2562
+ total: a
2563
+ });
2564
+ let s = t[r];
2565
+ try {
2566
+ let t = await m.mutateAsync({
2567
+ project_id: o,
2568
+ containerName: s.name
2569
+ });
2570
+ n += t, e++;
2571
+ } catch (e) {
2572
+ let t = e instanceof Error ? e.message : String(e);
2573
+ i.push(`${s.name}: ${t}`);
2574
+ }
2575
+ }
2576
+ e > 0 && await p.storage.ceph.containers.list.invalidate(), r?.({
2577
+ emptiedCount: e,
2578
+ totalDeleted: n,
2579
+ errors: i
2580
+ }), h();
2581
+ };
2582
+ if (!e || t.length === 0) return null;
2583
+ let _ = t.length, v = t.slice(0, $e), y = _ - v.length, b = m.isPending || c !== null, x = c?.current, S = c?.total, C = u === "empty";
2584
+ return /*#__PURE__*/ z(w, {
2585
+ title: /*#__PURE__*/ z(W, {
2586
+ id: "DWBWmW",
2587
+ values: { totalCount: _ }
2588
+ }),
2589
+ open: e,
2590
+ onCancel: h,
2591
+ confirmButtonLabel: b ? i._({ id: "s4Vnq2" }) : i._({ id: "N2S1rs" }),
2592
+ confirmButtonVariant: "primary-danger",
2593
+ cancelButtonLabel: i._({ id: "dEgA5A" }),
2594
+ onConfirm: g,
2595
+ disableConfirmButton: b || !C,
2596
+ disableCancelButton: b,
2597
+ disableCloseButton: b,
2598
+ size: "small",
2599
+ children: b ? /*#__PURE__*/ B(O, {
2600
+ direction: "vertical",
2601
+ distribution: "center",
2602
+ alignment: "center",
2603
+ gap: "2",
2604
+ className: "py-4",
2605
+ children: [/*#__PURE__*/ z(s, { variant: "primary" }), c && /*#__PURE__*/ z("p", {
2606
+ className: "text-theme-light text-sm",
2607
+ children: /*#__PURE__*/ z(W, {
2608
+ id: "NW1XEL",
2609
+ values: {
2610
+ progressCurrent: x,
2611
+ progressTotal: S
2612
+ }
2613
+ })
2614
+ })]
2615
+ }) : /*#__PURE__*/ B(O, {
2616
+ direction: "vertical",
2617
+ gap: "4",
2618
+ children: [
2619
+ /*#__PURE__*/ z(W, {
2620
+ id: "CtiFDz",
2621
+ values: { totalCount: _ }
2622
+ }),
2623
+ /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z("p", {
2624
+ className: "text-theme-light mb-2 text-sm",
2625
+ children: /*#__PURE__*/ z(W, { id: "Zshv0H" })
2626
+ }), /*#__PURE__*/ B("ul", {
2627
+ className: "list-inside list-disc space-y-1 text-sm",
2628
+ children: [v.map((e) => {
2629
+ let t = e.name, n = e.count;
2630
+ return /*#__PURE__*/ B("li", { children: [t, n > 0 && /*#__PURE__*/ B("span", {
2631
+ className: "text-theme-light ml-2",
2632
+ children: [
2633
+ "(",
2634
+ n,
2635
+ " ",
2636
+ /*#__PURE__*/ z(W, {
2637
+ id: "gFsjJK",
2638
+ values: { bucketCount: n }
2639
+ }),
2640
+ ")"
2641
+ ]
2642
+ })] }, t);
2643
+ }), y > 0 && /*#__PURE__*/ z("li", {
2644
+ className: "text-theme-light",
2645
+ children: /*#__PURE__*/ z(W, {
2646
+ id: "yqPflB",
2647
+ values: { hiddenCount: y }
2648
+ })
2649
+ })]
2650
+ })] }),
2651
+ /*#__PURE__*/ z(f, {
2652
+ label: i._({ id: "Ghp863" }),
2653
+ value: u,
2654
+ onChange: (e) => d(e.target.value),
2655
+ placeholder: "empty",
2656
+ autoFocus: !0
2657
+ })
2658
+ ]
2659
+ })
2660
+ });
2661
+ };
2662
+ //#endregion
2663
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Buckets/CredentialPrompt.tsx
2664
+ function tt({ onSuccess: e }) {
2665
+ let t = I(), n = M.useUtils(), r = M.storage.ceph.ec2Credentials.create.useMutation({
2666
+ onSuccess: () => {
2667
+ n.storage.ceph.ec2Credentials.list.invalidate(), e();
2668
+ },
2669
+ onError: (e) => {
2670
+ let t = e.message;
2671
+ l.error(/*#__PURE__*/ z(W, {
2672
+ id: "rcBt6T",
2673
+ values: { errorMessage: t }
2674
+ }));
2675
+ }
2676
+ });
2677
+ return /*#__PURE__*/ B(O, {
2678
+ direction: "vertical",
2679
+ gap: "4",
2680
+ className: "mt-8 max-w-lg",
2681
+ children: [
2682
+ /*#__PURE__*/ z("h2", {
2683
+ className: "text-lg font-semibold",
2684
+ children: /*#__PURE__*/ z(W, { id: "wXxPjv" })
2685
+ }),
2686
+ /*#__PURE__*/ z("p", {
2687
+ className: "text-theme-default",
2688
+ children: /*#__PURE__*/ z(W, { id: "+8m5QE" })
2689
+ }),
2690
+ /*#__PURE__*/ z("p", {
2691
+ className: "text-theme-default text-sm",
2692
+ children: /*#__PURE__*/ z(W, { id: "+1xG4p" })
2693
+ }),
2694
+ /*#__PURE__*/ z("div", { children: /*#__PURE__*/ z(j, {
2695
+ onClick: () => t && r.mutate({ project_id: t }),
2696
+ disabled: r.isPending || !t,
2697
+ children: r.isPending ? /*#__PURE__*/ z(W, { id: "k/zHK7" }) : /*#__PURE__*/ z(W, { id: "FJO48W" })
2698
+ }) })
2699
+ ]
2700
+ });
2701
+ }
2702
+ //#endregion
2703
+ //#region src/client/routes/_auth/projects/$projectId/storage/-components/Ceph/Buckets/index.tsx
2704
+ var nt = () => {
2705
+ let { i18n: e, i18n: n, _: r } = G(), i = I(), a = U({ from: N.fullPath }), { sortBy: o, sortDirection: c, search: u = "" } = N.useSearch(), [d, f] = H(!1), [p, g] = H(!1), [_, v] = H([]), [y, S] = H(u), C = ae(void 0);
2706
+ ie(() => () => clearTimeout(C.current), []), ie(() => {
2707
+ S(u);
2708
+ }, [u]);
2709
+ let w = (e) => {
2710
+ let { message: t, ...n } = Ke(e);
2711
+ l.success(t, n);
2712
+ }, E = (e, t) => {
2713
+ let { message: n, ...r } = qe(e, t);
2714
+ l.error(n, r);
2715
+ }, k = (e, t) => {
2716
+ let { message: n, ...r } = Je(e, t);
2717
+ l.success(n, r);
2718
+ }, A = (e, t) => {
2719
+ let { message: n, ...r } = Ye(e, t);
2720
+ l.error(n, r);
2721
+ }, P = (e) => {
2722
+ let { message: t, ...n } = Xe(e);
2723
+ l.success(t, n);
2724
+ }, F = (e, t) => {
2725
+ let { message: n, ...r } = Ze(e, t);
2726
+ l.error(n, r);
2727
+ }, te = ({ emptiedCount: e, totalDeleted: t, errors: n }) => {
2728
+ if (n.length === 0) v([]);
2729
+ else {
2730
+ let e = new Set(n.map((e) => e.split(": ")[0]));
2731
+ v((t) => t.filter((t) => e.has(t)));
2732
+ }
2733
+ let { message: r, ...i } = Qe(e, t, n);
2734
+ n.length > 0 ? l.warning(r, i) : l.success(r, i);
2735
+ }, L = {
2736
+ options: [
2737
+ {
2738
+ label: e._({ id: "6YtxFj" }),
2739
+ value: "name"
2740
+ },
2741
+ {
2742
+ label: e._({ id: "sxbP3b" }),
2743
+ value: "count"
2744
+ },
2745
+ {
2746
+ label: e._({ id: "hgpMHD" }),
2747
+ value: "bytes"
2748
+ },
2749
+ {
2750
+ label: e._({ id: "sjMCOP" }),
2751
+ value: "last_modified"
2752
+ }
2753
+ ],
2754
+ sortBy: o ?? "name",
2755
+ sortDirection: c ?? "asc"
2756
+ }, { data: R, isLoading: ne, error: V } = M.storage.ceph.containers.list.useQuery({
2757
+ project_id: i,
2758
+ includeMetadata: !0
2759
+ }, {
2760
+ enabled: !!i,
2761
+ retry: !1
2762
+ }), oe = (e) => [...e].sort((e, t) => {
2763
+ let n;
2764
+ switch (o ?? "name") {
2765
+ case "name":
2766
+ n = e.name.localeCompare(t.name);
2767
+ break;
2768
+ case "count":
2769
+ n = e.count - t.count;
2770
+ break;
2771
+ case "bytes":
2772
+ n = e.bytes - t.bytes;
2773
+ break;
2774
+ case "last_modified":
2775
+ if (!e.last_modified && !t.last_modified) return 0;
2776
+ if (!e.last_modified) return 1;
2777
+ if (!t.last_modified) return -1;
2778
+ n = new Date(e.last_modified).getTime() - new Date(t.last_modified).getTime();
2779
+ break;
2780
+ default: n = e.name.localeCompare(t.name);
2781
+ }
2782
+ return (c ?? "asc") === "desc" ? -n : n;
2783
+ }), K = (R || []).filter((e) => e.name.toLowerCase().includes(u.toLowerCase())), se = oe(K), q = (e) => {
2784
+ let t = typeof e == "string" ? e : "";
2785
+ re(() => {
2786
+ a({ search: (e) => ({
2787
+ ...e,
2788
+ search: t || void 0
2789
+ }) });
2790
+ });
2791
+ }, ce = (e) => {
2792
+ let t = e.sortBy?.toString() || "name", n = e.sortDirection || "asc";
2793
+ re(() => {
2794
+ a({ search: (e) => ({
2795
+ ...e,
2796
+ sortBy: t,
2797
+ sortDirection: n
2798
+ }) });
2799
+ });
2800
+ };
2801
+ if (ne) return /*#__PURE__*/ B(O, {
2802
+ className: "absolute inset-0",
2803
+ distribution: "center",
2804
+ alignment: "center",
2805
+ direction: "vertical",
2806
+ children: [/*#__PURE__*/ z(s, {
2807
+ variant: "primary",
2808
+ size: "large",
2809
+ className: "mb-2"
2810
+ }), /*#__PURE__*/ z(W, { id: "c5i+X0" })]
2811
+ });
2812
+ if (V) {
2813
+ let e = V.message;
2814
+ if (e === "NO_CEPH_CREDENTIALS") return /*#__PURE__*/ z(tt, { onSuccess: () => window.location.reload() });
2815
+ let t = e.includes("Access denied") || e.includes("AccessDenied"), n = e.includes("Invalid access key") || e.includes("InvalidAccessKeyId");
2816
+ return /*#__PURE__*/ z("div", { children: /*#__PURE__*/ z("p", {
2817
+ className: "text-theme-default text-sm",
2818
+ children: t ? /*#__PURE__*/ z(W, { id: "HAcOOW" }) : n ? /*#__PURE__*/ z(W, { id: "xIXYTK" }) : /*#__PURE__*/ z(W, {
2819
+ id: "yDAMyU",
2820
+ values: { errorMessage: e }
2821
+ })
2822
+ }) });
2823
+ }
2824
+ let J = (R || []).filter((e) => _.includes(e.name)), le = J.length > 0, ue = J.length, de = (R || []).length, fe = K.length, Y = se.map((e) => e.name), pe = Y.length > 0 && Y.every((e) => _.includes(e)), me = Y.some((e) => _.includes(e));
2825
+ return /*#__PURE__*/ B("div", {
2826
+ className: "relative",
2827
+ children: [
2828
+ /*#__PURE__*/ B(O, {
2829
+ direction: "vertical",
2830
+ children: [
2831
+ /*#__PURE__*/ B(O, {
2832
+ distribution: "end",
2833
+ alignment: "center",
2834
+ gap: "2",
2835
+ className: "pb-2",
2836
+ children: [/*#__PURE__*/ z(O, {
2837
+ gap: "0.5",
2838
+ alignment: "center",
2839
+ children: /*#__PURE__*/ z(ee, {
2840
+ options: L.options,
2841
+ sortBy: L.sortBy,
2842
+ sortDirection: L.sortDirection ?? "asc",
2843
+ selectClassName: "w-40",
2844
+ onSortByChange: (e) => ce({
2845
+ ...L,
2846
+ sortBy: e,
2847
+ sortDirection: L.sortDirection
2848
+ }),
2849
+ onSortDirectionChange: (e) => ce({
2850
+ ...L,
2851
+ sortDirection: e
2852
+ })
2853
+ })
2854
+ }), /*#__PURE__*/ z(j, {
2855
+ variant: "primary",
2856
+ className: "whitespace-nowrap",
2857
+ onClick: () => f(!0),
2858
+ children: /*#__PURE__*/ z(W, { id: "HiDAFk" })
2859
+ })]
2860
+ }),
2861
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ z(O, {
2862
+ direction: "vertical",
2863
+ gap: "2",
2864
+ children: /*#__PURE__*/ z(O, {
2865
+ distribution: "end",
2866
+ alignment: "center",
2867
+ children: /*#__PURE__*/ z(x, {
2868
+ placeholder: e._({ id: "VeDAv2" }),
2869
+ "data-testid": "searchbar",
2870
+ value: y,
2871
+ onInput: (e) => {
2872
+ let t = e.currentTarget.value;
2873
+ S(t), clearTimeout(C.current), C.current = window.setTimeout(() => q(t), 500);
2874
+ },
2875
+ onSearch: (e) => {
2876
+ clearTimeout(C.current), q(typeof e == "string" ? e : "");
2877
+ },
2878
+ onClear: () => {
2879
+ clearTimeout(C.current), S(""), q("");
2880
+ }
2881
+ })
2882
+ })
2883
+ }) }),
2884
+ /*#__PURE__*/ z(h, { children: /*#__PURE__*/ B(O, {
2885
+ distribution: "start",
2886
+ gap: "2",
2887
+ alignment: "center",
2888
+ className: "text-sm",
2889
+ children: [/*#__PURE__*/ B(O, {
2890
+ gap: "2",
2891
+ alignment: "center",
2892
+ children: [/*#__PURE__*/ z(b, {
2893
+ checked: pe,
2894
+ indeterminate: me && !pe,
2895
+ onChange: () => {
2896
+ v(pe ? (e) => e.filter((e) => !Y.includes(e)) : (e) => [...new Set([...e, ...Y])]);
2897
+ }
2898
+ }), /*#__PURE__*/ B(T, {
2899
+ className: "flex items-center",
2900
+ children: [/*#__PURE__*/ z(D, {
2901
+ as: "div",
2902
+ children: /*#__PURE__*/ z(j, {
2903
+ disabled: !le,
2904
+ size: "small",
2905
+ icon: "moreVert",
2906
+ label: e._({ id: "7L01XJ" })
2907
+ })
2908
+ }), le && /*#__PURE__*/ z(t, { children: /*#__PURE__*/ z(m, {
2909
+ disabled: !le,
2910
+ label: n._(e._({
2911
+ id: "P2tWBZ",
2912
+ values: { selectedCount: ue }
2913
+ })),
2914
+ onClick: () => g(!0)
2915
+ }) })]
2916
+ })]
2917
+ }), /*#__PURE__*/ z("div", {
2918
+ className: "text-theme-light flex items-center gap-1",
2919
+ "data-testid": "buckets-info-block",
2920
+ children: u.trim() ? /*#__PURE__*/ z(W, {
2921
+ id: "xOvKAE",
2922
+ values: {
2923
+ totalCount: de,
2924
+ filteredCount: fe
2925
+ }
2926
+ }) : /*#__PURE__*/ z(W, {
2927
+ id: "Ux/pNd",
2928
+ values: { totalCount: de }
2929
+ })
2930
+ })]
2931
+ }) })
2932
+ ]
2933
+ }),
2934
+ /*#__PURE__*/ z(Ge, {
2935
+ buckets: se,
2936
+ createModalOpen: d,
2937
+ setCreateModalOpen: f,
2938
+ onCreateSuccess: w,
2939
+ onCreateError: E,
2940
+ onEmptySuccess: k,
2941
+ onEmptyError: A,
2942
+ onDeleteSuccess: P,
2943
+ onDeleteError: F,
2944
+ selectedBuckets: _,
2945
+ setSelectedBuckets: v,
2946
+ hasAnyBulkAction: !0
2947
+ }),
2948
+ /*#__PURE__*/ z(et, {
2949
+ isOpen: p,
2950
+ buckets: J,
2951
+ onClose: () => g(!1),
2952
+ onComplete: te
2953
+ })
2954
+ ]
2955
+ });
2956
+ };
2957
+ //#endregion
2958
+ //#region src/client/routes/_auth/projects/$projectId/storage/$provider/$storageType/index.tsx?tsr-split=component
2959
+ function rt() {
2960
+ let { project: e, provider: t } = oe({
2961
+ from: "/_auth/projects/$projectId/storage/$provider/$storageType/",
2962
+ select: (e) => ({
2963
+ project: e.projectId,
2964
+ provider: e.provider,
2965
+ storageType: e.storageType
2966
+ })
2967
+ }), { i18n: n, _: r } = G(), i;
2968
+ switch (t) {
2969
+ case "swift":
2970
+ i = n._({ id: "+OEi73" });
2971
+ break;
2972
+ case "ceph":
2973
+ i = n._({ id: "KhNDX4" });
2974
+ break;
2975
+ default: i = n._({ id: "IWF68U" });
2976
+ }
2977
+ return /*#__PURE__*/ B("div", { children: [/*#__PURE__*/ z(P, {
2978
+ title: i,
2979
+ projectId: e
2980
+ }), e ? /*#__PURE__*/ z(se, {
2981
+ resetKeys: [e, t],
2982
+ fallback: /*#__PURE__*/ z("div", {
2983
+ className: "p-4 text-center",
2984
+ children: /*#__PURE__*/ z(W, { id: "diFNkW" })
2985
+ }),
2986
+ children: (() => {
2987
+ switch (t) {
2988
+ case "swift": return /*#__PURE__*/ z(ze, {});
2989
+ case "ceph": return /*#__PURE__*/ z(nt, {});
2990
+ default: return /*#__PURE__*/ z("div", { children: "Storage Overview Page" });
2991
+ }
2992
+ })()
2993
+ }) : /*#__PURE__*/ z("div", {
2994
+ className: "p-4 text-center",
2995
+ children: /*#__PURE__*/ z(W, { id: "Z2fZGD" })
2996
+ })] });
2997
+ }
2998
+ var it = () => /*#__PURE__*/ z(rt, {});
2999
+ //#endregion
3000
+ export { it as component };
3001
+
3002
+ //# sourceMappingURL=_storageType-Bb6YZgXf.mjs.map