@sparrowengg/integrations-templates-frontend 7.0.0-bulkify.7 → 7.0.0-bulkify.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/integration-template/components/dashboard-constants.js +1 -0
  2. package/dist/cjs/integration-template/components/dashboard-constants.js.map +1 -1
  3. package/dist/cjs/integration-template/components/dashboard.js +17 -1
  4. package/dist/cjs/integration-template/components/dashboard.js.map +1 -1
  5. package/dist/cjs/node_modules/@internationalized/date/dist/private/CalendarDate.js +32 -8
  6. package/dist/cjs/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -1
  7. package/dist/cjs/node_modules/@radix-ui/react-compose-refs/dist/index.js +1 -1
  8. package/dist/cjs/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  9. package/dist/cjs/node_modules/@radix-ui/react-context/dist/index.js +2 -1
  10. package/dist/cjs/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  11. package/dist/cjs/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +5 -2
  12. package/dist/cjs/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  13. package/dist/cjs/node_modules/@radix-ui/react-focus-guards/dist/index.js +15 -5
  14. package/dist/cjs/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  15. package/dist/cjs/node_modules/@radix-ui/react-id/dist/index.js +1 -1
  16. package/dist/cjs/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  17. package/dist/cjs/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
  18. package/dist/cjs/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
  19. package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js +58 -15
  20. package/dist/cjs/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  21. package/dist/cjs/node_modules/@radix-ui/react-portal/dist/index.js +2 -1
  22. package/dist/cjs/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  23. package/dist/cjs/node_modules/@radix-ui/react-presence/dist/index.js +38 -5
  24. package/dist/cjs/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  25. package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js +71 -37
  26. package/dist/cjs/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  27. package/dist/cjs/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +2 -2
  28. package/dist/cjs/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  29. package/dist/cjs/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  30. package/dist/cjs/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +1 -1
  31. package/dist/cjs/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  32. package/dist/cjs/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
  33. package/dist/cjs/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  34. package/dist/cjs/node_modules/@radix-ui/react-use-size/dist/index.js +1 -1
  35. package/dist/cjs/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  36. package/dist/cjs/node_modules/dayjs/dayjs.min.js +1 -1
  37. package/dist/cjs/node_modules/dayjs/dayjs.min.js.map +1 -1
  38. package/dist/cjs/triggers/components/EventSetup.js +1 -2
  39. package/dist/cjs/triggers/components/EventSetup.js.map +1 -1
  40. package/dist/es/integration-template/components/dashboard-constants.js +1 -0
  41. package/dist/es/integration-template/components/dashboard-constants.js.map +1 -1
  42. package/dist/es/integration-template/components/dashboard.js +17 -1
  43. package/dist/es/integration-template/components/dashboard.js.map +1 -1
  44. package/dist/es/node_modules/@internationalized/date/dist/private/CalendarDate.js +32 -8
  45. package/dist/es/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -1
  46. package/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js +1 -1
  47. package/dist/es/node_modules/@radix-ui/react-compose-refs/dist/index.js.map +1 -1
  48. package/dist/es/node_modules/@radix-ui/react-context/dist/index.js +2 -1
  49. package/dist/es/node_modules/@radix-ui/react-context/dist/index.js.map +1 -1
  50. package/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +5 -2
  51. package/dist/es/node_modules/@radix-ui/react-dismissable-layer/dist/index.js.map +1 -1
  52. package/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js +15 -5
  53. package/dist/es/node_modules/@radix-ui/react-focus-guards/dist/index.js.map +1 -1
  54. package/dist/es/node_modules/@radix-ui/react-id/dist/index.js +1 -1
  55. package/dist/es/node_modules/@radix-ui/react-id/dist/index.js.map +1 -1
  56. package/dist/es/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
  57. package/dist/es/node_modules/@radix-ui/react-popover/dist/index.js.map +1 -1
  58. package/dist/es/node_modules/@radix-ui/react-popper/dist/index.js +53 -10
  59. package/dist/es/node_modules/@radix-ui/react-popper/dist/index.js.map +1 -1
  60. package/dist/es/node_modules/@radix-ui/react-portal/dist/index.js +2 -2
  61. package/dist/es/node_modules/@radix-ui/react-portal/dist/index.js.map +1 -1
  62. package/dist/es/node_modules/@radix-ui/react-presence/dist/index.js +35 -2
  63. package/dist/es/node_modules/@radix-ui/react-presence/dist/index.js.map +1 -1
  64. package/dist/es/node_modules/@radix-ui/react-slot/dist/index.js +72 -38
  65. package/dist/es/node_modules/@radix-ui/react-slot/dist/index.js.map +1 -1
  66. package/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +2 -2
  67. package/dist/es/node_modules/@radix-ui/react-use-callback-ref/dist/index.js.map +1 -1
  68. package/dist/es/node_modules/@radix-ui/react-use-controllable-state/dist/index.js.map +1 -1
  69. package/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +1 -1
  70. package/dist/es/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js.map +1 -1
  71. package/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
  72. package/dist/es/node_modules/@radix-ui/react-use-layout-effect/dist/index.js.map +1 -1
  73. package/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js +1 -1
  74. package/dist/es/node_modules/@radix-ui/react-use-size/dist/index.js.map +1 -1
  75. package/dist/es/node_modules/dayjs/dayjs.min.js +1 -1
  76. package/dist/es/node_modules/dayjs/dayjs.min.js.map +1 -1
  77. package/dist/es/triggers/components/EventSetup.js +1 -2
  78. package/dist/es/triggers/components/EventSetup.js.map +1 -1
  79. package/dist/index.d.ts +3 -4
  80. package/package.json +1 -1
