@rpcbase/ui 0.182.0 → 0.184.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 (652) hide show
  1. package/dist/helpers/index.d.ts +1 -0
  2. package/dist/helpers/index.d.ts.map +1 -1
  3. package/dist/helpers/useScrollPagination.d.ts +23 -0
  4. package/dist/helpers/useScrollPagination.d.ts.map +1 -0
  5. package/dist/helpers/useScrollPagination.test.d.ts +2 -0
  6. package/dist/helpers/useScrollPagination.test.d.ts.map +1 -0
  7. package/dist/index.js +62 -60
  8. package/dist/index.js.map +1 -1
  9. package/dist/index10.js +24 -69
  10. package/dist/index10.js.map +1 -1
  11. package/dist/index100.js +4 -3
  12. package/dist/index100.js.map +1 -1
  13. package/dist/index101.js +5 -4
  14. package/dist/index101.js.map +1 -1
  15. package/dist/index102.js +4 -6
  16. package/dist/index102.js.map +1 -1
  17. package/dist/index103.js +4 -145
  18. package/dist/index103.js.map +1 -1
  19. package/dist/index104.js +6 -39
  20. package/dist/index104.js.map +1 -1
  21. package/dist/index105.js +24 -4
  22. package/dist/index105.js.map +1 -1
  23. package/dist/index106.js +6 -7
  24. package/dist/index106.js.map +1 -1
  25. package/dist/index107.js +4 -13
  26. package/dist/index107.js.map +1 -1
  27. package/dist/index108.js +6 -13
  28. package/dist/index108.js.map +1 -1
  29. package/dist/index109.js +5 -7
  30. package/dist/index109.js.map +1 -1
  31. package/dist/index11.js +38 -552
  32. package/dist/index11.js.map +1 -1
  33. package/dist/index110.js +4 -31
  34. package/dist/index110.js.map +1 -1
  35. package/dist/index111.js +5 -10
  36. package/dist/index111.js.map +1 -1
  37. package/dist/index112.js +4 -10
  38. package/dist/index112.js.map +1 -1
  39. package/dist/index113.js +8 -8
  40. package/dist/index113.js.map +1 -1
  41. package/dist/index114.js +5 -13
  42. package/dist/index114.js.map +1 -1
  43. package/dist/index115.js +4 -101
  44. package/dist/index115.js.map +1 -1
  45. package/dist/index116.js +5 -20
  46. package/dist/index116.js.map +1 -1
  47. package/dist/index117.js +6 -53
  48. package/dist/index117.js.map +1 -1
  49. package/dist/index118.js +145 -72
  50. package/dist/index118.js.map +1 -1
  51. package/dist/index119.js +39 -9
  52. package/dist/index119.js.map +1 -1
  53. package/dist/index12.js +571 -115
  54. package/dist/index12.js.map +1 -1
  55. package/dist/index120.js +4 -20
  56. package/dist/index120.js.map +1 -1
  57. package/dist/index121.js +7 -16
  58. package/dist/index121.js.map +1 -1
  59. package/dist/index122.js +13 -23
  60. package/dist/index122.js.map +1 -1
  61. package/dist/index123.js +13 -6
  62. package/dist/index123.js.map +1 -1
  63. package/dist/index124.js +7 -5
  64. package/dist/index124.js.map +1 -1
  65. package/dist/index125.js +31 -23
  66. package/dist/index125.js.map +1 -1
  67. package/dist/index126.js +11 -35
  68. package/dist/index126.js.map +1 -1
  69. package/dist/index127.js +11 -16
  70. package/dist/index127.js.map +1 -1
  71. package/dist/index128.js +8 -6
  72. package/dist/index128.js.map +1 -1
  73. package/dist/index129.js +13 -4
  74. package/dist/index129.js.map +1 -1
  75. package/dist/index13.js +137 -76
  76. package/dist/index13.js.map +1 -1
  77. package/dist/index130.js +101 -4
  78. package/dist/index130.js.map +1 -1
  79. package/dist/index131.js +20 -5
  80. package/dist/index131.js.map +1 -1
  81. package/dist/index132.js +53 -4
  82. package/dist/index132.js.map +1 -1
  83. package/dist/index133.js +72 -3
  84. package/dist/index133.js.map +1 -1
  85. package/dist/index134.js +9 -6
  86. package/dist/index134.js.map +1 -1
  87. package/dist/index135.js +21 -24
  88. package/dist/index135.js.map +1 -1
  89. package/dist/index136.js +16 -7
  90. package/dist/index136.js.map +1 -1
  91. package/dist/index137.js +23 -6
  92. package/dist/index137.js.map +1 -1
  93. package/dist/index138.js +6 -5
  94. package/dist/index138.js.map +1 -1
  95. package/dist/index139.js +5 -3
  96. package/dist/index139.js.map +1 -1
  97. package/dist/index14.js +74 -730
  98. package/dist/index14.js.map +1 -1
  99. package/dist/index140.js +23 -3
  100. package/dist/index140.js.map +1 -1
  101. package/dist/index141.js +35 -5
  102. package/dist/index141.js.map +1 -1
  103. package/dist/index142.js +16 -4
  104. package/dist/index142.js.map +1 -1
  105. package/dist/index143.js +6 -4
  106. package/dist/index143.js.map +1 -1
  107. package/dist/index144.js +4 -3
  108. package/dist/index144.js.map +1 -1
  109. package/dist/index145.js +4 -3
  110. package/dist/index145.js.map +1 -1
  111. package/dist/index146.js +4 -3
  112. package/dist/index146.js.map +1 -1
  113. package/dist/index147.js +4 -46
  114. package/dist/index147.js.map +1 -1
  115. package/dist/index148.js +3 -46
  116. package/dist/index148.js.map +1 -1
  117. package/dist/index149.js +6 -205
  118. package/dist/index149.js.map +1 -1
  119. package/dist/index15.js +870 -22
  120. package/dist/index15.js.map +1 -1
  121. package/dist/index150.js +24 -22
  122. package/dist/index150.js.map +1 -1
  123. package/dist/index151.js +7 -24
  124. package/dist/index151.js.map +1 -1
  125. package/dist/index152.js +6 -399
  126. package/dist/index152.js.map +1 -1
  127. package/dist/index153.js +5 -5
  128. package/dist/index153.js.map +1 -1
  129. package/dist/index154.js +3 -68
  130. package/dist/index154.js.map +1 -1
  131. package/dist/index155.js +4 -2
  132. package/dist/index155.js.map +1 -1
  133. package/dist/index156.js +4 -363
  134. package/dist/index156.js.map +1 -1
  135. package/dist/index157.js +3 -261
  136. package/dist/index157.js.map +1 -1
  137. package/dist/index158.js +4 -60
  138. package/dist/index158.js.map +1 -1
  139. package/dist/index159.js +3 -46
  140. package/dist/index159.js.map +1 -1
  141. package/dist/index16.js +20 -17
  142. package/dist/index16.js.map +1 -1
  143. package/dist/index160.js +3 -169
  144. package/dist/index160.js.map +1 -1
  145. package/dist/index161.js +3 -109
  146. package/dist/index161.js.map +1 -1
  147. package/dist/index162.js +5 -24
  148. package/dist/index162.js.map +1 -1
  149. package/dist/index163.js +69 -8
  150. package/dist/index163.js.map +1 -1
  151. package/dist/index164.js +2 -5
  152. package/dist/index164.js.map +1 -1
  153. package/dist/index165.js +363 -5
  154. package/dist/index165.js.map +1 -1
  155. package/dist/index166.js +261 -4
  156. package/dist/index166.js.map +1 -1
  157. package/dist/index167.js +52 -458
  158. package/dist/index167.js.map +1 -1
  159. package/dist/index168.js +42 -181
  160. package/dist/index168.js.map +1 -1
  161. package/dist/index169.js +156 -94
  162. package/dist/index169.js.map +1 -1
  163. package/dist/index17.js +18 -387
  164. package/dist/index17.js.map +1 -1
  165. package/dist/index170.js +102 -255
  166. package/dist/index170.js.map +1 -1
  167. package/dist/index171.js +24 -9
  168. package/dist/index171.js.map +1 -1
  169. package/dist/index172.js +8 -43
  170. package/dist/index172.js.map +1 -1
  171. package/dist/index173.js +4 -4
  172. package/dist/index173.js.map +1 -1
  173. package/dist/index174.js +5 -605
  174. package/dist/index174.js.map +1 -1
  175. package/dist/index175.js +4 -58
  176. package/dist/index175.js.map +1 -1
  177. package/dist/index176.js +466 -8
  178. package/dist/index176.js.map +1 -1
  179. package/dist/index177.js +178 -59
  180. package/dist/index177.js.map +1 -1
  181. package/dist/index178.js +105 -17
  182. package/dist/index178.js.map +1 -1
  183. package/dist/index179.js +260 -14
  184. package/dist/index179.js.map +1 -1
  185. package/dist/index18.js +431 -693
  186. package/dist/index18.js.map +1 -1
  187. package/dist/index180.js +9 -5
  188. package/dist/index180.js.map +1 -1
  189. package/dist/index181.js +41 -4
  190. package/dist/index181.js.map +1 -1
  191. package/dist/index182.js +4 -6
  192. package/dist/index182.js.map +1 -1
  193. package/dist/index183.js +24 -4
  194. package/dist/index183.js.map +1 -1
  195. package/dist/index184.js +29 -8
  196. package/dist/index184.js.map +1 -1
  197. package/dist/index185.js +5 -18
  198. package/dist/index185.js.map +1 -1
  199. package/dist/index186.js +67 -5
  200. package/dist/index186.js.map +1 -1
  201. package/dist/index187.js +180 -5
  202. package/dist/index187.js.map +1 -1
  203. package/dist/index188.js +46 -13
  204. package/dist/index188.js.map +1 -1
  205. package/dist/index189.js +58 -10
  206. package/dist/index189.js.map +1 -1
  207. package/dist/index19.js +661 -634
  208. package/dist/index19.js.map +1 -1
  209. package/dist/index190.js +8 -14
  210. package/dist/index190.js.map +1 -1
  211. package/dist/index191.js +66 -14
  212. package/dist/index191.js.map +1 -1
  213. package/dist/index192.js +19 -5
  214. package/dist/index192.js.map +1 -1
  215. package/dist/index193.js +16 -6
  216. package/dist/index193.js.map +1 -1
  217. package/dist/index194.js +5 -7
  218. package/dist/index194.js.map +1 -1
  219. package/dist/index195.js +5 -6
  220. package/dist/index195.js.map +1 -1
  221. package/dist/index196.js +6 -9
  222. package/dist/index196.js.map +1 -1
  223. package/dist/index197.js +4 -5
  224. package/dist/index197.js.map +1 -1
  225. package/dist/index198.js +7 -5
  226. package/dist/index198.js.map +1 -1
  227. package/dist/index199.js +17 -9
  228. package/dist/index199.js.map +1 -1
  229. package/dist/index2.js +2 -2
  230. package/dist/index20.js +455 -198
  231. package/dist/index20.js.map +1 -1
  232. package/dist/index200.js +5 -5
  233. package/dist/index200.js.map +1 -1
  234. package/dist/index201.js +5 -5
  235. package/dist/index201.js.map +1 -1
  236. package/dist/index202.js +13 -4
  237. package/dist/index202.js.map +1 -1
  238. package/dist/index203.js +9 -10
  239. package/dist/index203.js.map +1 -1
  240. package/dist/index204.js +14 -10
  241. package/dist/index204.js.map +1 -1
  242. package/dist/index205.js +14 -10
  243. package/dist/index205.js.map +1 -1
  244. package/dist/index206.js +5 -11
  245. package/dist/index206.js.map +1 -1
  246. package/dist/index207.js +6 -11
  247. package/dist/index207.js.map +1 -1
  248. package/dist/index208.js +6 -9
  249. package/dist/index208.js.map +1 -1
  250. package/dist/index209.js +6 -7
  251. package/dist/index209.js.map +1 -1
  252. package/dist/index21.js +263 -5
  253. package/dist/index21.js.map +1 -1
  254. package/dist/index210.js +9 -6
  255. package/dist/index210.js.map +1 -1
  256. package/dist/index211.js +5 -5
  257. package/dist/index211.js.map +1 -1
  258. package/dist/index212.js +5 -6
  259. package/dist/index212.js.map +1 -1
  260. package/dist/index213.js +9 -7
  261. package/dist/index213.js.map +1 -1
  262. package/dist/index214.js +5 -6
  263. package/dist/index214.js.map +1 -1
  264. package/dist/index215.js +5 -55
  265. package/dist/index215.js.map +1 -1
  266. package/dist/index216.js +4 -16
  267. package/dist/index216.js.map +1 -1
  268. package/dist/index217.js +11 -7
  269. package/dist/index217.js.map +1 -1
  270. package/dist/index218.js +10 -10
  271. package/dist/index218.js.map +1 -1
  272. package/dist/index219.js +10 -10
  273. package/dist/index219.js.map +1 -1
  274. package/dist/index22.js +5 -35
  275. package/dist/index22.js.map +1 -1
  276. package/dist/index220.js +11 -21
  277. package/dist/index220.js.map +1 -1
  278. package/dist/index221.js +11 -10
  279. package/dist/index221.js.map +1 -1
  280. package/dist/index222.js +10 -9
  281. package/dist/index222.js.map +1 -1
  282. package/dist/index223.js +7 -9
  283. package/dist/index223.js.map +1 -1
  284. package/dist/index224.js +6 -4
  285. package/dist/index224.js.map +1 -1
  286. package/dist/index225.js +5 -5
  287. package/dist/index225.js.map +1 -1
  288. package/dist/index226.js +6 -16
  289. package/dist/index226.js.map +1 -1
  290. package/dist/index227.js +7 -9
  291. package/dist/index227.js.map +1 -1
  292. package/dist/index228.js +6 -18
  293. package/dist/index228.js.map +1 -1
  294. package/dist/index229.js +54 -14
  295. package/dist/index229.js.map +1 -1
  296. package/dist/index23.js +27 -268
  297. package/dist/index23.js.map +1 -1
  298. package/dist/index230.js +16 -12
  299. package/dist/index230.js.map +1 -1
  300. package/dist/index231.js +7 -29
  301. package/dist/index231.js.map +1 -1
  302. package/dist/index232.js +9 -11
  303. package/dist/index232.js.map +1 -1
  304. package/dist/index233.js +9 -24
  305. package/dist/index233.js.map +1 -1
  306. package/dist/index234.js +21 -5
  307. package/dist/index234.js.map +1 -1
  308. package/dist/index235.js +10 -24
  309. package/dist/index235.js.map +1 -1
  310. package/dist/index236.js +10 -29
  311. package/dist/index236.js.map +1 -1
  312. package/dist/index237.js +10 -5
  313. package/dist/index237.js.map +1 -1
  314. package/dist/index238.js +4 -13
  315. package/dist/index238.js.map +1 -1
  316. package/dist/index239.js +5 -154
  317. package/dist/index239.js.map +1 -1
  318. package/dist/index24.js +251 -166
  319. package/dist/index24.js.map +1 -1
  320. package/dist/index240.js +15 -29
  321. package/dist/index240.js.map +1 -1
  322. package/dist/index241.js +9 -9
  323. package/dist/index241.js.map +1 -1
  324. package/dist/index242.js +18 -47
  325. package/dist/index242.js.map +1 -1
  326. package/dist/index243.js +15 -11
  327. package/dist/index243.js.map +1 -1
  328. package/dist/index244.js +12 -44
  329. package/dist/index244.js.map +1 -1
  330. package/dist/index245.js +28 -94
  331. package/dist/index245.js.map +1 -1
  332. package/dist/index246.js +11 -85
  333. package/dist/index246.js.map +1 -1
  334. package/dist/index247.js +23 -103
  335. package/dist/index247.js.map +1 -1
  336. package/dist/index248.js +5 -52
  337. package/dist/index248.js.map +1 -1
  338. package/dist/index249.js +13 -11
  339. package/dist/index249.js.map +1 -1
  340. package/dist/index25.js +176 -14
  341. package/dist/index25.js.map +1 -1
  342. package/dist/index250.js +149 -32
  343. package/dist/index250.js.map +1 -1
  344. package/dist/index251.js +30 -8
  345. package/dist/index251.js.map +1 -1
  346. package/dist/index252.js +9 -116
  347. package/dist/index252.js.map +1 -1
  348. package/dist/index253.js +46 -16
  349. package/dist/index253.js.map +1 -1
  350. package/dist/index254.js +11 -15
  351. package/dist/index254.js.map +1 -1
  352. package/dist/index255.js +44 -3
  353. package/dist/index255.js.map +1 -1
  354. package/dist/index256.js +91 -32
  355. package/dist/index256.js.map +1 -1
  356. package/dist/index257.js +85 -19
  357. package/dist/index257.js.map +1 -1
  358. package/dist/index258.js +105 -9
  359. package/dist/index258.js.map +1 -1
  360. package/dist/index259.js +52 -8
  361. package/dist/index259.js.map +1 -1
  362. package/dist/index26.js +15 -2763
  363. package/dist/index26.js.map +1 -1
  364. package/dist/index260.js +10 -18
  365. package/dist/index260.js.map +1 -1
  366. package/dist/index261.js +36 -27
  367. package/dist/index261.js.map +1 -1
  368. package/dist/index262.js +8 -16
  369. package/dist/index262.js.map +1 -1
  370. package/dist/index263.js +3 -67
  371. package/dist/index263.js.map +1 -1
  372. package/dist/index264.js +9 -180
  373. package/dist/index264.js.map +1 -1
  374. package/dist/index265.js +110 -40
  375. package/dist/index265.js.map +1 -1
  376. package/dist/index266.js +17 -4
  377. package/dist/index266.js.map +1 -1
  378. package/dist/index267.js +15 -18
  379. package/dist/index267.js.map +1 -1
  380. package/dist/index268.js +36 -12
  381. package/dist/index268.js.map +1 -1
  382. package/dist/index269.js +21 -5
  383. package/dist/index269.js.map +1 -1
  384. package/dist/index27.js +2761 -35
  385. package/dist/index27.js.map +1 -1
  386. package/dist/index270.js +9 -3
  387. package/dist/index270.js.map +1 -1
  388. package/dist/index271.js +19 -23
  389. package/dist/index271.js.map +1 -1
  390. package/dist/index272.js +26 -110
  391. package/dist/index272.js.map +1 -1
  392. package/dist/index273.js +16 -15
  393. package/dist/index273.js.map +1 -1
  394. package/dist/index274.js +5 -525
  395. package/dist/index274.js.map +1 -1
  396. package/dist/index275.js +3 -128
  397. package/dist/index275.js.map +1 -1
  398. package/dist/index276.js +22 -132
  399. package/dist/index276.js.map +1 -1
  400. package/dist/index277.js +111 -19
  401. package/dist/index277.js.map +1 -1
  402. package/dist/index278.js +15 -5
  403. package/dist/index278.js.map +1 -1
  404. package/dist/index279.js +524 -5
  405. package/dist/index279.js.map +1 -1
  406. package/dist/index28.js +2 -2
  407. package/dist/index280.js +128 -4
  408. package/dist/index280.js.map +1 -1
  409. package/dist/index281.js +132 -14
  410. package/dist/index281.js.map +1 -1
  411. package/dist/index282.js +4 -8
  412. package/dist/index282.js.map +1 -1
  413. package/dist/index283.js +19 -6
  414. package/dist/index283.js.map +1 -1
  415. package/dist/index284.js +12 -4
  416. package/dist/index284.js.map +1 -1
  417. package/dist/index285.js +19 -544
  418. package/dist/index285.js.map +1 -1
  419. package/dist/index286.js +65 -43
  420. package/dist/index286.js.map +1 -1
  421. package/dist/index287.js +9 -18
  422. package/dist/index287.js.map +1 -1
  423. package/dist/index288.js +14 -7
  424. package/dist/index288.js.map +1 -1
  425. package/dist/index289.js +66 -9
  426. package/dist/index289.js.map +1 -1
  427. package/dist/index29.js +33 -121
  428. package/dist/index29.js.map +1 -1
  429. package/dist/index290.js +64 -7
  430. package/dist/index290.js.map +1 -1
  431. package/dist/index291.js +5 -8
  432. package/dist/index291.js.map +1 -1
  433. package/dist/index292.js +5 -12
  434. package/dist/index292.js.map +1 -1
  435. package/dist/index293.js +4 -10
  436. package/dist/index293.js.map +1 -1
  437. package/dist/index294.js +15 -13
  438. package/dist/index294.js.map +1 -1
  439. package/dist/index295.js +8 -64
  440. package/dist/index295.js.map +1 -1
  441. package/dist/index296.js +6 -69
  442. package/dist/index296.js.map +1 -1
  443. package/dist/index297.js +5 -9
  444. package/dist/index297.js.map +1 -1
  445. package/dist/index298.js +545 -13
  446. package/dist/index298.js.map +1 -1
  447. package/dist/index299.js +45 -64
  448. package/dist/index299.js.map +1 -1
  449. package/dist/index3.js.map +1 -1
  450. package/dist/index30.js +3 -232
  451. package/dist/index30.js.map +1 -1
  452. package/dist/index300.js +17 -4
  453. package/dist/index300.js.map +1 -1
  454. package/dist/index301.js +7 -56
  455. package/dist/index301.js.map +1 -1
  456. package/dist/index302.js +9 -68
  457. package/dist/index302.js.map +1 -1
  458. package/dist/index303.js +8 -31
  459. package/dist/index303.js.map +1 -1
  460. package/dist/index304.js +9 -9
  461. package/dist/index304.js.map +1 -1
  462. package/dist/index305.js +13 -153
  463. package/dist/index305.js.map +1 -1
  464. package/dist/index306.js +10 -108
  465. package/dist/index306.js.map +1 -1
  466. package/dist/index307.js +13 -3
  467. package/dist/index307.js.map +1 -1
  468. package/dist/index308.js +3 -22
  469. package/dist/index308.js.map +1 -1
  470. package/dist/index309.js +22 -15
  471. package/dist/index309.js.map +1 -1
  472. package/dist/index31.js +123 -22
  473. package/dist/index31.js.map +1 -1
  474. package/dist/index310.js +4 -28
  475. package/dist/index310.js.map +1 -1
  476. package/dist/index311.js +56 -13
  477. package/dist/index311.js.map +1 -1
  478. package/dist/index312.js +68 -7
  479. package/dist/index312.js.map +1 -1
  480. package/dist/index313.js +30 -22
  481. package/dist/index313.js.map +1 -1
  482. package/dist/index314.js +9 -13
  483. package/dist/index314.js.map +1 -1
  484. package/dist/index315.js +151 -26
  485. package/dist/index315.js.map +1 -1
  486. package/dist/index316.js +107 -4
  487. package/dist/index316.js.map +1 -1
  488. package/dist/index317.js +26 -0
  489. package/dist/index317.js.map +1 -0
  490. package/dist/index318.js +16 -0
  491. package/dist/index318.js.map +1 -0
  492. package/dist/index319.js +31 -0
  493. package/dist/index319.js.map +1 -0
  494. package/dist/index32.js +230 -49
  495. package/dist/index32.js.map +1 -1
  496. package/dist/index320.js +8 -0
  497. package/dist/index320.js.map +1 -0
  498. package/dist/index321.js +19 -0
  499. package/dist/index321.js.map +1 -0
  500. package/dist/index322.js +32 -0
  501. package/dist/index322.js.map +1 -0
  502. package/dist/index323.js +16 -0
  503. package/dist/index323.js.map +1 -0
  504. package/dist/index324.js +10 -0
  505. package/dist/index324.js.map +1 -0
  506. package/dist/index33.js +20 -2637
  507. package/dist/index33.js.map +1 -1
  508. package/dist/index34.js +47 -390
  509. package/dist/index34.js.map +1 -1
  510. package/dist/index35.js +2604 -196
  511. package/dist/index35.js.map +1 -1
  512. package/dist/index36.js +390 -18
  513. package/dist/index36.js.map +1 -1
  514. package/dist/index37.js +222 -131
  515. package/dist/index37.js.map +1 -1
  516. package/dist/index38.js +18 -183
  517. package/dist/index38.js.map +1 -1
  518. package/dist/index39.js +118 -65
  519. package/dist/index39.js.map +1 -1
  520. package/dist/index4.js +17 -15
  521. package/dist/index4.js.map +1 -1
  522. package/dist/index40.js +216 -93
  523. package/dist/index40.js.map +1 -1
  524. package/dist/index41.js +90 -5
  525. package/dist/index41.js.map +1 -1
  526. package/dist/index42.js +115 -840
  527. package/dist/index42.js.map +1 -1
  528. package/dist/index43.js +6 -66
  529. package/dist/index43.js.map +1 -1
  530. package/dist/index44.js +843 -7
  531. package/dist/index44.js.map +1 -1
  532. package/dist/index45.js +57 -2
  533. package/dist/index45.js.map +1 -1
  534. package/dist/index46.js +7 -23
  535. package/dist/index46.js.map +1 -1
  536. package/dist/index47.js +2 -234
  537. package/dist/index47.js.map +1 -1
  538. package/dist/index48.js +11 -6
  539. package/dist/index48.js.map +1 -1
  540. package/dist/index49.js +18 -33
  541. package/dist/index49.js.map +1 -1
  542. package/dist/index5.js +34 -34
  543. package/dist/index5.js.map +1 -1
  544. package/dist/index50.js +7 -26
  545. package/dist/index50.js.map +1 -1
  546. package/dist/index51.js +2 -8
  547. package/dist/index51.js.map +1 -1
  548. package/dist/index52.js +22 -10
  549. package/dist/index52.js.map +1 -1
  550. package/dist/index53.js +233 -3
  551. package/dist/index53.js.map +1 -1
  552. package/dist/index54.js +201 -44
  553. package/dist/index54.js.map +1 -1
  554. package/dist/index55.js +3 -50
  555. package/dist/index55.js.map +1 -1
  556. package/dist/index56.js +6 -7
  557. package/dist/index56.js.map +1 -1
  558. package/dist/index57.js +47 -14
  559. package/dist/index57.js.map +1 -1
  560. package/dist/index58.js +22 -129
  561. package/dist/index58.js.map +1 -1
  562. package/dist/index59.js +50 -10
  563. package/dist/index59.js.map +1 -1
  564. package/dist/index6.js +172 -25
  565. package/dist/index6.js.map +1 -1
  566. package/dist/index60.js +7 -216
  567. package/dist/index60.js.map +1 -1
  568. package/dist/index61.js +15 -13
  569. package/dist/index61.js.map +1 -1
  570. package/dist/index62.js +128 -41
  571. package/dist/index62.js.map +1 -1
  572. package/dist/index63.js +9 -48
  573. package/dist/index63.js.map +1 -1
  574. package/dist/index64.js +216 -3
  575. package/dist/index64.js.map +1 -1
  576. package/dist/index65.js +13 -6
  577. package/dist/index65.js.map +1 -1
  578. package/dist/index66.js +34 -28
  579. package/dist/index66.js.map +1 -1
  580. package/dist/index67.js +46 -49
  581. package/dist/index67.js.map +1 -1
  582. package/dist/index68.js +8 -9
  583. package/dist/index68.js.map +1 -1
  584. package/dist/index69.js +50 -2
  585. package/dist/index69.js.map +1 -1
  586. package/dist/index7.js +31 -29
  587. package/dist/index7.js.map +1 -1
  588. package/dist/index70.js +4 -2
  589. package/dist/index70.js.map +1 -1
  590. package/dist/index71.js +6 -205
  591. package/dist/index71.js.map +1 -1
  592. package/dist/index72.js +28 -54
  593. package/dist/index72.js.map +1 -1
  594. package/dist/index73.js +50 -6
  595. package/dist/index73.js.map +1 -1
  596. package/dist/index74.js +9 -8
  597. package/dist/index74.js.map +1 -1
  598. package/dist/index75.js +2 -6
  599. package/dist/index75.js.map +1 -1
  600. package/dist/index76.js +2 -52
  601. package/dist/index76.js.map +1 -1
  602. package/dist/index77.js +11 -4
  603. package/dist/index77.js.map +1 -1
  604. package/dist/index78.js +5 -4
  605. package/dist/index78.js.map +1 -1
  606. package/dist/index79.js +7 -15
  607. package/dist/index79.js.map +1 -1
  608. package/dist/index8.js +25 -222
  609. package/dist/index8.js.map +1 -1
  610. package/dist/index80.js +5 -5
  611. package/dist/index80.js.map +1 -1
  612. package/dist/index81.js +2 -8
  613. package/dist/index81.js.map +1 -1
  614. package/dist/index82.js +2 -17
  615. package/dist/index82.js.map +1 -1
  616. package/dist/index83.js +53 -4
  617. package/dist/index83.js.map +1 -1
  618. package/dist/index84.js +46 -4
  619. package/dist/index84.js.map +1 -1
  620. package/dist/index85.js +205 -5
  621. package/dist/index85.js.map +1 -1
  622. package/dist/index86.js +22 -6
  623. package/dist/index86.js.map +1 -1
  624. package/dist/index87.js +24 -4
  625. package/dist/index87.js.map +1 -1
  626. package/dist/index88.js +399 -4
  627. package/dist/index88.js.map +1 -1
  628. package/dist/index89.js +46 -6
  629. package/dist/index89.js.map +1 -1
  630. package/dist/index9.js +177 -23
  631. package/dist/index9.js.map +1 -1
  632. package/dist/index90.js +604 -23
  633. package/dist/index90.js.map +1 -1
  634. package/dist/index91.js +52 -7
  635. package/dist/index91.js.map +1 -1
  636. package/dist/index92.js +3 -3
  637. package/dist/index92.js.map +1 -1
  638. package/dist/index93.js +4 -6
  639. package/dist/index93.js.map +1 -1
  640. package/dist/index94.js +15 -5
  641. package/dist/index94.js.map +1 -1
  642. package/dist/index95.js +5 -4
  643. package/dist/index95.js.map +1 -1
  644. package/dist/index96.js +7 -5
  645. package/dist/index96.js.map +1 -1
  646. package/dist/index97.js +16 -4
  647. package/dist/index97.js.map +1 -1
  648. package/dist/index98.js +4 -8
  649. package/dist/index98.js.map +1 -1
  650. package/dist/index99.js +4 -5
  651. package/dist/index99.js.map +1 -1
  652. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index20.js","sources":["../src/components/Select/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\"\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\n\nconst Select = SelectPrimitive.Root\nconst SelectGroup = SelectPrimitive.Group\nconst SelectValue = SelectPrimitive.Value\n\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst ScrollContext = React.createContext<{\n viewport: HTMLElement | null\n setViewport: (vp: HTMLElement | null) => void\n} | null>(null)\n\ninterface ScrollButtonImplProps extends React.HTMLAttributes<HTMLDivElement> {\n direction: \"up\" | \"down\"\n speed?: number\n}\n\nconst ScrollButtonImpl = React.forwardRef<HTMLDivElement, ScrollButtonImplProps>(\n ({ direction, speed = 400, className, children, ...rest }, ref) => {\n const scrollContext = React.useContext(ScrollContext)\n const [disabled, setDisabled] = React.useState(true)\n const animationRef = React.useRef<number | undefined>(undefined)\n const lastTimeRef = React.useRef<number | undefined>(undefined)\n const isScrollingRef = React.useRef(false)\n\n const viewport = scrollContext?.viewport\n\n const checkScrollability = React.useCallback(() => {\n if (!viewport) {\n setDisabled(true)\n return\n }\n\n const { scrollTop, scrollHeight, clientHeight } = viewport\n const tolerance = 2\n\n const canScrollUp = scrollTop > tolerance\n const canScrollDown = scrollTop < (scrollHeight - clientHeight - tolerance)\n const hasScrollableContent = scrollHeight > clientHeight + tolerance\n\n if (!hasScrollableContent) {\n setDisabled(true)\n return\n }\n\n const shouldDisable = direction === \"up\" ? !canScrollUp : !canScrollDown\n setDisabled(shouldDisable)\n }, [viewport, direction])\n\n React.useEffect(() => {\n if (!viewport) return\n\n checkScrollability()\n\n const handleScroll = () => checkScrollability()\n const handleResize = () => checkScrollability()\n\n viewport.addEventListener(\"scroll\", handleScroll, { passive: true })\n\n const resizeObserver = new ResizeObserver(handleResize)\n resizeObserver.observe(viewport)\n\n const mutationObserver = new MutationObserver(handleResize)\n mutationObserver.observe(viewport, { childList: true, subtree: true })\n\n return () => {\n viewport.removeEventListener(\"scroll\", handleScroll)\n resizeObserver.disconnect()\n mutationObserver.disconnect()\n }\n }, [viewport, checkScrollability])\n\n const stopScrolling = React.useCallback(() => {\n if (animationRef.current) {\n cancelAnimationFrame(animationRef.current)\n animationRef.current = undefined\n }\n isScrollingRef.current = false\n lastTimeRef.current = undefined\n }, [])\n\n const smoothScroll = React.useCallback(\n (currentTime: number) => {\n if (!viewport || disabled || !isScrollingRef.current) {\n stopScrolling()\n return\n }\n\n if (!lastTimeRef.current) {\n lastTimeRef.current = currentTime\n }\n\n const deltaTime = currentTime - lastTimeRef.current\n const distance = (speed * deltaTime) / 1000\n\n if (distance < 0.1) {\n animationRef.current = requestAnimationFrame(smoothScroll)\n return\n }\n\n const oldScrollTop = viewport.scrollTop\n const maxScroll = viewport.scrollHeight - viewport.clientHeight\n\n let newScrollTop: number\n if (direction === \"up\") {\n newScrollTop = Math.max(0, oldScrollTop - distance)\n } else {\n newScrollTop = Math.min(maxScroll, oldScrollTop + distance)\n }\n\n viewport.scrollTo({ top: newScrollTop })\n\n lastTimeRef.current = currentTime\n\n const tolerance = 1\n const canContinue =\n direction === \"up\"\n ? newScrollTop > tolerance\n : newScrollTop < (maxScroll - tolerance)\n\n if (canContinue && Math.abs(newScrollTop - oldScrollTop) > 0.01) {\n animationRef.current = requestAnimationFrame(smoothScroll)\n } else {\n stopScrolling()\n setTimeout(checkScrollability, 16)\n }\n },\n [viewport, disabled, direction, speed, stopScrolling, checkScrollability],\n )\n\n const startScrolling = React.useCallback(() => {\n if (disabled || !viewport || isScrollingRef.current) return\n\n isScrollingRef.current = true\n lastTimeRef.current = undefined\n animationRef.current = requestAnimationFrame(smoothScroll)\n }, [disabled, viewport, smoothScroll])\n\n React.useEffect(() => {\n return () => stopScrolling()\n }, [stopScrolling])\n\n return (\n <div\n {...rest}\n ref={ref}\n className={cn(\n \"flex items-center justify-center py-1 select-none\",\n disabled ? \"cursor-default opacity-40\" : \"cursor-pointer opacity-100 hover:bg-accent/20\",\n className\n )}\n onPointerEnter={e => {\n rest.onPointerEnter?.(e)\n if (!disabled) startScrolling()\n }}\n onPointerMove={e => {\n rest.onPointerMove?.(e)\n if (!disabled && !isScrollingRef.current) startScrolling()\n }}\n onPointerLeave={e => {\n rest.onPointerLeave?.(e)\n stopScrolling()\n }}\n >\n {children}\n </div>\n )\n }\n)\nScrollButtonImpl.displayName = \"ScrollButtonImpl\"\n\nconst SelectScrollUpButton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <ScrollButtonImpl ref={ref} direction=\"up\" className={className} {...props}>\n <ChevronUp className=\"h-4 w-4\" />\n </ScrollButtonImpl>\n))\nSelectScrollUpButton.displayName = \"SelectScrollUpButton\"\n\nconst SelectScrollDownButton = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <ScrollButtonImpl ref={ref} direction=\"down\" className={className} {...props}>\n <ChevronDown className=\"h-4 w-4\" />\n </ScrollButtonImpl>\n))\nSelectScrollDownButton.displayName = \"SelectScrollDownButton\"\n\ntype SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n autoScroll?: \"firstEnabled\" | \"firstEnabledWithContext\"\n}\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n SelectContentProps\n>(({ className, children, position = \"popper\", autoScroll, ...props }, ref) => {\n const [viewport, setViewport] = React.useState<HTMLElement | null>(null)\n const viewportRef = React.useCallback((node: HTMLElement | null) => {\n setViewport(node)\n }, [])\n\n React.useEffect(() => {\n if (!viewport || !autoScroll) return\n\n const run = () => {\n const selected = viewport.querySelector(\"[role=\\\"option\\\"][data-state=\\\"checked\\\"]\")\n if (selected instanceof HTMLElement) {\n const padding = 8\n const targetTop = selected.offsetTop - padding\n const targetBottom = selected.offsetTop + selected.offsetHeight + padding\n\n if (targetTop < viewport.scrollTop) {\n viewport.scrollTo({ top: Math.max(0, targetTop) })\n return\n }\n\n const viewportBottom = viewport.scrollTop + viewport.clientHeight\n if (targetBottom > viewportBottom) {\n viewport.scrollTo({ top: Math.max(0, targetBottom - viewport.clientHeight) })\n }\n return\n }\n\n const all = Array.from(\n viewport.querySelectorAll(\"[role=\\\"option\\\"]\")\n ) as HTMLElement[]\n if (!all.length) return\n\n let firstEnabled: HTMLElement | undefined\n let lastDisabledBefore: HTMLElement | undefined\n for (const el of all) {\n const isDisabled = el.hasAttribute(\"data-disabled\")\n if (!isDisabled) {\n firstEnabled = el\n break\n }\n lastDisabledBefore = el\n }\n\n if (!firstEnabled) return\n\n const target =\n autoScroll === \"firstEnabledWithContext\" && lastDisabledBefore\n ? lastDisabledBefore\n : firstEnabled\n\n const offset = Math.max(0, target.offsetTop - 8)\n viewport.scrollTo({ top: offset })\n }\n\n const raf = requestAnimationFrame(run)\n return () => cancelAnimationFrame(raf)\n }, [viewport, autoScroll])\n\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n \"relative z-[60] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <ScrollContext.Provider value={{ viewport, setViewport }}>\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n ref={viewportRef}\n className={cn(\n \"p-1 overflow-y-auto\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </ScrollContext.Provider>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n})\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n {...props}\n />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n}\n"],"names":["Select","SelectPrimitive.Root","SelectGroup","SelectPrimitive.Group","SelectValue","SelectPrimitive.Value","SelectTrigger","React","className","children","props","ref","jsxs","SelectPrimitive.Trigger","cn","jsx","SelectPrimitive.Icon","ChevronDown","ScrollContext","ScrollButtonImpl","direction","speed","rest","scrollContext","disabled","setDisabled","animationRef","lastTimeRef","isScrollingRef","viewport","checkScrollability","scrollTop","scrollHeight","clientHeight","tolerance","canScrollUp","canScrollDown","handleScroll","handleResize","resizeObserver","mutationObserver","stopScrolling","smoothScroll","currentTime","deltaTime","distance","oldScrollTop","maxScroll","newScrollTop","startScrolling","e","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","SelectContent","position","autoScroll","setViewport","viewportRef","node","raf","selected","targetTop","targetBottom","viewportBottom","all","firstEnabled","lastDisabledBefore","el","offset","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Viewport","SelectLabel","SelectPrimitive.Label","SelectItem","SelectPrimitive.Item","SelectPrimitive.ItemIndicator","Check","SelectPrimitive.ItemText","SelectSeparator","SelectPrimitive.Separator"],"mappings":";;;;;AAOA,MAAMA,KAASC,GACTC,KAAcC,GACdC,KAAcC,GAGdC,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MACpCC,gBAAAA,EAAAA;AAAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWG;AAAA,MACT;AAAA,MACAN;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEH,UAAA;AAAA,MAAAD;AAAA,MACDM,gBAAAA,EAAAA,IAACC,GAAA,EAAqB,SAAO,IAC3B,UAAAD,gBAAAA,EAAAA,IAACE,GAAA,EAAY,WAAU,qBAAA,CAAqB,EAAA,CAC9C;AAAA,IAAA;AAAA,EAAA;AACF,CACD;AACDX,EAAc,cAAcO,EAAwB;AAEpD,MAAMK,IAAgBX,EAAM,cAGlB,IAAI,GAORY,IAAmBZ,EAAM;AAAA,EAC7B,CAAC,EAAE,WAAAa,GAAW,OAAAC,IAAQ,KAAK,WAAAb,GAAW,UAAAC,GAAU,GAAGa,EAAA,GAAQX,MAAQ;AACjE,UAAMY,IAAgBhB,EAAM,WAAWW,CAAa,GAC9C,CAACM,GAAUC,CAAW,IAAIlB,EAAM,SAAS,EAAI,GAC7CmB,IAAenB,EAAM,OAA2B,MAAS,GACzDoB,IAAcpB,EAAM,OAA2B,MAAS,GACxDqB,IAAiBrB,EAAM,OAAO,EAAK,GAEnCsB,IAAWN,GAAe,UAE1BO,IAAqBvB,EAAM,YAAY,MA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EAAW,cAAcC,EAAqB;AAE9C,MAAMI,IAAkBzE,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAA,GAASC,MAC1BI,gBAAAA,EAAAA;AAAAA,EAACkE;AAAAA,EAAA;AAAA,IACC,KAAAtE;AAAA,IACA,WAAWG,EAAG,4BAA4BN,CAAS;AAAA,IAClD,GAAGE;AAAA,EAAA;AACN,CACD;AACDsE,EAAgB,cAAcC,EAA0B;"}
1
+ {"version":3,"file":"index20.js","sources":["../src/components/PhoneNumberInput/index.tsx"],"sourcesContent":["import * as React from \"react\"\nimport type { CountryCode } from \"libphonenumber-js\"\nimport { getCountryCallingCode } from \"libphonenumber-js\"\nimport Select, {\n type Props as SelectProps,\n type SingleValue,\n type StylesConfig,\n} from \"react-select\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputProps,\n PhoneNumberSelectedCountry,\n} from \"./types\"\nimport { resolveMessages } from \"./messages\"\nimport {\n DEFAULT_COUNTRY,\n COMMON_IDD_PREFIXES,\n buildFallbackSelectedCountry,\n getCachedCountryOptions,\n getLocaleCacheKey,\n getValidCountry,\n normalizeSearchValue,\n optionMatchIndex,\n parseLocaleCacheKey,\n toSelectedCountry,\n} from \"./country-options\"\nimport {\n detectNationalPrefixForDisplay,\n formatWithAsYouType,\n getLengthIssue,\n getSuggestionState,\n injectNationalPrefixDisplay,\n normalizeInputValue,\n sanitizeDigits,\n shouldDisplayExplicitCountrySelection,\n stripPrefix,\n type LengthIssue,\n} from \"./normalization\"\nimport {\n captureSelectionSnapshot,\n resolveSelection,\n skipFormattingCharactersLeft,\n skipFormattingCharactersRight,\n} from \"./selection\"\nimport {\n HiddenControl,\n NullComponent,\n SuggestionContext,\n SuggestionOption,\n formatCountryOption,\n suggestionSelectStyles,\n type SuggestionContextValue,\n} from \"./suggestions\"\n\n\nexport type {\n CountryOption,\n PhoneNumberChangeDetails,\n PhoneNumberInputMessages,\n PhoneNumberInputProps,\n PhoneNumberInputValidationCode,\n PhoneNumberSelectedCountry,\n} from \"./types\"\n\nexport const PhoneNumberInput = React.forwardRef<HTMLInputElement, PhoneNumberInputProps>(\n function PhoneNumberInput(props, forwardedRef) {\n const {\n value,\n defaultCountry,\n country: countryProp,\n locale,\n onChange,\n onCountryChange,\n className,\n inputClassName,\n disabled,\n readOnly,\n selectProps,\n autofillShimName,\n messages: messagesProp,\n renderValidationMessage,\n ...restProps\n } = props\n\n const {\n onFocus: onInputFocus,\n onBlur: onInputBlur,\n onKeyDown: onInputKeyDown,\n name: inputName,\n autoComplete: inputAutoComplete,\n ...restInputProps\n } = restProps\n\n const hasConfiguredCountry =\n typeof defaultCountry === \"string\" || typeof countryProp === \"string\"\n\n const localeCacheKey = getLocaleCacheKey(locale)\n const localeForBuild = React.useMemo(\n () => parseLocaleCacheKey(localeCacheKey),\n [localeCacheKey]\n )\n const resolvedMessages = React.useMemo(\n () => resolveMessages(localeForBuild, messagesProp),\n [localeForBuild, messagesProp]\n )\n const countryOptions = React.useMemo(\n () => getCachedCountryOptions(localeForBuild, localeCacheKey),\n [localeCacheKey, localeForBuild]\n )\n const resolveSelectedCountry = React.useCallback(\n (country: CountryCode): PhoneNumberSelectedCountry => {\n const match = countryOptions.find((candidate) => candidate.value === country)\n if (match) {\n return toSelectedCountry(match)\n }\n return buildFallbackSelectedCountry(country)\n },\n [countryOptions]\n )\n const fallbackCountry = React.useMemo(() => {\n const candidate = getValidCountry(defaultCountry ?? countryProp ?? DEFAULT_COUNTRY)\n if (countryOptions.some((option) => option.value === candidate)) {\n return candidate\n }\n return countryOptions[0]?.value ?? DEFAULT_COUNTRY\n }, [countryOptions, countryProp, defaultCountry])\n\n const hasResolvedCountryRef = React.useRef<boolean>(hasConfiguredCountry)\n\n const initialStateRef = React.useRef<{\n country: CountryCode\n inputValue: string\n normalizedValue: string\n hasExplicitCountrySelection: boolean\n } | null>(null)\n const lastNormalizedRef = React.useRef<string>(\"\")\n\n if (!initialStateRef.current) {\n if (!value) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const baseCountryForInit = hasConfiguredCountry ? fallbackCountry : undefined\n const normalized = normalizeInputValue(value, baseCountryForInit, { allowJustPlus: true })\n if (!normalized) {\n initialStateRef.current = {\n country: fallbackCountry,\n inputValue: \"\",\n normalizedValue: \"\",\n hasExplicitCountrySelection: false,\n }\n lastNormalizedRef.current = \"\"\n } else {\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInit)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let resolvedCountry = canonicalDetectedCountry ?? fallbackCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(resolvedCountry)\n const initialHasPrefix = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInit,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasPrefix,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n\n\n if (inferredCountryToApply) {\n resolvedCountry = inferredCountryToApply\n }\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n const nextDialCode = getCountryCallingCode(resolvedCountry)\n const finalHasPrefix = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasPrefix\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: finalHasPrefix,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const allowInlineFlag = hasResolvedCountryRef.current\n initialStateRef.current = {\n country: resolvedCountry,\n inputValue: displayValue,\n normalizedValue: normalized,\n hasExplicitCountrySelection:\n allowInlineFlag &&\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n }),\n }\n lastNormalizedRef.current = normalized\n }\n }\n }\n\n const initialState = initialStateRef.current\n\n const [uncontrolledCountry, setUncontrolledCountry] = React.useState(initialState.country)\n const [inputValueState, setInputValueState] = React.useState(initialState.inputValue)\n const [countryQuery, setCountryQuery] = React.useState(\"\")\n const [showSuggestions, setShowSuggestions] = React.useState(false)\n const [highlightedIndex, setHighlightedIndex] = React.useState<number>(-1)\n const [isFocused, setIsFocused] = React.useState(false)\n const [lengthIssue, setLengthIssue] = React.useState<LengthIssue | null>(null)\n const [hasExplicitCountrySelection, setHasExplicitCountrySelection] = React.useState(\n initialState.hasExplicitCountrySelection\n )\n const manualSelectionCountryRef = React.useRef<CountryCode | null>(null)\n\n const keyboardBufferRef = React.useRef(\"\")\n const bufferTimeoutRef = React.useRef<number | null>(null)\n const scrollBehaviorRef = React.useRef<ScrollBehavior>(\"smooth\")\n const pendingSelectionRef = React.useRef<{ start: number; end: number } | null>(null)\n const consumeScrollBehavior = React.useCallback(() => {\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n return behavior\n }, [])\n\n const isCountryControlled = typeof countryProp === \"string\"\n const selectedCountry = isCountryControlled ? countryProp : uncontrolledCountry\n const activeCountry = selectedCountry ?? fallbackCountry\n\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n React.useImperativeHandle(forwardedRef, () => inputRef.current as HTMLInputElement, [])\n\n React.useLayoutEffect(() => {\n const selection = pendingSelectionRef.current\n if (!selection) {\n return\n }\n\n const input = inputRef.current\n pendingSelectionRef.current = null\n if (!input) {\n return\n }\n\n const { start, end } = selection\n input.setSelectionRange(start, end)\n }, [inputValueState])\n\n const selectOverrides = selectProps ?? {}\n const {\n styles: userSelectStyles,\n components: userSelectComponents,\n classNamePrefix: userClassNamePrefix,\n formatOptionLabel: userFormatOptionLabel,\n ...forwardedSelectProps\n } = selectOverrides\n const { noOptionsMessage, ...restForwardedSelectProps } = forwardedSelectProps\n\n const mergedSelectStyles = React.useMemo<StylesConfig<CountryOption, false>>(\n () => ({\n ...suggestionSelectStyles,\n ...(userSelectStyles ?? {}),\n }),\n [userSelectStyles]\n )\n\n const mergedSelectComponents = React.useMemo(() => {\n const baseComponents = {\n Control: HiddenControl,\n IndicatorsContainer: NullComponent,\n DropdownIndicator: NullComponent,\n IndicatorSeparator: NullComponent,\n ValueContainer: NullComponent,\n }\n\n const overrides = userSelectComponents ?? {}\n\n if (!overrides.Option) {\n return {\n ...baseComponents,\n ...overrides,\n Option: SuggestionOption,\n }\n }\n\n return {\n ...baseComponents,\n ...overrides,\n }\n }, [userSelectComponents])\n\n const hasAnnouncedCountryRef = React.useRef(false)\n\n const notifyCountryChange = React.useCallback(\n (country: CountryCode) => {\n hasAnnouncedCountryRef.current = true\n const selection = resolveSelectedCountry(country)\n onCountryChange?.(country, selection)\n return selection\n },\n [onCountryChange, resolveSelectedCountry]\n )\n\n React.useEffect(() => () => {\n if (bufferTimeoutRef.current != null && typeof window !== \"undefined\") {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n }, [])\n\n React.useEffect(() => {\n if (value == null) {\n return\n }\n\n const baseCountryForSync = hasResolvedCountryRef.current ? activeCountry : undefined\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(value, baseCountryForSync, {\n allowJustPlus: true,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n keyboardBufferRef.current = \"\"\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n return\n }\n\n const {\n international,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForSync)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForSync ?? activeCountry\n const rawDigits = sanitizeDigits(value ?? \"\")\n const hasExplicitPlus = typeof value === \"string\" ? /^\\s*\\+/.test(value) : false\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForSync,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromValue =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromValue) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n rawDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n }, [\n value,\n activeCountry,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ])\n\n React.useEffect(() => {\n if (hasAnnouncedCountryRef.current) {\n return\n }\n if (!hasResolvedCountryRef.current) {\n return\n }\n const current = selectedCountry ?? fallbackCountry\n if (!current) {\n return\n }\n notifyCountryChange(current)\n }, [fallbackCountry, notifyCountryChange, selectedCountry])\n\n React.useEffect(() => {\n if (isCountryControlled && countryProp && countryProp !== uncontrolledCountry) {\n setUncontrolledCountry(countryProp)\n }\n }, [countryProp, isCountryControlled, uncontrolledCountry])\n\n const emitChange = React.useCallback(\n (details: Omit<PhoneNumberChangeDetails, \"selectedCountry\">) => {\n const selection = resolveSelectedCountry(details.country)\n onChange?.({\n ...details,\n selectedCountry: selection,\n })\n },\n [onChange, resolveSelectedCountry]\n )\n\n const scheduleBufferReset = React.useCallback(() => {\n if (typeof window === \"undefined\") {\n return\n }\n\n if (bufferTimeoutRef.current != null) {\n window.clearTimeout(bufferTimeoutRef.current)\n }\n\n bufferTimeoutRef.current = window.setTimeout(() => {\n keyboardBufferRef.current = \"\"\n bufferTimeoutRef.current = null\n }, 800)\n }, [])\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const target = event.target\n const snapshot = captureSelectionSnapshot(target)\n const raw = target.value\n keyboardBufferRef.current = \"\"\n\n const baseCountryForInput = hasResolvedCountryRef.current ? activeCountry : undefined\n const dialCode = baseCountryForInput ? getCountryCallingCode(baseCountryForInput) : \"\"\n const typedDigits = sanitizeDigits(raw)\n const hasExplicitPlus = raw.trim().startsWith(\"+\")\n const startsWithDialCode = dialCode ? typedDigits.startsWith(dialCode) : false\n const hasLeadingZero = typedDigits.startsWith(\"0\")\n const isIddPrefix = COMMON_IDD_PREFIXES.some((prefix) => typedDigits.startsWith(prefix))\n\n const shouldRemoveNationalPrefix =\n Boolean(baseCountryForInput) &&\n !isIddPrefix &&\n ((startsWithDialCode && typedDigits.slice(dialCode.length).startsWith(\"0\")) ||\n (!hasExplicitPlus && hasLeadingZero && typedDigits.length > 1) ||\n (hasExplicitPlus && hasLeadingZero && typedDigits.length > 1 && !startsWithDialCode))\n\n const previousNormalized = lastNormalizedRef.current\n const normalized = normalizeInputValue(raw, baseCountryForInput, {\n allowJustPlus: true,\n removeNationalPrefix: shouldRemoveNationalPrefix,\n previousValue: previousNormalized,\n })\n lastNormalizedRef.current = normalized\n\n if (!normalized) {\n setInputValueState(\"\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"0\") {\n setInputValueState(\"0\")\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"0\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"0\",\n formattedNational: \"0\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"0\",\n rawInput: \"0\",\n isValid: false,\n })\n return\n }\n\n if (normalized === \"+\") {\n setInputValueState(\"+\")\n setShowSuggestions(true)\n setCountryQuery(\"\")\n setHighlightedIndex(0)\n setLengthIssue(null)\n manualSelectionCountryRef.current = null\n setHasExplicitCountrySelection(false)\n pendingSelectionRef.current = resolveSelection(snapshot, \"+\")\n\n const nextCountry = hasConfiguredCountry ? fallbackCountry : activeCountry\n\n if (!isCountryControlled && uncontrolledCountry !== nextCountry) {\n setUncontrolledCountry(nextCountry)\n notifyCountryChange(nextCountry)\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n emitChange({\n formattedInternational: \"+\",\n formattedNational: \"\",\n e164: null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: \"\",\n rawInput: \"+\",\n isValid: false,\n })\n return\n }\n\n const {\n international,\n national,\n phoneNumber,\n detectedCountry,\n inferredCountry,\n hasExplicitInternationalPrefix,\n } = formatWithAsYouType(normalized, baseCountryForInput)\n const canonicalDetectedCountry = detectedCountry ?? undefined\n let nextCountry = canonicalDetectedCountry ?? baseCountryForInput ?? activeCountry\n\n const internationalDigits = sanitizeDigits(international)\n const initialDialCode = getCountryCallingCode(nextCountry)\n const initialHasTypedTrunk = detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n initialDialCode,\n hasExplicitPlus\n )\n\n const suggestion = getSuggestionState(\n normalized,\n baseCountryForInput,\n phoneNumber ?? undefined,\n {\n hasRemovedNationalPrefix: initialHasTypedTrunk,\n detectedCountry: canonicalDetectedCountry,\n hasExplicitInternationalPrefix,\n }\n )\n\n const inferredCountryToApply =\n !suggestion.shouldSuggest && !canonicalDetectedCountry ? inferredCountry : undefined\n const finalCountry = inferredCountryToApply ?? nextCountry\n\n const resolvedFromInput =\n Boolean(canonicalDetectedCountry) || Boolean(inferredCountryToApply)\n if (resolvedFromInput) {\n hasResolvedCountryRef.current = true\n }\n\n if (!isCountryControlled && finalCountry !== uncontrolledCountry) {\n setUncontrolledCountry(finalCountry)\n notifyCountryChange(finalCountry)\n }\n\n nextCountry = finalCountry\n\n if (\n manualSelectionCountryRef.current &&\n manualSelectionCountryRef.current !== nextCountry\n ) {\n manualSelectionCountryRef.current = null\n }\n\n const nextDialCode = getCountryCallingCode(nextCountry)\n const normalizedDigits = sanitizeDigits(normalized)\n const nationalDigits = stripPrefix(normalizedDigits, nextDialCode)\n const hasTypedTrunk = inferredCountryToApply\n ? detectNationalPrefixForDisplay(\n typedDigits,\n internationalDigits,\n nextDialCode,\n hasExplicitPlus\n )\n : initialHasTypedTrunk\n\n const displayValue = injectNationalPrefixDisplay(international, nextDialCode, {\n force: hasTypedTrunk,\n })\n\n const displayDetectedCountry = canonicalDetectedCountry ?? undefined\n\n pendingSelectionRef.current = resolveSelection(snapshot, displayValue)\n setInputValueState(displayValue)\n setShowSuggestions(suggestion.shouldSuggest)\n setCountryQuery(suggestion.query)\n setHighlightedIndex(suggestion.shouldSuggest ? 0 : -1)\n setLengthIssue(hasResolvedCountryRef.current ? getLengthIssue(normalized, nextCountry) : null)\n const manualSelectionActive = manualSelectionCountryRef.current != null\n const shouldShowInlineFlag =\n manualSelectionActive ||\n shouldDisplayExplicitCountrySelection(suggestion, {\n detectedCountry: displayDetectedCountry,\n hasExplicitInternationalPrefix,\n })\n setHasExplicitCountrySelection(hasResolvedCountryRef.current && shouldShowInlineFlag)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: nextDialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n },\n [\n activeCountry,\n emitChange,\n fallbackCountry,\n hasConfiguredCountry,\n isCountryControlled,\n notifyCountryChange,\n uncontrolledCountry,\n ]\n )\n\n const handleCountrySelect = React.useCallback(\n (option: SingleValue<CountryOption>) => {\n if (!option) {\n return\n }\n\n const previousDigits = sanitizeDigits(lastNormalizedRef.current || inputValueState)\n const currentDial = getCountryCallingCode(activeCountry)\n const digitsWithoutCurrentDial = previousDigits.startsWith(currentDial)\n ? previousDigits.slice(currentDial.length)\n : previousDigits\n let rebasedDigits = digitsWithoutCurrentDial\n if (!rebasedDigits) {\n rebasedDigits = option.dialCode\n } else if (!rebasedDigits.startsWith(option.dialCode)) {\n rebasedDigits = `${option.dialCode}${rebasedDigits}`\n }\n const normalized = `+${rebasedDigits}`\n lastNormalizedRef.current = normalized\n const { international, national, phoneNumber } = formatWithAsYouType(\n normalized,\n option.value\n )\n const nextCountry = option.value\n manualSelectionCountryRef.current = nextCountry\n hasResolvedCountryRef.current = true\n\n setInputValueState(international)\n pendingSelectionRef.current = {\n start: international.length,\n end: international.length,\n }\n setShowSuggestions(false)\n setCountryQuery(\"\")\n setHighlightedIndex(-1)\n setLengthIssue(getLengthIssue(normalized, nextCountry))\n\n if (!isCountryControlled && nextCountry !== uncontrolledCountry) {\n setUncontrolledCountry(nextCountry)\n }\n\n notifyCountryChange(nextCountry)\n\n const normalizedDigits = sanitizeDigits(normalized)\n const dialCode = phoneNumber?.countryCallingCode ?? option.dialCode\n const nationalDigits = stripPrefix(normalizedDigits, dialCode)\n setHasExplicitCountrySelection(true)\n emitChange({\n formattedInternational: international,\n formattedNational: national,\n e164: phoneNumber?.number ?? null,\n country: nextCountry,\n countryCallingCode: dialCode,\n nationalNumber: nationalDigits,\n rawInput: normalized,\n isValid: phoneNumber?.isValid() ?? false,\n })\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n },\n [activeCountry, emitChange, inputValueState, isCountryControlled, notifyCountryChange, uncontrolledCountry]\n )\n\n const filteredOptions = React.useMemo(() => {\n if (!showSuggestions) {\n return [] as CountryOption[]\n }\n\n const results: CountryOption[] = []\n\n const pushUnique = (option: CountryOption) => {\n if (!results.some((existing) => existing.value === option.value)) {\n results.push(option)\n }\n }\n\n const fallbackOption = countryOptions.find((option) => option.value === fallbackCountry)\n const currentOption = countryOptions.find((option) => option.value === activeCountry)\n const query = countryQuery.trim()\n const digitQuery = sanitizeDigits(query)\n const normalizedQuery = normalizeSearchValue(query)\n\n if (!digitQuery && !normalizedQuery) {\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (currentOption) {\n pushUnique(currentOption)\n }\n countryOptions.forEach(pushUnique)\n return results\n }\n\n if (digitQuery) {\n const dialMatches = countryOptions\n .filter((option) => option.dialCode.startsWith(digitQuery))\n .sort((a, b) => {\n const aExact = a.dialCode === digitQuery\n const bExact = b.dialCode === digitQuery\n if (aExact && !bExact) {\n return -1\n }\n if (!aExact && bExact) {\n return 1\n }\n return a.dialCode.length - b.dialCode.length\n })\n dialMatches.forEach(pushUnique)\n }\n\n if (normalizedQuery) {\n const nameMatches = countryOptions\n .filter((option) =>\n option.normalizedSearchableTokens.some((token) => token.includes(normalizedQuery))\n )\n .sort((a, b) => {\n const aIndex = optionMatchIndex(a.normalizedSearchableTokens, normalizedQuery)\n const bIndex = optionMatchIndex(b.normalizedSearchableTokens, normalizedQuery)\n if (aIndex !== bIndex) {\n return aIndex - bIndex\n }\n return a.name.localeCompare(b.name)\n })\n nameMatches.forEach(pushUnique)\n }\n\n if (currentOption) {\n pushUnique(currentOption)\n }\n if (fallbackOption) {\n pushUnique(fallbackOption)\n }\n if (results.length === 0) {\n countryOptions.forEach(pushUnique)\n }\n\n return results\n }, [activeCountry, countryOptions, countryQuery, fallbackCountry, showSuggestions])\n\n const suggestionMenuIsOpen = isFocused && showSuggestions && filteredOptions.length > 0\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [suggestionMenuIsOpen])\n\n React.useEffect(() => {\n if (!suggestionMenuIsOpen) {\n setHighlightedIndex(-1)\n return\n }\n\n if (filteredOptions.length === 0) {\n setHighlightedIndex(-1)\n return\n }\n\n setHighlightedIndex((current) => {\n if (current < 0 || current >= filteredOptions.length) {\n return 0\n }\n return current\n })\n }, [filteredOptions, suggestionMenuIsOpen])\n\n const highlightedOption =\n highlightedIndex >= 0 ? filteredOptions[highlightedIndex] ?? null : null\n React.useEffect(() => {\n if (highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n }\n }, [highlightedIndex])\n\n const updateHighlightedOption = React.useCallback(\n (option: CountryOption) => {\n const index = filteredOptions.findIndex((candidate) => candidate.value === option.value)\n if (index !== -1) {\n setHighlightedIndex(index)\n }\n },\n [filteredOptions]\n )\n\n const selectFormatOptionLabel = React.useCallback<\n NonNullable<SelectProps<CountryOption, false>[\"formatOptionLabel\"]>\n >(\n (option, meta) => {\n if (userFormatOptionLabel) {\n return userFormatOptionLabel(option, meta)\n }\n return formatCountryOption(option)\n },\n [userFormatOptionLabel]\n )\n\n const optionLabelRenderer = React.useCallback(\n (option: CountryOption) =>\n selectFormatOptionLabel(option, {\n context: \"menu\",\n inputValue: countryQuery,\n selectValue: [],\n }),\n [countryQuery, selectFormatOptionLabel]\n )\n\n const highlightContextValue = React.useMemo<SuggestionContextValue>(\n () => ({\n highlightedValue: highlightedOption?.value ?? null,\n setHighlightedOption: updateHighlightedOption,\n renderOptionLabel: optionLabelRenderer,\n consumeScrollBehavior,\n }),\n [consumeScrollBehavior, highlightedOption, optionLabelRenderer, updateHighlightedOption]\n )\n\n const activeOption = countryOptions.find((option) => option.value === activeCountry)\n const activeFlag = activeOption?.flag ?? \"\"\n const inlineFlagLabel = hasExplicitCountrySelection\n ? resolvedMessages.selectedCountryLabel(activeOption?.name ?? activeCountry ?? null)\n : resolvedMessages.selectCountryLabel\n const hasInlineFlag = hasExplicitCountrySelection && Boolean(activeFlag)\n const lengthHint =\n lengthIssue === \"TOO_LONG\"\n ? resolvedMessages.lengthTooLong(activeOption?.name ?? activeCountry ?? null)\n : null\n const countryName = activeOption?.name ?? activeCountry ?? null\n\n let validationNode: React.ReactNode = null\n if (lengthHint) {\n const rendered = renderValidationMessage?.({\n message: lengthHint,\n code: \"TOO_LONG\",\n countryName,\n })\n validationNode =\n rendered === undefined ? (\n <p className=\"mt-1 text-xs text-destructive\">\n <span>{lengthHint}</span>\n </p>\n ) : (\n rendered\n )\n }\n\n const appendToBuffer = React.useCallback(\n (char: string) => {\n keyboardBufferRef.current = `${keyboardBufferRef.current}${char}`.slice(-12)\n setCountryQuery(keyboardBufferRef.current)\n setShowSuggestions(true)\n scheduleBufferReset()\n },\n [scheduleBufferReset]\n )\n\n const popBuffer = React.useCallback(() => {\n const current = keyboardBufferRef.current\n if (!current) {\n return\n }\n keyboardBufferRef.current = current.slice(0, -1)\n setCountryQuery(keyboardBufferRef.current)\n if (keyboardBufferRef.current) {\n scheduleBufferReset()\n }\n }, [scheduleBufferReset])\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLInputElement>) => {\n onInputKeyDown?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n const key = event.key\n\n if (event.metaKey || event.ctrlKey || event.altKey) {\n return\n }\n\n const target = event.currentTarget\n const value = target.value\n const selectionStart = target.selectionStart ?? 0\n const selectionEnd = target.selectionEnd ?? selectionStart\n const isCollapsedSelection = selectionStart === selectionEnd\n\n if (key === \"Backspace\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n target.setSelectionRange(nextStart, nextStart)\n }\n } else if (key === \"ArrowLeft\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersLeft(value, selectionStart)\n if (nextStart !== selectionStart) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n } else if (key === \"ArrowRight\" && isCollapsedSelection) {\n const nextStart = skipFormattingCharactersRight(value, selectionEnd)\n if (nextStart !== selectionEnd) {\n event.preventDefault()\n target.setSelectionRange(nextStart, nextStart)\n return\n }\n }\n\n if (key === \"ArrowDown\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n const next = current < 0 ? 0 : (current + 1) % filteredOptions.length\n return next\n })\n }\n return\n }\n\n if (key === \"ArrowUp\") {\n scrollBehaviorRef.current = event.repeat ? \"auto\" : \"smooth\"\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? filteredOptions.length - 1 : -1)\n return\n }\n\n if (filteredOptions.length > 0) {\n setHighlightedIndex((current) => {\n if (current < 0) {\n return filteredOptions.length - 1\n }\n return (current - 1 + filteredOptions.length) % filteredOptions.length\n })\n }\n return\n }\n\n if (/^[a-z]$/i.test(key)) {\n event.preventDefault()\n if (!showSuggestions) {\n setShowSuggestions(true)\n setHighlightedIndex(filteredOptions.length > 0 ? 0 : -1)\n }\n appendToBuffer(key.toLowerCase())\n return\n }\n\n if (suggestionMenuIsOpen) {\n if (key === \"Backspace\" && keyboardBufferRef.current) {\n event.preventDefault()\n popBuffer()\n return\n }\n\n if (key === \"Escape\") {\n event.preventDefault()\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(false)\n return\n }\n\n if (key === \"Enter\" && filteredOptions.length > 0) {\n event.preventDefault()\n const target = highlightedOption ?? filteredOptions[0]\n handleCountrySelect(target)\n return\n }\n }\n },\n [\n appendToBuffer,\n filteredOptions,\n handleCountrySelect,\n highlightedOption,\n onInputKeyDown,\n popBuffer,\n showSuggestions,\n suggestionMenuIsOpen,\n ]\n )\n\n const handleFocus = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(true)\n onInputFocus?.(event)\n },\n [onInputFocus]\n )\n\n const handleBlur = React.useCallback(\n (event: React.FocusEvent<HTMLInputElement>) => {\n setIsFocused(false)\n setShowSuggestions(false)\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n onInputBlur?.(event)\n },\n [onInputBlur]\n )\n\n const openCountryMenu = React.useCallback(() => {\n if (disabled || readOnly) {\n return\n }\n\n keyboardBufferRef.current = \"\"\n setCountryQuery(\"\")\n setShowSuggestions(true)\n setHighlightedIndex((current) => (current < 0 ? 0 : current))\n\n requestAnimationFrame(() => {\n inputRef.current?.focus()\n })\n }, [disabled, readOnly])\n\n const shimName = autofillShimName ?? (inputName ? `${inputName}_shim` : undefined)\n\n return (\n <div className={cn(\"relative flex flex-col\", className)}>\n <div className=\"relative\">\n <input\n {...restInputProps}\n ref={inputRef}\n type=\"tel\"\n className={cn(\n \"flex h-10 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n \"pl-11 pr-3\",\n inputClassName\n )}\n name={inputName}\n value={inputValueState}\n onChange={handleInputChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n disabled={disabled}\n readOnly={readOnly}\n autoComplete={inputAutoComplete ?? \"off\"}\n />\n <button\n type=\"button\"\n className={cn(\n \"absolute left-3 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded border text-lg leading-none transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n hasInlineFlag\n ? \"border-transparent\"\n : \"border-dashed border-border text-muted-foreground\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : readOnly\n ? \"cursor-default\"\n : \"cursor-pointer hover:bg-muted\"\n )}\n aria-label={inlineFlagLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={openCountryMenu}\n tabIndex={-1}\n disabled={disabled}\n >\n <span aria-hidden=\"true\">\n {hasInlineFlag ? activeFlag : \"?\"}\n </span>\n </button>\n </div>\n\n {shimName ? (\n <input\n tabIndex={-1}\n autoComplete=\"tel\"\n name={shimName}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0\"\n />\n ) : null}\n\n <div\n className=\"absolute left-0 top-full z-30 mt-1\"\n style={{\n pointerEvents: suggestionMenuIsOpen ? \"auto\" : \"none\",\n width: \"min(260px, 100%)\",\n }}\n onMouseDown={(event) => event.preventDefault()}\n >\n <SuggestionContext.Provider value={highlightContextValue}>\n <Select<CountryOption, false>\n {...restForwardedSelectProps}\n menuIsOpen={suggestionMenuIsOpen}\n options={filteredOptions}\n value={null}\n components={mergedSelectComponents}\n styles={mergedSelectStyles}\n isClearable={false}\n isSearchable={false}\n backspaceRemovesValue={false}\n tabSelectsValue={false}\n menuShouldScrollIntoView={false}\n onChange={handleCountrySelect}\n classNamePrefix={userClassNamePrefix ?? \"phone-number-suggestions\"}\n placeholder=\"\"\n formatOptionLabel={selectFormatOptionLabel}\n noOptionsMessage={\n noOptionsMessage ?? (() => resolvedMessages.noMatches)\n }\n />\n </SuggestionContext.Provider>\n </div>\n\n {validationNode}\n </div>\n )\n }\n)\n\nPhoneNumberInput.displayName = \"PhoneNumberInput\"\n"],"names":["PhoneNumberInput","React","forwardRef","props","forwardedRef","value","defaultCountry","country","countryProp","locale","onChange","onCountryChange","className","inputClassName","disabled","readOnly","selectProps","autofillShimName","messages","messagesProp","renderValidationMessage","restProps","onFocus","onInputFocus","onBlur","onInputBlur","onKeyDown","onInputKeyDown","name","inputName","autoComplete","inputAutoComplete","restInputProps","hasConfiguredCountry","localeCacheKey","getLocaleCacheKey","localeForBuild","useMemo","parseLocaleCacheKey","resolvedMessages","resolveMessages","countryOptions","getCachedCountryOptions","resolveSelectedCountry","useCallback","match","find","candidate","toSelectedCountry","buildFallbackSelectedCountry","fallbackCountry","getValidCountry","DEFAULT_COUNTRY","some","option","hasResolvedCountryRef","useRef","initialStateRef","lastNormalizedRef","current","inputValue","normalizedValue","hasExplicitCountrySelection","baseCountryForInit","undefined","normalized","normalizeInputValue","allowJustPlus","international","phoneNumber","detectedCountry","inferredCountry","hasExplicitInternationalPrefix","formatWithAsYouType","canonicalDetectedCountry","resolvedCountry","rawDigits","sanitizeDigits","hasExplicitPlus","test","internationalDigits","initialDialCode","getCountryCallingCode","initialHasPrefix","detectNationalPrefixForDisplay","suggestion","getSuggestionState","hasRemovedNationalPrefix","inferredCountryToApply","shouldSuggest","nextDialCode","finalHasPrefix","displayValue","injectNationalPrefixDisplay","force","displayDetectedCountry","allowInlineFlag","shouldDisplayExplicitCountrySelection","initialState","uncontrolledCountry","setUncontrolledCountry","useState","inputValueState","setInputValueState","countryQuery","setCountryQuery","showSuggestions","setShowSuggestions","highlightedIndex","setHighlightedIndex","isFocused","setIsFocused","lengthIssue","setLengthIssue","setHasExplicitCountrySelection","manualSelectionCountryRef","keyboardBufferRef","bufferTimeoutRef","scrollBehaviorRef","pendingSelectionRef","consumeScrollBehavior","behavior","isCountryControlled","selectedCountry","activeCountry","inputRef","useImperativeHandle","useLayoutEffect","selection","input","start","end","setSelectionRange","selectOverrides","styles","userSelectStyles","components","userSelectComponents","classNamePrefix","userClassNamePrefix","formatOptionLabel","userFormatOptionLabel","forwardedSelectProps","noOptionsMessage","restForwardedSelectProps","mergedSelectStyles","suggestionSelectStyles","mergedSelectComponents","baseComponents","Control","HiddenControl","IndicatorsContainer","NullComponent","DropdownIndicator","IndicatorSeparator","ValueContainer","overrides","Option","SuggestionOption","hasAnnouncedCountryRef","notifyCountryChange","useEffect","window","clearTimeout","baseCountryForSync","previousNormalized","previousValue","nextCountry","initialHasTypedTrunk","finalCountry","hasTypedTrunk","shouldShowInlineFlag","query","getLengthIssue","emitChange","details","scheduleBufferReset","setTimeout","handleInputChange","event","target","snapshot","captureSelectionSnapshot","raw","baseCountryForInput","dialCode","typedDigits","trim","startsWith","startsWithDialCode","hasLeadingZero","isIddPrefix","COMMON_IDD_PREFIXES","prefix","shouldRemoveNationalPrefix","Boolean","slice","length","removeNationalPrefix","resolveSelection","formattedInternational","formattedNational","e164","countryCallingCode","nationalNumber","rawInput","isValid","national","normalizedDigits","nationalDigits","stripPrefix","number","handleCountrySelect","previousDigits","currentDial","rebasedDigits","requestAnimationFrame","focus","filteredOptions","results","pushUnique","existing","push","fallbackOption","currentOption","digitQuery","normalizedQuery","normalizeSearchValue","forEach","filter","sort","a","b","aExact","bExact","normalizedSearchableTokens","token","includes","aIndex","optionMatchIndex","bIndex","localeCompare","suggestionMenuIsOpen","highlightedOption","updateHighlightedOption","index","findIndex","selectFormatOptionLabel","meta","formatCountryOption","optionLabelRenderer","context","selectValue","highlightContextValue","highlightedValue","setHighlightedOption","renderOptionLabel","activeOption","activeFlag","flag","inlineFlagLabel","selectedCountryLabel","selectCountryLabel","hasInlineFlag","lengthHint","lengthTooLong","countryName","validationNode","rendered","message","code","jsx","appendToBuffer","char","popBuffer","handleKeyDown","defaultPrevented","key","metaKey","ctrlKey","altKey","currentTarget","selectionStart","selectionEnd","isCollapsedSelection","nextStart","skipFormattingCharactersLeft","preventDefault","skipFormattingCharactersRight","repeat","toLowerCase","handleFocus","handleBlur","openCountryMenu","shimName","cn","jsxs","pointerEvents","width","SuggestionContext","Select","noMatches","displayName"],"mappings":";;;;;;;;;;AAoEO,MAAMA,KAAmBC,EAAMC,WACpC,SAA0BC,IAAOC,IAAc;AAC7C,QAAM;AAAA,IACJC,OAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAASC;AAAAA,IACTC,QAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,UAAUC;AAAAA,IACVC,yBAAAA;AAAAA,IACA,GAAGC;AAAAA,EAAAA,IACDlB,IAEE;AAAA,IACJmB,SAASC;AAAAA,IACTC,QAAQC;AAAAA,IACRC,WAAWC;AAAAA,IACXC,MAAMC;AAAAA,IACNC,cAAcC;AAAAA,IACd,GAAGC;AAAAA,EAAAA,IACDX,IAEEY,IACJ,OAAO3B,MAAmB,YAAY,OAAOE,KAAgB,UAEzD0B,KAAiBC,GAAkB1B,EAAM,GACzC2B,KAAiBnC,EAAMoC,QAC3B,MAAMC,GAAoBJ,EAAc,GACxC,CAACA,EAAc,CACjB,GACMK,KAAmBtC,EAAMoC,QAC7B,MAAMG,GAAgBJ,IAAgBjB,EAAY,GAClD,CAACiB,IAAgBjB,EAAY,CAC/B,GACMsB,IAAiBxC,EAAMoC,QAC3B,MAAMK,GAAwBN,IAAgBF,EAAc,GAC5D,CAACA,IAAgBE,EAAc,CACjC,GACMO,KAAyB1C,EAAM2C,YACnC,CAACrC,MAAqD;AACpD,UAAMsC,IAAQJ,EAAeK,KAAMC,CAAAA,MAAcA,EAAU1C,UAAUE,CAAO;AAC5E,WAAIsC,IACKG,GAAkBH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vB,gBAAAA,EAAAA,IAAC,SAAA,EACC,UAAU,IACV,cAAa,OACb,MAAMuB,IACN,eAAY,QACZ,WAAU,+DAA6D,IAEvE;AAAA,IAEJvB,gBAAAA,EAAAA,IAAC,OAAA,EACC,WAAU,sCACV,OAAO;AAAA,MACL0B,eAAevD,IAAuB,SAAS;AAAA,MAC/CwD,OAAO;AAAA,IAAA,GAET,aAAcvH,CAAAA,MAAUA,EAAM4G,kBAE9B,UAAAhB,gBAAAA,EAAAA,IAAC4B,GAAkB,UAAlB,EAA2B,OAAO9C,IACjC,UAAAkB,gBAAAA,EAAAA,IAAC6B,IAAA,EACC,GAAI5J,IACJ,YAAYkG,GACZ,SAASxB,GACT,OAAO,MACP,YAAYvE,IACZ,QAAQF,IACR,aAAa,IACb,cAAc,IACd,uBAAuB,IACvB,iBAAiB,IACjB,0BAA0B,IAC1B,UAAUmE,IACV,iBAAiBzE,MAAuB,4BACxC,aAAY,IACZ,mBAAmB4G,IACnB,kBACAxG,OAAqB,MAAMxG,GAAiBsQ,YAC7C,EAAA,CAEL,EAAA,CACF;AAAA,IAEGlC;AAAAA,EAAAA,GACH;AAEJ,CACF;AAEA3Q,GAAiB8S,cAAc;"}
package/dist/index200.js CHANGED
@@ -1,9 +1,9 @@
1
- import { toDate as t } from "./index279.js";
2
- function f(r, e) {
3
- return +t(r) > +t(e);
1
+ import { addDays as r } from "./index198.js";
2
+ function o(a, d, e) {
3
+ return r(a, d * 7, e);
4
4
  }
5
5
  export {
6
- f as default,
7
- f as isAfter
6
+ o as addWeeks,
7
+ o as default
8
8
  };
9
9
  //# sourceMappingURL=index200.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index200.js","sources":["../../../node_modules/date-fns/isAfter.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n"],"names":["isAfter","date","dateToCompare","toDate"],"mappings":";AAoBO,SAASA,EAAQC,GAAMC,GAAe;AAC3C,SAAO,CAACC,EAAOF,CAAI,IAAI,CAACE,EAAOD,CAAa;AAC9C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index200.js","sources":["../../../node_modules/date-fns/addWeeks.js"],"sourcesContent":["import { addDays } from \"./addDays.js\";\n\n/**\n * The {@link addWeeks} function options.\n */\n\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of weeks to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param amount - The amount of weeks to be added.\n * @param options - An object with options\n *\n * @returns The new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nexport function addWeeks(date, amount, options) {\n return addDays(date, amount * 7, options);\n}\n\n// Fallback for modularized imports:\nexport default addWeeks;\n"],"names":["addWeeks","date","amount","options","addDays"],"mappings":";AA4BO,SAASA,EAASC,GAAMC,GAAQC,GAAS;AAC9C,SAAOC,EAAQH,GAAMC,IAAS,GAAGC,CAAO;AAC1C;","x_google_ignoreList":[0]}
package/dist/index201.js CHANGED
@@ -1,9 +1,9 @@
1
- import { toDate as t } from "./index279.js";
2
- function f(e, o) {
3
- return +t(e) < +t(o);
1
+ import { addMonths as d } from "./index199.js";
2
+ function e(r, t, a) {
3
+ return d(r, t * 12, a);
4
4
  }
5
5
  export {
6
- f as default,
7
- f as isBefore
6
+ e as addYears,
7
+ e as default
8
8
  };
9
9
  //# sourceMappingURL=index201.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index201.js","sources":["../../../node_modules/date-fns/isBefore.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n"],"names":["isBefore","date","dateToCompare","toDate"],"mappings":";AAoBO,SAASA,EAASC,GAAMC,GAAe;AAC5C,SAAO,CAACC,EAAOF,CAAI,IAAI,CAACE,EAAOD,CAAa;AAC9C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index201.js","sources":["../../../node_modules/date-fns/addYears.js"],"sourcesContent":["import { addMonths } from \"./addMonths.js\";\n\n/**\n * The {@link addYears} function options.\n */\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type.\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n * @param options - The options\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport function addYears(date, amount, options) {\n return addMonths(date, amount * 12, options);\n}\n\n// Fallback for modularized imports:\nexport default addYears;\n"],"names":["addYears","date","amount","options","addMonths"],"mappings":";AA4BO,SAASA,EAASC,GAAMC,GAAQC,GAAS;AAC9C,SAAOC,EAAUH,GAAMC,IAAS,IAAIC,CAAO;AAC7C;","x_google_ignoreList":[0]}
package/dist/index202.js CHANGED
@@ -1,8 +1,17 @@
1
- function e(t) {
2
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
1
+ import { getTimezoneOffsetInMilliseconds as r } from "./index294.js";
2
+ import { normalizeDates as c } from "./index295.js";
3
+ import { millisecondsInDay as D } from "./index293.js";
4
+ import { startOfDay as a } from "./index224.js";
5
+ function O(o, n, i) {
6
+ const [s, m] = c(
7
+ i?.in,
8
+ o,
9
+ n
10
+ ), t = a(s), e = a(m), f = +t - r(t), l = +e - r(e);
11
+ return Math.round((f - l) / D);
3
12
  }
4
13
  export {
5
- e as default,
6
- e as isDate
14
+ O as default,
15
+ O as differenceInCalendarDays
7
16
  };
8
17
  //# sourceMappingURL=index202.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index202.js","sources":["../../../node_modules/date-fns/isDate.js"],"sourcesContent":["/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * @param value - The value to check\n *\n * @returns True if the given value is a date\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\nexport function isDate(value) {\n return (\n value instanceof Date ||\n (typeof value === \"object\" &&\n Object.prototype.toString.call(value) === \"[object Date]\")\n );\n}\n\n// Fallback for modularized imports:\nexport default isDate;\n"],"names":["isDate","value"],"mappings":"AAgCO,SAASA,EAAOC,GAAO;AAC5B,SACEA,aAAiB,QAChB,OAAOA,KAAU,YAChB,OAAO,UAAU,SAAS,KAAKA,CAAK,MAAM;AAEhD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index202.js","sources":["../../../node_modules/date-fns/differenceInCalendarDays.js"],"sourcesContent":["import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n"],"names":["differenceInCalendarDays","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","laterStartOfDay","startOfDay","earlierStartOfDay","laterTimestamp","getTimezoneOffsetInMilliseconds","earlierTimestamp","millisecondsInDay"],"mappings":";;;;AAwCO,SAASA,EAAyBC,GAAWC,GAAaC,GAAS;AACxE,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ,GAEQK,IAAkBC,EAAWJ,CAAU,GACvCK,IAAoBD,EAAWH,CAAY,GAE3CK,IACJ,CAACH,IAAkBI,EAAgCJ,CAAe,GAC9DK,IACJ,CAACH,IAAoBE,EAAgCF,CAAiB;AAKxE,SAAO,KAAK,OAAOC,IAAiBE,KAAoBC,CAAiB;AAC3E;","x_google_ignoreList":[0]}
package/dist/index203.js CHANGED
@@ -1,15 +1,14 @@
1
- import { normalizeDates as f } from "./index282.js";
2
- import { startOfDay as t } from "./index210.js";
3
- function s(a, e, r) {
4
- const [o, i] = f(
5
- r?.in,
6
- a,
7
- e
8
- );
9
- return +t(o) == +t(i);
1
+ import { normalizeDates as l } from "./index295.js";
2
+ function s(n, r, a) {
3
+ const [e, t] = l(
4
+ a?.in,
5
+ n,
6
+ r
7
+ ), o = e.getFullYear() - t.getFullYear(), f = e.getMonth() - t.getMonth();
8
+ return o * 12 + f;
10
9
  }
11
10
  export {
12
11
  s as default,
13
- s as isSameDay
12
+ s as differenceInCalendarMonths
14
13
  };
15
14
  //# sourceMappingURL=index203.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index203.js","sources":["../../../node_modules/date-fns/isSameDay.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link isSameDay} function options.\n */\n\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day (and year and month)?\n *\n * @description\n * Are the given dates in the same day (and year and month)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same day (and year and month)\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n *\n * @example\n * // Are 4 September and 4 October in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))\n * //=> false\n *\n * @example\n * // Are 4 September, 2014 and 4 September, 2015 in the same day?\n * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))\n * //=> false\n */\nexport function isSameDay(laterDate, earlierDate, options) {\n const [dateLeft_, dateRight_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return +startOfDay(dateLeft_) === +startOfDay(dateRight_);\n}\n\n// Fallback for modularized imports:\nexport default isSameDay;\n"],"names":["isSameDay","laterDate","earlierDate","options","dateLeft_","dateRight_","normalizeDates","startOfDay"],"mappings":";;AAoCO,SAASA,EAAUC,GAAWC,GAAaC,GAAS;AACzD,QAAM,CAACC,GAAWC,CAAU,IAAIC;AAAA,IAC9BH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SAAO,CAACK,EAAWH,CAAS,KAAM,CAACG,EAAWF,CAAU;AAC1D;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index203.js","sources":["../../../node_modules/date-fns/differenceInCalendarMonths.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n"],"names":["differenceInCalendarMonths","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","yearsDiff","monthsDiff"],"mappings":";AA4BO,SAASA,EAA2BC,GAAWC,GAAaC,GAAS;AAC1E,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ,GAEQK,IAAYH,EAAW,YAAW,IAAKC,EAAa,YAAW,GAC/DG,IAAaJ,EAAW,SAAQ,IAAKC,EAAa,SAAQ;AAEhE,SAAOE,IAAY,KAAKC;AAC1B;","x_google_ignoreList":[0]}
package/dist/index204.js CHANGED
@@ -1,14 +1,18 @@
1
- import { normalizeDates as o } from "./index282.js";
2
- function i(a, r, n) {
3
- const [e, t] = o(
4
- n?.in,
5
- a,
6
- r
7
- );
8
- return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
1
+ import { normalizeInterval as l } from "./index296.js";
2
+ import { constructFrom as m } from "./index291.js";
3
+ function u(s, a) {
4
+ const { start: e, end: r } = l(a?.in, s);
5
+ let n = +e > +r;
6
+ const c = n ? +e : +r, t = n ? r : e;
7
+ t.setHours(0, 0, 0, 0), t.setDate(1);
8
+ let i = 1;
9
+ const o = [];
10
+ for (; +t <= c; )
11
+ o.push(m(e, t)), t.setMonth(t.getMonth() + i);
12
+ return n ? o.reverse() : o;
9
13
  }
10
14
  export {
11
- i as default,
12
- i as isSameMonth
15
+ u as default,
16
+ u as eachMonthOfInterval
13
17
  };
14
18
  //# sourceMappingURL=index204.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index204.js","sources":["../../../node_modules/date-fns/isSameMonth.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameMonth} function options.\n */\n\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month (and year)?\n *\n * @description\n * Are the given dates in the same month (and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same month (and year)\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n *\n * @example\n * // Are 2 September 2014 and 25 September 2015 in the same month?\n * const result = isSameMonth(new Date(2014, 8, 2), new Date(2015, 8, 25))\n * //=> false\n */\nexport function isSameMonth(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return (\n laterDate_.getFullYear() === earlierDate_.getFullYear() &&\n laterDate_.getMonth() === earlierDate_.getMonth()\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameMonth;\n"],"names":["isSameMonth","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates"],"mappings":";AA8BO,SAASA,EAAYC,GAAWC,GAAaC,GAAS;AAC3D,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SACEE,EAAW,YAAW,MAAOC,EAAa,YAAW,KACrDD,EAAW,eAAeC,EAAa,SAAQ;AAEnD;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index204.js","sources":["../../../node_modules/date-fns/eachMonthOfInterval.js"],"sourcesContent":["import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachMonthOfInterval} function options.\n */\n\n/**\n * The {@link eachMonthOfInterval} function result type. It resolves the proper data type.\n */\n\n/**\n * @name eachMonthOfInterval\n * @category Interval Helpers\n * @summary Return the array of months within the specified time interval.\n *\n * @description\n * Return the array of months within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of months from the month of the interval start to the month of the interval end\n *\n * @example\n * // Each month between 6 February 2014 and 10 August 2014:\n * const result = eachMonthOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2014, 7, 10)\n * })\n * //=> [\n * // Sat Feb 01 2014 00:00:00,\n * // Sat Mar 01 2014 00:00:00,\n * // Tue Apr 01 2014 00:00:00,\n * // Thu May 01 2014 00:00:00,\n * // Sun Jun 01 2014 00:00:00,\n * // Tue Jul 01 2014 00:00:00,\n * // Fri Aug 01 2014 00:00:00\n * // ]\n */\nexport function eachMonthOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setDate(1);\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setMonth(date.getMonth() + step);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachMonthOfInterval;\n"],"names":["eachMonthOfInterval","interval","options","start","end","normalizeInterval","reversed","endTime","date","step","dates","constructFrom"],"mappings":";;AA2CO,SAASA,EAAoBC,GAAUC,GAAS;AACrD,QAAM,EAAE,OAAAC,GAAO,KAAAC,EAAG,IAAKC,EAAkBH,GAAS,IAAID,CAAQ;AAE9D,MAAIK,IAAW,CAACH,IAAQ,CAACC;AACzB,QAAMG,IAAUD,IAAW,CAACH,IAAQ,CAACC,GAC/BI,IAAOF,IAAWF,IAAMD;AAC9B,EAAAK,EAAK,SAAS,GAAG,GAAG,GAAG,CAAC,GACxBA,EAAK,QAAQ,CAAC;AAEd,MAAIC,IAAwB;AAO5B,QAAMC,IAAQ,CAAA;AAEd,SAAO,CAACF,KAAQD;AACd,IAAAG,EAAM,KAAKC,EAAcR,GAAOK,CAAI,CAAC,GACrCA,EAAK,SAASA,EAAK,SAAQ,IAAKC,CAAI;AAGtC,SAAOH,IAAWI,EAAM,QAAO,IAAKA;AACtC;","x_google_ignoreList":[0]}
package/dist/index205.js CHANGED
@@ -1,14 +1,18 @@
1
- import { normalizeDates as i } from "./index282.js";
2
- function o(e, a, r) {
3
- const [t, l] = i(
4
- r?.in,
5
- e,
6
- a
7
- );
8
- return t.getFullYear() === l.getFullYear();
1
+ import { normalizeInterval as u } from "./index296.js";
2
+ import { constructFrom as i } from "./index291.js";
3
+ function f(o, a) {
4
+ const { start: t, end: r } = u(a?.in, o);
5
+ let s = +t > +r;
6
+ const l = s ? +t : +r, e = s ? r : t;
7
+ e.setHours(0, 0, 0, 0), e.setMonth(0, 1);
8
+ let c = 1;
9
+ const n = [];
10
+ for (; +e <= l; )
11
+ n.push(i(t, e)), e.setFullYear(e.getFullYear() + c);
12
+ return s ? n.reverse() : n;
9
13
  }
10
14
  export {
11
- o as default,
12
- o as isSameYear
15
+ f as default,
16
+ f as eachYearOfInterval
13
17
  };
14
18
  //# sourceMappingURL=index205.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index205.js","sources":["../../../node_modules/date-fns/isSameYear.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link isSameYear} function options.\n */\n\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * const result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\nexport function isSameYear(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() === earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default isSameYear;\n"],"names":["isSameYear","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates"],"mappings":";AAyBO,SAASA,EAAWC,GAAWC,GAAaC,GAAS;AAC1D,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SAAOE,EAAW,kBAAkBC,EAAa,YAAW;AAC9D;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index205.js","sources":["../../../node_modules/date-fns/eachYearOfInterval.js"],"sourcesContent":["import { normalizeInterval } from \"./_lib/normalizeInterval.js\";\nimport { constructFrom } from \"./constructFrom.js\";\n\n/**\n * The {@link eachYearOfInterval} function options.\n */\n\n/**\n * The {@link eachYearOfInterval} function result type. It resolves the proper data type.\n * It uses the first argument date object type, starting from the date argument,\n * then the start interval date, and finally the end interval date. If\n * a context function is passed, it uses the context function return type.\n */\n\n/**\n * @name eachYearOfInterval\n * @category Interval Helpers\n * @summary Return the array of yearly timestamps within the specified time interval.\n *\n * @description\n * Return the array of yearly timestamps within the specified time interval.\n *\n * @typeParam IntervalType - Interval type.\n * @typeParam Options - Options type.\n *\n * @param interval - The interval.\n * @param options - An object with options.\n *\n * @returns The array with starts of yearly timestamps from the month of the interval start to the month of the interval end\n *\n * @example\n * // Each year between 6 February 2014 and 10 August 2017:\n * const result = eachYearOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2017, 7, 10)\n * })\n * //=> [\n * // Wed Jan 01 2014 00:00:00,\n * // Thu Jan 01 2015 00:00:00,\n * // Fri Jan 01 2016 00:00:00,\n * // Sun Jan 01 2017 00:00:00\n * // ]\n */\nexport function eachYearOfInterval(interval, options) {\n const { start, end } = normalizeInterval(options?.in, interval);\n\n let reversed = +start > +end;\n const endTime = reversed ? +start : +end;\n const date = reversed ? end : start;\n date.setHours(0, 0, 0, 0);\n date.setMonth(0, 1);\n\n let step = options?.step ?? 1;\n if (!step) return [];\n if (step < 0) {\n step = -step;\n reversed = !reversed;\n }\n\n const dates = [];\n\n while (+date <= endTime) {\n dates.push(constructFrom(start, date));\n date.setFullYear(date.getFullYear() + step);\n }\n\n return reversed ? dates.reverse() : dates;\n}\n\n// Fallback for modularized imports:\nexport default eachYearOfInterval;\n"],"names":["eachYearOfInterval","interval","options","start","end","normalizeInterval","reversed","endTime","date","step","dates","constructFrom"],"mappings":";;AA2CO,SAASA,EAAmBC,GAAUC,GAAS;AACpD,QAAM,EAAE,OAAAC,GAAO,KAAAC,EAAG,IAAKC,EAAkBH,GAAS,IAAID,CAAQ;AAE9D,MAAIK,IAAW,CAACH,IAAQ,CAACC;AACzB,QAAMG,IAAUD,IAAW,CAACH,IAAQ,CAACC,GAC/BI,IAAOF,IAAWF,IAAMD;AAC9B,EAAAK,EAAK,SAAS,GAAG,GAAG,GAAG,CAAC,GACxBA,EAAK,SAAS,GAAG,CAAC;AAElB,MAAIC,IAAwB;AAO5B,QAAMC,IAAQ,CAAA;AAEd,SAAO,CAACF,KAAQD;AACd,IAAAG,EAAM,KAAKC,EAAcR,GAAOK,CAAI,CAAC,GACrCA,EAAK,YAAYA,EAAK,YAAW,IAAKC,CAAI;AAG5C,SAAOH,IAAWI,EAAM,QAAO,IAAKA;AACtC;","x_google_ignoreList":[0]}
package/dist/index206.js CHANGED
@@ -1,15 +1,9 @@
1
- import { constructFrom as n } from "./index278.js";
2
- import { toDate as c } from "./index279.js";
3
- function m(f, i) {
4
- let t, o = i?.in;
5
- return f.forEach((r) => {
6
- !o && typeof r == "object" && (o = n.bind(null, r));
7
- const e = c(r, o);
8
- (!t || t < e || isNaN(+e)) && (t = e);
9
- }), n(o, t || NaN);
1
+ import { endOfWeek as n } from "./index208.js";
2
+ function f(e, t) {
3
+ return n(e, { ...t, weekStartsOn: 1 });
10
4
  }
11
5
  export {
12
- m as default,
13
- m as max
6
+ f as default,
7
+ f as endOfISOWeek
14
8
  };
15
9
  //# sourceMappingURL=index206.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index206.js","sources":["../../../node_modules/date-fns/max.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link max} function options.\n */\n\n/**\n * @name max\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The latest of the dates\n *\n * @example\n * // Which of these dates is the latest?\n * const result = max([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Sun Jul 02 1995 00:00:00\n */\nexport function max(dates, options) {\n let result;\n let context = options?.in;\n\n dates.forEach((date) => {\n // Use the first date object as the context function\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n\n const date_ = toDate(date, context);\n if (!result || result < date_ || isNaN(+date_)) result = date_;\n });\n\n return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default max;\n"],"names":["max","dates","options","result","context","date","constructFrom","date_","toDate"],"mappings":";;AAgCO,SAASA,EAAIC,GAAOC,GAAS;AAClC,MAAIC,GACAC,IAAUF,GAAS;AAEvB,SAAAD,EAAM,QAAQ,CAACI,MAAS;AAEtB,IAAI,CAACD,KAAW,OAAOC,KAAS,aAC9BD,IAAUE,EAAc,KAAK,MAAMD,CAAI;AAEzC,UAAME,IAAQC,EAAOH,GAAMD,CAAO;AAClC,KAAI,CAACD,KAAUA,IAASI,KAAS,MAAM,CAACA,CAAK,OAAGJ,IAASI;AAAA,EAC3D,CAAC,GAEMD,EAAcF,GAASD,KAAU,GAAG;AAC7C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index206.js","sources":["../../../node_modules/date-fns/endOfISOWeek.js"],"sourcesContent":["import { endOfWeek } from \"./endOfWeek.js\";\n\n/**\n * The {@link endOfISOWeek} function options.\n */\n\n/**\n * @name endOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of an ISO week\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * const result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfISOWeek(date, options) {\n return endOfWeek(date, { ...options, weekStartsOn: 1 });\n}\n\n// Fallback for modularized imports:\nexport default endOfISOWeek;\n"],"names":["endOfISOWeek","date","options","endOfWeek"],"mappings":";AA8BO,SAASA,EAAaC,GAAMC,GAAS;AAC1C,SAAOC,EAAUF,GAAM,EAAE,GAAGC,GAAS,cAAc,GAAG;AACxD;","x_google_ignoreList":[0]}
package/dist/index207.js CHANGED
@@ -1,15 +1,10 @@
1
- import { constructFrom as e } from "./index278.js";
2
- import { toDate as c } from "./index279.js";
3
- function u(i, f) {
4
- let t, o = f?.in;
5
- return i.forEach((r) => {
6
- !o && typeof r == "object" && (o = e.bind(null, r));
7
- const n = c(r, o);
8
- (!t || t > n || isNaN(+n)) && (t = n);
9
- }), e(o, t || NaN);
1
+ import { toDate as r } from "./index292.js";
2
+ function s(e, o) {
3
+ const t = r(e, o?.in), n = t.getMonth();
4
+ return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
10
5
  }
11
6
  export {
12
- u as default,
13
- u as min
7
+ s as default,
8
+ s as endOfMonth
14
9
  };
15
10
  //# sourceMappingURL=index207.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index207.js","sources":["../../../node_modules/date-fns/min.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link min} function options.\n */\n\n/**\n * @name min\n * @category Common Helpers\n * @summary Returns the earliest of the given dates.\n *\n * @description\n * Returns the earliest of the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param dates - The dates to compare\n *\n * @returns The earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * const result = min([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\nexport function min(dates, options) {\n let result;\n let context = options?.in;\n\n dates.forEach((date) => {\n // Use the first date object as the context function\n if (!context && typeof date === \"object\")\n context = constructFrom.bind(null, date);\n\n const date_ = toDate(date, context);\n if (!result || result > date_ || isNaN(+date_)) result = date_;\n });\n\n return constructFrom(context, result || NaN);\n}\n\n// Fallback for modularized imports:\nexport default min;\n"],"names":["min","dates","options","result","context","date","constructFrom","date_","toDate"],"mappings":";;AAgCO,SAASA,EAAIC,GAAOC,GAAS;AAClC,MAAIC,GACAC,IAAUF,GAAS;AAEvB,SAAAD,EAAM,QAAQ,CAACI,MAAS;AAEtB,IAAI,CAACD,KAAW,OAAOC,KAAS,aAC9BD,IAAUE,EAAc,KAAK,MAAMD,CAAI;AAEzC,UAAME,IAAQC,EAAOH,GAAMD,CAAO;AAClC,KAAI,CAACD,KAAUA,IAASI,KAAS,MAAM,CAACA,CAAK,OAAGJ,IAASI;AAAA,EAC3D,CAAC,GAEMD,EAAcF,GAASD,KAAU,GAAG;AAC7C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index207.js","sources":["../../../node_modules/date-fns/endOfMonth.js"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfMonth} function options.\n */\n\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport function endOfMonth(date, options) {\n const _date = toDate(date, options?.in);\n const month = _date.getMonth();\n _date.setFullYear(_date.getFullYear(), month + 1, 0);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfMonth;\n"],"names":["endOfMonth","date","options","_date","toDate","month"],"mappings":";AA4BO,SAASA,EAAWC,GAAMC,GAAS;AACxC,QAAMC,IAAQC,EAAOH,GAAMC,GAAS,EAAE,GAChCG,IAAQF,EAAM,SAAQ;AAC5B,SAAAA,EAAM,YAAYA,EAAM,YAAW,GAAIE,IAAQ,GAAG,CAAC,GACnDF,EAAM,SAAS,IAAI,IAAI,IAAI,GAAG,GACvBA;AACT;","x_google_ignoreList":[0]}
package/dist/index208.js CHANGED
@@ -1,14 +1,11 @@
1
- import { constructFrom as m } from "./index278.js";
2
- import { getDaysInMonth as i } from "./index290.js";
3
- import { toDate as u } from "./index279.js";
4
- function l(n, e, r) {
5
- const t = u(n, r?.in), s = t.getFullYear(), a = t.getDate(), o = m(n, 0);
6
- o.setFullYear(s, e, 15), o.setHours(0, 0, 0, 0);
7
- const c = i(o);
8
- return t.setMonth(e, Math.min(a, c)), t;
1
+ import { getDefaultOptions as f } from "./index297.js";
2
+ import { toDate as c } from "./index292.js";
3
+ function l(s, e) {
4
+ const a = f(), n = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, t = c(s, e?.in), o = t.getDay(), r = (o < n ? -7 : 0) + 6 - (o - n);
5
+ return t.setDate(t.getDate() + r), t.setHours(23, 59, 59, 999), t;
9
6
  }
10
7
  export {
11
8
  l as default,
12
- l as setMonth
9
+ l as endOfWeek
13
10
  };
14
11
  //# sourceMappingURL=index208.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index208.js","sources":["../../../node_modules/date-fns/setMonth.js"],"sourcesContent":["import { constructFrom } from \"./constructFrom.js\";\nimport { getDaysInMonth } from \"./getDaysInMonth.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link setMonth} function options.\n */\n\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The date to be changed\n * @param month - The month index to set (0-11)\n * @param options - The options\n *\n * @returns The new date with the month set\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nexport function setMonth(date, month, options) {\n const _date = toDate(date, options?.in);\n const year = _date.getFullYear();\n const day = _date.getDate();\n\n const midMonth = constructFrom(options?.in || date, 0);\n midMonth.setFullYear(year, month, 15);\n midMonth.setHours(0, 0, 0, 0);\n const daysInMonth = getDaysInMonth(midMonth);\n\n // Set the earlier date, allows to wrap Jan 31 to Feb 28\n _date.setMonth(month, Math.min(day, daysInMonth));\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default setMonth;\n"],"names":["setMonth","date","month","options","_date","toDate","year","day","midMonth","constructFrom","daysInMonth","getDaysInMonth"],"mappings":";;;AA8BO,SAASA,EAASC,GAAMC,GAAOC,GAAS;AAC7C,QAAMC,IAAQC,EAAOJ,GAAME,GAAS,EAAE,GAChCG,IAAOF,EAAM,YAAW,GACxBG,IAAMH,EAAM,QAAO,GAEnBI,IAAWC,EAA6BR,GAAM,CAAC;AACrD,EAAAO,EAAS,YAAYF,GAAMJ,GAAO,EAAE,GACpCM,EAAS,SAAS,GAAG,GAAG,GAAG,CAAC;AAC5B,QAAME,IAAcC,EAAeH,CAAQ;AAG3C,SAAAJ,EAAM,SAASF,GAAO,KAAK,IAAIK,GAAKG,CAAW,CAAC,GACzCN;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index208.js","sources":["../../../node_modules/date-fns/endOfWeek.js"],"sourcesContent":["import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link endOfWeek} function options.\n */\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport function endOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n\n _date.setDate(_date.getDate() + diff);\n _date.setHours(23, 59, 59, 999);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default endOfWeek;\n"],"names":["endOfWeek","date","options","defaultOptions","getDefaultOptions","weekStartsOn","_date","toDate","day","diff"],"mappings":";;AAkCO,SAASA,EAAUC,GAAMC,GAAS;AACvC,QAAMC,IAAiBC,EAAiB,GAClCC,IACJH,GAAS,gBACTA,GAAS,QAAQ,SAAS,gBAC1BC,EAAe,gBACfA,EAAe,QAAQ,SAAS,gBAChC,GAEIG,IAAQC,EAAON,GAAMC,GAAS,EAAE,GAChCM,IAAMF,EAAM,OAAM,GAClBG,KAAQD,IAAMH,IAAe,KAAK,KAAK,KAAKG,IAAMH;AAExD,SAAAC,EAAM,QAAQA,EAAM,QAAO,IAAKG,CAAI,GACpCH,EAAM,SAAS,IAAI,IAAI,IAAI,GAAG,GACvBA;AACT;","x_google_ignoreList":[0]}