@bfrs/agentic-components 0.8.6 → 0.8.8

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 (32) hide show
  1. package/dist/components/data-display/DataTable/TableSaveView.d.ts +14 -1
  2. package/dist/components/data-display/DataTable/TableSaveView.js +164 -144
  3. package/dist/components/data-display/DataTable/TableSaveView.js.map +1 -1
  4. package/dist/components/data-display/DataTable/TableViewSelector.d.ts +15 -1
  5. package/dist/components/data-display/DataTable/TableViewSelector.js +304 -296
  6. package/dist/components/data-display/DataTable/TableViewSelector.js.map +1 -1
  7. package/dist/components/data-display/DataTable/index.d.ts +1 -0
  8. package/dist/components/data-display/DataTable/savedViewAnalytics.d.ts +109 -0
  9. package/dist/components/data-display/DataTable/savedViewAnalytics.js +140 -0
  10. package/dist/components/data-display/DataTable/savedViewAnalytics.js.map +1 -0
  11. package/dist/components/feedback/Toast/Toast.js +48 -48
  12. package/dist/components/feedback/Toast/Toast.js.map +1 -1
  13. package/dist/components/ui/feedback/warningVisual.d.ts +1 -0
  14. package/dist/components/ui/feedback/warningVisual.js +20 -16
  15. package/dist/components/ui/feedback/warningVisual.js.map +1 -1
  16. package/dist/components/ui/index.d.ts +2 -0
  17. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.d.ts +18 -0
  18. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.js +12 -0
  19. package/dist/components/ui/providers/BfrsAnalyticsProvider/BfrsAnalyticsProvider.js.map +1 -0
  20. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.d.ts +78 -0
  21. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.js +41 -0
  22. package/dist/components/ui/providers/BfrsAnalyticsProvider/analyticsContext.js.map +1 -0
  23. package/dist/components/ui/providers/BfrsAnalyticsProvider/index.d.ts +4 -0
  24. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.d.ts +25 -0
  25. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.js +42 -41
  26. package/dist/components/ui/providers/BfrsProvider/BfrsProvider.js.map +1 -1
  27. package/dist/custom-elements.js +9124 -8933
  28. package/dist/custom-elements.js.map +1 -1
  29. package/dist/index.js +224 -213
  30. package/dist/index.js.map +1 -1
  31. package/package.json +1 -1
  32. package/scripts/lint/cli.cjs +6 -0
