dara-core 1.19.0__py3-none-any.whl → 1.20.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. dara/core/__init__.py +1 -0
  2. dara/core/auth/basic.py +13 -7
  3. dara/core/auth/definitions.py +2 -2
  4. dara/core/auth/utils.py +1 -1
  5. dara/core/base_definitions.py +7 -42
  6. dara/core/data_utils.py +16 -17
  7. dara/core/definitions.py +8 -8
  8. dara/core/interactivity/__init__.py +6 -0
  9. dara/core/interactivity/actions.py +26 -22
  10. dara/core/interactivity/any_data_variable.py +7 -135
  11. dara/core/interactivity/any_variable.py +1 -1
  12. dara/core/interactivity/client_variable.py +71 -0
  13. dara/core/interactivity/data_variable.py +8 -266
  14. dara/core/interactivity/derived_data_variable.py +6 -290
  15. dara/core/interactivity/derived_variable.py +379 -199
  16. dara/core/interactivity/filtering.py +29 -2
  17. dara/core/interactivity/loop_variable.py +2 -2
  18. dara/core/interactivity/non_data_variable.py +5 -68
  19. dara/core/interactivity/plain_variable.py +87 -14
  20. dara/core/interactivity/server_variable.py +325 -0
  21. dara/core/interactivity/state_variable.py +69 -0
  22. dara/core/interactivity/switch_variable.py +15 -15
  23. dara/core/interactivity/tabular_variable.py +94 -0
  24. dara/core/interactivity/url_variable.py +10 -90
  25. dara/core/internal/cache_store/cache_store.py +5 -20
  26. dara/core/internal/dependency_resolution.py +27 -69
  27. dara/core/internal/devtools.py +10 -3
  28. dara/core/internal/execute_action.py +9 -3
  29. dara/core/internal/multi_resource_lock.py +70 -0
  30. dara/core/internal/normalization.py +0 -5
  31. dara/core/internal/pandas_utils.py +105 -3
  32. dara/core/internal/pool/definitions.py +1 -1
  33. dara/core/internal/pool/task_pool.py +9 -6
  34. dara/core/internal/pool/utils.py +19 -14
  35. dara/core/internal/registries.py +3 -2
  36. dara/core/internal/registry.py +1 -1
  37. dara/core/internal/registry_lookup.py +5 -3
  38. dara/core/internal/routing.py +52 -121
  39. dara/core/internal/store.py +2 -29
  40. dara/core/internal/tasks.py +372 -182
  41. dara/core/internal/utils.py +25 -3
  42. dara/core/internal/websocket.py +1 -1
  43. dara/core/js_tooling/js_utils.py +2 -0
  44. dara/core/logging.py +10 -6
  45. dara/core/persistence.py +26 -4
  46. dara/core/umd/dara.core.umd.js +1082 -1464
  47. dara/core/visual/dynamic_component.py +17 -13
  48. {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/METADATA +11 -11
  49. {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/RECORD +52 -47
  50. {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/LICENSE +0 -0
  51. {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/WHEEL +0 -0
  52. {dara_core-1.19.0.dist-info → dara_core-1.20.0a1.dist-info}/entry_points.txt +0 -0
@@ -1292,7 +1292,7 @@
1292
1292
  if (null == r2) return {};
1293
1293
  var t2 = {};
1294
1294
  for (var n2 in r2) if ({}.hasOwnProperty.call(r2, n2)) {
1295
- if (e2.includes(n2)) continue;
1295
+ if (-1 !== e2.indexOf(n2)) continue;
1296
1296
  t2[n2] = r2[n2];
1297
1297
  }
1298
1298
  return t2;
@@ -1830,7 +1830,7 @@
1830
1830
  invariant$1();
1831
1831
  };
1832
1832
  }
1833
- function noop$4() {
1833
+ function noop$5() {
1834
1834
  }
1835
1835
  var StaticRouter = /* @__PURE__ */ function(_React$Component) {
1836
1836
  _inheritsLoose$1(StaticRouter2, _React$Component);
@@ -1847,10 +1847,10 @@
1847
1847
  return _this.navigateTo(location2, "REPLACE");
1848
1848
  };
1849
1849
  _this.handleListen = function() {
1850
- return noop$4;
1850
+ return noop$5;
1851
1851
  };
1852
1852
  _this.handleBlock = function() {
1853
- return noop$4;
1853
+ return noop$5;
1854
1854
  };
1855
1855
  return _this;
1856
1856
  }
@@ -2761,7 +2761,7 @@
2761
2761
  };
2762
2762
  var LEAF = 1;
2763
2763
  var COLLISION = 2;
2764
- var INDEX = 3;
2764
+ var INDEX2 = 3;
2765
2765
  var ARRAY = 4;
2766
2766
  var empty = {
2767
2767
  __hamt_isEmpty: true
@@ -2790,7 +2790,7 @@
2790
2790
  };
2791
2791
  var IndexedNode = function IndexedNode2(edit, mask, children) {
2792
2792
  return {
2793
- type: INDEX,
2793
+ type: INDEX2,
2794
2794
  edit,
2795
2795
  mask,
2796
2796
  children,
@@ -2993,7 +2993,7 @@
2993
2993
  }
2994
2994
  return alt;
2995
2995
  }
2996
- case INDEX: {
2996
+ case INDEX2: {
2997
2997
  var frag = hashFragment(shift2, hash22);
2998
2998
  var bit = toBitmap(frag);
2999
2999
  if (node.mask & bit) {
@@ -3146,7 +3146,7 @@
3146
3146
  };
3147
3147
  case COLLISION:
3148
3148
  case ARRAY:
3149
- case INDEX:
3149
+ case INDEX2:
3150
3150
  var children = node.children;
3151
3151
  return lazyVisitChildren(children.length, children, 0, f, k);
3152
3152
  default:
@@ -12446,14 +12446,14 @@
12446
12446
  function _nonIterableRest$2() {
12447
12447
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
12448
12448
  }
12449
- var noop$3 = function noop2() {
12449
+ var noop$4 = function noop2() {
12450
12450
  };
12451
12451
  var _WINDOW = {};
12452
12452
  var _DOCUMENT = {};
12453
12453
  var _MUTATION_OBSERVER = null;
12454
12454
  var _PERFORMANCE = {
12455
- mark: noop$3,
12456
- measure: noop$3
12455
+ mark: noop$4,
12456
+ measure: noop$4
12457
12457
  };
12458
12458
  try {
12459
12459
  if (typeof window !== "undefined") _WINDOW = window;
@@ -15789,7 +15789,7 @@
15789
15789
  }
15790
15790
  });
15791
15791
  }
15792
- function noop$2() {
15792
+ function noop$3() {
15793
15793
  }
15794
15794
  function errorContext(cb) {
15795
15795
  {
@@ -15929,9 +15929,9 @@
15929
15929
  }
15930
15930
  var EMPTY_OBSERVER = {
15931
15931
  closed: true,
15932
- next: noop$2,
15932
+ next: noop$3,
15933
15933
  error: defaultErrorHandler,
15934
- complete: noop$2
15934
+ complete: noop$3
15935
15935
  };
15936
15936
  var observable = function() {
15937
15937
  return typeof Symbol === "function" && Symbol.observable || "@@observable";
@@ -19574,6 +19574,7 @@
19574
19574
  }
19575
19575
  return value instanceof ShadowRoot || value instanceof getWindow$1(value).ShadowRoot;
19576
19576
  }
19577
+ const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
19577
19578
  function isOverflowElement(element) {
19578
19579
  const {
19579
19580
  overflow,
@@ -19581,24 +19582,29 @@
19581
19582
  overflowY,
19582
19583
  display
19583
19584
  } = getComputedStyle$2(element);
19584
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
19585
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
19585
19586
  }
19587
+ const tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
19586
19588
  function isTableElement$1(element) {
19587
- return ["table", "td", "th"].includes(getNodeName$1(element));
19589
+ return tableElements.has(getNodeName$1(element));
19588
19590
  }
19591
+ const topLayerSelectors = [":popover-open", ":modal"];
19589
19592
  function isTopLayer(element) {
19590
- return [":popover-open", ":modal"].some((selector2) => {
19593
+ return topLayerSelectors.some((selector2) => {
19591
19594
  try {
19592
19595
  return element.matches(selector2);
19593
- } catch (e2) {
19596
+ } catch (_e2) {
19594
19597
  return false;
19595
19598
  }
19596
19599
  });
19597
19600
  }
19601
+ const transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
19602
+ const willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
19603
+ const containValues = ["paint", "layout", "strict", "content"];
19598
19604
  function isContainingBlock(elementOrCss) {
19599
19605
  const webkit = isWebKit();
19600
19606
  const css2 = isElement$1(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
19601
- return css2.transform !== "none" || css2.perspective !== "none" || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
19607
+ return transformProperties.some((value) => css2[value] ? css2[value] !== "none" : false) || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit && (css2.filter ? css2.filter !== "none" : false) || willChangeValues.some((value) => (css2.willChange || "").includes(value)) || containValues.some((value) => (css2.contain || "").includes(value));
19602
19608
  }
19603
19609
  function getContainingBlock$1(element) {
19604
19610
  let currentNode = getParentNode$1(element);
@@ -19616,8 +19622,9 @@
19616
19622
  if (typeof CSS === "undefined" || !CSS.supports) return false;
19617
19623
  return CSS.supports("-webkit-backdrop-filter", "none");
19618
19624
  }
19625
+ const lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
19619
19626
  function isLastTraversableNode(node) {
19620
- return ["html", "body", "#document"].includes(getNodeName$1(node));
19627
+ return lastTraversableNodeNames.has(getNodeName$1(node));
19621
19628
  }
19622
19629
  function getComputedStyle$2(element) {
19623
19630
  return getWindow$1(element).getComputedStyle(element);
@@ -19817,8 +19824,9 @@
19817
19824
  function getAxisLength(axis) {
19818
19825
  return axis === "y" ? "height" : "width";
19819
19826
  }
19827
+ const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
19820
19828
  function getSideAxis(placement) {
19821
- return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
19829
+ return yAxisSides.has(getSide(placement)) ? "y" : "x";
19822
19830
  }
19823
19831
  function getAlignmentAxis(placement) {
19824
19832
  return getOppositeAxis(getSideAxis(placement));
@@ -19843,19 +19851,19 @@
19843
19851
  function getOppositeAlignmentPlacement(placement) {
19844
19852
  return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
19845
19853
  }
19854
+ const lrPlacement = ["left", "right"];
19855
+ const rlPlacement = ["right", "left"];
19856
+ const tbPlacement = ["top", "bottom"];
19857
+ const btPlacement = ["bottom", "top"];
19846
19858
  function getSideList(side, isStart, rtl) {
19847
- const lr = ["left", "right"];
19848
- const rl = ["right", "left"];
19849
- const tb = ["top", "bottom"];
19850
- const bt2 = ["bottom", "top"];
19851
19859
  switch (side) {
19852
19860
  case "top":
19853
19861
  case "bottom":
19854
- if (rtl) return isStart ? rl : lr;
19855
- return isStart ? lr : rl;
19862
+ if (rtl) return isStart ? rlPlacement : lrPlacement;
19863
+ return isStart ? lrPlacement : rlPlacement;
19856
19864
  case "left":
19857
19865
  case "right":
19858
- return isStart ? tb : bt2;
19866
+ return isStart ? tbPlacement : btPlacement;
19859
19867
  default:
19860
19868
  return [];
19861
19869
  }
@@ -20617,15 +20625,20 @@
20617
20625
  const nextIndex2 = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
20618
20626
  const nextPlacement = placements2[nextIndex2];
20619
20627
  if (nextPlacement) {
20620
- return {
20621
- data: {
20622
- index: nextIndex2,
20623
- overflows: overflowsData
20624
- },
20625
- reset: {
20626
- placement: nextPlacement
20627
- }
20628
- };
20628
+ const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
20629
+ if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
20630
+ // overflows the main axis.
20631
+ overflowsData.every((d2) => d2.overflows[0] > 0 && getSideAxis(d2.placement) === initialSideAxis)) {
20632
+ return {
20633
+ data: {
20634
+ index: nextIndex2,
20635
+ overflows: overflowsData
20636
+ },
20637
+ reset: {
20638
+ placement: nextPlacement
20639
+ }
20640
+ };
20641
+ }
20629
20642
  }
20630
20643
  let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
20631
20644
  if (!resetPlacement) {
@@ -20663,6 +20676,7 @@
20663
20676
  }
20664
20677
  };
20665
20678
  };
20679
+ const originSides = /* @__PURE__ */ new Set(["left", "top"]);
20666
20680
  async function convertValueToCoords(state, options) {
20667
20681
  const {
20668
20682
  placement,
@@ -20673,7 +20687,7 @@
20673
20687
  const side = getSide(placement);
20674
20688
  const alignment = getAlignment(placement);
20675
20689
  const isVertical = getSideAxis(placement) === "y";
20676
- const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
20690
+ const mainAxisMulti = originSides.has(side) ? -1 : 1;
20677
20691
  const crossAxisMulti = rtl && isVertical ? -1 : 1;
20678
20692
  const rawValue = evaluate(options, state);
20679
20693
  let {
@@ -21103,6 +21117,7 @@
21103
21117
  y
21104
21118
  };
21105
21119
  }
21120
+ const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
21106
21121
  function getInnerBoundingClientRect$1(element, strategy) {
21107
21122
  const clientRect = getBoundingClientRect$1(element, true, strategy === "fixed");
21108
21123
  const top2 = clientRect.top + element.clientTop;
@@ -21160,7 +21175,7 @@
21160
21175
  if (!currentNodeIsContaining && computedStyle.position === "fixed") {
21161
21176
  currentContainingBlockComputedStyle = null;
21162
21177
  }
21163
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
21178
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
21164
21179
  if (shouldDropCurrentNode) {
21165
21180
  result = result.filter((ancestor) => ancestor !== currentNode);
21166
21181
  } else {
@@ -21216,6 +21231,9 @@
21216
21231
  scrollTop: 0
21217
21232
  };
21218
21233
  const offsets = createCoords(0);
21234
+ function setLeftRTLScrollbarOffset() {
21235
+ offsets.x = getWindowScrollBarX$1(documentElement);
21236
+ }
21219
21237
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
21220
21238
  if (getNodeName$1(offsetParent) !== "body" || isOverflowElement(documentElement)) {
21221
21239
  scroll = getNodeScroll$1(offsetParent);
@@ -21225,9 +21243,12 @@
21225
21243
  offsets.x = offsetRect.x + offsetParent.clientLeft;
21226
21244
  offsets.y = offsetRect.y + offsetParent.clientTop;
21227
21245
  } else if (documentElement) {
21228
- offsets.x = getWindowScrollBarX$1(documentElement);
21246
+ setLeftRTLScrollbarOffset();
21229
21247
  }
21230
21248
  }
21249
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
21250
+ setLeftRTLScrollbarOffset();
21251
+ }
21231
21252
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
21232
21253
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
21233
21254
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -21307,6 +21328,9 @@
21307
21328
  isElement: isElement$1,
21308
21329
  isRTL
21309
21330
  };
21331
+ function rectsAreEqual(a2, b2) {
21332
+ return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
21333
+ }
21310
21334
  function observeMove(element, onMove) {
21311
21335
  let io = null;
21312
21336
  let timeoutId2;
@@ -21325,12 +21349,13 @@
21325
21349
  threshold = 1;
21326
21350
  }
21327
21351
  cleanup();
21352
+ const elementRectForRootMargin = element.getBoundingClientRect();
21328
21353
  const {
21329
21354
  left: left2,
21330
21355
  top: top2,
21331
21356
  width,
21332
21357
  height
21333
- } = element.getBoundingClientRect();
21358
+ } = elementRectForRootMargin;
21334
21359
  if (!skip) {
21335
21360
  onMove();
21336
21361
  }
@@ -21361,6 +21386,9 @@
21361
21386
  refresh(false, ratio);
21362
21387
  }
21363
21388
  }
21389
+ if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
21390
+ refresh();
21391
+ }
21364
21392
  isFirstUpdate = false;
21365
21393
  }
21366
21394
  try {
@@ -21369,7 +21397,7 @@
21369
21397
  // Handle <iframe>s
21370
21398
  root: root.ownerDocument
21371
21399
  });
21372
- } catch (e2) {
21400
+ } catch (_e2) {
21373
21401
  io = new IntersectionObserver(handleObserve, options);
21374
21402
  }
21375
21403
  io.observe(element);
@@ -21424,7 +21452,7 @@
21424
21452
  }
21425
21453
  function frameLoop() {
21426
21454
  const nextRefRect = getBoundingClientRect$1(reference2);
21427
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
21455
+ if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
21428
21456
  update();
21429
21457
  }
21430
21458
  prevRefRect = nextRefRect;
@@ -21466,7 +21494,10 @@
21466
21494
  platform: platformWithCache
21467
21495
  });
21468
21496
  };
21469
- var index$2 = typeof document !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
21497
+ var isClient = typeof document !== "undefined";
21498
+ var noop$2 = function noop2() {
21499
+ };
21500
+ var index$2 = isClient ? React$1.useLayoutEffect : noop$2;
21470
21501
  function deepEqual(a2, b2) {
21471
21502
  if (a2 === b2) {
21472
21503
  return true;
@@ -22045,11 +22076,11 @@
22045
22076
  performedPointerEventsMutationRef.current = false;
22046
22077
  }
22047
22078
  });
22079
+ const isClickLikeOpenEvent = useEffectEvent(() => {
22080
+ return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false;
22081
+ });
22048
22082
  React__namespace.useEffect(() => {
22049
22083
  if (!enabled) return;
22050
- function isClickLikeOpenEvent() {
22051
- return dataRef.current.openEvent ? ["click", "mousedown"].includes(dataRef.current.openEvent.type) : false;
22052
- }
22053
22084
  function onMouseEnter(event) {
22054
22085
  clearTimeout(timeoutRef.current);
22055
22086
  blockMouseMoveRef.current = false;
@@ -22063,7 +22094,7 @@
22063
22094
  onOpenChange(true, event, "hover");
22064
22095
  }
22065
22096
  }, openDelay);
22066
- } else {
22097
+ } else if (!open2) {
22067
22098
  onOpenChange(true, event, "hover");
22068
22099
  }
22069
22100
  }
@@ -22085,7 +22116,9 @@
22085
22116
  onClose() {
22086
22117
  clearPointerEvents();
22087
22118
  cleanupMouseMoveHandler();
22088
- closeWithDelay(event, true, "safe-polygon");
22119
+ if (!isClickLikeOpenEvent()) {
22120
+ closeWithDelay(event, true, "safe-polygon");
22121
+ }
22089
22122
  }
22090
22123
  });
22091
22124
  const handler = handlerRef.current;
@@ -22111,7 +22144,9 @@
22111
22144
  onClose() {
22112
22145
  clearPointerEvents();
22113
22146
  cleanupMouseMoveHandler();
22114
- closeWithDelay(event);
22147
+ if (!isClickLikeOpenEvent()) {
22148
+ closeWithDelay(event);
22149
+ }
22115
22150
  }
22116
22151
  })(event);
22117
22152
  }
@@ -22134,7 +22169,7 @@
22134
22169
  ref.removeEventListener("mouseleave", onMouseLeave);
22135
22170
  };
22136
22171
  }
22137
- }, [elements, enabled, context2, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open2, openRef, tree, delayRef, handleCloseRef, dataRef]);
22172
+ }, [elements, enabled, context2, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open2, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent]);
22138
22173
  index$1(() => {
22139
22174
  var _handleCloseRef$curre;
22140
22175
  if (!enabled) return;
@@ -22217,9 +22252,11 @@
22217
22252
  clearTimeout(timeoutRef.current);
22218
22253
  },
22219
22254
  onMouseLeave(event) {
22220
- closeWithDelay(event.nativeEvent, false);
22255
+ if (!isClickLikeOpenEvent()) {
22256
+ closeWithDelay(event.nativeEvent, false);
22257
+ }
22221
22258
  }
22222
- }), [closeWithDelay]);
22259
+ }), [closeWithDelay, isClickLikeOpenEvent]);
22223
22260
  return React__namespace.useMemo(() => enabled ? {
22224
22261
  reference: reference2,
22225
22262
  floating
@@ -22503,7 +22540,8 @@
22503
22540
  event: eventOption = "click",
22504
22541
  toggle = true,
22505
22542
  ignoreMouse = false,
22506
- keyboardHandlers = true
22543
+ keyboardHandlers = true,
22544
+ stickIfOpen = true
22507
22545
  } = props;
22508
22546
  const pointerTypeRef = React__namespace.useRef();
22509
22547
  const didKeyDownRef = React__namespace.useRef(false);
@@ -22516,7 +22554,7 @@
22516
22554
  if (event.button !== 0) return;
22517
22555
  if (eventOption === "click") return;
22518
22556
  if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
22519
- if (open2 && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === "mousedown" : true)) {
22557
+ if (open2 && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === "mousedown" : true)) {
22520
22558
  onOpenChange(false, event.nativeEvent, "click");
22521
22559
  } else {
22522
22560
  event.preventDefault();
@@ -22530,7 +22568,7 @@
22530
22568
  return;
22531
22569
  }
22532
22570
  if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
22533
- if (open2 && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === "click" : true)) {
22571
+ if (open2 && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === "click" : true)) {
22534
22572
  onOpenChange(false, event.nativeEvent, "click");
22535
22573
  } else {
22536
22574
  onOpenChange(true, event.nativeEvent, "click");
@@ -22566,7 +22604,7 @@
22566
22604
  }
22567
22605
  }
22568
22606
  }
22569
- }), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open2, toggle]);
22607
+ }), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open2, stickIfOpen, toggle]);
22570
22608
  return React__namespace.useMemo(() => enabled ? {
22571
22609
  reference: reference2
22572
22610
  } : {}, [enabled, reference2]);
@@ -23906,6 +23944,10 @@
23906
23944
 
23907
23945
  border: none;
23908
23946
  border-radius: 0.25rem;
23947
+
23948
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
23949
+ transition-duration: 150ms;
23950
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
23909
23951
  `;
23910
23952
  function getOutlinedButtonStyle(buttonColor, disabled2, theme2) {
23911
23953
  return `
@@ -32390,6 +32432,112 @@
32390
32432
  cursor: not-allowed;
32391
32433
  color: ${(props) => props.theme.colors.grey2};
32392
32434
  }
32435
+ `;
32436
+ styled.div`
32437
+ overflow: hidden;
32438
+ display: flex;
32439
+ flex-direction: column;
32440
+
32441
+ background-color: ${(props) => props.theme.colors.blue1};
32442
+ border-radius: 4px;
32443
+ outline: none;
32444
+ box-shadow: rgb(0 0 0 / 10%) 0 2px 5px;
32445
+
32446
+ & > button:first-child {
32447
+ border-radius: 4px;
32448
+ }
32449
+
32450
+ &.enter {
32451
+ transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
32452
+ transition-duration: 100ms;
32453
+ transition-property: opacity, transform;
32454
+ }
32455
+
32456
+ &.enter-from {
32457
+ transform: scale(0.95);
32458
+ opacity: 0;
32459
+ }
32460
+
32461
+ &.enter-to {
32462
+ transform: scale(1);
32463
+ opacity: 1;
32464
+ }
32465
+
32466
+ &.leave {
32467
+ transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
32468
+ transition-duration: 75ms;
32469
+ transition-property: opacity, transform;
32470
+ }
32471
+
32472
+ &.leave-from {
32473
+ transform: scale(1);
32474
+ opacity: 1;
32475
+ }
32476
+
32477
+ &.leave-to {
32478
+ transform: scale(0.95);
32479
+ opacity: 0;
32480
+ }
32481
+ `;
32482
+ styled.button`
32483
+ cursor: pointer;
32484
+
32485
+ display: flex;
32486
+ gap: 0.25rem;
32487
+ align-items: center;
32488
+ justify-content: space-between;
32489
+
32490
+ width: 100%;
32491
+ min-width: 160px;
32492
+ height: fit-content;
32493
+ padding: 5px 8px;
32494
+
32495
+ font-size: 0.9rem;
32496
+ color: ${(props) => props.theme.colors.text};
32497
+ white-space: nowrap;
32498
+
32499
+ background-color: ${(props) => props.theme.colors.blue1};
32500
+ border: none;
32501
+ border-radius: 4px;
32502
+ box-shadow: none;
32503
+
32504
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
32505
+ transition-duration: 150ms;
32506
+ transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
32507
+
32508
+ &:hover {
32509
+ background-color: ${(props) => props.theme.colors.grey1};
32510
+ }
32511
+
32512
+ &:active {
32513
+ background-color: ${(props) => props.theme.colors.grey2};
32514
+ }
32515
+
32516
+ &:disabled {
32517
+ cursor: not-allowed;
32518
+ color: ${(props) => props.theme.colors.grey3};
32519
+
32520
+ svg {
32521
+ color: ${(props) => props.theme.colors.grey3};
32522
+ }
32523
+ }
32524
+ `;
32525
+ styled.div`
32526
+ padding: 4px;
32527
+ `;
32528
+ styled.hr`
32529
+ width: 100%;
32530
+ margin: 0.25rem 0;
32531
+ border: none;
32532
+ border-top: 1px solid ${(props) => props.theme.colors.grey2};
32533
+ `;
32534
+ styled.div`
32535
+ display: flex;
32536
+ gap: 0.5rem;
32537
+ width: 100%;
32538
+ `;
32539
+ styled.div`
32540
+ color: ${(props) => props.theme.colors.grey3};
32393
32541
  `;
32394
32542
  var locale$1 = {
32395
32543
  localize: localize$1
@@ -37785,7 +37933,7 @@
37785
37933
  effect,
37786
37934
  data: {}
37787
37935
  };
37788
- var hash$2 = {
37936
+ var hash$1 = {
37789
37937
  left: "right",
37790
37938
  right: "left",
37791
37939
  bottom: "top",
@@ -37793,16 +37941,16 @@
37793
37941
  };
37794
37942
  function getOppositePlacement(placement) {
37795
37943
  return placement.replace(/left|right|bottom|top/g, function(matched) {
37796
- return hash$2[matched];
37944
+ return hash$1[matched];
37797
37945
  });
37798
37946
  }
37799
- var hash$1 = {
37947
+ var hash = {
37800
37948
  start: "end",
37801
37949
  end: "start"
37802
37950
  };
37803
37951
  function getOppositeVariationPlacement(placement) {
37804
37952
  return placement.replace(/start|end/g, function(matched) {
37805
- return hash$1[matched];
37953
+ return hash[matched];
37806
37954
  });
37807
37955
  }
37808
37956
  function getWindowScroll(node) {
@@ -43639,9 +43787,11 @@
43639
43787
  requireRound();
43640
43788
  const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React$1.useLayoutEffect : () => {
43641
43789
  };
43790
+ var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
43791
+ const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = React$1["useInsertionEffect"]) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
43642
43792
  function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
43643
43793
  const ref = React$1.useRef(null);
43644
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
43794
+ $8ae05eaa5c114e9c$var$useEarlyEffect(() => {
43645
43795
  ref.current = fn;
43646
43796
  }, [
43647
43797
  fn
@@ -43881,11 +44031,54 @@
43881
44031
  "ping",
43882
44032
  "referrerPolicy"
43883
44033
  ]);
44034
+ const $65484d02dcb7eb3e$var$globalAttrs = /* @__PURE__ */ new Set([
44035
+ "dir",
44036
+ "lang",
44037
+ "hidden",
44038
+ "inert",
44039
+ "translate"
44040
+ ]);
44041
+ const $65484d02dcb7eb3e$var$globalEvents = /* @__PURE__ */ new Set([
44042
+ "onClick",
44043
+ "onAuxClick",
44044
+ "onContextMenu",
44045
+ "onDoubleClick",
44046
+ "onMouseDown",
44047
+ "onMouseEnter",
44048
+ "onMouseLeave",
44049
+ "onMouseMove",
44050
+ "onMouseOut",
44051
+ "onMouseOver",
44052
+ "onMouseUp",
44053
+ "onTouchCancel",
44054
+ "onTouchEnd",
44055
+ "onTouchMove",
44056
+ "onTouchStart",
44057
+ "onPointerDown",
44058
+ "onPointerMove",
44059
+ "onPointerUp",
44060
+ "onPointerCancel",
44061
+ "onPointerEnter",
44062
+ "onPointerLeave",
44063
+ "onPointerOver",
44064
+ "onPointerOut",
44065
+ "onGotPointerCapture",
44066
+ "onLostPointerCapture",
44067
+ "onScroll",
44068
+ "onWheel",
44069
+ "onAnimationStart",
44070
+ "onAnimationEnd",
44071
+ "onAnimationIteration",
44072
+ "onTransitionCancel",
44073
+ "onTransitionEnd",
44074
+ "onTransitionRun",
44075
+ "onTransitionStart"
44076
+ ]);
43884
44077
  const $65484d02dcb7eb3e$var$propRe = /^(data-.*)$/;
43885
44078
  function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
43886
- let { labelable, isLink, propNames } = opts;
44079
+ let { labelable, isLink, global: global2, events = global2, propNames } = opts;
43887
44080
  let filteredProps = {};
43888
- for (const prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
44081
+ for (const prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global2 && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith("Capture") && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
43889
44082
  return filteredProps;
43890
44083
  }
43891
44084
  function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
@@ -43943,7 +44136,8 @@
43943
44136
  function $c87311424ea30a05$var$testUserAgent(re) {
43944
44137
  var _window_navigator_userAgentData;
43945
44138
  if (typeof window === "undefined" || window.navigator == null) return false;
43946
- return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand) => re.test(brand.brand))) || re.test(window.navigator.userAgent);
44139
+ let brands = (_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
44140
+ return Array.isArray(brands) && brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
43947
44141
  }
43948
44142
  function $c87311424ea30a05$var$testPlatform(re) {
43949
44143
  var _window_navigator_userAgentData;
@@ -44133,9 +44327,8 @@
44133
44327
  return event.detail === 0 && !event.pointerType;
44134
44328
  }
44135
44329
  function $99facab73266f662$export$5add1d006293d136(ref, initialValue, onReset) {
44136
- let resetValue = React$1.useRef(initialValue);
44137
44330
  let handleReset2 = $8ae05eaa5c114e9c$export$7f54fc3180508a52(() => {
44138
- if (onReset) onReset(resetValue.current);
44331
+ if (onReset) onReset(initialValue);
44139
44332
  });
44140
44333
  React$1.useEffect(() => {
44141
44334
  var _ref_current;
@@ -44196,9 +44389,14 @@
44196
44389
  }
44197
44390
  function $9446cca9a3875146$export$e1a7b8e69ef6c52f(value, step) {
44198
44391
  let roundedValue = value;
44392
+ let precision = 0;
44199
44393
  let stepString = step.toString();
44200
- let pointIndex = stepString.indexOf(".");
44201
- let precision = pointIndex >= 0 ? stepString.length - pointIndex : 0;
44394
+ let eIndex = stepString.toLowerCase().indexOf("e-");
44395
+ if (eIndex > 0) precision = Math.abs(Math.floor(Math.log10(Math.abs(step)))) + eIndex;
44396
+ else {
44397
+ let pointIndex = stepString.indexOf(".");
44398
+ if (pointIndex >= 0) precision = stepString.length - pointIndex;
44399
+ }
44202
44400
  if (precision > 0) {
44203
44401
  let pow = Math.pow(10, precision);
44204
44402
  roundedValue = Math.round(roundedValue * pow) / pow;
@@ -44785,7 +44983,9 @@
44785
44983
  }
44786
44984
  function $6179b936705e76d3$var$setupGlobalTouchEvents() {
44787
44985
  if (typeof document === "undefined") return;
44788
- if (typeof PointerEvent !== "undefined") document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
44986
+ if ($6179b936705e76d3$var$hoverCount === 0) {
44987
+ if (typeof PointerEvent !== "undefined") document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
44988
+ }
44789
44989
  $6179b936705e76d3$var$hoverCount++;
44790
44990
  return () => {
44791
44991
  $6179b936705e76d3$var$hoverCount--;
@@ -45320,7 +45520,8 @@
45320
45520
  step
45321
45521
  ]);
45322
45522
  let value = React$1.useMemo(() => restrictValues($28f99e3e86e6ec45$var$convertValue(props.value)), [
45323
- props.value
45523
+ props.value,
45524
+ restrictValues
45324
45525
  ]);
45325
45526
  let defaultValue = React$1.useMemo(() => {
45326
45527
  var _convertValue;
@@ -45329,11 +45530,13 @@
45329
45530
  ]);
45330
45531
  }, [
45331
45532
  props.defaultValue,
45332
- minValue
45533
+ minValue,
45534
+ restrictValues
45333
45535
  ]);
45334
45536
  let onChange2 = $28f99e3e86e6ec45$var$createOnChange(props.value, props.defaultValue, props.onChange);
45335
45537
  let onChangeEnd = $28f99e3e86e6ec45$var$createOnChange(props.value, props.defaultValue, props.onChangeEnd);
45336
45538
  const [values, setValuesState] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange2);
45539
+ let [initialValues] = React$1.useState(values);
45337
45540
  const [isDraggings, setDraggingsState] = React$1.useState(new Array(values.length).fill(false));
45338
45541
  const isEditablesRef = React$1.useRef(new Array(values.length).fill(true));
45339
45542
  const [focusedIndex, setFocusedIndex] = React$1.useState(void 0);
@@ -45401,6 +45604,7 @@
45401
45604
  }
45402
45605
  return {
45403
45606
  values,
45607
+ defaultValues: props.defaultValue !== void 0 ? defaultValue : initialValues,
45404
45608
  getThumbValue: (index2) => values[index2],
45405
45609
  setThumbValue: updateValue,
45406
45610
  setThumbPercent,
@@ -45619,7 +45823,7 @@
45619
45823
  };
45620
45824
  }
45621
45825
  function $47b897dc8cdb026b$export$8d15029008292ae(opts, state) {
45622
- let { index: index2 = 0, isRequired, validationState, isInvalid, trackRef, inputRef, orientation = state.orientation, name } = opts;
45826
+ let { index: index2 = 0, isRequired, validationState, isInvalid, trackRef, inputRef, orientation = state.orientation, name, form } = opts;
45623
45827
  let isDisabled = opts.isDisabled || state.isDisabled;
45624
45828
  let isVertical = orientation === "vertical";
45625
45829
  let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
@@ -45738,7 +45942,7 @@
45738
45942
  onDown(e2.changedTouches[0].identifier);
45739
45943
  }
45740
45944
  }) : {};
45741
- $99facab73266f662$export$5add1d006293d136(inputRef, value, (v) => {
45945
+ $99facab73266f662$export$5add1d006293d136(inputRef, state.defaultValues[index2], (v) => {
45742
45946
  state.setThumbValue(index2, v);
45743
45947
  });
45744
45948
  return {
@@ -45750,6 +45954,7 @@
45750
45954
  step: state.step,
45751
45955
  value,
45752
45956
  name,
45957
+ form,
45753
45958
  disabled: isDisabled,
45754
45959
  "aria-orientation": orientation,
45755
45960
  "aria-valuetext": state.getThumbValueLabel(index2),
@@ -45810,7 +46015,9 @@
45810
46015
  },
45811
46016
  defaultClassName: "react-aria-Slider"
45812
46017
  });
45813
- let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
46018
+ let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
46019
+ global: true
46020
+ });
45814
46021
  delete DOMProps.id;
45815
46022
  return /* @__PURE__ */ React$1.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
45816
46023
  values: [
@@ -45838,9 +46045,7 @@
45838
46045
  ]
45839
46046
  ]
45840
46047
  }, /* @__PURE__ */ React$1.createElement("div", {
45841
- ...DOMProps,
45842
- ...groupProps,
45843
- ...renderProps,
46048
+ ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, renderProps, groupProps),
45844
46049
  ref,
45845
46050
  slot: props.slot || void 0,
45846
46051
  "data-orientation": state.orientation,
@@ -45904,7 +46109,9 @@
45904
46109
  isDisabled
45905
46110
  }
45906
46111
  });
45907
- let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
46112
+ let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
46113
+ global: true
46114
+ });
45908
46115
  delete DOMProps.id;
45909
46116
  return /* @__PURE__ */ React$1.createElement("div", {
45910
46117
  ...$3ef42575df84b30b$export$9d1611c77c2fe928(DOMProps, thumbProps, hoverProps),
@@ -56275,14 +56482,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56275
56482
  const maxDisconnectedTime = 1e4;
56276
56483
  const interPingInterval = 5e3;
56277
56484
  const maxAttempts = Math.round(maxDisconnectedTime / interAttemptTimeout);
56485
+ class TaskCancelledError extends Error {
56486
+ constructor(message, task_id) {
56487
+ super(message);
56488
+ this.task_id = task_id;
56489
+ }
56490
+ }
56491
+ class TaskError extends Error {
56492
+ constructor(message, task_id) {
56493
+ super(message);
56494
+ this.task_id = task_id;
56495
+ }
56496
+ }
56278
56497
  function isInitMessage(message) {
56279
56498
  return message.type === "init";
56280
56499
  }
56281
56500
  function isTaskNotification(message) {
56282
56501
  return message.type === "message" && "status" in message.message && "task_id" in message.message;
56283
56502
  }
56284
- function isServerTriggerMessage(message) {
56285
- return message.type === "message" && "data_id" in message.message;
56503
+ function isServerVariableMessage(message) {
56504
+ return message.type === "message" && "__type" in message.message && message.message.__type === "ServerVariable";
56286
56505
  }
56287
56506
  function isServerErrorMessage(message) {
56288
56507
  return message.type === "message" && "error" in message.message;
@@ -56408,6 +56627,12 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56408
56627
  map$2((msg) => msg.message)
56409
56628
  );
56410
56629
  }
56630
+ serverVariableMessages$() {
56631
+ return this.messages$.pipe(
56632
+ filter(isServerVariableMessage),
56633
+ map$2((msg) => msg.message)
56634
+ );
56635
+ }
56411
56636
  /**
56412
56637
  * Get the observable to receive the new channel when the socket reconnects
56413
56638
  */
@@ -56442,17 +56667,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56442
56667
  )
56443
56668
  );
56444
56669
  }
56445
- /**
56446
- * Get the observable to receive server trigger messages for a given data variable
56447
- *
56448
- * @param dataId id of the data variable triggered
56449
- */
56450
- serverTriggers$(dataId) {
56451
- return this.messages$.pipe(
56452
- filter(isServerTriggerMessage),
56453
- filter((msg) => msg.message?.data_id === dataId)
56454
- );
56455
- }
56456
56670
  /**
56457
56671
  * Get the observable to receive server error messages
56458
56672
  */
@@ -56483,21 +56697,21 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56483
56697
  return this.messages$.pipe(filter(isCustomMessage));
56484
56698
  }
56485
56699
  /**
56486
- * Returns a promise that will resolve when the task is completed. If the task is cancelled then this will throw an
56700
+ * Returns a promise that will resolve when the task is completed. If the task is cancelled or errored then this will throw an
56487
56701
  * error to signify that.
56488
56702
  *
56489
56703
  * @param task_id the id of the task to wait for
56490
56704
  */
56491
56705
  waitForTask(task_id) {
56492
56706
  return this.messages$.pipe(
56493
- filter(
56494
- (msg) => isTaskNotification(msg) && msg.message?.task_id === task_id && msg.message.status !== "PROGRESS"
56495
- /* PROGRESS */
56496
- // don't take progress updates
56497
- ),
56707
+ filter((msg) => {
56708
+ return isTaskNotification(msg) && msg.message?.task_id === task_id && msg.message.status !== "PROGRESS";
56709
+ }),
56498
56710
  map$2((msg) => {
56499
- if (isTaskNotification(msg) && msg.message.status === "CANCELED") {
56500
- throw new Error("CANCELED");
56711
+ if (msg.message.status === "CANCELED") {
56712
+ throw new TaskCancelledError("Task was cancelled", msg.message.task_id);
56713
+ } else if (msg.message.status === "ERROR") {
56714
+ throw new TaskError(msg.message.error, msg.message.task_id);
56501
56715
  }
56502
56716
  return msg;
56503
56717
  }),
@@ -56638,17 +56852,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56638
56852
  function isVariable(variable) {
56639
56853
  return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename.includes("Variable");
56640
56854
  }
56641
- function isUrlVariable(variable) {
56642
- return isVariable(variable) && variable.__typename === "UrlVariable";
56855
+ function isSingleVariable(variable) {
56856
+ return isVariable(variable) && variable.__typename === "Variable";
56643
56857
  }
56644
56858
  function isDerivedVariable(variable) {
56645
56859
  return isVariable(variable) && variable.__typename === "DerivedVariable";
56646
56860
  }
56647
- function isDataVariable(variable) {
56648
- return isVariable(variable) && variable.__typename === "DataVariable";
56649
- }
56650
- function isDerivedDataVariable(variable) {
56651
- return isVariable(variable) && variable.__typename === "DerivedDataVariable";
56861
+ function isServerVariable(variable) {
56862
+ return isVariable(variable) && variable.__typename === "ServerVariable";
56652
56863
  }
56653
56864
  function isLoopVariable(variable) {
56654
56865
  return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename === "LoopVariable";
@@ -56656,14 +56867,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56656
56867
  function isSwitchVariable(variable) {
56657
56868
  return isVariable(variable) && variable.__typename === "SwitchVariable";
56658
56869
  }
56870
+ function isStateVariable(variable) {
56871
+ return isVariable(variable) && variable.__typename === "StateVariable";
56872
+ }
56659
56873
  function isResolvedDerivedVariable(value) {
56660
56874
  return value && typeof value === "object" && "values" in value && "type" in value && value.type === "derived" && "uid" in value;
56661
56875
  }
56662
- function isResolvedDataVariable(value) {
56663
- return value && typeof value === "object" && "filters" in value && "type" in value && value.type === "data" && "uid" in value;
56664
- }
56665
- function isResolvedDerivedDataVariable(value) {
56666
- return value && typeof value === "object" && "filters" in value && "values" in value && "type" in value && value.type === "derived-data" && "uid" in value;
56876
+ function isResolvedServerVariable(value) {
56877
+ return value && typeof value === "object" && "type" in value && value.type === "server" && "uid" in value && "sequence_number" in value;
56667
56878
  }
56668
56879
  function isResolvedSwitchVariable(value) {
56669
56880
  return value && typeof value === "object" && "type" in value && value.type === "switch" && "uid" in value && "value_map" in value;
@@ -56801,813 +57012,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56801
57012
  });
56802
57013
  return res.ok;
56803
57014
  }
56804
- function commonjsRequire(path) {
56805
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
56806
- }
56807
- var object_hash = { exports: {} };
56808
- var hasRequiredObject_hash;
56809
- function requireObject_hash() {
56810
- if (hasRequiredObject_hash) return object_hash.exports;
56811
- hasRequiredObject_hash = 1;
56812
- (function(module2, exports2) {
56813
- !function(e2) {
56814
- module2.exports = e2();
56815
- }(function() {
56816
- return function r2(o2, i2, u) {
56817
- function s(n2, e3) {
56818
- if (!i2[n2]) {
56819
- if (!o2[n2]) {
56820
- var t2 = "function" == typeof commonjsRequire && commonjsRequire;
56821
- if (!e3 && t2) return t2(n2, true);
56822
- if (a2) return a2(n2, true);
56823
- throw new Error("Cannot find module '" + n2 + "'");
56824
- }
56825
- e3 = i2[n2] = { exports: {} };
56826
- o2[n2][0].call(e3.exports, function(e4) {
56827
- var t3 = o2[n2][1][e4];
56828
- return s(t3 || e4);
56829
- }, e3, e3.exports, r2, o2, i2, u);
56830
- }
56831
- return i2[n2].exports;
56832
- }
56833
- for (var a2 = "function" == typeof commonjsRequire && commonjsRequire, e2 = 0; e2 < u.length; e2++) s(u[e2]);
56834
- return s;
56835
- }({ 1: [function(w2, b2, m) {
56836
- !(function(e2, n2, s, c, d2, h, p2, g, y) {
56837
- var r2 = w2("crypto");
56838
- function t2(e3, t3) {
56839
- t3 = u(e3, t3);
56840
- var n3;
56841
- return void 0 === (n3 = "passthrough" !== t3.algorithm ? r2.createHash(t3.algorithm) : new l2()).write && (n3.write = n3.update, n3.end = n3.update), f(t3, n3).dispatch(e3), n3.update || n3.end(""), n3.digest ? n3.digest("buffer" === t3.encoding ? void 0 : t3.encoding) : (e3 = n3.read(), "buffer" !== t3.encoding ? e3.toString(t3.encoding) : e3);
56842
- }
56843
- (m = b2.exports = t2).sha1 = function(e3) {
56844
- return t2(e3);
56845
- }, m.keys = function(e3) {
56846
- return t2(e3, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
56847
- }, m.MD5 = function(e3) {
56848
- return t2(e3, { algorithm: "md5", encoding: "hex" });
56849
- }, m.keysMD5 = function(e3) {
56850
- return t2(e3, { algorithm: "md5", encoding: "hex", excludeValues: true });
56851
- };
56852
- var o2 = r2.getHashes ? r2.getHashes().slice() : ["sha1", "md5"], i2 = (o2.push("passthrough"), ["buffer", "hex", "binary", "base64"]);
56853
- function u(e3, t3) {
56854
- var n3 = {};
56855
- if (n3.algorithm = (t3 = t3 || {}).algorithm || "sha1", n3.encoding = t3.encoding || "hex", n3.excludeValues = !!t3.excludeValues, n3.algorithm = n3.algorithm.toLowerCase(), n3.encoding = n3.encoding.toLowerCase(), n3.ignoreUnknown = true === t3.ignoreUnknown, n3.respectType = false !== t3.respectType, n3.respectFunctionNames = false !== t3.respectFunctionNames, n3.respectFunctionProperties = false !== t3.respectFunctionProperties, n3.unorderedArrays = true === t3.unorderedArrays, n3.unorderedSets = false !== t3.unorderedSets, n3.unorderedObjects = false !== t3.unorderedObjects, n3.replacer = t3.replacer || void 0, n3.excludeKeys = t3.excludeKeys || void 0, void 0 === e3) throw new Error("Object argument required.");
56856
- for (var r3 = 0; r3 < o2.length; ++r3) o2[r3].toLowerCase() === n3.algorithm.toLowerCase() && (n3.algorithm = o2[r3]);
56857
- if (-1 === o2.indexOf(n3.algorithm)) throw new Error('Algorithm "' + n3.algorithm + '" not supported. supported values: ' + o2.join(", "));
56858
- if (-1 === i2.indexOf(n3.encoding) && "passthrough" !== n3.algorithm) throw new Error('Encoding "' + n3.encoding + '" not supported. supported values: ' + i2.join(", "));
56859
- return n3;
56860
- }
56861
- function a2(e3) {
56862
- if ("function" == typeof e3) return null != /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e3));
56863
- }
56864
- function f(o3, t3, i3) {
56865
- i3 = i3 || [];
56866
- function u2(e3) {
56867
- return t3.update ? t3.update(e3, "utf8") : t3.write(e3, "utf8");
56868
- }
56869
- return { dispatch: function(e3) {
56870
- return this["_" + (null === (e3 = o3.replacer ? o3.replacer(e3) : e3) ? "null" : typeof e3)](e3);
56871
- }, _object: function(t4) {
56872
- var n3, e3 = Object.prototype.toString.call(t4), r3 = /\[object (.*)\]/i.exec(e3);
56873
- r3 = (r3 = r3 ? r3[1] : "unknown:[" + e3 + "]").toLowerCase();
56874
- if (0 <= (e3 = i3.indexOf(t4))) return this.dispatch("[CIRCULAR:" + e3 + "]");
56875
- if (i3.push(t4), void 0 !== s && s.isBuffer && s.isBuffer(t4)) return u2("buffer:"), u2(t4);
56876
- if ("object" === r3 || "function" === r3 || "asyncfunction" === r3) return e3 = Object.keys(t4), o3.unorderedObjects && (e3 = e3.sort()), false === o3.respectType || a2(t4) || e3.splice(0, 0, "prototype", "__proto__", "constructor"), o3.excludeKeys && (e3 = e3.filter(function(e4) {
56877
- return !o3.excludeKeys(e4);
56878
- })), u2("object:" + e3.length + ":"), n3 = this, e3.forEach(function(e4) {
56879
- n3.dispatch(e4), u2(":"), o3.excludeValues || n3.dispatch(t4[e4]), u2(",");
56880
- });
56881
- if (!this["_" + r3]) {
56882
- if (o3.ignoreUnknown) return u2("[" + r3 + "]");
56883
- throw new Error('Unknown object type "' + r3 + '"');
56884
- }
56885
- this["_" + r3](t4);
56886
- }, _array: function(e3, t4) {
56887
- t4 = void 0 !== t4 ? t4 : false !== o3.unorderedArrays;
56888
- var n3 = this;
56889
- if (u2("array:" + e3.length + ":"), !t4 || e3.length <= 1) return e3.forEach(function(e4) {
56890
- return n3.dispatch(e4);
56891
- });
56892
- var r3 = [], t4 = e3.map(function(e4) {
56893
- var t5 = new l2(), n4 = i3.slice();
56894
- return f(o3, t5, n4).dispatch(e4), r3 = r3.concat(n4.slice(i3.length)), t5.read().toString();
56895
- });
56896
- return i3 = i3.concat(r3), t4.sort(), this._array(t4, false);
56897
- }, _date: function(e3) {
56898
- return u2("date:" + e3.toJSON());
56899
- }, _symbol: function(e3) {
56900
- return u2("symbol:" + e3.toString());
56901
- }, _error: function(e3) {
56902
- return u2("error:" + e3.toString());
56903
- }, _boolean: function(e3) {
56904
- return u2("bool:" + e3.toString());
56905
- }, _string: function(e3) {
56906
- u2("string:" + e3.length + ":"), u2(e3.toString());
56907
- }, _function: function(e3) {
56908
- u2("fn:"), a2(e3) ? this.dispatch("[native]") : this.dispatch(e3.toString()), false !== o3.respectFunctionNames && this.dispatch("function-name:" + String(e3.name)), o3.respectFunctionProperties && this._object(e3);
56909
- }, _number: function(e3) {
56910
- return u2("number:" + e3.toString());
56911
- }, _xml: function(e3) {
56912
- return u2("xml:" + e3.toString());
56913
- }, _null: function() {
56914
- return u2("Null");
56915
- }, _undefined: function() {
56916
- return u2("Undefined");
56917
- }, _regexp: function(e3) {
56918
- return u2("regex:" + e3.toString());
56919
- }, _uint8array: function(e3) {
56920
- return u2("uint8array:"), this.dispatch(Array.prototype.slice.call(e3));
56921
- }, _uint8clampedarray: function(e3) {
56922
- return u2("uint8clampedarray:"), this.dispatch(Array.prototype.slice.call(e3));
56923
- }, _int8array: function(e3) {
56924
- return u2("int8array:"), this.dispatch(Array.prototype.slice.call(e3));
56925
- }, _uint16array: function(e3) {
56926
- return u2("uint16array:"), this.dispatch(Array.prototype.slice.call(e3));
56927
- }, _int16array: function(e3) {
56928
- return u2("int16array:"), this.dispatch(Array.prototype.slice.call(e3));
56929
- }, _uint32array: function(e3) {
56930
- return u2("uint32array:"), this.dispatch(Array.prototype.slice.call(e3));
56931
- }, _int32array: function(e3) {
56932
- return u2("int32array:"), this.dispatch(Array.prototype.slice.call(e3));
56933
- }, _float32array: function(e3) {
56934
- return u2("float32array:"), this.dispatch(Array.prototype.slice.call(e3));
56935
- }, _float64array: function(e3) {
56936
- return u2("float64array:"), this.dispatch(Array.prototype.slice.call(e3));
56937
- }, _arraybuffer: function(e3) {
56938
- return u2("arraybuffer:"), this.dispatch(new Uint8Array(e3));
56939
- }, _url: function(e3) {
56940
- return u2("url:" + e3.toString());
56941
- }, _map: function(e3) {
56942
- u2("map:");
56943
- e3 = Array.from(e3);
56944
- return this._array(e3, false !== o3.unorderedSets);
56945
- }, _set: function(e3) {
56946
- u2("set:");
56947
- e3 = Array.from(e3);
56948
- return this._array(e3, false !== o3.unorderedSets);
56949
- }, _file: function(e3) {
56950
- return u2("file:"), this.dispatch([e3.name, e3.size, e3.type, e3.lastModfied]);
56951
- }, _blob: function() {
56952
- if (o3.ignoreUnknown) return u2("[blob]");
56953
- throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
56954
- }, _domwindow: function() {
56955
- return u2("domwindow");
56956
- }, _bigint: function(e3) {
56957
- return u2("bigint:" + e3.toString());
56958
- }, _process: function() {
56959
- return u2("process");
56960
- }, _timer: function() {
56961
- return u2("timer");
56962
- }, _pipe: function() {
56963
- return u2("pipe");
56964
- }, _tcp: function() {
56965
- return u2("tcp");
56966
- }, _udp: function() {
56967
- return u2("udp");
56968
- }, _tty: function() {
56969
- return u2("tty");
56970
- }, _statwatcher: function() {
56971
- return u2("statwatcher");
56972
- }, _securecontext: function() {
56973
- return u2("securecontext");
56974
- }, _connection: function() {
56975
- return u2("connection");
56976
- }, _zlib: function() {
56977
- return u2("zlib");
56978
- }, _context: function() {
56979
- return u2("context");
56980
- }, _nodescript: function() {
56981
- return u2("nodescript");
56982
- }, _httpparser: function() {
56983
- return u2("httpparser");
56984
- }, _dataview: function() {
56985
- return u2("dataview");
56986
- }, _signal: function() {
56987
- return u2("signal");
56988
- }, _fsevent: function() {
56989
- return u2("fsevent");
56990
- }, _tlswrap: function() {
56991
- return u2("tlswrap");
56992
- } };
56993
- }
56994
- function l2() {
56995
- return { buf: "", write: function(e3) {
56996
- this.buf += e3;
56997
- }, end: function(e3) {
56998
- this.buf += e3;
56999
- }, read: function() {
57000
- return this.buf;
57001
- } };
57002
- }
57003
- m.writeToStream = function(e3, t3, n3) {
57004
- return void 0 === n3 && (n3 = t3, t3 = {}), f(t3 = u(e3, t3), n3).dispatch(e3);
57005
- };
57006
- }).call(this, w2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, w2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_9a5aa49d.js", "/");
57007
- }, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(e2, t2, f) {
57008
- !(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
57009
- !function(e4) {
57010
- var a3 = "undefined" != typeof Uint8Array ? Uint8Array : Array, t4 = "+".charCodeAt(0), n3 = "/".charCodeAt(0), r3 = "0".charCodeAt(0), o3 = "a".charCodeAt(0), i3 = "A".charCodeAt(0), u2 = "-".charCodeAt(0), s2 = "_".charCodeAt(0);
57011
- function f2(e5) {
57012
- e5 = e5.charCodeAt(0);
57013
- return e5 === t4 || e5 === u2 ? 62 : e5 === n3 || e5 === s2 ? 63 : e5 < r3 ? -1 : e5 < r3 + 10 ? e5 - r3 + 26 + 26 : e5 < i3 + 26 ? e5 - i3 : e5 < o3 + 26 ? e5 - o3 + 26 : void 0;
57014
- }
57015
- e4.toByteArray = function(e5) {
57016
- var t5, n4;
57017
- if (0 < e5.length % 4) throw new Error("Invalid string. Length must be a multiple of 4");
57018
- var r4 = e5.length, r4 = "=" === e5.charAt(r4 - 2) ? 2 : "=" === e5.charAt(r4 - 1) ? 1 : 0, o4 = new a3(3 * e5.length / 4 - r4), i4 = 0 < r4 ? e5.length - 4 : e5.length, u3 = 0;
57019
- function s3(e6) {
57020
- o4[u3++] = e6;
57021
- }
57022
- for (t5 = 0; t5 < i4; t5 += 4, 0) s3((16711680 & (n4 = f2(e5.charAt(t5)) << 18 | f2(e5.charAt(t5 + 1)) << 12 | f2(e5.charAt(t5 + 2)) << 6 | f2(e5.charAt(t5 + 3)))) >> 16), s3((65280 & n4) >> 8), s3(255 & n4);
57023
- return 2 == r4 ? s3(255 & (n4 = f2(e5.charAt(t5)) << 2 | f2(e5.charAt(t5 + 1)) >> 4)) : 1 == r4 && (s3((n4 = f2(e5.charAt(t5)) << 10 | f2(e5.charAt(t5 + 1)) << 4 | f2(e5.charAt(t5 + 2)) >> 2) >> 8 & 255), s3(255 & n4)), o4;
57024
- }, e4.fromByteArray = function(e5) {
57025
- var t5, n4, r4, o4, i4 = e5.length % 3, u3 = "";
57026
- function s3(e6) {
57027
- return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e6);
57028
- }
57029
- for (t5 = 0, r4 = e5.length - i4; t5 < r4; t5 += 3) n4 = (e5[t5] << 16) + (e5[t5 + 1] << 8) + e5[t5 + 2], u3 += s3((o4 = n4) >> 18 & 63) + s3(o4 >> 12 & 63) + s3(o4 >> 6 & 63) + s3(63 & o4);
57030
- switch (i4) {
57031
- case 1:
57032
- u3 = (u3 += s3((n4 = e5[e5.length - 1]) >> 2)) + s3(n4 << 4 & 63) + "==";
57033
- break;
57034
- case 2:
57035
- u3 = (u3 = (u3 += s3((n4 = (e5[e5.length - 2] << 8) + e5[e5.length - 1]) >> 10)) + s3(n4 >> 4 & 63)) + s3(n4 << 2 & 63) + "=";
57036
- }
57037
- return u3;
57038
- };
57039
- }(void 0 === f ? this.base64js = {} : f);
57040
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js", "/node_modules/gulp-browserify/node_modules/base64-js/lib");
57041
- }, { buffer: 3, lYpoI2: 11 }], 3: [function(O, e2, H) {
57042
- !(function(e3, n2, f, r2, h, p2, g, y, w2) {
57043
- var a2 = O("base64-js"), i2 = O("ieee754");
57044
- function f(e4, t3, n3) {
57045
- if (!(this instanceof f)) return new f(e4, t3, n3);
57046
- var r3, o3, i3, u2, s2 = typeof e4;
57047
- if ("base64" === t3 && "string" == s2) for (e4 = (u2 = e4).trim ? u2.trim() : u2.replace(/^\s+|\s+$/g, ""); e4.length % 4 != 0; ) e4 += "=";
57048
- if ("number" == s2) r3 = j(e4);
57049
- else if ("string" == s2) r3 = f.byteLength(e4, t3);
57050
- else {
57051
- if ("object" != s2) throw new Error("First argument needs to be a number, array or string.");
57052
- r3 = j(e4.length);
57053
- }
57054
- if (f._useTypedArrays ? o3 = f._augment(new Uint8Array(r3)) : ((o3 = this).length = r3, o3._isBuffer = true), f._useTypedArrays && "number" == typeof e4.byteLength) o3._set(e4);
57055
- else if (C(u2 = e4) || f.isBuffer(u2) || u2 && "object" == typeof u2 && "number" == typeof u2.length) for (i3 = 0; i3 < r3; i3++) f.isBuffer(e4) ? o3[i3] = e4.readUInt8(i3) : o3[i3] = e4[i3];
57056
- else if ("string" == s2) o3.write(e4, 0, t3);
57057
- else if ("number" == s2 && !f._useTypedArrays && !n3) for (i3 = 0; i3 < r3; i3++) o3[i3] = 0;
57058
- return o3;
57059
- }
57060
- function b2(e4, t3, n3, r3) {
57061
- return f._charsWritten = c(function(e5) {
57062
- for (var t4 = [], n4 = 0; n4 < e5.length; n4++) t4.push(255 & e5.charCodeAt(n4));
57063
- return t4;
57064
- }(t3), e4, n3, r3);
57065
- }
57066
- function m(e4, t3, n3, r3) {
57067
- return f._charsWritten = c(function(e5) {
57068
- for (var t4, n4, r4 = [], o3 = 0; o3 < e5.length; o3++) n4 = e5.charCodeAt(o3), t4 = n4 >> 8, n4 = n4 % 256, r4.push(n4), r4.push(t4);
57069
- return r4;
57070
- }(t3), e4, n3, r3);
57071
- }
57072
- function v(e4, t3, n3) {
57073
- var r3 = "";
57074
- n3 = Math.min(e4.length, n3);
57075
- for (var o3 = t3; o3 < n3; o3++) r3 += String.fromCharCode(e4[o3]);
57076
- return r3;
57077
- }
57078
- function o2(e4, t3, n3, r3) {
57079
- r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 1 < e4.length, "Trying to read beyond buffer length"));
57080
- var o3, r3 = e4.length;
57081
- if (!(r3 <= t3)) return n3 ? (o3 = e4[t3], t3 + 1 < r3 && (o3 |= e4[t3 + 1] << 8)) : (o3 = e4[t3] << 8, t3 + 1 < r3 && (o3 |= e4[t3 + 1])), o3;
57082
- }
57083
- function u(e4, t3, n3, r3) {
57084
- r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length"));
57085
- var o3, r3 = e4.length;
57086
- if (!(r3 <= t3)) return n3 ? (t3 + 2 < r3 && (o3 = e4[t3 + 2] << 16), t3 + 1 < r3 && (o3 |= e4[t3 + 1] << 8), o3 |= e4[t3], t3 + 3 < r3 && (o3 += e4[t3 + 3] << 24 >>> 0)) : (t3 + 1 < r3 && (o3 = e4[t3 + 1] << 16), t3 + 2 < r3 && (o3 |= e4[t3 + 2] << 8), t3 + 3 < r3 && (o3 |= e4[t3 + 3]), o3 += e4[t3] << 24 >>> 0), o3;
57087
- }
57088
- function _(e4, t3, n3, r3) {
57089
- if (r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 1 < e4.length, "Trying to read beyond buffer length")), !(e4.length <= t3)) return r3 = o2(e4, t3, n3, true), 32768 & r3 ? -1 * (65535 - r3 + 1) : r3;
57090
- }
57091
- function E(e4, t3, n3, r3) {
57092
- if (r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(null != t3, "missing offset"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length")), !(e4.length <= t3)) return r3 = u(e4, t3, n3, true), 2147483648 & r3 ? -1 * (4294967295 - r3 + 1) : r3;
57093
- }
57094
- function I(e4, t3, n3, r3) {
57095
- return r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(t3 + 3 < e4.length, "Trying to read beyond buffer length")), i2.read(e4, t3, n3, 23, 4);
57096
- }
57097
- function A(e4, t3, n3, r3) {
57098
- return r3 || (d2("boolean" == typeof n3, "missing or invalid endian"), d2(t3 + 7 < e4.length, "Trying to read beyond buffer length")), i2.read(e4, t3, n3, 52, 8);
57099
- }
57100
- function s(e4, t3, n3, r3, o3) {
57101
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 1 < e4.length, "trying to write beyond buffer length"), Y(t3, 65535));
57102
- o3 = e4.length;
57103
- if (!(o3 <= n3)) for (var i3 = 0, u2 = Math.min(o3 - n3, 2); i3 < u2; i3++) e4[n3 + i3] = (t3 & 255 << 8 * (r3 ? i3 : 1 - i3)) >>> 8 * (r3 ? i3 : 1 - i3);
57104
- }
57105
- function l2(e4, t3, n3, r3, o3) {
57106
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "trying to write beyond buffer length"), Y(t3, 4294967295));
57107
- o3 = e4.length;
57108
- if (!(o3 <= n3)) for (var i3 = 0, u2 = Math.min(o3 - n3, 4); i3 < u2; i3++) e4[n3 + i3] = t3 >>> 8 * (r3 ? i3 : 3 - i3) & 255;
57109
- }
57110
- function B(e4, t3, n3, r3, o3) {
57111
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 1 < e4.length, "Trying to write beyond buffer length"), F(t3, 32767, -32768)), e4.length <= n3 || s(e4, 0 <= t3 ? t3 : 65535 + t3 + 1, n3, r3, o3);
57112
- }
57113
- function L(e4, t3, n3, r3, o3) {
57114
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "Trying to write beyond buffer length"), F(t3, 2147483647, -2147483648)), e4.length <= n3 || l2(e4, 0 <= t3 ? t3 : 4294967295 + t3 + 1, n3, r3, o3);
57115
- }
57116
- function U(e4, t3, n3, r3, o3) {
57117
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 3 < e4.length, "Trying to write beyond buffer length"), D(t3, 34028234663852886e22, -34028234663852886e22)), e4.length <= n3 || i2.write(e4, t3, n3, r3, 23, 4);
57118
- }
57119
- function x(e4, t3, n3, r3, o3) {
57120
- o3 || (d2(null != t3, "missing value"), d2("boolean" == typeof r3, "missing or invalid endian"), d2(null != n3, "missing offset"), d2(n3 + 7 < e4.length, "Trying to write beyond buffer length"), D(t3, 17976931348623157e292, -17976931348623157e292)), e4.length <= n3 || i2.write(e4, t3, n3, r3, 52, 8);
57121
- }
57122
- H.Buffer = f, H.SlowBuffer = f, H.INSPECT_MAX_BYTES = 50, f.poolSize = 8192, f._useTypedArrays = function() {
57123
- try {
57124
- var e4 = new ArrayBuffer(0), t3 = new Uint8Array(e4);
57125
- return t3.foo = function() {
57126
- return 42;
57127
- }, 42 === t3.foo() && "function" == typeof t3.subarray;
57128
- } catch (e5) {
57129
- return false;
57130
- }
57131
- }(), f.isEncoding = function(e4) {
57132
- switch (String(e4).toLowerCase()) {
57133
- case "hex":
57134
- case "utf8":
57135
- case "utf-8":
57136
- case "ascii":
57137
- case "binary":
57138
- case "base64":
57139
- case "raw":
57140
- case "ucs2":
57141
- case "ucs-2":
57142
- case "utf16le":
57143
- case "utf-16le":
57144
- return true;
57145
- default:
57146
- return false;
57147
- }
57148
- }, f.isBuffer = function(e4) {
57149
- return !(null == e4 || !e4._isBuffer);
57150
- }, f.byteLength = function(e4, t3) {
57151
- var n3;
57152
- switch (e4 += "", t3 || "utf8") {
57153
- case "hex":
57154
- n3 = e4.length / 2;
57155
- break;
57156
- case "utf8":
57157
- case "utf-8":
57158
- n3 = T(e4).length;
57159
- break;
57160
- case "ascii":
57161
- case "binary":
57162
- case "raw":
57163
- n3 = e4.length;
57164
- break;
57165
- case "base64":
57166
- n3 = M(e4).length;
57167
- break;
57168
- case "ucs2":
57169
- case "ucs-2":
57170
- case "utf16le":
57171
- case "utf-16le":
57172
- n3 = 2 * e4.length;
57173
- break;
57174
- default:
57175
- throw new Error("Unknown encoding");
57176
- }
57177
- return n3;
57178
- }, f.concat = function(e4, t3) {
57179
- if (d2(C(e4), "Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."), 0 === e4.length) return new f(0);
57180
- if (1 === e4.length) return e4[0];
57181
- if ("number" != typeof t3) for (o3 = t3 = 0; o3 < e4.length; o3++) t3 += e4[o3].length;
57182
- for (var n3 = new f(t3), r3 = 0, o3 = 0; o3 < e4.length; o3++) {
57183
- var i3 = e4[o3];
57184
- i3.copy(n3, r3), r3 += i3.length;
57185
- }
57186
- return n3;
57187
- }, f.prototype.write = function(e4, t3, n3, r3) {
57188
- isFinite(t3) ? isFinite(n3) || (r3 = n3, n3 = void 0) : (a3 = r3, r3 = t3, t3 = n3, n3 = a3), t3 = Number(t3) || 0;
57189
- var o3, i3, u2, s2, a3 = this.length - t3;
57190
- switch ((!n3 || a3 < (n3 = Number(n3))) && (n3 = a3), r3 = String(r3 || "utf8").toLowerCase()) {
57191
- case "hex":
57192
- o3 = function(e5, t4, n4, r4) {
57193
- n4 = Number(n4) || 0;
57194
- var o4 = e5.length - n4;
57195
- (!r4 || o4 < (r4 = Number(r4))) && (r4 = o4), d2((o4 = t4.length) % 2 == 0, "Invalid hex string"), o4 / 2 < r4 && (r4 = o4 / 2);
57196
- for (var i4 = 0; i4 < r4; i4++) {
57197
- var u3 = parseInt(t4.substr(2 * i4, 2), 16);
57198
- d2(!isNaN(u3), "Invalid hex string"), e5[n4 + i4] = u3;
57199
- }
57200
- return f._charsWritten = 2 * i4, i4;
57201
- }(this, e4, t3, n3);
57202
- break;
57203
- case "utf8":
57204
- case "utf-8":
57205
- i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(T(e4), i3, u2, s2);
57206
- break;
57207
- case "ascii":
57208
- case "binary":
57209
- o3 = b2(this, e4, t3, n3);
57210
- break;
57211
- case "base64":
57212
- i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(M(e4), i3, u2, s2);
57213
- break;
57214
- case "ucs2":
57215
- case "ucs-2":
57216
- case "utf16le":
57217
- case "utf-16le":
57218
- o3 = m(this, e4, t3, n3);
57219
- break;
57220
- default:
57221
- throw new Error("Unknown encoding");
57222
- }
57223
- return o3;
57224
- }, f.prototype.toString = function(e4, t3, n3) {
57225
- var r3, o3, i3, u2, s2 = this;
57226
- if (e4 = String(e4 || "utf8").toLowerCase(), t3 = Number(t3) || 0, (n3 = void 0 !== n3 ? Number(n3) : s2.length) === t3) return "";
57227
- switch (e4) {
57228
- case "hex":
57229
- r3 = function(e5, t4, n4) {
57230
- var r4 = e5.length;
57231
- (!t4 || t4 < 0) && (t4 = 0);
57232
- (!n4 || n4 < 0 || r4 < n4) && (n4 = r4);
57233
- for (var o4 = "", i4 = t4; i4 < n4; i4++) o4 += k(e5[i4]);
57234
- return o4;
57235
- }(s2, t3, n3);
57236
- break;
57237
- case "utf8":
57238
- case "utf-8":
57239
- r3 = function(e5, t4, n4) {
57240
- var r4 = "", o4 = "";
57241
- n4 = Math.min(e5.length, n4);
57242
- for (var i4 = t4; i4 < n4; i4++) e5[i4] <= 127 ? (r4 += N(o4) + String.fromCharCode(e5[i4]), o4 = "") : o4 += "%" + e5[i4].toString(16);
57243
- return r4 + N(o4);
57244
- }(s2, t3, n3);
57245
- break;
57246
- case "ascii":
57247
- case "binary":
57248
- r3 = v(s2, t3, n3);
57249
- break;
57250
- case "base64":
57251
- o3 = s2, u2 = n3, r3 = 0 === (i3 = t3) && u2 === o3.length ? a2.fromByteArray(o3) : a2.fromByteArray(o3.slice(i3, u2));
57252
- break;
57253
- case "ucs2":
57254
- case "ucs-2":
57255
- case "utf16le":
57256
- case "utf-16le":
57257
- r3 = function(e5, t4, n4) {
57258
- for (var r4 = e5.slice(t4, n4), o4 = "", i4 = 0; i4 < r4.length; i4 += 2) o4 += String.fromCharCode(r4[i4] + 256 * r4[i4 + 1]);
57259
- return o4;
57260
- }(s2, t3, n3);
57261
- break;
57262
- default:
57263
- throw new Error("Unknown encoding");
57264
- }
57265
- return r3;
57266
- }, f.prototype.toJSON = function() {
57267
- return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
57268
- }, f.prototype.copy = function(e4, t3, n3, r3) {
57269
- if (t3 = t3 || 0, (r3 = r3 || 0 === r3 ? r3 : this.length) !== (n3 = n3 || 0) && 0 !== e4.length && 0 !== this.length) {
57270
- d2(n3 <= r3, "sourceEnd < sourceStart"), d2(0 <= t3 && t3 < e4.length, "targetStart out of bounds"), d2(0 <= n3 && n3 < this.length, "sourceStart out of bounds"), d2(0 <= r3 && r3 <= this.length, "sourceEnd out of bounds"), r3 > this.length && (r3 = this.length);
57271
- var o3 = (r3 = e4.length - t3 < r3 - n3 ? e4.length - t3 + n3 : r3) - n3;
57272
- if (o3 < 100 || !f._useTypedArrays) for (var i3 = 0; i3 < o3; i3++) e4[i3 + t3] = this[i3 + n3];
57273
- else e4._set(this.subarray(n3, n3 + o3), t3);
57274
- }
57275
- }, f.prototype.slice = function(e4, t3) {
57276
- var n3 = this.length;
57277
- if (e4 = S(e4, n3, 0), t3 = S(t3, n3, n3), f._useTypedArrays) return f._augment(this.subarray(e4, t3));
57278
- for (var r3 = t3 - e4, o3 = new f(r3, void 0, true), i3 = 0; i3 < r3; i3++) o3[i3] = this[i3 + e4];
57279
- return o3;
57280
- }, f.prototype.get = function(e4) {
57281
- return console.log(".get() is deprecated. Access using array indexes instead."), this.readUInt8(e4);
57282
- }, f.prototype.set = function(e4, t3) {
57283
- return console.log(".set() is deprecated. Access using array indexes instead."), this.writeUInt8(e4, t3);
57284
- }, f.prototype.readUInt8 = function(e4, t3) {
57285
- if (t3 || (d2(null != e4, "missing offset"), d2(e4 < this.length, "Trying to read beyond buffer length")), !(e4 >= this.length)) return this[e4];
57286
- }, f.prototype.readUInt16LE = function(e4, t3) {
57287
- return o2(this, e4, true, t3);
57288
- }, f.prototype.readUInt16BE = function(e4, t3) {
57289
- return o2(this, e4, false, t3);
57290
- }, f.prototype.readUInt32LE = function(e4, t3) {
57291
- return u(this, e4, true, t3);
57292
- }, f.prototype.readUInt32BE = function(e4, t3) {
57293
- return u(this, e4, false, t3);
57294
- }, f.prototype.readInt8 = function(e4, t3) {
57295
- if (t3 || (d2(null != e4, "missing offset"), d2(e4 < this.length, "Trying to read beyond buffer length")), !(e4 >= this.length)) return 128 & this[e4] ? -1 * (255 - this[e4] + 1) : this[e4];
57296
- }, f.prototype.readInt16LE = function(e4, t3) {
57297
- return _(this, e4, true, t3);
57298
- }, f.prototype.readInt16BE = function(e4, t3) {
57299
- return _(this, e4, false, t3);
57300
- }, f.prototype.readInt32LE = function(e4, t3) {
57301
- return E(this, e4, true, t3);
57302
- }, f.prototype.readInt32BE = function(e4, t3) {
57303
- return E(this, e4, false, t3);
57304
- }, f.prototype.readFloatLE = function(e4, t3) {
57305
- return I(this, e4, true, t3);
57306
- }, f.prototype.readFloatBE = function(e4, t3) {
57307
- return I(this, e4, false, t3);
57308
- }, f.prototype.readDoubleLE = function(e4, t3) {
57309
- return A(this, e4, true, t3);
57310
- }, f.prototype.readDoubleBE = function(e4, t3) {
57311
- return A(this, e4, false, t3);
57312
- }, f.prototype.writeUInt8 = function(e4, t3, n3) {
57313
- n3 || (d2(null != e4, "missing value"), d2(null != t3, "missing offset"), d2(t3 < this.length, "trying to write beyond buffer length"), Y(e4, 255)), t3 >= this.length || (this[t3] = e4);
57314
- }, f.prototype.writeUInt16LE = function(e4, t3, n3) {
57315
- s(this, e4, t3, true, n3);
57316
- }, f.prototype.writeUInt16BE = function(e4, t3, n3) {
57317
- s(this, e4, t3, false, n3);
57318
- }, f.prototype.writeUInt32LE = function(e4, t3, n3) {
57319
- l2(this, e4, t3, true, n3);
57320
- }, f.prototype.writeUInt32BE = function(e4, t3, n3) {
57321
- l2(this, e4, t3, false, n3);
57322
- }, f.prototype.writeInt8 = function(e4, t3, n3) {
57323
- n3 || (d2(null != e4, "missing value"), d2(null != t3, "missing offset"), d2(t3 < this.length, "Trying to write beyond buffer length"), F(e4, 127, -128)), t3 >= this.length || (0 <= e4 ? this.writeUInt8(e4, t3, n3) : this.writeUInt8(255 + e4 + 1, t3, n3));
57324
- }, f.prototype.writeInt16LE = function(e4, t3, n3) {
57325
- B(this, e4, t3, true, n3);
57326
- }, f.prototype.writeInt16BE = function(e4, t3, n3) {
57327
- B(this, e4, t3, false, n3);
57328
- }, f.prototype.writeInt32LE = function(e4, t3, n3) {
57329
- L(this, e4, t3, true, n3);
57330
- }, f.prototype.writeInt32BE = function(e4, t3, n3) {
57331
- L(this, e4, t3, false, n3);
57332
- }, f.prototype.writeFloatLE = function(e4, t3, n3) {
57333
- U(this, e4, t3, true, n3);
57334
- }, f.prototype.writeFloatBE = function(e4, t3, n3) {
57335
- U(this, e4, t3, false, n3);
57336
- }, f.prototype.writeDoubleLE = function(e4, t3, n3) {
57337
- x(this, e4, t3, true, n3);
57338
- }, f.prototype.writeDoubleBE = function(e4, t3, n3) {
57339
- x(this, e4, t3, false, n3);
57340
- }, f.prototype.fill = function(e4, t3, n3) {
57341
- if (t3 = t3 || 0, n3 = n3 || this.length, d2("number" == typeof (e4 = "string" == typeof (e4 = e4 || 0) ? e4.charCodeAt(0) : e4) && !isNaN(e4), "value is not a number"), d2(t3 <= n3, "end < start"), n3 !== t3 && 0 !== this.length) {
57342
- d2(0 <= t3 && t3 < this.length, "start out of bounds"), d2(0 <= n3 && n3 <= this.length, "end out of bounds");
57343
- for (var r3 = t3; r3 < n3; r3++) this[r3] = e4;
57344
- }
57345
- }, f.prototype.inspect = function() {
57346
- for (var e4 = [], t3 = this.length, n3 = 0; n3 < t3; n3++) if (e4[n3] = k(this[n3]), n3 === H.INSPECT_MAX_BYTES) {
57347
- e4[n3 + 1] = "...";
57348
- break;
57349
- }
57350
- return "<Buffer " + e4.join(" ") + ">";
57351
- }, f.prototype.toArrayBuffer = function() {
57352
- if ("undefined" == typeof Uint8Array) throw new Error("Buffer.toArrayBuffer not supported in this browser");
57353
- if (f._useTypedArrays) return new f(this).buffer;
57354
- for (var e4 = new Uint8Array(this.length), t3 = 0, n3 = e4.length; t3 < n3; t3 += 1) e4[t3] = this[t3];
57355
- return e4.buffer;
57356
- };
57357
- var t2 = f.prototype;
57358
- function S(e4, t3, n3) {
57359
- return "number" != typeof e4 ? n3 : t3 <= (e4 = ~~e4) ? t3 : 0 <= e4 || 0 <= (e4 += t3) ? e4 : 0;
57360
- }
57361
- function j(e4) {
57362
- return (e4 = ~~Math.ceil(+e4)) < 0 ? 0 : e4;
57363
- }
57364
- function C(e4) {
57365
- return (Array.isArray || function(e5) {
57366
- return "[object Array]" === Object.prototype.toString.call(e5);
57367
- })(e4);
57368
- }
57369
- function k(e4) {
57370
- return e4 < 16 ? "0" + e4.toString(16) : e4.toString(16);
57371
- }
57372
- function T(e4) {
57373
- for (var t3 = [], n3 = 0; n3 < e4.length; n3++) {
57374
- var r3 = e4.charCodeAt(n3);
57375
- if (r3 <= 127) t3.push(e4.charCodeAt(n3));
57376
- else for (var o3 = n3, i3 = (55296 <= r3 && r3 <= 57343 && n3++, encodeURIComponent(e4.slice(o3, n3 + 1)).substr(1).split("%")), u2 = 0; u2 < i3.length; u2++) t3.push(parseInt(i3[u2], 16));
57377
- }
57378
- return t3;
57379
- }
57380
- function M(e4) {
57381
- return a2.toByteArray(e4);
57382
- }
57383
- function c(e4, t3, n3, r3) {
57384
- for (var o3 = 0; o3 < r3 && !(o3 + n3 >= t3.length || o3 >= e4.length); o3++) t3[o3 + n3] = e4[o3];
57385
- return o3;
57386
- }
57387
- function N(e4) {
57388
- try {
57389
- return decodeURIComponent(e4);
57390
- } catch (e5) {
57391
- return String.fromCharCode(65533);
57392
- }
57393
- }
57394
- function Y(e4, t3) {
57395
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(0 <= e4, "specified a negative value for writing an unsigned value"), d2(e4 <= t3, "value is larger than maximum value for type"), d2(Math.floor(e4) === e4, "value has a fractional component");
57396
- }
57397
- function F(e4, t3, n3) {
57398
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(e4 <= t3, "value larger than maximum allowed value"), d2(n3 <= e4, "value smaller than minimum allowed value"), d2(Math.floor(e4) === e4, "value has a fractional component");
57399
- }
57400
- function D(e4, t3, n3) {
57401
- d2("number" == typeof e4, "cannot write a non-number as a number"), d2(e4 <= t3, "value larger than maximum allowed value"), d2(n3 <= e4, "value smaller than minimum allowed value");
57402
- }
57403
- function d2(e4, t3) {
57404
- if (!e4) throw new Error(t3 || "Failed assertion");
57405
- }
57406
- f._augment = function(e4) {
57407
- return e4._isBuffer = true, e4._get = e4.get, e4._set = e4.set, e4.get = t2.get, e4.set = t2.set, e4.write = t2.write, e4.toString = t2.toString, e4.toLocaleString = t2.toString, e4.toJSON = t2.toJSON, e4.copy = t2.copy, e4.slice = t2.slice, e4.readUInt8 = t2.readUInt8, e4.readUInt16LE = t2.readUInt16LE, e4.readUInt16BE = t2.readUInt16BE, e4.readUInt32LE = t2.readUInt32LE, e4.readUInt32BE = t2.readUInt32BE, e4.readInt8 = t2.readInt8, e4.readInt16LE = t2.readInt16LE, e4.readInt16BE = t2.readInt16BE, e4.readInt32LE = t2.readInt32LE, e4.readInt32BE = t2.readInt32BE, e4.readFloatLE = t2.readFloatLE, e4.readFloatBE = t2.readFloatBE, e4.readDoubleLE = t2.readDoubleLE, e4.readDoubleBE = t2.readDoubleBE, e4.writeUInt8 = t2.writeUInt8, e4.writeUInt16LE = t2.writeUInt16LE, e4.writeUInt16BE = t2.writeUInt16BE, e4.writeUInt32LE = t2.writeUInt32LE, e4.writeUInt32BE = t2.writeUInt32BE, e4.writeInt8 = t2.writeInt8, e4.writeInt16LE = t2.writeInt16LE, e4.writeInt16BE = t2.writeInt16BE, e4.writeInt32LE = t2.writeInt32LE, e4.writeInt32BE = t2.writeInt32BE, e4.writeFloatLE = t2.writeFloatLE, e4.writeFloatBE = t2.writeFloatBE, e4.writeDoubleLE = t2.writeDoubleLE, e4.writeDoubleBE = t2.writeDoubleBE, e4.fill = t2.fill, e4.inspect = t2.inspect, e4.toArrayBuffer = t2.toArrayBuffer, e4;
57408
- };
57409
- }).call(this, O("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, O("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/buffer/index.js", "/node_modules/gulp-browserify/node_modules/buffer");
57410
- }, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(c, d2, e2) {
57411
- !(function(e3, t2, a2, n2, r2, o2, i2, u, s) {
57412
- var a2 = c("buffer").Buffer, f = 4, l2 = new a2(f);
57413
- l2.fill(0);
57414
- d2.exports = { hash: function(e4, t3, n3, r3) {
57415
- for (var o3 = t3(function(e5, t4) {
57416
- e5.length % f != 0 && (n4 = e5.length + (f - e5.length % f), e5 = a2.concat([e5, l2], n4));
57417
- for (var n4, r4 = [], o4 = t4 ? e5.readInt32BE : e5.readInt32LE, i4 = 0; i4 < e5.length; i4 += f) r4.push(o4.call(e5, i4));
57418
- return r4;
57419
- }(e4 = a2.isBuffer(e4) ? e4 : new a2(e4), r3), 8 * e4.length), t3 = r3, i3 = new a2(n3), u2 = t3 ? i3.writeInt32BE : i3.writeInt32LE, s2 = 0; s2 < o3.length; s2++) u2.call(i3, o3[s2], 4 * s2, true);
57420
- return i3;
57421
- } };
57422
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57423
- }, { buffer: 3, lYpoI2: 11 }], 5: [function(v, e2, _) {
57424
- !(function(l2, c, u, d2, h, p2, g, y, w2) {
57425
- var u = v("buffer").Buffer, e3 = v("./sha"), t2 = v("./sha256"), n2 = v("./rng"), b2 = { sha1: e3, sha256: t2, md5: v("./md5") }, s = 64, a2 = new u(s);
57426
- function r2(e4, n3) {
57427
- var r3 = b2[e4 = e4 || "sha1"], o3 = [];
57428
- return r3 || i2("algorithm:", e4, "is not yet supported"), { update: function(e5) {
57429
- return u.isBuffer(e5) || (e5 = new u(e5)), o3.push(e5), e5.length, this;
57430
- }, digest: function(e5) {
57431
- var t3 = u.concat(o3), t3 = n3 ? function(e6, t4, n4) {
57432
- u.isBuffer(t4) || (t4 = new u(t4)), u.isBuffer(n4) || (n4 = new u(n4)), t4.length > s ? t4 = e6(t4) : t4.length < s && (t4 = u.concat([t4, a2], s));
57433
- for (var r4 = new u(s), o4 = new u(s), i3 = 0; i3 < s; i3++) r4[i3] = 54 ^ t4[i3], o4[i3] = 92 ^ t4[i3];
57434
- return n4 = e6(u.concat([r4, n4])), e6(u.concat([o4, n4]));
57435
- }(r3, n3, t3) : r3(t3);
57436
- return o3 = null, e5 ? t3.toString(e5) : t3;
57437
- } };
57438
- }
57439
- function i2() {
57440
- var e4 = [].slice.call(arguments).join(" ");
57441
- throw new Error([e4, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join("\n"));
57442
- }
57443
- a2.fill(0), _.createHash = function(e4) {
57444
- return r2(e4);
57445
- }, _.createHmac = r2, _.randomBytes = function(e4, t3) {
57446
- if (!t3 || !t3.call) return new u(n2(e4));
57447
- try {
57448
- t3.call(this, void 0, new u(n2(e4)));
57449
- } catch (e5) {
57450
- t3(e5);
57451
- }
57452
- };
57453
- var o2, f = ["createCredentials", "createCipher", "createCipheriv", "createDecipher", "createDecipheriv", "createSign", "createVerify", "createDiffieHellman", "pbkdf2"], m = function(e4) {
57454
- _[e4] = function() {
57455
- i2("sorry,", e4, "is not implemented yet");
57456
- };
57457
- };
57458
- for (o2 in f) m(f[o2]);
57459
- }).call(this, v("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, v("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57460
- }, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(w2, b2, e2) {
57461
- !(function(e3, r2, o2, i2, u, a2, f, l2, y) {
57462
- var t2 = w2("./helpers");
57463
- function n2(e4, t3) {
57464
- e4[t3 >> 5] |= 128 << t3 % 32, e4[14 + (t3 + 64 >>> 9 << 4)] = t3;
57465
- for (var n3 = 1732584193, r3 = -271733879, o3 = -1732584194, i3 = 271733878, u2 = 0; u2 < e4.length; u2 += 16) {
57466
- var s2 = n3, a3 = r3, f2 = o3, l3 = i3, n3 = c(n3, r3, o3, i3, e4[u2 + 0], 7, -680876936), i3 = c(i3, n3, r3, o3, e4[u2 + 1], 12, -389564586), o3 = c(o3, i3, n3, r3, e4[u2 + 2], 17, 606105819), r3 = c(r3, o3, i3, n3, e4[u2 + 3], 22, -1044525330);
57467
- n3 = c(n3, r3, o3, i3, e4[u2 + 4], 7, -176418897), i3 = c(i3, n3, r3, o3, e4[u2 + 5], 12, 1200080426), o3 = c(o3, i3, n3, r3, e4[u2 + 6], 17, -1473231341), r3 = c(r3, o3, i3, n3, e4[u2 + 7], 22, -45705983), n3 = c(n3, r3, o3, i3, e4[u2 + 8], 7, 1770035416), i3 = c(i3, n3, r3, o3, e4[u2 + 9], 12, -1958414417), o3 = c(o3, i3, n3, r3, e4[u2 + 10], 17, -42063), r3 = c(r3, o3, i3, n3, e4[u2 + 11], 22, -1990404162), n3 = c(n3, r3, o3, i3, e4[u2 + 12], 7, 1804603682), i3 = c(i3, n3, r3, o3, e4[u2 + 13], 12, -40341101), o3 = c(o3, i3, n3, r3, e4[u2 + 14], 17, -1502002290), n3 = d2(n3, r3 = c(r3, o3, i3, n3, e4[u2 + 15], 22, 1236535329), o3, i3, e4[u2 + 1], 5, -165796510), i3 = d2(i3, n3, r3, o3, e4[u2 + 6], 9, -1069501632), o3 = d2(o3, i3, n3, r3, e4[u2 + 11], 14, 643717713), r3 = d2(r3, o3, i3, n3, e4[u2 + 0], 20, -373897302), n3 = d2(n3, r3, o3, i3, e4[u2 + 5], 5, -701558691), i3 = d2(i3, n3, r3, o3, e4[u2 + 10], 9, 38016083), o3 = d2(o3, i3, n3, r3, e4[u2 + 15], 14, -660478335), r3 = d2(r3, o3, i3, n3, e4[u2 + 4], 20, -405537848), n3 = d2(n3, r3, o3, i3, e4[u2 + 9], 5, 568446438), i3 = d2(i3, n3, r3, o3, e4[u2 + 14], 9, -1019803690), o3 = d2(o3, i3, n3, r3, e4[u2 + 3], 14, -187363961), r3 = d2(r3, o3, i3, n3, e4[u2 + 8], 20, 1163531501), n3 = d2(n3, r3, o3, i3, e4[u2 + 13], 5, -1444681467), i3 = d2(i3, n3, r3, o3, e4[u2 + 2], 9, -51403784), o3 = d2(o3, i3, n3, r3, e4[u2 + 7], 14, 1735328473), n3 = h(n3, r3 = d2(r3, o3, i3, n3, e4[u2 + 12], 20, -1926607734), o3, i3, e4[u2 + 5], 4, -378558), i3 = h(i3, n3, r3, o3, e4[u2 + 8], 11, -2022574463), o3 = h(o3, i3, n3, r3, e4[u2 + 11], 16, 1839030562), r3 = h(r3, o3, i3, n3, e4[u2 + 14], 23, -35309556), n3 = h(n3, r3, o3, i3, e4[u2 + 1], 4, -1530992060), i3 = h(i3, n3, r3, o3, e4[u2 + 4], 11, 1272893353), o3 = h(o3, i3, n3, r3, e4[u2 + 7], 16, -155497632), r3 = h(r3, o3, i3, n3, e4[u2 + 10], 23, -1094730640), n3 = h(n3, r3, o3, i3, e4[u2 + 13], 4, 681279174), i3 = h(i3, n3, r3, o3, e4[u2 + 0], 11, -358537222), o3 = h(o3, i3, n3, r3, e4[u2 + 3], 16, -722521979), r3 = h(r3, o3, i3, n3, e4[u2 + 6], 23, 76029189), n3 = h(n3, r3, o3, i3, e4[u2 + 9], 4, -640364487), i3 = h(i3, n3, r3, o3, e4[u2 + 12], 11, -421815835), o3 = h(o3, i3, n3, r3, e4[u2 + 15], 16, 530742520), n3 = p2(n3, r3 = h(r3, o3, i3, n3, e4[u2 + 2], 23, -995338651), o3, i3, e4[u2 + 0], 6, -198630844), i3 = p2(i3, n3, r3, o3, e4[u2 + 7], 10, 1126891415), o3 = p2(o3, i3, n3, r3, e4[u2 + 14], 15, -1416354905), r3 = p2(r3, o3, i3, n3, e4[u2 + 5], 21, -57434055), n3 = p2(n3, r3, o3, i3, e4[u2 + 12], 6, 1700485571), i3 = p2(i3, n3, r3, o3, e4[u2 + 3], 10, -1894986606), o3 = p2(o3, i3, n3, r3, e4[u2 + 10], 15, -1051523), r3 = p2(r3, o3, i3, n3, e4[u2 + 1], 21, -2054922799), n3 = p2(n3, r3, o3, i3, e4[u2 + 8], 6, 1873313359), i3 = p2(i3, n3, r3, o3, e4[u2 + 15], 10, -30611744), o3 = p2(o3, i3, n3, r3, e4[u2 + 6], 15, -1560198380), r3 = p2(r3, o3, i3, n3, e4[u2 + 13], 21, 1309151649), n3 = p2(n3, r3, o3, i3, e4[u2 + 4], 6, -145523070), i3 = p2(i3, n3, r3, o3, e4[u2 + 11], 10, -1120210379), o3 = p2(o3, i3, n3, r3, e4[u2 + 2], 15, 718787259), r3 = p2(r3, o3, i3, n3, e4[u2 + 9], 21, -343485551), n3 = g(n3, s2), r3 = g(r3, a3), o3 = g(o3, f2), i3 = g(i3, l3);
57468
- }
57469
- return Array(n3, r3, o3, i3);
57470
- }
57471
- function s(e4, t3, n3, r3, o3, i3) {
57472
- return g((t3 = g(g(t3, e4), g(r3, i3))) << o3 | t3 >>> 32 - o3, n3);
57473
- }
57474
- function c(e4, t3, n3, r3, o3, i3, u2) {
57475
- return s(t3 & n3 | ~t3 & r3, e4, t3, o3, i3, u2);
57476
- }
57477
- function d2(e4, t3, n3, r3, o3, i3, u2) {
57478
- return s(t3 & r3 | n3 & ~r3, e4, t3, o3, i3, u2);
57479
- }
57480
- function h(e4, t3, n3, r3, o3, i3, u2) {
57481
- return s(t3 ^ n3 ^ r3, e4, t3, o3, i3, u2);
57482
- }
57483
- function p2(e4, t3, n3, r3, o3, i3, u2) {
57484
- return s(n3 ^ (t3 | ~r3), e4, t3, o3, i3, u2);
57485
- }
57486
- function g(e4, t3) {
57487
- var n3 = (65535 & e4) + (65535 & t3);
57488
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57489
- }
57490
- b2.exports = function(e4) {
57491
- return t2.hash(e4, n2, 16);
57492
- };
57493
- }).call(this, w2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, w2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57494
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(e2, l2, t2) {
57495
- !(function(e3, t3, n2, r2, o2, i2, u, s, f) {
57496
- l2.exports = function(e4) {
57497
- for (var t4, n3 = new Array(e4), r3 = 0; r3 < e4; r3++) 0 == (3 & r3) && (t4 = 4294967296 * Math.random()), n3[r3] = t4 >>> ((3 & r3) << 3) & 255;
57498
- return n3;
57499
- };
57500
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57501
- }, { buffer: 3, lYpoI2: 11 }], 8: [function(c, d2, e2) {
57502
- !(function(e3, t2, n2, r2, o2, s, a2, f, l2) {
57503
- var i2 = c("./helpers");
57504
- function u(l3, c2) {
57505
- l3[c2 >> 5] |= 128 << 24 - c2 % 32, l3[15 + (c2 + 64 >> 9 << 4)] = c2;
57506
- for (var e4, t3, n3, r3 = Array(80), o3 = 1732584193, i3 = -271733879, u2 = -1732584194, s2 = 271733878, d3 = -1009589776, h = 0; h < l3.length; h += 16) {
57507
- for (var p2 = o3, g = i3, y = u2, w2 = s2, b2 = d3, a3 = 0; a3 < 80; a3++) {
57508
- r3[a3] = a3 < 16 ? l3[h + a3] : v(r3[a3 - 3] ^ r3[a3 - 8] ^ r3[a3 - 14] ^ r3[a3 - 16], 1);
57509
- var f2 = m(m(v(o3, 5), (f2 = i3, t3 = u2, n3 = s2, (e4 = a3) < 20 ? f2 & t3 | ~f2 & n3 : !(e4 < 40) && e4 < 60 ? f2 & t3 | f2 & n3 | t3 & n3 : f2 ^ t3 ^ n3)), m(m(d3, r3[a3]), (e4 = a3) < 20 ? 1518500249 : e4 < 40 ? 1859775393 : e4 < 60 ? -1894007588 : -899497514)), d3 = s2, s2 = u2, u2 = v(i3, 30), i3 = o3, o3 = f2;
57510
- }
57511
- o3 = m(o3, p2), i3 = m(i3, g), u2 = m(u2, y), s2 = m(s2, w2), d3 = m(d3, b2);
57512
- }
57513
- return Array(o3, i3, u2, s2, d3);
57514
- }
57515
- function m(e4, t3) {
57516
- var n3 = (65535 & e4) + (65535 & t3);
57517
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57518
- }
57519
- function v(e4, t3) {
57520
- return e4 << t3 | e4 >>> 32 - t3;
57521
- }
57522
- d2.exports = function(e4) {
57523
- return i2.hash(e4, u, 20, true);
57524
- };
57525
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57526
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(c, d2, e2) {
57527
- !(function(e3, t2, n2, r2, u, s, a2, f, l2) {
57528
- function b2(e4, t3) {
57529
- var n3 = (65535 & e4) + (65535 & t3);
57530
- return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
57531
- }
57532
- function o2(e4, l3) {
57533
- var c2, d3 = new Array(1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298), t3 = new Array(1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225), n3 = new Array(64);
57534
- e4[l3 >> 5] |= 128 << 24 - l3 % 32, e4[15 + (l3 + 64 >> 9 << 4)] = l3;
57535
- for (var r3, o3, h = 0; h < e4.length; h += 16) {
57536
- for (var i3 = t3[0], u2 = t3[1], s2 = t3[2], p2 = t3[3], a3 = t3[4], g = t3[5], y = t3[6], w2 = t3[7], f2 = 0; f2 < 64; f2++) n3[f2] = f2 < 16 ? e4[f2 + h] : b2(b2(b2((o3 = n3[f2 - 2], m(o3, 17) ^ m(o3, 19) ^ v(o3, 10)), n3[f2 - 7]), (o3 = n3[f2 - 15], m(o3, 7) ^ m(o3, 18) ^ v(o3, 3))), n3[f2 - 16]), c2 = b2(b2(b2(b2(w2, m(o3 = a3, 6) ^ m(o3, 11) ^ m(o3, 25)), a3 & g ^ ~a3 & y), d3[f2]), n3[f2]), r3 = b2(m(r3 = i3, 2) ^ m(r3, 13) ^ m(r3, 22), i3 & u2 ^ i3 & s2 ^ u2 & s2), w2 = y, y = g, g = a3, a3 = b2(p2, c2), p2 = s2, s2 = u2, u2 = i3, i3 = b2(c2, r3);
57537
- t3[0] = b2(i3, t3[0]), t3[1] = b2(u2, t3[1]), t3[2] = b2(s2, t3[2]), t3[3] = b2(p2, t3[3]), t3[4] = b2(a3, t3[4]), t3[5] = b2(g, t3[5]), t3[6] = b2(y, t3[6]), t3[7] = b2(w2, t3[7]);
57538
- }
57539
- return t3;
57540
- }
57541
- var i2 = c("./helpers"), m = function(e4, t3) {
57542
- return e4 >>> t3 | e4 << 32 - t3;
57543
- }, v = function(e4, t3) {
57544
- return e4 >>> t3;
57545
- };
57546
- d2.exports = function(e4) {
57547
- return i2.hash(e4, o2, 32, true);
57548
- };
57549
- }).call(this, c("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, c("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js", "/node_modules/gulp-browserify/node_modules/crypto-browserify");
57550
- }, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(e2, t2, f) {
57551
- !(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
57552
- f.read = function(e4, t4, n3, r3, o3) {
57553
- var i3, u2, l2 = 8 * o3 - r3 - 1, c = (1 << l2) - 1, d2 = c >> 1, s2 = -7, a3 = n3 ? o3 - 1 : 0, f2 = n3 ? -1 : 1, o3 = e4[t4 + a3];
57554
- for (a3 += f2, i3 = o3 & (1 << -s2) - 1, o3 >>= -s2, s2 += l2; 0 < s2; i3 = 256 * i3 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
57555
- for (u2 = i3 & (1 << -s2) - 1, i3 >>= -s2, s2 += r3; 0 < s2; u2 = 256 * u2 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
57556
- if (0 === i3) i3 = 1 - d2;
57557
- else {
57558
- if (i3 === c) return u2 ? NaN : 1 / 0 * (o3 ? -1 : 1);
57559
- u2 += Math.pow(2, r3), i3 -= d2;
57560
- }
57561
- return (o3 ? -1 : 1) * u2 * Math.pow(2, i3 - r3);
57562
- }, f.write = function(e4, t4, l2, n3, r3, c) {
57563
- var o3, i3, u2 = 8 * c - r3 - 1, s2 = (1 << u2) - 1, a3 = s2 >> 1, d2 = 23 === r3 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f2 = n3 ? 0 : c - 1, h = n3 ? 1 : -1, c = t4 < 0 || 0 === t4 && 1 / t4 < 0 ? 1 : 0;
57564
- for (t4 = Math.abs(t4), isNaN(t4) || t4 === 1 / 0 ? (i3 = isNaN(t4) ? 1 : 0, o3 = s2) : (o3 = Math.floor(Math.log(t4) / Math.LN2), t4 * (n3 = Math.pow(2, -o3)) < 1 && (o3--, n3 *= 2), 2 <= (t4 += 1 <= o3 + a3 ? d2 / n3 : d2 * Math.pow(2, 1 - a3)) * n3 && (o3++, n3 /= 2), s2 <= o3 + a3 ? (i3 = 0, o3 = s2) : 1 <= o3 + a3 ? (i3 = (t4 * n3 - 1) * Math.pow(2, r3), o3 += a3) : (i3 = t4 * Math.pow(2, a3 - 1) * Math.pow(2, r3), o3 = 0)); 8 <= r3; e4[l2 + f2] = 255 & i3, f2 += h, i3 /= 256, r3 -= 8) ;
57565
- for (o3 = o3 << r3 | i3, u2 += r3; 0 < u2; e4[l2 + f2] = 255 & o3, f2 += h, o3 /= 256, u2 -= 8) ;
57566
- e4[l2 + f2 - h] |= 128 * c;
57567
- };
57568
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/ieee754/index.js", "/node_modules/gulp-browserify/node_modules/ieee754");
57569
- }, { buffer: 3, lYpoI2: 11 }], 11: [function(e2, h, t2) {
57570
- !(function(e3, t3, n2, r2, o2, f, l2, c, d2) {
57571
- var i2, u, s;
57572
- function a2() {
57573
- }
57574
- (e3 = h.exports = {}).nextTick = (u = "undefined" != typeof window && window.setImmediate, s = "undefined" != typeof window && window.postMessage && window.addEventListener, u ? function(e4) {
57575
- return window.setImmediate(e4);
57576
- } : s ? (i2 = [], window.addEventListener("message", function(e4) {
57577
- var t4 = e4.source;
57578
- t4 !== window && null !== t4 || "process-tick" !== e4.data || (e4.stopPropagation(), 0 < i2.length && i2.shift()());
57579
- }, true), function(e4) {
57580
- i2.push(e4), window.postMessage("process-tick", "*");
57581
- }) : function(e4) {
57582
- setTimeout(e4, 0);
57583
- }), e3.title = "browser", e3.browser = true, e3.env = {}, e3.argv = [], e3.on = a2, e3.addListener = a2, e3.once = a2, e3.off = a2, e3.removeListener = a2, e3.removeAllListeners = a2, e3.emit = a2, e3.binding = function(e4) {
57584
- throw new Error("process.binding is not supported");
57585
- }, e3.cwd = function() {
57586
- return "/";
57587
- }, e3.chdir = function(e4) {
57588
- throw new Error("process.chdir is not supported");
57589
- };
57590
- }).call(this, e2("lYpoI2"), "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, e2("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/node_modules/gulp-browserify/node_modules/process/browser.js", "/node_modules/gulp-browserify/node_modules/process");
57591
- }, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
57592
- });
57593
- })(object_hash);
57594
- return object_hash.exports;
57595
- }
57596
- var object_hashExports = requireObject_hash();
57597
- const hash = /* @__PURE__ */ getDefaultExportFromCjs(object_hashExports);
57598
- function hashObject(obj) {
57599
- return hash(obj, { unorderedArrays: true, unorderedObjects: true, unorderedSets: true });
57600
- }
57601
- function getUniqueIdentifier(variable) {
57602
- let identifier = variable.uid;
57603
- if ("nested" in variable) {
57604
- identifier += variable.nested.join(",");
57605
- }
57606
- if ("filters" in variable && variable.filters) {
57607
- identifier += hashObject(variable.filters);
57608
- }
57609
- return identifier;
57610
- }
57611
57015
  function isPlaceholder(value) {
57612
57016
  return typeof value === "object" && "__ref" in value;
57613
57017
  }
@@ -57616,9 +57020,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57616
57020
  if ("nested" in variable && variable.nested.length > 0) {
57617
57021
  id += `:${variable.nested.join(",")}`;
57618
57022
  }
57619
- if ("filters" in variable) {
57620
- id += `:${hashObject(variable.filters)}`;
57621
- }
57622
57023
  return id;
57623
57024
  }
57624
57025
  function getEntries(obj) {
@@ -57649,7 +57050,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57649
57050
  const normalizedValues = [];
57650
57051
  let lookup = {};
57651
57052
  for (const [key, val] of resolved.values.entries()) {
57652
- if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
57053
+ if (isResolvedDerivedVariable(val)) {
57653
57054
  const { data: nestedNormalized, lookup: nestedLookup } = normalizeResolvedDerivedVariable(
57654
57055
  val,
57655
57056
  def.variables[key]
@@ -57686,7 +57087,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57686
57087
  const kwargDef = kwargsDefinition[key];
57687
57088
  if (!kwargDef) {
57688
57089
  data[key] = val;
57689
- } else if (isDerivedVariable(kwargDef) || isDerivedDataVariable(kwargDef)) {
57090
+ } else if (isDerivedVariable(kwargDef)) {
57690
57091
  const { data: nestedData, lookup: nestedLookup } = normalizeResolvedDerivedVariable(val, kwargDef);
57691
57092
  data[key] = nestedData;
57692
57093
  lookup = {
@@ -57778,7 +57179,13 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57778
57179
  await validateResponse(res, `Failed to cancel task with id: ${taskId}`);
57779
57180
  return true;
57780
57181
  }
57781
- const dataRegistry = /* @__PURE__ */ new Map();
57182
+ function getUniqueIdentifier(variable) {
57183
+ let identifier = variable.uid;
57184
+ if ("nested" in variable) {
57185
+ identifier += variable.nested.join(",");
57186
+ }
57187
+ return identifier;
57188
+ }
57782
57189
  const atomRegistry = /* @__PURE__ */ new Map();
57783
57190
  const atomFamilyRegistry = /* @__PURE__ */ new Map();
57784
57191
  const atomFamilyMembersRegistry = /* @__PURE__ */ new Map();
@@ -57795,7 +57202,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57795
57202
  }
57796
57203
  function clearRegistries_TEST() {
57797
57204
  for (const registry of [
57798
- dataRegistry,
57799
57205
  atomRegistry,
57800
57206
  atomFamilyRegistry,
57801
57207
  atomFamilyMembersRegistry,
@@ -57812,6 +57218,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57812
57218
  return false;
57813
57219
  }
57814
57220
  switch (variable.__typename) {
57221
+ case "ServerVariable":
57815
57222
  case "Variable": {
57816
57223
  if (atomRegistry.has(variable.uid)) {
57817
57224
  return true;
@@ -57822,17 +57229,10 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57822
57229
  }
57823
57230
  return atomFamilyMembersRegistry.get(family).size > 0;
57824
57231
  }
57825
- case "UrlVariable":
57826
- case "DataVariable":
57827
- return atomRegistry.has(variable.uid);
57828
57232
  case "DerivedVariable": {
57829
57233
  const key = getRegistryKey(variable, "selector");
57830
57234
  return selectorFamilyRegistry.has(key);
57831
57235
  }
57832
- case "DerivedDataVariable": {
57833
- const key = getRegistryKey(variable, "selector");
57834
- return selectorFamilyRegistry.has(key);
57835
- }
57836
57236
  default:
57837
57237
  return false;
57838
57238
  }
@@ -58095,8 +57495,9 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
58095
57495
  console.warn("No valid theme was found. Defaulting to light theme.");
58096
57496
  return theme;
58097
57497
  }
58098
- function useDeferLoadable(loadable) {
58099
- const { suspend } = useFallbackCtx();
57498
+ function useDeferLoadable(loadable, suspendOverride) {
57499
+ const { suspend: ctxSuspend } = useFallbackCtx();
57500
+ const suspend = suspendOverride ?? ctxSuspend;
58100
57501
  const [availableState, setAvailableState] = React$1.useState(() => loadable.getValue());
58101
57502
  const timerId = React$1.useRef(null);
58102
57503
  const isFirstRender = React$1.useRef(true);
@@ -58258,16 +57659,9 @@ Inferred class string: "${iconClasses}."`
58258
57659
  return /* @__PURE__ */ React__namespace.createElement(EventBusContext.Provider, { value: bus }, children);