@@ -16,7 +16,18 @@ var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
16
16
  var Popper = (props) => {
17
17
  const { __scopePopper, children } = props;
18
18
  const [anchor, setAnchor] = React.useState(null);
19
- return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
19
+ const [placementState, setPlacementState] = React.useState(void 0);
20
+ return /* @__PURE__ */ jsx(
21
+ PopperProvider,
22
+ {
23
+ scope: __scopePopper,
24
+ anchor,
25
+ onAnchorChange: setAnchor,
26
+ placementState,
27
+ setPlacementState,
28
+ children
29
+ }
30
+ );
20
31
  };
21
32
  Popper.displayName = POPPER_NAME;
22
33
  var ANCHOR_NAME = "PopperAnchor";
@@ -25,16 +36,40 @@ var PopperAnchor = React.forwardRef(
25
36
  const { __scopePopper, virtualRef, ...anchorProps } = props;
26
37
  const context = usePopperContext(ANCHOR_NAME, __scopePopper);
27
38
  const ref = React.useRef(null);
28
- const composedRefs = useComposedRefs(forwardedRef, ref);
39
+ const onAnchorChange = context.onAnchorChange;
40
+ const callbackRef = React.useCallback(
41
+ (node) => {
42
+ ref.current = node;
43
+ if (node) {
44
+ onAnchorChange(node);
45
+ }
46
+ },
47
+ [onAnchorChange]
48
+ );
49
+ const composedRefs = useComposedRefs(forwardedRef, callbackRef);
29
50
  const anchorRef = React.useRef(null);
30
51
  React.useEffect(() => {
52
+ if (!virtualRef) {
53
+ return;
54
+ }
31
55
  const previousAnchor = anchorRef.current;
32
- anchorRef.current = virtualRef?.current || ref.current;
56
+ anchorRef.current = virtualRef.current;
33
57
  if (previousAnchor !== anchorRef.current) {
34
- context.onAnchorChange(anchorRef.current);
58
+ onAnchorChange(anchorRef.current);
35
59
  }
36
60
  });
37
- return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
61
+ const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);
62
+ const placedSide = sideAndAlign?.[0];
63
+ const placedAlign = sideAndAlign?.[1];
64
+ return virtualRef ? null : /* @__PURE__ */ jsx(
65
+ Primitive.div,
66
+ {
67
+ "data-radix-popper-side": placedSide,
68
+ "data-radix-popper-align": placedAlign,
69
+ ...anchorProps,
70
+ ref: composedRefs
71
+ }
72
+ );
38
73
  }
