@arc-ui/components 11.14.0 → 11.16.0

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 (89) hide show
  1. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
  2. package/dist/Breadcrumbs/Breadcrumbs.esm.js +1 -1
  3. package/dist/Checkbox/Checkbox.cjs.js +2 -2
  4. package/dist/Checkbox/Checkbox.esm.js +2 -2
  5. package/dist/FormControl/FormControl.cjs.js +1 -1
  6. package/dist/FormControl/FormControl.esm.js +1 -1
  7. package/dist/InformationCard/InformationCard.cjs.js +25 -43
  8. package/dist/InformationCard/InformationCard.esm.js +24 -42
  9. package/dist/Modal/Modal.cjs.js +16 -40
  10. package/dist/Modal/Modal.esm.js +6 -30
  11. package/dist/PaginationSimple/PaginationSimple.cjs.js +19 -16
  12. package/dist/PaginationSimple/PaginationSimple.esm.js +19 -16
  13. package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
  14. package/dist/RadioGroup/RadioGroup.esm.js +2 -2
  15. package/dist/Select/Select.cjs.js +2736 -619
  16. package/dist/Select/Select.esm.js +2535 -418
  17. package/dist/Switch/Switch.cjs.js +335 -11
  18. package/dist/Switch/Switch.esm.js +328 -4
  19. package/dist/Tabs/Tabs.cjs.js +7 -4
  20. package/dist/Tabs/Tabs.esm.js +7 -4
  21. package/dist/TextArea/TextArea.cjs.js +17 -12
  22. package/dist/TextArea/TextArea.esm.js +17 -12
  23. package/dist/TextInput/TextInput.cjs.js +2 -2
  24. package/dist/TextInput/TextInput.esm.js +2 -2
  25. package/dist/Toast/Toast.cjs.js +7 -4
  26. package/dist/Toast/Toast.esm.js +7 -4
  27. package/dist/TypographyCard/TypographyCard.cjs.js +93 -0
  28. package/dist/TypographyCard/TypographyCard.esm.js +85 -0
  29. package/dist/TypographyCard/package.json +7 -0
  30. package/dist/UniversalHeader/UniversalHeader.cjs.js +1 -1
  31. package/dist/UniversalHeader/UniversalHeader.esm.js +1 -1
  32. package/dist/_shared/cjs/{Breadcrumbs-ed70e75a.js → Breadcrumbs-ef659d2b.js} +5 -5
  33. package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +30 -0
  34. package/dist/_shared/cjs/BtIconArrowRightFill.esm-435cf4bd.js +26 -0
  35. package/dist/_shared/cjs/{Checkbox-b126194e.js → Checkbox-904ad028.js} +1 -1
  36. package/dist/_shared/cjs/{FormControl-7daf8110.js → FormControl-166e0957.js} +5 -1
  37. package/dist/_shared/cjs/{RadioGroup-56e3b0e5.js → RadioGroup-1eddf86f.js} +1 -1
  38. package/dist/_shared/cjs/{Tabs-2d2a517d.js → Tabs-cc77dabb.js} +17 -37
  39. package/dist/_shared/cjs/{TextInput-bf1fe052.js → TextInput-fd9c756f.js} +10 -4
  40. package/dist/_shared/cjs/{Toast-69108261.js → Toast-91e96744.js} +36 -54
  41. package/dist/_shared/cjs/{UniversalHeader-5e43d320.js → UniversalHeader-b8389447.js} +4 -2
  42. package/dist/_shared/cjs/index-1641d0b4.js +27 -0
  43. package/dist/_shared/cjs/{index-43458549.js → index-3d69ea00.js} +28 -1
  44. package/dist/_shared/cjs/index-49c72a87.js +131 -0
  45. package/dist/_shared/cjs/{index-6b2a9ac3.js → index-4ecad2dd.js} +6 -22
  46. package/dist/_shared/cjs/{index.module-dd1d7d0b.js → index-56a040f4.js} +87 -104
  47. package/dist/_shared/cjs/index-6542b467.js +23 -0
  48. package/dist/_shared/cjs/{index-adbb63da.js → index-84e6a68f.js} +1 -1
  49. package/dist/_shared/cjs/{index-b2fd6338.js → index-d31f2b65.js} +1 -1
  50. package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
  51. package/dist/_shared/esm/{Breadcrumbs-87e2bd46.js → Breadcrumbs-36edfb3d.js} +5 -5
  52. package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +24 -0
  53. package/dist/_shared/esm/BtIconArrowRightFill.esm-99019d1a.js +20 -0
  54. package/dist/_shared/esm/{Checkbox-d6ec5024.js → Checkbox-8a5bb9a1.js} +1 -1
  55. package/dist/_shared/esm/{FormControl-351e5f1b.js → FormControl-9d4ddfec.js} +5 -1
  56. package/dist/_shared/esm/{RadioGroup-c838764c.js → RadioGroup-238db88d.js} +1 -1
  57. package/dist/_shared/esm/{Tabs-f903187a.js → Tabs-8719d952.js} +7 -27
  58. package/dist/_shared/esm/{TextInput-991804b6.js → TextInput-c1e2a1dd.js} +10 -4
  59. package/dist/_shared/esm/{Toast-37549e68.js → Toast-7cb1e544.js} +6 -24
  60. package/dist/_shared/esm/{UniversalHeader-b4c1577c.js → UniversalHeader-80c7313f.js} +4 -2
  61. package/dist/_shared/esm/{index.module-44714d3f.js → index-12f3a407.js} +89 -105
  62. package/dist/_shared/esm/index-246b4f18.js +21 -0
  63. package/dist/_shared/esm/{index-a1d2d9b3.js → index-39019a9b.js} +1 -1
  64. package/dist/_shared/esm/{index-41d7af2b.js → index-3e2bc99d.js} +29 -3
  65. package/dist/_shared/esm/index-6b7b075c.js +25 -0
  66. package/dist/_shared/esm/{index-efd9ef1c.js → index-936b5179.js} +1 -1
  67. package/dist/_shared/esm/index-a624de47.js +9 -0
  68. package/dist/_shared/esm/{index-3797d77e.js → index-d0307140.js} +5 -21
  69. package/dist/_shared/esm/index-db47e95a.js +129 -0
  70. package/dist/index.es.js +3062 -865
  71. package/dist/index.es.js.map +1 -1
  72. package/dist/index.js +3062 -864
  73. package/dist/index.js.map +1 -1
  74. package/dist/styles.css +5 -5
  75. package/dist/types/components/MediaCard/MediaCard.d.ts +24 -30
  76. package/dist/types/components/Select/Select.d.ts +49 -0
  77. package/dist/types/components/TextInput/TextInput.d.ts +12 -1
  78. package/dist/types/components/TypographyCard/TypographyCard.d.ts +48 -0
  79. package/dist/types/components/TypographyCard/index.d.ts +1 -0
  80. package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
  81. package/dist/types/components/index.d.ts +1 -0
  82. package/dist/types/internal-components/ConditionalWrapper/ConditionalWrapper.d.ts +6 -0
  83. package/dist/types/internal-components/ConditionalWrapper/index.d.ts +1 -0
  84. package/dist/types/internal-components/index.d.ts +1 -0
  85. package/dist/types/styles.d.ts +2 -1
  86. package/package.json +2 -2
  87. package/dist/_shared/cjs/index-c575a255.js +0 -490
  88. package/dist/_shared/esm/index-13d575cc.js +0 -479
  89. package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
package/dist/index.es.js CHANGED
@@ -1238,10 +1238,10 @@ const BtIconChevronRight2Px = (props) =>
1238
1238
  var BreadcrumbsItem = function (_a) {
1239
1239
  var spacerIconAfter = _a.spacerIconAfter, spacerIconBefore = _a.spacerIconBefore, children = _a.children, props = __rest(_a, ["spacerIconAfter", "spacerIconBefore", "children"]);
1240
1240
  return (React__default.createElement("li", __assign({ className: "arc-Breadcrumbs-item" }, filterDataAttrs(props)),
1241
- spacerIconBefore && (React__default.createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "data-testid": "arc-chevron-left-2px" },
1241
+ spacerIconBefore && (React__default.createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "data-testid": "arc-chevron-left-2px", "aria-hidden": "true" },
1242
1242
  React__default.createElement(Icon, { icon: BtIconChevronLeft2Px }))),
1243
1243
  children,
1244
- spacerIconAfter && (React__default.createElement("div", { className: "arc-Breadcrumbs-spacerIcon" },
1244
+ spacerIconAfter && (React__default.createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "aria-hidden": "true" },
1245
1245
  React__default.createElement(Icon, { icon: BtIconChevronRight2Px })))));
1246
1246
  };
1247
1247
 
@@ -1259,7 +1259,7 @@ var handleLinkClick = function (_a) {
1259
1259
 
1260
1260
  var BreadcrumbsLink = React__default.forwardRef(function (_a, ref) {
1261
1261
  var onClick = _a.onClick, href = _a.href, isActive = _a.isActive, children = _a.children, props = __rest(_a, ["onClick", "href", "isActive", "children"]);
1262
- return (React__default.createElement(React__default.Fragment, null, isActive || href === undefined ? (React__default.createElement("span", __assign({}, (isActive && { "aria-hidden": "true" }), { onClick: onClick, className: classNames({
1262
+ return (React__default.createElement(React__default.Fragment, null, isActive || href === undefined ? (React__default.createElement("span", __assign({ onClick: onClick, className: classNames({
1263
1263
  "arc-Breadcrumbs-text": true,
1264
1264
  "arc-Breadcrumbs-text--active": isActive
1265
1265
  }) }, filterDataAttrs(props)), children)) : (React__default.createElement("a", __assign({}, (onClick && ref
@@ -1308,11 +1308,11 @@ var Breadcrumbs = function (_a) {
1308
1308
  // eslint-disable-next-line
1309
1309
  }, []);
1310
1310
  var items = React__default.Children.toArray(children);
1311
- return (React__default.createElement("nav", __assign({ "aria-label": "Breadcrumbs", role: "navigation", className: classNames({
1311
+ return (React__default.createElement("nav", __assign({ "aria-label": "Breadcrumbs", className: classNames({
1312
1312
  "arc-Breadcrumbs": true,
1313
1313
  "arc-Breadcrumbs--light": isLight
1314
1314
  }) }, filterDataAttrs(props)),
1315
- React__default.createElement("ul", { className: "arc-Breadcrumbs-list", ref: breadcrumbsList }, showBackTrail ? (React__default.createElement(React__default.Fragment, null, items.length < 3 ? (React__default.createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[0].props.children)) : (React__default.createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[items.length - 2].props.children)))) : (React__default.createElement(React__default.Fragment, null, isCompressed ? (React__default.createElement(React__default.Fragment, null,
1315
+ React__default.createElement("ol", { className: "arc-Breadcrumbs-list", ref: breadcrumbsList }, showBackTrail ? (React__default.createElement(React__default.Fragment, null, items.length < 3 ? (React__default.createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[0].props.children)) : (React__default.createElement(Breadcrumbs.Item, { spacerIconBefore: true }, items[items.length - 2].props.children)))) : (React__default.createElement(React__default.Fragment, null, isCompressed ? (React__default.createElement(React__default.Fragment, null,
1316
1316
  React__default.createElement(Breadcrumbs.Item, { spacerIconAfter: true }, items[0].props.children),
1317
1317
  React__default.createElement(Breadcrumbs.Item, { spacerIconAfter: true },
1318
1318
  React__default.createElement("button", { className: "arc-Breadcrumbs-expand arc-Breadcrumbs-text", onClick: function () { return setIsCompressed(false); }, "aria-label": "Expand Breadcrumbs", type: "button", "data-testid": "expand-ellipsis" }, "...")),
@@ -1737,6 +1737,8 @@ var FormControl = function (_a) {
1737
1737
  else {
1738
1738
  elementProps["aria-describedby"] = ariaDescribedby;
1739
1739
  }
1740
+ var hasInfo = !helperUnderLabel &&
1741
+ Boolean(errorMessage || disclosureTitle || helper || supplementaryInfo);
1740
1742
  return (React__default.createElement(Provider$3, { value: { requirementStatus: requirementStatus } },
1741
1743
  React__default.createElement(ElementType, __assign({ className: classNames({
1742
1744
  "arc-FormControl": true,
@@ -1749,7 +1751,9 @@ var FormControl = function (_a) {
1749
1751
  requirementStatus === "optional" && (React__default.createElement("span", { className: "arc-FormControl-labelOptional" }, "(optional)"))),
1750
1752
  helperUnderLabel && (React__default.createElement(React__default.Fragment, null, helper && (React__default.createElement("div", { className: "arc-FormControl-helper arc-FormControl-helper--underLabel", id: idHelper }, helper)))),
1751
1753
  children,
1752
- React__default.createElement("div", { className: "arc-FormControl-info" },
1754
+ React__default.createElement("div", { className: classNames("arc-FormControl-info", {
1755
+ "arc-FormControl-info--hasContent": hasInfo
1756
+ }) },
1753
1757
  !helperUnderLabel && (React__default.createElement("div", { className: "arc-FormControl-helperContainer" }, errorMessage ? (React__default.createElement("div", { className: "arc-FormControl-error", id: idError },
1754
1758
  React__default.createElement("span", { className: "arc-FormControl-error--icon" },
1755
1759
  React__default.createElement(BtIconAlert, null)),
@@ -2203,27 +2207,29 @@ var InformationCard = function (_a) {
2203
2207
  "arc-InformationCard--interactive": cardUrl
2204
2208
  }) }, filterDataAttrs(props)),
2205
2209
  React__default.createElement(Surface, { growVertically: true, padding: containerSpacing, background: "white" },
2206
- image && (React__default.createElement("div", { className: "arc-InformationCard-img" },
2207
- React__default.createElement(Image, __assign({}, image)),
2208
- React__default.createElement(VerticalSpace, { size: assetSpacing }))),
2209
- icon && (React__default.createElement(React__default.Fragment, null,
2210
- React__default.createElement(Icon, { testId: "information-card-icon", icon: icon, size: 96 }),
2211
- React__default.createElement(VerticalSpace, { size: assetSpacing }))),
2212
- label && (React__default.createElement(React__default.Fragment, null,
2213
- React__default.createElement("span", { className: "arc-InformationCard-label" }, label),
2214
- React__default.createElement(VerticalSpace, { size: headingSpacing }))),
2215
- React__default.createElement(HeadingElement, { className: "arc-InformationCard-heading" }, cardUrl ? (React__default.createElement("a", { className: "arc-InformationCard-headingLink", href: cardUrl, onClick: onClick }, heading)) : (heading)),
2216
- React__default.createElement("div", { className: "arc-InformationCard-textContainer" }, text && (React__default.createElement(React__default.Fragment, null,
2217
- React__default.createElement(VerticalSpace, { size: headingSpacing }),
2218
- React__default.createElement(Text, null, text),
2219
- (button || tags || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" })))),
2220
- tags && (React__default.createElement(React__default.Fragment, null,
2221
- React__default.createElement("div", { className: "arc-InformationCard-tagContainer" }, tags.map(function (_a, i) {
2222
- var text = _a.text, tagProps = __rest(_a, ["text"]);
2223
- return (React__default.createElement("div", { className: "arc-InformationCard-tag", key: "information-card-tag-".concat(i) },
2224
- React__default.createElement(Tag, __assign({}, tagProps), text)));
2225
- })),
2226
- (button || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" }))),
2210
+ React__default.createElement("div", null,
2211
+ image && (React__default.createElement("div", { className: "arc-InformationCard-img" },
2212
+ React__default.createElement(Image, __assign({}, image)),
2213
+ React__default.createElement(VerticalSpace, { size: assetSpacing }))),
2214
+ icon && (React__default.createElement(React__default.Fragment, null,
2215
+ React__default.createElement(Icon, { testId: "information-card-icon", icon: icon, size: 96 }),
2216
+ React__default.createElement(VerticalSpace, { size: assetSpacing }))),
2217
+ label && (React__default.createElement(React__default.Fragment, null,
2218
+ React__default.createElement("span", { className: "arc-InformationCard-label" }, label),
2219
+ React__default.createElement(VerticalSpace, { size: headingSpacing }))),
2220
+ React__default.createElement(HeadingElement, { className: "arc-InformationCard-heading" }, cardUrl ? (React__default.createElement("a", { className: "arc-InformationCard-headingLink", href: cardUrl, onClick: onClick }, heading)) : (heading))),
2221
+ React__default.createElement("div", { className: "arc-InformationCard-contentContainer" },
2222
+ text && (React__default.createElement(React__default.Fragment, null,
2223
+ React__default.createElement(VerticalSpace, { size: headingSpacing }),
2224
+ React__default.createElement(Text, null, text),
2225
+ (button || tags || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" }))),
2226
+ tags && (React__default.createElement(React__default.Fragment, null,
2227
+ React__default.createElement("div", { className: "arc-InformationCard-tagContainer" }, tags.map(function (_a, i) {
2228
+ var text = _a.text, tagProps = __rest(_a, ["text"]);
2229
+ return (React__default.createElement("div", { className: "arc-InformationCard-tag", key: "information-card-tag-".concat(i) },
2230
+ React__default.createElement(Tag, __assign({}, tagProps), text)));
2231
+ })),
2232
+ (button || footerLogo) && React__default.createElement(VerticalSpace, { size: "24" })))),
2227
2233
  React__default.createElement("div", { className: "arc-InformationCard-footer" },
2228
2234
  button && !cardUrl && (React__default.createElement("div", { className: "arc-InformationCard-footerButtonContainer" },
2229
2235
  React__default.createElement(Button, __assign({}, button, { iconPosition: "beforeText", fill: "flat", icon: BtIconArrowRight })))),
@@ -2244,18 +2250,112 @@ var Markup = function (_a) {
2244
2250
  }) }, filterDataAttrs(props)), children));
2245
2251
  };
2246
2252
 
2247
- // Update tests for box surface
2253
+ const BtIconPlay = (props) =>
2254
+ /*#__PURE__*/ React__default.createElement(
2255
+ "svg",
2256
+ Object.assign(
2257
+ {
2258
+ xmlns: "http://www.w3.org/2000/svg",
2259
+ viewBox: "0 0 32 32",
2260
+ },
2261
+ props,
2262
+ ),
2263
+ /*#__PURE__*/ React__default.createElement("defs", null),
2264
+ /*#__PURE__*/ React__default.createElement("path", {
2265
+ d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,27A13,13,0,1,1,29,16,13.01474,13.01474,0,0,1,16,29Z",
2266
+ fill: "currentColor",
2267
+ }),
2268
+ /*#__PURE__*/ React__default.createElement("path", {
2269
+ d: "M20.83887,15.03955,13.66113,10.896A1.107,1.107,0,0,0,12,11.85449v8.2876a1.10534,1.10534,0,0,0,1.66113.95947L20.83887,16.957a1.10688,1.10688,0,0,0,0-1.91748Zm-.5,1.05176-7.17774,4.14453a.10437.10437,0,0,1-.10742-.00049A.10314.10314,0,0,1,13,20.14209v-8.2876a.10229.10229,0,0,1,.05371-.09277.10284.10284,0,0,1,.10742,0l7.17774,4.14307a.10421.10421,0,0,1,.05371.09375A.10285.10285,0,0,1,20.33887,16.09131Z",
2270
+ fill: "currentColor",
2271
+ }),
2272
+ );
2273
+
2274
+ const BtIconArrowRightFill = (props) =>
2275
+ /*#__PURE__*/ React__default.createElement(
2276
+ "svg",
2277
+ Object.assign(
2278
+ {
2279
+ xmlns: "http://www.w3.org/2000/svg",
2280
+ viewBox: "0 0 32 32",
2281
+ },
2282
+ props,
2283
+ ),
2284
+ /*#__PURE__*/ React__default.createElement("defs", null),
2285
+ /*#__PURE__*/ React__default.createElement("path", {
2286
+ d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
2287
+ fill: "currentColor",
2288
+ }),
2289
+ );
2290
+
2291
+ const BtIconPlayFill = (props) =>
2292
+ /*#__PURE__*/ React__default.createElement(
2293
+ "svg",
2294
+ Object.assign(
2295
+ {
2296
+ xmlns: "http://www.w3.org/2000/svg",
2297
+ viewBox: "0 0 32 32",
2298
+ },
2299
+ props,
2300
+ ),
2301
+ /*#__PURE__*/ React__default.createElement("defs", null),
2302
+ /*#__PURE__*/ React__default.createElement("path", {
2303
+ d: "M13.16113,11.76172a.10284.10284,0,0,0-.10742,0A.10229.10229,0,0,0,13,11.85449v8.2876a.10314.10314,0,0,0,.05371.09326.10451.10451,0,0,0,.10742.00049l7.17774-4.14453a.10285.10285,0,0,0,.05371-.09277.10421.10421,0,0,0-.05371-.09375Z",
2304
+ fill: "currentColor",
2305
+ }),
2306
+ /*#__PURE__*/ React__default.createElement("path", {
2307
+ d: "M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm4.83887,14.957-7.17774,4.14453A1.10791,1.10791,0,0,1,12,20.14209v-8.2876a1.107,1.107,0,0,1,1.66113-.95849l7.17774,4.14355a1.10688,1.10688,0,0,1,0,1.91748Z",
2308
+ fill: "currentColor",
2309
+ }),
2310
+ );
2311
+
2312
+ var ConditionalWrapper = function (_a) {
2313
+ var condition = _a.condition, wrapper = _a.wrapper, children = _a.children;
2314
+ return (React__default.createElement(React__default.Fragment, null, condition ? wrapper(children) : children));
2315
+ };
2316
+
2248
2317
  /**
2249
2318
  * Use `MediaCard` to contain content and an image about a single subject.
2250
2319
  */
2251
2320
  var MediaCard = function (_a) {
2252
- var isBorderRadius = _a.isBorderRadius, isFullHeight = _a.isFullHeight, cardFooter = _a.cardFooter, borderWidth = _a.borderWidth, surface = _a.surface, elevationLevel = _a.elevationLevel, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, imageLoading = _a.imageLoading, imageSizes = _a.imageSizes, imageSrcSet = _a.imageSrcSet, children = _a.children, props = __rest(_a, ["isBorderRadius", "isFullHeight", "cardFooter", "borderWidth", "surface", "elevationLevel", "imageSrc", "imageAlt", "imageLoading", "imageSizes", "imageSrcSet", "children"]);
2253
- return (React__default.createElement(Box, __assign({ isFullHeight: isFullHeight, surface: surface, elevationLevel: elevationLevel, isBorderRadius: isBorderRadius, borderWidth: borderWidth }, filterDataAttrs(props)),
2254
- React__default.createElement("div", { className: "arc-MediaCard-wrapper" },
2255
- React__default.createElement("div", { className: "arc-MediaCard-imageContainer" },
2256
- React__default.createElement(Image, { alt: imageAlt, loading: imageLoading, sizes: imageSizes, src: imageSrc, srcSet: imageSrcSet })),
2257
- React__default.createElement("div", { className: "arc-MediaCard-section" }, children),
2258
- cardFooter && (React__default.createElement("div", { className: "arc-MediaCard-section" }, cardFooter)))));
2321
+ var img = _a.img, url = _a.url, onClick = _a.onClick, heading = _a.heading, label = _a.label, text = _a.text, metaText = _a.metaText, _b = _a.buttonIcon, buttonIcon = _b === void 0 ? "arrow" : _b, _c = _a.isContained, isContained = _c === void 0 ? true : _c, _d = _a.headingLevel, headingLevel = _d === void 0 ? "2" : _d, props = __rest(_a, ["img", "url", "onClick", "heading", "label", "text", "metaText", "buttonIcon", "isContained", "headingLevel"]);
2322
+ var isMinWidthArcBreakpointS = useMediaQuery("(min-width: ".concat(ArcBreakpointS, "px)"));
2323
+ var headingSpacing = isMinWidthArcBreakpointS ? "16" : "8";
2324
+ var HeadingElement = "h".concat(headingLevel);
2325
+ var icons = {
2326
+ arrow: {
2327
+ regular: BtIconArrowRight,
2328
+ hover: BtIconArrowRightFill
2329
+ },
2330
+ play: {
2331
+ regular: BtIconPlay,
2332
+ hover: BtIconPlayFill
2333
+ }
2334
+ };
2335
+ return (React__default.createElement("div", __assign({ className: classNames("arc-MediaCard", {
2336
+ "arc-MediaCard--interactive": url,
2337
+ "arc-MediaCard--contained": isContained
2338
+ }) }, filterDataAttrs(props)),
2339
+ React__default.createElement(ConditionalWrapper, { condition: isContained, wrapper: function (children) { return (React__default.createElement(Surface, { growVertically: true, background: "white" }, children)); } },
2340
+ React__default.createElement("div", { className: "arc-MediaCard-imgContainer" },
2341
+ React__default.createElement(Image, __assign({}, img))),
2342
+ React__default.createElement("div", { className: "arc-MediaCard-content" },
2343
+ label && (React__default.createElement(React__default.Fragment, null,
2344
+ React__default.createElement("span", { className: "arc-MediaCard-label" }, label),
2345
+ React__default.createElement(VerticalSpace, { size: headingSpacing }))),
2346
+ React__default.createElement(HeadingElement, { className: "arc-MediaCard-heading" }, url ? (React__default.createElement("a", { className: "arc-MediaCard-headingLink", href: url, onClick: onClick }, heading)) : (heading)),
2347
+ React__default.createElement("div", { className: "arc-MediaCard-textContainer" }, text && (React__default.createElement(React__default.Fragment, null,
2348
+ React__default.createElement(VerticalSpace, { size: headingSpacing }),
2349
+ React__default.createElement(Text, null, text),
2350
+ (url || metaText) && React__default.createElement(VerticalSpace, { size: "24" })))),
2351
+ React__default.createElement("div", { className: "arc-MediaCard-footer" },
2352
+ React__default.createElement("div", { className: "arc-MediaCard-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-MediaCard-metaText" }, metaText))),
2353
+ url && (React__default.createElement("div", null,
2354
+ React__default.createElement("div", { className: "arc-MediaCard-footerButton" },
2355
+ React__default.createElement("div", { className: classNames("arc-MediaCard-footerButtonIcon", "arc-MediaCard-footerButtonIcon--regular") },
2356
+ React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
2357
+ React__default.createElement("div", { className: "arc-MediaCard-footerButtonIcon arc-MediaCard-footerButtonIcon--hover" },
2358
+ React__default.createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))))))));
2259
2359
  };
2260
2360
 
2261
2361
  function _extends() {
@@ -2408,13 +2508,13 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEv
2408
2508
  * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
2409
2509
  */ const $9f79659886946c16$export$e5c5a5f917a5871c$1 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
2410
2510
 
2411
- const $1746a345f3d73bb7$var$useReactId$1 = React['useId'.toString()] || (()=>undefined
2511
+ const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
2412
2512
  );
2413
- let $1746a345f3d73bb7$var$count$1 = 0;
2414
- function $1746a345f3d73bb7$export$f680877a34711e37$1(deterministicId) {
2415
- const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId$1()); // React versions older than 18 will have client-side ids only.
2513
+ let $1746a345f3d73bb7$var$count = 0;
2514
+ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
2515
+ const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
2416
2516
  $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
2417
- if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count$1++)
2517
+ if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
2418
2518
  );
2419
2519
  }, [
2420
2520
  deterministicId
@@ -33495,14 +33595,14 @@ const $8927f6f2acc4f386$var$NODES$1 = [
33495
33595
  * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
33496
33596
  * this utility with them. This is because it's possible for those handlers to be called implicitly during render
33497
33597
  * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
33498
- */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event) {
33598
+ */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
33499
33599
  if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
33500
33600
  );
33501
33601
  }
33502
33602
 
33503
33603
  /**
33504
33604
  * Listens for when the escape key is down
33505
- */ function $addc16e1bbe58fd0$export$3a72a57244d6e765$1(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33605
+ */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33506
33606
  const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onEscapeKeyDownProp);
33507
33607
  useEffect(()=>{
33508
33608
  const handleKeyDown = (event)=>{
@@ -33565,7 +33665,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((pr
33565
33665
  onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
33566
33666
  if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
33567
33667
  }, ownerDocument);
33568
- $addc16e1bbe58fd0$export$3a72a57244d6e765$1((event)=>{
33668
+ $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
33569
33669
  const isHighestLayer = index === context.layers.size - 1;
33570
33670
  if (!isHighestLayer) return;
33571
33671
  onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
@@ -33760,7 +33860,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, det
33760
33860
  if (handler) target.addEventListener(name, handler, {
33761
33861
  once: true
33762
33862
  });
33763
- if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event);
33863
+ if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
33764
33864
  else target.dispatchEvent(event);
33765
33865
  }
33766
33866
  const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22$1;
@@ -34170,25 +34270,25 @@ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
34170
34270
  return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
34171
34271
  }
34172
34272
 
34173
- /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count$1 = 0;
34273
+ /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
34174
34274
  /**
34175
34275
  * Injects a pair of focus guards at the edges of the whole DOM tree
34176
34276
  * to ensure `focusin` & `focusout` events can be caught consistently.
34177
- */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c$1() {
34277
+ */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
34178
34278
  useEffect(()=>{
34179
34279
  var _edgeGuards$, _edgeGuards$2;
34180
34280
  const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
34181
- document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard$1());
34182
- document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard$1());
34183
- $3db38b7d1fb3fe6a$var$count$1++;
34281
+ document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
34282
+ document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
34283
+ $3db38b7d1fb3fe6a$var$count++;
34184
34284
  return ()=>{
34185
- if ($3db38b7d1fb3fe6a$var$count$1 === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
34285
+ if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
34186
34286
  );
34187
- $3db38b7d1fb3fe6a$var$count$1--;
34287
+ $3db38b7d1fb3fe6a$var$count--;
34188
34288
  };
34189
34289
  }, []);
34190
34290
  }
34191
- function $3db38b7d1fb3fe6a$var$createFocusGuard$1() {
34291
+ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
34192
34292
  const element = document.createElement('span');
34193
34293
  element.setAttribute('data-radix-focus-guard', '');
34194
34294
  element.tabIndex = 0;
@@ -34973,9 +35073,9 @@ const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
34973
35073
  scope: __scopeDialog,
34974
35074
  triggerRef: triggerRef,
34975
35075
  contentRef: contentRef,
34976
- contentId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
34977
- titleId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
34978
- descriptionId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
35076
+ contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
35077
+ titleId: $1746a345f3d73bb7$export$f680877a34711e37(),
35078
+ descriptionId: $1746a345f3d73bb7$export$f680877a34711e37(),
34979
35079
  open: open,
34980
35080
  onOpenChange: setOpen,
34981
35081
  onOpenToggle: useCallback(()=>setOpen((prevOpen)=>!prevOpen
@@ -35130,7 +35230,7 @@ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((prop
35130
35230
  const contentRef = useRef(null);
35131
35231
  const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
35132
35232
  // the last element in the DOM (beacuse of the `Portal`)
35133
- $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c$1();
35233
+ $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
35134
35234
  return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6$1, {
35135
35235
  asChild: true,
35136
35236
  loop: true,
@@ -35308,22 +35408,25 @@ var PaginationSimple = function (_a) {
35308
35408
  "arc-PaginationSimple--fluid": isFluid,
35309
35409
  "arc-PaginationSimple--centered": !isFluid
35310
35410
  }) }, filterDataAttrs(props)),
35311
- React__default.createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
35312
- "arc-PaginationSimple-navigationButton--hidden": hidePrev
35313
- }), onClick: function () {
35314
- onPrevPage();
35315
- } },
35316
- React__default.createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--left" },
35317
- React__default.createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronLeftMid })),
35318
- React__default.createElement("span", { className: "arc-PaginationSimple-prevText" }, "Prev")),
35319
- React__default.createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
35320
- "arc-PaginationSimple-navigationButton--hidden": hideNext
35321
- }), onClick: function () {
35322
- onNextPage();
35323
- } },
35324
- React__default.createElement("span", { className: "arc-PaginationSimple-nextText" }, "Next"),
35325
- React__default.createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--right" },
35326
- React__default.createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronRightMid })))));
35411
+ React__default.createElement("ul", { className: "arc-PaginationSimple-list" },
35412
+ React__default.createElement("li", { className: "arc-PaginationSimple-listItem" },
35413
+ React__default.createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
35414
+ "arc-PaginationSimple-navigationButton--hidden": hidePrev
35415
+ }), onClick: function () {
35416
+ onPrevPage();
35417
+ } },
35418
+ React__default.createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--left" },
35419
+ React__default.createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronLeftMid })),
35420
+ React__default.createElement("span", { className: "arc-PaginationSimple-prevText" }, "Prev"))),
35421
+ React__default.createElement("li", { className: "arc-PaginationSimple-listItem" },
35422
+ React__default.createElement("button", { className: classNames("arc-PaginationSimple-navigationButton", {
35423
+ "arc-PaginationSimple-navigationButton--hidden": hideNext
35424
+ }), onClick: function () {
35425
+ onNextPage();
35426
+ } },
35427
+ React__default.createElement("span", { className: "arc-PaginationSimple-nextText" }, "Next"),
35428
+ React__default.createElement("div", { className: "arc-PaginationSimple-iconContainer arc-PaginationSimple-iconContainer--right" },
35429
+ React__default.createElement(Icon, { color: "brand", size: 32, icon: BtIconChevronRightMid })))))));
35327
35430
  };
35328
35431
 
35329
35432
  var PosterImage = function (_a) {
@@ -35691,218 +35794,15 @@ function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
35691
35794
  return Math.min(max, Math.max(min, value));
35692
35795
  }
35693
35796
 
35694
- function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
35695
- return function handleEvent(event) {
35696
- originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
35697
- if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
35698
- };
35699
- }
35700
-
35701
- /* -------------------------------------------------------------------------------------------------
35702
- * createContextScope
35703
- * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
35704
- let defaultContexts = [];
35705
- /* -----------------------------------------------------------------------------------------------
35706
- * createContext
35707
- * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
35708
- const BaseContext = /*#__PURE__*/ createContext(defaultContext);
35709
- const index = defaultContexts.length;
35710
- defaultContexts = [
35711
- ...defaultContexts,
35712
- defaultContext
35713
- ];
35714
- function Provider(props) {
35715
- const { scope: scope , children: children , ...context } = props;
35716
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
35717
- // eslint-disable-next-line react-hooks/exhaustive-deps
35718
- const value = useMemo(()=>context
35719
- , Object.values(context));
35720
- return /*#__PURE__*/ createElement(Context.Provider, {
35721
- value: value
35722
- }, children);
35723
- }
35724
- function useContext$1(consumerName, scope) {
35725
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
35726
- const context = useContext(Context);
35727
- if (context) return context;
35728
- if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
35729
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
35730
- }
35731
- Provider.displayName = rootComponentName + 'Provider';
35732
- return [
35733
- Provider,
35734
- useContext$1
35735
- ];
35736
- }
35737
- /* -----------------------------------------------------------------------------------------------
35738
- * createScope
35739
- * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
35740
- const scopeContexts = defaultContexts.map((defaultContext)=>{
35741
- return /*#__PURE__*/ createContext(defaultContext);
35742
- });
35743
- return function useScope(scope) {
35744
- const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
35745
- return useMemo(()=>({
35746
- [`__scope${scopeName}`]: {
35747
- ...scope,
35748
- [scopeName]: contexts
35749
- }
35750
- })
35751
- , [
35752
- scope,
35753
- contexts
35754
- ]);
35755
- };
35756
- };
35757
- createScope.scopeName = scopeName;
35758
- return [
35759
- $c512c27ab02ef895$export$fd42f52fd3ae1109,
35760
- $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
35761
- ];
35762
- }
35763
- /* -------------------------------------------------------------------------------------------------
35764
- * composeContextScopes
35765
- * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
35766
- const baseScope = scopes[0];
35767
- if (scopes.length === 1) return baseScope;
35768
- const createScope1 = ()=>{
35769
- const scopeHooks = scopes.map((createScope)=>({
35770
- useScope: createScope(),
35771
- scopeName: createScope.scopeName
35772
- })
35773
- );
35774
- return function useComposedScopes(overrideScopes) {
35775
- const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
35776
- // We are calling a hook inside a callback which React warns against to avoid inconsistent
35777
- // renders, however, scoping doesn't have render side effects so we ignore the rule.
35778
- // eslint-disable-next-line react-hooks/rules-of-hooks
35779
- const scopeProps = useScope(overrideScopes);
35780
- const currentScope = scopeProps[`__scope${scopeName}`];
35781
- return {
35782
- ...nextScopes,
35783
- ...currentScope
35784
- };
35785
- }, {});
35786
- return useMemo(()=>({
35787
- [`__scope${baseScope.scopeName}`]: nextScopes1
35788
- })
35789
- , [
35790
- nextScopes1
35791
- ]);
35792
- };
35793
- };
35794
- createScope1.scopeName = baseScope.scopeName;
35795
- return createScope1;
35796
- }
35797
-
35798
- /**
35799
- * Set a given ref to a given value
35800
- * This utility takes care of different types of refs: callback refs and RefObject(s)
35801
- */ function $6ed0406888f73fc4$var$setRef(ref, value) {
35802
- if (typeof ref === 'function') ref(value);
35803
- else if (ref !== null && ref !== undefined) ref.current = value;
35804
- }
35805
- /**
35806
- * A utility to compose multiple refs together
35807
- * Accepts callback refs and RefObject(s)
35808
- */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
35809
- return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
35810
- )
35811
- ;
35812
- }
35813
- /**
35814
- * A custom hook that composes multiple refs
35815
- * Accepts callback refs and RefObject(s)
35816
- */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
35817
- // eslint-disable-next-line react-hooks/exhaustive-deps
35818
- return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
35819
- }
35820
-
35821
- /* -------------------------------------------------------------------------------------------------
35822
- * Slot
35823
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35824
- const { children: children , ...slotProps } = props;
35825
- const childrenArray = Children.toArray(children);
35826
- const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
35827
- if (slottable) {
35828
- // the new element to render is the one passed as a child of `Slottable`
35829
- const newElement = slottable.props.children;
35830
- const newChildren = childrenArray.map((child)=>{
35831
- if (child === slottable) {
35832
- // because the new element will be the one rendered, we are only interested
35833
- // in grabbing its children (`newElement.props.children`)
35834
- if (Children.count(newElement) > 1) return Children.only(null);
35835
- return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
35836
- } else return child;
35837
- });
35838
- return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
35839
- ref: forwardedRef
35840
- }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
35841
- }
35842
- return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
35843
- ref: forwardedRef
35844
- }), children);
35845
- });
35846
- $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
35847
- /* -------------------------------------------------------------------------------------------------
35848
- * SlotClone
35849
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35850
- const { children: children , ...slotProps } = props;
35851
- if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
35852
- ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
35853
- ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
35854
- });
35855
- return Children.count(children) > 1 ? Children.only(null) : null;
35856
- });
35857
- $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
35858
- /* -------------------------------------------------------------------------------------------------
35859
- * Slottable
35860
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
35861
- return /*#__PURE__*/ createElement(Fragment, null, children);
35862
- };
35863
- /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
35864
- return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
35865
- }
35866
- function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
35867
- // all child props should override
35868
- const overrideProps = {
35869
- ...childProps
35870
- };
35871
- for(const propName in childProps){
35872
- const slotPropValue = slotProps[propName];
35873
- const childPropValue = childProps[propName];
35874
- const isHandler = /^on[A-Z]/.test(propName);
35875
- if (isHandler) {
35876
- // if the handler exists on both, we compose them
35877
- if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
35878
- childPropValue(...args);
35879
- slotPropValue(...args);
35880
- };
35881
- else if (slotPropValue) overrideProps[propName] = slotPropValue;
35882
- } else if (propName === 'style') overrideProps[propName] = {
35883
- ...slotPropValue,
35884
- ...childPropValue
35885
- };
35886
- else if (propName === 'className') overrideProps[propName] = [
35887
- slotPropValue,
35888
- childPropValue
35889
- ].filter(Boolean).join(' ');
35890
- }
35891
- return {
35892
- ...slotProps,
35893
- ...overrideProps
35894
- };
35895
- }
35896
-
35897
35797
  // We have resorted to returning slots directly rather than exposing primitives that can then
35898
35798
  // be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
35899
35799
  // This is because we encountered issues with generic types that cannot be statically analysed
35900
35800
  // due to creating them dynamically via createCollection.
35901
- function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
35801
+ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
35902
35802
  /* -----------------------------------------------------------------------------------------------
35903
35803
  * CollectionProvider
35904
35804
  * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
35905
- const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
35805
+ const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
35906
35806
  const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
35907
35807
  collectionRef: {
35908
35808
  current: null
@@ -35925,8 +35825,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
35925
35825
  const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
35926
35826
  const { scope: scope , children: children } = props;
35927
35827
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
35928
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
35929
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
35828
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
35829
+ return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
35930
35830
  ref: composedRefs
35931
35831
  }, children);
35932
35832
  });
@@ -35937,7 +35837,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
35937
35837
  const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
35938
35838
  const { scope: scope , children: children , ...itemData } = props;
35939
35839
  const ref = React__default.useRef(null);
35940
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
35840
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
35941
35841
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
35942
35842
  React__default.useEffect(()=>{
35943
35843
  context.itemMap.set(ref, {
@@ -35947,7 +35847,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
35947
35847
  return ()=>void context.itemMap.delete(ref)
35948
35848
  ;
35949
35849
  });
35950
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
35850
+ return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
35951
35851
  [ITEM_DATA_ATTR]: '',
35952
35852
  ref: composedRefs
35953
35853
  }, children);
@@ -35981,123 +35881,12 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1(name) {
35981
35881
  ];
35982
35882
  }
35983
35883
 
35984
- const $f631663db3294ace$var$DirectionContext$1 = /*#__PURE__*/ createContext(undefined);
35985
- /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3$1(localDir) {
35986
- const globalDir = useContext($f631663db3294ace$var$DirectionContext$1);
35884
+ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
35885
+ /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
35886
+ const globalDir = useContext($f631663db3294ace$var$DirectionContext);
35987
35887
  return localDir || globalDir || 'ltr';
35988
35888
  }
35989
35889
 
35990
- const $8927f6f2acc4f386$var$NODES = [
35991
- 'a',
35992
- 'button',
35993
- 'div',
35994
- 'h2',
35995
- 'h3',
35996
- 'img',
35997
- 'label',
35998
- 'li',
35999
- 'nav',
36000
- 'ol',
36001
- 'p',
36002
- 'span',
36003
- 'svg',
36004
- 'ul'
36005
- ]; // Temporary while we await merge of this fix:
36006
- // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
36007
- // prettier-ignore
36008
- /* -------------------------------------------------------------------------------------------------
36009
- * Primitive
36010
- * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
36011
- const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36012
- const { asChild: asChild , ...primitiveProps } = props;
36013
- const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
36014
- useEffect(()=>{
36015
- window[Symbol.for('radix-ui')] = true;
36016
- }, []);
36017
- return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
36018
- ref: forwardedRef
36019
- }));
36020
- });
36021
- Node.displayName = `Primitive.${node}`;
36022
- return {
36023
- ...primitive,
36024
- [node]: Node
36025
- };
36026
- }, {});
36027
- /* -------------------------------------------------------------------------------------------------
36028
- * Utils
36029
- * -----------------------------------------------------------------------------------------------*/ /**
36030
- * Flush custom event dispatch
36031
- * https://github.com/radix-ui/primitives/pull/1378
36032
- *
36033
- * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
36034
- *
36035
- * Internally, React prioritises events in the following order:
36036
- * - discrete
36037
- * - continuous
36038
- * - default
36039
- *
36040
- * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
36041
- *
36042
- * `discrete` is an important distinction as updates within these events are applied immediately.
36043
- * React however, is not able to infer the priority of custom event types due to how they are detected internally.
36044
- * Because of this, it's possible for updates from custom events to be unexpectedly batched when
36045
- * dispatched by another `discrete` event.
36046
- *
36047
- * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
36048
- * This utility should be used when dispatching a custom event from within another `discrete` event, this utility
36049
- * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
36050
- * For example:
36051
- *
36052
- * dispatching a known click 👎
36053
- * target.dispatchEvent(new Event(‘click’))
36054
- *
36055
- * dispatching a custom type within a non-discrete event 👎
36056
- * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
36057
- *
36058
- * dispatching a custom type within a `discrete` event 👍
36059
- * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
36060
- *
36061
- * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
36062
- * this utility with them. This is because it's possible for those handlers to be called implicitly during render
36063
- * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
36064
- */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
36065
- if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
36066
- );
36067
- }
36068
-
36069
- /**
36070
- * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
36071
- * prop or avoid re-executing effects when passed as a dependency
36072
- */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
36073
- const callbackRef = useRef(callback);
36074
- useEffect(()=>{
36075
- callbackRef.current = callback;
36076
- }); // https://github.com/facebook/react/issues/19240
36077
- return useMemo(()=>(...args)=>{
36078
- var _callbackRef$current;
36079
- return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
36080
- }
36081
- , []);
36082
- }
36083
-
36084
- /**
36085
- * Listens for when the escape key is down
36086
- */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
36087
- const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
36088
- useEffect(()=>{
36089
- const handleKeyDown = (event)=>{
36090
- if (event.key === 'Escape') onEscapeKeyDown(event);
36091
- };
36092
- ownerDocument.addEventListener('keydown', handleKeyDown);
36093
- return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
36094
- ;
36095
- }, [
36096
- onEscapeKeyDown,
36097
- ownerDocument
36098
- ]);
36099
- }
36100
-
36101
35890
  const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
36102
35891
  const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
36103
35892
  const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
@@ -36114,7 +35903,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
36114
35903
  const [node1, setNode] = useState(null);
36115
35904
  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;
36116
35905
  const [, force] = useState({});
36117
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
35906
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setNode(node)
36118
35907
  );
36119
35908
  const layers = Array.from(context.layers);
36120
35909
  const [highestLayerWithOutsidePointerEventsDisabled] = [
@@ -36198,15 +35987,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
36198
35987
  return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
36199
35988
  ;
36200
35989
  }, []);
36201
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
35990
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, layerProps, {
36202
35991
  ref: composedRefs,
36203
35992
  style: {
36204
35993
  pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
36205
35994
  ...props.style
36206
35995
  },
36207
- onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
36208
- onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
36209
- onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
35996
+ onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
35997
+ onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
35998
+ onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
36210
35999
  }));
36211
36000
  });
36212
36001
  /* -----------------------------------------------------------------------------------------------*/ /**
@@ -36214,7 +36003,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
36214
36003
  * to mimic layer dismissing behaviour present in OS.
36215
36004
  * Returns props to pass to the node we want to check for outside events.
36216
36005
  */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
36217
- const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
36006
+ const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPointerDownOutside);
36218
36007
  const isPointerInsideReactTreeRef = useRef(false);
36219
36008
  const handleClickRef = useRef(()=>{});
36220
36009
  useEffect(()=>{
@@ -36246,7 +36035,9 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
36246
36035
  once: true
36247
36036
  });
36248
36037
  } else handleAndDispatchPointerDownOutsideEvent();
36249
- }
36038
+ } else // We need to remove the event listener in case the outside click has been canceled.
36039
+ // See: https://github.com/radix-ui/primitives/issues/2171
36040
+ ownerDocument.removeEventListener('click', handleClickRef.current);
36250
36041
  isPointerInsideReactTreeRef.current = false;
36251
36042
  };
36252
36043
  /**
@@ -36282,7 +36073,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
36282
36073
  * Listens for when focus happens outside a react subtree.
36283
36074
  * Returns props to pass to the root (node) of the subtree we want to check.
36284
36075
  */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
36285
- const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
36076
+ const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onFocusOutside);
36286
36077
  const isFocusInsideReactTreeRef = useRef(false);
36287
36078
  useEffect(()=>{
36288
36079
  const handleFocus = (event)=>{
@@ -36326,32 +36117,6 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
36326
36117
  else target.dispatchEvent(event);
36327
36118
  }
36328
36119
 
36329
- /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
36330
- /**
36331
- * Injects a pair of focus guards at the edges of the whole DOM tree
36332
- * to ensure `focusin` & `focusout` events can be caught consistently.
36333
- */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
36334
- useEffect(()=>{
36335
- var _edgeGuards$, _edgeGuards$2;
36336
- const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
36337
- document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
36338
- document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
36339
- $3db38b7d1fb3fe6a$var$count++;
36340
- return ()=>{
36341
- if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
36342
- );
36343
- $3db38b7d1fb3fe6a$var$count--;
36344
- };
36345
- }, []);
36346
- }
36347
- function $3db38b7d1fb3fe6a$var$createFocusGuard() {
36348
- const element = document.createElement('span');
36349
- element.setAttribute('data-radix-focus-guard', '');
36350
- element.tabIndex = 0;
36351
- element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
36352
- return element;
36353
- }
36354
-
36355
36120
  const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
36356
36121
  const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
36357
36122
  const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
@@ -36361,10 +36126,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
36361
36126
  const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36362
36127
  const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
36363
36128
  const [container1, setContainer] = useState(null);
36364
- const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
36365
- const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
36129
+ const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
36130
+ const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onUnmountAutoFocusProp);
36366
36131
  const lastFocusedElementRef = useRef(null);
36367
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
36132
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContainer(node)
36368
36133
  );
36369
36134
  const focusScope = useRef({
36370
36135
  paused: false,
@@ -36387,15 +36152,40 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
36387
36152
  }
36388
36153
  function handleFocusOut(event) {
36389
36154
  if (focusScope.paused || !container1) return;
36390
- if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
36155
+ const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
36156
+ //
36157
+ // 1. When the user switches app/tabs/windows/the browser itself loses focus.
36158
+ // 2. In Google Chrome, when the focused element is removed from the DOM.
36159
+ //
36160
+ // We let the browser do its thing here because:
36161
+ //
36162
+ // 1. The browser already keeps a memory of what's focused for when the page gets refocused.
36163
+ // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
36164
+ // throws the CPU to 100%, so we avoid doing anything for this reason here too.
36165
+ if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
36166
+ // that is outside the container, we move focus to the last valid focused element inside.
36167
+ if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
36391
36168
  select: true
36392
36169
  });
36170
+ } // When the focused element gets removed from the DOM, browsers move focus
36171
+ // back to the document.body. In this case, we move focus to the container
36172
+ // to keep focus trapped correctly.
36173
+ function handleMutations(mutations) {
36174
+ const focusedElement = document.activeElement;
36175
+ if (focusedElement !== document.body) return;
36176
+ for (const mutation of mutations)if (mutation.removedNodes.length > 0) $d3863c46a17e8a28$var$focus(container1);
36393
36177
  }
36394
36178
  document.addEventListener('focusin', handleFocusIn);
36395
36179
  document.addEventListener('focusout', handleFocusOut);
36180
+ const mutationObserver = new MutationObserver(handleMutations);
36181
+ if (container1) mutationObserver.observe(container1, {
36182
+ childList: true,
36183
+ subtree: true
36184
+ });
36396
36185
  return ()=>{
36397
36186
  document.removeEventListener('focusin', handleFocusIn);
36398
36187
  document.removeEventListener('focusout', handleFocusOut);
36188
+ mutationObserver.disconnect();
36399
36189
  };
36400
36190
  }
36401
36191
  }, [
@@ -36472,7 +36262,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
36472
36262
  trapped,
36473
36263
  focusScope.paused
36474
36264
  ]);
36475
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
36265
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
36476
36266
  tabIndex: -1
36477
36267
  }, scopeProps, {
36478
36268
  ref: composedRefs,
@@ -36596,80 +36386,2163 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
36596
36386
  );
36597
36387
  }
36598
36388
 
36389
+ const sides = ['top', 'right', 'bottom', 'left'];
36390
+ const min = Math.min;
36391
+ const max = Math.max;
36392
+ const round = Math.round;
36393
+ const floor = Math.floor;
36394
+ const createCoords = v => ({
36395
+ x: v,
36396
+ y: v
36397
+ });
36398
+ const oppositeSideMap = {
36399
+ left: 'right',
36400
+ right: 'left',
36401
+ bottom: 'top',
36402
+ top: 'bottom'
36403
+ };
36404
+ const oppositeAlignmentMap = {
36405
+ start: 'end',
36406
+ end: 'start'
36407
+ };
36408
+ function clamp(start, value, end) {
36409
+ return max(start, min(value, end));
36410
+ }
36411
+ function evaluate(value, param) {
36412
+ return typeof value === 'function' ? value(param) : value;
36413
+ }
36414
+ function getSide(placement) {
36415
+ return placement.split('-')[0];
36416
+ }
36417
+ function getAlignment(placement) {
36418
+ return placement.split('-')[1];
36419
+ }
36420
+ function getOppositeAxis(axis) {
36421
+ return axis === 'x' ? 'y' : 'x';
36422
+ }
36423
+ function getAxisLength(axis) {
36424
+ return axis === 'y' ? 'height' : 'width';
36425
+ }
36426
+ function getSideAxis(placement) {
36427
+ return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';
36428
+ }
36429
+ function getAlignmentAxis(placement) {
36430
+ return getOppositeAxis(getSideAxis(placement));
36431
+ }
36432
+ function getAlignmentSides(placement, rects, rtl) {
36433
+ if (rtl === void 0) {
36434
+ rtl = false;
36435
+ }
36436
+ const alignment = getAlignment(placement);
36437
+ const alignmentAxis = getAlignmentAxis(placement);
36438
+ const length = getAxisLength(alignmentAxis);
36439
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
36440
+ if (rects.reference[length] > rects.floating[length]) {
36441
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
36442
+ }
36443
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
36444
+ }
36445
+ function getExpandedPlacements(placement) {
36446
+ const oppositePlacement = getOppositePlacement(placement);
36447
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
36448
+ }
36449
+ function getOppositeAlignmentPlacement(placement) {
36450
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
36451
+ }
36452
+ function getSideList(side, isStart, rtl) {
36453
+ const lr = ['left', 'right'];
36454
+ const rl = ['right', 'left'];
36455
+ const tb = ['top', 'bottom'];
36456
+ const bt = ['bottom', 'top'];
36457
+ switch (side) {
36458
+ case 'top':
36459
+ case 'bottom':
36460
+ if (rtl) return isStart ? rl : lr;
36461
+ return isStart ? lr : rl;
36462
+ case 'left':
36463
+ case 'right':
36464
+ return isStart ? tb : bt;
36465
+ default:
36466
+ return [];
36467
+ }
36468
+ }
36469
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
36470
+ const alignment = getAlignment(placement);
36471
+ let list = getSideList(getSide(placement), direction === 'start', rtl);
36472
+ if (alignment) {
36473
+ list = list.map(side => side + "-" + alignment);
36474
+ if (flipAlignment) {
36475
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
36476
+ }
36477
+ }
36478
+ return list;
36479
+ }
36480
+ function getOppositePlacement(placement) {
36481
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
36482
+ }
36483
+ function expandPaddingObject(padding) {
36484
+ return {
36485
+ top: 0,
36486
+ right: 0,
36487
+ bottom: 0,
36488
+ left: 0,
36489
+ ...padding
36490
+ };
36491
+ }
36492
+ function getPaddingObject(padding) {
36493
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
36494
+ top: padding,
36495
+ right: padding,
36496
+ bottom: padding,
36497
+ left: padding
36498
+ };
36499
+ }
36500
+ function rectToClientRect(rect) {
36501
+ return {
36502
+ ...rect,
36503
+ top: rect.y,
36504
+ left: rect.x,
36505
+ right: rect.x + rect.width,
36506
+ bottom: rect.y + rect.height
36507
+ };
36508
+ }
36509
+
36510
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
36511
+ let {
36512
+ reference,
36513
+ floating
36514
+ } = _ref;
36515
+ const sideAxis = getSideAxis(placement);
36516
+ const alignmentAxis = getAlignmentAxis(placement);
36517
+ const alignLength = getAxisLength(alignmentAxis);
36518
+ const side = getSide(placement);
36519
+ const isVertical = sideAxis === 'y';
36520
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
36521
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
36522
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
36523
+ let coords;
36524
+ switch (side) {
36525
+ case 'top':
36526
+ coords = {
36527
+ x: commonX,
36528
+ y: reference.y - floating.height
36529
+ };
36530
+ break;
36531
+ case 'bottom':
36532
+ coords = {
36533
+ x: commonX,
36534
+ y: reference.y + reference.height
36535
+ };
36536
+ break;
36537
+ case 'right':
36538
+ coords = {
36539
+ x: reference.x + reference.width,
36540
+ y: commonY
36541
+ };
36542
+ break;
36543
+ case 'left':
36544
+ coords = {
36545
+ x: reference.x - floating.width,
36546
+ y: commonY
36547
+ };
36548
+ break;
36549
+ default:
36550
+ coords = {
36551
+ x: reference.x,
36552
+ y: reference.y
36553
+ };
36554
+ }
36555
+ switch (getAlignment(placement)) {
36556
+ case 'start':
36557
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
36558
+ break;
36559
+ case 'end':
36560
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
36561
+ break;
36562
+ }
36563
+ return coords;
36564
+ }
36565
+
36599
36566
  /**
36600
- * On the server, React emits a warning when calling `useLayoutEffect`.
36601
- * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
36602
- * We use this safe version which suppresses the warning by replacing it with a noop on the server.
36567
+ * Computes the `x` and `y` coordinates that will place the floating element
36568
+ * next to a reference element when it is given a certain positioning strategy.
36603
36569
  *
36604
- * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
36605
- */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
36570
+ * This export does not have any `platform` interface logic. You will need to
36571
+ * write one for the platform you are using Floating UI with.
36572
+ */
36573
+ const computePosition$1 = async (reference, floating, config) => {
36574
+ const {
36575
+ placement = 'bottom',
36576
+ strategy = 'absolute',
36577
+ middleware = [],
36578
+ platform
36579
+ } = config;
36580
+ const validMiddleware = middleware.filter(Boolean);
36581
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
36582
+ let rects = await platform.getElementRects({
36583
+ reference,
36584
+ floating,
36585
+ strategy
36586
+ });
36587
+ let {
36588
+ x,
36589
+ y
36590
+ } = computeCoordsFromPlacement(rects, placement, rtl);
36591
+ let statefulPlacement = placement;
36592
+ let middlewareData = {};
36593
+ let resetCount = 0;
36594
+ for (let i = 0; i < validMiddleware.length; i++) {
36595
+ const {
36596
+ name,
36597
+ fn
36598
+ } = validMiddleware[i];
36599
+ const {
36600
+ x: nextX,
36601
+ y: nextY,
36602
+ data,
36603
+ reset
36604
+ } = await fn({
36605
+ x,
36606
+ y,
36607
+ initialPlacement: placement,
36608
+ placement: statefulPlacement,
36609
+ strategy,
36610
+ middlewareData,
36611
+ rects,
36612
+ platform,
36613
+ elements: {
36614
+ reference,
36615
+ floating
36616
+ }
36617
+ });
36618
+ x = nextX != null ? nextX : x;
36619
+ y = nextY != null ? nextY : y;
36620
+ middlewareData = {
36621
+ ...middlewareData,
36622
+ [name]: {
36623
+ ...middlewareData[name],
36624
+ ...data
36625
+ }
36626
+ };
36627
+ if (reset && resetCount <= 50) {
36628
+ resetCount++;
36629
+ if (typeof reset === 'object') {
36630
+ if (reset.placement) {
36631
+ statefulPlacement = reset.placement;
36632
+ }
36633
+ if (reset.rects) {
36634
+ rects = reset.rects === true ? await platform.getElementRects({
36635
+ reference,
36636
+ floating,
36637
+ strategy
36638
+ }) : reset.rects;
36639
+ }
36640
+ ({
36641
+ x,
36642
+ y
36643
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
36644
+ }
36645
+ i = -1;
36646
+ continue;
36647
+ }
36648
+ }
36649
+ return {
36650
+ x,
36651
+ y,
36652
+ placement: statefulPlacement,
36653
+ strategy,
36654
+ middlewareData
36655
+ };
36656
+ };
36606
36657
 
36607
- const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
36608
- );
36609
- let $1746a345f3d73bb7$var$count = 0;
36610
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
36611
- const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
36612
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
36613
- if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
36614
- );
36615
- }, [
36616
- deterministicId
36617
- ]);
36618
- return deterministicId || (id ? `radix-${id}` : '');
36658
+ /**
36659
+ * Resolves with an object of overflow side offsets that determine how much the
36660
+ * element is overflowing a given clipping boundary on each side.
36661
+ * - positive = overflowing the boundary by that number of pixels
36662
+ * - negative = how many pixels left before it will overflow
36663
+ * - 0 = lies flush with the boundary
36664
+ * @see https://floating-ui.com/docs/detectOverflow
36665
+ */
36666
+ async function detectOverflow(state, options) {
36667
+ var _await$platform$isEle;
36668
+ if (options === void 0) {
36669
+ options = {};
36670
+ }
36671
+ const {
36672
+ x,
36673
+ y,
36674
+ platform,
36675
+ rects,
36676
+ elements,
36677
+ strategy
36678
+ } = state;
36679
+ const {
36680
+ boundary = 'clippingAncestors',
36681
+ rootBoundary = 'viewport',
36682
+ elementContext = 'floating',
36683
+ altBoundary = false,
36684
+ padding = 0
36685
+ } = evaluate(options, state);
36686
+ const paddingObject = getPaddingObject(padding);
36687
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
36688
+ const element = elements[altBoundary ? altContext : elementContext];
36689
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
36690
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
36691
+ boundary,
36692
+ rootBoundary,
36693
+ strategy
36694
+ }));
36695
+ const rect = elementContext === 'floating' ? {
36696
+ ...rects.floating,
36697
+ x,
36698
+ y
36699
+ } : rects.reference;
36700
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
36701
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
36702
+ x: 1,
36703
+ y: 1
36704
+ } : {
36705
+ x: 1,
36706
+ y: 1
36707
+ };
36708
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
36709
+ rect,
36710
+ offsetParent,
36711
+ strategy
36712
+ }) : rect);
36713
+ return {
36714
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
36715
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
36716
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
36717
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
36718
+ };
36619
36719
  }
36620
36720
 
36621
- const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36622
- var _globalThis$document;
36623
- const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
36624
- return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
36625
- ref: forwardedRef
36626
- })), container) : null;
36721
+ /**
36722
+ * Provides data to position an inner element of the floating element so that it
36723
+ * appears centered to the reference element.
36724
+ * @see https://floating-ui.com/docs/arrow
36725
+ */
36726
+ const arrow$1 = options => ({
36727
+ name: 'arrow',
36728
+ options,
36729
+ async fn(state) {
36730
+ const {
36731
+ x,
36732
+ y,
36733
+ placement,
36734
+ rects,
36735
+ platform,
36736
+ elements,
36737
+ middlewareData
36738
+ } = state;
36739
+ // Since `element` is required, we don't Partial<> the type.
36740
+ const {
36741
+ element,
36742
+ padding = 0
36743
+ } = evaluate(options, state) || {};
36744
+ if (element == null) {
36745
+ return {};
36746
+ }
36747
+ const paddingObject = getPaddingObject(padding);
36748
+ const coords = {
36749
+ x,
36750
+ y
36751
+ };
36752
+ const axis = getAlignmentAxis(placement);
36753
+ const length = getAxisLength(axis);
36754
+ const arrowDimensions = await platform.getDimensions(element);
36755
+ const isYAxis = axis === 'y';
36756
+ const minProp = isYAxis ? 'top' : 'left';
36757
+ const maxProp = isYAxis ? 'bottom' : 'right';
36758
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
36759
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
36760
+ const startDiff = coords[axis] - rects.reference[axis];
36761
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
36762
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
36763
+
36764
+ // DOM platform can return `window` as the `offsetParent`.
36765
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
36766
+ clientSize = elements.floating[clientProp] || rects.floating[length];
36767
+ }
36768
+ const centerToReference = endDiff / 2 - startDiff / 2;
36769
+
36770
+ // If the padding is large enough that it causes the arrow to no longer be
36771
+ // centered, modify the padding so that it is centered.
36772
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
36773
+ const minPadding = min(paddingObject[minProp], largestPossiblePadding);
36774
+ const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
36775
+
36776
+ // Make sure the arrow doesn't overflow the floating element if the center
36777
+ // point is outside the floating element's bounds.
36778
+ const min$1 = minPadding;
36779
+ const max = clientSize - arrowDimensions[length] - maxPadding;
36780
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
36781
+ const offset = clamp(min$1, center, max);
36782
+
36783
+ // If the reference is small enough that the arrow's padding causes it to
36784
+ // to point to nothing for an aligned placement, adjust the offset of the
36785
+ // floating element itself. To ensure `shift()` continues to take action,
36786
+ // a single reset is performed when this is true.
36787
+ const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
36788
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;
36789
+ return {
36790
+ [axis]: coords[axis] + alignmentOffset,
36791
+ data: {
36792
+ [axis]: offset,
36793
+ centerOffset: center - offset - alignmentOffset,
36794
+ ...(shouldAddOffset && {
36795
+ alignmentOffset
36796
+ })
36797
+ },
36798
+ reset: shouldAddOffset
36799
+ };
36800
+ }
36627
36801
  });
36628
36802
 
36629
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
36630
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
36631
- defaultProp: defaultProp,
36632
- onChange: onChange
36803
+ /**
36804
+ * Optimizes the visibility of the floating element by flipping the `placement`
36805
+ * in order to keep it in view when the preferred placement(s) will overflow the
36806
+ * clipping boundary. Alternative to `autoPlacement`.
36807
+ * @see https://floating-ui.com/docs/flip
36808
+ */
36809
+ const flip = function (options) {
36810
+ if (options === void 0) {
36811
+ options = {};
36812
+ }
36813
+ return {
36814
+ name: 'flip',
36815
+ options,
36816
+ async fn(state) {
36817
+ var _middlewareData$arrow, _middlewareData$flip;
36818
+ const {
36819
+ placement,
36820
+ middlewareData,
36821
+ rects,
36822
+ initialPlacement,
36823
+ platform,
36824
+ elements
36825
+ } = state;
36826
+ const {
36827
+ mainAxis: checkMainAxis = true,
36828
+ crossAxis: checkCrossAxis = true,
36829
+ fallbackPlacements: specifiedFallbackPlacements,
36830
+ fallbackStrategy = 'bestFit',
36831
+ fallbackAxisSideDirection = 'none',
36832
+ flipAlignment = true,
36833
+ ...detectOverflowOptions
36834
+ } = evaluate(options, state);
36835
+
36836
+ // If a reset by the arrow was caused due to an alignment offset being
36837
+ // added, we should skip any logic now since `flip()` has already done its
36838
+ // work.
36839
+ // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
36840
+ if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
36841
+ return {};
36842
+ }
36843
+ const side = getSide(placement);
36844
+ const isBasePlacement = getSide(initialPlacement) === initialPlacement;
36845
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
36846
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
36847
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
36848
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
36849
+ }
36850
+ const placements = [initialPlacement, ...fallbackPlacements];
36851
+ const overflow = await detectOverflow(state, detectOverflowOptions);
36852
+ const overflows = [];
36853
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
36854
+ if (checkMainAxis) {
36855
+ overflows.push(overflow[side]);
36856
+ }
36857
+ if (checkCrossAxis) {
36858
+ const sides = getAlignmentSides(placement, rects, rtl);
36859
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
36860
+ }
36861
+ overflowsData = [...overflowsData, {
36862
+ placement,
36863
+ overflows
36864
+ }];
36865
+
36866
+ // One or more sides is overflowing.
36867
+ if (!overflows.every(side => side <= 0)) {
36868
+ var _middlewareData$flip2, _overflowsData$filter;
36869
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
36870
+ const nextPlacement = placements[nextIndex];
36871
+ if (nextPlacement) {
36872
+ // Try next placement and re-run the lifecycle.
36873
+ return {
36874
+ data: {
36875
+ index: nextIndex,
36876
+ overflows: overflowsData
36877
+ },
36878
+ reset: {
36879
+ placement: nextPlacement
36880
+ }
36881
+ };
36882
+ }
36883
+
36884
+ // First, find the candidates that fit on the mainAxis side of overflow,
36885
+ // then find the placement that fits the best on the main crossAxis side.
36886
+ 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;
36887
+
36888
+ // Otherwise fallback.
36889
+ if (!resetPlacement) {
36890
+ switch (fallbackStrategy) {
36891
+ case 'bestFit':
36892
+ {
36893
+ var _overflowsData$map$so;
36894
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
36895
+ if (placement) {
36896
+ resetPlacement = placement;
36897
+ }
36898
+ break;
36899
+ }
36900
+ case 'initialPlacement':
36901
+ resetPlacement = initialPlacement;
36902
+ break;
36903
+ }
36904
+ }
36905
+ if (placement !== resetPlacement) {
36906
+ return {
36907
+ reset: {
36908
+ placement: resetPlacement
36909
+ }
36910
+ };
36911
+ }
36912
+ }
36913
+ return {};
36914
+ }
36915
+ };
36916
+ };
36917
+
36918
+ function getSideOffsets(overflow, rect) {
36919
+ return {
36920
+ top: overflow.top - rect.height,
36921
+ right: overflow.right - rect.width,
36922
+ bottom: overflow.bottom - rect.height,
36923
+ left: overflow.left - rect.width
36924
+ };
36925
+ }
36926
+ function isAnySideFullyClipped(overflow) {
36927
+ return sides.some(side => overflow[side] >= 0);
36928
+ }
36929
+ /**
36930
+ * Provides data to hide the floating element in applicable situations, such as
36931
+ * when it is not in the same clipping context as the reference element.
36932
+ * @see https://floating-ui.com/docs/hide
36933
+ */
36934
+ const hide = function (options) {
36935
+ if (options === void 0) {
36936
+ options = {};
36937
+ }
36938
+ return {
36939
+ name: 'hide',
36940
+ options,
36941
+ async fn(state) {
36942
+ const {
36943
+ rects
36944
+ } = state;
36945
+ const {
36946
+ strategy = 'referenceHidden',
36947
+ ...detectOverflowOptions
36948
+ } = evaluate(options, state);
36949
+ switch (strategy) {
36950
+ case 'referenceHidden':
36951
+ {
36952
+ const overflow = await detectOverflow(state, {
36953
+ ...detectOverflowOptions,
36954
+ elementContext: 'reference'
36955
+ });
36956
+ const offsets = getSideOffsets(overflow, rects.reference);
36957
+ return {
36958
+ data: {
36959
+ referenceHiddenOffsets: offsets,
36960
+ referenceHidden: isAnySideFullyClipped(offsets)
36961
+ }
36962
+ };
36963
+ }
36964
+ case 'escaped':
36965
+ {
36966
+ const overflow = await detectOverflow(state, {
36967
+ ...detectOverflowOptions,
36968
+ altBoundary: true
36969
+ });
36970
+ const offsets = getSideOffsets(overflow, rects.floating);
36971
+ return {
36972
+ data: {
36973
+ escapedOffsets: offsets,
36974
+ escaped: isAnySideFullyClipped(offsets)
36975
+ }
36976
+ };
36977
+ }
36978
+ default:
36979
+ {
36980
+ return {};
36981
+ }
36982
+ }
36983
+ }
36984
+ };
36985
+ };
36986
+
36987
+ // For type backwards-compatibility, the `OffsetOptions` type was also
36988
+ // Derivable.
36989
+ async function convertValueToCoords(state, options) {
36990
+ const {
36991
+ placement,
36992
+ platform,
36993
+ elements
36994
+ } = state;
36995
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
36996
+ const side = getSide(placement);
36997
+ const alignment = getAlignment(placement);
36998
+ const isVertical = getSideAxis(placement) === 'y';
36999
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
37000
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
37001
+ const rawValue = evaluate(options, state);
37002
+
37003
+ // eslint-disable-next-line prefer-const
37004
+ let {
37005
+ mainAxis,
37006
+ crossAxis,
37007
+ alignmentAxis
37008
+ } = typeof rawValue === 'number' ? {
37009
+ mainAxis: rawValue,
37010
+ crossAxis: 0,
37011
+ alignmentAxis: null
37012
+ } : {
37013
+ mainAxis: 0,
37014
+ crossAxis: 0,
37015
+ alignmentAxis: null,
37016
+ ...rawValue
37017
+ };
37018
+ if (alignment && typeof alignmentAxis === 'number') {
37019
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
37020
+ }
37021
+ return isVertical ? {
37022
+ x: crossAxis * crossAxisMulti,
37023
+ y: mainAxis * mainAxisMulti
37024
+ } : {
37025
+ x: mainAxis * mainAxisMulti,
37026
+ y: crossAxis * crossAxisMulti
37027
+ };
37028
+ }
37029
+
37030
+ /**
37031
+ * Modifies the placement by translating the floating element along the
37032
+ * specified axes.
37033
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
37034
+ * object may be passed.
37035
+ * @see https://floating-ui.com/docs/offset
37036
+ */
37037
+ const offset = function (options) {
37038
+ if (options === void 0) {
37039
+ options = 0;
37040
+ }
37041
+ return {
37042
+ name: 'offset',
37043
+ options,
37044
+ async fn(state) {
37045
+ const {
37046
+ x,
37047
+ y
37048
+ } = state;
37049
+ const diffCoords = await convertValueToCoords(state, options);
37050
+ return {
37051
+ x: x + diffCoords.x,
37052
+ y: y + diffCoords.y,
37053
+ data: diffCoords
37054
+ };
37055
+ }
37056
+ };
37057
+ };
37058
+
37059
+ /**
37060
+ * Optimizes the visibility of the floating element by shifting it in order to
37061
+ * keep it in view when it will overflow the clipping boundary.
37062
+ * @see https://floating-ui.com/docs/shift
37063
+ */
37064
+ const shift = function (options) {
37065
+ if (options === void 0) {
37066
+ options = {};
37067
+ }
37068
+ return {
37069
+ name: 'shift',
37070
+ options,
37071
+ async fn(state) {
37072
+ const {
37073
+ x,
37074
+ y,
37075
+ placement
37076
+ } = state;
37077
+ const {
37078
+ mainAxis: checkMainAxis = true,
37079
+ crossAxis: checkCrossAxis = false,
37080
+ limiter = {
37081
+ fn: _ref => {
37082
+ let {
37083
+ x,
37084
+ y
37085
+ } = _ref;
37086
+ return {
37087
+ x,
37088
+ y
37089
+ };
37090
+ }
37091
+ },
37092
+ ...detectOverflowOptions
37093
+ } = evaluate(options, state);
37094
+ const coords = {
37095
+ x,
37096
+ y
37097
+ };
37098
+ const overflow = await detectOverflow(state, detectOverflowOptions);
37099
+ const crossAxis = getSideAxis(getSide(placement));
37100
+ const mainAxis = getOppositeAxis(crossAxis);
37101
+ let mainAxisCoord = coords[mainAxis];
37102
+ let crossAxisCoord = coords[crossAxis];
37103
+ if (checkMainAxis) {
37104
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
37105
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
37106
+ const min = mainAxisCoord + overflow[minSide];
37107
+ const max = mainAxisCoord - overflow[maxSide];
37108
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
37109
+ }
37110
+ if (checkCrossAxis) {
37111
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
37112
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
37113
+ const min = crossAxisCoord + overflow[minSide];
37114
+ const max = crossAxisCoord - overflow[maxSide];
37115
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
37116
+ }
37117
+ const limitedCoords = limiter.fn({
37118
+ ...state,
37119
+ [mainAxis]: mainAxisCoord,
37120
+ [crossAxis]: crossAxisCoord
37121
+ });
37122
+ return {
37123
+ ...limitedCoords,
37124
+ data: {
37125
+ x: limitedCoords.x - x,
37126
+ y: limitedCoords.y - y
37127
+ }
37128
+ };
37129
+ }
37130
+ };
37131
+ };
37132
+ /**
37133
+ * Built-in `limiter` that will stop `shift()` at a certain point.
37134
+ */
37135
+ const limitShift = function (options) {
37136
+ if (options === void 0) {
37137
+ options = {};
37138
+ }
37139
+ return {
37140
+ options,
37141
+ fn(state) {
37142
+ const {
37143
+ x,
37144
+ y,
37145
+ placement,
37146
+ rects,
37147
+ middlewareData
37148
+ } = state;
37149
+ const {
37150
+ offset = 0,
37151
+ mainAxis: checkMainAxis = true,
37152
+ crossAxis: checkCrossAxis = true
37153
+ } = evaluate(options, state);
37154
+ const coords = {
37155
+ x,
37156
+ y
37157
+ };
37158
+ const crossAxis = getSideAxis(placement);
37159
+ const mainAxis = getOppositeAxis(crossAxis);
37160
+ let mainAxisCoord = coords[mainAxis];
37161
+ let crossAxisCoord = coords[crossAxis];
37162
+ const rawOffset = evaluate(offset, state);
37163
+ const computedOffset = typeof rawOffset === 'number' ? {
37164
+ mainAxis: rawOffset,
37165
+ crossAxis: 0
37166
+ } : {
37167
+ mainAxis: 0,
37168
+ crossAxis: 0,
37169
+ ...rawOffset
37170
+ };
37171
+ if (checkMainAxis) {
37172
+ const len = mainAxis === 'y' ? 'height' : 'width';
37173
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
37174
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
37175
+ if (mainAxisCoord < limitMin) {
37176
+ mainAxisCoord = limitMin;
37177
+ } else if (mainAxisCoord > limitMax) {
37178
+ mainAxisCoord = limitMax;
37179
+ }
37180
+ }
37181
+ if (checkCrossAxis) {
37182
+ var _middlewareData$offse, _middlewareData$offse2;
37183
+ const len = mainAxis === 'y' ? 'width' : 'height';
37184
+ const isOriginSide = ['top', 'left'].includes(getSide(placement));
37185
+ 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);
37186
+ 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);
37187
+ if (crossAxisCoord < limitMin) {
37188
+ crossAxisCoord = limitMin;
37189
+ } else if (crossAxisCoord > limitMax) {
37190
+ crossAxisCoord = limitMax;
37191
+ }
37192
+ }
37193
+ return {
37194
+ [mainAxis]: mainAxisCoord,
37195
+ [crossAxis]: crossAxisCoord
37196
+ };
37197
+ }
37198
+ };
37199
+ };
37200
+
37201
+ /**
37202
+ * Provides data that allows you to change the size of the floating element —
37203
+ * for instance, prevent it from overflowing the clipping boundary or match the
37204
+ * width of the reference element.
37205
+ * @see https://floating-ui.com/docs/size
37206
+ */
37207
+ const size = function (options) {
37208
+ if (options === void 0) {
37209
+ options = {};
37210
+ }
37211
+ return {
37212
+ name: 'size',
37213
+ options,
37214
+ async fn(state) {
37215
+ const {
37216
+ placement,
37217
+ rects,
37218
+ platform,
37219
+ elements
37220
+ } = state;
37221
+ const {
37222
+ apply = () => {},
37223
+ ...detectOverflowOptions
37224
+ } = evaluate(options, state);
37225
+ const overflow = await detectOverflow(state, detectOverflowOptions);
37226
+ const side = getSide(placement);
37227
+ const alignment = getAlignment(placement);
37228
+ const isYAxis = getSideAxis(placement) === 'y';
37229
+ const {
37230
+ width,
37231
+ height
37232
+ } = rects.floating;
37233
+ let heightSide;
37234
+ let widthSide;
37235
+ if (side === 'top' || side === 'bottom') {
37236
+ heightSide = side;
37237
+ widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
37238
+ } else {
37239
+ widthSide = side;
37240
+ heightSide = alignment === 'end' ? 'top' : 'bottom';
37241
+ }
37242
+ const overflowAvailableHeight = height - overflow[heightSide];
37243
+ const overflowAvailableWidth = width - overflow[widthSide];
37244
+ const noShift = !state.middlewareData.shift;
37245
+ let availableHeight = overflowAvailableHeight;
37246
+ let availableWidth = overflowAvailableWidth;
37247
+ if (isYAxis) {
37248
+ const maximumClippingWidth = width - overflow.left - overflow.right;
37249
+ availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
37250
+ } else {
37251
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
37252
+ availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
37253
+ }
37254
+ if (noShift && !alignment) {
37255
+ const xMin = max(overflow.left, 0);
37256
+ const xMax = max(overflow.right, 0);
37257
+ const yMin = max(overflow.top, 0);
37258
+ const yMax = max(overflow.bottom, 0);
37259
+ if (isYAxis) {
37260
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
37261
+ } else {
37262
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
37263
+ }
37264
+ }
37265
+ await apply({
37266
+ ...state,
37267
+ availableWidth,
37268
+ availableHeight
37269
+ });
37270
+ const nextDimensions = await platform.getDimensions(elements.floating);
37271
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
37272
+ return {
37273
+ reset: {
37274
+ rects: true
37275
+ }
37276
+ };
37277
+ }
37278
+ return {};
37279
+ }
37280
+ };
37281
+ };
37282
+
37283
+ function getNodeName(node) {
37284
+ if (isNode(node)) {
37285
+ return (node.nodeName || '').toLowerCase();
37286
+ }
37287
+ // Mocked nodes in testing environments may not be instances of Node. By
37288
+ // returning `#document` an infinite loop won't occur.
37289
+ // https://github.com/floating-ui/floating-ui/issues/2317
37290
+ return '#document';
37291
+ }
37292
+ function getWindow(node) {
37293
+ var _node$ownerDocument;
37294
+ return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
37295
+ }
37296
+ function getDocumentElement(node) {
37297
+ var _ref;
37298
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
37299
+ }
37300
+ function isNode(value) {
37301
+ return value instanceof Node || value instanceof getWindow(value).Node;
37302
+ }
37303
+ function isElement(value) {
37304
+ return value instanceof Element || value instanceof getWindow(value).Element;
37305
+ }
37306
+ function isHTMLElement(value) {
37307
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
37308
+ }
37309
+ function isShadowRoot(value) {
37310
+ // Browsers without `ShadowRoot` support.
37311
+ if (typeof ShadowRoot === 'undefined') {
37312
+ return false;
37313
+ }
37314
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
37315
+ }
37316
+ function isOverflowElement(element) {
37317
+ const {
37318
+ overflow,
37319
+ overflowX,
37320
+ overflowY,
37321
+ display
37322
+ } = getComputedStyle$1(element);
37323
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
37324
+ }
37325
+ function isTableElement(element) {
37326
+ return ['table', 'td', 'th'].includes(getNodeName(element));
37327
+ }
37328
+ function isContainingBlock(element) {
37329
+ const webkit = isWebKit();
37330
+ const css = getComputedStyle$1(element);
37331
+
37332
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
37333
+ 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));
37334
+ }
37335
+ function getContainingBlock(element) {
37336
+ let currentNode = getParentNode(element);
37337
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
37338
+ if (isContainingBlock(currentNode)) {
37339
+ return currentNode;
37340
+ } else {
37341
+ currentNode = getParentNode(currentNode);
37342
+ }
37343
+ }
37344
+ return null;
37345
+ }
37346
+ function isWebKit() {
37347
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
37348
+ return CSS.supports('-webkit-backdrop-filter', 'none');
37349
+ }
37350
+ function isLastTraversableNode(node) {
37351
+ return ['html', 'body', '#document'].includes(getNodeName(node));
37352
+ }
37353
+ function getComputedStyle$1(element) {
37354
+ return getWindow(element).getComputedStyle(element);
37355
+ }
37356
+ function getNodeScroll(element) {
37357
+ if (isElement(element)) {
37358
+ return {
37359
+ scrollLeft: element.scrollLeft,
37360
+ scrollTop: element.scrollTop
37361
+ };
37362
+ }
37363
+ return {
37364
+ scrollLeft: element.pageXOffset,
37365
+ scrollTop: element.pageYOffset
37366
+ };
37367
+ }
37368
+ function getParentNode(node) {
37369
+ if (getNodeName(node) === 'html') {
37370
+ return node;
37371
+ }
37372
+ const result =
37373
+ // Step into the shadow DOM of the parent of a slotted node.
37374
+ node.assignedSlot ||
37375
+ // DOM Element detected.
37376
+ node.parentNode ||
37377
+ // ShadowRoot detected.
37378
+ isShadowRoot(node) && node.host ||
37379
+ // Fallback.
37380
+ getDocumentElement(node);
37381
+ return isShadowRoot(result) ? result.host : result;
37382
+ }
37383
+ function getNearestOverflowAncestor(node) {
37384
+ const parentNode = getParentNode(node);
37385
+ if (isLastTraversableNode(parentNode)) {
37386
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
37387
+ }
37388
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
37389
+ return parentNode;
37390
+ }
37391
+ return getNearestOverflowAncestor(parentNode);
37392
+ }
37393
+ function getOverflowAncestors(node, list, traverseIframes) {
37394
+ var _node$ownerDocument2;
37395
+ if (list === void 0) {
37396
+ list = [];
37397
+ }
37398
+ if (traverseIframes === void 0) {
37399
+ traverseIframes = true;
37400
+ }
37401
+ const scrollableAncestor = getNearestOverflowAncestor(node);
37402
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
37403
+ const win = getWindow(scrollableAncestor);
37404
+ if (isBody) {
37405
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
37406
+ }
37407
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
37408
+ }
37409
+
37410
+ function getCssDimensions(element) {
37411
+ const css = getComputedStyle$1(element);
37412
+ // In testing environments, the `width` and `height` properties are empty
37413
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
37414
+ let width = parseFloat(css.width) || 0;
37415
+ let height = parseFloat(css.height) || 0;
37416
+ const hasOffset = isHTMLElement(element);
37417
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
37418
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
37419
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
37420
+ if (shouldFallback) {
37421
+ width = offsetWidth;
37422
+ height = offsetHeight;
37423
+ }
37424
+ return {
37425
+ width,
37426
+ height,
37427
+ $: shouldFallback
37428
+ };
37429
+ }
37430
+
37431
+ function unwrapElement(element) {
37432
+ return !isElement(element) ? element.contextElement : element;
37433
+ }
37434
+
37435
+ function getScale(element) {
37436
+ const domElement = unwrapElement(element);
37437
+ if (!isHTMLElement(domElement)) {
37438
+ return createCoords(1);
37439
+ }
37440
+ const rect = domElement.getBoundingClientRect();
37441
+ const {
37442
+ width,
37443
+ height,
37444
+ $
37445
+ } = getCssDimensions(domElement);
37446
+ let x = ($ ? round(rect.width) : rect.width) / width;
37447
+ let y = ($ ? round(rect.height) : rect.height) / height;
37448
+
37449
+ // 0, NaN, or Infinity should always fallback to 1.
37450
+
37451
+ if (!x || !Number.isFinite(x)) {
37452
+ x = 1;
37453
+ }
37454
+ if (!y || !Number.isFinite(y)) {
37455
+ y = 1;
37456
+ }
37457
+ return {
37458
+ x,
37459
+ y
37460
+ };
37461
+ }
37462
+
37463
+ const noOffsets = /*#__PURE__*/createCoords(0);
37464
+ function getVisualOffsets(element) {
37465
+ const win = getWindow(element);
37466
+ if (!isWebKit() || !win.visualViewport) {
37467
+ return noOffsets;
37468
+ }
37469
+ return {
37470
+ x: win.visualViewport.offsetLeft,
37471
+ y: win.visualViewport.offsetTop
37472
+ };
37473
+ }
37474
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
37475
+ if (isFixed === void 0) {
37476
+ isFixed = false;
37477
+ }
37478
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
37479
+ return false;
37480
+ }
37481
+ return isFixed;
37482
+ }
37483
+
37484
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
37485
+ if (includeScale === void 0) {
37486
+ includeScale = false;
37487
+ }
37488
+ if (isFixedStrategy === void 0) {
37489
+ isFixedStrategy = false;
37490
+ }
37491
+ const clientRect = element.getBoundingClientRect();
37492
+ const domElement = unwrapElement(element);
37493
+ let scale = createCoords(1);
37494
+ if (includeScale) {
37495
+ if (offsetParent) {
37496
+ if (isElement(offsetParent)) {
37497
+ scale = getScale(offsetParent);
37498
+ }
37499
+ } else {
37500
+ scale = getScale(element);
37501
+ }
37502
+ }
37503
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
37504
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
37505
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
37506
+ let width = clientRect.width / scale.x;
37507
+ let height = clientRect.height / scale.y;
37508
+ if (domElement) {
37509
+ const win = getWindow(domElement);
37510
+ const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
37511
+ let currentIFrame = win.frameElement;
37512
+ while (currentIFrame && offsetParent && offsetWin !== win) {
37513
+ const iframeScale = getScale(currentIFrame);
37514
+ const iframeRect = currentIFrame.getBoundingClientRect();
37515
+ const css = getComputedStyle$1(currentIFrame);
37516
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
37517
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
37518
+ x *= iframeScale.x;
37519
+ y *= iframeScale.y;
37520
+ width *= iframeScale.x;
37521
+ height *= iframeScale.y;
37522
+ x += left;
37523
+ y += top;
37524
+ currentIFrame = getWindow(currentIFrame).frameElement;
37525
+ }
37526
+ }
37527
+ return rectToClientRect({
37528
+ width,
37529
+ height,
37530
+ x,
37531
+ y
37532
+ });
37533
+ }
37534
+
37535
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
37536
+ let {
37537
+ rect,
37538
+ offsetParent,
37539
+ strategy
37540
+ } = _ref;
37541
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
37542
+ const documentElement = getDocumentElement(offsetParent);
37543
+ if (offsetParent === documentElement) {
37544
+ return rect;
37545
+ }
37546
+ let scroll = {
37547
+ scrollLeft: 0,
37548
+ scrollTop: 0
37549
+ };
37550
+ let scale = createCoords(1);
37551
+ const offsets = createCoords(0);
37552
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
37553
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
37554
+ scroll = getNodeScroll(offsetParent);
37555
+ }
37556
+ if (isHTMLElement(offsetParent)) {
37557
+ const offsetRect = getBoundingClientRect(offsetParent);
37558
+ scale = getScale(offsetParent);
37559
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
37560
+ offsets.y = offsetRect.y + offsetParent.clientTop;
37561
+ }
37562
+ }
37563
+ return {
37564
+ width: rect.width * scale.x,
37565
+ height: rect.height * scale.y,
37566
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
37567
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
37568
+ };
37569
+ }
37570
+
37571
+ function getClientRects(element) {
37572
+ return Array.from(element.getClientRects());
37573
+ }
37574
+
37575
+ function getWindowScrollBarX(element) {
37576
+ // If <html> has a CSS width greater than the viewport, then this will be
37577
+ // incorrect for RTL.
37578
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
37579
+ }
37580
+
37581
+ // Gets the entire size of the scrollable document area, even extending outside
37582
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
37583
+ function getDocumentRect(element) {
37584
+ const html = getDocumentElement(element);
37585
+ const scroll = getNodeScroll(element);
37586
+ const body = element.ownerDocument.body;
37587
+ const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
37588
+ const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
37589
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
37590
+ const y = -scroll.scrollTop;
37591
+ if (getComputedStyle$1(body).direction === 'rtl') {
37592
+ x += max(html.clientWidth, body.clientWidth) - width;
37593
+ }
37594
+ return {
37595
+ width,
37596
+ height,
37597
+ x,
37598
+ y
37599
+ };
37600
+ }
37601
+
37602
+ function getViewportRect(element, strategy) {
37603
+ const win = getWindow(element);
37604
+ const html = getDocumentElement(element);
37605
+ const visualViewport = win.visualViewport;
37606
+ let width = html.clientWidth;
37607
+ let height = html.clientHeight;
37608
+ let x = 0;
37609
+ let y = 0;
37610
+ if (visualViewport) {
37611
+ width = visualViewport.width;
37612
+ height = visualViewport.height;
37613
+ const visualViewportBased = isWebKit();
37614
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
37615
+ x = visualViewport.offsetLeft;
37616
+ y = visualViewport.offsetTop;
37617
+ }
37618
+ }
37619
+ return {
37620
+ width,
37621
+ height,
37622
+ x,
37623
+ y
37624
+ };
37625
+ }
37626
+
37627
+ // Returns the inner client rect, subtracting scrollbars if present.
37628
+ function getInnerBoundingClientRect(element, strategy) {
37629
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
37630
+ const top = clientRect.top + element.clientTop;
37631
+ const left = clientRect.left + element.clientLeft;
37632
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
37633
+ const width = element.clientWidth * scale.x;
37634
+ const height = element.clientHeight * scale.y;
37635
+ const x = left * scale.x;
37636
+ const y = top * scale.y;
37637
+ return {
37638
+ width,
37639
+ height,
37640
+ x,
37641
+ y
37642
+ };
37643
+ }
37644
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
37645
+ let rect;
37646
+ if (clippingAncestor === 'viewport') {
37647
+ rect = getViewportRect(element, strategy);
37648
+ } else if (clippingAncestor === 'document') {
37649
+ rect = getDocumentRect(getDocumentElement(element));
37650
+ } else if (isElement(clippingAncestor)) {
37651
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
37652
+ } else {
37653
+ const visualOffsets = getVisualOffsets(element);
37654
+ rect = {
37655
+ ...clippingAncestor,
37656
+ x: clippingAncestor.x - visualOffsets.x,
37657
+ y: clippingAncestor.y - visualOffsets.y
37658
+ };
37659
+ }
37660
+ return rectToClientRect(rect);
37661
+ }
37662
+ function hasFixedPositionAncestor(element, stopNode) {
37663
+ const parentNode = getParentNode(element);
37664
+ if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
37665
+ return false;
37666
+ }
37667
+ return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
37668
+ }
37669
+
37670
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
37671
+ // clipping (or hiding) child elements. This returns all clipping ancestors
37672
+ // of the given element up the tree.
37673
+ function getClippingElementAncestors(element, cache) {
37674
+ const cachedResult = cache.get(element);
37675
+ if (cachedResult) {
37676
+ return cachedResult;
37677
+ }
37678
+ let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
37679
+ let currentContainingBlockComputedStyle = null;
37680
+ const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
37681
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
37682
+
37683
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
37684
+ while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
37685
+ const computedStyle = getComputedStyle$1(currentNode);
37686
+ const currentNodeIsContaining = isContainingBlock(currentNode);
37687
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
37688
+ currentContainingBlockComputedStyle = null;
37689
+ }
37690
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
37691
+ if (shouldDropCurrentNode) {
37692
+ // Drop non-containing blocks.
37693
+ result = result.filter(ancestor => ancestor !== currentNode);
37694
+ } else {
37695
+ // Record last containing block for next iteration.
37696
+ currentContainingBlockComputedStyle = computedStyle;
37697
+ }
37698
+ currentNode = getParentNode(currentNode);
37699
+ }
37700
+ cache.set(element, result);
37701
+ return result;
37702
+ }
37703
+
37704
+ // Gets the maximum area that the element is visible in due to any number of
37705
+ // clipping ancestors.
37706
+ function getClippingRect(_ref) {
37707
+ let {
37708
+ element,
37709
+ boundary,
37710
+ rootBoundary,
37711
+ strategy
37712
+ } = _ref;
37713
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
37714
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
37715
+ const firstClippingAncestor = clippingAncestors[0];
37716
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
37717
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
37718
+ accRect.top = max(rect.top, accRect.top);
37719
+ accRect.right = min(rect.right, accRect.right);
37720
+ accRect.bottom = min(rect.bottom, accRect.bottom);
37721
+ accRect.left = max(rect.left, accRect.left);
37722
+ return accRect;
37723
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
37724
+ return {
37725
+ width: clippingRect.right - clippingRect.left,
37726
+ height: clippingRect.bottom - clippingRect.top,
37727
+ x: clippingRect.left,
37728
+ y: clippingRect.top
37729
+ };
37730
+ }
37731
+
37732
+ function getDimensions(element) {
37733
+ return getCssDimensions(element);
37734
+ }
37735
+
37736
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
37737
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
37738
+ const documentElement = getDocumentElement(offsetParent);
37739
+ const isFixed = strategy === 'fixed';
37740
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
37741
+ let scroll = {
37742
+ scrollLeft: 0,
37743
+ scrollTop: 0
37744
+ };
37745
+ const offsets = createCoords(0);
37746
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
37747
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
37748
+ scroll = getNodeScroll(offsetParent);
37749
+ }
37750
+ if (isOffsetParentAnElement) {
37751
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
37752
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
37753
+ offsets.y = offsetRect.y + offsetParent.clientTop;
37754
+ } else if (documentElement) {
37755
+ offsets.x = getWindowScrollBarX(documentElement);
37756
+ }
37757
+ }
37758
+ return {
37759
+ x: rect.left + scroll.scrollLeft - offsets.x,
37760
+ y: rect.top + scroll.scrollTop - offsets.y,
37761
+ width: rect.width,
37762
+ height: rect.height
37763
+ };
37764
+ }
37765
+
37766
+ function getTrueOffsetParent(element, polyfill) {
37767
+ if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
37768
+ return null;
37769
+ }
37770
+ if (polyfill) {
37771
+ return polyfill(element);
37772
+ }
37773
+ return element.offsetParent;
37774
+ }
37775
+
37776
+ // Gets the closest ancestor positioned element. Handles some edge cases,
37777
+ // such as table ancestors and cross browser bugs.
37778
+ function getOffsetParent(element, polyfill) {
37779
+ const window = getWindow(element);
37780
+ if (!isHTMLElement(element)) {
37781
+ return window;
37782
+ }
37783
+ let offsetParent = getTrueOffsetParent(element, polyfill);
37784
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
37785
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
37786
+ }
37787
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
37788
+ return window;
37789
+ }
37790
+ return offsetParent || getContainingBlock(element) || window;
37791
+ }
37792
+
37793
+ const getElementRects = async function (_ref) {
37794
+ let {
37795
+ reference,
37796
+ floating,
37797
+ strategy
37798
+ } = _ref;
37799
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
37800
+ const getDimensionsFn = this.getDimensions;
37801
+ return {
37802
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
37803
+ floating: {
37804
+ x: 0,
37805
+ y: 0,
37806
+ ...(await getDimensionsFn(floating))
37807
+ }
37808
+ };
37809
+ };
37810
+
37811
+ function isRTL(element) {
37812
+ return getComputedStyle$1(element).direction === 'rtl';
37813
+ }
37814
+
37815
+ const platform = {
37816
+ convertOffsetParentRelativeRectToViewportRelativeRect,
37817
+ getDocumentElement,
37818
+ getClippingRect,
37819
+ getOffsetParent,
37820
+ getElementRects,
37821
+ getClientRects,
37822
+ getDimensions,
37823
+ getScale,
37824
+ isElement,
37825
+ isRTL
37826
+ };
37827
+
37828
+ // https://samthor.au/2021/observing-dom/
37829
+ function observeMove(element, onMove) {
37830
+ let io = null;
37831
+ let timeoutId;
37832
+ const root = getDocumentElement(element);
37833
+ function cleanup() {
37834
+ clearTimeout(timeoutId);
37835
+ io && io.disconnect();
37836
+ io = null;
37837
+ }
37838
+ function refresh(skip, threshold) {
37839
+ if (skip === void 0) {
37840
+ skip = false;
37841
+ }
37842
+ if (threshold === void 0) {
37843
+ threshold = 1;
37844
+ }
37845
+ cleanup();
37846
+ const {
37847
+ left,
37848
+ top,
37849
+ width,
37850
+ height
37851
+ } = element.getBoundingClientRect();
37852
+ if (!skip) {
37853
+ onMove();
37854
+ }
37855
+ if (!width || !height) {
37856
+ return;
37857
+ }
37858
+ const insetTop = floor(top);
37859
+ const insetRight = floor(root.clientWidth - (left + width));
37860
+ const insetBottom = floor(root.clientHeight - (top + height));
37861
+ const insetLeft = floor(left);
37862
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
37863
+ const options = {
37864
+ rootMargin,
37865
+ threshold: max(0, min(1, threshold)) || 1
37866
+ };
37867
+ let isFirstUpdate = true;
37868
+ function handleObserve(entries) {
37869
+ const ratio = entries[0].intersectionRatio;
37870
+ if (ratio !== threshold) {
37871
+ if (!isFirstUpdate) {
37872
+ return refresh();
37873
+ }
37874
+ if (!ratio) {
37875
+ timeoutId = setTimeout(() => {
37876
+ refresh(false, 1e-7);
37877
+ }, 100);
37878
+ } else {
37879
+ refresh(false, ratio);
37880
+ }
37881
+ }
37882
+ isFirstUpdate = false;
37883
+ }
37884
+
37885
+ // Older browsers don't support a `document` as the root and will throw an
37886
+ // error.
37887
+ try {
37888
+ io = new IntersectionObserver(handleObserve, {
37889
+ ...options,
37890
+ // Handle <iframe>s
37891
+ root: root.ownerDocument
37892
+ });
37893
+ } catch (e) {
37894
+ io = new IntersectionObserver(handleObserve, options);
37895
+ }
37896
+ io.observe(element);
37897
+ }
37898
+ refresh(true);
37899
+ return cleanup;
37900
+ }
37901
+
37902
+ /**
37903
+ * Automatically updates the position of the floating element when necessary.
37904
+ * Should only be called when the floating element is mounted on the DOM or
37905
+ * visible on the screen.
37906
+ * @returns cleanup function that should be invoked when the floating element is
37907
+ * removed from the DOM or hidden from the screen.
37908
+ * @see https://floating-ui.com/docs/autoUpdate
37909
+ */
37910
+ function autoUpdate(reference, floating, update, options) {
37911
+ if (options === void 0) {
37912
+ options = {};
37913
+ }
37914
+ const {
37915
+ ancestorScroll = true,
37916
+ ancestorResize = true,
37917
+ elementResize = typeof ResizeObserver === 'function',
37918
+ layoutShift = typeof IntersectionObserver === 'function',
37919
+ animationFrame = false
37920
+ } = options;
37921
+ const referenceEl = unwrapElement(reference);
37922
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
37923
+ ancestors.forEach(ancestor => {
37924
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
37925
+ passive: true
36633
37926
  });
36634
- const isControlled = prop !== undefined;
36635
- const value1 = isControlled ? prop : uncontrolledProp;
36636
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
36637
- const setValue = useCallback((nextValue)=>{
36638
- if (isControlled) {
36639
- const setter = nextValue;
36640
- const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
36641
- if (value !== prop) handleChange(value);
36642
- } else setUncontrolledProp(nextValue);
37927
+ ancestorResize && ancestor.addEventListener('resize', update);
37928
+ });
37929
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
37930
+ let reobserveFrame = -1;
37931
+ let resizeObserver = null;
37932
+ if (elementResize) {
37933
+ resizeObserver = new ResizeObserver(_ref => {
37934
+ let [firstEntry] = _ref;
37935
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
37936
+ // Prevent update loops when using the `size` middleware.
37937
+ // https://github.com/floating-ui/floating-ui/issues/1740
37938
+ resizeObserver.unobserve(floating);
37939
+ cancelAnimationFrame(reobserveFrame);
37940
+ reobserveFrame = requestAnimationFrame(() => {
37941
+ resizeObserver && resizeObserver.observe(floating);
37942
+ });
37943
+ }
37944
+ update();
37945
+ });
37946
+ if (referenceEl && !animationFrame) {
37947
+ resizeObserver.observe(referenceEl);
37948
+ }
37949
+ resizeObserver.observe(floating);
37950
+ }
37951
+ let frameId;
37952
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
37953
+ if (animationFrame) {
37954
+ frameLoop();
37955
+ }
37956
+ function frameLoop() {
37957
+ const nextRefRect = getBoundingClientRect(reference);
37958
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
37959
+ update();
37960
+ }
37961
+ prevRefRect = nextRefRect;
37962
+ frameId = requestAnimationFrame(frameLoop);
37963
+ }
37964
+ update();
37965
+ return () => {
37966
+ ancestors.forEach(ancestor => {
37967
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
37968
+ ancestorResize && ancestor.removeEventListener('resize', update);
37969
+ });
37970
+ cleanupIo && cleanupIo();
37971
+ resizeObserver && resizeObserver.disconnect();
37972
+ resizeObserver = null;
37973
+ if (animationFrame) {
37974
+ cancelAnimationFrame(frameId);
37975
+ }
37976
+ };
37977
+ }
37978
+
37979
+ /**
37980
+ * Computes the `x` and `y` coordinates that will place the floating element
37981
+ * next to a reference element when it is given a certain CSS positioning
37982
+ * strategy.
37983
+ */
37984
+ const computePosition = (reference, floating, options) => {
37985
+ // This caches the expensive `getClippingElementAncestors` function so that
37986
+ // multiple lifecycle resets re-use the same result. It only lives for a
37987
+ // single call. If other functions become expensive, we can add them as well.
37988
+ const cache = new Map();
37989
+ const mergedOptions = {
37990
+ platform,
37991
+ ...options
37992
+ };
37993
+ const platformWithCache = {
37994
+ ...mergedOptions.platform,
37995
+ _c: cache
37996
+ };
37997
+ return computePosition$1(reference, floating, {
37998
+ ...mergedOptions,
37999
+ platform: platformWithCache
38000
+ });
38001
+ };
38002
+
38003
+ /**
38004
+ * Provides data to position an inner element of the floating element so that it
38005
+ * appears centered to the reference element.
38006
+ * This wraps the core `arrow` middleware to allow React refs as the element.
38007
+ * @see https://floating-ui.com/docs/arrow
38008
+ */
38009
+ const arrow = options => {
38010
+ function isRef(value) {
38011
+ return {}.hasOwnProperty.call(value, 'current');
38012
+ }
38013
+ return {
38014
+ name: 'arrow',
38015
+ options,
38016
+ fn(state) {
38017
+ const {
38018
+ element,
38019
+ padding
38020
+ } = typeof options === 'function' ? options(state) : options;
38021
+ if (element && isRef(element)) {
38022
+ if (element.current != null) {
38023
+ return arrow$1({
38024
+ element: element.current,
38025
+ padding
38026
+ }).fn(state);
38027
+ }
38028
+ return {};
38029
+ } else if (element) {
38030
+ return arrow$1({
38031
+ element,
38032
+ padding
38033
+ }).fn(state);
38034
+ }
38035
+ return {};
38036
+ }
38037
+ };
38038
+ };
38039
+
38040
+ var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
38041
+
38042
+ // Fork of `fast-deep-equal` that only does the comparisons we need and compares
38043
+ // functions
38044
+ function deepEqual(a, b) {
38045
+ if (a === b) {
38046
+ return true;
38047
+ }
38048
+ if (typeof a !== typeof b) {
38049
+ return false;
38050
+ }
38051
+ if (typeof a === 'function' && a.toString() === b.toString()) {
38052
+ return true;
38053
+ }
38054
+ let length, i, keys;
38055
+ if (a && b && typeof a == 'object') {
38056
+ if (Array.isArray(a)) {
38057
+ length = a.length;
38058
+ if (length != b.length) return false;
38059
+ for (i = length; i-- !== 0;) {
38060
+ if (!deepEqual(a[i], b[i])) {
38061
+ return false;
38062
+ }
38063
+ }
38064
+ return true;
38065
+ }
38066
+ keys = Object.keys(a);
38067
+ length = keys.length;
38068
+ if (length !== Object.keys(b).length) {
38069
+ return false;
38070
+ }
38071
+ for (i = length; i-- !== 0;) {
38072
+ if (!{}.hasOwnProperty.call(b, keys[i])) {
38073
+ return false;
38074
+ }
38075
+ }
38076
+ for (i = length; i-- !== 0;) {
38077
+ const key = keys[i];
38078
+ if (key === '_owner' && a.$$typeof) {
38079
+ continue;
38080
+ }
38081
+ if (!deepEqual(a[key], b[key])) {
38082
+ return false;
38083
+ }
38084
+ }
38085
+ return true;
38086
+ }
38087
+ return a !== a && b !== b;
38088
+ }
38089
+
38090
+ function getDPR(element) {
38091
+ if (typeof window === 'undefined') {
38092
+ return 1;
38093
+ }
38094
+ const win = element.ownerDocument.defaultView || window;
38095
+ return win.devicePixelRatio || 1;
38096
+ }
38097
+
38098
+ function roundByDPR(element, value) {
38099
+ const dpr = getDPR(element);
38100
+ return Math.round(value * dpr) / dpr;
38101
+ }
38102
+
38103
+ function useLatestRef(value) {
38104
+ const ref = React.useRef(value);
38105
+ index(() => {
38106
+ ref.current = value;
38107
+ });
38108
+ return ref;
38109
+ }
38110
+
38111
+ /**
38112
+ * Provides data to position a floating element.
38113
+ * @see https://floating-ui.com/docs/react
38114
+ */
38115
+ function useFloating(options) {
38116
+ if (options === void 0) {
38117
+ options = {};
38118
+ }
38119
+ const {
38120
+ placement = 'bottom',
38121
+ strategy = 'absolute',
38122
+ middleware = [],
38123
+ platform,
38124
+ elements: {
38125
+ reference: externalReference,
38126
+ floating: externalFloating
38127
+ } = {},
38128
+ transform = true,
38129
+ whileElementsMounted,
38130
+ open
38131
+ } = options;
38132
+ const [data, setData] = React.useState({
38133
+ x: 0,
38134
+ y: 0,
38135
+ strategy,
38136
+ placement,
38137
+ middlewareData: {},
38138
+ isPositioned: false
38139
+ });
38140
+ const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
38141
+ if (!deepEqual(latestMiddleware, middleware)) {
38142
+ setLatestMiddleware(middleware);
38143
+ }
38144
+ const [_reference, _setReference] = React.useState(null);
38145
+ const [_floating, _setFloating] = React.useState(null);
38146
+ const setReference = React.useCallback(node => {
38147
+ if (node != referenceRef.current) {
38148
+ referenceRef.current = node;
38149
+ _setReference(node);
38150
+ }
38151
+ }, [_setReference]);
38152
+ const setFloating = React.useCallback(node => {
38153
+ if (node !== floatingRef.current) {
38154
+ floatingRef.current = node;
38155
+ _setFloating(node);
38156
+ }
38157
+ }, [_setFloating]);
38158
+ const referenceEl = externalReference || _reference;
38159
+ const floatingEl = externalFloating || _floating;
38160
+ const referenceRef = React.useRef(null);
38161
+ const floatingRef = React.useRef(null);
38162
+ const dataRef = React.useRef(data);
38163
+ const whileElementsMountedRef = useLatestRef(whileElementsMounted);
38164
+ const platformRef = useLatestRef(platform);
38165
+ const update = React.useCallback(() => {
38166
+ if (!referenceRef.current || !floatingRef.current) {
38167
+ return;
38168
+ }
38169
+ const config = {
38170
+ placement,
38171
+ strategy,
38172
+ middleware: latestMiddleware
38173
+ };
38174
+ if (platformRef.current) {
38175
+ config.platform = platformRef.current;
38176
+ }
38177
+ computePosition(referenceRef.current, floatingRef.current, config).then(data => {
38178
+ const fullData = {
38179
+ ...data,
38180
+ isPositioned: true
38181
+ };
38182
+ if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
38183
+ dataRef.current = fullData;
38184
+ reactDom.exports.flushSync(() => {
38185
+ setData(fullData);
38186
+ });
38187
+ }
38188
+ });
38189
+ }, [latestMiddleware, placement, strategy, platformRef]);
38190
+ index(() => {
38191
+ if (open === false && dataRef.current.isPositioned) {
38192
+ dataRef.current.isPositioned = false;
38193
+ setData(data => ({
38194
+ ...data,
38195
+ isPositioned: false
38196
+ }));
38197
+ }
38198
+ }, [open]);
38199
+ const isMountedRef = React.useRef(false);
38200
+ index(() => {
38201
+ isMountedRef.current = true;
38202
+ return () => {
38203
+ isMountedRef.current = false;
38204
+ };
38205
+ }, []);
38206
+ index(() => {
38207
+ if (referenceEl) referenceRef.current = referenceEl;
38208
+ if (floatingEl) floatingRef.current = floatingEl;
38209
+ if (referenceEl && floatingEl) {
38210
+ if (whileElementsMountedRef.current) {
38211
+ return whileElementsMountedRef.current(referenceEl, floatingEl, update);
38212
+ } else {
38213
+ update();
38214
+ }
38215
+ }
38216
+ }, [referenceEl, floatingEl, update, whileElementsMountedRef]);
38217
+ const refs = React.useMemo(() => ({
38218
+ reference: referenceRef,
38219
+ floating: floatingRef,
38220
+ setReference,
38221
+ setFloating
38222
+ }), [setReference, setFloating]);
38223
+ const elements = React.useMemo(() => ({
38224
+ reference: referenceEl,
38225
+ floating: floatingEl
38226
+ }), [referenceEl, floatingEl]);
38227
+ const floatingStyles = React.useMemo(() => {
38228
+ const initialStyles = {
38229
+ position: strategy,
38230
+ left: 0,
38231
+ top: 0
38232
+ };
38233
+ if (!elements.floating) {
38234
+ return initialStyles;
38235
+ }
38236
+ const x = roundByDPR(elements.floating, data.x);
38237
+ const y = roundByDPR(elements.floating, data.y);
38238
+ if (transform) {
38239
+ return {
38240
+ ...initialStyles,
38241
+ transform: "translate(" + x + "px, " + y + "px)",
38242
+ ...(getDPR(elements.floating) >= 1.5 && {
38243
+ willChange: 'transform'
38244
+ })
38245
+ };
38246
+ }
38247
+ return {
38248
+ position: strategy,
38249
+ left: x,
38250
+ top: y
38251
+ };
38252
+ }, [strategy, transform, elements.floating, data.x, data.y]);
38253
+ return React.useMemo(() => ({
38254
+ ...data,
38255
+ update,
38256
+ refs,
38257
+ elements,
38258
+ floatingStyles
38259
+ }), [data, update, refs, elements, floatingStyles]);
38260
+ }
38261
+
38262
+ function $db6c3485150b8e66$export$1ab7ae714698c4b8$1(element) {
38263
+ const [size, setSize] = useState(undefined);
38264
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
38265
+ if (element) {
38266
+ // provide size as early as possible
38267
+ setSize({
38268
+ width: element.offsetWidth,
38269
+ height: element.offsetHeight
38270
+ });
38271
+ const resizeObserver = new ResizeObserver((entries)=>{
38272
+ if (!Array.isArray(entries)) return;
38273
+ // Since we only observe the one element, we don't need to loop over the
38274
+ // array
38275
+ if (!entries.length) return;
38276
+ const entry = entries[0];
38277
+ let width;
38278
+ let height;
38279
+ if ('borderBoxSize' in entry) {
38280
+ const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers
38281
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
38282
+ width = borderSize['inlineSize'];
38283
+ height = borderSize['blockSize'];
38284
+ } else {
38285
+ // for browsers that don't support `borderBoxSize`
38286
+ // we calculate it ourselves to get the correct border box.
38287
+ width = element.offsetWidth;
38288
+ height = element.offsetHeight;
38289
+ }
38290
+ setSize({
38291
+ width: width,
38292
+ height: height
38293
+ });
38294
+ });
38295
+ resizeObserver.observe(element, {
38296
+ box: 'border-box'
38297
+ });
38298
+ return ()=>resizeObserver.unobserve(element)
38299
+ ;
38300
+ } else // We only want to reset to `undefined` when the element becomes `null`,
38301
+ // not if it changes to another element.
38302
+ setSize(undefined);
36643
38303
  }, [
36644
- isControlled,
36645
- prop,
36646
- setUncontrolledProp,
36647
- handleChange
38304
+ element
36648
38305
  ]);
36649
- return [
36650
- value1,
36651
- setValue
36652
- ];
38306
+ return size;
36653
38307
  }
36654
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
36655
- const uncontrolledState = useState(defaultProp);
36656
- const [value] = uncontrolledState;
36657
- const prevValueRef = useRef(value);
36658
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
38308
+
38309
+ /* -------------------------------------------------------------------------------------------------
38310
+ * Popper
38311
+ * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$POPPER_NAME = 'Popper';
38312
+ const [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cf1ac5d9fe0e8206$var$POPPER_NAME);
38313
+ const [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
38314
+ const $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props)=>{
38315
+ const { __scopePopper: __scopePopper , children: children } = props;
38316
+ const [anchor, setAnchor] = useState(null);
38317
+ return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
38318
+ scope: __scopePopper,
38319
+ anchor: anchor,
38320
+ onAnchorChange: setAnchor
38321
+ }, children);
38322
+ };
38323
+ /* -------------------------------------------------------------------------------------------------
38324
+ * PopperAnchor
38325
+ * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$ANCHOR_NAME = 'PopperAnchor';
38326
+ const $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38327
+ const { __scopePopper: __scopePopper , virtualRef: virtualRef , ...anchorProps } = props;
38328
+ const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
38329
+ const ref = useRef(null);
38330
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
36659
38331
  useEffect(()=>{
36660
- if (prevValueRef.current !== value) {
36661
- handleChange(value);
36662
- prevValueRef.current = value;
36663
- }
38332
+ // Consumer can anchor the popper to something that isn't
38333
+ // a DOM node e.g. pointer position, so we override the
38334
+ // `anchorRef` with their virtual ref in this case.
38335
+ context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
38336
+ });
38337
+ return virtualRef ? null : /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, anchorProps, {
38338
+ ref: composedRefs
38339
+ }));
38340
+ });
38341
+ /* -------------------------------------------------------------------------------------------------
38342
+ * PopperContent
38343
+ * -----------------------------------------------------------------------------------------------*/ const $cf1ac5d9fe0e8206$var$CONTENT_NAME = 'PopperContent';
38344
+ const [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
38345
+ const $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38346
+ var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
38347
+ const { __scopePopper: __scopePopper , side: side = 'bottom' , sideOffset: sideOffset = 0 , align: align = 'center' , alignOffset: alignOffset = 0 , arrowPadding: arrowPadding = 0 , avoidCollisions: avoidCollisions = true , collisionBoundary: collisionBoundary = [] , collisionPadding: collisionPaddingProp = 0 , sticky: sticky = 'partial' , hideWhenDetached: hideWhenDetached = false , updatePositionStrategy: updatePositionStrategy = 'optimized' , onPlaced: onPlaced , ...contentProps } = props;
38348
+ const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
38349
+ const [content, setContent] = useState(null);
38350
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
38351
+ );
38352
+ const [arrow$1, setArrow] = useState(null);
38353
+ const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8$1(arrow$1);
38354
+ const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
38355
+ const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
38356
+ const desiredPlacement = side + (align !== 'center' ? '-' + align : '');
38357
+ const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : {
38358
+ top: 0,
38359
+ right: 0,
38360
+ bottom: 0,
38361
+ left: 0,
38362
+ ...collisionPaddingProp
38363
+ };
38364
+ const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
38365
+ collisionBoundary
38366
+ ];
38367
+ const hasExplicitBoundaries = boundary.length > 0;
38368
+ const detectOverflowOptions = {
38369
+ padding: collisionPadding,
38370
+ boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
38371
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
38372
+ altBoundary: hasExplicitBoundaries
38373
+ };
38374
+ const { refs: refs , floatingStyles: floatingStyles , placement: placement , isPositioned: isPositioned , middlewareData: middlewareData } = useFloating({
38375
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
38376
+ strategy: 'fixed',
38377
+ placement: desiredPlacement,
38378
+ whileElementsMounted: (...args)=>{
38379
+ const cleanup = autoUpdate(...args, {
38380
+ animationFrame: updatePositionStrategy === 'always'
38381
+ });
38382
+ return cleanup;
38383
+ },
38384
+ elements: {
38385
+ reference: context.anchor
38386
+ },
38387
+ middleware: [
38388
+ offset({
38389
+ mainAxis: sideOffset + arrowHeight,
38390
+ alignmentAxis: alignOffset
38391
+ }),
38392
+ avoidCollisions && shift({
38393
+ mainAxis: true,
38394
+ crossAxis: false,
38395
+ limiter: sticky === 'partial' ? limitShift() : undefined,
38396
+ ...detectOverflowOptions
38397
+ }),
38398
+ avoidCollisions && flip({
38399
+ ...detectOverflowOptions
38400
+ }),
38401
+ size({
38402
+ ...detectOverflowOptions,
38403
+ apply: ({ elements: elements , rects: rects , availableWidth: availableWidth , availableHeight: availableHeight })=>{
38404
+ const { width: anchorWidth , height: anchorHeight } = rects.reference;
38405
+ const contentStyle = elements.floating.style;
38406
+ contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`);
38407
+ contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`);
38408
+ contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`);
38409
+ contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`);
38410
+ }
38411
+ }),
38412
+ arrow$1 && arrow({
38413
+ element: arrow$1,
38414
+ padding: arrowPadding
38415
+ }),
38416
+ $cf1ac5d9fe0e8206$var$transformOrigin({
38417
+ arrowWidth: arrowWidth,
38418
+ arrowHeight: arrowHeight
38419
+ }),
38420
+ hideWhenDetached && hide({
38421
+ strategy: 'referenceHidden',
38422
+ ...detectOverflowOptions
38423
+ })
38424
+ ]
38425
+ });
38426
+ const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
38427
+ const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onPlaced);
38428
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
38429
+ if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced();
36664
38430
  }, [
36665
- value,
36666
- prevValueRef,
36667
- handleChange
38431
+ isPositioned,
38432
+ handlePlaced
36668
38433
  ]);
36669
- return uncontrolledState;
38434
+ const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
38435
+ const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
38436
+ const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
38437
+ const [contentZIndex, setContentZIndex] = useState();
38438
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
38439
+ if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
38440
+ }, [
38441
+ content
38442
+ ]);
38443
+ return /*#__PURE__*/ createElement("div", {
38444
+ ref: refs.setFloating,
38445
+ "data-radix-popper-content-wrapper": "",
38446
+ style: {
38447
+ ...floatingStyles,
38448
+ transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)',
38449
+ // keep off the page when measuring
38450
+ minWidth: 'max-content',
38451
+ zIndex: contentZIndex,
38452
+ ['--radix-popper-transform-origin']: [
38453
+ (_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
38454
+ (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
38455
+ ].join(' ')
38456
+ } // Floating UI interally calculates logical alignment based the `dir` attribute on
38457
+ ,
38458
+ dir: props.dir
38459
+ }, /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
38460
+ scope: __scopePopper,
38461
+ placedSide: placedSide,
38462
+ onArrowChange: setArrow,
38463
+ arrowX: arrowX,
38464
+ arrowY: arrowY,
38465
+ shouldHideArrow: cannotCenterArrow
38466
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
38467
+ "data-side": placedSide,
38468
+ "data-align": placedAlign
38469
+ }, contentProps, {
38470
+ ref: composedRefs,
38471
+ style: {
38472
+ ...contentProps.style,
38473
+ // if the PopperContent hasn't been placed yet (not all measurements done)
38474
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
38475
+ animation: !isPositioned ? 'none' : undefined,
38476
+ // hide the content if using the hide middleware and should be hidden
38477
+ opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined
38478
+ }
38479
+ }))));
38480
+ });
38481
+ /* -----------------------------------------------------------------------------------------------*/ function $cf1ac5d9fe0e8206$var$isNotNull(value) {
38482
+ return value !== null;
38483
+ }
38484
+ const $cf1ac5d9fe0e8206$var$transformOrigin = (options)=>({
38485
+ name: 'transformOrigin',
38486
+ options: options,
38487
+ fn (data) {
38488
+ var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
38489
+ const { placement: placement , rects: rects , middlewareData: middlewareData } = data;
38490
+ const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
38491
+ const isArrowHidden = cannotCenterArrow;
38492
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
38493
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
38494
+ const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
38495
+ const noArrowAlign = {
38496
+ start: '0%',
38497
+ center: '50%',
38498
+ end: '100%'
38499
+ }[placedAlign];
38500
+ 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;
38501
+ 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;
38502
+ let x = '';
38503
+ let y = '';
38504
+ if (placedSide === 'bottom') {
38505
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
38506
+ y = `${-arrowHeight}px`;
38507
+ } else if (placedSide === 'top') {
38508
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
38509
+ y = `${rects.floating.height + arrowHeight}px`;
38510
+ } else if (placedSide === 'right') {
38511
+ x = `${-arrowHeight}px`;
38512
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
38513
+ } else if (placedSide === 'left') {
38514
+ x = `${rects.floating.width + arrowHeight}px`;
38515
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
38516
+ }
38517
+ return {
38518
+ data: {
38519
+ x: x,
38520
+ y: y
38521
+ }
38522
+ };
38523
+ }
38524
+ })
38525
+ ;
38526
+ function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
38527
+ const [side, align = 'center'] = placement.split('-');
38528
+ return [
38529
+ side,
38530
+ align
38531
+ ];
36670
38532
  }
38533
+ const $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
38534
+ const $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
38535
+ const $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
36671
38536
 
36672
- function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
38537
+ const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38538
+ var _globalThis$document;
38539
+ const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
38540
+ return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, portalProps, {
38541
+ ref: forwardedRef
38542
+ })), container) : null;
38543
+ });
38544
+
38545
+ function $010c2913dbd2fe3d$export$5cae361ad82dce8b$1(value) {
36673
38546
  const ref = useRef({
36674
38547
  value: value,
36675
38548
  previous: value
@@ -36687,8 +38560,8 @@ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
36687
38560
  ]);
36688
38561
  }
36689
38562
 
36690
- const $ea1ef594cf570d83$export$439d29a4e110a164$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36691
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
38563
+ const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38564
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, props, {
36692
38565
  ref: forwardedRef,
36693
38566
  style: {
36694
38567
  // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
@@ -36720,24 +38593,27 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
36720
38593
  /* -------------------------------------------------------------------------------------------------
36721
38594
  * Select
36722
38595
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
36723
- const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2$1($cc7e05a45900e73f$var$SELECT_NAME);
36724
- const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
36725
- $cc7e05a45900e73f$var$createCollectionScope
38596
+ const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
38597
+ const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cc7e05a45900e73f$var$SELECT_NAME, [
38598
+ $cc7e05a45900e73f$var$createCollectionScope,
38599
+ $cf1ac5d9fe0e8206$export$722aac194ae923
36726
38600
  ]);
38601
+ const $cc7e05a45900e73f$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
36727
38602
  const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
36728
38603
  const [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
36729
38604
  const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
36730
38605
  const { __scopeSelect: __scopeSelect , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , value: valueProp , defaultValue: defaultValue , onValueChange: onValueChange , dir: dir , name: name , autoComplete: autoComplete , disabled: disabled , required: required } = props;
38606
+ const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
36731
38607
  const [trigger, setTrigger] = useState(null);
36732
38608
  const [valueNode, setValueNode] = useState(null);
36733
38609
  const [valueNodeHasChildren, setValueNodeHasChildren] = useState(false);
36734
- const direction = $f631663db3294ace$export$b39126d51d94e6f3$1(dir);
36735
- const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
38610
+ const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
38611
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
36736
38612
  prop: openProp,
36737
38613
  defaultProp: defaultOpen,
36738
38614
  onChange: onOpenChange
36739
38615
  });
36740
- const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
38616
+ const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
36741
38617
  prop: valueProp,
36742
38618
  defaultProp: defaultValue,
36743
38619
  onChange: onValueChange
@@ -36751,7 +38627,7 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
36751
38627
  // each time the options change.
36752
38628
  const nativeSelectKey = Array.from(nativeOptionsSet).map((option)=>option.props.value
36753
38629
  ).join(';');
36754
- return /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectProvider, {
38630
+ return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectProvider, {
36755
38631
  required: required,
36756
38632
  scope: __scopeSelect,
36757
38633
  trigger: trigger,
@@ -36797,16 +38673,17 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
36797
38673
  disabled: disabled
36798
38674
  }, value === undefined ? /*#__PURE__*/ createElement("option", {
36799
38675
  value: ""
36800
- }) : null, Array.from(nativeOptionsSet)) : null);
38676
+ }) : null, Array.from(nativeOptionsSet)) : null));
36801
38677
  };
36802
38678
  /* -------------------------------------------------------------------------------------------------
36803
38679
  * SelectTrigger
36804
38680
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$TRIGGER_NAME = 'SelectTrigger';
36805
38681
  const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36806
38682
  const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
38683
+ const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
36807
38684
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
36808
38685
  const isDisabled = context.disabled || disabled;
36809
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
38686
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onTriggerChange);
36810
38687
  const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
36811
38688
  const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
36812
38689
  const enabledItems = getItems().filter((item)=>!item.disabled
@@ -36822,7 +38699,9 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
36822
38699
  resetTypeahead();
36823
38700
  }
36824
38701
  };
36825
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
38702
+ return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
38703
+ asChild: true
38704
+ }, popperScope), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.button, _extends({
36826
38705
  type: "button",
36827
38706
  role: "combobox",
36828
38707
  "aria-controls": context.contentId,
@@ -36833,11 +38712,11 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
36833
38712
  "data-state": context.open ? 'open' : 'closed',
36834
38713
  disabled: isDisabled,
36835
38714
  "data-disabled": isDisabled ? '' : undefined,
36836
- "data-placeholder": context.value === undefined ? '' : undefined
38715
+ "data-placeholder": $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? '' : undefined
36837
38716
  }, triggerProps, {
36838
38717
  ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
36839
38718
  ,
36840
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
38719
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onClick, (event)=>{
36841
38720
  // Whilst browsers generally have no issue focusing the trigger when clicking
36842
38721
  // on a label, Safari seems to struggle with the fact that there's no `onClick`.
36843
38722
  // We force `focus` in this case. Note: this doesn't create any other side-effect
@@ -36845,7 +38724,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
36845
38724
  // this only runs for a label "click"
36846
38725
  event.currentTarget.focus();
36847
38726
  }),
36848
- onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
38727
+ onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onPointerDown, (event)=>{
36849
38728
  // prevent implicit pointer capture
36850
38729
  // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
36851
38730
  const target = event.target;
@@ -36861,7 +38740,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
36861
38740
  event.preventDefault();
36862
38741
  }
36863
38742
  }),
36864
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
38743
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onKeyDown, (event)=>{
36865
38744
  const isTypingAhead = searchRef.current !== '';
36866
38745
  const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
36867
38746
  if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
@@ -36871,35 +38750,35 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
36871
38750
  event.preventDefault();
36872
38751
  }
36873
38752
  })
36874
- }));
38753
+ })));
36875
38754
  });
36876
38755
  /* -------------------------------------------------------------------------------------------------
36877
38756
  * SelectValue
36878
38757
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VALUE_NAME = 'SelectValue';
36879
38758
  const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36880
38759
  // We ignore `className` and `style` as this part shouldn't be styled.
36881
- const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
38760
+ const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder = '' , ...valueProps } = props;
36882
38761
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
36883
38762
  const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
36884
38763
  const hasChildren = children !== undefined;
36885
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
36886
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
38764
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.onValueNodeChange);
38765
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
36887
38766
  onValueNodeHasChildrenChange(hasChildren);
36888
38767
  }, [
36889
38768
  onValueNodeHasChildrenChange,
36890
38769
  hasChildren
36891
38770
  ]);
36892
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, valueProps, {
38771
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, valueProps, {
36893
38772
  ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
36894
38773
  ,
36895
38774
  style: {
36896
38775
  pointerEvents: 'none'
36897
38776
  }
36898
- }), context.value === undefined && placeholder !== undefined ? placeholder : children);
38777
+ }), $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? /*#__PURE__*/ createElement(Fragment, null, placeholder) : children);
36899
38778
  });
36900
38779
  const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36901
38780
  const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
36902
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
38781
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
36903
38782
  "aria-hidden": true
36904
38783
  }, iconProps, {
36905
38784
  ref: forwardedRef
@@ -36916,33 +38795,39 @@ const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
36916
38795
  const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36917
38796
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
36918
38797
  const [fragment, setFragment] = useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
36919
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
38798
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
36920
38799
  setFragment(new DocumentFragment());
36921
38800
  }, []);
36922
- return /*#__PURE__*/ createElement(Fragment, null, context.open ? /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends({}, props, {
38801
+ if (!context.open) {
38802
+ const frag = fragment;
38803
+ return frag ? /*#__PURE__*/ reactDom.exports.createPortal(/*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectContentProvider, {
38804
+ scope: props.__scopeSelect
38805
+ }, /*#__PURE__*/ createElement($cc7e05a45900e73f$var$Collection.Slot, {
38806
+ scope: props.__scopeSelect
38807
+ }, /*#__PURE__*/ createElement("div", null, props.children))), frag) : null;
38808
+ }
38809
+ return /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends({}, props, {
36923
38810
  ref: forwardedRef
36924
- })) : fragment ? /*#__PURE__*/ reactDom.exports.createPortal(/*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectContentProvider, {
36925
- scope: props.__scopeSelect
36926
- }, /*#__PURE__*/ createElement($cc7e05a45900e73f$var$Collection.Slot, {
36927
- scope: props.__scopeSelect
36928
- }, /*#__PURE__*/ createElement("div", null, props.children))), fragment) : null);
38811
+ }));
36929
38812
  });
36930
- const $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
38813
+ /* -------------------------------------------------------------------------------------------------
38814
+ * SelectContentImpl
38815
+ * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
36931
38816
  const [$cc7e05a45900e73f$var$SelectContentProvider, $cc7e05a45900e73f$var$useSelectContentContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME);
36932
38817
  const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36933
- const { __scopeSelect: __scopeSelect , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
38818
+ const { __scopeSelect: __scopeSelect , position: position = 'item-aligned' , onCloseAutoFocus: onCloseAutoFocus , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , side: //
38819
+ // PopperContent props
38820
+ side , sideOffset: sideOffset , align: align , alignOffset: alignOffset , arrowPadding: arrowPadding , collisionBoundary: collisionBoundary , collisionPadding: collisionPadding , sticky: sticky , hideWhenDetached: hideWhenDetached , avoidCollisions: avoidCollisions , //
38821
+ ...contentProps } = props;
36934
38822
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
36935
- const [contentWrapper, setContentWrapper] = useState(null);
36936
38823
  const [content, setContent] = useState(null);
36937
38824
  const [viewport, setViewport] = useState(null);
36938
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
38825
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
36939
38826
  );
36940
38827
  const [selectedItem, setSelectedItem] = useState(null);
36941
38828
  const [selectedItemText, setSelectedItemText] = useState(null);
36942
38829
  const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
36943
38830
  const [isPositioned, setIsPositioned] = useState(false);
36944
- const shouldRepositionRef = useRef(true);
36945
- const shouldExpandOnScrollRef = useRef(false);
36946
38831
  const firstValidItemFoundRef = useRef(false); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
36947
38832
  useEffect(()=>{
36948
38833
  if (content) return hideOthers(content);
@@ -36951,12 +38836,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
36951
38836
  ]); // Make sure the whole tree has focus guards as our `Select` may be
36952
38837
  // the last element in the DOM (because of the `Portal`)
36953
38838
  $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
36954
- const [contentZIndex, setContentZIndex] = useState();
36955
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
36956
- if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
36957
- }, [
36958
- content
36959
- ]);
36960
38839
  const focusFirst = useCallback((candidates)=>{
36961
38840
  const [firstItem, ...restItems] = getItems().map((item)=>item.ref.current
36962
38841
  );
@@ -36977,101 +38856,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
36977
38856
  getItems,
36978
38857
  viewport
36979
38858
  ]);
36980
- const position = useCallback(()=>{
36981
- if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
36982
- const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
36983
- // Horizontal positioning
36984
- // -----------------------------------------------------------------------------------------
36985
- const contentRect = content.getBoundingClientRect();
36986
- const valueNodeRect = context.valueNode.getBoundingClientRect();
36987
- const itemTextRect = selectedItemText.getBoundingClientRect();
36988
- if (context.dir !== 'rtl') {
36989
- const itemTextOffset = itemTextRect.left - contentRect.left;
36990
- const left = valueNodeRect.left - itemTextOffset;
36991
- const leftDelta = triggerRect.left - left;
36992
- const minContentWidth = triggerRect.width + leftDelta;
36993
- const contentWidth = Math.max(minContentWidth, contentRect.width);
36994
- const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
36995
- const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
36996
- $cc7e05a45900e73f$var$CONTENT_MARGIN,
36997
- rightEdge - contentWidth
36998
- ]);
36999
- contentWrapper.style.minWidth = minContentWidth + 'px';
37000
- contentWrapper.style.left = clampedLeft + 'px';
37001
- } else {
37002
- const itemTextOffset = contentRect.right - itemTextRect.right;
37003
- const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
37004
- const rightDelta = window.innerWidth - triggerRect.right - right;
37005
- const minContentWidth = triggerRect.width + rightDelta;
37006
- const contentWidth = Math.max(minContentWidth, contentRect.width);
37007
- const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
37008
- const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
37009
- $cc7e05a45900e73f$var$CONTENT_MARGIN,
37010
- leftEdge - contentWidth
37011
- ]);
37012
- contentWrapper.style.minWidth = minContentWidth + 'px';
37013
- contentWrapper.style.right = clampedRight + 'px';
37014
- } // -----------------------------------------------------------------------------------------
37015
- // Vertical positioning
37016
- // -----------------------------------------------------------------------------------------
37017
- const items = getItems();
37018
- const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
37019
- const itemsHeight = viewport.scrollHeight;
37020
- const contentStyles = window.getComputedStyle(content);
37021
- const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
37022
- const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
37023
- const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
37024
- const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
37025
- const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
37026
- const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
37027
- const viewportStyles = window.getComputedStyle(viewport);
37028
- const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
37029
- const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
37030
- const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
37031
- const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
37032
- const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
37033
- const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
37034
- const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
37035
- const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
37036
- const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
37037
- if (willAlignWithoutTopOverflow) {
37038
- const isLastItem = selectedItem === items[items.length - 1].ref.current;
37039
- contentWrapper.style.bottom = "0px";
37040
- const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
37041
- const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
37042
- const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
37043
- contentWrapper.style.height = height + 'px';
37044
- } else {
37045
- const isFirstItem = selectedItem === items[0].ref.current;
37046
- contentWrapper.style.top = "0px";
37047
- const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
37048
- const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
37049
- contentWrapper.style.height = height + 'px';
37050
- viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
37051
- }
37052
- contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
37053
- contentWrapper.style.minHeight = minContentHeight + 'px';
37054
- contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
37055
- setIsPositioned(true); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
37056
- // so we explicitly turn it on only after they've registered.
37057
- requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
37058
- );
37059
- }
37060
- }, [
37061
- getItems,
37062
- context.trigger,
37063
- context.valueNode,
37064
- contentWrapper,
37065
- content,
37066
- viewport,
37067
- selectedItem,
37068
- selectedItemText,
37069
- context.dir
37070
- ]);
37071
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
37072
- , [
37073
- position
37074
- ]);
37075
38859
  const focusSelectedItem = useCallback(()=>focusFirst([
37076
38860
  selectedItem,
37077
38861
  content
@@ -37087,19 +38871,6 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
37087
38871
  }, [
37088
38872
  isPositioned,
37089
38873
  focusSelectedItem
37090
- ]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
37091
- // Because it is part of the normal flow, it will push down the viewport, thus throwing our
37092
- // trigger => selectedItem alignment off by the amount the viewport was pushed down.
37093
- // We wait for this to happen and then re-run the positining logic one more time to account for it.
37094
- const handleScrollButtonChange = useCallback((node)=>{
37095
- if (node && shouldRepositionRef.current === true) {
37096
- position();
37097
- focusSelectedItem();
37098
- shouldRepositionRef.current = false;
37099
- }
37100
- }, [
37101
- position,
37102
- focusSelectedItem
37103
38874
  ]); // prevent selecting items on `pointerup` in some cases after opening from `pointerdown`
37104
38875
  // and close on `pointerup` outside.
37105
38876
  const { onOpenChange: onOpenChange , triggerPointerDownPosRef: triggerPointerDownPosRef } = context;
@@ -37188,9 +38959,21 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
37188
38959
  }, [
37189
38960
  context.value
37190
38961
  ]);
38962
+ const SelectPosition = position === 'popper' ? $cc7e05a45900e73f$var$SelectPopperPosition : $cc7e05a45900e73f$var$SelectItemAlignedPosition; // Silently ignore props that are not supported by `SelectItemAlignedPosition`
38963
+ const popperContentProps = SelectPosition === $cc7e05a45900e73f$var$SelectPopperPosition ? {
38964
+ side: side,
38965
+ sideOffset: sideOffset,
38966
+ align: align,
38967
+ alignOffset: alignOffset,
38968
+ arrowPadding: arrowPadding,
38969
+ collisionBoundary: collisionBoundary,
38970
+ collisionPadding: collisionPadding,
38971
+ sticky: sticky,
38972
+ hideWhenDetached: hideWhenDetached,
38973
+ avoidCollisions: avoidCollisions
38974
+ } : {};
37191
38975
  return /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectContentProvider, {
37192
38976
  scope: __scopeSelect,
37193
- contentWrapper: contentWrapper,
37194
38977
  content: content,
37195
38978
  viewport: viewport,
37196
38979
  onViewportChange: setViewport,
@@ -37198,22 +38981,14 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
37198
38981
  selectedItem: selectedItem,
37199
38982
  onItemLeave: handleItemLeave,
37200
38983
  itemTextRefCallback: itemTextRefCallback,
38984
+ focusSelectedItem: focusSelectedItem,
37201
38985
  selectedItemText: selectedItemText,
37202
- onScrollButtonChange: handleScrollButtonChange,
38986
+ position: position,
37203
38987
  isPositioned: isPositioned,
37204
- shouldExpandOnScrollRef: shouldExpandOnScrollRef,
37205
38988
  searchRef: searchRef
37206
38989
  }, /*#__PURE__*/ createElement($01b9c$RemoveScroll, {
37207
- as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
38990
+ as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1,
37208
38991
  allowPinchZoom: true
37209
- }, /*#__PURE__*/ createElement("div", {
37210
- ref: setContentWrapper,
37211
- style: {
37212
- display: 'flex',
37213
- flexDirection: 'column',
37214
- position: 'fixed',
37215
- zIndex: contentZIndex
37216
- }
37217
38992
  }, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
37218
38993
  asChild: true // we make sure we're not trapping once it's been closed
37219
38994
  ,
@@ -37222,38 +38997,41 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
37222
38997
  // we prevent open autofocus because we manually focus the selected item
37223
38998
  event.preventDefault();
37224
38999
  },
37225
- onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
39000
+ onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(onCloseAutoFocus, (event)=>{
37226
39001
  var _context$trigger;
37227
39002
  (_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
37228
39003
  preventScroll: true
37229
39004
  });
37230
39005
  event.preventDefault();
37231
39006
  })
37232
- }, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, _extends({
39007
+ }, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
39008
+ asChild: true,
39009
+ disableOutsidePointerEvents: true,
39010
+ onEscapeKeyDown: onEscapeKeyDown,
39011
+ onPointerDownOutside: onPointerDownOutside // When focus is trapped, a focusout event may still happen.
39012
+ ,
39013
+ onFocusOutside: (event)=>event.preventDefault()
39014
+ ,
39015
+ onDismiss: ()=>context.onOpenChange(false)
39016
+ }, /*#__PURE__*/ createElement(SelectPosition, _extends({
37233
39017
  role: "listbox",
37234
39018
  id: context.contentId,
37235
39019
  "data-state": context.open ? 'open' : 'closed',
37236
39020
  dir: context.dir,
37237
39021
  onContextMenu: (event)=>event.preventDefault()
37238
- }, contentProps, {
39022
+ }, contentProps, popperContentProps, {
39023
+ onPlaced: ()=>setIsPositioned(true)
39024
+ ,
37239
39025
  ref: composedRefs,
37240
39026
  style: {
39027
+ // flex layout so we can place the scroll buttons properly
37241
39028
  display: 'flex',
37242
39029
  flexDirection: 'column',
37243
- // When we get the height of the content, it includes borders. If we were to set
37244
- // the height without having `boxSizing: 'border-box'` it would be too big.
37245
- boxSizing: 'border-box',
37246
- maxHeight: '100%',
39030
+ // reset the outline by default as the content MAY get focused
37247
39031
  outline: 'none',
37248
39032
  ...contentProps.style
37249
39033
  },
37250
- disableOutsidePointerEvents: true // When focus is trapped, a focusout event may still happen.
37251
- ,
37252
- onFocusOutside: (event)=>event.preventDefault()
37253
- ,
37254
- onDismiss: ()=>context.onOpenChange(false)
37255
- ,
37256
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
39034
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(contentProps.onKeyDown, (event)=>{
37257
39035
  const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
37258
39036
  if (event.key === 'Tab') event.preventDefault();
37259
39037
  if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
@@ -37289,13 +39067,186 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
37289
39067
  })
37290
39068
  }))))));
37291
39069
  });
39070
+ const $cc7e05a45900e73f$var$SelectItemAlignedPosition = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
39071
+ const { __scopeSelect: __scopeSelect , onPlaced: onPlaced , ...popperProps } = props;
39072
+ const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
39073
+ const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
39074
+ const [contentWrapper, setContentWrapper] = useState(null);
39075
+ const [content, setContent] = useState(null);
39076
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContent(node)
39077
+ );
39078
+ const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
39079
+ const shouldExpandOnScrollRef = useRef(false);
39080
+ const shouldRepositionRef = useRef(true);
39081
+ const { viewport: viewport , selectedItem: selectedItem , selectedItemText: selectedItemText , focusSelectedItem: focusSelectedItem } = contentContext;
39082
+ const position = useCallback(()=>{
39083
+ if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
39084
+ const triggerRect = context.trigger.getBoundingClientRect(); // -----------------------------------------------------------------------------------------
39085
+ // Horizontal positioning
39086
+ // -----------------------------------------------------------------------------------------
39087
+ const contentRect = content.getBoundingClientRect();
39088
+ const valueNodeRect = context.valueNode.getBoundingClientRect();
39089
+ const itemTextRect = selectedItemText.getBoundingClientRect();
39090
+ if (context.dir !== 'rtl') {
39091
+ const itemTextOffset = itemTextRect.left - contentRect.left;
39092
+ const left = valueNodeRect.left - itemTextOffset;
39093
+ const leftDelta = triggerRect.left - left;
39094
+ const minContentWidth = triggerRect.width + leftDelta;
39095
+ const contentWidth = Math.max(minContentWidth, contentRect.width);
39096
+ const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
39097
+ const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
39098
+ $cc7e05a45900e73f$var$CONTENT_MARGIN,
39099
+ rightEdge - contentWidth
39100
+ ]);
39101
+ contentWrapper.style.minWidth = minContentWidth + 'px';
39102
+ contentWrapper.style.left = clampedLeft + 'px';
39103
+ } else {
39104
+ const itemTextOffset = contentRect.right - itemTextRect.right;
39105
+ const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
39106
+ const rightDelta = window.innerWidth - triggerRect.right - right;
39107
+ const minContentWidth = triggerRect.width + rightDelta;
39108
+ const contentWidth = Math.max(minContentWidth, contentRect.width);
39109
+ const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
39110
+ const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
39111
+ $cc7e05a45900e73f$var$CONTENT_MARGIN,
39112
+ leftEdge - contentWidth
39113
+ ]);
39114
+ contentWrapper.style.minWidth = minContentWidth + 'px';
39115
+ contentWrapper.style.right = clampedRight + 'px';
39116
+ } // -----------------------------------------------------------------------------------------
39117
+ // Vertical positioning
39118
+ // -----------------------------------------------------------------------------------------
39119
+ const items = getItems();
39120
+ const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
39121
+ const itemsHeight = viewport.scrollHeight;
39122
+ const contentStyles = window.getComputedStyle(content);
39123
+ const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
39124
+ const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
39125
+ const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
39126
+ const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
39127
+ const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth; // prettier-ignore
39128
+ const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
39129
+ const viewportStyles = window.getComputedStyle(viewport);
39130
+ const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
39131
+ const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
39132
+ const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
39133
+ const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
39134
+ const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
39135
+ const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
39136
+ const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
39137
+ const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
39138
+ const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
39139
+ if (willAlignWithoutTopOverflow) {
39140
+ const isLastItem = selectedItem === items[items.length - 1].ref.current;
39141
+ contentWrapper.style.bottom = "0px";
39142
+ const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
39143
+ const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
39144
+ const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
39145
+ contentWrapper.style.height = height + 'px';
39146
+ } else {
39147
+ const isFirstItem = selectedItem === items[0].ref.current;
39148
+ contentWrapper.style.top = "0px";
39149
+ const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
39150
+ const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
39151
+ contentWrapper.style.height = height + 'px';
39152
+ viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
39153
+ }
39154
+ contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
39155
+ contentWrapper.style.minHeight = minContentHeight + 'px';
39156
+ contentWrapper.style.maxHeight = availableHeight + 'px'; // -----------------------------------------------------------------------------------------
39157
+ onPlaced === null || onPlaced === void 0 || onPlaced(); // we don't want the initial scroll position adjustment to trigger "expand on scroll"
39158
+ // so we explicitly turn it on only after they've registered.
39159
+ requestAnimationFrame(()=>shouldExpandOnScrollRef.current = true
39160
+ );
39161
+ }
39162
+ }, [
39163
+ getItems,
39164
+ context.trigger,
39165
+ context.valueNode,
39166
+ contentWrapper,
39167
+ content,
39168
+ viewport,
39169
+ selectedItem,
39170
+ selectedItemText,
39171
+ context.dir,
39172
+ onPlaced
39173
+ ]);
39174
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>position()
39175
+ , [
39176
+ position
39177
+ ]); // copy z-index from content to wrapper
39178
+ const [contentZIndex, setContentZIndex] = useState();
39179
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
39180
+ if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
39181
+ }, [
39182
+ content
39183
+ ]); // When the viewport becomes scrollable at the top, the scroll up button will mount.
39184
+ // Because it is part of the normal flow, it will push down the viewport, thus throwing our
39185
+ // trigger => selectedItem alignment off by the amount the viewport was pushed down.
39186
+ // We wait for this to happen and then re-run the positining logic one more time to account for it.
39187
+ const handleScrollButtonChange = useCallback((node)=>{
39188
+ if (node && shouldRepositionRef.current === true) {
39189
+ position();
39190
+ focusSelectedItem === null || focusSelectedItem === void 0 || focusSelectedItem();
39191
+ shouldRepositionRef.current = false;
39192
+ }
39193
+ }, [
39194
+ position,
39195
+ focusSelectedItem
39196
+ ]);
39197
+ return /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectViewportProvider, {
39198
+ scope: __scopeSelect,
39199
+ contentWrapper: contentWrapper,
39200
+ shouldExpandOnScrollRef: shouldExpandOnScrollRef,
39201
+ onScrollButtonChange: handleScrollButtonChange
39202
+ }, /*#__PURE__*/ createElement("div", {
39203
+ ref: setContentWrapper,
39204
+ style: {
39205
+ display: 'flex',
39206
+ flexDirection: 'column',
39207
+ position: 'fixed',
39208
+ zIndex: contentZIndex
39209
+ }
39210
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({}, popperProps, {
39211
+ ref: composedRefs,
39212
+ style: {
39213
+ // When we get the height of the content, it includes borders. If we were to set
39214
+ // the height without having `boxSizing: 'border-box'` it would be too big.
39215
+ boxSizing: 'border-box',
39216
+ // We need to ensure the content doesn't get taller than the wrapper
39217
+ maxHeight: '100%',
39218
+ ...popperProps.style
39219
+ }
39220
+ }))));
39221
+ });
39222
+ const $cc7e05a45900e73f$var$SelectPopperPosition = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
39223
+ const { __scopeSelect: __scopeSelect , align: align = 'start' , collisionPadding: collisionPadding = $cc7e05a45900e73f$var$CONTENT_MARGIN , ...popperProps } = props;
39224
+ const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
39225
+ return /*#__PURE__*/ createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({}, popperScope, popperProps, {
39226
+ ref: forwardedRef,
39227
+ align: align,
39228
+ collisionPadding: collisionPadding,
39229
+ style: {
39230
+ // Ensure border-box for floating-ui calculations
39231
+ boxSizing: 'border-box',
39232
+ ...popperProps.style,
39233
+ '--radix-select-content-transform-origin': 'var(--radix-popper-transform-origin)',
39234
+ '--radix-select-content-available-width': 'var(--radix-popper-available-width)',
39235
+ '--radix-select-content-available-height': 'var(--radix-popper-available-height)',
39236
+ '--radix-select-trigger-width': 'var(--radix-popper-anchor-width)',
39237
+ '--radix-select-trigger-height': 'var(--radix-popper-anchor-height)'
39238
+ }
39239
+ }));
39240
+ });
37292
39241
  /* -------------------------------------------------------------------------------------------------
37293
39242
  * SelectViewport
37294
- * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$VIEWPORT_NAME = 'SelectViewport';
39243
+ * -----------------------------------------------------------------------------------------------*/ const [$cc7e05a45900e73f$var$SelectViewportProvider, $cc7e05a45900e73f$var$useSelectViewportContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, {});
39244
+ const $cc7e05a45900e73f$var$VIEWPORT_NAME = 'SelectViewport';
37295
39245
  const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
37296
39246
  const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
37297
39247
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
37298
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
39248
+ const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
39249
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, contentContext.onViewportChange);
37299
39250
  const prevScrollTopRef = useRef(0);
37300
39251
  return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement("style", {
37301
39252
  dangerouslySetInnerHTML: {
@@ -37303,7 +39254,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((prop
37303
39254
  }
37304
39255
  }), /*#__PURE__*/ createElement($cc7e05a45900e73f$var$Collection.Slot, {
37305
39256
  scope: __scopeSelect
37306
- }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
39257
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
37307
39258
  "data-radix-select-viewport": "",
37308
39259
  role: "presentation"
37309
39260
  }, viewportProps, {
@@ -37317,9 +39268,9 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((prop
37317
39268
  overflow: 'auto',
37318
39269
  ...viewportProps.style
37319
39270
  },
37320
- onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
39271
+ onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(viewportProps.onScroll, (event)=>{
37321
39272
  const viewport = event.currentTarget;
37322
- const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = contentContext;
39273
+ const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = viewportContext;
37323
39274
  if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
37324
39275
  const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
37325
39276
  if (scrolledBy > 0) {
@@ -37358,7 +39309,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
37358
39309
  const isSelected = context.value === value;
37359
39310
  const [textValue, setTextValue] = useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
37360
39311
  const [isFocused, setIsFocused] = useState(false);
37361
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
39312
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>{
37362
39313
  var _contentContext$itemR;
37363
39314
  return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
37364
39315
  });
@@ -37369,6 +39320,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
37369
39320
  context.onOpenChange(false);
37370
39321
  }
37371
39322
  };
39323
+ if (value === '') throw new Error('A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.');
37372
39324
  return /*#__PURE__*/ createElement($cc7e05a45900e73f$var$SelectItemContextProvider, {
37373
39325
  scope: __scopeSelect,
37374
39326
  value: value,
@@ -37386,7 +39338,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
37386
39338
  value: value,
37387
39339
  disabled: disabled,
37388
39340
  textValue: textValue
37389
- }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
39341
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
37390
39342
  role: "option",
37391
39343
  "aria-labelledby": textId,
37392
39344
  "data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
@@ -37398,12 +39350,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
37398
39350
  tabIndex: disabled ? undefined : -1
37399
39351
  }, itemProps, {
37400
39352
  ref: composedRefs,
37401
- onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
39353
+ onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onFocus, ()=>setIsFocused(true)
37402
39354
  ),
37403
- onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
39355
+ onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onBlur, ()=>setIsFocused(false)
37404
39356
  ),
37405
- onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
37406
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
39357
+ onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerUp, handleSelect),
39358
+ onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerMove, (event)=>{
37407
39359
  if (disabled) {
37408
39360
  var _contentContext$onIte;
37409
39361
  (_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
@@ -37413,13 +39365,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
37413
39365
  preventScroll: true
37414
39366
  });
37415
39367
  }),
37416
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
39368
+ onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerLeave, (event)=>{
37417
39369
  if (event.currentTarget === document.activeElement) {
37418
39370
  var _contentContext$onIte2;
37419
39371
  (_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
37420
39372
  }
37421
39373
  }),
37422
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
39374
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onKeyDown, (event)=>{
37423
39375
  var _contentContext$searc;
37424
39376
  const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
37425
39377
  if (isTypingAhead && event.key === ' ') return;
@@ -37439,7 +39391,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
37439
39391
  const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
37440
39392
  const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
37441
39393
  const [itemTextNode, setItemTextNode] = useState(null);
37442
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
39394
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setItemTextNode(node)
37443
39395
  , itemContext.onItemTextChange, (node)=>{
37444
39396
  var _contentContext$itemT;
37445
39397
  return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
@@ -37456,7 +39408,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
37456
39408
  textContent
37457
39409
  ]);
37458
39410
  const { onNativeOptionAdd: onNativeOptionAdd , onNativeOptionRemove: onNativeOptionRemove } = nativeOptionsContext;
37459
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
39411
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
37460
39412
  onNativeOptionAdd(nativeOption);
37461
39413
  return ()=>onNativeOptionRemove(nativeOption)
37462
39414
  ;
@@ -37465,7 +39417,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
37465
39417
  onNativeOptionRemove,
37466
39418
  nativeOption
37467
39419
  ]);
37468
- return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
39420
+ return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
37469
39421
  id: itemContext.textId
37470
39422
  }, itemTextProps, {
37471
39423
  ref: composedRefs
@@ -37477,7 +39429,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
37477
39429
  const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
37478
39430
  const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
37479
39431
  const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
37480
- return itemContext.isSelected ? /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
39432
+ return itemContext.isSelected ? /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({
37481
39433
  "aria-hidden": true
37482
39434
  }, itemIndicatorProps, {
37483
39435
  ref: forwardedRef
@@ -37488,9 +39440,10 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ forwardRef((prop
37488
39440
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME = 'SelectScrollUpButton';
37489
39441
  const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
37490
39442
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
39443
+ const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
37491
39444
  const [canScrollUp1, setCanScrollUp] = useState(false);
37492
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
37493
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
39445
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, viewportContext.onScrollButtonChange);
39446
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
37494
39447
  if (contentContext.viewport && contentContext.isPositioned) {
37495
39448
  const viewport = contentContext.viewport;
37496
39449
  function handleScroll() {
@@ -37519,9 +39472,10 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ forwardRef((prop
37519
39472
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME = 'SelectScrollDownButton';
37520
39473
  const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
37521
39474
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
39475
+ const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
37522
39476
  const [canScrollDown1, setCanScrollDown] = useState(false);
37523
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
37524
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
39477
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, viewportContext.onScrollButtonChange);
39478
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
37525
39479
  if (contentContext.viewport && contentContext.isPositioned) {
37526
39480
  const viewport = contentContext.viewport;
37527
39481
  function handleScroll() {
@@ -37567,7 +39521,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
37567
39521
  // Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)
37568
39522
  // the viewport, potentially causing the active item to now be partially out of view.
37569
39523
  // We re-run the `scrollIntoView` logic to make sure it stays within the viewport.
37570
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
39524
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
37571
39525
  var _activeItem$ref$curre;
37572
39526
  const activeItem = getItems().find((item)=>item.ref.current === document.activeElement
37573
39527
  );
@@ -37577,7 +39531,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
37577
39531
  }, [
37578
39532
  getItems
37579
39533
  ]);
37580
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
39534
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.div, _extends({
37581
39535
  "aria-hidden": true
37582
39536
  }, scrollIndicatorProps, {
37583
39537
  ref: forwardedRef,
@@ -37585,21 +39539,27 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
37585
39539
  flexShrink: 0,
37586
39540
  ...scrollIndicatorProps.style
37587
39541
  },
37588
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
39542
+ onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerDown, ()=>{
39543
+ if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
39544
+ }),
39545
+ onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerMove, ()=>{
37589
39546
  var _contentContext$onIte3;
37590
39547
  (_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
37591
39548
  if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
37592
39549
  }),
37593
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
39550
+ onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerLeave, ()=>{
37594
39551
  clearAutoScrollTimer();
37595
39552
  })
37596
39553
  }));
37597
39554
  });
37598
- /* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
39555
+ /* -----------------------------------------------------------------------------------------------*/ function $cc7e05a45900e73f$var$shouldShowPlaceholder(value) {
39556
+ return value === '' || value === undefined;
39557
+ }
39558
+ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
37599
39559
  const { value: value , ...selectProps } = props;
37600
39560
  const ref = useRef(null);
37601
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
37602
- const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
39561
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
39562
+ const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b$1(value); // Bubble value change to parents (e.g form change event)
37603
39563
  useEffect(()=>{
37604
39564
  const select = ref.current;
37605
39565
  const selectProto = window.HTMLSelectElement.prototype;
@@ -37627,7 +39587,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
37627
39587
  *
37628
39588
  * We use `VisuallyHidden` rather than `display: "none"` because Safari autofill
37629
39589
  * won't work otherwise.
37630
- */ return /*#__PURE__*/ createElement($ea1ef594cf570d83$export$439d29a4e110a164$1, {
39590
+ */ return /*#__PURE__*/ createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
37631
39591
  asChild: true
37632
39592
  }, /*#__PURE__*/ createElement("select", _extends({}, selectProps, {
37633
39593
  ref: composedRefs,
@@ -37636,7 +39596,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
37636
39596
  });
37637
39597
  $cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
37638
39598
  function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
37639
- const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
39599
+ const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onSearchChange);
37640
39600
  const searchRef = useRef('');
37641
39601
  const timerRef = useRef(0);
37642
39602
  const handleTypeaheadSearch = useCallback((key)=>{
@@ -37734,7 +39694,7 @@ const BtIconChevronUp2Px = (props) =>
37734
39694
  /** Use `Select` to choose from a dropdown list of options. */
37735
39695
  var Select = function (_a) {
37736
39696
  var _b;
37737
- var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
39697
+ var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, _c = _a.ariaLabel, ariaLabel = _c === void 0 ? label : _c, options = _a.options, onOpenChange = _a.onOpenChange, isDefaultOpen = _a.isDefaultOpen, defaultValue = _a.defaultValue, errorMessage = _a.errorMessage, labelSize = _a.labelSize, helper = _a.helper, name = _a.name, width = _a.width, isFluid = _a.isFluid, onBlur = _a.onBlur, onChange = _a.onChange, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, onClickDisclosure = _a.onClickDisclosure, _d = _a.selectSize, selectSize = _d === void 0 ? "m" : _d, props = __rest(_a, ["isRequired", "isDisabled", "placeholder", "label", "ariaLabel", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "width", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure", "selectSize"]);
37738
39698
  var id = useId();
37739
39699
  var arcRootElement = useContext(ArcRootElementContext);
37740
39700
  var surface = useContext(Context$3).surface;
@@ -37759,33 +39719,34 @@ var Select = function (_a) {
37759
39719
  };
37760
39720
  return (React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", isDisabled: isDisabled, disclosureText: disclosureText, disclosureTitle: disclosureTitle, onClickDisclosure: onClickDisclosure },
37761
39721
  React__default.createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectedValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
37762
- React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, className: classNames("arc-Select-trigger", (_b = {
37763
- "arc-Select-trigger--constrained": !isFluid,
37764
- "arc-Select-trigger--onDarkSurface": surface === "dark",
37765
- "arc-Select-trigger--invalid": errorMessage
37766
- },
37767
- _b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
37768
- _b)) }, filterDataAttrs(props)),
37769
- React__default.createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { asChild: true, "aria-label": getSelectedValueName(selectedValue) }, !selectedValue ? (React__default.createElement("span", { "aria-hidden": true, className: "arc-Select-placeHolder" }, placeholder)) : (React__default.createElement("span", { className: "arc-Select-valueItem" }, getSelectedValueName(selectedValue)))),
37770
- React__default.createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
37771
- React__default.createElement(Icon, { icon: BtIconChevronDown2Px, size: getIconSize(selectSize) }))),
37772
- React__default.createElement($cc7e05a45900e73f$export$602eac185826482c, { container: arcRootElement || undefined },
37773
- React__default.createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { className: classNames("arc-Select-content", {
37774
- "arc-Select-content--onDarkSurface": surface === "dark"
37775
- }) },
37776
- React__default.createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
37777
- React__default.createElement(Icon, { icon: BtIconChevronUp2Px, size: 16 })),
37778
- React__default.createElement($cc7e05a45900e73f$export$d5c6c08dc2d3ca7, null, options.map(function (_a, i) {
37779
- var name = _a.name, value = _a.value;
37780
- return (React__default.createElement($cc7e05a45900e73f$export$6d08773d2e66f8f2, { className: "arc-Select-item", key: "select-item-".concat(i), value: value },
37781
- React__default.createElement("div", { className: "arc-Select-itemTextWrapper" },
37782
- React__default.createElement($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { asChild: true },
37783
- React__default.createElement("span", { className: "arc-Select-itemText" }, name))),
37784
- React__default.createElement($cc7e05a45900e73f$export$c3468e2714d175fa, null,
37785
- React__default.createElement(Icon, { icon: BtIconTickAlt2Px, size: 20 }))));
37786
- })),
37787
- React__default.createElement($cc7e05a45900e73f$export$bf1aedc3039c8d63, { className: "arc-Select-scrollButton" },
37788
- React__default.createElement(Icon, { icon: BtIconChevronDown2Px, size: 16 })))))));
39722
+ React__default.createElement("div", { className: "arc-Select-wrapper" },
39723
+ React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign({ id: id, name: name, onBlur: onBlur, "aria-label": ariaLabel, style: { width: width }, className: classNames("arc-Select-trigger", (_b = {
39724
+ "arc-Select-trigger--constrained": !isFluid,
39725
+ "arc-Select-trigger--onDarkSurface": surface === "dark",
39726
+ "arc-Select-trigger--invalid": errorMessage
39727
+ },
39728
+ _b["arc-Select-trigger--size".concat(selectSize && selectSize.toUpperCase())] = selectSize && selectSize !== "m",
39729
+ _b)) }, filterDataAttrs(props)),
39730
+ React__default.createElement($cc7e05a45900e73f$export$4c8d1a57a761ef94, { className: "arc-Select-triggerText", placeholder: placeholder, "aria-label": getSelectedValueName(selectedValue) }),
39731
+ React__default.createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
39732
+ React__default.createElement(Icon, { icon: BtIconChevronDown2Px, size: getIconSize(selectSize) }))),
39733
+ React__default.createElement($cc7e05a45900e73f$export$602eac185826482c, { container: arcRootElement || undefined },
39734
+ React__default.createElement($cc7e05a45900e73f$export$7c6e2c02157bb7d2, { sideOffset: 5, position: "popper", className: classNames("arc-Select-content", {
39735
+ "arc-Select-content--onDarkSurface": surface === "dark"
39736
+ }) },
39737
+ React__default.createElement($cc7e05a45900e73f$export$2f60d3ec9ad468f2, { className: "arc-Select-scrollButton" },
39738
+ React__default.createElement(Icon, { icon: BtIconChevronUp2Px, size: 16 })),
39739
+ React__default.createElement($cc7e05a45900e73f$export$d5c6c08dc2d3ca7, null, options.map(function (_a, i) {
39740
+ var name = _a.name, value = _a.value;
39741
+ return (React__default.createElement($cc7e05a45900e73f$export$6d08773d2e66f8f2, { className: "arc-Select-item", key: "select-item-".concat(i), value: value },
39742
+ React__default.createElement("div", { className: "arc-Select-itemTextWrapper" },
39743
+ React__default.createElement($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { asChild: true },
39744
+ React__default.createElement("span", { className: "arc-Select-itemText" }, name))),
39745
+ React__default.createElement($cc7e05a45900e73f$export$c3468e2714d175fa, null,
39746
+ React__default.createElement(Icon, { icon: BtIconTickAlt2Px, size: 20 }))));
39747
+ })),
39748
+ React__default.createElement($cc7e05a45900e73f$export$bf1aedc3039c8d63, { className: "arc-Select-scrollButton" },
39749
+ React__default.createElement(Icon, { icon: BtIconChevronDown2Px, size: 16 }))))))));
37789
39750
  };
37790
39751
 
37791
39752
  /**
@@ -38507,6 +40468,217 @@ SiteHeaderRehydrator.NavItemRehydrator = NavItemRehydrator;
38507
40468
  SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
38508
40469
  SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
38509
40470
 
40471
+ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
40472
+ return function handleEvent(event) {
40473
+ originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
40474
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
40475
+ };
40476
+ }
40477
+
40478
+ /**
40479
+ * Set a given ref to a given value
40480
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
40481
+ */ function $6ed0406888f73fc4$var$setRef(ref, value) {
40482
+ if (typeof ref === 'function') ref(value);
40483
+ else if (ref !== null && ref !== undefined) ref.current = value;
40484
+ }
40485
+ /**
40486
+ * A utility to compose multiple refs together
40487
+ * Accepts callback refs and RefObject(s)
40488
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
40489
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
40490
+ )
40491
+ ;
40492
+ }
40493
+ /**
40494
+ * A custom hook that composes multiple refs
40495
+ * Accepts callback refs and RefObject(s)
40496
+ */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
40497
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40498
+ return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
40499
+ }
40500
+
40501
+ /* -------------------------------------------------------------------------------------------------
40502
+ * createContextScope
40503
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
40504
+ let defaultContexts = [];
40505
+ /* -----------------------------------------------------------------------------------------------
40506
+ * createContext
40507
+ * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
40508
+ const BaseContext = /*#__PURE__*/ createContext(defaultContext);
40509
+ const index = defaultContexts.length;
40510
+ defaultContexts = [
40511
+ ...defaultContexts,
40512
+ defaultContext
40513
+ ];
40514
+ function Provider(props) {
40515
+ const { scope: scope , children: children , ...context } = props;
40516
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
40517
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40518
+ const value = useMemo(()=>context
40519
+ , Object.values(context));
40520
+ return /*#__PURE__*/ createElement(Context.Provider, {
40521
+ value: value
40522
+ }, children);
40523
+ }
40524
+ function useContext$1(consumerName, scope) {
40525
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
40526
+ const context = useContext(Context);
40527
+ if (context) return context;
40528
+ if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
40529
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
40530
+ }
40531
+ Provider.displayName = rootComponentName + 'Provider';
40532
+ return [
40533
+ Provider,
40534
+ useContext$1
40535
+ ];
40536
+ }
40537
+ /* -----------------------------------------------------------------------------------------------
40538
+ * createScope
40539
+ * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
40540
+ const scopeContexts = defaultContexts.map((defaultContext)=>{
40541
+ return /*#__PURE__*/ createContext(defaultContext);
40542
+ });
40543
+ return function useScope(scope) {
40544
+ const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
40545
+ return useMemo(()=>({
40546
+ [`__scope${scopeName}`]: {
40547
+ ...scope,
40548
+ [scopeName]: contexts
40549
+ }
40550
+ })
40551
+ , [
40552
+ scope,
40553
+ contexts
40554
+ ]);
40555
+ };
40556
+ };
40557
+ createScope.scopeName = scopeName;
40558
+ return [
40559
+ $c512c27ab02ef895$export$fd42f52fd3ae1109,
40560
+ $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
40561
+ ];
40562
+ }
40563
+ /* -------------------------------------------------------------------------------------------------
40564
+ * composeContextScopes
40565
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
40566
+ const baseScope = scopes[0];
40567
+ if (scopes.length === 1) return baseScope;
40568
+ const createScope1 = ()=>{
40569
+ const scopeHooks = scopes.map((createScope)=>({
40570
+ useScope: createScope(),
40571
+ scopeName: createScope.scopeName
40572
+ })
40573
+ );
40574
+ return function useComposedScopes(overrideScopes) {
40575
+ const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
40576
+ // We are calling a hook inside a callback which React warns against to avoid inconsistent
40577
+ // renders, however, scoping doesn't have render side effects so we ignore the rule.
40578
+ // eslint-disable-next-line react-hooks/rules-of-hooks
40579
+ const scopeProps = useScope(overrideScopes);
40580
+ const currentScope = scopeProps[`__scope${scopeName}`];
40581
+ return {
40582
+ ...nextScopes,
40583
+ ...currentScope
40584
+ };
40585
+ }, {});
40586
+ return useMemo(()=>({
40587
+ [`__scope${baseScope.scopeName}`]: nextScopes1
40588
+ })
40589
+ , [
40590
+ nextScopes1
40591
+ ]);
40592
+ };
40593
+ };
40594
+ createScope1.scopeName = baseScope.scopeName;
40595
+ return createScope1;
40596
+ }
40597
+
40598
+ /**
40599
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
40600
+ * prop or avoid re-executing effects when passed as a dependency
40601
+ */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
40602
+ const callbackRef = useRef(callback);
40603
+ useEffect(()=>{
40604
+ callbackRef.current = callback;
40605
+ }); // https://github.com/facebook/react/issues/19240
40606
+ return useMemo(()=>(...args)=>{
40607
+ var _callbackRef$current;
40608
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
40609
+ }
40610
+ , []);
40611
+ }
40612
+
40613
+ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
40614
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
40615
+ defaultProp: defaultProp,
40616
+ onChange: onChange
40617
+ });
40618
+ const isControlled = prop !== undefined;
40619
+ const value1 = isControlled ? prop : uncontrolledProp;
40620
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
40621
+ const setValue = useCallback((nextValue)=>{
40622
+ if (isControlled) {
40623
+ const setter = nextValue;
40624
+ const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
40625
+ if (value !== prop) handleChange(value);
40626
+ } else setUncontrolledProp(nextValue);
40627
+ }, [
40628
+ isControlled,
40629
+ prop,
40630
+ setUncontrolledProp,
40631
+ handleChange
40632
+ ]);
40633
+ return [
40634
+ value1,
40635
+ setValue
40636
+ ];
40637
+ }
40638
+ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
40639
+ const uncontrolledState = useState(defaultProp);
40640
+ const [value] = uncontrolledState;
40641
+ const prevValueRef = useRef(value);
40642
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
40643
+ useEffect(()=>{
40644
+ if (prevValueRef.current !== value) {
40645
+ handleChange(value);
40646
+ prevValueRef.current = value;
40647
+ }
40648
+ }, [
40649
+ value,
40650
+ prevValueRef,
40651
+ handleChange
40652
+ ]);
40653
+ return uncontrolledState;
40654
+ }
40655
+
40656
+ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
40657
+ const ref = useRef({
40658
+ value: value,
40659
+ previous: value
40660
+ }); // We compare values before making an update to ensure that
40661
+ // a change has been made. This ensures the previous value is
40662
+ // persisted correctly between renders.
40663
+ return useMemo(()=>{
40664
+ if (ref.current.value !== value) {
40665
+ ref.current.previous = ref.current.value;
40666
+ ref.current.value = value;
40667
+ }
40668
+ return ref.current.previous;
40669
+ }, [
40670
+ value
40671
+ ]);
40672
+ }
40673
+
40674
+ /**
40675
+ * On the server, React emits a warning when calling `useLayoutEffect`.
40676
+ * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
40677
+ * We use this safe version which suppresses the warning by replacing it with a noop on the server.
40678
+ *
40679
+ * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
40680
+ */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
40681
+
38510
40682
  function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
38511
40683
  const [size, setSize] = useState(undefined);
38512
40684
  $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
@@ -38554,6 +40726,120 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
38554
40726
  return size;
38555
40727
  }
38556
40728
 
40729
+ /* -------------------------------------------------------------------------------------------------
40730
+ * Slot
40731
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
40732
+ const { children: children , ...slotProps } = props;
40733
+ const childrenArray = Children.toArray(children);
40734
+ const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
40735
+ if (slottable) {
40736
+ // the new element to render is the one passed as a child of `Slottable`
40737
+ const newElement = slottable.props.children;
40738
+ const newChildren = childrenArray.map((child)=>{
40739
+ if (child === slottable) {
40740
+ // because the new element will be the one rendered, we are only interested
40741
+ // in grabbing its children (`newElement.props.children`)
40742
+ if (Children.count(newElement) > 1) return Children.only(null);
40743
+ return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
40744
+ } else return child;
40745
+ });
40746
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
40747
+ ref: forwardedRef
40748
+ }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
40749
+ }
40750
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
40751
+ ref: forwardedRef
40752
+ }), children);
40753
+ });
40754
+ $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
40755
+ /* -------------------------------------------------------------------------------------------------
40756
+ * SlotClone
40757
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
40758
+ const { children: children , ...slotProps } = props;
40759
+ if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
40760
+ ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
40761
+ ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
40762
+ });
40763
+ return Children.count(children) > 1 ? Children.only(null) : null;
40764
+ });
40765
+ $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
40766
+ /* -------------------------------------------------------------------------------------------------
40767
+ * Slottable
40768
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
40769
+ return /*#__PURE__*/ createElement(Fragment, null, children);
40770
+ };
40771
+ /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
40772
+ return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
40773
+ }
40774
+ function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
40775
+ // all child props should override
40776
+ const overrideProps = {
40777
+ ...childProps
40778
+ };
40779
+ for(const propName in childProps){
40780
+ const slotPropValue = slotProps[propName];
40781
+ const childPropValue = childProps[propName];
40782
+ const isHandler = /^on[A-Z]/.test(propName);
40783
+ if (isHandler) {
40784
+ // if the handler exists on both, we compose them
40785
+ if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
40786
+ childPropValue(...args);
40787
+ slotPropValue(...args);
40788
+ };
40789
+ else if (slotPropValue) overrideProps[propName] = slotPropValue;
40790
+ } else if (propName === 'style') overrideProps[propName] = {
40791
+ ...slotPropValue,
40792
+ ...childPropValue
40793
+ };
40794
+ else if (propName === 'className') overrideProps[propName] = [
40795
+ slotPropValue,
40796
+ childPropValue
40797
+ ].filter(Boolean).join(' ');
40798
+ }
40799
+ return {
40800
+ ...slotProps,
40801
+ ...overrideProps
40802
+ };
40803
+ }
40804
+
40805
+ const $8927f6f2acc4f386$var$NODES = [
40806
+ 'a',
40807
+ 'button',
40808
+ 'div',
40809
+ 'h2',
40810
+ 'h3',
40811
+ 'img',
40812
+ 'label',
40813
+ 'li',
40814
+ 'nav',
40815
+ 'ol',
40816
+ 'p',
40817
+ 'span',
40818
+ 'svg',
40819
+ 'ul'
40820
+ ]; // Temporary while we await merge of this fix:
40821
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
40822
+ // prettier-ignore
40823
+ /* -------------------------------------------------------------------------------------------------
40824
+ * Primitive
40825
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
40826
+ const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
40827
+ const { asChild: asChild , ...primitiveProps } = props;
40828
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
40829
+ useEffect(()=>{
40830
+ window[Symbol.for('radix-ui')] = true;
40831
+ }, []);
40832
+ return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
40833
+ ref: forwardedRef
40834
+ }));
40835
+ });
40836
+ Node.displayName = `Primitive.${node}`;
40837
+ return {
40838
+ ...primitive,
40839
+ [node]: Node
40840
+ };
40841
+ }, {});
40842
+
38557
40843
  /* -------------------------------------------------------------------------------------------------
38558
40844
  * Switch
38559
40845
  * -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$SWITCH_NAME = 'Switch';
@@ -38695,99 +40981,6 @@ var Switch = function (_a) {
38695
40981
  " ")))));
38696
40982
  };
38697
40983
 
38698
- // We have resorted to returning slots directly rather than exposing primitives that can then
38699
- // be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
38700
- // This is because we encountered issues with generic types that cannot be statically analysed
38701
- // due to creating them dynamically via createCollection.
38702
- function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
38703
- /* -----------------------------------------------------------------------------------------------
38704
- * CollectionProvider
38705
- * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
38706
- const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
38707
- const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
38708
- collectionRef: {
38709
- current: null
38710
- },
38711
- itemMap: new Map()
38712
- });
38713
- const CollectionProvider = (props)=>{
38714
- const { scope: scope , children: children } = props;
38715
- const ref = React__default.useRef(null);
38716
- const itemMap = React__default.useRef(new Map()).current;
38717
- return /*#__PURE__*/ React__default.createElement(CollectionProviderImpl, {
38718
- scope: scope,
38719
- itemMap: itemMap,
38720
- collectionRef: ref
38721
- }, children);
38722
- };
38723
- /* -----------------------------------------------------------------------------------------------
38724
- * CollectionSlot
38725
- * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
38726
- const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
38727
- const { scope: scope , children: children } = props;
38728
- const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
38729
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, context.collectionRef);
38730
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
38731
- ref: composedRefs
38732
- }, children);
38733
- });
38734
- /* -----------------------------------------------------------------------------------------------
38735
- * CollectionItem
38736
- * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
38737
- const ITEM_DATA_ATTR = 'data-radix-collection-item';
38738
- const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
38739
- const { scope: scope , children: children , ...itemData } = props;
38740
- const ref = React__default.useRef(null);
38741
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, ref);
38742
- const context = useCollectionContext(ITEM_SLOT_NAME, scope);
38743
- React__default.useEffect(()=>{
38744
- context.itemMap.set(ref, {
38745
- ref: ref,
38746
- ...itemData
38747
- });
38748
- return ()=>void context.itemMap.delete(ref)
38749
- ;
38750
- });
38751
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360$1, {
38752
- [ITEM_DATA_ATTR]: '',
38753
- ref: composedRefs
38754
- }, children);
38755
- });
38756
- /* -----------------------------------------------------------------------------------------------
38757
- * useCollection
38758
- * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
38759
- const context = useCollectionContext(name + 'CollectionConsumer', scope);
38760
- const getItems = React__default.useCallback(()=>{
38761
- const collectionNode = context.collectionRef.current;
38762
- if (!collectionNode) return [];
38763
- const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
38764
- const items = Array.from(context.itemMap.values());
38765
- const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
38766
- );
38767
- return orderedItems;
38768
- }, [
38769
- context.collectionRef,
38770
- context.itemMap
38771
- ]);
38772
- return getItems;
38773
- }
38774
- return [
38775
- {
38776
- Provider: CollectionProvider,
38777
- Slot: CollectionSlot,
38778
- ItemSlot: CollectionItemSlot
38779
- },
38780
- useCollection,
38781
- createCollectionScope
38782
- ];
38783
- }
38784
-
38785
- const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
38786
- /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
38787
- const globalDir = useContext($f631663db3294ace$var$DirectionContext);
38788
- return localDir || globalDir || 'ltr';
38789
- }
38790
-
38791
40984
  const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';
38792
40985
  const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
38793
40986
  bubbles: false,
@@ -38902,7 +41095,7 @@ const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((prop
38902
41095
  * -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';
38903
41096
  const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38904
41097
  const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , tabStopId: tabStopId , ...itemProps } = props;
38905
- const autoId = $1746a345f3d73bb7$export$f680877a34711e37$1();
41098
+ const autoId = $1746a345f3d73bb7$export$f680877a34711e37();
38906
41099
  const id = tabStopId || autoId;
38907
41100
  const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);
38908
41101
  const isCurrentTabStop = context.currentTabStopId === id;
@@ -39029,7 +41222,7 @@ const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ forwardRef((prop
39029
41222
  });
39030
41223
  return /*#__PURE__*/ createElement($69cb30bb0017df05$var$TabsProvider, {
39031
41224
  scope: __scopeTabs,
39032
- baseId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
41225
+ baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
39033
41226
  value: value,
39034
41227
  onValueChange: setValue,
39035
41228
  orientation: orientation,
@@ -39174,23 +41367,6 @@ var TabContent = function (_a) {
39174
41367
  return (React__default.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-Tab-content", value: value }, children));
39175
41368
  };
39176
41369
 
39177
- const BtIconArrowRightFill = (props) =>
39178
- /*#__PURE__*/ React__default.createElement(
39179
- "svg",
39180
- Object.assign(
39181
- {
39182
- xmlns: "http://www.w3.org/2000/svg",
39183
- viewBox: "0 0 32 32",
39184
- },
39185
- props,
39186
- ),
39187
- /*#__PURE__*/ React__default.createElement("defs", null),
39188
- /*#__PURE__*/ React__default.createElement("path", {
39189
- d: "M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
39190
- fill: "currentColor",
39191
- }),
39192
- );
39193
-
39194
41370
  const BtIconArrowLeftFill = (props) =>
39195
41371
  /*#__PURE__*/ React__default.createElement(
39196
41372
  "svg",
@@ -39310,9 +41486,9 @@ var TextArea = forwardRef(function (_a, ref) {
39310
41486
  */
39311
41487
  var TextInput = forwardRef(function (_a, ref) {
39312
41488
  var _b;
39313
- var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize"]);
41489
+ var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize", "prefix", "suffix", "inputAlignment"]);
39314
41490
  var surface = useContext(Context$3).surface;
39315
- var _l = useState(false), showPasswordToggle = _l[0], setShowPasswordToggle = _l[1];
41491
+ var _m = useState(false), showPasswordToggle = _m[0], setShowPasswordToggle = _m[1];
39316
41492
  var inferredInputProps = useNumericInput({
39317
41493
  inputMode: inputMode,
39318
41494
  pattern: pattern,
@@ -39327,15 +41503,21 @@ var TextInput = forwardRef(function (_a, ref) {
39327
41503
  }).ariaDescribedby;
39328
41504
  return (React__default.createElement("div", __assign({ className: classNames((_b = {
39329
41505
  "arc-TextInput": true,
41506
+ "arc-TextInput--alignRight": inputAlignment === "right",
39330
41507
  "arc-TextInput--withPasswordToggle": showPassword,
41508
+ "arc-TextInput--isDisabled": isDisabled,
39331
41509
  "arc-TextInput--invalid": errorMessage,
39332
- "arc-TextInput--onDarkSurface": surface === "dark"
41510
+ "arc-TextInput--onDarkSurface": surface === "dark",
41511
+ "arc-TextInput--withPrefix": prefix,
41512
+ "arc-TextInput--withSuffix": suffix
39333
41513
  },
39334
41514
  _b["arc-TextInput--size".concat(inputSize && inputSize.toUpperCase())] = inputSize && inputSize !== "m",
39335
41515
  _b)) }, filterDataAttrs(props)),
39336
41516
  React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
39337
41517
  React__default.createElement("div", { className: "arc-TextInput-inputWrapper" },
41518
+ prefix && (React__default.createElement("span", { className: "arc-TextInput-prefix", "aria-hidden": true }, prefix)),
39338
41519
  React__default.createElement("input", __assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
41520
+ suffix && !showPassword ? (React__default.createElement("span", { className: "arc-TextInput-suffix", "aria-hidden": true }, suffix)) : null,
39339
41521
  showPassword && (React__default.createElement(React__default.Fragment, null,
39340
41522
  React__default.createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
39341
41523
  React__default.createElement(VisuallyHidden, null,
@@ -39345,26 +41527,6 @@ var TextInput = forwardRef(function (_a, ref) {
39345
41527
  : "Your password is hidden")))))))));
39346
41528
  });
39347
41529
 
39348
- const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
39349
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, props, {
39350
- ref: forwardedRef,
39351
- style: {
39352
- // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
39353
- position: 'absolute',
39354
- border: 0,
39355
- width: 1,
39356
- height: 1,
39357
- padding: 0,
39358
- margin: -1,
39359
- overflow: 'hidden',
39360
- clip: 'rect(0, 0, 0, 0)',
39361
- whiteSpace: 'nowrap',
39362
- wordWrap: 'normal',
39363
- ...props.style
39364
- }
39365
- }));
39366
- });
39367
-
39368
41530
  /* -------------------------------------------------------------------------------------------------
39369
41531
  * ToastProvider
39370
41532
  * -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
@@ -39954,7 +42116,7 @@ function $054eb8030ebde76e$var$getAnnounceTextContent(container) {
39954
42116
  if (handler) currentTarget.addEventListener(name, handler, {
39955
42117
  once: true
39956
42118
  });
39957
- if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(currentTarget, event);
42119
+ if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(currentTarget, event);
39958
42120
  else currentTarget.dispatchEvent(event);
39959
42121
  }
39960
42122
  const $054eb8030ebde76e$var$isDeltaInDirection = (delta, direction, threshold = 0)=>{
@@ -40061,11 +42223,44 @@ var Truncate = function (_a) {
40061
42223
  return (React__default.createElement("div", __assign({ className: "arc-Truncate", style: { maxWidth: "".concat(maxWidth, "%") }, title: title }, filterDataAttrs(props)), children));
40062
42224
  };
40063
42225
 
42226
+ // move arrow to right all the time when no meta text
42227
+ // 1 typography card + 2 media cards
42228
+ var TypographyCard = function (_a) {
42229
+ var url = _a.url, onClick = _a.onClick, heading = _a.heading, metaText = _a.metaText, label = _a.label, _b = _a.linkData, linkData = _b === void 0 ? {} : _b, _c = _a.pathway, pathway = _c === void 0 ? "light" : _c, _d = _a.buttonIcon, buttonIcon = _d === void 0 ? "arrow" : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e, props = __rest(_a, ["url", "onClick", "heading", "metaText", "label", "linkData", "pathway", "buttonIcon", "headingLevel"]);
42230
+ var HeadingElement = "h".concat(headingLevel);
42231
+ var icons = {
42232
+ arrow: {
42233
+ regular: BtIconArrowRight,
42234
+ hover: BtIconArrowRightFill
42235
+ },
42236
+ play: {
42237
+ regular: BtIconPlay,
42238
+ hover: BtIconPlayFill
42239
+ }
42240
+ };
42241
+ return (React__default.createElement("div", __assign({ className: classNames("arc-TypographyCard", {
42242
+ "arc-TypographyCard--darkPathway": pathway === "dark",
42243
+ "arc-TypographyCard--lightPathway": pathway === "light"
42244
+ }) }, filterDataAttrs(props)),
42245
+ React__default.createElement("div", { className: "arc-TypographyCard-contentContainer" },
42246
+ label && (React__default.createElement("div", { className: "arc-TypographyCard-labelContainer" },
42247
+ React__default.createElement("span", { className: "arc-TypographyCard-label" }, label))),
42248
+ React__default.createElement(HeadingElement, { className: "arc-TypographyCard-heading" },
42249
+ React__default.createElement("a", __assign({ className: "arc-TypographyCard-headingLink", href: url, onClick: onClick }, filterDataAttrs(linkData)), heading))),
42250
+ React__default.createElement("div", { className: "arc-TypographyCard-footer" },
42251
+ React__default.createElement("div", { className: "arc-TypographyCard-metaTextContainer" }, metaText && (React__default.createElement("span", { className: "arc-TypographyCard-metaText" }, metaText))),
42252
+ React__default.createElement("div", { className: "arc-TypographyCard-footerButton" },
42253
+ React__default.createElement("div", { className: classNames("arc-TypographyCard-footerButtonIcon", "arc-TypographyCard-footerButtonIcon--regular") },
42254
+ React__default.createElement(Icon, { icon: icons[buttonIcon].regular, size: 40 })),
42255
+ React__default.createElement("div", { className: "arc-TypographyCard-footerButtonIcon arc-TypographyCard-footerButtonIcon--hover" },
42256
+ React__default.createElement(Icon, { icon: icons[buttonIcon].hover, size: 40 }))))));
42257
+ };
42258
+
40064
42259
  /**
40065
42260
  * Use `UniversalHeader` to display a group-level page header.
40066
42261
  */
40067
42262
  var UniversalHeader = function (_a) {
40068
- var children = _a.children, props = __rest(_a, ["children"]);
42263
+ var children = _a.children, ContentSlot = _a.ContentSlot, props = __rest(_a, ["children", "ContentSlot"]);
40069
42264
  useEffect(function () {
40070
42265
  React__default.Children.map(children, function (item) {
40071
42266
  if (item && item.type !== UniversalHeaderItem) {
@@ -40075,7 +42270,9 @@ var UniversalHeader = function (_a) {
40075
42270
  }, [children]);
40076
42271
  return (React__default.createElement("nav", __assign({ className: "arc-UniversalHeader" }, filterDataAttrs(props)),
40077
42272
  React__default.createElement(Surface, { background: "light" },
40078
- React__default.createElement("ul", { className: "arc-UniversalHeader-items" }, children))));
42273
+ React__default.createElement("ul", { className: "arc-UniversalHeader-items" },
42274
+ children,
42275
+ ContentSlot && (React__default.createElement("li", { className: "arc-UniversalHeader-contentSlot" }, ContentSlot))))));
40079
42276
  };
40080
42277
  var UniversalHeaderItem = function (_a) {
40081
42278
  var children = _a.children, href = _a.href, props = __rest(_a, ["children", "href"]);
@@ -40084,5 +42281,5 @@ var UniversalHeaderItem = function (_a) {
40084
42281
  };
40085
42282
  UniversalHeader.Item = UniversalHeaderItem;
40086
42283
 
40087
- export { Alert, Align, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$3 as SurfaceContext, Switch, Tabs, Tag, Text, TextArea, TextInput, Toast, Truncate, UniversalHeader, VerticalSpace, VisuallyHidden };
42284
+ export { Alert, Align, Badge, Base, Box, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, DisclosureMini, Elevation, Filter, FormControl, Group, Heading, Icon, Image, InformationCard, Markup, MediaCard, Modal, Pagination, PaginationSimple, Poster, ProgressBar, ProgressStepper, RadioGroup, Rule, ScrollToTop, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$3 as SurfaceContext, Switch, Tabs, Tag, Text, TextArea, TextInput, Toast, Truncate, TypographyCard, UniversalHeader, VerticalSpace, VisuallyHidden };
40088
42285
  //# sourceMappingURL=index.es.js.map