@gisce/ooui 2.6.1 → 2.6.2

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/ooui.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var ce = Object.defineProperty;
2
- var de = (s, t, e) => t in s ? ce(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var n = (s, t, e) => (de(s, typeof t != "symbol" ? t + "" : t, e), e);
2
+ var de = (i, t, e) => t in i ? ce(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var n = (i, t, e) => (de(i, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import { decode as ue } from "html-entities";
5
5
  import { evaluateCondition as he } from "@gisce/conscheck";
6
6
  import * as Y from "txml";
@@ -108,14 +108,14 @@ const C = class C {
108
108
  */
109
109
  n(C, "_defaultColspan", 1);
110
110
  let F = C;
111
- const _e = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), fe = ({
112
- entry: s,
111
+ const _e = (i = !1) => (i = JSON.parse(i.toString().toLowerCase()), +i > 0), fe = ({
112
+ entry: i,
113
113
  values: t,
114
114
  fields: e
115
115
  }) => {
116
- let [i, r, a] = s, l = t[i];
116
+ let [s, r, a] = i, l = t[s];
117
117
  const o = q({
118
- fieldName: i,
118
+ fieldName: s,
119
119
  valueInObject: l,
120
120
  expectedValue: a,
121
121
  fields: e
@@ -144,46 +144,46 @@ const _e = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), fe
144
144
  default:
145
145
  return !1;
146
146
  }
147
- }, b = (s) => ue(s, { level: "xml" }), q = ({
148
- fieldName: s,
147
+ }, b = (i) => ue(i, { level: "xml" }), q = ({
148
+ fieldName: i,
149
149
  valueInObject: t,
150
150
  expectedValue: e,
151
- fields: i = {}
151
+ fields: s = {}
152
152
  }) => {
153
153
  const r = {
154
154
  modifiedValueInObject: t,
155
155
  modifiedExpectedValue: null,
156
156
  directOutcome: void 0
157
157
  };
158
- return i[s] === void 0 ? {
158
+ return s[i] === void 0 ? {
159
159
  modifiedValueInObject: null,
160
160
  modifiedExpectedValue: null,
161
161
  directOutcome: !1
162
- } : t === void 0 && i[s].type !== "boolean" && i[s].type !== "many2one" && i[s].type !== "selection" ? {
162
+ } : t === void 0 && s[i].type !== "boolean" && s[i].type !== "many2one" && s[i].type !== "selection" ? {
163
163
  modifiedValueInObject: null,
164
164
  modifiedExpectedValue: null,
165
165
  directOutcome: !1
166
- } : (r.modifiedValueInObject = i[s].type === "boolean" ? !!t : t, i[s].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), i[s].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), i[s].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
166
+ } : (r.modifiedValueInObject = s[i].type === "boolean" ? !!t : t, s[i].type === "many2one" && e === !1 && t === void 0 ? r.modifiedExpectedValue = void 0 : (r.modifiedValueInObject = r.modifiedValueInObject === void 0 ? !1 : r.modifiedValueInObject, r.modifiedValueInObject = r.modifiedValueInObject === null ? !1 : r.modifiedValueInObject), s[i].type === "many2one" && Array.isArray(r.modifiedValueInObject) && r.modifiedValueInObject[0] === void 0 && (r.modifiedValueInObject = !1), s[i].type === "boolean" && (e === 0 || e === 1) && (r.modifiedExpectedValue = e !== 0), r);
167
167
  }, ge = ({
168
- attrs: s,
168
+ attrs: i,
169
169
  values: t,
170
170
  fields: e,
171
- widgetType: i
171
+ widgetType: s
172
172
  }) => {
173
- const u = s.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
173
+ const u = i.replace(/\(/g, "[").replace(/\)/g, "]").replace(/'/g, '"').replace(/True/g, "true").replace(/False/g, "false"), _ = b(u), h = JSON.parse(_), d = {};
174
174
  for (const c of Object.keys(h)) {
175
175
  const x = h[c].map((m) => fe({ entry: m, values: t, fields: e })).every((m) => m);
176
- x ? d[c] = !0 : c === "readonly" && !x && i === "button" && (d[c] = !1);
176
+ x ? d[c] = !0 : c === "readonly" && !x && s === "button" && (d[c] = !1);
177
177
  }
178
178
  return d;
179
179
  }, me = ({
180
- attrs: s,
180
+ attrs: i,
181
181
  values: t,
182
182
  fields: e
183
183
  }) => {
184
184
  try {
185
- const i = b(s), r = JSON.parse(
186
- i.replace(/'/g, '"')
185
+ const s = b(i), r = JSON.parse(
186
+ s.replace(/'/g, '"')
187
187
  ), a = {};
188
188
  for (const l of Object.keys(r))
189
189
  a[l] = he({
@@ -201,41 +201,41 @@ const _e = (s = !1) => (s = JSON.parse(s.toString().toLowerCase()), +s > 0), fe
201
201
  })
202
202
  });
203
203
  return a;
204
- } catch (i) {
205
- throw console.error(i), i instanceof SyntaxError ? new Error(
206
- "Error parsing new json_attrs. Original string: " + s
207
- ) : i;
204
+ } catch (s) {
205
+ throw console.error(s), s instanceof SyntaxError ? new Error(
206
+ "Error parsing new json_attrs. Original string: " + i
207
+ ) : s;
208
208
  }
209
209
  }, be = ({
210
- tagAttributes: s,
210
+ tagAttributes: i,
211
211
  values: t,
212
212
  fields: e,
213
- widgetType: i,
213
+ widgetType: s,
214
214
  fallbackMode: r = !0
215
215
  }) => {
216
216
  let a = {}, l = {};
217
- if (s.attrs && (l = ge({
218
- attrs: s.attrs,
217
+ if (i.attrs && (l = ge({
218
+ attrs: i.attrs,
219
219
  values: t,
220
220
  fields: e,
221
- widgetType: i
222
- })), s.json_attrs)
221
+ widgetType: s
222
+ })), i.json_attrs)
223
223
  try {
224
224
  a = me({
225
- attrs: s.json_attrs,
225
+ attrs: i.json_attrs,
226
226
  values: t,
227
227
  fields: e
228
228
  });
229
229
  } catch (o) {
230
- if (r && s.attrs)
230
+ if (r && i.attrs)
231
231
  a = l;
232
232
  else
233
233
  throw o;
234
234
  }
235
235
  else
236
- s.attrs && (a = l);
236
+ i.attrs && (a = l);
237
237
  return {
238
- ...s,
238
+ ...i,
239
239
  ...a,
240
240
  attrs: void 0,
241
241
  json_attrs: void 0
@@ -415,7 +415,7 @@ class H extends g {
415
415
  }
416
416
  }
417
417
  class I {
418
- constructor(t = 4, e = 6, i = !1, r = void 0) {
418
+ constructor(t = 4, e = 6, s = !1, r = void 0) {
419
419
  /**
420
420
  * Number of columns the container is divided
421
421
  */
@@ -437,7 +437,7 @@ class I {
437
437
  * Unique key for container
438
438
  */
439
439
  n(this, "_key");
440
- this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = i, this._key = r;
440
+ this._columns = t, this._colspan = e, this._rows = [[]], this._index = 0, this._readOnly = s, this._key = r;
441
441
  }
442
442
  get columns() {
443
443
  return this._columns;
@@ -476,11 +476,11 @@ class I {
476
476
  * Returns the next free position
477
477
  */
478
478
  freePosition() {
479
- const t = this._rows[this._index].filter((e) => !e.invisible).reduce((e, i) => e + i.colspan, 0);
479
+ const t = this._rows[this._index].filter((e) => !e.invisible).reduce((e, s) => e + s.colspan, 0);
480
480
  return this._columns - t;
481
481
  }
482
482
  addWidget(t, e) {
483
- const i = [], r = e ? e.addLabel : !0;
483
+ const s = [], r = e ? e.addLabel : !0;
484
484
  if (t instanceof J) {
485
485
  this._rows.push([]), this._index++;
486
486
  return;
@@ -495,22 +495,22 @@ class I {
495
495
  fieldForLabel: t.id,
496
496
  key: `${t.key}-label`
497
497
  });
498
- l.type = "label", i.push(l), i.push(t);
498
+ l.type = "label", s.push(l), s.push(t);
499
499
  } else
500
- i.push(t);
501
- i.reduce(
500
+ s.push(t);
501
+ s.reduce(
502
502
  (l, o) => l + o.colspan,
503
503
  0
504
- ) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(i);
504
+ ) > this.freePosition() && (this._rows.push([]), this._index++), this._rows[this._index] = this._rows[this._index].concat(s);
505
505
  }
506
506
  /**
507
507
  * Traverses children to find a matching container or widget with the exact same id.
508
508
  * @param {string} id id (name) of the field or container to find
509
509
  */
510
510
  findById(t) {
511
- var i;
511
+ var s;
512
512
  let e = null;
513
- return (i = this._rows) != null && i.length && this._rows.forEach((r) => {
513
+ return (s = this._rows) != null && s.length && this._rows.forEach((r) => {
514
514
  e || r != null && r.length && r.forEach((a) => {
515
515
  e || a && (e = a.findById(t));
516
516
  });
@@ -668,12 +668,12 @@ class Q extends g {
668
668
  n(this, "_danger", !1);
669
669
  if (e) {
670
670
  if (e.string && (this._caption = b(e.string)), e.buttonType && (this._buttonType = e.buttonType), e.confirm && (this._confirmMessage = b(e.confirm)), e.special && e.special === "cancel" && (this._buttonType = "cancel"), e.icon && (this._icon = e.icon), e.primary) {
671
- const i = e.primary;
672
- (i === "1" || i === 1 || i === !0) && (this._primary = !0);
671
+ const s = e.primary;
672
+ (s === "1" || s === 1 || s === !0) && (this._primary = !0);
673
673
  }
674
674
  if (e.danger) {
675
- const i = e.danger;
676
- (i === "1" || i === 1 || i === !0) && (this._danger = !0);
675
+ const s = e.danger;
676
+ (s === "1" || s === 1 || s === !0) && (this._danger = !0);
677
677
  }
678
678
  }
679
679
  }
@@ -724,13 +724,13 @@ class we extends w {
724
724
  return this._defaultName;
725
725
  }
726
726
  get defaultButton() {
727
- return this.buttons.find((i) => i.id === this.defaultName) || this.buttons[0];
727
+ return this.buttons.find((s) => s.id === this.defaultName) || this.buttons[0];
728
728
  }
729
729
  get secondaryButtons() {
730
730
  return this.buttons.filter(
731
- (i) => {
731
+ (s) => {
732
732
  var r;
733
- return i.id !== ((r = this.defaultButton) == null ? void 0 : r.id);
733
+ return s.id !== ((r = this.defaultButton) == null ? void 0 : r.id);
734
734
  }
735
735
  );
736
736
  }
@@ -899,8 +899,8 @@ class L extends g {
899
899
  */
900
900
  n(this, "_decimalDigits", 2);
901
901
  if (e != null && e.digits) {
902
- const [i, r] = e.digits;
903
- this._integerDigits = i, this._decimalDigits = r;
902
+ const [s, r] = e.digits;
903
+ this._integerDigits = s, this._decimalDigits = r;
904
904
  }
905
905
  }
906
906
  get integerDigits() {
@@ -932,7 +932,7 @@ class Pe extends g {
932
932
  super(t);
933
933
  }
934
934
  }
935
- class Se extends g {
935
+ class We extends g {
936
936
  constructor(e) {
937
937
  super(e);
938
938
  /**
@@ -999,12 +999,19 @@ class U extends g {
999
999
  * Height
1000
1000
  */
1001
1001
  n(this, "_height");
1002
- if (e && (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height))
1003
- try {
1004
- this._height = parseInt(e.height);
1005
- } catch {
1006
- this._height = void 0;
1007
- }
1002
+ /**
1003
+ * Infinite mode
1004
+ */
1005
+ n(this, "_infinite", !1);
1006
+ if (e) {
1007
+ if (e.size && (this._size = e.size), e.relation && (this._relation = e.relation), e.mode && (this._mode = e.mode.split(",")), e.views && (this._views = e.views), e.colspan ? this.colspan = e.colspan : this._mustExpand = !0, e.inv_field && (this._inv_field = e.inv_field), e.height)
1008
+ try {
1009
+ this._height = parseInt(e.height);
1010
+ } catch {
1011
+ this._height = void 0;
1012
+ }
1013
+ e.widget_props && (this.parsedWidgetProps.infinite === "1" || this.parsedWidgetProps.infinite === 1 || this.parsedWidgetProps.infinite === !0) && (this._infinite = !0);
1014
+ }
1008
1015
  }
1009
1016
  get size() {
1010
1017
  return this._size;
@@ -1048,8 +1055,14 @@ class U extends g {
1048
1055
  set height(e) {
1049
1056
  this._height = e;
1050
1057
  }
1058
+ get infinite() {
1059
+ return this._infinite;
1060
+ }
1061
+ set infinite(e) {
1062
+ this._infinite = e;
1063
+ }
1051
1064
  }
1052
- class We extends F {
1065
+ class Se extends F {
1053
1066
  constructor(e) {
1054
1067
  super(e);
1055
1068
  /**
@@ -1377,7 +1390,7 @@ class G {
1377
1390
  this._widgetClass = Te;
1378
1391
  break;
1379
1392
  case "many2many":
1380
- this._widgetClass = Se;
1393
+ this._widgetClass = We;
1381
1394
  break;
1382
1395
  case "markdown":
1383
1396
  this._widgetClass = Fe;
@@ -1390,7 +1403,7 @@ class G {
1390
1403
  this._widgetClass = J;
1391
1404
  break;
1392
1405
  case "separator":
1393
- this._widgetClass = We;
1406
+ this._widgetClass = Se;
1394
1407
  break;
1395
1408
  case "url":
1396
1409
  this._widgetClass = D;
@@ -1452,12 +1465,12 @@ class G {
1452
1465
  }
1453
1466
  }
1454
1467
  createWidget(t, e) {
1455
- let i = t;
1456
- switch (this.setWidgetClass(t), this._widgetClass === void 0 && (i = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = F), t) {
1468
+ let s = t;
1469
+ switch (this.setWidgetClass(t), this._widgetClass === void 0 && (s = e.fieldsWidgetType, this.setWidgetClass(e.fieldsWidgetType)), this._widgetClass === void 0 && (this._widgetClass = F), t) {
1457
1470
  case "notebook":
1458
1471
  case "page":
1459
1472
  case "group":
1460
- return new this._widgetClass({ ...e, type: i });
1473
+ return new this._widgetClass({ ...e, type: s });
1461
1474
  case "button":
1462
1475
  return new this._widgetClass({
1463
1476
  ...e,
@@ -1465,25 +1478,25 @@ class G {
1465
1478
  buttonType: e.type
1466
1479
  });
1467
1480
  default:
1468
- return new this._widgetClass({ ...e, type: i });
1481
+ return new this._widgetClass({ ...e, type: s });
1469
1482
  }
1470
1483
  }
1471
1484
  }
1472
1485
  const qe = ({
1473
- fieldName: s,
1486
+ fieldName: i,
1474
1487
  values: t,
1475
1488
  fields: e
1476
1489
  }) => {
1477
1490
  var l;
1478
- if (!s)
1479
- return {};
1480
- const i = (l = e[s]) == null ? void 0 : l.states;
1481
1491
  if (!i)
1482
1492
  return {};
1493
+ const s = (l = e[i]) == null ? void 0 : l.states;
1494
+ if (!s)
1495
+ return {};
1483
1496
  const r = {}, a = {};
1484
- for (const o of Object.keys(i))
1497
+ for (const o of Object.keys(s))
1485
1498
  if (t.state === o) {
1486
- const u = i[o];
1499
+ const u = s[o];
1487
1500
  for (const _ of u) {
1488
1501
  const [h, d] = _;
1489
1502
  a[h] || (a[h] = []), a[h].push(d);
@@ -1495,39 +1508,39 @@ const qe = ({
1495
1508
  }
1496
1509
  return r;
1497
1510
  }, Je = ({
1498
- states: s,
1511
+ states: i,
1499
1512
  values: t
1500
1513
  }) => {
1501
1514
  if (!(t != null && t.state))
1502
1515
  return {};
1503
- const e = s.split(",");
1516
+ const e = i.split(",");
1504
1517
  return e.length === 0 ? {} : e.includes(t.state) ? {} : { invisible: !0 };
1505
1518
  };
1506
1519
  function He({
1507
- values: s = {},
1520
+ values: i = {},
1508
1521
  fieldName: t,
1509
1522
  fields: e = {}
1510
1523
  }) {
1511
1524
  var r;
1512
- const i = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1513
- return i === "many2one" ? s[t] ? s[t][0] || null : !1 : i === "one2many" || i === "many2many" ? s[t].map((a) => a.id) : s != null && s[t] ? s == null ? void 0 : s[t] : t.includes("'") ? t : parseInt(t);
1525
+ const s = ((r = e[t]) == null ? void 0 : r.type) || "passthrough";
1526
+ return s === "many2one" ? i[t] ? i[t][0] || null : !1 : s === "one2many" || s === "many2many" ? i[t].map((a) => a.id) : i != null && i[t] ? i == null ? void 0 : i[t] : t.includes("'") ? t : parseInt(t);
1514
1527
  }
1515
1528
  const Z = ({
1516
- context: s,
1529
+ context: i,
1517
1530
  values: t,
1518
1531
  fields: e
1519
1532
  }) => {
1520
1533
  try {
1521
- if (!s)
1534
+ if (!i)
1522
1535
  return;
1523
- if (te(s) || typeof s != "string")
1524
- return s;
1525
- const i = ee(s);
1526
- if (i !== null)
1536
+ if (te(i) || typeof i != "string")
1527
1537
  return i;
1528
- if (s.trim().length === 0)
1538
+ const s = ee(i);
1539
+ if (s !== null)
1540
+ return s;
1541
+ if (i.trim().length === 0)
1529
1542
  return;
1530
- const d = s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((f) => f.split(":")), c = {};
1543
+ const d = i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((f) => f.split(":")), c = {};
1531
1544
  return d.forEach((f) => {
1532
1545
  const y = f[1];
1533
1546
  if (!f[1].includes("'") && f[1] !== "true" && f[1] !== "false") {
@@ -1546,43 +1559,43 @@ const Z = ({
1546
1559
  } catch {
1547
1560
  return;
1548
1561
  }
1549
- }, pt = (s) => {
1562
+ }, pt = (i) => {
1550
1563
  const t = [];
1551
1564
  try {
1552
- return !s || te(s) || typeof s != "string" ? t : ee(s) !== null ? [] : (s.trim().length === 0 || s.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
1565
+ return !i || te(i) || typeof i != "string" ? t : ee(i) !== null ? [] : (i.trim().length === 0 || i.replace(/"/g, "'").replace(/\s/g, "").replace(/True/g, "true").replace(/False/g, "false").replace(/\{/g, "").replace(/\}/g, "").split(",").map((d) => d.split(":")).forEach((d) => {
1553
1566
  !d[1].includes("'") && d[1] !== "true" && d[1] !== "false" && t.push(d[1].replace(/'/g, ""));
1554
1567
  }), t);
1555
1568
  } catch {
1556
1569
  }
1557
1570
  return t;
1558
1571
  };
1559
- function ee(s) {
1572
+ function ee(i) {
1560
1573
  try {
1561
- return JSON.parse(s.replace(/'/g, '"'));
1574
+ return JSON.parse(i.replace(/'/g, '"'));
1562
1575
  } catch {
1563
1576
  return null;
1564
1577
  }
1565
1578
  }
1566
- function te(s) {
1567
- return typeof s == "object" && s !== null && typeof s != "string";
1579
+ function te(i) {
1580
+ return typeof i == "object" && i !== null && typeof i != "string";
1568
1581
  }
1569
- const Qe = (s) => {
1570
- const t = s.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1582
+ const Qe = (i) => {
1583
+ const t = i.trim().replace(")", "").split("("), e = t[0], r = t[1].split(",").map((a) => a.trim());
1571
1584
  return {
1572
1585
  method: e,
1573
1586
  args: r
1574
1587
  };
1575
1588
  };
1576
- function Xe(s) {
1589
+ function Xe(i) {
1577
1590
  const t = [];
1578
- function e(i) {
1591
+ function e(s) {
1579
1592
  const r = [];
1580
- for (const a of i)
1593
+ for (const a of s)
1581
1594
  a instanceof w ? e(a._container.rows.flat()) : r.push(a);
1582
1595
  r.length > 0 && t.push(r);
1583
1596
  }
1584
- for (const i of s)
1585
- e(i);
1597
+ for (const s of i)
1598
+ e(s);
1586
1599
  return t.flat();
1587
1600
  }
1588
1601
  class wt {
@@ -1688,11 +1701,11 @@ class wt {
1688
1701
  }
1689
1702
  parse(t, e) {
1690
1703
  var o;
1691
- const { values: i = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((u) => u.tagName === "form")[0];
1692
- this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = i.id ? { active_id: i.id, active_ids: [i.id] } : {}, this._invisibleFields = [], this.parseNode({
1704
+ const { values: s = {}, readOnly: r = !1 } = e || {}, a = Y.parse(t).filter((u) => u.tagName === "form")[0];
1705
+ this._string = ((o = a.attributes) == null ? void 0 : o.string) || null, this._string && (this._string = b(this._string)), this._readOnly = r, this._context = s.id ? { active_id: s.id, active_ids: [s.id] } : {}, this._invisibleFields = [], this.parseNode({
1693
1706
  fields: a.children,
1694
1707
  container: this._container,
1695
- values: i
1708
+ values: s
1696
1709
  }), Xe(this._container._rows).forEach((u) => {
1697
1710
  const _ = u;
1698
1711
  _._id && _._context && (this._contextForFields[_._id] = u._context);
@@ -1701,7 +1714,7 @@ class wt {
1701
1714
  parseNode({
1702
1715
  fields: t,
1703
1716
  container: e,
1704
- values: i
1717
+ values: s
1705
1718
  }) {
1706
1719
  const r = new G();
1707
1720
  t.filter((a) => typeof a == "object").forEach((a) => {
@@ -1709,9 +1722,9 @@ class wt {
1709
1722
  const { tagName: l, attributes: o, children: u } = a;
1710
1723
  let _ = l, h = o;
1711
1724
  if (l === "field") {
1712
- const { name: p, widget: S } = o;
1713
- if (S)
1714
- _ = S;
1725
+ const { name: p, widget: W } = o;
1726
+ if (W)
1727
+ _ = W;
1715
1728
  else if (p) {
1716
1729
  if (!this._fields[p])
1717
1730
  throw new Error(
@@ -1727,22 +1740,22 @@ class wt {
1727
1740
  }
1728
1741
  const d = be({
1729
1742
  tagAttributes: h,
1730
- values: i,
1743
+ values: s,
1731
1744
  fields: this._fields,
1732
1745
  widgetType: l
1733
1746
  });
1734
1747
  let c;
1735
1748
  l === "button" && h.states ? c = Je({
1736
1749
  states: h.states,
1737
- values: i
1750
+ values: s
1738
1751
  }) : c = qe({
1739
1752
  fieldName: h.name,
1740
- values: i,
1753
+ values: s,
1741
1754
  fields: this._fields
1742
1755
  });
1743
1756
  const f = Z({
1744
1757
  context: h.context || ((v = this._fields[h.name]) == null ? void 0 : v.context),
1745
- values: i,
1758
+ values: s,
1746
1759
  fields: this._fields
1747
1760
  });
1748
1761
  h.on_change && (this._onChangeFields[h.name] = Qe(
@@ -1762,7 +1775,7 @@ class wt {
1762
1775
  m.invisible && m instanceof g && this._invisibleFields.push(x.name), m instanceof w && this.parseNode({
1763
1776
  fields: u,
1764
1777
  container: m.container,
1765
- values: i
1778
+ values: s
1766
1779
  }), m instanceof Q && m.readOnly !== void 0 || (m.readOnly = m.readOnly || this.readOnly), e.addWidget(m);
1767
1780
  });
1768
1781
  }
@@ -1774,8 +1787,8 @@ class wt {
1774
1787
  return this.container.findById(t);
1775
1788
  }
1776
1789
  }
1777
- function R(s) {
1778
- return s ? Array.isArray(s) && s.length > 0 ? !0 : typeof s == "string" && s !== "" && s !== "[]" : !1;
1790
+ function R(i) {
1791
+ return i ? Array.isArray(i) && i.length > 0 ? !0 : typeof i == "string" && i !== "" && i !== "[]" : !1;
1779
1792
  }
1780
1793
  class vt {
1781
1794
  constructor(t) {
@@ -1834,7 +1847,7 @@ class vt {
1834
1847
  parse(t) {
1835
1848
  const e = Y.parse(t).filter((r) => r.tagName === "tree")[0];
1836
1849
  this._string = e.attributes.string || null, this._string && (this._string = b(this._string)), this._colors = e.attributes.colors || null, this._colors && (this._colors = b(this._colors)), this._status = e.attributes.status || null, this._status && (this._status = b(this._status)), this._editable = e.attributes.editable || null;
1837
- const i = new G();
1850
+ const s = new G();
1838
1851
  e.children.forEach((r) => {
1839
1852
  const { tagName: a, attributes: l } = r;
1840
1853
  let o = null;
@@ -1859,7 +1872,7 @@ class vt {
1859
1872
  }, this._contextForFields[u] = c;
1860
1873
  }
1861
1874
  if (_ && (o = _), !h.invisible) {
1862
- const d = i.createWidget(o, h);
1875
+ const d = s.createWidget(o, h);
1863
1876
  this._columns.push(d);
1864
1877
  }
1865
1878
  }
@@ -1887,7 +1900,7 @@ const Ue = {
1887
1900
  datetime: "datetime"
1888
1901
  };
1889
1902
  class Ft {
1890
- constructor(t, e, i = 8) {
1903
+ constructor(t, e, s = 8) {
1891
1904
  /**
1892
1905
  * Object containing the specific fields for primary and secondary search fields
1893
1906
  */
@@ -1898,7 +1911,7 @@ class Ft {
1898
1911
  n(this, "_fields");
1899
1912
  n(this, "_simpleSearchContainer");
1900
1913
  n(this, "_advancedSearchContainer");
1901
- this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(i), this._advancedSearchContainer = new I(i);
1914
+ this._searchFields = t, this._fields = e, this._simpleSearchContainer = new I(s), this._advancedSearchContainer = new I(s);
1902
1915
  }
1903
1916
  get searchFields() {
1904
1917
  return this._searchFields;
@@ -1927,10 +1940,10 @@ class Ft {
1927
1940
  });
1928
1941
  }
1929
1942
  parseFields(t, e) {
1930
- return t.map((i) => {
1943
+ return t.map((s) => {
1931
1944
  const r = {
1932
- ...this.fields[i],
1933
- name: i,
1945
+ ...this.fields[s],
1946
+ name: s,
1934
1947
  colspan: 2
1935
1948
  }, { type: a, widget: l } = r;
1936
1949
  let o = l ?? a;
@@ -1946,21 +1959,21 @@ class Ft {
1946
1959
  }
1947
1960
  }
1948
1961
  const Ct = ({
1949
- domain: s,
1962
+ domain: i,
1950
1963
  widgetFieldName: t
1951
1964
  }) => {
1952
1965
  const e = [];
1953
- return s.forEach((i) => {
1954
- if (!Array.isArray(i))
1966
+ return i.forEach((s) => {
1967
+ if (!Array.isArray(s))
1955
1968
  return;
1956
- const [r, a, l] = i;
1969
+ const [r, a, l] = s;
1957
1970
  let o, u;
1958
1971
  r.indexOf(".") !== -1 ? (o = r.substr(0, r.indexOf(".")), u = r.substr(
1959
1972
  r.indexOf(".") + 1,
1960
1973
  r.length - 1
1961
1974
  )) : (o = r, u = "id"), o === t && e.push([u, a, l]);
1962
1975
  }), e;
1963
- }, kt = (s) => typeof s != "string" ? [] : s.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1976
+ }, kt = (i) => typeof i != "string" ? [] : i.replace(/[()[\]]/g, "").split(",").map((t) => t.trim()).filter((t) => !t.includes("'"));
1964
1977
  class Ke {
1965
1978
  constructor(t) {
1966
1979
  n(this, "_action_id", null);
@@ -1980,8 +1993,8 @@ class Ot {
1980
1993
  n(this, "_items", []);
1981
1994
  const e = Y.parse(t).filter((r) => r.tagName === "dashboard")[0];
1982
1995
  this._string = e.attributes.string || null;
1983
- const { children: i } = e;
1984
- i.forEach((r) => {
1996
+ const { children: s } = e;
1997
+ s.forEach((r) => {
1985
1998
  r.tagName === "dashboard_item" && this._items.push(new Ke(r.attributes));
1986
1999
  });
1987
2000
  }
@@ -1992,7 +2005,7 @@ class Ot {
1992
2005
  return this._items;
1993
2006
  }
1994
2007
  }
1995
- class se {
2008
+ class ie {
1996
2009
  constructor(t) {
1997
2010
  n(this, "_string", null);
1998
2011
  n(this, "_type");
@@ -2013,16 +2026,16 @@ class se {
2013
2026
  return this._interval;
2014
2027
  }
2015
2028
  }
2016
- const Ze = (s) => s === 1 || s === "1" || s === !0 || s === "True";
2017
- class ie extends se {
2018
- constructor(e, i) {
2019
- super(i);
2029
+ const Ze = (i) => i === 1 || i === "1" || i === !0 || i === "True";
2030
+ class se extends ie {
2031
+ constructor(e, s) {
2032
+ super(s);
2020
2033
  n(this, "_color", null);
2021
2034
  n(this, "_icon", null);
2022
2035
  n(this, "_totalDomain", null);
2023
2036
  n(this, "_showPercent", !1);
2024
2037
  n(this, "_suffix", null);
2025
- this._type = e, this._color = i.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = i.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = i.attributes.suffix || null, this._totalDomain = b(i.attributes.totalDomain) || null, this._showPercent = Ze(i.attributes.showPercent);
2038
+ this._type = e, this._color = s.attributes.color || null, this._color && (this._color = b(this._color)), this._icon = s.attributes.icon || null, this._icon && (this._icon = b(this._icon)), this._suffix = s.attributes.suffix || null, this._totalDomain = b(s.attributes.totalDomain) || null, this._showPercent = Ze(s.attributes.showPercent);
2026
2039
  }
2027
2040
  get color() {
2028
2041
  return this._color;
@@ -2040,12 +2053,12 @@ class ie extends se {
2040
2053
  return this._suffix;
2041
2054
  }
2042
2055
  }
2043
- class et extends ie {
2044
- constructor(e, i) {
2045
- super(e, i);
2056
+ class et extends se {
2057
+ constructor(e, s) {
2058
+ super(e, s);
2046
2059
  n(this, "_field");
2047
2060
  n(this, "_operator");
2048
- const { children: r } = i;
2061
+ const { children: r } = s;
2049
2062
  r.forEach((a) => {
2050
2063
  if (a.tagName === "field") {
2051
2064
  const l = a.attributes.name, o = a.attributes.operator;
@@ -2060,12 +2073,12 @@ class et extends ie {
2060
2073
  return this._operator;
2061
2074
  }
2062
2075
  }
2063
- const tt = (s) => {
2076
+ const tt = (i) => {
2064
2077
  const t = [];
2065
2078
  let e;
2066
- if (s.forEach((i) => {
2067
- if (i.tagName === "field") {
2068
- const r = i.attributes.axis, a = i.attributes.operator, l = i.attributes.name, o = i.attributes.label || void 0, u = i.attributes.stacked || void 0;
2079
+ if (i.forEach((s) => {
2080
+ if (s.tagName === "field") {
2081
+ const r = s.attributes.axis, a = s.attributes.operator, l = s.attributes.name, o = s.attributes.label || void 0, u = s.attributes.stacked || void 0;
2069
2082
  if (!r)
2070
2083
  throw new Error(`Field ${l} doesn't have an axis`);
2071
2084
  if (!l)
@@ -2073,7 +2086,7 @@ const tt = (s) => {
2073
2086
  r === "x" ? e = new nt({
2074
2087
  name: l
2075
2088
  }) : r === "y" && t.push(
2076
- new it({
2089
+ new st({
2077
2090
  name: l,
2078
2091
  operator: a,
2079
2092
  label: o,
@@ -2090,13 +2103,13 @@ const tt = (s) => {
2090
2103
  y: t
2091
2104
  };
2092
2105
  };
2093
- class j extends se {
2094
- constructor(e, i) {
2095
- super(i);
2106
+ class j extends ie {
2107
+ constructor(e, s) {
2108
+ super(s);
2096
2109
  n(this, "_x");
2097
2110
  n(this, "_y");
2098
2111
  this._type = e;
2099
- const r = tt(i.children);
2112
+ const r = tt(s.children);
2100
2113
  this._x = r.x, this._y = r.y;
2101
2114
  }
2102
2115
  get x() {
@@ -2106,20 +2119,20 @@ class j extends se {
2106
2119
  return this._y;
2107
2120
  }
2108
2121
  }
2109
- const st = {
2110
- indicator: ie,
2122
+ const it = {
2123
+ indicator: se,
2111
2124
  indicatorField: et,
2112
2125
  line: j,
2113
2126
  bar: j,
2114
2127
  pie: j
2115
- }, Tt = (s) => {
2116
- const t = Y.parse(s).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2128
+ }, Tt = (i) => {
2129
+ const t = Y.parse(i).filter((r) => r.tagName === "graph")[0], e = t.attributes.type;
2117
2130
  if (!e)
2118
2131
  throw new Error(`${e} is not a valid graph`);
2119
- const i = st[e];
2120
- if (!i)
2132
+ const s = it[e];
2133
+ if (!s)
2121
2134
  throw new Error(`${e} not found as a GraphModel`);
2122
- return new i(e, t);
2135
+ return new s(e, t);
2123
2136
  };
2124
2137
  class ne {
2125
2138
  constructor({ name: t, axis: e }) {
@@ -2134,10 +2147,10 @@ class ne {
2134
2147
  return this._axis;
2135
2148
  }
2136
2149
  }
2137
- class it extends ne {
2150
+ class st extends ne {
2138
2151
  constructor({
2139
2152
  name: e,
2140
- operator: i,
2153
+ operator: s,
2141
2154
  label: r,
2142
2155
  stacked: a
2143
2156
  }) {
@@ -2145,7 +2158,7 @@ class it extends ne {
2145
2158
  n(this, "_operator");
2146
2159
  n(this, "_label");
2147
2160
  n(this, "_stacked");
2148
- this._operator = i, this._label = r, this._stacked = a;
2161
+ this._operator = s, this._label = r, this._stacked = a;
2149
2162
  }
2150
2163
  get operator() {
2151
2164
  return this._operator;
@@ -2162,24 +2175,24 @@ class nt extends ne {
2162
2175
  super({ name: t, axis: "x" });
2163
2176
  }
2164
2177
  }
2165
- const rt = ({ ooui: s }) => {
2166
- const e = [s.x.name];
2167
- return s.y ? (s.y.forEach((i) => {
2168
- i.operator !== "count" && !e.includes(i.name) && e.push(i.name), i.label && !e.includes(i.label) && e.push(i.label);
2178
+ const rt = ({ ooui: i }) => {
2179
+ const e = [i.x.name];
2180
+ return i.y ? (i.y.forEach((s) => {
2181
+ s.operator !== "count" && !e.includes(s.name) && e.push(s.name), s.label && !e.includes(s.label) && e.push(s.label);
2169
2182
  }), e) : [];
2170
2183
  };
2171
2184
  function $({
2172
- fields: s,
2185
+ fields: i,
2173
2186
  values: t,
2174
2187
  fieldName: e
2175
2188
  }) {
2176
- const i = s[e], r = t[e];
2177
- if (!i)
2189
+ const s = i[e], r = t[e];
2190
+ if (!s)
2178
2191
  throw new Error(`Field ${e} not found`);
2179
- if (i.type === "many2one")
2192
+ if (s.type === "many2one")
2180
2193
  return r ? { value: r[0], label: r[1] } : { value: !1, label: void 0 };
2181
- if (i.type === "selection") {
2182
- const l = i.selection.find((o) => o[0] === r);
2194
+ if (s.type === "selection") {
2195
+ const l = s.selection.find((o) => o[0] === r);
2183
2196
  return l ? { value: r, label: l[1] } : { value: !1, label: void 0 };
2184
2197
  }
2185
2198
  return { value: r, label: r };
@@ -2190,35 +2203,35 @@ const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2190
2203
  getValueAndLabelForField: $
2191
2204
  }, Symbol.toStringTag, { value: "Module" }));
2192
2205
  function at({
2193
- values: s,
2206
+ values: i,
2194
2207
  timerange: t,
2195
2208
  interval: e = 1
2196
2209
  }) {
2197
- const i = ct({
2198
- values: s,
2210
+ const s = ct({
2211
+ values: i,
2199
2212
  timerange: t
2200
2213
  });
2201
2214
  return lt({
2202
- values: i,
2215
+ values: s,
2203
2216
  timerange: t,
2204
2217
  interval: e
2205
2218
  });
2206
2219
  }
2207
2220
  function lt({
2208
- values: s,
2221
+ values: i,
2209
2222
  timerange: t,
2210
2223
  interval: e = 1
2211
2224
  }) {
2212
- let i = [];
2225
+ let s = [];
2213
2226
  const r = ae({
2214
- values: s,
2227
+ values: i,
2215
2228
  groupBy: "type-stacked"
2216
2229
  }), a = `${t}s`;
2217
2230
  return Object.keys(r).forEach((o) => {
2218
2231
  const u = r[o];
2219
2232
  for (let _ = 0; _ < u.length; _++) {
2220
2233
  const h = u[_];
2221
- if (i.push(h), _ === u.length - 1)
2234
+ if (s.push(h), _ === u.length - 1)
2222
2235
  return;
2223
2236
  const d = h.x, c = u[_ + 1].x;
2224
2237
  if (!re([d, c], a)) {
@@ -2227,7 +2240,7 @@ function lt({
2227
2240
  timerange: t,
2228
2241
  interval: e
2229
2242
  });
2230
- i = i.concat(
2243
+ s = s.concat(
2231
2244
  f.map((y) => ({
2232
2245
  x: y,
2233
2246
  value: 0,
@@ -2237,17 +2250,17 @@ function lt({
2237
2250
  );
2238
2251
  }
2239
2252
  }
2240
- }), i.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
2253
+ }), s.sort((o, u) => o.x < u.x ? -1 : o.x > u.x ? 1 : 0);
2241
2254
  }
2242
2255
  function ot({
2243
- dates: s,
2256
+ dates: i,
2244
2257
  timerange: t,
2245
2258
  interval: e = 1
2246
2259
  }) {
2247
- const i = [], r = `${t}s`;
2248
- if (s.length === 1)
2249
- return s;
2250
- const a = s.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2260
+ const s = [], r = `${t}s`;
2261
+ if (i.length === 1)
2262
+ return i;
2263
+ const a = i.sort((l, o) => l < o ? -1 : l > o ? 1 : 0);
2251
2264
  for (let l = 0; l < a.length - 1; l++) {
2252
2265
  const o = a[l], u = a[l + 1];
2253
2266
  if (!re([o, u], r)) {
@@ -2256,19 +2269,19 @@ function ot({
2256
2269
  r
2257
2270
  ), h = T(u, z(r));
2258
2271
  for (; _.isBefore(h); )
2259
- i.push(_.format(z(r))), _.add(e, r);
2272
+ s.push(_.format(z(r))), _.add(e, r);
2260
2273
  }
2261
2274
  }
2262
- return i;
2275
+ return s;
2263
2276
  }
2264
2277
  function ct({
2265
- values: s,
2278
+ values: i,
2266
2279
  timerange: t
2267
2280
  }) {
2268
2281
  const e = dt({
2269
- values: s,
2282
+ values: i,
2270
2283
  timerange: t
2271
- }), i = [], r = ae({
2284
+ }), s = [], r = ae({
2272
2285
  values: e,
2273
2286
  groupBy: "all"
2274
2287
  });
@@ -2277,17 +2290,17 @@ function ct({
2277
2290
  values: l.map((_) => _.value),
2278
2291
  operator: o
2279
2292
  });
2280
- i.push({
2293
+ s.push({
2281
2294
  ...l[0],
2282
2295
  value: u
2283
2296
  });
2284
- }), i;
2297
+ }), s;
2285
2298
  }
2286
2299
  function dt({
2287
- values: s,
2300
+ values: i,
2288
2301
  timerange: t
2289
2302
  }) {
2290
- return s.map((e) => ({
2303
+ return i.map((e) => ({
2291
2304
  ...e,
2292
2305
  x: ut({
2293
2306
  date: e.x,
@@ -2296,11 +2309,11 @@ function dt({
2296
2309
  }));
2297
2310
  }
2298
2311
  function ut({
2299
- date: s,
2312
+ date: i,
2300
2313
  timerange: t
2301
2314
  }) {
2302
- let e = ht(s);
2303
- const i = T(s, e);
2315
+ let e = ht(i);
2316
+ const s = T(i, e);
2304
2317
  switch (t) {
2305
2318
  case "hour": {
2306
2319
  e = "YYYY-MM-DD HH:00";
@@ -2323,36 +2336,36 @@ function ut({
2323
2336
  break;
2324
2337
  }
2325
2338
  }
2326
- return i.format(e);
2339
+ return s.format(e);
2327
2340
  }
2328
- function ht(s) {
2329
- return s.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2341
+ function ht(i) {
2342
+ return i.indexOf(":") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
2330
2343
  }
2331
- function re(s, t) {
2344
+ function re(i, t) {
2332
2345
  let e = !1;
2333
- const i = z(t);
2334
- if (s.length === 0)
2346
+ const s = z(t);
2347
+ if (i.length === 0)
2335
2348
  return !1;
2336
- if (s.length === 1)
2349
+ if (i.length === 1)
2337
2350
  return !0;
2338
- for (let r = 0; r < s.length - 1; r++) {
2339
- const a = T(s[r], i), o = T(s[r + 1], i).diff(a, t);
2351
+ for (let r = 0; r < i.length - 1; r++) {
2352
+ const a = T(i[r], s), o = T(i[r + 1], s).diff(a, t);
2340
2353
  Math.abs(o) === 1 ? e = !0 : e = !1;
2341
2354
  }
2342
2355
  return e;
2343
2356
  }
2344
2357
  function ae({
2345
- values: s,
2358
+ values: i,
2346
2359
  groupBy: t
2347
2360
  }) {
2348
2361
  const e = {};
2349
- return s.forEach((i) => {
2350
- const r = i.x, a = i.type, l = i.stacked, o = t === "all" ? `${r}-${a}-${l}` : `${a}-${l}`;
2351
- e[o] || (e[o] = []), e[o].push(i);
2362
+ return i.forEach((s) => {
2363
+ const r = s.x, a = s.type, l = s.stacked, o = t === "all" ? `${r}-${a}-${l}` : `${a}-${l}`;
2364
+ e[o] || (e[o] = []), e[o].push(s);
2352
2365
  }), e;
2353
2366
  }
2354
- function z(s) {
2355
- switch (s) {
2367
+ function z(i) {
2368
+ switch (i) {
2356
2369
  case "days":
2357
2370
  return "YYYY-MM-DD";
2358
2371
  case "weeks":
@@ -2375,17 +2388,17 @@ const _t = {
2375
2388
  min: "min",
2376
2389
  max: "max"
2377
2390
  }, ft = ({
2378
- ooui: s,
2391
+ ooui: i,
2379
2392
  values: t,
2380
2393
  fields: e,
2381
- options: i
2394
+ options: s
2382
2395
  }) => {
2383
2396
  const r = N({
2384
- fieldName: s.x.name,
2397
+ fieldName: i.x.name,
2385
2398
  values: t,
2386
2399
  fields: e
2387
2400
  }), a = [];
2388
- s.y.forEach((c) => {
2401
+ i.y.forEach((c) => {
2389
2402
  Object.keys(r).forEach((f) => {
2390
2403
  const y = r[f].label, x = r[f].entries;
2391
2404
  if (c.label) {
@@ -2395,12 +2408,12 @@ const _t = {
2395
2408
  fields: e
2396
2409
  });
2397
2410
  Object.keys(m).forEach((v) => {
2398
- const P = m[v].entries, p = m[v].label, S = A({
2411
+ const P = m[v].entries, p = m[v].label, W = A({
2399
2412
  entries: P,
2400
2413
  fields: e,
2401
2414
  fieldName: c.name
2402
2415
  }), oe = V({
2403
- values: S,
2416
+ values: W,
2404
2417
  operator: c.operator
2405
2418
  });
2406
2419
  a.push({
@@ -2433,63 +2446,63 @@ const _t = {
2433
2446
  }
2434
2447
  });
2435
2448
  });
2436
- const l = s.y.some((c) => c.label !== void 0), o = s.y.some((c) => c.stacked !== void 0);
2449
+ const l = i.y.some((c) => c.label !== void 0), o = i.y.some((c) => c.stacked !== void 0);
2437
2450
  let _ = [...a.sort((c, f) => c.x < f.x ? -1 : c.x > f.x ? 1 : 0)];
2438
- o && s.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
2451
+ o && i.y.filter((c) => c.stacked !== void 0).length > 1 && (_ = _.map((c) => ({ ...c, type: `${c.type} - ${c.stacked}` })));
2439
2452
  let h = [..._];
2440
- s.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (i == null ? void 0 : i.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
2453
+ i.type === "pie" && h.some((c) => c.x === !1) ? h = h.map((c) => c.x === !1 ? { ...c, x: (s == null ? void 0 : s.uninformedString) || "Not informed" } : c) : _.some((c) => c.x === !1) && (h = h.filter(
2441
2454
  (c) => c.x !== !1
2442
2455
  ));
2443
2456
  let d = h;
2444
- return s.timerange ? d = at({
2457
+ return i.timerange ? d = at({
2445
2458
  values: d,
2446
- timerange: s.timerange,
2447
- interval: s.interval
2448
- }) : s.type == "pie" && (d = h.sort((c, f) => f.value - c.value)), {
2459
+ timerange: i.timerange,
2460
+ interval: i.interval
2461
+ }) : i.type == "pie" && (d = h.sort((c, f) => f.value - c.value)), {
2449
2462
  data: d,
2450
2463
  isGroup: o || l,
2451
2464
  isStack: o
2452
2465
  };
2453
2466
  };
2454
2467
  function A({
2455
- entries: s,
2468
+ entries: i,
2456
2469
  fieldName: t,
2457
2470
  fields: e
2458
2471
  }) {
2459
- return s.map((i) => $({
2472
+ return i.map((s) => $({
2460
2473
  fieldName: t,
2461
- values: i,
2474
+ values: s,
2462
2475
  fields: e
2463
- })).map(({ value: i, label: r }) => r);
2476
+ })).map(({ value: s, label: r }) => r);
2464
2477
  }
2465
2478
  function V({
2466
- operator: s,
2479
+ operator: i,
2467
2480
  values: t
2468
2481
  }) {
2469
- switch (s) {
2482
+ switch (i) {
2470
2483
  case "count":
2471
2484
  return t.length;
2472
2485
  case "+":
2473
- return W(
2474
- t.reduce(function(e, i) {
2475
- return e + i;
2486
+ return S(
2487
+ t.reduce(function(e, s) {
2488
+ return e + s;
2476
2489
  })
2477
2490
  );
2478
2491
  case "-":
2479
- return W(
2480
- t.reduce(function(e, i) {
2481
- return e - i;
2492
+ return S(
2493
+ t.reduce(function(e, s) {
2494
+ return e - s;
2482
2495
  })
2483
2496
  );
2484
2497
  case "*":
2485
- return W(
2486
- t.reduce(function(e, i) {
2487
- return e * i;
2498
+ return S(
2499
+ t.reduce(function(e, s) {
2500
+ return e * s;
2488
2501
  })
2489
2502
  );
2490
2503
  case "avg": {
2491
- const i = t.reduce((r, a) => r + a, 0) / t.length || 0;
2492
- return W(i);
2504
+ const s = t.reduce((r, a) => r + a, 0) / t.length || 0;
2505
+ return S(s);
2493
2506
  }
2494
2507
  case "min":
2495
2508
  return Math.min(...t);
@@ -2497,37 +2510,37 @@ function V({
2497
2510
  return Math.max(...t);
2498
2511
  }
2499
2512
  }
2500
- function W(s) {
2501
- return Math.round((s + Number.EPSILON) * 100) / 100;
2513
+ function S(i) {
2514
+ return Math.round((i + Number.EPSILON) * 100) / 100;
2502
2515
  }
2503
2516
  function N({
2504
- fieldName: s,
2517
+ fieldName: i,
2505
2518
  fields: t,
2506
2519
  values: e
2507
2520
  }) {
2508
- const i = {};
2521
+ const s = {};
2509
2522
  return e.forEach((r) => {
2510
2523
  const { value: a, label: l } = $({
2511
2524
  fields: t,
2512
2525
  values: r,
2513
- fieldName: s
2526
+ fieldName: i
2514
2527
  });
2515
- i[a] || (i[a] = { label: l, entries: [] }), i[a].entries.push(r);
2516
- }), i;
2528
+ s[a] || (s[a] = { label: l, entries: [] }), s[a].entries.push(r);
2529
+ }), s;
2517
2530
  }
2518
- function gt(s) {
2531
+ function gt(i) {
2519
2532
  let t = [];
2520
- return Object.keys(s).forEach((e) => {
2521
- const i = s[e];
2522
- t = t.concat(i.entries);
2533
+ return Object.keys(i).forEach((e) => {
2534
+ const s = i[e];
2535
+ t = t.concat(s.entries);
2523
2536
  }), t;
2524
2537
  }
2525
2538
  function le({
2526
- yAxis: s,
2539
+ yAxis: i,
2527
2540
  fields: t
2528
2541
  }) {
2529
- const e = t[s.name];
2530
- return e != null && e.string ? e.string : s.name;
2542
+ const e = t[i.name];
2543
+ return e != null && e.string ? e.string : i.name;
2531
2544
  }
2532
2545
  const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2533
2546
  __proto__: null,
@@ -2558,20 +2571,20 @@ export {
2558
2571
  L as Float,
2559
2572
  ke as FloatTime,
2560
2573
  wt as Form,
2561
- se as Graph,
2574
+ ie as Graph,
2562
2575
  ne as GraphAxis,
2563
2576
  j as GraphChart,
2564
- ie as GraphIndicator,
2577
+ se as GraphIndicator,
2565
2578
  et as GraphIndicatorField,
2566
2579
  nt as GraphXAxis,
2567
- it as GraphYAxis,
2580
+ st as GraphYAxis,
2568
2581
  pe as Group,
2569
2582
  Oe as HTMLPreview,
2570
2583
  Ve as Image,
2571
2584
  je as Indicator,
2572
2585
  Ce as Integer,
2573
2586
  H as Label,
2574
- Se as Many2many,
2587
+ We as Many2many,
2575
2588
  ve as Many2one,
2576
2589
  Fe as Markdown,
2577
2590
  K as MultiCheckbox,
@@ -2585,7 +2598,7 @@ export {
2585
2598
  Ue as SearchFieldTypes,
2586
2599
  Ft as SearchFilter,
2587
2600
  E as Selection,
2588
- We as Separator,
2601
+ Se as Separator,
2589
2602
  Le as Steps,
2590
2603
  Be as Switch,
2591
2604
  Ae as Tag,