@rpcbase/ui 0.245.0 → 0.246.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 (448) hide show
  1. package/dist/index149.js +5 -14
  2. package/dist/index149.js.map +1 -1
  3. package/dist/index150.js +63 -63
  4. package/dist/index150.js.map +1 -1
  5. package/dist/index151.js +2 -38
  6. package/dist/index151.js.map +1 -1
  7. package/dist/index152.js +385 -13
  8. package/dist/index152.js.map +1 -1
  9. package/dist/index153.js +261 -23
  10. package/dist/index153.js.map +1 -1
  11. package/dist/index154.js +58 -109
  12. package/dist/index154.js.map +1 -1
  13. package/dist/index155.js +47 -13
  14. package/dist/index155.js.map +1 -1
  15. package/dist/index156.js +169 -4
  16. package/dist/index156.js.map +1 -1
  17. package/dist/index157.js +110 -4
  18. package/dist/index157.js.map +1 -1
  19. package/dist/index158.js +25 -5
  20. package/dist/index158.js.map +1 -1
  21. package/dist/index159.js +8 -12
  22. package/dist/index159.js.map +1 -1
  23. package/dist/index160.js +4 -19
  24. package/dist/index160.js.map +1 -1
  25. package/dist/index161.js +6 -11
  26. package/dist/index161.js.map +1 -1
  27. package/dist/index162.js +4 -176
  28. package/dist/index162.js.map +1 -1
  29. package/dist/index163.js +476 -268
  30. package/dist/index163.js.map +1 -1
  31. package/dist/index164.js +189 -4
  32. package/dist/index164.js.map +1 -1
  33. package/dist/index165.js +14 -28
  34. package/dist/index165.js.map +1 -1
  35. package/dist/index166.js +105 -124
  36. package/dist/index166.js.map +1 -1
  37. package/dist/index167.js +262 -63
  38. package/dist/index167.js.map +1 -1
  39. package/dist/index168.js +6 -8
  40. package/dist/index168.js.map +1 -1
  41. package/dist/index169.js +40 -15
  42. package/dist/index169.js.map +1 -1
  43. package/dist/index170.js +4 -30
  44. package/dist/index170.js.map +1 -1
  45. package/dist/index171.js +14 -69
  46. package/dist/index171.js.map +1 -1
  47. package/dist/index172.js +68 -5
  48. package/dist/index172.js.map +1 -1
  49. package/dist/index173.js +35 -66
  50. package/dist/index173.js.map +1 -1
  51. package/dist/index174.js +14 -2
  52. package/dist/index174.js.map +1 -1
  53. package/dist/index175.js +22 -384
  54. package/dist/index175.js.map +1 -1
  55. package/dist/index176.js +108 -258
  56. package/dist/index176.js.map +1 -1
  57. package/dist/index177.js +13 -61
  58. package/dist/index177.js.map +1 -1
  59. package/dist/index178.js +4 -46
  60. package/dist/index178.js.map +1 -1
  61. package/dist/index179.js +4 -170
  62. package/dist/index179.js.map +1 -1
  63. package/dist/index180.js +5 -110
  64. package/dist/index180.js.map +1 -1
  65. package/dist/index181.js +11 -24
  66. package/dist/index181.js.map +1 -1
  67. package/dist/index182.js +20 -8
  68. package/dist/index182.js.map +1 -1
  69. package/dist/index183.js +11 -5
  70. package/dist/index183.js.map +1 -1
  71. package/dist/index184.js +176 -5
  72. package/dist/index184.js.map +1 -1
  73. package/dist/index185.js +279 -4
  74. package/dist/index185.js.map +1 -1
  75. package/dist/index186.js +4 -487
  76. package/dist/index186.js.map +1 -1
  77. package/dist/index187.js +27 -189
  78. package/dist/index187.js.map +1 -1
  79. package/dist/index188.js +126 -13
  80. package/dist/index188.js.map +1 -1
  81. package/dist/index189.js +63 -107
  82. package/dist/index189.js.map +1 -1
  83. package/dist/index190.js +8 -262
  84. package/dist/index190.js.map +1 -1
  85. package/dist/index191.js +16 -7
  86. package/dist/index191.js.map +1 -1
  87. package/dist/index192.js +29 -39
  88. package/dist/index192.js.map +1 -1
  89. package/dist/index193.js +69 -4
  90. package/dist/index193.js.map +1 -1
  91. package/dist/index254.js +20 -67
  92. package/dist/index254.js.map +1 -1
  93. package/dist/index255.js +66 -8
  94. package/dist/index255.js.map +1 -1
  95. package/dist/index256.js +6 -11
  96. package/dist/index256.js.map +1 -1
  97. package/dist/index257.js +5 -8
  98. package/dist/index257.js.map +1 -1
  99. package/dist/index258.js +11 -5
  100. package/dist/index258.js.map +1 -1
  101. package/dist/index259.js +3 -13
  102. package/dist/index259.js.map +1 -1
  103. package/dist/index260.js +50 -3
  104. package/dist/index260.js.map +1 -1
  105. package/dist/index261.js +4 -4
  106. package/dist/index261.js.map +1 -1
  107. package/dist/index262.js +27 -97
  108. package/dist/index262.js.map +1 -1
  109. package/dist/index263.js +15 -16
  110. package/dist/index263.js.map +1 -1
  111. package/dist/index264.js +5 -29
  112. package/dist/index264.js.map +1 -1
  113. package/dist/index265.js +21 -51
  114. package/dist/index265.js.map +1 -1
  115. package/dist/index266.js +53 -5
  116. package/dist/index266.js.map +1 -1
  117. package/dist/index267.js +20 -5
  118. package/dist/index267.js.map +1 -1
  119. package/dist/index268.js +39 -59
  120. package/dist/index268.js.map +1 -1
  121. package/dist/index269.js +36 -63
  122. package/dist/index269.js.map +1 -1
  123. package/dist/index270.js +46 -134
  124. package/dist/index270.js.map +1 -1
  125. package/dist/index271.js +19 -7
  126. package/dist/index271.js.map +1 -1
  127. package/dist/index272.js +71 -5
  128. package/dist/index272.js.map +1 -1
  129. package/dist/index273.js +18 -4
  130. package/dist/index273.js.map +1 -1
  131. package/dist/index274.js +3 -11
  132. package/dist/index274.js.map +1 -1
  133. package/dist/index275.js +11 -21
  134. package/dist/index275.js.map +1 -1
  135. package/dist/index276.js +13 -16
  136. package/dist/index276.js.map +1 -1
  137. package/dist/index277.js +17 -10
  138. package/dist/index277.js.map +1 -1
  139. package/dist/index278.js +37 -8
  140. package/dist/index278.js.map +1 -1
  141. package/dist/index279.js +237 -142
  142. package/dist/index279.js.map +1 -1
  143. package/dist/index28.js +1 -1
  144. package/dist/index280.js +249 -76
  145. package/dist/index280.js.map +1 -1
  146. package/dist/index281.js +68 -61
  147. package/dist/index281.js.map +1 -1
  148. package/dist/index282.js +100 -15
  149. package/dist/index282.js.map +1 -1
  150. package/dist/index283.js +84 -20
  151. package/dist/index283.js.map +1 -1
  152. package/dist/index284.js +3 -6
  153. package/dist/index284.js.map +1 -1
  154. package/dist/index285.js +29 -11
  155. package/dist/index285.js.map +1 -1
  156. package/dist/index286.js +16 -3
  157. package/dist/index286.js.map +1 -1
  158. package/dist/index287.js +34 -50
  159. package/dist/index287.js.map +1 -1
  160. package/dist/index288.js +16 -15
  161. package/dist/index288.js.map +1 -1
  162. package/dist/index289.js +3 -21
  163. package/dist/index289.js.map +1 -1
  164. package/dist/index29.js +1 -1
  165. package/dist/index290.js +26 -53
  166. package/dist/index290.js.map +1 -1
  167. package/dist/index291.js +28 -20
  168. package/dist/index291.js.map +1 -1
  169. package/dist/index292.js +4 -42
  170. package/dist/index292.js.map +1 -1
  171. package/dist/index293.js +73 -34
  172. package/dist/index293.js.map +1 -1
  173. package/dist/index294.js +273 -46
  174. package/dist/index294.js.map +1 -1
  175. package/dist/index295.js +11 -20
  176. package/dist/index295.js.map +1 -1
  177. package/dist/index296.js +11 -71
  178. package/dist/index296.js.map +1 -1
  179. package/dist/index297.js +25 -17
  180. package/dist/index297.js.map +1 -1
  181. package/dist/index298.js +16 -3
  182. package/dist/index298.js.map +1 -1
  183. package/dist/index299.js +124 -12
  184. package/dist/index299.js.map +1 -1
  185. package/dist/index300.js +5 -18
  186. package/dist/index300.js.map +1 -1
  187. package/dist/index301.js +64 -35
  188. package/dist/index301.js.map +1 -1
  189. package/dist/index302.js +14 -240
  190. package/dist/index302.js.map +1 -1
  191. package/dist/index303.js +7 -252
  192. package/dist/index303.js.map +1 -1
  193. package/dist/index304.js +5 -68
  194. package/dist/index304.js.map +1 -1
  195. package/dist/index305.js +3 -83
  196. package/dist/index305.js.map +1 -1
  197. package/dist/index306.js +10 -3
  198. package/dist/index306.js.map +1 -1
  199. package/dist/index307.js +7 -29
  200. package/dist/index307.js.map +1 -1
  201. package/dist/index308.js +133 -16
  202. package/dist/index308.js.map +1 -1
  203. package/dist/index309.js +397 -32
  204. package/dist/index309.js.map +1 -1
  205. package/dist/index310.js +5 -18
  206. package/dist/index310.js.map +1 -1
  207. package/dist/index311.js +52 -3
  208. package/dist/index311.js.map +1 -1
  209. package/dist/index312.js +11 -26
  210. package/dist/index312.js.map +1 -1
  211. package/dist/index313.js +25 -26
  212. package/dist/index313.js.map +1 -1
  213. package/dist/index314.js +12 -4
  214. package/dist/index314.js.map +1 -1
  215. package/dist/index315.js +151 -75
  216. package/dist/index315.js.map +1 -1
  217. package/dist/index316.js +30 -270
  218. package/dist/index316.js.map +1 -1
  219. package/dist/index317.js +11 -11
  220. package/dist/index317.js.map +1 -1
  221. package/dist/index318.js +50 -11
  222. package/dist/index318.js.map +1 -1
  223. package/dist/index319.js +8 -24
  224. package/dist/index319.js.map +1 -1
  225. package/dist/index320.js +11 -16
  226. package/dist/index320.js.map +1 -1
  227. package/dist/index321.js +42 -124
  228. package/dist/index321.js.map +1 -1
  229. package/dist/index322.js +97 -5
  230. package/dist/index322.js.map +1 -1
  231. package/dist/index323.js +82 -61
  232. package/dist/index323.js.map +1 -1
  233. package/dist/index324.js +104 -12
  234. package/dist/index324.js.map +1 -1
  235. package/dist/index325.js +52 -7
  236. package/dist/index325.js.map +1 -1
  237. package/dist/index326.js +11 -5
  238. package/dist/index326.js.map +1 -1
  239. package/dist/index327.js +4 -3
  240. package/dist/index327.js.map +1 -1
  241. package/dist/index328.js +37 -10
  242. package/dist/index328.js.map +1 -1
  243. package/dist/index329.js +8 -7
  244. package/dist/index329.js.map +1 -1
  245. package/dist/index33.js +2 -2
  246. package/dist/index330.js +121 -385
  247. package/dist/index330.js.map +1 -1
  248. package/dist/index331.js +18 -5
  249. package/dist/index331.js.map +1 -1
  250. package/dist/index332.js +14 -51
  251. package/dist/index332.js.map +1 -1
  252. package/dist/index333.js +3 -11
  253. package/dist/index333.js.map +1 -1
  254. package/dist/index334.js +34 -25
  255. package/dist/index334.js.map +1 -1
  256. package/dist/index335.js +20 -11
  257. package/dist/index335.js.map +1 -1
  258. package/dist/index336.js +9 -154
  259. package/dist/index336.js.map +1 -1
  260. package/dist/index337.js +8 -32
  261. package/dist/index337.js.map +1 -1
  262. package/dist/index338.js +24 -11
  263. package/dist/index338.js.map +1 -1
  264. package/dist/index339.js +25 -46
  265. package/dist/index339.js.map +1 -1
  266. package/dist/index34.js +5 -5
  267. package/dist/index340.js +16 -9
  268. package/dist/index340.js.map +1 -1
  269. package/dist/index341.js +8 -11
  270. package/dist/index341.js.map +1 -1
  271. package/dist/index342.js +11 -43
  272. package/dist/index342.js.map +1 -1
  273. package/dist/index343.js +7 -96
  274. package/dist/index343.js.map +1 -1
  275. package/dist/index344.js +11 -84
  276. package/dist/index344.js.map +1 -1
  277. package/dist/index345.js +3 -105
  278. package/dist/index345.js.map +1 -1
  279. package/dist/index346.js +3 -52
  280. package/dist/index346.js.map +1 -1
  281. package/dist/index347.js +16 -10
  282. package/dist/index347.js.map +1 -1
  283. package/dist/index348.js +51 -4
  284. package/dist/index348.js.map +1 -1
  285. package/dist/index349.js +5 -37
  286. package/dist/index349.js.map +1 -1
  287. package/dist/index35.js +11 -11
  288. package/dist/index350.js +61 -8
  289. package/dist/index350.js.map +1 -1
  290. package/dist/index351.js +61 -130
  291. package/dist/index351.js.map +1 -1
  292. package/dist/index352.js +8 -17
  293. package/dist/index352.js.map +1 -1
  294. package/dist/index353.js +5 -16
  295. package/dist/index353.js.map +1 -1
  296. package/dist/index354.js +11 -3
  297. package/dist/index354.js.map +1 -1
  298. package/dist/index355.js +19 -34
  299. package/dist/index355.js.map +1 -1
  300. package/dist/index356.js +16 -20
  301. package/dist/index356.js.map +1 -1
  302. package/dist/index357.js +8 -10
  303. package/dist/index357.js.map +1 -1
  304. package/dist/index358.js +144 -8
  305. package/dist/index358.js.map +1 -1
  306. package/dist/index359.js +77 -22
  307. package/dist/index359.js.map +1 -1
  308. package/dist/index36.js +3 -3
  309. package/dist/index360.js +61 -28
  310. package/dist/index360.js.map +1 -1
  311. package/dist/index361.js +15 -17
  312. package/dist/index361.js.map +1 -1
  313. package/dist/index365.js +11 -8
  314. package/dist/index365.js.map +1 -1
  315. package/dist/index366.js +4 -27
  316. package/dist/index366.js.map +1 -1
  317. package/dist/index367.js +5 -137
  318. package/dist/index367.js.map +1 -1
  319. package/dist/index368.js +3 -13
  320. package/dist/index368.js.map +1 -1
  321. package/dist/index369.js +20 -46
  322. package/dist/index369.js.map +1 -1
  323. package/dist/index37.js +4 -4
  324. package/dist/index370.js +45 -4
  325. package/dist/index370.js.map +1 -1
  326. package/dist/index371.js +17 -21
  327. package/dist/index371.js.map +1 -1
  328. package/dist/index372.js +4 -75
  329. package/dist/index372.js.map +1 -1
  330. package/dist/index373.js +200 -11
  331. package/dist/index373.js.map +1 -1
  332. package/dist/index374.js +73 -3
  333. package/dist/index374.js.map +1 -1
  334. package/dist/index375.js +122 -72
  335. package/dist/index375.js.map +1 -1
  336. package/dist/index376.js +4 -200
  337. package/dist/index376.js.map +1 -1
  338. package/dist/index377.js +20 -71
  339. package/dist/index377.js.map +1 -1
  340. package/dist/index378.js +8 -35
  341. package/dist/index378.js.map +1 -1
  342. package/dist/index379.js +27 -7
  343. package/dist/index379.js.map +1 -1
  344. package/dist/index38.js +5 -5
  345. package/dist/index380.js +136 -14
  346. package/dist/index380.js.map +1 -1
  347. package/dist/index381.js +10 -121
  348. package/dist/index381.js.map +1 -1
  349. package/dist/index382.js +47 -4
  350. package/dist/index382.js.map +1 -1
  351. package/dist/index383.js +3 -11
  352. package/dist/index383.js.map +1 -1
  353. package/dist/index384.js +21 -5
  354. package/dist/index384.js.map +1 -1
  355. package/dist/index385.js +76 -3
  356. package/dist/index385.js.map +1 -1
  357. package/dist/index386.js +12 -21
  358. package/dist/index386.js.map +1 -1
  359. package/dist/index387.js +4 -45
  360. package/dist/index387.js.map +1 -1
  361. package/dist/index388.js +70 -16
  362. package/dist/index388.js.map +1 -1
  363. package/dist/index389.js +36 -5
  364. package/dist/index389.js.map +1 -1
  365. package/dist/index39.js +3 -3
  366. package/dist/index390.js +7 -5
  367. package/dist/index390.js.map +1 -1
  368. package/dist/index391.js +15 -20
  369. package/dist/index391.js.map +1 -1
  370. package/dist/index40.js +10 -10
  371. package/dist/index409.js +3 -3
  372. package/dist/index409.js.map +1 -1
  373. package/dist/index410.js +3 -15
  374. package/dist/index410.js.map +1 -1
  375. package/dist/index411.js +3 -492
  376. package/dist/index411.js.map +1 -1
  377. package/dist/index412.js +15 -3
  378. package/dist/index412.js.map +1 -1
  379. package/dist/index413.js +492 -3
  380. package/dist/index413.js.map +1 -1
  381. package/dist/index417.js +1 -1
  382. package/dist/index419.js +1 -1
  383. package/dist/index420.js +2 -2
  384. package/dist/index421.js +7 -32
  385. package/dist/index421.js.map +1 -1
  386. package/dist/index422.js +2 -8
  387. package/dist/index422.js.map +1 -1
  388. package/dist/index423.js +44 -2
  389. package/dist/index423.js.map +1 -1
  390. package/dist/index424.js +52 -40
  391. package/dist/index424.js.map +1 -1
  392. package/dist/index425.js +7 -55
  393. package/dist/index425.js.map +1 -1
  394. package/dist/index426.js +2 -8
  395. package/dist/index426.js.map +1 -1
  396. package/dist/index427.js +55 -2
  397. package/dist/index427.js.map +1 -1
  398. package/dist/index428.js +53 -52
  399. package/dist/index428.js.map +1 -1
  400. package/dist/index429.js +32 -55
  401. package/dist/index429.js.map +1 -1
  402. package/dist/index430.js +2 -16
  403. package/dist/index430.js.map +1 -1
  404. package/dist/index431.js +2 -29
  405. package/dist/index431.js.map +1 -1
  406. package/dist/index432.js +2 -13
  407. package/dist/index432.js.map +1 -1
  408. package/dist/index433.js +2 -7
  409. package/dist/index433.js.map +1 -1
  410. package/dist/index434.js +16 -2
  411. package/dist/index434.js.map +1 -1
  412. package/dist/index435.js +29 -2
  413. package/dist/index435.js.map +1 -1
  414. package/dist/index436.js +13 -2
  415. package/dist/index436.js.map +1 -1
  416. package/dist/index437.js +7 -2
  417. package/dist/index437.js.map +1 -1
  418. package/dist/index47.js +2 -2
  419. package/dist/index48.js +36 -36
  420. package/dist/index49.js +29 -29
  421. package/dist/index50.js +2 -2
  422. package/dist/index51.js +12 -12
  423. package/dist/index52.js +4 -4
  424. package/dist/index53.js +1 -1
  425. package/dist/index54.js +21 -21
  426. package/dist/index55.js +5 -5
  427. package/dist/index56.js +5 -5
  428. package/dist/index57.js +8 -8
  429. package/dist/index58.js +5 -5
  430. package/dist/index59.js +17 -17
  431. package/dist/index60.js +5 -5
  432. package/dist/index61.js +3 -3
  433. package/dist/index64.js +5 -5
  434. package/dist/index64.js.map +1 -1
  435. package/dist/index66.js +10 -22
  436. package/dist/index66.js.map +1 -1
  437. package/dist/index67.js +17 -232
  438. package/dist/index67.js.map +1 -1
  439. package/dist/index68.js +5 -5
  440. package/dist/index68.js.map +1 -1
  441. package/dist/index70.js +22 -10
  442. package/dist/index70.js.map +1 -1
  443. package/dist/index71.js +232 -17
  444. package/dist/index71.js.map +1 -1
  445. package/dist/index76.js +1 -1
  446. package/dist/index77.js +2 -2
  447. package/dist/index78.js +2 -2
  448. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index167.js","sources":["../../../node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { DialogInteractions, useDialogRoot } from \"./useDialogRoot.mjs\";\nimport { DialogRootContext, IsDrawerContext, useDialogRootContext } from \"./DialogRootContext.mjs\";\nimport { DialogStore } from \"../store/DialogStore.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function useRenderDialogRoot(props, mode = 'dialog') {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal: disablePointerDismissalProp = false,\n modal: modalProp = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const isDrawer = mode === 'drawer';\n const isAlertDialog = mode === 'alert-dialog';\n const modal = isAlertDialog ? true : modalProp;\n const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;\n const role = isAlertDialog ? 'alertdialog' : 'dialog';\n const parentDialogRootContext = useDialogRootContext(true);\n const nested = Boolean(parentDialogRootContext);\n const rootState = {\n modal,\n disablePointerDismissal,\n nested,\n role\n };\n const store = DialogStore.useStore(handle?.store, {\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n ...rootState\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n const nextState = openProp === undefined && store.state.open === false && defaultOpen === true ? {\n open: true,\n activeTriggerId: defaultTriggerIdProp\n } : null;\n if (isAlertDialog) {\n // Handles can reuse plain Dialog stores; alert dialog invariants must exist immediately.\n store.update(nextState ? {\n ...rootState,\n ...nextState\n } : rootState);\n } else if (nextState) {\n store.update(nextState);\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useSyncedValues(rootState);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const payload = store.useState('payload');\n useDialogRoot({\n store,\n actionsRef\n });\n const shouldRenderInteractions = open || mounted;\n const contextValue = React.useMemo(() => ({\n store\n }), [store]);\n return /*#__PURE__*/_jsx(IsDrawerContext.Provider, {\n value: false,\n children: /*#__PURE__*/_jsxs(DialogRootContext.Provider, {\n value: contextValue,\n children: [shouldRenderInteractions && /*#__PURE__*/_jsx(DialogInteractions, {\n store: store,\n parentContext: parentDialogRootContext?.store.context,\n isDrawer: isDrawer\n }), typeof children === 'function' ? children({\n payload\n }) : children]\n })\n });\n}"],"names":["useRenderDialogRoot","props","mode","children","openProp","defaultOpen","onOpenChange","onOpenChangeComplete","disablePointerDismissalProp","modalProp","actionsRef","handle","triggerIdProp","defaultTriggerIdProp","isDrawer","isAlertDialog","modal","disablePointerDismissal","role","parentDialogRootContext","useDialogRootContext","rootState","store","DialogStore","useOnFirstRender","nextState","open","mounted","payload","useDialogRoot","shouldRenderInteractions","contextValue","React","_jsx","IsDrawerContext","_jsxs","DialogRootContext","DialogInteractions"],"mappings":";;;;;;AAQO,SAASA,EAAoBC,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M,SAAS,MAAM,GAC5BK,IAAUL,EAAM,SAAS,SAAS,GAClCM,IAAUN,EAAM,SAAS,SAAS;AACxC,EAAAO,EAAc;AAAA,IACZ,OAAAP;AAAA,IACA,YAAAZ;AAAA,EACJ,CAAG;AACD,QAAMoB,IAA2BJ,KAAQC,GACnCI,IAAeC,EAAM,QAAQ,OAAO;AAAA,IACxC,OAAAV;AAAA,EACJ,IAAM,CAACA,CAAK,CAAC;AACX,SAAoBW,gBAAAA,EAAAA,IAAKC,EAAgB,UAAU;AAAA,IACjD,OAAO;AAAA,IACP,UAAuBC,gBAAAA,EAAAA,KAAMC,EAAkB,UAAU;AAAA,MACvD,OAAOL;AAAA,MACP,UAAU,CAACD,KAAyCG,gBAAAA,EAAAA,IAAKI,GAAoB;AAAA,QAC3E,OAAOf;AAAA,QACP,eAAeH,GAAyB,MAAM;AAAA,QAC9C,UAAUL;AAAA,MAClB,CAAO,GAAG,OAAOX,KAAa,aAAaA,EAAS;AAAA,QAC5C,SAAAyB;AAAA,MACR,CAAO,IAAIzB,CAAQ;AAAA,IACnB,CAAK;AAAA,EACL,CAAG;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index167.js","sources":["../../../node_modules/libphonenumber-js/es6/AsYouTypeParser.js"],"sourcesContent":["function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nimport _extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport extractNationalNumberFromPossiblyIncompleteNumber from './helpers/extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport stripIddPrefix from './helpers/stripIddPrefix.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport { VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from './constants.js';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');\nvar VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';\nvar AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$');\n\n// Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\nvar AsYouTypeParser = /*#__PURE__*/function () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n _classCallCheck(this, AsYouTypeParser);\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n return _createClass(AsYouTypeParser, [{\n key: \"input\",\n value: function input(text, state) {\n var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),\n formattedDigits = _extractFormattedDigi2[0],\n hasPlus = _extractFormattedDigi2[1];\n var digits = parseDigits(formattedDigits);\n // Checks for a special case: just a leading `+` has been entered.\n var justLeadingPlus;\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber(undefined, undefined);\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n if (digits) {\n this.inputDigits(digits, state);\n }\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n\n /**\r\n * Inputs \"next\" phone number digits.\r\n * @param {string} digits\r\n * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means \"don't format the national phone number at this stage\".\r\n */\n }, {\n key: \"inputDigits\",\n value: function inputDigits(nextDigits, state) {\n var digits = state.digits;\n var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3;\n\n // Append phone number digits.\n state.appendDigits(nextDigits);\n\n // Attempt to extract IDD prefix:\n // Some users input their phone number in international format,\n // but in an \"out-of-country\" dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers as soon as there're at least 3 digits.\n // Google's library attempts to extract IDD prefix at 3 digits,\n // so this library just copies that behavior.\n // I guess that's because the most commot IDD prefixes are\n // `00` (Europe) and `011` (US).\n // There exist really long IDD prefixes too:\n // for example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n // An IDD prefix is extracted here, and then every time when\n // there's a new digit and the number couldn't be formatted.\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\n }\n\n // If a phone number is being input in international format,\n // then it's not valid for it to have a national prefix.\n // Still, some people incorrectly input such numbers with a national prefix.\n // In such cases, only attempt to strip a national prefix if the number becomes too long.\n // (but that is done later, not here)\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }\n }, {\n key: \"isWaitingForCountryCallingCode\",\n value: function isWaitingForCountryCallingCode(_ref2) {\n var international = _ref2.international,\n callingCode = _ref2.callingCode;\n return international && !callingCode;\n }\n\n // Extracts a country calling code from a number\n // being entered in internatonal format.\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = _extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n if (countryCallingCode) {\n state.setCallingCode(countryCallingCode);\n state.update({\n nationalSignificantNumber: number\n });\n return true;\n }\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan) {\n if (numberingPlan) {\n this.hasSelectedNumberingPlan = true;\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n\n /**\r\n * Extracts a national (significant) number from user input.\r\n * Google's library is different in that it only applies `national_prefix_for_parsing`\r\n * and doesn't apply `national_prefix_transform_rule` after that.\r\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\r\n * @return {boolean} [extracted]\r\n */\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n if (nationalNumber === nationalDigits) {\n return;\n }\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n\n /**\r\n * In Google's code this function is called \"attempt to extract longer NDD\".\r\n * \"Some national prefixes are a substring of others\", they say.\r\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\r\n */\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode;\n // If a national prefix has been extracted previously,\n // then it's always extracted as additional digits are added.\n // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`\n // doesn't do anything different from what it currently does.\n // So, just in case, here's this check, though it doesn't occur.\n /* istanbul ignore if */\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n }, {\n key: \"onExtractedNationalNumber\",\n value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {\n // Tells if the parsed national (significant) number is present as-is in the input string.\n // For example, when inputting \"0343515551212999\" Argentinian mobile number,\n // the parsed national (significant) number is \"93435551212999\".\n // There, one can see how it stripped \"0\" national prefix and prepended a \"9\",\n // because that's how it is instructed to do in Argentina's metadata.\n // So in the described example, the parsed national (significant) number is not present\n // as-is in the input string. Instead, it's \"modified\" in the input string.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n var nationalSignificantNumberIsModified = false;\n\n // In some countries, a phone number could have a prefix that is not a \"national prefix\"\n // but rather some other type of \"utility\" prefix.\n // For example, when calling within Australia, one could prepend `1831` prefix to hide\n // caller's phone number.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n var prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;\n\n // `nationalSignificantNumber` could be empty. In that case, `.lastIndexOf()` still works correctly.\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);\n\n // If the parsed national (significant) number is the last substring of the `nationalDigits`,\n // then it means that it's present as-is in the input string.\n // In any other case, the parsed national (significant) number is \"modified\" in the input string.\n if (nationalSignificantNumberIndex < 0 || nationalSignificantNumberIndex !== nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberIsModified = true;\n } else {\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);\n // When national (significant) number is equal to the `nationalDigits`,\n // this `onExtractedNationalNumber()` function simply doesn't get called.\n // This means that at this point, `prefixBeforeNationalNumber` is always non-empty.\n // Still, added this `if` check just to prevent potential silly bugs.\n // The `!prefixBeforeNationalNumber` case is not really testable\n // so this line is exluded from the code coverage.\n /* istanbul ignore if */\n if (prefixBeforeNationalNumber) {\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = prefixBeforeNationalNumber;\n }\n }\n }\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberIsModified: nationalSignificantNumberIsModified,\n prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix: prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix\n });\n // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n this.hasExtractedNationalSignificantNumber = true;\n this.onNationalSignificantNumberChange();\n }\n }, {\n key: \"reExtractNationalSignificantNumber\",\n value: function reExtractNationalSignificantNumber(state) {\n // Attempt to extract a national prefix.\n //\n // Some people incorrectly input national prefix\n // in an international phone number.\n // For example, some people write British phone numbers as `+44(0)...`.\n //\n // Also, in some rare cases, it is valid for a national prefix\n // to be a part of an international phone number.\n // For example, mobile phone numbers in Mexico are supposed to be\n // dialled internationally using a `1` national prefix,\n // so the national prefix will be part of an international number.\n //\n // Quote from:\n // https://www.mexperience.com/dialing-cell-phones-in-mexico/\n //\n // \"Dialing a Mexican cell phone from abroad\n // When you are calling a cell phone number in Mexico from outside Mexico,\n // it’s necessary to dial an additional “1” after Mexico’s country code\n // (which is “52”) and before the area code.\n // You also ignore the 045, and simply dial the area code and the\n // cell phone’s number.\n //\n // If you don’t add the “1”, you’ll receive a recorded announcement\n // asking you to redial using it.\n //\n // For example, if you are calling from the USA to a cell phone\n // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.\n // (Note that this is different to calling a land line in Mexico City\n // from abroad, where the number dialed would be +52 – 55 – 1234 5678)\".\n //\n // Google's demo output:\n // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX\n //\n if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function (stateUpdate) {\n return state.update(stateUpdate);\n })) {\n return true;\n }\n // If no format matches the phone number, then it could be\n // \"a really long IDD\" (quote from a comment in Google's library).\n // An IDD prefix is first extracted when the user has entered at least 3 digits,\n // and then here — every time when there's a new digit and the number\n // couldn't be formatted.\n // For example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n //\n // Could also check `!hasReceivedThreeLeadingDigits` here\n // to filter out the case when this check duplicates the one\n // already performed when there're 3 leading digits,\n // but it's not a big deal, and in most cases there\n // will be a suitable `format` when there're 3 leading digits.\n //\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n // Google's AsYouType formatter supports sort of an \"autocorrection\" feature\n // when it \"autocorrects\" numbers that have been input for a country\n // with that country's calling code.\n // Such \"autocorrection\" feature looks weird, but different people have been requesting it:\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n // https://github.com/catamphetamine/libphonenumber-js/issues/375\n // https://github.com/catamphetamine/libphonenumber-js/issues/316\n if (this.fixMissingPlus(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n }\n }, {\n key: \"extractIddPrefix\",\n value: function extractIddPrefix(state) {\n // An IDD prefix can't be present in a number written with a `+`.\n // Also, don't re-extract an IDD prefix if has already been extracted.\n var international = state.international,\n IDDPrefix = state.IDDPrefix,\n digits = state.digits,\n nationalSignificantNumber = state.nationalSignificantNumber;\n if (international || IDDPrefix) {\n return;\n }\n // Some users input their phone number in \"out-of-country\"\n // dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers.\n var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {\n // If an IDD prefix was stripped then convert the IDD-prefixed number\n // to international number for subsequent parsing.\n state.update({\n IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)\n });\n this.startInternationalNumber(state, {\n country: undefined,\n callingCode: undefined\n });\n return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode;\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state, {\n country: state.country,\n callingCode: newCallingCode\n });\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state, _ref3) {\n var country = _ref3.country,\n callingCode = _ref3.callingCode;\n state.startInternationalNumber(country, callingCode);\n // If a national (significant) number has been extracted before, reset it.\n if (state.nationalSignificantNumber) {\n state.resetNationalSignificantNumber();\n this.onNationalSignificantNumberChange();\n this.hasExtractedNationalSignificantNumber = undefined;\n }\n }\n }, {\n key: \"extractCallingCodeAndNationalSignificantNumber\",\n value: function extractCallingCodeAndNationalSignificantNumber(state) {\n if (this.extractCountryCallingCode(state)) {\n // `this.extractCallingCode()` is currently called when the number\n // couldn't be formatted during the standard procedure.\n // Normally, the national prefix would be re-extracted\n // for an international number if such number couldn't be formatted,\n // but since it's already not able to be formatted,\n // there won't be yet another retry, so also extract national prefix here.\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }]);\n}();\n/**\r\n * Extracts formatted phone number from text (if there's any).\r\n * @param {string} text\r\n * @return {string} [formattedPhoneNumber]\r\n */\nexport { AsYouTypeParser as default };\nfunction extractFormattedPhoneNumber(text) {\n // Attempt to extract a possible number from the string passed in.\n var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);\n if (startsAt < 0) {\n return;\n }\n // Trim everything to the left of the phone number.\n text = text.slice(startsAt);\n // Trim the `+`.\n var hasPlus;\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n }\n // Trim everything to the right of the phone number.\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, '');\n // Re-add the previously trimmed `+`.\n if (hasPlus) {\n text = '+' + text;\n }\n return text;\n}\n\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || '';\n // Trim a `+`.\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n return [extractedNumber];\n}\n\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\nexport function extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1];\n // If the extracted phone number part\n // can possibly be a part of some valid phone number\n // then parse phone number characters from a formatted phone number.\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map"],"names":["_typeof","o","_slicedToArray","r","e","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","a","_arrayLikeToArray","n","l","i","u","f","_classCallCheck","_defineProperties","_toPropertyKey","_createClass","t","_toPrimitive","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART","VALID_PUNCTUATION","VALID_DIGITS","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN","VALID_FORMATTED_PHONE_NUMBER_PART","PLUS_CHARS","AFTER_PHONE_NUMBER_DIGITS_END_PATTERN","COMPLEX_NATIONAL_PREFIX","AsYouTypeParser","_ref","defaultCountry","defaultCallingCode","metadata","onNationalSignificantNumberChange","text","state","_extractFormattedDigi","extractFormattedDigitsAndPlus","_extractFormattedDigi2","formattedDigits","hasPlus","digits","parseDigits","justLeadingPlus","nextDigits","hasReceivedThreeLeadingDigits","stateUpdate","_ref2","international","callingCode","_extractCountryCallin","_extractCountryCallingCode","countryCallingCode","number","numberingPlan","nationalPrefixForParsing","nationalDigits","setState","_extractNationalNumbe","extractNationalNumberFromPossiblyIncompleteNumber","nationalPrefix","nationalNumber","carrierCode","prevNationalSignificantNumber","_extractNationalNumbe2","nationalSignificantNumber","nationalSignificantNumberIsModified","prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix","nationalSignificantNumberIndex","prefixBeforeNationalNumber","IDDPrefix","numberWithoutIDD","stripIddPrefix","_extractCountryCallin2","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","newCallingCode","_ref3","country","extractFormattedPhoneNumber","startsAt","_extractFormattedDigitsAndPlus","extractedNumber","_extractFormattedDigi3","_extractFormattedDigi4"],"mappings":";;;;;;AAAA,SAASA,EAAQC,GAAG;AAAE;AAA2B,SAAOD,IAAwB,OAAO,UAArB,cAA2C,OAAO,OAAO,YAA1B,WAAqC,SAAUC,GAAG;AAAE,WAAO,OAAOA;AAAA,EAAG,IAAI,SAAUA,GAAG;AAAE,WAAOA,KAAmB,OAAO,UAArB,cAA+BA,EAAE,gBAAgB,UAAUA,MAAM,OAAO,YAAY,WAAW,OAAOA;AAAA,EAAG,GAAGD,EAAQC,CAAC;AAAG;AAC7T,SAASC,EAAeC,GAAGC,GAAG;AAAE,SAAOC,EAAgBF,CAAC,KAAKG,EAAsBH,GAAGC,CAAC,KAAKG,EAA4BJ,GAAGC,CAAC,KAAKI,EAAgB;AAAI;AACrJ,SAASA,IAAmB;AAAE,QAAM,IAAI,UAAU;AAAA,mFAA2I;AAAG;AAChM,SAASD,EAA4BJ,GAAGM,GAAG;AAAE,MAAIN,GAAG;AAAE,QAAgB,OAAOA,KAAnB,SAAsB,QAAOO,EAAkBP,GAAGM,CAAC;AAAG,QAAI,IAAI,CAAA,EAAG,SAAS,KAAKN,CAAC,EAAE,MAAM,GAAG,EAAE;AAAG,WAAoB,MAAb,YAAkBA,EAAE,gBAAgB,IAAIA,EAAE,YAAY,OAAiB,MAAV,SAAyB,MAAV,QAAc,MAAM,KAAKA,CAAC,IAAoB,MAAhB,eAAqB,2CAA2C,KAAK,CAAC,IAAIO,EAAkBP,GAAGM,CAAC,IAAI;AAAA,EAAQ;AAAE;AACzX,SAASC,EAAkBP,GAAGM,GAAG;AAAE,GAASA,KAAR,QAAaA,IAAIN,EAAE,YAAYM,IAA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AA,IAEL;AAAA,EACJ,CAAG,CAAC;AACJ,GAAC;AAOD,SAASgC,EAA4B5C,GAAM;AAEzC,MAAI6C,IAAW7C,EAAK,OAAOV,CAAiC;AAC5D,MAAI,EAAAuD,IAAW,IAIf;AAAA,IAAA7C,IAAOA,EAAK,MAAM6C,CAAQ;AAE1B,QAAIvC;AACJ,WAAIN,EAAK,CAAC,MAAM,QACdM,IAAU,IACVN,IAAOA,EAAK,MAAM,CAAU,IAG9BA,IAAOA,EAAK,QAAQR,GAAuC,EAAE,GAEzDc,MACFN,IAAO,MAAMA,IAERA;AAAA;AACT;AAOA,SAAS8C,EAA+B9C,GAAM;AAE5C,MAAI+C,IAAkBH,EAA4B5C,CAAI,KAAK;AAE3D,SAAI+C,EAAgB,CAAC,MAAM,MAClB,CAACA,EAAgB,MAAM,CAAU,GAAG,EAAI,IAE1C,CAACA,CAAe;AACzB;AAOO,SAAS5C,EAA8BH,GAAM;AAClD,MAAIgD,IAAyBF,EAA+B9C,CAAI,GAC9DiD,IAAyBnF,EAAekF,GAAwB,CAAC,GACjE3C,IAAkB4C,EAAuB,CAAC,GAC1C3C,IAAU2C,EAAuB,CAAC;AAIpC,SAAK5D,EAAiD,KAAKgB,CAAe,MACxEA,IAAkB,KAEb,CAACA,GAAiBC,CAAO;AAClC;","x_google_ignoreList":[0]}
package/dist/index168.js CHANGED
@@ -1,12 +1,10 @@
1
- function n(a, s) {
2
- return function(e, ...t) {
3
- const r = new URL(a);
4
- return r.searchParams.set("code", e.toString()), t.forEach((o) => r.searchParams.append("args[]", o)), `${s} error #${e}; visit ${r} for the full message.`;
5
- };
1
+ import o from "./index169.js";
2
+ function i(r, a) {
3
+ var n = a.nationalNumber, e = a.metadata, t = e.getCountryCodesForCallingCode(r);
4
+ if (t)
5
+ return t.length === 1 ? t[0] : o(n, t, e.metadata);
6
6
  }
7
- const u = n("https://base-ui.com/production-error", "Base UI");
8
7
  export {
9
- n as createFormatErrorMessage,
10
- u as default
8
+ i as default
11
9
  };
12
10
  //# sourceMappingURL=index168.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index168.js","sources":["../../../node_modules/@base-ui/utils/formatErrorMessage.mjs"],"sourcesContent":["/**\n * Creates a formatErrorMessage function with a custom URL and prefix.\n * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')\n * @param prefix - The prefix for the error message (e.g., 'Base UI')\n * @returns A function that formats error messages with the given URL and prefix\n */\nexport function createFormatErrorMessage(baseUrl, prefix) {\n return function formatErrorMessage(code, ...args) {\n const url = new URL(baseUrl);\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `${prefix} error #${code}; visit ${url} for the full message.`;\n };\n}\n\n/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nconst formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');\nexport default formatErrorMessage;"],"names":["createFormatErrorMessage","baseUrl","prefix","code","args","url","arg","formatErrorMessage"],"mappings":"AAMO,SAASA,EAAyBC,GAASC,GAAQ;AACxD,SAAO,SAA4BC,MAASC,GAAM;AAChD,UAAMC,IAAM,IAAI,IAAIJ,CAAO;AAC3B,WAAAI,EAAI,aAAa,IAAI,QAAQF,EAAK,SAAQ,CAAE,GAC5CC,EAAK,QAAQ,CAAAE,MAAOD,EAAI,aAAa,OAAO,UAAUC,CAAG,CAAC,GACnD,GAAGJ,CAAM,WAAWC,CAAI,WAAWE,CAAG;AAAA,EAC/C;AACF;AAWK,MAACE,IAAqBP,EAAyB,wCAAwC,SAAS;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index168.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js"],"sourcesContent":["import getCountryByNationalNumber from './getCountryByNationalNumber.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [callingCode]\r\n * @param {string} [options.nationalNumber] — National (significant) number.\r\n * @param {Metadata} options.metadata — Metadata instance.\r\n * @returns {string?} Returns the most suitable country for this calling code and national (significant) number.\r\n */\nexport default function getCountryByCallingCode(callingCode, _ref) {\n var nationalNumber = _ref.nationalNumber,\n metadata = _ref.metadata;\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n }\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n if (!possibleCountries) {\n return;\n }\n // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n return getCountryByNationalNumber(nationalNumber, possibleCountries, metadata.metadata);\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map"],"names":["getCountryByCallingCode","callingCode","_ref","nationalNumber","metadata","possibleCountries","getCountryByNationalNumber"],"mappings":";AAWe,SAASA,EAAwBC,GAAaC,GAAM;AACjE,MAAIC,IAAiBD,EAAK,gBACxBE,IAAWF,EAAK,UAOdG,IAAoBD,EAAS,8BAA8BH,CAAW;AAC1E,MAAKI;AAKL,WAAIA,EAAkB,WAAW,IACxBA,EAAkB,CAAC,IAErBC,EAA2BH,GAAgBE,GAAmBD,EAAS,QAAQ;AACxF;","x_google_ignoreList":[0]}
package/dist/index169.js CHANGED
@@ -1,19 +1,44 @@
1
- const t = {
2
- style: {
3
- transition: "none"
1
+ import u from "./index163.js";
2
+ import f from "./index318.js";
3
+ function d(e, r) {
4
+ var t = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
5
+ if (t) return (t = t.call(e)).next.bind(t);
6
+ if (Array.isArray(e) || (t = s(e)) || r) {
7
+ t && (e = t);
8
+ var n = 0;
9
+ return function() {
10
+ return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
11
+ };
4
12
  }
5
- }, i = "data-base-ui-click-trigger", n = {
6
- fallbackAxisSide: "none"
7
- }, e = {
8
- clipPath: "inset(50%)",
9
- position: "fixed",
10
- top: 0,
11
- left: 0
12
- };
13
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
15
+ }
16
+ function s(e, r) {
17
+ if (e) {
18
+ if (typeof e == "string") return i(e, r);
19
+ var t = {}.toString.call(e).slice(8, -1);
20
+ return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? i(e, r) : void 0;
21
+ }
22
+ }
23
+ function i(e, r) {
24
+ (r == null || r > e.length) && (r = e.length);
25
+ for (var t = 0, n = Array(r); t < r; t++) n[t] = e[t];
26
+ return n;
27
+ }
28
+ function y(e, r, t) {
29
+ for (var n = new u(t), l = d(r), o; !(o = l()).done; ) {
30
+ var a = o.value;
31
+ if (n.selectNumberingPlan(a), n.leadingDigits()) {
32
+ if (e && e.search(n.leadingDigits()) === 0)
33
+ return a;
34
+ } else if (f({
35
+ phone: e,
36
+ country: a
37
+ }, void 0, n.metadata))
38
+ return a;
39
+ }
40
+ }
13
41
  export {
14
- i as CLICK_TRIGGER_IDENTIFIER,
15
- t as DISABLED_TRANSITIONS_STYLE,
16
- n as DROPDOWN_COLLISION_AVOIDANCE,
17
- e as ownerVisuallyHidden
42
+ y as default
18
43
  };
19
44
  //# sourceMappingURL=index169.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index169.js","sources":["../../../node_modules/@base-ui/react/internals/constants.mjs"],"sourcesContent":["export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};"],"names":["DISABLED_TRANSITIONS_STYLE","CLICK_TRIGGER_IDENTIFIER","DROPDOWN_COLLISION_AVOIDANCE","ownerVisuallyHidden"],"mappings":"AAEY,MAACA,IAA6B;AAAA,EACxC,OAAO;AAAA,IACL,YAAY;AAAA,EAChB;AACA,GACaC,IAA2B,8BAU3BC,IAA+B;AAAA,EAC1C,kBAAkB;AACpB,GAgBaC,IAAsB;AAAA,EACjC,UAAU;AAAA,EACV,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AACR;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index169.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"],"sourcesContent":["function _createForOfIteratorHelperLoose(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport Metadata from '../metadata.js';\nimport getNumberType from './getNumberType.js';\n\n/**\r\n * Returns the exact country that a given national (significant) number belongs to\r\n * in case of ambiguity, i.e. when multiple countries share the same \"country calling code\".\r\n * @param {string} [nationalNumber]\r\n * @param {string[]} countries — A list of countries that share the same calling code.\r\n * @param {object} metadata — Metadata JSON.\r\n * @returns {string?} Returns the exact country this number belongs to, or `undefined` if the exact country couldn't be determined.\r\n */\nexport default function getCountryByNationalNumber(nationalNumber, countries, metadataJson) {\n // Create a new `metadata` instance because it will be selecting a `country`.\n var metadata = new Metadata(metadataJson);\n\n // const matchingCountries = []\n\n for (var _iterator = _createForOfIteratorHelperLoose(countries), _step; !(_step = _iterator()).done;) {\n var country = _step.value;\n metadata.selectNumberingPlan(country);\n // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // condition for a phone number to belong to a country.\n // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // I'd suppose that \"leading digits\" patterns are mutually exclusive for different countries\n // because of the intended use of that feature.\n if (metadata.leadingDigits()) {\n if (nationalNumber && nationalNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n }\n // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalNumber,\n country: country\n }, undefined, metadata.metadata)) {\n // When multiple countries share the same \"country calling code\",\n // type patterns aren't guaranteed to be unique among them.\n // For example, both `US` and `CA` have the same pattern for `toll_free` numbers.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417147572\n //\n // That means that this `if` condition could be `true` for multiple countries from the list.\n // Currently, it just returns the first one, which is also the \"main\" country for the \"country calling code\".\n // In an example with `toll_free` numbers above, `\"US\"` would be returned even though\n // it could as well be `\"CA\"`.\n //\n // There was also a time when this attempted to be overly smart\n // and kept track of all such multiple matching countries\n // and then picked the one that matched the `defaultCountry`, if provided.\n // For example, with `toll_free` numbers above, and with `defaultCountry: \"CA\"`,\n // it would've returned `\"CA\"` instead of `\"US\"`.\n // Later it turned out that such \"overly smart\" behavior turned out to be just confusing,\n // so this \"overly smart\" country detection was reverted to returning the \"main\" country\n // for the \"country calling code\".\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/154\n //\n return country;\n //\n // The \"overly smart\" behavior code:\n //\n // if (defaultCountry) {\n // \tif (country === defaultCountry) {\n // \t\treturn country\n // \t} else {\n // \t\tmatchingCountries.push(country)\n // \t}\n // } else {\n // \treturn country\n // }\n }\n }\n\n // // Return the first (\"main\") one of the `matchingCountries`.\n // if (matchingCountries.length > 0) {\n // \treturn matchingCountries[0]\n // }\n}\n//# sourceMappingURL=getCountryByNationalNumber.js.map"],"names":["_createForOfIteratorHelperLoose","r","e","_unsupportedIterableToArray","o","a","_arrayLikeToArray","getCountryByNationalNumber","nationalNumber","countries","metadataJ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AI/BG,IAAYb,EAAgCS,CAAS,GAAGK,GAAO,EAAEA,IAAQD,EAAS,GAAI,QAAO;AACpG,QAAIE,IAAUD,EAAM;AASpB,QARAH,EAAS,oBAAoBI,CAAO,GAQhCJ,EAAS;AACX,UAAIH,KAAkBA,EAAe,OAAOG,EAAS,cAAa,CAAE,MAAM;AACxE,eAAOI;AAAA,eAKFC,EAAc;AAAA,MACrB,OAAOR;AAAA,MACP,SAASO;AAAA,IACf,GAAO,QAAWJ,EAAS,QAAQ;AAqB7B,aAAOI;AAAA,EAcX;AAMF;","x_google_ignoreList":[0]}
package/dist/index170.js CHANGED
@@ -1,34 +1,8 @@
1
- import * as i from "react";
2
- import { useStableCallback as u } from "./index264.js";
3
- import { useEnhancedClickHandler as c } from "./index276.js";
4
- import { useValueChanged as l } from "./index277.js";
5
- import { ios as a } from "./index278.js";
6
- function m(e, t) {
7
- const n = u((p, s) => {
8
- (typeof e == "function" ? e() : e) || t(s || // On iOS Safari, the hitslop around touch targets means tapping outside an element's
9
- // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`
10
- // will be "" in that case.
11
- (a ? "touch" : ""));
12
- }), {
13
- onClick: o,
14
- onPointerDown: r
15
- } = c(n);
16
- return i.useMemo(() => ({
17
- onClick: o,
18
- onPointerDown: r
19
- }), [o, r]);
20
- }
21
- function M(e) {
22
- const [t, n] = i.useState(null), o = m(e, n);
23
- return l(e, (r) => {
24
- r && !e && n(null);
25
- }), i.useMemo(() => ({
26
- openMethod: t,
27
- triggerProps: o
28
- }), [t, o]);
1
+ var t = {}.constructor;
2
+ function n(r) {
3
+ return r != null && r.constructor === t;
29
4
  }
30
5
  export {
31
- M as useOpenInteractionType,
32
- m as useOpenMethodTriggerProps
6
+ n as default
33
7
  };
34
8
  //# sourceMappingURL=index170.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index170.js","sources":["../../../node_modules/@base-ui/react/utils/useOpenInteractionType.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { platform } from '@base-ui/utils/platform';\nimport { useValueChanged } from \"../internals/useValueChanged.mjs\";\nexport function useOpenMethodTriggerProps(open, setOpenMethod) {\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n const isOpen = typeof open === 'function' ? open() : open;\n if (!isOpen) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n platform.os.ios ? 'touch' : ''));\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n onClick,\n onPointerDown\n }), [onClick, onPointerDown]);\n}\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n return React.useMemo(() => ({\n openMethod,\n triggerProps\n }), [openMethod, triggerProps]);\n}"],"names":["useOpenMethodTriggerProps","open","setOpenMethod","handleTriggerClick","useStableCallback","_","interactionType","platform.os.ios","onClick","onPointerDown","useEnhancedClickHandler","React","useOpenInteractionType","openMethod","triggerProps","useValueChanged","previousOpen"],"mappings":";;;;;AAOO,SAASA,EAA0BC,GAAMC,GAAe;AAC7D,QAAMC,IAAqBC,EAAkB,CAACC,GAAGC,MAAoB;AAEnE,KADe,OAAOL,KAAS,aAAaA,EAAI,IAAKA,MAEnDC,EAAcI;AAAA;AAAA;AAAA,KAIdC,IAAkB,UAAU,GAAG;AAAA,EAEnC,CAAC,GACK;AAAA,IACJ,SAAAC;AAAA,IACA,eAAAC;AAAA,EACJ,IAAMC,EAAwBP,CAAkB;AAC9C,SAAOQ,EAAM,QAAQ,OAAO;AAAA,IAC1B,SAAAH;AAAA,IACA,eAAAC;AAAA,EACJ,IAAM,CAACD,GAASC,CAAa,CAAC;AAC9B;AAOO,SAASG,EAAuBX,GAAM;AAC3C,QAAM,CAACY,GAAYX,CAAa,IAAIS,EAAM,SAAS,IAAI,GACjDG,IAAed,EAA0BC,GAAMC,CAAa;AAClE,SAAAa,EAAgBd,GAAM,CAAAe,MAAgB;AACpC,IAAIA,KAAgB,CAACf,KACnBC,EAAc,IAAI;AAAA,EAEtB,CAAC,GACMS,EAAM,QAAQ,OAAO;AAAA,IAC1B,YAAAE;AAAA,IACA,cAAAC;AAAA,EACJ,IAAM,CAACD,GAAYC,CAAY,CAAC;AAChC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index170.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/isObject.js"],"sourcesContent":["var objectConstructor = {}.constructor;\nexport default function isObject(object) {\n return object !== undefined && object !== null && object.constructor === objectConstructor;\n}\n//# sourceMappingURL=isObject.js.map"],"names":["objectConstructor","isObject","object"],"mappings":"AAAA,IAAIA,IAAoB,CAAA,EAAG;AACZ,SAASC,EAASC,GAAQ;AACvC,SAA+BA,KAAW,QAAQA,EAAO,gBAAgBF;AAC3E;","x_google_ignoreList":[0]}
package/dist/index171.js CHANGED
@@ -1,73 +1,18 @@
1
- import * as p from "react";
2
- import { useAnimationFrame as v } from "./index323.js";
3
- import { useTimeout as P } from "./index307.js";
4
- import { EMPTY_OBJECT as b } from "./index258.js";
5
- import { isTypeableElement as x } from "./index312.js";
6
- import { isMouseLikePointerType as E } from "./index334.js";
7
- import { createChangeEventDetails as I } from "./index153.js";
8
- import { getTarget as S } from "./index313.js";
9
- import { triggerPress as q } from "./index155.js";
10
- function Y(s, M = {}) {
11
- const {
12
- enabled: l = !0,
13
- event: c = "click",
14
- toggle: d = !0,
15
- ignoreMouse: f = !1,
16
- stickIfOpen: g = !0,
17
- touchOpenDelay: a = 0,
18
- reason: T = q
19
- } = M, i = "rootStore" in s ? s.rootStore : s, k = i.context.dataRef, u = p.useRef(void 0), O = v(), y = P(), w = p.useMemo(() => {
20
- function m(e, r, n, o) {
21
- const t = I(T, r, n);
22
- e && o === "touch" && a > 0 ? y.start(a, () => {
23
- i.setOpen(!0, t);
24
- }) : i.setOpen(e, t);
25
- }
26
- function h(e, r, n) {
27
- const o = k.current.openEvent, t = i.select("domReferenceElement") !== r;
28
- return e && t || !e || !d ? !0 : o && g ? !n(o.type) : !1;
29
- }
30
- return {
31
- onPointerDown(e) {
32
- u.current = e.pointerType;
33
- },
34
- onMouseDown(e) {
35
- const r = u.current, n = e.nativeEvent, o = i.select("open");
36
- if (e.button !== 0 || c === "click" || E(r) && f)
37
- return;
38
- const t = h(o, e.currentTarget, (D) => D === "click" || D === "mousedown"), C = S(n);
39
- if (x(C)) {
40
- m(t, n, C, r);
41
- return;
42
- }
43
- const R = e.currentTarget;
44
- O.request(() => {
45
- m(t, n, R, r);
46
- });
47
- },
48
- onClick(e) {
49
- if (c === "mousedown-only")
50
- return;
51
- const r = u.current;
52
- if (c === "mousedown" && r) {
53
- u.current = void 0;
54
- return;
55
- }
56
- if (E(r) && f)
57
- return;
58
- const n = i.select("open"), o = h(n, e.currentTarget, (t) => t === "click" || t === "mousedown" || t === "keydown" || t === "keyup");
59
- m(o, e.nativeEvent, e.currentTarget, r);
60
- },
61
- onKeyDown() {
62
- u.current = void 0;
63
- }
64
- };
65
- }, [k, c, f, T, i, g, d, O, y, a]);
66
- return p.useMemo(() => l ? {
67
- reference: w
68
- } : b, [l, w]);
1
+ import r from "./index190.js";
2
+ import * as o from "react";
3
+ const s = /* @__PURE__ */ o.createContext(!1);
4
+ process.env.NODE_ENV !== "production" && (s.displayName = "IsDrawerContext");
5
+ const e = /* @__PURE__ */ o.createContext(void 0);
6
+ process.env.NODE_ENV !== "production" && (e.displayName = "DialogRootContext");
7
+ function a(n) {
8
+ const t = o.useContext(e);
9
+ if (n === !1 && t === void 0)
10
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>." : r(27));
11
+ return t;
69
12
  }
70
13
  export {
71
- Y as useClick
14
+ e as DialogRootContext,
15
+ s as IsDrawerContext,
16
+ a as useDialogRootContext
72
17
  };
73
18
  //# sourceMappingURL=index171.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index171.js","sources":["../../../node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getTarget, isTypeableElement } from \"../utils/element.mjs\";\nimport { isMouseLikePointerType } from \"../utils/event.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nexport function useClick(context, props = {}) {\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n stickIfOpen = true,\n touchOpenDelay = 0,\n reason = REASONS.triggerPress\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const dataRef = store.context.dataRef;\n const pointerTypeRef = React.useRef(undefined);\n const frame = useAnimationFrame();\n const touchOpenTimeout = useTimeout();\n const reference = React.useMemo(() => {\n function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {\n const details = createChangeEventDetails(reason, nativeEvent, target);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n }\n function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {\n const openEvent = dataRef.current.openEvent;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== currentTarget;\n if (open && hasClickedOnInactiveTrigger) {\n // Moving between triggers should always open the newly active one.\n return true;\n }\n if (!open) {\n // A closed popup should open on the next press.\n return true;\n }\n if (!toggle) {\n // Non-toggle mode never closes on a repeated trigger press.\n return true;\n }\n if (openEvent && stickIfOpen) {\n // Preserve hover/focus-opened popups until the matching click-like event closes them.\n return !isClickLikeOpenEvent(openEvent.type);\n }\n\n // Otherwise, a repeated click toggles the popup closed.\n return false;\n }\n return {\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n const nativeEvent = event.nativeEvent;\n const open = store.select('open');\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown');\n\n // Animations sometimes won't run on a typeable element if using a rAF.\n // Focus is always set on these elements. For touch, we may delay opening.\n const target = getTarget(nativeEvent);\n if (isTypeableElement(target)) {\n setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType);\n return;\n }\n\n // Capture the currentTarget before the rAF.\n // as React sets it to null after the event handler completes.\n const eventCurrentTarget = event.currentTarget;\n\n // Wait until focus is set on the element. This is an alternative to\n // `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.\n frame.request(() => {\n setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);\n });\n },\n onClick(event) {\n if (eventOption === 'mousedown-only') {\n return;\n }\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerType) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const open = store.select('open');\n const nextOpen = getNextOpen(open, event.currentTarget, openEventType => openEventType === 'click' || openEventType === 'mousedown' || openEventType === 'keydown' || openEventType === 'keyup');\n setOpenWithTouchDelay(nextOpen, event.nativeEvent, event.currentTarget, pointerType);\n },\n onKeyDown() {\n pointerTypeRef.current = undefined;\n }\n };\n }, [dataRef, eventOption, ignoreMouse, reason, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);\n return React.useMemo(() => enabled ? {\n reference\n } : EMPTY_OBJECT, [enabled, reference]);\n}"],"names":["useClick","context","props","enabled","eventOption","toggle","ignoreMouse","stickIfOpen","touchOpenDelay","reason","REASONS.triggerPress","store","dataRef","pointerTypeRef","React","frame","useAnimationFrame","touchOpenTimeout","useTimeout","reference","setOpenWithTouchDelay","nextOpen","nativeEvent","target","pointerType","details","createChangeEventDetails","getNextOpen","open","currentTarget","isClickLikeOpenEvent","openEvent","hasClickedOnInactiveTrigger","event","isMouseLikePointerType","openEventType","getTarget","isTypeableElement","eventCurrentTarget","EMPTY_OBJECT"],"mappings":";;;;;;;;;AAcO,SAASA,EAASC,GAASC,IAAQ,IAAI;AAC5C,QAAM;AAAA,IACJ,SAAAC,IAAU;AAAA,IACV,OAAOC,IAAc;AAAA,IACrB,QAAAC,IAAS;AAAA,IACT,aAAAC,IAAc;AAAA,IACd,aAAAC,IAAc;AAAA,IACd,gBAAAC,IAAiB;AAAA,IACjB,QAAAC,IAASC;AAAAA,EACb,IAAMR,GACES,IAAQ,eAAeV,IAAUA,EAAQ,YAAYA,GACrDW,IAAUD,EAAM,QAAQ,SACxBE,IAAiBC,EAAM,OAAO,MAAS,GACvCC,IAAQC,EAAiB,GACzBC,IAAmBC,EAAU,GAC7BC,IAAYL,EAAM,QAAQ,MAAM;AACpC,aAASM,EAAsBC,GAAUC,GAAaC,GAAQC,GAAa;AACzE,YAAMC,IAAUC,EAAyBjB,GAAQa,GAAaC,CAAM;AACpE,MAAIF,KAAYG,MAAgB,WAAWhB,IAAiB,IAC1DS,EAAiB,MAAMT,GAAgB,MAAM;AAC3C,QAAAG,EAAM,QAAQ,IAAMc,C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AE,MAAiBA,MAAkB,WAAWA,MAAkB,eAAeA,MAAkB,aAAaA,MAAkB,OAAO;AAC/L,QAAAf,EAAsBC,GAAUY,EAAM,aAAaA,EAAM,eAAeT,CAAW;AAAA,MACrF;AAAA,MACA,YAAY;AACV,QAAAX,EAAe,UAAU;AAAA,MAC3B;AAAA,IACN;AAAA,EACE,GAAG,CAACD,GAASR,GAAaE,GAAaG,GAAQE,GAAOJ,GAAaF,GAAQU,GAAOE,GAAkBT,CAAc,CAAC;AACnH,SAAOM,EAAM,QAAQ,MAAMX,IAAU;AAAA,IACnC,WAAAgB;AAAA,EACJ,IAAMoB,GAAc,CAACpC,GAASgB,CAAS,CAAC;AACxC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index171.js","sources":["../../../node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs"],"sourcesContent":["'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const IsDrawerContext = /*#__PURE__*/React.createContext(false);\nif (process.env.NODE_ENV !== \"production\") IsDrawerContext.displayName = \"IsDrawerContext\";\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const dialogRootContext = React.useContext(DialogRootContext);\n if (optional === false && dialogRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return dialogRootContext;\n}"],"names":["IsDrawerContext","React","DialogRootContext","useDialogRootContext","optional","dialogRootContext","_formatErrorMessage"],"mappings":";;AAIY,MAACA,IAA+B,gBAAAC,EAAM,cAAc,EAAK;AACjE,QAAQ,IAAI,aAAa,iBAAcD,EAAgB,cAAc;AAC7D,MAACE,IAAiC,gBAAAD,EAAM,cAAc,MAAS;AACvE,QAAQ,IAAI,aAAa,iBAAcC,EAAkB,cAAc;AACpE,SAASC,EAAqBC,GAAU;AAC7C,QAAMC,IAAoBJ,EAAM,WAAWC,CAAiB;AAC5D,MAAIE,MAAa,MAASC,MAAsB;AAC9C,UAAM,IAAI,MAAM,QAAQ,IAAI,aAAa,eAAe,6FAA6FC,EAAoB,EAAE,CAAC;AAE9K,SAAOD;AACT;","x_google_ignoreList":[0]}
package/dist/index172.js CHANGED
@@ -1,9 +1,72 @@
1
- import e from "./index174.js";
2
- function o(a, r) {
3
- var t = Array.prototype.slice.call(r);
4
- return t.push(e), a.apply(this, t);
1
+ import b from "./index190.js";
2
+ import * as c from "react";
3
+ import { createElement as p } from "react";
4
+ import { useMergedRefs as E, useMergedRefsN as g } from "./index255.js";
5
+ import { getReactElementRef as y } from "./index341.js";
6
+ import { mergeObjects as R } from "./index342.js";
7
+ import { warn as v } from "./index343.js";
8
+ import { EMPTY_OBJECT as f } from "./index264.js";
9
+ import { getStateAttributesProps as w } from "./index344.js";
10
+ import { resolveClassName as C } from "./index345.js";
11
+ import { resolveStyle as T } from "./index346.js";
12
+ import { mergeClassNames as _, mergeProps as h, mergePropsN as k } from "./index282.js";
13
+ function q(r, e, t = {}) {
14
+ const a = e.render, s = I(e, t);
15
+ if (t.enabled === !1)
16
+ return null;
17
+ const n = t.state ?? f;
18
+ return B(r, a, s, n);
19
+ }
20
+ function I(r, e = {}) {
21
+ const {
22
+ className: t,
23
+ style: a,
24
+ render: s
25
+ } = r, {
26
+ state: n = f,
27
+ ref: l,
28
+ props: u,
29
+ stateAttributesMapping: N,
30
+ enabled: i = !0
31
+ } = e, d = i ? C(t, n) : void 0, m = i ? T(a, n) : void 0, P = i ? w(n, N) : f, A = i && u ? O(u) : void 0, o = i ? R(P, A) ?? {} : f;
32
+ return typeof document < "u" && (i ? Array.isArray(l) ? o.ref = g([o.ref, y(s), ...l]) : o.ref = E(o.ref, y(s), l) : E(null, null)), i ? (d !== void 0 && (o.className = _(o.className, d)), m !== void 0 && (o.style = R(o.style, m)), o) : f;
33
+ }
34
+ function O(r) {
35
+ return Array.isArray(r) ? k(r) : h(void 0, r);
36
+ }
37
+ const M = /* @__PURE__ */ Symbol.for("react.lazy"), V = /^[A-Z][A-Za-z0-9$]*$/, $ = /[a-z]/;
38
+ function B(r, e, t, a) {
39
+ if (e) {
40
+ if (typeof e == "function")
41
+ return process.env.NODE_ENV !== "production" && D(e), e(t, a);
42
+ const s = h(t, e.props);
43
+ s.ref = t.ref;
44
+ let n = e;
45
+ if (n?.$$typeof === M && (n = c.Children.toArray(e)[0]), process.env.NODE_ENV !== "production" && !/* @__PURE__ */ c.isValidElement(n))
46
+ throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join(`
47
+ `));
48
+ return /* @__PURE__ */ c.cloneElement(n, s);
49
+ }
50
+ if (r && typeof r == "string")
51
+ return L(r, t);
52
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: Render element or function are not defined." : b(8));
53
+ }
54
+ function D(r) {
55
+ const e = r.name;
56
+ e.length !== 0 && V.test(e) && $.test(e) && v(`The \`render\` prop received a function named \`${e}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
57
+ }
58
+ function L(r, e) {
59
+ return r === "button" ? /* @__PURE__ */ p("button", {
60
+ type: "button",
61
+ ...e,
62
+ key: e.key
63
+ }) : r === "img" ? /* @__PURE__ */ p("img", {
64
+ alt: "",
65
+ ...e,
66
+ key: e.key
67
+ }) : /* @__PURE__ */ c.createElement(r, e);
5
68
  }
6
69
  export {
7
- o as default
70
+ q as useRenderElement
8
71
  };
9
72
  //# sourceMappingURL=index172.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index172.js","sources":["../../../node_modules/libphonenumber-js/min/exports/withMetadataArgument.js"],"sourcesContent":["// Importing from a \".js\" file is a workaround for Node.js \"ES Modules\"\r\n// importing system which is even uncapable of importing \"*.json\" files.\r\nimport metadata from '../../metadata.min.json.js'\r\n\r\nexport default function withMetadataArgument(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}"],"names":["withMetadataArgument","func","_arguments","args","metadata"],"mappings":";AAIe,SAASA,EAAqBC,GAAMC,GAAY;AAC9D,MAAIC,IAAO,MAAM,UAAU,MAAM,KAAKD,CAAU;AAChD,SAAAC,EAAK,KAAKC,CAAQ,GACXH,EAAK,MAAM,MAAME,CAAI;AAC7B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index172.js","sources":["../../../node_modules/@base-ui/react/internals/useRenderElement.mjs"],"sourcesContent":["import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.mjs\";\nimport { resolveClassName } from \"../utils/resolveClassName.mjs\";\nimport { resolveStyle } from \"../utils/resolveStyle.mjs\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.mjs\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n const renderProp = componentProps.render;\n const outProps = useRenderElementProps(componentProps, params);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params = {}) {\n const {\n className: classNameProp,\n style: styleProp,\n render: renderProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/facebook/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n let newElement = render;\n\n // Workaround for https://github.com/facebook/react/issues/32392\n // This works because the toArray() logic unwrap lazy element type in\n // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\n if (newElement?.$$typeof === REACT_LAZY_TYPE) {\n const children = React.Children.toArray(render);\n newElement = children[0];\n }\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(newElement)) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error(['Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.', 'A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.', 'https://base-ui.com/r/invalid-render-prop'].join('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(newElement, mergedProps);\n }\n if (element) {\n if (typeof element === 'string') {\n return renderTag(element, props);\n }\n }\n // Unreachable, but the typings on `useRenderElement` need to be reworked\n // to annotate it correctly.\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}"],"names":["useRenderElement","element","componentProps","params","renderProp","outProps","useRenderElementProps","state","EMPTY_OBJECT","evaluateRenderProp","classNameProp","styleProp","ref","props","stateAttributesMapping","enabled","className","resolveClassName","style","resolveStyle","stateProps","getStateAttributesProps","resolvedProps","resolveRenderFunctionProps","mergeObjects","useMergedRefsN","getReactElementRef","useMergedRefs","mergeClassNames","mergePropsN","mergeProps","REACT_LAZY_TYPE","COMPONENT_IDENTIFIER_PATTERN","LOWERCASE_CHARACTER_PATTERN","render","warnIfRenderPropLooksLikeComponent","mergedProps","newElement","React","renderTag","_formatErrorMessage","renderFn","functionName","warn","Tag","_createElement"],"mappings":";;;;;;;;;;;;AAmBO,SAASA,EAAiBC,GAASC,GAAgBC,IAAS,CAAA,GAAI;AACrE,QAAMC,IAAaF,EAAe,QAC5BG,IAAWC,EAAsBJ,GAAgBC,CAAM;AAC7D,MAAIA,EAAO,YAAY;AACrB,WAAO;AAET,QAAMI,IAAQJ,EAAO,SAASK;AAC9B,SAAOC,EAAmBR,GAASG,GAAYC,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