@vitessce/neuroglancer 3.9.6 → 4.0.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ReactNeuroglancer-BSLfuCt9.js → ReactNeuroglancer-Bg6f79hO.js} +193 -200
- package/dist/{index-DvhFVdN_.js → index-DZhbMDug.js} +274 -3036
- package/dist/index.js +1 -1
- package/dist-tsc/Neuroglancer.d.ts +1 -3
- package/dist-tsc/Neuroglancer.d.ts.map +1 -1
- package/dist-tsc/Neuroglancer.js +4 -26
- package/dist-tsc/NeuroglancerSubscriber.d.ts +1 -1
- package/dist-tsc/NeuroglancerSubscriber.d.ts.map +1 -1
- package/dist-tsc/NeuroglancerSubscriber.js +4 -1
- package/dist-tsc/ReactNeuroglancer.d.ts +1 -1
- package/dist-tsc/ReactNeuroglancer.d.ts.map +1 -1
- package/package.json +20 -12
- package/src/Neuroglancer.js +7 -26
- package/src/NeuroglancerSubscriber.js +5 -0
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as React$1 from "react";
|
|
2
2
|
import React__default, { useContext, forwardRef, useRef, useMemo, createContext, createElement, PureComponent, useEffect, useState, useCallback, Suspense, useReducer } from "react";
|
|
3
3
|
import { useLoaders, useMergeCoordination, useCoordinationScopes, useCoordinationScopesBy, useCoordination, useGridItemSize, useMultiCoordinationScopesSecondaryNonNull, useMultiCoordinationScopesNonNull, useComplexCoordination, useComplexCoordinationSecondary, useMultiObsPoints, usePointMultiObsFeatureMatrixIndices, useMultiObsSegmentations, useSegmentationMultiObsSets, useSegmentationMultiFeatureSelection, useSegmentationMultiObsFeatureMatrixIndices, useReady, TitleInfo } from "@vitessce/vit-s";
|
|
4
|
+
import { jsx as jsx$1, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import * as ReactDOM from "react-dom";
|
|
6
|
+
import { Quaternion, Euler } from "three";
|
|
5
7
|
const ViewType$1 = {
|
|
6
8
|
DESCRIPTION: "description",
|
|
7
9
|
STATUS: "status",
|
|
@@ -2384,7 +2386,12 @@ function getAugmentedNamespace(n) {
|
|
|
2384
2386
|
var f = n.default;
|
|
2385
2387
|
if (typeof f == "function") {
|
|
2386
2388
|
var a = function a2() {
|
|
2387
|
-
|
|
2389
|
+
var isInstance = false;
|
|
2390
|
+
try {
|
|
2391
|
+
isInstance = this instanceof a2;
|
|
2392
|
+
} catch {
|
|
2393
|
+
}
|
|
2394
|
+
if (isInstance) {
|
|
2388
2395
|
return Reflect.construct(f, arguments, this.constructor);
|
|
2389
2396
|
}
|
|
2390
2397
|
return f.apply(this, arguments);
|
|
@@ -3764,7 +3771,7 @@ var util;
|
|
|
3764
3771
|
function assertIs(_arg) {
|
|
3765
3772
|
}
|
|
3766
3773
|
util2.assertIs = assertIs;
|
|
3767
|
-
function assertNever(
|
|
3774
|
+
function assertNever(_x) {
|
|
3768
3775
|
throw new Error();
|
|
3769
3776
|
}
|
|
3770
3777
|
util2.assertNever = assertNever;
|
|
@@ -7771,13 +7778,12 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
|
|
|
7771
7778
|
};
|
|
7772
7779
|
const layout = [];
|
|
7773
7780
|
config.staticLayout.forEach((componentDef) => {
|
|
7774
|
-
var _a, _b, _c;
|
|
7775
7781
|
let newComponentDef = {
|
|
7776
7782
|
...componentDef,
|
|
7777
7783
|
coordinationScopes: {}
|
|
7778
7784
|
};
|
|
7779
7785
|
if (componentDef.component === "scatterplot") {
|
|
7780
|
-
if (
|
|
7786
|
+
if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
|
|
7781
7787
|
coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
|
|
7782
7788
|
newComponentDef = {
|
|
7783
7789
|
...newComponentDef,
|
|
@@ -7787,7 +7793,7 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
|
|
|
7787
7793
|
}
|
|
7788
7794
|
};
|
|
7789
7795
|
}
|
|
7790
|
-
if (
|
|
7796
|
+
if (componentDef.props?.view) {
|
|
7791
7797
|
const newScopeValues = upgradeReplaceViewProp("embedding", componentDef.props.view, coordinationSpace);
|
|
7792
7798
|
newComponentDef = {
|
|
7793
7799
|
...newComponentDef,
|
|
@@ -7799,7 +7805,7 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
|
|
|
7799
7805
|
}
|
|
7800
7806
|
}
|
|
7801
7807
|
if (componentDef.component === "spatial") {
|
|
7802
|
-
if (
|
|
7808
|
+
if (componentDef?.props?.view) {
|
|
7803
7809
|
const newScopeValues = upgradeReplaceViewProp("spatial", componentDef.props.view, coordinationSpace);
|
|
7804
7810
|
newComponentDef = {
|
|
7805
7811
|
...newComponentDef,
|
|
@@ -7889,7 +7895,6 @@ function upgradeFrom1_0_0(config) {
|
|
|
7889
7895
|
};
|
|
7890
7896
|
}
|
|
7891
7897
|
function upgradeFrom1_0_1(config) {
|
|
7892
|
-
var _a;
|
|
7893
7898
|
const layout = config.layout.map((component) => {
|
|
7894
7899
|
const newComponent = { ...component };
|
|
7895
7900
|
if (newComponent.component === "layerController") {
|
|
@@ -7901,9 +7906,8 @@ function upgradeFrom1_0_1(config) {
|
|
|
7901
7906
|
return newComponent;
|
|
7902
7907
|
});
|
|
7903
7908
|
const newConfig = cloneDeep(config);
|
|
7904
|
-
Object.keys(
|
|
7905
|
-
|
|
7906
|
-
if ((_b = (_a2 = newConfig.coordinationSpace) == null ? void 0 : _a2.spatialRasterLayers) == null ? void 0 : _b[key]) {
|
|
7909
|
+
Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
|
|
7910
|
+
if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
|
|
7907
7911
|
newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index) => {
|
|
7908
7912
|
if (newConfig.coordinationSpace) {
|
|
7909
7913
|
newConfig.coordinationSpace.spatialRasterLayers[key][index].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
|
|
@@ -8044,7 +8048,7 @@ function upgradeFrom1_0_10(config) {
|
|
|
8044
8048
|
function upgradeFrom1_0_11(config) {
|
|
8045
8049
|
const newConfig = cloneDeep(config);
|
|
8046
8050
|
const { datasets, coordinationSpace } = newConfig;
|
|
8047
|
-
if (coordinationSpace
|
|
8051
|
+
if (coordinationSpace?.embeddingType) {
|
|
8048
8052
|
const embeddingTypes = Object.values(coordinationSpace.embeddingType);
|
|
8049
8053
|
datasets.forEach((dataset, i) => {
|
|
8050
8054
|
const { files } = dataset;
|
|
@@ -8077,7 +8081,7 @@ function upgradeFrom1_0_12(config) {
|
|
|
8077
8081
|
if (options && "factors" in options && Array.isArray(options.factors)) {
|
|
8078
8082
|
const obsLabelsTypeScopes = [];
|
|
8079
8083
|
options.factors.forEach((olt) => {
|
|
8080
|
-
const nextScope = getNextScope(Object.keys(
|
|
8084
|
+
const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
|
|
8081
8085
|
newCoordinationSpace.obsLabelsType = {
|
|
8082
8086
|
...newCoordinationSpace.obsLabelsType,
|
|
8083
8087
|
// Need to remove the obs/ prefix.
|
|
@@ -8091,8 +8095,7 @@ function upgradeFrom1_0_12(config) {
|
|
|
8091
8095
|
});
|
|
8092
8096
|
});
|
|
8093
8097
|
function getDatasetUidForView(viewDef) {
|
|
8094
|
-
|
|
8095
|
-
if (((_a = viewDef.coordinationScopes) == null ? void 0 : _a.dataset) && typeof ((_b = viewDef.coordinationScopes) == null ? void 0 : _b.dataset) === "string") {
|
|
8098
|
+
if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
|
|
8096
8099
|
return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
|
|
8097
8100
|
}
|
|
8098
8101
|
if (datasets.length > 0) {
|
|
@@ -8155,8 +8158,7 @@ function upgradeFrom1_0_14(config) {
|
|
|
8155
8158
|
};
|
|
8156
8159
|
newLayout.forEach((viewDef) => {
|
|
8157
8160
|
Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
|
|
8158
|
-
|
|
8159
|
-
if ((_a = viewDef.props) == null ? void 0 : _a[oldProp]) {
|
|
8161
|
+
if (viewDef.props?.[oldProp]) {
|
|
8160
8162
|
log.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
|
|
8161
8163
|
}
|
|
8162
8164
|
});
|
|
@@ -8173,7 +8175,7 @@ function upgradeFrom1_0_15(config) {
|
|
|
8173
8175
|
const newLayout = layout.map((view) => {
|
|
8174
8176
|
const { coordinationScopes } = view;
|
|
8175
8177
|
const newCoordinationScopes = {};
|
|
8176
|
-
if (
|
|
8178
|
+
if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
|
|
8177
8179
|
const coordinationScopesBy = {
|
|
8178
8180
|
dataset: {}
|
|
8179
8181
|
};
|
|
@@ -11727,13 +11729,13 @@ function getNextNumberedNodeName(nodes, prefix2, suffix) {
|
|
|
11727
11729
|
}
|
|
11728
11730
|
function setObsSelection(cellSelection, additionalCellSets, cellSetColor, setCellSetSelection, setAdditionalCellSets, setCellSetColor, setCellColorEncoding, prefix2 = "Selection ", suffix = "") {
|
|
11729
11731
|
const CELL_SELECTIONS_LEVEL_ZERO_NAME = "My Selections";
|
|
11730
|
-
const selectionsLevelZeroNode = additionalCellSets
|
|
11732
|
+
const selectionsLevelZeroNode = additionalCellSets?.tree.find((n) => n.name === CELL_SELECTIONS_LEVEL_ZERO_NAME);
|
|
11731
11733
|
const nextAdditionalCellSets = {
|
|
11732
11734
|
version: HIERARCHICAL_SCHEMAS.latestVersion,
|
|
11733
11735
|
datatype: SETS_DATATYPE_OBS,
|
|
11734
11736
|
tree: [...additionalCellSets ? additionalCellSets.tree : []]
|
|
11735
11737
|
};
|
|
11736
|
-
const nextName = getNextNumberedNodeName(selectionsLevelZeroNode
|
|
11738
|
+
const nextName = getNextNumberedNodeName(selectionsLevelZeroNode?.children, prefix2, suffix);
|
|
11737
11739
|
let colorIndex = 0;
|
|
11738
11740
|
if (selectionsLevelZeroNode) {
|
|
11739
11741
|
colorIndex = selectionsLevelZeroNode.children.length;
|
|
@@ -11815,11 +11817,10 @@ function colorMixWithUncertainty(originalColor, p, mixingColor = [128, 128, 128]
|
|
|
11815
11817
|
function treeToCellColorsBySetNames(currTree, selectedNamePaths, cellSetColor, theme) {
|
|
11816
11818
|
let cellColorsArray = [];
|
|
11817
11819
|
selectedNamePaths.forEach((setNamePath) => {
|
|
11818
|
-
var _a;
|
|
11819
11820
|
const node2 = treeFindNodeByNamePath(currTree, setNamePath);
|
|
11820
11821
|
if (node2) {
|
|
11821
11822
|
const nodeSet = nodeToSet(node2);
|
|
11822
|
-
const nodeColor =
|
|
11823
|
+
const nodeColor = cellSetColor?.find((d) => isEqual$1(d.path, setNamePath))?.color || getDefaultColor(theme);
|
|
11823
11824
|
cellColorsArray = [
|
|
11824
11825
|
...cellColorsArray,
|
|
11825
11826
|
...nodeSet.map(([cellId, prob]) => [
|
|
@@ -17114,903 +17115,6 @@ function getCellColors(params) {
|
|
|
17114
17115
|
}
|
|
17115
17116
|
return /* @__PURE__ */ new Map();
|
|
17116
17117
|
}
|
|
17117
|
-
var jsxRuntime = { exports: {} };
|
|
17118
|
-
var reactJsxRuntime_development = {};
|
|
17119
|
-
var hasRequiredReactJsxRuntime_development;
|
|
17120
|
-
function requireReactJsxRuntime_development() {
|
|
17121
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
17122
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
17123
|
-
/**
|
|
17124
|
-
* @license React
|
|
17125
|
-
* react-jsx-runtime.development.js
|
|
17126
|
-
*
|
|
17127
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17128
|
-
*
|
|
17129
|
-
* This source code is licensed under the MIT license found in the
|
|
17130
|
-
* LICENSE file in the root directory of this source tree.
|
|
17131
|
-
*/
|
|
17132
|
-
{
|
|
17133
|
-
(function() {
|
|
17134
|
-
var React2 = React__default;
|
|
17135
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
17136
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
17137
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
17138
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
17139
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
17140
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
17141
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
17142
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
17143
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
17144
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
17145
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
17146
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
17147
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
17148
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
17149
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
17150
|
-
function getIteratorFn(maybeIterable) {
|
|
17151
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
17152
|
-
return null;
|
|
17153
|
-
}
|
|
17154
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
17155
|
-
if (typeof maybeIterator === "function") {
|
|
17156
|
-
return maybeIterator;
|
|
17157
|
-
}
|
|
17158
|
-
return null;
|
|
17159
|
-
}
|
|
17160
|
-
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
17161
|
-
function error(format2) {
|
|
17162
|
-
{
|
|
17163
|
-
{
|
|
17164
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
17165
|
-
args[_key2 - 1] = arguments[_key2];
|
|
17166
|
-
}
|
|
17167
|
-
printWarning("error", format2, args);
|
|
17168
|
-
}
|
|
17169
|
-
}
|
|
17170
|
-
}
|
|
17171
|
-
function printWarning(level, format2, args) {
|
|
17172
|
-
{
|
|
17173
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
17174
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
17175
|
-
if (stack !== "") {
|
|
17176
|
-
format2 += "%s";
|
|
17177
|
-
args = args.concat([stack]);
|
|
17178
|
-
}
|
|
17179
|
-
var argsWithFormat = args.map(function(item) {
|
|
17180
|
-
return String(item);
|
|
17181
|
-
});
|
|
17182
|
-
argsWithFormat.unshift("Warning: " + format2);
|
|
17183
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
17184
|
-
}
|
|
17185
|
-
}
|
|
17186
|
-
var enableScopeAPI = false;
|
|
17187
|
-
var enableCacheElement = false;
|
|
17188
|
-
var enableTransitionTracing = false;
|
|
17189
|
-
var enableLegacyHidden = false;
|
|
17190
|
-
var enableDebugTracing = false;
|
|
17191
|
-
var REACT_MODULE_REFERENCE;
|
|
17192
|
-
{
|
|
17193
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
17194
|
-
}
|
|
17195
|
-
function isValidElementType(type) {
|
|
17196
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
17197
|
-
return true;
|
|
17198
|
-
}
|
|
17199
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
17200
|
-
return true;
|
|
17201
|
-
}
|
|
17202
|
-
if (typeof type === "object" && type !== null) {
|
|
17203
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
17204
|
-
// types supported by any Flight configuration anywhere since
|
|
17205
|
-
// we don't know which Flight build this will end up being used
|
|
17206
|
-
// with.
|
|
17207
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
17208
|
-
return true;
|
|
17209
|
-
}
|
|
17210
|
-
}
|
|
17211
|
-
return false;
|
|
17212
|
-
}
|
|
17213
|
-
function getWrappedName2(outerType, innerType, wrapperName) {
|
|
17214
|
-
var displayName = outerType.displayName;
|
|
17215
|
-
if (displayName) {
|
|
17216
|
-
return displayName;
|
|
17217
|
-
}
|
|
17218
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
17219
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
17220
|
-
}
|
|
17221
|
-
function getContextName(type) {
|
|
17222
|
-
return type.displayName || "Context";
|
|
17223
|
-
}
|
|
17224
|
-
function getComponentNameFromType(type) {
|
|
17225
|
-
if (type == null) {
|
|
17226
|
-
return null;
|
|
17227
|
-
}
|
|
17228
|
-
{
|
|
17229
|
-
if (typeof type.tag === "number") {
|
|
17230
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
17231
|
-
}
|
|
17232
|
-
}
|
|
17233
|
-
if (typeof type === "function") {
|
|
17234
|
-
return type.displayName || type.name || null;
|
|
17235
|
-
}
|
|
17236
|
-
if (typeof type === "string") {
|
|
17237
|
-
return type;
|
|
17238
|
-
}
|
|
17239
|
-
switch (type) {
|
|
17240
|
-
case REACT_FRAGMENT_TYPE:
|
|
17241
|
-
return "Fragment";
|
|
17242
|
-
case REACT_PORTAL_TYPE:
|
|
17243
|
-
return "Portal";
|
|
17244
|
-
case REACT_PROFILER_TYPE:
|
|
17245
|
-
return "Profiler";
|
|
17246
|
-
case REACT_STRICT_MODE_TYPE:
|
|
17247
|
-
return "StrictMode";
|
|
17248
|
-
case REACT_SUSPENSE_TYPE:
|
|
17249
|
-
return "Suspense";
|
|
17250
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
17251
|
-
return "SuspenseList";
|
|
17252
|
-
}
|
|
17253
|
-
if (typeof type === "object") {
|
|
17254
|
-
switch (type.$$typeof) {
|
|
17255
|
-
case REACT_CONTEXT_TYPE:
|
|
17256
|
-
var context = type;
|
|
17257
|
-
return getContextName(context) + ".Consumer";
|
|
17258
|
-
case REACT_PROVIDER_TYPE:
|
|
17259
|
-
var provider = type;
|
|
17260
|
-
return getContextName(provider._context) + ".Provider";
|
|
17261
|
-
case REACT_FORWARD_REF_TYPE:
|
|
17262
|
-
return getWrappedName2(type, type.render, "ForwardRef");
|
|
17263
|
-
case REACT_MEMO_TYPE:
|
|
17264
|
-
var outerName = type.displayName || null;
|
|
17265
|
-
if (outerName !== null) {
|
|
17266
|
-
return outerName;
|
|
17267
|
-
}
|
|
17268
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
17269
|
-
case REACT_LAZY_TYPE: {
|
|
17270
|
-
var lazyComponent = type;
|
|
17271
|
-
var payload = lazyComponent._payload;
|
|
17272
|
-
var init = lazyComponent._init;
|
|
17273
|
-
try {
|
|
17274
|
-
return getComponentNameFromType(init(payload));
|
|
17275
|
-
} catch (x) {
|
|
17276
|
-
return null;
|
|
17277
|
-
}
|
|
17278
|
-
}
|
|
17279
|
-
}
|
|
17280
|
-
}
|
|
17281
|
-
return null;
|
|
17282
|
-
}
|
|
17283
|
-
var assign2 = Object.assign;
|
|
17284
|
-
var disabledDepth = 0;
|
|
17285
|
-
var prevLog;
|
|
17286
|
-
var prevInfo;
|
|
17287
|
-
var prevWarn;
|
|
17288
|
-
var prevError;
|
|
17289
|
-
var prevGroup;
|
|
17290
|
-
var prevGroupCollapsed;
|
|
17291
|
-
var prevGroupEnd;
|
|
17292
|
-
function disabledLog() {
|
|
17293
|
-
}
|
|
17294
|
-
disabledLog.__reactDisabledLog = true;
|
|
17295
|
-
function disableLogs() {
|
|
17296
|
-
{
|
|
17297
|
-
if (disabledDepth === 0) {
|
|
17298
|
-
prevLog = console.log;
|
|
17299
|
-
prevInfo = console.info;
|
|
17300
|
-
prevWarn = console.warn;
|
|
17301
|
-
prevError = console.error;
|
|
17302
|
-
prevGroup = console.group;
|
|
17303
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
17304
|
-
prevGroupEnd = console.groupEnd;
|
|
17305
|
-
var props = {
|
|
17306
|
-
configurable: true,
|
|
17307
|
-
enumerable: true,
|
|
17308
|
-
value: disabledLog,
|
|
17309
|
-
writable: true
|
|
17310
|
-
};
|
|
17311
|
-
Object.defineProperties(console, {
|
|
17312
|
-
info: props,
|
|
17313
|
-
log: props,
|
|
17314
|
-
warn: props,
|
|
17315
|
-
error: props,
|
|
17316
|
-
group: props,
|
|
17317
|
-
groupCollapsed: props,
|
|
17318
|
-
groupEnd: props
|
|
17319
|
-
});
|
|
17320
|
-
}
|
|
17321
|
-
disabledDepth++;
|
|
17322
|
-
}
|
|
17323
|
-
}
|
|
17324
|
-
function reenableLogs() {
|
|
17325
|
-
{
|
|
17326
|
-
disabledDepth--;
|
|
17327
|
-
if (disabledDepth === 0) {
|
|
17328
|
-
var props = {
|
|
17329
|
-
configurable: true,
|
|
17330
|
-
enumerable: true,
|
|
17331
|
-
writable: true
|
|
17332
|
-
};
|
|
17333
|
-
Object.defineProperties(console, {
|
|
17334
|
-
log: assign2({}, props, {
|
|
17335
|
-
value: prevLog
|
|
17336
|
-
}),
|
|
17337
|
-
info: assign2({}, props, {
|
|
17338
|
-
value: prevInfo
|
|
17339
|
-
}),
|
|
17340
|
-
warn: assign2({}, props, {
|
|
17341
|
-
value: prevWarn
|
|
17342
|
-
}),
|
|
17343
|
-
error: assign2({}, props, {
|
|
17344
|
-
value: prevError
|
|
17345
|
-
}),
|
|
17346
|
-
group: assign2({}, props, {
|
|
17347
|
-
value: prevGroup
|
|
17348
|
-
}),
|
|
17349
|
-
groupCollapsed: assign2({}, props, {
|
|
17350
|
-
value: prevGroupCollapsed
|
|
17351
|
-
}),
|
|
17352
|
-
groupEnd: assign2({}, props, {
|
|
17353
|
-
value: prevGroupEnd
|
|
17354
|
-
})
|
|
17355
|
-
});
|
|
17356
|
-
}
|
|
17357
|
-
if (disabledDepth < 0) {
|
|
17358
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
17359
|
-
}
|
|
17360
|
-
}
|
|
17361
|
-
}
|
|
17362
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
17363
|
-
var prefix2;
|
|
17364
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
17365
|
-
{
|
|
17366
|
-
if (prefix2 === void 0) {
|
|
17367
|
-
try {
|
|
17368
|
-
throw Error();
|
|
17369
|
-
} catch (x) {
|
|
17370
|
-
var match2 = x.stack.trim().match(/\n( *(at )?)/);
|
|
17371
|
-
prefix2 = match2 && match2[1] || "";
|
|
17372
|
-
}
|
|
17373
|
-
}
|
|
17374
|
-
return "\n" + prefix2 + name;
|
|
17375
|
-
}
|
|
17376
|
-
}
|
|
17377
|
-
var reentry = false;
|
|
17378
|
-
var componentFrameCache;
|
|
17379
|
-
{
|
|
17380
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
17381
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
17382
|
-
}
|
|
17383
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
17384
|
-
if (!fn || reentry) {
|
|
17385
|
-
return "";
|
|
17386
|
-
}
|
|
17387
|
-
{
|
|
17388
|
-
var frame = componentFrameCache.get(fn);
|
|
17389
|
-
if (frame !== void 0) {
|
|
17390
|
-
return frame;
|
|
17391
|
-
}
|
|
17392
|
-
}
|
|
17393
|
-
var control;
|
|
17394
|
-
reentry = true;
|
|
17395
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
17396
|
-
Error.prepareStackTrace = void 0;
|
|
17397
|
-
var previousDispatcher;
|
|
17398
|
-
{
|
|
17399
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
|
17400
|
-
ReactCurrentDispatcher.current = null;
|
|
17401
|
-
disableLogs();
|
|
17402
|
-
}
|
|
17403
|
-
try {
|
|
17404
|
-
if (construct) {
|
|
17405
|
-
var Fake = function() {
|
|
17406
|
-
throw Error();
|
|
17407
|
-
};
|
|
17408
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
17409
|
-
set: function() {
|
|
17410
|
-
throw Error();
|
|
17411
|
-
}
|
|
17412
|
-
});
|
|
17413
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
17414
|
-
try {
|
|
17415
|
-
Reflect.construct(Fake, []);
|
|
17416
|
-
} catch (x) {
|
|
17417
|
-
control = x;
|
|
17418
|
-
}
|
|
17419
|
-
Reflect.construct(fn, [], Fake);
|
|
17420
|
-
} else {
|
|
17421
|
-
try {
|
|
17422
|
-
Fake.call();
|
|
17423
|
-
} catch (x) {
|
|
17424
|
-
control = x;
|
|
17425
|
-
}
|
|
17426
|
-
fn.call(Fake.prototype);
|
|
17427
|
-
}
|
|
17428
|
-
} else {
|
|
17429
|
-
try {
|
|
17430
|
-
throw Error();
|
|
17431
|
-
} catch (x) {
|
|
17432
|
-
control = x;
|
|
17433
|
-
}
|
|
17434
|
-
fn();
|
|
17435
|
-
}
|
|
17436
|
-
} catch (sample) {
|
|
17437
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
17438
|
-
var sampleLines = sample.stack.split("\n");
|
|
17439
|
-
var controlLines = control.stack.split("\n");
|
|
17440
|
-
var s = sampleLines.length - 1;
|
|
17441
|
-
var c = controlLines.length - 1;
|
|
17442
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
17443
|
-
c--;
|
|
17444
|
-
}
|
|
17445
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
17446
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
17447
|
-
if (s !== 1 || c !== 1) {
|
|
17448
|
-
do {
|
|
17449
|
-
s--;
|
|
17450
|
-
c--;
|
|
17451
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
17452
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
17453
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
17454
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
17455
|
-
}
|
|
17456
|
-
{
|
|
17457
|
-
if (typeof fn === "function") {
|
|
17458
|
-
componentFrameCache.set(fn, _frame);
|
|
17459
|
-
}
|
|
17460
|
-
}
|
|
17461
|
-
return _frame;
|
|
17462
|
-
}
|
|
17463
|
-
} while (s >= 1 && c >= 0);
|
|
17464
|
-
}
|
|
17465
|
-
break;
|
|
17466
|
-
}
|
|
17467
|
-
}
|
|
17468
|
-
}
|
|
17469
|
-
} finally {
|
|
17470
|
-
reentry = false;
|
|
17471
|
-
{
|
|
17472
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
17473
|
-
reenableLogs();
|
|
17474
|
-
}
|
|
17475
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
17476
|
-
}
|
|
17477
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
17478
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
17479
|
-
{
|
|
17480
|
-
if (typeof fn === "function") {
|
|
17481
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
17482
|
-
}
|
|
17483
|
-
}
|
|
17484
|
-
return syntheticFrame;
|
|
17485
|
-
}
|
|
17486
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
17487
|
-
{
|
|
17488
|
-
return describeNativeComponentFrame(fn, false);
|
|
17489
|
-
}
|
|
17490
|
-
}
|
|
17491
|
-
function shouldConstruct(Component) {
|
|
17492
|
-
var prototype = Component.prototype;
|
|
17493
|
-
return !!(prototype && prototype.isReactComponent);
|
|
17494
|
-
}
|
|
17495
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
17496
|
-
if (type == null) {
|
|
17497
|
-
return "";
|
|
17498
|
-
}
|
|
17499
|
-
if (typeof type === "function") {
|
|
17500
|
-
{
|
|
17501
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
17502
|
-
}
|
|
17503
|
-
}
|
|
17504
|
-
if (typeof type === "string") {
|
|
17505
|
-
return describeBuiltInComponentFrame(type);
|
|
17506
|
-
}
|
|
17507
|
-
switch (type) {
|
|
17508
|
-
case REACT_SUSPENSE_TYPE:
|
|
17509
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
17510
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
17511
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
17512
|
-
}
|
|
17513
|
-
if (typeof type === "object") {
|
|
17514
|
-
switch (type.$$typeof) {
|
|
17515
|
-
case REACT_FORWARD_REF_TYPE:
|
|
17516
|
-
return describeFunctionComponentFrame(type.render);
|
|
17517
|
-
case REACT_MEMO_TYPE:
|
|
17518
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
17519
|
-
case REACT_LAZY_TYPE: {
|
|
17520
|
-
var lazyComponent = type;
|
|
17521
|
-
var payload = lazyComponent._payload;
|
|
17522
|
-
var init = lazyComponent._init;
|
|
17523
|
-
try {
|
|
17524
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
17525
|
-
} catch (x) {
|
|
17526
|
-
}
|
|
17527
|
-
}
|
|
17528
|
-
}
|
|
17529
|
-
}
|
|
17530
|
-
return "";
|
|
17531
|
-
}
|
|
17532
|
-
var hasOwnProperty2 = Object.prototype.hasOwnProperty;
|
|
17533
|
-
var loggedTypeFailures = {};
|
|
17534
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
17535
|
-
function setCurrentlyValidatingElement(element) {
|
|
17536
|
-
{
|
|
17537
|
-
if (element) {
|
|
17538
|
-
var owner = element._owner;
|
|
17539
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
17540
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
17541
|
-
} else {
|
|
17542
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
17543
|
-
}
|
|
17544
|
-
}
|
|
17545
|
-
}
|
|
17546
|
-
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
17547
|
-
{
|
|
17548
|
-
var has2 = Function.call.bind(hasOwnProperty2);
|
|
17549
|
-
for (var typeSpecName in typeSpecs) {
|
|
17550
|
-
if (has2(typeSpecs, typeSpecName)) {
|
|
17551
|
-
var error$1 = void 0;
|
|
17552
|
-
try {
|
|
17553
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
17554
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
17555
|
-
err.name = "Invariant Violation";
|
|
17556
|
-
throw err;
|
|
17557
|
-
}
|
|
17558
|
-
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
17559
|
-
} catch (ex) {
|
|
17560
|
-
error$1 = ex;
|
|
17561
|
-
}
|
|
17562
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
17563
|
-
setCurrentlyValidatingElement(element);
|
|
17564
|
-
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
17565
|
-
setCurrentlyValidatingElement(null);
|
|
17566
|
-
}
|
|
17567
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
17568
|
-
loggedTypeFailures[error$1.message] = true;
|
|
17569
|
-
setCurrentlyValidatingElement(element);
|
|
17570
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
17571
|
-
setCurrentlyValidatingElement(null);
|
|
17572
|
-
}
|
|
17573
|
-
}
|
|
17574
|
-
}
|
|
17575
|
-
}
|
|
17576
|
-
}
|
|
17577
|
-
var isArrayImpl = Array.isArray;
|
|
17578
|
-
function isArray2(a) {
|
|
17579
|
-
return isArrayImpl(a);
|
|
17580
|
-
}
|
|
17581
|
-
function typeName(value) {
|
|
17582
|
-
{
|
|
17583
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
17584
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
17585
|
-
return type;
|
|
17586
|
-
}
|
|
17587
|
-
}
|
|
17588
|
-
function willCoercionThrow(value) {
|
|
17589
|
-
{
|
|
17590
|
-
try {
|
|
17591
|
-
testStringCoercion(value);
|
|
17592
|
-
return false;
|
|
17593
|
-
} catch (e) {
|
|
17594
|
-
return true;
|
|
17595
|
-
}
|
|
17596
|
-
}
|
|
17597
|
-
}
|
|
17598
|
-
function testStringCoercion(value) {
|
|
17599
|
-
return "" + value;
|
|
17600
|
-
}
|
|
17601
|
-
function checkKeyStringCoercion(value) {
|
|
17602
|
-
{
|
|
17603
|
-
if (willCoercionThrow(value)) {
|
|
17604
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
17605
|
-
return testStringCoercion(value);
|
|
17606
|
-
}
|
|
17607
|
-
}
|
|
17608
|
-
}
|
|
17609
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
17610
|
-
var RESERVED_PROPS = {
|
|
17611
|
-
key: true,
|
|
17612
|
-
ref: true,
|
|
17613
|
-
__self: true,
|
|
17614
|
-
__source: true
|
|
17615
|
-
};
|
|
17616
|
-
var specialPropKeyWarningShown;
|
|
17617
|
-
var specialPropRefWarningShown;
|
|
17618
|
-
function hasValidRef(config) {
|
|
17619
|
-
{
|
|
17620
|
-
if (hasOwnProperty2.call(config, "ref")) {
|
|
17621
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
17622
|
-
if (getter && getter.isReactWarning) {
|
|
17623
|
-
return false;
|
|
17624
|
-
}
|
|
17625
|
-
}
|
|
17626
|
-
}
|
|
17627
|
-
return config.ref !== void 0;
|
|
17628
|
-
}
|
|
17629
|
-
function hasValidKey(config) {
|
|
17630
|
-
{
|
|
17631
|
-
if (hasOwnProperty2.call(config, "key")) {
|
|
17632
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
17633
|
-
if (getter && getter.isReactWarning) {
|
|
17634
|
-
return false;
|
|
17635
|
-
}
|
|
17636
|
-
}
|
|
17637
|
-
}
|
|
17638
|
-
return config.key !== void 0;
|
|
17639
|
-
}
|
|
17640
|
-
function warnIfStringRefCannotBeAutoConverted(config, self2) {
|
|
17641
|
-
{
|
|
17642
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self2) ;
|
|
17643
|
-
}
|
|
17644
|
-
}
|
|
17645
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
17646
|
-
{
|
|
17647
|
-
var warnAboutAccessingKey = function() {
|
|
17648
|
-
if (!specialPropKeyWarningShown) {
|
|
17649
|
-
specialPropKeyWarningShown = true;
|
|
17650
|
-
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
17651
|
-
}
|
|
17652
|
-
};
|
|
17653
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
17654
|
-
Object.defineProperty(props, "key", {
|
|
17655
|
-
get: warnAboutAccessingKey,
|
|
17656
|
-
configurable: true
|
|
17657
|
-
});
|
|
17658
|
-
}
|
|
17659
|
-
}
|
|
17660
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
17661
|
-
{
|
|
17662
|
-
var warnAboutAccessingRef = function() {
|
|
17663
|
-
if (!specialPropRefWarningShown) {
|
|
17664
|
-
specialPropRefWarningShown = true;
|
|
17665
|
-
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
17666
|
-
}
|
|
17667
|
-
};
|
|
17668
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
17669
|
-
Object.defineProperty(props, "ref", {
|
|
17670
|
-
get: warnAboutAccessingRef,
|
|
17671
|
-
configurable: true
|
|
17672
|
-
});
|
|
17673
|
-
}
|
|
17674
|
-
}
|
|
17675
|
-
var ReactElement = function(type, key, ref, self2, source, owner, props) {
|
|
17676
|
-
var element = {
|
|
17677
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
17678
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
17679
|
-
// Built-in properties that belong on the element
|
|
17680
|
-
type,
|
|
17681
|
-
key,
|
|
17682
|
-
ref,
|
|
17683
|
-
props,
|
|
17684
|
-
// Record the component responsible for creating this element.
|
|
17685
|
-
_owner: owner
|
|
17686
|
-
};
|
|
17687
|
-
{
|
|
17688
|
-
element._store = {};
|
|
17689
|
-
Object.defineProperty(element._store, "validated", {
|
|
17690
|
-
configurable: false,
|
|
17691
|
-
enumerable: false,
|
|
17692
|
-
writable: true,
|
|
17693
|
-
value: false
|
|
17694
|
-
});
|
|
17695
|
-
Object.defineProperty(element, "_self", {
|
|
17696
|
-
configurable: false,
|
|
17697
|
-
enumerable: false,
|
|
17698
|
-
writable: false,
|
|
17699
|
-
value: self2
|
|
17700
|
-
});
|
|
17701
|
-
Object.defineProperty(element, "_source", {
|
|
17702
|
-
configurable: false,
|
|
17703
|
-
enumerable: false,
|
|
17704
|
-
writable: false,
|
|
17705
|
-
value: source
|
|
17706
|
-
});
|
|
17707
|
-
if (Object.freeze) {
|
|
17708
|
-
Object.freeze(element.props);
|
|
17709
|
-
Object.freeze(element);
|
|
17710
|
-
}
|
|
17711
|
-
}
|
|
17712
|
-
return element;
|
|
17713
|
-
};
|
|
17714
|
-
function jsxDEV(type, config, maybeKey, source, self2) {
|
|
17715
|
-
{
|
|
17716
|
-
var propName;
|
|
17717
|
-
var props = {};
|
|
17718
|
-
var key = null;
|
|
17719
|
-
var ref = null;
|
|
17720
|
-
if (maybeKey !== void 0) {
|
|
17721
|
-
{
|
|
17722
|
-
checkKeyStringCoercion(maybeKey);
|
|
17723
|
-
}
|
|
17724
|
-
key = "" + maybeKey;
|
|
17725
|
-
}
|
|
17726
|
-
if (hasValidKey(config)) {
|
|
17727
|
-
{
|
|
17728
|
-
checkKeyStringCoercion(config.key);
|
|
17729
|
-
}
|
|
17730
|
-
key = "" + config.key;
|
|
17731
|
-
}
|
|
17732
|
-
if (hasValidRef(config)) {
|
|
17733
|
-
ref = config.ref;
|
|
17734
|
-
warnIfStringRefCannotBeAutoConverted(config, self2);
|
|
17735
|
-
}
|
|
17736
|
-
for (propName in config) {
|
|
17737
|
-
if (hasOwnProperty2.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
17738
|
-
props[propName] = config[propName];
|
|
17739
|
-
}
|
|
17740
|
-
}
|
|
17741
|
-
if (type && type.defaultProps) {
|
|
17742
|
-
var defaultProps = type.defaultProps;
|
|
17743
|
-
for (propName in defaultProps) {
|
|
17744
|
-
if (props[propName] === void 0) {
|
|
17745
|
-
props[propName] = defaultProps[propName];
|
|
17746
|
-
}
|
|
17747
|
-
}
|
|
17748
|
-
}
|
|
17749
|
-
if (key || ref) {
|
|
17750
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
17751
|
-
if (key) {
|
|
17752
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
17753
|
-
}
|
|
17754
|
-
if (ref) {
|
|
17755
|
-
defineRefPropWarningGetter(props, displayName);
|
|
17756
|
-
}
|
|
17757
|
-
}
|
|
17758
|
-
return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
|
|
17759
|
-
}
|
|
17760
|
-
}
|
|
17761
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
17762
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
17763
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
17764
|
-
{
|
|
17765
|
-
if (element) {
|
|
17766
|
-
var owner = element._owner;
|
|
17767
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
17768
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
17769
|
-
} else {
|
|
17770
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
17771
|
-
}
|
|
17772
|
-
}
|
|
17773
|
-
}
|
|
17774
|
-
var propTypesMisspellWarningShown;
|
|
17775
|
-
{
|
|
17776
|
-
propTypesMisspellWarningShown = false;
|
|
17777
|
-
}
|
|
17778
|
-
function isValidElement(object2) {
|
|
17779
|
-
{
|
|
17780
|
-
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
17781
|
-
}
|
|
17782
|
-
}
|
|
17783
|
-
function getDeclarationErrorAddendum() {
|
|
17784
|
-
{
|
|
17785
|
-
if (ReactCurrentOwner$1.current) {
|
|
17786
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
17787
|
-
if (name) {
|
|
17788
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
17789
|
-
}
|
|
17790
|
-
}
|
|
17791
|
-
return "";
|
|
17792
|
-
}
|
|
17793
|
-
}
|
|
17794
|
-
function getSourceInfoErrorAddendum(source) {
|
|
17795
|
-
{
|
|
17796
|
-
return "";
|
|
17797
|
-
}
|
|
17798
|
-
}
|
|
17799
|
-
var ownerHasKeyUseWarning = {};
|
|
17800
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
17801
|
-
{
|
|
17802
|
-
var info = getDeclarationErrorAddendum();
|
|
17803
|
-
if (!info) {
|
|
17804
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
17805
|
-
if (parentName) {
|
|
17806
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
17807
|
-
}
|
|
17808
|
-
}
|
|
17809
|
-
return info;
|
|
17810
|
-
}
|
|
17811
|
-
}
|
|
17812
|
-
function validateExplicitKey(element, parentType) {
|
|
17813
|
-
{
|
|
17814
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
17815
|
-
return;
|
|
17816
|
-
}
|
|
17817
|
-
element._store.validated = true;
|
|
17818
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
17819
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
17820
|
-
return;
|
|
17821
|
-
}
|
|
17822
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
17823
|
-
var childOwner = "";
|
|
17824
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
17825
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
17826
|
-
}
|
|
17827
|
-
setCurrentlyValidatingElement$1(element);
|
|
17828
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
17829
|
-
setCurrentlyValidatingElement$1(null);
|
|
17830
|
-
}
|
|
17831
|
-
}
|
|
17832
|
-
function validateChildKeys(node2, parentType) {
|
|
17833
|
-
{
|
|
17834
|
-
if (typeof node2 !== "object") {
|
|
17835
|
-
return;
|
|
17836
|
-
}
|
|
17837
|
-
if (isArray2(node2)) {
|
|
17838
|
-
for (var i = 0; i < node2.length; i++) {
|
|
17839
|
-
var child = node2[i];
|
|
17840
|
-
if (isValidElement(child)) {
|
|
17841
|
-
validateExplicitKey(child, parentType);
|
|
17842
|
-
}
|
|
17843
|
-
}
|
|
17844
|
-
} else if (isValidElement(node2)) {
|
|
17845
|
-
if (node2._store) {
|
|
17846
|
-
node2._store.validated = true;
|
|
17847
|
-
}
|
|
17848
|
-
} else if (node2) {
|
|
17849
|
-
var iteratorFn = getIteratorFn(node2);
|
|
17850
|
-
if (typeof iteratorFn === "function") {
|
|
17851
|
-
if (iteratorFn !== node2.entries) {
|
|
17852
|
-
var iterator = iteratorFn.call(node2);
|
|
17853
|
-
var step;
|
|
17854
|
-
while (!(step = iterator.next()).done) {
|
|
17855
|
-
if (isValidElement(step.value)) {
|
|
17856
|
-
validateExplicitKey(step.value, parentType);
|
|
17857
|
-
}
|
|
17858
|
-
}
|
|
17859
|
-
}
|
|
17860
|
-
}
|
|
17861
|
-
}
|
|
17862
|
-
}
|
|
17863
|
-
}
|
|
17864
|
-
function validatePropTypes(element) {
|
|
17865
|
-
{
|
|
17866
|
-
var type = element.type;
|
|
17867
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
17868
|
-
return;
|
|
17869
|
-
}
|
|
17870
|
-
var propTypes2;
|
|
17871
|
-
if (typeof type === "function") {
|
|
17872
|
-
propTypes2 = type.propTypes;
|
|
17873
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
17874
|
-
// Inner props are checked in the reconciler.
|
|
17875
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
17876
|
-
propTypes2 = type.propTypes;
|
|
17877
|
-
} else {
|
|
17878
|
-
return;
|
|
17879
|
-
}
|
|
17880
|
-
if (propTypes2) {
|
|
17881
|
-
var name = getComponentNameFromType(type);
|
|
17882
|
-
checkPropTypes(propTypes2, element.props, "prop", name, element);
|
|
17883
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
17884
|
-
propTypesMisspellWarningShown = true;
|
|
17885
|
-
var _name = getComponentNameFromType(type);
|
|
17886
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
17887
|
-
}
|
|
17888
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
17889
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
17890
|
-
}
|
|
17891
|
-
}
|
|
17892
|
-
}
|
|
17893
|
-
function validateFragmentProps(fragment) {
|
|
17894
|
-
{
|
|
17895
|
-
var keys2 = Object.keys(fragment.props);
|
|
17896
|
-
for (var i = 0; i < keys2.length; i++) {
|
|
17897
|
-
var key = keys2[i];
|
|
17898
|
-
if (key !== "children" && key !== "key") {
|
|
17899
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
17900
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
17901
|
-
setCurrentlyValidatingElement$1(null);
|
|
17902
|
-
break;
|
|
17903
|
-
}
|
|
17904
|
-
}
|
|
17905
|
-
if (fragment.ref !== null) {
|
|
17906
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
17907
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
17908
|
-
setCurrentlyValidatingElement$1(null);
|
|
17909
|
-
}
|
|
17910
|
-
}
|
|
17911
|
-
}
|
|
17912
|
-
var didWarnAboutKeySpread = {};
|
|
17913
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self2) {
|
|
17914
|
-
{
|
|
17915
|
-
var validType = isValidElementType(type);
|
|
17916
|
-
if (!validType) {
|
|
17917
|
-
var info = "";
|
|
17918
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
17919
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
17920
|
-
}
|
|
17921
|
-
var sourceInfo = getSourceInfoErrorAddendum();
|
|
17922
|
-
if (sourceInfo) {
|
|
17923
|
-
info += sourceInfo;
|
|
17924
|
-
} else {
|
|
17925
|
-
info += getDeclarationErrorAddendum();
|
|
17926
|
-
}
|
|
17927
|
-
var typeString;
|
|
17928
|
-
if (type === null) {
|
|
17929
|
-
typeString = "null";
|
|
17930
|
-
} else if (isArray2(type)) {
|
|
17931
|
-
typeString = "array";
|
|
17932
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
17933
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
17934
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
17935
|
-
} else {
|
|
17936
|
-
typeString = typeof type;
|
|
17937
|
-
}
|
|
17938
|
-
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
17939
|
-
}
|
|
17940
|
-
var element = jsxDEV(type, props, key, source, self2);
|
|
17941
|
-
if (element == null) {
|
|
17942
|
-
return element;
|
|
17943
|
-
}
|
|
17944
|
-
if (validType) {
|
|
17945
|
-
var children2 = props.children;
|
|
17946
|
-
if (children2 !== void 0) {
|
|
17947
|
-
if (isStaticChildren) {
|
|
17948
|
-
if (isArray2(children2)) {
|
|
17949
|
-
for (var i = 0; i < children2.length; i++) {
|
|
17950
|
-
validateChildKeys(children2[i], type);
|
|
17951
|
-
}
|
|
17952
|
-
if (Object.freeze) {
|
|
17953
|
-
Object.freeze(children2);
|
|
17954
|
-
}
|
|
17955
|
-
} else {
|
|
17956
|
-
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
17957
|
-
}
|
|
17958
|
-
} else {
|
|
17959
|
-
validateChildKeys(children2, type);
|
|
17960
|
-
}
|
|
17961
|
-
}
|
|
17962
|
-
}
|
|
17963
|
-
{
|
|
17964
|
-
if (hasOwnProperty2.call(props, "key")) {
|
|
17965
|
-
var componentName = getComponentNameFromType(type);
|
|
17966
|
-
var keys2 = Object.keys(props).filter(function(k) {
|
|
17967
|
-
return k !== "key";
|
|
17968
|
-
});
|
|
17969
|
-
var beforeExample = keys2.length > 0 ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
17970
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
17971
|
-
var afterExample = keys2.length > 0 ? "{" + keys2.join(": ..., ") + ": ...}" : "{}";
|
|
17972
|
-
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
17973
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
17974
|
-
}
|
|
17975
|
-
}
|
|
17976
|
-
}
|
|
17977
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
17978
|
-
validateFragmentProps(element);
|
|
17979
|
-
} else {
|
|
17980
|
-
validatePropTypes(element);
|
|
17981
|
-
}
|
|
17982
|
-
return element;
|
|
17983
|
-
}
|
|
17984
|
-
}
|
|
17985
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
17986
|
-
{
|
|
17987
|
-
return jsxWithValidation(type, props, key, true);
|
|
17988
|
-
}
|
|
17989
|
-
}
|
|
17990
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
17991
|
-
{
|
|
17992
|
-
return jsxWithValidation(type, props, key, false);
|
|
17993
|
-
}
|
|
17994
|
-
}
|
|
17995
|
-
var jsx3 = jsxWithValidationDynamic;
|
|
17996
|
-
var jsxs = jsxWithValidationStatic;
|
|
17997
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
17998
|
-
reactJsxRuntime_development.jsx = jsx3;
|
|
17999
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
18000
|
-
})();
|
|
18001
|
-
}
|
|
18002
|
-
return reactJsxRuntime_development;
|
|
18003
|
-
}
|
|
18004
|
-
var hasRequiredJsxRuntime;
|
|
18005
|
-
function requireJsxRuntime() {
|
|
18006
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
18007
|
-
hasRequiredJsxRuntime = 1;
|
|
18008
|
-
{
|
|
18009
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
18010
|
-
}
|
|
18011
|
-
return jsxRuntime.exports;
|
|
18012
|
-
}
|
|
18013
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
18014
17118
|
function r$1(e) {
|
|
18015
17119
|
var t, f, n = "";
|
|
18016
17120
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
@@ -18810,14 +17914,14 @@ var createCache = function createCache2(options) {
|
|
|
18810
17914
|
cache.sheet.hydrate(nodesToHydrate);
|
|
18811
17915
|
return cache;
|
|
18812
17916
|
};
|
|
18813
|
-
function _extends$
|
|
18814
|
-
return _extends$
|
|
17917
|
+
function _extends$1() {
|
|
17918
|
+
return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
|
|
18815
17919
|
for (var e = 1; e < arguments.length; e++) {
|
|
18816
17920
|
var t = arguments[e];
|
|
18817
17921
|
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
|
|
18818
17922
|
}
|
|
18819
17923
|
return n;
|
|
18820
|
-
}, _extends$
|
|
17924
|
+
}, _extends$1.apply(null, arguments);
|
|
18821
17925
|
}
|
|
18822
17926
|
var reactIs$1 = { exports: {} };
|
|
18823
17927
|
var reactIs_development$1 = {};
|
|
@@ -20349,7 +19453,7 @@ var createStyled$1 = function createStyled(tag, options) {
|
|
|
20349
19453
|
}
|
|
20350
19454
|
});
|
|
20351
19455
|
Styled.withComponent = function(nextTag, nextOptions) {
|
|
20352
|
-
var newStyled2 = createStyled(nextTag, _extends$
|
|
19456
|
+
var newStyled2 = createStyled(nextTag, _extends$1({}, options, nextOptions, {
|
|
20353
19457
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
20354
19458
|
}));
|
|
20355
19459
|
return newStyled2.apply(void 0, styles);
|
|
@@ -21367,9 +20471,8 @@ function sortContainerQueries(theme, css2) {
|
|
|
21367
20471
|
return css2;
|
|
21368
20472
|
}
|
|
21369
20473
|
const sorted = Object.keys(css2).filter((key) => key.startsWith("@container")).sort((a, b) => {
|
|
21370
|
-
var _a, _b;
|
|
21371
20474
|
const regex = /min-width:\s*([0-9.]+)/;
|
|
21372
|
-
return +(
|
|
20475
|
+
return +(a.match(regex)?.[1] || 0) - +(b.match(regex)?.[1] || 0);
|
|
21373
20476
|
});
|
|
21374
20477
|
if (!sorted.length) {
|
|
21375
20478
|
return css2;
|
|
@@ -21497,8 +20600,7 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
21497
20600
|
return output;
|
|
21498
20601
|
}
|
|
21499
20602
|
function createEmptyBreakpointObject(breakpointsInput = {}) {
|
|
21500
|
-
|
|
21501
|
-
const breakpointsInOrder = (_a = breakpointsInput.keys) == null ? void 0 : _a.reduce((acc, key) => {
|
|
20603
|
+
const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key) => {
|
|
21502
20604
|
const breakpointStyleKey = breakpointsInput.up(key);
|
|
21503
20605
|
acc[breakpointStyleKey] = {};
|
|
21504
20606
|
return acc;
|
|
@@ -21918,14 +21020,13 @@ const width = style$1({
|
|
|
21918
21020
|
const maxWidth = (props) => {
|
|
21919
21021
|
if (props.maxWidth !== void 0 && props.maxWidth !== null) {
|
|
21920
21022
|
const styleFromPropValue = (propValue) => {
|
|
21921
|
-
|
|
21922
|
-
const breakpoint = ((_c = (_b = (_a = props.theme) == null ? void 0 : _a.breakpoints) == null ? void 0 : _b.values) == null ? void 0 : _c[propValue]) || values[propValue];
|
|
21023
|
+
const breakpoint = props.theme?.breakpoints?.values?.[propValue] || values[propValue];
|
|
21923
21024
|
if (!breakpoint) {
|
|
21924
21025
|
return {
|
|
21925
21026
|
maxWidth: sizingTransform(propValue)
|
|
21926
21027
|
};
|
|
21927
21028
|
}
|
|
21928
|
-
if (
|
|
21029
|
+
if (props.theme?.breakpoints?.unit !== "px") {
|
|
21929
21030
|
return {
|
|
21930
21031
|
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
21931
21032
|
};
|
|
@@ -22366,10 +21467,9 @@ function unstable_createStyleFunctionSx() {
|
|
|
22366
21467
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
22367
21468
|
styleFunctionSx.filterProps = ["sx"];
|
|
22368
21469
|
function applyStyles(key, styles) {
|
|
22369
|
-
var _a;
|
|
22370
21470
|
const theme = this;
|
|
22371
21471
|
if (theme.vars) {
|
|
22372
|
-
if (!
|
|
21472
|
+
if (!theme.colorSchemes?.[key] || typeof theme.getColorSchemeSelector !== "function") {
|
|
22373
21473
|
return {};
|
|
22374
21474
|
}
|
|
22375
21475
|
let selector2 = theme.getColorSchemeSelector(key);
|
|
@@ -22418,7 +21518,7 @@ function createTheme$1(options = {}, ...args) {
|
|
|
22418
21518
|
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
|
22419
21519
|
muiTheme.unstable_sxConfig = {
|
|
22420
21520
|
...defaultSxConfig,
|
|
22421
|
-
...other
|
|
21521
|
+
...other?.unstable_sxConfig
|
|
22422
21522
|
};
|
|
22423
21523
|
muiTheme.unstable_sx = function sx(props) {
|
|
22424
21524
|
return styleFunctionSx({
|
|
@@ -22440,12 +21540,11 @@ function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
|
|
|
22440
21540
|
return useTheme$2(defaultTheme2);
|
|
22441
21541
|
}
|
|
22442
21542
|
const splitProps = (props) => {
|
|
22443
|
-
var _a;
|
|
22444
21543
|
const result = {
|
|
22445
21544
|
systemProps: {},
|
|
22446
21545
|
otherProps: {}
|
|
22447
21546
|
};
|
|
22448
|
-
const config =
|
|
21547
|
+
const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
|
|
22449
21548
|
Object.keys(props).forEach((prop) => {
|
|
22450
21549
|
if (config[prop]) {
|
|
22451
21550
|
result.systemProps[prop] = props[prop];
|
|
@@ -22612,7 +21711,7 @@ function processStyle(props, style2) {
|
|
|
22612
21711
|
if (Array.isArray(resolvedStyle)) {
|
|
22613
21712
|
return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
|
|
22614
21713
|
}
|
|
22615
|
-
if (Array.isArray(resolvedStyle
|
|
21714
|
+
if (Array.isArray(resolvedStyle?.variants)) {
|
|
22616
21715
|
let rootStyle;
|
|
22617
21716
|
if (resolvedStyle.isProcessed) {
|
|
22618
21717
|
rootStyle = resolvedStyle.style;
|
|
@@ -22625,38 +21724,37 @@ function processStyle(props, style2) {
|
|
|
22625
21724
|
}
|
|
22626
21725
|
return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
|
|
22627
21726
|
}
|
|
22628
|
-
if (resolvedStyle
|
|
21727
|
+
if (resolvedStyle?.isProcessed) {
|
|
22629
21728
|
return resolvedStyle.style;
|
|
22630
21729
|
}
|
|
22631
21730
|
return resolvedStyle;
|
|
22632
21731
|
}
|
|
22633
21732
|
function processStyleVariants(props, variants, results = []) {
|
|
22634
|
-
var _a;
|
|
22635
21733
|
let mergedState;
|
|
22636
21734
|
variantLoop: for (let i = 0; i < variants.length; i += 1) {
|
|
22637
21735
|
const variant = variants[i];
|
|
22638
21736
|
if (typeof variant.props === "function") {
|
|
22639
|
-
mergedState
|
|
21737
|
+
mergedState ??= {
|
|
22640
21738
|
...props,
|
|
22641
21739
|
...props.ownerState,
|
|
22642
21740
|
ownerState: props.ownerState
|
|
22643
|
-
}
|
|
21741
|
+
};
|
|
22644
21742
|
if (!variant.props(mergedState)) {
|
|
22645
21743
|
continue;
|
|
22646
21744
|
}
|
|
22647
21745
|
} else {
|
|
22648
21746
|
for (const key in variant.props) {
|
|
22649
|
-
if (props[key] !== variant.props[key] &&
|
|
21747
|
+
if (props[key] !== variant.props[key] && props.ownerState?.[key] !== variant.props[key]) {
|
|
22650
21748
|
continue variantLoop;
|
|
22651
21749
|
}
|
|
22652
21750
|
}
|
|
22653
21751
|
}
|
|
22654
21752
|
if (typeof variant.style === "function") {
|
|
22655
|
-
mergedState
|
|
21753
|
+
mergedState ??= {
|
|
22656
21754
|
...props,
|
|
22657
21755
|
...props.ownerState,
|
|
22658
21756
|
ownerState: props.ownerState
|
|
22659
|
-
}
|
|
21757
|
+
};
|
|
22660
21758
|
results.push(variant.style(mergedState));
|
|
22661
21759
|
} else {
|
|
22662
21760
|
results.push(variant.style);
|
|
@@ -22729,9 +21827,8 @@ function createStyled2(input = {}) {
|
|
|
22729
21827
|
expressionsHead.push(styleAttachTheme);
|
|
22730
21828
|
if (componentName && overridesResolver) {
|
|
22731
21829
|
expressionsTail.push(function styleThemeOverrides(props) {
|
|
22732
|
-
var _a, _b;
|
|
22733
21830
|
const theme = props.theme;
|
|
22734
|
-
const styleOverrides =
|
|
21831
|
+
const styleOverrides = theme.components?.[componentName]?.styleOverrides;
|
|
22735
21832
|
if (!styleOverrides) {
|
|
22736
21833
|
return null;
|
|
22737
21834
|
}
|
|
@@ -22744,9 +21841,8 @@ function createStyled2(input = {}) {
|
|
|
22744
21841
|
}
|
|
22745
21842
|
if (componentName && !skipVariantsResolver) {
|
|
22746
21843
|
expressionsTail.push(function styleThemeVariants(props) {
|
|
22747
|
-
var _a, _b;
|
|
22748
21844
|
const theme = props.theme;
|
|
22749
|
-
const themeVariants =
|
|
21845
|
+
const themeVariants = theme?.components?.[componentName]?.variants;
|
|
22750
21846
|
if (!themeVariants) {
|
|
22751
21847
|
return null;
|
|
22752
21848
|
}
|
|
@@ -22855,7 +21951,7 @@ function resolveProps(defaultProps, props) {
|
|
|
22855
21951
|
return output;
|
|
22856
21952
|
}
|
|
22857
21953
|
const useEnhancedEffect$1 = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
22858
|
-
function clamp
|
|
21954
|
+
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
|
22859
21955
|
return Math.max(min, Math.min(val, max));
|
|
22860
21956
|
}
|
|
22861
21957
|
function clampWrapper(value, min = 0, max = 1) {
|
|
@@ -22864,7 +21960,7 @@ function clampWrapper(value, min = 0, max = 1) {
|
|
|
22864
21960
|
console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);
|
|
22865
21961
|
}
|
|
22866
21962
|
}
|
|
22867
|
-
return clamp
|
|
21963
|
+
return clamp(value, min, max);
|
|
22868
21964
|
}
|
|
22869
21965
|
function hexToRgb(color2) {
|
|
22870
21966
|
color2 = color2.slice(1);
|
|
@@ -23288,7 +22384,6 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23288
22384
|
};
|
|
23289
22385
|
}
|
|
23290
22386
|
function defaultGetSelector2(colorScheme, cssObject) {
|
|
23291
|
-
var _a, _b;
|
|
23292
22387
|
let rule = selector2;
|
|
23293
22388
|
if (selector2 === "class") {
|
|
23294
22389
|
rule = ".%s";
|
|
@@ -23296,7 +22391,7 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23296
22391
|
if (selector2 === "data") {
|
|
23297
22392
|
rule = "[data-%s]";
|
|
23298
22393
|
}
|
|
23299
|
-
if (
|
|
22394
|
+
if (selector2?.startsWith("data-") && !selector2.includes("%s")) {
|
|
23300
22395
|
rule = `[${selector2}="%s"]`;
|
|
23301
22396
|
}
|
|
23302
22397
|
if (colorScheme) {
|
|
@@ -23304,7 +22399,7 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23304
22399
|
if (theme.defaultColorScheme === colorScheme) {
|
|
23305
22400
|
return ":root";
|
|
23306
22401
|
}
|
|
23307
|
-
const mode =
|
|
22402
|
+
const mode = colorSchemes[colorScheme]?.palette?.mode || colorScheme;
|
|
23308
22403
|
return {
|
|
23309
22404
|
[`@media (prefers-color-scheme: ${mode})`]: {
|
|
23310
22405
|
":root": cssObject
|
|
@@ -23332,7 +22427,6 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23332
22427
|
return vars;
|
|
23333
22428
|
};
|
|
23334
22429
|
const generateStyleSheets = () => {
|
|
23335
|
-
var _a, _b;
|
|
23336
22430
|
const stylesheets = [];
|
|
23337
22431
|
const colorScheme = theme.defaultColorScheme || "light";
|
|
23338
22432
|
function insertStyleSheet(key, css2) {
|
|
@@ -23355,7 +22449,7 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23355
22449
|
const {
|
|
23356
22450
|
css: css2
|
|
23357
22451
|
} = defaultSchemeVal;
|
|
23358
|
-
const cssColorSheme =
|
|
22452
|
+
const cssColorSheme = colorSchemes[colorScheme]?.palette?.mode;
|
|
23359
22453
|
const finalCss = !disableCssColorScheme && cssColorSheme ? {
|
|
23360
22454
|
colorScheme: cssColorSheme,
|
|
23361
22455
|
...css2
|
|
@@ -23369,8 +22463,7 @@ function prepareCssVars(theme, parserConfig = {}) {
|
|
|
23369
22463
|
Object.entries(other).forEach(([key, {
|
|
23370
22464
|
css: css2
|
|
23371
22465
|
}]) => {
|
|
23372
|
-
|
|
23373
|
-
const cssColorSheme = (_b2 = (_a2 = colorSchemes[key]) == null ? void 0 : _a2.palette) == null ? void 0 : _b2.mode;
|
|
22466
|
+
const cssColorSheme = colorSchemes[key]?.palette?.mode;
|
|
23374
22467
|
const finalCss = !disableCssColorScheme && cssColorSheme ? {
|
|
23375
22468
|
colorScheme: cssColorSheme,
|
|
23376
22469
|
...css2
|
|
@@ -24102,7 +23195,7 @@ function createThemeNoVars(options = {}, ...args) {
|
|
|
24102
23195
|
}
|
|
24103
23196
|
muiTheme.unstable_sxConfig = {
|
|
24104
23197
|
...defaultSxConfig,
|
|
24105
|
-
...other
|
|
23198
|
+
...other?.unstable_sxConfig
|
|
24106
23199
|
};
|
|
24107
23200
|
muiTheme.unstable_sx = function sx(props) {
|
|
24108
23201
|
return styleFunctionSx({
|
|
@@ -24162,9 +23255,8 @@ function createColorScheme(options) {
|
|
|
24162
23255
|
};
|
|
24163
23256
|
}
|
|
24164
23257
|
function shouldSkipGeneratingVar(keys2) {
|
|
24165
|
-
var _a;
|
|
24166
23258
|
return !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
|
|
24167
|
-
keys2[0] === "palette" && !!
|
|
23259
|
+
keys2[0] === "palette" && !!keys2[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
|
24168
23260
|
}
|
|
24169
23261
|
const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
|
|
24170
23262
|
const defaultGetSelector = (theme) => (colorScheme, css2) => {
|
|
@@ -24177,7 +23269,7 @@ const defaultGetSelector = (theme) => (colorScheme, css2) => {
|
|
|
24177
23269
|
if (selector2 === "data") {
|
|
24178
23270
|
rule = "[data-%s]";
|
|
24179
23271
|
}
|
|
24180
|
-
if (
|
|
23272
|
+
if (selector2?.startsWith("data-") && !selector2.includes("%s")) {
|
|
24181
23273
|
rule = `[${selector2}="%s"]`;
|
|
24182
23274
|
}
|
|
24183
23275
|
if (theme.defaultColorScheme === colorScheme) {
|
|
@@ -24277,7 +23369,7 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
24277
23369
|
...scheme,
|
|
24278
23370
|
palette: {
|
|
24279
23371
|
mode,
|
|
24280
|
-
...scheme
|
|
23372
|
+
...scheme?.palette
|
|
24281
23373
|
}
|
|
24282
23374
|
});
|
|
24283
23375
|
return void 0;
|
|
@@ -24289,7 +23381,7 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
24289
23381
|
...restTheme,
|
|
24290
23382
|
palette: {
|
|
24291
23383
|
mode,
|
|
24292
|
-
...scheme
|
|
23384
|
+
...scheme?.palette
|
|
24293
23385
|
}
|
|
24294
23386
|
});
|
|
24295
23387
|
colorSchemes[colorScheme] = {
|
|
@@ -24297,9 +23389,9 @@ function attachColorScheme$1(colorSchemes, scheme, restTheme, colorScheme) {
|
|
|
24297
23389
|
palette,
|
|
24298
23390
|
opacity: {
|
|
24299
23391
|
...getOpacity(mode),
|
|
24300
|
-
...scheme
|
|
23392
|
+
...scheme?.opacity
|
|
24301
23393
|
},
|
|
24302
|
-
overlays:
|
|
23394
|
+
overlays: scheme?.overlays || getOverlays(mode)
|
|
24303
23395
|
};
|
|
24304
23396
|
return muiTheme;
|
|
24305
23397
|
}
|
|
@@ -24558,7 +23650,7 @@ function createThemeWithVars(options = {}, ...args) {
|
|
|
24558
23650
|
theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar$1;
|
|
24559
23651
|
theme.unstable_sxConfig = {
|
|
24560
23652
|
...defaultSxConfig,
|
|
24561
|
-
...input
|
|
23653
|
+
...input?.unstable_sxConfig
|
|
24562
23654
|
};
|
|
24563
23655
|
theme.unstable_sx = function sx(props) {
|
|
24564
23656
|
return styleFunctionSx({
|
|
@@ -24591,11 +23683,11 @@ function createTheme(options = {}, ...args) {
|
|
|
24591
23683
|
colorSchemes: initialColorSchemes = !palette ? {
|
|
24592
23684
|
light: true
|
|
24593
23685
|
} : void 0,
|
|
24594
|
-
defaultColorScheme: initialDefaultColorScheme = palette
|
|
23686
|
+
defaultColorScheme: initialDefaultColorScheme = palette?.mode,
|
|
24595
23687
|
...rest
|
|
24596
23688
|
} = options;
|
|
24597
23689
|
const defaultColorSchemeInput = initialDefaultColorScheme || "light";
|
|
24598
|
-
const defaultScheme = initialColorSchemes
|
|
23690
|
+
const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
|
|
24599
23691
|
const colorSchemesInput = {
|
|
24600
23692
|
...initialColorSchemes,
|
|
24601
23693
|
...palette ? {
|
|
@@ -24776,7 +23868,7 @@ function useForkRef$1(...refs) {
|
|
|
24776
23868
|
};
|
|
24777
23869
|
});
|
|
24778
23870
|
return () => {
|
|
24779
|
-
cleanups.forEach((refCleanup) => refCleanup
|
|
23871
|
+
cleanups.forEach((refCleanup) => refCleanup?.());
|
|
24780
23872
|
};
|
|
24781
23873
|
}, refs);
|
|
24782
23874
|
return React$1.useMemo(() => {
|
|
@@ -24799,15 +23891,6 @@ function chainPropTypes(propType1, propType2) {
|
|
|
24799
23891
|
return propType1(...args) || propType2(...args);
|
|
24800
23892
|
};
|
|
24801
23893
|
}
|
|
24802
|
-
function _extends$1() {
|
|
24803
|
-
return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
|
|
24804
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
24805
|
-
var t = arguments[e];
|
|
24806
|
-
for (var r2 in t) ({}).hasOwnProperty.call(t, r2) && (n[r2] = t[r2]);
|
|
24807
|
-
}
|
|
24808
|
-
return n;
|
|
24809
|
-
}, _extends$1.apply(null, arguments);
|
|
24810
|
-
}
|
|
24811
23894
|
function _setPrototypeOf(t, e) {
|
|
24812
23895
|
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e3) {
|
|
24813
23896
|
return t2.__proto__ = e3, t2;
|
|
@@ -24870,11 +23953,11 @@ function mergeSlotProps(parameters) {
|
|
|
24870
23953
|
className
|
|
24871
23954
|
} = parameters;
|
|
24872
23955
|
if (!getSlotProps) {
|
|
24873
|
-
const joinedClasses2 = clsx(additionalProps
|
|
23956
|
+
const joinedClasses2 = clsx(additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
24874
23957
|
const mergedStyle2 = {
|
|
24875
|
-
...additionalProps
|
|
24876
|
-
...externalForwardedProps
|
|
24877
|
-
...externalSlotProps
|
|
23958
|
+
...additionalProps?.style,
|
|
23959
|
+
...externalForwardedProps?.style,
|
|
23960
|
+
...externalSlotProps?.style
|
|
24878
23961
|
};
|
|
24879
23962
|
const props2 = {
|
|
24880
23963
|
...additionalProps,
|
|
@@ -24899,12 +23982,12 @@ function mergeSlotProps(parameters) {
|
|
|
24899
23982
|
const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);
|
|
24900
23983
|
const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);
|
|
24901
23984
|
const internalSlotProps = getSlotProps(eventHandlers);
|
|
24902
|
-
const joinedClasses = clsx(internalSlotProps
|
|
23985
|
+
const joinedClasses = clsx(internalSlotProps?.className, additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
|
24903
23986
|
const mergedStyle = {
|
|
24904
|
-
...internalSlotProps
|
|
24905
|
-
...additionalProps
|
|
24906
|
-
...externalForwardedProps
|
|
24907
|
-
...externalSlotProps
|
|
23987
|
+
...internalSlotProps?.style,
|
|
23988
|
+
...additionalProps?.style,
|
|
23989
|
+
...externalForwardedProps?.style,
|
|
23990
|
+
...externalSlotProps?.style
|
|
24908
23991
|
};
|
|
24909
23992
|
const props = {
|
|
24910
23993
|
...internalSlotProps,
|
|
@@ -24962,7 +24045,6 @@ function HTMLElementType(props, propName, componentName, location, propFullName)
|
|
|
24962
24045
|
return null;
|
|
24963
24046
|
}
|
|
24964
24047
|
function useSlotProps(parameters) {
|
|
24965
|
-
var _a;
|
|
24966
24048
|
const {
|
|
24967
24049
|
elementType,
|
|
24968
24050
|
externalSlotProps,
|
|
@@ -24978,7 +24060,7 @@ function useSlotProps(parameters) {
|
|
|
24978
24060
|
...other,
|
|
24979
24061
|
externalSlotProps: resolvedComponentsProps
|
|
24980
24062
|
});
|
|
24981
|
-
const ref = useForkRef$1(internalRef, resolvedComponentsProps
|
|
24063
|
+
const ref = useForkRef$1(internalRef, resolvedComponentsProps?.ref, parameters.additionalProps?.ref);
|
|
24982
24064
|
const props = appendOwnerState(elementType, {
|
|
24983
24065
|
...mergedProps,
|
|
24984
24066
|
ref
|
|
@@ -24986,11 +24068,10 @@ function useSlotProps(parameters) {
|
|
|
24986
24068
|
return props;
|
|
24987
24069
|
}
|
|
24988
24070
|
function getReactElementRef(element) {
|
|
24989
|
-
var _a;
|
|
24990
24071
|
if (parseInt(React$1.version, 10) >= 19) {
|
|
24991
|
-
return
|
|
24072
|
+
return element?.props?.ref || null;
|
|
24992
24073
|
}
|
|
24993
|
-
return
|
|
24074
|
+
return element?.ref || null;
|
|
24994
24075
|
}
|
|
24995
24076
|
function getContainer(container) {
|
|
24996
24077
|
return typeof container === "function" ? container() : container;
|
|
@@ -25101,72 +24182,69 @@ const TypographyRoot = styled("span", {
|
|
|
25101
24182
|
}
|
|
25102
24183
|
})(memoTheme(({
|
|
25103
24184
|
theme
|
|
25104
|
-
}) => {
|
|
25105
|
-
|
|
25106
|
-
|
|
25107
|
-
|
|
25108
|
-
|
|
25109
|
-
|
|
25110
|
-
|
|
25111
|
-
|
|
25112
|
-
|
|
25113
|
-
|
|
25114
|
-
|
|
25115
|
-
|
|
25116
|
-
|
|
25117
|
-
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
|
|
25121
|
-
|
|
25122
|
-
|
|
25123
|
-
|
|
25124
|
-
|
|
25125
|
-
|
|
25126
|
-
|
|
25127
|
-
|
|
25128
|
-
|
|
25129
|
-
|
|
25130
|
-
|
|
25131
|
-
|
|
25132
|
-
|
|
25133
|
-
|
|
25134
|
-
|
|
25135
|
-
|
|
25136
|
-
|
|
25137
|
-
|
|
25138
|
-
|
|
25139
|
-
|
|
25140
|
-
|
|
25141
|
-
|
|
25142
|
-
|
|
25143
|
-
|
|
25144
|
-
|
|
25145
|
-
|
|
25146
|
-
|
|
25147
|
-
|
|
25148
|
-
|
|
25149
|
-
|
|
25150
|
-
|
|
25151
|
-
|
|
25152
|
-
|
|
25153
|
-
|
|
25154
|
-
|
|
25155
|
-
|
|
25156
|
-
|
|
25157
|
-
|
|
25158
|
-
|
|
25159
|
-
|
|
25160
|
-
|
|
25161
|
-
|
|
25162
|
-
|
|
25163
|
-
|
|
25164
|
-
|
|
25165
|
-
|
|
25166
|
-
|
|
25167
|
-
}]
|
|
25168
|
-
};
|
|
25169
|
-
}));
|
|
24185
|
+
}) => ({
|
|
24186
|
+
margin: 0,
|
|
24187
|
+
variants: [{
|
|
24188
|
+
props: {
|
|
24189
|
+
variant: "inherit"
|
|
24190
|
+
},
|
|
24191
|
+
style: {
|
|
24192
|
+
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
|
|
24193
|
+
font: "inherit",
|
|
24194
|
+
lineHeight: "inherit",
|
|
24195
|
+
letterSpacing: "inherit"
|
|
24196
|
+
}
|
|
24197
|
+
}, ...Object.entries(theme.typography).filter(([variant, value]) => variant !== "inherit" && value && typeof value === "object").map(([variant, value]) => ({
|
|
24198
|
+
props: {
|
|
24199
|
+
variant
|
|
24200
|
+
},
|
|
24201
|
+
style: value
|
|
24202
|
+
})), ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color2]) => ({
|
|
24203
|
+
props: {
|
|
24204
|
+
color: color2
|
|
24205
|
+
},
|
|
24206
|
+
style: {
|
|
24207
|
+
color: (theme.vars || theme).palette[color2].main
|
|
24208
|
+
}
|
|
24209
|
+
})), ...Object.entries(theme.palette?.text || {}).filter(([, value]) => typeof value === "string").map(([color2]) => ({
|
|
24210
|
+
props: {
|
|
24211
|
+
color: `text${capitalize(color2)}`
|
|
24212
|
+
},
|
|
24213
|
+
style: {
|
|
24214
|
+
color: (theme.vars || theme).palette.text[color2]
|
|
24215
|
+
}
|
|
24216
|
+
})), {
|
|
24217
|
+
props: ({
|
|
24218
|
+
ownerState
|
|
24219
|
+
}) => ownerState.align !== "inherit",
|
|
24220
|
+
style: {
|
|
24221
|
+
textAlign: "var(--Typography-textAlign)"
|
|
24222
|
+
}
|
|
24223
|
+
}, {
|
|
24224
|
+
props: ({
|
|
24225
|
+
ownerState
|
|
24226
|
+
}) => ownerState.noWrap,
|
|
24227
|
+
style: {
|
|
24228
|
+
overflow: "hidden",
|
|
24229
|
+
textOverflow: "ellipsis",
|
|
24230
|
+
whiteSpace: "nowrap"
|
|
24231
|
+
}
|
|
24232
|
+
}, {
|
|
24233
|
+
props: ({
|
|
24234
|
+
ownerState
|
|
24235
|
+
}) => ownerState.gutterBottom,
|
|
24236
|
+
style: {
|
|
24237
|
+
marginBottom: "0.35em"
|
|
24238
|
+
}
|
|
24239
|
+
}, {
|
|
24240
|
+
props: ({
|
|
24241
|
+
ownerState
|
|
24242
|
+
}) => ownerState.paragraph,
|
|
24243
|
+
style: {
|
|
24244
|
+
marginBottom: 16
|
|
24245
|
+
}
|
|
24246
|
+
}]
|
|
24247
|
+
})));
|
|
25170
24248
|
const defaultVariantMapping = {
|
|
25171
24249
|
h1: "h1",
|
|
25172
24250
|
h2: "h2",
|
|
@@ -25220,7 +24298,7 @@ const Typography = /* @__PURE__ */ React$1.forwardRef(function Typography2(inPro
|
|
|
25220
24298
|
};
|
|
25221
24299
|
const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
|
|
25222
24300
|
const classes = useUtilityClasses$1(ownerState);
|
|
25223
|
-
return /* @__PURE__ */
|
|
24301
|
+
return /* @__PURE__ */ jsx$1(TypographyRoot, {
|
|
25224
24302
|
as: Component,
|
|
25225
24303
|
ref,
|
|
25226
24304
|
className: clsx(classes.root, className),
|
|
@@ -25408,10 +24486,9 @@ function focusThumb({
|
|
|
25408
24486
|
activeIndex,
|
|
25409
24487
|
setActive
|
|
25410
24488
|
}) {
|
|
25411
|
-
var _a, _b, _c;
|
|
25412
24489
|
const doc = ownerDocument(sliderRef.current);
|
|
25413
|
-
if (!
|
|
25414
|
-
|
|
24490
|
+
if (!sliderRef.current?.contains(doc.activeElement) || Number(doc?.activeElement?.getAttribute("data-index")) !== activeIndex) {
|
|
24491
|
+
sliderRef.current?.querySelector(`[type="range"][data-index="${activeIndex}"]`).focus();
|
|
25415
24492
|
}
|
|
25416
24493
|
if (setActive) {
|
|
25417
24494
|
setActive(activeIndex);
|
|
@@ -25511,7 +24588,7 @@ function useSlider(parameters) {
|
|
|
25511
24588
|
});
|
|
25512
24589
|
const range2 = Array.isArray(valueDerived);
|
|
25513
24590
|
let values2 = range2 ? valueDerived.slice().sort(asc) : [valueDerived];
|
|
25514
|
-
values2 = values2.map((value) => value == null ? min : clamp
|
|
24591
|
+
values2 = values2.map((value) => value == null ? min : clamp(value, min, max));
|
|
25515
24592
|
const marks = marksProp === true && step !== null ? [...Array(Math.floor((max - min) / step) + 1)].map((_, index) => ({
|
|
25516
24593
|
value: min + step * index
|
|
25517
24594
|
})) : marksProp || [];
|
|
@@ -25520,21 +24597,19 @@ function useSlider(parameters) {
|
|
|
25520
24597
|
const sliderRef = React$1.useRef(null);
|
|
25521
24598
|
const handleRef = useForkRef$1(ref, sliderRef);
|
|
25522
24599
|
const createHandleHiddenInputFocus = (otherHandlers) => (event) => {
|
|
25523
|
-
var _a;
|
|
25524
24600
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
25525
24601
|
if (isFocusVisible(event.target)) {
|
|
25526
24602
|
setFocusedThumbIndex(index);
|
|
25527
24603
|
}
|
|
25528
24604
|
setOpen(index);
|
|
25529
|
-
|
|
24605
|
+
otherHandlers?.onFocus?.(event);
|
|
25530
24606
|
};
|
|
25531
24607
|
const createHandleHiddenInputBlur = (otherHandlers) => (event) => {
|
|
25532
|
-
var _a;
|
|
25533
24608
|
if (!isFocusVisible(event.target)) {
|
|
25534
24609
|
setFocusedThumbIndex(-1);
|
|
25535
24610
|
}
|
|
25536
24611
|
setOpen(-1);
|
|
25537
|
-
|
|
24612
|
+
otherHandlers?.onBlur?.(event);
|
|
25538
24613
|
};
|
|
25539
24614
|
const changeValue = (event, valueInput) => {
|
|
25540
24615
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
@@ -25551,10 +24626,10 @@ function useSlider(parameters) {
|
|
|
25551
24626
|
newValue = newValue < value ? marksValues[marksIndex - 1] : marksValues[marksIndex + 1];
|
|
25552
24627
|
}
|
|
25553
24628
|
}
|
|
25554
|
-
newValue = clamp
|
|
24629
|
+
newValue = clamp(newValue, min, max);
|
|
25555
24630
|
if (range2) {
|
|
25556
24631
|
if (disableSwap) {
|
|
25557
|
-
newValue = clamp
|
|
24632
|
+
newValue = clamp(newValue, values2[index - 1] || -Infinity, values2[index + 1] || Infinity);
|
|
25558
24633
|
}
|
|
25559
24634
|
const previousValue = newValue;
|
|
25560
24635
|
newValue = setValueIndex({
|
|
@@ -25581,7 +24656,6 @@ function useSlider(parameters) {
|
|
|
25581
24656
|
}
|
|
25582
24657
|
};
|
|
25583
24658
|
const createHandleHiddenInputKeyDown = (otherHandlers) => (event) => {
|
|
25584
|
-
var _a;
|
|
25585
24659
|
if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"].includes(event.key)) {
|
|
25586
24660
|
event.preventDefault();
|
|
25587
24661
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
@@ -25638,12 +24712,11 @@ function useSlider(parameters) {
|
|
|
25638
24712
|
changeValue(event, newValue);
|
|
25639
24713
|
}
|
|
25640
24714
|
}
|
|
25641
|
-
|
|
24715
|
+
otherHandlers?.onKeyDown?.(event);
|
|
25642
24716
|
};
|
|
25643
24717
|
useEnhancedEffect$1(() => {
|
|
25644
|
-
var _a;
|
|
25645
24718
|
if (disabled && sliderRef.current.contains(document.activeElement)) {
|
|
25646
|
-
|
|
24719
|
+
document.activeElement?.blur();
|
|
25647
24720
|
}
|
|
25648
24721
|
}, [disabled]);
|
|
25649
24722
|
if (disabled && active !== -1) {
|
|
@@ -25653,8 +24726,7 @@ function useSlider(parameters) {
|
|
|
25653
24726
|
setFocusedThumbIndex(-1);
|
|
25654
24727
|
}
|
|
25655
24728
|
const createHandleHiddenInputChange = (otherHandlers) => (event) => {
|
|
25656
|
-
|
|
25657
|
-
(_a = otherHandlers.onChange) == null ? void 0 : _a.call(otherHandlers, event);
|
|
24729
|
+
otherHandlers.onChange?.(event);
|
|
25658
24730
|
changeValue(event, event.target.valueAsNumber);
|
|
25659
24731
|
};
|
|
25660
24732
|
const previousIndex = React$1.useRef(void 0);
|
|
@@ -25692,7 +24764,7 @@ function useSlider(parameters) {
|
|
|
25692
24764
|
const closestIndex = findClosest(marksValues, newValue);
|
|
25693
24765
|
newValue = marksValues[closestIndex];
|
|
25694
24766
|
}
|
|
25695
|
-
newValue = clamp
|
|
24767
|
+
newValue = clamp(newValue, min, max);
|
|
25696
24768
|
let activeIndex = 0;
|
|
25697
24769
|
if (range2) {
|
|
25698
24770
|
if (!move) {
|
|
@@ -25701,7 +24773,7 @@ function useSlider(parameters) {
|
|
|
25701
24773
|
activeIndex = previousIndex.current;
|
|
25702
24774
|
}
|
|
25703
24775
|
if (disableSwap) {
|
|
25704
|
-
newValue = clamp
|
|
24776
|
+
newValue = clamp(newValue, values2[activeIndex - 1] || -Infinity, values2[activeIndex + 1] || Infinity);
|
|
25705
24777
|
}
|
|
25706
24778
|
const previousValue = newValue;
|
|
25707
24779
|
newValue = setValueIndex({
|
|
@@ -25834,8 +24906,7 @@ function useSlider(parameters) {
|
|
|
25834
24906
|
}
|
|
25835
24907
|
}, [disabled, stopListening]);
|
|
25836
24908
|
const createHandleMouseDown = (otherHandlers) => (event) => {
|
|
25837
|
-
|
|
25838
|
-
(_a = otherHandlers.onMouseDown) == null ? void 0 : _a.call(otherHandlers, event);
|
|
24909
|
+
otherHandlers.onMouseDown?.(event);
|
|
25839
24910
|
if (disabled) {
|
|
25840
24911
|
return;
|
|
25841
24912
|
}
|
|
@@ -25889,14 +24960,12 @@ function useSlider(parameters) {
|
|
|
25889
24960
|
};
|
|
25890
24961
|
};
|
|
25891
24962
|
const createHandleMouseOver = (otherHandlers) => (event) => {
|
|
25892
|
-
|
|
25893
|
-
(_a = otherHandlers.onMouseOver) == null ? void 0 : _a.call(otherHandlers, event);
|
|
24963
|
+
otherHandlers.onMouseOver?.(event);
|
|
25894
24964
|
const index = Number(event.currentTarget.getAttribute("data-index"));
|
|
25895
24965
|
setOpen(index);
|
|
25896
24966
|
};
|
|
25897
24967
|
const createHandleMouseLeave = (otherHandlers) => (event) => {
|
|
25898
|
-
|
|
25899
|
-
(_a = otherHandlers.onMouseLeave) == null ? void 0 : _a.call(otherHandlers, event);
|
|
24968
|
+
otherHandlers.onMouseLeave?.(event);
|
|
25900
24969
|
setOpen(-1);
|
|
25901
24970
|
};
|
|
25902
24971
|
const getThumbProps = (externalProps = {}) => {
|
|
@@ -26006,13 +25075,13 @@ function SliderValueLabel$1(props) {
|
|
|
26006
25075
|
}
|
|
26007
25076
|
return /* @__PURE__ */ React$1.cloneElement(children2, {
|
|
26008
25077
|
className: children2.props.className
|
|
26009
|
-
}, /* @__PURE__ */
|
|
26010
|
-
children: [children2.props.children, /* @__PURE__ */
|
|
25078
|
+
}, /* @__PURE__ */ jsxs(React$1.Fragment, {
|
|
25079
|
+
children: [children2.props.children, /* @__PURE__ */ jsx$1("span", {
|
|
26011
25080
|
className: clsx(classes.offset, className),
|
|
26012
25081
|
"aria-hidden": true,
|
|
26013
|
-
children: /* @__PURE__ */
|
|
25082
|
+
children: /* @__PURE__ */ jsx$1("span", {
|
|
26014
25083
|
className: classes.circle,
|
|
26015
|
-
children: /* @__PURE__ */
|
|
25084
|
+
children: /* @__PURE__ */ jsx$1("span", {
|
|
26016
25085
|
className: classes.label,
|
|
26017
25086
|
children: value
|
|
26018
25087
|
})
|
|
@@ -26644,22 +25713,22 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26644
25713
|
ownerState.dragging = dragging;
|
|
26645
25714
|
ownerState.focusedThumbIndex = focusedThumbIndex;
|
|
26646
25715
|
const classes = useUtilityClasses(ownerState);
|
|
26647
|
-
const RootSlot =
|
|
26648
|
-
const RailSlot =
|
|
26649
|
-
const TrackSlot =
|
|
26650
|
-
const ThumbSlot =
|
|
26651
|
-
const ValueLabelSlot =
|
|
26652
|
-
const MarkSlot =
|
|
26653
|
-
const MarkLabelSlot =
|
|
26654
|
-
const InputSlot =
|
|
26655
|
-
const rootSlotProps =
|
|
26656
|
-
const railSlotProps =
|
|
26657
|
-
const trackSlotProps =
|
|
26658
|
-
const thumbSlotProps =
|
|
26659
|
-
const valueLabelSlotProps =
|
|
26660
|
-
const markSlotProps =
|
|
26661
|
-
const markLabelSlotProps =
|
|
26662
|
-
const inputSlotProps =
|
|
25716
|
+
const RootSlot = slots?.root ?? components.Root ?? SliderRoot;
|
|
25717
|
+
const RailSlot = slots?.rail ?? components.Rail ?? SliderRail;
|
|
25718
|
+
const TrackSlot = slots?.track ?? components.Track ?? SliderTrack;
|
|
25719
|
+
const ThumbSlot = slots?.thumb ?? components.Thumb ?? SliderThumb;
|
|
25720
|
+
const ValueLabelSlot = slots?.valueLabel ?? components.ValueLabel ?? SliderValueLabel;
|
|
25721
|
+
const MarkSlot = slots?.mark ?? components.Mark ?? SliderMark;
|
|
25722
|
+
const MarkLabelSlot = slots?.markLabel ?? components.MarkLabel ?? SliderMarkLabel;
|
|
25723
|
+
const InputSlot = slots?.input ?? components.Input ?? "input";
|
|
25724
|
+
const rootSlotProps = slotProps?.root ?? componentsProps.root;
|
|
25725
|
+
const railSlotProps = slotProps?.rail ?? componentsProps.rail;
|
|
25726
|
+
const trackSlotProps = slotProps?.track ?? componentsProps.track;
|
|
25727
|
+
const thumbSlotProps = slotProps?.thumb ?? componentsProps.thumb;
|
|
25728
|
+
const valueLabelSlotProps = slotProps?.valueLabel ?? componentsProps.valueLabel;
|
|
25729
|
+
const markSlotProps = slotProps?.mark ?? componentsProps.mark;
|
|
25730
|
+
const markLabelSlotProps = slotProps?.markLabel ?? componentsProps.markLabel;
|
|
25731
|
+
const inputSlotProps = slotProps?.input ?? componentsProps.input;
|
|
26663
25732
|
const rootProps = useSlotProps({
|
|
26664
25733
|
elementType: RootSlot,
|
|
26665
25734
|
getSlotProps: getRootProps,
|
|
@@ -26672,7 +25741,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26672
25741
|
},
|
|
26673
25742
|
ownerState: {
|
|
26674
25743
|
...ownerState,
|
|
26675
|
-
...rootSlotProps
|
|
25744
|
+
...rootSlotProps?.ownerState
|
|
26676
25745
|
},
|
|
26677
25746
|
className: [classes.root, className]
|
|
26678
25747
|
});
|
|
@@ -26693,7 +25762,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26693
25762
|
},
|
|
26694
25763
|
ownerState: {
|
|
26695
25764
|
...ownerState,
|
|
26696
|
-
...trackSlotProps
|
|
25765
|
+
...trackSlotProps?.ownerState
|
|
26697
25766
|
},
|
|
26698
25767
|
className: classes.track
|
|
26699
25768
|
});
|
|
@@ -26703,7 +25772,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26703
25772
|
externalSlotProps: thumbSlotProps,
|
|
26704
25773
|
ownerState: {
|
|
26705
25774
|
...ownerState,
|
|
26706
|
-
...thumbSlotProps
|
|
25775
|
+
...thumbSlotProps?.ownerState
|
|
26707
25776
|
},
|
|
26708
25777
|
className: classes.thumb
|
|
26709
25778
|
});
|
|
@@ -26712,7 +25781,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26712
25781
|
externalSlotProps: valueLabelSlotProps,
|
|
26713
25782
|
ownerState: {
|
|
26714
25783
|
...ownerState,
|
|
26715
|
-
...valueLabelSlotProps
|
|
25784
|
+
...valueLabelSlotProps?.ownerState
|
|
26716
25785
|
},
|
|
26717
25786
|
className: classes.valueLabel
|
|
26718
25787
|
});
|
|
@@ -26734,11 +25803,11 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26734
25803
|
externalSlotProps: inputSlotProps,
|
|
26735
25804
|
ownerState
|
|
26736
25805
|
});
|
|
26737
|
-
return /* @__PURE__ */
|
|
25806
|
+
return /* @__PURE__ */ jsxs(RootSlot, {
|
|
26738
25807
|
...rootProps,
|
|
26739
|
-
children: [/* @__PURE__ */
|
|
25808
|
+
children: [/* @__PURE__ */ jsx$1(RailSlot, {
|
|
26740
25809
|
...railProps
|
|
26741
|
-
}), /* @__PURE__ */
|
|
25810
|
+
}), /* @__PURE__ */ jsx$1(TrackSlot, {
|
|
26742
25811
|
...trackProps
|
|
26743
25812
|
}), marks.filter((mark) => mark.value >= min && mark.value <= max).map((mark, index) => {
|
|
26744
25813
|
const percent = valueToPercent(mark.value, min, max);
|
|
@@ -26749,8 +25818,8 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26749
25818
|
} else {
|
|
26750
25819
|
markActive = track === "normal" && (range2 ? mark.value >= values2[0] && mark.value <= values2[values2.length - 1] : mark.value <= values2[0]) || track === "inverted" && (range2 ? mark.value <= values2[0] || mark.value >= values2[values2.length - 1] : mark.value >= values2[0]);
|
|
26751
25820
|
}
|
|
26752
|
-
return /* @__PURE__ */
|
|
26753
|
-
children: [/* @__PURE__ */
|
|
25821
|
+
return /* @__PURE__ */ jsxs(React$1.Fragment, {
|
|
25822
|
+
children: [/* @__PURE__ */ jsx$1(MarkSlot, {
|
|
26754
25823
|
"data-index": index,
|
|
26755
25824
|
...markProps,
|
|
26756
25825
|
...!isHostComponent(MarkSlot) && {
|
|
@@ -26761,7 +25830,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26761
25830
|
...markProps.style
|
|
26762
25831
|
},
|
|
26763
25832
|
className: clsx(markProps.className, markActive && classes.markActive)
|
|
26764
|
-
}), mark.label != null ? /* @__PURE__ */
|
|
25833
|
+
}), mark.label != null ? /* @__PURE__ */ jsx$1(MarkLabelSlot, {
|
|
26765
25834
|
"aria-hidden": true,
|
|
26766
25835
|
"data-index": index,
|
|
26767
25836
|
...markLabelProps,
|
|
@@ -26782,7 +25851,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26782
25851
|
const ValueLabelComponent = valueLabelDisplay === "off" ? Forward : ValueLabelSlot;
|
|
26783
25852
|
return (
|
|
26784
25853
|
/* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
|
|
26785
|
-
/* @__PURE__ */
|
|
25854
|
+
/* @__PURE__ */ jsx$1(ValueLabelComponent, {
|
|
26786
25855
|
...!isHostComponent(ValueLabelComponent) && {
|
|
26787
25856
|
valueLabelFormat,
|
|
26788
25857
|
valueLabelDisplay,
|
|
@@ -26792,7 +25861,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26792
25861
|
disabled
|
|
26793
25862
|
},
|
|
26794
25863
|
...valueLabelProps,
|
|
26795
|
-
children: /* @__PURE__ */
|
|
25864
|
+
children: /* @__PURE__ */ jsx$1(ThumbSlot, {
|
|
26796
25865
|
"data-index": index,
|
|
26797
25866
|
...thumbProps,
|
|
26798
25867
|
className: clsx(classes.thumb, thumbProps.className, active === index && classes.active, focusedThumbIndex === index && classes.focusVisible),
|
|
@@ -26801,7 +25870,7 @@ const Slider = /* @__PURE__ */ React$1.forwardRef(function Slider2(inputProps, r
|
|
|
26801
25870
|
...getThumbStyle(index),
|
|
26802
25871
|
...thumbProps.style
|
|
26803
25872
|
},
|
|
26804
|
-
children: /* @__PURE__ */
|
|
25873
|
+
children: /* @__PURE__ */ jsx$1(InputSlot, {
|
|
26805
25874
|
"data-index": index,
|
|
26806
25875
|
"aria-label": getAriaLabel ? getAriaLabel(index) : ariaLabel,
|
|
26807
25876
|
"aria-valuenow": scale(value),
|
|
@@ -28785,7 +27854,7 @@ React$1.forwardRef((props, ref) => {
|
|
|
28785
27854
|
onExited: handleExited
|
|
28786
27855
|
};
|
|
28787
27856
|
}
|
|
28788
|
-
return
|
|
27857
|
+
return jsx$1(Portal, { disablePortal, container, children: jsx$1("div", { ref: handleRef, role: "tooltip", ...other, style: {
|
|
28789
27858
|
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
|
28790
27859
|
position: "fixed",
|
|
28791
27860
|
// Fix Popper.js display issue
|
|
@@ -28805,7 +27874,7 @@ function ScopedGlobalStyles(props) {
|
|
|
28805
27874
|
const { styles, parentClassName } = props;
|
|
28806
27875
|
const component = useMemo(() => {
|
|
28807
27876
|
const computedStyles = prependParentClassName(styles, parentClassName);
|
|
28808
|
-
return
|
|
27877
|
+
return jsx$1(GlobalStyles, { styles: computedStyles });
|
|
28809
27878
|
}, [parentClassName, styles]);
|
|
28810
27879
|
return component;
|
|
28811
27880
|
}
|
|
@@ -29442,7 +28511,7 @@ makeStyles()(() => ({
|
|
|
29442
28511
|
const OuterElementContext = React__default.createContext({});
|
|
29443
28512
|
const OuterElementType = React__default.forwardRef((props, ref) => {
|
|
29444
28513
|
const outerProps = React__default.useContext(OuterElementContext);
|
|
29445
|
-
return
|
|
28514
|
+
return jsx$1("div", { ref, ...props, ...outerProps });
|
|
29446
28515
|
});
|
|
29447
28516
|
function ListRow(props) {
|
|
29448
28517
|
const { data, index, style: style2 } = props;
|
|
@@ -29453,7 +28522,7 @@ function ListRow(props) {
|
|
|
29453
28522
|
};
|
|
29454
28523
|
const [props0, option, getItemLabel] = dataSet;
|
|
29455
28524
|
const { key, ...optionProps } = props0;
|
|
29456
|
-
return
|
|
28525
|
+
return jsx$1(Typography, { component: "li", ...optionProps, noWrap: true, style: inlineStyle, children: getItemLabel(option) }, key);
|
|
29457
28526
|
}
|
|
29458
28527
|
function useResetCache(itemCount) {
|
|
29459
28528
|
const ref = useRef(null);
|
|
@@ -29469,7 +28538,7 @@ React__default.forwardRef((props, ref) => {
|
|
|
29469
28538
|
const items = children2;
|
|
29470
28539
|
const itemCount = items.length;
|
|
29471
28540
|
const gridRef = useResetCache(itemCount);
|
|
29472
|
-
return
|
|
28541
|
+
return jsx$1("div", { ref, children: jsx$1(OuterElementContext.Provider, { value: other, children: jsx$1(VariableSizeList, { height: Math.min(8, itemCount) * LIST_ROW_HEIGHT, itemSize: () => LIST_ROW_HEIGHT, width: "100%", innerElementType: "ul", outerElementType: OuterElementType, overscanCount: 5, ref: gridRef, itemCount, itemData: items, children: ListRow }) }) });
|
|
29473
28542
|
});
|
|
29474
28543
|
var xhtml = "http://www.w3.org/1999/xhtml";
|
|
29475
28544
|
const namespaces = {
|
|
@@ -31473,7 +30542,7 @@ const rectMarginY = 2;
|
|
|
31473
30542
|
const rectMarginX = 2;
|
|
31474
30543
|
function combineExtents(extents, featureAggregationStrategy) {
|
|
31475
30544
|
if (Array.isArray(extents)) {
|
|
31476
|
-
if (Array.isArray(extents
|
|
30545
|
+
if (Array.isArray(extents?.[0])) {
|
|
31477
30546
|
const extentsArray = extents;
|
|
31478
30547
|
if (featureAggregationStrategy === "first") {
|
|
31479
30548
|
return extentsArray[0];
|
|
@@ -31586,7 +30655,7 @@ function Legend(props) {
|
|
|
31586
30655
|
const layerColor = Array.isArray(spatialLayerColor) && spatialLayerColor.length === 3 ? spatialLayerColor : getDefaultColor(theme ?? "light");
|
|
31587
30656
|
const channelColor = Array.isArray(spatialChannelColor) && spatialChannelColor.length === 3 ? spatialChannelColor : getDefaultColor(theme ?? "light");
|
|
31588
30657
|
const staticColor = obsColorEncoding === "spatialChannelColor" ? channelColor : layerColor;
|
|
31589
|
-
const visible = visibleProp && (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && featureSelection && Array.isArray(featureSelection) && featureSelection.length >= 1 || isSetColor && (
|
|
30658
|
+
const visible = visibleProp && (!considerSelections || ["geneSelection", "geneExpression"].includes(obsColorEncoding ?? "") && featureSelection && Array.isArray(featureSelection) && featureSelection.length >= 1 || isSetColor && (obsSetSelection?.length ?? 0) > 0 && (obsSetColor?.length ?? 0) > 0 || isStaticColor || isPointsLayer);
|
|
31590
30659
|
const pointsLegendElements = [];
|
|
31591
30660
|
if (isPointsLayer) {
|
|
31592
30661
|
const MAX_NUM_COLORS = 10;
|
|
@@ -31616,8 +30685,7 @@ function Legend(props) {
|
|
|
31616
30685
|
} else {
|
|
31617
30686
|
const limitedFeatureSelection = featureSelection.slice(0, MAX_NUM_COLORS);
|
|
31618
30687
|
limitedFeatureSelection.forEach((featureName) => {
|
|
31619
|
-
|
|
31620
|
-
const featureColorMatch = Array.isArray(featureColor) ? (_a = featureColor.find((fc) => fc.name === featureName)) == null ? void 0 : _a.color : null;
|
|
30688
|
+
const featureColorMatch = Array.isArray(featureColor) ? featureColor.find((fc) => fc.name === featureName)?.color : null;
|
|
31621
30689
|
pointsLegendElements.push({
|
|
31622
30690
|
name: featureName,
|
|
31623
30691
|
// If no color is specified for this feature, use staticColor.
|
|
@@ -31660,13 +30728,13 @@ function Legend(props) {
|
|
|
31660
30728
|
});
|
|
31661
30729
|
}
|
|
31662
30730
|
}
|
|
31663
|
-
const levelZeroNames = useMemo(() => Array.from(new Set(
|
|
30731
|
+
const levelZeroNames = useMemo(() => Array.from(new Set(obsSetSelection?.map((setPath) => setPath[0]) || [])), [obsSetSelection]);
|
|
31664
30732
|
const dynamicHeight = isPointsLayer ? (
|
|
31665
30733
|
// Height logic for points layers.
|
|
31666
30734
|
pointsLegendElements.length * (rectHeight + rectMarginY) + titleHeight
|
|
31667
30735
|
) : (
|
|
31668
30736
|
// Height logic for non-points layers.
|
|
31669
|
-
isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + (
|
|
30737
|
+
isSetColor && obsSetSelection ? levelZeroNames.length * titleHeight + (obsSetSelection?.length ?? 0) * (rectHeight + rectMarginY) : height2 + (!pointsVisible && contoursVisible ? 25 : 0)
|
|
31670
30738
|
);
|
|
31671
30739
|
const availHeight = maxHeight2 !== null ? Math.max(0, maxHeight2 - 4) : Infinity;
|
|
31672
30740
|
const needsScroll = Number.isFinite(availHeight) && dynamicHeight > availHeight + 1;
|
|
@@ -31723,7 +30791,7 @@ function Legend(props) {
|
|
|
31723
30791
|
axisTicks.selectAll("text").style("fill", foregroundColor);
|
|
31724
30792
|
const NEIGHBOR_THRESHOLD = 18;
|
|
31725
30793
|
const contourPercentages = contourPercentiles.map((p) => p * 100);
|
|
31726
|
-
if (
|
|
30794
|
+
if (contourPercentages?.[1] - contourPercentages?.[0] <= NEIGHBOR_THRESHOLD || contourPercentages?.[2] - contourPercentages?.[1] <= NEIGHBOR_THRESHOLD) {
|
|
31727
30795
|
axisTicks.selectAll("text").attr("transform", (_d, i) => `translate(0,${i === 0 || i === contourPercentiles.length - 1 ? 0 : 10})`);
|
|
31728
30796
|
}
|
|
31729
30797
|
const triangleGroupG = g.append("g").attr("transform", `translate(0,${titleHeight + rectHeight + 4})`);
|
|
@@ -31734,7 +30802,7 @@ function Legend(props) {
|
|
|
31734
30802
|
const thresholdGroupG = g.append("g").attr("transform", `translate(0,${titleHeight + rectHeight})`);
|
|
31735
30803
|
const thresholdFormatter = format(".0f");
|
|
31736
30804
|
contourPercentiles.forEach((p, i) => {
|
|
31737
|
-
const contourThreshold = xMin + (xMax - xMin) * ((
|
|
30805
|
+
const contourThreshold = xMin + (xMax - xMin) * ((contourThresholds?.[i] ?? 0) / 255);
|
|
31738
30806
|
const thresholdG = thresholdGroupG.append("g").attr("transform", `translate(${xPercentile(p)},0)`).style("font-size", "7px");
|
|
31739
30807
|
thresholdG.append("text").text(thresholdFormatter(contourThreshold)).style("fill", foregroundColor).attr("text-anchor", "middle");
|
|
31740
30808
|
});
|
|
@@ -31757,8 +30825,7 @@ function Legend(props) {
|
|
|
31757
30825
|
g.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", 0).attr("y", y).text(levelZeroName).style("font-size", "9px").style("fill", foregroundColor);
|
|
31758
30826
|
y += titleHeight;
|
|
31759
30827
|
setPaths.forEach((setPath) => {
|
|
31760
|
-
|
|
31761
|
-
const setColor2 = ((_a = obsSetColor == null ? void 0 : obsSetColor.find((d) => isEqual$1(d.path, setPath))) == null ? void 0 : _a.color) || getDefaultColor(theme ?? "light");
|
|
30828
|
+
const setColor2 = obsSetColor?.find((d) => isEqual$1(d.path, setPath))?.color || getDefaultColor(theme ?? "light");
|
|
31762
30829
|
g.append("rect").attr("x", 0).attr("y", y).attr("width", rectHeight).attr("height", rectHeight).attr("fill", `rgb(${setColor2[0]},${setColor2[1]},${setColor2[2]})`);
|
|
31763
30830
|
g.append("text").attr("text-anchor", "start").attr("dominant-baseline", "hanging").attr("x", rectHeight + rectMarginX).attr("y", y).text(setPath.at(-1) ?? "").style("font-size", "9px").style("fill", foregroundColor);
|
|
31764
30831
|
y += rectHeight + rectMarginY;
|
|
@@ -31775,29 +30842,29 @@ function Legend(props) {
|
|
|
31775
30842
|
y += rectHeight + rectMarginY;
|
|
31776
30843
|
});
|
|
31777
30844
|
}
|
|
31778
|
-
const featureSelectionLabelRaw = featureSelection && featureSelection.length >= 1 && !isStaticColor ? featureSelection.map((geneName) =>
|
|
30845
|
+
const featureSelectionLabelRaw = featureSelection && featureSelection.length >= 1 && !isStaticColor ? featureSelection.map((geneName) => featureLabelsMap?.get(geneName) || featureLabelsMap?.get(cleanFeatureId(geneName)) || geneName) : null;
|
|
31779
30846
|
let featureSelectionLabelRawStr = "";
|
|
31780
30847
|
if (featureAggregationStrategy === "first") {
|
|
31781
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30848
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.[0];
|
|
31782
30849
|
} else if (featureAggregationStrategy === "last") {
|
|
31783
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30850
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.at(-1);
|
|
31784
30851
|
} else if (typeof featureAggregationStrategy === "number") {
|
|
31785
30852
|
const i = featureAggregationStrategy;
|
|
31786
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30853
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.[i];
|
|
31787
30854
|
} else if (featureAggregationStrategy === "sum") {
|
|
31788
30855
|
if (Array.isArray(featureSelection) && featureSelection.length === 1) {
|
|
31789
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30856
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.[0];
|
|
31790
30857
|
} else {
|
|
31791
30858
|
featureSelectionLabelRawStr = "Sum of features";
|
|
31792
30859
|
}
|
|
31793
30860
|
} else if (featureAggregationStrategy === "mean") {
|
|
31794
30861
|
if (Array.isArray(featureSelection) && featureSelection.length === 1) {
|
|
31795
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30862
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.[0];
|
|
31796
30863
|
} else {
|
|
31797
30864
|
featureSelectionLabelRawStr = "Mean of features";
|
|
31798
30865
|
}
|
|
31799
30866
|
} else {
|
|
31800
|
-
featureSelectionLabelRawStr = featureSelectionLabelRaw
|
|
30867
|
+
featureSelectionLabelRawStr = featureSelectionLabelRaw?.[0];
|
|
31801
30868
|
}
|
|
31802
30869
|
const combinedMissing = combineMissings(missing ?? null, featureAggregationStrategy ?? null);
|
|
31803
30870
|
const featureSelectionLabel = combinedMissing ? `${featureSelectionLabelRawStr} (${Math.round(combinedMissing * 100)}% NaN)` : featureSelectionLabelRawStr;
|
|
@@ -31866,7 +30933,7 @@ function Legend(props) {
|
|
|
31866
30933
|
}, [globalExtent]);
|
|
31867
30934
|
const xlinkHref = featureValueColormap ? getXlinkHref(featureValueColormap) : null;
|
|
31868
30935
|
const currentLocalRange = localRange || [0, 1];
|
|
31869
|
-
return
|
|
30936
|
+
return jsxs("div", { className: clsx$1(classes.legend, {
|
|
31870
30937
|
[classes.legendRelative]: positionRelative,
|
|
31871
30938
|
[classes.legendAbsolute]: !positionRelative,
|
|
31872
30939
|
[classes.legendHighContrast]: highContrast,
|
|
@@ -31875,19 +30942,19 @@ function Legend(props) {
|
|
|
31875
30942
|
}), style: {
|
|
31876
30943
|
...needsScroll ? { maxHeight: `${Math.floor(availHeight)}px`, overflowY: "auto" } : { maxHeight: void 0, overflowY: "visible" },
|
|
31877
30944
|
width: `${width2}px`
|
|
31878
|
-
}, children: [
|
|
30945
|
+
}, children: [jsx$1("svg", { ref: svgRef, style: {
|
|
31879
30946
|
width: `${width2}px`,
|
|
31880
30947
|
height: `${dynamicHeight}px`
|
|
31881
|
-
} }), showInteractiveSlider && xlinkHref &&
|
|
30948
|
+
} }), showInteractiveSlider && xlinkHref && jsxs("div", { className: classes.sliderContainer, children: [currentLocalRange[0] > 0 && jsx$1("div", { className: classes.grayTrack, style: {
|
|
31882
30949
|
left: 0,
|
|
31883
30950
|
width: `${currentLocalRange[0] * 100}%`
|
|
31884
|
-
} }), currentLocalRange[1] < 1 &&
|
|
30951
|
+
} }), currentLocalRange[1] < 1 && jsx$1("div", { className: classes.grayTrack, style: {
|
|
31885
30952
|
left: `${currentLocalRange[1] * 100}%`,
|
|
31886
30953
|
width: `${(1 - currentLocalRange[1]) * 100}%`
|
|
31887
|
-
} }),
|
|
30954
|
+
} }), jsx$1("img", { src: xlinkHref, alt: "Colormap gradient", className: classes.colormapImage, style: {
|
|
31888
30955
|
left: `${currentLocalRange[0] * 100}%`,
|
|
31889
30956
|
width: `${(currentLocalRange[1] - currentLocalRange[0]) * 100}%`
|
|
31890
|
-
} }),
|
|
30957
|
+
} }), jsx$1(Slider, { className: classes.sliderRoot, value: currentLocalRange, onChange: handleSliderChange, min: 0, max: 1, step: 0.01, disableSwap: true, valueLabelDisplay: "auto", valueLabelFormat: formatSliderValue, "aria-label": "Colormap range", getAriaLabel: (index) => index === 0 ? "Colormap minimum" : "Colormap maximum", getAriaValueText: (value) => formatSliderValue(value), slotProps: {
|
|
31891
30958
|
thumb: {
|
|
31892
30959
|
className: classes.sliderThumb
|
|
31893
30960
|
}
|
|
@@ -31924,18 +30991,17 @@ function MultiLegend(props) {
|
|
|
31924
30991
|
const reversedSegmentationLayerScopes = useMemo(() => [...segmentationLayerScopes || []].reverse(), [segmentationLayerScopes]);
|
|
31925
30992
|
const reversedSpotLayerScopes = useMemo(() => [...spotLayerScopes || []].reverse(), [spotLayerScopes]);
|
|
31926
30993
|
const reversedPointLayerScopes = useMemo(() => [...pointLayerScopes || []].reverse(), [pointLayerScopes]);
|
|
31927
|
-
return
|
|
31928
|
-
|
|
31929
|
-
const
|
|
31930
|
-
const layerSetters = (_b = pointLayerCoordination == null ? void 0 : pointLayerCoordination[1]) == null ? void 0 : _b[layerScope];
|
|
30994
|
+
return jsxs("div", { className: classes.multiLegend, children: [pointLayerScopes ? reversedPointLayerScopes.flatMap((layerScope) => {
|
|
30995
|
+
const layerCoordination = pointLayerCoordination?.[0]?.[layerScope];
|
|
30996
|
+
const layerSetters = pointLayerCoordination?.[1]?.[layerScope];
|
|
31931
30997
|
if (!layerCoordination)
|
|
31932
30998
|
return null;
|
|
31933
30999
|
const { spatialLayerVisible, obsColorEncoding, obsType, featureType, featureValueType, featureSelection, featureColor, featureFilterMode, featureValueColormap, featureValueColormapRange, spatialLayerColor, legendVisible } = layerCoordination;
|
|
31934
|
-
const pointIndicesData = pointMultiIndicesData
|
|
31000
|
+
const pointIndicesData = pointMultiIndicesData?.[layerScope];
|
|
31935
31001
|
const { setFeatureValueColormapRange } = layerSetters || {};
|
|
31936
31002
|
const isStaticColor = obsColorEncoding === "spatialLayerColor";
|
|
31937
31003
|
const height2 = isStaticColor ? 20 : 36;
|
|
31938
|
-
return spatialLayerVisible && legendVisible ?
|
|
31004
|
+
return spatialLayerVisible && legendVisible ? jsx$1(Legend, {
|
|
31939
31005
|
maxHeight: maxHeight2,
|
|
31940
31006
|
positionRelative: true,
|
|
31941
31007
|
highContrast: true,
|
|
@@ -31950,7 +31016,7 @@ function MultiLegend(props) {
|
|
|
31950
31016
|
featureSelection,
|
|
31951
31017
|
featureFilterMode,
|
|
31952
31018
|
featureColor,
|
|
31953
|
-
featureIndex: pointIndicesData
|
|
31019
|
+
featureIndex: pointIndicesData?.featureIndex,
|
|
31954
31020
|
isPointsLayer: true,
|
|
31955
31021
|
// featureLabelsMap={featureLabelsMap} // TODO
|
|
31956
31022
|
featureValueColormap: featureValueColormap || "viridis",
|
|
@@ -31960,38 +31026,35 @@ function MultiLegend(props) {
|
|
|
31960
31026
|
height: height2
|
|
31961
31027
|
}, layerScope) : null;
|
|
31962
31028
|
}) : null, spotLayerScopes ? reversedSpotLayerScopes.flatMap((layerScope) => {
|
|
31963
|
-
|
|
31964
|
-
const
|
|
31965
|
-
const layerSetters = (_a = spotLayerCoordination == null ? void 0 : spotLayerCoordination[1]) == null ? void 0 : _a[layerScope];
|
|
31029
|
+
const layerCoordination = spotLayerCoordination?.[0][layerScope];
|
|
31030
|
+
const layerSetters = spotLayerCoordination?.[1]?.[layerScope];
|
|
31966
31031
|
if (!layerCoordination)
|
|
31967
31032
|
return null;
|
|
31968
31033
|
const { spatialLayerVisible, obsColorEncoding, featureValueColormap, featureValueColormapRange, obsType, featureType, featureValueType, featureSelection, featureAggregationStrategy, spatialLayerColor, legendVisible, obsSetSelection, obsSetColor } = layerCoordination;
|
|
31969
31034
|
const { setFeatureValueColormapRange } = layerSetters || {};
|
|
31970
|
-
const expressionExtents = spotMultiExpressionExtents
|
|
31971
|
-
const firstExpressionExtent = expressionExtents
|
|
31035
|
+
const expressionExtents = spotMultiExpressionExtents?.[layerScope];
|
|
31036
|
+
const firstExpressionExtent = expressionExtents?.[0];
|
|
31972
31037
|
const isStaticColor = obsColorEncoding === "spatialLayerColor";
|
|
31973
31038
|
const height2 = isStaticColor ? 20 : 36;
|
|
31974
|
-
const featureLabelsMap =
|
|
31975
|
-
return spatialLayerVisible && legendVisible ?
|
|
31039
|
+
const featureLabelsMap = spotMultiFeatureLabels?.[layerScope]?.featureLabelsMap;
|
|
31040
|
+
return spatialLayerVisible && legendVisible ? jsx$1(Legend, { maxHeight: maxHeight2, positionRelative: true, highContrast: true, showObsLabel: true, visible: spatialLayerVisible, theme, obsType, featureType, featureValueType, obsColorEncoding, spatialLayerColor, featureSelection, featureAggregationStrategy, featureLabelsMap, featureValueColormap, featureValueColormapRange, setFeatureValueColormapRange, extent: firstExpressionExtent, height: height2, obsSetSelection, obsSetColor }, layerScope) : null;
|
|
31976
31041
|
}) : null, segmentationLayerScopes ? reversedSegmentationLayerScopes.flatMap((layerScope) => {
|
|
31977
|
-
|
|
31978
|
-
const
|
|
31979
|
-
const
|
|
31980
|
-
const
|
|
31981
|
-
const channelSetters = (_a = segmentationChannelCoordination == null ? void 0 : segmentationChannelCoordination[1]) == null ? void 0 : _a[layerScope];
|
|
31042
|
+
const layerCoordination = segmentationLayerCoordination?.[0][layerScope];
|
|
31043
|
+
const channelScopes = segmentationChannelScopesByLayer?.[layerScope];
|
|
31044
|
+
const channelCoordination = segmentationChannelCoordination?.[0][layerScope];
|
|
31045
|
+
const channelSetters = segmentationChannelCoordination?.[1]?.[layerScope];
|
|
31982
31046
|
if (!layerCoordination)
|
|
31983
31047
|
return null;
|
|
31984
31048
|
const { spatialLayerVisible } = layerCoordination;
|
|
31985
31049
|
const reversedChannelScopes = [...channelScopes || []].reverse();
|
|
31986
31050
|
return channelCoordination && channelScopes ? reversedChannelScopes.map((cScope) => {
|
|
31987
|
-
var _a2;
|
|
31988
31051
|
const { spatialChannelVisible, spatialChannelColor, obsColorEncoding, featureValueColormap, featureValueColormapRange, obsType, featureType, featureValueType, featureSelection, featureAggregationStrategy, legendVisible, obsSetSelection, obsSetColor } = channelCoordination[cScope];
|
|
31989
|
-
const { setFeatureValueColormapRange } =
|
|
31990
|
-
const expressionExtents =
|
|
31991
|
-
const firstExpressionExtent = expressionExtents
|
|
31052
|
+
const { setFeatureValueColormapRange } = channelSetters?.[cScope] || {};
|
|
31053
|
+
const expressionExtents = segmentationMultiExpressionExtents?.[layerScope]?.[cScope];
|
|
31054
|
+
const firstExpressionExtent = expressionExtents?.[0];
|
|
31992
31055
|
const isStaticColor = obsColorEncoding === "spatialChannelColor";
|
|
31993
31056
|
const height2 = isStaticColor ? 20 : 36;
|
|
31994
|
-
return spatialLayerVisible && spatialChannelVisible && legendVisible ?
|
|
31057
|
+
return spatialLayerVisible && spatialChannelVisible && legendVisible ? jsx$1(Legend, {
|
|
31995
31058
|
maxHeight: maxHeight2,
|
|
31996
31059
|
positionRelative: true,
|
|
31997
31060
|
highContrast: true,
|
|
@@ -34679,7 +33742,7 @@ function NeuroglancerGlobalStyles(props) {
|
|
|
34679
33742
|
}
|
|
34680
33743
|
));
|
|
34681
33744
|
}
|
|
34682
|
-
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-
|
|
33745
|
+
const LazyReactNeuroglancer = React__default.lazy(() => import("./ReactNeuroglancer-Bg6f79hO.js"));
|
|
34683
33746
|
function createWorker() {
|
|
34684
33747
|
return new WorkerFactory();
|
|
34685
33748
|
}
|
|
@@ -34689,8 +33752,6 @@ class NeuroglancerComp extends PureComponent {
|
|
|
34689
33752
|
this.bundleRoot = createWorker();
|
|
34690
33753
|
this.cellColorMapping = props.cellColorMapping;
|
|
34691
33754
|
this.justReceivedExternalUpdate = false;
|
|
34692
|
-
this.prevElement = null;
|
|
34693
|
-
this.prevClickHandler = null;
|
|
34694
33755
|
this.prevMouseStateChanged = null;
|
|
34695
33756
|
this.prevHoverHandler = null;
|
|
34696
33757
|
this.onViewerStateChanged = this.onViewerStateChanged.bind(this);
|
|
@@ -34701,42 +33762,27 @@ class NeuroglancerComp extends PureComponent {
|
|
|
34701
33762
|
onRef(viewerRef) {
|
|
34702
33763
|
if (viewerRef) {
|
|
34703
33764
|
const { viewer } = viewerRef;
|
|
34704
|
-
this.prevElement = viewer.element;
|
|
34705
33765
|
this.prevMouseStateChanged = viewer.mouseState.changed;
|
|
34706
33766
|
viewer.inputEventBindings.sliceView.set("at:dblclick0", () => {
|
|
34707
33767
|
});
|
|
34708
33768
|
viewer.inputEventBindings.perspectiveView.set("at:dblclick0", () => {
|
|
34709
33769
|
});
|
|
34710
|
-
|
|
34711
|
-
|
|
34712
|
-
|
|
34713
|
-
|
|
34714
|
-
const { pickedValue, pickedRenderLayer } = viewer.mouseState;
|
|
34715
|
-
if (pickedValue && pickedValue.low !== void 0 && pickedRenderLayer) {
|
|
34716
|
-
(_a = this.latestOnSegmentClick) == null ? void 0 : _a.call(this, pickedValue.low);
|
|
34717
|
-
}
|
|
34718
|
-
});
|
|
34719
|
-
}
|
|
34720
|
-
};
|
|
33770
|
+
viewer.inputEventBindings.sliceView.set("at:space", () => {
|
|
33771
|
+
});
|
|
33772
|
+
viewer.inputEventBindings.perspectiveView.set("at:space", () => {
|
|
33773
|
+
});
|
|
34721
33774
|
this.prevHoverHandler = () => {
|
|
34722
|
-
var _a;
|
|
34723
33775
|
if (viewer.mouseState.pickedValue !== void 0) {
|
|
34724
33776
|
const pickedSegment = viewer.mouseState.pickedValue;
|
|
34725
|
-
|
|
33777
|
+
this.latestOnSelectHoveredCoords?.(pickedSegment?.low);
|
|
34726
33778
|
}
|
|
34727
33779
|
};
|
|
34728
|
-
viewer.element.addEventListener("mouseup", this.prevClickHandler);
|
|
34729
33780
|
viewer.mouseState.changed.add(this.prevHoverHandler);
|
|
34730
33781
|
} else {
|
|
34731
|
-
if (this.prevElement && this.prevClickHandler) {
|
|
34732
|
-
this.prevElement.removeEventListener("mouseup", this.prevClickHandler);
|
|
34733
|
-
this.prevClickHandler = null;
|
|
34734
|
-
}
|
|
34735
33782
|
if (this.prevMouseStateChanged && this.prevHoverHandler) {
|
|
34736
33783
|
this.prevMouseStateChanged.remove(this.prevHoverHandler);
|
|
34737
33784
|
this.prevHoverHandler = null;
|
|
34738
33785
|
}
|
|
34739
|
-
this.prevElement = null;
|
|
34740
33786
|
this.prevMouseStateChanged = null;
|
|
34741
33787
|
}
|
|
34742
33788
|
}
|
|
@@ -34745,10 +33791,7 @@ class NeuroglancerComp extends PureComponent {
|
|
|
34745
33791
|
setViewerState(nextState);
|
|
34746
33792
|
}
|
|
34747
33793
|
componentDidUpdate(prevProps) {
|
|
34748
|
-
const {
|
|
34749
|
-
if (prevProps.onSegmentClick !== onSegmentClick) {
|
|
34750
|
-
this.latestOnSegmentClick = onSegmentClick;
|
|
34751
|
-
}
|
|
33794
|
+
const { onSelectHoveredCoords } = this.props;
|
|
34752
33795
|
if (prevProps.onSelectHoveredCoords !== onSelectHoveredCoords) {
|
|
34753
33796
|
this.latestOnSelectHoveredCoords = onSelectHoveredCoords;
|
|
34754
33797
|
}
|
|
@@ -34779,30 +33822,17 @@ function useMemoCustomComparison(factory, dependencies, customIsEqual) {
|
|
|
34779
33822
|
return ref.current.value;
|
|
34780
33823
|
}
|
|
34781
33824
|
const shallowDiff = (prevDeps, nextDeps, depName) => prevDeps[depName] !== nextDeps[depName];
|
|
34782
|
-
const shallowDiffByLayer = (prevDeps, nextDeps, depName, scopeName) =>
|
|
34783
|
-
var _a, _b;
|
|
34784
|
-
return ((_a = prevDeps == null ? void 0 : prevDeps[depName]) == null ? void 0 : _a[scopeName]) !== ((_b = nextDeps == null ? void 0 : nextDeps[depName]) == null ? void 0 : _b[scopeName]);
|
|
34785
|
-
};
|
|
33825
|
+
const shallowDiffByLayer = (prevDeps, nextDeps, depName, scopeName) => prevDeps?.[depName]?.[scopeName] !== nextDeps?.[depName]?.[scopeName];
|
|
34786
33826
|
const shallowDiffByChannelWithKeys = (prevDeps, nextDeps, depName, firstName, secondName, keys2) => keys2.some(
|
|
34787
|
-
(k) =>
|
|
34788
|
-
var _a, _b, _c, _d, _e, _f;
|
|
34789
|
-
return ((_c = (_b = (_a = prevDeps == null ? void 0 : prevDeps[depName]) == null ? void 0 : _a[firstName]) == null ? void 0 : _b[secondName]) == null ? void 0 : _c[k]) !== ((_f = (_e = (_d = nextDeps == null ? void 0 : nextDeps[depName]) == null ? void 0 : _d[firstName]) == null ? void 0 : _e[secondName]) == null ? void 0 : _f[k]);
|
|
34790
|
-
}
|
|
33827
|
+
(k) => prevDeps?.[depName]?.[firstName]?.[secondName]?.[k] !== nextDeps?.[depName]?.[firstName]?.[secondName]?.[k]
|
|
34791
33828
|
);
|
|
34792
33829
|
const shallowDiffByLayerCoordinationWithKeys = (prevDeps, nextDeps, depName, layerScope, keys2) => keys2.some(
|
|
34793
|
-
(k) =>
|
|
34794
|
-
var _a, _b, _c, _d, _e, _f;
|
|
34795
|
-
return ((_c = (_b = (_a = prevDeps == null ? void 0 : prevDeps[depName]) == null ? void 0 : _a[0]) == null ? void 0 : _b[layerScope]) == null ? void 0 : _c[k]) !== ((_f = (_e = (_d = nextDeps == null ? void 0 : nextDeps[depName]) == null ? void 0 : _d[0]) == null ? void 0 : _e[layerScope]) == null ? void 0 : _f[k]);
|
|
34796
|
-
}
|
|
33830
|
+
(k) => prevDeps?.[depName]?.[0]?.[layerScope]?.[k] !== nextDeps?.[depName]?.[0]?.[layerScope]?.[k]
|
|
34797
33831
|
);
|
|
34798
33832
|
const shallowDiffByChannelCoordinationWithKeys = (prevDeps, nextDeps, depName, layerScope, channelScope, keys2) => keys2.some(
|
|
34799
|
-
(k) =>
|
|
34800
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34801
|
-
return ((_d = (_c = (_b = (_a = prevDeps == null ? void 0 : prevDeps[depName]) == null ? void 0 : _a[0]) == null ? void 0 : _b[layerScope]) == null ? void 0 : _c[channelScope]) == null ? void 0 : _d[k]) !== ((_h = (_g = (_f = (_e = nextDeps == null ? void 0 : nextDeps[depName]) == null ? void 0 : _e[0]) == null ? void 0 : _f[layerScope]) == null ? void 0 : _g[channelScope]) == null ? void 0 : _h[k]);
|
|
34802
|
-
}
|
|
33833
|
+
(k) => prevDeps?.[depName]?.[0]?.[layerScope]?.[channelScope]?.[k] !== nextDeps?.[depName]?.[0]?.[layerScope]?.[channelScope]?.[k]
|
|
34803
33834
|
);
|
|
34804
33835
|
function customIsEqualForCellColors(prevDeps, nextDeps) {
|
|
34805
|
-
var _a;
|
|
34806
33836
|
let forceUpdate = false;
|
|
34807
33837
|
const curriedShallowDiff = (depName) => shallowDiff(prevDeps, nextDeps, depName);
|
|
34808
33838
|
const curriedShallowDiffByChannelWithKeys = (depName, firstName, secondName, keys2) => shallowDiffByChannelWithKeys(prevDeps, nextDeps, depName, firstName, secondName, keys2);
|
|
@@ -34813,9 +33843,8 @@ function customIsEqualForCellColors(prevDeps, nextDeps) {
|
|
|
34813
33843
|
if (["segmentationLayerScopes", "segmentationChannelScopesByLayer"].some(curriedShallowDiff)) {
|
|
34814
33844
|
forceUpdate = true;
|
|
34815
33845
|
} else {
|
|
34816
|
-
|
|
34817
|
-
|
|
34818
|
-
(_b = (_a2 = nextDeps.segmentationChannelScopesByLayer) == null ? void 0 : _a2[layerScope]) == null ? void 0 : _b.forEach((channelScope) => {
|
|
33846
|
+
nextDeps.segmentationLayerScopes?.forEach((layerScope) => {
|
|
33847
|
+
nextDeps.segmentationChannelScopesByLayer?.[layerScope]?.forEach((channelScope) => {
|
|
34819
33848
|
if (curriedShallowDiffByChannelWithKeys("obsSegmentationsSetsData", layerScope, channelScope, [
|
|
34820
33849
|
"obsSets",
|
|
34821
33850
|
"obsIndex"
|
|
@@ -34833,7 +33862,6 @@ function customIsEqualForCellColors(prevDeps, nextDeps) {
|
|
|
34833
33862
|
return !forceUpdate;
|
|
34834
33863
|
}
|
|
34835
33864
|
function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
34836
|
-
var _a, _b;
|
|
34837
33865
|
let forceUpdate = false;
|
|
34838
33866
|
const curriedShallowDiff = (depName) => shallowDiff(prevDeps, nextDeps, depName);
|
|
34839
33867
|
const curriedShallowDiffByLayer = (depName, scopeName) => shallowDiffByLayer(prevDeps, nextDeps, depName, scopeName);
|
|
@@ -34842,14 +33870,13 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
34842
33870
|
if (["segmentationLayerScopes", "segmentationChannelScopesByLayer"].some(curriedShallowDiff)) {
|
|
34843
33871
|
forceUpdate = true;
|
|
34844
33872
|
} else {
|
|
34845
|
-
|
|
34846
|
-
var _a2, _b2;
|
|
33873
|
+
nextDeps.segmentationLayerScopes?.forEach((layerScope) => {
|
|
34847
33874
|
if (curriedShallowDiffByLayer("obsSegmentationsData", layerScope) || curriedShallowDiffByLayerCoordinationWithKeys("segmentationLayerCoordination", layerScope, [
|
|
34848
33875
|
"spatialLayerVisible"
|
|
34849
33876
|
])) {
|
|
34850
33877
|
forceUpdate = true;
|
|
34851
33878
|
}
|
|
34852
|
-
|
|
33879
|
+
nextDeps.segmentationChannelScopesByLayer?.[layerScope]?.forEach((channelScope) => {
|
|
34853
33880
|
if (curriedShallowDiffByChannelCoordinationWithKeys("segmentationChannelCoordination", layerScope, channelScope, [
|
|
34854
33881
|
"spatialChannelVisible"
|
|
34855
33882
|
])) {
|
|
@@ -34861,8 +33888,7 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
34861
33888
|
if (curriedShallowDiff("pointLayerScopes")) {
|
|
34862
33889
|
forceUpdate = true;
|
|
34863
33890
|
} else {
|
|
34864
|
-
|
|
34865
|
-
var _a2, _b2, _c, _d, _e, _f;
|
|
33891
|
+
nextDeps.pointLayerScopes?.forEach((layerScope) => {
|
|
34866
33892
|
if (curriedShallowDiffByLayer("obsPointsData", layerScope) || curriedShallowDiffByLayer("pointMultiIndicesData", layerScope) || curriedShallowDiffByLayerCoordinationWithKeys("pointLayerCoordination", layerScope, [
|
|
34867
33893
|
"spatialLayerVisible",
|
|
34868
33894
|
"obsColorEncoding",
|
|
@@ -34870,7 +33896,7 @@ function customIsEqualForInitialViewerState(prevDeps, nextDeps) {
|
|
|
34870
33896
|
"featureSelection",
|
|
34871
33897
|
"featureFilterMode",
|
|
34872
33898
|
"featureColor"
|
|
34873
|
-
]) || Math.abs(
|
|
33899
|
+
]) || Math.abs(prevDeps?.pointLayerCoordination?.[0]?.[layerScope]?.spatialLayerOpacity - nextDeps?.pointLayerCoordination?.[0]?.[layerScope]?.spatialLayerOpacity) >= 0.05) {
|
|
34874
33900
|
forceUpdate = true;
|
|
34875
33901
|
}
|
|
34876
33902
|
});
|
|
@@ -35168,9 +34194,8 @@ function getPointsShader(layerCoordination) {
|
|
|
35168
34194
|
featureIndices = featureSelection.map((name) => featureIndex.indexOf(name)).filter((i) => i >= 0);
|
|
35169
34195
|
}
|
|
35170
34196
|
const hasResolvedIndices = featureIndices.length > 0;
|
|
35171
|
-
const resolvedFeatureColors = hasResolvedIndices ? featureSelection.filter((name) =>
|
|
35172
|
-
|
|
35173
|
-
const match2 = Array.isArray(featureColor) ? (_a = featureColor.find((fc) => fc.name === name)) == null ? void 0 : _a.color : null;
|
|
34197
|
+
const resolvedFeatureColors = hasResolvedIndices ? featureSelection.filter((name) => featureIndex?.indexOf(name) >= 0).map((name) => {
|
|
34198
|
+
const match2 = Array.isArray(featureColor) ? featureColor.find((fc) => fc.name === name)?.color : null;
|
|
35174
34199
|
return match2 || staticColor;
|
|
35175
34200
|
}) : [];
|
|
35176
34201
|
if (obsColorEncoding === "spatialLayerColor") {
|
|
@@ -35296,18 +34321,16 @@ function useNeuroglancerViewerState(theme, segmentationLayerScopes, segmentation
|
|
|
35296
34321
|
const viewerState = useMemoCustomComparison(() => {
|
|
35297
34322
|
let result = cloneDeep(DEFAULT_NG_PROPS);
|
|
35298
34323
|
segmentationLayerScopes.forEach((layerScope) => {
|
|
35299
|
-
var _a, _b;
|
|
35300
34324
|
const layerCoordination = segmentationLayerCoordination[0][layerScope];
|
|
35301
34325
|
const channelScopes = segmentationChannelScopesByLayer[layerScope] || [];
|
|
35302
34326
|
const layerData = obsSegmentationsData[layerScope];
|
|
35303
|
-
const layerUrl =
|
|
34327
|
+
const layerUrl = obsSegmentationsUrls[layerScope]?.[0]?.url;
|
|
35304
34328
|
if (layerUrl && layerData) {
|
|
35305
34329
|
const {
|
|
35306
34330
|
spatialLayerVisible
|
|
35307
34331
|
} = layerCoordination || {};
|
|
35308
34332
|
channelScopes.forEach((channelScope) => {
|
|
35309
|
-
|
|
35310
|
-
const channelCoordination = (_b2 = (_a2 = segmentationChannelCoordination[0]) == null ? void 0 : _a2[layerScope]) == null ? void 0 : _b2[channelScope];
|
|
34333
|
+
const channelCoordination = segmentationChannelCoordination[0]?.[layerScope]?.[channelScope];
|
|
35311
34334
|
const {
|
|
35312
34335
|
spatialChannelVisible
|
|
35313
34336
|
} = channelCoordination || {};
|
|
@@ -35333,11 +34356,10 @@ function useNeuroglancerViewerState(theme, segmentationLayerScopes, segmentation
|
|
|
35333
34356
|
}
|
|
35334
34357
|
});
|
|
35335
34358
|
pointLayerScopes.forEach((layerScope) => {
|
|
35336
|
-
var _a, _b, _c, _d, _e, _f;
|
|
35337
34359
|
const layerCoordination = pointLayerCoordination[0][layerScope];
|
|
35338
34360
|
const layerData = obsPointsData[layerScope];
|
|
35339
|
-
const layerUrl =
|
|
35340
|
-
const featureIndex =
|
|
34361
|
+
const layerUrl = obsPointsUrls[layerScope]?.[0]?.url;
|
|
34362
|
+
const featureIndex = pointMultiIndicesData[layerScope]?.featureIndex;
|
|
35341
34363
|
if (layerUrl && layerData) {
|
|
35342
34364
|
const {
|
|
35343
34365
|
spatialLayerVisible,
|
|
@@ -35357,8 +34379,8 @@ function useNeuroglancerViewerState(theme, segmentationLayerScopes, segmentation
|
|
|
35357
34379
|
featureSelection,
|
|
35358
34380
|
featureFilterMode,
|
|
35359
34381
|
featureColor,
|
|
35360
|
-
featureIndexProp:
|
|
35361
|
-
pointIndexProp:
|
|
34382
|
+
featureIndexProp: layerData.neuroglancerOptions?.featureIndexProp,
|
|
34383
|
+
pointIndexProp: layerData.neuroglancerOptions?.pointIndexProp
|
|
35362
34384
|
});
|
|
35363
34385
|
result = {
|
|
35364
34386
|
...result,
|
|
@@ -35379,7 +34401,7 @@ function useNeuroglancerViewerState(theme, segmentationLayerScopes, segmentation
|
|
|
35379
34401
|
visible: spatialLayerVisible,
|
|
35380
34402
|
// Options from layerData.neuroglancerOptions
|
|
35381
34403
|
// like projectionAnnotationSpacing:
|
|
35382
|
-
projectionAnnotationSpacing:
|
|
34404
|
+
projectionAnnotationSpacing: layerData.neuroglancerOptions?.projectionAnnotationSpacing ?? 1
|
|
35383
34405
|
}
|
|
35384
34406
|
],
|
|
35385
34407
|
// TODO: is this needed?
|
|
@@ -35409,1784 +34431,6 @@ function useNeuroglancerViewerState(theme, segmentationLayerScopes, segmentation
|
|
|
35409
34431
|
}, customIsEqualForInitialViewerState);
|
|
35410
34432
|
return viewerState;
|
|
35411
34433
|
}
|
|
35412
|
-
/**
|
|
35413
|
-
* @license
|
|
35414
|
-
* Copyright 2010-2023 Three.js Authors
|
|
35415
|
-
* SPDX-License-Identifier: MIT
|
|
35416
|
-
*/
|
|
35417
|
-
const REVISION = "154";
|
|
35418
|
-
const WebGLCoordinateSystem = 2e3;
|
|
35419
|
-
const WebGPUCoordinateSystem = 2001;
|
|
35420
|
-
function clamp(value, min, max) {
|
|
35421
|
-
return Math.max(min, Math.min(max, value));
|
|
35422
|
-
}
|
|
35423
|
-
class Quaternion {
|
|
35424
|
-
constructor(x = 0, y = 0, z2 = 0, w = 1) {
|
|
35425
|
-
this.isQuaternion = true;
|
|
35426
|
-
this._x = x;
|
|
35427
|
-
this._y = y;
|
|
35428
|
-
this._z = z2;
|
|
35429
|
-
this._w = w;
|
|
35430
|
-
}
|
|
35431
|
-
static slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {
|
|
35432
|
-
let x0 = src0[srcOffset0 + 0], y0 = src0[srcOffset0 + 1], z0 = src0[srcOffset0 + 2], w0 = src0[srcOffset0 + 3];
|
|
35433
|
-
const x1 = src1[srcOffset1 + 0], y1 = src1[srcOffset1 + 1], z1 = src1[srcOffset1 + 2], w1 = src1[srcOffset1 + 3];
|
|
35434
|
-
if (t === 0) {
|
|
35435
|
-
dst[dstOffset + 0] = x0;
|
|
35436
|
-
dst[dstOffset + 1] = y0;
|
|
35437
|
-
dst[dstOffset + 2] = z0;
|
|
35438
|
-
dst[dstOffset + 3] = w0;
|
|
35439
|
-
return;
|
|
35440
|
-
}
|
|
35441
|
-
if (t === 1) {
|
|
35442
|
-
dst[dstOffset + 0] = x1;
|
|
35443
|
-
dst[dstOffset + 1] = y1;
|
|
35444
|
-
dst[dstOffset + 2] = z1;
|
|
35445
|
-
dst[dstOffset + 3] = w1;
|
|
35446
|
-
return;
|
|
35447
|
-
}
|
|
35448
|
-
if (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {
|
|
35449
|
-
let s = 1 - t;
|
|
35450
|
-
const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1, dir = cos >= 0 ? 1 : -1, sqrSin = 1 - cos * cos;
|
|
35451
|
-
if (sqrSin > Number.EPSILON) {
|
|
35452
|
-
const sin = Math.sqrt(sqrSin), len = Math.atan2(sin, cos * dir);
|
|
35453
|
-
s = Math.sin(s * len) / sin;
|
|
35454
|
-
t = Math.sin(t * len) / sin;
|
|
35455
|
-
}
|
|
35456
|
-
const tDir = t * dir;
|
|
35457
|
-
x0 = x0 * s + x1 * tDir;
|
|
35458
|
-
y0 = y0 * s + y1 * tDir;
|
|
35459
|
-
z0 = z0 * s + z1 * tDir;
|
|
35460
|
-
w0 = w0 * s + w1 * tDir;
|
|
35461
|
-
if (s === 1 - t) {
|
|
35462
|
-
const f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);
|
|
35463
|
-
x0 *= f;
|
|
35464
|
-
y0 *= f;
|
|
35465
|
-
z0 *= f;
|
|
35466
|
-
w0 *= f;
|
|
35467
|
-
}
|
|
35468
|
-
}
|
|
35469
|
-
dst[dstOffset] = x0;
|
|
35470
|
-
dst[dstOffset + 1] = y0;
|
|
35471
|
-
dst[dstOffset + 2] = z0;
|
|
35472
|
-
dst[dstOffset + 3] = w0;
|
|
35473
|
-
}
|
|
35474
|
-
static multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {
|
|
35475
|
-
const x0 = src0[srcOffset0];
|
|
35476
|
-
const y0 = src0[srcOffset0 + 1];
|
|
35477
|
-
const z0 = src0[srcOffset0 + 2];
|
|
35478
|
-
const w0 = src0[srcOffset0 + 3];
|
|
35479
|
-
const x1 = src1[srcOffset1];
|
|
35480
|
-
const y1 = src1[srcOffset1 + 1];
|
|
35481
|
-
const z1 = src1[srcOffset1 + 2];
|
|
35482
|
-
const w1 = src1[srcOffset1 + 3];
|
|
35483
|
-
dst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;
|
|
35484
|
-
dst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;
|
|
35485
|
-
dst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;
|
|
35486
|
-
dst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;
|
|
35487
|
-
return dst;
|
|
35488
|
-
}
|
|
35489
|
-
get x() {
|
|
35490
|
-
return this._x;
|
|
35491
|
-
}
|
|
35492
|
-
set x(value) {
|
|
35493
|
-
this._x = value;
|
|
35494
|
-
this._onChangeCallback();
|
|
35495
|
-
}
|
|
35496
|
-
get y() {
|
|
35497
|
-
return this._y;
|
|
35498
|
-
}
|
|
35499
|
-
set y(value) {
|
|
35500
|
-
this._y = value;
|
|
35501
|
-
this._onChangeCallback();
|
|
35502
|
-
}
|
|
35503
|
-
get z() {
|
|
35504
|
-
return this._z;
|
|
35505
|
-
}
|
|
35506
|
-
set z(value) {
|
|
35507
|
-
this._z = value;
|
|
35508
|
-
this._onChangeCallback();
|
|
35509
|
-
}
|
|
35510
|
-
get w() {
|
|
35511
|
-
return this._w;
|
|
35512
|
-
}
|
|
35513
|
-
set w(value) {
|
|
35514
|
-
this._w = value;
|
|
35515
|
-
this._onChangeCallback();
|
|
35516
|
-
}
|
|
35517
|
-
set(x, y, z2, w) {
|
|
35518
|
-
this._x = x;
|
|
35519
|
-
this._y = y;
|
|
35520
|
-
this._z = z2;
|
|
35521
|
-
this._w = w;
|
|
35522
|
-
this._onChangeCallback();
|
|
35523
|
-
return this;
|
|
35524
|
-
}
|
|
35525
|
-
clone() {
|
|
35526
|
-
return new this.constructor(this._x, this._y, this._z, this._w);
|
|
35527
|
-
}
|
|
35528
|
-
copy(quaternion) {
|
|
35529
|
-
this._x = quaternion.x;
|
|
35530
|
-
this._y = quaternion.y;
|
|
35531
|
-
this._z = quaternion.z;
|
|
35532
|
-
this._w = quaternion.w;
|
|
35533
|
-
this._onChangeCallback();
|
|
35534
|
-
return this;
|
|
35535
|
-
}
|
|
35536
|
-
setFromEuler(euler, update2) {
|
|
35537
|
-
const x = euler._x, y = euler._y, z2 = euler._z, order = euler._order;
|
|
35538
|
-
const cos = Math.cos;
|
|
35539
|
-
const sin = Math.sin;
|
|
35540
|
-
const c1 = cos(x / 2);
|
|
35541
|
-
const c2 = cos(y / 2);
|
|
35542
|
-
const c3 = cos(z2 / 2);
|
|
35543
|
-
const s1 = sin(x / 2);
|
|
35544
|
-
const s2 = sin(y / 2);
|
|
35545
|
-
const s3 = sin(z2 / 2);
|
|
35546
|
-
switch (order) {
|
|
35547
|
-
case "XYZ":
|
|
35548
|
-
this._x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
35549
|
-
this._y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
35550
|
-
this._z = c1 * c2 * s3 + s1 * s2 * c3;
|
|
35551
|
-
this._w = c1 * c2 * c3 - s1 * s2 * s3;
|
|
35552
|
-
break;
|
|
35553
|
-
case "YXZ":
|
|
35554
|
-
this._x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
35555
|
-
this._y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
35556
|
-
this._z = c1 * c2 * s3 - s1 * s2 * c3;
|
|
35557
|
-
this._w = c1 * c2 * c3 + s1 * s2 * s3;
|
|
35558
|
-
break;
|
|
35559
|
-
case "ZXY":
|
|
35560
|
-
this._x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
35561
|
-
this._y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
35562
|
-
this._z = c1 * c2 * s3 + s1 * s2 * c3;
|
|
35563
|
-
this._w = c1 * c2 * c3 - s1 * s2 * s3;
|
|
35564
|
-
break;
|
|
35565
|
-
case "ZYX":
|
|
35566
|
-
this._x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
35567
|
-
this._y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
35568
|
-
this._z = c1 * c2 * s3 - s1 * s2 * c3;
|
|
35569
|
-
this._w = c1 * c2 * c3 + s1 * s2 * s3;
|
|
35570
|
-
break;
|
|
35571
|
-
case "YZX":
|
|
35572
|
-
this._x = s1 * c2 * c3 + c1 * s2 * s3;
|
|
35573
|
-
this._y = c1 * s2 * c3 + s1 * c2 * s3;
|
|
35574
|
-
this._z = c1 * c2 * s3 - s1 * s2 * c3;
|
|
35575
|
-
this._w = c1 * c2 * c3 - s1 * s2 * s3;
|
|
35576
|
-
break;
|
|
35577
|
-
case "XZY":
|
|
35578
|
-
this._x = s1 * c2 * c3 - c1 * s2 * s3;
|
|
35579
|
-
this._y = c1 * s2 * c3 - s1 * c2 * s3;
|
|
35580
|
-
this._z = c1 * c2 * s3 + s1 * s2 * c3;
|
|
35581
|
-
this._w = c1 * c2 * c3 + s1 * s2 * s3;
|
|
35582
|
-
break;
|
|
35583
|
-
default:
|
|
35584
|
-
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + order);
|
|
35585
|
-
}
|
|
35586
|
-
if (update2 !== false) this._onChangeCallback();
|
|
35587
|
-
return this;
|
|
35588
|
-
}
|
|
35589
|
-
setFromAxisAngle(axis2, angle) {
|
|
35590
|
-
const halfAngle = angle / 2, s = Math.sin(halfAngle);
|
|
35591
|
-
this._x = axis2.x * s;
|
|
35592
|
-
this._y = axis2.y * s;
|
|
35593
|
-
this._z = axis2.z * s;
|
|
35594
|
-
this._w = Math.cos(halfAngle);
|
|
35595
|
-
this._onChangeCallback();
|
|
35596
|
-
return this;
|
|
35597
|
-
}
|
|
35598
|
-
setFromRotationMatrix(m) {
|
|
35599
|
-
const te = m.elements, m11 = te[0], m12 = te[4], m13 = te[8], m21 = te[1], m22 = te[5], m23 = te[9], m31 = te[2], m32 = te[6], m33 = te[10], trace = m11 + m22 + m33;
|
|
35600
|
-
if (trace > 0) {
|
|
35601
|
-
const s = 0.5 / Math.sqrt(trace + 1);
|
|
35602
|
-
this._w = 0.25 / s;
|
|
35603
|
-
this._x = (m32 - m23) * s;
|
|
35604
|
-
this._y = (m13 - m31) * s;
|
|
35605
|
-
this._z = (m21 - m12) * s;
|
|
35606
|
-
} else if (m11 > m22 && m11 > m33) {
|
|
35607
|
-
const s = 2 * Math.sqrt(1 + m11 - m22 - m33);
|
|
35608
|
-
this._w = (m32 - m23) / s;
|
|
35609
|
-
this._x = 0.25 * s;
|
|
35610
|
-
this._y = (m12 + m21) / s;
|
|
35611
|
-
this._z = (m13 + m31) / s;
|
|
35612
|
-
} else if (m22 > m33) {
|
|
35613
|
-
const s = 2 * Math.sqrt(1 + m22 - m11 - m33);
|
|
35614
|
-
this._w = (m13 - m31) / s;
|
|
35615
|
-
this._x = (m12 + m21) / s;
|
|
35616
|
-
this._y = 0.25 * s;
|
|
35617
|
-
this._z = (m23 + m32) / s;
|
|
35618
|
-
} else {
|
|
35619
|
-
const s = 2 * Math.sqrt(1 + m33 - m11 - m22);
|
|
35620
|
-
this._w = (m21 - m12) / s;
|
|
35621
|
-
this._x = (m13 + m31) / s;
|
|
35622
|
-
this._y = (m23 + m32) / s;
|
|
35623
|
-
this._z = 0.25 * s;
|
|
35624
|
-
}
|
|
35625
|
-
this._onChangeCallback();
|
|
35626
|
-
return this;
|
|
35627
|
-
}
|
|
35628
|
-
setFromUnitVectors(vFrom, vTo) {
|
|
35629
|
-
let r2 = vFrom.dot(vTo) + 1;
|
|
35630
|
-
if (r2 < Number.EPSILON) {
|
|
35631
|
-
r2 = 0;
|
|
35632
|
-
if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {
|
|
35633
|
-
this._x = -vFrom.y;
|
|
35634
|
-
this._y = vFrom.x;
|
|
35635
|
-
this._z = 0;
|
|
35636
|
-
this._w = r2;
|
|
35637
|
-
} else {
|
|
35638
|
-
this._x = 0;
|
|
35639
|
-
this._y = -vFrom.z;
|
|
35640
|
-
this._z = vFrom.y;
|
|
35641
|
-
this._w = r2;
|
|
35642
|
-
}
|
|
35643
|
-
} else {
|
|
35644
|
-
this._x = vFrom.y * vTo.z - vFrom.z * vTo.y;
|
|
35645
|
-
this._y = vFrom.z * vTo.x - vFrom.x * vTo.z;
|
|
35646
|
-
this._z = vFrom.x * vTo.y - vFrom.y * vTo.x;
|
|
35647
|
-
this._w = r2;
|
|
35648
|
-
}
|
|
35649
|
-
return this.normalize();
|
|
35650
|
-
}
|
|
35651
|
-
angleTo(q) {
|
|
35652
|
-
return 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));
|
|
35653
|
-
}
|
|
35654
|
-
rotateTowards(q, step) {
|
|
35655
|
-
const angle = this.angleTo(q);
|
|
35656
|
-
if (angle === 0) return this;
|
|
35657
|
-
const t = Math.min(1, step / angle);
|
|
35658
|
-
this.slerp(q, t);
|
|
35659
|
-
return this;
|
|
35660
|
-
}
|
|
35661
|
-
identity() {
|
|
35662
|
-
return this.set(0, 0, 0, 1);
|
|
35663
|
-
}
|
|
35664
|
-
invert() {
|
|
35665
|
-
return this.conjugate();
|
|
35666
|
-
}
|
|
35667
|
-
conjugate() {
|
|
35668
|
-
this._x *= -1;
|
|
35669
|
-
this._y *= -1;
|
|
35670
|
-
this._z *= -1;
|
|
35671
|
-
this._onChangeCallback();
|
|
35672
|
-
return this;
|
|
35673
|
-
}
|
|
35674
|
-
dot(v) {
|
|
35675
|
-
return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;
|
|
35676
|
-
}
|
|
35677
|
-
lengthSq() {
|
|
35678
|
-
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
|
|
35679
|
-
}
|
|
35680
|
-
length() {
|
|
35681
|
-
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
|
|
35682
|
-
}
|
|
35683
|
-
normalize() {
|
|
35684
|
-
let l = this.length();
|
|
35685
|
-
if (l === 0) {
|
|
35686
|
-
this._x = 0;
|
|
35687
|
-
this._y = 0;
|
|
35688
|
-
this._z = 0;
|
|
35689
|
-
this._w = 1;
|
|
35690
|
-
} else {
|
|
35691
|
-
l = 1 / l;
|
|
35692
|
-
this._x = this._x * l;
|
|
35693
|
-
this._y = this._y * l;
|
|
35694
|
-
this._z = this._z * l;
|
|
35695
|
-
this._w = this._w * l;
|
|
35696
|
-
}
|
|
35697
|
-
this._onChangeCallback();
|
|
35698
|
-
return this;
|
|
35699
|
-
}
|
|
35700
|
-
multiply(q) {
|
|
35701
|
-
return this.multiplyQuaternions(this, q);
|
|
35702
|
-
}
|
|
35703
|
-
premultiply(q) {
|
|
35704
|
-
return this.multiplyQuaternions(q, this);
|
|
35705
|
-
}
|
|
35706
|
-
multiplyQuaternions(a, b) {
|
|
35707
|
-
const qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;
|
|
35708
|
-
const qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;
|
|
35709
|
-
this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
|
|
35710
|
-
this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
|
|
35711
|
-
this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
|
|
35712
|
-
this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
|
|
35713
|
-
this._onChangeCallback();
|
|
35714
|
-
return this;
|
|
35715
|
-
}
|
|
35716
|
-
slerp(qb, t) {
|
|
35717
|
-
if (t === 0) return this;
|
|
35718
|
-
if (t === 1) return this.copy(qb);
|
|
35719
|
-
const x = this._x, y = this._y, z2 = this._z, w = this._w;
|
|
35720
|
-
let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z2 * qb._z;
|
|
35721
|
-
if (cosHalfTheta < 0) {
|
|
35722
|
-
this._w = -qb._w;
|
|
35723
|
-
this._x = -qb._x;
|
|
35724
|
-
this._y = -qb._y;
|
|
35725
|
-
this._z = -qb._z;
|
|
35726
|
-
cosHalfTheta = -cosHalfTheta;
|
|
35727
|
-
} else {
|
|
35728
|
-
this.copy(qb);
|
|
35729
|
-
}
|
|
35730
|
-
if (cosHalfTheta >= 1) {
|
|
35731
|
-
this._w = w;
|
|
35732
|
-
this._x = x;
|
|
35733
|
-
this._y = y;
|
|
35734
|
-
this._z = z2;
|
|
35735
|
-
return this;
|
|
35736
|
-
}
|
|
35737
|
-
const sqrSinHalfTheta = 1 - cosHalfTheta * cosHalfTheta;
|
|
35738
|
-
if (sqrSinHalfTheta <= Number.EPSILON) {
|
|
35739
|
-
const s = 1 - t;
|
|
35740
|
-
this._w = s * w + t * this._w;
|
|
35741
|
-
this._x = s * x + t * this._x;
|
|
35742
|
-
this._y = s * y + t * this._y;
|
|
35743
|
-
this._z = s * z2 + t * this._z;
|
|
35744
|
-
this.normalize();
|
|
35745
|
-
this._onChangeCallback();
|
|
35746
|
-
return this;
|
|
35747
|
-
}
|
|
35748
|
-
const sinHalfTheta = Math.sqrt(sqrSinHalfTheta);
|
|
35749
|
-
const halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);
|
|
35750
|
-
const ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta, ratioB = Math.sin(t * halfTheta) / sinHalfTheta;
|
|
35751
|
-
this._w = w * ratioA + this._w * ratioB;
|
|
35752
|
-
this._x = x * ratioA + this._x * ratioB;
|
|
35753
|
-
this._y = y * ratioA + this._y * ratioB;
|
|
35754
|
-
this._z = z2 * ratioA + this._z * ratioB;
|
|
35755
|
-
this._onChangeCallback();
|
|
35756
|
-
return this;
|
|
35757
|
-
}
|
|
35758
|
-
slerpQuaternions(qa, qb, t) {
|
|
35759
|
-
return this.copy(qa).slerp(qb, t);
|
|
35760
|
-
}
|
|
35761
|
-
random() {
|
|
35762
|
-
const u1 = Math.random();
|
|
35763
|
-
const sqrt1u1 = Math.sqrt(1 - u1);
|
|
35764
|
-
const sqrtu1 = Math.sqrt(u1);
|
|
35765
|
-
const u2 = 2 * Math.PI * Math.random();
|
|
35766
|
-
const u3 = 2 * Math.PI * Math.random();
|
|
35767
|
-
return this.set(
|
|
35768
|
-
sqrt1u1 * Math.cos(u2),
|
|
35769
|
-
sqrtu1 * Math.sin(u3),
|
|
35770
|
-
sqrtu1 * Math.cos(u3),
|
|
35771
|
-
sqrt1u1 * Math.sin(u2)
|
|
35772
|
-
);
|
|
35773
|
-
}
|
|
35774
|
-
equals(quaternion) {
|
|
35775
|
-
return quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;
|
|
35776
|
-
}
|
|
35777
|
-
fromArray(array2, offset2 = 0) {
|
|
35778
|
-
this._x = array2[offset2];
|
|
35779
|
-
this._y = array2[offset2 + 1];
|
|
35780
|
-
this._z = array2[offset2 + 2];
|
|
35781
|
-
this._w = array2[offset2 + 3];
|
|
35782
|
-
this._onChangeCallback();
|
|
35783
|
-
return this;
|
|
35784
|
-
}
|
|
35785
|
-
toArray(array2 = [], offset2 = 0) {
|
|
35786
|
-
array2[offset2] = this._x;
|
|
35787
|
-
array2[offset2 + 1] = this._y;
|
|
35788
|
-
array2[offset2 + 2] = this._z;
|
|
35789
|
-
array2[offset2 + 3] = this._w;
|
|
35790
|
-
return array2;
|
|
35791
|
-
}
|
|
35792
|
-
fromBufferAttribute(attribute, index) {
|
|
35793
|
-
this._x = attribute.getX(index);
|
|
35794
|
-
this._y = attribute.getY(index);
|
|
35795
|
-
this._z = attribute.getZ(index);
|
|
35796
|
-
this._w = attribute.getW(index);
|
|
35797
|
-
return this;
|
|
35798
|
-
}
|
|
35799
|
-
toJSON() {
|
|
35800
|
-
return this.toArray();
|
|
35801
|
-
}
|
|
35802
|
-
_onChange(callback) {
|
|
35803
|
-
this._onChangeCallback = callback;
|
|
35804
|
-
return this;
|
|
35805
|
-
}
|
|
35806
|
-
_onChangeCallback() {
|
|
35807
|
-
}
|
|
35808
|
-
*[Symbol.iterator]() {
|
|
35809
|
-
yield this._x;
|
|
35810
|
-
yield this._y;
|
|
35811
|
-
yield this._z;
|
|
35812
|
-
yield this._w;
|
|
35813
|
-
}
|
|
35814
|
-
}
|
|
35815
|
-
class Vector3 {
|
|
35816
|
-
constructor(x = 0, y = 0, z2 = 0) {
|
|
35817
|
-
Vector3.prototype.isVector3 = true;
|
|
35818
|
-
this.x = x;
|
|
35819
|
-
this.y = y;
|
|
35820
|
-
this.z = z2;
|
|
35821
|
-
}
|
|
35822
|
-
set(x, y, z2) {
|
|
35823
|
-
if (z2 === void 0) z2 = this.z;
|
|
35824
|
-
this.x = x;
|
|
35825
|
-
this.y = y;
|
|
35826
|
-
this.z = z2;
|
|
35827
|
-
return this;
|
|
35828
|
-
}
|
|
35829
|
-
setScalar(scalar) {
|
|
35830
|
-
this.x = scalar;
|
|
35831
|
-
this.y = scalar;
|
|
35832
|
-
this.z = scalar;
|
|
35833
|
-
return this;
|
|
35834
|
-
}
|
|
35835
|
-
setX(x) {
|
|
35836
|
-
this.x = x;
|
|
35837
|
-
return this;
|
|
35838
|
-
}
|
|
35839
|
-
setY(y) {
|
|
35840
|
-
this.y = y;
|
|
35841
|
-
return this;
|
|
35842
|
-
}
|
|
35843
|
-
setZ(z2) {
|
|
35844
|
-
this.z = z2;
|
|
35845
|
-
return this;
|
|
35846
|
-
}
|
|
35847
|
-
setComponent(index, value) {
|
|
35848
|
-
switch (index) {
|
|
35849
|
-
case 0:
|
|
35850
|
-
this.x = value;
|
|
35851
|
-
break;
|
|
35852
|
-
case 1:
|
|
35853
|
-
this.y = value;
|
|
35854
|
-
break;
|
|
35855
|
-
case 2:
|
|
35856
|
-
this.z = value;
|
|
35857
|
-
break;
|
|
35858
|
-
default:
|
|
35859
|
-
throw new Error("index is out of range: " + index);
|
|
35860
|
-
}
|
|
35861
|
-
return this;
|
|
35862
|
-
}
|
|
35863
|
-
getComponent(index) {
|
|
35864
|
-
switch (index) {
|
|
35865
|
-
case 0:
|
|
35866
|
-
return this.x;
|
|
35867
|
-
case 1:
|
|
35868
|
-
return this.y;
|
|
35869
|
-
case 2:
|
|
35870
|
-
return this.z;
|
|
35871
|
-
default:
|
|
35872
|
-
throw new Error("index is out of range: " + index);
|
|
35873
|
-
}
|
|
35874
|
-
}
|
|
35875
|
-
clone() {
|
|
35876
|
-
return new this.constructor(this.x, this.y, this.z);
|
|
35877
|
-
}
|
|
35878
|
-
copy(v) {
|
|
35879
|
-
this.x = v.x;
|
|
35880
|
-
this.y = v.y;
|
|
35881
|
-
this.z = v.z;
|
|
35882
|
-
return this;
|
|
35883
|
-
}
|
|
35884
|
-
add(v) {
|
|
35885
|
-
this.x += v.x;
|
|
35886
|
-
this.y += v.y;
|
|
35887
|
-
this.z += v.z;
|
|
35888
|
-
return this;
|
|
35889
|
-
}
|
|
35890
|
-
addScalar(s) {
|
|
35891
|
-
this.x += s;
|
|
35892
|
-
this.y += s;
|
|
35893
|
-
this.z += s;
|
|
35894
|
-
return this;
|
|
35895
|
-
}
|
|
35896
|
-
addVectors(a, b) {
|
|
35897
|
-
this.x = a.x + b.x;
|
|
35898
|
-
this.y = a.y + b.y;
|
|
35899
|
-
this.z = a.z + b.z;
|
|
35900
|
-
return this;
|
|
35901
|
-
}
|
|
35902
|
-
addScaledVector(v, s) {
|
|
35903
|
-
this.x += v.x * s;
|
|
35904
|
-
this.y += v.y * s;
|
|
35905
|
-
this.z += v.z * s;
|
|
35906
|
-
return this;
|
|
35907
|
-
}
|
|
35908
|
-
sub(v) {
|
|
35909
|
-
this.x -= v.x;
|
|
35910
|
-
this.y -= v.y;
|
|
35911
|
-
this.z -= v.z;
|
|
35912
|
-
return this;
|
|
35913
|
-
}
|
|
35914
|
-
subScalar(s) {
|
|
35915
|
-
this.x -= s;
|
|
35916
|
-
this.y -= s;
|
|
35917
|
-
this.z -= s;
|
|
35918
|
-
return this;
|
|
35919
|
-
}
|
|
35920
|
-
subVectors(a, b) {
|
|
35921
|
-
this.x = a.x - b.x;
|
|
35922
|
-
this.y = a.y - b.y;
|
|
35923
|
-
this.z = a.z - b.z;
|
|
35924
|
-
return this;
|
|
35925
|
-
}
|
|
35926
|
-
multiply(v) {
|
|
35927
|
-
this.x *= v.x;
|
|
35928
|
-
this.y *= v.y;
|
|
35929
|
-
this.z *= v.z;
|
|
35930
|
-
return this;
|
|
35931
|
-
}
|
|
35932
|
-
multiplyScalar(scalar) {
|
|
35933
|
-
this.x *= scalar;
|
|
35934
|
-
this.y *= scalar;
|
|
35935
|
-
this.z *= scalar;
|
|
35936
|
-
return this;
|
|
35937
|
-
}
|
|
35938
|
-
multiplyVectors(a, b) {
|
|
35939
|
-
this.x = a.x * b.x;
|
|
35940
|
-
this.y = a.y * b.y;
|
|
35941
|
-
this.z = a.z * b.z;
|
|
35942
|
-
return this;
|
|
35943
|
-
}
|
|
35944
|
-
applyEuler(euler) {
|
|
35945
|
-
return this.applyQuaternion(_quaternion$4.setFromEuler(euler));
|
|
35946
|
-
}
|
|
35947
|
-
applyAxisAngle(axis2, angle) {
|
|
35948
|
-
return this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis2, angle));
|
|
35949
|
-
}
|
|
35950
|
-
applyMatrix3(m) {
|
|
35951
|
-
const x = this.x, y = this.y, z2 = this.z;
|
|
35952
|
-
const e = m.elements;
|
|
35953
|
-
this.x = e[0] * x + e[3] * y + e[6] * z2;
|
|
35954
|
-
this.y = e[1] * x + e[4] * y + e[7] * z2;
|
|
35955
|
-
this.z = e[2] * x + e[5] * y + e[8] * z2;
|
|
35956
|
-
return this;
|
|
35957
|
-
}
|
|
35958
|
-
applyNormalMatrix(m) {
|
|
35959
|
-
return this.applyMatrix3(m).normalize();
|
|
35960
|
-
}
|
|
35961
|
-
applyMatrix4(m) {
|
|
35962
|
-
const x = this.x, y = this.y, z2 = this.z;
|
|
35963
|
-
const e = m.elements;
|
|
35964
|
-
const w = 1 / (e[3] * x + e[7] * y + e[11] * z2 + e[15]);
|
|
35965
|
-
this.x = (e[0] * x + e[4] * y + e[8] * z2 + e[12]) * w;
|
|
35966
|
-
this.y = (e[1] * x + e[5] * y + e[9] * z2 + e[13]) * w;
|
|
35967
|
-
this.z = (e[2] * x + e[6] * y + e[10] * z2 + e[14]) * w;
|
|
35968
|
-
return this;
|
|
35969
|
-
}
|
|
35970
|
-
applyQuaternion(q) {
|
|
35971
|
-
const x = this.x, y = this.y, z2 = this.z;
|
|
35972
|
-
const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
|
|
35973
|
-
const ix = qw * x + qy * z2 - qz * y;
|
|
35974
|
-
const iy = qw * y + qz * x - qx * z2;
|
|
35975
|
-
const iz = qw * z2 + qx * y - qy * x;
|
|
35976
|
-
const iw = -qx * x - qy * y - qz * z2;
|
|
35977
|
-
this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;
|
|
35978
|
-
this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;
|
|
35979
|
-
this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;
|
|
35980
|
-
return this;
|
|
35981
|
-
}
|
|
35982
|
-
project(camera) {
|
|
35983
|
-
return this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);
|
|
35984
|
-
}
|
|
35985
|
-
unproject(camera) {
|
|
35986
|
-
return this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);
|
|
35987
|
-
}
|
|
35988
|
-
transformDirection(m) {
|
|
35989
|
-
const x = this.x, y = this.y, z2 = this.z;
|
|
35990
|
-
const e = m.elements;
|
|
35991
|
-
this.x = e[0] * x + e[4] * y + e[8] * z2;
|
|
35992
|
-
this.y = e[1] * x + e[5] * y + e[9] * z2;
|
|
35993
|
-
this.z = e[2] * x + e[6] * y + e[10] * z2;
|
|
35994
|
-
return this.normalize();
|
|
35995
|
-
}
|
|
35996
|
-
divide(v) {
|
|
35997
|
-
this.x /= v.x;
|
|
35998
|
-
this.y /= v.y;
|
|
35999
|
-
this.z /= v.z;
|
|
36000
|
-
return this;
|
|
36001
|
-
}
|
|
36002
|
-
divideScalar(scalar) {
|
|
36003
|
-
return this.multiplyScalar(1 / scalar);
|
|
36004
|
-
}
|
|
36005
|
-
min(v) {
|
|
36006
|
-
this.x = Math.min(this.x, v.x);
|
|
36007
|
-
this.y = Math.min(this.y, v.y);
|
|
36008
|
-
this.z = Math.min(this.z, v.z);
|
|
36009
|
-
return this;
|
|
36010
|
-
}
|
|
36011
|
-
max(v) {
|
|
36012
|
-
this.x = Math.max(this.x, v.x);
|
|
36013
|
-
this.y = Math.max(this.y, v.y);
|
|
36014
|
-
this.z = Math.max(this.z, v.z);
|
|
36015
|
-
return this;
|
|
36016
|
-
}
|
|
36017
|
-
clamp(min, max) {
|
|
36018
|
-
this.x = Math.max(min.x, Math.min(max.x, this.x));
|
|
36019
|
-
this.y = Math.max(min.y, Math.min(max.y, this.y));
|
|
36020
|
-
this.z = Math.max(min.z, Math.min(max.z, this.z));
|
|
36021
|
-
return this;
|
|
36022
|
-
}
|
|
36023
|
-
clampScalar(minVal, maxVal) {
|
|
36024
|
-
this.x = Math.max(minVal, Math.min(maxVal, this.x));
|
|
36025
|
-
this.y = Math.max(minVal, Math.min(maxVal, this.y));
|
|
36026
|
-
this.z = Math.max(minVal, Math.min(maxVal, this.z));
|
|
36027
|
-
return this;
|
|
36028
|
-
}
|
|
36029
|
-
clampLength(min, max) {
|
|
36030
|
-
const length2 = this.length();
|
|
36031
|
-
return this.divideScalar(length2 || 1).multiplyScalar(Math.max(min, Math.min(max, length2)));
|
|
36032
|
-
}
|
|
36033
|
-
floor() {
|
|
36034
|
-
this.x = Math.floor(this.x);
|
|
36035
|
-
this.y = Math.floor(this.y);
|
|
36036
|
-
this.z = Math.floor(this.z);
|
|
36037
|
-
return this;
|
|
36038
|
-
}
|
|
36039
|
-
ceil() {
|
|
36040
|
-
this.x = Math.ceil(this.x);
|
|
36041
|
-
this.y = Math.ceil(this.y);
|
|
36042
|
-
this.z = Math.ceil(this.z);
|
|
36043
|
-
return this;
|
|
36044
|
-
}
|
|
36045
|
-
round() {
|
|
36046
|
-
this.x = Math.round(this.x);
|
|
36047
|
-
this.y = Math.round(this.y);
|
|
36048
|
-
this.z = Math.round(this.z);
|
|
36049
|
-
return this;
|
|
36050
|
-
}
|
|
36051
|
-
roundToZero() {
|
|
36052
|
-
this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);
|
|
36053
|
-
this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);
|
|
36054
|
-
this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);
|
|
36055
|
-
return this;
|
|
36056
|
-
}
|
|
36057
|
-
negate() {
|
|
36058
|
-
this.x = -this.x;
|
|
36059
|
-
this.y = -this.y;
|
|
36060
|
-
this.z = -this.z;
|
|
36061
|
-
return this;
|
|
36062
|
-
}
|
|
36063
|
-
dot(v) {
|
|
36064
|
-
return this.x * v.x + this.y * v.y + this.z * v.z;
|
|
36065
|
-
}
|
|
36066
|
-
// TODO lengthSquared?
|
|
36067
|
-
lengthSq() {
|
|
36068
|
-
return this.x * this.x + this.y * this.y + this.z * this.z;
|
|
36069
|
-
}
|
|
36070
|
-
length() {
|
|
36071
|
-
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
36072
|
-
}
|
|
36073
|
-
manhattanLength() {
|
|
36074
|
-
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
|
|
36075
|
-
}
|
|
36076
|
-
normalize() {
|
|
36077
|
-
return this.divideScalar(this.length() || 1);
|
|
36078
|
-
}
|
|
36079
|
-
setLength(length2) {
|
|
36080
|
-
return this.normalize().multiplyScalar(length2);
|
|
36081
|
-
}
|
|
36082
|
-
lerp(v, alpha2) {
|
|
36083
|
-
this.x += (v.x - this.x) * alpha2;
|
|
36084
|
-
this.y += (v.y - this.y) * alpha2;
|
|
36085
|
-
this.z += (v.z - this.z) * alpha2;
|
|
36086
|
-
return this;
|
|
36087
|
-
}
|
|
36088
|
-
lerpVectors(v1, v2, alpha2) {
|
|
36089
|
-
this.x = v1.x + (v2.x - v1.x) * alpha2;
|
|
36090
|
-
this.y = v1.y + (v2.y - v1.y) * alpha2;
|
|
36091
|
-
this.z = v1.z + (v2.z - v1.z) * alpha2;
|
|
36092
|
-
return this;
|
|
36093
|
-
}
|
|
36094
|
-
cross(v) {
|
|
36095
|
-
return this.crossVectors(this, v);
|
|
36096
|
-
}
|
|
36097
|
-
crossVectors(a, b) {
|
|
36098
|
-
const ax = a.x, ay = a.y, az = a.z;
|
|
36099
|
-
const bx = b.x, by = b.y, bz = b.z;
|
|
36100
|
-
this.x = ay * bz - az * by;
|
|
36101
|
-
this.y = az * bx - ax * bz;
|
|
36102
|
-
this.z = ax * by - ay * bx;
|
|
36103
|
-
return this;
|
|
36104
|
-
}
|
|
36105
|
-
projectOnVector(v) {
|
|
36106
|
-
const denominator = v.lengthSq();
|
|
36107
|
-
if (denominator === 0) return this.set(0, 0, 0);
|
|
36108
|
-
const scalar = v.dot(this) / denominator;
|
|
36109
|
-
return this.copy(v).multiplyScalar(scalar);
|
|
36110
|
-
}
|
|
36111
|
-
projectOnPlane(planeNormal) {
|
|
36112
|
-
_vector$b.copy(this).projectOnVector(planeNormal);
|
|
36113
|
-
return this.sub(_vector$b);
|
|
36114
|
-
}
|
|
36115
|
-
reflect(normal) {
|
|
36116
|
-
return this.sub(_vector$b.copy(normal).multiplyScalar(2 * this.dot(normal)));
|
|
36117
|
-
}
|
|
36118
|
-
angleTo(v) {
|
|
36119
|
-
const denominator = Math.sqrt(this.lengthSq() * v.lengthSq());
|
|
36120
|
-
if (denominator === 0) return Math.PI / 2;
|
|
36121
|
-
const theta = this.dot(v) / denominator;
|
|
36122
|
-
return Math.acos(clamp(theta, -1, 1));
|
|
36123
|
-
}
|
|
36124
|
-
distanceTo(v) {
|
|
36125
|
-
return Math.sqrt(this.distanceToSquared(v));
|
|
36126
|
-
}
|
|
36127
|
-
distanceToSquared(v) {
|
|
36128
|
-
const dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
|
|
36129
|
-
return dx * dx + dy * dy + dz * dz;
|
|
36130
|
-
}
|
|
36131
|
-
manhattanDistanceTo(v) {
|
|
36132
|
-
return Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);
|
|
36133
|
-
}
|
|
36134
|
-
setFromSpherical(s) {
|
|
36135
|
-
return this.setFromSphericalCoords(s.radius, s.phi, s.theta);
|
|
36136
|
-
}
|
|
36137
|
-
setFromSphericalCoords(radius, phi, theta) {
|
|
36138
|
-
const sinPhiRadius = Math.sin(phi) * radius;
|
|
36139
|
-
this.x = sinPhiRadius * Math.sin(theta);
|
|
36140
|
-
this.y = Math.cos(phi) * radius;
|
|
36141
|
-
this.z = sinPhiRadius * Math.cos(theta);
|
|
36142
|
-
return this;
|
|
36143
|
-
}
|
|
36144
|
-
setFromCylindrical(c) {
|
|
36145
|
-
return this.setFromCylindricalCoords(c.radius, c.theta, c.y);
|
|
36146
|
-
}
|
|
36147
|
-
setFromCylindricalCoords(radius, theta, y) {
|
|
36148
|
-
this.x = radius * Math.sin(theta);
|
|
36149
|
-
this.y = y;
|
|
36150
|
-
this.z = radius * Math.cos(theta);
|
|
36151
|
-
return this;
|
|
36152
|
-
}
|
|
36153
|
-
setFromMatrixPosition(m) {
|
|
36154
|
-
const e = m.elements;
|
|
36155
|
-
this.x = e[12];
|
|
36156
|
-
this.y = e[13];
|
|
36157
|
-
this.z = e[14];
|
|
36158
|
-
return this;
|
|
36159
|
-
}
|
|
36160
|
-
setFromMatrixScale(m) {
|
|
36161
|
-
const sx = this.setFromMatrixColumn(m, 0).length();
|
|
36162
|
-
const sy = this.setFromMatrixColumn(m, 1).length();
|
|
36163
|
-
const sz = this.setFromMatrixColumn(m, 2).length();
|
|
36164
|
-
this.x = sx;
|
|
36165
|
-
this.y = sy;
|
|
36166
|
-
this.z = sz;
|
|
36167
|
-
return this;
|
|
36168
|
-
}
|
|
36169
|
-
setFromMatrixColumn(m, index) {
|
|
36170
|
-
return this.fromArray(m.elements, index * 4);
|
|
36171
|
-
}
|
|
36172
|
-
setFromMatrix3Column(m, index) {
|
|
36173
|
-
return this.fromArray(m.elements, index * 3);
|
|
36174
|
-
}
|
|
36175
|
-
setFromEuler(e) {
|
|
36176
|
-
this.x = e._x;
|
|
36177
|
-
this.y = e._y;
|
|
36178
|
-
this.z = e._z;
|
|
36179
|
-
return this;
|
|
36180
|
-
}
|
|
36181
|
-
setFromColor(c) {
|
|
36182
|
-
this.x = c.r;
|
|
36183
|
-
this.y = c.g;
|
|
36184
|
-
this.z = c.b;
|
|
36185
|
-
return this;
|
|
36186
|
-
}
|
|
36187
|
-
equals(v) {
|
|
36188
|
-
return v.x === this.x && v.y === this.y && v.z === this.z;
|
|
36189
|
-
}
|
|
36190
|
-
fromArray(array2, offset2 = 0) {
|
|
36191
|
-
this.x = array2[offset2];
|
|
36192
|
-
this.y = array2[offset2 + 1];
|
|
36193
|
-
this.z = array2[offset2 + 2];
|
|
36194
|
-
return this;
|
|
36195
|
-
}
|
|
36196
|
-
toArray(array2 = [], offset2 = 0) {
|
|
36197
|
-
array2[offset2] = this.x;
|
|
36198
|
-
array2[offset2 + 1] = this.y;
|
|
36199
|
-
array2[offset2 + 2] = this.z;
|
|
36200
|
-
return array2;
|
|
36201
|
-
}
|
|
36202
|
-
fromBufferAttribute(attribute, index) {
|
|
36203
|
-
this.x = attribute.getX(index);
|
|
36204
|
-
this.y = attribute.getY(index);
|
|
36205
|
-
this.z = attribute.getZ(index);
|
|
36206
|
-
return this;
|
|
36207
|
-
}
|
|
36208
|
-
random() {
|
|
36209
|
-
this.x = Math.random();
|
|
36210
|
-
this.y = Math.random();
|
|
36211
|
-
this.z = Math.random();
|
|
36212
|
-
return this;
|
|
36213
|
-
}
|
|
36214
|
-
randomDirection() {
|
|
36215
|
-
const u = (Math.random() - 0.5) * 2;
|
|
36216
|
-
const t = Math.random() * Math.PI * 2;
|
|
36217
|
-
const f = Math.sqrt(1 - u ** 2);
|
|
36218
|
-
this.x = f * Math.cos(t);
|
|
36219
|
-
this.y = f * Math.sin(t);
|
|
36220
|
-
this.z = u;
|
|
36221
|
-
return this;
|
|
36222
|
-
}
|
|
36223
|
-
*[Symbol.iterator]() {
|
|
36224
|
-
yield this.x;
|
|
36225
|
-
yield this.y;
|
|
36226
|
-
yield this.z;
|
|
36227
|
-
}
|
|
36228
|
-
}
|
|
36229
|
-
const _vector$b = /* @__PURE__ */ new Vector3();
|
|
36230
|
-
const _quaternion$4 = /* @__PURE__ */ new Quaternion();
|
|
36231
|
-
class Matrix4 {
|
|
36232
|
-
constructor(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
|
|
36233
|
-
Matrix4.prototype.isMatrix4 = true;
|
|
36234
|
-
this.elements = [
|
|
36235
|
-
1,
|
|
36236
|
-
0,
|
|
36237
|
-
0,
|
|
36238
|
-
0,
|
|
36239
|
-
0,
|
|
36240
|
-
1,
|
|
36241
|
-
0,
|
|
36242
|
-
0,
|
|
36243
|
-
0,
|
|
36244
|
-
0,
|
|
36245
|
-
1,
|
|
36246
|
-
0,
|
|
36247
|
-
0,
|
|
36248
|
-
0,
|
|
36249
|
-
0,
|
|
36250
|
-
1
|
|
36251
|
-
];
|
|
36252
|
-
if (n11 !== void 0) {
|
|
36253
|
-
this.set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44);
|
|
36254
|
-
}
|
|
36255
|
-
}
|
|
36256
|
-
set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {
|
|
36257
|
-
const te = this.elements;
|
|
36258
|
-
te[0] = n11;
|
|
36259
|
-
te[4] = n12;
|
|
36260
|
-
te[8] = n13;
|
|
36261
|
-
te[12] = n14;
|
|
36262
|
-
te[1] = n21;
|
|
36263
|
-
te[5] = n22;
|
|
36264
|
-
te[9] = n23;
|
|
36265
|
-
te[13] = n24;
|
|
36266
|
-
te[2] = n31;
|
|
36267
|
-
te[6] = n32;
|
|
36268
|
-
te[10] = n33;
|
|
36269
|
-
te[14] = n34;
|
|
36270
|
-
te[3] = n41;
|
|
36271
|
-
te[7] = n42;
|
|
36272
|
-
te[11] = n43;
|
|
36273
|
-
te[15] = n44;
|
|
36274
|
-
return this;
|
|
36275
|
-
}
|
|
36276
|
-
identity() {
|
|
36277
|
-
this.set(
|
|
36278
|
-
1,
|
|
36279
|
-
0,
|
|
36280
|
-
0,
|
|
36281
|
-
0,
|
|
36282
|
-
0,
|
|
36283
|
-
1,
|
|
36284
|
-
0,
|
|
36285
|
-
0,
|
|
36286
|
-
0,
|
|
36287
|
-
0,
|
|
36288
|
-
1,
|
|
36289
|
-
0,
|
|
36290
|
-
0,
|
|
36291
|
-
0,
|
|
36292
|
-
0,
|
|
36293
|
-
1
|
|
36294
|
-
);
|
|
36295
|
-
return this;
|
|
36296
|
-
}
|
|
36297
|
-
clone() {
|
|
36298
|
-
return new Matrix4().fromArray(this.elements);
|
|
36299
|
-
}
|
|
36300
|
-
copy(m) {
|
|
36301
|
-
const te = this.elements;
|
|
36302
|
-
const me = m.elements;
|
|
36303
|
-
te[0] = me[0];
|
|
36304
|
-
te[1] = me[1];
|
|
36305
|
-
te[2] = me[2];
|
|
36306
|
-
te[3] = me[3];
|
|
36307
|
-
te[4] = me[4];
|
|
36308
|
-
te[5] = me[5];
|
|
36309
|
-
te[6] = me[6];
|
|
36310
|
-
te[7] = me[7];
|
|
36311
|
-
te[8] = me[8];
|
|
36312
|
-
te[9] = me[9];
|
|
36313
|
-
te[10] = me[10];
|
|
36314
|
-
te[11] = me[11];
|
|
36315
|
-
te[12] = me[12];
|
|
36316
|
-
te[13] = me[13];
|
|
36317
|
-
te[14] = me[14];
|
|
36318
|
-
te[15] = me[15];
|
|
36319
|
-
return this;
|
|
36320
|
-
}
|
|
36321
|
-
copyPosition(m) {
|
|
36322
|
-
const te = this.elements, me = m.elements;
|
|
36323
|
-
te[12] = me[12];
|
|
36324
|
-
te[13] = me[13];
|
|
36325
|
-
te[14] = me[14];
|
|
36326
|
-
return this;
|
|
36327
|
-
}
|
|
36328
|
-
setFromMatrix3(m) {
|
|
36329
|
-
const me = m.elements;
|
|
36330
|
-
this.set(
|
|
36331
|
-
me[0],
|
|
36332
|
-
me[3],
|
|
36333
|
-
me[6],
|
|
36334
|
-
0,
|
|
36335
|
-
me[1],
|
|
36336
|
-
me[4],
|
|
36337
|
-
me[7],
|
|
36338
|
-
0,
|
|
36339
|
-
me[2],
|
|
36340
|
-
me[5],
|
|
36341
|
-
me[8],
|
|
36342
|
-
0,
|
|
36343
|
-
0,
|
|
36344
|
-
0,
|
|
36345
|
-
0,
|
|
36346
|
-
1
|
|
36347
|
-
);
|
|
36348
|
-
return this;
|
|
36349
|
-
}
|
|
36350
|
-
extractBasis(xAxis, yAxis, zAxis) {
|
|
36351
|
-
xAxis.setFromMatrixColumn(this, 0);
|
|
36352
|
-
yAxis.setFromMatrixColumn(this, 1);
|
|
36353
|
-
zAxis.setFromMatrixColumn(this, 2);
|
|
36354
|
-
return this;
|
|
36355
|
-
}
|
|
36356
|
-
makeBasis(xAxis, yAxis, zAxis) {
|
|
36357
|
-
this.set(
|
|
36358
|
-
xAxis.x,
|
|
36359
|
-
yAxis.x,
|
|
36360
|
-
zAxis.x,
|
|
36361
|
-
0,
|
|
36362
|
-
xAxis.y,
|
|
36363
|
-
yAxis.y,
|
|
36364
|
-
zAxis.y,
|
|
36365
|
-
0,
|
|
36366
|
-
xAxis.z,
|
|
36367
|
-
yAxis.z,
|
|
36368
|
-
zAxis.z,
|
|
36369
|
-
0,
|
|
36370
|
-
0,
|
|
36371
|
-
0,
|
|
36372
|
-
0,
|
|
36373
|
-
1
|
|
36374
|
-
);
|
|
36375
|
-
return this;
|
|
36376
|
-
}
|
|
36377
|
-
extractRotation(m) {
|
|
36378
|
-
const te = this.elements;
|
|
36379
|
-
const me = m.elements;
|
|
36380
|
-
const scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length();
|
|
36381
|
-
const scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length();
|
|
36382
|
-
const scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length();
|
|
36383
|
-
te[0] = me[0] * scaleX;
|
|
36384
|
-
te[1] = me[1] * scaleX;
|
|
36385
|
-
te[2] = me[2] * scaleX;
|
|
36386
|
-
te[3] = 0;
|
|
36387
|
-
te[4] = me[4] * scaleY;
|
|
36388
|
-
te[5] = me[5] * scaleY;
|
|
36389
|
-
te[6] = me[6] * scaleY;
|
|
36390
|
-
te[7] = 0;
|
|
36391
|
-
te[8] = me[8] * scaleZ;
|
|
36392
|
-
te[9] = me[9] * scaleZ;
|
|
36393
|
-
te[10] = me[10] * scaleZ;
|
|
36394
|
-
te[11] = 0;
|
|
36395
|
-
te[12] = 0;
|
|
36396
|
-
te[13] = 0;
|
|
36397
|
-
te[14] = 0;
|
|
36398
|
-
te[15] = 1;
|
|
36399
|
-
return this;
|
|
36400
|
-
}
|
|
36401
|
-
makeRotationFromEuler(euler) {
|
|
36402
|
-
const te = this.elements;
|
|
36403
|
-
const x = euler.x, y = euler.y, z2 = euler.z;
|
|
36404
|
-
const a = Math.cos(x), b = Math.sin(x);
|
|
36405
|
-
const c = Math.cos(y), d = Math.sin(y);
|
|
36406
|
-
const e = Math.cos(z2), f = Math.sin(z2);
|
|
36407
|
-
if (euler.order === "XYZ") {
|
|
36408
|
-
const ae = a * e, af = a * f, be = b * e, bf = b * f;
|
|
36409
|
-
te[0] = c * e;
|
|
36410
|
-
te[4] = -c * f;
|
|
36411
|
-
te[8] = d;
|
|
36412
|
-
te[1] = af + be * d;
|
|
36413
|
-
te[5] = ae - bf * d;
|
|
36414
|
-
te[9] = -b * c;
|
|
36415
|
-
te[2] = bf - ae * d;
|
|
36416
|
-
te[6] = be + af * d;
|
|
36417
|
-
te[10] = a * c;
|
|
36418
|
-
} else if (euler.order === "YXZ") {
|
|
36419
|
-
const ce = c * e, cf = c * f, de = d * e, df = d * f;
|
|
36420
|
-
te[0] = ce + df * b;
|
|
36421
|
-
te[4] = de * b - cf;
|
|
36422
|
-
te[8] = a * d;
|
|
36423
|
-
te[1] = a * f;
|
|
36424
|
-
te[5] = a * e;
|
|
36425
|
-
te[9] = -b;
|
|
36426
|
-
te[2] = cf * b - de;
|
|
36427
|
-
te[6] = df + ce * b;
|
|
36428
|
-
te[10] = a * c;
|
|
36429
|
-
} else if (euler.order === "ZXY") {
|
|
36430
|
-
const ce = c * e, cf = c * f, de = d * e, df = d * f;
|
|
36431
|
-
te[0] = ce - df * b;
|
|
36432
|
-
te[4] = -a * f;
|
|
36433
|
-
te[8] = de + cf * b;
|
|
36434
|
-
te[1] = cf + de * b;
|
|
36435
|
-
te[5] = a * e;
|
|
36436
|
-
te[9] = df - ce * b;
|
|
36437
|
-
te[2] = -a * d;
|
|
36438
|
-
te[6] = b;
|
|
36439
|
-
te[10] = a * c;
|
|
36440
|
-
} else if (euler.order === "ZYX") {
|
|
36441
|
-
const ae = a * e, af = a * f, be = b * e, bf = b * f;
|
|
36442
|
-
te[0] = c * e;
|
|
36443
|
-
te[4] = be * d - af;
|
|
36444
|
-
te[8] = ae * d + bf;
|
|
36445
|
-
te[1] = c * f;
|
|
36446
|
-
te[5] = bf * d + ae;
|
|
36447
|
-
te[9] = af * d - be;
|
|
36448
|
-
te[2] = -d;
|
|
36449
|
-
te[6] = b * c;
|
|
36450
|
-
te[10] = a * c;
|
|
36451
|
-
} else if (euler.order === "YZX") {
|
|
36452
|
-
const ac = a * c, ad = a * d, bc = b * c, bd = b * d;
|
|
36453
|
-
te[0] = c * e;
|
|
36454
|
-
te[4] = bd - ac * f;
|
|
36455
|
-
te[8] = bc * f + ad;
|
|
36456
|
-
te[1] = f;
|
|
36457
|
-
te[5] = a * e;
|
|
36458
|
-
te[9] = -b * e;
|
|
36459
|
-
te[2] = -d * e;
|
|
36460
|
-
te[6] = ad * f + bc;
|
|
36461
|
-
te[10] = ac - bd * f;
|
|
36462
|
-
} else if (euler.order === "XZY") {
|
|
36463
|
-
const ac = a * c, ad = a * d, bc = b * c, bd = b * d;
|
|
36464
|
-
te[0] = c * e;
|
|
36465
|
-
te[4] = -f;
|
|
36466
|
-
te[8] = d * e;
|
|
36467
|
-
te[1] = ac * f + bd;
|
|
36468
|
-
te[5] = a * e;
|
|
36469
|
-
te[9] = ad * f - bc;
|
|
36470
|
-
te[2] = bc * f - ad;
|
|
36471
|
-
te[6] = b * e;
|
|
36472
|
-
te[10] = bd * f + ac;
|
|
36473
|
-
}
|
|
36474
|
-
te[3] = 0;
|
|
36475
|
-
te[7] = 0;
|
|
36476
|
-
te[11] = 0;
|
|
36477
|
-
te[12] = 0;
|
|
36478
|
-
te[13] = 0;
|
|
36479
|
-
te[14] = 0;
|
|
36480
|
-
te[15] = 1;
|
|
36481
|
-
return this;
|
|
36482
|
-
}
|
|
36483
|
-
makeRotationFromQuaternion(q) {
|
|
36484
|
-
return this.compose(_zero, q, _one);
|
|
36485
|
-
}
|
|
36486
|
-
lookAt(eye, target, up) {
|
|
36487
|
-
const te = this.elements;
|
|
36488
|
-
_z.subVectors(eye, target);
|
|
36489
|
-
if (_z.lengthSq() === 0) {
|
|
36490
|
-
_z.z = 1;
|
|
36491
|
-
}
|
|
36492
|
-
_z.normalize();
|
|
36493
|
-
_x.crossVectors(up, _z);
|
|
36494
|
-
if (_x.lengthSq() === 0) {
|
|
36495
|
-
if (Math.abs(up.z) === 1) {
|
|
36496
|
-
_z.x += 1e-4;
|
|
36497
|
-
} else {
|
|
36498
|
-
_z.z += 1e-4;
|
|
36499
|
-
}
|
|
36500
|
-
_z.normalize();
|
|
36501
|
-
_x.crossVectors(up, _z);
|
|
36502
|
-
}
|
|
36503
|
-
_x.normalize();
|
|
36504
|
-
_y.crossVectors(_z, _x);
|
|
36505
|
-
te[0] = _x.x;
|
|
36506
|
-
te[4] = _y.x;
|
|
36507
|
-
te[8] = _z.x;
|
|
36508
|
-
te[1] = _x.y;
|
|
36509
|
-
te[5] = _y.y;
|
|
36510
|
-
te[9] = _z.y;
|
|
36511
|
-
te[2] = _x.z;
|
|
36512
|
-
te[6] = _y.z;
|
|
36513
|
-
te[10] = _z.z;
|
|
36514
|
-
return this;
|
|
36515
|
-
}
|
|
36516
|
-
multiply(m) {
|
|
36517
|
-
return this.multiplyMatrices(this, m);
|
|
36518
|
-
}
|
|
36519
|
-
premultiply(m) {
|
|
36520
|
-
return this.multiplyMatrices(m, this);
|
|
36521
|
-
}
|
|
36522
|
-
multiplyMatrices(a, b) {
|
|
36523
|
-
const ae = a.elements;
|
|
36524
|
-
const be = b.elements;
|
|
36525
|
-
const te = this.elements;
|
|
36526
|
-
const a11 = ae[0], a12 = ae[4], a13 = ae[8], a14 = ae[12];
|
|
36527
|
-
const a21 = ae[1], a22 = ae[5], a23 = ae[9], a24 = ae[13];
|
|
36528
|
-
const a31 = ae[2], a32 = ae[6], a33 = ae[10], a34 = ae[14];
|
|
36529
|
-
const a41 = ae[3], a42 = ae[7], a43 = ae[11], a44 = ae[15];
|
|
36530
|
-
const b11 = be[0], b12 = be[4], b13 = be[8], b14 = be[12];
|
|
36531
|
-
const b21 = be[1], b22 = be[5], b23 = be[9], b24 = be[13];
|
|
36532
|
-
const b31 = be[2], b32 = be[6], b33 = be[10], b34 = be[14];
|
|
36533
|
-
const b41 = be[3], b42 = be[7], b43 = be[11], b44 = be[15];
|
|
36534
|
-
te[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
|
|
36535
|
-
te[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
|
|
36536
|
-
te[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
|
|
36537
|
-
te[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
|
|
36538
|
-
te[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
|
|
36539
|
-
te[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
|
|
36540
|
-
te[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
|
|
36541
|
-
te[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
|
|
36542
|
-
te[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
|
|
36543
|
-
te[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
|
|
36544
|
-
te[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
|
|
36545
|
-
te[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
|
|
36546
|
-
te[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
|
|
36547
|
-
te[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
|
|
36548
|
-
te[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
|
|
36549
|
-
te[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
|
|
36550
|
-
return this;
|
|
36551
|
-
}
|
|
36552
|
-
multiplyScalar(s) {
|
|
36553
|
-
const te = this.elements;
|
|
36554
|
-
te[0] *= s;
|
|
36555
|
-
te[4] *= s;
|
|
36556
|
-
te[8] *= s;
|
|
36557
|
-
te[12] *= s;
|
|
36558
|
-
te[1] *= s;
|
|
36559
|
-
te[5] *= s;
|
|
36560
|
-
te[9] *= s;
|
|
36561
|
-
te[13] *= s;
|
|
36562
|
-
te[2] *= s;
|
|
36563
|
-
te[6] *= s;
|
|
36564
|
-
te[10] *= s;
|
|
36565
|
-
te[14] *= s;
|
|
36566
|
-
te[3] *= s;
|
|
36567
|
-
te[7] *= s;
|
|
36568
|
-
te[11] *= s;
|
|
36569
|
-
te[15] *= s;
|
|
36570
|
-
return this;
|
|
36571
|
-
}
|
|
36572
|
-
determinant() {
|
|
36573
|
-
const te = this.elements;
|
|
36574
|
-
const n11 = te[0], n12 = te[4], n13 = te[8], n14 = te[12];
|
|
36575
|
-
const n21 = te[1], n22 = te[5], n23 = te[9], n24 = te[13];
|
|
36576
|
-
const n31 = te[2], n32 = te[6], n33 = te[10], n34 = te[14];
|
|
36577
|
-
const n41 = te[3], n42 = te[7], n43 = te[11], n44 = te[15];
|
|
36578
|
-
return n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);
|
|
36579
|
-
}
|
|
36580
|
-
transpose() {
|
|
36581
|
-
const te = this.elements;
|
|
36582
|
-
let tmp;
|
|
36583
|
-
tmp = te[1];
|
|
36584
|
-
te[1] = te[4];
|
|
36585
|
-
te[4] = tmp;
|
|
36586
|
-
tmp = te[2];
|
|
36587
|
-
te[2] = te[8];
|
|
36588
|
-
te[8] = tmp;
|
|
36589
|
-
tmp = te[6];
|
|
36590
|
-
te[6] = te[9];
|
|
36591
|
-
te[9] = tmp;
|
|
36592
|
-
tmp = te[3];
|
|
36593
|
-
te[3] = te[12];
|
|
36594
|
-
te[12] = tmp;
|
|
36595
|
-
tmp = te[7];
|
|
36596
|
-
te[7] = te[13];
|
|
36597
|
-
te[13] = tmp;
|
|
36598
|
-
tmp = te[11];
|
|
36599
|
-
te[11] = te[14];
|
|
36600
|
-
te[14] = tmp;
|
|
36601
|
-
return this;
|
|
36602
|
-
}
|
|
36603
|
-
setPosition(x, y, z2) {
|
|
36604
|
-
const te = this.elements;
|
|
36605
|
-
if (x.isVector3) {
|
|
36606
|
-
te[12] = x.x;
|
|
36607
|
-
te[13] = x.y;
|
|
36608
|
-
te[14] = x.z;
|
|
36609
|
-
} else {
|
|
36610
|
-
te[12] = x;
|
|
36611
|
-
te[13] = y;
|
|
36612
|
-
te[14] = z2;
|
|
36613
|
-
}
|
|
36614
|
-
return this;
|
|
36615
|
-
}
|
|
36616
|
-
invert() {
|
|
36617
|
-
const te = this.elements, n11 = te[0], n21 = te[1], n31 = te[2], n41 = te[3], n12 = te[4], n22 = te[5], n32 = te[6], n42 = te[7], n13 = te[8], n23 = te[9], n33 = te[10], n43 = te[11], n14 = te[12], n24 = te[13], n34 = te[14], n44 = te[15], t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44, t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44, t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44, t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
|
|
36618
|
-
const det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
|
|
36619
|
-
if (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
36620
|
-
const detInv = 1 / det;
|
|
36621
|
-
te[0] = t11 * detInv;
|
|
36622
|
-
te[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;
|
|
36623
|
-
te[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;
|
|
36624
|
-
te[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;
|
|
36625
|
-
te[4] = t12 * detInv;
|
|
36626
|
-
te[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;
|
|
36627
|
-
te[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;
|
|
36628
|
-
te[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;
|
|
36629
|
-
te[8] = t13 * detInv;
|
|
36630
|
-
te[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;
|
|
36631
|
-
te[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;
|
|
36632
|
-
te[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;
|
|
36633
|
-
te[12] = t14 * detInv;
|
|
36634
|
-
te[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;
|
|
36635
|
-
te[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;
|
|
36636
|
-
te[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;
|
|
36637
|
-
return this;
|
|
36638
|
-
}
|
|
36639
|
-
scale(v) {
|
|
36640
|
-
const te = this.elements;
|
|
36641
|
-
const x = v.x, y = v.y, z2 = v.z;
|
|
36642
|
-
te[0] *= x;
|
|
36643
|
-
te[4] *= y;
|
|
36644
|
-
te[8] *= z2;
|
|
36645
|
-
te[1] *= x;
|
|
36646
|
-
te[5] *= y;
|
|
36647
|
-
te[9] *= z2;
|
|
36648
|
-
te[2] *= x;
|
|
36649
|
-
te[6] *= y;
|
|
36650
|
-
te[10] *= z2;
|
|
36651
|
-
te[3] *= x;
|
|
36652
|
-
te[7] *= y;
|
|
36653
|
-
te[11] *= z2;
|
|
36654
|
-
return this;
|
|
36655
|
-
}
|
|
36656
|
-
getMaxScaleOnAxis() {
|
|
36657
|
-
const te = this.elements;
|
|
36658
|
-
const scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];
|
|
36659
|
-
const scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];
|
|
36660
|
-
const scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];
|
|
36661
|
-
return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));
|
|
36662
|
-
}
|
|
36663
|
-
makeTranslation(x, y, z2) {
|
|
36664
|
-
if (x.isVector3) {
|
|
36665
|
-
this.set(
|
|
36666
|
-
1,
|
|
36667
|
-
0,
|
|
36668
|
-
0,
|
|
36669
|
-
x.x,
|
|
36670
|
-
0,
|
|
36671
|
-
1,
|
|
36672
|
-
0,
|
|
36673
|
-
x.y,
|
|
36674
|
-
0,
|
|
36675
|
-
0,
|
|
36676
|
-
1,
|
|
36677
|
-
x.z,
|
|
36678
|
-
0,
|
|
36679
|
-
0,
|
|
36680
|
-
0,
|
|
36681
|
-
1
|
|
36682
|
-
);
|
|
36683
|
-
} else {
|
|
36684
|
-
this.set(
|
|
36685
|
-
1,
|
|
36686
|
-
0,
|
|
36687
|
-
0,
|
|
36688
|
-
x,
|
|
36689
|
-
0,
|
|
36690
|
-
1,
|
|
36691
|
-
0,
|
|
36692
|
-
y,
|
|
36693
|
-
0,
|
|
36694
|
-
0,
|
|
36695
|
-
1,
|
|
36696
|
-
z2,
|
|
36697
|
-
0,
|
|
36698
|
-
0,
|
|
36699
|
-
0,
|
|
36700
|
-
1
|
|
36701
|
-
);
|
|
36702
|
-
}
|
|
36703
|
-
return this;
|
|
36704
|
-
}
|
|
36705
|
-
makeRotationX(theta) {
|
|
36706
|
-
const c = Math.cos(theta), s = Math.sin(theta);
|
|
36707
|
-
this.set(
|
|
36708
|
-
1,
|
|
36709
|
-
0,
|
|
36710
|
-
0,
|
|
36711
|
-
0,
|
|
36712
|
-
0,
|
|
36713
|
-
c,
|
|
36714
|
-
-s,
|
|
36715
|
-
0,
|
|
36716
|
-
0,
|
|
36717
|
-
s,
|
|
36718
|
-
c,
|
|
36719
|
-
0,
|
|
36720
|
-
0,
|
|
36721
|
-
0,
|
|
36722
|
-
0,
|
|
36723
|
-
1
|
|
36724
|
-
);
|
|
36725
|
-
return this;
|
|
36726
|
-
}
|
|
36727
|
-
makeRotationY(theta) {
|
|
36728
|
-
const c = Math.cos(theta), s = Math.sin(theta);
|
|
36729
|
-
this.set(
|
|
36730
|
-
c,
|
|
36731
|
-
0,
|
|
36732
|
-
s,
|
|
36733
|
-
0,
|
|
36734
|
-
0,
|
|
36735
|
-
1,
|
|
36736
|
-
0,
|
|
36737
|
-
0,
|
|
36738
|
-
-s,
|
|
36739
|
-
0,
|
|
36740
|
-
c,
|
|
36741
|
-
0,
|
|
36742
|
-
0,
|
|
36743
|
-
0,
|
|
36744
|
-
0,
|
|
36745
|
-
1
|
|
36746
|
-
);
|
|
36747
|
-
return this;
|
|
36748
|
-
}
|
|
36749
|
-
makeRotationZ(theta) {
|
|
36750
|
-
const c = Math.cos(theta), s = Math.sin(theta);
|
|
36751
|
-
this.set(
|
|
36752
|
-
c,
|
|
36753
|
-
-s,
|
|
36754
|
-
0,
|
|
36755
|
-
0,
|
|
36756
|
-
s,
|
|
36757
|
-
c,
|
|
36758
|
-
0,
|
|
36759
|
-
0,
|
|
36760
|
-
0,
|
|
36761
|
-
0,
|
|
36762
|
-
1,
|
|
36763
|
-
0,
|
|
36764
|
-
0,
|
|
36765
|
-
0,
|
|
36766
|
-
0,
|
|
36767
|
-
1
|
|
36768
|
-
);
|
|
36769
|
-
return this;
|
|
36770
|
-
}
|
|
36771
|
-
makeRotationAxis(axis2, angle) {
|
|
36772
|
-
const c = Math.cos(angle);
|
|
36773
|
-
const s = Math.sin(angle);
|
|
36774
|
-
const t = 1 - c;
|
|
36775
|
-
const x = axis2.x, y = axis2.y, z2 = axis2.z;
|
|
36776
|
-
const tx = t * x, ty = t * y;
|
|
36777
|
-
this.set(
|
|
36778
|
-
tx * x + c,
|
|
36779
|
-
tx * y - s * z2,
|
|
36780
|
-
tx * z2 + s * y,
|
|
36781
|
-
0,
|
|
36782
|
-
tx * y + s * z2,
|
|
36783
|
-
ty * y + c,
|
|
36784
|
-
ty * z2 - s * x,
|
|
36785
|
-
0,
|
|
36786
|
-
tx * z2 - s * y,
|
|
36787
|
-
ty * z2 + s * x,
|
|
36788
|
-
t * z2 * z2 + c,
|
|
36789
|
-
0,
|
|
36790
|
-
0,
|
|
36791
|
-
0,
|
|
36792
|
-
0,
|
|
36793
|
-
1
|
|
36794
|
-
);
|
|
36795
|
-
return this;
|
|
36796
|
-
}
|
|
36797
|
-
makeScale(x, y, z2) {
|
|
36798
|
-
this.set(
|
|
36799
|
-
x,
|
|
36800
|
-
0,
|
|
36801
|
-
0,
|
|
36802
|
-
0,
|
|
36803
|
-
0,
|
|
36804
|
-
y,
|
|
36805
|
-
0,
|
|
36806
|
-
0,
|
|
36807
|
-
0,
|
|
36808
|
-
0,
|
|
36809
|
-
z2,
|
|
36810
|
-
0,
|
|
36811
|
-
0,
|
|
36812
|
-
0,
|
|
36813
|
-
0,
|
|
36814
|
-
1
|
|
36815
|
-
);
|
|
36816
|
-
return this;
|
|
36817
|
-
}
|
|
36818
|
-
makeShear(xy, xz, yx, yz, zx, zy) {
|
|
36819
|
-
this.set(
|
|
36820
|
-
1,
|
|
36821
|
-
yx,
|
|
36822
|
-
zx,
|
|
36823
|
-
0,
|
|
36824
|
-
xy,
|
|
36825
|
-
1,
|
|
36826
|
-
zy,
|
|
36827
|
-
0,
|
|
36828
|
-
xz,
|
|
36829
|
-
yz,
|
|
36830
|
-
1,
|
|
36831
|
-
0,
|
|
36832
|
-
0,
|
|
36833
|
-
0,
|
|
36834
|
-
0,
|
|
36835
|
-
1
|
|
36836
|
-
);
|
|
36837
|
-
return this;
|
|
36838
|
-
}
|
|
36839
|
-
compose(position2, quaternion, scale) {
|
|
36840
|
-
const te = this.elements;
|
|
36841
|
-
const x = quaternion._x, y = quaternion._y, z2 = quaternion._z, w = quaternion._w;
|
|
36842
|
-
const x2 = x + x, y2 = y + y, z22 = z2 + z2;
|
|
36843
|
-
const xx = x * x2, xy = x * y2, xz = x * z22;
|
|
36844
|
-
const yy = y * y2, yz = y * z22, zz = z2 * z22;
|
|
36845
|
-
const wx = w * x2, wy = w * y2, wz = w * z22;
|
|
36846
|
-
const sx = scale.x, sy = scale.y, sz = scale.z;
|
|
36847
|
-
te[0] = (1 - (yy + zz)) * sx;
|
|
36848
|
-
te[1] = (xy + wz) * sx;
|
|
36849
|
-
te[2] = (xz - wy) * sx;
|
|
36850
|
-
te[3] = 0;
|
|
36851
|
-
te[4] = (xy - wz) * sy;
|
|
36852
|
-
te[5] = (1 - (xx + zz)) * sy;
|
|
36853
|
-
te[6] = (yz + wx) * sy;
|
|
36854
|
-
te[7] = 0;
|
|
36855
|
-
te[8] = (xz + wy) * sz;
|
|
36856
|
-
te[9] = (yz - wx) * sz;
|
|
36857
|
-
te[10] = (1 - (xx + yy)) * sz;
|
|
36858
|
-
te[11] = 0;
|
|
36859
|
-
te[12] = position2.x;
|
|
36860
|
-
te[13] = position2.y;
|
|
36861
|
-
te[14] = position2.z;
|
|
36862
|
-
te[15] = 1;
|
|
36863
|
-
return this;
|
|
36864
|
-
}
|
|
36865
|
-
decompose(position2, quaternion, scale) {
|
|
36866
|
-
const te = this.elements;
|
|
36867
|
-
let sx = _v1$5.set(te[0], te[1], te[2]).length();
|
|
36868
|
-
const sy = _v1$5.set(te[4], te[5], te[6]).length();
|
|
36869
|
-
const sz = _v1$5.set(te[8], te[9], te[10]).length();
|
|
36870
|
-
const det = this.determinant();
|
|
36871
|
-
if (det < 0) sx = -sx;
|
|
36872
|
-
position2.x = te[12];
|
|
36873
|
-
position2.y = te[13];
|
|
36874
|
-
position2.z = te[14];
|
|
36875
|
-
_m1$2.copy(this);
|
|
36876
|
-
const invSX = 1 / sx;
|
|
36877
|
-
const invSY = 1 / sy;
|
|
36878
|
-
const invSZ = 1 / sz;
|
|
36879
|
-
_m1$2.elements[0] *= invSX;
|
|
36880
|
-
_m1$2.elements[1] *= invSX;
|
|
36881
|
-
_m1$2.elements[2] *= invSX;
|
|
36882
|
-
_m1$2.elements[4] *= invSY;
|
|
36883
|
-
_m1$2.elements[5] *= invSY;
|
|
36884
|
-
_m1$2.elements[6] *= invSY;
|
|
36885
|
-
_m1$2.elements[8] *= invSZ;
|
|
36886
|
-
_m1$2.elements[9] *= invSZ;
|
|
36887
|
-
_m1$2.elements[10] *= invSZ;
|
|
36888
|
-
quaternion.setFromRotationMatrix(_m1$2);
|
|
36889
|
-
scale.x = sx;
|
|
36890
|
-
scale.y = sy;
|
|
36891
|
-
scale.z = sz;
|
|
36892
|
-
return this;
|
|
36893
|
-
}
|
|
36894
|
-
makePerspective(left, right, top, bottom2, near, far, coordinateSystem = WebGLCoordinateSystem) {
|
|
36895
|
-
const te = this.elements;
|
|
36896
|
-
const x = 2 * near / (right - left);
|
|
36897
|
-
const y = 2 * near / (top - bottom2);
|
|
36898
|
-
const a = (right + left) / (right - left);
|
|
36899
|
-
const b = (top + bottom2) / (top - bottom2);
|
|
36900
|
-
let c, d;
|
|
36901
|
-
if (coordinateSystem === WebGLCoordinateSystem) {
|
|
36902
|
-
c = -(far + near) / (far - near);
|
|
36903
|
-
d = -2 * far * near / (far - near);
|
|
36904
|
-
} else if (coordinateSystem === WebGPUCoordinateSystem) {
|
|
36905
|
-
c = -far / (far - near);
|
|
36906
|
-
d = -far * near / (far - near);
|
|
36907
|
-
} else {
|
|
36908
|
-
throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + coordinateSystem);
|
|
36909
|
-
}
|
|
36910
|
-
te[0] = x;
|
|
36911
|
-
te[4] = 0;
|
|
36912
|
-
te[8] = a;
|
|
36913
|
-
te[12] = 0;
|
|
36914
|
-
te[1] = 0;
|
|
36915
|
-
te[5] = y;
|
|
36916
|
-
te[9] = b;
|
|
36917
|
-
te[13] = 0;
|
|
36918
|
-
te[2] = 0;
|
|
36919
|
-
te[6] = 0;
|
|
36920
|
-
te[10] = c;
|
|
36921
|
-
te[14] = d;
|
|
36922
|
-
te[3] = 0;
|
|
36923
|
-
te[7] = 0;
|
|
36924
|
-
te[11] = -1;
|
|
36925
|
-
te[15] = 0;
|
|
36926
|
-
return this;
|
|
36927
|
-
}
|
|
36928
|
-
makeOrthographic(left, right, top, bottom2, near, far, coordinateSystem = WebGLCoordinateSystem) {
|
|
36929
|
-
const te = this.elements;
|
|
36930
|
-
const w = 1 / (right - left);
|
|
36931
|
-
const h = 1 / (top - bottom2);
|
|
36932
|
-
const p = 1 / (far - near);
|
|
36933
|
-
const x = (right + left) * w;
|
|
36934
|
-
const y = (top + bottom2) * h;
|
|
36935
|
-
let z2, zInv;
|
|
36936
|
-
if (coordinateSystem === WebGLCoordinateSystem) {
|
|
36937
|
-
z2 = (far + near) * p;
|
|
36938
|
-
zInv = -2 * p;
|
|
36939
|
-
} else if (coordinateSystem === WebGPUCoordinateSystem) {
|
|
36940
|
-
z2 = near * p;
|
|
36941
|
-
zInv = -1 * p;
|
|
36942
|
-
} else {
|
|
36943
|
-
throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + coordinateSystem);
|
|
36944
|
-
}
|
|
36945
|
-
te[0] = 2 * w;
|
|
36946
|
-
te[4] = 0;
|
|
36947
|
-
te[8] = 0;
|
|
36948
|
-
te[12] = -x;
|
|
36949
|
-
te[1] = 0;
|
|
36950
|
-
te[5] = 2 * h;
|
|
36951
|
-
te[9] = 0;
|
|
36952
|
-
te[13] = -y;
|
|
36953
|
-
te[2] = 0;
|
|
36954
|
-
te[6] = 0;
|
|
36955
|
-
te[10] = zInv;
|
|
36956
|
-
te[14] = -z2;
|
|
36957
|
-
te[3] = 0;
|
|
36958
|
-
te[7] = 0;
|
|
36959
|
-
te[11] = 0;
|
|
36960
|
-
te[15] = 1;
|
|
36961
|
-
return this;
|
|
36962
|
-
}
|
|
36963
|
-
equals(matrix) {
|
|
36964
|
-
const te = this.elements;
|
|
36965
|
-
const me = matrix.elements;
|
|
36966
|
-
for (let i = 0; i < 16; i++) {
|
|
36967
|
-
if (te[i] !== me[i]) return false;
|
|
36968
|
-
}
|
|
36969
|
-
return true;
|
|
36970
|
-
}
|
|
36971
|
-
fromArray(array2, offset2 = 0) {
|
|
36972
|
-
for (let i = 0; i < 16; i++) {
|
|
36973
|
-
this.elements[i] = array2[i + offset2];
|
|
36974
|
-
}
|
|
36975
|
-
return this;
|
|
36976
|
-
}
|
|
36977
|
-
toArray(array2 = [], offset2 = 0) {
|
|
36978
|
-
const te = this.elements;
|
|
36979
|
-
array2[offset2] = te[0];
|
|
36980
|
-
array2[offset2 + 1] = te[1];
|
|
36981
|
-
array2[offset2 + 2] = te[2];
|
|
36982
|
-
array2[offset2 + 3] = te[3];
|
|
36983
|
-
array2[offset2 + 4] = te[4];
|
|
36984
|
-
array2[offset2 + 5] = te[5];
|
|
36985
|
-
array2[offset2 + 6] = te[6];
|
|
36986
|
-
array2[offset2 + 7] = te[7];
|
|
36987
|
-
array2[offset2 + 8] = te[8];
|
|
36988
|
-
array2[offset2 + 9] = te[9];
|
|
36989
|
-
array2[offset2 + 10] = te[10];
|
|
36990
|
-
array2[offset2 + 11] = te[11];
|
|
36991
|
-
array2[offset2 + 12] = te[12];
|
|
36992
|
-
array2[offset2 + 13] = te[13];
|
|
36993
|
-
array2[offset2 + 14] = te[14];
|
|
36994
|
-
array2[offset2 + 15] = te[15];
|
|
36995
|
-
return array2;
|
|
36996
|
-
}
|
|
36997
|
-
}
|
|
36998
|
-
const _v1$5 = /* @__PURE__ */ new Vector3();
|
|
36999
|
-
const _m1$2 = /* @__PURE__ */ new Matrix4();
|
|
37000
|
-
const _zero = /* @__PURE__ */ new Vector3(0, 0, 0);
|
|
37001
|
-
const _one = /* @__PURE__ */ new Vector3(1, 1, 1);
|
|
37002
|
-
const _x = /* @__PURE__ */ new Vector3();
|
|
37003
|
-
const _y = /* @__PURE__ */ new Vector3();
|
|
37004
|
-
const _z = /* @__PURE__ */ new Vector3();
|
|
37005
|
-
const _matrix = /* @__PURE__ */ new Matrix4();
|
|
37006
|
-
const _quaternion$3 = /* @__PURE__ */ new Quaternion();
|
|
37007
|
-
class Euler {
|
|
37008
|
-
constructor(x = 0, y = 0, z2 = 0, order = Euler.DEFAULT_ORDER) {
|
|
37009
|
-
this.isEuler = true;
|
|
37010
|
-
this._x = x;
|
|
37011
|
-
this._y = y;
|
|
37012
|
-
this._z = z2;
|
|
37013
|
-
this._order = order;
|
|
37014
|
-
}
|
|
37015
|
-
get x() {
|
|
37016
|
-
return this._x;
|
|
37017
|
-
}
|
|
37018
|
-
set x(value) {
|
|
37019
|
-
this._x = value;
|
|
37020
|
-
this._onChangeCallback();
|
|
37021
|
-
}
|
|
37022
|
-
get y() {
|
|
37023
|
-
return this._y;
|
|
37024
|
-
}
|
|
37025
|
-
set y(value) {
|
|
37026
|
-
this._y = value;
|
|
37027
|
-
this._onChangeCallback();
|
|
37028
|
-
}
|
|
37029
|
-
get z() {
|
|
37030
|
-
return this._z;
|
|
37031
|
-
}
|
|
37032
|
-
set z(value) {
|
|
37033
|
-
this._z = value;
|
|
37034
|
-
this._onChangeCallback();
|
|
37035
|
-
}
|
|
37036
|
-
get order() {
|
|
37037
|
-
return this._order;
|
|
37038
|
-
}
|
|
37039
|
-
set order(value) {
|
|
37040
|
-
this._order = value;
|
|
37041
|
-
this._onChangeCallback();
|
|
37042
|
-
}
|
|
37043
|
-
set(x, y, z2, order = this._order) {
|
|
37044
|
-
this._x = x;
|
|
37045
|
-
this._y = y;
|
|
37046
|
-
this._z = z2;
|
|
37047
|
-
this._order = order;
|
|
37048
|
-
this._onChangeCallback();
|
|
37049
|
-
return this;
|
|
37050
|
-
}
|
|
37051
|
-
clone() {
|
|
37052
|
-
return new this.constructor(this._x, this._y, this._z, this._order);
|
|
37053
|
-
}
|
|
37054
|
-
copy(euler) {
|
|
37055
|
-
this._x = euler._x;
|
|
37056
|
-
this._y = euler._y;
|
|
37057
|
-
this._z = euler._z;
|
|
37058
|
-
this._order = euler._order;
|
|
37059
|
-
this._onChangeCallback();
|
|
37060
|
-
return this;
|
|
37061
|
-
}
|
|
37062
|
-
setFromRotationMatrix(m, order = this._order, update2 = true) {
|
|
37063
|
-
const te = m.elements;
|
|
37064
|
-
const m11 = te[0], m12 = te[4], m13 = te[8];
|
|
37065
|
-
const m21 = te[1], m22 = te[5], m23 = te[9];
|
|
37066
|
-
const m31 = te[2], m32 = te[6], m33 = te[10];
|
|
37067
|
-
switch (order) {
|
|
37068
|
-
case "XYZ":
|
|
37069
|
-
this._y = Math.asin(clamp(m13, -1, 1));
|
|
37070
|
-
if (Math.abs(m13) < 0.9999999) {
|
|
37071
|
-
this._x = Math.atan2(-m23, m33);
|
|
37072
|
-
this._z = Math.atan2(-m12, m11);
|
|
37073
|
-
} else {
|
|
37074
|
-
this._x = Math.atan2(m32, m22);
|
|
37075
|
-
this._z = 0;
|
|
37076
|
-
}
|
|
37077
|
-
break;
|
|
37078
|
-
case "YXZ":
|
|
37079
|
-
this._x = Math.asin(-clamp(m23, -1, 1));
|
|
37080
|
-
if (Math.abs(m23) < 0.9999999) {
|
|
37081
|
-
this._y = Math.atan2(m13, m33);
|
|
37082
|
-
this._z = Math.atan2(m21, m22);
|
|
37083
|
-
} else {
|
|
37084
|
-
this._y = Math.atan2(-m31, m11);
|
|
37085
|
-
this._z = 0;
|
|
37086
|
-
}
|
|
37087
|
-
break;
|
|
37088
|
-
case "ZXY":
|
|
37089
|
-
this._x = Math.asin(clamp(m32, -1, 1));
|
|
37090
|
-
if (Math.abs(m32) < 0.9999999) {
|
|
37091
|
-
this._y = Math.atan2(-m31, m33);
|
|
37092
|
-
this._z = Math.atan2(-m12, m22);
|
|
37093
|
-
} else {
|
|
37094
|
-
this._y = 0;
|
|
37095
|
-
this._z = Math.atan2(m21, m11);
|
|
37096
|
-
}
|
|
37097
|
-
break;
|
|
37098
|
-
case "ZYX":
|
|
37099
|
-
this._y = Math.asin(-clamp(m31, -1, 1));
|
|
37100
|
-
if (Math.abs(m31) < 0.9999999) {
|
|
37101
|
-
this._x = Math.atan2(m32, m33);
|
|
37102
|
-
this._z = Math.atan2(m21, m11);
|
|
37103
|
-
} else {
|
|
37104
|
-
this._x = 0;
|
|
37105
|
-
this._z = Math.atan2(-m12, m22);
|
|
37106
|
-
}
|
|
37107
|
-
break;
|
|
37108
|
-
case "YZX":
|
|
37109
|
-
this._z = Math.asin(clamp(m21, -1, 1));
|
|
37110
|
-
if (Math.abs(m21) < 0.9999999) {
|
|
37111
|
-
this._x = Math.atan2(-m23, m22);
|
|
37112
|
-
this._y = Math.atan2(-m31, m11);
|
|
37113
|
-
} else {
|
|
37114
|
-
this._x = 0;
|
|
37115
|
-
this._y = Math.atan2(m13, m33);
|
|
37116
|
-
}
|
|
37117
|
-
break;
|
|
37118
|
-
case "XZY":
|
|
37119
|
-
this._z = Math.asin(-clamp(m12, -1, 1));
|
|
37120
|
-
if (Math.abs(m12) < 0.9999999) {
|
|
37121
|
-
this._x = Math.atan2(m32, m22);
|
|
37122
|
-
this._y = Math.atan2(m13, m11);
|
|
37123
|
-
} else {
|
|
37124
|
-
this._x = Math.atan2(-m23, m33);
|
|
37125
|
-
this._y = 0;
|
|
37126
|
-
}
|
|
37127
|
-
break;
|
|
37128
|
-
default:
|
|
37129
|
-
console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: " + order);
|
|
37130
|
-
}
|
|
37131
|
-
this._order = order;
|
|
37132
|
-
if (update2 === true) this._onChangeCallback();
|
|
37133
|
-
return this;
|
|
37134
|
-
}
|
|
37135
|
-
setFromQuaternion(q, order, update2) {
|
|
37136
|
-
_matrix.makeRotationFromQuaternion(q);
|
|
37137
|
-
return this.setFromRotationMatrix(_matrix, order, update2);
|
|
37138
|
-
}
|
|
37139
|
-
setFromVector3(v, order = this._order) {
|
|
37140
|
-
return this.set(v.x, v.y, v.z, order);
|
|
37141
|
-
}
|
|
37142
|
-
reorder(newOrder) {
|
|
37143
|
-
_quaternion$3.setFromEuler(this);
|
|
37144
|
-
return this.setFromQuaternion(_quaternion$3, newOrder);
|
|
37145
|
-
}
|
|
37146
|
-
equals(euler) {
|
|
37147
|
-
return euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;
|
|
37148
|
-
}
|
|
37149
|
-
fromArray(array2) {
|
|
37150
|
-
this._x = array2[0];
|
|
37151
|
-
this._y = array2[1];
|
|
37152
|
-
this._z = array2[2];
|
|
37153
|
-
if (array2[3] !== void 0) this._order = array2[3];
|
|
37154
|
-
this._onChangeCallback();
|
|
37155
|
-
return this;
|
|
37156
|
-
}
|
|
37157
|
-
toArray(array2 = [], offset2 = 0) {
|
|
37158
|
-
array2[offset2] = this._x;
|
|
37159
|
-
array2[offset2 + 1] = this._y;
|
|
37160
|
-
array2[offset2 + 2] = this._z;
|
|
37161
|
-
array2[offset2 + 3] = this._order;
|
|
37162
|
-
return array2;
|
|
37163
|
-
}
|
|
37164
|
-
_onChange(callback) {
|
|
37165
|
-
this._onChangeCallback = callback;
|
|
37166
|
-
return this;
|
|
37167
|
-
}
|
|
37168
|
-
_onChangeCallback() {
|
|
37169
|
-
}
|
|
37170
|
-
*[Symbol.iterator]() {
|
|
37171
|
-
yield this._x;
|
|
37172
|
-
yield this._y;
|
|
37173
|
-
yield this._z;
|
|
37174
|
-
yield this._order;
|
|
37175
|
-
}
|
|
37176
|
-
}
|
|
37177
|
-
Euler.DEFAULT_ORDER = "XYZ";
|
|
37178
|
-
if (typeof __THREE_DEVTOOLS__ !== "undefined") {
|
|
37179
|
-
__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
|
|
37180
|
-
revision: REVISION
|
|
37181
|
-
} }));
|
|
37182
|
-
}
|
|
37183
|
-
if (typeof window !== "undefined") {
|
|
37184
|
-
if (window.__THREE__) {
|
|
37185
|
-
console.warn("WARNING: Multiple instances of Three.js being imported.");
|
|
37186
|
-
} else {
|
|
37187
|
-
window.__THREE__ = REVISION;
|
|
37188
|
-
}
|
|
37189
|
-
}
|
|
37190
34434
|
const EPSILON_KEYS_MAPPING_NG = {
|
|
37191
34435
|
projectionScale: 100,
|
|
37192
34436
|
projectionOrientation: 0.02,
|
|
@@ -37220,17 +34464,17 @@ const nearEq = (a, b, epsilon2) => Number.isFinite(a) && Number.isFinite(b) ? Ma
|
|
|
37220
34464
|
function diffCameraState(prev2, next2) {
|
|
37221
34465
|
const eps = EPSILON_KEYS_MAPPING_NG;
|
|
37222
34466
|
const scale = valueGreaterThanEpsilon(
|
|
37223
|
-
prev2
|
|
37224
|
-
next2
|
|
34467
|
+
prev2?.projectionScale,
|
|
34468
|
+
next2?.projectionScale,
|
|
37225
34469
|
eps.projectionScale
|
|
37226
34470
|
);
|
|
37227
|
-
const posHard = valueGreaterThanEpsilon(prev2
|
|
34471
|
+
const posHard = valueGreaterThanEpsilon(prev2?.position, next2?.position, eps.position);
|
|
37228
34472
|
const rot = valueGreaterThanEpsilon(
|
|
37229
|
-
prev2
|
|
37230
|
-
next2
|
|
34473
|
+
prev2?.projectionOrientation,
|
|
34474
|
+
next2?.projectionOrientation,
|
|
37231
34475
|
eps.projectionOrientation
|
|
37232
34476
|
);
|
|
37233
|
-
const posSoft = !posHard && scale && valueGreaterThanEpsilon(prev2
|
|
34477
|
+
const posSoft = !posHard && scale && valueGreaterThanEpsilon(prev2?.position, next2?.position, SOFT_POS_FACTOR);
|
|
37234
34478
|
const pos = posHard || posSoft;
|
|
37235
34479
|
return { changed: scale || pos || rot, scale, pos, rot };
|
|
37236
34480
|
}
|
|
@@ -37264,6 +34508,7 @@ const ZOOM_EPS = 0.01;
|
|
|
37264
34508
|
const ROTATION_EPS = 1e-3;
|
|
37265
34509
|
const TARGET_EPS = 0.5;
|
|
37266
34510
|
const NG_ROT_COOLDOWN_MS = 120;
|
|
34511
|
+
const GUIDE_URL = "https://vitessce.io/docs/ng-guide/";
|
|
37267
34512
|
const LAST_INTERACTION_SOURCE = {
|
|
37268
34513
|
vitessce: "vitessce",
|
|
37269
34514
|
neuroglancer: "neuroglancer"
|
|
@@ -37272,7 +34517,6 @@ function rgbToHex(rgb2) {
|
|
|
37272
34517
|
return typeof rgb2 === "string" ? rgb2 : `#${rgb2.map((c) => c.toString(16).padStart(2, "0")).join("")}`;
|
|
37273
34518
|
}
|
|
37274
34519
|
function NeuroglancerSubscriber(props) {
|
|
37275
|
-
var _a;
|
|
37276
34520
|
const {
|
|
37277
34521
|
uuid,
|
|
37278
34522
|
coordinationScopes: coordinationScopesRaw,
|
|
@@ -37469,12 +34713,10 @@ function NeuroglancerSubscriber(props) {
|
|
|
37469
34713
|
const { classes } = useStyles();
|
|
37470
34714
|
const segmentationColorMapping = useMemoCustomComparison(() => {
|
|
37471
34715
|
const result = {};
|
|
37472
|
-
segmentationLayerScopes
|
|
37473
|
-
var _a2;
|
|
34716
|
+
segmentationLayerScopes?.forEach((layerScope) => {
|
|
37474
34717
|
result[layerScope] = {};
|
|
37475
|
-
|
|
37476
|
-
|
|
37477
|
-
const { obsSets: layerSets, obsIndex: layerIndex } = ((_a3 = obsSegmentationsSetsData == null ? void 0 : obsSegmentationsSetsData[layerScope]) == null ? void 0 : _a3[channelScope]) || {};
|
|
34718
|
+
segmentationChannelScopesByLayer?.[layerScope]?.forEach((channelScope) => {
|
|
34719
|
+
const { obsSets: layerSets, obsIndex: layerIndex } = obsSegmentationsSetsData?.[layerScope]?.[channelScope] || {};
|
|
37478
34720
|
if (layerSets && layerIndex) {
|
|
37479
34721
|
const {
|
|
37480
34722
|
obsSetColor,
|
|
@@ -37637,11 +34879,10 @@ function NeuroglancerSubscriber(props) {
|
|
|
37637
34879
|
};
|
|
37638
34880
|
}, []);
|
|
37639
34881
|
const onSegmentClick = useCallback((value) => {
|
|
37640
|
-
var _a2;
|
|
37641
34882
|
if (value) {
|
|
37642
34883
|
const id = String(value);
|
|
37643
34884
|
const selectedCellIds = [id];
|
|
37644
|
-
const alreadySelectedId =
|
|
34885
|
+
const alreadySelectedId = cellSetSelection?.flat()?.some((sel) => sel.includes(id));
|
|
37645
34886
|
if (alreadySelectedId) {
|
|
37646
34887
|
return;
|
|
37647
34888
|
}
|
|
@@ -37665,18 +34906,14 @@ function NeuroglancerSubscriber(props) {
|
|
|
37665
34906
|
setCellSetColor,
|
|
37666
34907
|
setCellSetSelection
|
|
37667
34908
|
]);
|
|
37668
|
-
const cellColorMapping = useMemo(() => {
|
|
37669
|
-
var _a2, _b;
|
|
37670
|
-
return ((_b = segmentationColorMapping == null ? void 0 : segmentationColorMapping[segmentationLayerScopes == null ? void 0 : segmentationLayerScopes[0]]) == null ? void 0 : _b[(_a2 = segmentationChannelScopesByLayer == null ? void 0 : segmentationChannelScopesByLayer[segmentationLayerScopes == null ? void 0 : segmentationLayerScopes[0]]) == null ? void 0 : _a2[0]]) ?? {};
|
|
37671
|
-
}, [segmentationColorMapping]);
|
|
34909
|
+
const cellColorMapping = useMemo(() => segmentationColorMapping?.[segmentationLayerScopes?.[0]]?.[segmentationChannelScopesByLayer?.[segmentationLayerScopes?.[0]]?.[0]] ?? {}, [segmentationColorMapping]);
|
|
37672
34910
|
const derivedViewerState = useMemo(() => {
|
|
37673
|
-
var _a2, _b, _c, _d;
|
|
37674
34911
|
const { current } = latestViewerStateRef;
|
|
37675
34912
|
if (current.layers.length <= 0) {
|
|
37676
34913
|
return current;
|
|
37677
34914
|
}
|
|
37678
34915
|
const nextSegments = Object.keys(cellColorMapping);
|
|
37679
|
-
const prevLayer =
|
|
34916
|
+
const prevLayer = current?.layers?.[0] || {};
|
|
37680
34917
|
const prevSegments = prevLayer.segments || [];
|
|
37681
34918
|
const { projectionScale, projectionOrientation, position: position2 } = current;
|
|
37682
34919
|
const rotChangedNow = !nearEq(spatialRotationX, prevCoordsRef.current.rx, ROTATION_EPS) || !nearEq(spatialRotationY, prevCoordsRef.current.ry, ROTATION_EPS) || !nearEq(spatialRotationZ, prevCoordsRef.current.rz, ROTATION_EPS) || !nearEq(spatialRotationOrbit, prevCoordsRef.current.orbit, ROTATION_EPS);
|
|
@@ -37691,7 +34928,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
37691
34928
|
}
|
|
37692
34929
|
}
|
|
37693
34930
|
const [ox, oy, oz] = translationOffsetRef.current;
|
|
37694
|
-
const [px = 0, py = 0, pz =
|
|
34931
|
+
const [px = 0, py = 0, pz = current.position?.[2] ?? oz] = current.position || [];
|
|
37695
34932
|
const hasVitessceSpatialTarget = Number.isFinite(spatialTargetX) && Number.isFinite(spatialTargetY);
|
|
37696
34933
|
if (hasVitessceSpatialTarget && lastInteractionSource.current !== LAST_INTERACTION_SOURCE.neuroglancer && transChangedNow) {
|
|
37697
34934
|
const nx = spatialTargetX + ox;
|
|
@@ -37729,7 +34966,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
37729
34966
|
const [
|
|
37730
34967
|
cx = 0,
|
|
37731
34968
|
cy = 0,
|
|
37732
|
-
cz =
|
|
34969
|
+
cz = nextPosition?.[2] ?? current.position?.[2] ?? 0
|
|
37733
34970
|
] = nextPosition || current.position || [];
|
|
37734
34971
|
const tX = Number.isFinite(spatialTargetX) ? spatialTargetX : 0;
|
|
37735
34972
|
const tY = Number.isFinite(spatialTargetY) ? spatialTargetY : 0;
|
|
@@ -37752,7 +34989,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
37752
34989
|
projectionScale: nextProjectionScale,
|
|
37753
34990
|
projectionOrientation: nextOrientation,
|
|
37754
34991
|
position: nextPosition,
|
|
37755
|
-
layers: prevSegments.length === 0 ? [newLayer0, ...
|
|
34992
|
+
layers: prevSegments.length === 0 ? [newLayer0, ...current?.layers?.slice(1) || []] : current?.layers
|
|
37756
34993
|
};
|
|
37757
34994
|
latestViewerStateRef.current = updated;
|
|
37758
34995
|
prevCoordsRef.current = {
|
|
@@ -37779,7 +35016,7 @@ function NeuroglancerSubscriber(props) {
|
|
|
37779
35016
|
const onSegmentHighlight = useCallback((obsId) => {
|
|
37780
35017
|
setCellHighlight(String(obsId));
|
|
37781
35018
|
}, [setCellHighlight]);
|
|
37782
|
-
const hasLayers =
|
|
35019
|
+
const hasLayers = derivedViewerState?.layers?.length > 0;
|
|
37783
35020
|
return /* @__PURE__ */ React__default.createElement(
|
|
37784
35021
|
TitleInfo,
|
|
37785
35022
|
{
|
|
@@ -37793,7 +35030,8 @@ function NeuroglancerSubscriber(props) {
|
|
|
37793
35030
|
removeGridComponent,
|
|
37794
35031
|
isReady,
|
|
37795
35032
|
errors,
|
|
37796
|
-
withPadding: false
|
|
35033
|
+
withPadding: false,
|
|
35034
|
+
guideUrl: GUIDE_URL
|
|
37797
35035
|
},
|
|
37798
35036
|
/* @__PURE__ */ React__default.createElement("div", { style: { position: "relative", width: "100%", height: "100%" }, ref: containerRef }, /* @__PURE__ */ React__default.createElement("div", { style: { position: "absolute", top: 0, right: 0, zIndex: 50 } }, /* @__PURE__ */ React__default.createElement(
|
|
37799
35037
|
MultiLegend,
|