sodtrack-web-ui 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -239,16 +239,16 @@ function createSplitModifiers(config) {
239
239
  let bracketDepth = 0;
240
240
  let modifierStart = 0;
241
241
  let postfixModifierPosition;
242
- for (let index2 = 0; index2 < className.length; index2++) {
243
- let currentCharacter = className[index2];
242
+ for (let index = 0; index < className.length; index++) {
243
+ let currentCharacter = className[index];
244
244
  if (bracketDepth === 0) {
245
- if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index2, index2 + separatorLength) === separator)) {
246
- modifiers.push(className.slice(modifierStart, index2));
247
- modifierStart = index2 + separatorLength;
245
+ if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
246
+ modifiers.push(className.slice(modifierStart, index));
247
+ modifierStart = index + separatorLength;
248
248
  continue;
249
249
  }
250
250
  if (currentCharacter === "/") {
251
- postfixModifierPosition = index2;
251
+ postfixModifierPosition = index;
252
252
  continue;
253
253
  }
254
254
  }
@@ -356,12 +356,12 @@ function mergeClassList(classList, configUtils) {
356
356
  }).reverse().map((parsed) => parsed.originalClassName).join(" ");
357
357
  }
358
358
  function twJoin() {
359
- let index2 = 0;
359
+ let index = 0;
360
360
  let argument;
361
361
  let resolvedValue;
362
362
  let string = "";
363
- while (index2 < arguments.length) {
364
- if (argument = arguments[index2++]) {
363
+ while (index < arguments.length) {
364
+ if (argument = arguments[index++]) {
365
365
  if (resolvedValue = toValue(argument)) {
366
366
  string && (string += " ");
367
367
  string += resolvedValue;
@@ -2557,8 +2557,8 @@ var import_react2 = require("react");
2557
2557
 
2558
2558
  // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
2559
2559
  var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2560
- var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
2561
- return Boolean(className) && array.indexOf(className) === index2;
2560
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
2561
+ return Boolean(className) && array.indexOf(className) === index;
2562
2562
  }).join(" ");
2563
2563
 
2564
2564
  // node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
@@ -2581,7 +2581,7 @@ var defaultAttributes = {
2581
2581
  var Icon = (0, import_react.forwardRef)(
2582
2582
  ({
2583
2583
  color = "currentColor",
2584
- size: size4 = 24,
2584
+ size = 24,
2585
2585
  strokeWidth = 2,
2586
2586
  absoluteStrokeWidth,
2587
2587
  className = "",
@@ -2594,10 +2594,10 @@ var Icon = (0, import_react.forwardRef)(
2594
2594
  {
2595
2595
  ref,
2596
2596
  ...defaultAttributes,
2597
- width: size4,
2598
- height: size4,
2597
+ width: size,
2598
+ height: size,
2599
2599
  stroke: color,
2600
- strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
2600
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
2601
2601
  className: mergeClasses("lucide", className),
2602
2602
  ...rest
2603
2603
  },
@@ -2680,7 +2680,7 @@ var Button = ({
2680
2680
  children,
2681
2681
  className,
2682
2682
  variant = "contained",
2683
- size: size4 = "medium",
2683
+ size = "medium",
2684
2684
  startIcon,
2685
2685
  endIcon,
2686
2686
  loading = false,
@@ -2692,24 +2692,24 @@ var Button = ({
2692
2692
  {
2693
2693
  ...props,
2694
2694
  disabled: loading || disabled,
2695
- className: cn(button({ variant, size: size4, loading }), className)
2695
+ className: cn(button({ variant, size, loading }), className)
2696
2696
  },
2697
2697
  loading && /* @__PURE__ */ import_react3.default.createElement(
2698
2698
  LoaderCircleIcon,
2699
2699
  {
2700
2700
  className: cn("absolute animate-spin text-neutral-500"),
2701
- width: size4 === "small" ? "16px" : "24px",
2702
- height: size4 === "small" ? "16px" : "24px"
2701
+ width: size === "small" ? "16px" : "24px",
2702
+ height: size === "small" ? "16px" : "24px"
2703
2703
  }
2704
2704
  ),
2705
2705
  startIcon && import_react3.default.cloneElement(startIcon, {
2706
- width: size4 === "small" ? "16px" : "24px",
2707
- height: size4 === "small" ? "16px" : "24px"
2706
+ width: size === "small" ? "16px" : "24px",
2707
+ height: size === "small" ? "16px" : "24px"
2708
2708
  }),
2709
2709
  children,
2710
2710
  endIcon && import_react3.default.cloneElement(endIcon, {
2711
- width: size4 === "small" ? "16px" : "24px",
2712
- height: size4 === "small" ? "16px" : "24px"
2711
+ width: size === "small" ? "16px" : "24px",
2712
+ height: size === "small" ? "16px" : "24px"
2713
2713
  })
2714
2714
  );
2715
2715
  };
@@ -2767,17 +2767,17 @@ var Alert = ({
2767
2767
  variant,
2768
2768
  className,
2769
2769
  description,
2770
- size: size4 = "sm",
2770
+ size = "sm",
2771
2771
  title
2772
2772
  }) => {
2773
2773
  const [open, setOpen] = (0, import_react4.useState)(true);
2774
- return /* @__PURE__ */ import_react4.default.createElement("div", { className: cn(alertRoot({ variant, className }), !open && "hidden") }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex" }, variant === "warning" && /* @__PURE__ */ import_react4.default.createElement(TriangleAlertIcon, { className: alertIcon({ variant }) }), variant === "success" && /* @__PURE__ */ import_react4.default.createElement(CircleCheckIcon, { className: alertIcon({ variant }) }), variant === "error" && /* @__PURE__ */ import_react4.default.createElement(CircleXIcon, { className: alertIcon({ variant }) }), variant === "info" && /* @__PURE__ */ import_react4.default.createElement(InfoIcon, { className: alertIcon({ variant }) }), size4 === "sm" && /* @__PURE__ */ import_react4.default.createElement("p", { className: "leading-[130%]" }, title), size4 !== "sm" && /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react4.default.createElement("h6", { className: "font-semibold leading-[130%]" }, title), /* @__PURE__ */ import_react4.default.createElement(
2774
+ return /* @__PURE__ */ import_react4.default.createElement("div", { className: cn(alertRoot({ variant, className }), !open && "hidden") }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex" }, variant === "warning" && /* @__PURE__ */ import_react4.default.createElement(TriangleAlertIcon, { className: alertIcon({ variant }) }), variant === "success" && /* @__PURE__ */ import_react4.default.createElement(CircleCheckIcon, { className: alertIcon({ variant }) }), variant === "error" && /* @__PURE__ */ import_react4.default.createElement(CircleXIcon, { className: alertIcon({ variant }) }), variant === "info" && /* @__PURE__ */ import_react4.default.createElement(InfoIcon, { className: alertIcon({ variant }) }), size === "sm" && /* @__PURE__ */ import_react4.default.createElement("p", { className: "leading-[130%]" }, title), size !== "sm" && /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react4.default.createElement("h6", { className: "font-semibold leading-[130%]" }, title), /* @__PURE__ */ import_react4.default.createElement(
2775
2775
  "p",
2776
2776
  {
2777
2777
  className: cn(
2778
2778
  "mt-1 text-sm leading-[120%] text-neutral-700",
2779
- size4 === "md" && "line-clamp-1",
2780
- size4 === "lg" && "line-clamp-2"
2779
+ size === "md" && "line-clamp-1",
2780
+ size === "lg" && "line-clamp-2"
2781
2781
  )
2782
2782
  },
2783
2783
  description
@@ -2814,13 +2814,13 @@ var iconButton = (0, import_cva3.cva)({
2814
2814
  }
2815
2815
  });
2816
2816
  var IconButton = (0, import_react5.forwardRef)(
2817
- ({ children, className, variant = "contained", size: size4 = "medium", ...props }, ref) => {
2817
+ ({ children, className, variant = "contained", size = "medium", ...props }, ref) => {
2818
2818
  return /* @__PURE__ */ import_react5.default.createElement(
2819
2819
  "button",
2820
2820
  {
2821
2821
  ref,
2822
2822
  ...props,
2823
- className: iconButton({ variant, size: size4, className })
2823
+ className: iconButton({ variant, size, className })
2824
2824
  },
2825
2825
  children
2826
2826
  );
@@ -2828,3359 +2828,9 @@ var IconButton = (0, import_react5.forwardRef)(
2828
2828
  );
2829
2829
 
2830
2830
  // src/components/tooltip.tsx
2831
- var import_react22 = __toESM(require("react"));
2832
-
2833
- // node_modules/.pnpm/@babel+runtime@7.24.5/node_modules/@babel/runtime/helpers/esm/extends.js
2834
- function _extends() {
2835
- _extends = Object.assign ? Object.assign.bind() : function(target) {
2836
- for (var i = 1; i < arguments.length; i++) {
2837
- var source = arguments[i];
2838
- for (var key in source) {
2839
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2840
- target[key] = source[key];
2841
- }
2842
- }
2843
- }
2844
- return target;
2845
- };
2846
- return _extends.apply(this, arguments);
2847
- }
2848
-
2849
- // node_modules/.pnpm/@radix-ui+react-tooltip@1.0.7_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.mjs
2850
- var import_react21 = require("react");
2851
-
2852
- // node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
2853
- function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
2854
- return function handleEvent(event) {
2855
- originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
2856
- if (checkForDefaultPrevented === false || !event.defaultPrevented)
2857
- return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
2858
- };
2859
- }
2860
-
2861
- // node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
2862
- var import_react6 = require("react");
2863
- function $6ed0406888f73fc4$var$setRef(ref, value) {
2864
- if (typeof ref === "function")
2865
- ref(value);
2866
- else if (ref !== null && ref !== void 0)
2867
- ref.current = value;
2868
- }
2869
- function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
2870
- return (node) => refs.forEach(
2871
- (ref) => $6ed0406888f73fc4$var$setRef(ref, node)
2872
- );
2873
- }
2874
- function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
2875
- return (0, import_react6.useCallback)($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
2876
- }
2877
-
2878
- // node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-context/dist/index.mjs
2879
- var import_react7 = require("react");
2880
- function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
2881
- let defaultContexts = [];
2882
- function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
2883
- const BaseContext = /* @__PURE__ */ (0, import_react7.createContext)(defaultContext);
2884
- const index2 = defaultContexts.length;
2885
- defaultContexts = [
2886
- ...defaultContexts,
2887
- defaultContext
2888
- ];
2889
- function Provider(props) {
2890
- const { scope, children, ...context } = props;
2891
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
2892
- const value = (0, import_react7.useMemo)(
2893
- () => context,
2894
- Object.values(context)
2895
- );
2896
- return /* @__PURE__ */ (0, import_react7.createElement)(Context.Provider, {
2897
- value
2898
- }, children);
2899
- }
2900
- function useContext(consumerName, scope) {
2901
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
2902
- const context = (0, import_react7.useContext)(Context);
2903
- if (context)
2904
- return context;
2905
- if (defaultContext !== void 0)
2906
- return defaultContext;
2907
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2908
- }
2909
- Provider.displayName = rootComponentName + "Provider";
2910
- return [
2911
- Provider,
2912
- useContext
2913
- ];
2914
- }
2915
- const createScope = () => {
2916
- const scopeContexts = defaultContexts.map((defaultContext) => {
2917
- return /* @__PURE__ */ (0, import_react7.createContext)(defaultContext);
2918
- });
2919
- return function useScope(scope) {
2920
- const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
2921
- return (0, import_react7.useMemo)(
2922
- () => ({
2923
- [`__scope${scopeName}`]: {
2924
- ...scope,
2925
- [scopeName]: contexts
2926
- }
2927
- }),
2928
- [
2929
- scope,
2930
- contexts
2931
- ]
2932
- );
2933
- };
2934
- };
2935
- createScope.scopeName = scopeName;
2936
- return [
2937
- $c512c27ab02ef895$export$fd42f52fd3ae1109,
2938
- $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
2939
- ];
2940
- }
2941
- function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
2942
- const baseScope = scopes[0];
2943
- if (scopes.length === 1)
2944
- return baseScope;
2945
- const createScope1 = () => {
2946
- const scopeHooks = scopes.map(
2947
- (createScope) => ({
2948
- useScope: createScope(),
2949
- scopeName: createScope.scopeName
2950
- })
2951
- );
2952
- return function useComposedScopes(overrideScopes) {
2953
- const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
2954
- const scopeProps = useScope(overrideScopes);
2955
- const currentScope = scopeProps[`__scope${scopeName}`];
2956
- return {
2957
- ...nextScopes,
2958
- ...currentScope
2959
- };
2960
- }, {});
2961
- return (0, import_react7.useMemo)(
2962
- () => ({
2963
- [`__scope${baseScope.scopeName}`]: nextScopes1
2964
- }),
2965
- [
2966
- nextScopes1
2967
- ]
2968
- );
2969
- };
2970
- };
2971
- createScope1.scopeName = baseScope.scopeName;
2972
- return createScope1;
2973
- }
2974
-
2975
- // node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
2976
- var import_react12 = require("react");
2977
-
2978
- // node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs
2979
- var import_react9 = require("react");
2980
- var import_react_dom = require("react-dom");
2981
-
2982
- // node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-slot/dist/index.mjs
2983
- var import_react8 = require("react");
2984
- var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ (0, import_react8.forwardRef)((props, forwardedRef) => {
2985
- const { children, ...slotProps } = props;
2986
- const childrenArray = import_react8.Children.toArray(children);
2987
- const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
2988
- if (slottable) {
2989
- const newElement = slottable.props.children;
2990
- const newChildren = childrenArray.map((child) => {
2991
- if (child === slottable) {
2992
- if (import_react8.Children.count(newElement) > 1)
2993
- return import_react8.Children.only(null);
2994
- return /* @__PURE__ */ (0, import_react8.isValidElement)(newElement) ? newElement.props.children : null;
2995
- } else
2996
- return child;
2997
- });
2998
- return /* @__PURE__ */ (0, import_react8.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
2999
- ref: forwardedRef
3000
- }), /* @__PURE__ */ (0, import_react8.isValidElement)(newElement) ? /* @__PURE__ */ (0, import_react8.cloneElement)(newElement, void 0, newChildren) : null);
3001
- }
3002
- return /* @__PURE__ */ (0, import_react8.createElement)($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
3003
- ref: forwardedRef
3004
- }), children);
3005
- });
3006
- $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
3007
- var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ (0, import_react8.forwardRef)((props, forwardedRef) => {
3008
- const { children, ...slotProps } = props;
3009
- if (/* @__PURE__ */ (0, import_react8.isValidElement)(children))
3010
- return /* @__PURE__ */ (0, import_react8.cloneElement)(children, {
3011
- ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
3012
- ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
3013
- });
3014
- return import_react8.Children.count(children) > 1 ? import_react8.Children.only(null) : null;
3015
- });
3016
- $5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
3017
- var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
3018
- return /* @__PURE__ */ (0, import_react8.createElement)(import_react8.Fragment, null, children);
3019
- };
3020
- function $5e63c961fc1ce211$var$isSlottable(child) {
3021
- return /* @__PURE__ */ (0, import_react8.isValidElement)(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
3022
- }
3023
- function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
3024
- const overrideProps = {
3025
- ...childProps
3026
- };
3027
- for (const propName in childProps) {
3028
- const slotPropValue = slotProps[propName];
3029
- const childPropValue = childProps[propName];
3030
- const isHandler = /^on[A-Z]/.test(propName);
3031
- if (isHandler) {
3032
- if (slotPropValue && childPropValue)
3033
- overrideProps[propName] = (...args) => {
3034
- childPropValue(...args);
3035
- slotPropValue(...args);
3036
- };
3037
- else if (slotPropValue)
3038
- overrideProps[propName] = slotPropValue;
3039
- } else if (propName === "style")
3040
- overrideProps[propName] = {
3041
- ...slotPropValue,
3042
- ...childPropValue
3043
- };
3044
- else if (propName === "className")
3045
- overrideProps[propName] = [
3046
- slotPropValue,
3047
- childPropValue
3048
- ].filter(Boolean).join(" ");
3049
- }
3050
- return {
3051
- ...slotProps,
3052
- ...overrideProps
3053
- };
3054
- }
3055
-
3056
- // node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-primitive/dist/index.mjs
3057
- var $8927f6f2acc4f386$var$NODES = [
3058
- "a",
3059
- "button",
3060
- "div",
3061
- "form",
3062
- "h2",
3063
- "h3",
3064
- "img",
3065
- "input",
3066
- "label",
3067
- "li",
3068
- "nav",
3069
- "ol",
3070
- "p",
3071
- "span",
3072
- "svg",
3073
- "ul"
3074
- ];
3075
- var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
3076
- const Node2 = /* @__PURE__ */ (0, import_react9.forwardRef)((props, forwardedRef) => {
3077
- const { asChild, ...primitiveProps } = props;
3078
- const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
3079
- (0, import_react9.useEffect)(() => {
3080
- window[Symbol.for("radix-ui")] = true;
3081
- }, []);
3082
- return /* @__PURE__ */ (0, import_react9.createElement)(Comp, _extends({}, primitiveProps, {
3083
- ref: forwardedRef
3084
- }));
3085
- });
3086
- Node2.displayName = `Primitive.${node}`;
3087
- return {
3088
- ...primitive,
3089
- [node]: Node2
3090
- };
3091
- }, {});
3092
- function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
3093
- if (target)
3094
- (0, import_react_dom.flushSync)(
3095
- () => target.dispatchEvent(event)
3096
- );
3097
- }
3098
-
3099
- // node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
3100
- var import_react10 = require("react");
3101
- function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
3102
- const callbackRef = (0, import_react10.useRef)(callback);
3103
- (0, import_react10.useEffect)(() => {
3104
- callbackRef.current = callback;
3105
- });
3106
- return (0, import_react10.useMemo)(
3107
- () => (...args) => {
3108
- var _callbackRef$current;
3109
- return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
3110
- },
3111
- []
3112
- );
3113
- }
3114
-
3115
- // node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.0.3_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
3116
- var import_react11 = require("react");
3117
- function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3118
- const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
3119
- (0, import_react11.useEffect)(() => {
3120
- const handleKeyDown = (event) => {
3121
- if (event.key === "Escape")
3122
- onEscapeKeyDown(event);
3123
- };
3124
- ownerDocument.addEventListener("keydown", handleKeyDown);
3125
- return () => ownerDocument.removeEventListener("keydown", handleKeyDown);
3126
- }, [
3127
- onEscapeKeyDown,
3128
- ownerDocument
3129
- ]);
3130
- }
3131
-
3132
- // node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
3133
- var $5cb92bef7577960e$var$CONTEXT_UPDATE = "dismissableLayer.update";
3134
- var $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
3135
- var $5cb92bef7577960e$var$FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
3136
- var $5cb92bef7577960e$var$originalBodyPointerEvents;
3137
- var $5cb92bef7577960e$var$DismissableLayerContext = /* @__PURE__ */ (0, import_react12.createContext)({
3138
- layers: /* @__PURE__ */ new Set(),
3139
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
3140
- branches: /* @__PURE__ */ new Set()
3141
- });
3142
- var $5cb92bef7577960e$export$177fb62ff3ec1f22 = /* @__PURE__ */ (0, import_react12.forwardRef)((props, forwardedRef) => {
3143
- var _node$ownerDocument;
3144
- const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
3145
- const context = (0, import_react12.useContext)($5cb92bef7577960e$var$DismissableLayerContext);
3146
- const [node1, setNode] = (0, import_react12.useState)(null);
3147
- const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
3148
- const [, force] = (0, import_react12.useState)({});
3149
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
3150
- forwardedRef,
3151
- (node) => setNode(node)
3152
- );
3153
- const layers = Array.from(context.layers);
3154
- const [highestLayerWithOutsidePointerEventsDisabled] = [
3155
- ...context.layersWithOutsidePointerEventsDisabled
3156
- ].slice(-1);
3157
- const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
3158
- const index2 = node1 ? layers.indexOf(node1) : -1;
3159
- const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
3160
- const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
3161
- const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event) => {
3162
- const target = event.target;
3163
- const isPointerDownOnBranch = [
3164
- ...context.branches
3165
- ].some(
3166
- (branch) => branch.contains(target)
3167
- );
3168
- if (!isPointerEventsEnabled || isPointerDownOnBranch)
3169
- return;
3170
- onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
3171
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
3172
- if (!event.defaultPrevented)
3173
- onDismiss === null || onDismiss === void 0 || onDismiss();
3174
- }, ownerDocument);
3175
- const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event) => {
3176
- const target = event.target;
3177
- const isFocusInBranch = [
3178
- ...context.branches
3179
- ].some(
3180
- (branch) => branch.contains(target)
3181
- );
3182
- if (isFocusInBranch)
3183
- return;
3184
- onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
3185
- onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
3186
- if (!event.defaultPrevented)
3187
- onDismiss === null || onDismiss === void 0 || onDismiss();
3188
- }, ownerDocument);
3189
- $addc16e1bbe58fd0$export$3a72a57244d6e765((event) => {
3190
- const isHighestLayer = index2 === context.layers.size - 1;
3191
- if (!isHighestLayer)
3192
- return;
3193
- onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
3194
- if (!event.defaultPrevented && onDismiss) {
3195
- event.preventDefault();
3196
- onDismiss();
3197
- }
3198
- }, ownerDocument);
3199
- (0, import_react12.useEffect)(() => {
3200
- if (!node1)
3201
- return;
3202
- if (disableOutsidePointerEvents) {
3203
- if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
3204
- $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
3205
- ownerDocument.body.style.pointerEvents = "none";
3206
- }
3207
- context.layersWithOutsidePointerEventsDisabled.add(node1);
3208
- }
3209
- context.layers.add(node1);
3210
- $5cb92bef7577960e$var$dispatchUpdate();
3211
- return () => {
3212
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1)
3213
- ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
3214
- };
3215
- }, [
3216
- node1,
3217
- ownerDocument,
3218
- disableOutsidePointerEvents,
3219
- context
3220
- ]);
3221
- (0, import_react12.useEffect)(() => {
3222
- return () => {
3223
- if (!node1)
3224
- return;
3225
- context.layers.delete(node1);
3226
- context.layersWithOutsidePointerEventsDisabled.delete(node1);
3227
- $5cb92bef7577960e$var$dispatchUpdate();
3228
- };
3229
- }, [
3230
- node1,
3231
- context
3232
- ]);
3233
- (0, import_react12.useEffect)(() => {
3234
- const handleUpdate = () => force({});
3235
- document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
3236
- return () => document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
3237
- }, []);
3238
- return /* @__PURE__ */ (0, import_react12.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
3239
- ref: composedRefs,
3240
- style: {
3241
- pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
3242
- ...props.style
3243
- },
3244
- onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
3245
- onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
3246
- onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
3247
- }));
3248
- });
3249
- function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3250
- const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
3251
- const isPointerInsideReactTreeRef = (0, import_react12.useRef)(false);
3252
- const handleClickRef = (0, import_react12.useRef)(() => {
3253
- });
3254
- (0, import_react12.useEffect)(() => {
3255
- const handlePointerDown = (event) => {
3256
- if (event.target && !isPointerInsideReactTreeRef.current) {
3257
- let handleAndDispatchPointerDownOutsideEvent2 = function() {
3258
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
3259
- discrete: true
3260
- });
3261
- };
3262
- var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
3263
- const eventDetail = {
3264
- originalEvent: event
3265
- };
3266
- if (event.pointerType === "touch") {
3267
- ownerDocument.removeEventListener("click", handleClickRef.current);
3268
- handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
3269
- ownerDocument.addEventListener("click", handleClickRef.current, {
3270
- once: true
3271
- });
3272
- } else
3273
- handleAndDispatchPointerDownOutsideEvent2();
3274
- } else
3275
- ownerDocument.removeEventListener("click", handleClickRef.current);
3276
- isPointerInsideReactTreeRef.current = false;
3277
- };
3278
- const timerId = window.setTimeout(() => {
3279
- ownerDocument.addEventListener("pointerdown", handlePointerDown);
3280
- }, 0);
3281
- return () => {
3282
- window.clearTimeout(timerId);
3283
- ownerDocument.removeEventListener("pointerdown", handlePointerDown);
3284
- ownerDocument.removeEventListener("click", handleClickRef.current);
3285
- };
3286
- }, [
3287
- ownerDocument,
3288
- handlePointerDownOutside
3289
- ]);
3290
- return {
3291
- // ensures we check React component tree (not just DOM tree)
3292
- onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
3293
- };
3294
- }
3295
- function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
3296
- const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
3297
- const isFocusInsideReactTreeRef = (0, import_react12.useRef)(false);
3298
- (0, import_react12.useEffect)(() => {
3299
- const handleFocus = (event) => {
3300
- if (event.target && !isFocusInsideReactTreeRef.current) {
3301
- const eventDetail = {
3302
- originalEvent: event
3303
- };
3304
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
3305
- discrete: false
3306
- });
3307
- }
3308
- };
3309
- ownerDocument.addEventListener("focusin", handleFocus);
3310
- return () => ownerDocument.removeEventListener("focusin", handleFocus);
3311
- }, [
3312
- ownerDocument,
3313
- handleFocusOutside
3314
- ]);
3315
- return {
3316
- onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
3317
- onBlurCapture: () => isFocusInsideReactTreeRef.current = false
3318
- };
3319
- }
3320
- function $5cb92bef7577960e$var$dispatchUpdate() {
3321
- const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
3322
- document.dispatchEvent(event);
3323
- }
3324
- function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
3325
- const target = detail.originalEvent.target;
3326
- const event = new CustomEvent(name, {
3327
- bubbles: false,
3328
- cancelable: true,
3329
- detail
3330
- });
3331
- if (handler)
3332
- target.addEventListener(name, handler, {
3333
- once: true
3334
- });
3335
- if (discrete)
3336
- $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
3337
- else
3338
- target.dispatchEvent(event);
3339
- }
3340
-
3341
- // node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
3342
- var $2AODx$react = __toESM(require("react"), 1);
3343
-
3344
- // node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
3345
- var import_react13 = require("react");
3346
- var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react13.useLayoutEffect : () => {
3347
- };
3348
-
3349
- // node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-id/dist/index.mjs
3350
- var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
3351
- var $1746a345f3d73bb7$var$count = 0;
3352
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
3353
- const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
3354
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
3355
- if (!deterministicId)
3356
- setId(
3357
- (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
3358
- );
3359
- }, [
3360
- deterministicId
3361
- ]);
3362
- return deterministicId || (id ? `radix-${id}` : "");
3363
- }
3364
-
3365
- // node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.mjs
3366
- var import_react17 = require("react");
3367
-
3368
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
3369
- var sides = ["top", "right", "bottom", "left"];
3370
- var min = Math.min;
3371
- var max = Math.max;
3372
- var round = Math.round;
3373
- var floor = Math.floor;
3374
- var createCoords = (v) => ({
3375
- x: v,
3376
- y: v
3377
- });
3378
- var oppositeSideMap = {
3379
- left: "right",
3380
- right: "left",
3381
- bottom: "top",
3382
- top: "bottom"
3383
- };
3384
- var oppositeAlignmentMap = {
3385
- start: "end",
3386
- end: "start"
3387
- };
3388
- function clamp(start, value, end) {
3389
- return max(start, min(value, end));
3390
- }
3391
- function evaluate(value, param) {
3392
- return typeof value === "function" ? value(param) : value;
3393
- }
3394
- function getSide(placement) {
3395
- return placement.split("-")[0];
3396
- }
3397
- function getAlignment(placement) {
3398
- return placement.split("-")[1];
3399
- }
3400
- function getOppositeAxis(axis) {
3401
- return axis === "x" ? "y" : "x";
3402
- }
3403
- function getAxisLength(axis) {
3404
- return axis === "y" ? "height" : "width";
3405
- }
3406
- function getSideAxis(placement) {
3407
- return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
3408
- }
3409
- function getAlignmentAxis(placement) {
3410
- return getOppositeAxis(getSideAxis(placement));
3411
- }
3412
- function getAlignmentSides(placement, rects, rtl) {
3413
- if (rtl === void 0) {
3414
- rtl = false;
3415
- }
3416
- const alignment = getAlignment(placement);
3417
- const alignmentAxis = getAlignmentAxis(placement);
3418
- const length = getAxisLength(alignmentAxis);
3419
- let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
3420
- if (rects.reference[length] > rects.floating[length]) {
3421
- mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
3422
- }
3423
- return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
3424
- }
3425
- function getExpandedPlacements(placement) {
3426
- const oppositePlacement = getOppositePlacement(placement);
3427
- return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
3428
- }
3429
- function getOppositeAlignmentPlacement(placement) {
3430
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
3431
- }
3432
- function getSideList(side, isStart, rtl) {
3433
- const lr = ["left", "right"];
3434
- const rl = ["right", "left"];
3435
- const tb = ["top", "bottom"];
3436
- const bt = ["bottom", "top"];
3437
- switch (side) {
3438
- case "top":
3439
- case "bottom":
3440
- if (rtl)
3441
- return isStart ? rl : lr;
3442
- return isStart ? lr : rl;
3443
- case "left":
3444
- case "right":
3445
- return isStart ? tb : bt;
3446
- default:
3447
- return [];
3448
- }
3449
- }
3450
- function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
3451
- const alignment = getAlignment(placement);
3452
- let list = getSideList(getSide(placement), direction === "start", rtl);
3453
- if (alignment) {
3454
- list = list.map((side) => side + "-" + alignment);
3455
- if (flipAlignment) {
3456
- list = list.concat(list.map(getOppositeAlignmentPlacement));
3457
- }
3458
- }
3459
- return list;
3460
- }
3461
- function getOppositePlacement(placement) {
3462
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
3463
- }
3464
- function expandPaddingObject(padding) {
3465
- return {
3466
- top: 0,
3467
- right: 0,
3468
- bottom: 0,
3469
- left: 0,
3470
- ...padding
3471
- };
3472
- }
3473
- function getPaddingObject(padding) {
3474
- return typeof padding !== "number" ? expandPaddingObject(padding) : {
3475
- top: padding,
3476
- right: padding,
3477
- bottom: padding,
3478
- left: padding
3479
- };
3480
- }
3481
- function rectToClientRect(rect) {
3482
- const {
3483
- x,
3484
- y,
3485
- width,
3486
- height
3487
- } = rect;
3488
- return {
3489
- width,
3490
- height,
3491
- top: y,
3492
- left: x,
3493
- right: x + width,
3494
- bottom: y + height,
3495
- x,
3496
- y
3497
- };
3498
- }
3499
-
3500
- // node_modules/.pnpm/@floating-ui+core@1.6.2/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
3501
- function computeCoordsFromPlacement(_ref, placement, rtl) {
3502
- let {
3503
- reference,
3504
- floating
3505
- } = _ref;
3506
- const sideAxis = getSideAxis(placement);
3507
- const alignmentAxis = getAlignmentAxis(placement);
3508
- const alignLength = getAxisLength(alignmentAxis);
3509
- const side = getSide(placement);
3510
- const isVertical = sideAxis === "y";
3511
- const commonX = reference.x + reference.width / 2 - floating.width / 2;
3512
- const commonY = reference.y + reference.height / 2 - floating.height / 2;
3513
- const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
3514
- let coords;
3515
- switch (side) {
3516
- case "top":
3517
- coords = {
3518
- x: commonX,
3519
- y: reference.y - floating.height
3520
- };
3521
- break;
3522
- case "bottom":
3523
- coords = {
3524
- x: commonX,
3525
- y: reference.y + reference.height
3526
- };
3527
- break;
3528
- case "right":
3529
- coords = {
3530
- x: reference.x + reference.width,
3531
- y: commonY
3532
- };
3533
- break;
3534
- case "left":
3535
- coords = {
3536
- x: reference.x - floating.width,
3537
- y: commonY
3538
- };
3539
- break;
3540
- default:
3541
- coords = {
3542
- x: reference.x,
3543
- y: reference.y
3544
- };
3545
- }
3546
- switch (getAlignment(placement)) {
3547
- case "start":
3548
- coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
3549
- break;
3550
- case "end":
3551
- coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
3552
- break;
3553
- }
3554
- return coords;
3555
- }
3556
- var computePosition = async (reference, floating, config) => {
3557
- const {
3558
- placement = "bottom",
3559
- strategy = "absolute",
3560
- middleware = [],
3561
- platform: platform2
3562
- } = config;
3563
- const validMiddleware = middleware.filter(Boolean);
3564
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
3565
- let rects = await platform2.getElementRects({
3566
- reference,
3567
- floating,
3568
- strategy
3569
- });
3570
- let {
3571
- x,
3572
- y
3573
- } = computeCoordsFromPlacement(rects, placement, rtl);
3574
- let statefulPlacement = placement;
3575
- let middlewareData = {};
3576
- let resetCount = 0;
3577
- for (let i = 0; i < validMiddleware.length; i++) {
3578
- const {
3579
- name,
3580
- fn
3581
- } = validMiddleware[i];
3582
- const {
3583
- x: nextX,
3584
- y: nextY,
3585
- data,
3586
- reset
3587
- } = await fn({
3588
- x,
3589
- y,
3590
- initialPlacement: placement,
3591
- placement: statefulPlacement,
3592
- strategy,
3593
- middlewareData,
3594
- rects,
3595
- platform: platform2,
3596
- elements: {
3597
- reference,
3598
- floating
3599
- }
3600
- });
3601
- x = nextX != null ? nextX : x;
3602
- y = nextY != null ? nextY : y;
3603
- middlewareData = {
3604
- ...middlewareData,
3605
- [name]: {
3606
- ...middlewareData[name],
3607
- ...data
3608
- }
3609
- };
3610
- if (reset && resetCount <= 50) {
3611
- resetCount++;
3612
- if (typeof reset === "object") {
3613
- if (reset.placement) {
3614
- statefulPlacement = reset.placement;
3615
- }
3616
- if (reset.rects) {
3617
- rects = reset.rects === true ? await platform2.getElementRects({
3618
- reference,
3619
- floating,
3620
- strategy
3621
- }) : reset.rects;
3622
- }
3623
- ({
3624
- x,
3625
- y
3626
- } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
3627
- }
3628
- i = -1;
3629
- }
3630
- }
3631
- return {
3632
- x,
3633
- y,
3634
- placement: statefulPlacement,
3635
- strategy,
3636
- middlewareData
3637
- };
3638
- };
3639
- async function detectOverflow(state, options) {
3640
- var _await$platform$isEle;
3641
- if (options === void 0) {
3642
- options = {};
3643
- }
3644
- const {
3645
- x,
3646
- y,
3647
- platform: platform2,
3648
- rects,
3649
- elements,
3650
- strategy
3651
- } = state;
3652
- const {
3653
- boundary = "clippingAncestors",
3654
- rootBoundary = "viewport",
3655
- elementContext = "floating",
3656
- altBoundary = false,
3657
- padding = 0
3658
- } = evaluate(options, state);
3659
- const paddingObject = getPaddingObject(padding);
3660
- const altContext = elementContext === "floating" ? "reference" : "floating";
3661
- const element = elements[altBoundary ? altContext : elementContext];
3662
- const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
3663
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
3664
- boundary,
3665
- rootBoundary,
3666
- strategy
3667
- }));
3668
- const rect = elementContext === "floating" ? {
3669
- x,
3670
- y,
3671
- width: rects.floating.width,
3672
- height: rects.floating.height
3673
- } : rects.reference;
3674
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
3675
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
3676
- x: 1,
3677
- y: 1
3678
- } : {
3679
- x: 1,
3680
- y: 1
3681
- };
3682
- const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
3683
- elements,
3684
- rect,
3685
- offsetParent,
3686
- strategy
3687
- }) : rect);
3688
- return {
3689
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
3690
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
3691
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
3692
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
3693
- };
3694
- }
3695
- var arrow = (options) => ({
3696
- name: "arrow",
3697
- options,
3698
- async fn(state) {
3699
- const {
3700
- x,
3701
- y,
3702
- placement,
3703
- rects,
3704
- platform: platform2,
3705
- elements,
3706
- middlewareData
3707
- } = state;
3708
- const {
3709
- element,
3710
- padding = 0
3711
- } = evaluate(options, state) || {};
3712
- if (element == null) {
3713
- return {};
3714
- }
3715
- const paddingObject = getPaddingObject(padding);
3716
- const coords = {
3717
- x,
3718
- y
3719
- };
3720
- const axis = getAlignmentAxis(placement);
3721
- const length = getAxisLength(axis);
3722
- const arrowDimensions = await platform2.getDimensions(element);
3723
- const isYAxis = axis === "y";
3724
- const minProp = isYAxis ? "top" : "left";
3725
- const maxProp = isYAxis ? "bottom" : "right";
3726
- const clientProp = isYAxis ? "clientHeight" : "clientWidth";
3727
- const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
3728
- const startDiff = coords[axis] - rects.reference[axis];
3729
- const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
3730
- let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
3731
- if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
3732
- clientSize = elements.floating[clientProp] || rects.floating[length];
3733
- }
3734
- const centerToReference = endDiff / 2 - startDiff / 2;
3735
- const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
3736
- const minPadding = min(paddingObject[minProp], largestPossiblePadding);
3737
- const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
3738
- const min$1 = minPadding;
3739
- const max2 = clientSize - arrowDimensions[length] - maxPadding;
3740
- const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
3741
- const offset4 = clamp(min$1, center, max2);
3742
- const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
3743
- const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
3744
- return {
3745
- [axis]: coords[axis] + alignmentOffset,
3746
- data: {
3747
- [axis]: offset4,
3748
- centerOffset: center - offset4 - alignmentOffset,
3749
- ...shouldAddOffset && {
3750
- alignmentOffset
3751
- }
3752
- },
3753
- reset: shouldAddOffset
3754
- };
3755
- }
3756
- });
3757
- var flip = function(options) {
3758
- if (options === void 0) {
3759
- options = {};
3760
- }
3761
- return {
3762
- name: "flip",
3763
- options,
3764
- async fn(state) {
3765
- var _middlewareData$arrow, _middlewareData$flip;
3766
- const {
3767
- placement,
3768
- middlewareData,
3769
- rects,
3770
- initialPlacement,
3771
- platform: platform2,
3772
- elements
3773
- } = state;
3774
- const {
3775
- mainAxis: checkMainAxis = true,
3776
- crossAxis: checkCrossAxis = true,
3777
- fallbackPlacements: specifiedFallbackPlacements,
3778
- fallbackStrategy = "bestFit",
3779
- fallbackAxisSideDirection = "none",
3780
- flipAlignment = true,
3781
- ...detectOverflowOptions
3782
- } = evaluate(options, state);
3783
- if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3784
- return {};
3785
- }
3786
- const side = getSide(placement);
3787
- const isBasePlacement = getSide(initialPlacement) === initialPlacement;
3788
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3789
- const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
3790
- if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
3791
- fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
3792
- }
3793
- const placements2 = [initialPlacement, ...fallbackPlacements];
3794
- const overflow = await detectOverflow(state, detectOverflowOptions);
3795
- const overflows = [];
3796
- let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
3797
- if (checkMainAxis) {
3798
- overflows.push(overflow[side]);
3799
- }
3800
- if (checkCrossAxis) {
3801
- const sides2 = getAlignmentSides(placement, rects, rtl);
3802
- overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
3803
- }
3804
- overflowsData = [...overflowsData, {
3805
- placement,
3806
- overflows
3807
- }];
3808
- if (!overflows.every((side2) => side2 <= 0)) {
3809
- var _middlewareData$flip2, _overflowsData$filter;
3810
- const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
3811
- const nextPlacement = placements2[nextIndex];
3812
- if (nextPlacement) {
3813
- return {
3814
- data: {
3815
- index: nextIndex,
3816
- overflows: overflowsData
3817
- },
3818
- reset: {
3819
- placement: nextPlacement
3820
- }
3821
- };
3822
- }
3823
- let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
3824
- if (!resetPlacement) {
3825
- switch (fallbackStrategy) {
3826
- case "bestFit": {
3827
- var _overflowsData$map$so;
3828
- const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
3829
- if (placement2) {
3830
- resetPlacement = placement2;
3831
- }
3832
- break;
3833
- }
3834
- case "initialPlacement":
3835
- resetPlacement = initialPlacement;
3836
- break;
3837
- }
3838
- }
3839
- if (placement !== resetPlacement) {
3840
- return {
3841
- reset: {
3842
- placement: resetPlacement
3843
- }
3844
- };
3845
- }
3846
- }
3847
- return {};
3848
- }
3849
- };
3850
- };
3851
- function getSideOffsets(overflow, rect) {
3852
- return {
3853
- top: overflow.top - rect.height,
3854
- right: overflow.right - rect.width,
3855
- bottom: overflow.bottom - rect.height,
3856
- left: overflow.left - rect.width
3857
- };
3858
- }
3859
- function isAnySideFullyClipped(overflow) {
3860
- return sides.some((side) => overflow[side] >= 0);
3861
- }
3862
- var hide = function(options) {
3863
- if (options === void 0) {
3864
- options = {};
3865
- }
3866
- return {
3867
- name: "hide",
3868
- options,
3869
- async fn(state) {
3870
- const {
3871
- rects
3872
- } = state;
3873
- const {
3874
- strategy = "referenceHidden",
3875
- ...detectOverflowOptions
3876
- } = evaluate(options, state);
3877
- switch (strategy) {
3878
- case "referenceHidden": {
3879
- const overflow = await detectOverflow(state, {
3880
- ...detectOverflowOptions,
3881
- elementContext: "reference"
3882
- });
3883
- const offsets = getSideOffsets(overflow, rects.reference);
3884
- return {
3885
- data: {
3886
- referenceHiddenOffsets: offsets,
3887
- referenceHidden: isAnySideFullyClipped(offsets)
3888
- }
3889
- };
3890
- }
3891
- case "escaped": {
3892
- const overflow = await detectOverflow(state, {
3893
- ...detectOverflowOptions,
3894
- altBoundary: true
3895
- });
3896
- const offsets = getSideOffsets(overflow, rects.floating);
3897
- return {
3898
- data: {
3899
- escapedOffsets: offsets,
3900
- escaped: isAnySideFullyClipped(offsets)
3901
- }
3902
- };
3903
- }
3904
- default: {
3905
- return {};
3906
- }
3907
- }
3908
- }
3909
- };
3910
- };
3911
- async function convertValueToCoords(state, options) {
3912
- const {
3913
- placement,
3914
- platform: platform2,
3915
- elements
3916
- } = state;
3917
- const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
3918
- const side = getSide(placement);
3919
- const alignment = getAlignment(placement);
3920
- const isVertical = getSideAxis(placement) === "y";
3921
- const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
3922
- const crossAxisMulti = rtl && isVertical ? -1 : 1;
3923
- const rawValue = evaluate(options, state);
3924
- let {
3925
- mainAxis,
3926
- crossAxis,
3927
- alignmentAxis
3928
- } = typeof rawValue === "number" ? {
3929
- mainAxis: rawValue,
3930
- crossAxis: 0,
3931
- alignmentAxis: null
3932
- } : {
3933
- mainAxis: 0,
3934
- crossAxis: 0,
3935
- alignmentAxis: null,
3936
- ...rawValue
3937
- };
3938
- if (alignment && typeof alignmentAxis === "number") {
3939
- crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
3940
- }
3941
- return isVertical ? {
3942
- x: crossAxis * crossAxisMulti,
3943
- y: mainAxis * mainAxisMulti
3944
- } : {
3945
- x: mainAxis * mainAxisMulti,
3946
- y: crossAxis * crossAxisMulti
3947
- };
3948
- }
3949
- var offset = function(options) {
3950
- if (options === void 0) {
3951
- options = 0;
3952
- }
3953
- return {
3954
- name: "offset",
3955
- options,
3956
- async fn(state) {
3957
- var _middlewareData$offse, _middlewareData$arrow;
3958
- const {
3959
- x,
3960
- y,
3961
- placement,
3962
- middlewareData
3963
- } = state;
3964
- const diffCoords = await convertValueToCoords(state, options);
3965
- if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
3966
- return {};
3967
- }
3968
- return {
3969
- x: x + diffCoords.x,
3970
- y: y + diffCoords.y,
3971
- data: {
3972
- ...diffCoords,
3973
- placement
3974
- }
3975
- };
3976
- }
3977
- };
3978
- };
3979
- var shift = function(options) {
3980
- if (options === void 0) {
3981
- options = {};
3982
- }
3983
- return {
3984
- name: "shift",
3985
- options,
3986
- async fn(state) {
3987
- const {
3988
- x,
3989
- y,
3990
- placement
3991
- } = state;
3992
- const {
3993
- mainAxis: checkMainAxis = true,
3994
- crossAxis: checkCrossAxis = false,
3995
- limiter = {
3996
- fn: (_ref) => {
3997
- let {
3998
- x: x2,
3999
- y: y2
4000
- } = _ref;
4001
- return {
4002
- x: x2,
4003
- y: y2
4004
- };
4005
- }
4006
- },
4007
- ...detectOverflowOptions
4008
- } = evaluate(options, state);
4009
- const coords = {
4010
- x,
4011
- y
4012
- };
4013
- const overflow = await detectOverflow(state, detectOverflowOptions);
4014
- const crossAxis = getSideAxis(getSide(placement));
4015
- const mainAxis = getOppositeAxis(crossAxis);
4016
- let mainAxisCoord = coords[mainAxis];
4017
- let crossAxisCoord = coords[crossAxis];
4018
- if (checkMainAxis) {
4019
- const minSide = mainAxis === "y" ? "top" : "left";
4020
- const maxSide = mainAxis === "y" ? "bottom" : "right";
4021
- const min2 = mainAxisCoord + overflow[minSide];
4022
- const max2 = mainAxisCoord - overflow[maxSide];
4023
- mainAxisCoord = clamp(min2, mainAxisCoord, max2);
4024
- }
4025
- if (checkCrossAxis) {
4026
- const minSide = crossAxis === "y" ? "top" : "left";
4027
- const maxSide = crossAxis === "y" ? "bottom" : "right";
4028
- const min2 = crossAxisCoord + overflow[minSide];
4029
- const max2 = crossAxisCoord - overflow[maxSide];
4030
- crossAxisCoord = clamp(min2, crossAxisCoord, max2);
4031
- }
4032
- const limitedCoords = limiter.fn({
4033
- ...state,
4034
- [mainAxis]: mainAxisCoord,
4035
- [crossAxis]: crossAxisCoord
4036
- });
4037
- return {
4038
- ...limitedCoords,
4039
- data: {
4040
- x: limitedCoords.x - x,
4041
- y: limitedCoords.y - y
4042
- }
4043
- };
4044
- }
4045
- };
4046
- };
4047
- var limitShift = function(options) {
4048
- if (options === void 0) {
4049
- options = {};
4050
- }
4051
- return {
4052
- options,
4053
- fn(state) {
4054
- const {
4055
- x,
4056
- y,
4057
- placement,
4058
- rects,
4059
- middlewareData
4060
- } = state;
4061
- const {
4062
- offset: offset4 = 0,
4063
- mainAxis: checkMainAxis = true,
4064
- crossAxis: checkCrossAxis = true
4065
- } = evaluate(options, state);
4066
- const coords = {
4067
- x,
4068
- y
4069
- };
4070
- const crossAxis = getSideAxis(placement);
4071
- const mainAxis = getOppositeAxis(crossAxis);
4072
- let mainAxisCoord = coords[mainAxis];
4073
- let crossAxisCoord = coords[crossAxis];
4074
- const rawOffset = evaluate(offset4, state);
4075
- const computedOffset = typeof rawOffset === "number" ? {
4076
- mainAxis: rawOffset,
4077
- crossAxis: 0
4078
- } : {
4079
- mainAxis: 0,
4080
- crossAxis: 0,
4081
- ...rawOffset
4082
- };
4083
- if (checkMainAxis) {
4084
- const len = mainAxis === "y" ? "height" : "width";
4085
- const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
4086
- const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
4087
- if (mainAxisCoord < limitMin) {
4088
- mainAxisCoord = limitMin;
4089
- } else if (mainAxisCoord > limitMax) {
4090
- mainAxisCoord = limitMax;
4091
- }
4092
- }
4093
- if (checkCrossAxis) {
4094
- var _middlewareData$offse, _middlewareData$offse2;
4095
- const len = mainAxis === "y" ? "width" : "height";
4096
- const isOriginSide = ["top", "left"].includes(getSide(placement));
4097
- const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
4098
- const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
4099
- if (crossAxisCoord < limitMin) {
4100
- crossAxisCoord = limitMin;
4101
- } else if (crossAxisCoord > limitMax) {
4102
- crossAxisCoord = limitMax;
4103
- }
4104
- }
4105
- return {
4106
- [mainAxis]: mainAxisCoord,
4107
- [crossAxis]: crossAxisCoord
4108
- };
4109
- }
4110
- };
4111
- };
4112
- var size = function(options) {
4113
- if (options === void 0) {
4114
- options = {};
4115
- }
4116
- return {
4117
- name: "size",
4118
- options,
4119
- async fn(state) {
4120
- const {
4121
- placement,
4122
- rects,
4123
- platform: platform2,
4124
- elements
4125
- } = state;
4126
- const {
4127
- apply = () => {
4128
- },
4129
- ...detectOverflowOptions
4130
- } = evaluate(options, state);
4131
- const overflow = await detectOverflow(state, detectOverflowOptions);
4132
- const side = getSide(placement);
4133
- const alignment = getAlignment(placement);
4134
- const isYAxis = getSideAxis(placement) === "y";
4135
- const {
4136
- width,
4137
- height
4138
- } = rects.floating;
4139
- let heightSide;
4140
- let widthSide;
4141
- if (side === "top" || side === "bottom") {
4142
- heightSide = side;
4143
- widthSide = alignment === (await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
4144
- } else {
4145
- widthSide = side;
4146
- heightSide = alignment === "end" ? "top" : "bottom";
4147
- }
4148
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
4149
- const maximumClippingWidth = width - overflow.left - overflow.right;
4150
- const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
4151
- const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
4152
- const noShift = !state.middlewareData.shift;
4153
- let availableHeight = overflowAvailableHeight;
4154
- let availableWidth = overflowAvailableWidth;
4155
- if (isYAxis) {
4156
- availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
4157
- } else {
4158
- availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
4159
- }
4160
- if (noShift && !alignment) {
4161
- const xMin = max(overflow.left, 0);
4162
- const xMax = max(overflow.right, 0);
4163
- const yMin = max(overflow.top, 0);
4164
- const yMax = max(overflow.bottom, 0);
4165
- if (isYAxis) {
4166
- availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
4167
- } else {
4168
- availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
4169
- }
4170
- }
4171
- await apply({
4172
- ...state,
4173
- availableWidth,
4174
- availableHeight
4175
- });
4176
- const nextDimensions = await platform2.getDimensions(elements.floating);
4177
- if (width !== nextDimensions.width || height !== nextDimensions.height) {
4178
- return {
4179
- reset: {
4180
- rects: true
4181
- }
4182
- };
4183
- }
4184
- return {};
4185
- }
4186
- };
4187
- };
4188
-
4189
- // node_modules/.pnpm/@floating-ui+utils@0.2.2/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
4190
- function getNodeName(node) {
4191
- if (isNode(node)) {
4192
- return (node.nodeName || "").toLowerCase();
4193
- }
4194
- return "#document";
4195
- }
4196
- function getWindow(node) {
4197
- var _node$ownerDocument;
4198
- return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
4199
- }
4200
- function getDocumentElement(node) {
4201
- var _ref;
4202
- return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
4203
- }
4204
- function isNode(value) {
4205
- return value instanceof Node || value instanceof getWindow(value).Node;
4206
- }
4207
- function isElement(value) {
4208
- return value instanceof Element || value instanceof getWindow(value).Element;
4209
- }
4210
- function isHTMLElement(value) {
4211
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
4212
- }
4213
- function isShadowRoot(value) {
4214
- if (typeof ShadowRoot === "undefined") {
4215
- return false;
4216
- }
4217
- return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
4218
- }
4219
- function isOverflowElement(element) {
4220
- const {
4221
- overflow,
4222
- overflowX,
4223
- overflowY,
4224
- display
4225
- } = getComputedStyle2(element);
4226
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
4227
- }
4228
- function isTableElement(element) {
4229
- return ["table", "td", "th"].includes(getNodeName(element));
4230
- }
4231
- function isContainingBlock(element) {
4232
- const webkit = isWebKit();
4233
- const css = getComputedStyle2(element);
4234
- return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
4235
- }
4236
- function getContainingBlock(element) {
4237
- let currentNode = getParentNode(element);
4238
- while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
4239
- if (isContainingBlock(currentNode)) {
4240
- return currentNode;
4241
- }
4242
- currentNode = getParentNode(currentNode);
4243
- }
4244
- return null;
4245
- }
4246
- function isWebKit() {
4247
- if (typeof CSS === "undefined" || !CSS.supports)
4248
- return false;
4249
- return CSS.supports("-webkit-backdrop-filter", "none");
4250
- }
4251
- function isLastTraversableNode(node) {
4252
- return ["html", "body", "#document"].includes(getNodeName(node));
4253
- }
4254
- function getComputedStyle2(element) {
4255
- return getWindow(element).getComputedStyle(element);
4256
- }
4257
- function getNodeScroll(element) {
4258
- if (isElement(element)) {
4259
- return {
4260
- scrollLeft: element.scrollLeft,
4261
- scrollTop: element.scrollTop
4262
- };
4263
- }
4264
- return {
4265
- scrollLeft: element.pageXOffset,
4266
- scrollTop: element.pageYOffset
4267
- };
4268
- }
4269
- function getParentNode(node) {
4270
- if (getNodeName(node) === "html") {
4271
- return node;
4272
- }
4273
- const result = (
4274
- // Step into the shadow DOM of the parent of a slotted node.
4275
- node.assignedSlot || // DOM Element detected.
4276
- node.parentNode || // ShadowRoot detected.
4277
- isShadowRoot(node) && node.host || // Fallback.
4278
- getDocumentElement(node)
4279
- );
4280
- return isShadowRoot(result) ? result.host : result;
4281
- }
4282
- function getNearestOverflowAncestor(node) {
4283
- const parentNode = getParentNode(node);
4284
- if (isLastTraversableNode(parentNode)) {
4285
- return node.ownerDocument ? node.ownerDocument.body : node.body;
4286
- }
4287
- if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
4288
- return parentNode;
4289
- }
4290
- return getNearestOverflowAncestor(parentNode);
4291
- }
4292
- function getOverflowAncestors(node, list, traverseIframes) {
4293
- var _node$ownerDocument2;
4294
- if (list === void 0) {
4295
- list = [];
4296
- }
4297
- if (traverseIframes === void 0) {
4298
- traverseIframes = true;
4299
- }
4300
- const scrollableAncestor = getNearestOverflowAncestor(node);
4301
- const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
4302
- const win = getWindow(scrollableAncestor);
4303
- if (isBody) {
4304
- return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
4305
- }
4306
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
4307
- }
4308
-
4309
- // node_modules/.pnpm/@floating-ui+dom@1.6.5/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
4310
- function getCssDimensions(element) {
4311
- const css = getComputedStyle2(element);
4312
- let width = parseFloat(css.width) || 0;
4313
- let height = parseFloat(css.height) || 0;
4314
- const hasOffset = isHTMLElement(element);
4315
- const offsetWidth = hasOffset ? element.offsetWidth : width;
4316
- const offsetHeight = hasOffset ? element.offsetHeight : height;
4317
- const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
4318
- if (shouldFallback) {
4319
- width = offsetWidth;
4320
- height = offsetHeight;
4321
- }
4322
- return {
4323
- width,
4324
- height,
4325
- $: shouldFallback
4326
- };
4327
- }
4328
- function unwrapElement(element) {
4329
- return !isElement(element) ? element.contextElement : element;
4330
- }
4331
- function getScale(element) {
4332
- const domElement = unwrapElement(element);
4333
- if (!isHTMLElement(domElement)) {
4334
- return createCoords(1);
4335
- }
4336
- const rect = domElement.getBoundingClientRect();
4337
- const {
4338
- width,
4339
- height,
4340
- $
4341
- } = getCssDimensions(domElement);
4342
- let x = ($ ? round(rect.width) : rect.width) / width;
4343
- let y = ($ ? round(rect.height) : rect.height) / height;
4344
- if (!x || !Number.isFinite(x)) {
4345
- x = 1;
4346
- }
4347
- if (!y || !Number.isFinite(y)) {
4348
- y = 1;
4349
- }
4350
- return {
4351
- x,
4352
- y
4353
- };
4354
- }
4355
- var noOffsets = /* @__PURE__ */ createCoords(0);
4356
- function getVisualOffsets(element) {
4357
- const win = getWindow(element);
4358
- if (!isWebKit() || !win.visualViewport) {
4359
- return noOffsets;
4360
- }
4361
- return {
4362
- x: win.visualViewport.offsetLeft,
4363
- y: win.visualViewport.offsetTop
4364
- };
4365
- }
4366
- function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
4367
- if (isFixed === void 0) {
4368
- isFixed = false;
4369
- }
4370
- if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
4371
- return false;
4372
- }
4373
- return isFixed;
4374
- }
4375
- function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
4376
- if (includeScale === void 0) {
4377
- includeScale = false;
4378
- }
4379
- if (isFixedStrategy === void 0) {
4380
- isFixedStrategy = false;
4381
- }
4382
- const clientRect = element.getBoundingClientRect();
4383
- const domElement = unwrapElement(element);
4384
- let scale = createCoords(1);
4385
- if (includeScale) {
4386
- if (offsetParent) {
4387
- if (isElement(offsetParent)) {
4388
- scale = getScale(offsetParent);
4389
- }
4390
- } else {
4391
- scale = getScale(element);
4392
- }
4393
- }
4394
- const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
4395
- let x = (clientRect.left + visualOffsets.x) / scale.x;
4396
- let y = (clientRect.top + visualOffsets.y) / scale.y;
4397
- let width = clientRect.width / scale.x;
4398
- let height = clientRect.height / scale.y;
4399
- if (domElement) {
4400
- const win = getWindow(domElement);
4401
- const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
4402
- let currentWin = win;
4403
- let currentIFrame = currentWin.frameElement;
4404
- while (currentIFrame && offsetParent && offsetWin !== currentWin) {
4405
- const iframeScale = getScale(currentIFrame);
4406
- const iframeRect = currentIFrame.getBoundingClientRect();
4407
- const css = getComputedStyle2(currentIFrame);
4408
- const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
4409
- const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
4410
- x *= iframeScale.x;
4411
- y *= iframeScale.y;
4412
- width *= iframeScale.x;
4413
- height *= iframeScale.y;
4414
- x += left;
4415
- y += top;
4416
- currentWin = getWindow(currentIFrame);
4417
- currentIFrame = currentWin.frameElement;
4418
- }
4419
- }
4420
- return rectToClientRect({
4421
- width,
4422
- height,
4423
- x,
4424
- y
4425
- });
4426
- }
4427
- var topLayerSelectors = [":popover-open", ":modal"];
4428
- function isTopLayer(element) {
4429
- return topLayerSelectors.some((selector) => {
4430
- try {
4431
- return element.matches(selector);
4432
- } catch (e) {
4433
- return false;
4434
- }
4435
- });
4436
- }
4437
- function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
4438
- let {
4439
- elements,
4440
- rect,
4441
- offsetParent,
4442
- strategy
4443
- } = _ref;
4444
- const isFixed = strategy === "fixed";
4445
- const documentElement = getDocumentElement(offsetParent);
4446
- const topLayer = elements ? isTopLayer(elements.floating) : false;
4447
- if (offsetParent === documentElement || topLayer && isFixed) {
4448
- return rect;
4449
- }
4450
- let scroll = {
4451
- scrollLeft: 0,
4452
- scrollTop: 0
4453
- };
4454
- let scale = createCoords(1);
4455
- const offsets = createCoords(0);
4456
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
4457
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
4458
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4459
- scroll = getNodeScroll(offsetParent);
4460
- }
4461
- if (isHTMLElement(offsetParent)) {
4462
- const offsetRect = getBoundingClientRect(offsetParent);
4463
- scale = getScale(offsetParent);
4464
- offsets.x = offsetRect.x + offsetParent.clientLeft;
4465
- offsets.y = offsetRect.y + offsetParent.clientTop;
4466
- }
4467
- }
4468
- return {
4469
- width: rect.width * scale.x,
4470
- height: rect.height * scale.y,
4471
- x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
4472
- y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
4473
- };
4474
- }
4475
- function getClientRects(element) {
4476
- return Array.from(element.getClientRects());
4477
- }
4478
- function getWindowScrollBarX(element) {
4479
- return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
4480
- }
4481
- function getDocumentRect(element) {
4482
- const html = getDocumentElement(element);
4483
- const scroll = getNodeScroll(element);
4484
- const body = element.ownerDocument.body;
4485
- const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
4486
- const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
4487
- let x = -scroll.scrollLeft + getWindowScrollBarX(element);
4488
- const y = -scroll.scrollTop;
4489
- if (getComputedStyle2(body).direction === "rtl") {
4490
- x += max(html.clientWidth, body.clientWidth) - width;
4491
- }
4492
- return {
4493
- width,
4494
- height,
4495
- x,
4496
- y
4497
- };
4498
- }
4499
- function getViewportRect(element, strategy) {
4500
- const win = getWindow(element);
4501
- const html = getDocumentElement(element);
4502
- const visualViewport = win.visualViewport;
4503
- let width = html.clientWidth;
4504
- let height = html.clientHeight;
4505
- let x = 0;
4506
- let y = 0;
4507
- if (visualViewport) {
4508
- width = visualViewport.width;
4509
- height = visualViewport.height;
4510
- const visualViewportBased = isWebKit();
4511
- if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
4512
- x = visualViewport.offsetLeft;
4513
- y = visualViewport.offsetTop;
4514
- }
4515
- }
4516
- return {
4517
- width,
4518
- height,
4519
- x,
4520
- y
4521
- };
4522
- }
4523
- function getInnerBoundingClientRect(element, strategy) {
4524
- const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
4525
- const top = clientRect.top + element.clientTop;
4526
- const left = clientRect.left + element.clientLeft;
4527
- const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
4528
- const width = element.clientWidth * scale.x;
4529
- const height = element.clientHeight * scale.y;
4530
- const x = left * scale.x;
4531
- const y = top * scale.y;
4532
- return {
4533
- width,
4534
- height,
4535
- x,
4536
- y
4537
- };
4538
- }
4539
- function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
4540
- let rect;
4541
- if (clippingAncestor === "viewport") {
4542
- rect = getViewportRect(element, strategy);
4543
- } else if (clippingAncestor === "document") {
4544
- rect = getDocumentRect(getDocumentElement(element));
4545
- } else if (isElement(clippingAncestor)) {
4546
- rect = getInnerBoundingClientRect(clippingAncestor, strategy);
4547
- } else {
4548
- const visualOffsets = getVisualOffsets(element);
4549
- rect = {
4550
- ...clippingAncestor,
4551
- x: clippingAncestor.x - visualOffsets.x,
4552
- y: clippingAncestor.y - visualOffsets.y
4553
- };
4554
- }
4555
- return rectToClientRect(rect);
4556
- }
4557
- function hasFixedPositionAncestor(element, stopNode) {
4558
- const parentNode = getParentNode(element);
4559
- if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
4560
- return false;
4561
- }
4562
- return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
4563
- }
4564
- function getClippingElementAncestors(element, cache) {
4565
- const cachedResult = cache.get(element);
4566
- if (cachedResult) {
4567
- return cachedResult;
4568
- }
4569
- let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
4570
- let currentContainingBlockComputedStyle = null;
4571
- const elementIsFixed = getComputedStyle2(element).position === "fixed";
4572
- let currentNode = elementIsFixed ? getParentNode(element) : element;
4573
- while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
4574
- const computedStyle = getComputedStyle2(currentNode);
4575
- const currentNodeIsContaining = isContainingBlock(currentNode);
4576
- if (!currentNodeIsContaining && computedStyle.position === "fixed") {
4577
- currentContainingBlockComputedStyle = null;
4578
- }
4579
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
4580
- if (shouldDropCurrentNode) {
4581
- result = result.filter((ancestor) => ancestor !== currentNode);
4582
- } else {
4583
- currentContainingBlockComputedStyle = computedStyle;
4584
- }
4585
- currentNode = getParentNode(currentNode);
4586
- }
4587
- cache.set(element, result);
4588
- return result;
4589
- }
4590
- function getClippingRect(_ref) {
4591
- let {
4592
- element,
4593
- boundary,
4594
- rootBoundary,
4595
- strategy
4596
- } = _ref;
4597
- const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
4598
- const clippingAncestors = [...elementClippingAncestors, rootBoundary];
4599
- const firstClippingAncestor = clippingAncestors[0];
4600
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
4601
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
4602
- accRect.top = max(rect.top, accRect.top);
4603
- accRect.right = min(rect.right, accRect.right);
4604
- accRect.bottom = min(rect.bottom, accRect.bottom);
4605
- accRect.left = max(rect.left, accRect.left);
4606
- return accRect;
4607
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
4608
- return {
4609
- width: clippingRect.right - clippingRect.left,
4610
- height: clippingRect.bottom - clippingRect.top,
4611
- x: clippingRect.left,
4612
- y: clippingRect.top
4613
- };
4614
- }
4615
- function getDimensions(element) {
4616
- const {
4617
- width,
4618
- height
4619
- } = getCssDimensions(element);
4620
- return {
4621
- width,
4622
- height
4623
- };
4624
- }
4625
- function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
4626
- const isOffsetParentAnElement = isHTMLElement(offsetParent);
4627
- const documentElement = getDocumentElement(offsetParent);
4628
- const isFixed = strategy === "fixed";
4629
- const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
4630
- let scroll = {
4631
- scrollLeft: 0,
4632
- scrollTop: 0
4633
- };
4634
- const offsets = createCoords(0);
4635
- if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
4636
- if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
4637
- scroll = getNodeScroll(offsetParent);
4638
- }
4639
- if (isOffsetParentAnElement) {
4640
- const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
4641
- offsets.x = offsetRect.x + offsetParent.clientLeft;
4642
- offsets.y = offsetRect.y + offsetParent.clientTop;
4643
- } else if (documentElement) {
4644
- offsets.x = getWindowScrollBarX(documentElement);
4645
- }
4646
- }
4647
- const x = rect.left + scroll.scrollLeft - offsets.x;
4648
- const y = rect.top + scroll.scrollTop - offsets.y;
4649
- return {
4650
- x,
4651
- y,
4652
- width: rect.width,
4653
- height: rect.height
4654
- };
4655
- }
4656
- function isStaticPositioned(element) {
4657
- return getComputedStyle2(element).position === "static";
4658
- }
4659
- function getTrueOffsetParent(element, polyfill) {
4660
- if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
4661
- return null;
4662
- }
4663
- if (polyfill) {
4664
- return polyfill(element);
4665
- }
4666
- return element.offsetParent;
4667
- }
4668
- function getOffsetParent(element, polyfill) {
4669
- const win = getWindow(element);
4670
- if (isTopLayer(element)) {
4671
- return win;
4672
- }
4673
- if (!isHTMLElement(element)) {
4674
- let svgOffsetParent = getParentNode(element);
4675
- while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
4676
- if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
4677
- return svgOffsetParent;
4678
- }
4679
- svgOffsetParent = getParentNode(svgOffsetParent);
4680
- }
4681
- return win;
4682
- }
4683
- let offsetParent = getTrueOffsetParent(element, polyfill);
4684
- while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
4685
- offsetParent = getTrueOffsetParent(offsetParent, polyfill);
4686
- }
4687
- if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
4688
- return win;
4689
- }
4690
- return offsetParent || getContainingBlock(element) || win;
4691
- }
4692
- var getElementRects = async function(data) {
4693
- const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
4694
- const getDimensionsFn = this.getDimensions;
4695
- const floatingDimensions = await getDimensionsFn(data.floating);
4696
- return {
4697
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
4698
- floating: {
4699
- x: 0,
4700
- y: 0,
4701
- width: floatingDimensions.width,
4702
- height: floatingDimensions.height
4703
- }
4704
- };
4705
- };
4706
- function isRTL(element) {
4707
- return getComputedStyle2(element).direction === "rtl";
4708
- }
4709
- var platform = {
4710
- convertOffsetParentRelativeRectToViewportRelativeRect,
4711
- getDocumentElement,
4712
- getClippingRect,
4713
- getOffsetParent,
4714
- getElementRects,
4715
- getClientRects,
4716
- getDimensions,
4717
- getScale,
4718
- isElement,
4719
- isRTL
4720
- };
4721
- function observeMove(element, onMove) {
4722
- let io = null;
4723
- let timeoutId;
4724
- const root = getDocumentElement(element);
4725
- function cleanup() {
4726
- var _io;
4727
- clearTimeout(timeoutId);
4728
- (_io = io) == null || _io.disconnect();
4729
- io = null;
4730
- }
4731
- function refresh(skip, threshold) {
4732
- if (skip === void 0) {
4733
- skip = false;
4734
- }
4735
- if (threshold === void 0) {
4736
- threshold = 1;
4737
- }
4738
- cleanup();
4739
- const {
4740
- left,
4741
- top,
4742
- width,
4743
- height
4744
- } = element.getBoundingClientRect();
4745
- if (!skip) {
4746
- onMove();
4747
- }
4748
- if (!width || !height) {
4749
- return;
4750
- }
4751
- const insetTop = floor(top);
4752
- const insetRight = floor(root.clientWidth - (left + width));
4753
- const insetBottom = floor(root.clientHeight - (top + height));
4754
- const insetLeft = floor(left);
4755
- const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
4756
- const options = {
4757
- rootMargin,
4758
- threshold: max(0, min(1, threshold)) || 1
4759
- };
4760
- let isFirstUpdate = true;
4761
- function handleObserve(entries) {
4762
- const ratio = entries[0].intersectionRatio;
4763
- if (ratio !== threshold) {
4764
- if (!isFirstUpdate) {
4765
- return refresh();
4766
- }
4767
- if (!ratio) {
4768
- timeoutId = setTimeout(() => {
4769
- refresh(false, 1e-7);
4770
- }, 1e3);
4771
- } else {
4772
- refresh(false, ratio);
4773
- }
4774
- }
4775
- isFirstUpdate = false;
4776
- }
4777
- try {
4778
- io = new IntersectionObserver(handleObserve, {
4779
- ...options,
4780
- // Handle <iframe>s
4781
- root: root.ownerDocument
4782
- });
4783
- } catch (e) {
4784
- io = new IntersectionObserver(handleObserve, options);
4785
- }
4786
- io.observe(element);
4787
- }
4788
- refresh(true);
4789
- return cleanup;
4790
- }
4791
- function autoUpdate(reference, floating, update, options) {
4792
- if (options === void 0) {
4793
- options = {};
4794
- }
4795
- const {
4796
- ancestorScroll = true,
4797
- ancestorResize = true,
4798
- elementResize = typeof ResizeObserver === "function",
4799
- layoutShift = typeof IntersectionObserver === "function",
4800
- animationFrame = false
4801
- } = options;
4802
- const referenceEl = unwrapElement(reference);
4803
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
4804
- ancestors.forEach((ancestor) => {
4805
- ancestorScroll && ancestor.addEventListener("scroll", update, {
4806
- passive: true
4807
- });
4808
- ancestorResize && ancestor.addEventListener("resize", update);
4809
- });
4810
- const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
4811
- let reobserveFrame = -1;
4812
- let resizeObserver = null;
4813
- if (elementResize) {
4814
- resizeObserver = new ResizeObserver((_ref) => {
4815
- let [firstEntry] = _ref;
4816
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
4817
- resizeObserver.unobserve(floating);
4818
- cancelAnimationFrame(reobserveFrame);
4819
- reobserveFrame = requestAnimationFrame(() => {
4820
- var _resizeObserver;
4821
- (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
4822
- });
4823
- }
4824
- update();
4825
- });
4826
- if (referenceEl && !animationFrame) {
4827
- resizeObserver.observe(referenceEl);
4828
- }
4829
- resizeObserver.observe(floating);
4830
- }
4831
- let frameId;
4832
- let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
4833
- if (animationFrame) {
4834
- frameLoop();
4835
- }
4836
- function frameLoop() {
4837
- const nextRefRect = getBoundingClientRect(reference);
4838
- if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
4839
- update();
4840
- }
4841
- prevRefRect = nextRefRect;
4842
- frameId = requestAnimationFrame(frameLoop);
4843
- }
4844
- update();
4845
- return () => {
4846
- var _resizeObserver2;
4847
- ancestors.forEach((ancestor) => {
4848
- ancestorScroll && ancestor.removeEventListener("scroll", update);
4849
- ancestorResize && ancestor.removeEventListener("resize", update);
4850
- });
4851
- cleanupIo == null || cleanupIo();
4852
- (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
4853
- resizeObserver = null;
4854
- if (animationFrame) {
4855
- cancelAnimationFrame(frameId);
4856
- }
4857
- };
4858
- }
4859
- var offset2 = offset;
4860
- var shift2 = shift;
4861
- var flip2 = flip;
4862
- var size2 = size;
4863
- var hide2 = hide;
4864
- var arrow2 = arrow;
4865
- var limitShift2 = limitShift;
4866
- var computePosition2 = (reference, floating, options) => {
4867
- const cache = /* @__PURE__ */ new Map();
4868
- const mergedOptions = {
4869
- platform,
4870
- ...options
4871
- };
4872
- const platformWithCache = {
4873
- ...mergedOptions.platform,
4874
- _c: cache
4875
- };
4876
- return computePosition(reference, floating, {
4877
- ...mergedOptions,
4878
- platform: platformWithCache
4879
- });
4880
- };
4881
-
4882
- // node_modules/.pnpm/@floating-ui+react-dom@2.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
4883
- var React4 = __toESM(require("react"), 1);
4884
- var import_react14 = require("react");
4885
- var ReactDOM = __toESM(require("react-dom"), 1);
4886
- var index = typeof document !== "undefined" ? import_react14.useLayoutEffect : import_react14.useEffect;
4887
- function deepEqual(a, b) {
4888
- if (a === b) {
4889
- return true;
4890
- }
4891
- if (typeof a !== typeof b) {
4892
- return false;
4893
- }
4894
- if (typeof a === "function" && a.toString() === b.toString()) {
4895
- return true;
4896
- }
4897
- let length;
4898
- let i;
4899
- let keys;
4900
- if (a && b && typeof a === "object") {
4901
- if (Array.isArray(a)) {
4902
- length = a.length;
4903
- if (length !== b.length)
4904
- return false;
4905
- for (i = length; i-- !== 0; ) {
4906
- if (!deepEqual(a[i], b[i])) {
4907
- return false;
4908
- }
4909
- }
4910
- return true;
4911
- }
4912
- keys = Object.keys(a);
4913
- length = keys.length;
4914
- if (length !== Object.keys(b).length) {
4915
- return false;
4916
- }
4917
- for (i = length; i-- !== 0; ) {
4918
- if (!{}.hasOwnProperty.call(b, keys[i])) {
4919
- return false;
4920
- }
4921
- }
4922
- for (i = length; i-- !== 0; ) {
4923
- const key = keys[i];
4924
- if (key === "_owner" && a.$$typeof) {
4925
- continue;
4926
- }
4927
- if (!deepEqual(a[key], b[key])) {
4928
- return false;
4929
- }
4930
- }
4931
- return true;
4932
- }
4933
- return a !== a && b !== b;
4934
- }
4935
- function getDPR(element) {
4936
- if (typeof window === "undefined") {
4937
- return 1;
4938
- }
4939
- const win = element.ownerDocument.defaultView || window;
4940
- return win.devicePixelRatio || 1;
4941
- }
4942
- function roundByDPR(element, value) {
4943
- const dpr = getDPR(element);
4944
- return Math.round(value * dpr) / dpr;
4945
- }
4946
- function useLatestRef(value) {
4947
- const ref = React4.useRef(value);
4948
- index(() => {
4949
- ref.current = value;
4950
- });
4951
- return ref;
4952
- }
4953
- function useFloating(options) {
4954
- if (options === void 0) {
4955
- options = {};
4956
- }
4957
- const {
4958
- placement = "bottom",
4959
- strategy = "absolute",
4960
- middleware = [],
4961
- platform: platform2,
4962
- elements: {
4963
- reference: externalReference,
4964
- floating: externalFloating
4965
- } = {},
4966
- transform = true,
4967
- whileElementsMounted,
4968
- open
4969
- } = options;
4970
- const [data, setData] = React4.useState({
4971
- x: 0,
4972
- y: 0,
4973
- strategy,
4974
- placement,
4975
- middlewareData: {},
4976
- isPositioned: false
4977
- });
4978
- const [latestMiddleware, setLatestMiddleware] = React4.useState(middleware);
4979
- if (!deepEqual(latestMiddleware, middleware)) {
4980
- setLatestMiddleware(middleware);
4981
- }
4982
- const [_reference, _setReference] = React4.useState(null);
4983
- const [_floating, _setFloating] = React4.useState(null);
4984
- const setReference = React4.useCallback((node) => {
4985
- if (node !== referenceRef.current) {
4986
- referenceRef.current = node;
4987
- _setReference(node);
4988
- }
4989
- }, []);
4990
- const setFloating = React4.useCallback((node) => {
4991
- if (node !== floatingRef.current) {
4992
- floatingRef.current = node;
4993
- _setFloating(node);
4994
- }
4995
- }, []);
4996
- const referenceEl = externalReference || _reference;
4997
- const floatingEl = externalFloating || _floating;
4998
- const referenceRef = React4.useRef(null);
4999
- const floatingRef = React4.useRef(null);
5000
- const dataRef = React4.useRef(data);
5001
- const hasWhileElementsMounted = whileElementsMounted != null;
5002
- const whileElementsMountedRef = useLatestRef(whileElementsMounted);
5003
- const platformRef = useLatestRef(platform2);
5004
- const update = React4.useCallback(() => {
5005
- if (!referenceRef.current || !floatingRef.current) {
5006
- return;
5007
- }
5008
- const config = {
5009
- placement,
5010
- strategy,
5011
- middleware: latestMiddleware
5012
- };
5013
- if (platformRef.current) {
5014
- config.platform = platformRef.current;
5015
- }
5016
- computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
5017
- const fullData = {
5018
- ...data2,
5019
- isPositioned: true
5020
- };
5021
- if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
5022
- dataRef.current = fullData;
5023
- ReactDOM.flushSync(() => {
5024
- setData(fullData);
5025
- });
5026
- }
5027
- });
5028
- }, [latestMiddleware, placement, strategy, platformRef]);
5029
- index(() => {
5030
- if (open === false && dataRef.current.isPositioned) {
5031
- dataRef.current.isPositioned = false;
5032
- setData((data2) => ({
5033
- ...data2,
5034
- isPositioned: false
5035
- }));
5036
- }
5037
- }, [open]);
5038
- const isMountedRef = React4.useRef(false);
5039
- index(() => {
5040
- isMountedRef.current = true;
5041
- return () => {
5042
- isMountedRef.current = false;
5043
- };
5044
- }, []);
5045
- index(() => {
5046
- if (referenceEl)
5047
- referenceRef.current = referenceEl;
5048
- if (floatingEl)
5049
- floatingRef.current = floatingEl;
5050
- if (referenceEl && floatingEl) {
5051
- if (whileElementsMountedRef.current) {
5052
- return whileElementsMountedRef.current(referenceEl, floatingEl, update);
5053
- }
5054
- update();
5055
- }
5056
- }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
5057
- const refs = React4.useMemo(() => ({
5058
- reference: referenceRef,
5059
- floating: floatingRef,
5060
- setReference,
5061
- setFloating
5062
- }), [setReference, setFloating]);
5063
- const elements = React4.useMemo(() => ({
5064
- reference: referenceEl,
5065
- floating: floatingEl
5066
- }), [referenceEl, floatingEl]);
5067
- const floatingStyles = React4.useMemo(() => {
5068
- const initialStyles = {
5069
- position: strategy,
5070
- left: 0,
5071
- top: 0
5072
- };
5073
- if (!elements.floating) {
5074
- return initialStyles;
5075
- }
5076
- const x = roundByDPR(elements.floating, data.x);
5077
- const y = roundByDPR(elements.floating, data.y);
5078
- if (transform) {
5079
- return {
5080
- ...initialStyles,
5081
- transform: "translate(" + x + "px, " + y + "px)",
5082
- ...getDPR(elements.floating) >= 1.5 && {
5083
- willChange: "transform"
5084
- }
5085
- };
5086
- }
5087
- return {
5088
- position: strategy,
5089
- left: x,
5090
- top: y
5091
- };
5092
- }, [strategy, transform, elements.floating, data.x, data.y]);
5093
- return React4.useMemo(() => ({
5094
- ...data,
5095
- update,
5096
- refs,
5097
- elements,
5098
- floatingStyles
5099
- }), [data, update, refs, elements, floatingStyles]);
5100
- }
5101
- var arrow$1 = (options) => {
5102
- function isRef(value) {
5103
- return {}.hasOwnProperty.call(value, "current");
5104
- }
5105
- return {
5106
- name: "arrow",
5107
- options,
5108
- fn(state) {
5109
- const {
5110
- element,
5111
- padding
5112
- } = typeof options === "function" ? options(state) : options;
5113
- if (element && isRef(element)) {
5114
- if (element.current != null) {
5115
- return arrow2({
5116
- element: element.current,
5117
- padding
5118
- }).fn(state);
5119
- }
5120
- return {};
5121
- }
5122
- if (element) {
5123
- return arrow2({
5124
- element,
5125
- padding
5126
- }).fn(state);
5127
- }
5128
- return {};
5129
- }
5130
- };
5131
- };
5132
- var offset3 = (options, deps) => ({
5133
- ...offset2(options),
5134
- options: [options, deps]
5135
- });
5136
- var shift3 = (options, deps) => ({
5137
- ...shift2(options),
5138
- options: [options, deps]
5139
- });
5140
- var limitShift3 = (options, deps) => ({
5141
- ...limitShift2(options),
5142
- options: [options, deps]
5143
- });
5144
- var flip3 = (options, deps) => ({
5145
- ...flip2(options),
5146
- options: [options, deps]
5147
- });
5148
- var size3 = (options, deps) => ({
5149
- ...size2(options),
5150
- options: [options, deps]
5151
- });
5152
- var hide3 = (options, deps) => ({
5153
- ...hide2(options),
5154
- options: [options, deps]
5155
- });
5156
- var arrow3 = (options, deps) => ({
5157
- ...arrow$1(options),
5158
- options: [options, deps]
5159
- });
5160
-
5161
- // node_modules/.pnpm/@radix-ui+react-arrow@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-arrow/dist/index.mjs
5162
- var import_react15 = require("react");
5163
- var $7e8f5cd07187803e$export$21b07c8f274aebd5 = /* @__PURE__ */ (0, import_react15.forwardRef)((props, forwardedRef) => {
5164
- const { children, width = 10, height = 5, ...arrowProps } = props;
5165
- return /* @__PURE__ */ (0, import_react15.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.svg, _extends({}, arrowProps, {
5166
- ref: forwardedRef,
5167
- width,
5168
- height,
5169
- viewBox: "0 0 30 10",
5170
- preserveAspectRatio: "none"
5171
- }), props.asChild ? children : /* @__PURE__ */ (0, import_react15.createElement)("polygon", {
5172
- points: "0,0 30,0 15,10"
5173
- }));
5174
- });
5175
- var $7e8f5cd07187803e$export$be92b6f5f03c0fe9 = $7e8f5cd07187803e$export$21b07c8f274aebd5;
5176
-
5177
- // node_modules/.pnpm/@radix-ui+react-use-size@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-size/dist/index.mjs
5178
- var import_react16 = require("react");
5179
- function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
5180
- const [size4, setSize] = (0, import_react16.useState)(void 0);
5181
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5182
- if (element) {
5183
- setSize({
5184
- width: element.offsetWidth,
5185
- height: element.offsetHeight
5186
- });
5187
- const resizeObserver = new ResizeObserver((entries) => {
5188
- if (!Array.isArray(entries))
5189
- return;
5190
- if (!entries.length)
5191
- return;
5192
- const entry = entries[0];
5193
- let width;
5194
- let height;
5195
- if ("borderBoxSize" in entry) {
5196
- const borderSizeEntry = entry["borderBoxSize"];
5197
- const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
5198
- width = borderSize["inlineSize"];
5199
- height = borderSize["blockSize"];
5200
- } else {
5201
- width = element.offsetWidth;
5202
- height = element.offsetHeight;
5203
- }
5204
- setSize({
5205
- width,
5206
- height
5207
- });
5208
- });
5209
- resizeObserver.observe(element, {
5210
- box: "border-box"
5211
- });
5212
- return () => resizeObserver.unobserve(element);
5213
- } else
5214
- setSize(void 0);
5215
- }, [
5216
- element
5217
- ]);
5218
- return size4;
5219
- }
5220
-
5221
- // node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-popper/dist/index.mjs
5222
- var $cf1ac5d9fe0e8206$var$POPPER_NAME = "Popper";
5223
- var [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
5224
- var [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
5225
- var $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props) => {
5226
- const { __scopePopper, children } = props;
5227
- const [anchor, setAnchor] = (0, import_react17.useState)(null);
5228
- return /* @__PURE__ */ (0, import_react17.createElement)($cf1ac5d9fe0e8206$var$PopperProvider, {
5229
- scope: __scopePopper,
5230
- anchor,
5231
- onAnchorChange: setAnchor
5232
- }, children);
5233
- };
5234
- var $cf1ac5d9fe0e8206$var$ANCHOR_NAME = "PopperAnchor";
5235
- var $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
5236
- const { __scopePopper, virtualRef, ...anchorProps } = props;
5237
- const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
5238
- const ref = (0, import_react17.useRef)(null);
5239
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
5240
- (0, import_react17.useEffect)(() => {
5241
- context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
5242
- });
5243
- return virtualRef ? null : /* @__PURE__ */ (0, import_react17.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
5244
- ref: composedRefs
5245
- }));
5246
- });
5247
- var $cf1ac5d9fe0e8206$var$CONTENT_NAME = "PopperContent";
5248
- var [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
5249
- var $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ (0, import_react17.forwardRef)((props, forwardedRef) => {
5250
- var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
5251
- const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
5252
- const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
5253
- const [content, setContent] = (0, import_react17.useState)(null);
5254
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
5255
- forwardedRef,
5256
- (node) => setContent(node)
5257
- );
5258
- const [arrow4, setArrow] = (0, import_react17.useState)(null);
5259
- const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow4);
5260
- const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
5261
- const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
5262
- const desiredPlacement = side + (align !== "center" ? "-" + align : "");
5263
- const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : {
5264
- top: 0,
5265
- right: 0,
5266
- bottom: 0,
5267
- left: 0,
5268
- ...collisionPaddingProp
5269
- };
5270
- const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
5271
- collisionBoundary
5272
- ];
5273
- const hasExplicitBoundaries = boundary.length > 0;
5274
- const detectOverflowOptions = {
5275
- padding: collisionPadding,
5276
- boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
5277
- // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5278
- altBoundary: hasExplicitBoundaries
5279
- };
5280
- const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
5281
- // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
5282
- strategy: "fixed",
5283
- placement: desiredPlacement,
5284
- whileElementsMounted: (...args) => {
5285
- const cleanup = autoUpdate(...args, {
5286
- animationFrame: updatePositionStrategy === "always"
5287
- });
5288
- return cleanup;
5289
- },
5290
- elements: {
5291
- reference: context.anchor
5292
- },
5293
- middleware: [
5294
- offset3({
5295
- mainAxis: sideOffset + arrowHeight,
5296
- alignmentAxis: alignOffset
5297
- }),
5298
- avoidCollisions && shift3({
5299
- mainAxis: true,
5300
- crossAxis: false,
5301
- limiter: sticky === "partial" ? limitShift3() : void 0,
5302
- ...detectOverflowOptions
5303
- }),
5304
- avoidCollisions && flip3({
5305
- ...detectOverflowOptions
5306
- }),
5307
- size3({
5308
- ...detectOverflowOptions,
5309
- apply: ({ elements, rects, availableWidth, availableHeight }) => {
5310
- const { width: anchorWidth, height: anchorHeight } = rects.reference;
5311
- const contentStyle = elements.floating.style;
5312
- contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
5313
- contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
5314
- contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
5315
- contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
5316
- }
5317
- }),
5318
- arrow4 && arrow3({
5319
- element: arrow4,
5320
- padding: arrowPadding
5321
- }),
5322
- $cf1ac5d9fe0e8206$var$transformOrigin({
5323
- arrowWidth,
5324
- arrowHeight
5325
- }),
5326
- hideWhenDetached && hide3({
5327
- strategy: "referenceHidden",
5328
- ...detectOverflowOptions
5329
- })
5330
- ]
5331
- });
5332
- const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
5333
- const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
5334
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5335
- if (isPositioned)
5336
- handlePlaced === null || handlePlaced === void 0 || handlePlaced();
5337
- }, [
5338
- isPositioned,
5339
- handlePlaced
5340
- ]);
5341
- const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
5342
- const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
5343
- const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
5344
- const [contentZIndex, setContentZIndex] = (0, import_react17.useState)();
5345
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5346
- if (content)
5347
- setContentZIndex(window.getComputedStyle(content).zIndex);
5348
- }, [
5349
- content
5350
- ]);
5351
- return /* @__PURE__ */ (0, import_react17.createElement)("div", {
5352
- ref: refs.setFloating,
5353
- "data-radix-popper-content-wrapper": "",
5354
- style: {
5355
- ...floatingStyles,
5356
- transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
5357
- // keep off the page when measuring
5358
- minWidth: "max-content",
5359
- zIndex: contentZIndex,
5360
- ["--radix-popper-transform-origin"]: [
5361
- (_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
5362
- (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
5363
- ].join(" ")
5364
- },
5365
- dir: props.dir
5366
- }, /* @__PURE__ */ (0, import_react17.createElement)($cf1ac5d9fe0e8206$var$PopperContentProvider, {
5367
- scope: __scopePopper,
5368
- placedSide,
5369
- onArrowChange: setArrow,
5370
- arrowX,
5371
- arrowY,
5372
- shouldHideArrow: cannotCenterArrow
5373
- }, /* @__PURE__ */ (0, import_react17.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
5374
- "data-side": placedSide,
5375
- "data-align": placedAlign
5376
- }, contentProps, {
5377
- ref: composedRefs,
5378
- style: {
5379
- ...contentProps.style,
5380
- // if the PopperContent hasn't been placed yet (not all measurements done)
5381
- // we prevent animations so that users's animation don't kick in too early referring wrong sides
5382
- animation: !isPositioned ? "none" : void 0,
5383
- // hide the content if using the hide middleware and should be hidden
5384
- opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : void 0
5385
- }
5386
- }))));
5387
- });
5388
- var $cf1ac5d9fe0e8206$var$ARROW_NAME = "PopperArrow";
5389
- var $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE = {
5390
- top: "bottom",
5391
- right: "left",
5392
- bottom: "top",
5393
- left: "right"
5394
- };
5395
- var $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0 = /* @__PURE__ */ (0, import_react17.forwardRef)(function $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd02(props, forwardedRef) {
5396
- const { __scopePopper, ...arrowProps } = props;
5397
- const contentContext = $cf1ac5d9fe0e8206$var$useContentContext($cf1ac5d9fe0e8206$var$ARROW_NAME, __scopePopper);
5398
- const baseSide = $cf1ac5d9fe0e8206$var$OPPOSITE_SIDE[contentContext.placedSide];
5399
- return (
5400
- // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
5401
- // doesn't report size as we'd expect on SVG elements.
5402
- // it reports their bounding box which is effectively the largest path inside the SVG.
5403
- /* @__PURE__ */ (0, import_react17.createElement)("span", {
5404
- ref: contentContext.onArrowChange,
5405
- style: {
5406
- position: "absolute",
5407
- left: contentContext.arrowX,
5408
- top: contentContext.arrowY,
5409
- [baseSide]: 0,
5410
- transformOrigin: {
5411
- top: "",
5412
- right: "0 0",
5413
- bottom: "center 0",
5414
- left: "100% 0"
5415
- }[contentContext.placedSide],
5416
- transform: {
5417
- top: "translateY(100%)",
5418
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
5419
- bottom: `rotate(180deg)`,
5420
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
5421
- }[contentContext.placedSide],
5422
- visibility: contentContext.shouldHideArrow ? "hidden" : void 0
5423
- }
5424
- }, /* @__PURE__ */ (0, import_react17.createElement)($7e8f5cd07187803e$export$be92b6f5f03c0fe9, _extends({}, arrowProps, {
5425
- ref: forwardedRef,
5426
- style: {
5427
- ...arrowProps.style,
5428
- // ensures the element can be measured correctly (mostly for if SVG)
5429
- display: "block"
5430
- }
5431
- })))
5432
- );
5433
- });
5434
- function $cf1ac5d9fe0e8206$var$isNotNull(value) {
5435
- return value !== null;
5436
- }
5437
- var $cf1ac5d9fe0e8206$var$transformOrigin = (options) => ({
5438
- name: "transformOrigin",
5439
- options,
5440
- fn(data) {
5441
- var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
5442
- const { placement, rects, middlewareData } = data;
5443
- const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
5444
- const isArrowHidden = cannotCenterArrow;
5445
- const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
5446
- const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
5447
- const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
5448
- const noArrowAlign = {
5449
- start: "0%",
5450
- center: "50%",
5451
- end: "100%"
5452
- }[placedAlign];
5453
- const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
5454
- const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
5455
- let x = "";
5456
- let y = "";
5457
- if (placedSide === "bottom") {
5458
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
5459
- y = `${-arrowHeight}px`;
5460
- } else if (placedSide === "top") {
5461
- x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
5462
- y = `${rects.floating.height + arrowHeight}px`;
5463
- } else if (placedSide === "right") {
5464
- x = `${-arrowHeight}px`;
5465
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
5466
- } else if (placedSide === "left") {
5467
- x = `${rects.floating.width + arrowHeight}px`;
5468
- y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
5469
- }
5470
- return {
5471
- data: {
5472
- x,
5473
- y
5474
- }
5475
- };
5476
- }
5477
- });
5478
- function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
5479
- const [side, align = "center"] = placement.split("-");
5480
- return [
5481
- side,
5482
- align
5483
- ];
5484
- }
5485
- var $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
5486
- var $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
5487
- var $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
5488
- var $cf1ac5d9fe0e8206$export$21b07c8f274aebd5 = $cf1ac5d9fe0e8206$export$79d62cd4e10a3fd0;
5489
-
5490
- // node_modules/.pnpm/@radix-ui+react-presence@1.0.1_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-presence/dist/index.mjs
5491
- var import_react18 = require("react");
5492
- var import_react_dom3 = require("react-dom");
5493
- function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
5494
- return (0, import_react18.useReducer)((state, event) => {
5495
- const nextState = machine[state][event];
5496
- return nextState !== null && nextState !== void 0 ? nextState : state;
5497
- }, initialState);
5498
- }
5499
- var $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
5500
- const { present, children } = props;
5501
- const presence = $921a889cee6df7e8$var$usePresence(present);
5502
- const child = typeof children === "function" ? children({
5503
- present: presence.isPresent
5504
- }) : import_react18.Children.only(children);
5505
- const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
5506
- const forceMount = typeof children === "function";
5507
- return forceMount || presence.isPresent ? /* @__PURE__ */ (0, import_react18.cloneElement)(child, {
5508
- ref
5509
- }) : null;
5510
- };
5511
- $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
5512
- function $921a889cee6df7e8$var$usePresence(present) {
5513
- const [node1, setNode] = (0, import_react18.useState)();
5514
- const stylesRef = (0, import_react18.useRef)({});
5515
- const prevPresentRef = (0, import_react18.useRef)(present);
5516
- const prevAnimationNameRef = (0, import_react18.useRef)("none");
5517
- const initialState = present ? "mounted" : "unmounted";
5518
- const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
5519
- mounted: {
5520
- UNMOUNT: "unmounted",
5521
- ANIMATION_OUT: "unmountSuspended"
5522
- },
5523
- unmountSuspended: {
5524
- MOUNT: "mounted",
5525
- ANIMATION_END: "unmounted"
5526
- },
5527
- unmounted: {
5528
- MOUNT: "mounted"
5529
- }
5530
- });
5531
- (0, import_react18.useEffect)(() => {
5532
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5533
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
5534
- }, [
5535
- state
5536
- ]);
5537
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5538
- const styles = stylesRef.current;
5539
- const wasPresent = prevPresentRef.current;
5540
- const hasPresentChanged = wasPresent !== present;
5541
- if (hasPresentChanged) {
5542
- const prevAnimationName = prevAnimationNameRef.current;
5543
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
5544
- if (present)
5545
- send("MOUNT");
5546
- else if (currentAnimationName === "none" || (styles === null || styles === void 0 ? void 0 : styles.display) === "none")
5547
- send("UNMOUNT");
5548
- else {
5549
- const isAnimating = prevAnimationName !== currentAnimationName;
5550
- if (wasPresent && isAnimating)
5551
- send("ANIMATION_OUT");
5552
- else
5553
- send("UNMOUNT");
5554
- }
5555
- prevPresentRef.current = present;
5556
- }
5557
- }, [
5558
- present,
5559
- send
5560
- ]);
5561
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
5562
- if (node1) {
5563
- const handleAnimationEnd = (event) => {
5564
- const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5565
- const isCurrentAnimation = currentAnimationName.includes(event.animationName);
5566
- if (event.target === node1 && isCurrentAnimation)
5567
- (0, import_react_dom3.flushSync)(
5568
- () => send("ANIMATION_END")
5569
- );
5570
- };
5571
- const handleAnimationStart = (event) => {
5572
- if (event.target === node1)
5573
- prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
5574
- };
5575
- node1.addEventListener("animationstart", handleAnimationStart);
5576
- node1.addEventListener("animationcancel", handleAnimationEnd);
5577
- node1.addEventListener("animationend", handleAnimationEnd);
5578
- return () => {
5579
- node1.removeEventListener("animationstart", handleAnimationStart);
5580
- node1.removeEventListener("animationcancel", handleAnimationEnd);
5581
- node1.removeEventListener("animationend", handleAnimationEnd);
5582
- };
5583
- } else
5584
- send("ANIMATION_END");
5585
- }, [
5586
- node1,
5587
- send
5588
- ]);
5589
- return {
5590
- isPresent: [
5591
- "mounted",
5592
- "unmountSuspended"
5593
- ].includes(state),
5594
- ref: (0, import_react18.useCallback)((node) => {
5595
- if (node)
5596
- stylesRef.current = getComputedStyle(node);
5597
- setNode(node);
5598
- }, [])
5599
- };
5600
- }
5601
- function $921a889cee6df7e8$var$getAnimationName(styles) {
5602
- return (styles === null || styles === void 0 ? void 0 : styles.animationName) || "none";
5603
- }
5604
-
5605
- // node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.3.3_react@18.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
5606
- var import_react19 = require("react");
5607
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
5608
- } }) {
5609
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
5610
- defaultProp,
5611
- onChange
5612
- });
5613
- const isControlled = prop !== void 0;
5614
- const value1 = isControlled ? prop : uncontrolledProp;
5615
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
5616
- const setValue = (0, import_react19.useCallback)((nextValue) => {
5617
- if (isControlled) {
5618
- const setter = nextValue;
5619
- const value = typeof nextValue === "function" ? setter(prop) : nextValue;
5620
- if (value !== prop)
5621
- handleChange(value);
5622
- } else
5623
- setUncontrolledProp(nextValue);
5624
- }, [
5625
- isControlled,
5626
- prop,
5627
- setUncontrolledProp,
5628
- handleChange
5629
- ]);
5630
- return [
5631
- value1,
5632
- setValue
5633
- ];
5634
- }
5635
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
5636
- const uncontrolledState = (0, import_react19.useState)(defaultProp);
5637
- const [value] = uncontrolledState;
5638
- const prevValueRef = (0, import_react19.useRef)(value);
5639
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
5640
- (0, import_react19.useEffect)(() => {
5641
- if (prevValueRef.current !== value) {
5642
- handleChange(value);
5643
- prevValueRef.current = value;
5644
- }
5645
- }, [
5646
- value,
5647
- prevValueRef,
5648
- handleChange
5649
- ]);
5650
- return uncontrolledState;
5651
- }
5652
-
5653
- // node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
5654
- var import_react20 = require("react");
5655
- var $ea1ef594cf570d83$export$439d29a4e110a164 = /* @__PURE__ */ (0, import_react20.forwardRef)((props, forwardedRef) => {
5656
- return /* @__PURE__ */ (0, import_react20.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
5657
- ref: forwardedRef,
5658
- style: {
5659
- // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
5660
- position: "absolute",
5661
- border: 0,
5662
- width: 1,
5663
- height: 1,
5664
- padding: 0,
5665
- margin: -1,
5666
- overflow: "hidden",
5667
- clip: "rect(0, 0, 0, 0)",
5668
- whiteSpace: "nowrap",
5669
- wordWrap: "normal",
5670
- ...props.style
5671
- }
5672
- }));
5673
- });
5674
- var $ea1ef594cf570d83$export$be92b6f5f03c0fe9 = $ea1ef594cf570d83$export$439d29a4e110a164;
5675
-
5676
- // node_modules/.pnpm/@radix-ui+react-tooltip@1.0.7_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@radix-ui/react-tooltip/dist/index.mjs
5677
- var [$a093c7e1ec25a057$var$createTooltipContext, $a093c7e1ec25a057$export$1c540a2224f0d865] = $c512c27ab02ef895$export$50c7b4e9d9f19c1("Tooltip", [
5678
- $cf1ac5d9fe0e8206$export$722aac194ae923
5679
- ]);
5680
- var $a093c7e1ec25a057$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
5681
- var $a093c7e1ec25a057$var$PROVIDER_NAME = "TooltipProvider";
5682
- var $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION = 700;
5683
- var $a093c7e1ec25a057$var$TOOLTIP_OPEN = "tooltip.open";
5684
- var [$a093c7e1ec25a057$var$TooltipProviderContextProvider, $a093c7e1ec25a057$var$useTooltipProviderContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PROVIDER_NAME);
5685
- var $a093c7e1ec25a057$export$f78649fb9ca566b8 = (props) => {
5686
- const { __scopeTooltip, delayDuration = $a093c7e1ec25a057$var$DEFAULT_DELAY_DURATION, skipDelayDuration = 300, disableHoverableContent = false, children } = props;
5687
- const [isOpenDelayed, setIsOpenDelayed] = (0, import_react21.useState)(true);
5688
- const isPointerInTransitRef = (0, import_react21.useRef)(false);
5689
- const skipDelayTimerRef = (0, import_react21.useRef)(0);
5690
- (0, import_react21.useEffect)(() => {
5691
- const skipDelayTimer = skipDelayTimerRef.current;
5692
- return () => window.clearTimeout(skipDelayTimer);
5693
- }, []);
5694
- return /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipProviderContextProvider, {
5695
- scope: __scopeTooltip,
5696
- isOpenDelayed,
5697
- delayDuration,
5698
- onOpen: (0, import_react21.useCallback)(() => {
5699
- window.clearTimeout(skipDelayTimerRef.current);
5700
- setIsOpenDelayed(false);
5701
- }, []),
5702
- onClose: (0, import_react21.useCallback)(() => {
5703
- window.clearTimeout(skipDelayTimerRef.current);
5704
- skipDelayTimerRef.current = window.setTimeout(
5705
- () => setIsOpenDelayed(true),
5706
- skipDelayDuration
5707
- );
5708
- }, [
5709
- skipDelayDuration
5710
- ]),
5711
- isPointerInTransitRef,
5712
- onPointerInTransitChange: (0, import_react21.useCallback)((inTransit) => {
5713
- isPointerInTransitRef.current = inTransit;
5714
- }, []),
5715
- disableHoverableContent
5716
- }, children);
5717
- };
5718
- var $a093c7e1ec25a057$var$TOOLTIP_NAME = "Tooltip";
5719
- var [$a093c7e1ec25a057$var$TooltipContextProvider, $a093c7e1ec25a057$var$useTooltipContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME);
5720
- var $a093c7e1ec25a057$export$28c660c63b792dea = (props) => {
5721
- const { __scopeTooltip, children, open: openProp, defaultOpen = false, onOpenChange, disableHoverableContent: disableHoverableContentProp, delayDuration: delayDurationProp } = props;
5722
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TOOLTIP_NAME, props.__scopeTooltip);
5723
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5724
- const [trigger, setTrigger] = (0, import_react21.useState)(null);
5725
- const contentId = $1746a345f3d73bb7$export$f680877a34711e37();
5726
- const openTimerRef = (0, import_react21.useRef)(0);
5727
- const disableHoverableContent = disableHoverableContentProp !== null && disableHoverableContentProp !== void 0 ? disableHoverableContentProp : providerContext.disableHoverableContent;
5728
- const delayDuration = delayDurationProp !== null && delayDurationProp !== void 0 ? delayDurationProp : providerContext.delayDuration;
5729
- const wasOpenDelayedRef = (0, import_react21.useRef)(false);
5730
- const [open1 = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
5731
- prop: openProp,
5732
- defaultProp: defaultOpen,
5733
- onChange: (open) => {
5734
- if (open) {
5735
- providerContext.onOpen();
5736
- document.dispatchEvent(new CustomEvent($a093c7e1ec25a057$var$TOOLTIP_OPEN));
5737
- } else
5738
- providerContext.onClose();
5739
- onOpenChange === null || onOpenChange === void 0 || onOpenChange(open);
5740
- }
5741
- });
5742
- const stateAttribute = (0, import_react21.useMemo)(() => {
5743
- return open1 ? wasOpenDelayedRef.current ? "delayed-open" : "instant-open" : "closed";
5744
- }, [
5745
- open1
5746
- ]);
5747
- const handleOpen = (0, import_react21.useCallback)(() => {
5748
- window.clearTimeout(openTimerRef.current);
5749
- wasOpenDelayedRef.current = false;
5750
- setOpen(true);
5751
- }, [
5752
- setOpen
5753
- ]);
5754
- const handleClose = (0, import_react21.useCallback)(() => {
5755
- window.clearTimeout(openTimerRef.current);
5756
- setOpen(false);
5757
- }, [
5758
- setOpen
5759
- ]);
5760
- const handleDelayedOpen = (0, import_react21.useCallback)(() => {
5761
- window.clearTimeout(openTimerRef.current);
5762
- openTimerRef.current = window.setTimeout(() => {
5763
- wasOpenDelayedRef.current = true;
5764
- setOpen(true);
5765
- }, delayDuration);
5766
- }, [
5767
- delayDuration,
5768
- setOpen
5769
- ]);
5770
- (0, import_react21.useEffect)(() => {
5771
- return () => window.clearTimeout(openTimerRef.current);
5772
- }, []);
5773
- return /* @__PURE__ */ (0, import_react21.createElement)($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipContextProvider, {
5774
- scope: __scopeTooltip,
5775
- contentId,
5776
- open: open1,
5777
- stateAttribute,
5778
- trigger,
5779
- onTriggerChange: setTrigger,
5780
- onTriggerEnter: (0, import_react21.useCallback)(() => {
5781
- if (providerContext.isOpenDelayed)
5782
- handleDelayedOpen();
5783
- else
5784
- handleOpen();
5785
- }, [
5786
- providerContext.isOpenDelayed,
5787
- handleDelayedOpen,
5788
- handleOpen
5789
- ]),
5790
- onTriggerLeave: (0, import_react21.useCallback)(() => {
5791
- if (disableHoverableContent)
5792
- handleClose();
5793
- else
5794
- window.clearTimeout(openTimerRef.current);
5795
- }, [
5796
- handleClose,
5797
- disableHoverableContent
5798
- ]),
5799
- onOpen: handleOpen,
5800
- onClose: handleClose,
5801
- disableHoverableContent
5802
- }, children));
5803
- };
5804
- var $a093c7e1ec25a057$var$TRIGGER_NAME = "TooltipTrigger";
5805
- var $a093c7e1ec25a057$export$8c610744efcf8a1d = /* @__PURE__ */ (0, import_react21.forwardRef)((props, forwardedRef) => {
5806
- const { __scopeTooltip, ...triggerProps } = props;
5807
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
5808
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$TRIGGER_NAME, __scopeTooltip);
5809
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5810
- const ref = (0, import_react21.useRef)(null);
5811
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref, context.onTriggerChange);
5812
- const isPointerDownRef = (0, import_react21.useRef)(false);
5813
- const hasPointerMoveOpenedRef = (0, import_react21.useRef)(false);
5814
- const handlePointerUp = (0, import_react21.useCallback)(
5815
- () => isPointerDownRef.current = false,
5816
- []
5817
- );
5818
- (0, import_react21.useEffect)(() => {
5819
- return () => document.removeEventListener("pointerup", handlePointerUp);
5820
- }, [
5821
- handlePointerUp
5822
- ]);
5823
- return /* @__PURE__ */ (0, import_react21.createElement)($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
5824
- asChild: true
5825
- }, popperScope), /* @__PURE__ */ (0, import_react21.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
5826
- // We purposefully avoid adding `type=button` here because tooltip triggers are also
5827
- // commonly anchors and the anchor `type` attribute signifies MIME type.
5828
- "aria-describedby": context.open ? context.contentId : void 0,
5829
- "data-state": context.stateAttribute
5830
- }, triggerProps, {
5831
- ref: composedRefs,
5832
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerMove, (event) => {
5833
- if (event.pointerType === "touch")
5834
- return;
5835
- if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {
5836
- context.onTriggerEnter();
5837
- hasPointerMoveOpenedRef.current = true;
5838
- }
5839
- }),
5840
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerLeave, () => {
5841
- context.onTriggerLeave();
5842
- hasPointerMoveOpenedRef.current = false;
5843
- }),
5844
- onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDown, () => {
5845
- isPointerDownRef.current = true;
5846
- document.addEventListener("pointerup", handlePointerUp, {
5847
- once: true
5848
- });
5849
- }),
5850
- onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, () => {
5851
- if (!isPointerDownRef.current)
5852
- context.onOpen();
5853
- }),
5854
- onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, context.onClose),
5855
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onClose)
5856
- })));
5857
- });
5858
- var $a093c7e1ec25a057$var$PORTAL_NAME = "TooltipPortal";
5859
- var [$a093c7e1ec25a057$var$PortalProvider, $a093c7e1ec25a057$var$usePortalContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$PORTAL_NAME, {
5860
- forceMount: void 0
5861
- });
5862
- var $a093c7e1ec25a057$var$CONTENT_NAME = "TooltipContent";
5863
- var $a093c7e1ec25a057$export$e9003e2be37ec060 = /* @__PURE__ */ (0, import_react21.forwardRef)((props, forwardedRef) => {
5864
- const portalContext = $a093c7e1ec25a057$var$usePortalContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5865
- const { forceMount = portalContext.forceMount, side = "top", ...contentProps } = props;
5866
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5867
- return /* @__PURE__ */ (0, import_react21.createElement)($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
5868
- present: forceMount || context.open
5869
- }, context.disableHoverableContent ? /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipContentImpl, _extends({
5870
- side
5871
- }, contentProps, {
5872
- ref: forwardedRef
5873
- })) : /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipContentHoverable, _extends({
5874
- side
5875
- }, contentProps, {
5876
- ref: forwardedRef
5877
- })));
5878
- });
5879
- var $a093c7e1ec25a057$var$TooltipContentHoverable = /* @__PURE__ */ (0, import_react21.forwardRef)((props, forwardedRef) => {
5880
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5881
- const providerContext = $a093c7e1ec25a057$var$useTooltipProviderContext($a093c7e1ec25a057$var$CONTENT_NAME, props.__scopeTooltip);
5882
- const ref = (0, import_react21.useRef)(null);
5883
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
5884
- const [pointerGraceArea, setPointerGraceArea] = (0, import_react21.useState)(null);
5885
- const { trigger, onClose } = context;
5886
- const content = ref.current;
5887
- const { onPointerInTransitChange } = providerContext;
5888
- const handleRemoveGraceArea = (0, import_react21.useCallback)(() => {
5889
- setPointerGraceArea(null);
5890
- onPointerInTransitChange(false);
5891
- }, [
5892
- onPointerInTransitChange
5893
- ]);
5894
- const handleCreateGraceArea = (0, import_react21.useCallback)((event, hoverTarget) => {
5895
- const currentTarget = event.currentTarget;
5896
- const exitPoint = {
5897
- x: event.clientX,
5898
- y: event.clientY
5899
- };
5900
- const exitSide = $a093c7e1ec25a057$var$getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());
5901
- const paddedExitPoints = $a093c7e1ec25a057$var$getPaddedExitPoints(exitPoint, exitSide);
5902
- const hoverTargetPoints = $a093c7e1ec25a057$var$getPointsFromRect(hoverTarget.getBoundingClientRect());
5903
- const graceArea = $a093c7e1ec25a057$var$getHull([
5904
- ...paddedExitPoints,
5905
- ...hoverTargetPoints
5906
- ]);
5907
- setPointerGraceArea(graceArea);
5908
- onPointerInTransitChange(true);
5909
- }, [
5910
- onPointerInTransitChange
5911
- ]);
5912
- (0, import_react21.useEffect)(() => {
5913
- return () => handleRemoveGraceArea();
5914
- }, [
5915
- handleRemoveGraceArea
5916
- ]);
5917
- (0, import_react21.useEffect)(() => {
5918
- if (trigger && content) {
5919
- const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);
5920
- const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);
5921
- trigger.addEventListener("pointerleave", handleTriggerLeave);
5922
- content.addEventListener("pointerleave", handleContentLeave);
5923
- return () => {
5924
- trigger.removeEventListener("pointerleave", handleTriggerLeave);
5925
- content.removeEventListener("pointerleave", handleContentLeave);
5926
- };
5927
- }
5928
- }, [
5929
- trigger,
5930
- content,
5931
- handleCreateGraceArea,
5932
- handleRemoveGraceArea
5933
- ]);
5934
- (0, import_react21.useEffect)(() => {
5935
- if (pointerGraceArea) {
5936
- const handleTrackPointerGrace = (event) => {
5937
- const target = event.target;
5938
- const pointerPosition = {
5939
- x: event.clientX,
5940
- y: event.clientY
5941
- };
5942
- const hasEnteredTarget = (trigger === null || trigger === void 0 ? void 0 : trigger.contains(target)) || (content === null || content === void 0 ? void 0 : content.contains(target));
5943
- const isPointerOutsideGraceArea = !$a093c7e1ec25a057$var$isPointInPolygon(pointerPosition, pointerGraceArea);
5944
- if (hasEnteredTarget)
5945
- handleRemoveGraceArea();
5946
- else if (isPointerOutsideGraceArea) {
5947
- handleRemoveGraceArea();
5948
- onClose();
5949
- }
5950
- };
5951
- document.addEventListener("pointermove", handleTrackPointerGrace);
5952
- return () => document.removeEventListener("pointermove", handleTrackPointerGrace);
5953
- }
5954
- }, [
5955
- trigger,
5956
- content,
5957
- pointerGraceArea,
5958
- onClose,
5959
- handleRemoveGraceArea
5960
- ]);
5961
- return /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$TooltipContentImpl, _extends({}, props, {
5962
- ref: composedRefs
5963
- }));
5964
- });
5965
- var [$a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, $a093c7e1ec25a057$var$useVisuallyHiddenContentContext] = $a093c7e1ec25a057$var$createTooltipContext($a093c7e1ec25a057$var$TOOLTIP_NAME, {
5966
- isInside: false
5967
- });
5968
- var $a093c7e1ec25a057$var$TooltipContentImpl = /* @__PURE__ */ (0, import_react21.forwardRef)((props, forwardedRef) => {
5969
- const { __scopeTooltip, children, "aria-label": ariaLabel, onEscapeKeyDown, onPointerDownOutside, ...contentProps } = props;
5970
- const context = $a093c7e1ec25a057$var$useTooltipContext($a093c7e1ec25a057$var$CONTENT_NAME, __scopeTooltip);
5971
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
5972
- const { onClose } = context;
5973
- (0, import_react21.useEffect)(() => {
5974
- document.addEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose);
5975
- return () => document.removeEventListener($a093c7e1ec25a057$var$TOOLTIP_OPEN, onClose);
5976
- }, [
5977
- onClose
5978
- ]);
5979
- (0, import_react21.useEffect)(() => {
5980
- if (context.trigger) {
5981
- const handleScroll = (event) => {
5982
- const target = event.target;
5983
- if (target !== null && target !== void 0 && target.contains(context.trigger))
5984
- onClose();
5985
- };
5986
- window.addEventListener("scroll", handleScroll, {
5987
- capture: true
5988
- });
5989
- return () => window.removeEventListener("scroll", handleScroll, {
5990
- capture: true
5991
- });
5992
- }
5993
- }, [
5994
- context.trigger,
5995
- onClose
5996
- ]);
5997
- return /* @__PURE__ */ (0, import_react21.createElement)($5cb92bef7577960e$export$177fb62ff3ec1f22, {
5998
- asChild: true,
5999
- disableOutsidePointerEvents: false,
6000
- onEscapeKeyDown,
6001
- onPointerDownOutside,
6002
- onFocusOutside: (event) => event.preventDefault(),
6003
- onDismiss: onClose
6004
- }, /* @__PURE__ */ (0, import_react21.createElement)($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({
6005
- "data-state": context.stateAttribute
6006
- }, popperScope, contentProps, {
6007
- ref: forwardedRef,
6008
- style: {
6009
- ...contentProps.style,
6010
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
6011
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
6012
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
6013
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
6014
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
6015
- }
6016
- }), /* @__PURE__ */ (0, import_react21.createElement)($5e63c961fc1ce211$export$d9f1ccf0bdb05d45, null, children), /* @__PURE__ */ (0, import_react21.createElement)($a093c7e1ec25a057$var$VisuallyHiddenContentContextProvider, {
6017
- scope: __scopeTooltip,
6018
- isInside: true
6019
- }, /* @__PURE__ */ (0, import_react21.createElement)($ea1ef594cf570d83$export$be92b6f5f03c0fe9, {
6020
- id: context.contentId,
6021
- role: "tooltip"
6022
- }, ariaLabel || children))));
6023
- });
6024
- var $a093c7e1ec25a057$var$ARROW_NAME = "TooltipArrow";
6025
- var $a093c7e1ec25a057$export$c27ee0ad710f7559 = /* @__PURE__ */ (0, import_react21.forwardRef)((props, forwardedRef) => {
6026
- const { __scopeTooltip, ...arrowProps } = props;
6027
- const popperScope = $a093c7e1ec25a057$var$usePopperScope(__scopeTooltip);
6028
- const visuallyHiddenContentContext = $a093c7e1ec25a057$var$useVisuallyHiddenContentContext($a093c7e1ec25a057$var$ARROW_NAME, __scopeTooltip);
6029
- return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ (0, import_react21.createElement)($cf1ac5d9fe0e8206$export$21b07c8f274aebd5, _extends({}, popperScope, arrowProps, {
6030
- ref: forwardedRef
6031
- }));
6032
- });
6033
- function $a093c7e1ec25a057$var$getExitSideFromRect(point, rect) {
6034
- const top = Math.abs(rect.top - point.y);
6035
- const bottom = Math.abs(rect.bottom - point.y);
6036
- const right = Math.abs(rect.right - point.x);
6037
- const left = Math.abs(rect.left - point.x);
6038
- switch (Math.min(top, bottom, right, left)) {
6039
- case left:
6040
- return "left";
6041
- case right:
6042
- return "right";
6043
- case top:
6044
- return "top";
6045
- case bottom:
6046
- return "bottom";
6047
- default:
6048
- throw new Error("unreachable");
6049
- }
6050
- }
6051
- function $a093c7e1ec25a057$var$getPaddedExitPoints(exitPoint, exitSide, padding = 5) {
6052
- const paddedExitPoints = [];
6053
- switch (exitSide) {
6054
- case "top":
6055
- paddedExitPoints.push({
6056
- x: exitPoint.x - padding,
6057
- y: exitPoint.y + padding
6058
- }, {
6059
- x: exitPoint.x + padding,
6060
- y: exitPoint.y + padding
6061
- });
6062
- break;
6063
- case "bottom":
6064
- paddedExitPoints.push({
6065
- x: exitPoint.x - padding,
6066
- y: exitPoint.y - padding
6067
- }, {
6068
- x: exitPoint.x + padding,
6069
- y: exitPoint.y - padding
6070
- });
6071
- break;
6072
- case "left":
6073
- paddedExitPoints.push({
6074
- x: exitPoint.x + padding,
6075
- y: exitPoint.y - padding
6076
- }, {
6077
- x: exitPoint.x + padding,
6078
- y: exitPoint.y + padding
6079
- });
6080
- break;
6081
- case "right":
6082
- paddedExitPoints.push({
6083
- x: exitPoint.x - padding,
6084
- y: exitPoint.y - padding
6085
- }, {
6086
- x: exitPoint.x - padding,
6087
- y: exitPoint.y + padding
6088
- });
6089
- break;
6090
- }
6091
- return paddedExitPoints;
6092
- }
6093
- function $a093c7e1ec25a057$var$getPointsFromRect(rect) {
6094
- const { top, right, bottom, left } = rect;
6095
- return [
6096
- {
6097
- x: left,
6098
- y: top
6099
- },
6100
- {
6101
- x: right,
6102
- y: top
6103
- },
6104
- {
6105
- x: right,
6106
- y: bottom
6107
- },
6108
- {
6109
- x: left,
6110
- y: bottom
6111
- }
6112
- ];
6113
- }
6114
- function $a093c7e1ec25a057$var$isPointInPolygon(point, polygon) {
6115
- const { x, y } = point;
6116
- let inside = false;
6117
- for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
6118
- const xi = polygon[i].x;
6119
- const yi = polygon[i].y;
6120
- const xj = polygon[j].x;
6121
- const yj = polygon[j].y;
6122
- const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
6123
- if (intersect)
6124
- inside = !inside;
6125
- }
6126
- return inside;
6127
- }
6128
- function $a093c7e1ec25a057$var$getHull(points) {
6129
- const newPoints = points.slice();
6130
- newPoints.sort((a, b) => {
6131
- if (a.x < b.x)
6132
- return -1;
6133
- else if (a.x > b.x)
6134
- return 1;
6135
- else if (a.y < b.y)
6136
- return -1;
6137
- else if (a.y > b.y)
6138
- return 1;
6139
- else
6140
- return 0;
6141
- });
6142
- return $a093c7e1ec25a057$var$getHullPresorted(newPoints);
6143
- }
6144
- function $a093c7e1ec25a057$var$getHullPresorted(points) {
6145
- if (points.length <= 1)
6146
- return points.slice();
6147
- const upperHull = [];
6148
- for (let i = 0; i < points.length; i++) {
6149
- const p = points[i];
6150
- while (upperHull.length >= 2) {
6151
- const q = upperHull[upperHull.length - 1];
6152
- const r2 = upperHull[upperHull.length - 2];
6153
- if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x))
6154
- upperHull.pop();
6155
- else
6156
- break;
6157
- }
6158
- upperHull.push(p);
6159
- }
6160
- upperHull.pop();
6161
- const lowerHull = [];
6162
- for (let i1 = points.length - 1; i1 >= 0; i1--) {
6163
- const p = points[i1];
6164
- while (lowerHull.length >= 2) {
6165
- const q = lowerHull[lowerHull.length - 1];
6166
- const r2 = lowerHull[lowerHull.length - 2];
6167
- if ((q.x - r2.x) * (p.y - r2.y) >= (q.y - r2.y) * (p.x - r2.x))
6168
- lowerHull.pop();
6169
- else
6170
- break;
6171
- }
6172
- lowerHull.push(p);
6173
- }
6174
- lowerHull.pop();
6175
- if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y)
6176
- return upperHull;
6177
- else
6178
- return upperHull.concat(lowerHull);
6179
- }
6180
- var $a093c7e1ec25a057$export$be92b6f5f03c0fe9 = $a093c7e1ec25a057$export$28c660c63b792dea;
6181
-
6182
- // src/components/tooltip.tsx
6183
- var TooltipProvider = $a093c7e1ec25a057$export$f78649fb9ca566b8;
2831
+ var import_react6 = __toESM(require("react"));
2832
+ var import_react_tooltip = require("@radix-ui/react-tooltip");
2833
+ var TooltipProvider = import_react_tooltip.TooltipProvider;
6184
2834
  var Tooltip = ({
6185
2835
  children,
6186
2836
  content,
@@ -6188,16 +2838,16 @@ var Tooltip = ({
6188
2838
  defaultOpen,
6189
2839
  onOpenChange,
6190
2840
  className,
6191
- size: size4 = "medium",
2841
+ size = "medium",
6192
2842
  ...props
6193
2843
  }) => {
6194
- return /* @__PURE__ */ import_react22.default.createElement($a093c7e1ec25a057$export$be92b6f5f03c0fe9, { open, defaultOpen, onOpenChange }, /* @__PURE__ */ import_react22.default.createElement($a093c7e1ec25a057$export$8c610744efcf8a1d, { asChild: true }, children), /* @__PURE__ */ import_react22.default.createElement(
6195
- $a093c7e1ec25a057$export$e9003e2be37ec060,
2844
+ return /* @__PURE__ */ import_react6.default.createElement(import_react_tooltip.Root, { open, defaultOpen, onOpenChange }, /* @__PURE__ */ import_react6.default.createElement(import_react_tooltip.TooltipTrigger, { asChild: true }, children), /* @__PURE__ */ import_react6.default.createElement(
2845
+ import_react_tooltip.TooltipContent,
6196
2846
  {
6197
2847
  className: cn(
6198
2848
  "max-w-[20.5rem] rounded bg-neutral-900 text-sm leading-[120%] text-neutral-50",
6199
- size4 === "small" && "p-2",
6200
- size4 === "medium" && "p-4",
2849
+ size === "small" && "p-2",
2850
+ size === "medium" && "p-4",
6201
2851
  className
6202
2852
  ),
6203
2853
  side: "bottom",
@@ -6205,7 +2855,7 @@ var Tooltip = ({
6205
2855
  ...props
6206
2856
  },
6207
2857
  content,
6208
- /* @__PURE__ */ import_react22.default.createElement($a093c7e1ec25a057$export$c27ee0ad710f7559, { width: 16, height: 8, className: "fill-neutral-900" })
2858
+ /* @__PURE__ */ import_react6.default.createElement(import_react_tooltip.TooltipArrow, { width: 16, height: 8, className: "fill-neutral-900" })
6209
2859
  ));
6210
2860
  };
6211
2861
  // Annotate the CommonJS export names for ESM import in node: