@1urso/generic-editor 0.1.2 → 0.1.4

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.
@@ -1,7 +1,7 @@
1
1
  import * as React$1 from "react";
2
2
  import React, { Component, Fragment, PureComponent, createContext, createElement, forwardRef, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  import * as ReactDOM$1 from "react-dom";
4
- import ReactDOM, { flushSync } from "react-dom";
4
+ import ReactDOM, { createPortal, flushSync } from "react-dom";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
  var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __esmMin = (s, d) => () => (s && (d = s(s = 0)), d), __commonJSMin = (s, d) => () => (d || s((d = { exports: {} }).exports, d), d.exports), __export = (s) => {
7
7
  let d = {};
@@ -253,7 +253,7 @@ function createCollection(s) {
253
253
  });
254
254
  });
255
255
  q.displayName = U;
256
- let J = s + "CollectionItemSlot", X = "data-radix-collection-item", $ = /* @__PURE__ */ createSlot(J), CO = React.forwardRef((s, C) => {
256
+ let J = s + "CollectionItemSlot", X = "data-radix-collection-item", $ = /* @__PURE__ */ createSlot(J), PD = React.forwardRef((s, C) => {
257
257
  let { scope: w, children: k, ...F } = s, V = React.useRef(null), U = useComposedRefs(C, V), K = L(J, w);
258
258
  return React.useEffect(() => (K.itemMap.set(V, {
259
259
  ref: V,
@@ -264,8 +264,8 @@ function createCollection(s) {
264
264
  children: k
265
265
  });
266
266
  });
267
- CO.displayName = J;
268
- function wO(C) {
267
+ PD.displayName = J;
268
+ function FD(C) {
269
269
  let w = L(s + "CollectionConsumer", C);
270
270
  return React.useCallback(() => {
271
271
  let s = w.collectionRef.current;
@@ -278,9 +278,9 @@ function createCollection(s) {
278
278
  {
279
279
  Provider: V,
280
280
  Slot: q,
281
- ItemSlot: CO
281
+ ItemSlot: PD
282
282
  },
283
- wO,
283
+ FD,
284
284
  k
285
285
  ];
286
286
  }
@@ -433,15 +433,15 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
433
433
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
434
434
  branches: /* @__PURE__ */ new Set()
435
435
  }), DismissableLayer = React$1.forwardRef((d, C) => {
436
- let { disableOutsidePointerEvents: w = !1, onEscapeKeyDown: k, onPointerDownOutside: F, onFocusOutside: L, onInteractOutside: V, onDismiss: U, ...K } = d, q = React$1.useContext(DismissableLayerContext), [J, X] = React$1.useState(null), $ = J?.ownerDocument ?? globalThis?.document, [, CO] = React$1.useState({}), wO = useComposedRefs(C, (s) => X(s)), TO = Array.from(q.layers), [EO] = [...q.layersWithOutsidePointerEventsDisabled].slice(-1), DO = TO.indexOf(EO), OO = J ? TO.indexOf(J) : -1, kO = q.layersWithOutsidePointerEventsDisabled.size > 0, AO = OO >= DO, jO = usePointerDownOutside((s) => {
436
+ let { disableOutsidePointerEvents: w = !1, onEscapeKeyDown: k, onPointerDownOutside: F, onFocusOutside: L, onInteractOutside: V, onDismiss: U, ...K } = d, q = React$1.useContext(DismissableLayerContext), [J, X] = React$1.useState(null), $ = J?.ownerDocument ?? globalThis?.document, [, PD] = React$1.useState({}), FD = useComposedRefs(C, (s) => X(s)), ID = Array.from(q.layers), [LD] = [...q.layersWithOutsidePointerEventsDisabled].slice(-1), RD = ID.indexOf(LD), zD = J ? ID.indexOf(J) : -1, BD = q.layersWithOutsidePointerEventsDisabled.size > 0, VD = zD >= RD, HD = usePointerDownOutside((s) => {
437
437
  let d = s.target, C = [...q.branches].some((s) => s.contains(d));
438
- !AO || C || (F?.(s), V?.(s), s.defaultPrevented || U?.());
439
- }, $), NO = useFocusOutside((s) => {
438
+ !VD || C || (F?.(s), V?.(s), s.defaultPrevented || U?.());
439
+ }, $), UD = useFocusOutside((s) => {
440
440
  let d = s.target;
441
441
  [...q.branches].some((s) => s.contains(d)) || (L?.(s), V?.(s), s.defaultPrevented || U?.());
442
442
  }, $);
443
443
  return useEscapeKeydown((s) => {
444
- OO === q.layers.size - 1 && (k?.(s), !s.defaultPrevented && U && (s.preventDefault(), U()));
444
+ zD === q.layers.size - 1 && (k?.(s), !s.defaultPrevented && U && (s.preventDefault(), U()));
445
445
  }, $), React$1.useEffect(() => {
446
446
  if (J) return w && (q.layersWithOutsidePointerEventsDisabled.size === 0 && (originalBodyPointerEvents = $.body.style.pointerEvents, $.body.style.pointerEvents = "none"), q.layersWithOutsidePointerEventsDisabled.add(J)), q.layers.add(J), dispatchUpdate(), () => {
447
447
  w && q.layersWithOutsidePointerEventsDisabled.size === 1 && ($.body.style.pointerEvents = originalBodyPointerEvents);
@@ -454,18 +454,18 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
454
454
  ]), React$1.useEffect(() => () => {
455
455
  J && (q.layers.delete(J), q.layersWithOutsidePointerEventsDisabled.delete(J), dispatchUpdate());
456
456
  }, [J, q]), React$1.useEffect(() => {
457
- let s = () => CO({});
457
+ let s = () => PD({});
458
458
  return document.addEventListener(CONTEXT_UPDATE, s), () => document.removeEventListener(CONTEXT_UPDATE, s);
459
459
  }, []), /* @__PURE__ */ jsx(Primitive.div, {
460
460
  ...K,
461
- ref: wO,
461
+ ref: FD,
462
462
  style: {
463
- pointerEvents: kO ? AO ? "auto" : "none" : void 0,
463
+ pointerEvents: BD ? VD ? "auto" : "none" : void 0,
464
464
  ...d.style
465
465
  },
466
- onFocusCapture: composeEventHandlers(d.onFocusCapture, NO.onFocusCapture),
467
- onBlurCapture: composeEventHandlers(d.onBlurCapture, NO.onBlurCapture),
468
- onPointerDownCapture: composeEventHandlers(d.onPointerDownCapture, jO.onPointerDownCapture)
466
+ onFocusCapture: composeEventHandlers(d.onFocusCapture, UD.onFocusCapture),
467
+ onBlurCapture: composeEventHandlers(d.onBlurCapture, UD.onBlurCapture),
468
+ onPointerDownCapture: composeEventHandlers(d.onPointerDownCapture, HD.onPointerDownCapture)
469
469
  });
470
470
  });
471
471
  DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
@@ -529,7 +529,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
529
529
  bubbles: !1,
530
530
  cancelable: !0
531
531
  }, FOCUS_SCOPE_NAME = "FocusScope", FocusScope = React$1.forwardRef((d, C) => {
532
- let { loop: w = !1, trapped: k = !1, onMountAutoFocus: F, onUnmountAutoFocus: L, ...V } = d, [U, K] = React$1.useState(null), q = useCallbackRef(F), J = useCallbackRef(L), X = React$1.useRef(null), $ = useComposedRefs(C, (s) => K(s)), CO = React$1.useRef({
532
+ let { loop: w = !1, trapped: k = !1, onMountAutoFocus: F, onUnmountAutoFocus: L, ...V } = d, [U, K] = React$1.useState(null), q = useCallbackRef(F), J = useCallbackRef(L), X = React$1.useRef(null), $ = useComposedRefs(C, (s) => K(s)), PD = React$1.useRef({
533
533
  paused: !1,
534
534
  pause() {
535
535
  this.paused = !0;
@@ -541,11 +541,11 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
541
541
  React$1.useEffect(() => {
542
542
  if (k) {
543
543
  let s = function(s) {
544
- if (CO.paused || !U) return;
544
+ if (PD.paused || !U) return;
545
545
  let d = s.target;
546
546
  U.contains(d) ? X.current = d : focus(X.current, { select: !0 });
547
547
  }, d = function(s) {
548
- if (CO.paused || !U) return;
548
+ if (PD.paused || !U) return;
549
549
  let d = s.relatedTarget;
550
550
  d !== null && (U.contains(d) || focus(X.current, { select: !0 }));
551
551
  }, C = function(s) {
@@ -563,10 +563,10 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
563
563
  }, [
564
564
  k,
565
565
  U,
566
- CO.paused
566
+ PD.paused
567
567
  ]), React$1.useEffect(() => {
568
568
  if (U) {
569
- focusScopesStack.add(CO);
569
+ focusScopesStack.add(PD);
570
570
  let s = document.activeElement;
571
571
  if (!U.contains(s)) {
572
572
  let d = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS$1);
@@ -575,7 +575,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
575
575
  return () => {
576
576
  U.removeEventListener(AUTOFOCUS_ON_MOUNT, q), setTimeout(() => {
577
577
  let d = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS$1);
578
- U.addEventListener(AUTOFOCUS_ON_UNMOUNT, J), U.dispatchEvent(d), d.defaultPrevented || focus(s ?? document.body, { select: !0 }), U.removeEventListener(AUTOFOCUS_ON_UNMOUNT, J), focusScopesStack.remove(CO);
578
+ U.addEventListener(AUTOFOCUS_ON_UNMOUNT, J), U.dispatchEvent(d), d.defaultPrevented || focus(s ?? document.body, { select: !0 }), U.removeEventListener(AUTOFOCUS_ON_UNMOUNT, J), focusScopesStack.remove(PD);
579
579
  }, 0);
580
580
  };
581
581
  }
@@ -583,10 +583,10 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
583
583
  U,
584
584
  q,
585
585
  J,
586
- CO
586
+ PD
587
587
  ]);
588
- let wO = React$1.useCallback((s) => {
589
- if (!w && !k || CO.paused) return;
588
+ let FD = React$1.useCallback((s) => {
589
+ if (!w && !k || PD.paused) return;
590
590
  let d = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, C = document.activeElement;
591
591
  if (d && C) {
592
592
  let d = s.currentTarget, [k, F] = getTabbableEdges(d);
@@ -595,13 +595,13 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount", AUTOFOCUS_ON_UNMOUNT = "
595
595
  }, [
596
596
  w,
597
597
  k,
598
- CO.paused
598
+ PD.paused
599
599
  ]);
600
600
  return /* @__PURE__ */ jsx(Primitive.div, {
601
601
  tabIndex: -1,
602
602
  ...V,
603
603
  ref: $,
604
- onKeyDown: wO
604
+ onKeyDown: FD
605
605
  });
606
606
  });
607
607
  FocusScope.displayName = FOCUS_SCOPE_NAME;
@@ -662,7 +662,7 @@ function arrayRemove(s, d) {
662
662
  function removeLinks(s) {
663
663
  return s.filter((s) => s.tagName !== "A");
664
664
  }
665
- var PORTAL_NAME$5 = "Portal", Portal = React$1.forwardRef((d, C) => {
665
+ var PORTAL_NAME$4 = "Portal", Portal = React$1.forwardRef((d, C) => {
666
666
  let { container: w, ...k } = d, [F, L] = React$1.useState(!1);
667
667
  useLayoutEffect2(() => L(!0), []);
668
668
  let V = w || F && globalThis?.document?.body;
@@ -671,7 +671,7 @@ var PORTAL_NAME$5 = "Portal", Portal = React$1.forwardRef((d, C) => {
671
671
  ref: C
672
672
  }), V) : null;
673
673
  });
674
- Portal.displayName = PORTAL_NAME$5;
674
+ Portal.displayName = PORTAL_NAME$4;
675
675
  var count = 0;
676
676
  function useFocusGuards() {
677
677
  React$1.useEffect(() => {
@@ -824,7 +824,7 @@ var effectCar = createSidecarMedium(), nothing = function() {}, RemoveScroll = R
824
824
  onScrollCapture: nothing,
825
825
  onWheelCapture: nothing,
826
826
  onTouchMoveCapture: nothing
827
- }), F = k[0], L = k[1], V = d.forwardProps, U = d.children, K = d.className, q = d.removeScrollBar, J = d.enabled, X = d.shards, $ = d.sideCar, CO = d.noRelative, wO = d.noIsolation, TO = d.inert, EO = d.allowPinchZoom, DO = d.as, OO = DO === void 0 ? "div" : DO, kO = d.gapMode, AO = __rest(d, [
827
+ }), F = k[0], L = k[1], V = d.forwardProps, U = d.children, K = d.className, q = d.removeScrollBar, J = d.enabled, X = d.shards, $ = d.sideCar, PD = d.noRelative, FD = d.noIsolation, ID = d.inert, LD = d.allowPinchZoom, RD = d.as, zD = RD === void 0 ? "div" : RD, BD = d.gapMode, VD = __rest(d, [
828
828
  "forwardProps",
829
829
  "children",
830
830
  "className",
@@ -838,21 +838,21 @@ var effectCar = createSidecarMedium(), nothing = function() {}, RemoveScroll = R
838
838
  "allowPinchZoom",
839
839
  "as",
840
840
  "gapMode"
841
- ]), jO = $, MO = useMergeRefs([w, C]), NO = __assign$2(__assign$2({}, AO), F);
842
- return React$1.createElement(React$1.Fragment, null, J && React$1.createElement(jO, {
841
+ ]), HD = $, UD = useMergeRefs([w, C]), WD = __assign$2(__assign$2({}, VD), F);
842
+ return React$1.createElement(React$1.Fragment, null, J && React$1.createElement(HD, {
843
843
  sideCar: effectCar,
844
844
  removeScrollBar: q,
845
845
  shards: X,
846
- noRelative: CO,
847
- noIsolation: wO,
848
- inert: TO,
846
+ noRelative: PD,
847
+ noIsolation: FD,
848
+ inert: ID,
849
849
  setCallbacks: L,
850
- allowPinchZoom: !!EO,
850
+ allowPinchZoom: !!LD,
851
851
  lockRef: w,
852
- gapMode: kO
853
- }), V ? React$1.cloneElement(React$1.Children.only(U), __assign$2(__assign$2({}, NO), { ref: MO })) : React$1.createElement(OO, __assign$2({}, NO, {
852
+ gapMode: BD
853
+ }), V ? React$1.cloneElement(React$1.Children.only(U), __assign$2(__assign$2({}, WD), { ref: UD })) : React$1.createElement(zD, __assign$2({}, WD, {
854
854
  className: K,
855
- ref: MO
855
+ ref: UD
856
856
  }), U));
857
857
  });
858
858
  RemoveScroll.defaultProps = {
@@ -1040,10 +1040,10 @@ var nonPassive = passiveSupported ? { passive: !1 } : !1, alwaysContainsScroll =
1040
1040
  var F = getDirectionFactor(s, window.getComputedStyle(d).direction), L = F * w, V = C.target, U = d.contains(V), K = !1, q = L > 0, J = 0, X = 0;
1041
1041
  do {
1042
1042
  if (!V) break;
1043
- var $ = getScrollVariables(s, V), CO = $[0], wO = $[1] - $[2] - F * CO;
1044
- (CO || wO) && elementCouldBeScrolled(s, V) && (J += wO, X += CO);
1045
- var TO = V.parentNode;
1046
- V = TO && TO.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? TO.host : TO;
1043
+ var $ = getScrollVariables(s, V), PD = $[0], FD = $[1] - $[2] - F * PD;
1044
+ (PD || FD) && elementCouldBeScrolled(s, V) && (J += FD, X += PD);
1045
+ var ID = V.parentNode;
1046
+ V = ID && ID.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? ID.host : ID;
1047
1047
  } while (!U && V !== document.body || U && (d.contains(V) || d === V));
1048
1048
  return (q && (k && Math.abs(J) < 1 || !k && L > J) || !q && (k && Math.abs(X) < 1 || !k && -L > X)) && (K = !0), K;
1049
1049
  }, getTouchXY = function(s) {
@@ -1087,12 +1087,12 @@ function RemoveScrollSideCar(d) {
1087
1087
  if ("touches" in s && J === "h" && q.type === "range") return !1;
1088
1088
  var X = window.getSelection(), $ = X && X.anchorNode;
1089
1089
  if ($ && ($ === q || $.contains(q))) return !1;
1090
- var CO = locationCouldBeScrolled(J, q);
1091
- if (!CO) return !0;
1092
- if (CO ? K = J : (K = J === "v" ? "h" : "v", CO = locationCouldBeScrolled(J, q)), !CO) return !1;
1090
+ var PD = locationCouldBeScrolled(J, q);
1091
+ if (!PD) return !0;
1092
+ if (PD ? K = J : (K = J === "v" ? "h" : "v", PD = locationCouldBeScrolled(J, q)), !PD) return !1;
1093
1093
  if (!k.current && "changedTouches" in s && (L || U) && (k.current = K), !K) return !0;
1094
- var wO = k.current || K;
1095
- return handleScroll(wO, d, s, wO === "h" ? L : U, !0);
1094
+ var FD = k.current || K;
1095
+ return handleScroll(FD, d, s, FD === "h" ? L : U, !0);
1096
1096
  }, []), K = React$1.useCallback(function(s) {
1097
1097
  var d = s;
1098
1098
  if (!(!lockStack.length || lockStack[lockStack.length - 1] !== L)) {
@@ -1141,8 +1141,8 @@ function RemoveScrollSideCar(d) {
1141
1141
  }), document.removeEventListener("wheel", K, nonPassive), document.removeEventListener("touchmove", K, nonPassive), document.removeEventListener("touchstart", J, nonPassive);
1142
1142
  };
1143
1143
  }, []);
1144
- var CO = d.removeScrollBar, wO = d.inert;
1145
- return React$1.createElement(React$1.Fragment, null, wO ? React$1.createElement(L, { styles: generateStyle(F) }) : null, CO ? React$1.createElement(RemoveScrollBar, {
1144
+ var PD = d.removeScrollBar, FD = d.inert;
1145
+ return React$1.createElement(React$1.Fragment, null, FD ? React$1.createElement(L, { styles: generateStyle(F) }) : null, PD ? React$1.createElement(RemoveScrollBar, {
1146
1146
  noRelative: d.noRelative,
1147
1147
  gapMode: d.gapMode
1148
1148
  }) : null);
@@ -1222,8 +1222,8 @@ var Combination_default = ReactRemoveScroll, getDefaultParent = function(s) {
1222
1222
  });
1223
1223
  };
1224
1224
  Dialog.displayName = DIALOG_NAME;
1225
- var TRIGGER_NAME$3 = "DialogTrigger", DialogTrigger = React$1.forwardRef((s, d) => {
1226
- let { __scopeDialog: C, ...w } = s, k = useDialogContext(TRIGGER_NAME$3, C), F = useComposedRefs(d, k.triggerRef);
1225
+ var TRIGGER_NAME$2 = "DialogTrigger", DialogTrigger = React$1.forwardRef((s, d) => {
1226
+ let { __scopeDialog: C, ...w } = s, k = useDialogContext(TRIGGER_NAME$2, C), F = useComposedRefs(d, k.triggerRef);
1227
1227
  return /* @__PURE__ */ jsx(Primitive.button, {
1228
1228
  type: "button",
1229
1229
  "aria-haspopup": "dialog",
@@ -1235,9 +1235,9 @@ var TRIGGER_NAME$3 = "DialogTrigger", DialogTrigger = React$1.forwardRef((s, d)
1235
1235
  onClick: composeEventHandlers(s.onClick, k.onOpenToggle)
1236
1236
  });
1237
1237
  });
1238
- DialogTrigger.displayName = TRIGGER_NAME$3;
1239
- var PORTAL_NAME$4 = "DialogPortal", [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$4, { forceMount: void 0 }), DialogPortal = (d) => {
1240
- let { __scopeDialog: C, forceMount: w, children: k, container: F } = d, L = useDialogContext(PORTAL_NAME$4, C);
1238
+ DialogTrigger.displayName = TRIGGER_NAME$2;
1239
+ var PORTAL_NAME$3 = "DialogPortal", [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$3, { forceMount: void 0 }), DialogPortal = (d) => {
1240
+ let { __scopeDialog: C, forceMount: w, children: k, container: F } = d, L = useDialogContext(PORTAL_NAME$3, C);
1241
1241
  return /* @__PURE__ */ jsx(PortalProvider$2, {
1242
1242
  scope: C,
1243
1243
  forceMount: w,
@@ -1251,7 +1251,7 @@ var PORTAL_NAME$4 = "DialogPortal", [PortalProvider$2, usePortalContext$2] = cre
1251
1251
  }))
1252
1252
  });
1253
1253
  };
1254
- DialogPortal.displayName = PORTAL_NAME$4;
1254
+ DialogPortal.displayName = PORTAL_NAME$3;
1255
1255
  var OVERLAY_NAME = "DialogOverlay", DialogOverlay = React$1.forwardRef((s, d) => {
1256
1256
  let C = usePortalContext$2(OVERLAY_NAME, s.__scopeDialog), { forceMount: w = C.forceMount, ...k } = s, F = useDialogContext(OVERLAY_NAME, s.__scopeDialog);
1257
1257
  return F.modal ? /* @__PURE__ */ jsx(Presence, {
@@ -1279,8 +1279,8 @@ var Slot$1 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll"), DialogOve
1279
1279
  }
1280
1280
  })
1281
1281
  });
1282
- }), CONTENT_NAME$5 = "DialogContent", DialogContent = React$1.forwardRef((s, d) => {
1283
- let C = usePortalContext$2(CONTENT_NAME$5, s.__scopeDialog), { forceMount: w = C.forceMount, ...k } = s, F = useDialogContext(CONTENT_NAME$5, s.__scopeDialog);
1282
+ }), CONTENT_NAME$4 = "DialogContent", DialogContent = React$1.forwardRef((s, d) => {
1283
+ let C = usePortalContext$2(CONTENT_NAME$4, s.__scopeDialog), { forceMount: w = C.forceMount, ...k } = s, F = useDialogContext(CONTENT_NAME$4, s.__scopeDialog);
1284
1284
  return /* @__PURE__ */ jsx(Presence, {
1285
1285
  present: w || F.open,
1286
1286
  children: F.modal ? /* @__PURE__ */ jsx(DialogContentModal, {
@@ -1292,9 +1292,9 @@ var Slot$1 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll"), DialogOve
1292
1292
  })
1293
1293
  });
1294
1294
  });
1295
- DialogContent.displayName = CONTENT_NAME$5;
1295
+ DialogContent.displayName = CONTENT_NAME$4;
1296
1296
  var DialogContentModal = React$1.forwardRef((d, C) => {
1297
- let w = useDialogContext(CONTENT_NAME$5, d.__scopeDialog), k = React$1.useRef(null), F = useComposedRefs(C, w.contentRef, k);
1297
+ let w = useDialogContext(CONTENT_NAME$4, d.__scopeDialog), k = React$1.useRef(null), F = useComposedRefs(C, w.contentRef, k);
1298
1298
  return React$1.useEffect(() => {
1299
1299
  let s = k.current;
1300
1300
  if (s) return hideOthers(s);
@@ -1313,7 +1313,7 @@ var DialogContentModal = React$1.forwardRef((d, C) => {
1313
1313
  onFocusOutside: composeEventHandlers(d.onFocusOutside, (s) => s.preventDefault())
1314
1314
  });
1315
1315
  }), DialogContentNonModal = React$1.forwardRef((d, C) => {
1316
- let w = useDialogContext(CONTENT_NAME$5, d.__scopeDialog), k = React$1.useRef(!1), F = React$1.useRef(!1);
1316
+ let w = useDialogContext(CONTENT_NAME$4, d.__scopeDialog), k = React$1.useRef(!1), F = React$1.useRef(!1);
1317
1317
  return /* @__PURE__ */ jsx(DialogContentImpl, {
1318
1318
  ...d,
1319
1319
  ref: C,
@@ -1329,7 +1329,7 @@ var DialogContentModal = React$1.forwardRef((d, C) => {
1329
1329
  }
1330
1330
  });
1331
1331
  }), DialogContentImpl = React$1.forwardRef((d, C) => {
1332
- let { __scopeDialog: w, trapFocus: k, onOpenAutoFocus: F, onCloseAutoFocus: L, ...V } = d, U = useDialogContext(CONTENT_NAME$5, w), K = React$1.useRef(null), q = useComposedRefs(C, K);
1332
+ let { __scopeDialog: w, trapFocus: k, onOpenAutoFocus: F, onCloseAutoFocus: L, ...V } = d, U = useDialogContext(CONTENT_NAME$4, w), K = React$1.useRef(null), q = useComposedRefs(C, K);
1333
1333
  return useFocusGuards(), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FocusScope, {
1334
1334
  asChild: !0,
1335
1335
  loop: !0,
@@ -1382,7 +1382,7 @@ function getState(s) {
1382
1382
  return s ? "open" : "closed";
1383
1383
  }
1384
1384
  var TITLE_WARNING_NAME = "DialogTitleWarning", [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
1385
- contentName: CONTENT_NAME$5,
1385
+ contentName: CONTENT_NAME$4,
1386
1386
  titleName: TITLE_NAME,
1387
1387
  docsSlug: "dialog"
1388
1388
  }), TitleWarning = ({ titleId: d }) => {
@@ -1404,7 +1404,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${C.do
1404
1404
  d,
1405
1405
  C
1406
1406
  ]), null;
1407
- }, Root$3 = Dialog, Trigger$2 = DialogTrigger, Portal$2 = DialogPortal, Overlay = DialogOverlay, Content$1 = DialogContent, Title = DialogTitle, Description = DialogDescription, Close = DialogClose;
1407
+ }, Root$3 = Dialog, Trigger$1 = DialogTrigger, Portal$2 = DialogPortal, Overlay = DialogOverlay, Content$1 = DialogContent, Title = DialogTitle, Description = DialogDescription, Close = DialogClose;
1408
1408
  function useSize(d) {
1409
1409
  let [C, w] = React$1.useState(void 0);
1410
1410
  return useLayoutEffect2(() => {
@@ -1581,9 +1581,9 @@ var computePosition$1 = async (s, d, C) => {
1581
1581
  reference: s,
1582
1582
  floating: d,
1583
1583
  strategy: k
1584
- }), { x: q, y: J } = computeCoordsFromPlacement(K, w, U), X = w, $ = {}, CO = 0;
1584
+ }), { x: q, y: J } = computeCoordsFromPlacement(K, w, U), X = w, $ = {}, PD = 0;
1585
1585
  for (let C = 0; C < V.length; C++) {
1586
- let { name: F, fn: wO } = V[C], { x: TO, y: EO, data: DO, reset: OO } = await wO({
1586
+ let { name: F, fn: FD } = V[C], { x: ID, y: LD, data: RD, reset: zD } = await FD({
1587
1587
  x: q,
1588
1588
  y: J,
1589
1589
  initialPlacement: w,
@@ -1597,17 +1597,17 @@ var computePosition$1 = async (s, d, C) => {
1597
1597
  floating: d
1598
1598
  }
1599
1599
  });
1600
- q = TO ?? q, J = EO ?? J, $ = {
1600
+ q = ID ?? q, J = LD ?? J, $ = {
1601
1601
  ...$,
1602
1602
  [F]: {
1603
1603
  ...$[F],
1604
- ...DO
1604
+ ...RD
1605
1605
  }
1606
- }, OO && CO <= 50 && (CO++, typeof OO == "object" && (OO.placement && (X = OO.placement), OO.rects && (K = OO.rects === !0 ? await L.getElementRects({
1606
+ }, zD && PD <= 50 && (PD++, typeof zD == "object" && (zD.placement && (X = zD.placement), zD.rects && (K = zD.rects === !0 ? await L.getElementRects({
1607
1607
  reference: s,
1608
1608
  floating: d,
1609
1609
  strategy: k
1610
- }) : OO.rects), {x: q, y: J} = computeCoordsFromPlacement(K, X, U)), C = -1);
1610
+ }) : zD.rects), {x: q, y: J} = computeCoordsFromPlacement(K, X, U)), C = -1);
1611
1611
  }
1612
1612
  return {
1613
1613
  x: q,
@@ -1619,30 +1619,30 @@ var computePosition$1 = async (s, d, C) => {
1619
1619
  };
1620
1620
  async function detectOverflow$1(s, d) {
1621
1621
  d === void 0 && (d = {});
1622
- let { x: C, y: w, platform: k, rects: F, elements: L, strategy: V } = s, { boundary: U = "clippingAncestors", rootBoundary: K = "viewport", elementContext: q = "floating", altBoundary: J = !1, padding: X = 0 } = evaluate(d, s), $ = getPaddingObject(X), CO = L[J ? q === "floating" ? "reference" : "floating" : q], wO = rectToClientRect(await k.getClippingRect({
1623
- element: await (k.isElement == null ? void 0 : k.isElement(CO)) ?? !0 ? CO : CO.contextElement || await (k.getDocumentElement == null ? void 0 : k.getDocumentElement(L.floating)),
1622
+ let { x: C, y: w, platform: k, rects: F, elements: L, strategy: V } = s, { boundary: U = "clippingAncestors", rootBoundary: K = "viewport", elementContext: q = "floating", altBoundary: J = !1, padding: X = 0 } = evaluate(d, s), $ = getPaddingObject(X), PD = L[J ? q === "floating" ? "reference" : "floating" : q], FD = rectToClientRect(await k.getClippingRect({
1623
+ element: await (k.isElement == null ? void 0 : k.isElement(PD)) ?? !0 ? PD : PD.contextElement || await (k.getDocumentElement == null ? void 0 : k.getDocumentElement(L.floating)),
1624
1624
  boundary: U,
1625
1625
  rootBoundary: K,
1626
1626
  strategy: V
1627
- })), TO = q === "floating" ? {
1627
+ })), ID = q === "floating" ? {
1628
1628
  x: C,
1629
1629
  y: w,
1630
1630
  width: F.floating.width,
1631
1631
  height: F.floating.height
1632
- } : F.reference, EO = await (k.getOffsetParent == null ? void 0 : k.getOffsetParent(L.floating)), DO = await (k.isElement == null ? void 0 : k.isElement(EO)) && await (k.getScale == null ? void 0 : k.getScale(EO)) || {
1632
+ } : F.reference, LD = await (k.getOffsetParent == null ? void 0 : k.getOffsetParent(L.floating)), RD = await (k.isElement == null ? void 0 : k.isElement(LD)) && await (k.getScale == null ? void 0 : k.getScale(LD)) || {
1633
1633
  x: 1,
1634
1634
  y: 1
1635
- }, OO = rectToClientRect(k.convertOffsetParentRelativeRectToViewportRelativeRect ? await k.convertOffsetParentRelativeRectToViewportRelativeRect({
1635
+ }, zD = rectToClientRect(k.convertOffsetParentRelativeRectToViewportRelativeRect ? await k.convertOffsetParentRelativeRectToViewportRelativeRect({
1636
1636
  elements: L,
1637
- rect: TO,
1638
- offsetParent: EO,
1637
+ rect: ID,
1638
+ offsetParent: LD,
1639
1639
  strategy: V
1640
- }) : TO);
1640
+ }) : ID);
1641
1641
  return {
1642
- top: (wO.top - OO.top + $.top) / DO.y,
1643
- bottom: (OO.bottom - wO.bottom + $.bottom) / DO.y,
1644
- left: (wO.left - OO.left + $.left) / DO.x,
1645
- right: (OO.right - wO.right + $.right) / DO.x
1642
+ top: (FD.top - zD.top + $.top) / RD.y,
1643
+ bottom: (zD.bottom - FD.bottom + $.bottom) / RD.y,
1644
+ left: (FD.left - zD.left + $.left) / RD.x,
1645
+ right: (zD.right - FD.right + $.right) / RD.x
1646
1646
  };
1647
1647
  }
1648
1648
  var arrow$2 = (s) => ({
@@ -1654,17 +1654,17 @@ var arrow$2 = (s) => ({
1654
1654
  let J = getPaddingObject(q), X = {
1655
1655
  x: C,
1656
1656
  y: w
1657
- }, $ = getAlignmentAxis(k), CO = getAxisLength($), wO = await L.getDimensions(K), TO = $ === "y", EO = TO ? "top" : "left", DO = TO ? "bottom" : "right", OO = TO ? "clientHeight" : "clientWidth", kO = F.reference[CO] + F.reference[$] - X[$] - F.floating[CO], AO = X[$] - F.reference[$], jO = await (L.getOffsetParent == null ? void 0 : L.getOffsetParent(K)), MO = jO ? jO[OO] : 0;
1658
- (!MO || !await (L.isElement == null ? void 0 : L.isElement(jO))) && (MO = V.floating[OO] || F.floating[CO]);
1659
- let NO = kO / 2 - AO / 2, PO = MO / 2 - wO[CO] / 2 - 1, FO = min(J[EO], PO), IO = min(J[DO], PO), LO = FO, RO = MO - wO[CO] - IO, zO = MO / 2 - wO[CO] / 2 + NO, BO = clamp$3(LO, zO, RO), VO = !U.arrow && getAlignment(k) != null && zO !== BO && F.reference[CO] / 2 - (zO < LO ? FO : IO) - wO[CO] / 2 < 0, HO = VO ? zO < LO ? zO - LO : zO - RO : 0;
1657
+ }, $ = getAlignmentAxis(k), PD = getAxisLength($), FD = await L.getDimensions(K), ID = $ === "y", LD = ID ? "top" : "left", RD = ID ? "bottom" : "right", zD = ID ? "clientHeight" : "clientWidth", BD = F.reference[PD] + F.reference[$] - X[$] - F.floating[PD], VD = X[$] - F.reference[$], HD = await (L.getOffsetParent == null ? void 0 : L.getOffsetParent(K)), UD = HD ? HD[zD] : 0;
1658
+ (!UD || !await (L.isElement == null ? void 0 : L.isElement(HD))) && (UD = V.floating[zD] || F.floating[PD]);
1659
+ let WD = BD / 2 - VD / 2, GD = UD / 2 - FD[PD] / 2 - 1, KD = min(J[LD], GD), qD = min(J[RD], GD), JD = KD, YD = UD - FD[PD] - qD, XD = UD / 2 - FD[PD] / 2 + WD, ZD = clamp$3(JD, XD, YD), QD = !U.arrow && getAlignment(k) != null && XD !== ZD && F.reference[PD] / 2 - (XD < JD ? KD : qD) - FD[PD] / 2 < 0, $D = QD ? XD < JD ? XD - JD : XD - YD : 0;
1660
1660
  return {
1661
- [$]: X[$] + HO,
1661
+ [$]: X[$] + $D,
1662
1662
  data: {
1663
- [$]: BO,
1664
- centerOffset: zO - BO - HO,
1665
- ...VO && { alignmentOffset: HO }
1663
+ [$]: ZD,
1664
+ centerOffset: XD - ZD - $D,
1665
+ ...QD && { alignmentOffset: $D }
1666
1666
  },
1667
- reset: VO
1667
+ reset: QD
1668
1668
  };
1669
1669
  }
1670
1670
  }), flip$2 = function(s) {
@@ -1673,34 +1673,34 @@ var arrow$2 = (s) => ({
1673
1673
  options: s,
1674
1674
  async fn(d) {
1675
1675
  var C;
1676
- let { placement: w, middlewareData: k, rects: F, initialPlacement: L, platform: V, elements: U } = d, { mainAxis: K = !0, crossAxis: q = !0, fallbackPlacements: J, fallbackStrategy: X = "bestFit", fallbackAxisSideDirection: $ = "none", flipAlignment: CO = !0, ...wO } = evaluate(s, d);
1676
+ let { placement: w, middlewareData: k, rects: F, initialPlacement: L, platform: V, elements: U } = d, { mainAxis: K = !0, crossAxis: q = !0, fallbackPlacements: J, fallbackStrategy: X = "bestFit", fallbackAxisSideDirection: $ = "none", flipAlignment: PD = !0, ...FD } = evaluate(s, d);
1677
1677
  if ((C = k.arrow) != null && C.alignmentOffset) return {};
1678
- let TO = getSide(w), EO = getSideAxis(L), DO = getSide(L) === L, OO = await (V.isRTL == null ? void 0 : V.isRTL(U.floating)), kO = J || (DO || !CO ? [getOppositePlacement(L)] : getExpandedPlacements(L)), AO = $ !== "none";
1679
- !J && AO && kO.push(...getOppositeAxisPlacements(L, CO, $, OO));
1680
- let jO = [L, ...kO], MO = await detectOverflow$1(d, wO), NO = [], PO = k.flip?.overflows || [];
1681
- if (K && NO.push(MO[TO]), q) {
1682
- let s = getAlignmentSides(w, F, OO);
1683
- NO.push(MO[s[0]], MO[s[1]]);
1678
+ let ID = getSide(w), LD = getSideAxis(L), RD = getSide(L) === L, zD = await (V.isRTL == null ? void 0 : V.isRTL(U.floating)), BD = J || (RD || !PD ? [getOppositePlacement(L)] : getExpandedPlacements(L)), VD = $ !== "none";
1679
+ !J && VD && BD.push(...getOppositeAxisPlacements(L, PD, $, zD));
1680
+ let HD = [L, ...BD], UD = await detectOverflow$1(d, FD), WD = [], GD = k.flip?.overflows || [];
1681
+ if (K && WD.push(UD[ID]), q) {
1682
+ let s = getAlignmentSides(w, F, zD);
1683
+ WD.push(UD[s[0]], UD[s[1]]);
1684
1684
  }
1685
- if (PO = [...PO, {
1685
+ if (GD = [...GD, {
1686
1686
  placement: w,
1687
- overflows: NO
1688
- }], !NO.every((s) => s <= 0)) {
1689
- let s = (k.flip?.index || 0) + 1, d = jO[s];
1690
- if (d && (!(q === "alignment" && EO !== getSideAxis(d)) || PO.every((s) => getSideAxis(s.placement) === EO ? s.overflows[0] > 0 : !0))) return {
1687
+ overflows: WD
1688
+ }], !WD.every((s) => s <= 0)) {
1689
+ let s = (k.flip?.index || 0) + 1, d = HD[s];
1690
+ if (d && (!(q === "alignment" && LD !== getSideAxis(d)) || GD.every((s) => getSideAxis(s.placement) === LD ? s.overflows[0] > 0 : !0))) return {
1691
1691
  data: {
1692
1692
  index: s,
1693
- overflows: PO
1693
+ overflows: GD
1694
1694
  },
1695
1695
  reset: { placement: d }
1696
1696
  };
1697
- let C = PO.filter((s) => s.overflows[0] <= 0).sort((s, d) => s.overflows[1] - d.overflows[1])[0]?.placement;
1697
+ let C = GD.filter((s) => s.overflows[0] <= 0).sort((s, d) => s.overflows[1] - d.overflows[1])[0]?.placement;
1698
1698
  if (!C) switch (X) {
1699
1699
  case "bestFit": {
1700
- let s = PO.filter((s) => {
1701
- if (AO) {
1700
+ let s = GD.filter((s) => {
1701
+ if (VD) {
1702
1702
  let d = getSideAxis(s.placement);
1703
- return d === EO || d === "y";
1703
+ return d === LD || d === "y";
1704
1704
  }
1705
1705
  return !0;
1706
1706
  }).map((s) => [s.placement, s.overflows.filter((s) => s > 0).reduce((s, d) => s + d, 0)]).sort((s, d) => s[1] - d[1])[0]?.[0];
@@ -1761,7 +1761,7 @@ var hide$2 = function(s) {
1761
1761
  };
1762
1762
  }, originSides = /* @__PURE__ */ new Set(["left", "top"]);
1763
1763
  async function convertValueToCoords(s, d) {
1764
- let { placement: C, platform: w, elements: k } = s, F = await (w.isRTL == null ? void 0 : w.isRTL(k.floating)), L = getSide(C), V = getAlignment(C), U = getSideAxis(C) === "y", K = originSides.has(L) ? -1 : 1, q = F && U ? -1 : 1, J = evaluate(d, s), { mainAxis: X, crossAxis: $, alignmentAxis: CO } = typeof J == "number" ? {
1764
+ let { placement: C, platform: w, elements: k } = s, F = await (w.isRTL == null ? void 0 : w.isRTL(k.floating)), L = getSide(C), V = getAlignment(C), U = getSideAxis(C) === "y", K = originSides.has(L) ? -1 : 1, q = F && U ? -1 : 1, J = evaluate(d, s), { mainAxis: X, crossAxis: $, alignmentAxis: PD } = typeof J == "number" ? {
1765
1765
  mainAxis: J,
1766
1766
  crossAxis: 0,
1767
1767
  alignmentAxis: null
@@ -1770,7 +1770,7 @@ async function convertValueToCoords(s, d) {
1770
1770
  crossAxis: J.crossAxis || 0,
1771
1771
  alignmentAxis: J.alignmentAxis
1772
1772
  };
1773
- return V && typeof CO == "number" && ($ = V === "end" ? CO * -1 : CO), U ? {
1773
+ return V && typeof PD == "number" && ($ = V === "end" ? PD * -1 : PD), U ? {
1774
1774
  x: $ * q,
1775
1775
  y: X * K
1776
1776
  } : {
@@ -1809,25 +1809,25 @@ var offset$2 = function(s) {
1809
1809
  } }, ...U } = evaluate(s, d), K = {
1810
1810
  x: C,
1811
1811
  y: w
1812
- }, q = await detectOverflow$1(d, U), J = getSideAxis(getSide(k)), X = getOppositeAxis(J), $ = K[X], CO = K[J];
1812
+ }, q = await detectOverflow$1(d, U), J = getSideAxis(getSide(k)), X = getOppositeAxis(J), $ = K[X], PD = K[J];
1813
1813
  if (F) {
1814
1814
  let s = X === "y" ? "top" : "left", d = X === "y" ? "bottom" : "right", C = $ + q[s], w = $ - q[d];
1815
1815
  $ = clamp$3(C, $, w);
1816
1816
  }
1817
1817
  if (L) {
1818
- let s = J === "y" ? "top" : "left", d = J === "y" ? "bottom" : "right", C = CO + q[s], w = CO - q[d];
1819
- CO = clamp$3(C, CO, w);
1818
+ let s = J === "y" ? "top" : "left", d = J === "y" ? "bottom" : "right", C = PD + q[s], w = PD - q[d];
1819
+ PD = clamp$3(C, PD, w);
1820
1820
  }
1821
- let wO = V.fn({
1821
+ let FD = V.fn({
1822
1822
  ...d,
1823
1823
  [X]: $,
1824
- [J]: CO
1824
+ [J]: PD
1825
1825
  });
1826
1826
  return {
1827
- ...wO,
1827
+ ...FD,
1828
1828
  data: {
1829
- x: wO.x - C,
1830
- y: wO.y - w,
1829
+ x: FD.x - C,
1830
+ y: FD.y - w,
1831
1831
  enabled: {
1832
1832
  [X]: F,
1833
1833
  [J]: L
@@ -1843,25 +1843,25 @@ var offset$2 = function(s) {
1843
1843
  let { x: C, y: w, placement: k, rects: F, middlewareData: L } = d, { offset: V = 0, mainAxis: U = !0, crossAxis: K = !0 } = evaluate(s, d), q = {
1844
1844
  x: C,
1845
1845
  y: w
1846
- }, J = getSideAxis(k), X = getOppositeAxis(J), $ = q[X], CO = q[J], wO = evaluate(V, d), TO = typeof wO == "number" ? {
1847
- mainAxis: wO,
1846
+ }, J = getSideAxis(k), X = getOppositeAxis(J), $ = q[X], PD = q[J], FD = evaluate(V, d), ID = typeof FD == "number" ? {
1847
+ mainAxis: FD,
1848
1848
  crossAxis: 0
1849
1849
  } : {
1850
1850
  mainAxis: 0,
1851
1851
  crossAxis: 0,
1852
- ...wO
1852
+ ...FD
1853
1853
  };
1854
1854
  if (U) {
1855
- let s = X === "y" ? "height" : "width", d = F.reference[X] - F.floating[s] + TO.mainAxis, C = F.reference[X] + F.reference[s] - TO.mainAxis;
1855
+ let s = X === "y" ? "height" : "width", d = F.reference[X] - F.floating[s] + ID.mainAxis, C = F.reference[X] + F.reference[s] - ID.mainAxis;
1856
1856
  $ < d ? $ = d : $ > C && ($ = C);
1857
1857
  }
1858
1858
  if (K) {
1859
- let s = X === "y" ? "width" : "height", d = originSides.has(getSide(k)), C = F.reference[J] - F.floating[s] + (d && L.offset?.[J] || 0) + (d ? 0 : TO.crossAxis), w = F.reference[J] + F.reference[s] + (d ? 0 : L.offset?.[J] || 0) - (d ? TO.crossAxis : 0);
1860
- CO < C ? CO = C : CO > w && (CO = w);
1859
+ let s = X === "y" ? "width" : "height", d = originSides.has(getSide(k)), C = F.reference[J] - F.floating[s] + (d && L.offset?.[J] || 0) + (d ? 0 : ID.crossAxis), w = F.reference[J] + F.reference[s] + (d ? 0 : L.offset?.[J] || 0) - (d ? ID.crossAxis : 0);
1860
+ PD < C ? PD = C : PD > w && (PD = w);
1861
1861
  }
1862
1862
  return {
1863
1863
  [X]: $,
1864
- [J]: CO
1864
+ [J]: PD
1865
1865
  };
1866
1866
  }
1867
1867
  };
@@ -1871,20 +1871,20 @@ var offset$2 = function(s) {
1871
1871
  options: s,
1872
1872
  async fn(d) {
1873
1873
  var C, w;
1874
- let { placement: k, rects: F, platform: L, elements: V } = d, { apply: U = () => {}, ...K } = evaluate(s, d), q = await detectOverflow$1(d, K), J = getSide(k), X = getAlignment(k), $ = getSideAxis(k) === "y", { width: CO, height: wO } = F.floating, TO, EO;
1875
- J === "top" || J === "bottom" ? (TO = J, EO = X === (await (L.isRTL == null ? void 0 : L.isRTL(V.floating)) ? "start" : "end") ? "left" : "right") : (EO = J, TO = X === "end" ? "top" : "bottom");
1876
- let DO = wO - q.top - q.bottom, OO = CO - q.left - q.right, kO = min(wO - q[TO], DO), AO = min(CO - q[EO], OO), jO = !d.middlewareData.shift, MO = kO, NO = AO;
1877
- if ((C = d.middlewareData.shift) != null && C.enabled.x && (NO = OO), (w = d.middlewareData.shift) != null && w.enabled.y && (MO = DO), jO && !X) {
1874
+ let { placement: k, rects: F, platform: L, elements: V } = d, { apply: U = () => {}, ...K } = evaluate(s, d), q = await detectOverflow$1(d, K), J = getSide(k), X = getAlignment(k), $ = getSideAxis(k) === "y", { width: PD, height: FD } = F.floating, ID, LD;
1875
+ J === "top" || J === "bottom" ? (ID = J, LD = X === (await (L.isRTL == null ? void 0 : L.isRTL(V.floating)) ? "start" : "end") ? "left" : "right") : (LD = J, ID = X === "end" ? "top" : "bottom");
1876
+ let RD = FD - q.top - q.bottom, zD = PD - q.left - q.right, BD = min(FD - q[ID], RD), VD = min(PD - q[LD], zD), HD = !d.middlewareData.shift, UD = BD, WD = VD;
1877
+ if ((C = d.middlewareData.shift) != null && C.enabled.x && (WD = zD), (w = d.middlewareData.shift) != null && w.enabled.y && (UD = RD), HD && !X) {
1878
1878
  let s = max(q.left, 0), d = max(q.right, 0), C = max(q.top, 0), w = max(q.bottom, 0);
1879
- $ ? NO = CO - 2 * (s !== 0 || d !== 0 ? s + d : max(q.left, q.right)) : MO = wO - 2 * (C !== 0 || w !== 0 ? C + w : max(q.top, q.bottom));
1879
+ $ ? WD = PD - 2 * (s !== 0 || d !== 0 ? s + d : max(q.left, q.right)) : UD = FD - 2 * (C !== 0 || w !== 0 ? C + w : max(q.top, q.bottom));
1880
1880
  }
1881
1881
  await U({
1882
1882
  ...d,
1883
- availableWidth: NO,
1884
- availableHeight: MO
1883
+ availableWidth: WD,
1884
+ availableHeight: UD
1885
1885
  });
1886
- let PO = await L.getDimensions(V.floating);
1887
- return CO !== PO.width || wO !== PO.height ? { reset: { rects: !0 } } : {};
1886
+ let GD = await L.getDimensions(V.floating);
1887
+ return PD !== GD.width || FD !== GD.height ? { reset: { rects: !0 } } : {};
1888
1888
  }
1889
1889
  };
1890
1890
  };
@@ -2268,27 +2268,27 @@ function observeMove(s, d) {
2268
2268
  V === void 0 && (V = !1), U === void 0 && (U = 1), F();
2269
2269
  let K = s.getBoundingClientRect(), { left: q, top: J, width: X, height: $ } = K;
2270
2270
  if (V || d(), !X || !$) return;
2271
- let CO = floor(J), wO = floor(k.clientWidth - (q + X)), TO = floor(k.clientHeight - (J + $)), EO = floor(q), DO = {
2272
- rootMargin: -CO + "px " + -wO + "px " + -TO + "px " + -EO + "px",
2271
+ let PD = floor(J), FD = floor(k.clientWidth - (q + X)), ID = floor(k.clientHeight - (J + $)), LD = floor(q), RD = {
2272
+ rootMargin: -PD + "px " + -FD + "px " + -ID + "px " + -LD + "px",
2273
2273
  threshold: max(0, min(1, U)) || 1
2274
- }, OO = !0;
2275
- function kO(d) {
2274
+ }, zD = !0;
2275
+ function BD(d) {
2276
2276
  let C = d[0].intersectionRatio;
2277
2277
  if (C !== U) {
2278
- if (!OO) return L();
2278
+ if (!zD) return L();
2279
2279
  C ? L(!1, C) : w = setTimeout(() => {
2280
2280
  L(!1, 1e-7);
2281
2281
  }, 1e3);
2282
2282
  }
2283
- C === 1 && !rectsAreEqual(K, s.getBoundingClientRect()) && L(), OO = !1;
2283
+ C === 1 && !rectsAreEqual(K, s.getBoundingClientRect()) && L(), zD = !1;
2284
2284
  }
2285
2285
  try {
2286
- C = new IntersectionObserver(kO, {
2287
- ...DO,
2286
+ C = new IntersectionObserver(BD, {
2287
+ ...RD,
2288
2288
  root: k.ownerDocument
2289
2289
  });
2290
2290
  } catch {
2291
- C = new IntersectionObserver(kO, DO);
2291
+ C = new IntersectionObserver(BD, RD);
2292
2292
  }
2293
2293
  C.observe(s);
2294
2294
  }
@@ -2308,17 +2308,17 @@ function autoUpdate(s, d, C, w) {
2308
2308
  (s = $) == null || s.observe(d);
2309
2309
  })), C();
2310
2310
  }), K && !U && $.observe(K), $.observe(d));
2311
- let CO, wO = U ? getBoundingClientRect(s) : null;
2312
- U && TO();
2313
- function TO() {
2311
+ let PD, FD = U ? getBoundingClientRect(s) : null;
2312
+ U && ID();
2313
+ function ID() {
2314
2314
  let d = getBoundingClientRect(s);
2315
- wO && !rectsAreEqual(wO, d) && C(), wO = d, CO = requestAnimationFrame(TO);
2315
+ FD && !rectsAreEqual(FD, d) && C(), FD = d, PD = requestAnimationFrame(ID);
2316
2316
  }
2317
2317
  return C(), () => {
2318
2318
  var s;
2319
2319
  q.forEach((s) => {
2320
2320
  k && s.removeEventListener("scroll", C), F && s.removeEventListener("resize", C);
2321
- }), J?.(), (s = $) == null || s.disconnect(), $ = null, U && cancelAnimationFrame(CO);
2321
+ }), J?.(), (s = $) == null || s.disconnect(), $ = null, U && cancelAnimationFrame(PD);
2322
2322
  };
2323
2323
  }
2324
2324
  var offset$1 = offset$2, shift$1 = shift$2, flip$1 = flip$2, size$1 = size$2, hide$1 = hide$2, arrow$1 = arrow$2, limitShift$1 = limitShift$2, computePosition = (s, d, C) => {
@@ -2377,25 +2377,25 @@ function useFloating(d) {
2377
2377
  placement: C,
2378
2378
  middlewareData: {},
2379
2379
  isPositioned: !1
2380
- }), [$, CO] = React$1.useState(k);
2381
- deepEqual($, k) || CO(k);
2382
- let [wO, TO] = React$1.useState(null), [EO, DO] = React$1.useState(null), kO = React$1.useCallback((s) => {
2383
- s !== NO.current && (NO.current = s, TO(s));
2384
- }, []), AO = React$1.useCallback((s) => {
2385
- s !== PO.current && (PO.current = s, DO(s));
2386
- }, []), jO = L || wO, MO = V || EO, NO = React$1.useRef(null), PO = React$1.useRef(null), FO = React$1.useRef(J), IO = K != null, LO = useLatestRef(K), RO = useLatestRef(F), zO = useLatestRef(q), BO = React$1.useCallback(() => {
2387
- if (!NO.current || !PO.current) return;
2380
+ }), [$, PD] = React$1.useState(k);
2381
+ deepEqual($, k) || PD(k);
2382
+ let [FD, ID] = React$1.useState(null), [LD, RD] = React$1.useState(null), BD = React$1.useCallback((s) => {
2383
+ s !== WD.current && (WD.current = s, ID(s));
2384
+ }, []), VD = React$1.useCallback((s) => {
2385
+ s !== GD.current && (GD.current = s, RD(s));
2386
+ }, []), HD = L || FD, UD = V || LD, WD = React$1.useRef(null), GD = React$1.useRef(null), KD = React$1.useRef(J), qD = K != null, JD = useLatestRef(K), YD = useLatestRef(F), XD = useLatestRef(q), ZD = React$1.useCallback(() => {
2387
+ if (!WD.current || !GD.current) return;
2388
2388
  let s = {
2389
2389
  placement: C,
2390
2390
  strategy: w,
2391
2391
  middleware: $
2392
2392
  };
2393
- RO.current && (s.platform = RO.current), computePosition(NO.current, PO.current, s).then((s) => {
2393
+ YD.current && (s.platform = YD.current), computePosition(WD.current, GD.current, s).then((s) => {
2394
2394
  let d = {
2395
2395
  ...s,
2396
- isPositioned: zO.current !== !1
2396
+ isPositioned: XD.current !== !1
2397
2397
  };
2398
- VO.current && !deepEqual(FO.current, d) && (FO.current = d, ReactDOM$1.flushSync(() => {
2398
+ QD.current && !deepEqual(KD.current, d) && (KD.current = d, ReactDOM$1.flushSync(() => {
2399
2399
  X(d);
2400
2400
  }));
2401
2401
  });
@@ -2403,50 +2403,50 @@ function useFloating(d) {
2403
2403
  $,
2404
2404
  C,
2405
2405
  w,
2406
- RO,
2407
- zO
2406
+ YD,
2407
+ XD
2408
2408
  ]);
2409
2409
  index(() => {
2410
- q === !1 && FO.current.isPositioned && (FO.current.isPositioned = !1, X((s) => ({
2410
+ q === !1 && KD.current.isPositioned && (KD.current.isPositioned = !1, X((s) => ({
2411
2411
  ...s,
2412
2412
  isPositioned: !1
2413
2413
  })));
2414
2414
  }, [q]);
2415
- let VO = React$1.useRef(!1);
2416
- index(() => (VO.current = !0, () => {
2417
- VO.current = !1;
2415
+ let QD = React$1.useRef(!1);
2416
+ index(() => (QD.current = !0, () => {
2417
+ QD.current = !1;
2418
2418
  }), []), index(() => {
2419
- if (jO && (NO.current = jO), MO && (PO.current = MO), jO && MO) {
2420
- if (LO.current) return LO.current(jO, MO, BO);
2421
- BO();
2419
+ if (HD && (WD.current = HD), UD && (GD.current = UD), HD && UD) {
2420
+ if (JD.current) return JD.current(HD, UD, ZD);
2421
+ ZD();
2422
2422
  }
2423
2423
  }, [
2424
- jO,
2425
- MO,
2426
- BO,
2427
- LO,
2428
- IO
2424
+ HD,
2425
+ UD,
2426
+ ZD,
2427
+ JD,
2428
+ qD
2429
2429
  ]);
2430
- let HO = React$1.useMemo(() => ({
2431
- reference: NO,
2432
- floating: PO,
2433
- setReference: kO,
2434
- setFloating: AO
2435
- }), [kO, AO]), UO = React$1.useMemo(() => ({
2436
- reference: jO,
2437
- floating: MO
2438
- }), [jO, MO]), WO = React$1.useMemo(() => {
2430
+ let $D = React$1.useMemo(() => ({
2431
+ reference: WD,
2432
+ floating: GD,
2433
+ setReference: BD,
2434
+ setFloating: VD
2435
+ }), [BD, VD]), eO = React$1.useMemo(() => ({
2436
+ reference: HD,
2437
+ floating: UD
2438
+ }), [HD, UD]), tO = React$1.useMemo(() => {
2439
2439
  let s = {
2440
2440
  position: w,
2441
2441
  left: 0,
2442
2442
  top: 0
2443
2443
  };
2444
- if (!UO.floating) return s;
2445
- let d = roundByDPR(UO.floating, J.x), C = roundByDPR(UO.floating, J.y);
2444
+ if (!eO.floating) return s;
2445
+ let d = roundByDPR(eO.floating, J.x), C = roundByDPR(eO.floating, J.y);
2446
2446
  return U ? {
2447
2447
  ...s,
2448
2448
  transform: "translate(" + d + "px, " + C + "px)",
2449
- ...getDPR(UO.floating) >= 1.5 && { willChange: "transform" }
2449
+ ...getDPR(eO.floating) >= 1.5 && { willChange: "transform" }
2450
2450
  } : {
2451
2451
  position: w,
2452
2452
  left: d,
@@ -2455,22 +2455,22 @@ function useFloating(d) {
2455
2455
  }, [
2456
2456
  w,
2457
2457
  U,
2458
- UO.floating,
2458
+ eO.floating,
2459
2459
  J.x,
2460
2460
  J.y
2461
2461
  ]);
2462
2462
  return React$1.useMemo(() => ({
2463
2463
  ...J,
2464
- update: BO,
2465
- refs: HO,
2466
- elements: UO,
2467
- floatingStyles: WO
2464
+ update: ZD,
2465
+ refs: $D,
2466
+ elements: eO,
2467
+ floatingStyles: tO
2468
2468
  }), [
2469
2469
  J,
2470
- BO,
2471
- HO,
2472
- UO,
2473
- WO
2470
+ ZD,
2471
+ $D,
2472
+ eO,
2473
+ tO
2474
2474
  ]);
2475
2475
  }
2476
2476
  var arrow$1$1 = (s) => {
@@ -2546,71 +2546,71 @@ var ANCHOR_NAME$1 = "PopperAnchor", PopperAnchor = React$1.forwardRef((d, C) =>
2546
2546
  });
2547
2547
  });
2548
2548
  PopperAnchor.displayName = ANCHOR_NAME$1;
2549
- var CONTENT_NAME$4 = "PopperContent", [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$4), PopperContent = React$1.forwardRef((d, C) => {
2550
- let { __scopePopper: w, side: k = "bottom", sideOffset: F = 0, align: L = "center", alignOffset: V = 0, arrowPadding: U = 0, avoidCollisions: K = !0, collisionBoundary: q = [], collisionPadding: J = 0, sticky: X = "partial", hideWhenDetached: $ = !1, updatePositionStrategy: CO = "optimized", onPlaced: wO, ...TO } = d, EO = usePopperContext(CONTENT_NAME$4, w), [DO, OO] = React$1.useState(null), kO = useComposedRefs(C, (s) => OO(s)), [AO, jO] = React$1.useState(null), NO = useSize(AO), PO = NO?.width ?? 0, FO = NO?.height ?? 0, IO = k + (L === "center" ? "" : "-" + L), LO = typeof J == "number" ? J : {
2549
+ var CONTENT_NAME$3 = "PopperContent", [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$3), PopperContent = React$1.forwardRef((d, C) => {
2550
+ let { __scopePopper: w, side: k = "bottom", sideOffset: F = 0, align: L = "center", alignOffset: V = 0, arrowPadding: U = 0, avoidCollisions: K = !0, collisionBoundary: q = [], collisionPadding: J = 0, sticky: X = "partial", hideWhenDetached: $ = !1, updatePositionStrategy: PD = "optimized", onPlaced: FD, ...ID } = d, LD = usePopperContext(CONTENT_NAME$3, w), [RD, zD] = React$1.useState(null), BD = useComposedRefs(C, (s) => zD(s)), [VD, HD] = React$1.useState(null), UD = useSize(VD), GD = UD?.width ?? 0, KD = UD?.height ?? 0, qD = k + (L === "center" ? "" : "-" + L), JD = typeof J == "number" ? J : {
2551
2551
  top: 0,
2552
2552
  right: 0,
2553
2553
  bottom: 0,
2554
2554
  left: 0,
2555
2555
  ...J
2556
- }, RO = Array.isArray(q) ? q : [q], zO = RO.length > 0, BO = {
2557
- padding: LO,
2558
- boundary: RO.filter(isNotNull$2),
2559
- altBoundary: zO
2560
- }, { refs: VO, floatingStyles: HO, placement: UO, isPositioned: WO, middlewareData: GO } = useFloating({
2556
+ }, YD = Array.isArray(q) ? q : [q], XD = YD.length > 0, ZD = {
2557
+ padding: JD,
2558
+ boundary: YD.filter(isNotNull$2),
2559
+ altBoundary: XD
2560
+ }, { refs: QD, floatingStyles: $D, placement: eO, isPositioned: tO, middlewareData: nO } = useFloating({
2561
2561
  strategy: "fixed",
2562
- placement: IO,
2563
- whileElementsMounted: (...s) => autoUpdate(...s, { animationFrame: CO === "always" }),
2564
- elements: { reference: EO.anchor },
2562
+ placement: qD,
2563
+ whileElementsMounted: (...s) => autoUpdate(...s, { animationFrame: PD === "always" }),
2564
+ elements: { reference: LD.anchor },
2565
2565
  middleware: [
2566
2566
  offset({
2567
- mainAxis: F + FO,
2567
+ mainAxis: F + KD,
2568
2568
  alignmentAxis: V
2569
2569
  }),
2570
2570
  K && shift({
2571
2571
  mainAxis: !0,
2572
2572
  crossAxis: !1,
2573
2573
  limiter: X === "partial" ? limitShift() : void 0,
2574
- ...BO
2574
+ ...ZD
2575
2575
  }),
2576
- K && flip({ ...BO }),
2576
+ K && flip({ ...ZD }),
2577
2577
  size({
2578
- ...BO,
2578
+ ...ZD,
2579
2579
  apply: ({ elements: s, rects: d, availableWidth: C, availableHeight: w }) => {
2580
2580
  let { width: k, height: F } = d.reference, L = s.floating.style;
2581
2581
  L.setProperty("--radix-popper-available-width", `${C}px`), L.setProperty("--radix-popper-available-height", `${w}px`), L.setProperty("--radix-popper-anchor-width", `${k}px`), L.setProperty("--radix-popper-anchor-height", `${F}px`);
2582
2582
  }
2583
2583
  }),
2584
- AO && arrow({
2585
- element: AO,
2584
+ VD && arrow({
2585
+ element: VD,
2586
2586
  padding: U
2587
2587
  }),
2588
2588
  transformOrigin({
2589
- arrowWidth: PO,
2590
- arrowHeight: FO
2589
+ arrowWidth: GD,
2590
+ arrowHeight: KD
2591
2591
  }),
2592
2592
  $ && hide({
2593
2593
  strategy: "referenceHidden",
2594
- ...BO
2594
+ ...ZD
2595
2595
  })
2596
2596
  ]
2597
- }), [KO, qO] = getSideAndAlignFromPlacement(UO), JO = useCallbackRef(wO);
2597
+ }), [rO, iO] = getSideAndAlignFromPlacement(eO), aO = useCallbackRef(FD);
2598
2598
  useLayoutEffect2(() => {
2599
- WO && JO?.();
2600
- }, [WO, JO]);
2601
- let YO = GO.arrow?.x, XO = GO.arrow?.y, ZO = GO.arrow?.centerOffset !== 0, [QO, $O] = React$1.useState();
2599
+ tO && aO?.();
2600
+ }, [tO, aO]);
2601
+ let oO = nO.arrow?.x, sO = nO.arrow?.y, cO = nO.arrow?.centerOffset !== 0, [lO, uO] = React$1.useState();
2602
2602
  return useLayoutEffect2(() => {
2603
- DO && $O(window.getComputedStyle(DO).zIndex);
2604
- }, [DO]), /* @__PURE__ */ jsx("div", {
2605
- ref: VO.setFloating,
2603
+ RD && uO(window.getComputedStyle(RD).zIndex);
2604
+ }, [RD]), /* @__PURE__ */ jsx("div", {
2605
+ ref: QD.setFloating,
2606
2606
  "data-radix-popper-content-wrapper": "",
2607
2607
  style: {
2608
- ...HO,
2609
- transform: WO ? HO.transform : "translate(0, -200%)",
2608
+ ...$D,
2609
+ transform: tO ? $D.transform : "translate(0, -200%)",
2610
2610
  minWidth: "max-content",
2611
- zIndex: QO,
2612
- "--radix-popper-transform-origin": [GO.transformOrigin?.x, GO.transformOrigin?.y].join(" "),
2613
- ...GO.hide?.referenceHidden && {
2611
+ zIndex: lO,
2612
+ "--radix-popper-transform-origin": [nO.transformOrigin?.x, nO.transformOrigin?.y].join(" "),
2613
+ ...nO.hide?.referenceHidden && {
2614
2614
  visibility: "hidden",
2615
2615
  pointerEvents: "none"
2616
2616
  }
@@ -2618,32 +2618,32 @@ var CONTENT_NAME$4 = "PopperContent", [PopperContentProvider, useContentContext]
2618
2618
  dir: d.dir,
2619
2619
  children: /* @__PURE__ */ jsx(PopperContentProvider, {
2620
2620
  scope: w,
2621
- placedSide: KO,
2622
- onArrowChange: jO,
2623
- arrowX: YO,
2624
- arrowY: XO,
2625
- shouldHideArrow: ZO,
2621
+ placedSide: rO,
2622
+ onArrowChange: HD,
2623
+ arrowX: oO,
2624
+ arrowY: sO,
2625
+ shouldHideArrow: cO,
2626
2626
  children: /* @__PURE__ */ jsx(Primitive.div, {
2627
- "data-side": KO,
2628
- "data-align": qO,
2629
- ...TO,
2630
- ref: kO,
2627
+ "data-side": rO,
2628
+ "data-align": iO,
2629
+ ...ID,
2630
+ ref: BD,
2631
2631
  style: {
2632
- ...TO.style,
2633
- animation: WO ? void 0 : "none"
2632
+ ...ID.style,
2633
+ animation: tO ? void 0 : "none"
2634
2634
  }
2635
2635
  })
2636
2636
  })
2637
2637
  });
2638
2638
  });
2639
- PopperContent.displayName = CONTENT_NAME$4;
2640
- var ARROW_NAME$4 = "PopperArrow", OPPOSITE_SIDE = {
2639
+ PopperContent.displayName = CONTENT_NAME$3;
2640
+ var ARROW_NAME$3 = "PopperArrow", OPPOSITE_SIDE = {
2641
2641
  top: "bottom",
2642
2642
  right: "left",
2643
2643
  bottom: "top",
2644
2644
  left: "right"
2645
2645
  }, PopperArrow = React$1.forwardRef(function(s, d) {
2646
- let { __scopePopper: C, ...w } = s, k = useContentContext(ARROW_NAME$4, C), F = OPPOSITE_SIDE[k.placedSide];
2646
+ let { __scopePopper: C, ...w } = s, k = useContentContext(ARROW_NAME$3, C), F = OPPOSITE_SIDE[k.placedSide];
2647
2647
  return /* @__PURE__ */ jsx("span", {
2648
2648
  ref: k.onArrowChange,
2649
2649
  style: {
@@ -2675,7 +2675,7 @@ var ARROW_NAME$4 = "PopperArrow", OPPOSITE_SIDE = {
2675
2675
  })
2676
2676
  });
2677
2677
  });
2678
- PopperArrow.displayName = ARROW_NAME$4;
2678
+ PopperArrow.displayName = ARROW_NAME$3;
2679
2679
  function isNotNull$2(s) {
2680
2680
  return s !== null;
2681
2681
  }
@@ -2687,10 +2687,10 @@ var transformOrigin = (s) => ({
2687
2687
  start: "0%",
2688
2688
  center: "50%",
2689
2689
  end: "100%"
2690
- }[K], J = (k.arrow?.x ?? 0) + L / 2, X = (k.arrow?.y ?? 0) + V / 2, $ = "", CO = "";
2691
- return U === "bottom" ? ($ = F ? q : `${J}px`, CO = `${-V}px`) : U === "top" ? ($ = F ? q : `${J}px`, CO = `${w.floating.height + V}px`) : U === "right" ? ($ = `${-V}px`, CO = F ? q : `${X}px`) : U === "left" && ($ = `${w.floating.width + V}px`, CO = F ? q : `${X}px`), { data: {
2690
+ }[K], J = (k.arrow?.x ?? 0) + L / 2, X = (k.arrow?.y ?? 0) + V / 2, $ = "", PD = "";
2691
+ return U === "bottom" ? ($ = F ? q : `${J}px`, PD = `${-V}px`) : U === "top" ? ($ = F ? q : `${J}px`, PD = `${w.floating.height + V}px`) : U === "right" ? ($ = `${-V}px`, PD = F ? q : `${X}px`) : U === "left" && ($ = `${w.floating.width + V}px`, PD = F ? q : `${X}px`), { data: {
2692
2692
  x: $,
2693
- y: CO
2693
+ y: PD
2694
2694
  } };
2695
2695
  }
2696
2696
  });
@@ -2698,10 +2698,10 @@ function getSideAndAlignFromPlacement(s) {
2698
2698
  let [d, C = "center"] = s.split("-");
2699
2699
  return [d, C];
2700
2700
  }
2701
- var Root2$2 = Popper, Anchor = PopperAnchor, Content = PopperContent, Arrow = PopperArrow, ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus", EVENT_OPTIONS = {
2701
+ var Root2$1 = Popper, Anchor = PopperAnchor, Content = PopperContent, Arrow = PopperArrow, ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus", EVENT_OPTIONS = {
2702
2702
  bubbles: !1,
2703
2703
  cancelable: !0
2704
- }, GROUP_NAME$3 = "RovingFocusGroup", [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(GROUP_NAME$3), [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME$3, [createCollectionScope$1]), [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$3), RovingFocusGroup = React$1.forwardRef((s, d) => /* @__PURE__ */ jsx(Collection$1.Provider, {
2704
+ }, GROUP_NAME$2 = "RovingFocusGroup", [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(GROUP_NAME$2), [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME$2, [createCollectionScope$1]), [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$2), RovingFocusGroup = React$1.forwardRef((s, d) => /* @__PURE__ */ jsx(Collection$1.Provider, {
2705
2705
  scope: s.__scopeRovingFocusGroup,
2706
2706
  children: /* @__PURE__ */ jsx(Collection$1.Slot, {
2707
2707
  scope: s.__scopeRovingFocusGroup,
@@ -2711,65 +2711,65 @@ var Root2$2 = Popper, Anchor = PopperAnchor, Content = PopperContent, Arrow = Po
2711
2711
  })
2712
2712
  })
2713
2713
  }));
2714
- RovingFocusGroup.displayName = GROUP_NAME$3;
2714
+ RovingFocusGroup.displayName = GROUP_NAME$2;
2715
2715
  var RovingFocusGroupImpl = React$1.forwardRef((d, C) => {
2716
- let { __scopeRovingFocusGroup: w, orientation: k, loop: F = !1, dir: L, currentTabStopId: V, defaultCurrentTabStopId: U, onCurrentTabStopIdChange: K, onEntryFocus: q, preventScrollOnEntryFocus: J = !1, ...X } = d, $ = React$1.useRef(null), CO = useComposedRefs(C, $), wO = useDirection(L), [TO, EO] = useControllableState({
2716
+ let { __scopeRovingFocusGroup: w, orientation: k, loop: F = !1, dir: L, currentTabStopId: V, defaultCurrentTabStopId: U, onCurrentTabStopIdChange: K, onEntryFocus: q, preventScrollOnEntryFocus: J = !1, ...X } = d, $ = React$1.useRef(null), PD = useComposedRefs(C, $), FD = useDirection(L), [ID, LD] = useControllableState({
2717
2717
  prop: V,
2718
2718
  defaultProp: U ?? null,
2719
2719
  onChange: K,
2720
- caller: GROUP_NAME$3
2721
- }), [DO, OO] = React$1.useState(!1), kO = useCallbackRef(q), AO = useCollection$1(w), jO = React$1.useRef(!1), [NO, PO] = React$1.useState(0);
2720
+ caller: GROUP_NAME$2
2721
+ }), [RD, zD] = React$1.useState(!1), BD = useCallbackRef(q), VD = useCollection$1(w), HD = React$1.useRef(!1), [UD, GD] = React$1.useState(0);
2722
2722
  return React$1.useEffect(() => {
2723
2723
  let s = $.current;
2724
- if (s) return s.addEventListener(ENTRY_FOCUS, kO), () => s.removeEventListener(ENTRY_FOCUS, kO);
2725
- }, [kO]), /* @__PURE__ */ jsx(RovingFocusProvider, {
2724
+ if (s) return s.addEventListener(ENTRY_FOCUS, BD), () => s.removeEventListener(ENTRY_FOCUS, BD);
2725
+ }, [BD]), /* @__PURE__ */ jsx(RovingFocusProvider, {
2726
2726
  scope: w,
2727
2727
  orientation: k,
2728
- dir: wO,
2728
+ dir: FD,
2729
2729
  loop: F,
2730
- currentTabStopId: TO,
2731
- onItemFocus: React$1.useCallback((s) => EO(s), [EO]),
2732
- onItemShiftTab: React$1.useCallback(() => OO(!0), []),
2733
- onFocusableItemAdd: React$1.useCallback(() => PO((s) => s + 1), []),
2734
- onFocusableItemRemove: React$1.useCallback(() => PO((s) => s - 1), []),
2730
+ currentTabStopId: ID,
2731
+ onItemFocus: React$1.useCallback((s) => LD(s), [LD]),
2732
+ onItemShiftTab: React$1.useCallback(() => zD(!0), []),
2733
+ onFocusableItemAdd: React$1.useCallback(() => GD((s) => s + 1), []),
2734
+ onFocusableItemRemove: React$1.useCallback(() => GD((s) => s - 1), []),
2735
2735
  children: /* @__PURE__ */ jsx(Primitive.div, {
2736
- tabIndex: DO || NO === 0 ? -1 : 0,
2736
+ tabIndex: RD || UD === 0 ? -1 : 0,
2737
2737
  "data-orientation": k,
2738
2738
  ...X,
2739
- ref: CO,
2739
+ ref: PD,
2740
2740
  style: {
2741
2741
  outline: "none",
2742
2742
  ...d.style
2743
2743
  },
2744
2744
  onMouseDown: composeEventHandlers(d.onMouseDown, () => {
2745
- jO.current = !0;
2745
+ HD.current = !0;
2746
2746
  }),
2747
2747
  onFocus: composeEventHandlers(d.onFocus, (s) => {
2748
- let d = !jO.current;
2749
- if (s.target === s.currentTarget && d && !DO) {
2748
+ let d = !HD.current;
2749
+ if (s.target === s.currentTarget && d && !RD) {
2750
2750
  let d = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
2751
2751
  if (s.currentTarget.dispatchEvent(d), !d.defaultPrevented) {
2752
- let s = AO().filter((s) => s.focusable);
2752
+ let s = VD().filter((s) => s.focusable);
2753
2753
  focusFirst$1([
2754
2754
  s.find((s) => s.active),
2755
- s.find((s) => s.id === TO),
2755
+ s.find((s) => s.id === ID),
2756
2756
  ...s
2757
2757
  ].filter(Boolean).map((s) => s.ref.current), J);
2758
2758
  }
2759
2759
  }
2760
- jO.current = !1;
2760
+ HD.current = !1;
2761
2761
  }),
2762
- onBlur: composeEventHandlers(d.onBlur, () => OO(!1))
2762
+ onBlur: composeEventHandlers(d.onBlur, () => zD(!1))
2763
2763
  })
2764
2764
  });
2765
- }), ITEM_NAME$3 = "RovingFocusGroupItem", RovingFocusGroupItem = React$1.forwardRef((d, C) => {
2766
- let { __scopeRovingFocusGroup: w, focusable: k = !0, active: F = !1, tabStopId: L, children: V, ...U } = d, K = useId$1(), q = L || K, J = useRovingFocusContext(ITEM_NAME$3, w), X = J.currentTabStopId === q, $ = useCollection$1(w), { onFocusableItemAdd: CO, onFocusableItemRemove: wO, currentTabStopId: TO } = J;
2765
+ }), ITEM_NAME$2 = "RovingFocusGroupItem", RovingFocusGroupItem = React$1.forwardRef((d, C) => {
2766
+ let { __scopeRovingFocusGroup: w, focusable: k = !0, active: F = !1, tabStopId: L, children: V, ...U } = d, K = useId$1(), q = L || K, J = useRovingFocusContext(ITEM_NAME$2, w), X = J.currentTabStopId === q, $ = useCollection$1(w), { onFocusableItemAdd: PD, onFocusableItemRemove: FD, currentTabStopId: ID } = J;
2767
2767
  return React$1.useEffect(() => {
2768
- if (k) return CO(), () => wO();
2768
+ if (k) return PD(), () => FD();
2769
2769
  }, [
2770
2770
  k,
2771
- CO,
2772
- wO
2771
+ PD,
2772
+ FD
2773
2773
  ]), /* @__PURE__ */ jsx(Collection$1.ItemSlot, {
2774
2774
  scope: w,
2775
2775
  id: q,
@@ -2806,12 +2806,12 @@ var RovingFocusGroupImpl = React$1.forwardRef((d, C) => {
2806
2806
  }),
2807
2807
  children: typeof V == "function" ? V({
2808
2808
  isCurrentTabStop: X,
2809
- hasTabStop: TO != null
2809
+ hasTabStop: ID != null
2810
2810
  }) : V
2811
2811
  })
2812
2812
  });
2813
2813
  });
2814
- RovingFocusGroupItem.displayName = ITEM_NAME$3;
2814
+ RovingFocusGroupItem.displayName = ITEM_NAME$2;
2815
2815
  var MAP_KEY_TO_FOCUS_INTENT = {
2816
2816
  ArrowLeft: "prev",
2817
2817
  ArrowUp: "prev",
@@ -2869,7 +2869,7 @@ var Root$1 = RovingFocusGroup, Item = RovingFocusGroupItem, SELECTION_KEYS = ["E
2869
2869
  return document.addEventListener("keydown", s, { capture: !0 }), () => {
2870
2870
  document.removeEventListener("keydown", s, { capture: !0 }), document.removeEventListener("pointerdown", d, { capture: !0 }), document.removeEventListener("pointermove", d, { capture: !0 });
2871
2871
  };
2872
- }, []), /* @__PURE__ */ jsx(Root2$2, {
2872
+ }, []), /* @__PURE__ */ jsx(Root2$1, {
2873
2873
  ...U,
2874
2874
  children: /* @__PURE__ */ jsx(MenuProvider, {
2875
2875
  scope: C,
@@ -2898,8 +2898,8 @@ var ANCHOR_NAME = "MenuAnchor", MenuAnchor = React$1.forwardRef((s, d) => {
2898
2898
  });
2899
2899
  });
2900
2900
  MenuAnchor.displayName = ANCHOR_NAME;
2901
- var PORTAL_NAME$3 = "MenuPortal", [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$3, { forceMount: void 0 }), MenuPortal = (s) => {
2902
- let { __scopeMenu: d, forceMount: C, children: w, container: k } = s, F = useMenuContext(PORTAL_NAME$3, d);
2901
+ var PORTAL_NAME$2 = "MenuPortal", [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$2, { forceMount: void 0 }), MenuPortal = (s) => {
2902
+ let { __scopeMenu: d, forceMount: C, children: w, container: k } = s, F = useMenuContext(PORTAL_NAME$2, d);
2903
2903
  return /* @__PURE__ */ jsx(PortalProvider$1, {
2904
2904
  scope: d,
2905
2905
  forceMount: C,
@@ -2913,9 +2913,9 @@ var PORTAL_NAME$3 = "MenuPortal", [PortalProvider$1, usePortalContext$1] = creat
2913
2913
  })
2914
2914
  });
2915
2915
  };
2916
- MenuPortal.displayName = PORTAL_NAME$3;
2917
- var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$3), MenuContent = React$1.forwardRef((s, d) => {
2918
- let C = usePortalContext$1(CONTENT_NAME$3, s.__scopeMenu), { forceMount: w = C.forceMount, ...k } = s, F = useMenuContext(CONTENT_NAME$3, s.__scopeMenu), L = useMenuRootContext(CONTENT_NAME$3, s.__scopeMenu);
2916
+ MenuPortal.displayName = PORTAL_NAME$2;
2917
+ var CONTENT_NAME$2 = "MenuContent", [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$2), MenuContent = React$1.forwardRef((s, d) => {
2918
+ let C = usePortalContext$1(CONTENT_NAME$2, s.__scopeMenu), { forceMount: w = C.forceMount, ...k } = s, F = useMenuContext(CONTENT_NAME$2, s.__scopeMenu), L = useMenuRootContext(CONTENT_NAME$2, s.__scopeMenu);
2919
2919
  return /* @__PURE__ */ jsx(Collection.Provider, {
2920
2920
  scope: s.__scopeMenu,
2921
2921
  children: /* @__PURE__ */ jsx(Presence, {
@@ -2933,7 +2933,7 @@ var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext]
2933
2933
  })
2934
2934
  });
2935
2935
  }), MenuRootContentModal = React$1.forwardRef((d, C) => {
2936
- let w = useMenuContext(CONTENT_NAME$3, d.__scopeMenu), k = React$1.useRef(null), F = useComposedRefs(C, k);
2936
+ let w = useMenuContext(CONTENT_NAME$2, d.__scopeMenu), k = React$1.useRef(null), F = useComposedRefs(C, k);
2937
2937
  return React$1.useEffect(() => {
2938
2938
  let s = k.current;
2939
2939
  if (s) return hideOthers(s);
@@ -2947,7 +2947,7 @@ var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext]
2947
2947
  onDismiss: () => w.onOpenChange(!1)
2948
2948
  });
2949
2949
  }), MenuRootContentNonModal = React$1.forwardRef((s, d) => {
2950
- let C = useMenuContext(CONTENT_NAME$3, s.__scopeMenu);
2950
+ let C = useMenuContext(CONTENT_NAME$2, s.__scopeMenu);
2951
2951
  return /* @__PURE__ */ jsx(MenuContentImpl, {
2952
2952
  ...s,
2953
2953
  ref: d,
@@ -2957,40 +2957,40 @@ var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext]
2957
2957
  onDismiss: () => C.onOpenChange(!1)
2958
2958
  });
2959
2959
  }), Slot = /* @__PURE__ */ createSlot("MenuContent.ScrollLock"), MenuContentImpl = React$1.forwardRef((d, C) => {
2960
- let { __scopeMenu: w, loop: k = !1, trapFocus: F, onOpenAutoFocus: L, onCloseAutoFocus: V, disableOutsidePointerEvents: U, onEntryFocus: K, onEscapeKeyDown: q, onPointerDownOutside: J, onFocusOutside: X, onInteractOutside: $, onDismiss: CO, disableOutsideScroll: wO, ...TO } = d, EO = useMenuContext(CONTENT_NAME$3, w), DO = useMenuRootContext(CONTENT_NAME$3, w), OO = usePopperScope$1(w), kO = useRovingFocusGroupScope(w), AO = useCollection(w), [jO, NO] = React$1.useState(null), PO = React$1.useRef(null), FO = useComposedRefs(C, PO, EO.onContentChange), IO = React$1.useRef(0), LO = React$1.useRef(""), RO = React$1.useRef(0), zO = React$1.useRef(null), BO = React$1.useRef("right"), VO = React$1.useRef(0), HO = wO ? Combination_default : React$1.Fragment, UO = wO ? {
2960
+ let { __scopeMenu: w, loop: k = !1, trapFocus: F, onOpenAutoFocus: L, onCloseAutoFocus: V, disableOutsidePointerEvents: U, onEntryFocus: K, onEscapeKeyDown: q, onPointerDownOutside: J, onFocusOutside: X, onInteractOutside: $, onDismiss: PD, disableOutsideScroll: FD, ...ID } = d, LD = useMenuContext(CONTENT_NAME$2, w), RD = useMenuRootContext(CONTENT_NAME$2, w), zD = usePopperScope$1(w), BD = useRovingFocusGroupScope(w), VD = useCollection(w), [HD, UD] = React$1.useState(null), GD = React$1.useRef(null), KD = useComposedRefs(C, GD, LD.onContentChange), qD = React$1.useRef(0), JD = React$1.useRef(""), YD = React$1.useRef(0), XD = React$1.useRef(null), ZD = React$1.useRef("right"), QD = React$1.useRef(0), $D = FD ? Combination_default : React$1.Fragment, eO = FD ? {
2961
2961
  as: Slot,
2962
2962
  allowPinchZoom: !0
2963
- } : void 0, WO = (s) => {
2964
- let d = LO.current + s, C = AO().filter((s) => !s.disabled), w = document.activeElement, k = C.find((s) => s.ref.current === w)?.textValue, F = getNextMatch(C.map((s) => s.textValue), d, k), L = C.find((s) => s.textValue === F)?.ref.current;
2963
+ } : void 0, tO = (s) => {
2964
+ let d = JD.current + s, C = VD().filter((s) => !s.disabled), w = document.activeElement, k = C.find((s) => s.ref.current === w)?.textValue, F = getNextMatch(C.map((s) => s.textValue), d, k), L = C.find((s) => s.textValue === F)?.ref.current;
2965
2965
  (function s(d) {
2966
- LO.current = d, window.clearTimeout(IO.current), d !== "" && (IO.current = window.setTimeout(() => s(""), 1e3));
2966
+ JD.current = d, window.clearTimeout(qD.current), d !== "" && (qD.current = window.setTimeout(() => s(""), 1e3));
2967
2967
  })(d), L && setTimeout(() => L.focus());
2968
2968
  };
2969
- React$1.useEffect(() => () => window.clearTimeout(IO.current), []), useFocusGuards();
2970
- let GO = React$1.useCallback((s) => BO.current === zO.current?.side && isPointerInGraceArea(s, zO.current?.area), []);
2969
+ React$1.useEffect(() => () => window.clearTimeout(qD.current), []), useFocusGuards();
2970
+ let nO = React$1.useCallback((s) => ZD.current === XD.current?.side && isPointerInGraceArea(s, XD.current?.area), []);
2971
2971
  return /* @__PURE__ */ jsx(MenuContentProvider, {
2972
2972
  scope: w,
2973
- searchRef: LO,
2973
+ searchRef: JD,
2974
2974
  onItemEnter: React$1.useCallback((s) => {
2975
- GO(s) && s.preventDefault();
2976
- }, [GO]),
2975
+ nO(s) && s.preventDefault();
2976
+ }, [nO]),
2977
2977
  onItemLeave: React$1.useCallback((s) => {
2978
- GO(s) || (PO.current?.focus(), NO(null));
2979
- }, [GO]),
2978
+ nO(s) || (GD.current?.focus(), UD(null));
2979
+ }, [nO]),
2980
2980
  onTriggerLeave: React$1.useCallback((s) => {
2981
- GO(s) && s.preventDefault();
2982
- }, [GO]),
2983
- pointerGraceTimerRef: RO,
2981
+ nO(s) && s.preventDefault();
2982
+ }, [nO]),
2983
+ pointerGraceTimerRef: YD,
2984
2984
  onPointerGraceIntentChange: React$1.useCallback((s) => {
2985
- zO.current = s;
2985
+ XD.current = s;
2986
2986
  }, []),
2987
- children: /* @__PURE__ */ jsx(HO, {
2988
- ...UO,
2987
+ children: /* @__PURE__ */ jsx($D, {
2988
+ ...eO,
2989
2989
  children: /* @__PURE__ */ jsx(FocusScope, {
2990
2990
  asChild: !0,
2991
2991
  trapped: F,
2992
2992
  onMountAutoFocus: composeEventHandlers(L, (s) => {
2993
- s.preventDefault(), PO.current?.focus({ preventScroll: !0 });
2993
+ s.preventDefault(), GD.current?.focus({ preventScroll: !0 });
2994
2994
  }),
2995
2995
  onUnmountAutoFocus: V,
2996
2996
  children: /* @__PURE__ */ jsx(DismissableLayer, {
@@ -3000,47 +3000,47 @@ var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext]
3000
3000
  onPointerDownOutside: J,
3001
3001
  onFocusOutside: X,
3002
3002
  onInteractOutside: $,
3003
- onDismiss: CO,
3003
+ onDismiss: PD,
3004
3004
  children: /* @__PURE__ */ jsx(Root$1, {
3005
3005
  asChild: !0,
3006
- ...kO,
3007
- dir: DO.dir,
3006
+ ...BD,
3007
+ dir: RD.dir,
3008
3008
  orientation: "vertical",
3009
3009
  loop: k,
3010
- currentTabStopId: jO,
3011
- onCurrentTabStopIdChange: NO,
3010
+ currentTabStopId: HD,
3011
+ onCurrentTabStopIdChange: UD,
3012
3012
  onEntryFocus: composeEventHandlers(K, (s) => {
3013
- DO.isUsingKeyboardRef.current || s.preventDefault();
3013
+ RD.isUsingKeyboardRef.current || s.preventDefault();
3014
3014
  }),
3015
3015
  preventScrollOnEntryFocus: !0,
3016
3016
  children: /* @__PURE__ */ jsx(Content, {
3017
3017
  role: "menu",
3018
3018
  "aria-orientation": "vertical",
3019
- "data-state": getOpenState(EO.open),
3019
+ "data-state": getOpenState(LD.open),
3020
3020
  "data-radix-menu-content": "",
3021
- dir: DO.dir,
3022
- ...OO,
3023
- ...TO,
3024
- ref: FO,
3021
+ dir: RD.dir,
3022
+ ...zD,
3023
+ ...ID,
3024
+ ref: KD,
3025
3025
  style: {
3026
3026
  outline: "none",
3027
- ...TO.style
3027
+ ...ID.style
3028
3028
  },
3029
- onKeyDown: composeEventHandlers(TO.onKeyDown, (s) => {
3029
+ onKeyDown: composeEventHandlers(ID.onKeyDown, (s) => {
3030
3030
  let d = s.target.closest("[data-radix-menu-content]") === s.currentTarget, C = s.ctrlKey || s.altKey || s.metaKey, w = s.key.length === 1;
3031
- d && (s.key === "Tab" && s.preventDefault(), !C && w && WO(s.key));
3032
- let k = PO.current;
3031
+ d && (s.key === "Tab" && s.preventDefault(), !C && w && tO(s.key));
3032
+ let k = GD.current;
3033
3033
  if (s.target !== k || !FIRST_LAST_KEYS.includes(s.key)) return;
3034
3034
  s.preventDefault();
3035
- let F = AO().filter((s) => !s.disabled).map((s) => s.ref.current);
3035
+ let F = VD().filter((s) => !s.disabled).map((s) => s.ref.current);
3036
3036
  LAST_KEYS.includes(s.key) && F.reverse(), focusFirst(F);
3037
3037
  }),
3038
3038
  onBlur: composeEventHandlers(d.onBlur, (s) => {
3039
- s.currentTarget.contains(s.target) || (window.clearTimeout(IO.current), LO.current = "");
3039
+ s.currentTarget.contains(s.target) || (window.clearTimeout(qD.current), JD.current = "");
3040
3040
  }),
3041
3041
  onPointerMove: composeEventHandlers(d.onPointerMove, whenMouse((s) => {
3042
- let d = s.target, C = VO.current !== s.clientX;
3043
- s.currentTarget.contains(d) && C && (BO.current = s.clientX > VO.current ? "right" : "left", VO.current = s.clientX);
3042
+ let d = s.target, C = QD.current !== s.clientX;
3043
+ s.currentTarget.contains(d) && C && (ZD.current = s.clientX > QD.current ? "right" : "left", QD.current = s.clientX);
3044
3044
  }))
3045
3045
  })
3046
3046
  })
@@ -3049,8 +3049,8 @@ var CONTENT_NAME$3 = "MenuContent", [MenuContentProvider, useMenuContentContext]
3049
3049
  })
3050
3050
  });
3051
3051
  });
3052
- MenuContent.displayName = CONTENT_NAME$3;
3053
- var GROUP_NAME$2 = "MenuGroup", MenuGroup = React$1.forwardRef((s, d) => {
3052
+ MenuContent.displayName = CONTENT_NAME$2;
3053
+ var GROUP_NAME$1 = "MenuGroup", MenuGroup = React$1.forwardRef((s, d) => {
3054
3054
  let { __scopeMenu: C, ...w } = s;
3055
3055
  return /* @__PURE__ */ jsx(Primitive.div, {
3056
3056
  role: "group",
@@ -3058,17 +3058,17 @@ var GROUP_NAME$2 = "MenuGroup", MenuGroup = React$1.forwardRef((s, d) => {
3058
3058
  ref: d
3059
3059
  });
3060
3060
  });
3061
- MenuGroup.displayName = GROUP_NAME$2;
3062
- var LABEL_NAME$2 = "MenuLabel", MenuLabel = React$1.forwardRef((s, d) => {
3061
+ MenuGroup.displayName = GROUP_NAME$1;
3062
+ var LABEL_NAME$1 = "MenuLabel", MenuLabel = React$1.forwardRef((s, d) => {
3063
3063
  let { __scopeMenu: C, ...w } = s;
3064
3064
  return /* @__PURE__ */ jsx(Primitive.div, {
3065
3065
  ...w,
3066
3066
  ref: d
3067
3067
  });
3068
3068
  });
3069
- MenuLabel.displayName = LABEL_NAME$2;
3070
- var ITEM_NAME$2 = "MenuItem", ITEM_SELECT = "menu.itemSelect", MenuItem = React$1.forwardRef((d, C) => {
3071
- let { disabled: w = !1, onSelect: k, ...F } = d, L = React$1.useRef(null), V = useMenuRootContext(ITEM_NAME$2, d.__scopeMenu), U = useMenuContentContext(ITEM_NAME$2, d.__scopeMenu), K = useComposedRefs(C, L), q = React$1.useRef(!1), J = () => {
3069
+ MenuLabel.displayName = LABEL_NAME$1;
3070
+ var ITEM_NAME$1 = "MenuItem", ITEM_SELECT = "menu.itemSelect", MenuItem$1 = React$1.forwardRef((d, C) => {
3071
+ let { disabled: w = !1, onSelect: k, ...F } = d, L = React$1.useRef(null), V = useMenuRootContext(ITEM_NAME$1, d.__scopeMenu), U = useMenuContentContext(ITEM_NAME$1, d.__scopeMenu), K = useComposedRefs(C, L), q = React$1.useRef(!1), J = () => {
3072
3072
  let s = L.current;
3073
3073
  if (!w && s) {
3074
3074
  let d = new CustomEvent(ITEM_SELECT, {
@@ -3095,12 +3095,12 @@ var ITEM_NAME$2 = "MenuItem", ITEM_SELECT = "menu.itemSelect", MenuItem = React$
3095
3095
  })
3096
3096
  });
3097
3097
  });
3098
- MenuItem.displayName = ITEM_NAME$2;
3098
+ MenuItem$1.displayName = ITEM_NAME$1;
3099
3099
  var MenuItemImpl = React$1.forwardRef((d, C) => {
3100
- let { __scopeMenu: w, disabled: k = !1, textValue: F, ...L } = d, V = useMenuContentContext(ITEM_NAME$2, w), U = useRovingFocusGroupScope(w), K = React$1.useRef(null), q = useComposedRefs(C, K), [J, X] = React$1.useState(!1), [$, CO] = React$1.useState("");
3100
+ let { __scopeMenu: w, disabled: k = !1, textValue: F, ...L } = d, V = useMenuContentContext(ITEM_NAME$1, w), U = useRovingFocusGroupScope(w), K = React$1.useRef(null), q = useComposedRefs(C, K), [J, X] = React$1.useState(!1), [$, PD] = React$1.useState("");
3101
3101
  return React$1.useEffect(() => {
3102
3102
  let s = K.current;
3103
- s && CO((s.textContent ?? "").trim());
3103
+ s && PD((s.textContent ?? "").trim());
3104
3104
  }, [L.children]), /* @__PURE__ */ jsx(Collection.ItemSlot, {
3105
3105
  scope: w,
3106
3106
  disabled: k,
@@ -3125,12 +3125,12 @@ var MenuItemImpl = React$1.forwardRef((d, C) => {
3125
3125
  })
3126
3126
  })
3127
3127
  });
3128
- }), CHECKBOX_ITEM_NAME$2 = "MenuCheckboxItem", MenuCheckboxItem = React$1.forwardRef((s, d) => {
3128
+ }), CHECKBOX_ITEM_NAME$1 = "MenuCheckboxItem", MenuCheckboxItem = React$1.forwardRef((s, d) => {
3129
3129
  let { checked: C = !1, onCheckedChange: w, ...k } = s;
3130
3130
  return /* @__PURE__ */ jsx(ItemIndicatorProvider, {
3131
3131
  scope: s.__scopeMenu,
3132
3132
  checked: C,
3133
- children: /* @__PURE__ */ jsx(MenuItem, {
3133
+ children: /* @__PURE__ */ jsx(MenuItem$1, {
3134
3134
  role: "menuitemcheckbox",
3135
3135
  "aria-checked": isIndeterminate(C) ? "mixed" : C,
3136
3136
  ...k,
@@ -3140,8 +3140,8 @@ var MenuItemImpl = React$1.forwardRef((d, C) => {
3140
3140
  })
3141
3141
  });
3142
3142
  });
3143
- MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME$2;
3144
- var RADIO_GROUP_NAME$2 = "MenuRadioGroup", [RadioGroupProvider, useRadioGroupContext] = createMenuContext(RADIO_GROUP_NAME$2, {
3143
+ MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME$1;
3144
+ var RADIO_GROUP_NAME$1 = "MenuRadioGroup", [RadioGroupProvider, useRadioGroupContext] = createMenuContext(RADIO_GROUP_NAME$1, {
3145
3145
  value: void 0,
3146
3146
  onValueChange: () => {}
3147
3147
  }), MenuRadioGroup = React$1.forwardRef((s, d) => {
@@ -3156,13 +3156,13 @@ var RADIO_GROUP_NAME$2 = "MenuRadioGroup", [RadioGroupProvider, useRadioGroupCon
3156
3156
  })
3157
3157
  });
3158
3158
  });
3159
- MenuRadioGroup.displayName = RADIO_GROUP_NAME$2;
3160
- var RADIO_ITEM_NAME$2 = "MenuRadioItem", MenuRadioItem = React$1.forwardRef((s, d) => {
3161
- let { value: C, ...w } = s, k = useRadioGroupContext(RADIO_ITEM_NAME$2, s.__scopeMenu), F = C === k.value;
3159
+ MenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
3160
+ var RADIO_ITEM_NAME$1 = "MenuRadioItem", MenuRadioItem = React$1.forwardRef((s, d) => {
3161
+ let { value: C, ...w } = s, k = useRadioGroupContext(RADIO_ITEM_NAME$1, s.__scopeMenu), F = C === k.value;
3162
3162
  return /* @__PURE__ */ jsx(ItemIndicatorProvider, {
3163
3163
  scope: s.__scopeMenu,
3164
3164
  checked: F,
3165
- children: /* @__PURE__ */ jsx(MenuItem, {
3165
+ children: /* @__PURE__ */ jsx(MenuItem$1, {
3166
3166
  role: "menuitemradio",
3167
3167
  "aria-checked": F,
3168
3168
  ...w,
@@ -3172,7 +3172,7 @@ var RADIO_ITEM_NAME$2 = "MenuRadioItem", MenuRadioItem = React$1.forwardRef((s,
3172
3172
  })
3173
3173
  });
3174
3174
  });
3175
- MenuRadioItem.displayName = RADIO_ITEM_NAME$2;
3175
+ MenuRadioItem.displayName = RADIO_ITEM_NAME$1;
3176
3176
  var ITEM_INDICATOR_NAME = "MenuItemIndicator", [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME, { checked: !1 }), MenuItemIndicator = React$1.forwardRef((s, d) => {
3177
3177
  let { __scopeMenu: C, forceMount: w, ...k } = s, F = useItemIndicatorContext(ITEM_INDICATOR_NAME, C);
3178
3178
  return /* @__PURE__ */ jsx(Presence, {
@@ -3185,7 +3185,7 @@ var ITEM_INDICATOR_NAME = "MenuItemIndicator", [ItemIndicatorProvider, useItemIn
3185
3185
  });
3186
3186
  });
3187
3187
  MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
3188
- var SEPARATOR_NAME$2 = "MenuSeparator", MenuSeparator = React$1.forwardRef((s, d) => {
3188
+ var SEPARATOR_NAME$1 = "MenuSeparator", MenuSeparator$1 = React$1.forwardRef((s, d) => {
3189
3189
  let { __scopeMenu: C, ...w } = s;
3190
3190
  return /* @__PURE__ */ jsx(Primitive.div, {
3191
3191
  role: "separator",
@@ -3194,8 +3194,8 @@ var SEPARATOR_NAME$2 = "MenuSeparator", MenuSeparator = React$1.forwardRef((s, d
3194
3194
  ref: d
3195
3195
  });
3196
3196
  });
3197
- MenuSeparator.displayName = SEPARATOR_NAME$2;
3198
- var ARROW_NAME$3 = "MenuArrow", MenuArrow = React$1.forwardRef((s, d) => {
3197
+ MenuSeparator$1.displayName = SEPARATOR_NAME$1;
3198
+ var ARROW_NAME$2 = "MenuArrow", MenuArrow = React$1.forwardRef((s, d) => {
3199
3199
  let { __scopeMenu: C, ...w } = s;
3200
3200
  return /* @__PURE__ */ jsx(Arrow, {
3201
3201
  ...usePopperScope$1(C),
@@ -3203,10 +3203,10 @@ var ARROW_NAME$3 = "MenuArrow", MenuArrow = React$1.forwardRef((s, d) => {
3203
3203
  ref: d
3204
3204
  });
3205
3205
  });
3206
- MenuArrow.displayName = ARROW_NAME$3;
3207
- var SUB_NAME$1 = "MenuSub", [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME$1), MenuSub = (d) => {
3208
- let { __scopeMenu: C, children: w, open: k = !1, onOpenChange: F } = d, L = useMenuContext(SUB_NAME$1, C), V = usePopperScope$1(C), [U, K] = React$1.useState(null), [q, J] = React$1.useState(null), X = useCallbackRef(F);
3209
- return React$1.useEffect(() => (L.open === !1 && X(!1), () => X(!1)), [L.open, X]), /* @__PURE__ */ jsx(Root2$2, {
3206
+ MenuArrow.displayName = ARROW_NAME$2;
3207
+ var SUB_NAME = "MenuSub", [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME), MenuSub = (d) => {
3208
+ let { __scopeMenu: C, children: w, open: k = !1, onOpenChange: F } = d, L = useMenuContext(SUB_NAME, C), V = usePopperScope$1(C), [U, K] = React$1.useState(null), [q, J] = React$1.useState(null), X = useCallbackRef(F);
3209
+ return React$1.useEffect(() => (L.open === !1 && X(!1), () => X(!1)), [L.open, X]), /* @__PURE__ */ jsx(Root2$1, {
3210
3210
  ...V,
3211
3211
  children: /* @__PURE__ */ jsx(MenuProvider, {
3212
3212
  scope: C,
@@ -3225,9 +3225,9 @@ var SUB_NAME$1 = "MenuSub", [MenuSubProvider, useMenuSubContext] = createMenuCon
3225
3225
  })
3226
3226
  });
3227
3227
  };
3228
- MenuSub.displayName = SUB_NAME$1;
3229
- var SUB_TRIGGER_NAME$2 = "MenuSubTrigger", MenuSubTrigger = React$1.forwardRef((d, C) => {
3230
- let w = useMenuContext(SUB_TRIGGER_NAME$2, d.__scopeMenu), k = useMenuRootContext(SUB_TRIGGER_NAME$2, d.__scopeMenu), F = useMenuSubContext(SUB_TRIGGER_NAME$2, d.__scopeMenu), L = useMenuContentContext(SUB_TRIGGER_NAME$2, d.__scopeMenu), V = React$1.useRef(null), { pointerGraceTimerRef: U, onPointerGraceIntentChange: K } = L, q = { __scopeMenu: d.__scopeMenu }, J = React$1.useCallback(() => {
3228
+ MenuSub.displayName = SUB_NAME;
3229
+ var SUB_TRIGGER_NAME$1 = "MenuSubTrigger", MenuSubTrigger = React$1.forwardRef((d, C) => {
3230
+ let w = useMenuContext(SUB_TRIGGER_NAME$1, d.__scopeMenu), k = useMenuRootContext(SUB_TRIGGER_NAME$1, d.__scopeMenu), F = useMenuSubContext(SUB_TRIGGER_NAME$1, d.__scopeMenu), L = useMenuContentContext(SUB_TRIGGER_NAME$1, d.__scopeMenu), V = React$1.useRef(null), { pointerGraceTimerRef: U, onPointerGraceIntentChange: K } = L, q = { __scopeMenu: d.__scopeMenu }, J = React$1.useCallback(() => {
3231
3231
  V.current && window.clearTimeout(V.current), V.current = null;
3232
3232
  }, []);
3233
3233
  return React$1.useEffect(() => J, [J]), React$1.useEffect(() => {
@@ -3296,9 +3296,9 @@ var SUB_TRIGGER_NAME$2 = "MenuSubTrigger", MenuSubTrigger = React$1.forwardRef((
3296
3296
  })
3297
3297
  });
3298
3298
  });
3299
- MenuSubTrigger.displayName = SUB_TRIGGER_NAME$2;
3300
- var SUB_CONTENT_NAME$2 = "MenuSubContent", MenuSubContent = React$1.forwardRef((d, C) => {
3301
- let w = usePortalContext$1(CONTENT_NAME$3, d.__scopeMenu), { forceMount: k = w.forceMount, ...F } = d, L = useMenuContext(CONTENT_NAME$3, d.__scopeMenu), V = useMenuRootContext(CONTENT_NAME$3, d.__scopeMenu), U = useMenuSubContext(SUB_CONTENT_NAME$2, d.__scopeMenu), K = React$1.useRef(null), q = useComposedRefs(C, K);
3299
+ MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
3300
+ var SUB_CONTENT_NAME$1 = "MenuSubContent", MenuSubContent = React$1.forwardRef((d, C) => {
3301
+ let w = usePortalContext$1(CONTENT_NAME$2, d.__scopeMenu), { forceMount: k = w.forceMount, ...F } = d, L = useMenuContext(CONTENT_NAME$2, d.__scopeMenu), V = useMenuRootContext(CONTENT_NAME$2, d.__scopeMenu), U = useMenuSubContext(SUB_CONTENT_NAME$1, d.__scopeMenu), K = React$1.useRef(null), q = useComposedRefs(C, K);
3302
3302
  return /* @__PURE__ */ jsx(Collection.Provider, {
3303
3303
  scope: d.__scopeMenu,
3304
3304
  children: /* @__PURE__ */ jsx(Presence, {
@@ -3334,7 +3334,7 @@ var SUB_CONTENT_NAME$2 = "MenuSubContent", MenuSubContent = React$1.forwardRef((
3334
3334
  })
3335
3335
  });
3336
3336
  });
3337
- MenuSubContent.displayName = SUB_CONTENT_NAME$2;
3337
+ MenuSubContent.displayName = SUB_CONTENT_NAME$1;
3338
3338
  function getOpenState(s) {
3339
3339
  return s ? "open" : "closed";
3340
3340
  }
@@ -3374,224 +3374,7 @@ function isPointerInGraceArea(s, d) {
3374
3374
  function whenMouse(s) {
3375
3375
  return (d) => d.pointerType === "mouse" ? s(d) : void 0;
3376
3376
  }
3377
- var Root3 = Menu, Anchor2 = MenuAnchor, Portal$1 = MenuPortal, Content2$2 = MenuContent, Group = MenuGroup, Label = MenuLabel, Item2$2 = MenuItem, CheckboxItem = MenuCheckboxItem, RadioGroup = MenuRadioGroup, RadioItem = MenuRadioItem, ItemIndicator = MenuItemIndicator, Separator = MenuSeparator, Arrow2 = MenuArrow, Sub = MenuSub, SubTrigger = MenuSubTrigger, SubContent = MenuSubContent, CONTEXT_MENU_NAME = "ContextMenu", [createContextMenuContext, createContextMenuScope] = createContextScope(CONTEXT_MENU_NAME, [createMenuScope]), useMenuScope$1 = createMenuScope(), [ContextMenuProvider, useContextMenuContext] = createContextMenuContext(CONTEXT_MENU_NAME), ContextMenu = (d) => {
3378
- let { __scopeContextMenu: C, children: w, onOpenChange: k, dir: F, modal: L = !0 } = d, [V, U] = React$1.useState(!1), K = useMenuScope$1(C), q = useCallbackRef(k), J = React$1.useCallback((s) => {
3379
- U(s), q(s);
3380
- }, [q]);
3381
- return /* @__PURE__ */ jsx(ContextMenuProvider, {
3382
- scope: C,
3383
- open: V,
3384
- onOpenChange: J,
3385
- modal: L,
3386
- children: /* @__PURE__ */ jsx(Root3, {
3387
- ...K,
3388
- dir: F,
3389
- open: V,
3390
- onOpenChange: J,
3391
- modal: L,
3392
- children: w
3393
- })
3394
- });
3395
- };
3396
- ContextMenu.displayName = CONTEXT_MENU_NAME;
3397
- var TRIGGER_NAME$2 = "ContextMenuTrigger", ContextMenuTrigger = React$1.forwardRef((d, C) => {
3398
- let { __scopeContextMenu: w, disabled: k = !1, ...F } = d, L = useContextMenuContext(TRIGGER_NAME$2, w), V = useMenuScope$1(w), U = React$1.useRef({
3399
- x: 0,
3400
- y: 0
3401
- }), K = React$1.useRef({ getBoundingClientRect: () => DOMRect.fromRect({
3402
- width: 0,
3403
- height: 0,
3404
- ...U.current
3405
- }) }), q = React$1.useRef(0), J = React$1.useCallback(() => window.clearTimeout(q.current), []), X = (s) => {
3406
- U.current = {
3407
- x: s.clientX,
3408
- y: s.clientY
3409
- }, L.onOpenChange(!0);
3410
- };
3411
- return React$1.useEffect(() => J, [J]), React$1.useEffect(() => void (k && J()), [k, J]), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Anchor2, {
3412
- ...V,
3413
- virtualRef: K
3414
- }), /* @__PURE__ */ jsx(Primitive.span, {
3415
- "data-state": L.open ? "open" : "closed",
3416
- "data-disabled": k ? "" : void 0,
3417
- ...F,
3418
- ref: C,
3419
- style: {
3420
- WebkitTouchCallout: "none",
3421
- ...d.style
3422
- },
3423
- onContextMenu: k ? d.onContextMenu : composeEventHandlers(d.onContextMenu, (s) => {
3424
- J(), X(s), s.preventDefault();
3425
- }),
3426
- onPointerDown: k ? d.onPointerDown : composeEventHandlers(d.onPointerDown, whenTouchOrPen((s) => {
3427
- J(), q.current = window.setTimeout(() => X(s), 700);
3428
- })),
3429
- onPointerMove: k ? d.onPointerMove : composeEventHandlers(d.onPointerMove, whenTouchOrPen(J)),
3430
- onPointerCancel: k ? d.onPointerCancel : composeEventHandlers(d.onPointerCancel, whenTouchOrPen(J)),
3431
- onPointerUp: k ? d.onPointerUp : composeEventHandlers(d.onPointerUp, whenTouchOrPen(J))
3432
- })] });
3433
- });
3434
- ContextMenuTrigger.displayName = TRIGGER_NAME$2;
3435
- var PORTAL_NAME$2 = "ContextMenuPortal", ContextMenuPortal = (s) => {
3436
- let { __scopeContextMenu: d, ...C } = s;
3437
- return /* @__PURE__ */ jsx(Portal$1, {
3438
- ...useMenuScope$1(d),
3439
- ...C
3440
- });
3441
- };
3442
- ContextMenuPortal.displayName = PORTAL_NAME$2;
3443
- var CONTENT_NAME$2 = "ContextMenuContent", ContextMenuContent = React$1.forwardRef((d, C) => {
3444
- let { __scopeContextMenu: w, ...k } = d, F = useContextMenuContext(CONTENT_NAME$2, w), L = useMenuScope$1(w), V = React$1.useRef(!1);
3445
- return /* @__PURE__ */ jsx(Content2$2, {
3446
- ...L,
3447
- ...k,
3448
- ref: C,
3449
- side: "right",
3450
- sideOffset: 2,
3451
- align: "start",
3452
- onCloseAutoFocus: (s) => {
3453
- d.onCloseAutoFocus?.(s), !s.defaultPrevented && V.current && s.preventDefault(), V.current = !1;
3454
- },
3455
- onInteractOutside: (s) => {
3456
- d.onInteractOutside?.(s), !s.defaultPrevented && !F.modal && (V.current = !0);
3457
- },
3458
- style: {
3459
- ...d.style,
3460
- "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3461
- "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
3462
- "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
3463
- "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
3464
- "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
3465
- }
3466
- });
3467
- });
3468
- ContextMenuContent.displayName = CONTENT_NAME$2;
3469
- var GROUP_NAME$1 = "ContextMenuGroup", ContextMenuGroup = React$1.forwardRef((s, d) => {
3470
- let { __scopeContextMenu: C, ...w } = s;
3471
- return /* @__PURE__ */ jsx(Group, {
3472
- ...useMenuScope$1(C),
3473
- ...w,
3474
- ref: d
3475
- });
3476
- });
3477
- ContextMenuGroup.displayName = GROUP_NAME$1;
3478
- var LABEL_NAME$1 = "ContextMenuLabel", ContextMenuLabel = React$1.forwardRef((s, d) => {
3479
- let { __scopeContextMenu: C, ...w } = s;
3480
- return /* @__PURE__ */ jsx(Label, {
3481
- ...useMenuScope$1(C),
3482
- ...w,
3483
- ref: d
3484
- });
3485
- });
3486
- ContextMenuLabel.displayName = LABEL_NAME$1;
3487
- var ITEM_NAME$1 = "ContextMenuItem", ContextMenuItem = React$1.forwardRef((s, d) => {
3488
- let { __scopeContextMenu: C, ...w } = s;
3489
- return /* @__PURE__ */ jsx(Item2$2, {
3490
- ...useMenuScope$1(C),
3491
- ...w,
3492
- ref: d
3493
- });
3494
- });
3495
- ContextMenuItem.displayName = ITEM_NAME$1;
3496
- var CHECKBOX_ITEM_NAME$1 = "ContextMenuCheckboxItem", ContextMenuCheckboxItem = React$1.forwardRef((s, d) => {
3497
- let { __scopeContextMenu: C, ...w } = s;
3498
- return /* @__PURE__ */ jsx(CheckboxItem, {
3499
- ...useMenuScope$1(C),
3500
- ...w,
3501
- ref: d
3502
- });
3503
- });
3504
- ContextMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME$1;
3505
- var RADIO_GROUP_NAME$1 = "ContextMenuRadioGroup", ContextMenuRadioGroup = React$1.forwardRef((s, d) => {
3506
- let { __scopeContextMenu: C, ...w } = s;
3507
- return /* @__PURE__ */ jsx(RadioGroup, {
3508
- ...useMenuScope$1(C),
3509
- ...w,
3510
- ref: d
3511
- });
3512
- });
3513
- ContextMenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
3514
- var RADIO_ITEM_NAME$1 = "ContextMenuRadioItem", ContextMenuRadioItem = React$1.forwardRef((s, d) => {
3515
- let { __scopeContextMenu: C, ...w } = s;
3516
- return /* @__PURE__ */ jsx(RadioItem, {
3517
- ...useMenuScope$1(C),
3518
- ...w,
3519
- ref: d
3520
- });
3521
- });
3522
- ContextMenuRadioItem.displayName = RADIO_ITEM_NAME$1;
3523
- var INDICATOR_NAME$1 = "ContextMenuItemIndicator", ContextMenuItemIndicator = React$1.forwardRef((s, d) => {
3524
- let { __scopeContextMenu: C, ...w } = s;
3525
- return /* @__PURE__ */ jsx(ItemIndicator, {
3526
- ...useMenuScope$1(C),
3527
- ...w,
3528
- ref: d
3529
- });
3530
- });
3531
- ContextMenuItemIndicator.displayName = INDICATOR_NAME$1;
3532
- var SEPARATOR_NAME$1 = "ContextMenuSeparator", ContextMenuSeparator = React$1.forwardRef((s, d) => {
3533
- let { __scopeContextMenu: C, ...w } = s;
3534
- return /* @__PURE__ */ jsx(Separator, {
3535
- ...useMenuScope$1(C),
3536
- ...w,
3537
- ref: d
3538
- });
3539
- });
3540
- ContextMenuSeparator.displayName = SEPARATOR_NAME$1;
3541
- var ARROW_NAME$2 = "ContextMenuArrow", ContextMenuArrow = React$1.forwardRef((s, d) => {
3542
- let { __scopeContextMenu: C, ...w } = s;
3543
- return /* @__PURE__ */ jsx(Arrow2, {
3544
- ...useMenuScope$1(C),
3545
- ...w,
3546
- ref: d
3547
- });
3548
- });
3549
- ContextMenuArrow.displayName = ARROW_NAME$2;
3550
- var SUB_NAME = "ContextMenuSub", ContextMenuSub = (s) => {
3551
- let { __scopeContextMenu: d, children: C, onOpenChange: w, open: k, defaultOpen: F } = s, L = useMenuScope$1(d), [V, U] = useControllableState({
3552
- prop: k,
3553
- defaultProp: F ?? !1,
3554
- onChange: w,
3555
- caller: SUB_NAME
3556
- });
3557
- return /* @__PURE__ */ jsx(Sub, {
3558
- ...L,
3559
- open: V,
3560
- onOpenChange: U,
3561
- children: C
3562
- });
3563
- };
3564
- ContextMenuSub.displayName = SUB_NAME;
3565
- var SUB_TRIGGER_NAME$1 = "ContextMenuSubTrigger", ContextMenuSubTrigger = React$1.forwardRef((s, d) => {
3566
- let { __scopeContextMenu: C, ...w } = s;
3567
- return /* @__PURE__ */ jsx(SubTrigger, {
3568
- ...useMenuScope$1(C),
3569
- ...w,
3570
- ref: d
3571
- });
3572
- });
3573
- ContextMenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
3574
- var SUB_CONTENT_NAME$1 = "ContextMenuSubContent", ContextMenuSubContent = React$1.forwardRef((s, d) => {
3575
- let { __scopeContextMenu: C, ...w } = s;
3576
- return /* @__PURE__ */ jsx(SubContent, {
3577
- ...useMenuScope$1(C),
3578
- ...w,
3579
- ref: d,
3580
- style: {
3581
- ...s.style,
3582
- "--radix-context-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3583
- "--radix-context-menu-content-available-width": "var(--radix-popper-available-width)",
3584
- "--radix-context-menu-content-available-height": "var(--radix-popper-available-height)",
3585
- "--radix-context-menu-trigger-width": "var(--radix-popper-anchor-width)",
3586
- "--radix-context-menu-trigger-height": "var(--radix-popper-anchor-height)"
3587
- }
3588
- });
3589
- });
3590
- ContextMenuSubContent.displayName = SUB_CONTENT_NAME$1;
3591
- function whenTouchOrPen(s) {
3592
- return (d) => d.pointerType === "mouse" ? void 0 : s(d);
3593
- }
3594
- var Root2$1 = ContextMenu, Trigger$1 = ContextMenuTrigger, Portal2$1 = ContextMenuPortal, Content2$1 = ContextMenuContent, Item2$1 = ContextMenuItem, Separator2$1 = ContextMenuSeparator, Sub2$1 = ContextMenuSub, SubTrigger2$1 = ContextMenuSubTrigger, SubContent2$1 = ContextMenuSubContent, DROPDOWN_MENU_NAME = "DropdownMenu", [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]), useMenuScope = createMenuScope(), [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME), DropdownMenu = (d) => {
3377
+ var Root3 = Menu, Anchor2 = MenuAnchor, Portal$1 = MenuPortal, Content2$1 = MenuContent, Group = MenuGroup, Label = MenuLabel, Item2$1 = MenuItem$1, CheckboxItem = MenuCheckboxItem, RadioGroup = MenuRadioGroup, RadioItem = MenuRadioItem, ItemIndicator = MenuItemIndicator, Separator = MenuSeparator$1, Arrow2 = MenuArrow, Sub = MenuSub, SubTrigger = MenuSubTrigger, SubContent = MenuSubContent, DROPDOWN_MENU_NAME = "DropdownMenu", [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [createMenuScope]), useMenuScope = createMenuScope(), [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME), DropdownMenu = (d) => {
3595
3378
  let { __scopeDropdownMenu: C, children: w, dir: k, open: F, defaultOpen: L, onOpenChange: V, modal: U = !0 } = d, K = useMenuScope(C), q = React$1.useRef(null), [J, X] = useControllableState({
3596
3379
  prop: F,
3597
3380
  defaultProp: L ?? !1,
@@ -3658,7 +3441,7 @@ var PORTAL_NAME$1 = "DropdownMenuPortal", DropdownMenuPortal = (s) => {
3658
3441
  DropdownMenuPortal.displayName = PORTAL_NAME$1;
3659
3442
  var CONTENT_NAME$1 = "DropdownMenuContent", DropdownMenuContent = React$1.forwardRef((d, C) => {
3660
3443
  let { __scopeDropdownMenu: w, ...k } = d, F = useDropdownMenuContext(CONTENT_NAME$1, w), L = useMenuScope(w), V = React$1.useRef(!1);
3661
- return /* @__PURE__ */ jsx(Content2$2, {
3444
+ return /* @__PURE__ */ jsx(Content2$1, {
3662
3445
  id: F.contentId,
3663
3446
  "aria-labelledby": F.triggerId,
3664
3447
  ...L,
@@ -3702,7 +3485,7 @@ var LABEL_NAME = "DropdownMenuLabel", DropdownMenuLabel = React$1.forwardRef((s,
3702
3485
  DropdownMenuLabel.displayName = LABEL_NAME;
3703
3486
  var ITEM_NAME = "DropdownMenuItem", DropdownMenuItem = React$1.forwardRef((s, d) => {
3704
3487
  let { __scopeDropdownMenu: C, ...w } = s;
3705
- return /* @__PURE__ */ jsx(Item2$2, {
3488
+ return /* @__PURE__ */ jsx(Item2$1, {
3706
3489
  ...useMenuScope(C),
3707
3490
  ...w,
3708
3491
  ref: d
@@ -3810,35 +3593,35 @@ function useStateMachine(d, C) {
3810
3593
  return React$1.useReducer((s, d) => C[s][d] ?? s, d);
3811
3594
  }
3812
3595
  var SCROLL_AREA_NAME = "ScrollArea", [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME), [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME), ScrollArea = React$1.forwardRef((d, C) => {
3813
- let { __scopeScrollArea: w, type: k = "hover", dir: F, scrollHideDelay: L = 600, ...V } = d, [U, K] = React$1.useState(null), [q, J] = React$1.useState(null), [X, $] = React$1.useState(null), [CO, wO] = React$1.useState(null), [TO, EO] = React$1.useState(null), [DO, OO] = React$1.useState(0), [kO, AO] = React$1.useState(0), [jO, NO] = React$1.useState(!1), [PO, FO] = React$1.useState(!1), IO = useComposedRefs(C, (s) => K(s)), LO = useDirection(F);
3596
+ let { __scopeScrollArea: w, type: k = "hover", dir: F, scrollHideDelay: L = 600, ...V } = d, [U, K] = React$1.useState(null), [q, J] = React$1.useState(null), [X, $] = React$1.useState(null), [PD, FD] = React$1.useState(null), [ID, LD] = React$1.useState(null), [RD, zD] = React$1.useState(0), [BD, VD] = React$1.useState(0), [HD, UD] = React$1.useState(!1), [GD, KD] = React$1.useState(!1), qD = useComposedRefs(C, (s) => K(s)), JD = useDirection(F);
3814
3597
  return /* @__PURE__ */ jsx(ScrollAreaProvider, {
3815
3598
  scope: w,
3816
3599
  type: k,
3817
- dir: LO,
3600
+ dir: JD,
3818
3601
  scrollHideDelay: L,
3819
3602
  scrollArea: U,
3820
3603
  viewport: q,
3821
3604
  onViewportChange: J,
3822
3605
  content: X,
3823
3606
  onContentChange: $,
3824
- scrollbarX: CO,
3825
- onScrollbarXChange: wO,
3826
- scrollbarXEnabled: jO,
3827
- onScrollbarXEnabledChange: NO,
3828
- scrollbarY: TO,
3829
- onScrollbarYChange: EO,
3830
- scrollbarYEnabled: PO,
3831
- onScrollbarYEnabledChange: FO,
3832
- onCornerWidthChange: OO,
3833
- onCornerHeightChange: AO,
3607
+ scrollbarX: PD,
3608
+ onScrollbarXChange: FD,
3609
+ scrollbarXEnabled: HD,
3610
+ onScrollbarXEnabledChange: UD,
3611
+ scrollbarY: ID,
3612
+ onScrollbarYChange: LD,
3613
+ scrollbarYEnabled: GD,
3614
+ onScrollbarYEnabledChange: KD,
3615
+ onCornerWidthChange: zD,
3616
+ onCornerHeightChange: VD,
3834
3617
  children: /* @__PURE__ */ jsx(Primitive.div, {
3835
- dir: LO,
3618
+ dir: JD,
3836
3619
  ...V,
3837
- ref: IO,
3620
+ ref: qD,
3838
3621
  style: {
3839
3622
  position: "relative",
3840
- "--radix-scroll-area-corner-width": DO + "px",
3841
- "--radix-scroll-area-corner-height": kO + "px",
3623
+ "--radix-scroll-area-corner-width": RD + "px",
3624
+ "--radix-scroll-area-corner-height": BD + "px",
3842
3625
  ...d.style
3843
3626
  }
3844
3627
  })
@@ -4109,46 +3892,46 @@ var ScrollAreaScrollbarHover = React$1.forwardRef((d, C) => {
4109
3892
  }
4110
3893
  });
4111
3894
  }), [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME), ScrollAreaScrollbarImpl = React$1.forwardRef((d, C) => {
4112
- let { __scopeScrollArea: w, sizes: k, hasThumb: F, onThumbChange: L, onThumbPointerUp: V, onThumbPointerDown: U, onThumbPositionChange: K, onDragScroll: q, onWheelScroll: J, onResize: X, ...$ } = d, CO = useScrollAreaContext(SCROLLBAR_NAME, w), [wO, TO] = React$1.useState(null), EO = useComposedRefs(C, (s) => TO(s)), DO = React$1.useRef(null), OO = React$1.useRef(""), kO = CO.viewport, AO = k.content - k.viewport, jO = useCallbackRef(J), NO = useCallbackRef(K), PO = useDebounceCallback(X, 10);
4113
- function FO(s) {
4114
- DO.current && q({
4115
- x: s.clientX - DO.current.left,
4116
- y: s.clientY - DO.current.top
3895
+ let { __scopeScrollArea: w, sizes: k, hasThumb: F, onThumbChange: L, onThumbPointerUp: V, onThumbPointerDown: U, onThumbPositionChange: K, onDragScroll: q, onWheelScroll: J, onResize: X, ...$ } = d, PD = useScrollAreaContext(SCROLLBAR_NAME, w), [FD, ID] = React$1.useState(null), LD = useComposedRefs(C, (s) => ID(s)), RD = React$1.useRef(null), zD = React$1.useRef(""), BD = PD.viewport, VD = k.content - k.viewport, HD = useCallbackRef(J), UD = useCallbackRef(K), GD = useDebounceCallback(X, 10);
3896
+ function KD(s) {
3897
+ RD.current && q({
3898
+ x: s.clientX - RD.current.left,
3899
+ y: s.clientY - RD.current.top
4117
3900
  });
4118
3901
  }
4119
3902
  return React$1.useEffect(() => {
4120
3903
  let s = (s) => {
4121
3904
  let d = s.target;
4122
- wO?.contains(d) && jO(s, AO);
3905
+ FD?.contains(d) && HD(s, VD);
4123
3906
  };
4124
3907
  return document.addEventListener("wheel", s, { passive: !1 }), () => document.removeEventListener("wheel", s, { passive: !1 });
4125
3908
  }, [
4126
- kO,
4127
- wO,
4128
- AO,
4129
- jO
4130
- ]), React$1.useEffect(NO, [k, NO]), useResizeObserver(wO, PO), useResizeObserver(CO.content, PO), /* @__PURE__ */ jsx(ScrollbarProvider, {
3909
+ BD,
3910
+ FD,
3911
+ VD,
3912
+ HD
3913
+ ]), React$1.useEffect(UD, [k, UD]), useResizeObserver(FD, GD), useResizeObserver(PD.content, GD), /* @__PURE__ */ jsx(ScrollbarProvider, {
4131
3914
  scope: w,
4132
- scrollbar: wO,
3915
+ scrollbar: FD,
4133
3916
  hasThumb: F,
4134
3917
  onThumbChange: useCallbackRef(L),
4135
3918
  onThumbPointerUp: useCallbackRef(V),
4136
- onThumbPositionChange: NO,
3919
+ onThumbPositionChange: UD,
4137
3920
  onThumbPointerDown: useCallbackRef(U),
4138
3921
  children: /* @__PURE__ */ jsx(Primitive.div, {
4139
3922
  ...$,
4140
- ref: EO,
3923
+ ref: LD,
4141
3924
  style: {
4142
3925
  position: "absolute",
4143
3926
  ...$.style
4144
3927
  },
4145
3928
  onPointerDown: composeEventHandlers(d.onPointerDown, (s) => {
4146
- s.button === 0 && (s.target.setPointerCapture(s.pointerId), DO.current = wO.getBoundingClientRect(), OO.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", CO.viewport && (CO.viewport.style.scrollBehavior = "auto"), FO(s));
3929
+ s.button === 0 && (s.target.setPointerCapture(s.pointerId), RD.current = FD.getBoundingClientRect(), zD.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", PD.viewport && (PD.viewport.style.scrollBehavior = "auto"), KD(s));
4147
3930
  }),
4148
- onPointerMove: composeEventHandlers(d.onPointerMove, FO),
3931
+ onPointerMove: composeEventHandlers(d.onPointerMove, KD),
4149
3932
  onPointerUp: composeEventHandlers(d.onPointerUp, (s) => {
4150
3933
  let d = s.target;
4151
- d.hasPointerCapture(s.pointerId) && d.releasePointerCapture(s.pointerId), document.body.style.webkitUserSelect = OO.current, CO.viewport && (CO.viewport.style.scrollBehavior = ""), DO.current = null;
3934
+ d.hasPointerCapture(s.pointerId) && d.releasePointerCapture(s.pointerId), document.body.style.webkitUserSelect = zD.current, PD.viewport && (PD.viewport.style.scrollBehavior = ""), RD.current = null;
4152
3935
  })
4153
3936
  })
4154
3937
  });
@@ -4314,46 +4097,46 @@ var Root = ScrollArea, Viewport = ScrollAreaViewport, Scrollbar = ScrollAreaScro
4314
4097
  };
4315
4098
  TooltipProvider.displayName = PROVIDER_NAME;
4316
4099
  var TOOLTIP_NAME = "Tooltip", [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME), Tooltip = (d) => {
4317
- let { __scopeTooltip: C, children: w, open: k, defaultOpen: F, onOpenChange: L, disableHoverableContent: V, delayDuration: U } = d, K = useTooltipProviderContext(TOOLTIP_NAME, d.__scopeTooltip), q = usePopperScope(C), [J, X] = React$1.useState(null), $ = useId$1(), CO = React$1.useRef(0), wO = V ?? K.disableHoverableContent, TO = U ?? K.delayDuration, EO = React$1.useRef(!1), [DO, OO] = useControllableState({
4100
+ let { __scopeTooltip: C, children: w, open: k, defaultOpen: F, onOpenChange: L, disableHoverableContent: V, delayDuration: U } = d, K = useTooltipProviderContext(TOOLTIP_NAME, d.__scopeTooltip), q = usePopperScope(C), [J, X] = React$1.useState(null), $ = useId$1(), PD = React$1.useRef(0), FD = V ?? K.disableHoverableContent, ID = U ?? K.delayDuration, LD = React$1.useRef(!1), [RD, zD] = useControllableState({
4318
4101
  prop: k,
4319
4102
  defaultProp: F ?? !1,
4320
4103
  onChange: (s) => {
4321
4104
  s ? (K.onOpen(), document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))) : K.onClose(), L?.(s);
4322
4105
  },
4323
4106
  caller: TOOLTIP_NAME
4324
- }), kO = React$1.useMemo(() => DO ? EO.current ? "delayed-open" : "instant-open" : "closed", [DO]), AO = React$1.useCallback(() => {
4325
- window.clearTimeout(CO.current), CO.current = 0, EO.current = !1, OO(!0);
4326
- }, [OO]), jO = React$1.useCallback(() => {
4327
- window.clearTimeout(CO.current), CO.current = 0, OO(!1);
4328
- }, [OO]), NO = React$1.useCallback(() => {
4329
- window.clearTimeout(CO.current), CO.current = window.setTimeout(() => {
4330
- EO.current = !0, OO(!0), CO.current = 0;
4331
- }, TO);
4332
- }, [TO, OO]);
4107
+ }), BD = React$1.useMemo(() => RD ? LD.current ? "delayed-open" : "instant-open" : "closed", [RD]), VD = React$1.useCallback(() => {
4108
+ window.clearTimeout(PD.current), PD.current = 0, LD.current = !1, zD(!0);
4109
+ }, [zD]), HD = React$1.useCallback(() => {
4110
+ window.clearTimeout(PD.current), PD.current = 0, zD(!1);
4111
+ }, [zD]), UD = React$1.useCallback(() => {
4112
+ window.clearTimeout(PD.current), PD.current = window.setTimeout(() => {
4113
+ LD.current = !0, zD(!0), PD.current = 0;
4114
+ }, ID);
4115
+ }, [ID, zD]);
4333
4116
  return React$1.useEffect(() => () => {
4334
- CO.current &&= (window.clearTimeout(CO.current), 0);
4335
- }, []), /* @__PURE__ */ jsx(Root2$2, {
4117
+ PD.current &&= (window.clearTimeout(PD.current), 0);
4118
+ }, []), /* @__PURE__ */ jsx(Root2$1, {
4336
4119
  ...q,
4337
4120
  children: /* @__PURE__ */ jsx(TooltipContextProvider, {
4338
4121
  scope: C,
4339
4122
  contentId: $,
4340
- open: DO,
4341
- stateAttribute: kO,
4123
+ open: RD,
4124
+ stateAttribute: BD,
4342
4125
  trigger: J,
4343
4126
  onTriggerChange: X,
4344
4127
  onTriggerEnter: React$1.useCallback(() => {
4345
- K.isOpenDelayedRef.current ? NO() : AO();
4128
+ K.isOpenDelayedRef.current ? UD() : VD();
4346
4129
  }, [
4347
4130
  K.isOpenDelayedRef,
4348
- NO,
4349
- AO
4131
+ UD,
4132
+ VD
4350
4133
  ]),
4351
4134
  onTriggerLeave: React$1.useCallback(() => {
4352
- wO ? jO() : (window.clearTimeout(CO.current), CO.current = 0);
4353
- }, [jO, wO]),
4354
- onOpen: AO,
4355
- onClose: jO,
4356
- disableHoverableContent: wO,
4135
+ FD ? HD() : (window.clearTimeout(PD.current), PD.current = 0);
4136
+ }, [HD, FD]),
4137
+ onOpen: VD,
4138
+ onClose: HD,
4139
+ disableHoverableContent: FD,
4357
4140
  children: w
4358
4141
  })
4359
4142
  });
@@ -4420,7 +4203,7 @@ var CONTENT_NAME = "TooltipContent", TooltipContent = React$1.forwardRef((s, d)
4420
4203
  }), TooltipContentHoverable = React$1.forwardRef((d, C) => {
4421
4204
  let w = useTooltipContext(CONTENT_NAME, d.__scopeTooltip), k = useTooltipProviderContext(CONTENT_NAME, d.__scopeTooltip), F = React$1.useRef(null), L = useComposedRefs(C, F), [V, U] = React$1.useState(null), { trigger: K, onClose: q } = w, J = F.current, { onPointerInTransitChange: X } = k, $ = React$1.useCallback(() => {
4422
4205
  U(null), X(!1);
4423
- }, [X]), CO = React$1.useCallback((s, d) => {
4206
+ }, [X]), PD = React$1.useCallback((s, d) => {
4424
4207
  let C = s.currentTarget, w = {
4425
4208
  x: s.clientX,
4426
4209
  y: s.clientY
@@ -4429,7 +4212,7 @@ var CONTENT_NAME = "TooltipContent", TooltipContent = React$1.forwardRef((s, d)
4429
4212
  }, [X]);
4430
4213
  return React$1.useEffect(() => () => $(), [$]), React$1.useEffect(() => {
4431
4214
  if (K && J) {
4432
- let s = (s) => CO(s, J), d = (s) => CO(s, K);
4215
+ let s = (s) => PD(s, J), d = (s) => PD(s, K);
4433
4216
  return K.addEventListener("pointerleave", s), J.addEventListener("pointerleave", d), () => {
4434
4217
  K.removeEventListener("pointerleave", s), J.removeEventListener("pointerleave", d);
4435
4218
  };
@@ -4437,7 +4220,7 @@ var CONTENT_NAME = "TooltipContent", TooltipContent = React$1.forwardRef((s, d)
4437
4220
  }, [
4438
4221
  K,
4439
4222
  J,
4440
- CO,
4223
+ PD,
4441
4224
  $
4442
4225
  ]), React$1.useEffect(() => {
4443
4226
  if (V) {
@@ -5163,79 +4946,79 @@ R.displayName = "Theme";
5163
4946
  var I$2 = React$1.forwardRef((d, C) => {
5164
4947
  let { appearance: w = s$10.appearance.default, accentColor: k = s$10.accentColor.default, grayColor: F = s$10.grayColor.default, panelBackground: L = s$10.panelBackground.default, radius: V = s$10.radius.default, scaling: U = s$10.scaling.default, hasBackground: K = s$10.hasBackground.default, ...q } = d, [J, X] = React$1.useState(w);
5165
4948
  React$1.useEffect(() => X(w), [w]);
5166
- let [$, CO] = React$1.useState(k);
5167
- React$1.useEffect(() => CO(k), [k]);
5168
- let [wO, TO] = React$1.useState(F);
5169
- React$1.useEffect(() => TO(F), [F]);
5170
- let [EO, DO] = React$1.useState(L);
5171
- React$1.useEffect(() => DO(L), [L]);
5172
- let [OO, kO] = React$1.useState(V);
5173
- React$1.useEffect(() => kO(V), [V]);
5174
- let [AO, jO] = React$1.useState(U);
5175
- return React$1.useEffect(() => jO(U), [U]), React$1.createElement(A$1, {
4949
+ let [$, PD] = React$1.useState(k);
4950
+ React$1.useEffect(() => PD(k), [k]);
4951
+ let [FD, ID] = React$1.useState(F);
4952
+ React$1.useEffect(() => ID(F), [F]);
4953
+ let [LD, RD] = React$1.useState(L);
4954
+ React$1.useEffect(() => RD(L), [L]);
4955
+ let [zD, BD] = React$1.useState(V);
4956
+ React$1.useEffect(() => BD(V), [V]);
4957
+ let [VD, HD] = React$1.useState(U);
4958
+ return React$1.useEffect(() => HD(U), [U]), React$1.createElement(A$1, {
5176
4959
  ...q,
5177
4960
  ref: C,
5178
4961
  isRoot: !0,
5179
4962
  hasBackground: K,
5180
4963
  appearance: J,
5181
4964
  accentColor: $,
5182
- grayColor: wO,
5183
- panelBackground: EO,
5184
- radius: OO,
5185
- scaling: AO,
4965
+ grayColor: FD,
4966
+ panelBackground: LD,
4967
+ radius: zD,
4968
+ scaling: VD,
5186
4969
  onAppearanceChange: X,
5187
- onAccentColorChange: CO,
5188
- onGrayColorChange: TO,
5189
- onPanelBackgroundChange: DO,
5190
- onRadiusChange: kO,
5191
- onScalingChange: jO
4970
+ onAccentColorChange: PD,
4971
+ onGrayColorChange: ID,
4972
+ onPanelBackgroundChange: RD,
4973
+ onRadiusChange: BD,
4974
+ onScalingChange: HD
5192
4975
  });
5193
4976
  });
5194
4977
  I$2.displayName = "ThemeRoot";
5195
4978
  var A$1 = React$1.forwardRef((d, C) => {
5196
- let w = React$1.useContext(P), { asChild: k, isRoot: F, hasBackground: L, appearance: V = w?.appearance ?? s$10.appearance.default, accentColor: U = w?.accentColor ?? s$10.accentColor.default, grayColor: K = w?.resolvedGrayColor ?? s$10.grayColor.default, panelBackground: q = w?.panelBackground ?? s$10.panelBackground.default, radius: J = w?.radius ?? s$10.radius.default, scaling: X = w?.scaling ?? s$10.scaling.default, onAppearanceChange: $ = d$4, onAccentColorChange: CO = d$4, onGrayColorChange: wO = d$4, onPanelBackgroundChange: TO = d$4, onRadiusChange: EO = d$4, onScalingChange: DO = d$4, ...OO } = d, kO = k ? Slot$2 : "div", AO = K === "auto" ? a$8(U) : K, jO = d.appearance === "light" || d.appearance === "dark", MO = L === void 0 ? F || jO : L;
4979
+ let w = React$1.useContext(P), { asChild: k, isRoot: F, hasBackground: L, appearance: V = w?.appearance ?? s$10.appearance.default, accentColor: U = w?.accentColor ?? s$10.accentColor.default, grayColor: K = w?.resolvedGrayColor ?? s$10.grayColor.default, panelBackground: q = w?.panelBackground ?? s$10.panelBackground.default, radius: J = w?.radius ?? s$10.radius.default, scaling: X = w?.scaling ?? s$10.scaling.default, onAppearanceChange: $ = d$4, onAccentColorChange: PD = d$4, onGrayColorChange: FD = d$4, onPanelBackgroundChange: ID = d$4, onRadiusChange: LD = d$4, onScalingChange: RD = d$4, ...zD } = d, BD = k ? Slot$2 : "div", VD = K === "auto" ? a$8(U) : K, HD = d.appearance === "light" || d.appearance === "dark", UD = L === void 0 ? F || HD : L;
5197
4980
  return React$1.createElement(P.Provider, { value: React$1.useMemo(() => ({
5198
4981
  appearance: V,
5199
4982
  accentColor: U,
5200
4983
  grayColor: K,
5201
- resolvedGrayColor: AO,
4984
+ resolvedGrayColor: VD,
5202
4985
  panelBackground: q,
5203
4986
  radius: J,
5204
4987
  scaling: X,
5205
4988
  onAppearanceChange: $,
5206
- onAccentColorChange: CO,
5207
- onGrayColorChange: wO,
5208
- onPanelBackgroundChange: TO,
5209
- onRadiusChange: EO,
5210
- onScalingChange: DO
4989
+ onAccentColorChange: PD,
4990
+ onGrayColorChange: FD,
4991
+ onPanelBackgroundChange: ID,
4992
+ onRadiusChange: LD,
4993
+ onScalingChange: RD
5211
4994
  }), [
5212
4995
  V,
5213
4996
  U,
5214
4997
  K,
5215
- AO,
4998
+ VD,
5216
4999
  q,
5217
5000
  J,
5218
5001
  X,
5219
5002
  $,
5220
- CO,
5221
- wO,
5222
- TO,
5223
- EO,
5224
- DO
5225
- ]) }, React$1.createElement(kO, {
5003
+ PD,
5004
+ FD,
5005
+ ID,
5006
+ LD,
5007
+ RD
5008
+ ]) }, React$1.createElement(BD, {
5226
5009
  "data-is-root-theme": F ? "true" : "false",
5227
5010
  "data-accent-color": U,
5228
- "data-gray-color": AO,
5229
- "data-has-background": MO ? "true" : "false",
5011
+ "data-gray-color": VD,
5012
+ "data-has-background": UD ? "true" : "false",
5230
5013
  "data-panel-background": q,
5231
5014
  "data-radius": J,
5232
5015
  "data-scaling": X,
5233
5016
  ref: C,
5234
- ...OO,
5017
+ ...zD,
5235
5018
  className: (0, import_classnames$13.default)("radix-themes", {
5236
5019
  light: V === "light",
5237
5020
  dark: V === "dark"
5238
- }, OO.className)
5021
+ }, zD.className)
5239
5022
  }));
5240
5023
  });
5241
5024
  A$1.displayName = "ThemeImpl";
@@ -5886,16 +5669,16 @@ function S$1(s) {
5886
5669
  customProperties: ["--margin-bottom"],
5887
5670
  propValues: r$5,
5888
5671
  value: s.mb
5889
- }), [$, CO] = R$3({
5672
+ }), [$, PD] = R$3({
5890
5673
  className: "rt-r-ml",
5891
5674
  customProperties: ["--margin-left"],
5892
5675
  propValues: r$5,
5893
5676
  value: s.ml
5894
5677
  });
5895
- return [(0, import_classnames$6.default)(d, w, F, V, K, J, $), l$1(C, k, L, U, q, X, CO)];
5678
+ return [(0, import_classnames$6.default)(d, w, F, V, K, J, $), l$1(C, k, L, U, q, X, PD)];
5896
5679
  }
5897
5680
  var import_classnames$5 = /* @__PURE__ */ __toESM(require_classnames()), c = React$1.forwardRef((d, C) => {
5898
- let { rest: w, ...k } = a$3(d), [F, L] = S$1(k), { asChild: V, children: U, className: K, style: q, type: J, scrollHideDelay: X = J === "scroll" ? void 0 : 0, dir: $, size: CO = t$1.size.default, radius: wO = t$1.radius.default, scrollbars: TO = t$1.scrollbars.default, ...EO } = w;
5681
+ let { rest: w, ...k } = a$3(d), [F, L] = S$1(k), { asChild: V, children: U, className: K, style: q, type: J, scrollHideDelay: X = J === "scroll" ? void 0 : 0, dir: $, size: PD = t$1.size.default, radius: FD = t$1.radius.default, scrollbars: ID = t$1.scrollbars.default, ...LD } = w;
5899
5682
  return React$1.createElement(Root, {
5900
5683
  type: J,
5901
5684
  scrollHideDelay: X,
@@ -5906,26 +5689,26 @@ var import_classnames$5 = /* @__PURE__ */ __toESM(require_classnames()), c = Rea
5906
5689
  asChild: V,
5907
5690
  children: U
5908
5691
  }, (d) => React$1.createElement(React$1.Fragment, null, React$1.createElement(Viewport, {
5909
- ...EO,
5692
+ ...LD,
5910
5693
  ref: C,
5911
5694
  className: "rt-ScrollAreaViewport"
5912
- }, d), React$1.createElement("div", { className: "rt-ScrollAreaViewportFocusRing" }), TO === "vertical" ? null : React$1.createElement(Scrollbar, {
5913
- "data-radius": wO,
5695
+ }, d), React$1.createElement("div", { className: "rt-ScrollAreaViewportFocusRing" }), ID === "vertical" ? null : React$1.createElement(Scrollbar, {
5696
+ "data-radius": FD,
5914
5697
  orientation: "horizontal",
5915
5698
  className: (0, import_classnames$5.default)("rt-ScrollAreaScrollbar", g$2({
5916
5699
  className: "rt-r-size",
5917
- value: CO,
5700
+ value: PD,
5918
5701
  propValues: t$1.size.values
5919
5702
  }))
5920
- }, React$1.createElement(Thumb, { className: "rt-ScrollAreaThumb" })), TO === "horizontal" ? null : React$1.createElement(Scrollbar, {
5921
- "data-radius": wO,
5703
+ }, React$1.createElement(Thumb, { className: "rt-ScrollAreaThumb" })), ID === "horizontal" ? null : React$1.createElement(Scrollbar, {
5704
+ "data-radius": FD,
5922
5705
  orientation: "vertical",
5923
5706
  className: (0, import_classnames$5.default)("rt-ScrollAreaScrollbar", g$2({
5924
5707
  className: "rt-r-size",
5925
- value: CO,
5708
+ value: PD,
5926
5709
  propValues: t$1.size.values
5927
5710
  }))
5928
- }, React$1.createElement(Thumb, { className: "rt-ScrollAreaThumb" })), TO === "both" ? React$1.createElement(Corner, { className: "rt-ScrollAreaCorner" }) : null)));
5711
+ }, React$1.createElement(Thumb, { className: "rt-ScrollAreaThumb" })), ID === "both" ? React$1.createElement(Corner, { className: "rt-ScrollAreaCorner" }) : null)));
5929
5712
  });
5930
5713
  c.displayName = "ScrollArea";
5931
5714
  var n$1 = {
@@ -5956,7 +5739,7 @@ var n$1 = {
5956
5739
  modal: !0
5957
5740
  });
5958
5741
  s$2.displayName = "Dialog.Root";
5959
- var n$2 = React$1.forwardRef(({ children: d, ...C }, w) => React$1.createElement(Trigger$2, {
5742
+ var n$2 = React$1.forwardRef(({ children: d, ...C }, w) => React$1.createElement(Trigger$1, {
5960
5743
  ...C,
5961
5744
  ref: w,
5962
5745
  asChild: !0
@@ -6928,17 +6711,17 @@ function $e({ document: s, event: d, hitRegions: C, initialLayoutMap: w, mounted
6928
6711
  C.forEach((s) => {
6929
6712
  let { group: C, groupSize: U } = s, { disableCursor: K, orientation: q, panels: J } = C, X = 0;
6930
6713
  X = F ? q === "horizontal" ? (d.clientX - F.x) / U * 100 : (d.clientY - F.y) / U * 100 : q === "horizontal" ? d.clientX < 0 ? -100 : 100 : d.clientY < 0 ? -100 : 100;
6931
- let $ = w.get(C), { defaultLayoutDeferred: CO, derivedPanelConstraints: wO, layout: TO, separatorToPanels: EO } = k.get(C) ?? { defaultLayoutDeferred: !1 };
6932
- if (wO && $ && TO && EO) {
6714
+ let $ = w.get(C), { defaultLayoutDeferred: PD, derivedPanelConstraints: FD, layout: ID, separatorToPanels: LD } = k.get(C) ?? { defaultLayoutDeferred: !1 };
6715
+ if (FD && $ && ID && LD) {
6933
6716
  let d = Z({
6934
6717
  delta: X,
6935
6718
  initialLayout: $,
6936
- panelConstraints: wO,
6719
+ panelConstraints: FD,
6937
6720
  pivotIndices: s.panels.map((s) => J.indexOf(s)),
6938
- prevLayout: TO,
6721
+ prevLayout: ID,
6939
6722
  trigger: "mouse-or-touch"
6940
6723
  });
6941
- if (B(d, TO)) {
6724
+ if (B(d, ID)) {
6942
6725
  if (X !== 0 && !K) switch (q) {
6943
6726
  case "horizontal":
6944
6727
  L |= X < 0 ? De : Oe;
@@ -6949,10 +6732,10 @@ function $e({ document: s, event: d, hitRegions: C, initialLayoutMap: w, mounted
6949
6732
  }
6950
6733
  } else {
6951
6734
  V.set(s.group, {
6952
- defaultLayoutDeferred: CO,
6953
- derivedPanelConstraints: wO,
6735
+ defaultLayoutDeferred: PD,
6736
+ derivedPanelConstraints: FD,
6954
6737
  layout: d,
6955
- separatorToPanels: EO
6738
+ separatorToPanels: LD
6956
6739
  });
6957
6740
  let C = s.group.panels.map(({ id: s }) => s).join(",");
6958
6741
  s.group.inMemoryLayouts[C] = d;
@@ -7162,66 +6945,66 @@ function Pt(s, d) {
7162
6945
  });
7163
6946
  }
7164
6947
  function Rt({ children: s, className: d, defaultLayout: C, disableCursor: w, disabled: k, elementRef: F, groupRef: L, id: V, onLayoutChange: U, orientation: K = "horizontal", style: q, ...X }) {
7165
- let $ = useRef({}), CO = le((s) => {
6948
+ let $ = useRef({}), PD = le((s) => {
7166
6949
  B($.current, s) || ($.current = s, U?.(s));
7167
- }), wO = ae(V), OO = useRef(null), [kO, AO] = useState(!1), [jO, NO] = useState(C ?? {}), [PO, FO] = wt(), IO = useRef({
6950
+ }), FD = ae(V), zD = useRef(null), [BD, VD] = useState(!1), [HD, UD] = useState(C ?? {}), [GD, KD] = wt(), qD = useRef({
7168
6951
  lastExpandedPanelSizes: {},
7169
6952
  layouts: {},
7170
6953
  panels: [],
7171
6954
  separators: []
7172
- }), LO = ue(OO, F);
7173
- Pt(wO, L);
7174
- let RO = useMemo(() => ({
7175
- id: wO,
6955
+ }), JD = ue(zD, F);
6956
+ Pt(FD, L);
6957
+ let YD = useMemo(() => ({
6958
+ id: FD,
7176
6959
  orientation: K,
7177
6960
  registerPanel: (s) => {
7178
- let d = IO.current;
7179
- return d.panels = ie(K, [...d.panels, s]), FO(), () => {
7180
- d.panels = d.panels.filter((d) => d !== s), FO();
6961
+ let d = qD.current;
6962
+ return d.panels = ie(K, [...d.panels, s]), KD(), () => {
6963
+ d.panels = d.panels.filter((d) => d !== s), KD();
7181
6964
  };
7182
6965
  },
7183
6966
  registerSeparator: (s) => {
7184
- let d = IO.current;
7185
- return d.separators = ie(K, [...d.separators, s]), FO(), () => {
7186
- d.separators = d.separators.filter((d) => d !== s), FO();
6967
+ let d = qD.current;
6968
+ return d.separators = ie(K, [...d.separators, s]), KD(), () => {
6969
+ d.separators = d.separators.filter((d) => d !== s), KD();
7187
6970
  };
7188
6971
  }
7189
6972
  }), [
7190
- wO,
7191
- FO,
6973
+ FD,
6974
+ KD,
7192
6975
  K
7193
- ]), zO = Lt({
6976
+ ]), XD = Lt({
7194
6977
  defaultLayout: C,
7195
6978
  disableCursor: w
7196
- }), BO = useRef(null);
6979
+ }), ZD = useRef(null);
7197
6980
  A(() => {
7198
- let s = OO.current;
6981
+ let s = zD.current;
7199
6982
  if (s === null) return;
7200
- let d = IO.current, C = {
7201
- defaultLayout: zO.defaultLayout,
7202
- disableCursor: !!zO.disableCursor,
6983
+ let d = qD.current, C = {
6984
+ defaultLayout: XD.defaultLayout,
6985
+ disableCursor: !!XD.disableCursor,
7203
6986
  disabled: !!k,
7204
6987
  element: s,
7205
- id: wO,
7206
- inMemoryLastExpandedPanelSizes: IO.current.lastExpandedPanelSizes,
7207
- inMemoryLayouts: IO.current.layouts,
6988
+ id: FD,
6989
+ inMemoryLastExpandedPanelSizes: qD.current.lastExpandedPanelSizes,
6990
+ inMemoryLayouts: qD.current.layouts,
7208
6991
  orientation: K,
7209
6992
  panels: d.panels,
7210
6993
  separators: d.separators
7211
6994
  };
7212
- BO.current = C;
6995
+ ZD.current = C;
7213
6996
  let w = bt(C), F = D().mountedGroups.get(C);
7214
6997
  if (F) {
7215
6998
  let { defaultLayoutDeferred: s, derivedPanelConstraints: d, layout: C } = F;
7216
- !s && d.length > 0 && (NO(C), CO?.(C));
6999
+ !s && d.length > 0 && (UD(C), PD?.(C));
7217
7000
  }
7218
7001
  let L = T.addListener("interactionStateChange", (s) => {
7219
7002
  switch (s.state) {
7220
7003
  case "active":
7221
- AO(s.hitRegions.some((s) => s.group === C));
7004
+ VD(s.hitRegions.some((s) => s.group === C));
7222
7005
  break;
7223
7006
  default:
7224
- AO(!1);
7007
+ VD(!1);
7225
7008
  break;
7226
7009
  }
7227
7010
  }), V = T.addListener("mountedGroupsChange", (s) => {
@@ -7229,44 +7012,44 @@ function Rt({ children: s, className: d, defaultLayout: C, disableCursor: w, dis
7229
7012
  if (d) {
7230
7013
  let { defaultLayoutDeferred: s, derivedPanelConstraints: C, layout: w } = d;
7231
7014
  if (s || C.length === 0) return;
7232
- NO(w), CO?.(w);
7015
+ UD(w), PD?.(w);
7233
7016
  }
7234
7017
  });
7235
7018
  return () => {
7236
- BO.current = null, w(), L(), V();
7019
+ ZD.current = null, w(), L(), V();
7237
7020
  };
7238
7021
  }, [
7239
7022
  k,
7240
- wO,
7241
- CO,
7023
+ FD,
7024
+ PD,
7242
7025
  K,
7243
- PO,
7244
- zO
7026
+ GD,
7027
+ XD
7245
7028
  ]), useEffect(() => {
7246
- let s = BO.current;
7029
+ let s = ZD.current;
7247
7030
  s && (s.defaultLayout = C, s.disableCursor = !!w);
7248
7031
  });
7249
- let VO = { [Fe]: kO ? "none" : void 0 };
7250
- for (let s in jO) {
7251
- let d = Ve(wO, s);
7252
- VO[d] = jO[s];
7032
+ let QD = { [Fe]: BD ? "none" : void 0 };
7033
+ for (let s in HD) {
7034
+ let d = Ve(FD, s);
7035
+ QD[d] = HD[s];
7253
7036
  }
7254
7037
  return /* @__PURE__ */ jsx(je.Provider, {
7255
- value: RO,
7038
+ value: YD,
7256
7039
  children: /* @__PURE__ */ jsx("div", {
7257
7040
  ...X,
7258
7041
  "aria-orientation": K,
7259
7042
  className: d,
7260
7043
  "data-group": !0,
7261
- "data-testid": wO,
7262
- id: wO,
7263
- ref: LO,
7044
+ "data-testid": FD,
7045
+ id: FD,
7046
+ ref: JD,
7264
7047
  style: {
7265
7048
  height: "100%",
7266
7049
  width: "100%",
7267
7050
  overflow: "hidden",
7268
7051
  ...q,
7269
- ...VO,
7052
+ ...QD,
7270
7053
  display: "flex",
7271
7054
  flexDirection: K === "horizontal" ? "row" : "column",
7272
7055
  flexWrap: "nowrap"
@@ -7384,20 +7167,20 @@ function It(s, d) {
7384
7167
  });
7385
7168
  }
7386
7169
  function kt({ children: s, className: d, collapsedSize: C = "0%", collapsible: w = !1, defaultSize: k, elementRef: F, id: L, maxSize: V = "100%", minSize: U = "0%", onResize: K, panelRef: q, style: J, ...X }) {
7387
- let $ = !!L, CO = ae(L), wO = useRef(null), TO = ue(wO, F), { id: DO, registerPanel: OO } = ce(), kO = K !== null, AO = le((s, d, C) => {
7170
+ let $ = !!L, PD = ae(L), FD = useRef(null), ID = ue(FD, F), { id: RD, registerPanel: zD } = ce(), BD = K !== null, VD = le((s, d, C) => {
7388
7171
  K?.(s, L, C);
7389
7172
  });
7390
7173
  A(() => {
7391
- let s = wO.current;
7392
- if (s !== null) return OO({
7174
+ let s = FD.current;
7175
+ if (s !== null) return zD({
7393
7176
  element: s,
7394
- id: CO,
7177
+ id: PD,
7395
7178
  idIsStable: $,
7396
7179
  mutableValues: {
7397
7180
  expandToSize: void 0,
7398
7181
  prevSize: void 0
7399
7182
  },
7400
- onResize: kO ? AO : void 0,
7183
+ onResize: BD ? VD : void 0,
7401
7184
  panelConstraints: {
7402
7185
  collapsedSize: C,
7403
7186
  collapsible: w,
@@ -7410,25 +7193,25 @@ function kt({ children: s, className: d, collapsedSize: C = "0%", collapsible: w
7410
7193
  C,
7411
7194
  w,
7412
7195
  k,
7413
- kO,
7414
- CO,
7196
+ BD,
7197
+ PD,
7415
7198
  $,
7416
7199
  V,
7417
7200
  U,
7418
- AO,
7419
- OO
7420
- ]), It(CO, q);
7421
- let jO = Ve(DO, CO);
7201
+ VD,
7202
+ zD
7203
+ ]), It(PD, q);
7204
+ let HD = Ve(RD, PD);
7422
7205
  return /* @__PURE__ */ jsx("div", {
7423
7206
  ...X,
7424
7207
  "data-panel": !0,
7425
- "data-testid": CO,
7426
- id: CO,
7427
- ref: TO,
7208
+ "data-testid": PD,
7209
+ id: PD,
7210
+ ref: ID,
7428
7211
  style: {
7429
7212
  ...Gt,
7430
7213
  flexBasis: 0,
7431
- flexGrow: `var(${jO}, 1)`,
7214
+ flexGrow: `var(${HD}, 1)`,
7432
7215
  flexShrink: 1,
7433
7216
  overflow: "hidden",
7434
7217
  pointerEvents: `var(${Fe})`
@@ -7491,14 +7274,14 @@ function Dt({ layout: s, panelConstraints: d, panelId: C, panelIndex: w }) {
7491
7274
  };
7492
7275
  }
7493
7276
  function Ot({ children: s, className: d, elementRef: C, id: w, style: k, ...F }) {
7494
- let L = ae(w), [V, U] = useState({}), [K, q] = useState("inactive"), J = useRef(null), X = ue(J, C), { id: $, orientation: CO, registerSeparator: wO } = ce(), TO = CO === "horizontal" ? "vertical" : "horizontal";
7277
+ let L = ae(w), [V, U] = useState({}), [K, q] = useState("inactive"), J = useRef(null), X = ue(J, C), { id: $, orientation: PD, registerSeparator: FD } = ce(), ID = PD === "horizontal" ? "vertical" : "horizontal";
7495
7278
  return A(() => {
7496
7279
  let s = J.current;
7497
7280
  if (s !== null) {
7498
7281
  let d = {
7499
7282
  element: s,
7500
7283
  id: L
7501
- }, C = wO(d), w = T.addListener("interactionStateChange", (s) => {
7284
+ }, C = FD(d), w = T.addListener("interactionStateChange", (s) => {
7502
7285
  q(s.state !== "inactive" && s.hitRegions.some((s) => s.separator === d) ? s.state : "inactive");
7503
7286
  }), k = T.addListener("mountedGroupsChange", (s) => {
7504
7287
  s.forEach(({ derivedPanelConstraints: s, layout: C, separatorToPanels: w }, k) => {
@@ -7523,11 +7306,11 @@ function Ot({ children: s, className: d, elementRef: C, id: w, style: k, ...F })
7523
7306
  }, [
7524
7307
  $,
7525
7308
  L,
7526
- wO
7309
+ FD
7527
7310
  ]), /* @__PURE__ */ jsx("div", {
7528
7311
  ...F,
7529
7312
  "aria-controls": V.valueControls,
7530
- "aria-orientation": TO,
7313
+ "aria-orientation": ID,
7531
7314
  "aria-valuemax": V.valueMax,
7532
7315
  "aria-valuemin": V.valueMin,
7533
7316
  "aria-valuenow": V.valueNow,
@@ -7753,7 +7536,7 @@ const EditorProvider = ({ children: s, isList: C = !1, availableProps: w = [], t
7753
7536
  mockData: s,
7754
7537
  singleMockData: d
7755
7538
  }));
7756
- }, []), CO = React.useCallback((s) => {
7539
+ }, []), PD = React.useCallback((s) => {
7757
7540
  L((d) => ({
7758
7541
  ...d,
7759
7542
  listSettings: {
@@ -7761,7 +7544,7 @@ const EditorProvider = ({ children: s, isList: C = !1, availableProps: w = [], t
7761
7544
  ...s
7762
7545
  }
7763
7546
  }));
7764
- }, []), wO = React.useMemo(() => ({
7547
+ }, []), FD = React.useMemo(() => ({
7765
7548
  state: F,
7766
7549
  addElement: U,
7767
7550
  removeElement: K,
@@ -7769,7 +7552,7 @@ const EditorProvider = ({ children: s, isList: C = !1, availableProps: w = [], t
7769
7552
  moveElement: J,
7770
7553
  updateElement: X,
7771
7554
  setMockData: $,
7772
- updateListSettings: CO,
7555
+ updateListSettings: PD,
7773
7556
  loadState: V
7774
7557
  }), [
7775
7558
  F,
@@ -7779,11 +7562,11 @@ const EditorProvider = ({ children: s, isList: C = !1, availableProps: w = [], t
7779
7562
  J,
7780
7563
  X,
7781
7564
  $,
7782
- CO,
7565
+ PD,
7783
7566
  V
7784
7567
  ]);
7785
7568
  return /* @__PURE__ */ jsx(EditorContext.Provider, {
7786
- value: wO,
7569
+ value: FD,
7787
7570
  children: s
7788
7571
  });
7789
7572
  }, useEditor = () => {
@@ -8076,16 +7859,16 @@ var __assign$1 = function() {
8076
7859
  maxHeight: d
8077
7860
  };
8078
7861
  }, d.prototype.calculateNewSizeFromDirection = function(s, d) {
8079
- var C = this.props.scale || 1, w = normalizeToPair(this.props.resizeRatio || 1), k = w[0], F = w[1], L = this.state, V = L.direction, U = L.original, K = this.props, q = K.lockAspectRatio, J = K.lockAspectRatioExtraHeight, X = K.lockAspectRatioExtraWidth, $ = U.width, CO = U.height, wO = J || 0, TO = X || 0;
8080
- return hasDirection("right", V) && ($ = U.width + (s - U.x) * k / C, q && (CO = ($ - TO) / this.ratio + wO)), hasDirection("left", V) && ($ = U.width - (s - U.x) * k / C, q && (CO = ($ - TO) / this.ratio + wO)), hasDirection("bottom", V) && (CO = U.height + (d - U.y) * F / C, q && ($ = (CO - wO) * this.ratio + TO)), hasDirection("top", V) && (CO = U.height - (d - U.y) * F / C, q && ($ = (CO - wO) * this.ratio + TO)), {
7862
+ var C = this.props.scale || 1, w = normalizeToPair(this.props.resizeRatio || 1), k = w[0], F = w[1], L = this.state, V = L.direction, U = L.original, K = this.props, q = K.lockAspectRatio, J = K.lockAspectRatioExtraHeight, X = K.lockAspectRatioExtraWidth, $ = U.width, PD = U.height, FD = J || 0, ID = X || 0;
7863
+ return hasDirection("right", V) && ($ = U.width + (s - U.x) * k / C, q && (PD = ($ - ID) / this.ratio + FD)), hasDirection("left", V) && ($ = U.width - (s - U.x) * k / C, q && (PD = ($ - ID) / this.ratio + FD)), hasDirection("bottom", V) && (PD = U.height + (d - U.y) * F / C, q && ($ = (PD - FD) * this.ratio + ID)), hasDirection("top", V) && (PD = U.height - (d - U.y) * F / C, q && ($ = (PD - FD) * this.ratio + ID)), {
8081
7864
  newWidth: $,
8082
- newHeight: CO
7865
+ newHeight: PD
8083
7866
  };
8084
7867
  }, d.prototype.calculateNewSizeFromAspectRatio = function(s, d, C, w) {
8085
7868
  var k = this.props, F = k.lockAspectRatio, L = k.lockAspectRatioExtraHeight, V = k.lockAspectRatioExtraWidth, U = w.width === void 0 ? 10 : w.width, K = C.width === void 0 || C.width < 0 ? s : C.width, q = w.height === void 0 ? 10 : w.height, J = C.height === void 0 || C.height < 0 ? d : C.height, X = L || 0, $ = V || 0;
8086
7869
  if (F) {
8087
- var CO = (q - X) * this.ratio + $, wO = (J - X) * this.ratio + $, TO = (U - $) / this.ratio + X, EO = (K - $) / this.ratio + X, DO = Math.max(U, CO), OO = Math.min(K, wO), kO = Math.max(q, TO), AO = Math.min(J, EO);
8088
- s = clamp$1(s, DO, OO), d = clamp$1(d, kO, AO);
7870
+ var PD = (q - X) * this.ratio + $, FD = (J - X) * this.ratio + $, ID = (U - $) / this.ratio + X, LD = (K - $) / this.ratio + X, RD = Math.max(U, PD), zD = Math.min(K, FD), BD = Math.max(q, ID), VD = Math.min(J, LD);
7871
+ s = clamp$1(s, RD, zD), d = clamp$1(d, BD, VD);
8089
7872
  } else s = clamp$1(s, U, K), d = clamp$1(d, q, J);
8090
7873
  return {
8091
7874
  newWidth: s,
@@ -8140,58 +7923,58 @@ var __assign$1 = function() {
8140
7923
  if (this.window.TouchEvent && isTouchEvent(s)) try {
8141
7924
  s.preventDefault(), s.stopPropagation();
8142
7925
  } catch {}
8143
- var C = this.props, w = C.maxWidth, k = C.maxHeight, F = C.minWidth, L = C.minHeight, V = isTouchEvent(s) ? s.touches[0].clientX : s.clientX, U = isTouchEvent(s) ? s.touches[0].clientY : s.clientY, K = this.state, q = K.direction, J = K.original, X = K.width, $ = K.height, CO = this.getParentSize(), wO = calculateNewMax(CO, this.window.innerWidth, this.window.innerHeight, w, k, F, L);
8144
- w = wO.maxWidth, k = wO.maxHeight, F = wO.minWidth, L = wO.minHeight;
8145
- var TO = this.calculateNewSizeFromDirection(V, U), EO = TO.newHeight, DO = TO.newWidth, OO = this.calculateNewMaxFromBoundary(w, k);
8146
- this.props.snap && this.props.snap.x && (DO = findClosestSnap(DO, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (EO = findClosestSnap(EO, this.props.snap.y, this.props.snapGap));
8147
- var kO = this.calculateNewSizeFromAspectRatio(DO, EO, {
8148
- width: OO.maxWidth,
8149
- height: OO.maxHeight
7926
+ var C = this.props, w = C.maxWidth, k = C.maxHeight, F = C.minWidth, L = C.minHeight, V = isTouchEvent(s) ? s.touches[0].clientX : s.clientX, U = isTouchEvent(s) ? s.touches[0].clientY : s.clientY, K = this.state, q = K.direction, J = K.original, X = K.width, $ = K.height, PD = this.getParentSize(), FD = calculateNewMax(PD, this.window.innerWidth, this.window.innerHeight, w, k, F, L);
7927
+ w = FD.maxWidth, k = FD.maxHeight, F = FD.minWidth, L = FD.minHeight;
7928
+ var ID = this.calculateNewSizeFromDirection(V, U), LD = ID.newHeight, RD = ID.newWidth, zD = this.calculateNewMaxFromBoundary(w, k);
7929
+ this.props.snap && this.props.snap.x && (RD = findClosestSnap(RD, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (LD = findClosestSnap(LD, this.props.snap.y, this.props.snapGap));
7930
+ var BD = this.calculateNewSizeFromAspectRatio(RD, LD, {
7931
+ width: zD.maxWidth,
7932
+ height: zD.maxHeight
8150
7933
  }, {
8151
7934
  width: F,
8152
7935
  height: L
8153
7936
  });
8154
- if (DO = kO.newWidth, EO = kO.newHeight, this.props.grid) {
8155
- var jO = snap(DO, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), MO = snap(EO, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), NO = this.props.snapGap || 0, PO = NO === 0 || Math.abs(jO - DO) <= NO ? jO : DO, FO = NO === 0 || Math.abs(MO - EO) <= NO ? MO : EO;
8156
- DO = PO, EO = FO;
7937
+ if (RD = BD.newWidth, LD = BD.newHeight, this.props.grid) {
7938
+ var VD = snap(RD, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), UD = snap(LD, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), WD = this.props.snapGap || 0, GD = WD === 0 || Math.abs(VD - RD) <= WD ? VD : RD, KD = WD === 0 || Math.abs(UD - LD) <= WD ? UD : LD;
7939
+ RD = GD, LD = KD;
8157
7940
  }
8158
- var IO = {
8159
- width: DO - J.width,
8160
- height: EO - J.height
7941
+ var qD = {
7942
+ width: RD - J.width,
7943
+ height: LD - J.height
8161
7944
  };
8162
- if (this.delta = IO, X && typeof X == "string") {
7945
+ if (this.delta = qD, X && typeof X == "string") {
8163
7946
  if (X.endsWith("%")) {
8164
- var LO = DO / CO.width * 100;
8165
- DO = `${LO}%`;
7947
+ var JD = RD / PD.width * 100;
7948
+ RD = `${JD}%`;
8166
7949
  } else if (X.endsWith("vw")) {
8167
- var RO = DO / this.window.innerWidth * 100;
8168
- DO = `${RO}vw`;
7950
+ var YD = RD / this.window.innerWidth * 100;
7951
+ RD = `${YD}vw`;
8169
7952
  } else if (X.endsWith("vh")) {
8170
- var zO = DO / this.window.innerHeight * 100;
8171
- DO = `${zO}vh`;
7953
+ var XD = RD / this.window.innerHeight * 100;
7954
+ RD = `${XD}vh`;
8172
7955
  }
8173
7956
  }
8174
7957
  if ($ && typeof $ == "string") {
8175
7958
  if ($.endsWith("%")) {
8176
- var LO = EO / CO.height * 100;
8177
- EO = `${LO}%`;
7959
+ var JD = LD / PD.height * 100;
7960
+ LD = `${JD}%`;
8178
7961
  } else if ($.endsWith("vw")) {
8179
- var RO = EO / this.window.innerWidth * 100;
8180
- EO = `${RO}vw`;
7962
+ var YD = LD / this.window.innerWidth * 100;
7963
+ LD = `${YD}vw`;
8181
7964
  } else if ($.endsWith("vh")) {
8182
- var zO = EO / this.window.innerHeight * 100;
8183
- EO = `${zO}vh`;
7965
+ var XD = LD / this.window.innerHeight * 100;
7966
+ LD = `${XD}vh`;
8184
7967
  }
8185
7968
  }
8186
- var BO = {
8187
- width: this.createSizeForCssProperty(DO, "width"),
8188
- height: this.createSizeForCssProperty(EO, "height")
7969
+ var ZD = {
7970
+ width: this.createSizeForCssProperty(RD, "width"),
7971
+ height: this.createSizeForCssProperty(LD, "height")
8189
7972
  };
8190
- this.flexDir === "row" ? BO.flexBasis = BO.width : this.flexDir === "column" && (BO.flexBasis = BO.height);
8191
- var VO = this.state.width !== BO.width, HO = this.state.height !== BO.height, UO = this.state.flexBasis !== BO.flexBasis, WO = VO || HO || UO;
8192
- WO && flushSync(function() {
8193
- d.setState(BO);
8194
- }), this.props.onResize && WO && this.props.onResize(s, q, this.resizable, IO);
7973
+ this.flexDir === "row" ? ZD.flexBasis = ZD.width : this.flexDir === "column" && (ZD.flexBasis = ZD.height);
7974
+ var QD = this.state.width !== ZD.width, $D = this.state.height !== ZD.height, eO = this.state.flexBasis !== ZD.flexBasis, tO = QD || $D || eO;
7975
+ tO && flushSync(function() {
7976
+ d.setState(ZD);
7977
+ }), this.props.onResize && tO && this.props.onResize(s, q, this.resizable, qD);
8195
7978
  }
8196
7979
  }, d.prototype.onMouseUp = function(s) {
8197
7980
  var d = this.state, C = d.isResizing, w = d.direction;
@@ -8274,40 +8057,75 @@ var __assign$1 = function() {
8274
8057
  resizeRatio: 1,
8275
8058
  snapGap: 0
8276
8059
  }, d;
8277
- }(PureComponent);
8278
- const ElementContextMenu = ({ children: s, element: C }) => {
8279
- let { updateElement: w, removeElement: k, addElement: F, moveElement: L, state: V } = useEditor(), [U, K] = useState(!1), [q, J] = useState(!1), [X, $] = useState(C.content), [CO, wO] = useState(C.dataBinding || ""), TO = useRef(null), OO = (s) => {
8280
- let d = TO.current;
8060
+ }(PureComponent), MenuItem = ({ children: s, onClick: d, rightSlot: C, style: w, className: k }) => /* @__PURE__ */ jsxs("div", {
8061
+ className: `custom-menu-item ${k || ""}`,
8062
+ onClick: (s) => {
8063
+ s.stopPropagation(), d && d();
8064
+ },
8065
+ style: w,
8066
+ children: [s, C && /* @__PURE__ */ jsx("div", {
8067
+ className: "custom-menu-right-slot",
8068
+ children: C
8069
+ })]
8070
+ }), MenuSeparator = () => /* @__PURE__ */ jsx("div", { className: "custom-menu-separator" }), SubMenu = ({ label: s, children: d, scrollable: C }) => /* @__PURE__ */ jsxs("div", {
8071
+ className: "custom-menu-item",
8072
+ children: [
8073
+ s,
8074
+ /* @__PURE__ */ jsx("div", {
8075
+ className: "custom-menu-right-slot",
8076
+ children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8077
+ }),
8078
+ /* @__PURE__ */ jsx("div", {
8079
+ className: `custom-submenu ${C ? "scrollable" : ""}`,
8080
+ children: d
8081
+ })
8082
+ ]
8083
+ });
8084
+ const ElementContextMenu = ({ children: s, element: d }) => {
8085
+ let { updateElement: C, removeElement: w, addElement: k, moveElement: F, state: L } = useEditor(), [V, U] = useState(null), [K, q] = useState(!1), [X, $] = useState(!1), [PD, FD] = useState(d.content), [ID, zD] = useState(d.dataBinding || ""), BD = useRef(null), HD = useRef(null);
8086
+ useEffect(() => {
8087
+ let s = () => U(null);
8088
+ return window.addEventListener("scroll", s, !0), window.addEventListener("resize", s), () => {
8089
+ window.removeEventListener("scroll", s, !0), window.removeEventListener("resize", s);
8090
+ };
8091
+ }, []);
8092
+ let KD = (s) => {
8093
+ s.preventDefault(), s.stopPropagation(), U({
8094
+ x: s.clientX,
8095
+ y: s.clientY
8096
+ });
8097
+ }, qD = () => U(null), JD = (s) => {
8098
+ let d = BD.current;
8281
8099
  if (d) {
8282
- let C = d.selectionStart, w = d.selectionEnd, k = X;
8283
- $(k.substring(0, C) + `{{${s}}}` + k.substring(w)), setTimeout(() => {
8100
+ let C = d.selectionStart, w = d.selectionEnd, k = PD;
8101
+ FD(k.substring(0, C) + `{{${s}}}` + k.substring(w)), setTimeout(() => {
8284
8102
  d.focus();
8285
8103
  let w = C + s.length + 4;
8286
8104
  d.setSelectionRange(w, w);
8287
8105
  }, 0);
8288
- } else $((d) => d + `{{${s}}}`);
8289
- }, kO = (s) => {
8290
- w(C.id, { style: {
8291
- ...C.style,
8106
+ } else FD((d) => d + `{{${s}}}`);
8107
+ }, YD = (s) => {
8108
+ C(d.id, { style: {
8109
+ ...d.style,
8292
8110
  ...s
8293
- } });
8294
- }, AO = () => {
8295
- let s = V.elements.findIndex((s) => s.id === C.id);
8296
- s < V.elements.length - 1 && L(s, V.elements.length - 1);
8297
- }, PO = () => {
8298
- let s = V.elements.findIndex((s) => s.id === C.id);
8299
- s > 0 && L(s, 0);
8300
- }, FO = () => {
8301
- F({
8302
- type: C.type,
8303
- content: C.content,
8304
- x: C.x + 20,
8305
- y: C.y + 20,
8306
- width: C.width,
8307
- height: C.height,
8308
- style: C.style
8309
- });
8310
- }, IO = [
8111
+ } }), qD();
8112
+ }, XD = () => {
8113
+ let s = L.elements.findIndex((s) => s.id === d.id);
8114
+ s < L.elements.length - 1 && F(s, L.elements.length - 1), qD();
8115
+ }, ZD = () => {
8116
+ let s = L.elements.findIndex((s) => s.id === d.id);
8117
+ s > 0 && F(s, 0), qD();
8118
+ }, QD = () => {
8119
+ k({
8120
+ type: d.type,
8121
+ content: d.content,
8122
+ x: d.x + 20,
8123
+ y: d.y + 20,
8124
+ width: d.width,
8125
+ height: d.height,
8126
+ style: d.style
8127
+ }), qD();
8128
+ }, $D = [
8311
8129
  "#000000",
8312
8130
  "#FFFFFF",
8313
8131
  "#FF0000",
@@ -8317,11 +8135,16 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8317
8135
  "#808080",
8318
8136
  "#800080",
8319
8137
  "transparent"
8320
- ], LO = React.useRef(null);
8138
+ ];
8321
8139
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
8140
+ /* @__PURE__ */ jsx("div", {
8141
+ onContextMenu: KD,
8142
+ style: { display: "contents" },
8143
+ children: s
8144
+ }),
8322
8145
  /* @__PURE__ */ jsx(s$2, {
8323
- open: U,
8324
- onOpenChange: K,
8146
+ open: K,
8147
+ onOpenChange: q,
8325
8148
  children: /* @__PURE__ */ jsxs(p$5, {
8326
8149
  style: { maxWidth: 450 },
8327
8150
  children: [/* @__PURE__ */ jsx(g$1, { children: "Editar Texto" }), /* @__PURE__ */ jsxs(p, {
@@ -8329,13 +8152,13 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8329
8152
  gap: "3",
8330
8153
  children: [
8331
8154
  /* @__PURE__ */ jsx(r, {
8332
- ref: TO,
8333
- value: X,
8334
- onChange: (s) => $(s.target.value),
8155
+ ref: BD,
8156
+ value: PD,
8157
+ onChange: (s) => FD(s.target.value),
8335
8158
  placeholder: "Digite o novo texto...",
8336
8159
  style: { height: 100 }
8337
8160
  }),
8338
- V.availableProps && V.availableProps.length > 0 && /* @__PURE__ */ jsxs(p, {
8161
+ L.availableProps && L.availableProps.length > 0 && /* @__PURE__ */ jsxs(p, {
8339
8162
  direction: "column",
8340
8163
  gap: "2",
8341
8164
  children: [/* @__PURE__ */ jsx(p$2, {
@@ -8345,11 +8168,11 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8345
8168
  }), /* @__PURE__ */ jsx(p, {
8346
8169
  gap: "2",
8347
8170
  wrap: "wrap",
8348
- children: V.availableProps.map((s) => /* @__PURE__ */ jsx(e, {
8171
+ children: L.availableProps.map((s) => /* @__PURE__ */ jsx(e, {
8349
8172
  color: "blue",
8350
8173
  variant: "surface",
8351
8174
  style: { cursor: "pointer" },
8352
- onClick: () => OO(s.dataName),
8175
+ onClick: () => JD(s.dataName),
8353
8176
  children: s.name
8354
8177
  }, s.dataName))
8355
8178
  })]
@@ -8363,7 +8186,7 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8363
8186
  children: "Cancelar"
8364
8187
  }) }), /* @__PURE__ */ jsx(o, {
8365
8188
  onClick: () => {
8366
- w(C.id, { content: X }), K(!1);
8189
+ C(d.id, { content: PD }), q(!1);
8367
8190
  },
8368
8191
  children: "Salvar"
8369
8192
  })]
@@ -8373,8 +8196,8 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8373
8196
  })
8374
8197
  }),
8375
8198
  /* @__PURE__ */ jsx(s$2, {
8376
- open: q,
8377
- onOpenChange: J,
8199
+ open: X,
8200
+ onOpenChange: $,
8378
8201
  children: /* @__PURE__ */ jsxs(p$5, {
8379
8202
  style: { maxWidth: 450 },
8380
8203
  children: [/* @__PURE__ */ jsx(g$1, { children: "Vincular Dados Manualmente" }), /* @__PURE__ */ jsxs(p, {
@@ -8386,8 +8209,8 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8386
8209
  children: "Nome da propriedade (ex: titulo, preco, imagem):"
8387
8210
  }),
8388
8211
  /* @__PURE__ */ jsx(u, {
8389
- value: CO,
8390
- onChange: (s) => wO(s.target.value),
8212
+ value: ID,
8213
+ onChange: (s) => zD(s.target.value),
8391
8214
  placeholder: "propriedade"
8392
8215
  }),
8393
8216
  /* @__PURE__ */ jsxs(p, {
@@ -8399,8 +8222,8 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8399
8222
  children: "Cancelar"
8400
8223
  }) }), /* @__PURE__ */ jsx(o, {
8401
8224
  onClick: () => {
8402
- let s = CO, d = { dataBinding: s };
8403
- C.type === "text" && (d.content = `{{${s}}}`), w(C.id, d), J(!1);
8225
+ let s = ID, w = { dataBinding: s };
8226
+ d.type === "text" && (w.content = `{{${s}}}`), C(d.id, w), $(!1);
8404
8227
  },
8405
8228
  children: "Vincular"
8406
8229
  })]
@@ -8411,454 +8234,288 @@ const ElementContextMenu = ({ children: s, element: C }) => {
8411
8234
  }),
8412
8235
  /* @__PURE__ */ jsx("input", {
8413
8236
  type: "file",
8414
- ref: LO,
8237
+ ref: HD,
8415
8238
  style: { display: "none" },
8416
8239
  accept: "image/*",
8417
8240
  onChange: (s) => {
8418
- let d = s.target.files?.[0];
8419
- if (d) {
8241
+ let w = s.target.files?.[0];
8242
+ if (w) {
8420
8243
  let s = new FileReader();
8421
8244
  s.onload = (s) => {
8422
- s.target?.result && w(C.id, { content: s.target.result });
8423
- }, s.readAsDataURL(d);
8245
+ s.target?.result && C(d.id, { content: s.target.result });
8246
+ }, s.readAsDataURL(w);
8424
8247
  }
8248
+ qD();
8425
8249
  }
8426
8250
  }),
8427
- /* @__PURE__ */ jsxs(Root2$1, { children: [/* @__PURE__ */ jsx(Trigger$1, {
8428
- asChild: !0,
8429
- children: s
8430
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8431
- appearance: V.theme,
8432
- style: { display: "contents" },
8433
- children: /* @__PURE__ */ jsxs(Content2$1, {
8434
- className: "ContextMenuContent",
8435
- children: [
8436
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8437
- className: "ContextMenuSubTrigger",
8251
+ V && createPortal(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
8252
+ className: "custom-context-menu-overlay",
8253
+ onClick: qD,
8254
+ onContextMenu: (s) => {
8255
+ s.preventDefault(), qD();
8256
+ }
8257
+ }), /* @__PURE__ */ jsxs("div", {
8258
+ className: "custom-context-menu",
8259
+ style: {
8260
+ top: Math.min(V.y, window.innerHeight - 300),
8261
+ left: Math.min(V.x, window.innerWidth - 250)
8262
+ },
8263
+ children: [
8264
+ /* @__PURE__ */ jsxs(SubMenu, {
8265
+ label: /* @__PURE__ */ jsxs(Fragment$1, { children: ["Vincular Dados ", d.dataBinding && /* @__PURE__ */ jsxs("span", {
8266
+ style: {
8267
+ fontSize: 10,
8268
+ marginLeft: 4,
8269
+ opacity: .7
8270
+ },
8438
8271
  children: [
8439
- "Vincular Dados ",
8440
- C.dataBinding && `(${C.dataBinding})`,
8441
- /* @__PURE__ */ jsx("div", {
8442
- className: "RightSlot",
8443
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8272
+ "(",
8273
+ d.dataBinding,
8274
+ ")"
8275
+ ]
8276
+ })] }),
8277
+ children: [
8278
+ L.availableProps && L.availableProps.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [L.availableProps.map((s) => /* @__PURE__ */ jsx(MenuItem, {
8279
+ onClick: () => {
8280
+ let w = { dataBinding: s.dataName };
8281
+ d.type === "text" && (w.content = `{{${s.dataName}}}`), C(d.id, w), qD();
8282
+ },
8283
+ rightSlot: /* @__PURE__ */ jsx("span", {
8284
+ style: { fontSize: 10 },
8285
+ children: s.dataName
8286
+ }),
8287
+ children: s.name
8288
+ }, s.dataName)), /* @__PURE__ */ jsx(MenuSeparator, {})] }),
8289
+ /* @__PURE__ */ jsx(MenuItem, {
8290
+ onClick: () => {
8291
+ zD(d.dataBinding || ""), $(!0), qD();
8292
+ },
8293
+ children: "Outro / Manual..."
8294
+ }),
8295
+ d.dataBinding && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsx(MenuItem, {
8296
+ onClick: () => {
8297
+ C(d.id, { dataBinding: void 0 }), qD();
8298
+ },
8299
+ style: { color: "var(--red-9)" },
8300
+ children: "Remover Vínculo"
8301
+ })] })
8302
+ ]
8303
+ }),
8304
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
8305
+ d.type === "text" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuItem, {
8306
+ onClick: () => {
8307
+ FD(d.content), q(!0), qD();
8308
+ },
8309
+ children: "Editar Texto..."
8310
+ }), /* @__PURE__ */ jsx(MenuSeparator, {})] }),
8311
+ /* @__PURE__ */ jsx(MenuItem, {
8312
+ onClick: QD,
8313
+ children: "Duplicar"
8314
+ }),
8315
+ /* @__PURE__ */ jsx(MenuItem, {
8316
+ onClick: () => {
8317
+ w(d.id), qD();
8318
+ },
8319
+ children: "Excluir"
8320
+ }),
8321
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
8322
+ d.type === "image" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
8323
+ /* @__PURE__ */ jsxs(SubMenu, {
8324
+ label: "Alterar Imagem",
8325
+ children: [/* @__PURE__ */ jsx(MenuItem, {
8326
+ onClick: () => {
8327
+ HD.current?.click(), qD();
8328
+ },
8329
+ children: "Carregar do Computador"
8330
+ }), /* @__PURE__ */ jsx(MenuItem, {
8331
+ onClick: () => {
8332
+ qD(), setTimeout(() => {
8333
+ let s = window.prompt("Insira a URL da imagem:", d.content);
8334
+ s !== null && C(d.id, { content: s });
8335
+ }, 10);
8336
+ },
8337
+ children: "Inserir URL"
8338
+ })]
8339
+ }),
8340
+ /* @__PURE__ */ jsxs(SubMenu, {
8341
+ label: "Ajuste da Imagem",
8342
+ children: [
8343
+ /* @__PURE__ */ jsx(MenuItem, {
8344
+ onClick: () => YD({ objectFit: "cover" }),
8345
+ children: "Preencher (Cover)"
8346
+ }),
8347
+ /* @__PURE__ */ jsx(MenuItem, {
8348
+ onClick: () => YD({ objectFit: "contain" }),
8349
+ children: "Ajustar (Contain)"
8350
+ }),
8351
+ /* @__PURE__ */ jsx(MenuItem, {
8352
+ onClick: () => YD({ objectFit: "fill" }),
8353
+ children: "Esticar (Fill)"
8444
8354
  })
8445
8355
  ]
8446
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8447
- appearance: V.theme,
8448
- style: { display: "contents" },
8449
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8450
- className: "ContextMenuSubContent",
8451
- children: [
8452
- V.availableProps && V.availableProps.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [V.availableProps.map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8453
- className: "ContextMenuItem",
8454
- onSelect: () => {
8455
- let d = { dataBinding: s.dataName };
8456
- C.type === "text" && (d.content = `{{${s.dataName}}}`), w(C.id, d);
8457
- },
8458
- children: [s.name, /* @__PURE__ */ jsx("div", {
8459
- className: "RightSlot",
8460
- style: {
8461
- color: "var(--gray-10)",
8462
- fontSize: 10
8463
- },
8464
- children: s.dataName
8465
- })]
8466
- }, s.dataName)), /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" })] }),
8467
- /* @__PURE__ */ jsx(Item2$1, {
8468
- className: "ContextMenuItem",
8469
- onSelect: () => {
8470
- wO(C.dataBinding || ""), J(!0);
8471
- },
8472
- children: "Outro / Manual..."
8473
- }),
8474
- C.dataBinding && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }), /* @__PURE__ */ jsx(Item2$1, {
8475
- className: "ContextMenuItem",
8476
- style: { color: "var(--red-9)" },
8477
- onSelect: () => w(C.id, { dataBinding: void 0 }),
8478
- children: "Remover Vínculo"
8479
- })] })
8480
- ]
8481
- })
8482
- }) })] }),
8483
- /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
8484
- C.type === "text" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Item2$1, {
8485
- className: "ContextMenuItem",
8486
- onSelect: () => {
8487
- $(C.content), K(!0);
8488
- },
8489
- children: "Editar Texto..."
8490
- }), /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" })] }),
8491
- /* @__PURE__ */ jsx(Item2$1, {
8492
- className: "ContextMenuItem",
8493
- onSelect: FO,
8494
- children: "Duplicar"
8495
8356
  }),
8496
- /* @__PURE__ */ jsx(Item2$1, {
8497
- className: "ContextMenuItem",
8498
- onSelect: () => k(C.id),
8499
- children: "Excluir"
8357
+ /* @__PURE__ */ jsx(MenuSeparator, {})
8358
+ ] }),
8359
+ /* @__PURE__ */ jsxs(SubMenu, {
8360
+ label: "Camadas",
8361
+ children: [/* @__PURE__ */ jsx(MenuItem, {
8362
+ onClick: XD,
8363
+ children: "Trazer para frente"
8364
+ }), /* @__PURE__ */ jsx(MenuItem, {
8365
+ onClick: ZD,
8366
+ children: "Enviar para trás"
8367
+ })]
8368
+ }),
8369
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
8370
+ d.type === "text" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
8371
+ /* @__PURE__ */ jsx(SubMenu, {
8372
+ label: "Fonte",
8373
+ scrollable: !0,
8374
+ children: L.availableFonts && L.availableFonts.map((s) => /* @__PURE__ */ jsx(MenuItem, {
8375
+ onClick: () => YD({ fontFamily: s }),
8376
+ style: { fontFamily: s },
8377
+ rightSlot: d.style?.fontFamily === s ? "✓" : void 0,
8378
+ children: s
8379
+ }, s))
8500
8380
  }),
8501
- /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
8502
- C.type === "image" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
8503
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8504
- className: "ContextMenuSubTrigger",
8505
- children: ["Alterar Imagem", /* @__PURE__ */ jsx("div", {
8506
- className: "RightSlot",
8507
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8508
- })]
8509
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8510
- appearance: V.theme,
8511
- style: { display: "contents" },
8512
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8513
- className: "ContextMenuSubContent",
8514
- children: [/* @__PURE__ */ jsx(Item2$1, {
8515
- className: "ContextMenuItem",
8516
- onSelect: () => LO.current?.click(),
8517
- children: "Carregar do Computador"
8518
- }), /* @__PURE__ */ jsx(Item2$1, {
8519
- className: "ContextMenuItem",
8520
- onSelect: () => {
8521
- let s = window.prompt("Insira a URL da imagem:", C.content);
8522
- s !== null && w(C.id, { content: s });
8523
- },
8524
- children: "Inserir URL"
8525
- })]
8526
- })
8527
- }) })] }),
8528
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8529
- className: "ContextMenuSubTrigger",
8530
- children: ["Ajuste da Imagem", /* @__PURE__ */ jsx("div", {
8531
- className: "RightSlot",
8532
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8533
- })]
8534
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8535
- appearance: V.theme,
8536
- style: { display: "contents" },
8537
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8538
- className: "ContextMenuSubContent",
8539
- children: [
8540
- /* @__PURE__ */ jsx(Item2$1, {
8541
- className: "ContextMenuItem",
8542
- onSelect: () => kO({ objectFit: "cover" }),
8543
- children: "Preencher (Cover)"
8544
- }),
8545
- /* @__PURE__ */ jsx(Item2$1, {
8546
- className: "ContextMenuItem",
8547
- onSelect: () => kO({ objectFit: "contain" }),
8548
- children: "Ajustar (Contain)"
8549
- }),
8550
- /* @__PURE__ */ jsx(Item2$1, {
8551
- className: "ContextMenuItem",
8552
- onSelect: () => kO({ objectFit: "fill" }),
8553
- children: "Esticar (Fill)"
8554
- })
8555
- ]
8556
- })
8557
- }) })] }),
8558
- /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" })
8559
- ] }),
8560
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8561
- className: "ContextMenuSubTrigger",
8562
- children: ["Camadas", /* @__PURE__ */ jsx("div", {
8563
- className: "RightSlot",
8564
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8381
+ /* @__PURE__ */ jsx(SubMenu, {
8382
+ label: "Tamanho da Fonte",
8383
+ children: [
8384
+ 12,
8385
+ 14,
8386
+ 16,
8387
+ 20,
8388
+ 24,
8389
+ 32,
8390
+ 48,
8391
+ 64
8392
+ ].map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8393
+ onClick: () => YD({ fontSize: `${s}px` }),
8394
+ children: [s, "px"]
8395
+ }, s))
8396
+ }),
8397
+ /* @__PURE__ */ jsx(SubMenu, {
8398
+ label: "Cor do Texto",
8399
+ children: $D.filter((s) => s !== "transparent").map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8400
+ onClick: () => YD({ color: s }),
8401
+ children: [/* @__PURE__ */ jsx("div", { style: {
8402
+ width: 12,
8403
+ height: 12,
8404
+ backgroundColor: s,
8405
+ marginRight: 8,
8406
+ border: "1px solid #ccc"
8407
+ } }), s]
8408
+ }, s))
8409
+ }),
8410
+ /* @__PURE__ */ jsxs(SubMenu, {
8411
+ label: "Peso da Fonte",
8412
+ children: [/* @__PURE__ */ jsx(MenuItem, {
8413
+ onClick: () => YD({ fontWeight: "normal" }),
8414
+ children: "Normal"
8415
+ }), /* @__PURE__ */ jsx(MenuItem, {
8416
+ onClick: () => YD({ fontWeight: "bold" }),
8417
+ children: "Negrito"
8565
8418
  })]
8566
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8567
- appearance: V.theme,
8568
- style: { display: "contents" },
8569
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8570
- className: "ContextMenuSubContent",
8571
- children: [/* @__PURE__ */ jsx(Item2$1, {
8572
- className: "ContextMenuItem",
8573
- onSelect: AO,
8574
- children: "Trazer para frente"
8575
- }), /* @__PURE__ */ jsx(Item2$1, {
8576
- className: "ContextMenuItem",
8577
- onSelect: PO,
8578
- children: "Enviar para trás"
8579
- })]
8580
- })
8581
- }) })] }),
8582
- /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
8583
- C.type === "text" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
8584
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8585
- className: "ContextMenuSubTrigger",
8586
- children: ["Fonte", /* @__PURE__ */ jsx("div", {
8587
- className: "RightSlot",
8588
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8589
- })]
8590
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8591
- appearance: V.theme,
8592
- style: { display: "contents" },
8593
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8594
- className: "ContextMenuSubContent",
8595
- style: {
8596
- maxHeight: "300px",
8597
- overflowY: "auto"
8598
- },
8599
- children: V.availableFonts && V.availableFonts.map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8600
- className: "ContextMenuItem",
8601
- onSelect: () => kO({ fontFamily: s }),
8602
- style: { fontFamily: s },
8603
- children: [s, C.style?.fontFamily === s && /* @__PURE__ */ jsx("div", {
8604
- className: "RightSlot",
8605
- children: "✓"
8606
- })]
8607
- }, s))
8608
- })
8609
- }) })] }),
8610
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8611
- className: "ContextMenuSubTrigger",
8612
- children: ["Tamanho da Fonte", /* @__PURE__ */ jsx("div", {
8613
- className: "RightSlot",
8614
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8615
- })]
8616
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8617
- appearance: V.theme,
8618
- style: { display: "contents" },
8619
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8620
- className: "ContextMenuSubContent",
8621
- children: [
8622
- 12,
8623
- 14,
8624
- 16,
8625
- 20,
8626
- 24,
8627
- 32,
8628
- 48,
8629
- 64
8630
- ].map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8631
- className: "ContextMenuItem",
8632
- onSelect: () => kO({ fontSize: `${s}px` }),
8633
- children: [s, "px"]
8634
- }, s))
8635
- })
8636
- }) })] }),
8637
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8638
- className: "ContextMenuSubTrigger",
8639
- children: ["Cor do Texto", /* @__PURE__ */ jsx("div", {
8640
- className: "RightSlot",
8641
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8642
- })]
8643
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8644
- appearance: V.theme,
8645
- style: { display: "contents" },
8646
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8647
- className: "ContextMenuSubContent",
8648
- children: IO.filter((s) => s !== "transparent").map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8649
- className: "ContextMenuItem",
8650
- onSelect: () => kO({ color: s }),
8651
- children: [/* @__PURE__ */ jsx("div", { style: {
8652
- width: 12,
8653
- height: 12,
8654
- backgroundColor: s,
8655
- marginRight: 8,
8656
- border: "1px solid #ccc"
8657
- } }), s]
8658
- }, s))
8659
- })
8660
- }) })] }),
8661
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8662
- className: "ContextMenuSubTrigger",
8663
- children: ["Peso da Fonte", /* @__PURE__ */ jsx("div", {
8664
- className: "RightSlot",
8665
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8666
- })]
8667
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8668
- appearance: V.theme,
8669
- style: { display: "contents" },
8670
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8671
- className: "ContextMenuSubContent",
8672
- children: [/* @__PURE__ */ jsx(Item2$1, {
8673
- className: "ContextMenuItem",
8674
- onSelect: () => kO({ fontWeight: "normal" }),
8675
- children: "Normal"
8676
- }), /* @__PURE__ */ jsx(Item2$1, {
8677
- className: "ContextMenuItem",
8678
- onSelect: () => kO({ fontWeight: "bold" }),
8679
- children: "Negrito"
8680
- })]
8681
- })
8682
- }) })] }),
8683
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8684
- className: "ContextMenuSubTrigger",
8685
- children: ["Alinhamento", /* @__PURE__ */ jsx("div", {
8686
- className: "RightSlot",
8687
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8688
- })]
8689
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8690
- appearance: V.theme,
8691
- style: { display: "contents" },
8692
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8693
- className: "ContextMenuSubContent",
8694
- children: [
8695
- /* @__PURE__ */ jsx(Item2$1, {
8696
- className: "ContextMenuItem",
8697
- onSelect: () => kO({ textAlign: "left" }),
8698
- children: "Esquerda"
8699
- }),
8700
- /* @__PURE__ */ jsx(Item2$1, {
8701
- className: "ContextMenuItem",
8702
- onSelect: () => kO({ textAlign: "center" }),
8703
- children: "Centro"
8704
- }),
8705
- /* @__PURE__ */ jsx(Item2$1, {
8706
- className: "ContextMenuItem",
8707
- onSelect: () => kO({ textAlign: "right" }),
8708
- children: "Direita"
8709
- })
8710
- ]
8419
+ }),
8420
+ /* @__PURE__ */ jsxs(SubMenu, {
8421
+ label: "Alinhamento",
8422
+ children: [
8423
+ /* @__PURE__ */ jsx(MenuItem, {
8424
+ onClick: () => YD({ textAlign: "left" }),
8425
+ children: "Esquerda"
8426
+ }),
8427
+ /* @__PURE__ */ jsx(MenuItem, {
8428
+ onClick: () => YD({ textAlign: "center" }),
8429
+ children: "Centro"
8430
+ }),
8431
+ /* @__PURE__ */ jsx(MenuItem, {
8432
+ onClick: () => YD({ textAlign: "right" }),
8433
+ children: "Direita"
8711
8434
  })
8712
- }) })] })
8713
- ] }),
8714
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8715
- className: "ContextMenuSubTrigger",
8716
- children: ["Cor de Fundo", /* @__PURE__ */ jsx("div", {
8717
- className: "RightSlot",
8718
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8719
- })]
8720
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8721
- appearance: V.theme,
8722
- style: { display: "contents" },
8723
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8724
- className: "ContextMenuSubContent",
8725
- children: IO.map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8726
- className: "ContextMenuItem",
8727
- onSelect: () => kO({ backgroundColor: s }),
8728
- children: [/* @__PURE__ */ jsx("div", { style: {
8729
- width: 12,
8730
- height: 12,
8731
- backgroundColor: s,
8732
- marginRight: 8,
8733
- border: "1px solid #ccc"
8734
- } }), s === "transparent" ? "Transparente" : s]
8735
- }, s))
8736
- })
8737
- }) })] }),
8738
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8739
- className: "ContextMenuSubTrigger",
8740
- children: ["Arredondamento", /* @__PURE__ */ jsx("div", {
8741
- className: "RightSlot",
8742
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8743
- })]
8744
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8745
- appearance: V.theme,
8746
- style: { display: "contents" },
8747
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8748
- className: "ContextMenuSubContent",
8749
- children: [
8750
- 0,
8751
- 4,
8752
- 8,
8753
- 12,
8754
- 16,
8755
- 24,
8756
- "50%"
8757
- ].map((s) => /* @__PURE__ */ jsx(Item2$1, {
8758
- className: "ContextMenuItem",
8759
- onSelect: () => kO({ borderRadius: typeof s == "number" ? `${s}px` : s }),
8760
- children: s === "50%" ? "Círculo" : `${s}px`
8761
- }, s))
8762
- })
8763
- }) })] }),
8764
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8765
- className: "ContextMenuSubTrigger",
8766
- children: ["Espaçamento", /* @__PURE__ */ jsx("div", {
8767
- className: "RightSlot",
8768
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8769
- })]
8770
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8771
- appearance: V.theme,
8772
- style: { display: "contents" },
8773
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8774
- className: "ContextMenuSubContent",
8775
- children: [
8776
- 0,
8777
- 4,
8778
- 8,
8779
- 12,
8780
- 16,
8781
- 24,
8782
- 32
8783
- ].map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8784
- className: "ContextMenuItem",
8785
- onSelect: () => kO({ padding: `${s}px` }),
8786
- children: [s, "px"]
8787
- }, s))
8788
- })
8789
- }) })] }),
8790
- /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8791
- className: "ContextMenuSubTrigger",
8792
- children: ["Borda", /* @__PURE__ */ jsx("div", {
8793
- className: "RightSlot",
8794
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8435
+ ]
8436
+ })
8437
+ ] }),
8438
+ /* @__PURE__ */ jsx(SubMenu, {
8439
+ label: "Cor de Fundo",
8440
+ children: $D.map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8441
+ onClick: () => YD({ backgroundColor: s }),
8442
+ children: [/* @__PURE__ */ jsx("div", { style: {
8443
+ width: 12,
8444
+ height: 12,
8445
+ backgroundColor: s,
8446
+ marginRight: 8,
8447
+ border: "1px solid #ccc"
8448
+ } }), s === "transparent" ? "Transparente" : s]
8449
+ }, s))
8450
+ }),
8451
+ /* @__PURE__ */ jsx(SubMenu, {
8452
+ label: "Arredondamento",
8453
+ children: [
8454
+ 0,
8455
+ 4,
8456
+ 8,
8457
+ 12,
8458
+ 16,
8459
+ 24,
8460
+ "50%"
8461
+ ].map((s) => /* @__PURE__ */ jsx(MenuItem, {
8462
+ onClick: () => YD({ borderRadius: typeof s == "number" ? `${s}px` : s }),
8463
+ children: s === "50%" ? "Círculo" : `${s}px`
8464
+ }, s))
8465
+ }),
8466
+ /* @__PURE__ */ jsx(SubMenu, {
8467
+ label: "Espaçamento",
8468
+ children: [
8469
+ 0,
8470
+ 4,
8471
+ 8,
8472
+ 12,
8473
+ 16,
8474
+ 24,
8475
+ 32
8476
+ ].map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8477
+ onClick: () => YD({ padding: `${s}px` }),
8478
+ children: [s, "px"]
8479
+ }, s))
8480
+ }),
8481
+ /* @__PURE__ */ jsxs(SubMenu, {
8482
+ label: "Borda",
8483
+ children: [/* @__PURE__ */ jsxs(SubMenu, {
8484
+ label: "Cor da Borda",
8485
+ children: [$D.filter((s) => s !== "transparent").map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8486
+ onClick: () => YD({
8487
+ borderColor: s,
8488
+ borderStyle: "solid"
8489
+ }),
8490
+ children: [/* @__PURE__ */ jsx("div", { style: {
8491
+ width: 12,
8492
+ height: 12,
8493
+ backgroundColor: s,
8494
+ marginRight: 8,
8495
+ border: "1px solid #ccc"
8496
+ } }), s]
8497
+ }, s)), /* @__PURE__ */ jsx(MenuItem, {
8498
+ onClick: () => YD({ borderStyle: "none" }),
8499
+ children: "Sem Borda"
8795
8500
  })]
8796
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8797
- appearance: V.theme,
8798
- style: { display: "contents" },
8799
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8800
- className: "ContextMenuSubContent",
8801
- children: [/* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8802
- className: "ContextMenuSubTrigger",
8803
- children: ["Cor da Borda", /* @__PURE__ */ jsx("div", {
8804
- className: "RightSlot",
8805
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8806
- })]
8807
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8808
- appearance: V.theme,
8809
- style: { display: "contents" },
8810
- children: /* @__PURE__ */ jsxs(SubContent2$1, {
8811
- className: "ContextMenuSubContent",
8812
- children: [IO.filter((s) => s !== "transparent").map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8813
- className: "ContextMenuItem",
8814
- onSelect: () => kO({
8815
- borderColor: s,
8816
- borderStyle: "solid"
8817
- }),
8818
- children: [/* @__PURE__ */ jsx("div", { style: {
8819
- width: 12,
8820
- height: 12,
8821
- backgroundColor: s,
8822
- marginRight: 8,
8823
- border: "1px solid #ccc"
8824
- } }), s]
8825
- }, s)), /* @__PURE__ */ jsx(Item2$1, {
8826
- className: "ContextMenuItem",
8827
- onSelect: () => kO({ borderStyle: "none" }),
8828
- children: "Sem Borda"
8829
- })]
8830
- })
8831
- }) })] }), /* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
8832
- className: "ContextMenuSubTrigger",
8833
- children: ["Espessura", /* @__PURE__ */ jsx("div", {
8834
- className: "RightSlot",
8835
- children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
8836
- })]
8837
- }), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsx(R, {
8838
- appearance: V.theme,
8839
- style: { display: "contents" },
8840
- children: /* @__PURE__ */ jsx(SubContent2$1, {
8841
- className: "ContextMenuSubContent",
8842
- children: [
8843
- 1,
8844
- 2,
8845
- 4,
8846
- 8
8847
- ].map((s) => /* @__PURE__ */ jsxs(Item2$1, {
8848
- className: "ContextMenuItem",
8849
- onSelect: () => kO({
8850
- borderWidth: `${s}px`,
8851
- borderStyle: "solid"
8852
- }),
8853
- children: [s, "px"]
8854
- }, s))
8855
- })
8856
- }) })] })]
8857
- })
8858
- }) })] })
8859
- ]
8860
- })
8861
- }) })] })
8501
+ }), /* @__PURE__ */ jsx(SubMenu, {
8502
+ label: "Espessura",
8503
+ children: [
8504
+ 1,
8505
+ 2,
8506
+ 4,
8507
+ 8
8508
+ ].map((s) => /* @__PURE__ */ jsxs(MenuItem, {
8509
+ onClick: () => YD({
8510
+ borderWidth: `${s}px`,
8511
+ borderStyle: "solid"
8512
+ }),
8513
+ children: [s, "px"]
8514
+ }, s))
8515
+ })]
8516
+ })
8517
+ ]
8518
+ })] }), document.body)
8862
8519
  ] });
