@warkypublic/oranguru 0.0.45 → 0.0.47

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.
package/dist/lib.es.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import * as ye from "react";
2
- import $, { forwardRef as Be, useMemo as yt, useRef as U, useCallback as oe, useEffect as I, useImperativeHandle as Ve, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
- import { TextInput as Ge, Loader as Nt, ActionIcon as _e, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Vt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as K, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
2
+ import $, { forwardRef as Be, useMemo as yt, useRef as K, useCallback as oe, useEffect as R, useImperativeHandle as Ve, useState as se, createElement as ce, createContext as zt, useContext as $t } from "react";
3
+ import { TextInput as Ge, Loader as Nt, ActionIcon as Ce, Combobox as te, Checkbox as Lt, useVirtualizedCombobox as Bt, ScrollArea as Vt, rem as We, Group as we, Button as re, Paper as Gt, Text as Ke, Collapse as qt, Code as Ht, Switch as wt, Tooltip as Q, ScrollAreaAutosize as Wt, LoadingOverlay as Kt, Drawer as Ut, Modal as Jt, Popover as Re, VisuallyHidden as Yt, NativeSelect as Xt, PasswordInput as Qt, Textarea as Zt, Portal as en, Menu as W, Stack as bt, Select as tn, useMantineTheme as nn, useMantineColorScheme as rn, lighten as Ue, darken as on } from "@mantine/core";
4
4
  import { flushSync as sn } from "react-dom";
5
- import { createSyncStore as Ce } from "@warkypublic/zustandsyncstore";
6
- import { produce as H } from "immer";
5
+ import { createSyncStore as _e } from "@warkypublic/zustandsyncstore";
6
+ import { produce as q } from "immer";
7
7
  import { IconX as qe, IconExclamationCircle as an, IconDeviceFloppy as ln, IconGrid4x4 as Ie, IconSquarePlus as cn, IconEdit as Je, IconTrashX as Ye, IconExclamationMark as un, IconRefresh as dn, IconMenu2 as fn } from "@tabler/icons-react";
8
8
  import { useForm as hn, FormProvider as mn, Controller as he } from "react-hook-form";
9
9
  import { newUUID as gn, getUUID as xt } from "@warkypublic/artemis-kit";
10
10
  import { get as pn, set as Sn } from "idb-keyval";
11
11
  import { CompactSelection as ne, GridCellKind as ae, DataEditor as vn } from "@glideapps/glide-data-grid";
12
- import { useDebouncedValue as _t, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
12
+ import { useDebouncedValue as Ct, useDebouncedCallback as yn, useElementSize as wn, useMergedRef as bn } from "@mantine/hooks";
13
13
  function xn(r) {
14
14
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
15
15
  }
16
16
  var ge = { exports: {} }, ue = {};
17
17
  var Xe;
18
- function _n() {
18
+ function Cn() {
19
19
  if (Xe) return ue;
20
20
  Xe = 1;
21
21
  var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), o = /* @__PURE__ */ Symbol.for("react.fragment");
@@ -38,19 +38,19 @@ function _n() {
38
38
  }
39
39
  var de = {};
40
40
  var Qe;
41
- function Cn() {
41
+ function _n() {
42
42
  return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && (function() {
43
43
  function r(h) {
44
44
  if (h == null) return null;
45
45
  if (typeof h == "function")
46
- return h.$$typeof === M ? null : h.displayName || h.name || null;
46
+ return h.$$typeof === D ? null : h.displayName || h.name || null;
47
47
  if (typeof h == "string") return h;
48
48
  switch (h) {
49
- case _:
49
+ case C:
50
50
  return "Fragment";
51
51
  case x:
52
52
  return "Profiler";
53
- case C:
53
+ case _:
54
54
  return "StrictMode";
55
55
  case w:
56
56
  return "Suspense";
@@ -65,16 +65,16 @@ function Cn() {
65
65
  ), h.$$typeof) {
66
66
  case y:
67
67
  return "Portal";
68
- case O:
68
+ case I:
69
69
  return h.displayName || "Context";
70
- case R:
70
+ case O:
71
71
  return (h._context.displayName || "Context") + ".Consumer";
72
72
  case N:
73
73
  var b = h.render;
74
74
  return h = h.displayName, h || (h = b.displayName || b.name || "", h = h !== "" ? "ForwardRef(" + h + ")" : "ForwardRef"), h;
75
75
  case E:
76
76
  return b = h.displayName || null, b !== null ? b : r(h.type) || "Memo";
77
- case D:
77
+ case M:
78
78
  b = h._payload, h = h._init;
79
79
  try {
80
80
  return r(h(b));
@@ -104,8 +104,8 @@ function Cn() {
104
104
  }
105
105
  }
106
106
  function t(h) {
107
- if (h === _) return "<>";
108
- if (typeof h == "object" && h !== null && h.$$typeof === D)
107
+ if (h === C) return "<>";
108
+ if (typeof h == "object" && h !== null && h.$$typeof === M)
109
109
  return "<...>";
110
110
  try {
111
111
  var b = r(h);
@@ -115,14 +115,14 @@ function Cn() {
115
115
  }
116
116
  }
117
117
  function n() {
118
- var h = F.A;
118
+ var h = P.A;
119
119
  return h === null ? null : h.getOwner();
120
120
  }
121
121
  function s() {
122
122
  return Error("react-stack-top-frame");
123
123
  }
124
124
  function i(h) {
125
- if (A.call(h, "key")) {
125
+ if (F.call(h, "key")) {
126
126
  var b = Object.getOwnPropertyDescriptor(h, "key").get;
127
127
  if (b && b.isReactWarning) return !1;
128
128
  }
@@ -146,15 +146,15 @@ function Cn() {
146
146
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
147
147
  )), h = this.props.ref, h !== void 0 ? h : null;
148
148
  }
149
- function f(h, b, k, v, z, P) {
150
- var T = k.ref;
149
+ function f(h, b, k, v, z, T) {
150
+ var A = k.ref;
151
151
  return h = {
152
152
  $$typeof: p,
153
153
  type: h,
154
154
  key: b,
155
155
  props: k,
156
156
  _owner: v
157
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(h, "ref", {
157
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(h, "ref", {
158
158
  enumerable: !1,
159
159
  get: l
160
160
  }) : Object.defineProperty(h, "ref", { enumerable: !1, value: null }), h._store = {}, Object.defineProperty(h._store, "validated", {
@@ -176,28 +176,28 @@ function Cn() {
176
176
  configurable: !1,
177
177
  enumerable: !1,
178
178
  writable: !0,
179
- value: P
179
+ value: T
180
180
  }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
181
181
  }
182
- function u(h, b, k, v, z, P) {
183
- var T = b.children;
184
- if (T !== void 0)
182
+ function u(h, b, k, v, z, T) {
183
+ var A = b.children;
184
+ if (A !== void 0)
185
185
  if (v)
186
- if (B(T)) {
187
- for (v = 0; v < T.length; v++)
188
- c(T[v]);
189
- Object.freeze && Object.freeze(T);
186
+ if (U(A)) {
187
+ for (v = 0; v < A.length; v++)
188
+ c(A[v]);
189
+ Object.freeze && Object.freeze(A);
190
190
  } else
191
191
  console.error(
192
192
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
193
193
  );
194
- else c(T);
195
- if (A.call(b, "key")) {
196
- T = r(h);
194
+ else c(A);
195
+ if (F.call(b, "key")) {
196
+ A = r(h);
197
197
  var ee = Object.keys(b).filter(function(Ee) {
198
198
  return Ee !== "key";
199
199
  });
200
- v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", q[T + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
200
+ v = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", G[A + v] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
201
201
  `A props object containing a "key" prop is being spread into JSX:
202
202
  let props = %s;
203
203
  <%s {...props} />
@@ -205,35 +205,35 @@ React keys must be passed directly to JSX without using spread:
205
205
  let props = %s;
206
206
  <%s key={someKey} {...props} />`,
207
207
  v,
208
- T,
208
+ A,
209
209
  ee,
210
- T
211
- ), q[T + v] = !0);
210
+ A
211
+ ), G[A + v] = !0);
212
212
  }
213
- if (T = null, k !== void 0 && (e(k), T = "" + k), i(b) && (e(b.key), T = "" + b.key), "key" in b) {
213
+ if (A = null, k !== void 0 && (e(k), A = "" + k), i(b) && (e(b.key), A = "" + b.key), "key" in b) {
214
214
  k = {};
215
215
  for (var ie in b)
216
216
  ie !== "key" && (k[ie] = b[ie]);
217
217
  } else k = b;
218
- return T && a(
218
+ return A && a(
219
219
  k,
220
220
  typeof h == "function" ? h.displayName || h.name || "Unknown" : h
221
221
  ), f(
222
222
  h,
223
- T,
223
+ A,
224
224
  k,
225
225
  n(),
226
226
  z,
227
- P
227
+ T
228
228
  );
229
229
  }
230
230
  function c(h) {
231
- m(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === D && (h._payload.status === "fulfilled" ? m(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
231
+ m(h) ? h._store && (h._store.validated = 1) : typeof h == "object" && h !== null && h.$$typeof === M && (h._payload.status === "fulfilled" ? m(h._payload.value) && h._payload.value._store && (h._payload.value._store.validated = 1) : h._store && (h._store.validated = 1));
232
232
  }
233
233
  function m(h) {
234
234
  return typeof h == "object" && h !== null && h.$$typeof === p;
235
235
  }
236
- var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), _ = /* @__PURE__ */ Symbol.for("react.fragment"), C = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), O = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), M = /* @__PURE__ */ Symbol.for("react.client.reference"), F = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, B = Array.isArray, G = console.createTask ? console.createTask : function() {
236
+ var g = $, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), C = /* @__PURE__ */ Symbol.for("react.fragment"), _ = /* @__PURE__ */ Symbol.for("react.strict_mode"), x = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), N = /* @__PURE__ */ Symbol.for("react.forward_ref"), w = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), E = /* @__PURE__ */ Symbol.for("react.memo"), M = /* @__PURE__ */ Symbol.for("react.lazy"), L = /* @__PURE__ */ Symbol.for("react.activity"), D = /* @__PURE__ */ Symbol.for("react.client.reference"), P = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, U = Array.isArray, V = console.createTask ? console.createTask : function() {
237
237
  return null;
238
238
  };
239
239
  g = {
@@ -244,33 +244,33 @@ React keys must be passed directly to JSX without using spread:
244
244
  var j, J = {}, Y = g.react_stack_bottom_frame.bind(
245
245
  g,
246
246
  s
247
- )(), Z = G(t(s)), q = {};
248
- de.Fragment = _, de.jsx = function(h, b, k) {
249
- var v = 1e4 > F.recentlyCreatedOwnerStacks++;
247
+ )(), Z = V(t(s)), G = {};
248
+ de.Fragment = C, de.jsx = function(h, b, k) {
249
+ var v = 1e4 > P.recentlyCreatedOwnerStacks++;
250
250
  return u(
251
251
  h,
252
252
  b,
253
253
  k,
254
254
  !1,
255
255
  v ? Error("react-stack-top-frame") : Y,
256
- v ? G(t(h)) : Z
256
+ v ? V(t(h)) : Z
257
257
  );
258
258
  }, de.jsxs = function(h, b, k) {
259
- var v = 1e4 > F.recentlyCreatedOwnerStacks++;
259
+ var v = 1e4 > P.recentlyCreatedOwnerStacks++;
260
260
  return u(
261
261
  h,
262
262
  b,
263
263
  k,
264
264
  !0,
265
265
  v ? Error("react-stack-top-frame") : Y,
266
- v ? G(t(h)) : Z
266
+ v ? V(t(h)) : Z
267
267
  );
268
268
  };
269
269
  })()), de;
270
270
  }
271
271
  var Ze;
272
272
  function En() {
273
- return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ge.exports = _n() : ge.exports = Cn()), ge.exports;
273
+ return Ze || (Ze = 1, process.env.NODE_ENV === "production" ? ge.exports = Cn() : ge.exports = _n()), ge.exports;
274
274
  }
275
275
  var d = En();
276
276
  function le(r, o, e) {
@@ -285,19 +285,19 @@ function le(r, o, e) {
285
285
  t = c;
286
286
  let g;
287
287
  if (e.key && ((l = e.debug) != null && l.call(e)) && (g = Date.now()), n = o(...c), e.key && ((f = e.debug) != null && f.call(e))) {
288
- const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, _ = y / 16, C = (x, R) => {
289
- for (x = String(x); x.length < R; )
288
+ const p = Math.round((Date.now() - u) * 100) / 100, y = Math.round((Date.now() - g) * 100) / 100, C = y / 16, _ = (x, O) => {
289
+ for (x = String(x); x.length < O; )
290
290
  x = " " + x;
291
291
  return x;
292
292
  };
293
293
  console.info(
294
- `%c⏱ ${C(y, 5)} /${C(p, 5)} ms`,
294
+ `%c⏱ ${_(y, 5)} /${_(p, 5)} ms`,
295
295
  `
296
296
  font-size: .6rem;
297
297
  font-weight: bold;
298
298
  color: hsl(${Math.max(
299
299
  0,
300
- Math.min(120 - 120 * _, 120)
300
+ Math.min(120 - 120 * C, 120)
301
301
  )}deg 100% 31%);`,
302
302
  e?.key
303
303
  );
@@ -562,21 +562,21 @@ class Mn {
562
562
  }
563
563
  for (let m = f; m < e; m++) {
564
564
  const g = s(m), p = this.laneAssignments.get(m);
565
- let y, _;
565
+ let y, C;
566
566
  if (p !== void 0 && this.options.lanes > 1) {
567
567
  y = p;
568
- const O = c[y], N = O !== void 0 ? u[O] : void 0;
569
- _ = N ? N.end + this.options.gap : t + n;
568
+ const I = c[y], N = I !== void 0 ? u[I] : void 0;
569
+ C = N ? N.end + this.options.gap : t + n;
570
570
  } else {
571
- const O = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
- _ = O ? O.end + this.options.gap : t + n, y = O ? O.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
571
+ const I = this.options.lanes === 1 ? u[m - 1] : this.getFurthestMeasurement(u, m);
572
+ C = I ? I.end + this.options.gap : t + n, y = I ? I.lane : m % this.options.lanes, this.options.lanes > 1 && this.laneAssignments.set(m, y);
573
573
  }
574
- const C = l.get(g), x = typeof C == "number" ? C : this.options.estimateSize(m), R = _ + x;
574
+ const _ = l.get(g), x = typeof _ == "number" ? _ : this.options.estimateSize(m), O = C + x;
575
575
  u[m] = {
576
576
  index: m,
577
- start: _,
577
+ start: C,
578
578
  size: x,
579
- end: R,
579
+ end: O,
580
580
  key: g,
581
581
  lane: y
582
582
  }, c[y] = m;
@@ -672,7 +672,7 @@ class Mn {
672
672
  const t = this.getMeasurements();
673
673
  if (t.length !== 0)
674
674
  return et(
675
- t[Ct(
675
+ t[_t(
676
676
  0,
677
677
  t.length - 1,
678
678
  (n) => et(t[n]).start,
@@ -789,7 +789,7 @@ class Mn {
789
789
  }, this.setOptions(o);
790
790
  }
791
791
  }
792
- const Ct = (r, o, e, t) => {
792
+ const _t = (r, o, e, t) => {
793
793
  for (; r <= o; ) {
794
794
  const n = (r + o) / 2 | 0, s = e(n);
795
795
  if (s < t)
@@ -813,7 +813,7 @@ function Pn({
813
813
  startIndex: 0,
814
814
  endIndex: n
815
815
  };
816
- let i = Ct(
816
+ let i = _t(
817
817
  0,
818
818
  n,
819
819
  s,
@@ -861,7 +861,7 @@ function zn(r) {
861
861
  ...r
862
862
  });
863
863
  }
864
- const { Provider: $n, useStore: Nn } = Ce(
864
+ const { Provider: $n, useStore: Nn } = _e(
865
865
  (r, o) => ({
866
866
  boxerData: [],
867
867
  // Data Actions
@@ -888,7 +888,7 @@ const { Provider: $n, useStore: Nn } = Ce(
888
888
  search: e
889
889
  });
890
890
  r(
891
- H((a) => {
891
+ q((a) => {
892
892
  t ? (a.boxerData = i.data, a.page = 0) : a.boxerData = [...a.boxerData ?? [], ...i.data], a.total = i.total, a.hasMore = a.boxerData.length < i.total, a.isFetching = !1;
893
893
  })
894
894
  );
@@ -910,7 +910,7 @@ const { Provider: $n, useStore: Nn } = Ce(
910
910
  loadMore: async () => {
911
911
  const e = o();
912
912
  !e.hasMore || e.isFetching || (r(
913
- H((t) => {
913
+ q((t) => {
914
914
  t.page = t.page + 1;
915
915
  })
916
916
  ), await e.fetchData(e.search));
@@ -936,7 +936,7 @@ const { Provider: $n, useStore: Nn } = Ce(
936
936
  },
937
937
  setState: (e, t) => {
938
938
  r(
939
- H((n) => {
939
+ q((n) => {
940
940
  n[e] = t;
941
941
  })
942
942
  );
@@ -973,7 +973,7 @@ const { Provider: $n, useStore: Nn } = Ce(
973
973
  placeholder: m,
974
974
  search: g
975
975
  } = r, p = i ? /* @__PURE__ */ d.jsx(Nt, { size: "xs" }) : g && e ? /* @__PURE__ */ d.jsx(
976
- _e,
976
+ Ce,
977
977
  {
978
978
  onClick: (y) => {
979
979
  y.stopPropagation(), u();
@@ -1024,7 +1024,7 @@ const Ln = (r) => {
1024
1024
  );
1025
1025
  }), [o, n, e, t]) };
1026
1026
  }, Ot = $.forwardRef((r, o) => {
1027
- const e = U(null), t = U(null), n = U(null), s = U(null), {
1027
+ const e = K(null), t = K(null), n = K(null), s = K(null), {
1028
1028
  boxerData: i,
1029
1029
  clearable: a,
1030
1030
  comboBoxProps: l,
@@ -1035,22 +1035,22 @@ const Ln = (r) => {
1035
1035
  input: g,
1036
1036
  isFetching: p,
1037
1037
  label: y,
1038
- mah: _,
1039
- multiSelect: C,
1038
+ mah: C,
1039
+ multiSelect: _,
1040
1040
  onBufferChange: x,
1041
- onChange: R,
1042
- opened: O,
1041
+ onChange: O,
1042
+ opened: I,
1043
1043
  openOnClear: N,
1044
1044
  placeholder: w,
1045
1045
  scrollAreaProps: S,
1046
1046
  search: E,
1047
- selectedOptionIndex: D,
1047
+ selectedOptionIndex: M,
1048
1048
  selectFirst: L,
1049
- setInput: M,
1050
- setOpened: F,
1051
- setSearch: A,
1052
- setSelectedOptionIndex: B,
1053
- showAll: G,
1049
+ setInput: D,
1050
+ setOpened: P,
1051
+ setSearch: F,
1052
+ setSelectedOptionIndex: U,
1053
+ showAll: V,
1054
1054
  value: j
1055
1055
  } = Nn((v) => ({
1056
1056
  boxerData: v.boxerData,
@@ -1084,82 +1084,82 @@ const Ln = (r) => {
1084
1084
  count: J,
1085
1085
  estimateSize: () => 36,
1086
1086
  getScrollElement: () => e.current
1087
- }), Z = Y.getVirtualItems(), q = oe(
1087
+ }), Z = Y.getVirtualItems(), G = oe(
1088
1088
  (v) => {
1089
- const z = typeof v == "string" ? parseInt(v, 10) : v, P = i[z];
1090
- if (P)
1091
- if (C) {
1092
- const T = Array.isArray(j) ? j : [], ie = T.includes(P.value) ? T.filter((Oe) => Oe !== P.value) : [...T, P.value];
1093
- R?.(ie);
1089
+ const z = typeof v == "string" ? parseInt(v, 10) : v, T = i[z];
1090
+ if (T)
1091
+ if (_) {
1092
+ const A = Array.isArray(j) ? j : [], ie = A.includes(T.value) ? A.filter((Oe) => Oe !== T.value) : [...A, T.value];
1093
+ O?.(ie);
1094
1094
  const Ee = i.filter((Oe) => ie.includes(Oe.value));
1095
1095
  x?.(Ee);
1096
1096
  } else
1097
- R?.(P.value), A(""), M(P.label), n.current = P.value, F(!1);
1097
+ O?.(T.value), F(""), D(T.label), n.current = T.value, P(!1);
1098
1098
  },
1099
- [i, C, j, R, x, A, M, F]
1099
+ [i, _, j, O, x, F, D, P]
1100
1100
  ), h = oe(() => {
1101
- G && L ? q(0) : (R?.(C ? [] : null), A(""), M(""), t.current?.focus()), N && F(!0);
1102
- }, [G, L, C, R, A, M, N, F, q]), b = Bt({
1101
+ V && L ? G(0) : (O?.(_ ? [] : null), F(""), D(""), t.current?.focus()), N && P(!0);
1102
+ }, [V, L, _, O, F, D, N, P, G]), b = Bt({
1103
1103
  getOptionId: (v) => String(v),
1104
1104
  onDropdownClose: () => {
1105
- F(!1);
1105
+ P(!1);
1106
1106
  },
1107
1107
  onDropdownOpen: () => {
1108
- (!j || C && (!Array.isArray(j) || j.length === 0)) && (A(""), M("")), b.selectFirstOption();
1108
+ (!j || _ && (!Array.isArray(j) || j.length === 0)) && (F(""), D("")), b.selectFirstOption();
1109
1109
  },
1110
- onSelectedOptionSubmit: q,
1111
- opened: O,
1112
- selectedOptionIndex: D,
1110
+ onSelectedOptionSubmit: G,
1111
+ opened: I,
1112
+ selectedOptionIndex: M,
1113
1113
  setSelectedOptionIndex: (v) => {
1114
- B(v), v !== -1 && Y.scrollToIndex(v);
1114
+ U(v), v !== -1 && Y.scrollToIndex(v);
1115
1115
  },
1116
1116
  totalOptionsCount: i.length
1117
1117
  }), { options: k } = Ln({
1118
1118
  boxerData: i,
1119
- multiSelect: C,
1120
- onOptionSubmit: q,
1119
+ multiSelect: _,
1120
+ onOptionSubmit: G,
1121
1121
  value: j
1122
1122
  });
1123
- return I(() => {
1123
+ return R(() => {
1124
1124
  c("", !0);
1125
- }, []), I(() => {
1125
+ }, []), R(() => {
1126
1126
  const v = setTimeout(() => {
1127
- E !== void 0 && O && c(E, !0);
1127
+ E !== void 0 && I && c(E, !0);
1128
1128
  }, 300);
1129
1129
  return () => clearTimeout(v);
1130
- }, [E, O]), I(() => {
1131
- if (C) {
1130
+ }, [E, I]), R(() => {
1131
+ if (_) {
1132
1132
  const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)).map((z) => z.label).join(", ");
1133
- !O && g !== v && (M(v), A(""));
1133
+ !I && g !== v && (D(v), F(""));
1134
1134
  } else {
1135
1135
  const v = i.find((z) => z.value === j)?.label;
1136
- g !== v && (E ?? "") === "" && n.current !== j && j ? M(v ?? "") : !j && !n.current && (E ?? "") === "" && (A(""), M(""));
1136
+ g !== v && (E ?? "") === "" && n.current !== j && j ? D(v ?? "") : !j && !n.current && (E ?? "") === "" && (F(""), D(""));
1137
1137
  }
1138
- if (C) {
1138
+ if (_) {
1139
1139
  const v = i.filter((z) => Array.isArray(j) && j.includes(z.value)) ?? [];
1140
1140
  JSON.stringify(s.current) !== JSON.stringify(v) && (x?.(v), s.current = v);
1141
1141
  } else {
1142
1142
  const v = i?.find((z) => z.value === j) ?? null;
1143
1143
  s.current?.value !== v?.value && (x?.(v), s.current = v);
1144
1144
  }
1145
- }, [j, i, g, E, C, O, x, M, A]), I(() => {
1146
- L && (i?.length ?? 0) > 0 && !C && (j || q?.(0));
1147
- }, [L, i, C]), Ve(o, () => ({
1145
+ }, [j, i, g, E, _, I, x, D, F]), R(() => {
1146
+ L && (i?.length ?? 0) > 0 && !_ && (j || G?.(0));
1147
+ }, [L, i, _]), Ve(o, () => ({
1148
1148
  clear: () => {
1149
1149
  h();
1150
1150
  },
1151
1151
  close: () => {
1152
- F(!1), b.closeDropdown();
1152
+ P(!1), b.closeDropdown();
1153
1153
  },
1154
1154
  focus: () => {
1155
1155
  t.current?.focus();
1156
1156
  },
1157
1157
  getValue: () => j,
1158
1158
  open: () => {
1159
- F(!0), b.openDropdown();
1159
+ P(!0), b.openDropdown();
1160
1160
  },
1161
1161
  setValue: (v) => {
1162
- R?.(v);
1162
+ O?.(v);
1163
1163
  }
1164
1164
  })), /* @__PURE__ */ d.jsxs(
1165
1165
  te,
@@ -1178,11 +1178,11 @@ const Ln = (r) => {
1178
1178
  isFetching: p,
1179
1179
  label: y,
1180
1180
  onBlur: () => {
1181
- !j && !C && (A(""), M(""), b.closeDropdown(), F(!1));
1181
+ !j && !_ && (F(""), D(""), b.closeDropdown(), P(!1));
1182
1182
  },
1183
1183
  onClear: h,
1184
1184
  onSearch: (v) => {
1185
- A(v.currentTarget.value), M(v.currentTarget.value), F(!0);
1185
+ F(v.currentTarget.value), D(v.currentTarget.value), P(!0);
1186
1186
  },
1187
1187
  placeholder: w,
1188
1188
  ref: t,
@@ -1197,11 +1197,11 @@ const Ln = (r) => {
1197
1197
  },
1198
1198
  p: 2,
1199
1199
  ...f,
1200
- children: O && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1200
+ children: I && k.length > 0 ? /* @__PURE__ */ d.jsx(te.Options, { children: /* @__PURE__ */ d.jsx(
1201
1201
  Vt.Autosize,
1202
1202
  {
1203
1203
  ...S,
1204
- mah: _ ?? 200,
1204
+ mah: C ?? 200,
1205
1205
  viewportProps: {
1206
1206
  ...S?.viewportProps,
1207
1207
  onScroll: (v) => {
@@ -1595,7 +1595,7 @@ class so extends $.Component {
1595
1595
  }), this.forceUpdate();
1596
1596
  }
1597
1597
  }
1598
- const { Provider: qn, useStore: me } = Ce(
1598
+ const { Provider: qn, useStore: me } = _e(
1599
1599
  (r, o) => ({
1600
1600
  getAllState: () => o(),
1601
1601
  getState: (e) => o()?.[e],
@@ -1680,14 +1680,14 @@ const { Provider: qn, useStore: me } = Ce(
1680
1680
  },
1681
1681
  setState: (e, t) => {
1682
1682
  r(
1683
- H((n) => {
1683
+ q((n) => {
1684
1684
  n[e] = t;
1685
1685
  })
1686
1686
  );
1687
1687
  },
1688
1688
  setStateFN: (e, t) => new Promise((s, i) => {
1689
1689
  r(
1690
- H((a) => {
1690
+ q((a) => {
1691
1691
  if (typeof t == "function")
1692
1692
  a[e] = t(a[e]);
1693
1693
  else
@@ -1866,7 +1866,7 @@ const { Provider: qn, useStore: me } = Ce(
1866
1866
  save: m.save,
1867
1867
  scrollAreaProps: m.scrollAreaProps
1868
1868
  }));
1869
- return I(() => {
1869
+ return R(() => {
1870
1870
  e && e() && l !== "insert" && n(!0);
1871
1871
  }, [e, l, a]), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
1872
1872
  /* @__PURE__ */ d.jsx(Wn, {}),
@@ -1930,7 +1930,7 @@ const { Provider: qn, useStore: me } = Ce(
1930
1930
  useFormProps: g,
1931
1931
  validate: p,
1932
1932
  values: y,
1933
- wrapper: _
1933
+ wrapper: C
1934
1934
  } = me((x) => ({
1935
1935
  getAllState: x.getAllState,
1936
1936
  getState: x.getState,
@@ -1946,7 +1946,7 @@ const { Provider: qn, useStore: me } = Ce(
1946
1946
  validate: x.validate,
1947
1947
  values: x.values,
1948
1948
  wrapper: x.wrapper
1949
- })), C = hn({
1949
+ })), _ = hn({
1950
1950
  defaultValues: f,
1951
1951
  mode: "all",
1952
1952
  shouldUseNativeValidation: !0,
@@ -1973,14 +1973,14 @@ const { Provider: qn, useStore: me } = Ce(
1973
1973
  validate: async () => await p()
1974
1974
  }),
1975
1975
  [n, t, s, p, c, u, m, i, a]
1976
- ), I(() => {
1977
- m("getFormMethods", () => C), C && C.subscribe({
1976
+ ), R(() => {
1977
+ m("getFormMethods", () => _), _ && _.subscribe({
1978
1978
  callback: ({ isDirty: x }) => {
1979
1979
  m("dirty", x);
1980
1980
  },
1981
1981
  formState: { isDirty: !0 }
1982
1982
  });
1983
- }, [C]), /* @__PURE__ */ d.jsx(mn, { ...C, children: typeof _ == "function" ? _(
1983
+ }, [_]), /* @__PURE__ */ d.jsx(mn, { ..._, children: typeof C == "function" ? C(
1984
1984
  /* @__PURE__ */ d.jsx(st, { children: o.children }),
1985
1985
  l ?? !1,
1986
1986
  i ?? (() => {
@@ -2167,7 +2167,7 @@ const lo = (r) => {
2167
2167
  }, mo = (r) => {
2168
2168
  const [o, e] = se(!1);
2169
2169
  return /* @__PURE__ */ d.jsx(Q, { label: r.tooltip ?? "", withArrow: !0, children: /* @__PURE__ */ d.jsxs(
2170
- _e,
2170
+ Ce,
2171
2171
  {
2172
2172
  loaderProps: {
2173
2173
  type: "bars"
@@ -2328,16 +2328,16 @@ function Yn() {
2328
2328
  }
2329
2329
  var e = typeof Object.is == "function" ? Object.is : o, t = r.useState, n = r.useEffect, s = r.useLayoutEffect, i = r.useDebugValue;
2330
2330
  function a(c, m) {
2331
- var g = m(), p = t({ inst: { value: g, getSnapshot: m } }), y = p[0].inst, _ = p[1];
2331
+ var g = m(), p = t({ inst: { value: g, getSnapshot: m } }), y = p[0].inst, C = p[1];
2332
2332
  return s(
2333
2333
  function() {
2334
- y.value = g, y.getSnapshot = m, l(y) && _({ inst: y });
2334
+ y.value = g, y.getSnapshot = m, l(y) && C({ inst: y });
2335
2335
  },
2336
2336
  [c, g, m]
2337
2337
  ), n(
2338
2338
  function() {
2339
- return l(y) && _({ inst: y }), c(function() {
2340
- l(y) && _({ inst: y });
2339
+ return l(y) && C({ inst: y }), c(function() {
2340
+ l(y) && C({ inst: y });
2341
2341
  });
2342
2342
  },
2343
2343
  [c]
@@ -2372,24 +2372,24 @@ function Xn() {
2372
2372
  ));
2373
2373
  var y = p();
2374
2374
  if (!c) {
2375
- var _ = p();
2376
- s(y, _) || (console.error(
2375
+ var C = p();
2376
+ s(y, C) || (console.error(
2377
2377
  "The result of getSnapshot should be cached to avoid an infinite loop"
2378
2378
  ), c = !0);
2379
2379
  }
2380
- _ = i({
2380
+ C = i({
2381
2381
  inst: { value: y, getSnapshot: p }
2382
2382
  });
2383
- var C = _[0].inst, x = _[1];
2383
+ var _ = C[0].inst, x = C[1];
2384
2384
  return l(
2385
2385
  function() {
2386
- C.value = y, C.getSnapshot = p, e(C) && x({ inst: C });
2386
+ _.value = y, _.getSnapshot = p, e(_) && x({ inst: _ });
2387
2387
  },
2388
2388
  [g, y, p]
2389
2389
  ), a(
2390
2390
  function() {
2391
- return e(C) && x({ inst: C }), g(function() {
2392
- e(C) && x({ inst: C });
2391
+ return e(_) && x({ inst: _ }), g(function() {
2392
+ e(_) && x({ inst: _ });
2393
2393
  });
2394
2394
  },
2395
2395
  [g]
@@ -2434,38 +2434,38 @@ function Qn() {
2434
2434
  } else y = p.current;
2435
2435
  p = a(
2436
2436
  function() {
2437
- function C(w) {
2437
+ function _(w) {
2438
2438
  if (!x) {
2439
- if (x = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2439
+ if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
2440
2440
  var S = y.value;
2441
2441
  if (g(S, w))
2442
- return O = S;
2442
+ return I = S;
2443
2443
  }
2444
- return O = w;
2444
+ return I = w;
2445
2445
  }
2446
- if (S = O, t(R, w)) return S;
2446
+ if (S = I, t(O, w)) return S;
2447
2447
  var E = m(w);
2448
- return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2448
+ return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, I = E);
2449
2449
  }
2450
- var x = !1, R, O, N = c === void 0 ? null : c;
2450
+ var x = !1, O, I, N = c === void 0 ? null : c;
2451
2451
  return [
2452
2452
  function() {
2453
- return C(u());
2453
+ return _(u());
2454
2454
  },
2455
2455
  N === null ? void 0 : function() {
2456
- return C(N());
2456
+ return _(N());
2457
2457
  }
2458
2458
  ];
2459
2459
  },
2460
2460
  [u, c, m, g]
2461
2461
  );
2462
- var _ = n(f, p[0], p[1]);
2462
+ var C = n(f, p[0], p[1]);
2463
2463
  return i(
2464
2464
  function() {
2465
- y.hasValue = !0, y.value = _;
2465
+ y.hasValue = !0, y.value = C;
2466
2466
  },
2467
- [_]
2468
- ), l(_), _;
2467
+ [C]
2468
+ ), l(C), C;
2469
2469
  }, je;
2470
2470
  }
2471
2471
  var Te = {};
@@ -2485,39 +2485,39 @@ function Zn() {
2485
2485
  } else y = p.current;
2486
2486
  p = a(
2487
2487
  function() {
2488
- function C(w) {
2488
+ function _(w) {
2489
2489
  if (!x) {
2490
- if (x = !0, R = w, w = m(w), g !== void 0 && y.hasValue) {
2490
+ if (x = !0, O = w, w = m(w), g !== void 0 && y.hasValue) {
2491
2491
  var S = y.value;
2492
2492
  if (g(S, w))
2493
- return O = S;
2493
+ return I = S;
2494
2494
  }
2495
- return O = w;
2495
+ return I = w;
2496
2496
  }
2497
- if (S = O, t(R, w))
2497
+ if (S = I, t(O, w))
2498
2498
  return S;
2499
2499
  var E = m(w);
2500
- return g !== void 0 && g(S, E) ? (R = w, S) : (R = w, O = E);
2500
+ return g !== void 0 && g(S, E) ? (O = w, S) : (O = w, I = E);
2501
2501
  }
2502
- var x = !1, R, O, N = c === void 0 ? null : c;
2502
+ var x = !1, O, I, N = c === void 0 ? null : c;
2503
2503
  return [
2504
2504
  function() {
2505
- return C(u());
2505
+ return _(u());
2506
2506
  },
2507
2507
  N === null ? void 0 : function() {
2508
- return C(N());
2508
+ return _(N());
2509
2509
  }
2510
2510
  ];
2511
2511
  },
2512
2512
  [u, c, m, g]
2513
2513
  );
2514
- var _ = n(f, p[0], p[1]);
2514
+ var C = n(f, p[0], p[1]);
2515
2515
  return i(
2516
2516
  function() {
2517
- y.hasValue = !0, y.value = _;
2517
+ y.hasValue = !0, y.value = C;
2518
2518
  },
2519
- [_]
2520
- ), l(_), _;
2519
+ [C]
2520
+ ), l(C), C;
2521
2521
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
2522
2522
  })()), Te;
2523
2523
  }
@@ -2862,7 +2862,7 @@ const Me = async () => {
2862
2862
  } finally {
2863
2863
  e();
2864
2864
  }
2865
- }, V = rr((r, o) => ({
2865
+ }, B = rr((r, o) => ({
2866
2866
  ...$e,
2867
2867
  ...dr(r),
2868
2868
  ...fr(r),
@@ -2873,7 +2873,7 @@ const Me = async () => {
2873
2873
  ...Sr(r, o)
2874
2874
  }));
2875
2875
  xe = cr().then((r) => {
2876
- V.setState(
2876
+ B.setState(
2877
2877
  (o) => ({
2878
2878
  ...o,
2879
2879
  ...r,
@@ -2889,20 +2889,20 @@ xe = cr().then((r) => {
2889
2889
  // Replace state completely to avoid triggering subscription during init
2890
2890
  );
2891
2891
  }).catch((r) => {
2892
- console.error("Error loading storage:", r), V.setState({ initialized: !0 });
2892
+ console.error("Error loading storage:", r), B.setState({ initialized: !0 });
2893
2893
  }).finally(() => {
2894
2894
  kt = !0, xe = null;
2895
2895
  });
2896
- V.subscribe((r) => {
2896
+ B.subscribe((r) => {
2897
2897
  kt && ur(r).catch((o) => {
2898
2898
  console.error("Error saving storage:", o);
2899
2899
  });
2900
2900
  });
2901
- const vr = ((r) => (o) => ir(r, o, Jn)), wo = vr(V), bo = (r) => {
2902
- V.getState().setApiURL(r);
2903
- }, xo = () => V.getState().session.apiURL ?? "", _o = () => V.getState().session.authToken ?? "", Co = () => V.getState().isLoggedIn(), Eo = (r) => {
2904
- V.getState().setAuthToken(r);
2905
- }, yr = () => V.getState(), jt = zt(null);
2901
+ const vr = ((r) => (o) => ir(r, o, Jn)), wo = vr(B), bo = (r) => {
2902
+ B.getState().setApiURL(r);
2903
+ }, xo = () => B.getState().session.apiURL ?? "", Co = () => B.getState().session.authToken ?? "", _o = () => B.getState().isLoggedIn(), Eo = (r) => {
2904
+ B.getState().setAuthToken(r);
2905
+ }, yr = () => B.getState(), jt = zt(null);
2906
2906
  function Oo({
2907
2907
  apiURL: r,
2908
2908
  autoFetch: o = !0,
@@ -2914,12 +2914,12 @@ function Oo({
2914
2914
  program: a,
2915
2915
  throttleMs: l = 0
2916
2916
  }) {
2917
- const f = U(0), u = U(!1), c = U(!1), m = oe(
2917
+ const f = K(0), u = K(!1), c = K(!1), m = oe(
2918
2918
  async (y) => {
2919
- const _ = Date.now(), C = _ - f.current;
2920
- if (!u.current && !(l > 0 && C < l))
2919
+ const C = Date.now(), _ = C - f.current;
2920
+ if (!u.current && !(l > 0 && _ < l))
2921
2921
  try {
2922
- u.current = !0, f.current = _, await V.getState().fetchData(y);
2922
+ u.current = !0, f.current = C, await B.getState().fetchData(y);
2923
2923
  } finally {
2924
2924
  u.current = !1;
2925
2925
  }
@@ -2928,17 +2928,17 @@ function Oo({
2928
2928
  ), g = oe(async () => {
2929
2929
  await m();
2930
2930
  }, [m]);
2931
- I(() => {
2932
- r && V.getState().setApiURL(r);
2933
- }, [r]), I(() => {
2934
- a && V.getState().setProgram(a);
2935
- }, [a]), I(() => {
2936
- n && V.setState({ onFetchSession: n });
2937
- }, [n]), I(() => {
2938
- s && V.setState({ onLogin: s });
2939
- }, [s]), I(() => {
2940
- i && V.setState({ onLogout: i });
2941
- }, [i]), I(() => {
2931
+ R(() => {
2932
+ r && B.getState().setApiURL(r);
2933
+ }, [r]), R(() => {
2934
+ a && B.getState().setProgram(a);
2935
+ }, [a]), R(() => {
2936
+ n && B.setState({ onFetchSession: n });
2937
+ }, [n]), R(() => {
2938
+ s && B.setState({ onLogin: s });
2939
+ }, [s]), R(() => {
2940
+ i && B.setState({ onLogout: i });
2941
+ }, [i]), R(() => {
2942
2942
  c.current || (c.current = !0, o && t && m(r).catch((y) => {
2943
2943
  console.error("Failed to fetch on mount:", y);
2944
2944
  }));
@@ -3010,7 +3010,7 @@ const wr = "gridler_golang_restapi_v2_token", br = (r, o) => {
3010
3010
  }
3011
3011
  }
3012
3012
  }, St = () => xr?.getAuthToken?.();
3013
- function _r(r, o) {
3013
+ function Cr(r, o) {
3014
3014
  if (!r || !o || r.includes("..") || r.includes("[]") || /\[\s*\]/.test(r))
3015
3015
  return;
3016
3016
  const e = r.replace(/\[(\w+)\]/g, ".$1").split(".").filter(Boolean);
@@ -3020,7 +3020,7 @@ function _r(r, o) {
3020
3020
  return t[n];
3021
3021
  }, o);
3022
3022
  }
3023
- const { Provider: Cr, useStore: At } = Ce(
3023
+ const { Provider: _r, useStore: At } = _e(
3024
3024
  (r, o) => ({
3025
3025
  hide: (e) => {
3026
3026
  o().setInstanceState(e, "visible", !1);
@@ -3028,7 +3028,7 @@ const { Provider: Cr, useStore: At } = Ce(
3028
3028
  menus: [],
3029
3029
  setInstanceState: (e, t, n) => {
3030
3030
  r(
3031
- H((s) => {
3031
+ q((s) => {
3032
3032
  const i = s?.menus?.findIndex((a) => a.id === e);
3033
3033
  i >= 0 && (s.menus[i][t] = n);
3034
3034
  })
@@ -3036,7 +3036,7 @@ const { Provider: Cr, useStore: At } = Ce(
3036
3036
  },
3037
3037
  setState: (e, t) => {
3038
3038
  r(
3039
- H((n) => {
3039
+ q((n) => {
3040
3040
  n[e] = t;
3041
3041
  })
3042
3042
  );
@@ -3044,7 +3044,7 @@ const { Provider: Cr, useStore: At } = Ce(
3044
3044
  show: (e, t) => {
3045
3045
  const n = o(), s = n.menus.findIndex((a) => a.id === e), i = n.menus[s] ? { ...n.menus[s] } : {};
3046
3046
  Object.assign(i, t), i.id = i.id ?? e, i.visible = !(i.visible ?? !1), s < 0 ? n.setState("menus", [...n.menus, i]) : r(
3047
- H((a) => {
3047
+ q((a) => {
3048
3048
  a.menus || (a.menus = []), a.menus[s] = { ...a.menus[s], ...i };
3049
3049
  })
3050
3050
  );
@@ -3064,7 +3064,7 @@ function Er() {
3064
3064
  }));
3065
3065
  return /* @__PURE__ */ d.jsx(en, { id: `bmm_portal_${o}`, children: $.Children.toArray(
3066
3066
  r?.map((n, s) => /* @__PURE__ */ ce(
3067
- K,
3067
+ W,
3068
3068
  {
3069
3069
  shadow: "md",
3070
3070
  width: t ?? "300",
@@ -3075,14 +3075,14 @@ function Er() {
3075
3075
  },
3076
3076
  opened: n.visible
3077
3077
  },
3078
- /* @__PURE__ */ d.jsx(K.Target, { children: /* @__PURE__ */ d.jsx(
3078
+ /* @__PURE__ */ d.jsx(W.Target, { children: /* @__PURE__ */ d.jsx(
3079
3079
  "div",
3080
3080
  {
3081
3081
  id: `bmm_${o}_${s}_target`,
3082
3082
  style: { left: n.x, position: "fixed", top: n.y, visibility: "hidden" }
3083
3083
  }
3084
3084
  ) }),
3085
- /* @__PURE__ */ d.jsx(K.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
3085
+ /* @__PURE__ */ d.jsx(W.Dropdown, { children: n.renderer ? n.renderer : $.Children.toArray(
3086
3086
  n.items?.map((i, a) => /* @__PURE__ */ d.jsx(
3087
3087
  Ft,
3088
3088
  {
@@ -3096,9 +3096,9 @@ function Er() {
3096
3096
  }
3097
3097
  const Ft = ({ children: r, label: o, ...e }) => {
3098
3098
  const [t, n] = se(!1);
3099
- return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(K.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(K.Sub, { children: [
3100
- /* @__PURE__ */ d.jsx(K.Sub.Target, { children: /* @__PURE__ */ d.jsx(
3101
- K.Sub.Item,
3099
+ return typeof e.renderer == "function" ? e.renderer({ ...e, loading: t, renderer: void 0, setLoading: n }) : typeof e.renderer == "object" ? e.renderer : e.isDivider ? /* @__PURE__ */ d.jsx(W.Divider, {}) : e.items && e.items.length > 0 ? /* @__PURE__ */ d.jsxs(W.Sub, { children: [
3100
+ /* @__PURE__ */ d.jsx(W.Sub.Target, { children: /* @__PURE__ */ d.jsx(
3101
+ W.Sub.Item,
3102
3102
  {
3103
3103
  ...e,
3104
3104
  disabled: t,
@@ -3115,7 +3115,7 @@ const Ft = ({ children: r, label: o, ...e }) => {
3115
3115
  children: r ?? o
3116
3116
  }
3117
3117
  ) }),
3118
- /* @__PURE__ */ d.jsx(K.Sub.Dropdown, { children: $.Children.toArray(
3118
+ /* @__PURE__ */ d.jsx(W.Sub.Dropdown, { children: $.Children.toArray(
3119
3119
  e.items.map((s, i) => /* @__PURE__ */ d.jsx(
3120
3120
  Ft,
3121
3121
  {
@@ -3124,11 +3124,11 @@ const Ft = ({ children: r, label: o, ...e }) => {
3124
3124
  `bmm_subitem_${s?.id ?? ""}${i}`
3125
3125
  ))
3126
3126
  ) })
3127
- ] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(K.Label, { ...e, children: [
3127
+ ] }) : !e.onClick && !e.onClickAsync ? /* @__PURE__ */ d.jsxs(W.Label, { ...e, children: [
3128
3128
  " ",
3129
3129
  r ?? o
3130
3130
  ] }) : /* @__PURE__ */ d.jsx(
3131
- K.Item,
3131
+ W.Item,
3132
3132
  {
3133
3133
  ...e,
3134
3134
  disabled: t,
@@ -3147,7 +3147,7 @@ const Ft = ({ children: r, label: o, ...e }) => {
3147
3147
  );
3148
3148
  };
3149
3149
  function Or(r) {
3150
- return /* @__PURE__ */ d.jsxs(Cr, { ...r, children: [
3150
+ return /* @__PURE__ */ d.jsxs(_r, { ...r, children: [
3151
3151
  /* @__PURE__ */ d.jsx(Er, {}),
3152
3152
  r.children
3153
3153
  ] });
@@ -3161,8 +3161,8 @@ const Rr = [
3161
3161
  { label: "Less Than", value: "lt" },
3162
3162
  { label: "Less Than or Equal", value: "lte" }
3163
3163
  ], Ir = (r) => {
3164
- const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = se(e?.value ?? ""), [s] = _t(t, 900);
3165
- return I(() => {
3164
+ const o = r.storeState?.colFilters?.findIndex((i) => i.id === r.column.id) ?? -1, e = r.storeState?.colFilters?.[o] ?? { id: r.column.id, value: "" }, [t, n] = se(e?.value ?? ""), [s] = Ct(t, 900);
3165
+ return R(() => {
3166
3166
  r.storeState.setStateFN("colFilters", (i) => {
3167
3167
  const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3168
3168
  return a >= 0 ? l[a] = {
@@ -3181,7 +3181,7 @@ const Rr = [
3181
3181
  Ge,
3182
3182
  {
3183
3183
  onChange: (i) => n(i.target.value),
3184
- rightSection: /* @__PURE__ */ d.jsx(_e, { color: "gray", onClick: () => n(""), variant: "filled", children: /* @__PURE__ */ d.jsx(qe, { color: "red" }) }),
3184
+ rightSection: /* @__PURE__ */ d.jsx(Ce, { color: "gray", onClick: () => n(""), variant: "filled", children: /* @__PURE__ */ d.jsx(qe, { color: "red" }) }),
3185
3185
  value: t ?? e?.value
3186
3186
  }
3187
3187
  );
@@ -3191,8 +3191,8 @@ const Rr = [
3191
3191
  operator: "contains"
3192
3192
  }, [t, n] = se(
3193
3193
  e?.operator ?? "contains"
3194
- ), [s] = _t(t, 900);
3195
- return I(() => {
3194
+ ), [s] = Ct(t, 900);
3195
+ return R(() => {
3196
3196
  r.storeState.setStateFN("colFilters", (i) => {
3197
3197
  const a = i?.findIndex((f) => f.id === r.column.id) ?? -1, l = i ?? [];
3198
3198
  return a >= 0 ? l[a] = {
@@ -3235,7 +3235,7 @@ const Rr = [
3235
3235
  d="M15 17.5a.5.5 0 0 1-1 0V3.707l-2.146 2.147a.5.5 0 0 1-.708-.708l3-3a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L15 3.707zM2.5 16a.5.5 0 0 1 0-1h9a.5.5 0 0 1 0 1zM5 12.5a.5.5 0 0 0 .5.5h6a.5.5 0 0 0 0-1h-6a.5.5 0 0 0-.5.5M8.5 10a.5.5 0 0 1 0-1h3a.5.5 0 0 1 0 1z"
3236
3236
  ></path>
3237
3237
  </svg>
3238
- `, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore: W } = Ce(
3238
+ `, ve = (r) => /* @__PURE__ */ d.jsx("img", { alt: r.alt ?? "Sprite Image", src: `data:image/svg+xml;utf8,${r.sprite({ ...r, sprite: void 0 })}` }), { Provider: jr, useStore: H } = _e(
3239
3239
  (r, o) => ({
3240
3240
  _events: new EventTarget(),
3241
3241
  _loadingList: ne.empty(),
@@ -3249,7 +3249,7 @@ const Rr = [
3249
3249
  addError: (e, ...t) => {
3250
3250
  const n = o();
3251
3251
  console.log("Gridler Error", n.uniqueid, e, t), r(
3252
- H((s) => {
3252
+ q((s) => {
3253
3253
  s.errors = [...s.errors, e];
3254
3254
  })
3255
3255
  );
@@ -3309,6 +3309,8 @@ const Rr = [
3309
3309
  },
3310
3310
  getRowIndexByKey: async (e) => {
3311
3311
  const t = o();
3312
+ if (e == null)
3313
+ return;
3312
3314
  let n = -1;
3313
3315
  if (t.ready) {
3314
3316
  const s = t._page_data, i = t.pageSize, a = t.keyField ?? "id";
@@ -3316,14 +3318,14 @@ const Rr = [
3316
3318
  for (const f in s[l]) {
3317
3319
  const u = Number(l) * i + Number(f);
3318
3320
  if (String(s[l][f]?.[a]) === String(e)) {
3319
- n = s[l][f]?._rownumber > 0 ? s[l][f]?._rownumber : u > 0 ? u : -1;
3321
+ n = s[l][f]?._rownumber > 0 ? s[l][f]?._rownumber : u >= 0 ? u : -1;
3320
3322
  break;
3321
3323
  }
3322
3324
  }
3323
- if (n > 0)
3325
+ if (n >= 0)
3324
3326
  return n;
3325
3327
  }
3326
- if (n > 0)
3328
+ if (n >= 0)
3327
3329
  return n;
3328
3330
  if (typeof t.askAPIRowNumber == "function") {
3329
3331
  const l = await t.askAPIRowNumber(String(e));
@@ -3634,14 +3636,14 @@ const Rr = [
3634
3636
  },
3635
3637
  setState: (e, t) => {
3636
3638
  r(
3637
- H((n) => {
3639
+ q((n) => {
3638
3640
  n[e] = t;
3639
3641
  })
3640
3642
  );
3641
3643
  },
3642
3644
  setStateFN: (e, t) => new Promise((s, i) => {
3643
3645
  r(
3644
- H((a) => {
3646
+ q((a) => {
3645
3647
  if (typeof t == "function")
3646
3648
  a[e] = t(a[e]);
3647
3649
  else
@@ -3657,7 +3659,7 @@ const Rr = [
3657
3659
  kind: ae.Loading
3658
3660
  };
3659
3661
  try {
3660
- const l = String(a).includes(".") ? _r(a, e) ?? "" : e?.[a];
3662
+ const l = String(a).includes(".") ? Cr(a, e) ?? "" : e?.[a];
3661
3663
  return i?.Cell ? { kind: ae.Text, ...i?.Cell(e, t, a, l, n) } : n.RenderCell ? n.RenderCell(e, t, a, l, n) : {
3662
3664
  allowOverlay: !0,
3663
3665
  data: l ?? "",
@@ -3677,7 +3679,7 @@ const Rr = [
3677
3679
  }),
3678
3680
  (r) => {
3679
3681
  const [o, e] = r.useStore((n) => [n.setState, n.getState]), t = At();
3680
- return I(() => {
3682
+ return R(() => {
3681
3683
  const n = e("onMounted");
3682
3684
  if (typeof n == "function" && n(e, o), o("mounted", !0), window && window.document && !window.document.getElementById("portal")) {
3683
3685
  const i = window.document.createElement("div");
@@ -3708,7 +3710,7 @@ const Rr = [
3708
3710
  }
3709
3711
  );
3710
3712
  function Ar(r) {
3711
- const [o, e, t, n, s] = W((l) => [
3713
+ const [o, e, t, n, s] = H((l) => [
3712
3714
  l.setStateFN,
3713
3715
  l.setState,
3714
3716
  l.getState,
@@ -3716,12 +3718,12 @@ function Ar(r) {
3716
3718
  l.mounted
3717
3719
  ]), i = oe(
3718
3720
  async (l) => {
3719
- const f = t("columns"), u = t("colSort"), c = t("pageSize"), m = t("colFilters"), g = t("searchStr"), p = t("searchFields"), y = t("_active_requests"), _ = t("keyField");
3721
+ const f = t("columns"), u = t("colSort"), c = t("pageSize"), m = t("colFilters"), g = t("searchStr"), p = t("searchFields"), y = t("_active_requests"), C = t("keyField");
3720
3722
  e("loadingData", !0);
3721
3723
  try {
3722
3724
  if (r && r.url) {
3723
- const C = new Headers();
3724
- C.set("Authorization", `Token ${r.authtoken}`);
3725
+ const _ = new Headers();
3726
+ _.set("Authorization", `Token ${r.authtoken}`);
3725
3727
  const x = [
3726
3728
  { type: "limit", value: String(c ?? 50) },
3727
3729
  { type: "offset", value: String((c ?? 50) * l) }
@@ -3750,19 +3752,19 @@ function Ar(r) {
3750
3752
  type: "custom-sql-w",
3751
3753
  value: r.filter
3752
3754
  }), (r.options ?? []).length > 0 && x.push(...r.options ?? []);
3753
- const R = f?.filter((S) => !S.virtual)?.map((S) => S.id) ?? [];
3754
- if (r.hotfields && r.hotfields.length > 0 && R?.push(r.hotfields.join(",")), _ && (R.includes(_) || R.push(_)), R && R.length > 0 && x.push({
3755
+ const O = f?.filter((S) => !S.virtual)?.map((S) => S.id) ?? [];
3756
+ if (r.hotfields && r.hotfields.length > 0 && O?.push(r.hotfields.join(",")), C && (O.includes(C) || O.push(C)), O && O.length > 0 && x.push({
3755
3757
  type: "select-fields",
3756
- value: R.join(",")
3758
+ value: O.join(",")
3757
3759
  }), x && x.length > 0) {
3758
3760
  const S = fe(x);
3759
3761
  for (const E in fe(x))
3760
- C.set(E, S[E]);
3762
+ _.set(E, S[E]);
3761
3763
  }
3762
- const O = y?.findIndex((S) => S.page === l) ?? -1;
3764
+ const I = y?.findIndex((S) => S.page === l) ?? -1;
3763
3765
  if (y?.forEach((S) => {
3764
3766
  (S.page >= 0 && S.page < l - 2 || l >= 0 && S.page > l + 2) && S.controller?.abort?.();
3765
- }), y && O >= 0 && y[O]) {
3767
+ }), y && I >= 0 && y[I]) {
3766
3768
  e("loadingData", !1);
3767
3769
  return;
3768
3770
  }
@@ -3774,7 +3776,7 @@ function Ar(r) {
3774
3776
  const w = await fetch(
3775
3777
  `${r.url}?x-limit=${String(c ?? 50)}&x-offset=${String((c ?? 50) * l)}`,
3776
3778
  {
3777
- headers: C,
3779
+ headers: _,
3778
3780
  method: "GET",
3779
3781
  signal: N?.signal
3780
3782
  }
@@ -3844,7 +3846,7 @@ function Ar(r) {
3844
3846
  },
3845
3847
  [r.url, r.authtoken, r.filter, r.options, t, n]
3846
3848
  );
3847
- return I(() => {
3849
+ return R(() => {
3848
3850
  e("useAPIQuery", i), e("askAPIRowNumber", a);
3849
3851
  const l = t("isValuesInPages"), f = t("_refresh");
3850
3852
  l || e("values", []), f?.().then(() => {
@@ -3859,13 +3861,13 @@ function Ar(r) {
3859
3861
  const Fr = $.memo(Ar);
3860
3862
  Fr.displayName = "Gridler-GlidlerAPIAdaptorForGoLangv2";
3861
3863
  function Tr(r) {
3862
- const [o, e, t, n] = W((i) => [
3864
+ const [o, e, t, n] = H((i) => [
3863
3865
  i.getState,
3864
3866
  i.mounted,
3865
3867
  i.setState,
3866
3868
  i._events
3867
3869
  ]);
3868
- I(() => {
3870
+ R(() => {
3869
3871
  if (e && r.changeOnActiveClick) {
3870
3872
  const i = (a) => {
3871
3873
  const { row: l, state: f } = a.detail, u = f.getRowBuffer;
@@ -3889,8 +3891,8 @@ function Tr(r) {
3889
3891
  c.push(...u);
3890
3892
  const m = o("_gridSelection")?.rows.toArray() ?? [], g = m.length > 1;
3891
3893
  if (!l) {
3892
- const _ = m[0];
3893
- _ !== void 0 && (l = a.getRowBuffer(_));
3894
+ const C = m[0];
3895
+ C !== void 0 && (l = a.getRowBuffer(C));
3894
3896
  }
3895
3897
  const p = typeof r.descriptionField == "string" ? l?.[r.descriptionField] : typeof r.descriptionField == "function" && l ? r.descriptionField(l) : void 0;
3896
3898
  (i === "other" || i === "cell" && !l) && c.push({
@@ -3913,7 +3915,7 @@ function Tr(r) {
3913
3915
  onClick: () => {
3914
3916
  r.onRequestForm(
3915
3917
  "change",
3916
- m.map((_) => a.getRowBuffer(_))
3918
+ m.map((C) => a.getRowBuffer(C))
3917
3919
  );
3918
3920
  }
3919
3921
  }), c.push({
@@ -3923,7 +3925,7 @@ function Tr(r) {
3923
3925
  onClick: () => {
3924
3926
  r.onRequestForm(
3925
3927
  "delete",
3926
- m.map((_) => a.getRowBuffer(_))
3928
+ m.map((C) => a.getRowBuffer(C))
3927
3929
  );
3928
3930
  }
3929
3931
  })) : (c.push({
@@ -3959,11 +3961,11 @@ function Tr(r) {
3959
3961
  },
3960
3962
  [r.onRequestForm, o]
3961
3963
  );
3962
- return I(() => (e && typeof t == "function" && o("getMenuItems") !== s && t("getMenuItems", s), () => {
3964
+ return R(() => (e && typeof t == "function" && o("getMenuItems") !== s && t("getMenuItems", s), () => {
3963
3965
  }), [r.getMenuItems, e]), /* @__PURE__ */ d.jsx(d.Fragment, {});
3964
3966
  }
3965
3967
  function Mr(r) {
3966
- const [o, e, t] = W((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = W((u) => ({
3968
+ const [o, e, t] = H((u) => [u.setState, u.getState, u.mounted]), { colFilters: n, colSort: s, columns: i, searchStr: a } = H((u) => ({
3967
3969
  colFilters: u.colFilters,
3968
3970
  colOrder: u.colOrder,
3969
3971
  colSize: u.colSize,
@@ -3978,19 +3980,19 @@ function Mr(r) {
3978
3980
  const c = e("pageSize");
3979
3981
  return r.data && Array.isArray(r.data) ? (o("total_rows", r.data.length), r.data.slice(u * (c ?? 50), (u + 1) * (c ?? 50))) : [];
3980
3982
  };
3981
- return I(() => {
3983
+ return R(() => {
3982
3984
  o("useAPIQuery", f);
3983
- }, [t, o]), I(() => {
3985
+ }, [t, o]), R(() => {
3984
3986
  if (r.onColumnSort && s !== l?.current?.colSort) {
3985
3987
  const u = r.onColumnSort(s, i, r.data);
3986
3988
  o("total_rows", u.length), o("data", u), l.current.colSort = s, e("refreshCells")?.();
3987
3989
  }
3988
- }, [s, r.onColumnSort]), I(() => {
3990
+ }, [s, r.onColumnSort]), R(() => {
3989
3991
  if (r.onColumnFilter && n !== l?.current?.colFilters) {
3990
3992
  const u = r.onColumnFilter(n, i, r.data);
3991
3993
  o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
3992
3994
  }
3993
- }, [n, r.onColumnFilter]), I(() => {
3995
+ }, [n, r.onColumnFilter]), R(() => {
3994
3996
  if (r.onSearch && a !== l?.current?.searchStr) {
3995
3997
  const u = r.onSearch(a, i, r.data);
3996
3998
  o("total_rows", u.length), o("data", u), l.current.colFilters = n, e("refreshCells")?.();
@@ -4000,12 +4002,12 @@ function Mr(r) {
4000
4002
  const Tt = $.memo(Mr);
4001
4003
  Tt.displayName = "Gridler-GlidlerLocalDataAdaptor";
4002
4004
  function Pr() {
4003
- const { loadingData: r, onContextClick: o } = W((e) => ({
4005
+ const { loadingData: r, onContextClick: o } = H((e) => ({
4004
4006
  loadingData: e.loadingData,
4005
4007
  onContextClick: e.onContextClick
4006
4008
  }));
4007
4009
  return /* @__PURE__ */ d.jsx(
4008
- _e,
4010
+ Ce,
4009
4011
  {
4010
4012
  loading: r,
4011
4013
  mr: "xs",
@@ -4017,7 +4019,7 @@ function Pr() {
4017
4019
  );
4018
4020
  }
4019
4021
  function Dr(r, o) {
4020
- const [e, t] = W((n) => [n.setStateFN, n.getState]);
4022
+ const [e, t] = H((n) => [n.setStateFN, n.getState]);
4021
4023
  return Ve(o, () => ({
4022
4024
  getGlideRef: () => t("_glideref"),
4023
4025
  getState: t,
@@ -4049,14 +4051,14 @@ function Dr(r, o) {
4049
4051
  }
4050
4052
  const zr = $.forwardRef(Dr);
4051
4053
  function $r() {
4052
- const { _activeTooltip: r, tooltipBarProps: o } = W((e) => ({
4054
+ const { _activeTooltip: r, tooltipBarProps: o } = H((e) => ({
4053
4055
  _activeTooltip: e._activeTooltip,
4054
4056
  tooltipBarProps: e.tooltipBarProps
4055
4057
  }));
4056
4058
  return /* @__PURE__ */ d.jsx("div", { "data-tooltip-bar": !0, style: { minHeight: "24px" }, ...o, children: r });
4057
4059
  }
4058
4060
  const Mt = $.memo(() => {
4059
- const r = U(0), o = U(""), e = U(null), {
4061
+ const r = K(0), o = K(""), e = K(null), {
4060
4062
  _glideref: t,
4061
4063
  _gridSelectionRows: n,
4062
4064
  colFilters: s,
@@ -4070,12 +4072,12 @@ const Mt = $.memo(() => {
4070
4072
  ready: g,
4071
4073
  scrollToRowKey: p,
4072
4074
  searchStr: y,
4073
- selectedRowKey: _,
4074
- selectFirstRowOnMount: C,
4075
+ selectedRowKey: C,
4076
+ selectFirstRowOnMount: _,
4075
4077
  setState: x,
4076
- setStateFN: R,
4077
- values: O
4078
- } = W((w) => ({
4078
+ setStateFN: O,
4079
+ values: I
4080
+ } = H((w) => ({
4079
4081
  _glideref: w._glideref,
4080
4082
  _gridSelectionRows: w._gridSelectionRows,
4081
4083
  colFilters: w.colFilters,
@@ -4110,52 +4112,36 @@ const Mt = $.memo(() => {
4110
4112
  leading: !1
4111
4113
  }
4112
4114
  );
4113
- return I(() => {
4114
- O && (async () => {
4115
- const S = c("_page_data"), E = c("pageSize"), D = c("keyField") ?? "id", L = [];
4116
- for (const M in O) {
4117
- let F = -1;
4118
- const A = String(
4119
- typeof O?.[M] == "object" ? O?.[M]?.[D] : typeof O?.[M] == "string" ? O?.[M] : void 0
4115
+ return R(() => {
4116
+ I && (async (S) => {
4117
+ const E = c("keyField") ?? "id", M = [];
4118
+ for (const L in S) {
4119
+ const D = String(
4120
+ typeof S?.[L] == "object" ? S?.[L]?.[E] : typeof S?.[L] == "string" ? S?.[L] : void 0
4120
4121
  );
4121
- for (const B in S) {
4122
- for (const G in S[B]) {
4123
- const j = Number(B) * E + Number(G);
4124
- if (String(S[B][G]?.[D]) === A) {
4125
- F = j;
4126
- break;
4127
- }
4128
- }
4129
- if (F >= 0) {
4130
- L.push(F);
4131
- break;
4132
- }
4133
- }
4134
- if (F >= 0)
4135
- L.push(F);
4136
- else {
4137
- const B = await u(A);
4138
- B !== null && L.push(B);
4139
- }
4122
+ if (!D)
4123
+ continue;
4124
+ const P = await u(D);
4125
+ P != null && M.push(P);
4140
4126
  }
4141
- return L;
4142
- })().then((S) => {
4127
+ return M;
4128
+ })(I).then((S) => {
4143
4129
  let E = ne.empty();
4144
- S.forEach((D) => {
4145
- D !== void 0 && (E = E.add(D));
4146
- }), R("_gridSelectionRows", () => E), R("_gridSelection", (D) => ({
4147
- columns: D?.columns ?? ne.empty(),
4148
- ...D,
4130
+ S.forEach((M) => {
4131
+ M !== void 0 && (E = E.add(M));
4132
+ }), O("_gridSelectionRows", () => E), O("_gridSelection", (M) => ({
4133
+ columns: M?.columns ?? ne.empty(),
4134
+ ...M,
4149
4135
  rows: E
4150
4136
  }));
4151
4137
  });
4152
- }, [O]), I(() => {
4138
+ }, [I]), R(() => {
4153
4139
  const w = c("onChange");
4154
4140
  if (w && typeof w == "function") {
4155
- const E = c("getGridSelectedRows")(), D = c("values");
4156
- JSON.stringify(D) !== JSON.stringify(E) && w(E);
4141
+ const E = c("getGridSelectedRows")(), M = c("values");
4142
+ JSON.stringify(M) !== JSON.stringify(E) && w(E);
4157
4143
  }
4158
- }, [n, n?.length, c]), I(() => {
4144
+ }, [n, n?.length, c]), R(() => {
4159
4145
  x(
4160
4146
  "renderColumns",
4161
4147
  f?.map((w) => ({
@@ -4164,18 +4150,18 @@ const Mt = $.memo(() => {
4164
4150
  icon: "sort"
4165
4151
  }))
4166
4152
  );
4167
- }, [f]), I(() => {
4153
+ }, [f]), R(() => {
4168
4154
  if (y == null) {
4169
4155
  o.current = "";
4170
4156
  return;
4171
4157
  }
4172
4158
  o.current !== y && (N(y), o.current = y);
4173
- }, [y]), I(() => {
4159
+ }, [y]), R(() => {
4174
4160
  l && (x("_gridSelection", {
4175
4161
  columns: ne.empty(),
4176
4162
  current: void 0,
4177
4163
  rows: ne.empty()
4178
- }), x("_gridSelectionRows", ne.empty()), R("renderColumns", (w) => w?.map((S) => ({
4164
+ }), x("_gridSelectionRows", ne.empty()), O("renderColumns", (w) => w?.map((S) => ({
4179
4165
  ...S,
4180
4166
  icon: S.id && l?.find((E) => E.id === S.id)?.direction ? l?.find((E) => E.id === S.id)?.direction === "asc" ? "sortup" : "sortdown" : S.defaultIcon ?? "sort"
4181
4167
  }))).then(() => {
@@ -4187,7 +4173,7 @@ const Mt = $.memo(() => {
4187
4173
  );
4188
4174
  });
4189
4175
  }));
4190
- }, [l]), I(() => {
4176
+ }, [l]), R(() => {
4191
4177
  s && JSON.stringify(e.current) !== JSON.stringify(s) && (m(0, "all").then(() => {
4192
4178
  c("refreshCells")?.(), c("_events")?.dispatchEvent?.(
4193
4179
  new CustomEvent("onColumnFiltered", {
@@ -4195,60 +4181,60 @@ const Mt = $.memo(() => {
4195
4181
  })
4196
4182
  );
4197
4183
  }), e.current = s);
4198
- }, [s]), I(() => {
4199
- a && R("renderColumns", (w) => w?.map((S) => ({
4184
+ }, [s]), R(() => {
4185
+ a && O("renderColumns", (w) => w?.map((S) => ({
4200
4186
  ...S,
4201
4187
  width: S.id && a?.[S.id] ? a?.[S.id] : S.width
4202
4188
  }))).then(() => {
4203
4189
  c("refreshCells")?.();
4204
4190
  });
4205
- }, [a]), I(() => {
4206
- i && R("renderColumns", (w) => w?.sort((E, D) => i[E.id] > i[D.id] ? 1 : -1)).then(() => {
4191
+ }, [a]), R(() => {
4192
+ i && O("renderColumns", (w) => w?.sort((E, M) => i[E.id] > i[M.id] ? 1 : -1)).then(() => {
4207
4193
  c("refreshCells")?.();
4208
4194
  });
4209
- }, [i]), I(() => {
4195
+ }, [i]), R(() => {
4210
4196
  t && (r.current > 0 || (r.current = 1, m(0).then(() => {
4211
4197
  c("refreshCells")?.();
4212
4198
  })));
4213
- }, [g, m]), I(() => {
4199
+ }, [g, m]), R(() => {
4214
4200
  const w = c("_events"), S = () => {
4215
4201
  const E = c("selectFirstRowOnMount");
4216
4202
  if (c("ready") && E) {
4217
4203
  const L = c("scrollToRowKey");
4218
4204
  if (L && L >= 0)
4219
4205
  return;
4220
- const M = c("keyField") ?? "id", A = c("_page_data")?.[0]?.[0], B = A?.[M] ?? -1, G = c("values") ?? [];
4221
- if (!A)
4206
+ const D = c("keyField") ?? "id", F = c("_page_data")?.[0]?.[0], U = F?.[D] ?? -1, V = c("values") ?? [];
4207
+ if (!F)
4222
4208
  return;
4223
- if (B && B > 0 && (G.length ?? 0) === 0) {
4224
- const j = [A], J = c("onChange");
4225
- J ? J(j) : x("values", j), x("scrollToRowKey", B);
4209
+ if (U && U > 0 && (V.length ?? 0) === 0) {
4210
+ const j = [F], J = c("onChange");
4211
+ J ? J(j) : x("values", j), x("scrollToRowKey", U);
4226
4212
  }
4227
4213
  }
4228
4214
  };
4229
4215
  return w?.addEventListener("loadPage", S), () => {
4230
4216
  w?.removeEventListener("loadPage", S);
4231
4217
  };
4232
- }, [g, C, O]), I(() => {
4233
- const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), D = _ ?? p;
4234
- D && S && w && E?.(D).then((L) => {
4218
+ }, [g, _, I]), R(() => {
4219
+ const w = c("ready"), S = c("_glideref"), E = c("getRowIndexByKey"), M = C ?? p;
4220
+ M && S && w && E?.(M).then((L) => {
4235
4221
  if (L !== void 0) {
4236
- if (_) {
4237
- const M = c("onChange"), F = [{ [c("keyField") ?? "id"]: _ }];
4238
- JSON.stringify(c("values")) !== JSON.stringify(F) && (M ? M(F) : x("values", F));
4222
+ if (C) {
4223
+ const D = c("onChange"), P = [{ [c("keyField") ?? "id"]: C }];
4224
+ JSON.stringify(c("values")) !== JSON.stringify(P) && (D ? D(P) : x("values", P));
4239
4225
  }
4240
4226
  S.scrollTo(0, L), c("_events").dispatchEvent(
4241
4227
  new CustomEvent("scrollToRowKeyFound", {
4242
4228
  detail: {
4243
4229
  rowNumber: L,
4244
4230
  scrollToRowKey: p,
4245
- selectedRowKey: _
4231
+ selectedRowKey: C
4246
4232
  }
4247
4233
  })
4248
4234
  );
4249
4235
  }
4250
4236
  });
4251
- }, [p, _]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4237
+ }, [p, C]), /* @__PURE__ */ d.jsx(d.Fragment, {});
4252
4238
  });
4253
4239
  Mt.displayName = "Gridler-Computer";
4254
4240
  function Nr(r, o, e = 1) {
@@ -4275,7 +4261,7 @@ const Pt = $.memo(() => {
4275
4261
  s,
4276
4262
  i,
4277
4263
  a
4278
- ] = W((l) => [
4264
+ ] = H((l) => [
4279
4265
  l.setState,
4280
4266
  l.getState,
4281
4267
  l._glideref,
@@ -4286,9 +4272,9 @@ const Pt = $.memo(() => {
4286
4272
  l._loadingList,
4287
4273
  l.hasLocalData
4288
4274
  ]);
4289
- return I(() => {
4275
+ return R(() => {
4290
4276
  e && r("mounted", !0);
4291
- }, [r]), I(() => {
4277
+ }, [r]), R(() => {
4292
4278
  if (!e)
4293
4279
  return;
4294
4280
  const l = Math.max(0, Math.floor(t.y / n)), f = Math.floor((t.y + t.height) / n);
@@ -4310,7 +4296,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4310
4296
  }, Gr = (r) => (o) => o % 2 === 0 ? void 0 : {
4311
4297
  bgCell: r === "dark" ? "#303030" : "#e1effc"
4312
4298
  }, qr = () => {
4313
- const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = W((c) => ({
4299
+ const r = nn(), { colorScheme: o } = rn(), { enableOddEvenRowColor: e, focused: t } = H((c) => ({
4314
4300
  enableOddEvenRowColor: c.enableOddEvenRowColor,
4315
4301
  focused: c.focused
4316
4302
  })), n = {
@@ -4347,7 +4333,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4347
4333
  bgCell: n,
4348
4334
  textGroupHeader: "#2c5491"
4349
4335
  }, [l, f] = se(a);
4350
- return I(() => {
4336
+ return R(() => {
4351
4337
  f(a);
4352
4338
  }, [o, t]), { getRowThemeOverride: (c) => e ? Gr(o)(c) : void 0, gridTheme: l };
4353
4339
  }, Hr = () => {
@@ -4363,26 +4349,26 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4363
4349
  headerHeight: g,
4364
4350
  heightProp: p,
4365
4351
  mounted: y,
4366
- onCellActivated: _,
4367
- onCellClicked: C,
4352
+ onCellActivated: C,
4353
+ onCellClicked: _,
4368
4354
  onCellEdited: x,
4369
- onColumnMoved: R,
4370
- onColumnProposeMove: O,
4355
+ onColumnMoved: O,
4356
+ onColumnProposeMove: I,
4371
4357
  onColumnResize: N,
4372
4358
  onContextClick: w,
4373
4359
  onHeaderClicked: S,
4374
4360
  onHeaderMenuClick: E,
4375
- onItemHovered: D,
4361
+ onItemHovered: M,
4376
4362
  onVisibleRegionChanged: L,
4377
- renderColumns: M,
4378
- rowHeight: F,
4379
- sections: A,
4380
- selectMode: B,
4381
- setState: G,
4363
+ renderColumns: D,
4364
+ rowHeight: P,
4365
+ sections: F,
4366
+ selectMode: U,
4367
+ setState: V,
4382
4368
  setStateFN: j,
4383
4369
  total_rows: J,
4384
4370
  widthProp: Y
4385
- } = W((h) => ({
4371
+ } = H((h) => ({
4386
4372
  _gridSelection: h._gridSelection,
4387
4373
  allowMultiSelect: h.allowMultiSelect,
4388
4374
  focused: h.focused,
@@ -4415,9 +4401,11 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4415
4401
  widthProp: h.width
4416
4402
  })), Z = bn(r, (h) => {
4417
4403
  j("_glideref", () => h ?? void 0);
4418
- const b = u("ready"), k = !!(h && y);
4419
- b !== k && G("ready", k);
4420
- }), q = qr();
4404
+ });
4405
+ R(() => {
4406
+ r.current && y ? u("ready") || V("ready", !0) : u("ready") && V("ready", !1);
4407
+ }, [y, u, V]);
4408
+ const G = qr();
4421
4409
  return /* @__PURE__ */ d.jsxs(
4422
4410
  bt,
4423
4411
  {
@@ -4427,7 +4415,7 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4427
4415
  justify: "stretch",
4428
4416
  w: Y ?? "100%",
4429
4417
  children: [
4430
- A?.top,
4418
+ F?.top,
4431
4419
  /* @__PURE__ */ d.jsxs(
4432
4420
  "div",
4433
4421
  {
@@ -4447,12 +4435,12 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4447
4435
  width: "100%"
4448
4436
  },
4449
4437
  children: [
4450
- A?.left,
4438
+ F?.left,
4451
4439
  n && n > 0 && e && e > 0 && /* @__PURE__ */ d.jsx(
4452
4440
  vn,
4453
4441
  {
4454
4442
  cellActivationBehavior: "double-click",
4455
- columns: M ?? [],
4443
+ columns: D ?? [],
4456
4444
  columnSelect: "none",
4457
4445
  drawFocusRing: !0,
4458
4446
  height: e ?? 400,
@@ -4473,33 +4461,33 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4473
4461
  ...c,
4474
4462
  getCellContent: l,
4475
4463
  getCellsForSelection: f,
4476
- getRowThemeOverride: q.getRowThemeOverride,
4464
+ getRowThemeOverride: G.getRowThemeOverride,
4477
4465
  gridSelection: s,
4478
4466
  headerHeight: g ?? 32,
4479
4467
  headerIcons: { sort: Lr, sortdown: Ne, sortup: Le },
4480
- onCellActivated: _,
4481
- onCellClicked: C,
4468
+ onCellActivated: C,
4469
+ onCellClicked: _,
4482
4470
  onCellContextMenu: (h, b) => {
4483
4471
  b.preventDefault(), c?.onCellContextMenu?.(h, b), o.current || (o.current = !0, w("cell", b, h[0], h[1]), setTimeout(() => {
4484
4472
  o.current = !1;
4485
4473
  }, 100));
4486
4474
  },
4487
4475
  onCellEdited: x,
4488
- onColumnMoved: R,
4489
- onColumnProposeMove: O,
4476
+ onColumnMoved: O,
4477
+ onColumnProposeMove: I,
4490
4478
  onColumnResize: N,
4491
4479
  onGridSelectionChange: (h) => {
4492
4480
  let b = ne.empty();
4493
4481
  const k = u("_gridSelection"), v = u("keyField") ?? "id", z = u("getRowBuffer");
4494
- for (const P of h.rows)
4495
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4496
- if (B === "row" && h.current?.range)
4497
- for (let P = h.current.range.y; P < h.current.range.y + h.current.range.height; P++)
4498
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4482
+ for (const T of h.rows)
4483
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4484
+ if (U === "row" && h.current?.range)
4485
+ for (let T = h.current.range.y; T < h.current.range.y + h.current.range.height; T++)
4486
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4499
4487
  if (b.length === 0)
4500
- for (const P of k?.rows ?? [])
4501
- z && z(P)?.[v] && (b = b.hasIndex(P) ? b : b.add(P));
4502
- (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (G("_gridSelection", { ...h, rows: b }), G("_gridSelectionRows", b));
4488
+ for (const T of k?.rows ?? [])
4489
+ z && z(T)?.[v] && (b = b.hasIndex(T) ? b : b.add(T));
4490
+ (JSON.stringify(k?.columns) !== JSON.stringify(h.columns) || JSON.stringify(k?.rows) !== JSON.stringify(b) || JSON.stringify(k?.current) !== JSON.stringify(h.current)) && (V("_gridSelection", { ...h, rows: b }), V("_gridSelectionRows", b));
4503
4491
  },
4504
4492
  onHeaderClicked: S,
4505
4493
  onHeaderContextMenu: (h, b) => {
@@ -4508,29 +4496,29 @@ const Lr = (r) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" w
4508
4496
  }, 100));
4509
4497
  },
4510
4498
  onHeaderMenuClick: E,
4511
- onItemHovered: D,
4499
+ onItemHovered: M,
4512
4500
  onVisibleRegionChanged: L,
4513
4501
  ref: Z,
4514
- rightElement: A?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
4515
- A?.rightElementStart,
4502
+ rightElement: F?.rightElementDisabled ? void 0 : /* @__PURE__ */ d.jsxs(we, { children: [
4503
+ F?.rightElementStart,
4516
4504
  /* @__PURE__ */ d.jsx(Pr, {}),
4517
- A?.rightElementEnd
4505
+ F?.rightElementEnd
4518
4506
  ] }),
4519
- rowHeight: F ?? 22,
4507
+ rowHeight: P ?? 22,
4520
4508
  rows: J ?? 0,
4521
- theme: q.gridTheme,
4509
+ theme: G.gridTheme,
4522
4510
  width: n ?? 200
4523
4511
  }
4524
4512
  ),
4525
4513
  /* @__PURE__ */ d.jsx(Mt, {}),
4526
4514
  !m && /* @__PURE__ */ d.jsx(Pt, {}),
4527
- A?.right
4515
+ F?.right
4528
4516
  ]
4529
4517
  }
4530
4518
  ),
4531
4519
  /* @__PURE__ */ d.jsxs("div", { style: { flexGrow: 0 }, children: [
4532
4520
  /* @__PURE__ */ d.jsx($r, {}),
4533
- A?.bottom
4521
+ F?.bottom
4534
4522
  ] })
4535
4523
  ]
4536
4524
  }
@@ -4572,7 +4560,7 @@ export {
4572
4560
  Fr as GlidlerAPIAdaptorForGoLangv2,
4573
4561
  Tr as GlidlerFormAdaptor,
4574
4562
  Tt as GlidlerLocalDataAdaptor,
4575
- V as GlobalStateStore,
4563
+ B as GlobalStateStore,
4576
4564
  Oo as GlobalStateStoreProvider,
4577
4565
  fe as GoAPIHeaders,
4578
4566
  Dt as Gridler,
@@ -4588,15 +4576,15 @@ export {
4588
4576
  yo as TextInputCtrl,
4589
4577
  De as errorManager,
4590
4578
  xo as getApiURL,
4591
- _o as getAuthToken,
4592
- Co as isLoggedIn,
4579
+ Co as getAuthToken,
4580
+ _o as isLoggedIn,
4593
4581
  bo as setApiURL,
4594
4582
  Eo as setAuthToken,
4595
4583
  Nn as useBoxerStore,
4596
4584
  fo as useFormerState,
4597
4585
  wo as useGlobalStateStore,
4598
4586
  Ro as useGlobalStateStoreContext,
4599
- W as useGridlerStore,
4587
+ H as useGridlerStore,
4600
4588
  At as useMantineBetterMenus
4601
4589
  };
4602
4590
  //# sourceMappingURL=lib.es.js.map