@rpcbase/ui 0.238.0 → 0.240.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 (439) hide show
  1. package/dist/components/AddressAutocompleteInput/index.d.ts.map +1 -1
  2. package/dist/components/I18nField/index.d.ts +2 -1
  3. package/dist/components/I18nField/index.d.ts.map +1 -1
  4. package/dist/helpers/useMapsLibrary.d.ts.map +1 -1
  5. package/dist/index106.js +36 -36
  6. package/dist/index11.js +373 -335
  7. package/dist/index11.js.map +1 -1
  8. package/dist/index118.js +6 -6
  9. package/dist/index121.js +10 -10
  10. package/dist/index123.js +2 -2
  11. package/dist/index124.js +3 -3
  12. package/dist/index125.js +1 -1
  13. package/dist/index127.js +2 -2
  14. package/dist/index129.js +2 -2
  15. package/dist/index172.js +3 -3
  16. package/dist/index175.js +1 -1
  17. package/dist/index176.js +4 -4
  18. package/dist/index178.js +1 -1
  19. package/dist/index182.js +2 -2
  20. package/dist/index184.js +12 -12
  21. package/dist/index185.js +1 -1
  22. package/dist/index187.js +6 -6
  23. package/dist/index189.js +6 -6
  24. package/dist/index190.js +5 -5
  25. package/dist/index193.js +3 -3
  26. package/dist/index194.js +5 -5
  27. package/dist/index196.js +20 -59
  28. package/dist/index196.js.map +1 -1
  29. package/dist/index197.js +66 -8
  30. package/dist/index197.js.map +1 -1
  31. package/dist/index198.js +6 -87
  32. package/dist/index198.js.map +1 -1
  33. package/dist/index199.js +11 -19
  34. package/dist/index199.js.map +1 -1
  35. package/dist/index200.js +48 -14
  36. package/dist/index200.js.map +1 -1
  37. package/dist/index201.js +4 -6
  38. package/dist/index201.js.map +1 -1
  39. package/dist/index202.js +29 -5
  40. package/dist/index202.js.map +1 -1
  41. package/dist/index203.js +16 -6
  42. package/dist/index203.js.map +1 -1
  43. package/dist/index204.js +5 -4
  44. package/dist/index204.js.map +1 -1
  45. package/dist/index205.js +21 -6
  46. package/dist/index205.js.map +1 -1
  47. package/dist/index206.js +51 -16
  48. package/dist/index206.js.map +1 -1
  49. package/dist/index207.js +25 -4
  50. package/dist/index207.js.map +1 -1
  51. package/dist/index208.js +41 -4
  52. package/dist/index208.js.map +1 -1
  53. package/dist/index209.js +39 -12
  54. package/dist/index209.js.map +1 -1
  55. package/dist/index210.js +45 -10
  56. package/dist/index210.js.map +1 -1
  57. package/dist/index211.js +20 -13
  58. package/dist/index211.js.map +1 -1
  59. package/dist/index212.js +70 -13
  60. package/dist/index212.js.map +1 -1
  61. package/dist/index213.js +17 -4
  62. package/dist/index213.js.map +1 -1
  63. package/dist/index214.js +11 -5
  64. package/dist/index214.js.map +1 -1
  65. package/dist/index215.js +27 -6
  66. package/dist/index215.js.map +1 -1
  67. package/dist/index216.js +13 -5
  68. package/dist/index216.js.map +1 -1
  69. package/dist/index217.js +17 -53
  70. package/dist/index217.js.map +1 -1
  71. package/dist/index218.js +36 -8
  72. package/dist/index218.js.map +1 -1
  73. package/dist/index219.js +262 -4
  74. package/dist/index219.js.map +1 -1
  75. package/dist/index22.js.map +1 -1
  76. package/dist/index220.js +278 -4
  77. package/dist/index220.js.map +1 -1
  78. package/dist/index221.js +68 -8
  79. package/dist/index221.js.map +1 -1
  80. package/dist/index222.js +99 -4
  81. package/dist/index222.js.map +1 -1
  82. package/dist/index223.js +83 -4
  83. package/dist/index223.js.map +1 -1
  84. package/dist/index224.js +3 -3
  85. package/dist/index224.js.map +1 -1
  86. package/dist/index225.js +29 -10
  87. package/dist/index225.js.map +1 -1
  88. package/dist/index226.js +16 -9
  89. package/dist/index226.js.map +1 -1
  90. package/dist/index227.js +35 -10
  91. package/dist/index227.js.map +1 -1
  92. package/dist/index228.js +16 -10
  93. package/dist/index228.js.map +1 -1
  94. package/dist/index229.js +3 -10
  95. package/dist/index229.js.map +1 -1
  96. package/dist/index230.js +26 -9
  97. package/dist/index230.js.map +1 -1
  98. package/dist/index231.js +28 -6
  99. package/dist/index231.js.map +1 -1
  100. package/dist/index232.js +4 -6
  101. package/dist/index232.js.map +1 -1
  102. package/dist/index233.js +78 -4
  103. package/dist/index233.js.map +1 -1
  104. package/dist/index234.js +269 -5
  105. package/dist/index234.js.map +1 -1
  106. package/dist/index235.js +11 -6
  107. package/dist/index235.js.map +1 -1
  108. package/dist/index236.js +10 -5
  109. package/dist/index236.js.map +1 -1
  110. package/dist/index237.js +25 -29
  111. package/dist/index237.js.map +1 -1
  112. package/dist/index238.js +16 -12
  113. package/dist/index238.js.map +1 -1
  114. package/dist/index239.js +124 -24
  115. package/dist/index239.js.map +1 -1
  116. package/dist/index240.js +5 -5
  117. package/dist/index240.js.map +1 -1
  118. package/dist/index241.js +40 -16
  119. package/dist/index241.js.map +1 -1
  120. package/dist/index242.js +65 -7
  121. package/dist/index242.js.map +1 -1
  122. package/dist/index243.js +13 -10
  123. package/dist/index243.js.map +1 -1
  124. package/dist/index244.js +7 -10
  125. package/dist/index244.js.map +1 -1
  126. package/dist/index245.js +5 -21
  127. package/dist/index245.js.map +1 -1
  128. package/dist/index246.js +3 -10
  129. package/dist/index246.js.map +1 -1
  130. package/dist/index247.js +10 -9
  131. package/dist/index247.js.map +1 -1
  132. package/dist/index248.js +7 -9
  133. package/dist/index248.js.map +1 -1
  134. package/dist/index249.js +133 -4
  135. package/dist/index249.js.map +1 -1
  136. package/dist/index250.js +399 -5
  137. package/dist/index250.js.map +1 -1
  138. package/dist/index251.js +52 -16
  139. package/dist/index251.js.map +1 -1
  140. package/dist/index252.js +11 -9
  141. package/dist/index252.js.map +1 -1
  142. package/dist/index253.js +11 -18
  143. package/dist/index253.js.map +1 -1
  144. package/dist/index254.js +16 -15
  145. package/dist/index254.js.map +1 -1
  146. package/dist/index255.js +5 -12
  147. package/dist/index255.js.map +1 -1
  148. package/dist/index256.js +6 -20
  149. package/dist/index256.js.map +1 -1
  150. package/dist/index257.js +57 -65
  151. package/dist/index257.js.map +1 -1
  152. package/dist/index258.js +87 -6
  153. package/dist/index258.js.map +1 -1
  154. package/dist/index259.js +6 -11
  155. package/dist/index259.js.map +1 -1
  156. package/dist/index260.js +4 -50
  157. package/dist/index260.js.map +1 -1
  158. package/dist/index261.js +7 -4
  159. package/dist/index261.js.map +1 -1
  160. package/dist/index262.js +16 -29
  161. package/dist/index262.js.map +1 -1
  162. package/dist/index263.js +4 -16
  163. package/dist/index263.js.map +1 -1
  164. package/dist/index264.js +4 -5
  165. package/dist/index264.js.map +1 -1
  166. package/dist/index265.js +12 -21
  167. package/dist/index265.js.map +1 -1
  168. package/dist/index266.js +9 -51
  169. package/dist/index266.js.map +1 -1
  170. package/dist/index267.js +13 -25
  171. package/dist/index267.js.map +1 -1
  172. package/dist/index268.js +13 -41
  173. package/dist/index268.js.map +1 -1
  174. package/dist/index269.js +4 -39
  175. package/dist/index269.js.map +1 -1
  176. package/dist/index270.js +6 -45
  177. package/dist/index270.js.map +1 -1
  178. package/dist/index271.js +6 -20
  179. package/dist/index271.js.map +1 -1
  180. package/dist/index272.js +5 -70
  181. package/dist/index272.js.map +1 -1
  182. package/dist/index273.js +53 -16
  183. package/dist/index273.js.map +1 -1
  184. package/dist/index274.js +8 -11
  185. package/dist/index274.js.map +1 -1
  186. package/dist/index275.js +4 -27
  187. package/dist/index275.js.map +1 -1
  188. package/dist/index276.js +4 -13
  189. package/dist/index276.js.map +1 -1
  190. package/dist/index277.js +8 -18
  191. package/dist/index277.js.map +1 -1
  192. package/dist/index278.js +4 -36
  193. package/dist/index278.js.map +1 -1
  194. package/dist/index279.js +4 -262
  195. package/dist/index279.js.map +1 -1
  196. package/dist/index280.js +3 -278
  197. package/dist/index280.js.map +1 -1
  198. package/dist/index281.js +10 -68
  199. package/dist/index281.js.map +1 -1
  200. package/dist/index282.js +9 -99
  201. package/dist/index282.js.map +1 -1
  202. package/dist/index283.js +9 -83
  203. package/dist/index283.js.map +1 -1
  204. package/dist/index284.js +10 -3
  205. package/dist/index284.js.map +1 -1
  206. package/dist/index285.js +10 -29
  207. package/dist/index285.js.map +1 -1
  208. package/dist/index286.js +9 -16
  209. package/dist/index286.js.map +1 -1
  210. package/dist/index287.js +7 -35
  211. package/dist/index287.js.map +1 -1
  212. package/dist/index288.js +5 -16
  213. package/dist/index288.js.map +1 -1
  214. package/dist/index289.js +4 -3
  215. package/dist/index289.js.map +1 -1
  216. package/dist/index290.js +5 -26
  217. package/dist/index290.js.map +1 -1
  218. package/dist/index291.js +6 -28
  219. package/dist/index291.js.map +1 -1
  220. package/dist/index292.js +6 -4
  221. package/dist/index292.js.map +1 -1
  222. package/dist/index293.js +8 -78
  223. package/dist/index293.js.map +1 -1
  224. package/dist/index294.js +18 -268
  225. package/dist/index294.js.map +1 -1
  226. package/dist/index295.js +15 -10
  227. package/dist/index295.js.map +1 -1
  228. package/dist/index296.js +7 -10
  229. package/dist/index296.js.map +1 -1
  230. package/dist/index297.js +10 -25
  231. package/dist/index297.js.map +1 -1
  232. package/dist/index298.js +10 -16
  233. package/dist/index298.js.map +1 -1
  234. package/dist/index299.js +21 -125
  235. package/dist/index299.js.map +1 -1
  236. package/dist/index3.js.map +1 -1
  237. package/dist/index300.js +10 -5
  238. package/dist/index300.js.map +1 -1
  239. package/dist/index301.js +9 -40
  240. package/dist/index301.js.map +1 -1
  241. package/dist/index302.js +9 -65
  242. package/dist/index302.js.map +1 -1
  243. package/dist/index303.js +5 -14
  244. package/dist/index303.js.map +1 -1
  245. package/dist/index304.js +5 -7
  246. package/dist/index304.js.map +1 -1
  247. package/dist/index305.js +16 -5
  248. package/dist/index305.js.map +1 -1
  249. package/dist/index306.js +9 -3
  250. package/dist/index306.js.map +1 -1
  251. package/dist/index307.js +18 -10
  252. package/dist/index307.js.map +1 -1
  253. package/dist/index308.js +15 -7
  254. package/dist/index308.js.map +1 -1
  255. package/dist/index309.js +11 -132
  256. package/dist/index309.js.map +1 -1
  257. package/dist/index310.js +29 -399
  258. package/dist/index310.js.map +1 -1
  259. package/dist/index311.js +12 -52
  260. package/dist/index311.js.map +1 -1
  261. package/dist/index312.js +25 -11
  262. package/dist/index312.js.map +1 -1
  263. package/dist/index313.js +5 -11
  264. package/dist/index313.js.map +1 -1
  265. package/dist/index321.js +1 -1
  266. package/dist/index329.js +1 -1
  267. package/dist/index330.js +1 -1
  268. package/dist/index334.js +7 -8
  269. package/dist/index334.js.map +1 -1
  270. package/dist/index335.js +8 -7
  271. package/dist/index335.js.map +1 -1
  272. package/dist/index339.js +1 -1
  273. package/dist/index345.js +51 -17
  274. package/dist/index345.js.map +1 -1
  275. package/dist/index346.js +17 -51
  276. package/dist/index346.js.map +1 -1
  277. package/dist/index347.js +5 -122
  278. package/dist/index347.js.map +1 -1
  279. package/dist/index348.js +121 -31
  280. package/dist/index348.js.map +1 -1
  281. package/dist/index349.js +31 -72
  282. package/dist/index349.js.map +1 -1
  283. package/dist/index350.js +70 -139
  284. package/dist/index350.js.map +1 -1
  285. package/dist/index351.js +116 -35
  286. package/dist/index351.js.map +1 -1
  287. package/dist/index352.js +56 -44
  288. package/dist/index352.js.map +1 -1
  289. package/dist/index353.js +49 -14
  290. package/dist/index353.js.map +1 -1
  291. package/dist/index354.js +15 -6
  292. package/dist/index354.js.map +1 -1
  293. package/dist/index359.js +11 -4
  294. package/dist/index359.js.map +1 -1
  295. package/dist/index360.js +17 -18
  296. package/dist/index360.js.map +1 -1
  297. package/dist/index361.js +4 -13
  298. package/dist/index361.js.map +1 -1
  299. package/dist/index362.js +5 -11
  300. package/dist/index362.js.map +1 -1
  301. package/dist/index363.js +19 -15
  302. package/dist/index363.js.map +1 -1
  303. package/dist/index364.js +45 -6
  304. package/dist/index364.js.map +1 -1
  305. package/dist/index365.js +18 -4
  306. package/dist/index365.js.map +1 -1
  307. package/dist/index366.js +5 -21
  308. package/dist/index366.js.map +1 -1
  309. package/dist/index367.js +200 -44
  310. package/dist/index367.js.map +1 -1
  311. package/dist/index368.js +77 -17
  312. package/dist/index368.js.map +1 -1
  313. package/dist/index369.js +5 -5
  314. package/dist/index369.js.map +1 -1
  315. package/dist/index370.js +16 -199
  316. package/dist/index370.js.map +1 -1
  317. package/dist/index371.js +12 -77
  318. package/dist/index371.js.map +1 -1
  319. package/dist/index374.js +3 -3
  320. package/dist/index375.js +1 -1
  321. package/dist/index376.js +3 -3
  322. package/dist/index378.js +2 -2
  323. package/dist/index380.js +1 -1
  324. package/dist/index381.js +2 -2
  325. package/dist/index384.js +2 -2
  326. package/dist/index386.js +1 -1
  327. package/dist/index387.js +3 -5
  328. package/dist/index387.js.map +1 -1
  329. package/dist/index388.js +3 -5
  330. package/dist/index388.js.map +1 -1
  331. package/dist/index389.js +5 -4
  332. package/dist/index389.js.map +1 -1
  333. package/dist/index390.js +4 -15
  334. package/dist/index390.js.map +1 -1
  335. package/dist/index391.js +4 -9
  336. package/dist/index391.js.map +1 -1
  337. package/dist/index392.js +15 -5
  338. package/dist/index392.js.map +1 -1
  339. package/dist/index393.js +8 -4
  340. package/dist/index393.js.map +1 -1
  341. package/dist/index394.js +5 -545
  342. package/dist/index394.js.map +1 -1
  343. package/dist/index395.js +5 -47
  344. package/dist/index395.js.map +1 -1
  345. package/dist/index396.js +543 -15
  346. package/dist/index396.js.map +1 -1
  347. package/dist/index397.js +47 -6
  348. package/dist/index397.js.map +1 -1
  349. package/dist/index398.js +17 -7
  350. package/dist/index398.js.map +1 -1
  351. package/dist/index399.js +5 -6
  352. package/dist/index399.js.map +1 -1
  353. package/dist/index400.js +7 -7
  354. package/dist/index400.js.map +1 -1
  355. package/dist/index401.js +6 -11
  356. package/dist/index401.js.map +1 -1
  357. package/dist/index402.js +7 -8
  358. package/dist/index402.js.map +1 -1
  359. package/dist/index403.js +11 -12
  360. package/dist/index403.js.map +1 -1
  361. package/dist/index404.js +9 -3
  362. package/dist/index404.js.map +1 -1
  363. package/dist/index405.js +13 -3
  364. package/dist/index405.js.map +1 -1
  365. package/dist/index407.js +1 -1
  366. package/dist/index408.js +7 -4
  367. package/dist/index408.js.map +1 -1
  368. package/dist/index409.js +2 -56
  369. package/dist/index409.js.map +1 -1
  370. package/dist/index410.js +43 -67
  371. package/dist/index410.js.map +1 -1
  372. package/dist/index411.js +56 -31
  373. package/dist/index411.js.map +1 -1
  374. package/dist/index412.js +8 -9
  375. package/dist/index412.js.map +1 -1
  376. package/dist/index413.js +2 -153
  377. package/dist/index413.js.map +1 -1
  378. package/dist/index414.js +54 -107
  379. package/dist/index414.js.map +1 -1
  380. package/dist/index415.js +55 -7
  381. package/dist/index415.js.map +1 -1
  382. package/dist/index416.js +5 -2
  383. package/dist/index416.js.map +1 -1
  384. package/dist/index417.js +54 -42
  385. package/dist/index417.js.map +1 -1
  386. package/dist/index418.js +68 -56
  387. package/dist/index418.js.map +1 -1
  388. package/dist/index419.js +31 -8
  389. package/dist/index419.js.map +1 -1
  390. package/dist/index420.js +9 -2
  391. package/dist/index420.js.map +1 -1
  392. package/dist/index421.js +152 -54
  393. package/dist/index421.js.map +1 -1
  394. package/dist/index422.js +108 -56
  395. package/dist/index422.js.map +1 -1
  396. package/dist/index423.js +2 -16
  397. package/dist/index423.js.map +1 -1
  398. package/dist/index424.js +2 -29
  399. package/dist/index424.js.map +1 -1
  400. package/dist/index425.js +2 -13
  401. package/dist/index425.js.map +1 -1
  402. package/dist/index426.js +2 -7
  403. package/dist/index426.js.map +1 -1
  404. package/dist/index427.js +16 -2
  405. package/dist/index427.js.map +1 -1
  406. package/dist/index428.js +29 -2
  407. package/dist/index428.js.map +1 -1
  408. package/dist/index429.js +13 -2
  409. package/dist/index429.js.map +1 -1
  410. package/dist/index430.js +7 -2
  411. package/dist/index430.js.map +1 -1
  412. package/dist/index44.js +1 -1
  413. package/dist/index45.js +2 -2
  414. package/dist/index49.js +28 -28
  415. package/dist/index50.js +21 -21
  416. package/dist/index51.js +1 -1
  417. package/dist/index52.js +8 -8
  418. package/dist/index53.js +2 -2
  419. package/dist/index55.js +17 -17
  420. package/dist/index56.js +4 -4
  421. package/dist/index57.js +3 -3
  422. package/dist/index58.js +7 -7
  423. package/dist/index59.js +4 -4
  424. package/dist/index60.js +12 -12
  425. package/dist/index61.js +2 -2
  426. package/dist/index62.js +2 -2
  427. package/dist/index70.js +1 -1
  428. package/dist/index71.js +1 -1
  429. package/dist/index74.js +6 -2
  430. package/dist/index74.js.map +1 -1
  431. package/dist/index75.js +8 -2
  432. package/dist/index75.js.map +1 -1
  433. package/dist/index76.js +5 -5
  434. package/dist/index76.js.map +1 -1
  435. package/dist/index77.js +2 -8
  436. package/dist/index77.js.map +1 -1
  437. package/dist/index78.js +2 -6
  438. package/dist/index78.js.map +1 -1
  439. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index297.js","sources":["../../../node_modules/@base-ui/react/esm/utils/usePositioner.js"],"sourcesContent":["'use client';\n\nimport { popupStateMapping } from \"./popupStateMapping.js\";\nimport { useRenderElement } from \"../internals/useRenderElement.js\";\nimport { getDisabledMountTransitionStyles } from \"./getDisabledMountTransitionStyles.js\";\n/**\n * Renders the shared outer Positioner element used by popup components.\n * Applies the common role, hidden state, transition styles, state attributes, and optional inert styling.\n */\nexport function usePositioner(componentProps, state, {\n styles,\n transitionStatus,\n props,\n refs,\n hidden,\n inert = false\n}) {\n const style = {\n ...styles\n };\n if (inert) {\n style.pointerEvents = 'none';\n }\n return useRenderElement('div', componentProps, {\n state,\n ref: refs,\n props: [{\n role: 'presentation',\n hidden,\n style\n }, getDisabledMountTransitionStyles(transitionStatus), props],\n stateAttributesMapping: popupStateMapping\n });\n}"],"names":["usePositioner","componentProps","state","styles","transitionStatus","props","refs","hidden","inert","style","useRenderElement","getDisabledMountTransitionStyles","popupStateMapping"],"mappings":";;;AASO,SAASA,EAAcC,GAAgBC,GAAO;AAAA,EACnD,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,GAAG;AACD,QAAMC,IAAQ;AAAA,IACZ,GAAGN;AAAA,EACP;AACE,SAAIK,MACFC,EAAM,gBAAgB,SAEjBC,EAAiB,OAAOT,GAAgB;AAAA,IAC7C,OAAAC;AAAA,IACA,KAAKI;AAAA,IACL,OAAO,CAAC;AAAA,MACN,MAAM;AAAA,MACN,QAAAC;AAAA,MACA,OAAAE;AAAA,IACN,GAAOE,EAAiCP,CAAgB,GAAGC,CAAK;AAAA,IAC5D,wBAAwBO;AAAA,EAC5B,CAAG;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index297.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js"],"sourcesContent":["/**\n * Returns the months to display in the calendar.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n * calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param props The DayPicker props, including `numberOfMonths`.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of dates representing the months to display.\n */\nexport function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {\n const { numberOfMonths = 1 } = props;\n const months = [];\n for (let i = 0; i < numberOfMonths; i++) {\n const month = dateLib.addMonths(firstDisplayedMonth, i);\n if (calendarEndMonth && month > calendarEndMonth) {\n break;\n }\n months.push(month);\n }\n return months;\n}\n"],"names":["getDisplayMonths","firstDisplayedMonth","calendarEndMonth","props","dateLib","numberOfMonths","months","i","month"],"mappings":"AAUO,SAASA,EAAiBC,GAAqBC,GAAkBC,GAAOC,GAAS;AACpF,QAAM,EAAE,gBAAAC,IAAiB,EAAC,IAAKF,GACzBG,IAAS,CAAA;AACf,WAASC,IAAI,GAAGA,IAAIF,GAAgBE,KAAK;AACrC,UAAMC,IAAQJ,EAAQ,UAAUH,GAAqBM,CAAC;AACtD,QAAIL,KAAoBM,IAAQN;AAC5B;AAEJ,IAAAI,EAAO,KAAKE,CAAK;AAAA,EACrB;AACA,SAAOF;AACX;","x_google_ignoreList":[0]}
