@rpcbase/ui 0.183.0 → 0.184.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (632) hide show
  1. package/dist/index10.js +25 -24
  2. package/dist/index10.js.map +1 -1
  3. package/dist/index100.js +5 -5
  4. package/dist/index100.js.map +1 -1
  5. package/dist/index101.js +5 -4
  6. package/dist/index101.js.map +1 -1
  7. package/dist/index102.js +4 -4
  8. package/dist/index102.js.map +1 -1
  9. package/dist/index103.js +4 -6
  10. package/dist/index103.js.map +1 -1
  11. package/dist/index104.js +6 -145
  12. package/dist/index104.js.map +1 -1
  13. package/dist/index105.js +24 -39
  14. package/dist/index105.js.map +1 -1
  15. package/dist/index106.js +6 -4
  16. package/dist/index106.js.map +1 -1
  17. package/dist/index107.js +4 -7
  18. package/dist/index107.js.map +1 -1
  19. package/dist/index108.js +6 -13
  20. package/dist/index108.js.map +1 -1
  21. package/dist/index109.js +5 -13
  22. package/dist/index109.js.map +1 -1
  23. package/dist/index11.js +34 -66
  24. package/dist/index11.js.map +1 -1
  25. package/dist/index110.js +4 -7
  26. package/dist/index110.js.map +1 -1
  27. package/dist/index111.js +5 -31
  28. package/dist/index111.js.map +1 -1
  29. package/dist/index112.js +4 -10
  30. package/dist/index112.js.map +1 -1
  31. package/dist/index113.js +8 -10
  32. package/dist/index113.js.map +1 -1
  33. package/dist/index114.js +5 -8
  34. package/dist/index114.js.map +1 -1
  35. package/dist/index115.js +4 -13
  36. package/dist/index115.js.map +1 -1
  37. package/dist/index116.js +4 -101
  38. package/dist/index116.js.map +1 -1
  39. package/dist/index117.js +7 -20
  40. package/dist/index117.js.map +1 -1
  41. package/dist/index118.js +145 -53
  42. package/dist/index118.js.map +1 -1
  43. package/dist/index119.js +36 -69
  44. package/dist/index119.js.map +1 -1
  45. package/dist/index12.js +556 -525
  46. package/dist/index12.js.map +1 -1
  47. package/dist/index120.js +4 -9
  48. package/dist/index120.js.map +1 -1
  49. package/dist/index121.js +5 -18
  50. package/dist/index121.js.map +1 -1
  51. package/dist/index122.js +13 -16
  52. package/dist/index122.js.map +1 -1
  53. package/dist/index123.js +13 -23
  54. package/dist/index123.js.map +1 -1
  55. package/dist/index124.js +7 -6
  56. package/dist/index124.js.map +1 -1
  57. package/dist/index125.js +31 -5
  58. package/dist/index125.js.map +1 -1
  59. package/dist/index126.js +10 -23
  60. package/dist/index126.js.map +1 -1
  61. package/dist/index127.js +11 -35
  62. package/dist/index127.js.map +1 -1
  63. package/dist/index128.js +9 -16
  64. package/dist/index128.js.map +1 -1
  65. package/dist/index129.js +13 -6
  66. package/dist/index129.js.map +1 -1
  67. package/dist/index13.js +128 -118
  68. package/dist/index13.js.map +1 -1
  69. package/dist/index130.js +101 -4
  70. package/dist/index130.js.map +1 -1
  71. package/dist/index131.js +20 -5
  72. package/dist/index131.js.map +1 -1
  73. package/dist/index132.js +53 -4
  74. package/dist/index132.js.map +1 -1
  75. package/dist/index133.js +72 -4
  76. package/dist/index133.js.map +1 -1
  77. package/dist/index134.js +9 -3
  78. package/dist/index134.js.map +1 -1
  79. package/dist/index135.js +20 -6
  80. package/dist/index135.js.map +1 -1
  81. package/dist/index136.js +17 -24
  82. package/dist/index136.js.map +1 -1
  83. package/dist/index137.js +23 -7
  84. package/dist/index137.js.map +1 -1
  85. package/dist/index138.js +6 -6
  86. package/dist/index138.js.map +1 -1
  87. package/dist/index139.js +5 -5
  88. package/dist/index139.js.map +1 -1
  89. package/dist/index14.js +74 -74
  90. package/dist/index14.js.map +1 -1
  91. package/dist/index140.js +23 -3
  92. package/dist/index140.js.map +1 -1
  93. package/dist/index141.js +35 -4
  94. package/dist/index141.js.map +1 -1
  95. package/dist/index142.js +16 -5
  96. package/dist/index142.js.map +1 -1
  97. package/dist/index143.js +6 -3
  98. package/dist/index143.js.map +1 -1
  99. package/dist/index144.js +4 -4
  100. package/dist/index144.js.map +1 -1
  101. package/dist/index145.js +4 -3
  102. package/dist/index145.js.map +1 -1
  103. package/dist/index146.js +4 -3
  104. package/dist/index146.js.map +1 -1
  105. package/dist/index147.js +4 -3
  106. package/dist/index147.js.map +1 -1
  107. package/dist/index148.js +3 -46
  108. package/dist/index148.js.map +1 -1
  109. package/dist/index149.js +6 -205
  110. package/dist/index149.js.map +1 -1
  111. package/dist/index15.js +763 -624
  112. package/dist/index15.js.map +1 -1
  113. package/dist/index150.js +24 -22
  114. package/dist/index150.js.map +1 -1
  115. package/dist/index151.js +7 -24
  116. package/dist/index151.js.map +1 -1
  117. package/dist/index152.js +6 -399
  118. package/dist/index152.js.map +1 -1
  119. package/dist/index153.js +5 -46
  120. package/dist/index153.js.map +1 -1
  121. package/dist/index154.js +3 -605
  122. package/dist/index154.js.map +1 -1
  123. package/dist/index155.js +3 -5
  124. package/dist/index155.js.map +1 -1
  125. package/dist/index156.js +3 -67
  126. package/dist/index156.js.map +1 -1
  127. package/dist/index157.js +4 -2
  128. package/dist/index157.js.map +1 -1
  129. package/dist/index158.js +4 -363
  130. package/dist/index158.js.map +1 -1
  131. package/dist/index159.js +3 -261
  132. package/dist/index159.js.map +1 -1
  133. package/dist/index16.js +20 -22
  134. package/dist/index16.js.map +1 -1
  135. package/dist/index160.js +3 -60
  136. package/dist/index160.js.map +1 -1
  137. package/dist/index161.js +3 -46
  138. package/dist/index161.js.map +1 -1
  139. package/dist/index162.js +5 -169
  140. package/dist/index162.js.map +1 -1
  141. package/dist/index163.js +61 -102
  142. package/dist/index163.js.map +1 -1
  143. package/dist/index164.js +2 -25
  144. package/dist/index164.js.map +1 -1
  145. package/dist/index165.js +364 -8
  146. package/dist/index165.js.map +1 -1
  147. package/dist/index166.js +261 -4
  148. package/dist/index166.js.map +1 -1
  149. package/dist/index167.js +60 -5
  150. package/dist/index167.js.map +1 -1
  151. package/dist/index168.js +46 -4
  152. package/dist/index168.js.map +1 -1
  153. package/dist/index169.js +153 -450
  154. package/dist/index169.js.map +1 -1
  155. package/dist/index17.js +17 -17
  156. package/dist/index17.js.map +1 -1
  157. package/dist/index170.js +102 -178
  158. package/dist/index170.js.map +1 -1
  159. package/dist/index171.js +24 -107
  160. package/dist/index171.js.map +1 -1
  161. package/dist/index172.js +8 -263
  162. package/dist/index172.js.map +1 -1
  163. package/dist/index173.js +4 -9
  164. package/dist/index173.js.map +1 -1
  165. package/dist/index174.js +5 -42
  166. package/dist/index174.js.map +1 -1
  167. package/dist/index175.js +3 -3
  168. package/dist/index175.js.map +1 -1
  169. package/dist/index176.js +459 -51
  170. package/dist/index176.js.map +1 -1
  171. package/dist/index177.js +185 -8
  172. package/dist/index177.js.map +1 -1
  173. package/dist/index178.js +102 -61
  174. package/dist/index178.js.map +1 -1
  175. package/dist/index179.js +260 -17
  176. package/dist/index179.js.map +1 -1
  177. package/dist/index18.js +411 -341
  178. package/dist/index18.js.map +1 -1
  179. package/dist/index180.js +9 -16
  180. package/dist/index180.js.map +1 -1
  181. package/dist/index181.js +41 -4
  182. package/dist/index181.js.map +1 -1
  183. package/dist/index182.js +4 -5
  184. package/dist/index182.js.map +1 -1
  185. package/dist/index183.js +24 -6
  186. package/dist/index183.js.map +1 -1
  187. package/dist/index184.js +29 -5
  188. package/dist/index184.js.map +1 -1
  189. package/dist/index185.js +5 -8
  190. package/dist/index185.js.map +1 -1
  191. package/dist/index186.js +67 -17
  192. package/dist/index186.js.map +1 -1
  193. package/dist/index187.js +180 -5
  194. package/dist/index187.js.map +1 -1
  195. package/dist/index188.js +46 -5
  196. package/dist/index188.js.map +1 -1
  197. package/dist/index189.js +58 -13
  198. package/dist/index189.js.map +1 -1
  199. package/dist/index19.js +626 -660
  200. package/dist/index19.js.map +1 -1
  201. package/dist/index190.js +8 -10
  202. package/dist/index190.js.map +1 -1
  203. package/dist/index191.js +66 -14
  204. package/dist/index191.js.map +1 -1
  205. package/dist/index192.js +19 -14
  206. package/dist/index192.js.map +1 -1
  207. package/dist/index193.js +16 -5
  208. package/dist/index193.js.map +1 -1
  209. package/dist/index194.js +5 -6
  210. package/dist/index194.js.map +1 -1
  211. package/dist/index195.js +5 -7
  212. package/dist/index195.js.map +1 -1
  213. package/dist/index196.js +6 -6
  214. package/dist/index196.js.map +1 -1
  215. package/dist/index197.js +4 -9
  216. package/dist/index197.js.map +1 -1
  217. package/dist/index198.js +7 -5
  218. package/dist/index198.js.map +1 -1
  219. package/dist/index199.js +17 -5
  220. package/dist/index199.js.map +1 -1
  221. package/dist/index20.js +442 -634
  222. package/dist/index20.js.map +1 -1
  223. package/dist/index200.js +5 -9
  224. package/dist/index200.js.map +1 -1
  225. package/dist/index201.js +5 -5
  226. package/dist/index201.js.map +1 -1
  227. package/dist/index202.js +13 -5
  228. package/dist/index202.js.map +1 -1
  229. package/dist/index203.js +10 -4
  230. package/dist/index203.js.map +1 -1
  231. package/dist/index204.js +14 -11
  232. package/dist/index204.js.map +1 -1
  233. package/dist/index205.js +14 -10
  234. package/dist/index205.js.map +1 -1
  235. package/dist/index206.js +5 -10
  236. package/dist/index206.js.map +1 -1
  237. package/dist/index207.js +6 -11
  238. package/dist/index207.js.map +1 -1
  239. package/dist/index208.js +7 -11
  240. package/dist/index208.js.map +1 -1
  241. package/dist/index209.js +6 -10
  242. package/dist/index209.js.map +1 -1
  243. package/dist/index21.js +254 -200
  244. package/dist/index21.js.map +1 -1
  245. package/dist/index210.js +9 -7
  246. package/dist/index210.js.map +1 -1
  247. package/dist/index211.js +5 -6
  248. package/dist/index211.js.map +1 -1
  249. package/dist/index212.js +5 -5
  250. package/dist/index212.js.map +1 -1
  251. package/dist/index213.js +9 -6
  252. package/dist/index213.js.map +1 -1
  253. package/dist/index214.js +5 -7
  254. package/dist/index214.js.map +1 -1
  255. package/dist/index215.js +5 -6
  256. package/dist/index215.js.map +1 -1
  257. package/dist/index216.js +4 -55
  258. package/dist/index216.js.map +1 -1
  259. package/dist/index217.js +11 -16
  260. package/dist/index217.js.map +1 -1
  261. package/dist/index218.js +10 -7
  262. package/dist/index218.js.map +1 -1
  263. package/dist/index219.js +10 -10
  264. package/dist/index219.js.map +1 -1
  265. package/dist/index22.js +1 -1
  266. package/dist/index22.js.map +1 -1
  267. package/dist/index220.js +11 -10
  268. package/dist/index220.js.map +1 -1
  269. package/dist/index221.js +11 -21
  270. package/dist/index221.js.map +1 -1
  271. package/dist/index222.js +10 -10
  272. package/dist/index222.js.map +1 -1
  273. package/dist/index223.js +7 -9
  274. package/dist/index223.js.map +1 -1
  275. package/dist/index224.js +6 -9
  276. package/dist/index224.js.map +1 -1
  277. package/dist/index225.js +5 -4
  278. package/dist/index225.js.map +1 -1
  279. package/dist/index226.js +6 -5
  280. package/dist/index226.js.map +1 -1
  281. package/dist/index227.js +7 -16
  282. package/dist/index227.js.map +1 -1
  283. package/dist/index228.js +6 -9
  284. package/dist/index228.js.map +1 -1
  285. package/dist/index229.js +54 -17
  286. package/dist/index229.js.map +1 -1
  287. package/dist/index23.js +27 -34
  288. package/dist/index23.js.map +1 -1
  289. package/dist/index230.js +16 -15
  290. package/dist/index230.js.map +1 -1
  291. package/dist/index231.js +7 -12
  292. package/dist/index231.js.map +1 -1
  293. package/dist/index232.js +9 -28
  294. package/dist/index232.js.map +1 -1
  295. package/dist/index233.js +9 -11
  296. package/dist/index233.js.map +1 -1
  297. package/dist/index234.js +20 -24
  298. package/dist/index234.js.map +1 -1
  299. package/dist/index235.js +10 -5
  300. package/dist/index235.js.map +1 -1
  301. package/dist/index236.js +9 -24
  302. package/dist/index236.js.map +1 -1
  303. package/dist/index237.js +10 -29
  304. package/dist/index237.js.map +1 -1
  305. package/dist/index238.js +5 -5
  306. package/dist/index238.js.map +1 -1
  307. package/dist/index239.js +5 -67
  308. package/dist/index239.js.map +1 -1
  309. package/dist/index24.js +219 -222
  310. package/dist/index24.js.map +1 -1
  311. package/dist/index240.js +15 -179
  312. package/dist/index240.js.map +1 -1
  313. package/dist/index241.js +9 -46
  314. package/dist/index241.js.map +1 -1
  315. package/dist/index242.js +18 -13
  316. package/dist/index242.js.map +1 -1
  317. package/dist/index243.js +15 -154
  318. package/dist/index243.js.map +1 -1
  319. package/dist/index244.js +12 -30
  320. package/dist/index244.js.map +1 -1
  321. package/dist/index245.js +29 -9
  322. package/dist/index245.js.map +1 -1
  323. package/dist/index246.js +11 -46
  324. package/dist/index246.js.map +1 -1
  325. package/dist/index247.js +25 -11
  326. package/dist/index247.js.map +1 -1
  327. package/dist/index248.js +5 -44
  328. package/dist/index248.js.map +1 -1
  329. package/dist/index249.js +12 -94
  330. package/dist/index249.js.map +1 -1
  331. package/dist/index25.js +46 -50
  332. package/dist/index25.js.map +1 -1
  333. package/dist/index250.js +143 -75
  334. package/dist/index250.js.map +1 -1
  335. package/dist/index251.js +27 -102
  336. package/dist/index251.js.map +1 -1
  337. package/dist/index252.js +9 -52
  338. package/dist/index252.js.map +1 -1
  339. package/dist/index253.js +46 -10
  340. package/dist/index253.js.map +1 -1
  341. package/dist/index254.js +10 -36
  342. package/dist/index254.js.map +1 -1
  343. package/dist/index255.js +44 -8
  344. package/dist/index255.js.map +1 -1
  345. package/dist/index256.js +86 -107
  346. package/dist/index256.js.map +1 -1
  347. package/dist/index257.js +86 -17
  348. package/dist/index257.js.map +1 -1
  349. package/dist/index258.js +104 -14
  350. package/dist/index258.js.map +1 -1
  351. package/dist/index259.js +52 -3
  352. package/dist/index259.js.map +1 -1
  353. package/dist/index260.js +10 -35
  354. package/dist/index260.js.map +1 -1
  355. package/dist/index261.js +36 -19
  356. package/dist/index261.js.map +1 -1
  357. package/dist/index262.js +8 -9
  358. package/dist/index262.js.map +1 -1
  359. package/dist/index263.js +3 -8
  360. package/dist/index263.js.map +1 -1
  361. package/dist/index264.js +9 -19
  362. package/dist/index264.js.map +1 -1
  363. package/dist/index265.js +113 -25
  364. package/dist/index265.js.map +1 -1
  365. package/dist/index266.js +17 -16
  366. package/dist/index266.js.map +1 -1
  367. package/dist/index267.js +15 -4
  368. package/dist/index267.js.map +1 -1
  369. package/dist/index268.js +36 -18
  370. package/dist/index268.js.map +1 -1
  371. package/dist/index269.js +20 -12
  372. package/dist/index269.js.map +1 -1
  373. package/dist/index270.js +9 -5
  374. package/dist/index270.js.map +1 -1
  375. package/dist/index271.js +20 -3
  376. package/dist/index271.js.map +1 -1
  377. package/dist/index272.js +26 -21
  378. package/dist/index272.js.map +1 -1
  379. package/dist/index273.js +15 -111
  380. package/dist/index273.js.map +1 -1
  381. package/dist/index274.js +5 -16
  382. package/dist/index274.js.map +1 -1
  383. package/dist/index275.js +3 -525
  384. package/dist/index275.js.map +1 -1
  385. package/dist/index276.js +23 -127
  386. package/dist/index276.js.map +1 -1
  387. package/dist/index277.js +108 -129
  388. package/dist/index277.js.map +1 -1
  389. package/dist/index278.js +15 -20
  390. package/dist/index278.js.map +1 -1
  391. package/dist/index279.js +524 -5
  392. package/dist/index279.js.map +1 -1
  393. package/dist/index28.js +3 -37
  394. package/dist/index28.js.map +1 -1
  395. package/dist/index280.js +127 -5
  396. package/dist/index280.js.map +1 -1
  397. package/dist/index281.js +134 -4
  398. package/dist/index281.js.map +1 -1
  399. package/dist/index282.js +4 -15
  400. package/dist/index282.js.map +1 -1
  401. package/dist/index283.js +19 -9
  402. package/dist/index283.js.map +1 -1
  403. package/dist/index284.js +12 -5
  404. package/dist/index284.js.map +1 -1
  405. package/dist/index285.js +20 -4
  406. package/dist/index285.js.map +1 -1
  407. package/dist/index286.js +67 -544
  408. package/dist/index286.js.map +1 -1
  409. package/dist/index287.js +8 -46
  410. package/dist/index287.js.map +1 -1
  411. package/dist/index288.js +14 -18
  412. package/dist/index288.js.map +1 -1
  413. package/dist/index289.js +66 -7
  414. package/dist/index289.js.map +1 -1
  415. package/dist/index29.js +37 -3
  416. package/dist/index29.js.map +1 -1
  417. package/dist/index290.js +64 -8
  418. package/dist/index290.js.map +1 -1
  419. package/dist/index291.js +5 -7
  420. package/dist/index291.js.map +1 -1
  421. package/dist/index292.js +5 -8
  422. package/dist/index292.js.map +1 -1
  423. package/dist/index293.js +4 -13
  424. package/dist/index293.js.map +1 -1
  425. package/dist/index294.js +15 -9
  426. package/dist/index294.js.map +1 -1
  427. package/dist/index295.js +8 -13
  428. package/dist/index295.js.map +1 -1
  429. package/dist/index296.js +6 -69
  430. package/dist/index296.js.map +1 -1
  431. package/dist/index297.js +5 -9
  432. package/dist/index297.js.map +1 -1
  433. package/dist/index298.js +545 -13
  434. package/dist/index298.js.map +1 -1
  435. package/dist/index299.js +45 -64
  436. package/dist/index299.js.map +1 -1
  437. package/dist/index3.js.map +1 -1
  438. package/dist/index30.js +3 -125
  439. package/dist/index30.js.map +1 -1
  440. package/dist/index300.js +15 -62
  441. package/dist/index300.js.map +1 -1
  442. package/dist/index301.js +6 -4
  443. package/dist/index301.js.map +1 -1
  444. package/dist/index302.js +9 -56
  445. package/dist/index302.js.map +1 -1
  446. package/dist/index303.js +8 -68
  447. package/dist/index303.js.map +1 -1
  448. package/dist/index304.js +9 -31
  449. package/dist/index304.js.map +1 -1
  450. package/dist/index305.js +13 -9
  451. package/dist/index305.js.map +1 -1
  452. package/dist/index306.js +10 -153
  453. package/dist/index306.js.map +1 -1
  454. package/dist/index307.js +14 -108
  455. package/dist/index307.js.map +1 -1
  456. package/dist/index31.js +120 -227
  457. package/dist/index31.js.map +1 -1
  458. package/dist/index310.js +4 -15
  459. package/dist/index310.js.map +1 -1
  460. package/dist/index311.js +55 -28
  461. package/dist/index311.js.map +1 -1
  462. package/dist/index312.js +68 -13
  463. package/dist/index312.js.map +1 -1
  464. package/dist/index313.js +31 -7
  465. package/dist/index313.js.map +1 -1
  466. package/dist/index314.js +9 -23
  467. package/dist/index314.js.map +1 -1
  468. package/dist/index315.js +152 -12
  469. package/dist/index315.js.map +1 -1
  470. package/dist/index316.js +107 -27
  471. package/dist/index316.js.map +1 -1
  472. package/dist/index317.js +22 -4
  473. package/dist/index317.js.map +1 -1
  474. package/dist/index318.js +16 -0
  475. package/dist/index318.js.map +1 -0
  476. package/dist/index319.js +31 -0
  477. package/dist/index319.js.map +1 -0
  478. package/dist/index32.js +229 -21
  479. package/dist/index32.js.map +1 -1
  480. package/dist/index320.js +8 -0
  481. package/dist/index320.js.map +1 -0
  482. package/dist/index321.js +19 -0
  483. package/dist/index321.js.map +1 -0
  484. package/dist/index322.js +32 -0
  485. package/dist/index322.js.map +1 -0
  486. package/dist/index323.js +16 -0
  487. package/dist/index323.js.map +1 -0
  488. package/dist/index324.js +10 -0
  489. package/dist/index324.js.map +1 -0
  490. package/dist/index33.js +23 -50
  491. package/dist/index33.js.map +1 -1
  492. package/dist/index34.js +50 -2640
  493. package/dist/index34.js.map +1 -1
  494. package/dist/index35.js +2598 -351
  495. package/dist/index35.js.map +1 -1
  496. package/dist/index36.js +375 -214
  497. package/dist/index36.js.map +1 -1
  498. package/dist/index37.js +230 -19
  499. package/dist/index37.js.map +1 -1
  500. package/dist/index38.js +18 -138
  501. package/dist/index38.js.map +1 -1
  502. package/dist/index39.js +113 -170
  503. package/dist/index39.js.map +1 -1
  504. package/dist/index4.js +17 -15
  505. package/dist/index4.js.map +1 -1
  506. package/dist/index40.js +209 -64
  507. package/dist/index40.js.map +1 -1
  508. package/dist/index41.js +86 -94
  509. package/dist/index41.js.map +1 -1
  510. package/dist/index42.js +118 -5
  511. package/dist/index42.js.map +1 -1
  512. package/dist/index43.js +5 -843
  513. package/dist/index43.js.map +1 -1
  514. package/dist/index44.js +832 -54
  515. package/dist/index44.js.map +1 -1
  516. package/dist/index45.js +57 -8
  517. package/dist/index45.js.map +1 -1
  518. package/dist/index46.js +8 -2
  519. package/dist/index46.js.map +1 -1
  520. package/dist/index47.js +2 -24
  521. package/dist/index47.js.map +1 -1
  522. package/dist/index48.js +11 -233
  523. package/dist/index48.js.map +1 -1
  524. package/dist/index49.js +19 -205
  525. package/dist/index49.js.map +1 -1
  526. package/dist/index5.js +34 -34
  527. package/dist/index5.js.map +1 -1
  528. package/dist/index50.js +7 -3
  529. package/dist/index50.js.map +1 -1
  530. package/dist/index51.js +2 -7
  531. package/dist/index51.js.map +1 -1
  532. package/dist/index52.js +22 -46
  533. package/dist/index52.js.map +1 -1
  534. package/dist/index53.js +232 -25
  535. package/dist/index53.js.map +1 -1
  536. package/dist/index54.js +203 -49
  537. package/dist/index54.js.map +1 -1
  538. package/dist/index55.js +3 -7
  539. package/dist/index55.js.map +1 -1
  540. package/dist/index56.js +6 -14
  541. package/dist/index56.js.map +1 -1
  542. package/dist/index57.js +43 -129
  543. package/dist/index57.js.map +1 -1
  544. package/dist/index58.js +26 -10
  545. package/dist/index58.js.map +1 -1
  546. package/dist/index59.js +48 -214
  547. package/dist/index59.js.map +1 -1
  548. package/dist/index6.js +154 -120
  549. package/dist/index6.js.map +1 -1
  550. package/dist/index60.js +8 -13
  551. package/dist/index60.js.map +1 -1
  552. package/dist/index61.js +14 -33
  553. package/dist/index61.js.map +1 -1
  554. package/dist/index62.js +128 -41
  555. package/dist/index62.js.map +1 -1
  556. package/dist/index63.js +10 -7
  557. package/dist/index63.js.map +1 -1
  558. package/dist/index64.js +213 -46
  559. package/dist/index64.js.map +1 -1
  560. package/dist/index65.js +13 -4
  561. package/dist/index65.js.map +1 -1
  562. package/dist/index66.js +33 -5
  563. package/dist/index66.js.map +1 -1
  564. package/dist/index67.js +46 -27
  565. package/dist/index67.js.map +1 -1
  566. package/dist/index68.js +8 -50
  567. package/dist/index68.js.map +1 -1
  568. package/dist/index69.js +50 -9
  569. package/dist/index69.js.map +1 -1
  570. package/dist/index7.js +29 -24
  571. package/dist/index7.js.map +1 -1
  572. package/dist/index70.js +4 -12
  573. package/dist/index70.js.map +1 -1
  574. package/dist/index71.js +5 -53
  575. package/dist/index71.js.map +1 -1
  576. package/dist/index72.js +28 -6
  577. package/dist/index72.js.map +1 -1
  578. package/dist/index73.js +50 -8
  579. package/dist/index73.js.map +1 -1
  580. package/dist/index74.js +9 -6
  581. package/dist/index74.js.map +1 -1
  582. package/dist/index77.js +12 -52
  583. package/dist/index77.js.map +1 -1
  584. package/dist/index78.js +5 -4
  585. package/dist/index78.js.map +1 -1
  586. package/dist/index79.js +7 -4
  587. package/dist/index79.js.map +1 -1
  588. package/dist/index8.js +21 -24
  589. package/dist/index8.js.map +1 -1
  590. package/dist/index80.js +5 -15
  591. package/dist/index80.js.map +1 -1
  592. package/dist/index81.js +2 -6
  593. package/dist/index81.js.map +1 -1
  594. package/dist/index82.js +2 -8
  595. package/dist/index82.js.map +1 -1
  596. package/dist/index83.js +53 -16
  597. package/dist/index83.js.map +1 -1
  598. package/dist/index84.js +46 -4
  599. package/dist/index84.js.map +1 -1
  600. package/dist/index85.js +205 -4
  601. package/dist/index85.js.map +1 -1
  602. package/dist/index86.js +22 -6
  603. package/dist/index86.js.map +1 -1
  604. package/dist/index87.js +24 -5
  605. package/dist/index87.js.map +1 -1
  606. package/dist/index88.js +399 -4
  607. package/dist/index88.js.map +1 -1
  608. package/dist/index89.js +46 -4
  609. package/dist/index89.js.map +1 -1
  610. package/dist/index9.js +138 -187
  611. package/dist/index9.js.map +1 -1
  612. package/dist/index90.js +605 -6
  613. package/dist/index90.js.map +1 -1
  614. package/dist/index91.js +52 -25
  615. package/dist/index91.js.map +1 -1
  616. package/dist/index92.js +4 -6
  617. package/dist/index92.js.map +1 -1
  618. package/dist/index93.js +4 -4
  619. package/dist/index93.js.map +1 -1
  620. package/dist/index94.js +14 -5
  621. package/dist/index94.js.map +1 -1
  622. package/dist/index95.js +3 -3
  623. package/dist/index95.js.map +1 -1
  624. package/dist/index96.js +7 -4
  625. package/dist/index96.js.map +1 -1
  626. package/dist/index97.js +16 -5
  627. package/dist/index97.js.map +1 -1
  628. package/dist/index98.js +3 -3
  629. package/dist/index98.js.map +1 -1
  630. package/dist/index99.js +4 -8
  631. package/dist/index99.js.map +1 -1
  632. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index248.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js"],"sourcesContent":["import stripIddPrefix from './stripIddPrefix.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport Metadata from '../metadata.js';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants.js';\n\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Country.\r\n * @param {string} [defaultCountry] — Default country.\r\n * @param {string} [defaultCallingCode] Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCodeSource: string?, countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', null, 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', null, 'RU', null, metadata)\r\n */\nexport default function extractCountryCallingCode(number, country, defaultCountry, defaultCallingCode, metadata) {\n if (!number) {\n return {};\n }\n var isNumberWithIddPrefix;\n\n // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country || defaultCountry, defaultCallingCode, metadata);\n // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n isNumberWithIddPrefix = true;\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || defaultCountry || defaultCallingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n if (countryCallingCode) {\n return {\n countryCallingCodeSource: 'FROM_NUMBER_WITHOUT_PLUS_SIGN',\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n return {\n // No need to set it to `UNSPECIFIED`. It can be just `undefined`.\n // countryCallingCodeSource: 'UNSPECIFIED',\n number: number\n };\n }\n }\n\n // `number` can only be international at this point.\n\n // Fast abortion: country codes do not begin with a '0'\n if (number[1] === '0') {\n return {};\n }\n metadata = new Metadata(metadata);\n\n // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n var i = 2;\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCodeSource: isNumberWithIddPrefix ? 'FROM_NUMBER_WITH_IDD' : 'FROM_NUMBER_WITH_PLUS_SIGN',\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n i++;\n }\n return {};\n}\n\n// The possible values for the returned `countryCallingCodeSource` are:\n//\n// Copy-pasted from:\n// https://github.com/google/libphonenumber/blob/master/resources/phonenumber.proto\n//\n// // The source from which the country_code is derived. This is not set in the\n// // general parsing method, but in the method that parses and keeps raw_input.\n// // New fields could be added upon request.\n// enum CountryCodeSource {\n// // Default value returned if this is not set, because the phone number was\n// // created using parse, not parseAndKeepRawInput. hasCountryCodeSource will\n// // return false if this is the case.\n// UNSPECIFIED = 0;\n//\n// // The country_code is derived based on a phone number with a leading \"+\",\n// // e.g. the French number \"+33 1 42 68 53 00\".\n// FROM_NUMBER_WITH_PLUS_SIGN = 1;\n//\n// // The country_code is derived based on a phone number with a leading IDD,\n// // e.g. the French number \"011 33 1 42 68 53 00\", as it is dialled from US.\n// FROM_NUMBER_WITH_IDD = 5;\n//\n// // The country_code is derived based on a phone number without a leading\n// // \"+\", e.g. the French number \"33 1 42 68 53 00\" when defaultCountry is\n// // supplied as France.\n// FROM_NUMBER_WITHOUT_PLUS_SIGN = 10;\n//\n// // The country_code is derived NOT based on the phone number itself, but\n// // from the defaultCountry parameter provided in the parsing function by the\n// // clients. This happens mostly for numbers written in the national format\n// // (without country code). For example, this would be set when parsing the\n// // French number \"01 42 68 53 00\", when defaultCountry is supplied as\n// // France.\n// FROM_DEFAULT_COUNTRY = 20;\n// }\n//# sourceMappingURL=extractCountryCallingCode.js.map"],"names":["extractCountryCallingCode","number","country","defaultCountry","defaultCallingCode","metadata","isNumberWithIddPrefix","numberWithoutIDD","stripIddPrefix","_extractCountryCallin","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","countryCallingCode","shorterNumber","Metadata","i","MAX_LENGTH_COUNTRY_CODE","_countryCallingCode"],"mappings":";;;;AAwBe,SAASA,EAA0BC,GAAQC,GAASC,GAAgBC,GAAoBC,GAAU;AAC/G,MAAI,CAACJ;AACH,WAAO,CAAA;AAET,MAAIK;AASJ,MAAIL,EAAO,CAAC,MAAM,KAAK;AAGrB,QAAIM,IAAmBC,EAAeP,GAAQC,KAAWC,GAAgBC,GAAoBC,CAAQ;AAIrG,QAAIE,KAAoBA,MAAqBN;AAC3C,MAAAK,IAAwB,IACxBL,IAAS,MAAMM;AAAA,SACV;AAKL,UAAIL,KAAWC,KAAkBC,GAAoB;AACnD,YAAIK,IAAwBC,EAAgET,GAAQC,GAASC,GAAgBC,GAAoBC,CAAQ,GACvJM,IAAqBF,EAAsB,oBAC3CG,IAAgBH,EAAsB;AACxC,YAAIE;AACF,iBAAO;AAAA,YACL,0BAA0B;AAAA,YAC1B,oBAAoBA;AAAA,YACpB,QAAQC;AAAA,UACpB;AAAA,MAEM;AACA,aAAO;AAAA;AAAA;AAAA,QAGL,QAAQX;AAAA,MAChB;AAAA,IACI;AAAA,EACF;AAKA,MAAIA,EAAO,CAAC,MAAM;AAChB,WAAO,CAAA;AAET,EAAAI,IAAW,IAAIQ,EAASR,CAAQ;AAYhC,WADIS,IAAI,GACDA,IAAI,KAAKC,KAA2BD,KAAKb,EAAO,UAAQ;AAC7D,QAAIe,IAAsBf,EAAO,MAAM,GAAGa,CAAC;AAC3C,QAAIT,EAAS,eAAeW,CAAmB;AAC7C,aAAAX,EAAS,oBAAoBW,CAAmB,GACzC;AAAA,QACL,0BAA0BV,IAAwB,yBAAyB;AAAA,QAC3E,oBAAoBU;AAAA,QACpB,QAAQf,EAAO,MAAMa,CAAC;AAAA,MAC9B;AAEI,IAAAA;AAAA,EACF;AACA,SAAO,CAAA;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index248.js","sources":["../../../node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/index.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\n/**\n * Determines if two date ranges overlap.\n *\n * @since 9.2.2\n * @param rangeLeft - The first date range.\n * @param rangeRight - The second date range.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the ranges overlap, otherwise `false`.\n * @group Utilities\n */\nexport function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {\n return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||\n rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||\n rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||\n rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));\n}\n"],"names":["rangeOverlaps","rangeLeft","rangeRight","dateLib","defaultDateLib","rangeIncludesDate"],"mappings":";;AAYO,SAASA,EAAcC,GAAWC,GAAYC,IAAUC,GAAgB;AAC3E,SAAQC,EAAkBJ,GAAWC,EAAW,MAAM,IAAOC,CAAO,KAChEE,EAAkBJ,GAAWC,EAAW,IAAI,IAAOC,CAAO,KAC1DE,EAAkBH,GAAYD,EAAU,MAAM,IAAOE,CAAO,KAC5DE,EAAkBH,GAAYD,EAAU,IAAI,IAAOE,CAAO;AAClE;","x_google_ignoreList":[0]}
package/dist/index249.js CHANGED
@@ -1,99 +1,17 @@
1
- import N from "./index259.js";
2
- import g from "./index164.js";
3
- import m, { getCountryCallingCode as s } from "./index169.js";
4
- import h from "./index262.js";
5
- import { formatRFC3966 as I } from "./index255.js";
6
- var l = {
7
- formatExtension: function(t, r, e) {
8
- return "".concat(t).concat(e.ext()).concat(r);
9
- }
10
- };
11
- function O(n, t, r, e) {
12
- if (r ? r = E({}, l, r) : r = l, e = new m(e), n.country && n.country !== "001") {
13
- if (!e.hasCountry(n.country))
14
- throw new Error("Unknown country: ".concat(n.country));
15
- e.selectNumberingPlan(n.country);
16
- } else if (n.countryCallingCode)
17
- e.selectNumberingPlan(n.countryCallingCode);
18
- else return n.phone || "";
19
- var o = e.countryCallingCode(), a = r.v2 ? n.nationalNumber : n.phone, c;
20
- switch (t) {
21
- case "NATIONAL":
22
- return a ? (c = f(a, n.carrierCode, "NATIONAL", e, r), u(c, n.ext, e, r.formatExtension)) : "";
23
- case "INTERNATIONAL":
24
- return a ? (c = f(a, null, "INTERNATIONAL", e, r), c = "+".concat(o, " ").concat(c), u(c, n.ext, e, r.formatExtension)) : "+".concat(o);
25
- case "E.164":
26
- return "+".concat(o).concat(a);
27
- case "RFC3966":
28
- return I({
29
- number: "+".concat(o).concat(a),
30
- ext: n.ext
31
- });
32
- // For reference, here's Google's IDD formatter:
33
- // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
34
- // Not saying that this IDD formatter replicates it 1:1, but it seems to work.
35
- // Who would even need to format phone numbers in IDD format anyway?
36
- case "IDD":
37
- if (!r.fromCountry)
38
- return;
39
- var i = A(a, n.carrierCode, o, r.fromCountry, e);
40
- return i ? u(i, n.ext, e, r.formatExtension) : void 0;
41
- default:
42
- throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t, '"'));
43
- }
44
- }
45
- function f(n, t, r, e, o) {
46
- var a = x(e.formats(), n);
47
- return a ? g(n, a, {
48
- useInternationalFormat: r === "INTERNATIONAL",
49
- withNationalPrefix: !(a.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && o && o.nationalPrefix === !1),
50
- carrierCode: t,
51
- metadata: e
52
- }) : n;
53
- }
54
- function x(n, t) {
55
- return v(n, function(r) {
56
- if (r.leadingDigitsPatterns().length > 0) {
57
- var e = r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length - 1];
58
- if (t.search(e) !== 0)
59
- return !1;
60
- }
61
- return N(t, r.pattern());
62
- });
63
- }
64
- function u(n, t, r, e) {
65
- return t ? e(n, t, r) : n;
66
- }
67
- function A(n, t, r, e, o) {
68
- var a = s(e, o.metadata);
69
- if (a === r) {
70
- var c = f(n, t, "NATIONAL", o);
71
- return r === "1" ? r + " " + c : c;
72
- }
73
- var i = h(e, void 0, o.metadata);
74
- if (i)
75
- return "".concat(i, " ").concat(r, " ").concat(f(n, null, "INTERNATIONAL", o));
76
- }
77
- function E() {
78
- for (var n = 1, t = arguments.length, r = new Array(t), e = 0; e < t; e++)
79
- r[e] = arguments[e];
80
- for (; n < r.length; ) {
81
- if (r[n])
82
- for (var o in r[n])
83
- r[0][o] = r[n][o];
84
- n++;
85
- }
86
- return r[0];
1
+ import h from "./index176.js";
2
+ function L(i, r, u) {
3
+ return s(i, r, void 0, u);
87
4
  }
88
- function v(n, t) {
89
- for (var r = 0; r < n.length; ) {
90
- if (t(n[r]))
91
- return n[r];
92
- r++;
93
- }
5
+ function s(i, r, u, e) {
6
+ r && (e = new h(e.metadata), e.selectNumberingPlan(r));
7
+ var f = e.type(u), n = f && f.possibleLengths() || e.possibleLengths();
8
+ if (!n)
9
+ return "IS_POSSIBLE";
10
+ var t = i.length, l = n[0];
11
+ return l === t ? "IS_POSSIBLE" : l > t ? "TOO_SHORT" : n[n.length - 1] < t ? "TOO_LONG" : n.indexOf(t, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
94
12
  }
95
13
  export {
96
- x as chooseFormatForNumber,
97
- O as default
14
+ s as checkNumberLengthForType,
15
+ L as default
98
16
  };
99
17
  //# sourceMappingURL=index249.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index249.js","sources":["../../../node_modules/libphonenumber-js/es6/format.js"],"sourcesContent":["// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport matchesEntirely from './helpers/matchesEntirely.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nimport Metadata, { getCountryCallingCode } from './metadata.js';\nimport getIddPrefix from './helpers/getIddPrefix.js';\nimport { formatRFC3966 } from './helpers/RFC3966.js';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n }\n};\n\n/**\r\n * Formats a phone number.\r\n *\r\n * format(phoneNumberInstance, 'INTERNATIONAL', { ..., v2: true }, metadata)\r\n * format(phoneNumberInstance, 'NATIONAL', { ..., v2: true }, metadata)\r\n *\r\n * format({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', { ... }, metadata)\r\n * format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', undefined, metadata)\r\n *\r\n * @param {object|PhoneNumber} input — If `options.v2: true` flag is passed, the `input` should be a `PhoneNumber` instance. Otherwise, it should be an object of shape `{ phone: '...', country: '...' }`.\r\n * @param {string} format\r\n * @param {object} [options]\r\n * @param {object} metadata\r\n * @return {string}\r\n */\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n // Using ES6 \"rest spread\" syntax here didn't work with `babel`/`istanbul`\n // for some weird reason: this line of code would cause the code coverage\n // to show as not 100%. That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // options = { ...DEFAULT_OPTIONS, ...options }\n //\n options = merge({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n metadata = new Metadata(metadata);\n\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance.\n // Also, according to the `PhoneNumber` class source code, `country` can't be \"001\".\n // It means that normally `input.country` or `input.countryCallingCode` is supposed\n // to be present because either of the two is always required to exist in a `PhoneNumber` instance.\n // This means that realistically, it's gonna step into either the first `if`\n // or the following `else if`, and normally it won't even reach the legacy-compatibility\n // `else return input.phone || ''` part.\n // So normally, it won't ever return an empty string here.\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n metadata.selectNumberingPlan(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone;\n\n // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n var number;\n switch (format) {\n case 'NATIONAL':\n // Normally, the `input` object is supposed to be a `PhoneNumber` class instance,\n // and a `PhoneNumber` class instance is always required to have a `nationalNumber`.\n // This means that the `if (!nationalNumber)` below is just for legacy-compatibility\n // and it normally can't really happen, so normally it won't ever return an empty string here.\n if (!nationalNumber) {\n return '';\n }\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n case 'IDD':\n // If the required `fromCountry` parameter is not passed, it will return `undefined`.\n if (!options.fromCountry) {\n return;\n // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n // If the country of the phone number doesn't support IDD calling, it will return `undefined`.\n if (!formattedNumber) {\n return;\n }\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n if (!format) {\n return number;\n }\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\nexport function chooseFormatForNumber(availableFormats, nationalNumber) {\n // Using a `for ... of` loop here didn't work with `babel`/`istanbul`:\n // for some weird reason, it showed code coverage less than 100%.\n // That's because `babel`/`istanbul`, for some weird reason,\n // apparently doesn't know how to properly exclude Babel polyfills from code coverage.\n //\n // for (const format of availableFormats) { ... }\n //\n return pickFirstMatchingElement(availableFormats, function (format) {\n // Validate leading digits.\n // The test case for \"else path\" could be found by searching for\n // \"format.leadingDigitsPatterns().length === 0\".\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1];\n // If leading digits don't match then move on to the next phone number format\n if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {\n return false;\n }\n }\n // Check that the national number matches the phone number format regular expression\n return matchesEntirely(nationalNumber, format.pattern());\n });\n}\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);\n // When calling within the same country calling code.\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata);\n // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n }\n // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n return formattedNumber;\n }\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\nfunction merge() {\n var i = 1;\n for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {\n objects[_key] = arguments[_key];\n }\n while (i < objects.length) {\n if (objects[i]) {\n for (var key in objects[i]) {\n objects[0][key] = objects[i][key];\n }\n }\n i++;\n }\n return objects[0];\n}\nfunction pickFirstMatchingElement(elements, testFunction) {\n var i = 0;\n while (i < elements.length) {\n if (testFunction(elements[i])) {\n return elements[i];\n }\n i++;\n }\n}\n//# sourceMappingURL=format.js.map"],"names":["DEFAULT_OPTIONS","formattedNumber","extension","metadata","formatNumber","input","format","options","merge","Metadata","countryCallingCode","nationalNumber","number","formatNationalNumber","addExtension","formatRFC3966","formatIDD","carrierCode","formatAs","chooseFormatForNumber","formatNationalNumberUsingFormat","availableFormats","pickFirstMatchingElement","lastLeadingDigitsPattern","matchesEntirely","ext","formatExtension","fromCountry","fromCountryCallingCode","getCountryCallingCode","iddPrefix","getIddPrefix","i","_len","objects","_key","key","elements","testFunction"],"mappings":";;;;;AAUA,IAAIA,IAAkB;AAAA,EACpB,iBAAiB,SAAyBC,GAAiBC,GAAWC,GAAU;AAC9E,WAAO,GAAG,OAAOF,CAAe,EAAE,OAAOE,EAAS,IAAG,CAAE,EAAE,OAAOD,CAAS;AAAA,EAC3E;AACF;AAiBe,SAASE,EAAaC,GAAOC,GAAQC,GAASJ,GAAU;AAwBrE,MAtBII,IAQFA,IAAUC,EAAM,IAAIR,GAAiBO,CAAO,IAE5CA,IAAUP,GAEZG,IAAW,IAAIM,EAASN,CAAQ,GAU5BE,EAAM,WAAWA,EAAM,YAAY,OAAO;AAE5C,QAAI,CAACF,EAAS,WAAWE,EAAM,OAAO;AACpC,YAAM,IAAI,MAAM,oBAAoB,OAAOA,EAAM,OAAO,CAAC;AAE3D,IAAAF,EAAS,oBAAoBE,EAAM,OAAO;AAAA,EAC5C,WAAWA,EAAM;AACf,IAAAF,EAAS,oBAAoBE,EAAM,kBAAkB;AAAA,MAChD,QAAOA,EAAM,SAAS;AAC7B,MAAIK,IAAqBP,EAAS,mBAAkB,GAChDQ,IAAiBJ,EAAQ,KAAKF,EAAM,iBA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QAAAE,EAAQ,CAAC,EAAEE,CAAG,IAAIF,EAAQF,CAAC,EAAEI,CAAG;AAGpC,IAAAJ;AAAA,EACF;AACA,SAAOE,EAAQ,CAAC;AAClB;AACA,SAASZ,EAAyBe,GAAUC,GAAc;AAExD,WADIN,IAAI,GACDA,IAAIK,EAAS,UAAQ;AAC1B,QAAIC,EAAaD,EAASL,CAAC,CAAC;AAC1B,aAAOK,EAASL,CAAC;AAEnB,IAAAA;AAAA,EACF;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index249.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport mergeArrays from './mergeArrays.js';\nexport default function checkNumberLength(nationalNumber, country, metadata) {\n return checkNumberLengthForType(nationalNumber, country, undefined, metadata);\n}\n\n// Checks whether a number is possible for a certain `country` based on the number length.\n//\n// This function is not supported by metadata generated with ancient versions of\n// `libphonenumber-js` (before version `1.0.18`) which didn't include \"possible lengths\".\n//\n// There was also a known issue with `checkNumberLength()` function:\n// if a number is possible only in a certain `country` among several `countries`\n// that share the same \"country calling code\", that function would check\n// the possibility of the phone number only in the \"main\" `country` for the \"country calling code\"\n// and would not check if it's actually be possible in the speciifc `country`.\n//\n// For example, \"+1310xxxx\" numbers are valid in Canada.\n// However, they are not possible in the US due to being too short.\n// Since Canada and the US share the same country calling code — \"+1\" —\n// `checkNumberLength()` function used to return not \"IS_POSSIBLE\" for \"+1310xxxx\" numbers.\n//\n// In such cases, when using \"/max\" metadata, `isValid()` could output `true`\n// but at the same time `isPossible()` could output `false`, which was contradictory.\n//\n// See https://issuetracker.google.com/issues/335892662 for the discusson in Google's issues.\n//\n// The solution suggested by Google was implemented: an optional `country` argument\n// was added to `checkNumberLength()` function. If present, that `country` will be used\n// to check phone number length for that specific `country` rather than the \"main\" country\n// for the shared \"country calling code\".\n//\nexport function checkNumberLengthForType(nationalNumber, country, type, metadata) {\n // If the exact `country` is specified, it's no necessarily already selected in `metadata`.\n // Most likely, in cases when there're multiple countries corresponding to the same\n // \"country calling code\", the \"main\" country for that \"country calling code\" will be selected.\n if (country) {\n metadata = new Metadata(metadata.metadata);\n metadata.selectNumberingPlan(country);\n }\n var type_info = metadata.type(type);\n\n // There should always be \"<possiblePengths/>\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"<possiblePengths/>\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();\n // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, country, 'MOBILE', metadata);\n }\n var mobile_type = metadata.type('MOBILE');\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());\n // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n }\n // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n var actual_length = nationalNumber.length;\n\n // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n }\n\n // We skip the first element since we've already checked it.\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map"],"names":["checkNumberLength","nationalNumber","country","metadata","checkNumberLengthForType","type","Metadata","type_info","possible_lengths","actual_length","minimum_length"],"mappings":";AAEe,SAASA,EAAkBC,GAAgBC,GAASC,GAAU;AAC3E,SAAOC,EAAyBH,GAAgBC,GAAS,QAAWC,CAAQ;AAC9E;AA4BO,SAASC,EAAyBH,GAAgBC,GAASG,GAAMF,GAAU;AAIhF,EAAID,MACFC,IAAW,IAAIG,EAASH,EAAS,QAAQ,GACzCA,EAAS,oBAAoBD,CAAO;AAEtC,MAAIK,IAAYJ,EAAS,KAAKE,CAAI,GAS9BG,IAAmBD,KAAaA,EAAU,gBAAe,KAAMJ,EAAS,gBAAe;AAI3F,MAAI,CAACK;AACH,WAAO;AAiCT,MAAIC,IAAgBR,EAAe,QAU/BS,IAAiBF,EAAiB,CAAC;AACvC,SAAIE,MAAmBD,IACd,gBAELC,IAAiBD,IACZ,cAELD,EAAiBA,EAAiB,SAAS,CAAC,IAAIC,IAC3C,aAIFD,EAAiB,QAAQC,GAAe,CAAC,KAAK,IAAI,gBAAgB;AAC3E;","x_google_ignoreList":[0]}
package/dist/index25.js CHANGED
@@ -1,12 +1,17 @@
1
- import { j as e } from "./index29.js";
1
+ import { j as e } from "./index30.js";
2
2
  import { useState as g, useMemo as A, useEffect as k } from "react";
3
3
  import { Loader2 as S } from "lucide-react";
4
4
  import { cn as w } from "./index2.js";
5
- const D = [
6
- { value: "off", label: "Off" },
7
- { value: "daily", label: "Daily" },
8
- { value: "weekly", label: "Weekly" }
9
- ], f = (r) => {
5
+ const D = [{
6
+ value: "off",
7
+ label: "Off"
8
+ }, {
9
+ value: "daily",
10
+ label: "Daily"
11
+ }, {
12
+ value: "weekly",
13
+ label: "Weekly"
14
+ }], f = (r) => {
10
15
  const o = r?.digestFrequency, s = o === "off" || o === "daily" || o === "weekly" ? o : "weekly", p = Array.isArray(r?.topicPreferences) ? r.topicPreferences.map((i) => ({
11
16
  topic: typeof i.topic == "string" ? i.topic.trim() : "",
12
17
  inApp: i.inApp === !0,
@@ -16,7 +21,9 @@ const D = [
16
21
  return {
17
22
  digestFrequency: s,
18
23
  topicPreferences: p,
19
- ...typeof r?.lastDigestSentAt == "string" ? { lastDigestSentAt: r.lastDigestSentAt } : {}
24
+ ...typeof r?.lastDigestSentAt == "string" ? {
25
+ lastDigestSentAt: r.lastDigestSentAt
26
+ } : {}
20
27
  };
21
28
  }, T = (r) => {
22
29
  if (!Array.isArray(r)) return [];
@@ -53,9 +60,10 @@ function z({
53
60
  className: r,
54
61
  topics: o
55
62
  }) {
56
- const [s, p] = g(!0), [i, d] = g(!1), [j, u] = g(null), [m, h] = g(
57
- () => f({ digestFrequency: "weekly", topicPreferences: [] })
58
- ), a = A(() => T(o), [o]), P = async () => {
63
+ const [s, p] = g(!0), [i, d] = g(!1), [j, u] = g(null), [m, h] = g(() => f({
64
+ digestFrequency: "weekly",
65
+ topicPreferences: []
66
+ })), a = A(() => T(o), [o]), P = async () => {
59
67
  p(!0), u(null);
60
68
  try {
61
69
  const t = await fetch("/api/rb/notifications/settings", {
@@ -78,7 +86,9 @@ function z({
78
86
  try {
79
87
  const c = await fetch("/api/rb/notifications/settings", {
80
88
  method: "PUT",
81
- headers: { "Content-Type": "application/json" },
89
+ headers: {
90
+ "Content-Type": "application/json"
91
+ },
82
92
  credentials: "include",
83
93
  body: JSON.stringify({
84
94
  digestFrequency: t.digestFrequency,
@@ -103,7 +113,15 @@ function z({
103
113
  a.length !== 0 && h((t) => y(t, a));
104
114
  }, [a]);
105
115
  const N = (t, c) => {
106
- const l = m.topicPreferences.some((x) => x.topic === t) ? m.topicPreferences.map((x) => x.topic === t ? c(x) : x) : [...m.topicPreferences, c({ topic: t, inApp: !0, emailDigest: !0, push: !1 })], b = f({ ...m, topicPreferences: l });
116
+ const l = m.topicPreferences.some((x) => x.topic === t) ? m.topicPreferences.map((x) => x.topic === t ? c(x) : x) : [...m.topicPreferences, c({
117
+ topic: t,
118
+ inApp: !0,
119
+ emailDigest: !0,
120
+ push: !1
121
+ })], b = f({
122
+ ...m,
123
+ topicPreferences: l
124
+ });
107
125
  h(b), v(b);
108
126
  };
109
127
  return s ? /* @__PURE__ */ e.jsx("div", { className: w("flex items-center justify-center py-10 text-muted-foreground", r), children: /* @__PURE__ */ e.jsx(S, { className: "h-4 w-4 animate-spin" }) }) : /* @__PURE__ */ e.jsxs("div", { className: w("space-y-4", r), children: [
@@ -112,18 +130,13 @@ function z({
112
130
  /* @__PURE__ */ e.jsx("div", { className: "text-sm font-semibold", children: "Email digest" }),
113
131
  /* @__PURE__ */ e.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "Choose how often we email you a summary." })
114
132
  ] }),
115
- /* @__PURE__ */ e.jsx(
116
- "select",
117
- {
118
- value: m.digestFrequency,
119
- onChange: (t) => {
120
- const c = t.target.value, n = f({ ...m, digestFrequency: c });
121
- h(n), v(n);
122
- },
123
- className: "h-9 rounded-md border bg-background px-2 text-sm",
124
- children: D.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.value, children: t.label }, t.value))
125
- }
126
- )
133
+ /* @__PURE__ */ e.jsx("select", { value: m.digestFrequency, onChange: (t) => {
134
+ const c = t.target.value, n = f({
135
+ ...m,
136
+ digestFrequency: c
137
+ });
138
+ h(n), v(n);
139
+ }, className: "h-9 rounded-md border bg-background px-2 text-sm", children: D.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.value, children: t.label }, t.value)) })
127
140
  ] }) }),
128
141
  /* @__PURE__ */ e.jsxs("div", { className: "rounded-md border bg-background p-4", children: [
129
142
  /* @__PURE__ */ e.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ e.jsxs("div", { children: [
@@ -145,32 +158,15 @@ function z({
145
158
  c?.description ? /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: c.description }) : null,
146
159
  /* @__PURE__ */ e.jsx("span", { className: "text-[11px] text-muted-foreground", children: t.topic })
147
160
  ] }) }),
148
- /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx(
149
- "input",
150
- {
151
- type: "checkbox",
152
- checked: t.inApp,
153
- onChange: (n) => N(t.topic, (l) => ({ ...l, inApp: n.target.checked }))
154
- }
155
- ) }),
156
- /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx(
157
- "input",
158
- {
159
- type: "checkbox",
160
- checked: t.emailDigest,
161
- onChange: (n) => N(t.topic, (l) => ({ ...l, emailDigest: n.target.checked }))
162
- }
163
- ) }),
164
- /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx(
165
- "input",
166
- {
167
- type: "checkbox",
168
- checked: t.push,
169
- disabled: !0,
170
- className: "opacity-50",
171
- "aria-label": "Push notifications (coming soon)"
172
- }
173
- ) })
161
+ /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.inApp, onChange: (n) => N(t.topic, (l) => ({
162
+ ...l,
163
+ inApp: n.target.checked
164
+ })) }) }),
165
+ /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.emailDigest, onChange: (n) => N(t.topic, (l) => ({
166
+ ...l,
167
+ emailDigest: n.target.checked
168
+ })) }) }),
169
+ /* @__PURE__ */ e.jsx("td", { className: "py-3 pr-4", children: /* @__PURE__ */ e.jsx("input", { type: "checkbox", checked: t.push, disabled: !0, className: "opacity-50", "aria-label": "Push notifications (coming soon)" }) })
174
170
  ] }, t.topic);
