@astrato-io/visualizations 0.6.4 → 0.7.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 (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,66 +1,219 @@
1
1
  import { o as e, t } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Eo as n, ds as r, ja as i, nc as a, oc as o, qs as s, sc as c } from "./interfaces-VUY4_yVO.js";
3
- import { Ai as l, Di as u, Ei as d, Ki as f, Mn as p, Nn as m, Oi as h, Pn as g, Qn as _, Ti as v, Ui as y, Z as b, _ as x, d as ee, ji as S, ki as C, wi as w, xn as te } from "./utils-Ba9T0TqC.js";
4
- import { P as ne, a as re, c as ie, d as ae, i as T, l as oe, o as E, s as D, u as O } from "./ui-D1HQNIBy.js";
5
- import { t as k } from "./typeof-CJDtcySz.js";
6
- var A = /* @__PURE__ */ t(((e, t) => {
2
+ import { Is as n, Ls as r, Ns as i, Ua as a, qi as o, ws as s } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { An as c, Ei as l, X as u, ai as d, bn as f, ci as p, d as m, g as h, ii as g, jn as _, kn as v, li as y, oi as b, qn as x, ri as S, si as C, ui as w, xi as T } from "./utils-vdmi_2PK.js";
4
+ import { s as E } from "./logger-DpQtYQnX.js";
5
+ import { t as ee } from "./FieldTypeIcon-Drs6hSJF.js";
6
+ import { t as D } from "./typeof-CJDtcySz.js";
7
+ var O = /* @__PURE__ */ e(l()), k = S();
8
+ function te({ label: e }) {
9
+ return /* @__PURE__ */ (0, k.jsxs)("span", {
10
+ className: "astrato-app-filter-bar__loader",
11
+ role: "status",
12
+ children: [/* @__PURE__ */ (0, k.jsx)("span", {
13
+ className: "astrato-app-filter-bar__spinner",
14
+ "aria-hidden": "true"
15
+ }), /* @__PURE__ */ (0, k.jsx)("span", {
16
+ className: "astrato-app-filter-bar__sr-only",
17
+ children: e
18
+ })]
19
+ });
20
+ }
21
+ var A = (0, O.forwardRef)(function({ type: e = "button", className: t = "", ...n }, r) {
22
+ return /* @__PURE__ */ (0, k.jsx)("button", {
23
+ ...n,
24
+ type: e,
25
+ className: `astrato-app-filter-bar__button ${t}`,
26
+ ref: r
27
+ });
28
+ }), j = (0, O.forwardRef)(function({ className: e = "", ...t }, n) {
29
+ return /* @__PURE__ */ (0, k.jsx)("input", {
30
+ ...t,
31
+ className: `astrato-app-filter-bar__input ${e}`,
32
+ ref: n
33
+ });
34
+ }), M = (0, O.forwardRef)(function({ className: e = "", ...t }, n) {
35
+ return /* @__PURE__ */ (0, k.jsx)("select", {
36
+ ...t,
37
+ className: `astrato-app-filter-bar__select ${e}`,
38
+ ref: n
39
+ });
40
+ });
41
+ (0, O.forwardRef)(function(e, t) {
42
+ return /* @__PURE__ */ (0, k.jsx)(j, {
43
+ ...e,
44
+ type: "range",
45
+ ref: t
46
+ });
47
+ });
48
+ var ne = (0, O.forwardRef)(function(e, t) {
49
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
50
+ className: "astrato-app-filter-bar__search",
51
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "search" }), /* @__PURE__ */ (0, k.jsx)(j, {
52
+ ...e,
53
+ type: "search",
54
+ ref: t
55
+ })]
56
+ });
57
+ });
58
+ function N({ actions: e, label: t = "Selection actions", icon: n, align: r = "end", disabled: i = !1 }) {
59
+ let a = (0, O.useRef)(null), o = (0, O.useId)(), s = () => {
60
+ a.current?.removeAttribute("open"), a.current?.querySelector("summary")?.focus();
61
+ };
62
+ return (0, O.useEffect)(() => {
63
+ i && a.current?.removeAttribute("open");
64
+ }, [i]), /* @__PURE__ */ (0, k.jsxs)("details", {
65
+ ref: a,
66
+ className: "astrato-app-filter-bar__menu",
67
+ "data-align": r,
68
+ onToggle: () => {
69
+ a.current?.open && a.current.ownerDocument.activeElement === a.current.querySelector("summary") && (a.current.querySelector("button[aria-checked=\"true\"]:enabled") ?? a.current.querySelector("button:enabled"))?.focus();
70
+ },
71
+ onBlur: (e) => {
72
+ e.currentTarget.contains(e.relatedTarget) || e.currentTarget.removeAttribute("open");
73
+ },
74
+ onKeyDown: (e) => {
75
+ let t = a.current;
76
+ if (!(!t || i)) {
77
+ if (e.key === "Escape" && a.current?.open) e.preventDefault(), e.stopPropagation(), s();
78
+ else if ([
79
+ "ArrowDown",
80
+ "ArrowUp",
81
+ "Home",
82
+ "End"
83
+ ].includes(e.key)) {
84
+ e.preventDefault(), e.stopPropagation();
85
+ let n = Array.from(t.querySelectorAll("button:enabled"));
86
+ if (!n.length) return;
87
+ let r = n.indexOf(t.ownerDocument.activeElement), i = t.open;
88
+ t.open = !0, n[e.key === "Home" ? 0 : e.key === "End" || !i && e.key === "ArrowUp" ? n.length - 1 : (r + (e.key === "ArrowUp" ? -1 : 1) + n.length) % n.length]?.focus();
89
+ }
90
+ }
91
+ },
92
+ children: [/* @__PURE__ */ (0, k.jsx)("summary", {
93
+ className: "astrato-app-filter-bar__button",
94
+ "aria-label": t,
95
+ "aria-haspopup": "menu",
96
+ "aria-controls": o,
97
+ "aria-disabled": i || void 0,
98
+ tabIndex: i ? -1 : 0,
99
+ "data-icon-only": n ? "true" : void 0,
100
+ title: t,
101
+ onClick: (e) => {
102
+ i && e.preventDefault();
103
+ },
104
+ children: n ? /* @__PURE__ */ (0, k.jsx)(x, { name: n }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: ["Actions ", /* @__PURE__ */ (0, k.jsx)(x, { name: "chevronDown" })] })
105
+ }), /* @__PURE__ */ (0, k.jsx)("div", {
106
+ className: "astrato-app-filter-bar__menu-items",
107
+ id: o,
108
+ role: "menu",
109
+ "aria-label": t,
110
+ children: e.map(({ label: e, description: t, icon: n, selected: r, disabled: a, onSelect: o }) => /* @__PURE__ */ (0, k.jsxs)(A, {
111
+ role: r === void 0 ? "menuitem" : "menuitemradio",
112
+ "aria-checked": r,
113
+ tabIndex: -1,
114
+ disabled: i || a,
115
+ onClick: () => {
116
+ o(), s();
117
+ },
118
+ children: [
119
+ n && /* @__PURE__ */ (0, k.jsx)(x, { name: n }),
120
+ /* @__PURE__ */ (0, k.jsxs)("span", {
121
+ className: "astrato-app-filter-bar__menu-label",
122
+ children: [/* @__PURE__ */ (0, k.jsx)("span", { children: e }), t && /* @__PURE__ */ (0, k.jsx)("small", { children: t })]
123
+ }),
124
+ r && /* @__PURE__ */ (0, k.jsx)(x, { name: "check" })
125
+ ]
126
+ }, e))
127
+ })]
128
+ });
129
+ }
130
+ function P(e) {
131
+ if (e.key !== "Tab" || e.defaultPrevented) return;
132
+ let t = e.currentTarget, n = t.ownerDocument.defaultView, r = Array.from(t.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], summary:not([aria-disabled=\"true\"]), [tabindex=\"0\"]")).filter((e) => e.tabIndex >= 0 && e.getClientRects().length > 0 && n?.getComputedStyle(e).visibility !== "hidden"), i = r[0], a = r[r.length - 1];
133
+ i ? e.shiftKey && (e.target === i || e.target === t) ? (e.preventDefault(), a.focus()) : !e.shiftKey && (e.target === a || e.target === t) && (e.preventDefault(), i.focus()) : (e.preventDefault(), t.focus());
134
+ }
135
+ function re({ onCloseDialog: e, children: t, ...n }) {
136
+ let r = (0, O.useRef)(null);
137
+ return (0, O.useLayoutEffect)(() => {
138
+ let e = r.current;
139
+ if (!e) return;
140
+ let t = e.getRootNode().activeElement;
141
+ return e.showModal(), () => {
142
+ e.close(), t?.isConnected && t.focus();
143
+ };
144
+ }, []), /* @__PURE__ */ (0, k.jsx)("dialog", {
145
+ ...n,
146
+ ref: r,
147
+ onKeyDown: P,
148
+ onCancel: (t) => {
149
+ t.preventDefault(), e();
150
+ },
151
+ onClick: (t) => {
152
+ if (t.target !== t.currentTarget) return;
153
+ let n = t.currentTarget.getBoundingClientRect();
154
+ (t.clientX < n.left || t.clientX > n.right || t.clientY < n.top || t.clientY > n.bottom) && e();
155
+ },
156
+ children: t
157
+ });
158
+ }
159
+ var F = /* @__PURE__ */ t(((e, t) => {
7
160
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
8
161
  function n(e, t) {
9
162
  if (t.length < e) throw TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + t.length + " present");
10
163
  }
11
164
  t.exports = e.default;
12
- })), j = /* @__PURE__ */ t(((e, t) => {
13
- var n = b().default;
165
+ })), I = /* @__PURE__ */ t(((e, t) => {
166
+ var n = u().default;
14
167
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
15
- var r = n(k()), i = n(A());
168
+ var r = n(D()), i = n(F());
16
169
  function a(e) {
17
170
  return (0, i.default)(1, arguments), e instanceof Date || (0, r.default)(e) === "object" && Object.prototype.toString.call(e) === "[object Date]";
18
171
  }
19
172
  t.exports = e.default;
20
- })), M = /* @__PURE__ */ t(((e, t) => {
21
- var n = b().default;
173
+ })), L = /* @__PURE__ */ t(((e, t) => {
174
+ var n = u().default;
22
175
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
23
- var r = n(k()), i = n(A());
176
+ var r = n(D()), i = n(F());
24
177
  function a(e) {
25
178
  (0, i.default)(1, arguments);
26
179
  var t = Object.prototype.toString.call(e);
27
180
  return e instanceof Date || (0, r.default)(e) === "object" && t === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || t === "[object Number]" ? new Date(e) : ((typeof e == "string" || t === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn((/* @__PURE__ */ Error()).stack)), /* @__PURE__ */ new Date(NaN));
28
181
  }
29
182
  t.exports = e.default;
30
- })), N = /* @__PURE__ */ t(((e, t) => {
31
- var n = b().default;
183
+ })), ie = /* @__PURE__ */ t(((e, t) => {
184
+ var n = u().default;
32
185
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
33
- var r = n(j()), i = n(M()), a = n(A());
186
+ var r = n(I()), i = n(L()), a = n(F());
34
187
  function o(e) {
35
188
  if ((0, a.default)(1, arguments), !(0, r.default)(e) && typeof e != "number") return !1;
36
189
  var t = (0, i.default)(e);
37
190
  return !isNaN(Number(t));
38
191
  }
39
192
  t.exports = e.default;
40
- })), se = /* @__PURE__ */ t(((e, t) => {
41
- var n = b().default;
193
+ })), ae = /* @__PURE__ */ t(((e, t) => {
194
+ var n = u().default;
42
195
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
43
- var r = n(C()), i = n(M()), a = n(A());
196
+ var r = n(p()), i = n(L()), a = n(F());
44
197
  function o(e, t) {
45
198
  (0, a.default)(2, arguments);
46
199
  var n = (0, i.default)(e).getTime(), o = (0, r.default)(t);
47
200
  return new Date(n + o);
48
201
  }
49
202
  t.exports = e.default;
50
- })), ce = /* @__PURE__ */ t(((e, t) => {
51
- var n = b().default;
203
+ })), oe = /* @__PURE__ */ t(((e, t) => {
204
+ var n = u().default;
52
205
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
53
- var r = n(se()), i = n(A()), a = n(C());
206
+ var r = n(ae()), i = n(F()), a = n(p());
54
207
  function o(e, t) {
55
208
  (0, i.default)(2, arguments);
56
209
  var n = (0, a.default)(t);
57
210
  return (0, r.default)(e, -n);
58
211
  }
59
212
  t.exports = e.default;
60
- })), P = /* @__PURE__ */ t(((e, t) => {
61
- var n = b().default;
213
+ })), R = /* @__PURE__ */ t(((e, t) => {
214
+ var n = u().default;
62
215
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
63
- var r = n(M()), i = n(A()), a = 864e5;
216
+ var r = n(L()), i = n(F()), a = 864e5;
64
217
  function o(e) {
65
218
  (0, i.default)(1, arguments);
66
219
  var t = (0, r.default)(e), n = t.getTime();
@@ -69,20 +222,20 @@ var A = /* @__PURE__ */ t(((e, t) => {
69
222
  return Math.floor(o / a) + 1;
70
223
  }
71
224
  t.exports = e.default;
72
- })), F = /* @__PURE__ */ t(((e, t) => {
73
- var n = b().default;
225
+ })), z = /* @__PURE__ */ t(((e, t) => {
226
+ var n = u().default;
74
227
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = a;
75
- var r = n(M()), i = n(A());
228
+ var r = n(L()), i = n(F());
76
229
  function a(e) {
77
230
  (0, i.default)(1, arguments);
78
231
  var t = 1, n = (0, r.default)(e), a = n.getUTCDay(), o = (a < t ? 7 : 0) + a - t;
79
232
  return n.setUTCDate(n.getUTCDate() - o), n.setUTCHours(0, 0, 0, 0), n;
80
233
  }
81
234
  t.exports = e.default;
82
- })), le = /* @__PURE__ */ t(((e, t) => {
83
- var n = b().default;
235
+ })), B = /* @__PURE__ */ t(((e, t) => {
236
+ var n = u().default;
84
237
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
85
- var r = n(M()), i = n(A()), a = n(F());
238
+ var r = n(L()), i = n(F()), a = n(z());
86
239
  function o(e) {
87
240
  (0, i.default)(1, arguments);
88
241
  var t = (0, r.default)(e), n = t.getUTCFullYear(), o = /* @__PURE__ */ new Date(0);
@@ -93,27 +246,27 @@ var A = /* @__PURE__ */ t(((e, t) => {
93
246
  return t.getTime() >= s.getTime() ? n + 1 : t.getTime() >= l.getTime() ? n : n - 1;
94
247
  }
95
248
  t.exports = e.default;
96
- })), I = /* @__PURE__ */ t(((e, t) => {
97
- var n = b().default;
249
+ })), V = /* @__PURE__ */ t(((e, t) => {
250
+ var n = u().default;
98
251
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o;
99
- var r = n(le()), i = n(F()), a = n(A());
252
+ var r = n(B()), i = n(z()), a = n(F());
100
253
  function o(e) {
101
254
  (0, a.default)(1, arguments);
102
255
  var t = (0, r.default)(e), n = /* @__PURE__ */ new Date(0);
103
256
  return n.setUTCFullYear(t, 0, 4), n.setUTCHours(0, 0, 0, 0), (0, i.default)(n);
104
257
  }
105
258
  t.exports = e.default;
106
- })), L = /* @__PURE__ */ t(((e, t) => {
107
- var n = b().default;
259
+ })), H = /* @__PURE__ */ t(((e, t) => {
260
+ var n = u().default;
108
261
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
109
- var r = n(M()), i = n(F()), a = n(I()), o = n(A()), s = 6048e5;
262
+ var r = n(L()), i = n(z()), a = n(V()), o = n(F()), s = 6048e5;
110
263
  function c(e) {
111
264
  (0, o.default)(1, arguments);
112
265
  var t = (0, r.default)(e), n = (0, i.default)(t).getTime() - (0, a.default)(t).getTime();
113
266
  return Math.round(n / s) + 1;
114
267
  }
115
268
  t.exports = e.default;
116
- })), R = /* @__PURE__ */ t(((e) => {
269
+ })), se = /* @__PURE__ */ t(((e) => {
117
270
  Object.defineProperty(e, "__esModule", { value: !0 }), e.getDefaultOptions = n, e.setDefaultOptions = r;
118
271
  var t = {};
119
272
  function n() {
@@ -122,10 +275,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
122
275
  function r(e) {
123
276
  t = e;
124
277
  }
125
- })), z = /* @__PURE__ */ t(((e, t) => {
126
- var n = b().default;
278
+ })), U = /* @__PURE__ */ t(((e, t) => {
279
+ var n = u().default;
127
280
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s;
128
- var r = n(M()), i = n(A()), a = n(C()), o = R();
281
+ var r = n(L()), i = n(F()), a = n(p()), o = se();
129
282
  function s(e, t) {
130
283
  var n;
131
284
  (0, i.default)(1, arguments);
@@ -135,10 +288,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
135
288
  return l.setUTCDate(l.getUTCDate() - d), l.setUTCHours(0, 0, 0, 0), l;
136
289
  }
137
290
  t.exports = e.default;
138
- })), ue = /* @__PURE__ */ t(((e, t) => {
139
- var n = b().default;
291
+ })), ce = /* @__PURE__ */ t(((e, t) => {
292
+ var n = u().default;
140
293
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
141
- var r = n(M()), i = n(A()), a = n(z()), o = n(C()), s = R();
294
+ var r = n(L()), i = n(F()), a = n(U()), o = n(p()), s = se();
142
295
  function c(e, t) {
143
296
  var n;
144
297
  (0, i.default)(1, arguments);
@@ -152,10 +305,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
152
305
  return c.getTime() >= p.getTime() ? l + 1 : c.getTime() >= h.getTime() ? l : l - 1;
153
306
  }
154
307
  t.exports = e.default;
155
- })), de = /* @__PURE__ */ t(((e, t) => {
156
- var n = b().default;
308
+ })), le = /* @__PURE__ */ t(((e, t) => {
309
+ var n = u().default;
157
310
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
158
- var r = n(ue()), i = n(A()), a = n(z()), o = n(C()), s = R();
311
+ var r = n(ce()), i = n(F()), a = n(U()), o = n(p()), s = se();
159
312
  function c(e, t) {
160
313
  var n;
161
314
  (0, i.default)(1, arguments);
@@ -163,27 +316,27 @@ var A = /* @__PURE__ */ t(((e, t) => {
163
316
  return d.setUTCFullYear(u, 0, l), d.setUTCHours(0, 0, 0, 0), (0, a.default)(d, t);
164
317
  }
165
318
  t.exports = e.default;
166
- })), fe = /* @__PURE__ */ t(((e, t) => {
167
- var n = b().default;
319
+ })), W = /* @__PURE__ */ t(((e, t) => {
320
+ var n = u().default;
168
321
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c;
169
- var r = n(M()), i = n(z()), a = n(de()), o = n(A()), s = 6048e5;
322
+ var r = n(L()), i = n(U()), a = n(le()), o = n(F()), s = 6048e5;
170
323
  function c(e, t) {
171
324
  (0, o.default)(1, arguments);
172
325
  var n = (0, r.default)(e), c = (0, i.default)(n, t).getTime() - (0, a.default)(n, t).getTime();
173
326
  return Math.round(c / s) + 1;
174
327
  }
175
328
  t.exports = e.default;
176
- })), pe = /* @__PURE__ */ t(((e, t) => {
329
+ })), ue = /* @__PURE__ */ t(((e, t) => {
177
330
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
178
331
  function n(e, t) {
179
332
  for (var n = e < 0 ? "-" : "", r = Math.abs(e).toString(); r.length < t;) r = "0" + r;
180
333
  return n + r;
181
334
  }
182
335
  t.exports = e.default;
183
- })), me = /* @__PURE__ */ t(((e, t) => {
184
- var n = b().default;
336
+ })), de = /* @__PURE__ */ t(((e, t) => {
337
+ var n = u().default;
185
338
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
186
- var r = n(pe());
339
+ var r = n(ue());
187
340
  e.default = {
188
341
  y: function(e, t) {
189
342
  var n = e.getUTCFullYear(), i = n > 0 ? n : 1 - n;
@@ -223,10 +376,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
223
376
  return (0, r.default)(a, t.length);
224
377
  }
225
378
  }, t.exports = e.default;
226
- })), he = /* @__PURE__ */ t(((e, t) => {
227
- var n = b().default;
379
+ })), fe = /* @__PURE__ */ t(((e, t) => {
380
+ var n = u().default;
228
381
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
229
- var r = n(P()), i = n(L()), a = n(le()), o = n(fe()), s = n(ue()), c = n(pe()), l = n(me()), u = {
382
+ var r = n(R()), i = n(H()), a = n(B()), o = n(W()), s = n(ce()), c = n(ue()), l = n(de()), d = {
230
383
  am: "am",
231
384
  pm: "pm",
232
385
  midnight: "midnight",
@@ -235,7 +388,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
235
388
  afternoon: "afternoon",
236
389
  evening: "evening",
237
390
  night: "night"
238
- }, d = {
391
+ }, f = {
239
392
  G: function(e, t, n) {
240
393
  var r = +(e.getUTCFullYear() > 0);
241
394
  switch (t) {
@@ -482,7 +635,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
482
635
  }
483
636
  },
484
637
  b: function(e, t, n) {
485
- var r = e.getUTCHours(), i = r === 12 ? u.noon : r === 0 ? u.midnight : r / 12 >= 1 ? "pm" : "am";
638
+ var r = e.getUTCHours(), i = r === 12 ? d.noon : r === 0 ? d.midnight : r / 12 >= 1 ? "pm" : "am";
486
639
  switch (t) {
487
640
  case "b":
488
641
  case "bb": return n.dayPeriod(i, {
@@ -504,7 +657,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
504
657
  }
505
658
  },
506
659
  B: function(e, t, n) {
507
- var r = e.getUTCHours(), i = r >= 17 ? u.evening : r >= 12 ? u.afternoon : r >= 4 ? u.morning : u.night;
660
+ var r = e.getUTCHours(), i = r >= 17 ? d.evening : r >= 12 ? d.afternoon : r >= 4 ? d.morning : d.night;
508
661
  switch (t) {
509
662
  case "B":
510
663
  case "BB":
@@ -553,19 +706,19 @@ var A = /* @__PURE__ */ t(((e, t) => {
553
706
  var i = (r._originalDate || e).getTimezoneOffset();
554
707
  if (i === 0) return "Z";
555
708
  switch (t) {
556
- case "X": return p(i);
709
+ case "X": return m(i);
557
710
  case "XXXX":
558
- case "XX": return m(i);
559
- default: return m(i, ":");
711
+ case "XX": return h(i);
712
+ default: return h(i, ":");
560
713
  }
561
714
  },
562
715
  x: function(e, t, n, r) {
563
716
  var i = (r._originalDate || e).getTimezoneOffset();
564
717
  switch (t) {
565
- case "x": return p(i);
718
+ case "x": return m(i);
566
719
  case "xxxx":
567
- case "xx": return m(i);
568
- default: return m(i, ":");
720
+ case "xx": return h(i);
721
+ default: return h(i, ":");
569
722
  }
570
723
  },
571
724
  O: function(e, t, n, r) {
@@ -573,8 +726,8 @@ var A = /* @__PURE__ */ t(((e, t) => {
573
726
  switch (t) {
574
727
  case "O":
575
728
  case "OO":
576
- case "OOO": return "GMT" + f(i, ":");
577
- default: return "GMT" + m(i, ":");
729
+ case "OOO": return "GMT" + p(i, ":");
730
+ default: return "GMT" + h(i, ":");
578
731
  }
579
732
  },
580
733
  z: function(e, t, n, r) {
@@ -582,8 +735,8 @@ var A = /* @__PURE__ */ t(((e, t) => {
582
735
  switch (t) {
583
736
  case "z":
584
737
  case "zz":
585
- case "zzz": return "GMT" + f(i, ":");
586
- default: return "GMT" + m(i, ":");
738
+ case "zzz": return "GMT" + p(i, ":");
739
+ default: return "GMT" + h(i, ":");
587
740
  }
588
741
  },
589
742
  t: function(e, t, n, r) {
@@ -595,21 +748,21 @@ var A = /* @__PURE__ */ t(((e, t) => {
595
748
  return (0, c.default)(i, t.length);
596
749
  }
597
750
  };
598
- function f(e, t) {
751
+ function p(e, t) {
599
752
  var n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.floor(r / 60), a = r % 60;
600
753
  if (a === 0) return n + String(i);
601
754
  var o = t || "";
602
755
  return n + String(i) + o + (0, c.default)(a, 2);
603
756
  }
604
- function p(e, t) {
605
- return e % 60 == 0 ? (e > 0 ? "-" : "+") + (0, c.default)(Math.abs(e) / 60, 2) : m(e, t);
606
- }
607
757
  function m(e, t) {
758
+ return e % 60 == 0 ? (e > 0 ? "-" : "+") + (0, c.default)(Math.abs(e) / 60, 2) : h(e, t);
759
+ }
760
+ function h(e, t) {
608
761
  var n = t || "", r = e > 0 ? "-" : "+", i = Math.abs(e), a = (0, c.default)(Math.floor(i / 60), 2), o = (0, c.default)(i % 60, 2);
609
762
  return r + a + n + o;
610
763
  }
611
- e.default = d, t.exports = e.default;
612
- })), ge = /* @__PURE__ */ t(((e, t) => {
764
+ e.default = f, t.exports = e.default;
765
+ })), pe = /* @__PURE__ */ t(((e, t) => {
613
766
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
614
767
  var n = function(e, t) {
615
768
  switch (e) {
@@ -649,7 +802,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
649
802
  return s.replace("{{date}}", n(a, t)).replace("{{time}}", r(o, t));
650
803
  }
651
804
  }, t.exports = e.default;
652
- })), B = /* @__PURE__ */ t(((e) => {
805
+ })), G = /* @__PURE__ */ t(((e) => {
653
806
  Object.defineProperty(e, "__esModule", { value: !0 }), e.isProtectedDayOfYearToken = r, e.isProtectedWeekYearToken = i, e.throwProtectedError = a;
654
807
  var t = ["D", "DD"], n = ["YY", "YYYY"];
655
808
  function r(e) {
@@ -664,7 +817,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
664
817
  if (e === "D") throw RangeError(`Use \`d\` instead of \`D\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);
665
818
  if (e === "DD") throw RangeError(`Use \`dd\` instead of \`DD\` (in \`${t}\`) for formatting days of the month to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);
666
819
  }
667
- })), _e = /* @__PURE__ */ t(((e, t) => {
820
+ })), me = /* @__PURE__ */ t(((e, t) => {
668
821
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
669
822
  var n = {
670
823
  lessThanXSeconds: {
@@ -733,7 +886,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
733
886
  var i, a = n[e];
734
887
  return i = typeof a == "string" ? a : t === 1 ? a.one : a.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + i : i + " ago" : i;
735
888
  }, t.exports = e.default;
736
- })), ve = /* @__PURE__ */ t(((e, t) => {
889
+ })), he = /* @__PURE__ */ t(((e, t) => {
737
890
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
738
891
  function n(e) {
739
892
  return function() {
@@ -742,10 +895,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
742
895
  };
743
896
  }
744
897
  t.exports = e.default;
745
- })), V = /* @__PURE__ */ t(((e, t) => {
746
- var n = b().default;
898
+ })), ge = /* @__PURE__ */ t(((e, t) => {
899
+ var n = u().default;
747
900
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
748
- var r = n(ve());
901
+ var r = n(he());
749
902
  e.default = {
750
903
  date: (0, r.default)({
751
904
  formats: {
@@ -775,7 +928,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
775
928
  defaultWidth: "full"
776
929
  })
777
930
  }, t.exports = e.default;
778
- })), ye = /* @__PURE__ */ t(((e, t) => {
931
+ })), _e = /* @__PURE__ */ t(((e, t) => {
779
932
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
780
933
  var n = {
781
934
  lastWeek: "'last' eeee 'at' p",
@@ -788,7 +941,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
788
941
  e.default = function(e, t, r, i) {
789
942
  return n[e];
790
943
  }, t.exports = e.default;
791
- })), be = /* @__PURE__ */ t(((e, t) => {
944
+ })), ve = /* @__PURE__ */ t(((e, t) => {
792
945
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
793
946
  function n(e) {
794
947
  return function(t, n) {
@@ -805,10 +958,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
805
958
  };
806
959
  }
807
960
  t.exports = e.default;
808
- })), H = /* @__PURE__ */ t(((e, t) => {
809
- var n = b().default;
961
+ })), ye = /* @__PURE__ */ t(((e, t) => {
962
+ var n = u().default;
810
963
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
811
- var r = n(be());
964
+ var r = n(ve());
812
965
  e.default = {
813
966
  ordinalNumber: function(e, t) {
814
967
  var n = Number(e), r = n % 100;
@@ -1010,7 +1163,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
1010
1163
  defaultFormattingWidth: "wide"
1011
1164
  })
1012
1165
  }, t.exports = e.default;
1013
- })), xe = /* @__PURE__ */ t(((e, t) => {
1166
+ })), be = /* @__PURE__ */ t(((e, t) => {
1014
1167
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
1015
1168
  function n(e) {
1016
1169
  return function(t) {
@@ -1036,7 +1189,7 @@ var A = /* @__PURE__ */ t(((e, t) => {
1036
1189
  for (var n = 0; n < e.length; n++) if (t(e[n])) return n;
1037
1190
  }
1038
1191
  t.exports = e.default;
1039
- })), Se = /* @__PURE__ */ t(((e, t) => {
1192
+ })), xe = /* @__PURE__ */ t(((e, t) => {
1040
1193
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
1041
1194
  function n(e) {
1042
1195
  return function(t) {
@@ -1054,12 +1207,12 @@ var A = /* @__PURE__ */ t(((e, t) => {
1054
1207
  };
1055
1208
  }
1056
1209
  t.exports = e.default;
1057
- })), Ce = /* @__PURE__ */ t(((e, t) => {
1058
- var n = b().default;
1210
+ })), Se = /* @__PURE__ */ t(((e, t) => {
1211
+ var n = u().default;
1059
1212
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
1060
- var r = n(xe());
1213
+ var r = n(be());
1061
1214
  e.default = {
1062
- ordinalNumber: (0, n(Se()).default)({
1215
+ ordinalNumber: (0, n(xe()).default)({
1063
1216
  matchPattern: /^(\d+)(th|st|nd|rd)?/i,
1064
1217
  parsePattern: /\d+/i,
1065
1218
  valueCallback: function(e) {
@@ -1182,10 +1335,10 @@ var A = /* @__PURE__ */ t(((e, t) => {
1182
1335
  defaultParseWidth: "any"
1183
1336
  })
1184
1337
  }, t.exports = e.default;
1185
- })), we = /* @__PURE__ */ t(((e, t) => {
1186
- var n = b().default;
1338
+ })), Ce = /* @__PURE__ */ t(((e, t) => {
1339
+ var n = u().default;
1187
1340
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0;
1188
- var r = n(_e()), i = n(V()), a = n(ye()), o = n(H()), s = n(Ce());
1341
+ var r = n(me()), i = n(ge()), a = n(_e()), o = n(ye()), s = n(Se());
1189
1342
  e.default = {
1190
1343
  code: "en-US",
1191
1344
  formatDistance: r.default,
@@ -1198,145 +1351,145 @@ var A = /* @__PURE__ */ t(((e, t) => {
1198
1351
  firstWeekContainsDate: 1
1199
1352
  }
1200
1353
  }, t.exports = e.default;
1354
+ })), we = /* @__PURE__ */ t(((e, t) => {
1355
+ var n = u().default;
1356
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0, e.default = n(Ce()).default, t.exports = e.default;
1201
1357
  })), Te = /* @__PURE__ */ t(((e, t) => {
1202
- var n = b().default;
1203
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = void 0, e.default = n(we()).default, t.exports = e.default;
1204
- })), Ee = /* @__PURE__ */ t(((e, t) => {
1205
- var n = b().default;
1358
+ var n = u().default;
1206
1359
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = x;
1207
- var r = n(N()), i = n(ce()), a = n(M()), o = n(he()), s = n(ge()), c = n(h()), l = B(), u = n(C()), d = n(A()), f = R(), p = n(Te()), m = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, g = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, _ = /^'([^]*?)'?$/, v = /''/g, y = /[a-zA-Z]/;
1360
+ var r = n(ie()), i = n(oe()), a = n(L()), o = n(fe()), s = n(pe()), c = n(C()), l = G(), d = n(p()), f = n(F()), m = se(), h = n(we()), g = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, _ = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, v = /^'([^]*?)'?$/, y = /''/g, b = /[a-zA-Z]/;
1208
1361
  function x(e, t, n) {
1209
- var h, _;
1210
- (0, d.default)(2, arguments);
1211
- var v = String(t), b = (0, f.getDefaultOptions)(), x = n?.locale ?? b.locale ?? p.default, S = (0, u.default)(n?.firstWeekContainsDate ?? (n == null || (h = n.locale) == null ? void 0 : h.options?.firstWeekContainsDate) ?? b.firstWeekContainsDate ?? b.locale?.options?.firstWeekContainsDate ?? 1);
1212
- if (!(S >= 1 && S <= 7)) throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
1213
- var C = (0, u.default)(n?.weekStartsOn ?? (n == null || (_ = n.locale) == null ? void 0 : _.options?.weekStartsOn) ?? b.weekStartsOn ?? b.locale?.options?.weekStartsOn ?? 0);
1214
- if (!(C >= 0 && C <= 6)) throw RangeError("weekStartsOn must be between 0 and 6 inclusively");
1362
+ var u, p;
1363
+ (0, f.default)(2, arguments);
1364
+ var v = String(t), y = (0, m.getDefaultOptions)(), x = n?.locale ?? y.locale ?? h.default, C = (0, d.default)(n?.firstWeekContainsDate ?? (n == null || (u = n.locale) == null ? void 0 : u.options?.firstWeekContainsDate) ?? y.firstWeekContainsDate ?? y.locale?.options?.firstWeekContainsDate ?? 1);
1365
+ if (!(C >= 1 && C <= 7)) throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
1366
+ var w = (0, d.default)(n?.weekStartsOn ?? (n == null || (p = n.locale) == null ? void 0 : p.options?.weekStartsOn) ?? y.weekStartsOn ?? y.locale?.options?.weekStartsOn ?? 0);
1367
+ if (!(w >= 0 && w <= 6)) throw RangeError("weekStartsOn must be between 0 and 6 inclusively");
1215
1368
  if (!x.localize) throw RangeError("locale must contain localize property");
1216
1369
  if (!x.formatLong) throw RangeError("locale must contain formatLong property");
1217
- var w = (0, a.default)(e);
1218
- if (!(0, r.default)(w)) throw RangeError("Invalid time value");
1219
- var te = (0, c.default)(w), ne = (0, i.default)(w, te), re = {
1220
- firstWeekContainsDate: S,
1221
- weekStartsOn: C,
1370
+ var T = (0, a.default)(e);
1371
+ if (!(0, r.default)(T)) throw RangeError("Invalid time value");
1372
+ var E = (0, c.default)(T), ee = (0, i.default)(T, E), D = {
1373
+ firstWeekContainsDate: C,
1374
+ weekStartsOn: w,
1222
1375
  locale: x,
1223
- _originalDate: w
1376
+ _originalDate: T
1224
1377
  };
1225
- return v.match(g).map(function(e) {
1378
+ return v.match(_).map(function(e) {
1226
1379
  var t = e[0];
1227
1380
  if (t === "p" || t === "P") {
1228
1381
  var n = s.default[t];
1229
1382
  return n(e, x.formatLong);
1230
1383
  }
1231
1384
  return e;
1232
- }).join("").match(m).map(function(r) {
1385
+ }).join("").match(g).map(function(r) {
1233
1386
  if (r === "''") return "'";
1234
1387
  var i = r[0];
1235
- if (i === "'") return ee(r);
1388
+ if (i === "'") return S(r);
1236
1389
  var a = o.default[i];
1237
- if (a) return !(n != null && n.useAdditionalWeekYearTokens) && (0, l.isProtectedWeekYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), !(n != null && n.useAdditionalDayOfYearTokens) && (0, l.isProtectedDayOfYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), a(ne, r, x.localize, re);
1238
- if (i.match(y)) throw RangeError("Format string contains an unescaped latin alphabet character `" + i + "`");
1390
+ if (a) return !(n != null && n.useAdditionalWeekYearTokens) && (0, l.isProtectedWeekYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), !(n != null && n.useAdditionalDayOfYearTokens) && (0, l.isProtectedDayOfYearToken)(r) && (0, l.throwProtectedError)(r, t, String(e)), a(ee, r, x.localize, D);
1391
+ if (i.match(b)) throw RangeError("Format string contains an unescaped latin alphabet character `" + i + "`");
1239
1392
  return r;
1240
1393
  }).join("");
1241
1394
  }
1242
- function ee(e) {
1243
- var t = e.match(_);
1244
- return t ? t[1].replace(v, "'") : e;
1395
+ function S(e) {
1396
+ var t = e.match(v);
1397
+ return t ? t[1].replace(y, "'") : e;
1245
1398
  }
1246
1399
  t.exports = e.default;
1247
1400
  }));
1248
- function De(e, t, n) {
1249
- var r = Ae(e, n.timeZone, n.locale);
1250
- return r.formatToParts ? Oe(r, t) : ke(r, t);
1401
+ function Ee(e, t, n) {
1402
+ var r = ke(e, n.timeZone, n.locale);
1403
+ return r.formatToParts ? De(r, t) : Oe(r, t);
1251
1404
  }
1252
- function Oe(e, t) {
1405
+ function De(e, t) {
1253
1406
  for (var n = e.formatToParts(t), r = n.length - 1; r >= 0; --r) if (n[r].type === "timeZoneName") return n[r].value;
1254
1407
  }
1255
- function ke(e, t) {
1408
+ function Oe(e, t) {
1256
1409
  var n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1257
1410
  return r ? r[0].substr(1) : "";
1258
1411
  }
1259
- function Ae(e, t, n) {
1412
+ function ke(e, t, n) {
1260
1413
  if (n && !n.code) throw Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");
1261
1414
  return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1262
1415
  timeZone: t,
1263
1416
  timeZoneName: e
1264
1417
  });
1265
1418
  }
1266
- var je = 60 * 1e3, Me = {
1419
+ var Ae = 60 * 1e3, je = {
1267
1420
  X: function(e, t, n, r) {
1268
- var i = Ne(r.timeZone, e);
1421
+ var i = Me(r.timeZone, e);
1269
1422
  if (i === 0) return "Z";
1270
1423
  switch (t) {
1271
- case "X": return Ie(i);
1424
+ case "X": return Fe(i);
1272
1425
  case "XXXX":
1273
- case "XX": return Fe(i);
1274
- default: return Fe(i, ":");
1426
+ case "XX": return Pe(i);
1427
+ default: return Pe(i, ":");
1275
1428
  }
1276
1429
  },
1277
1430
  x: function(e, t, n, r) {
1278
- var i = Ne(r.timeZone, e);
1431
+ var i = Me(r.timeZone, e);
1279
1432
  switch (t) {
1280
- case "x": return Ie(i);
1433
+ case "x": return Fe(i);
1281
1434
  case "xxxx":
1282
- case "xx": return Fe(i);
1283
- default: return Fe(i, ":");
1435
+ case "xx": return Pe(i);
1436
+ default: return Pe(i, ":");
1284
1437
  }
1285
1438
  },
1286
1439
  O: function(e, t, n, r) {
1287
- var i = Ne(r.timeZone, e);
1440
+ var i = Me(r.timeZone, e);
1288
1441
  switch (t) {
1289
1442
  case "O":
1290
1443
  case "OO":
1291
- case "OOO": return "GMT" + Le(i, ":");
1292
- default: return "GMT" + Fe(i, ":");
1444
+ case "OOO": return "GMT" + Ie(i, ":");
1445
+ default: return "GMT" + Pe(i, ":");
1293
1446
  }
1294
1447
  },
1295
1448
  z: function(e, t, n, r) {
1296
1449
  switch (t) {
1297
1450
  case "z":
1298
1451
  case "zz":
1299
- case "zzz": return De("short", e, r);
1300
- default: return De("long", e, r);
1452
+ case "zzz": return Ee("short", e, r);
1453
+ default: return Ee("long", e, r);
1301
1454
  }
1302
1455
  }
1303
1456
  };
1304
- function Ne(e, t) {
1305
- var n = e ? l(e, t, !0) / je : t.getTimezoneOffset();
1457
+ function Me(e, t) {
1458
+ var n = e ? y(e, t, !0) / Ae : t.getTimezoneOffset();
1306
1459
  if (Number.isNaN(n)) throw RangeError("Invalid time zone specified: " + e);
1307
1460
  return n;
1308
1461
  }
1309
- function Pe(e, t) {
1462
+ function Ne(e, t) {
1310
1463
  for (var n = e < 0 ? "-" : "", r = Math.abs(e).toString(); r.length < t;) r = "0" + r;
1311
1464
  return n + r;
1312
1465
  }
1313
- function Fe(e, t) {
1314
- var n = t || "", r = e > 0 ? "-" : "+", i = Math.abs(e), a = Pe(Math.floor(i / 60), 2), o = Pe(Math.floor(i % 60), 2);
1466
+ function Pe(e, t) {
1467
+ var n = t || "", r = e > 0 ? "-" : "+", i = Math.abs(e), a = Ne(Math.floor(i / 60), 2), o = Ne(Math.floor(i % 60), 2);
1315
1468
  return r + a + n + o;
1316
1469
  }
1317
- function Ie(e, t) {
1318
- return e % 60 == 0 ? (e > 0 ? "-" : "+") + Pe(Math.abs(e) / 60, 2) : Fe(e, t);
1470
+ function Fe(e, t) {
1471
+ return e % 60 == 0 ? (e > 0 ? "-" : "+") + Ne(Math.abs(e) / 60, 2) : Pe(e, t);
1319
1472
  }
1320
- function Le(e, t) {
1473
+ function Ie(e, t) {
1321
1474
  var n = e > 0 ? "-" : "+", r = Math.abs(e), i = Math.floor(r / 60), a = r % 60;
1322
1475
  if (a === 0) return n + String(i);
1323
1476
  var o = t || "";
1324
- return n + String(i) + o + Pe(a, 2);
1477
+ return n + String(i) + o + Ne(a, 2);
1325
1478
  }
1326
- var Re = /* @__PURE__ */ e(Ee()), ze = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1327
- function Be(e, t, n) {
1328
- var r = String(t), i = n || {}, a = r.match(ze);
1479
+ var Le = /* @__PURE__ */ e(Te()), Re = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1480
+ function ze(e, t, n) {
1481
+ var r = String(t), i = n || {}, a = r.match(Re);
1329
1482
  if (a) {
1330
1483
  var o = d(i.originalDate || e, i);
1331
1484
  r = a.reduce(function(e, t) {
1332
1485
  if (t[0] === "'") return e;
1333
- var n = e.indexOf(t), r = e[n - 1] === "'", a = e.replace(t, "'" + Me[t[0]](o, t, null, i) + "'");
1486
+ var n = e.indexOf(t), r = e[n - 1] === "'", a = e.replace(t, "'" + je[t[0]](o, t, null, i) + "'");
1334
1487
  return r ? a.substring(0, n - 1) + a.substring(n + 1) : a;
1335
1488
  }, r);
1336
1489
  }
1337
- return (0, Re.default)(e, r, i);
1490
+ return (0, Le.default)(e, r, i);
1338
1491
  }
1339
- var Ve = /* @__PURE__ */ t(((e, t) => {
1492
+ var Be = /* @__PURE__ */ t(((e, t) => {
1340
1493
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n;
1341
1494
  function n(e, t) {
1342
1495
  if (e == null) throw TypeError("assign requires that input parameter not be null or undefined");
@@ -1344,68 +1497,68 @@ var Ve = /* @__PURE__ */ t(((e, t) => {
1344
1497
  return e;
1345
1498
  }
1346
1499
  t.exports = e.default;
1347
- })), He = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1348
- var n = b().default;
1500
+ })), Ve = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t) => {
1501
+ var n = u().default;
1349
1502
  Object.defineProperty(e, "__esModule", { value: !0 }), e.default = i;
1350
- var r = n(Ve());
1503
+ var r = n(Be());
1351
1504
  function i(e) {
1352
1505
  return (0, r.default)({}, e);
1353
1506
  }
1354
1507
  t.exports = e.default;
1355
1508
  })))());
1356
- function Ue(e, t, n, r) {
1357
- var i = (0, He.default)(r);
1358
- return i.timeZone = t, i.originalDate = e, Be(v(e, t), n, i);
1509
+ function He(e, t, n, r) {
1510
+ var i = (0, Ve.default)(r);
1511
+ return i.timeZone = t, i.originalDate = e, ze(g(e, t), n, i);
1359
1512
  }
1360
- function We(e, t, n) {
1361
- if (typeof e == "string" && !e.match(u)) {
1362
- var r = (0, He.default)(n);
1513
+ function Ue(e, t, n) {
1514
+ if (typeof e == "string" && !e.match(b)) {
1515
+ var r = (0, Ve.default)(n);
1363
1516
  return r.timeZone = t, d(e, r);
1364
1517
  }
1365
- var i = d(e, n), a = S(i.getFullYear(), i.getMonth(), i.getDate(), i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()).getTime(), o = l(t, new Date(a));
1518
+ var i = d(e, n), a = w(i.getFullYear(), i.getMonth(), i.getDate(), i.getHours(), i.getMinutes(), i.getSeconds(), i.getMilliseconds()).getTime(), o = y(t, new Date(a));
1366
1519
  return new Date(a + o);
1367
1520
  }
1368
- var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ge = (e) => G(e) && G(e.associativeListFilter), K = (e) => {
1369
- if (!G(e)) return;
1521
+ var K = E(), q = (e) => typeof e == "object" && !!e && !Array.isArray(e), We = (e) => q(e) && q(e.associativeListFilter), J = (e) => {
1522
+ if (!q(e)) return;
1370
1523
  if (typeof e.fieldKey == "string") return e.fieldKey;
1371
1524
  let t = e.field;
1372
- if (!(!G(t) || typeof t.name != "string" || typeof t.view != "string")) return `[${t.view}].[${t.name}]`;
1373
- }, Ke = (e) => {
1374
- if (Ge(e)) return JSON.stringify(["associative", K(e) ?? ""]);
1375
- let t = G(e) ? e : {};
1525
+ if (!(!q(t) || typeof t.name != "string" || typeof t.view != "string")) return `[${t.view}].[${t.name}]`;
1526
+ }, Ge = (e) => {
1527
+ if (We(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1528
+ let t = q(e) ? e : {};
1376
1529
  return JSON.stringify([
1377
1530
  "value",
1378
- K(e) ?? "",
1531
+ J(e) ?? "",
1379
1532
  t.dateLevel ?? null,
1380
1533
  t.datePart ?? null,
1381
1534
  t.operator
1382
1535
  ]);
1383
- }, q = (e) => {
1384
- if (Ge(e)) return JSON.stringify(["associative", K(e) ?? ""]);
1385
- let t = G(e) ? e : {};
1536
+ }, Y = (e) => {
1537
+ if (We(e)) return JSON.stringify(["associative", J(e) ?? ""]);
1538
+ let t = q(e) ? e : {};
1386
1539
  return JSON.stringify([
1387
1540
  "value",
1388
- K(e) ?? "",
1541
+ J(e) ?? "",
1389
1542
  t.dateLevel ?? null,
1390
1543
  t.datePart ?? null
1391
1544
  ]);
1392
- }, qe = (e) => {
1393
- let t = G(e) ? e : {};
1545
+ }, Ke = (e) => {
1546
+ let t = q(e) ? e : {};
1394
1547
  return {
1395
1548
  applied: $e(t.applied),
1396
1549
  pending: $e(t.pending)
1397
1550
  };
1398
- }, Je = (e) => {
1551
+ }, qe = (e) => {
1399
1552
  let t = /* @__PURE__ */ new Map();
1400
1553
  for (let n of e.applied) {
1401
- let e = Ke(n);
1554
+ let e = Ge(n);
1402
1555
  t.set(e, {
1403
1556
  identity: e,
1404
1557
  applied: n
1405
1558
  });
1406
1559
  }
1407
1560
  for (let n of e.pending) {
1408
- let e = Ke(n), r = t.get(e);
1561
+ let e = Ge(n), r = t.get(e);
1409
1562
  t.set(e, {
1410
1563
  ...r,
1411
1564
  identity: e,
@@ -1413,7 +1566,7 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1413
1566
  });
1414
1567
  }
1415
1568
  return [...t.values()];
1416
- }, Ye = (e) => Je(e).flatMap(({ identity: e, applied: t, pending: n }) => {
1569
+ }, Je = (e) => qe(e).flatMap(({ identity: e, applied: t, pending: n }) => {
1417
1570
  let r = n ?? t;
1418
1571
  return r ? [{
1419
1572
  id: e,
@@ -1421,31 +1574,31 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1421
1574
  applied: t,
1422
1575
  pending: n
1423
1576
  }] : [];
1424
- }), Xe = (e, t = (e) => e === null ? "∅" : String(e)) => {
1425
- if (Ge(e)) return {
1577
+ }), Ye = (e, t = (e) => e === null ? "∅" : String(e)) => {
1578
+ if (We(e)) return {
1426
1579
  isAssociative: !0,
1427
1580
  isEmpty: !nt(e.associativeListFilter),
1428
1581
  valueCount: 0,
1429
1582
  text: "Related records"
1430
1583
  };
1431
- let n = Array.isArray(e.values) ? e.values : [], r = ut(e), i = n.length, a = e.operator === W.FilterOperator.Set || e.operator === W.FilterOperator.NotSet, o = n.slice(0, 3).map((e) => G(e) ? typeof e.dataType == "string" ? `${e.dataType} filter` : "Value" : t(e));
1584
+ let n = Array.isArray(e.values) ? e.values : [], r = ut(e), i = n.length, a = e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet, o = n.slice(0, 3).map((e) => q(e) ? typeof e.dataType == "string" ? `${e.dataType} filter` : "Value" : t(e));
1432
1585
  return {
1433
1586
  isAssociative: !1,
1434
1587
  isEmpty: !r && !a && i === 0,
1435
1588
  valueCount: i,
1436
1589
  text: a ? "Has value" : r ? "Dynamic date" : `${o.join(", ")}${i > 3 ? ` +${i - 3}` : ""}`
1437
1590
  };
1438
- }, Ze = (e) => Ge(e) ? nt(e.associativeListFilter) : e.operator === W.FilterOperator.Set || e.operator === W.FilterOperator.NotSet || ut(e) ? !0 : !Array.isArray(e.values) || e.values.length === 0 ? !1 : e.operator === W.FilterOperator.Between || e.operator === W.FilterOperator.NotBetween ? e.values.length === 2 && st(e.values[0]) && st(e.values[1]) : e.operator === W.FilterOperator.Like || e.operator === W.FilterOperator.NotLike ? e.values.length === 1 && typeof e.values[0] == "string" && e.values[0].trim().length > 0 : [W.FilterOperator.InList, W.FilterOperator.NotInList].includes(e.operator) ? e.values.every(ot) : e.operator === W.FilterOperator.GeoIntersect ? e.values.length === 1 && ct(e.values[0]) : e.values.length === 1 && ot(e.values[0]), J = Ze, Qe = Xe, $e = (e) => Array.isArray(e) ? e.flatMap((e) => {
1439
- if (!G(e)) return [];
1440
- if (G(e.associativeListFilter)) {
1441
- let t = K(e);
1591
+ }, Xe = (e) => We(e) ? nt(e.associativeListFilter) : e.operator === K.FilterOperator.Set || e.operator === K.FilterOperator.NotSet || ut(e) ? !0 : !Array.isArray(e.values) || e.values.length === 0 ? !1 : e.operator === K.FilterOperator.Between || e.operator === K.FilterOperator.NotBetween ? e.values.length === 2 && st(e.values[0]) && st(e.values[1]) : e.operator === K.FilterOperator.Like || e.operator === K.FilterOperator.NotLike ? e.values.length === 1 && typeof e.values[0] == "string" && e.values[0].trim().length > 0 : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) ? e.values.every(ot) : e.operator === K.FilterOperator.GeoIntersect ? e.values.length === 1 && ct(e.values[0]) : e.values.length === 1 && ot(e.values[0]), Ze = Xe, Qe = Ye, $e = (e) => Array.isArray(e) ? e.flatMap((e) => {
1592
+ if (!q(e)) return [];
1593
+ if (q(e.associativeListFilter)) {
1594
+ let t = J(e);
1442
1595
  return t ? [{
1443
1596
  ...e,
1444
1597
  fieldKey: t,
1445
1598
  associativeListFilter: tt(e.associativeListFilter)
1446
1599
  }] : [];
1447
1600
  }
1448
- let t = K(e);
1601
+ let t = J(e);
1449
1602
  if (!t || typeof e.operator != "string") return [];
1450
1603
  let n = {
1451
1604
  ...e,
@@ -1454,22 +1607,22 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1454
1607
  return Array.isArray(e.values) && (n.values = e.values.map(et)), [n];
1455
1608
  }) : [], et = (e) => {
1456
1609
  if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
1457
- if (!G(e) || e.isNull === !0 || "value" in e && e.value === null) return null;
1610
+ if (!q(e) || e.isNull === !0 || "value" in e && e.value === null) return null;
1458
1611
  if ("value" in e && (typeof e.value == "string" || typeof e.value == "number" || typeof e.value == "boolean")) return e.value;
1459
1612
  let t = e;
1460
1613
  return "valueBoolean" in t && t.valueBoolean !== void 0 ? t.valueBoolean : "valueInt" in t && t.valueInt !== void 0 ? t.valueInt : "valueFloat" in t && t.valueFloat !== void 0 ? t.valueFloat : "valueMillisec" in t && t.valueMillisec !== void 0 ? t.valueMillisec : "valueString" in t && t.valueString !== void 0 ? t.valueString : "valueDate" in t && t.valueDate !== void 0 ? t.valueDate : "valueTime" in t && t.valueTime !== void 0 ? t.valueTime : "valueTimeTZ" in t && t.valueTimeTZ !== void 0 ? t.valueTimeTZ : "valueDatetime" in t && t.valueDatetime !== void 0 ? t.valueDatetime : "valueDatetimeTZ" in t && t.valueDatetimeTZ !== void 0 ? t.valueDatetimeTZ : typeof e.dataType == "string" ? e : null;
1461
1614
  }, tt = (e) => {
1462
- let t = (e) => !G(e) || !G(e.filterGroup) ? e : {
1615
+ let t = (e) => !q(e) || !q(e.filterGroup) ? e : {
1463
1616
  ...e,
1464
1617
  filterGroup: n(e.filterGroup)
1465
1618
  }, n = (e) => ({
1466
1619
  ...e,
1467
1620
  ...Array.isArray(e.filters) ? { filters: e.filters.map((e) => {
1468
- if (!G(e)) return e;
1621
+ if (!q(e)) return e;
1469
1622
  let t = { ...e };
1470
1623
  return Array.isArray(e.values) && (t.values = e.values.map(et)), t;
1471
1624
  }) } : {},
1472
- ...Array.isArray(e.filterGroups) ? { filterGroups: e.filterGroups.map((e) => G(e) ? n(e) : e) } : {}
1625
+ ...Array.isArray(e.filterGroups) ? { filterGroups: e.filterGroups.map((e) => q(e) ? n(e) : e) } : {}
1473
1626
  });
1474
1627
  return {
1475
1628
  ...e,
@@ -1477,13 +1630,13 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1477
1630
  ...Array.isArray(e.unionFilters) ? { unionFilters: e.unionFilters.map(t) } : {}
1478
1631
  };
1479
1632
  }, nt = (e) => {
1480
- if (!G(e) || typeof e.view != "string") return !1;
1633
+ if (!q(e) || typeof e.view != "string") return !1;
1481
1634
  let t = [e.intersectFilters, e.unionFilters].filter(Array.isArray).flatMap((e) => e);
1482
1635
  return t.length > 0 && t.every(rt);
1483
- }, rt = (e) => !G(e) || !G(e.filterGroup) ? !1 : it(e.filterGroup), it = (e) => {
1636
+ }, rt = (e) => !q(e) || !q(e.filterGroup) ? !1 : it(e.filterGroup), it = (e) => {
1484
1637
  let t = Array.isArray(e.filters) ? e.filters : [], n = Array.isArray(e.filterGroups) ? e.filterGroups : [], r = [...t, ...n];
1485
1638
  return r.length > 0 && r.every(at);
1486
- }, at = (e) => G(e) ? G(e.filterGroup) ? it(e.filterGroup) : Array.isArray(e.filters) || Array.isArray(e.filterGroups) ? it(e) : typeof e.fieldKey == "string" && typeof e.operator == "string" && Ze(e) : !1, ot = (e) => e === null || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : typeof e == "string" ? e.trim().length > 0 : G(e) && typeof e.dataType == "string", st = (e) => e !== null && ot(e), ct = (e) => G(e) && e.dataType === "geography" && lt(e.valueGeoMinPoint) && lt(e.valueGeoMaxPoint), lt = (e) => {
1639
+ }, at = (e) => q(e) ? q(e.filterGroup) ? it(e.filterGroup) : Array.isArray(e.filters) || Array.isArray(e.filterGroups) ? it(e) : typeof e.fieldKey == "string" && typeof e.operator == "string" && Xe(e) : !1, ot = (e) => e === null || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : typeof e == "string" ? e.trim().length > 0 : q(e) && typeof e.dataType == "string", st = (e) => e !== null && ot(e), ct = (e) => q(e) && e.dataType === "geography" && lt(e.valueGeoMinPoint) && lt(e.valueGeoMaxPoint), lt = (e) => {
1487
1640
  if (typeof e != "string") return !1;
1488
1641
  let t = e.trim().split(/[ ,]+/).map(Number);
1489
1642
  if (t.length !== 2 || !t.every(Number.isFinite)) return !1;
@@ -1504,50 +1657,50 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1504
1657
  let r = e.dynamicDateRange;
1505
1658
  if (r && Number.isFinite(r.offsetBegin) && Number.isFinite(r.offsetEnd) && t.includes(r.part)) return !0;
1506
1659
  let i = e.dynamicDateCalc;
1507
- if (i && Object.values(W.DynamicDateCalcType).includes(i.type)) return !0;
1660
+ if (i && Object.values(K.DynamicDateCalcType).includes(i.type)) return !0;
1508
1661
  let a = e.dynamicDateCalcRange;
1509
- return !!(a && Object.values(W.DynamicDateCalcRangeType).includes(a.type));
1510
- }, dt = (e) => e.dataType === W.FieldType.GEOGRAPHY ? {
1662
+ return !!(a && Object.values(K.DynamicDateCalcRangeType).includes(a.type));
1663
+ }, dt = (e) => e.dataType === K.FieldType.GEOGRAPHY ? {
1511
1664
  fieldKey: e.key,
1512
- operator: W.FilterOperator.GeoIntersect,
1665
+ operator: K.FilterOperator.GeoIntersect,
1513
1666
  values: [{
1514
- dataType: W.FilterValueDataType.Geography,
1667
+ dataType: K.FilterValueDataType.Geography,
1515
1668
  valueGeoMinPoint: "",
1516
1669
  valueGeoMaxPoint: ""
1517
1670
  }]
1518
1671
  } : {
1519
1672
  fieldKey: e.key,
1520
- operator: W.FilterOperator.InList,
1673
+ operator: K.FilterOperator.InList,
1521
1674
  values: []
1522
1675
  }, ft = (e, t) => t ? [e[0] ?? null] : [e[0] ?? null, e[1] ?? null], pt = (e, t) => {
1523
1676
  let n = typeof e == "string" && /\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?\s*(?:Z|[+-]\d{2}(?::?\d{2})?)$/i.test(e);
1524
- return typeof e == "string" && !n ? We(e.replace(" ", "T"), t) : new Date(e);
1677
+ return typeof e == "string" && !n ? Ue(e.replace(" ", "T"), t) : new Date(e);
1525
1678
  }, mt = (e, t, n) => {
1526
1679
  if (e == null || e === "" || typeof e != "number" && typeof e != "string") return "";
1527
- if (t === W.FieldType.TIME) {
1680
+ if (t === K.FieldType.TIME) {
1528
1681
  let t = typeof e == "string" && /^(\d{1,2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e), n = typeof e == "number" ? e : t ? (Number(t[1]) * 3600 + Number(t[2]) * 60 + Number(t[3] ?? 0)) * 1e3 + Number((t[4] ?? "").padEnd(3, "0")) : Date.parse(String(e));
1529
1682
  if (!Number.isFinite(n)) return "";
1530
1683
  let r = Math.max(0, Math.floor(n)), i = Math.floor(r / 1e3);
1531
1684
  return `${String(Math.floor(i / 3600) % 24).padStart(2, "0")}:${String(Math.floor(i % 3600 / 60)).padStart(2, "0")}:${String(i % 60).padStart(2, "0")}.${String(r % 1e3).padStart(3, "0")}`;
1532
1685
  }
1533
- if (t === W.FieldType.DATE) {
1686
+ if (t === K.FieldType.DATE) {
1534
1687
  let t = new Date(typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T00:00:00.000Z` : e);
1535
1688
  return Number.isFinite(t.getTime()) ? t.toISOString().slice(0, 10) : "";
1536
1689
  }
1537
1690
  let r = pt(e, n);
1538
- return Number.isFinite(r.getTime()) ? Ue(r, n, "yyyy-MM-dd'T'HH:mm:ss.SSS") : "";
1691
+ return Number.isFinite(r.getTime()) ? He(r, n, "yyyy-MM-dd'T'HH:mm:ss.SSS") : "";
1539
1692
  }, ht = (e, t, n) => {
1540
1693
  if (!e) return null;
1541
- if (t === W.FieldType.TIME) {
1694
+ if (t === K.FieldType.TIME) {
1542
1695
  let [t = "0", n = "0", r = "0"] = e.split(":"), [i = "0", a = "0"] = r.split(".");
1543
1696
  return (Number(t) * 3600 + Number(n) * 60 + Number(i)) * 1e3 + Number(a.padEnd(3, "0").slice(0, 3));
1544
1697
  }
1545
- if (t === W.FieldType.DATE) {
1698
+ if (t === K.FieldType.DATE) {
1546
1699
  let t = /* @__PURE__ */ new Date(`${e}T00:00:00.000Z`);
1547
1700
  return Number.isFinite(t.getTime()) ? t.getTime() : null;
1548
1701
  }
1549
1702
  try {
1550
- return We(e, n).getTime();
1703
+ return Ue(e, n).getTime();
1551
1704
  } catch {
1552
1705
  return null;
1553
1706
  }
@@ -1556,9 +1709,9 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1556
1709
  if (typeof e != "number" && (typeof e != "string" || !e.trim())) return [];
1557
1710
  let r;
1558
1711
  if (typeof e == "number") r = e;
1559
- else if (t === W.FieldType.DATE) r = Date.parse(e);
1560
- else if (t === W.FieldType.TIMESTAMP || t === W.FieldType.TIMESTAMP_TZ) r = pt(e, n).getTime();
1561
- else if (t === W.FieldType.TIME) {
1712
+ else if (t === K.FieldType.DATE) r = Date.parse(e);
1713
+ else if (t === K.FieldType.TIMESTAMP || t === K.FieldType.TIMESTAMP_TZ) r = pt(e, n).getTime();
1714
+ else if (t === K.FieldType.TIME) {
1562
1715
  let i = ht(mt(e, t, n), t, n);
1563
1716
  r = typeof i == "number" ? i : NaN;
1564
1717
  } else r = Number(e);
@@ -1569,78 +1722,78 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1569
1722
  }).sort((e, t) => e.order - t.order);
1570
1723
  return r.length ? [r[0].value, r[r.length - 1].value] : [];
1571
1724
  }, _t = (e) => [
1572
- W.FieldType.INT,
1573
- W.FieldType.REAL,
1574
- W.FieldType.FLOAT,
1575
- W.FieldType.DECIMAL
1576
- ].includes(e), Y = (e) => [
1577
- W.FieldType.DATE,
1578
- W.FieldType.TIME,
1579
- W.FieldType.TIMESTAMP,
1580
- W.FieldType.TIMESTAMP_TZ
1581
- ].includes(e), vt = (e, t) => t.operator === W.FilterOperator.GeoIntersect ? "geo" : [W.FilterOperator.Set, W.FilterOperator.NotSet].includes(t.operator) ? "null" : [W.FilterOperator.Contains, W.FilterOperator.NotContains].includes(t.operator) ? "text" : Y(e) && (t.dynamicDate || t.dynamicDateCalc || [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(t.operator)) ? "date" : t.operator === W.FilterOperator.Like || t.operator === W.FilterOperator.NotLike ? "text" : t.operator === W.FilterOperator.Between || t.operator === W.FilterOperator.NotBetween || t.dynamicDateRange || t.dynamicDateCalcRange ? Y(e) ? "date" : "range" : [W.FilterOperator.InList, W.FilterOperator.NotInList].includes(t.operator) ? "list" : [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(t.operator) && Y(e) ? "date" : "scalar", yt = (e) => {
1582
- if (e === W.FieldType.GEOGRAPHY) return [W.FilterOperator.GeoIntersect];
1583
- if (e === W.FieldType.BOOLEAN) return [
1584
- W.FilterOperator.Equals,
1585
- W.FilterOperator.NotEquals,
1586
- W.FilterOperator.Set,
1587
- W.FilterOperator.NotSet
1725
+ K.FieldType.INT,
1726
+ K.FieldType.REAL,
1727
+ K.FieldType.FLOAT,
1728
+ K.FieldType.DECIMAL
1729
+ ].includes(e), X = (e) => [
1730
+ K.FieldType.DATE,
1731
+ K.FieldType.TIME,
1732
+ K.FieldType.TIMESTAMP,
1733
+ K.FieldType.TIMESTAMP_TZ
1734
+ ].includes(e), vt = (e, t) => t.operator === K.FilterOperator.GeoIntersect ? "geo" : [K.FilterOperator.Set, K.FilterOperator.NotSet].includes(t.operator) ? "null" : [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator) ? "text" : X(e) && (t.dynamicDate || t.dynamicDateCalc || [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator)) ? "date" : t.operator === K.FilterOperator.Like || t.operator === K.FilterOperator.NotLike ? "text" : t.operator === K.FilterOperator.Between || t.operator === K.FilterOperator.NotBetween || t.dynamicDateRange || t.dynamicDateCalcRange ? X(e) ? "date" : "range" : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(t.operator) ? "list" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator) && X(e) ? "date" : "scalar", yt = (e) => {
1735
+ if (e === K.FieldType.GEOGRAPHY) return [K.FilterOperator.GeoIntersect];
1736
+ if (e === K.FieldType.BOOLEAN) return [
1737
+ K.FilterOperator.Equals,
1738
+ K.FilterOperator.NotEquals,
1739
+ K.FilterOperator.Set,
1740
+ K.FilterOperator.NotSet
1588
1741
  ];
1589
1742
  let t = [
1590
- W.FilterOperator.Equals,
1591
- W.FilterOperator.NotEquals,
1592
- W.FilterOperator.InList,
1593
- W.FilterOperator.NotInList,
1594
- W.FilterOperator.Set,
1595
- W.FilterOperator.NotSet
1743
+ K.FilterOperator.Equals,
1744
+ K.FilterOperator.NotEquals,
1745
+ K.FilterOperator.InList,
1746
+ K.FilterOperator.NotInList,
1747
+ K.FilterOperator.Set,
1748
+ K.FilterOperator.NotSet
1596
1749
  ];
1597
- return _t(e) || Y(e) ? [
1750
+ return _t(e) || X(e) ? [
1598
1751
  ...t,
1599
- W.FilterOperator.GT,
1600
- W.FilterOperator.GTE,
1601
- W.FilterOperator.LT,
1602
- W.FilterOperator.LTE,
1603
- W.FilterOperator.Between,
1604
- W.FilterOperator.NotBetween
1752
+ K.FilterOperator.GT,
1753
+ K.FilterOperator.GTE,
1754
+ K.FilterOperator.LT,
1755
+ K.FilterOperator.LTE,
1756
+ K.FilterOperator.Between,
1757
+ K.FilterOperator.NotBetween
1605
1758
  ] : [
1606
1759
  ...t,
1607
- W.FilterOperator.Like,
1608
- W.FilterOperator.NotLike,
1609
- W.FilterOperator.Contains,
1610
- W.FilterOperator.NotContains
1760
+ K.FilterOperator.Like,
1761
+ K.FilterOperator.NotLike,
1762
+ K.FilterOperator.Contains,
1763
+ K.FilterOperator.NotContains
1611
1764
  ];
1612
- }, X = (e) => {
1765
+ }, Z = (e) => {
1613
1766
  let t = { ...e };
1614
1767
  return delete t.dynamicDate, delete t.dynamicDateCalc, delete t.dynamicDateRange, delete t.dynamicDateCalcRange, t;
1615
1768
  }, bt = (e, t) => ({
1616
- ...X(e),
1769
+ ...Z(e),
1617
1770
  values: t
1618
- }), Z = (e) => Array.isArray(e.values) ? e.values : [], Q = (e) => `${typeof e}:${typeof e == "object" && e ? JSON.stringify(e) : String(e)}`, xt = (e) => Array.isArray(e.data) ? e.data.map((e) => e[0]) : Object.values(e.data).map((e) => e[0]), St = (e, t, n) => {
1619
- let r = [W.FilterOperator.Contains, W.FilterOperator.NotContains].includes(t.operator), i = [W.FilterOperator.Like, W.FilterOperator.NotLike].includes(t.operator);
1771
+ }), Q = (e) => Array.isArray(e.values) ? e.values : [], $ = (e) => `${typeof e}:${typeof e == "object" && e ? JSON.stringify(e) : String(e)}`, xt = (e) => Array.isArray(e.data) ? e.data.map((e) => e[0]) : Object.values(e.data).map((e) => e[0]), St = (e, t, n) => {
1772
+ let r = [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator), i = [K.FilterOperator.Like, K.FilterOperator.NotLike].includes(t.operator);
1620
1773
  if (!(!r && !i)) return {
1621
1774
  dimensions: [{ fieldKey: e }],
1622
1775
  measures: [],
1623
1776
  filters: [{
1624
1777
  fieldKey: e,
1625
- operator: r ? W.FilterOperator.Contains : W.FilterOperator.Like,
1626
- values: [String(Z(t)[0] ?? "").trim()],
1778
+ operator: r ? K.FilterOperator.Contains : K.FilterOperator.Like,
1779
+ values: [String(Q(t)[0] ?? "").trim()],
1627
1780
  dateLevel: t.dateLevel,
1628
1781
  datePart: t.datePart
1629
1782
  }],
1630
1783
  limit: n
1631
1784
  };
1632
- }, Ct = (e) => e === W.FieldType.DATE ? "date" : e === W.FieldType.TIME ? "time" : "datetime-local", wt = (e) => e.dynamicDateCalcRange ? "preset" : e.dynamicDateRange ? "relative" : e.dynamicDateCalc ? "dynamic-calc" : e.dynamicDate ? "dynamic" : [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(e.operator) ? "single" : "fixed", Tt = (e, t) => {
1633
- let n = X(e), r = [W.FilterOperator.NotEquals, W.FilterOperator.NotBetween].includes(e.operator), i = [
1634
- W.FilterOperator.Equals,
1635
- W.FilterOperator.NotEquals,
1636
- W.FilterOperator.GT,
1637
- W.FilterOperator.GTE,
1638
- W.FilterOperator.LT,
1639
- W.FilterOperator.LTE
1640
- ].includes(e.operator) ? e.operator : r ? W.FilterOperator.NotEquals : W.FilterOperator.Equals;
1785
+ }, Ct = (e) => e === K.FieldType.DATE ? "date" : e === K.FieldType.TIME ? "time" : "datetime-local", wt = (e) => e.dynamicDateCalcRange ? "preset" : e.dynamicDateRange ? "relative" : e.dynamicDateCalc ? "dynamic-calc" : e.dynamicDate ? "dynamic" : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(e.operator) ? "single" : "fixed", Tt = (e, t) => {
1786
+ let n = Z(e), r = [K.FilterOperator.NotEquals, K.FilterOperator.NotBetween].includes(e.operator), i = [
1787
+ K.FilterOperator.Equals,
1788
+ K.FilterOperator.NotEquals,
1789
+ K.FilterOperator.GT,
1790
+ K.FilterOperator.GTE,
1791
+ K.FilterOperator.LT,
1792
+ K.FilterOperator.LTE
1793
+ ].includes(e.operator) ? e.operator : r ? K.FilterOperator.NotEquals : K.FilterOperator.Equals;
1641
1794
  return t === "single" ? {
1642
1795
  ...n,
1643
- operator: r ? W.FilterOperator.NotEquals : W.FilterOperator.Equals,
1796
+ operator: r ? K.FilterOperator.NotEquals : K.FilterOperator.Equals,
1644
1797
  values: [null]
1645
1798
  } : t === "dynamic" ? {
1646
1799
  ...n,
@@ -1654,15 +1807,15 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1654
1807
  ...n,
1655
1808
  operator: i,
1656
1809
  values: [],
1657
- dynamicDateCalc: { type: W.DynamicDateCalcType.Today }
1810
+ dynamicDateCalc: { type: K.DynamicDateCalcType.Today }
1658
1811
  } : t === "preset" ? {
1659
1812
  ...n,
1660
- operator: r ? W.FilterOperator.NotBetween : W.FilterOperator.Between,
1813
+ operator: r ? K.FilterOperator.NotBetween : K.FilterOperator.Between,
1661
1814
  values: [],
1662
- dynamicDateCalcRange: { type: W.DynamicDateCalcRangeType.Today }
1815
+ dynamicDateCalcRange: { type: K.DynamicDateCalcRangeType.Today }
1663
1816
  } : t === "relative" ? {
1664
1817
  ...n,
1665
- operator: r ? W.FilterOperator.NotBetween : W.FilterOperator.Between,
1818
+ operator: r ? K.FilterOperator.NotBetween : K.FilterOperator.Between,
1666
1819
  values: [],
1667
1820
  dynamicDateRange: {
1668
1821
  offsetBegin: 0,
@@ -1671,44 +1824,44 @@ var U = /* @__PURE__ */ e(f()), W = r(), G = (e) => typeof e == "object" && !!e
1671
1824
  }
1672
1825
  } : {
1673
1826
  ...n,
1674
- operator: r ? W.FilterOperator.NotBetween : W.FilterOperator.Between,
1827
+ operator: r ? K.FilterOperator.NotBetween : K.FilterOperator.Between,
1675
1828
  values: [null, null]
1676
1829
  };
1677
- }, $ = w();
1830
+ };
1678
1831
  function Et({ filter: e, disabledControls: t, update: n }) {
1679
- let r = Z(e), i = r[0], a = (i?.valueGeoMinPoint ?? "").split(/[ ,]+/), o = (i?.valueGeoMaxPoint ?? "").split(/[ ,]+/), s = (t, i, s) => {
1832
+ let r = Q(e), i = r[0], a = (i?.valueGeoMinPoint ?? "").split(/[ ,]+/), o = (i?.valueGeoMaxPoint ?? "").split(/[ ,]+/), s = (t, i, s) => {
1680
1833
  let c = t === "min" ? a : o;
1681
1834
  c[i] = s;
1682
1835
  let l = `${c[0] ?? ""} ${c[1] ?? ""}`.trim(), u = r[0], d = {
1683
1836
  ...u && typeof u == "object" ? u : {},
1684
- dataType: W.FilterValueDataType.Geography,
1837
+ dataType: K.FilterValueDataType.Geography,
1685
1838
  [t === "min" ? "valueGeoMinPoint" : "valueGeoMaxPoint"]: l
1686
1839
  };
1687
1840
  n({
1688
1841
  ...e,
1689
- operator: W.FilterOperator.GeoIntersect,
1842
+ operator: K.FilterOperator.GeoIntersect,
1690
1843
  values: [d]
1691
1844
  });
1692
1845
  };
1693
- return /* @__PURE__ */ (0, $.jsx)("div", {
1846
+ return /* @__PURE__ */ (0, k.jsx)("div", {
1694
1847
  className: "astrato-app-filter-bar__fieldset",
1695
1848
  "aria-label": "Geographic bounding box",
1696
1849
  children: ["min", "max"].map((e) => {
1697
1850
  let n = e === "min" ? a : o;
1698
- return /* @__PURE__ */ (0, $.jsxs)("div", {
1851
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
1699
1852
  className: "astrato-app-filter-bar__row",
1700
- children: [/* @__PURE__ */ (0, $.jsxs)("label", {
1853
+ children: [/* @__PURE__ */ (0, k.jsxs)("label", {
1701
1854
  className: "astrato-app-filter-bar__label",
1702
- children: [e === "min" ? "Minimum longitude" : "Maximum longitude", /* @__PURE__ */ (0, $.jsx)(E, {
1855
+ children: [e === "min" ? "Minimum longitude" : "Maximum longitude", /* @__PURE__ */ (0, k.jsx)(j, {
1703
1856
  className: "astrato-app-filter-bar__control",
1704
1857
  type: "number",
1705
1858
  value: n[0] ?? "",
1706
1859
  disabled: t,
1707
1860
  onChange: (t) => s(e, 0, t.currentTarget.value)
1708
1861
  })]
1709
- }), /* @__PURE__ */ (0, $.jsxs)("label", {
1862
+ }), /* @__PURE__ */ (0, k.jsxs)("label", {
1710
1863
  className: "astrato-app-filter-bar__label",
1711
- children: [e === "min" ? "Minimum latitude" : "Maximum latitude", /* @__PURE__ */ (0, $.jsx)(E, {
1864
+ children: [e === "min" ? "Minimum latitude" : "Maximum latitude", /* @__PURE__ */ (0, k.jsx)(j, {
1712
1865
  className: "astrato-app-filter-bar__control",
1713
1866
  type: "number",
1714
1867
  value: n[1] ?? "",
@@ -1720,12 +1873,12 @@ function Et({ filter: e, disabledControls: t, update: n }) {
1720
1873
  })
1721
1874
  });
1722
1875
  }
1723
- var Dt = Object.values(W.DynamicDateCalcRangeType).map((e) => ({
1876
+ var Dt = Object.values(K.DynamicDateCalcRangeType).map((e) => ({
1724
1877
  value: e,
1725
- label: i[e] ?? e
1726
- })), Ot = Object.values(W.DynamicDateCalcType).map((e) => ({
1878
+ label: o[e] ?? e
1879
+ })), Ot = Object.values(K.DynamicDateCalcType).map((e) => ({
1727
1880
  value: e,
1728
- label: i[e] ?? e
1881
+ label: o[e] ?? e
1729
1882
  })), kt = [
1730
1883
  {
1731
1884
  value: "list",
@@ -1763,33 +1916,33 @@ var Dt = Object.values(W.DynamicDateCalcRangeType).map((e) => ({
1763
1916
  icon: "geography"
1764
1917
  }
1765
1918
  ], At = {
1766
- [W.FilterOperator.Equals]: "Equals",
1767
- [W.FilterOperator.NotEquals]: "Does not equal",
1768
- [W.FilterOperator.InList]: "In list",
1769
- [W.FilterOperator.NotInList]: "Excluded from list",
1770
- [W.FilterOperator.GT]: "Greater than",
1771
- [W.FilterOperator.GTE]: "Greater than or equal",
1772
- [W.FilterOperator.LT]: "Less than",
1773
- [W.FilterOperator.LTE]: "Less than or equal",
1774
- [W.FilterOperator.Set]: "Is set",
1775
- [W.FilterOperator.NotSet]: "Is not set",
1776
- [W.FilterOperator.Between]: "Between",
1777
- [W.FilterOperator.NotBetween]: "Not between",
1778
- [W.FilterOperator.Like]: "Like",
1779
- [W.FilterOperator.NotLike]: "Not like",
1780
- [W.FilterOperator.Contains]: "Contains",
1781
- [W.FilterOperator.NotContains]: "Does not contain",
1782
- [W.FilterOperator.GeoIntersect]: "Intersects bounding box"
1919
+ [K.FilterOperator.Equals]: "Equals",
1920
+ [K.FilterOperator.NotEquals]: "Does not equal",
1921
+ [K.FilterOperator.InList]: "In list",
1922
+ [K.FilterOperator.NotInList]: "Excluded from list",
1923
+ [K.FilterOperator.GT]: "Greater than",
1924
+ [K.FilterOperator.GTE]: "Greater than or equal",
1925
+ [K.FilterOperator.LT]: "Less than",
1926
+ [K.FilterOperator.LTE]: "Less than or equal",
1927
+ [K.FilterOperator.Set]: "Is set",
1928
+ [K.FilterOperator.NotSet]: "Is not set",
1929
+ [K.FilterOperator.Between]: "Between",
1930
+ [K.FilterOperator.NotBetween]: "Not between",
1931
+ [K.FilterOperator.Like]: "Like",
1932
+ [K.FilterOperator.NotLike]: "Not like",
1933
+ [K.FilterOperator.Contains]: "Contains",
1934
+ [K.FilterOperator.NotContains]: "Does not contain",
1935
+ [K.FilterOperator.GeoIntersect]: "Intersects bounding box"
1783
1936
  };
1784
1937
  function jt({ field: e, filter: t, editor: n }) {
1785
- let { editorMode: r, disabledControls: i, update: a, valueList: { searchInput: o, setSearchInput: s } } = n, c = Z(t);
1786
- return r === "list" ? /* @__PURE__ */ (0, $.jsx)(oe, {
1938
+ let { editorMode: r, disabledControls: i, update: a, valueList: { searchInput: o, setSearchInput: s } } = n, c = Q(t);
1939
+ return r === "list" ? /* @__PURE__ */ (0, k.jsx)(ne, {
1787
1940
  value: o,
1788
1941
  disabled: i,
1789
1942
  placeholder: "Search values…",
1790
1943
  "aria-label": `Search ${e.name} values`,
1791
1944
  onChange: (e) => s(e.currentTarget.value)
1792
- }) : r === "text" ? /* @__PURE__ */ (0, $.jsx)(E, {
1945
+ }) : r === "text" ? /* @__PURE__ */ (0, k.jsx)(j, {
1793
1946
  className: "astrato-app-filter-bar__control astrato-app-filter-bar__text-query",
1794
1947
  type: "search",
1795
1948
  placeholder: "Match text…",
@@ -1797,31 +1950,31 @@ function jt({ field: e, filter: t, editor: n }) {
1797
1950
  value: String(c[0] ?? ""),
1798
1951
  disabled: i,
1799
1952
  onChange: (e) => a({
1800
- ...X(t),
1953
+ ...Z(t),
1801
1954
  values: [e.currentTarget.value]
1802
1955
  })
1803
1956
  }) : null;
1804
1957
  }
1805
1958
  function Mt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
1806
- let { editorMode: i, disabledControls: a, isSingleSelect: o, isChangingMode: s, switchMode: c, changeOperator: l, changeExclude: u } = n, d = t.operator === W.FilterOperator.NotInList || t.operator === W.FilterOperator.NotLike || t.operator === W.FilterOperator.NotBetween || t.operator === W.FilterOperator.NotEquals || t.operator === W.FilterOperator.NotContains, f = kt.filter(({ value: t }) => t === "list" || t === i ? !0 : o ? !1 : t === "text" ? e.dataType !== W.FieldType.BOOLEAN && e.dataType !== W.FieldType.GEOGRAPHY : t === "range" ? _t(e.dataType) : t === "date" && Y(e.dataType)), p = kt.find(({ value: e }) => e === i) ?? kt[0], m = f[(f.findIndex(({ value: e }) => e === i) + 1) % f.length], h = f.length > 1 ? `Filter type: ${p.label}. Switch to ${m.label}` : `Filter type: ${p.label}`, g = i === "list" || i === "text" ? /* @__PURE__ */ (0, $.jsx)(jt, {
1959
+ let { editorMode: i, disabledControls: a, isSingleSelect: o, isChangingMode: s, switchMode: c, changeOperator: l, changeExclude: u } = n, d = t.operator === K.FilterOperator.NotInList || t.operator === K.FilterOperator.NotLike || t.operator === K.FilterOperator.NotBetween || t.operator === K.FilterOperator.NotEquals || t.operator === K.FilterOperator.NotContains, f = kt.filter(({ value: t }) => t === "list" || t === i ? !0 : o ? !1 : t === "text" ? e.dataType !== K.FieldType.BOOLEAN && e.dataType !== K.FieldType.GEOGRAPHY : t === "range" ? _t(e.dataType) : t === "date" && X(e.dataType)), p = kt.find(({ value: e }) => e === i) ?? kt[0], m = f[(f.findIndex(({ value: e }) => e === i) + 1) % f.length], h = f.length > 1 ? `Filter type: ${p.label}. Switch to ${m.label}` : `Filter type: ${p.label}`, g = i === "list" || i === "text" ? /* @__PURE__ */ (0, k.jsx)(jt, {
1807
1960
  field: e,
1808
1961
  filter: t,
1809
1962
  editor: n
1810
1963
  }) : null;
1811
- return /* @__PURE__ */ (0, $.jsx)("header", {
1964
+ return /* @__PURE__ */ (0, k.jsx)("header", {
1812
1965
  className: "astrato-app-filter-bar__editor-options",
1813
- children: r ? /* @__PURE__ */ (0, $.jsx)(O, {
1966
+ children: r ? /* @__PURE__ */ (0, k.jsx)(M, {
1814
1967
  className: "astrato-app-filter-bar__control",
1815
1968
  "aria-label": "Filter operator",
1816
1969
  value: t.operator,
1817
1970
  disabled: a,
1818
1971
  onChange: (e) => l(e.currentTarget.value),
1819
- children: yt(e.dataType).map((e) => /* @__PURE__ */ (0, $.jsx)("option", {
1972
+ children: yt(e.dataType).map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
1820
1973
  value: e,
1821
1974
  children: At[e] ?? e
1822
1975
  }, e))
1823
- }) : /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
1824
- /* @__PURE__ */ (0, $.jsx)(T, {
1976
+ }) : /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [
1977
+ /* @__PURE__ */ (0, k.jsx)(A, {
1825
1978
  className: "astrato-app-filter-bar__mode-toggle",
1826
1979
  "data-variant": "ghost",
1827
1980
  "data-icon-only": "true",
@@ -1832,16 +1985,16 @@ function Mt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
1832
1985
  "aria-disabled": s || void 0,
1833
1986
  "aria-busy": s,
1834
1987
  onClick: () => void c(m.value),
1835
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: p.icon })
1988
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: p.icon })
1836
1989
  }),
1837
- g ?? /* @__PURE__ */ (0, $.jsx)("span", {
1990
+ g ?? /* @__PURE__ */ (0, k.jsx)("span", {
1838
1991
  className: "astrato-app-filter-bar__mode-label",
1839
1992
  children: p.label
1840
1993
  }),
1841
- /* @__PURE__ */ (0, $.jsxs)("label", {
1994
+ /* @__PURE__ */ (0, k.jsxs)("label", {
1842
1995
  className: "astrato-app-filter-bar__exclude",
1843
1996
  "data-active": d,
1844
- children: [/* @__PURE__ */ (0, $.jsx)(E, {
1997
+ children: [/* @__PURE__ */ (0, k.jsx)(j, {
1845
1998
  type: "checkbox",
1846
1999
  checked: d,
1847
2000
  disabled: a || o && i === "list",
@@ -1852,48 +2005,48 @@ function Mt({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
1852
2005
  });
1853
2006
  }
1854
2007
  function Nt({ filter: e, disabledControls: t, update: n }) {
1855
- let r = (t) => n(Tt(e, t));
1856
- return /* @__PURE__ */ (0, $.jsxs)("div", {
2008
+ let r = (t) => n(Tt(e, t)), i = e.dynamicDate, a = e.dynamicDateRange;
2009
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
1857
2010
  className: "astrato-app-filter-bar__fieldset",
1858
2011
  children: [
1859
- /* @__PURE__ */ (0, $.jsxs)("label", {
2012
+ /* @__PURE__ */ (0, k.jsxs)("label", {
1860
2013
  className: "astrato-app-filter-bar__label",
1861
- children: ["Date mode", /* @__PURE__ */ (0, $.jsxs)(O, {
2014
+ children: ["Date mode", /* @__PURE__ */ (0, k.jsxs)(M, {
1862
2015
  className: "astrato-app-filter-bar__control",
1863
2016
  value: wt(e),
1864
2017
  disabled: t,
1865
2018
  onChange: (e) => r(e.currentTarget.value),
1866
2019
  children: [
1867
- /* @__PURE__ */ (0, $.jsx)("option", {
2020
+ /* @__PURE__ */ (0, k.jsx)("option", {
1868
2021
  value: "fixed",
1869
2022
  children: "Fixed range"
1870
2023
  }),
1871
- /* @__PURE__ */ (0, $.jsx)("option", {
2024
+ /* @__PURE__ */ (0, k.jsx)("option", {
1872
2025
  value: "single",
1873
2026
  children: "Specific date"
1874
2027
  }),
1875
- /* @__PURE__ */ (0, $.jsx)("option", {
2028
+ /* @__PURE__ */ (0, k.jsx)("option", {
1876
2029
  value: "dynamic",
1877
2030
  children: "Dynamic date"
1878
2031
  }),
1879
- /* @__PURE__ */ (0, $.jsx)("option", {
2032
+ /* @__PURE__ */ (0, k.jsx)("option", {
1880
2033
  value: "dynamic-calc",
1881
2034
  children: "Dynamic date preset"
1882
2035
  }),
1883
- /* @__PURE__ */ (0, $.jsx)("option", {
2036
+ /* @__PURE__ */ (0, k.jsx)("option", {
1884
2037
  value: "preset",
1885
2038
  children: "Predefined period"
1886
2039
  }),
1887
- /* @__PURE__ */ (0, $.jsx)("option", {
2040
+ /* @__PURE__ */ (0, k.jsx)("option", {
1888
2041
  value: "relative",
1889
2042
  children: "Relative range"
1890
2043
  })
1891
2044
  ]
1892
2045
  })]
1893
2046
  }),
1894
- e.dynamicDateCalcRange && /* @__PURE__ */ (0, $.jsxs)("label", {
2047
+ e.dynamicDateCalcRange && /* @__PURE__ */ (0, k.jsxs)("label", {
1895
2048
  className: "astrato-app-filter-bar__label",
1896
- children: ["Period", /* @__PURE__ */ (0, $.jsx)(O, {
2049
+ children: ["Period", /* @__PURE__ */ (0, k.jsx)(M, {
1897
2050
  className: "astrato-app-filter-bar__control",
1898
2051
  value: e.dynamicDateCalcRange.type,
1899
2052
  disabled: t,
@@ -1901,15 +2054,15 @@ function Nt({ filter: e, disabledControls: t, update: n }) {
1901
2054
  ...e,
1902
2055
  dynamicDateCalcRange: { type: t.currentTarget.value }
1903
2056
  }),
1904
- children: Dt.map(({ value: e, label: t }) => /* @__PURE__ */ (0, $.jsx)("option", {
2057
+ children: Dt.map(({ value: e, label: t }) => /* @__PURE__ */ (0, k.jsx)("option", {
1905
2058
  value: e,
1906
2059
  children: t
1907
2060
  }, e))
1908
2061
  })]
1909
2062
  }),
1910
- e.dynamicDateCalc && /* @__PURE__ */ (0, $.jsxs)("label", {
2063
+ e.dynamicDateCalc && /* @__PURE__ */ (0, k.jsxs)("label", {
1911
2064
  className: "astrato-app-filter-bar__label",
1912
- children: ["Dynamic date", /* @__PURE__ */ (0, $.jsx)(O, {
2065
+ children: ["Dynamic date", /* @__PURE__ */ (0, k.jsx)(M, {
1913
2066
  className: "astrato-app-filter-bar__control",
1914
2067
  value: e.dynamicDateCalc.type,
1915
2068
  disabled: t,
@@ -1917,39 +2070,39 @@ function Nt({ filter: e, disabledControls: t, update: n }) {
1917
2070
  ...e,
1918
2071
  dynamicDateCalc: { type: t.currentTarget.value }
1919
2072
  }),
1920
- children: Ot.map(({ value: e, label: t }) => /* @__PURE__ */ (0, $.jsx)("option", {
2073
+ children: Ot.map(({ value: e, label: t }) => /* @__PURE__ */ (0, k.jsx)("option", {
1921
2074
  value: e,
1922
2075
  children: t
1923
2076
  }, e))
1924
2077
  })]
1925
2078
  }),
1926
- e.dynamicDate && /* @__PURE__ */ (0, $.jsxs)("div", {
2079
+ i && /* @__PURE__ */ (0, k.jsxs)("div", {
1927
2080
  className: "astrato-app-filter-bar__row",
1928
- children: [/* @__PURE__ */ (0, $.jsxs)("label", {
2081
+ children: [/* @__PURE__ */ (0, k.jsxs)("label", {
1929
2082
  className: "astrato-app-filter-bar__label",
1930
- children: ["Offset", /* @__PURE__ */ (0, $.jsx)(E, {
2083
+ children: ["Offset", /* @__PURE__ */ (0, k.jsx)(j, {
1931
2084
  className: "astrato-app-filter-bar__control",
1932
2085
  type: "number",
1933
- value: e.dynamicDate.offset,
2086
+ value: i.offset,
1934
2087
  disabled: t,
1935
2088
  onChange: (t) => n({
1936
2089
  ...e,
1937
2090
  dynamicDate: {
1938
- ...e.dynamicDate,
2091
+ ...i,
1939
2092
  offset: Number(t.currentTarget.value)
1940
2093
  }
1941
2094
  })
1942
2095
  })]
1943
- }), /* @__PURE__ */ (0, $.jsxs)("label", {
2096
+ }), /* @__PURE__ */ (0, k.jsxs)("label", {
1944
2097
  className: "astrato-app-filter-bar__label",
1945
- children: ["Unit", /* @__PURE__ */ (0, $.jsx)(O, {
2098
+ children: ["Unit", /* @__PURE__ */ (0, k.jsx)(M, {
1946
2099
  className: "astrato-app-filter-bar__control",
1947
- value: e.dynamicDate.part,
2100
+ value: i.part,
1948
2101
  disabled: t,
1949
2102
  onChange: (t) => n({
1950
2103
  ...e,
1951
2104
  dynamicDate: {
1952
- ...e.dynamicDate,
2105
+ ...i,
1953
2106
  part: t.currentTarget.value
1954
2107
  }
1955
2108
  }),
@@ -1962,58 +2115,58 @@ function Nt({ filter: e, disabledControls: t, update: n }) {
1962
2115
  "hour",
1963
2116
  "minute",
1964
2117
  "second"
1965
- ].map((e) => /* @__PURE__ */ (0, $.jsx)("option", {
2118
+ ].map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
1966
2119
  value: e,
1967
2120
  children: e
1968
2121
  }, e))
1969
2122
  })]
1970
2123
  })]
1971
2124
  }),
1972
- e.dynamicDateRange && /* @__PURE__ */ (0, $.jsxs)("div", {
2125
+ a && /* @__PURE__ */ (0, k.jsxs)("div", {
1973
2126
  className: "astrato-app-filter-bar__row",
1974
2127
  children: [
1975
- /* @__PURE__ */ (0, $.jsxs)("label", {
2128
+ /* @__PURE__ */ (0, k.jsxs)("label", {
1976
2129
  className: "astrato-app-filter-bar__label",
1977
- children: ["Start offset", /* @__PURE__ */ (0, $.jsx)(E, {
2130
+ children: ["Start offset", /* @__PURE__ */ (0, k.jsx)(j, {
1978
2131
  className: "astrato-app-filter-bar__control",
1979
2132
  type: "number",
1980
- value: e.dynamicDateRange.offsetBegin,
2133
+ value: a.offsetBegin,
1981
2134
  disabled: t,
1982
2135
  onChange: (t) => n({
1983
2136
  ...e,
1984
2137
  dynamicDateRange: {
1985
- ...e.dynamicDateRange,
2138
+ ...a,
1986
2139
  offsetBegin: Number(t.currentTarget.value)
1987
2140
  }
1988
2141
  })
1989
2142
  })]
1990
2143
  }),
1991
- /* @__PURE__ */ (0, $.jsxs)("label", {
2144
+ /* @__PURE__ */ (0, k.jsxs)("label", {
1992
2145
  className: "astrato-app-filter-bar__label",
1993
- children: ["End offset", /* @__PURE__ */ (0, $.jsx)(E, {
2146
+ children: ["End offset", /* @__PURE__ */ (0, k.jsx)(j, {
1994
2147
  className: "astrato-app-filter-bar__control",
1995
2148
  type: "number",
1996
- value: e.dynamicDateRange.offsetEnd,
2149
+ value: a.offsetEnd,
1997
2150
  disabled: t,
1998
2151
  onChange: (t) => n({
1999
2152
  ...e,
2000
2153
  dynamicDateRange: {
2001
- ...e.dynamicDateRange,
2154
+ ...a,
2002
2155
  offsetEnd: Number(t.currentTarget.value)
2003
2156
  }
2004
2157
  })
2005
2158
  })]
2006
2159
  }),
2007
- /* @__PURE__ */ (0, $.jsxs)("label", {
2160
+ /* @__PURE__ */ (0, k.jsxs)("label", {
2008
2161
  className: "astrato-app-filter-bar__label",
2009
- children: ["Unit", /* @__PURE__ */ (0, $.jsx)(O, {
2162
+ children: ["Unit", /* @__PURE__ */ (0, k.jsx)(M, {
2010
2163
  className: "astrato-app-filter-bar__control",
2011
- value: e.dynamicDateRange.part,
2164
+ value: a.part,
2012
2165
  disabled: t,
2013
2166
  onChange: (t) => n({
2014
2167
  ...e,
2015
2168
  dynamicDateRange: {
2016
- ...e.dynamicDateRange,
2169
+ ...a,
2017
2170
  part: t.currentTarget.value
2018
2171
  }
2019
2172
  }),
@@ -2026,7 +2179,7 @@ function Nt({ filter: e, disabledControls: t, update: n }) {
2026
2179
  "hour",
2027
2180
  "minute",
2028
2181
  "second"
2029
- ].map((e) => /* @__PURE__ */ (0, $.jsx)("option", {
2182
+ ].map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
2030
2183
  value: e,
2031
2184
  children: e
2032
2185
  }, e))
@@ -2038,24 +2191,24 @@ function Nt({ filter: e, disabledControls: t, update: n }) {
2038
2191
  });
2039
2192
  }
2040
2193
  function Pt(e) {
2041
- let { field: t, filter: n, editorMode: r, timeZone: i, disabledControls: a, update: o } = e, s = Z(n);
2042
- return /* @__PURE__ */ (0, $.jsxs)("div", {
2194
+ let { field: t, filter: n, editorMode: r, timeZone: i, disabledControls: a, update: o } = e, s = Q(n);
2195
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
2043
2196
  className: "astrato-app-filter-bar__values",
2044
- children: [r === "date" && /* @__PURE__ */ (0, $.jsx)(Nt, { ...e }), !n.dynamicDateCalcRange && !n.dynamicDateRange && !n.dynamicDate && !n.dynamicDateCalc && /* @__PURE__ */ (0, $.jsx)("div", {
2197
+ children: [r === "date" && /* @__PURE__ */ (0, k.jsx)(Nt, { ...e }), !n.dynamicDateCalcRange && !n.dynamicDateRange && !n.dynamicDate && !n.dynamicDateCalc && /* @__PURE__ */ (0, k.jsx)("div", {
2045
2198
  className: "astrato-app-filter-bar__row astrato-app-filter-bar__range-inputs",
2046
- children: ([W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(n.operator) ? [0] : [0, 1]).map((e) => /* @__PURE__ */ (0, $.jsxs)("label", {
2199
+ children: ([K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? [0] : [0, 1]).map((e) => /* @__PURE__ */ (0, k.jsxs)("label", {
2047
2200
  className: "astrato-app-filter-bar__label",
2048
- children: [[W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(n.operator) ? "Date" : e === 0 ? "From" : "To", /* @__PURE__ */ (0, $.jsx)(E, {
2201
+ children: [[K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator) ? "Date" : e === 0 ? "From" : "To", /* @__PURE__ */ (0, k.jsx)(j, {
2049
2202
  className: "astrato-app-filter-bar__control",
2050
2203
  type: r === "date" ? Ct(t.dataType) : "number",
2051
- step: r === "date" && t.dataType !== W.FieldType.DATE ? "0.001" : void 0,
2204
+ step: r === "date" && t.dataType !== K.FieldType.DATE ? "0.001" : void 0,
2052
2205
  value: r === "date" ? mt(s[e], t.dataType, i) : String(s[e] ?? ""),
2053
2206
  disabled: a,
2054
2207
  onChange: (a) => {
2055
2208
  let c = [s[0] ?? null, s[1] ?? null];
2056
2209
  c[e] = r === "date" ? ht(a.currentTarget.value, t.dataType, i) : a.currentTarget.value === "" ? null : Number(a.currentTarget.value), o({
2057
- ...X(n),
2058
- values: ft(c, [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(n.operator))
2210
+ ...Z(n),
2211
+ values: ft(c, [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n.operator))
2059
2212
  });
2060
2213
  }
2061
2214
  })]
@@ -2064,190 +2217,190 @@ function Pt(e) {
2064
2217
  });
2065
2218
  }
2066
2219
  function Ft({ field: e, filter: t, timeZone: n, disabledControls: r, update: i }) {
2067
- let a = Z(t);
2068
- return /* @__PURE__ */ (0, $.jsxs)("label", {
2220
+ let a = Q(t);
2221
+ return /* @__PURE__ */ (0, k.jsxs)("label", {
2069
2222
  className: "astrato-app-filter-bar__label",
2070
- children: ["Value", e.dataType === W.FieldType.BOOLEAN ? /* @__PURE__ */ (0, $.jsxs)(O, {
2223
+ children: ["Value", e.dataType === K.FieldType.BOOLEAN ? /* @__PURE__ */ (0, k.jsxs)(M, {
2071
2224
  className: "astrato-app-filter-bar__control",
2072
2225
  value: a[0] == null ? "" : String(a[0]),
2073
2226
  disabled: r,
2074
2227
  onChange: (e) => i({
2075
- ...X(t),
2228
+ ...Z(t),
2076
2229
  values: [e.currentTarget.value === "" ? null : e.currentTarget.value === "true"]
2077
2230
  }),
2078
2231
  children: [
2079
- /* @__PURE__ */ (0, $.jsx)("option", {
2232
+ /* @__PURE__ */ (0, k.jsx)("option", {
2080
2233
  value: "",
2081
2234
  children: "Choose a value"
2082
2235
  }),
2083
- /* @__PURE__ */ (0, $.jsx)("option", {
2236
+ /* @__PURE__ */ (0, k.jsx)("option", {
2084
2237
  value: "true",
2085
2238
  children: "True"
2086
2239
  }),
2087
- /* @__PURE__ */ (0, $.jsx)("option", {
2240
+ /* @__PURE__ */ (0, k.jsx)("option", {
2088
2241
  value: "false",
2089
2242
  children: "False"
2090
2243
  })
2091
2244
  ]
2092
- }) : /* @__PURE__ */ (0, $.jsx)(E, {
2245
+ }) : /* @__PURE__ */ (0, k.jsx)(j, {
2093
2246
  className: "astrato-app-filter-bar__control",
2094
- type: Y(e.dataType) ? Ct(e.dataType) : _t(e.dataType) ? "number" : "text",
2095
- step: Y(e.dataType) && e.dataType !== W.FieldType.DATE ? "0.001" : void 0,
2096
- value: Y(e.dataType) ? mt(a[0], e.dataType, n) : String(a[0] ?? ""),
2247
+ type: X(e.dataType) ? Ct(e.dataType) : _t(e.dataType) ? "number" : "text",
2248
+ step: X(e.dataType) && e.dataType !== K.FieldType.DATE ? "0.001" : void 0,
2249
+ value: X(e.dataType) ? mt(a[0], e.dataType, n) : String(a[0] ?? ""),
2097
2250
  disabled: r,
2098
2251
  onChange: (r) => i({
2099
- ...X(t),
2100
- values: [Y(e.dataType) ? ht(r.currentTarget.value, e.dataType, n) : _t(e.dataType) ? r.currentTarget.value === "" ? null : Number(r.currentTarget.value) : r.currentTarget.value]
2252
+ ...Z(t),
2253
+ values: [X(e.dataType) ? ht(r.currentTarget.value, e.dataType, n) : _t(e.dataType) ? r.currentTarget.value === "" ? null : Number(r.currentTarget.value) : r.currentTarget.value]
2101
2254
  })
2102
2255
  })]
2103
2256
  });
2104
2257
  }
2105
- function It({ field: e, filter: t, editor: r, showAdvancedOperators: i }) {
2106
- let a = (0, U.useId)(), { update: o, valuesSelected: s, isSingleSelect: c, disabledControls: l, valueList: u } = r, { values: d, availableValues: f, availableSelectedValues: p, searchQuery: m, hasConnectedFilters: h, showAllValues: g, setShowAllValues: v, sortDirection: y, toggleSortDirection: b, isRefreshingValues: x, isLoadingMore: ee, loadMoreError: S, canLoadMore: C, loadMore: w, valueListRef: te, nextPageRef: ne } = u, re = /* @__PURE__ */ (0, $.jsx)(jt, {
2258
+ function It({ field: e, filter: t, editor: n, showAdvancedOperators: r }) {
2259
+ let i = (0, O.useId)(), { update: o, valuesSelected: s, isSingleSelect: c, disabledControls: l, valueList: u } = n, { values: d, availableValues: f, availableSelectedValues: p, searchQuery: m, hasConnectedFilters: h, showAllValues: g, setShowAllValues: _, sortDirection: v, toggleSortDirection: y, isRefreshingValues: b, isLoadingMore: S, loadMoreError: C, canLoadMore: w, loadMore: T, valueListRef: E, nextPageRef: ee } = u, D = /* @__PURE__ */ (0, k.jsx)(jt, {
2107
2260
  field: e,
2108
2261
  filter: t,
2109
- editor: r
2110
- }), ae = (e) => {
2111
- let n = Z(t), r = Q(e), i = s.has(r) ? n.filter((e) => Q(e) !== r) : [...n, e];
2262
+ editor: n
2263
+ }), M = (e) => {
2264
+ let n = Q(t), r = $(e), i = s.has(r) ? n.filter((e) => $(e) !== r) : [...n, e];
2112
2265
  o(bt(t, c ? [e] : i));
2113
- }, oe = () => {
2114
- let e = new Set(d.map(Q)), n = Z(t).filter((t) => !e.has(Q(t)));
2266
+ }, ne = () => {
2267
+ let e = new Set(d.map($)), n = Q(t).filter((t) => !e.has($(t)));
2115
2268
  o(bt(t, [...n, ...d]));
2116
- }, O = () => {
2117
- let e = new Set(d.map(Q));
2118
- o(bt(t, Z(t).filter((t) => !e.has(Q(t)))));
2119
- }, k = () => {
2120
- let e = new Set(d.map(Q)), n = Z(t).filter((t) => !e.has(Q(t)));
2121
- n.push(...d.filter((e) => !s.has(Q(e)))), o(bt(t, n));
2122
- }, A = () => o(bt(t, f)), j = Z(t), M = m ? d : [...new Map([...d, ...j].map((e) => [Q(e), e])).values()], N = new Set([...f, ...p].map(Q));
2123
- return /* @__PURE__ */ (0, $.jsxs)("div", {
2269
+ }, P = () => {
2270
+ let e = new Set(d.map($));
2271
+ o(bt(t, Q(t).filter((t) => !e.has($(t)))));
2272
+ }, re = () => {
2273
+ let e = new Set(d.map($)), n = Q(t).filter((t) => !e.has($(t)));
2274
+ n.push(...d.filter((e) => !s.has($(e)))), o(bt(t, n));
2275
+ }, F = () => o(bt(t, f)), I = Q(t), L = m ? d : [...new Map([...d, ...I].map((e) => [$(e), e])).values()], ie = new Set([...f, ...p].map($));
2276
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
2124
2277
  className: "astrato-app-filter-bar__list-editor",
2125
2278
  children: [
2126
- i && /* @__PURE__ */ (0, $.jsx)("div", {
2279
+ r && /* @__PURE__ */ (0, k.jsx)("div", {
2127
2280
  className: "astrato-app-filter-bar__search-row",
2128
- children: re
2281
+ children: D
2129
2282
  }),
2130
- /* @__PURE__ */ (0, $.jsxs)("div", {
2283
+ /* @__PURE__ */ (0, k.jsxs)("div", {
2131
2284
  className: "astrato-app-filter-bar__selection-toolbar",
2132
2285
  children: [
2133
- /* @__PURE__ */ (0, $.jsxs)("span", {
2286
+ /* @__PURE__ */ (0, k.jsxs)("span", {
2134
2287
  className: "astrato-app-filter-bar__muted",
2135
2288
  role: "status",
2136
- children: [j.length, " selected"]
2289
+ children: [I.length, " selected"]
2137
2290
  }),
2138
- /* @__PURE__ */ (0, $.jsx)(T, {
2291
+ /* @__PURE__ */ (0, k.jsx)(A, {
2139
2292
  "data-variant": "ghost",
2140
2293
  "data-icon-only": "true",
2141
2294
  disabled: l,
2142
- "aria-label": y === n.Asc ? "Sort descending" : "Sort ascending",
2143
- title: y === n.Asc ? "Sorted ascending. Switch to descending." : "Sorted descending. Switch to ascending.",
2144
- onClick: b,
2145
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: y === n.Asc ? "sortAsc" : "sortDesc" })
2295
+ "aria-label": v === a.Asc ? "Sort descending" : "Sort ascending",
2296
+ title: v === a.Asc ? "Sorted ascending. Switch to descending." : "Sorted descending. Switch to ascending.",
2297
+ onClick: y,
2298
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: v === a.Asc ? "sortAsc" : "sortDesc" })
2146
2299
  }),
2147
- /* @__PURE__ */ (0, $.jsx)(T, {
2300
+ /* @__PURE__ */ (0, k.jsx)(A, {
2148
2301
  "data-variant": "ghost",
2149
2302
  "aria-label": "Select loaded values",
2150
2303
  title: "Select all values currently loaded in this list",
2151
- disabled: l || c || x || !d.length,
2152
- onClick: oe,
2304
+ disabled: l || c || b || !d.length,
2305
+ onClick: ne,
2153
2306
  children: "Select all"
2154
2307
  }),
2155
- /* @__PURE__ */ (0, $.jsx)(ie, { actions: [
2308
+ /* @__PURE__ */ (0, k.jsx)(N, { actions: [
2156
2309
  {
2157
2310
  label: "Deselect loaded values",
2158
- onSelect: O,
2159
- disabled: l || c || x || !d.length
2311
+ onSelect: P,
2312
+ disabled: l || c || b || !d.length
2160
2313
  },
2161
2314
  {
2162
2315
  label: "Invert loaded selection",
2163
- onSelect: k,
2164
- disabled: l || c || x || !d.length
2316
+ onSelect: re,
2317
+ disabled: l || c || b || !d.length
2165
2318
  },
2166
2319
  {
2167
2320
  label: "Select loaded available values",
2168
- onSelect: A,
2169
- disabled: l || c || x || !f.length
2321
+ onSelect: F,
2322
+ disabled: l || c || b || !f.length
2170
2323
  },
2171
2324
  {
2172
2325
  label: "Clear values",
2173
2326
  onSelect: () => o(bt(t, [])),
2174
- disabled: l || c || !j.length
2327
+ disabled: l || c || !I.length
2175
2328
  }
2176
2329
  ] })
2177
2330
  ]
2178
2331
  }),
2179
- h && /* @__PURE__ */ (0, $.jsxs)("label", {
2332
+ h && /* @__PURE__ */ (0, k.jsxs)("label", {
2180
2333
  className: "astrato-app-filter-bar__availability",
2181
- children: [/* @__PURE__ */ (0, $.jsx)(E, {
2334
+ children: [/* @__PURE__ */ (0, k.jsx)(j, {
2182
2335
  type: "checkbox",
2183
2336
  checked: g,
2184
- disabled: l || x,
2185
- onChange: (e) => v(e.currentTarget.checked)
2337
+ disabled: l || b,
2338
+ onChange: (e) => _(e.currentTarget.checked)
2186
2339
  }), "Include unavailable values"]
2187
2340
  }),
2188
- /* @__PURE__ */ (0, $.jsxs)("div", {
2341
+ /* @__PURE__ */ (0, k.jsxs)("div", {
2189
2342
  className: "astrato-app-filter-bar__value-viewport",
2190
- "data-loading": x,
2191
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
2343
+ "data-loading": b,
2344
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2192
2345
  className: "astrato-app-filter-bar__value-list",
2193
- ref: te,
2194
- "aria-busy": x,
2346
+ ref: E,
2347
+ "aria-busy": b,
2195
2348
  children: [
2196
- M.map((e) => {
2197
- let t = Q(e);
2198
- return /* @__PURE__ */ (0, $.jsxs)("label", {
2349
+ L.map((e) => {
2350
+ let t = $(e);
2351
+ return /* @__PURE__ */ (0, k.jsxs)("label", {
2199
2352
  className: "astrato-app-filter-bar__value",
2200
2353
  "data-selected": s.has(t),
2201
- "data-excluded": h && !N.has(t),
2202
- children: [/* @__PURE__ */ (0, $.jsx)(E, {
2354
+ "data-excluded": h && !ie.has(t),
2355
+ children: [/* @__PURE__ */ (0, k.jsx)(j, {
2203
2356
  type: c ? "radio" : "checkbox",
2204
- name: c ? a : void 0,
2357
+ name: c ? i : void 0,
2205
2358
  checked: s.has(t),
2206
- disabled: l || x,
2207
- onChange: () => ae(e)
2208
- }), /* @__PURE__ */ (0, $.jsx)("span", { children: e == null ? "Null" : typeof e == "object" ? "value" in e ? String(e.value) : JSON.stringify(e) : String(e) })]
2359
+ disabled: l || b,
2360
+ onChange: () => M(e)
2361
+ }), /* @__PURE__ */ (0, k.jsx)("span", { children: e == null ? "Null" : typeof e == "object" ? "value" in e ? String(e.value) : JSON.stringify(e) : String(e) })]
2209
2362
  }, t);
2210
2363
  }),
2211
- !M.length && !x && /* @__PURE__ */ (0, $.jsx)("div", {
2364
+ !L.length && !b && /* @__PURE__ */ (0, k.jsx)("div", {
2212
2365
  className: "astrato-app-filter-bar__empty",
2213
2366
  children: "No matching values"
2214
2367
  }),
2215
- C && /* @__PURE__ */ (0, $.jsxs)("div", {
2368
+ w && /* @__PURE__ */ (0, k.jsxs)("div", {
2216
2369
  className: "astrato-app-filter-bar__next-page",
2217
- ref: ne,
2218
- children: [ee && /* @__PURE__ */ (0, $.jsx)(D, { label: "Loading more values" }), S && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("span", {
2370
+ ref: ee,
2371
+ children: [S && /* @__PURE__ */ (0, k.jsx)(te, { label: "Loading more values" }), C && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)("span", {
2219
2372
  role: "alert",
2220
2373
  className: "astrato-app-filter-bar__error",
2221
- children: S
2222
- }), /* @__PURE__ */ (0, $.jsx)(T, {
2374
+ children: C
2375
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
2223
2376
  "data-variant": "ghost",
2224
2377
  disabled: l,
2225
- onClick: () => void w(),
2378
+ onClick: () => void T(),
2226
2379
  children: "Retry loading values"
2227
2380
  })] })]
2228
2381
  })
2229
2382
  ]
2230
- }), x && /* @__PURE__ */ (0, $.jsx)(D, { label: "Loading values" })]
2383
+ }), b && /* @__PURE__ */ (0, k.jsx)(te, { label: "Loading values" })]
2231
2384
  })
2232
2385
  ]
2233
2386
  });
2234
2387
  }
2235
2388
  var Lt = (e, t) => {
2236
- let n = e.getSelection(), r = Bt(e, n, t), i = n.applied.find(Ge), a = i ? K(i) : void 0;
2389
+ let n = e.getSelection(), r = Bt(e, n, t), i = n.applied.find(We), a = i ? J(i) : void 0;
2237
2390
  return {
2238
2391
  connectedFilters: r,
2239
2392
  associativeListFilter: i && a && (a === t || e.areFieldsConnected(t, a)) ? i.associativeListFilter : void 0
2240
2393
  };
2241
- }, Rt = async (e, t, r, i) => {
2242
- let a = qt(Kt(i));
2243
- if (!a.length) return [];
2244
- let { connectedFilters: o, associativeListFilter: s } = Lt(e, t.key), c = Ht(t.key, 0, a.length, n.Asc, [...o, {
2394
+ }, Rt = async (e, t, n, r) => {
2395
+ let i = qt(Kt(r));
2396
+ if (!i.length) return [];
2397
+ let { connectedFilters: o, associativeListFilter: s } = Lt(e, t.key), c = Ht(t.key, 0, i.length, a.Asc, [...o, {
2245
2398
  fieldKey: t.key,
2246
- ...r.dateLevel ? { dateLevel: r.dateLevel } : {},
2247
- ...r.datePart ? { datePart: r.datePart } : {},
2248
- operator: W.FilterOperator.InList,
2249
- values: a
2250
- }], r.dateLevel, r.datePart, s);
2399
+ ...n.dateLevel ? { dateLevel: n.dateLevel } : {},
2400
+ ...n.datePart ? { datePart: n.datePart } : {},
2401
+ operator: K.FilterOperator.InList,
2402
+ values: i
2403
+ }], n.dateLevel, n.datePart, s);
2251
2404
  return Gt((await e.query(c)).data);
2252
2405
  }, zt = async (e, t, n, r) => {
2253
2406
  let { searchQuery: i = null, sortDirection: a, offset: o, limit: s } = r, c = r.availableOffset ?? 0, { connectedFilters: l, associativeListFilter: u } = Lt(e, t.key), d = l.length > 0 || !!u, f = i ? [Ut(t, i)] : [], p = Ht(t.key, o, s, a, f, n.dateLevel, n.datePart), m = Gt((await e.query(p)).data), h = [], g = [], _ = !1;
@@ -2289,153 +2442,153 @@ var Lt = (e, t) => {
2289
2442
  let n = t.split(" ").filter((e) => e !== ""), r = Wt(e.dataType) ? n.map(Number).filter((e) => Number.isFinite(e)) : n;
2290
2443
  if (r.length > 0) return {
2291
2444
  fieldKey: e.key,
2292
- operator: W.FilterOperator.InList,
2445
+ operator: K.FilterOperator.InList,
2293
2446
  values: r
2294
2447
  };
2295
2448
  }
2296
2449
  return {
2297
2450
  fieldKey: e.key,
2298
- operator: W.FilterOperator.Like,
2451
+ operator: K.FilterOperator.Like,
2299
2452
  values: [t.toLocaleLowerCase()]
2300
2453
  };
2301
2454
  }, Wt = (e) => [
2302
- W.FieldType.DECIMAL,
2303
- W.FieldType.FLOAT,
2304
- W.FieldType.INT,
2305
- W.FieldType.REAL
2455
+ K.FieldType.DECIMAL,
2456
+ K.FieldType.FLOAT,
2457
+ K.FieldType.INT,
2458
+ K.FieldType.REAL
2306
2459
  ].includes(e), Gt = (e) => Array.isArray(e) ? e.map((e) => e[0]) : Object.values(e).map((e) => e[0]), Kt = (e) => Array.isArray(e) ? e.filter((e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean") : [], qt = (e) => [...new Set(e)], Jt = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t);
2307
- function Yt({ field: e, filter: t, services: r, editorMode: i, disabledControls: a, onError: o }) {
2308
- let [s, c] = (0, U.useState)(""), [l, u] = (0, U.useState)(""), [d, f] = (0, U.useState)([]), [p, m] = (0, U.useState)([]), [h, g] = (0, U.useState)([]), [_, v] = (0, U.useState)(!1), [y, b] = (0, U.useState)(!1), [x, ee] = (0, U.useState)(!1), [S, C] = (0, U.useState)(!1), [w, te] = (0, U.useState)(0), [ne, re] = (0, U.useState)(!0), [ie, ae] = (0, U.useState)(!1), [T, oe] = (0, U.useState)(null), [E, D] = (0, U.useState)(n.Asc), [, O] = (0, U.useState)(0), [k, A] = (0, U.useState)(null), j = (0, U.useRef)(/* @__PURE__ */ new Map()), M = (0, U.useRef)(0), N = (0, U.useRef)(null), se = (0, U.useRef)(null), ce = (0, U.useRef)(null), P = (0, U.useRef)({
2460
+ function Yt({ field: e, filter: t, services: n, editorMode: r, disabledControls: i, onError: o }) {
2461
+ let [s, c] = (0, O.useState)(""), [l, u] = (0, O.useState)(""), [d, f] = (0, O.useState)([]), [p, m] = (0, O.useState)([]), [h, g] = (0, O.useState)([]), [_, v] = (0, O.useState)(!1), [y, b] = (0, O.useState)(!1), [x, S] = (0, O.useState)(!1), [C, w] = (0, O.useState)(!1), [T, E] = (0, O.useState)(0), [ee, D] = (0, O.useState)(!0), [k, te] = (0, O.useState)(!1), [A, j] = (0, O.useState)(null), [M, ne] = (0, O.useState)(a.Asc), [, N] = (0, O.useState)(0), [P, re] = (0, O.useState)(null), F = (0, O.useRef)(/* @__PURE__ */ new Map()), I = (0, O.useRef)(0), L = (0, O.useRef)(null), ie = (0, O.useRef)(null), ae = (0, O.useRef)(null), oe = (0, O.useRef)({
2309
2462
  field: e,
2310
2463
  filter: t,
2311
2464
  searchQuery: l,
2312
- sortDirection: E,
2313
- showAllValues: S
2465
+ sortDirection: M,
2466
+ showAllValues: C
2314
2467
  });
2315
- P.current = {
2468
+ oe.current = {
2316
2469
  field: e,
2317
2470
  filter: t,
2318
2471
  searchQuery: l,
2319
- sortDirection: E,
2320
- showAllValues: S
2472
+ sortDirection: M,
2473
+ showAllValues: C
2321
2474
  };
2322
- let F = JSON.stringify([
2475
+ let R = JSON.stringify([
2323
2476
  e.key,
2324
2477
  e.dataType,
2325
2478
  t.dateLevel,
2326
2479
  t.datePart,
2327
2480
  l,
2328
- E,
2329
- S,
2330
- Lt(r, e.key)
2331
- ]), le = JSON.stringify(Z(t)), I = ne || s !== l, L = x && !S ? y : _;
2332
- (0, U.useEffect)(() => {
2481
+ M,
2482
+ C,
2483
+ Lt(n, e.key)
2484
+ ]), z = JSON.stringify(Q(t)), B = ee || s !== l, V = x && !C ? y : _;
2485
+ (0, O.useEffect)(() => {
2333
2486
  let e = setTimeout(() => u(s), 300);
2334
2487
  return () => clearTimeout(e);
2335
- }, [s]), (0, U.useEffect)(() => r.subscribe(() => O((e) => e + 1)), [r]), (0, U.useEffect)(() => {
2336
- if (i !== "list") return;
2337
- let { field: e, filter: t, searchQuery: n, sortDirection: a, showAllValues: s } = P.current, c = ++M.current;
2338
- return N.current = null, re(!0), ae(!1), oe(null), o(null), A(null), j.current.clear(), zt(r, e, t, {
2339
- searchQuery: n,
2488
+ }, [s]), (0, O.useEffect)(() => n.subscribe(() => N((e) => e + 1)), [n]), (0, O.useEffect)(() => {
2489
+ if (r !== "list") return;
2490
+ let { field: e, filter: t, searchQuery: i, sortDirection: a, showAllValues: s } = oe.current, c = ++I.current;
2491
+ return L.current = null, D(!0), te(!1), j(null), o(null), re(null), F.current.clear(), zt(n, e, t, {
2492
+ searchQuery: i,
2340
2493
  sortDirection: a,
2341
2494
  offset: 0,
2342
2495
  availableOffset: 0,
2343
2496
  limit: 100
2344
2497
  }).then((e) => {
2345
- if (M.current !== c) return;
2346
- let r = e.hasConnectedFilters && !s ? [...e.availableValues, ...e.selectedExcluded] : e.values, i = n ? [] : Z(t);
2347
- f([...new Map([...i, ...r].map((e) => [Q(e), e])).values()]), m(e.availableValues);
2348
- let a = new Set(e.selectedExcluded.map(Q)), o = Z(t).filter((e) => !a.has(Q(e)));
2349
- g(o), e.availableValues.forEach((e) => j.current.set(Q(e), !0)), Z(t).forEach((e) => j.current.set(Q(e), !a.has(Q(e)))), v(e.hasMore), b(e.hasMoreAvailable), ee(e.hasConnectedFilters), te(e.values.length), A(F), se.current && (se.current.scrollTop = 0);
2498
+ if (I.current !== c) return;
2499
+ let n = e.hasConnectedFilters && !s ? [...e.availableValues, ...e.selectedExcluded] : e.values, r = i ? [] : Q(t);
2500
+ f([...new Map([...r, ...n].map((e) => [$(e), e])).values()]), m(e.availableValues);
2501
+ let a = new Set(e.selectedExcluded.map($)), o = Q(t).filter((e) => !a.has($(e)));
2502
+ g(o), e.availableValues.forEach((e) => F.current.set($(e), !0)), Q(t).forEach((e) => F.current.set($(e), !a.has($(e)))), v(e.hasMore), b(e.hasMoreAvailable), S(e.hasConnectedFilters), E(e.values.length), re(R), ie.current && (ie.current.scrollTop = 0);
2350
2503
  }).catch((e) => {
2351
- M.current === c && o(e instanceof Error ? e.message : "Could not load filter values.");
2504
+ I.current === c && o(e instanceof Error ? e.message : "Could not load filter values.");
2352
2505
  }).finally(() => {
2353
- M.current === c && re(!1);
2506
+ I.current === c && D(!1);
2354
2507
  }), () => {
2355
- M.current++, N.current = null;
2508
+ I.current++, L.current = null;
2356
2509
  };
2357
2510
  }, [
2358
- i,
2359
2511
  r,
2360
- F,
2512
+ n,
2513
+ R,
2361
2514
  o
2362
- ]), (0, U.useEffect)(() => {
2363
- if (i !== "list" || k !== F || !x) return;
2364
- let { field: e, filter: t } = P.current, n = Z(t).filter((e) => !j.current.has(Q(e)));
2365
- if (!n.length) return;
2515
+ ]), (0, O.useEffect)(() => {
2516
+ if (r !== "list" || P !== R || !x) return;
2517
+ let { field: e, filter: t } = oe.current, i = Q(t).filter((e) => !F.current.has($(e)));
2518
+ if (!i.length) return;
2366
2519
  let a = !0;
2367
- return Rt(r, e, t, n).then((e) => {
2520
+ return Rt(n, e, t, i).then((e) => {
2368
2521
  if (!a) return;
2369
- let t = new Set(e.map(Q));
2370
- n.forEach((e) => j.current.set(Q(e), t.has(Q(e)))), g((t) => [...new Map([...t, ...e].map((e) => [Q(e), e])).values()]);
2522
+ let t = new Set(e.map($));
2523
+ i.forEach((e) => F.current.set($(e), t.has($(e)))), g((t) => [...new Map([...t, ...e].map((e) => [$(e), e])).values()]);
2371
2524
  }).catch((e) => {
2372
2525
  a && o(e instanceof Error ? e.message : "Could not check selected value availability.");
2373
2526
  }), () => {
2374
2527
  a = !1;
2375
2528
  };
2376
2529
  }, [
2377
- i,
2378
2530
  r,
2379
- F,
2380
- k,
2531
+ n,
2532
+ R,
2533
+ P,
2381
2534
  x,
2382
- le,
2535
+ z,
2383
2536
  o
2384
2537
  ]);
2385
- let R = (0, U.useCallback)(async () => {
2386
- if (i !== "list" || a || I || !L || k !== F || N.current !== null) return;
2387
- let n = ++M.current;
2388
- N.current = n, ae(!0), oe(null);
2538
+ let H = (0, O.useCallback)(async () => {
2539
+ if (r !== "list" || i || B || !V || P !== R || L.current !== null) return;
2540
+ let a = ++I.current;
2541
+ L.current = a, te(!0), j(null);
2389
2542
  try {
2390
- let i = await zt(r, e, t, {
2543
+ let r = await zt(n, e, t, {
2391
2544
  searchQuery: l,
2392
- sortDirection: E,
2393
- offset: w,
2545
+ sortDirection: M,
2546
+ offset: T,
2394
2547
  availableOffset: p.length,
2395
2548
  limit: 100
2396
2549
  });
2397
- if (M.current !== n) return;
2550
+ if (I.current !== a) return;
2398
2551
  f((e) => {
2399
- let t = i.hasConnectedFilters && !S ? i.availableValues : i.values;
2400
- return [...e, ...t.filter((t) => !e.some((e) => Q(e) === Q(t)))];
2401
- }), m((e) => [...e, ...i.availableValues.filter((t) => !e.some((e) => Q(e) === Q(t)))]), i.availableValues.forEach((e) => j.current.set(Q(e), !0)), v(i.hasMore), b(i.hasMoreAvailable), te((e) => e + i.values.length);
2552
+ let t = r.hasConnectedFilters && !C ? r.availableValues : r.values;
2553
+ return [...e, ...t.filter((t) => !e.some((e) => $(e) === $(t)))];
2554
+ }), m((e) => [...e, ...r.availableValues.filter((t) => !e.some((e) => $(e) === $(t)))]), r.availableValues.forEach((e) => F.current.set($(e), !0)), v(r.hasMore), b(r.hasMoreAvailable), E((e) => e + r.values.length);
2402
2555
  } catch (e) {
2403
- if (M.current !== n) return;
2404
- oe(e instanceof Error ? e.message : "Could not load more filter values.");
2556
+ if (I.current !== a) return;
2557
+ j(e instanceof Error ? e.message : "Could not load more filter values.");
2405
2558
  } finally {
2406
- N.current === n && (N.current = null, ae(!1));
2559
+ L.current === a && (L.current = null, te(!1));
2407
2560
  }
2408
2561
  }, [
2409
- i,
2410
- a,
2411
- I,
2412
- L,
2413
- k,
2414
- F,
2415
2562
  r,
2563
+ i,
2564
+ B,
2565
+ V,
2566
+ P,
2567
+ R,
2568
+ n,
2416
2569
  e,
2417
2570
  t,
2418
2571
  l,
2419
- E,
2420
- w,
2572
+ M,
2573
+ T,
2421
2574
  p.length,
2422
- S
2575
+ C
2423
2576
  ]);
2424
- return (0, U.useEffect)(() => {
2425
- let e = se.current, t = ce.current;
2426
- if (!e || !t || !L || T || I) return;
2577
+ return (0, O.useEffect)(() => {
2578
+ let e = ie.current, t = ae.current;
2579
+ if (!e || !t || !V || A || B) return;
2427
2580
  let n = new IntersectionObserver((e) => {
2428
- e.some((e) => e.isIntersecting) && R();
2581
+ e.some((e) => e.isIntersecting) && H();
2429
2582
  }, {
2430
2583
  root: e,
2431
2584
  rootMargin: "0px 0px 120px 0px"
2432
2585
  });
2433
2586
  return n.observe(t), () => n.disconnect();
2434
2587
  }, [
2435
- L,
2436
- T,
2437
- I,
2438
- R
2588
+ V,
2589
+ A,
2590
+ B,
2591
+ H
2439
2592
  ]), {
2440
2593
  searchInput: s,
2441
2594
  searchQuery: l,
@@ -2447,21 +2600,21 @@ function Yt({ field: e, filter: t, services: r, editorMode: i, disabledControls:
2447
2600
  availableValues: p,
2448
2601
  availableSelectedValues: h,
2449
2602
  hasConnectedFilters: x,
2450
- showAllValues: S,
2451
- setShowAllValues: C,
2452
- sortDirection: E,
2453
- toggleSortDirection: () => D((e) => e === n.Asc ? n.Desc : n.Asc),
2454
- isRefreshingValues: I,
2455
- isLoadingMore: ie,
2456
- loadMoreError: T,
2457
- canLoadMore: L,
2458
- loadMore: R,
2459
- valueListRef: se,
2460
- nextPageRef: ce
2603
+ showAllValues: C,
2604
+ setShowAllValues: w,
2605
+ sortDirection: M,
2606
+ toggleSortDirection: () => ne((e) => e === a.Asc ? a.Desc : a.Asc),
2607
+ isRefreshingValues: B,
2608
+ isLoadingMore: k,
2609
+ loadMoreError: A,
2610
+ canLoadMore: V,
2611
+ loadMore: H,
2612
+ valueListRef: ie,
2613
+ nextPageRef: ae
2461
2614
  };
2462
2615
  }
2463
2616
  function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 }) {
2464
- let [a, o] = (0, U.useState)(null), [s, c] = (0, U.useState)(!1), l = (0, U.useRef)(0), u = vt(e.dataType, t), d = n.getTimeZone() ?? "UTC", f = i || n.isLocked(e.key), p = (0, U.useMemo)(() => new Set(Z(t).map(Q)), [t.values]), m = n.isSingleSelect(e.key), h = Yt({
2617
+ let [a, o] = (0, O.useState)(null), [s, c] = (0, O.useState)(!1), l = (0, O.useRef)(0), u = vt(e.dataType, t), d = n.getTimeZone() ?? "UTC", f = i || n.isLocked(e.key), p = (0, O.useMemo)(() => new Set(Q(t).map($)), [t.values]), m = n.isSingleSelect(e.key), h = Yt({
2465
2618
  field: e,
2466
2619
  filter: t,
2467
2620
  services: n,
@@ -2469,9 +2622,9 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2469
2622
  disabledControls: f,
2470
2623
  onError: o
2471
2624
  });
2472
- (0, U.useEffect)(() => {
2625
+ (0, O.useEffect)(() => {
2473
2626
  l.current++;
2474
- }, [e.key, t]), (0, U.useEffect)(() => () => {
2627
+ }, [e.key, t]), (0, O.useEffect)(() => () => {
2475
2628
  l.current++;
2476
2629
  }, []);
2477
2630
  let g = (e) => {
@@ -2479,12 +2632,12 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2479
2632
  }, _ = async (r, i) => {
2480
2633
  let a = ++l.current;
2481
2634
  o(null);
2482
- let s = Z(t), c = i ?? t.operator, f = [
2483
- W.FilterOperator.NotInList,
2484
- W.FilterOperator.NotLike,
2485
- W.FilterOperator.NotBetween,
2486
- W.FilterOperator.NotEquals,
2487
- W.FilterOperator.NotContains
2635
+ let s = Q(t), c = i ?? t.operator, f = [
2636
+ K.FilterOperator.NotInList,
2637
+ K.FilterOperator.NotLike,
2638
+ K.FilterOperator.NotBetween,
2639
+ K.FilterOperator.NotEquals,
2640
+ K.FilterOperator.NotContains
2488
2641
  ].includes(c);
2489
2642
  if (r === "list") {
2490
2643
  if (t.dynamicDate || t.dynamicDateCalc) {
@@ -2505,8 +2658,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2505
2658
  return;
2506
2659
  }
2507
2660
  g({
2508
- ...X(t),
2509
- operator: W.FilterOperator.InList,
2661
+ ...Z(t),
2662
+ operator: K.FilterOperator.InList,
2510
2663
  values: i
2511
2664
  });
2512
2665
  } catch (e) {
@@ -2522,7 +2675,7 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2522
2675
  filters: [{
2523
2676
  ...t,
2524
2677
  fieldKey: e.key,
2525
- operator: W.FilterOperator.Between
2678
+ operator: K.FilterOperator.Between
2526
2679
  }],
2527
2680
  limit: 501
2528
2681
  });
@@ -2533,8 +2686,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2533
2686
  return;
2534
2687
  }
2535
2688
  h.resetSearch(), g({
2536
- ...X(t),
2537
- operator: f ? W.FilterOperator.NotInList : W.FilterOperator.InList,
2689
+ ...Z(t),
2690
+ operator: f ? K.FilterOperator.NotInList : K.FilterOperator.InList,
2538
2691
  values: i
2539
2692
  });
2540
2693
  } catch (e) {
@@ -2546,8 +2699,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2546
2699
  if (r) {
2547
2700
  if (!String(s[0] ?? "").trim()) {
2548
2701
  g({
2549
- ...X(t),
2550
- operator: f ? W.FilterOperator.NotInList : W.FilterOperator.InList,
2702
+ ...Z(t),
2703
+ operator: f ? K.FilterOperator.NotInList : K.FilterOperator.InList,
2551
2704
  values: []
2552
2705
  });
2553
2706
  return;
@@ -2561,8 +2714,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2561
2714
  return;
2562
2715
  }
2563
2716
  g({
2564
- ...X(t),
2565
- operator: f ? W.FilterOperator.NotInList : W.FilterOperator.InList,
2717
+ ...Z(t),
2718
+ operator: f ? K.FilterOperator.NotInList : K.FilterOperator.InList,
2566
2719
  values: i
2567
2720
  });
2568
2721
  } catch (e) {
@@ -2570,11 +2723,11 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2570
2723
  }
2571
2724
  return;
2572
2725
  }
2573
- if ([W.FilterOperator.Between, W.FilterOperator.NotBetween].includes(t.operator)) {
2726
+ if ([K.FilterOperator.Between, K.FilterOperator.NotBetween].includes(t.operator)) {
2574
2727
  try {
2575
2728
  let r = {
2576
2729
  ...t,
2577
- operator: W.FilterOperator.Between,
2730
+ operator: K.FilterOperator.Between,
2578
2731
  fieldKey: e.key
2579
2732
  }, i = await n.query({
2580
2733
  dimensions: [{ fieldKey: e.key }],
@@ -2589,8 +2742,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2589
2742
  return;
2590
2743
  }
2591
2744
  g({
2592
- ...X(t),
2593
- operator: f ? W.FilterOperator.NotInList : W.FilterOperator.InList,
2745
+ ...Z(t),
2746
+ operator: f ? K.FilterOperator.NotInList : K.FilterOperator.InList,
2594
2747
  values: s
2595
2748
  });
2596
2749
  } catch (e) {
@@ -2599,8 +2752,8 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2599
2752
  return;
2600
2753
  }
2601
2754
  g({
2602
- ...X(t),
2603
- operator: i ?? (f ? W.FilterOperator.NotInList : W.FilterOperator.InList),
2755
+ ...Z(t),
2756
+ operator: i ?? (f ? K.FilterOperator.NotInList : K.FilterOperator.InList),
2604
2757
  values: s
2605
2758
  });
2606
2759
  return;
@@ -2608,38 +2761,38 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2608
2761
  if (r === "text") {
2609
2762
  let e = s[0], n = h.searchInput || (e == null ? "" : String(e));
2610
2763
  h.resetSearch(), g({
2611
- ...X(t),
2612
- operator: i ?? (f ? W.FilterOperator.NotLike : W.FilterOperator.Like),
2764
+ ...Z(t),
2765
+ operator: i ?? (f ? K.FilterOperator.NotLike : K.FilterOperator.Like),
2613
2766
  values: [n]
2614
2767
  });
2615
2768
  return;
2616
2769
  }
2617
2770
  if (r === "null") {
2618
2771
  g({
2619
- ...X(t),
2620
- operator: i ?? W.FilterOperator.Set,
2772
+ ...Z(t),
2773
+ operator: i ?? K.FilterOperator.Set,
2621
2774
  values: null
2622
2775
  });
2623
2776
  return;
2624
2777
  }
2625
2778
  if (r === "geo") {
2626
2779
  g({
2627
- ...X(t),
2628
- operator: W.FilterOperator.GeoIntersect,
2780
+ ...Z(t),
2781
+ operator: K.FilterOperator.GeoIntersect,
2629
2782
  values: [null]
2630
2783
  });
2631
2784
  return;
2632
2785
  }
2633
2786
  if (r === "scalar") {
2634
2787
  g({
2635
- ...X(t),
2636
- operator: i ?? W.FilterOperator.Equals,
2788
+ ...Z(t),
2789
+ operator: i ?? K.FilterOperator.Equals,
2637
2790
  values: [s[0] ?? null]
2638
2791
  });
2639
2792
  return;
2640
2793
  }
2641
2794
  if (r === "range" || r === "date") {
2642
- let r = i ?? (f ? W.FilterOperator.NotBetween : W.FilterOperator.Between), c = [];
2795
+ let r = i ?? (f ? K.FilterOperator.NotBetween : K.FilterOperator.Between), c = [];
2643
2796
  if (s.length >= 2 && (u === "list" || u === "range" || u === "date") && (c = gt(s, e.dataType, d)), c.length !== 2 || c[0] == null || c[1] == null) try {
2644
2797
  let t = await n.query({
2645
2798
  dimensions: [],
@@ -2661,7 +2814,7 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2661
2814
  return;
2662
2815
  }
2663
2816
  g({
2664
- ...X(t),
2817
+ ...Z(t),
2665
2818
  operator: r,
2666
2819
  values: c.length === 2 ? c : [null, null]
2667
2820
  });
@@ -2690,29 +2843,29 @@ function Xt({ field: e, filter: t, services: n, onChange: r, disabled: i = !1 })
2690
2843
  },
2691
2844
  changeExclude: (e) => {
2692
2845
  let n = t.operator;
2693
- u === "list" ? n = e ? W.FilterOperator.NotInList : W.FilterOperator.InList : u === "text" ? n = [W.FilterOperator.Contains, W.FilterOperator.NotContains].includes(t.operator) ? e ? W.FilterOperator.NotContains : W.FilterOperator.Contains : e ? W.FilterOperator.NotLike : W.FilterOperator.Like : u === "scalar" ? n = e ? W.FilterOperator.NotEquals : W.FilterOperator.Equals : (u === "range" || u === "date") && (n = u === "date" && [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(t.operator) ? e ? W.FilterOperator.NotEquals : W.FilterOperator.Equals : e ? W.FilterOperator.NotBetween : W.FilterOperator.Between), g({
2846
+ u === "list" ? n = e ? K.FilterOperator.NotInList : K.FilterOperator.InList : u === "text" ? n = [K.FilterOperator.Contains, K.FilterOperator.NotContains].includes(t.operator) ? e ? K.FilterOperator.NotContains : K.FilterOperator.Contains : e ? K.FilterOperator.NotLike : K.FilterOperator.Like : u === "scalar" ? n = e ? K.FilterOperator.NotEquals : K.FilterOperator.Equals : (u === "range" || u === "date") && (n = u === "date" && [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(t.operator) ? e ? K.FilterOperator.NotEquals : K.FilterOperator.Equals : e ? K.FilterOperator.NotBetween : K.FilterOperator.Between), g({
2694
2847
  ...t,
2695
2848
  operator: n
2696
2849
  });
2697
2850
  },
2698
2851
  changeOperator: (n) => {
2699
- [W.FilterOperator.Set, W.FilterOperator.NotSet].includes(n) ? _("null", n) : n === W.FilterOperator.GeoIntersect ? _("geo", n) : [W.FilterOperator.InList, W.FilterOperator.NotInList].includes(n) ? _("list", n) : [W.FilterOperator.Between, W.FilterOperator.NotBetween].includes(n) ? Y(e.dataType) && (t.dynamicDateRange || t.dynamicDateCalcRange) ? g({
2852
+ [K.FilterOperator.Set, K.FilterOperator.NotSet].includes(n) ? _("null", n) : n === K.FilterOperator.GeoIntersect ? _("geo", n) : [K.FilterOperator.InList, K.FilterOperator.NotInList].includes(n) ? _("list", n) : [K.FilterOperator.Between, K.FilterOperator.NotBetween].includes(n) ? X(e.dataType) && (t.dynamicDateRange || t.dynamicDateCalcRange) ? g({
2700
2853
  ...t,
2701
2854
  operator: n
2702
- }) : _(Y(e.dataType) ? "date" : "range", n) : [
2703
- W.FilterOperator.Like,
2704
- W.FilterOperator.NotLike,
2705
- W.FilterOperator.Contains,
2706
- W.FilterOperator.NotContains
2707
- ].includes(n) ? _("text", n) : [W.FilterOperator.Equals, W.FilterOperator.NotEquals].includes(n) && Y(e.dataType) ? t.dynamicDate || t.dynamicDateCalc ? g({
2855
+ }) : _(X(e.dataType) ? "date" : "range", n) : [
2856
+ K.FilterOperator.Like,
2857
+ K.FilterOperator.NotLike,
2858
+ K.FilterOperator.Contains,
2859
+ K.FilterOperator.NotContains
2860
+ ].includes(n) ? _("text", n) : [K.FilterOperator.Equals, K.FilterOperator.NotEquals].includes(n) && X(e.dataType) ? t.dynamicDate || t.dynamicDateCalc ? g({
2708
2861
  ...t,
2709
2862
  operator: n,
2710
2863
  values: []
2711
2864
  }) : g({
2712
- ...X(t),
2865
+ ...Z(t),
2713
2866
  operator: n,
2714
- values: [Z(t)[0] ?? null]
2715
- }) : Y(e.dataType) && (t.dynamicDate || t.dynamicDateCalc) ? g({
2867
+ values: [Q(t)[0] ?? null]
2868
+ }) : X(e.dataType) && (t.dynamicDate || t.dynamicDateCalc) ? g({
2716
2869
  ...t,
2717
2870
  operator: n,
2718
2871
  values: []
@@ -2728,41 +2881,41 @@ function Zt({ showAdvancedOperators: e = !1, ...t }) {
2728
2881
  disabledControls: a,
2729
2882
  update: o
2730
2883
  };
2731
- return /* @__PURE__ */ (0, $.jsxs)("section", {
2884
+ return /* @__PURE__ */ (0, k.jsxs)("section", {
2732
2885
  className: "astrato-app-filter-bar__editor",
2733
2886
  "aria-label": `Filter ${c.name}`,
2734
2887
  children: [
2735
- /* @__PURE__ */ (0, $.jsx)(Mt, {
2888
+ /* @__PURE__ */ (0, k.jsx)(Mt, {
2736
2889
  field: c,
2737
2890
  filter: l,
2738
2891
  editor: n,
2739
2892
  showAdvancedOperators: e
2740
2893
  }),
2741
- r === "list" && /* @__PURE__ */ (0, $.jsx)(It, {
2894
+ r === "list" && /* @__PURE__ */ (0, k.jsx)(It, {
2742
2895
  field: c,
2743
2896
  filter: l,
2744
2897
  editor: n,
2745
2898
  showAdvancedOperators: e
2746
2899
  }),
2747
- r === "text" && e && /* @__PURE__ */ (0, $.jsxs)("label", {
2900
+ r === "text" && e && /* @__PURE__ */ (0, k.jsxs)("label", {
2748
2901
  className: "astrato-app-filter-bar__label",
2749
- children: ["Match text", /* @__PURE__ */ (0, $.jsx)(jt, {
2902
+ children: ["Match text", /* @__PURE__ */ (0, k.jsx)(jt, {
2750
2903
  field: c,
2751
2904
  filter: l,
2752
2905
  editor: n
2753
2906
  })]
2754
2907
  }),
2755
- r === "scalar" && /* @__PURE__ */ (0, $.jsx)(Ft, { ...u }),
2756
- r === "null" && /* @__PURE__ */ (0, $.jsx)("p", {
2908
+ r === "scalar" && /* @__PURE__ */ (0, k.jsx)(Ft, { ...u }),
2909
+ r === "null" && /* @__PURE__ */ (0, k.jsx)("p", {
2757
2910
  className: "astrato-app-filter-bar__muted",
2758
2911
  children: "This operator matches whether the field has a value."
2759
2912
  }),
2760
- r === "geo" && /* @__PURE__ */ (0, $.jsx)(Et, { ...u }),
2761
- (r === "range" || r === "date") && /* @__PURE__ */ (0, $.jsx)(Pt, {
2913
+ r === "geo" && /* @__PURE__ */ (0, k.jsx)(Et, { ...u }),
2914
+ (r === "range" || r === "date") && /* @__PURE__ */ (0, k.jsx)(Pt, {
2762
2915
  ...u,
2763
2916
  editorMode: r
2764
2917
  }),
2765
- s && /* @__PURE__ */ (0, $.jsx)("p", {
2918
+ s && /* @__PURE__ */ (0, k.jsx)("p", {
2766
2919
  className: "astrato-app-filter-bar__error",
2767
2920
  role: "alert",
2768
2921
  children: s
@@ -2770,13 +2923,13 @@ function Zt({ showAdvancedOperators: e = !1, ...t }) {
2770
2923
  ]
2771
2924
  });
2772
2925
  }
2773
- var Qt = (e) => !!e && typeof e == "object" && "fieldKey" in e && "operator" in e, $t = (e) => !!e.fieldKey && J(e), en = (e) => {
2926
+ var Qt = (e) => !!e && typeof e == "object" && "fieldKey" in e && "operator" in e, $t = (e) => !!e.fieldKey && Ze(e), en = (e) => {
2774
2927
  let t = e.filters ?? [], n = t.filter(Qt), r = e.filterGroups ?? [];
2775
2928
  return [...t, ...r].length > 0 && t.length === n.length && n.every($t) && r.every(en);
2776
2929
  }, tn = (e = []) => ({
2777
2930
  filters: [e[0] ? dt(e[0]) : {
2778
2931
  fieldKey: "",
2779
- operator: W.FilterOperator.InList,
2932
+ operator: K.FilterOperator.InList,
2780
2933
  values: []
2781
2934
  }],
2782
2935
  filterGroups: [],
@@ -2798,7 +2951,7 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2798
2951
  ...e,
2799
2952
  filters: [...e.filters ?? [], t[0] ? dt(t[0]) : {
2800
2953
  fieldKey: "",
2801
- operator: W.FilterOperator.InList,
2954
+ operator: K.FilterOperator.InList,
2802
2955
  values: []
2803
2956
  }]
2804
2957
  }));
@@ -2813,16 +2966,16 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2813
2966
  filterGroups: (t.filterGroups ?? []).filter((t, n) => n !== e)
2814
2967
  }));
2815
2968
  };
2816
- return /* @__PURE__ */ (0, $.jsxs)("div", {
2969
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
2817
2970
  className: "astrato-app-filter-bar__group",
2818
2971
  "data-operator": e.or ? "or" : "and",
2819
2972
  children: [
2820
- /* @__PURE__ */ (0, $.jsxs)("div", {
2973
+ /* @__PURE__ */ (0, k.jsxs)("div", {
2821
2974
  className: "astrato-app-filter-bar__row",
2822
2975
  children: [
2823
- /* @__PURE__ */ (0, $.jsxs)("label", {
2976
+ /* @__PURE__ */ (0, k.jsxs)("label", {
2824
2977
  className: "astrato-app-filter-bar__label",
2825
- children: ["Match", /* @__PURE__ */ (0, $.jsxs)(O, {
2978
+ children: ["Match", /* @__PURE__ */ (0, k.jsxs)(M, {
2826
2979
  className: "astrato-app-filter-bar__control",
2827
2980
  value: e.or ? "or" : "and",
2828
2981
  disabled: i,
@@ -2830,21 +2983,21 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2830
2983
  ...t,
2831
2984
  or: e.currentTarget.value === "or"
2832
2985
  })),
2833
- children: [/* @__PURE__ */ (0, $.jsx)("option", {
2986
+ children: [/* @__PURE__ */ (0, k.jsx)("option", {
2834
2987
  value: "and",
2835
2988
  children: "All conditions (AND)"
2836
- }), /* @__PURE__ */ (0, $.jsx)("option", {
2989
+ }), /* @__PURE__ */ (0, k.jsx)("option", {
2837
2990
  value: "or",
2838
2991
  children: "Any condition (OR)"
2839
2992
  })]
2840
2993
  })]
2841
2994
  }),
2842
- /* @__PURE__ */ (0, $.jsx)(T, {
2995
+ /* @__PURE__ */ (0, k.jsx)(A, {
2843
2996
  disabled: i,
2844
2997
  onClick: c,
2845
2998
  children: "Add condition"
2846
2999
  }),
2847
- /* @__PURE__ */ (0, $.jsx)(T, {
3000
+ /* @__PURE__ */ (0, k.jsx)(A, {
2848
3001
  disabled: i,
2849
3002
  onClick: l,
2850
3003
  children: "Add nested group"
@@ -2853,13 +3006,13 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2853
3006
  }),
2854
3007
  (e.filters ?? []).map((e, r) => {
2855
3008
  let a = t.find((t) => t.key === e.fieldKey);
2856
- return /* @__PURE__ */ (0, $.jsxs)("div", {
3009
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
2857
3010
  className: "astrato-app-filter-bar__condition",
2858
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3011
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2859
3012
  className: "astrato-app-filter-bar__row",
2860
- children: [/* @__PURE__ */ (0, $.jsxs)("label", {
3013
+ children: [/* @__PURE__ */ (0, k.jsxs)("label", {
2861
3014
  className: "astrato-app-filter-bar__label",
2862
- children: ["Field", /* @__PURE__ */ (0, $.jsxs)(O, {
3015
+ children: ["Field", /* @__PURE__ */ (0, k.jsxs)(M, {
2863
3016
  className: "astrato-app-filter-bar__control",
2864
3017
  value: e.fieldKey,
2865
3018
  disabled: i || !t.length,
@@ -2867,21 +3020,21 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2867
3020
  let n = t.find((t) => t.key === e.currentTarget.value);
2868
3021
  n && o(r, dt(n));
2869
3022
  },
2870
- children: [/* @__PURE__ */ (0, $.jsx)("option", {
3023
+ children: [/* @__PURE__ */ (0, k.jsx)("option", {
2871
3024
  value: "",
2872
3025
  children: "Choose a field"
2873
- }), t.map((e) => /* @__PURE__ */ (0, $.jsx)("option", {
3026
+ }), t.map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
2874
3027
  value: e.key,
2875
3028
  children: e.name
2876
3029
  }, e.key))]
2877
3030
  })]
2878
- }), /* @__PURE__ */ (0, $.jsx)(T, {
3031
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
2879
3032
  disabled: i,
2880
3033
  "aria-label": "Remove condition",
2881
3034
  onClick: () => s(r),
2882
3035
  children: "Remove"
2883
3036
  })]
2884
- }), a && /* @__PURE__ */ (0, $.jsx)(Zt, {
3037
+ }), a && /* @__PURE__ */ (0, k.jsx)(Zt, {
2885
3038
  field: a,
2886
3039
  filter: e,
2887
3040
  services: n,
@@ -2891,20 +3044,20 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2891
3044
  })]
2892
3045
  }, `filter-${r}`);
2893
3046
  }),
2894
- (e.filterGroups ?? []).map((e, r) => /* @__PURE__ */ (0, $.jsxs)("div", {
3047
+ (e.filterGroups ?? []).map((e, r) => /* @__PURE__ */ (0, k.jsxs)("div", {
2895
3048
  className: "astrato-app-filter-bar__nested-group",
2896
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3049
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2897
3050
  className: "astrato-app-filter-bar__row",
2898
- children: [/* @__PURE__ */ (0, $.jsx)("span", {
3051
+ children: [/* @__PURE__ */ (0, k.jsx)("span", {
2899
3052
  className: "astrato-app-filter-bar__muted",
2900
3053
  children: "Nested group"
2901
- }), /* @__PURE__ */ (0, $.jsx)(T, {
3054
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
2902
3055
  disabled: i,
2903
3056
  "aria-label": "Remove nested group",
2904
3057
  onClick: () => u(r),
2905
3058
  children: "Remove group"
2906
3059
  })]
2907
- }), /* @__PURE__ */ (0, $.jsx)(rn, {
3060
+ }), /* @__PURE__ */ (0, k.jsx)(rn, {
2908
3061
  group: e,
2909
3062
  fields: t,
2910
3063
  services: n,
@@ -2919,8 +3072,8 @@ function rn({ group: e, fields: t, services: n, onChange: r, disabled: i }) {
2919
3072
  });
2920
3073
  }
2921
3074
  function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, disabled: a = !1 }) {
2922
- let [o, s] = (0, U.useState)(e), [c, l] = (0, U.useState)([]), [u, d] = (0, U.useState)(null), f = n.find((e) => e.key === o.fieldKey), p = o.associativeListFilter;
2923
- (0, U.useEffect)(() => s(e), [e]), (0, U.useEffect)(() => {
3075
+ let [o, s] = (0, O.useState)(e), [c, l] = (0, O.useState)([]), [u, d] = (0, O.useState)(null), f = n.find((e) => e.key === o.fieldKey), p = o.associativeListFilter;
3076
+ (0, O.useEffect)(() => s(e), [e]), (0, O.useEffect)(() => {
2924
3077
  let e = !0;
2925
3078
  return l([]), o.fieldKey ? (d(null), r.getAssociatedViews(o.fieldKey).then((t) => {
2926
3079
  e && l(t);
@@ -2932,7 +3085,7 @@ function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
2932
3085
  e = !1;
2933
3086
  };
2934
3087
  }, [o.fieldKey, r]);
2935
- let m = (0, U.useMemo)(() => t.filter((e) => c.includes(e.view ?? "")), [t, c]), h = (e, t) => s((n) => ({
3088
+ let m = (0, O.useMemo)(() => t.filter((e) => c.includes(e.view ?? "")), [t, c]), h = (e, t) => s((n) => ({
2936
3089
  ...n,
2937
3090
  associativeListFilter: {
2938
3091
  ...n.associativeListFilter,
@@ -2966,28 +3119,28 @@ function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
2966
3119
  ...p,
2967
3120
  view: f?.view ?? p.view
2968
3121
  }
2969
- }), x = !!(p.intersectFilters?.length || p.unionFilters?.length), ee = [...p.intersectFilters ?? [], ...p.unionFilters ?? []], S = !!(o.fieldKey && ee.length && m.length && !u) && ee.every((e) => en(e.filterGroup)), C = (e, t) => /* @__PURE__ */ (0, $.jsxs)("section", {
3122
+ }), x = !!(p.intersectFilters?.length || p.unionFilters?.length), S = [...p.intersectFilters ?? [], ...p.unionFilters ?? []], C = !!(o.fieldKey && S.length && m.length && !u) && S.every((e) => en(e.filterGroup)), w = (e, t) => /* @__PURE__ */ (0, k.jsxs)("section", {
2970
3123
  className: "astrato-app-filter-bar__association-list",
2971
3124
  "aria-label": t,
2972
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3125
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2973
3126
  className: "astrato-app-filter-bar__row",
2974
- children: [/* @__PURE__ */ (0, $.jsx)("h4", {
3127
+ children: [/* @__PURE__ */ (0, k.jsx)("h4", {
2975
3128
  className: "astrato-app-filter-bar__field",
2976
3129
  children: t
2977
- }), /* @__PURE__ */ (0, $.jsxs)(T, {
3130
+ }), /* @__PURE__ */ (0, k.jsxs)(A, {
2978
3131
  disabled: a || !m.length,
2979
3132
  onClick: () => _(e),
2980
3133
  children: ["Add ", e === "intersectFilters" ? "intersection" : "union"]
2981
3134
  })]
2982
- }), (p[e] ?? []).map((t, n) => /* @__PURE__ */ (0, $.jsxs)("article", {
3135
+ }), (p[e] ?? []).map((t, n) => /* @__PURE__ */ (0, k.jsxs)("article", {
2983
3136
  className: "astrato-app-filter-bar__association",
2984
3137
  "data-negative": t.isNegativeAssociation === !0,
2985
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3138
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
2986
3139
  className: "astrato-app-filter-bar__row",
2987
3140
  children: [
2988
- /* @__PURE__ */ (0, $.jsxs)("label", {
3141
+ /* @__PURE__ */ (0, k.jsxs)("label", {
2989
3142
  className: "astrato-app-filter-bar__muted",
2990
- children: [/* @__PURE__ */ (0, $.jsx)("input", {
3143
+ children: [/* @__PURE__ */ (0, k.jsx)("input", {
2991
3144
  type: "checkbox",
2992
3145
  checked: t.isNegativeAssociation === !0,
2993
3146
  disabled: a,
@@ -3000,18 +3153,18 @@ function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
3000
3153
  }
3001
3154
  }), "Exclude this association"]
3002
3155
  }),
3003
- /* @__PURE__ */ (0, $.jsxs)(T, {
3156
+ /* @__PURE__ */ (0, k.jsxs)(A, {
3004
3157
  disabled: a,
3005
3158
  onClick: () => v(e, n),
3006
3159
  children: ["Move to ", e === "intersectFilters" ? "union" : "intersection"]
3007
3160
  }),
3008
- /* @__PURE__ */ (0, $.jsx)(T, {
3161
+ /* @__PURE__ */ (0, k.jsx)(A, {
3009
3162
  disabled: a,
3010
3163
  onClick: () => y(e, n),
3011
3164
  children: "Remove"
3012
3165
  })
3013
3166
  ]
3014
- }), /* @__PURE__ */ (0, $.jsx)(rn, {
3167
+ }), /* @__PURE__ */ (0, k.jsx)(rn, {
3015
3168
  group: t.filterGroup,
3016
3169
  fields: m,
3017
3170
  services: r,
@@ -3020,15 +3173,15 @@ function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
3020
3173
  })]
3021
3174
  }, `${e}-${n}`))]
3022
3175
  });
3023
- return /* @__PURE__ */ (0, $.jsxs)("section", {
3176
+ return /* @__PURE__ */ (0, k.jsxs)("section", {
3024
3177
  className: "astrato-app-filter-bar__editor",
3025
3178
  "aria-label": "Associative filter",
3026
3179
  children: [
3027
- /* @__PURE__ */ (0, $.jsxs)("div", {
3180
+ /* @__PURE__ */ (0, k.jsxs)("div", {
3028
3181
  className: "astrato-app-filter-bar__fieldset",
3029
- children: [/* @__PURE__ */ (0, $.jsxs)("label", {
3182
+ children: [/* @__PURE__ */ (0, k.jsxs)("label", {
3030
3183
  className: "astrato-app-filter-bar__label",
3031
- children: ["Associate from field", /* @__PURE__ */ (0, $.jsxs)(O, {
3184
+ children: ["Associate from field", /* @__PURE__ */ (0, k.jsxs)(M, {
3032
3185
  className: "astrato-app-filter-bar__control",
3033
3186
  value: o.fieldKey,
3034
3187
  disabled: a || x,
@@ -3043,39 +3196,39 @@ function an({ filter: e, fields: t, targetFields: n, services: r, onChange: i, d
3043
3196
  }
3044
3197
  });
3045
3198
  },
3046
- children: [/* @__PURE__ */ (0, $.jsx)("option", {
3199
+ children: [/* @__PURE__ */ (0, k.jsx)("option", {
3047
3200
  value: "",
3048
3201
  children: "Choose a field"
3049
- }), n.map((e) => /* @__PURE__ */ (0, $.jsx)("option", {
3202
+ }), n.map((e) => /* @__PURE__ */ (0, k.jsx)("option", {
3050
3203
  value: e.key,
3051
3204
  children: e.name
3052
3205
  }, e.key))]
3053
3206
  })]
3054
- }), /* @__PURE__ */ (0, $.jsx)("p", {
3207
+ }), /* @__PURE__ */ (0, k.jsx)("p", {
3055
3208
  className: "astrato-app-filter-bar__muted",
3056
3209
  children: f?.view ? `Conditions apply to associated fields from ${f.view}.` : "Choose a field to load its associated views."
3057
3210
  })]
3058
3211
  }),
3059
- u && /* @__PURE__ */ (0, $.jsx)("p", {
3212
+ u && /* @__PURE__ */ (0, k.jsx)("p", {
3060
3213
  className: "astrato-app-filter-bar__error",
3061
3214
  role: "alert",
3062
3215
  children: u
3063
3216
  }),
3064
- o.fieldKey && c.length === 0 && !u && /* @__PURE__ */ (0, $.jsx)("p", {
3217
+ o.fieldKey && c.length === 0 && !u && /* @__PURE__ */ (0, k.jsx)("p", {
3065
3218
  className: "astrato-app-filter-bar__muted",
3066
3219
  children: "This field has no associated views."
3067
3220
  }),
3068
- C("intersectFilters", "Intersections"),
3069
- C("unionFilters", "Unions"),
3070
- /* @__PURE__ */ (0, $.jsxs)("div", {
3221
+ w("intersectFilters", "Intersections"),
3222
+ w("unionFilters", "Unions"),
3223
+ /* @__PURE__ */ (0, k.jsxs)("div", {
3071
3224
  className: "astrato-app-filter-bar__toolbar",
3072
- children: [/* @__PURE__ */ (0, $.jsx)(T, {
3225
+ children: [/* @__PURE__ */ (0, k.jsx)(A, {
3073
3226
  disabled: a,
3074
3227
  onClick: () => s(e),
3075
3228
  children: "Cancel"
3076
- }), /* @__PURE__ */ (0, $.jsx)(T, {
3229
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
3077
3230
  "data-primary": "true",
3078
- disabled: a || !S,
3231
+ disabled: a || !C,
3079
3232
  onClick: b,
3080
3233
  children: "Update filter"
3081
3234
  })]
@@ -3103,8 +3256,8 @@ var on = (e, t, n, r) => {
3103
3256
  };
3104
3257
  };
3105
3258
  function sn(e, t, n) {
3106
- let r = (0, U.useRef)(null), i = (0, U.useRef)(n);
3107
- return i.current = n, (0, U.useLayoutEffect)(() => {
3259
+ let r = (0, O.useRef)(null), i = (0, O.useRef)(n);
3260
+ return i.current = n, (0, O.useLayoutEffect)(() => {
3108
3261
  let n = r.current;
3109
3262
  if (!n) return;
3110
3263
  let a = n.ownerDocument, o = a.defaultView;
@@ -3141,7 +3294,7 @@ function sn(e, t, n) {
3141
3294
  }, [e, t]), r;
3142
3295
  }
3143
3296
  function cn({ id: e, anchor: t, title: n, subtitle: r, icon: i, className: a = "", placement: o = "bottom", children: s, onClose: c }) {
3144
- return /* @__PURE__ */ (0, $.jsxs)("div", {
3297
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
3145
3298
  ref: sn(t, o, c),
3146
3299
  id: e,
3147
3300
  role: "dialog",
@@ -3149,29 +3302,29 @@ function cn({ id: e, anchor: t, title: n, subtitle: r, icon: i, className: a = "
3149
3302
  "aria-label": n,
3150
3303
  className: `astrato-app-filter-bar__popover ${a}`,
3151
3304
  onKeyDown: (e) => {
3152
- ae(e), e.key === "Escape" && (e.preventDefault(), c());
3305
+ P(e), e.key === "Escape" && (e.preventDefault(), c());
3153
3306
  },
3154
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
3307
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
3155
3308
  className: "astrato-app-filter-bar__popover-header",
3156
3309
  children: [
3157
- /* @__PURE__ */ (0, $.jsx)("span", {
3310
+ /* @__PURE__ */ (0, k.jsx)("span", {
3158
3311
  className: "astrato-app-filter-bar__heading-icon",
3159
3312
  "aria-hidden": "true",
3160
- children: i ?? /* @__PURE__ */ (0, $.jsx)(_, { name: "filter" })
3313
+ children: i ?? /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" })
3161
3314
  }),
3162
- /* @__PURE__ */ (0, $.jsxs)("div", {
3315
+ /* @__PURE__ */ (0, k.jsxs)("div", {
3163
3316
  className: "astrato-app-filter-bar__heading",
3164
- children: [/* @__PURE__ */ (0, $.jsx)("strong", { children: n }), r && /* @__PURE__ */ (0, $.jsx)("span", {
3317
+ children: [/* @__PURE__ */ (0, k.jsx)("strong", { children: n }), r && /* @__PURE__ */ (0, k.jsx)("span", {
3165
3318
  className: "astrato-app-filter-bar__muted",
3166
3319
  children: r
3167
3320
  })]
3168
3321
  }),
3169
- /* @__PURE__ */ (0, $.jsx)(T, {
3322
+ /* @__PURE__ */ (0, k.jsx)(A, {
3170
3323
  "data-variant": "ghost",
3171
3324
  "data-icon-only": "true",
3172
3325
  "aria-label": "Close filter editor",
3173
3326
  onClick: c,
3174
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: "close" })
3327
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
3175
3328
  })
3176
3329
  ]
3177
3330
  }), s]
@@ -3184,8 +3337,8 @@ var ln = (e, t, n, r) => {
3184
3337
  return a;
3185
3338
  }, un = (e, t, n = 480, r = 960) => e !== "collapse-button" && e !== "wrap-collapse-button" ? e : t < n ? "button" : e === "wrap-collapse-button" && t >= Math.max(n, r) ? "wrap" : "collapse";
3186
3339
  function dn(e, t, n) {
3187
- let r = (0, U.useRef)(null), [i, a] = (0, U.useState)(0);
3188
- return (0, U.useLayoutEffect)(() => {
3340
+ let r = (0, O.useRef)(null), [i, a] = (0, O.useState)(0);
3341
+ return (0, O.useLayoutEffect)(() => {
3189
3342
  let t = r.current;
3190
3343
  if (!t || !e) return;
3191
3344
  let n = t.ownerDocument.defaultView;
@@ -3207,12 +3360,12 @@ function dn(e, t, n) {
3207
3360
  };
3208
3361
  }
3209
3362
  function fn(e, t) {
3210
- let n = (0, U.useRef)(null), [r, i] = (0, U.useState)({
3363
+ let n = (0, O.useRef)(null), [r, i] = (0, O.useState)({
3211
3364
  width: 0,
3212
3365
  buttonBreakpoint: 480,
3213
3366
  collapseBreakpoint: 960
3214
3367
  });
3215
- return (0, U.useLayoutEffect)(() => {
3368
+ return (0, O.useLayoutEffect)(() => {
3216
3369
  let e = n.current, r = e?.ownerDocument.defaultView;
3217
3370
  if (!e || !r || !t) return;
3218
3371
  let a = () => {
@@ -3235,10 +3388,10 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3235
3388
  let t = () => {
3236
3389
  let t = e.engine;
3237
3390
  if (!t) return [];
3238
- let n = y(null, t), r = new Map(n.filter(c).map((e) => [e.key, e])), i = /* @__PURE__ */ new Map();
3239
- for (let e of n) {
3240
- if (c(e)) {
3241
- i.set(e.key, {
3391
+ let a = T(null, t), o = new Map(a.filter(r).map((e) => [e.key, e])), s = /* @__PURE__ */ new Map();
3392
+ for (let e of a) {
3393
+ if (r(e)) {
3394
+ s.set(e.key, {
3242
3395
  key: e.key,
3243
3396
  name: e.name,
3244
3397
  view: e.view,
@@ -3246,22 +3399,22 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3246
3399
  });
3247
3400
  continue;
3248
3401
  }
3249
- if (!o(e) || !e.dimension?.fieldKey) continue;
3250
- let t = e.dimension.fieldKey, n = r.get(t);
3251
- if (!i.has(t)) {
3252
- let r = n?.dataType ?? a(e);
3253
- if (!r) continue;
3254
- i.set(t, {
3402
+ if (!n(e) || !e.dimension?.fieldKey) continue;
3403
+ let t = e.dimension.fieldKey, a = o.get(t);
3404
+ if (!s.has(t)) {
3405
+ let n = a?.dataType ?? i(e);
3406
+ if (!n) continue;
3407
+ s.set(t, {
3255
3408
  key: t,
3256
3409
  name: e.name,
3257
- view: n?.view ?? e.dimension.view,
3258
- dataType: r
3410
+ view: a?.view ?? e.dimension.view,
3411
+ dataType: n
3259
3412
  });
3260
3413
  }
3261
3414
  }
3262
- return [...i.values()];
3263
- }, n = () => {
3264
- let t = e.selection.getActiveSelection(W.FilterType.ALL);
3415
+ return [...s.values()];
3416
+ }, a = () => {
3417
+ let t = e.selection.getActiveSelection(K.FilterType.ALL);
3265
3418
  if (typeof t != "object" || !t) return {
3266
3419
  applied: [],
3267
3420
  pending: []
@@ -3271,36 +3424,36 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3271
3424
  applied: Array.isArray(n.applied) ? n.applied : [],
3272
3425
  pending: Array.isArray(n.pending) ? n.pending : []
3273
3426
  };
3274
- }, r = () => qe(n()), i = (e) => {
3427
+ }, o = () => Ke(a()), s = (e) => {
3275
3428
  let n = t().find((t) => t.key === e);
3276
3429
  return n?.view ? {
3277
3430
  name: n.name,
3278
3431
  view: n.view,
3279
3432
  fieldKey: e
3280
3433
  } : void 0;
3281
- }, s = (e) => {
3434
+ }, c = (e) => {
3282
3435
  let n = t().find((t) => t.key === e);
3283
3436
  return {
3284
3437
  fieldKey: e,
3285
3438
  name: n?.name ?? "",
3286
3439
  view: n?.view ?? ""
3287
3440
  };
3288
- }, l = (t) => e.selection.isFieldLocked(s(t)), u = (t) => e.selection.getSingleSelectedFields().some((e) => K(e) === t), d = (t, n) => {
3441
+ }, l = (t) => e.selection.isFieldLocked(c(t)), u = (t) => e.selection.getSingleSelectedFields().some((e) => J(e) === t), d = (t, n) => {
3289
3442
  e.selection.setNewSelectionState(t, n);
3290
3443
  }, f = /* @__PURE__ */ new Set(), p = [], m = /* @__PURE__ */ new Map(), h = () => f.forEach((e) => e()), g = () => {
3291
- let n = t(), i = new Map(n.map((e) => [e.key, e])), a = r(), o = /* @__PURE__ */ new Set([
3444
+ let n = t(), r = new Map(n.map((e) => [e.key, e])), i = o(), a = /* @__PURE__ */ new Set([
3292
3445
  ...n.map((e) => e.key),
3293
- ...a.applied.map((e) => K(e)).filter((e) => !!e),
3294
- ...a.pending.map((e) => K(e)).filter((e) => !!e)
3446
+ ...i.applied.map((e) => J(e)).filter((e) => !!e),
3447
+ ...i.pending.map((e) => J(e)).filter((e) => !!e)
3295
3448
  ]);
3296
- for (let t of o) {
3449
+ for (let t of a) {
3297
3450
  if (m.has(t)) continue;
3298
- let n = i.get(t), r = e.selection.isFieldLocked$({
3451
+ let n = r.get(t), i = e.selection.isFieldLocked$({
3299
3452
  fieldKey: t,
3300
3453
  name: n?.name ?? "",
3301
3454
  view: n?.view ?? ""
3302
3455
  }).subscribe(h);
3303
- m.set(t, r);
3456
+ m.set(t, i);
3304
3457
  }
3305
3458
  }, _ = () => {
3306
3459
  p.forEach((e) => e.unsubscribe()), p = [], m.forEach((e) => e.unsubscribe()), m.clear();
@@ -3320,54 +3473,56 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3320
3473
  return () => {
3321
3474
  f.delete(n), f.size === 0 && _();
3322
3475
  };
3323
- }, b = (e, t) => {
3324
- let r = K(e);
3325
- if (!r || l(r)) return;
3326
- let i = t === "inherit" ? S() : t, a = n(), o = qe(a), s = q(e);
3327
- if (!Ge(e) && !J(e) && u(r) && [...o.applied, ...o.pending].some((e) => q(e) === s && J(e))) return;
3328
- if (i === "auto") {
3329
- if (!J(e)) {
3476
+ }, y = (e, t) => {
3477
+ let n = J(e);
3478
+ if (!n || l(n)) return;
3479
+ let r = t === "inherit" ? S() : t, i = a(), o = Ke(i), s = Y(e);
3480
+ if (!We(e) && !Ze(e) && u(n) && [...o.applied, ...o.pending].some((e) => Y(e) === s && Ze(e))) return;
3481
+ if (r === "auto") {
3482
+ if (!Ze(e)) {
3330
3483
  let e = {
3331
- applied: a.applied.filter((e) => q(e) !== s),
3332
- pending: a.pending.filter((e) => q(e) !== s)
3484
+ applied: i.applied.filter((e) => Y(e) !== s),
3485
+ pending: i.pending.filter((e) => Y(e) !== s)
3333
3486
  };
3334
- d(e, W.FilterType.ALL);
3487
+ d(e, K.FilterType.ALL);
3335
3488
  return;
3336
3489
  }
3337
3490
  let t = {
3338
- applied: [...a.applied.filter((e) => q(e) !== s), e],
3339
- pending: a.pending.filter((e) => q(e) !== s)
3491
+ applied: [...i.applied.filter((e) => Y(e) !== s), e],
3492
+ pending: i.pending.filter((e) => Y(e) !== s)
3340
3493
  };
3341
- d(t, W.FilterType.ALL);
3494
+ d(t, K.FilterType.ALL);
3342
3495
  return;
3343
3496
  }
3344
3497
  let c = {
3345
- applied: a.applied,
3346
- pending: [...a.pending.filter((e) => q(e) !== s), e]
3498
+ applied: i.applied,
3499
+ pending: [...i.pending.filter((e) => Y(e) !== s), e]
3347
3500
  };
3348
- d(c, W.FilterType.ALL);
3349
- }, x = (e) => {
3350
- let t = K(e);
3501
+ d(c, K.FilterType.ALL);
3502
+ }, b = (e) => {
3503
+ let t = J(e);
3351
3504
  if (!t || l(t) || u(t)) return;
3352
- let r = Ke(e), i = n(), a = {
3353
- applied: i.applied.filter((e) => Ke(e) !== r),
3354
- pending: i.pending.filter((e) => Ke(e) !== r)
3505
+ let n = Ge(e), r = a(), i = {
3506
+ applied: r.applied.filter((e) => Ge(e) !== n),
3507
+ pending: r.pending.filter((e) => Ge(e) !== n)
3355
3508
  };
3356
- d(a, W.FilterType.ALL);
3357
- }, ee = () => {
3358
- let n = e.engine;
3359
- if (!n) return [];
3360
- let r = t(), i = new Map(r.map((e) => [e.key, e])), a = n.getGroupedDimensions();
3361
- return y(null, n).flatMap((e) => {
3362
- if (!o(e) || !e.dimension?.group?.fieldKeys.length) return [];
3363
- let t = e.dimension.group.fieldKeys.map((e) => i.get(e)).filter((e) => !!e);
3364
- if (t.length === 0) return [];
3365
- let n = a[e.id] ?? e.dimension.group.fieldKeys.indexOf(e.dimension.fieldKey), r = mn(e.dimension.group.fieldKeys, new Set(i.keys()), n), s = r >= 0 ? r : Math.max(0, t.findIndex((t) => t.key === e.dimension.fieldKey));
3509
+ d(i, K.FilterType.ALL);
3510
+ }, x = () => {
3511
+ let r = e.engine;
3512
+ if (!r) return [];
3513
+ let i = t(), a = new Map(i.map((e) => [e.key, e])), o = r.getGroupedDimensions();
3514
+ return T(null, r).flatMap((e) => {
3515
+ if (!n(e)) return [];
3516
+ let t = e.dimension, r = t?.group;
3517
+ if (!t || !r?.fieldKeys.length) return [];
3518
+ let i = r.fieldKeys.map((e) => a.get(e)).filter((e) => !!e);
3519
+ if (i.length === 0) return [];
3520
+ let s = o[e.id] ?? r.fieldKeys.indexOf(t.fieldKey), c = mn(r.fieldKeys, new Set(a.keys()), s), l = c >= 0 ? c : Math.max(0, i.findIndex((e) => e.key === t.fieldKey));
3366
3521
  return [{
3367
3522
  id: e.id,
3368
3523
  name: e.name,
3369
- fields: t,
3370
- selectedIndex: s
3524
+ fields: i,
3525
+ selectedIndex: l
3371
3526
  }];
3372
3527
  });
3373
3528
  }, S = () => e.selection.getSelectionMode?.() === "manual" ? "manual" : "auto", C = () => {
@@ -3389,38 +3544,38 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3389
3544
  };
3390
3545
  return {
3391
3546
  getFields: t,
3392
- getSelection: r,
3547
+ getSelection: o,
3393
3548
  subscribe: v,
3394
- select: b,
3395
- remove: x,
3549
+ select: y,
3550
+ remove: b,
3396
3551
  apply: () => {
3397
- let t = n().pending;
3552
+ let t = a().pending;
3398
3553
  e.selection.confirmSelectionAll(t, {
3399
3554
  overrideValues: !0,
3400
3555
  overrideOperator: !0
3401
3556
  });
3402
3557
  },
3403
3558
  cancel: () => {
3404
- let e = n();
3559
+ let e = a();
3405
3560
  d({
3406
3561
  applied: e.applied,
3407
3562
  pending: []
3408
- }, W.FilterType.ALL);
3563
+ }, K.FilterType.ALL);
3409
3564
  },
3410
3565
  clear: () => e.selection.clearAllSelection(),
3411
3566
  isLocked: l,
3412
- isSingleSelect: (t) => e.selection.getSingleSelectedFields().some((e) => K(e) === t),
3567
+ isSingleSelect: (t) => e.selection.getSingleSelectedFields().some((e) => J(e) === t),
3413
3568
  canLock: e.selection.canLock === !0,
3414
3569
  toggleLock: (t) => {
3415
- e.selection.toggleFieldLocked(s(t));
3570
+ e.selection.toggleFieldLocked(c(t));
3416
3571
  },
3417
3572
  query: async (t) => {
3418
3573
  if (!e.engine) throw Error("Cannot query filter values without an engine");
3419
3574
  return await e.engine.getData(t);
3420
3575
  },
3421
3576
  areFieldsConnected: (t, n) => {
3422
- let r = i(t), a = i(n);
3423
- return r && a ? e.engine?.areFieldsConnected(r, a) ?? !1 : !1;
3577
+ let r = s(t), i = s(n);
3578
+ return r && i ? e.engine?.areFieldsConnected(r, i) ?? !1 : !1;
3424
3579
  },
3425
3580
  get supportsAssociativeFiltering() {
3426
3581
  return C();
@@ -3440,14 +3595,14 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
3440
3595
  getAssociatedViews: w,
3441
3596
  getSelectionMode: S,
3442
3597
  getTimeZone: () => e.engine?.localeSettings?.timezone,
3443
- getDimensionGroups: ee,
3444
- setDimensionGroup: (n, r) => {
3445
- let i = e.engine;
3446
- if (!i || r < 0) return;
3447
- let a = y(null, i).find((e) => o(e) && e.id === n && e.dimension?.group?.fieldKeys), s = a && o(a) ? a.dimension?.group?.fieldKeys : void 0, c = new Map(t().map((e) => [e.key, e])), l = s ? hn(s, new Set(c.keys()), r) : void 0;
3598
+ getDimensionGroups: x,
3599
+ setDimensionGroup: (r, i) => {
3600
+ let a = e.engine;
3601
+ if (!a || i < 0) return;
3602
+ let o = T(null, a).find((e) => n(e) && e.id === r && e.dimension?.group?.fieldKeys), s = o && n(o) ? o.dimension?.group?.fieldKeys : void 0, c = new Map(t().map((e) => [e.key, e])), l = s ? hn(s, new Set(c.keys()), i) : void 0;
3448
3603
  l !== void 0 && e.emitEvent(pn, {
3449
- ...i.getGroupedDimensions(),
3450
- [n]: l
3604
+ ...a.getGroupedDimensions(),
3605
+ [r]: l
3451
3606
  });
3452
3607
  }
3453
3608
  };
@@ -4042,7 +4197,7 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
4042
4197
  borderRadius: "50%",
4043
4198
  background: "var(--afb-popup-surface, var(--afb-surface, #fff))",
4044
4199
  boxShadow: "0 0 0 6px var(--afb-popup-surface, var(--afb-surface, #fff))",
4045
- animation: `${g({ to: { transform: "rotate(360deg)" } })} 750ms linear infinite`,
4200
+ animation: `${_({ to: { transform: "rotate(360deg)" } })} 750ms linear infinite`,
4046
4201
  "@media (prefers-reduced-motion: reduce)": { animation: "none" }
4047
4202
  },
4048
4203
  "& .astrato-app-filter-bar__sr-only": {
@@ -4166,7 +4321,7 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
4166
4321
  marginBlock: 8,
4167
4322
  minWidth: 0
4168
4323
  }
4169
- }, Tn = p({
4324
+ }, Tn = v({
4170
4325
  ...vn,
4171
4326
  ...yn,
4172
4327
  ...bn,
@@ -4175,444 +4330,444 @@ var pn = "grouped-dimension-level-changed", mn = (e, t, n) => e.flatMap((e, n) =
4175
4330
  ...Cn,
4176
4331
  ...wn
4177
4332
  }), En = /* @__PURE__ */ new Set([
4178
- W.FilterOperator.NotInList,
4179
- W.FilterOperator.NotBetween,
4180
- W.FilterOperator.NotLike,
4181
- W.FilterOperator.NotEquals,
4182
- W.FilterOperator.NotContains,
4183
- W.FilterOperator.NotSet
4184
- ]), Dn = (e, t) => [...e.pending, ...e.applied].find((e) => q(e) === q(t));
4333
+ K.FilterOperator.NotInList,
4334
+ K.FilterOperator.NotBetween,
4335
+ K.FilterOperator.NotLike,
4336
+ K.FilterOperator.NotEquals,
4337
+ K.FilterOperator.NotContains,
4338
+ K.FilterOperator.NotSet
4339
+ ]), Dn = (e, t) => [...e.pending, ...e.applied].find((e) => Y(e) === Y(t));
4185
4340
  function On() {
4186
- return /* @__PURE__ */ (0, $.jsx)(kn, {});
4341
+ return /* @__PURE__ */ (0, k.jsx)(kn, {});
4187
4342
  }
4188
4343
  function kn({ isExpanded: e = !1 }) {
4189
- let t = te(), n = x()((e) => e.vSpec), r = ee(), i = (0, U.useMemo)(() => gn(t), [t]), [a, o] = (0, U.useState)({
4344
+ let t = f(), n = h()((e) => e.vSpec), r = m(), i = (0, O.useMemo)(() => gn(t), [t]), [a, o] = (0, O.useState)({
4190
4345
  applied: [],
4191
4346
  pending: []
4192
- }), [c, l] = (0, U.useState)(0), [u, d] = (0, U.useState)(), [f, p] = (0, U.useState)(), [h, g] = (0, U.useState)(), [v, y] = (0, U.useState)(), b = (0, U.useRef)(), [S, C] = (0, U.useState)(""), w = (0, U.useId)(), ie = (0, U.useId)(), [ae, E] = (0, U.useState)(!1), D = n?.appFilterBarSettings ?? {}, k = () => {
4193
- o(i.getSelection()), l((e) => e + 1);
4194
- }, A = (e) => {
4347
+ }), [l, u] = (0, O.useState)(0), [d, p] = (0, O.useState)(), [g, _] = (0, O.useState)(), [v, y] = (0, O.useState)(), [b, S] = (0, O.useState)(), C = (0, O.useRef)(), [w, T] = (0, O.useState)(""), E = (0, O.useId)(), D = (0, O.useId)(), [te, j] = (0, O.useState)(!1), N = n?.appFilterBarSettings ?? {}, P = () => {
4348
+ o(i.getSelection()), u((e) => e + 1);
4349
+ }, F = (e) => {
4195
4350
  try {
4196
- e(), k(), d(void 0);
4351
+ e(), P(), p(void 0);
4197
4352
  } catch (e) {
4198
- d(e instanceof Error ? e.message : "Could not update filters.");
4353
+ p(e instanceof Error ? e.message : "Could not update filters.");
4199
4354
  }
4200
4355
  };
4201
- (0, U.useEffect)(() => {
4356
+ (0, O.useEffect)(() => {
4202
4357
  let e;
4203
4358
  try {
4204
- k(), e = i.subscribe(k);
4359
+ P(), e = i.subscribe(P);
4205
4360
  } catch (e) {
4206
- d(e instanceof Error ? e.message : "Could not connect to the selection service.");
4361
+ p(e instanceof Error ? e.message : "Could not connect to the selection service.");
4207
4362
  }
4208
4363
  return () => e?.();
4209
- }, [i]), (0, U.useEffect)(() => {
4364
+ }, [i]), (0, O.useEffect)(() => {
4210
4365
  !e && n?.type === s.AppFilterBar && r();
4211
4366
  }, [
4212
4367
  n,
4213
4368
  r,
4214
4369
  e
4215
- ]), (0, U.useEffect)(() => {
4216
- if (!h) return;
4217
- let e = Dn(a, h), t = JSON.stringify(e);
4218
- t !== b.current && (b.current = t, e ? g(structuredClone(e)) : (g(void 0), p(void 0)));
4219
- }, [a, h]);
4220
- let j = (0, U.useMemo)(() => i.getFields(), [i, c]), M = (0, U.useMemo)(() => D.showChartBreakdown === !0 ? i.getDimensionGroups().filter((e) => e.fields.length > 1) : [], [
4370
+ ]), (0, O.useEffect)(() => {
4371
+ if (!v) return;
4372
+ let e = Dn(a, v), t = JSON.stringify(e);
4373
+ t !== C.current && (C.current = t, e ? y(structuredClone(e)) : (y(void 0), _(void 0)));
4374
+ }, [a, v]);
4375
+ let I = (0, O.useMemo)(() => i.getFields(), [i, l]), L = (0, O.useMemo)(() => N.showChartBreakdown === !0 ? i.getDimensionGroups().filter((e) => e.fields.length > 1) : [], [
4221
4376
  i,
4222
- c,
4223
- D.showChartBreakdown
4224
- ]), N = (0, U.useMemo)(() => new Map(j.map((e) => [e.key, e])), [j]), se = D.selectableFieldKeys?.length ? new Set(D.selectableFieldKeys) : void 0, ce = j.filter((e) => !se || se.has(e.key)), P = JSON.stringify(ce), F = i.supportsAssociativeFiltering, le = D.enableAssociativeFilter !== !1 && F, I = f?.kind === "fields", L = F && v?.services === i && v.fieldMetadata === P ? v.fields : [];
4225
- (0, U.useEffect)(() => {
4226
- if (!I || !le) return;
4377
+ l,
4378
+ N.showChartBreakdown
4379
+ ]), ie = (0, O.useMemo)(() => new Map(I.map((e) => [e.key, e])), [I]), ae = N.selectableFieldKeys?.length ? new Set(N.selectableFieldKeys) : void 0, oe = I.filter((e) => !ae || ae.has(e.key)), R = JSON.stringify(oe), z = i.supportsAssociativeFiltering, B = N.enableAssociativeFilter !== !1 && z, V = g?.kind === "fields", H = z && b?.services === i && b.fieldMetadata === R ? b.fields : [];
4380
+ (0, O.useEffect)(() => {
4381
+ if (!V || !B) return;
4227
4382
  let e = new AbortController();
4228
- y(void 0);
4229
- let t = JSON.parse(P);
4383
+ S(void 0);
4384
+ let t = JSON.parse(R);
4230
4385
  return i.getAssociativeFields(t, e.signal).then((t) => {
4231
- e.signal.aborted || y({
4386
+ e.signal.aborted || S({
4232
4387
  services: i,
4233
- fieldMetadata: P,
4388
+ fieldMetadata: R,
4234
4389
  fields: t
4235
4390
  });
4236
4391
  }), () => e.abort();
4237
4392
  }, [
4238
4393
  i,
4239
- P,
4240
- le,
4241
- I
4394
+ R,
4395
+ B,
4396
+ V
4242
4397
  ]);
4243
- let R = ce.filter((e) => `${e.name} ${e.view ?? ""}`.toLocaleLowerCase().includes(S.toLocaleLowerCase().trim())), z = Ye(a), ue = e ? "vertical" : D.orientation ?? "horizontal", { barRef: de, overflow: fe } = fn(!e && D.overflow === "button" ? "button" : ue === "vertical" ? "wrap" : D.overflow ?? "wrap", !!n);
4244
- (0, U.useEffect)(() => {
4245
- fe !== "button" && E(!1), p(void 0), g(void 0);
4246
- }, [fe]);
4247
- let { chipsRef: pe, visibleCount: me } = dn(fe === "collapse", JSON.stringify(z), z.length), he = z.length - me, ge = z.slice(me).some((e) => e.pending), B = a.pending.length > 0, _e = B && a.pending.every(J) && (!h || J(h)), ve = a.applied.length > 0 || B, V = () => {
4248
- p(void 0), g(void 0), b.current = void 0;
4249
- }, ye = () => A(() => {
4250
- i.cancel(), V();
4251
- }), be = () => A(() => {
4252
- i.apply(), V();
4253
- }), H = (e) => N.get(e.fieldKey) ?? {
4398
+ let se = oe.filter((e) => `${e.name} ${e.view ?? ""}`.toLocaleLowerCase().includes(w.toLocaleLowerCase().trim())), U = Je(a), ce = e ? "vertical" : N.orientation ?? "horizontal", { barRef: le, overflow: W } = fn(!e && N.overflow === "button" ? "button" : ce === "vertical" ? "wrap" : N.overflow ?? "wrap", !!n);
4399
+ (0, O.useEffect)(() => {
4400
+ W !== "button" && j(!1), _(void 0), y(void 0);
4401
+ }, [W]);
4402
+ let { chipsRef: ue, visibleCount: de } = dn(W === "collapse", JSON.stringify(U), U.length), fe = U.length - de, pe = U.slice(de).some((e) => e.pending), G = a.pending.length > 0, me = G && a.pending.every(Ze) && (!v || Ze(v)), he = a.applied.length > 0 || G, ge = () => {
4403
+ _(void 0), y(void 0), C.current = void 0;
4404
+ }, _e = () => F(() => {
4405
+ i.cancel(), ge();
4406
+ }), ve = () => F(() => {
4407
+ i.apply(), ge();
4408
+ }), ye = (e) => ie.get(e.fieldKey) ?? {
4254
4409
  key: e.fieldKey,
4255
4410
  name: e.fieldKey,
4256
- dataType: W.FieldType.STRING
4257
- }, xe = (e, t, n = !1) => {
4258
- b.current = JSON.stringify(Dn(a, e)), g(structuredClone(e)), p({
4411
+ dataType: K.FieldType.STRING
4412
+ }, be = (e, t, n = !1) => {
4413
+ C.current = JSON.stringify(Dn(a, e)), y(structuredClone(e)), _({
4259
4414
  kind: "filter",
4260
4415
  anchor: t,
4261
4416
  fromOverflow: n
4262
4417
  });
4263
- }, Se = (e) => {
4264
- if (!f) return;
4418
+ }, xe = (e) => {
4419
+ if (!g) return;
4265
4420
  let t = a.pending.find((t) => t.fieldKey === e.key && !("associativeListFilter" in t)) ?? a.applied.find((t) => t.fieldKey === e.key && !("associativeListFilter" in t));
4266
- xe(t ?? dt(e), f.anchor);
4267
- }, Ce = (e) => {
4268
- g(e);
4269
- let t = D.selectionMode ?? "inherit", n = t === "inherit" ? i.getSelectionMode() : t, r = !!Dn(i.getSelection(), e), a = "operator" in e && ([W.FilterOperator.InList, W.FilterOperator.NotInList].includes(e.operator) && !e.values?.length || [W.FilterOperator.Like, W.FilterOperator.NotLike].includes(e.operator) && !String(e.values?.[0] ?? "").trim());
4270
- (J(e) || r && (n === "manual" || a)) && A(() => i.select(e, t)), b.current = JSON.stringify(Dn(i.getSelection(), e));
4271
- }, we = (e, t, n = !1) => {
4272
- let { id: r, filter: a, pending: o } = e, s = H(a), c = i.isLocked(a.fieldKey), l = i.isSingleSelect(a.fieldKey), u = Qe(a, (e) => [
4273
- W.FieldType.DATE,
4274
- W.FieldType.TIME,
4275
- W.FieldType.TIMESTAMP,
4276
- W.FieldType.TIMESTAMP_TZ
4277
- ].includes(s.dataType) && "operator" in a && !a.datePart && (typeof e == "number" || typeof e == "string") ? mt(e, s.dataType, i.getTimeZone() ?? "UTC").replace("T", " ") || String(e) : e === null ? "Null" : String(e)), d = "operator" in a && En.has(a.operator), p = f?.kind === "filter" && h && Ke(h) === r;
4278
- return /* @__PURE__ */ (0, $.jsxs)("div", {
4421
+ be(t ?? dt(e), g.anchor);
4422
+ }, Se = (e) => {
4423
+ y(e);
4424
+ let t = N.selectionMode ?? "inherit", n = t === "inherit" ? i.getSelectionMode() : t, r = !!Dn(i.getSelection(), e), a = "operator" in e && ([K.FilterOperator.InList, K.FilterOperator.NotInList].includes(e.operator) && !e.values?.length || [K.FilterOperator.Like, K.FilterOperator.NotLike].includes(e.operator) && !String(e.values?.[0] ?? "").trim());
4425
+ (Ze(e) || r && (n === "manual" || a)) && F(() => i.select(e, t)), C.current = JSON.stringify(Dn(i.getSelection(), e));
4426
+ }, Ce = (e, t, n = !1) => {
4427
+ let { id: r, filter: a, pending: o } = e, s = ye(a), c = i.isLocked(a.fieldKey), l = i.isSingleSelect(a.fieldKey), u = Qe(a, (e) => [
4428
+ K.FieldType.DATE,
4429
+ K.FieldType.TIME,
4430
+ K.FieldType.TIMESTAMP,
4431
+ K.FieldType.TIMESTAMP_TZ
4432
+ ].includes(s.dataType) && "operator" in a && !a.datePart && (typeof e == "number" || typeof e == "string") ? mt(e, s.dataType, i.getTimeZone() ?? "UTC").replace("T", " ") || String(e) : e === null ? "Null" : String(e)), d = "operator" in a && En.has(a.operator), f = g?.kind === "filter" && v && Ge(v) === r;
4433
+ return /* @__PURE__ */ (0, k.jsxs)("div", {
4279
4434
  className: "astrato-app-filter-bar__chip",
4280
- "data-overflow-hidden": !n && t >= me,
4281
- "aria-hidden": !n && t >= me || void 0,
4435
+ "data-overflow-hidden": !n && t >= de,
4436
+ "aria-hidden": !n && t >= de || void 0,
4282
4437
  "data-pending": !!o,
4283
4438
  "data-excluded": d,
4284
4439
  "data-locked": c,
4285
- children: [/* @__PURE__ */ (0, $.jsxs)(T, {
4440
+ children: [/* @__PURE__ */ (0, k.jsxs)(A, {
4286
4441
  "aria-haspopup": "dialog",
4287
- "aria-controls": w,
4288
- "aria-expanded": !!p,
4442
+ "aria-controls": E,
4443
+ "aria-expanded": !!f,
4289
4444
  "aria-label": `${d ? "Not " : ""}${s.name}: ${u.text || "Choose values"}${c ? ", locked" : ""}`,
4290
- onClick: (e) => xe(a, n && f ? f.anchor : e.currentTarget, n),
4445
+ onClick: (e) => be(a, n && g ? g.anchor : e.currentTarget, n),
4291
4446
  title: `${s.name}: ${u.text}`,
4292
4447
  children: [
4293
- /* @__PURE__ */ (0, $.jsx)(_, { name: "filter" }),
4294
- /* @__PURE__ */ (0, $.jsxs)("span", {
4448
+ /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }),
4449
+ /* @__PURE__ */ (0, k.jsxs)("span", {
4295
4450
  className: "astrato-app-filter-bar__chip-label",
4296
4451
  children: [
4297
- /* @__PURE__ */ (0, $.jsx)("strong", { children: d ? `Not ${s.name}` : s.name }),
4298
- /* @__PURE__ */ (0, $.jsx)("span", {
4452
+ /* @__PURE__ */ (0, k.jsx)("strong", { children: d ? `Not ${s.name}` : s.name }),
4453
+ /* @__PURE__ */ (0, k.jsx)("span", {
4299
4454
  className: "astrato-app-filter-bar__chip-divider",
4300
4455
  "aria-hidden": "true",
4301
4456
  children: "·"
4302
4457
  }),
4303
- /* @__PURE__ */ (0, $.jsx)("span", {
4458
+ /* @__PURE__ */ (0, k.jsx)("span", {
4304
4459
  className: "astrato-app-filter-bar__chip-summary",
4305
4460
  children: u.text || "Choose values"
4306
4461
  })
4307
4462
  ]
4308
4463
  }),
4309
- c && /* @__PURE__ */ (0, $.jsx)("span", {
4464
+ c && /* @__PURE__ */ (0, k.jsx)("span", {
4310
4465
  "aria-label": "Locked",
4311
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: "lock" })
4466
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: "lock" })
4312
4467
  })
4313
4468
  ]
4314
- }), /* @__PURE__ */ (0, $.jsx)(T, {
4469
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
4315
4470
  "data-icon-only": "true",
4316
4471
  "aria-label": `Remove ${s.name} filter`,
4317
4472
  disabled: c || l,
4318
4473
  onClick: (e) => {
4319
4474
  let t = e.currentTarget.closest(".astrato-app-filter-bar__chip"), n = (t?.nextElementSibling ?? t?.previousElementSibling)?.querySelector("button:not(:disabled)") ?? t?.closest("[role=\"dialog\"], dialog")?.querySelector("button:not(:disabled)");
4320
- A(() => {
4321
- i.remove(a), p ? V() : n?.focus();
4475
+ F(() => {
4476
+ i.remove(a), f ? ge() : n?.focus();
4322
4477
  });
4323
4478
  },
4324
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: "close" })
4479
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
4325
4480
  })]
4326
4481
  }, r);
4327
4482
  };
4328
- return n ? fe === "button" ? /* @__PURE__ */ (0, $.jsxs)("div", {
4329
- ref: de,
4330
- className: m("astrato-app-filter-bar", Tn),
4483
+ return n ? W === "button" ? /* @__PURE__ */ (0, k.jsxs)("div", {
4484
+ ref: le,
4485
+ className: c("astrato-app-filter-bar", Tn),
4331
4486
  "data-overflow": "button",
4332
4487
  role: "region",
4333
4488
  "aria-label": "Filters",
4334
- children: [/* @__PURE__ */ (0, $.jsxs)(T, {
4489
+ children: [/* @__PURE__ */ (0, k.jsxs)(A, {
4335
4490
  className: "astrato-app-filter-bar__overflow astrato-app-filter-bar__trigger",
4336
- "data-pending": B,
4337
- "aria-label": `Filters (${z.length})${B ? ", pending changes" : ""}`,
4491
+ "data-pending": G,
4492
+ "aria-label": `Filters (${U.length})${G ? ", pending changes" : ""}`,
4338
4493
  "aria-haspopup": "dialog",
4339
- "aria-expanded": ae,
4340
- "aria-controls": ie,
4341
- onClick: () => E(!0),
4494
+ "aria-expanded": te,
4495
+ "aria-controls": D,
4496
+ onClick: () => j(!0),
4342
4497
  children: [
4343
- /* @__PURE__ */ (0, $.jsx)(_, { name: "filter" }),
4498
+ /* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }),
4344
4499
  " Filters (",
4345
- z.length,
4500
+ U.length,
4346
4501
  ")"
4347
4502
  ]
4348
- }), ae && /* @__PURE__ */ (0, $.jsxs)(re, {
4349
- id: ie,
4503
+ }), te && /* @__PURE__ */ (0, k.jsxs)(re, {
4504
+ id: D,
4350
4505
  className: "astrato-app-filter-bar__modal",
4351
- "aria-labelledby": `${ie}-title`,
4352
- onCloseDialog: () => E(!1),
4353
- children: [/* @__PURE__ */ (0, $.jsxs)("div", {
4506
+ "aria-labelledby": `${D}-title`,
4507
+ onCloseDialog: () => j(!1),
4508
+ children: [/* @__PURE__ */ (0, k.jsxs)("div", {
4354
4509
  className: "astrato-app-filter-bar__popover-header",
4355
- children: [/* @__PURE__ */ (0, $.jsxs)("strong", {
4356
- id: `${ie}-title`,
4510
+ children: [/* @__PURE__ */ (0, k.jsxs)("strong", {
4511
+ id: `${D}-title`,
4357
4512
  children: [
4358
4513
  "Filters (",
4359
- z.length,
4514
+ U.length,
4360
4515
  ")"
4361
4516
  ]
4362
- }), /* @__PURE__ */ (0, $.jsx)(T, {
4517
+ }), /* @__PURE__ */ (0, k.jsx)(A, {
4363
4518
  "data-icon-only": "true",
4364
4519
  "data-variant": "ghost",
4365
4520
  "aria-label": "Close filters",
4366
- onClick: () => E(!1),
4367
- children: /* @__PURE__ */ (0, $.jsx)(_, { name: "close" })
4521
+ onClick: () => j(!1),
4522
+ children: /* @__PURE__ */ (0, k.jsx)(x, { name: "close" })
4368
4523
  })]
4369
- }), /* @__PURE__ */ (0, $.jsx)(kn, { isExpanded: !0 })]
4524
+ }), /* @__PURE__ */ (0, k.jsx)(kn, { isExpanded: !0 })]
4370
4525
  })]
4371
- }) : /* @__PURE__ */ (0, $.jsxs)("div", {
4372
- ref: de,
4373
- className: m("astrato-app-filter-bar", Tn),
4526
+ }) : /* @__PURE__ */ (0, k.jsxs)("div", {
4527
+ ref: le,
4528
+ className: c("astrato-app-filter-bar", Tn),
4374
4529
  role: "region",
4375
4530
  tabIndex: -1,
4376
4531
  "aria-label": "Filters",
4377
- "data-selection-mode": D.selectionMode ?? "inherit",
4378
- "data-overflow": fe,
4379
- "data-orientation": ue,
4532
+ "data-selection-mode": N.selectionMode ?? "inherit",
4533
+ "data-overflow": W,
4534
+ "data-orientation": ce,
4380
4535
  children: [
4381
- D.enableAddingNewFilters !== !1 && /* @__PURE__ */ (0, $.jsxs)(T, {
4382
- "aria-expanded": f?.kind === "fields",
4383
- "aria-controls": w,
4536
+ N.enableAddingNewFilters !== !1 && /* @__PURE__ */ (0, k.jsxs)(A, {
4537
+ "aria-expanded": g?.kind === "fields",
4538
+ "aria-controls": E,
4384
4539
  "aria-haspopup": "dialog",
4385
4540
  onClick: (e) => {
4386
- C(""), g(void 0), p({
4541
+ T(""), y(void 0), _({
4387
4542
  kind: "fields",
4388
4543
  anchor: e.currentTarget
4389
4544
  });
4390
4545
  },
4391
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "plus" }), " New filter"]
4546
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "plus" }), " New filter"]
4392
4547
  }),
4393
- M.length > 0 && /* @__PURE__ */ (0, $.jsxs)(T, {
4548
+ L.length > 0 && /* @__PURE__ */ (0, k.jsxs)(A, {
4394
4549
  "aria-haspopup": "dialog",
4395
- "aria-controls": w,
4396
- "aria-expanded": f?.kind === "groups",
4397
- onClick: (e) => p({
4550
+ "aria-controls": E,
4551
+ "aria-expanded": g?.kind === "groups",
4552
+ onClick: (e) => _({
4398
4553
  kind: "groups",
4399
4554
  anchor: e.currentTarget
4400
4555
  }),
4401
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "dimensions" }), " Chart breakdown"]
4556
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "dimensions" }), " Chart breakdown"]
4402
4557
  }),
4403
- /* @__PURE__ */ (0, $.jsxs)("div", {
4404
- ref: pe,
4558
+ /* @__PURE__ */ (0, k.jsxs)("div", {
4559
+ ref: ue,
4405
4560
  className: "astrato-app-filter-bar__chips",
4406
4561
  "aria-live": "polite",
4407
4562
  "aria-relevant": "additions removals",
4408
4563
  children: [
4409
- z.map((e, t) => we(e, t)),
4410
- fe === "collapse" && z.length > 0 && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)("div", {
4564
+ U.map((e, t) => Ce(e, t)),
4565
+ W === "collapse" && U.length > 0 && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)("div", {
4411
4566
  className: "astrato-app-filter-bar__overflow-probes",
4412
4567
  "aria-hidden": "true",
4413
- children: z.map((e, t) => /* @__PURE__ */ (0, $.jsxs)("span", {
4568
+ children: U.map((e, t) => /* @__PURE__ */ (0, k.jsxs)("span", {
4414
4569
  className: "astrato-app-filter-bar__button astrato-app-filter-bar__overflow",
4415
4570
  "data-overflow-count": t + 1,
4416
4571
  children: ["+", t + 1]
4417
4572
  }, e.id))
4418
- }), /* @__PURE__ */ (0, $.jsxs)(T, {
4573
+ }), /* @__PURE__ */ (0, k.jsxs)(A, {
4419
4574
  className: "astrato-app-filter-bar__overflow",
4420
- "data-overflow-hidden": he === 0,
4421
- "data-pending": ge,
4422
- "aria-hidden": he === 0 || void 0,
4423
- "aria-label": `${he} hidden filters${ge ? ", pending changes" : ""}`,
4575
+ "data-overflow-hidden": fe === 0,
4576
+ "data-pending": pe,
4577
+ "aria-hidden": fe === 0 || void 0,
4578
+ "aria-label": `${fe} hidden filters${pe ? ", pending changes" : ""}`,
4424
4579
  "aria-haspopup": "dialog",
4425
- "aria-controls": w,
4426
- "aria-expanded": f?.kind === "overflow" || !!f?.fromOverflow,
4580
+ "aria-controls": E,
4581
+ "aria-expanded": g?.kind === "overflow" || !!g?.fromOverflow,
4427
4582
  onClick: (e) => {
4428
- g(void 0), p({
4583
+ y(void 0), _({
4429
4584
  kind: "overflow",
4430
4585
  anchor: e.currentTarget
4431
4586
  });
4432
4587
  },
4433
- children: ["+", he]
4588
+ children: ["+", fe]
4434
4589
  })] }),
4435
- !z.length && /* @__PURE__ */ (0, $.jsxs)("span", {
4590
+ !U.length && /* @__PURE__ */ (0, k.jsxs)("span", {
4436
4591
  className: "astrato-app-filter-bar__empty-bar",
4437
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "filter" }), "No active filters"]
4592
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "filter" }), "No active filters"]
4438
4593
  })
4439
4594
  ]
4440
4595
  }),
4441
- /* @__PURE__ */ (0, $.jsxs)("div", {
4596
+ /* @__PURE__ */ (0, k.jsxs)("div", {
4442
4597
  className: "astrato-app-filter-bar__actions",
4443
- children: [B && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(T, {
4444
- onClick: ye,
4598
+ children: [G && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(A, {
4599
+ onClick: _e,
4445
4600
  "data-variant": "ghost",
4446
4601
  children: "Cancel"
4447
- }), /* @__PURE__ */ (0, $.jsxs)(T, {
4602
+ }), /* @__PURE__ */ (0, k.jsxs)(A, {
4448
4603
  "data-primary": "true",
4449
- disabled: !_e,
4450
- onClick: be,
4451
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "check" }), " Apply"]
4452
- })] }), D.showClearAll !== !1 && ve && /* @__PURE__ */ (0, $.jsxs)(T, {
4604
+ disabled: !me,
4605
+ onClick: ve,
4606
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
4607
+ })] }), N.showClearAll !== !1 && he && /* @__PURE__ */ (0, k.jsxs)(A, {
4453
4608
  "data-variant": "ghost",
4454
- onClick: () => A(() => {
4455
- i.clear(), V();
4609
+ onClick: () => F(() => {
4610
+ i.clear(), ge();
4456
4611
  }),
4457
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "reset" }), " Clear all"]
4612
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "reset" }), " Clear all"]
4458
4613
  })]
4459
4614
  }),
4460
- u && /* @__PURE__ */ (0, $.jsx)("div", {
4615
+ d && /* @__PURE__ */ (0, k.jsx)("div", {
4461
4616
  className: "astrato-app-filter-bar__error",
4462
4617
  role: "alert",
4463
- children: u
4618
+ children: d
4464
4619
  }),
4465
- f && (f.kind !== "groups" || M.length > 0) && /* @__PURE__ */ (0, $.jsxs)(cn, {
4466
- id: w,
4467
- anchor: f.anchor,
4468
- placement: ue === "vertical" ? "side" : "bottom",
4469
- className: f.kind === "fields" ? "astrato-app-filter-bar__field-picker" : f.kind === "overflow" ? "astrato-app-filter-bar__overflow-popover" : void 0,
4470
- onClose: V,
4471
- subtitle: f.kind === "groups" ? "Choose the fields shown in your charts" : f.kind === "filter" && h ? H(h).view : void 0,
4472
- icon: f.kind === "filter" && h ? /* @__PURE__ */ (0, $.jsx)(ne, {
4473
- fieldType: H(h).dataType,
4620
+ g && (g.kind !== "groups" || L.length > 0) && /* @__PURE__ */ (0, k.jsxs)(cn, {
4621
+ id: E,
4622
+ anchor: g.anchor,
4623
+ placement: ce === "vertical" ? "side" : "bottom",
4624
+ className: g.kind === "fields" ? "astrato-app-filter-bar__field-picker" : g.kind === "overflow" ? "astrato-app-filter-bar__overflow-popover" : void 0,
4625
+ onClose: ge,
4626
+ subtitle: g.kind === "groups" ? "Choose the fields shown in your charts" : g.kind === "filter" && v ? ye(v).view : void 0,
4627
+ icon: g.kind === "filter" && v ? /* @__PURE__ */ (0, k.jsx)(ee, {
4628
+ fieldType: ye(v).dataType,
4474
4629
  fill: "currentColor"
4475
- }) : /* @__PURE__ */ (0, $.jsx)(_, { name: f.kind === "groups" ? "dimensions" : "filter" }),
4476
- title: f.kind === "fields" ? "Add filter" : f.kind === "groups" ? "Chart breakdown" : f.kind === "overflow" ? `Filters (${z.length})` : h ? H(h).name : "Filter",
4630
+ }) : /* @__PURE__ */ (0, k.jsx)(x, { name: g.kind === "groups" ? "dimensions" : "filter" }),
4631
+ title: g.kind === "fields" ? "Add filter" : g.kind === "groups" ? "Chart breakdown" : g.kind === "overflow" ? `Filters (${U.length})` : v ? ye(v).name : "Filter",
4477
4632
  children: [
4478
- f.kind === "overflow" && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsxs)("div", {
4633
+ g.kind === "overflow" && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsxs)("div", {
4479
4634
  className: "astrato-app-filter-bar__overflow-list",
4480
- children: [z.map((e, t) => we(e, t, !0)), !z.length && /* @__PURE__ */ (0, $.jsx)("p", {
4635
+ children: [U.map((e, t) => Ce(e, t, !0)), !U.length && /* @__PURE__ */ (0, k.jsx)("p", {
4481
4636
  className: "astrato-app-filter-bar__muted",
4482
4637
  children: "No active filters"
4483
4638
  })]
4484
- }), B && /* @__PURE__ */ (0, $.jsxs)("div", {
4639
+ }), G && /* @__PURE__ */ (0, k.jsxs)("div", {
4485
4640
  className: "astrato-app-filter-bar__editor-footer",
4486
- children: [/* @__PURE__ */ (0, $.jsx)(T, {
4641
+ children: [/* @__PURE__ */ (0, k.jsx)(A, {
4487
4642
  "data-variant": "ghost",
4488
- onClick: ye,
4643
+ onClick: _e,
4489
4644
  children: "Cancel"
4490
- }), /* @__PURE__ */ (0, $.jsxs)(T, {
4645
+ }), /* @__PURE__ */ (0, k.jsxs)(A, {
4491
4646
  "data-primary": "true",
4492
- disabled: !_e,
4493
- onClick: be,
4494
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "check" }), " Apply"]
4647
+ disabled: !me,
4648
+ onClick: ve,
4649
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
4495
4650
  })]
4496
4651
  })] }),
4497
- f.kind === "fields" && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [
4498
- /* @__PURE__ */ (0, $.jsx)(oe, {
4652
+ g.kind === "fields" && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [
4653
+ /* @__PURE__ */ (0, k.jsx)(ne, {
4499
4654
  "aria-label": "Search fields",
4500
4655
  placeholder: "Search fields…",
4501
- value: S,
4502
- onChange: (e) => C(e.target.value)
4656
+ value: w,
4657
+ onChange: (e) => T(e.target.value)
4503
4658
  }),
4504
- /* @__PURE__ */ (0, $.jsxs)("div", {
4659
+ /* @__PURE__ */ (0, k.jsxs)("div", {
4505
4660
  className: "astrato-app-filter-bar__values",
4506
- children: [R.map((e) => /* @__PURE__ */ (0, $.jsxs)(T, {
4661
+ children: [se.map((e) => /* @__PURE__ */ (0, k.jsxs)(A, {
4507
4662
  className: "astrato-app-filter-bar__value astrato-app-filter-bar__field-option",
4508
4663
  disabled: i.isLocked(e.key),
4509
4664
  title: e.view ? `${e.name} · ${e.view}` : e.name,
4510
- onClick: () => Se(e),
4665
+ onClick: () => xe(e),
4511
4666
  children: [
4512
- /* @__PURE__ */ (0, $.jsx)("span", {
4667
+ /* @__PURE__ */ (0, k.jsx)("span", {
4513
4668
  className: "astrato-app-filter-bar__field-icon",
4514
4669
  "aria-hidden": "true",
4515
- children: /* @__PURE__ */ (0, $.jsx)(ne, {
4670
+ children: /* @__PURE__ */ (0, k.jsx)(ee, {
4516
4671
  fieldType: e.dataType,
4517
4672
  fill: "currentColor"
4518
4673
  })
4519
4674
  }),
4520
- /* @__PURE__ */ (0, $.jsxs)("span", {
4675
+ /* @__PURE__ */ (0, k.jsxs)("span", {
4521
4676
  className: "astrato-app-filter-bar__field-name",
4522
- children: [/* @__PURE__ */ (0, $.jsx)("span", {
4677
+ children: [/* @__PURE__ */ (0, k.jsx)("span", {
4523
4678
  className: "astrato-app-filter-bar__field-label",
4524
4679
  children: e.name
4525
- }), /* @__PURE__ */ (0, $.jsx)("small", {
4680
+ }), /* @__PURE__ */ (0, k.jsx)("small", {
4526
4681
  className: "astrato-app-filter-bar__muted",
4527
4682
  children: e.view
4528
4683
  })]
4529
4684
  }),
4530
- /* @__PURE__ */ (0, $.jsx)(_, { name: "chevronRight" })
4685
+ /* @__PURE__ */ (0, k.jsx)(x, { name: "chevronRight" })
4531
4686
  ]
4532
- }, e.key)), !R.length && /* @__PURE__ */ (0, $.jsx)("p", {
4687
+ }, e.key)), !se.length && /* @__PURE__ */ (0, k.jsx)("p", {
4533
4688
  className: "astrato-app-filter-bar__muted",
4534
4689
  children: "No matching fields"
4535
4690
  })]
4536
4691
  }),
4537
- le && L.length > 0 && /* @__PURE__ */ (0, $.jsxs)(T, {
4692
+ B && H.length > 0 && /* @__PURE__ */ (0, k.jsxs)(A, {
4538
4693
  className: "astrato-app-filter-bar__association-action",
4539
4694
  "data-variant": "ghost",
4540
- onClick: () => xe({
4541
- fieldKey: L[0].key,
4695
+ onClick: () => be({
4696
+ fieldKey: H[0].key,
4542
4697
  associativeListFilter: {
4543
- view: L[0].view ?? "",
4698
+ view: H[0].view ?? "",
4544
4699
  intersectFilters: [],
4545
4700
  unionFilters: []
4546
4701
  }
4547
- }, f.anchor),
4548
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "association" }), " New associative filter"]
4702
+ }, g.anchor),
4703
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "association" }), " New associative filter"]
4549
4704
  })
4550
4705
  ] }),
4551
- f.kind === "groups" && M.map((e) => /* @__PURE__ */ (0, $.jsxs)("label", {
4706
+ g.kind === "groups" && L.map((e) => /* @__PURE__ */ (0, k.jsxs)("label", {
4552
4707
  className: "astrato-app-filter-bar__field",
4553
- children: [e.name, /* @__PURE__ */ (0, $.jsx)(O, {
4708
+ children: [e.name, /* @__PURE__ */ (0, k.jsx)(M, {
4554
4709
  value: e.selectedIndex,
4555
- onChange: (t) => A(() => i.setDimensionGroup(e.id, Number(t.target.value))),
4556
- children: e.fields.map((e, t) => /* @__PURE__ */ (0, $.jsx)("option", {
4710
+ onChange: (t) => F(() => i.setDimensionGroup(e.id, Number(t.target.value))),
4711
+ children: e.fields.map((e, t) => /* @__PURE__ */ (0, k.jsx)("option", {
4557
4712
  value: t,
4558
4713
  children: e.name
4559
4714
  }, e.key))
4560
4715
  })]
4561
4716
  }, e.id)),
4562
- f.kind === "filter" && h && /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: ["associativeListFilter" in h ? F ? /* @__PURE__ */ (0, $.jsx)(an, {
4563
- filter: h,
4564
- fields: ce,
4565
- targetFields: L.some((e) => e.key === h.fieldKey) ? L : [H(h), ...L],
4717
+ g.kind === "filter" && v && /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: ["associativeListFilter" in v ? z ? /* @__PURE__ */ (0, k.jsx)(an, {
4718
+ filter: v,
4719
+ fields: oe,
4720
+ targetFields: H.some((e) => e.key === v.fieldKey) ? H : [ye(v), ...H],
4566
4721
  services: i,
4567
- onChange: Ce,
4568
- disabled: i.isLocked(h.fieldKey)
4569
- }) : /* @__PURE__ */ (0, $.jsx)("p", {
4722
+ onChange: Se,
4723
+ disabled: i.isLocked(v.fieldKey)
4724
+ }) : /* @__PURE__ */ (0, k.jsx)("p", {
4570
4725
  className: "astrato-app-filter-bar__muted",
4571
4726
  children: "Associative filter editing is unavailable in this app."
4572
- }) : /* @__PURE__ */ (0, $.jsx)(Zt, {
4573
- field: H(h),
4574
- filter: h,
4727
+ }) : /* @__PURE__ */ (0, k.jsx)(Zt, {
4728
+ field: ye(v),
4729
+ filter: v,
4575
4730
  services: i,
4576
- onChange: Ce,
4577
- disabled: i.isLocked(h.fieldKey)
4578
- }), /* @__PURE__ */ (0, $.jsxs)("div", {
4731
+ onChange: Se,
4732
+ disabled: i.isLocked(v.fieldKey)
4733
+ }), /* @__PURE__ */ (0, k.jsxs)("div", {
4579
4734
  className: "astrato-app-filter-bar__editor-footer",
4580
4735
  children: [
4581
- f.fromOverflow && /* @__PURE__ */ (0, $.jsx)(T, {
4736
+ g.fromOverflow && /* @__PURE__ */ (0, k.jsx)(A, {
4582
4737
  "data-variant": "ghost",
4583
4738
  onClick: () => {
4584
- g(void 0), p({
4739
+ y(void 0), _({
4585
4740
  kind: "overflow",
4586
- anchor: f.anchor
4741
+ anchor: g.anchor
4587
4742
  });
4588
4743
  },
4589
4744
  children: "All filters"
4590
4745
  }),
4591
- i.canLock && /* @__PURE__ */ (0, $.jsxs)(T, {
4746
+ i.canLock && /* @__PURE__ */ (0, k.jsxs)(A, {
4592
4747
  "data-variant": "ghost",
4593
- onClick: () => A(() => i.toggleLock(h.fieldKey)),
4594
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: i.isLocked(h.fieldKey) ? "lock" : "unlock" }), i.isLocked(h.fieldKey) ? "Unlock field" : "Lock field"]
4748
+ onClick: () => F(() => i.toggleLock(v.fieldKey)),
4749
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: i.isLocked(v.fieldKey) ? "lock" : "unlock" }), i.isLocked(v.fieldKey) ? "Unlock field" : "Lock field"]
4595
4750
  }),
4596
- /* @__PURE__ */ (0, $.jsx)("div", {
4751
+ /* @__PURE__ */ (0, k.jsx)("div", {
4597
4752
  className: "astrato-app-filter-bar__actions",
4598
- children: B ? /* @__PURE__ */ (0, $.jsxs)($.Fragment, { children: [/* @__PURE__ */ (0, $.jsx)(T, {
4753
+ children: G ? /* @__PURE__ */ (0, k.jsxs)(k.Fragment, { children: [/* @__PURE__ */ (0, k.jsx)(A, {
4599
4754
  "data-variant": "ghost",
4600
- onClick: ye,
4755
+ onClick: _e,
4601
4756
  children: "Cancel"
4602
- }), /* @__PURE__ */ (0, $.jsxs)(T, {
4757
+ }), /* @__PURE__ */ (0, k.jsxs)(A, {
4603
4758
  "data-primary": "true",
4604
- disabled: !_e,
4605
- onClick: be,
4606
- children: [/* @__PURE__ */ (0, $.jsx)(_, { name: "check" }), " Apply"]
4607
- })] }) : /* @__PURE__ */ (0, $.jsx)(T, {
4608
- onClick: V,
4759
+ disabled: !me,
4760
+ onClick: ve,
4761
+ children: [/* @__PURE__ */ (0, k.jsx)(x, { name: "check" }), " Apply"]
4762
+ })] }) : /* @__PURE__ */ (0, k.jsx)(A, {
4763
+ onClick: ge,
4609
4764
  children: "Done"
4610
4765
  })
4611
4766
  })
4612
4767
  ]
4613
4768
  })] })
4614
4769
  ]
4615
- }, `${f.kind}:${h?.fieldKey ?? ""}`)
4770
+ }, `${g.kind}:${v?.fieldKey ?? ""}`)
4616
4771
  ]
4617
4772
  }) : null;
4618
4773
  }