package/dist/index298.js CHANGED
@@ -1,20 +1,14 @@
1
- import * as e from "react";
2
- import { ownerDocument as m } from "./index284.js";
3
- import { useScrollLock as p } from "./index347.js";
4
- import { useIsoLayoutEffect as h } from "./index261.js";
5
- const S = 20;
6
- function L(t, c, o, l) {
7
- const [s, r] = e.useState(!1);
8
- h(() => {
9
- if (!t || !c || o == null) {
10
- r(!1);
11
- return;
12
- }
13
- const u = m(o).documentElement.clientWidth, f = o.offsetWidth;
14
- r(u > 0 && f > 0 && f >= u - S);
15
- }, [t, c, o]), p(t && (!c || s), l);
1
+ function u(i, o, n, e) {
2
+ const { month: s, defaultMonth: M, today: c = e.today(), numberOfMonths: f = 1 } = i;
3
+ let t = s || M || c;
4
+ const { differenceInCalendarMonths: h, addMonths: l, startOfMonth: r } = e;
5
+ if (n && h(n, t) < f - 1) {
6
+ const d = -1 * (f - 1);
7
+ t = l(n, d);
8
+ }
9
+ return o && h(t, o) < 0 && (t = o), r(t);
16
10
  }
17
11
  export {
18
- L as useAnchoredPopupScrollLock
12
+ u as getInitialMonth
19
13
  };
20
14
  //# sourceMappingURL=index298.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index298.js","sources":["../../../node_modules/@base-ui/react/esm/utils/useAnchoredPopupScrollLock.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\n\n// Touch-opened popups normally avoid scroll locking so users can still swipe outside to dismiss.\n// This hook re-enables scroll lock only when the popup is effectively full-width.\n// Treat popups with up to 20px of total horizontal gutter as full-width so common ~10px side\n// padding still locks scroll, since that leaves too little outside space for a reliable swipe.\nconst VIEWPORT_WIDTH_TOLERANCE_PX = 20;\n\n/**\n * Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when\n * enabled. For touch opens, scroll lock is applied only when the positioner width is effectively\n * viewport-sized.\n */\nexport function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {\n const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (!enabled || !touchOpen || positionerElement == null) {\n setTouchOpenShouldLockScroll(false);\n return;\n }\n const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;\n const popupWidth = positionerElement.offsetWidth;\n setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);\n }, [enabled, touchOpen, positionerElement]);\n useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);\n}"],"names":["VIEWPORT_WIDTH_TOLERANCE_PX","useAnchoredPopupScrollLock","enabled","touchOpen","positionerElement","referenceElement","touchOpenShouldLockScroll","setTouchOpenShouldLockScroll","React","useIsoLayoutEffect","viewportWidth","ownerDocument","popupWidth","useScrollLock"],"mappings":";;;;AAWA,MAAMA,IAA8B;AAO7B,SAASC,EAA2BC,GAASC,GAAWC,GAAmBC,GAAkB;AAClG,QAAM,CAACC,GAA2BC,CAA4B,IAAIC,EAAM,SAAS,EAAK;AACtF,EAAAC,EAAmB,MAAM;AACvB,QAAI,CAACP,KAAW,CAACC,KAAaC,KAAqB,MAAM;AACvD,MAAAG,EAA6B,EAAK;AAClC;AAAA,IACF;AACA,UAAMG,IAAgBC,EAAcP,CAAiB,EAAE,gBAAgB,aACjEQ,IAAaR,EAAkB;AACrC,IAAAG,EAA6BG,IAAgB,KAAKE,IAAa,KAAKA,KAAcF,IAAgBV,CAA2B;AAAA,EAC/H,GAAG,CAACE,GAASC,GAAWC,CAAiB,CAAC,GAC1CS,EAAcX,MAAY,CAACC,KAAaG,IAA4BD,CAAgB;AACtF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index298.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js"],"sourcesContent":["/**\n * Determines the initial month to display in the calendar based on the provided\n * props.\n *\n * This function calculates the starting month, considering constraints such as\n * `startMonth`, `endMonth`, and the number of months to display.\n *\n * @param props The DayPicker props, including navigation and date constraints.\n * @param dateLib The date library to use for date manipulation.\n * @returns The initial month to display.\n */\nexport function getInitialMonth(props, navStart, navEnd, dateLib) {\n const { month, defaultMonth, today = dateLib.today(), numberOfMonths = 1, } = props;\n let initialMonth = month || defaultMonth || today;\n const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;\n if (navEnd &&\n differenceInCalendarMonths(navEnd, initialMonth) < numberOfMonths - 1) {\n const offset = -1 * (numberOfMonths - 1);\n initialMonth = addMonths(navEnd, offset);\n }\n if (navStart && differenceInCalendarMonths(initialMonth, navStart) < 0) {\n initialMonth = navStart;\n }\n return startOfMonth(initialMonth);\n}\n"],"names":["getInitialMonth","props","navStart","navEnd","dateLib","month","defaultMonth","today","numberOfMonths","initialMonth","differenceInCalendarMonths","addMonths","startOfMonth","offset"],"mappings":"AAWO,SAASA,EAAgBC,GAAOC,GAAUC,GAAQC,GAAS;AAC9D,QAAM,EAAE,OAAAC,GAAO,cAAAC,GAAc,OAAAC,IAAQH,EAAQ,SAAS,gBAAAI,IAAiB,EAAC,IAAMP;AAC9E,MAAIQ,IAAeJ,KAASC,KAAgBC;AAC5C,QAAM,EAAE,4BAAAG,GAA4B,WAAAC,GAAW,cAAAC,EAAY,IAAKR;AAChE,MAAID,KACAO,EAA2BP,GAAQM,CAAY,IAAID,IAAiB,GAAG;AACvE,UAAMK,IAAS,MAAML,IAAiB;AACtC,IAAAC,IAAeE,EAAUR,GAAQU,CAAM;AAAA,EAC3C;AACA,SAAIX,KAAYQ,EAA2BD,GAAcP,CAAQ,IAAI,MACjEO,IAAeP,IAEZU,EAAaH,CAAY;AACpC;","x_google_ignoreList":[0]}
package/dist/index299.js CHANGED
@@ -1,129 +1,25 @@
1
- const S = ["top", "right", "bottom", "left"], m = Math.min, h = Math.max, w = Math.round, C = Math.floor, j = (t) => ({
2
- x: t,
3
- y: t
4
- }), p = {
5
- left: "right",
6
- right: "left",
7
- bottom: "top",
8
- top: "bottom"
9
- };
10
- function L(t, n, e) {
11
- return h(t, m(n, e));
12
- }
13
- function E(t, n) {
14
- return typeof t == "function" ? t(n) : t;
15
- }
16
- function g(t) {
17
- return t.split("-")[0];
18
- }
19
- function a(t) {
20
- return t.split("-")[1];
21
- }
22
- function x(t) {
23
- return t === "x" ? "y" : "x";
24
- }
25
- function b(t) {
26
- return t === "y" ? "height" : "width";
27
- }
28
- function d(t) {
29
- const n = t[0];
30
- return n === "t" || n === "b" ? "y" : "x";
31
- }
32
- function A(t) {
33
- return x(d(t));
34
- }
35
- function R(t, n, e) {
36
- e === void 0 && (e = !1);
37
- const r = a(t), i = A(t), o = b(i);
38
- let c = i === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
39
- return n.reference[o] > n.floating[o] && (c = f(c)), [c, f(c)];
40
- }
41
- function T(t) {
42
- const n = f(t);
43
- return [s(t), n, s(n)];
44
- }
45
- function s(t) {
46
- return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
47
- }
48
- const u = ["left", "right"], l = ["right", "left"], P = ["top", "bottom"], y = ["bottom", "top"];
49
- function O(t, n, e) {
50
- switch (t) {
51
- case "top":
52
- case "bottom":
53
- return e ? n ? l : u : n ? u : l;
54
- case "left":
55
- case "right":
56
- return n ? P : y;
57
- default:
58
- return [];
59
- }
60
- }
61
- function k(t, n, e, r) {
62
- const i = a(t);
63
- let o = O(g(t), e === "start", r);
64
- return i && (o = o.map((c) => c + "-" + i), n && (o = o.concat(o.map(s)))), o;
65
- }
66
- function f(t) {
67
- const n = g(t);
68
- return p[n] + t.slice(n.length);
69
- }
70
- function M(t) {
71
- return {
72
- top: 0,
73
- right: 0,
74
- bottom: 0,
75
- left: 0,
76
- ...t
77
- };
78
- }
79
- function q(t) {
80
- return typeof t != "number" ? M(t) : {
81
- top: t,
82
- right: t,
83
- bottom: t,
84
- left: t
85
- };
86
- }
87
- function z(t) {
88
- const {
89
- x: n,
90
- y: e,
91
- width: r,
92
- height: i
93
- } = t;
94
- return {
95
- width: r,
96
- height: i,
97
- top: e,
98
- left: n,
99
- right: n + r,
100
- bottom: e + i,
101
- x: n,
102
- y: e
103
- };
1
+ import { CalendarDay as F } from "./index254.js";
2
+ import { CalendarWeek as N } from "./index256.js";
3
+ import { CalendarMonth as P } from "./index255.js";
4
+ function j(l, f, e, c) {
5
+ const { addDays: y, endOfBroadcastWeek: D, endOfISOWeek: h, endOfMonth: k, endOfWeek: C, getISOWeek: I, getWeek: M, startOfBroadcastWeek: S, startOfISOWeek: g, startOfWeek: w } = c, o = l.reduce((W, t) => {
6
+ const x = e.broadcastCalendar ? S(t, c) : e.ISOWeek ? g(t) : w(t), d = e.broadcastCalendar ? D(t) : e.ISOWeek ? h(k(t)) : C(k(t)), a = f.filter((r) => r >= x && r <= d), O = e.broadcastCalendar ? 35 : 42;
7
+ if (e.fixedWeeks && a.length < O) {
8
+ const r = f.filter((n) => {
9
+ const s = O - a.length;
10
+ return n > d && n <= y(d, s);
11
+ });
12
+ a.push(...r);
13
+ }
14
+ const b = a.reduce((r, n) => {
15
+ const s = e.ISOWeek ? I(n) : M(n), i = r.find((B) => B.weekNumber === s), u = new F(n, t, c);
16
+ return i ? i.days.push(u) : r.push(new N(s, [u])), r;
17
+ }, []), v = new P(t, b);
18
+ return W.push(v), W;
19
+ }, []);
20
+ return e.reverseMonths ? o.reverse() : o;
104
21
  }
105
22
  export {
106
- L as clamp,
107
- j as createCoords,
108
- E as evaluate,
109
- M as expandPaddingObject,
110
- C as floor,
111
- a as getAlignment,
112
- A as getAlignmentAxis,
113
- R as getAlignmentSides,
114
- b as getAxisLength,
115
- T as getExpandedPlacements,
116
- s as getOppositeAlignmentPlacement,
117
- x as getOppositeAxis,
118
- k as getOppositeAxisPlacements,
119
- f as getOppositePlacement,
120
- q as getPaddingObject,
121
- g as getSide,
122
- d as getSideAxis,
123
- h as max,
124
- m as min,
125
- z as rectToClientRect,
126
- w as round,
127
- S as sides
23
+ j as getMonths
128
24
  };
129
25
  //# sourceMappingURL=index299.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index299.js","sources":["../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"],"sourcesContent":["/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n"],"names":["sides","min","max","round","floor","createCoords","v","oppositeSideMap","clamp","start","value","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","x","y","width","height"],"mappings":"AAKK,MAACA,IAAQ,CAAC,OAAO,SAAS,UAAU,MAAM,GAGzCC,IAAM,KAAK,KACXC,IAAM,KAAK,KACXC,IAAQ,KAAK,OACbC,IAAQ,KAAK,OACbC,IAAe,CAAAC,OAAM;AAAA,EACzB,GAAGA;AAAA,EACH,GAAGA;AACL,IACMC,IAAkB;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AACP;AACA,SAASC,EAAMC,GAAOC,GAAOC,GAAK;AAChC,SAAOT,EAAIO,GAAOR,EAAIS,GAAOC,CAAG,CAAC;AACnC;AACA,SAASC,EAASF,GAAOG,GAAO;AAC9B,SAAO,OAAOH,KAAU,aAAaA,EAAMG,CAAK,IAAIH;AACtD;AACA,SAASI,EAAQC,GAAW;AAC1B,SAAOA,EAAU,MAAM,GAAG,EAAE,CAAC;AAC/B;AACA,SAASC,EAAaD,GAAW;AAC/B,SAAOA,EAAU,MAAM,GAAG,EAAE,CAAC;AAC/B;AACA,SAASE,EAAgBC,GAAM;AAC7B,SAAOA,MAAS,MAAM,MAAM;AAC9B;AACA,SAASC,EAAcD,GAAM;AAC3B,SAAOA,MAAS,MAAM,WAAW;AACnC;AACA,SAASE,EAAYL,GAAW;AAC9B,QAAMM,IAAYN,EAAU,CAAC;AAC7B,SAAOM,MAAc,OAAOA,MAAc,MAAM,MAAM;AACxD;AACA,SAASC,EAAiBP,GAAW;AACnC,SAAOE,EAAgBG,EAAYL,CAAS,CAAC;AAC/C;AACA,SAASQ,EAAkBR,GAAWS,GAAOC,GAAK;AAChD,EAAIA,MAAQ,WACVA,IAAM;AAER,QAAMC,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K,OAAOA,EAAK,IAAIX,CAA6B,CAAC,KAGvDW;AACT;AACA,SAASd,EAAqBf,GAAW;AACvC,QAAMwB,IAAOzB,EAAQC,CAAS;AAC9B,SAAOR,EAAgBgC,CAAI,IAAIxB,EAAU,MAAMwB,EAAK,MAAM;AAC5D;AACA,SAASM,EAAoBC,GAAS;AACpC,SAAO;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,GAAGA;AAAA,EACP;AACA;AACA,SAASC,EAAiBD,GAAS;AACjC,SAAO,OAAOA,KAAY,WAAWD,EAAoBC,CAAO,IAAI;AAAA,IAClE,KAAKA;AAAA,IACL,OAAOA;AAAA,IACP,QAAQA;AAAA,IACR,MAAMA;AAAA,EACV;AACA;AACA,SAASE,EAAiBC,GAAM;AAC9B,QAAM;AAAA,IACJ,GAAAC;AAAA,IACA,GAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,EACJ,IAAMJ;AACJ,SAAO;AAAA,IACL,OAAAG;AAAA,IACA,QAAAC;AAAA,IACA,KAAKF;AAAA,IACL,MAAMD;AAAA,IACN,OAAOA,IAAIE;AAAA,IACX,QAAQD,IAAIE;AAAA,IACZ,GAAAH;AAAA,IACA,GAAAC;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index299.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js"],"sourcesContent":["import { CalendarDay, CalendarMonth, CalendarWeek } from \"../classes/index.js\";\n/**\n * Returns the months to display in the calendar.\n *\n * This function generates `CalendarMonth` objects for each month to be\n * displayed, including their weeks and days, based on the provided display\n * months and dates.\n *\n * @param displayMonths The months (as dates) to display in the calendar.\n * @param dates The dates to display in the calendar.\n * @param props Options from the DayPicker props context.\n * @param dateLib The date library to use for date manipulation.\n * @returns An array of `CalendarMonth` objects representing the months to\n * display.\n */\nexport function getMonths(displayMonths, dates, props, dateLib) {\n const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek, } = dateLib;\n const dayPickerMonths = displayMonths.reduce((months, month) => {\n const firstDateOfFirstWeek = props.broadcastCalendar\n ? startOfBroadcastWeek(month, dateLib)\n : props.ISOWeek\n ? startOfISOWeek(month)\n : startOfWeek(month);\n const lastDateOfLastWeek = props.broadcastCalendar\n ? endOfBroadcastWeek(month)\n : props.ISOWeek\n ? endOfISOWeek(endOfMonth(month))\n : endOfWeek(endOfMonth(month));\n /** The dates to display in the month. */\n const monthDates = dates.filter((date) => {\n return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;\n });\n const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;\n if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {\n const extraDates = dates.filter((date) => {\n const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;\n return (date > lastDateOfLastWeek &&\n date <= addDays(lastDateOfLastWeek, daysToAdd));\n });\n monthDates.push(...extraDates);\n }\n const weeks = monthDates.reduce((weeks, date) => {\n const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);\n const week = weeks.find((week) => week.weekNumber === weekNumber);\n const day = new CalendarDay(date, month, dateLib);\n if (!week) {\n weeks.push(new CalendarWeek(weekNumber, [day]));\n }\n else {\n week.days.push(day);\n }\n return weeks;\n }, []);\n const dayPickerMonth = new CalendarMonth(month, weeks);\n months.push(dayPickerMonth);\n return months;\n }, []);\n if (!props.reverseMonths) {\n return dayPickerMonths;\n }\n else {\n return dayPickerMonths.reverse();\n }\n}\n"],"names":["getMonths","displayMonths","dates","props","dateLib","addDays","endOfBroadcastWeek","endOfISOWeek","endOfMonth","endOfWeek","getISOWeek","getWeek","startOfBroadcastWeek","startOfISOWeek","startOfWeek","dayPickerMonths","months","month","firstDateOfFirstWeek","lastDateOfLastWeek","monthDates","date","nrOfDaysWithFixedWeeks","extraDates","daysToAdd","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AaJ,GAAY,CAACE,CAAG,CAAC,CAAC,GAK3CH;AAAA,IACX,GAAG,CAAA,CAAE,GACCM,IAAiB,IAAIC,EAAcf,GAAOQ,CAAK;AACrD,WAAAT,EAAO,KAAKe,CAAc,GACnBf;AAAA,EACX,GAAG,CAAA,CAAE;AACL,SAAKb,EAAM,gBAIAY,EAAgB,QAAO,IAHvBA;AAKf;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- {"version":3,"file":"index3.js","sources":["../src/components/AddressAutocompleteInput/index.tsx"],"sourcesContent":["import { ReactNode, ChangeEvent, KeyboardEvent, useState, useEffect, useRef, useMemo } from \"react\"\nimport clsx from \"clsx\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { useMapsLibrary } from \"@/helpers/useMapsLibrary\"\nimport { Input } from \"@/components/Input\"\nimport { cn } from \"@/lib/utils\"\n\n\nconst DEFAULT_ALLOWED_TYPES = new Set([\n \"street_address\",\n \"route\",\n \"premise\",\n \"subpremise\",\n \"intersection\",\n \"sublocality\",\n \"sublocality_level_1\",\n \"sublocality_level_2\",\n \"sublocality_level_3\",\n \"sublocality_level_4\",\n \"sublocality_level_5\",\n \"administrative_area_level_1\",\n \"administrative_area_level_2\",\n \"administrative_area_level_3\",\n \"administrative_area_level_4\",\n \"administrative_area_level_5\",\n \"administrative_area_level_6\",\n \"administrative_area_level_7\",\n \"postal_code\",\n \"locality\",\n \"country\",\n \"geocode\",\n \"plus_code\",\n \"political\",\n \"neighborhood\",\n \"colloquial_area\",\n \"lodging\",\n \"train_station\",\n \"transit_station\",\n])\n\nconst getDisplayText = (prediction: google.maps.places.PlacePrediction) => {\n const fullText = prediction.text?.text ?? \"\"\n return fullText.replace(/, France$/, \"\").trim()\n}\n\nconst PredictionItem = ({ prediction }: { prediction: google.maps.places.PlacePrediction }) => {\n const displayText = getDisplayText(prediction)\n const fullText = prediction.text?.text ?? \"\"\n const matches = prediction.text?.matches ?? []\n const wasCountryRemoved = displayText.length < fullText.length\n\n if (matches.length === 0) {\n return <>{displayText}</>\n }\n\n const parts: ReactNode[] = []\n let lastIndex = 0\n\n matches.forEach((substring, index) => {\n if (wasCountryRemoved && substring.startOffset >= displayText.length) {\n return\n }\n\n const startOffset = substring.startOffset\n const endOffset = Math.min(substring.endOffset, displayText.length)\n\n if (startOffset > lastIndex) {\n parts.push(displayText.substring(lastIndex, startOffset))\n }\n\n if (endOffset > startOffset) {\n const matched = displayText.substring(startOffset, endOffset)\n parts.push(<strong key={index}>{matched}</strong>)\n }\n\n lastIndex = Math.max(lastIndex, endOffset)\n })\n\n if (lastIndex < displayText.length) {\n parts.push(displayText.substring(lastIndex))\n }\n\n if (parts.length === 0) {\n return <>{displayText}</>\n }\n\n return <>{parts}</>\n}\n\nconst isAllowedPrediction = (\n prediction: google.maps.places.PlacePrediction,\n allowedTypes: ReadonlySet<string> | null,\n) => {\n if (!prediction.types || prediction.types.length === 0) {\n return true\n }\n\n if (!allowedTypes || allowedTypes.size === 0) {\n return true\n }\n\n return prediction.types.some(type => allowedTypes.has(type))\n}\n\nconst getPredictionId = (prediction: google.maps.places.PlacePrediction, index: number) =>\n prediction.placeId || `${prediction.text?.text ?? \"prediction\"}-${index}`\n\nconst getUniquePredictions = (predictions: google.maps.places.PlacePrediction[]) => {\n const map = new Map<string, google.maps.places.PlacePrediction>()\n\n predictions.forEach(prediction => {\n const key = prediction.placeId\n\n if (!key) {\n return\n }\n\n if (!map.has(key)) {\n map.set(key, prediction)\n }\n })\n\n return Array.from(map.values())\n}\n\nconst getFilteredPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => predictions.filter(prediction => isAllowedPrediction(prediction, allowedTypes))\n\nconst sortPredictions = (predictions: google.maps.places.PlacePrediction[]) =>\n predictions.sort((a, b) => {\n const aDistance = a.distanceMeters ?? Number.POSITIVE_INFINITY\n const bDistance = b.distanceMeters ?? Number.POSITIVE_INFINITY\n\n return aDistance - bDistance\n })\n\nconst buildDisplayPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => sortPredictions(getFilteredPredictions(getUniquePredictions(predictions), allowedTypes))\n\nconst isExactMatch = (prediction: google.maps.places.PlacePrediction, value: string) => {\n const display = getDisplayText(prediction)\n return display.toLowerCase() === value.trim().toLowerCase()\n}\n\nexport const AddressAutocompleteInput = ({\n id,\n label,\n placeholder,\n value,\n onValueChange,\n disabled,\n name,\n className,\n autofillShimName,\n googleMapsApiKey,\n locationRestriction,\n allowedTypes,\n}: {\n id: string\n label: string\n placeholder: string\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name?: string\n className?: string\n autofillShimName?: string\n googleMapsApiKey?: string\n locationRestriction?: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds\n allowedTypes?: Iterable<string>\n}) => {\n const [inputValue, setInputValue] = useState(value ?? \"\")\n const [predictions, setPredictions] = useState<google.maps.places.PlacePrediction[]>([])\n const [isDropdownOpen, setIsDropdownOpen] = useState(false)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [isLoading, setIsLoading] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const dropdownRef = useRef<HTMLUListElement>(null)\n const isSelecting = useRef(false)\n const hasUserTyped = useRef(false)\n const sessionTokenRef = useRef<google.maps.places.AutocompleteSessionToken | null>(null)\n const optionRefs = useRef<(HTMLLIElement | null)[]>([])\n const scrollBehaviorRef = useRef<ScrollBehavior>(\"smooth\")\n const placesLibrary = useMapsLibrary(\"places\", googleMapsApiKey)\n const allowedTypesSet = useMemo(() => {\n if (!allowedTypes) {\n return DEFAULT_ALLOWED_TYPES\n }\n\n const newSet = new Set<string>()\n for (const type of allowedTypes) {\n newSet.add(type)\n }\n return newSet\n }, [allowedTypes])\n\n useEffect(() => {\n setInputValue(value ?? \"\")\n hasUserTyped.current = false\n }, [value])\n\n useEffect(() => {\n if (isSelecting.current) {\n isSelecting.current = false\n return\n }\n\n const trimmed = inputValue.trim()\n\n if (trimmed === \"\") {\n setIsLoading(false)\n } else {\n setIsLoading(true)\n }\n\n let isActive = true\n\n const handler = setTimeout(() => {\n if (!isActive) {\n return\n }\n\n if (trimmed === \"\") {\n setPredictions([])\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n if (value !== \"\") {\n onValueChange(\"\")\n }\n return\n }\n\n if (!placesLibrary) return\n\n const { AutocompleteSuggestion, AutocompleteSessionToken } = placesLibrary\n\n if (!AutocompleteSuggestion || !AutocompleteSessionToken) {\n console.error(\"AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports\")\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (!sessionTokenRef.current) {\n sessionTokenRef.current = new AutocompleteSessionToken()\n }\n\n const request: google.maps.places.AutocompleteRequest = {\n input: inputValue,\n sessionToken: sessionTokenRef.current ?? undefined,\n includedRegionCodes: [\"fr\"],\n }\n if (locationRestriction) {\n request.locationRestriction = locationRestriction\n }\n\n AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response: { suggestions: google.maps.places.AutocompleteSuggestion[] }) => {\n if (!isActive) {\n return\n }\n\n const placePredictions = response.suggestions\n .map((suggestion: google.maps.places.AutocompleteSuggestion) => suggestion.placePrediction)\n .filter((prediction): prediction is google.maps.places.PlacePrediction => Boolean(prediction))\n\n const combinedPredictions = buildDisplayPredictions(placePredictions, allowedTypesSet)\n\n const singlePrediction = combinedPredictions[0]\n const hasExactMatch =\n singlePrediction && combinedPredictions.length === 1 && isExactMatch(singlePrediction, inputValue)\n\n if (!hasUserTyped.current && hasExactMatch) {\n setPredictions(combinedPredictions)\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (combinedPredictions.length > 0) {\n setPredictions(combinedPredictions)\n if (hasUserTyped.current) {\n setIsDropdownOpen(true)\n }\n setHighlightedIndex(-1)\n } else {\n setPredictions([])\n setIsDropdownOpen(false)\n }\n setIsLoading(false)\n })\n .catch((error: unknown) => {\n if (!isActive) {\n return\n }\n console.error(\"AddressAutocompleteInput: suggestion fetch failed\", error)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n })\n }, 300)\n\n return () => {\n isActive = false\n clearTimeout(handler)\n }\n }, [inputValue, placesLibrary, onValueChange, value, locationRestriction, allowedTypesSet])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n inputRef.current &&\n !inputRef.current.contains(event.target as Node) &&\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false)\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside)\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside)\n }\n }, [])\n\n const handleSelectPrediction = (prediction: google.maps.places.PlacePrediction) => {\n isSelecting.current = true\n const newAddress = getDisplayText(prediction)\n setInputValue(newAddress)\n onValueChange(newAddress)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n sessionTokenRef.current = null\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n hasUserTyped.current = true\n setInputValue(e.target.value)\n }\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (!isDropdownOpen || predictions.length === 0) {\n if (e.key === \"Enter\") {\n e.preventDefault()\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n return\n }\n\n if (e.key === \"ArrowDown\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n return prev < 0 ? 0 : (prev + 1) % predictions.length\n })\n } else if (e.key === \"ArrowUp\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n if (prev <= 0) {\n return predictions.length - 1\n }\n return (prev - 1) % predictions.length\n })\n } else if (e.key === \"Enter\") {\n e.preventDefault()\n if (highlightedIndex > -1 && predictions[highlightedIndex]) {\n handleSelectPrediction(predictions[highlightedIndex])\n } else {\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n } else if (e.key === \"Escape\") {\n setIsDropdownOpen(false)\n }\n }\n\n const handleBlur = () => {\n setIsDropdownOpen(false)\n if (value !== inputValue) {\n onValueChange(inputValue)\n }\n sessionTokenRef.current = null\n }\n\n const shimName = autofillShimName ?? (name ? `${name}_shim` : undefined)\n\n useEffect(() => {\n if (!isDropdownOpen || highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const item = optionRefs.current[highlightedIndex]\n const list = dropdownRef.current\n\n if (!item || !list) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n\n const top = item.offsetTop\n const bottom = top + item.offsetHeight\n const viewTop = list.scrollTop\n const viewBottom = viewTop + list.clientHeight\n\n if (top >= viewTop && bottom <= viewBottom) {\n return\n }\n\n item.scrollIntoView({\n block: \"nearest\",\n behavior,\n })\n }, [highlightedIndex, isDropdownOpen])\n\n optionRefs.current.length = predictions.length\n\n return (\n <div className=\"relative\">\n {shimName && (\n <input\n tabIndex={-1}\n autoComplete=\"street-address\"\n name={shimName}\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"-9999px\",\n top: \"-9999px\",\n height: \"1px\",\n width: \"1px\",\n }}\n />\n )}\n <label htmlFor={id} className=\"text-left block text-sm font-medium text-gray-700 mb-1 cursor-pointer\">\n {label}\n </label>\n <div className=\"relative\">\n <Input\n ref={inputRef}\n id={id}\n type=\"text\"\n placeholder={placeholder}\n name={name ?? `${id}_input`}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={() => {\n if (predictions.length > 0 && inputValue) {\n setIsDropdownOpen(true)\n }\n }}\n onBlur={handleBlur}\n disabled={disabled}\n autoComplete=\"new-password\"\n className={cn(\"w-full\", isLoading && \"pr-9\", className)}\n />\n {isLoading && (\n <Loader2\n className=\"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-gray-400\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isDropdownOpen && predictions.length > 0 && (\n <ul\n ref={dropdownRef}\n className=\"absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg\"\n role=\"listbox\"\n >\n {predictions.map((prediction, index) => (\n <li\n key={getPredictionId(prediction, index)}\n ref={node => {\n optionRefs.current[index] = node\n }}\n className={clsx(\n \"cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100\",\n { \"bg-gray-100\": highlightedIndex === index },\n )}\n role=\"option\"\n onMouseDown={e => {\n e.preventDefault()\n handleSelectPrediction(prediction)\n }}\n >\n <PredictionItem prediction={prediction} />\n </li>\n ))}\n </ul>\n )}\n </div>\n )\n}\n"],"names":["DEFAULT_ALLOWED_TYPES","Set","getDisplayText","prediction","text","replace","trim","PredictionItem","t0","$","_c","displayText","parts","t1","Symbol","for","bb0","fullText","matches","wasCountryRemoved","length","lastIndex","forEach","substring","index","startOffset","endOffset","Math","min","push","matched","jsx","max","t2","isAllowedPrediction","allowedTypes","types","size","some","type","has","getPredictionId","placeId","getUniquePredictions","predictions","map","Map","key","set","Array","from","values","getFilteredPredictions","filter","sortPredictions","sort","a","b","aDistance","distanceMeters","Number","POSITIVE_INFINITY","bDistance","buildDisplayPredictions","isExactMatch","value","toLowerCase","AddressAutocompleteInput","id","label","placeholder","onValueChange","disabled","name","className","autofillShimName","googleMapsApiKey","locationRestriction","inputValue","setInputValue","useState","setPredictions","isDropdownOpen","setIsDropdownOpen","highlightedIndex","setHighlightedIndex","isLoading","setIsLoading","inputRef","useRef","dropdownRef","isSelecting","hasUserTyped","sessionTokenRef","optionRefs","scrollBehaviorRef","placesLibrary","useMapsLibrary","allowedTypesSet","useMemo","newSet","add","useEffect","current","trimmed","isActive","handler","setTimeout","AutocompleteSuggestion","AutocompleteSessionToken","console","error","request","input","sessionToken","undefined","includedRegionCodes","fetchAutocompleteSuggestions","then","response","placePredictions","suggestions","suggestion","placePrediction","Boolean","combinedPredictions","singlePrediction","hasExactMatch","catch","clearTimeout","handleClickOutside","event","contains","target","document","addEventListener","removeEventListener","handleSelectPrediction","newAddress","handleInputChange","e","handleKeyDown","preventDefault","repeat","prev","handleBlur","shimName","item","list","behavior","top","offsetTop","bottom","offsetHeight","viewTop","scrollTop","viewBottom","clientHeight","scrollIntoView","block","jsxs","position","left","height","width","Input","cn","Loader2","node","clsx"],"mappings":";;;;;;;;AASA,MAAMA,KAAwB,oBAAIC,IAAI,CACpC,kBACA,SACA,WACA,cACA,gBACA,eACA,uBACA,uBACA,uBACA,uBACA,uBACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,eACA,YACA,WACA,WACA,aACA,aACA,gBACA,mBACA,WACA,iBACA,iBAAiB,CAClB,GAEKC,IAAiBA,CAACC,OACLA,EAAWC,MAAMA,QAAQ,IAC1BC,QAAQ,aAAa,EAAE,EAAEC,KAAAA,GAGrCC,KAAiBC,CAAAA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GAAC;AAAA,IAAAP,YAAAA;AAAAA,EAAAA,IAAAK;AAAkE,MAAAG,GAAAC,GAAAC;AAAA,MAAAJ,SAAAN,GAAA;AAO/EU,IAAAA,IAAAC,uBAAkBC,IAAlB,6BAAiB;AAACC,IAAAA,GAAA;AAN3BL,MAAAA,IAAoBT,EAAeC,CAAU;AAC7C,YAAAc,IAAiBd,EAAUC,MAAWA,QAArB,IACjBc,IAAgBf,EAAUC,MAAcc,WAAxB,CAAA,GAChBC,IAA0BR,EAAWS,SAAUH,EAAQG;AAEvD,UAAIF,EAAOE,WAAY,GAAC;AACfP,QAAAA,wCAAGF,UAAAA,EAAAA,CAAW;AAAd,cAAAK;AAAAA,MAAkB;AAG3BJ,MAAAA,IAA2B,C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1C,GAAYqB,MAC5BO,gBAAAA,EAAAA,IAAC,MAAA,EAEC,KAAKyI,CAAAA,MAAQ;AACX1E,MAAAA,EAAWS,QAAQ/E,CAAK,IAAIgJ;AAAAA,IAC9B,GACA,WAAWC,GACT,oEACA;AAAA,MAAE,eAAerF,MAAqB5D;AAAAA,IAAAA,CACxC,GACA,MAAK,UACL,aAAaoH,CAAAA,MAAK;AAChBA,MAAAA,EAAEE,eAAAA,GACFL,EAAuBtI,CAAU;AAAA,IACnC,GAEA,UAAA4B,gBAAAA,EAAAA,IAACxB,IAAA,EAAe,YAAYJ,GAAW,EAAA,GAdlCsC,GAAgBtC,GAAYqB,CAAK,CAexC,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"index3.js","sources":["../src/components/AddressAutocompleteInput/index.tsx"],"sourcesContent":["/// <reference types=\"google.maps\" />\n\nimport { ReactNode, ChangeEvent, KeyboardEvent, useState, useEffect, useRef, useMemo } from \"react\"\nimport clsx from \"clsx\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { useMapsLibrary } from \"@/helpers/useMapsLibrary\"\nimport { Input } from \"@/components/Input\"\nimport { cn } from \"@/lib/utils\"\n\n\nconst DEFAULT_ALLOWED_TYPES = new Set([\n \"street_address\",\n \"route\",\n \"premise\",\n \"subpremise\",\n \"intersection\",\n \"sublocality\",\n \"sublocality_level_1\",\n \"sublocality_level_2\",\n \"sublocality_level_3\",\n \"sublocality_level_4\",\n \"sublocality_level_5\",\n \"administrative_area_level_1\",\n \"administrative_area_level_2\",\n \"administrative_area_level_3\",\n \"administrative_area_level_4\",\n \"administrative_area_level_5\",\n \"administrative_area_level_6\",\n \"administrative_area_level_7\",\n \"postal_code\",\n \"locality\",\n \"country\",\n \"geocode\",\n \"plus_code\",\n \"political\",\n \"neighborhood\",\n \"colloquial_area\",\n \"lodging\",\n \"train_station\",\n \"transit_station\",\n])\n\nconst getDisplayText = (prediction: google.maps.places.PlacePrediction) => {\n const fullText = prediction.text?.text ?? \"\"\n return fullText.replace(/, France$/, \"\").trim()\n}\n\nconst PredictionItem = ({ prediction }: { prediction: google.maps.places.PlacePrediction }) => {\n const displayText = getDisplayText(prediction)\n const fullText = prediction.text?.text ?? \"\"\n const matches = prediction.text?.matches ?? []\n const wasCountryRemoved = displayText.length < fullText.length\n\n if (matches.length === 0) {\n return <>{displayText}</>\n }\n\n const parts: ReactNode[] = []\n let lastIndex = 0\n\n matches.forEach((substring, index) => {\n if (wasCountryRemoved && substring.startOffset >= displayText.length) {\n return\n }\n\n const startOffset = substring.startOffset\n const endOffset = Math.min(substring.endOffset, displayText.length)\n\n if (startOffset > lastIndex) {\n parts.push(displayText.substring(lastIndex, startOffset))\n }\n\n if (endOffset > startOffset) {\n const matched = displayText.substring(startOffset, endOffset)\n parts.push(<strong key={index}>{matched}</strong>)\n }\n\n lastIndex = Math.max(lastIndex, endOffset)\n })\n\n if (lastIndex < displayText.length) {\n parts.push(displayText.substring(lastIndex))\n }\n\n if (parts.length === 0) {\n return <>{displayText}</>\n }\n\n return <>{parts}</>\n}\n\nconst isAllowedPrediction = (\n prediction: google.maps.places.PlacePrediction,\n allowedTypes: ReadonlySet<string> | null,\n) => {\n if (!prediction.types || prediction.types.length === 0) {\n return true\n }\n\n if (!allowedTypes || allowedTypes.size === 0) {\n return true\n }\n\n return prediction.types.some(type => allowedTypes.has(type))\n}\n\nconst getPredictionId = (prediction: google.maps.places.PlacePrediction, index: number) =>\n prediction.placeId || `${prediction.text?.text ?? \"prediction\"}-${index}`\n\nconst getUniquePredictions = (predictions: google.maps.places.PlacePrediction[]) => {\n const map = new Map<string, google.maps.places.PlacePrediction>()\n\n predictions.forEach(prediction => {\n const key = prediction.placeId\n\n if (!key) {\n return\n }\n\n if (!map.has(key)) {\n map.set(key, prediction)\n }\n })\n\n return Array.from(map.values())\n}\n\nconst getFilteredPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => predictions.filter(prediction => isAllowedPrediction(prediction, allowedTypes))\n\nconst sortPredictions = (predictions: google.maps.places.PlacePrediction[]) =>\n predictions.sort((a, b) => {\n const aDistance = a.distanceMeters ?? Number.POSITIVE_INFINITY\n const bDistance = b.distanceMeters ?? Number.POSITIVE_INFINITY\n\n return aDistance - bDistance\n })\n\nconst buildDisplayPredictions = (\n predictions: google.maps.places.PlacePrediction[],\n allowedTypes: ReadonlySet<string> | null,\n) => sortPredictions(getFilteredPredictions(getUniquePredictions(predictions), allowedTypes))\n\nconst isExactMatch = (prediction: google.maps.places.PlacePrediction, value: string) => {\n const display = getDisplayText(prediction)\n return display.toLowerCase() === value.trim().toLowerCase()\n}\n\nexport const AddressAutocompleteInput = ({\n id,\n label,\n placeholder,\n value,\n onValueChange,\n disabled,\n name,\n className,\n autofillShimName,\n googleMapsApiKey,\n locationRestriction,\n allowedTypes,\n}: {\n id: string\n label: string\n placeholder: string\n value: string | undefined\n onValueChange: (value: string) => void\n disabled?: boolean\n name?: string\n className?: string\n autofillShimName?: string\n googleMapsApiKey?: string\n locationRestriction?: google.maps.LatLngBoundsLiteral | google.maps.LatLngBounds\n allowedTypes?: Iterable<string>\n}) => {\n const [inputValue, setInputValue] = useState(value ?? \"\")\n const [predictions, setPredictions] = useState<google.maps.places.PlacePrediction[]>([])\n const [isDropdownOpen, setIsDropdownOpen] = useState(false)\n const [highlightedIndex, setHighlightedIndex] = useState(-1)\n const [isLoading, setIsLoading] = useState(false)\n\n const inputRef = useRef<HTMLInputElement>(null)\n const dropdownRef = useRef<HTMLUListElement>(null)\n const isSelecting = useRef(false)\n const hasUserTyped = useRef(false)\n const sessionTokenRef = useRef<google.maps.places.AutocompleteSessionToken | null>(null)\n const optionRefs = useRef<(HTMLLIElement | null)[]>([])\n const scrollBehaviorRef = useRef<ScrollBehavior>(\"smooth\")\n const placesLibrary = useMapsLibrary(\"places\", googleMapsApiKey)\n const allowedTypesSet = useMemo(() => {\n if (!allowedTypes) {\n return DEFAULT_ALLOWED_TYPES\n }\n\n const newSet = new Set<string>()\n for (const type of allowedTypes) {\n newSet.add(type)\n }\n return newSet\n }, [allowedTypes])\n\n useEffect(() => {\n setInputValue(value ?? \"\")\n hasUserTyped.current = false\n }, [value])\n\n useEffect(() => {\n if (isSelecting.current) {\n isSelecting.current = false\n return\n }\n\n const trimmed = inputValue.trim()\n\n if (trimmed === \"\") {\n setIsLoading(false)\n } else {\n setIsLoading(true)\n }\n\n let isActive = true\n\n const handler = setTimeout(() => {\n if (!isActive) {\n return\n }\n\n if (trimmed === \"\") {\n setPredictions([])\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n if (value !== \"\") {\n onValueChange(\"\")\n }\n return\n }\n\n if (!placesLibrary) return\n\n const { AutocompleteSuggestion, AutocompleteSessionToken } = placesLibrary\n\n if (!AutocompleteSuggestion || !AutocompleteSessionToken) {\n console.error(\"AddressAutocompleteInput: missing AutocompleteSuggestion or AutocompleteSessionToken exports\")\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (!sessionTokenRef.current) {\n sessionTokenRef.current = new AutocompleteSessionToken()\n }\n\n const request: google.maps.places.AutocompleteRequest = {\n input: inputValue,\n sessionToken: sessionTokenRef.current ?? undefined,\n includedRegionCodes: [\"fr\"],\n }\n if (locationRestriction) {\n request.locationRestriction = locationRestriction\n }\n\n AutocompleteSuggestion.fetchAutocompleteSuggestions(request)\n .then((response: { suggestions: google.maps.places.AutocompleteSuggestion[] }) => {\n if (!isActive) {\n return\n }\n\n const placePredictions = response.suggestions\n .map((suggestion: google.maps.places.AutocompleteSuggestion) => suggestion.placePrediction)\n .filter((prediction): prediction is google.maps.places.PlacePrediction => Boolean(prediction))\n\n const combinedPredictions = buildDisplayPredictions(placePredictions, allowedTypesSet)\n\n const singlePrediction = combinedPredictions[0]\n const hasExactMatch =\n singlePrediction && combinedPredictions.length === 1 && isExactMatch(singlePrediction, inputValue)\n\n if (!hasUserTyped.current && hasExactMatch) {\n setPredictions(combinedPredictions)\n setIsDropdownOpen(false)\n setIsLoading(false)\n return\n }\n\n if (combinedPredictions.length > 0) {\n setPredictions(combinedPredictions)\n if (hasUserTyped.current) {\n setIsDropdownOpen(true)\n }\n setHighlightedIndex(-1)\n } else {\n setPredictions([])\n setIsDropdownOpen(false)\n }\n setIsLoading(false)\n })\n .catch((error: unknown) => {\n if (!isActive) {\n return\n }\n console.error(\"AddressAutocompleteInput: suggestion fetch failed\", error)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n })\n }, 300)\n\n return () => {\n isActive = false\n clearTimeout(handler)\n }\n }, [inputValue, placesLibrary, onValueChange, value, locationRestriction, allowedTypesSet])\n\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (\n inputRef.current &&\n !inputRef.current.contains(event.target as Node) &&\n dropdownRef.current &&\n !dropdownRef.current.contains(event.target as Node)\n ) {\n setIsDropdownOpen(false)\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside)\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside)\n }\n }, [])\n\n const handleSelectPrediction = (prediction: google.maps.places.PlacePrediction) => {\n isSelecting.current = true\n const newAddress = getDisplayText(prediction)\n setInputValue(newAddress)\n onValueChange(newAddress)\n setPredictions([])\n setIsDropdownOpen(false)\n setIsLoading(false)\n sessionTokenRef.current = null\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n hasUserTyped.current = true\n setInputValue(e.target.value)\n }\n\n const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (!isDropdownOpen || predictions.length === 0) {\n if (e.key === \"Enter\") {\n e.preventDefault()\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n return\n }\n\n if (e.key === \"ArrowDown\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n return prev < 0 ? 0 : (prev + 1) % predictions.length\n })\n } else if (e.key === \"ArrowUp\") {\n scrollBehaviorRef.current = e.repeat ? \"auto\" : \"smooth\"\n e.preventDefault()\n setHighlightedIndex(prev => {\n if (predictions.length === 0) {\n return -1\n }\n if (prev <= 0) {\n return predictions.length - 1\n }\n return (prev - 1) % predictions.length\n })\n } else if (e.key === \"Enter\") {\n e.preventDefault()\n if (highlightedIndex > -1 && predictions[highlightedIndex]) {\n handleSelectPrediction(predictions[highlightedIndex])\n } else {\n onValueChange(inputValue)\n setIsDropdownOpen(false)\n sessionTokenRef.current = null\n }\n } else if (e.key === \"Escape\") {\n setIsDropdownOpen(false)\n }\n }\n\n const handleBlur = () => {\n setIsDropdownOpen(false)\n if (value !== inputValue) {\n onValueChange(inputValue)\n }\n sessionTokenRef.current = null\n }\n\n const shimName = autofillShimName ?? (name ? `${name}_shim` : undefined)\n\n useEffect(() => {\n if (!isDropdownOpen || highlightedIndex < 0) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const item = optionRefs.current[highlightedIndex]\n const list = dropdownRef.current\n\n if (!item || !list) {\n scrollBehaviorRef.current = \"smooth\"\n return\n }\n\n const behavior = scrollBehaviorRef.current\n scrollBehaviorRef.current = \"smooth\"\n\n const top = item.offsetTop\n const bottom = top + item.offsetHeight\n const viewTop = list.scrollTop\n const viewBottom = viewTop + list.clientHeight\n\n if (top >= viewTop && bottom <= viewBottom) {\n return\n }\n\n item.scrollIntoView({\n block: \"nearest\",\n behavior,\n })\n }, [highlightedIndex, isDropdownOpen])\n\n optionRefs.current.length = predictions.length\n\n return (\n <div className=\"relative\">\n {shimName && (\n <input\n tabIndex={-1}\n autoComplete=\"street-address\"\n name={shimName}\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"-9999px\",\n top: \"-9999px\",\n height: \"1px\",\n width: \"1px\",\n }}\n />\n )}\n <label htmlFor={id} className=\"text-left block text-sm font-medium text-gray-700 mb-1 cursor-pointer\">\n {label}\n </label>\n <div className=\"relative\">\n <Input\n ref={inputRef}\n id={id}\n type=\"text\"\n placeholder={placeholder}\n name={name ?? `${id}_input`}\n value={inputValue}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onFocus={() => {\n if (predictions.length > 0 && inputValue) {\n setIsDropdownOpen(true)\n }\n }}\n onBlur={handleBlur}\n disabled={disabled}\n autoComplete=\"new-password\"\n className={cn(\"w-full\", isLoading && \"pr-9\", className)}\n />\n {isLoading && (\n <Loader2\n className=\"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-gray-400\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isDropdownOpen && predictions.length > 0 && (\n <ul\n ref={dropdownRef}\n className=\"absolute z-10 mt-1 w-full max-h-60 overflow-y-auto rounded-md border border-gray-200 bg-white text-left shadow-lg\"\n role=\"listbox\"\n >\n {predictions.map((prediction, index) => (\n <li\n key={getPredictionId(prediction, index)}\n ref={node => {\n optionRefs.current[index] = node\n }}\n className={clsx(\n \"cursor-pointer px-3 py-2 text-sm text-gray-700 hover:bg-gray-100\",\n { \"bg-gray-100\": highlightedIndex === index },\n )}\n role=\"option\"\n onMouseDown={e => {\n e.preventDefault()\n handleSelectPrediction(prediction)\n }}\n >\n <PredictionItem prediction={prediction} />\n </li>\n ))}\n </ul>\n )}\n </div>\n )\n}\n"],"names":["DEFAULT_ALLOWED_TYPES","Set","getDisplayText","prediction","text","replace","trim","PredictionItem","t0","$","_c","displayText","parts","t1","Symbol","for","bb0","fullText","matches","wasCountryRemoved","length","lastIndex","forEach","substring","index","startOffset","endOffset","Math","min","push","matched","jsx","max","t2","isAllowedPrediction","allowedTypes","types","size","some","type","has","getPredictionId","placeId","getUniquePredictions","predictions","map","Map","key","set","Array","from","values","getFilteredPredictions","filter","sortPredictions","sort","a","b","aDistance","distanceMeters","Number","POSITIVE_INFINITY","bDistance","buildDisplayPredictions","isExactMatch","value","toLowerCase","AddressAutocompleteInput","id","label","placeholder","onValueChange","disabled","name","className","autofillShimName","googleMapsApiKey","locationRestriction","inputValue","setInputValue","useState","setPredictions","isDropdownOpen","setIsDropdownOpen","highlightedIndex","setHighlightedIndex","isLoading","setIsLoading","inputRef","useRef","dropdownRef","isSelecting","hasUserTyped","sessionTokenRef","optionRefs","scrollBehaviorRef","placesLibrary","useMapsLibrary","allowedTypesSet","useMemo","newSet","add","useEffect","current","trimmed","isActive","handler","setTimeout","AutocompleteSuggestion","AutocompleteSessionToken","console","error","request","input","sessionToken","undefined","includedRegionCodes","fetchAutocompleteSuggestions","then","response","placePredictions","suggestions","suggestion","placePrediction","Boolean","combinedPredictions","singlePrediction","hasExactMatch","catch","clearTimeout","handleClickOutside","event","contains","target","document","addEventListener","removeEventListener","handleSelectPrediction","newAddress","handleInputChange","e","handleKeyDown","preventDefault","repeat","prev","handleBlur","shimName","item","list","behavior","top","offsetTop","bottom","offsetHeight","viewTop","scrollTop","viewBottom","clientHeight","scrollIntoView","block","jsxs","position","left","height","width","Input","cn","Loader2","node","clsx"],"mappings":";;;;;;;;AAWA,MAAMA,KAAwB,oBAAIC,IAAI,CACpC,kBACA,SACA,WACA,cACA,gBACA,eACA,uBACA,uBACA,uBACA,uBACA,uBACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,+BACA,eACA,YACA,WACA,WACA,aACA,aACA,gBACA,mBACA,WACA,iBACA,iBAAiB,CAClB,GAEKC,IAAiBA,CAACC,OACLA,EAAWC,MAAMA,QAAQ,IAC1BC,QAAQ,aAAa,EAAE,EAAEC,KAAAA,GAGrCC,KAAiBC,CAAAA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,EAAA,CAAA,GAAC;AAAA,IAAAP,YAAAA;AAAAA,EAAAA,IAAAK;AAAkE,MAAAG,GAAAC,GAAAC;AAAA,MAAAJ,SAAAN,GAAA;AAO/EU,IAAAA,IAAAC,uBAAkBC,IAAlB,6BAAiB;AAACC,IAAAA,GAAA;AAN3BL,MAAAA,IAAoBT,EAAeC,CAAU;AAC7C,YAAAc,IAAiBd,EAAUC,M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,MAEzDY,KACCvD,gBAAAA,EAAAA,IAACwI,IAAA,EACC,WAAU,oGACV,eAAY,OAAA,CAAM;AAAA,IAAA,GAGxB;AAAA,IACCrF,KAAkBtC,EAAYxB,SAAS,2BACrC,MAAA,EACC,KAAKsE,GACL,WAAU,qHACV,MAAK,WAEJ9C,UAAAA,EAAYC,IAAI,CAAC1C,GAAYqB,MAC5BO,gBAAAA,EAAAA,IAAC,MAAA,EAEC,KAAKyI,CAAAA,MAAQ;AACX1E,MAAAA,EAAWS,QAAQ/E,CAAK,IAAIgJ;AAAAA,IAC9B,GACA,WAAWC,GACT,oEACA;AAAA,MAAE,eAAerF,MAAqB5D;AAAAA,IAAAA,CACxC,GACA,MAAK,UACL,aAAaoH,CAAAA,MAAK;AAChBA,MAAAA,EAAEE,eAAAA,GACFL,EAAuBtI,CAAU;AAAA,IACnC,GAEA,UAAA4B,gBAAAA,EAAAA,IAACxB,IAAA,EAAe,YAAYJ,GAAW,EAAA,GAdlCsC,GAAgBtC,GAAYqB,CAAK,CAexC,CACD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
package/dist/index300.js CHANGED
@@ -1,9 +1,14 @@
1
- function t(e, n, r, d) {
2
- return e.addEventListener(n, r, d), () => {
3
- e.removeEventListener(n, r, d);
4
- };
1
+ function O(o, r) {
2
+ let { startMonth: t, endMonth: e } = o;
3
+ const { startOfYear: M, startOfDay: d, startOfMonth: c, endOfMonth: Y, addYears: l, endOfYear: w, newDate: f, today: i } = r, { fromYear: a, toYear: n, fromMonth: s, toMonth: h } = o;
4
+ !t && s && (t = s), !t && a && (t = r.newDate(a, 0, 1)), !e && h && (e = h), !e && n && (e = f(n, 11, 31));
5
+ const y = o.captionLayout === "dropdown" || o.captionLayout === "dropdown-years";
6
+ return t ? t = c(t) : a ? t = f(a, 0, 1) : !t && y && (t = M(l(o.today ?? i(), -100))), e ? e = Y(e) : n ? e = f(n, 11, 31) : !e && y && (e = w(o.today ?? i())), [
7
+ t && d(t),
8
+ e && d(e)
9
+ ];
5
10
  }
6
11
  export {
7
- t as addEventListener
12
+ O as getNavMonths
8
13
  };
9
14
  //# sourceMappingURL=index300.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index300.js","sources":["../../../node_modules/@base-ui/utils/esm/addEventListener.js"],"sourcesContent":["/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}"],"names":["addEventListener","target","type","listener","options"],"mappings":"AAIO,SAASA,EAAiBC,GAAQC,GAAMC,GAAUC,GAAS;AAChE,SAAAH,EAAO,iBAAiBC,GAAMC,GAAUC,CAAO,GACxC,MAAM;AACX,IAAAH,EAAO,oBAAoBC,GAAMC,GAAUC,CAAO;AAAA,EACpD;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index300.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js"],"sourcesContent":["/**\n * Returns the start and end months for calendar navigation.\n *\n * @param props The DayPicker props, including navigation and layout options.\n * @param dateLib The date library to use for date manipulation.\n * @returns A tuple containing the start and end months for navigation.\n */\nexport function getNavMonths(props, dateLib) {\n let { startMonth, endMonth } = props;\n const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear, newDate, today, } = dateLib;\n // Handle deprecated code\n const { fromYear, toYear, fromMonth, toMonth } = props;\n if (!startMonth && fromMonth) {\n startMonth = fromMonth;\n }\n if (!startMonth && fromYear) {\n startMonth = dateLib.newDate(fromYear, 0, 1);\n }\n if (!endMonth && toMonth) {\n endMonth = toMonth;\n }\n if (!endMonth && toYear) {\n endMonth = newDate(toYear, 11, 31);\n }\n const hasYearDropdown = props.captionLayout === \"dropdown\" ||\n props.captionLayout === \"dropdown-years\";\n if (startMonth) {\n startMonth = startOfMonth(startMonth);\n }\n else if (fromYear) {\n startMonth = newDate(fromYear, 0, 1);\n }\n else if (!startMonth && hasYearDropdown) {\n startMonth = startOfYear(addYears(props.today ?? today(), -100));\n }\n if (endMonth) {\n endMonth = endOfMonth(endMonth);\n }\n else if (toYear) {\n endMonth = newDate(toYear, 11, 31);\n }\n else if (!endMonth && hasYearDropdown) {\n endMonth = endOfYear(props.today ?? today());\n }\n return [\n startMonth ? startOfDay(startMonth) : startMonth,\n endMonth ? startOfDay(endMonth) : endMonth,\n ];\n}\n"],"names":["getNavMonths","props","dateLib","startMonth","endMonth","startOfYear","startOfDay","startOfMonth","endOfMonth","addYears","endOfYear","newDate","today","fromYear","toYear","fromMonth","toMonth","hasYearDropdown"],"mappings":"AAOO,SAASA,EAAaC,GAAOC,GAAS;AACzC,MAAI,EAAE,YAAAC,GAAY,UAAAC,EAAQ,IAAKH;AAC/B,QAAM,EAAE,aAAAI,GAAa,YAAAC,GAAY,cAAAC,GAAc,YAAAC,GAAY,UAAAC,GAAU,WAAAC,GAAW,SAAAC,GAAS,OAAAC,EAAK,IAAMV,GAE9F,EAAE,UAAAW,GAAU,QAAAC,GAAQ,WAAAC,GAAW,SAAAC,EAAO,IAAKf;AACjD,EAAI,CAACE,KAAcY,MACfZ,IAAaY,IAEb,CAACZ,KAAcU,MACfV,IAAaD,EAAQ,QAAQW,GAAU,GAAG,CAAC,IAE3C,CAACT,KAAYY,MACbZ,IAAWY,IAEX,CAACZ,KAAYU,MACbV,IAAWO,EAAQG,GAAQ,IAAI,EAAE;AAErC,QAAMG,IAAkBhB,EAAM,kBAAkB,cAC5CA,EAAM,kBAAkB;AAC5B,SAAIE,IACAA,IAAaI,EAAaJ,CAAU,IAE/BU,IACLV,IAAaQ,EAAQE,GAAU,GAAG,CAAC,IAE9B,CAACV,KAAcc,MACpBd,IAAaE,EAAYI,EAASR,EAAM,SAASW,EAAK,GAAI,IAAI,CAAC,IAE/DR,IACAA,IAAWI,EAAWJ,CAAQ,IAEzBU,IACLV,IAAWO,EAAQG,GAAQ,IAAI,EAAE,IAE5B,CAACV,KAAYa,MAClBb,IAAWM,EAAUT,EAAM,SAASW,EAAK,CAAE,IAExC;AAAA,IACHT,KAAaG,EAAWH,CAAU;AAAA,IAClCC,KAAWE,EAAWF,CAAQ;AAAA,EACtC;AACA;","x_google_ignoreList":[0]}
package/dist/index301.js CHANGED
@@ -1,44 +1,13 @@
1
- const a = typeof navigator < "u", o = s(), r = f(), n = u(), c = typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter:none"), m = (
2
- // iPads can claim to be MacIntel
3
- o.platform === "MacIntel" && o.maxTouchPoints > 1 ? !0 : /iP(hone|ad|od)|iOS/.test(o.platform)
4
- ), p = a && /apple/i.test(navigator.vendor), g = a && /android/i.test(r) || /android/i.test(n);
5
- a && r.toLowerCase().startsWith("mac") && navigator.maxTouchPoints;
6
- const d = n.includes("jsdom/");
7
- function s() {
8
- if (!a)
9
- return {
10
- platform: "",
11
- maxTouchPoints: -1
12
- };
13
- const t = navigator.userAgentData;
14
- return t?.platform ? {
15
- platform: t.platform,
16
- maxTouchPoints: navigator.maxTouchPoints
17
- } : {
18
- platform: navigator.platform ?? "",
19
- maxTouchPoints: navigator.maxTouchPoints ?? -1
20
- };
21
- }
22
- function u() {
23
- if (!a)
24
- return "";
25
- const t = navigator.userAgentData;
26
- return t && Array.isArray(t.brands) ? t.brands.map(({
27
- brand: i,
28
- version: e
29
- }) => `${i}/${e}`).join(" ") : navigator.userAgent;
30
- }
31
- function f() {
32
- if (!a)
33
- return "";
34
- const t = navigator.userAgentData;
35
- return t?.platform ? t.platform : navigator.platform ?? "";
1
+ function h(n, t, e, s) {
2
+ if (e.disableNavigation)
3
+ return;
4
+ const { pagedNavigation: u, numberOfMonths: f = 1 } = e, { startOfMonth: a, addMonths: o, differenceInCalendarMonths: d } = s, i = u ? f : 1, r = a(n);
5
+ if (!t)
6
+ return o(r, i);
7
+ if (!(d(t, n) < f))
8
+ return o(r, i);
36
9
  }
37
10
  export {
38
- g as isAndroid,
39
- m as isIOS,
40
- d as isJSDOM,
41
- p as isSafari,
42
- c as isWebKit
11
+ h as getNextMonth
43
12
  };
44
13
  //# sourceMappingURL=index301.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index301.js","sources":["../../../node_modules/@base-ui/utils/esm/detectBrowser.js"],"sourcesContent":["const hasNavigator = typeof navigator !== 'undefined';\nconst nav = getNavigatorData();\nconst platform = getPlatform();\nconst userAgent = getUserAgent();\nexport const isWebKit = typeof CSS === 'undefined' || !CSS.supports ? false : CSS.supports('-webkit-backdrop-filter:none');\nexport const isIOS =\n// iPads can claim to be MacIntel\nnav.platform === 'MacIntel' && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform);\nexport const isFirefox = hasNavigator && /firefox/i.test(userAgent);\nexport const isSafari = hasNavigator && /apple/i.test(navigator.vendor);\nexport const isEdge = hasNavigator && /Edg/i.test(userAgent);\nexport const isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent);\nexport const isMac = hasNavigator && platform.toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\nexport const isJSDOM = userAgent.includes('jsdom/');\n\n// Avoid Chrome DevTools blue warning.\nfunction getNavigatorData() {\n if (!hasNavigator) {\n return {\n platform: '',\n maxTouchPoints: -1\n };\n }\n const uaData = navigator.userAgentData;\n if (uaData?.platform) {\n return {\n platform: uaData.platform,\n maxTouchPoints: navigator.maxTouchPoints\n };\n }\n return {\n platform: navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? -1\n };\n}\nfunction getUserAgent() {\n if (!hasNavigator) {\n return '';\n }\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(({\n brand,\n version\n }) => `${brand}/${version}`).join(' ');\n }\n return navigator.userAgent;\n}\nfunction getPlatform() {\n if (!hasNavigator) {\n return '';\n }\n const uaData = navigator.userAgentData;\n if (uaData?.platform) {\n return uaData.platform;\n }\n return navigator.platform ?? '';\n}"],"names":["hasNavigator","nav","getNavigatorData","platform","getPlatform","userAgent","get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AAU,YAAY;AAC/B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index301.js","sources":["../../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js"],"sourcesContent":["/**\n * Returns the next month the user can navigate to, based on the given options.\n *\n * The next month is not always the next calendar month:\n *\n * - If it is after the `calendarEndMonth`, it returns `undefined`.\n * - If paged navigation is enabled, it skips forward by the number of displayed\n * months.\n *\n * @param firstDisplayedMonth The first month currently displayed in the\n * calendar.\n * @param calendarEndMonth The latest month the user can navigate to.\n * @param options Navigation options, including `numberOfMonths` and\n * `pagedNavigation`.\n * @param dateLib The date library to use for date manipulation.\n * @returns The next month, or `undefined` if navigation is not possible.\n */\nexport function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {\n if (options.disableNavigation) {\n return undefined;\n }\n const { pagedNavigation, numberOfMonths = 1 } = options;\n const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n const offset = pagedNavigation ? numberOfMonths : 1;\n const month = startOfMonth(firstDisplayedMonth);\n if (!calendarEndMonth) {\n return addMonths(month, offset);\n }\n const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);\n if (monthsDiff < numberOfMonths) {\n return undefined;\n }\n return addMonths(month, offset);\n}\n"],"names":["getNextMonth","firstDisplayedMonth","calendarEndMonth","options","dateLib","pagedNavigation","numberOfMonths","startOfMonth","addMonths","differenceInCalendarMonths","offset","month"],"mappings":"AAiBO,SAASA,EAAaC,GAAqBC,GAAkBC,GAASC,GAAS;AAClF,MAAID,EAAQ;AACR;AAEJ,QAAM,EAAE,iBAAAE,GAAiB,gBAAAC,IAAiB,EAAC,IAAKH,GAC1C,EAAE,cAAAI,GAAc,WAAAC,GAAW,4BAAAC,EAA0B,IAAKL,GAC1DM,IAASL,IAAkBC,IAAiB,GAC5CK,IAAQJ,EAAaN,CAAmB;AAC9C,MAAI,CAACC;AACD,WAAOM,EAAUG,GAAOD,CAAM;AAGlC,MAAI,EADeD,EAA2BP,GAAkBD,CAAmB,IAClEK;AAGjB,WAAOE,EAAUG,GAAOD,CAAM;AAClC;","x_google_ignoreList":[0]}
package/dist/index302.js CHANGED
@@ -1,69 +1,13 @@
1
- import { useRefWithInit as u } from "./index258.js";
2
- import { useOnMount as h } from "./index364.js";
3
- const s = null;
4
- let l = globalThis.requestAnimationFrame;
5
- class o {
6
- /* This implementation uses an array as a backing data-structure for frame callbacks.
7
- * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
8
- * never calls the native `cancelAnimationFrame` if there are no frames left. This can
9
- * be much more efficient if there is a call pattern that alterns as
10
- * "request-cancel-request-cancel-…".
11
- * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
12
- * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
13
- callbacks = [];
14
- callbacksCount = 0;
15
- nextId = 1;
16
- startId = 1;
17
- isScheduled = !1;
18
- tick = (t) => {
19
- this.isScheduled = !1;
20
- const e = this.callbacks, r = this.callbacksCount;
21
- if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, r > 0)
22
- for (let i = 0; i < e.length; i += 1)
23
- e[i]?.(t);
24
- };
25
- request(t) {
26
- const e = this.nextId;
27
- this.nextId += 1, this.callbacks.push(t), this.callbacksCount += 1;
28
- const r = process.env.NODE_ENV !== "production" && l !== requestAnimationFrame && (l = requestAnimationFrame, !0);
29
- return (!this.isScheduled || r) && (requestAnimationFrame(this.tick), this.isScheduled = !0), e;
30
- }
31
- cancel(t) {
32
- const e = t - this.startId;
33
- e < 0 || e >= this.callbacks.length || (this.callbacks[e] = null, this.callbacksCount -= 1);
34
- }
35
- }
36
- const c = new o();
37
- class a {
38
- static create() {
39
- return new a();
40
- }
41
- static request(t) {
42
- return c.request(t);
43
- }
44
- static cancel(t) {
45
- return c.cancel(t);
46
- }
47
- currentId = s;
48
- /**
49
- * Executes `fn` after `delay`, clearing any previously scheduled call.
50
- */
51
- request(t) {
52
- this.cancel(), this.currentId = c.request(() => {
53
- this.currentId = s, t();
54
- });
55
- }
56
- cancel = () => {
57
- this.currentId !== s && (c.cancel(this.currentId), this.currentId = s);
58
- };
59
- disposeEffect = () => this.cancel;
60
- }
61
- function k() {
62
- const n = u(a.create).current;
63
- return h(n.disposeEffect), n;
1
+ function c(i, t, e, s) {
2
+ if (e.disableNavigation)
3
+ return;
4
+ const { pagedNavigation: r, numberOfMonths: d } = e, { startOfMonth: u, addMonths: f, differenceInCalendarMonths: a } = s, o = r ? d ?? 1 : 1, n = u(i);
5
+ if (!t)
6
+ return f(n, -o);
7
+ if (!(a(n, t) <= 0))
8
+ return f(n, -o);
64
9
  }
65
10
  export {
66
- a as AnimationFrame,
67
- k as useAnimationFrame
11
+ c as getPreviousMonth
68
12
  };
69
13
  //# sourceMappingURL=index302.js.map