39
74
  );
40
75
  PopperAnchor.displayName = ANCHOR_NAME;
@@ -50,7 +85,7 @@ var PopperContent = React.forwardRef(
50
85
  alignOffset = 0,
51
86
  arrowPadding = 0,
52
87
  avoidCollisions = true,
53
- collisionBoundary = [],
88
+ collisionBoundary,
54
89
  collisionPadding: collisionPaddingProp = 0,
55
90
  sticky = "partial",
56
91
  hideWhenDetached = false,
@@ -67,11 +102,11 @@ var PopperContent = React.forwardRef(
67
102
  const arrowHeight = arrowSize?.height ?? 0;
68
103
  const desiredPlacement = side + (align !== "center" ? "-" + align : "");
69
104
  const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
70
- const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
71
- const hasExplicitBoundaries = boundary.length > 0;
105
+ const boundary = collisionBoundary ? Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary] : void 0;
106
+ const hasExplicitBoundaries = boundary !== void 0 && boundary.length > 0;
72
107
  const detectOverflowOptions = {
73
108
  padding: collisionPadding,
74
- boundary: boundary.filter(isNotNull),
109
+ boundary: boundary?.filter(isNotNull),
75
110
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
76
111
  altBoundary: hasExplicitBoundaries
77
112
  };
@@ -113,6 +148,13 @@ var PopperContent = React.forwardRef(
113
148
  hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
114
149
  ]
115
150
  });
151
+ const setPlacementState = context.setPlacementState;
152
+ useLayoutEffect2(() => {
153
+ setPlacementState(placement);
154
+ return () => {
155
+ setPlacementState(void 0);
156
+ };
157
+ }, [placement, setPlacementState]);
116
158
  const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
117
159
  const handlePlaced = useCallbackRef(onPlaced);
118
160
  useLayoutEffect2(() => {
@@ -138,7 +180,7 @@ var PopperContent = React.forwardRef(
138
180
  // keep off the page when measuring
139
181
  minWidth: "max-content",
140
182
  zIndex: contentZIndex,
141
- ["--radix-popper-transform-origin"]: [
183
+ "--radix-popper-transform-origin": [
142
184
  middlewareData.transformOrigin?.x,
143
185
  middlewareData.transformOrigin?.y
144
186
  ].join(" "),
@@ -156,6 +198,7 @@ var PopperContent = React.forwardRef(
156
198
  {
157
199
  scope: __scopePopper,
158
200
  placedSide,
201
+ placedAlign,
159
202
  onArrowChange: setArrow,
160
203
  arrowX,
161
204
  arrowY,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef?.current || ref.current;\n if (previousAnchor !== anchorRef.current) {\n context.onAnchorChange(anchorRef.current);\n }\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["arrow","floatingUIarrow","useLayoutEffect","ArrowPrimitive.Root"],"mappings":";;;;;;;;;;;;AAyBA,IAAI,WAAW,GAAG,QAAQ;AACvB,IAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,GAAG,kBAAkB,CAAC,WAAW;AAC7E,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,mBAAmB,CAAC,WAAW,CAAC;AACtE,IAAC,MAAM,GAAG,CAAC,KAAK,KAAK;AACxB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK;AAC3C,EAAE,MAAM,CAAC,MAAM,EAAE,SAA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C,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC;AACpD,IAAI,CAAC,MAAM,IAAI,UAAU,KAAK,OAAO,EAAE;AACvC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AAC7B,MAAM,CAAC,GAAG,aAAa,GAAG,YAAY,GAAG,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC;AAC5D,IAAI,CAAC,MAAM,IAAI,UAAU,KAAK,MAAM,EAAE;AACtC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,GAAG,WAAW,CAAC,EAAE,CAAC;AACnD,MAAM,CAAC,GAAG,aAAa,GAAG,YAAY,GAAG,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC;AAC5D,IAAI;AACJ,IAAI,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7B,EAAE;AACF,CAAC,CAAC;AACF,SAAS,4BAA4B,CAAC,SAAS,EAAE;AACjD,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC;AACvD,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;AACtB;AACG,IAAC,KAAK,GAAG;AACT,IAAC,MAAM,GAAG;AACV,IAAC,OAAO,GAAG;AACX,IAAC,KAAK,GAAG;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n const [placementState, setPlacementState] = React.useState(void 0);\n return /* @__PURE__ */ jsx(\n PopperProvider,\n {\n scope: __scopePopper,\n anchor,\n onAnchorChange: setAnchor,\n placementState,\n setPlacementState,\n children\n }\n );\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const onAnchorChange = context.onAnchorChange;\n const callbackRef = React.useCallback(\n (node) => {\n ref.current = node;\n if (node) {\n onAnchorChange(node);\n }\n },\n [onAnchorChange]\n );\n const composedRefs = useComposedRefs(forwardedRef, callbackRef);\n const anchorRef = React.useRef(null);\n React.useEffect(() => {\n if (!virtualRef) {\n return;\n }\n const previousAnchor = anchorRef.current;\n anchorRef.current = virtualRef.current;\n if (previousAnchor !== anchorRef.current) {\n onAnchorChange(anchorRef.current);\n }\n });\n const sideAndAlign = context.placementState && getSideAndAlignFromPlacement(context.placementState);\n const placedSide = sideAndAlign?.[0];\n const placedAlign = sideAndAlign?.[1];\n return virtualRef ? null : /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-popper-side\": placedSide,\n \"data-radix-popper-align\": placedAlign,\n ...anchorProps,\n ref: composedRefs\n }\n );\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary,\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = collisionBoundary ? Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary] : void 0;\n const hasExplicitBoundaries = boundary !== void 0 && boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary?.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const setPlacementState = context.setPlacementState;\n useLayoutEffect(() => {\n setPlacementState(placement);\n return () => {\n setPlacementState(void 0);\n };\n }, [placement, setPlacementState]);\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n \"--radix-popper-transform-origin\": [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n placedAlign,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["arrow","floatingUIarrow","useLayoutEffect","ArrowPrimitive.Root"],"mappings":";;;;;;;;;;;;AAyBA,IAAI,WAAW,GAAG,QAAQ;AACvB,IAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,GAAG,kBAAkB,CAAC,WAAW;AAC7E,IAAI,CAAC,cAAc,EAAE,gBAAgB,CAAC,GAAG,mBAAmB,CAAC,WAAW,CAAC;AACtE,IAAC,MAAM,GAAG,CAAC,KAAK,KAAK;AACxB,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,KAAK;AAC3C,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;AAClD,EAAE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;AACpE,EAAE,uBAAuB,GAAG;AAC5B,IAAI,cAAc;AAClB,IAAI;AACJ,MAAM,KAAK,EAAE,aAAa;AAC1B,MAAM,MAAM;AACZ,MAAM,cAAc,EAAE,SAAS;AAC/B,MAAM,cAAc;AACpB,MAAM,iBAAiB;AACvB,MAAM;AACN;AACA,GAAG;AACH;AACA,MAAM,CAAC,WAAW,GAAG,WAAW;AAChC,IAAI,WAAW,GAAG,cAAc;AAC7B,IAAC,YAAY,GAAG,KAAK,CAAC,UAAU;AACnC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AAC3B,IAAI,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK;AAC/D,IAAI,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,EAAE,aAAa,CA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,CAAC;AACtB;AACG,IAAC,KAAK,GAAG;AACT,IAAC,MAAM,GAAG;AACV,IAAC,OAAO,GAAG;AACX,IAAC,KAAK,GAAG;;;;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import ReactDOM__default from 'react-dom';
2
+ import * as ReactDOM from 'react-dom';
3
3
  import { Primitive } from '../../react-primitive/dist/index.js';
4
4
  import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -10,7 +10,7 @@ var Portal = React.forwardRef((props, forwardedRef) => {
10
10
  const [mounted, setMounted] = React.useState(false);
11
11
  useLayoutEffect2(() => setMounted(true), []);
12
12
  const container = containerProp || mounted && globalThis?.document?.body;
13
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
13
+ return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
14
14
  });
15
15
  Portal.displayName = PORTAL_NAME;
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect","ReactDOM"],"mappings":";;;;;;AAQA,IAAI,WAAW,GAAG,QAAQ;AACvB,IAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK;AACvD,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK;AAC5D,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACrD,EAAEA,gBAAe,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC7C,EAAE,MAAM,SAAS,GAAG,aAAa,IAAI,OAAO,IAAI,UAAU,EAAE,QAAQ,EAAE,IAAI;AAC1E,EAAE,OAAO,SAAS,GAAGC,iBAAQ,CAAC,YAAY,iBAAiB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI;AACvI,CAAC;AACD,MAAM,CAAC,WAAW,GAAG,WAAW;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/portal.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;;;AAQA,IAAI,WAAW,GAAG,QAAQ;AACvB,IAAC,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK;AACvD,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,GAAG,KAAK;AAC5D,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACrD,EAAEA,gBAAe,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;AAC7C,EAAE,MAAM,SAAS,GAAG,aAAa,IAAI,OAAO,IAAI,UAAU,EAAE,QAAQ,EAAE,IAAI;AAC1E,EAAE,OAAO,SAAS,GAAG,QAAQ,CAAC,YAAY,iBAAiB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,GAAG,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI;AACvI,CAAC;AACD,MAAM,CAAC,WAAW,GAAG,WAAW;;;;","x_google_ignoreList":[0]}
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
3
2
  import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
4
3
 
5
4
  function useStateMachine(initialState, machine) {
@@ -14,7 +13,7 @@ var Presence = (props) => {
14
13
  const { present, children } = props;
15
14
  const presence = usePresence(present);
16
15
  const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
17
- const ref = useComposedRefs(presence.ref, getElementRef(child));
16
+ const ref = useStableComposedRefs(presence.ref, getElementRef(child));
18
17
  const forceMount = typeof children === "function";
19
18
  return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
20
19
  };
@@ -110,6 +109,40 @@ function usePresence(present) {
110
109
  }, [])
111
110
  };
112
111
  }
112
+ function setRef(ref, value) {
113
+ if (typeof ref === "function") {
114
+ return ref(value);
115
+ } else if (ref !== null && ref !== void 0) {
116
+ ref.current = value;
117
+ }
118
+ }
119
+ function useStableComposedRefs(...refs) {
120
+ const refsRef = React.useRef(refs);
121
+ refsRef.current = refs;
122
+ return React.useCallback((node) => {
123
+ const currentRefs = refsRef.current;
124
+ let hasCleanup = false;
125
+ const cleanups = currentRefs.map((ref) => {
126
+ const cleanup = setRef(ref, node);
127
+ if (!hasCleanup && typeof cleanup === "function") {
128
+ hasCleanup = true;
129
+ }
130
+ return cleanup;
131
+ });
132
+ if (hasCleanup) {
133
+ return () => {
134
+ for (let i = 0; i < cleanups.length; i++) {
135
+ const cleanup = cleanups[i];
136
+ if (typeof cleanup === "function") {
137
+ cleanup();
138
+ } else {
139
+ setRef(currentRefs[i], null);
140
+ }
141
+ }
142
+ };
143
+ }
144
+ }, []);
145
+ }
113
146
  function getAnimationName(styles) {
114
147
  return styles?.animationName || "none";
115
148
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["React2","useLayoutEffect"],"mappings":";;;;AASA,SAAS,eAAe,CAAC,YAAY,EAAE,OAAO,EAAE;AAChD,EAAE,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK;AAC5C,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;AAC3C,IAAI,OAAO,SAAS,IAAI,KAAK;AAC7B,EAAE,CAAC,EAAE,YAAY,CAAC;AAClB;;AAEA;AACG,IAAC,QAAQ,GAAG,CAAC,K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AAE;AACf,IAAI,OAAO,OAAO,CAAC,GAAG;AACtB,EAAE;AACF,EAAE,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG;AAC/D,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useStableComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction useStableComposedRefs(...refs) {\n const refsRef = React2.useRef(refs);\n refsRef.current = refs;\n return React2.useCallback((node) => {\n const currentRefs = refsRef.current;\n let hasCleanup = false;\n const cleanups = currentRefs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup === \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup === \"function\") {\n cleanup();\n } else {\n setRef(currentRefs[i], null);\n }\n }\n };\n }\n }, []);\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["React2","useLayoutEffect"],"mappings":";;;AAQA,SAAS,eAAe,CAAC,YAAY,EAAE,OAAO,EAAE;AAChD,EAAE,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK;AAC5C,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;AAC3C,IAAI,OAAO,SAAS,IAAI,KAAK;AAC7B,EA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AM,CAAC,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG;AACzE,EAAE,IAAI,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AAC7E,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,GAAG;AACtB,EAAE;AACF,EAAE,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG;AAC/D,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0]}
@@ -1,53 +1,70 @@
1
1
  import * as React from 'react';
2
- import { composeRefs } from '../../react-compose-refs/dist/index.js';
3
- import { jsx } from 'react/jsx-runtime';
2
+ import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
4
3
 
5
4
  // src/slot.tsx
6
5
  // @__NO_SIDE_EFFECTS__
7
6
  function createSlot(ownerName) {
8
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
9
7
  const Slot2 = React.forwardRef((props, forwardedRef) => {
10
- const { children, ...slotProps } = props;
11
- const childrenArray = React.Children.toArray(children);
12
- const slottable = childrenArray.find(isSlottable);
13
- if (slottable) {
14
- const newElement = slottable.props.children;
15
- const newChildren = childrenArray.map((child) => {
16
- if (child === slottable) {
17
- if (React.Children.count(newElement) > 1) return React.Children.only(null);
18
- return React.isValidElement(newElement) ? newElement.props.children : null;
19
- } else {
20
- return child;
8
+ let { children, ...slotProps } = props;
9
+ let slottableElement = null;
10
+ let hasSlottable = false;
11
+ const newChildren = [];
12
+ if (isLazyComponent(children) && typeof use === "function") {
13
+ children = use(children._payload);
14
+ }
15
+ React.Children.forEach(children, (maybeSlottable) => {
16
+ if (isSlottable(maybeSlottable)) {
17
+ hasSlottable = true;
18
+ const slottable = maybeSlottable;
19
+ let child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
20
+ if (isLazyComponent(child) && typeof use === "function") {
21
+ child = use(child._payload);
21
22
  }
22
- });
23
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
23
+ slottableElement = getSlottableElementFromSlottable(slottable, child);
24
+ newChildren.push(slottableElement?.props?.children);
25
+ } else {
26
+ newChildren.push(maybeSlottable);
27
+ }
28
+ });
29
+ if (slottableElement) {
30
+ slottableElement = React.cloneElement(slottableElement, void 0, newChildren);
31
+ } else if (
32
+ // A `Slottable` was found but it didn't resolve to a single element (e.g.
33
+ // it wrapped multiple elements, text, or a render-prop `child` that
34
+ // wasn't an element). Don't fall back to treating the `Slottable` wrapper
35
+ // itself as the slot target — throw a descriptive error below instead.
36
+ !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)
37
+ ) {
38
+ slottableElement = children;
24
39
  }
25
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
26
- });
27
- Slot2.displayName = `${ownerName}.Slot`;
28
- return Slot2;
29
- }
30
- // @__NO_SIDE_EFFECTS__
31
- function createSlotClone(ownerName) {
32
- const SlotClone = React.forwardRef((props, forwardedRef) => {
33
- const { children, ...slotProps } = props;
34
- if (React.isValidElement(children)) {
35
- const childrenRef = getElementRef(children);
36
- const props2 = mergeProps(slotProps, children.props);
37
- if (children.type !== React.Fragment) {
38
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
40
+ const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;
41
+ const composedRef = useComposedRefs(forwardedRef, slottableElementRef);
42
+ if (!slottableElement) {
43
+ if (children || children === 0) {
44
+ throw new Error(
45
+ hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)
46
+ );
39
47
  }
40
- return React.cloneElement(children, props2);
48
+ return children;
49
+ }
50
+ const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
51
+ if (slottableElement.type !== React.Fragment) {
52
+ mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
41
53
  }
42
- return React.Children.count(children) > 1 ? React.Children.only(null) : null;
54
+ return React.cloneElement(slottableElement, mergedProps);
43
55
  });
44
- SlotClone.displayName = `${ownerName}.SlotClone`;
45
- return SlotClone;
46
- }
47
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
48
- function isSlottable(child) {
49
- return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
56
+ Slot2.displayName = `${ownerName}.Slot`;
57
+ return Slot2;
50
58
  }
59
+ var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable");
60
+ var getSlottableElementFromSlottable = (slottable, child) => {
61
+ if ("child" in slottable.props) {
62
+ const child2 = slottable.props.child;
63
+ if (!React.isValidElement(child2)) return null;
64
+ return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
65
+ }
66
+ return React.isValidElement(child) ? child : null;
67
+ };
51
68
  function mergeProps(slotProps, childProps) {
52
69
  const overrideProps = { ...childProps };
53
70
  for (const propName in childProps) {
@@ -85,6 +102,23 @@ function getElementRef(element) {
85
102
  }
86
103
  return element.props.ref || element.ref;
87
104
  }
105
+ function isSlottable(child) {
106
+ return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
107
+ }
108
+ var REACT_LAZY_TYPE = Symbol.for("react.lazy");
109
+ function isLazyComponent(element) {
110
+ return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
111
+ }
112
+ function isPromiseLike(value) {
113
+ return typeof value === "object" && value !== null && "then" in value;
114
+ }
115
+ var createSlotError = (ownerName) => {
116
+ return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
117
+ };
118
+ var createSlottableError = (ownerName) => {
119
+ return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
120
+ };
121
+ var use = React[" use ".trim().toString()];
88
122
 
89
123
  export { createSlot };
90
124
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n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AE,cAAc,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzF,IAAI;AACJ,EAAE;AACF,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,EAAE;AAC3C;AACA,SAAS,aAAa,CAAC,OAAO,EAAE;AAChC,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG;AACzE,EAAE,IAAI,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AAC7E,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,GAAG;AACtB,EAAE;AACF,EAAE,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG;AAC/D,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement = null;\n let hasSlottable = false;\n const newChildren = [];\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = \"child\" in slottable.props ? slottable.props.child : slottable.props.children;\n if (isLazyComponent(child) && typeof use === \"function\") {\n child = use(child._payload);\n }\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push(slottableElement?.props?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, void 0, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target — throw a descriptive error below instead.\n !hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n if (!slottableElement) {\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)\n );\n }\n return children;\n }\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n return React.cloneElement(slottableElement, mergedProps);\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\nvar SLOTTABLE_IDENTIFIER = Symbol.for(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = (props) => \"child\" in props ? props.children(props.child) : props.children;\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nvar getSlottableElementFromSlottable = (slottable, child) => {\n if (\"child\" in slottable.props) {\n const child2 = slottable.props.child;\n if (!React.isValidElement(child2)) return null;\n return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));\n }\n return React.isValidElement(child) ? child : null;\n};\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nvar createSlotError = (ownerName) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n};\nvar createSlottableError = (ownerName) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n};\nvar use = React[\" use \".trim().toString()];\nexport {\n Slot as Root,\n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,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,WAAW,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,oBAAoB;AACtJ;AACA,IAAI,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AAC9C,SAAS,eAAe,CAAC,OAAO,EAAE;AAClC,EAAE,OAAO,OAAO,IAAI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,UAAU,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,eAAe,IAAI,UAAU,IAAI,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;AACpL;AACA,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,EAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;AACvE;AACA,IAAI,eAAe,GAAG,CAAC,SAAS,KAAK;AACrC,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,0FAA0F,CAAC;AACjH,CAAC;AACD,IAAI,oBAAoB,GAAG,CAAC,SAAS,KAAK;AAC1C,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,uGAAuG,CAAC;AAC9H,CAAC;AACD,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;;;;","x_google_ignoreList":[0]}
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
 
3
- // packages/react/use-callback-ref/src/use-callback-ref.tsx
3
+ // src/use-callback-ref.tsx
4
4
  function useCallbackRef(callback) {
5
5
  const callbackRef = React.useRef(callback);
6
6
  React.useEffect(() => {
7
7
  callbackRef.current = callback;
8
8
  });
9
- return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
9
+ return React.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
10
10
  }
11
11
 
12
12
  export { useCallbackRef };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5C,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,WAAW,CAAC,OAAO,GAAG,QAAQ;AAClC,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK,WAAW,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAC7E;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEA,SAAS,cAAc,CAAC,QAAQ,EAAE;AAClC,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5C,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,WAAW,CAAC,OAAO,GAAG,QAAQ;AAClC,EAAE,CAAC,CAAC;AACJ,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,WAAW,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/E;;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"],"sourcesContent":["// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;AAAA;AAGA,IAAI,kBAAkB,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAIA,gBAAe;AAC3F,SAAS,oBAAoB,CAAC;AAC9B,EAAE,IAAI;AACN,EAAE,WAAW;AACb,EAAE,QAAQ,GAAG,MAAM;AACnB,EAAE,CAAC;AACH,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,CAAC,GAAG,oBAAoB,CAAC;AACpF,IAAI,WAAW;AACf,IAAI;AACJ,GAAG,CAAC;AACJ,EAAE,MAAM,YAAY,GAAG,IAAI,KAAK,MAAM;AACtC,EAAE,MAAM,KAAK,GAAG,YAAY,GAAG,IAAI,GAAG,gBAAgB;AACtD,EAAY;AACZ,IAAI,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AACzD,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;AAC1B,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO;AACnD,MAAM,IAAI,aAAa,KAAK,YAAY,EAAE;AAC1C,QAAQ,MAAM,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc;AAClE,QAAQ,MAAM,EAAE,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc;AAC/D,QAAQ,OAAO,CAAC,IAAI;AACpB,UAAU,CAAC,EAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,0KAA0K;AAChO,SAAS;AACT,MAAM;AACN,MAAM,eAAe,CAAC,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AAK;AAClC,IAAI;AACJ,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AAC3B,EAAE,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC;AACvC;AACA,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,EAAE,OAAO,OAAO,KAAK,KAAK,UAAU;AACpC;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs"],"sourcesContent":["// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;AAAA;AAGA,IAAI,kBAAkB,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAIA,gBAAe;AAC3F,SAAS,oBAAoB,CAAC;AAC9B,EAAE,IAAI;AACN,EAAE,WAAW;AACb,EAAE,QAAQ,GAAG,MAAM;AACnB,EAAE,CAAC;AACH,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,CAAC,GAAG,oBAAoB,CAAC;AACpF,IAAI,WAAW;AACf,IAAI;AACJ,GAAG,CAAC;AACJ,EAAE,MAAM,YAAY,GAAG,IAAI,KAAK,MAAM;AACtC,EAAE,MAAM,KAAK,GAAG,YAAY,GAAG,IAAI,GAAG,gBAAgB;AACtD,EAAY;AACZ,IAAI,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC;AACzD,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM;AAC1B,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO;AACnD,MAAM,IAAI,aAAa,KAAK,YAAY,EAAE;AAC1C,QAAQ,MAAM,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc;AAClE,QAAQ,MAAM,EAAE,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc;AAC/D,QAAQ,OAAO,CAAC,IAAI;AACpB,UAAU,CAAC,EAAE,MAAM,CAAC,kBAAkB,EAAE,IAAI,CAAC,IAAI,EAAE,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