58259
57660
  }
58260
57661
  class StateSynchronizer {
58261
- static #instance;
58262
- #observers = /* @__PURE__ */ new Map();
58263
- // eslint-disable-next-line no-useless-constructor, no-empty-function
57662
+ #observers;
58264
57663
  constructor() {
58265
- }
58266
- static getInstance() {
58267
- if (!StateSynchronizer.#instance) {
58268
- StateSynchronizer.#instance = new StateSynchronizer();
58269
- }
58270
- return StateSynchronizer.#instance;
57664
+ this.#observers = /* @__PURE__ */ new Map();
58271
57665
  }
58272
57666
  /**
58273
57667
  * Register a key in the state synchronizer
@@ -58329,6 +57723,7 @@ Inferred class string: "${iconClasses}."`
58329
57723
  this.#observers.get(key).next(update);
58330
57724
  }
58331
57725
  }
57726
+ const STATE_SYNCHRONIZER$1 = new StateSynchronizer();
58332
57727
  function getOrRegisterPlainVariable(variable, wsClient, taskContext, extras) {
58333
57728
  const isNested = variable.nested && variable.nested.length > 0;
58334
57729
  const isDefaultDerived = isDerivedVariable(variable.default);
@@ -58352,15 +57747,15 @@ Inferred class string: "${iconClasses}."`
58352
57747
  ) : variable.default,
58353
57748
  effects: (extrasSerializable2) => {
58354
57749
  const familySync = ({ onSet, setSelf, resetSelf, node }) => {
58355
- if (!StateSynchronizer.getInstance().isRegistered(variable.uid)) {
58356
- StateSynchronizer.getInstance().register(variable.uid, variable.default);
57750
+ if (!STATE_SYNCHRONIZER$1.isRegistered(variable.uid)) {
57751
+ STATE_SYNCHRONIZER$1.register(variable.uid, variable.default);
58357
57752
  } else {
58358
- const currentState = StateSynchronizer.getInstance().getCurrentState(variable.uid);
57753
+ const currentState = STATE_SYNCHRONIZER$1.getCurrentState(variable.uid);
58359
57754
  if (!isDefaultDerived || currentState?.type !== "initial") {
58360
57755
  setSelf(currentState?.value);
58361
57756
  }
58362
57757
  }
58363
- const unsub = StateSynchronizer.getInstance().subscribe(variable.uid, (update) => {
57758
+ const unsub = STATE_SYNCHRONIZER$1.subscribe(variable.uid, (update) => {
58364
57759
  if (update.type === "initial") {
58365
57760
  return;
58366
57761
  }
@@ -58374,7 +57769,7 @@ Inferred class string: "${iconClasses}."`
58374
57769
  }
58375
57770
  });
58376
57771
  onSet((newValue, oldValue, isReset) => {
58377
- StateSynchronizer.getInstance().notify(variable.uid, {
57772
+ STATE_SYNCHRONIZER$1.notify(variable.uid, {
58378
57773
  isReset,
58379
57774
  nodeKey: node.key,
58380
57775
  oldValue,
@@ -58388,12 +57783,15 @@ Inferred class string: "${iconClasses}."`
58388
57783
  const storeEffect = getEffect(variable);
58389
57784
  if (storeEffect) {
58390
57785
  effects.push(storeEffect(variable, extrasSerializable2, wsClient, taskContext));
58391
- } else {
58392
- if (variable.persist_value || isEmbedded()) {
58393
- effects.push(
58394
- STORES.BrowserStore.effect(variable, extrasSerializable2, wsClient, taskContext)
58395
- );
58396
- }
57786
+ } else if (isEmbedded()) {
57787
+ effects.push(
57788
+ STORES.BrowserStore.effect(
57789
+ variable,
57790
+ extrasSerializable2,
57791
+ wsClient,
57792
+ taskContext
57793
+ )
57794
+ );
58397
57795
  }
58398
57796
  return effects;
58399
57797
  },
@@ -58440,6 +57838,108 @@ Inferred class string: "${iconClasses}."`
58440
57838
  }
58441
57839
  return atomInstance;
58442
57840
  }
57841
+ function createDataUrl(path, pagination) {
57842
+ const url = new URL(path, window.location.origin);
57843
+ if (pagination?.limit) {
57844
+ url.searchParams.set("limit", String(pagination.limit));
57845
+ }
57846
+ if (pagination?.offset) {
57847
+ url.searchParams.set("offset", String(pagination.offset));
57848
+ }
57849
+ if (pagination?.sort) {
57850
+ url.searchParams.set("order_by", (pagination.sort.desc ? "-" : "") + pagination.sort.id);
57851
+ }
57852
+ if (pagination?.index) {
57853
+ url.searchParams.set("index", String(pagination.index));
57854
+ }
57855
+ return url;
57856
+ }
57857
+ async function validateTabularResponse(uid2, response) {
57858
+ if (response.status === 415) {
57859
+ let msg = `The requested variable ${uid2} data is not tabular`;
57860
+ try {
57861
+ const data = await response.json();
57862
+ if ("detail" in data) {
57863
+ msg += `. ${data.detail}`;
57864
+ }
57865
+ } catch {
57866
+ }
57867
+ throw new UserError(msg);
57868
+ }
57869
+ }
57870
+ function isDataResponse(response) {
57871
+ return response && typeof response === "object" && "data" in response && "count" in response;
57872
+ }
57873
+ async function fetchTabularServerVariable({
57874
+ variable,
57875
+ // Explicitly unused, required for the callback dependency to ensure its identity changes
57876
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
57877
+ seqNumber,
57878
+ wsClient,
57879
+ extras,
57880
+ filters = null,
57881
+ pagination = null
57882
+ }) {
57883
+ const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
57884
+ const body = {
57885
+ filters: filters ?? null,
57886
+ ws_channel: await wsClient.getChannel()
57887
+ };
57888
+ const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
57889
+ await handleAuthErrors(response, true);
57890
+ await validateTabularResponse(variable.uid, response);
57891
+ await validateResponse(response, "Failed to fetch tabular data");
57892
+ return response.json();
57893
+ }
57894
+ function useFetchTabularServerVariable(variable, seqNumber, wsClient, extras) {
57895
+ return React$1.useCallback(
57896
+ async (filters, pagination) => {
57897
+ return fetchTabularServerVariable({ variable, seqNumber, wsClient, extras, filters, pagination });
57898
+ },
57899
+ [wsClient, variable, seqNumber, extras]
57900
+ );
57901
+ }
57902
+ function useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras) {
57903
+ const previousResult = React$1.useRef({
57904
+ data: null,
57905
+ count: 0,
57906
+ schema: { fields: [], primaryKey: [] }
57907
+ });
57908
+ return React$1.useCallback(
57909
+ async (filters, pagination) => {
57910
+ const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
57911
+ const body = {
57912
+ filters: filters ?? null,
57913
+ ws_channel: await wsClient.getChannel(),
57914
+ dv_values: normalizeRequest(cleanArgs(dvResult.values), variable.variables)
57915
+ };
57916
+ const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
57917
+ await handleAuthErrors(response, true);
57918
+ await validateTabularResponse(variable.uid, response);
57919
+ await validateResponse(response, "Failed to fetch tabular data");
57920
+ const responseJson = await response.json();
57921
+ const variableTaskId = `${variable.uid}-filter`;
57922
+ taskContext.cleanupRunningTasks(variableTaskId);
57923
+ if (!("task_id" in responseJson)) {
57924
+ previousResult.current = responseJson;
57925
+ return responseJson;
57926
+ }
57927
+ const taskId = responseJson.task_id;
57928
+ taskContext.startTask(taskId, variableTaskId);
57929
+ try {
57930
+ await wsClient.waitForTask(taskId);
57931
+ } catch {
57932
+ return previousResult.current;
57933
+ } finally {
57934
+ taskContext.endTask(taskId);
57935
+ }
57936
+ const taskResult = await fetchTaskResult(taskId, extras);
57937
+ previousResult.current = taskResult;
57938
+ return taskResult;
57939
+ },
57940
+ [variable.uid, variable.variables, dvResult, wsClient, taskContext, extras]
57941
+ );
57942
+ }
58443
57943
  function _defineProperty(obj, key, value) {
58444
57944
  if (key in obj) {
58445
57945
  Object.defineProperty(obj, key, {
@@ -58784,183 +58284,109 @@ Inferred class string: "${iconClasses}."`
58784
58284
  mixed: mixed$1
58785
58285
  };
58786
58286
  var Refine_index_6 = Refine_index.mixed;
58787
- function getOrRegisterUrlVariable(variable) {
58788
- if (!atomRegistry.has(variable.uid)) {
58789
- atomRegistry.set(
58287
+ const STORE_EXTRAS_MAP$1 = /* @__PURE__ */ new Map();
58288
+ function serverSyncEffect(variable, requestExtras) {
58289
+ STORE_EXTRAS_MAP$1.set(variable.uid, requestExtras);
58290
+ return RecoilSync_index_2({
58291
+ /** Use store uid as the unique identifier */
58292
+ itemKey: variable.uid,
58293
+ refine: Refine_index_6(),
58294
+ storeKey: "ServerVariable"
58295
+ });
58296
+ }
58297
+ const STATE_SYNCHRONIZER = new StateSynchronizer();
58298
+ function getOrRegisterServerVariable(variable, extras) {
58299
+ if (!atomFamilyRegistry.has(variable.uid)) {
58300
+ atomFamilyRegistry.set(
58790
58301
  variable.uid,
58791
- Recoil_index_8({
58792
- default: variable.default,
58793
- effects: [
58794
- RecoilSync_index_6({
58795
- history: "push",
58796
- itemKey: variable.query,
58797
- refine: Refine_index_6()
58798
- })
58799
- ],
58302
+ Recoil_index_10({
58303
+ // NOTE: No default provided, atom starts in a pending state
58304
+ effects: (extrasSerializable2) => {
58305
+ const familySync = ({ onSet, setSelf, resetSelf, node }) => {
58306
+ if (!STATE_SYNCHRONIZER.isRegistered(variable.uid)) {
58307
+ STATE_SYNCHRONIZER.register(variable.uid, null);
58308
+ } else {
58309
+ const currentState = STATE_SYNCHRONIZER.getCurrentState(variable.uid);
58310
+ if (currentState?.type !== "initial") {
58311
+ setSelf(currentState?.value);
58312
+ }
58313
+ }
58314
+ const unsub = STATE_SYNCHRONIZER.subscribe(variable.uid, (update) => {
58315
+ if (update.type === "initial") {
58316
+ return;
58317
+ }
58318
+ if (update.nodeKey === node.key) {
58319
+ return;
58320
+ }
58321
+ if (update.isReset) {
58322
+ resetSelf();
58323
+ } else {
58324
+ setSelf(update.value);
58325
+ }
58326
+ });
58327
+ onSet((newValue, oldValue, isReset) => {
58328
+ STATE_SYNCHRONIZER.notify(variable.uid, {
58329
+ isReset,
58330
+ nodeKey: node.key,
58331
+ oldValue,
58332
+ type: "update",
58333
+ value: newValue
58334
+ });
58335
+ });
58336
+ return unsub;
58337
+ };
58338
+ return [familySync, serverSyncEffect(variable, extrasSerializable2)];
58339
+ },
58800
58340
  key: variable.uid
58801
58341
  })
58802
58342
  );
58803
58343
  }
58804
- return atomRegistry.get(variable.uid);
58805
- }
58806
- function useUrlVariable(variable) {
58807
- return Recoil_index_22(getOrRegisterUrlVariable(variable));
58808
- }
58809
- function combineFilters(combinator, queries) {
58810
- const validQueries = queries.filter(Boolean);
58811
- if (validQueries.length === 0) {
58812
- return null;
58813
- }
58814
- if (validQueries.length === 1) {
58815
- return validQueries[0];
58344
+ const family = atomFamilyRegistry.get(variable.uid);
58345
+ const extrasSerializable = new RequestExtrasSerializable(extras);
58346
+ const atomInstance = family(extrasSerializable);
58347
+ if (!atomFamilyMembersRegistry.has(family)) {
58348
+ atomFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
58816
58349
  }
58817
- return {
58818
- clauses: validQueries,
58819
- combinator
58820
- };
58350
+ atomFamilyMembersRegistry.get(family).set(extrasSerializable.toJSON(), atomInstance);
58351
+ return atomInstance;
58821
58352
  }
58822
- function resolveDataVariable(variable) {
58353
+ async function resolveServerVariable(variable, extras, resolver) {
58354
+ const atom2 = getOrRegisterServerVariable(variable, extras);
58355
+ const seqNumber = await resolver(atom2);
58823
58356
  return {
58824
- filters: variable.filters,
58825
- type: "data",
58826
- uid: variable.uid
58357
+ type: "server",
58358
+ uid: variable.uid,
58359
+ sequence_number: seqNumber
58827
58360
  };
58828
58361
  }
58829
- function createDataUrl(path, pagination) {
58830
- const url = new URL(path, window.location.origin);
58831
- if (pagination?.limit) {
58832
- url.searchParams.set("limit", String(pagination.limit));
58833
- }
58834
- if (pagination?.offset) {
58835
- url.searchParams.set("offset", String(pagination.offset));
58836
- }
58837
- if (pagination?.sort) {
58838
- url.searchParams.set("order_by", (pagination.sort.desc ? "-" : "") + pagination.sort.id);
58839
- }
58840
- if (pagination?.index) {
58841
- url.searchParams.set("index", String(pagination.index));
58842
- }
58843
- return url;
58844
- }
58845
- async function fetchDataVariable(uid2, extras, filters, pagination) {
58846
- const url = createDataUrl(`/api/core/data-variable/${uid2}`, pagination);
58847
- const response = await request(url, { body: JSON.stringify({ filters }), method: HTTP_METHOD.POST }, extras);
58848
- await handleAuthErrors(response, true);
58849
- await validateResponse(response, "Failed to fetch data variable");
58850
- return response.json();
58851
- }
58852
- async function fetchDerivedDataVariable(uid2, extras, cacheKey, wsChannel, filters, pagination) {
58853
- const url = createDataUrl(`/api/core/data-variable/${uid2}`, pagination);
58854
- const response = await request(
58855
- url,
58856
- { body: JSON.stringify({ cache_key: cacheKey, filters, ws_channel: wsChannel }), method: HTTP_METHOD.POST },
58857
- extras
58858
- );
58859
- await handleAuthErrors(response, true);
58860
- await validateResponse(response, "Failed to fetch data variable");
58861
- return response.json();
58862
- }
58863
- async function fetchDataVariableCount(uid2, extras, filters, cacheKey) {
58864
- const response = await request(
58865
- `/api/core/data-variable/${uid2}/count`,
58866
- { body: JSON.stringify({ cache_key: cacheKey, filters }), method: HTTP_METHOD.POST },
58867
- extras
58868
- );
58869
- await handleAuthErrors(response, true);
58870
- await validateResponse(response, "Failed to fetch data variable total count");
58871
- return response.json();
58872
- }
58873
- async function fetchDataVariableSchema(uid2, extras, cacheKey) {
58874
- const queryString = cacheKey ? new URLSearchParams({ cache_key: cacheKey }).toString() : "";
58875
- const response = await request(
58876
- `/api/core/data-variable/${uid2}/schema?${queryString}`,
58877
- { method: HTTP_METHOD.GET },
58878
- extras
58879
- );
58880
- await handleAuthErrors(response, true);
58881
- await validateResponse(response, "Failed to fetch data variable schema");
58882
- return response.json();
58883
- }
58884
- function useFetchDataVariable(variable, serverTriggerCounter) {
58885
- const eventBus = useEventBus();
58886
- const extras = useRequestExtras();
58887
- const dataCallback = React$1.useCallback(
58888
- async (filters, pagination, options) => {
58889
- const mergedFilters = combineFilters("AND", [variable.filters, filters]);
58890
- const data = await fetchDataVariable(variable.uid, extras, mergedFilters, pagination);
58891
- const [totalCount, schema = null] = await Promise.all([
58892
- fetchDataVariableCount(variable.uid, extras, mergedFilters),
58893
- ...options?.schema ? [fetchDataVariableSchema(variable.uid, extras)] : []
58894
- ]);
58895
- eventBus.publish("DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
58896
- return {
58897
- data,
58898
- totalCount,
58899
- ...schema !== null && { schema }
58900
- };
58901
- },
58902
- [variable, extras, serverTriggerCounter, eventBus]
58903
- );
58904
- return dataCallback;
58905
- }
58906
- function useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValuePromise) {
58907
- const eventBus = useEventBus();
58908
- const extras = useRequestExtras();
58909
- const previousResult = React$1.useRef({ data: null, totalCount: 0, schema: { fields: [], primaryKey: [] } });
58910
- const dataCallback = React$1.useCallback(
58911
- async (filters, pagination, options) => {
58912
- const mergedFilters = combineFilters("AND", [variable.filters, filters]);
58913
- const dvValue = await dvValuePromise;
58914
- const response = await fetchDerivedDataVariable(
58915
- variable.uid,
58916
- extras,
58917
- dvValue.cache_key,
58918
- await wsClient.getChannel(),
58919
- mergedFilters,
58920
- pagination
58921
- );
58922
- let data = null;
58923
- const variableTaskId = `${variable.uid}-filter`;
58924
- taskContext.cleanupRunningTasks(variableTaskId);
58925
- if (response && "task_id" in response) {
58926
- const taskId = response.task_id;
58927
- taskContext.startTask(taskId, variableTaskId);
58928
- try {
58929
- await wsClient.waitForTask(taskId);
58930
- } catch {
58931
- eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: null });
58932
- return previousResult.current;
58933
- } finally {
58934
- taskContext.endTask(taskId);
58935
- }
58936
- data = await fetchTaskResult(taskId, extras);
58937
- } else {
58938
- data = response;
58939
- }
58940
- const [totalCount, schema = null] = await Promise.all([
58941
- fetchDataVariableCount(variable.uid, extras, mergedFilters, dvValue.cache_key),
58942
- ...options?.schema ? [fetchDataVariableSchema(variable.uid, extras, dvValue.cache_key)] : []
58943
- ]);
58944
- previousResult.current = {
58945
- data,
58946
- totalCount,
58947
- ...schema !== null && { schema }
58948
- };
58949
- eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
58950
- return {
58951
- data,
58952
- totalCount,
58953
- ...schema !== null && { schema }
58362
+ function ServerVariableSyncProvider({ children }) {
58363
+ const { client: client2 } = React$1.useContext(websocketCtx);
58364
+ const getStoreValue = React$1.useCallback(async (itemKey) => {
58365
+ const serializableExtras = STORE_EXTRAS_MAP$1.get(itemKey);
58366
+ const response = await request(
58367
+ `/api/core/server-variable/${itemKey}/sequence`,
58368
+ serializableExtras?.extras ?? {}
58369
+ );
58370
+ await handleAuthErrors(response, true);
58371
+ await validateResponse(response, `Failed to fetch the sequence number for key: ${itemKey}`);
58372
+ const { sequence_number } = await response.json();
58373
+ return sequence_number;
58374
+ }, []);
58375
+ const listenToStoreChanges = React$1.useCallback(
58376
+ ({ updateItem }) => {
58377
+ if (!client2) {
58378
+ return;
58379
+ }
58380
+ const valueSub = client2.serverVariableMessages$().subscribe((message) => {
58381
+ updateItem(message.uid, message.sequence_number);
58382
+ });
58383
+ return () => {
58384
+ valueSub.unsubscribe();
58954
58385
  };
58955
58386
  },
58956
- [variable, extras, dvValuePromise, eventBus]
58387
+ [client2]
58957
58388
  );
58958
- return dataCallback;
58959
- }
58960
- function registerDataVariable(variable) {
58961
- if (!atomRegistry.has(variable.uid)) {
58962
- atomRegistry.set(variable.uid, Recoil_index_8({ default: true, key: variable.uid }));
58963
- }
58389
+ return /* @__PURE__ */ React$1.createElement(RecoilSync_index_1, { listen: listenToStoreChanges, read: getStoreValue, storeKey: "ServerVariable" }, children);
58964
58390
  }
58965
58391
  var set_1;
58966
58392
  var hasRequiredSet;
@@ -58992,50 +58418,11 @@ Inferred class string: "${iconClasses}."`
58992
58418
  }
58993
58419
  return atomRegistry.get(triggerKey);
58994
58420
  }
58995
- function getOrRegisterDataVariableTrigger(variable, wsClient) {
58996
- const key = `${variable.uid}-data`;
58997
- if (!dataRegistry.has(key)) {
58998
- dataRegistry.set(
58999
- key,
59000
- Recoil_index_8({
59001
- default: {
59002
- force_key: null,
59003
- inc: 0
59004
- },
59005
- effects: [
59006
- // synchronize with server triggers - increment when the variable is triggered on the server side
59007
- // In the DataVariable case we always force so new key is generated
59008
- ({ setSelf }) => {
59009
- const subscription = wsClient.serverTriggers$(variable.uid).subscribe(() => {
59010
- setSelf((v) => {
59011
- if (typeof v === "object" && "inc" in v) {
59012
- return {
59013
- force_key: nanoid(),
59014
- inc: v.inc + 1
59015
- };
59016
- }
59017
- return {
59018
- force_key: nanoid(),
59019
- inc: 1
59020
- };
59021
- });
59022
- });
59023
- return () => {
59024
- subscription?.unsubscribe();
59025
- };
59026
- }
59027
- ],
59028
- key
59029
- })
59030
- );
59031
- }
59032
- return dataRegistry.get(key);
59033
- }
59034
58421
  function buildTriggerList(variables) {
59035
58422
  const triggers = [];
59036
58423
  function walk(vars, path) {
59037
58424
  for (const [idx, variable] of vars.entries()) {
59038
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
58425
+ if (isDerivedVariable(variable)) {
59039
58426
  const varPath = [...path, String(idx)];
59040
58427
  triggers.push({
59041
58428
  path: varPath,
@@ -59043,27 +58430,17 @@ Inferred class string: "${iconClasses}."`
59043
58430
  });
59044
58431
  walk(variable.variables, [...varPath, "values"]);
59045
58432
  }
59046
- if (isDataVariable(variable)) {
59047
- triggers.push({
59048
- path: path.length > 0 ? path.slice(0, -1) : [],
59049
- variable
59050
- });
59051
- }
59052
58433
  }
59053
58434
  }
59054
58435
  walk(variables, []);
59055
58436
  return triggers;
59056
58437
  }
59057
- function registerChildTriggers(triggerList, wsClient, registerFunc = Recoil_index_20) {
58438
+ function registerChildTriggers(triggerList, registerFunc = Recoil_index_20) {
59058
58439
  return triggerList.map((triggerInfo) => {
59059
- if (isDerivedVariable(triggerInfo.variable) || isDerivedDataVariable(triggerInfo.variable)) {
58440
+ if (isDerivedVariable(triggerInfo.variable)) {
59060
58441
  const triggerIndex = getOrRegisterTrigger(triggerInfo.variable);
59061
58442
  return registerFunc(triggerIndex);
59062
58443
  }
59063
- if (isDataVariable(triggerInfo.variable)) {
59064
- const serverTrigger = getOrRegisterDataVariableTrigger(triggerInfo.variable, wsClient);
59065
- return registerFunc(serverTrigger);
59066
- }
59067
58444
  throw new Error("Invalid trigger variable type");
59068
58445
  });
59069
58446
  }
@@ -59076,8 +58453,7 @@ Inferred class string: "${iconClasses}."`
59076
58453
  force_key,
59077
58454
  variableUid,
59078
58455
  values,
59079
- wsClient,
59080
- is_data_variable = false
58456
+ wsClient
59081
58457
  }) {
59082
58458
  const cacheControl = cache2 === null ? {
59083
58459
  "cache-control": "none"
@@ -59086,7 +58462,7 @@ Inferred class string: "${iconClasses}."`
59086
58462
  const res = await request(
59087
58463
  `/api/core/derived-variable/${variableUid}`,
59088
58464
  {
59089
- body: JSON.stringify({ is_data_variable, values, ws_channel, force_key: force_key ?? null }),
58465
+ body: JSON.stringify({ values, ws_channel, force_key: force_key ?? null }),
59090
58466
  headers: { ...cacheControl },
59091
58467
  method: HTTP_METHOD.POST
59092
58468
  },
@@ -59105,8 +58481,7 @@ Inferred class string: "${iconClasses}."`
59105
58481
  wsClient,
59106
58482
  extras,
59107
58483
  cache: cache2,
59108
- force_key,
59109
- is_data_variable = false
58484
+ force_key
59110
58485
  }) {
59111
58486
  if (!debouncedFetchSubjects[selectorKey]) {
59112
58487
  debouncedFetchSubjects[selectorKey] = new BehaviorSubject(null);
@@ -59121,7 +58496,6 @@ Inferred class string: "${iconClasses}."`
59121
58496
  cache: cache2,
59122
58497
  extras,
59123
58498
  force_key,
59124
- is_data_variable,
59125
58499
  selectorKey,
59126
58500
  values,
59127
58501
  variableUid,
@@ -59132,7 +58506,7 @@ Inferred class string: "${iconClasses}."`
59132
58506
  });
59133
58507
  }
59134
58508
  function resolveValue(value, getter) {
59135
- if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
58509
+ if (isResolvedDerivedVariable(value)) {
59136
58510
  const resolvedValues = value.values.map((v) => resolveValue(v, getter));
59137
58511
  return {
59138
58512
  ...value,
@@ -59147,8 +58521,11 @@ Inferred class string: "${iconClasses}."`
59147
58521
  default: resolveValue(value.default, getter)
59148
58522
  };
59149
58523
  }
59150
- if (isResolvedDataVariable(value)) {
59151
- return value;
58524
+ if (isResolvedServerVariable(value)) {
58525
+ return {
58526
+ ...value,
58527
+ sequence_number: Recoil_index_2(value.sequence_number) ? getter(value.sequence_number) : value.sequence_number
58528
+ };
59152
58529
  }
59153
58530
  if (isCondition(value)) {
59154
58531
  return {
@@ -59167,9 +58544,12 @@ Inferred class string: "${iconClasses}."`
59167
58544
  if (deps && !deps.includes(idx)) {
59168
58545
  return [];
59169
58546
  }
59170
- if (isResolvedDerivedVariable(val) || isResolvedDerivedDataVariable(val)) {
58547
+ if (isResolvedDerivedVariable(val)) {
59171
58548
  return getDeps(val.values, val.deps).flat();
59172
58549
  }
58550
+ if (isResolvedServerVariable(val)) {
58551
+ return val.sequence_number;
58552
+ }
59173
58553
  if (isResolvedSwitchVariable(val)) {
59174
58554
  return getDeps([val.value, val.value_map, val.default], [0, 1, 2]).flat();
59175
58555
  }
@@ -59179,9 +58559,9 @@ Inferred class string: "${iconClasses}."`
59179
58559
  function useTriggerIndex(variable) {
59180
58560
  return Recoil_index_20(getOrRegisterTrigger(variable));
59181
58561
  }
59182
- function resolveDerivedValue(key, variables, deps, resolvedVariables, wsClient, get, selfTrigger) {
58562
+ function resolveDerivedValue(key, variables, deps, resolvedVariables, get, selfTrigger) {
59183
58563
  const triggerList = buildTriggerList(variables);
59184
- const triggers = registerChildTriggers(triggerList, wsClient, get);
58564
+ const triggers = registerChildTriggers(triggerList, get);
59185
58565
  if (selfTrigger) {
59186
58566
  triggers.unshift(selfTrigger);
59187
58567
  }
@@ -59200,7 +58580,9 @@ Inferred class string: "${iconClasses}."`
59200
58580
  if (areArgsTheSame) {
59201
58581
  return {
59202
58582
  entry: previousEntry,
59203
- type: "previous"
58583
+ type: "previous",
58584
+ values,
58585
+ depsKey: key
59204
58586
  };
59205
58587
  }
59206
58588
  const previousTriggerCounters = previousEntry.args.slice(
@@ -59227,18 +58609,20 @@ Inferred class string: "${iconClasses}."`
59227
58609
  relevantValues,
59228
58610
  selfTriggerForceKey,
59229
58611
  type: "current",
59230
- values
58612
+ values,
58613
+ depsKey: key
59231
58614
  };
59232
58615
  }
59233
58616
  return {
59234
58617
  relevantValues,
59235
58618
  selfTriggerForceKey: null,
59236
58619
  type: "current",
59237
- values
58620
+ values,
58621
+ depsKey: key
59238
58622
  };
59239
58623
  }
59240
- function getOrRegisterDerivedVariable(variable, wsClient, taskContext, currentExtras) {
59241
- const key = getRegistryKey(variable, "selector");
58624
+ function getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, currentExtras) {
58625
+ const key = getRegistryKey(variable, "result-selector");
59242
58626
  if (!selectorFamilyRegistry.has(key)) {
59243
58627
  getOrRegisterTrigger(variable);
59244
58628
  selectorFamilyRegistry.set(
@@ -59248,34 +58632,68 @@ Inferred class string: "${iconClasses}."`
59248
58632
  eviction: "most-recent"
59249
58633
  },
59250
58634
  get: (extrasSerializable) => async ({ get }) => {
59251
- const resolvedVariables = variable.variables.map((v) => {
59252
- if (!isVariable(v)) {
59253
- return v;
59254
- }
59255
- return resolveVariable(v, wsClient, taskContext, currentExtras);
59256
- });
58635
+ const resolvedVariables = await Promise.all(
58636
+ variable.variables.map(async (v) => {
58637
+ if (!isVariable(v)) {
58638
+ return Promise.resolve(v);
58639
+ }
58640
+ return resolveVariable(v, wsClient, taskContext, currentExtras);
58641
+ })
58642
+ );
59257
58643
  const selfTrigger = get(getOrRegisterTrigger(variable));
59258
- const { extras } = extrasSerializable;
59259
58644
  const selectorKey = key + extrasSerializable.toJSON();
59260
58645
  const derivedResult = resolveDerivedValue(
59261
58646
  selectorKey,
59262
58647
  variable.variables,
59263
58648
  variable.deps,
59264
58649
  resolvedVariables,
59265
- wsClient,
59266
58650
  get,
59267
58651
  selfTrigger
59268
58652
  );
58653
+ return derivedResult;
58654
+ },
58655
+ key: nanoid()
58656
+ })
58657
+ );
58658
+ }
58659
+ const family = selectorFamilyRegistry.get(key);
58660
+ const serializableExtras = new RequestExtrasSerializable(currentExtras);
58661
+ const selectorInstance = family(serializableExtras);
58662
+ if (!selectorFamilyMembersRegistry.has(family)) {
58663
+ selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
58664
+ }
58665
+ selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
58666
+ return selectorInstance;
58667
+ }
58668
+ function getOrRegisterDerivedVariable(variable, wsClient, taskContext, currentExtras) {
58669
+ const key = getRegistryKey(variable, "selector");
58670
+ if (!selectorFamilyRegistry.has(key)) {
58671
+ getOrRegisterTrigger(variable);
58672
+ selectorFamilyRegistry.set(
58673
+ key,
58674
+ Recoil_index_11({
58675
+ cachePolicy_UNSTABLE: {
58676
+ eviction: "most-recent"
58677
+ },
58678
+ get: (extrasSerializable) => async ({ get }) => {
58679
+ const selectorKey = key + extrasSerializable.toJSON();
58680
+ const dvResultSelector = getOrRegisterDerivedVariableResult(
58681
+ variable,
58682
+ wsClient,
58683
+ taskContext,
58684
+ extrasSerializable.extras
58685
+ );
58686
+ const derivedResult = get(dvResultSelector);
59269
58687
  if (derivedResult.type === "previous") {
59270
58688
  return { cache_key: derivedResult.entry.cacheKey, value: derivedResult.entry.result };
59271
58689
  }
58690
+ const { extras } = extrasSerializable;
59272
58691
  let variableResponse = null;
59273
58692
  try {
59274
58693
  variableResponse = await debouncedFetchDerivedVariable({
59275
58694
  cache: variable.cache,
59276
58695
  extras,
59277
58696
  force_key: derivedResult.selfTriggerForceKey,
59278
- is_data_variable: isDerivedDataVariable(variable),
59279
58697
  selectorKey,
59280
58698
  values: normalizeRequest(cleanArgs(derivedResult.values), variable.variables),
59281
58699
  variableUid: variable.uid,
@@ -59288,34 +58706,37 @@ Inferred class string: "${iconClasses}."`
59288
58706
  }
59289
58707
  const cacheKey = variableResponse.cache_key;
59290
58708
  let variableValue = null;
59291
- if (isDerivedVariable(variable)) {
59292
- taskContext.cleanupRunningTasks(variable.uid);
59293
- if (isTaskResponse$1(variableResponse)) {
59294
- const taskId = variableResponse.task_id;
59295
- taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, "trigger"));
59296
- try {
59297
- await wsClient.waitForTask(taskId);
59298
- } catch {
59299
- return {
59300
- cache_key: cacheKey,
59301
- value: null
59302
- };
59303
- } finally {
59304
- taskContext.endTask(taskId);
59305
- }
59306
- try {
59307
- variableValue = await fetchTaskResult(taskId, extras);
59308
- } catch (e2) {
58709
+ taskContext.cleanupRunningTasks(variable.uid);
58710
+ if (isTaskResponse$1(variableResponse)) {
58711
+ const taskId = variableResponse.task_id;
58712
+ taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, "trigger"));
58713
+ try {
58714
+ await wsClient.waitForTask(taskId);
58715
+ } catch (e2) {
58716
+ if (e2 instanceof TaskError) {
59309
58717
  e2.selectorId = key;
59310
58718
  e2.selectorExtras = extrasSerializable.toJSON();
59311
58719
  throw e2;
59312
58720
  }
59313
- } else {
59314
- variableValue = variableResponse.value;
58721
+ return {
58722
+ cache_key: cacheKey,
58723
+ value: null
58724
+ };
58725
+ } finally {
58726
+ taskContext.endTask(taskId);
58727
+ }
58728
+ try {
58729
+ variableValue = await fetchTaskResult(taskId, extras);
58730
+ } catch (e2) {
58731
+ e2.selectorId = key;
58732
+ e2.selectorExtras = extrasSerializable.toJSON();
58733
+ throw e2;
59315
58734
  }
58735
+ } else {
58736
+ variableValue = variableResponse.value;
59316
58737
  }
59317
58738
  variableValue = "nested" in variable ? resolveNested(variableValue, variable.nested) : variableValue;
59318
- depsRegistry.set(selectorKey, {
58739
+ depsRegistry.set(derivedResult.depsKey, {
59319
58740
  args: derivedResult.relevantValues,
59320
58741
  cacheKey,
59321
58742
  result: variableValue
@@ -59427,20 +58848,13 @@ Inferred class string: "${iconClasses}."`
59427
58848
  cloned[key] = nested.length === 1 ? newValue : setNested(cloned[key], nested.slice(1), newValue);
59428
58849
  return cloned;
59429
58850
  }
59430
- function resolveVariable(variable, client2, taskContext, extras, resolver = (val) => val) {
59431
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
58851
+ async function resolveVariable(variable, client2, taskContext, extras, resolver = (state) => Promise.resolve(state)) {
58852
+ if (isDerivedVariable(variable)) {
59432
58853
  getOrRegisterDerivedVariable(variable, client2, taskContext, extras);
59433
- const values = variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver));
58854
+ const values = await Promise.all(
58855
+ variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver))
58856
+ );
59434
58857
  const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
59435
- if (isDerivedDataVariable(variable)) {
59436
- return {
59437
- deps,
59438
- filters: variable.filters,
59439
- type: "derived-data",
59440
- uid: variable.uid,
59441
- values
59442
- };
59443
- }
59444
58858
  return {
59445
58859
  deps,
59446
58860
  type: "derived",
@@ -59448,22 +58862,20 @@ Inferred class string: "${iconClasses}."`
59448
58862
  values
59449
58863
  };
59450
58864
  }
59451
- if (isDataVariable(variable)) {
59452
- return resolveDataVariable(variable);
59453
- }
59454
- if (isUrlVariable(variable)) {
59455
- return resolver(getOrRegisterUrlVariable(variable));
58865
+ if (isServerVariable(variable)) {
58866
+ getOrRegisterServerVariable(variable, extras);
58867
+ return resolveServerVariable(variable, extras, resolver);
59456
58868
  }
59457
58869
  if (isSwitchVariable(variable)) {
59458
- let resolvedValue = isVariable(variable.value) ? resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
58870
+ let resolvedValue = isVariable(variable.value) ? await resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
59459
58871
  if (isCondition(resolvedValue)) {
59460
58872
  resolvedValue = {
59461
58873
  ...resolvedValue,
59462
- variable: resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
58874
+ variable: await resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
59463
58875
  };
59464
58876
  }
59465
- const resolvedValueMap = isVariable(variable.value_map) ? resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
59466
- const resolvedDefault = isVariable(variable.default) ? resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
58877
+ const resolvedValueMap = isVariable(variable.value_map) ? await resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
58878
+ const resolvedDefault = isVariable(variable.default) ? await resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
59467
58879
  return {
59468
58880
  type: "switch",
59469
58881
  uid: variable.uid,
@@ -59472,10 +58884,13 @@ Inferred class string: "${iconClasses}."`
59472
58884
  default: resolvedDefault
59473
58885
  };
59474
58886
  }
58887
+ if (isStateVariable(variable)) {
58888
+ throw new Error("StateVariable should not be resolved - it should be handled by useVariable hook");
58889
+ }
59475
58890
  return resolver(getOrRegisterPlainVariable(variable, client2, taskContext, extras));
59476
58891
  }
59477
58892
  function cleanValue(value, forceKeyOverride) {
59478
- if (isResolvedDerivedVariable(value) || isResolvedDerivedDataVariable(value)) {
58893
+ if (isResolvedDerivedVariable(value)) {
59479
58894
  const { deps, ...rest } = value;
59480
58895
  const cleanedValues = value.values.map((v) => cleanValue(v));
59481
58896
  return {
@@ -60383,19 +59798,27 @@ Inferred class string: "${iconClasses}."`
60383
59798
  storeKey: "BrowserStore"
60384
59799
  });
60385
59800
  }
59801
+ function urlEffect(variable) {
59802
+ return RecoilSync_index_6({
59803
+ history: "push",
59804
+ itemKey: variable.store.query,
59805
+ refine: Refine_index_6()
59806
+ });
59807
+ }
60386
59808
  const STORES = {
60387
59809
  BackendStore: {
60388
- effect: backendStoreEffect,
60389
- sync: BackendStoreSync
59810
+ effect: backendStoreEffect
60390
59811
  },
60391
59812
  BrowserStore: {
60392
- effect: localStorageEffect,
60393
- sync: BrowserStoreSync
59813
+ effect: localStorageEffect
59814
+ },
59815
+ QueryParamStore: {
59816
+ effect: urlEffect
60394
59817
  }
60395
59818
  };
60396
59819
  function getEffect(variable) {
60397
59820
  const storeName = variable.store?.__typename;
60398
- if (!storeName) {
59821
+ if (!storeName || !(storeName in STORES)) {
60399
59822
  return null;
60400
59823
  }
60401
59824
  return STORES[storeName]?.effect ?? null;
@@ -60427,25 +59850,290 @@ Inferred class string: "${iconClasses}."`
60427
59850
  }
60428
59851
  throw new Error(`Unexpected operator ${String(operator)} passed to conditional (If) component`);
60429
59852
  }
60430
- function useConditionOrVariable(arg) {
59853
+ function useConditionOrVariable(arg, opts = {}) {
60431
59854
  if (isCondition(arg)) {
60432
- const value = useVariable(arg.variable)[0];
60433
- const other = useVariable(arg.other)[0];
59855
+ const value = useVariable(arg.variable, opts)[0];
59856
+ const other = useVariable(arg.other, opts)[0];
60434
59857
  return isConditionTrue(arg.operator, value, other);
60435
59858
  }
60436
- return useVariable(arg)[0];
59859
+ return useVariable(arg, opts)[0];
60437
59860
  }
60438
59861
  function useSwitchVariable(variable) {
60439
- const value = useConditionOrVariable(variable.value);
60440
- const [valueMap] = useVariable(variable.value_map);
60441
- const [defaultValue] = useVariable(variable.default);
59862
+ const value = useConditionOrVariable(variable.value, { suspend: false });
59863
+ const [valueMap] = useVariable(variable.value_map, { suspend: false });
59864
+ const [defaultValue] = useVariable(variable.default, { suspend: false });
60442
59865
  const lookupKey = String(value);
60443
59866
  return valueMap[lookupKey] ?? defaultValue;
60444
59867
  }
59868
+ const COLUMN_PREFIX_REGEX = /__(?:col|index)__\d+__/;
59869
+ function combineFilters(combinator, queries) {
59870
+ const validQueries = queries.filter((x) => x !== null && x !== void 0);
59871
+ if (validQueries.length === 0) {
59872
+ return null;
59873
+ }
59874
+ if (validQueries.length === 1) {
59875
+ return validQueries[0];
59876
+ }
59877
+ return {
59878
+ clauses: validQueries,
59879
+ combinator
59880
+ };
59881
+ }
59882
+ function inferColumnType(value, hint) {
59883
+ if (typeof value === "number") {
59884
+ return "numerical";
59885
+ }
59886
+ if (typeof value === "string") {
59887
+ return "categorical";
59888
+ }
59889
+ if (value instanceof Date) {
59890
+ return "datetime";
59891
+ }
59892
+ return "categorical";
59893
+ }
59894
+ function filterRow(row, column, operator, value, columnHints) {
59895
+ const cellValue = row[column];
59896
+ if (operator === "CONTAINS") {
59897
+ return String(cellValue).toLowerCase().includes(String(value).toLowerCase());
59898
+ }
59899
+ const colType = inferColumnType(cellValue);
59900
+ try {
59901
+ let processedValue = value;
59902
+ let processedCellValue = cellValue;
59903
+ if (Array.isArray(value)) {
59904
+ return value.includes(cellValue);
59905
+ }
59906
+ if (colType === "datetime") {
59907
+ if (Array.isArray(value)) {
59908
+ processedValue = value.map((v) => new Date(v).getTime());
59909
+ } else {
59910
+ processedValue = new Date(value).getTime();
59911
+ }
59912
+ if (typeof cellValue === "number") {
59913
+ processedCellValue = cellValue;
59914
+ } else if (cellValue instanceof Date) {
59915
+ processedCellValue = cellValue.getTime();
59916
+ } else if (typeof cellValue === "string") {
59917
+ processedCellValue = parseISO$1(cellValue).getTime();
59918
+ } else {
59919
+ processedCellValue = 0;
59920
+ }
59921
+ } else if (colType === "categorical") {
59922
+ processedValue = String(value);
59923
+ processedCellValue = String(cellValue);
59924
+ } else if (colType === "numerical") {
59925
+ if (Array.isArray(value)) {
59926
+ processedValue = value.map((v) => {
59927
+ const num = Number(v);
59928
+ return Number.isNaN(num) ? 0 : num;
59929
+ });
59930
+ } else {
59931
+ const num = Number(value);
59932
+ processedValue = Number.isNaN(num) ? 0 : num;
59933
+ }
59934
+ const cellNum = Number(cellValue);
59935
+ processedCellValue = Number.isNaN(cellNum) ? 0 : cellNum;
59936
+ }
59937
+ switch (operator) {
59938
+ case "GT":
59939
+ return processedCellValue > processedValue;
59940
+ case "LT":
59941
+ return processedCellValue < processedValue;
59942
+ case "NE":
59943
+ return processedCellValue !== processedValue;
59944
+ case "BT":
59945
+ if (Array.isArray(processedValue) && processedValue.length === 2) {
59946
+ return processedCellValue >= processedValue[0] && processedCellValue <= processedValue[1];
59947
+ }
59948
+ return false;
59949
+ case "EQ":
59950
+ default:
59951
+ return processedCellValue === processedValue;
59952
+ }
59953
+ } catch (error) {
59954
+ console.warn("Filter error:", error, { column, value, operator });
59955
+ return true;
59956
+ }
59957
+ }
59958
+ function resolveFilterQuery(row, query, columnHints) {
59959
+ if ("column" in query) {
59960
+ const cleanColumn = query.column.replace(COLUMN_PREFIX_REGEX, "");
59961
+ return filterRow(row, cleanColumn, query.operator, query.value);
59962
+ }
59963
+ const results = query.clauses.map((clause) => resolveFilterQuery(row, clause));
59964
+ if (query.combinator === "AND") {
59965
+ return results.every((result) => result);
59966
+ }
59967
+ if (query.combinator === "OR") {
59968
+ return results.some((result) => result);
59969
+ }
59970
+ return true;
59971
+ }
59972
+ function applyFilters(data, filters, pagination, columnHints) {
59973
+ if (!data || data.length === 0) {
59974
+ return { data: [], count: 0, schema: null };
59975
+ }
59976
+ let filteredData = data;
59977
+ if (filters) {
59978
+ filteredData = data.filter((row) => resolveFilterQuery(row, filters));
59979
+ }
59980
+ const totalCount = filteredData.length;
59981
+ if (pagination) {
59982
+ if (pagination.index !== void 0) {
59983
+ const targetRow = data[pagination.index];
59984
+ return {
59985
+ data: targetRow ? [targetRow] : [],
59986
+ count: totalCount,
59987
+ schema: null
59988
+ };
59989
+ }
59990
+ if (pagination.sort) {
59991
+ const { id, desc } = pagination.sort;
59992
+ filteredData = [...filteredData].sort((a2, b2) => {
59993
+ const aVal = a2[id];
59994
+ const bVal = b2[id];
59995
+ if (aVal == null && bVal == null) {
59996
+ return 0;
59997
+ }
59998
+ if (aVal == null) {
59999
+ return desc ? 1 : -1;
60000
+ }
60001
+ if (bVal == null) {
60002
+ return desc ? -1 : 1;
60003
+ }
60004
+ const colType = inferColumnType(aVal);
60005
+ let comparison = 0;
60006
+ if (colType === "numerical") {
60007
+ comparison = Number(aVal) - Number(bVal);
60008
+ } else if (colType === "datetime") {
60009
+ let aTime = 0;
60010
+ if (typeof aVal === "number") {
60011
+ aTime = aVal;
60012
+ } else if (aVal instanceof Date) {
60013
+ aTime = aVal.getTime();
60014
+ } else if (typeof aVal === "string") {
60015
+ aTime = parseISO$1(aVal).getTime();
60016
+ }
60017
+ let bTime = 0;
60018
+ if (typeof bVal === "number") {
60019
+ bTime = bVal;
60020
+ } else if (bVal instanceof Date) {
60021
+ bTime = bVal.getTime();
60022
+ } else if (typeof bVal === "string") {
60023
+ bTime = parseISO$1(bVal).getTime();
60024
+ }
60025
+ comparison = aTime - bTime;
60026
+ } else {
60027
+ comparison = String(aVal).localeCompare(String(bVal));
60028
+ }
60029
+ return desc ? -comparison : comparison;
60030
+ });
60031
+ }
60032
+ const startIndex = pagination.offset || 0;
60033
+ const endIndex = pagination.limit ? startIndex + pagination.limit : filteredData.length;
60034
+ filteredData = filteredData.slice(startIndex, endIndex);
60035
+ }
60036
+ return {
60037
+ data: filteredData,
60038
+ count: totalCount,
60039
+ schema: null
60040
+ };
60041
+ }
60042
+ const INDEX = "__index__";
60043
+ function appendIndex(df) {
60044
+ if (df.length > 0 && !(INDEX in df[0])) {
60045
+ return df.map((row, i2) => ({ ...row, [INDEX]: i2 }));
60046
+ }
60047
+ return df;
60048
+ }
60049
+ function createFetcher(df) {
60050
+ const data = appendIndex(df);
60051
+ return async (filters, pagination) => {
60052
+ return applyFilters(data, filters, pagination);
60053
+ };
60054
+ }
60055
+ function useTabularVariable(variable) {
60056
+ const extras = useRequestExtras();
60057
+ const { client: wsClient } = React$1.useContext(websocketCtx);
60058
+ if (!isVariable(variable) || isSingleVariable(variable)) {
60059
+ const [data] = useVariable(variable);
60060
+ return React$1.useMemo(() => createFetcher(data), [data]);
60061
+ }
60062
+ const variablesContext = React$1.useContext(variablesCtx);
60063
+ variablesContext?.variables.current.add(variable.uid);
60064
+ React$1.useEffect(() => {
60065
+ return () => {
60066
+ variablesContext?.variables.current.delete(variable.uid);
60067
+ };
60068
+ }, []);
60069
+ if (isServerVariable(variable)) {
60070
+ const serverAtom = getOrRegisterServerVariable(variable, extras);
60071
+ const atomCount = Recoil_index_20(serverAtom);
60072
+ return useFetchTabularServerVariable(variable, atomCount, wsClient, extras);
60073
+ }
60074
+ const taskContext = useTaskContext();
60075
+ const dvResultSelector = getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, extras);
60076
+ const dvResultLoadable = Recoil_index_21(dvResultSelector);
60077
+ const [dvResult, setDvResult] = React$1.useState(() => dvResultLoadable.getValue());
60078
+ React$1.useEffect(() => {
60079
+ if (dvResultLoadable.state === "hasValue") {
60080
+ setDvResult(dvResultLoadable.getValue());
60081
+ }
60082
+ }, [dvResultLoadable]);
60083
+ return useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras);
60084
+ }
60085
+ async function getTabularVariableValue(variable, ctx) {
60086
+ if (!isVariable(variable)) {
60087
+ return variable;
60088
+ }
60089
+ if (isSingleVariable(variable)) {
60090
+ return resolveVariable(
60091
+ variable,
60092
+ ctx.client,
60093
+ ctx.taskContext,
60094
+ ctx.extras,
60095
+ (v) => ctx.snapshot.getLoadable(v).toPromise()
60096
+ );
60097
+ }
60098
+ if (isServerVariable(variable)) {
60099
+ const response2 = await fetchTabularServerVariable({
60100
+ variable,
60101
+ // doesn't matter for fetching, will get up to date anyway
60102
+ seqNumber: 0,
60103
+ wsClient: ctx.client,
60104
+ extras: ctx.extras
60105
+ });
60106
+ return response2.data;
60107
+ }
60108
+ const resolved = await resolveVariable(
60109
+ variable,
60110
+ ctx.client,
60111
+ ctx.taskContext,
60112
+ ctx.extras,
60113
+ (v) => ctx.snapshot.getLoadable(v).toPromise()
60114
+ );
60115
+ const result = await fetchDerivedVariable({
60116
+ cache: variable.cache,
60117
+ extras: ctx.extras,
60118
+ force_key: null,
60119
+ /**
60120
+ * In this case we're not concerned about different selectors fetching the value so just use the uid
60121
+ */
60122
+ selectorKey: resolved.uid,
60123
+ values: normalizeRequest(cleanArgs(resolved.values), variable.variables),
60124
+ variableUid: resolved.uid,
60125
+ wsClient: ctx.client
60126
+ });
60127
+ if (isTaskResponse$1(result)) {
60128
+ throw new UserError("Task DerivedVariables are not supported in this context");
60129
+ }
60130
+ const response = result.value;
60131
+ return response.data;
60132
+ }
60445
60133
  function warnUpdateOnDerivedState() {
60446
60134
  console.warn("You tried to call update on variable with derived state, this is a noop and will be ignored.");
60447
60135
  }
60448
- function useVariable(variable) {
60136
+ function useVariable(variable, opts = { serverVariable: "disallow" }) {
60449
60137
  const extras = useRequestExtras();
60450
60138
  const { client: wsClient } = React$1.useContext(websocketCtx);
60451
60139
  const taskContext = useTaskContext();
@@ -60466,9 +60154,6 @@ Inferred class string: "${iconClasses}."`
60466
60154
  variablesContext?.variables.current.delete(variable.uid);
60467
60155
  };
60468
60156
  }, []);
60469
- if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
60470
- throw new Error(`Non-data variable expected, got ${variable.__typename}`);
60471
- }
60472
60157
  if (isDerivedVariable(variable)) {
60473
60158
  const selector2 = useDerivedVariable(variable, wsClient, taskContext, extras);
60474
60159
  const selectorLoadable = Recoil_index_28(selector2);
@@ -60477,19 +60162,52 @@ Inferred class string: "${iconClasses}."`
60477
60162
  bus.publish("DERIVED_VARIABLE_LOADED", { variable, value: selectorLoadable.contents });
60478
60163
  }
60479
60164
  }, [selectorLoadable]);
60480
- const deferred2 = useDeferLoadable(selectorLoadable);
60165
+ const deferred2 = useDeferLoadable(selectorLoadable, opts.suspend);
60481
60166
  return [deferred2.value, warnUpdateOnDerivedState];
60482
60167
  }
60483
- if (isUrlVariable(variable)) {
60484
- const [urlValue, setUrlValue] = useUrlVariable(variable);
60485
- React$1.useEffect(() => {
60486
- bus.publish("URL_VARIABLE_LOADED", { variable, value: urlValue });
60487
- }, [urlValue]);
60488
- return [urlValue, setUrlValue];
60489
- }
60490
60168
  if (isSwitchVariable(variable)) {
60491
60169
  return [useSwitchVariable(variable), warnUpdateOnDerivedState];
60492
60170
  }
60171
+ if (isStateVariable(variable)) {
60172
+ const parentSelector = useDerivedVariable(variable.parent_variable, wsClient, taskContext, extras);
60173
+ const parentLoadable = Recoil_index_28(parentSelector);
60174
+ let stateValue;
60175
+ switch (variable.property_name) {
60176
+ case "loading":
60177
+ stateValue = parentLoadable.state === "loading";
60178
+ break;
60179
+ case "error":
60180
+ stateValue = parentLoadable.state === "hasError";
60181
+ break;
60182
+ case "hasValue":
60183
+ stateValue = parentLoadable.state === "hasValue";
60184
+ break;
60185
+ default:
60186
+ stateValue = false;
60187
+ }
60188
+ return [stateValue, warnUpdateOnDerivedState];
60189
+ }
60190
+ if (isServerVariable(variable)) {
60191
+ if (opts.serverVariable === "disallow") {
60192
+ throw new UserError("ServerVariable cannot be directly consumed by this component");
60193
+ }
60194
+ const atom2 = React$1.useMemo(() => getOrRegisterServerVariable(variable, extras), [variable, extras]);
60195
+ const [seqNumber] = Recoil_index_22(atom2);
60196
+ const fetcher = useTabularVariable(variable);
60197
+ const { data } = reactQuery.useSuspenseQuery({
60198
+ // use the seq number as a dependency to refetch on changes
60199
+ queryKey: ["use-variable-server-variable", variable.uid, seqNumber],
60200
+ queryFn: async () => {
60201
+ const result = await fetcher(null, {
60202
+ limit: 1,
60203
+ offset: 0
60204
+ });
60205
+ return result.data;
60206
+ },
60207
+ refetchOnWindowFocus: false
60208
+ });
60209
+ return [data?.[0] ?? null, warnUpdateOnDerivedState];
60210
+ }
60493
60211
  const recoilState = getOrRegisterPlainVariable(variable, wsClient, taskContext, extras);
60494
60212
  if (!isDerivedVariable(variable.default)) {
60495
60213
  const [value, setValue] = Recoil_index_22(recoilState);
@@ -60504,7 +60222,7 @@ Inferred class string: "${iconClasses}."`
60504
60222
  bus.publish("PLAIN_VARIABLE_LOADED", { variable, value: loadable.contents });
60505
60223
  }
60506
60224
  }, [loadable]);
60507
- const deferred = useDeferLoadable(loadable);
60225
+ const deferred = useDeferLoadable(loadable, opts.suspend);
60508
60226
  return [deferred, setLoadable];
60509
60227
  }
60510
60228
  function flexStyles(props, displayCtx2, useDisplayContext) {
@@ -60747,24 +60465,18 @@ Inferred class string: "${iconClasses}."`
60747
60465
  return React$1.useMemo(() => ({ get }), [get]);
60748
60466
  }
60749
60467
  async function invokeAction(input, executionId, annotatedAction, actionCtx) {
60750
- const resolvedKwargs = Object.keys(annotatedAction.dynamic_kwargs).reduce(
60751
- (acc, k) => {
60752
- const value = annotatedAction.dynamic_kwargs[k];
60753
- acc[k] = isVariable(value) ? resolveVariable(
60468
+ const resolvedKwargs = await Promise.all(
60469
+ Object.entries(annotatedAction.dynamic_kwargs).map(async ([k, value]) => {
60470
+ const resolvedValue = isVariable(value) ? await resolveVariable(
60754
60471
  value,
60755
60472
  actionCtx.wsClient,
60756
60473
  actionCtx.taskCtx,
60757
60474
  actionCtx.extras,
60758
- (v) => (
60759
- // This is only called for primitive variables so it should always resolve successfully
60760
- // hence not using a promise
60761
- actionCtx.snapshot.getLoadable(v).getValue()
60762
- )
60475
+ (v) => actionCtx.snapshot.getLoadable(v).toPromise()
60763
60476
  ) : value;
60764
- return acc;
60765
- },
60766
- {}
60767
- );
60477
+ return [k, resolvedValue];
60478
+ })
60479
+ ).then((entries) => Object.fromEntries(entries));
60768
60480
  const ws_channel = await actionCtx.wsClient.getChannel();
60769
60481
  const res = await request(
60770
60482
  `/api/core/action/${annotatedAction.definition_uid}`,
@@ -61038,128 +60750,6 @@ Inferred class string: "${iconClasses}."`
61038
60750
  const { login, logout, ...extraRoutes } = authConfig.auth_components;
61039
60751
  return /* @__PURE__ */ React.createElement(Switch$1, null, /* @__PURE__ */ React.createElement(Route, { path: "/login" }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component: login })), /* @__PURE__ */ React.createElement(Route, { path: "/logout" }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component: logout })), Object.entries(extraRoutes).map(([path, component]) => /* @__PURE__ */ React.createElement(Route, { key: path, path: `/${path}` }, /* @__PURE__ */ React.createElement(DynamicAuthComponent, { component }))), /* @__PURE__ */ React.createElement(Route, { component: ErrorPage, path: "/error" }), /* @__PURE__ */ React.createElement(Route, { path: "/", render: () => /* @__PURE__ */ React.createElement(PrivateRoute, null, props.children) }));
