@feathery/react 2.6.8 → 2.7.1

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 (314) hide show
  1. package/dist/Form/components/AIExtractionToast/ExtractionItem.d.ts +5 -5
  2. package/dist/Form/components/AIExtractionToast/icons.d.ts +7 -7
  3. package/dist/Form/components/AIExtractionToast/index.d.ts +8 -8
  4. package/dist/Form/components/AIExtractionToast/useAIExtractionToast.d.ts +64 -64
  5. package/dist/Form/components/DevNavBar.d.ts +1 -1
  6. package/dist/Form/components/ReactPortal.d.ts +2 -2
  7. package/dist/Form/definitions.d.ts +40 -40
  8. package/dist/Form/grid/CalendlyEmbed.d.ts +1 -1
  9. package/dist/Form/grid/Container/index.d.ts +19 -19
  10. package/dist/Form/grid/Element/index.d.ts +2 -2
  11. package/dist/Form/grid/Element/utils/address.d.ts +3 -3
  12. package/dist/Form/grid/Element/utils/utils.d.ts +13 -13
  13. package/dist/Form/grid/StyledContainer/hooks/index.d.ts +20 -20
  14. package/dist/Form/grid/StyledContainer/hooks/useFixedContainer.d.ts +1 -1
  15. package/dist/Form/grid/StyledContainer/index.d.ts +21 -21
  16. package/dist/Form/grid/StyledContainer/styles.d.ts +5 -5
  17. package/dist/Form/grid/StyledContainer/transform.d.ts +4 -4
  18. package/dist/Form/grid/StyledContainer/utils.d.ts +44 -44
  19. package/dist/Form/grid/index.d.ts +2 -2
  20. package/dist/Form/hooks/useCheckButtonAction.d.ts +6 -6
  21. package/dist/Form/hooks/useTrackUserInteraction.d.ts +2 -2
  22. package/dist/Form/index.d.ts +52 -52
  23. package/dist/Form/logic.d.ts +10 -10
  24. package/dist/Form/tests/testMocks.d.ts +6 -6
  25. package/dist/auth/LoginError.d.ts +3 -3
  26. package/dist/auth/LoginForm.d.ts +29 -29
  27. package/dist/auth/internal/AuthIntegrationInterface.d.ts +31 -31
  28. package/dist/auth/internal/useFormAuth.d.ts +10 -10
  29. package/dist/auth/internal/utils.d.ts +13 -13
  30. package/dist/auth/useAuthClient.d.ts +2 -2
  31. package/dist/auth/utils.d.ts +1 -1
  32. package/dist/elements/basic/ButtonElement.d.ts +2 -2
  33. package/dist/elements/basic/ImageElement.d.ts +3 -3
  34. package/dist/elements/basic/ProgressBarElement/components/SegmentBar.d.ts +2 -2
  35. package/dist/elements/basic/ProgressBarElement/components/SmoothBar.d.ts +2 -2
  36. package/dist/elements/basic/ProgressBarElement/index.d.ts +2 -2
  37. package/dist/elements/basic/TextElement.d.ts +2 -2
  38. package/dist/elements/basic/VideoElement.d.ts +2 -2
  39. package/dist/elements/components/ErrorInput.d.ts +2 -2
  40. package/dist/elements/components/FormControl.d.ts +10 -10
  41. package/dist/elements/components/FormOff.d.ts +10 -10
  42. package/dist/elements/components/InlineTooltip.d.ts +11 -11
  43. package/dist/elements/components/LoaderContainer.d.ts +10 -10
  44. package/dist/elements/components/Lottie.d.ts +2 -2
  45. package/dist/elements/components/Overlay.d.ts +15 -15
  46. package/dist/elements/components/Placeholder.d.ts +1 -1
  47. package/dist/elements/components/QuikFormViewer/transforms/form.d.ts +1 -1
  48. package/dist/elements/components/QuikFormViewer/transforms/header.d.ts +1 -1
  49. package/dist/elements/components/QuikFormViewer/transforms/sidebar.d.ts +6 -6
  50. package/dist/elements/components/QuikFormViewer.d.ts +9 -9
  51. package/dist/elements/components/Spinner.d.ts +4 -4
  52. package/dist/elements/components/TextHoverTooltip.d.ts +8 -8
  53. package/dist/elements/components/TextNodes.d.ts +4 -4
  54. package/dist/elements/components/Tooltip.d.ts +7 -7
  55. package/dist/elements/components/Watermark.d.ts +1 -1
  56. package/dist/elements/components/data/countries.d.ts +14 -14
  57. package/dist/elements/components/data/states/ae.d.ts +5 -5
  58. package/dist/elements/components/data/states/au.d.ts +5 -5
  59. package/dist/elements/components/data/states/br.d.ts +5 -5
  60. package/dist/elements/components/data/states/ca.d.ts +5 -5
  61. package/dist/elements/components/data/states/cl.d.ts +5 -5
  62. package/dist/elements/components/data/states/cn.d.ts +5 -5
  63. package/dist/elements/components/data/states/co.d.ts +5 -5
  64. package/dist/elements/components/data/states/eg.d.ts +5 -5
  65. package/dist/elements/components/data/states/es.d.ts +5 -5
  66. package/dist/elements/components/data/states/gb.d.ts +5 -5
  67. package/dist/elements/components/data/states/gt.d.ts +5 -5
  68. package/dist/elements/components/data/states/hk.d.ts +5 -5
  69. package/dist/elements/components/data/states/id.d.ts +5 -5
  70. package/dist/elements/components/data/states/ie.d.ts +5 -5
  71. package/dist/elements/components/data/states/in.d.ts +5 -5
  72. package/dist/elements/components/data/states/index.d.ts +6 -6
  73. package/dist/elements/components/data/states/it.d.ts +5 -5
  74. package/dist/elements/components/data/states/jp.d.ts +5 -5
  75. package/dist/elements/components/data/states/kr.d.ts +5 -5
  76. package/dist/elements/components/data/states/mx.d.ts +5 -5
  77. package/dist/elements/components/data/states/my.d.ts +5 -5
  78. package/dist/elements/components/data/states/ng.d.ts +5 -5
  79. package/dist/elements/components/data/states/nz.d.ts +5 -5
  80. package/dist/elements/components/data/states/pa.d.ts +5 -5
  81. package/dist/elements/components/data/states/pe.d.ts +5 -5
  82. package/dist/elements/components/data/states/ph.d.ts +5 -5
  83. package/dist/elements/components/data/states/pt.d.ts +5 -5
  84. package/dist/elements/components/data/states/ro.d.ts +5 -5
  85. package/dist/elements/components/data/states/ru.d.ts +5 -5
  86. package/dist/elements/components/data/states/th.d.ts +5 -5
  87. package/dist/elements/components/data/states/us.d.ts +9 -9
  88. package/dist/elements/components/data/states/za.d.ts +5 -5
  89. package/dist/elements/components/icons/Close.d.ts +6 -6
  90. package/dist/elements/components/icons/DiagonalArrow.d.ts +5 -5
  91. package/dist/elements/components/icons/DownloadIcon.d.ts +4 -4
  92. package/dist/elements/components/icons/FileUpload.d.ts +1 -1
  93. package/dist/elements/components/icons/FormClosed.d.ts +5 -5
  94. package/dist/elements/components/icons/Heart.d.ts +1 -1
  95. package/dist/elements/components/icons/Help.d.ts +4 -4
  96. package/dist/elements/components/icons/HideEyeIcon.d.ts +5 -5
  97. package/dist/elements/components/icons/LeftChevron.d.ts +1 -1
  98. package/dist/elements/components/icons/RatingStar.d.ts +1 -1
  99. package/dist/elements/components/icons/RightChevron.d.ts +1 -1
  100. package/dist/elements/components/icons/ShowEyeIcon.d.ts +5 -5
  101. package/dist/elements/components/icons/Warning.d.ts +5 -5
  102. package/dist/elements/components/icons/index.d.ts +11 -11
  103. package/dist/elements/components/skeletons/FieldSkeleton.d.ts +7 -7
  104. package/dist/elements/components/useBorder.d.ts +21 -21
  105. package/dist/elements/components/useTextEdit.d.ts +6 -5
  106. package/dist/elements/components/useTextEdit.d.ts.map +1 -1
  107. package/dist/elements/fields/AddressLine1Field/index.d.ts +4 -4
  108. package/dist/elements/fields/AddressLine1Field/tests/test-utils.d.ts +33 -34
  109. package/dist/elements/fields/AddressLine1Field/tests/test-utils.d.ts.map +1 -1
  110. package/dist/elements/fields/AddressLine1Field/utils.d.ts +2 -2
  111. package/dist/elements/fields/ButtonGroupField/index.d.ts +2 -2
  112. package/dist/elements/fields/ButtonGroupField/tests/test-utils.d.ts +45 -46
  113. package/dist/elements/fields/ButtonGroupField/tests/test-utils.d.ts.map +1 -1
  114. package/dist/elements/fields/CheckboxField/index.d.ts +5 -5
  115. package/dist/elements/fields/CheckboxField/tests/test-utils.d.ts +19 -20
  116. package/dist/elements/fields/CheckboxField/tests/test-utils.d.ts.map +1 -1
  117. package/dist/elements/fields/CheckboxGroupField/index.d.ts +2 -2
  118. package/dist/elements/fields/CheckboxGroupField/tests/test-utils.d.ts +59 -60
  119. package/dist/elements/fields/CheckboxGroupField/tests/test-utils.d.ts.map +1 -1
  120. package/dist/elements/fields/ColorPickerField/index.d.ts +2 -2
  121. package/dist/elements/fields/ColorPickerField/tests/test-utils.d.ts +20 -21
  122. package/dist/elements/fields/ColorPickerField/tests/test-utils.d.ts.map +1 -1
  123. package/dist/elements/fields/CustomField/Status.d.ts +8 -8
  124. package/dist/elements/fields/CustomField/index.d.ts +3 -3
  125. package/dist/elements/fields/CustomField/template.d.ts +1 -1
  126. package/dist/elements/fields/CustomField/useCustomComponentIframe.d.ts +15 -15
  127. package/dist/elements/fields/DateSelectorField/index.d.ts +22 -22
  128. package/dist/elements/fields/DateSelectorField/index.d.ts.map +1 -1
  129. package/dist/elements/fields/DateSelectorField/styles.d.ts +4 -4
  130. package/dist/elements/fields/DateSelectorField/tests/test-utils.d.ts +73 -74
  131. package/dist/elements/fields/DateSelectorField/tests/test-utils.d.ts.map +1 -1
  132. package/dist/elements/fields/DateSelectorField/useDateLocale.d.ts +7 -7
  133. package/dist/elements/fields/DateSelectorField/utils.d.ts +3 -3
  134. package/dist/elements/fields/DropdownField/index.d.ts +1 -1
  135. package/dist/elements/fields/DropdownField/tests/test-utils.d.ts +26 -28
  136. package/dist/elements/fields/DropdownField/tests/test-utils.d.ts.map +1 -1
  137. package/dist/elements/fields/DropdownMultiField/DropdownMultiFieldSelectComponents.d.ts +8 -8
  138. package/dist/elements/fields/DropdownMultiField/createDropdownSelect.d.ts +190 -190
  139. package/dist/elements/fields/DropdownMultiField/index.d.ts +1 -1
  140. package/dist/elements/fields/DropdownMultiField/optionNormalization.d.ts +9 -9
  141. package/dist/elements/fields/DropdownMultiField/selectStyles.d.ts +12 -12
  142. package/dist/elements/fields/DropdownMultiField/tests/test-utils.d.ts +46 -47
  143. package/dist/elements/fields/DropdownMultiField/tests/test-utils.d.ts.map +1 -1
  144. package/dist/elements/fields/DropdownMultiField/types.d.ts +49 -49
  145. package/dist/elements/fields/DropdownMultiField/useCollapsedSelectionManager.d.ts +46 -46
  146. package/dist/elements/fields/DropdownMultiField/useCollapsedValuesMeasurement.d.ts +19 -19
  147. package/dist/elements/fields/DropdownMultiField/useDropdownInteractions.d.ts +46 -46
  148. package/dist/elements/fields/DropdownMultiField/useDropdownOptions.d.ts +24 -24
  149. package/dist/elements/fields/DropdownMultiField/useSelectProps.d.ts +112 -112
  150. package/dist/elements/fields/FileUploadField/index.d.ts +2 -2
  151. package/dist/elements/fields/FileUploadField/tests/test-utils.d.ts +10 -10
  152. package/dist/elements/fields/MatrixField/index.d.ts +2 -2
  153. package/dist/elements/fields/MatrixField/tests/test-utils.d.ts +66 -67
  154. package/dist/elements/fields/MatrixField/tests/test-utils.d.ts.map +1 -1
  155. package/dist/elements/fields/PasswordField/index.d.ts +4 -4
  156. package/dist/elements/fields/PasswordField/tests/test-utils.d.ts +29 -30
  157. package/dist/elements/fields/PasswordField/tests/test-utils.d.ts.map +1 -1
  158. package/dist/elements/fields/PaymentMethodField.d.ts +4 -4
  159. package/dist/elements/fields/PhoneField/CountryDropdown.d.ts +3 -3
  160. package/dist/elements/fields/PhoneField/exampleNumbers.d.ts +2 -2
  161. package/dist/elements/fields/PhoneField/index.d.ts +4 -4
  162. package/dist/elements/fields/PhoneField/tests/test-utils.d.ts +85 -86
  163. package/dist/elements/fields/PhoneField/tests/test-utils.d.ts.map +1 -1
  164. package/dist/elements/fields/PhoneField/timeZoneCountries.d.ts +4 -4
  165. package/dist/elements/fields/PhoneField/validation.d.ts +3 -3
  166. package/dist/elements/fields/PinInputField/index.d.ts +2 -2
  167. package/dist/elements/fields/PinInputField/tests/test-utils.d.ts +78 -79
  168. package/dist/elements/fields/PinInputField/tests/test-utils.d.ts.map +1 -1
  169. package/dist/elements/fields/PinInputField/useOTPListener.d.ts +1 -1
  170. package/dist/elements/fields/QRScanner/constants.d.ts +14 -14
  171. package/dist/elements/fields/QRScanner/hooks/use-device-rotation.d.ts +11 -11
  172. package/dist/elements/fields/QRScanner/index.d.ts +2 -2
  173. package/dist/elements/fields/QRScanner/qrLoader.d.ts +2 -2
  174. package/dist/elements/fields/QRScanner/utils/local-storage.d.ts +5 -5
  175. package/dist/elements/fields/QRScanner/utils/select-camera.d.ts +9 -9
  176. package/dist/elements/fields/QRScanner/utils/supports-zoom.d.ts +8 -8
  177. package/dist/elements/fields/RadioButtonGroupField/index.d.ts +2 -2
  178. package/dist/elements/fields/RadioButtonGroupField/tests/test-utils.d.ts +54 -55
  179. package/dist/elements/fields/RadioButtonGroupField/tests/test-utils.d.ts.map +1 -1
  180. package/dist/elements/fields/RatingField/index.d.ts +1 -1
  181. package/dist/elements/fields/RatingField/tests/test-utils.d.ts +21 -22
  182. package/dist/elements/fields/RatingField/tests/test-utils.d.ts.map +1 -1
  183. package/dist/elements/fields/SignatureField/components/SignatureCanvas.d.ts +22 -22
  184. package/dist/elements/fields/SignatureField/components/SignatureModal.d.ts +12 -12
  185. package/dist/elements/fields/SignatureField/components/utils.d.ts +10 -10
  186. package/dist/elements/fields/SignatureField/index.d.ts +3 -3
  187. package/dist/elements/fields/SignatureField/translation.d.ts +17 -17
  188. package/dist/elements/fields/SliderField/index.d.ts +1 -1
  189. package/dist/elements/fields/SliderField/styles.d.ts +3 -3
  190. package/dist/elements/fields/SliderField/tests/test-utils.d.ts +21 -22
  191. package/dist/elements/fields/SliderField/tests/test-utils.d.ts.map +1 -1
  192. package/dist/elements/fields/TextArea/index.d.ts +4 -4
  193. package/dist/elements/fields/TextArea/tests/test-utils.d.ts +10 -10
  194. package/dist/elements/fields/TextField/TextAutocomplete.d.ts +15 -15
  195. package/dist/elements/fields/TextField/index.d.ts +4 -4
  196. package/dist/elements/fields/TextField/index.d.ts.map +1 -1
  197. package/dist/elements/fields/TextField/tests/test-utils.d.ts +10 -10
  198. package/dist/elements/fields/index.d.ts +27 -26
  199. package/dist/elements/fields/index.d.ts.map +1 -1
  200. package/dist/elements/fields/shared/tests/field-test-utils.d.ts +50 -51
  201. package/dist/elements/fields/shared/tests/field-test-utils.d.ts.map +1 -1
  202. package/dist/elements/index.d.ts +36 -36
  203. package/dist/elements/styles.d.ts +64 -64
  204. package/dist/elements/utils/fieldNormalization.d.ts +12 -12
  205. package/dist/fthry_FormControl.DxW_Bnm8.js +16 -0
  206. package/dist/fthry_InlineTooltip.CKU9xvD_.js +53 -0
  207. package/dist/fthry_Overlay.CAkqWcqE.js +228 -0
  208. package/dist/fthry_PaymentMethodField.DgbAXbj6.js +928 -0
  209. package/dist/fthry_Placeholder.Dns0M5df.js +14 -0
  210. package/dist/fthry_ShowEyeIcon.B5WMynZy.js +13 -0
  211. package/dist/fthry_index.3X-DqTfs.js +97 -0
  212. package/dist/fthry_index.B2eJWMcW.js +2000 -0
  213. package/dist/fthry_index.BMqtYXlU.js +8166 -0
  214. package/dist/fthry_index.BOBND5Kw.js +1427 -0
  215. package/dist/fthry_index.BOzMcNbx.js +1452 -0
  216. package/dist/fthry_index.BQObFcP7.js +15921 -0
  217. package/dist/fthry_index.CJrl9QNZ.js +888 -0
  218. package/dist/fthry_index.CcFhx1jU.js +73 -0
  219. package/dist/fthry_index.CcNVqQ7R.js +293 -0
  220. package/dist/fthry_index.CnVdemA5.js +1162 -0
  221. package/dist/fthry_index.CxRelutP.js +42 -0
  222. package/dist/fthry_index.D19e9CJD.js +1193 -0
  223. package/dist/fthry_index.D6UpFxPB.js +216 -0
  224. package/dist/fthry_index.DD4M0PFc.js +46 -0
  225. package/dist/fthry_index.DMgGgKWy.js +55 -0
  226. package/dist/fthry_index.DQB3aI2u.js +95 -0
  227. package/dist/fthry_index.DaJO430v.js +513 -0
  228. package/dist/fthry_index.DfiZRBo4.js +35 -0
  229. package/dist/fthry_index.Di1aadud.js +251 -0
  230. package/dist/fthry_index.DpFG-lbP.js +138 -0
  231. package/dist/fthry_index.DsECQjJb.js +131 -0
  232. package/dist/fthry_index.diObxaBS.js +60999 -0
  233. package/dist/fthry_index.ghZ0mkQF.js +98 -0
  234. package/dist/fthry_input.COhHyroj.js +3779 -0
  235. package/dist/fthry_script.D9CLkYzO.js +157 -0
  236. package/dist/fthry_styles.Bcy5cq6p.js +1654 -0
  237. package/dist/fthry_useElementSize.boD8p4bk.js +51 -0
  238. package/dist/fthry_useSalesforceSync.BNvWxPzE.js +44 -0
  239. package/dist/fthry_webfontloader.DEj1XG0u.js +57 -0
  240. package/dist/hooks/router.d.ts +14 -14
  241. package/dist/hooks/useElementSize.d.ts +7 -7
  242. package/dist/hooks/useLoader.d.ts +35 -35
  243. package/dist/hooks/useMounted.d.ts +2 -2
  244. package/dist/hooks/usePollFuserData.d.ts +1 -1
  245. package/dist/hooks/usePrevious.d.ts +2 -2
  246. package/dist/hooks/useSalesforceSync.d.ts +10 -10
  247. package/dist/index.d.ts +150 -149
  248. package/dist/index.d.ts.map +1 -1
  249. package/dist/index.js +9 -1
  250. package/dist/integrations/alloy.d.ts +2 -2
  251. package/dist/integrations/amplitude.d.ts +1 -1
  252. package/dist/integrations/argyle.d.ts +2 -2
  253. package/dist/integrations/calendly.d.ts +2 -2
  254. package/dist/integrations/firebase.d.ts +42 -42
  255. package/dist/integrations/flinks/index.d.ts +10 -10
  256. package/dist/integrations/flinks/utils.d.ts +12 -12
  257. package/dist/integrations/googleAnalytics.d.ts +3 -3
  258. package/dist/integrations/googleTagManager.d.ts +1 -1
  259. package/dist/integrations/heap.d.ts +2 -2
  260. package/dist/integrations/intercom.d.ts +2 -2
  261. package/dist/integrations/mixpanel.d.ts +2 -2
  262. package/dist/integrations/persona.d.ts +2 -2
  263. package/dist/integrations/plaid.d.ts +2 -2
  264. package/dist/integrations/recaptcha.d.ts +2 -2
  265. package/dist/integrations/rudderstack.d.ts +3 -3
  266. package/dist/integrations/schwab.d.ts +1 -1
  267. package/dist/integrations/segment.d.ts +1 -1
  268. package/dist/integrations/stripe/Cart.d.ts +19 -19
  269. package/dist/integrations/stripe/SimplifiedProduct.d.ts +39 -39
  270. package/dist/integrations/stripe/index.d.ts +1 -1
  271. package/dist/integrations/stripe/stripe.d.ts +97 -97
  272. package/dist/integrations/stytch.d.ts +19 -19
  273. package/dist/integrations/trustedform.d.ts +2 -2
  274. package/dist/integrations/utils.d.ts +14 -14
  275. package/dist/setupTests.d.ts +1 -1
  276. package/dist/types/Form.d.ts +80 -80
  277. package/dist/utils/DangerouslySetHTMLContent.d.ts +2 -2
  278. package/dist/utils/ShadowDomHtmlContent.d.ts +8 -8
  279. package/dist/utils/array.d.ts +11 -11
  280. package/dist/utils/browser.d.ts +23 -23
  281. package/dist/utils/callbackQueue.d.ts +10 -10
  282. package/dist/utils/document.d.ts +1 -1
  283. package/dist/utils/elementActions.d.ts +55 -55
  284. package/dist/utils/entities/Collaborator.d.ts +14 -14
  285. package/dist/utils/entities/Field.d.ts +129 -129
  286. package/dist/utils/error.d.ts +13 -13
  287. package/dist/utils/featheryClient/index.d.ts +103 -103
  288. package/dist/utils/featheryClient/integrationClient.d.ts +114 -114
  289. package/dist/utils/featheryClient/utils.d.ts +1 -1
  290. package/dist/utils/fieldHelperFunctions.d.ts +70 -70
  291. package/dist/utils/formContext.d.ts +104 -104
  292. package/dist/utils/formHelperFunctions.d.ts +44 -44
  293. package/dist/utils/hideAndRepeats.d.ts +27 -27
  294. package/dist/utils/hydration.d.ts +14 -14
  295. package/dist/utils/image.d.ts +39 -39
  296. package/dist/utils/init.d.ts +59 -59
  297. package/dist/utils/interactionState.d.ts +4 -4
  298. package/dist/utils/internalState.d.ts +91 -91
  299. package/dist/utils/logic.d.ts +50 -50
  300. package/dist/utils/offlineRequestHandler.d.ts +94 -94
  301. package/dist/utils/polyfills.d.ts +2 -2
  302. package/dist/utils/primitives.d.ts +14 -14
  303. package/dist/utils/random.d.ts +1 -1
  304. package/dist/utils/repeat.d.ts +38 -38
  305. package/dist/utils/sensitiveActions.d.ts +7 -7
  306. package/dist/utils/stepHelperFunctions.d.ts +22 -22
  307. package/dist/utils/styles.d.ts +5 -5
  308. package/dist/utils/validation.d.ts +58 -58
  309. package/package.json +17 -5
  310. package/umd/466.e3456c8b3407ad04ba56.js +1 -0
  311. package/umd/{DateSelectorField.b98c0ecb80f56e65cc69.js → DateSelectorField.bd5646949de71f571d04.js} +1 -1
  312. package/umd/{TextField.a3d8d42f6f8236d00f83.js → TextField.5a5296fe3ea60c4459f2.js} +1 -1
  313. package/umd/index.js +1 -1
  314. package/umd/796.e66d52ea21ef09c4eeaa.js +0 -1
@@ -0,0 +1,1654 @@
1
+ import * as React from 'react';
2
+ import { useState, useMemo } from 'react';
3
+ import { aq as cls, j as jsxs, m as Fragment, b as jsx, G as Global, o as css, p as __makeTemplateObject } from './fthry_index.diObxaBS.js';
4
+ import { flushSync } from 'react-dom';
5
+
6
+ function canUseDom() {
7
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
8
+ }
9
+
10
+ /**
11
+ * Wrap `React.useLayoutEffect` which will not throw warning message in test env
12
+ */
13
+ const useInternalLayoutEffect = process.env.NODE_ENV !== 'test' && canUseDom() ? React.useLayoutEffect : React.useEffect;
14
+ const useLayoutEffect = (callback, deps) => {
15
+ const firstMountRef = React.useRef(true);
16
+ useInternalLayoutEffect(() => {
17
+ return callback(firstMountRef.current);
18
+ }, deps);
19
+
20
+ // We tell react that first mount has passed
21
+ useInternalLayoutEffect(() => {
22
+ firstMountRef.current = false;
23
+ return () => {
24
+ firstMountRef.current = true;
25
+ };
26
+ }, []);
27
+ };
28
+
29
+ /**
30
+ * Similar to `useState` but will use props value if provided.
31
+ * From React 18, we do not need safe `useState` since it will not throw for unmounted update.
32
+ * This hooks remove the `onChange` & `postState` logic since we only need basic merged state logic.
33
+ */
34
+ function useControlledState(defaultStateValue, value) {
35
+ const [innerValue, setInnerValue] = useState(defaultStateValue);
36
+ const mergedValue = value !== undefined ? value : innerValue;
37
+ useLayoutEffect(mount => {
38
+ if (!mount) {
39
+ setInnerValue(value);
40
+ }
41
+ }, [value]);
42
+ return [
43
+ // Value
44
+ mergedValue,
45
+ // Update function
46
+ setInnerValue];
47
+ }
48
+
49
+ /* eslint-disable @typescript-eslint/ban-types */
50
+ /* eslint-disable react-hooks/exhaustive-deps */
51
+ function useEvent(callback) {
52
+ const fnRef = React.useRef();
53
+ fnRef.current = callback;
54
+ const memoFn = React.useCallback((...args) => fnRef.current?.(...args), []);
55
+ return memoFn;
56
+ }
57
+
58
+ /* eslint-disable no-console */
59
+ let warned = {};
60
+ const preWarningFns = [];
61
+
62
+ /**
63
+ * Pre warning enable you to parse content before console.error.
64
+ * Modify to null will prevent warning.
65
+ */
66
+ const preMessage = fn => {
67
+ preWarningFns.push(fn);
68
+ };
69
+
70
+ /**
71
+ * Warning if condition not match.
72
+ * @param valid Condition
73
+ * @param message Warning message
74
+ * @example
75
+ * ```js
76
+ * warning(false, 'some error'); // print some error
77
+ * warning(true, 'some error'); // print nothing
78
+ * warning(1 === 2, 'some error'); // print some error
79
+ * ```
80
+ */
81
+ function warning(valid, message) {
82
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
83
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'warning'), message);
84
+ if (finalMessage) {
85
+ console.error(`Warning: ${finalMessage}`);
86
+ }
87
+ }
88
+ }
89
+
90
+ /** @see Similar to {@link warning} */
91
+ function note(valid, message) {
92
+ if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
93
+ const finalMessage = preWarningFns.reduce((msg, preMessageFn) => preMessageFn(msg ?? '', 'note'), message);
94
+ if (finalMessage) {
95
+ console.warn(`Note: ${finalMessage}`);
96
+ }
97
+ }
98
+ }
99
+ function resetWarned() {
100
+ warned = {};
101
+ }
102
+ function call(method, valid, message) {
103
+ if (!valid && !warned[message]) {
104
+ method(false, message);
105
+ warned[message] = true;
106
+ }
107
+ }
108
+
109
+ /** @see Same as {@link warning}, but only warn once for the same message */
110
+ function warningOnce(valid, message) {
111
+ call(warning, valid, message);
112
+ }
113
+
114
+ /** @see Same as {@link warning}, but only warn once for the same message */
115
+ function noteOnce(valid, message) {
116
+ call(note, valid, message);
117
+ }
118
+ warningOnce.preMessage = preMessage;
119
+ warningOnce.resetWarned = resetWarned;
120
+ warningOnce.noteOnce = noteOnce;
121
+
122
+ /**
123
+ * Deeply compares two object literals.
124
+ * @param obj1 object 1
125
+ * @param obj2 object 2
126
+ * @param shallow shallow compare
127
+ * @returns
128
+ */
129
+ function isEqual(obj1, obj2, shallow = false) {
130
+ // https://github.com/mapbox/mapbox-gl-js/pull/5979/files#diff-fde7145050c47cc3a306856efd5f9c3016e86e859de9afbd02c879be5067e58f
131
+ const refSet = new Set();
132
+ function deepEqual(a, b, level = 1) {
133
+ const circular = refSet.has(a);
134
+ warningOnce(!circular, 'Warning: There may be circular references');
135
+ if (circular) {
136
+ return false;
137
+ }
138
+ if (a === b) {
139
+ return true;
140
+ }
141
+ if (shallow && level > 1) {
142
+ return false;
143
+ }
144
+ refSet.add(a);
145
+ const newLevel = level + 1;
146
+ if (Array.isArray(a)) {
147
+ if (!Array.isArray(b) || a.length !== b.length) {
148
+ return false;
149
+ }
150
+ for (let i = 0; i < a.length; i++) {
151
+ if (!deepEqual(a[i], b[i], newLevel)) {
152
+ return false;
153
+ }
154
+ }
155
+ return true;
156
+ }
157
+ if (a && b && typeof a === 'object' && typeof b === 'object') {
158
+ const keys = Object.keys(a);
159
+ if (keys.length !== Object.keys(b).length) {
160
+ return false;
161
+ }
162
+ return keys.every(key => deepEqual(a[key], b[key], newLevel));
163
+ }
164
+ // other
165
+ return false;
166
+ }
167
+ return deepEqual(obj1, obj2);
168
+ }
169
+
170
+ function getOffset(value, min, max) {
171
+ return (value - min) / (max - min);
172
+ }
173
+ function getDirectionStyle(direction, value, min, max) {
174
+ const offset = getOffset(value, min, max);
175
+ const positionStyle = {};
176
+ switch (direction) {
177
+ case 'rtl':
178
+ positionStyle.right = `${offset * 100}%`;
179
+ positionStyle.transform = 'translateX(50%)';
180
+ break;
181
+ case 'btt':
182
+ positionStyle.bottom = `${offset * 100}%`;
183
+ positionStyle.transform = 'translateY(50%)';
184
+ break;
185
+ case 'ttb':
186
+ positionStyle.top = `${offset * 100}%`;
187
+ positionStyle.transform = 'translateY(-50%)';
188
+ break;
189
+ default:
190
+ positionStyle.left = `${offset * 100}%`;
191
+ positionStyle.transform = 'translateX(-50%)';
192
+ break;
193
+ }
194
+ return positionStyle;
195
+ }
196
+
197
+ /** Return index value if is list or return value directly */
198
+ function getIndex(value, index) {
199
+ return Array.isArray(value) ? value[index] : value;
200
+ }
201
+
202
+ /**
203
+ * @ignore
204
+ * some key-codes definition and utils from closure-library
205
+ * @author yiminghe@gmail.com
206
+ */
207
+
208
+ const KeyCode = {
209
+ /**
210
+ * BACKSPACE
211
+ */
212
+ BACKSPACE: 8,
213
+ /**
214
+ * PAGE_UP
215
+ */
216
+ PAGE_UP: 33,
217
+ // also NUM_NORTH_EAST
218
+ /**
219
+ * PAGE_DOWN
220
+ */
221
+ PAGE_DOWN: 34,
222
+ // also NUM_SOUTH_EAST
223
+ /**
224
+ * END
225
+ */
226
+ END: 35,
227
+ // also NUM_SOUTH_WEST
228
+ /**
229
+ * HOME
230
+ */
231
+ HOME: 36,
232
+ // also NUM_NORTH_WEST
233
+ /**
234
+ * LEFT
235
+ */
236
+ LEFT: 37,
237
+ // also NUM_WEST
238
+ /**
239
+ * UP
240
+ */
241
+ UP: 38,
242
+ // also NUM_NORTH
243
+ /**
244
+ * RIGHT
245
+ */
246
+ RIGHT: 39,
247
+ // also NUM_EAST
248
+ /**
249
+ * DOWN
250
+ */
251
+ DOWN: 40,
252
+ // also NUM_INSERT
253
+ /**
254
+ * DELETE
255
+ */
256
+ DELETE: 46};
257
+
258
+ const SliderContext = /*#__PURE__*/React.createContext({
259
+ min: 0,
260
+ max: 0,
261
+ direction: 'ltr',
262
+ step: 1,
263
+ includedStart: 0,
264
+ includedEnd: 0,
265
+ tabIndex: 0,
266
+ keyboard: true,
267
+ styles: {},
268
+ classNames: {}
269
+ });
270
+ /** @private NOT PROMISE AVAILABLE. DO NOT USE IN PRODUCTION. */
271
+ const UnstableContext = /*#__PURE__*/React.createContext({});
272
+
273
+ function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
274
+ const Handle = /*#__PURE__*/React.forwardRef((props, ref) => {
275
+ const {
276
+ prefixCls,
277
+ value,
278
+ valueIndex,
279
+ onStartMove,
280
+ onDelete,
281
+ style,
282
+ render,
283
+ dragging,
284
+ draggingDelete,
285
+ onOffsetChange,
286
+ onChangeComplete,
287
+ onFocus,
288
+ onMouseEnter,
289
+ ...restProps
290
+ } = props;
291
+ const {
292
+ min,
293
+ max,
294
+ direction,
295
+ disabled,
296
+ keyboard,
297
+ range,
298
+ tabIndex,
299
+ ariaLabelForHandle,
300
+ ariaLabelledByForHandle,
301
+ ariaRequired,
302
+ ariaValueTextFormatterForHandle,
303
+ styles,
304
+ classNames
305
+ } = React.useContext(SliderContext);
306
+ const handlePrefixCls = `${prefixCls}-handle`;
307
+
308
+ // ============================ Events ============================
309
+ const onInternalStartMove = e => {
310
+ if (!disabled) {
311
+ onStartMove(e, valueIndex);
312
+ }
313
+ };
314
+ const onInternalFocus = e => {
315
+ onFocus?.(e, valueIndex);
316
+ };
317
+ const onInternalMouseEnter = e => {
318
+ onMouseEnter(e, valueIndex);
319
+ };
320
+
321
+ // =========================== Keyboard ===========================
322
+ const onKeyDown = e => {
323
+ if (!disabled && keyboard) {
324
+ let offset = null;
325
+
326
+ // Change the value
327
+ switch (e.which || e.keyCode) {
328
+ case KeyCode.LEFT:
329
+ offset = direction === 'ltr' || direction === 'btt' ? -1 : 1;
330
+ break;
331
+ case KeyCode.RIGHT:
332
+ offset = direction === 'ltr' || direction === 'btt' ? 1 : -1;
333
+ break;
334
+
335
+ // Up is plus
336
+ case KeyCode.UP:
337
+ offset = direction !== 'ttb' ? 1 : -1;
338
+ break;
339
+
340
+ // Down is minus
341
+ case KeyCode.DOWN:
342
+ offset = direction !== 'ttb' ? -1 : 1;
343
+ break;
344
+ case KeyCode.HOME:
345
+ offset = 'min';
346
+ break;
347
+ case KeyCode.END:
348
+ offset = 'max';
349
+ break;
350
+ case KeyCode.PAGE_UP:
351
+ offset = 2;
352
+ break;
353
+ case KeyCode.PAGE_DOWN:
354
+ offset = -2;
355
+ break;
356
+ case KeyCode.BACKSPACE:
357
+ case KeyCode.DELETE:
358
+ onDelete?.(valueIndex);
359
+ break;
360
+ }
361
+ if (offset !== null) {
362
+ e.preventDefault();
363
+ onOffsetChange(offset, valueIndex);
364
+ }
365
+ }
366
+ };
367
+ const handleKeyUp = e => {
368
+ switch (e.which || e.keyCode) {
369
+ case KeyCode.LEFT:
370
+ case KeyCode.RIGHT:
371
+ case KeyCode.UP:
372
+ case KeyCode.DOWN:
373
+ case KeyCode.HOME:
374
+ case KeyCode.END:
375
+ case KeyCode.PAGE_UP:
376
+ case KeyCode.PAGE_DOWN:
377
+ onChangeComplete?.();
378
+ break;
379
+ }
380
+ };
381
+
382
+ // ============================ Offset ============================
383
+ const positionStyle = getDirectionStyle(direction, value, min, max);
384
+
385
+ // ============================ Render ============================
386
+ let divProps = {};
387
+ if (valueIndex !== null) {
388
+ divProps = {
389
+ tabIndex: disabled ? null : getIndex(tabIndex, valueIndex),
390
+ role: 'slider',
391
+ 'aria-valuemin': min,
392
+ 'aria-valuemax': max,
393
+ 'aria-valuenow': value,
394
+ 'aria-disabled': disabled,
395
+ 'aria-label': getIndex(ariaLabelForHandle, valueIndex),
396
+ 'aria-labelledby': getIndex(ariaLabelledByForHandle, valueIndex),
397
+ 'aria-required': getIndex(ariaRequired, valueIndex),
398
+ 'aria-valuetext': getIndex(ariaValueTextFormatterForHandle, valueIndex)?.(value),
399
+ 'aria-orientation': direction === 'ltr' || direction === 'rtl' ? 'horizontal' : 'vertical',
400
+ onMouseDown: onInternalStartMove,
401
+ onTouchStart: onInternalStartMove,
402
+ onFocus: onInternalFocus,
403
+ onMouseEnter: onInternalMouseEnter,
404
+ onKeyDown,
405
+ onKeyUp: handleKeyUp
406
+ };
407
+ }
408
+ let handleNode = /*#__PURE__*/React.createElement("div", _extends$1({
409
+ ref: ref,
410
+ className: cls(handlePrefixCls, {
411
+ [`${handlePrefixCls}-${valueIndex + 1}`]: valueIndex !== null && range,
412
+ [`${handlePrefixCls}-dragging`]: dragging,
413
+ [`${handlePrefixCls}-dragging-delete`]: draggingDelete
414
+ }, classNames.handle),
415
+ style: {
416
+ ...positionStyle,
417
+ ...style,
418
+ ...styles.handle
419
+ }
420
+ }, divProps, restProps));
421
+
422
+ // Customize
423
+ if (render) {
424
+ handleNode = render(handleNode, {
425
+ index: valueIndex,
426
+ prefixCls,
427
+ value,
428
+ dragging,
429
+ draggingDelete
430
+ });
431
+ }
432
+ return handleNode;
433
+ });
434
+ if (process.env.NODE_ENV !== 'production') {
435
+ Handle.displayName = 'Handle';
436
+ }
437
+
438
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
439
+ const Handles = /*#__PURE__*/React.forwardRef((props, ref) => {
440
+ const {
441
+ prefixCls,
442
+ style,
443
+ onStartMove,
444
+ onOffsetChange,
445
+ values,
446
+ handleRender,
447
+ activeHandleRender,
448
+ draggingIndex,
449
+ draggingDelete,
450
+ onFocus,
451
+ ...restProps
452
+ } = props;
453
+ const handlesRef = React.useRef({});
454
+
455
+ // =========================== Active ===========================
456
+ const [activeVisible, setActiveVisible] = React.useState(false);
457
+ const [activeIndex, setActiveIndex] = React.useState(-1);
458
+ const onActive = index => {
459
+ setActiveIndex(index);
460
+ setActiveVisible(true);
461
+ };
462
+ const onHandleFocus = (e, index) => {
463
+ onActive(index);
464
+ onFocus?.(e);
465
+ };
466
+ const onHandleMouseEnter = (e, index) => {
467
+ onActive(index);
468
+ };
469
+
470
+ // =========================== Render ===========================
471
+ React.useImperativeHandle(ref, () => ({
472
+ focus: index => {
473
+ handlesRef.current[index]?.focus();
474
+ },
475
+ hideHelp: () => {
476
+ flushSync(() => {
477
+ setActiveVisible(false);
478
+ });
479
+ }
480
+ }));
481
+
482
+ // =========================== Render ===========================
483
+ // Handle Props
484
+ const handleProps = {
485
+ prefixCls,
486
+ onStartMove,
487
+ onOffsetChange,
488
+ render: handleRender,
489
+ onFocus: onHandleFocus,
490
+ onMouseEnter: onHandleMouseEnter,
491
+ ...restProps
492
+ };
493
+ return /*#__PURE__*/React.createElement(React.Fragment, null, values.map((value, index) => {
494
+ const dragging = draggingIndex === index;
495
+ return /*#__PURE__*/React.createElement(Handle, _extends({
496
+ ref: node => {
497
+ if (!node) {
498
+ delete handlesRef.current[index];
499
+ } else {
500
+ handlesRef.current[index] = node;
501
+ }
502
+ },
503
+ dragging: dragging,
504
+ draggingDelete: dragging && draggingDelete,
505
+ style: getIndex(style, index),
506
+ key: index,
507
+ value: value,
508
+ valueIndex: index
509
+ }, handleProps));
510
+ }), activeHandleRender && activeVisible && /*#__PURE__*/React.createElement(Handle, _extends({
511
+ key: "a11y"
512
+ }, handleProps, {
513
+ value: values[activeIndex],
514
+ valueIndex: null,
515
+ dragging: draggingIndex !== -1,
516
+ draggingDelete: draggingDelete,
517
+ render: activeHandleRender,
518
+ style: {
519
+ pointerEvents: 'none'
520
+ },
521
+ tabIndex: null,
522
+ "aria-hidden": true
523
+ })));
524
+ });
525
+ if (process.env.NODE_ENV !== 'production') {
526
+ Handles.displayName = 'Handles';
527
+ }
528
+
529
+ const Mark = props => {
530
+ const {
531
+ prefixCls,
532
+ style,
533
+ children,
534
+ value,
535
+ onClick
536
+ } = props;
537
+ const {
538
+ min,
539
+ max,
540
+ direction,
541
+ includedStart,
542
+ includedEnd,
543
+ included
544
+ } = React.useContext(SliderContext);
545
+ const textCls = `${prefixCls}-text`;
546
+
547
+ // ============================ Offset ============================
548
+ const positionStyle = getDirectionStyle(direction, value, min, max);
549
+ return /*#__PURE__*/React.createElement("span", {
550
+ className: cls(textCls, {
551
+ [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd
552
+ }),
553
+ style: {
554
+ ...positionStyle,
555
+ ...style
556
+ },
557
+ onMouseDown: e => {
558
+ e.stopPropagation();
559
+ },
560
+ onClick: () => {
561
+ onClick(value);
562
+ }
563
+ }, children);
564
+ };
565
+
566
+ const Marks = props => {
567
+ const {
568
+ prefixCls,
569
+ marks,
570
+ onClick
571
+ } = props;
572
+ const markPrefixCls = `${prefixCls}-mark`;
573
+
574
+ // Not render mark if empty
575
+ if (!marks.length) {
576
+ return null;
577
+ }
578
+ return /*#__PURE__*/React.createElement("div", {
579
+ className: markPrefixCls
580
+ }, marks.map(({
581
+ value,
582
+ style,
583
+ label
584
+ }) => /*#__PURE__*/React.createElement(Mark, {
585
+ key: value,
586
+ prefixCls: markPrefixCls,
587
+ style: style,
588
+ value: value,
589
+ onClick: onClick
590
+ }, label)));
591
+ };
592
+
593
+ const Dot = props => {
594
+ const {
595
+ prefixCls,
596
+ value,
597
+ style,
598
+ activeStyle
599
+ } = props;
600
+ const {
601
+ min,
602
+ max,
603
+ direction,
604
+ included,
605
+ includedStart,
606
+ includedEnd
607
+ } = React.useContext(SliderContext);
608
+ const dotClassName = `${prefixCls}-dot`;
609
+ const active = included && includedStart <= value && value <= includedEnd;
610
+
611
+ // ============================ Offset ============================
612
+ let mergedStyle = {
613
+ ...getDirectionStyle(direction, value, min, max),
614
+ ...(typeof style === 'function' ? style(value) : style)
615
+ };
616
+ if (active) {
617
+ mergedStyle = {
618
+ ...mergedStyle,
619
+ ...(typeof activeStyle === 'function' ? activeStyle(value) : activeStyle)
620
+ };
621
+ }
622
+ return /*#__PURE__*/React.createElement("span", {
623
+ className: cls(dotClassName, {
624
+ [`${dotClassName}-active`]: active
625
+ }),
626
+ style: mergedStyle
627
+ });
628
+ };
629
+
630
+ const Steps = props => {
631
+ const {
632
+ prefixCls,
633
+ marks,
634
+ dots,
635
+ style,
636
+ activeStyle
637
+ } = props;
638
+ const {
639
+ min,
640
+ max,
641
+ step
642
+ } = React.useContext(SliderContext);
643
+ const stepDots = React.useMemo(() => {
644
+ const dotSet = new Set();
645
+
646
+ // Add marks
647
+ marks.forEach(mark => {
648
+ dotSet.add(mark.value);
649
+ });
650
+
651
+ // Fill dots
652
+ if (dots && step !== null) {
653
+ let current = min;
654
+ while (current <= max) {
655
+ dotSet.add(current);
656
+ current += step;
657
+ }
658
+ }
659
+ return Array.from(dotSet);
660
+ }, [min, max, step, dots, marks]);
661
+ return /*#__PURE__*/React.createElement("div", {
662
+ className: `${prefixCls}-step`
663
+ }, stepDots.map(dotValue => /*#__PURE__*/React.createElement(Dot, {
664
+ prefixCls: prefixCls,
665
+ key: dotValue,
666
+ value: dotValue,
667
+ style: style,
668
+ activeStyle: activeStyle
669
+ })));
670
+ };
671
+
672
+ const Track = props => {
673
+ const {
674
+ prefixCls,
675
+ style,
676
+ start,
677
+ end,
678
+ index,
679
+ onStartMove,
680
+ replaceCls
681
+ } = props;
682
+ const {
683
+ direction,
684
+ min,
685
+ max,
686
+ disabled,
687
+ range,
688
+ classNames
689
+ } = React.useContext(SliderContext);
690
+ const trackPrefixCls = `${prefixCls}-track`;
691
+ const offsetStart = getOffset(start, min, max);
692
+ const offsetEnd = getOffset(end, min, max);
693
+
694
+ // ============================ Events ============================
695
+ const onInternalStartMove = e => {
696
+ if (!disabled && onStartMove) {
697
+ onStartMove(e, -1);
698
+ }
699
+ };
700
+
701
+ // ============================ Render ============================
702
+ const positionStyle = {};
703
+ switch (direction) {
704
+ case 'rtl':
705
+ positionStyle.right = `${offsetStart * 100}%`;
706
+ positionStyle.width = `${offsetEnd * 100 - offsetStart * 100}%`;
707
+ break;
708
+ case 'btt':
709
+ positionStyle.bottom = `${offsetStart * 100}%`;
710
+ positionStyle.height = `${offsetEnd * 100 - offsetStart * 100}%`;
711
+ break;
712
+ case 'ttb':
713
+ positionStyle.top = `${offsetStart * 100}%`;
714
+ positionStyle.height = `${offsetEnd * 100 - offsetStart * 100}%`;
715
+ break;
716
+ default:
717
+ positionStyle.left = `${offsetStart * 100}%`;
718
+ positionStyle.width = `${offsetEnd * 100 - offsetStart * 100}%`;
719
+ }
720
+ const className = replaceCls || cls(trackPrefixCls, {
721
+ [`${trackPrefixCls}-${index + 1}`]: index !== null && range,
722
+ [`${prefixCls}-track-draggable`]: onStartMove
723
+ }, classNames.track);
724
+ return /*#__PURE__*/React.createElement("div", {
725
+ className: className,
726
+ style: {
727
+ ...positionStyle,
728
+ ...style
729
+ },
730
+ onMouseDown: onInternalStartMove,
731
+ onTouchStart: onInternalStartMove
732
+ });
733
+ };
734
+
735
+ const Tracks = props => {
736
+ const {
737
+ prefixCls,
738
+ style,
739
+ values,
740
+ startPoint,
741
+ onStartMove
742
+ } = props;
743
+ const {
744
+ included,
745
+ range,
746
+ min,
747
+ styles,
748
+ classNames
749
+ } = React.useContext(SliderContext);
750
+
751
+ // =========================== List ===========================
752
+ const trackList = React.useMemo(() => {
753
+ if (!range) {
754
+ // null value do not have track
755
+ if (values.length === 0) {
756
+ return [];
757
+ }
758
+ const startValue = startPoint ?? min;
759
+ const endValue = values[0];
760
+ return [{
761
+ start: Math.min(startValue, endValue),
762
+ end: Math.max(startValue, endValue)
763
+ }];
764
+ }
765
+
766
+ // Multiple
767
+ const list = [];
768
+ for (let i = 0; i < values.length - 1; i += 1) {
769
+ list.push({
770
+ start: values[i],
771
+ end: values[i + 1]
772
+ });
773
+ }
774
+ return list;
775
+ }, [values, range, startPoint, min]);
776
+ if (!included) {
777
+ return null;
778
+ }
779
+
780
+ // ========================== Render ==========================
781
+ const tracksNode = trackList?.length && (classNames.tracks || styles.tracks) ? /*#__PURE__*/React.createElement(Track, {
782
+ index: null,
783
+ prefixCls: prefixCls,
784
+ start: trackList[0].start,
785
+ end: trackList[trackList.length - 1].end,
786
+ replaceCls: cls(classNames.tracks, `${prefixCls}-tracks`),
787
+ style: styles.tracks
788
+ }) : null;
789
+ return /*#__PURE__*/React.createElement(React.Fragment, null, tracksNode, trackList.map(({
790
+ start,
791
+ end
792
+ }, index) => /*#__PURE__*/React.createElement(Track, {
793
+ index: index,
794
+ prefixCls: prefixCls,
795
+ style: {
796
+ ...getIndex(style, index),
797
+ ...styles.track
798
+ },
799
+ start: start,
800
+ end: end,
801
+ key: index,
802
+ onStartMove: onStartMove
803
+ })));
804
+ };
805
+
806
+ /** Drag to delete offset. It's a user experience number for dragging out */
807
+ const REMOVE_DIST = 130;
808
+ function getPosition(e) {
809
+ const obj = 'targetTouches' in e ? e.targetTouches[0] : e;
810
+ return {
811
+ pageX: obj.pageX,
812
+ pageY: obj.pageY
813
+ };
814
+ }
815
+ function useDrag(containerRef, direction, rawValues, min, max, formatValue, triggerChange, finishChange, offsetValues, editable, minCount) {
816
+ const [draggingValue, setDraggingValue] = React.useState(null);
817
+ const [draggingIndex, setDraggingIndex] = React.useState(-1);
818
+ const [draggingDelete, setDraggingDelete] = React.useState(false);
819
+ const [cacheValues, setCacheValues] = React.useState(rawValues);
820
+ const [originValues, setOriginValues] = React.useState(rawValues);
821
+ const mouseMoveEventRef = React.useRef(null);
822
+ const mouseUpEventRef = React.useRef(null);
823
+ const touchEventTargetRef = React.useRef(null);
824
+ const {
825
+ onDragStart,
826
+ onDragChange
827
+ } = React.useContext(UnstableContext);
828
+ useLayoutEffect(() => {
829
+ if (draggingIndex === -1) {
830
+ setCacheValues(rawValues);
831
+ }
832
+ }, [rawValues, draggingIndex]);
833
+
834
+ // Clean up event
835
+ React.useEffect(() => () => {
836
+ document.removeEventListener('mousemove', mouseMoveEventRef.current);
837
+ document.removeEventListener('mouseup', mouseUpEventRef.current);
838
+ if (touchEventTargetRef.current) {
839
+ touchEventTargetRef.current.removeEventListener('touchmove', mouseMoveEventRef.current);
840
+ touchEventTargetRef.current.removeEventListener('touchend', mouseUpEventRef.current);
841
+ }
842
+ }, []);
843
+ const flushValues = (nextValues, nextValue, deleteMark) => {
844
+ // Perf: Only update state when value changed
845
+ if (nextValue !== undefined) {
846
+ setDraggingValue(nextValue);
847
+ }
848
+ setCacheValues(nextValues);
849
+ let changeValues = nextValues;
850
+ if (deleteMark) {
851
+ changeValues = nextValues.filter((_, i) => i !== draggingIndex);
852
+ }
853
+ triggerChange(changeValues);
854
+ if (onDragChange) {
855
+ onDragChange({
856
+ rawValues: nextValues,
857
+ deleteIndex: deleteMark ? draggingIndex : -1,
858
+ draggingIndex,
859
+ draggingValue: nextValue
860
+ });
861
+ }
862
+ };
863
+ const updateCacheValue = useEvent((valueIndex, offsetPercent, deleteMark) => {
864
+ if (valueIndex === -1) {
865
+ // >>>> Dragging on the track
866
+ const startValue = originValues[0];
867
+ const endValue = originValues[originValues.length - 1];
868
+ const maxStartOffset = min - startValue;
869
+ const maxEndOffset = max - endValue;
870
+
871
+ // Get valid offset
872
+ let offset = offsetPercent * (max - min);
873
+ offset = Math.max(offset, maxStartOffset);
874
+ offset = Math.min(offset, maxEndOffset);
875
+
876
+ // Use first value to revert back of valid offset (like steps marks)
877
+ const formatStartValue = formatValue(startValue + offset);
878
+ offset = formatStartValue - startValue;
879
+ const cloneCacheValues = originValues.map(val => val + offset);
880
+ flushValues(cloneCacheValues);
881
+ } else {
882
+ // >>>> Dragging on the handle
883
+ const offsetDist = (max - min) * offsetPercent;
884
+
885
+ // Always start with the valueIndex origin value
886
+ const cloneValues = [...cacheValues];
887
+ cloneValues[valueIndex] = originValues[valueIndex];
888
+ const next = offsetValues(cloneValues, offsetDist, valueIndex, 'dist');
889
+ flushValues(next.values, next.value, deleteMark);
890
+ }
891
+ });
892
+ const onStartMove = (e, valueIndex, startValues) => {
893
+ e.stopPropagation();
894
+
895
+ // 如果是点击 track 触发的,需要传入变化后的初始值,而不能直接用 rawValues
896
+ const initialValues = startValues || rawValues;
897
+ const originValue = initialValues[valueIndex];
898
+ setDraggingIndex(valueIndex);
899
+ setDraggingValue(originValue);
900
+ setOriginValues(initialValues);
901
+ setCacheValues(initialValues);
902
+ setDraggingDelete(false);
903
+ const {
904
+ pageX: startX,
905
+ pageY: startY
906
+ } = getPosition(e);
907
+
908
+ // We declare it here since closure can't get outer latest value
909
+ let deleteMark = false;
910
+
911
+ // Internal trigger event
912
+ if (onDragStart) {
913
+ onDragStart({
914
+ rawValues: initialValues,
915
+ draggingIndex: valueIndex,
916
+ draggingValue: originValue
917
+ });
918
+ }
919
+
920
+ // Moving
921
+ const onMouseMove = event => {
922
+ event.preventDefault();
923
+ const {
924
+ pageX: moveX,
925
+ pageY: moveY
926
+ } = getPosition(event);
927
+ const offsetX = moveX - startX;
928
+ const offsetY = moveY - startY;
929
+ const {
930
+ width,
931
+ height
932
+ } = containerRef.current.getBoundingClientRect();
933
+ let offSetPercent;
934
+ let removeDist;
935
+ switch (direction) {
936
+ case 'btt':
937
+ offSetPercent = -offsetY / height;
938
+ removeDist = offsetX;
939
+ break;
940
+ case 'ttb':
941
+ offSetPercent = offsetY / height;
942
+ removeDist = offsetX;
943
+ break;
944
+ case 'rtl':
945
+ offSetPercent = -offsetX / width;
946
+ removeDist = offsetY;
947
+ break;
948
+ default:
949
+ offSetPercent = offsetX / width;
950
+ removeDist = offsetY;
951
+ }
952
+
953
+ // Check if need mark remove
954
+ deleteMark = editable ? Math.abs(removeDist) > REMOVE_DIST && minCount < cacheValues.length : false;
955
+ setDraggingDelete(deleteMark);
956
+ updateCacheValue(valueIndex, offSetPercent, deleteMark);
957
+ };
958
+
959
+ // End
960
+ const onMouseUp = event => {
961
+ event.preventDefault();
962
+ document.removeEventListener('mouseup', onMouseUp);
963
+ document.removeEventListener('mousemove', onMouseMove);
964
+ if (touchEventTargetRef.current) {
965
+ touchEventTargetRef.current.removeEventListener('touchmove', mouseMoveEventRef.current);
966
+ touchEventTargetRef.current.removeEventListener('touchend', mouseUpEventRef.current);
967
+ }
968
+ mouseMoveEventRef.current = null;
969
+ mouseUpEventRef.current = null;
970
+ touchEventTargetRef.current = null;
971
+ finishChange(deleteMark);
972
+ setDraggingIndex(-1);
973
+ setDraggingDelete(false);
974
+ };
975
+ document.addEventListener('mouseup', onMouseUp);
976
+ document.addEventListener('mousemove', onMouseMove);
977
+ e.currentTarget.addEventListener('touchend', onMouseUp);
978
+ e.currentTarget.addEventListener('touchmove', onMouseMove);
979
+ mouseMoveEventRef.current = onMouseMove;
980
+ mouseUpEventRef.current = onMouseUp;
981
+ touchEventTargetRef.current = e.currentTarget;
982
+ };
983
+
984
+ // Only return cache value when it mapping with rawValues
985
+ const returnValues = React.useMemo(() => {
986
+ const sourceValues = [...rawValues].sort((a, b) => a - b);
987
+ const targetValues = [...cacheValues].sort((a, b) => a - b);
988
+ const counts = {};
989
+ targetValues.forEach(val => {
990
+ counts[val] = (counts[val] || 0) + 1;
991
+ });
992
+ sourceValues.forEach(val => {
993
+ counts[val] = (counts[val] || 0) - 1;
994
+ });
995
+ const maxDiffCount = editable ? 1 : 0;
996
+ const diffCount = Object.values(counts).reduce((prev, next) => prev + Math.abs(next), 0);
997
+ return diffCount <= maxDiffCount ? cacheValues : rawValues;
998
+ }, [rawValues, cacheValues, editable]);
999
+ return [draggingIndex, draggingValue, draggingDelete, returnValues, onStartMove];
1000
+ }
1001
+
1002
+ /** Format the value in the range of [min, max] */
1003
+
1004
+ /** Format value align with step */
1005
+
1006
+ /** Format value align with step & marks */
1007
+
1008
+ function useOffset(min, max, step, markList, allowCross, pushable) {
1009
+ const formatRangeValue = React.useCallback(val => Math.max(min, Math.min(max, val)), [min, max]);
1010
+ const formatStepValue = React.useCallback(val => {
1011
+ if (step !== null) {
1012
+ const stepValue = min + Math.round((formatRangeValue(val) - min) / step) * step;
1013
+
1014
+ // Cut number in case to be like 0.30000000000000004
1015
+ const getDecimal = num => (String(num).split('.')[1] || '').length;
1016
+ const maxDecimal = Math.max(getDecimal(step), getDecimal(max), getDecimal(min));
1017
+ const fixedValue = Number(stepValue.toFixed(maxDecimal));
1018
+ return min <= fixedValue && fixedValue <= max ? fixedValue : null;
1019
+ }
1020
+ return null;
1021
+ }, [step, min, max, formatRangeValue]);
1022
+ const formatValue = React.useCallback(val => {
1023
+ const formatNextValue = formatRangeValue(val);
1024
+
1025
+ // List align values
1026
+ const alignValues = markList.map(mark => mark.value);
1027
+ if (step !== null) {
1028
+ alignValues.push(formatStepValue(val));
1029
+ }
1030
+
1031
+ // min & max
1032
+ alignValues.push(min, max);
1033
+
1034
+ // Align with marks
1035
+ let closeValue = alignValues[0];
1036
+ let closeDist = max - min;
1037
+ alignValues.forEach(alignValue => {
1038
+ const dist = Math.abs(formatNextValue - alignValue);
1039
+ if (dist <= closeDist) {
1040
+ closeValue = alignValue;
1041
+ closeDist = dist;
1042
+ }
1043
+ });
1044
+ return closeValue;
1045
+ }, [min, max, markList, step, formatRangeValue, formatStepValue]);
1046
+
1047
+ // ========================== Offset ==========================
1048
+ // Single Value
1049
+ const offsetValue = (values, offset, valueIndex, mode = 'unit') => {
1050
+ if (typeof offset === 'number') {
1051
+ let nextValue;
1052
+ const originValue = values[valueIndex];
1053
+
1054
+ // Only used for `dist` mode
1055
+ const targetDistValue = originValue + offset;
1056
+
1057
+ // Compare next step value & mark value which is best match
1058
+ let potentialValues = [];
1059
+ markList.forEach(mark => {
1060
+ potentialValues.push(mark.value);
1061
+ });
1062
+
1063
+ // Min & Max
1064
+ potentialValues.push(min, max);
1065
+
1066
+ // In case origin value is align with mark but not with step
1067
+ potentialValues.push(formatStepValue(originValue));
1068
+
1069
+ // Put offset step value also
1070
+ const sign = offset > 0 ? 1 : -1;
1071
+ if (mode === 'unit') {
1072
+ potentialValues.push(formatStepValue(originValue + sign * step));
1073
+ } else {
1074
+ potentialValues.push(formatStepValue(targetDistValue));
1075
+ }
1076
+
1077
+ // Find close one
1078
+ potentialValues = potentialValues.filter(val => val !== null)
1079
+ // Remove reverse value
1080
+ .filter(val => offset < 0 ? val <= originValue : val >= originValue);
1081
+ if (mode === 'unit') {
1082
+ // `unit` mode can not contain itself
1083
+ potentialValues = potentialValues.filter(val => val !== originValue);
1084
+ }
1085
+ const compareValue = mode === 'unit' ? originValue : targetDistValue;
1086
+ nextValue = potentialValues[0];
1087
+ let valueDist = Math.abs(nextValue - compareValue);
1088
+ potentialValues.forEach(potentialValue => {
1089
+ const dist = Math.abs(potentialValue - compareValue);
1090
+ if (dist < valueDist) {
1091
+ nextValue = potentialValue;
1092
+ valueDist = dist;
1093
+ }
1094
+ });
1095
+
1096
+ // Out of range will back to range
1097
+ if (nextValue === undefined) {
1098
+ return offset < 0 ? min : max;
1099
+ }
1100
+
1101
+ // `dist` mode
1102
+ if (mode === 'dist') {
1103
+ return nextValue;
1104
+ }
1105
+
1106
+ // `unit` mode may need another round
1107
+ if (Math.abs(offset) > 1) {
1108
+ const cloneValues = [...values];
1109
+ cloneValues[valueIndex] = nextValue;
1110
+ return offsetValue(cloneValues, offset - sign, valueIndex, mode);
1111
+ }
1112
+ return nextValue;
1113
+ } else if (offset === 'min') {
1114
+ return min;
1115
+ } else if (offset === 'max') {
1116
+ return max;
1117
+ }
1118
+ };
1119
+
1120
+ /** Same as `offsetValue` but return `changed` mark to tell value changed */
1121
+ const offsetChangedValue = (values, offset, valueIndex, mode = 'unit') => {
1122
+ const originValue = values[valueIndex];
1123
+ const nextValue = offsetValue(values, offset, valueIndex, mode);
1124
+ return {
1125
+ value: nextValue,
1126
+ changed: nextValue !== originValue
1127
+ };
1128
+ };
1129
+ const needPush = dist => {
1130
+ return pushable === null && dist === 0 || typeof pushable === 'number' && dist < pushable;
1131
+ };
1132
+
1133
+ // Values
1134
+ const offsetValues = (values, offset, valueIndex, mode = 'unit') => {
1135
+ const nextValues = values.map(formatValue);
1136
+ const originValue = nextValues[valueIndex];
1137
+ const nextValue = offsetValue(nextValues, offset, valueIndex, mode);
1138
+ nextValues[valueIndex] = nextValue;
1139
+ if (allowCross === false) {
1140
+ // >>>>> Allow Cross
1141
+ const pushNum = pushable || 0;
1142
+
1143
+ // ============ AllowCross ===============
1144
+ if (valueIndex > 0 && nextValues[valueIndex - 1] !== originValue) {
1145
+ nextValues[valueIndex] = Math.max(nextValues[valueIndex], nextValues[valueIndex - 1] + pushNum);
1146
+ }
1147
+ if (valueIndex < nextValues.length - 1 && nextValues[valueIndex + 1] !== originValue) {
1148
+ nextValues[valueIndex] = Math.min(nextValues[valueIndex], nextValues[valueIndex + 1] - pushNum);
1149
+ }
1150
+ } else if (typeof pushable === 'number' || pushable === null) {
1151
+ // >>>>> Pushable
1152
+ // =============== Push ==================
1153
+
1154
+ // >>>>>> Basic push
1155
+ // End values
1156
+ for (let i = valueIndex + 1; i < nextValues.length; i += 1) {
1157
+ let changed = true;
1158
+ while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
1159
+ ({
1160
+ value: nextValues[i],
1161
+ changed
1162
+ } = offsetChangedValue(nextValues, 1, i));
1163
+ }
1164
+ }
1165
+
1166
+ // Start values
1167
+ for (let i = valueIndex; i > 0; i -= 1) {
1168
+ let changed = true;
1169
+ while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
1170
+ ({
1171
+ value: nextValues[i - 1],
1172
+ changed
1173
+ } = offsetChangedValue(nextValues, -1, i - 1));
1174
+ }
1175
+ }
1176
+
1177
+ // >>>>> Revert back to safe push range
1178
+ // End to Start
1179
+ for (let i = nextValues.length - 1; i > 0; i -= 1) {
1180
+ let changed = true;
1181
+ while (needPush(nextValues[i] - nextValues[i - 1]) && changed) {
1182
+ ({
1183
+ value: nextValues[i - 1],
1184
+ changed
1185
+ } = offsetChangedValue(nextValues, -1, i - 1));
1186
+ }
1187
+ }
1188
+
1189
+ // Start to End
1190
+ for (let i = 0; i < nextValues.length - 1; i += 1) {
1191
+ let changed = true;
1192
+ while (needPush(nextValues[i + 1] - nextValues[i]) && changed) {
1193
+ ({
1194
+ value: nextValues[i + 1],
1195
+ changed
1196
+ } = offsetChangedValue(nextValues, 1, i + 1));
1197
+ }
1198
+ }
1199
+ }
1200
+ return {
1201
+ value: nextValues[valueIndex],
1202
+ values: nextValues
1203
+ };
1204
+ };
1205
+ return [formatValue, offsetValues];
1206
+ }
1207
+
1208
+ function useRange(range) {
1209
+ return useMemo(() => {
1210
+ if (range === true || !range) {
1211
+ return [!!range, false, false, 0];
1212
+ }
1213
+ const {
1214
+ editable,
1215
+ draggableTrack,
1216
+ minCount,
1217
+ maxCount
1218
+ } = range;
1219
+ if (process.env.NODE_ENV !== 'production') {
1220
+ warning(!editable || !draggableTrack, '`editable` can not work with `draggableTrack`.');
1221
+ }
1222
+ return [true, editable, !editable && draggableTrack, minCount || 0, maxCount];
1223
+ }, [range]);
1224
+ }
1225
+
1226
+ /**
1227
+ * New:
1228
+ * - click mark to update range value
1229
+ * - handleRender
1230
+ * - Fix handle with count not correct
1231
+ * - Fix pushable not work in some case
1232
+ * - No more FindDOMNode
1233
+ * - Move all position related style into inline style
1234
+ * - Key: up is plus, down is minus
1235
+ * - fix Key with step = null not align with marks
1236
+ * - Change range should not trigger onChange
1237
+ * - keyboard support pushable
1238
+ */
1239
+
1240
+ const Slider = /*#__PURE__*/React.forwardRef((props, ref) => {
1241
+ const {
1242
+ prefixCls = 'rc-slider',
1243
+ className,
1244
+ style,
1245
+ classNames,
1246
+ styles,
1247
+ id,
1248
+ // Status
1249
+ disabled = false,
1250
+ keyboard = true,
1251
+ autoFocus,
1252
+ onFocus,
1253
+ onBlur,
1254
+ // Value
1255
+ min = 0,
1256
+ max = 100,
1257
+ step = 1,
1258
+ value,
1259
+ defaultValue,
1260
+ range,
1261
+ count,
1262
+ onChange,
1263
+ onBeforeChange,
1264
+ onAfterChange,
1265
+ onChangeComplete,
1266
+ // Cross
1267
+ allowCross = true,
1268
+ pushable = false,
1269
+ // Direction
1270
+ reverse,
1271
+ vertical,
1272
+ // Style
1273
+ included = true,
1274
+ startPoint,
1275
+ trackStyle,
1276
+ handleStyle,
1277
+ railStyle,
1278
+ dotStyle,
1279
+ activeDotStyle,
1280
+ // Decorations
1281
+ marks,
1282
+ dots,
1283
+ // Components
1284
+ handleRender,
1285
+ activeHandleRender,
1286
+ track,
1287
+ // Accessibility
1288
+ tabIndex = 0,
1289
+ ariaLabelForHandle,
1290
+ ariaLabelledByForHandle,
1291
+ ariaRequired,
1292
+ ariaValueTextFormatterForHandle
1293
+ } = props;
1294
+ const handlesRef = React.useRef(null);
1295
+ const containerRef = React.useRef(null);
1296
+ const direction = React.useMemo(() => {
1297
+ if (vertical) {
1298
+ return reverse ? 'ttb' : 'btt';
1299
+ }
1300
+ return reverse ? 'rtl' : 'ltr';
1301
+ }, [reverse, vertical]);
1302
+
1303
+ // ============================ Range =============================
1304
+ const [rangeEnabled, rangeEditable, rangeDraggableTrack, minCount, maxCount] = useRange(range);
1305
+ const mergedMin = React.useMemo(() => isFinite(min) ? min : 0, [min]);
1306
+ const mergedMax = React.useMemo(() => isFinite(max) ? max : 100, [max]);
1307
+
1308
+ // ============================= Step =============================
1309
+ const mergedStep = React.useMemo(() => step !== null && step <= 0 ? 1 : step, [step]);
1310
+
1311
+ // ============================= Push =============================
1312
+ const mergedPush = React.useMemo(() => {
1313
+ if (typeof pushable === 'boolean') {
1314
+ return pushable ? mergedStep : false;
1315
+ }
1316
+ return pushable >= 0 ? pushable : false;
1317
+ }, [pushable, mergedStep]);
1318
+
1319
+ // ============================ Marks =============================
1320
+ const markList = React.useMemo(() => {
1321
+ return Object.keys(marks || {}).map(key => {
1322
+ const mark = marks[key];
1323
+ const markObj = {
1324
+ value: Number(key)
1325
+ };
1326
+ if (mark && typeof mark === 'object' && ! /*#__PURE__*/React.isValidElement(mark) && ('label' in mark || 'style' in mark)) {
1327
+ markObj.style = mark.style;
1328
+ markObj.label = mark.label;
1329
+ } else {
1330
+ markObj.label = mark;
1331
+ }
1332
+ return markObj;
1333
+ }).filter(({
1334
+ label
1335
+ }) => label || typeof label === 'number').sort((a, b) => a.value - b.value);
1336
+ }, [marks]);
1337
+
1338
+ // ============================ Format ============================
1339
+ const [formatValue, offsetValues] = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush);
1340
+
1341
+ // ============================ Values ============================
1342
+ const [mergedValue, setValue] = useControlledState(defaultValue, value);
1343
+ const rawValues = React.useMemo(() => {
1344
+ const valueList = mergedValue === null || mergedValue === undefined ? [] : Array.isArray(mergedValue) ? mergedValue : [mergedValue];
1345
+ const [val0 = mergedMin] = valueList;
1346
+ let returnValues = mergedValue === null ? [] : [val0];
1347
+
1348
+ // Format as range
1349
+ if (rangeEnabled) {
1350
+ returnValues = [...valueList];
1351
+
1352
+ // When count provided or value is `undefined`, we fill values
1353
+ if (count || mergedValue === undefined) {
1354
+ const pointCount = count >= 0 ? count + 1 : 2;
1355
+ returnValues = returnValues.slice(0, pointCount);
1356
+
1357
+ // Fill with count
1358
+ while (returnValues.length < pointCount) {
1359
+ returnValues.push(returnValues[returnValues.length - 1] ?? mergedMin);
1360
+ }
1361
+ }
1362
+ returnValues.sort((a, b) => a - b);
1363
+ }
1364
+
1365
+ // Align in range
1366
+ returnValues.forEach((val, index) => {
1367
+ returnValues[index] = formatValue(val);
1368
+ });
1369
+ return returnValues;
1370
+ }, [mergedValue, rangeEnabled, mergedMin, count, formatValue]);
1371
+
1372
+ // =========================== onChange ===========================
1373
+ const getTriggerValue = triggerValues => rangeEnabled ? triggerValues : triggerValues[0];
1374
+ const triggerChange = useEvent(nextValues => {
1375
+ // Order first
1376
+ const cloneNextValues = [...nextValues].sort((a, b) => a - b);
1377
+
1378
+ // Trigger event if needed
1379
+ if (onChange && !isEqual(cloneNextValues, rawValues, true)) {
1380
+ onChange(getTriggerValue(cloneNextValues));
1381
+ }
1382
+
1383
+ // We set this later since it will re-render component immediately
1384
+ setValue(cloneNextValues);
1385
+ });
1386
+ const finishChange = useEvent(draggingDelete => {
1387
+ // Trigger from `useDrag` will tell if it's a delete action
1388
+ if (draggingDelete) {
1389
+ handlesRef.current.hideHelp();
1390
+ }
1391
+ const finishValue = getTriggerValue(rawValues);
1392
+ onAfterChange?.(finishValue);
1393
+ warningOnce(!onAfterChange, '[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.');
1394
+ onChangeComplete?.(finishValue);
1395
+ });
1396
+ const onDelete = index => {
1397
+ if (disabled || !rangeEditable || rawValues.length <= minCount) {
1398
+ return;
1399
+ }
1400
+ const cloneNextValues = [...rawValues];
1401
+ cloneNextValues.splice(index, 1);
1402
+ onBeforeChange?.(getTriggerValue(cloneNextValues));
1403
+ triggerChange(cloneNextValues);
1404
+ const nextFocusIndex = Math.max(0, index - 1);
1405
+ handlesRef.current.hideHelp();
1406
+ handlesRef.current.focus(nextFocusIndex);
1407
+ };
1408
+ const [draggingIndex, draggingValue, draggingDelete, cacheValues, onStartDrag] = useDrag(containerRef, direction, rawValues, mergedMin, mergedMax, formatValue, triggerChange, finishChange, offsetValues, rangeEditable, minCount);
1409
+
1410
+ /**
1411
+ * When `rangeEditable` will insert a new value in the values array.
1412
+ * Else it will replace the value in the values array.
1413
+ */
1414
+ const changeToCloseValue = (newValue, e) => {
1415
+ if (!disabled) {
1416
+ // Create new values
1417
+ const cloneNextValues = [...rawValues];
1418
+ let valueIndex = 0;
1419
+ let valueBeforeIndex = 0; // Record the index which value < newValue
1420
+ let valueDist = mergedMax - mergedMin;
1421
+ rawValues.forEach((val, index) => {
1422
+ const dist = Math.abs(newValue - val);
1423
+ if (dist <= valueDist) {
1424
+ valueDist = dist;
1425
+ valueIndex = index;
1426
+ }
1427
+ if (val < newValue) {
1428
+ valueBeforeIndex = index;
1429
+ }
1430
+ });
1431
+ let focusIndex = valueIndex;
1432
+ if (rangeEditable && valueDist !== 0 && (!maxCount || rawValues.length < maxCount)) {
1433
+ cloneNextValues.splice(valueBeforeIndex + 1, 0, newValue);
1434
+ focusIndex = valueBeforeIndex + 1;
1435
+ } else {
1436
+ cloneNextValues[valueIndex] = newValue;
1437
+ }
1438
+
1439
+ // Fill value to match default 2 (only when `rawValues` is empty)
1440
+ if (rangeEnabled && !rawValues.length && count === undefined) {
1441
+ cloneNextValues.push(newValue);
1442
+ }
1443
+ const nextValue = getTriggerValue(cloneNextValues);
1444
+ onBeforeChange?.(nextValue);
1445
+ triggerChange(cloneNextValues);
1446
+ if (e) {
1447
+ document.activeElement?.blur?.();
1448
+ handlesRef.current.focus(focusIndex);
1449
+ onStartDrag(e, focusIndex, cloneNextValues);
1450
+ } else {
1451
+ // https://github.com/ant-design/ant-design/issues/49997
1452
+ onAfterChange?.(nextValue);
1453
+ warningOnce(!onAfterChange, '[rc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.');
1454
+ onChangeComplete?.(nextValue);
1455
+ }
1456
+ }
1457
+ };
1458
+
1459
+ // ============================ Click =============================
1460
+ const onSliderMouseDown = e => {
1461
+ e.preventDefault();
1462
+ const {
1463
+ width,
1464
+ height,
1465
+ left,
1466
+ top,
1467
+ bottom,
1468
+ right
1469
+ } = containerRef.current.getBoundingClientRect();
1470
+ const {
1471
+ clientX,
1472
+ clientY
1473
+ } = e;
1474
+ let percent;
1475
+ switch (direction) {
1476
+ case 'btt':
1477
+ percent = (bottom - clientY) / height;
1478
+ break;
1479
+ case 'ttb':
1480
+ percent = (clientY - top) / height;
1481
+ break;
1482
+ case 'rtl':
1483
+ percent = (right - clientX) / width;
1484
+ break;
1485
+ default:
1486
+ percent = (clientX - left) / width;
1487
+ }
1488
+ const nextValue = mergedMin + percent * (mergedMax - mergedMin);
1489
+ changeToCloseValue(formatValue(nextValue), e);
1490
+ };
1491
+
1492
+ // =========================== Keyboard ===========================
1493
+ const [keyboardValue, setKeyboardValue] = React.useState(null);
1494
+ const onHandleOffsetChange = (offset, valueIndex) => {
1495
+ if (!disabled) {
1496
+ const next = offsetValues(rawValues, offset, valueIndex);
1497
+ onBeforeChange?.(getTriggerValue(rawValues));
1498
+ triggerChange(next.values);
1499
+ setKeyboardValue(next.value);
1500
+ }
1501
+ };
1502
+ React.useEffect(() => {
1503
+ if (keyboardValue !== null) {
1504
+ const valueIndex = rawValues.indexOf(keyboardValue);
1505
+ if (valueIndex >= 0) {
1506
+ handlesRef.current.focus(valueIndex);
1507
+ }
1508
+ }
1509
+ setKeyboardValue(null);
1510
+ }, [keyboardValue]);
1511
+
1512
+ // ============================= Drag =============================
1513
+ const mergedDraggableTrack = React.useMemo(() => {
1514
+ if (rangeDraggableTrack && mergedStep === null) {
1515
+ if (process.env.NODE_ENV !== 'production') {
1516
+ warningOnce(false, '`draggableTrack` is not supported when `step` is `null`.');
1517
+ }
1518
+ return false;
1519
+ }
1520
+ return rangeDraggableTrack;
1521
+ }, [rangeDraggableTrack, mergedStep]);
1522
+ const onStartMove = useEvent((e, valueIndex) => {
1523
+ onStartDrag(e, valueIndex);
1524
+ onBeforeChange?.(getTriggerValue(rawValues));
1525
+ });
1526
+
1527
+ // Auto focus for updated handle
1528
+ const dragging = draggingIndex !== -1;
1529
+ React.useEffect(() => {
1530
+ if (!dragging) {
1531
+ const valueIndex = rawValues.lastIndexOf(draggingValue);
1532
+ handlesRef.current.focus(valueIndex);
1533
+ }
1534
+ }, [dragging]);
1535
+
1536
+ // =========================== Included ===========================
1537
+ const sortedCacheValues = React.useMemo(() => [...cacheValues].sort((a, b) => a - b), [cacheValues]);
1538
+
1539
+ // Provide a range values with included [min, max]
1540
+ // Used for Track, Mark & Dot
1541
+ const [includedStart, includedEnd] = React.useMemo(() => {
1542
+ if (!rangeEnabled) {
1543
+ return [mergedMin, sortedCacheValues[0]];
1544
+ }
1545
+ return [sortedCacheValues[0], sortedCacheValues[sortedCacheValues.length - 1]];
1546
+ }, [sortedCacheValues, rangeEnabled, mergedMin]);
1547
+
1548
+ // ============================= Refs =============================
1549
+ React.useImperativeHandle(ref, () => ({
1550
+ focus: () => {
1551
+ handlesRef.current.focus(0);
1552
+ },
1553
+ blur: () => {
1554
+ const {
1555
+ activeElement
1556
+ } = document;
1557
+ if (containerRef.current?.contains(activeElement)) {
1558
+ activeElement?.blur();
1559
+ }
1560
+ }
1561
+ }));
1562
+
1563
+ // ========================== Auto Focus ==========================
1564
+ React.useEffect(() => {
1565
+ if (autoFocus) {
1566
+ handlesRef.current.focus(0);
1567
+ }
1568
+ }, []);
1569
+
1570
+ // =========================== Context ============================
1571
+ const context = React.useMemo(() => ({
1572
+ min: mergedMin,
1573
+ max: mergedMax,
1574
+ direction,
1575
+ disabled,
1576
+ keyboard,
1577
+ step: mergedStep,
1578
+ included,
1579
+ includedStart,
1580
+ includedEnd,
1581
+ range: rangeEnabled,
1582
+ tabIndex,
1583
+ ariaLabelForHandle,
1584
+ ariaLabelledByForHandle,
1585
+ ariaRequired,
1586
+ ariaValueTextFormatterForHandle,
1587
+ styles: styles || {},
1588
+ classNames: classNames || {}
1589
+ }), [mergedMin, mergedMax, direction, disabled, keyboard, mergedStep, included, includedStart, includedEnd, rangeEnabled, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle, styles, classNames]);
1590
+
1591
+ // ============================ Render ============================
1592
+ return /*#__PURE__*/React.createElement(SliderContext.Provider, {
1593
+ value: context
1594
+ }, /*#__PURE__*/React.createElement("div", {
1595
+ ref: containerRef,
1596
+ className: cls(prefixCls, className, {
1597
+ [`${prefixCls}-disabled`]: disabled,
1598
+ [`${prefixCls}-vertical`]: vertical,
1599
+ [`${prefixCls}-horizontal`]: !vertical,
1600
+ [`${prefixCls}-with-marks`]: markList.length
1601
+ }),
1602
+ style: style,
1603
+ onMouseDown: onSliderMouseDown,
1604
+ id: id
1605
+ }, /*#__PURE__*/React.createElement("div", {
1606
+ className: cls(`${prefixCls}-rail`, classNames?.rail),
1607
+ style: {
1608
+ ...railStyle,
1609
+ ...styles?.rail
1610
+ }
1611
+ }), track !== false && /*#__PURE__*/React.createElement(Tracks, {
1612
+ prefixCls: prefixCls,
1613
+ style: trackStyle,
1614
+ values: rawValues,
1615
+ startPoint: startPoint,
1616
+ onStartMove: mergedDraggableTrack ? onStartMove : undefined
1617
+ }), /*#__PURE__*/React.createElement(Steps, {
1618
+ prefixCls: prefixCls,
1619
+ marks: markList,
1620
+ dots: dots,
1621
+ style: dotStyle,
1622
+ activeStyle: activeDotStyle
1623
+ }), /*#__PURE__*/React.createElement(Handles, {
1624
+ ref: handlesRef,
1625
+ prefixCls: prefixCls,
1626
+ style: handleStyle,
1627
+ values: cacheValues,
1628
+ draggingIndex: draggingIndex,
1629
+ draggingDelete: draggingDelete,
1630
+ onStartMove: onStartMove,
1631
+ onOffsetChange: onHandleOffsetChange,
1632
+ onFocus: onFocus,
1633
+ onBlur: onBlur,
1634
+ handleRender: handleRender,
1635
+ activeHandleRender: activeHandleRender,
1636
+ onChangeComplete: finishChange,
1637
+ onDelete: rangeEditable ? onDelete : undefined
1638
+ }), /*#__PURE__*/React.createElement(Marks, {
1639
+ prefixCls: prefixCls,
1640
+ marks: markList,
1641
+ onClick: changeToCloseValue
1642
+ })));
1643
+ });
1644
+ if (process.env.NODE_ENV !== 'production') {
1645
+ Slider.displayName = 'Slider';
1646
+ }
1647
+
1648
+ function SliderStyles(_a) {
1649
+ var _b = _a.customStyles, customStyles = _b === void 0 ? {} : _b;
1650
+ return (jsxs(Fragment, { children: [jsx(Global, { styles: customStyles }), jsx(Global, { styles: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .rc-slider {\n position: relative;\n width: 100%;\n height: 14px;\n padding: 5px 0;\n border-radius: 6px;\n touch-action: none;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-rail {\n position: absolute;\n width: 100%;\n height: 4px;\n background-color: #e9e9e9;\n border-radius: 6px;\n }\n .rc-slider-track {\n position: absolute;\n height: 4px;\n background-color: #abe2fb;\n border-radius: 6px;\n }\n .rc-slider-handle {\n position: absolute;\n width: 14px;\n height: 14px;\n margin-top: -5px;\n background-color: #fff;\n border: solid 2px #96dbfa;\n border-radius: 50%;\n cursor: pointer;\n cursor: -webkit-grab;\n cursor: grab;\n opacity: 0.8;\n touch-action: pan-x;\n }\n .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging {\n border-color: #57c5f7;\n box-shadow: 0 0 0 5px #96dbfa;\n }\n .rc-slider-handle:focus {\n outline: none;\n box-shadow: none;\n }\n .rc-slider-handle:focus-visible {\n border-color: #2db7f5;\n box-shadow: 0 0 0 3px #96dbfa;\n }\n .rc-slider-handle-click-focused:focus {\n border-color: #96dbfa;\n box-shadow: unset;\n }\n .rc-slider-handle:hover {\n border-color: #57c5f7;\n }\n .rc-slider-handle:active {\n border-color: #57c5f7;\n box-shadow: 0 0 5px #57c5f7;\n cursor: -webkit-grabbing;\n cursor: grabbing;\n }\n .rc-slider-mark {\n position: absolute;\n top: 18px;\n left: 0;\n width: 100%;\n font-size: 12px;\n }\n .rc-slider-mark-text {\n position: absolute;\n display: inline-block;\n color: #999;\n text-align: center;\n vertical-align: middle;\n cursor: pointer;\n }\n .rc-slider-mark-text-active {\n color: #666;\n }\n .rc-slider-step {\n position: absolute;\n width: 100%;\n height: 4px;\n background: transparent;\n pointer-events: none;\n }\n .rc-slider-dot {\n position: absolute;\n bottom: -2px;\n width: 8px;\n height: 8px;\n vertical-align: middle;\n background-color: #fff;\n border: 2px solid #e9e9e9;\n border-radius: 50%;\n cursor: pointer;\n }\n .rc-slider-dot-active {\n border-color: #96dbfa;\n }\n .rc-slider-dot-reverse {\n margin-right: -4px;\n }\n .rc-slider-disabled {\n background-color: #e9e9e9;\n }\n .rc-slider-disabled .rc-slider-track {\n background-color: #ccc;\n }\n .rc-slider-disabled .rc-slider-handle,\n .rc-slider-disabled .rc-slider-dot {\n background-color: #fff;\n border-color: #ccc;\n box-shadow: none;\n cursor: not-allowed;\n }\n .rc-slider-disabled .rc-slider-mark-text,\n .rc-slider-disabled .rc-slider-dot {\n cursor: not-allowed !important;\n }\n .rc-slider-vertical {\n width: 14px;\n height: 100%;\n padding: 0 5px;\n }\n .rc-slider-vertical .rc-slider-rail {\n width: 4px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-track {\n bottom: 0;\n left: 5px;\n width: 4px;\n }\n .rc-slider-vertical .rc-slider-handle {\n margin-top: 0;\n margin-left: -5px;\n touch-action: pan-y;\n }\n .rc-slider-vertical .rc-slider-mark {\n top: 0;\n left: 18px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-step {\n width: 4px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-dot {\n margin-left: -2px;\n }\n .rc-slider-tooltip-zoom-down-enter,\n .rc-slider-tooltip-zoom-down-appear {\n display: block !important;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-play-state: paused;\n }\n .rc-slider-tooltip-zoom-down-leave {\n display: block !important;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-play-state: paused;\n }\n .rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active,\n .rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active {\n animation-name: rcSliderTooltipZoomDownIn;\n animation-play-state: running;\n }\n .rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active {\n animation-name: rcSliderTooltipZoomDownOut;\n animation-play-state: running;\n }\n .rc-slider-tooltip-zoom-down-enter,\n .rc-slider-tooltip-zoom-down-appear {\n transform: scale(0, 0);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n }\n .rc-slider-tooltip-zoom-down-leave {\n animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);\n }\n @keyframes rcSliderTooltipZoomDownIn {\n 0% {\n transform: scale(0, 0);\n transform-origin: 50% 100%;\n opacity: 0;\n }\n 100% {\n transform: scale(1, 1);\n transform-origin: 50% 100%;\n }\n }\n @keyframes rcSliderTooltipZoomDownOut {\n 0% {\n transform: scale(1, 1);\n transform-origin: 50% 100%;\n }\n 100% {\n transform: scale(0, 0);\n transform-origin: 50% 100%;\n opacity: 0;\n }\n }\n .rc-slider-tooltip {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: visible;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-tooltip * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-tooltip-hidden {\n display: none;\n }\n .rc-slider-tooltip-placement-top {\n padding: 4px 0 8px 0;\n }\n .rc-slider-tooltip-inner {\n min-width: 24px;\n height: 24px;\n padding: 6px 2px;\n color: #fff;\n font-size: 12px;\n line-height: 1;\n text-align: center;\n text-decoration: none;\n background-color: #6c6c6c;\n border-radius: 6px;\n box-shadow: 0 0 4px #d9d9d9;\n }\n .rc-slider-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow {\n bottom: 4px;\n left: 50%;\n margin-left: -4px;\n border-width: 4px 4px 0;\n border-top-color: #6c6c6c;\n }\n "], ["\n .rc-slider {\n position: relative;\n width: 100%;\n height: 14px;\n padding: 5px 0;\n border-radius: 6px;\n touch-action: none;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-rail {\n position: absolute;\n width: 100%;\n height: 4px;\n background-color: #e9e9e9;\n border-radius: 6px;\n }\n .rc-slider-track {\n position: absolute;\n height: 4px;\n background-color: #abe2fb;\n border-radius: 6px;\n }\n .rc-slider-handle {\n position: absolute;\n width: 14px;\n height: 14px;\n margin-top: -5px;\n background-color: #fff;\n border: solid 2px #96dbfa;\n border-radius: 50%;\n cursor: pointer;\n cursor: -webkit-grab;\n cursor: grab;\n opacity: 0.8;\n touch-action: pan-x;\n }\n .rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging {\n border-color: #57c5f7;\n box-shadow: 0 0 0 5px #96dbfa;\n }\n .rc-slider-handle:focus {\n outline: none;\n box-shadow: none;\n }\n .rc-slider-handle:focus-visible {\n border-color: #2db7f5;\n box-shadow: 0 0 0 3px #96dbfa;\n }\n .rc-slider-handle-click-focused:focus {\n border-color: #96dbfa;\n box-shadow: unset;\n }\n .rc-slider-handle:hover {\n border-color: #57c5f7;\n }\n .rc-slider-handle:active {\n border-color: #57c5f7;\n box-shadow: 0 0 5px #57c5f7;\n cursor: -webkit-grabbing;\n cursor: grabbing;\n }\n .rc-slider-mark {\n position: absolute;\n top: 18px;\n left: 0;\n width: 100%;\n font-size: 12px;\n }\n .rc-slider-mark-text {\n position: absolute;\n display: inline-block;\n color: #999;\n text-align: center;\n vertical-align: middle;\n cursor: pointer;\n }\n .rc-slider-mark-text-active {\n color: #666;\n }\n .rc-slider-step {\n position: absolute;\n width: 100%;\n height: 4px;\n background: transparent;\n pointer-events: none;\n }\n .rc-slider-dot {\n position: absolute;\n bottom: -2px;\n width: 8px;\n height: 8px;\n vertical-align: middle;\n background-color: #fff;\n border: 2px solid #e9e9e9;\n border-radius: 50%;\n cursor: pointer;\n }\n .rc-slider-dot-active {\n border-color: #96dbfa;\n }\n .rc-slider-dot-reverse {\n margin-right: -4px;\n }\n .rc-slider-disabled {\n background-color: #e9e9e9;\n }\n .rc-slider-disabled .rc-slider-track {\n background-color: #ccc;\n }\n .rc-slider-disabled .rc-slider-handle,\n .rc-slider-disabled .rc-slider-dot {\n background-color: #fff;\n border-color: #ccc;\n box-shadow: none;\n cursor: not-allowed;\n }\n .rc-slider-disabled .rc-slider-mark-text,\n .rc-slider-disabled .rc-slider-dot {\n cursor: not-allowed !important;\n }\n .rc-slider-vertical {\n width: 14px;\n height: 100%;\n padding: 0 5px;\n }\n .rc-slider-vertical .rc-slider-rail {\n width: 4px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-track {\n bottom: 0;\n left: 5px;\n width: 4px;\n }\n .rc-slider-vertical .rc-slider-handle {\n margin-top: 0;\n margin-left: -5px;\n touch-action: pan-y;\n }\n .rc-slider-vertical .rc-slider-mark {\n top: 0;\n left: 18px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-step {\n width: 4px;\n height: 100%;\n }\n .rc-slider-vertical .rc-slider-dot {\n margin-left: -2px;\n }\n .rc-slider-tooltip-zoom-down-enter,\n .rc-slider-tooltip-zoom-down-appear {\n display: block !important;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-play-state: paused;\n }\n .rc-slider-tooltip-zoom-down-leave {\n display: block !important;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-play-state: paused;\n }\n .rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active,\n .rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active {\n animation-name: rcSliderTooltipZoomDownIn;\n animation-play-state: running;\n }\n .rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active {\n animation-name: rcSliderTooltipZoomDownOut;\n animation-play-state: running;\n }\n .rc-slider-tooltip-zoom-down-enter,\n .rc-slider-tooltip-zoom-down-appear {\n transform: scale(0, 0);\n animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);\n }\n .rc-slider-tooltip-zoom-down-leave {\n animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);\n }\n @keyframes rcSliderTooltipZoomDownIn {\n 0% {\n transform: scale(0, 0);\n transform-origin: 50% 100%;\n opacity: 0;\n }\n 100% {\n transform: scale(1, 1);\n transform-origin: 50% 100%;\n }\n }\n @keyframes rcSliderTooltipZoomDownOut {\n 0% {\n transform: scale(1, 1);\n transform-origin: 50% 100%;\n }\n 100% {\n transform: scale(0, 0);\n transform-origin: 50% 100%;\n opacity: 0;\n }\n }\n .rc-slider-tooltip {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: visible;\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-tooltip * {\n box-sizing: border-box;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n .rc-slider-tooltip-hidden {\n display: none;\n }\n .rc-slider-tooltip-placement-top {\n padding: 4px 0 8px 0;\n }\n .rc-slider-tooltip-inner {\n min-width: 24px;\n height: 24px;\n padding: 6px 2px;\n color: #fff;\n font-size: 12px;\n line-height: 1;\n text-align: center;\n text-decoration: none;\n background-color: #6c6c6c;\n border-radius: 6px;\n box-shadow: 0 0 4px #d9d9d9;\n }\n .rc-slider-tooltip-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border-color: transparent;\n border-style: solid;\n }\n .rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow {\n bottom: 4px;\n left: 50%;\n margin-left: -4px;\n border-width: 4px 4px 0;\n border-top-color: #6c6c6c;\n }\n "]))) })] }));
1651
+ }
1652
+ var templateObject_1;
1653
+
1654
+ export { SliderStyles as S, Slider as a };