@tscircuit/3d-viewer 0.0.577 → 0.0.579
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/index.js +1359 -903
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13721,23 +13721,23 @@ var require_src = __commonJS({
|
|
|
13721
13721
|
var require_dist = __commonJS({
|
|
13722
13722
|
"node_modules/jscad-planner/dist/index.cjs"(exports, module) {
|
|
13723
13723
|
"use strict";
|
|
13724
|
-
var
|
|
13724
|
+
var __defProp25 = Object.defineProperty;
|
|
13725
13725
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
13726
13726
|
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
13727
13727
|
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
13728
13728
|
var __export2 = (target, all) => {
|
|
13729
13729
|
for (var name in all)
|
|
13730
|
-
|
|
13730
|
+
__defProp25(target, name, { get: all[name], enumerable: true });
|
|
13731
13731
|
};
|
|
13732
13732
|
var __copyProps2 = (to, from, except, desc) => {
|
|
13733
13733
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13734
13734
|
for (let key of __getOwnPropNames2(from))
|
|
13735
13735
|
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
13736
|
-
|
|
13736
|
+
__defProp25(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
|
|
13737
13737
|
}
|
|
13738
13738
|
return to;
|
|
13739
13739
|
};
|
|
13740
|
-
var __toCommonJS = (mod) => __copyProps2(
|
|
13740
|
+
var __toCommonJS = (mod) => __copyProps2(__defProp25({}, "__esModule", { value: true }), mod);
|
|
13741
13741
|
var lib_exports = {};
|
|
13742
13742
|
__export2(lib_exports, {
|
|
13743
13743
|
executeJscadOperations: () => executeJscadOperations3,
|
|
@@ -14432,7 +14432,7 @@ var require_browser = __commonJS({
|
|
|
14432
14432
|
});
|
|
14433
14433
|
|
|
14434
14434
|
// src/CadViewer.tsx
|
|
14435
|
-
import { useState as useState39, useCallback as useCallback25, useRef as
|
|
14435
|
+
import { useState as useState39, useCallback as useCallback25, useRef as useRef29, useEffect as useEffect48 } from "react";
|
|
14436
14436
|
import * as THREE46 from "three";
|
|
14437
14437
|
|
|
14438
14438
|
// src/CadViewerJscad.tsx
|
|
@@ -31245,9 +31245,9 @@ function getObjectBoundsRelativeToParent(object) {
|
|
|
31245
31245
|
node.geometry.computeBoundingBox();
|
|
31246
31246
|
}
|
|
31247
31247
|
if (node.geometry.boundingBox) {
|
|
31248
|
+
const localMatrix = parentInverseMatrix.clone().multiply(node.matrixWorld);
|
|
31248
31249
|
const transformedBounds = node.geometry.boundingBox.clone();
|
|
31249
|
-
transformedBounds.applyMatrix4(
|
|
31250
|
-
transformedBounds.applyMatrix4(parentInverseMatrix);
|
|
31250
|
+
transformedBounds.applyMatrix4(localMatrix);
|
|
31251
31251
|
if (!hasBounds) {
|
|
31252
31252
|
bounds.copy(transformedBounds);
|
|
31253
31253
|
hasBounds = true;
|
|
@@ -32710,7 +32710,7 @@ import * as THREE21 from "three";
|
|
|
32710
32710
|
// package.json
|
|
32711
32711
|
var package_default = {
|
|
32712
32712
|
name: "@tscircuit/3d-viewer",
|
|
32713
|
-
version: "0.0.
|
|
32713
|
+
version: "0.0.578",
|
|
32714
32714
|
main: "./dist/index.js",
|
|
32715
32715
|
module: "./dist/index.js",
|
|
32716
32716
|
type: "module",
|
|
@@ -33692,16 +33692,11 @@ function computePointInFront(rotationVector, distance5) {
|
|
|
33692
33692
|
var OrientationCubeCanvas = () => {
|
|
33693
33693
|
const { mainCameraRef } = useCameraController();
|
|
33694
33694
|
const containerRef = useRef7(null);
|
|
33695
|
-
const canvasRef = useRef7(null);
|
|
33696
|
-
const rendererRef = useRef7(null);
|
|
33697
|
-
const sceneRef = useRef7(null);
|
|
33698
|
-
const cameraRef = useRef7(null);
|
|
33699
|
-
const animationFrameRef = useRef7(null);
|
|
33700
33695
|
useEffect18(() => {
|
|
33701
33696
|
if (!containerRef.current) return;
|
|
33697
|
+
const container = containerRef.current;
|
|
33702
33698
|
const canvas = document.createElement("canvas");
|
|
33703
|
-
|
|
33704
|
-
containerRef.current.appendChild(canvas);
|
|
33699
|
+
container.appendChild(canvas);
|
|
33705
33700
|
const renderer = new THREE20.WebGLRenderer({
|
|
33706
33701
|
canvas,
|
|
33707
33702
|
antialias: true,
|
|
@@ -33709,12 +33704,9 @@ var OrientationCubeCanvas = () => {
|
|
|
33709
33704
|
});
|
|
33710
33705
|
renderer.setSize(120, 120);
|
|
33711
33706
|
renderer.setPixelRatio(window.devicePixelRatio);
|
|
33712
|
-
rendererRef.current = renderer;
|
|
33713
33707
|
const scene = new THREE20.Scene();
|
|
33714
|
-
sceneRef.current = scene;
|
|
33715
33708
|
const camera = new THREE20.PerspectiveCamera(75, 1, 0.1, 1e3);
|
|
33716
33709
|
camera.up.set(0, 0, 1);
|
|
33717
|
-
cameraRef.current = camera;
|
|
33718
33710
|
const ambientLight = new THREE20.AmbientLight(16777215, Math.PI / 2);
|
|
33719
33711
|
scene.add(ambientLight);
|
|
33720
33712
|
const group = new THREE20.Group();
|
|
@@ -33780,6 +33772,7 @@ var OrientationCubeCanvas = () => {
|
|
|
33780
33772
|
group.add(leftText);
|
|
33781
33773
|
group.add(topText);
|
|
33782
33774
|
group.add(bottomText);
|
|
33775
|
+
let animationFrameId = null;
|
|
33783
33776
|
const animate = () => {
|
|
33784
33777
|
if (mainCameraRef.current) {
|
|
33785
33778
|
const cameraPosition = computePointInFront(
|
|
@@ -33792,12 +33785,13 @@ var OrientationCubeCanvas = () => {
|
|
|
33792
33785
|
}
|
|
33793
33786
|
}
|
|
33794
33787
|
renderer.render(scene, camera);
|
|
33795
|
-
|
|
33788
|
+
animationFrameId = requestAnimationFrame(animate);
|
|
33796
33789
|
};
|
|
33797
33790
|
animate();
|
|
33798
33791
|
return () => {
|
|
33799
|
-
|
|
33800
|
-
|
|
33792
|
+
canvas.remove();
|
|
33793
|
+
if (animationFrameId !== null) {
|
|
33794
|
+
cancelAnimationFrame(animationFrameId);
|
|
33801
33795
|
}
|
|
33802
33796
|
frontText.dispose();
|
|
33803
33797
|
backText.dispose();
|
|
@@ -33812,9 +33806,6 @@ var OrientationCubeCanvas = () => {
|
|
|
33812
33806
|
scene.clear();
|
|
33813
33807
|
renderer.dispose();
|
|
33814
33808
|
renderer.forceContextLoss();
|
|
33815
|
-
if (canvasRef.current && containerRef.current) {
|
|
33816
|
-
containerRef.current.removeChild(canvasRef.current);
|
|
33817
|
-
}
|
|
33818
33809
|
};
|
|
33819
33810
|
}, [mainCameraRef]);
|
|
33820
33811
|
return /* @__PURE__ */ jsx14(
|
|
@@ -40022,18 +40013,61 @@ import { useState as useState37 } from "react";
|
|
|
40022
40013
|
import * as React44 from "react";
|
|
40023
40014
|
|
|
40024
40015
|
// node_modules/@radix-ui/primitive/dist/index.mjs
|
|
40016
|
+
var __defProp3 = Object.defineProperty;
|
|
40017
|
+
var __name = (target, value) => __defProp3(target, "name", { value, configurable: true });
|
|
40025
40018
|
var canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement);
|
|
40026
40019
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
40027
|
-
return function handleEvent(event) {
|
|
40020
|
+
return /* @__PURE__ */ __name(function handleEvent(event) {
|
|
40028
40021
|
originalEventHandler?.(event);
|
|
40029
40022
|
if (checkForDefaultPrevented === false || !event || !event.defaultPrevented) {
|
|
40030
40023
|
return ourEventHandler?.(event);
|
|
40031
40024
|
}
|
|
40032
|
-
};
|
|
40025
|
+
}, "handleEvent");
|
|
40026
|
+
}
|
|
40027
|
+
__name(composeEventHandlers, "composeEventHandlers");
|
|
40028
|
+
function getOwnerWindow(element) {
|
|
40029
|
+
if (!canUseDOM) {
|
|
40030
|
+
throw new Error("Cannot access window outside of the DOM");
|
|
40031
|
+
}
|
|
40032
|
+
return element?.ownerDocument?.defaultView ?? window;
|
|
40033
|
+
}
|
|
40034
|
+
__name(getOwnerWindow, "getOwnerWindow");
|
|
40035
|
+
function getOwnerDocument(element) {
|
|
40036
|
+
if (!canUseDOM) {
|
|
40037
|
+
throw new Error("Cannot access document outside of the DOM");
|
|
40038
|
+
}
|
|
40039
|
+
return element?.ownerDocument ?? document;
|
|
40040
|
+
}
|
|
40041
|
+
__name(getOwnerDocument, "getOwnerDocument");
|
|
40042
|
+
function getActiveElement(node, activeDescendant = false) {
|
|
40043
|
+
const { activeElement } = getOwnerDocument(node);
|
|
40044
|
+
if (!activeElement?.nodeName) {
|
|
40045
|
+
return null;
|
|
40046
|
+
}
|
|
40047
|
+
if (isFrame(activeElement) && activeElement.contentDocument) {
|
|
40048
|
+
return getActiveElement(activeElement.contentDocument.body, activeDescendant);
|
|
40049
|
+
}
|
|
40050
|
+
if (activeDescendant) {
|
|
40051
|
+
const id = activeElement.getAttribute("aria-activedescendant");
|
|
40052
|
+
if (id) {
|
|
40053
|
+
const element = getOwnerDocument(activeElement).getElementById(id);
|
|
40054
|
+
if (element) {
|
|
40055
|
+
return element;
|
|
40056
|
+
}
|
|
40057
|
+
}
|
|
40058
|
+
}
|
|
40059
|
+
return activeElement;
|
|
40060
|
+
}
|
|
40061
|
+
__name(getActiveElement, "getActiveElement");
|
|
40062
|
+
function isFrame(element) {
|
|
40063
|
+
return element.tagName === "IFRAME";
|
|
40033
40064
|
}
|
|
40065
|
+
__name(isFrame, "isFrame");
|
|
40034
40066
|
|
|
40035
40067
|
// node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
40036
40068
|
import * as React13 from "react";
|
|
40069
|
+
var __defProp4 = Object.defineProperty;
|
|
40070
|
+
var __name2 = (target, value) => __defProp4(target, "name", { value, configurable: true });
|
|
40037
40071
|
function setRef(ref, value) {
|
|
40038
40072
|
if (typeof ref === "function") {
|
|
40039
40073
|
return ref(value);
|
|
@@ -40041,6 +40075,7 @@ function setRef(ref, value) {
|
|
|
40041
40075
|
ref.current = value;
|
|
40042
40076
|
}
|
|
40043
40077
|
}
|
|
40078
|
+
__name2(setRef, "setRef");
|
|
40044
40079
|
function composeRefs(...refs) {
|
|
40045
40080
|
return (node) => {
|
|
40046
40081
|
let hasCleanup = false;
|
|
@@ -40065,13 +40100,40 @@ function composeRefs(...refs) {
|
|
|
40065
40100
|
}
|
|
40066
40101
|
};
|
|
40067
40102
|
}
|
|
40103
|
+
__name2(composeRefs, "composeRefs");
|
|
40068
40104
|
function useComposedRefs(...refs) {
|
|
40069
40105
|
return React13.useCallback(composeRefs(...refs), refs);
|
|
40070
40106
|
}
|
|
40107
|
+
__name2(useComposedRefs, "useComposedRefs");
|
|
40071
40108
|
|
|
40072
40109
|
// node_modules/@radix-ui/react-context/dist/index.mjs
|
|
40073
40110
|
import * as React14 from "react";
|
|
40074
40111
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
40112
|
+
var __defProp5 = Object.defineProperty;
|
|
40113
|
+
var __name3 = (target, value) => __defProp5(target, "name", { value, configurable: true });
|
|
40114
|
+
// @__NO_SIDE_EFFECTS__
|
|
40115
|
+
function createContext22(rootComponentName, defaultContext) {
|
|
40116
|
+
const Context = React14.createContext(defaultContext);
|
|
40117
|
+
Context.displayName = rootComponentName + "Context";
|
|
40118
|
+
const Provider = /* @__PURE__ */ __name3((props) => {
|
|
40119
|
+
const { children, ...context } = props;
|
|
40120
|
+
const value = React14.useMemo(() => context, Object.values(context));
|
|
40121
|
+
return /* @__PURE__ */ jsx21(Context.Provider, { value, children });
|
|
40122
|
+
}, "Provider");
|
|
40123
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
40124
|
+
function useContext22(consumerName, options = {}) {
|
|
40125
|
+
const { optional = false } = options;
|
|
40126
|
+
const context = React14.useContext(Context);
|
|
40127
|
+
if (context) return context;
|
|
40128
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
40129
|
+
if (optional) return void 0;
|
|
40130
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
40131
|
+
}
|
|
40132
|
+
__name3(useContext22, "useContext");
|
|
40133
|
+
return [Provider, useContext22];
|
|
40134
|
+
}
|
|
40135
|
+
__name3(createContext22, "createContext");
|
|
40136
|
+
// @__NO_SIDE_EFFECTS__
|
|
40075
40137
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
40076
40138
|
let defaultContexts = [];
|
|
40077
40139
|
function createContext32(rootComponentName, defaultContext) {
|
|
@@ -40079,12 +40141,12 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
40079
40141
|
BaseContext.displayName = rootComponentName + "Context";
|
|
40080
40142
|
const index2 = defaultContexts.length;
|
|
40081
40143
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
40082
|
-
const Provider = (props) => {
|
|
40144
|
+
const Provider = /* @__PURE__ */ __name3((props) => {
|
|
40083
40145
|
const { scope, children, ...context } = props;
|
|
40084
40146
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
40085
40147
|
const value = React14.useMemo(() => context, Object.values(context));
|
|
40086
40148
|
return /* @__PURE__ */ jsx21(Context.Provider, { value, children });
|
|
40087
|
-
};
|
|
40149
|
+
}, "Provider");
|
|
40088
40150
|
Provider.displayName = rootComponentName + "Provider";
|
|
40089
40151
|
function useContext22(consumerName, scope, options = {}) {
|
|
40090
40152
|
const { optional = false } = options;
|
|
@@ -40095,46 +40157,53 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
40095
40157
|
if (optional) return void 0;
|
|
40096
40158
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
40097
40159
|
}
|
|
40160
|
+
__name3(useContext22, "useContext");
|
|
40098
40161
|
return [Provider, useContext22];
|
|
40099
40162
|
}
|
|
40100
|
-
|
|
40163
|
+
__name3(createContext32, "createContext");
|
|
40164
|
+
const createScope = /* @__PURE__ */ __name3(() => {
|
|
40101
40165
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
40102
40166
|
return React14.createContext(defaultContext);
|
|
40103
40167
|
});
|
|
40104
|
-
return function useScope(scope) {
|
|
40168
|
+
return /* @__PURE__ */ __name3(function useScope(scope) {
|
|
40105
40169
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
40106
40170
|
return React14.useMemo(
|
|
40107
40171
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
40108
40172
|
[scope, contexts]
|
|
40109
40173
|
);
|
|
40110
|
-
};
|
|
40111
|
-
};
|
|
40174
|
+
}, "useScope");
|
|
40175
|
+
}, "createScope");
|
|
40112
40176
|
createScope.scopeName = scopeName;
|
|
40113
40177
|
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
40114
40178
|
}
|
|
40179
|
+
__name3(createContextScope, "createContextScope");
|
|
40115
40180
|
function composeContextScopes(...scopes) {
|
|
40116
40181
|
const baseScope = scopes[0];
|
|
40117
40182
|
if (scopes.length === 1) return baseScope;
|
|
40118
|
-
const createScope = () => {
|
|
40183
|
+
const createScope = /* @__PURE__ */ __name3(() => {
|
|
40119
40184
|
const scopeHooks = scopes.map((createScope2) => ({
|
|
40120
40185
|
useScope: createScope2(),
|
|
40121
40186
|
scopeName: createScope2.scopeName
|
|
40122
40187
|
}));
|
|
40123
|
-
return function useComposedScopes(overrideScopes) {
|
|
40188
|
+
return /* @__PURE__ */ __name3(function useComposedScopes(overrideScopes) {
|
|
40124
40189
|
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
40125
40190
|
const scopeProps = useScope(overrideScopes);
|
|
40126
40191
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
40127
40192
|
return { ...nextScopes2, ...currentScope };
|
|
40128
40193
|
}, {});
|
|
40129
40194
|
return React14.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
40130
|
-
};
|
|
40131
|
-
};
|
|
40195
|
+
}, "useComposedScopes");
|
|
40196
|
+
}, "createScope");
|
|
40132
40197
|
createScope.scopeName = baseScope.scopeName;
|
|
40133
40198
|
return createScope;
|
|
40134
40199
|
}
|
|
40200
|
+
__name3(composeContextScopes, "composeContextScopes");
|
|
40135
40201
|
|
|
40136
40202
|
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
40137
|
-
import * as
|
|
40203
|
+
import * as React17 from "react";
|
|
40204
|
+
|
|
40205
|
+
// node_modules/@radix-ui/primitive/dist/internal/is-development.false.mjs
|
|
40206
|
+
var IS_DEVELOPMENT = false;
|
|
40138
40207
|
|
|
40139
40208
|
// node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
40140
40209
|
import * as React15 from "react";
|
|
@@ -40143,12 +40212,42 @@ var useLayoutEffect2 = globalThis?.document ? React15.useLayoutEffect : () => {
|
|
|
40143
40212
|
|
|
40144
40213
|
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
40145
40214
|
import * as React22 from "react";
|
|
40146
|
-
|
|
40215
|
+
|
|
40216
|
+
// node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
40217
|
+
import * as React16 from "react";
|
|
40218
|
+
var __defProp6 = Object.defineProperty;
|
|
40219
|
+
var __name4 = (target, value) => __defProp6(target, "name", { value, configurable: true });
|
|
40220
|
+
var useReactEffectEvent = React16[" useEffectEvent ".trim().toString()];
|
|
40221
|
+
var useReactInsertionEffect = React16[" useInsertionEffect ".trim().toString()];
|
|
40222
|
+
function useEffectEvent(callback) {
|
|
40223
|
+
if (typeof useReactEffectEvent === "function") {
|
|
40224
|
+
return useReactEffectEvent(callback);
|
|
40225
|
+
}
|
|
40226
|
+
const ref = React16.useRef(() => {
|
|
40227
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
40228
|
+
});
|
|
40229
|
+
if (typeof useReactInsertionEffect === "function") {
|
|
40230
|
+
useReactInsertionEffect(() => {
|
|
40231
|
+
ref.current = callback;
|
|
40232
|
+
});
|
|
40233
|
+
} else {
|
|
40234
|
+
useLayoutEffect2(() => {
|
|
40235
|
+
ref.current = callback;
|
|
40236
|
+
});
|
|
40237
|
+
}
|
|
40238
|
+
return React16.useMemo(() => ((...args) => ref.current?.(...args)), []);
|
|
40239
|
+
}
|
|
40240
|
+
__name4(useEffectEvent, "useEffectEvent");
|
|
40241
|
+
|
|
40242
|
+
// node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
40243
|
+
var __defProp7 = Object.defineProperty;
|
|
40244
|
+
var __name5 = (target, value) => __defProp7(target, "name", { value, configurable: true });
|
|
40245
|
+
var useInsertionEffect = React17[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
40147
40246
|
function useControllableState({
|
|
40148
40247
|
prop,
|
|
40149
40248
|
defaultProp,
|
|
40150
|
-
onChange = () => {
|
|
40151
|
-
},
|
|
40249
|
+
onChange = /* @__PURE__ */ __name5(() => {
|
|
40250
|
+
}, "onChange"),
|
|
40152
40251
|
caller
|
|
40153
40252
|
}) {
|
|
40154
40253
|
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
@@ -40157,9 +40256,9 @@ function useControllableState({
|
|
|
40157
40256
|
});
|
|
40158
40257
|
const isControlled = prop !== void 0;
|
|
40159
40258
|
const value = isControlled ? prop : uncontrolledProp;
|
|
40160
|
-
if (
|
|
40161
|
-
const isControlledRef =
|
|
40162
|
-
|
|
40259
|
+
if (IS_DEVELOPMENT) {
|
|
40260
|
+
const isControlledRef = React17.useRef(prop !== void 0);
|
|
40261
|
+
React17.useEffect(() => {
|
|
40163
40262
|
const wasControlled = isControlledRef.current;
|
|
40164
40263
|
if (wasControlled !== isControlled) {
|
|
40165
40264
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -40171,7 +40270,7 @@ function useControllableState({
|
|
|
40171
40270
|
isControlledRef.current = isControlled;
|
|
40172
40271
|
}, [isControlled, caller]);
|
|
40173
40272
|
}
|
|
40174
|
-
const setValue =
|
|
40273
|
+
const setValue = React17.useCallback(
|
|
40175
40274
|
(nextValue) => {
|
|
40176
40275
|
if (isControlled) {
|
|
40177
40276
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -40186,17 +40285,18 @@ function useControllableState({
|
|
|
40186
40285
|
);
|
|
40187
40286
|
return [value, setValue];
|
|
40188
40287
|
}
|
|
40288
|
+
__name5(useControllableState, "useControllableState");
|
|
40189
40289
|
function useUncontrolledState({
|
|
40190
40290
|
defaultProp,
|
|
40191
40291
|
onChange
|
|
40192
40292
|
}) {
|
|
40193
|
-
const [value, setValue] =
|
|
40194
|
-
const prevValueRef =
|
|
40195
|
-
const onChangeRef =
|
|
40293
|
+
const [value, setValue] = React17.useState(defaultProp);
|
|
40294
|
+
const prevValueRef = React17.useRef(value);
|
|
40295
|
+
const onChangeRef = React17.useRef(onChange);
|
|
40196
40296
|
useInsertionEffect(() => {
|
|
40197
40297
|
onChangeRef.current = onChange;
|
|
40198
40298
|
}, [onChange]);
|
|
40199
|
-
|
|
40299
|
+
React17.useEffect(() => {
|
|
40200
40300
|
if (prevValueRef.current !== value) {
|
|
40201
40301
|
onChangeRef.current?.(value);
|
|
40202
40302
|
prevValueRef.current = value;
|
|
@@ -40204,19 +40304,84 @@ function useUncontrolledState({
|
|
|
40204
40304
|
}, [value, prevValueRef]);
|
|
40205
40305
|
return [value, setValue, onChangeRef];
|
|
40206
40306
|
}
|
|
40307
|
+
__name5(useUncontrolledState, "useUncontrolledState");
|
|
40207
40308
|
function isFunction(value) {
|
|
40208
40309
|
return typeof value === "function";
|
|
40209
40310
|
}
|
|
40311
|
+
__name5(isFunction, "isFunction");
|
|
40312
|
+
var SYNC_STATE = /* @__PURE__ */ Symbol("RADIX:SYNC_STATE");
|
|
40313
|
+
function useControllableStateReducer(reducer, userArgs, initialArg, init) {
|
|
40314
|
+
const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;
|
|
40315
|
+
const isControlled = controlledState !== void 0;
|
|
40316
|
+
const onChange = useEffectEvent(onChangeProp);
|
|
40317
|
+
if (IS_DEVELOPMENT) {
|
|
40318
|
+
const isControlledRef = React22.useRef(controlledState !== void 0);
|
|
40319
|
+
React22.useEffect(() => {
|
|
40320
|
+
const wasControlled = isControlledRef.current;
|
|
40321
|
+
if (wasControlled !== isControlled) {
|
|
40322
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
40323
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
40324
|
+
console.warn(
|
|
40325
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
40326
|
+
);
|
|
40327
|
+
}
|
|
40328
|
+
isControlledRef.current = isControlled;
|
|
40329
|
+
}, [isControlled, caller]);
|
|
40330
|
+
}
|
|
40331
|
+
const args = [{ ...initialArg, state: defaultProp }];
|
|
40332
|
+
if (init) {
|
|
40333
|
+
args.push(init);
|
|
40334
|
+
}
|
|
40335
|
+
const [internalState, dispatch] = React22.useReducer(
|
|
40336
|
+
(state2, action) => {
|
|
40337
|
+
if (action.type === SYNC_STATE) {
|
|
40338
|
+
return { ...state2, state: action.state };
|
|
40339
|
+
}
|
|
40340
|
+
const next = reducer(state2, action);
|
|
40341
|
+
if (isControlled && !Object.is(next.state, state2.state)) {
|
|
40342
|
+
onChange(next.state);
|
|
40343
|
+
}
|
|
40344
|
+
return next;
|
|
40345
|
+
},
|
|
40346
|
+
...args
|
|
40347
|
+
);
|
|
40348
|
+
const uncontrolledState = internalState.state;
|
|
40349
|
+
const prevValueRef = React22.useRef(uncontrolledState);
|
|
40350
|
+
React22.useEffect(() => {
|
|
40351
|
+
if (prevValueRef.current !== uncontrolledState) {
|
|
40352
|
+
prevValueRef.current = uncontrolledState;
|
|
40353
|
+
if (!isControlled) {
|
|
40354
|
+
onChange(uncontrolledState);
|
|
40355
|
+
}
|
|
40356
|
+
}
|
|
40357
|
+
}, [uncontrolledState, prevValueRef, isControlled]);
|
|
40358
|
+
const state = React22.useMemo(() => {
|
|
40359
|
+
const isControlled2 = controlledState !== void 0;
|
|
40360
|
+
if (isControlled2) {
|
|
40361
|
+
return { ...internalState, state: controlledState };
|
|
40362
|
+
}
|
|
40363
|
+
return internalState;
|
|
40364
|
+
}, [internalState, controlledState]);
|
|
40365
|
+
React22.useEffect(() => {
|
|
40366
|
+
if (isControlled && !Object.is(controlledState, internalState.state)) {
|
|
40367
|
+
dispatch({ type: SYNC_STATE, state: controlledState });
|
|
40368
|
+
}
|
|
40369
|
+
}, [controlledState, internalState.state, isControlled]);
|
|
40370
|
+
return [state, dispatch];
|
|
40371
|
+
}
|
|
40372
|
+
__name5(useControllableStateReducer, "useControllableStateReducer");
|
|
40210
40373
|
|
|
40211
40374
|
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
40212
|
-
import * as
|
|
40375
|
+
import * as React19 from "react";
|
|
40213
40376
|
import * as ReactDOM2 from "react-dom";
|
|
40214
40377
|
|
|
40215
40378
|
// node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
40216
|
-
import * as
|
|
40379
|
+
import * as React18 from "react";
|
|
40380
|
+
var __defProp8 = Object.defineProperty;
|
|
40381
|
+
var __name6 = (target, value) => __defProp8(target, "name", { value, configurable: true });
|
|
40217
40382
|
// @__NO_SIDE_EFFECTS__
|
|
40218
40383
|
function createSlot(ownerName) {
|
|
40219
|
-
const Slot2 =
|
|
40384
|
+
const Slot2 = React18.forwardRef((props, forwardedRef) => {
|
|
40220
40385
|
let { children, ...slotProps } = props;
|
|
40221
40386
|
let slottableElement = null;
|
|
40222
40387
|
let hasSlottable = false;
|
|
@@ -40224,7 +40389,7 @@ function createSlot(ownerName) {
|
|
|
40224
40389
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
40225
40390
|
children = use(children._payload);
|
|
40226
40391
|
}
|
|
40227
|
-
|
|
40392
|
+
React18.Children.forEach(children, (maybeSlottable) => {
|
|
40228
40393
|
if (isSlottable(maybeSlottable)) {
|
|
40229
40394
|
hasSlottable = true;
|
|
40230
40395
|
const slottable = maybeSlottable;
|
|
@@ -40239,13 +40404,13 @@ function createSlot(ownerName) {
|
|
|
40239
40404
|
}
|
|
40240
40405
|
});
|
|
40241
40406
|
if (slottableElement) {
|
|
40242
|
-
slottableElement =
|
|
40407
|
+
slottableElement = React18.cloneElement(slottableElement, void 0, newChildren);
|
|
40243
40408
|
} else if (
|
|
40244
40409
|
// A `Slottable` was found but it didn't resolve to a single element (e.g.
|
|
40245
40410
|
// it wrapped multiple elements, text, or a render-prop `child` that
|
|
40246
40411
|
// wasn't an element). Don't fall back to treating the `Slottable` wrapper
|
|
40247
40412
|
// itself as the slot target — throw a descriptive error below instead.
|
|
40248
|
-
!hasSlottable &&
|
|
40413
|
+
!hasSlottable && React18.Children.count(children) === 1 && React18.isValidElement(children)
|
|
40249
40414
|
) {
|
|
40250
40415
|
slottableElement = children;
|
|
40251
40416
|
}
|
|
@@ -40260,23 +40425,32 @@ function createSlot(ownerName) {
|
|
|
40260
40425
|
return children;
|
|
40261
40426
|
}
|
|
40262
40427
|
const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
|
|
40263
|
-
if (slottableElement.type !==
|
|
40428
|
+
if (slottableElement.type !== React18.Fragment) {
|
|
40264
40429
|
mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
|
|
40265
40430
|
}
|
|
40266
|
-
return
|
|
40431
|
+
return React18.cloneElement(slottableElement, mergedProps);
|
|
40267
40432
|
});
|
|
40268
40433
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
40269
40434
|
return Slot2;
|
|
40270
40435
|
}
|
|
40436
|
+
__name6(createSlot, "createSlot");
|
|
40271
40437
|
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol.for("radix.slottable");
|
|
40272
|
-
|
|
40438
|
+
// @__NO_SIDE_EFFECTS__
|
|
40439
|
+
function createSlottable(ownerName) {
|
|
40440
|
+
const Slottable2 = /* @__PURE__ */ __name6((props) => "child" in props ? props.children(props.child) : props.children, "Slottable");
|
|
40441
|
+
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
40442
|
+
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
40443
|
+
return Slottable2;
|
|
40444
|
+
}
|
|
40445
|
+
__name6(createSlottable, "createSlottable");
|
|
40446
|
+
var getSlottableElementFromSlottable = /* @__PURE__ */ __name6((slottable, child) => {
|
|
40273
40447
|
if ("child" in slottable.props) {
|
|
40274
40448
|
const child2 = slottable.props.child;
|
|
40275
|
-
if (!
|
|
40276
|
-
return
|
|
40449
|
+
if (!React18.isValidElement(child2)) return null;
|
|
40450
|
+
return React18.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
|
|
40277
40451
|
}
|
|
40278
|
-
return
|
|
40279
|
-
};
|
|
40452
|
+
return React18.isValidElement(child) ? child : null;
|
|
40453
|
+
}, "getSlottableElementFromSlottable");
|
|
40280
40454
|
function mergeProps(slotProps, childProps) {
|
|
40281
40455
|
const overrideProps = { ...childProps };
|
|
40282
40456
|
for (const propName in childProps) {
|
|
@@ -40301,6 +40475,7 @@ function mergeProps(slotProps, childProps) {
|
|
|
40301
40475
|
}
|
|
40302
40476
|
return { ...slotProps, ...overrideProps };
|
|
40303
40477
|
}
|
|
40478
|
+
__name6(mergeProps, "mergeProps");
|
|
40304
40479
|
function getElementRef(element) {
|
|
40305
40480
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
40306
40481
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -40314,26 +40489,32 @@ function getElementRef(element) {
|
|
|
40314
40489
|
}
|
|
40315
40490
|
return element.props.ref || element.ref;
|
|
40316
40491
|
}
|
|
40492
|
+
__name6(getElementRef, "getElementRef");
|
|
40317
40493
|
function isSlottable(child) {
|
|
40318
|
-
return
|
|
40494
|
+
return React18.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
40319
40495
|
}
|
|
40496
|
+
__name6(isSlottable, "isSlottable");
|
|
40320
40497
|
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
40321
40498
|
function isLazyComponent(element) {
|
|
40322
40499
|
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
40323
40500
|
}
|
|
40501
|
+
__name6(isLazyComponent, "isLazyComponent");
|
|
40324
40502
|
function isPromiseLike(value) {
|
|
40325
40503
|
return typeof value === "object" && value !== null && "then" in value;
|
|
40326
40504
|
}
|
|
40327
|
-
|
|
40505
|
+
__name6(isPromiseLike, "isPromiseLike");
|
|
40506
|
+
var createSlotError = /* @__PURE__ */ __name6((ownerName) => {
|
|
40328
40507
|
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
|
|
40329
|
-
};
|
|
40330
|
-
var createSlottableError = (ownerName) => {
|
|
40508
|
+
}, "createSlotError");
|
|
40509
|
+
var createSlottableError = /* @__PURE__ */ __name6((ownerName) => {
|
|
40331
40510
|
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
|
|
40332
|
-
};
|
|
40333
|
-
var use =
|
|
40511
|
+
}, "createSlottableError");
|
|
40512
|
+
var use = React18[" use ".trim().toString()];
|
|
40334
40513
|
|
|
40335
40514
|
// node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
40336
40515
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
40516
|
+
var __defProp9 = Object.defineProperty;
|
|
40517
|
+
var __name7 = (target, value) => __defProp9(target, "name", { value, configurable: true });
|
|
40337
40518
|
var NODES = [
|
|
40338
40519
|
"a",
|
|
40339
40520
|
"button",
|
|
@@ -40355,7 +40536,7 @@ var NODES = [
|
|
|
40355
40536
|
];
|
|
40356
40537
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
40357
40538
|
const Slot2 = createSlot(`Primitive.${node}`);
|
|
40358
|
-
const Node2 =
|
|
40539
|
+
const Node2 = React19.forwardRef((props, forwardedRef) => {
|
|
40359
40540
|
const { asChild, ...primitiveProps } = props;
|
|
40360
40541
|
const Comp = asChild ? Slot2 : node;
|
|
40361
40542
|
if (typeof window !== "undefined") {
|
|
@@ -40369,15 +40550,19 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
40369
40550
|
function dispatchDiscreteCustomEvent(target, event) {
|
|
40370
40551
|
if (target) ReactDOM2.flushSync(() => target.dispatchEvent(event));
|
|
40371
40552
|
}
|
|
40553
|
+
__name7(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
40372
40554
|
|
|
40373
40555
|
// node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
40374
40556
|
import * as React43 from "react";
|
|
40375
40557
|
|
|
40376
40558
|
// node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
40377
|
-
import * as
|
|
40559
|
+
import * as React20 from "react";
|
|
40378
40560
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
40379
40561
|
import * as React23 from "react";
|
|
40380
40562
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
40563
|
+
var __defProp10 = Object.defineProperty;
|
|
40564
|
+
var __name8 = (target, value) => __defProp10(target, "name", { value, configurable: true });
|
|
40565
|
+
// @__NO_SIDE_EFFECTS__
|
|
40381
40566
|
function createCollection(name) {
|
|
40382
40567
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
40383
40568
|
const [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME);
|
|
@@ -40385,16 +40570,16 @@ function createCollection(name) {
|
|
|
40385
40570
|
PROVIDER_NAME,
|
|
40386
40571
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
40387
40572
|
);
|
|
40388
|
-
const CollectionProvider = (props) => {
|
|
40573
|
+
const CollectionProvider = /* @__PURE__ */ __name8((props) => {
|
|
40389
40574
|
const { scope, children } = props;
|
|
40390
|
-
const ref =
|
|
40391
|
-
const itemMap =
|
|
40575
|
+
const ref = React20.useRef(null);
|
|
40576
|
+
const itemMap = React20.useRef(/* @__PURE__ */ new Map()).current;
|
|
40392
40577
|
return /* @__PURE__ */ jsx23(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
40393
|
-
};
|
|
40578
|
+
}, "CollectionProvider");
|
|
40394
40579
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
40395
40580
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
40396
40581
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
40397
|
-
const CollectionSlot =
|
|
40582
|
+
const CollectionSlot = React20.forwardRef(
|
|
40398
40583
|
(props, forwardedRef) => {
|
|
40399
40584
|
const { scope, children } = props;
|
|
40400
40585
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -40406,13 +40591,13 @@ function createCollection(name) {
|
|
|
40406
40591
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
40407
40592
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
40408
40593
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
40409
|
-
const CollectionItemSlot =
|
|
40594
|
+
const CollectionItemSlot = React20.forwardRef(
|
|
40410
40595
|
(props, forwardedRef) => {
|
|
40411
40596
|
const { scope, children, ...itemData } = props;
|
|
40412
|
-
const ref =
|
|
40597
|
+
const ref = React20.useRef(null);
|
|
40413
40598
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
40414
40599
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
40415
|
-
|
|
40600
|
+
React20.useEffect(() => {
|
|
40416
40601
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
40417
40602
|
return () => void context.itemMap.delete(ref);
|
|
40418
40603
|
});
|
|
@@ -40422,7 +40607,7 @@ function createCollection(name) {
|
|
|
40422
40607
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
40423
40608
|
function useCollection3(scope) {
|
|
40424
40609
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
40425
|
-
const getItems =
|
|
40610
|
+
const getItems = React20.useCallback(() => {
|
|
40426
40611
|
const collectionNode = context.collectionRef.current;
|
|
40427
40612
|
if (!collectionNode) return [];
|
|
40428
40613
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -40434,43 +40619,525 @@ function createCollection(name) {
|
|
|
40434
40619
|
}, [context.collectionRef, context.itemMap]);
|
|
40435
40620
|
return getItems;
|
|
40436
40621
|
}
|
|
40622
|
+
__name8(useCollection3, "useCollection");
|
|
40437
40623
|
return [
|
|
40438
40624
|
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
40439
40625
|
useCollection3,
|
|
40440
40626
|
createCollectionScope3
|
|
40441
40627
|
];
|
|
40442
40628
|
}
|
|
40629
|
+
__name8(createCollection, "createCollection");
|
|
40630
|
+
var __instanciated = /* @__PURE__ */ new WeakMap();
|
|
40631
|
+
var OrderedDict = class _OrderedDict extends Map {
|
|
40632
|
+
static {
|
|
40633
|
+
__name8(this, "OrderedDict");
|
|
40634
|
+
}
|
|
40635
|
+
#keys;
|
|
40636
|
+
constructor(entries) {
|
|
40637
|
+
super(entries);
|
|
40638
|
+
this.#keys = [...super.keys()];
|
|
40639
|
+
__instanciated.set(this, true);
|
|
40640
|
+
}
|
|
40641
|
+
set(key, value) {
|
|
40642
|
+
if (__instanciated.get(this)) {
|
|
40643
|
+
if (this.has(key)) {
|
|
40644
|
+
this.#keys[this.#keys.indexOf(key)] = key;
|
|
40645
|
+
} else {
|
|
40646
|
+
this.#keys.push(key);
|
|
40647
|
+
}
|
|
40648
|
+
}
|
|
40649
|
+
super.set(key, value);
|
|
40650
|
+
return this;
|
|
40651
|
+
}
|
|
40652
|
+
insert(index2, key, value) {
|
|
40653
|
+
const has = this.has(key);
|
|
40654
|
+
const length64 = this.#keys.length;
|
|
40655
|
+
const relativeIndex = toSafeInteger(index2);
|
|
40656
|
+
let actualIndex = relativeIndex >= 0 ? relativeIndex : length64 + relativeIndex;
|
|
40657
|
+
const safeIndex = actualIndex < 0 || actualIndex >= length64 ? -1 : actualIndex;
|
|
40658
|
+
if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
|
|
40659
|
+
this.set(key, value);
|
|
40660
|
+
return this;
|
|
40661
|
+
}
|
|
40662
|
+
const size4 = this.size + (has ? 0 : 1);
|
|
40663
|
+
if (relativeIndex < 0) {
|
|
40664
|
+
actualIndex++;
|
|
40665
|
+
}
|
|
40666
|
+
const keys = [...this.#keys];
|
|
40667
|
+
let nextValue;
|
|
40668
|
+
let shouldSkip = false;
|
|
40669
|
+
for (let i = actualIndex; i < size4; i++) {
|
|
40670
|
+
if (actualIndex === i) {
|
|
40671
|
+
let nextKey = keys[i];
|
|
40672
|
+
if (keys[i] === key) {
|
|
40673
|
+
nextKey = keys[i + 1];
|
|
40674
|
+
}
|
|
40675
|
+
if (has) {
|
|
40676
|
+
this.delete(key);
|
|
40677
|
+
}
|
|
40678
|
+
nextValue = this.get(nextKey);
|
|
40679
|
+
this.set(key, value);
|
|
40680
|
+
} else {
|
|
40681
|
+
if (!shouldSkip && keys[i - 1] === key) {
|
|
40682
|
+
shouldSkip = true;
|
|
40683
|
+
}
|
|
40684
|
+
const currentKey = keys[shouldSkip ? i : i - 1];
|
|
40685
|
+
const currentValue = nextValue;
|
|
40686
|
+
nextValue = this.get(currentKey);
|
|
40687
|
+
this.delete(currentKey);
|
|
40688
|
+
this.set(currentKey, currentValue);
|
|
40689
|
+
}
|
|
40690
|
+
}
|
|
40691
|
+
return this;
|
|
40692
|
+
}
|
|
40693
|
+
with(index2, key, value) {
|
|
40694
|
+
const copy = new _OrderedDict(this);
|
|
40695
|
+
copy.insert(index2, key, value);
|
|
40696
|
+
return copy;
|
|
40697
|
+
}
|
|
40698
|
+
before(key) {
|
|
40699
|
+
const index2 = this.#keys.indexOf(key) - 1;
|
|
40700
|
+
if (index2 < 0) {
|
|
40701
|
+
return void 0;
|
|
40702
|
+
}
|
|
40703
|
+
return this.entryAt(index2);
|
|
40704
|
+
}
|
|
40705
|
+
/**
|
|
40706
|
+
* Sets a new key-value pair at the position before the given key.
|
|
40707
|
+
*/
|
|
40708
|
+
setBefore(key, newKey, value) {
|
|
40709
|
+
const index2 = this.#keys.indexOf(key);
|
|
40710
|
+
if (index2 === -1) {
|
|
40711
|
+
return this;
|
|
40712
|
+
}
|
|
40713
|
+
return this.insert(index2, newKey, value);
|
|
40714
|
+
}
|
|
40715
|
+
after(key) {
|
|
40716
|
+
let index2 = this.#keys.indexOf(key);
|
|
40717
|
+
index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
|
|
40718
|
+
if (index2 === -1) {
|
|
40719
|
+
return void 0;
|
|
40720
|
+
}
|
|
40721
|
+
return this.entryAt(index2);
|
|
40722
|
+
}
|
|
40723
|
+
/**
|
|
40724
|
+
* Sets a new key-value pair at the position after the given key.
|
|
40725
|
+
*/
|
|
40726
|
+
setAfter(key, newKey, value) {
|
|
40727
|
+
const index2 = this.#keys.indexOf(key);
|
|
40728
|
+
if (index2 === -1) {
|
|
40729
|
+
return this;
|
|
40730
|
+
}
|
|
40731
|
+
return this.insert(index2 + 1, newKey, value);
|
|
40732
|
+
}
|
|
40733
|
+
first() {
|
|
40734
|
+
return this.entryAt(0);
|
|
40735
|
+
}
|
|
40736
|
+
last() {
|
|
40737
|
+
return this.entryAt(-1);
|
|
40738
|
+
}
|
|
40739
|
+
clear() {
|
|
40740
|
+
this.#keys = [];
|
|
40741
|
+
return super.clear();
|
|
40742
|
+
}
|
|
40743
|
+
delete(key) {
|
|
40744
|
+
const deleted = super.delete(key);
|
|
40745
|
+
if (deleted) {
|
|
40746
|
+
this.#keys.splice(this.#keys.indexOf(key), 1);
|
|
40747
|
+
}
|
|
40748
|
+
return deleted;
|
|
40749
|
+
}
|
|
40750
|
+
deleteAt(index2) {
|
|
40751
|
+
const key = this.keyAt(index2);
|
|
40752
|
+
if (key !== void 0) {
|
|
40753
|
+
return this.delete(key);
|
|
40754
|
+
}
|
|
40755
|
+
return false;
|
|
40756
|
+
}
|
|
40757
|
+
at(index2) {
|
|
40758
|
+
const key = at(this.#keys, index2);
|
|
40759
|
+
if (key !== void 0) {
|
|
40760
|
+
return this.get(key);
|
|
40761
|
+
}
|
|
40762
|
+
}
|
|
40763
|
+
entryAt(index2) {
|
|
40764
|
+
const key = at(this.#keys, index2);
|
|
40765
|
+
if (key !== void 0) {
|
|
40766
|
+
return [key, this.get(key)];
|
|
40767
|
+
}
|
|
40768
|
+
}
|
|
40769
|
+
indexOf(key) {
|
|
40770
|
+
return this.#keys.indexOf(key);
|
|
40771
|
+
}
|
|
40772
|
+
keyAt(index2) {
|
|
40773
|
+
return at(this.#keys, index2);
|
|
40774
|
+
}
|
|
40775
|
+
from(key, offset4) {
|
|
40776
|
+
const index2 = this.indexOf(key);
|
|
40777
|
+
if (index2 === -1) {
|
|
40778
|
+
return void 0;
|
|
40779
|
+
}
|
|
40780
|
+
let dest = index2 + offset4;
|
|
40781
|
+
if (dest < 0) dest = 0;
|
|
40782
|
+
if (dest >= this.size) dest = this.size - 1;
|
|
40783
|
+
return this.at(dest);
|
|
40784
|
+
}
|
|
40785
|
+
keyFrom(key, offset4) {
|
|
40786
|
+
const index2 = this.indexOf(key);
|
|
40787
|
+
if (index2 === -1) {
|
|
40788
|
+
return void 0;
|
|
40789
|
+
}
|
|
40790
|
+
let dest = index2 + offset4;
|
|
40791
|
+
if (dest < 0) dest = 0;
|
|
40792
|
+
if (dest >= this.size) dest = this.size - 1;
|
|
40793
|
+
return this.keyAt(dest);
|
|
40794
|
+
}
|
|
40795
|
+
find(predicate, thisArg) {
|
|
40796
|
+
let index2 = 0;
|
|
40797
|
+
for (const entry of this) {
|
|
40798
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
40799
|
+
return entry;
|
|
40800
|
+
}
|
|
40801
|
+
index2++;
|
|
40802
|
+
}
|
|
40803
|
+
return void 0;
|
|
40804
|
+
}
|
|
40805
|
+
findIndex(predicate, thisArg) {
|
|
40806
|
+
let index2 = 0;
|
|
40807
|
+
for (const entry of this) {
|
|
40808
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
40809
|
+
return index2;
|
|
40810
|
+
}
|
|
40811
|
+
index2++;
|
|
40812
|
+
}
|
|
40813
|
+
return -1;
|
|
40814
|
+
}
|
|
40815
|
+
filter(predicate, thisArg) {
|
|
40816
|
+
const entries = [];
|
|
40817
|
+
let index2 = 0;
|
|
40818
|
+
for (const entry of this) {
|
|
40819
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
40820
|
+
entries.push(entry);
|
|
40821
|
+
}
|
|
40822
|
+
index2++;
|
|
40823
|
+
}
|
|
40824
|
+
return new _OrderedDict(entries);
|
|
40825
|
+
}
|
|
40826
|
+
map(callbackfn, thisArg) {
|
|
40827
|
+
const entries = [];
|
|
40828
|
+
let index2 = 0;
|
|
40829
|
+
for (const entry of this) {
|
|
40830
|
+
entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
|
|
40831
|
+
index2++;
|
|
40832
|
+
}
|
|
40833
|
+
return new _OrderedDict(entries);
|
|
40834
|
+
}
|
|
40835
|
+
reduce(...args) {
|
|
40836
|
+
const [callbackfn, initialValue] = args;
|
|
40837
|
+
let index2 = 0;
|
|
40838
|
+
let accumulator = initialValue ?? this.at(0);
|
|
40839
|
+
for (const entry of this) {
|
|
40840
|
+
if (index2 === 0 && args.length === 1) {
|
|
40841
|
+
accumulator = entry;
|
|
40842
|
+
} else {
|
|
40843
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
|
|
40844
|
+
}
|
|
40845
|
+
index2++;
|
|
40846
|
+
}
|
|
40847
|
+
return accumulator;
|
|
40848
|
+
}
|
|
40849
|
+
reduceRight(...args) {
|
|
40850
|
+
const [callbackfn, initialValue] = args;
|
|
40851
|
+
let accumulator = initialValue ?? this.at(-1);
|
|
40852
|
+
for (let index2 = this.size - 1; index2 >= 0; index2--) {
|
|
40853
|
+
const entry = this.at(index2);
|
|
40854
|
+
if (index2 === this.size - 1 && args.length === 1) {
|
|
40855
|
+
accumulator = entry;
|
|
40856
|
+
} else {
|
|
40857
|
+
accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
|
|
40858
|
+
}
|
|
40859
|
+
}
|
|
40860
|
+
return accumulator;
|
|
40861
|
+
}
|
|
40862
|
+
toSorted(compareFn) {
|
|
40863
|
+
const entries = [...this.entries()].sort(compareFn);
|
|
40864
|
+
return new _OrderedDict(entries);
|
|
40865
|
+
}
|
|
40866
|
+
toReversed() {
|
|
40867
|
+
const reversed = new _OrderedDict();
|
|
40868
|
+
for (let index2 = this.size - 1; index2 >= 0; index2--) {
|
|
40869
|
+
const key = this.keyAt(index2);
|
|
40870
|
+
const element = this.get(key);
|
|
40871
|
+
reversed.set(key, element);
|
|
40872
|
+
}
|
|
40873
|
+
return reversed;
|
|
40874
|
+
}
|
|
40875
|
+
toSpliced(...args) {
|
|
40876
|
+
const entries = [...this.entries()];
|
|
40877
|
+
entries.splice(...args);
|
|
40878
|
+
return new _OrderedDict(entries);
|
|
40879
|
+
}
|
|
40880
|
+
slice(start, end) {
|
|
40881
|
+
const result = new _OrderedDict();
|
|
40882
|
+
let stop = this.size - 1;
|
|
40883
|
+
if (start === void 0) {
|
|
40884
|
+
return result;
|
|
40885
|
+
}
|
|
40886
|
+
if (start < 0) {
|
|
40887
|
+
start = start + this.size;
|
|
40888
|
+
}
|
|
40889
|
+
if (end !== void 0 && end > 0) {
|
|
40890
|
+
stop = end - 1;
|
|
40891
|
+
}
|
|
40892
|
+
for (let index2 = start; index2 <= stop; index2++) {
|
|
40893
|
+
const key = this.keyAt(index2);
|
|
40894
|
+
const element = this.get(key);
|
|
40895
|
+
result.set(key, element);
|
|
40896
|
+
}
|
|
40897
|
+
return result;
|
|
40898
|
+
}
|
|
40899
|
+
every(predicate, thisArg) {
|
|
40900
|
+
let index2 = 0;
|
|
40901
|
+
for (const entry of this) {
|
|
40902
|
+
if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
40903
|
+
return false;
|
|
40904
|
+
}
|
|
40905
|
+
index2++;
|
|
40906
|
+
}
|
|
40907
|
+
return true;
|
|
40908
|
+
}
|
|
40909
|
+
some(predicate, thisArg) {
|
|
40910
|
+
let index2 = 0;
|
|
40911
|
+
for (const entry of this) {
|
|
40912
|
+
if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
|
|
40913
|
+
return true;
|
|
40914
|
+
}
|
|
40915
|
+
index2++;
|
|
40916
|
+
}
|
|
40917
|
+
return false;
|
|
40918
|
+
}
|
|
40919
|
+
};
|
|
40920
|
+
function at(array, index2) {
|
|
40921
|
+
if ("at" in Array.prototype) {
|
|
40922
|
+
return Array.prototype.at.call(array, index2);
|
|
40923
|
+
}
|
|
40924
|
+
const actualIndex = toSafeIndex(array, index2);
|
|
40925
|
+
return actualIndex === -1 ? void 0 : array[actualIndex];
|
|
40926
|
+
}
|
|
40927
|
+
__name8(at, "at");
|
|
40928
|
+
function toSafeIndex(array, index2) {
|
|
40929
|
+
const length64 = array.length;
|
|
40930
|
+
const relativeIndex = toSafeInteger(index2);
|
|
40931
|
+
const actualIndex = relativeIndex >= 0 ? relativeIndex : length64 + relativeIndex;
|
|
40932
|
+
return actualIndex < 0 || actualIndex >= length64 ? -1 : actualIndex;
|
|
40933
|
+
}
|
|
40934
|
+
__name8(toSafeIndex, "toSafeIndex");
|
|
40935
|
+
function toSafeInteger(number) {
|
|
40936
|
+
return number !== number || number === 0 ? 0 : Math.trunc(number);
|
|
40937
|
+
}
|
|
40938
|
+
__name8(toSafeInteger, "toSafeInteger");
|
|
40939
|
+
// @__NO_SIDE_EFFECTS__
|
|
40940
|
+
function createCollection2(name) {
|
|
40941
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
40942
|
+
const [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME);
|
|
40943
|
+
const [CollectionContextProvider, useCollectionContext] = createCollectionContext(
|
|
40944
|
+
PROVIDER_NAME,
|
|
40945
|
+
{
|
|
40946
|
+
collectionElement: null,
|
|
40947
|
+
collectionRef: { current: null },
|
|
40948
|
+
collectionRefObject: { current: null },
|
|
40949
|
+
itemMap: new OrderedDict(),
|
|
40950
|
+
setItemMap: /* @__PURE__ */ __name8(() => void 0, "setItemMap")
|
|
40951
|
+
}
|
|
40952
|
+
);
|
|
40953
|
+
const CollectionProvider = /* @__PURE__ */ __name8(({ state, ...props }) => {
|
|
40954
|
+
return state ? /* @__PURE__ */ jsx24(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx24(CollectionInit, { ...props });
|
|
40955
|
+
}, "CollectionProvider");
|
|
40956
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
40957
|
+
const CollectionInit = /* @__PURE__ */ __name8((props) => {
|
|
40958
|
+
const state = useInitCollection();
|
|
40959
|
+
return /* @__PURE__ */ jsx24(CollectionProviderImpl, { ...props, state });
|
|
40960
|
+
}, "CollectionInit");
|
|
40961
|
+
CollectionInit.displayName = PROVIDER_NAME + "Init";
|
|
40962
|
+
const CollectionProviderImpl = /* @__PURE__ */ __name8((props) => {
|
|
40963
|
+
const { scope, children, state } = props;
|
|
40964
|
+
const ref = React23.useRef(null);
|
|
40965
|
+
const [collectionElement, setCollectionElement] = React23.useState(
|
|
40966
|
+
null
|
|
40967
|
+
);
|
|
40968
|
+
const composeRefs2 = useComposedRefs(ref, setCollectionElement);
|
|
40969
|
+
const [itemMap, setItemMap] = state;
|
|
40970
|
+
React23.useEffect(() => {
|
|
40971
|
+
if (!collectionElement) return;
|
|
40972
|
+
const observer = getChildListObserver(() => {
|
|
40973
|
+
});
|
|
40974
|
+
observer.observe(collectionElement, {
|
|
40975
|
+
childList: true,
|
|
40976
|
+
subtree: true
|
|
40977
|
+
});
|
|
40978
|
+
return () => {
|
|
40979
|
+
observer.disconnect();
|
|
40980
|
+
};
|
|
40981
|
+
}, [collectionElement]);
|
|
40982
|
+
return /* @__PURE__ */ jsx24(
|
|
40983
|
+
CollectionContextProvider,
|
|
40984
|
+
{
|
|
40985
|
+
scope,
|
|
40986
|
+
itemMap,
|
|
40987
|
+
setItemMap,
|
|
40988
|
+
collectionRef: composeRefs2,
|
|
40989
|
+
collectionRefObject: ref,
|
|
40990
|
+
collectionElement,
|
|
40991
|
+
children
|
|
40992
|
+
}
|
|
40993
|
+
);
|
|
40994
|
+
}, "CollectionProviderImpl");
|
|
40995
|
+
CollectionProviderImpl.displayName = PROVIDER_NAME + "Impl";
|
|
40996
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
40997
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
40998
|
+
const CollectionSlot = React23.forwardRef(
|
|
40999
|
+
(props, forwardedRef) => {
|
|
41000
|
+
const { scope, children } = props;
|
|
41001
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
41002
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
41003
|
+
return /* @__PURE__ */ jsx24(CollectionSlotImpl, { ref: composedRefs, children });
|
|
41004
|
+
}
|
|
41005
|
+
);
|
|
41006
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
41007
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
41008
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
41009
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
41010
|
+
const CollectionItemSlot = React23.forwardRef(
|
|
41011
|
+
(props, forwardedRef) => {
|
|
41012
|
+
const { scope, children, ...itemData } = props;
|
|
41013
|
+
const ref = React23.useRef(null);
|
|
41014
|
+
const [element, setElement] = React23.useState(null);
|
|
41015
|
+
const composedRefs = useComposedRefs(forwardedRef, ref, setElement);
|
|
41016
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
41017
|
+
const { setItemMap } = context;
|
|
41018
|
+
const itemDataRef = React23.useRef(itemData);
|
|
41019
|
+
if (!shallowEqual(itemDataRef.current, itemData)) {
|
|
41020
|
+
itemDataRef.current = itemData;
|
|
41021
|
+
}
|
|
41022
|
+
const memoizedItemData = itemDataRef.current;
|
|
41023
|
+
React23.useEffect(() => {
|
|
41024
|
+
const itemData2 = memoizedItemData;
|
|
41025
|
+
setItemMap((map) => {
|
|
41026
|
+
if (!element) {
|
|
41027
|
+
return map;
|
|
41028
|
+
}
|
|
41029
|
+
if (!map.has(element)) {
|
|
41030
|
+
map.set(element, { ...itemData2, element });
|
|
41031
|
+
return map.toSorted(sortByDocumentPosition);
|
|
41032
|
+
}
|
|
41033
|
+
return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);
|
|
41034
|
+
});
|
|
41035
|
+
return () => {
|
|
41036
|
+
setItemMap((map) => {
|
|
41037
|
+
if (!element || !map.has(element)) {
|
|
41038
|
+
return map;
|
|
41039
|
+
}
|
|
41040
|
+
map.delete(element);
|
|
41041
|
+
return new OrderedDict(map);
|
|
41042
|
+
});
|
|
41043
|
+
};
|
|
41044
|
+
}, [element, memoizedItemData, setItemMap]);
|
|
41045
|
+
return /* @__PURE__ */ jsx24(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
41046
|
+
}
|
|
41047
|
+
);
|
|
41048
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
41049
|
+
function useInitCollection() {
|
|
41050
|
+
return React23.useState(new OrderedDict());
|
|
41051
|
+
}
|
|
41052
|
+
__name8(useInitCollection, "useInitCollection");
|
|
41053
|
+
function useCollection3(scope) {
|
|
41054
|
+
const { itemMap } = useCollectionContext(name + "CollectionConsumer", scope);
|
|
41055
|
+
return itemMap;
|
|
41056
|
+
}
|
|
41057
|
+
__name8(useCollection3, "useCollection");
|
|
41058
|
+
const functions = {
|
|
41059
|
+
createCollectionScope: createCollectionScope3,
|
|
41060
|
+
useCollection: useCollection3,
|
|
41061
|
+
useInitCollection
|
|
41062
|
+
};
|
|
41063
|
+
return [
|
|
41064
|
+
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
41065
|
+
functions
|
|
41066
|
+
];
|
|
41067
|
+
}
|
|
41068
|
+
__name8(createCollection2, "createCollection");
|
|
41069
|
+
function shallowEqual(a, b) {
|
|
41070
|
+
if (a === b) return true;
|
|
41071
|
+
if (typeof a !== "object" || typeof b !== "object") return false;
|
|
41072
|
+
if (a == null || b == null) return false;
|
|
41073
|
+
const keysA = Object.keys(a);
|
|
41074
|
+
const keysB = Object.keys(b);
|
|
41075
|
+
if (keysA.length !== keysB.length) return false;
|
|
41076
|
+
for (const key of keysA) {
|
|
41077
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
|
|
41078
|
+
if (a[key] !== b[key]) return false;
|
|
41079
|
+
}
|
|
41080
|
+
return true;
|
|
41081
|
+
}
|
|
41082
|
+
__name8(shallowEqual, "shallowEqual");
|
|
41083
|
+
function isElementPreceding(a, b) {
|
|
41084
|
+
return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);
|
|
41085
|
+
}
|
|
41086
|
+
__name8(isElementPreceding, "isElementPreceding");
|
|
41087
|
+
function sortByDocumentPosition(a, b) {
|
|
41088
|
+
return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;
|
|
41089
|
+
}
|
|
41090
|
+
__name8(sortByDocumentPosition, "sortByDocumentPosition");
|
|
41091
|
+
function getChildListObserver(callback) {
|
|
41092
|
+
const observer = new MutationObserver((mutationsList) => {
|
|
41093
|
+
for (const mutation of mutationsList) {
|
|
41094
|
+
if (mutation.type === "childList") {
|
|
41095
|
+
callback();
|
|
41096
|
+
return;
|
|
41097
|
+
}
|
|
41098
|
+
}
|
|
41099
|
+
});
|
|
41100
|
+
return observer;
|
|
41101
|
+
}
|
|
41102
|
+
__name8(getChildListObserver, "getChildListObserver");
|
|
40443
41103
|
|
|
40444
41104
|
// node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
40445
|
-
import * as
|
|
41105
|
+
import * as React21 from "react";
|
|
40446
41106
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
40447
|
-
var
|
|
41107
|
+
var __defProp11 = Object.defineProperty;
|
|
41108
|
+
var __name9 = (target, value) => __defProp11(target, "name", { value, configurable: true });
|
|
41109
|
+
var DirectionContext = React21.createContext(void 0);
|
|
40448
41110
|
function useDirection(localDir) {
|
|
40449
|
-
const globalDir =
|
|
41111
|
+
const globalDir = React21.useContext(DirectionContext);
|
|
40450
41112
|
return localDir || globalDir || "ltr";
|
|
40451
41113
|
}
|
|
41114
|
+
__name9(useDirection, "useDirection");
|
|
40452
41115
|
|
|
40453
41116
|
// node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
40454
|
-
import * as
|
|
41117
|
+
import * as React25 from "react";
|
|
40455
41118
|
|
|
40456
41119
|
// node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
40457
|
-
import * as
|
|
41120
|
+
import * as React24 from "react";
|
|
41121
|
+
var __defProp12 = Object.defineProperty;
|
|
41122
|
+
var __name10 = (target, value) => __defProp12(target, "name", { value, configurable: true });
|
|
40458
41123
|
function useCallbackRef(callback) {
|
|
40459
|
-
const callbackRef =
|
|
40460
|
-
|
|
41124
|
+
const callbackRef = React24.useRef(callback);
|
|
41125
|
+
React24.useEffect(() => {
|
|
40461
41126
|
callbackRef.current = callback;
|
|
40462
41127
|
});
|
|
40463
|
-
return
|
|
41128
|
+
return React24.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
|
|
40464
41129
|
}
|
|
41130
|
+
__name10(useCallbackRef, "useCallbackRef");
|
|
40465
41131
|
|
|
40466
41132
|
// node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
40467
41133
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
40468
|
-
var
|
|
41134
|
+
var __defProp13 = Object.defineProperty;
|
|
41135
|
+
var __name11 = (target, value) => __defProp13(target, "name", { value, configurable: true });
|
|
40469
41136
|
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
40470
41137
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
40471
41138
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
40472
41139
|
var originalBodyPointerEvents;
|
|
40473
|
-
var DismissableLayerContext =
|
|
41140
|
+
var DismissableLayerContext = React25.createContext({
|
|
40474
41141
|
layers: /* @__PURE__ */ new Set(),
|
|
40475
41142
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
40476
41143
|
branches: /* @__PURE__ */ new Set(),
|
|
@@ -40481,8 +41148,9 @@ var DismissableLayerContext = React24.createContext({
|
|
|
40481
41148
|
// See https://github.com/radix-ui/primitives/issues/3346
|
|
40482
41149
|
dismissableSurfaces: /* @__PURE__ */ new Set()
|
|
40483
41150
|
});
|
|
40484
|
-
var DismissableLayer =
|
|
40485
|
-
|
|
41151
|
+
var DismissableLayer = /* @__PURE__ */ React25.forwardRef(
|
|
41152
|
+
// blank line to reduce diff noise
|
|
41153
|
+
/* @__PURE__ */ __name11(function DismissableLayer2(props, forwardedRef) {
|
|
40486
41154
|
const {
|
|
40487
41155
|
disableOutsidePointerEvents = false,
|
|
40488
41156
|
deferPointerDownOutside = false,
|
|
@@ -40493,10 +41161,10 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40493
41161
|
onDismiss,
|
|
40494
41162
|
...layerProps
|
|
40495
41163
|
} = props;
|
|
40496
|
-
const context =
|
|
40497
|
-
const [node, setNode] =
|
|
41164
|
+
const context = React25.useContext(DismissableLayerContext);
|
|
41165
|
+
const [node, setNode] = React25.useState(null);
|
|
40498
41166
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
40499
|
-
const [, force] =
|
|
41167
|
+
const [, force] = React25.useState({});
|
|
40500
41168
|
const composedRefs = useComposedRefs(forwardedRef, setNode);
|
|
40501
41169
|
const layers = Array.from(context.layers);
|
|
40502
41170
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -40506,7 +41174,7 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40506
41174
|
const index2 = node ? layers.indexOf(node) : -1;
|
|
40507
41175
|
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
40508
41176
|
const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
40509
|
-
const isDeferredPointerDownOutsideRef =
|
|
41177
|
+
const isDeferredPointerDownOutsideRef = React25.useRef(false);
|
|
40510
41178
|
const pointerDownOutside = usePointerDownOutside(
|
|
40511
41179
|
(event) => {
|
|
40512
41180
|
onPointerDownOutside?.(event);
|
|
@@ -40518,7 +41186,7 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40518
41186
|
deferPointerDownOutside,
|
|
40519
41187
|
isDeferredPointerDownOutsideRef,
|
|
40520
41188
|
dismissableSurfaces: context.dismissableSurfaces,
|
|
40521
|
-
shouldHandlePointerDownOutside:
|
|
41189
|
+
shouldHandlePointerDownOutside: React25.useCallback(
|
|
40522
41190
|
(target) => {
|
|
40523
41191
|
if (!(target instanceof Node)) {
|
|
40524
41192
|
return false;
|
|
@@ -40554,14 +41222,14 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40554
41222
|
onDismiss();
|
|
40555
41223
|
}
|
|
40556
41224
|
});
|
|
40557
|
-
|
|
41225
|
+
React25.useEffect(() => {
|
|
40558
41226
|
if (!isHighestLayer) {
|
|
40559
41227
|
return;
|
|
40560
41228
|
}
|
|
40561
41229
|
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
40562
41230
|
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
40563
41231
|
}, [ownerDocument, isHighestLayer, handleKeyDown]);
|
|
40564
|
-
|
|
41232
|
+
React25.useEffect(() => {
|
|
40565
41233
|
if (!node) return;
|
|
40566
41234
|
if (disableOutsidePointerEvents) {
|
|
40567
41235
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -40581,7 +41249,7 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40581
41249
|
}
|
|
40582
41250
|
};
|
|
40583
41251
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
40584
|
-
|
|
41252
|
+
React25.useEffect(() => {
|
|
40585
41253
|
return () => {
|
|
40586
41254
|
if (!node) return;
|
|
40587
41255
|
context.layers.delete(node);
|
|
@@ -40589,8 +41257,8 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40589
41257
|
dispatchUpdate();
|
|
40590
41258
|
};
|
|
40591
41259
|
}, [node, context]);
|
|
40592
|
-
|
|
40593
|
-
const handleUpdate = () => force({});
|
|
41260
|
+
React25.useEffect(() => {
|
|
41261
|
+
const handleUpdate = /* @__PURE__ */ __name11(() => force({}), "handleUpdate");
|
|
40594
41262
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
40595
41263
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
40596
41264
|
}, []);
|
|
@@ -40611,27 +41279,24 @@ var DismissableLayer = React24.forwardRef(
|
|
|
40611
41279
|
)
|
|
40612
41280
|
}
|
|
40613
41281
|
);
|
|
40614
|
-
}
|
|
41282
|
+
}, "DismissableLayer")
|
|
40615
41283
|
);
|
|
40616
|
-
|
|
40617
|
-
|
|
40618
|
-
|
|
40619
|
-
|
|
40620
|
-
|
|
40621
|
-
|
|
40622
|
-
React24.useEffect(() => {
|
|
40623
|
-
const node = ref.current;
|
|
40624
|
-
if (node) {
|
|
40625
|
-
context.branches.add(node);
|
|
40626
|
-
return () => {
|
|
40627
|
-
context.branches.delete(node);
|
|
40628
|
-
};
|
|
41284
|
+
function useDismissableLayerSurface() {
|
|
41285
|
+
const context = React25.useContext(DismissableLayerContext);
|
|
41286
|
+
const [node, setNode] = React25.useState(null);
|
|
41287
|
+
React25.useEffect(() => {
|
|
41288
|
+
if (!node) {
|
|
41289
|
+
return;
|
|
40629
41290
|
}
|
|
40630
|
-
|
|
40631
|
-
|
|
40632
|
-
|
|
40633
|
-
|
|
40634
|
-
|
|
41291
|
+
context.dismissableSurfaces.add(node);
|
|
41292
|
+
return () => {
|
|
41293
|
+
context.dismissableSurfaces.delete(node);
|
|
41294
|
+
};
|
|
41295
|
+
}, [node, context.dismissableSurfaces]);
|
|
41296
|
+
return setNode;
|
|
41297
|
+
}
|
|
41298
|
+
__name11(useDismissableLayerSurface, "useDismissableLayerSurface");
|
|
41299
|
+
var IS_TRUE = /* @__PURE__ */ __name11(() => true, "IS_TRUE");
|
|
40635
41300
|
function usePointerDownOutside(onPointerDownOutside, args) {
|
|
40636
41301
|
const {
|
|
40637
41302
|
ownerDocument = globalThis?.document,
|
|
@@ -40641,20 +41306,22 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
40641
41306
|
shouldHandlePointerDownOutside = IS_TRUE
|
|
40642
41307
|
} = args;
|
|
40643
41308
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
40644
|
-
const isPointerInsideReactTreeRef =
|
|
40645
|
-
const isPointerDownOutsideRef =
|
|
40646
|
-
const interceptedOutsideInteractionEventsRef =
|
|
40647
|
-
const handleClickRef =
|
|
41309
|
+
const isPointerInsideReactTreeRef = React25.useRef(false);
|
|
41310
|
+
const isPointerDownOutsideRef = React25.useRef(false);
|
|
41311
|
+
const interceptedOutsideInteractionEventsRef = React25.useRef(/* @__PURE__ */ new Map());
|
|
41312
|
+
const handleClickRef = React25.useRef(() => {
|
|
40648
41313
|
});
|
|
40649
|
-
|
|
41314
|
+
React25.useEffect(() => {
|
|
40650
41315
|
function resetOutsideInteraction() {
|
|
40651
41316
|
isPointerDownOutsideRef.current = false;
|
|
40652
41317
|
isDeferredPointerDownOutsideRef.current = false;
|
|
40653
41318
|
interceptedOutsideInteractionEventsRef.current.clear();
|
|
40654
41319
|
}
|
|
41320
|
+
__name11(resetOutsideInteraction, "resetOutsideInteraction");
|
|
40655
41321
|
function isOutsideInteractionIntercepted() {
|
|
40656
41322
|
return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
|
|
40657
41323
|
}
|
|
41324
|
+
__name11(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
|
|
40658
41325
|
function handleInteractionCapture(event) {
|
|
40659
41326
|
if (!isPointerDownOutsideRef.current) {
|
|
40660
41327
|
return;
|
|
@@ -40672,12 +41339,14 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
40672
41339
|
}, 0);
|
|
40673
41340
|
}
|
|
40674
41341
|
}
|
|
41342
|
+
__name11(handleInteractionCapture, "handleInteractionCapture");
|
|
40675
41343
|
function handleInteractionBubble(event) {
|
|
40676
41344
|
if (isPointerDownOutsideRef.current) {
|
|
40677
41345
|
interceptedOutsideInteractionEventsRef.current.set(event.type, false);
|
|
40678
41346
|
}
|
|
40679
41347
|
}
|
|
40680
|
-
|
|
41348
|
+
__name11(handleInteractionBubble, "handleInteractionBubble");
|
|
41349
|
+
const handlePointerDown = /* @__PURE__ */ __name11((event) => {
|
|
40681
41350
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
40682
41351
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
40683
41352
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
@@ -40693,6 +41362,7 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
40693
41362
|
}
|
|
40694
41363
|
};
|
|
40695
41364
|
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
41365
|
+
__name11(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent");
|
|
40696
41366
|
if (!shouldHandlePointerDownOutside(event.target)) {
|
|
40697
41367
|
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
40698
41368
|
resetOutsideInteraction();
|
|
@@ -40715,7 +41385,7 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
40715
41385
|
resetOutsideInteraction();
|
|
40716
41386
|
}
|
|
40717
41387
|
isPointerInsideReactTreeRef.current = false;
|
|
40718
|
-
};
|
|
41388
|
+
}, "handlePointerDown");
|
|
40719
41389
|
const outsideInteractionEvents = [
|
|
40720
41390
|
"pointerup",
|
|
40721
41391
|
"mousedown",
|
|
@@ -40750,33 +41420,36 @@ function usePointerDownOutside(onPointerDownOutside, args) {
|
|
|
40750
41420
|
]);
|
|
40751
41421
|
return {
|
|
40752
41422
|
// ensures we check React component tree (not just DOM tree)
|
|
40753
|
-
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
41423
|
+
onPointerDownCapture: /* @__PURE__ */ __name11(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture")
|
|
40754
41424
|
};
|
|
40755
41425
|
}
|
|
41426
|
+
__name11(usePointerDownOutside, "usePointerDownOutside");
|
|
40756
41427
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
40757
41428
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
40758
|
-
const isFocusInsideReactTreeRef =
|
|
40759
|
-
|
|
40760
|
-
const handleFocus = (event) => {
|
|
41429
|
+
const isFocusInsideReactTreeRef = React25.useRef(false);
|
|
41430
|
+
React25.useEffect(() => {
|
|
41431
|
+
const handleFocus = /* @__PURE__ */ __name11((event) => {
|
|
40761
41432
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
40762
41433
|
const eventDetail = { originalEvent: event };
|
|
40763
41434
|
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
40764
41435
|
discrete: false
|
|
40765
41436
|
});
|
|
40766
41437
|
}
|
|
40767
|
-
};
|
|
41438
|
+
}, "handleFocus");
|
|
40768
41439
|
ownerDocument.addEventListener("focusin", handleFocus);
|
|
40769
41440
|
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
40770
41441
|
}, [ownerDocument, handleFocusOutside]);
|
|
40771
41442
|
return {
|
|
40772
|
-
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
40773
|
-
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
41443
|
+
onFocusCapture: /* @__PURE__ */ __name11(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
|
|
41444
|
+
onBlurCapture: /* @__PURE__ */ __name11(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
|
|
40774
41445
|
};
|
|
40775
41446
|
}
|
|
41447
|
+
__name11(useFocusOutside, "useFocusOutside");
|
|
40776
41448
|
function dispatchUpdate() {
|
|
40777
41449
|
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
40778
41450
|
document.dispatchEvent(event);
|
|
40779
41451
|
}
|
|
41452
|
+
__name11(dispatchUpdate, "dispatchUpdate");
|
|
40780
41453
|
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
40781
41454
|
const target = detail.originalEvent.target;
|
|
40782
41455
|
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
@@ -40787,13 +41460,21 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
40787
41460
|
target.dispatchEvent(event);
|
|
40788
41461
|
}
|
|
40789
41462
|
}
|
|
41463
|
+
__name11(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
40790
41464
|
|
|
40791
41465
|
// node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
40792
|
-
import * as
|
|
41466
|
+
import * as React26 from "react";
|
|
41467
|
+
var __defProp14 = Object.defineProperty;
|
|
41468
|
+
var __name12 = (target, value) => __defProp14(target, "name", { value, configurable: true });
|
|
40793
41469
|
var count = 0;
|
|
40794
41470
|
var guards = null;
|
|
41471
|
+
function FocusGuards(props) {
|
|
41472
|
+
useFocusGuards();
|
|
41473
|
+
return props.children;
|
|
41474
|
+
}
|
|
41475
|
+
__name12(FocusGuards, "FocusGuards");
|
|
40795
41476
|
function useFocusGuards() {
|
|
40796
|
-
|
|
41477
|
+
React26.useEffect(() => {
|
|
40797
41478
|
if (!guards) {
|
|
40798
41479
|
guards = { start: createFocusGuard(), end: createFocusGuard() };
|
|
40799
41480
|
}
|
|
@@ -40815,6 +41496,7 @@ function useFocusGuards() {
|
|
|
40815
41496
|
};
|
|
40816
41497
|
}, []);
|
|
40817
41498
|
}
|
|
41499
|
+
__name12(useFocusGuards, "useFocusGuards");
|
|
40818
41500
|
function createFocusGuard() {
|
|
40819
41501
|
const element = document.createElement("span");
|
|
40820
41502
|
element.setAttribute("data-radix-focus-guard", "");
|
|
@@ -40825,131 +41507,137 @@ function createFocusGuard() {
|
|
|
40825
41507
|
element.style.pointerEvents = "none";
|
|
40826
41508
|
return element;
|
|
40827
41509
|
}
|
|
41510
|
+
__name12(createFocusGuard, "createFocusGuard");
|
|
40828
41511
|
|
|
40829
41512
|
// node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
40830
|
-
import * as
|
|
41513
|
+
import * as React27 from "react";
|
|
40831
41514
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
41515
|
+
var __defProp15 = Object.defineProperty;
|
|
41516
|
+
var __name13 = (target, value) => __defProp15(target, "name", { value, configurable: true });
|
|
40832
41517
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
40833
41518
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
40834
41519
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
40835
|
-
var
|
|
40836
|
-
|
|
40837
|
-
|
|
40838
|
-
|
|
40839
|
-
|
|
40840
|
-
|
|
40841
|
-
|
|
40842
|
-
|
|
40843
|
-
|
|
40844
|
-
|
|
40845
|
-
|
|
40846
|
-
|
|
40847
|
-
|
|
40848
|
-
|
|
40849
|
-
|
|
40850
|
-
|
|
40851
|
-
|
|
40852
|
-
|
|
40853
|
-
|
|
40854
|
-
|
|
40855
|
-
|
|
40856
|
-
|
|
40857
|
-
|
|
40858
|
-
|
|
40859
|
-
|
|
40860
|
-
|
|
40861
|
-
|
|
40862
|
-
|
|
40863
|
-
|
|
40864
|
-
|
|
40865
|
-
|
|
40866
|
-
|
|
40867
|
-
}
|
|
40868
|
-
}, handleFocusOut2 = function(event) {
|
|
40869
|
-
if (focusScope.paused || !container) return;
|
|
40870
|
-
const relatedTarget = event.relatedTarget;
|
|
40871
|
-
if (relatedTarget === null) return;
|
|
40872
|
-
if (!container.contains(relatedTarget)) {
|
|
40873
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
40874
|
-
}
|
|
40875
|
-
}, handleMutations2 = function(mutations) {
|
|
40876
|
-
const focusedElement = document.activeElement;
|
|
40877
|
-
if (focusedElement !== document.body) return;
|
|
40878
|
-
for (const mutation of mutations) {
|
|
40879
|
-
if (mutation.removedNodes.length > 0) focus(container);
|
|
40880
|
-
}
|
|
40881
|
-
};
|
|
40882
|
-
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
40883
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
40884
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
40885
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
40886
|
-
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
40887
|
-
return () => {
|
|
40888
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
40889
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
40890
|
-
mutationObserver.disconnect();
|
|
40891
|
-
};
|
|
40892
|
-
}
|
|
40893
|
-
}, [trapped, container, focusScope.paused]);
|
|
40894
|
-
React26.useEffect(() => {
|
|
40895
|
-
if (container) {
|
|
40896
|
-
focusScopesStack.add(focusScope);
|
|
40897
|
-
const previouslyFocusedElement = document.activeElement;
|
|
40898
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
40899
|
-
if (!hasFocusedCandidate) {
|
|
40900
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
40901
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
40902
|
-
container.dispatchEvent(mountEvent);
|
|
40903
|
-
if (!mountEvent.defaultPrevented) {
|
|
40904
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
40905
|
-
if (document.activeElement === previouslyFocusedElement) {
|
|
40906
|
-
focus(container);
|
|
41520
|
+
var FocusScope = /* @__PURE__ */ React27.forwardRef(
|
|
41521
|
+
/* @__PURE__ */ __name13(function FocusScope2(props, forwardedRef) {
|
|
41522
|
+
const {
|
|
41523
|
+
loop = false,
|
|
41524
|
+
trapped = false,
|
|
41525
|
+
onMountAutoFocus: onMountAutoFocusProp,
|
|
41526
|
+
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
41527
|
+
...scopeProps
|
|
41528
|
+
} = props;
|
|
41529
|
+
const [container, setContainer] = React27.useState(null);
|
|
41530
|
+
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
41531
|
+
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
41532
|
+
const lastFocusedElementRef = React27.useRef(null);
|
|
41533
|
+
const composedRefs = useComposedRefs(forwardedRef, setContainer);
|
|
41534
|
+
const focusScope = React27.useRef({
|
|
41535
|
+
paused: false,
|
|
41536
|
+
pause() {
|
|
41537
|
+
this.paused = true;
|
|
41538
|
+
},
|
|
41539
|
+
resume() {
|
|
41540
|
+
this.paused = false;
|
|
41541
|
+
}
|
|
41542
|
+
}).current;
|
|
41543
|
+
React27.useEffect(() => {
|
|
41544
|
+
if (trapped) {
|
|
41545
|
+
let handleFocusIn2 = function(event) {
|
|
41546
|
+
if (focusScope.paused || !container) return;
|
|
41547
|
+
const target = event.target;
|
|
41548
|
+
if (container.contains(target)) {
|
|
41549
|
+
lastFocusedElementRef.current = target;
|
|
41550
|
+
} else {
|
|
41551
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
40907
41552
|
}
|
|
40908
|
-
}
|
|
40909
|
-
|
|
40910
|
-
|
|
40911
|
-
|
|
40912
|
-
|
|
40913
|
-
|
|
40914
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
40915
|
-
container.dispatchEvent(unmountEvent);
|
|
40916
|
-
if (!unmountEvent.defaultPrevented) {
|
|
40917
|
-
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
41553
|
+
}, handleFocusOut2 = function(event) {
|
|
41554
|
+
if (focusScope.paused || !container) return;
|
|
41555
|
+
const relatedTarget = event.relatedTarget;
|
|
41556
|
+
if (relatedTarget === null) return;
|
|
41557
|
+
if (!container.contains(relatedTarget)) {
|
|
41558
|
+
focus(lastFocusedElementRef.current, { select: true });
|
|
40918
41559
|
}
|
|
40919
|
-
|
|
40920
|
-
|
|
40921
|
-
|
|
40922
|
-
|
|
40923
|
-
|
|
40924
|
-
|
|
40925
|
-
|
|
40926
|
-
|
|
40927
|
-
|
|
40928
|
-
|
|
40929
|
-
|
|
40930
|
-
|
|
40931
|
-
|
|
40932
|
-
const
|
|
40933
|
-
|
|
40934
|
-
|
|
40935
|
-
|
|
40936
|
-
|
|
40937
|
-
|
|
40938
|
-
|
|
40939
|
-
|
|
40940
|
-
|
|
40941
|
-
|
|
40942
|
-
|
|
40943
|
-
|
|
41560
|
+
}, handleMutations2 = function(mutations) {
|
|
41561
|
+
const focusedElement = document.activeElement;
|
|
41562
|
+
if (focusedElement !== document.body) return;
|
|
41563
|
+
for (const mutation of mutations) {
|
|
41564
|
+
if (mutation.removedNodes.length > 0) focus(container);
|
|
41565
|
+
}
|
|
41566
|
+
};
|
|
41567
|
+
var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
|
|
41568
|
+
__name13(handleFocusIn2, "handleFocusIn");
|
|
41569
|
+
__name13(handleFocusOut2, "handleFocusOut");
|
|
41570
|
+
__name13(handleMutations2, "handleMutations");
|
|
41571
|
+
document.addEventListener("focusin", handleFocusIn2);
|
|
41572
|
+
document.addEventListener("focusout", handleFocusOut2);
|
|
41573
|
+
const mutationObserver = new MutationObserver(handleMutations2);
|
|
41574
|
+
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
41575
|
+
return () => {
|
|
41576
|
+
document.removeEventListener("focusin", handleFocusIn2);
|
|
41577
|
+
document.removeEventListener("focusout", handleFocusOut2);
|
|
41578
|
+
mutationObserver.disconnect();
|
|
41579
|
+
};
|
|
41580
|
+
}
|
|
41581
|
+
}, [trapped, container, focusScope.paused]);
|
|
41582
|
+
React27.useEffect(() => {
|
|
41583
|
+
if (container) {
|
|
41584
|
+
focusScopesStack.add(focusScope);
|
|
41585
|
+
const previouslyFocusedElement = document.activeElement;
|
|
41586
|
+
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
41587
|
+
if (!hasFocusedCandidate) {
|
|
41588
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
41589
|
+
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
41590
|
+
container.dispatchEvent(mountEvent);
|
|
41591
|
+
if (!mountEvent.defaultPrevented) {
|
|
41592
|
+
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
41593
|
+
if (document.activeElement === previouslyFocusedElement) {
|
|
41594
|
+
focus(container);
|
|
41595
|
+
}
|
|
40944
41596
|
}
|
|
40945
41597
|
}
|
|
41598
|
+
return () => {
|
|
41599
|
+
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
41600
|
+
setTimeout(() => {
|
|
41601
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
41602
|
+
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
41603
|
+
container.dispatchEvent(unmountEvent);
|
|
41604
|
+
if (!unmountEvent.defaultPrevented) {
|
|
41605
|
+
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
41606
|
+
}
|
|
41607
|
+
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
41608
|
+
focusScopesStack.remove(focusScope);
|
|
41609
|
+
}, 0);
|
|
41610
|
+
};
|
|
40946
41611
|
}
|
|
40947
|
-
},
|
|
40948
|
-
|
|
40949
|
-
|
|
40950
|
-
|
|
40951
|
-
|
|
40952
|
-
|
|
41612
|
+
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
41613
|
+
const handleKeyDown = React27.useCallback(
|
|
41614
|
+
(event) => {
|
|
41615
|
+
if (!loop && !trapped) return;
|
|
41616
|
+
if (focusScope.paused) return;
|
|
41617
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
41618
|
+
const focusedElement = document.activeElement;
|
|
41619
|
+
if (isTabKey && focusedElement) {
|
|
41620
|
+
const container2 = event.currentTarget;
|
|
41621
|
+
const [first, last] = getTabbableEdges(container2);
|
|
41622
|
+
const hasTabbableElementsInside = first && last;
|
|
41623
|
+
if (!hasTabbableElementsInside) {
|
|
41624
|
+
if (focusedElement === container2) event.preventDefault();
|
|
41625
|
+
} else {
|
|
41626
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
41627
|
+
event.preventDefault();
|
|
41628
|
+
if (loop) focus(first, { select: true });
|
|
41629
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
41630
|
+
event.preventDefault();
|
|
41631
|
+
if (loop) focus(last, { select: true });
|
|
41632
|
+
}
|
|
41633
|
+
}
|
|
41634
|
+
}
|
|
41635
|
+
},
|
|
41636
|
+
[loop, trapped, focusScope.paused]
|
|
41637
|
+
);
|
|
41638
|
+
return /* @__PURE__ */ jsx27(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
41639
|
+
}, "FocusScope")
|
|
41640
|
+
);
|
|
40953
41641
|
function focusFirst(candidates, { select = false } = {}) {
|
|
40954
41642
|
const previouslyFocusedElement = document.activeElement;
|
|
40955
41643
|
for (const candidate of candidates) {
|
|
@@ -40957,24 +41645,27 @@ function focusFirst(candidates, { select = false } = {}) {
|
|
|
40957
41645
|
if (document.activeElement !== previouslyFocusedElement) return;
|
|
40958
41646
|
}
|
|
40959
41647
|
}
|
|
41648
|
+
__name13(focusFirst, "focusFirst");
|
|
40960
41649
|
function getTabbableEdges(container) {
|
|
40961
41650
|
const candidates = getTabbableCandidates(container);
|
|
40962
41651
|
const first = findVisible(candidates, container);
|
|
40963
41652
|
const last = findVisible(candidates.reverse(), container);
|
|
40964
41653
|
return [first, last];
|
|
40965
41654
|
}
|
|
41655
|
+
__name13(getTabbableEdges, "getTabbableEdges");
|
|
40966
41656
|
function getTabbableCandidates(container) {
|
|
40967
41657
|
const nodes = [];
|
|
40968
41658
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
40969
|
-
acceptNode: (node) => {
|
|
41659
|
+
acceptNode: /* @__PURE__ */ __name13((node) => {
|
|
40970
41660
|
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
40971
41661
|
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
40972
41662
|
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
40973
|
-
}
|
|
41663
|
+
}, "acceptNode")
|
|
40974
41664
|
});
|
|
40975
41665
|
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
40976
41666
|
return nodes;
|
|
40977
41667
|
}
|
|
41668
|
+
__name13(getTabbableCandidates, "getTabbableCandidates");
|
|
40978
41669
|
function findVisible(elements, container) {
|
|
40979
41670
|
const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
|
|
40980
41671
|
for (const element of elements) {
|
|
@@ -40984,6 +41675,7 @@ function findVisible(elements, container) {
|
|
|
40984
41675
|
}
|
|
40985
41676
|
}
|
|
40986
41677
|
}
|
|
41678
|
+
__name13(findVisible, "findVisible");
|
|
40987
41679
|
function isHidden(node, { upTo }) {
|
|
40988
41680
|
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
40989
41681
|
while (node) {
|
|
@@ -40993,9 +41685,11 @@ function isHidden(node, { upTo }) {
|
|
|
40993
41685
|
}
|
|
40994
41686
|
return false;
|
|
40995
41687
|
}
|
|
41688
|
+
__name13(isHidden, "isHidden");
|
|
40996
41689
|
function isSelectableInput(element) {
|
|
40997
41690
|
return element instanceof HTMLInputElement && "select" in element;
|
|
40998
41691
|
}
|
|
41692
|
+
__name13(isSelectableInput, "isSelectableInput");
|
|
40999
41693
|
function focus(element, { select = false } = {}) {
|
|
41000
41694
|
if (element && element.focus) {
|
|
41001
41695
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -41004,6 +41698,7 @@ function focus(element, { select = false } = {}) {
|
|
|
41004
41698
|
element.select();
|
|
41005
41699
|
}
|
|
41006
41700
|
}
|
|
41701
|
+
__name13(focus, "focus");
|
|
41007
41702
|
var focusScopesStack = createFocusScopesStack();
|
|
41008
41703
|
function createFocusScopesStack() {
|
|
41009
41704
|
let stack = [];
|
|
@@ -41022,6 +41717,7 @@ function createFocusScopesStack() {
|
|
|
41022
41717
|
}
|
|
41023
41718
|
};
|
|
41024
41719
|
}
|
|
41720
|
+
__name13(createFocusScopesStack, "createFocusScopesStack");
|
|
41025
41721
|
function arrayRemove(array, item) {
|
|
41026
41722
|
const updatedArray = [...array];
|
|
41027
41723
|
const index2 = updatedArray.indexOf(item);
|
|
@@ -41030,21 +41726,26 @@ function arrayRemove(array, item) {
|
|
|
41030
41726
|
}
|
|
41031
41727
|
return updatedArray;
|
|
41032
41728
|
}
|
|
41729
|
+
__name13(arrayRemove, "arrayRemove");
|
|
41033
41730
|
function removeLinks(items) {
|
|
41034
41731
|
return items.filter((item) => item.tagName !== "A");
|
|
41035
41732
|
}
|
|
41733
|
+
__name13(removeLinks, "removeLinks");
|
|
41036
41734
|
|
|
41037
41735
|
// node_modules/@radix-ui/react-id/dist/index.mjs
|
|
41038
|
-
import * as
|
|
41039
|
-
var
|
|
41736
|
+
import * as React28 from "react";
|
|
41737
|
+
var __defProp16 = Object.defineProperty;
|
|
41738
|
+
var __name14 = (target, value) => __defProp16(target, "name", { value, configurable: true });
|
|
41739
|
+
var useReactId = React28[" useId ".trim().toString()] || (() => void 0);
|
|
41040
41740
|
var count2 = 0;
|
|
41041
41741
|
function useId(deterministicId) {
|
|
41042
|
-
const [id, setId] =
|
|
41742
|
+
const [id, setId] = React28.useState(useReactId());
|
|
41043
41743
|
useLayoutEffect2(() => {
|
|
41044
41744
|
if (!deterministicId) setId((reactId) => reactId ?? String(count2++));
|
|
41045
41745
|
}, [deterministicId]);
|
|
41046
41746
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
41047
41747
|
}
|
|
41748
|
+
__name14(useId, "useId");
|
|
41048
41749
|
|
|
41049
41750
|
// node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
41050
41751
|
import * as React31 from "react";
|
|
@@ -41143,12 +41844,12 @@ function getOppositePlacement(placement) {
|
|
|
41143
41844
|
return oppositeSideMap[side] + placement.slice(side.length);
|
|
41144
41845
|
}
|
|
41145
41846
|
function expandPaddingObject(padding) {
|
|
41847
|
+
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
|
41146
41848
|
return {
|
|
41147
|
-
top: 0,
|
|
41148
|
-
right: 0,
|
|
41149
|
-
bottom: 0,
|
|
41150
|
-
left: 0
|
|
41151
|
-
...padding
|
|
41849
|
+
top: (_padding$top = padding.top) != null ? _padding$top : 0,
|
|
41850
|
+
right: (_padding$right = padding.right) != null ? _padding$right : 0,
|
|
41851
|
+
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
|
|
41852
|
+
left: (_padding$left = padding.left) != null ? _padding$left : 0
|
|
41152
41853
|
};
|
|
41153
41854
|
}
|
|
41154
41855
|
function getPaddingObject(padding) {
|
|
@@ -41224,13 +41925,9 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
41224
41925
|
y: reference.y
|
|
41225
41926
|
};
|
|
41226
41927
|
}
|
|
41227
|
-
|
|
41228
|
-
|
|
41229
|
-
|
|
41230
|
-
break;
|
|
41231
|
-
case "end":
|
|
41232
|
-
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
41233
|
-
break;
|
|
41928
|
+
const alignment = getAlignment(placement);
|
|
41929
|
+
if (alignment) {
|
|
41930
|
+
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
|
|
41234
41931
|
}
|
|
41235
41932
|
return coords;
|
|
41236
41933
|
}
|
|
@@ -41270,10 +41967,7 @@ async function detectOverflow(state, options) {
|
|
|
41270
41967
|
height: rects.floating.height
|
|
41271
41968
|
} : rects.reference;
|
|
41272
41969
|
const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
|
|
41273
|
-
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent))
|
|
41274
|
-
x: 1,
|
|
41275
|
-
y: 1
|
|
41276
|
-
} : {
|
|
41970
|
+
const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
|
|
41277
41971
|
x: 1,
|
|
41278
41972
|
y: 1
|
|
41279
41973
|
};
|
|
@@ -41421,12 +42115,11 @@ var arrow = (options) => ({
|
|
|
41421
42115
|
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length64] / 2 - 1;
|
|
41422
42116
|
const minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
41423
42117
|
const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
41424
|
-
const min$1 = minPadding;
|
|
41425
42118
|
const max2 = clientSize - arrowDimensions[length64] - maxPadding;
|
|
41426
42119
|
const center = clientSize / 2 - arrowDimensions[length64] / 2 + centerToReference;
|
|
41427
|
-
const offset4 = clamp2(
|
|
41428
|
-
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length64] / 2 - (center <
|
|
41429
|
-
const alignmentOffset = shouldAddOffset ? center <
|
|
42120
|
+
const offset4 = clamp2(minPadding, center, max2);
|
|
42121
|
+
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length64] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length64] / 2 < 0;
|
|
42122
|
+
const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0;
|
|
41430
42123
|
return {
|
|
41431
42124
|
[axis]: coords[axis] + alignmentOffset,
|
|
41432
42125
|
data: {
|
|
@@ -41714,23 +42407,16 @@ var shift = function(options) {
|
|
|
41714
42407
|
y
|
|
41715
42408
|
};
|
|
41716
42409
|
const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
|
|
41717
|
-
const crossAxis = getSideAxis(
|
|
42410
|
+
const crossAxis = getSideAxis(placement);
|
|
41718
42411
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
41719
42412
|
let mainAxisCoord = coords[mainAxis];
|
|
41720
42413
|
let crossAxisCoord = coords[crossAxis];
|
|
42414
|
+
const clampCoord = (axis, coord) => clamp2(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
|
|
41721
42415
|
if (checkMainAxis) {
|
|
41722
|
-
|
|
41723
|
-
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
41724
|
-
const min2 = mainAxisCoord + overflow[minSide];
|
|
41725
|
-
const max2 = mainAxisCoord - overflow[maxSide];
|
|
41726
|
-
mainAxisCoord = clamp2(min2, mainAxisCoord, max2);
|
|
42416
|
+
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
|
|
41727
42417
|
}
|
|
41728
42418
|
if (checkCrossAxis) {
|
|
41729
|
-
|
|
41730
|
-
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
41731
|
-
const min2 = crossAxisCoord + overflow[minSide];
|
|
41732
|
-
const max2 = crossAxisCoord - overflow[maxSide];
|
|
41733
|
-
crossAxisCoord = clamp2(min2, crossAxisCoord, max2);
|
|
42419
|
+
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
|
|
41734
42420
|
}
|
|
41735
42421
|
const limitedCoords = limiter.fn({
|
|
41736
42422
|
...state,
|
|
@@ -41758,6 +42444,7 @@ var limitShift = function(options) {
|
|
|
41758
42444
|
return {
|
|
41759
42445
|
options,
|
|
41760
42446
|
fn(state) {
|
|
42447
|
+
var _rawOffset$mainAxis, _rawOffset$crossAxis;
|
|
41761
42448
|
const {
|
|
41762
42449
|
x,
|
|
41763
42450
|
y,
|
|
@@ -41783,9 +42470,8 @@ var limitShift = function(options) {
|
|
|
41783
42470
|
mainAxis: rawOffset,
|
|
41784
42471
|
crossAxis: 0
|
|
41785
42472
|
} : {
|
|
41786
|
-
mainAxis: 0,
|
|
41787
|
-
crossAxis: 0
|
|
41788
|
-
...rawOffset
|
|
42473
|
+
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
|
|
42474
|
+
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
|
|
41789
42475
|
};
|
|
41790
42476
|
if (checkMainAxis) {
|
|
41791
42477
|
const len = mainAxis === "y" ? "height" : "width";
|
|
@@ -41824,7 +42510,6 @@ var size = function(options) {
|
|
|
41824
42510
|
name: "size",
|
|
41825
42511
|
options,
|
|
41826
42512
|
async fn(state) {
|
|
41827
|
-
var _state$middlewareData, _state$middlewareData2;
|
|
41828
42513
|
const {
|
|
41829
42514
|
placement,
|
|
41830
42515
|
rects,
|
|
@@ -41857,24 +42542,21 @@ var size = function(options) {
|
|
|
41857
42542
|
const maximumClippingWidth = width10 - overflow.left - overflow.right;
|
|
41858
42543
|
const overflowAvailableHeight = min(height10 - overflow[heightSide], maximumClippingHeight);
|
|
41859
42544
|
const overflowAvailableWidth = min(width10 - overflow[widthSide], maximumClippingWidth);
|
|
41860
|
-
const
|
|
42545
|
+
const shiftData = state.middlewareData.shift;
|
|
42546
|
+
const noShift = !shiftData;
|
|
41861
42547
|
let availableHeight = overflowAvailableHeight;
|
|
41862
42548
|
let availableWidth = overflowAvailableWidth;
|
|
41863
|
-
if (
|
|
42549
|
+
if (shiftData != null && shiftData.enabled.x) {
|
|
41864
42550
|
availableWidth = maximumClippingWidth;
|
|
41865
42551
|
}
|
|
41866
|
-
if (
|
|
42552
|
+
if (shiftData != null && shiftData.enabled.y) {
|
|
41867
42553
|
availableHeight = maximumClippingHeight;
|
|
41868
42554
|
}
|
|
41869
42555
|
if (noShift && !alignment) {
|
|
41870
|
-
const xMin = max(overflow.left, 0);
|
|
41871
|
-
const xMax = max(overflow.right, 0);
|
|
41872
|
-
const yMin = max(overflow.top, 0);
|
|
41873
|
-
const yMax = max(overflow.bottom, 0);
|
|
41874
42556
|
if (isYAxis) {
|
|
41875
|
-
availableWidth = width10 - 2 *
|
|
42557
|
+
availableWidth = width10 - 2 * max(overflow.left, overflow.right);
|
|
41876
42558
|
} else {
|
|
41877
|
-
availableHeight = height10 - 2 *
|
|
42559
|
+
availableHeight = height10 - 2 * max(overflow.top, overflow.bottom);
|
|
41878
42560
|
}
|
|
41879
42561
|
}
|
|
41880
42562
|
await apply({
|
|
@@ -42022,7 +42704,7 @@ function getParentNode(node) {
|
|
|
42022
42704
|
function getNearestOverflowAncestor(node) {
|
|
42023
42705
|
const parentNode = getParentNode(node);
|
|
42024
42706
|
if (isLastTraversableNode(parentNode)) {
|
|
42025
|
-
return node.ownerDocument
|
|
42707
|
+
return (node.ownerDocument || node).body;
|
|
42026
42708
|
}
|
|
42027
42709
|
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
42028
42710
|
return parentNode;
|
|
@@ -42112,10 +42794,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
|
42112
42794
|
if (isFixed === void 0) {
|
|
42113
42795
|
isFixed = false;
|
|
42114
42796
|
}
|
|
42115
|
-
|
|
42116
|
-
return false;
|
|
42117
|
-
}
|
|
42118
|
-
return isFixed;
|
|
42797
|
+
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
|
|
42119
42798
|
}
|
|
42120
42799
|
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
42121
42800
|
if (includeScale === void 0) {
|
|
@@ -42141,12 +42820,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
42141
42820
|
let y = (clientRect.top + visualOffsets.y) / scale2.y;
|
|
42142
42821
|
let width10 = clientRect.width / scale2.x;
|
|
42143
42822
|
let height10 = clientRect.height / scale2.y;
|
|
42144
|
-
if (domElement) {
|
|
42823
|
+
if (domElement && offsetParent) {
|
|
42145
42824
|
const win = getWindow(domElement);
|
|
42146
|
-
const offsetWin =
|
|
42825
|
+
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
42147
42826
|
let currentWin = win;
|
|
42148
42827
|
let currentIFrame = getFrameElement(currentWin);
|
|
42149
|
-
while (currentIFrame &&
|
|
42828
|
+
while (currentIFrame && offsetWin !== currentWin) {
|
|
42150
42829
|
const iframeScale = getScale(currentIFrame);
|
|
42151
42830
|
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
42152
42831
|
const css = getComputedStyle2(currentIFrame);
|
|
@@ -42205,7 +42884,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
42205
42884
|
let scale2 = createCoords(1);
|
|
42206
42885
|
const offsets = createCoords(0);
|
|
42207
42886
|
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
42208
|
-
if (isOffsetParentAnElement || !
|
|
42887
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
42209
42888
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
42210
42889
|
scroll = getNodeScroll(offsetParent);
|
|
42211
42890
|
}
|
|
@@ -42225,15 +42904,14 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
42225
42904
|
};
|
|
42226
42905
|
}
|
|
42227
42906
|
function getClientRects(element) {
|
|
42228
|
-
return Array.from(element.getClientRects());
|
|
42907
|
+
return element.getClientRects ? Array.from(element.getClientRects()) : [];
|
|
42229
42908
|
}
|
|
42230
|
-
function getDocumentRect(
|
|
42231
|
-
const
|
|
42232
|
-
const
|
|
42233
|
-
const body = element.ownerDocument.body;
|
|
42909
|
+
function getDocumentRect(html) {
|
|
42910
|
+
const scroll = getNodeScroll(html);
|
|
42911
|
+
const body = html.ownerDocument.body;
|
|
42234
42912
|
const width10 = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
42235
42913
|
const height10 = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
42236
|
-
let x = -scroll.scrollLeft + getWindowScrollBarX(
|
|
42914
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
|
|
42237
42915
|
const y = -scroll.scrollTop;
|
|
42238
42916
|
if (getComputedStyle2(body).direction === "rtl") {
|
|
42239
42917
|
x += max(html.clientWidth, body.clientWidth) - width10;
|
|
@@ -42246,7 +42924,11 @@ function getDocumentRect(element) {
|
|
|
42246
42924
|
};
|
|
42247
42925
|
}
|
|
42248
42926
|
var SCROLLBAR_MAX = 25;
|
|
42249
|
-
function getViewportRect(element, strategy) {
|
|
42927
|
+
function getViewportRect(element, strategy, rootBoundary) {
|
|
42928
|
+
if (rootBoundary === void 0) {
|
|
42929
|
+
rootBoundary = "viewport";
|
|
42930
|
+
}
|
|
42931
|
+
const isLayoutViewport = rootBoundary === "layoutViewport";
|
|
42250
42932
|
const win = getWindow(element);
|
|
42251
42933
|
const html = getDocumentElement(element);
|
|
42252
42934
|
const visualViewport = win.visualViewport;
|
|
@@ -42255,12 +42937,19 @@ function getViewportRect(element, strategy) {
|
|
|
42255
42937
|
let x = 0;
|
|
42256
42938
|
let y = 0;
|
|
42257
42939
|
if (visualViewport) {
|
|
42258
|
-
|
|
42259
|
-
|
|
42260
|
-
|
|
42261
|
-
|
|
42262
|
-
|
|
42263
|
-
|
|
42940
|
+
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
|
|
42941
|
+
if (isLayoutViewport) {
|
|
42942
|
+
if (!layoutRelativeClientCoords) {
|
|
42943
|
+
x = -visualViewport.offsetLeft;
|
|
42944
|
+
y = -visualViewport.offsetTop;
|
|
42945
|
+
}
|
|
42946
|
+
} else {
|
|
42947
|
+
width10 = visualViewport.width;
|
|
42948
|
+
height10 = visualViewport.height;
|
|
42949
|
+
if (layoutRelativeClientCoords) {
|
|
42950
|
+
x = visualViewport.offsetLeft;
|
|
42951
|
+
y = visualViewport.offsetTop;
|
|
42952
|
+
}
|
|
42264
42953
|
}
|
|
42265
42954
|
}
|
|
42266
42955
|
const windowScrollbarX = getWindowScrollBarX(html);
|
|
@@ -42269,12 +42958,11 @@ function getViewportRect(element, strategy) {
|
|
|
42269
42958
|
const body = doc.body;
|
|
42270
42959
|
const bodyStyles = getComputedStyle(body);
|
|
42271
42960
|
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
42272
|
-
const
|
|
42273
|
-
|
|
42274
|
-
|
|
42961
|
+
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
42962
|
+
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
|
|
42963
|
+
if (gutter <= SCROLLBAR_MAX) {
|
|
42964
|
+
width10 -= gutter;
|
|
42275
42965
|
}
|
|
42276
|
-
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
42277
|
-
width10 += windowScrollbarX;
|
|
42278
42966
|
}
|
|
42279
42967
|
return {
|
|
42280
42968
|
width: width10,
|
|
@@ -42287,7 +42975,7 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
42287
42975
|
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
|
|
42288
42976
|
const top = clientRect.top + element.clientTop;
|
|
42289
42977
|
const left = clientRect.left + element.clientLeft;
|
|
42290
|
-
const scale2 =
|
|
42978
|
+
const scale2 = getScale(element);
|
|
42291
42979
|
const width10 = element.clientWidth * scale2.x;
|
|
42292
42980
|
const height10 = element.clientHeight * scale2.y;
|
|
42293
42981
|
const x = left * scale2.x;
|
|
@@ -42301,8 +42989,8 @@ function getInnerBoundingClientRect(element, strategy) {
|
|
|
42301
42989
|
}
|
|
42302
42990
|
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
42303
42991
|
let rect;
|
|
42304
|
-
if (clippingAncestor === "viewport") {
|
|
42305
|
-
rect = getViewportRect(element, strategy);
|
|
42992
|
+
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
|
|
42993
|
+
rect = getViewportRect(element, strategy, clippingAncestor);
|
|
42306
42994
|
} else if (clippingAncestor === "document") {
|
|
42307
42995
|
rect = getDocumentRect(getDocumentElement(element));
|
|
42308
42996
|
} else if (isElement(clippingAncestor)) {
|
|
@@ -42318,33 +43006,24 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
42318
43006
|
}
|
|
42319
43007
|
return rectToClientRect(rect);
|
|
42320
43008
|
}
|
|
42321
|
-
function hasFixedPositionAncestor(element, stopNode) {
|
|
42322
|
-
const parentNode = getParentNode(element);
|
|
42323
|
-
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
42324
|
-
return false;
|
|
42325
|
-
}
|
|
42326
|
-
return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
|
|
42327
|
-
}
|
|
42328
43009
|
function getClippingElementAncestors(element, cache) {
|
|
42329
43010
|
const cachedResult = cache.get(element);
|
|
42330
43011
|
if (cachedResult) {
|
|
42331
43012
|
return cachedResult;
|
|
42332
43013
|
}
|
|
42333
43014
|
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
|
|
42334
|
-
let
|
|
43015
|
+
let lastKeptComputedStyle = null;
|
|
42335
43016
|
const elementIsFixed = getComputedStyle2(element).position === "fixed";
|
|
42336
43017
|
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
42337
43018
|
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
42338
43019
|
const computedStyle = getComputedStyle2(currentNode);
|
|
42339
43020
|
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
42340
|
-
|
|
42341
|
-
|
|
42342
|
-
}
|
|
42343
|
-
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
43021
|
+
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
|
|
43022
|
+
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
|
|
42344
43023
|
if (shouldDropCurrentNode) {
|
|
42345
43024
|
result = result.filter((ancestor) => ancestor !== currentNode);
|
|
42346
43025
|
} else {
|
|
42347
|
-
|
|
43026
|
+
lastKeptComputedStyle = computedStyle;
|
|
42348
43027
|
}
|
|
42349
43028
|
currentNode = getParentNode(currentNode);
|
|
42350
43029
|
}
|
|
@@ -42399,10 +43078,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
42399
43078
|
scrollTop: 0
|
|
42400
43079
|
};
|
|
42401
43080
|
const offsets = createCoords(0);
|
|
42402
|
-
|
|
42403
|
-
offsets.x = getWindowScrollBarX(documentElement);
|
|
42404
|
-
}
|
|
42405
|
-
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
43081
|
+
if (isOffsetParentAnElement || !isFixed) {
|
|
42406
43082
|
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
|
|
42407
43083
|
scroll = getNodeScroll(offsetParent);
|
|
42408
43084
|
}
|
|
@@ -42410,12 +43086,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
42410
43086
|
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
42411
43087
|
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
42412
43088
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
42413
|
-
} else if (documentElement) {
|
|
42414
|
-
setLeftRTLScrollbarOffset();
|
|
42415
43089
|
}
|
|
42416
43090
|
}
|
|
42417
|
-
if (
|
|
42418
|
-
|
|
43091
|
+
if (!isOffsetParentAnElement && documentElement) {
|
|
43092
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
42419
43093
|
}
|
|
42420
43094
|
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
42421
43095
|
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
@@ -42499,7 +43173,7 @@ var platform = {
|
|
|
42499
43173
|
function rectsAreEqual(a, b) {
|
|
42500
43174
|
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
42501
43175
|
}
|
|
42502
|
-
function observeMove(element, onMove) {
|
|
43176
|
+
function observeMove(element, onMove, ancestorResize) {
|
|
42503
43177
|
let io = null;
|
|
42504
43178
|
let timeoutId;
|
|
42505
43179
|
const root = getDocumentElement(element);
|
|
@@ -42542,6 +43216,9 @@ function observeMove(element, onMove) {
|
|
|
42542
43216
|
let isFirstUpdate = true;
|
|
42543
43217
|
function handleObserve(entries) {
|
|
42544
43218
|
const ratio = entries[0].intersectionRatio;
|
|
43219
|
+
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
43220
|
+
return refresh();
|
|
43221
|
+
}
|
|
42545
43222
|
if (ratio !== threshold) {
|
|
42546
43223
|
if (!isFirstUpdate) {
|
|
42547
43224
|
return refresh();
|
|
@@ -42554,9 +43231,6 @@ function observeMove(element, onMove) {
|
|
|
42554
43231
|
refresh(false, ratio);
|
|
42555
43232
|
}
|
|
42556
43233
|
}
|
|
42557
|
-
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
42558
|
-
refresh();
|
|
42559
|
-
}
|
|
42560
43234
|
isFirstUpdate = false;
|
|
42561
43235
|
}
|
|
42562
43236
|
try {
|
|
@@ -42570,8 +43244,14 @@ function observeMove(element, onMove) {
|
|
|
42570
43244
|
}
|
|
42571
43245
|
io.observe(element);
|
|
42572
43246
|
}
|
|
43247
|
+
const win = getWindow(element);
|
|
43248
|
+
const handleResize = () => refresh(ancestorResize);
|
|
43249
|
+
win.addEventListener("resize", handleResize);
|
|
42573
43250
|
refresh(true);
|
|
42574
|
-
return
|
|
43251
|
+
return () => {
|
|
43252
|
+
win.removeEventListener("resize", handleResize);
|
|
43253
|
+
cleanup();
|
|
43254
|
+
};
|
|
42575
43255
|
}
|
|
42576
43256
|
function autoUpdate(reference, floating, update, options) {
|
|
42577
43257
|
if (options === void 0) {
|
|
@@ -42587,12 +43267,10 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
42587
43267
|
const referenceEl = unwrapElement(reference);
|
|
42588
43268
|
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
|
|
42589
43269
|
ancestors.forEach((ancestor) => {
|
|
42590
|
-
ancestorScroll && ancestor.addEventListener("scroll", update
|
|
42591
|
-
passive: true
|
|
42592
|
-
});
|
|
43270
|
+
ancestorScroll && ancestor.addEventListener("scroll", update);
|
|
42593
43271
|
ancestorResize && ancestor.addEventListener("resize", update);
|
|
42594
43272
|
});
|
|
42595
|
-
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
43273
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
|
|
42596
43274
|
let reobserveFrame = -1;
|
|
42597
43275
|
let resizeObserver = null;
|
|
42598
43276
|
if (elementResize) {
|
|
@@ -42652,11 +43330,9 @@ var arrow2 = arrow;
|
|
|
42652
43330
|
var limitShift2 = limitShift;
|
|
42653
43331
|
var computePosition2 = (reference, floating, options) => {
|
|
42654
43332
|
const cache = /* @__PURE__ */ new Map();
|
|
42655
|
-
const mergedOptions = {
|
|
42656
|
-
platform,
|
|
42657
|
-
...options
|
|
42658
|
-
};
|
|
43333
|
+
const mergedOptions = options != null ? options : {};
|
|
42659
43334
|
const platformWithCache = {
|
|
43335
|
+
...platform,
|
|
42660
43336
|
...mergedOptions.platform,
|
|
42661
43337
|
_c: cache
|
|
42662
43338
|
};
|
|
@@ -42667,7 +43343,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
42667
43343
|
};
|
|
42668
43344
|
|
|
42669
43345
|
// node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
42670
|
-
import * as
|
|
43346
|
+
import * as React29 from "react";
|
|
42671
43347
|
import { useLayoutEffect as useLayoutEffect3 } from "react";
|
|
42672
43348
|
import * as ReactDOM3 from "react-dom";
|
|
42673
43349
|
var isClient = typeof document !== "undefined";
|
|
@@ -42733,7 +43409,7 @@ function roundByDPR(element, value) {
|
|
|
42733
43409
|
return Math.round(value * dpr) / dpr;
|
|
42734
43410
|
}
|
|
42735
43411
|
function useLatestRef(value) {
|
|
42736
|
-
const ref =
|
|
43412
|
+
const ref = React29.useRef(value);
|
|
42737
43413
|
index(() => {
|
|
42738
43414
|
ref.current = value;
|
|
42739
43415
|
});
|
|
@@ -42756,7 +43432,7 @@ function useFloating(options) {
|
|
|
42756
43432
|
whileElementsMounted,
|
|
42757
43433
|
open
|
|
42758
43434
|
} = options;
|
|
42759
|
-
const [data, setData] =
|
|
43435
|
+
const [data, setData] = React29.useState({
|
|
42760
43436
|
x: 0,
|
|
42761
43437
|
y: 0,
|
|
42762
43438
|
strategy,
|
|
@@ -42764,19 +43440,19 @@ function useFloating(options) {
|
|
|
42764
43440
|
middlewareData: {},
|
|
42765
43441
|
isPositioned: false
|
|
42766
43442
|
});
|
|
42767
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
43443
|
+
const [latestMiddleware, setLatestMiddleware] = React29.useState(middleware);
|
|
42768
43444
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
42769
43445
|
setLatestMiddleware(middleware);
|
|
42770
43446
|
}
|
|
42771
|
-
const [_reference, _setReference] =
|
|
42772
|
-
const [_floating, _setFloating] =
|
|
42773
|
-
const setReference =
|
|
43447
|
+
const [_reference, _setReference] = React29.useState(null);
|
|
43448
|
+
const [_floating, _setFloating] = React29.useState(null);
|
|
43449
|
+
const setReference = React29.useCallback((node) => {
|
|
42774
43450
|
if (node !== referenceRef.current) {
|
|
42775
43451
|
referenceRef.current = node;
|
|
42776
43452
|
_setReference(node);
|
|
42777
43453
|
}
|
|
42778
43454
|
}, []);
|
|
42779
|
-
const setFloating =
|
|
43455
|
+
const setFloating = React29.useCallback((node) => {
|
|
42780
43456
|
if (node !== floatingRef.current) {
|
|
42781
43457
|
floatingRef.current = node;
|
|
42782
43458
|
_setFloating(node);
|
|
@@ -42784,14 +43460,14 @@ function useFloating(options) {
|
|
|
42784
43460
|
}, []);
|
|
42785
43461
|
const referenceEl = externalReference || _reference;
|
|
42786
43462
|
const floatingEl = externalFloating || _floating;
|
|
42787
|
-
const referenceRef =
|
|
42788
|
-
const floatingRef =
|
|
42789
|
-
const dataRef =
|
|
43463
|
+
const referenceRef = React29.useRef(null);
|
|
43464
|
+
const floatingRef = React29.useRef(null);
|
|
43465
|
+
const dataRef = React29.useRef(data);
|
|
42790
43466
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
42791
43467
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
42792
43468
|
const platformRef = useLatestRef(platform2);
|
|
42793
43469
|
const openRef = useLatestRef(open);
|
|
42794
|
-
const update =
|
|
43470
|
+
const update = React29.useCallback(() => {
|
|
42795
43471
|
if (!referenceRef.current || !floatingRef.current) {
|
|
42796
43472
|
return;
|
|
42797
43473
|
}
|
|
@@ -42829,7 +43505,7 @@ function useFloating(options) {
|
|
|
42829
43505
|
}));
|
|
42830
43506
|
}
|
|
42831
43507
|
}, [open]);
|
|
42832
|
-
const isMountedRef =
|
|
43508
|
+
const isMountedRef = React29.useRef(false);
|
|
42833
43509
|
index(() => {
|
|
42834
43510
|
isMountedRef.current = true;
|
|
42835
43511
|
return () => {
|
|
@@ -42846,17 +43522,17 @@ function useFloating(options) {
|
|
|
42846
43522
|
update();
|
|
42847
43523
|
}
|
|
42848
43524
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
42849
|
-
const refs =
|
|
43525
|
+
const refs = React29.useMemo(() => ({
|
|
42850
43526
|
reference: referenceRef,
|
|
42851
43527
|
floating: floatingRef,
|
|
42852
43528
|
setReference,
|
|
42853
43529
|
setFloating
|
|
42854
43530
|
}), [setReference, setFloating]);
|
|
42855
|
-
const elements =
|
|
43531
|
+
const elements = React29.useMemo(() => ({
|
|
42856
43532
|
reference: referenceEl,
|
|
42857
43533
|
floating: floatingEl
|
|
42858
43534
|
}), [referenceEl, floatingEl]);
|
|
42859
|
-
const floatingStyles =
|
|
43535
|
+
const floatingStyles = React29.useMemo(() => {
|
|
42860
43536
|
const initialStyles = {
|
|
42861
43537
|
position: strategy,
|
|
42862
43538
|
left: 0,
|
|
@@ -42882,7 +43558,7 @@ function useFloating(options) {
|
|
|
42882
43558
|
top: y
|
|
42883
43559
|
};
|
|
42884
43560
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
42885
|
-
return
|
|
43561
|
+
return React29.useMemo(() => ({
|
|
42886
43562
|
...data,
|
|
42887
43563
|
update,
|
|
42888
43564
|
refs,
|
|
@@ -42977,30 +43653,10 @@ var arrow3 = (options, deps) => {
|
|
|
42977
43653
|
};
|
|
42978
43654
|
};
|
|
42979
43655
|
|
|
42980
|
-
// node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
42981
|
-
import * as React29 from "react";
|
|
42982
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
42983
|
-
var NAME = "Arrow";
|
|
42984
|
-
var Arrow = React29.forwardRef((props, forwardedRef) => {
|
|
42985
|
-
const { children, width: width10 = 10, height: height10 = 5, ...arrowProps } = props;
|
|
42986
|
-
return /* @__PURE__ */ jsx28(
|
|
42987
|
-
Primitive.svg,
|
|
42988
|
-
{
|
|
42989
|
-
...arrowProps,
|
|
42990
|
-
ref: forwardedRef,
|
|
42991
|
-
width: width10,
|
|
42992
|
-
height: height10,
|
|
42993
|
-
viewBox: "0 0 30 10",
|
|
42994
|
-
preserveAspectRatio: "none",
|
|
42995
|
-
children: props.asChild ? children : /* @__PURE__ */ jsx28("polygon", { points: "0,0 30,0 15,10" })
|
|
42996
|
-
}
|
|
42997
|
-
);
|
|
42998
|
-
});
|
|
42999
|
-
Arrow.displayName = NAME;
|
|
43000
|
-
var Root = Arrow;
|
|
43001
|
-
|
|
43002
43656
|
// node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
43003
43657
|
import * as React30 from "react";
|
|
43658
|
+
var __defProp17 = Object.defineProperty;
|
|
43659
|
+
var __name15 = (target, value) => __defProp17(target, "name", { value, configurable: true });
|
|
43004
43660
|
function useSize(element) {
|
|
43005
43661
|
const [size4, setSize] = React30.useState(void 0);
|
|
43006
43662
|
useLayoutEffect2(() => {
|
|
@@ -43035,17 +43691,20 @@ function useSize(element) {
|
|
|
43035
43691
|
}, [element]);
|
|
43036
43692
|
return size4;
|
|
43037
43693
|
}
|
|
43694
|
+
__name15(useSize, "useSize");
|
|
43038
43695
|
|
|
43039
43696
|
// node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
43040
|
-
import { jsx as
|
|
43697
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
43698
|
+
var __defProp18 = Object.defineProperty;
|
|
43699
|
+
var __name16 = (target, value) => __defProp18(target, "name", { value, configurable: true });
|
|
43041
43700
|
var POPPER_NAME = "Popper";
|
|
43042
43701
|
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
43043
43702
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
43044
|
-
var Popper = (props) => {
|
|
43703
|
+
var Popper = /* @__PURE__ */ __name16((props) => {
|
|
43045
43704
|
const { __scopePopper, children } = props;
|
|
43046
43705
|
const [anchor, setAnchor] = React31.useState(null);
|
|
43047
43706
|
const [placementState, setPlacementState] = React31.useState(void 0);
|
|
43048
|
-
return /* @__PURE__ */
|
|
43707
|
+
return /* @__PURE__ */ jsx28(
|
|
43049
43708
|
PopperProvider,
|
|
43050
43709
|
{
|
|
43051
43710
|
scope: __scopePopper,
|
|
@@ -43056,11 +43715,10 @@ var Popper = (props) => {
|
|
|
43056
43715
|
children
|
|
43057
43716
|
}
|
|
43058
43717
|
);
|
|
43059
|
-
};
|
|
43060
|
-
Popper.displayName = POPPER_NAME;
|
|
43718
|
+
}, "Popper");
|
|
43061
43719
|
var ANCHOR_NAME = "PopperAnchor";
|
|
43062
|
-
var PopperAnchor = React31.forwardRef(
|
|
43063
|
-
(props, forwardedRef)
|
|
43720
|
+
var PopperAnchor = /* @__PURE__ */ React31.forwardRef(
|
|
43721
|
+
/* @__PURE__ */ __name16(function PopperAnchor2(props, forwardedRef) {
|
|
43064
43722
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
43065
43723
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
43066
43724
|
const ref = React31.useRef(null);
|
|
@@ -43089,7 +43747,7 @@ var PopperAnchor = React31.forwardRef(
|
|
|
43089
43747
|
const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);
|
|
43090
43748
|
const placedSide = sideAndAlign?.[0];
|
|
43091
43749
|
const placedAlign = sideAndAlign?.[1];
|
|
43092
|
-
return virtualRef ? null : /* @__PURE__ */
|
|
43750
|
+
return virtualRef ? null : /* @__PURE__ */ jsx28(
|
|
43093
43751
|
Primitive.div,
|
|
43094
43752
|
{
|
|
43095
43753
|
"data-radix-popper-side": placedSide,
|
|
@@ -43098,13 +43756,12 @@ var PopperAnchor = React31.forwardRef(
|
|
|
43098
43756
|
ref: composedRefs
|
|
43099
43757
|
}
|
|
43100
43758
|
);
|
|
43101
|
-
}
|
|
43759
|
+
}, "PopperAnchor")
|
|
43102
43760
|
);
|
|
43103
|
-
PopperAnchor.displayName = ANCHOR_NAME;
|
|
43104
43761
|
var CONTENT_NAME = "PopperContent";
|
|
43105
43762
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
43106
|
-
var PopperContent = React31.forwardRef(
|
|
43107
|
-
(props, forwardedRef)
|
|
43763
|
+
var PopperContent = /* @__PURE__ */ React31.forwardRef(
|
|
43764
|
+
/* @__PURE__ */ __name16(function PopperContent2(props, forwardedRef) {
|
|
43108
43765
|
const {
|
|
43109
43766
|
__scopePopper,
|
|
43110
43767
|
side = "bottom",
|
|
@@ -43142,12 +43799,12 @@ var PopperContent = React31.forwardRef(
|
|
|
43142
43799
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
43143
43800
|
strategy: "fixed",
|
|
43144
43801
|
placement: desiredPlacement,
|
|
43145
|
-
whileElementsMounted: (...args) => {
|
|
43802
|
+
whileElementsMounted: /* @__PURE__ */ __name16((...args) => {
|
|
43146
43803
|
const cleanup = autoUpdate(...args, {
|
|
43147
43804
|
animationFrame: updatePositionStrategy === "always"
|
|
43148
43805
|
});
|
|
43149
43806
|
return cleanup;
|
|
43150
|
-
},
|
|
43807
|
+
}, "whileElementsMounted"),
|
|
43151
43808
|
elements: {
|
|
43152
43809
|
reference: context.anchor
|
|
43153
43810
|
},
|
|
@@ -43162,14 +43819,14 @@ var PopperContent = React31.forwardRef(
|
|
|
43162
43819
|
avoidCollisions && flip3({ ...detectOverflowOptions }),
|
|
43163
43820
|
size3({
|
|
43164
43821
|
...detectOverflowOptions,
|
|
43165
|
-
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
43822
|
+
apply: /* @__PURE__ */ __name16(({ elements, rects, availableWidth, availableHeight }) => {
|
|
43166
43823
|
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
43167
43824
|
const contentStyle = elements.floating.style;
|
|
43168
43825
|
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
43169
43826
|
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
43170
43827
|
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
43171
43828
|
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
43172
|
-
}
|
|
43829
|
+
}, "apply")
|
|
43173
43830
|
}),
|
|
43174
43831
|
arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
|
|
43175
43832
|
transformOrigin({ arrowWidth, arrowHeight }),
|
|
@@ -43208,7 +43865,7 @@ var PopperContent = React31.forwardRef(
|
|
|
43208
43865
|
useLayoutEffect2(() => {
|
|
43209
43866
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
43210
43867
|
}, [content]);
|
|
43211
|
-
return /* @__PURE__ */
|
|
43868
|
+
return /* @__PURE__ */ jsx28(
|
|
43212
43869
|
"div",
|
|
43213
43870
|
{
|
|
43214
43871
|
ref: refs.setFloating,
|
|
@@ -43232,7 +43889,7 @@ var PopperContent = React31.forwardRef(
|
|
|
43232
43889
|
}
|
|
43233
43890
|
},
|
|
43234
43891
|
dir: props.dir,
|
|
43235
|
-
children: /* @__PURE__ */
|
|
43892
|
+
children: /* @__PURE__ */ jsx28(
|
|
43236
43893
|
PopperContentProvider,
|
|
43237
43894
|
{
|
|
43238
43895
|
scope: __scopePopper,
|
|
@@ -43242,7 +43899,7 @@ var PopperContent = React31.forwardRef(
|
|
|
43242
43899
|
arrowX,
|
|
43243
43900
|
arrowY,
|
|
43244
43901
|
shouldHideArrow: cannotCenterArrow,
|
|
43245
|
-
children: /* @__PURE__ */
|
|
43902
|
+
children: /* @__PURE__ */ jsx28(
|
|
43246
43903
|
Primitive.div,
|
|
43247
43904
|
{
|
|
43248
43905
|
"data-side": placedSide,
|
|
@@ -43251,9 +43908,10 @@ var PopperContent = React31.forwardRef(
|
|
|
43251
43908
|
ref: composedRefs,
|
|
43252
43909
|
style: {
|
|
43253
43910
|
...contentProps.style,
|
|
43254
|
-
// if the PopperContent hasn't been placed yet (not all
|
|
43255
|
-
// we prevent animations so that users'
|
|
43256
|
-
|
|
43911
|
+
// if the PopperContent hasn't been placed yet (not all
|
|
43912
|
+
// measurements done) we prevent animations so that users'
|
|
43913
|
+
// animations don't kick in too early from the wrong sides.
|
|
43914
|
+
animation: !isPositioned ? "none" : contentProps.style?.animation
|
|
43257
43915
|
}
|
|
43258
43916
|
}
|
|
43259
43917
|
)
|
|
@@ -43261,68 +43919,13 @@ var PopperContent = React31.forwardRef(
|
|
|
43261
43919
|
)
|
|
43262
43920
|
}
|
|
43263
43921
|
);
|
|
43264
|
-
}
|
|
43922
|
+
}, "PopperContent")
|
|
43265
43923
|
);
|
|
43266
|
-
PopperContent.displayName = CONTENT_NAME;
|
|
43267
|
-
var ARROW_NAME = "PopperArrow";
|
|
43268
|
-
var OPPOSITE_SIDE = {
|
|
43269
|
-
top: "bottom",
|
|
43270
|
-
right: "left",
|
|
43271
|
-
bottom: "top",
|
|
43272
|
-
left: "right"
|
|
43273
|
-
};
|
|
43274
|
-
var PopperArrow = React31.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
43275
|
-
const { __scopePopper, ...arrowProps } = props;
|
|
43276
|
-
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
43277
|
-
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
43278
|
-
return (
|
|
43279
|
-
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
43280
|
-
// doesn't report size as we'd expect on SVG elements.
|
|
43281
|
-
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
43282
|
-
/* @__PURE__ */ jsx29(
|
|
43283
|
-
"span",
|
|
43284
|
-
{
|
|
43285
|
-
ref: contentContext.onArrowChange,
|
|
43286
|
-
style: {
|
|
43287
|
-
position: "absolute",
|
|
43288
|
-
left: contentContext.arrowX,
|
|
43289
|
-
top: contentContext.arrowY,
|
|
43290
|
-
[baseSide]: 0,
|
|
43291
|
-
transformOrigin: {
|
|
43292
|
-
top: "",
|
|
43293
|
-
right: "0 0",
|
|
43294
|
-
bottom: "center 0",
|
|
43295
|
-
left: "100% 0"
|
|
43296
|
-
}[contentContext.placedSide],
|
|
43297
|
-
transform: {
|
|
43298
|
-
top: "translateY(100%)",
|
|
43299
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
43300
|
-
bottom: `rotate(180deg)`,
|
|
43301
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
43302
|
-
}[contentContext.placedSide],
|
|
43303
|
-
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
43304
|
-
},
|
|
43305
|
-
children: /* @__PURE__ */ jsx29(
|
|
43306
|
-
Root,
|
|
43307
|
-
{
|
|
43308
|
-
...arrowProps,
|
|
43309
|
-
ref: forwardedRef,
|
|
43310
|
-
style: {
|
|
43311
|
-
...arrowProps.style,
|
|
43312
|
-
// ensures the element can be measured correctly (mostly for if SVG)
|
|
43313
|
-
display: "block"
|
|
43314
|
-
}
|
|
43315
|
-
}
|
|
43316
|
-
)
|
|
43317
|
-
}
|
|
43318
|
-
)
|
|
43319
|
-
);
|
|
43320
|
-
});
|
|
43321
|
-
PopperArrow.displayName = ARROW_NAME;
|
|
43322
43924
|
function isNotNull2(value) {
|
|
43323
43925
|
return value !== null;
|
|
43324
43926
|
}
|
|
43325
|
-
|
|
43927
|
+
__name16(isNotNull2, "isNotNull");
|
|
43928
|
+
var transformOrigin = /* @__PURE__ */ __name16((options) => ({
|
|
43326
43929
|
name: "transformOrigin",
|
|
43327
43930
|
options,
|
|
43328
43931
|
fn(data) {
|
|
@@ -43352,48 +43955,52 @@ var transformOrigin = (options) => ({
|
|
|
43352
43955
|
}
|
|
43353
43956
|
return { data: { x, y } };
|
|
43354
43957
|
}
|
|
43355
|
-
});
|
|
43958
|
+
}), "transformOrigin");
|
|
43356
43959
|
function getSideAndAlignFromPlacement(placement) {
|
|
43357
43960
|
const [side, align = "center"] = placement.split("-");
|
|
43358
43961
|
return [side, align];
|
|
43359
43962
|
}
|
|
43963
|
+
__name16(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
|
|
43360
43964
|
var Root2 = Popper;
|
|
43361
43965
|
var Anchor = PopperAnchor;
|
|
43362
43966
|
var Content = PopperContent;
|
|
43363
|
-
var Arrow2 = PopperArrow;
|
|
43364
43967
|
|
|
43365
43968
|
// node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
43366
43969
|
import * as React32 from "react";
|
|
43367
43970
|
import * as ReactDOM4 from "react-dom";
|
|
43368
|
-
import { jsx as
|
|
43369
|
-
var
|
|
43370
|
-
var
|
|
43371
|
-
|
|
43372
|
-
|
|
43373
|
-
|
|
43374
|
-
|
|
43375
|
-
|
|
43376
|
-
|
|
43377
|
-
|
|
43971
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
43972
|
+
var __defProp19 = Object.defineProperty;
|
|
43973
|
+
var __name17 = (target, value) => __defProp19(target, "name", { value, configurable: true });
|
|
43974
|
+
var Portal = /* @__PURE__ */ React32.forwardRef(
|
|
43975
|
+
/* @__PURE__ */ __name17(function Portal2(props, forwardedRef) {
|
|
43976
|
+
const { container: containerProp, ...portalProps } = props;
|
|
43977
|
+
const [mounted, setMounted] = React32.useState(false);
|
|
43978
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
43979
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
43980
|
+
return container ? ReactDOM4.createPortal(/* @__PURE__ */ jsx29(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
43981
|
+
}, "Portal")
|
|
43982
|
+
);
|
|
43378
43983
|
|
|
43379
43984
|
// node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
43380
43985
|
import * as React210 from "react";
|
|
43381
43986
|
import * as React33 from "react";
|
|
43987
|
+
var __defProp20 = Object.defineProperty;
|
|
43988
|
+
var __name18 = (target, value) => __defProp20(target, "name", { value, configurable: true });
|
|
43382
43989
|
function useStateMachine(initialState, machine) {
|
|
43383
43990
|
return React33.useReducer((state, event) => {
|
|
43384
43991
|
const nextState = machine[state][event];
|
|
43385
43992
|
return nextState ?? state;
|
|
43386
43993
|
}, initialState);
|
|
43387
43994
|
}
|
|
43388
|
-
|
|
43995
|
+
__name18(useStateMachine, "useStateMachine");
|
|
43996
|
+
var Presence = /* @__PURE__ */ __name18((props) => {
|
|
43389
43997
|
const { present, children } = props;
|
|
43390
43998
|
const presence = usePresence(present);
|
|
43391
43999
|
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React210.Children.only(children);
|
|
43392
44000
|
const ref = useStableComposedRefs(presence.ref, getElementRef2(child));
|
|
43393
44001
|
const forceMount = typeof children === "function";
|
|
43394
44002
|
return forceMount || presence.isPresent ? React210.cloneElement(child, { ref }) : null;
|
|
43395
|
-
};
|
|
43396
|
-
Presence.displayName = "Presence";
|
|
44003
|
+
}, "Presence");
|
|
43397
44004
|
function usePresence(present) {
|
|
43398
44005
|
const [node, setNode] = React210.useState();
|
|
43399
44006
|
const stylesRef = React210.useRef(null);
|
|
@@ -43449,7 +44056,7 @@ function usePresence(present) {
|
|
|
43449
44056
|
if (node) {
|
|
43450
44057
|
let timeoutId;
|
|
43451
44058
|
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
43452
|
-
const handleAnimationEnd = (event) => {
|
|
44059
|
+
const handleAnimationEnd = /* @__PURE__ */ __name18((event) => {
|
|
43453
44060
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
43454
44061
|
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
43455
44062
|
if (event.target === node && isCurrentAnimation) {
|
|
@@ -43464,12 +44071,12 @@ function usePresence(present) {
|
|
|
43464
44071
|
});
|
|
43465
44072
|
}
|
|
43466
44073
|
}
|
|
43467
|
-
};
|
|
43468
|
-
const handleAnimationStart = (event) => {
|
|
44074
|
+
}, "handleAnimationEnd");
|
|
44075
|
+
const handleAnimationStart = /* @__PURE__ */ __name18((event) => {
|
|
43469
44076
|
if (event.target === node) {
|
|
43470
44077
|
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
43471
44078
|
}
|
|
43472
|
-
};
|
|
44079
|
+
}, "handleAnimationStart");
|
|
43473
44080
|
node.addEventListener("animationstart", handleAnimationStart);
|
|
43474
44081
|
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
43475
44082
|
node.addEventListener("animationend", handleAnimationEnd);
|
|
@@ -43497,6 +44104,7 @@ function usePresence(present) {
|
|
|
43497
44104
|
}, [])
|
|
43498
44105
|
};
|
|
43499
44106
|
}
|
|
44107
|
+
__name18(usePresence, "usePresence");
|
|
43500
44108
|
function setRef2(ref, value) {
|
|
43501
44109
|
if (typeof ref === "function") {
|
|
43502
44110
|
return ref(value);
|
|
@@ -43504,6 +44112,7 @@ function setRef2(ref, value) {
|
|
|
43504
44112
|
ref.current = value;
|
|
43505
44113
|
}
|
|
43506
44114
|
}
|
|
44115
|
+
__name18(setRef2, "setRef");
|
|
43507
44116
|
function useStableComposedRefs(...refs) {
|
|
43508
44117
|
const refsRef = React210.useRef(refs);
|
|
43509
44118
|
refsRef.current = refs;
|
|
@@ -43531,9 +44140,11 @@ function useStableComposedRefs(...refs) {
|
|
|
43531
44140
|
}
|
|
43532
44141
|
}, []);
|
|
43533
44142
|
}
|
|
44143
|
+
__name18(useStableComposedRefs, "useStableComposedRefs");
|
|
43534
44144
|
function getAnimationName(styles) {
|
|
43535
44145
|
return styles?.animationName || "none";
|
|
43536
44146
|
}
|
|
44147
|
+
__name18(getAnimationName, "getAnimationName");
|
|
43537
44148
|
function getElementRef2(element) {
|
|
43538
44149
|
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
43539
44150
|
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
@@ -43547,6 +44158,7 @@ function getElementRef2(element) {
|
|
|
43547
44158
|
}
|
|
43548
44159
|
return element.props.ref || element.ref;
|
|
43549
44160
|
}
|
|
44161
|
+
__name18(getElementRef2, "getElementRef");
|
|
43550
44162
|
|
|
43551
44163
|
// node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
43552
44164
|
import * as React35 from "react";
|
|
@@ -43554,6 +44166,8 @@ import * as React35 from "react";
|
|
|
43554
44166
|
// node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
|
|
43555
44167
|
import * as React211 from "react";
|
|
43556
44168
|
import * as React34 from "react";
|
|
44169
|
+
var __defProp21 = Object.defineProperty;
|
|
44170
|
+
var __name19 = (target, value) => __defProp21(target, "name", { value, configurable: true });
|
|
43557
44171
|
var _isHydrated = false;
|
|
43558
44172
|
function useIsHydrated() {
|
|
43559
44173
|
const [isHydrated, setIsHydrated] = React34.useState(_isHydrated);
|
|
@@ -43565,11 +44179,13 @@ function useIsHydrated() {
|
|
|
43565
44179
|
}, []);
|
|
43566
44180
|
return isHydrated;
|
|
43567
44181
|
}
|
|
44182
|
+
__name19(useIsHydrated, "useIsHydrated");
|
|
43568
44183
|
var useReactSyncExternalStore = React211[" useSyncExternalStore ".trim().toString()];
|
|
43569
44184
|
function subscribe() {
|
|
43570
44185
|
return () => {
|
|
43571
44186
|
};
|
|
43572
44187
|
}
|
|
44188
|
+
__name19(subscribe, "subscribe");
|
|
43573
44189
|
function useIsHydratedModern() {
|
|
43574
44190
|
return useReactSyncExternalStore(
|
|
43575
44191
|
subscribe,
|
|
@@ -43577,10 +44193,13 @@ function useIsHydratedModern() {
|
|
|
43577
44193
|
() => false
|
|
43578
44194
|
);
|
|
43579
44195
|
}
|
|
44196
|
+
__name19(useIsHydratedModern, "useIsHydratedModern");
|
|
43580
44197
|
var useIsHydrated2 = typeof useReactSyncExternalStore === "function" ? useIsHydratedModern : useIsHydrated;
|
|
43581
44198
|
|
|
43582
44199
|
// node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
43583
|
-
import { jsx as
|
|
44200
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
44201
|
+
var __defProp22 = Object.defineProperty;
|
|
44202
|
+
var __name20 = (target, value) => __defProp22(target, "name", { value, configurable: true });
|
|
43584
44203
|
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
43585
44204
|
var EVENT_OPTIONS2 = { bubbles: false, cancelable: true };
|
|
43586
44205
|
var GROUP_NAME = "RovingFocusGroup";
|
|
@@ -43590,13 +44209,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
43590
44209
|
[createCollectionScope]
|
|
43591
44210
|
);
|
|
43592
44211
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
43593
|
-
var RovingFocusGroup = React35.forwardRef(
|
|
43594
|
-
|
|
43595
|
-
|
|
43596
|
-
|
|
44212
|
+
var RovingFocusGroup = /* @__PURE__ */ React35.forwardRef(
|
|
44213
|
+
// blank line to reduce diff noise
|
|
44214
|
+
/* @__PURE__ */ __name20(function RovingFocusGroup2(props, forwardedRef) {
|
|
44215
|
+
return /* @__PURE__ */ jsx30(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx30(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx30(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
44216
|
+
}, "RovingFocusGroup")
|
|
43597
44217
|
);
|
|
43598
|
-
|
|
43599
|
-
var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
|
|
44218
|
+
var RovingFocusGroupImpl = /* @__PURE__ */ React35.forwardRef(/* @__PURE__ */ __name20(function RovingFocusGroupImpl2(props, forwardedRef) {
|
|
43600
44219
|
const {
|
|
43601
44220
|
__scopeRovingFocusGroup,
|
|
43602
44221
|
orientation: orientation2,
|
|
@@ -43630,7 +44249,7 @@ var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
|
|
|
43630
44249
|
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
43631
44250
|
}
|
|
43632
44251
|
}, [handleEntryFocus]);
|
|
43633
|
-
return /* @__PURE__ */
|
|
44252
|
+
return /* @__PURE__ */ jsx30(
|
|
43634
44253
|
RovingFocusProvider,
|
|
43635
44254
|
{
|
|
43636
44255
|
scope: __scopeRovingFocusGroup,
|
|
@@ -43651,7 +44270,7 @@ var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
|
|
|
43651
44270
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
43652
44271
|
[]
|
|
43653
44272
|
),
|
|
43654
|
-
children: /* @__PURE__ */
|
|
44273
|
+
children: /* @__PURE__ */ jsx30(
|
|
43655
44274
|
Primitive.div,
|
|
43656
44275
|
{
|
|
43657
44276
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
@@ -43685,10 +44304,11 @@ var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
|
|
|
43685
44304
|
)
|
|
43686
44305
|
}
|
|
43687
44306
|
);
|
|
43688
|
-
});
|
|
44307
|
+
}, "RovingFocusGroupImpl"));
|
|
43689
44308
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
43690
|
-
var RovingFocusGroupItem = React35.forwardRef(
|
|
43691
|
-
|
|
44309
|
+
var RovingFocusGroupItem = /* @__PURE__ */ React35.forwardRef(
|
|
44310
|
+
// blank line to reduce diff noise
|
|
44311
|
+
/* @__PURE__ */ __name20(function RovingFocusGroupItem2(props, forwardedRef) {
|
|
43692
44312
|
const {
|
|
43693
44313
|
__scopeRovingFocusGroup,
|
|
43694
44314
|
focusable = true,
|
|
@@ -43718,14 +44338,14 @@ var RovingFocusGroupItem = React35.forwardRef(
|
|
|
43718
44338
|
onFocusableItemAdd();
|
|
43719
44339
|
return () => onFocusableItemRemove();
|
|
43720
44340
|
}, [isHydrated, focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
43721
|
-
return /* @__PURE__ */
|
|
44341
|
+
return /* @__PURE__ */ jsx30(
|
|
43722
44342
|
Collection.ItemSlot,
|
|
43723
44343
|
{
|
|
43724
44344
|
scope: __scopeRovingFocusGroup,
|
|
43725
44345
|
id,
|
|
43726
44346
|
focusable,
|
|
43727
44347
|
active,
|
|
43728
|
-
children: /* @__PURE__ */
|
|
44348
|
+
children: /* @__PURE__ */ jsx30(
|
|
43729
44349
|
Primitive.span,
|
|
43730
44350
|
{
|
|
43731
44351
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
@@ -43763,9 +44383,8 @@ var RovingFocusGroupItem = React35.forwardRef(
|
|
|
43763
44383
|
)
|
|
43764
44384
|
}
|
|
43765
44385
|
);
|
|
43766
|
-
}
|
|
44386
|
+
}, "RovingFocusGroupItem")
|
|
43767
44387
|
);
|
|
43768
|
-
RovingFocusGroupItem.displayName = ITEM_NAME;
|
|
43769
44388
|
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
43770
44389
|
ArrowLeft: "prev",
|
|
43771
44390
|
ArrowUp: "prev",
|
|
@@ -43780,12 +44399,14 @@ function getDirectionAwareKey(key, dir) {
|
|
|
43780
44399
|
if (dir !== "rtl") return key;
|
|
43781
44400
|
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
43782
44401
|
}
|
|
44402
|
+
__name20(getDirectionAwareKey, "getDirectionAwareKey");
|
|
43783
44403
|
function getFocusIntent(event, orientation2, dir) {
|
|
43784
44404
|
const key = getDirectionAwareKey(event.key, dir);
|
|
43785
44405
|
if (orientation2 === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
43786
44406
|
if (orientation2 === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
43787
44407
|
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
43788
44408
|
}
|
|
44409
|
+
__name20(getFocusIntent, "getFocusIntent");
|
|
43789
44410
|
function focusFirst2(candidates, preventScroll = false) {
|
|
43790
44411
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
43791
44412
|
for (const candidate of candidates) {
|
|
@@ -43794,10 +44415,12 @@ function focusFirst2(candidates, preventScroll = false) {
|
|
|
43794
44415
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
43795
44416
|
}
|
|
43796
44417
|
}
|
|
44418
|
+
__name20(focusFirst2, "focusFirst");
|
|
43797
44419
|
function wrapArray(array, startIndex) {
|
|
43798
44420
|
return array.map((_, index2) => array[(startIndex + index2) % array.length]);
|
|
43799
44421
|
}
|
|
43800
|
-
|
|
44422
|
+
__name20(wrapArray, "wrapArray");
|
|
44423
|
+
var Root = RovingFocusGroup;
|
|
43801
44424
|
var Item = RovingFocusGroupItem;
|
|
43802
44425
|
|
|
43803
44426
|
// node_modules/aria-hidden/dist/es2015/index.js
|
|
@@ -44642,7 +45265,9 @@ ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
|
44642
45265
|
var Combination_default = ReactRemoveScroll;
|
|
44643
45266
|
|
|
44644
45267
|
// node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
44645
|
-
import { jsx as
|
|
45268
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
45269
|
+
var __defProp23 = Object.defineProperty;
|
|
45270
|
+
var __name21 = (target, value) => __defProp23(target, "name", { value, configurable: true });
|
|
44646
45271
|
var SELECTION_KEYS = ["Enter", " "];
|
|
44647
45272
|
var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
|
|
44648
45273
|
var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
|
|
@@ -44666,7 +45291,7 @@ var usePopperScope = createPopperScope();
|
|
|
44666
45291
|
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
44667
45292
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
44668
45293
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
44669
|
-
var Menu = (props) => {
|
|
45294
|
+
var Menu = /* @__PURE__ */ __name21((props) => {
|
|
44670
45295
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
44671
45296
|
const popperScope = usePopperScope(__scopeMenu);
|
|
44672
45297
|
const [content, setContent] = React43.useState(null);
|
|
@@ -44674,12 +45299,12 @@ var Menu = (props) => {
|
|
|
44674
45299
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
44675
45300
|
const direction = useDirection(dir);
|
|
44676
45301
|
React43.useEffect(() => {
|
|
44677
|
-
const handleKeyDown = () => {
|
|
45302
|
+
const handleKeyDown = /* @__PURE__ */ __name21(() => {
|
|
44678
45303
|
isUsingKeyboardRef.current = true;
|
|
44679
45304
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
44680
45305
|
document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
|
|
44681
|
-
};
|
|
44682
|
-
const handlePointer = () => isUsingKeyboardRef.current = false;
|
|
45306
|
+
}, "handleKeyDown");
|
|
45307
|
+
const handlePointer = /* @__PURE__ */ __name21(() => isUsingKeyboardRef.current = false, "handlePointer");
|
|
44683
45308
|
document.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
44684
45309
|
return () => {
|
|
44685
45310
|
document.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
@@ -44691,11 +45316,11 @@ var Menu = (props) => {
|
|
|
44691
45316
|
if (!open) {
|
|
44692
45317
|
return;
|
|
44693
45318
|
}
|
|
44694
|
-
const handleBlur = () => handleOpenChange(false);
|
|
45319
|
+
const handleBlur = /* @__PURE__ */ __name21(() => handleOpenChange(false), "handleBlur");
|
|
44695
45320
|
window.addEventListener("blur", handleBlur);
|
|
44696
45321
|
return () => window.removeEventListener("blur", handleBlur);
|
|
44697
45322
|
}, [open, handleOpenChange]);
|
|
44698
|
-
return /* @__PURE__ */
|
|
45323
|
+
return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
|
|
44699
45324
|
MenuProvider,
|
|
44700
45325
|
{
|
|
44701
45326
|
scope: __scopeMenu,
|
|
@@ -44703,7 +45328,7 @@ var Menu = (props) => {
|
|
|
44703
45328
|
onOpenChange: handleOpenChange,
|
|
44704
45329
|
content,
|
|
44705
45330
|
onContentChange: setContent,
|
|
44706
|
-
children: /* @__PURE__ */
|
|
45331
|
+
children: /* @__PURE__ */ jsx31(
|
|
44707
45332
|
MenuRootProvider,
|
|
44708
45333
|
{
|
|
44709
45334
|
scope: __scopeMenu,
|
|
@@ -44716,40 +45341,37 @@ var Menu = (props) => {
|
|
|
44716
45341
|
)
|
|
44717
45342
|
}
|
|
44718
45343
|
) });
|
|
44719
|
-
};
|
|
44720
|
-
|
|
44721
|
-
|
|
44722
|
-
var MenuAnchor = React43.forwardRef(
|
|
44723
|
-
(props, forwardedRef) => {
|
|
45344
|
+
}, "Menu");
|
|
45345
|
+
var MenuAnchor = /* @__PURE__ */ React43.forwardRef(
|
|
45346
|
+
/* @__PURE__ */ __name21(function MenuAnchor2(props, forwardedRef) {
|
|
44724
45347
|
const { __scopeMenu, ...anchorProps } = props;
|
|
44725
45348
|
const popperScope = usePopperScope(__scopeMenu);
|
|
44726
|
-
return /* @__PURE__ */
|
|
44727
|
-
}
|
|
45349
|
+
return /* @__PURE__ */ jsx31(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
45350
|
+
}, "MenuAnchor")
|
|
44728
45351
|
);
|
|
44729
|
-
|
|
44730
|
-
var
|
|
44731
|
-
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
|
|
45352
|
+
var PORTAL_NAME = "MenuPortal";
|
|
45353
|
+
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
|
|
44732
45354
|
forceMount: void 0
|
|
44733
45355
|
});
|
|
44734
|
-
var MenuPortal = (props) => {
|
|
45356
|
+
var MenuPortal = /* @__PURE__ */ __name21((props) => {
|
|
44735
45357
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
44736
|
-
const context = useMenuContext(
|
|
44737
|
-
return /* @__PURE__ */
|
|
44738
|
-
};
|
|
44739
|
-
MenuPortal.displayName = PORTAL_NAME2;
|
|
45358
|
+
const context = useMenuContext(PORTAL_NAME, __scopeMenu);
|
|
45359
|
+
return /* @__PURE__ */ jsx31(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Portal, { asChild: true, container, children }) }) });
|
|
45360
|
+
}, "MenuPortal");
|
|
44740
45361
|
var CONTENT_NAME2 = "MenuContent";
|
|
44741
45362
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
44742
|
-
var MenuContent = React43.forwardRef(
|
|
44743
|
-
(props, forwardedRef)
|
|
45363
|
+
var MenuContent = /* @__PURE__ */ React43.forwardRef(
|
|
45364
|
+
/* @__PURE__ */ __name21(function MenuContent2(props, forwardedRef) {
|
|
44744
45365
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
44745
45366
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
44746
45367
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
44747
45368
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
44748
|
-
return /* @__PURE__ */
|
|
44749
|
-
}
|
|
45369
|
+
return /* @__PURE__ */ jsx31(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx31(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx31(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
45370
|
+
}, "MenuContent")
|
|
44750
45371
|
);
|
|
44751
|
-
var MenuRootContentModal = React43.forwardRef(
|
|
44752
|
-
|
|
45372
|
+
var MenuRootContentModal = /* @__PURE__ */ React43.forwardRef(
|
|
45373
|
+
// blank line to reduce diff noise
|
|
45374
|
+
/* @__PURE__ */ __name21(function MenuRootContentModal2(props, forwardedRef) {
|
|
44753
45375
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
44754
45376
|
const ref = React43.useRef(null);
|
|
44755
45377
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -44757,7 +45379,7 @@ var MenuRootContentModal = React43.forwardRef(
|
|
|
44757
45379
|
const content = ref.current;
|
|
44758
45380
|
if (content) return hideOthers(content);
|
|
44759
45381
|
}, []);
|
|
44760
|
-
return /* @__PURE__ */
|
|
45382
|
+
return /* @__PURE__ */ jsx31(
|
|
44761
45383
|
MenuContentImpl,
|
|
44762
45384
|
{
|
|
44763
45385
|
...props,
|
|
@@ -44773,11 +45395,11 @@ var MenuRootContentModal = React43.forwardRef(
|
|
|
44773
45395
|
onDismiss: () => context.onOpenChange(false)
|
|
44774
45396
|
}
|
|
44775
45397
|
);
|
|
44776
|
-
}
|
|
45398
|
+
}, "MenuRootContentModal")
|
|
44777
45399
|
);
|
|
44778
|
-
var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef)
|
|
45400
|
+
var MenuRootContentNonModal = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name21(function MenuRootContentNonModal2(props, forwardedRef) {
|
|
44779
45401
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
44780
|
-
return /* @__PURE__ */
|
|
45402
|
+
return /* @__PURE__ */ jsx31(
|
|
44781
45403
|
MenuContentImpl,
|
|
44782
45404
|
{
|
|
44783
45405
|
...props,
|
|
@@ -44788,10 +45410,11 @@ var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef) => {
|
|
|
44788
45410
|
onDismiss: () => context.onOpenChange(false)
|
|
44789
45411
|
}
|
|
44790
45412
|
);
|
|
44791
|
-
});
|
|
45413
|
+
}, "MenuRootContentNonModal"));
|
|
44792
45414
|
var Slot = createSlot("MenuContent.ScrollLock");
|
|
44793
|
-
var MenuContentImpl = React43.forwardRef(
|
|
44794
|
-
|
|
45415
|
+
var MenuContentImpl = /* @__PURE__ */ React43.forwardRef(
|
|
45416
|
+
// blank line to reduce diff noise
|
|
45417
|
+
/* @__PURE__ */ __name21(function MenuContentImpl2(props, forwardedRef) {
|
|
44795
45418
|
const {
|
|
44796
45419
|
__scopeMenu,
|
|
44797
45420
|
loop = false,
|
|
@@ -44824,7 +45447,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44824
45447
|
const lastPointerXRef = React43.useRef(0);
|
|
44825
45448
|
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React43.Fragment;
|
|
44826
45449
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
|
|
44827
|
-
const handleTypeaheadSearch = (key) => {
|
|
45450
|
+
const handleTypeaheadSearch = /* @__PURE__ */ __name21((key) => {
|
|
44828
45451
|
const search = searchRef.current + key;
|
|
44829
45452
|
const items = getItems().filter((item) => !item.disabled);
|
|
44830
45453
|
const currentItem = document.activeElement;
|
|
@@ -44832,15 +45455,15 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44832
45455
|
const values = items.map((item) => item.textValue);
|
|
44833
45456
|
const nextMatch = getNextMatch(values, search, currentMatch);
|
|
44834
45457
|
const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
|
|
44835
|
-
(function updateSearch(value) {
|
|
45458
|
+
(/* @__PURE__ */ __name21((function updateSearch(value) {
|
|
44836
45459
|
searchRef.current = value;
|
|
44837
45460
|
window.clearTimeout(timerRef.current);
|
|
44838
45461
|
if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
|
|
44839
|
-
})(search);
|
|
45462
|
+
}), "updateSearch"))(search);
|
|
44840
45463
|
if (newItem) {
|
|
44841
45464
|
setTimeout(() => newItem.focus());
|
|
44842
45465
|
}
|
|
44843
|
-
};
|
|
45466
|
+
}, "handleTypeaheadSearch");
|
|
44844
45467
|
React43.useEffect(() => {
|
|
44845
45468
|
return () => window.clearTimeout(timerRef.current);
|
|
44846
45469
|
}, []);
|
|
@@ -44849,7 +45472,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44849
45472
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
44850
45473
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
44851
45474
|
}, []);
|
|
44852
|
-
return /* @__PURE__ */
|
|
45475
|
+
return /* @__PURE__ */ jsx31(
|
|
44853
45476
|
MenuContentProvider,
|
|
44854
45477
|
{
|
|
44855
45478
|
scope: __scopeMenu,
|
|
@@ -44878,7 +45501,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44878
45501
|
onPointerGraceIntentChange: React43.useCallback((intent) => {
|
|
44879
45502
|
pointerGraceIntentRef.current = intent;
|
|
44880
45503
|
}, []),
|
|
44881
|
-
children: /* @__PURE__ */
|
|
45504
|
+
children: /* @__PURE__ */ jsx31(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx31(
|
|
44882
45505
|
FocusScope,
|
|
44883
45506
|
{
|
|
44884
45507
|
asChild: true,
|
|
@@ -44888,7 +45511,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44888
45511
|
contentRef.current?.focus({ preventScroll: true });
|
|
44889
45512
|
}),
|
|
44890
45513
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
44891
|
-
children: /* @__PURE__ */
|
|
45514
|
+
children: /* @__PURE__ */ jsx31(
|
|
44892
45515
|
DismissableLayer,
|
|
44893
45516
|
{
|
|
44894
45517
|
asChild: true,
|
|
@@ -44898,8 +45521,8 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44898
45521
|
onFocusOutside,
|
|
44899
45522
|
onInteractOutside,
|
|
44900
45523
|
onDismiss,
|
|
44901
|
-
children: /* @__PURE__ */
|
|
44902
|
-
|
|
45524
|
+
children: /* @__PURE__ */ jsx31(
|
|
45525
|
+
Root,
|
|
44903
45526
|
{
|
|
44904
45527
|
asChild: true,
|
|
44905
45528
|
...rovingFocusGroupScope,
|
|
@@ -44912,7 +45535,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44912
45535
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
44913
45536
|
}),
|
|
44914
45537
|
preventScrollOnEntryFocus: true,
|
|
44915
|
-
children: /* @__PURE__ */
|
|
45538
|
+
children: /* @__PURE__ */ jsx31(
|
|
44916
45539
|
Content,
|
|
44917
45540
|
{
|
|
44918
45541
|
role: "menu",
|
|
@@ -44970,36 +45593,20 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
44970
45593
|
) })
|
|
44971
45594
|
}
|
|
44972
45595
|
);
|
|
44973
|
-
}
|
|
44974
|
-
);
|
|
44975
|
-
MenuContent.displayName = CONTENT_NAME2;
|
|
44976
|
-
var GROUP_NAME2 = "MenuGroup";
|
|
44977
|
-
var MenuGroup = React43.forwardRef(
|
|
44978
|
-
(props, forwardedRef) => {
|
|
44979
|
-
const { __scopeMenu, ...groupProps } = props;
|
|
44980
|
-
return /* @__PURE__ */ jsx32(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
44981
|
-
}
|
|
45596
|
+
}, "MenuContentImpl")
|
|
44982
45597
|
);
|
|
44983
|
-
MenuGroup.displayName = GROUP_NAME2;
|
|
44984
|
-
var LABEL_NAME = "MenuLabel";
|
|
44985
|
-
var MenuLabel = React43.forwardRef(
|
|
44986
|
-
(props, forwardedRef) => {
|
|
44987
|
-
const { __scopeMenu, ...labelProps } = props;
|
|
44988
|
-
return /* @__PURE__ */ jsx32(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
44989
|
-
}
|
|
44990
|
-
);
|
|
44991
|
-
MenuLabel.displayName = LABEL_NAME;
|
|
44992
45598
|
var ITEM_NAME2 = "MenuItem";
|
|
44993
45599
|
var ITEM_SELECT = "menu.itemSelect";
|
|
44994
|
-
var MenuItem = React43.forwardRef(
|
|
44995
|
-
|
|
45600
|
+
var MenuItem = /* @__PURE__ */ React43.forwardRef(
|
|
45601
|
+
// blank line to reduce diff noise
|
|
45602
|
+
/* @__PURE__ */ __name21(function MenuItem2(props, forwardedRef) {
|
|
44996
45603
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
44997
45604
|
const ref = React43.useRef(null);
|
|
44998
45605
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
44999
45606
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
45000
45607
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
45001
45608
|
const isPointerDownRef = React43.useRef(false);
|
|
45002
|
-
const handleSelect = () => {
|
|
45609
|
+
const handleSelect = /* @__PURE__ */ __name21(() => {
|
|
45003
45610
|
const menuItem = ref.current;
|
|
45004
45611
|
if (!disabled && menuItem) {
|
|
45005
45612
|
const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
|
|
@@ -45011,8 +45618,8 @@ var MenuItem = React43.forwardRef(
|
|
|
45011
45618
|
rootContext.onClose();
|
|
45012
45619
|
}
|
|
45013
45620
|
}
|
|
45014
|
-
};
|
|
45015
|
-
return /* @__PURE__ */
|
|
45621
|
+
}, "handleSelect");
|
|
45622
|
+
return /* @__PURE__ */ jsx31(
|
|
45016
45623
|
MenuItemImpl,
|
|
45017
45624
|
{
|
|
45018
45625
|
...itemProps,
|
|
@@ -45041,11 +45648,10 @@ var MenuItem = React43.forwardRef(
|
|
|
45041
45648
|
})
|
|
45042
45649
|
}
|
|
45043
45650
|
);
|
|
45044
|
-
}
|
|
45651
|
+
}, "MenuItem")
|
|
45045
45652
|
);
|
|
45046
|
-
|
|
45047
|
-
|
|
45048
|
-
(props, forwardedRef) => {
|
|
45653
|
+
var MenuItemImpl = /* @__PURE__ */ React43.forwardRef(
|
|
45654
|
+
/* @__PURE__ */ __name21(function MenuItemImpl2(props, forwardedRef) {
|
|
45049
45655
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
45050
45656
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
45051
45657
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
@@ -45059,13 +45665,13 @@ var MenuItemImpl = React43.forwardRef(
|
|
|
45059
45665
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
45060
45666
|
}
|
|
45061
45667
|
}, [itemProps.children]);
|
|
45062
|
-
return /* @__PURE__ */
|
|
45668
|
+
return /* @__PURE__ */ jsx31(
|
|
45063
45669
|
Collection2.ItemSlot,
|
|
45064
45670
|
{
|
|
45065
45671
|
scope: __scopeMenu,
|
|
45066
45672
|
disabled,
|
|
45067
45673
|
textValue: textValue ?? textContent,
|
|
45068
|
-
children: /* @__PURE__ */
|
|
45674
|
+
children: /* @__PURE__ */ jsx31(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx31(
|
|
45069
45675
|
Primitive.div,
|
|
45070
45676
|
{
|
|
45071
45677
|
role: "menuitem",
|
|
@@ -45098,99 +45704,23 @@ var MenuItemImpl = React43.forwardRef(
|
|
|
45098
45704
|
) })
|
|
45099
45705
|
}
|
|
45100
45706
|
);
|
|
45101
|
-
}
|
|
45102
|
-
);
|
|
45103
|
-
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
45104
|
-
var MenuCheckboxItem = React43.forwardRef(
|
|
45105
|
-
(props, forwardedRef) => {
|
|
45106
|
-
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
45107
|
-
return /* @__PURE__ */ jsx32(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx32(
|
|
45108
|
-
MenuItem,
|
|
45109
|
-
{
|
|
45110
|
-
role: "menuitemcheckbox",
|
|
45111
|
-
"aria-checked": isIndeterminate(checked) ? "mixed" : checked,
|
|
45112
|
-
...checkboxItemProps,
|
|
45113
|
-
ref: forwardedRef,
|
|
45114
|
-
"data-state": getCheckedState(checked),
|
|
45115
|
-
onSelect: composeEventHandlers(
|
|
45116
|
-
checkboxItemProps.onSelect,
|
|
45117
|
-
() => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
|
|
45118
|
-
{ checkForDefaultPrevented: false }
|
|
45119
|
-
)
|
|
45120
|
-
}
|
|
45121
|
-
) });
|
|
45122
|
-
}
|
|
45707
|
+
}, "MenuItemImpl")
|
|
45123
45708
|
);
|
|
45124
|
-
MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
45125
45709
|
var RADIO_GROUP_NAME = "MenuRadioGroup";
|
|
45126
45710
|
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
45127
45711
|
RADIO_GROUP_NAME,
|
|
45128
|
-
{ value: void 0, onValueChange: () => {
|
|
45129
|
-
} }
|
|
45130
|
-
);
|
|
45131
|
-
var MenuRadioGroup = React43.forwardRef(
|
|
45132
|
-
(props, forwardedRef) => {
|
|
45133
|
-
const { value, onValueChange, ...groupProps } = props;
|
|
45134
|
-
const handleValueChange = useCallbackRef(onValueChange);
|
|
45135
|
-
return /* @__PURE__ */ jsx32(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx32(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
45136
|
-
}
|
|
45712
|
+
{ value: void 0, onValueChange: /* @__PURE__ */ __name21(() => {
|
|
45713
|
+
}, "onValueChange") }
|
|
45137
45714
|
);
|
|
45138
|
-
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
45139
|
-
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
45140
|
-
var MenuRadioItem = React43.forwardRef(
|
|
45141
|
-
(props, forwardedRef) => {
|
|
45142
|
-
const { value, ...radioItemProps } = props;
|
|
45143
|
-
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
45144
|
-
const checked = value === context.value;
|
|
45145
|
-
return /* @__PURE__ */ jsx32(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx32(
|
|
45146
|
-
MenuItem,
|
|
45147
|
-
{
|
|
45148
|
-
role: "menuitemradio",
|
|
45149
|
-
"aria-checked": checked,
|
|
45150
|
-
...radioItemProps,
|
|
45151
|
-
ref: forwardedRef,
|
|
45152
|
-
"data-state": getCheckedState(checked),
|
|
45153
|
-
onSelect: composeEventHandlers(
|
|
45154
|
-
radioItemProps.onSelect,
|
|
45155
|
-
() => context.onValueChange?.(value),
|
|
45156
|
-
{ checkForDefaultPrevented: false }
|
|
45157
|
-
)
|
|
45158
|
-
}
|
|
45159
|
-
) });
|
|
45160
|
-
}
|
|
45161
|
-
);
|
|
45162
|
-
MenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
45163
45715
|
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
45164
45716
|
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
45165
45717
|
ITEM_INDICATOR_NAME,
|
|
45166
45718
|
{ checked: false }
|
|
45167
45719
|
);
|
|
45168
|
-
var
|
|
45169
|
-
(props, forwardedRef)
|
|
45170
|
-
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
45171
|
-
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
45172
|
-
return /* @__PURE__ */ jsx32(
|
|
45173
|
-
Presence,
|
|
45174
|
-
{
|
|
45175
|
-
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
45176
|
-
children: /* @__PURE__ */ jsx32(
|
|
45177
|
-
Primitive.span,
|
|
45178
|
-
{
|
|
45179
|
-
...itemIndicatorProps,
|
|
45180
|
-
ref: forwardedRef,
|
|
45181
|
-
"data-state": getCheckedState(indicatorContext.checked)
|
|
45182
|
-
}
|
|
45183
|
-
)
|
|
45184
|
-
}
|
|
45185
|
-
);
|
|
45186
|
-
}
|
|
45187
|
-
);
|
|
45188
|
-
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
45189
|
-
var SEPARATOR_NAME = "MenuSeparator";
|
|
45190
|
-
var MenuSeparator = React43.forwardRef(
|
|
45191
|
-
(props, forwardedRef) => {
|
|
45720
|
+
var MenuSeparator = /* @__PURE__ */ React43.forwardRef(
|
|
45721
|
+
/* @__PURE__ */ __name21(function MenuSeparator2(props, forwardedRef) {
|
|
45192
45722
|
const { __scopeMenu, ...separatorProps } = props;
|
|
45193
|
-
return /* @__PURE__ */
|
|
45723
|
+
return /* @__PURE__ */ jsx31(
|
|
45194
45724
|
Primitive.div,
|
|
45195
45725
|
{
|
|
45196
45726
|
role: "separator",
|
|
@@ -45199,21 +45729,11 @@ var MenuSeparator = React43.forwardRef(
|
|
|
45199
45729
|
ref: forwardedRef
|
|
45200
45730
|
}
|
|
45201
45731
|
);
|
|
45202
|
-
}
|
|
45203
|
-
);
|
|
45204
|
-
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
45205
|
-
var ARROW_NAME2 = "MenuArrow";
|
|
45206
|
-
var MenuArrow = React43.forwardRef(
|
|
45207
|
-
(props, forwardedRef) => {
|
|
45208
|
-
const { __scopeMenu, ...arrowProps } = props;
|
|
45209
|
-
const popperScope = usePopperScope(__scopeMenu);
|
|
45210
|
-
return /* @__PURE__ */ jsx32(Arrow2, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
45211
|
-
}
|
|
45732
|
+
}, "MenuSeparator")
|
|
45212
45733
|
);
|
|
45213
|
-
MenuArrow.displayName = ARROW_NAME2;
|
|
45214
45734
|
var SUB_NAME = "MenuSub";
|
|
45215
45735
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
45216
|
-
var MenuSub = (props) => {
|
|
45736
|
+
var MenuSub = /* @__PURE__ */ __name21((props) => {
|
|
45217
45737
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
45218
45738
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
45219
45739
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -45224,7 +45744,7 @@ var MenuSub = (props) => {
|
|
|
45224
45744
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
45225
45745
|
return () => handleOpenChange(false);
|
|
45226
45746
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
45227
|
-
return /* @__PURE__ */
|
|
45747
|
+
return /* @__PURE__ */ jsx31(Root2, { ...popperScope, children: /* @__PURE__ */ jsx31(
|
|
45228
45748
|
MenuProvider,
|
|
45229
45749
|
{
|
|
45230
45750
|
scope: __scopeMenu,
|
|
@@ -45232,7 +45752,7 @@ var MenuSub = (props) => {
|
|
|
45232
45752
|
onOpenChange: handleOpenChange,
|
|
45233
45753
|
content,
|
|
45234
45754
|
onContentChange: setContent,
|
|
45235
|
-
children: /* @__PURE__ */
|
|
45755
|
+
children: /* @__PURE__ */ jsx31(
|
|
45236
45756
|
MenuSubProvider,
|
|
45237
45757
|
{
|
|
45238
45758
|
scope: __scopeMenu,
|
|
@@ -45245,11 +45765,10 @@ var MenuSub = (props) => {
|
|
|
45245
45765
|
)
|
|
45246
45766
|
}
|
|
45247
45767
|
) });
|
|
45248
|
-
};
|
|
45249
|
-
MenuSub.displayName = SUB_NAME;
|
|
45768
|
+
}, "MenuSub");
|
|
45250
45769
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
45251
|
-
var MenuSubTrigger = React43.forwardRef(
|
|
45252
|
-
(props, forwardedRef)
|
|
45770
|
+
var MenuSubTrigger = /* @__PURE__ */ React43.forwardRef(
|
|
45771
|
+
/* @__PURE__ */ __name21(function MenuSubTrigger2(props, forwardedRef) {
|
|
45253
45772
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
45254
45773
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
45255
45774
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
@@ -45270,7 +45789,7 @@ var MenuSubTrigger = React43.forwardRef(
|
|
|
45270
45789
|
};
|
|
45271
45790
|
}, [pointerGraceTimerRef, onPointerGraceIntentChange]);
|
|
45272
45791
|
const composedRefs = useComposedRefs(forwardedRef, subContext.onTriggerChange);
|
|
45273
|
-
return /* @__PURE__ */
|
|
45792
|
+
return /* @__PURE__ */ jsx31(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx31(
|
|
45274
45793
|
MenuItemImpl,
|
|
45275
45794
|
{
|
|
45276
45795
|
id: subContext.triggerId,
|
|
@@ -45351,12 +45870,11 @@ var MenuSubTrigger = React43.forwardRef(
|
|
|
45351
45870
|
})
|
|
45352
45871
|
}
|
|
45353
45872
|
) });
|
|
45354
|
-
}
|
|
45873
|
+
}, "MenuSubTrigger")
|
|
45355
45874
|
);
|
|
45356
|
-
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
45357
45875
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
45358
|
-
var MenuSubContent = React43.forwardRef(
|
|
45359
|
-
(props, forwardedRef)
|
|
45876
|
+
var MenuSubContent = /* @__PURE__ */ React43.forwardRef(
|
|
45877
|
+
/* @__PURE__ */ __name21(function MenuSubContent2(props, forwardedRef) {
|
|
45360
45878
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
45361
45879
|
const { forceMount = portalContext.forceMount, align = "start", ...subContentProps } = props;
|
|
45362
45880
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
@@ -45364,7 +45882,7 @@ var MenuSubContent = React43.forwardRef(
|
|
|
45364
45882
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
45365
45883
|
const ref = React43.useRef(null);
|
|
45366
45884
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
45367
|
-
return /* @__PURE__ */
|
|
45885
|
+
return /* @__PURE__ */ jsx31(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx31(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx31(
|
|
45368
45886
|
MenuContentImpl,
|
|
45369
45887
|
{
|
|
45370
45888
|
id: subContext.contentId,
|
|
@@ -45399,18 +45917,20 @@ var MenuSubContent = React43.forwardRef(
|
|
|
45399
45917
|
})
|
|
45400
45918
|
}
|
|
45401
45919
|
) }) }) });
|
|
45402
|
-
}
|
|
45920
|
+
}, "MenuSubContent")
|
|
45403
45921
|
);
|
|
45404
|
-
MenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
45405
45922
|
function getOpenState(open) {
|
|
45406
45923
|
return open ? "open" : "closed";
|
|
45407
45924
|
}
|
|
45925
|
+
__name21(getOpenState, "getOpenState");
|
|
45408
45926
|
function isIndeterminate(checked) {
|
|
45409
45927
|
return checked === "indeterminate";
|
|
45410
45928
|
}
|
|
45929
|
+
__name21(isIndeterminate, "isIndeterminate");
|
|
45411
45930
|
function getCheckedState(checked) {
|
|
45412
45931
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
45413
45932
|
}
|
|
45933
|
+
__name21(getCheckedState, "getCheckedState");
|
|
45414
45934
|
function focusFirst3(candidates) {
|
|
45415
45935
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
45416
45936
|
for (const candidate of candidates) {
|
|
@@ -45419,9 +45939,11 @@ function focusFirst3(candidates) {
|
|
|
45419
45939
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
45420
45940
|
}
|
|
45421
45941
|
}
|
|
45942
|
+
__name21(focusFirst3, "focusFirst");
|
|
45422
45943
|
function wrapArray2(array, startIndex) {
|
|
45423
45944
|
return array.map((_, index2) => array[(startIndex + index2) % array.length]);
|
|
45424
45945
|
}
|
|
45946
|
+
__name21(wrapArray2, "wrapArray");
|
|
45425
45947
|
function getNextMatch(values, search, currentMatch) {
|
|
45426
45948
|
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
|
|
45427
45949
|
const normalizedSearch = isRepeated ? search[0] : search;
|
|
@@ -45434,6 +45956,7 @@ function getNextMatch(values, search, currentMatch) {
|
|
|
45434
45956
|
);
|
|
45435
45957
|
return nextMatch !== currentMatch ? nextMatch : void 0;
|
|
45436
45958
|
}
|
|
45959
|
+
__name21(getNextMatch, "getNextMatch");
|
|
45437
45960
|
function isPointInPolygon(point, polygon2) {
|
|
45438
45961
|
const { x, y } = point;
|
|
45439
45962
|
let inside = false;
|
|
@@ -45449,33 +45972,31 @@ function isPointInPolygon(point, polygon2) {
|
|
|
45449
45972
|
}
|
|
45450
45973
|
return inside;
|
|
45451
45974
|
}
|
|
45975
|
+
__name21(isPointInPolygon, "isPointInPolygon");
|
|
45452
45976
|
function isPointerInGraceArea(event, area) {
|
|
45453
45977
|
if (!area) return false;
|
|
45454
45978
|
const cursorPos = { x: event.clientX, y: event.clientY };
|
|
45455
45979
|
return isPointInPolygon(cursorPos, area);
|
|
45456
45980
|
}
|
|
45981
|
+
__name21(isPointerInGraceArea, "isPointerInGraceArea");
|
|
45457
45982
|
function whenMouse(handler) {
|
|
45458
45983
|
return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
|
|
45459
45984
|
}
|
|
45460
|
-
|
|
45985
|
+
__name21(whenMouse, "whenMouse");
|
|
45986
|
+
var Root3 = Menu;
|
|
45461
45987
|
var Anchor2 = MenuAnchor;
|
|
45462
|
-
var
|
|
45988
|
+
var Portal3 = MenuPortal;
|
|
45463
45989
|
var Content2 = MenuContent;
|
|
45464
|
-
var Group7 = MenuGroup;
|
|
45465
|
-
var Label = MenuLabel;
|
|
45466
45990
|
var Item2 = MenuItem;
|
|
45467
|
-
var CheckboxItem = MenuCheckboxItem;
|
|
45468
|
-
var RadioGroup = MenuRadioGroup;
|
|
45469
|
-
var RadioItem = MenuRadioItem;
|
|
45470
|
-
var ItemIndicator = MenuItemIndicator;
|
|
45471
45991
|
var Separator = MenuSeparator;
|
|
45472
|
-
var Arrow22 = MenuArrow;
|
|
45473
45992
|
var Sub = MenuSub;
|
|
45474
45993
|
var SubTrigger = MenuSubTrigger;
|
|
45475
45994
|
var SubContent = MenuSubContent;
|
|
45476
45995
|
|
|
45477
45996
|
// node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
|
|
45478
|
-
import { jsx as
|
|
45997
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
45998
|
+
var __defProp24 = Object.defineProperty;
|
|
45999
|
+
var __name22 = (target, value) => __defProp24(target, "name", { value, configurable: true });
|
|
45479
46000
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
45480
46001
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
45481
46002
|
DROPDOWN_MENU_NAME,
|
|
@@ -45483,7 +46004,7 @@ var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
|
|
|
45483
46004
|
);
|
|
45484
46005
|
var useMenuScope = createMenuScope();
|
|
45485
46006
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
45486
|
-
var DropdownMenu = (props) => {
|
|
46007
|
+
var DropdownMenu = /* @__PURE__ */ __name22((props) => {
|
|
45487
46008
|
const {
|
|
45488
46009
|
__scopeDropdownMenu,
|
|
45489
46010
|
children,
|
|
@@ -45501,7 +46022,7 @@ var DropdownMenu = (props) => {
|
|
|
45501
46022
|
onChange: onOpenChange,
|
|
45502
46023
|
caller: DROPDOWN_MENU_NAME
|
|
45503
46024
|
});
|
|
45504
|
-
return /* @__PURE__ */
|
|
46025
|
+
return /* @__PURE__ */ jsx32(
|
|
45505
46026
|
DropdownMenuProvider,
|
|
45506
46027
|
{
|
|
45507
46028
|
scope: __scopeDropdownMenu,
|
|
@@ -45512,19 +46033,19 @@ var DropdownMenu = (props) => {
|
|
|
45512
46033
|
onOpenChange: setOpen,
|
|
45513
46034
|
onOpenToggle: React44.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
45514
46035
|
modal,
|
|
45515
|
-
children: /* @__PURE__ */
|
|
46036
|
+
children: /* @__PURE__ */ jsx32(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
45516
46037
|
}
|
|
45517
46038
|
);
|
|
45518
|
-
};
|
|
45519
|
-
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
46039
|
+
}, "DropdownMenu");
|
|
45520
46040
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
45521
|
-
var DropdownMenuTrigger = React44.forwardRef(
|
|
45522
|
-
|
|
46041
|
+
var DropdownMenuTrigger = /* @__PURE__ */ React44.forwardRef(
|
|
46042
|
+
// blank line to reduce diff noise
|
|
46043
|
+
/* @__PURE__ */ __name22(function DropdownMenuTrigger2(props, forwardedRef) {
|
|
45523
46044
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
45524
46045
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
45525
46046
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45526
46047
|
const composedRefs = useComposedRefs(forwardedRef, context.triggerRef);
|
|
45527
|
-
return /* @__PURE__ */
|
|
46048
|
+
return /* @__PURE__ */ jsx32(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx32(
|
|
45528
46049
|
Primitive.button,
|
|
45529
46050
|
{
|
|
45530
46051
|
type: "button",
|
|
@@ -45551,24 +46072,22 @@ var DropdownMenuTrigger = React44.forwardRef(
|
|
|
45551
46072
|
})
|
|
45552
46073
|
}
|
|
45553
46074
|
) });
|
|
45554
|
-
}
|
|
46075
|
+
}, "DropdownMenuTrigger")
|
|
45555
46076
|
);
|
|
45556
|
-
|
|
45557
|
-
var PORTAL_NAME3 = "DropdownMenuPortal";
|
|
45558
|
-
var DropdownMenuPortal = (props) => {
|
|
46077
|
+
var DropdownMenuPortal = /* @__PURE__ */ __name22((props) => {
|
|
45559
46078
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
45560
46079
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45561
|
-
return /* @__PURE__ */
|
|
45562
|
-
};
|
|
45563
|
-
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
46080
|
+
return /* @__PURE__ */ jsx32(Portal3, { ...menuScope, ...portalProps });
|
|
46081
|
+
}, "DropdownMenuPortal");
|
|
45564
46082
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
45565
|
-
var DropdownMenuContent = React44.forwardRef(
|
|
45566
|
-
|
|
46083
|
+
var DropdownMenuContent = /* @__PURE__ */ React44.forwardRef(
|
|
46084
|
+
// blank line to reduce diff noise
|
|
46085
|
+
/* @__PURE__ */ __name22(function DropdownMenuContent2(props, forwardedRef) {
|
|
45567
46086
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
45568
46087
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
45569
46088
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45570
46089
|
const hasInteractedOutsideRef = React44.useRef(false);
|
|
45571
|
-
return /* @__PURE__ */
|
|
46090
|
+
return /* @__PURE__ */ jsx32(
|
|
45572
46091
|
Content2,
|
|
45573
46092
|
{
|
|
45574
46093
|
id: context.contentId,
|
|
@@ -45600,81 +46119,22 @@ var DropdownMenuContent = React44.forwardRef(
|
|
|
45600
46119
|
}
|
|
45601
46120
|
}
|
|
45602
46121
|
);
|
|
45603
|
-
}
|
|
45604
|
-
);
|
|
45605
|
-
DropdownMenuContent.displayName = CONTENT_NAME3;
|
|
45606
|
-
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
45607
|
-
var DropdownMenuGroup = React44.forwardRef(
|
|
45608
|
-
(props, forwardedRef) => {
|
|
45609
|
-
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
45610
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45611
|
-
return /* @__PURE__ */ jsx33(Group7, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
45612
|
-
}
|
|
45613
|
-
);
|
|
45614
|
-
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
45615
|
-
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
45616
|
-
var DropdownMenuLabel = React44.forwardRef(
|
|
45617
|
-
(props, forwardedRef) => {
|
|
45618
|
-
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
45619
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45620
|
-
return /* @__PURE__ */ jsx33(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
45621
|
-
}
|
|
46122
|
+
}, "DropdownMenuContent")
|
|
45622
46123
|
);
|
|
45623
|
-
|
|
45624
|
-
|
|
45625
|
-
|
|
45626
|
-
(props, forwardedRef) => {
|
|
46124
|
+
var DropdownMenuItem = /* @__PURE__ */ React44.forwardRef(
|
|
46125
|
+
// blank line to reduce diff noise
|
|
46126
|
+
/* @__PURE__ */ __name22(function DropdownMenuItem2(props, forwardedRef) {
|
|
45627
46127
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
45628
46128
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45629
|
-
return /* @__PURE__ */
|
|
45630
|
-
}
|
|
46129
|
+
return /* @__PURE__ */ jsx32(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
46130
|
+
}, "DropdownMenuItem")
|
|
45631
46131
|
);
|
|
45632
|
-
|
|
45633
|
-
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
45634
|
-
var DropdownMenuCheckboxItem = React44.forwardRef((props, forwardedRef) => {
|
|
45635
|
-
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
45636
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45637
|
-
return /* @__PURE__ */ jsx33(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
45638
|
-
});
|
|
45639
|
-
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
45640
|
-
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
45641
|
-
var DropdownMenuRadioGroup = React44.forwardRef((props, forwardedRef) => {
|
|
45642
|
-
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
45643
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45644
|
-
return /* @__PURE__ */ jsx33(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
45645
|
-
});
|
|
45646
|
-
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
45647
|
-
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
45648
|
-
var DropdownMenuRadioItem = React44.forwardRef((props, forwardedRef) => {
|
|
45649
|
-
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
45650
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45651
|
-
return /* @__PURE__ */ jsx33(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
45652
|
-
});
|
|
45653
|
-
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
45654
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
45655
|
-
var DropdownMenuItemIndicator = React44.forwardRef((props, forwardedRef) => {
|
|
45656
|
-
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
45657
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45658
|
-
return /* @__PURE__ */ jsx33(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
45659
|
-
});
|
|
45660
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
45661
|
-
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
45662
|
-
var DropdownMenuSeparator = React44.forwardRef((props, forwardedRef) => {
|
|
46132
|
+
var DropdownMenuSeparator = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSeparator2(props, forwardedRef) {
|
|
45663
46133
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
45664
46134
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45665
|
-
return /* @__PURE__ */
|
|
45666
|
-
});
|
|
45667
|
-
|
|
45668
|
-
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
45669
|
-
var DropdownMenuArrow = React44.forwardRef(
|
|
45670
|
-
(props, forwardedRef) => {
|
|
45671
|
-
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
45672
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45673
|
-
return /* @__PURE__ */ jsx33(Arrow22, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
45674
|
-
}
|
|
45675
|
-
);
|
|
45676
|
-
DropdownMenuArrow.displayName = ARROW_NAME3;
|
|
45677
|
-
var DropdownMenuSub = (props) => {
|
|
46135
|
+
return /* @__PURE__ */ jsx32(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
46136
|
+
}, "DropdownMenuSeparator"));
|
|
46137
|
+
var DropdownMenuSub = /* @__PURE__ */ __name22((props) => {
|
|
45678
46138
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
45679
46139
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45680
46140
|
const [open, setOpen] = useControllableState({
|
|
@@ -45683,20 +46143,17 @@ var DropdownMenuSub = (props) => {
|
|
|
45683
46143
|
onChange: onOpenChange,
|
|
45684
46144
|
caller: "DropdownMenuSub"
|
|
45685
46145
|
});
|
|
45686
|
-
return /* @__PURE__ */
|
|
45687
|
-
};
|
|
45688
|
-
var
|
|
45689
|
-
var DropdownMenuSubTrigger = React44.forwardRef((props, forwardedRef) => {
|
|
46146
|
+
return /* @__PURE__ */ jsx32(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
46147
|
+
}, "DropdownMenuSub");
|
|
46148
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubTrigger2(props, forwardedRef) {
|
|
45690
46149
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
45691
46150
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45692
|
-
return /* @__PURE__ */
|
|
45693
|
-
});
|
|
45694
|
-
|
|
45695
|
-
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
45696
|
-
var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
|
|
46151
|
+
return /* @__PURE__ */ jsx32(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
46152
|
+
}, "DropdownMenuSubTrigger"));
|
|
46153
|
+
var DropdownMenuSubContent = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubContent2(props, forwardedRef) {
|
|
45697
46154
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
45698
46155
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
45699
|
-
return /* @__PURE__ */
|
|
46156
|
+
return /* @__PURE__ */ jsx32(
|
|
45700
46157
|
SubContent,
|
|
45701
46158
|
{
|
|
45702
46159
|
...menuScope,
|
|
@@ -45715,8 +46172,7 @@ var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
|
|
|
45715
46172
|
}
|
|
45716
46173
|
}
|
|
45717
46174
|
);
|
|
45718
|
-
});
|
|
45719
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME2;
|
|
46175
|
+
}, "DropdownMenuSubContent"));
|
|
45720
46176
|
var Root22 = DropdownMenu;
|
|
45721
46177
|
var Trigger = DropdownMenuTrigger;
|
|
45722
46178
|
var Portal22 = DropdownMenuPortal;
|
|
@@ -45731,8 +46187,8 @@ var SubContent2 = DropdownMenuSubContent;
|
|
|
45731
46187
|
import { useState as useState36 } from "react";
|
|
45732
46188
|
|
|
45733
46189
|
// src/components/Icons.tsx
|
|
45734
|
-
import { jsx as
|
|
45735
|
-
var CheckIcon = () => /* @__PURE__ */
|
|
46190
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
46191
|
+
var CheckIcon = () => /* @__PURE__ */ jsx33(
|
|
45736
46192
|
"svg",
|
|
45737
46193
|
{
|
|
45738
46194
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45744,10 +46200,10 @@ var CheckIcon = () => /* @__PURE__ */ jsx34(
|
|
|
45744
46200
|
strokeWidth: "2",
|
|
45745
46201
|
strokeLinecap: "round",
|
|
45746
46202
|
strokeLinejoin: "round",
|
|
45747
|
-
children: /* @__PURE__ */
|
|
46203
|
+
children: /* @__PURE__ */ jsx33("path", { d: "M20 6 9 17l-5-5" })
|
|
45748
46204
|
}
|
|
45749
46205
|
);
|
|
45750
|
-
var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */
|
|
46206
|
+
var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */ jsx33(
|
|
45751
46207
|
"svg",
|
|
45752
46208
|
{
|
|
45753
46209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45764,10 +46220,10 @@ var ChevronRightIcon = ({ isOpen }) => /* @__PURE__ */ jsx34(
|
|
|
45764
46220
|
transform: isOpen ? "rotate(90deg)" : "rotate(0deg)",
|
|
45765
46221
|
opacity: 0.6
|
|
45766
46222
|
},
|
|
45767
|
-
children: /* @__PURE__ */
|
|
46223
|
+
children: /* @__PURE__ */ jsx33("path", { d: "m9 18 6-6-6-6" })
|
|
45768
46224
|
}
|
|
45769
46225
|
);
|
|
45770
|
-
var DotIcon = () => /* @__PURE__ */
|
|
46226
|
+
var DotIcon = () => /* @__PURE__ */ jsx33(
|
|
45771
46227
|
"svg",
|
|
45772
46228
|
{
|
|
45773
46229
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45780,12 +46236,12 @@ var DotIcon = () => /* @__PURE__ */ jsx34(
|
|
|
45780
46236
|
strokeLinecap: "round",
|
|
45781
46237
|
strokeLinejoin: "round",
|
|
45782
46238
|
className: "lucide lucide-dot-icon lucide-dot",
|
|
45783
|
-
children: /* @__PURE__ */
|
|
46239
|
+
children: /* @__PURE__ */ jsx33("circle", { cx: "12.1", cy: "12.1", r: "4.5", fill: "white" })
|
|
45784
46240
|
}
|
|
45785
46241
|
);
|
|
45786
46242
|
|
|
45787
46243
|
// src/components/AppearanceMenu.tsx
|
|
45788
|
-
import { Fragment as Fragment11, jsx as
|
|
46244
|
+
import { Fragment as Fragment11, jsx as jsx34, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
45789
46245
|
var itemStyles = {
|
|
45790
46246
|
padding: "6px 8px",
|
|
45791
46247
|
borderRadius: 6,
|
|
@@ -45838,7 +46294,7 @@ var AppearanceMenu = () => {
|
|
|
45838
46294
|
const [appearanceSubOpen, setAppearanceSubOpen] = useState36(false);
|
|
45839
46295
|
const [hoveredItem, setHoveredItem] = useState36(null);
|
|
45840
46296
|
return /* @__PURE__ */ jsxs8(Fragment11, { children: [
|
|
45841
|
-
/* @__PURE__ */
|
|
46297
|
+
/* @__PURE__ */ jsx34(Separator2, { style: separatorStyles }),
|
|
45842
46298
|
/* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setAppearanceSubOpen, children: [
|
|
45843
46299
|
/* @__PURE__ */ jsxs8(
|
|
45844
46300
|
SubTrigger2,
|
|
@@ -45852,8 +46308,8 @@ var AppearanceMenu = () => {
|
|
|
45852
46308
|
onMouseLeave: () => setHoveredItem(null),
|
|
45853
46309
|
onTouchStart: () => setHoveredItem("appearance"),
|
|
45854
46310
|
children: [
|
|
45855
|
-
/* @__PURE__ */
|
|
45856
|
-
/* @__PURE__ */
|
|
46311
|
+
/* @__PURE__ */ jsx34("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: "Appearance" }),
|
|
46312
|
+
/* @__PURE__ */ jsx34(
|
|
45857
46313
|
"div",
|
|
45858
46314
|
{
|
|
45859
46315
|
style: {
|
|
@@ -45862,13 +46318,13 @@ var AppearanceMenu = () => {
|
|
|
45862
46318
|
alignItems: "flex-end",
|
|
45863
46319
|
marginBottom: "-5px"
|
|
45864
46320
|
},
|
|
45865
|
-
children: /* @__PURE__ */
|
|
46321
|
+
children: /* @__PURE__ */ jsx34(ChevronRightIcon, { isOpen: appearanceSubOpen })
|
|
45866
46322
|
}
|
|
45867
46323
|
)
|
|
45868
46324
|
]
|
|
45869
46325
|
}
|
|
45870
46326
|
),
|
|
45871
|
-
/* @__PURE__ */
|
|
46327
|
+
/* @__PURE__ */ jsx34(Portal22, { children: /* @__PURE__ */ jsxs8(
|
|
45872
46328
|
SubContent2,
|
|
45873
46329
|
{
|
|
45874
46330
|
style: { ...contentStyles, marginLeft: -2 },
|
|
@@ -45891,12 +46347,12 @@ var AppearanceMenu = () => {
|
|
|
45891
46347
|
onMouseLeave: () => setHoveredItem(null),
|
|
45892
46348
|
onTouchStart: () => setHoveredItem("lighting"),
|
|
45893
46349
|
children: [
|
|
45894
|
-
/* @__PURE__ */
|
|
45895
|
-
/* @__PURE__ */
|
|
46350
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: lightingEnabled && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46351
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Lighting" })
|
|
45896
46352
|
]
|
|
45897
46353
|
}
|
|
45898
46354
|
),
|
|
45899
|
-
/* @__PURE__ */
|
|
46355
|
+
/* @__PURE__ */ jsx34(Separator2, { style: separatorStyles }),
|
|
45900
46356
|
/* @__PURE__ */ jsxs8(
|
|
45901
46357
|
Item22,
|
|
45902
46358
|
{
|
|
@@ -45913,8 +46369,8 @@ var AppearanceMenu = () => {
|
|
|
45913
46369
|
onMouseLeave: () => setHoveredItem(null),
|
|
45914
46370
|
onTouchStart: () => setHoveredItem("boardBody"),
|
|
45915
46371
|
children: [
|
|
45916
|
-
/* @__PURE__ */
|
|
45917
|
-
/* @__PURE__ */
|
|
46372
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.boardBody && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46373
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Board Body" })
|
|
45918
46374
|
]
|
|
45919
46375
|
}
|
|
45920
46376
|
),
|
|
@@ -45934,8 +46390,8 @@ var AppearanceMenu = () => {
|
|
|
45934
46390
|
onMouseLeave: () => setHoveredItem(null),
|
|
45935
46391
|
onTouchStart: () => setHoveredItem("topCopper"),
|
|
45936
46392
|
children: [
|
|
45937
|
-
/* @__PURE__ */
|
|
45938
|
-
/* @__PURE__ */
|
|
46393
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.topCopper && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46394
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Top Copper" })
|
|
45939
46395
|
]
|
|
45940
46396
|
}
|
|
45941
46397
|
),
|
|
@@ -45955,8 +46411,8 @@ var AppearanceMenu = () => {
|
|
|
45955
46411
|
onMouseLeave: () => setHoveredItem(null),
|
|
45956
46412
|
onTouchStart: () => setHoveredItem("bottomCopper"),
|
|
45957
46413
|
children: [
|
|
45958
|
-
/* @__PURE__ */
|
|
45959
|
-
/* @__PURE__ */
|
|
46414
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.bottomCopper && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46415
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Copper" })
|
|
45960
46416
|
]
|
|
45961
46417
|
}
|
|
45962
46418
|
),
|
|
@@ -45976,8 +46432,8 @@ var AppearanceMenu = () => {
|
|
|
45976
46432
|
onMouseLeave: () => setHoveredItem(null),
|
|
45977
46433
|
onTouchStart: () => setHoveredItem("keepout"),
|
|
45978
46434
|
children: [
|
|
45979
|
-
/* @__PURE__ */
|
|
45980
|
-
/* @__PURE__ */
|
|
46435
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.keepout && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46436
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Keepout" })
|
|
45981
46437
|
]
|
|
45982
46438
|
}
|
|
45983
46439
|
),
|
|
@@ -45997,8 +46453,8 @@ var AppearanceMenu = () => {
|
|
|
45997
46453
|
onMouseLeave: () => setHoveredItem(null),
|
|
45998
46454
|
onTouchStart: () => setHoveredItem("topSilkscreen"),
|
|
45999
46455
|
children: [
|
|
46000
|
-
/* @__PURE__ */
|
|
46001
|
-
/* @__PURE__ */
|
|
46456
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.topSilkscreen && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46457
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Top Silkscreen" })
|
|
46002
46458
|
]
|
|
46003
46459
|
}
|
|
46004
46460
|
),
|
|
@@ -46021,8 +46477,8 @@ var AppearanceMenu = () => {
|
|
|
46021
46477
|
onMouseLeave: () => setHoveredItem(null),
|
|
46022
46478
|
onTouchStart: () => setHoveredItem("bottomSilkscreen"),
|
|
46023
46479
|
children: [
|
|
46024
|
-
/* @__PURE__ */
|
|
46025
|
-
/* @__PURE__ */
|
|
46480
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.bottomSilkscreen && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46481
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Silkscreen" })
|
|
46026
46482
|
]
|
|
46027
46483
|
}
|
|
46028
46484
|
),
|
|
@@ -46042,8 +46498,8 @@ var AppearanceMenu = () => {
|
|
|
46042
46498
|
onMouseLeave: () => setHoveredItem(null),
|
|
46043
46499
|
onTouchStart: () => setHoveredItem("topMask"),
|
|
46044
46500
|
children: [
|
|
46045
|
-
/* @__PURE__ */
|
|
46046
|
-
/* @__PURE__ */
|
|
46501
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.topMask && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46502
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Top Soldermask" })
|
|
46047
46503
|
]
|
|
46048
46504
|
}
|
|
46049
46505
|
),
|
|
@@ -46063,8 +46519,8 @@ var AppearanceMenu = () => {
|
|
|
46063
46519
|
onMouseLeave: () => setHoveredItem(null),
|
|
46064
46520
|
onTouchStart: () => setHoveredItem("bottomMask"),
|
|
46065
46521
|
children: [
|
|
46066
|
-
/* @__PURE__ */
|
|
46067
|
-
/* @__PURE__ */
|
|
46522
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.bottomMask && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46523
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Bottom Soldermask" })
|
|
46068
46524
|
]
|
|
46069
46525
|
}
|
|
46070
46526
|
),
|
|
@@ -46084,8 +46540,8 @@ var AppearanceMenu = () => {
|
|
|
46084
46540
|
onMouseLeave: () => setHoveredItem(null),
|
|
46085
46541
|
onTouchStart: () => setHoveredItem("pcbNotes"),
|
|
46086
46542
|
children: [
|
|
46087
|
-
/* @__PURE__ */
|
|
46088
|
-
/* @__PURE__ */
|
|
46543
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.pcbNotes && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46544
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "PCB Notes" })
|
|
46089
46545
|
]
|
|
46090
46546
|
}
|
|
46091
46547
|
),
|
|
@@ -46105,8 +46561,8 @@ var AppearanceMenu = () => {
|
|
|
46105
46561
|
onMouseLeave: () => setHoveredItem(null),
|
|
46106
46562
|
onTouchStart: () => setHoveredItem("smtModels"),
|
|
46107
46563
|
children: [
|
|
46108
|
-
/* @__PURE__ */
|
|
46109
|
-
/* @__PURE__ */
|
|
46564
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.smtModels && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46565
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Surface Mount Components" })
|
|
46110
46566
|
]
|
|
46111
46567
|
}
|
|
46112
46568
|
),
|
|
@@ -46129,8 +46585,8 @@ var AppearanceMenu = () => {
|
|
|
46129
46585
|
onMouseLeave: () => setHoveredItem(null),
|
|
46130
46586
|
onTouchStart: () => setHoveredItem("throughHoleModels"),
|
|
46131
46587
|
children: [
|
|
46132
|
-
/* @__PURE__ */
|
|
46133
|
-
/* @__PURE__ */
|
|
46588
|
+
/* @__PURE__ */ jsx34("span", { style: iconContainerStyles, children: visibility.throughHoleModels && /* @__PURE__ */ jsx34(CheckIcon, {}) }),
|
|
46589
|
+
/* @__PURE__ */ jsx34("span", { style: { display: "flex", alignItems: "center" }, children: "Through-Hole Components" })
|
|
46134
46590
|
]
|
|
46135
46591
|
}
|
|
46136
46592
|
)
|
|
@@ -46142,7 +46598,7 @@ var AppearanceMenu = () => {
|
|
|
46142
46598
|
};
|
|
46143
46599
|
|
|
46144
46600
|
// src/components/ContextMenu.tsx
|
|
46145
|
-
import { jsx as
|
|
46601
|
+
import { jsx as jsx35, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
46146
46602
|
var cameraOptions = [
|
|
46147
46603
|
"Custom",
|
|
46148
46604
|
"Top Center Angled",
|
|
@@ -46226,7 +46682,7 @@ var ContextMenu = ({
|
|
|
46226
46682
|
const { cameraType, setCameraType } = useCameraController();
|
|
46227
46683
|
const [cameraSubOpen, setCameraSubOpen] = useState37(false);
|
|
46228
46684
|
const [hoveredItem, setHoveredItem] = useState37(null);
|
|
46229
|
-
return /* @__PURE__ */
|
|
46685
|
+
return /* @__PURE__ */ jsx35(
|
|
46230
46686
|
"div",
|
|
46231
46687
|
{
|
|
46232
46688
|
ref: menuRef,
|
|
@@ -46238,8 +46694,8 @@ var ContextMenu = ({
|
|
|
46238
46694
|
height: 0
|
|
46239
46695
|
},
|
|
46240
46696
|
children: /* @__PURE__ */ jsxs9(Root22, { open: true, modal: false, children: [
|
|
46241
|
-
/* @__PURE__ */
|
|
46242
|
-
/* @__PURE__ */
|
|
46697
|
+
/* @__PURE__ */ jsx35(Trigger, { asChild: true, children: /* @__PURE__ */ jsx35("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
|
|
46698
|
+
/* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsxs9(
|
|
46243
46699
|
Content22,
|
|
46244
46700
|
{
|
|
46245
46701
|
style: contentStyles2,
|
|
@@ -46261,7 +46717,7 @@ var ContextMenu = ({
|
|
|
46261
46717
|
onMouseLeave: () => setHoveredItem(null),
|
|
46262
46718
|
onTouchStart: () => setHoveredItem("camera"),
|
|
46263
46719
|
children: [
|
|
46264
|
-
/* @__PURE__ */
|
|
46720
|
+
/* @__PURE__ */ jsx35(
|
|
46265
46721
|
"span",
|
|
46266
46722
|
{
|
|
46267
46723
|
style: { flex: 1, display: "flex", alignItems: "center" },
|
|
@@ -46278,15 +46734,15 @@ var ContextMenu = ({
|
|
|
46278
46734
|
marginLeft: "auto"
|
|
46279
46735
|
},
|
|
46280
46736
|
children: [
|
|
46281
|
-
/* @__PURE__ */
|
|
46282
|
-
/* @__PURE__ */
|
|
46737
|
+
/* @__PURE__ */ jsx35("span", { style: { opacity: 0.55, fontSize: 13 }, children: cameraPreset }),
|
|
46738
|
+
/* @__PURE__ */ jsx35(ChevronRightIcon, { isOpen: cameraSubOpen })
|
|
46283
46739
|
]
|
|
46284
46740
|
}
|
|
46285
46741
|
)
|
|
46286
46742
|
]
|
|
46287
46743
|
}
|
|
46288
46744
|
),
|
|
46289
|
-
/* @__PURE__ */
|
|
46745
|
+
/* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsx35(
|
|
46290
46746
|
SubContent2,
|
|
46291
46747
|
{
|
|
46292
46748
|
style: { ...contentStyles2, marginLeft: -2 },
|
|
@@ -46308,8 +46764,8 @@ var ContextMenu = ({
|
|
|
46308
46764
|
onMouseLeave: () => setHoveredItem(null),
|
|
46309
46765
|
onTouchStart: () => setHoveredItem(option),
|
|
46310
46766
|
children: [
|
|
46311
|
-
/* @__PURE__ */
|
|
46312
|
-
/* @__PURE__ */
|
|
46767
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: cameraPreset === option && /* @__PURE__ */ jsx35(DotIcon, {}) }),
|
|
46768
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: option })
|
|
46313
46769
|
]
|
|
46314
46770
|
},
|
|
46315
46771
|
option
|
|
@@ -46333,8 +46789,8 @@ var ContextMenu = ({
|
|
|
46333
46789
|
onMouseLeave: () => setHoveredItem(null),
|
|
46334
46790
|
onTouchStart: () => setHoveredItem("autorotate"),
|
|
46335
46791
|
children: [
|
|
46336
|
-
/* @__PURE__ */
|
|
46337
|
-
/* @__PURE__ */
|
|
46792
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: autoRotate && /* @__PURE__ */ jsx35(CheckIcon, {}) }),
|
|
46793
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Auto rotate" })
|
|
46338
46794
|
]
|
|
46339
46795
|
}
|
|
46340
46796
|
),
|
|
@@ -46356,14 +46812,14 @@ var ContextMenu = ({
|
|
|
46356
46812
|
onMouseLeave: () => setHoveredItem(null),
|
|
46357
46813
|
onTouchStart: () => setHoveredItem("cameratype"),
|
|
46358
46814
|
children: [
|
|
46359
|
-
/* @__PURE__ */
|
|
46360
|
-
/* @__PURE__ */
|
|
46815
|
+
/* @__PURE__ */ jsx35("span", { style: iconContainerStyles2, children: cameraType === "orthographic" && /* @__PURE__ */ jsx35(CheckIcon, {}) }),
|
|
46816
|
+
/* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Orthographic Camera" })
|
|
46361
46817
|
]
|
|
46362
46818
|
}
|
|
46363
46819
|
),
|
|
46364
|
-
/* @__PURE__ */
|
|
46365
|
-
/* @__PURE__ */
|
|
46366
|
-
/* @__PURE__ */
|
|
46820
|
+
/* @__PURE__ */ jsx35(AppearanceMenu, {}),
|
|
46821
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
46822
|
+
/* @__PURE__ */ jsx35(
|
|
46367
46823
|
Item22,
|
|
46368
46824
|
{
|
|
46369
46825
|
style: {
|
|
@@ -46375,10 +46831,10 @@ var ContextMenu = ({
|
|
|
46375
46831
|
onMouseEnter: () => setHoveredItem("download"),
|
|
46376
46832
|
onMouseLeave: () => setHoveredItem(null),
|
|
46377
46833
|
onTouchStart: () => setHoveredItem("download"),
|
|
46378
|
-
children: /* @__PURE__ */
|
|
46834
|
+
children: /* @__PURE__ */ jsx35("span", { style: { display: "flex", alignItems: "center" }, children: "Download GLTF" })
|
|
46379
46835
|
}
|
|
46380
46836
|
),
|
|
46381
|
-
/* @__PURE__ */
|
|
46837
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
46382
46838
|
/* @__PURE__ */ jsxs9(
|
|
46383
46839
|
Item22,
|
|
46384
46840
|
{
|
|
@@ -46401,7 +46857,7 @@ var ContextMenu = ({
|
|
|
46401
46857
|
engine === "jscad" ? "Manifold" : "JSCAD",
|
|
46402
46858
|
" Engine"
|
|
46403
46859
|
] }),
|
|
46404
|
-
/* @__PURE__ */
|
|
46860
|
+
/* @__PURE__ */ jsx35(
|
|
46405
46861
|
"div",
|
|
46406
46862
|
{
|
|
46407
46863
|
style: {
|
|
@@ -46415,7 +46871,7 @@ var ContextMenu = ({
|
|
|
46415
46871
|
]
|
|
46416
46872
|
}
|
|
46417
46873
|
),
|
|
46418
|
-
/* @__PURE__ */
|
|
46874
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
46419
46875
|
/* @__PURE__ */ jsxs9(
|
|
46420
46876
|
Item22,
|
|
46421
46877
|
{
|
|
@@ -46429,8 +46885,8 @@ var ContextMenu = ({
|
|
|
46429
46885
|
onMouseLeave: () => setHoveredItem(null),
|
|
46430
46886
|
onTouchStart: () => setHoveredItem("shortcuts"),
|
|
46431
46887
|
children: [
|
|
46432
|
-
/* @__PURE__ */
|
|
46433
|
-
/* @__PURE__ */
|
|
46888
|
+
/* @__PURE__ */ jsx35("span", { style: { flex: 1, display: "flex", alignItems: "center" }, children: "Keyboard Shortcuts" }),
|
|
46889
|
+
/* @__PURE__ */ jsx35(
|
|
46434
46890
|
"div",
|
|
46435
46891
|
{
|
|
46436
46892
|
style: {
|
|
@@ -46444,8 +46900,8 @@ var ContextMenu = ({
|
|
|
46444
46900
|
]
|
|
46445
46901
|
}
|
|
46446
46902
|
),
|
|
46447
|
-
/* @__PURE__ */
|
|
46448
|
-
/* @__PURE__ */
|
|
46903
|
+
/* @__PURE__ */ jsx35(Separator2, { style: separatorStyles2 }),
|
|
46904
|
+
/* @__PURE__ */ jsx35(
|
|
46449
46905
|
"div",
|
|
46450
46906
|
{
|
|
46451
46907
|
style: {
|
|
@@ -46483,14 +46939,14 @@ var ContextMenu = ({
|
|
|
46483
46939
|
};
|
|
46484
46940
|
|
|
46485
46941
|
// src/components/KeyboardShortcutsDialog.tsx
|
|
46486
|
-
import { useEffect as useEffect47, useMemo as
|
|
46487
|
-
import { jsx as
|
|
46942
|
+
import { useEffect as useEffect47, useMemo as useMemo31, useRef as useRef28, useState as useState38 } from "react";
|
|
46943
|
+
import { jsx as jsx36, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
46488
46944
|
var KeyboardShortcutsDialog = ({
|
|
46489
46945
|
open,
|
|
46490
46946
|
onClose
|
|
46491
46947
|
}) => {
|
|
46492
46948
|
const [query, setQuery] = useState38("");
|
|
46493
|
-
const inputRef =
|
|
46949
|
+
const inputRef = useRef28(null);
|
|
46494
46950
|
const hotkeys = useHotkeyRegistry();
|
|
46495
46951
|
useEffect47(() => {
|
|
46496
46952
|
if (!open) return void 0;
|
|
@@ -46510,7 +46966,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46510
46966
|
}, 0);
|
|
46511
46967
|
}
|
|
46512
46968
|
}, [open]);
|
|
46513
|
-
const filteredHotkeys =
|
|
46969
|
+
const filteredHotkeys = useMemo31(() => {
|
|
46514
46970
|
const normalizedQuery = query.trim().toLowerCase();
|
|
46515
46971
|
if (!normalizedQuery) {
|
|
46516
46972
|
return hotkeys;
|
|
@@ -46523,7 +46979,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46523
46979
|
if (!open) {
|
|
46524
46980
|
return null;
|
|
46525
46981
|
}
|
|
46526
|
-
return /* @__PURE__ */
|
|
46982
|
+
return /* @__PURE__ */ jsx36(
|
|
46527
46983
|
"div",
|
|
46528
46984
|
{
|
|
46529
46985
|
role: "dialog",
|
|
@@ -46563,7 +47019,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46563
47019
|
},
|
|
46564
47020
|
children: [
|
|
46565
47021
|
/* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between" }, children: [
|
|
46566
|
-
/* @__PURE__ */
|
|
47022
|
+
/* @__PURE__ */ jsx36(
|
|
46567
47023
|
"h2",
|
|
46568
47024
|
{
|
|
46569
47025
|
style: {
|
|
@@ -46575,7 +47031,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46575
47031
|
children: "Keyboard Shortcuts"
|
|
46576
47032
|
}
|
|
46577
47033
|
),
|
|
46578
|
-
/* @__PURE__ */
|
|
47034
|
+
/* @__PURE__ */ jsx36(
|
|
46579
47035
|
"button",
|
|
46580
47036
|
{
|
|
46581
47037
|
type: "button",
|
|
@@ -46591,7 +47047,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46591
47047
|
}
|
|
46592
47048
|
)
|
|
46593
47049
|
] }),
|
|
46594
|
-
/* @__PURE__ */
|
|
47050
|
+
/* @__PURE__ */ jsx36(
|
|
46595
47051
|
"input",
|
|
46596
47052
|
{
|
|
46597
47053
|
ref: inputRef,
|
|
@@ -46614,7 +47070,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46614
47070
|
]
|
|
46615
47071
|
}
|
|
46616
47072
|
),
|
|
46617
|
-
/* @__PURE__ */
|
|
47073
|
+
/* @__PURE__ */ jsx36("div", { style: { overflowY: "auto" }, children: /* @__PURE__ */ jsxs10(
|
|
46618
47074
|
"table",
|
|
46619
47075
|
{
|
|
46620
47076
|
style: {
|
|
@@ -46623,11 +47079,11 @@ var KeyboardShortcutsDialog = ({
|
|
|
46623
47079
|
fontSize: "0.95rem"
|
|
46624
47080
|
},
|
|
46625
47081
|
children: [
|
|
46626
|
-
/* @__PURE__ */
|
|
46627
|
-
/* @__PURE__ */
|
|
46628
|
-
/* @__PURE__ */
|
|
47082
|
+
/* @__PURE__ */ jsx36("thead", { children: /* @__PURE__ */ jsxs10("tr", { style: { textAlign: "left", color: "#a1a1b5" }, children: [
|
|
47083
|
+
/* @__PURE__ */ jsx36("th", { style: { padding: "12px 24px", width: "25%" }, children: "Key" }),
|
|
47084
|
+
/* @__PURE__ */ jsx36("th", { style: { padding: "12px 24px" }, children: "Description" })
|
|
46629
47085
|
] }) }),
|
|
46630
|
-
/* @__PURE__ */
|
|
47086
|
+
/* @__PURE__ */ jsx36("tbody", { children: filteredHotkeys.length === 0 ? /* @__PURE__ */ jsx36("tr", { children: /* @__PURE__ */ jsx36(
|
|
46631
47087
|
"td",
|
|
46632
47088
|
{
|
|
46633
47089
|
colSpan: 2,
|
|
@@ -46639,7 +47095,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46639
47095
|
{
|
|
46640
47096
|
style: { borderTop: "1px solid rgba(255, 255, 255, 0.05)" },
|
|
46641
47097
|
children: [
|
|
46642
|
-
/* @__PURE__ */
|
|
47098
|
+
/* @__PURE__ */ jsx36("td", { style: { padding: "12px 24px" }, children: /* @__PURE__ */ jsx36(
|
|
46643
47099
|
"span",
|
|
46644
47100
|
{
|
|
46645
47101
|
style: {
|
|
@@ -46657,7 +47113,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46657
47113
|
children: hotkey.shortcut
|
|
46658
47114
|
}
|
|
46659
47115
|
) }),
|
|
46660
|
-
/* @__PURE__ */
|
|
47116
|
+
/* @__PURE__ */ jsx36("td", { style: { padding: "12px 24px" }, children: hotkey.description })
|
|
46661
47117
|
]
|
|
46662
47118
|
},
|
|
46663
47119
|
hotkey.id
|
|
@@ -46673,7 +47129,7 @@ var KeyboardShortcutsDialog = ({
|
|
|
46673
47129
|
};
|
|
46674
47130
|
|
|
46675
47131
|
// src/CadViewer.tsx
|
|
46676
|
-
import { jsx as
|
|
47132
|
+
import { jsx as jsx37, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
46677
47133
|
var DEFAULT_TARGET = new THREE46.Vector3(0, 0, 0);
|
|
46678
47134
|
var INITIAL_CAMERA_POSITION = [5, -5, 5];
|
|
46679
47135
|
var readStoredCameraType = () => {
|
|
@@ -46686,7 +47142,7 @@ var CadViewerInner = (props) => {
|
|
|
46686
47142
|
const stored = window.localStorage.getItem("cadViewerEngine");
|
|
46687
47143
|
return stored === "jscad" || stored === "manifold" ? stored : "manifold";
|
|
46688
47144
|
});
|
|
46689
|
-
const containerRef =
|
|
47145
|
+
const containerRef = useRef29(null);
|
|
46690
47146
|
const [isKeyboardShortcutsDialogOpen, setIsKeyboardShortcutsDialogOpen] = useState39(false);
|
|
46691
47147
|
const [autoRotate, setAutoRotate] = useState39(() => {
|
|
46692
47148
|
const stored = window.localStorage.getItem("cadViewerAutoRotate");
|
|
@@ -46700,7 +47156,7 @@ var CadViewerInner = (props) => {
|
|
|
46700
47156
|
const { cameraType, setCameraType } = useCameraController();
|
|
46701
47157
|
const { visibility, setLayerVisibility } = useLayerVisibility();
|
|
46702
47158
|
const { showToast } = useToast();
|
|
46703
|
-
const cameraControllerRef =
|
|
47159
|
+
const cameraControllerRef = useRef29(null);
|
|
46704
47160
|
const externalCameraControllerReady = props.onCameraControllerReady;
|
|
46705
47161
|
const {
|
|
46706
47162
|
menuVisible,
|
|
@@ -46709,10 +47165,10 @@ var CadViewerInner = (props) => {
|
|
|
46709
47165
|
contextMenuEventHandlers,
|
|
46710
47166
|
setMenuVisible
|
|
46711
47167
|
} = useContextMenu({ containerRef });
|
|
46712
|
-
const autoRotateUserToggledRef =
|
|
47168
|
+
const autoRotateUserToggledRef = useRef29(autoRotateUserToggled);
|
|
46713
47169
|
autoRotateUserToggledRef.current = autoRotateUserToggled;
|
|
46714
|
-
const isAnimatingRef =
|
|
46715
|
-
const lastPresetSelectTime =
|
|
47170
|
+
const isAnimatingRef = useRef29(false);
|
|
47171
|
+
const lastPresetSelectTime = useRef29(0);
|
|
46716
47172
|
const PRESET_COOLDOWN = 1e3;
|
|
46717
47173
|
const handleUserInteraction = useCallback25(() => {
|
|
46718
47174
|
if (isAnimatingRef.current || Date.now() - lastPresetSelectTime.current < PRESET_COOLDOWN) {
|
|
@@ -46844,7 +47300,7 @@ var CadViewerInner = (props) => {
|
|
|
46844
47300
|
},
|
|
46845
47301
|
...contextMenuEventHandlers,
|
|
46846
47302
|
children: [
|
|
46847
|
-
engine === "jscad" ? /* @__PURE__ */
|
|
47303
|
+
engine === "jscad" ? /* @__PURE__ */ jsx37(
|
|
46848
47304
|
CadViewerJscad,
|
|
46849
47305
|
{
|
|
46850
47306
|
...props,
|
|
@@ -46853,7 +47309,7 @@ var CadViewerInner = (props) => {
|
|
|
46853
47309
|
onUserInteraction: handleUserInteraction,
|
|
46854
47310
|
onCameraControllerReady: handleCameraControllerReady
|
|
46855
47311
|
}
|
|
46856
|
-
) : /* @__PURE__ */
|
|
47312
|
+
) : /* @__PURE__ */ jsx37(
|
|
46857
47313
|
CadViewerManifold_default,
|
|
46858
47314
|
{
|
|
46859
47315
|
...props,
|
|
@@ -46880,11 +47336,11 @@ var CadViewerInner = (props) => {
|
|
|
46880
47336
|
},
|
|
46881
47337
|
children: [
|
|
46882
47338
|
"Engine: ",
|
|
46883
|
-
/* @__PURE__ */
|
|
47339
|
+
/* @__PURE__ */ jsx37("b", { children: engine === "jscad" ? "JSCAD" : "Manifold" })
|
|
46884
47340
|
]
|
|
46885
47341
|
}
|
|
46886
47342
|
),
|
|
46887
|
-
menuVisible && /* @__PURE__ */
|
|
47343
|
+
menuVisible && /* @__PURE__ */ jsx37(
|
|
46888
47344
|
ContextMenu,
|
|
46889
47345
|
{
|
|
46890
47346
|
menuRef,
|
|
@@ -46911,7 +47367,7 @@ var CadViewerInner = (props) => {
|
|
|
46911
47367
|
}
|
|
46912
47368
|
}
|
|
46913
47369
|
),
|
|
46914
|
-
/* @__PURE__ */
|
|
47370
|
+
/* @__PURE__ */ jsx37(
|
|
46915
47371
|
KeyboardShortcutsDialog,
|
|
46916
47372
|
{
|
|
46917
47373
|
open: isKeyboardShortcutsDialogOpen,
|
|
@@ -46924,13 +47380,13 @@ var CadViewerInner = (props) => {
|
|
|
46924
47380
|
);
|
|
46925
47381
|
};
|
|
46926
47382
|
var CadViewer = (props) => {
|
|
46927
|
-
return /* @__PURE__ */
|
|
47383
|
+
return /* @__PURE__ */ jsx37(
|
|
46928
47384
|
CameraControllerProvider,
|
|
46929
47385
|
{
|
|
46930
47386
|
defaultTarget: DEFAULT_TARGET,
|
|
46931
47387
|
initialCameraPosition: INITIAL_CAMERA_POSITION,
|
|
46932
47388
|
initialCameraType: readStoredCameraType(),
|
|
46933
|
-
children: /* @__PURE__ */
|
|
47389
|
+
children: /* @__PURE__ */ jsx37(LayerVisibilityProvider, { children: /* @__PURE__ */ jsx37(RenderingModeProvider, { children: /* @__PURE__ */ jsx37(ToastProvider, { children: /* @__PURE__ */ jsx37(CadViewerInner, { ...props }) }) }) })
|
|
46934
47390
|
}
|
|
46935
47391
|
);
|
|
46936
47392
|
};
|
|
@@ -47225,10 +47681,10 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
|
|
|
47225
47681
|
|
|
47226
47682
|
// src/hooks/exporter/gltf.ts
|
|
47227
47683
|
import { GLTFExporter as GLTFExporter3 } from "three-stdlib";
|
|
47228
|
-
import { useEffect as useEffect49, useState as useState40, useMemo as
|
|
47684
|
+
import { useEffect as useEffect49, useState as useState40, useMemo as useMemo32, useCallback as useCallback26 } from "react";
|
|
47229
47685
|
function useSaveGltfAs(options = {}) {
|
|
47230
47686
|
const parse2 = useParser(options);
|
|
47231
|
-
const link =
|
|
47687
|
+
const link = useMemo32(() => document.createElement("a"), []);
|
|
47232
47688
|
const saveAs = async (filename) => {
|
|
47233
47689
|
const name = filename ?? options.filename ?? "";
|
|
47234
47690
|
if (options.binary == null) options.binary = name.endsWith(".glb");
|
|
@@ -47263,7 +47719,7 @@ function useExportGltfUrl(options = {}) {
|
|
|
47263
47719
|
return [ref, url, error];
|
|
47264
47720
|
}
|
|
47265
47721
|
function useParser(options = {}) {
|
|
47266
|
-
const exporter =
|
|
47722
|
+
const exporter = useMemo32(() => new GLTFExporter3(), []);
|
|
47267
47723
|
return (instance) => {
|
|
47268
47724
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
47269
47725
|
exporter.parse(
|