8863
8520
  };
8864
8521
  var DraggableResizableElement = ({ element: s, isSelected: d }) => {
@@ -8868,26 +8525,26 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8868
8525
  }), q = useRef({
8869
8526
  x: 0,
8870
8527
  y: 0
8871
- }), X = useRef(0), $ = useRef(0), CO = useRef({
8528
+ }), X = useRef(0), $ = useRef(0), PD = useRef({
8872
8529
  x: 0,
8873
8530
  y: 0
8874
- }), wO = k.isList ? k.mockData.length > 0 ? k.mockData[0] : null : k.singleMockData, TO = s.content;
8875
- if (wO) {
8876
- if (s.type === "text") TO = TO.replace(/\{\{(.*?)\}\}/g, (s, d) => {
8877
- let C = wO[d.trim()];
8531
+ }), FD = k.isList ? k.mockData.length > 0 ? k.mockData[0] : null : k.singleMockData, ID = s.content;
8532
+ if (FD) {
8533
+ if (s.type === "text") ID = ID.replace(/\{\{(.*?)\}\}/g, (s, d) => {
8534
+ let C = FD[d.trim()];
8878
8535
  return C == null ? s : String(C);
8879
8536
  });
8880
8537
  else if (s.type === "image") if (s.dataBinding) {
8881
- let d = wO[s.dataBinding];
8882
- d != null && (TO = String(d));
8883
- } else TO = TO.replace(/\{\{(.*?)\}\}/g, (s, d) => {
8884
- let C = wO[d.trim()];
8538
+ let d = FD[s.dataBinding];
8539
+ d != null && (ID = String(d));
8540
+ } else ID = ID.replace(/\{\{(.*?)\}\}/g, (s, d) => {
8541
+ let C = FD[d.trim()];
8885
8542
  return C == null ? s : String(C);
8886
8543
  });
8887
8544
  }
8888
- let OO = (d) => {
8545
+ let zD = (d) => {
8889
8546
  d.stopPropagation(), C(s.id);
8890
- }, kO = (d) => {
8547
+ }, BD = (d) => {
8891
8548
  d.button === 0 && (d.stopPropagation(), C(s.id), L(!0), K.current = {
8892
8549
  x: d.clientX,
8893
8550
  y: d.clientY
@@ -8895,16 +8552,16 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8895
8552
  x: s.x,
8896
8553
  y: s.y
8897
8554
  });
8898
- }, AO = (d) => {
8555
+ }, VD = (d) => {
8899
8556
  d.stopPropagation(), d.preventDefault(), U(!0);
8900
8557
  let C = d.target.closest(".resizable-element");
8901
8558
  if (C) {
8902
8559
  let w = C.getBoundingClientRect();
8903
- CO.current = {
8560
+ PD.current = {
8904
8561
  x: w.left + w.width / 2,
8905
8562
  y: w.top + w.height / 2
8906
8563
  };
8907
- let k = d.clientX - CO.current.x, F = d.clientY - CO.current.y;
8564
+ let k = d.clientX - PD.current.x, F = d.clientY - PD.current.y;
8908
8565
  X.current = Math.atan2(F, k) * (180 / Math.PI), $.current = s.rotation || 0;
8909
8566
  }
8910
8567
  };
@@ -8918,7 +8575,7 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8918
8575
  });
8919
8576
  }
8920
8577
  if (V) {
8921
- let C = d.clientX - CO.current.x, k = d.clientY - CO.current.y, F = Math.atan2(k, C) * (180 / Math.PI) - X.current;
8578
+ let C = d.clientX - PD.current.x, k = d.clientY - PD.current.y, F = Math.atan2(k, C) * (180 / Math.PI) - X.current;
8922
8579
  w(s.id, { rotation: ($.current + F) % 360 });
8923
8580
  }
8924
8581
  }, C = () => {
@@ -8933,7 +8590,7 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8933
8590
  s.id,
8934
8591
  w
8935
8592
  ]);