61040
60752
  }
61041
- function useDataVariable(variable) {
61042
- const extras = useRequestExtras();
61043
- const { client: wsClient } = React$1.useContext(websocketCtx);
61044
- if (isDataVariable(variable)) {
61045
- registerDataVariable(variable);
61046
- const serverTriggers$ = React$1.useMemo(() => wsClient.serverTriggers$(variable.uid), []);
61047
- const [serverTriggerCounter, setServerTriggerCounter] = React$1.useState(0);
61048
- React$1.useEffect(() => {
61049
- const sub = serverTriggers$.subscribe(() => setServerTriggerCounter((c) => c + 1));
61050
- return () => sub.unsubscribe();
61051
- }, [serverTriggers$]);
61052
- const fetchDataVariable2 = useFetchDataVariable(variable, serverTriggerCounter);
61053
- return fetchDataVariable2;
61054
- }
61055
- const variablesContext = React$1.useContext(variablesCtx);
61056
- variablesContext?.variables.current.add(variable.uid);
61057
- React$1.useEffect(() => {
61058
- return () => {
61059
- variablesContext?.variables.current.delete(variable.uid);
61060
- };
61061
- }, []);
61062
- const taskContext = useTaskContext();
61063
- const dvSelector = useDerivedVariable(variable, wsClient, taskContext, extras);
61064
- const dvLoadable = Recoil_index_21(dvSelector);
61065
- const [dvValue, setDvValue] = React$1.useState(dvLoadable.toPromise());
61066
- React$1.useEffect(() => {
61067
- if (dvLoadable.state === "loading") {
61068
- setDvValue(dvLoadable.toPromise());
61069
- }
61070
- }, [dvLoadable]);
61071
- const fetchDerivedDataVariable2 = useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValue);
61072
- return fetchDerivedDataVariable2;
61073
- }
61074
- function useAnyVariable(variable) {
61075
- if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
61076
- const getData = useDataVariable(variable);
61077
- const { data, refetch } = reactQuery.useQuery({
61078
- // ideally would be 0 but that causes infinite loops, see https://github.com/TanStack/query/issues/2367
61079
- cacheTime: 1,
61080
- queryFn: async () => {
61081
- const dataResponse = await getData();
61082
- return dataResponse.data;
61083
- },
61084
- queryKey: ["any-variable-data", variable.uid],
61085
- refetchOnWindowFocus: false,
61086
- suspense: true
61087
- });
61088
- React$1.useEffect(() => {
61089
- refetch();
61090
- }, [getData]);
61091
- return data ?? void 0;
61092
- }
61093
- return useVariable(variable)[0];
61094
- }
61095
- function getVariableValue(variable, shouldFetchVariable = false, ctx) {
61096
- const resolved = resolveVariable(
61097
- variable,
61098
- ctx.client,
61099
- ctx.taskContext,
61100
- ctx.extras,
61101
- (v) => ctx.snapshot.getLoadable(v).getValue()
61102
- );
61103
- if (isResolvedSwitchVariable(resolved)) {
61104
- throw new UserError("Switch variables are not supported in this context");
61105
- }
61106
- if (!shouldFetchVariable || !isDerivedVariable(variable) && !isDataVariable(variable) && !isDerivedDataVariable(variable)) {
61107
- return resolved;
61108
- }
61109
- if (!isResolvedDerivedVariable(resolved) && !isResolvedDataVariable(resolved) && !isResolvedDerivedDataVariable(resolved)) {
61110
- return resolved;
61111
- }
61112
- if (isResolvedDataVariable(resolved)) {
61113
- return fetchDataVariable(resolved.uid, ctx.extras, resolved.filters);
61114
- }
61115
- return fetchDerivedVariable({
61116
- cache: variable.cache,
61117
- extras: ctx.extras,
61118
- force_key: null,
61119
- /**
61120
- * In this case we're not concerned about different selectors fetching the value so just use the uid
61121
- */
61122
- selectorKey: resolved.uid,
61123
- values: normalizeRequest(
61124
- cleanArgs(resolved.values),
61125
- variable.variables
61126
- ),
61127
- variableUid: resolved.uid,
61128
- wsClient: ctx.client
61129
- }).then((resp) => {
61130
- if (isTaskResponse$1(resp)) {
61131
- throw new Error("Task DerivedVariables are not supported in this context");
61132
- }
61133
- if (isDerivedDataVariable(variable)) {
61134
- return ctx.client.getChannel().then(
61135
- (chan) => fetchDerivedDataVariable(variable.uid, ctx.extras, resp.cache_key, chan, variable.filters)
61136
- );
61137
- }
61138
- return resp.value;
61139
- });
61140
- }
61141
- function useVariableValue(variable, shouldFetchVariable = false) {
61142
- const taskContext = useTaskContext();
61143
- const { client: client2 } = React$1.useContext(websocketCtx);
61144
- const { search } = useLocation();
61145
- const extras = useRequestExtras();
61146
- if (!isVariable(variable)) {
61147
- return () => variable;
61148
- }
61149
- return Recoil_index_31(
61150
- ({ snapshot }) => {
61151
- return () => {
61152
- return getVariableValue(variable, shouldFetchVariable, {
61153
- client: client2,
61154
- extras,
61155
- snapshot,
61156
- taskContext
61157
- });
61158
- };
61159
- },
61160
- [variable.uid, useDeepCompare(taskContext), client2, search, extras]
61161
- );
61162
- }
61163
60753
  function useRefreshSelector() {
61164
60754
  return Recoil_index_31(({ refresh }) => {
61165
60755
  return (key, extras) => {
@@ -61178,16 +60768,16 @@ Inferred class string: "${iconClasses}."`
61178
60768
  const { client: client2 } = React$1.useContext(websocketCtx);
61179
60769
  const taskCtx = useTaskContext();
61180
60770
  return Recoil_index_31(({ snapshot }) => {
61181
- return (variable) => {
60771
+ return async (variable) => {
61182
60772
  if (!isRegistered(variable)) {
61183
60773
  return "__NOT_REGISTERED__";
61184
60774
  }
61185
- const resolvedVariable = resolveVariable(
60775
+ const resolvedVariable = await resolveVariable(
61186
60776
  variable,
61187
60777
  client2,
61188
60778
  taskCtx,
61189
60779
  extras,
61190
- (v) => snapshot.getLoadable(v).getValue()
60780
+ (v) => snapshot.getLoadable(v).toPromise()
61191
60781
  );
61192
60782
  return resolvedVariable;
61193
60783
  };
@@ -61476,14 +61066,12 @@ Inferred class string: "${iconClasses}."`
61476
61066
  eviction: "most-recent"
61477
61067
  },
61478
61068
  get: (extrasSerializable) => async ({ get }) => {
61479
- const resolvedKwargs = Object.keys(dynamicKwargs).reduce(
61480
- (acc, k) => {
61481
- const value = dynamicKwargs[k];
61482
- acc[k] = isVariable(value) ? resolveVariable(value, wsClient, taskContext, currentExtras) : value;
61483
- return acc;
61484
- },
61485
- {}
61486
- );
61069
+ const resolvedKwargs = await Promise.all(
61070
+ Object.entries(dynamicKwargs).map(async ([k, value]) => {
61071
+ const resolvedValue = isVariable(value) ? await resolveVariable(value, wsClient, taskContext, currentExtras) : value;
61072
+ return [k, resolvedValue];
61073
+ })
61074
+ ).then((entries) => Object.fromEntries(entries));
61487
61075
  const resolvedKwargsList = Object.values(resolvedKwargs);
61488
61076
  const kwargsList = Object.values(dynamicKwargs);
61489
61077
  const triggerAtom = getOrRegisterComponentTrigger(uid2);
@@ -61495,7 +61083,6 @@ Inferred class string: "${iconClasses}."`
61495
61083
  kwargsList,
61496
61084
  // pass deps=kwargs
61497
61085
  resolvedKwargsList,
61498
- wsClient,
61499
61086
  get,
61500
61087
  selfTrigger
61501
61088
  );
@@ -61531,8 +61118,10 @@ Inferred class string: "${iconClasses}."`
61531
61118
  taskContext.startTask(taskId, key, getComponentRegistryKey(uid2, true));
61532
61119
  try {
61533
61120
  await wsClient.waitForTask(taskId);
61534
- } catch {
61535
- return null;
61121
+ } catch (e2) {
61122
+ e2.selectorId = key;
61123
+ e2.selectorExtras = extrasSerializable.toJSON();
61124
+ throw e2;
61536
61125
  } finally {
61537
61126
  taskContext.endTask(taskId);
61538
61127
  }
@@ -61891,7 +61480,9 @@ Inferred class string: "${iconClasses}."`
61891
61480
  const taskIds = findRunningTasks(taskContext, props.variablesRef);
61892
61481
  if (taskIds.length > 0) {
61893
61482
  setSubscribedTaskIds(taskIds);
61894
- progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) => setLatestProgressUpdate(notif.message));
61483
+ progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) => {
61484
+ setLatestProgressUpdate(notif.message);
61485
+ });
61895
61486
  clearInterval(timer2);
61896
61487
  }
61897
61488
  }, POLLING_INTERVAL);
@@ -62069,7 +61660,7 @@ Inferred class string: "${iconClasses}."`
62069
61660
  pollingInterval = variable.polling_interval;
62070
61661
  }
62071
61662
  variable.variables.forEach((value) => {
62072
- if (isDerivedVariable(value) || isDerivedDataVariable(value)) {
61663
+ if (isDerivedVariable(value)) {
62073
61664
  const innerPollingInterval = getDerivedVariablePollingInterval(value);
62074
61665
  if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
62075
61666
  pollingInterval = innerPollingInterval;
@@ -62081,7 +61672,7 @@ Inferred class string: "${iconClasses}."`
62081
61672
  function computePollingInterval(kwargs, componentInterval) {
62082
61673
  let pollingInterval;
62083
61674
  Object.values(kwargs).forEach((value) => {
62084
- if (isDerivedVariable(value) || isDerivedDataVariable(value)) {
61675
+ if (isDerivedVariable(value)) {
62085
61676
  const innerPollingInterval = getDerivedVariablePollingInterval(value);
62086
61677
  if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
62087
61678
  pollingInterval = innerPollingInterval;
@@ -62782,9 +62373,9 @@ Inferred class string: "${iconClasses}."`
62782
62373
  function VariableStateProvider(props) {
62783
62374
  const getVariableState = useVariableState();
62784
62375
  React$1.useEffect(() => {
62785
- const sub = props.wsClient?.variableRequests$().subscribe((req) => {
62376
+ const sub = props.wsClient?.variableRequests$().subscribe(async (req) => {
62786
62377
  try {
62787
- const variableValue = getVariableState(req.message.variable);
62378
+ const variableValue = await getVariableState(req.message.variable);
62788
62379
  props.wsClient.sendVariable(variableValue, req.message.__rchan);
62789
62380
  } catch (err2) {
62790
62381
  console.warn(`Error when processing a getVariableValue request: ${String(err2)}`);
@@ -62894,7 +62485,7 @@ Inferred class string: "${iconClasses}."`
62894
62485
  {
62895
62486
  value: { actionRegistry: actions, componentRegistry: components, refetchComponents }
62896
62487
  },
62897
- /* @__PURE__ */ React.createElement(DynamicContext, { contextComponents: config2?.context_components ?? [] }, /* @__PURE__ */ React.createElement(StoreProviders, null, /* @__PURE__ */ React.createElement(RootWrapper, null, /* @__PURE__ */ React.createElement(DynamicComponent$1, { component: template.layout }), /* @__PURE__ */ React.createElement(VariableStateProvider, { wsClient }), config2?.enable_devtools && /* @__PURE__ */ React.createElement(DevTools, null))))
62488
+ /* @__PURE__ */ React.createElement(DynamicContext, { contextComponents: config2?.context_components ?? [] }, /* @__PURE__ */ React.createElement(StoreProviders, null, /* @__PURE__ */ React.createElement(ServerVariableSyncProvider, null, /* @__PURE__ */ React.createElement(RootWrapper, null, /* @__PURE__ */ React.createElement(DynamicComponent$1, { component: template.layout }), /* @__PURE__ */ React.createElement(VariableStateProvider, { wsClient }), config2?.enable_devtools && /* @__PURE__ */ React.createElement(DevTools, null)))))
62898
62489
  )));
62899
62490
  }
62900
62491
  const Wrapper = styled.div`
@@ -62948,21 +62539,22 @@ Inferred class string: "${iconClasses}."`
62948
62539
  };
62949
62540
  const ResetVariables = (ctx, actionImpl) => {
62950
62541
  actionImpl.variables.filter(isVariable).forEach((variable) => {
62951
- if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
62542
+ if (isDerivedVariable(variable)) {
62952
62543
  const triggerAtom = getOrRegisterTrigger(variable);
62953
62544
  ctx.set(triggerAtom, (triggerIndexValue) => ({
62954
62545
  force_key: nanoid(),
62955
62546
  inc: triggerIndexValue.inc + 1
62956
62547
  }));
62957
- } else if (isUrlVariable(variable)) {
62958
- const urlAtom = getOrRegisterUrlVariable(variable);
62959
- ctx.set(urlAtom, variable.default);
62960
- ctx.eventBus.publish("URL_VARIABLE_LOADED", { variable, value: variable.default });
62961
- } else if (isDataVariable(variable)) ;
62962
- else if (isSwitchVariable(variable)) ;
62548
+ } else if (isSwitchVariable(variable)) ;
62549
+ else if (isStateVariable(variable)) ;
62550
+ else if (isServerVariable(variable)) ;
62963
62551
  else {
62964
62552
  const plainAtom = getOrRegisterPlainVariable(variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
62965
- ctx.reset(plainAtom);
62553
+ if (variable.store?.__typename === "QueryParamStore") {
62554
+ ctx.set(plainAtom, variable.default);
62555
+ } else {
62556
+ ctx.reset(plainAtom);
62557
+ }
62966
62558
  ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable, value: variable.default });
62967
62559
  }
62968
62560
  });
@@ -62977,20 +62569,10 @@ Inferred class string: "${iconClasses}."`
62977
62569
  const INPUT = "__dara_input__";
62978
62570
  const TOGGLE = "__dara_toggle__";
62979
62571
  const UpdateVariable = async (ctx, actionImpl) => {
62980
- let varAtom;
62981
- let eventName;
62982
- switch (actionImpl.variable.__typename) {
62983
- case "Variable":
62984
- varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
62985
- eventName = "PLAIN_VARIABLE_LOADED";
62986
- break;
62987
- case "UrlVariable":
62988
- varAtom = getOrRegisterUrlVariable(actionImpl.variable);
62989
- eventName = "URL_VARIABLE_LOADED";
62990
- break;
62991
- case "DataVariable":
62992
- throw new Error("DataVariable is not supported in UpdateVariable action");
62572
+ if (actionImpl.variable.__typename !== "Variable") {
62573
+ throw new UserError("UpdateVariable action only supports Variables");
62993
62574
  }
62575
+ const varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
62994
62576
  let newValue;
62995
62577
  if (actionImpl.value === INPUT) {
62996
62578
  newValue = ctx.input;
@@ -63001,8 +62583,11 @@ Inferred class string: "${iconClasses}."`
63001
62583
  newValue = actionImpl.value;
63002
62584
  }
63003
62585
  ctx.set(varAtom, newValue);
63004
- ctx.eventBus.publish(eventName, { variable: actionImpl.variable, value: newValue });
62586
+ ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable: actionImpl.variable, value: newValue });
63005
62587
  };
62588
+ function commonjsRequire(path) {
62589
+ throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
62590
+ }
63006
62591
  var exceljs_min = { exports: {} };
63007
62592
  /*! ExcelJS 19-10-2023 */
63008
62593
  var hasRequiredExceljs_min;
@@ -86205,10 +85790,37 @@ Inferred class string: "${iconClasses}."`
86205
85790
  return FileSaver_min$1.exports;
86206
85791
  }
86207
85792
  var FileSaver_minExports = requireFileSaver_min();
85793
+ const COL_PATTERN = /^__col__\d+__(.+)$/;
85794
+ const INDEX_PATTERN = /^__index__\d+__(.+)$/;
85795
+ const restoreColumnName = (colName) => {
85796
+ const colMatch = colName.match(COL_PATTERN);
85797
+ if (colMatch) {
85798
+ return colMatch[1];
85799
+ }
85800
+ const indexMatch = colName.match(INDEX_PATTERN);
85801
+ if (indexMatch) {
85802
+ return indexMatch[1];
85803
+ }
85804
+ return colName;
85805
+ };
85806
+ const processDataForDownload = (content) => {
85807
+ return content.map((row) => {
85808
+ const processedRow = {};
85809
+ Object.entries(row).forEach(([key, value]) => {
85810
+ if (key === "__index__") {
85811
+ return;
85812
+ }
85813
+ const restoredKey = restoreColumnName(key);
85814
+ processedRow[restoredKey] = value;
85815
+ });
85816
+ return processedRow;
85817
+ });
85818
+ };
86208
85819
  const createMatrixFromArrayOfObjects = (content) => {
85820
+ const processedContent = processDataForDownload(content);
86209
85821
  const headings = [];
86210
85822
  const indexes = {};
86211
- content.forEach((c) => {
85823
+ processedContent.forEach((c) => {
86212
85824
  Object.keys(c).forEach((k) => {
86213
85825
  if (!headings.includes(k)) {
86214
85826
  headings.push(k);
@@ -86218,7 +85830,7 @@ Inferred class string: "${iconClasses}."`
86218
85830
  });
86219
85831
  const headingsLength = headings.length;
86220
85832
  const matrix = [];
86221
- content.forEach((c) => {
85833
+ processedContent.forEach((c) => {
86222
85834
  const row = new Array(headingsLength);
86223
85835
  Object.entries(c).forEach(([k, v]) => {
86224
85836
  row[indexes[k]] = v;
@@ -86290,22 +85902,24 @@ Inferred class string: "${iconClasses}."`
86290
85902
  return null;
86291
85903
  };
86292
85904
  const DownloadVariable = async (ctx, actionImpl) => {
86293
- let value = getVariableValue(actionImpl.variable, true, {
85905
+ let value = await getTabularVariableValue(actionImpl.variable, {
86294
85906
  client: ctx.wsClient,
86295
85907
  extras: ctx.extras,
86296
85908
  search: ctx.location.search,
86297
85909
  snapshot: ctx.snapshot,
86298
85910
  taskContext: ctx.taskCtx
86299
85911
  });
86300
- if (value instanceof Promise) {
86301
- value = await value;
85912
+ if (value === null) {
85913
+ ctx.notificationCtx.pushNotification({
85914
+ key: "_downloadVariable",
85915
+ message: "Failed to fetch the variable value",
85916
+ status: Status.ERROR,
85917
+ title: "Error fetching variable value"
85918
+ });
85919
+ return;
86302
85920
  }
86303
- if (actionImpl.variable.__typename === "DataVariable" || actionImpl.variable.__typename === "DerivedDataVariable") {
86304
- for (const row of value) {
86305
- if ("__index__" in row) {
86306
- delete row.__index__;
86307
- }
86308
- }
85921
+ if (Array.isArray(value)) {
85922
+ value = processDataForDownload(value);
86309
85923
  }
86310
85924
  const fileName = actionImpl.file_name || "Data";
86311
85925
  const fileNameWithExt = `${fileName}.${actionImpl.type}`;
@@ -86611,7 +86225,7 @@ Inferred class string: "${iconClasses}."`
86611
86225
  return /* @__PURE__ */ React__namespace.createElement(DynamicComponent$1, { component: transformedRenderer });
86612
86226
  }, isEqual$5);
86613
86227
  function ForImpl(props) {
86614
- const items = useAnyVariable(props.items);
86228
+ const [items] = useVariable(props.items, { suspend: false });
86615
86229
  const markers = React__namespace.useMemo(() => getInjectionMarkers(props.renderer), [props.renderer]);
86616
86230
  const key = React__namespace.useMemo(() => props.key_accessor?.split(".") ?? null, [props.key_accessor]);
86617
86231
  const getItemKey = React__namespace.useCallback(
@@ -86694,6 +86308,7 @@ Inferred class string: "${iconClasses}."`
86694
86308
  exports.ResetVariables = ResetVariables;
86695
86309
  exports.RouterContent = RouterContent;
86696
86310
  exports.RowFallback = RowFallback;
86311
+ exports.ServerVariableSyncProvider = ServerVariableSyncProvider;
86697
86312
  exports.SideBarFrame = SideBarFrame;
86698
86313
  exports.TemplateRoot = TemplateRoot;
86699
86314
  exports.TopBarFrame = TopBarFrame;
@@ -86713,29 +86328,30 @@ Inferred class string: "${iconClasses}."`
86713
86328
  exports.clearCaches_TEST = clearCaches_TEST;
86714
86329
  exports.clearRegistries_TEST = clearRegistries_TEST;
86715
86330
  exports.combineFilters = combineFilters;
86716
- exports.dataRegistry = dataRegistry;
86717
86331
  exports.default = run;
86718
86332
  exports.depsRegistry = depsRegistry;
86719
86333
  exports.fetchDerivedVariable = fetchDerivedVariable;
86334
+ exports.fetchTabularServerVariable = fetchTabularServerVariable;
86720
86335
  exports.fetchTaskResult = fetchTaskResult;
86721
86336
  exports.getComponentRegistryKey = getComponentRegistryKey;
86722
86337
  exports.getDeps = getDeps;
86723
86338
  exports.getIcon = getIcon;
86724
86339
  exports.getOrRegisterDerivedVariable = getOrRegisterDerivedVariable;
86340
+ exports.getOrRegisterDerivedVariableResult = getOrRegisterDerivedVariableResult;
86725
86341
  exports.getOrRegisterDerivedVariableValue = getOrRegisterDerivedVariableValue;
86342
+ exports.getOrRegisterServerVariable = getOrRegisterServerVariable;
86726
86343
  exports.getRegistryKey = getRegistryKey;
86727
86344
  exports.getSessionToken = getSessionToken;
86345
+ exports.getTabularVariableValue = getTabularVariableValue;
86728
86346
  exports.getToken = getToken;
86729
86347
  exports.getTokenKey = getTokenKey;
86730
- exports.getVariableValue = getVariableValue;
86731
86348
  exports.handleAuthErrors = handleAuthErrors;
86732
86349
  exports.injectCss = injectCss;
86733
86350
  exports.isActionImpl = isActionImpl;
86734
86351
  exports.isAnnotatedAction = isAnnotatedAction;
86735
86352
  exports.isCondition = isCondition;
86736
86353
  exports.isConditionTrue = isConditionTrue;
86737
- exports.isDataVariable = isDataVariable;
86738
- exports.isDerivedDataVariable = isDerivedDataVariable;
86354
+ exports.isDataResponse = isDataResponse;
86739
86355
  exports.isDerivedVariable = isDerivedVariable;
86740
86356
  exports.isInvalidComponent = isInvalidComponent;
86741
86357
  exports.isJsComponent = isJsComponent;
@@ -86743,13 +86359,14 @@ Inferred class string: "${iconClasses}."`
86743
86359
  exports.isPyComponent = isPyComponent;
86744
86360
  exports.isRawString = isRawString;
86745
86361
  exports.isRegistered = isRegistered;
86746
- exports.isResolvedDataVariable = isResolvedDataVariable;
86747
- exports.isResolvedDerivedDataVariable = isResolvedDerivedDataVariable;
86748
86362
  exports.isResolvedDerivedVariable = isResolvedDerivedVariable;
86363
+ exports.isResolvedServerVariable = isResolvedServerVariable;
86749
86364
  exports.isResolvedSwitchVariable = isResolvedSwitchVariable;
86365
+ exports.isServerVariable = isServerVariable;
86366
+ exports.isSingleVariable = isSingleVariable;
86367
+ exports.isStateVariable = isStateVariable;
86750
86368
  exports.isSwitchVariable = isSwitchVariable;
86751
86369
  exports.isTaskResponse = isTaskResponse$1;
86752
- exports.isUrlVariable = isUrlVariable;
86753
86370
  exports.isVariable = isVariable;
86754
86371
  exports.normalizeRequest = normalizeRequest;
86755
86372
  exports.onTokenChange = onTokenChange;
@@ -86760,6 +86377,7 @@ Inferred class string: "${iconClasses}."`
86760
86377
  exports.resolveDerivedValue = resolveDerivedValue;
86761
86378
  exports.resolveNested = resolveNested;
86762
86379
  exports.resolveReferrer = resolveReferrer;
86380
+ exports.resolveServerVariable = resolveServerVariable;
86763
86381
  exports.resolveTheme = resolveTheme;
86764
86382
  exports.revokeSession = revokeSession;
86765
86383
  exports.selectorFamilyMembersRegistry = selectorFamilyMembersRegistry;
@@ -86771,17 +86389,17 @@ Inferred class string: "${iconClasses}."`
86771
86389
  exports.useAction = useAction;
86772
86390
  exports.useActionIsLoading = useActionIsLoading;
86773
86391
  exports.useActions = useActions;
86774
- exports.useAnyVariable = useAnyVariable;
86775
86392
  exports.useAuthConfig = useAuthConfig;
86776
86393
  exports.useComponentRegistry = useComponentRegistry;
86777
86394
  exports.useComponentStyles = useComponentStyles;
86778
86395
  exports.useComponents = useComponents;
86779
86396
  exports.useConditionOrVariable = useConditionOrVariable;
86780
86397
  exports.useConfig = useConfig;
86781
- exports.useDataVariable = useDataVariable;
86782
86398
  exports.useDeferLoadable = useDeferLoadable;
86783
86399
  exports.useDerivedVariable = useDerivedVariable;
86784
86400
  exports.useEventBus = useEventBus;
86401
+ exports.useFetchTabularDerivedVariable = useFetchTabularDerivedVariable;
86402
+ exports.useFetchTabularServerVariable = useFetchTabularServerVariable;
86785
86403
  exports.useInterval = useInterval;
86786
86404
  exports.usePrevious = usePrevious;
86787
86405
  exports.useRefreshSelector = useRefreshSelector;
@@ -86790,6 +86408,7 @@ Inferred class string: "${iconClasses}."`
86790
86408
  exports.useSession = useSession;
86791
86409
  exports.useSessionToken = useSessionToken;
86792
86410
  exports.useSwitchVariable = useSwitchVariable;
86411
+ exports.useTabularVariable = useTabularVariable;
86793
86412
  exports.useTaskContext = useTaskContext;
86794
86413
  exports.useTemplate = useTemplate;
86795
86414
  exports.useTriggerIndex = useTriggerIndex;
@@ -86797,7 +86416,6 @@ Inferred class string: "${iconClasses}."`
86797
86416
  exports.useUser = useUser;
86798
86417
  exports.useVariable = useVariable;
86799
86418
  exports.useVariableState = useVariableState;
86800
- exports.useVariableValue = useVariableValue;
86801
86419
  exports.useWindowTitle = useWindowTitle;
86802
86420
  exports.verifySessionToken = verifySessionToken;
86803
86421
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });