@arc-ui/components 11.7.0 → 11.8.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 (230) hide show
  1. package/dist/Alert/Alert.cjs.d.ts +1 -1
  2. package/dist/Alert/Alert.cjs.js +10 -89
  3. package/dist/Alert/Alert.esm.d.ts +1 -1
  4. package/dist/Alert/Alert.esm.js +3 -82
  5. package/dist/Badge/Badge.cjs.js +3 -3
  6. package/dist/Badge/Badge.esm.js +4 -4
  7. package/dist/Box/Box.cjs.d.ts +40 -1
  8. package/dist/Box/Box.cjs.js +25 -6
  9. package/dist/Box/Box.esm.d.ts +40 -1
  10. package/dist/Box/Box.esm.js +24 -5
  11. package/dist/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -1
  12. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +2 -2
  13. package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -1
  14. package/dist/Breadcrumbs/Breadcrumbs.esm.js +2 -2
  15. package/dist/Button/Button.cjs.d.ts +1 -1
  16. package/dist/Button/Button.cjs.js +1 -1
  17. package/dist/Button/Button.esm.d.ts +1 -1
  18. package/dist/Button/Button.esm.js +1 -1
  19. package/dist/Card/Card.cjs.d.ts +1 -1
  20. package/dist/Card/Card.cjs.js +2 -2
  21. package/dist/Card/Card.esm.d.ts +1 -1
  22. package/dist/Card/Card.esm.js +2 -2
  23. package/dist/Checkbox/Checkbox.cjs.d.ts +1 -1
  24. package/dist/Checkbox/Checkbox.cjs.js +4 -4
  25. package/dist/Checkbox/Checkbox.esm.d.ts +1 -1
  26. package/dist/Checkbox/Checkbox.esm.js +4 -4
  27. package/dist/Columns/Columns.cjs.d.ts +1 -1
  28. package/dist/Columns/Columns.esm.d.ts +1 -1
  29. package/dist/Curve/Curve.cjs.d.ts +1 -1
  30. package/dist/Curve/Curve.cjs.js +1 -1
  31. package/dist/Curve/Curve.esm.d.ts +1 -1
  32. package/dist/Curve/Curve.esm.js +1 -1
  33. package/dist/Disclosure/Disclosure.cjs.d.ts +1 -1
  34. package/dist/Disclosure/Disclosure.cjs.js +1 -1
  35. package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
  36. package/dist/Disclosure/Disclosure.esm.js +1 -1
  37. package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
  38. package/dist/DisclosureMini/DisclosureMini.cjs.js +2 -2
  39. package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
  40. package/dist/DisclosureMini/DisclosureMini.esm.js +2 -2
  41. package/dist/FormControl/FormControl.cjs.d.ts +1 -1
  42. package/dist/FormControl/FormControl.cjs.js +3 -3
  43. package/dist/FormControl/FormControl.esm.d.ts +1 -1
  44. package/dist/FormControl/FormControl.esm.js +3 -3
  45. package/dist/Heading/Heading.cjs.d.ts +1 -1
  46. package/dist/Heading/Heading.cjs.js +1 -1
  47. package/dist/Heading/Heading.esm.d.ts +1 -1
  48. package/dist/Heading/Heading.esm.js +1 -1
  49. package/dist/Modal/Modal.cjs.d.ts +31 -9
  50. package/dist/Modal/Modal.cjs.js +450 -161
  51. package/dist/Modal/Modal.esm.d.ts +31 -9
  52. package/dist/Modal/Modal.esm.js +423 -134
  53. package/dist/Pagination/Pagination.cjs.js +4 -4
  54. package/dist/Pagination/Pagination.esm.js +4 -4
  55. package/dist/PaginationSimple/PaginationSimple.cjs.js +4 -4
  56. package/dist/PaginationSimple/PaginationSimple.esm.js +4 -4
  57. package/dist/ProgressBar/ProgressBar.cjs.js +5 -5
  58. package/dist/ProgressBar/ProgressBar.esm.js +6 -6
  59. package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
  60. package/dist/RadioGroup/RadioGroup.cjs.js +4 -4
  61. package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
  62. package/dist/RadioGroup/RadioGroup.esm.js +4 -4
  63. package/dist/Select/Select.cjs.d.ts +1 -1
  64. package/dist/Select/Select.cjs.js +995 -60
  65. package/dist/Select/Select.esm.d.ts +1 -1
  66. package/dist/Select/Select.esm.js +948 -32
  67. package/dist/SiteFooter/SiteFooter.cjs.d.ts +1 -1
  68. package/dist/SiteFooter/SiteFooter.cjs.js +2 -2
  69. package/dist/SiteFooter/SiteFooter.esm.d.ts +1 -1
  70. package/dist/SiteFooter/SiteFooter.esm.js +3 -3
  71. package/dist/SiteHeader/SiteHeader.cjs.d.ts +1 -1
  72. package/dist/SiteHeader/SiteHeader.cjs.js +3 -3
  73. package/dist/SiteHeader/SiteHeader.esm.d.ts +1 -1
  74. package/dist/SiteHeader/SiteHeader.esm.js +3 -3
  75. package/dist/Switch/Switch.cjs.d.ts +1 -1
  76. package/dist/Switch/Switch.cjs.js +241 -18
  77. package/dist/Switch/Switch.esm.d.ts +1 -1
  78. package/dist/Switch/Switch.esm.js +234 -11
  79. package/dist/Tabs/Tabs.cjs.d.ts +75 -0
  80. package/dist/Tabs/Tabs.cjs.js +514 -0
  81. package/dist/Tabs/Tabs.esm.d.ts +75 -0
  82. package/dist/Tabs/Tabs.esm.js +506 -0
  83. package/dist/Tabs/package.json +7 -0
  84. package/dist/Text/Text.cjs.d.ts +1 -1
  85. package/dist/Text/Text.cjs.js +1 -1
  86. package/dist/Text/Text.esm.d.ts +1 -1
  87. package/dist/Text/Text.esm.js +1 -1
  88. package/dist/TextArea/TextArea.cjs.d.ts +4 -1
  89. package/dist/TextArea/TextArea.cjs.js +14 -13
  90. package/dist/TextArea/TextArea.esm.d.ts +4 -1
  91. package/dist/TextArea/TextArea.esm.js +14 -13
  92. package/dist/TextInput/TextInput.cjs.d.ts +1 -1
  93. package/dist/TextInput/TextInput.cjs.js +4 -4
  94. package/dist/TextInput/TextInput.esm.d.ts +1 -1
  95. package/dist/TextInput/TextInput.esm.js +4 -4
  96. package/dist/Toast/Toast.cjs.d.ts +52 -0
  97. package/dist/Toast/Toast.cjs.js +743 -0
  98. package/dist/Toast/Toast.esm.d.ts +52 -0
  99. package/dist/Toast/Toast.esm.js +735 -0
  100. package/dist/Toast/package.json +7 -0
  101. package/dist/Truncate/Truncate.cjs.js +3 -2
  102. package/dist/Truncate/Truncate.esm.js +3 -2
  103. package/dist/_shared/cjs/{Breadcrumbs-9f580f69.js → Breadcrumbs-0906dd10.js} +9 -9
  104. package/dist/_shared/cjs/BtIconTick-42fcc5ec.js +91 -0
  105. package/dist/_shared/{esm/Button-9c3b0b11.d.ts → cjs/Button-5aaa6776.d.ts} +4 -0
  106. package/dist/_shared/cjs/{Button-b4d6ccc8.js → Button-5aaa6776.js} +2 -2
  107. package/dist/_shared/cjs/{Card-f1108bfe.js → Card-fd189ba8.js} +1 -1
  108. package/dist/_shared/cjs/{Checkbox-c927b62f.js → Checkbox-02c546ca.js} +1 -1
  109. package/dist/_shared/cjs/Columns-e90798f8.d.ts +1 -1
  110. package/dist/_shared/cjs/{Curve-b05589d8.d.ts → Curve-781ef633.d.ts} +5 -2
  111. package/dist/_shared/cjs/{Curve-b05589d8.js → Curve-781ef633.js} +5 -2
  112. package/dist/_shared/cjs/{DisclosureMini-2a10006e.js → DisclosureMini-52706ee6.js} +1 -1
  113. package/dist/_shared/cjs/{FormControl-78b007b7.js → FormControl-1e1bf2bf.js} +1 -1
  114. package/dist/_shared/cjs/{Heading-ed1cb455.d.ts → Heading-e3332dcf.d.ts} +4 -0
  115. package/dist/_shared/cjs/{Heading-ed1cb455.js → Heading-e3332dcf.js} +2 -2
  116. package/dist/_shared/{esm/RadioGroup-65b8c8bf.d.ts → cjs/RadioGroup-d7664b0c.d.ts} +1 -1
  117. package/dist/_shared/cjs/{RadioGroup-8e17de70.js → RadioGroup-d7664b0c.js} +1 -1
  118. package/dist/_shared/cjs/{SiteFooter-9f7f9c2d.js → SiteFooter-5da774e1.js} +1 -1
  119. package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +2 -2
  120. package/dist/_shared/cjs/{SiteHeader.rehydrator-ccbebde6.js → SiteHeader.rehydrator-acc9d8c4.js} +2 -2
  121. package/dist/_shared/{esm/Text-14deb70e.d.ts → cjs/Text-fa447e2d.d.ts} +4 -0
  122. package/dist/_shared/cjs/{Text-555a29a4.js → Text-fa447e2d.js} +2 -2
  123. package/dist/_shared/cjs/{TextInput-7ed03a48.d.ts → TextInput-13050538.d.ts} +3 -1
  124. package/dist/_shared/{esm/TextInput-62bb7dee.d.ts → cjs/TextInput-f4549637.d.ts} +1 -1
  125. package/dist/_shared/cjs/{TextInput-b768e346.js → TextInput-f4549637.js} +1 -1
  126. package/dist/_shared/cjs/extends-bb8ffacd.js +21 -0
  127. package/dist/_shared/cjs/index-27b53d49.js +174 -0
  128. package/dist/_shared/cjs/index-699086a7.d.ts +1 -1
  129. package/dist/_shared/cjs/index-74488a9f.d.ts +1 -1
  130. package/dist/_shared/cjs/{index.module-9b87a34d.js → index-952918c9.js} +141 -33
  131. package/dist/_shared/cjs/index-96c4d581.js +289 -0
  132. package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
  133. package/dist/_shared/cjs/index-e340924e.d.ts +1 -1
  134. package/dist/_shared/cjs/index-e6d20018.d.ts +1 -1
  135. package/dist/_shared/cjs/index-eb06f640.d.ts +1 -1
  136. package/dist/_shared/cjs/{index-31fbb076.js → index-ec260f5e.js} +0 -547
  137. package/dist/_shared/cjs/index-f419cf04.d.ts +1 -1
  138. package/dist/_shared/cjs/index-fb4b8fda.js +47 -0
  139. package/dist/_shared/cjs/index.module-bbcc4e18.js +126 -0
  140. package/dist/_shared/esm/{Breadcrumbs-5dc0afa7.js → Breadcrumbs-dafa8dde.js} +9 -9
  141. package/dist/_shared/esm/BtIconTick-5fe50cc7.js +83 -0
  142. package/dist/_shared/{cjs/Button-b4d6ccc8.d.ts → esm/Button-d1dbcf79.d.ts} +4 -0
  143. package/dist/_shared/esm/{Button-9c3b0b11.js → Button-d1dbcf79.js} +2 -2
  144. package/dist/_shared/esm/{Card-79b6eae0.js → Card-e62c3ff6.js} +1 -1
  145. package/dist/_shared/esm/{Checkbox-2d144384.js → Checkbox-d8891198.js} +1 -1
  146. package/dist/_shared/esm/Columns-8704515b.d.ts +1 -1
  147. package/dist/_shared/esm/{Curve-3e87b1bc.d.ts → Curve-bbc5589c.d.ts} +5 -2
  148. package/dist/_shared/esm/{Curve-3e87b1bc.js → Curve-bbc5589c.js} +5 -2
  149. package/dist/_shared/esm/{DisclosureMini-78a8f392.js → DisclosureMini-9b819941.js} +1 -1
  150. package/dist/_shared/esm/{FormControl-2fa7aae5.js → FormControl-f18e2f59.js} +1 -1
  151. package/dist/_shared/esm/{Heading-ee6bec51.d.ts → Heading-0f629151.d.ts} +4 -0
  152. package/dist/_shared/esm/{Heading-ee6bec51.js → Heading-0f629151.js} +2 -2
  153. package/dist/_shared/{cjs/RadioGroup-8e17de70.d.ts → esm/RadioGroup-be16d5d3.d.ts} +1 -1
  154. package/dist/_shared/esm/{RadioGroup-65b8c8bf.js → RadioGroup-be16d5d3.js} +1 -1
  155. package/dist/_shared/esm/{SiteFooter-51bdc7df.js → SiteFooter-a182cb18.js} +1 -1
  156. package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +2 -2
  157. package/dist/_shared/esm/{SiteHeader.rehydrator-382d1c03.js → SiteHeader.rehydrator-023b7b76.js} +2 -2
  158. package/dist/_shared/{cjs/Text-555a29a4.d.ts → esm/Text-40457811.d.ts} +4 -0
  159. package/dist/_shared/esm/{Text-14deb70e.js → Text-40457811.js} +2 -2
  160. package/dist/_shared/esm/{TextInput-7ed03a48.d.ts → TextInput-13050538.d.ts} +3 -1
  161. package/dist/_shared/{cjs/TextInput-b768e346.d.ts → esm/TextInput-4424c195.d.ts} +3 -3
  162. package/dist/_shared/esm/{TextInput-62bb7dee.js → TextInput-4424c195.js} +1 -1
  163. package/dist/_shared/esm/extends-4575346e.js +19 -0
  164. package/dist/_shared/esm/{index.module-216016b5.js → index-22aad354.js} +138 -29
  165. package/dist/_shared/esm/{index-4fa635bd.js → index-369dce7f.js} +2 -541
  166. package/dist/_shared/esm/index-699086a7.d.ts +1 -1
  167. package/dist/_shared/esm/index-74488a9f.d.ts +1 -1
  168. package/dist/_shared/esm/index-8000d9e3.js +168 -0
  169. package/dist/_shared/esm/index-94ecc5f8.js +280 -0
  170. package/dist/_shared/esm/index-bed18a88.js +26 -0
  171. package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
  172. package/dist/_shared/esm/index-e340924e.d.ts +1 -1
  173. package/dist/_shared/esm/index-e6d20018.d.ts +1 -1
  174. package/dist/_shared/esm/index-eb06f640.d.ts +1 -1
  175. package/dist/_shared/esm/index-f419cf04.d.ts +1 -1
  176. package/dist/_shared/esm/index.module-5ed90b21.js +122 -0
  177. package/dist/index.es.js +2807 -1034
  178. package/dist/index.es.js.map +1 -1
  179. package/dist/index.js +3014 -1240
  180. package/dist/index.js.map +1 -1
  181. package/dist/styles.css +1 -1
  182. package/dist/types/components/Button/Button.d.ts +4 -0
  183. package/dist/types/components/Columns/Columns.d.ts +1 -1
  184. package/dist/types/components/Columns/index.d.ts +1 -1
  185. package/dist/types/components/Curve/Curve.d.ts +5 -2
  186. package/dist/types/components/Heading/Heading.d.ts +4 -0
  187. package/dist/types/components/Modal/Modal.d.ts +31 -9
  188. package/dist/types/components/Tabs/Tab/Tab.d.ts +22 -0
  189. package/dist/types/components/Tabs/Tab/index.d.ts +1 -0
  190. package/dist/types/components/Tabs/TabContent/TabContent.d.ts +12 -0
  191. package/dist/types/components/Tabs/TabContent/index.d.ts +1 -0
  192. package/dist/types/components/Tabs/Tabs.d.ts +27 -0
  193. package/dist/types/components/Tabs/TabsList/TabsList.d.ts +20 -0
  194. package/dist/types/components/Tabs/TabsList/index.d.ts +1 -0
  195. package/dist/types/components/Tabs/index.d.ts +1 -0
  196. package/dist/types/components/Text/Text.d.ts +4 -0
  197. package/dist/types/components/TextArea/TextArea.d.ts +3 -0
  198. package/dist/types/components/TextInput/TextInput.d.ts +2 -0
  199. package/dist/types/components/Toast/Toast.d.ts +14 -0
  200. package/dist/types/components/Toast/ToastNotification.d.ts +39 -0
  201. package/dist/types/components/Toast/index.d.ts +1 -0
  202. package/dist/types/components/index.d.ts +1 -0
  203. package/dist/types/styles.d.ts +3 -2
  204. package/package.json +8 -6
  205. package/dist/MediaCard/MediaCard.cjs.d.ts +0 -61
  206. package/dist/MediaCard/MediaCard.cjs.js +0 -31
  207. package/dist/MediaCard/MediaCard.esm.d.ts +0 -61
  208. package/dist/MediaCard/MediaCard.esm.js +0 -23
  209. package/dist/MediaCard/package.json +0 -7
  210. package/dist/_shared/cjs/Box-ebe2b7be.d.ts +0 -39
  211. package/dist/_shared/cjs/Box-ebe2b7be.js +0 -30
  212. package/dist/_shared/cjs/index.module-5ea728f4.js +0 -23
  213. package/dist/_shared/esm/Box-06d99d8a.d.ts +0 -39
  214. package/dist/_shared/esm/Box-06d99d8a.js +0 -24
  215. package/dist/_shared/esm/index.module-88179159.js +0 -21
  216. package/dist/types/components/Modal/Modal.stories-wip.d.ts +0 -9
  217. /package/dist/_shared/cjs/{Breadcrumbs-9f580f69.d.ts → Breadcrumbs-0906dd10.d.ts} +0 -0
  218. /package/dist/_shared/cjs/{Card-f1108bfe.d.ts → Card-fd189ba8.d.ts} +0 -0
  219. /package/dist/_shared/cjs/{Checkbox-c927b62f.d.ts → Checkbox-02c546ca.d.ts} +0 -0
  220. /package/dist/_shared/cjs/{DisclosureMini-2a10006e.d.ts → DisclosureMini-52706ee6.d.ts} +0 -0
  221. /package/dist/_shared/cjs/{FormControl-78b007b7.d.ts → FormControl-1e1bf2bf.d.ts} +0 -0
  222. /package/dist/_shared/cjs/{SiteFooter-9f7f9c2d.d.ts → SiteFooter-5da774e1.d.ts} +0 -0
  223. /package/dist/_shared/cjs/{SiteHeader.rehydrator-ccbebde6.d.ts → SiteHeader.rehydrator-acc9d8c4.d.ts} +0 -0
  224. /package/dist/_shared/esm/{Breadcrumbs-5dc0afa7.d.ts → Breadcrumbs-dafa8dde.d.ts} +0 -0
  225. /package/dist/_shared/esm/{Card-79b6eae0.d.ts → Card-e62c3ff6.d.ts} +0 -0
  226. /package/dist/_shared/esm/{Checkbox-2d144384.d.ts → Checkbox-d8891198.d.ts} +0 -0
  227. /package/dist/_shared/esm/{DisclosureMini-78a8f392.d.ts → DisclosureMini-9b819941.d.ts} +0 -0
  228. /package/dist/_shared/esm/{FormControl-2fa7aae5.d.ts → FormControl-f18e2f59.d.ts} +0 -0
  229. /package/dist/_shared/esm/{SiteFooter-51bdc7df.d.ts → SiteFooter-a182cb18.d.ts} +0 -0
  230. /package/dist/_shared/esm/{SiteHeader.rehydrator-382d1c03.d.ts → SiteHeader.rehydrator-023b7b76.d.ts} +0 -0
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import * as React$b from 'react';
2
- import React__default, { createContext, useContext, useRef, useState, useEffect, forwardRef, useMemo, createElement, useCallback, Children, isValidElement, cloneElement, Fragment, useLayoutEffect, useId } from 'react';
1
+ import * as React$c from 'react';
2
+ import React__default, { createContext, useContext, useRef, useState, useEffect, forwardRef, useCallback, useMemo, createElement, useLayoutEffect, Children, isValidElement, cloneElement, Fragment, useReducer, useId } from 'react';
3
3
 
4
4
  /*! *****************************************************************************
5
5
  Copyright (c) Microsoft Corporation.
@@ -853,9 +853,9 @@ function debounce(func, wait, options) {
853
853
 
854
854
  var debounce_1 = debounce;
855
855
 
856
- const React$a = React__default;
856
+ const React$b = React__default;
857
857
  const BtIconChevronLeft2Px = props =>
858
- /*#__PURE__*/ React$a.createElement(
858
+ /*#__PURE__*/ React$b.createElement(
859
859
  "svg",
860
860
  Object.assign(
861
861
  {
@@ -864,8 +864,8 @@ const BtIconChevronLeft2Px = props =>
864
864
  },
865
865
  props
866
866
  ),
867
- /*#__PURE__*/ React$a.createElement("defs", null),
868
- /*#__PURE__*/ React$a.createElement("path", {
867
+ /*#__PURE__*/ React$b.createElement("defs", null),
868
+ /*#__PURE__*/ React$b.createElement("path", {
869
869
  d:
870
870
  "M22.5,29.99854a.99676.99676,0,0,1-.707-.293L8.08594,15.99268,21.793,2.294A1.00023,1.00023,0,0,1,23.207,3.709l-12.293,12.28467L23.207,28.2915a1,1,0,0,1-.707,1.707Z",
871
871
  fill: "currentColor"
@@ -873,9 +873,9 @@ const BtIconChevronLeft2Px = props =>
873
873
  );
874
874
  var BtIconChevronLeft2Px_2 = BtIconChevronLeft2Px;
875
875
 
876
- const React$9 = React__default;
876
+ const React$a = React__default;
877
877
  const BtIconChevronRight2Px = props =>
878
- /*#__PURE__*/ React$9.createElement(
878
+ /*#__PURE__*/ React$a.createElement(
879
879
  "svg",
880
880
  Object.assign(
881
881
  {
@@ -884,8 +884,8 @@ const BtIconChevronRight2Px = props =>
884
884
  },
885
885
  props
886
886
  ),
887
- /*#__PURE__*/ React$9.createElement("defs", null),
888
- /*#__PURE__*/ React$9.createElement("path", {
887
+ /*#__PURE__*/ React$a.createElement("defs", null),
888
+ /*#__PURE__*/ React$a.createElement("path", {
889
889
  d:
890
890
  "M9.5,29.99854A1.00025,1.00025,0,0,1,8.793,28.291l12.293-12.28467L8.793,3.7085A.99989.99989,0,0,1,10.207,2.29443l13.707,13.71289L10.207,29.70605A.99827.99827,0,0,1,9.5,29.99854Z",
891
891
  fill: "currentColor"
@@ -893,9 +893,9 @@ const BtIconChevronRight2Px = props =>
893
893
  );
894
894
  var BtIconChevronRight2Px_2 = BtIconChevronRight2Px;
895
895
 
896
- const React$8 = React__default;
896
+ const React$9 = React__default;
897
897
  const ArcIconArc = props =>
898
- /*#__PURE__*/ React$8.createElement(
898
+ /*#__PURE__*/ React$9.createElement(
899
899
  "svg",
900
900
  Object.assign(
901
901
  {
@@ -904,7 +904,7 @@ const ArcIconArc = props =>
904
904
  },
905
905
  props
906
906
  ),
907
- /*#__PURE__*/ React$8.createElement("path", {
907
+ /*#__PURE__*/ React$9.createElement("path", {
908
908
  fill: "none",
909
909
  d: "M3.472 11.69a6.5 6.5 0 012.321-6.839A6.5 6.5 0 0113 4.38",
910
910
  stroke: "currentColor"
@@ -977,8 +977,8 @@ var Icon = function (_a) {
977
977
  };
978
978
 
979
979
  var BreadcrumbsItem = function (_a) {
980
- var spacerIconAfter = _a.spacerIconAfter, spacerIconBefore = _a.spacerIconBefore, children = _a.children;
981
- return (React__default.createElement("li", { className: "arc-Breadcrumbs-item" },
980
+ var spacerIconAfter = _a.spacerIconAfter, spacerIconBefore = _a.spacerIconBefore, children = _a.children, props = __rest$2(_a, ["spacerIconAfter", "spacerIconBefore", "children"]);
981
+ return (React__default.createElement("li", __assign$2({ className: "arc-Breadcrumbs-item" }, filterDataAttrs(props)),
982
982
  spacerIconBefore && (React__default.createElement("div", { className: "arc-Breadcrumbs-spacerIcon", "data-testid": "arc-chevron-left-2px" },
983
983
  React__default.createElement(Icon, { icon: BtIconChevronLeft2Px_2 }))),
984
984
  children,
@@ -999,18 +999,18 @@ var handleLinkClick = function (_a) {
999
999
  };
1000
1000
 
1001
1001
  var BreadcrumbsLink = React__default.forwardRef(function (_a, ref) {
1002
- var onClick = _a.onClick, href = _a.href, isActive = _a.isActive, children = _a.children;
1002
+ var onClick = _a.onClick, href = _a.href, isActive = _a.isActive, children = _a.children, props = __rest$2(_a, ["onClick", "href", "isActive", "children"]);
1003
1003
  return (React__default.createElement(React__default.Fragment, null, isActive || href === undefined ? (React__default.createElement("span", __assign$2({}, (isActive && { "aria-hidden": "true" }), { onClick: onClick, className: classNames({
1004
1004
  "arc-Breadcrumbs-text": true,
1005
1005
  "arc-Breadcrumbs-text--active": isActive
1006
- }) }), children)) : (React__default.createElement("a", __assign$2({}, (onClick && ref
1006
+ }) }, filterDataAttrs(props)), children)) : (React__default.createElement("a", __assign$2({}, (onClick && ref
1007
1007
  ? { onClick: onClick }
1008
- : { onClick: handleLinkClick({ handler: onClick }) }), { className: "arc-Breadcrumbs-text", ref: ref, href: href }), children))));
1008
+ : { onClick: handleLinkClick({ handler: onClick }) }), { className: "arc-Breadcrumbs-text", ref: ref, href: href }, filterDataAttrs(props)), children))));
1009
1009
  });
1010
1010
 
1011
1011
  /** Use `Breadcrumbs` to add a secondary navigation scheme that reveals the user’s location. Each item should be wrapped with `Breadcrumbs.Item` */
1012
1012
  var Breadcrumbs = function (_a) {
1013
- var isLight = _a.isLight, children = _a.children;
1013
+ var isLight = _a.isLight, children = _a.children, props = __rest$2(_a, ["isLight", "children"]);
1014
1014
  var breadcrumbsList = useRef(null);
1015
1015
  var _b = useState(false), isCompressed = _b[0], setIsCompressed = _b[1];
1016
1016
  var _c = useState(false), showBackTrail = _c[0], setShowBackTrail = _c[1];
@@ -1049,10 +1049,10 @@ var Breadcrumbs = function (_a) {
1049
1049
  // eslint-disable-next-line
1050
1050
  }, []);
1051
1051
  var items = React__default.Children.toArray(children);
1052
- return (React__default.createElement("nav", { "aria-label": "Breadcrumbs", role: "navigation", className: classNames({
1052
+ return (React__default.createElement("nav", __assign$2({ "aria-label": "Breadcrumbs", role: "navigation", className: classNames({
1053
1053
  "arc-Breadcrumbs": true,
1054
1054
  "arc-Breadcrumbs--dark": isLight
1055
- }) },
1055
+ }) }, filterDataAttrs(props)),
1056
1056
  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,
1057
1057
  React__default.createElement(Breadcrumbs.Item, { spacerIconAfter: true }, items[0].props.children),
1058
1058
  React__default.createElement(Breadcrumbs.Item, { spacerIconAfter: true },
@@ -1097,9 +1097,9 @@ var BrandLogo = function (_a) {
1097
1097
  } }, filterDataAttrs(props)), label ? React__default.createElement("span", { className: "arc-BrandLogo-text" }, label) : null));
1098
1098
  };
1099
1099
 
1100
- const React$7 = React__default;
1100
+ const React$8 = React__default;
1101
1101
  const BtIconChevronLeftMid = props =>
1102
- /*#__PURE__*/ React$7.createElement(
1102
+ /*#__PURE__*/ React$8.createElement(
1103
1103
  "svg",
1104
1104
  Object.assign(
1105
1105
  {
@@ -1109,7 +1109,7 @@ const BtIconChevronLeftMid = props =>
1109
1109
  },
1110
1110
  props
1111
1111
  ),
1112
- /*#__PURE__*/ React$7.createElement("path", {
1112
+ /*#__PURE__*/ React$8.createElement("path", {
1113
1113
  fillRule: "evenodd",
1114
1114
  clipRule: "evenodd",
1115
1115
  d:
@@ -1119,9 +1119,9 @@ const BtIconChevronLeftMid = props =>
1119
1119
  );
1120
1120
  var BtIconChevronLeftMid_2 = BtIconChevronLeftMid;
1121
1121
 
1122
- const React$6 = React__default;
1122
+ const React$7 = React__default;
1123
1123
  const BtIconChevronRightMid = props =>
1124
- /*#__PURE__*/ React$6.createElement(
1124
+ /*#__PURE__*/ React$7.createElement(
1125
1125
  "svg",
1126
1126
  Object.assign(
1127
1127
  {
@@ -1131,7 +1131,7 @@ const BtIconChevronRightMid = props =>
1131
1131
  },
1132
1132
  props
1133
1133
  ),
1134
- /*#__PURE__*/ React$6.createElement("path", {
1134
+ /*#__PURE__*/ React$7.createElement("path", {
1135
1135
  fillRule: "evenodd",
1136
1136
  clipRule: "evenodd",
1137
1137
  d:
@@ -1146,7 +1146,7 @@ var BtIconChevronRightMid_2 = BtIconChevronRightMid;
1146
1146
  */
1147
1147
  var Button = forwardRef(function (_a, ref) {
1148
1148
  var _b;
1149
- var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, supportingText = _a.supportingText, target = _a.target, type = _a.type, props = __rest$2(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type"]);
1149
+ var ariaLabel = _a.ariaLabel, _c = _a.fill, fill = _c === void 0 ? "solid" : _c, href = _a.href, icon = _a.icon, _d = _a.iconPosition, iconPosition = _d === void 0 ? "afterText" : _d, id = _a.id, _e = _a.isDisabled, isDisabled = _e === void 0 ? false : _e, _f = _a.isDisplayBlock, isDisplayBlock = _f === void 0 ? false : _f, _g = _a.isFullWidth, isFullWidth = _g === void 0 ? false : _g, label = _a.label, onClick = _a.onClick, rel = _a.rel, supportingText = _a.supportingText, target = _a.target, type = _a.type, form = _a.form, props = __rest$2(_a, ["ariaLabel", "fill", "href", "icon", "iconPosition", "id", "isDisabled", "isDisplayBlock", "isFullWidth", "label", "onClick", "rel", "supportingText", "target", "type", "form"]);
1150
1150
  var surface = useContext(Context$3).surface;
1151
1151
  var buttonClasses = classNames((_b = {
1152
1152
  "arc-Button": true,
@@ -1171,7 +1171,7 @@ var Button = forwardRef(function (_a, ref) {
1171
1171
  buttonText,
1172
1172
  buttonIcon)));
1173
1173
  }
1174
- return (React__default.createElement("button", __assign$2({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type }),
1174
+ return (React__default.createElement("button", __assign$2({}, commonProps, { "aria-label": ariaLabel, className: buttonClasses, disabled: isDisabled, type: type, form: form }),
1175
1175
  React__default.createElement("span", { className: "arc-Button-inner" },
1176
1176
  buttonText,
1177
1177
  buttonIcon)));
@@ -1219,13 +1219,13 @@ Image.Source = ImageSource;
1219
1219
  */
1220
1220
  var Heading = function (_a) {
1221
1221
  var _b;
1222
- var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, children = _a.children, _e = _a.color, color = _e === void 0 ? "auto" : _e, level = _a.level, size = _a.size, props = __rest$2(_a, ["align", "casing", "children", "color", "level", "size"]);
1222
+ var _c = _a.align, align = _c === void 0 ? "left" : _c, _d = _a.casing, casing = _d === void 0 ? "auto" : _d, children = _a.children, _e = _a.color, color = _e === void 0 ? "auto" : _e, level = _a.level, size = _a.size, id = _a.id, props = __rest$2(_a, ["align", "casing", "children", "color", "level", "size", "id"]);
1223
1223
  var surface = useContext(Context$3).surface;
1224
1224
  var Element = "span";
1225
1225
  if (level) {
1226
1226
  Element = "h".concat(level);
1227
1227
  }
1228
- return (React__default.createElement(Element, __assign$2({ className: classNames((_b = {
1228
+ return (React__default.createElement(Element, __assign$2({ id: id, className: classNames((_b = {
1229
1229
  "arc-Heading": true
1230
1230
  },
1231
1231
  _b[suffixModifier("arc-Heading--align", align)] = align && align !== "left",
@@ -1438,9 +1438,9 @@ var CardLink = function (_a) {
1438
1438
  React__default.createElement(Icon, { testId: "cardIcon", icon: BtIconChevronRightMid_2, size: 24 })))));
1439
1439
  };
1440
1440
 
1441
- const React$5 = React__default;
1441
+ const React$6 = React__default;
1442
1442
  const BtIconTickAlt2Px = props =>
1443
- /*#__PURE__*/ React$5.createElement(
1443
+ /*#__PURE__*/ React$6.createElement(
1444
1444
  "svg",
1445
1445
  Object.assign(
1446
1446
  {
@@ -1449,8 +1449,8 @@ const BtIconTickAlt2Px = props =>
1449
1449
  },
1450
1450
  props
1451
1451
  ),
1452
- /*#__PURE__*/ React$5.createElement("defs", null),
1453
- /*#__PURE__*/ React$5.createElement("path", {
1452
+ /*#__PURE__*/ React$6.createElement("defs", null),
1453
+ /*#__PURE__*/ React$6.createElement("path", {
1454
1454
  d:
1455
1455
  "M13.49963,21.91418l-4.707-4.707a1.0014,1.0014,0,0,1,0-1.41406,1.02353,1.02353,0,0,1,1.41406,0l3.293,3.293,8.293-8.293a.99989.99989,0,1,1,1.41406,1.41406Z",
1456
1456
  fill: "currentColor"
@@ -1458,9 +1458,9 @@ const BtIconTickAlt2Px = props =>
1458
1458
  );
1459
1459
  var BtIconTickAlt2Px_2 = BtIconTickAlt2Px;
1460
1460
 
1461
- const React$4 = React__default;
1461
+ const React$5 = React__default;
1462
1462
  const BtIconAlert = props =>
1463
- /*#__PURE__*/ React$4.createElement(
1463
+ /*#__PURE__*/ React$5.createElement(
1464
1464
  "svg",
1465
1465
  Object.assign(
1466
1466
  {
@@ -1469,17 +1469,17 @@ const BtIconAlert = props =>
1469
1469
  },
1470
1470
  props
1471
1471
  ),
1472
- /*#__PURE__*/ React$4.createElement("defs", null),
1473
- /*#__PURE__*/ React$4.createElement("path", {
1472
+ /*#__PURE__*/ React$5.createElement("defs", null),
1473
+ /*#__PURE__*/ React$5.createElement("path", {
1474
1474
  d:
1475
1475
  "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",
1476
1476
  fill: "currentColor"
1477
1477
  }),
1478
- /*#__PURE__*/ React$4.createElement("path", {
1478
+ /*#__PURE__*/ React$5.createElement("path", {
1479
1479
  fill: "currentColor",
1480
1480
  d: "M16 20.99335A1 1 0 1 0 16 22.99335 1 1 0 1 0 16 20.99335z"
1481
1481
  }),
1482
- /*#__PURE__*/ React$4.createElement("path", {
1482
+ /*#__PURE__*/ React$5.createElement("path", {
1483
1483
  d:
1484
1484
  "M16.00488,19.00977a.49972.49972,0,0,0,.5-.5L16.50684,9.5a.5.5,0,0,0-1,0l-.002,9.00977A.5.5,0,0,0,16.00488,19.00977Z",
1485
1485
  fill: "currentColor"
@@ -1487,9 +1487,9 @@ const BtIconAlert = props =>
1487
1487
  );
1488
1488
  var BtIconAlert_2 = BtIconAlert;
1489
1489
 
1490
- const React$3 = React__default;
1490
+ const React$4 = React__default;
1491
1491
  const BtIconChevronDown2Px = props =>
1492
- /*#__PURE__*/ React$3.createElement(
1492
+ /*#__PURE__*/ React$4.createElement(
1493
1493
  "svg",
1494
1494
  Object.assign(
1495
1495
  {
@@ -1498,8 +1498,8 @@ const BtIconChevronDown2Px = props =>
1498
1498
  },
1499
1499
  props
1500
1500
  ),
1501
- /*#__PURE__*/ React$3.createElement("defs", null),
1502
- /*#__PURE__*/ React$3.createElement("path", {
1501
+ /*#__PURE__*/ React$4.createElement("defs", null),
1502
+ /*#__PURE__*/ React$4.createElement("path", {
1503
1503
  d:
1504
1504
  "M15.99316,23.91406,2.294,10.207A.99989.99989,0,1,1,3.708,8.793l12.28515,12.293L28.292,8.793A.99989.99989,0,1,1,29.70605,10.207Z",
1505
1505
  fill: "currentColor"
@@ -1512,9 +1512,9 @@ var BtIconChevronDown2Px_2 = BtIconChevronDown2Px;
1512
1512
  */
1513
1513
  var Text = function (_a) {
1514
1514
  var _b;
1515
- var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest$2(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
1515
+ var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, id = _a.id, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest$2(_a, ["align", "children", "id", "isInline", "isMeasured", "size", "tone"]);
1516
1516
  var surface = useContext(Context$3).surface;
1517
- return (React__default.createElement("span", __assign$2({ className: classNames((_b = {
1517
+ return (React__default.createElement("span", __assign$2({ id: id, className: classNames((_b = {
1518
1518
  "arc-Text": true
1519
1519
  },
1520
1520
  _b[suffixModifier("arc-Text--align", align)] = align !== "left",
@@ -1732,8 +1732,11 @@ Col.displayName = "Columns.Col";
1732
1732
  Columns.Col = Col;
1733
1733
 
1734
1734
  /**
1735
- * Use `Curve` sparingly to soften edges and create a more natural, less rigid
1736
- * look and feel.
1735
+ #### Deprecation Notice
1736
+
1737
+ The `Curve` component is an outdated brand feature and is being deprecated from Arc as a standalone component or sub-component within other components. Do not use Curve for any new work, and prepare to update any design that features it to remove it.
1738
+
1739
+ `Curve` will be removed from Arc in a subsequent release
1737
1740
  */
1738
1741
  var Curve = function (_a) {
1739
1742
  var _b;
@@ -1940,145 +1943,25 @@ var Markup = function (_a) {
1940
1943
  }) }, filterDataAttrs(props)), children));
1941
1944
  };
1942
1945
 
1943
- /**
1944
- * Use `UniversalHeader` to display a group-level page header.
1945
- */
1946
- var UniversalHeader = function (_a) {
1947
- var children = _a.children, props = __rest$2(_a, ["children"]);
1948
- useEffect(function () {
1949
- React__default.Children.map(children, function (item) {
1950
- if (item && item.type !== UniversalHeaderItem) {
1951
- throw new Error("Illegal child passed to <UniversalHeader />. Ensure to only use <UniversalHeader.Item />.");
1952
- }
1953
- });
1954
- }, [children]);
1955
- return (React__default.createElement("nav", __assign$2({ className: "arc-UniversalHeader" }, filterDataAttrs(props)),
1956
- React__default.createElement(Surface, { background: "light" },
1957
- React__default.createElement("ul", { className: "arc-UniversalHeader-items" }, children))));
1958
- };
1959
- var UniversalHeaderItem = function (_a) {
1960
- var children = _a.children, href = _a.href, props = __rest$2(_a, ["children", "href"]);
1961
- return (React__default.createElement("li", __assign$2({}, filterDataAttrs(props)),
1962
- React__default.createElement("a", { className: "arc-UniversalHeader-link", href: href }, children)));
1963
- };
1964
- UniversalHeaderItem.displayName = "UniversalHeader.Item";
1965
- UniversalHeader.Item = UniversalHeaderItem;
1966
-
1967
- var PosterImage = function (_a) {
1968
- var alt = _a.alt, _b = _a.anchor, anchor = _b === void 0 ? "C" : _b, loading = _a.loading, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, props = __rest$2(_a, ["alt", "anchor", "loading", "sizes", "src", "srcSet"]);
1969
- return (React__default.createElement(Image, __assign$2({ alt: alt, anchor: anchor, fit: "cover", loading: loading, sizes: sizes, src: src, srcSet: srcSet }, props)));
1970
- };
1971
- PosterImage.displayName = "Poster.Image";
1972
-
1973
- var PosterVideo = function (_a) {
1974
- var _b;
1975
- var _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, _d = _a.autoPlay, autoPlay = _d === void 0 ? true : _d, children = _a.children, _e = _a.loop, loop = _e === void 0 ? true : _e, props = __rest$2(_a, ["anchor", "autoPlay", "children", "loop"]);
1976
- return (React__default.createElement("video", __assign$2({ className: classNames((_b = {
1977
- "arc-PosterVideo": true
1978
- },
1979
- _b[suffixModifier("arc-PosterVideo--anchor", anchor)] = anchor,
1980
- _b)), autoPlay: autoPlay, muted: true, loop: loop }, filterDataAttrs(props)), children));
1981
- };
1982
- PosterVideo.displayName = "Poster.Video";
1983
-
1984
- /**
1985
- * Use `Poster` to compose content on an image or video background.
1986
- */
1987
- var Poster = function (_a) {
1988
- var background = _a.background, children = _a.children, _b = _a.overlay, overlay = _b === void 0 ? true : _b, _c = _a.surface, surface = _c === void 0 ? "darker" : _c, props = __rest$2(_a, ["background", "children", "overlay", "surface"]);
1989
- return (React__default.createElement(Surface, { background: surface },
1990
- React__default.createElement("div", __assign$2({ className: classNames({
1991
- "arc-Poster": true,
1992
- "arc-Poster--overlay": overlay,
1993
- "arc-Poster--overlayLight": surface === "lighter"
1994
- }) }, filterDataAttrs(props)),
1995
- React__default.createElement("div", { className: "arc-Poster-backgroundWrapper" }, background),
1996
- React__default.createElement("div", { className: "arc-Poster-body" }, children))));
1997
- };
1998
- PosterImage.displayName = "Poster.Image";
1999
- Poster.Image = PosterImage;
2000
- PosterVideo.displayName = "Poster.Video";
2001
- Poster.Video = PosterVideo;
2002
-
2003
- var RadioContext = createContext({});
2004
- var Provider$2 = RadioContext.Provider;
2005
- var useRadioContext = function () {
2006
- var context = useContext(RadioContext);
2007
- return context;
2008
- };
2009
-
2010
- /**
2011
- * Radio Button component.
2012
- */
2013
- var RadioButton = forwardRef(function (_a, ref) {
2014
- var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest$2(_a, ["helper", "id", "isDisabled", "label", "value"]);
2015
- var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, checkedValue = _b.checkedValue, labelSize = _b.labelSize, name = _b.name, size = _b.size;
2016
- var surface = useContext(Context$3).surface;
2017
- var idLabel = "".concat(id, "-label");
2018
- var checked = checkedValue === value ? true : false;
2019
- return (React__default.createElement("div", __assign$2({ className: classNames({
2020
- "arc-RadioButton": true,
2021
- "arc-RadioButton--disabled": isDisabled || groupDisabled,
2022
- "arc-RadioButton--small": size === "s",
2023
- "arc-RadioButton--smallLabel": labelSize === "s",
2024
- "arc-RadioButton--onDarkSurface": surface === "dark"
2025
- }) }, filterDataAttrs(props)),
2026
- React__default.createElement("label", { className: "arc-RadioButton-label", htmlFor: id, id: idLabel },
2027
- React__default.createElement("input", { className: "arc-RadioButton-input", checked: typeof changeEvent !== "function" ? undefined : checked, defaultChecked: typeof changeEvent !== "function" ? checked : undefined, disabled: isDisabled || groupDisabled, id: id, name: name, onBlur: blurEvent, onChange: changeEvent, ref: ref, type: "radio", value: value }),
2028
- React__default.createElement("span", null,
2029
- label,
2030
- helper && React__default.createElement("span", { className: "arc-RadioButton-helper" }, helper)))));
2031
- });
2032
-
2033
- /**
2034
- * Use `RadioGroup` to wrap and control radio buttons and apply default values
2035
- */
2036
- var RadioGroup = function (_a) {
2037
- var children = _a.children, checkedValue = _a.checkedValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, id = _a.id, helper = _a.helper, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? "l" : _d, props = __rest$2(_a, ["children", "checkedValue", "isDisabled", "id", "helper", "label", "labelSize", "name", "onBlur", "onChange", "size"]);
2038
- useEffect(function () {
2039
- React__default.Children.map(children, function (item) {
2040
- if (item && item.type !== RadioButton) {
2041
- throw new Error("Illegal child passed to <RadioGroup />. Ensure to only use <RadioGroup.RadioButton />.");
2042
- }
2043
- });
2044
- }, [children]);
2045
- return (React__default.createElement(Provider$2, { value: {
2046
- blurEvent: onBlur,
2047
- changeEvent: onChange,
2048
- groupDisabled: isDisabled,
2049
- checkedValue: checkedValue,
2050
- labelSize: labelSize,
2051
- name: name,
2052
- size: size
2053
- } },
2054
- React__default.createElement("div", __assign$2({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
2055
- React__default.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable", helperUnderLabel: true }, children))));
2056
- };
2057
- RadioButton.displayName = "RadioGroup.RadioButton";
2058
- RadioGroup.RadioButton = RadioButton;
2059
-
2060
- /**
2061
- * Use `Rule` to display a horizontal rule.
2062
- */
2063
- var Rule = function (props) {
2064
- var surface = useContext(Context$3).surface;
2065
- return (React__default.createElement("hr", __assign$2({ className: classNames({
2066
- "arc-Rule": true,
2067
- "arc-Rule--onDarkSurface": surface === "dark"
2068
- }) }, filterDataAttrs(props))));
2069
- };
2070
-
2071
- /**
2072
- * Use `Section` to compose content into vertical page layouts.
2073
- */
2074
- var Section = function (_a) {
2075
- var children = _a.children, _b = _a.isFullWidth, isFullWidth = _b === void 0 ? false : _b, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, props = __rest$2(_a, ["children", "isFullWidth", "isDebugVisible"]);
2076
- return (React__default.createElement("div", __assign$2({ className: classNames({
2077
- "arc-Section": true,
2078
- "arc-Section--fullWidth": isFullWidth,
2079
- "arc-Section--debugVisible": isDebugVisible
2080
- }) }, filterDataAttrs(props)), children));
2081
- };
1946
+ const React$3 = React__default;
1947
+ const BtIconCrossAlt2Px = props =>
1948
+ /*#__PURE__*/ React$3.createElement(
1949
+ "svg",
1950
+ Object.assign(
1951
+ {
1952
+ xmlns: "http://www.w3.org/2000/svg",
1953
+ viewBox: "0 0 32 32"
1954
+ },
1955
+ props
1956
+ ),
1957
+ /*#__PURE__*/ React$3.createElement("defs", null),
1958
+ /*#__PURE__*/ React$3.createElement("path", {
1959
+ d:
1960
+ "M17.41406,16l3.793-3.793A.99989.99989,0,0,0,19.793,10.793L16,14.58594l-3.793-3.793A.99989.99989,0,0,0,10.793,12.207L14.58594,16l-3.793,3.793A.99989.99989,0,1,0,12.207,21.207L16,17.41406l3.793,3.793A.99989.99989,0,0,0,21.207,19.793Z",
1961
+ fill: "currentColor"
1962
+ })
1963
+ );
1964
+ var BtIconCrossAlt2Px_2 = BtIconCrossAlt2Px;
2082
1965
 
2083
1966
  function _extends() {
2084
1967
  _extends = Object.assign || function (target) {
@@ -2098,6 +1981,213 @@ function _extends() {
2098
1981
  return _extends.apply(this, arguments);
2099
1982
  }
2100
1983
 
1984
+ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
1985
+ return function handleEvent(event) {
1986
+ originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
1987
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
1988
+ };
1989
+ }
1990
+
1991
+ /**
1992
+ * Set a given ref to a given value
1993
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
1994
+ */ function $6ed0406888f73fc4$var$setRef$4(ref, value) {
1995
+ if (typeof ref === 'function') ref(value);
1996
+ else if (ref !== null && ref !== undefined) ref.current = value;
1997
+ }
1998
+ /**
1999
+ * A utility to compose multiple refs together
2000
+ * Accepts callback refs and RefObject(s)
2001
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af$4(...refs) {
2002
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$4(ref, node)
2003
+ )
2004
+ ;
2005
+ }
2006
+ /**
2007
+ * A custom hook that composes multiple refs
2008
+ * Accepts callback refs and RefObject(s)
2009
+ */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(...refs) {
2010
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2011
+ return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$4(...refs), refs);
2012
+ }
2013
+
2014
+ /* -------------------------------------------------------------------------------------------------
2015
+ * createContextScope
2016
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$2(scopeName, createContextScopeDeps = []) {
2017
+ let defaultContexts = [];
2018
+ /* -----------------------------------------------------------------------------------------------
2019
+ * createContext
2020
+ * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
2021
+ const BaseContext = /*#__PURE__*/ createContext(defaultContext);
2022
+ const index = defaultContexts.length;
2023
+ defaultContexts = [
2024
+ ...defaultContexts,
2025
+ defaultContext
2026
+ ];
2027
+ function Provider(props) {
2028
+ const { scope: scope , children: children , ...context } = props;
2029
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
2030
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2031
+ const value = useMemo(()=>context
2032
+ , Object.values(context));
2033
+ return /*#__PURE__*/ createElement(Context.Provider, {
2034
+ value: value
2035
+ }, children);
2036
+ }
2037
+ function useContext$1(consumerName, scope) {
2038
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
2039
+ const context = useContext(Context);
2040
+ if (context) return context;
2041
+ if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
2042
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
2043
+ }
2044
+ Provider.displayName = rootComponentName + 'Provider';
2045
+ return [
2046
+ Provider,
2047
+ useContext$1
2048
+ ];
2049
+ }
2050
+ /* -----------------------------------------------------------------------------------------------
2051
+ * createScope
2052
+ * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
2053
+ const scopeContexts = defaultContexts.map((defaultContext)=>{
2054
+ return /*#__PURE__*/ createContext(defaultContext);
2055
+ });
2056
+ return function useScope(scope) {
2057
+ const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
2058
+ return useMemo(()=>({
2059
+ [`__scope${scopeName}`]: {
2060
+ ...scope,
2061
+ [scopeName]: contexts
2062
+ }
2063
+ })
2064
+ , [
2065
+ scope,
2066
+ contexts
2067
+ ]);
2068
+ };
2069
+ };
2070
+ createScope.scopeName = scopeName;
2071
+ return [
2072
+ $c512c27ab02ef895$export$fd42f52fd3ae1109,
2073
+ $c512c27ab02ef895$var$composeContextScopes$2(createScope, ...createContextScopeDeps)
2074
+ ];
2075
+ }
2076
+ /* -------------------------------------------------------------------------------------------------
2077
+ * composeContextScopes
2078
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$2(...scopes) {
2079
+ const baseScope = scopes[0];
2080
+ if (scopes.length === 1) return baseScope;
2081
+ const createScope1 = ()=>{
2082
+ const scopeHooks = scopes.map((createScope)=>({
2083
+ useScope: createScope(),
2084
+ scopeName: createScope.scopeName
2085
+ })
2086
+ );
2087
+ return function useComposedScopes(overrideScopes) {
2088
+ const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
2089
+ // We are calling a hook inside a callback which React warns against to avoid inconsistent
2090
+ // renders, however, scoping doesn't have render side effects so we ignore the rule.
2091
+ // eslint-disable-next-line react-hooks/rules-of-hooks
2092
+ const scopeProps = useScope(overrideScopes);
2093
+ const currentScope = scopeProps[`__scope${scopeName}`];
2094
+ return {
2095
+ ...nextScopes,
2096
+ ...currentScope
2097
+ };
2098
+ }, {});
2099
+ return useMemo(()=>({
2100
+ [`__scope${baseScope.scopeName}`]: nextScopes1
2101
+ })
2102
+ , [
2103
+ nextScopes1
2104
+ ]);
2105
+ };
2106
+ };
2107
+ createScope1.scopeName = baseScope.scopeName;
2108
+ return createScope1;
2109
+ }
2110
+
2111
+ /**
2112
+ * On the server, React emits a warning when calling `useLayoutEffect`.
2113
+ * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
2114
+ * We use this safe version which suppresses the warning by replacing it with a noop on the server.
2115
+ *
2116
+ * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
2117
+ */ const $9f79659886946c16$export$e5c5a5f917a5871c$2 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
2118
+
2119
+ const $1746a345f3d73bb7$var$useReactId$1 = React$c['useId'.toString()] || (()=>undefined
2120
+ );
2121
+ let $1746a345f3d73bb7$var$count$1 = 0;
2122
+ function $1746a345f3d73bb7$export$f680877a34711e37$1(deterministicId) {
2123
+ const [id, setId] = React$c.useState($1746a345f3d73bb7$var$useReactId$1()); // React versions older than 18 will have client-side ids only.
2124
+ $9f79659886946c16$export$e5c5a5f917a5871c$2(()=>{
2125
+ if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count$1++)
2126
+ );
2127
+ }, [
2128
+ deterministicId
2129
+ ]);
2130
+ return deterministicId || (id ? `radix-${id}` : '');
2131
+ }
2132
+
2133
+ /**
2134
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
2135
+ * prop or avoid re-executing effects when passed as a dependency
2136
+ */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(callback) {
2137
+ const callbackRef = useRef(callback);
2138
+ useEffect(()=>{
2139
+ callbackRef.current = callback;
2140
+ }); // https://github.com/facebook/react/issues/19240
2141
+ return useMemo(()=>(...args)=>{
2142
+ var _callbackRef$current;
2143
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
2144
+ }
2145
+ , []);
2146
+ }
2147
+
2148
+ function $71cd76cc60e0454e$export$6f32135080cb4c3$2({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
2149
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState$2({
2150
+ defaultProp: defaultProp,
2151
+ onChange: onChange
2152
+ });
2153
+ const isControlled = prop !== undefined;
2154
+ const value1 = isControlled ? prop : uncontrolledProp;
2155
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onChange);
2156
+ const setValue = useCallback((nextValue)=>{
2157
+ if (isControlled) {
2158
+ const setter = nextValue;
2159
+ const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
2160
+ if (value !== prop) handleChange(value);
2161
+ } else setUncontrolledProp(nextValue);
2162
+ }, [
2163
+ isControlled,
2164
+ prop,
2165
+ setUncontrolledProp,
2166
+ handleChange
2167
+ ]);
2168
+ return [
2169
+ value1,
2170
+ setValue
2171
+ ];
2172
+ }
2173
+ function $71cd76cc60e0454e$var$useUncontrolledState$2({ defaultProp: defaultProp , onChange: onChange }) {
2174
+ const uncontrolledState = useState(defaultProp);
2175
+ const [value] = uncontrolledState;
2176
+ const prevValueRef = useRef(value);
2177
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onChange);
2178
+ useEffect(()=>{
2179
+ if (prevValueRef.current !== value) {
2180
+ handleChange(value);
2181
+ prevValueRef.current = value;
2182
+ }
2183
+ }, [
2184
+ value,
2185
+ prevValueRef,
2186
+ handleChange
2187
+ ]);
2188
+ return uncontrolledState;
2189
+ }
2190
+
2101
2191
  var reactDom = {exports: {}};
2102
2192
 
2103
2193
  var reactDom_production_min = {};
@@ -32959,143 +33049,12 @@ if (process.env.NODE_ENV === 'production') {
32959
33049
 
32960
33050
  var $7SXl2$reactdom = reactDom.exports;
32961
33051
 
32962
- function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
32963
- return Math.min(max, Math.max(min, value));
32964
- }
32965
-
32966
- function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
32967
- return function handleEvent(event) {
32968
- originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
32969
- if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
32970
- };
32971
- }
32972
-
32973
- /* -------------------------------------------------------------------------------------------------
32974
- * createContextScope
32975
- * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
32976
- let defaultContexts = [];
32977
- /* -----------------------------------------------------------------------------------------------
32978
- * createContext
32979
- * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
32980
- const BaseContext = /*#__PURE__*/ createContext(defaultContext);
32981
- const index = defaultContexts.length;
32982
- defaultContexts = [
32983
- ...defaultContexts,
32984
- defaultContext
32985
- ];
32986
- function Provider(props) {
32987
- const { scope: scope , children: children , ...context } = props;
32988
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
32989
- // eslint-disable-next-line react-hooks/exhaustive-deps
32990
- const value = useMemo(()=>context
32991
- , Object.values(context));
32992
- return /*#__PURE__*/ createElement(Context.Provider, {
32993
- value: value
32994
- }, children);
32995
- }
32996
- function useContext$1(consumerName, scope) {
32997
- const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
32998
- const context = useContext(Context);
32999
- if (context) return context;
33000
- if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
33001
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
33002
- }
33003
- Provider.displayName = rootComponentName + 'Provider';
33004
- return [
33005
- Provider,
33006
- useContext$1
33007
- ];
33008
- }
33009
- /* -----------------------------------------------------------------------------------------------
33010
- * createScope
33011
- * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
33012
- const scopeContexts = defaultContexts.map((defaultContext)=>{
33013
- return /*#__PURE__*/ createContext(defaultContext);
33014
- });
33015
- return function useScope(scope) {
33016
- const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
33017
- return useMemo(()=>({
33018
- [`__scope${scopeName}`]: {
33019
- ...scope,
33020
- [scopeName]: contexts
33021
- }
33022
- })
33023
- , [
33024
- scope,
33025
- contexts
33026
- ]);
33027
- };
33028
- };
33029
- createScope.scopeName = scopeName;
33030
- return [
33031
- $c512c27ab02ef895$export$fd42f52fd3ae1109,
33032
- $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
33033
- ];
33034
- }
33035
- /* -------------------------------------------------------------------------------------------------
33036
- * composeContextScopes
33037
- * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
33038
- const baseScope = scopes[0];
33039
- if (scopes.length === 1) return baseScope;
33040
- const createScope1 = ()=>{
33041
- const scopeHooks = scopes.map((createScope)=>({
33042
- useScope: createScope(),
33043
- scopeName: createScope.scopeName
33044
- })
33045
- );
33046
- return function useComposedScopes(overrideScopes) {
33047
- const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
33048
- // We are calling a hook inside a callback which React warns against to avoid inconsistent
33049
- // renders, however, scoping doesn't have render side effects so we ignore the rule.
33050
- // eslint-disable-next-line react-hooks/rules-of-hooks
33051
- const scopeProps = useScope(overrideScopes);
33052
- const currentScope = scopeProps[`__scope${scopeName}`];
33053
- return {
33054
- ...nextScopes,
33055
- ...currentScope
33056
- };
33057
- }, {});
33058
- return useMemo(()=>({
33059
- [`__scope${baseScope.scopeName}`]: nextScopes1
33060
- })
33061
- , [
33062
- nextScopes1
33063
- ]);
33064
- };
33065
- };
33066
- createScope1.scopeName = baseScope.scopeName;
33067
- return createScope1;
33068
- }
33069
-
33070
- /**
33071
- * Set a given ref to a given value
33072
- * This utility takes care of different types of refs: callback refs and RefObject(s)
33073
- */ function $6ed0406888f73fc4$var$setRef(ref, value) {
33074
- if (typeof ref === 'function') ref(value);
33075
- else if (ref !== null && ref !== undefined) ref.current = value;
33076
- }
33077
- /**
33078
- * A utility to compose multiple refs together
33079
- * Accepts callback refs and RefObject(s)
33080
- */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
33081
- return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
33082
- )
33083
- ;
33084
- }
33085
- /**
33086
- * A custom hook that composes multiple refs
33087
- * Accepts callback refs and RefObject(s)
33088
- */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
33089
- // eslint-disable-next-line react-hooks/exhaustive-deps
33090
- return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
33091
- }
33092
-
33093
33052
  /* -------------------------------------------------------------------------------------------------
33094
33053
  * Slot
33095
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33054
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33096
33055
  const { children: children , ...slotProps } = props;
33097
33056
  const childrenArray = Children.toArray(children);
33098
- const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
33057
+ const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$2);
33099
33058
  if (slottable) {
33100
33059
  // the new element to render is the one passed as a child of `Slottable`
33101
33060
  const newElement = slottable.props.children;
@@ -33107,35 +33066,35 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
33107
33066
  return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
33108
33067
  } else return child;
33109
33068
  });
33110
- return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
33069
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$2, _extends({}, slotProps, {
33111
33070
  ref: forwardedRef
33112
33071
  }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
33113
33072
  }
33114
- return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
33073
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$2, _extends({}, slotProps, {
33115
33074
  ref: forwardedRef
33116
33075
  }), children);
33117
33076
  });
33118
- $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
33077
+ $5e63c961fc1ce211$export$8c6ed5c666ac1360$2.displayName = 'Slot';
33119
33078
  /* -------------------------------------------------------------------------------------------------
33120
33079
  * SlotClone
33121
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33080
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$2 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33122
33081
  const { children: children , ...slotProps } = props;
33123
33082
  if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
33124
- ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
33125
- ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
33083
+ ...$5e63c961fc1ce211$var$mergeProps$2(slotProps, children.props),
33084
+ ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af$4(forwardedRef, children.ref) : children.ref
33126
33085
  });
33127
33086
  return Children.count(children) > 1 ? Children.only(null) : null;
33128
33087
  });
33129
- $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
33088
+ $5e63c961fc1ce211$var$SlotClone$2.displayName = 'SlotClone';
33130
33089
  /* -------------------------------------------------------------------------------------------------
33131
33090
  * Slottable
33132
- * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
33091
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$2 = ({ children: children })=>{
33133
33092
  return /*#__PURE__*/ createElement(Fragment, null, children);
33134
33093
  };
33135
- /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
33136
- return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
33094
+ /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$2(child) {
33095
+ return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$2;
33137
33096
  }
33138
- function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
33097
+ function $5e63c961fc1ce211$var$mergeProps$2(slotProps, childProps) {
33139
33098
  // all child props should override
33140
33099
  const overrideProps = {
33141
33100
  ...childProps
@@ -33166,106 +33125,15 @@ function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
33166
33125
  };
33167
33126
  }
33168
33127
 
33169
- // We have resorted to returning slots directly rather than exposing primitives that can then
33170
- // be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
33171
- // This is because we encountered issues with generic types that cannot be statically analysed
33172
- // due to creating them dynamically via createCollection.
33173
- function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
33174
- /* -----------------------------------------------------------------------------------------------
33175
- * CollectionProvider
33176
- * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
33177
- const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
33178
- const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
33179
- collectionRef: {
33180
- current: null
33181
- },
33182
- itemMap: new Map()
33183
- });
33184
- const CollectionProvider = (props)=>{
33185
- const { scope: scope , children: children } = props;
33186
- const ref = React__default.useRef(null);
33187
- const itemMap = React__default.useRef(new Map()).current;
33188
- return /*#__PURE__*/ React__default.createElement(CollectionProviderImpl, {
33189
- scope: scope,
33190
- itemMap: itemMap,
33191
- collectionRef: ref
33192
- }, children);
33193
- };
33194
- /* -----------------------------------------------------------------------------------------------
33195
- * CollectionSlot
33196
- * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
33197
- const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
33198
- const { scope: scope , children: children } = props;
33199
- const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
33200
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
33201
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
33202
- ref: composedRefs
33203
- }, children);
33204
- });
33205
- /* -----------------------------------------------------------------------------------------------
33206
- * CollectionItem
33207
- * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
33208
- const ITEM_DATA_ATTR = 'data-radix-collection-item';
33209
- const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
33210
- const { scope: scope , children: children , ...itemData } = props;
33211
- const ref = React__default.useRef(null);
33212
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
33213
- const context = useCollectionContext(ITEM_SLOT_NAME, scope);
33214
- React__default.useEffect(()=>{
33215
- context.itemMap.set(ref, {
33216
- ref: ref,
33217
- ...itemData
33218
- });
33219
- return ()=>void context.itemMap.delete(ref)
33220
- ;
33221
- });
33222
- return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
33223
- [ITEM_DATA_ATTR]: '',
33224
- ref: composedRefs
33225
- }, children);
33226
- });
33227
- /* -----------------------------------------------------------------------------------------------
33228
- * useCollection
33229
- * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
33230
- const context = useCollectionContext(name + 'CollectionConsumer', scope);
33231
- const getItems = React__default.useCallback(()=>{
33232
- const collectionNode = context.collectionRef.current;
33233
- if (!collectionNode) return [];
33234
- const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
33235
- const items = Array.from(context.itemMap.values());
33236
- const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
33237
- );
33238
- return orderedItems;
33239
- }, [
33240
- context.collectionRef,
33241
- context.itemMap
33242
- ]);
33243
- return getItems;
33244
- }
33245
- return [
33246
- {
33247
- Provider: CollectionProvider,
33248
- Slot: CollectionSlot,
33249
- ItemSlot: CollectionItemSlot
33250
- },
33251
- useCollection,
33252
- createCollectionScope
33253
- ];
33254
- }
33255
-
33256
- const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
33257
- /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
33258
- const globalDir = useContext($f631663db3294ace$var$DirectionContext);
33259
- return localDir || globalDir || 'ltr';
33260
- }
33261
-
33262
- const $8927f6f2acc4f386$var$NODES = [
33128
+ const $8927f6f2acc4f386$var$NODES$4 = [
33263
33129
  'a',
33264
33130
  'button',
33265
33131
  'div',
33132
+ 'form',
33266
33133
  'h2',
33267
33134
  'h3',
33268
33135
  'img',
33136
+ 'input',
33269
33137
  'label',
33270
33138
  'li',
33271
33139
  'nav',
@@ -33279,10 +33147,10 @@ const $8927f6f2acc4f386$var$NODES = [
33279
33147
  // prettier-ignore
33280
33148
  /* -------------------------------------------------------------------------------------------------
33281
33149
  * Primitive
33282
- * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
33150
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$4 = $8927f6f2acc4f386$var$NODES$4.reduce((primitive, node)=>{
33283
33151
  const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33284
33152
  const { asChild: asChild , ...primitiveProps } = props;
33285
- const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
33153
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360$2 : node;
33286
33154
  useEffect(()=>{
33287
33155
  window[Symbol.for('radix-ui')] = true;
33288
33156
  }, []);
@@ -33333,30 +33201,15 @@ const $8927f6f2acc4f386$var$NODES = [
33333
33201
  * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
33334
33202
  * this utility with them. This is because it's possible for those handlers to be called implicitly during render
33335
33203
  * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
33336
- */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
33204
+ */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event) {
33337
33205
  if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
33338
33206
  );
33339
33207
  }
33340
33208
 
33341
- /**
33342
- * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
33343
- * prop or avoid re-executing effects when passed as a dependency
33344
- */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
33345
- const callbackRef = useRef(callback);
33346
- useEffect(()=>{
33347
- callbackRef.current = callback;
33348
- }); // https://github.com/facebook/react/issues/19240
33349
- return useMemo(()=>(...args)=>{
33350
- var _callbackRef$current;
33351
- return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
33352
- }
33353
- , []);
33354
- }
33355
-
33356
33209
  /**
33357
33210
  * Listens for when the escape key is down
33358
- */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33359
- const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
33211
+ */ function $addc16e1bbe58fd0$export$3a72a57244d6e765$1(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33212
+ const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onEscapeKeyDownProp);
33360
33213
  useEffect(()=>{
33361
33214
  const handleKeyDown = (event)=>{
33362
33215
  if (event.key === 'Escape') onEscapeKeyDown(event);
@@ -33370,23 +33223,23 @@ const $8927f6f2acc4f386$var$NODES = [
33370
33223
  ]);
33371
33224
  }
33372
33225
 
33373
- const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
33374
- const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
33375
- const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
33376
- let $5cb92bef7577960e$var$originalBodyPointerEvents;
33377
- const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
33226
+ const $5cb92bef7577960e$var$CONTEXT_UPDATE$1 = 'dismissableLayer.update';
33227
+ const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE$1 = 'dismissableLayer.pointerDownOutside';
33228
+ const $5cb92bef7577960e$var$FOCUS_OUTSIDE$1 = 'dismissableLayer.focusOutside';
33229
+ let $5cb92bef7577960e$var$originalBodyPointerEvents$1;
33230
+ const $5cb92bef7577960e$var$DismissableLayerContext$1 = /*#__PURE__*/ createContext({
33378
33231
  layers: new Set(),
33379
33232
  layersWithOutsidePointerEventsDisabled: new Set(),
33380
33233
  branches: new Set()
33381
33234
  });
33382
- const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33235
+ const $5cb92bef7577960e$export$177fb62ff3ec1f22$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33383
33236
  var _node$ownerDocument;
33384
33237
  const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
33385
- const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
33238
+ const context = useContext($5cb92bef7577960e$var$DismissableLayerContext$1);
33386
33239
  const [node1, setNode] = useState(null);
33387
33240
  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;
33388
33241
  const [, force] = useState({});
33389
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
33242
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(forwardedRef, (node)=>setNode(node)
33390
33243
  );
33391
33244
  const layers = Array.from(context.layers);
33392
33245
  const [highestLayerWithOutsidePointerEventsDisabled] = [
@@ -33396,7 +33249,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33396
33249
  const index = node1 ? layers.indexOf(node1) : -1;
33397
33250
  const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
33398
33251
  const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
33399
- const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
33252
+ const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside$1((event)=>{
33400
33253
  const target = event.target;
33401
33254
  const isPointerDownOnBranch = [
33402
33255
  ...context.branches
@@ -33407,7 +33260,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33407
33260
  onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
33408
33261
  if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
33409
33262
  }, ownerDocument);
33410
- const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
33263
+ const focusOutside = $5cb92bef7577960e$var$useFocusOutside$1((event)=>{
33411
33264
  const target = event.target;
33412
33265
  const isFocusInBranch = [
33413
33266
  ...context.branches
@@ -33418,7 +33271,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33418
33271
  onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
33419
33272
  if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
33420
33273
  }, ownerDocument);
33421
- $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
33274
+ $addc16e1bbe58fd0$export$3a72a57244d6e765$1((event)=>{
33422
33275
  const isHighestLayer = index === context.layers.size - 1;
33423
33276
  if (!isHighestLayer) return;
33424
33277
  onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
@@ -33431,15 +33284,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33431
33284
  if (!node1) return;
33432
33285
  if (disableOutsidePointerEvents) {
33433
33286
  if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
33434
- $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
33287
+ $5cb92bef7577960e$var$originalBodyPointerEvents$1 = ownerDocument.body.style.pointerEvents;
33435
33288
  ownerDocument.body.style.pointerEvents = 'none';
33436
33289
  }
33437
33290
  context.layersWithOutsidePointerEventsDisabled.add(node1);
33438
33291
  }
33439
33292
  context.layers.add(node1);
33440
- $5cb92bef7577960e$var$dispatchUpdate();
33293
+ $5cb92bef7577960e$var$dispatchUpdate$1();
33441
33294
  return ()=>{
33442
- if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
33295
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents$1;
33443
33296
  };
33444
33297
  }, [
33445
33298
  node1,
@@ -33457,7 +33310,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33457
33310
  if (!node1) return;
33458
33311
  context.layers.delete(node1);
33459
33312
  context.layersWithOutsidePointerEventsDisabled.delete(node1);
33460
- $5cb92bef7577960e$var$dispatchUpdate();
33313
+ $5cb92bef7577960e$var$dispatchUpdate$1();
33461
33314
  };
33462
33315
  }, [
33463
33316
  node1,
@@ -33466,27 +33319,27 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33466
33319
  useEffect(()=>{
33467
33320
  const handleUpdate = ()=>force({})
33468
33321
  ;
33469
- document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
33470
- return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
33322
+ document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate);
33323
+ return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE$1, handleUpdate)
33471
33324
  ;
33472
33325
  }, []);
33473
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
33326
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.div, _extends({}, layerProps, {
33474
33327
  ref: composedRefs,
33475
33328
  style: {
33476
33329
  pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
33477
33330
  ...props.style
33478
33331
  },
33479
- onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
33480
- onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
33481
- onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
33332
+ onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onFocusCapture, focusOutside.onFocusCapture),
33333
+ onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onBlurCapture, focusOutside.onBlurCapture),
33334
+ onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
33482
33335
  }));
33483
33336
  });
33484
33337
  /* -----------------------------------------------------------------------------------------------*/ /**
33485
33338
  * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
33486
33339
  * to mimic layer dismissing behaviour present in OS.
33487
33340
  * Returns props to pass to the node we want to check for outside events.
33488
- */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33489
- const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
33341
+ */ function $5cb92bef7577960e$var$usePointerDownOutside$1(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33342
+ const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onPointerDownOutside);
33490
33343
  const isPointerInsideReactTreeRef = useRef(false);
33491
33344
  const handleClickRef = useRef(()=>{});
33492
33345
  useEffect(()=>{
@@ -33496,7 +33349,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33496
33349
  originalEvent: event
33497
33350
  };
33498
33351
  function handleAndDispatchPointerDownOutsideEvent() {
33499
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
33352
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE$1, handlePointerDownOutside, eventDetail, {
33500
33353
  discrete: true
33501
33354
  });
33502
33355
  }
@@ -33553,8 +33406,8 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33553
33406
  /**
33554
33407
  * Listens for when focus happens outside a react subtree.
33555
33408
  * Returns props to pass to the root (node) of the subtree we want to check.
33556
- */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33557
- const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
33409
+ */ function $5cb92bef7577960e$var$useFocusOutside$1(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
33410
+ const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onFocusOutside);
33558
33411
  const isFocusInsideReactTreeRef = useRef(false);
33559
33412
  useEffect(()=>{
33560
33413
  const handleFocus = (event)=>{
@@ -33562,7 +33415,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33562
33415
  const eventDetail = {
33563
33416
  originalEvent: event
33564
33417
  };
33565
- $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
33418
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1($5cb92bef7577960e$var$FOCUS_OUTSIDE$1, handleFocusOutside, eventDetail, {
33566
33419
  discrete: false
33567
33420
  });
33568
33421
  }
@@ -33580,11 +33433,11 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((prop
33580
33433
  onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
33581
33434
  };
33582
33435
  }
33583
- function $5cb92bef7577960e$var$dispatchUpdate() {
33584
- const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
33436
+ function $5cb92bef7577960e$var$dispatchUpdate$1() {
33437
+ const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE$1);
33585
33438
  document.dispatchEvent(event);
33586
33439
  }
33587
- function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
33440
+ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent$1(name, handler, detail, { discrete: discrete }) {
33588
33441
  const target = detail.originalEvent.target;
33589
33442
  const event = new CustomEvent(name, {
33590
33443
  bubbles: false,
@@ -33594,49 +33447,23 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
33594
33447
  if (handler) target.addEventListener(name, handler, {
33595
33448
  once: true
33596
33449
  });
33597
- if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
33450
+ if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f$1(target, event);
33598
33451
  else target.dispatchEvent(event);
33599
33452
  }
33600
33453
 
33601
- /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
33602
- /**
33603
- * Injects a pair of focus guards at the edges of the whole DOM tree
33604
- * to ensure `focusin` & `focusout` events can be caught consistently.
33605
- */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
33606
- useEffect(()=>{
33607
- var _edgeGuards$, _edgeGuards$2;
33608
- const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
33609
- document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
33610
- document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
33611
- $3db38b7d1fb3fe6a$var$count++;
33612
- return ()=>{
33613
- if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
33614
- );
33615
- $3db38b7d1fb3fe6a$var$count--;
33616
- };
33617
- }, []);
33618
- }
33619
- function $3db38b7d1fb3fe6a$var$createFocusGuard() {
33620
- const element = document.createElement('span');
33621
- element.setAttribute('data-radix-focus-guard', '');
33622
- element.tabIndex = 0;
33623
- element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
33624
- return element;
33625
- }
33626
-
33627
- const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
33628
- const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
33629
- const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
33454
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT$1 = 'focusScope.autoFocusOnMount';
33455
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT$1 = 'focusScope.autoFocusOnUnmount';
33456
+ const $d3863c46a17e8a28$var$EVENT_OPTIONS$1 = {
33630
33457
  bubbles: false,
33631
33458
  cancelable: true
33632
33459
  };
33633
- const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33460
+ const $d3863c46a17e8a28$export$20e40289641fbbb6$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33634
33461
  const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
33635
33462
  const [container1, setContainer] = useState(null);
33636
- const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
33637
- const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
33463
+ const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onMountAutoFocusProp);
33464
+ const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$3(onUnmountAutoFocusProp);
33638
33465
  const lastFocusedElementRef = useRef(null);
33639
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
33466
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(forwardedRef, (node)=>setContainer(node)
33640
33467
  );
33641
33468
  const focusScope = useRef({
33642
33469
  paused: false,
@@ -33653,21 +33480,49 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33653
33480
  if (focusScope.paused || !container1) return;
33654
33481
  const target = event.target;
33655
33482
  if (container1.contains(target)) lastFocusedElementRef.current = target;
33656
- else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
33483
+ else $d3863c46a17e8a28$var$focus$1(lastFocusedElementRef.current, {
33657
33484
  select: true
33658
33485
  });
33659
33486
  }
33660
33487
  function handleFocusOut(event) {
33661
33488
  if (focusScope.paused || !container1) return;
33662
- if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
33489
+ const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
33490
+ //
33491
+ // 1. When the user switches app/tabs/windows/the browser itself loses focus.
33492
+ // 2. In Google Chrome, when the focused element is removed from the DOM.
33493
+ //
33494
+ // We let the browser do its thing here because:
33495
+ //
33496
+ // 1. The browser already keeps a memory of what's focused for when the page gets refocused.
33497
+ // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
33498
+ // throws the CPU to 100%, so we avoid doing anything for this reason here too.
33499
+ if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
33500
+ // that is outside the container, we move focus to the last valid focused element inside.
33501
+ if (!container1.contains(relatedTarget)) $d3863c46a17e8a28$var$focus$1(lastFocusedElementRef.current, {
33663
33502
  select: true
33664
33503
  });
33504
+ } // When the focused element gets removed from the DOM, browsers move focus
33505
+ // back to the document.body. In this case, we move focus to the container
33506
+ // to keep focus trapped correctly.
33507
+ function handleMutations(mutations) {
33508
+ const focusedElement = document.activeElement;
33509
+ for (const mutation of mutations){
33510
+ if (mutation.removedNodes.length > 0) {
33511
+ if (!(container1 !== null && container1 !== void 0 && container1.contains(focusedElement))) $d3863c46a17e8a28$var$focus$1(container1);
33512
+ }
33513
+ }
33665
33514
  }
33666
33515
  document.addEventListener('focusin', handleFocusIn);
33667
33516
  document.addEventListener('focusout', handleFocusOut);
33517
+ const mutationObserver = new MutationObserver(handleMutations);
33518
+ if (container1) mutationObserver.observe(container1, {
33519
+ childList: true,
33520
+ subtree: true
33521
+ });
33668
33522
  return ()=>{
33669
33523
  document.removeEventListener('focusin', handleFocusIn);
33670
33524
  document.removeEventListener('focusout', handleFocusOut);
33525
+ mutationObserver.disconnect();
33671
33526
  };
33672
33527
  }
33673
33528
  }, [
@@ -33677,34 +33532,34 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33677
33532
  ]);
33678
33533
  useEffect(()=>{
33679
33534
  if (container1) {
33680
- $d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
33535
+ $d3863c46a17e8a28$var$focusScopesStack$1.add(focusScope);
33681
33536
  const previouslyFocusedElement = document.activeElement;
33682
33537
  const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
33683
33538
  if (!hasFocusedCandidate) {
33684
- const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
33685
- container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
33539
+ const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT$1, $d3863c46a17e8a28$var$EVENT_OPTIONS$1);
33540
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus);
33686
33541
  container1.dispatchEvent(mountEvent);
33687
33542
  if (!mountEvent.defaultPrevented) {
33688
- $d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
33543
+ $d3863c46a17e8a28$var$focusFirst$1($d3863c46a17e8a28$var$removeLinks$1($d3863c46a17e8a28$var$getTabbableCandidates$1(container1)), {
33689
33544
  select: true
33690
33545
  });
33691
- if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
33546
+ if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus$1(container1);
33692
33547
  }
33693
33548
  }
33694
33549
  return ()=>{
33695
- container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
33550
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
33696
33551
  // We need to delay the focus a little to get around it for now.
33697
33552
  // See: https://github.com/facebook/react/issues/17894
33698
33553
  setTimeout(()=>{
33699
- const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
33700
- container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
33554
+ const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT$1, $d3863c46a17e8a28$var$EVENT_OPTIONS$1);
33555
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT$1, onUnmountAutoFocus);
33701
33556
  container1.dispatchEvent(unmountEvent);
33702
- if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
33557
+ if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus$1(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
33703
33558
  select: true
33704
33559
  });
33705
33560
  // we need to remove the listener after we `dispatchEvent`
33706
- container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
33707
- $d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
33561
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT$1, onUnmountAutoFocus);
33562
+ $d3863c46a17e8a28$var$focusScopesStack$1.remove(focusScope);
33708
33563
  }, 0);
33709
33564
  };
33710
33565
  }
@@ -33721,19 +33576,19 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33721
33576
  const focusedElement = document.activeElement;
33722
33577
  if (isTabKey && focusedElement) {
33723
33578
  const container = event.currentTarget;
33724
- const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
33579
+ const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges$1(container);
33725
33580
  const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
33726
33581
  if (!hasTabbableElementsInside) {
33727
33582
  if (focusedElement === container) event.preventDefault();
33728
33583
  } else {
33729
33584
  if (!event.shiftKey && focusedElement === last) {
33730
33585
  event.preventDefault();
33731
- if (loop) $d3863c46a17e8a28$var$focus(first, {
33586
+ if (loop) $d3863c46a17e8a28$var$focus$1(first, {
33732
33587
  select: true
33733
33588
  });
33734
33589
  } else if (event.shiftKey && focusedElement === first) {
33735
33590
  event.preventDefault();
33736
- if (loop) $d3863c46a17e8a28$var$focus(last, {
33591
+ if (loop) $d3863c46a17e8a28$var$focus$1(last, {
33737
33592
  select: true
33738
33593
  });
33739
33594
  }
@@ -33744,7 +33599,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33744
33599
  trapped,
33745
33600
  focusScope.paused
33746
33601
  ]);
33747
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
33602
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.div, _extends({
33748
33603
  tabIndex: -1
33749
33604
  }, scopeProps, {
33750
33605
  ref: composedRefs,
@@ -33756,10 +33611,10 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33756
33611
  * -----------------------------------------------------------------------------------------------*/ /**
33757
33612
  * Attempts focusing the first element in a list of candidates.
33758
33613
  * Stops when focus has actually moved.
33759
- */ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
33614
+ */ function $d3863c46a17e8a28$var$focusFirst$1(candidates, { select: select = false } = {}) {
33760
33615
  const previouslyFocusedElement = document.activeElement;
33761
33616
  for (const candidate of candidates){
33762
- $d3863c46a17e8a28$var$focus(candidate, {
33617
+ $d3863c46a17e8a28$var$focus$1(candidate, {
33763
33618
  select: select
33764
33619
  });
33765
33620
  if (document.activeElement !== previouslyFocusedElement) return;
@@ -33767,10 +33622,10 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33767
33622
  }
33768
33623
  /**
33769
33624
  * Returns the first and last tabbable elements inside a container.
33770
- */ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
33771
- const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
33772
- const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
33773
- const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
33625
+ */ function $d3863c46a17e8a28$var$getTabbableEdges$1(container) {
33626
+ const candidates = $d3863c46a17e8a28$var$getTabbableCandidates$1(container);
33627
+ const first = $d3863c46a17e8a28$var$findVisible$1(candidates, container);
33628
+ const last = $d3863c46a17e8a28$var$findVisible$1(candidates.reverse(), container);
33774
33629
  return [
33775
33630
  first,
33776
33631
  last
@@ -33785,7 +33640,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33785
33640
  *
33786
33641
  * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
33787
33642
  * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
33788
- */ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
33643
+ */ function $d3863c46a17e8a28$var$getTabbableCandidates$1(container) {
33789
33644
  const nodes = [];
33790
33645
  const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
33791
33646
  acceptNode: (node)=>{
@@ -33803,15 +33658,15 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((prop
33803
33658
  /**
33804
33659
  * Returns the first visible element in a list.
33805
33660
  * NOTE: Only checks visibility up to the `container`.
33806
- */ function $d3863c46a17e8a28$var$findVisible(elements, container) {
33661
+ */ function $d3863c46a17e8a28$var$findVisible$1(elements, container) {
33807
33662
  for (const element of elements){
33808
33663
  // we stop checking if it's hidden at the `container` level (excluding)
33809
- if (!$d3863c46a17e8a28$var$isHidden(element, {
33664
+ if (!$d3863c46a17e8a28$var$isHidden$1(element, {
33810
33665
  upTo: container
33811
33666
  })) return element;
33812
33667
  }
33813
33668
  }
33814
- function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
33669
+ function $d3863c46a17e8a28$var$isHidden$1(node, { upTo: upTo }) {
33815
33670
  if (getComputedStyle(node).visibility === 'hidden') return true;
33816
33671
  while(node){
33817
33672
  // we stop at `upTo` (excluding it)
@@ -33821,23 +33676,23 @@ function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
33821
33676
  }
33822
33677
  return false;
33823
33678
  }
33824
- function $d3863c46a17e8a28$var$isSelectableInput(element) {
33679
+ function $d3863c46a17e8a28$var$isSelectableInput$1(element) {
33825
33680
  return element instanceof HTMLInputElement && 'select' in element;
33826
33681
  }
33827
- function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
33682
+ function $d3863c46a17e8a28$var$focus$1(element, { select: select = false } = {}) {
33828
33683
  // only focus if that element is focusable
33829
33684
  if (element && element.focus) {
33830
33685
  const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
33831
33686
  element.focus({
33832
33687
  preventScroll: true
33833
33688
  }); // only select if its not the same element, it supports selection and we need to select
33834
- if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
33689
+ if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput$1(element) && select) element.select();
33835
33690
  }
33836
33691
  }
33837
33692
  /* -------------------------------------------------------------------------------------------------
33838
33693
  * FocusScope stack
33839
- * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
33840
- function $d3863c46a17e8a28$var$createFocusScopesStack() {
33694
+ * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack$1 = $d3863c46a17e8a28$var$createFocusScopesStack$1();
33695
+ function $d3863c46a17e8a28$var$createFocusScopesStack$1() {
33841
33696
  /** A stack of focus scopes, with the active one at the top */ let stack = [];
33842
33697
  return {
33843
33698
  add (focusScope) {
@@ -33845,17 +33700,17 @@ function $d3863c46a17e8a28$var$createFocusScopesStack() {
33845
33700
  const activeFocusScope = stack[0];
33846
33701
  if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
33847
33702
  // remove in case it already exists (because we'll re-add it at the top of the stack)
33848
- stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
33703
+ stack = $d3863c46a17e8a28$var$arrayRemove$1(stack, focusScope);
33849
33704
  stack.unshift(focusScope);
33850
33705
  },
33851
33706
  remove (focusScope) {
33852
33707
  var _stack$;
33853
- stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
33708
+ stack = $d3863c46a17e8a28$var$arrayRemove$1(stack, focusScope);
33854
33709
  (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
33855
33710
  }
33856
33711
  };
33857
33712
  }
33858
- function $d3863c46a17e8a28$var$arrayRemove(array, item) {
33713
+ function $d3863c46a17e8a28$var$arrayRemove$1(array, item) {
33859
33714
  const updatedArray = [
33860
33715
  ...array
33861
33716
  ];
@@ -33863,249 +33718,176 @@ function $d3863c46a17e8a28$var$arrayRemove(array, item) {
33863
33718
  if (index !== -1) updatedArray.splice(index, 1);
33864
33719
  return updatedArray;
33865
33720
  }
33866
- function $d3863c46a17e8a28$var$removeLinks(items) {
33721
+ function $d3863c46a17e8a28$var$removeLinks$1(items) {
33867
33722
  return items.filter((item)=>item.tagName !== 'A'
33868
33723
  );
33869
33724
  }
33870
33725
 
33871
- /**
33872
- * On the server, React emits a warning when calling `useLayoutEffect`.
33873
- * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
33874
- * We use this safe version which suppresses the warning by replacing it with a noop on the server.
33875
- *
33876
- * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
33877
- */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
33878
-
33879
- const $1746a345f3d73bb7$var$useReactId = React$b['useId'.toString()] || (()=>undefined
33880
- );
33881
- let $1746a345f3d73bb7$var$count = 0;
33882
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
33883
- const [id, setId] = React$b.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
33884
- $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
33885
- if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
33886
- );
33887
- }, [
33888
- deterministicId
33889
- ]);
33890
- return deterministicId || (id ? `radix-${id}` : '');
33891
- }
33892
-
33893
- const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33726
+ const $f1701beae083dbae$export$602eac185826482c$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33894
33727
  var _globalThis$document;
33895
33728
  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;
33896
- return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
33729
+ return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.div, _extends({}, portalProps, {
33897
33730
  ref: forwardedRef
33898
33731
  })), container) : null;
33899
33732
  });
33900
33733
 
33901
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
33902
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
33903
- defaultProp: defaultProp,
33904
- onChange: onChange
33734
+ /**
33735
+ * On the server, React emits a warning when calling `useLayoutEffect`.
33736
+ * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
33737
+ * We use this safe version which suppresses the warning by replacing it with a noop on the server.
33738
+ *
33739
+ * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
33740
+ */ const $9f79659886946c16$export$e5c5a5f917a5871c$1 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
33741
+
33742
+ function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
33743
+ return useReducer((state, event)=>{
33744
+ const nextState = machine[state][event];
33745
+ return nextState !== null && nextState !== void 0 ? nextState : state;
33746
+ }, initialState);
33747
+ }
33748
+
33749
+
33750
+ const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{
33751
+ const { present: present , children: children } = props;
33752
+ const presence = $921a889cee6df7e8$var$usePresence(present);
33753
+ const child = typeof children === 'function' ? children({
33754
+ present: presence.isPresent
33755
+ }) : Children.only(children);
33756
+ const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(presence.ref, child.ref);
33757
+ const forceMount = typeof children === 'function';
33758
+ return forceMount || presence.isPresent ? /*#__PURE__*/ cloneElement(child, {
33759
+ ref: ref
33760
+ }) : null;
33761
+ };
33762
+ $921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';
33763
+ /* -------------------------------------------------------------------------------------------------
33764
+ * usePresence
33765
+ * -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {
33766
+ const [node1, setNode] = useState();
33767
+ const stylesRef = useRef({});
33768
+ const prevPresentRef = useRef(present);
33769
+ const prevAnimationNameRef = useRef('none');
33770
+ const initialState = present ? 'mounted' : 'unmounted';
33771
+ const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
33772
+ mounted: {
33773
+ UNMOUNT: 'unmounted',
33774
+ ANIMATION_OUT: 'unmountSuspended'
33775
+ },
33776
+ unmountSuspended: {
33777
+ MOUNT: 'mounted',
33778
+ ANIMATION_END: 'unmounted'
33779
+ },
33780
+ unmounted: {
33781
+ MOUNT: 'mounted'
33782
+ }
33905
33783
  });
33906
- const isControlled = prop !== undefined;
33907
- const value1 = isControlled ? prop : uncontrolledProp;
33908
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
33909
- const setValue = useCallback((nextValue)=>{
33910
- if (isControlled) {
33911
- const setter = nextValue;
33912
- const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
33913
- if (value !== prop) handleChange(value);
33914
- } else setUncontrolledProp(nextValue);
33784
+ useEffect(()=>{
33785
+ const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
33786
+ prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';
33915
33787
  }, [
33916
- isControlled,
33917
- prop,
33918
- setUncontrolledProp,
33919
- handleChange
33788
+ state
33920
33789
  ]);
33921
- return [
33922
- value1,
33923
- setValue
33924
- ];
33925
- }
33926
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
33927
- const uncontrolledState = useState(defaultProp);
33928
- const [value] = uncontrolledState;
33929
- const prevValueRef = useRef(value);
33930
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
33931
- useEffect(()=>{
33932
- if (prevValueRef.current !== value) {
33933
- handleChange(value);
33934
- prevValueRef.current = value;
33790
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
33791
+ const styles = stylesRef.current;
33792
+ const wasPresent = prevPresentRef.current;
33793
+ const hasPresentChanged = wasPresent !== present;
33794
+ if (hasPresentChanged) {
33795
+ const prevAnimationName = prevAnimationNameRef.current;
33796
+ const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
33797
+ if (present) send('MOUNT');
33798
+ else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run
33799
+ // so we unmount instantly
33800
+ send('UNMOUNT');
33801
+ else {
33802
+ /**
33803
+ * When `present` changes to `false`, we check changes to animation-name to
33804
+ * determine whether an animation has started. We chose this approach (reading
33805
+ * computed styles) because there is no `animationrun` event and `animationstart`
33806
+ * fires after `animation-delay` has expired which would be too late.
33807
+ */ const isAnimating = prevAnimationName !== currentAnimationName;
33808
+ if (wasPresent && isAnimating) send('ANIMATION_OUT');
33809
+ else send('UNMOUNT');
33810
+ }
33811
+ prevPresentRef.current = present;
33935
33812
  }
33936
33813
  }, [
33937
- value,
33938
- prevValueRef,
33939
- handleChange
33814
+ present,
33815
+ send
33940
33816
  ]);
33941
- return uncontrolledState;
33942
- }
33943
-
33944
- function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
33945
- const ref = useRef({
33946
- value: value,
33947
- previous: value
33948
- }); // We compare values before making an update to ensure that
33949
- // a change has been made. This ensures the previous value is
33950
- // persisted correctly between renders.
33951
- return useMemo(()=>{
33952
- if (ref.current.value !== value) {
33953
- ref.current.previous = ref.current.value;
33954
- ref.current.value = value;
33955
- }
33956
- return ref.current.previous;
33817
+ $9f79659886946c16$export$e5c5a5f917a5871c$1(()=>{
33818
+ if (node1) {
33819
+ /**
33820
+ * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`
33821
+ * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we
33822
+ * make sure we only trigger ANIMATION_END for the currently active animation.
33823
+ */ const handleAnimationEnd = (event)=>{
33824
+ const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
33825
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
33826
+ if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied
33827
+ // a frame after the animation ends, creating a flash of visible content.
33828
+ // By manually flushing we ensure they sync within a frame, removing the flash.
33829
+ reactDom.exports.flushSync(()=>send('ANIMATION_END')
33830
+ );
33831
+ };
33832
+ const handleAnimationStart = (event)=>{
33833
+ if (event.target === node1) // if animation occurred, store its name as the previous animation.
33834
+ prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
33835
+ };
33836
+ node1.addEventListener('animationstart', handleAnimationStart);
33837
+ node1.addEventListener('animationcancel', handleAnimationEnd);
33838
+ node1.addEventListener('animationend', handleAnimationEnd);
33839
+ return ()=>{
33840
+ node1.removeEventListener('animationstart', handleAnimationStart);
33841
+ node1.removeEventListener('animationcancel', handleAnimationEnd);
33842
+ node1.removeEventListener('animationend', handleAnimationEnd);
33843
+ };
33844
+ } else // Transition to the unmounted state if the node is removed prematurely.
33845
+ // We avoid doing so during cleanup as the node may change but still exist.
33846
+ send('ANIMATION_END');
33957
33847
  }, [
33958
- value
33848
+ node1,
33849
+ send
33959
33850
  ]);
33851
+ return {
33852
+ isPresent: [
33853
+ 'mounted',
33854
+ 'unmountSuspended'
33855
+ ].includes(state),
33856
+ ref: useCallback((node)=>{
33857
+ if (node) stylesRef.current = getComputedStyle(node);
33858
+ setNode(node);
33859
+ }, [])
33860
+ };
33861
+ }
33862
+ /* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {
33863
+ return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';
33960
33864
  }
33961
33865
 
33962
- const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
33963
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
33964
- ref: forwardedRef,
33965
- style: {
33966
- // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
33967
- position: 'absolute',
33968
- border: 0,
33969
- width: 1,
33970
- height: 1,
33971
- padding: 0,
33972
- margin: -1,
33973
- overflow: 'hidden',
33974
- clip: 'rect(0, 0, 0, 0)',
33975
- whiteSpace: 'nowrap',
33976
- wordWrap: 'normal',
33977
- ...props.style
33978
- }
33979
- }));
33980
- });
33981
-
33982
- var getDefaultParent = function (originalTarget) {
33983
- if (typeof document === 'undefined') {
33984
- return null;
33985
- }
33986
- var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
33987
- return sampleTarget.ownerDocument.body;
33988
- };
33989
- var counterMap = new WeakMap();
33990
- var uncontrolledNodes = new WeakMap();
33991
- var markerMap = {};
33992
- var lockCount = 0;
33993
- var unwrapHost = function (node) {
33994
- return node && (node.host || unwrapHost(node.parentNode));
33995
- };
33996
- var correctTargets = function (parent, targets) {
33997
- return targets.map(function (target) {
33998
- if (parent.contains(target)) {
33999
- return target;
34000
- }
34001
- var correctedTarget = unwrapHost(target);
34002
- if (correctedTarget && parent.contains(correctedTarget)) {
34003
- return correctedTarget;
34004
- }
34005
- console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
34006
- return null;
34007
- }).filter(function (x) { return Boolean(x); });
34008
- };
33866
+ /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count$1 = 0;
34009
33867
  /**
34010
- * Marks everything except given node(or nodes) as aria-hidden
34011
- * @param {Element | Element[]} originalTarget - elements to keep on the page
34012
- * @param [parentNode] - top element, defaults to document.body
34013
- * @param {String} [markerName] - a special attribute to mark every node
34014
- * @param {String} [controlAttribute] - html Attribute to control
34015
- * @return {Undo} undo command
34016
- */
34017
- var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
34018
- var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
34019
- if (!markerMap[markerName]) {
34020
- markerMap[markerName] = new WeakMap();
34021
- }
34022
- var markerCounter = markerMap[markerName];
34023
- var hiddenNodes = [];
34024
- var elementsToKeep = new Set();
34025
- var elementsToStop = new Set(targets);
34026
- var keep = function (el) {
34027
- if (!el || elementsToKeep.has(el)) {
34028
- return;
34029
- }
34030
- elementsToKeep.add(el);
34031
- keep(el.parentNode);
34032
- };
34033
- targets.forEach(keep);
34034
- var deep = function (parent) {
34035
- if (!parent || elementsToStop.has(parent)) {
34036
- return;
34037
- }
34038
- Array.prototype.forEach.call(parent.children, function (node) {
34039
- if (elementsToKeep.has(node)) {
34040
- deep(node);
34041
- }
34042
- else {
34043
- var attr = node.getAttribute(controlAttribute);
34044
- var alreadyHidden = attr !== null && attr !== 'false';
34045
- var counterValue = (counterMap.get(node) || 0) + 1;
34046
- var markerValue = (markerCounter.get(node) || 0) + 1;
34047
- counterMap.set(node, counterValue);
34048
- markerCounter.set(node, markerValue);
34049
- hiddenNodes.push(node);
34050
- if (counterValue === 1 && alreadyHidden) {
34051
- uncontrolledNodes.set(node, true);
34052
- }
34053
- if (markerValue === 1) {
34054
- node.setAttribute(markerName, 'true');
34055
- }
34056
- if (!alreadyHidden) {
34057
- node.setAttribute(controlAttribute, 'true');
34058
- }
34059
- }
34060
- });
34061
- };
34062
- deep(parentNode);
34063
- elementsToKeep.clear();
34064
- lockCount++;
34065
- return function () {
34066
- hiddenNodes.forEach(function (node) {
34067
- var counterValue = counterMap.get(node) - 1;
34068
- var markerValue = markerCounter.get(node) - 1;
34069
- counterMap.set(node, counterValue);
34070
- markerCounter.set(node, markerValue);
34071
- if (!counterValue) {
34072
- if (!uncontrolledNodes.has(node)) {
34073
- node.removeAttribute(controlAttribute);
34074
- }
34075
- uncontrolledNodes.delete(node);
34076
- }
34077
- if (!markerValue) {
34078
- node.removeAttribute(markerName);
34079
- }
34080
- });
34081
- lockCount--;
34082
- if (!lockCount) {
34083
- // clear
34084
- counterMap = new WeakMap();
34085
- counterMap = new WeakMap();
34086
- uncontrolledNodes = new WeakMap();
34087
- markerMap = {};
34088
- }
34089
- };
34090
- };
34091
- /**
34092
- * Marks everything except given node(or nodes) as aria-hidden
34093
- * @param {Element | Element[]} originalTarget - elements to keep on the page
34094
- * @param [parentNode] - top element, defaults to document.body
34095
- * @param {String} [markerName] - a special attribute to mark every node
34096
- * @return {Undo} undo command
34097
- */
34098
- var hideOthers = function (originalTarget, parentNode, markerName) {
34099
- if (markerName === void 0) { markerName = 'data-aria-hidden'; }
34100
- var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
34101
- var activeParentNode = parentNode || getDefaultParent(originalTarget);
34102
- if (!activeParentNode) {
34103
- return function () { return null; };
34104
- }
34105
- // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
34106
- targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
34107
- return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
34108
- };
33868
+ * Injects a pair of focus guards at the edges of the whole DOM tree
33869
+ * to ensure `focusin` & `focusout` events can be caught consistently.
33870
+ */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c$1() {
33871
+ useEffect(()=>{
33872
+ var _edgeGuards$, _edgeGuards$2;
33873
+ const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
33874
+ document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard$1());
33875
+ document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard$1());
33876
+ $3db38b7d1fb3fe6a$var$count$1++;
33877
+ return ()=>{
33878
+ if ($3db38b7d1fb3fe6a$var$count$1 === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
33879
+ );
33880
+ $3db38b7d1fb3fe6a$var$count$1--;
33881
+ };
33882
+ }, []);
33883
+ }
33884
+ function $3db38b7d1fb3fe6a$var$createFocusGuard$1() {
33885
+ const element = document.createElement('span');
33886
+ element.setAttribute('data-radix-focus-guard', '');
33887
+ element.tabIndex = 0;
33888
+ element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
33889
+ return element;
33890
+ }
34109
33891
 
34110
33892
  /******************************************************************************
34111
33893
  Copyright (c) Microsoft Corporation.
@@ -34365,7 +34147,7 @@ var SideCar$1 = function (_a) {
34365
34147
  if (!Target) {
34366
34148
  throw new Error('Sidecar medium not found');
34367
34149
  }
34368
- return React$b.createElement(Target, __assign({}, rest));
34150
+ return React$c.createElement(Target, __assign({}, rest));
34369
34151
  };
34370
34152
  SideCar$1.isSideCarExport = true;
34371
34153
  function exportSidecar(medium, exported) {
@@ -34381,9 +34163,9 @@ var nothing = function () {
34381
34163
  /**
34382
34164
  * Removes scrollbar from the page and contain the scroll within the Lock
34383
34165
  */
34384
- var RemoveScroll = React$b.forwardRef(function (props, parentRef) {
34385
- var ref = React$b.useRef(null);
34386
- var _a = React$b.useState({
34166
+ var RemoveScroll = React$c.forwardRef(function (props, parentRef) {
34167
+ var ref = React$c.useRef(null);
34168
+ var _a = React$c.useState({
34387
34169
  onScrollCapture: nothing,
34388
34170
  onWheelCapture: nothing,
34389
34171
  onTouchMoveCapture: nothing,
@@ -34392,9 +34174,9 @@ var RemoveScroll = React$b.forwardRef(function (props, parentRef) {
34392
34174
  var SideCar = sideCar;
34393
34175
  var containerRef = useMergeRefs([ref, parentRef]);
34394
34176
  var containerProps = __assign$1(__assign$1({}, rest), callbacks);
34395
- return (React$b.createElement(React$b.Fragment, null,
34396
- enabled && (React$b.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
34397
- forwardProps ? (React$b.cloneElement(React$b.Children.only(children), __assign$1(__assign$1({}, containerProps), { ref: containerRef }))) : (React$b.createElement(Container, __assign$1({}, containerProps, { className: className, ref: containerRef }), children))));
34177
+ return (React$c.createElement(React$c.Fragment, null,
34178
+ enabled && (React$c.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),
34179
+ forwardProps ? (React$c.cloneElement(React$c.Children.only(children), __assign$1(__assign$1({}, containerProps), { ref: containerRef }))) : (React$c.createElement(Container, __assign$1({}, containerProps, { className: className, ref: containerRef }), children))));
34398
34180
  });
34399
34181
  RemoveScroll.defaultProps = {
34400
34182
  enabled: true,
@@ -34473,7 +34255,7 @@ var stylesheetSingleton = function () {
34473
34255
  var styleHookSingleton = function () {
34474
34256
  var sheet = stylesheetSingleton();
34475
34257
  return function (styles, isDynamic) {
34476
- React$b.useEffect(function () {
34258
+ React$c.useEffect(function () {
34477
34259
  sheet.add(styles);
34478
34260
  return function () {
34479
34261
  sheet.remove();
@@ -34554,8 +34336,8 @@ var RemoveScrollBar = function (props) {
34554
34336
  however it will be used only by the "first" invocation
34555
34337
  due to singleton nature of <Style
34556
34338
  */
34557
- var gap = React$b.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
34558
- return React$b.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
34339
+ var gap = React$c.useMemo(function () { return getGapWidth(gapMode); }, [gapMode]);
34340
+ return React$c.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? '!important' : '') });
34559
34341
  };
34560
34342
 
34561
34343
  var passiveSupported = false;
@@ -34621,206 +34403,1991 @@ var getVScrollVariables = function (_a) {
34621
34403
  var getHScrollVariables = function (_a) {
34622
34404
  var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
34623
34405
  return [
34624
- scrollLeft,
34625
- scrollWidth,
34626
- clientWidth,
34406
+ scrollLeft,
34407
+ scrollWidth,
34408
+ clientWidth,
34409
+ ];
34410
+ };
34411
+ var elementCouldBeScrolled = function (axis, node) {
34412
+ return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
34413
+ };
34414
+ var getScrollVariables = function (axis, node) {
34415
+ return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
34416
+ };
34417
+ var getDirectionFactor = function (axis, direction) {
34418
+ /**
34419
+ * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
34420
+ * and then increasingly negative as you scroll towards the end of the content.
34421
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
34422
+ */
34423
+ return axis === 'h' && direction === 'rtl' ? -1 : 1;
34424
+ };
34425
+ var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
34426
+ var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
34427
+ var delta = directionFactor * sourceDelta;
34428
+ // find scrollable target
34429
+ var target = event.target;
34430
+ var targetInLock = endTarget.contains(target);
34431
+ var shouldCancelScroll = false;
34432
+ var isDeltaPositive = delta > 0;
34433
+ var availableScroll = 0;
34434
+ var availableScrollTop = 0;
34435
+ do {
34436
+ var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
34437
+ var elementScroll = scroll_1 - capacity - directionFactor * position;
34438
+ if (position || elementScroll) {
34439
+ if (elementCouldBeScrolled(axis, target)) {
34440
+ availableScroll += elementScroll;
34441
+ availableScrollTop += position;
34442
+ }
34443
+ }
34444
+ target = target.parentNode;
34445
+ } while (
34446
+ // portaled content
34447
+ (!targetInLock && target !== document.body) ||
34448
+ // self content
34449
+ (targetInLock && (endTarget.contains(target) || endTarget === target)));
34450
+ if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
34451
+ shouldCancelScroll = true;
34452
+ }
34453
+ else if (!isDeltaPositive &&
34454
+ ((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
34455
+ shouldCancelScroll = true;
34456
+ }
34457
+ return shouldCancelScroll;
34458
+ };
34459
+
34460
+ var getTouchXY = function (event) {
34461
+ return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
34462
+ };
34463
+ var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
34464
+ var extractRef = function (ref) {
34465
+ return ref && 'current' in ref ? ref.current : ref;
34466
+ };
34467
+ var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
34468
+ var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
34469
+ var idCounter = 0;
34470
+ var lockStack = [];
34471
+ function RemoveScrollSideCar(props) {
34472
+ var shouldPreventQueue = React$c.useRef([]);
34473
+ var touchStartRef = React$c.useRef([0, 0]);
34474
+ var activeAxis = React$c.useRef();
34475
+ var id = React$c.useState(idCounter++)[0];
34476
+ var Style = React$c.useState(function () { return styleSingleton(); })[0];
34477
+ var lastProps = React$c.useRef(props);
34478
+ React$c.useEffect(function () {
34479
+ lastProps.current = props;
34480
+ }, [props]);
34481
+ React$c.useEffect(function () {
34482
+ if (props.inert) {
34483
+ document.body.classList.add("block-interactivity-".concat(id));
34484
+ var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
34485
+ allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
34486
+ return function () {
34487
+ document.body.classList.remove("block-interactivity-".concat(id));
34488
+ allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
34489
+ };
34490
+ }
34491
+ return;
34492
+ }, [props.inert, props.lockRef.current, props.shards]);
34493
+ var shouldCancelEvent = React$c.useCallback(function (event, parent) {
34494
+ if ('touches' in event && event.touches.length === 2) {
34495
+ return !lastProps.current.allowPinchZoom;
34496
+ }
34497
+ var touch = getTouchXY(event);
34498
+ var touchStart = touchStartRef.current;
34499
+ var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
34500
+ var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
34501
+ var currentAxis;
34502
+ var target = event.target;
34503
+ var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
34504
+ // allow horizontal touch move on Range inputs. They will not cause any scroll
34505
+ if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
34506
+ return false;
34507
+ }
34508
+ var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
34509
+ if (!canBeScrolledInMainDirection) {
34510
+ return true;
34511
+ }
34512
+ if (canBeScrolledInMainDirection) {
34513
+ currentAxis = moveDirection;
34514
+ }
34515
+ else {
34516
+ currentAxis = moveDirection === 'v' ? 'h' : 'v';
34517
+ canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
34518
+ // other axis might be not scrollable
34519
+ }
34520
+ if (!canBeScrolledInMainDirection) {
34521
+ return false;
34522
+ }
34523
+ if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
34524
+ activeAxis.current = currentAxis;
34525
+ }
34526
+ if (!currentAxis) {
34527
+ return true;
34528
+ }
34529
+ var cancelingAxis = activeAxis.current || currentAxis;
34530
+ return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
34531
+ }, []);
34532
+ var shouldPrevent = React$c.useCallback(function (_event) {
34533
+ var event = _event;
34534
+ if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
34535
+ // not the last active
34536
+ return;
34537
+ }
34538
+ var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
34539
+ var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
34540
+ // self event, and should be canceled
34541
+ if (sourceEvent && sourceEvent.should) {
34542
+ if (event.cancelable) {
34543
+ event.preventDefault();
34544
+ }
34545
+ return;
34546
+ }
34547
+ // outside or shard event
34548
+ if (!sourceEvent) {
34549
+ var shardNodes = (lastProps.current.shards || [])
34550
+ .map(extractRef)
34551
+ .filter(Boolean)
34552
+ .filter(function (node) { return node.contains(event.target); });
34553
+ var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
34554
+ if (shouldStop) {
34555
+ if (event.cancelable) {
34556
+ event.preventDefault();
34557
+ }
34558
+ }
34559
+ }
34560
+ }, []);
34561
+ var shouldCancel = React$c.useCallback(function (name, delta, target, should) {
34562
+ var event = { name: name, delta: delta, target: target, should: should };
34563
+ shouldPreventQueue.current.push(event);
34564
+ setTimeout(function () {
34565
+ shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
34566
+ }, 1);
34567
+ }, []);
34568
+ var scrollTouchStart = React$c.useCallback(function (event) {
34569
+ touchStartRef.current = getTouchXY(event);
34570
+ activeAxis.current = undefined;
34571
+ }, []);
34572
+ var scrollWheel = React$c.useCallback(function (event) {
34573
+ shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
34574
+ }, []);
34575
+ var scrollTouchMove = React$c.useCallback(function (event) {
34576
+ shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
34577
+ }, []);
34578
+ React$c.useEffect(function () {
34579
+ lockStack.push(Style);
34580
+ props.setCallbacks({
34581
+ onScrollCapture: scrollWheel,
34582
+ onWheelCapture: scrollWheel,
34583
+ onTouchMoveCapture: scrollTouchMove,
34584
+ });
34585
+ document.addEventListener('wheel', shouldPrevent, nonPassive);
34586
+ document.addEventListener('touchmove', shouldPrevent, nonPassive);
34587
+ document.addEventListener('touchstart', scrollTouchStart, nonPassive);
34588
+ return function () {
34589
+ lockStack = lockStack.filter(function (inst) { return inst !== Style; });
34590
+ document.removeEventListener('wheel', shouldPrevent, nonPassive);
34591
+ document.removeEventListener('touchmove', shouldPrevent, nonPassive);
34592
+ document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
34593
+ };
34594
+ }, []);
34595
+ var removeScrollBar = props.removeScrollBar, inert = props.inert;
34596
+ return (React$c.createElement(React$c.Fragment, null,
34597
+ inert ? React$c.createElement(Style, { styles: generateStyle(id) }) : null,
34598
+ removeScrollBar ? React$c.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
34599
+ }
34600
+
34601
+ var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
34602
+
34603
+ var ReactRemoveScroll = React$c.forwardRef(function (props, ref) { return (React$c.createElement(RemoveScroll, __assign$1({}, props, { ref: ref, sideCar: SideCar }))); });
34604
+ ReactRemoveScroll.classNames = RemoveScroll.classNames;
34605
+ var $01b9c$RemoveScroll = ReactRemoveScroll;
34606
+
34607
+ var getDefaultParent = function (originalTarget) {
34608
+ if (typeof document === 'undefined') {
34609
+ return null;
34610
+ }
34611
+ var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
34612
+ return sampleTarget.ownerDocument.body;
34613
+ };
34614
+ var counterMap = new WeakMap();
34615
+ var uncontrolledNodes = new WeakMap();
34616
+ var markerMap = {};
34617
+ var lockCount = 0;
34618
+ var unwrapHost = function (node) {
34619
+ return node && (node.host || unwrapHost(node.parentNode));
34620
+ };
34621
+ var correctTargets = function (parent, targets) {
34622
+ return targets.map(function (target) {
34623
+ if (parent.contains(target)) {
34624
+ return target;
34625
+ }
34626
+ var correctedTarget = unwrapHost(target);
34627
+ if (correctedTarget && parent.contains(correctedTarget)) {
34628
+ return correctedTarget;
34629
+ }
34630
+ console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing');
34631
+ return null;
34632
+ }).filter(function (x) { return Boolean(x); });
34633
+ };
34634
+ /**
34635
+ * Marks everything except given node(or nodes) as aria-hidden
34636
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
34637
+ * @param [parentNode] - top element, defaults to document.body
34638
+ * @param {String} [markerName] - a special attribute to mark every node
34639
+ * @param {String} [controlAttribute] - html Attribute to control
34640
+ * @return {Undo} undo command
34641
+ */
34642
+ var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) {
34643
+ var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
34644
+ if (!markerMap[markerName]) {
34645
+ markerMap[markerName] = new WeakMap();
34646
+ }
34647
+ var markerCounter = markerMap[markerName];
34648
+ var hiddenNodes = [];
34649
+ var elementsToKeep = new Set();
34650
+ var elementsToStop = new Set(targets);
34651
+ var keep = function (el) {
34652
+ if (!el || elementsToKeep.has(el)) {
34653
+ return;
34654
+ }
34655
+ elementsToKeep.add(el);
34656
+ keep(el.parentNode);
34657
+ };
34658
+ targets.forEach(keep);
34659
+ var deep = function (parent) {
34660
+ if (!parent || elementsToStop.has(parent)) {
34661
+ return;
34662
+ }
34663
+ Array.prototype.forEach.call(parent.children, function (node) {
34664
+ if (elementsToKeep.has(node)) {
34665
+ deep(node);
34666
+ }
34667
+ else {
34668
+ var attr = node.getAttribute(controlAttribute);
34669
+ var alreadyHidden = attr !== null && attr !== 'false';
34670
+ var counterValue = (counterMap.get(node) || 0) + 1;
34671
+ var markerValue = (markerCounter.get(node) || 0) + 1;
34672
+ counterMap.set(node, counterValue);
34673
+ markerCounter.set(node, markerValue);
34674
+ hiddenNodes.push(node);
34675
+ if (counterValue === 1 && alreadyHidden) {
34676
+ uncontrolledNodes.set(node, true);
34677
+ }
34678
+ if (markerValue === 1) {
34679
+ node.setAttribute(markerName, 'true');
34680
+ }
34681
+ if (!alreadyHidden) {
34682
+ node.setAttribute(controlAttribute, 'true');
34683
+ }
34684
+ }
34685
+ });
34686
+ };
34687
+ deep(parentNode);
34688
+ elementsToKeep.clear();
34689
+ lockCount++;
34690
+ return function () {
34691
+ hiddenNodes.forEach(function (node) {
34692
+ var counterValue = counterMap.get(node) - 1;
34693
+ var markerValue = markerCounter.get(node) - 1;
34694
+ counterMap.set(node, counterValue);
34695
+ markerCounter.set(node, markerValue);
34696
+ if (!counterValue) {
34697
+ if (!uncontrolledNodes.has(node)) {
34698
+ node.removeAttribute(controlAttribute);
34699
+ }
34700
+ uncontrolledNodes.delete(node);
34701
+ }
34702
+ if (!markerValue) {
34703
+ node.removeAttribute(markerName);
34704
+ }
34705
+ });
34706
+ lockCount--;
34707
+ if (!lockCount) {
34708
+ // clear
34709
+ counterMap = new WeakMap();
34710
+ counterMap = new WeakMap();
34711
+ uncontrolledNodes = new WeakMap();
34712
+ markerMap = {};
34713
+ }
34714
+ };
34715
+ };
34716
+ /**
34717
+ * Marks everything except given node(or nodes) as aria-hidden
34718
+ * @param {Element | Element[]} originalTarget - elements to keep on the page
34719
+ * @param [parentNode] - top element, defaults to document.body
34720
+ * @param {String} [markerName] - a special attribute to mark every node
34721
+ * @return {Undo} undo command
34722
+ */
34723
+ var hideOthers = function (originalTarget, parentNode, markerName) {
34724
+ if (markerName === void 0) { markerName = 'data-aria-hidden'; }
34725
+ var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
34726
+ var activeParentNode = parentNode || getDefaultParent(originalTarget);
34727
+ if (!activeParentNode) {
34728
+ return function () { return null; };
34729
+ }
34730
+ // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
34731
+ targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]')));
34732
+ return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden');
34733
+ };
34734
+
34735
+ /* -------------------------------------------------------------------------------------------------
34736
+ * Slot
34737
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34738
+ const { children: children , ...slotProps } = props;
34739
+ const childrenArray = Children.toArray(children);
34740
+ const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable$1);
34741
+ if (slottable) {
34742
+ // the new element to render is the one passed as a child of `Slottable`
34743
+ const newElement = slottable.props.children;
34744
+ const newChildren = childrenArray.map((child)=>{
34745
+ if (child === slottable) {
34746
+ // because the new element will be the one rendered, we are only interested
34747
+ // in grabbing its children (`newElement.props.children`)
34748
+ if (Children.count(newElement) > 1) return Children.only(null);
34749
+ return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
34750
+ } else return child;
34751
+ });
34752
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$1, _extends({}, slotProps, {
34753
+ ref: forwardedRef
34754
+ }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
34755
+ }
34756
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone$1, _extends({}, slotProps, {
34757
+ ref: forwardedRef
34758
+ }), children);
34759
+ });
34760
+ $5e63c961fc1ce211$export$8c6ed5c666ac1360$1.displayName = 'Slot';
34761
+ /* -------------------------------------------------------------------------------------------------
34762
+ * SlotClone
34763
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone$1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34764
+ const { children: children , ...slotProps } = props;
34765
+ if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
34766
+ ...$5e63c961fc1ce211$var$mergeProps$1(slotProps, children.props),
34767
+ ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af$4(forwardedRef, children.ref) : children.ref
34768
+ });
34769
+ return Children.count(children) > 1 ? Children.only(null) : null;
34770
+ });
34771
+ $5e63c961fc1ce211$var$SlotClone$1.displayName = 'SlotClone';
34772
+ /* -------------------------------------------------------------------------------------------------
34773
+ * Slottable
34774
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1 = ({ children: children })=>{
34775
+ return /*#__PURE__*/ createElement(Fragment, null, children);
34776
+ };
34777
+ /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable$1(child) {
34778
+ return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45$1;
34779
+ }
34780
+ function $5e63c961fc1ce211$var$mergeProps$1(slotProps, childProps) {
34781
+ // all child props should override
34782
+ const overrideProps = {
34783
+ ...childProps
34784
+ };
34785
+ for(const propName in childProps){
34786
+ const slotPropValue = slotProps[propName];
34787
+ const childPropValue = childProps[propName];
34788
+ const isHandler = /^on[A-Z]/.test(propName);
34789
+ if (isHandler) {
34790
+ // if the handler exists on both, we compose them
34791
+ if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
34792
+ childPropValue(...args);
34793
+ slotPropValue(...args);
34794
+ };
34795
+ else if (slotPropValue) overrideProps[propName] = slotPropValue;
34796
+ } else if (propName === 'style') overrideProps[propName] = {
34797
+ ...slotPropValue,
34798
+ ...childPropValue
34799
+ };
34800
+ else if (propName === 'className') overrideProps[propName] = [
34801
+ slotPropValue,
34802
+ childPropValue
34803
+ ].filter(Boolean).join(' ');
34804
+ }
34805
+ return {
34806
+ ...slotProps,
34807
+ ...overrideProps
34808
+ };
34809
+ }
34810
+
34811
+ /* -------------------------------------------------------------------------------------------------
34812
+ * Dialog
34813
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DIALOG_NAME = 'Dialog';
34814
+ const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$2($5d3850c4d0b4e6c7$var$DIALOG_NAME);
34815
+ const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
34816
+ const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = (props)=>{
34817
+ const { __scopeDialog: __scopeDialog , children: children , open: openProp , defaultOpen: defaultOpen , onOpenChange: onOpenChange , modal: modal = true } = props;
34818
+ const triggerRef = useRef(null);
34819
+ const contentRef = useRef(null);
34820
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$2({
34821
+ prop: openProp,
34822
+ defaultProp: defaultOpen,
34823
+ onChange: onOpenChange
34824
+ });
34825
+ return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogProvider, {
34826
+ scope: __scopeDialog,
34827
+ triggerRef: triggerRef,
34828
+ contentRef: contentRef,
34829
+ contentId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
34830
+ titleId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
34831
+ descriptionId: $1746a345f3d73bb7$export$f680877a34711e37$1(),
34832
+ open: open,
34833
+ onOpenChange: setOpen,
34834
+ onOpenToggle: useCallback(()=>setOpen((prevOpen)=>!prevOpen
34835
+ )
34836
+ , [
34837
+ setOpen
34838
+ ]),
34839
+ modal: modal
34840
+ }, children);
34841
+ };
34842
+ /* -------------------------------------------------------------------------------------------------
34843
+ * DialogPortal
34844
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$PORTAL_NAME = 'DialogPortal';
34845
+ const [$5d3850c4d0b4e6c7$var$PortalProvider, $5d3850c4d0b4e6c7$var$usePortalContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, {
34846
+ forceMount: undefined
34847
+ });
34848
+ const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = (props)=>{
34849
+ const { __scopeDialog: __scopeDialog , forceMount: forceMount , children: children , container: container } = props;
34850
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$PORTAL_NAME, __scopeDialog);
34851
+ return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$PortalProvider, {
34852
+ scope: __scopeDialog,
34853
+ forceMount: forceMount
34854
+ }, Children.map(children, (child)=>/*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
34855
+ present: forceMount || context.open
34856
+ }, /*#__PURE__*/ createElement($f1701beae083dbae$export$602eac185826482c$1, {
34857
+ asChild: true,
34858
+ container: container
34859
+ }, child))
34860
+ ));
34861
+ };
34862
+ /* -------------------------------------------------------------------------------------------------
34863
+ * DialogOverlay
34864
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$OVERLAY_NAME = 'DialogOverlay';
34865
+ const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34866
+ const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
34867
+ const { forceMount: forceMount = portalContext.forceMount , ...overlayProps } = props;
34868
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, props.__scopeDialog);
34869
+ return context.modal ? /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
34870
+ present: forceMount || context.open
34871
+ }, /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogOverlayImpl, _extends({}, overlayProps, {
34872
+ ref: forwardedRef
34873
+ }))) : null;
34874
+ });
34875
+ const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34876
+ const { __scopeDialog: __scopeDialog , ...overlayProps } = props;
34877
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$OVERLAY_NAME, __scopeDialog);
34878
+ return(/*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
34879
+ // ie. when `Overlay` and `Content` are siblings
34880
+ createElement($01b9c$RemoveScroll, {
34881
+ as: $5e63c961fc1ce211$export$8c6ed5c666ac1360$1,
34882
+ allowPinchZoom: true,
34883
+ shards: [
34884
+ context.contentRef
34885
+ ]
34886
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.div, _extends({
34887
+ "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
34888
+ }, overlayProps, {
34889
+ ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
34890
+ ,
34891
+ style: {
34892
+ pointerEvents: 'auto',
34893
+ ...overlayProps.style
34894
+ }
34895
+ }))));
34896
+ });
34897
+ /* -------------------------------------------------------------------------------------------------
34898
+ * DialogContent
34899
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$CONTENT_NAME = 'DialogContent';
34900
+ const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34901
+ const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
34902
+ const { forceMount: forceMount = portalContext.forceMount , ...contentProps } = props;
34903
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
34904
+ return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
34905
+ present: forceMount || context.open
34906
+ }, context.modal ? /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentModal, _extends({}, contentProps, {
34907
+ ref: forwardedRef
34908
+ })) : /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentNonModal, _extends({}, contentProps, {
34909
+ ref: forwardedRef
34910
+ })));
34911
+ });
34912
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34913
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
34914
+ const contentRef = useRef(null);
34915
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal)
34916
+ useEffect(()=>{
34917
+ const content = contentRef.current;
34918
+ if (content) return hideOthers(content);
34919
+ }, []);
34920
+ return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
34921
+ ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
34922
+ ,
34923
+ trapFocus: context.open,
34924
+ disableOutsidePointerEvents: true,
34925
+ onCloseAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onCloseAutoFocus, (event)=>{
34926
+ var _context$triggerRef$c;
34927
+ event.preventDefault();
34928
+ (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus();
34929
+ }),
34930
+ onPointerDownOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onPointerDownOutside, (event)=>{
34931
+ const originalEvent = event.detail.originalEvent;
34932
+ const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
34933
+ const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because
34934
+ // it is effectively as if we right-clicked the `Overlay`.
34935
+ if (isRightClick) event.preventDefault();
34936
+ }) // When focus is trapped, a `focusout` event may still happen.
34937
+ ,
34938
+ onFocusOutside: $e42e1063c40fb3ef$export$b9ecd428b558ff10$2(props.onFocusOutside, (event)=>event.preventDefault()
34939
+ )
34940
+ }));
34941
+ });
34942
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34943
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, props.__scopeDialog);
34944
+ const hasInteractedOutsideRef = useRef(false);
34945
+ const hasPointerDownOutsideRef = useRef(false);
34946
+ return /*#__PURE__*/ createElement($5d3850c4d0b4e6c7$var$DialogContentImpl, _extends({}, props, {
34947
+ ref: forwardedRef,
34948
+ trapFocus: false,
34949
+ disableOutsidePointerEvents: false,
34950
+ onCloseAutoFocus: (event)=>{
34951
+ var _props$onCloseAutoFoc;
34952
+ (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event);
34953
+ if (!event.defaultPrevented) {
34954
+ var _context$triggerRef$c2;
34955
+ if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus
34956
+ event.preventDefault();
34957
+ }
34958
+ hasInteractedOutsideRef.current = false;
34959
+ hasPointerDownOutsideRef.current = false;
34960
+ },
34961
+ onInteractOutside: (event)=>{
34962
+ var _props$onInteractOuts, _context$triggerRef$c3;
34963
+ (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event);
34964
+ if (!event.defaultPrevented) {
34965
+ hasInteractedOutsideRef.current = true;
34966
+ if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true;
34967
+ } // Prevent dismissing when clicking the trigger.
34968
+ // As the trigger is already setup to close, without doing so would
34969
+ // cause it to close and immediately open.
34970
+ const target = event.target;
34971
+ const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target);
34972
+ if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
34973
+ // we will get the pointer down outside event on the trigger, but then a subsequent
34974
+ // focus outside event on the container, we ignore any focus outside event when we've
34975
+ // already had a pointer down outside event.
34976
+ if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault();
34977
+ }
34978
+ }));
34979
+ });
34980
+ /* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
34981
+ const { __scopeDialog: __scopeDialog , trapFocus: trapFocus , onOpenAutoFocus: onOpenAutoFocus , onCloseAutoFocus: onCloseAutoFocus , ...contentProps } = props;
34982
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$CONTENT_NAME, __scopeDialog);
34983
+ const contentRef = useRef(null);
34984
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$3(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be
34985
+ // the last element in the DOM (beacuse of the `Portal`)
34986
+ $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c$1();
34987
+ return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($d3863c46a17e8a28$export$20e40289641fbbb6$1, {
34988
+ asChild: true,
34989
+ loop: true,
34990
+ trapped: trapFocus,
34991
+ onMountAutoFocus: onOpenAutoFocus,
34992
+ onUnmountAutoFocus: onCloseAutoFocus
34993
+ }, /*#__PURE__*/ createElement($5cb92bef7577960e$export$177fb62ff3ec1f22$1, _extends({
34994
+ role: "dialog",
34995
+ id: context.contentId,
34996
+ "aria-describedby": context.descriptionId,
34997
+ "aria-labelledby": context.titleId,
34998
+ "data-state": $5d3850c4d0b4e6c7$var$getState(context.open)
34999
+ }, contentProps, {
35000
+ ref: composedRefs,
35001
+ onDismiss: ()=>context.onOpenChange(false)
35002
+ }))), false);
35003
+ });
35004
+ /* -------------------------------------------------------------------------------------------------
35005
+ * DialogTitle
35006
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$TITLE_NAME = 'DialogTitle';
35007
+ const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35008
+ const { __scopeDialog: __scopeDialog , ...titleProps } = props;
35009
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$TITLE_NAME, __scopeDialog);
35010
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.h2, _extends({
35011
+ id: context.titleId
35012
+ }, titleProps, {
35013
+ ref: forwardedRef
35014
+ }));
35015
+ });
35016
+ /* -------------------------------------------------------------------------------------------------
35017
+ * DialogDescription
35018
+ * -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DESCRIPTION_NAME = 'DialogDescription';
35019
+ const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35020
+ const { __scopeDialog: __scopeDialog , ...descriptionProps } = props;
35021
+ const context = $5d3850c4d0b4e6c7$var$useDialogContext($5d3850c4d0b4e6c7$var$DESCRIPTION_NAME, __scopeDialog);
35022
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$4.p, _extends({
35023
+ id: context.descriptionId
35024
+ }, descriptionProps, {
35025
+ ref: forwardedRef
35026
+ }));
35027
+ });
35028
+ /* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState(open) {
35029
+ return open ? 'open' : 'closed';
35030
+ }
35031
+ const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153;
35032
+ const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0;
35033
+ const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17;
35034
+ const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf;
35035
+ const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = $5d3850c4d0b4e6c7$export$16f7638e4a34b909;
35036
+ const $5d3850c4d0b4e6c7$export$393edc798c47379d = $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5;
35037
+
35038
+ /**
35039
+ * Use `VerticalSpace` to create vertical space between components.
35040
+ */
35041
+ var VerticalSpace = function (_a) {
35042
+ var _b;
35043
+ var _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "24" : _d, sizeS = _a.sizeS, sizeM = _a.sizeM, sizeL = _a.sizeL, sizeXL = _a.sizeXL, props = __rest$2(_a, ["isDebugVisible", "size", "sizeS", "sizeM", "sizeL", "sizeXL"]);
35044
+ return (React__default.createElement("div", __assign$2({ className: classNames((_b = {
35045
+ "arc-VerticalSpace": true
35046
+ },
35047
+ _b["arc-VerticalSpace--size".concat(size)] = size,
35048
+ _b["arc-VerticalSpace--sizeS".concat(sizeS)] = sizeS && sizeS,
35049
+ _b["arc-VerticalSpace--sizeM".concat(sizeM)] = sizeM && sizeM,
35050
+ _b["arc-VerticalSpace--sizeL".concat(sizeL)] = sizeL && sizeL,
35051
+ _b["arc-VerticalSpace--sizeXL".concat(sizeXL)] = sizeXL && sizeXL,
35052
+ _b["arc-VerticalSpace--debugVisible"] = isDebugVisible,
35053
+ _b)) }, filterDataAttrs(props))));
35054
+ };
35055
+
35056
+ /** Use `Modal` to focus a user's attention to an urgent or required prompt for interaction or input. */
35057
+ var Modal = function (_a) {
35058
+ var title = _a.title, description = _a.description, ariaDescribedBy = _a.ariaDescribedBy, isOpen = _a.isOpen, actions = _a.actions, onRequestClose = _a.onRequestClose, children = _a.children, _b = _a.role, role = _b === void 0 ? "dialog" : _b, _c = _a.shouldReturnFocus, shouldReturnFocus = _c === void 0 ? true : _c, _d = _a.isContentScrollable, isContentScrollable = _d === void 0 ? false : _d, _e = _a.size, size = _e === void 0 ? "l" : _e, props = __rest$2(_a, ["title", "description", "ariaDescribedBy", "isOpen", "actions", "onRequestClose", "children", "role", "shouldReturnFocus", "isContentScrollable", "size"]);
35059
+ var arcRootElement = useContext(ArcRootElementContext);
35060
+ var triggerRef = useRef(null);
35061
+ var setTriggerElement = function () {
35062
+ return shouldReturnFocus &&
35063
+ (triggerRef.current = document.activeElement);
35064
+ };
35065
+ var focusTriggerElement = function () {
35066
+ if (triggerRef.current) {
35067
+ triggerRef.current.focus();
35068
+ }
35069
+ };
35070
+ var canShowClose = role !== "alertdialog" && onRequestClose;
35071
+ var hasContent = description || children;
35072
+ var ariaProps = __assign$2({}, (ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {}));
35073
+ var closeModal = function () {
35074
+ if (role !== "alertdialog" && onRequestClose) {
35075
+ onRequestClose();
35076
+ }
35077
+ };
35078
+ return (React__default.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { open: isOpen },
35079
+ React__default.createElement($5d3850c4d0b4e6c7$export$602eac185826482c, { container: arcRootElement },
35080
+ React__default.createElement($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: "arc-Modal-overlay" },
35081
+ React__default.createElement($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, __assign$2({}, ariaProps, { role: role, onOpenAutoFocus: setTriggerElement, onCloseAutoFocus: focusTriggerElement, onEscapeKeyDown: closeModal, onInteractOutside: closeModal, className: classNames("arc-Modal-dialog", "arc-Modal-dialog--".concat(size), {
35082
+ "arc-Modal-dialog--maxHeightWindow": isContentScrollable
35083
+ }) }, filterDataAttrs(props)),
35084
+ React__default.createElement("div", { className: "arc-Modal-section" },
35085
+ React__default.createElement($5d3850c4d0b4e6c7$export$f99233281efd08a0, { asChild: true },
35086
+ React__default.createElement(Heading, { level: "1", size: "m" }, title))),
35087
+ React__default.createElement(VerticalSpace, { size: "12" }),
35088
+ hasContent && (React__default.createElement("div", { className: "arc-Modal-content" },
35089
+ React__default.createElement("div", { className: "arc-Modal-section" },
35090
+ description && (React__default.createElement($5d3850c4d0b4e6c7$export$393edc798c47379d, { asChild: true },
35091
+ React__default.createElement(Text, null, description))),
35092
+ description && children && (React__default.createElement(VerticalSpace, { "data-testid": "arc-modal-vertical-space", size: "20" })),
35093
+ children))),
35094
+ actions && (React__default.createElement("div", { className: "arc-Modal-section" },
35095
+ React__default.createElement("div", { className: "arc-Modal-actions" }, actions.map(function (props, i) { return (React__default.createElement("div", { key: "arc-modal-button-".concat(i), className: "arc-Modal-actionButton" },
35096
+ React__default.createElement(Button, __assign$2({ isFullWidth: true }, props)))); })))),
35097
+ canShowClose && (React__default.createElement("div", { className: "arc-Modal-iconContainer" },
35098
+ React__default.createElement("button", { "aria-label": "close", onClick: closeModal, className: "arc-Modal-closeButton" },
35099
+ React__default.createElement(Icon, { size: 32, icon: BtIconCrossAlt2Px_2 })))))))));
35100
+ };
35101
+
35102
+ /**
35103
+ * Use `UniversalHeader` to display a group-level page header.
35104
+ */
35105
+ var UniversalHeader = function (_a) {
35106
+ var children = _a.children, props = __rest$2(_a, ["children"]);
35107
+ useEffect(function () {
35108
+ React__default.Children.map(children, function (item) {
35109
+ if (item && item.type !== UniversalHeaderItem) {
35110
+ throw new Error("Illegal child passed to <UniversalHeader />. Ensure to only use <UniversalHeader.Item />.");
35111
+ }
35112
+ });
35113
+ }, [children]);
35114
+ return (React__default.createElement("nav", __assign$2({ className: "arc-UniversalHeader" }, filterDataAttrs(props)),
35115
+ React__default.createElement(Surface, { background: "light" },
35116
+ React__default.createElement("ul", { className: "arc-UniversalHeader-items" }, children))));
35117
+ };
35118
+ var UniversalHeaderItem = function (_a) {
35119
+ var children = _a.children, href = _a.href, props = __rest$2(_a, ["children", "href"]);
35120
+ return (React__default.createElement("li", __assign$2({}, filterDataAttrs(props)),
35121
+ React__default.createElement("a", { className: "arc-UniversalHeader-link", href: href }, children)));
35122
+ };
35123
+ UniversalHeaderItem.displayName = "UniversalHeader.Item";
35124
+ UniversalHeader.Item = UniversalHeaderItem;
35125
+
35126
+ var PosterImage = function (_a) {
35127
+ var alt = _a.alt, _b = _a.anchor, anchor = _b === void 0 ? "C" : _b, loading = _a.loading, sizes = _a.sizes, src = _a.src, srcSet = _a.srcSet, props = __rest$2(_a, ["alt", "anchor", "loading", "sizes", "src", "srcSet"]);
35128
+ return (React__default.createElement(Image, __assign$2({ alt: alt, anchor: anchor, fit: "cover", loading: loading, sizes: sizes, src: src, srcSet: srcSet }, props)));
35129
+ };
35130
+ PosterImage.displayName = "Poster.Image";
35131
+
35132
+ var PosterVideo = function (_a) {
35133
+ var _b;
35134
+ var _c = _a.anchor, anchor = _c === void 0 ? "C" : _c, _d = _a.autoPlay, autoPlay = _d === void 0 ? true : _d, children = _a.children, _e = _a.loop, loop = _e === void 0 ? true : _e, props = __rest$2(_a, ["anchor", "autoPlay", "children", "loop"]);
35135
+ return (React__default.createElement("video", __assign$2({ className: classNames((_b = {
35136
+ "arc-PosterVideo": true
35137
+ },
35138
+ _b[suffixModifier("arc-PosterVideo--anchor", anchor)] = anchor,
35139
+ _b)), autoPlay: autoPlay, muted: true, loop: loop }, filterDataAttrs(props)), children));
35140
+ };
35141
+ PosterVideo.displayName = "Poster.Video";
35142
+
35143
+ /**
35144
+ * Use `Poster` to compose content on an image or video background.
35145
+ */
35146
+ var Poster = function (_a) {
35147
+ var background = _a.background, children = _a.children, _b = _a.overlay, overlay = _b === void 0 ? true : _b, _c = _a.surface, surface = _c === void 0 ? "darker" : _c, props = __rest$2(_a, ["background", "children", "overlay", "surface"]);
35148
+ return (React__default.createElement(Surface, { background: surface },
35149
+ React__default.createElement("div", __assign$2({ className: classNames({
35150
+ "arc-Poster": true,
35151
+ "arc-Poster--overlay": overlay,
35152
+ "arc-Poster--overlayLight": surface === "lighter"
35153
+ }) }, filterDataAttrs(props)),
35154
+ React__default.createElement("div", { className: "arc-Poster-backgroundWrapper" }, background),
35155
+ React__default.createElement("div", { className: "arc-Poster-body" }, children))));
35156
+ };
35157
+ PosterImage.displayName = "Poster.Image";
35158
+ Poster.Image = PosterImage;
35159
+ PosterVideo.displayName = "Poster.Video";
35160
+ Poster.Video = PosterVideo;
35161
+
35162
+ var RadioContext = createContext({});
35163
+ var Provider$2 = RadioContext.Provider;
35164
+ var useRadioContext = function () {
35165
+ var context = useContext(RadioContext);
35166
+ return context;
35167
+ };
35168
+
35169
+ /**
35170
+ * Radio Button component.
35171
+ */
35172
+ var RadioButton = forwardRef(function (_a, ref) {
35173
+ var helper = _a.helper, id = _a.id, isDisabled = _a.isDisabled, label = _a.label, value = _a.value, props = __rest$2(_a, ["helper", "id", "isDisabled", "label", "value"]);
35174
+ var _b = useRadioContext(), blurEvent = _b.blurEvent, changeEvent = _b.changeEvent, groupDisabled = _b.groupDisabled, checkedValue = _b.checkedValue, labelSize = _b.labelSize, name = _b.name, size = _b.size;
35175
+ var surface = useContext(Context$3).surface;
35176
+ var idLabel = "".concat(id, "-label");
35177
+ var checked = checkedValue === value ? true : false;
35178
+ return (React__default.createElement("div", __assign$2({ className: classNames({
35179
+ "arc-RadioButton": true,
35180
+ "arc-RadioButton--disabled": isDisabled || groupDisabled,
35181
+ "arc-RadioButton--small": size === "s",
35182
+ "arc-RadioButton--smallLabel": labelSize === "s",
35183
+ "arc-RadioButton--onDarkSurface": surface === "dark"
35184
+ }) }, filterDataAttrs(props)),
35185
+ React__default.createElement("label", { className: "arc-RadioButton-label", htmlFor: id, id: idLabel },
35186
+ React__default.createElement("input", { className: "arc-RadioButton-input", checked: typeof changeEvent !== "function" ? undefined : checked, defaultChecked: typeof changeEvent !== "function" ? checked : undefined, disabled: isDisabled || groupDisabled, id: id, name: name, onBlur: blurEvent, onChange: changeEvent, ref: ref, type: "radio", value: value }),
35187
+ React__default.createElement("span", null,
35188
+ label,
35189
+ helper && React__default.createElement("span", { className: "arc-RadioButton-helper" }, helper)))));
35190
+ });
35191
+
35192
+ /**
35193
+ * Use `RadioGroup` to wrap and control radio buttons and apply default values
35194
+ */
35195
+ var RadioGroup = function (_a) {
35196
+ var children = _a.children, checkedValue = _a.checkedValue, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, id = _a.id, helper = _a.helper, label = _a.label, _c = _a.labelSize, labelSize = _c === void 0 ? "l" : _c, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, _d = _a.size, size = _d === void 0 ? "l" : _d, props = __rest$2(_a, ["children", "checkedValue", "isDisabled", "id", "helper", "label", "labelSize", "name", "onBlur", "onChange", "size"]);
35197
+ useEffect(function () {
35198
+ React__default.Children.map(children, function (item) {
35199
+ if (item && item.type !== RadioButton) {
35200
+ throw new Error("Illegal child passed to <RadioGroup />. Ensure to only use <RadioGroup.RadioButton />.");
35201
+ }
35202
+ });
35203
+ }, [children]);
35204
+ return (React__default.createElement(Provider$2, { value: {
35205
+ blurEvent: onBlur,
35206
+ changeEvent: onChange,
35207
+ groupDisabled: isDisabled,
35208
+ checkedValue: checkedValue,
35209
+ labelSize: labelSize,
35210
+ name: name,
35211
+ size: size
35212
+ } },
35213
+ React__default.createElement("div", __assign$2({ className: "arc-RadioGroup" }, filterDataAttrs(props)),
35214
+ React__default.createElement(FormControl, { elementType: "fieldset", label: label, labelSize: labelSize, helper: helper, id: id, requirementStatus: "not-applicable", helperUnderLabel: true }, children))));
35215
+ };
35216
+ RadioButton.displayName = "RadioGroup.RadioButton";
35217
+ RadioGroup.RadioButton = RadioButton;
35218
+
35219
+ /**
35220
+ * Use `Rule` to display a horizontal rule.
35221
+ */
35222
+ var Rule = function (props) {
35223
+ var surface = useContext(Context$3).surface;
35224
+ return (React__default.createElement("hr", __assign$2({ className: classNames({
35225
+ "arc-Rule": true,
35226
+ "arc-Rule--onDarkSurface": surface === "dark"
35227
+ }) }, filterDataAttrs(props))));
35228
+ };
35229
+
35230
+ /**
35231
+ * Use `Section` to compose content into vertical page layouts.
35232
+ */
35233
+ var Section = function (_a) {
35234
+ var children = _a.children, _b = _a.isFullWidth, isFullWidth = _b === void 0 ? false : _b, _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, props = __rest$2(_a, ["children", "isFullWidth", "isDebugVisible"]);
35235
+ return (React__default.createElement("div", __assign$2({ className: classNames({
35236
+ "arc-Section": true,
35237
+ "arc-Section--fullWidth": isFullWidth,
35238
+ "arc-Section--debugVisible": isDebugVisible
35239
+ }) }, filterDataAttrs(props)), children));
35240
+ };
35241
+
35242
+ function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
35243
+ return Math.min(max, Math.max(min, value));
35244
+ }
35245
+
35246
+ function $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
35247
+ return function handleEvent(event) {
35248
+ originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
35249
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
35250
+ };
35251
+ }
35252
+
35253
+ /* -------------------------------------------------------------------------------------------------
35254
+ * createContextScope
35255
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(scopeName, createContextScopeDeps = []) {
35256
+ let defaultContexts = [];
35257
+ /* -----------------------------------------------------------------------------------------------
35258
+ * createContext
35259
+ * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
35260
+ const BaseContext = /*#__PURE__*/ createContext(defaultContext);
35261
+ const index = defaultContexts.length;
35262
+ defaultContexts = [
35263
+ ...defaultContexts,
35264
+ defaultContext
35265
+ ];
35266
+ function Provider(props) {
35267
+ const { scope: scope , children: children , ...context } = props;
35268
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
35269
+ // eslint-disable-next-line react-hooks/exhaustive-deps
35270
+ const value = useMemo(()=>context
35271
+ , Object.values(context));
35272
+ return /*#__PURE__*/ createElement(Context.Provider, {
35273
+ value: value
35274
+ }, children);
35275
+ }
35276
+ function useContext$1(consumerName, scope) {
35277
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
35278
+ const context = useContext(Context);
35279
+ if (context) return context;
35280
+ if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
35281
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
35282
+ }
35283
+ Provider.displayName = rootComponentName + 'Provider';
35284
+ return [
35285
+ Provider,
35286
+ useContext$1
35287
+ ];
35288
+ }
35289
+ /* -----------------------------------------------------------------------------------------------
35290
+ * createScope
35291
+ * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
35292
+ const scopeContexts = defaultContexts.map((defaultContext)=>{
35293
+ return /*#__PURE__*/ createContext(defaultContext);
35294
+ });
35295
+ return function useScope(scope) {
35296
+ const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
35297
+ return useMemo(()=>({
35298
+ [`__scope${scopeName}`]: {
35299
+ ...scope,
35300
+ [scopeName]: contexts
35301
+ }
35302
+ })
35303
+ , [
35304
+ scope,
35305
+ contexts
35306
+ ]);
35307
+ };
35308
+ };
35309
+ createScope.scopeName = scopeName;
35310
+ return [
35311
+ $c512c27ab02ef895$export$fd42f52fd3ae1109,
35312
+ $c512c27ab02ef895$var$composeContextScopes$1(createScope, ...createContextScopeDeps)
35313
+ ];
35314
+ }
35315
+ /* -------------------------------------------------------------------------------------------------
35316
+ * composeContextScopes
35317
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes$1(...scopes) {
35318
+ const baseScope = scopes[0];
35319
+ if (scopes.length === 1) return baseScope;
35320
+ const createScope1 = ()=>{
35321
+ const scopeHooks = scopes.map((createScope)=>({
35322
+ useScope: createScope(),
35323
+ scopeName: createScope.scopeName
35324
+ })
35325
+ );
35326
+ return function useComposedScopes(overrideScopes) {
35327
+ const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
35328
+ // We are calling a hook inside a callback which React warns against to avoid inconsistent
35329
+ // renders, however, scoping doesn't have render side effects so we ignore the rule.
35330
+ // eslint-disable-next-line react-hooks/rules-of-hooks
35331
+ const scopeProps = useScope(overrideScopes);
35332
+ const currentScope = scopeProps[`__scope${scopeName}`];
35333
+ return {
35334
+ ...nextScopes,
35335
+ ...currentScope
35336
+ };
35337
+ }, {});
35338
+ return useMemo(()=>({
35339
+ [`__scope${baseScope.scopeName}`]: nextScopes1
35340
+ })
35341
+ , [
35342
+ nextScopes1
35343
+ ]);
35344
+ };
35345
+ };
35346
+ createScope1.scopeName = baseScope.scopeName;
35347
+ return createScope1;
35348
+ }
35349
+
35350
+ /**
35351
+ * Set a given ref to a given value
35352
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
35353
+ */ function $6ed0406888f73fc4$var$setRef$3(ref, value) {
35354
+ if (typeof ref === 'function') ref(value);
35355
+ else if (ref !== null && ref !== undefined) ref.current = value;
35356
+ }
35357
+ /**
35358
+ * A utility to compose multiple refs together
35359
+ * Accepts callback refs and RefObject(s)
35360
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af$3(...refs) {
35361
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$3(ref, node)
35362
+ )
35363
+ ;
35364
+ }
35365
+ /**
35366
+ * A custom hook that composes multiple refs
35367
+ * Accepts callback refs and RefObject(s)
35368
+ */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(...refs) {
35369
+ // eslint-disable-next-line react-hooks/exhaustive-deps
35370
+ return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$3(...refs), refs);
35371
+ }
35372
+
35373
+ /**
35374
+ * Set a given ref to a given value
35375
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
35376
+ */ function $6ed0406888f73fc4$var$setRef$2(ref, value) {
35377
+ if (typeof ref === 'function') ref(value);
35378
+ else if (ref !== null && ref !== undefined) ref.current = value;
35379
+ }
35380
+ /**
35381
+ * A utility to compose multiple refs together
35382
+ * Accepts callback refs and RefObject(s)
35383
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af$2(...refs) {
35384
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$2(ref, node)
35385
+ )
35386
+ ;
35387
+ }
35388
+
35389
+ /* -------------------------------------------------------------------------------------------------
35390
+ * Slot
35391
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35392
+ const { children: children , ...slotProps } = props;
35393
+ const childrenArray = Children.toArray(children);
35394
+ const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
35395
+ if (slottable) {
35396
+ // the new element to render is the one passed as a child of `Slottable`
35397
+ const newElement = slottable.props.children;
35398
+ const newChildren = childrenArray.map((child)=>{
35399
+ if (child === slottable) {
35400
+ // because the new element will be the one rendered, we are only interested
35401
+ // in grabbing its children (`newElement.props.children`)
35402
+ if (Children.count(newElement) > 1) return Children.only(null);
35403
+ return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
35404
+ } else return child;
35405
+ });
35406
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
35407
+ ref: forwardedRef
35408
+ }), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
35409
+ }
35410
+ return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
35411
+ ref: forwardedRef
35412
+ }), children);
35413
+ });
35414
+ $5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
35415
+ /* -------------------------------------------------------------------------------------------------
35416
+ * SlotClone
35417
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35418
+ const { children: children , ...slotProps } = props;
35419
+ if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
35420
+ ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
35421
+ ref: $6ed0406888f73fc4$export$43e446d32b3d21af$2(forwardedRef, children.ref)
35422
+ });
35423
+ return Children.count(children) > 1 ? Children.only(null) : null;
35424
+ });
35425
+ $5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
35426
+ /* -------------------------------------------------------------------------------------------------
35427
+ * Slottable
35428
+ * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
35429
+ return /*#__PURE__*/ createElement(Fragment, null, children);
35430
+ };
35431
+ /* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
35432
+ return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
35433
+ }
35434
+ function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
35435
+ // all child props should override
35436
+ const overrideProps = {
35437
+ ...childProps
35438
+ };
35439
+ for(const propName in childProps){
35440
+ const slotPropValue = slotProps[propName];
35441
+ const childPropValue = childProps[propName];
35442
+ const isHandler = /^on[A-Z]/.test(propName);
35443
+ if (isHandler) {
35444
+ // if the handler exists on both, we compose them
35445
+ if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
35446
+ childPropValue(...args);
35447
+ slotPropValue(...args);
35448
+ };
35449
+ else if (slotPropValue) overrideProps[propName] = slotPropValue;
35450
+ } else if (propName === 'style') overrideProps[propName] = {
35451
+ ...slotPropValue,
35452
+ ...childPropValue
35453
+ };
35454
+ else if (propName === 'className') overrideProps[propName] = [
35455
+ slotPropValue,
35456
+ childPropValue
35457
+ ].filter(Boolean).join(' ');
35458
+ }
35459
+ return {
35460
+ ...slotProps,
35461
+ ...overrideProps
35462
+ };
35463
+ }
35464
+
35465
+ // We have resorted to returning slots directly rather than exposing primitives that can then
35466
+ // be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
35467
+ // This is because we encountered issues with generic types that cannot be statically analysed
35468
+ // due to creating them dynamically via createCollection.
35469
+ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
35470
+ /* -----------------------------------------------------------------------------------------------
35471
+ * CollectionProvider
35472
+ * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
35473
+ const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1(PROVIDER_NAME);
35474
+ const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
35475
+ collectionRef: {
35476
+ current: null
35477
+ },
35478
+ itemMap: new Map()
35479
+ });
35480
+ const CollectionProvider = (props)=>{
35481
+ const { scope: scope , children: children } = props;
35482
+ const ref = React__default.useRef(null);
35483
+ const itemMap = React__default.useRef(new Map()).current;
35484
+ return /*#__PURE__*/ React__default.createElement(CollectionProviderImpl, {
35485
+ scope: scope,
35486
+ itemMap: itemMap,
35487
+ collectionRef: ref
35488
+ }, children);
35489
+ };
35490
+ /* -----------------------------------------------------------------------------------------------
35491
+ * CollectionSlot
35492
+ * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
35493
+ const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
35494
+ const { scope: scope , children: children } = props;
35495
+ const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
35496
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, context.collectionRef);
35497
+ return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
35498
+ ref: composedRefs
35499
+ }, children);
35500
+ });
35501
+ /* -----------------------------------------------------------------------------------------------
35502
+ * CollectionItem
35503
+ * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
35504
+ const ITEM_DATA_ATTR = 'data-radix-collection-item';
35505
+ const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
35506
+ const { scope: scope , children: children , ...itemData } = props;
35507
+ const ref = React__default.useRef(null);
35508
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, ref);
35509
+ const context = useCollectionContext(ITEM_SLOT_NAME, scope);
35510
+ React__default.useEffect(()=>{
35511
+ context.itemMap.set(ref, {
35512
+ ref: ref,
35513
+ ...itemData
35514
+ });
35515
+ return ()=>void context.itemMap.delete(ref)
35516
+ ;
35517
+ });
35518
+ return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
35519
+ [ITEM_DATA_ATTR]: '',
35520
+ ref: composedRefs
35521
+ }, children);
35522
+ });
35523
+ /* -----------------------------------------------------------------------------------------------
35524
+ * useCollection
35525
+ * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
35526
+ const context = useCollectionContext(name + 'CollectionConsumer', scope);
35527
+ const getItems = React__default.useCallback(()=>{
35528
+ const collectionNode = context.collectionRef.current;
35529
+ if (!collectionNode) return [];
35530
+ const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
35531
+ const items = Array.from(context.itemMap.values());
35532
+ const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
35533
+ );
35534
+ return orderedItems;
35535
+ }, [
35536
+ context.collectionRef,
35537
+ context.itemMap
35538
+ ]);
35539
+ return getItems;
35540
+ }
35541
+ return [
35542
+ {
35543
+ Provider: CollectionProvider,
35544
+ Slot: CollectionSlot,
35545
+ ItemSlot: CollectionItemSlot
35546
+ },
35547
+ useCollection,
35548
+ createCollectionScope
35549
+ ];
35550
+ }
35551
+
35552
+ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
35553
+ /* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
35554
+ const globalDir = useContext($f631663db3294ace$var$DirectionContext);
35555
+ return localDir || globalDir || 'ltr';
35556
+ }
35557
+
35558
+ const $8927f6f2acc4f386$var$NODES$3 = [
35559
+ 'a',
35560
+ 'button',
35561
+ 'div',
35562
+ 'h2',
35563
+ 'h3',
35564
+ 'img',
35565
+ 'label',
35566
+ 'li',
35567
+ 'nav',
35568
+ 'ol',
35569
+ 'p',
35570
+ 'span',
35571
+ 'svg',
35572
+ 'ul'
35573
+ ]; // Temporary while we await merge of this fix:
35574
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
35575
+ // prettier-ignore
35576
+ /* -------------------------------------------------------------------------------------------------
35577
+ * Primitive
35578
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$3 = $8927f6f2acc4f386$var$NODES$3.reduce((primitive, node)=>{
35579
+ const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35580
+ const { asChild: asChild , ...primitiveProps } = props;
35581
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
35582
+ useEffect(()=>{
35583
+ window[Symbol.for('radix-ui')] = true;
35584
+ }, []);
35585
+ return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
35586
+ ref: forwardedRef
35587
+ }));
35588
+ });
35589
+ Node.displayName = `Primitive.${node}`;
35590
+ return {
35591
+ ...primitive,
35592
+ [node]: Node
35593
+ };
35594
+ }, {});
35595
+ /* -------------------------------------------------------------------------------------------------
35596
+ * Utils
35597
+ * -----------------------------------------------------------------------------------------------*/ /**
35598
+ * Flush custom event dispatch
35599
+ * https://github.com/radix-ui/primitives/pull/1378
35600
+ *
35601
+ * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.
35602
+ *
35603
+ * Internally, React prioritises events in the following order:
35604
+ * - discrete
35605
+ * - continuous
35606
+ * - default
35607
+ *
35608
+ * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
35609
+ *
35610
+ * `discrete` is an important distinction as updates within these events are applied immediately.
35611
+ * React however, is not able to infer the priority of custom event types due to how they are detected internally.
35612
+ * Because of this, it's possible for updates from custom events to be unexpectedly batched when
35613
+ * dispatched by another `discrete` event.
35614
+ *
35615
+ * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.
35616
+ * This utility should be used when dispatching a custom event from within another `discrete` event, this utility
35617
+ * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.
35618
+ * For example:
35619
+ *
35620
+ * dispatching a known click 👎
35621
+ * target.dispatchEvent(new Event(‘click’))
35622
+ *
35623
+ * dispatching a custom type within a non-discrete event 👎
35624
+ * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}
35625
+ *
35626
+ * dispatching a custom type within a `discrete` event 👍
35627
+ * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}
35628
+ *
35629
+ * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use
35630
+ * this utility with them. This is because it's possible for those handlers to be called implicitly during render
35631
+ * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.
35632
+ */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
35633
+ if (target) reactDom.exports.flushSync(()=>target.dispatchEvent(event)
35634
+ );
35635
+ }
35636
+
35637
+ /**
35638
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
35639
+ * prop or avoid re-executing effects when passed as a dependency
35640
+ */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(callback) {
35641
+ const callbackRef = useRef(callback);
35642
+ useEffect(()=>{
35643
+ callbackRef.current = callback;
35644
+ }); // https://github.com/facebook/react/issues/19240
35645
+ return useMemo(()=>(...args)=>{
35646
+ var _callbackRef$current;
35647
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
35648
+ }
35649
+ , []);
35650
+ }
35651
+
35652
+ /**
35653
+ * Listens for when the escape key is down
35654
+ */ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
35655
+ const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onEscapeKeyDownProp);
35656
+ useEffect(()=>{
35657
+ const handleKeyDown = (event)=>{
35658
+ if (event.key === 'Escape') onEscapeKeyDown(event);
35659
+ };
35660
+ ownerDocument.addEventListener('keydown', handleKeyDown);
35661
+ return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
35662
+ ;
35663
+ }, [
35664
+ onEscapeKeyDown,
35665
+ ownerDocument
35666
+ ]);
35667
+ }
35668
+
35669
+ const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
35670
+ const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
35671
+ const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
35672
+ let $5cb92bef7577960e$var$originalBodyPointerEvents;
35673
+ const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
35674
+ layers: new Set(),
35675
+ layersWithOutsidePointerEventsDisabled: new Set(),
35676
+ branches: new Set()
35677
+ });
35678
+ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35679
+ var _node$ownerDocument;
35680
+ const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
35681
+ const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
35682
+ const [node1, setNode] = useState(null);
35683
+ 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;
35684
+ const [, force] = useState({});
35685
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, (node)=>setNode(node)
35686
+ );
35687
+ const layers = Array.from(context.layers);
35688
+ const [highestLayerWithOutsidePointerEventsDisabled] = [
35689
+ ...context.layersWithOutsidePointerEventsDisabled
35690
+ ].slice(-1); // prettier-ignore
35691
+ const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
35692
+ const index = node1 ? layers.indexOf(node1) : -1;
35693
+ const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
35694
+ const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
35695
+ const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
35696
+ const target = event.target;
35697
+ const isPointerDownOnBranch = [
35698
+ ...context.branches
35699
+ ].some((branch)=>branch.contains(target)
35700
+ );
35701
+ if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
35702
+ onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
35703
+ onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
35704
+ if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
35705
+ }, ownerDocument);
35706
+ const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
35707
+ const target = event.target;
35708
+ const isFocusInBranch = [
35709
+ ...context.branches
35710
+ ].some((branch)=>branch.contains(target)
35711
+ );
35712
+ if (isFocusInBranch) return;
35713
+ onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
35714
+ onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
35715
+ if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
35716
+ }, ownerDocument);
35717
+ $addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
35718
+ const isHighestLayer = index === context.layers.size - 1;
35719
+ if (!isHighestLayer) return;
35720
+ onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
35721
+ if (!event.defaultPrevented && onDismiss) {
35722
+ event.preventDefault();
35723
+ onDismiss();
35724
+ }
35725
+ }, ownerDocument);
35726
+ useEffect(()=>{
35727
+ if (!node1) return;
35728
+ if (disableOutsidePointerEvents) {
35729
+ if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
35730
+ $5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
35731
+ ownerDocument.body.style.pointerEvents = 'none';
35732
+ }
35733
+ context.layersWithOutsidePointerEventsDisabled.add(node1);
35734
+ }
35735
+ context.layers.add(node1);
35736
+ $5cb92bef7577960e$var$dispatchUpdate();
35737
+ return ()=>{
35738
+ if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
35739
+ };
35740
+ }, [
35741
+ node1,
35742
+ ownerDocument,
35743
+ disableOutsidePointerEvents,
35744
+ context
35745
+ ]);
35746
+ /**
35747
+ * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
35748
+ * because a change to `disableOutsidePointerEvents` would remove this layer from the stack
35749
+ * and add it to the end again so the layering order wouldn't be _creation order_.
35750
+ * We only want them to be removed from context stacks when unmounted.
35751
+ */ useEffect(()=>{
35752
+ return ()=>{
35753
+ if (!node1) return;
35754
+ context.layers.delete(node1);
35755
+ context.layersWithOutsidePointerEventsDisabled.delete(node1);
35756
+ $5cb92bef7577960e$var$dispatchUpdate();
35757
+ };
35758
+ }, [
35759
+ node1,
35760
+ context
35761
+ ]);
35762
+ useEffect(()=>{
35763
+ const handleUpdate = ()=>force({})
35764
+ ;
35765
+ document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
35766
+ return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
35767
+ ;
35768
+ }, []);
35769
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.div, _extends({}, layerProps, {
35770
+ ref: composedRefs,
35771
+ style: {
35772
+ pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
35773
+ ...props.style
35774
+ },
35775
+ onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onFocusCapture, focusOutside.onFocusCapture),
35776
+ onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onBlurCapture, focusOutside.onBlurCapture),
35777
+ onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
35778
+ }));
35779
+ });
35780
+ /* -----------------------------------------------------------------------------------------------*/ /**
35781
+ * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
35782
+ * to mimic layer dismissing behaviour present in OS.
35783
+ * Returns props to pass to the node we want to check for outside events.
35784
+ */ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
35785
+ const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onPointerDownOutside);
35786
+ const isPointerInsideReactTreeRef = useRef(false);
35787
+ const handleClickRef = useRef(()=>{});
35788
+ useEffect(()=>{
35789
+ const handlePointerDown = (event)=>{
35790
+ if (event.target && !isPointerInsideReactTreeRef.current) {
35791
+ const eventDetail = {
35792
+ originalEvent: event
35793
+ };
35794
+ function handleAndDispatchPointerDownOutsideEvent() {
35795
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
35796
+ discrete: true
35797
+ });
35798
+ }
35799
+ /**
35800
+ * On touch devices, we need to wait for a click event because browsers implement
35801
+ * a ~350ms delay between the time the user stops touching the display and when the
35802
+ * browser executres events. We need to ensure we don't reactivate pointer-events within
35803
+ * this timeframe otherwise the browser may execute events that should have been prevented.
35804
+ *
35805
+ * Additionally, this also lets us deal automatically with cancellations when a click event
35806
+ * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
35807
+ *
35808
+ * This is why we also continuously remove the previous listener, because we cannot be
35809
+ * certain that it was raised, and therefore cleaned-up.
35810
+ */ if (event.pointerType === 'touch') {
35811
+ ownerDocument.removeEventListener('click', handleClickRef.current);
35812
+ handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
35813
+ ownerDocument.addEventListener('click', handleClickRef.current, {
35814
+ once: true
35815
+ });
35816
+ } else handleAndDispatchPointerDownOutsideEvent();
35817
+ }
35818
+ isPointerInsideReactTreeRef.current = false;
35819
+ };
35820
+ /**
35821
+ * if this hook executes in a component that mounts via a `pointerdown` event, the event
35822
+ * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
35823
+ * this by delaying the event listener registration on the document.
35824
+ * This is not React specific, but rather how the DOM works, ie:
35825
+ * ```
35826
+ * button.addEventListener('pointerdown', () => {
35827
+ * console.log('I will log');
35828
+ * document.addEventListener('pointerdown', () => {
35829
+ * console.log('I will also log');
35830
+ * })
35831
+ * });
35832
+ */ const timerId = window.setTimeout(()=>{
35833
+ ownerDocument.addEventListener('pointerdown', handlePointerDown);
35834
+ }, 0);
35835
+ return ()=>{
35836
+ window.clearTimeout(timerId);
35837
+ ownerDocument.removeEventListener('pointerdown', handlePointerDown);
35838
+ ownerDocument.removeEventListener('click', handleClickRef.current);
35839
+ };
35840
+ }, [
35841
+ ownerDocument,
35842
+ handlePointerDownOutside
35843
+ ]);
35844
+ return {
35845
+ // ensures we check React component tree (not just DOM tree)
35846
+ onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
35847
+ };
35848
+ }
35849
+ /**
35850
+ * Listens for when focus happens outside a react subtree.
35851
+ * Returns props to pass to the root (node) of the subtree we want to check.
35852
+ */ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
35853
+ const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onFocusOutside);
35854
+ const isFocusInsideReactTreeRef = useRef(false);
35855
+ useEffect(()=>{
35856
+ const handleFocus = (event)=>{
35857
+ if (event.target && !isFocusInsideReactTreeRef.current) {
35858
+ const eventDetail = {
35859
+ originalEvent: event
35860
+ };
35861
+ $5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
35862
+ discrete: false
35863
+ });
35864
+ }
35865
+ };
35866
+ ownerDocument.addEventListener('focusin', handleFocus);
35867
+ return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
35868
+ ;
35869
+ }, [
35870
+ ownerDocument,
35871
+ handleFocusOutside
35872
+ ]);
35873
+ return {
35874
+ onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
35875
+ ,
35876
+ onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
35877
+ };
35878
+ }
35879
+ function $5cb92bef7577960e$var$dispatchUpdate() {
35880
+ const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
35881
+ document.dispatchEvent(event);
35882
+ }
35883
+ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
35884
+ const target = detail.originalEvent.target;
35885
+ const event = new CustomEvent(name, {
35886
+ bubbles: false,
35887
+ cancelable: true,
35888
+ detail: detail
35889
+ });
35890
+ if (handler) target.addEventListener(name, handler, {
35891
+ once: true
35892
+ });
35893
+ if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
35894
+ else target.dispatchEvent(event);
35895
+ }
35896
+
35897
+ /** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0;
35898
+ /**
35899
+ * Injects a pair of focus guards at the edges of the whole DOM tree
35900
+ * to ensure `focusin` & `focusout` events can be caught consistently.
35901
+ */ function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
35902
+ useEffect(()=>{
35903
+ var _edgeGuards$, _edgeGuards$2;
35904
+ const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]');
35905
+ document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
35906
+ document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
35907
+ $3db38b7d1fb3fe6a$var$count++;
35908
+ return ()=>{
35909
+ if ($3db38b7d1fb3fe6a$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach((node)=>node.remove()
35910
+ );
35911
+ $3db38b7d1fb3fe6a$var$count--;
35912
+ };
35913
+ }, []);
35914
+ }
35915
+ function $3db38b7d1fb3fe6a$var$createFocusGuard() {
35916
+ const element = document.createElement('span');
35917
+ element.setAttribute('data-radix-focus-guard', '');
35918
+ element.tabIndex = 0;
35919
+ element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none';
35920
+ return element;
35921
+ }
35922
+
35923
+ /**
35924
+ * Set a given ref to a given value
35925
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
35926
+ */ function $6ed0406888f73fc4$var$setRef$1(ref, value) {
35927
+ if (typeof ref === 'function') ref(value);
35928
+ else if (ref !== null && ref !== undefined) ref.current = value;
35929
+ }
35930
+ /**
35931
+ * A utility to compose multiple refs together
35932
+ * Accepts callback refs and RefObject(s)
35933
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs) {
35934
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef$1(ref, node)
35935
+ )
35936
+ ;
35937
+ }
35938
+ /**
35939
+ * A custom hook that composes multiple refs
35940
+ * Accepts callback refs and RefObject(s)
35941
+ */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(...refs) {
35942
+ // eslint-disable-next-line react-hooks/exhaustive-deps
35943
+ return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af$1(...refs), refs);
35944
+ }
35945
+
35946
+ const $8927f6f2acc4f386$var$NODES$2 = [
35947
+ 'a',
35948
+ 'button',
35949
+ 'div',
35950
+ 'h2',
35951
+ 'h3',
35952
+ 'img',
35953
+ 'label',
35954
+ 'li',
35955
+ 'nav',
35956
+ 'ol',
35957
+ 'p',
35958
+ 'span',
35959
+ 'svg',
35960
+ 'ul'
35961
+ ]; // Temporary while we await merge of this fix:
35962
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
35963
+ // prettier-ignore
35964
+ /* -------------------------------------------------------------------------------------------------
35965
+ * Primitive
35966
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$2 = $8927f6f2acc4f386$var$NODES$2.reduce((primitive, node)=>{
35967
+ const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35968
+ const { asChild: asChild , ...primitiveProps } = props;
35969
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
35970
+ useEffect(()=>{
35971
+ window[Symbol.for('radix-ui')] = true;
35972
+ }, []);
35973
+ return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
35974
+ ref: forwardedRef
35975
+ }));
35976
+ });
35977
+ Node.displayName = `Primitive.${node}`;
35978
+ return {
35979
+ ...primitive,
35980
+ [node]: Node
35981
+ };
35982
+ }, {});
35983
+
35984
+ /**
35985
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
35986
+ * prop or avoid re-executing effects when passed as a dependency
35987
+ */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(callback) {
35988
+ const callbackRef = useRef(callback);
35989
+ useEffect(()=>{
35990
+ callbackRef.current = callback;
35991
+ }); // https://github.com/facebook/react/issues/19240
35992
+ return useMemo(()=>(...args)=>{
35993
+ var _callbackRef$current;
35994
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
35995
+ }
35996
+ , []);
35997
+ }
35998
+
35999
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount';
36000
+ const $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount';
36001
+ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
36002
+ bubbles: false,
36003
+ cancelable: true
36004
+ };
36005
+ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36006
+ const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
36007
+ const [container1, setContainer] = useState(null);
36008
+ const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onMountAutoFocusProp);
36009
+ const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$1(onUnmountAutoFocusProp);
36010
+ const lastFocusedElementRef = useRef(null);
36011
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$1(forwardedRef, (node)=>setContainer(node)
36012
+ );
36013
+ const focusScope = useRef({
36014
+ paused: false,
36015
+ pause () {
36016
+ this.paused = true;
36017
+ },
36018
+ resume () {
36019
+ this.paused = false;
36020
+ }
36021
+ }).current; // Takes care of trapping focus if focus is moved outside programmatically for example
36022
+ useEffect(()=>{
36023
+ if (trapped) {
36024
+ function handleFocusIn(event) {
36025
+ if (focusScope.paused || !container1) return;
36026
+ const target = event.target;
36027
+ if (container1.contains(target)) lastFocusedElementRef.current = target;
36028
+ else $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
36029
+ select: true
36030
+ });
36031
+ }
36032
+ function handleFocusOut(event) {
36033
+ if (focusScope.paused || !container1) return;
36034
+ if (!container1.contains(event.relatedTarget)) $d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
36035
+ select: true
36036
+ });
36037
+ }
36038
+ document.addEventListener('focusin', handleFocusIn);
36039
+ document.addEventListener('focusout', handleFocusOut);
36040
+ return ()=>{
36041
+ document.removeEventListener('focusin', handleFocusIn);
36042
+ document.removeEventListener('focusout', handleFocusOut);
36043
+ };
36044
+ }
36045
+ }, [
36046
+ trapped,
36047
+ container1,
36048
+ focusScope.paused
36049
+ ]);
36050
+ useEffect(()=>{
36051
+ if (container1) {
36052
+ $d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
36053
+ const previouslyFocusedElement = document.activeElement;
36054
+ const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
36055
+ if (!hasFocusedCandidate) {
36056
+ const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
36057
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
36058
+ container1.dispatchEvent(mountEvent);
36059
+ if (!mountEvent.defaultPrevented) {
36060
+ $d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
36061
+ select: true
36062
+ });
36063
+ if (document.activeElement === previouslyFocusedElement) $d3863c46a17e8a28$var$focus(container1);
36064
+ }
36065
+ }
36066
+ return ()=>{
36067
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount.
36068
+ // We need to delay the focus a little to get around it for now.
36069
+ // See: https://github.com/facebook/react/issues/17894
36070
+ setTimeout(()=>{
36071
+ const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
36072
+ container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
36073
+ container1.dispatchEvent(unmountEvent);
36074
+ if (!unmountEvent.defaultPrevented) $d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
36075
+ select: true
36076
+ });
36077
+ // we need to remove the listener after we `dispatchEvent`
36078
+ container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
36079
+ $d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
36080
+ }, 0);
36081
+ };
36082
+ }
36083
+ }, [
36084
+ container1,
36085
+ onMountAutoFocus,
36086
+ onUnmountAutoFocus,
36087
+ focusScope
36088
+ ]); // Takes care of looping focus (when tabbing whilst at the edges)
36089
+ const handleKeyDown = useCallback((event)=>{
36090
+ if (!loop && !trapped) return;
36091
+ if (focusScope.paused) return;
36092
+ const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey;
36093
+ const focusedElement = document.activeElement;
36094
+ if (isTabKey && focusedElement) {
36095
+ const container = event.currentTarget;
36096
+ const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
36097
+ const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges
36098
+ if (!hasTabbableElementsInside) {
36099
+ if (focusedElement === container) event.preventDefault();
36100
+ } else {
36101
+ if (!event.shiftKey && focusedElement === last) {
36102
+ event.preventDefault();
36103
+ if (loop) $d3863c46a17e8a28$var$focus(first, {
36104
+ select: true
36105
+ });
36106
+ } else if (event.shiftKey && focusedElement === first) {
36107
+ event.preventDefault();
36108
+ if (loop) $d3863c46a17e8a28$var$focus(last, {
36109
+ select: true
36110
+ });
36111
+ }
36112
+ }
36113
+ }
36114
+ }, [
36115
+ loop,
36116
+ trapped,
36117
+ focusScope.paused
36118
+ ]);
36119
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$2.div, _extends({
36120
+ tabIndex: -1
36121
+ }, scopeProps, {
36122
+ ref: composedRefs,
36123
+ onKeyDown: handleKeyDown
36124
+ }));
36125
+ });
36126
+ /* -------------------------------------------------------------------------------------------------
36127
+ * Utils
36128
+ * -----------------------------------------------------------------------------------------------*/ /**
36129
+ * Attempts focusing the first element in a list of candidates.
36130
+ * Stops when focus has actually moved.
36131
+ */ function $d3863c46a17e8a28$var$focusFirst(candidates, { select: select = false } = {}) {
36132
+ const previouslyFocusedElement = document.activeElement;
36133
+ for (const candidate of candidates){
36134
+ $d3863c46a17e8a28$var$focus(candidate, {
36135
+ select: select
36136
+ });
36137
+ if (document.activeElement !== previouslyFocusedElement) return;
36138
+ }
36139
+ }
36140
+ /**
36141
+ * Returns the first and last tabbable elements inside a container.
36142
+ */ function $d3863c46a17e8a28$var$getTabbableEdges(container) {
36143
+ const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
36144
+ const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
36145
+ const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
36146
+ return [
36147
+ first,
36148
+ last
36149
+ ];
36150
+ }
36151
+ /**
36152
+ * Returns a list of potential tabbable candidates.
36153
+ *
36154
+ * NOTE: This is only a close approximation. For example it doesn't take into account cases like when
36155
+ * elements are not visible. This cannot be worked out easily by just reading a property, but rather
36156
+ * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately.
36157
+ *
36158
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker
36159
+ * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
36160
+ */ function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
36161
+ const nodes = [];
36162
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
36163
+ acceptNode: (node)=>{
36164
+ const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden';
36165
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
36166
+ // runtime's understanding of tabbability, so this automatically accounts
36167
+ // for any kind of element that could be tabbed to.
36168
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
36169
+ }
36170
+ });
36171
+ while(walker.nextNode())nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it
36172
+ // hinders accessibility to have tab order different from visual order.
36173
+ return nodes;
36174
+ }
36175
+ /**
36176
+ * Returns the first visible element in a list.
36177
+ * NOTE: Only checks visibility up to the `container`.
36178
+ */ function $d3863c46a17e8a28$var$findVisible(elements, container) {
36179
+ for (const element of elements){
36180
+ // we stop checking if it's hidden at the `container` level (excluding)
36181
+ if (!$d3863c46a17e8a28$var$isHidden(element, {
36182
+ upTo: container
36183
+ })) return element;
36184
+ }
36185
+ }
36186
+ function $d3863c46a17e8a28$var$isHidden(node, { upTo: upTo }) {
36187
+ if (getComputedStyle(node).visibility === 'hidden') return true;
36188
+ while(node){
36189
+ // we stop at `upTo` (excluding it)
36190
+ if (upTo !== undefined && node === upTo) return false;
36191
+ if (getComputedStyle(node).display === 'none') return true;
36192
+ node = node.parentElement;
36193
+ }
36194
+ return false;
36195
+ }
36196
+ function $d3863c46a17e8a28$var$isSelectableInput(element) {
36197
+ return element instanceof HTMLInputElement && 'select' in element;
36198
+ }
36199
+ function $d3863c46a17e8a28$var$focus(element, { select: select = false } = {}) {
36200
+ // only focus if that element is focusable
36201
+ if (element && element.focus) {
36202
+ const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
36203
+ element.focus({
36204
+ preventScroll: true
36205
+ }); // only select if its not the same element, it supports selection and we need to select
36206
+ if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select) element.select();
36207
+ }
36208
+ }
36209
+ /* -------------------------------------------------------------------------------------------------
36210
+ * FocusScope stack
36211
+ * -----------------------------------------------------------------------------------------------*/ const $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
36212
+ function $d3863c46a17e8a28$var$createFocusScopesStack() {
36213
+ /** A stack of focus scopes, with the active one at the top */ let stack = [];
36214
+ return {
36215
+ add (focusScope) {
36216
+ // pause the currently active focus scope (at the top of the stack)
36217
+ const activeFocusScope = stack[0];
36218
+ if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
36219
+ // remove in case it already exists (because we'll re-add it at the top of the stack)
36220
+ stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
36221
+ stack.unshift(focusScope);
36222
+ },
36223
+ remove (focusScope) {
36224
+ var _stack$;
36225
+ stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
36226
+ (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
36227
+ }
36228
+ };
36229
+ }
36230
+ function $d3863c46a17e8a28$var$arrayRemove(array, item) {
36231
+ const updatedArray = [
36232
+ ...array
36233
+ ];
36234
+ const index = updatedArray.indexOf(item);
36235
+ if (index !== -1) updatedArray.splice(index, 1);
36236
+ return updatedArray;
36237
+ }
36238
+ function $d3863c46a17e8a28$var$removeLinks(items) {
36239
+ return items.filter((item)=>item.tagName !== 'A'
36240
+ );
36241
+ }
36242
+
36243
+ /**
36244
+ * On the server, React emits a warning when calling `useLayoutEffect`.
36245
+ * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
36246
+ * We use this safe version which suppresses the warning by replacing it with a noop on the server.
36247
+ *
36248
+ * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
36249
+ */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
36250
+
36251
+ const $1746a345f3d73bb7$var$useReactId = React$c['useId'.toString()] || (()=>undefined
36252
+ );
36253
+ let $1746a345f3d73bb7$var$count = 0;
36254
+ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
36255
+ const [id, setId] = React$c.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
36256
+ $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
36257
+ if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
36258
+ );
36259
+ }, [
36260
+ deterministicId
36261
+ ]);
36262
+ return deterministicId || (id ? `radix-${id}` : '');
36263
+ }
36264
+
36265
+ const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36266
+ var _globalThis$document;
36267
+ 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;
36268
+ return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.div, _extends({}, portalProps, {
36269
+ ref: forwardedRef
36270
+ })), container) : null;
36271
+ });
36272
+
36273
+ function $71cd76cc60e0454e$export$6f32135080cb4c3$1({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
36274
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState$1({
36275
+ defaultProp: defaultProp,
36276
+ onChange: onChange
36277
+ });
36278
+ const isControlled = prop !== undefined;
36279
+ const value1 = isControlled ? prop : uncontrolledProp;
36280
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onChange);
36281
+ const setValue = useCallback((nextValue)=>{
36282
+ if (isControlled) {
36283
+ const setter = nextValue;
36284
+ const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
36285
+ if (value !== prop) handleChange(value);
36286
+ } else setUncontrolledProp(nextValue);
36287
+ }, [
36288
+ isControlled,
36289
+ prop,
36290
+ setUncontrolledProp,
36291
+ handleChange
36292
+ ]);
36293
+ return [
36294
+ value1,
36295
+ setValue
34627
36296
  ];
34628
- };
34629
- var elementCouldBeScrolled = function (axis, node) {
34630
- return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
34631
- };
34632
- var getScrollVariables = function (axis, node) {
34633
- return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
34634
- };
34635
- var getDirectionFactor = function (axis, direction) {
34636
- /**
34637
- * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
34638
- * and then increasingly negative as you scroll towards the end of the content.
34639
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
34640
- */
34641
- return axis === 'h' && direction === 'rtl' ? -1 : 1;
34642
- };
34643
- var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {
34644
- var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
34645
- var delta = directionFactor * sourceDelta;
34646
- // find scrollable target
34647
- var target = event.target;
34648
- var targetInLock = endTarget.contains(target);
34649
- var shouldCancelScroll = false;
34650
- var isDeltaPositive = delta > 0;
34651
- var availableScroll = 0;
34652
- var availableScrollTop = 0;
34653
- do {
34654
- var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
34655
- var elementScroll = scroll_1 - capacity - directionFactor * position;
34656
- if (position || elementScroll) {
34657
- if (elementCouldBeScrolled(axis, target)) {
34658
- availableScroll += elementScroll;
34659
- availableScrollTop += position;
34660
- }
36297
+ }
36298
+ function $71cd76cc60e0454e$var$useUncontrolledState$1({ defaultProp: defaultProp , onChange: onChange }) {
36299
+ const uncontrolledState = useState(defaultProp);
36300
+ const [value] = uncontrolledState;
36301
+ const prevValueRef = useRef(value);
36302
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onChange);
36303
+ useEffect(()=>{
36304
+ if (prevValueRef.current !== value) {
36305
+ handleChange(value);
36306
+ prevValueRef.current = value;
34661
36307
  }
34662
- target = target.parentNode;
34663
- } while (
34664
- // portaled content
34665
- (!targetInLock && target !== document.body) ||
34666
- // self content
34667
- (targetInLock && (endTarget.contains(target) || endTarget === target)));
34668
- if (isDeltaPositive && ((noOverscroll && availableScroll === 0) || (!noOverscroll && delta > availableScroll))) {
34669
- shouldCancelScroll = true;
34670
- }
34671
- else if (!isDeltaPositive &&
34672
- ((noOverscroll && availableScrollTop === 0) || (!noOverscroll && -delta > availableScrollTop))) {
34673
- shouldCancelScroll = true;
34674
- }
34675
- return shouldCancelScroll;
34676
- };
36308
+ }, [
36309
+ value,
36310
+ prevValueRef,
36311
+ handleChange
36312
+ ]);
36313
+ return uncontrolledState;
36314
+ }
34677
36315
 
34678
- var getTouchXY = function (event) {
34679
- return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
34680
- };
34681
- var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };
34682
- var extractRef = function (ref) {
34683
- return ref && 'current' in ref ? ref.current : ref;
34684
- };
34685
- var deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };
34686
- var generateStyle = function (id) { return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n"); };
34687
- var idCounter = 0;
34688
- var lockStack = [];
34689
- function RemoveScrollSideCar(props) {
34690
- var shouldPreventQueue = React$b.useRef([]);
34691
- var touchStartRef = React$b.useRef([0, 0]);
34692
- var activeAxis = React$b.useRef();
34693
- var id = React$b.useState(idCounter++)[0];
34694
- var Style = React$b.useState(function () { return styleSingleton(); })[0];
34695
- var lastProps = React$b.useRef(props);
34696
- React$b.useEffect(function () {
34697
- lastProps.current = props;
34698
- }, [props]);
34699
- React$b.useEffect(function () {
34700
- if (props.inert) {
34701
- document.body.classList.add("block-interactivity-".concat(id));
34702
- var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
34703
- allow_1.forEach(function (el) { return el.classList.add("allow-interactivity-".concat(id)); });
34704
- return function () {
34705
- document.body.classList.remove("block-interactivity-".concat(id));
34706
- allow_1.forEach(function (el) { return el.classList.remove("allow-interactivity-".concat(id)); });
34707
- };
34708
- }
34709
- return;
34710
- }, [props.inert, props.lockRef.current, props.shards]);
34711
- var shouldCancelEvent = React$b.useCallback(function (event, parent) {
34712
- if ('touches' in event && event.touches.length === 2) {
34713
- return !lastProps.current.allowPinchZoom;
34714
- }
34715
- var touch = getTouchXY(event);
34716
- var touchStart = touchStartRef.current;
34717
- var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
34718
- var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
34719
- var currentAxis;
34720
- var target = event.target;
34721
- var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
34722
- // allow horizontal touch move on Range inputs. They will not cause any scroll
34723
- if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
34724
- return false;
34725
- }
34726
- var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
34727
- if (!canBeScrolledInMainDirection) {
34728
- return true;
34729
- }
34730
- if (canBeScrolledInMainDirection) {
34731
- currentAxis = moveDirection;
34732
- }
34733
- else {
34734
- currentAxis = moveDirection === 'v' ? 'h' : 'v';
34735
- canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
34736
- // other axis might be not scrollable
34737
- }
34738
- if (!canBeScrolledInMainDirection) {
34739
- return false;
34740
- }
34741
- if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
34742
- activeAxis.current = currentAxis;
34743
- }
34744
- if (!currentAxis) {
34745
- return true;
34746
- }
34747
- var cancelingAxis = activeAxis.current || currentAxis;
34748
- return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
34749
- }, []);
34750
- var shouldPrevent = React$b.useCallback(function (_event) {
34751
- var event = _event;
34752
- if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
34753
- // not the last active
34754
- return;
34755
- }
34756
- var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
34757
- var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta); })[0];
34758
- // self event, and should be canceled
34759
- if (sourceEvent && sourceEvent.should) {
34760
- if (event.cancelable) {
34761
- event.preventDefault();
34762
- }
34763
- return;
34764
- }
34765
- // outside or shard event
34766
- if (!sourceEvent) {
34767
- var shardNodes = (lastProps.current.shards || [])
34768
- .map(extractRef)
34769
- .filter(Boolean)
34770
- .filter(function (node) { return node.contains(event.target); });
34771
- var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
34772
- if (shouldStop) {
34773
- if (event.cancelable) {
34774
- event.preventDefault();
34775
- }
34776
- }
36316
+ function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
36317
+ const ref = useRef({
36318
+ value: value,
36319
+ previous: value
36320
+ }); // We compare values before making an update to ensure that
36321
+ // a change has been made. This ensures the previous value is
36322
+ // persisted correctly between renders.
36323
+ return useMemo(()=>{
36324
+ if (ref.current.value !== value) {
36325
+ ref.current.previous = ref.current.value;
36326
+ ref.current.value = value;
34777
36327
  }
34778
- }, []);
34779
- var shouldCancel = React$b.useCallback(function (name, delta, target, should) {
34780
- var event = { name: name, delta: delta, target: target, should: should };
34781
- shouldPreventQueue.current.push(event);
34782
- setTimeout(function () {
34783
- shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });
34784
- }, 1);
34785
- }, []);
34786
- var scrollTouchStart = React$b.useCallback(function (event) {
34787
- touchStartRef.current = getTouchXY(event);
34788
- activeAxis.current = undefined;
34789
- }, []);
34790
- var scrollWheel = React$b.useCallback(function (event) {
34791
- shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
34792
- }, []);
34793
- var scrollTouchMove = React$b.useCallback(function (event) {
34794
- shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
34795
- }, []);
34796
- React$b.useEffect(function () {
34797
- lockStack.push(Style);
34798
- props.setCallbacks({
34799
- onScrollCapture: scrollWheel,
34800
- onWheelCapture: scrollWheel,
34801
- onTouchMoveCapture: scrollTouchMove,
34802
- });
34803
- document.addEventListener('wheel', shouldPrevent, nonPassive);
34804
- document.addEventListener('touchmove', shouldPrevent, nonPassive);
34805
- document.addEventListener('touchstart', scrollTouchStart, nonPassive);
34806
- return function () {
34807
- lockStack = lockStack.filter(function (inst) { return inst !== Style; });
34808
- document.removeEventListener('wheel', shouldPrevent, nonPassive);
34809
- document.removeEventListener('touchmove', shouldPrevent, nonPassive);
34810
- document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
34811
- };
34812
- }, []);
34813
- var removeScrollBar = props.removeScrollBar, inert = props.inert;
34814
- return (React$b.createElement(React$b.Fragment, null,
34815
- inert ? React$b.createElement(Style, { styles: generateStyle(id) }) : null,
34816
- removeScrollBar ? React$b.createElement(RemoveScrollBar, { gapMode: "margin" }) : null));
36328
+ return ref.current.previous;
36329
+ }, [
36330
+ value
36331
+ ]);
34817
36332
  }
34818
36333
 
34819
- var SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
36334
+ const $8927f6f2acc4f386$var$NODES$1 = [
36335
+ 'a',
36336
+ 'button',
36337
+ 'div',
36338
+ 'h2',
36339
+ 'h3',
36340
+ 'img',
36341
+ 'label',
36342
+ 'li',
36343
+ 'nav',
36344
+ 'ol',
36345
+ 'p',
36346
+ 'span',
36347
+ 'svg',
36348
+ 'ul'
36349
+ ]; // Temporary while we await merge of this fix:
36350
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
36351
+ // prettier-ignore
36352
+ /* -------------------------------------------------------------------------------------------------
36353
+ * Primitive
36354
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034$1 = $8927f6f2acc4f386$var$NODES$1.reduce((primitive, node)=>{
36355
+ const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36356
+ const { asChild: asChild , ...primitiveProps } = props;
36357
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
36358
+ useEffect(()=>{
36359
+ window[Symbol.for('radix-ui')] = true;
36360
+ }, []);
36361
+ return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
36362
+ ref: forwardedRef
36363
+ }));
36364
+ });
36365
+ Node.displayName = `Primitive.${node}`;
36366
+ return {
36367
+ ...primitive,
36368
+ [node]: Node
36369
+ };
36370
+ }, {});
34820
36371
 
34821
- var ReactRemoveScroll = React$b.forwardRef(function (props, ref) { return (React$b.createElement(RemoveScroll, __assign$1({}, props, { ref: ref, sideCar: SideCar }))); });
34822
- ReactRemoveScroll.classNames = RemoveScroll.classNames;
34823
- var $01b9c$RemoveScroll = ReactRemoveScroll;
36372
+ const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
36373
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$1.span, _extends({}, props, {
36374
+ ref: forwardedRef,
36375
+ style: {
36376
+ // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
36377
+ position: 'absolute',
36378
+ border: 0,
36379
+ width: 1,
36380
+ height: 1,
36381
+ padding: 0,
36382
+ margin: -1,
36383
+ overflow: 'hidden',
36384
+ clip: 'rect(0, 0, 0, 0)',
36385
+ whiteSpace: 'nowrap',
36386
+ wordWrap: 'normal',
36387
+ ...props.style
36388
+ }
36389
+ }));
36390
+ });
34824
36391
 
34825
36392
  const $cc7e05a45900e73f$var$OPEN_KEYS = [
34826
36393
  ' ',
@@ -34836,7 +36403,7 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
34836
36403
  * Select
34837
36404
  * -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
34838
36405
  const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
34839
- const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
36406
+ const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1$1($cc7e05a45900e73f$var$SELECT_NAME, [
34840
36407
  $cc7e05a45900e73f$var$createCollectionScope
34841
36408
  ]);
34842
36409
  const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
@@ -34847,12 +36414,12 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
34847
36414
  const [valueNode, setValueNode] = useState(null);
34848
36415
  const [valueNodeHasChildren, setValueNodeHasChildren] = useState(false);
34849
36416
  const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
34850
- const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
36417
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
34851
36418
  prop: openProp,
34852
36419
  defaultProp: defaultOpen,
34853
36420
  onChange: onOpenChange
34854
36421
  });
34855
- const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
36422
+ const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
34856
36423
  prop: valueProp,
34857
36424
  defaultProp: defaultValue,
34858
36425
  onChange: onValueChange
@@ -34921,7 +36488,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
34921
36488
  const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
34922
36489
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
34923
36490
  const isDisabled = context.disabled || disabled;
34924
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
36491
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, context.onTriggerChange);
34925
36492
  const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
34926
36493
  const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
34927
36494
  const enabledItems = getItems().filter((item)=>!item.disabled
@@ -34937,7 +36504,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
34937
36504
  resetTypeahead();
34938
36505
  }
34939
36506
  };
34940
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
36507
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.button, _extends({
34941
36508
  type: "button",
34942
36509
  role: "combobox",
34943
36510
  "aria-controls": context.contentId,
@@ -34952,7 +36519,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
34952
36519
  }, triggerProps, {
34953
36520
  ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
34954
36521
  ,
34955
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
36522
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onClick, (event)=>{
34956
36523
  // Whilst browsers generally have no issue focusing the trigger when clicking
34957
36524
  // on a label, Safari seems to struggle with the fact that there's no `onClick`.
34958
36525
  // We force `focus` in this case. Note: this doesn't create any other side-effect
@@ -34960,7 +36527,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
34960
36527
  // this only runs for a label "click"
34961
36528
  event.currentTarget.focus();
34962
36529
  }),
34963
- onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
36530
+ onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onPointerDown, (event)=>{
34964
36531
  // prevent implicit pointer capture
34965
36532
  // https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
34966
36533
  const target = event.target;
@@ -34976,7 +36543,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ forwardRef((props
34976
36543
  event.preventDefault();
34977
36544
  }
34978
36545
  }),
34979
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
36546
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(triggerProps.onKeyDown, (event)=>{
34980
36547
  const isTypingAhead = searchRef.current !== '';
34981
36548
  const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
34982
36549
  if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
@@ -34997,14 +36564,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ forwardRef((prop
34997
36564
  const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
34998
36565
  const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
34999
36566
  const hasChildren = children !== undefined;
35000
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
36567
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, context.onValueNodeChange);
35001
36568
  $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
35002
36569
  onValueNodeHasChildrenChange(hasChildren);
35003
36570
  }, [
35004
36571
  onValueNodeHasChildrenChange,
35005
36572
  hasChildren
35006
36573
  ]);
35007
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, valueProps, {
36574
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.span, _extends({}, valueProps, {
35008
36575
  ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
35009
36576
  ,
35010
36577
  style: {
@@ -35014,7 +36581,7 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ forwardRef((prop
35014
36581
  });
35015
36582
  const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35016
36583
  const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
35017
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
36584
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.span, _extends({
35018
36585
  "aria-hidden": true
35019
36586
  }, iconProps, {
35020
36587
  ref: forwardedRef
@@ -35050,7 +36617,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
35050
36617
  const [contentWrapper, setContentWrapper] = useState(null);
35051
36618
  const [content, setContent] = useState(null);
35052
36619
  const [viewport, setViewport] = useState(null);
35053
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
36620
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, (node)=>setContent(node)
35054
36621
  );
35055
36622
  const [selectedItem, setSelectedItem] = useState(null);
35056
36623
  const [selectedItemText, setSelectedItemText] = useState(null);
@@ -35337,7 +36904,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
35337
36904
  // we prevent open autofocus because we manually focus the selected item
35338
36905
  event.preventDefault();
35339
36906
  },
35340
- onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
36907
+ onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(onCloseAutoFocus, (event)=>{
35341
36908
  var _context$trigger;
35342
36909
  (_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
35343
36910
  preventScroll: true
@@ -35368,7 +36935,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
35368
36935
  ,
35369
36936
  onDismiss: ()=>context.onOpenChange(false)
35370
36937
  ,
35371
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
36938
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(contentProps.onKeyDown, (event)=>{
35372
36939
  const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
35373
36940
  if (event.key === 'Tab') event.preventDefault();
35374
36941
  if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
@@ -35410,7 +36977,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ forwardRef((props,
35410
36977
  const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35411
36978
  const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
35412
36979
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
35413
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
36980
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, contentContext.onViewportChange);
35414
36981
  const prevScrollTopRef = useRef(0);
35415
36982
  return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement("style", {
35416
36983
  dangerouslySetInnerHTML: {
@@ -35418,7 +36985,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((prop
35418
36985
  }
35419
36986
  }), /*#__PURE__*/ createElement($cc7e05a45900e73f$var$Collection.Slot, {
35420
36987
  scope: __scopeSelect
35421
- }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
36988
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.div, _extends({
35422
36989
  "data-radix-select-viewport": "",
35423
36990
  role: "presentation"
35424
36991
  }, viewportProps, {
@@ -35432,7 +36999,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ forwardRef((prop
35432
36999
  overflow: 'auto',
35433
37000
  ...viewportProps.style
35434
37001
  },
35435
- onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
37002
+ onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(viewportProps.onScroll, (event)=>{
35436
37003
  const viewport = event.currentTarget;
35437
37004
  const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = contentContext;
35438
37005
  if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
@@ -35473,7 +37040,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
35473
37040
  const isSelected = context.value === value;
35474
37041
  const [textValue, setTextValue] = useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
35475
37042
  const [isFocused, setIsFocused] = useState(false);
35476
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
37043
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, (node)=>{
35477
37044
  var _contentContext$itemR;
35478
37045
  return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
35479
37046
  });
@@ -35501,7 +37068,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
35501
37068
  value: value,
35502
37069
  disabled: disabled,
35503
37070
  textValue: textValue
35504
- }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
37071
+ }, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.div, _extends({
35505
37072
  role: "option",
35506
37073
  "aria-labelledby": textId,
35507
37074
  "data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
@@ -35513,12 +37080,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
35513
37080
  tabIndex: disabled ? undefined : -1
35514
37081
  }, itemProps, {
35515
37082
  ref: composedRefs,
35516
- onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
37083
+ onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onFocus, ()=>setIsFocused(true)
35517
37084
  ),
35518
- onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
37085
+ onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onBlur, ()=>setIsFocused(false)
35519
37086
  ),
35520
- onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
35521
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
37087
+ onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerUp, handleSelect),
37088
+ onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerMove, (event)=>{
35522
37089
  if (disabled) {
35523
37090
  var _contentContext$onIte;
35524
37091
  (_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
@@ -35528,13 +37095,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ forwardRef((prop
35528
37095
  preventScroll: true
35529
37096
  });
35530
37097
  }),
35531
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
37098
+ onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onPointerLeave, (event)=>{
35532
37099
  if (event.currentTarget === document.activeElement) {
35533
37100
  var _contentContext$onIte2;
35534
37101
  (_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
35535
37102
  }
35536
37103
  }),
35537
- onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
37104
+ onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(itemProps.onKeyDown, (event)=>{
35538
37105
  var _contentContext$searc;
35539
37106
  const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
35540
37107
  if (isTypingAhead && event.key === ' ') return;
@@ -35554,7 +37121,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
35554
37121
  const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
35555
37122
  const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
35556
37123
  const [itemTextNode, setItemTextNode] = useState(null);
35557
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
37124
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, (node)=>setItemTextNode(node)
35558
37125
  , itemContext.onItemTextChange, (node)=>{
35559
37126
  var _contentContext$itemT;
35560
37127
  return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
@@ -35580,7 +37147,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
35580
37147
  onNativeOptionRemove,
35581
37148
  nativeOption
35582
37149
  ]);
35583
- return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
37150
+ return /*#__PURE__*/ createElement(Fragment, null, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.span, _extends({
35584
37151
  id: itemContext.textId
35585
37152
  }, itemTextProps, {
35586
37153
  ref: composedRefs
@@ -35592,7 +37159,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ forwardRef((prop
35592
37159
  const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35593
37160
  const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
35594
37161
  const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
35595
- return itemContext.isSelected ? /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
37162
+ return itemContext.isSelected ? /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.span, _extends({
35596
37163
  "aria-hidden": true
35597
37164
  }, itemIndicatorProps, {
35598
37165
  ref: forwardedRef
@@ -35604,7 +37171,7 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ forwardRef((prop
35604
37171
  const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35605
37172
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
35606
37173
  const [canScrollUp1, setCanScrollUp] = useState(false);
35607
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
37174
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, contentContext.onScrollButtonChange);
35608
37175
  $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
35609
37176
  if (contentContext.viewport && contentContext.isPositioned) {
35610
37177
  const viewport = contentContext.viewport;
@@ -35635,7 +37202,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ forwardRef((prop
35635
37202
  const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35636
37203
  const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
35637
37204
  const [canScrollDown1, setCanScrollDown] = useState(false);
35638
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
37205
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, contentContext.onScrollButtonChange);
35639
37206
  $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
35640
37207
  if (contentContext.viewport && contentContext.isPositioned) {
35641
37208
  const viewport = contentContext.viewport;
@@ -35692,7 +37259,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
35692
37259
  }, [
35693
37260
  getItems
35694
37261
  ]);
35695
- return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
37262
+ return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034$3.div, _extends({
35696
37263
  "aria-hidden": true
35697
37264
  }, scrollIndicatorProps, {
35698
37265
  ref: forwardedRef,
@@ -35700,12 +37267,12 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
35700
37267
  flexShrink: 0,
35701
37268
  ...scrollIndicatorProps.style
35702
37269
  },
35703
- onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
37270
+ onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerMove, ()=>{
35704
37271
  var _contentContext$onIte3;
35705
37272
  (_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
35706
37273
  if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
35707
37274
  }),
35708
- onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
37275
+ onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10$1(scrollIndicatorProps.onPointerLeave, ()=>{
35709
37276
  clearAutoScrollTimer();
35710
37277
  })
35711
37278
  }));
@@ -35713,7 +37280,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
35713
37280
  /* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
35714
37281
  const { value: value , ...selectProps } = props;
35715
37282
  const ref = useRef(null);
35716
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
37283
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05$2(forwardedRef, ref);
35717
37284
  const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
35718
37285
  useEffect(()=>{
35719
37286
  const select = ref.current;
@@ -35751,7 +37318,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ forwardRef((p
35751
37318
  });
35752
37319
  $cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
35753
37320
  function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
35754
- const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
37321
+ const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a$2(onSearchChange);
35755
37322
  const searchRef = useRef('');
35756
37323
  const timerRef = useRef(0);
35757
37324
  const handleTypeaheadSearch = useCallback((key)=>{
@@ -35851,7 +37418,7 @@ var BtIconChevronUp2Px_2 = BtIconChevronUp2Px;
35851
37418
 
35852
37419
  /** Use `Select` to choose from a dropdown list of options. */
35853
37420
  var Select = function (_a) {
35854
- var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, 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;
37421
+ var isRequired = _a.isRequired, isDisabled = _a.isDisabled, placeholder = _a.placeholder, label = _a.label, 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, props = __rest$2(_a, ["isRequired", "isDisabled", "placeholder", "label", "options", "onOpenChange", "isDefaultOpen", "defaultValue", "errorMessage", "labelSize", "helper", "name", "isFluid", "onBlur", "onChange", "disclosureTitle", "disclosureText", "onClickDisclosure"]);
35855
37422
  var id = useId();
35856
37423
  var arcRootElement = useContext(ArcRootElementContext);
35857
37424
  var surface = useContext(Context$3).surface;
@@ -35866,11 +37433,11 @@ var Select = function (_a) {
35866
37433
  };
35867
37434
  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 },
35868
37435
  React__default.createElement($cc7e05a45900e73f$export$be92b6f5f03c0fe9, { name: name, required: isRequired, disabled: isDisabled, defaultOpen: isDefaultOpen, value: selectedValue, onOpenChange: onOpenChange, onValueChange: function (value) { return onValueChange(value); } },
35869
- React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, { id: id, name: name, onBlur: onBlur, className: classNames("arc-Select-trigger", {
37436
+ React__default.createElement($cc7e05a45900e73f$export$41fb9f06171c75f4, __assign$2({ id: id, name: name, onBlur: onBlur, className: classNames("arc-Select-trigger", {
35870
37437
  "arc-Select-trigger--constrained": !isFluid,
35871
37438
  "arc-Select-trigger--onDarkSurface": surface === "dark",
35872
37439
  "arc-Select-trigger--invalid": errorMessage
35873
- }) },
37440
+ }) }, filterDataAttrs(props)),
35874
37441
  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)))),
35875
37442
  React__default.createElement($cc7e05a45900e73f$export$f04a61298a47a40f, { className: "arc-Select-triggerIcon" },
35876
37443
  React__default.createElement(Icon, { icon: BtIconChevronDown2Px_2, size: 20 }))),
@@ -36629,6 +38196,191 @@ SiteHeaderRehydrator.NavItemRehydrator = NavItemRehydrator;
36629
38196
  SiteHeaderRehydrator.NavItemWithSubNavRehydrator = NavItemWithSubNavRehydrator;
36630
38197
  SiteHeaderRehydrator.SubNavItemRehydrator = SubNavItemRehydrator;
36631
38198
 
38199
+ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {
38200
+ return function handleEvent(event) {
38201
+ originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
38202
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
38203
+ };
38204
+ }
38205
+
38206
+ /**
38207
+ * Set a given ref to a given value
38208
+ * This utility takes care of different types of refs: callback refs and RefObject(s)
38209
+ */ function $6ed0406888f73fc4$var$setRef(ref, value) {
38210
+ if (typeof ref === 'function') ref(value);
38211
+ else if (ref !== null && ref !== undefined) ref.current = value;
38212
+ }
38213
+ /**
38214
+ * A utility to compose multiple refs together
38215
+ * Accepts callback refs and RefObject(s)
38216
+ */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
38217
+ return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
38218
+ )
38219
+ ;
38220
+ }
38221
+ /**
38222
+ * A custom hook that composes multiple refs
38223
+ * Accepts callback refs and RefObject(s)
38224
+ */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
38225
+ // eslint-disable-next-line react-hooks/exhaustive-deps
38226
+ return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
38227
+ }
38228
+
38229
+ /* -------------------------------------------------------------------------------------------------
38230
+ * createContextScope
38231
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
38232
+ let defaultContexts = [];
38233
+ /* -----------------------------------------------------------------------------------------------
38234
+ * createContext
38235
+ * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
38236
+ const BaseContext = /*#__PURE__*/ createContext(defaultContext);
38237
+ const index = defaultContexts.length;
38238
+ defaultContexts = [
38239
+ ...defaultContexts,
38240
+ defaultContext
38241
+ ];
38242
+ function Provider(props) {
38243
+ const { scope: scope , children: children , ...context } = props;
38244
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change
38245
+ // eslint-disable-next-line react-hooks/exhaustive-deps
38246
+ const value = useMemo(()=>context
38247
+ , Object.values(context));
38248
+ return /*#__PURE__*/ createElement(Context.Provider, {
38249
+ value: value
38250
+ }, children);
38251
+ }
38252
+ function useContext$1(consumerName, scope) {
38253
+ const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
38254
+ const context = useContext(Context);
38255
+ if (context) return context;
38256
+ if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.
38257
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
38258
+ }
38259
+ Provider.displayName = rootComponentName + 'Provider';
38260
+ return [
38261
+ Provider,
38262
+ useContext$1
38263
+ ];
38264
+ }
38265
+ /* -----------------------------------------------------------------------------------------------
38266
+ * createScope
38267
+ * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{
38268
+ const scopeContexts = defaultContexts.map((defaultContext)=>{
38269
+ return /*#__PURE__*/ createContext(defaultContext);
38270
+ });
38271
+ return function useScope(scope) {
38272
+ const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
38273
+ return useMemo(()=>({
38274
+ [`__scope${scopeName}`]: {
38275
+ ...scope,
38276
+ [scopeName]: contexts
38277
+ }
38278
+ })
38279
+ , [
38280
+ scope,
38281
+ contexts
38282
+ ]);
38283
+ };
38284
+ };
38285
+ createScope.scopeName = scopeName;
38286
+ return [
38287
+ $c512c27ab02ef895$export$fd42f52fd3ae1109,
38288
+ $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
38289
+ ];
38290
+ }
38291
+ /* -------------------------------------------------------------------------------------------------
38292
+ * composeContextScopes
38293
+ * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
38294
+ const baseScope = scopes[0];
38295
+ if (scopes.length === 1) return baseScope;
38296
+ const createScope1 = ()=>{
38297
+ const scopeHooks = scopes.map((createScope)=>({
38298
+ useScope: createScope(),
38299
+ scopeName: createScope.scopeName
38300
+ })
38301
+ );
38302
+ return function useComposedScopes(overrideScopes) {
38303
+ const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{
38304
+ // We are calling a hook inside a callback which React warns against to avoid inconsistent
38305
+ // renders, however, scoping doesn't have render side effects so we ignore the rule.
38306
+ // eslint-disable-next-line react-hooks/rules-of-hooks
38307
+ const scopeProps = useScope(overrideScopes);
38308
+ const currentScope = scopeProps[`__scope${scopeName}`];
38309
+ return {
38310
+ ...nextScopes,
38311
+ ...currentScope
38312
+ };
38313
+ }, {});
38314
+ return useMemo(()=>({
38315
+ [`__scope${baseScope.scopeName}`]: nextScopes1
38316
+ })
38317
+ , [
38318
+ nextScopes1
38319
+ ]);
38320
+ };
38321
+ };
38322
+ createScope1.scopeName = baseScope.scopeName;
38323
+ return createScope1;
38324
+ }
38325
+
38326
+ /**
38327
+ * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
38328
+ * prop or avoid re-executing effects when passed as a dependency
38329
+ */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
38330
+ const callbackRef = useRef(callback);
38331
+ useEffect(()=>{
38332
+ callbackRef.current = callback;
38333
+ }); // https://github.com/facebook/react/issues/19240
38334
+ return useMemo(()=>(...args)=>{
38335
+ var _callbackRef$current;
38336
+ return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
38337
+ }
38338
+ , []);
38339
+ }
38340
+
38341
+ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
38342
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
38343
+ defaultProp: defaultProp,
38344
+ onChange: onChange
38345
+ });
38346
+ const isControlled = prop !== undefined;
38347
+ const value1 = isControlled ? prop : uncontrolledProp;
38348
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
38349
+ const setValue = useCallback((nextValue)=>{
38350
+ if (isControlled) {
38351
+ const setter = nextValue;
38352
+ const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
38353
+ if (value !== prop) handleChange(value);
38354
+ } else setUncontrolledProp(nextValue);
38355
+ }, [
38356
+ isControlled,
38357
+ prop,
38358
+ setUncontrolledProp,
38359
+ handleChange
38360
+ ]);
38361
+ return [
38362
+ value1,
38363
+ setValue
38364
+ ];
38365
+ }
38366
+ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
38367
+ const uncontrolledState = useState(defaultProp);
38368
+ const [value] = uncontrolledState;
38369
+ const prevValueRef = useRef(value);
38370
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
38371
+ useEffect(()=>{
38372
+ if (prevValueRef.current !== value) {
38373
+ handleChange(value);
38374
+ prevValueRef.current = value;
38375
+ }
38376
+ }, [
38377
+ value,
38378
+ prevValueRef,
38379
+ handleChange
38380
+ ]);
38381
+ return uncontrolledState;
38382
+ }
38383
+
36632
38384
  function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
36633
38385
  const [size, setSize] = useState(undefined);
36634
38386
  $9f79659886946c16$export$e5c5a5f917a5871c(()=>{
@@ -36676,6 +38428,44 @@ function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
36676
38428
  return size;
36677
38429
  }
36678
38430
 
38431
+ const $8927f6f2acc4f386$var$NODES = [
38432
+ 'a',
38433
+ 'button',
38434
+ 'div',
38435
+ 'h2',
38436
+ 'h3',
38437
+ 'img',
38438
+ 'label',
38439
+ 'li',
38440
+ 'nav',
38441
+ 'ol',
38442
+ 'p',
38443
+ 'span',
38444
+ 'svg',
38445
+ 'ul'
38446
+ ]; // Temporary while we await merge of this fix:
38447
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
38448
+ // prettier-ignore
38449
+ /* -------------------------------------------------------------------------------------------------
38450
+ * Primitive
38451
+ * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{
38452
+ const Node = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
38453
+ const { asChild: asChild , ...primitiveProps } = props;
38454
+ const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
38455
+ useEffect(()=>{
38456
+ window[Symbol.for('radix-ui')] = true;
38457
+ }, []);
38458
+ return /*#__PURE__*/ createElement(Comp, _extends({}, primitiveProps, {
38459
+ ref: forwardedRef
38460
+ }));
38461
+ });
38462
+ Node.displayName = `Primitive.${node}`;
38463
+ return {
38464
+ ...primitive,
38465
+ [node]: Node
38466
+ };
38467
+ }, {});
38468
+
36679
38469
  /* -------------------------------------------------------------------------------------------------
36680
38470
  * Switch
36681
38471
  * -----------------------------------------------------------------------------------------------*/ const $6be4966fd9bbc698$var$SWITCH_NAME = 'Switch';
@@ -36790,36 +38580,18 @@ function $6be4966fd9bbc698$var$getState(checked) {
36790
38580
  const $6be4966fd9bbc698$export$be92b6f5f03c0fe9 = $6be4966fd9bbc698$export$b5d5cf8927ab7262;
36791
38581
  const $6be4966fd9bbc698$export$6521433ed15a34db = $6be4966fd9bbc698$export$4d07bf653ea69106;
36792
38582
 
36793
- /**
36794
- * Use `VerticalSpace` to create vertical space between components.
36795
- */
36796
- var VerticalSpace = function (_a) {
36797
- var _b;
36798
- var _c = _a.isDebugVisible, isDebugVisible = _c === void 0 ? false : _c, _d = _a.size, size = _d === void 0 ? "24" : _d, sizeS = _a.sizeS, sizeM = _a.sizeM, sizeL = _a.sizeL, sizeXL = _a.sizeXL, props = __rest$2(_a, ["isDebugVisible", "size", "sizeS", "sizeM", "sizeL", "sizeXL"]);
36799
- return (React__default.createElement("div", __assign$2({ className: classNames((_b = {
36800
- "arc-VerticalSpace": true
36801
- },
36802
- _b["arc-VerticalSpace--size".concat(size)] = size,
36803
- _b["arc-VerticalSpace--sizeS".concat(sizeS)] = sizeS && sizeS,
36804
- _b["arc-VerticalSpace--sizeM".concat(sizeM)] = sizeM && sizeM,
36805
- _b["arc-VerticalSpace--sizeL".concat(sizeL)] = sizeL && sizeL,
36806
- _b["arc-VerticalSpace--sizeXL".concat(sizeXL)] = sizeXL && sizeXL,
36807
- _b["arc-VerticalSpace--debugVisible"] = isDebugVisible,
36808
- _b)) }, filterDataAttrs(props))));
36809
- };
36810
-
36811
38583
  /** Use `Switch` to toggle between checked and not checked. */
36812
38584
  var Switch = function (_a) {
36813
- var defaultChecked = _a.defaultChecked, onCheckedChange = _a.onCheckedChange, label = _a.label, name = _a.name, onBlur = _a.onBlur, value = _a.value, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, id = _a.id, _c = _a.labelSize, labelSize = _c === void 0 ? "s" : _c, statusText = _a.statusText, _d = _a.hideLabel, hideLabel = _d === void 0 ? false : _d;
38585
+ var defaultChecked = _a.defaultChecked, onCheckedChange = _a.onCheckedChange, label = _a.label, name = _a.name, onBlur = _a.onBlur, value = _a.value, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, errorMessage = _a.errorMessage, id = _a.id, _c = _a.labelSize, labelSize = _c === void 0 ? "s" : _c, statusText = _a.statusText, _d = _a.hideLabel, hideLabel = _d === void 0 ? false : _d, props = __rest$2(_a, ["defaultChecked", "onCheckedChange", "label", "name", "onBlur", "value", "isDisabled", "errorMessage", "id", "labelSize", "statusText", "hideLabel"]);
36814
38586
  var surface = useContext(Context$3).surface;
36815
38587
  return (React__default.createElement(FormControl, { errorMessage: errorMessage, htmlFor: id, isDisabled: isDisabled, label: hideLabel ? "" : label, labelSize: labelSize, requirementStatus: "not-applicable" },
36816
38588
  !hideLabel && React__default.createElement(VerticalSpace, { size: "8" }),
36817
38589
  React__default.createElement("div", { className: "arc-Switch-container" },
36818
- React__default.createElement($6be4966fd9bbc698$export$be92b6f5f03c0fe9, { id: id, "aria-label": label, defaultChecked: defaultChecked, name: name, value: value, onBlur: onBlur, onCheckedChange: onCheckedChange, disabled: isDisabled, className: classNames("arc-Switch", {
38590
+ React__default.createElement($6be4966fd9bbc698$export$be92b6f5f03c0fe9, __assign$2({ id: id, "aria-label": label, defaultChecked: defaultChecked, name: name, value: value, onBlur: onBlur, onCheckedChange: onCheckedChange, disabled: isDisabled, className: classNames("arc-Switch", {
36819
38591
  "arc-Switch--large": labelSize === "l",
36820
38592
  "arc-Switch--isDisabled": isDisabled,
36821
38593
  "arc-Switch--onDarkSurface": surface === "dark"
36822
- }) },
38594
+ }) }, filterDataAttrs(props)),
36823
38595
  React__default.createElement("div", { className: "arc-Switch-wrapper" },
36824
38596
  React__default.createElement($6be4966fd9bbc698$export$6521433ed15a34db, { className: "arc-Switch-thumb" },
36825
38597
  React__default.createElement("div", { className: "arc-Switch-thumbIcon" },
@@ -36838,7 +38610,7 @@ var Switch = function (_a) {
36838
38610
  /** Use `Badge` component to visually display a small amount of information, such as notification counts or status indicators. */
36839
38611
  var Badge = function (_a) {
36840
38612
  var _b, _c;
36841
- var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel;
38613
+ var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, props = __rest$2(_a, ["children", "state", "size", "fill", "ariaLabel"]);
36842
38614
  var surface = useContext(Context$3).surface;
36843
38615
  return (React__default.createElement("div", __assign$2({}, (ariaLabel && { "aria-label": ariaLabel }), { className: classNames((_b = {
36844
38616
  "arc-Badge": true,
@@ -36847,7 +38619,7 @@ var Badge = function (_a) {
36847
38619
  "arc-Badge--outline": fill === "outlined"
36848
38620
  },
36849
38621
  _b[suffixModifier("arc-Badge--state", state)] = state !== "default",
36850
- _b)), role: state === "error" ? "alert" : "status", "data-testid": "badge" }),
38622
+ _b)), role: state === "error" ? "alert" : "status" }, filterDataAttrs(props)),
36851
38623
  React__default.createElement("div", { className: classNames((_c = {
36852
38624
  "arc-Badge-text": true
36853
38625
  },
@@ -36979,6 +38751,7 @@ var TextInput = forwardRef(function (_a, ref) {
36979
38751
  : "Your password is hidden")))))))));
36980
38752
  });
36981
38753
 
38754
+ /** Use `TextArea` to allow custom user text entry via keyboard, for long-form and multi-line descriptions */
36982
38755
  var TextArea = forwardRef(function (_a, ref) {
36983
38756
  var _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, _c = _a.resize, resize = _c === void 0 ? "manual" : _c, _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, _g = _a.showCharacterCount, showCharacterCount = _g === void 0 ? true : _g, label = _a.label, _h = _a.labelSize, labelSize = _h === void 0 ? "l" : _h, maxLength = _a.maxLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, props = __rest$2(_a, ["defaultValue", "errorMessage", "helper", "id", "resize", "isDisabled", "isReadOnly", "isRequired", "showCharacterCount", "label", "labelSize", "maxLength", "name", "onBlur", "onChange", "onClickDisclosure", "value", "disclosureTitle", "disclosureText"]);
36984
38757
  var surface = useContext(Context$3).surface;
@@ -37020,9 +38793,9 @@ var TextArea = forwardRef(function (_a, ref) {
37020
38793
 
37021
38794
  /** Use `Truncate` component to shorten text with an ellipsis. Add a `title` attribute to the truncated element so the full text remains accessible. */
37022
38795
  var Truncate = function (_a) {
37023
- var _b = _a.maxWidth, maxWidth = _b === void 0 ? 100 : _b, title = _a.title, children = _a.children;
37024
- return (React__default.createElement("div", { className: "arc-Truncate", style: { maxWidth: "".concat(maxWidth, "%") }, title: title }, children));
38796
+ var _b = _a.maxWidth, maxWidth = _b === void 0 ? 100 : _b, title = _a.title, children = _a.children, props = __rest$2(_a, ["maxWidth", "title", "children"]);
38797
+ return (React__default.createElement("div", __assign$2({ className: "arc-Truncate", style: { maxWidth: "".concat(maxWidth, "%") }, title: title }, filterDataAttrs(props)), children));
37025
38798
  };
37026
38799
 
37027
- export { Align, Badge, Base, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, Elevation, Filter, FormControl, Group, Heading, Icon, Image, Markup, Poster, RadioGroup, Rule, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$3 as SurfaceContext, Switch, Tag, Text, TextArea, TextInput, Truncate, UniversalHeader, VerticalSpace, VisuallyHidden };
38800
+ export { Align, Badge, Base, BrandLogo, Breadcrumbs, Button, Card, Checkbox, Clock, Clock_rehydrator as ClockRehydrator, Columns, Curve, Disclosure, Elevation, Filter, FormControl, Group, Heading, Icon, Image, Markup, Modal, Poster, RadioGroup, Rule, Section, Select, SiteFooter, SiteFooter_rehydrator as SiteFooterRehydrator, SiteHeader, SiteHeaderRehydrator, Surface, Context$3 as SurfaceContext, Switch, Tag, Text, TextArea, TextInput, Truncate, UniversalHeader, VerticalSpace, VisuallyHidden };
37028
38801
  //# sourceMappingURL=index.es.js.map