175
171
  }) })
176
172
  ] }) }),
@@ -1 +1 @@
1
- {"version":3,"file":"index25.js","sources":["../src/components/Notifications/NotificationsSettings.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type { NotificationDigestFrequency, NotificationSettings, NotificationTopicCatalogItem, NotificationTopicPreference } from \"./types\"\n\n\ntype SettingsResponse = {\n ok?: boolean\n error?: string\n settings?: NotificationSettings\n}\n\nconst digestValues: Array<{ value: NotificationDigestFrequency; label: string }> = [\n { value: \"off\", label: \"Off\" },\n { value: \"daily\", label: \"Daily\" },\n { value: \"weekly\", label: \"Weekly\" },\n]\n\nconst normalizeSettings = (settings: NotificationSettings | undefined): NotificationSettings => {\n const digestFrequency = settings?.digestFrequency\n const frequency: NotificationDigestFrequency =\n digestFrequency === \"off\" || digestFrequency === \"daily\" || digestFrequency === \"weekly\"\n ? digestFrequency\n : \"weekly\"\n\n const topicPreferences = Array.isArray(settings?.topicPreferences)\n ? settings!.topicPreferences\n .map((pref) => ({\n topic: typeof pref.topic === \"string\" ? pref.topic.trim() : \"\",\n inApp: pref.inApp === true,\n emailDigest: pref.emailDigest === true,\n push: pref.push === true,\n }))\n .filter((pref) => pref.topic.length > 0)\n : []\n\n return {\n digestFrequency: frequency,\n topicPreferences,\n ...(typeof settings?.lastDigestSentAt === \"string\" ? { lastDigestSentAt: settings.lastDigestSentAt } : {}),\n }\n}\n\nconst normalizeTopics = (topics: NotificationTopicCatalogItem[] | undefined): NotificationTopicCatalogItem[] => {\n if (!Array.isArray(topics)) return []\n\n const seen = new Set<string>()\n return topics\n .map((topic) => ({\n topic: typeof topic.topic === \"string\" ? topic.topic.trim() : \"\",\n title: typeof topic.title === \"string\" ? topic.title.trim() : \"\",\n description: typeof topic.description === \"string\" ? topic.description.trim() : undefined,\n }))\n .filter((topic) => topic.topic.length > 0)\n .filter((topic) => {\n if (seen.has(topic.topic)) return false\n seen.add(topic.topic)\n return true\n })\n}\n\nconst applyTopicsToSettings = (\n settings: NotificationSettings,\n topics: NotificationTopicCatalogItem[],\n): NotificationSettings => {\n const defaults: NotificationTopicPreference = {\n topic: \"\",\n inApp: true,\n emailDigest: true,\n push: false,\n }\n\n const byTopic = new Map(settings.topicPreferences.map((pref) => [pref.topic, pref]))\n return {\n ...settings,\n topicPreferences: topics.map((topic) => {\n const existing = byTopic.get(topic.topic)\n return existing\n ? {\n topic: topic.topic,\n inApp: existing.inApp === true,\n emailDigest: existing.emailDigest === true,\n push: existing.push === true,\n }\n : {\n ...defaults,\n topic: topic.topic,\n }\n }),\n }\n}\n\nexport function NotificationsSettings({\n className,\n topics,\n}: {\n className?: string\n topics?: NotificationTopicCatalogItem[]\n}) {\n const [loading, setLoading] = useState(true)\n const [saving, setSaving] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [settings, setSettings] = useState<NotificationSettings>(() =>\n normalizeSettings({ digestFrequency: \"weekly\", topicPreferences: [] }),\n )\n\n const normalizedTopics = useMemo(() => normalizeTopics(topics), [topics])\n\n const loadSettings = async () => {\n setLoading(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"GET\",\n credentials: \"include\",\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to load notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to load notification settings.\")\n } finally {\n setLoading(false)\n }\n }\n\n const saveSettings = async (next: NotificationSettings) => {\n setSaving(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({\n digestFrequency: next.digestFrequency,\n topicPreferences: next.topicPreferences,\n }),\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to save notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to save notification settings.\")\n } finally {\n setSaving(false)\n }\n }\n\n useEffect(() => {\n void loadSettings()\n }, [])\n\n useEffect(() => {\n if (normalizedTopics.length === 0) return\n setSettings((current) => applyTopicsToSettings(current, normalizedTopics))\n }, [normalizedTopics])\n\n const updatePreference = (topic: string, update: (p: NotificationTopicPreference) => NotificationTopicPreference) => {\n const hasExisting = settings.topicPreferences.some((p) => p.topic === topic)\n const nextPrefs = hasExisting\n ? settings.topicPreferences.map((p) => (p.topic === topic ? update(p) : p))\n : [...settings.topicPreferences, update({ topic, inApp: true, emailDigest: true, push: false })]\n const next = normalizeSettings({ ...settings, topicPreferences: nextPrefs })\n setSettings(next)\n void saveSettings(next)\n }\n\n if (loading) {\n return (\n <div className={cn(\"flex items-center justify-center py-10 text-muted-foreground\", className)}>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )\n }\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Email digest</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose how often we email you a summary.</div>\n </div>\n <select\n value={settings.digestFrequency}\n onChange={(e) => {\n const value = e.target.value as NotificationDigestFrequency\n const next = normalizeSettings({ ...settings, digestFrequency: value })\n setSettings(next)\n void saveSettings(next)\n }}\n className=\"h-9 rounded-md border bg-background px-2 text-sm\"\n >\n {digestValues.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Topics</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose where you receive each topic.</div>\n </div>\n </div>\n\n {normalizedTopics.length === 0 ? (\n <div className=\"mt-4 text-sm text-muted-foreground\">No topics configured.</div>\n ) : (\n <div className=\"mt-4 overflow-x-auto\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"text-left text-xs text-muted-foreground\">\n <th className=\"py-2 pr-4 font-medium\">Topic</th>\n <th className=\"py-2 pr-4 font-medium\">In-app</th>\n <th className=\"py-2 pr-4 font-medium\">Email digest</th>\n <th className=\"py-2 pr-4 font-medium\">Push</th>\n </tr>\n </thead>\n <tbody>\n {settings.topicPreferences.map((pref) => {\n const meta = normalizedTopics.find((topic) => topic.topic === pref.topic)\n return (\n <tr key={pref.topic} className=\"border-t align-top\">\n <td className=\"py-3 pr-4\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-medium\">{meta?.title || pref.topic}</span>\n {meta?.description ? (\n <span className=\"text-xs text-muted-foreground\">{meta.description}</span>\n ) : null}\n <span className=\"text-[11px] text-muted-foreground\">{pref.topic}</span>\n </div>\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.inApp}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, inApp: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.emailDigest}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, emailDigest: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.push}\n disabled\n className=\"opacity-50\"\n aria-label=\"Push notifications (coming soon)\"\n />\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )}\n\n {error ? (\n <div className=\"mt-3 text-sm text-destructive\">{error}</div>\n ) : saving ? (\n <div className=\"mt-3 text-xs text-muted-foreground\">Saving…</div>\n ) : null}\n </div>\n </div>\n )\n}\n"],"names":["digestValues","normalizeSettings","settings","digestFrequency","frequency","topicPreferences","pref","normalizeTopics","topics","seen","topic","applyTopicsToSettings","defaults","byTopic","existing","NotificationsSettings","className","loading","setLoading","useState","saving","setSaving","error","setError","setSettings","normalizedTopics","useMemo","loadSettings","res","json","normalized","saveSettings","next","useEffect","current","updatePreference","update","nextPrefs","p","jsx","cn","Loader2","jsxs","e","value","opt","meta"],"mappings":";;;;AAcA,MAAMA,IAA6E;AAAA,EACjF,EAAE,OAAO,OAAO,OAAO,MAAA;AAAA,EACvB,EAAE,OAAO,SAAS,OAAO,QAAA;AAAA,EACzB,EAAE,OAAO,UAAU,OAAO,SAAA;AAC5B,GAEMC,IAAoB,CAACC,MAAqE;AAC9F,QAAMC,IAAkBD,GAAU,iBAC5BE,IACJD,MAAoB,SAASA,MAAoB,WAAWA,MAAoB,WAC5EA,IACA,UAEAE,IAAmB,MAAM,QAAQH,GAAU,gBAAgB,IAC7DA,EAAU,iBACT,IAAI,CAACI,OAAU;AAAA,IACd,OAAO,OAAOA,EAAK,SAAU,WAAWA,EAAK,MAAM,SAAS;AAAA,IAC5D,OAAOA,EAAK,UAAU;AAAA,IACtB,aAAaA,EAAK,gBAAgB;AAAA,IAClC,MAAMA,EAAK,SAAS;AAAA,EAAA,EACpB,EACD,OAAO,CAACA,MAASA,EAAK,MAAM,SAAS,CAAC,IACvC,CAAA;AAEJ,SAAO;AAAA,IACL,iBAAiBF;AAAA,IACjB,kBAAAC;AAAA,IACA,GAAI,OAAOH,GAAU,oBAAqB,WAAW,EAAE,kBAAkBA,EAAS,qBAAqB,CAAA;AAAA,EAAC;AAE5G,GAEMK,IAAkB,CAACC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A,gBACL,SAASjC,EAAK;AAAA,gBACd,UAAU,CAACqC,MACTR,EAAiB7B,EAAK,OAAO,CAACgC,OAAO,EAAE,GAAGA,GAAG,OAAOK,EAAE,OAAO,UAAU;AAAA,cAAA;AAAA,YAAA,GAG7E;AAAA,YACAJ,gBAAAA,EAAAA,IAAC,MAAA,EAAG,WAAU,aACZ,UAAAA,gBAAAA,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAASjC,EAAK;AAAA,gBACd,UAAU,CAACqC,MACTR,EAAiB7B,EAAK,OAAO,CAACgC,OAAO,EAAE,GAAGA,GAAG,aAAaK,EAAE,OAAO,UAAU;AAAA,cAAA;AAAA,YAAA,GAGnF;AAAA,YACAJ,gBAAAA,EAAAA,IAAC,MAAA,EAAG,WAAU,aACZ,UAAAA,gBAAAA,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAASjC,EAAK;AAAA,gBACd,UAAQ;AAAA,gBACR,WAAU;AAAA,gBACV,cAAW;AAAA,cAAA;AAAA,YAAA,EACb,CACF;AAAA,UAAA,EAAA,GApCOA,EAAK,KAqCd;AAAA,QAEJ,CAAC,EAAA,CACH;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,MAGDgB,IACCiB,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,iCAAiC,UAAAjB,EAAA,CAAM,IACpDF,IACFmB,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,sCAAqC,qBAAO,IACzD;AAAA,IAAA,EAAA,CACN;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"index25.js","sources":["../src/components/Notifications/NotificationsSettings.tsx"],"sourcesContent":["import { useEffect, useMemo, useState } from \"react\"\nimport { Loader2 } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nimport type { NotificationDigestFrequency, NotificationSettings, NotificationTopicCatalogItem, NotificationTopicPreference } from \"./types\"\n\n\ntype SettingsResponse = {\n ok?: boolean\n error?: string\n settings?: NotificationSettings\n}\n\nconst digestValues: Array<{ value: NotificationDigestFrequency; label: string }> = [\n { value: \"off\", label: \"Off\" },\n { value: \"daily\", label: \"Daily\" },\n { value: \"weekly\", label: \"Weekly\" },\n]\n\nconst normalizeSettings = (settings: NotificationSettings | undefined): NotificationSettings => {\n const digestFrequency = settings?.digestFrequency\n const frequency: NotificationDigestFrequency =\n digestFrequency === \"off\" || digestFrequency === \"daily\" || digestFrequency === \"weekly\"\n ? digestFrequency\n : \"weekly\"\n\n const topicPreferences = Array.isArray(settings?.topicPreferences)\n ? settings!.topicPreferences\n .map((pref) => ({\n topic: typeof pref.topic === \"string\" ? pref.topic.trim() : \"\",\n inApp: pref.inApp === true,\n emailDigest: pref.emailDigest === true,\n push: pref.push === true,\n }))\n .filter((pref) => pref.topic.length > 0)\n : []\n\n return {\n digestFrequency: frequency,\n topicPreferences,\n ...(typeof settings?.lastDigestSentAt === \"string\" ? { lastDigestSentAt: settings.lastDigestSentAt } : {}),\n }\n}\n\nconst normalizeTopics = (topics: NotificationTopicCatalogItem[] | undefined): NotificationTopicCatalogItem[] => {\n if (!Array.isArray(topics)) return []\n\n const seen = new Set<string>()\n return topics\n .map((topic) => ({\n topic: typeof topic.topic === \"string\" ? topic.topic.trim() : \"\",\n title: typeof topic.title === \"string\" ? topic.title.trim() : \"\",\n description: typeof topic.description === \"string\" ? topic.description.trim() : undefined,\n }))\n .filter((topic) => topic.topic.length > 0)\n .filter((topic) => {\n if (seen.has(topic.topic)) return false\n seen.add(topic.topic)\n return true\n })\n}\n\nconst applyTopicsToSettings = (\n settings: NotificationSettings,\n topics: NotificationTopicCatalogItem[],\n): NotificationSettings => {\n const defaults: NotificationTopicPreference = {\n topic: \"\",\n inApp: true,\n emailDigest: true,\n push: false,\n }\n\n const byTopic = new Map(settings.topicPreferences.map((pref) => [pref.topic, pref]))\n return {\n ...settings,\n topicPreferences: topics.map((topic) => {\n const existing = byTopic.get(topic.topic)\n return existing\n ? {\n topic: topic.topic,\n inApp: existing.inApp === true,\n emailDigest: existing.emailDigest === true,\n push: existing.push === true,\n }\n : {\n ...defaults,\n topic: topic.topic,\n }\n }),\n }\n}\n\nexport function NotificationsSettings({\n className,\n topics,\n}: {\n className?: string\n topics?: NotificationTopicCatalogItem[]\n}) {\n const [loading, setLoading] = useState(true)\n const [saving, setSaving] = useState(false)\n const [error, setError] = useState<string | null>(null)\n const [settings, setSettings] = useState<NotificationSettings>(() =>\n normalizeSettings({ digestFrequency: \"weekly\", topicPreferences: [] }),\n )\n\n const normalizedTopics = useMemo(() => normalizeTopics(topics), [topics])\n\n const loadSettings = async () => {\n setLoading(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"GET\",\n credentials: \"include\",\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to load notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to load notification settings.\")\n } finally {\n setLoading(false)\n }\n }\n\n const saveSettings = async (next: NotificationSettings) => {\n setSaving(true)\n setError(null)\n try {\n const res = await fetch(\"/api/rb/notifications/settings\", {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n credentials: \"include\",\n body: JSON.stringify({\n digestFrequency: next.digestFrequency,\n topicPreferences: next.topicPreferences,\n }),\n })\n const json = (await res.json().catch(() => null)) as SettingsResponse | null\n if (!res.ok || !json?.ok) {\n setError(json?.error || \"Unable to save notification settings.\")\n return\n }\n const normalized = normalizeSettings(json.settings)\n setSettings(normalizedTopics.length > 0 ? applyTopicsToSettings(normalized, normalizedTopics) : normalized)\n } catch {\n setError(\"Unable to save notification settings.\")\n } finally {\n setSaving(false)\n }\n }\n\n useEffect(() => {\n void loadSettings()\n }, [])\n\n useEffect(() => {\n if (normalizedTopics.length === 0) return\n setSettings((current) => applyTopicsToSettings(current, normalizedTopics))\n }, [normalizedTopics])\n\n const updatePreference = (topic: string, update: (p: NotificationTopicPreference) => NotificationTopicPreference) => {\n const hasExisting = settings.topicPreferences.some((p) => p.topic === topic)\n const nextPrefs = hasExisting\n ? settings.topicPreferences.map((p) => (p.topic === topic ? update(p) : p))\n : [...settings.topicPreferences, update({ topic, inApp: true, emailDigest: true, push: false })]\n const next = normalizeSettings({ ...settings, topicPreferences: nextPrefs })\n setSettings(next)\n void saveSettings(next)\n }\n\n if (loading) {\n return (\n <div className={cn(\"flex items-center justify-center py-10 text-muted-foreground\", className)}>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n </div>\n )\n }\n\n return (\n <div className={cn(\"space-y-4\", className)}>\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Email digest</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose how often we email you a summary.</div>\n </div>\n <select\n value={settings.digestFrequency}\n onChange={(e) => {\n const value = e.target.value as NotificationDigestFrequency\n const next = normalizeSettings({ ...settings, digestFrequency: value })\n setSettings(next)\n void saveSettings(next)\n }}\n className=\"h-9 rounded-md border bg-background px-2 text-sm\"\n >\n {digestValues.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n </div>\n </div>\n\n <div className=\"rounded-md border bg-background p-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <div className=\"text-sm font-semibold\">Topics</div>\n <div className=\"mt-1 text-xs text-muted-foreground\">Choose where you receive each topic.</div>\n </div>\n </div>\n\n {normalizedTopics.length === 0 ? (\n <div className=\"mt-4 text-sm text-muted-foreground\">No topics configured.</div>\n ) : (\n <div className=\"mt-4 overflow-x-auto\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"text-left text-xs text-muted-foreground\">\n <th className=\"py-2 pr-4 font-medium\">Topic</th>\n <th className=\"py-2 pr-4 font-medium\">In-app</th>\n <th className=\"py-2 pr-4 font-medium\">Email digest</th>\n <th className=\"py-2 pr-4 font-medium\">Push</th>\n </tr>\n </thead>\n <tbody>\n {settings.topicPreferences.map((pref) => {\n const meta = normalizedTopics.find((topic) => topic.topic === pref.topic)\n return (\n <tr key={pref.topic} className=\"border-t align-top\">\n <td className=\"py-3 pr-4\">\n <div className=\"flex flex-col gap-1\">\n <span className=\"font-medium\">{meta?.title || pref.topic}</span>\n {meta?.description ? (\n <span className=\"text-xs text-muted-foreground\">{meta.description}</span>\n ) : null}\n <span className=\"text-[11px] text-muted-foreground\">{pref.topic}</span>\n </div>\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.inApp}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, inApp: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.emailDigest}\n onChange={(e) =>\n updatePreference(pref.topic, (p) => ({ ...p, emailDigest: e.target.checked }))\n }\n />\n </td>\n <td className=\"py-3 pr-4\">\n <input\n type=\"checkbox\"\n checked={pref.push}\n disabled\n className=\"opacity-50\"\n aria-label=\"Push notifications (coming soon)\"\n />\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )}\n\n {error ? (\n <div className=\"mt-3 text-sm text-destructive\">{error}</div>\n ) : saving ? (\n <div className=\"mt-3 text-xs text-muted-foreground\">Saving…</div>\n ) : null}\n </div>\n </div>\n )\n}\n"],"names":["digestValues","value","label","normalizeSettings","settings","digestFrequency","frequency","topicPreferences","Array","isArray","map","pref","topic","trim","inApp","emailDigest","push","filter","length","lastDigestSentAt","normalizeTopics","topics","seen","Set","title","description","undefined","has","add","applyTopicsToSettings","defaults","byTopic","Map","existing","get","NotificationsSettings","className","loading","setLoading","useState","saving","setSaving","error","setError","setSettings","normalizedTopics","useMemo","loadSettings","res","fetch","method","credentials","json","catch","ok","normalized","saveSettings","next","headers","body","JSON","stringify","useEffect","current","updatePreference","update","nextPrefs","some","p","jsx","cn","Loader2","jsxs","e","target","opt","meta","find","checked"],"mappings":";;;;AAcA,MAAMA,IAA6E,CACjF;AAAA,EAAEC,OAAO;AAAA,EAAOC,OAAO;AAAM,GAC7B;AAAA,EAAED,OAAO;AAAA,EAASC,OAAO;AAAQ,GACjC;AAAA,EAAED,OAAO;AAAA,EAAUC,OAAO;AAAS,CAAC,GAGhCC,IAAoBA,CAACC,MAAqE;AAC9F,QAAMC,IAAkBD,GAAUC,iBAC5BC,IACJD,MAAoB,SAASA,MAAoB,WAAWA,MAAoB,WAC5EA,IACA,UAEAE,IAAmBC,MAAMC,QAAQL,GAAUG,gBAAgB,IAC7DH,EAAUG,iBACTG,IAAKC,CAAAA,OAAU;AAAA,IACdC,OAAO,OAAOD,EAAKC,SAAU,WAAWD,EAAKC,MAAMC,SAAS;AAAA,IAC5DC,OAAOH,EAAKG,UAAU;AAAA,IACtBC,aAAaJ,EAAKI,gBAAgB;AAAA,IAClCC,MAAML,EAAKK,SAAS;AAAA,EAAA,EACpB,EACDC,OAAQN,CAAAA,MAASA,EAAKC,MAAMM,SAAS,CAAC,IACvC,CAAA;AAEJ,SAAO;AAAA,IACLb,iBAAiBC;AAAAA,IACjBC,kBAAAA;AAAAA,IACA,GAAI,OAAOH,GAAUe,oBAAqB,WAAW;AAAA,MAAEA,kBAAkBf,EAASe;AAAAA,IAAAA,IAAqB,CAAA;AAAA,EAAC;AAE5G,GAEMC,IAAkBA,CAACC,MAAuF;AAC9G,MAAI,CAACb,MAAMC,QAAQY,CAAM,UAAU,CAAA;AAEnC,QAAMC,wBAAWC,IAAAA;AACjB,SAAOF,EACJX,IAAKE,CAAAA,OAAW;AAAA,IACfA,OAAO,OAAOA,EAAMA,SAAU,WAAWA,EAAMA,MAAMC,SAAS;AAAA,IAC9DW,OAAO,OAAOZ,EAAMY,SAAU,WAAWZ,EAAMY,MAAMX,SAAS;AAAA,IAC9DY,a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