@@ -1,45 +1,46 @@
1
- import { jsxs as c, jsx as t, Fragment as We } from "react/jsx-runtime";
2
- import { Root as Pe, Portal as Be, Overlay as Wt, Content as Pt, Title as Bt, Description as Lt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
- import { Root as Ot, Trigger as Ht, Portal as Et, Content as Ft } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
- import { BookmarkSimple as jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
- import { CaretDown as Nt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
- import { DotsThreeVertical as Le } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
- import { Info as Kt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
- import { PencilSimple as Mt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
- import { Star as q } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
- import { Trash as $t } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
- import { useRef as y, useMemo as se, useState as m, useId as qt, useEffect as M, useCallback as $ } from "react";
1
+ import { jsxs as s, jsx as t, Fragment as Oe } from "react/jsx-runtime";
2
+ import { Root as Le, Portal as He, Overlay as Lt, Content as Ht, Title as Et, Description as Ft } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
+ import { Root as jt, Trigger as Nt, Portal as Kt, Content as Mt } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
+ import { BookmarkSimple as $t } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
+ import { CaretDown as qt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
+ import { DotsThreeVertical as Ee } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
+ import { Info as Yt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
+ import { PencilSimple as Gt } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
+ import { Star as Y } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
+ import { Trash as Jt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
+ import { useRef as S, useMemo as se, useState as f, useId as Qt, useEffect as $, useCallback as q } from "react";
12
12
  import i from "@emotion/styled";
13
- import { IconButton as Oe, Button as Y } from "../../primitives/Button/Button.js";
14
- import { twRing as fe, twTransform as Ge, kfContentIn as Yt, kfOverlayIn as Gt, kfModalContentIn as Jt } from "../../../lib/emotionTw.js";
15
- import { floatingCollisionPadding as Qt } from "../../ui/overlays/overlayPositioning.js";
16
- import { createTableViewSelectorStore as Xt, isReservedViewName as He } from "./viewStore.js";
17
- import { BfrsPortalScope as de } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
- import { Tooltip as Zt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
- import { ActionMenu as Ee } from "../../navigation/ActionMenu/ActionMenu.js";
20
- const D = {
13
+ import { IconButton as Fe, Button as G } from "../../primitives/Button/Button.js";
14
+ import { twRing as me, twTransform as Xe, kfContentIn as Xt, kfOverlayIn as Zt, kfModalContentIn as Ut } from "../../../lib/emotionTw.js";
15
+ import { floatingCollisionPadding as er } from "../../ui/overlays/overlayPositioning.js";
16
+ import { useSavedViewAnalytics as tr } from "./savedViewAnalytics.js";
17
+ import { createTableViewSelectorStore as rr, isReservedViewName as je } from "./viewStore.js";
18
+ import { BfrsPortalScope as ce } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
19
+ import { Tooltip as nr } from "../../ui/overlays/Tooltip/Tooltip.js";
20
+ import { ActionMenu as Ne } from "../../navigation/ActionMenu/ActionMenu.js";
21
+ const P = {
21
22
  "--tw-text-opacity": "1",
22
23
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
23
24
  }, W = {
24
25
  "--tw-text-opacity": "1",
25
26
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
26
- }, pe = {
27
+ }, fe = {
27
28
  "--tw-bg-opacity": "1",
28
29
  backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
29
- }, me = {
30
+ }, ue = {
30
31
  "--tw-bg-opacity": "1",
31
32
  backgroundColor: "hsl(var(--bfrs-color-primary-soft) / var(--tw-bg-opacity, 1))"
32
- }, Ut = {
33
+ }, ir = {
33
34
  backgroundColor: "#F6F9F6"
34
- }, he = {
35
+ }, pe = {
35
36
  "--tw-border-opacity": "1",
36
37
  borderColor: "hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))"
37
- }, er = /* @__PURE__ */ i("div", {
38
+ }, or = /* @__PURE__ */ i("div", {
38
39
  label: "AgenticTableViewSelector-root"
39
40
  })({
40
41
  display: "inline-flex",
41
42
  minWidth: "0px"
42
- }), tr = /* @__PURE__ */ i("button", {
43
+ }), ar = /* @__PURE__ */ i("button", {
43
44
  label: "AgenticTableViewSelector-trigger",
44
45
  shouldForwardProp: (n) => n !== "ownerState"
45
46
  })(({ ownerState: n }) => [
@@ -52,20 +53,20 @@ const D = {
52
53
  gap: ".5rem",
53
54
  borderRadius: "7px",
54
55
  borderWidth: "1px",
55
- ...Ut,
56
+ ...ir,
56
57
  paddingLeft: ".75rem",
57
58
  paddingRight: ".75rem",
58
59
  fontSize: "12px",
59
60
  lineHeight: "normal",
60
61
  fontWeight: 400,
61
- ...D,
62
+ ...P,
62
63
  outline: "2px solid transparent",
63
64
  outlineOffset: "2px",
64
65
  transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
65
66
  transitionTimingFunction: "cubic-bezier(0,0,.2,1)",
66
67
  transitionDuration: ".15s",
67
- "&:hover": me,
68
- "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
68
+ "&:hover": ue,
69
+ "&:focus-visible": me("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
69
70
  "&:disabled": {
70
71
  pointerEvents: "none",
71
72
  opacity: ".55"
@@ -82,11 +83,11 @@ const D = {
82
83
  n.open || n.filled || n.defaultSelected ? {
83
84
  "--tw-border-opacity": "1",
84
85
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))"
85
- } : he,
86
+ } : pe,
86
87
  // Default is a selected, built-in view. It must use the same primary text
87
88
  // colour as a selected saved view; only a genuinely empty trigger is muted.
88
89
  n.empty && !n.defaultSelected && W
89
- ]), rr = /* @__PURE__ */ i("span", {
90
+ ]), lr = /* @__PURE__ */ i("span", {
90
91
  label: "AgenticTableViewSelector-triggerLabel"
91
92
  })({
92
93
  minWidth: "0px",
@@ -94,13 +95,13 @@ const D = {
94
95
  overflow: "hidden",
95
96
  textOverflow: "ellipsis",
96
97
  whiteSpace: "nowrap"
97
- }), ue = /* @__PURE__ */ i(q, {
98
+ }), de = /* @__PURE__ */ i(Y, {
98
99
  label: "AgenticTableViewSelector-primaryStar"
99
100
  })({
100
101
  flexShrink: 0,
101
102
  "--tw-text-opacity": "1",
102
103
  color: "hsl(var(--bfrs-color-warning) / var(--tw-text-opacity, 1))"
103
- }), nr = /* @__PURE__ */ i(Nt, {
104
+ }), sr = /* @__PURE__ */ i(qt, {
104
105
  label: "AgenticTableViewSelector-caret",
105
106
  shouldForwardProp: (n) => n !== "ownerState"
106
107
  })(({ ownerState: n }) => [
@@ -111,8 +112,8 @@ const D = {
111
112
  transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
112
113
  transitionDuration: ".15s"
113
114
  },
114
- n.open && Ge({ "--tw-rotate": "180deg" })
115
- ]), ir = /* @__PURE__ */ i(Ft, {
115
+ n.open && Xe({ "--tw-rotate": "180deg" })
116
+ ]), cr = /* @__PURE__ */ i(Mt, {
116
117
  label: "AgenticTableViewSelector-content"
117
118
  })({
118
119
  zIndex: 1e3,
@@ -120,16 +121,16 @@ const D = {
120
121
  overflow: "hidden",
121
122
  borderRadius: "var(--bfrs-radius-lg)",
122
123
  borderWidth: "1px",
123
- ...he,
124
124
  ...pe,
125
+ ...fe,
125
126
  "--tw-shadow": "var(--bfrs-shadow-elevated)",
126
127
  "--tw-shadow-colored": "var(--bfrs-shadow-elevated)",
127
128
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
128
129
  outline: "2px solid transparent",
129
130
  outlineOffset: "2px",
130
- ...Yt,
131
+ ...Xt,
131
132
  animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
132
- }), or = /* @__PURE__ */ i("div", {
133
+ }), dr = /* @__PURE__ */ i("div", {
133
134
  label: "AgenticTableViewSelector-header"
134
135
  })({
135
136
  display: "flex",
@@ -145,7 +146,7 @@ const D = {
145
146
  letterSpacing: ".08em",
146
147
  textTransform: "uppercase",
147
148
  ...W
148
- }), ar = /* @__PURE__ */ i("span", {
149
+ }), ur = /* @__PURE__ */ i("span", {
149
150
  label: "AgenticTableViewSelector-headerInfo"
150
151
  })({
151
152
  display: "inline-flex",
@@ -164,7 +165,7 @@ const D = {
164
165
  "--tw-text-opacity": "1",
165
166
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
166
167
  }
167
- }), lr = /* @__PURE__ */ i("div", {
168
+ }), mr = /* @__PURE__ */ i("div", {
168
169
  label: "AgenticTableViewSelector-list"
169
170
  })({
170
171
  display: "flex",
@@ -172,7 +173,7 @@ const D = {
172
173
  flexDirection: "column",
173
174
  overflowY: "auto",
174
175
  paddingBottom: ".25rem"
175
- }), Je = /* @__PURE__ */ i("div", {
176
+ }), Ze = /* @__PURE__ */ i("div", {
176
177
  label: "AgenticTableViewSelector-row"
177
178
  })({
178
179
  display: "flex",
@@ -181,7 +182,7 @@ const D = {
181
182
  gap: ".375rem",
182
183
  paddingLeft: ".5rem",
183
184
  paddingRight: ".625rem"
184
- }), cr = /* @__PURE__ */ i(Je, {
185
+ }), fr = /* @__PURE__ */ i(Ze, {
185
186
  label: "AgenticTableViewSelector-defaultRow"
186
187
  })({
187
188
  marginLeft: ".5rem",
@@ -190,7 +191,7 @@ const D = {
190
191
  borderRadius: "var(--bfrs-radius-sm)",
191
192
  paddingLeft: ".125rem",
192
193
  paddingRight: ".125rem"
193
- }), sr = /* @__PURE__ */ i("div", {
194
+ }), pr = /* @__PURE__ */ i("div", {
194
195
  label: "AgenticTableViewSelector-defaultDivider"
195
196
  })({
196
197
  height: "1px",
@@ -200,7 +201,7 @@ const D = {
200
201
  marginBottom: ".25rem",
201
202
  "--tw-bg-opacity": "1",
202
203
  backgroundColor: "hsl(var(--bfrs-color-border-strong) / var(--tw-bg-opacity, 1))"
203
- }), Fe = /* @__PURE__ */ i("button", {
204
+ }), Ke = /* @__PURE__ */ i("button", {
204
205
  label: "AgenticTableViewSelector-viewButton",
205
206
  shouldForwardProp: (n) => n !== "ownerState"
206
207
  })(({ ownerState: n }) => [
@@ -223,17 +224,17 @@ const D = {
223
224
  fontSize: "12px",
224
225
  lineHeight: "1rem",
225
226
  fontWeight: 400,
226
- ...D,
227
+ ...P,
227
228
  outline: "2px solid transparent",
228
229
  outlineOffset: "2px",
229
- "&:hover": me,
230
- "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
230
+ "&:hover": ue,
231
+ "&:focus-visible": me("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
231
232
  },
232
233
  n.selected && {
233
- ...me,
234
+ ...ue,
234
235
  fontWeight: 700
235
236
  }
236
- ]), je = /* @__PURE__ */ i("span", {
237
+ ]), Me = /* @__PURE__ */ i("span", {
237
238
  label: "AgenticTableViewSelector-name"
238
239
  })({
239
240
  minWidth: "0px",
@@ -241,7 +242,7 @@ const D = {
241
242
  overflow: "hidden",
242
243
  textOverflow: "ellipsis",
243
244
  whiteSpace: "nowrap"
244
- }), Ne = /* @__PURE__ */ i("div", {
245
+ }), $e = /* @__PURE__ */ i("div", {
245
246
  label: "AgenticTableViewSelector-empty"
246
247
  })({
247
248
  paddingLeft: ".75rem",
@@ -251,16 +252,16 @@ const D = {
251
252
  fontSize: ".75rem",
252
253
  lineHeight: "1rem",
253
254
  ...W
254
- }), Ke = /* @__PURE__ */ i(Wt, {
255
+ }), qe = /* @__PURE__ */ i(Lt, {
255
256
  label: "AgenticTableViewSelector-renameOverlay"
256
257
  })({
257
258
  position: "fixed",
258
259
  inset: 0,
259
260
  zIndex: 1050,
260
261
  backgroundColor: "hsl(var(--bfrs-color-text-primary) / .45)",
261
- ...Gt,
262
+ ...Zt,
262
263
  animation: "bfrs-bfrs-overlay-in var(--bfrs-motion-fast) var(--bfrs-ease-out)"
263
- }), Me = /* @__PURE__ */ i(Pt, {
264
+ }), Ye = /* @__PURE__ */ i(Ht, {
264
265
  label: "AgenticTableViewSelector-renameContent"
265
266
  })({
266
267
  position: "fixed",
@@ -273,33 +274,33 @@ const D = {
273
274
  overflow: "auto",
274
275
  borderRadius: "var(--bfrs-radius-lg)",
275
276
  borderWidth: "1px",
276
- ...he,
277
277
  ...pe,
278
+ ...fe,
278
279
  padding: "1.25rem",
279
- ...D,
280
+ ...P,
280
281
  "--tw-shadow": "var(--bfrs-shadow-overlay)",
281
282
  "--tw-shadow-colored": "var(--bfrs-shadow-overlay)",
282
283
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
283
284
  outline: "2px solid transparent",
284
285
  outlineOffset: "2px",
285
- ...Ge({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
286
- ...Jt,
286
+ ...Xe({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
287
+ ...Ut,
287
288
  animation: "bfrs-bfrs-modal-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
288
- }), $e = /* @__PURE__ */ i(Bt, {
289
+ }), Ge = /* @__PURE__ */ i(Et, {
289
290
  label: "AgenticTableViewSelector-renameTitle"
290
291
  })({
291
292
  fontSize: "1.125rem",
292
293
  lineHeight: "1.5rem",
293
294
  fontWeight: 700,
294
- ...D
295
- }), qe = /* @__PURE__ */ i(Lt, {
295
+ ...P
296
+ }), Je = /* @__PURE__ */ i(Ft, {
296
297
  label: "AgenticTableViewSelector-renameDescription"
297
298
  })({
298
299
  marginTop: ".25rem",
299
300
  fontSize: ".75rem",
300
301
  lineHeight: "1.25rem",
301
302
  ...W
302
- }), dr = /* @__PURE__ */ i("label", {
303
+ }), hr = /* @__PURE__ */ i("label", {
303
304
  label: "AgenticTableViewSelector-renameLabel"
304
305
  })({
305
306
  display: "block",
@@ -307,8 +308,8 @@ const D = {
307
308
  fontSize: ".75rem",
308
309
  lineHeight: "1rem",
309
310
  fontWeight: 700,
310
- ...D
311
- }), ur = /* @__PURE__ */ i("input", {
311
+ ...P
312
+ }), br = /* @__PURE__ */ i("input", {
312
313
  label: "AgenticTableViewSelector-renameInput"
313
314
  })({
314
315
  marginTop: ".5rem",
@@ -318,24 +319,24 @@ const D = {
318
319
  borderWidth: "1.5px",
319
320
  "--tw-border-opacity": "1",
320
321
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))",
321
- ...pe,
322
+ ...fe,
322
323
  paddingLeft: ".75rem",
323
324
  paddingRight: ".75rem",
324
325
  fontSize: ".875rem",
325
326
  lineHeight: "1.25rem",
326
327
  fontWeight: 500,
327
- ...D,
328
+ ...P,
328
329
  outline: "2px solid transparent",
329
330
  outlineOffset: "2px",
330
- "&:focus-visible": fe("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
331
- }), Ye = /* @__PURE__ */ i("div", {
331
+ "&:focus-visible": me("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
332
+ }), Qe = /* @__PURE__ */ i("div", {
332
333
  label: "AgenticTableViewSelector-renameFooter"
333
334
  })({
334
335
  marginTop: "1.5rem",
335
336
  display: "flex",
336
337
  justifyContent: "flex-end",
337
338
  gap: ".625rem"
338
- }), mr = /* @__PURE__ */ i(Y, {
339
+ }), gr = /* @__PURE__ */ i(G, {
339
340
  label: "AgenticTableViewSelector-renameSubmitButton"
340
341
  })({
341
342
  "&&:disabled": {
@@ -346,7 +347,7 @@ const D = {
346
347
  "--tw-text-opacity": "1",
347
348
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
348
349
  }
349
- }), fr = /* @__PURE__ */ i("p", {
350
+ }), wr = /* @__PURE__ */ i("p", {
350
351
  label: "AgenticTableViewSelector-renameFieldError"
351
352
  })({
352
353
  marginTop: ".375rem",
@@ -355,35 +356,35 @@ const D = {
355
356
  "--tw-text-opacity": "1",
356
357
  color: "hsl(var(--bfrs-color-danger) / var(--tw-text-opacity, 1))"
357
358
  });
358
- function V(n, o) {
359
+ function I(n, o) {
359
360
  return o ? n.find((r) => r.view_id === o) ?? null : null;
360
361
  }
361
- function pr(n, o, r) {
362
- var _;
363
- const S = [], x = /* @__PURE__ */ new Set(), T = o ?? ((_ = n.find((s) => s.is_default)) == null ? void 0 : _.view_id) ?? null, p = (s) => {
364
- if (!s || x.has(s)) return;
365
- const h = V(n, s);
366
- h && (S.push(h), x.add(h.view_id));
362
+ function vr(n, o, r) {
363
+ var R;
364
+ const x = [], T = /* @__PURE__ */ new Set(), _ = o ?? ((R = n.find((c) => c.is_default)) == null ? void 0 : R.view_id) ?? null, h = (c) => {
365
+ if (!c || T.has(c)) return;
366
+ const b = I(n, c);
367
+ b && (x.push(b), T.add(b.view_id));
367
368
  };
368
- p(T), p(r);
369
- for (const s of n)
370
- x.has(s.view_id) || (S.push(s), x.add(s.view_id));
371
- return S;
369
+ h(_), h(r);
370
+ for (const c of n)
371
+ T.has(c.view_id) || (x.push(c), T.add(c.view_id));
372
+ return x;
372
373
  }
373
- const hr = /* @__PURE__ */ new Set(["true", "1"]);
374
- function br() {
374
+ const yr = /* @__PURE__ */ new Set(["true", "1"]);
375
+ function Sr() {
375
376
  if (typeof window > "u") return !1;
376
377
  const n = new URLSearchParams(window.location.search).get("skip_primary_view");
377
- return n !== null && hr.has(n.trim().toLowerCase());
378
+ return n !== null && yr.has(n.trim().toLowerCase());
378
379
  }
379
- function gr(n) {
380
+ function xr(n) {
380
381
  return n ? [
381
382
  "api",
382
383
  n.viewType && n.tab ? "scoped" : "local",
383
384
  n.saveEndpoint || n.endpoint ? "remote-save" : "local-save"
384
385
  ].join(":") : "none";
385
386
  }
386
- function wr(n) {
387
+ function Tr(n) {
387
388
  const o = () => n.current;
388
389
  return {
389
390
  get baseUrl() {
@@ -436,267 +437,274 @@ function wr(n) {
436
437
  }
437
438
  };
438
439
  }
439
- function Hr({
440
+ function Mr({
440
441
  screenName: n,
441
442
  store: o,
442
443
  saveApi: r,
443
- value: S,
444
- defaultValue: x,
445
- onValueChange: T,
446
- onViewSelect: p,
447
- onPrimaryViewChange: _,
448
- onUnsetPrimaryView: s,
449
- onRenameView: h,
450
- onDeleteView: G,
451
- onResetSavedFilters: R,
452
- onError: H,
453
- triggerLabel: Qe,
454
- placeholder: Xe = "Views",
455
- viewsLabel: Ze = "VIEWS",
456
- primaryHintLabel: be = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
457
- emptyLabel: Ue = "No saved views",
458
- loadingLabel: et = "Loading views",
459
- defaultViewLabel: ge = "Default",
460
- setPrimaryLabel: we = "Set as Primary View",
461
- unsetPrimaryLabel: tt = "Unset as Primary",
462
- renameLabel: rt = "Rename",
463
- deleteLabel: nt = "Delete",
464
- renameTitle: it = "Rename view",
465
- renameDescription: ve = "Update the saved view name.",
466
- renameInputLabel: ot = "View name",
467
- renameCancelLabel: at = "Cancel",
468
- renameSaveLabel: lt = "Save",
469
- deleteTitle: ct = "Delete view",
470
- deleteDescription: st,
471
- deleteCancelLabel: dt = "Cancel",
472
- deleteConfirmLabel: ut = "Delete",
473
- size: mt = "sm",
474
- disabled: ft = !1,
475
- className: pt,
476
- triggerClassName: ht,
477
- contentClassName: bt,
478
- actionMenuClassName: ye
444
+ value: x,
445
+ defaultValue: T,
446
+ onValueChange: _,
447
+ onViewSelect: h,
448
+ onPrimaryViewChange: R,
449
+ onUnsetPrimaryView: c,
450
+ onRenameView: b,
451
+ onDeleteView: J,
452
+ onResetSavedFilters: A,
453
+ analytics: Ue,
454
+ onError: E,
455
+ triggerLabel: et,
456
+ placeholder: tt = "Views",
457
+ viewsLabel: rt = "VIEWS",
458
+ primaryHintLabel: he = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
459
+ emptyLabel: nt = "No saved views",
460
+ loadingLabel: it = "Loading views",
461
+ defaultViewLabel: be = "Default",
462
+ setPrimaryLabel: ge = "Set as Primary View",
463
+ unsetPrimaryLabel: ot = "Unset as Primary",
464
+ renameLabel: at = "Rename",
465
+ deleteLabel: lt = "Delete",
466
+ renameTitle: st = "Rename view",
467
+ renameDescription: we = "Update the saved view name.",
468
+ renameInputLabel: ct = "View name",
469
+ renameCancelLabel: dt = "Cancel",
470
+ renameSaveLabel: ut = "Save",
471
+ deleteTitle: mt = "Delete view",
472
+ deleteDescription: ft,
473
+ deleteCancelLabel: pt = "Cancel",
474
+ deleteConfirmLabel: ht = "Delete",
475
+ size: bt = "sm",
476
+ disabled: gt = !1,
477
+ className: wt,
478
+ triggerClassName: vt,
479
+ contentClassName: yt,
480
+ actionMenuClassName: ve
479
481
  }) {
480
- const Se = y(r);
481
- Se.current = r;
482
- const xe = gr(r), J = se(
483
- () => xe === "none" ? void 0 : wr(Se),
484
- [xe]
485
- ), u = se(
486
- () => o ?? Xt(n, J ? { saveApi: J } : void 0),
487
- [n, o, J]
488
- ), Q = S !== void 0, E = !br(), [X, Z] = m(!1), [A, gt] = m([]), [P, wt] = m(null), [vt, Te] = m(x ?? null), [_e, Re] = m(!1), [F, Ae] = m(null), [B, U] = m(""), [b, ke] = m(null), [Ce, j] = m(null), k = y(!1), L = S ?? vt, O = y(L), ee = y(Q), te = y(!1), g = y(!1), C = y(null), ze = qt();
489
- M(() => {
490
- O.current = L, L && (g.current = !1);
491
- }, [L]), M(() => {
492
- ee.current = Q;
493
- }, [Q]), M(() => {
494
- C.current = null, te.current = !1, g.current = !1;
495
- }, [u, n]);
496
- const w = $(
482
+ const ye = S(r);
483
+ ye.current = r;
484
+ const Se = xr(r), Q = se(
485
+ () => Se === "none" ? void 0 : Tr(ye),
486
+ [Se]
487
+ ), m = se(
488
+ () => o ?? rr(n, Q ? { saveApi: Q } : void 0),
489
+ [n, o, Q]
490
+ ), X = x !== void 0, F = !Sr(), [Z, U] = f(!1), [k, St] = f([]), [B, xt] = f(null), [Tt, xe] = f(T ?? null), [Te, _e] = f(!1), [j, Re] = f(null), [O, ee] = f(""), [g, Ae] = f(null), [ke, N] = f(null), C = S(!1), L = x ?? Tt, H = S(L), te = S(X), re = S(!1), w = S(!1), z = S(null), Ce = Qt();
491
+ $(() => {
492
+ H.current = L, L && (w.current = !1);
493
+ }, [L]), $(() => {
494
+ te.current = X;
495
+ }, [X]), $(() => {
496
+ z.current = null, re.current = !1, w.current = !1;
497
+ }, [m, n]);
498
+ const v = q(
497
499
  (e) => {
498
- H == null || H(e);
500
+ E == null || E(e);
499
501
  },
500
- [H]
501
- ), f = $(
502
+ [E]
503
+ ), p = q(
502
504
  (e) => {
503
- e && (g.current = !1), ee.current || Te((e == null ? void 0 : e.view_id) ?? null), T == null || T((e == null ? void 0 : e.view_id) ?? null, e), e && (p == null || p(e));
505
+ e && (w.current = !1), te.current || xe((e == null ? void 0 : e.view_id) ?? null), _ == null || _((e == null ? void 0 : e.view_id) ?? null, e), e && (h == null || h(e));
504
506
  },
505
- [T, p]
506
- ), re = $(
507
+ [_, h]
508
+ ), ne = q(
507
509
  (e) => {
508
- f(e);
510
+ p(e);
509
511
  },
510
- [f]
511
- ), v = $(
512
+ [p]
513
+ ), y = q(
512
514
  async (e) => {
513
- var Ve;
515
+ var We;
514
516
  const a = e === void 0 ? "__default__" : e ?? "__none__";
515
- if (((Ve = C.current) == null ? void 0 : Ve.key) === a) return C.current.promise;
517
+ if (((We = z.current) == null ? void 0 : We.key) === a) return z.current.promise;
516
518
  const d = { key: a, promise: Promise.resolve(null) };
517
- return C.current = d, d.promise = (async () => {
518
- Re(!0);
519
+ return z.current = d, d.promise = (async () => {
520
+ _e(!0);
519
521
  try {
520
- const z = await u.list(), I = z.find((Dt) => Dt.is_default) ?? null, It = e !== void 0 ? e : O.current, De = V(z, It), Vt = E && !g.current, ce = De || !Vt ? null : V(z, I == null ? void 0 : I.view_id), K = De ?? ce ?? null;
521
- return gt(z), wt((I == null ? void 0 : I.view_id) ?? null), ee.current || Te((K == null ? void 0 : K.view_id) ?? null), E && ce && e === void 0 && !O.current && !te.current && (te.current = !0, re(ce)), K;
522
- } catch (z) {
523
- return w(z), null;
522
+ const D = await m.list(), V = D.find((Ot) => Ot.is_default) ?? null, Wt = e !== void 0 ? e : H.current, Be = I(D, Wt), Bt = F && !w.current, le = Be || !Bt ? null : I(D, V == null ? void 0 : V.view_id), M = Be ?? le ?? null;
523
+ return St(D), xt((V == null ? void 0 : V.view_id) ?? null), te.current || xe((M == null ? void 0 : M.view_id) ?? null), F && le && e === void 0 && !H.current && !re.current && (re.current = !0, ne(le)), M;
524
+ } catch (D) {
525
+ return v(D), null;
524
526
  } finally {
525
- Re(!1), C.current === d && (C.current = null);
527
+ _e(!1), z.current === d && (z.current = null);
526
528
  }
527
529
  })(), d.promise;
528
530
  },
529
- [E, re, w, u, f]
531
+ [F, ne, v, m, p]
530
532
  );
531
- M(() => {
533
+ $(() => {
532
534
  const e = () => {
533
- v();
535
+ y();
534
536
  };
535
- return e(), u.subscribe(e);
536
- }, [v, u]);
537
- const l = V(A, L) ?? (E && !g.current ? V(A, P) : null), yt = se(
538
- () => pr(A, P, l == null ? void 0 : l.view_id),
539
- [P, l == null ? void 0 : l.view_id, A]
540
- ), N = !l, ne = P === null, St = Qe ?? (l == null ? void 0 : l.name) ?? (N ? ge : Xe), ie = A.length > 0, xt = (e) => {
541
- Z(!1), re(e);
542
- }, Tt = (e) => {
543
- u.setPrimary(e.view_id).then(async (a) => {
544
- const d = await v(e.view_id);
545
- f(d ?? a), _ == null || _(a);
546
- }).catch(w);
547
- }, _t = (e) => {
548
- u.unsetPrimary(e.view_id).then(async (a) => {
549
- const d = await v(e.view_id);
550
- f(d ?? a), s == null || s(a);
551
- }).catch(w);
552
- }, oe = () => ke(null), Rt = (e) => {
553
- if (k.current) return;
554
- k.current = !0, j("delete");
555
- const a = O.current === e.view_id;
556
- u.remove(e.view_id).then(async () => {
557
- const d = await v(a ? null : O.current);
558
- a && f(d), G == null || G(e.view_id);
559
- }).catch(w).finally(() => {
560
- k.current = !1, j(null), oe();
537
+ return e(), m.subscribe(e);
538
+ }, [y, m]);
539
+ const l = I(k, L) ?? (F && !w.current ? I(k, B) : null), _t = se(
540
+ () => vr(k, B, l == null ? void 0 : l.view_id),
541
+ [B, l == null ? void 0 : l.view_id, k]
542
+ ), K = !l, ie = B === null, Rt = et ?? (l == null ? void 0 : l.name) ?? (K ? be : tt), oe = k.length > 0, u = tr(Ue, n), At = (e) => {
543
+ U(!1), u.viewSelected(), ne(e);
544
+ }, kt = (e) => {
545
+ u.setPrimary(), m.setPrimary(e.view_id).then(async (a) => {
546
+ const d = await y(e.view_id);
547
+ p(d ?? a), R == null || R(a);
548
+ }).catch(v);
549
+ }, Ct = (e) => {
550
+ u.unsetPrimary(), m.unsetPrimary(e.view_id).then(async (a) => {
551
+ const d = await y(e.view_id);
552
+ p(d ?? a), c == null || c(a);
553
+ }).catch(v);
554
+ }, ze = () => Ae(null), De = () => {
555
+ u.deleteDismissed("cancel"), ze();
556
+ }, zt = (e) => {
557
+ if (C.current) return;
558
+ u.deleteConfirmed(), C.current = !0, N("delete");
559
+ const a = H.current === e.view_id;
560
+ m.remove(e.view_id).then(async () => {
561
+ const d = await y(a ? null : H.current);
562
+ a && p(d), J == null || J(e.view_id);
563
+ }).catch(v).finally(() => {
564
+ C.current = !1, N(null), ze();
561
565
  });
562
- }, At = () => {
563
- b && Rt(b);
564
- }, Ie = () => {
565
- g.current = !0, f(null), R == null || R(), Z(!1);
566
- }, kt = () => {
567
- const e = V(A, P);
566
+ }, Dt = () => {
567
+ g && zt(g);
568
+ }, Ve = () => {
569
+ w.current = !0, u.defaultViewSelected(), p(null), A == null || A(), U(!1);
570
+ }, Vt = () => {
571
+ const e = I(k, B);
568
572
  if (!e) {
569
- Ie();
573
+ Ve();
570
574
  return;
571
575
  }
572
- u.unsetPrimary(e.view_id).then(async (a) => {
573
- g.current = !0, await v(null), f(null), R == null || R(), s == null || s(a);
574
- }).catch(w);
575
- }, Ct = (e) => {
576
- Ae(e), U(e.name);
577
- }, ae = () => {
578
- Ae(null), U("");
579
- }, zt = (e) => {
576
+ u.unsetPrimary(), m.unsetPrimary(e.view_id).then(async (a) => {
577
+ w.current = !0, await y(null), p(null), A == null || A(), c == null || c(a);
578
+ }).catch(v);
579
+ }, It = (e) => {
580
+ u.renameOpened(), Re(e), ee(e.name);
581
+ }, Ie = () => {
582
+ Re(null), ee("");
583
+ }, Pe = () => {
584
+ u.renameDismissed("cancel"), Ie();
585
+ }, Pt = (e) => {
580
586
  e.preventDefault();
581
- const a = B.trim();
582
- !F || !a || He(a) || k.current || (k.current = !0, j("rename"), u.rename(F.view_id, a).then(async (d) => {
583
- await v(F.view_id), h == null || h(d), ae();
584
- }).catch(w).finally(() => {
585
- k.current = !1, j(null);
587
+ const a = O.trim();
588
+ !j || !a || je(a) || C.current || (u.renameSubmitted(), C.current = !0, N("rename"), m.rename(j.view_id, a).then(async (d) => {
589
+ await y(j.view_id), b == null || b(d), Ie();
590
+ }).catch(v).finally(() => {
591
+ C.current = !1, N(null);
586
592
  }));
587
- }, le = He(B);
588
- return ie ? /* @__PURE__ */ c(er, { className: pt, children: [
589
- /* @__PURE__ */ c(Ot, { open: X, onOpenChange: Z, children: [
590
- /* @__PURE__ */ t(Ht, { asChild: !0, children: /* @__PURE__ */ c(
591
- tr,
593
+ }, ae = je(O);
594
+ return oe ? /* @__PURE__ */ s(or, { className: wt, children: [
595
+ /* @__PURE__ */ s(jt, { open: Z, onOpenChange: U, children: [
596
+ /* @__PURE__ */ t(Nt, { asChild: !0, children: /* @__PURE__ */ s(
597
+ ar,
592
598
  {
593
599
  type: "button",
594
600
  "aria-label": "Saved views",
595
- className: ht,
596
- disabled: ft,
601
+ className: vt,
602
+ disabled: gt,
597
603
  "data-filled": l ? "" : void 0,
598
- ownerState: { open: X, empty: !l, filled: !!l, defaultSelected: N, size: mt },
604
+ ownerState: { open: Z, empty: !l, filled: !!l, defaultSelected: K, size: bt },
599
605
  children: [
600
- /* @__PURE__ */ t(jt, { size: 13 }),
601
- /* @__PURE__ */ t(rr, { children: St }),
602
- l != null && l.is_default || N && ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
603
- /* @__PURE__ */ t(nr, { size: 13, ownerState: { open: X } })
606
+ /* @__PURE__ */ t($t, { size: 13 }),
607
+ /* @__PURE__ */ t(lr, { children: Rt }),
608
+ l != null && l.is_default || K && ie ? /* @__PURE__ */ t(de, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
609
+ /* @__PURE__ */ t(sr, { size: 13, ownerState: { open: Z } })
604
610
  ]
605
611
  }
606
612
  ) }),
607
- /* @__PURE__ */ t(Et, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ c(
608
- ir,
613
+ /* @__PURE__ */ t(Kt, { children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ s(
614
+ cr,
609
615
  {
610
616
  align: "start",
611
617
  sideOffset: 8,
612
- collisionPadding: Qt,
613
- className: bt,
618
+ collisionPadding: er,
619
+ className: yt,
614
620
  children: [
615
- /* @__PURE__ */ c(or, { children: [
616
- Ze,
617
- be ? /* @__PURE__ */ t(Zt, { content: be, side: "right", variant: "white", children: /* @__PURE__ */ t(ar, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Kt, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
621
+ /* @__PURE__ */ s(dr, { children: [
622
+ rt,
623
+ he ? /* @__PURE__ */ t(nr, { content: he, side: "right", variant: "white", children: /* @__PURE__ */ t(ur, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ t(Yt, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
618
624
  ] }),
619
- /* @__PURE__ */ c(lr, { children: [
620
- _e && !ie ? /* @__PURE__ */ t(Ne, { children: et }) : null,
621
- !_e && !ie ? /* @__PURE__ */ t(Ne, { children: Ue }) : null,
622
- /* @__PURE__ */ c(cr, { "data-default-view-surface": !0, children: [
623
- /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: N }, onClick: Ie, children: [
624
- /* @__PURE__ */ t(je, { children: ge }),
625
- ne ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
625
+ /* @__PURE__ */ s(mr, { children: [
626
+ Te && !oe ? /* @__PURE__ */ t($e, { children: it }) : null,
627
+ !Te && !oe ? /* @__PURE__ */ t($e, { children: nt }) : null,
628
+ /* @__PURE__ */ s(fr, { "data-default-view-surface": !0, children: [
629
+ /* @__PURE__ */ s(Ke, { type: "button", ownerState: { selected: K }, onClick: Ve, children: [
630
+ /* @__PURE__ */ t(Me, { children: be }),
631
+ ie ? /* @__PURE__ */ t(de, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
626
632
  ] }),
627
633
  /* @__PURE__ */ t(
628
- Ee,
634
+ Ne,
629
635
  {
630
636
  align: "start",
631
637
  side: "right",
632
638
  size: "sm",
633
- className: ye,
639
+ className: ve,
634
640
  trigger: /* @__PURE__ */ t(
635
- Oe,
641
+ Fe,
636
642
  {
637
643
  variant: "secondary",
638
644
  size: "sm",
639
- icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
645
+ icon: /* @__PURE__ */ t(Ee, { size: 14, weight: "bold" }),
640
646
  "aria-label": "View actions for Default"
641
647
  }
642
648
  ),
643
649
  items: [
644
650
  {
645
- label: we,
646
- icon: /* @__PURE__ */ t(q, { size: 16 }),
647
- disabled: ne,
648
- onSelect: kt
651
+ label: ge,
652
+ icon: /* @__PURE__ */ t(Y, { size: 16 }),
653
+ disabled: ie,
654
+ onSelect: Vt
649
655
  }
650
656
  ]
651
657
  }
652
658
  )
653
659
  ] }),
654
- /* @__PURE__ */ t(sr, { role: "separator", "data-default-view-divider": !0 }),
655
- yt.map((e) => {
660
+ /* @__PURE__ */ t(pr, { role: "separator", "data-default-view-divider": !0 }),
661
+ _t.map((e) => {
656
662
  const a = (l == null ? void 0 : l.view_id) === e.view_id;
657
- return /* @__PURE__ */ c(Je, { children: [
658
- /* @__PURE__ */ c(Fe, { type: "button", ownerState: { selected: a }, onClick: () => xt(e), children: [
659
- /* @__PURE__ */ t(je, { children: e.name }),
660
- e.is_default ? /* @__PURE__ */ t(ue, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
663
+ return /* @__PURE__ */ s(Ze, { children: [
664
+ /* @__PURE__ */ s(Ke, { type: "button", ownerState: { selected: a }, onClick: () => At(e), children: [
665
+ /* @__PURE__ */ t(Me, { children: e.name }),
666
+ e.is_default ? /* @__PURE__ */ t(de, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
661
667
  ] }),
662
668
  /* @__PURE__ */ t(
663
- Ee,
669
+ Ne,
664
670
  {
665
671
  align: "start",
666
672
  side: "right",
667
673
  size: "sm",
668
- className: ye,
674
+ className: ve,
669
675
  trigger: /* @__PURE__ */ t(
670
- Oe,
676
+ Fe,
671
677
  {
672
678
  variant: "secondary",
673
679
  size: "sm",
674
- icon: /* @__PURE__ */ t(Le, { size: 14, weight: "bold" }),
680
+ icon: /* @__PURE__ */ t(Ee, { size: 14, weight: "bold" }),
675
681
  "aria-label": `View actions for ${e.name}`
676
682
  }
677
683
  ),
678
684
  items: [
679
685
  ...e.is_system_defined ? [] : [
680
686
  e.is_default ? {
681
- label: tt,
682
- icon: /* @__PURE__ */ t(q, { size: 16 }),
683
- onSelect: () => _t(e)
687
+ label: ot,
688
+ icon: /* @__PURE__ */ t(Y, { size: 16 }),
689
+ onSelect: () => Ct(e)
684
690
  } : {
685
- label: we,
686
- icon: /* @__PURE__ */ t(q, { size: 16 }),
687
- onSelect: () => Tt(e)
691
+ label: ge,
692
+ icon: /* @__PURE__ */ t(Y, { size: 16 }),
693
+ onSelect: () => kt(e)
688
694
  }
689
695
  ],
690
696
  {
691
- label: rt,
692
- icon: /* @__PURE__ */ t(Mt, { size: 16 }),
693
- onSelect: () => Ct(e)
697
+ label: at,
698
+ icon: /* @__PURE__ */ t(Gt, { size: 16 }),
699
+ onSelect: () => It(e)
694
700
  },
695
701
  {
696
- label: nt,
697
- icon: /* @__PURE__ */ t($t, { size: 16 }),
702
+ label: lt,
703
+ icon: /* @__PURE__ */ t(Jt, { size: 16 }),
698
704
  destructive: !0,
699
- onSelect: () => ke(e)
705
+ onSelect: () => {
706
+ u.deleteOpened(), Ae(e);
707
+ }
700
708
  }
701
709
  ]
702
710
  }
@@ -708,67 +716,67 @@ function Hr({
708
716
  }
709
717
  ) }) })
710
718
  ] }),
711
- /* @__PURE__ */ t(Pe, { open: !!F, onOpenChange: (e) => {
712
- e || ae();
713
- }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
714
- /* @__PURE__ */ t(Ke, {}),
715
- /* @__PURE__ */ t(Me, { children: /* @__PURE__ */ c("form", { onSubmit: zt, children: [
716
- /* @__PURE__ */ t($e, { children: it }),
717
- ve ? /* @__PURE__ */ t(qe, { children: ve }) : null,
718
- /* @__PURE__ */ t(dr, { htmlFor: ze, children: ot }),
719
+ /* @__PURE__ */ t(Le, { open: !!j, onOpenChange: (e) => {
720
+ e || Pe();
721
+ }, children: /* @__PURE__ */ t(He, { children: /* @__PURE__ */ s(ce, { children: [
722
+ /* @__PURE__ */ t(qe, {}),
723
+ /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ s("form", { onSubmit: Pt, children: [
724
+ /* @__PURE__ */ t(Ge, { children: st }),
725
+ we ? /* @__PURE__ */ t(Je, { children: we }) : null,
726
+ /* @__PURE__ */ t(hr, { htmlFor: Ce, children: ct }),
719
727
  /* @__PURE__ */ t(
720
- ur,
728
+ br,
721
729
  {
722
- id: ze,
730
+ id: Ce,
723
731
  autoFocus: !0,
724
- value: B,
725
- onChange: (e) => U(e.currentTarget.value),
726
- "aria-invalid": le
732
+ value: O,
733
+ onChange: (e) => ee(e.currentTarget.value),
734
+ "aria-invalid": ae
727
735
  }
728
736
  ),
729
- le ? /* @__PURE__ */ c(fr, { children: [
737
+ ae ? /* @__PURE__ */ s(wr, { children: [
730
738
  "“",
731
- B.trim(),
739
+ O.trim(),
732
740
  "” is reserved. Choose a different name."
733
741
  ] }) : null,
734
- /* @__PURE__ */ c(Ye, { children: [
735
- /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: ae, children: at }),
742
+ /* @__PURE__ */ s(Qe, { children: [
743
+ /* @__PURE__ */ t(G, { type: "button", variant: "secondary", onClick: Pe, children: dt }),
736
744
  /* @__PURE__ */ t(
737
- mr,
745
+ gr,
738
746
  {
739
747
  type: "submit",
740
- loading: Ce === "rename",
741
- disabled: B.trim().length === 0 || le,
742
- children: lt
748
+ loading: ke === "rename",
749
+ disabled: O.trim().length === 0 || ae,
750
+ children: ut
743
751
  }
744
752
  )
745
753
  ] })
746
754
  ] }) })
747
755
  ] }) }) }),
748
- /* @__PURE__ */ t(Pe, { open: !!b, onOpenChange: (e) => {
749
- e || oe();
750
- }, children: /* @__PURE__ */ t(Be, { children: /* @__PURE__ */ c(de, { children: [
751
- /* @__PURE__ */ t(Ke, {}),
752
- /* @__PURE__ */ c(Me, { children: [
753
- /* @__PURE__ */ t($e, { children: ct }),
754
- /* @__PURE__ */ t(qe, { children: st ?? /* @__PURE__ */ c(We, { children: [
756
+ /* @__PURE__ */ t(Le, { open: !!g, onOpenChange: (e) => {
757
+ e || De();
758
+ }, children: /* @__PURE__ */ t(He, { children: /* @__PURE__ */ s(ce, { children: [
759
+ /* @__PURE__ */ t(qe, {}),
760
+ /* @__PURE__ */ s(Ye, { children: [
761
+ /* @__PURE__ */ t(Ge, { children: mt }),
762
+ /* @__PURE__ */ t(Je, { children: ft ?? /* @__PURE__ */ s(Oe, { children: [
755
763
  "Are you sure you want to delete",
756
- b != null && b.name ? /* @__PURE__ */ c(We, { children: [
764
+ g != null && g.name ? /* @__PURE__ */ s(Oe, { children: [
757
765
  " “",
758
- /* @__PURE__ */ t("strong", { children: b.name }),
766
+ /* @__PURE__ */ t("strong", { children: g.name }),
759
767
  "”"
760
768
  ] }) : " this view",
761
769
  "? This can’t be undone."
762
770
  ] }) }),
763
- /* @__PURE__ */ c(Ye, { children: [
764
- /* @__PURE__ */ t(Y, { type: "button", variant: "secondary", onClick: oe, children: dt }),
765
- /* @__PURE__ */ t(Y, { type: "button", variant: "danger", onClick: At, loading: Ce === "delete", children: ut })
771
+ /* @__PURE__ */ s(Qe, { children: [
772
+ /* @__PURE__ */ t(G, { type: "button", variant: "secondary", onClick: De, children: pt }),
773
+ /* @__PURE__ */ t(G, { type: "button", variant: "danger", onClick: Dt, loading: ke === "delete", children: ht })
766
774
  ] })
767
775
  ] })
768
776
  ] }) }) })
769
777
  ] }) : null;
770
778
  }
771
779
  export {
772
- Hr as TableViewSelector
780
+ Mr as TableViewSelector
773
781
  };
774
782
  //# sourceMappingURL=TableViewSelector.js.map