@tscircuit/3d-viewer 0.0.577 → 0.0.578

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1436 -890
  2. 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 __defProp3 = Object.defineProperty;
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
- __defProp3(target, name, { get: all[name], enumerable: true });
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
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
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(__defProp3({}, "__esModule", { value: true }), mod);
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 useRef28, useEffect as useEffect48 } from "react";
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
@@ -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.576",
32713
+ version: "0.0.577",
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
- canvasRef.current = canvas;
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
- animationFrameRef.current = requestAnimationFrame(animate);
33788
+ animationFrameId = requestAnimationFrame(animate);
33796
33789
  };
33797
33790
  animate();
33798
33791
  return () => {
33799
- if (animationFrameRef.current) {
33800
- cancelAnimationFrame(animationFrameRef.current);
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
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";
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
- const createScope = () => {
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 React16 from "react";
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
- var useInsertionEffect = React16[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
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 (true) {
40161
- const isControlledRef = React16.useRef(prop !== void 0);
40162
- React16.useEffect(() => {
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 = React16.useCallback(
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] = React16.useState(defaultProp);
40194
- const prevValueRef = React16.useRef(value);
40195
- const onChangeRef = React16.useRef(onChange);
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
- React16.useEffect(() => {
40299
+ React17.useEffect(() => {
40200
40300
  if (prevValueRef.current !== value) {
40201
40301
  onChangeRef.current?.(value);
40202
40302
  prevValueRef.current = value;
@@ -40204,27 +40304,147 @@ 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 React18 from "react";
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 React17 from "react";
40379
+ import * as React18 from "react";
40380
+ import { jsx as jsx22 } from "react/jsx-runtime";
40381
+ var __defProp8 = Object.defineProperty;
40382
+ var __name6 = (target, value) => __defProp8(target, "name", { value, configurable: true });
40383
+ var mergeProps = /* @__PURE__ */ __name6(((slotProps, childProps) => {
40384
+ const overrideProps = { ...childProps };
40385
+ for (const propName in childProps) {
40386
+ const slotPropValue = slotProps[propName];
40387
+ const childPropValue = childProps[propName];
40388
+ const isHandler = /^on[A-Z]/.test(propName);
40389
+ if (isHandler) {
40390
+ if (slotPropValue && childPropValue) {
40391
+ const slotIsFunction = typeof slotPropValue === "function";
40392
+ const childIsFunction = typeof childPropValue === "function";
40393
+ if (IS_DEVELOPMENT) {
40394
+ if (!slotIsFunction || !childIsFunction) {
40395
+ console.warn(
40396
+ `Slot: Expected a function for ${propName}, but received ${[typeof slotPropValue, typeof childPropValue].filter((v) => v !== "function").join(" and ")}.`
40397
+ );
40398
+ }
40399
+ }
40400
+ overrideProps[propName] = (...args) => {
40401
+ const result = childIsFunction ? childPropValue(...args) : void 0;
40402
+ if (slotIsFunction) {
40403
+ slotPropValue(...args);
40404
+ }
40405
+ return result;
40406
+ };
40407
+ } else if (slotPropValue) {
40408
+ overrideProps[propName] = slotPropValue;
40409
+ }
40410
+ } else if (propName === "style") {
40411
+ overrideProps[propName] = {
40412
+ ...typeof slotPropValue === "object" ? slotPropValue : null,
40413
+ ...typeof childPropValue === "object" ? childPropValue : null
40414
+ };
40415
+ } else if (propName === "className") {
40416
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
40417
+ } else if (propName === "aria-describedby") {
40418
+ overrideProps[propName] = concatAriaDescribedby(childPropValue, slotPropValue);
40419
+ }
40420
+ }
40421
+ return { ...slotProps, ...overrideProps };
40422
+ }), "mergeProps");
40423
+ function concatAriaDescribedby(...values) {
40424
+ const ids = /* @__PURE__ */ new Set();
40425
+ for (const value of values) {
40426
+ if (typeof value !== "string") continue;
40427
+ for (const id of String(value).trim().split(/\s+/)) {
40428
+ if (id) ids.add(id);
40429
+ }
40430
+ }
40431
+ return ids.size > 0 ? Array.from(ids).join(" ") : void 0;
40432
+ }
40433
+ __name6(concatAriaDescribedby, "concatAriaDescribedby");
40434
+ var SlotContext = React18.createContext(mergeProps);
40435
+ SlotContext.displayName = "SlotContext";
40217
40436
  // @__NO_SIDE_EFFECTS__
40218
40437
  function createSlot(ownerName) {
40219
- const Slot2 = React17.forwardRef((props, forwardedRef) => {
40220
- let { children, ...slotProps } = props;
40438
+ const Slot2 = React18.forwardRef((props, forwardedRef) => {
40439
+ const context = React18.useContext(SlotContext);
40440
+ let { children, mergeProps: mergePropsProp = context, ...slotProps } = props;
40221
40441
  let slottableElement = null;
40222
40442
  let hasSlottable = false;
40223
40443
  const newChildren = [];
40224
40444
  if (isLazyComponent(children) && typeof use === "function") {
40225
40445
  children = use(children._payload);
40226
40446
  }
40227
- React17.Children.forEach(children, (maybeSlottable) => {
40447
+ React18.Children.forEach(children, (maybeSlottable) => {
40228
40448
  if (isSlottable(maybeSlottable)) {
40229
40449
  hasSlottable = true;
40230
40450
  const slottable = maybeSlottable;
@@ -40239,13 +40459,13 @@ function createSlot(ownerName) {
40239
40459
  }
40240
40460
  });
40241
40461
  if (slottableElement) {
40242
- slottableElement = React17.cloneElement(slottableElement, void 0, newChildren);
40462
+ slottableElement = React18.cloneElement(slottableElement, void 0, newChildren);
40243
40463
  } else if (
40244
40464
  // A `Slottable` was found but it didn't resolve to a single element (e.g.
40245
40465
  // it wrapped multiple elements, text, or a render-prop `child` that
40246
40466
  // wasn't an element). Don't fall back to treating the `Slottable` wrapper
40247
40467
  // itself as the slot target — throw a descriptive error below instead.
40248
- !hasSlottable && React17.Children.count(children) === 1 && React17.isValidElement(children)
40468
+ !hasSlottable && React18.Children.count(children) === 1 && React18.isValidElement(children)
40249
40469
  ) {
40250
40470
  slottableElement = children;
40251
40471
  }
@@ -40259,48 +40479,36 @@ function createSlot(ownerName) {
40259
40479
  }
40260
40480
  return children;
40261
40481
  }
40262
- const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
40263
- if (slottableElement.type !== React17.Fragment) {
40482
+ const mergedProps = mergePropsProp(
40483
+ slotProps,
40484
+ slottableElement.props ?? {}
40485
+ );
40486
+ if (slottableElement.type !== React18.Fragment) {
40264
40487
  mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
40265
40488
  }
40266
- return React17.cloneElement(slottableElement, mergedProps);
40489
+ return React18.cloneElement(slottableElement, mergedProps);
40267
40490
  });
40268
40491
  Slot2.displayName = `${ownerName}.Slot`;
40269
40492
  return Slot2;
40270
40493
  }
40494
+ __name6(createSlot, "createSlot");
40271
40495
  var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol.for("radix.slottable");
40272
- var getSlottableElementFromSlottable = (slottable, child) => {
40496
+ // @__NO_SIDE_EFFECTS__
40497
+ function createSlottable(ownerName) {
40498
+ const Slottable2 = /* @__PURE__ */ __name6((props) => "child" in props ? props.children(props.child) : props.children, "Slottable");
40499
+ Slottable2.displayName = `${ownerName}.Slottable`;
40500
+ Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
40501
+ return Slottable2;
40502
+ }
40503
+ __name6(createSlottable, "createSlottable");
40504
+ var getSlottableElementFromSlottable = /* @__PURE__ */ __name6((slottable, child) => {
40273
40505
  if ("child" in slottable.props) {
40274
40506
  const child2 = slottable.props.child;
40275
- if (!React17.isValidElement(child2)) return null;
40276
- return React17.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
40277
- }
40278
- return React17.isValidElement(child) ? child : null;
40279
- };
40280
- function mergeProps(slotProps, childProps) {
40281
- const overrideProps = { ...childProps };
40282
- for (const propName in childProps) {
40283
- const slotPropValue = slotProps[propName];
40284
- const childPropValue = childProps[propName];
40285
- const isHandler = /^on[A-Z]/.test(propName);
40286
- if (isHandler) {
40287
- if (slotPropValue && childPropValue) {
40288
- overrideProps[propName] = (...args) => {
40289
- const result = childPropValue(...args);
40290
- slotPropValue(...args);
40291
- return result;
40292
- };
40293
- } else if (slotPropValue) {
40294
- overrideProps[propName] = slotPropValue;
40295
- }
40296
- } else if (propName === "style") {
40297
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
40298
- } else if (propName === "className") {
40299
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
40300
- }
40507
+ if (!React18.isValidElement(child2)) return null;
40508
+ return React18.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
40301
40509
  }
40302
- return { ...slotProps, ...overrideProps };
40303
- }
40510
+ return React18.isValidElement(child) ? child : null;
40511
+ }, "getSlottableElementFromSlottable");
40304
40512
  function getElementRef(element) {
40305
40513
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
40306
40514
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
@@ -40314,26 +40522,32 @@ function getElementRef(element) {
40314
40522
  }
40315
40523
  return element.props.ref || element.ref;
40316
40524
  }
40525
+ __name6(getElementRef, "getElementRef");
40317
40526
  function isSlottable(child) {
40318
- return React17.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
40527
+ return React18.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
40319
40528
  }
40529
+ __name6(isSlottable, "isSlottable");
40320
40530
  var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
40321
40531
  function isLazyComponent(element) {
40322
40532
  return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
40323
40533
  }
40534
+ __name6(isLazyComponent, "isLazyComponent");
40324
40535
  function isPromiseLike(value) {
40325
40536
  return typeof value === "object" && value !== null && "then" in value;
40326
40537
  }
40327
- var createSlotError = (ownerName) => {
40538
+ __name6(isPromiseLike, "isPromiseLike");
40539
+ var createSlotError = /* @__PURE__ */ __name6((ownerName) => {
40328
40540
  return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
40329
- };
40330
- var createSlottableError = (ownerName) => {
40541
+ }, "createSlotError");
40542
+ var createSlottableError = /* @__PURE__ */ __name6((ownerName) => {
40331
40543
  return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
40332
- };
40333
- var use = React17[" use ".trim().toString()];
40544
+ }, "createSlottableError");
40545
+ var use = React18[" use ".trim().toString()];
40334
40546
 
40335
40547
  // node_modules/@radix-ui/react-primitive/dist/index.mjs
40336
- import { jsx as jsx22 } from "react/jsx-runtime";
40548
+ import { jsx as jsx23 } from "react/jsx-runtime";
40549
+ var __defProp9 = Object.defineProperty;
40550
+ var __name7 = (target, value) => __defProp9(target, "name", { value, configurable: true });
40337
40551
  var NODES = [
40338
40552
  "a",
40339
40553
  "button",
@@ -40355,13 +40569,13 @@ var NODES = [
40355
40569
  ];
40356
40570
  var Primitive = NODES.reduce((primitive, node) => {
40357
40571
  const Slot2 = createSlot(`Primitive.${node}`);
40358
- const Node2 = React18.forwardRef((props, forwardedRef) => {
40572
+ const Node2 = React19.forwardRef((props, forwardedRef) => {
40359
40573
  const { asChild, ...primitiveProps } = props;
40360
40574
  const Comp = asChild ? Slot2 : node;
40361
40575
  if (typeof window !== "undefined") {
40362
40576
  window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
40363
40577
  }
40364
- return /* @__PURE__ */ jsx22(Comp, { ...primitiveProps, ref: forwardedRef });
40578
+ return /* @__PURE__ */ jsx23(Comp, { ...primitiveProps, ref: forwardedRef });
40365
40579
  });
40366
40580
  Node2.displayName = `Primitive.${node}`;
40367
40581
  return { ...primitive, [node]: Node2 };
@@ -40369,15 +40583,19 @@ var Primitive = NODES.reduce((primitive, node) => {
40369
40583
  function dispatchDiscreteCustomEvent(target, event) {
40370
40584
  if (target) ReactDOM2.flushSync(() => target.dispatchEvent(event));
40371
40585
  }
40586
+ __name7(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
40372
40587
 
40373
40588
  // node_modules/@radix-ui/react-menu/dist/index.mjs
40374
40589
  import * as React43 from "react";
40375
40590
 
40376
40591
  // node_modules/@radix-ui/react-collection/dist/index.mjs
40377
- import * as React19 from "react";
40378
- import { jsx as jsx23 } from "react/jsx-runtime";
40379
- import * as React23 from "react";
40592
+ import * as React20 from "react";
40380
40593
  import { jsx as jsx24 } from "react/jsx-runtime";
40594
+ import * as React23 from "react";
40595
+ import { jsx as jsx25 } from "react/jsx-runtime";
40596
+ var __defProp10 = Object.defineProperty;
40597
+ var __name8 = (target, value) => __defProp10(target, "name", { value, configurable: true });
40598
+ // @__NO_SIDE_EFFECTS__
40381
40599
  function createCollection(name) {
40382
40600
  const PROVIDER_NAME = name + "CollectionProvider";
40383
40601
  const [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME);
@@ -40385,44 +40603,44 @@ function createCollection(name) {
40385
40603
  PROVIDER_NAME,
40386
40604
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
40387
40605
  );
40388
- const CollectionProvider = (props) => {
40606
+ const CollectionProvider = /* @__PURE__ */ __name8((props) => {
40389
40607
  const { scope, children } = props;
40390
- const ref = React19.useRef(null);
40391
- const itemMap = React19.useRef(/* @__PURE__ */ new Map()).current;
40392
- return /* @__PURE__ */ jsx23(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
40393
- };
40608
+ const ref = React20.useRef(null);
40609
+ const itemMap = React20.useRef(/* @__PURE__ */ new Map()).current;
40610
+ return /* @__PURE__ */ jsx24(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
40611
+ }, "CollectionProvider");
40394
40612
  CollectionProvider.displayName = PROVIDER_NAME;
40395
40613
  const COLLECTION_SLOT_NAME = name + "CollectionSlot";
40396
40614
  const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
40397
- const CollectionSlot = React19.forwardRef(
40615
+ const CollectionSlot = React20.forwardRef(
40398
40616
  (props, forwardedRef) => {
40399
40617
  const { scope, children } = props;
40400
40618
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
40401
40619
  const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
40402
- return /* @__PURE__ */ jsx23(CollectionSlotImpl, { ref: composedRefs, children });
40620
+ return /* @__PURE__ */ jsx24(CollectionSlotImpl, { ref: composedRefs, children });
40403
40621
  }
40404
40622
  );
40405
40623
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
40406
40624
  const ITEM_SLOT_NAME = name + "CollectionItemSlot";
40407
40625
  const ITEM_DATA_ATTR = "data-radix-collection-item";
40408
40626
  const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
40409
- const CollectionItemSlot = React19.forwardRef(
40627
+ const CollectionItemSlot = React20.forwardRef(
40410
40628
  (props, forwardedRef) => {
40411
40629
  const { scope, children, ...itemData } = props;
40412
- const ref = React19.useRef(null);
40630
+ const ref = React20.useRef(null);
40413
40631
  const composedRefs = useComposedRefs(forwardedRef, ref);
40414
40632
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
40415
- React19.useEffect(() => {
40633
+ React20.useEffect(() => {
40416
40634
  context.itemMap.set(ref, { ref, ...itemData });
40417
40635
  return () => void context.itemMap.delete(ref);
40418
40636
  });
40419
- return /* @__PURE__ */ jsx23(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
40637
+ return /* @__PURE__ */ jsx24(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
40420
40638
  }
40421
40639
  );
40422
40640
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
40423
40641
  function useCollection3(scope) {
40424
40642
  const context = useCollectionContext(name + "CollectionConsumer", scope);
40425
- const getItems = React19.useCallback(() => {
40643
+ const getItems = React20.useCallback(() => {
40426
40644
  const collectionNode = context.collectionRef.current;
40427
40645
  if (!collectionNode) return [];
40428
40646
  const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
@@ -40434,43 +40652,525 @@ function createCollection(name) {
40434
40652
  }, [context.collectionRef, context.itemMap]);
40435
40653
  return getItems;
40436
40654
  }
40655
+ __name8(useCollection3, "useCollection");
40437
40656
  return [
40438
40657
  { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
40439
40658
  useCollection3,
40440
40659
  createCollectionScope3
40441
40660
  ];
40442
40661
  }
40662
+ __name8(createCollection, "createCollection");
40663
+ var __instanciated = /* @__PURE__ */ new WeakMap();
40664
+ var OrderedDict = class _OrderedDict extends Map {
40665
+ static {
40666
+ __name8(this, "OrderedDict");
40667
+ }
40668
+ #keys;
40669
+ constructor(entries) {
40670
+ super(entries);
40671
+ this.#keys = [...super.keys()];
40672
+ __instanciated.set(this, true);
40673
+ }
40674
+ set(key, value) {
40675
+ if (__instanciated.get(this)) {
40676
+ if (this.has(key)) {
40677
+ this.#keys[this.#keys.indexOf(key)] = key;
40678
+ } else {
40679
+ this.#keys.push(key);
40680
+ }
40681
+ }
40682
+ super.set(key, value);
40683
+ return this;
40684
+ }
40685
+ insert(index2, key, value) {
40686
+ const has = this.has(key);
40687
+ const length64 = this.#keys.length;
40688
+ const relativeIndex = toSafeInteger(index2);
40689
+ let actualIndex = relativeIndex >= 0 ? relativeIndex : length64 + relativeIndex;
40690
+ const safeIndex = actualIndex < 0 || actualIndex >= length64 ? -1 : actualIndex;
40691
+ if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {
40692
+ this.set(key, value);
40693
+ return this;
40694
+ }
40695
+ const size4 = this.size + (has ? 0 : 1);
40696
+ if (relativeIndex < 0) {
40697
+ actualIndex++;
40698
+ }
40699
+ const keys = [...this.#keys];
40700
+ let nextValue;
40701
+ let shouldSkip = false;
40702
+ for (let i = actualIndex; i < size4; i++) {
40703
+ if (actualIndex === i) {
40704
+ let nextKey = keys[i];
40705
+ if (keys[i] === key) {
40706
+ nextKey = keys[i + 1];
40707
+ }
40708
+ if (has) {
40709
+ this.delete(key);
40710
+ }
40711
+ nextValue = this.get(nextKey);
40712
+ this.set(key, value);
40713
+ } else {
40714
+ if (!shouldSkip && keys[i - 1] === key) {
40715
+ shouldSkip = true;
40716
+ }
40717
+ const currentKey = keys[shouldSkip ? i : i - 1];
40718
+ const currentValue = nextValue;
40719
+ nextValue = this.get(currentKey);
40720
+ this.delete(currentKey);
40721
+ this.set(currentKey, currentValue);
40722
+ }
40723
+ }
40724
+ return this;
40725
+ }
40726
+ with(index2, key, value) {
40727
+ const copy = new _OrderedDict(this);
40728
+ copy.insert(index2, key, value);
40729
+ return copy;
40730
+ }
40731
+ before(key) {
40732
+ const index2 = this.#keys.indexOf(key) - 1;
40733
+ if (index2 < 0) {
40734
+ return void 0;
40735
+ }
40736
+ return this.entryAt(index2);
40737
+ }
40738
+ /**
40739
+ * Sets a new key-value pair at the position before the given key.
40740
+ */
40741
+ setBefore(key, newKey, value) {
40742
+ const index2 = this.#keys.indexOf(key);
40743
+ if (index2 === -1) {
40744
+ return this;
40745
+ }
40746
+ return this.insert(index2, newKey, value);
40747
+ }
40748
+ after(key) {
40749
+ let index2 = this.#keys.indexOf(key);
40750
+ index2 = index2 === -1 || index2 === this.size - 1 ? -1 : index2 + 1;
40751
+ if (index2 === -1) {
40752
+ return void 0;
40753
+ }
40754
+ return this.entryAt(index2);
40755
+ }
40756
+ /**
40757
+ * Sets a new key-value pair at the position after the given key.
40758
+ */
40759
+ setAfter(key, newKey, value) {
40760
+ const index2 = this.#keys.indexOf(key);
40761
+ if (index2 === -1) {
40762
+ return this;
40763
+ }
40764
+ return this.insert(index2 + 1, newKey, value);
40765
+ }
40766
+ first() {
40767
+ return this.entryAt(0);
40768
+ }
40769
+ last() {
40770
+ return this.entryAt(-1);
40771
+ }
40772
+ clear() {
40773
+ this.#keys = [];
40774
+ return super.clear();
40775
+ }
40776
+ delete(key) {
40777
+ const deleted = super.delete(key);
40778
+ if (deleted) {
40779
+ this.#keys.splice(this.#keys.indexOf(key), 1);
40780
+ }
40781
+ return deleted;
40782
+ }
40783
+ deleteAt(index2) {
40784
+ const key = this.keyAt(index2);
40785
+ if (key !== void 0) {
40786
+ return this.delete(key);
40787
+ }
40788
+ return false;
40789
+ }
40790
+ at(index2) {
40791
+ const key = at(this.#keys, index2);
40792
+ if (key !== void 0) {
40793
+ return this.get(key);
40794
+ }
40795
+ }
40796
+ entryAt(index2) {
40797
+ const key = at(this.#keys, index2);
40798
+ if (key !== void 0) {
40799
+ return [key, this.get(key)];
40800
+ }
40801
+ }
40802
+ indexOf(key) {
40803
+ return this.#keys.indexOf(key);
40804
+ }
40805
+ keyAt(index2) {
40806
+ return at(this.#keys, index2);
40807
+ }
40808
+ from(key, offset4) {
40809
+ const index2 = this.indexOf(key);
40810
+ if (index2 === -1) {
40811
+ return void 0;
40812
+ }
40813
+ let dest = index2 + offset4;
40814
+ if (dest < 0) dest = 0;
40815
+ if (dest >= this.size) dest = this.size - 1;
40816
+ return this.at(dest);
40817
+ }
40818
+ keyFrom(key, offset4) {
40819
+ const index2 = this.indexOf(key);
40820
+ if (index2 === -1) {
40821
+ return void 0;
40822
+ }
40823
+ let dest = index2 + offset4;
40824
+ if (dest < 0) dest = 0;
40825
+ if (dest >= this.size) dest = this.size - 1;
40826
+ return this.keyAt(dest);
40827
+ }
40828
+ find(predicate, thisArg) {
40829
+ let index2 = 0;
40830
+ for (const entry of this) {
40831
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
40832
+ return entry;
40833
+ }
40834
+ index2++;
40835
+ }
40836
+ return void 0;
40837
+ }
40838
+ findIndex(predicate, thisArg) {
40839
+ let index2 = 0;
40840
+ for (const entry of this) {
40841
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
40842
+ return index2;
40843
+ }
40844
+ index2++;
40845
+ }
40846
+ return -1;
40847
+ }
40848
+ filter(predicate, thisArg) {
40849
+ const entries = [];
40850
+ let index2 = 0;
40851
+ for (const entry of this) {
40852
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
40853
+ entries.push(entry);
40854
+ }
40855
+ index2++;
40856
+ }
40857
+ return new _OrderedDict(entries);
40858
+ }
40859
+ map(callbackfn, thisArg) {
40860
+ const entries = [];
40861
+ let index2 = 0;
40862
+ for (const entry of this) {
40863
+ entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index2, this])]);
40864
+ index2++;
40865
+ }
40866
+ return new _OrderedDict(entries);
40867
+ }
40868
+ reduce(...args) {
40869
+ const [callbackfn, initialValue] = args;
40870
+ let index2 = 0;
40871
+ let accumulator = initialValue ?? this.at(0);
40872
+ for (const entry of this) {
40873
+ if (index2 === 0 && args.length === 1) {
40874
+ accumulator = entry;
40875
+ } else {
40876
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
40877
+ }
40878
+ index2++;
40879
+ }
40880
+ return accumulator;
40881
+ }
40882
+ reduceRight(...args) {
40883
+ const [callbackfn, initialValue] = args;
40884
+ let accumulator = initialValue ?? this.at(-1);
40885
+ for (let index2 = this.size - 1; index2 >= 0; index2--) {
40886
+ const entry = this.at(index2);
40887
+ if (index2 === this.size - 1 && args.length === 1) {
40888
+ accumulator = entry;
40889
+ } else {
40890
+ accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index2, this]);
40891
+ }
40892
+ }
40893
+ return accumulator;
40894
+ }
40895
+ toSorted(compareFn) {
40896
+ const entries = [...this.entries()].sort(compareFn);
40897
+ return new _OrderedDict(entries);
40898
+ }
40899
+ toReversed() {
40900
+ const reversed = new _OrderedDict();
40901
+ for (let index2 = this.size - 1; index2 >= 0; index2--) {
40902
+ const key = this.keyAt(index2);
40903
+ const element = this.get(key);
40904
+ reversed.set(key, element);
40905
+ }
40906
+ return reversed;
40907
+ }
40908
+ toSpliced(...args) {
40909
+ const entries = [...this.entries()];
40910
+ entries.splice(...args);
40911
+ return new _OrderedDict(entries);
40912
+ }
40913
+ slice(start, end) {
40914
+ const result = new _OrderedDict();
40915
+ let stop = this.size - 1;
40916
+ if (start === void 0) {
40917
+ return result;
40918
+ }
40919
+ if (start < 0) {
40920
+ start = start + this.size;
40921
+ }
40922
+ if (end !== void 0 && end > 0) {
40923
+ stop = end - 1;
40924
+ }
40925
+ for (let index2 = start; index2 <= stop; index2++) {
40926
+ const key = this.keyAt(index2);
40927
+ const element = this.get(key);
40928
+ result.set(key, element);
40929
+ }
40930
+ return result;
40931
+ }
40932
+ every(predicate, thisArg) {
40933
+ let index2 = 0;
40934
+ for (const entry of this) {
40935
+ if (!Reflect.apply(predicate, thisArg, [entry, index2, this])) {
40936
+ return false;
40937
+ }
40938
+ index2++;
40939
+ }
40940
+ return true;
40941
+ }
40942
+ some(predicate, thisArg) {
40943
+ let index2 = 0;
40944
+ for (const entry of this) {
40945
+ if (Reflect.apply(predicate, thisArg, [entry, index2, this])) {
40946
+ return true;
40947
+ }
40948
+ index2++;
40949
+ }
40950
+ return false;
40951
+ }
40952
+ };
40953
+ function at(array, index2) {
40954
+ if ("at" in Array.prototype) {
40955
+ return Array.prototype.at.call(array, index2);
40956
+ }
40957
+ const actualIndex = toSafeIndex(array, index2);
40958
+ return actualIndex === -1 ? void 0 : array[actualIndex];
40959
+ }
40960
+ __name8(at, "at");
40961
+ function toSafeIndex(array, index2) {
40962
+ const length64 = array.length;
40963
+ const relativeIndex = toSafeInteger(index2);
40964
+ const actualIndex = relativeIndex >= 0 ? relativeIndex : length64 + relativeIndex;
40965
+ return actualIndex < 0 || actualIndex >= length64 ? -1 : actualIndex;
40966
+ }
40967
+ __name8(toSafeIndex, "toSafeIndex");
40968
+ function toSafeInteger(number) {
40969
+ return number !== number || number === 0 ? 0 : Math.trunc(number);
40970
+ }
40971
+ __name8(toSafeInteger, "toSafeInteger");
40972
+ // @__NO_SIDE_EFFECTS__
40973
+ function createCollection2(name) {
40974
+ const PROVIDER_NAME = name + "CollectionProvider";
40975
+ const [createCollectionContext, createCollectionScope3] = createContextScope(PROVIDER_NAME);
40976
+ const [CollectionContextProvider, useCollectionContext] = createCollectionContext(
40977
+ PROVIDER_NAME,
40978
+ {
40979
+ collectionElement: null,
40980
+ collectionRef: { current: null },
40981
+ collectionRefObject: { current: null },
40982
+ itemMap: new OrderedDict(),
40983
+ setItemMap: /* @__PURE__ */ __name8(() => void 0, "setItemMap")
40984
+ }
40985
+ );
40986
+ const CollectionProvider = /* @__PURE__ */ __name8(({ state, ...props }) => {
40987
+ return state ? /* @__PURE__ */ jsx25(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx25(CollectionInit, { ...props });
40988
+ }, "CollectionProvider");
40989
+ CollectionProvider.displayName = PROVIDER_NAME;
40990
+ const CollectionInit = /* @__PURE__ */ __name8((props) => {
40991
+ const state = useInitCollection();
40992
+ return /* @__PURE__ */ jsx25(CollectionProviderImpl, { ...props, state });
40993
+ }, "CollectionInit");
40994
+ CollectionInit.displayName = PROVIDER_NAME + "Init";
40995
+ const CollectionProviderImpl = /* @__PURE__ */ __name8((props) => {
40996
+ const { scope, children, state } = props;
40997
+ const ref = React23.useRef(null);
40998
+ const [collectionElement, setCollectionElement] = React23.useState(
40999
+ null
41000
+ );
41001
+ const composeRefs2 = useComposedRefs(ref, setCollectionElement);
41002
+ const [itemMap, setItemMap] = state;
41003
+ React23.useEffect(() => {
41004
+ if (!collectionElement) return;
41005
+ const observer = getChildListObserver(() => {
41006
+ });
41007
+ observer.observe(collectionElement, {
41008
+ childList: true,
41009
+ subtree: true
41010
+ });
41011
+ return () => {
41012
+ observer.disconnect();
41013
+ };
41014
+ }, [collectionElement]);
41015
+ return /* @__PURE__ */ jsx25(
41016
+ CollectionContextProvider,
41017
+ {
41018
+ scope,
41019
+ itemMap,
41020
+ setItemMap,
41021
+ collectionRef: composeRefs2,
41022
+ collectionRefObject: ref,
41023
+ collectionElement,
41024
+ children
41025
+ }
41026
+ );
41027
+ }, "CollectionProviderImpl");
41028
+ CollectionProviderImpl.displayName = PROVIDER_NAME + "Impl";
41029
+ const COLLECTION_SLOT_NAME = name + "CollectionSlot";
41030
+ const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
41031
+ const CollectionSlot = React23.forwardRef(
41032
+ (props, forwardedRef) => {
41033
+ const { scope, children } = props;
41034
+ const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
41035
+ const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
41036
+ return /* @__PURE__ */ jsx25(CollectionSlotImpl, { ref: composedRefs, children });
41037
+ }
41038
+ );
41039
+ CollectionSlot.displayName = COLLECTION_SLOT_NAME;
41040
+ const ITEM_SLOT_NAME = name + "CollectionItemSlot";
41041
+ const ITEM_DATA_ATTR = "data-radix-collection-item";
41042
+ const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
41043
+ const CollectionItemSlot = React23.forwardRef(
41044
+ (props, forwardedRef) => {
41045
+ const { scope, children, ...itemData } = props;
41046
+ const ref = React23.useRef(null);
41047
+ const [element, setElement] = React23.useState(null);
41048
+ const composedRefs = useComposedRefs(forwardedRef, ref, setElement);
41049
+ const context = useCollectionContext(ITEM_SLOT_NAME, scope);
41050
+ const { setItemMap } = context;
41051
+ const itemDataRef = React23.useRef(itemData);
41052
+ if (!shallowEqual(itemDataRef.current, itemData)) {
41053
+ itemDataRef.current = itemData;
41054
+ }
41055
+ const memoizedItemData = itemDataRef.current;
41056
+ React23.useEffect(() => {
41057
+ const itemData2 = memoizedItemData;
41058
+ setItemMap((map) => {
41059
+ if (!element) {
41060
+ return map;
41061
+ }
41062
+ if (!map.has(element)) {
41063
+ map.set(element, { ...itemData2, element });
41064
+ return map.toSorted(sortByDocumentPosition);
41065
+ }
41066
+ return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);
41067
+ });
41068
+ return () => {
41069
+ setItemMap((map) => {
41070
+ if (!element || !map.has(element)) {
41071
+ return map;
41072
+ }
41073
+ map.delete(element);
41074
+ return new OrderedDict(map);
41075
+ });
41076
+ };
41077
+ }, [element, memoizedItemData, setItemMap]);
41078
+ return /* @__PURE__ */ jsx25(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
41079
+ }
41080
+ );
41081
+ CollectionItemSlot.displayName = ITEM_SLOT_NAME;
41082
+ function useInitCollection() {
41083
+ return React23.useState(new OrderedDict());
41084
+ }
41085
+ __name8(useInitCollection, "useInitCollection");
41086
+ function useCollection3(scope) {
41087
+ const { itemMap } = useCollectionContext(name + "CollectionConsumer", scope);
41088
+ return itemMap;
41089
+ }
41090
+ __name8(useCollection3, "useCollection");
41091
+ const functions = {
41092
+ createCollectionScope: createCollectionScope3,
41093
+ useCollection: useCollection3,
41094
+ useInitCollection
41095
+ };
41096
+ return [
41097
+ { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
41098
+ functions
41099
+ ];
41100
+ }
41101
+ __name8(createCollection2, "createCollection");
41102
+ function shallowEqual(a, b) {
41103
+ if (a === b) return true;
41104
+ if (typeof a !== "object" || typeof b !== "object") return false;
41105
+ if (a == null || b == null) return false;
41106
+ const keysA = Object.keys(a);
41107
+ const keysB = Object.keys(b);
41108
+ if (keysA.length !== keysB.length) return false;
41109
+ for (const key of keysA) {
41110
+ if (!Object.prototype.hasOwnProperty.call(b, key)) return false;
41111
+ if (a[key] !== b[key]) return false;
41112
+ }
41113
+ return true;
41114
+ }
41115
+ __name8(shallowEqual, "shallowEqual");
41116
+ function isElementPreceding(a, b) {
41117
+ return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);
41118
+ }
41119
+ __name8(isElementPreceding, "isElementPreceding");
41120
+ function sortByDocumentPosition(a, b) {
41121
+ return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;
41122
+ }
41123
+ __name8(sortByDocumentPosition, "sortByDocumentPosition");
41124
+ function getChildListObserver(callback) {
41125
+ const observer = new MutationObserver((mutationsList) => {
41126
+ for (const mutation of mutationsList) {
41127
+ if (mutation.type === "childList") {
41128
+ callback();
41129
+ return;
41130
+ }
41131
+ }
41132
+ });
41133
+ return observer;
41134
+ }
41135
+ __name8(getChildListObserver, "getChildListObserver");
40443
41136
 
40444
41137
  // node_modules/@radix-ui/react-direction/dist/index.mjs
40445
- import * as React20 from "react";
40446
- import { jsx as jsx25 } from "react/jsx-runtime";
40447
- var DirectionContext = React20.createContext(void 0);
41138
+ import * as React21 from "react";
41139
+ import { jsx as jsx26 } from "react/jsx-runtime";
41140
+ var __defProp11 = Object.defineProperty;
41141
+ var __name9 = (target, value) => __defProp11(target, "name", { value, configurable: true });
41142
+ var DirectionContext = React21.createContext(void 0);
40448
41143
  function useDirection(localDir) {
40449
- const globalDir = React20.useContext(DirectionContext);
41144
+ const globalDir = React21.useContext(DirectionContext);
40450
41145
  return localDir || globalDir || "ltr";
40451
41146
  }
41147
+ __name9(useDirection, "useDirection");
40452
41148
 
40453
41149
  // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
40454
- import * as React24 from "react";
41150
+ import * as React25 from "react";
40455
41151
 
40456
41152
  // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
40457
- import * as React21 from "react";
41153
+ import * as React24 from "react";
41154
+ var __defProp12 = Object.defineProperty;
41155
+ var __name10 = (target, value) => __defProp12(target, "name", { value, configurable: true });
40458
41156
  function useCallbackRef(callback) {
40459
- const callbackRef = React21.useRef(callback);
40460
- React21.useEffect(() => {
41157
+ const callbackRef = React24.useRef(callback);
41158
+ React24.useEffect(() => {
40461
41159
  callbackRef.current = callback;
40462
41160
  });
40463
- return React21.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
41161
+ return React24.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
40464
41162
  }
41163
+ __name10(useCallbackRef, "useCallbackRef");
40465
41164
 
40466
41165
  // node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
40467
- import { jsx as jsx26 } from "react/jsx-runtime";
40468
- var DISMISSABLE_LAYER_NAME = "DismissableLayer";
41166
+ import { jsx as jsx27 } from "react/jsx-runtime";
41167
+ var __defProp13 = Object.defineProperty;
41168
+ var __name11 = (target, value) => __defProp13(target, "name", { value, configurable: true });
40469
41169
  var CONTEXT_UPDATE = "dismissableLayer.update";
40470
41170
  var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
40471
41171
  var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
40472
41172
  var originalBodyPointerEvents;
40473
- var DismissableLayerContext = React24.createContext({
41173
+ var DismissableLayerContext = React25.createContext({
40474
41174
  layers: /* @__PURE__ */ new Set(),
40475
41175
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
40476
41176
  branches: /* @__PURE__ */ new Set(),
@@ -40481,8 +41181,9 @@ var DismissableLayerContext = React24.createContext({
40481
41181
  // See https://github.com/radix-ui/primitives/issues/3346
40482
41182
  dismissableSurfaces: /* @__PURE__ */ new Set()
40483
41183
  });
40484
- var DismissableLayer = React24.forwardRef(
40485
- (props, forwardedRef) => {
41184
+ var DismissableLayer = /* @__PURE__ */ React25.forwardRef(
41185
+ // blank line to reduce diff noise
41186
+ /* @__PURE__ */ __name11(function DismissableLayer2(props, forwardedRef) {
40486
41187
  const {
40487
41188
  disableOutsidePointerEvents = false,
40488
41189
  deferPointerDownOutside = false,
@@ -40493,10 +41194,10 @@ var DismissableLayer = React24.forwardRef(
40493
41194
  onDismiss,
40494
41195
  ...layerProps
40495
41196
  } = props;
40496
- const context = React24.useContext(DismissableLayerContext);
40497
- const [node, setNode] = React24.useState(null);
41197
+ const context = React25.useContext(DismissableLayerContext);
41198
+ const [node, setNode] = React25.useState(null);
40498
41199
  const ownerDocument = node?.ownerDocument ?? globalThis?.document;
40499
- const [, force] = React24.useState({});
41200
+ const [, force] = React25.useState({});
40500
41201
  const composedRefs = useComposedRefs(forwardedRef, setNode);
40501
41202
  const layers = Array.from(context.layers);
40502
41203
  const [highestLayerWithOutsidePointerEventsDisabled] = [
@@ -40506,7 +41207,7 @@ var DismissableLayer = React24.forwardRef(
40506
41207
  const index2 = node ? layers.indexOf(node) : -1;
40507
41208
  const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
40508
41209
  const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
40509
- const isDeferredPointerDownOutsideRef = React24.useRef(false);
41210
+ const isDeferredPointerDownOutsideRef = React25.useRef(false);
40510
41211
  const pointerDownOutside = usePointerDownOutside(
40511
41212
  (event) => {
40512
41213
  onPointerDownOutside?.(event);
@@ -40518,7 +41219,7 @@ var DismissableLayer = React24.forwardRef(
40518
41219
  deferPointerDownOutside,
40519
41220
  isDeferredPointerDownOutsideRef,
40520
41221
  dismissableSurfaces: context.dismissableSurfaces,
40521
- shouldHandlePointerDownOutside: React24.useCallback(
41222
+ shouldHandlePointerDownOutside: React25.useCallback(
40522
41223
  (target) => {
40523
41224
  if (!(target instanceof Node)) {
40524
41225
  return false;
@@ -40554,14 +41255,14 @@ var DismissableLayer = React24.forwardRef(
40554
41255
  onDismiss();
40555
41256
  }
40556
41257
  });
40557
- React24.useEffect(() => {
41258
+ React25.useEffect(() => {
40558
41259
  if (!isHighestLayer) {
40559
41260
  return;
40560
41261
  }
40561
41262
  ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
40562
41263
  return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
40563
41264
  }, [ownerDocument, isHighestLayer, handleKeyDown]);
40564
- React24.useEffect(() => {
41265
+ React25.useEffect(() => {
40565
41266
  if (!node) return;
40566
41267
  if (disableOutsidePointerEvents) {
40567
41268
  if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
@@ -40581,7 +41282,7 @@ var DismissableLayer = React24.forwardRef(
40581
41282
  }
40582
41283
  };
40583
41284
  }, [node, ownerDocument, disableOutsidePointerEvents, context]);
40584
- React24.useEffect(() => {
41285
+ React25.useEffect(() => {
40585
41286
  return () => {
40586
41287
  if (!node) return;
40587
41288
  context.layers.delete(node);
@@ -40589,12 +41290,12 @@ var DismissableLayer = React24.forwardRef(
40589
41290
  dispatchUpdate();
40590
41291
  };
40591
41292
  }, [node, context]);
40592
- React24.useEffect(() => {
40593
- const handleUpdate = () => force({});
41293
+ React25.useEffect(() => {
41294
+ const handleUpdate = /* @__PURE__ */ __name11(() => force({}), "handleUpdate");
40594
41295
  document.addEventListener(CONTEXT_UPDATE, handleUpdate);
40595
41296
  return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
40596
41297
  }, []);
40597
- return /* @__PURE__ */ jsx26(
41298
+ return /* @__PURE__ */ jsx27(
40598
41299
  Primitive.div,
40599
41300
  {
40600
41301
  ...layerProps,
@@ -40611,27 +41312,24 @@ var DismissableLayer = React24.forwardRef(
40611
41312
  )
40612
41313
  }
40613
41314
  );
40614
- }
41315
+ }, "DismissableLayer")
40615
41316
  );
40616
- DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
40617
- var BRANCH_NAME = "DismissableLayerBranch";
40618
- var DismissableLayerBranch = React24.forwardRef((props, forwardedRef) => {
40619
- const context = React24.useContext(DismissableLayerContext);
40620
- const ref = React24.useRef(null);
40621
- const composedRefs = useComposedRefs(forwardedRef, ref);
40622
- React24.useEffect(() => {
40623
- const node = ref.current;
40624
- if (node) {
40625
- context.branches.add(node);
40626
- return () => {
40627
- context.branches.delete(node);
40628
- };
41317
+ function useDismissableLayerSurface() {
41318
+ const context = React25.useContext(DismissableLayerContext);
41319
+ const [node, setNode] = React25.useState(null);
41320
+ React25.useEffect(() => {
41321
+ if (!node) {
41322
+ return;
40629
41323
  }
40630
- }, [context.branches]);
40631
- return /* @__PURE__ */ jsx26(Primitive.div, { ...props, ref: composedRefs });
40632
- });
40633
- DismissableLayerBranch.displayName = BRANCH_NAME;
40634
- var IS_TRUE = () => true;
41324
+ context.dismissableSurfaces.add(node);
41325
+ return () => {
41326
+ context.dismissableSurfaces.delete(node);
41327
+ };
41328
+ }, [node, context.dismissableSurfaces]);
41329
+ return setNode;
41330
+ }
41331
+ __name11(useDismissableLayerSurface, "useDismissableLayerSurface");
41332
+ var IS_TRUE = /* @__PURE__ */ __name11(() => true, "IS_TRUE");
40635
41333
  function usePointerDownOutside(onPointerDownOutside, args) {
40636
41334
  const {
40637
41335
  ownerDocument = globalThis?.document,
@@ -40641,20 +41339,22 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40641
41339
  shouldHandlePointerDownOutside = IS_TRUE
40642
41340
  } = args;
40643
41341
  const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
40644
- const isPointerInsideReactTreeRef = React24.useRef(false);
40645
- const isPointerDownOutsideRef = React24.useRef(false);
40646
- const interceptedOutsideInteractionEventsRef = React24.useRef(/* @__PURE__ */ new Map());
40647
- const handleClickRef = React24.useRef(() => {
41342
+ const isPointerInsideReactTreeRef = React25.useRef(false);
41343
+ const isPointerDownOutsideRef = React25.useRef(false);
41344
+ const interceptedOutsideInteractionEventsRef = React25.useRef(/* @__PURE__ */ new Map());
41345
+ const handleClickRef = React25.useRef(() => {
40648
41346
  });
40649
- React24.useEffect(() => {
41347
+ React25.useEffect(() => {
40650
41348
  function resetOutsideInteraction() {
40651
41349
  isPointerDownOutsideRef.current = false;
40652
41350
  isDeferredPointerDownOutsideRef.current = false;
40653
41351
  interceptedOutsideInteractionEventsRef.current.clear();
40654
41352
  }
41353
+ __name11(resetOutsideInteraction, "resetOutsideInteraction");
40655
41354
  function isOutsideInteractionIntercepted() {
40656
41355
  return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);
40657
41356
  }
41357
+ __name11(isOutsideInteractionIntercepted, "isOutsideInteractionIntercepted");
40658
41358
  function handleInteractionCapture(event) {
40659
41359
  if (!isPointerDownOutsideRef.current) {
40660
41360
  return;
@@ -40672,12 +41372,14 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40672
41372
  }, 0);
40673
41373
  }
40674
41374
  }
41375
+ __name11(handleInteractionCapture, "handleInteractionCapture");
40675
41376
  function handleInteractionBubble(event) {
40676
41377
  if (isPointerDownOutsideRef.current) {
40677
41378
  interceptedOutsideInteractionEventsRef.current.set(event.type, false);
40678
41379
  }
40679
41380
  }
40680
- const handlePointerDown = (event) => {
41381
+ __name11(handleInteractionBubble, "handleInteractionBubble");
41382
+ const handlePointerDown = /* @__PURE__ */ __name11((event) => {
40681
41383
  if (event.target && !isPointerInsideReactTreeRef.current) {
40682
41384
  let handleAndDispatchPointerDownOutsideEvent2 = function() {
40683
41385
  ownerDocument.removeEventListener("click", handleClickRef.current);
@@ -40693,6 +41395,7 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40693
41395
  }
40694
41396
  };
40695
41397
  var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
41398
+ __name11(handleAndDispatchPointerDownOutsideEvent2, "handleAndDispatchPointerDownOutsideEvent");
40696
41399
  if (!shouldHandlePointerDownOutside(event.target)) {
40697
41400
  ownerDocument.removeEventListener("click", handleClickRef.current);
40698
41401
  resetOutsideInteraction();
@@ -40715,7 +41418,7 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40715
41418
  resetOutsideInteraction();
40716
41419
  }
40717
41420
  isPointerInsideReactTreeRef.current = false;
40718
- };
41421
+ }, "handlePointerDown");
40719
41422
  const outsideInteractionEvents = [
40720
41423
  "pointerup",
40721
41424
  "mousedown",
@@ -40750,33 +41453,36 @@ function usePointerDownOutside(onPointerDownOutside, args) {
40750
41453
  ]);
40751
41454
  return {
40752
41455
  // ensures we check React component tree (not just DOM tree)
40753
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
41456
+ onPointerDownCapture: /* @__PURE__ */ __name11(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture")
40754
41457
  };
40755
41458
  }
41459
+ __name11(usePointerDownOutside, "usePointerDownOutside");
40756
41460
  function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
40757
41461
  const handleFocusOutside = useCallbackRef(onFocusOutside);
40758
- const isFocusInsideReactTreeRef = React24.useRef(false);
40759
- React24.useEffect(() => {
40760
- const handleFocus = (event) => {
41462
+ const isFocusInsideReactTreeRef = React25.useRef(false);
41463
+ React25.useEffect(() => {
41464
+ const handleFocus = /* @__PURE__ */ __name11((event) => {
40761
41465
  if (event.target && !isFocusInsideReactTreeRef.current) {
40762
41466
  const eventDetail = { originalEvent: event };
40763
41467
  handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
40764
41468
  discrete: false
40765
41469
  });
40766
41470
  }
40767
- };
41471
+ }, "handleFocus");
40768
41472
  ownerDocument.addEventListener("focusin", handleFocus);
40769
41473
  return () => ownerDocument.removeEventListener("focusin", handleFocus);
40770
41474
  }, [ownerDocument, handleFocusOutside]);
40771
41475
  return {
40772
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
40773
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
41476
+ onFocusCapture: /* @__PURE__ */ __name11(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
41477
+ onBlurCapture: /* @__PURE__ */ __name11(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
40774
41478
  };
40775
41479
  }
41480
+ __name11(useFocusOutside, "useFocusOutside");
40776
41481
  function dispatchUpdate() {
40777
41482
  const event = new CustomEvent(CONTEXT_UPDATE);
40778
41483
  document.dispatchEvent(event);
40779
41484
  }
41485
+ __name11(dispatchUpdate, "dispatchUpdate");
40780
41486
  function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
40781
41487
  const target = detail.originalEvent.target;
40782
41488
  const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
@@ -40787,13 +41493,21 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
40787
41493
  target.dispatchEvent(event);
40788
41494
  }
40789
41495
  }
41496
+ __name11(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
40790
41497
 
40791
41498
  // node_modules/@radix-ui/react-focus-guards/dist/index.mjs
40792
- import * as React25 from "react";
41499
+ import * as React26 from "react";
41500
+ var __defProp14 = Object.defineProperty;
41501
+ var __name12 = (target, value) => __defProp14(target, "name", { value, configurable: true });
40793
41502
  var count = 0;
40794
41503
  var guards = null;
41504
+ function FocusGuards(props) {
41505
+ useFocusGuards();
41506
+ return props.children;
41507
+ }
41508
+ __name12(FocusGuards, "FocusGuards");
40795
41509
  function useFocusGuards() {
40796
- React25.useEffect(() => {
41510
+ React26.useEffect(() => {
40797
41511
  if (!guards) {
40798
41512
  guards = { start: createFocusGuard(), end: createFocusGuard() };
40799
41513
  }
@@ -40815,6 +41529,7 @@ function useFocusGuards() {
40815
41529
  };
40816
41530
  }, []);
40817
41531
  }
41532
+ __name12(useFocusGuards, "useFocusGuards");
40818
41533
  function createFocusGuard() {
40819
41534
  const element = document.createElement("span");
40820
41535
  element.setAttribute("data-radix-focus-guard", "");
@@ -40825,131 +41540,173 @@ function createFocusGuard() {
40825
41540
  element.style.pointerEvents = "none";
40826
41541
  return element;
40827
41542
  }
41543
+ __name12(createFocusGuard, "createFocusGuard");
40828
41544
 
40829
41545
  // node_modules/@radix-ui/react-focus-scope/dist/index.mjs
40830
- import * as React26 from "react";
40831
- import { jsx as jsx27 } from "react/jsx-runtime";
41546
+ import * as React27 from "react";
41547
+ import { jsx as jsx28 } from "react/jsx-runtime";
41548
+ var __defProp15 = Object.defineProperty;
41549
+ var __name13 = (target, value) => __defProp15(target, "name", { value, configurable: true });
40832
41550
  var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
40833
41551
  var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
40834
41552
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
40835
- var FOCUS_SCOPE_NAME = "FocusScope";
40836
- var FocusScope = React26.forwardRef((props, forwardedRef) => {
40837
- const {
40838
- loop = false,
40839
- trapped = false,
40840
- onMountAutoFocus: onMountAutoFocusProp,
40841
- onUnmountAutoFocus: onUnmountAutoFocusProp,
40842
- ...scopeProps
40843
- } = props;
40844
- const [container, setContainer] = React26.useState(null);
40845
- const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
40846
- const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
40847
- const lastFocusedElementRef = React26.useRef(null);
40848
- const composedRefs = useComposedRefs(forwardedRef, setContainer);
40849
- const focusScope = React26.useRef({
40850
- paused: false,
40851
- pause() {
40852
- this.paused = true;
40853
- },
40854
- resume() {
40855
- this.paused = false;
40856
- }
40857
- }).current;
40858
- React26.useEffect(() => {
40859
- if (trapped) {
40860
- let handleFocusIn2 = function(event) {
40861
- if (focusScope.paused || !container) return;
40862
- const target = event.target;
40863
- if (container.contains(target)) {
40864
- lastFocusedElementRef.current = target;
40865
- } else {
40866
- focus(lastFocusedElementRef.current, { select: true });
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);
41553
+ var FocusScope = /* @__PURE__ */ React27.forwardRef(
41554
+ /* @__PURE__ */ __name13(function FocusScope2(props, forwardedRef) {
41555
+ const {
41556
+ loop = false,
41557
+ trapped = false,
41558
+ branches,
41559
+ onMountAutoFocus: onMountAutoFocusProp,
41560
+ onUnmountAutoFocus: onUnmountAutoFocusProp,
41561
+ ...scopeProps
41562
+ } = props;
41563
+ const [container, setContainer] = React27.useState(null);
41564
+ const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
41565
+ const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
41566
+ const lastFocusedElementRef = React27.useRef(null);
41567
+ const composedRefs = useComposedRefs(forwardedRef, setContainer);
41568
+ const branchesRef = React27.useRef(branches);
41569
+ React27.useEffect(() => {
41570
+ branchesRef.current = branches;
41571
+ });
41572
+ const isTargetInScope = React27.useCallback(
41573
+ (target) => {
41574
+ if (!target) return false;
41575
+ if (container?.contains(target)) return true;
41576
+ return Boolean(branchesRef.current?.some((branch) => branch.contains(target)));
41577
+ },
41578
+ [container]
41579
+ );
41580
+ const focusScope = React27.useRef({
41581
+ paused: false,
41582
+ pause() {
41583
+ this.paused = true;
41584
+ },
41585
+ resume() {
41586
+ this.paused = false;
41587
+ }
41588
+ }).current;
41589
+ React27.useEffect(() => {
41590
+ if (trapped) {
41591
+ let handleFocusIn2 = function(event) {
41592
+ if (focusScope.paused || !container) return;
41593
+ const target = event.target;
41594
+ if (isTargetInScope(target)) {
41595
+ lastFocusedElementRef.current = target;
41596
+ } else {
41597
+ focus(lastFocusedElementRef.current, { select: true });
40907
41598
  }
40908
- }
40909
- }
40910
- return () => {
40911
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
40912
- setTimeout(() => {
40913
- const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
40914
- container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
40915
- container.dispatchEvent(unmountEvent);
40916
- if (!unmountEvent.defaultPrevented) {
40917
- focus(previouslyFocusedElement ?? document.body, { select: true });
41599
+ }, handleFocusOut2 = function(event) {
41600
+ if (focusScope.paused || !container) return;
41601
+ const relatedTarget = event.relatedTarget;
41602
+ if (relatedTarget === null) return;
41603
+ if (!isTargetInScope(relatedTarget)) {
41604
+ focus(lastFocusedElementRef.current, { select: true });
40918
41605
  }
40919
- container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
40920
- focusScopesStack.remove(focusScope);
40921
- }, 0);
40922
- };
40923
- }
40924
- }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
40925
- const handleKeyDown = React26.useCallback(
40926
- (event) => {
40927
- if (!loop && !trapped) return;
40928
- if (focusScope.paused) return;
40929
- const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
40930
- const focusedElement = document.activeElement;
40931
- if (isTabKey && focusedElement) {
40932
- const container2 = event.currentTarget;
40933
- const [first, last] = getTabbableEdges(container2);
40934
- const hasTabbableElementsInside = first && last;
40935
- if (!hasTabbableElementsInside) {
40936
- if (focusedElement === container2) event.preventDefault();
40937
- } else {
40938
- if (!event.shiftKey && focusedElement === last) {
40939
- event.preventDefault();
40940
- if (loop) focus(first, { select: true });
40941
- } else if (event.shiftKey && focusedElement === first) {
40942
- event.preventDefault();
40943
- if (loop) focus(last, { select: true });
41606
+ }, handleMutations2 = function(mutations) {
41607
+ const focusedElement = document.activeElement;
41608
+ if (focusedElement !== document.body) return;
41609
+ for (const mutation of mutations) {
41610
+ if (mutation.removedNodes.length > 0) focus(container);
41611
+ }
41612
+ };
41613
+ var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;
41614
+ __name13(handleFocusIn2, "handleFocusIn");
41615
+ __name13(handleFocusOut2, "handleFocusOut");
41616
+ __name13(handleMutations2, "handleMutations");
41617
+ document.addEventListener("focusin", handleFocusIn2);
41618
+ document.addEventListener("focusout", handleFocusOut2);
41619
+ const mutationObserver = new MutationObserver(handleMutations2);
41620
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
41621
+ return () => {
41622
+ document.removeEventListener("focusin", handleFocusIn2);
41623
+ document.removeEventListener("focusout", handleFocusOut2);
41624
+ mutationObserver.disconnect();
41625
+ };
41626
+ }
41627
+ }, [trapped, container, focusScope.paused, isTargetInScope]);
41628
+ React27.useEffect(() => {
41629
+ if (container) {
41630
+ focusScopesStack.add(focusScope);
41631
+ const previouslyFocusedElement = document.activeElement;
41632
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
41633
+ if (!hasFocusedCandidate) {
41634
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
41635
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
41636
+ container.dispatchEvent(mountEvent);
41637
+ if (!mountEvent.defaultPrevented) {
41638
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
41639
+ if (document.activeElement === previouslyFocusedElement) {
41640
+ focus(container);
41641
+ }
40944
41642
  }
40945
41643
  }
41644
+ return () => {
41645
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
41646
+ setTimeout(() => {
41647
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
41648
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
41649
+ container.dispatchEvent(unmountEvent);
41650
+ if (!unmountEvent.defaultPrevented) {
41651
+ focus(previouslyFocusedElement ?? document.body, { select: true });
41652
+ }
41653
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
41654
+ focusScopesStack.remove(focusScope);
41655
+ }, 0);
41656
+ };
40946
41657
  }
40947
- },
40948
- [loop, trapped, focusScope.paused]
41658
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
41659
+ const handleKeyDown = React27.useCallback(
41660
+ (event) => {
41661
+ if (!loop && !trapped) return;
41662
+ if (focusScope.paused) return;
41663
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
41664
+ const focusedElement = document.activeElement;
41665
+ if (isTabKey && focusedElement) {
41666
+ const container2 = event.currentTarget;
41667
+ const [first, last] = getTabbableEdges(container2);
41668
+ const hasTabbableElementsInside = first && last;
41669
+ if (!hasTabbableElementsInside) {
41670
+ if (focusedElement === container2) event.preventDefault();
41671
+ } else {
41672
+ if (!event.shiftKey && focusedElement === last) {
41673
+ event.preventDefault();
41674
+ if (loop) focus(first, { select: true });
41675
+ } else if (event.shiftKey && focusedElement === first) {
41676
+ event.preventDefault();
41677
+ if (loop) focus(last, { select: true });
41678
+ }
41679
+ }
41680
+ }
41681
+ },
41682
+ [loop, trapped, focusScope.paused]
41683
+ );
41684
+ return /* @__PURE__ */ jsx28(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
41685
+ }, "FocusScope")
41686
+ );
41687
+ var FocusScopeBranchContext = React27.createContext(null);
41688
+ var FocusScopeBranchProvider = FocusScopeBranchContext.Provider;
41689
+ function useFocusScopeBranchRegistry() {
41690
+ const [nodes, setNodes] = React27.useState([]);
41691
+ const registry = React27.useMemo(
41692
+ () => ({
41693
+ add: /* @__PURE__ */ __name13((node) => setNodes((prev) => prev.includes(node) ? prev : [...prev, node]), "add"),
41694
+ remove: /* @__PURE__ */ __name13((node) => setNodes((prev) => prev.filter((current) => current !== node)), "remove")
41695
+ }),
41696
+ []
40949
41697
  );
40950
- return /* @__PURE__ */ jsx27(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
40951
- });
40952
- FocusScope.displayName = FOCUS_SCOPE_NAME;
41698
+ return { nodes, registry };
41699
+ }
41700
+ __name13(useFocusScopeBranchRegistry, "useFocusScopeBranchRegistry");
41701
+ function useFocusScopeBranch(node) {
41702
+ const registry = React27.useContext(FocusScopeBranchContext);
41703
+ React27.useEffect(() => {
41704
+ if (!node || !registry) return;
41705
+ registry.add(node);
41706
+ return () => registry.remove(node);
41707
+ }, [node, registry]);
41708
+ }
41709
+ __name13(useFocusScopeBranch, "useFocusScopeBranch");
40953
41710
  function focusFirst(candidates, { select = false } = {}) {
40954
41711
  const previouslyFocusedElement = document.activeElement;
40955
41712
  for (const candidate of candidates) {
@@ -40957,24 +41714,27 @@ function focusFirst(candidates, { select = false } = {}) {
40957
41714
  if (document.activeElement !== previouslyFocusedElement) return;
40958
41715
  }
40959
41716
  }
41717
+ __name13(focusFirst, "focusFirst");
40960
41718
  function getTabbableEdges(container) {
40961
41719
  const candidates = getTabbableCandidates(container);
40962
41720
  const first = findVisible(candidates, container);
40963
41721
  const last = findVisible(candidates.reverse(), container);
40964
41722
  return [first, last];
40965
41723
  }
41724
+ __name13(getTabbableEdges, "getTabbableEdges");
40966
41725
  function getTabbableCandidates(container) {
40967
41726
  const nodes = [];
40968
41727
  const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
40969
- acceptNode: (node) => {
41728
+ acceptNode: /* @__PURE__ */ __name13((node) => {
40970
41729
  const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
40971
41730
  if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
40972
41731
  return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
40973
- }
41732
+ }, "acceptNode")
40974
41733
  });
40975
41734
  while (walker.nextNode()) nodes.push(walker.currentNode);
40976
41735
  return nodes;
40977
41736
  }
41737
+ __name13(getTabbableCandidates, "getTabbableCandidates");
40978
41738
  function findVisible(elements, container) {
40979
41739
  const canUseCheckVisibility = typeof container.checkVisibility === "function" && container.checkVisibility({ checkVisibilityCSS: true });
40980
41740
  for (const element of elements) {
@@ -40984,6 +41744,7 @@ function findVisible(elements, container) {
40984
41744
  }
40985
41745
  }
40986
41746
  }
41747
+ __name13(findVisible, "findVisible");
40987
41748
  function isHidden(node, { upTo }) {
40988
41749
  if (getComputedStyle(node).visibility === "hidden") return true;
40989
41750
  while (node) {
@@ -40993,9 +41754,11 @@ function isHidden(node, { upTo }) {
40993
41754
  }
40994
41755
  return false;
40995
41756
  }
41757
+ __name13(isHidden, "isHidden");
40996
41758
  function isSelectableInput(element) {
40997
41759
  return element instanceof HTMLInputElement && "select" in element;
40998
41760
  }
41761
+ __name13(isSelectableInput, "isSelectableInput");
40999
41762
  function focus(element, { select = false } = {}) {
41000
41763
  if (element && element.focus) {
41001
41764
  const previouslyFocusedElement = document.activeElement;
@@ -41004,6 +41767,7 @@ function focus(element, { select = false } = {}) {
41004
41767
  element.select();
41005
41768
  }
41006
41769
  }
41770
+ __name13(focus, "focus");
41007
41771
  var focusScopesStack = createFocusScopesStack();
41008
41772
  function createFocusScopesStack() {
41009
41773
  let stack = [];
@@ -41022,6 +41786,7 @@ function createFocusScopesStack() {
41022
41786
  }
41023
41787
  };
41024
41788
  }
41789
+ __name13(createFocusScopesStack, "createFocusScopesStack");
41025
41790
  function arrayRemove(array, item) {
41026
41791
  const updatedArray = [...array];
41027
41792
  const index2 = updatedArray.indexOf(item);
@@ -41030,21 +41795,26 @@ function arrayRemove(array, item) {
41030
41795
  }
41031
41796
  return updatedArray;
41032
41797
  }
41798
+ __name13(arrayRemove, "arrayRemove");
41033
41799
  function removeLinks(items) {
41034
41800
  return items.filter((item) => item.tagName !== "A");
41035
41801
  }
41802
+ __name13(removeLinks, "removeLinks");
41036
41803
 
41037
41804
  // node_modules/@radix-ui/react-id/dist/index.mjs
41038
- import * as React27 from "react";
41039
- var useReactId = React27[" useId ".trim().toString()] || (() => void 0);
41805
+ import * as React28 from "react";
41806
+ var __defProp16 = Object.defineProperty;
41807
+ var __name14 = (target, value) => __defProp16(target, "name", { value, configurable: true });
41808
+ var useReactId = React28[" useId ".trim().toString()] || (() => void 0);
41040
41809
  var count2 = 0;
41041
41810
  function useId(deterministicId) {
41042
- const [id, setId] = React27.useState(useReactId());
41811
+ const [id, setId] = React28.useState(useReactId());
41043
41812
  useLayoutEffect2(() => {
41044
41813
  if (!deterministicId) setId((reactId) => reactId ?? String(count2++));
41045
41814
  }, [deterministicId]);
41046
41815
  return deterministicId || (id ? `radix-${id}` : "");
41047
41816
  }
41817
+ __name14(useId, "useId");
41048
41818
 
41049
41819
  // node_modules/@radix-ui/react-popper/dist/index.mjs
41050
41820
  import * as React31 from "react";
@@ -41143,12 +41913,12 @@ function getOppositePlacement(placement) {
41143
41913
  return oppositeSideMap[side] + placement.slice(side.length);
41144
41914
  }
41145
41915
  function expandPaddingObject(padding) {
41916
+ var _padding$top, _padding$right, _padding$bottom, _padding$left;
41146
41917
  return {
41147
- top: 0,
41148
- right: 0,
41149
- bottom: 0,
41150
- left: 0,
41151
- ...padding
41918
+ top: (_padding$top = padding.top) != null ? _padding$top : 0,
41919
+ right: (_padding$right = padding.right) != null ? _padding$right : 0,
41920
+ bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
41921
+ left: (_padding$left = padding.left) != null ? _padding$left : 0
41152
41922
  };
41153
41923
  }
41154
41924
  function getPaddingObject(padding) {
@@ -41224,13 +41994,9 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
41224
41994
  y: reference.y
41225
41995
  };
41226
41996
  }
41227
- switch (getAlignment(placement)) {
41228
- case "start":
41229
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
41230
- break;
41231
- case "end":
41232
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
41233
- break;
41997
+ const alignment = getAlignment(placement);
41998
+ if (alignment) {
41999
+ coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
41234
42000
  }
41235
42001
  return coords;
41236
42002
  }
@@ -41270,10 +42036,7 @@ async function detectOverflow(state, options) {
41270
42036
  height: rects.floating.height
41271
42037
  } : rects.reference;
41272
42038
  const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
41273
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
41274
- x: 1,
41275
- y: 1
41276
- } : {
42039
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) && await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
41277
42040
  x: 1,
41278
42041
  y: 1
41279
42042
  };
@@ -41421,12 +42184,11 @@ var arrow = (options) => ({
41421
42184
  const largestPossiblePadding = clientSize / 2 - arrowDimensions[length64] / 2 - 1;
41422
42185
  const minPadding = min(paddingObject[minProp], largestPossiblePadding);
41423
42186
  const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
41424
- const min$1 = minPadding;
41425
42187
  const max2 = clientSize - arrowDimensions[length64] - maxPadding;
41426
42188
  const center = clientSize / 2 - arrowDimensions[length64] / 2 + centerToReference;
41427
- const offset4 = clamp2(min$1, center, max2);
41428
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length64] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length64] / 2 < 0;
41429
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
42189
+ const offset4 = clamp2(minPadding, center, max2);
42190
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length64] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length64] / 2 < 0;
42191
+ const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max2 : 0;
41430
42192
  return {
41431
42193
  [axis]: coords[axis] + alignmentOffset,
41432
42194
  data: {
@@ -41714,23 +42476,16 @@ var shift = function(options) {
41714
42476
  y
41715
42477
  };
41716
42478
  const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
41717
- const crossAxis = getSideAxis(getSide(placement));
42479
+ const crossAxis = getSideAxis(placement);
41718
42480
  const mainAxis = getOppositeAxis(crossAxis);
41719
42481
  let mainAxisCoord = coords[mainAxis];
41720
42482
  let crossAxisCoord = coords[crossAxis];
42483
+ const clampCoord = (axis, coord) => clamp2(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
41721
42484
  if (checkMainAxis) {
41722
- const minSide = mainAxis === "y" ? "top" : "left";
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);
42485
+ mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
41727
42486
  }
41728
42487
  if (checkCrossAxis) {
41729
- const minSide = crossAxis === "y" ? "top" : "left";
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);
42488
+ crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
41734
42489
  }
41735
42490
  const limitedCoords = limiter.fn({
41736
42491
  ...state,
@@ -41758,6 +42513,7 @@ var limitShift = function(options) {
41758
42513
  return {
41759
42514
  options,
41760
42515
  fn(state) {
42516
+ var _rawOffset$mainAxis, _rawOffset$crossAxis;
41761
42517
  const {
41762
42518
  x,
41763
42519
  y,
@@ -41783,9 +42539,8 @@ var limitShift = function(options) {
41783
42539
  mainAxis: rawOffset,
41784
42540
  crossAxis: 0
41785
42541
  } : {
41786
- mainAxis: 0,
41787
- crossAxis: 0,
41788
- ...rawOffset
42542
+ mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
42543
+ crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
41789
42544
  };
41790
42545
  if (checkMainAxis) {
41791
42546
  const len = mainAxis === "y" ? "height" : "width";
@@ -41824,7 +42579,6 @@ var size = function(options) {
41824
42579
  name: "size",
41825
42580
  options,
41826
42581
  async fn(state) {
41827
- var _state$middlewareData, _state$middlewareData2;
41828
42582
  const {
41829
42583
  placement,
41830
42584
  rects,
@@ -41857,24 +42611,21 @@ var size = function(options) {
41857
42611
  const maximumClippingWidth = width10 - overflow.left - overflow.right;
41858
42612
  const overflowAvailableHeight = min(height10 - overflow[heightSide], maximumClippingHeight);
41859
42613
  const overflowAvailableWidth = min(width10 - overflow[widthSide], maximumClippingWidth);
41860
- const noShift = !state.middlewareData.shift;
42614
+ const shiftData = state.middlewareData.shift;
42615
+ const noShift = !shiftData;
41861
42616
  let availableHeight = overflowAvailableHeight;
41862
42617
  let availableWidth = overflowAvailableWidth;
41863
- if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
42618
+ if (shiftData != null && shiftData.enabled.x) {
41864
42619
  availableWidth = maximumClippingWidth;
41865
42620
  }
41866
- if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
42621
+ if (shiftData != null && shiftData.enabled.y) {
41867
42622
  availableHeight = maximumClippingHeight;
41868
42623
  }
41869
42624
  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
42625
  if (isYAxis) {
41875
- availableWidth = width10 - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
42626
+ availableWidth = width10 - 2 * max(overflow.left, overflow.right);
41876
42627
  } else {
41877
- availableHeight = height10 - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
42628
+ availableHeight = height10 - 2 * max(overflow.top, overflow.bottom);
41878
42629
  }
41879
42630
  }
41880
42631
  await apply({
@@ -42022,7 +42773,7 @@ function getParentNode(node) {
42022
42773
  function getNearestOverflowAncestor(node) {
42023
42774
  const parentNode = getParentNode(node);
42024
42775
  if (isLastTraversableNode(parentNode)) {
42025
- return node.ownerDocument ? node.ownerDocument.body : node.body;
42776
+ return (node.ownerDocument || node).body;
42026
42777
  }
42027
42778
  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
42028
42779
  return parentNode;
@@ -42112,10 +42863,7 @@ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
42112
42863
  if (isFixed === void 0) {
42113
42864
  isFixed = false;
42114
42865
  }
42115
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
42116
- return false;
42117
- }
42118
- return isFixed;
42866
+ return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
42119
42867
  }
42120
42868
  function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
42121
42869
  if (includeScale === void 0) {
@@ -42141,12 +42889,12 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
42141
42889
  let y = (clientRect.top + visualOffsets.y) / scale2.y;
42142
42890
  let width10 = clientRect.width / scale2.x;
42143
42891
  let height10 = clientRect.height / scale2.y;
42144
- if (domElement) {
42892
+ if (domElement && offsetParent) {
42145
42893
  const win = getWindow(domElement);
42146
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
42894
+ const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
42147
42895
  let currentWin = win;
42148
42896
  let currentIFrame = getFrameElement(currentWin);
42149
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
42897
+ while (currentIFrame && offsetWin !== currentWin) {
42150
42898
  const iframeScale = getScale(currentIFrame);
42151
42899
  const iframeRect = currentIFrame.getBoundingClientRect();
42152
42900
  const css = getComputedStyle2(currentIFrame);
@@ -42205,7 +42953,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
42205
42953
  let scale2 = createCoords(1);
42206
42954
  const offsets = createCoords(0);
42207
42955
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
42208
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
42956
+ if (isOffsetParentAnElement || !isFixed) {
42209
42957
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
42210
42958
  scroll = getNodeScroll(offsetParent);
42211
42959
  }
@@ -42225,15 +42973,14 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
42225
42973
  };
42226
42974
  }
42227
42975
  function getClientRects(element) {
42228
- return Array.from(element.getClientRects());
42976
+ return element.getClientRects ? Array.from(element.getClientRects()) : [];
42229
42977
  }
42230
- function getDocumentRect(element) {
42231
- const html = getDocumentElement(element);
42232
- const scroll = getNodeScroll(element);
42233
- const body = element.ownerDocument.body;
42978
+ function getDocumentRect(html) {
42979
+ const scroll = getNodeScroll(html);
42980
+ const body = html.ownerDocument.body;
42234
42981
  const width10 = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
42235
42982
  const height10 = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
42236
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
42983
+ let x = -scroll.scrollLeft + getWindowScrollBarX(html);
42237
42984
  const y = -scroll.scrollTop;
42238
42985
  if (getComputedStyle2(body).direction === "rtl") {
42239
42986
  x += max(html.clientWidth, body.clientWidth) - width10;
@@ -42246,7 +42993,11 @@ function getDocumentRect(element) {
42246
42993
  };
42247
42994
  }
42248
42995
  var SCROLLBAR_MAX = 25;
42249
- function getViewportRect(element, strategy) {
42996
+ function getViewportRect(element, strategy, rootBoundary) {
42997
+ if (rootBoundary === void 0) {
42998
+ rootBoundary = "viewport";
42999
+ }
43000
+ const isLayoutViewport = rootBoundary === "layoutViewport";
42250
43001
  const win = getWindow(element);
42251
43002
  const html = getDocumentElement(element);
42252
43003
  const visualViewport = win.visualViewport;
@@ -42255,12 +43006,19 @@ function getViewportRect(element, strategy) {
42255
43006
  let x = 0;
42256
43007
  let y = 0;
42257
43008
  if (visualViewport) {
42258
- width10 = visualViewport.width;
42259
- height10 = visualViewport.height;
42260
- const visualViewportBased = isWebKit();
42261
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
42262
- x = visualViewport.offsetLeft;
42263
- y = visualViewport.offsetTop;
43009
+ const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
43010
+ if (isLayoutViewport) {
43011
+ if (!layoutRelativeClientCoords) {
43012
+ x = -visualViewport.offsetLeft;
43013
+ y = -visualViewport.offsetTop;
43014
+ }
43015
+ } else {
43016
+ width10 = visualViewport.width;
43017
+ height10 = visualViewport.height;
43018
+ if (layoutRelativeClientCoords) {
43019
+ x = visualViewport.offsetLeft;
43020
+ y = visualViewport.offsetTop;
43021
+ }
42264
43022
  }
42265
43023
  }
42266
43024
  const windowScrollbarX = getWindowScrollBarX(html);
@@ -42269,12 +43027,11 @@ function getViewportRect(element, strategy) {
42269
43027
  const body = doc.body;
42270
43028
  const bodyStyles = getComputedStyle(body);
42271
43029
  const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
42272
- const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
42273
- if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
42274
- width10 -= clippingStableScrollbarWidth;
43030
+ const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
43031
+ const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
43032
+ if (gutter <= SCROLLBAR_MAX) {
43033
+ width10 -= gutter;
42275
43034
  }
42276
- } else if (windowScrollbarX <= SCROLLBAR_MAX) {
42277
- width10 += windowScrollbarX;
42278
43035
  }
42279
43036
  return {
42280
43037
  width: width10,
@@ -42287,7 +43044,7 @@ function getInnerBoundingClientRect(element, strategy) {
42287
43044
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
42288
43045
  const top = clientRect.top + element.clientTop;
42289
43046
  const left = clientRect.left + element.clientLeft;
42290
- const scale2 = isHTMLElement(element) ? getScale(element) : createCoords(1);
43047
+ const scale2 = getScale(element);
42291
43048
  const width10 = element.clientWidth * scale2.x;
42292
43049
  const height10 = element.clientHeight * scale2.y;
42293
43050
  const x = left * scale2.x;
@@ -42301,8 +43058,8 @@ function getInnerBoundingClientRect(element, strategy) {
42301
43058
  }
42302
43059
  function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
42303
43060
  let rect;
42304
- if (clippingAncestor === "viewport") {
42305
- rect = getViewportRect(element, strategy);
43061
+ if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
43062
+ rect = getViewportRect(element, strategy, clippingAncestor);
42306
43063
  } else if (clippingAncestor === "document") {
42307
43064
  rect = getDocumentRect(getDocumentElement(element));
42308
43065
  } else if (isElement(clippingAncestor)) {
@@ -42318,33 +43075,24 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
42318
43075
  }
42319
43076
  return rectToClientRect(rect);
42320
43077
  }
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
43078
  function getClippingElementAncestors(element, cache) {
42329
43079
  const cachedResult = cache.get(element);
42330
43080
  if (cachedResult) {
42331
43081
  return cachedResult;
42332
43082
  }
42333
43083
  let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
42334
- let currentContainingBlockComputedStyle = null;
43084
+ let lastKeptComputedStyle = null;
42335
43085
  const elementIsFixed = getComputedStyle2(element).position === "fixed";
42336
43086
  let currentNode = elementIsFixed ? getParentNode(element) : element;
42337
43087
  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
42338
43088
  const computedStyle = getComputedStyle2(currentNode);
42339
43089
  const currentNodeIsContaining = isContainingBlock(currentNode);
42340
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
42341
- currentContainingBlockComputedStyle = null;
42342
- }
42343
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
43090
+ const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
43091
+ const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
42344
43092
  if (shouldDropCurrentNode) {
42345
43093
  result = result.filter((ancestor) => ancestor !== currentNode);
42346
43094
  } else {
42347
- currentContainingBlockComputedStyle = computedStyle;
43095
+ lastKeptComputedStyle = computedStyle;
42348
43096
  }
42349
43097
  currentNode = getParentNode(currentNode);
42350
43098
  }
@@ -42399,10 +43147,7 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
42399
43147
  scrollTop: 0
42400
43148
  };
42401
43149
  const offsets = createCoords(0);
42402
- function setLeftRTLScrollbarOffset() {
42403
- offsets.x = getWindowScrollBarX(documentElement);
42404
- }
42405
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
43150
+ if (isOffsetParentAnElement || !isFixed) {
42406
43151
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
42407
43152
  scroll = getNodeScroll(offsetParent);
42408
43153
  }
@@ -42410,12 +43155,10 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
42410
43155
  const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
42411
43156
  offsets.x = offsetRect.x + offsetParent.clientLeft;
42412
43157
  offsets.y = offsetRect.y + offsetParent.clientTop;
42413
- } else if (documentElement) {
42414
- setLeftRTLScrollbarOffset();
42415
43158
  }
42416
43159
  }
42417
- if (isFixed && !isOffsetParentAnElement && documentElement) {
42418
- setLeftRTLScrollbarOffset();
43160
+ if (!isOffsetParentAnElement && documentElement) {
43161
+ offsets.x = getWindowScrollBarX(documentElement);
42419
43162
  }
42420
43163
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
42421
43164
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
@@ -42499,7 +43242,7 @@ var platform = {
42499
43242
  function rectsAreEqual(a, b) {
42500
43243
  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
42501
43244
  }
42502
- function observeMove(element, onMove) {
43245
+ function observeMove(element, onMove, ancestorResize) {
42503
43246
  let io = null;
42504
43247
  let timeoutId;
42505
43248
  const root = getDocumentElement(element);
@@ -42542,6 +43285,9 @@ function observeMove(element, onMove) {
42542
43285
  let isFirstUpdate = true;
42543
43286
  function handleObserve(entries) {
42544
43287
  const ratio = entries[0].intersectionRatio;
43288
+ if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
43289
+ return refresh();
43290
+ }
42545
43291
  if (ratio !== threshold) {
42546
43292
  if (!isFirstUpdate) {
42547
43293
  return refresh();
@@ -42554,9 +43300,6 @@ function observeMove(element, onMove) {
42554
43300
  refresh(false, ratio);
42555
43301
  }
42556
43302
  }
42557
- if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
42558
- refresh();
42559
- }
42560
43303
  isFirstUpdate = false;
42561
43304
  }
42562
43305
  try {
@@ -42570,8 +43313,14 @@ function observeMove(element, onMove) {
42570
43313
  }
42571
43314
  io.observe(element);
42572
43315
  }
43316
+ const win = getWindow(element);
43317
+ const handleResize = () => refresh(ancestorResize);
43318
+ win.addEventListener("resize", handleResize);
42573
43319
  refresh(true);
42574
- return cleanup;
43320
+ return () => {
43321
+ win.removeEventListener("resize", handleResize);
43322
+ cleanup();
43323
+ };
42575
43324
  }
42576
43325
  function autoUpdate(reference, floating, update, options) {
42577
43326
  if (options === void 0) {
@@ -42587,12 +43336,10 @@ function autoUpdate(reference, floating, update, options) {
42587
43336
  const referenceEl = unwrapElement(reference);
42588
43337
  const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
42589
43338
  ancestors.forEach((ancestor) => {
42590
- ancestorScroll && ancestor.addEventListener("scroll", update, {
42591
- passive: true
42592
- });
43339
+ ancestorScroll && ancestor.addEventListener("scroll", update);
42593
43340
  ancestorResize && ancestor.addEventListener("resize", update);
42594
43341
  });
42595
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
43342
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;
42596
43343
  let reobserveFrame = -1;
42597
43344
  let resizeObserver = null;
42598
43345
  if (elementResize) {
@@ -42652,11 +43399,9 @@ var arrow2 = arrow;
42652
43399
  var limitShift2 = limitShift;
42653
43400
  var computePosition2 = (reference, floating, options) => {
42654
43401
  const cache = /* @__PURE__ */ new Map();
42655
- const mergedOptions = {
42656
- platform,
42657
- ...options
42658
- };
43402
+ const mergedOptions = options != null ? options : {};
42659
43403
  const platformWithCache = {
43404
+ ...platform,
42660
43405
  ...mergedOptions.platform,
42661
43406
  _c: cache
42662
43407
  };
@@ -42667,7 +43412,7 @@ var computePosition2 = (reference, floating, options) => {
42667
43412
  };
42668
43413
 
42669
43414
  // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
42670
- import * as React28 from "react";
43415
+ import * as React29 from "react";
42671
43416
  import { useLayoutEffect as useLayoutEffect3 } from "react";
42672
43417
  import * as ReactDOM3 from "react-dom";
42673
43418
  var isClient = typeof document !== "undefined";
@@ -42733,7 +43478,7 @@ function roundByDPR(element, value) {
42733
43478
  return Math.round(value * dpr) / dpr;
42734
43479
  }
42735
43480
  function useLatestRef(value) {
42736
- const ref = React28.useRef(value);
43481
+ const ref = React29.useRef(value);
42737
43482
  index(() => {
42738
43483
  ref.current = value;
42739
43484
  });
@@ -42756,7 +43501,7 @@ function useFloating(options) {
42756
43501
  whileElementsMounted,
42757
43502
  open
42758
43503
  } = options;
42759
- const [data, setData] = React28.useState({
43504
+ const [data, setData] = React29.useState({
42760
43505
  x: 0,
42761
43506
  y: 0,
42762
43507
  strategy,
@@ -42764,19 +43509,19 @@ function useFloating(options) {
42764
43509
  middlewareData: {},
42765
43510
  isPositioned: false
42766
43511
  });
42767
- const [latestMiddleware, setLatestMiddleware] = React28.useState(middleware);
43512
+ const [latestMiddleware, setLatestMiddleware] = React29.useState(middleware);
42768
43513
  if (!deepEqual(latestMiddleware, middleware)) {
42769
43514
  setLatestMiddleware(middleware);
42770
43515
  }
42771
- const [_reference, _setReference] = React28.useState(null);
42772
- const [_floating, _setFloating] = React28.useState(null);
42773
- const setReference = React28.useCallback((node) => {
43516
+ const [_reference, _setReference] = React29.useState(null);
43517
+ const [_floating, _setFloating] = React29.useState(null);
43518
+ const setReference = React29.useCallback((node) => {
42774
43519
  if (node !== referenceRef.current) {
42775
43520
  referenceRef.current = node;
42776
43521
  _setReference(node);
42777
43522
  }
42778
43523
  }, []);
42779
- const setFloating = React28.useCallback((node) => {
43524
+ const setFloating = React29.useCallback((node) => {
42780
43525
  if (node !== floatingRef.current) {
42781
43526
  floatingRef.current = node;
42782
43527
  _setFloating(node);
@@ -42784,14 +43529,14 @@ function useFloating(options) {
42784
43529
  }, []);
42785
43530
  const referenceEl = externalReference || _reference;
42786
43531
  const floatingEl = externalFloating || _floating;
42787
- const referenceRef = React28.useRef(null);
42788
- const floatingRef = React28.useRef(null);
42789
- const dataRef = React28.useRef(data);
43532
+ const referenceRef = React29.useRef(null);
43533
+ const floatingRef = React29.useRef(null);
43534
+ const dataRef = React29.useRef(data);
42790
43535
  const hasWhileElementsMounted = whileElementsMounted != null;
42791
43536
  const whileElementsMountedRef = useLatestRef(whileElementsMounted);
42792
43537
  const platformRef = useLatestRef(platform2);
42793
43538
  const openRef = useLatestRef(open);
42794
- const update = React28.useCallback(() => {
43539
+ const update = React29.useCallback(() => {
42795
43540
  if (!referenceRef.current || !floatingRef.current) {
42796
43541
  return;
42797
43542
  }
@@ -42829,7 +43574,7 @@ function useFloating(options) {
42829
43574
  }));
42830
43575
  }
42831
43576
  }, [open]);
42832
- const isMountedRef = React28.useRef(false);
43577
+ const isMountedRef = React29.useRef(false);
42833
43578
  index(() => {
42834
43579
  isMountedRef.current = true;
42835
43580
  return () => {
@@ -42846,17 +43591,17 @@ function useFloating(options) {
42846
43591
  update();
42847
43592
  }
42848
43593
  }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
42849
- const refs = React28.useMemo(() => ({
43594
+ const refs = React29.useMemo(() => ({
42850
43595
  reference: referenceRef,
42851
43596
  floating: floatingRef,
42852
43597
  setReference,
42853
43598
  setFloating
42854
43599
  }), [setReference, setFloating]);
42855
- const elements = React28.useMemo(() => ({
43600
+ const elements = React29.useMemo(() => ({
42856
43601
  reference: referenceEl,
42857
43602
  floating: floatingEl
42858
43603
  }), [referenceEl, floatingEl]);
42859
- const floatingStyles = React28.useMemo(() => {
43604
+ const floatingStyles = React29.useMemo(() => {
42860
43605
  const initialStyles = {
42861
43606
  position: strategy,
42862
43607
  left: 0,
@@ -42882,7 +43627,7 @@ function useFloating(options) {
42882
43627
  top: y
42883
43628
  };
42884
43629
  }, [strategy, transform, elements.floating, data.x, data.y]);
42885
- return React28.useMemo(() => ({
43630
+ return React29.useMemo(() => ({
42886
43631
  ...data,
42887
43632
  update,
42888
43633
  refs,
@@ -42977,30 +43722,10 @@ var arrow3 = (options, deps) => {
42977
43722
  };
42978
43723
  };
42979
43724
 
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
43725
  // node_modules/@radix-ui/react-use-size/dist/index.mjs
43003
43726
  import * as React30 from "react";
43727
+ var __defProp17 = Object.defineProperty;
43728
+ var __name15 = (target, value) => __defProp17(target, "name", { value, configurable: true });
43004
43729
  function useSize(element) {
43005
43730
  const [size4, setSize] = React30.useState(void 0);
43006
43731
  useLayoutEffect2(() => {
@@ -43035,13 +43760,24 @@ function useSize(element) {
43035
43760
  }, [element]);
43036
43761
  return size4;
43037
43762
  }
43763
+ __name15(useSize, "useSize");
43038
43764
 
43039
43765
  // node_modules/@radix-ui/react-popper/dist/index.mjs
43040
43766
  import { jsx as jsx29 } from "react/jsx-runtime";
43767
+ var __defProp18 = Object.defineProperty;
43768
+ var __name16 = (target, value) => __defProp18(target, "name", { value, configurable: true });
43769
+ var Sticky = {
43770
+ Partial: "partial",
43771
+ Always: "always"
43772
+ };
43773
+ var UpdatePositionStrategy = {
43774
+ Optimized: "optimized",
43775
+ Always: "always"
43776
+ };
43041
43777
  var POPPER_NAME = "Popper";
43042
43778
  var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
43043
43779
  var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
43044
- var Popper = (props) => {
43780
+ var Popper = /* @__PURE__ */ __name16((props) => {
43045
43781
  const { __scopePopper, children } = props;
43046
43782
  const [anchor, setAnchor] = React31.useState(null);
43047
43783
  const [placementState, setPlacementState] = React31.useState(void 0);
@@ -43056,11 +43792,10 @@ var Popper = (props) => {
43056
43792
  children
43057
43793
  }
43058
43794
  );
43059
- };
43060
- Popper.displayName = POPPER_NAME;
43795
+ }, "Popper");
43061
43796
  var ANCHOR_NAME = "PopperAnchor";
43062
- var PopperAnchor = React31.forwardRef(
43063
- (props, forwardedRef) => {
43797
+ var PopperAnchor = /* @__PURE__ */ React31.forwardRef(
43798
+ /* @__PURE__ */ __name16(function PopperAnchor2(props, forwardedRef) {
43064
43799
  const { __scopePopper, virtualRef, ...anchorProps } = props;
43065
43800
  const context = usePopperContext(ANCHOR_NAME, __scopePopper);
43066
43801
  const ref = React31.useRef(null);
@@ -43098,13 +43833,12 @@ var PopperAnchor = React31.forwardRef(
43098
43833
  ref: composedRefs
43099
43834
  }
43100
43835
  );
43101
- }
43836
+ }, "PopperAnchor")
43102
43837
  );
43103
- PopperAnchor.displayName = ANCHOR_NAME;
43104
43838
  var CONTENT_NAME = "PopperContent";
43105
43839
  var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
43106
- var PopperContent = React31.forwardRef(
43107
- (props, forwardedRef) => {
43840
+ var PopperContent = /* @__PURE__ */ React31.forwardRef(
43841
+ /* @__PURE__ */ __name16(function PopperContent2(props, forwardedRef) {
43108
43842
  const {
43109
43843
  __scopePopper,
43110
43844
  side = "bottom",
@@ -43115,9 +43849,9 @@ var PopperContent = React31.forwardRef(
43115
43849
  avoidCollisions = true,
43116
43850
  collisionBoundary = [],
43117
43851
  collisionPadding: collisionPaddingProp = 0,
43118
- sticky = "partial",
43852
+ sticky = Sticky.Partial,
43119
43853
  hideWhenDetached = false,
43120
- updatePositionStrategy = "optimized",
43854
+ updatePositionStrategy = UpdatePositionStrategy.Optimized,
43121
43855
  onPlaced,
43122
43856
  ...contentProps
43123
43857
  } = props;
@@ -43142,12 +43876,12 @@ var PopperContent = React31.forwardRef(
43142
43876
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
43143
43877
  strategy: "fixed",
43144
43878
  placement: desiredPlacement,
43145
- whileElementsMounted: (...args) => {
43879
+ whileElementsMounted: /* @__PURE__ */ __name16((...args) => {
43146
43880
  const cleanup = autoUpdate(...args, {
43147
- animationFrame: updatePositionStrategy === "always"
43881
+ animationFrame: updatePositionStrategy === UpdatePositionStrategy.Always
43148
43882
  });
43149
43883
  return cleanup;
43150
- },
43884
+ }, "whileElementsMounted"),
43151
43885
  elements: {
43152
43886
  reference: context.anchor
43153
43887
  },
@@ -43156,20 +43890,20 @@ var PopperContent = React31.forwardRef(
43156
43890
  avoidCollisions && shift3({
43157
43891
  mainAxis: true,
43158
43892
  crossAxis: false,
43159
- limiter: sticky === "partial" ? limitShift3() : void 0,
43893
+ limiter: sticky === Sticky.Partial ? limitShift3() : void 0,
43160
43894
  ...detectOverflowOptions
43161
43895
  }),
43162
43896
  avoidCollisions && flip3({ ...detectOverflowOptions }),
43163
43897
  size3({
43164
43898
  ...detectOverflowOptions,
43165
- apply: ({ elements, rects, availableWidth, availableHeight }) => {
43899
+ apply: /* @__PURE__ */ __name16(({ elements, rects, availableWidth, availableHeight }) => {
43166
43900
  const { width: anchorWidth, height: anchorHeight } = rects.reference;
43167
43901
  const contentStyle = elements.floating.style;
43168
43902
  contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
43169
43903
  contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
43170
43904
  contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
43171
43905
  contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
43172
- }
43906
+ }, "apply")
43173
43907
  }),
43174
43908
  arrow4 && arrow3({ element: arrow4, padding: arrowPadding }),
43175
43909
  transformOrigin({ arrowWidth, arrowHeight }),
@@ -43251,9 +43985,10 @@ var PopperContent = React31.forwardRef(
43251
43985
  ref: composedRefs,
43252
43986
  style: {
43253
43987
  ...contentProps.style,
43254
- // if the PopperContent hasn't been placed yet (not all measurements done)
43255
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
43256
- animation: !isPositioned ? "none" : void 0
43988
+ // if the PopperContent hasn't been placed yet (not all
43989
+ // measurements done) we prevent animations so that users'
43990
+ // animations don't kick in too early from the wrong sides.
43991
+ animation: !isPositioned ? "none" : contentProps.style?.animation
43257
43992
  }
43258
43993
  }
43259
43994
  )
@@ -43261,68 +43996,13 @@ var PopperContent = React31.forwardRef(
43261
43996
  )
43262
43997
  }
43263
43998
  );
43264
- }
43999
+ }, "PopperContent")
43265
44000
  );
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
44001
  function isNotNull2(value) {
43323
44002
  return value !== null;
43324
44003
  }
43325
- var transformOrigin = (options) => ({
44004
+ __name16(isNotNull2, "isNotNull");
44005
+ var transformOrigin = /* @__PURE__ */ __name16((options) => ({
43326
44006
  name: "transformOrigin",
43327
44007
  options,
43328
44008
  fn(data) {
@@ -43352,48 +44032,49 @@ var transformOrigin = (options) => ({
43352
44032
  }
43353
44033
  return { data: { x, y } };
43354
44034
  }
43355
- });
44035
+ }), "transformOrigin");
43356
44036
  function getSideAndAlignFromPlacement(placement) {
43357
44037
  const [side, align = "center"] = placement.split("-");
43358
44038
  return [side, align];
43359
44039
  }
43360
- var Root2 = Popper;
43361
- var Anchor = PopperAnchor;
43362
- var Content = PopperContent;
43363
- var Arrow2 = PopperArrow;
44040
+ __name16(getSideAndAlignFromPlacement, "getSideAndAlignFromPlacement");
43364
44041
 
43365
44042
  // node_modules/@radix-ui/react-portal/dist/index.mjs
43366
44043
  import * as React32 from "react";
43367
44044
  import * as ReactDOM4 from "react-dom";
43368
44045
  import { jsx as jsx30 } from "react/jsx-runtime";
43369
- var PORTAL_NAME = "Portal";
43370
- var Portal = React32.forwardRef((props, forwardedRef) => {
43371
- const { container: containerProp, ...portalProps } = props;
43372
- const [mounted, setMounted] = React32.useState(false);
43373
- useLayoutEffect2(() => setMounted(true), []);
43374
- const container = containerProp || mounted && globalThis?.document?.body;
43375
- return container ? ReactDOM4.createPortal(/* @__PURE__ */ jsx30(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
43376
- });
43377
- Portal.displayName = PORTAL_NAME;
44046
+ var __defProp19 = Object.defineProperty;
44047
+ var __name17 = (target, value) => __defProp19(target, "name", { value, configurable: true });
44048
+ var Portal = /* @__PURE__ */ React32.forwardRef(
44049
+ /* @__PURE__ */ __name17(function Portal2(props, forwardedRef) {
44050
+ const { container: containerProp, ...portalProps } = props;
44051
+ const [mounted, setMounted] = React32.useState(false);
44052
+ useLayoutEffect2(() => setMounted(true), []);
44053
+ const container = containerProp || mounted && globalThis?.document?.body;
44054
+ return container ? ReactDOM4.createPortal(/* @__PURE__ */ jsx30(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
44055
+ }, "Portal")
44056
+ );
43378
44057
 
43379
44058
  // node_modules/@radix-ui/react-presence/dist/index.mjs
43380
44059
  import * as React210 from "react";
43381
44060
  import * as React33 from "react";
44061
+ var __defProp20 = Object.defineProperty;
44062
+ var __name18 = (target, value) => __defProp20(target, "name", { value, configurable: true });
43382
44063
  function useStateMachine(initialState, machine) {
43383
44064
  return React33.useReducer((state, event) => {
43384
44065
  const nextState = machine[state][event];
43385
44066
  return nextState ?? state;
43386
44067
  }, initialState);
43387
44068
  }
43388
- var Presence = (props) => {
44069
+ __name18(useStateMachine, "useStateMachine");
44070
+ var Presence = /* @__PURE__ */ __name18((props) => {
43389
44071
  const { present, children } = props;
43390
44072
  const presence = usePresence(present);
43391
44073
  const child = typeof children === "function" ? children({ present: presence.isPresent }) : React210.Children.only(children);
43392
44074
  const ref = useStableComposedRefs(presence.ref, getElementRef2(child));
43393
44075
  const forceMount = typeof children === "function";
43394
44076
  return forceMount || presence.isPresent ? React210.cloneElement(child, { ref }) : null;
43395
- };
43396
- Presence.displayName = "Presence";
44077
+ }, "Presence");
43397
44078
  function usePresence(present) {
43398
44079
  const [node, setNode] = React210.useState();
43399
44080
  const stylesRef = React210.useRef(null);
@@ -43449,7 +44130,7 @@ function usePresence(present) {
43449
44130
  if (node) {
43450
44131
  let timeoutId;
43451
44132
  const ownerWindow = node.ownerDocument.defaultView ?? window;
43452
- const handleAnimationEnd = (event) => {
44133
+ const handleAnimationEnd = /* @__PURE__ */ __name18((event) => {
43453
44134
  const currentAnimationName = getAnimationName(stylesRef.current);
43454
44135
  const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
43455
44136
  if (event.target === node && isCurrentAnimation) {
@@ -43464,12 +44145,12 @@ function usePresence(present) {
43464
44145
  });
43465
44146
  }
43466
44147
  }
43467
- };
43468
- const handleAnimationStart = (event) => {
44148
+ }, "handleAnimationEnd");
44149
+ const handleAnimationStart = /* @__PURE__ */ __name18((event) => {
43469
44150
  if (event.target === node) {
43470
44151
  prevAnimationNameRef.current = getAnimationName(stylesRef.current);
43471
44152
  }
43472
- };
44153
+ }, "handleAnimationStart");
43473
44154
  node.addEventListener("animationstart", handleAnimationStart);
43474
44155
  node.addEventListener("animationcancel", handleAnimationEnd);
43475
44156
  node.addEventListener("animationend", handleAnimationEnd);
@@ -43497,6 +44178,7 @@ function usePresence(present) {
43497
44178
  }, [])
43498
44179
  };
43499
44180
  }
44181
+ __name18(usePresence, "usePresence");
43500
44182
  function setRef2(ref, value) {
43501
44183
  if (typeof ref === "function") {
43502
44184
  return ref(value);
@@ -43504,6 +44186,7 @@ function setRef2(ref, value) {
43504
44186
  ref.current = value;
43505
44187
  }
43506
44188
  }
44189
+ __name18(setRef2, "setRef");
43507
44190
  function useStableComposedRefs(...refs) {
43508
44191
  const refsRef = React210.useRef(refs);
43509
44192
  refsRef.current = refs;
@@ -43531,9 +44214,11 @@ function useStableComposedRefs(...refs) {
43531
44214
  }
43532
44215
  }, []);
43533
44216
  }
44217
+ __name18(useStableComposedRefs, "useStableComposedRefs");
43534
44218
  function getAnimationName(styles) {
43535
44219
  return styles?.animationName || "none";
43536
44220
  }
44221
+ __name18(getAnimationName, "getAnimationName");
43537
44222
  function getElementRef2(element) {
43538
44223
  let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
43539
44224
  let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
@@ -43547,6 +44232,7 @@ function getElementRef2(element) {
43547
44232
  }
43548
44233
  return element.props.ref || element.ref;
43549
44234
  }
44235
+ __name18(getElementRef2, "getElementRef");
43550
44236
 
43551
44237
  // node_modules/@radix-ui/react-roving-focus/dist/index.mjs
43552
44238
  import * as React35 from "react";
@@ -43554,6 +44240,8 @@ import * as React35 from "react";
43554
44240
  // node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
43555
44241
  import * as React211 from "react";
43556
44242
  import * as React34 from "react";
44243
+ var __defProp21 = Object.defineProperty;
44244
+ var __name19 = (target, value) => __defProp21(target, "name", { value, configurable: true });
43557
44245
  var _isHydrated = false;
43558
44246
  function useIsHydrated() {
43559
44247
  const [isHydrated, setIsHydrated] = React34.useState(_isHydrated);
@@ -43565,11 +44253,13 @@ function useIsHydrated() {
43565
44253
  }, []);
43566
44254
  return isHydrated;
43567
44255
  }
44256
+ __name19(useIsHydrated, "useIsHydrated");
43568
44257
  var useReactSyncExternalStore = React211[" useSyncExternalStore ".trim().toString()];
43569
44258
  function subscribe() {
43570
44259
  return () => {
43571
44260
  };
43572
44261
  }
44262
+ __name19(subscribe, "subscribe");
43573
44263
  function useIsHydratedModern() {
43574
44264
  return useReactSyncExternalStore(
43575
44265
  subscribe,
@@ -43577,10 +44267,13 @@ function useIsHydratedModern() {
43577
44267
  () => false
43578
44268
  );
43579
44269
  }
44270
+ __name19(useIsHydratedModern, "useIsHydratedModern");
43580
44271
  var useIsHydrated2 = typeof useReactSyncExternalStore === "function" ? useIsHydratedModern : useIsHydrated;
43581
44272
 
43582
44273
  // node_modules/@radix-ui/react-roving-focus/dist/index.mjs
43583
44274
  import { jsx as jsx31 } from "react/jsx-runtime";
44275
+ var __defProp22 = Object.defineProperty;
44276
+ var __name20 = (target, value) => __defProp22(target, "name", { value, configurable: true });
43584
44277
  var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
43585
44278
  var EVENT_OPTIONS2 = { bubbles: false, cancelable: true };
43586
44279
  var GROUP_NAME = "RovingFocusGroup";
@@ -43589,14 +44282,22 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
43589
44282
  GROUP_NAME,
43590
44283
  [createCollectionScope]
43591
44284
  );
44285
+ var Orientation = {
44286
+ Vertical: "vertical",
44287
+ Horizontal: "horizontal"
44288
+ };
44289
+ var Direction = {
44290
+ LTR: "ltr",
44291
+ RTL: "rtl"
44292
+ };
43592
44293
  var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
43593
- var RovingFocusGroup = React35.forwardRef(
43594
- (props, forwardedRef) => {
44294
+ var RovingFocusGroup = /* @__PURE__ */ React35.forwardRef(
44295
+ // blank line to reduce diff noise
44296
+ /* @__PURE__ */ __name20(function RovingFocusGroup2(props, forwardedRef) {
43595
44297
  return /* @__PURE__ */ jsx31(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx31(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx31(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
43596
- }
44298
+ }, "RovingFocusGroup")
43597
44299
  );
43598
- RovingFocusGroup.displayName = GROUP_NAME;
43599
- var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
44300
+ var RovingFocusGroupImpl = /* @__PURE__ */ React35.forwardRef(/* @__PURE__ */ __name20(function RovingFocusGroupImpl2(props, forwardedRef) {
43600
44301
  const {
43601
44302
  __scopeRovingFocusGroup,
43602
44303
  orientation: orientation2,
@@ -43685,10 +44386,11 @@ var RovingFocusGroupImpl = React35.forwardRef((props, forwardedRef) => {
43685
44386
  )
43686
44387
  }
43687
44388
  );
43688
- });
44389
+ }, "RovingFocusGroupImpl"));
43689
44390
  var ITEM_NAME = "RovingFocusGroupItem";
43690
- var RovingFocusGroupItem = React35.forwardRef(
43691
- (props, forwardedRef) => {
44391
+ var RovingFocusGroupItem = /* @__PURE__ */ React35.forwardRef(
44392
+ // blank line to reduce diff noise
44393
+ /* @__PURE__ */ __name20(function RovingFocusGroupItem2(props, forwardedRef) {
43692
44394
  const {
43693
44395
  __scopeRovingFocusGroup,
43694
44396
  focusable = true,
@@ -43763,9 +44465,8 @@ var RovingFocusGroupItem = React35.forwardRef(
43763
44465
  )
43764
44466
  }
43765
44467
  );
43766
- }
44468
+ }, "RovingFocusGroupItem")
43767
44469
  );
43768
- RovingFocusGroupItem.displayName = ITEM_NAME;
43769
44470
  var MAP_KEY_TO_FOCUS_INTENT = {
43770
44471
  ArrowLeft: "prev",
43771
44472
  ArrowUp: "prev",
@@ -43777,15 +44478,21 @@ var MAP_KEY_TO_FOCUS_INTENT = {
43777
44478
  End: "last"
43778
44479
  };
43779
44480
  function getDirectionAwareKey(key, dir) {
43780
- if (dir !== "rtl") return key;
44481
+ if (dir !== Direction.RTL) return key;
43781
44482
  return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
43782
44483
  }
44484
+ __name20(getDirectionAwareKey, "getDirectionAwareKey");
43783
44485
  function getFocusIntent(event, orientation2, dir) {
43784
44486
  const key = getDirectionAwareKey(event.key, dir);
43785
- if (orientation2 === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
43786
- if (orientation2 === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
44487
+ if (orientation2 === Orientation.Vertical && ["ArrowLeft", "ArrowRight"].includes(key)) {
44488
+ return void 0;
44489
+ }
44490
+ if (orientation2 === Orientation.Horizontal && ["ArrowUp", "ArrowDown"].includes(key)) {
44491
+ return void 0;
44492
+ }
43787
44493
  return MAP_KEY_TO_FOCUS_INTENT[key];
43788
44494
  }
44495
+ __name20(getFocusIntent, "getFocusIntent");
43789
44496
  function focusFirst2(candidates, preventScroll = false) {
43790
44497
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
43791
44498
  for (const candidate of candidates) {
@@ -43794,11 +44501,11 @@ function focusFirst2(candidates, preventScroll = false) {
43794
44501
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
43795
44502
  }
43796
44503
  }
44504
+ __name20(focusFirst2, "focusFirst");
43797
44505
  function wrapArray(array, startIndex) {
43798
44506
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
43799
44507
  }
43800
- var Root3 = RovingFocusGroup;
43801
- var Item = RovingFocusGroupItem;
44508
+ __name20(wrapArray, "wrapArray");
43802
44509
 
43803
44510
  // node_modules/aria-hidden/dist/es2015/index.js
43804
44511
  var getDefaultParent = function(originalTarget) {
@@ -44643,6 +45350,12 @@ var Combination_default = ReactRemoveScroll;
44643
45350
 
44644
45351
  // node_modules/@radix-ui/react-menu/dist/index.mjs
44645
45352
  import { jsx as jsx32 } from "react/jsx-runtime";
45353
+ var __defProp23 = Object.defineProperty;
45354
+ var __name21 = (target, value) => __defProp23(target, "name", { value, configurable: true });
45355
+ var Direction2 = {
45356
+ LTR: "ltr",
45357
+ RTL: "rtl"
45358
+ };
44646
45359
  var SELECTION_KEYS = ["Enter", " "];
44647
45360
  var FIRST_KEYS = ["ArrowDown", "PageUp", "Home"];
44648
45361
  var LAST_KEYS = ["ArrowUp", "PageDown", "End"];
@@ -44666,7 +45379,7 @@ var usePopperScope = createPopperScope();
44666
45379
  var useRovingFocusGroupScope = createRovingFocusGroupScope();
44667
45380
  var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
44668
45381
  var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
44669
- var Menu = (props) => {
45382
+ var Menu = /* @__PURE__ */ __name21((props) => {
44670
45383
  const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
44671
45384
  const popperScope = usePopperScope(__scopeMenu);
44672
45385
  const [content, setContent] = React43.useState(null);
@@ -44674,12 +45387,12 @@ var Menu = (props) => {
44674
45387
  const handleOpenChange = useCallbackRef(onOpenChange);
44675
45388
  const direction = useDirection(dir);
44676
45389
  React43.useEffect(() => {
44677
- const handleKeyDown = () => {
45390
+ const handleKeyDown = /* @__PURE__ */ __name21(() => {
44678
45391
  isUsingKeyboardRef.current = true;
44679
45392
  document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
44680
45393
  document.addEventListener("pointermove", handlePointer, { capture: true, once: true });
44681
- };
44682
- const handlePointer = () => isUsingKeyboardRef.current = false;
45394
+ }, "handleKeyDown");
45395
+ const handlePointer = /* @__PURE__ */ __name21(() => isUsingKeyboardRef.current = false, "handlePointer");
44683
45396
  document.addEventListener("keydown", handleKeyDown, { capture: true });
44684
45397
  return () => {
44685
45398
  document.removeEventListener("keydown", handleKeyDown, { capture: true });
@@ -44691,11 +45404,11 @@ var Menu = (props) => {
44691
45404
  if (!open) {
44692
45405
  return;
44693
45406
  }
44694
- const handleBlur = () => handleOpenChange(false);
45407
+ const handleBlur = /* @__PURE__ */ __name21(() => handleOpenChange(false), "handleBlur");
44695
45408
  window.addEventListener("blur", handleBlur);
44696
45409
  return () => window.removeEventListener("blur", handleBlur);
44697
45410
  }, [open, handleOpenChange]);
44698
- return /* @__PURE__ */ jsx32(Root2, { ...popperScope, children: /* @__PURE__ */ jsx32(
45411
+ return /* @__PURE__ */ jsx32(Popper, { ...popperScope, children: /* @__PURE__ */ jsx32(
44699
45412
  MenuProvider,
44700
45413
  {
44701
45414
  scope: __scopeMenu,
@@ -44716,40 +45429,37 @@ var Menu = (props) => {
44716
45429
  )
44717
45430
  }
44718
45431
  ) });
44719
- };
44720
- Menu.displayName = MENU_NAME;
44721
- var ANCHOR_NAME2 = "MenuAnchor";
44722
- var MenuAnchor = React43.forwardRef(
44723
- (props, forwardedRef) => {
45432
+ }, "Menu");
45433
+ var MenuAnchor = /* @__PURE__ */ React43.forwardRef(
45434
+ /* @__PURE__ */ __name21(function MenuAnchor2(props, forwardedRef) {
44724
45435
  const { __scopeMenu, ...anchorProps } = props;
44725
45436
  const popperScope = usePopperScope(__scopeMenu);
44726
- return /* @__PURE__ */ jsx32(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
44727
- }
45437
+ return /* @__PURE__ */ jsx32(PopperAnchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
45438
+ }, "MenuAnchor")
44728
45439
  );
44729
- MenuAnchor.displayName = ANCHOR_NAME2;
44730
- var PORTAL_NAME2 = "MenuPortal";
44731
- var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME2, {
45440
+ var PORTAL_NAME = "MenuPortal";
45441
+ var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {
44732
45442
  forceMount: void 0
44733
45443
  });
44734
- var MenuPortal = (props) => {
45444
+ var MenuPortal = /* @__PURE__ */ __name21((props) => {
44735
45445
  const { __scopeMenu, forceMount, children, container } = props;
44736
- const context = useMenuContext(PORTAL_NAME2, __scopeMenu);
45446
+ const context = useMenuContext(PORTAL_NAME, __scopeMenu);
44737
45447
  return /* @__PURE__ */ jsx32(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx32(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx32(Portal, { asChild: true, container, children }) }) });
44738
- };
44739
- MenuPortal.displayName = PORTAL_NAME2;
45448
+ }, "MenuPortal");
44740
45449
  var CONTENT_NAME2 = "MenuContent";
44741
45450
  var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
44742
- var MenuContent = React43.forwardRef(
44743
- (props, forwardedRef) => {
45451
+ var MenuContent = /* @__PURE__ */ React43.forwardRef(
45452
+ /* @__PURE__ */ __name21(function MenuContent2(props, forwardedRef) {
44744
45453
  const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
44745
45454
  const { forceMount = portalContext.forceMount, ...contentProps } = props;
44746
45455
  const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
44747
45456
  const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
44748
45457
  return /* @__PURE__ */ jsx32(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx32(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx32(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx32(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx32(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
44749
- }
45458
+ }, "MenuContent")
44750
45459
  );
44751
- var MenuRootContentModal = React43.forwardRef(
44752
- (props, forwardedRef) => {
45460
+ var MenuRootContentModal = /* @__PURE__ */ React43.forwardRef(
45461
+ // blank line to reduce diff noise
45462
+ /* @__PURE__ */ __name21(function MenuRootContentModal2(props, forwardedRef) {
44753
45463
  const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
44754
45464
  const ref = React43.useRef(null);
44755
45465
  const composedRefs = useComposedRefs(forwardedRef, ref);
@@ -44773,9 +45483,9 @@ var MenuRootContentModal = React43.forwardRef(
44773
45483
  onDismiss: () => context.onOpenChange(false)
44774
45484
  }
44775
45485
  );
44776
- }
45486
+ }, "MenuRootContentModal")
44777
45487
  );
44778
- var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef) => {
45488
+ var MenuRootContentNonModal = /* @__PURE__ */ React43.forwardRef(/* @__PURE__ */ __name21(function MenuRootContentNonModal2(props, forwardedRef) {
44779
45489
  const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
44780
45490
  return /* @__PURE__ */ jsx32(
44781
45491
  MenuContentImpl,
@@ -44788,10 +45498,11 @@ var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef) => {
44788
45498
  onDismiss: () => context.onOpenChange(false)
44789
45499
  }
44790
45500
  );
44791
- });
45501
+ }, "MenuRootContentNonModal"));
44792
45502
  var Slot = createSlot("MenuContent.ScrollLock");
44793
- var MenuContentImpl = React43.forwardRef(
44794
- (props, forwardedRef) => {
45503
+ var MenuContentImpl = /* @__PURE__ */ React43.forwardRef(
45504
+ // blank line to reduce diff noise
45505
+ /* @__PURE__ */ __name21(function MenuContentImpl2(props, forwardedRef) {
44795
45506
  const {
44796
45507
  __scopeMenu,
44797
45508
  loop = false,
@@ -44806,6 +45517,7 @@ var MenuContentImpl = React43.forwardRef(
44806
45517
  onInteractOutside,
44807
45518
  onDismiss,
44808
45519
  disableOutsideScroll,
45520
+ children,
44809
45521
  ...contentProps
44810
45522
  } = props;
44811
45523
  const context = useMenuContext(CONTENT_NAME2, __scopeMenu);
@@ -44815,16 +45527,33 @@ var MenuContentImpl = React43.forwardRef(
44815
45527
  const getItems = useCollection2(__scopeMenu);
44816
45528
  const [currentItemId, setCurrentItemId] = React43.useState(null);
44817
45529
  const contentRef = React43.useRef(null);
44818
- const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
45530
+ const [branchNode, setBranchNode] = React43.useState(null);
45531
+ useFocusScopeBranch(branchNode);
45532
+ const { nodes: branchNodes, registry: branchRegistry } = useFocusScopeBranchRegistry();
45533
+ const isModal = Boolean(trapFocus || disableOutsideScroll);
45534
+ const composedRefs = useComposedRefs(
45535
+ forwardedRef,
45536
+ contentRef,
45537
+ context.onContentChange,
45538
+ setBranchNode
45539
+ );
44819
45540
  const timerRef = React43.useRef(0);
44820
45541
  const searchRef = React43.useRef("");
44821
45542
  const pointerGraceTimerRef = React43.useRef(0);
44822
45543
  const pointerGraceIntentRef = React43.useRef(null);
44823
45544
  const pointerDirRef = React43.useRef("right");
44824
45545
  const lastPointerXRef = React43.useRef(0);
45546
+ const shards = React43.useMemo(
45547
+ () => disableOutsideScroll ? [contentRef, ...branchNodes.map((node) => ({ current: node }))] : [],
45548
+ [contentRef, branchNodes, disableOutsideScroll]
45549
+ );
44825
45550
  const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React43.Fragment;
44826
- const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;
44827
- const handleTypeaheadSearch = (key) => {
45551
+ const scrollLockWrapperProps = disableOutsideScroll ? {
45552
+ as: Slot,
45553
+ allowPinchZoom: true,
45554
+ shards
45555
+ } : void 0;
45556
+ const handleTypeaheadSearch = /* @__PURE__ */ __name21((key) => {
44828
45557
  const search = searchRef.current + key;
44829
45558
  const items = getItems().filter((item) => !item.disabled);
44830
45559
  const currentItem = document.activeElement;
@@ -44832,15 +45561,15 @@ var MenuContentImpl = React43.forwardRef(
44832
45561
  const values = items.map((item) => item.textValue);
44833
45562
  const nextMatch = getNextMatch(values, search, currentMatch);
44834
45563
  const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;
44835
- (function updateSearch(value) {
45564
+ (/* @__PURE__ */ __name21((function updateSearch(value) {
44836
45565
  searchRef.current = value;
44837
45566
  window.clearTimeout(timerRef.current);
44838
45567
  if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
44839
- })(search);
45568
+ }), "updateSearch"))(search);
44840
45569
  if (newItem) {
44841
45570
  setTimeout(() => newItem.focus());
44842
45571
  }
44843
- };
45572
+ }, "handleTypeaheadSearch");
44844
45573
  React43.useEffect(() => {
44845
45574
  return () => window.clearTimeout(timerRef.current);
44846
45575
  }, []);
@@ -44883,6 +45612,7 @@ var MenuContentImpl = React43.forwardRef(
44883
45612
  {
44884
45613
  asChild: true,
44885
45614
  trapped: trapFocus,
45615
+ branches: branchNodes,
44886
45616
  onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {
44887
45617
  event.preventDefault();
44888
45618
  contentRef.current?.focus({ preventScroll: true });
@@ -44899,7 +45629,7 @@ var MenuContentImpl = React43.forwardRef(
44899
45629
  onInteractOutside,
44900
45630
  onDismiss,
44901
45631
  children: /* @__PURE__ */ jsx32(
44902
- Root3,
45632
+ RovingFocusGroup,
44903
45633
  {
44904
45634
  asChild: true,
44905
45635
  ...rovingFocusGroupScope,
@@ -44913,7 +45643,7 @@ var MenuContentImpl = React43.forwardRef(
44913
45643
  }),
44914
45644
  preventScrollOnEntryFocus: true,
44915
45645
  children: /* @__PURE__ */ jsx32(
44916
- Content,
45646
+ PopperContent,
44917
45647
  {
44918
45648
  role: "menu",
44919
45649
  "aria-orientation": "vertical",
@@ -44959,7 +45689,8 @@ var MenuContentImpl = React43.forwardRef(
44959
45689
  lastPointerXRef.current = event.clientX;
44960
45690
  }
44961
45691
  })
44962
- )
45692
+ ),
45693
+ children: isModal ? /* @__PURE__ */ jsx32(FocusScopeBranchProvider, { value: branchRegistry, children }) : children
44963
45694
  }
44964
45695
  )
44965
45696
  }
@@ -44970,36 +45701,20 @@ var MenuContentImpl = React43.forwardRef(
44970
45701
  ) })
44971
45702
  }
44972
45703
  );
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
- }
45704
+ }, "MenuContentImpl")
44982
45705
  );
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
45706
  var ITEM_NAME2 = "MenuItem";
44993
45707
  var ITEM_SELECT = "menu.itemSelect";
44994
- var MenuItem = React43.forwardRef(
44995
- (props, forwardedRef) => {
45708
+ var MenuItem = /* @__PURE__ */ React43.forwardRef(
45709
+ // blank line to reduce diff noise
45710
+ /* @__PURE__ */ __name21(function MenuItem2(props, forwardedRef) {
44996
45711
  const { disabled = false, onSelect, ...itemProps } = props;
44997
45712
  const ref = React43.useRef(null);
44998
45713
  const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
44999
45714
  const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
45000
45715
  const composedRefs = useComposedRefs(forwardedRef, ref);
45001
45716
  const isPointerDownRef = React43.useRef(false);
45002
- const handleSelect = () => {
45717
+ const handleSelect = /* @__PURE__ */ __name21(() => {
45003
45718
  const menuItem = ref.current;
45004
45719
  if (!disabled && menuItem) {
45005
45720
  const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
@@ -45011,7 +45726,7 @@ var MenuItem = React43.forwardRef(
45011
45726
  rootContext.onClose();
45012
45727
  }
45013
45728
  }
45014
- };
45729
+ }, "handleSelect");
45015
45730
  return /* @__PURE__ */ jsx32(
45016
45731
  MenuItemImpl,
45017
45732
  {
@@ -45041,11 +45756,10 @@ var MenuItem = React43.forwardRef(
45041
45756
  })
45042
45757
  }
45043
45758
  );
45044
- }
45759
+ }, "MenuItem")
45045
45760
  );
45046
- MenuItem.displayName = ITEM_NAME2;
45047
- var MenuItemImpl = React43.forwardRef(
45048
- (props, forwardedRef) => {
45761
+ var MenuItemImpl = /* @__PURE__ */ React43.forwardRef(
45762
+ /* @__PURE__ */ __name21(function MenuItemImpl2(props, forwardedRef) {
45049
45763
  const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
45050
45764
  const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
45051
45765
  const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
@@ -45065,7 +45779,7 @@ var MenuItemImpl = React43.forwardRef(
45065
45779
  scope: __scopeMenu,
45066
45780
  disabled,
45067
45781
  textValue: textValue ?? textContent,
45068
- children: /* @__PURE__ */ jsx32(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx32(
45782
+ children: /* @__PURE__ */ jsx32(RovingFocusGroupItem, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx32(
45069
45783
  Primitive.div,
45070
45784
  {
45071
45785
  role: "menuitem",
@@ -45098,97 +45812,21 @@ var MenuItemImpl = React43.forwardRef(
45098
45812
  ) })
45099
45813
  }
45100
45814
  );
45101
- }
45815
+ }, "MenuItemImpl")
45102
45816
  );
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
- }
45123
- );
45124
- MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
45125
45817
  var RADIO_GROUP_NAME = "MenuRadioGroup";
45126
45818
  var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
45127
45819
  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
- }
45820
+ { value: void 0, onValueChange: /* @__PURE__ */ __name21(() => {
45821
+ }, "onValueChange") }
45137
45822
  );
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
45823
  var ITEM_INDICATOR_NAME = "MenuItemIndicator";
45164
45824
  var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
45165
45825
  ITEM_INDICATOR_NAME,
45166
45826
  { checked: false }
45167
45827
  );
45168
- var MenuItemIndicator = React43.forwardRef(
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) => {
45828
+ var MenuSeparator = /* @__PURE__ */ React43.forwardRef(
45829
+ /* @__PURE__ */ __name21(function MenuSeparator2(props, forwardedRef) {
45192
45830
  const { __scopeMenu, ...separatorProps } = props;
45193
45831
  return /* @__PURE__ */ jsx32(
45194
45832
  Primitive.div,
@@ -45199,21 +45837,11 @@ var MenuSeparator = React43.forwardRef(
45199
45837
  ref: forwardedRef
45200
45838
  }
45201
45839
  );
45202
- }
45840
+ }, "MenuSeparator")
45203
45841
  );
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
- }
45212
- );
45213
- MenuArrow.displayName = ARROW_NAME2;
45214
45842
  var SUB_NAME = "MenuSub";
45215
45843
  var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
45216
- var MenuSub = (props) => {
45844
+ var MenuSub = /* @__PURE__ */ __name21((props) => {
45217
45845
  const { __scopeMenu, children, open = false, onOpenChange } = props;
45218
45846
  const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
45219
45847
  const popperScope = usePopperScope(__scopeMenu);
@@ -45224,7 +45852,7 @@ var MenuSub = (props) => {
45224
45852
  if (parentMenuContext.open === false) handleOpenChange(false);
45225
45853
  return () => handleOpenChange(false);
45226
45854
  }, [parentMenuContext.open, handleOpenChange]);
45227
- return /* @__PURE__ */ jsx32(Root2, { ...popperScope, children: /* @__PURE__ */ jsx32(
45855
+ return /* @__PURE__ */ jsx32(Popper, { ...popperScope, children: /* @__PURE__ */ jsx32(
45228
45856
  MenuProvider,
45229
45857
  {
45230
45858
  scope: __scopeMenu,
@@ -45245,11 +45873,10 @@ var MenuSub = (props) => {
45245
45873
  )
45246
45874
  }
45247
45875
  ) });
45248
- };
45249
- MenuSub.displayName = SUB_NAME;
45876
+ }, "MenuSub");
45250
45877
  var SUB_TRIGGER_NAME = "MenuSubTrigger";
45251
- var MenuSubTrigger = React43.forwardRef(
45252
- (props, forwardedRef) => {
45878
+ var MenuSubTrigger = /* @__PURE__ */ React43.forwardRef(
45879
+ /* @__PURE__ */ __name21(function MenuSubTrigger2(props, forwardedRef) {
45253
45880
  const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
45254
45881
  const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
45255
45882
  const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
@@ -45351,12 +45978,11 @@ var MenuSubTrigger = React43.forwardRef(
45351
45978
  })
45352
45979
  }
45353
45980
  ) });
45354
- }
45981
+ }, "MenuSubTrigger")
45355
45982
  );
45356
- MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
45357
45983
  var SUB_CONTENT_NAME = "MenuSubContent";
45358
- var MenuSubContent = React43.forwardRef(
45359
- (props, forwardedRef) => {
45984
+ var MenuSubContent = /* @__PURE__ */ React43.forwardRef(
45985
+ /* @__PURE__ */ __name21(function MenuSubContent2(props, forwardedRef) {
45360
45986
  const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
45361
45987
  const { forceMount = portalContext.forceMount, align = "start", ...subContentProps } = props;
45362
45988
  const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
@@ -45372,7 +45998,7 @@ var MenuSubContent = React43.forwardRef(
45372
45998
  ...subContentProps,
45373
45999
  ref: composedRefs,
45374
46000
  align,
45375
- side: rootContext.dir === "rtl" ? "left" : "right",
46001
+ side: rootContext.dir === Direction2.RTL ? "left" : "right",
45376
46002
  disableOutsidePointerEvents: false,
45377
46003
  disableOutsideScroll: false,
45378
46004
  trapFocus: false,
@@ -45399,18 +46025,20 @@ var MenuSubContent = React43.forwardRef(
45399
46025
  })
45400
46026
  }
45401
46027
  ) }) }) });
45402
- }
46028
+ }, "MenuSubContent")
45403
46029
  );
45404
- MenuSubContent.displayName = SUB_CONTENT_NAME;
45405
46030
  function getOpenState(open) {
45406
46031
  return open ? "open" : "closed";
45407
46032
  }
46033
+ __name21(getOpenState, "getOpenState");
45408
46034
  function isIndeterminate(checked) {
45409
46035
  return checked === "indeterminate";
45410
46036
  }
46037
+ __name21(isIndeterminate, "isIndeterminate");
45411
46038
  function getCheckedState(checked) {
45412
46039
  return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
45413
46040
  }
46041
+ __name21(getCheckedState, "getCheckedState");
45414
46042
  function focusFirst3(candidates) {
45415
46043
  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
45416
46044
  for (const candidate of candidates) {
@@ -45419,9 +46047,11 @@ function focusFirst3(candidates) {
45419
46047
  if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
45420
46048
  }
45421
46049
  }
46050
+ __name21(focusFirst3, "focusFirst");
45422
46051
  function wrapArray2(array, startIndex) {
45423
46052
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
45424
46053
  }
46054
+ __name21(wrapArray2, "wrapArray");
45425
46055
  function getNextMatch(values, search, currentMatch) {
45426
46056
  const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
45427
46057
  const normalizedSearch = isRepeated ? search[0] : search;
@@ -45434,6 +46064,7 @@ function getNextMatch(values, search, currentMatch) {
45434
46064
  );
45435
46065
  return nextMatch !== currentMatch ? nextMatch : void 0;
45436
46066
  }
46067
+ __name21(getNextMatch, "getNextMatch");
45437
46068
  function isPointInPolygon(point, polygon2) {
45438
46069
  const { x, y } = point;
45439
46070
  let inside = false;
@@ -45449,33 +46080,22 @@ function isPointInPolygon(point, polygon2) {
45449
46080
  }
45450
46081
  return inside;
45451
46082
  }
46083
+ __name21(isPointInPolygon, "isPointInPolygon");
45452
46084
  function isPointerInGraceArea(event, area) {
45453
46085
  if (!area) return false;
45454
46086
  const cursorPos = { x: event.clientX, y: event.clientY };
45455
46087
  return isPointInPolygon(cursorPos, area);
45456
46088
  }
46089
+ __name21(isPointerInGraceArea, "isPointerInGraceArea");
45457
46090
  function whenMouse(handler) {
45458
46091
  return (event) => event.pointerType === "mouse" ? handler(event) : void 0;
45459
46092
  }
45460
- var Root32 = Menu;
45461
- var Anchor2 = MenuAnchor;
45462
- var Portal2 = MenuPortal;
45463
- var Content2 = MenuContent;
45464
- var Group7 = MenuGroup;
45465
- var Label = MenuLabel;
45466
- var Item2 = MenuItem;
45467
- var CheckboxItem = MenuCheckboxItem;
45468
- var RadioGroup = MenuRadioGroup;
45469
- var RadioItem = MenuRadioItem;
45470
- var ItemIndicator = MenuItemIndicator;
45471
- var Separator = MenuSeparator;
45472
- var Arrow22 = MenuArrow;
45473
- var Sub = MenuSub;
45474
- var SubTrigger = MenuSubTrigger;
45475
- var SubContent = MenuSubContent;
46093
+ __name21(whenMouse, "whenMouse");
45476
46094
 
45477
46095
  // node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs
45478
46096
  import { jsx as jsx33 } from "react/jsx-runtime";
46097
+ var __defProp24 = Object.defineProperty;
46098
+ var __name22 = (target, value) => __defProp24(target, "name", { value, configurable: true });
45479
46099
  var DROPDOWN_MENU_NAME = "DropdownMenu";
45480
46100
  var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
45481
46101
  DROPDOWN_MENU_NAME,
@@ -45483,7 +46103,7 @@ var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(
45483
46103
  );
45484
46104
  var useMenuScope = createMenuScope();
45485
46105
  var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
45486
- var DropdownMenu = (props) => {
46106
+ var DropdownMenu = /* @__PURE__ */ __name22((props) => {
45487
46107
  const {
45488
46108
  __scopeDropdownMenu,
45489
46109
  children,
@@ -45512,19 +46132,19 @@ var DropdownMenu = (props) => {
45512
46132
  onOpenChange: setOpen,
45513
46133
  onOpenToggle: React44.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
45514
46134
  modal,
45515
- children: /* @__PURE__ */ jsx33(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
46135
+ children: /* @__PURE__ */ jsx33(Menu, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
45516
46136
  }
45517
46137
  );
45518
- };
45519
- DropdownMenu.displayName = DROPDOWN_MENU_NAME;
46138
+ }, "DropdownMenu");
45520
46139
  var TRIGGER_NAME = "DropdownMenuTrigger";
45521
- var DropdownMenuTrigger = React44.forwardRef(
45522
- (props, forwardedRef) => {
46140
+ var DropdownMenuTrigger = /* @__PURE__ */ React44.forwardRef(
46141
+ // blank line to reduce diff noise
46142
+ /* @__PURE__ */ __name22(function DropdownMenuTrigger2(props, forwardedRef) {
45523
46143
  const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
45524
46144
  const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
45525
46145
  const menuScope = useMenuScope(__scopeDropdownMenu);
45526
46146
  const composedRefs = useComposedRefs(forwardedRef, context.triggerRef);
45527
- return /* @__PURE__ */ jsx33(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx33(
46147
+ return /* @__PURE__ */ jsx33(MenuAnchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx33(
45528
46148
  Primitive.button,
45529
46149
  {
45530
46150
  type: "button",
@@ -45551,25 +46171,23 @@ var DropdownMenuTrigger = React44.forwardRef(
45551
46171
  })
45552
46172
  }
45553
46173
  ) });
45554
- }
46174
+ }, "DropdownMenuTrigger")
45555
46175
  );
45556
- DropdownMenuTrigger.displayName = TRIGGER_NAME;
45557
- var PORTAL_NAME3 = "DropdownMenuPortal";
45558
- var DropdownMenuPortal = (props) => {
46176
+ var DropdownMenuPortal = /* @__PURE__ */ __name22((props) => {
45559
46177
  const { __scopeDropdownMenu, ...portalProps } = props;
45560
46178
  const menuScope = useMenuScope(__scopeDropdownMenu);
45561
- return /* @__PURE__ */ jsx33(Portal2, { ...menuScope, ...portalProps });
45562
- };
45563
- DropdownMenuPortal.displayName = PORTAL_NAME3;
46179
+ return /* @__PURE__ */ jsx33(MenuPortal, { ...menuScope, ...portalProps });
46180
+ }, "DropdownMenuPortal");
45564
46181
  var CONTENT_NAME3 = "DropdownMenuContent";
45565
- var DropdownMenuContent = React44.forwardRef(
45566
- (props, forwardedRef) => {
46182
+ var DropdownMenuContent = /* @__PURE__ */ React44.forwardRef(
46183
+ // blank line to reduce diff noise
46184
+ /* @__PURE__ */ __name22(function DropdownMenuContent2(props, forwardedRef) {
45567
46185
  const { __scopeDropdownMenu, ...contentProps } = props;
45568
46186
  const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
45569
46187
  const menuScope = useMenuScope(__scopeDropdownMenu);
45570
46188
  const hasInteractedOutsideRef = React44.useRef(false);
45571
46189
  return /* @__PURE__ */ jsx33(
45572
- Content2,
46190
+ MenuContent,
45573
46191
  {
45574
46192
  id: context.contentId,
45575
46193
  "aria-labelledby": context.triggerId,
@@ -45600,81 +46218,22 @@ var DropdownMenuContent = React44.forwardRef(
45600
46218
  }
45601
46219
  }
45602
46220
  );
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
- }
46221
+ }, "DropdownMenuContent")
45622
46222
  );
45623
- DropdownMenuLabel.displayName = LABEL_NAME2;
45624
- var ITEM_NAME3 = "DropdownMenuItem";
45625
- var DropdownMenuItem = React44.forwardRef(
45626
- (props, forwardedRef) => {
46223
+ var DropdownMenuItem = /* @__PURE__ */ React44.forwardRef(
46224
+ // blank line to reduce diff noise
46225
+ /* @__PURE__ */ __name22(function DropdownMenuItem2(props, forwardedRef) {
45627
46226
  const { __scopeDropdownMenu, ...itemProps } = props;
45628
46227
  const menuScope = useMenuScope(__scopeDropdownMenu);
45629
- return /* @__PURE__ */ jsx33(Item2, { ...menuScope, ...itemProps, ref: forwardedRef });
45630
- }
46228
+ return /* @__PURE__ */ jsx33(MenuItem, { ...menuScope, ...itemProps, ref: forwardedRef });
46229
+ }, "DropdownMenuItem")
45631
46230
  );
45632
- DropdownMenuItem.displayName = ITEM_NAME3;
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) => {
46231
+ var DropdownMenuSeparator = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSeparator2(props, forwardedRef) {
45663
46232
  const { __scopeDropdownMenu, ...separatorProps } = props;
45664
46233
  const menuScope = useMenuScope(__scopeDropdownMenu);
45665
- return /* @__PURE__ */ jsx33(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
45666
- });
45667
- DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
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) => {
46234
+ return /* @__PURE__ */ jsx33(MenuSeparator, { ...menuScope, ...separatorProps, ref: forwardedRef });
46235
+ }, "DropdownMenuSeparator"));
46236
+ var DropdownMenuSub = /* @__PURE__ */ __name22((props) => {
45678
46237
  const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
45679
46238
  const menuScope = useMenuScope(__scopeDropdownMenu);
45680
46239
  const [open, setOpen] = useControllableState({
@@ -45683,21 +46242,18 @@ var DropdownMenuSub = (props) => {
45683
46242
  onChange: onOpenChange,
45684
46243
  caller: "DropdownMenuSub"
45685
46244
  });
45686
- return /* @__PURE__ */ jsx33(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
45687
- };
45688
- var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
45689
- var DropdownMenuSubTrigger = React44.forwardRef((props, forwardedRef) => {
46245
+ return /* @__PURE__ */ jsx33(MenuSub, { ...menuScope, open, onOpenChange: setOpen, children });
46246
+ }, "DropdownMenuSub");
46247
+ var DropdownMenuSubTrigger = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubTrigger2(props, forwardedRef) {
45690
46248
  const { __scopeDropdownMenu, ...subTriggerProps } = props;
45691
46249
  const menuScope = useMenuScope(__scopeDropdownMenu);
45692
- return /* @__PURE__ */ jsx33(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
45693
- });
45694
- DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
45695
- var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
45696
- var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
46250
+ return /* @__PURE__ */ jsx33(MenuSubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
46251
+ }, "DropdownMenuSubTrigger"));
46252
+ var DropdownMenuSubContent = /* @__PURE__ */ React44.forwardRef(/* @__PURE__ */ __name22(function DropdownMenuSubContent2(props, forwardedRef) {
45697
46253
  const { __scopeDropdownMenu, ...subContentProps } = props;
45698
46254
  const menuScope = useMenuScope(__scopeDropdownMenu);
45699
46255
  return /* @__PURE__ */ jsx33(
45700
- SubContent,
46256
+ MenuSubContent,
45701
46257
  {
45702
46258
  ...menuScope,
45703
46259
  ...subContentProps,
@@ -45715,17 +46271,7 @@ var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
45715
46271
  }
45716
46272
  }
45717
46273
  );
45718
- });
45719
- DropdownMenuSubContent.displayName = SUB_CONTENT_NAME2;
45720
- var Root22 = DropdownMenu;
45721
- var Trigger = DropdownMenuTrigger;
45722
- var Portal22 = DropdownMenuPortal;
45723
- var Content22 = DropdownMenuContent;
45724
- var Item22 = DropdownMenuItem;
45725
- var Separator2 = DropdownMenuSeparator;
45726
- var Sub2 = DropdownMenuSub;
45727
- var SubTrigger2 = DropdownMenuSubTrigger;
45728
- var SubContent2 = DropdownMenuSubContent;
46274
+ }, "DropdownMenuSubContent"));
45729
46275
 
45730
46276
  // src/components/AppearanceMenu.tsx
45731
46277
  import { useState as useState36 } from "react";
@@ -45838,10 +46384,10 @@ var AppearanceMenu = () => {
45838
46384
  const [appearanceSubOpen, setAppearanceSubOpen] = useState36(false);
45839
46385
  const [hoveredItem, setHoveredItem] = useState36(null);
45840
46386
  return /* @__PURE__ */ jsxs8(Fragment11, { children: [
45841
- /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
45842
- /* @__PURE__ */ jsxs8(Sub2, { onOpenChange: setAppearanceSubOpen, children: [
46387
+ /* @__PURE__ */ jsx35(DropdownMenuSeparator, { style: separatorStyles }),
46388
+ /* @__PURE__ */ jsxs8(DropdownMenuSub, { onOpenChange: setAppearanceSubOpen, children: [
45843
46389
  /* @__PURE__ */ jsxs8(
45844
- SubTrigger2,
46390
+ DropdownMenuSubTrigger,
45845
46391
  {
45846
46392
  style: {
45847
46393
  ...itemStyles,
@@ -45868,15 +46414,15 @@ var AppearanceMenu = () => {
45868
46414
  ]
45869
46415
  }
45870
46416
  ),
45871
- /* @__PURE__ */ jsx35(Portal22, { children: /* @__PURE__ */ jsxs8(
45872
- SubContent2,
46417
+ /* @__PURE__ */ jsx35(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs8(
46418
+ DropdownMenuSubContent,
45873
46419
  {
45874
46420
  style: { ...contentStyles, marginLeft: -2 },
45875
46421
  collisionPadding: 10,
45876
46422
  avoidCollisions: true,
45877
46423
  children: [
45878
46424
  /* @__PURE__ */ jsxs8(
45879
- Item22,
46425
+ DropdownMenuItem,
45880
46426
  {
45881
46427
  style: {
45882
46428
  ...itemStyles,
@@ -45896,9 +46442,9 @@ var AppearanceMenu = () => {
45896
46442
  ]
45897
46443
  }
45898
46444
  ),
45899
- /* @__PURE__ */ jsx35(Separator2, { style: separatorStyles }),
46445
+ /* @__PURE__ */ jsx35(DropdownMenuSeparator, { style: separatorStyles }),
45900
46446
  /* @__PURE__ */ jsxs8(
45901
- Item22,
46447
+ DropdownMenuItem,
45902
46448
  {
45903
46449
  style: {
45904
46450
  ...itemStyles,
@@ -45919,7 +46465,7 @@ var AppearanceMenu = () => {
45919
46465
  }
45920
46466
  ),
45921
46467
  /* @__PURE__ */ jsxs8(
45922
- Item22,
46468
+ DropdownMenuItem,
45923
46469
  {
45924
46470
  style: {
45925
46471
  ...itemStyles,
@@ -45940,7 +46486,7 @@ var AppearanceMenu = () => {
45940
46486
  }
45941
46487
  ),
45942
46488
  /* @__PURE__ */ jsxs8(
45943
- Item22,
46489
+ DropdownMenuItem,
45944
46490
  {
45945
46491
  style: {
45946
46492
  ...itemStyles,
@@ -45961,7 +46507,7 @@ var AppearanceMenu = () => {
45961
46507
  }
45962
46508
  ),
45963
46509
  /* @__PURE__ */ jsxs8(
45964
- Item22,
46510
+ DropdownMenuItem,
45965
46511
  {
45966
46512
  style: {
45967
46513
  ...itemStyles,
@@ -45982,7 +46528,7 @@ var AppearanceMenu = () => {
45982
46528
  }
45983
46529
  ),
45984
46530
  /* @__PURE__ */ jsxs8(
45985
- Item22,
46531
+ DropdownMenuItem,
45986
46532
  {
45987
46533
  style: {
45988
46534
  ...itemStyles,
@@ -46003,7 +46549,7 @@ var AppearanceMenu = () => {
46003
46549
  }
46004
46550
  ),
46005
46551
  /* @__PURE__ */ jsxs8(
46006
- Item22,
46552
+ DropdownMenuItem,
46007
46553
  {
46008
46554
  style: {
46009
46555
  ...itemStyles,
@@ -46027,7 +46573,7 @@ var AppearanceMenu = () => {
46027
46573
  }
46028
46574
  ),
46029
46575
  /* @__PURE__ */ jsxs8(
46030
- Item22,
46576
+ DropdownMenuItem,
46031
46577
  {
46032
46578
  style: {
46033
46579
  ...itemStyles,
@@ -46048,7 +46594,7 @@ var AppearanceMenu = () => {
46048
46594
  }
46049
46595
  ),
46050
46596
  /* @__PURE__ */ jsxs8(
46051
- Item22,
46597
+ DropdownMenuItem,
46052
46598
  {
46053
46599
  style: {
46054
46600
  ...itemStyles,
@@ -46069,7 +46615,7 @@ var AppearanceMenu = () => {
46069
46615
  }
46070
46616
  ),
46071
46617
  /* @__PURE__ */ jsxs8(
46072
- Item22,
46618
+ DropdownMenuItem,
46073
46619
  {
46074
46620
  style: {
46075
46621
  ...itemStyles,
@@ -46090,7 +46636,7 @@ var AppearanceMenu = () => {
46090
46636
  }
46091
46637
  ),
46092
46638
  /* @__PURE__ */ jsxs8(
46093
- Item22,
46639
+ DropdownMenuItem,
46094
46640
  {
46095
46641
  style: {
46096
46642
  ...itemStyles,
@@ -46111,7 +46657,7 @@ var AppearanceMenu = () => {
46111
46657
  }
46112
46658
  ),
46113
46659
  /* @__PURE__ */ jsxs8(
46114
- Item22,
46660
+ DropdownMenuItem,
46115
46661
  {
46116
46662
  style: {
46117
46663
  ...itemStyles,
@@ -46237,10 +46783,10 @@ var ContextMenu = ({
46237
46783
  width: 0,
46238
46784
  height: 0
46239
46785
  },
46240
- children: /* @__PURE__ */ jsxs9(Root22, { open: true, modal: false, children: [
46241
- /* @__PURE__ */ jsx36(Trigger, { asChild: true, children: /* @__PURE__ */ jsx36("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
46242
- /* @__PURE__ */ jsx36(Portal22, { children: /* @__PURE__ */ jsxs9(
46243
- Content22,
46786
+ children: /* @__PURE__ */ jsxs9(DropdownMenu, { open: true, modal: false, children: [
46787
+ /* @__PURE__ */ jsx36(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx36("div", { style: { position: "absolute", width: 1, height: 1 } }) }),
46788
+ /* @__PURE__ */ jsx36(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs9(
46789
+ DropdownMenuContent,
46244
46790
  {
46245
46791
  style: contentStyles2,
46246
46792
  collisionPadding: 10,
@@ -46248,9 +46794,9 @@ var ContextMenu = ({
46248
46794
  sideOffset: 0,
46249
46795
  align: "start",
46250
46796
  children: [
46251
- /* @__PURE__ */ jsxs9(Sub2, { onOpenChange: setCameraSubOpen, children: [
46797
+ /* @__PURE__ */ jsxs9(DropdownMenuSub, { onOpenChange: setCameraSubOpen, children: [
46252
46798
  /* @__PURE__ */ jsxs9(
46253
- SubTrigger2,
46799
+ DropdownMenuSubTrigger,
46254
46800
  {
46255
46801
  style: {
46256
46802
  ...itemStyles2,
@@ -46286,14 +46832,14 @@ var ContextMenu = ({
46286
46832
  ]
46287
46833
  }
46288
46834
  ),
46289
- /* @__PURE__ */ jsx36(Portal22, { children: /* @__PURE__ */ jsx36(
46290
- SubContent2,
46835
+ /* @__PURE__ */ jsx36(DropdownMenuPortal, { children: /* @__PURE__ */ jsx36(
46836
+ DropdownMenuSubContent,
46291
46837
  {
46292
46838
  style: { ...contentStyles2, marginLeft: -2 },
46293
46839
  collisionPadding: 10,
46294
46840
  avoidCollisions: true,
46295
46841
  children: cameraOptions.map((option) => /* @__PURE__ */ jsxs9(
46296
- Item22,
46842
+ DropdownMenuItem,
46297
46843
  {
46298
46844
  style: {
46299
46845
  ...itemStyles2,
@@ -46318,7 +46864,7 @@ var ContextMenu = ({
46318
46864
  ) })
46319
46865
  ] }),
46320
46866
  /* @__PURE__ */ jsxs9(
46321
- Item22,
46867
+ DropdownMenuItem,
46322
46868
  {
46323
46869
  style: {
46324
46870
  ...itemStyles2,
@@ -46339,7 +46885,7 @@ var ContextMenu = ({
46339
46885
  }
46340
46886
  ),
46341
46887
  /* @__PURE__ */ jsxs9(
46342
- Item22,
46888
+ DropdownMenuItem,
46343
46889
  {
46344
46890
  style: {
46345
46891
  ...itemStyles2,
@@ -46362,9 +46908,9 @@ var ContextMenu = ({
46362
46908
  }
46363
46909
  ),
46364
46910
  /* @__PURE__ */ jsx36(AppearanceMenu, {}),
46365
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
46911
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
46366
46912
  /* @__PURE__ */ jsx36(
46367
- Item22,
46913
+ DropdownMenuItem,
46368
46914
  {
46369
46915
  style: {
46370
46916
  ...itemStyles2,
@@ -46378,9 +46924,9 @@ var ContextMenu = ({
46378
46924
  children: /* @__PURE__ */ jsx36("span", { style: { display: "flex", alignItems: "center" }, children: "Download GLTF" })
46379
46925
  }
46380
46926
  ),
46381
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
46927
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
46382
46928
  /* @__PURE__ */ jsxs9(
46383
- Item22,
46929
+ DropdownMenuItem,
46384
46930
  {
46385
46931
  style: {
46386
46932
  ...itemStyles2,
@@ -46415,9 +46961,9 @@ var ContextMenu = ({
46415
46961
  ]
46416
46962
  }
46417
46963
  ),
46418
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
46964
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
46419
46965
  /* @__PURE__ */ jsxs9(
46420
- Item22,
46966
+ DropdownMenuItem,
46421
46967
  {
46422
46968
  style: {
46423
46969
  ...itemStyles2,
@@ -46444,7 +46990,7 @@ var ContextMenu = ({
46444
46990
  ]
46445
46991
  }
46446
46992
  ),
46447
- /* @__PURE__ */ jsx36(Separator2, { style: separatorStyles2 }),
46993
+ /* @__PURE__ */ jsx36(DropdownMenuSeparator, { style: separatorStyles2 }),
46448
46994
  /* @__PURE__ */ jsx36(
46449
46995
  "div",
46450
46996
  {
@@ -46483,14 +47029,14 @@ var ContextMenu = ({
46483
47029
  };
46484
47030
 
46485
47031
  // src/components/KeyboardShortcutsDialog.tsx
46486
- import { useEffect as useEffect47, useMemo as useMemo30, useRef as useRef27, useState as useState38 } from "react";
47032
+ import { useEffect as useEffect47, useMemo as useMemo33, useRef as useRef28, useState as useState38 } from "react";
46487
47033
  import { jsx as jsx37, jsxs as jsxs10 } from "react/jsx-runtime";
46488
47034
  var KeyboardShortcutsDialog = ({
46489
47035
  open,
46490
47036
  onClose
46491
47037
  }) => {
46492
47038
  const [query, setQuery] = useState38("");
46493
- const inputRef = useRef27(null);
47039
+ const inputRef = useRef28(null);
46494
47040
  const hotkeys = useHotkeyRegistry();
46495
47041
  useEffect47(() => {
46496
47042
  if (!open) return void 0;
@@ -46510,7 +47056,7 @@ var KeyboardShortcutsDialog = ({
46510
47056
  }, 0);
46511
47057
  }
46512
47058
  }, [open]);
46513
- const filteredHotkeys = useMemo30(() => {
47059
+ const filteredHotkeys = useMemo33(() => {
46514
47060
  const normalizedQuery = query.trim().toLowerCase();
46515
47061
  if (!normalizedQuery) {
46516
47062
  return hotkeys;
@@ -46686,7 +47232,7 @@ var CadViewerInner = (props) => {
46686
47232
  const stored = window.localStorage.getItem("cadViewerEngine");
46687
47233
  return stored === "jscad" || stored === "manifold" ? stored : "manifold";
46688
47234
  });
46689
- const containerRef = useRef28(null);
47235
+ const containerRef = useRef29(null);
46690
47236
  const [isKeyboardShortcutsDialogOpen, setIsKeyboardShortcutsDialogOpen] = useState39(false);
46691
47237
  const [autoRotate, setAutoRotate] = useState39(() => {
46692
47238
  const stored = window.localStorage.getItem("cadViewerAutoRotate");
@@ -46700,7 +47246,7 @@ var CadViewerInner = (props) => {
46700
47246
  const { cameraType, setCameraType } = useCameraController();
46701
47247
  const { visibility, setLayerVisibility } = useLayerVisibility();
46702
47248
  const { showToast } = useToast();
46703
- const cameraControllerRef = useRef28(null);
47249
+ const cameraControllerRef = useRef29(null);
46704
47250
  const externalCameraControllerReady = props.onCameraControllerReady;
46705
47251
  const {
46706
47252
  menuVisible,
@@ -46709,10 +47255,10 @@ var CadViewerInner = (props) => {
46709
47255
  contextMenuEventHandlers,
46710
47256
  setMenuVisible
46711
47257
  } = useContextMenu({ containerRef });
46712
- const autoRotateUserToggledRef = useRef28(autoRotateUserToggled);
47258
+ const autoRotateUserToggledRef = useRef29(autoRotateUserToggled);
46713
47259
  autoRotateUserToggledRef.current = autoRotateUserToggled;
46714
- const isAnimatingRef = useRef28(false);
46715
- const lastPresetSelectTime = useRef28(0);
47260
+ const isAnimatingRef = useRef29(false);
47261
+ const lastPresetSelectTime = useRef29(0);
46716
47262
  const PRESET_COOLDOWN = 1e3;
46717
47263
  const handleUserInteraction = useCallback25(() => {
46718
47264
  if (isAnimatingRef.current || Date.now() - lastPresetSelectTime.current < PRESET_COOLDOWN) {
@@ -47225,10 +47771,10 @@ async function convertCircuitJsonTo3dSvg(circuitJson, options = {}) {
47225
47771
 
47226
47772
  // src/hooks/exporter/gltf.ts
47227
47773
  import { GLTFExporter as GLTFExporter3 } from "three-stdlib";
47228
- import { useEffect as useEffect49, useState as useState40, useMemo as useMemo31, useCallback as useCallback26 } from "react";
47774
+ import { useEffect as useEffect49, useState as useState40, useMemo as useMemo34, useCallback as useCallback26 } from "react";
47229
47775
  function useSaveGltfAs(options = {}) {
47230
47776
  const parse2 = useParser(options);
47231
- const link = useMemo31(() => document.createElement("a"), []);
47777
+ const link = useMemo34(() => document.createElement("a"), []);
47232
47778
  const saveAs = async (filename) => {
47233
47779
  const name = filename ?? options.filename ?? "";
47234
47780
  if (options.binary == null) options.binary = name.endsWith(".glb");
@@ -47263,7 +47809,7 @@ function useExportGltfUrl(options = {}) {
47263
47809
  return [ref, url, error];
47264
47810
  }
47265
47811
  function useParser(options = {}) {
47266
- const exporter = useMemo31(() => new GLTFExporter3(), []);
47812
+ const exporter = useMemo34(() => new GLTFExporter3(), []);
47267
47813
  return (instance) => {
47268
47814
  const { promise, resolve, reject } = Promise.withResolvers();
47269
47815
  exporter.parse(