dara-core 1.19.1__py3-none-any.whl → 1.20.0__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.
- dara/core/__init__.py +1 -0
- dara/core/auth/basic.py +13 -7
- dara/core/auth/definitions.py +2 -2
- dara/core/auth/utils.py +1 -1
- dara/core/base_definitions.py +7 -42
- dara/core/data_utils.py +16 -17
- dara/core/definitions.py +8 -8
- dara/core/interactivity/__init__.py +4 -0
- dara/core/interactivity/actions.py +20 -22
- dara/core/interactivity/any_data_variable.py +7 -135
- dara/core/interactivity/any_variable.py +1 -1
- dara/core/interactivity/client_variable.py +71 -0
- dara/core/interactivity/data_variable.py +8 -266
- dara/core/interactivity/derived_data_variable.py +6 -290
- dara/core/interactivity/derived_variable.py +335 -201
- dara/core/interactivity/filtering.py +29 -2
- dara/core/interactivity/loop_variable.py +2 -2
- dara/core/interactivity/non_data_variable.py +5 -68
- dara/core/interactivity/plain_variable.py +87 -14
- dara/core/interactivity/server_variable.py +325 -0
- dara/core/interactivity/state_variable.py +2 -2
- dara/core/interactivity/switch_variable.py +15 -15
- dara/core/interactivity/tabular_variable.py +94 -0
- dara/core/interactivity/url_variable.py +10 -90
- dara/core/internal/cache_store/cache_store.py +5 -20
- dara/core/internal/dependency_resolution.py +27 -69
- dara/core/internal/devtools.py +10 -3
- dara/core/internal/execute_action.py +9 -3
- dara/core/internal/multi_resource_lock.py +70 -0
- dara/core/internal/normalization.py +0 -5
- dara/core/internal/pandas_utils.py +105 -3
- dara/core/internal/pool/definitions.py +1 -1
- dara/core/internal/pool/task_pool.py +1 -1
- dara/core/internal/registries.py +3 -2
- dara/core/internal/registry.py +1 -1
- dara/core/internal/registry_lookup.py +5 -3
- dara/core/internal/routing.py +52 -121
- dara/core/internal/store.py +2 -29
- dara/core/internal/tasks.py +372 -182
- dara/core/internal/utils.py +25 -3
- dara/core/internal/websocket.py +1 -1
- dara/core/js_tooling/js_utils.py +2 -0
- dara/core/logging.py +10 -6
- dara/core/persistence.py +26 -4
- dara/core/umd/dara.core.umd.js +751 -1386
- dara/core/visual/dynamic_component.py +10 -13
- {dara_core-1.19.1.dist-info → dara_core-1.20.0.dist-info}/METADATA +10 -10
- {dara_core-1.19.1.dist-info → dara_core-1.20.0.dist-info}/RECORD +51 -47
- {dara_core-1.19.1.dist-info → dara_core-1.20.0.dist-info}/LICENSE +0 -0
- {dara_core-1.19.1.dist-info → dara_core-1.20.0.dist-info}/WHEEL +0 -0
- {dara_core-1.19.1.dist-info → dara_core-1.20.0.dist-info}/entry_points.txt +0 -0
dara/core/umd/dara.core.umd.js
CHANGED
|
@@ -2761,7 +2761,7 @@
|
|
|
2761
2761
|
};
|
|
2762
2762
|
var LEAF = 1;
|
|
2763
2763
|
var COLLISION = 2;
|
|
2764
|
-
var
|
|
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:
|
|
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
|
|
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
|
|
3149
|
+
case INDEX2:
|
|
3150
3150
|
var children = node.children;
|
|
3151
3151
|
return lazyVisitChildren(children.length, children, 0, f, k);
|
|
3152
3152
|
default:
|
|
@@ -37933,7 +37933,7 @@
|
|
|
37933
37933
|
effect,
|
|
37934
37934
|
data: {}
|
|
37935
37935
|
};
|
|
37936
|
-
var hash$
|
|
37936
|
+
var hash$1 = {
|
|
37937
37937
|
left: "right",
|
|
37938
37938
|
right: "left",
|
|
37939
37939
|
bottom: "top",
|
|
@@ -37941,16 +37941,16 @@
|
|
|
37941
37941
|
};
|
|
37942
37942
|
function getOppositePlacement(placement) {
|
|
37943
37943
|
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
37944
|
-
return hash$
|
|
37944
|
+
return hash$1[matched];
|
|
37945
37945
|
});
|
|
37946
37946
|
}
|
|
37947
|
-
var hash
|
|
37947
|
+
var hash = {
|
|
37948
37948
|
start: "end",
|
|
37949
37949
|
end: "start"
|
|
37950
37950
|
};
|
|
37951
37951
|
function getOppositeVariationPlacement(placement) {
|
|
37952
37952
|
return placement.replace(/start|end/g, function(matched) {
|
|
37953
|
-
return hash
|
|
37953
|
+
return hash[matched];
|
|
37954
37954
|
});
|
|
37955
37955
|
}
|
|
37956
37956
|
function getWindowScroll(node) {
|
|
@@ -43654,10 +43654,13 @@
|
|
|
43654
43654
|
const unpackedItems = React$1.useMemo(() => unpackSectionedList(props.items), [props.items]);
|
|
43655
43655
|
const [pendingHighlight, setPendingHighlight] = React$1.useState(null);
|
|
43656
43656
|
const [items, setItems] = React$1.useState(unpackedItems);
|
|
43657
|
-
const [inputValue, setInputValue] = React$1.useState((
|
|
43657
|
+
const [inputValue, setInputValue] = React$1.useState(((_a = props.selectedItem) === null || _a === void 0 ? void 0 : _a.label) && props.selectedItem.label !== "null" ? props.selectedItem.label : (_b = props.placeholder) !== null && _b !== void 0 ? _b : "");
|
|
43658
43658
|
const [kbdHighlightIdx, setKbdHighlightIdx] = React$1.useState();
|
|
43659
43659
|
const { selectedItem, isOpen, getMenuProps, getInputProps, getToggleButtonProps, getItemProps, setHighlightedIndex } = useCombobox(Object.assign(Object.assign(Object.assign({ initialIsOpen: false, initialSelectedItem: (_c = props.initialValue) !== null && _c !== void 0 ? _c : props.selectedItem, itemToString: (item) => item ? item.label : "", items, onInputValueChange: (change) => {
|
|
43660
|
-
|
|
43660
|
+
const shouldUpdateInput = [stateChangeTypes.ItemClick, stateChangeTypes.InputChange].includes(change.type);
|
|
43661
|
+
if (shouldUpdateInput) {
|
|
43662
|
+
setInputValue(change.inputValue);
|
|
43663
|
+
}
|
|
43661
43664
|
if (!change.inputValue) {
|
|
43662
43665
|
setItems(unpackedItems);
|
|
43663
43666
|
return;
|
|
@@ -43722,10 +43725,11 @@
|
|
|
43722
43725
|
}
|
|
43723
43726
|
}, [isOpen, pendingHighlight, setHighlightedIndex]);
|
|
43724
43727
|
React$1.useEffect(() => {
|
|
43728
|
+
var _a2;
|
|
43725
43729
|
if (props.selectedItem === null) {
|
|
43726
|
-
setInputValue("");
|
|
43730
|
+
setInputValue((_a2 = props.placeholder) !== null && _a2 !== void 0 ? _a2 : "");
|
|
43727
43731
|
}
|
|
43728
|
-
}, [props.selectedItem]);
|
|
43732
|
+
}, [props.selectedItem, props.placeholder]);
|
|
43729
43733
|
const { refs, floatingStyles, context: context2 } = useFloating({
|
|
43730
43734
|
open: isOpen,
|
|
43731
43735
|
placement: "bottom-start",
|
|
@@ -56482,14 +56486,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56482
56486
|
const maxDisconnectedTime = 1e4;
|
|
56483
56487
|
const interPingInterval = 5e3;
|
|
56484
56488
|
const maxAttempts = Math.round(maxDisconnectedTime / interAttemptTimeout);
|
|
56489
|
+
class TaskCancelledError extends Error {
|
|
56490
|
+
constructor(message, task_id) {
|
|
56491
|
+
super(message);
|
|
56492
|
+
this.task_id = task_id;
|
|
56493
|
+
}
|
|
56494
|
+
}
|
|
56495
|
+
class TaskError extends Error {
|
|
56496
|
+
constructor(message, task_id) {
|
|
56497
|
+
super(message);
|
|
56498
|
+
this.task_id = task_id;
|
|
56499
|
+
}
|
|
56500
|
+
}
|
|
56485
56501
|
function isInitMessage(message) {
|
|
56486
56502
|
return message.type === "init";
|
|
56487
56503
|
}
|
|
56488
56504
|
function isTaskNotification(message) {
|
|
56489
56505
|
return message.type === "message" && "status" in message.message && "task_id" in message.message;
|
|
56490
56506
|
}
|
|
56491
|
-
function
|
|
56492
|
-
return message.type === "message" && "
|
|
56507
|
+
function isServerVariableMessage(message) {
|
|
56508
|
+
return message.type === "message" && "__type" in message.message && message.message.__type === "ServerVariable";
|
|
56493
56509
|
}
|
|
56494
56510
|
function isServerErrorMessage(message) {
|
|
56495
56511
|
return message.type === "message" && "error" in message.message;
|
|
@@ -56615,6 +56631,12 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56615
56631
|
map$2((msg) => msg.message)
|
|
56616
56632
|
);
|
|
56617
56633
|
}
|
|
56634
|
+
serverVariableMessages$() {
|
|
56635
|
+
return this.messages$.pipe(
|
|
56636
|
+
filter(isServerVariableMessage),
|
|
56637
|
+
map$2((msg) => msg.message)
|
|
56638
|
+
);
|
|
56639
|
+
}
|
|
56618
56640
|
/**
|
|
56619
56641
|
* Get the observable to receive the new channel when the socket reconnects
|
|
56620
56642
|
*/
|
|
@@ -56649,17 +56671,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56649
56671
|
)
|
|
56650
56672
|
);
|
|
56651
56673
|
}
|
|
56652
|
-
/**
|
|
56653
|
-
* Get the observable to receive server trigger messages for a given data variable
|
|
56654
|
-
*
|
|
56655
|
-
* @param dataId id of the data variable triggered
|
|
56656
|
-
*/
|
|
56657
|
-
serverTriggers$(dataId) {
|
|
56658
|
-
return this.messages$.pipe(
|
|
56659
|
-
filter(isServerTriggerMessage),
|
|
56660
|
-
filter((msg) => msg.message?.data_id === dataId)
|
|
56661
|
-
);
|
|
56662
|
-
}
|
|
56663
56674
|
/**
|
|
56664
56675
|
* Get the observable to receive server error messages
|
|
56665
56676
|
*/
|
|
@@ -56690,21 +56701,21 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56690
56701
|
return this.messages$.pipe(filter(isCustomMessage));
|
|
56691
56702
|
}
|
|
56692
56703
|
/**
|
|
56693
|
-
* Returns a promise that will resolve when the task is completed. If the task is cancelled then this will throw an
|
|
56704
|
+
* Returns a promise that will resolve when the task is completed. If the task is cancelled or errored then this will throw an
|
|
56694
56705
|
* error to signify that.
|
|
56695
56706
|
*
|
|
56696
56707
|
* @param task_id the id of the task to wait for
|
|
56697
56708
|
*/
|
|
56698
56709
|
waitForTask(task_id) {
|
|
56699
56710
|
return this.messages$.pipe(
|
|
56700
|
-
filter(
|
|
56701
|
-
|
|
56702
|
-
|
|
56703
|
-
// don't take progress updates
|
|
56704
|
-
),
|
|
56711
|
+
filter((msg) => {
|
|
56712
|
+
return isTaskNotification(msg) && msg.message?.task_id === task_id && msg.message.status !== "PROGRESS";
|
|
56713
|
+
}),
|
|
56705
56714
|
map$2((msg) => {
|
|
56706
|
-
if (
|
|
56707
|
-
throw new
|
|
56715
|
+
if (msg.message.status === "CANCELED") {
|
|
56716
|
+
throw new TaskCancelledError("Task was cancelled", msg.message.task_id);
|
|
56717
|
+
} else if (msg.message.status === "ERROR") {
|
|
56718
|
+
throw new TaskError(msg.message.error, msg.message.task_id);
|
|
56708
56719
|
}
|
|
56709
56720
|
return msg;
|
|
56710
56721
|
}),
|
|
@@ -56845,17 +56856,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56845
56856
|
function isVariable(variable) {
|
|
56846
56857
|
return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename.includes("Variable");
|
|
56847
56858
|
}
|
|
56848
|
-
function
|
|
56849
|
-
return isVariable(variable) && variable.__typename === "
|
|
56859
|
+
function isSingleVariable(variable) {
|
|
56860
|
+
return isVariable(variable) && variable.__typename === "Variable";
|
|
56850
56861
|
}
|
|
56851
56862
|
function isDerivedVariable(variable) {
|
|
56852
56863
|
return isVariable(variable) && variable.__typename === "DerivedVariable";
|
|
56853
56864
|
}
|
|
56854
|
-
function
|
|
56855
|
-
return isVariable(variable) && variable.__typename === "
|
|
56856
|
-
}
|
|
56857
|
-
function isDerivedDataVariable(variable) {
|
|
56858
|
-
return isVariable(variable) && variable.__typename === "DerivedDataVariable";
|
|
56865
|
+
function isServerVariable(variable) {
|
|
56866
|
+
return isVariable(variable) && variable.__typename === "ServerVariable";
|
|
56859
56867
|
}
|
|
56860
56868
|
function isLoopVariable(variable) {
|
|
56861
56869
|
return variable && typeof variable == "object" && variable.hasOwnProperty("uid") && variable.hasOwnProperty("__typename") && variable.__typename === "LoopVariable";
|
|
@@ -56869,11 +56877,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56869
56877
|
function isResolvedDerivedVariable(value) {
|
|
56870
56878
|
return value && typeof value === "object" && "values" in value && "type" in value && value.type === "derived" && "uid" in value;
|
|
56871
56879
|
}
|
|
56872
|
-
function
|
|
56873
|
-
return value && typeof value === "object" && "
|
|
56874
|
-
}
|
|
56875
|
-
function isResolvedDerivedDataVariable(value) {
|
|
56876
|
-
return value && typeof value === "object" && "filters" in value && "values" in value && "type" in value && value.type === "derived-data" && "uid" in value;
|
|
56880
|
+
function isResolvedServerVariable(value) {
|
|
56881
|
+
return value && typeof value === "object" && "type" in value && value.type === "server" && "uid" in value && "sequence_number" in value;
|
|
56877
56882
|
}
|
|
56878
56883
|
function isResolvedSwitchVariable(value) {
|
|
56879
56884
|
return value && typeof value === "object" && "type" in value && value.type === "switch" && "uid" in value && "value_map" in value;
|
|
@@ -56882,7 +56887,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
56882
56887
|
return action && typeof action === "object" && action.__typename === "ActionImpl";
|
|
56883
56888
|
}
|
|
56884
56889
|
function isAnnotatedAction(action) {
|
|
56885
|
-
return action && "uid" in action && "definition_uid" in action && "dynamic_kwargs" in action;
|
|
56890
|
+
return action && isObject(action) && "uid" in action && "definition_uid" in action && "dynamic_kwargs" in action;
|
|
56886
56891
|
}
|
|
56887
56892
|
const isPyComponent = (value) => isObject(value) && "props" in value && isObject(value.props) && "func_name" in value.props && "dynamic_kwargs" in value.props;
|
|
56888
56893
|
function isCondition(value) {
|
|
@@ -57011,813 +57016,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
57011
57016
|
});
|
|
57012
57017
|
return res.ok;
|
|
57013
57018
|
}
|
|
57014
|
-
function commonjsRequire(path) {
|
|
57015
|
-
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.');
|
|
57016
|
-
}
|
|
57017
|
-
var object_hash = { exports: {} };
|
|
57018
|
-
var hasRequiredObject_hash;
|
|
57019
|
-
function requireObject_hash() {
|
|
57020
|
-
if (hasRequiredObject_hash) return object_hash.exports;
|
|
57021
|
-
hasRequiredObject_hash = 1;
|
|
57022
|
-
(function(module2, exports2) {
|
|
57023
|
-
!function(e2) {
|
|
57024
|
-
module2.exports = e2();
|
|
57025
|
-
}(function() {
|
|
57026
|
-
return function r2(o2, i2, u) {
|
|
57027
|
-
function s(n2, e3) {
|
|
57028
|
-
if (!i2[n2]) {
|
|
57029
|
-
if (!o2[n2]) {
|
|
57030
|
-
var t2 = "function" == typeof commonjsRequire && commonjsRequire;
|
|
57031
|
-
if (!e3 && t2) return t2(n2, true);
|
|
57032
|
-
if (a2) return a2(n2, true);
|
|
57033
|
-
throw new Error("Cannot find module '" + n2 + "'");
|
|
57034
|
-
}
|
|
57035
|
-
e3 = i2[n2] = { exports: {} };
|
|
57036
|
-
o2[n2][0].call(e3.exports, function(e4) {
|
|
57037
|
-
var t3 = o2[n2][1][e4];
|
|
57038
|
-
return s(t3 || e4);
|
|
57039
|
-
}, e3, e3.exports, r2, o2, i2, u);
|
|
57040
|
-
}
|
|
57041
|
-
return i2[n2].exports;
|
|
57042
|
-
}
|
|
57043
|
-
for (var a2 = "function" == typeof commonjsRequire && commonjsRequire, e2 = 0; e2 < u.length; e2++) s(u[e2]);
|
|
57044
|
-
return s;
|
|
57045
|
-
}({ 1: [function(w2, b2, m) {
|
|
57046
|
-
!(function(e2, n2, s, c, d2, h, p2, g, y) {
|
|
57047
|
-
var r2 = w2("crypto");
|
|
57048
|
-
function t2(e3, t3) {
|
|
57049
|
-
t3 = u(e3, t3);
|
|
57050
|
-
var n3;
|
|
57051
|
-
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);
|
|
57052
|
-
}
|
|
57053
|
-
(m = b2.exports = t2).sha1 = function(e3) {
|
|
57054
|
-
return t2(e3);
|
|
57055
|
-
}, m.keys = function(e3) {
|
|
57056
|
-
return t2(e3, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
|
|
57057
|
-
}, m.MD5 = function(e3) {
|
|
57058
|
-
return t2(e3, { algorithm: "md5", encoding: "hex" });
|
|
57059
|
-
}, m.keysMD5 = function(e3) {
|
|
57060
|
-
return t2(e3, { algorithm: "md5", encoding: "hex", excludeValues: true });
|
|
57061
|
-
};
|
|
57062
|
-
var o2 = r2.getHashes ? r2.getHashes().slice() : ["sha1", "md5"], i2 = (o2.push("passthrough"), ["buffer", "hex", "binary", "base64"]);
|
|
57063
|
-
function u(e3, t3) {
|
|
57064
|
-
var n3 = {};
|
|
57065
|
-
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.");
|
|
57066
|
-
for (var r3 = 0; r3 < o2.length; ++r3) o2[r3].toLowerCase() === n3.algorithm.toLowerCase() && (n3.algorithm = o2[r3]);
|
|
57067
|
-
if (-1 === o2.indexOf(n3.algorithm)) throw new Error('Algorithm "' + n3.algorithm + '" not supported. supported values: ' + o2.join(", "));
|
|
57068
|
-
if (-1 === i2.indexOf(n3.encoding) && "passthrough" !== n3.algorithm) throw new Error('Encoding "' + n3.encoding + '" not supported. supported values: ' + i2.join(", "));
|
|
57069
|
-
return n3;
|
|
57070
|
-
}
|
|
57071
|
-
function a2(e3) {
|
|
57072
|
-
if ("function" == typeof e3) return null != /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e3));
|
|
57073
|
-
}
|
|
57074
|
-
function f(o3, t3, i3) {
|
|
57075
|
-
i3 = i3 || [];
|
|
57076
|
-
function u2(e3) {
|
|
57077
|
-
return t3.update ? t3.update(e3, "utf8") : t3.write(e3, "utf8");
|
|
57078
|
-
}
|
|
57079
|
-
return { dispatch: function(e3) {
|
|
57080
|
-
return this["_" + (null === (e3 = o3.replacer ? o3.replacer(e3) : e3) ? "null" : typeof e3)](e3);
|
|
57081
|
-
}, _object: function(t4) {
|
|
57082
|
-
var n3, e3 = Object.prototype.toString.call(t4), r3 = /\[object (.*)\]/i.exec(e3);
|
|
57083
|
-
r3 = (r3 = r3 ? r3[1] : "unknown:[" + e3 + "]").toLowerCase();
|
|
57084
|
-
if (0 <= (e3 = i3.indexOf(t4))) return this.dispatch("[CIRCULAR:" + e3 + "]");
|
|
57085
|
-
if (i3.push(t4), void 0 !== s && s.isBuffer && s.isBuffer(t4)) return u2("buffer:"), u2(t4);
|
|
57086
|
-
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) {
|
|
57087
|
-
return !o3.excludeKeys(e4);
|
|
57088
|
-
})), u2("object:" + e3.length + ":"), n3 = this, e3.forEach(function(e4) {
|
|
57089
|
-
n3.dispatch(e4), u2(":"), o3.excludeValues || n3.dispatch(t4[e4]), u2(",");
|
|
57090
|
-
});
|
|
57091
|
-
if (!this["_" + r3]) {
|
|
57092
|
-
if (o3.ignoreUnknown) return u2("[" + r3 + "]");
|
|
57093
|
-
throw new Error('Unknown object type "' + r3 + '"');
|
|
57094
|
-
}
|
|
57095
|
-
this["_" + r3](t4);
|
|
57096
|
-
}, _array: function(e3, t4) {
|
|
57097
|
-
t4 = void 0 !== t4 ? t4 : false !== o3.unorderedArrays;
|
|
57098
|
-
var n3 = this;
|
|
57099
|
-
if (u2("array:" + e3.length + ":"), !t4 || e3.length <= 1) return e3.forEach(function(e4) {
|
|
57100
|
-
return n3.dispatch(e4);
|
|
57101
|
-
});
|
|
57102
|
-
var r3 = [], t4 = e3.map(function(e4) {
|
|
57103
|
-
var t5 = new l2(), n4 = i3.slice();
|
|
57104
|
-
return f(o3, t5, n4).dispatch(e4), r3 = r3.concat(n4.slice(i3.length)), t5.read().toString();
|
|
57105
|
-
});
|
|
57106
|
-
return i3 = i3.concat(r3), t4.sort(), this._array(t4, false);
|
|
57107
|
-
}, _date: function(e3) {
|
|
57108
|
-
return u2("date:" + e3.toJSON());
|
|
57109
|
-
}, _symbol: function(e3) {
|
|
57110
|
-
return u2("symbol:" + e3.toString());
|
|
57111
|
-
}, _error: function(e3) {
|
|
57112
|
-
return u2("error:" + e3.toString());
|
|
57113
|
-
}, _boolean: function(e3) {
|
|
57114
|
-
return u2("bool:" + e3.toString());
|
|
57115
|
-
}, _string: function(e3) {
|
|
57116
|
-
u2("string:" + e3.length + ":"), u2(e3.toString());
|
|
57117
|
-
}, _function: function(e3) {
|
|
57118
|
-
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);
|
|
57119
|
-
}, _number: function(e3) {
|
|
57120
|
-
return u2("number:" + e3.toString());
|
|
57121
|
-
}, _xml: function(e3) {
|
|
57122
|
-
return u2("xml:" + e3.toString());
|
|
57123
|
-
}, _null: function() {
|
|
57124
|
-
return u2("Null");
|
|
57125
|
-
}, _undefined: function() {
|
|
57126
|
-
return u2("Undefined");
|
|
57127
|
-
}, _regexp: function(e3) {
|
|
57128
|
-
return u2("regex:" + e3.toString());
|
|
57129
|
-
}, _uint8array: function(e3) {
|
|
57130
|
-
return u2("uint8array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57131
|
-
}, _uint8clampedarray: function(e3) {
|
|
57132
|
-
return u2("uint8clampedarray:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57133
|
-
}, _int8array: function(e3) {
|
|
57134
|
-
return u2("int8array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57135
|
-
}, _uint16array: function(e3) {
|
|
57136
|
-
return u2("uint16array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57137
|
-
}, _int16array: function(e3) {
|
|
57138
|
-
return u2("int16array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57139
|
-
}, _uint32array: function(e3) {
|
|
57140
|
-
return u2("uint32array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57141
|
-
}, _int32array: function(e3) {
|
|
57142
|
-
return u2("int32array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57143
|
-
}, _float32array: function(e3) {
|
|
57144
|
-
return u2("float32array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57145
|
-
}, _float64array: function(e3) {
|
|
57146
|
-
return u2("float64array:"), this.dispatch(Array.prototype.slice.call(e3));
|
|
57147
|
-
}, _arraybuffer: function(e3) {
|
|
57148
|
-
return u2("arraybuffer:"), this.dispatch(new Uint8Array(e3));
|
|
57149
|
-
}, _url: function(e3) {
|
|
57150
|
-
return u2("url:" + e3.toString());
|
|
57151
|
-
}, _map: function(e3) {
|
|
57152
|
-
u2("map:");
|
|
57153
|
-
e3 = Array.from(e3);
|
|
57154
|
-
return this._array(e3, false !== o3.unorderedSets);
|
|
57155
|
-
}, _set: function(e3) {
|
|
57156
|
-
u2("set:");
|
|
57157
|
-
e3 = Array.from(e3);
|
|
57158
|
-
return this._array(e3, false !== o3.unorderedSets);
|
|
57159
|
-
}, _file: function(e3) {
|
|
57160
|
-
return u2("file:"), this.dispatch([e3.name, e3.size, e3.type, e3.lastModfied]);
|
|
57161
|
-
}, _blob: function() {
|
|
57162
|
-
if (o3.ignoreUnknown) return u2("[blob]");
|
|
57163
|
-
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');
|
|
57164
|
-
}, _domwindow: function() {
|
|
57165
|
-
return u2("domwindow");
|
|
57166
|
-
}, _bigint: function(e3) {
|
|
57167
|
-
return u2("bigint:" + e3.toString());
|
|
57168
|
-
}, _process: function() {
|
|
57169
|
-
return u2("process");
|
|
57170
|
-
}, _timer: function() {
|
|
57171
|
-
return u2("timer");
|
|
57172
|
-
}, _pipe: function() {
|
|
57173
|
-
return u2("pipe");
|
|
57174
|
-
}, _tcp: function() {
|
|
57175
|
-
return u2("tcp");
|
|
57176
|
-
}, _udp: function() {
|
|
57177
|
-
return u2("udp");
|
|
57178
|
-
}, _tty: function() {
|
|
57179
|
-
return u2("tty");
|
|
57180
|
-
}, _statwatcher: function() {
|
|
57181
|
-
return u2("statwatcher");
|
|
57182
|
-
}, _securecontext: function() {
|
|
57183
|
-
return u2("securecontext");
|
|
57184
|
-
}, _connection: function() {
|
|
57185
|
-
return u2("connection");
|
|
57186
|
-
}, _zlib: function() {
|
|
57187
|
-
return u2("zlib");
|
|
57188
|
-
}, _context: function() {
|
|
57189
|
-
return u2("context");
|
|
57190
|
-
}, _nodescript: function() {
|
|
57191
|
-
return u2("nodescript");
|
|
57192
|
-
}, _httpparser: function() {
|
|
57193
|
-
return u2("httpparser");
|
|
57194
|
-
}, _dataview: function() {
|
|
57195
|
-
return u2("dataview");
|
|
57196
|
-
}, _signal: function() {
|
|
57197
|
-
return u2("signal");
|
|
57198
|
-
}, _fsevent: function() {
|
|
57199
|
-
return u2("fsevent");
|
|
57200
|
-
}, _tlswrap: function() {
|
|
57201
|
-
return u2("tlswrap");
|
|
57202
|
-
} };
|
|
57203
|
-
}
|
|
57204
|
-
function l2() {
|
|
57205
|
-
return { buf: "", write: function(e3) {
|
|
57206
|
-
this.buf += e3;
|
|
57207
|
-
}, end: function(e3) {
|
|
57208
|
-
this.buf += e3;
|
|
57209
|
-
}, read: function() {
|
|
57210
|
-
return this.buf;
|
|
57211
|
-
} };
|
|
57212
|
-
}
|
|
57213
|
-
m.writeToStream = function(e3, t3, n3) {
|
|
57214
|
-
return void 0 === n3 && (n3 = t3, t3 = {}), f(t3 = u(e3, t3), n3).dispatch(e3);
|
|
57215
|
-
};
|
|
57216
|
-
}).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", "/");
|
|
57217
|
-
}, { buffer: 3, crypto: 5, lYpoI2: 11 }], 2: [function(e2, t2, f) {
|
|
57218
|
-
!(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
|
|
57219
|
-
!function(e4) {
|
|
57220
|
-
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);
|
|
57221
|
-
function f2(e5) {
|
|
57222
|
-
e5 = e5.charCodeAt(0);
|
|
57223
|
-
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;
|
|
57224
|
-
}
|
|
57225
|
-
e4.toByteArray = function(e5) {
|
|
57226
|
-
var t5, n4;
|
|
57227
|
-
if (0 < e5.length % 4) throw new Error("Invalid string. Length must be a multiple of 4");
|
|
57228
|
-
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;
|
|
57229
|
-
function s3(e6) {
|
|
57230
|
-
o4[u3++] = e6;
|
|
57231
|
-
}
|
|
57232
|
-
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);
|
|
57233
|
-
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;
|
|
57234
|
-
}, e4.fromByteArray = function(e5) {
|
|
57235
|
-
var t5, n4, r4, o4, i4 = e5.length % 3, u3 = "";
|
|
57236
|
-
function s3(e6) {
|
|
57237
|
-
return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e6);
|
|
57238
|
-
}
|
|
57239
|
-
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);
|
|
57240
|
-
switch (i4) {
|
|
57241
|
-
case 1:
|
|
57242
|
-
u3 = (u3 += s3((n4 = e5[e5.length - 1]) >> 2)) + s3(n4 << 4 & 63) + "==";
|
|
57243
|
-
break;
|
|
57244
|
-
case 2:
|
|
57245
|
-
u3 = (u3 = (u3 += s3((n4 = (e5[e5.length - 2] << 8) + e5[e5.length - 1]) >> 10)) + s3(n4 >> 4 & 63)) + s3(n4 << 2 & 63) + "=";
|
|
57246
|
-
}
|
|
57247
|
-
return u3;
|
|
57248
|
-
};
|
|
57249
|
-
}(void 0 === f ? this.base64js = {} : f);
|
|
57250
|
-
}).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");
|
|
57251
|
-
}, { buffer: 3, lYpoI2: 11 }], 3: [function(O, e2, H) {
|
|
57252
|
-
!(function(e3, n2, f, r2, h, p2, g, y, w2) {
|
|
57253
|
-
var a2 = O("base64-js"), i2 = O("ieee754");
|
|
57254
|
-
function f(e4, t3, n3) {
|
|
57255
|
-
if (!(this instanceof f)) return new f(e4, t3, n3);
|
|
57256
|
-
var r3, o3, i3, u2, s2 = typeof e4;
|
|
57257
|
-
if ("base64" === t3 && "string" == s2) for (e4 = (u2 = e4).trim ? u2.trim() : u2.replace(/^\s+|\s+$/g, ""); e4.length % 4 != 0; ) e4 += "=";
|
|
57258
|
-
if ("number" == s2) r3 = j(e4);
|
|
57259
|
-
else if ("string" == s2) r3 = f.byteLength(e4, t3);
|
|
57260
|
-
else {
|
|
57261
|
-
if ("object" != s2) throw new Error("First argument needs to be a number, array or string.");
|
|
57262
|
-
r3 = j(e4.length);
|
|
57263
|
-
}
|
|
57264
|
-
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);
|
|
57265
|
-
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];
|
|
57266
|
-
else if ("string" == s2) o3.write(e4, 0, t3);
|
|
57267
|
-
else if ("number" == s2 && !f._useTypedArrays && !n3) for (i3 = 0; i3 < r3; i3++) o3[i3] = 0;
|
|
57268
|
-
return o3;
|
|
57269
|
-
}
|
|
57270
|
-
function b2(e4, t3, n3, r3) {
|
|
57271
|
-
return f._charsWritten = c(function(e5) {
|
|
57272
|
-
for (var t4 = [], n4 = 0; n4 < e5.length; n4++) t4.push(255 & e5.charCodeAt(n4));
|
|
57273
|
-
return t4;
|
|
57274
|
-
}(t3), e4, n3, r3);
|
|
57275
|
-
}
|
|
57276
|
-
function m(e4, t3, n3, r3) {
|
|
57277
|
-
return f._charsWritten = c(function(e5) {
|
|
57278
|
-
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);
|
|
57279
|
-
return r4;
|
|
57280
|
-
}(t3), e4, n3, r3);
|
|
57281
|
-
}
|
|
57282
|
-
function v(e4, t3, n3) {
|
|
57283
|
-
var r3 = "";
|
|
57284
|
-
n3 = Math.min(e4.length, n3);
|
|
57285
|
-
for (var o3 = t3; o3 < n3; o3++) r3 += String.fromCharCode(e4[o3]);
|
|
57286
|
-
return r3;
|
|
57287
|
-
}
|
|
57288
|
-
function o2(e4, t3, n3, r3) {
|
|
57289
|
-
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"));
|
|
57290
|
-
var o3, r3 = e4.length;
|
|
57291
|
-
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;
|
|
57292
|
-
}
|
|
57293
|
-
function u(e4, t3, n3, r3) {
|
|
57294
|
-
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"));
|
|
57295
|
-
var o3, r3 = e4.length;
|
|
57296
|
-
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;
|
|
57297
|
-
}
|
|
57298
|
-
function _(e4, t3, n3, r3) {
|
|
57299
|
-
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;
|
|
57300
|
-
}
|
|
57301
|
-
function E(e4, t3, n3, r3) {
|
|
57302
|
-
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;
|
|
57303
|
-
}
|
|
57304
|
-
function I(e4, t3, n3, r3) {
|
|
57305
|
-
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);
|
|
57306
|
-
}
|
|
57307
|
-
function A(e4, t3, n3, r3) {
|
|
57308
|
-
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);
|
|
57309
|
-
}
|
|
57310
|
-
function s(e4, t3, n3, r3, o3) {
|
|
57311
|
-
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));
|
|
57312
|
-
o3 = e4.length;
|
|
57313
|
-
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);
|
|
57314
|
-
}
|
|
57315
|
-
function l2(e4, t3, n3, r3, o3) {
|
|
57316
|
-
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));
|
|
57317
|
-
o3 = e4.length;
|
|
57318
|
-
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;
|
|
57319
|
-
}
|
|
57320
|
-
function B(e4, t3, n3, r3, o3) {
|
|
57321
|
-
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);
|
|
57322
|
-
}
|
|
57323
|
-
function L(e4, t3, n3, r3, o3) {
|
|
57324
|
-
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);
|
|
57325
|
-
}
|
|
57326
|
-
function U(e4, t3, n3, r3, o3) {
|
|
57327
|
-
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);
|
|
57328
|
-
}
|
|
57329
|
-
function x(e4, t3, n3, r3, o3) {
|
|
57330
|
-
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);
|
|
57331
|
-
}
|
|
57332
|
-
H.Buffer = f, H.SlowBuffer = f, H.INSPECT_MAX_BYTES = 50, f.poolSize = 8192, f._useTypedArrays = function() {
|
|
57333
|
-
try {
|
|
57334
|
-
var e4 = new ArrayBuffer(0), t3 = new Uint8Array(e4);
|
|
57335
|
-
return t3.foo = function() {
|
|
57336
|
-
return 42;
|
|
57337
|
-
}, 42 === t3.foo() && "function" == typeof t3.subarray;
|
|
57338
|
-
} catch (e5) {
|
|
57339
|
-
return false;
|
|
57340
|
-
}
|
|
57341
|
-
}(), f.isEncoding = function(e4) {
|
|
57342
|
-
switch (String(e4).toLowerCase()) {
|
|
57343
|
-
case "hex":
|
|
57344
|
-
case "utf8":
|
|
57345
|
-
case "utf-8":
|
|
57346
|
-
case "ascii":
|
|
57347
|
-
case "binary":
|
|
57348
|
-
case "base64":
|
|
57349
|
-
case "raw":
|
|
57350
|
-
case "ucs2":
|
|
57351
|
-
case "ucs-2":
|
|
57352
|
-
case "utf16le":
|
|
57353
|
-
case "utf-16le":
|
|
57354
|
-
return true;
|
|
57355
|
-
default:
|
|
57356
|
-
return false;
|
|
57357
|
-
}
|
|
57358
|
-
}, f.isBuffer = function(e4) {
|
|
57359
|
-
return !(null == e4 || !e4._isBuffer);
|
|
57360
|
-
}, f.byteLength = function(e4, t3) {
|
|
57361
|
-
var n3;
|
|
57362
|
-
switch (e4 += "", t3 || "utf8") {
|
|
57363
|
-
case "hex":
|
|
57364
|
-
n3 = e4.length / 2;
|
|
57365
|
-
break;
|
|
57366
|
-
case "utf8":
|
|
57367
|
-
case "utf-8":
|
|
57368
|
-
n3 = T(e4).length;
|
|
57369
|
-
break;
|
|
57370
|
-
case "ascii":
|
|
57371
|
-
case "binary":
|
|
57372
|
-
case "raw":
|
|
57373
|
-
n3 = e4.length;
|
|
57374
|
-
break;
|
|
57375
|
-
case "base64":
|
|
57376
|
-
n3 = M(e4).length;
|
|
57377
|
-
break;
|
|
57378
|
-
case "ucs2":
|
|
57379
|
-
case "ucs-2":
|
|
57380
|
-
case "utf16le":
|
|
57381
|
-
case "utf-16le":
|
|
57382
|
-
n3 = 2 * e4.length;
|
|
57383
|
-
break;
|
|
57384
|
-
default:
|
|
57385
|
-
throw new Error("Unknown encoding");
|
|
57386
|
-
}
|
|
57387
|
-
return n3;
|
|
57388
|
-
}, f.concat = function(e4, t3) {
|
|
57389
|
-
if (d2(C(e4), "Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."), 0 === e4.length) return new f(0);
|
|
57390
|
-
if (1 === e4.length) return e4[0];
|
|
57391
|
-
if ("number" != typeof t3) for (o3 = t3 = 0; o3 < e4.length; o3++) t3 += e4[o3].length;
|
|
57392
|
-
for (var n3 = new f(t3), r3 = 0, o3 = 0; o3 < e4.length; o3++) {
|
|
57393
|
-
var i3 = e4[o3];
|
|
57394
|
-
i3.copy(n3, r3), r3 += i3.length;
|
|
57395
|
-
}
|
|
57396
|
-
return n3;
|
|
57397
|
-
}, f.prototype.write = function(e4, t3, n3, r3) {
|
|
57398
|
-
isFinite(t3) ? isFinite(n3) || (r3 = n3, n3 = void 0) : (a3 = r3, r3 = t3, t3 = n3, n3 = a3), t3 = Number(t3) || 0;
|
|
57399
|
-
var o3, i3, u2, s2, a3 = this.length - t3;
|
|
57400
|
-
switch ((!n3 || a3 < (n3 = Number(n3))) && (n3 = a3), r3 = String(r3 || "utf8").toLowerCase()) {
|
|
57401
|
-
case "hex":
|
|
57402
|
-
o3 = function(e5, t4, n4, r4) {
|
|
57403
|
-
n4 = Number(n4) || 0;
|
|
57404
|
-
var o4 = e5.length - n4;
|
|
57405
|
-
(!r4 || o4 < (r4 = Number(r4))) && (r4 = o4), d2((o4 = t4.length) % 2 == 0, "Invalid hex string"), o4 / 2 < r4 && (r4 = o4 / 2);
|
|
57406
|
-
for (var i4 = 0; i4 < r4; i4++) {
|
|
57407
|
-
var u3 = parseInt(t4.substr(2 * i4, 2), 16);
|
|
57408
|
-
d2(!isNaN(u3), "Invalid hex string"), e5[n4 + i4] = u3;
|
|
57409
|
-
}
|
|
57410
|
-
return f._charsWritten = 2 * i4, i4;
|
|
57411
|
-
}(this, e4, t3, n3);
|
|
57412
|
-
break;
|
|
57413
|
-
case "utf8":
|
|
57414
|
-
case "utf-8":
|
|
57415
|
-
i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(T(e4), i3, u2, s2);
|
|
57416
|
-
break;
|
|
57417
|
-
case "ascii":
|
|
57418
|
-
case "binary":
|
|
57419
|
-
o3 = b2(this, e4, t3, n3);
|
|
57420
|
-
break;
|
|
57421
|
-
case "base64":
|
|
57422
|
-
i3 = this, u2 = t3, s2 = n3, o3 = f._charsWritten = c(M(e4), i3, u2, s2);
|
|
57423
|
-
break;
|
|
57424
|
-
case "ucs2":
|
|
57425
|
-
case "ucs-2":
|
|
57426
|
-
case "utf16le":
|
|
57427
|
-
case "utf-16le":
|
|
57428
|
-
o3 = m(this, e4, t3, n3);
|
|
57429
|
-
break;
|
|
57430
|
-
default:
|
|
57431
|
-
throw new Error("Unknown encoding");
|
|
57432
|
-
}
|
|
57433
|
-
return o3;
|
|
57434
|
-
}, f.prototype.toString = function(e4, t3, n3) {
|
|
57435
|
-
var r3, o3, i3, u2, s2 = this;
|
|
57436
|
-
if (e4 = String(e4 || "utf8").toLowerCase(), t3 = Number(t3) || 0, (n3 = void 0 !== n3 ? Number(n3) : s2.length) === t3) return "";
|
|
57437
|
-
switch (e4) {
|
|
57438
|
-
case "hex":
|
|
57439
|
-
r3 = function(e5, t4, n4) {
|
|
57440
|
-
var r4 = e5.length;
|
|
57441
|
-
(!t4 || t4 < 0) && (t4 = 0);
|
|
57442
|
-
(!n4 || n4 < 0 || r4 < n4) && (n4 = r4);
|
|
57443
|
-
for (var o4 = "", i4 = t4; i4 < n4; i4++) o4 += k(e5[i4]);
|
|
57444
|
-
return o4;
|
|
57445
|
-
}(s2, t3, n3);
|
|
57446
|
-
break;
|
|
57447
|
-
case "utf8":
|
|
57448
|
-
case "utf-8":
|
|
57449
|
-
r3 = function(e5, t4, n4) {
|
|
57450
|
-
var r4 = "", o4 = "";
|
|
57451
|
-
n4 = Math.min(e5.length, n4);
|
|
57452
|
-
for (var i4 = t4; i4 < n4; i4++) e5[i4] <= 127 ? (r4 += N(o4) + String.fromCharCode(e5[i4]), o4 = "") : o4 += "%" + e5[i4].toString(16);
|
|
57453
|
-
return r4 + N(o4);
|
|
57454
|
-
}(s2, t3, n3);
|
|
57455
|
-
break;
|
|
57456
|
-
case "ascii":
|
|
57457
|
-
case "binary":
|
|
57458
|
-
r3 = v(s2, t3, n3);
|
|
57459
|
-
break;
|
|
57460
|
-
case "base64":
|
|
57461
|
-
o3 = s2, u2 = n3, r3 = 0 === (i3 = t3) && u2 === o3.length ? a2.fromByteArray(o3) : a2.fromByteArray(o3.slice(i3, u2));
|
|
57462
|
-
break;
|
|
57463
|
-
case "ucs2":
|
|
57464
|
-
case "ucs-2":
|
|
57465
|
-
case "utf16le":
|
|
57466
|
-
case "utf-16le":
|
|
57467
|
-
r3 = function(e5, t4, n4) {
|
|
57468
|
-
for (var r4 = e5.slice(t4, n4), o4 = "", i4 = 0; i4 < r4.length; i4 += 2) o4 += String.fromCharCode(r4[i4] + 256 * r4[i4 + 1]);
|
|
57469
|
-
return o4;
|
|
57470
|
-
}(s2, t3, n3);
|
|
57471
|
-
break;
|
|
57472
|
-
default:
|
|
57473
|
-
throw new Error("Unknown encoding");
|
|
57474
|
-
}
|
|
57475
|
-
return r3;
|
|
57476
|
-
}, f.prototype.toJSON = function() {
|
|
57477
|
-
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
|
|
57478
|
-
}, f.prototype.copy = function(e4, t3, n3, r3) {
|
|
57479
|
-
if (t3 = t3 || 0, (r3 = r3 || 0 === r3 ? r3 : this.length) !== (n3 = n3 || 0) && 0 !== e4.length && 0 !== this.length) {
|
|
57480
|
-
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);
|
|
57481
|
-
var o3 = (r3 = e4.length - t3 < r3 - n3 ? e4.length - t3 + n3 : r3) - n3;
|
|
57482
|
-
if (o3 < 100 || !f._useTypedArrays) for (var i3 = 0; i3 < o3; i3++) e4[i3 + t3] = this[i3 + n3];
|
|
57483
|
-
else e4._set(this.subarray(n3, n3 + o3), t3);
|
|
57484
|
-
}
|
|
57485
|
-
}, f.prototype.slice = function(e4, t3) {
|
|
57486
|
-
var n3 = this.length;
|
|
57487
|
-
if (e4 = S(e4, n3, 0), t3 = S(t3, n3, n3), f._useTypedArrays) return f._augment(this.subarray(e4, t3));
|
|
57488
|
-
for (var r3 = t3 - e4, o3 = new f(r3, void 0, true), i3 = 0; i3 < r3; i3++) o3[i3] = this[i3 + e4];
|
|
57489
|
-
return o3;
|
|
57490
|
-
}, f.prototype.get = function(e4) {
|
|
57491
|
-
return console.log(".get() is deprecated. Access using array indexes instead."), this.readUInt8(e4);
|
|
57492
|
-
}, f.prototype.set = function(e4, t3) {
|
|
57493
|
-
return console.log(".set() is deprecated. Access using array indexes instead."), this.writeUInt8(e4, t3);
|
|
57494
|
-
}, f.prototype.readUInt8 = function(e4, t3) {
|
|
57495
|
-
if (t3 || (d2(null != e4, "missing offset"), d2(e4 < this.length, "Trying to read beyond buffer length")), !(e4 >= this.length)) return this[e4];
|
|
57496
|
-
}, f.prototype.readUInt16LE = function(e4, t3) {
|
|
57497
|
-
return o2(this, e4, true, t3);
|
|
57498
|
-
}, f.prototype.readUInt16BE = function(e4, t3) {
|
|
57499
|
-
return o2(this, e4, false, t3);
|
|
57500
|
-
}, f.prototype.readUInt32LE = function(e4, t3) {
|
|
57501
|
-
return u(this, e4, true, t3);
|
|
57502
|
-
}, f.prototype.readUInt32BE = function(e4, t3) {
|
|
57503
|
-
return u(this, e4, false, t3);
|
|
57504
|
-
}, f.prototype.readInt8 = function(e4, t3) {
|
|
57505
|
-
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];
|
|
57506
|
-
}, f.prototype.readInt16LE = function(e4, t3) {
|
|
57507
|
-
return _(this, e4, true, t3);
|
|
57508
|
-
}, f.prototype.readInt16BE = function(e4, t3) {
|
|
57509
|
-
return _(this, e4, false, t3);
|
|
57510
|
-
}, f.prototype.readInt32LE = function(e4, t3) {
|
|
57511
|
-
return E(this, e4, true, t3);
|
|
57512
|
-
}, f.prototype.readInt32BE = function(e4, t3) {
|
|
57513
|
-
return E(this, e4, false, t3);
|
|
57514
|
-
}, f.prototype.readFloatLE = function(e4, t3) {
|
|
57515
|
-
return I(this, e4, true, t3);
|
|
57516
|
-
}, f.prototype.readFloatBE = function(e4, t3) {
|
|
57517
|
-
return I(this, e4, false, t3);
|
|
57518
|
-
}, f.prototype.readDoubleLE = function(e4, t3) {
|
|
57519
|
-
return A(this, e4, true, t3);
|
|
57520
|
-
}, f.prototype.readDoubleBE = function(e4, t3) {
|
|
57521
|
-
return A(this, e4, false, t3);
|
|
57522
|
-
}, f.prototype.writeUInt8 = function(e4, t3, n3) {
|
|
57523
|
-
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);
|
|
57524
|
-
}, f.prototype.writeUInt16LE = function(e4, t3, n3) {
|
|
57525
|
-
s(this, e4, t3, true, n3);
|
|
57526
|
-
}, f.prototype.writeUInt16BE = function(e4, t3, n3) {
|
|
57527
|
-
s(this, e4, t3, false, n3);
|
|
57528
|
-
}, f.prototype.writeUInt32LE = function(e4, t3, n3) {
|
|
57529
|
-
l2(this, e4, t3, true, n3);
|
|
57530
|
-
}, f.prototype.writeUInt32BE = function(e4, t3, n3) {
|
|
57531
|
-
l2(this, e4, t3, false, n3);
|
|
57532
|
-
}, f.prototype.writeInt8 = function(e4, t3, n3) {
|
|
57533
|
-
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));
|
|
57534
|
-
}, f.prototype.writeInt16LE = function(e4, t3, n3) {
|
|
57535
|
-
B(this, e4, t3, true, n3);
|
|
57536
|
-
}, f.prototype.writeInt16BE = function(e4, t3, n3) {
|
|
57537
|
-
B(this, e4, t3, false, n3);
|
|
57538
|
-
}, f.prototype.writeInt32LE = function(e4, t3, n3) {
|
|
57539
|
-
L(this, e4, t3, true, n3);
|
|
57540
|
-
}, f.prototype.writeInt32BE = function(e4, t3, n3) {
|
|
57541
|
-
L(this, e4, t3, false, n3);
|
|
57542
|
-
}, f.prototype.writeFloatLE = function(e4, t3, n3) {
|
|
57543
|
-
U(this, e4, t3, true, n3);
|
|
57544
|
-
}, f.prototype.writeFloatBE = function(e4, t3, n3) {
|
|
57545
|
-
U(this, e4, t3, false, n3);
|
|
57546
|
-
}, f.prototype.writeDoubleLE = function(e4, t3, n3) {
|
|
57547
|
-
x(this, e4, t3, true, n3);
|
|
57548
|
-
}, f.prototype.writeDoubleBE = function(e4, t3, n3) {
|
|
57549
|
-
x(this, e4, t3, false, n3);
|
|
57550
|
-
}, f.prototype.fill = function(e4, t3, n3) {
|
|
57551
|
-
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) {
|
|
57552
|
-
d2(0 <= t3 && t3 < this.length, "start out of bounds"), d2(0 <= n3 && n3 <= this.length, "end out of bounds");
|
|
57553
|
-
for (var r3 = t3; r3 < n3; r3++) this[r3] = e4;
|
|
57554
|
-
}
|
|
57555
|
-
}, f.prototype.inspect = function() {
|
|
57556
|
-
for (var e4 = [], t3 = this.length, n3 = 0; n3 < t3; n3++) if (e4[n3] = k(this[n3]), n3 === H.INSPECT_MAX_BYTES) {
|
|
57557
|
-
e4[n3 + 1] = "...";
|
|
57558
|
-
break;
|
|
57559
|
-
}
|
|
57560
|
-
return "<Buffer " + e4.join(" ") + ">";
|
|
57561
|
-
}, f.prototype.toArrayBuffer = function() {
|
|
57562
|
-
if ("undefined" == typeof Uint8Array) throw new Error("Buffer.toArrayBuffer not supported in this browser");
|
|
57563
|
-
if (f._useTypedArrays) return new f(this).buffer;
|
|
57564
|
-
for (var e4 = new Uint8Array(this.length), t3 = 0, n3 = e4.length; t3 < n3; t3 += 1) e4[t3] = this[t3];
|
|
57565
|
-
return e4.buffer;
|
|
57566
|
-
};
|
|
57567
|
-
var t2 = f.prototype;
|
|
57568
|
-
function S(e4, t3, n3) {
|
|
57569
|
-
return "number" != typeof e4 ? n3 : t3 <= (e4 = ~~e4) ? t3 : 0 <= e4 || 0 <= (e4 += t3) ? e4 : 0;
|
|
57570
|
-
}
|
|
57571
|
-
function j(e4) {
|
|
57572
|
-
return (e4 = ~~Math.ceil(+e4)) < 0 ? 0 : e4;
|
|
57573
|
-
}
|
|
57574
|
-
function C(e4) {
|
|
57575
|
-
return (Array.isArray || function(e5) {
|
|
57576
|
-
return "[object Array]" === Object.prototype.toString.call(e5);
|
|
57577
|
-
})(e4);
|
|
57578
|
-
}
|
|
57579
|
-
function k(e4) {
|
|
57580
|
-
return e4 < 16 ? "0" + e4.toString(16) : e4.toString(16);
|
|
57581
|
-
}
|
|
57582
|
-
function T(e4) {
|
|
57583
|
-
for (var t3 = [], n3 = 0; n3 < e4.length; n3++) {
|
|
57584
|
-
var r3 = e4.charCodeAt(n3);
|
|
57585
|
-
if (r3 <= 127) t3.push(e4.charCodeAt(n3));
|
|
57586
|
-
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));
|
|
57587
|
-
}
|
|
57588
|
-
return t3;
|
|
57589
|
-
}
|
|
57590
|
-
function M(e4) {
|
|
57591
|
-
return a2.toByteArray(e4);
|
|
57592
|
-
}
|
|
57593
|
-
function c(e4, t3, n3, r3) {
|
|
57594
|
-
for (var o3 = 0; o3 < r3 && !(o3 + n3 >= t3.length || o3 >= e4.length); o3++) t3[o3 + n3] = e4[o3];
|
|
57595
|
-
return o3;
|
|
57596
|
-
}
|
|
57597
|
-
function N(e4) {
|
|
57598
|
-
try {
|
|
57599
|
-
return decodeURIComponent(e4);
|
|
57600
|
-
} catch (e5) {
|
|
57601
|
-
return String.fromCharCode(65533);
|
|
57602
|
-
}
|
|
57603
|
-
}
|
|
57604
|
-
function Y(e4, t3) {
|
|
57605
|
-
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");
|
|
57606
|
-
}
|
|
57607
|
-
function F(e4, t3, n3) {
|
|
57608
|
-
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");
|
|
57609
|
-
}
|
|
57610
|
-
function D(e4, t3, n3) {
|
|
57611
|
-
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");
|
|
57612
|
-
}
|
|
57613
|
-
function d2(e4, t3) {
|
|
57614
|
-
if (!e4) throw new Error(t3 || "Failed assertion");
|
|
57615
|
-
}
|
|
57616
|
-
f._augment = function(e4) {
|
|
57617
|
-
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;
|
|
57618
|
-
};
|
|
57619
|
-
}).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");
|
|
57620
|
-
}, { "base64-js": 2, buffer: 3, ieee754: 10, lYpoI2: 11 }], 4: [function(c, d2, e2) {
|
|
57621
|
-
!(function(e3, t2, a2, n2, r2, o2, i2, u, s) {
|
|
57622
|
-
var a2 = c("buffer").Buffer, f = 4, l2 = new a2(f);
|
|
57623
|
-
l2.fill(0);
|
|
57624
|
-
d2.exports = { hash: function(e4, t3, n3, r3) {
|
|
57625
|
-
for (var o3 = t3(function(e5, t4) {
|
|
57626
|
-
e5.length % f != 0 && (n4 = e5.length + (f - e5.length % f), e5 = a2.concat([e5, l2], n4));
|
|
57627
|
-
for (var n4, r4 = [], o4 = t4 ? e5.readInt32BE : e5.readInt32LE, i4 = 0; i4 < e5.length; i4 += f) r4.push(o4.call(e5, i4));
|
|
57628
|
-
return r4;
|
|
57629
|
-
}(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);
|
|
57630
|
-
return i3;
|
|
57631
|
-
} };
|
|
57632
|
-
}).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");
|
|
57633
|
-
}, { buffer: 3, lYpoI2: 11 }], 5: [function(v, e2, _) {
|
|
57634
|
-
!(function(l2, c, u, d2, h, p2, g, y, w2) {
|
|
57635
|
-
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);
|
|
57636
|
-
function r2(e4, n3) {
|
|
57637
|
-
var r3 = b2[e4 = e4 || "sha1"], o3 = [];
|
|
57638
|
-
return r3 || i2("algorithm:", e4, "is not yet supported"), { update: function(e5) {
|
|
57639
|
-
return u.isBuffer(e5) || (e5 = new u(e5)), o3.push(e5), e5.length, this;
|
|
57640
|
-
}, digest: function(e5) {
|
|
57641
|
-
var t3 = u.concat(o3), t3 = n3 ? function(e6, t4, n4) {
|
|
57642
|
-
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));
|
|
57643
|
-
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];
|
|
57644
|
-
return n4 = e6(u.concat([r4, n4])), e6(u.concat([o4, n4]));
|
|
57645
|
-
}(r3, n3, t3) : r3(t3);
|
|
57646
|
-
return o3 = null, e5 ? t3.toString(e5) : t3;
|
|
57647
|
-
} };
|
|
57648
|
-
}
|
|
57649
|
-
function i2() {
|
|
57650
|
-
var e4 = [].slice.call(arguments).join(" ");
|
|
57651
|
-
throw new Error([e4, "we accept pull requests", "http://github.com/dominictarr/crypto-browserify"].join("\n"));
|
|
57652
|
-
}
|
|
57653
|
-
a2.fill(0), _.createHash = function(e4) {
|
|
57654
|
-
return r2(e4);
|
|
57655
|
-
}, _.createHmac = r2, _.randomBytes = function(e4, t3) {
|
|
57656
|
-
if (!t3 || !t3.call) return new u(n2(e4));
|
|
57657
|
-
try {
|
|
57658
|
-
t3.call(this, void 0, new u(n2(e4)));
|
|
57659
|
-
} catch (e5) {
|
|
57660
|
-
t3(e5);
|
|
57661
|
-
}
|
|
57662
|
-
};
|
|
57663
|
-
var o2, f = ["createCredentials", "createCipher", "createCipheriv", "createDecipher", "createDecipheriv", "createSign", "createVerify", "createDiffieHellman", "pbkdf2"], m = function(e4) {
|
|
57664
|
-
_[e4] = function() {
|
|
57665
|
-
i2("sorry,", e4, "is not implemented yet");
|
|
57666
|
-
};
|
|
57667
|
-
};
|
|
57668
|
-
for (o2 in f) m(f[o2]);
|
|
57669
|
-
}).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");
|
|
57670
|
-
}, { "./md5": 6, "./rng": 7, "./sha": 8, "./sha256": 9, buffer: 3, lYpoI2: 11 }], 6: [function(w2, b2, e2) {
|
|
57671
|
-
!(function(e3, r2, o2, i2, u, a2, f, l2, y) {
|
|
57672
|
-
var t2 = w2("./helpers");
|
|
57673
|
-
function n2(e4, t3) {
|
|
57674
|
-
e4[t3 >> 5] |= 128 << t3 % 32, e4[14 + (t3 + 64 >>> 9 << 4)] = t3;
|
|
57675
|
-
for (var n3 = 1732584193, r3 = -271733879, o3 = -1732584194, i3 = 271733878, u2 = 0; u2 < e4.length; u2 += 16) {
|
|
57676
|
-
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);
|
|
57677
|
-
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);
|
|
57678
|
-
}
|
|
57679
|
-
return Array(n3, r3, o3, i3);
|
|
57680
|
-
}
|
|
57681
|
-
function s(e4, t3, n3, r3, o3, i3) {
|
|
57682
|
-
return g((t3 = g(g(t3, e4), g(r3, i3))) << o3 | t3 >>> 32 - o3, n3);
|
|
57683
|
-
}
|
|
57684
|
-
function c(e4, t3, n3, r3, o3, i3, u2) {
|
|
57685
|
-
return s(t3 & n3 | ~t3 & r3, e4, t3, o3, i3, u2);
|
|
57686
|
-
}
|
|
57687
|
-
function d2(e4, t3, n3, r3, o3, i3, u2) {
|
|
57688
|
-
return s(t3 & r3 | n3 & ~r3, e4, t3, o3, i3, u2);
|
|
57689
|
-
}
|
|
57690
|
-
function h(e4, t3, n3, r3, o3, i3, u2) {
|
|
57691
|
-
return s(t3 ^ n3 ^ r3, e4, t3, o3, i3, u2);
|
|
57692
|
-
}
|
|
57693
|
-
function p2(e4, t3, n3, r3, o3, i3, u2) {
|
|
57694
|
-
return s(n3 ^ (t3 | ~r3), e4, t3, o3, i3, u2);
|
|
57695
|
-
}
|
|
57696
|
-
function g(e4, t3) {
|
|
57697
|
-
var n3 = (65535 & e4) + (65535 & t3);
|
|
57698
|
-
return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
|
|
57699
|
-
}
|
|
57700
|
-
b2.exports = function(e4) {
|
|
57701
|
-
return t2.hash(e4, n2, 16);
|
|
57702
|
-
};
|
|
57703
|
-
}).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");
|
|
57704
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 7: [function(e2, l2, t2) {
|
|
57705
|
-
!(function(e3, t3, n2, r2, o2, i2, u, s, f) {
|
|
57706
|
-
l2.exports = function(e4) {
|
|
57707
|
-
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;
|
|
57708
|
-
return n3;
|
|
57709
|
-
};
|
|
57710
|
-
}).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");
|
|
57711
|
-
}, { buffer: 3, lYpoI2: 11 }], 8: [function(c, d2, e2) {
|
|
57712
|
-
!(function(e3, t2, n2, r2, o2, s, a2, f, l2) {
|
|
57713
|
-
var i2 = c("./helpers");
|
|
57714
|
-
function u(l3, c2) {
|
|
57715
|
-
l3[c2 >> 5] |= 128 << 24 - c2 % 32, l3[15 + (c2 + 64 >> 9 << 4)] = c2;
|
|
57716
|
-
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) {
|
|
57717
|
-
for (var p2 = o3, g = i3, y = u2, w2 = s2, b2 = d3, a3 = 0; a3 < 80; a3++) {
|
|
57718
|
-
r3[a3] = a3 < 16 ? l3[h + a3] : v(r3[a3 - 3] ^ r3[a3 - 8] ^ r3[a3 - 14] ^ r3[a3 - 16], 1);
|
|
57719
|
-
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;
|
|
57720
|
-
}
|
|
57721
|
-
o3 = m(o3, p2), i3 = m(i3, g), u2 = m(u2, y), s2 = m(s2, w2), d3 = m(d3, b2);
|
|
57722
|
-
}
|
|
57723
|
-
return Array(o3, i3, u2, s2, d3);
|
|
57724
|
-
}
|
|
57725
|
-
function m(e4, t3) {
|
|
57726
|
-
var n3 = (65535 & e4) + (65535 & t3);
|
|
57727
|
-
return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
|
|
57728
|
-
}
|
|
57729
|
-
function v(e4, t3) {
|
|
57730
|
-
return e4 << t3 | e4 >>> 32 - t3;
|
|
57731
|
-
}
|
|
57732
|
-
d2.exports = function(e4) {
|
|
57733
|
-
return i2.hash(e4, u, 20, true);
|
|
57734
|
-
};
|
|
57735
|
-
}).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");
|
|
57736
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 9: [function(c, d2, e2) {
|
|
57737
|
-
!(function(e3, t2, n2, r2, u, s, a2, f, l2) {
|
|
57738
|
-
function b2(e4, t3) {
|
|
57739
|
-
var n3 = (65535 & e4) + (65535 & t3);
|
|
57740
|
-
return (e4 >> 16) + (t3 >> 16) + (n3 >> 16) << 16 | 65535 & n3;
|
|
57741
|
-
}
|
|
57742
|
-
function o2(e4, l3) {
|
|
57743
|
-
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);
|
|
57744
|
-
e4[l3 >> 5] |= 128 << 24 - l3 % 32, e4[15 + (l3 + 64 >> 9 << 4)] = l3;
|
|
57745
|
-
for (var r3, o3, h = 0; h < e4.length; h += 16) {
|
|
57746
|
-
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);
|
|
57747
|
-
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]);
|
|
57748
|
-
}
|
|
57749
|
-
return t3;
|
|
57750
|
-
}
|
|
57751
|
-
var i2 = c("./helpers"), m = function(e4, t3) {
|
|
57752
|
-
return e4 >>> t3 | e4 << 32 - t3;
|
|
57753
|
-
}, v = function(e4, t3) {
|
|
57754
|
-
return e4 >>> t3;
|
|
57755
|
-
};
|
|
57756
|
-
d2.exports = function(e4) {
|
|
57757
|
-
return i2.hash(e4, o2, 32, true);
|
|
57758
|
-
};
|
|
57759
|
-
}).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");
|
|
57760
|
-
}, { "./helpers": 4, buffer: 3, lYpoI2: 11 }], 10: [function(e2, t2, f) {
|
|
57761
|
-
!(function(e3, t3, n2, r2, o2, i2, u, s, a2) {
|
|
57762
|
-
f.read = function(e4, t4, n3, r3, o3) {
|
|
57763
|
-
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];
|
|
57764
|
-
for (a3 += f2, i3 = o3 & (1 << -s2) - 1, o3 >>= -s2, s2 += l2; 0 < s2; i3 = 256 * i3 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
|
|
57765
|
-
for (u2 = i3 & (1 << -s2) - 1, i3 >>= -s2, s2 += r3; 0 < s2; u2 = 256 * u2 + e4[t4 + a3], a3 += f2, s2 -= 8) ;
|
|
57766
|
-
if (0 === i3) i3 = 1 - d2;
|
|
57767
|
-
else {
|
|
57768
|
-
if (i3 === c) return u2 ? NaN : 1 / 0 * (o3 ? -1 : 1);
|
|
57769
|
-
u2 += Math.pow(2, r3), i3 -= d2;
|
|
57770
|
-
}
|
|
57771
|
-
return (o3 ? -1 : 1) * u2 * Math.pow(2, i3 - r3);
|
|
57772
|
-
}, f.write = function(e4, t4, l2, n3, r3, c) {
|
|
57773
|
-
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;
|
|
57774
|
-
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) ;
|
|
57775
|
-
for (o3 = o3 << r3 | i3, u2 += r3; 0 < u2; e4[l2 + f2] = 255 & o3, f2 += h, o3 /= 256, u2 -= 8) ;
|
|
57776
|
-
e4[l2 + f2 - h] |= 128 * c;
|
|
57777
|
-
};
|
|
57778
|
-
}).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");
|
|
57779
|
-
}, { buffer: 3, lYpoI2: 11 }], 11: [function(e2, h, t2) {
|
|
57780
|
-
!(function(e3, t3, n2, r2, o2, f, l2, c, d2) {
|
|
57781
|
-
var i2, u, s;
|
|
57782
|
-
function a2() {
|
|
57783
|
-
}
|
|
57784
|
-
(e3 = h.exports = {}).nextTick = (u = "undefined" != typeof window && window.setImmediate, s = "undefined" != typeof window && window.postMessage && window.addEventListener, u ? function(e4) {
|
|
57785
|
-
return window.setImmediate(e4);
|
|
57786
|
-
} : s ? (i2 = [], window.addEventListener("message", function(e4) {
|
|
57787
|
-
var t4 = e4.source;
|
|
57788
|
-
t4 !== window && null !== t4 || "process-tick" !== e4.data || (e4.stopPropagation(), 0 < i2.length && i2.shift()());
|
|
57789
|
-
}, true), function(e4) {
|
|
57790
|
-
i2.push(e4), window.postMessage("process-tick", "*");
|
|
57791
|
-
}) : function(e4) {
|
|
57792
|
-
setTimeout(e4, 0);
|
|
57793
|
-
}), 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) {
|
|
57794
|
-
throw new Error("process.binding is not supported");
|
|
57795
|
-
}, e3.cwd = function() {
|
|
57796
|
-
return "/";
|
|
57797
|
-
}, e3.chdir = function(e4) {
|
|
57798
|
-
throw new Error("process.chdir is not supported");
|
|
57799
|
-
};
|
|
57800
|
-
}).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");
|
|
57801
|
-
}, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
|
|
57802
|
-
});
|
|
57803
|
-
})(object_hash);
|
|
57804
|
-
return object_hash.exports;
|
|
57805
|
-
}
|
|
57806
|
-
var object_hashExports = requireObject_hash();
|
|
57807
|
-
const hash = /* @__PURE__ */ getDefaultExportFromCjs(object_hashExports);
|
|
57808
|
-
function hashObject(obj) {
|
|
57809
|
-
return hash(obj, { unorderedArrays: true, unorderedObjects: true, unorderedSets: true });
|
|
57810
|
-
}
|
|
57811
|
-
function getUniqueIdentifier(variable) {
|
|
57812
|
-
let identifier = variable.uid;
|
|
57813
|
-
if ("nested" in variable) {
|
|
57814
|
-
identifier += variable.nested.join(",");
|
|
57815
|
-
}
|
|
57816
|
-
if ("filters" in variable && variable.filters) {
|
|
57817
|
-
identifier += hashObject(variable.filters);
|
|
57818
|
-
}
|
|
57819
|
-
return identifier;
|
|
57820
|
-
}
|
|
57821
57019
|
function isPlaceholder(value) {
|
|
57822
57020
|
return typeof value === "object" && "__ref" in value;
|
|
57823
57021
|
}
|
|
@@ -57826,9 +57024,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
57826
57024
|
if ("nested" in variable && variable.nested.length > 0) {
|
|
57827
57025
|
id += `:${variable.nested.join(",")}`;
|
|
57828
57026
|
}
|
|
57829
|
-
if ("filters" in variable) {
|
|
57830
|
-
id += `:${hashObject(variable.filters)}`;
|
|
57831
|
-
}
|
|
57832
57027
|
return id;
|
|
57833
57028
|
}
|
|
57834
57029
|
function getEntries(obj) {
|
|
@@ -57859,7 +57054,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
57859
57054
|
const normalizedValues = [];
|
|
57860
57055
|
let lookup = {};
|
|
57861
57056
|
for (const [key, val] of resolved.values.entries()) {
|
|
57862
|
-
if (isResolvedDerivedVariable(val)
|
|
57057
|
+
if (isResolvedDerivedVariable(val)) {
|
|
57863
57058
|
const { data: nestedNormalized, lookup: nestedLookup } = normalizeResolvedDerivedVariable(
|
|
57864
57059
|
val,
|
|
57865
57060
|
def.variables[key]
|
|
@@ -57896,7 +57091,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
57896
57091
|
const kwargDef = kwargsDefinition[key];
|
|
57897
57092
|
if (!kwargDef) {
|
|
57898
57093
|
data[key] = val;
|
|
57899
|
-
} else if (isDerivedVariable(kwargDef)
|
|
57094
|
+
} else if (isDerivedVariable(kwargDef)) {
|
|
57900
57095
|
const { data: nestedData, lookup: nestedLookup } = normalizeResolvedDerivedVariable(val, kwargDef);
|
|
57901
57096
|
data[key] = nestedData;
|
|
57902
57097
|
lookup = {
|
|
@@ -57988,7 +57183,13 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
57988
57183
|
await validateResponse(res, `Failed to cancel task with id: ${taskId}`);
|
|
57989
57184
|
return true;
|
|
57990
57185
|
}
|
|
57991
|
-
|
|
57186
|
+
function getUniqueIdentifier(variable) {
|
|
57187
|
+
let identifier = variable.uid;
|
|
57188
|
+
if ("nested" in variable) {
|
|
57189
|
+
identifier += variable.nested.join(",");
|
|
57190
|
+
}
|
|
57191
|
+
return identifier;
|
|
57192
|
+
}
|
|
57992
57193
|
const atomRegistry = /* @__PURE__ */ new Map();
|
|
57993
57194
|
const atomFamilyRegistry = /* @__PURE__ */ new Map();
|
|
57994
57195
|
const atomFamilyMembersRegistry = /* @__PURE__ */ new Map();
|
|
@@ -58005,7 +57206,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
58005
57206
|
}
|
|
58006
57207
|
function clearRegistries_TEST() {
|
|
58007
57208
|
for (const registry of [
|
|
58008
|
-
dataRegistry,
|
|
58009
57209
|
atomRegistry,
|
|
58010
57210
|
atomFamilyRegistry,
|
|
58011
57211
|
atomFamilyMembersRegistry,
|
|
@@ -58022,6 +57222,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
58022
57222
|
return false;
|
|
58023
57223
|
}
|
|
58024
57224
|
switch (variable.__typename) {
|
|
57225
|
+
case "ServerVariable":
|
|
58025
57226
|
case "Variable": {
|
|
58026
57227
|
if (atomRegistry.has(variable.uid)) {
|
|
58027
57228
|
return true;
|
|
@@ -58032,17 +57233,10 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
58032
57233
|
}
|
|
58033
57234
|
return atomFamilyMembersRegistry.get(family).size > 0;
|
|
58034
57235
|
}
|
|
58035
|
-
case "UrlVariable":
|
|
58036
|
-
case "DataVariable":
|
|
58037
|
-
return atomRegistry.has(variable.uid);
|
|
58038
57236
|
case "DerivedVariable": {
|
|
58039
57237
|
const key = getRegistryKey(variable, "selector");
|
|
58040
57238
|
return selectorFamilyRegistry.has(key);
|
|
58041
57239
|
}
|
|
58042
|
-
case "DerivedDataVariable": {
|
|
58043
|
-
const key = getRegistryKey(variable, "selector");
|
|
58044
|
-
return selectorFamilyRegistry.has(key);
|
|
58045
|
-
}
|
|
58046
57240
|
default:
|
|
58047
57241
|
return false;
|
|
58048
57242
|
}
|
|
@@ -58469,16 +57663,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
58469
57663
|
return /* @__PURE__ */ React__namespace.createElement(EventBusContext.Provider, { value: bus }, children);
|
|
58470
57664
|
}
|
|
58471
57665
|
class StateSynchronizer {
|
|
58472
|
-
|
|
58473
|
-
#observers = /* @__PURE__ */ new Map();
|
|
58474
|
-
// eslint-disable-next-line no-useless-constructor, no-empty-function
|
|
57666
|
+
#observers;
|
|
58475
57667
|
constructor() {
|
|
58476
|
-
|
|
58477
|
-
static getInstance() {
|
|
58478
|
-
if (!StateSynchronizer.#instance) {
|
|
58479
|
-
StateSynchronizer.#instance = new StateSynchronizer();
|
|
58480
|
-
}
|
|
58481
|
-
return StateSynchronizer.#instance;
|
|
57668
|
+
this.#observers = /* @__PURE__ */ new Map();
|
|
58482
57669
|
}
|
|
58483
57670
|
/**
|
|
58484
57671
|
* Register a key in the state synchronizer
|
|
@@ -58540,6 +57727,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
58540
57727
|
this.#observers.get(key).next(update);
|
|
58541
57728
|
}
|
|
58542
57729
|
}
|
|
57730
|
+
const STATE_SYNCHRONIZER$1 = new StateSynchronizer();
|
|
58543
57731
|
function getOrRegisterPlainVariable(variable, wsClient, taskContext, extras) {
|
|
58544
57732
|
const isNested = variable.nested && variable.nested.length > 0;
|
|
58545
57733
|
const isDefaultDerived = isDerivedVariable(variable.default);
|
|
@@ -58563,15 +57751,15 @@ Inferred class string: "${iconClasses}."`
|
|
|
58563
57751
|
) : variable.default,
|
|
58564
57752
|
effects: (extrasSerializable2) => {
|
|
58565
57753
|
const familySync = ({ onSet, setSelf, resetSelf, node }) => {
|
|
58566
|
-
if (!
|
|
58567
|
-
|
|
57754
|
+
if (!STATE_SYNCHRONIZER$1.isRegistered(variable.uid)) {
|
|
57755
|
+
STATE_SYNCHRONIZER$1.register(variable.uid, variable.default);
|
|
58568
57756
|
} else {
|
|
58569
|
-
const currentState =
|
|
57757
|
+
const currentState = STATE_SYNCHRONIZER$1.getCurrentState(variable.uid);
|
|
58570
57758
|
if (!isDefaultDerived || currentState?.type !== "initial") {
|
|
58571
57759
|
setSelf(currentState?.value);
|
|
58572
57760
|
}
|
|
58573
57761
|
}
|
|
58574
|
-
const unsub =
|
|
57762
|
+
const unsub = STATE_SYNCHRONIZER$1.subscribe(variable.uid, (update) => {
|
|
58575
57763
|
if (update.type === "initial") {
|
|
58576
57764
|
return;
|
|
58577
57765
|
}
|
|
@@ -58585,7 +57773,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
58585
57773
|
}
|
|
58586
57774
|
});
|
|
58587
57775
|
onSet((newValue, oldValue, isReset) => {
|
|
58588
|
-
|
|
57776
|
+
STATE_SYNCHRONIZER$1.notify(variable.uid, {
|
|
58589
57777
|
isReset,
|
|
58590
57778
|
nodeKey: node.key,
|
|
58591
57779
|
oldValue,
|
|
@@ -58599,12 +57787,15 @@ Inferred class string: "${iconClasses}."`
|
|
|
58599
57787
|
const storeEffect = getEffect(variable);
|
|
58600
57788
|
if (storeEffect) {
|
|
58601
57789
|
effects.push(storeEffect(variable, extrasSerializable2, wsClient, taskContext));
|
|
58602
|
-
} else {
|
|
58603
|
-
|
|
58604
|
-
|
|
58605
|
-
|
|
58606
|
-
|
|
58607
|
-
|
|
57790
|
+
} else if (isEmbedded()) {
|
|
57791
|
+
effects.push(
|
|
57792
|
+
STORES.BrowserStore.effect(
|
|
57793
|
+
variable,
|
|
57794
|
+
extrasSerializable2,
|
|
57795
|
+
wsClient,
|
|
57796
|
+
taskContext
|
|
57797
|
+
)
|
|
57798
|
+
);
|
|
58608
57799
|
}
|
|
58609
57800
|
return effects;
|
|
58610
57801
|
},
|
|
@@ -58651,6 +57842,108 @@ Inferred class string: "${iconClasses}."`
|
|
|
58651
57842
|
}
|
|
58652
57843
|
return atomInstance;
|
|
58653
57844
|
}
|
|
57845
|
+
function createDataUrl(path, pagination) {
|
|
57846
|
+
const url = new URL(path, window.location.origin);
|
|
57847
|
+
if (pagination?.limit) {
|
|
57848
|
+
url.searchParams.set("limit", String(pagination.limit));
|
|
57849
|
+
}
|
|
57850
|
+
if (pagination?.offset) {
|
|
57851
|
+
url.searchParams.set("offset", String(pagination.offset));
|
|
57852
|
+
}
|
|
57853
|
+
if (pagination?.sort) {
|
|
57854
|
+
url.searchParams.set("order_by", (pagination.sort.desc ? "-" : "") + pagination.sort.id);
|
|
57855
|
+
}
|
|
57856
|
+
if (pagination?.index) {
|
|
57857
|
+
url.searchParams.set("index", String(pagination.index));
|
|
57858
|
+
}
|
|
57859
|
+
return url;
|
|
57860
|
+
}
|
|
57861
|
+
async function validateTabularResponse(uid2, response) {
|
|
57862
|
+
if (response.status === 415) {
|
|
57863
|
+
let msg = `The requested variable ${uid2} data is not tabular`;
|
|
57864
|
+
try {
|
|
57865
|
+
const data = await response.json();
|
|
57866
|
+
if ("detail" in data) {
|
|
57867
|
+
msg += `. ${data.detail}`;
|
|
57868
|
+
}
|
|
57869
|
+
} catch {
|
|
57870
|
+
}
|
|
57871
|
+
throw new UserError(msg);
|
|
57872
|
+
}
|
|
57873
|
+
}
|
|
57874
|
+
function isDataResponse(response) {
|
|
57875
|
+
return response && typeof response === "object" && "data" in response && "count" in response;
|
|
57876
|
+
}
|
|
57877
|
+
async function fetchTabularServerVariable({
|
|
57878
|
+
variable,
|
|
57879
|
+
// Explicitly unused, required for the callback dependency to ensure its identity changes
|
|
57880
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57881
|
+
seqNumber,
|
|
57882
|
+
wsClient,
|
|
57883
|
+
extras,
|
|
57884
|
+
filters = null,
|
|
57885
|
+
pagination = null
|
|
57886
|
+
}) {
|
|
57887
|
+
const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
|
|
57888
|
+
const body = {
|
|
57889
|
+
filters: filters ?? null,
|
|
57890
|
+
ws_channel: await wsClient.getChannel()
|
|
57891
|
+
};
|
|
57892
|
+
const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
|
|
57893
|
+
await handleAuthErrors(response, true);
|
|
57894
|
+
await validateTabularResponse(variable.uid, response);
|
|
57895
|
+
await validateResponse(response, "Failed to fetch tabular data");
|
|
57896
|
+
return response.json();
|
|
57897
|
+
}
|
|
57898
|
+
function useFetchTabularServerVariable(variable, seqNumber, wsClient, extras) {
|
|
57899
|
+
return React$1.useCallback(
|
|
57900
|
+
async (filters, pagination) => {
|
|
57901
|
+
return fetchTabularServerVariable({ variable, seqNumber, wsClient, extras, filters, pagination });
|
|
57902
|
+
},
|
|
57903
|
+
[wsClient, variable, seqNumber, extras]
|
|
57904
|
+
);
|
|
57905
|
+
}
|
|
57906
|
+
function useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras) {
|
|
57907
|
+
const previousResult = React$1.useRef({
|
|
57908
|
+
data: null,
|
|
57909
|
+
count: 0,
|
|
57910
|
+
schema: { fields: [], primaryKey: [] }
|
|
57911
|
+
});
|
|
57912
|
+
return React$1.useCallback(
|
|
57913
|
+
async (filters, pagination) => {
|
|
57914
|
+
const url = createDataUrl(`/api/core/tabular-variable/${variable.uid}`, pagination);
|
|
57915
|
+
const body = {
|
|
57916
|
+
filters: filters ?? null,
|
|
57917
|
+
ws_channel: await wsClient.getChannel(),
|
|
57918
|
+
dv_values: normalizeRequest(cleanArgs(dvResult.values), variable.variables)
|
|
57919
|
+
};
|
|
57920
|
+
const response = await request(url, { body: JSON.stringify(body), method: HTTP_METHOD.POST }, extras);
|
|
57921
|
+
await handleAuthErrors(response, true);
|
|
57922
|
+
await validateTabularResponse(variable.uid, response);
|
|
57923
|
+
await validateResponse(response, "Failed to fetch tabular data");
|
|
57924
|
+
const responseJson = await response.json();
|
|
57925
|
+
const variableTaskId = `${variable.uid}-filter`;
|
|
57926
|
+
taskContext.cleanupRunningTasks(variableTaskId);
|
|
57927
|
+
if (!("task_id" in responseJson)) {
|
|
57928
|
+
previousResult.current = responseJson;
|
|
57929
|
+
return responseJson;
|
|
57930
|
+
}
|
|
57931
|
+
const taskId = responseJson.task_id;
|
|
57932
|
+
taskContext.startTask(taskId, variableTaskId);
|
|
57933
|
+
try {
|
|
57934
|
+
await wsClient.waitForTask(taskId);
|
|
57935
|
+
} catch {
|
|
57936
|
+
return previousResult.current;
|
|
57937
|
+
} finally {
|
|
57938
|
+
taskContext.endTask(taskId);
|
|
57939
|
+
}
|
|
57940
|
+
const taskResult = await fetchTaskResult(taskId, extras);
|
|
57941
|
+
previousResult.current = taskResult;
|
|
57942
|
+
return taskResult;
|
|
57943
|
+
},
|
|
57944
|
+
[variable.uid, variable.variables, dvResult, wsClient, taskContext, extras]
|
|
57945
|
+
);
|
|
57946
|
+
}
|
|
58654
57947
|
function _defineProperty(obj, key, value) {
|
|
58655
57948
|
if (key in obj) {
|
|
58656
57949
|
Object.defineProperty(obj, key, {
|
|
@@ -58995,183 +58288,109 @@ Inferred class string: "${iconClasses}."`
|
|
|
58995
58288
|
mixed: mixed$1
|
|
58996
58289
|
};
|
|
58997
58290
|
var Refine_index_6 = Refine_index.mixed;
|
|
58998
|
-
|
|
58999
|
-
|
|
59000
|
-
|
|
58291
|
+
const STORE_EXTRAS_MAP$1 = /* @__PURE__ */ new Map();
|
|
58292
|
+
function serverSyncEffect(variable, requestExtras) {
|
|
58293
|
+
STORE_EXTRAS_MAP$1.set(variable.uid, requestExtras);
|
|
58294
|
+
return RecoilSync_index_2({
|
|
58295
|
+
/** Use store uid as the unique identifier */
|
|
58296
|
+
itemKey: variable.uid,
|
|
58297
|
+
refine: Refine_index_6(),
|
|
58298
|
+
storeKey: "ServerVariable"
|
|
58299
|
+
});
|
|
58300
|
+
}
|
|
58301
|
+
const STATE_SYNCHRONIZER = new StateSynchronizer();
|
|
58302
|
+
function getOrRegisterServerVariable(variable, extras) {
|
|
58303
|
+
if (!atomFamilyRegistry.has(variable.uid)) {
|
|
58304
|
+
atomFamilyRegistry.set(
|
|
59001
58305
|
variable.uid,
|
|
59002
|
-
|
|
59003
|
-
|
|
59004
|
-
effects:
|
|
59005
|
-
|
|
59006
|
-
|
|
59007
|
-
|
|
59008
|
-
|
|
59009
|
-
|
|
59010
|
-
|
|
58306
|
+
Recoil_index_10({
|
|
58307
|
+
// NOTE: No default provided, atom starts in a pending state
|
|
58308
|
+
effects: (extrasSerializable2) => {
|
|
58309
|
+
const familySync = ({ onSet, setSelf, resetSelf, node }) => {
|
|
58310
|
+
if (!STATE_SYNCHRONIZER.isRegistered(variable.uid)) {
|
|
58311
|
+
STATE_SYNCHRONIZER.register(variable.uid, null);
|
|
58312
|
+
} else {
|
|
58313
|
+
const currentState = STATE_SYNCHRONIZER.getCurrentState(variable.uid);
|
|
58314
|
+
if (currentState?.type !== "initial") {
|
|
58315
|
+
setSelf(currentState?.value);
|
|
58316
|
+
}
|
|
58317
|
+
}
|
|
58318
|
+
const unsub = STATE_SYNCHRONIZER.subscribe(variable.uid, (update) => {
|
|
58319
|
+
if (update.type === "initial") {
|
|
58320
|
+
return;
|
|
58321
|
+
}
|
|
58322
|
+
if (update.nodeKey === node.key) {
|
|
58323
|
+
return;
|
|
58324
|
+
}
|
|
58325
|
+
if (update.isReset) {
|
|
58326
|
+
resetSelf();
|
|
58327
|
+
} else {
|
|
58328
|
+
setSelf(update.value);
|
|
58329
|
+
}
|
|
58330
|
+
});
|
|
58331
|
+
onSet((newValue, oldValue, isReset) => {
|
|
58332
|
+
STATE_SYNCHRONIZER.notify(variable.uid, {
|
|
58333
|
+
isReset,
|
|
58334
|
+
nodeKey: node.key,
|
|
58335
|
+
oldValue,
|
|
58336
|
+
type: "update",
|
|
58337
|
+
value: newValue
|
|
58338
|
+
});
|
|
58339
|
+
});
|
|
58340
|
+
return unsub;
|
|
58341
|
+
};
|
|
58342
|
+
return [familySync, serverSyncEffect(variable, extrasSerializable2)];
|
|
58343
|
+
},
|
|
59011
58344
|
key: variable.uid
|
|
59012
58345
|
})
|
|
59013
58346
|
);
|
|
59014
58347
|
}
|
|
59015
|
-
|
|
59016
|
-
|
|
59017
|
-
|
|
59018
|
-
|
|
59019
|
-
|
|
59020
|
-
function combineFilters(combinator, queries) {
|
|
59021
|
-
const validQueries = queries.filter(Boolean);
|
|
59022
|
-
if (validQueries.length === 0) {
|
|
59023
|
-
return null;
|
|
59024
|
-
}
|
|
59025
|
-
if (validQueries.length === 1) {
|
|
59026
|
-
return validQueries[0];
|
|
58348
|
+
const family = atomFamilyRegistry.get(variable.uid);
|
|
58349
|
+
const extrasSerializable = new RequestExtrasSerializable(extras);
|
|
58350
|
+
const atomInstance = family(extrasSerializable);
|
|
58351
|
+
if (!atomFamilyMembersRegistry.has(family)) {
|
|
58352
|
+
atomFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
|
|
59027
58353
|
}
|
|
59028
|
-
|
|
59029
|
-
|
|
59030
|
-
combinator
|
|
59031
|
-
};
|
|
58354
|
+
atomFamilyMembersRegistry.get(family).set(extrasSerializable.toJSON(), atomInstance);
|
|
58355
|
+
return atomInstance;
|
|
59032
58356
|
}
|
|
59033
|
-
function
|
|
58357
|
+
async function resolveServerVariable(variable, extras, resolver) {
|
|
58358
|
+
const atom2 = getOrRegisterServerVariable(variable, extras);
|
|
58359
|
+
const seqNumber = await resolver(atom2);
|
|
59034
58360
|
return {
|
|
59035
|
-
|
|
59036
|
-
|
|
59037
|
-
|
|
58361
|
+
type: "server",
|
|
58362
|
+
uid: variable.uid,
|
|
58363
|
+
sequence_number: seqNumber
|
|
59038
58364
|
};
|
|
59039
58365
|
}
|
|
59040
|
-
function
|
|
59041
|
-
const
|
|
59042
|
-
|
|
59043
|
-
|
|
59044
|
-
|
|
59045
|
-
|
|
59046
|
-
|
|
59047
|
-
|
|
59048
|
-
|
|
59049
|
-
|
|
59050
|
-
|
|
59051
|
-
|
|
59052
|
-
|
|
59053
|
-
|
|
59054
|
-
|
|
59055
|
-
|
|
59056
|
-
|
|
59057
|
-
|
|
59058
|
-
|
|
59059
|
-
|
|
59060
|
-
|
|
59061
|
-
|
|
59062
|
-
|
|
59063
|
-
async function fetchDerivedDataVariable(uid2, extras, cacheKey, wsChannel, filters, pagination) {
|
|
59064
|
-
const url = createDataUrl(`/api/core/data-variable/${uid2}`, pagination);
|
|
59065
|
-
const response = await request(
|
|
59066
|
-
url,
|
|
59067
|
-
{ body: JSON.stringify({ cache_key: cacheKey, filters, ws_channel: wsChannel }), method: HTTP_METHOD.POST },
|
|
59068
|
-
extras
|
|
59069
|
-
);
|
|
59070
|
-
await handleAuthErrors(response, true);
|
|
59071
|
-
await validateResponse(response, "Failed to fetch data variable");
|
|
59072
|
-
return response.json();
|
|
59073
|
-
}
|
|
59074
|
-
async function fetchDataVariableCount(uid2, extras, filters, cacheKey) {
|
|
59075
|
-
const response = await request(
|
|
59076
|
-
`/api/core/data-variable/${uid2}/count`,
|
|
59077
|
-
{ body: JSON.stringify({ cache_key: cacheKey, filters }), method: HTTP_METHOD.POST },
|
|
59078
|
-
extras
|
|
59079
|
-
);
|
|
59080
|
-
await handleAuthErrors(response, true);
|
|
59081
|
-
await validateResponse(response, "Failed to fetch data variable total count");
|
|
59082
|
-
return response.json();
|
|
59083
|
-
}
|
|
59084
|
-
async function fetchDataVariableSchema(uid2, extras, cacheKey) {
|
|
59085
|
-
const queryString = cacheKey ? new URLSearchParams({ cache_key: cacheKey }).toString() : "";
|
|
59086
|
-
const response = await request(
|
|
59087
|
-
`/api/core/data-variable/${uid2}/schema?${queryString}`,
|
|
59088
|
-
{ method: HTTP_METHOD.GET },
|
|
59089
|
-
extras
|
|
59090
|
-
);
|
|
59091
|
-
await handleAuthErrors(response, true);
|
|
59092
|
-
await validateResponse(response, "Failed to fetch data variable schema");
|
|
59093
|
-
return response.json();
|
|
59094
|
-
}
|
|
59095
|
-
function useFetchDataVariable(variable, serverTriggerCounter) {
|
|
59096
|
-
const eventBus = useEventBus();
|
|
59097
|
-
const extras = useRequestExtras();
|
|
59098
|
-
const dataCallback = React$1.useCallback(
|
|
59099
|
-
async (filters, pagination, options) => {
|
|
59100
|
-
const mergedFilters = combineFilters("AND", [variable.filters, filters]);
|
|
59101
|
-
const data = await fetchDataVariable(variable.uid, extras, mergedFilters, pagination);
|
|
59102
|
-
const [totalCount, schema = null] = await Promise.all([
|
|
59103
|
-
fetchDataVariableCount(variable.uid, extras, mergedFilters),
|
|
59104
|
-
...options?.schema ? [fetchDataVariableSchema(variable.uid, extras)] : []
|
|
59105
|
-
]);
|
|
59106
|
-
eventBus.publish("DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
|
|
59107
|
-
return {
|
|
59108
|
-
data,
|
|
59109
|
-
totalCount,
|
|
59110
|
-
...schema !== null && { schema }
|
|
59111
|
-
};
|
|
59112
|
-
},
|
|
59113
|
-
[variable, extras, serverTriggerCounter, eventBus]
|
|
59114
|
-
);
|
|
59115
|
-
return dataCallback;
|
|
59116
|
-
}
|
|
59117
|
-
function useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValuePromise) {
|
|
59118
|
-
const eventBus = useEventBus();
|
|
59119
|
-
const extras = useRequestExtras();
|
|
59120
|
-
const previousResult = React$1.useRef({ data: null, totalCount: 0, schema: { fields: [], primaryKey: [] } });
|
|
59121
|
-
const dataCallback = React$1.useCallback(
|
|
59122
|
-
async (filters, pagination, options) => {
|
|
59123
|
-
const mergedFilters = combineFilters("AND", [variable.filters, filters]);
|
|
59124
|
-
const dvValue = await dvValuePromise;
|
|
59125
|
-
const response = await fetchDerivedDataVariable(
|
|
59126
|
-
variable.uid,
|
|
59127
|
-
extras,
|
|
59128
|
-
dvValue.cache_key,
|
|
59129
|
-
await wsClient.getChannel(),
|
|
59130
|
-
mergedFilters,
|
|
59131
|
-
pagination
|
|
59132
|
-
);
|
|
59133
|
-
let data = null;
|
|
59134
|
-
const variableTaskId = `${variable.uid}-filter`;
|
|
59135
|
-
taskContext.cleanupRunningTasks(variableTaskId);
|
|
59136
|
-
if (response && "task_id" in response) {
|
|
59137
|
-
const taskId = response.task_id;
|
|
59138
|
-
taskContext.startTask(taskId, variableTaskId);
|
|
59139
|
-
try {
|
|
59140
|
-
await wsClient.waitForTask(taskId);
|
|
59141
|
-
} catch {
|
|
59142
|
-
eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: null });
|
|
59143
|
-
return previousResult.current;
|
|
59144
|
-
} finally {
|
|
59145
|
-
taskContext.endTask(taskId);
|
|
59146
|
-
}
|
|
59147
|
-
data = await fetchTaskResult(taskId, extras);
|
|
59148
|
-
} else {
|
|
59149
|
-
data = response;
|
|
59150
|
-
}
|
|
59151
|
-
const [totalCount, schema = null] = await Promise.all([
|
|
59152
|
-
fetchDataVariableCount(variable.uid, extras, mergedFilters, dvValue.cache_key),
|
|
59153
|
-
...options?.schema ? [fetchDataVariableSchema(variable.uid, extras, dvValue.cache_key)] : []
|
|
59154
|
-
]);
|
|
59155
|
-
previousResult.current = {
|
|
59156
|
-
data,
|
|
59157
|
-
totalCount,
|
|
59158
|
-
...schema !== null && { schema }
|
|
59159
|
-
};
|
|
59160
|
-
eventBus.publish("DERIVED_DATA_VARIABLE_LOADED", { variable, value: { data, totalCount } });
|
|
59161
|
-
return {
|
|
59162
|
-
data,
|
|
59163
|
-
totalCount,
|
|
59164
|
-
...schema !== null && { schema }
|
|
58366
|
+
function ServerVariableSyncProvider({ children }) {
|
|
58367
|
+
const { client: client2 } = React$1.useContext(websocketCtx);
|
|
58368
|
+
const getStoreValue = React$1.useCallback(async (itemKey) => {
|
|
58369
|
+
const serializableExtras = STORE_EXTRAS_MAP$1.get(itemKey);
|
|
58370
|
+
const response = await request(
|
|
58371
|
+
`/api/core/server-variable/${itemKey}/sequence`,
|
|
58372
|
+
serializableExtras?.extras ?? {}
|
|
58373
|
+
);
|
|
58374
|
+
await handleAuthErrors(response, true);
|
|
58375
|
+
await validateResponse(response, `Failed to fetch the sequence number for key: ${itemKey}`);
|
|
58376
|
+
const { sequence_number } = await response.json();
|
|
58377
|
+
return sequence_number;
|
|
58378
|
+
}, []);
|
|
58379
|
+
const listenToStoreChanges = React$1.useCallback(
|
|
58380
|
+
({ updateItem }) => {
|
|
58381
|
+
if (!client2) {
|
|
58382
|
+
return;
|
|
58383
|
+
}
|
|
58384
|
+
const valueSub = client2.serverVariableMessages$().subscribe((message) => {
|
|
58385
|
+
updateItem(message.uid, message.sequence_number);
|
|
58386
|
+
});
|
|
58387
|
+
return () => {
|
|
58388
|
+
valueSub.unsubscribe();
|
|
59165
58389
|
};
|
|
59166
58390
|
},
|
|
59167
|
-
[
|
|
58391
|
+
[client2]
|
|
59168
58392
|
);
|
|
59169
|
-
return
|
|
59170
|
-
}
|
|
59171
|
-
function registerDataVariable(variable) {
|
|
59172
|
-
if (!atomRegistry.has(variable.uid)) {
|
|
59173
|
-
atomRegistry.set(variable.uid, Recoil_index_8({ default: true, key: variable.uid }));
|
|
59174
|
-
}
|
|
58393
|
+
return /* @__PURE__ */ React$1.createElement(RecoilSync_index_1, { listen: listenToStoreChanges, read: getStoreValue, storeKey: "ServerVariable" }, children);
|
|
59175
58394
|
}
|
|
59176
58395
|
var set_1;
|
|
59177
58396
|
var hasRequiredSet;
|
|
@@ -59203,50 +58422,11 @@ Inferred class string: "${iconClasses}."`
|
|
|
59203
58422
|
}
|
|
59204
58423
|
return atomRegistry.get(triggerKey);
|
|
59205
58424
|
}
|
|
59206
|
-
function getOrRegisterDataVariableTrigger(variable, wsClient) {
|
|
59207
|
-
const key = `${variable.uid}-data`;
|
|
59208
|
-
if (!dataRegistry.has(key)) {
|
|
59209
|
-
dataRegistry.set(
|
|
59210
|
-
key,
|
|
59211
|
-
Recoil_index_8({
|
|
59212
|
-
default: {
|
|
59213
|
-
force_key: null,
|
|
59214
|
-
inc: 0
|
|
59215
|
-
},
|
|
59216
|
-
effects: [
|
|
59217
|
-
// synchronize with server triggers - increment when the variable is triggered on the server side
|
|
59218
|
-
// In the DataVariable case we always force so new key is generated
|
|
59219
|
-
({ setSelf }) => {
|
|
59220
|
-
const subscription = wsClient.serverTriggers$(variable.uid).subscribe(() => {
|
|
59221
|
-
setSelf((v) => {
|
|
59222
|
-
if (typeof v === "object" && "inc" in v) {
|
|
59223
|
-
return {
|
|
59224
|
-
force_key: nanoid(),
|
|
59225
|
-
inc: v.inc + 1
|
|
59226
|
-
};
|
|
59227
|
-
}
|
|
59228
|
-
return {
|
|
59229
|
-
force_key: nanoid(),
|
|
59230
|
-
inc: 1
|
|
59231
|
-
};
|
|
59232
|
-
});
|
|
59233
|
-
});
|
|
59234
|
-
return () => {
|
|
59235
|
-
subscription?.unsubscribe();
|
|
59236
|
-
};
|
|
59237
|
-
}
|
|
59238
|
-
],
|
|
59239
|
-
key
|
|
59240
|
-
})
|
|
59241
|
-
);
|
|
59242
|
-
}
|
|
59243
|
-
return dataRegistry.get(key);
|
|
59244
|
-
}
|
|
59245
58425
|
function buildTriggerList(variables) {
|
|
59246
58426
|
const triggers = [];
|
|
59247
58427
|
function walk(vars, path) {
|
|
59248
58428
|
for (const [idx, variable] of vars.entries()) {
|
|
59249
|
-
if (isDerivedVariable(variable)
|
|
58429
|
+
if (isDerivedVariable(variable)) {
|
|
59250
58430
|
const varPath = [...path, String(idx)];
|
|
59251
58431
|
triggers.push({
|
|
59252
58432
|
path: varPath,
|
|
@@ -59254,27 +58434,17 @@ Inferred class string: "${iconClasses}."`
|
|
|
59254
58434
|
});
|
|
59255
58435
|
walk(variable.variables, [...varPath, "values"]);
|
|
59256
58436
|
}
|
|
59257
|
-
if (isDataVariable(variable)) {
|
|
59258
|
-
triggers.push({
|
|
59259
|
-
path: path.length > 0 ? path.slice(0, -1) : [],
|
|
59260
|
-
variable
|
|
59261
|
-
});
|
|
59262
|
-
}
|
|
59263
58437
|
}
|
|
59264
58438
|
}
|
|
59265
58439
|
walk(variables, []);
|
|
59266
58440
|
return triggers;
|
|
59267
58441
|
}
|
|
59268
|
-
function registerChildTriggers(triggerList,
|
|
58442
|
+
function registerChildTriggers(triggerList, registerFunc = Recoil_index_20) {
|
|
59269
58443
|
return triggerList.map((triggerInfo) => {
|
|
59270
|
-
if (isDerivedVariable(triggerInfo.variable)
|
|
58444
|
+
if (isDerivedVariable(triggerInfo.variable)) {
|
|
59271
58445
|
const triggerIndex = getOrRegisterTrigger(triggerInfo.variable);
|
|
59272
58446
|
return registerFunc(triggerIndex);
|
|
59273
58447
|
}
|
|
59274
|
-
if (isDataVariable(triggerInfo.variable)) {
|
|
59275
|
-
const serverTrigger = getOrRegisterDataVariableTrigger(triggerInfo.variable, wsClient);
|
|
59276
|
-
return registerFunc(serverTrigger);
|
|
59277
|
-
}
|
|
59278
58448
|
throw new Error("Invalid trigger variable type");
|
|
59279
58449
|
});
|
|
59280
58450
|
}
|
|
@@ -59287,8 +58457,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
59287
58457
|
force_key,
|
|
59288
58458
|
variableUid,
|
|
59289
58459
|
values,
|
|
59290
|
-
wsClient
|
|
59291
|
-
is_data_variable = false
|
|
58460
|
+
wsClient
|
|
59292
58461
|
}) {
|
|
59293
58462
|
const cacheControl = cache2 === null ? {
|
|
59294
58463
|
"cache-control": "none"
|
|
@@ -59297,7 +58466,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
59297
58466
|
const res = await request(
|
|
59298
58467
|
`/api/core/derived-variable/${variableUid}`,
|
|
59299
58468
|
{
|
|
59300
|
-
body: JSON.stringify({
|
|
58469
|
+
body: JSON.stringify({ values, ws_channel, force_key: force_key ?? null }),
|
|
59301
58470
|
headers: { ...cacheControl },
|
|
59302
58471
|
method: HTTP_METHOD.POST
|
|
59303
58472
|
},
|
|
@@ -59316,8 +58485,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
59316
58485
|
wsClient,
|
|
59317
58486
|
extras,
|
|
59318
58487
|
cache: cache2,
|
|
59319
|
-
force_key
|
|
59320
|
-
is_data_variable = false
|
|
58488
|
+
force_key
|
|
59321
58489
|
}) {
|
|
59322
58490
|
if (!debouncedFetchSubjects[selectorKey]) {
|
|
59323
58491
|
debouncedFetchSubjects[selectorKey] = new BehaviorSubject(null);
|
|
@@ -59332,7 +58500,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
59332
58500
|
cache: cache2,
|
|
59333
58501
|
extras,
|
|
59334
58502
|
force_key,
|
|
59335
|
-
is_data_variable,
|
|
59336
58503
|
selectorKey,
|
|
59337
58504
|
values,
|
|
59338
58505
|
variableUid,
|
|
@@ -59343,7 +58510,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
59343
58510
|
});
|
|
59344
58511
|
}
|
|
59345
58512
|
function resolveValue(value, getter) {
|
|
59346
|
-
if (isResolvedDerivedVariable(value)
|
|
58513
|
+
if (isResolvedDerivedVariable(value)) {
|
|
59347
58514
|
const resolvedValues = value.values.map((v) => resolveValue(v, getter));
|
|
59348
58515
|
return {
|
|
59349
58516
|
...value,
|
|
@@ -59358,8 +58525,11 @@ Inferred class string: "${iconClasses}."`
|
|
|
59358
58525
|
default: resolveValue(value.default, getter)
|
|
59359
58526
|
};
|
|
59360
58527
|
}
|
|
59361
|
-
if (
|
|
59362
|
-
return
|
|
58528
|
+
if (isResolvedServerVariable(value)) {
|
|
58529
|
+
return {
|
|
58530
|
+
...value,
|
|
58531
|
+
sequence_number: Recoil_index_2(value.sequence_number) ? getter(value.sequence_number) : value.sequence_number
|
|
58532
|
+
};
|
|
59363
58533
|
}
|
|
59364
58534
|
if (isCondition(value)) {
|
|
59365
58535
|
return {
|
|
@@ -59378,9 +58548,12 @@ Inferred class string: "${iconClasses}."`
|
|
|
59378
58548
|
if (deps && !deps.includes(idx)) {
|
|
59379
58549
|
return [];
|
|
59380
58550
|
}
|
|
59381
|
-
if (isResolvedDerivedVariable(val)
|
|
58551
|
+
if (isResolvedDerivedVariable(val)) {
|
|
59382
58552
|
return getDeps(val.values, val.deps).flat();
|
|
59383
58553
|
}
|
|
58554
|
+
if (isResolvedServerVariable(val)) {
|
|
58555
|
+
return val.sequence_number;
|
|
58556
|
+
}
|
|
59384
58557
|
if (isResolvedSwitchVariable(val)) {
|
|
59385
58558
|
return getDeps([val.value, val.value_map, val.default], [0, 1, 2]).flat();
|
|
59386
58559
|
}
|
|
@@ -59390,9 +58563,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
59390
58563
|
function useTriggerIndex(variable) {
|
|
59391
58564
|
return Recoil_index_20(getOrRegisterTrigger(variable));
|
|
59392
58565
|
}
|
|
59393
|
-
function resolveDerivedValue(key, variables, deps, resolvedVariables,
|
|
58566
|
+
function resolveDerivedValue(key, variables, deps, resolvedVariables, get, selfTrigger) {
|
|
59394
58567
|
const triggerList = buildTriggerList(variables);
|
|
59395
|
-
const triggers = registerChildTriggers(triggerList,
|
|
58568
|
+
const triggers = registerChildTriggers(triggerList, get);
|
|
59396
58569
|
if (selfTrigger) {
|
|
59397
58570
|
triggers.unshift(selfTrigger);
|
|
59398
58571
|
}
|
|
@@ -59411,7 +58584,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
59411
58584
|
if (areArgsTheSame) {
|
|
59412
58585
|
return {
|
|
59413
58586
|
entry: previousEntry,
|
|
59414
|
-
type: "previous"
|
|
58587
|
+
type: "previous",
|
|
58588
|
+
values,
|
|
58589
|
+
depsKey: key
|
|
59415
58590
|
};
|
|
59416
58591
|
}
|
|
59417
58592
|
const previousTriggerCounters = previousEntry.args.slice(
|
|
@@ -59438,18 +58613,20 @@ Inferred class string: "${iconClasses}."`
|
|
|
59438
58613
|
relevantValues,
|
|
59439
58614
|
selfTriggerForceKey,
|
|
59440
58615
|
type: "current",
|
|
59441
|
-
values
|
|
58616
|
+
values,
|
|
58617
|
+
depsKey: key
|
|
59442
58618
|
};
|
|
59443
58619
|
}
|
|
59444
58620
|
return {
|
|
59445
58621
|
relevantValues,
|
|
59446
58622
|
selfTriggerForceKey: null,
|
|
59447
58623
|
type: "current",
|
|
59448
|
-
values
|
|
58624
|
+
values,
|
|
58625
|
+
depsKey: key
|
|
59449
58626
|
};
|
|
59450
58627
|
}
|
|
59451
|
-
function
|
|
59452
|
-
const key = getRegistryKey(variable, "selector");
|
|
58628
|
+
function getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, currentExtras) {
|
|
58629
|
+
const key = getRegistryKey(variable, "result-selector");
|
|
59453
58630
|
if (!selectorFamilyRegistry.has(key)) {
|
|
59454
58631
|
getOrRegisterTrigger(variable);
|
|
59455
58632
|
selectorFamilyRegistry.set(
|
|
@@ -59459,34 +58636,68 @@ Inferred class string: "${iconClasses}."`
|
|
|
59459
58636
|
eviction: "most-recent"
|
|
59460
58637
|
},
|
|
59461
58638
|
get: (extrasSerializable) => async ({ get }) => {
|
|
59462
|
-
const resolvedVariables =
|
|
59463
|
-
|
|
59464
|
-
|
|
59465
|
-
|
|
59466
|
-
|
|
59467
|
-
|
|
58639
|
+
const resolvedVariables = await Promise.all(
|
|
58640
|
+
variable.variables.map(async (v) => {
|
|
58641
|
+
if (!isVariable(v)) {
|
|
58642
|
+
return Promise.resolve(v);
|
|
58643
|
+
}
|
|
58644
|
+
return resolveVariable(v, wsClient, taskContext, currentExtras);
|
|
58645
|
+
})
|
|
58646
|
+
);
|
|
59468
58647
|
const selfTrigger = get(getOrRegisterTrigger(variable));
|
|
59469
|
-
const { extras } = extrasSerializable;
|
|
59470
58648
|
const selectorKey = key + extrasSerializable.toJSON();
|
|
59471
58649
|
const derivedResult = resolveDerivedValue(
|
|
59472
58650
|
selectorKey,
|
|
59473
58651
|
variable.variables,
|
|
59474
58652
|
variable.deps,
|
|
59475
58653
|
resolvedVariables,
|
|
59476
|
-
wsClient,
|
|
59477
58654
|
get,
|
|
59478
58655
|
selfTrigger
|
|
59479
58656
|
);
|
|
58657
|
+
return derivedResult;
|
|
58658
|
+
},
|
|
58659
|
+
key: nanoid()
|
|
58660
|
+
})
|
|
58661
|
+
);
|
|
58662
|
+
}
|
|
58663
|
+
const family = selectorFamilyRegistry.get(key);
|
|
58664
|
+
const serializableExtras = new RequestExtrasSerializable(currentExtras);
|
|
58665
|
+
const selectorInstance = family(serializableExtras);
|
|
58666
|
+
if (!selectorFamilyMembersRegistry.has(family)) {
|
|
58667
|
+
selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
|
|
58668
|
+
}
|
|
58669
|
+
selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
|
|
58670
|
+
return selectorInstance;
|
|
58671
|
+
}
|
|
58672
|
+
function getOrRegisterDerivedVariable(variable, wsClient, taskContext, currentExtras) {
|
|
58673
|
+
const key = getRegistryKey(variable, "selector");
|
|
58674
|
+
if (!selectorFamilyRegistry.has(key)) {
|
|
58675
|
+
getOrRegisterTrigger(variable);
|
|
58676
|
+
selectorFamilyRegistry.set(
|
|
58677
|
+
key,
|
|
58678
|
+
Recoil_index_11({
|
|
58679
|
+
cachePolicy_UNSTABLE: {
|
|
58680
|
+
eviction: "most-recent"
|
|
58681
|
+
},
|
|
58682
|
+
get: (extrasSerializable) => async ({ get }) => {
|
|
58683
|
+
const selectorKey = key + extrasSerializable.toJSON();
|
|
58684
|
+
const dvResultSelector = getOrRegisterDerivedVariableResult(
|
|
58685
|
+
variable,
|
|
58686
|
+
wsClient,
|
|
58687
|
+
taskContext,
|
|
58688
|
+
extrasSerializable.extras
|
|
58689
|
+
);
|
|
58690
|
+
const derivedResult = get(dvResultSelector);
|
|
59480
58691
|
if (derivedResult.type === "previous") {
|
|
59481
58692
|
return { cache_key: derivedResult.entry.cacheKey, value: derivedResult.entry.result };
|
|
59482
58693
|
}
|
|
58694
|
+
const { extras } = extrasSerializable;
|
|
59483
58695
|
let variableResponse = null;
|
|
59484
58696
|
try {
|
|
59485
58697
|
variableResponse = await debouncedFetchDerivedVariable({
|
|
59486
58698
|
cache: variable.cache,
|
|
59487
58699
|
extras,
|
|
59488
58700
|
force_key: derivedResult.selfTriggerForceKey,
|
|
59489
|
-
is_data_variable: isDerivedDataVariable(variable),
|
|
59490
58701
|
selectorKey,
|
|
59491
58702
|
values: normalizeRequest(cleanArgs(derivedResult.values), variable.variables),
|
|
59492
58703
|
variableUid: variable.uid,
|
|
@@ -59499,34 +58710,37 @@ Inferred class string: "${iconClasses}."`
|
|
|
59499
58710
|
}
|
|
59500
58711
|
const cacheKey = variableResponse.cache_key;
|
|
59501
58712
|
let variableValue = null;
|
|
59502
|
-
|
|
59503
|
-
|
|
59504
|
-
|
|
59505
|
-
|
|
59506
|
-
|
|
59507
|
-
|
|
59508
|
-
|
|
59509
|
-
|
|
59510
|
-
return {
|
|
59511
|
-
cache_key: cacheKey,
|
|
59512
|
-
value: null
|
|
59513
|
-
};
|
|
59514
|
-
} finally {
|
|
59515
|
-
taskContext.endTask(taskId);
|
|
59516
|
-
}
|
|
59517
|
-
try {
|
|
59518
|
-
variableValue = await fetchTaskResult(taskId, extras);
|
|
59519
|
-
} catch (e2) {
|
|
58713
|
+
taskContext.cleanupRunningTasks(variable.uid);
|
|
58714
|
+
if (isTaskResponse$1(variableResponse)) {
|
|
58715
|
+
const taskId = variableResponse.task_id;
|
|
58716
|
+
taskContext.startTask(taskId, variable.uid, getRegistryKey(variable, "trigger"));
|
|
58717
|
+
try {
|
|
58718
|
+
await wsClient.waitForTask(taskId);
|
|
58719
|
+
} catch (e2) {
|
|
58720
|
+
if (e2 instanceof TaskError) {
|
|
59520
58721
|
e2.selectorId = key;
|
|
59521
58722
|
e2.selectorExtras = extrasSerializable.toJSON();
|
|
59522
58723
|
throw e2;
|
|
59523
58724
|
}
|
|
59524
|
-
|
|
59525
|
-
|
|
58725
|
+
return {
|
|
58726
|
+
cache_key: cacheKey,
|
|
58727
|
+
value: null
|
|
58728
|
+
};
|
|
58729
|
+
} finally {
|
|
58730
|
+
taskContext.endTask(taskId);
|
|
59526
58731
|
}
|
|
58732
|
+
try {
|
|
58733
|
+
variableValue = await fetchTaskResult(taskId, extras);
|
|
58734
|
+
} catch (e2) {
|
|
58735
|
+
e2.selectorId = key;
|
|
58736
|
+
e2.selectorExtras = extrasSerializable.toJSON();
|
|
58737
|
+
throw e2;
|
|
58738
|
+
}
|
|
58739
|
+
} else {
|
|
58740
|
+
variableValue = variableResponse.value;
|
|
59527
58741
|
}
|
|
59528
58742
|
variableValue = "nested" in variable ? resolveNested(variableValue, variable.nested) : variableValue;
|
|
59529
|
-
depsRegistry.set(
|
|
58743
|
+
depsRegistry.set(derivedResult.depsKey, {
|
|
59530
58744
|
args: derivedResult.relevantValues,
|
|
59531
58745
|
cacheKey,
|
|
59532
58746
|
result: variableValue
|
|
@@ -59638,20 +58852,13 @@ Inferred class string: "${iconClasses}."`
|
|
|
59638
58852
|
cloned[key] = nested.length === 1 ? newValue : setNested(cloned[key], nested.slice(1), newValue);
|
|
59639
58853
|
return cloned;
|
|
59640
58854
|
}
|
|
59641
|
-
function resolveVariable(variable, client2, taskContext, extras, resolver = (
|
|
59642
|
-
if (isDerivedVariable(variable)
|
|
58855
|
+
async function resolveVariable(variable, client2, taskContext, extras, resolver = (state) => Promise.resolve(state)) {
|
|
58856
|
+
if (isDerivedVariable(variable)) {
|
|
59643
58857
|
getOrRegisterDerivedVariable(variable, client2, taskContext, extras);
|
|
59644
|
-
const values =
|
|
58858
|
+
const values = await Promise.all(
|
|
58859
|
+
variable.variables.map((v) => resolveVariable(v, client2, taskContext, extras, resolver))
|
|
58860
|
+
);
|
|
59645
58861
|
const deps = variable.deps.map((dep) => variable.variables.findIndex((v) => v.uid === dep.uid));
|
|
59646
|
-
if (isDerivedDataVariable(variable)) {
|
|
59647
|
-
return {
|
|
59648
|
-
deps,
|
|
59649
|
-
filters: variable.filters,
|
|
59650
|
-
type: "derived-data",
|
|
59651
|
-
uid: variable.uid,
|
|
59652
|
-
values
|
|
59653
|
-
};
|
|
59654
|
-
}
|
|
59655
58862
|
return {
|
|
59656
58863
|
deps,
|
|
59657
58864
|
type: "derived",
|
|
@@ -59659,22 +58866,20 @@ Inferred class string: "${iconClasses}."`
|
|
|
59659
58866
|
values
|
|
59660
58867
|
};
|
|
59661
58868
|
}
|
|
59662
|
-
if (
|
|
59663
|
-
|
|
59664
|
-
|
|
59665
|
-
if (isUrlVariable(variable)) {
|
|
59666
|
-
return resolver(getOrRegisterUrlVariable(variable));
|
|
58869
|
+
if (isServerVariable(variable)) {
|
|
58870
|
+
getOrRegisterServerVariable(variable, extras);
|
|
58871
|
+
return resolveServerVariable(variable, extras, resolver);
|
|
59667
58872
|
}
|
|
59668
58873
|
if (isSwitchVariable(variable)) {
|
|
59669
|
-
let resolvedValue = isVariable(variable.value) ? resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
|
|
58874
|
+
let resolvedValue = isVariable(variable.value) ? await resolveVariable(variable.value, client2, taskContext, extras, resolver) : variable.value;
|
|
59670
58875
|
if (isCondition(resolvedValue)) {
|
|
59671
58876
|
resolvedValue = {
|
|
59672
58877
|
...resolvedValue,
|
|
59673
|
-
variable: resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
|
|
58878
|
+
variable: await resolveVariable(resolvedValue.variable, client2, taskContext, extras, resolver)
|
|
59674
58879
|
};
|
|
59675
58880
|
}
|
|
59676
|
-
const resolvedValueMap = isVariable(variable.value_map) ? resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
|
|
59677
|
-
const resolvedDefault = isVariable(variable.default) ? resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
|
|
58881
|
+
const resolvedValueMap = isVariable(variable.value_map) ? await resolveVariable(variable.value_map, client2, taskContext, extras, resolver) : variable.value_map;
|
|
58882
|
+
const resolvedDefault = isVariable(variable.default) ? await resolveVariable(variable.default, client2, taskContext, extras, resolver) : variable.default;
|
|
59678
58883
|
return {
|
|
59679
58884
|
type: "switch",
|
|
59680
58885
|
uid: variable.uid,
|
|
@@ -59689,7 +58894,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
59689
58894
|
return resolver(getOrRegisterPlainVariable(variable, client2, taskContext, extras));
|
|
59690
58895
|
}
|
|
59691
58896
|
function cleanValue(value, forceKeyOverride) {
|
|
59692
|
-
if (isResolvedDerivedVariable(value)
|
|
58897
|
+
if (isResolvedDerivedVariable(value)) {
|
|
59693
58898
|
const { deps, ...rest } = value;
|
|
59694
58899
|
const cleanedValues = value.values.map((v) => cleanValue(v));
|
|
59695
58900
|
return {
|
|
@@ -60597,19 +59802,27 @@ Inferred class string: "${iconClasses}."`
|
|
|
60597
59802
|
storeKey: "BrowserStore"
|
|
60598
59803
|
});
|
|
60599
59804
|
}
|
|
59805
|
+
function urlEffect(variable) {
|
|
59806
|
+
return RecoilSync_index_6({
|
|
59807
|
+
history: "push",
|
|
59808
|
+
itemKey: variable.store.query,
|
|
59809
|
+
refine: Refine_index_6()
|
|
59810
|
+
});
|
|
59811
|
+
}
|
|
60600
59812
|
const STORES = {
|
|
60601
59813
|
BackendStore: {
|
|
60602
|
-
effect: backendStoreEffect
|
|
60603
|
-
sync: BackendStoreSync
|
|
59814
|
+
effect: backendStoreEffect
|
|
60604
59815
|
},
|
|
60605
59816
|
BrowserStore: {
|
|
60606
|
-
effect: localStorageEffect
|
|
60607
|
-
|
|
59817
|
+
effect: localStorageEffect
|
|
59818
|
+
},
|
|
59819
|
+
QueryParamStore: {
|
|
59820
|
+
effect: urlEffect
|
|
60608
59821
|
}
|
|
60609
59822
|
};
|
|
60610
59823
|
function getEffect(variable) {
|
|
60611
59824
|
const storeName = variable.store?.__typename;
|
|
60612
|
-
if (!storeName) {
|
|
59825
|
+
if (!storeName || !(storeName in STORES)) {
|
|
60613
59826
|
return null;
|
|
60614
59827
|
}
|
|
60615
59828
|
return STORES[storeName]?.effect ?? null;
|
|
@@ -60656,10 +59869,275 @@ Inferred class string: "${iconClasses}."`
|
|
|
60656
59869
|
const lookupKey = String(value);
|
|
60657
59870
|
return valueMap[lookupKey] ?? defaultValue;
|
|
60658
59871
|
}
|
|
59872
|
+
const COLUMN_PREFIX_REGEX = /__(?:col|index)__\d+__/;
|
|
59873
|
+
function combineFilters(combinator, queries) {
|
|
59874
|
+
const validQueries = queries.filter((x) => x !== null && x !== void 0);
|
|
59875
|
+
if (validQueries.length === 0) {
|
|
59876
|
+
return null;
|
|
59877
|
+
}
|
|
59878
|
+
if (validQueries.length === 1) {
|
|
59879
|
+
return validQueries[0];
|
|
59880
|
+
}
|
|
59881
|
+
return {
|
|
59882
|
+
clauses: validQueries,
|
|
59883
|
+
combinator
|
|
59884
|
+
};
|
|
59885
|
+
}
|
|
59886
|
+
function inferColumnType(value, hint) {
|
|
59887
|
+
if (typeof value === "number") {
|
|
59888
|
+
return "numerical";
|
|
59889
|
+
}
|
|
59890
|
+
if (typeof value === "string") {
|
|
59891
|
+
return "categorical";
|
|
59892
|
+
}
|
|
59893
|
+
if (value instanceof Date) {
|
|
59894
|
+
return "datetime";
|
|
59895
|
+
}
|
|
59896
|
+
return "categorical";
|
|
59897
|
+
}
|
|
59898
|
+
function filterRow(row, column, operator, value, columnHints) {
|
|
59899
|
+
const cellValue = row[column];
|
|
59900
|
+
if (operator === "CONTAINS") {
|
|
59901
|
+
return String(cellValue).toLowerCase().includes(String(value).toLowerCase());
|
|
59902
|
+
}
|
|
59903
|
+
const colType = inferColumnType(cellValue);
|
|
59904
|
+
try {
|
|
59905
|
+
let processedValue = value;
|
|
59906
|
+
let processedCellValue = cellValue;
|
|
59907
|
+
if (Array.isArray(value)) {
|
|
59908
|
+
return value.includes(cellValue);
|
|
59909
|
+
}
|
|
59910
|
+
if (colType === "datetime") {
|
|
59911
|
+
if (Array.isArray(value)) {
|
|
59912
|
+
processedValue = value.map((v) => new Date(v).getTime());
|
|
59913
|
+
} else {
|
|
59914
|
+
processedValue = new Date(value).getTime();
|
|
59915
|
+
}
|
|
59916
|
+
if (typeof cellValue === "number") {
|
|
59917
|
+
processedCellValue = cellValue;
|
|
59918
|
+
} else if (cellValue instanceof Date) {
|
|
59919
|
+
processedCellValue = cellValue.getTime();
|
|
59920
|
+
} else if (typeof cellValue === "string") {
|
|
59921
|
+
processedCellValue = parseISO$1(cellValue).getTime();
|
|
59922
|
+
} else {
|
|
59923
|
+
processedCellValue = 0;
|
|
59924
|
+
}
|
|
59925
|
+
} else if (colType === "categorical") {
|
|
59926
|
+
processedValue = String(value);
|
|
59927
|
+
processedCellValue = String(cellValue);
|
|
59928
|
+
} else if (colType === "numerical") {
|
|
59929
|
+
if (Array.isArray(value)) {
|
|
59930
|
+
processedValue = value.map((v) => {
|
|
59931
|
+
const num = Number(v);
|
|
59932
|
+
return Number.isNaN(num) ? 0 : num;
|
|
59933
|
+
});
|
|
59934
|
+
} else {
|
|
59935
|
+
const num = Number(value);
|
|
59936
|
+
processedValue = Number.isNaN(num) ? 0 : num;
|
|
59937
|
+
}
|
|
59938
|
+
const cellNum = Number(cellValue);
|
|
59939
|
+
processedCellValue = Number.isNaN(cellNum) ? 0 : cellNum;
|
|
59940
|
+
}
|
|
59941
|
+
switch (operator) {
|
|
59942
|
+
case "GT":
|
|
59943
|
+
return processedCellValue > processedValue;
|
|
59944
|
+
case "LT":
|
|
59945
|
+
return processedCellValue < processedValue;
|
|
59946
|
+
case "NE":
|
|
59947
|
+
return processedCellValue !== processedValue;
|
|
59948
|
+
case "BT":
|
|
59949
|
+
if (Array.isArray(processedValue) && processedValue.length === 2) {
|
|
59950
|
+
return processedCellValue >= processedValue[0] && processedCellValue <= processedValue[1];
|
|
59951
|
+
}
|
|
59952
|
+
return false;
|
|
59953
|
+
case "EQ":
|
|
59954
|
+
default:
|
|
59955
|
+
return processedCellValue === processedValue;
|
|
59956
|
+
}
|
|
59957
|
+
} catch (error) {
|
|
59958
|
+
console.warn("Filter error:", error, { column, value, operator });
|
|
59959
|
+
return true;
|
|
59960
|
+
}
|
|
59961
|
+
}
|
|
59962
|
+
function resolveFilterQuery(row, query, columnHints) {
|
|
59963
|
+
if ("column" in query) {
|
|
59964
|
+
const cleanColumn = query.column.replace(COLUMN_PREFIX_REGEX, "");
|
|
59965
|
+
return filterRow(row, cleanColumn, query.operator, query.value);
|
|
59966
|
+
}
|
|
59967
|
+
const results = query.clauses.map((clause) => resolveFilterQuery(row, clause));
|
|
59968
|
+
if (query.combinator === "AND") {
|
|
59969
|
+
return results.every((result) => result);
|
|
59970
|
+
}
|
|
59971
|
+
if (query.combinator === "OR") {
|
|
59972
|
+
return results.some((result) => result);
|
|
59973
|
+
}
|
|
59974
|
+
return true;
|
|
59975
|
+
}
|
|
59976
|
+
function applyFilters(data, filters, pagination, columnHints) {
|
|
59977
|
+
if (!data || data.length === 0) {
|
|
59978
|
+
return { data: [], count: 0, schema: null };
|
|
59979
|
+
}
|
|
59980
|
+
let filteredData = data;
|
|
59981
|
+
if (filters) {
|
|
59982
|
+
filteredData = data.filter((row) => resolveFilterQuery(row, filters));
|
|
59983
|
+
}
|
|
59984
|
+
const totalCount = filteredData.length;
|
|
59985
|
+
if (pagination) {
|
|
59986
|
+
if (pagination.index !== void 0) {
|
|
59987
|
+
const targetRow = data[pagination.index];
|
|
59988
|
+
return {
|
|
59989
|
+
data: targetRow ? [targetRow] : [],
|
|
59990
|
+
count: totalCount,
|
|
59991
|
+
schema: null
|
|
59992
|
+
};
|
|
59993
|
+
}
|
|
59994
|
+
if (pagination.sort) {
|
|
59995
|
+
const { id, desc } = pagination.sort;
|
|
59996
|
+
filteredData = [...filteredData].sort((a2, b2) => {
|
|
59997
|
+
const aVal = a2[id];
|
|
59998
|
+
const bVal = b2[id];
|
|
59999
|
+
if (aVal == null && bVal == null) {
|
|
60000
|
+
return 0;
|
|
60001
|
+
}
|
|
60002
|
+
if (aVal == null) {
|
|
60003
|
+
return desc ? 1 : -1;
|
|
60004
|
+
}
|
|
60005
|
+
if (bVal == null) {
|
|
60006
|
+
return desc ? -1 : 1;
|
|
60007
|
+
}
|
|
60008
|
+
const colType = inferColumnType(aVal);
|
|
60009
|
+
let comparison = 0;
|
|
60010
|
+
if (colType === "numerical") {
|
|
60011
|
+
comparison = Number(aVal) - Number(bVal);
|
|
60012
|
+
} else if (colType === "datetime") {
|
|
60013
|
+
let aTime = 0;
|
|
60014
|
+
if (typeof aVal === "number") {
|
|
60015
|
+
aTime = aVal;
|
|
60016
|
+
} else if (aVal instanceof Date) {
|
|
60017
|
+
aTime = aVal.getTime();
|
|
60018
|
+
} else if (typeof aVal === "string") {
|
|
60019
|
+
aTime = parseISO$1(aVal).getTime();
|
|
60020
|
+
}
|
|
60021
|
+
let bTime = 0;
|
|
60022
|
+
if (typeof bVal === "number") {
|
|
60023
|
+
bTime = bVal;
|
|
60024
|
+
} else if (bVal instanceof Date) {
|
|
60025
|
+
bTime = bVal.getTime();
|
|
60026
|
+
} else if (typeof bVal === "string") {
|
|
60027
|
+
bTime = parseISO$1(bVal).getTime();
|
|
60028
|
+
}
|
|
60029
|
+
comparison = aTime - bTime;
|
|
60030
|
+
} else {
|
|
60031
|
+
comparison = String(aVal).localeCompare(String(bVal));
|
|
60032
|
+
}
|
|
60033
|
+
return desc ? -comparison : comparison;
|
|
60034
|
+
});
|
|
60035
|
+
}
|
|
60036
|
+
const startIndex = pagination.offset || 0;
|
|
60037
|
+
const endIndex = pagination.limit ? startIndex + pagination.limit : filteredData.length;
|
|
60038
|
+
filteredData = filteredData.slice(startIndex, endIndex);
|
|
60039
|
+
}
|
|
60040
|
+
return {
|
|
60041
|
+
data: filteredData,
|
|
60042
|
+
count: totalCount,
|
|
60043
|
+
schema: null
|
|
60044
|
+
};
|
|
60045
|
+
}
|
|
60046
|
+
const INDEX = "__index__";
|
|
60047
|
+
function appendIndex(df) {
|
|
60048
|
+
if (df.length > 0 && !(INDEX in df[0])) {
|
|
60049
|
+
return df.map((row, i2) => ({ ...row, [INDEX]: i2 }));
|
|
60050
|
+
}
|
|
60051
|
+
return df;
|
|
60052
|
+
}
|
|
60053
|
+
function createFetcher(df) {
|
|
60054
|
+
const data = appendIndex(df);
|
|
60055
|
+
return async (filters, pagination) => {
|
|
60056
|
+
return applyFilters(data, filters, pagination);
|
|
60057
|
+
};
|
|
60058
|
+
}
|
|
60059
|
+
function useTabularVariable(variable) {
|
|
60060
|
+
const extras = useRequestExtras();
|
|
60061
|
+
const { client: wsClient } = React$1.useContext(websocketCtx);
|
|
60062
|
+
if (!isVariable(variable) || isSingleVariable(variable)) {
|
|
60063
|
+
const [data] = useVariable(variable);
|
|
60064
|
+
return React$1.useMemo(() => createFetcher(data), [data]);
|
|
60065
|
+
}
|
|
60066
|
+
const variablesContext = React$1.useContext(variablesCtx);
|
|
60067
|
+
variablesContext?.variables.current.add(variable.uid);
|
|
60068
|
+
React$1.useEffect(() => {
|
|
60069
|
+
return () => {
|
|
60070
|
+
variablesContext?.variables.current.delete(variable.uid);
|
|
60071
|
+
};
|
|
60072
|
+
}, []);
|
|
60073
|
+
if (isServerVariable(variable)) {
|
|
60074
|
+
const serverAtom = getOrRegisterServerVariable(variable, extras);
|
|
60075
|
+
const atomCount = Recoil_index_20(serverAtom);
|
|
60076
|
+
return useFetchTabularServerVariable(variable, atomCount, wsClient, extras);
|
|
60077
|
+
}
|
|
60078
|
+
const taskContext = useTaskContext();
|
|
60079
|
+
const dvResultSelector = getOrRegisterDerivedVariableResult(variable, wsClient, taskContext, extras);
|
|
60080
|
+
const dvResultLoadable = Recoil_index_21(dvResultSelector);
|
|
60081
|
+
const [dvResult, setDvResult] = React$1.useState(() => dvResultLoadable.getValue());
|
|
60082
|
+
React$1.useEffect(() => {
|
|
60083
|
+
if (dvResultLoadable.state === "hasValue") {
|
|
60084
|
+
setDvResult(dvResultLoadable.getValue());
|
|
60085
|
+
}
|
|
60086
|
+
}, [dvResultLoadable]);
|
|
60087
|
+
return useFetchTabularDerivedVariable(variable, dvResult, wsClient, taskContext, extras);
|
|
60088
|
+
}
|
|
60089
|
+
async function getTabularVariableValue(variable, ctx) {
|
|
60090
|
+
if (!isVariable(variable)) {
|
|
60091
|
+
return variable;
|
|
60092
|
+
}
|
|
60093
|
+
if (isSingleVariable(variable)) {
|
|
60094
|
+
return resolveVariable(
|
|
60095
|
+
variable,
|
|
60096
|
+
ctx.client,
|
|
60097
|
+
ctx.taskContext,
|
|
60098
|
+
ctx.extras,
|
|
60099
|
+
(v) => ctx.snapshot.getLoadable(v).toPromise()
|
|
60100
|
+
);
|
|
60101
|
+
}
|
|
60102
|
+
if (isServerVariable(variable)) {
|
|
60103
|
+
const response2 = await fetchTabularServerVariable({
|
|
60104
|
+
variable,
|
|
60105
|
+
// doesn't matter for fetching, will get up to date anyway
|
|
60106
|
+
seqNumber: 0,
|
|
60107
|
+
wsClient: ctx.client,
|
|
60108
|
+
extras: ctx.extras
|
|
60109
|
+
});
|
|
60110
|
+
return response2.data;
|
|
60111
|
+
}
|
|
60112
|
+
const resolved = await resolveVariable(
|
|
60113
|
+
variable,
|
|
60114
|
+
ctx.client,
|
|
60115
|
+
ctx.taskContext,
|
|
60116
|
+
ctx.extras,
|
|
60117
|
+
(v) => ctx.snapshot.getLoadable(v).toPromise()
|
|
60118
|
+
);
|
|
60119
|
+
const result = await fetchDerivedVariable({
|
|
60120
|
+
cache: variable.cache,
|
|
60121
|
+
extras: ctx.extras,
|
|
60122
|
+
force_key: null,
|
|
60123
|
+
/**
|
|
60124
|
+
* In this case we're not concerned about different selectors fetching the value so just use the uid
|
|
60125
|
+
*/
|
|
60126
|
+
selectorKey: resolved.uid,
|
|
60127
|
+
values: normalizeRequest(cleanArgs(resolved.values), variable.variables),
|
|
60128
|
+
variableUid: resolved.uid,
|
|
60129
|
+
wsClient: ctx.client
|
|
60130
|
+
});
|
|
60131
|
+
if (isTaskResponse$1(result)) {
|
|
60132
|
+
throw new UserError("Task DerivedVariables are not supported in this context");
|
|
60133
|
+
}
|
|
60134
|
+
const response = result.value;
|
|
60135
|
+
return response.data;
|
|
60136
|
+
}
|
|
60659
60137
|
function warnUpdateOnDerivedState() {
|
|
60660
60138
|
console.warn("You tried to call update on variable with derived state, this is a noop and will be ignored.");
|
|
60661
60139
|
}
|
|
60662
|
-
function useVariable(variable, opts = {}) {
|
|
60140
|
+
function useVariable(variable, opts = { serverVariable: "disallow" }) {
|
|
60663
60141
|
const extras = useRequestExtras();
|
|
60664
60142
|
const { client: wsClient } = React$1.useContext(websocketCtx);
|
|
60665
60143
|
const taskContext = useTaskContext();
|
|
@@ -60680,9 +60158,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
60680
60158
|
variablesContext?.variables.current.delete(variable.uid);
|
|
60681
60159
|
};
|
|
60682
60160
|
}, []);
|
|
60683
|
-
if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
|
|
60684
|
-
throw new Error(`Non-data variable expected, got ${variable.__typename}`);
|
|
60685
|
-
}
|
|
60686
60161
|
if (isDerivedVariable(variable)) {
|
|
60687
60162
|
const selector2 = useDerivedVariable(variable, wsClient, taskContext, extras);
|
|
60688
60163
|
const selectorLoadable = Recoil_index_28(selector2);
|
|
@@ -60694,13 +60169,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
60694
60169
|
const deferred2 = useDeferLoadable(selectorLoadable, opts.suspend);
|
|
60695
60170
|
return [deferred2.value, warnUpdateOnDerivedState];
|
|
60696
60171
|
}
|
|
60697
|
-
if (isUrlVariable(variable)) {
|
|
60698
|
-
const [urlValue, setUrlValue] = useUrlVariable(variable);
|
|
60699
|
-
React$1.useEffect(() => {
|
|
60700
|
-
bus.publish("URL_VARIABLE_LOADED", { variable, value: urlValue });
|
|
60701
|
-
}, [urlValue]);
|
|
60702
|
-
return [urlValue, setUrlValue];
|
|
60703
|
-
}
|
|
60704
60172
|
if (isSwitchVariable(variable)) {
|
|
60705
60173
|
return [useSwitchVariable(variable), warnUpdateOnDerivedState];
|
|
60706
60174
|
}
|
|
@@ -60723,6 +60191,27 @@ Inferred class string: "${iconClasses}."`
|
|
|
60723
60191
|
}
|
|
60724
60192
|
return [stateValue, warnUpdateOnDerivedState];
|
|
60725
60193
|
}
|
|
60194
|
+
if (isServerVariable(variable)) {
|
|
60195
|
+
if (opts.serverVariable === "disallow") {
|
|
60196
|
+
throw new UserError("ServerVariable cannot be directly consumed by this component");
|
|
60197
|
+
}
|
|
60198
|
+
const atom2 = React$1.useMemo(() => getOrRegisterServerVariable(variable, extras), [variable, extras]);
|
|
60199
|
+
const [seqNumber] = Recoil_index_22(atom2);
|
|
60200
|
+
const fetcher = useTabularVariable(variable);
|
|
60201
|
+
const { data } = reactQuery.useSuspenseQuery({
|
|
60202
|
+
// use the seq number as a dependency to refetch on changes
|
|
60203
|
+
queryKey: ["use-variable-server-variable", variable.uid, seqNumber],
|
|
60204
|
+
queryFn: async () => {
|
|
60205
|
+
const result = await fetcher(null, {
|
|
60206
|
+
limit: 1,
|
|
60207
|
+
offset: 0
|
|
60208
|
+
});
|
|
60209
|
+
return result.data;
|
|
60210
|
+
},
|
|
60211
|
+
refetchOnWindowFocus: false
|
|
60212
|
+
});
|
|
60213
|
+
return [data?.[0] ?? null, warnUpdateOnDerivedState];
|
|
60214
|
+
}
|
|
60726
60215
|
const recoilState = getOrRegisterPlainVariable(variable, wsClient, taskContext, extras);
|
|
60727
60216
|
if (!isDerivedVariable(variable.default)) {
|
|
60728
60217
|
const [value, setValue] = Recoil_index_22(recoilState);
|
|
@@ -60980,24 +60469,18 @@ Inferred class string: "${iconClasses}."`
|
|
|
60980
60469
|
return React$1.useMemo(() => ({ get }), [get]);
|
|
60981
60470
|
}
|
|
60982
60471
|
async function invokeAction(input, executionId, annotatedAction, actionCtx) {
|
|
60983
|
-
const resolvedKwargs =
|
|
60984
|
-
(
|
|
60985
|
-
const
|
|
60986
|
-
acc[k] = isVariable(value) ? resolveVariable(
|
|
60472
|
+
const resolvedKwargs = await Promise.all(
|
|
60473
|
+
Object.entries(annotatedAction.dynamic_kwargs).map(async ([k, value]) => {
|
|
60474
|
+
const resolvedValue = isVariable(value) ? await resolveVariable(
|
|
60987
60475
|
value,
|
|
60988
60476
|
actionCtx.wsClient,
|
|
60989
60477
|
actionCtx.taskCtx,
|
|
60990
60478
|
actionCtx.extras,
|
|
60991
|
-
(v) => (
|
|
60992
|
-
// This is only called for primitive variables so it should always resolve successfully
|
|
60993
|
-
// hence not using a promise
|
|
60994
|
-
actionCtx.snapshot.getLoadable(v).getValue()
|
|
60995
|
-
)
|
|
60479
|
+
(v) => actionCtx.snapshot.getLoadable(v).toPromise()
|
|
60996
60480
|
) : value;
|
|
60997
|
-
return
|
|
60998
|
-
}
|
|
60999
|
-
|
|
61000
|
-
);
|
|
60481
|
+
return [k, resolvedValue];
|
|
60482
|
+
})
|
|
60483
|
+
).then((entries) => Object.fromEntries(entries));
|
|
61001
60484
|
const ws_channel = await actionCtx.wsClient.getChannel();
|
|
61002
60485
|
const res = await request(
|
|
61003
60486
|
`/api/core/action/${annotatedAction.definition_uid}`,
|
|
@@ -61271,130 +60754,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
61271
60754
|
const { login, logout, ...extraRoutes } = authConfig.auth_components;
|
|
61272
60755
|
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) }));
|
|
61273
60756
|
}
|
|
61274
|
-
function useDataVariable(variable) {
|
|
61275
|
-
const extras = useRequestExtras();
|
|
61276
|
-
const { client: wsClient } = React$1.useContext(websocketCtx);
|
|
61277
|
-
if (isDataVariable(variable)) {
|
|
61278
|
-
registerDataVariable(variable);
|
|
61279
|
-
const serverTriggers$ = React$1.useMemo(() => wsClient.serverTriggers$(variable.uid), []);
|
|
61280
|
-
const [serverTriggerCounter, setServerTriggerCounter] = React$1.useState(0);
|
|
61281
|
-
React$1.useEffect(() => {
|
|
61282
|
-
const sub = serverTriggers$.subscribe(() => setServerTriggerCounter((c) => c + 1));
|
|
61283
|
-
return () => sub.unsubscribe();
|
|
61284
|
-
}, [serverTriggers$]);
|
|
61285
|
-
const fetchDataVariable2 = useFetchDataVariable(variable, serverTriggerCounter);
|
|
61286
|
-
return fetchDataVariable2;
|
|
61287
|
-
}
|
|
61288
|
-
const variablesContext = React$1.useContext(variablesCtx);
|
|
61289
|
-
variablesContext?.variables.current.add(variable.uid);
|
|
61290
|
-
React$1.useEffect(() => {
|
|
61291
|
-
return () => {
|
|
61292
|
-
variablesContext?.variables.current.delete(variable.uid);
|
|
61293
|
-
};
|
|
61294
|
-
}, []);
|
|
61295
|
-
const taskContext = useTaskContext();
|
|
61296
|
-
const dvSelector = useDerivedVariable(variable, wsClient, taskContext, extras);
|
|
61297
|
-
const dvLoadable = Recoil_index_21(dvSelector);
|
|
61298
|
-
const [dvValue, setDvValue] = React$1.useState(dvLoadable.toPromise());
|
|
61299
|
-
React$1.useEffect(() => {
|
|
61300
|
-
if (dvLoadable.state === "loading") {
|
|
61301
|
-
setDvValue(dvLoadable.toPromise());
|
|
61302
|
-
}
|
|
61303
|
-
}, [dvLoadable]);
|
|
61304
|
-
const fetchDerivedDataVariable2 = useFetchDerivedDataVariable(variable, taskContext, wsClient, dvValue);
|
|
61305
|
-
return fetchDerivedDataVariable2;
|
|
61306
|
-
}
|
|
61307
|
-
function useAnyVariable(variable) {
|
|
61308
|
-
if (isDataVariable(variable) || isDerivedDataVariable(variable)) {
|
|
61309
|
-
const getData = useDataVariable(variable);
|
|
61310
|
-
const { data, refetch } = reactQuery.useQuery({
|
|
61311
|
-
// ideally would be 0 but that causes infinite loops, see https://github.com/TanStack/query/issues/2367
|
|
61312
|
-
cacheTime: 1,
|
|
61313
|
-
queryFn: async () => {
|
|
61314
|
-
const dataResponse = await getData();
|
|
61315
|
-
return dataResponse.data;
|
|
61316
|
-
},
|
|
61317
|
-
queryKey: ["any-variable-data", variable.uid],
|
|
61318
|
-
refetchOnWindowFocus: false,
|
|
61319
|
-
suspense: true
|
|
61320
|
-
});
|
|
61321
|
-
React$1.useEffect(() => {
|
|
61322
|
-
refetch();
|
|
61323
|
-
}, [getData]);
|
|
61324
|
-
return data ?? void 0;
|
|
61325
|
-
}
|
|
61326
|
-
return useVariable(variable, {
|
|
61327
|
-
suspend: false
|
|
61328
|
-
})[0];
|
|
61329
|
-
}
|
|
61330
|
-
function getVariableValue(variable, shouldFetchVariable = false, ctx) {
|
|
61331
|
-
const resolved = resolveVariable(
|
|
61332
|
-
variable,
|
|
61333
|
-
ctx.client,
|
|
61334
|
-
ctx.taskContext,
|
|
61335
|
-
ctx.extras,
|
|
61336
|
-
(v) => ctx.snapshot.getLoadable(v).getValue()
|
|
61337
|
-
);
|
|
61338
|
-
if (isResolvedSwitchVariable(resolved)) {
|
|
61339
|
-
throw new UserError("Switch variables are not supported in this context");
|
|
61340
|
-
}
|
|
61341
|
-
if (!shouldFetchVariable || !isDerivedVariable(variable) && !isDataVariable(variable) && !isDerivedDataVariable(variable)) {
|
|
61342
|
-
return resolved;
|
|
61343
|
-
}
|
|
61344
|
-
if (!isResolvedDerivedVariable(resolved) && !isResolvedDataVariable(resolved) && !isResolvedDerivedDataVariable(resolved)) {
|
|
61345
|
-
return resolved;
|
|
61346
|
-
}
|
|
61347
|
-
if (isResolvedDataVariable(resolved)) {
|
|
61348
|
-
return fetchDataVariable(resolved.uid, ctx.extras, resolved.filters);
|
|
61349
|
-
}
|
|
61350
|
-
return fetchDerivedVariable({
|
|
61351
|
-
cache: variable.cache,
|
|
61352
|
-
extras: ctx.extras,
|
|
61353
|
-
force_key: null,
|
|
61354
|
-
/**
|
|
61355
|
-
* In this case we're not concerned about different selectors fetching the value so just use the uid
|
|
61356
|
-
*/
|
|
61357
|
-
selectorKey: resolved.uid,
|
|
61358
|
-
values: normalizeRequest(
|
|
61359
|
-
cleanArgs(resolved.values),
|
|
61360
|
-
variable.variables
|
|
61361
|
-
),
|
|
61362
|
-
variableUid: resolved.uid,
|
|
61363
|
-
wsClient: ctx.client
|
|
61364
|
-
}).then((resp) => {
|
|
61365
|
-
if (isTaskResponse$1(resp)) {
|
|
61366
|
-
throw new Error("Task DerivedVariables are not supported in this context");
|
|
61367
|
-
}
|
|
61368
|
-
if (isDerivedDataVariable(variable)) {
|
|
61369
|
-
return ctx.client.getChannel().then(
|
|
61370
|
-
(chan) => fetchDerivedDataVariable(variable.uid, ctx.extras, resp.cache_key, chan, variable.filters)
|
|
61371
|
-
);
|
|
61372
|
-
}
|
|
61373
|
-
return resp.value;
|
|
61374
|
-
});
|
|
61375
|
-
}
|
|
61376
|
-
function useVariableValue(variable, shouldFetchVariable = false) {
|
|
61377
|
-
const taskContext = useTaskContext();
|
|
61378
|
-
const { client: client2 } = React$1.useContext(websocketCtx);
|
|
61379
|
-
const { search } = useLocation();
|
|
61380
|
-
const extras = useRequestExtras();
|
|
61381
|
-
if (!isVariable(variable)) {
|
|
61382
|
-
return () => variable;
|
|
61383
|
-
}
|
|
61384
|
-
return Recoil_index_31(
|
|
61385
|
-
({ snapshot }) => {
|
|
61386
|
-
return () => {
|
|
61387
|
-
return getVariableValue(variable, shouldFetchVariable, {
|
|
61388
|
-
client: client2,
|
|
61389
|
-
extras,
|
|
61390
|
-
snapshot,
|
|
61391
|
-
taskContext
|
|
61392
|
-
});
|
|
61393
|
-
};
|
|
61394
|
-
},
|
|
61395
|
-
[variable.uid, useDeepCompare(taskContext), client2, search, extras]
|
|
61396
|
-
);
|
|
61397
|
-
}
|
|
61398
60757
|
function useRefreshSelector() {
|
|
61399
60758
|
return Recoil_index_31(({ refresh }) => {
|
|
61400
60759
|
return (key, extras) => {
|
|
@@ -61413,16 +60772,16 @@ Inferred class string: "${iconClasses}."`
|
|
|
61413
60772
|
const { client: client2 } = React$1.useContext(websocketCtx);
|
|
61414
60773
|
const taskCtx = useTaskContext();
|
|
61415
60774
|
return Recoil_index_31(({ snapshot }) => {
|
|
61416
|
-
return (variable) => {
|
|
60775
|
+
return async (variable) => {
|
|
61417
60776
|
if (!isRegistered(variable)) {
|
|
61418
60777
|
return "__NOT_REGISTERED__";
|
|
61419
60778
|
}
|
|
61420
|
-
const resolvedVariable = resolveVariable(
|
|
60779
|
+
const resolvedVariable = await resolveVariable(
|
|
61421
60780
|
variable,
|
|
61422
60781
|
client2,
|
|
61423
60782
|
taskCtx,
|
|
61424
60783
|
extras,
|
|
61425
|
-
(v) => snapshot.getLoadable(v).
|
|
60784
|
+
(v) => snapshot.getLoadable(v).toPromise()
|
|
61426
60785
|
);
|
|
61427
60786
|
return resolvedVariable;
|
|
61428
60787
|
};
|
|
@@ -61711,14 +61070,12 @@ Inferred class string: "${iconClasses}."`
|
|
|
61711
61070
|
eviction: "most-recent"
|
|
61712
61071
|
},
|
|
61713
61072
|
get: (extrasSerializable) => async ({ get }) => {
|
|
61714
|
-
const resolvedKwargs =
|
|
61715
|
-
(
|
|
61716
|
-
const
|
|
61717
|
-
|
|
61718
|
-
|
|
61719
|
-
|
|
61720
|
-
{}
|
|
61721
|
-
);
|
|
61073
|
+
const resolvedKwargs = await Promise.all(
|
|
61074
|
+
Object.entries(dynamicKwargs).map(async ([k, value]) => {
|
|
61075
|
+
const resolvedValue = isVariable(value) ? await resolveVariable(value, wsClient, taskContext, currentExtras) : value;
|
|
61076
|
+
return [k, resolvedValue];
|
|
61077
|
+
})
|
|
61078
|
+
).then((entries) => Object.fromEntries(entries));
|
|
61722
61079
|
const resolvedKwargsList = Object.values(resolvedKwargs);
|
|
61723
61080
|
const kwargsList = Object.values(dynamicKwargs);
|
|
61724
61081
|
const triggerAtom = getOrRegisterComponentTrigger(uid2);
|
|
@@ -61730,7 +61087,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
61730
61087
|
kwargsList,
|
|
61731
61088
|
// pass deps=kwargs
|
|
61732
61089
|
resolvedKwargsList,
|
|
61733
|
-
wsClient,
|
|
61734
61090
|
get,
|
|
61735
61091
|
selfTrigger
|
|
61736
61092
|
);
|
|
@@ -61766,8 +61122,10 @@ Inferred class string: "${iconClasses}."`
|
|
|
61766
61122
|
taskContext.startTask(taskId, key, getComponentRegistryKey(uid2, true));
|
|
61767
61123
|
try {
|
|
61768
61124
|
await wsClient.waitForTask(taskId);
|
|
61769
|
-
} catch {
|
|
61770
|
-
|
|
61125
|
+
} catch (e2) {
|
|
61126
|
+
e2.selectorId = key;
|
|
61127
|
+
e2.selectorExtras = extrasSerializable.toJSON();
|
|
61128
|
+
throw e2;
|
|
61771
61129
|
} finally {
|
|
61772
61130
|
taskContext.endTask(taskId);
|
|
61773
61131
|
}
|
|
@@ -62126,7 +61484,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
62126
61484
|
const taskIds = findRunningTasks(taskContext, props.variablesRef);
|
|
62127
61485
|
if (taskIds.length > 0) {
|
|
62128
61486
|
setSubscribedTaskIds(taskIds);
|
|
62129
|
-
progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) =>
|
|
61487
|
+
progressSubscription = wsClient.progressUpdates$(...taskIds).subscribe((notif) => {
|
|
61488
|
+
setLatestProgressUpdate(notif.message);
|
|
61489
|
+
});
|
|
62130
61490
|
clearInterval(timer2);
|
|
62131
61491
|
}
|
|
62132
61492
|
}, POLLING_INTERVAL);
|
|
@@ -62304,7 +61664,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
62304
61664
|
pollingInterval = variable.polling_interval;
|
|
62305
61665
|
}
|
|
62306
61666
|
variable.variables.forEach((value) => {
|
|
62307
|
-
if (isDerivedVariable(value)
|
|
61667
|
+
if (isDerivedVariable(value)) {
|
|
62308
61668
|
const innerPollingInterval = getDerivedVariablePollingInterval(value);
|
|
62309
61669
|
if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
|
|
62310
61670
|
pollingInterval = innerPollingInterval;
|
|
@@ -62316,7 +61676,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
62316
61676
|
function computePollingInterval(kwargs, componentInterval) {
|
|
62317
61677
|
let pollingInterval;
|
|
62318
61678
|
Object.values(kwargs).forEach((value) => {
|
|
62319
|
-
if (isDerivedVariable(value)
|
|
61679
|
+
if (isDerivedVariable(value)) {
|
|
62320
61680
|
const innerPollingInterval = getDerivedVariablePollingInterval(value);
|
|
62321
61681
|
if (innerPollingInterval && (!pollingInterval || pollingInterval > innerPollingInterval)) {
|
|
62322
61682
|
pollingInterval = innerPollingInterval;
|
|
@@ -63017,9 +62377,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
63017
62377
|
function VariableStateProvider(props) {
|
|
63018
62378
|
const getVariableState = useVariableState();
|
|
63019
62379
|
React$1.useEffect(() => {
|
|
63020
|
-
const sub = props.wsClient?.variableRequests$().subscribe((req) => {
|
|
62380
|
+
const sub = props.wsClient?.variableRequests$().subscribe(async (req) => {
|
|
63021
62381
|
try {
|
|
63022
|
-
const variableValue = getVariableState(req.message.variable);
|
|
62382
|
+
const variableValue = await getVariableState(req.message.variable);
|
|
63023
62383
|
props.wsClient.sendVariable(variableValue, req.message.__rchan);
|
|
63024
62384
|
} catch (err2) {
|
|
63025
62385
|
console.warn(`Error when processing a getVariableValue request: ${String(err2)}`);
|
|
@@ -63129,7 +62489,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
63129
62489
|
{
|
|
63130
62490
|
value: { actionRegistry: actions, componentRegistry: components, refetchComponents }
|
|
63131
62491
|
},
|
|
63132
|
-
/* @__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))))
|
|
62492
|
+
/* @__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)))))
|
|
63133
62493
|
)));
|
|
63134
62494
|
}
|
|
63135
62495
|
const Wrapper = styled.div`
|
|
@@ -63183,22 +62543,22 @@ Inferred class string: "${iconClasses}."`
|
|
|
63183
62543
|
};
|
|
63184
62544
|
const ResetVariables = (ctx, actionImpl) => {
|
|
63185
62545
|
actionImpl.variables.filter(isVariable).forEach((variable) => {
|
|
63186
|
-
if (isDerivedVariable(variable)
|
|
62546
|
+
if (isDerivedVariable(variable)) {
|
|
63187
62547
|
const triggerAtom = getOrRegisterTrigger(variable);
|
|
63188
62548
|
ctx.set(triggerAtom, (triggerIndexValue) => ({
|
|
63189
62549
|
force_key: nanoid(),
|
|
63190
62550
|
inc: triggerIndexValue.inc + 1
|
|
63191
62551
|
}));
|
|
63192
|
-
} else if (
|
|
63193
|
-
const urlAtom = getOrRegisterUrlVariable(variable);
|
|
63194
|
-
ctx.set(urlAtom, variable.default);
|
|
63195
|
-
ctx.eventBus.publish("URL_VARIABLE_LOADED", { variable, value: variable.default });
|
|
63196
|
-
} else if (isDataVariable(variable)) ;
|
|
63197
|
-
else if (isSwitchVariable(variable)) ;
|
|
62552
|
+
} else if (isSwitchVariable(variable)) ;
|
|
63198
62553
|
else if (isStateVariable(variable)) ;
|
|
62554
|
+
else if (isServerVariable(variable)) ;
|
|
63199
62555
|
else {
|
|
63200
62556
|
const plainAtom = getOrRegisterPlainVariable(variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
|
|
63201
|
-
|
|
62557
|
+
if (variable.store?.__typename === "QueryParamStore") {
|
|
62558
|
+
ctx.set(plainAtom, variable.default);
|
|
62559
|
+
} else {
|
|
62560
|
+
ctx.reset(plainAtom);
|
|
62561
|
+
}
|
|
63202
62562
|
ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable, value: variable.default });
|
|
63203
62563
|
}
|
|
63204
62564
|
});
|
|
@@ -63213,20 +62573,10 @@ Inferred class string: "${iconClasses}."`
|
|
|
63213
62573
|
const INPUT = "__dara_input__";
|
|
63214
62574
|
const TOGGLE = "__dara_toggle__";
|
|
63215
62575
|
const UpdateVariable = async (ctx, actionImpl) => {
|
|
63216
|
-
|
|
63217
|
-
|
|
63218
|
-
switch (actionImpl.variable.__typename) {
|
|
63219
|
-
case "Variable":
|
|
63220
|
-
varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
|
|
63221
|
-
eventName = "PLAIN_VARIABLE_LOADED";
|
|
63222
|
-
break;
|
|
63223
|
-
case "UrlVariable":
|
|
63224
|
-
varAtom = getOrRegisterUrlVariable(actionImpl.variable);
|
|
63225
|
-
eventName = "URL_VARIABLE_LOADED";
|
|
63226
|
-
break;
|
|
63227
|
-
case "DataVariable":
|
|
63228
|
-
throw new Error("DataVariable is not supported in UpdateVariable action");
|
|
62576
|
+
if (actionImpl.variable.__typename !== "Variable") {
|
|
62577
|
+
throw new UserError("UpdateVariable action only supports Variables");
|
|
63229
62578
|
}
|
|
62579
|
+
const varAtom = getOrRegisterPlainVariable(actionImpl.variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
|
|
63230
62580
|
let newValue;
|
|
63231
62581
|
if (actionImpl.value === INPUT) {
|
|
63232
62582
|
newValue = ctx.input;
|
|
@@ -63237,8 +62587,11 @@ Inferred class string: "${iconClasses}."`
|
|
|
63237
62587
|
newValue = actionImpl.value;
|
|
63238
62588
|
}
|
|
63239
62589
|
ctx.set(varAtom, newValue);
|
|
63240
|
-
ctx.eventBus.publish(
|
|
62590
|
+
ctx.eventBus.publish("PLAIN_VARIABLE_LOADED", { variable: actionImpl.variable, value: newValue });
|
|
63241
62591
|
};
|
|
62592
|
+
function commonjsRequire(path) {
|
|
62593
|
+
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.');
|
|
62594
|
+
}
|
|
63242
62595
|
var exceljs_min = { exports: {} };
|
|
63243
62596
|
/*! ExcelJS 19-10-2023 */
|
|
63244
62597
|
var hasRequiredExceljs_min;
|
|
@@ -86441,13 +85794,16 @@ Inferred class string: "${iconClasses}."`
|
|
|
86441
85794
|
return FileSaver_min$1.exports;
|
|
86442
85795
|
}
|
|
86443
85796
|
var FileSaver_minExports = requireFileSaver_min();
|
|
85797
|
+
const COL_PATTERN = /^__col__\d+__(.+)$/;
|
|
85798
|
+
const INDEX_PATTERN = /^__index__\d+__(.+)$/;
|
|
86444
85799
|
const restoreColumnName = (colName) => {
|
|
86445
|
-
const colMatch = colName.match(
|
|
85800
|
+
const colMatch = colName.match(COL_PATTERN);
|
|
86446
85801
|
if (colMatch) {
|
|
86447
85802
|
return colMatch[1];
|
|
86448
85803
|
}
|
|
86449
|
-
|
|
86450
|
-
|
|
85804
|
+
const indexMatch = colName.match(INDEX_PATTERN);
|
|
85805
|
+
if (indexMatch) {
|
|
85806
|
+
return indexMatch[1];
|
|
86451
85807
|
}
|
|
86452
85808
|
return colName;
|
|
86453
85809
|
};
|
|
@@ -86455,7 +85811,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
86455
85811
|
return content.map((row) => {
|
|
86456
85812
|
const processedRow = {};
|
|
86457
85813
|
Object.entries(row).forEach(([key, value]) => {
|
|
86458
|
-
if (key === "__index__"
|
|
85814
|
+
if (key === "__index__") {
|
|
86459
85815
|
return;
|
|
86460
85816
|
}
|
|
86461
85817
|
const restoredKey = restoreColumnName(key);
|
|
@@ -86550,17 +85906,23 @@ Inferred class string: "${iconClasses}."`
|
|
|
86550
85906
|
return null;
|
|
86551
85907
|
};
|
|
86552
85908
|
const DownloadVariable = async (ctx, actionImpl) => {
|
|
86553
|
-
let value =
|
|
85909
|
+
let value = await getTabularVariableValue(actionImpl.variable, {
|
|
86554
85910
|
client: ctx.wsClient,
|
|
86555
85911
|
extras: ctx.extras,
|
|
86556
85912
|
search: ctx.location.search,
|
|
86557
85913
|
snapshot: ctx.snapshot,
|
|
86558
85914
|
taskContext: ctx.taskCtx
|
|
86559
85915
|
});
|
|
86560
|
-
if (value
|
|
86561
|
-
|
|
85916
|
+
if (value === null) {
|
|
85917
|
+
ctx.notificationCtx.pushNotification({
|
|
85918
|
+
key: "_downloadVariable",
|
|
85919
|
+
message: "Failed to fetch the variable value",
|
|
85920
|
+
status: Status.ERROR,
|
|
85921
|
+
title: "Error fetching variable value"
|
|
85922
|
+
});
|
|
85923
|
+
return;
|
|
86562
85924
|
}
|
|
86563
|
-
if (
|
|
85925
|
+
if (Array.isArray(value)) {
|
|
86564
85926
|
value = processDataForDownload(value);
|
|
86565
85927
|
}
|
|
86566
85928
|
const fileName = actionImpl.file_name || "Data";
|
|
@@ -86867,7 +86229,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
86867
86229
|
return /* @__PURE__ */ React__namespace.createElement(DynamicComponent$1, { component: transformedRenderer });
|
|
86868
86230
|
}, isEqual$5);
|
|
86869
86231
|
function ForImpl(props) {
|
|
86870
|
-
const items =
|
|
86232
|
+
const [items] = useVariable(props.items, { suspend: false });
|
|
86871
86233
|
const markers = React__namespace.useMemo(() => getInjectionMarkers(props.renderer), [props.renderer]);
|
|
86872
86234
|
const key = React__namespace.useMemo(() => props.key_accessor?.split(".") ?? null, [props.key_accessor]);
|
|
86873
86235
|
const getItemKey = React__namespace.useCallback(
|
|
@@ -86950,6 +86312,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
86950
86312
|
exports.ResetVariables = ResetVariables;
|
|
86951
86313
|
exports.RouterContent = RouterContent;
|
|
86952
86314
|
exports.RowFallback = RowFallback;
|
|
86315
|
+
exports.ServerVariableSyncProvider = ServerVariableSyncProvider;
|
|
86953
86316
|
exports.SideBarFrame = SideBarFrame;
|
|
86954
86317
|
exports.TemplateRoot = TemplateRoot;
|
|
86955
86318
|
exports.TopBarFrame = TopBarFrame;
|
|
@@ -86969,29 +86332,30 @@ Inferred class string: "${iconClasses}."`
|
|
|
86969
86332
|
exports.clearCaches_TEST = clearCaches_TEST;
|
|
86970
86333
|
exports.clearRegistries_TEST = clearRegistries_TEST;
|
|
86971
86334
|
exports.combineFilters = combineFilters;
|
|
86972
|
-
exports.dataRegistry = dataRegistry;
|
|
86973
86335
|
exports.default = run;
|
|
86974
86336
|
exports.depsRegistry = depsRegistry;
|
|
86975
86337
|
exports.fetchDerivedVariable = fetchDerivedVariable;
|
|
86338
|
+
exports.fetchTabularServerVariable = fetchTabularServerVariable;
|
|
86976
86339
|
exports.fetchTaskResult = fetchTaskResult;
|
|
86977
86340
|
exports.getComponentRegistryKey = getComponentRegistryKey;
|
|
86978
86341
|
exports.getDeps = getDeps;
|
|
86979
86342
|
exports.getIcon = getIcon;
|
|
86980
86343
|
exports.getOrRegisterDerivedVariable = getOrRegisterDerivedVariable;
|
|
86344
|
+
exports.getOrRegisterDerivedVariableResult = getOrRegisterDerivedVariableResult;
|
|
86981
86345
|
exports.getOrRegisterDerivedVariableValue = getOrRegisterDerivedVariableValue;
|
|
86346
|
+
exports.getOrRegisterServerVariable = getOrRegisterServerVariable;
|
|
86982
86347
|
exports.getRegistryKey = getRegistryKey;
|
|
86983
86348
|
exports.getSessionToken = getSessionToken;
|
|
86349
|
+
exports.getTabularVariableValue = getTabularVariableValue;
|
|
86984
86350
|
exports.getToken = getToken;
|
|
86985
86351
|
exports.getTokenKey = getTokenKey;
|
|
86986
|
-
exports.getVariableValue = getVariableValue;
|
|
86987
86352
|
exports.handleAuthErrors = handleAuthErrors;
|
|
86988
86353
|
exports.injectCss = injectCss;
|
|
86989
86354
|
exports.isActionImpl = isActionImpl;
|
|
86990
86355
|
exports.isAnnotatedAction = isAnnotatedAction;
|
|
86991
86356
|
exports.isCondition = isCondition;
|
|
86992
86357
|
exports.isConditionTrue = isConditionTrue;
|
|
86993
|
-
exports.
|
|
86994
|
-
exports.isDerivedDataVariable = isDerivedDataVariable;
|
|
86358
|
+
exports.isDataResponse = isDataResponse;
|
|
86995
86359
|
exports.isDerivedVariable = isDerivedVariable;
|
|
86996
86360
|
exports.isInvalidComponent = isInvalidComponent;
|
|
86997
86361
|
exports.isJsComponent = isJsComponent;
|
|
@@ -86999,14 +86363,14 @@ Inferred class string: "${iconClasses}."`
|
|
|
86999
86363
|
exports.isPyComponent = isPyComponent;
|
|
87000
86364
|
exports.isRawString = isRawString;
|
|
87001
86365
|
exports.isRegistered = isRegistered;
|
|
87002
|
-
exports.isResolvedDataVariable = isResolvedDataVariable;
|
|
87003
|
-
exports.isResolvedDerivedDataVariable = isResolvedDerivedDataVariable;
|
|
87004
86366
|
exports.isResolvedDerivedVariable = isResolvedDerivedVariable;
|
|
86367
|
+
exports.isResolvedServerVariable = isResolvedServerVariable;
|
|
87005
86368
|
exports.isResolvedSwitchVariable = isResolvedSwitchVariable;
|
|
86369
|
+
exports.isServerVariable = isServerVariable;
|
|
86370
|
+
exports.isSingleVariable = isSingleVariable;
|
|
87006
86371
|
exports.isStateVariable = isStateVariable;
|
|
87007
86372
|
exports.isSwitchVariable = isSwitchVariable;
|
|
87008
86373
|
exports.isTaskResponse = isTaskResponse$1;
|
|
87009
|
-
exports.isUrlVariable = isUrlVariable;
|
|
87010
86374
|
exports.isVariable = isVariable;
|
|
87011
86375
|
exports.normalizeRequest = normalizeRequest;
|
|
87012
86376
|
exports.onTokenChange = onTokenChange;
|
|
@@ -87017,6 +86381,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
87017
86381
|
exports.resolveDerivedValue = resolveDerivedValue;
|
|
87018
86382
|
exports.resolveNested = resolveNested;
|
|
87019
86383
|
exports.resolveReferrer = resolveReferrer;
|
|
86384
|
+
exports.resolveServerVariable = resolveServerVariable;
|
|
87020
86385
|
exports.resolveTheme = resolveTheme;
|
|
87021
86386
|
exports.revokeSession = revokeSession;
|
|
87022
86387
|
exports.selectorFamilyMembersRegistry = selectorFamilyMembersRegistry;
|
|
@@ -87028,17 +86393,17 @@ Inferred class string: "${iconClasses}."`
|
|
|
87028
86393
|
exports.useAction = useAction;
|
|
87029
86394
|
exports.useActionIsLoading = useActionIsLoading;
|
|
87030
86395
|
exports.useActions = useActions;
|
|
87031
|
-
exports.useAnyVariable = useAnyVariable;
|
|
87032
86396
|
exports.useAuthConfig = useAuthConfig;
|
|
87033
86397
|
exports.useComponentRegistry = useComponentRegistry;
|
|
87034
86398
|
exports.useComponentStyles = useComponentStyles;
|
|
87035
86399
|
exports.useComponents = useComponents;
|
|
87036
86400
|
exports.useConditionOrVariable = useConditionOrVariable;
|
|
87037
86401
|
exports.useConfig = useConfig;
|
|
87038
|
-
exports.useDataVariable = useDataVariable;
|
|
87039
86402
|
exports.useDeferLoadable = useDeferLoadable;
|
|
87040
86403
|
exports.useDerivedVariable = useDerivedVariable;
|
|
87041
86404
|
exports.useEventBus = useEventBus;
|
|
86405
|
+
exports.useFetchTabularDerivedVariable = useFetchTabularDerivedVariable;
|
|
86406
|
+
exports.useFetchTabularServerVariable = useFetchTabularServerVariable;
|
|
87042
86407
|
exports.useInterval = useInterval;
|
|
87043
86408
|
exports.usePrevious = usePrevious;
|
|
87044
86409
|
exports.useRefreshSelector = useRefreshSelector;
|
|
@@ -87047,6 +86412,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
87047
86412
|
exports.useSession = useSession;
|
|
87048
86413
|
exports.useSessionToken = useSessionToken;
|
|
87049
86414
|
exports.useSwitchVariable = useSwitchVariable;
|
|
86415
|
+
exports.useTabularVariable = useTabularVariable;
|
|
87050
86416
|
exports.useTaskContext = useTaskContext;
|
|
87051
86417
|
exports.useTemplate = useTemplate;
|
|
87052
86418
|
exports.useTriggerIndex = useTriggerIndex;
|
|
@@ -87054,7 +86420,6 @@ Inferred class string: "${iconClasses}."`
|
|
|
87054
86420
|
exports.useUser = useUser;
|
|
87055
86421
|
exports.useVariable = useVariable;
|
|
87056
86422
|
exports.useVariableState = useVariableState;
|
|
87057
|
-
exports.useVariableValue = useVariableValue;
|
|
87058
86423
|
exports.useWindowTitle = useWindowTitle;
|
|
87059
86424
|
exports.verifySessionToken = verifySessionToken;
|
|
87060
86425
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|