8936
- let jO = {
8593
+ let HD = {
8937
8594
  position: "absolute",
8938
8595
  left: 0,
8939
8596
  top: 0,
@@ -8974,9 +8631,9 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8974
8631
  position: "relative"
8975
8632
  },
8976
8633
  children: [/* @__PURE__ */ jsxs(p$1, {
8977
- style: jO,
8978
- onMouseDown: kO,
8979
- onClick: OO,
8634
+ style: HD,
8635
+ onMouseDown: BD,
8636
+ onClick: zD,
8980
8637
  onMouseEnter: (s) => {
8981
8638
  d || (s.currentTarget.style.borderColor = "var(--gray-6)");
8982
8639
  },
@@ -8989,10 +8646,10 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
8989
8646
  width: "100%",
8990
8647
  height: "100%"
8991
8648
  },
8992
- children: TO
8649
+ children: ID
8993
8650
  }),
8994
- s.type === "image" && (TO ? /* @__PURE__ */ jsx("img", {
8995
- src: TO,
8651
+ s.type === "image" && (ID ? /* @__PURE__ */ jsx("img", {
8652
+ src: ID,
8996
8653
  alt: "Element",
8997
8654
  style: {
8998
8655
  width: "100%",
@@ -9034,7 +8691,7 @@ var DraggableResizableElement = ({ element: s, isSelected: d }) => {
9034
8691
  zIndex: 50,
9035
8692
  boxShadow: "0 0 0 2px white"
9036
8693
  },
9037
- onMouseDown: AO,
8694
+ onMouseDown: VD,
9038
8695
  children: /* @__PURE__ */ jsx(p$1, { style: {
9039
8696
  position: "absolute",
9040
8697
  top: 12,
@@ -9222,16 +8879,16 @@ function createRenderBatcher(s, d) {
9222
8879
  delta: 0,
9223
8880
  timestamp: 0,
9224
8881
  isProcessing: !1
9225
- }, F = () => C = !0, L = stepsOrder.reduce((s, C) => (s[C] = createRenderStep(F, d ? C : void 0), s), {}), { setup: V, read: U, resolveKeyframes: K, preUpdate: q, update: J, preRender: X, render: $, postRender: CO } = L, wO = () => {
8882
+ }, F = () => C = !0, L = stepsOrder.reduce((s, C) => (s[C] = createRenderStep(F, d ? C : void 0), s), {}), { setup: V, read: U, resolveKeyframes: K, preUpdate: q, update: J, preRender: X, render: $, postRender: PD } = L, FD = () => {
9226
8883
  let F = MotionGlobalConfig.useManualTiming ? k.timestamp : performance.now();
9227
- C = !1, MotionGlobalConfig.useManualTiming || (k.delta = w ? 1e3 / 60 : Math.max(Math.min(F - k.timestamp, maxElapsed), 1)), k.timestamp = F, k.isProcessing = !0, V.process(k), U.process(k), K.process(k), q.process(k), J.process(k), X.process(k), $.process(k), CO.process(k), k.isProcessing = !1, C && d && (w = !1, s(wO));
9228
- }, TO = () => {
9229
- C = !0, w = !0, k.isProcessing || s(wO);
8884
+ C = !1, MotionGlobalConfig.useManualTiming || (k.delta = w ? 1e3 / 60 : Math.max(Math.min(F - k.timestamp, maxElapsed), 1)), k.timestamp = F, k.isProcessing = !0, V.process(k), U.process(k), K.process(k), q.process(k), J.process(k), X.process(k), $.process(k), PD.process(k), k.isProcessing = !1, C && d && (w = !1, s(FD));
8885
+ }, ID = () => {
8886
+ C = !0, w = !0, k.isProcessing || s(FD);
9230
8887
  };
9231
8888
  return {
9232
8889
  schedule: stepsOrder.reduce((s, d) => {
9233
8890
  let w = L[d];
9234
- return s[d] = (s, d = !1, k = !1) => (C || TO(), w.schedule(s, d, k)), s;
8891
+ return s[d] = (s, d = !1, k = !1) => (C || ID(), w.schedule(s, d, k)), s;
9235
8892
  }, {}),
9236
8893
  cancel: (s) => {
9237
8894
  for (let d = 0; d < stepsOrder.length; d++) L[stepsOrder[d]].cancel(s);
@@ -9589,40 +9246,40 @@ function spring(s = springDefaults.visualDuration, d = springDefaults.bounce) {
9589
9246
  }, { stiffness: U, damping: K, mass: q, duration: J, velocity: X, isResolvedFromDuration: $ } = getSpringOptions({
9590
9247
  ...C,
9591
9248
  velocity: -/* @__PURE__ */ millisecondsToSeconds(C.velocity || 0)
9592
- }), CO = X || 0, wO = K / (2 * Math.sqrt(U * q)), TO = L - F, EO = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(U / q)), DO = Math.abs(TO) < 5;
9593
- w ||= DO ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default, k ||= DO ? springDefaults.restDelta.granular : springDefaults.restDelta.default;
9594
- let OO;
9595
- if (wO < 1) {
9596
- let s = calcAngularFreq(EO, wO);
9597
- OO = (d) => L - Math.exp(-wO * EO * d) * ((CO + wO * EO * TO) / s * Math.sin(s * d) + TO * Math.cos(s * d));
9598
- } else if (wO === 1) OO = (s) => L - Math.exp(-EO * s) * (TO + (CO + EO * TO) * s);
9249
+ }), PD = X || 0, FD = K / (2 * Math.sqrt(U * q)), ID = L - F, LD = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(U / q)), RD = Math.abs(ID) < 5;
9250
+ w ||= RD ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default, k ||= RD ? springDefaults.restDelta.granular : springDefaults.restDelta.default;
9251
+ let zD;
9252
+ if (FD < 1) {
9253
+ let s = calcAngularFreq(LD, FD);
9254
+ zD = (d) => L - Math.exp(-FD * LD * d) * ((PD + FD * LD * ID) / s * Math.sin(s * d) + ID * Math.cos(s * d));
9255
+ } else if (FD === 1) zD = (s) => L - Math.exp(-LD * s) * (ID + (PD + LD * ID) * s);
9599
9256
  else {
9600
- let s = EO * Math.sqrt(wO * wO - 1);
9601
- OO = (d) => {
9602
- let C = Math.exp(-wO * EO * d), w = Math.min(s * d, 300);
9603
- return L - C * ((CO + wO * EO * TO) * Math.sinh(w) + s * TO * Math.cosh(w)) / s;
9257
+ let s = LD * Math.sqrt(FD * FD - 1);
9258
+ zD = (d) => {
9259
+ let C = Math.exp(-FD * LD * d), w = Math.min(s * d, 300);
9260
+ return L - C * ((PD + FD * LD * ID) * Math.sinh(w) + s * ID * Math.cosh(w)) / s;
9604
9261
  };
9605
9262
  }
9606
- let kO = {
9263
+ let BD = {
9607
9264
  calculatedDuration: $ && J || null,
9608
9265
  next: (s) => {
9609
- let d = OO(s);
9266
+ let d = zD(s);
9610
9267
  if ($) V.done = s >= J;
9611
9268
  else {
9612
- let C = s === 0 ? CO : 0;
9613
- wO < 1 && (C = s === 0 ? /* @__PURE__ */ secondsToMilliseconds(CO) : calcGeneratorVelocity(OO, s, d));
9269
+ let C = s === 0 ? PD : 0;
9270
+ FD < 1 && (C = s === 0 ? /* @__PURE__ */ secondsToMilliseconds(PD) : calcGeneratorVelocity(zD, s, d));
9614
9271
  let F = Math.abs(C) <= w, U = Math.abs(L - d) <= k;
9615
9272
  V.done = F && U;
9616
9273
  }
9617
9274
  return V.value = V.done ? L : d, V;
9618
9275
  },
9619
9276
  toString: () => {
9620
- let s = Math.min(calcGeneratorDuration(kO), maxGeneratorDuration), d = generateLinearEasing((d) => kO.next(s * d).value, s, 30);
9277
+ let s = Math.min(calcGeneratorDuration(BD), maxGeneratorDuration), d = generateLinearEasing((d) => BD.next(s * d).value, s, 30);
9621
9278
  return s + "ms " + d;
9622
9279
  },
9623
9280
  toTransition: () => {}
9624
9281
  };
9625
- return kO;
9282
+ return BD;
9626
9283
  }
9627
9284
  spring.applyToOptions = (s) => {
9628
9285
  let d = createGeneratorEasing(s, 100, spring);
@@ -9632,26 +9289,26 @@ function inertia({ keyframes: s, velocity: d = 0, power: C = .8, timeConstant: w
9632
9289
  let J = s[0], X = {
9633
9290
  done: !1,
9634
9291
  value: J
9635
- }, $ = (s) => V !== void 0 && s < V || U !== void 0 && s > U, CO = (s) => V === void 0 ? U : U === void 0 || Math.abs(V - s) < Math.abs(U - s) ? V : U, wO = C * d, TO = J + wO, EO = L === void 0 ? TO : L(TO);
9636
- EO !== TO && (wO = EO - J);
9637
- let DO = (s) => -wO * Math.exp(-s / w), OO = (s) => EO + DO(s), kO = (s) => {
9638
- let d = DO(s), C = OO(s);
9639
- X.done = Math.abs(d) <= K, X.value = X.done ? EO : C;
9640
- }, AO, jO, MO = (s) => {
9641
- $(X.value) && (AO = s, jO = spring({
9642
- keyframes: [X.value, CO(X.value)],
9643
- velocity: calcGeneratorVelocity(OO, s, X.value),
9292
+ }, $ = (s) => V !== void 0 && s < V || U !== void 0 && s > U, PD = (s) => V === void 0 ? U : U === void 0 || Math.abs(V - s) < Math.abs(U - s) ? V : U, FD = C * d, ID = J + FD, LD = L === void 0 ? ID : L(ID);
9293
+ LD !== ID && (FD = LD - J);
9294
+ let RD = (s) => -FD * Math.exp(-s / w), zD = (s) => LD + RD(s), BD = (s) => {
9295
+ let d = RD(s), C = zD(s);
9296
+ X.done = Math.abs(d) <= K, X.value = X.done ? LD : C;
9297
+ }, VD, HD, UD = (s) => {
9298
+ $(X.value) && (VD = s, HD = spring({
9299
+ keyframes: [X.value, PD(X.value)],
9300
+ velocity: calcGeneratorVelocity(zD, s, X.value),
9644
9301
  damping: k,
9645
9302
  stiffness: F,
9646
9303
  restDelta: K,
9647
9304
  restSpeed: q
9648
9305
  }));
9649
9306
  };
9650
- return MO(0), {
9307
+ return UD(0), {
9651
9308
  calculatedDuration: null,
9652
9309
  next: (s) => {
9653
9310
  let d = !1;
9654
- return !jO && AO === void 0 && (d = !0, kO(s), MO(s)), AO !== void 0 && s >= AO ? jO.next(s - AO) : (!d && kO(s), X);
9311
+ return !HD && VD === void 0 && (d = !0, BD(s), UD(s)), VD !== void 0 && s >= VD ? HD.next(s - VD) : (!d && BD(s), X);
9655
9312
  }
9656
9313
  };
9657
9314
  }
@@ -9769,24 +9426,24 @@ var WithPromise = class {
9769
9426
  tick(s, d = !1) {
9770
9427
  let { generator: C, totalDuration: w, mixKeyframes: k, mirroredGenerator: F, resolvedDuration: L, calculatedDuration: V } = this;
9771
9428
  if (this.startTime === null) return C.next(0);
9772
- let { delay: U = 0, keyframes: K, repeat: q, repeatType: J, repeatDelay: X, type: $, onUpdate: CO, finalKeyframe: wO } = this.options;
9429
+ let { delay: U = 0, keyframes: K, repeat: q, repeatType: J, repeatDelay: X, type: $, onUpdate: PD, finalKeyframe: FD } = this.options;
9773
9430
  this.speed > 0 ? this.startTime = Math.min(this.startTime, s) : this.speed < 0 && (this.startTime = Math.min(s - w / this.speed, this.startTime)), d ? this.currentTime = s : this.updateTime(s);
9774
- let TO = this.currentTime - U * (this.playbackSpeed >= 0 ? 1 : -1), EO = this.playbackSpeed >= 0 ? TO < 0 : TO > w;
9775
- this.currentTime = Math.max(TO, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = w);
9776
- let DO = this.currentTime, OO = C;
9431
+ let ID = this.currentTime - U * (this.playbackSpeed >= 0 ? 1 : -1), LD = this.playbackSpeed >= 0 ? ID < 0 : ID > w;
9432
+ this.currentTime = Math.max(ID, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = w);
9433
+ let RD = this.currentTime, zD = C;
9777
9434
  if (q) {
9778
9435
  let s = Math.min(this.currentTime, w) / L, d = Math.floor(s), C = s % 1;
9779
- !C && s >= 1 && (C = 1), C === 1 && d--, d = Math.min(d, q + 1), d % 2 && (J === "reverse" ? (C = 1 - C, X && (C -= X / L)) : J === "mirror" && (OO = F)), DO = clamp(0, 1, C) * L;
9436
+ !C && s >= 1 && (C = 1), C === 1 && d--, d = Math.min(d, q + 1), d % 2 && (J === "reverse" ? (C = 1 - C, X && (C -= X / L)) : J === "mirror" && (zD = F)), RD = clamp(0, 1, C) * L;
9780
9437
  }
9781
- let kO = EO ? {
9438
+ let BD = LD ? {
9782
9439
  done: !1,
9783
9440
  value: K[0]
9784
- } : OO.next(DO);
9785
- k && (kO.value = k(kO.value));
9786
- let { done: AO } = kO;
9787
- !EO && V !== null && (AO = this.playbackSpeed >= 0 ? this.currentTime >= w : this.currentTime <= 0);
9788
- let jO = this.holdTime === null && (this.state === "finished" || this.state === "running" && AO);
9789
- return jO && $ !== inertia && (kO.value = getFinalKeyframe$1(K, this.options, wO, this.speed)), CO && CO(kO.value), jO && this.finish(), kO;
9441
+ } : zD.next(RD);
9442
+ k && (BD.value = k(BD.value));
9443
+ let { done: VD } = BD;
9444
+ !LD && V !== null && (VD = this.playbackSpeed >= 0 ? this.currentTime >= w : this.currentTime <= 0);
9445
+ let HD = this.holdTime === null && (this.state === "finished" || this.state === "running" && VD);
9446
+ return HD && $ !== inertia && (BD.value = getFinalKeyframe$1(K, this.options, FD, this.speed)), PD && PD(BD.value), HD && this.finish(), BD;
9790
9447
  }
9791
9448
  then(s, d) {
9792
9449
  return this.finished.then(s, d);
@@ -11155,18 +10812,18 @@ function useVisualElement(s, d, C, w, k, F) {
11155
10812
  reducedMotionConfig: K,
11156
10813
  isSVG: F
11157
10814
  }));
11158
- let $ = X.current, wO = useContext(SwitchLayoutGroupContext);
11159
- $ && !$.projection && k && ($.type === "html" || $.type === "svg") && createProjectionNode$1(X.current, C, k, wO);
11160
- let TO = useRef(!1);
10815
+ let $ = X.current, FD = useContext(SwitchLayoutGroupContext);
10816
+ $ && !$.projection && k && ($.type === "html" || $.type === "svg") && createProjectionNode$1(X.current, C, k, FD);
10817
+ let ID = useRef(!1);
11161
10818
  useInsertionEffect(() => {
11162
- $ && TO.current && $.update(C, U);
10819
+ $ && ID.current && $.update(C, U);
11163
10820
  });
11164
- let DO = C[optimizedAppearDataAttribute], OO = useRef(!!DO && !window.MotionHandoffIsComplete?.(DO) && window.MotionHasOptimisedAnimation?.(DO));
10821
+ let RD = C[optimizedAppearDataAttribute], zD = useRef(!!RD && !window.MotionHandoffIsComplete?.(RD) && window.MotionHasOptimisedAnimation?.(RD));
11165
10822
  return useIsomorphicLayoutEffect(() => {
11166
- $ && (TO.current = !0, window.MotionIsMounted = !0, $.updateFeatures(), $.scheduleRenderMicrotask(), OO.current && $.animationState && $.animationState.animateChanges());
10823
+ $ && (ID.current = !0, window.MotionIsMounted = !0, $.updateFeatures(), $.scheduleRenderMicrotask(), zD.current && $.animationState && $.animationState.animateChanges());
11167
10824
  }), useEffect(() => {
11168
- $ && (!OO.current && $.animationState && $.animationState.animateChanges(), OO.current &&= (queueMicrotask(() => {
11169
- window.MotionHandoffMarkAsComplete?.(DO);
10825
+ $ && (!zD.current && $.animationState && $.animationState.animateChanges(), zD.current &&= (queueMicrotask(() => {
10826
+ window.MotionHandoffMarkAsComplete?.(RD);
11170
10827
  }), !1), $.enteringChildren = void 0);
11171
10828
  }), $;
11172
10829
  }
@@ -11844,34 +11501,34 @@ function createAnimationState(s) {
11844
11501
  function L(F) {
11845
11502
  let { props: L } = s, V = getVariantContext(s.parent) || {}, U = [], K = /* @__PURE__ */ new Set(), q = {}, J = Infinity;
11846
11503
  for (let d = 0; d < numAnimationTypes; d++) {
11847
- let X = reversePriorityOrder[d], $ = C[X], CO = L[X] === void 0 ? V[X] : L[X], wO = isVariantLabel(CO), TO = X === F ? $.isActive : null;
11848
- TO === !1 && (J = d);
11849
- let EO = CO === V[X] && CO !== L[X] && wO;
11850
- if (EO && w && s.manuallyAnimateOnMount && (EO = !1), $.protectedKeys = { ...q }, !$.isActive && TO === null || !CO && !$.prevProp || isAnimationControls(CO) || typeof CO == "boolean") continue;
11851
- let DO = checkVariantsDidChange($.prevProp, CO), OO = DO || X === F && $.isActive && !EO && wO || d > J && wO, kO = !1, AO = Array.isArray(CO) ? CO : [CO], jO = AO.reduce(k(X), {});
11852
- TO === !1 && (jO = {});
11853
- let { prevResolvedValues: MO = {} } = $, NO = {
11854
- ...MO,
11855
- ...jO
11856
- }, PO = (d) => {
11857
- OO = !0, K.has(d) && (kO = !0, K.delete(d)), $.needsAnimating[d] = !0;
11504
+ let X = reversePriorityOrder[d], $ = C[X], PD = L[X] === void 0 ? V[X] : L[X], FD = isVariantLabel(PD), ID = X === F ? $.isActive : null;
11505
+ ID === !1 && (J = d);
11506
+ let LD = PD === V[X] && PD !== L[X] && FD;
11507
+ if (LD && w && s.manuallyAnimateOnMount && (LD = !1), $.protectedKeys = { ...q }, !$.isActive && ID === null || !PD && !$.prevProp || isAnimationControls(PD) || typeof PD == "boolean") continue;
11508
+ let RD = checkVariantsDidChange($.prevProp, PD), zD = RD || X === F && $.isActive && !LD && FD || d > J && FD, BD = !1, VD = Array.isArray(PD) ? PD : [PD], HD = VD.reduce(k(X), {});
11509
+ ID === !1 && (HD = {});
11510
+ let { prevResolvedValues: UD = {} } = $, WD = {
11511
+ ...UD,
11512
+ ...HD
11513
+ }, GD = (d) => {
11514
+ zD = !0, K.has(d) && (BD = !0, K.delete(d)), $.needsAnimating[d] = !0;
11858
11515
  let C = s.getValue(d);
11859
11516
  C && (C.liveStyle = !1);
11860
11517
  };
11861
- for (let s in NO) {
11862
- let d = jO[s], C = MO[s];
11518
+ for (let s in WD) {
11519
+ let d = HD[s], C = UD[s];
11863
11520
  if (q.hasOwnProperty(s)) continue;
11864
11521
  let w = !1;
11865
- w = isKeyframesTarget(d) && isKeyframesTarget(C) ? !shallowCompare(d, C) : d !== C, w ? d == null ? K.add(s) : PO(s) : d !== void 0 && K.has(s) ? PO(s) : $.protectedKeys[s] = !0;
11522
+ w = isKeyframesTarget(d) && isKeyframesTarget(C) ? !shallowCompare(d, C) : d !== C, w ? d == null ? K.add(s) : GD(s) : d !== void 0 && K.has(s) ? GD(s) : $.protectedKeys[s] = !0;
11866
11523
  }
11867
- $.prevProp = CO, $.prevResolvedValues = jO, $.isActive && (q = {
11524
+ $.prevProp = PD, $.prevResolvedValues = HD, $.isActive && (q = {
11868
11525
  ...q,
11869
- ...jO
11870
- }), w && s.blockInitialAnimation && (OO = !1);
11871
- let FO = EO && DO;
11872
- OO && (!FO || kO) && U.push(...AO.map((d) => {
11526
+ ...HD
11527
+ }), w && s.blockInitialAnimation && (zD = !1);
11528
+ let KD = LD && RD;
11529
+ zD && (!KD || BD) && U.push(...VD.map((d) => {
11873
11530
  let C = { type: X };
11874
- if (typeof d == "string" && w && !FO && s.manuallyAnimateOnMount && s.parent) {
11531
+ if (typeof d == "string" && w && !KD && s.manuallyAnimateOnMount && s.parent) {
11875
11532
  let { parent: w } = s, k = resolveVariant(w, d);
11876
11533
  if (w.enteringChildren && k) {
11877
11534
  let { delayChildren: d } = k.transition || {};