tempest-react-sdk 0.77.0 → 0.79.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 (1623) hide show
  1. package/README.md +6 -6
  2. package/bin/lib/alias/collect.mjs +20 -3
  3. package/bin/lib/alias/index.mjs +12 -1
  4. package/bin/lib/alias/index.test.mjs +24 -0
  5. package/bin/lib/css/analyze.test.mjs +21 -1
  6. package/bin/lib/css/collect.mjs +14 -0
  7. package/bin/lib/css/extract.mjs +63 -5
  8. package/bin/lib/css/extract.test.mjs +110 -1
  9. package/bin/lib/css/fix.e2e.test.mjs +50 -0
  10. package/bin/lib/css/index.mjs +6 -1
  11. package/bin/lib/fs/contain.mjs +50 -0
  12. package/bin/lib/icons/generate.mjs +28 -3
  13. package/bin/lib/icons/generate.test.mjs +57 -1
  14. package/bin/lib/openapi/escape.mjs +20 -6
  15. package/bin/lib/openapi/generate.encode.test.mjs +120 -0
  16. package/bin/lib/openapi/generate.hostile.test.mjs +38 -9
  17. package/bin/lib/openapi/generate.mjs +203 -64
  18. package/bin/lib/openapi/generate.pagination.test.mjs +3 -2
  19. package/bin/lib/openapi/generate.test.mjs +270 -3
  20. package/bin/lib/openapi/schema-to-zod.mjs +5 -3
  21. package/bin/tempest-gen.test.mjs +188 -0
  22. package/bin/tempest.mjs +120 -44
  23. package/dist/access/Can.cjs.map +1 -1
  24. package/dist/access/Can.js.map +1 -1
  25. package/dist/access/access-control-context.cjs.map +1 -1
  26. package/dist/access/access-control-context.js.map +1 -1
  27. package/dist/access/create-role-access-control.cjs.map +1 -1
  28. package/dist/access/create-role-access-control.js.map +1 -1
  29. package/dist/access/permissions-from-token.cjs.map +1 -1
  30. package/dist/access/permissions-from-token.js.map +1 -1
  31. package/dist/access/use-can.cjs.map +1 -1
  32. package/dist/access/use-can.js.map +1 -1
  33. package/dist/app/AppProviders.cjs.map +1 -1
  34. package/dist/app/AppProviders.js.map +1 -1
  35. package/dist/audio/audio-bus.cjs.map +1 -1
  36. package/dist/audio/audio-bus.js.map +1 -1
  37. package/dist/audio/audio-output.cjs.map +1 -1
  38. package/dist/audio/audio-output.js.map +1 -1
  39. package/dist/audio/audio-player.cjs.map +1 -1
  40. package/dist/audio/audio-player.js.map +1 -1
  41. package/dist/audio/audio-recorder.cjs.map +1 -1
  42. package/dist/audio/audio-recorder.js.map +1 -1
  43. package/dist/audio/duration.cjs.map +1 -1
  44. package/dist/audio/duration.js.map +1 -1
  45. package/dist/audio/level-meter.cjs.map +1 -1
  46. package/dist/audio/level-meter.js.map +1 -1
  47. package/dist/audio/media-access.cjs.map +1 -1
  48. package/dist/audio/media-access.js.map +1 -1
  49. package/dist/audio/noise-floor.cjs.map +1 -1
  50. package/dist/audio/noise-floor.js.map +1 -1
  51. package/dist/audio/sfx-pool.cjs.map +1 -1
  52. package/dist/audio/sfx-pool.js.map +1 -1
  53. package/dist/audio/use-audio-bus.cjs.map +1 -1
  54. package/dist/audio/use-audio-bus.js.map +1 -1
  55. package/dist/audio/use-audio-recorder.cjs.map +1 -1
  56. package/dist/audio/use-audio-recorder.js.map +1 -1
  57. package/dist/audio/use-audio.cjs.map +1 -1
  58. package/dist/audio/use-audio.js.map +1 -1
  59. package/dist/audio/use-microphone.cjs +1 -1
  60. package/dist/audio/use-microphone.cjs.map +1 -1
  61. package/dist/audio/use-microphone.js +1 -5
  62. package/dist/audio/use-microphone.js.map +1 -1
  63. package/dist/audio/use-sfx-pool.cjs.map +1 -1
  64. package/dist/audio/use-sfx-pool.js.map +1 -1
  65. package/dist/audio/voice-activity.cjs.map +1 -1
  66. package/dist/audio/voice-activity.js.map +1 -1
  67. package/dist/audio/voice-chain-stages.cjs.map +1 -1
  68. package/dist/audio/voice-chain-stages.js.map +1 -1
  69. package/dist/audio/voice-chain.cjs.map +1 -1
  70. package/dist/audio/voice-chain.js.map +1 -1
  71. package/dist/audio/wav.cjs.map +1 -1
  72. package/dist/audio/wav.js.map +1 -1
  73. package/dist/auth/AuthGuard.cjs.map +1 -1
  74. package/dist/auth/AuthGuard.js.map +1 -1
  75. package/dist/auth/create-auth-store.cjs.map +1 -1
  76. package/dist/auth/create-auth-store.js.map +1 -1
  77. package/dist/auth/create-tempest-auth.cjs +1 -1
  78. package/dist/auth/create-tempest-auth.cjs.map +1 -1
  79. package/dist/auth/create-tempest-auth.js +185 -114
  80. package/dist/auth/create-tempest-auth.js.map +1 -1
  81. package/dist/auth/jwt.cjs.map +1 -1
  82. package/dist/auth/jwt.js.map +1 -1
  83. package/dist/auth/lazy-with-retry.cjs.map +1 -1
  84. package/dist/auth/lazy-with-retry.js.map +1 -1
  85. package/dist/auth/passkey.cjs.map +1 -1
  86. package/dist/auth/passkey.js.map +1 -1
  87. package/dist/auth/refresh-queue.cjs.map +1 -1
  88. package/dist/auth/refresh-queue.js.map +1 -1
  89. package/dist/auth/use-passkey.cjs +1 -1
  90. package/dist/auth/use-passkey.cjs.map +1 -1
  91. package/dist/auth/use-passkey.js +1 -1
  92. package/dist/auth/use-passkey.js.map +1 -1
  93. package/dist/br/BrazilMap.cjs.map +1 -1
  94. package/dist/br/BrazilMap.js.map +1 -1
  95. package/dist/br/BrazilMap.module.cjs.map +1 -1
  96. package/dist/br/BrazilMap.module.js.map +1 -1
  97. package/dist/br/BrazilStateCitySelect.cjs.map +1 -1
  98. package/dist/br/BrazilStateCitySelect.js.map +1 -1
  99. package/dist/br/BrazilStateMap.cjs.map +1 -1
  100. package/dist/br/BrazilStateMap.js.map +1 -1
  101. package/dist/br/MapLegend.cjs.map +1 -1
  102. package/dist/br/MapLegend.js.map +1 -1
  103. package/dist/br/MapLegend.module.cjs.map +1 -1
  104. package/dist/br/MapLegend.module.js.map +1 -1
  105. package/dist/br/MapMarkers.cjs.map +1 -1
  106. package/dist/br/MapMarkers.js.map +1 -1
  107. package/dist/br/MapTooltip.cjs.map +1 -1
  108. package/dist/br/MapTooltip.js.map +1 -1
  109. package/dist/br/MunicipalitySearch.cjs +1 -1
  110. package/dist/br/MunicipalitySearch.cjs.map +1 -1
  111. package/dist/br/MunicipalitySearch.js +2 -5
  112. package/dist/br/MunicipalitySearch.js.map +1 -1
  113. package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
  114. package/dist/br/MunicipalitySearch.module.js.map +1 -1
  115. package/dist/br/PixQRCode.cjs.map +1 -1
  116. package/dist/br/PixQRCode.js.map +1 -1
  117. package/dist/br/PixQRCode.module.cjs.map +1 -1
  118. package/dist/br/PixQRCode.module.js.map +1 -1
  119. package/dist/br/boleto.cjs.map +1 -1
  120. package/dist/br/boleto.js.map +1 -1
  121. package/dist/br/br-geo.cjs.map +1 -1
  122. package/dist/br/br-geo.js.map +1 -1
  123. package/dist/br/data/br-centroids.cjs.map +1 -1
  124. package/dist/br/data/br-centroids.js.map +1 -1
  125. package/dist/br/data/br-locations.cjs.map +1 -1
  126. package/dist/br/data/br-locations.js.map +1 -1
  127. package/dist/br/data/br-uf-geo.cjs.map +1 -1
  128. package/dist/br/data/br-uf-geo.js.map +1 -1
  129. package/dist/br/data/mun/AC.cjs.map +1 -1
  130. package/dist/br/data/mun/AC.js.map +1 -1
  131. package/dist/br/data/mun/AL.cjs.map +1 -1
  132. package/dist/br/data/mun/AL.js.map +1 -1
  133. package/dist/br/data/mun/AM.cjs.map +1 -1
  134. package/dist/br/data/mun/AM.js.map +1 -1
  135. package/dist/br/data/mun/AP.cjs.map +1 -1
  136. package/dist/br/data/mun/AP.js.map +1 -1
  137. package/dist/br/data/mun/BA.cjs.map +1 -1
  138. package/dist/br/data/mun/BA.js.map +1 -1
  139. package/dist/br/data/mun/CE.cjs.map +1 -1
  140. package/dist/br/data/mun/CE.js.map +1 -1
  141. package/dist/br/data/mun/DF.cjs.map +1 -1
  142. package/dist/br/data/mun/DF.js.map +1 -1
  143. package/dist/br/data/mun/ES.cjs.map +1 -1
  144. package/dist/br/data/mun/ES.js.map +1 -1
  145. package/dist/br/data/mun/GO.cjs.map +1 -1
  146. package/dist/br/data/mun/GO.js.map +1 -1
  147. package/dist/br/data/mun/MA.cjs.map +1 -1
  148. package/dist/br/data/mun/MA.js.map +1 -1
  149. package/dist/br/data/mun/MG.cjs.map +1 -1
  150. package/dist/br/data/mun/MG.js.map +1 -1
  151. package/dist/br/data/mun/MS.cjs.map +1 -1
  152. package/dist/br/data/mun/MS.js.map +1 -1
  153. package/dist/br/data/mun/MT.cjs.map +1 -1
  154. package/dist/br/data/mun/MT.js.map +1 -1
  155. package/dist/br/data/mun/PA.cjs.map +1 -1
  156. package/dist/br/data/mun/PA.js.map +1 -1
  157. package/dist/br/data/mun/PB.cjs.map +1 -1
  158. package/dist/br/data/mun/PB.js.map +1 -1
  159. package/dist/br/data/mun/PE.cjs.map +1 -1
  160. package/dist/br/data/mun/PE.js.map +1 -1
  161. package/dist/br/data/mun/PI.cjs.map +1 -1
  162. package/dist/br/data/mun/PI.js.map +1 -1
  163. package/dist/br/data/mun/PR.cjs.map +1 -1
  164. package/dist/br/data/mun/PR.js.map +1 -1
  165. package/dist/br/data/mun/RJ.cjs.map +1 -1
  166. package/dist/br/data/mun/RJ.js.map +1 -1
  167. package/dist/br/data/mun/RN.cjs.map +1 -1
  168. package/dist/br/data/mun/RN.js.map +1 -1
  169. package/dist/br/data/mun/RO.cjs.map +1 -1
  170. package/dist/br/data/mun/RO.js.map +1 -1
  171. package/dist/br/data/mun/RR.cjs.map +1 -1
  172. package/dist/br/data/mun/RR.js.map +1 -1
  173. package/dist/br/data/mun/RS.cjs.map +1 -1
  174. package/dist/br/data/mun/RS.js.map +1 -1
  175. package/dist/br/data/mun/SC.cjs.map +1 -1
  176. package/dist/br/data/mun/SC.js.map +1 -1
  177. package/dist/br/data/mun/SE.cjs.map +1 -1
  178. package/dist/br/data/mun/SE.js.map +1 -1
  179. package/dist/br/data/mun/SP.cjs.map +1 -1
  180. package/dist/br/data/mun/SP.js.map +1 -1
  181. package/dist/br/data/mun/TO.cjs.map +1 -1
  182. package/dist/br/data/mun/TO.js.map +1 -1
  183. package/dist/br/geocode.cjs.map +1 -1
  184. package/dist/br/geocode.js.map +1 -1
  185. package/dist/br/holidays.cjs.map +1 -1
  186. package/dist/br/holidays.js.map +1 -1
  187. package/dist/br/locations.cjs.map +1 -1
  188. package/dist/br/locations.js.map +1 -1
  189. package/dist/br/nfe.cjs.map +1 -1
  190. package/dist/br/nfe.js.map +1 -1
  191. package/dist/br/pix.cjs +1 -1
  192. package/dist/br/pix.cjs.map +1 -1
  193. package/dist/br/pix.js +108 -71
  194. package/dist/br/pix.js.map +1 -1
  195. package/dist/br/regions.cjs.map +1 -1
  196. package/dist/br/regions.js.map +1 -1
  197. package/dist/br/scales.cjs.map +1 -1
  198. package/dist/br/scales.js.map +1 -1
  199. package/dist/br/state-geo.cjs.map +1 -1
  200. package/dist/br/state-geo.js.map +1 -1
  201. package/dist/br/svg-utils.cjs.map +1 -1
  202. package/dist/br/svg-utils.js.map +1 -1
  203. package/dist/br/use-map-hover.cjs.map +1 -1
  204. package/dist/br/use-map-hover.js.map +1 -1
  205. package/dist/br/use-map-zoom.cjs.map +1 -1
  206. package/dist/br/use-map-zoom.js.map +1 -1
  207. package/dist/br/whatsapp.cjs.map +1 -1
  208. package/dist/br/whatsapp.js.map +1 -1
  209. package/dist/br.cjs.map +1 -1
  210. package/dist/br.d.ts +16 -5
  211. package/dist/br.js.map +1 -1
  212. package/dist/capture/barcode.cjs.map +1 -1
  213. package/dist/capture/barcode.js.map +1 -1
  214. package/dist/capture/media-recorder.cjs.map +1 -1
  215. package/dist/capture/media-recorder.js.map +1 -1
  216. package/dist/capture/use-barcode-scanner.cjs.map +1 -1
  217. package/dist/capture/use-barcode-scanner.js.map +1 -1
  218. package/dist/capture/use-screen-capture.cjs +1 -1
  219. package/dist/capture/use-screen-capture.cjs.map +1 -1
  220. package/dist/capture/use-screen-capture.js +1 -7
  221. package/dist/capture/use-screen-capture.js.map +1 -1
  222. package/dist/capture/use-speech-recognition.cjs +1 -1
  223. package/dist/capture/use-speech-recognition.cjs.map +1 -1
  224. package/dist/capture/use-speech-recognition.js +35 -36
  225. package/dist/capture/use-speech-recognition.js.map +1 -1
  226. package/dist/capture/use-torch.cjs.map +1 -1
  227. package/dist/capture/use-torch.js.map +1 -1
  228. package/dist/capture/use-video-recorder.cjs.map +1 -1
  229. package/dist/capture/use-video-recorder.js.map +1 -1
  230. package/dist/capture/video-recorder.cjs.map +1 -1
  231. package/dist/capture/video-recorder.js.map +1 -1
  232. package/dist/charts/AreaChart.cjs.map +1 -1
  233. package/dist/charts/AreaChart.js.map +1 -1
  234. package/dist/charts/BarChart.cjs.map +1 -1
  235. package/dist/charts/BarChart.js.map +1 -1
  236. package/dist/charts/LineChart.cjs.map +1 -1
  237. package/dist/charts/LineChart.js.map +1 -1
  238. package/dist/charts/PieChart.cjs.map +1 -1
  239. package/dist/charts/PieChart.js.map +1 -1
  240. package/dist/charts/RadarChart.cjs.map +1 -1
  241. package/dist/charts/RadarChart.js.map +1 -1
  242. package/dist/charts/palette.cjs.map +1 -1
  243. package/dist/charts/palette.js.map +1 -1
  244. package/dist/charts/scales.cjs.map +1 -1
  245. package/dist/charts/scales.js.map +1 -1
  246. package/dist/charts/types.cjs.map +1 -1
  247. package/dist/charts/types.js.map +1 -1
  248. package/dist/charts/use-chart-colors.cjs.map +1 -1
  249. package/dist/charts/use-chart-colors.js.map +1 -1
  250. package/dist/components/AIChat/AIChat.cjs +1 -1
  251. package/dist/components/AIChat/AIChat.cjs.map +1 -1
  252. package/dist/components/AIChat/AIChat.js +1 -5
  253. package/dist/components/AIChat/AIChat.js.map +1 -1
  254. package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
  255. package/dist/components/AIChat/AIChat.module.js.map +1 -1
  256. package/dist/components/AIChat/AIChatComposer.cjs +1 -1
  257. package/dist/components/AIChat/AIChatComposer.cjs.map +1 -1
  258. package/dist/components/AIChat/AIChatComposer.js +1 -7
  259. package/dist/components/AIChat/AIChatComposer.js.map +1 -1
  260. package/dist/components/AIChat/AIChatTurn.cjs.map +1 -1
  261. package/dist/components/AIChat/AIChatTurn.js.map +1 -1
  262. package/dist/components/AIChat/ai-chat-turns.cjs.map +1 -1
  263. package/dist/components/AIChat/ai-chat-turns.js.map +1 -1
  264. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  265. package/dist/components/Accordion/Accordion.js.map +1 -1
  266. package/dist/components/Accordion/Accordion.module.cjs.map +1 -1
  267. package/dist/components/Accordion/Accordion.module.js.map +1 -1
  268. package/dist/components/Alert/Alert.cjs.map +1 -1
  269. package/dist/components/Alert/Alert.js.map +1 -1
  270. package/dist/components/Alert/Alert.module.cjs.map +1 -1
  271. package/dist/components/Alert/Alert.module.js.map +1 -1
  272. package/dist/components/AppBar/AppBar.cjs.map +1 -1
  273. package/dist/components/AppBar/AppBar.js.map +1 -1
  274. package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
  275. package/dist/components/AppBar/AppBar.module.js.map +1 -1
  276. package/dist/components/AppBar/use-sticky-body-warning.cjs +1 -1
  277. package/dist/components/AppBar/use-sticky-body-warning.cjs.map +1 -1
  278. package/dist/components/AppBar/use-sticky-body-warning.js +1 -1
  279. package/dist/components/AppBar/use-sticky-body-warning.js.map +1 -1
  280. package/dist/components/AppShell/AppShell.cjs.map +1 -1
  281. package/dist/components/AppShell/AppShell.js.map +1 -1
  282. package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
  283. package/dist/components/AppShell/AppShell.module.js.map +1 -1
  284. package/dist/components/AspectRatio/AspectRatio.cjs.map +1 -1
  285. package/dist/components/AspectRatio/AspectRatio.js.map +1 -1
  286. package/dist/components/AspectRatio/AspectRatio.module.cjs.map +1 -1
  287. package/dist/components/AspectRatio/AspectRatio.module.js.map +1 -1
  288. package/dist/components/AudioPlayer/AudioPlayer.cjs +1 -1
  289. package/dist/components/AudioPlayer/AudioPlayer.cjs.map +1 -1
  290. package/dist/components/AudioPlayer/AudioPlayer.js +1 -7
  291. package/dist/components/AudioPlayer/AudioPlayer.js.map +1 -1
  292. package/dist/components/AudioPlayer/AudioPlayer.module.cjs.map +1 -1
  293. package/dist/components/AudioPlayer/AudioPlayer.module.js.map +1 -1
  294. package/dist/components/AudioRecorder/AudioRecorder.cjs +1 -1
  295. package/dist/components/AudioRecorder/AudioRecorder.cjs.map +1 -1
  296. package/dist/components/AudioRecorder/AudioRecorder.js +16 -21
  297. package/dist/components/AudioRecorder/AudioRecorder.js.map +1 -1
  298. package/dist/components/AudioRecorder/AudioRecorder.module.cjs.map +1 -1
  299. package/dist/components/AudioRecorder/AudioRecorder.module.js.map +1 -1
  300. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  301. package/dist/components/Avatar/Avatar.js.map +1 -1
  302. package/dist/components/Avatar/Avatar.module.cjs.map +1 -1
  303. package/dist/components/Avatar/Avatar.module.js.map +1 -1
  304. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  305. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
  306. package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -1
  307. package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -1
  308. package/dist/components/Badge/Badge.cjs.map +1 -1
  309. package/dist/components/Badge/Badge.js.map +1 -1
  310. package/dist/components/Badge/Badge.module.cjs.map +1 -1
  311. package/dist/components/Badge/Badge.module.js.map +1 -1
  312. package/dist/components/Banner/Banner.cjs.map +1 -1
  313. package/dist/components/Banner/Banner.js.map +1 -1
  314. package/dist/components/Banner/Banner.module.cjs.map +1 -1
  315. package/dist/components/Banner/Banner.module.js.map +1 -1
  316. package/dist/components/BarList/BarList.cjs.map +1 -1
  317. package/dist/components/BarList/BarList.js.map +1 -1
  318. package/dist/components/BarList/BarList.module.cjs.map +1 -1
  319. package/dist/components/BarList/BarList.module.js.map +1 -1
  320. package/dist/components/BarList/bar-list-model.cjs.map +1 -1
  321. package/dist/components/BarList/bar-list-model.js.map +1 -1
  322. package/dist/components/BarcodeScanner/BarcodeScanner.cjs.map +1 -1
  323. package/dist/components/BarcodeScanner/BarcodeScanner.js.map +1 -1
  324. package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs.map +1 -1
  325. package/dist/components/BarcodeScanner/BarcodeScanner.module.js.map +1 -1
  326. package/dist/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  327. package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -1
  328. package/dist/components/BottomNavigation/BottomNavigation.module.cjs.map +1 -1
  329. package/dist/components/BottomNavigation/BottomNavigation.module.js.map +1 -1
  330. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  331. package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
  332. package/dist/components/BottomSheet/BottomSheet.module.cjs.map +1 -1
  333. package/dist/components/BottomSheet/BottomSheet.module.js.map +1 -1
  334. package/dist/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
  335. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  336. package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs.map +1 -1
  337. package/dist/components/Breadcrumbs/Breadcrumbs.module.js.map +1 -1
  338. package/dist/components/Button/Button.cjs.map +1 -1
  339. package/dist/components/Button/Button.js.map +1 -1
  340. package/dist/components/Button/Button.module.cjs.map +1 -1
  341. package/dist/components/Button/Button.module.js.map +1 -1
  342. package/dist/components/Button/ButtonContent.cjs.map +1 -1
  343. package/dist/components/Button/ButtonContent.js.map +1 -1
  344. package/dist/components/Button/ButtonSlot.cjs.map +1 -1
  345. package/dist/components/Button/ButtonSlot.js.map +1 -1
  346. package/dist/components/Button/button-class.cjs.map +1 -1
  347. package/dist/components/Button/button-class.js.map +1 -1
  348. package/dist/components/Button/link-rel.cjs.map +1 -1
  349. package/dist/components/Button/link-rel.js.map +1 -1
  350. package/dist/components/Button/slot.cjs.map +1 -1
  351. package/dist/components/Button/slot.js.map +1 -1
  352. package/dist/components/Calendar/Calendar.cjs.map +1 -1
  353. package/dist/components/Calendar/Calendar.js.map +1 -1
  354. package/dist/components/Calendar/Calendar.module.cjs.map +1 -1
  355. package/dist/components/Calendar/Calendar.module.js.map +1 -1
  356. package/dist/components/Card/Card.cjs.map +1 -1
  357. package/dist/components/Card/Card.js.map +1 -1
  358. package/dist/components/Card/Card.module.cjs.map +1 -1
  359. package/dist/components/Card/Card.module.js.map +1 -1
  360. package/dist/components/Carousel/Carousel.cjs.map +1 -1
  361. package/dist/components/Carousel/Carousel.js.map +1 -1
  362. package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
  363. package/dist/components/Carousel/Carousel.module.js.map +1 -1
  364. package/dist/components/Center/Center.cjs.map +1 -1
  365. package/dist/components/Center/Center.js.map +1 -1
  366. package/dist/components/Center/Center.module.cjs.map +1 -1
  367. package/dist/components/Center/Center.module.js.map +1 -1
  368. package/dist/components/Chat/Chat.cjs.map +1 -1
  369. package/dist/components/Chat/Chat.js.map +1 -1
  370. package/dist/components/Chat/Chat.module.cjs.map +1 -1
  371. package/dist/components/Chat/Chat.module.js.map +1 -1
  372. package/dist/components/Chat/ChatActionsMenu.cjs.map +1 -1
  373. package/dist/components/Chat/ChatActionsMenu.js.map +1 -1
  374. package/dist/components/Chat/ChatAttachments.cjs.map +1 -1
  375. package/dist/components/Chat/ChatAttachments.js.map +1 -1
  376. package/dist/components/Chat/ChatBubble.cjs.map +1 -1
  377. package/dist/components/Chat/ChatBubble.js.map +1 -1
  378. package/dist/components/Chat/ChatComposer.cjs.map +1 -1
  379. package/dist/components/Chat/ChatComposer.js.map +1 -1
  380. package/dist/components/Chat/chat-groups.cjs +1 -1
  381. package/dist/components/Chat/chat-groups.cjs.map +1 -1
  382. package/dist/components/Chat/chat-groups.js +2 -6
  383. package/dist/components/Chat/chat-groups.js.map +1 -1
  384. package/dist/components/Chat/chat-receipt.cjs.map +1 -1
  385. package/dist/components/Chat/chat-receipt.js.map +1 -1
  386. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  387. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  388. package/dist/components/Checkbox/Checkbox.module.cjs.map +1 -1
  389. package/dist/components/Checkbox/Checkbox.module.js.map +1 -1
  390. package/dist/components/ChipInput/ChipInput.cjs +1 -1
  391. package/dist/components/ChipInput/ChipInput.cjs.map +1 -1
  392. package/dist/components/ChipInput/ChipInput.js +2 -12
  393. package/dist/components/ChipInput/ChipInput.js.map +1 -1
  394. package/dist/components/ChipInput/ChipInput.module.cjs.map +1 -1
  395. package/dist/components/ChipInput/ChipInput.module.js.map +1 -1
  396. package/dist/components/ClickOutside/ClickOutside.cjs.map +1 -1
  397. package/dist/components/ClickOutside/ClickOutside.js.map +1 -1
  398. package/dist/components/CodeBlock/CodeBlock.cjs +1 -1
  399. package/dist/components/CodeBlock/CodeBlock.cjs.map +1 -1
  400. package/dist/components/CodeBlock/CodeBlock.js +1 -1
  401. package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
  402. package/dist/components/CodeBlock/CodeBlock.module.cjs.map +1 -1
  403. package/dist/components/CodeBlock/CodeBlock.module.js.map +1 -1
  404. package/dist/components/CodeBlock/tokenize.cjs +1 -1
  405. package/dist/components/CodeBlock/tokenize.cjs.map +1 -1
  406. package/dist/components/CodeBlock/tokenize.js +54 -25
  407. package/dist/components/CodeBlock/tokenize.js.map +1 -1
  408. package/dist/components/Collapsible/Collapsible.cjs.map +1 -1
  409. package/dist/components/Collapsible/Collapsible.js.map +1 -1
  410. package/dist/components/Collapsible/Collapsible.module.cjs.map +1 -1
  411. package/dist/components/Collapsible/Collapsible.module.js.map +1 -1
  412. package/dist/components/Combobox/Combobox.cjs.map +1 -1
  413. package/dist/components/Combobox/Combobox.js.map +1 -1
  414. package/dist/components/Combobox/Combobox.module.cjs.map +1 -1
  415. package/dist/components/Combobox/Combobox.module.js.map +1 -1
  416. package/dist/components/Combobox/use-listbox-dismiss.cjs.map +1 -1
  417. package/dist/components/Combobox/use-listbox-dismiss.js.map +1 -1
  418. package/dist/components/Command/Command.cjs +1 -1
  419. package/dist/components/Command/Command.cjs.map +1 -1
  420. package/dist/components/Command/Command.js +4 -11
  421. package/dist/components/Command/Command.js.map +1 -1
  422. package/dist/components/Command/Command.module.cjs.map +1 -1
  423. package/dist/components/Command/Command.module.js.map +1 -1
  424. package/dist/components/ConditionalWrapper/ConditionalWrapper.cjs.map +1 -1
  425. package/dist/components/ConditionalWrapper/ConditionalWrapper.js.map +1 -1
  426. package/dist/components/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
  427. package/dist/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
  428. package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
  429. package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -1
  430. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  431. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  432. package/dist/components/ContextMenu/ContextMenu.module.cjs.map +1 -1
  433. package/dist/components/ContextMenu/ContextMenu.module.js.map +1 -1
  434. package/dist/components/CopyButton/CopyButton.cjs.map +1 -1
  435. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  436. package/dist/components/CopyButton/CopyButton.module.cjs.map +1 -1
  437. package/dist/components/CopyButton/CopyButton.module.js.map +1 -1
  438. package/dist/components/DataList/DataList.cjs.map +1 -1
  439. package/dist/components/DataList/DataList.js.map +1 -1
  440. package/dist/components/DataList/DataList.module.cjs.map +1 -1
  441. package/dist/components/DataList/DataList.module.js.map +1 -1
  442. package/dist/components/DataTable/DataTable.cjs +1 -1
  443. package/dist/components/DataTable/DataTable.cjs.map +1 -1
  444. package/dist/components/DataTable/DataTable.js +6 -14
  445. package/dist/components/DataTable/DataTable.js.map +1 -1
  446. package/dist/components/DataTable/DataTable.module.cjs.map +1 -1
  447. package/dist/components/DataTable/DataTable.module.js.map +1 -1
  448. package/dist/components/DataTable/EditableCell.cjs +1 -1
  449. package/dist/components/DataTable/EditableCell.cjs.map +1 -1
  450. package/dist/components/DataTable/EditableCell.js +1 -9
  451. package/dist/components/DataTable/EditableCell.js.map +1 -1
  452. package/dist/components/DataTable/LoadingRows.cjs.map +1 -1
  453. package/dist/components/DataTable/LoadingRows.js.map +1 -1
  454. package/dist/components/DataTable/edit-labels.cjs.map +1 -1
  455. package/dist/components/DataTable/edit-labels.js.map +1 -1
  456. package/dist/components/DataTable/use-dev-warnings.cjs.map +1 -1
  457. package/dist/components/DataTable/use-dev-warnings.js.map +1 -1
  458. package/dist/components/DatePicker/DatePicker.cjs.map +1 -1
  459. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  460. package/dist/components/DateRangePicker/DateRangePicker.cjs.map +1 -1
  461. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  462. package/dist/components/DateRangePicker/DateRangePicker.module.cjs.map +1 -1
  463. package/dist/components/DateRangePicker/DateRangePicker.module.js.map +1 -1
  464. package/dist/components/DescriptionList/DescriptionList.cjs.map +1 -1
  465. package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
  466. package/dist/components/DescriptionList/DescriptionList.module.cjs.map +1 -1
  467. package/dist/components/DescriptionList/DescriptionList.module.js.map +1 -1
  468. package/dist/components/Divider/Divider.cjs.map +1 -1
  469. package/dist/components/Divider/Divider.js.map +1 -1
  470. package/dist/components/Divider/Divider.module.cjs.map +1 -1
  471. package/dist/components/Divider/Divider.module.js.map +1 -1
  472. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  473. package/dist/components/Drawer/Drawer.js.map +1 -1
  474. package/dist/components/Drawer/Drawer.module.cjs.map +1 -1
  475. package/dist/components/Drawer/Drawer.module.js.map +1 -1
  476. package/dist/components/DropdownMenu/DropdownMenu.cjs +1 -1
  477. package/dist/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
  478. package/dist/components/DropdownMenu/DropdownMenu.js +2 -14
  479. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
  480. package/dist/components/DropdownMenu/DropdownMenu.module.cjs.map +1 -1
  481. package/dist/components/DropdownMenu/DropdownMenu.module.js.map +1 -1
  482. package/dist/components/Dropzone/Dropzone.cjs.map +1 -1
  483. package/dist/components/Dropzone/Dropzone.js.map +1 -1
  484. package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
  485. package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
  486. package/dist/components/EmptyState/EmptyState.cjs.map +1 -1
  487. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  488. package/dist/components/EmptyState/EmptyState.module.cjs.map +1 -1
  489. package/dist/components/EmptyState/EmptyState.module.js.map +1 -1
  490. package/dist/components/ErrorState/ErrorState.cjs.map +1 -1
  491. package/dist/components/ErrorState/ErrorState.js.map +1 -1
  492. package/dist/components/ErrorState/ErrorState.module.cjs.map +1 -1
  493. package/dist/components/ErrorState/ErrorState.module.js.map +1 -1
  494. package/dist/components/ErrorText/ErrorText.cjs.map +1 -1
  495. package/dist/components/ErrorText/ErrorText.js.map +1 -1
  496. package/dist/components/ErrorText/ErrorText.module.cjs.map +1 -1
  497. package/dist/components/ErrorText/ErrorText.module.js.map +1 -1
  498. package/dist/components/FileUpload/FileUpload.cjs +1 -1
  499. package/dist/components/FileUpload/FileUpload.cjs.map +1 -1
  500. package/dist/components/FileUpload/FileUpload.js +7 -17
  501. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  502. package/dist/components/FileUpload/FileUpload.module.cjs.map +1 -1
  503. package/dist/components/FileUpload/FileUpload.module.js.map +1 -1
  504. package/dist/components/FilterBar/FilterBar.cjs.map +1 -1
  505. package/dist/components/FilterBar/FilterBar.js.map +1 -1
  506. package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
  507. package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
  508. package/dist/components/FilterBar/filter-apply.cjs.map +1 -1
  509. package/dist/components/FilterBar/filter-apply.js.map +1 -1
  510. package/dist/components/FilterBar/filter-model.cjs.map +1 -1
  511. package/dist/components/FilterBar/filter-model.js.map +1 -1
  512. package/dist/components/FilterBar/filter-query.cjs +1 -1
  513. package/dist/components/FilterBar/filter-query.cjs.map +1 -1
  514. package/dist/components/FilterBar/filter-query.js +2 -5
  515. package/dist/components/FilterBar/filter-query.js.map +1 -1
  516. package/dist/components/FilterPanel/FilterPanel.cjs.map +1 -1
  517. package/dist/components/FilterPanel/FilterPanel.js.map +1 -1
  518. package/dist/components/FilterPanel/FilterPanel.module.cjs.map +1 -1
  519. package/dist/components/FilterPanel/FilterPanel.module.js.map +1 -1
  520. package/dist/components/FloatingActionButton/FloatingActionButton.cjs.map +1 -1
  521. package/dist/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
  522. package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
  523. package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
  524. package/dist/components/For/For.cjs.map +1 -1
  525. package/dist/components/For/For.js.map +1 -1
  526. package/dist/components/Form/Form.cjs.map +1 -1
  527. package/dist/components/Form/Form.js.map +1 -1
  528. package/dist/components/Form/Form.module.cjs.map +1 -1
  529. package/dist/components/Form/Form.module.js.map +1 -1
  530. package/dist/components/HoverCard/HoverCard.cjs.map +1 -1
  531. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  532. package/dist/components/HoverCard/HoverCard.module.cjs.map +1 -1
  533. package/dist/components/HoverCard/HoverCard.module.js.map +1 -1
  534. package/dist/components/Image/Image.cjs.map +1 -1
  535. package/dist/components/Image/Image.js.map +1 -1
  536. package/dist/components/Image/Image.module.cjs.map +1 -1
  537. package/dist/components/Image/Image.module.js.map +1 -1
  538. package/dist/components/ImageCropper/ImageCropper.cjs +1 -1
  539. package/dist/components/ImageCropper/ImageCropper.cjs.map +1 -1
  540. package/dist/components/ImageCropper/ImageCropper.js +4 -8
  541. package/dist/components/ImageCropper/ImageCropper.js.map +1 -1
  542. package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
  543. package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
  544. package/dist/components/ImageCropper/crop-geometry.cjs.map +1 -1
  545. package/dist/components/ImageCropper/crop-geometry.js.map +1 -1
  546. package/dist/components/Input/Input.cjs.map +1 -1
  547. package/dist/components/Input/Input.js.map +1 -1
  548. package/dist/components/Input/Input.module.cjs.map +1 -1
  549. package/dist/components/Input/Input.module.js.map +1 -1
  550. package/dist/components/InstallBanner/InstallBanner.cjs.map +1 -1
  551. package/dist/components/InstallBanner/InstallBanner.js.map +1 -1
  552. package/dist/components/InstallBanner/InstallBanner.module.cjs.map +1 -1
  553. package/dist/components/InstallBanner/InstallBanner.module.js.map +1 -1
  554. package/dist/components/InstallButton/InstallButton.cjs.map +1 -1
  555. package/dist/components/InstallButton/InstallButton.js.map +1 -1
  556. package/dist/components/InstallButton/InstallButton.module.cjs.map +1 -1
  557. package/dist/components/InstallButton/InstallButton.module.js.map +1 -1
  558. package/dist/components/InstallButton/install-hints.cjs.map +1 -1
  559. package/dist/components/InstallButton/install-hints.js.map +1 -1
  560. package/dist/components/Kanban/Kanban.cjs.map +1 -1
  561. package/dist/components/Kanban/Kanban.js.map +1 -1
  562. package/dist/components/Kanban/Kanban.module.cjs.map +1 -1
  563. package/dist/components/Kanban/Kanban.module.js.map +1 -1
  564. package/dist/components/Kbd/Kbd.cjs.map +1 -1
  565. package/dist/components/Kbd/Kbd.js.map +1 -1
  566. package/dist/components/Kbd/Kbd.module.cjs.map +1 -1
  567. package/dist/components/Kbd/Kbd.module.js.map +1 -1
  568. package/dist/components/Label/Label.cjs.map +1 -1
  569. package/dist/components/Label/Label.js.map +1 -1
  570. package/dist/components/Label/Label.module.cjs.map +1 -1
  571. package/dist/components/Label/Label.module.js.map +1 -1
  572. package/dist/components/Layout/Layout.cjs.map +1 -1
  573. package/dist/components/Layout/Layout.js.map +1 -1
  574. package/dist/components/Layout/Layout.module.cjs.map +1 -1
  575. package/dist/components/Layout/Layout.module.js.map +1 -1
  576. package/dist/components/Lightbox/Lightbox.cjs +1 -1
  577. package/dist/components/Lightbox/Lightbox.cjs.map +1 -1
  578. package/dist/components/Lightbox/Lightbox.js +1 -1
  579. package/dist/components/Lightbox/Lightbox.js.map +1 -1
  580. package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -1
  581. package/dist/components/Lightbox/Lightbox.module.js.map +1 -1
  582. package/dist/components/ListTile/ListTile.cjs.map +1 -1
  583. package/dist/components/ListTile/ListTile.js.map +1 -1
  584. package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
  585. package/dist/components/ListTile/ListTile.module.js.map +1 -1
  586. package/dist/components/Markdown/Markdown.cjs.map +1 -1
  587. package/dist/components/Markdown/Markdown.js.map +1 -1
  588. package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
  589. package/dist/components/Markdown/Markdown.module.js.map +1 -1
  590. package/dist/components/Markdown/markdown-parse.cjs +6 -6
  591. package/dist/components/Markdown/markdown-parse.cjs.map +1 -1
  592. package/dist/components/Markdown/markdown-parse.js +94 -96
  593. package/dist/components/Markdown/markdown-parse.js.map +1 -1
  594. package/dist/components/Masonry/Masonry.cjs.map +1 -1
  595. package/dist/components/Masonry/Masonry.js.map +1 -1
  596. package/dist/components/Masonry/Masonry.module.cjs.map +1 -1
  597. package/dist/components/Masonry/Masonry.module.js.map +1 -1
  598. package/dist/components/Masonry/masonry-layout.cjs.map +1 -1
  599. package/dist/components/Masonry/masonry-layout.js.map +1 -1
  600. package/dist/components/Menubar/Menubar.cjs.map +1 -1
  601. package/dist/components/Menubar/Menubar.js.map +1 -1
  602. package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
  603. package/dist/components/Menubar/Menubar.module.js.map +1 -1
  604. package/dist/components/Modal/Modal.cjs.map +1 -1
  605. package/dist/components/Modal/Modal.js.map +1 -1
  606. package/dist/components/Modal/Modal.module.cjs.map +1 -1
  607. package/dist/components/Modal/Modal.module.js.map +1 -1
  608. package/dist/components/ModalsManager/ModalsManager.cjs.map +1 -1
  609. package/dist/components/ModalsManager/ModalsManager.js.map +1 -1
  610. package/dist/components/ModalsManager/ModalsManager.module.cjs.map +1 -1
  611. package/dist/components/ModalsManager/ModalsManager.module.js.map +1 -1
  612. package/dist/components/Money/Money.cjs.map +1 -1
  613. package/dist/components/Money/Money.js.map +1 -1
  614. package/dist/components/MultiSelect/MultiSelect.cjs.map +1 -1
  615. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  616. package/dist/components/MultiSelect/MultiSelect.module.cjs.map +1 -1
  617. package/dist/components/MultiSelect/MultiSelect.module.js.map +1 -1
  618. package/dist/components/NProgress/NProgress.cjs.map +1 -1
  619. package/dist/components/NProgress/NProgress.js.map +1 -1
  620. package/dist/components/NProgress/NProgress.module.cjs.map +1 -1
  621. package/dist/components/NProgress/NProgress.module.js.map +1 -1
  622. package/dist/components/Navbar/Navbar.cjs.map +1 -1
  623. package/dist/components/Navbar/Navbar.js.map +1 -1
  624. package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
  625. package/dist/components/Navbar/Navbar.module.js.map +1 -1
  626. package/dist/components/NavigationMenu/NavigationMenu.cjs.map +1 -1
  627. package/dist/components/NavigationMenu/NavigationMenu.js.map +1 -1
  628. package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
  629. package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
  630. package/dist/components/NavigationRail/NavigationRail.cjs.map +1 -1
  631. package/dist/components/NavigationRail/NavigationRail.js.map +1 -1
  632. package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
  633. package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
  634. package/dist/components/NotificationCenter/NotificationCenter.cjs.map +1 -1
  635. package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -1
  636. package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
  637. package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
  638. package/dist/components/NotificationCenter/use-notification-inbox.cjs.map +1 -1
  639. package/dist/components/NotificationCenter/use-notification-inbox.js.map +1 -1
  640. package/dist/components/OfflineIndicator/OfflineIndicator.cjs.map +1 -1
  641. package/dist/components/OfflineIndicator/OfflineIndicator.js.map +1 -1
  642. package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs.map +1 -1
  643. package/dist/components/OfflineIndicator/OfflineIndicator.module.js.map +1 -1
  644. package/dist/components/Page/Page.cjs.map +1 -1
  645. package/dist/components/Page/Page.js.map +1 -1
  646. package/dist/components/Page/Page.module.cjs.map +1 -1
  647. package/dist/components/Page/Page.module.js.map +1 -1
  648. package/dist/components/Pagination/Pagination.cjs.map +1 -1
  649. package/dist/components/Pagination/Pagination.js.map +1 -1
  650. package/dist/components/Pagination/Pagination.module.cjs.map +1 -1
  651. package/dist/components/Pagination/Pagination.module.js.map +1 -1
  652. package/dist/components/PasswordInput/PasswordInput.cjs.map +1 -1
  653. package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
  654. package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
  655. package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
  656. package/dist/components/PinInput/PinInput.cjs.map +1 -1
  657. package/dist/components/PinInput/PinInput.js.map +1 -1
  658. package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
  659. package/dist/components/PinInput/PinInput.module.js.map +1 -1
  660. package/dist/components/Popover/Popover.cjs.map +1 -1
  661. package/dist/components/Popover/Popover.js.map +1 -1
  662. package/dist/components/Popover/Popover.module.cjs.map +1 -1
  663. package/dist/components/Popover/Popover.module.js.map +1 -1
  664. package/dist/components/Portal/Portal.cjs.map +1 -1
  665. package/dist/components/Portal/Portal.js.map +1 -1
  666. package/dist/components/Portal/anchor-position.cjs.map +1 -1
  667. package/dist/components/Portal/anchor-position.js.map +1 -1
  668. package/dist/components/Portal/escape-layer.cjs.map +1 -1
  669. package/dist/components/Portal/escape-layer.js.map +1 -1
  670. package/dist/components/Portal/portal-host.cjs.map +1 -1
  671. package/dist/components/Portal/portal-host.js.map +1 -1
  672. package/dist/components/Portal/tab-bridge.cjs +1 -1
  673. package/dist/components/Portal/tab-bridge.cjs.map +1 -1
  674. package/dist/components/Portal/tab-bridge.js +1 -5
  675. package/dist/components/Portal/tab-bridge.js.map +1 -1
  676. package/dist/components/Progress/Progress.cjs.map +1 -1
  677. package/dist/components/Progress/Progress.js.map +1 -1
  678. package/dist/components/Progress/Progress.module.cjs.map +1 -1
  679. package/dist/components/Progress/Progress.module.js.map +1 -1
  680. package/dist/components/QRCode/QRCode.cjs.map +1 -1
  681. package/dist/components/QRCode/QRCode.js.map +1 -1
  682. package/dist/components/QRCode/QRCode.module.cjs.map +1 -1
  683. package/dist/components/QRCode/QRCode.module.js.map +1 -1
  684. package/dist/components/QRCode/qr-encode.cjs +1 -1
  685. package/dist/components/QRCode/qr-encode.cjs.map +1 -1
  686. package/dist/components/QRCode/qr-encode.js +7 -13
  687. package/dist/components/QRCode/qr-encode.js.map +1 -1
  688. package/dist/components/QRCode/qr-tables.cjs.map +1 -1
  689. package/dist/components/QRCode/qr-tables.js.map +1 -1
  690. package/dist/components/Radio/Radio.cjs.map +1 -1
  691. package/dist/components/Radio/Radio.js.map +1 -1
  692. package/dist/components/Radio/Radio.module.cjs.map +1 -1
  693. package/dist/components/Radio/Radio.module.js.map +1 -1
  694. package/dist/components/RangeSlider/RangeSlider.cjs.map +1 -1
  695. package/dist/components/RangeSlider/RangeSlider.js.map +1 -1
  696. package/dist/components/RangeSlider/RangeSlider.module.cjs.map +1 -1
  697. package/dist/components/RangeSlider/RangeSlider.module.js.map +1 -1
  698. package/dist/components/RatingStars/RatingStars.cjs.map +1 -1
  699. package/dist/components/RatingStars/RatingStars.js.map +1 -1
  700. package/dist/components/RatingStars/RatingStars.module.cjs.map +1 -1
  701. package/dist/components/RatingStars/RatingStars.module.js.map +1 -1
  702. package/dist/components/RefreshIndicator/RefreshIndicator.cjs +1 -1
  703. package/dist/components/RefreshIndicator/RefreshIndicator.cjs.map +1 -1
  704. package/dist/components/RefreshIndicator/RefreshIndicator.js +10 -18
  705. package/dist/components/RefreshIndicator/RefreshIndicator.js.map +1 -1
  706. package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs.map +1 -1
  707. package/dist/components/RefreshIndicator/RefreshIndicator.module.js.map +1 -1
  708. package/dist/components/RelativeTime/RelativeTime.cjs.map +1 -1
  709. package/dist/components/RelativeTime/RelativeTime.js.map +1 -1
  710. package/dist/components/Resizable/Resizable.cjs +1 -1
  711. package/dist/components/Resizable/Resizable.cjs.map +1 -1
  712. package/dist/components/Resizable/Resizable.js +1 -9
  713. package/dist/components/Resizable/Resizable.js.map +1 -1
  714. package/dist/components/Resizable/Resizable.module.cjs.map +1 -1
  715. package/dist/components/Resizable/Resizable.module.js.map +1 -1
  716. package/dist/components/Responsive/Responsive.cjs.map +1 -1
  717. package/dist/components/Responsive/Responsive.js.map +1 -1
  718. package/dist/components/Reveal/Reveal.cjs.map +1 -1
  719. package/dist/components/Reveal/Reveal.js.map +1 -1
  720. package/dist/components/Reveal/Reveal.module.cjs.map +1 -1
  721. package/dist/components/Reveal/Reveal.module.js.map +1 -1
  722. package/dist/components/Reveal/reveal-threshold.cjs.map +1 -1
  723. package/dist/components/Reveal/reveal-threshold.js.map +1 -1
  724. package/dist/components/SafeArea/SafeArea.cjs.map +1 -1
  725. package/dist/components/SafeArea/SafeArea.js.map +1 -1
  726. package/dist/components/SafeArea/SafeArea.module.cjs.map +1 -1
  727. package/dist/components/SafeArea/SafeArea.module.js.map +1 -1
  728. package/dist/components/Scheduler/Scheduler.cjs.map +1 -1
  729. package/dist/components/Scheduler/Scheduler.js.map +1 -1
  730. package/dist/components/Scheduler/Scheduler.module.cjs.map +1 -1
  731. package/dist/components/Scheduler/Scheduler.module.js.map +1 -1
  732. package/dist/components/Scheduler/scheduler-layout.cjs.map +1 -1
  733. package/dist/components/Scheduler/scheduler-layout.js.map +1 -1
  734. package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
  735. package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
  736. package/dist/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
  737. package/dist/components/ScrollArea/ScrollArea.module.js.map +1 -1
  738. package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
  739. package/dist/components/SearchBar/SearchBar.js.map +1 -1
  740. package/dist/components/SearchBar/SearchBar.module.cjs.map +1 -1
  741. package/dist/components/SearchBar/SearchBar.module.js.map +1 -1
  742. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  743. package/dist/components/SectionHeader/SectionHeader.js.map +1 -1
  744. package/dist/components/SectionHeader/SectionHeader.module.cjs.map +1 -1
  745. package/dist/components/SectionHeader/SectionHeader.module.js.map +1 -1
  746. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  747. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  748. package/dist/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
  749. package/dist/components/SegmentedControl/SegmentedControl.module.js.map +1 -1
  750. package/dist/components/Select/CaretIcon.cjs.map +1 -1
  751. package/dist/components/Select/CaretIcon.js.map +1 -1
  752. package/dist/components/Select/Select.cjs.map +1 -1
  753. package/dist/components/Select/Select.js.map +1 -1
  754. package/dist/components/Select/Select.module.cjs.map +1 -1
  755. package/dist/components/Select/Select.module.js.map +1 -1
  756. package/dist/components/Select/options.cjs.map +1 -1
  757. package/dist/components/Select/options.js.map +1 -1
  758. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  759. package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
  760. package/dist/components/Sidebar/Sidebar.js +13 -23
  761. package/dist/components/Sidebar/Sidebar.js.map +1 -1
  762. package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
  763. package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
  764. package/dist/components/Sidebar/SidebarEntry.cjs.map +1 -1
  765. package/dist/components/Sidebar/SidebarEntry.js.map +1 -1
  766. package/dist/components/Sidebar/active-nav-key.cjs.map +1 -1
  767. package/dist/components/Sidebar/active-nav-key.js.map +1 -1
  768. package/dist/components/SignaturePad/SignaturePad.cjs +1 -1
  769. package/dist/components/SignaturePad/SignaturePad.cjs.map +1 -1
  770. package/dist/components/SignaturePad/SignaturePad.js +1 -5
  771. package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
  772. package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -1
  773. package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -1
  774. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  775. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  776. package/dist/components/Skeleton/Skeleton.module.cjs.map +1 -1
  777. package/dist/components/Skeleton/Skeleton.module.js.map +1 -1
  778. package/dist/components/Slider/Slider.cjs.map +1 -1
  779. package/dist/components/Slider/Slider.js.map +1 -1
  780. package/dist/components/Slider/Slider.module.cjs.map +1 -1
  781. package/dist/components/Slider/Slider.module.js.map +1 -1
  782. package/dist/components/Spacer/Spacer.cjs.map +1 -1
  783. package/dist/components/Spacer/Spacer.js.map +1 -1
  784. package/dist/components/Spacer/Spacer.module.cjs.map +1 -1
  785. package/dist/components/Spacer/Spacer.module.js.map +1 -1
  786. package/dist/components/Sparkline/Sparkline.cjs.map +1 -1
  787. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  788. package/dist/components/Sparkline/Sparkline.module.cjs.map +1 -1
  789. package/dist/components/Sparkline/Sparkline.module.js.map +1 -1
  790. package/dist/components/Sparkline/sparkline-geometry.cjs.map +1 -1
  791. package/dist/components/Sparkline/sparkline-geometry.js.map +1 -1
  792. package/dist/components/Spinner/Spinner.cjs.map +1 -1
  793. package/dist/components/Spinner/Spinner.js.map +1 -1
  794. package/dist/components/Spinner/Spinner.module.cjs.map +1 -1
  795. package/dist/components/Spinner/Spinner.module.js.map +1 -1
  796. package/dist/components/Stat/Stat.cjs.map +1 -1
  797. package/dist/components/Stat/Stat.js.map +1 -1
  798. package/dist/components/Stat/Stat.module.cjs.map +1 -1
  799. package/dist/components/Stat/Stat.module.js.map +1 -1
  800. package/dist/components/Stepper/Stepper.cjs.map +1 -1
  801. package/dist/components/Stepper/Stepper.js.map +1 -1
  802. package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
  803. package/dist/components/Stepper/Stepper.module.js.map +1 -1
  804. package/dist/components/StepperInput/StepperInput.cjs.map +1 -1
  805. package/dist/components/StepperInput/StepperInput.js.map +1 -1
  806. package/dist/components/StepperInput/StepperInput.module.cjs.map +1 -1
  807. package/dist/components/StepperInput/StepperInput.module.js.map +1 -1
  808. package/dist/components/Switch/Switch.cjs.map +1 -1
  809. package/dist/components/Switch/Switch.js.map +1 -1
  810. package/dist/components/Switch/Switch.module.cjs.map +1 -1
  811. package/dist/components/Switch/Switch.module.js.map +1 -1
  812. package/dist/components/SyncStatusBadge/SyncStatusBadge.cjs.map +1 -1
  813. package/dist/components/SyncStatusBadge/SyncStatusBadge.js.map +1 -1
  814. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs.map +1 -1
  815. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js.map +1 -1
  816. package/dist/components/Table/Table.cjs.map +1 -1
  817. package/dist/components/Table/Table.js.map +1 -1
  818. package/dist/components/Table/Table.module.cjs.map +1 -1
  819. package/dist/components/Table/Table.module.js.map +1 -1
  820. package/dist/components/Tabs/Tabs.cjs.map +1 -1
  821. package/dist/components/Tabs/Tabs.js.map +1 -1
  822. package/dist/components/Tabs/Tabs.module.cjs.map +1 -1
  823. package/dist/components/Tabs/Tabs.module.js.map +1 -1
  824. package/dist/components/Tag/Tag.cjs.map +1 -1
  825. package/dist/components/Tag/Tag.js.map +1 -1
  826. package/dist/components/Tag/Tag.module.cjs.map +1 -1
  827. package/dist/components/Tag/Tag.module.js.map +1 -1
  828. package/dist/components/Textarea/Textarea.cjs.map +1 -1
  829. package/dist/components/Textarea/Textarea.js.map +1 -1
  830. package/dist/components/Textarea/Textarea.module.cjs.map +1 -1
  831. package/dist/components/Textarea/Textarea.module.js.map +1 -1
  832. package/dist/components/TimePicker/TimePicker.cjs.map +1 -1
  833. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  834. package/dist/components/TimePicker/TimePicker.module.cjs.map +1 -1
  835. package/dist/components/TimePicker/TimePicker.module.js.map +1 -1
  836. package/dist/components/Timeline/Timeline.cjs.map +1 -1
  837. package/dist/components/Timeline/Timeline.js.map +1 -1
  838. package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
  839. package/dist/components/Timeline/Timeline.module.js.map +1 -1
  840. package/dist/components/Toast/Toast.module.cjs.map +1 -1
  841. package/dist/components/Toast/Toast.module.js.map +1 -1
  842. package/dist/components/Toast/ToastProvider.cjs.map +1 -1
  843. package/dist/components/Toast/ToastProvider.js.map +1 -1
  844. package/dist/components/Toggle/Toggle.cjs.map +1 -1
  845. package/dist/components/Toggle/Toggle.js.map +1 -1
  846. package/dist/components/Toggle/Toggle.module.cjs.map +1 -1
  847. package/dist/components/Toggle/Toggle.module.js.map +1 -1
  848. package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
  849. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  850. package/dist/components/ToggleGroup/ToggleGroup.module.cjs.map +1 -1
  851. package/dist/components/ToggleGroup/ToggleGroup.module.js.map +1 -1
  852. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  853. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  854. package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -1
  855. package/dist/components/Tooltip/Tooltip.module.js.map +1 -1
  856. package/dist/components/Tour/Tour.cjs +1 -1
  857. package/dist/components/Tour/Tour.cjs.map +1 -1
  858. package/dist/components/Tour/Tour.js +1 -5
  859. package/dist/components/Tour/Tour.js.map +1 -1
  860. package/dist/components/Tour/Tour.module.cjs.map +1 -1
  861. package/dist/components/Tour/Tour.module.js.map +1 -1
  862. package/dist/components/Tour/tour-position.cjs.map +1 -1
  863. package/dist/components/Tour/tour-position.js.map +1 -1
  864. package/dist/components/Transfer/Transfer.cjs.map +1 -1
  865. package/dist/components/Transfer/Transfer.js.map +1 -1
  866. package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
  867. package/dist/components/Transfer/Transfer.module.js.map +1 -1
  868. package/dist/components/Transfer/transfer-state.cjs.map +1 -1
  869. package/dist/components/Transfer/transfer-state.js.map +1 -1
  870. package/dist/components/TreeView/TreeView.cjs.map +1 -1
  871. package/dist/components/TreeView/TreeView.js.map +1 -1
  872. package/dist/components/TreeView/TreeView.module.cjs.map +1 -1
  873. package/dist/components/TreeView/TreeView.module.js.map +1 -1
  874. package/dist/components/TruncateText/TruncateText.cjs.map +1 -1
  875. package/dist/components/TruncateText/TruncateText.js.map +1 -1
  876. package/dist/components/TruncateText/TruncateText.module.cjs.map +1 -1
  877. package/dist/components/TruncateText/TruncateText.module.js.map +1 -1
  878. package/dist/components/UpdatePrompt/UpdatePrompt.cjs.map +1 -1
  879. package/dist/components/UpdatePrompt/UpdatePrompt.js.map +1 -1
  880. package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs.map +1 -1
  881. package/dist/components/UpdatePrompt/UpdatePrompt.module.js.map +1 -1
  882. package/dist/components/VideoPlayer/VideoPlayer.cjs +1 -1
  883. package/dist/components/VideoPlayer/VideoPlayer.cjs.map +1 -1
  884. package/dist/components/VideoPlayer/VideoPlayer.js +1 -7
  885. package/dist/components/VideoPlayer/VideoPlayer.js.map +1 -1
  886. package/dist/components/VideoPlayer/VideoPlayer.module.cjs.map +1 -1
  887. package/dist/components/VideoPlayer/VideoPlayer.module.js.map +1 -1
  888. package/dist/components/VideoPlayer/playback-rates.cjs.map +1 -1
  889. package/dist/components/VideoPlayer/playback-rates.js.map +1 -1
  890. package/dist/components/VirtualList/VirtualList.cjs.map +1 -1
  891. package/dist/components/VirtualList/VirtualList.js.map +1 -1
  892. package/dist/components/VirtualList/VirtualList.module.cjs.map +1 -1
  893. package/dist/components/VirtualList/VirtualList.module.js.map +1 -1
  894. package/dist/components/VirtualTable/VirtualTable.cjs.map +1 -1
  895. package/dist/components/VirtualTable/VirtualTable.js.map +1 -1
  896. package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
  897. package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
  898. package/dist/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
  899. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  900. package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs.map +1 -1
  901. package/dist/components/VisuallyHidden/VisuallyHidden.module.js.map +1 -1
  902. package/dist/components/Wizard/Wizard.cjs +1 -1
  903. package/dist/components/Wizard/Wizard.cjs.map +1 -1
  904. package/dist/components/Wizard/Wizard.js +4 -11
  905. package/dist/components/Wizard/Wizard.js.map +1 -1
  906. package/dist/components/Wizard/Wizard.module.cjs.map +1 -1
  907. package/dist/components/Wizard/Wizard.module.js.map +1 -1
  908. package/dist/data/create-data-provider.cjs.map +1 -1
  909. package/dist/data/create-data-provider.js.map +1 -1
  910. package/dist/data/data-provider-context.cjs.map +1 -1
  911. package/dist/data/data-provider-context.js.map +1 -1
  912. package/dist/data/use-resource.cjs.map +1 -1
  913. package/dist/data/use-resource.js.map +1 -1
  914. package/dist/editor/RichTextEditor.cjs.map +1 -1
  915. package/dist/editor/RichTextEditor.js.map +1 -1
  916. package/dist/editor/RichTextEditor.module.cjs.map +1 -1
  917. package/dist/editor/RichTextEditor.module.js.map +1 -1
  918. package/dist/editor.js +1 -2
  919. package/dist/error-boundary/ErrorBoundary.cjs.map +1 -1
  920. package/dist/error-boundary/ErrorBoundary.js.map +1 -1
  921. package/dist/error-boundary/use-error-handler.cjs.map +1 -1
  922. package/dist/error-boundary/use-error-handler.js.map +1 -1
  923. package/dist/feature-flags/FeatureFlagsProvider.cjs.map +1 -1
  924. package/dist/feature-flags/FeatureFlagsProvider.js.map +1 -1
  925. package/dist/feature-flags/growthbook-adapter.cjs.map +1 -1
  926. package/dist/feature-flags/growthbook-adapter.js.map +1 -1
  927. package/dist/feature-flags/in-memory-adapter.cjs.map +1 -1
  928. package/dist/feature-flags/in-memory-adapter.js.map +1 -1
  929. package/dist/feature-flags/launchdarkly-adapter.cjs.map +1 -1
  930. package/dist/feature-flags/launchdarkly-adapter.js.map +1 -1
  931. package/dist/forms/FormField.cjs.map +1 -1
  932. package/dist/forms/FormField.js.map +1 -1
  933. package/dist/forms/br-validators.cjs.map +1 -1
  934. package/dist/forms/br-validators.js.map +1 -1
  935. package/dist/forms/masked-inputs.cjs.map +1 -1
  936. package/dist/forms/masked-inputs.js.map +1 -1
  937. package/dist/forms/use-viacep.cjs.map +1 -1
  938. package/dist/forms/use-viacep.js.map +1 -1
  939. package/dist/forms/use-zod-form.cjs.map +1 -1
  940. package/dist/forms/use-zod-form.js.map +1 -1
  941. package/dist/forms/validate-form.cjs.map +1 -1
  942. package/dist/forms/validate-form.js.map +1 -1
  943. package/dist/forms/zod-resolver.cjs.map +1 -1
  944. package/dist/forms/zod-resolver.js.map +1 -1
  945. package/dist/geo/TrajectoryMap.cjs.map +1 -1
  946. package/dist/geo/TrajectoryMap.js.map +1 -1
  947. package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
  948. package/dist/geo/TrajectoryMap.module.js.map +1 -1
  949. package/dist/geo/bounds.cjs.map +1 -1
  950. package/dist/geo/bounds.js.map +1 -1
  951. package/dist/geo/create-position-tracker.cjs +1 -1
  952. package/dist/geo/create-position-tracker.cjs.map +1 -1
  953. package/dist/geo/create-position-tracker.js +1 -7
  954. package/dist/geo/create-position-tracker.js.map +1 -1
  955. package/dist/geo/distance.cjs.map +1 -1
  956. package/dist/geo/distance.js.map +1 -1
  957. package/dist/geo/estimate.cjs.map +1 -1
  958. package/dist/geo/estimate.js.map +1 -1
  959. package/dist/geo/leaflet-map.cjs.map +1 -1
  960. package/dist/geo/leaflet-map.js.map +1 -1
  961. package/dist/geo/projection.cjs.map +1 -1
  962. package/dist/geo/projection.js.map +1 -1
  963. package/dist/geo/routing.cjs.map +1 -1
  964. package/dist/geo/routing.js.map +1 -1
  965. package/dist/geo/types.cjs.map +1 -1
  966. package/dist/geo/types.js.map +1 -1
  967. package/dist/geo/use-position-tracker.cjs.map +1 -1
  968. package/dist/geo/use-position-tracker.js.map +1 -1
  969. package/dist/hooks/pwa-env.cjs.map +1 -1
  970. package/dist/hooks/pwa-env.js.map +1 -1
  971. package/dist/hooks/tab-sequence.cjs.map +1 -1
  972. package/dist/hooks/tab-sequence.js.map +1 -1
  973. package/dist/hooks/use-announce.cjs +1 -1
  974. package/dist/hooks/use-announce.cjs.map +1 -1
  975. package/dist/hooks/use-announce.js +2 -2
  976. package/dist/hooks/use-announce.js.map +1 -1
  977. package/dist/hooks/use-async.cjs.map +1 -1
  978. package/dist/hooks/use-async.js.map +1 -1
  979. package/dist/hooks/use-before-install-prompt.cjs.map +1 -1
  980. package/dist/hooks/use-before-install-prompt.js.map +1 -1
  981. package/dist/hooks/use-breakpoint.cjs.map +1 -1
  982. package/dist/hooks/use-breakpoint.js.map +1 -1
  983. package/dist/hooks/use-click-outside.cjs.map +1 -1
  984. package/dist/hooks/use-click-outside.js.map +1 -1
  985. package/dist/hooks/use-client-filter.cjs.map +1 -1
  986. package/dist/hooks/use-client-filter.js.map +1 -1
  987. package/dist/hooks/use-clipboard.cjs.map +1 -1
  988. package/dist/hooks/use-clipboard.js.map +1 -1
  989. package/dist/hooks/use-countdown.cjs.map +1 -1
  990. package/dist/hooks/use-countdown.js.map +1 -1
  991. package/dist/hooks/use-counter.cjs.map +1 -1
  992. package/dist/hooks/use-counter.js.map +1 -1
  993. package/dist/hooks/use-debounce.cjs.map +1 -1
  994. package/dist/hooks/use-debounce.js.map +1 -1
  995. package/dist/hooks/use-deep-memo.cjs.map +1 -1
  996. package/dist/hooks/use-deep-memo.js.map +1 -1
  997. package/dist/hooks/use-disclosure.cjs.map +1 -1
  998. package/dist/hooks/use-disclosure.js.map +1 -1
  999. package/dist/hooks/use-document-title.cjs.map +1 -1
  1000. package/dist/hooks/use-document-title.js.map +1 -1
  1001. package/dist/hooks/use-document-visibility.cjs.map +1 -1
  1002. package/dist/hooks/use-document-visibility.js.map +1 -1
  1003. package/dist/hooks/use-draft-filters.cjs.map +1 -1
  1004. package/dist/hooks/use-draft-filters.js.map +1 -1
  1005. package/dist/hooks/use-event-listener.cjs.map +1 -1
  1006. package/dist/hooks/use-event-listener.js.map +1 -1
  1007. package/dist/hooks/use-favicon.cjs.map +1 -1
  1008. package/dist/hooks/use-favicon.js.map +1 -1
  1009. package/dist/hooks/use-focus-trap.cjs.map +1 -1
  1010. package/dist/hooks/use-focus-trap.js.map +1 -1
  1011. package/dist/hooks/use-fullscreen-element.cjs.map +1 -1
  1012. package/dist/hooks/use-fullscreen-element.js.map +1 -1
  1013. package/dist/hooks/use-fullscreen.cjs +1 -1
  1014. package/dist/hooks/use-fullscreen.cjs.map +1 -1
  1015. package/dist/hooks/use-fullscreen.js +7 -23
  1016. package/dist/hooks/use-fullscreen.js.map +1 -1
  1017. package/dist/hooks/use-geolocation.cjs.map +1 -1
  1018. package/dist/hooks/use-geolocation.js.map +1 -1
  1019. package/dist/hooks/use-hover.cjs.map +1 -1
  1020. package/dist/hooks/use-hover.js.map +1 -1
  1021. package/dist/hooks/use-idle.cjs.map +1 -1
  1022. package/dist/hooks/use-idle.js.map +1 -1
  1023. package/dist/hooks/use-install-prompt.cjs +1 -1
  1024. package/dist/hooks/use-install-prompt.cjs.map +1 -1
  1025. package/dist/hooks/use-install-prompt.js +1 -1
  1026. package/dist/hooks/use-install-prompt.js.map +1 -1
  1027. package/dist/hooks/use-intersection-observer.cjs.map +1 -1
  1028. package/dist/hooks/use-intersection-observer.js.map +1 -1
  1029. package/dist/hooks/use-interval.cjs.map +1 -1
  1030. package/dist/hooks/use-interval.js.map +1 -1
  1031. package/dist/hooks/use-is-first-render.cjs.map +1 -1
  1032. package/dist/hooks/use-is-first-render.js.map +1 -1
  1033. package/dist/hooks/use-keyboard-shortcut.cjs.map +1 -1
  1034. package/dist/hooks/use-keyboard-shortcut.js.map +1 -1
  1035. package/dist/hooks/use-latest-ref.cjs.map +1 -1
  1036. package/dist/hooks/use-latest-ref.js.map +1 -1
  1037. package/dist/hooks/use-list-state.cjs.map +1 -1
  1038. package/dist/hooks/use-list-state.js.map +1 -1
  1039. package/dist/hooks/use-local-storage.cjs +1 -1
  1040. package/dist/hooks/use-local-storage.cjs.map +1 -1
  1041. package/dist/hooks/use-local-storage.js +2 -5
  1042. package/dist/hooks/use-local-storage.js.map +1 -1
  1043. package/dist/hooks/use-long-press-handlers.cjs.map +1 -1
  1044. package/dist/hooks/use-long-press-handlers.js.map +1 -1
  1045. package/dist/hooks/use-long-press.cjs.map +1 -1
  1046. package/dist/hooks/use-long-press.js.map +1 -1
  1047. package/dist/hooks/use-map.cjs.map +1 -1
  1048. package/dist/hooks/use-map.js.map +1 -1
  1049. package/dist/hooks/use-media-devices.cjs.map +1 -1
  1050. package/dist/hooks/use-media-devices.js.map +1 -1
  1051. package/dist/hooks/use-media-permission.cjs +1 -1
  1052. package/dist/hooks/use-media-permission.cjs.map +1 -1
  1053. package/dist/hooks/use-media-permission.js +2 -5
  1054. package/dist/hooks/use-media-permission.js.map +1 -1
  1055. package/dist/hooks/use-media-query.cjs.map +1 -1
  1056. package/dist/hooks/use-media-query.js.map +1 -1
  1057. package/dist/hooks/use-object-url.cjs.map +1 -1
  1058. package/dist/hooks/use-object-url.js.map +1 -1
  1059. package/dist/hooks/use-online.cjs.map +1 -1
  1060. package/dist/hooks/use-online.js.map +1 -1
  1061. package/dist/hooks/use-pagination.cjs.map +1 -1
  1062. package/dist/hooks/use-pagination.js.map +1 -1
  1063. package/dist/hooks/use-previous.cjs.map +1 -1
  1064. package/dist/hooks/use-previous.js.map +1 -1
  1065. package/dist/hooks/use-push-to-talk.cjs.map +1 -1
  1066. package/dist/hooks/use-push-to-talk.js.map +1 -1
  1067. package/dist/hooks/use-queue.cjs.map +1 -1
  1068. package/dist/hooks/use-queue.js.map +1 -1
  1069. package/dist/hooks/use-resize-observer.cjs.map +1 -1
  1070. package/dist/hooks/use-resize-observer.js.map +1 -1
  1071. package/dist/hooks/use-scroll-lock.cjs.map +1 -1
  1072. package/dist/hooks/use-scroll-lock.js.map +1 -1
  1073. package/dist/hooks/use-scroll-overflow.cjs.map +1 -1
  1074. package/dist/hooks/use-scroll-overflow.js.map +1 -1
  1075. package/dist/hooks/use-service-worker-update.cjs.map +1 -1
  1076. package/dist/hooks/use-service-worker-update.js.map +1 -1
  1077. package/dist/hooks/use-set.cjs.map +1 -1
  1078. package/dist/hooks/use-set.js.map +1 -1
  1079. package/dist/hooks/use-sortable.cjs.map +1 -1
  1080. package/dist/hooks/use-sortable.js.map +1 -1
  1081. package/dist/hooks/use-stable-callback.cjs.map +1 -1
  1082. package/dist/hooks/use-stable-callback.js.map +1 -1
  1083. package/dist/hooks/use-storage-estimate.cjs.map +1 -1
  1084. package/dist/hooks/use-storage-estimate.js.map +1 -1
  1085. package/dist/hooks/use-throttle.cjs.map +1 -1
  1086. package/dist/hooks/use-throttle.js.map +1 -1
  1087. package/dist/hooks/use-timeout.cjs.map +1 -1
  1088. package/dist/hooks/use-timeout.js.map +1 -1
  1089. package/dist/hooks/use-toggle.cjs.map +1 -1
  1090. package/dist/hooks/use-toggle.js.map +1 -1
  1091. package/dist/hooks/use-typewriter.cjs.map +1 -1
  1092. package/dist/hooks/use-typewriter.js.map +1 -1
  1093. package/dist/hooks/use-window-size.cjs.map +1 -1
  1094. package/dist/hooks/use-window-size.js.map +1 -1
  1095. package/dist/http/api-client.cjs.map +1 -1
  1096. package/dist/http/api-client.js.map +1 -1
  1097. package/dist/http/build-url.cjs.map +1 -1
  1098. package/dist/http/build-url.js.map +1 -1
  1099. package/dist/http/credential-scope.cjs.map +1 -1
  1100. package/dist/http/credential-scope.js.map +1 -1
  1101. package/dist/http/csrf.cjs.map +1 -1
  1102. package/dist/http/csrf.js.map +1 -1
  1103. package/dist/http/decode-response.cjs.map +1 -1
  1104. package/dist/http/decode-response.js.map +1 -1
  1105. package/dist/http/describe-api-error.cjs.map +1 -1
  1106. package/dist/http/describe-api-error.js.map +1 -1
  1107. package/dist/http/errors.cjs.map +1 -1
  1108. package/dist/http/errors.js.map +1 -1
  1109. package/dist/http/idempotency.cjs.map +1 -1
  1110. package/dist/http/idempotency.js.map +1 -1
  1111. package/dist/http/parse-response.cjs.map +1 -1
  1112. package/dist/http/parse-response.js.map +1 -1
  1113. package/dist/http/resumable-upload.cjs +1 -1
  1114. package/dist/http/resumable-upload.cjs.map +1 -1
  1115. package/dist/http/resumable-upload.js +141 -105
  1116. package/dist/http/resumable-upload.js.map +1 -1
  1117. package/dist/http/retry.cjs +1 -1
  1118. package/dist/http/retry.cjs.map +1 -1
  1119. package/dist/http/retry.js +5 -6
  1120. package/dist/http/retry.js.map +1 -1
  1121. package/dist/http/timeout.cjs.map +1 -1
  1122. package/dist/http/timeout.js.map +1 -1
  1123. package/dist/http/upload-with-progress.cjs +1 -1
  1124. package/dist/http/upload-with-progress.cjs.map +1 -1
  1125. package/dist/http/upload-with-progress.js +2 -7
  1126. package/dist/http/upload-with-progress.js.map +1 -1
  1127. package/dist/http/use-describe-api-error.cjs.map +1 -1
  1128. package/dist/http/use-describe-api-error.js.map +1 -1
  1129. package/dist/http/use-poll.cjs +1 -1
  1130. package/dist/http/use-poll.cjs.map +1 -1
  1131. package/dist/http/use-poll.js +2 -5
  1132. package/dist/http/use-poll.js.map +1 -1
  1133. package/dist/i18n/I18nProvider.cjs.map +1 -1
  1134. package/dist/i18n/I18nProvider.js.map +1 -1
  1135. package/dist/i18n/create-i18n.cjs.map +1 -1
  1136. package/dist/i18n/create-i18n.js.map +1 -1
  1137. package/dist/icons/Icon.cjs.map +1 -1
  1138. package/dist/icons/Icon.js.map +1 -1
  1139. package/dist/icons/IconPicker.cjs.map +1 -1
  1140. package/dist/icons/IconPicker.js.map +1 -1
  1141. package/dist/icons/IconPicker.module.cjs.map +1 -1
  1142. package/dist/icons/IconPicker.module.js.map +1 -1
  1143. package/dist/icons/IconProvider.cjs.map +1 -1
  1144. package/dist/icons/IconProvider.js.map +1 -1
  1145. package/dist/icons/alias.cjs.map +1 -1
  1146. package/dist/icons/alias.js.map +1 -1
  1147. package/dist/icons/generated/aliases.cjs.map +1 -1
  1148. package/dist/icons/generated/aliases.js.map +1 -1
  1149. package/dist/icons/generated/icon-names.cjs.map +1 -1
  1150. package/dist/icons/generated/icon-names.js.map +1 -1
  1151. package/dist/icons/generated/loaders.cjs.map +1 -1
  1152. package/dist/icons/generated/loaders.js.map +1 -1
  1153. package/dist/icons/generated/shard-00.cjs.map +1 -1
  1154. package/dist/icons/generated/shard-00.js.map +1 -1
  1155. package/dist/icons/generated/shard-01.cjs.map +1 -1
  1156. package/dist/icons/generated/shard-01.js.map +1 -1
  1157. package/dist/icons/generated/shard-02.cjs.map +1 -1
  1158. package/dist/icons/generated/shard-02.js.map +1 -1
  1159. package/dist/icons/generated/shard-03.cjs.map +1 -1
  1160. package/dist/icons/generated/shard-03.js.map +1 -1
  1161. package/dist/icons/generated/shard-04.cjs.map +1 -1
  1162. package/dist/icons/generated/shard-04.js.map +1 -1
  1163. package/dist/icons/generated/shard-05.cjs.map +1 -1
  1164. package/dist/icons/generated/shard-05.js.map +1 -1
  1165. package/dist/icons/generated/shard-06.cjs.map +1 -1
  1166. package/dist/icons/generated/shard-06.js.map +1 -1
  1167. package/dist/icons/generated/shard-07.cjs.map +1 -1
  1168. package/dist/icons/generated/shard-07.js.map +1 -1
  1169. package/dist/icons/generated/shard-08.cjs.map +1 -1
  1170. package/dist/icons/generated/shard-08.js.map +1 -1
  1171. package/dist/icons/generated/shard-09.cjs.map +1 -1
  1172. package/dist/icons/generated/shard-09.js.map +1 -1
  1173. package/dist/icons/generated/shard-10.cjs.map +1 -1
  1174. package/dist/icons/generated/shard-10.js.map +1 -1
  1175. package/dist/icons/generated/shard-11.cjs.map +1 -1
  1176. package/dist/icons/generated/shard-11.js.map +1 -1
  1177. package/dist/icons/generated/shard-12.cjs.map +1 -1
  1178. package/dist/icons/generated/shard-12.js.map +1 -1
  1179. package/dist/icons/generated/shard-13.cjs.map +1 -1
  1180. package/dist/icons/generated/shard-13.js.map +1 -1
  1181. package/dist/icons/generated/shard-14.cjs.map +1 -1
  1182. package/dist/icons/generated/shard-14.js.map +1 -1
  1183. package/dist/icons/generated/shard-15.cjs.map +1 -1
  1184. package/dist/icons/generated/shard-15.js.map +1 -1
  1185. package/dist/icons/generated/shard-16.cjs.map +1 -1
  1186. package/dist/icons/generated/shard-16.js.map +1 -1
  1187. package/dist/icons/generated/shard-17.cjs.map +1 -1
  1188. package/dist/icons/generated/shard-17.js.map +1 -1
  1189. package/dist/icons/generated/shard-18.cjs.map +1 -1
  1190. package/dist/icons/generated/shard-18.js.map +1 -1
  1191. package/dist/icons/generated/shard-19.cjs.map +1 -1
  1192. package/dist/icons/generated/shard-19.js.map +1 -1
  1193. package/dist/icons/generated/shard-20.cjs.map +1 -1
  1194. package/dist/icons/generated/shard-20.js.map +1 -1
  1195. package/dist/icons/generated/shard-21.cjs.map +1 -1
  1196. package/dist/icons/generated/shard-21.js.map +1 -1
  1197. package/dist/icons/generated/shard-22.cjs.map +1 -1
  1198. package/dist/icons/generated/shard-22.js.map +1 -1
  1199. package/dist/icons/generated/shard-23.cjs.map +1 -1
  1200. package/dist/icons/generated/shard-23.js.map +1 -1
  1201. package/dist/icons/generated/shard-24.cjs.map +1 -1
  1202. package/dist/icons/generated/shard-24.js.map +1 -1
  1203. package/dist/icons/generated/shard-25.cjs.map +1 -1
  1204. package/dist/icons/generated/shard-25.js.map +1 -1
  1205. package/dist/icons/generated/shard-26.cjs.map +1 -1
  1206. package/dist/icons/generated/shard-26.js.map +1 -1
  1207. package/dist/icons/generated/shard-27.cjs.map +1 -1
  1208. package/dist/icons/generated/shard-27.js.map +1 -1
  1209. package/dist/icons/generated/shard-28.cjs.map +1 -1
  1210. package/dist/icons/generated/shard-28.js.map +1 -1
  1211. package/dist/icons/generated/shard-29.cjs.map +1 -1
  1212. package/dist/icons/generated/shard-29.js.map +1 -1
  1213. package/dist/icons/generated/shard-30.cjs.map +1 -1
  1214. package/dist/icons/generated/shard-30.js.map +1 -1
  1215. package/dist/icons/generated/shard-31.cjs.map +1 -1
  1216. package/dist/icons/generated/shard-31.js.map +1 -1
  1217. package/dist/icons/generated/shard-32.cjs.map +1 -1
  1218. package/dist/icons/generated/shard-32.js.map +1 -1
  1219. package/dist/icons/generated/shard-33.cjs.map +1 -1
  1220. package/dist/icons/generated/shard-33.js.map +1 -1
  1221. package/dist/icons/generated/shard-34.cjs.map +1 -1
  1222. package/dist/icons/generated/shard-34.js.map +1 -1
  1223. package/dist/icons/generated/shard-35.cjs.map +1 -1
  1224. package/dist/icons/generated/shard-35.js.map +1 -1
  1225. package/dist/icons/generated/shard-36.cjs.map +1 -1
  1226. package/dist/icons/generated/shard-36.js.map +1 -1
  1227. package/dist/icons/generated/shard-37.cjs.map +1 -1
  1228. package/dist/icons/generated/shard-37.js.map +1 -1
  1229. package/dist/icons/generated/shard-38.cjs.map +1 -1
  1230. package/dist/icons/generated/shard-38.js.map +1 -1
  1231. package/dist/icons/generated/shard-39.cjs.map +1 -1
  1232. package/dist/icons/generated/shard-39.js.map +1 -1
  1233. package/dist/icons/generated/shard-40.cjs.map +1 -1
  1234. package/dist/icons/generated/shard-40.js.map +1 -1
  1235. package/dist/icons/generated/shard-41.cjs.map +1 -1
  1236. package/dist/icons/generated/shard-41.js.map +1 -1
  1237. package/dist/icons/generated/shard-42.cjs.map +1 -1
  1238. package/dist/icons/generated/shard-42.js.map +1 -1
  1239. package/dist/icons/generated/shard-43.cjs.map +1 -1
  1240. package/dist/icons/generated/shard-43.js.map +1 -1
  1241. package/dist/icons/generated/shard-44.cjs.map +1 -1
  1242. package/dist/icons/generated/shard-44.js.map +1 -1
  1243. package/dist/icons/generated/shard-45.cjs.map +1 -1
  1244. package/dist/icons/generated/shard-45.js.map +1 -1
  1245. package/dist/icons/icon-context.cjs.map +1 -1
  1246. package/dist/icons/icon-context.js.map +1 -1
  1247. package/dist/icons/is-icon-name.cjs.map +1 -1
  1248. package/dist/icons/is-icon-name.js.map +1 -1
  1249. package/dist/icons/material-symbols.cjs.map +1 -1
  1250. package/dist/icons/material-symbols.js.map +1 -1
  1251. package/dist/icons/normalize-icon-name.cjs.map +1 -1
  1252. package/dist/icons/normalize-icon-name.js.map +1 -1
  1253. package/dist/icons/shard-cache.cjs +1 -1
  1254. package/dist/icons/shard-cache.cjs.map +1 -1
  1255. package/dist/icons/shard-cache.js +2 -5
  1256. package/dist/icons/shard-cache.js.map +1 -1
  1257. package/dist/icons/use-icon.cjs.map +1 -1
  1258. package/dist/icons/use-icon.js.map +1 -1
  1259. package/dist/icons/validate-icon-name.cjs.map +1 -1
  1260. package/dist/icons/validate-icon-name.js.map +1 -1
  1261. package/dist/icons-virtual.cjs.map +1 -1
  1262. package/dist/icons-virtual.js.map +1 -1
  1263. package/dist/imaging/canvas.cjs.map +1 -1
  1264. package/dist/imaging/canvas.js.map +1 -1
  1265. package/dist/imaging/compress.cjs.map +1 -1
  1266. package/dist/imaging/compress.js.map +1 -1
  1267. package/dist/imaging/decode.cjs.map +1 -1
  1268. package/dist/imaging/decode.js.map +1 -1
  1269. package/dist/imaging/encode.cjs.map +1 -1
  1270. package/dist/imaging/encode.js.map +1 -1
  1271. package/dist/imaging/exceptions.cjs.map +1 -1
  1272. package/dist/imaging/exceptions.js.map +1 -1
  1273. package/dist/imaging/frame.cjs.map +1 -1
  1274. package/dist/imaging/frame.js.map +1 -1
  1275. package/dist/imaging/thumbnails.cjs.map +1 -1
  1276. package/dist/imaging/thumbnails.js.map +1 -1
  1277. package/dist/imaging/transform.cjs.map +1 -1
  1278. package/dist/imaging/transform.js.map +1 -1
  1279. package/dist/imaging/use-image-processing.cjs.map +1 -1
  1280. package/dist/imaging/use-image-processing.js.map +1 -1
  1281. package/dist/logger/logger.cjs.map +1 -1
  1282. package/dist/logger/logger.js.map +1 -1
  1283. package/dist/neural.cjs.map +1 -1
  1284. package/dist/neural.js.map +1 -1
  1285. package/dist/oauth/GoogleSignIn.cjs +1 -1
  1286. package/dist/oauth/GoogleSignIn.cjs.map +1 -1
  1287. package/dist/oauth/GoogleSignIn.js +6 -9
  1288. package/dist/oauth/GoogleSignIn.js.map +1 -1
  1289. package/dist/oauth/callback.cjs.map +1 -1
  1290. package/dist/oauth/callback.js.map +1 -1
  1291. package/dist/oauth/use-oauth-callback.cjs.map +1 -1
  1292. package/dist/oauth/use-oauth-callback.js.map +1 -1
  1293. package/dist/offline/conflict.cjs.map +1 -1
  1294. package/dist/offline/conflict.js.map +1 -1
  1295. package/dist/offline/create-offline-database.cjs.map +1 -1
  1296. package/dist/offline/create-offline-database.js.map +1 -1
  1297. package/dist/offline/create-offline-store.cjs +1 -1
  1298. package/dist/offline/create-offline-store.cjs.map +1 -1
  1299. package/dist/offline/create-offline-store.js +1 -5
  1300. package/dist/offline/create-offline-store.js.map +1 -1
  1301. package/dist/offline/create-offline-sync.cjs +1 -1
  1302. package/dist/offline/create-offline-sync.cjs.map +1 -1
  1303. package/dist/offline/create-offline-sync.js +9 -14
  1304. package/dist/offline/create-offline-sync.js.map +1 -1
  1305. package/dist/offline/use-offline-sync.cjs.map +1 -1
  1306. package/dist/offline/use-offline-sync.js.map +1 -1
  1307. package/dist/perf/cache-size.cjs.map +1 -1
  1308. package/dist/perf/cache-size.js.map +1 -1
  1309. package/dist/perf/device.cjs.map +1 -1
  1310. package/dist/perf/device.js.map +1 -1
  1311. package/dist/perf/format.cjs.map +1 -1
  1312. package/dist/perf/format.js.map +1 -1
  1313. package/dist/perf/profiler.cjs.map +1 -1
  1314. package/dist/perf/profiler.js.map +1 -1
  1315. package/dist/push/use-push-subscription.cjs.map +1 -1
  1316. package/dist/push/use-push-subscription.js.map +1 -1
  1317. package/dist/push/utils.cjs.map +1 -1
  1318. package/dist/push/utils.js.map +1 -1
  1319. package/dist/push/web-push-client.cjs.map +1 -1
  1320. package/dist/push/web-push-client.js.map +1 -1
  1321. package/dist/query/QueryProvider.cjs.map +1 -1
  1322. package/dist/query/QueryProvider.js.map +1 -1
  1323. package/dist/query/constants.cjs.map +1 -1
  1324. package/dist/query/constants.js.map +1 -1
  1325. package/dist/query/create-query-keys.cjs.map +1 -1
  1326. package/dist/query/create-query-keys.js.map +1 -1
  1327. package/dist/query/foreign-client-warning.cjs.map +1 -1
  1328. package/dist/query/foreign-client-warning.js.map +1 -1
  1329. package/dist/query/offline-persistence.cjs +1 -1
  1330. package/dist/query/offline-persistence.cjs.map +1 -1
  1331. package/dist/query/offline-persistence.js +2 -10
  1332. package/dist/query/offline-persistence.js.map +1 -1
  1333. package/dist/query/optimistic.cjs.map +1 -1
  1334. package/dist/query/optimistic.js.map +1 -1
  1335. package/dist/query/pagination.cjs.map +1 -1
  1336. package/dist/query/pagination.js.map +1 -1
  1337. package/dist/query/retry-policy.cjs.map +1 -1
  1338. package/dist/query/retry-policy.js.map +1 -1
  1339. package/dist/query/use-cursor-query.cjs.map +1 -1
  1340. package/dist/query/use-cursor-query.js.map +1 -1
  1341. package/dist/query/use-offline-mutation.cjs.map +1 -1
  1342. package/dist/query/use-offline-mutation.js.map +1 -1
  1343. package/dist/query/use-paginated-query.cjs.map +1 -1
  1344. package/dist/query/use-paginated-query.js.map +1 -1
  1345. package/dist/router/AppRouter.cjs.map +1 -1
  1346. package/dist/router/AppRouter.js.map +1 -1
  1347. package/dist/router/RouteGuard.cjs.map +1 -1
  1348. package/dist/router/RouteGuard.js.map +1 -1
  1349. package/dist/router/index.js +2 -2
  1350. package/dist/share/share-or-download.cjs.map +1 -1
  1351. package/dist/share/share-or-download.js.map +1 -1
  1352. package/dist/share/share.cjs.map +1 -1
  1353. package/dist/share/share.js.map +1 -1
  1354. package/dist/sse/create-event-stream.cjs.map +1 -1
  1355. package/dist/sse/create-event-stream.js.map +1 -1
  1356. package/dist/sse/use-event-stream.cjs.map +1 -1
  1357. package/dist/sse/use-event-stream.js.map +1 -1
  1358. package/dist/store/create-selectors.cjs.map +1 -1
  1359. package/dist/store/create-selectors.js.map +1 -1
  1360. package/dist/store/create-store.cjs.map +1 -1
  1361. package/dist/store/create-store.js.map +1 -1
  1362. package/dist/sw/background-sync.cjs +1 -1
  1363. package/dist/sw/background-sync.cjs.map +1 -1
  1364. package/dist/sw/background-sync.js +32 -31
  1365. package/dist/sw/background-sync.js.map +1 -1
  1366. package/dist/sw/cache-inspect.cjs.map +1 -1
  1367. package/dist/sw/cache-inspect.js.map +1 -1
  1368. package/dist/sw/cache.cjs +1 -1
  1369. package/dist/sw/cache.cjs.map +1 -1
  1370. package/dist/sw/cache.js +2 -6
  1371. package/dist/sw/cache.js.map +1 -1
  1372. package/dist/sw/create-push-handler.cjs.map +1 -1
  1373. package/dist/sw/create-push-handler.js.map +1 -1
  1374. package/dist/sw/credential-headers.cjs.map +1 -1
  1375. package/dist/sw/credential-headers.js.map +1 -1
  1376. package/dist/sw/periodic-sync.cjs.map +1 -1
  1377. package/dist/sw/periodic-sync.js.map +1 -1
  1378. package/dist/sw/register-service-worker.cjs.map +1 -1
  1379. package/dist/sw/register-service-worker.js.map +1 -1
  1380. package/dist/sw/session-data.cjs.map +1 -1
  1381. package/dist/sw/session-data.js.map +1 -1
  1382. package/dist/sw.d.ts +46 -8
  1383. package/dist/tabular/assets.cjs.map +1 -1
  1384. package/dist/tabular/assets.js.map +1 -1
  1385. package/dist/tabular/cache.cjs.map +1 -1
  1386. package/dist/tabular/cache.js.map +1 -1
  1387. package/dist/tabular/compact.cjs.map +1 -1
  1388. package/dist/tabular/compact.js.map +1 -1
  1389. package/dist/tabular/exceptions.cjs.map +1 -1
  1390. package/dist/tabular/exceptions.js.map +1 -1
  1391. package/dist/tabular/manifest.cjs.map +1 -1
  1392. package/dist/tabular/manifest.js.map +1 -1
  1393. package/dist/tabular/predictor.cjs.map +1 -1
  1394. package/dist/tabular/predictor.js.map +1 -1
  1395. package/dist/tabular/use-tabular-predictor.cjs.map +1 -1
  1396. package/dist/tabular/use-tabular-predictor.js.map +1 -1
  1397. package/dist/telemetry/TelemetryProvider.cjs.map +1 -1
  1398. package/dist/telemetry/TelemetryProvider.js.map +1 -1
  1399. package/dist/telemetry/app-error-adapter.cjs.map +1 -1
  1400. package/dist/telemetry/app-error-adapter.js.map +1 -1
  1401. package/dist/telemetry/app-error-queue.cjs.map +1 -1
  1402. package/dist/telemetry/app-error-queue.js.map +1 -1
  1403. package/dist/telemetry/app-error-reporter.cjs +1 -1
  1404. package/dist/telemetry/app-error-reporter.cjs.map +1 -1
  1405. package/dist/telemetry/app-error-reporter.js +1 -1
  1406. package/dist/telemetry/app-error-reporter.js.map +1 -1
  1407. package/dist/telemetry/app-error-schema.cjs.map +1 -1
  1408. package/dist/telemetry/app-error-schema.js.map +1 -1
  1409. package/dist/telemetry/app-error-transport.cjs.map +1 -1
  1410. package/dist/telemetry/app-error-transport.js.map +1 -1
  1411. package/dist/telemetry/console-adapter.cjs.map +1 -1
  1412. package/dist/telemetry/console-adapter.js.map +1 -1
  1413. package/dist/telemetry/describe-app-error.cjs.map +1 -1
  1414. package/dist/telemetry/describe-app-error.js.map +1 -1
  1415. package/dist/telemetry/posthog-adapter.cjs +1 -1
  1416. package/dist/telemetry/posthog-adapter.cjs.map +1 -1
  1417. package/dist/telemetry/posthog-adapter.js +1 -5
  1418. package/dist/telemetry/posthog-adapter.js.map +1 -1
  1419. package/dist/telemetry/sentry-adapter.cjs.map +1 -1
  1420. package/dist/telemetry/sentry-adapter.js.map +1 -1
  1421. package/dist/tempest-react-sdk.cjs +1 -1
  1422. package/dist/tempest-react-sdk.d.ts +448 -15
  1423. package/dist/tempest-react-sdk.js +119 -119
  1424. package/dist/testing/create-mock-handlers.cjs.map +1 -1
  1425. package/dist/testing/create-mock-handlers.js.map +1 -1
  1426. package/dist/testing.js +1 -2
  1427. package/dist/theme/ThemeProvider.cjs.map +1 -1
  1428. package/dist/theme/ThemeProvider.js.map +1 -1
  1429. package/dist/theme/apply-theme.cjs.map +1 -1
  1430. package/dist/theme/apply-theme.js.map +1 -1
  1431. package/dist/theme/color.cjs.map +1 -1
  1432. package/dist/theme/color.js.map +1 -1
  1433. package/dist/theme/create-theme.cjs.map +1 -1
  1434. package/dist/theme/create-theme.js.map +1 -1
  1435. package/dist/theme/data-viz-ramps.cjs.map +1 -1
  1436. package/dist/theme/data-viz-ramps.js.map +1 -1
  1437. package/dist/theme/initial-theme.cjs.map +1 -1
  1438. package/dist/theme/initial-theme.js.map +1 -1
  1439. package/dist/theme/inverse-render.cjs.map +1 -1
  1440. package/dist/theme/inverse-render.js.map +1 -1
  1441. package/dist/theme/inverse-restore.cjs.map +1 -1
  1442. package/dist/theme/inverse-restore.js.map +1 -1
  1443. package/dist/theme/inverse-surface.cjs.map +1 -1
  1444. package/dist/theme/inverse-surface.js.map +1 -1
  1445. package/dist/theme/status-tokens.cjs.map +1 -1
  1446. package/dist/theme/status-tokens.js.map +1 -1
  1447. package/dist/theme/theme-presets.cjs.map +1 -1
  1448. package/dist/theme/theme-presets.js.map +1 -1
  1449. package/dist/utils/absent.cjs.map +1 -1
  1450. package/dist/utils/absent.js.map +1 -1
  1451. package/dist/utils/arrays.cjs.map +1 -1
  1452. package/dist/utils/arrays.js.map +1 -1
  1453. package/dist/utils/base64.cjs.map +1 -1
  1454. package/dist/utils/base64.js.map +1 -1
  1455. package/dist/utils/cn.cjs.map +1 -1
  1456. package/dist/utils/cn.js.map +1 -1
  1457. package/dist/utils/compare-values.cjs.map +1 -1
  1458. package/dist/utils/compare-values.js.map +1 -1
  1459. package/dist/utils/compressed-storage.cjs.map +1 -1
  1460. package/dist/utils/compressed-storage.js.map +1 -1
  1461. package/dist/utils/csv.cjs +3 -3
  1462. package/dist/utils/csv.cjs.map +1 -1
  1463. package/dist/utils/csv.js +11 -10
  1464. package/dist/utils/csv.js.map +1 -1
  1465. package/dist/utils/dev-mode.cjs.map +1 -1
  1466. package/dist/utils/dev-mode.js.map +1 -1
  1467. package/dist/utils/duplicate-instance.cjs.map +1 -1
  1468. package/dist/utils/duplicate-instance.js.map +1 -1
  1469. package/dist/utils/format.cjs.map +1 -1
  1470. package/dist/utils/format.js.map +1 -1
  1471. package/dist/utils/functions.cjs +1 -1
  1472. package/dist/utils/functions.cjs.map +1 -1
  1473. package/dist/utils/functions.js +1 -1
  1474. package/dist/utils/functions.js.map +1 -1
  1475. package/dist/utils/guards.cjs.map +1 -1
  1476. package/dist/utils/guards.js.map +1 -1
  1477. package/dist/utils/ids.cjs.map +1 -1
  1478. package/dist/utils/ids.js.map +1 -1
  1479. package/dist/utils/intl-cache.cjs.map +1 -1
  1480. package/dist/utils/intl-cache.js.map +1 -1
  1481. package/dist/utils/json-frame.cjs.map +1 -1
  1482. package/dist/utils/json-frame.js.map +1 -1
  1483. package/dist/utils/numbers.cjs.map +1 -1
  1484. package/dist/utils/numbers.js.map +1 -1
  1485. package/dist/utils/objects.cjs.map +1 -1
  1486. package/dist/utils/objects.js.map +1 -1
  1487. package/dist/{telemetry/app-error-owner.cjs → utils/owner-fingerprint.cjs} +2 -2
  1488. package/dist/utils/owner-fingerprint.cjs.map +1 -0
  1489. package/dist/{telemetry/app-error-owner.js → utils/owner-fingerprint.js} +3 -3
  1490. package/dist/utils/owner-fingerprint.js.map +1 -0
  1491. package/dist/utils/promises.cjs.map +1 -1
  1492. package/dist/utils/promises.js.map +1 -1
  1493. package/dist/utils/relative-time.cjs.map +1 -1
  1494. package/dist/utils/relative-time.js.map +1 -1
  1495. package/dist/utils/safe-url.cjs.map +1 -1
  1496. package/dist/utils/safe-url.js.map +1 -1
  1497. package/dist/utils/schema-like.cjs.map +1 -1
  1498. package/dist/utils/schema-like.js.map +1 -1
  1499. package/dist/utils/storage.cjs +1 -1
  1500. package/dist/utils/storage.cjs.map +1 -1
  1501. package/dist/utils/storage.js +2 -2
  1502. package/dist/utils/storage.js.map +1 -1
  1503. package/dist/utils/strings.cjs.map +1 -1
  1504. package/dist/utils/strings.js.map +1 -1
  1505. package/dist/utils/xlsx.cjs.map +1 -1
  1506. package/dist/utils/xlsx.js.map +1 -1
  1507. package/dist/vision/core/canvas.cjs.map +1 -1
  1508. package/dist/vision/core/canvas.js.map +1 -1
  1509. package/dist/vision/core/dtypes.cjs.map +1 -1
  1510. package/dist/vision/core/dtypes.js.map +1 -1
  1511. package/dist/vision/core/exceptions.cjs.map +1 -1
  1512. package/dist/vision/core/exceptions.js.map +1 -1
  1513. package/dist/vision/core/graph.cjs.map +1 -1
  1514. package/dist/vision/core/graph.js.map +1 -1
  1515. package/dist/vision/core/metadata.cjs +1 -1
  1516. package/dist/vision/core/metadata.cjs.map +1 -1
  1517. package/dist/vision/core/metadata.js +9 -26
  1518. package/dist/vision/core/metadata.js.map +1 -1
  1519. package/dist/vision/core/providers.cjs.map +1 -1
  1520. package/dist/vision/core/providers.js.map +1 -1
  1521. package/dist/vision/core/session.cjs.map +1 -1
  1522. package/dist/vision/core/session.js.map +1 -1
  1523. package/dist/vision/core/timing.cjs.map +1 -1
  1524. package/dist/vision/core/timing.js.map +1 -1
  1525. package/dist/vision/fusion.cjs.map +1 -1
  1526. package/dist/vision/fusion.js.map +1 -1
  1527. package/dist/vision/index.cjs.map +1 -1
  1528. package/dist/vision/index.js.map +1 -1
  1529. package/dist/vision/io/image.cjs.map +1 -1
  1530. package/dist/vision/io/image.js.map +1 -1
  1531. package/dist/vision/labels.cjs.map +1 -1
  1532. package/dist/vision/labels.js.map +1 -1
  1533. package/dist/vision/luminance.cjs.map +1 -1
  1534. package/dist/vision/luminance.js.map +1 -1
  1535. package/dist/vision/normalization.cjs.map +1 -1
  1536. package/dist/vision/normalization.js.map +1 -1
  1537. package/dist/vision/postprocess/classification.cjs.map +1 -1
  1538. package/dist/vision/postprocess/classification.js.map +1 -1
  1539. package/dist/vision/postprocess/detection.cjs.map +1 -1
  1540. package/dist/vision/postprocess/detection.js.map +1 -1
  1541. package/dist/vision/postprocess/segmentation.cjs.map +1 -1
  1542. package/dist/vision/postprocess/segmentation.js.map +1 -1
  1543. package/dist/vision/preprocess/image.cjs.map +1 -1
  1544. package/dist/vision/preprocess/image.js.map +1 -1
  1545. package/dist/vision/preprocess/pipeline.cjs.map +1 -1
  1546. package/dist/vision/preprocess/pipeline.js.map +1 -1
  1547. package/dist/vision/results.cjs.map +1 -1
  1548. package/dist/vision/results.js.map +1 -1
  1549. package/dist/vision/tasks/base.cjs.map +1 -1
  1550. package/dist/vision/tasks/base.js.map +1 -1
  1551. package/dist/vision/tasks/classifier.cjs.map +1 -1
  1552. package/dist/vision/tasks/classifier.js.map +1 -1
  1553. package/dist/vision/tasks/detectClassify.cjs.map +1 -1
  1554. package/dist/vision/tasks/detectClassify.js.map +1 -1
  1555. package/dist/vision/tasks/detector.cjs.map +1 -1
  1556. package/dist/vision/tasks/detector.js.map +1 -1
  1557. package/dist/vision/tasks/segmenter.cjs.map +1 -1
  1558. package/dist/vision/tasks/segmenter.js.map +1 -1
  1559. package/dist/vision/types.cjs.map +1 -1
  1560. package/dist/vision/types.js.map +1 -1
  1561. package/dist/vision/use-camera-stream.cjs +1 -1
  1562. package/dist/vision/use-camera-stream.cjs.map +1 -1
  1563. package/dist/vision/use-camera-stream.js +3 -9
  1564. package/dist/vision/use-camera-stream.js.map +1 -1
  1565. package/dist/vision/use-live-luminance.cjs +1 -1
  1566. package/dist/vision/use-live-luminance.cjs.map +1 -1
  1567. package/dist/vision/use-live-luminance.js +1 -5
  1568. package/dist/vision/use-live-luminance.js.map +1 -1
  1569. package/dist/vite/base-url.cjs.map +1 -1
  1570. package/dist/vite/base-url.js.map +1 -1
  1571. package/dist/vite/create-vite-config.cjs.map +1 -1
  1572. package/dist/vite/create-vite-config.js.map +1 -1
  1573. package/dist/vite/narrow-tokens.cjs.map +1 -1
  1574. package/dist/vite/narrow-tokens.js.map +1 -1
  1575. package/dist/vite/tempest-csp.cjs +2 -2
  1576. package/dist/vite/tempest-csp.cjs.map +1 -1
  1577. package/dist/vite/tempest-csp.js +69 -66
  1578. package/dist/vite/tempest-csp.js.map +1 -1
  1579. package/dist/vite/tempest-icons.cjs.map +1 -1
  1580. package/dist/vite/tempest-icons.js.map +1 -1
  1581. package/dist/vite/tempest-pwa-dev-sw.cjs +1 -1
  1582. package/dist/vite/tempest-pwa-dev-sw.cjs.map +1 -1
  1583. package/dist/vite/tempest-pwa-dev-sw.js +9 -16
  1584. package/dist/vite/tempest-pwa-dev-sw.js.map +1 -1
  1585. package/dist/vite/tempest-pwa-icons.cjs.map +1 -1
  1586. package/dist/vite/tempest-pwa-icons.js.map +1 -1
  1587. package/dist/vite/tempest-pwa-manifest.cjs.map +1 -1
  1588. package/dist/vite/tempest-pwa-manifest.js.map +1 -1
  1589. package/dist/vite/tempest-styles.cjs.map +1 -1
  1590. package/dist/vite/tempest-styles.js.map +1 -1
  1591. package/dist/vite/tempest-vitest.cjs.map +1 -1
  1592. package/dist/vite/tempest-vitest.js.map +1 -1
  1593. package/dist/vite.d.ts +5 -3
  1594. package/dist/webrtc/link-stats.cjs.map +1 -1
  1595. package/dist/webrtc/link-stats.js.map +1 -1
  1596. package/dist/webrtc/mesh-quality.cjs.map +1 -1
  1597. package/dist/webrtc/mesh-quality.js.map +1 -1
  1598. package/dist/webrtc/opus-sdp.cjs.map +1 -1
  1599. package/dist/webrtc/opus-sdp.js.map +1 -1
  1600. package/dist/webrtc/peer-link.cjs +1 -1
  1601. package/dist/webrtc/peer-link.cjs.map +1 -1
  1602. package/dist/webrtc/peer-link.js +2 -5
  1603. package/dist/webrtc/peer-link.js.map +1 -1
  1604. package/dist/webrtc/peer-mesh.cjs +1 -1
  1605. package/dist/webrtc/peer-mesh.cjs.map +1 -1
  1606. package/dist/webrtc/peer-mesh.js +8 -24
  1607. package/dist/webrtc/peer-mesh.js.map +1 -1
  1608. package/dist/webrtc/sender-bitrate.cjs.map +1 -1
  1609. package/dist/webrtc/sender-bitrate.js.map +1 -1
  1610. package/dist/webrtc/use-link-stats.cjs.map +1 -1
  1611. package/dist/webrtc/use-link-stats.js.map +1 -1
  1612. package/dist/ws/create-web-socket.cjs +1 -1
  1613. package/dist/ws/create-web-socket.cjs.map +1 -1
  1614. package/dist/ws/create-web-socket.js +4 -22
  1615. package/dist/ws/create-web-socket.js.map +1 -1
  1616. package/dist/ws/resilience.cjs.map +1 -1
  1617. package/dist/ws/resilience.js.map +1 -1
  1618. package/dist/ws/use-web-socket.cjs.map +1 -1
  1619. package/dist/ws/use-web-socket.js.map +1 -1
  1620. package/package.json +9 -6
  1621. package/template/package.json +1 -1
  1622. package/dist/telemetry/app-error-owner.cjs.map +0 -1
  1623. package/dist/telemetry/app-error-owner.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"format.cjs","names":[],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\n\n/**\n * Format a number as Brazilian Real currency.\n *\n * An absent or unrepresentable amount renders as `\"—\"` rather than as a number.\n * That branch is a data-correctness fix, not cosmetics: `Intl` coerces `null` to\n * zero, so an amount the backend left out used to reach the screen as\n * **`\"R$ 0,00\"`** — a plausible figure a reader has no way to question — and\n * `undefined` as `\"R$ NaN\"`.\n *\n * @example\n * ```typescript\n * formatCurrency(1234.56); // \"R$ 1.234,56\"\n * formatCurrency(null); // \"—\"\n * formatCurrency(null, { fallback: \"sem valor\" }); // \"sem valor\"\n * ```\n *\n * @param value - The amount in BRL, or `null`/`undefined` when there is none.\n * @param options - Text to render when there is nothing to format.\n * @returns A locale-formatted string, e.g. \"R$ 1.234,56\".\n */\nexport function formatCurrency(\n value: number | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(\"pt-BR\", { style: \"currency\", currency: \"BRL\" }).format(value);\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy`.\n *\n * Absent input answers `\"—\"`. It used to **throw**: `new Date(null)` is epoch and\n * `null.getTime` is a `TypeError`, so a nullable column — which is every\n * `deleted_at`, `expires_at` and half the `updated_at` a FastAPI backend sends —\n * took the screen down instead of rendering a gap.\n *\n * A value that is present and unparseable still answers `\"\"`, deliberately: on a\n * screen that reads a log, \"nobody filled this in\" and \"what they filled in is\n * broken\" are different findings, and the second is the one worth chasing.\n *\n * @example\n * ```typescript\n * formatDate(\"2026-05-16T12:00:00Z\"); // \"16/05/2026\"\n * formatDate(null); // \"—\"\n * formatDate(\"banana\"); // \"\"\n * ```\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted date string, the fallback when absent, or empty string when\n * the value is present and invalid.\n */\nexport function formatDate(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\").format(date);\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-dd`, the value an\n * `<input type=\"date\">` accepts.\n *\n * Built from the **local** calendar parts rather than `toISOString().slice(0, 10)`,\n * which is the reflex and which is wrong: `toISOString` converts to UTC first, so\n * anything after 21:00 in UTC-3 reports the next day and the form opens on the\n * wrong date. `formatDate` cannot fill this role because a date input rejects\n * `dd/MM/yyyy` outright.\n *\n * A value that is already `yyyy-MM-dd` is returned untouched, and that shortcut\n * is load-bearing rather than an optimisation: `new Date(\"2026-05-16\")` is parsed\n * as **UTC** midnight, which in UTC-3 is the 15th at 21:00, so round-tripping the\n * exact value a backend sent would move it back a day.\n *\n * @example\n * <input type=\"date\" defaultValue={formatDateForInput(order.createdAt)} />\n *\n * Absent input answers `\"\"` here — **not** the em dash the reading formatters\n * use — because that is what an input reads as \"no value\"; an em dash would\n * arrive as content the user has to delete before typing a date.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text for an absent value; defaults to `\"\"`.\n * @returns The `yyyy-MM-dd` value, or an empty string when the input is invalid —\n * which is what a date input reads as \"no value\", unlike `\"Invalid Date\"`.\n */\nexport function formatDateForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-ddTHH:mm`, the value an\n * `<input type=\"datetime-local\">` accepts.\n *\n * The sibling of {@link formatDateForInput}, and it exists for the same reason:\n * `toISOString().slice(0, 16)` is the reflex and it is wrong. `toISOString`\n * converts to UTC first, so a 22:00 appointment in UTC-3 opens the form on the\n * next day at 01:00 — here the trap costs the hour as well as the date.\n *\n * A value already in `yyyy-MM-ddTHH:mm` is returned untouched. A value carrying\n * a zone (`...Z`, `...-03:00`) deliberately does **not** take that shortcut: it\n * is a different instant from the naive string that looks like it, so it is\n * converted to the local calendar parts the input has to show.\n *\n * Seconds are dropped. A `datetime-local` steps by the minute unless the app\n * sets `step`, so a `:ss` the field cannot represent would be silently discarded\n * on the first edit anyway — truncating here keeps the rendered value and the\n * submitted value the same.\n *\n * @example\n * <input\n * type=\"datetime-local\"\n * defaultValue={formatDateTimeForInput(appointment.startsAt)}\n * />\n *\n * @param value - ISO string or Date.\n * @returns The `yyyy-MM-ddTHH:mm` value, or an empty string when the input is\n * invalid — which is what a datetime input reads as \"no value\", unlike\n * `\"Invalid Date\"`.\n */\nexport function formatDateTimeForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hours = `${date.getHours()}`.padStart(2, \"0\");\n const minutes = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}T${hours}:${minutes}`;\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy HH:mm`.\n *\n * Same contract as {@link formatDate}: absent answers the fallback (`\"—\"` by\n * default) instead of throwing, and present-but-invalid answers `\"\"`.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted datetime string, the fallback when absent, or empty string\n * when the value is present and invalid.\n */\nexport function formatDateTime(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\", { dateStyle: \"short\", timeStyle: \"short\" }).format(date);\n}\n\nexport interface FormatPhoneOptions {\n /**\n * Treat the number as a mobile line: insert the mandatory `9` after the area\n * code when it is missing, and group the subscriber part `5+4` from the\n * first digit typed instead of waiting for the eleventh.\n *\n * Default `false`, which keeps the length-based behaviour: `4+4` up to ten\n * digits, `5+4` at eleven.\n */\n mobile?: boolean;\n}\n\n/**\n * Apply the Brazilian phone mask `(XX) XXXXX-XXXX` or `(XX) XXXX-XXXX`.\n *\n * By default the grouping is decided by **length**, which is what a field\n * accepting both landlines and mobiles needs.\n *\n * `mobile: true` is for a field that only accepts mobile numbers, and it exists\n * because the default is wrong as an as-you-type mask there. Reading anything up\n * to ten digits as a landline puts the hyphen after the fourth subscriber digit,\n * so a half-typed mobile renders `(11) 9123-4`; it only becomes `(11) 91234-5`\n * once the eleventh digit lands. The separator visibly jumps backwards while the\n * user is still typing. With `mobile`, the same input reads `(11) 91234` and the\n * hyphen never moves. It also inserts the leading `9` every Brazilian mobile\n * carries, so a ten-digit number gets corrected rather than masked as a landline.\n *\n * @param value - Raw digits or partially masked string.\n * @param options - Masking options.\n * @returns Masked phone string.\n *\n * @example\n * formatPhone(\"1191234\"); // \"(11) 9123-4\"\n * formatPhone(\"1191234\", { mobile: true }); // \"(11) 91234\"\n * formatPhone(\"1112345678\", { mobile: true }); // \"(11) 91234-5678\" — 9 inserted\n */\nexport function formatPhone(value: string, options: FormatPhoneOptions = {}): string {\n const digits = value.replace(/\\D/g, \"\").slice(0, 11);\n\n if (!options.mobile) {\n if (digits.length <= 10) {\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{4})(\\d)/, \"$1-$2\");\n }\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{5})(\\d)/, \"$1-$2\");\n }\n\n if (digits.length <= 2) return digits;\n\n const area = digits.slice(0, 2);\n let subscriber = digits.slice(2);\n if (subscriber[0] !== \"9\") subscriber = `9${subscriber}`;\n subscriber = subscriber.slice(0, 9);\n\n const prefix = subscriber.slice(0, 5);\n const suffix = subscriber.slice(5);\n return suffix ? `(${area}) ${prefix}-${suffix}` : `(${area}) ${prefix}`;\n}\n\n/**\n * Apply the Brazilian CPF mask `XXX.XXX.XXX-XX`.\n *\n * @param value - Raw digits or partially masked string.\n * @returns Masked CPF string.\n */\nexport function formatCPF(value: string): string {\n return value\n .replace(/\\D/g, \"\")\n .slice(0, 11)\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d{1,2})$/, \"$1-$2\");\n}\n\n/** How {@link formatPercent} renders a fraction. */\nexport interface FormatPercentOptions extends FormatFallbackOptions {\n /**\n * Decimal places to show, fixed (padded as well as truncated).\n *\n * Defaults to `1`, which is what the function always did. Two is the case\n * that produced this option: a confidence of 98,74% and one of 98,7% are the\n * same number on a summary card and two different readings on a detail\n * screen, so the precision belongs to the call site.\n */\n decimals?: number;\n}\n\n/**\n * Format a fraction (0-1) as a percentage.\n *\n * A non-finite input renders as `\"—\"` rather than `\"NaN%\"` or `\"∞%\"`, which is\n * what `Intl.NumberFormat` produces and what a division by zero upstream puts on\n * the screen. It matches `formatDurationMs`, which already answers that way.\n *\n * @example\n * ```typescript\n * formatPercent(0.9874); // \"98,7%\"\n * formatPercent(0.9874, { decimals: 2 }); // \"98,74%\"\n * formatPercent(0 / 0); // \"—\"\n * ```\n *\n * @param value - Fraction between 0 and 1.\n * @param options - Rendering options; `decimals` defaults to 1.\n * @returns Formatted percent string, e.g. \"12,5%\", or `\"—\"` for a non-finite input.\n */\nexport function formatPercent(\n value: number | null | undefined,\n options: FormatPercentOptions = {},\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n const decimals = options.decimals ?? 1;\n return numberFormat(\"pt-BR\", {\n style: \"percent\",\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(value);\n}\n"],"mappings":"8DAuBA,SAAgB,EACZ,EACA,EACM,CAEN,OADI,EAAA,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EAAU,EAAA,aAAa,CAAO,EACpE,EAAA,aAAa,QAAS,CAAE,MAAO,WAAY,SAAU,KAAM,CAAC,CAAC,CAAC,OAAO,CAAK,CACrF,CA0BA,SAAgB,EACZ,EACA,EACM,CACN,GAAI,EAAA,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,CAAO,EAChD,IAAM,EAAO,OAAO,GAAU,SAAW,IAAI,KAAK,CAAK,EAAI,EAE3D,OADI,OAAO,MAAM,EAAK,QAAQ,CAAC,EAAU,GAClC,EAAA,eAAe,OAAO,CAAC,CAAC,OAAO,CAAI,CAC9C,CA6BA,SAAgB,EACZ,EACA,EACM,CACN,GAAI,EAAA,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,EAAS,EAAE,EACpD,GAAI,OAAO,GAAU,UAAY,sBAAsB,KAAK,CAAK,EAAG,OAAO,EAC3E,IAAM,EAAO,OAAO,GAAU,SAAW,IAAI,KAAK,CAAK,EAAI,EAC3D,GAAI,OAAO,MAAM,EAAK,QAAQ,CAAC,EAAG,MAAO,GACzC,IAAM,EAAQ,GAAG,EAAK,SAAS,EAAI,IAAI,SAAS,EAAG,GAAG,EAChD,EAAM,GAAG,EAAK,QAAQ,IAAI,SAAS,EAAG,GAAG,EAC/C,MAAO,GAAG,EAAK,YAAY,EAAE,GAAG,EAAM,GAAG,GAC7C,CAgCA,SAAgB,EACZ,EACA,EACM,CACN,GAAI,EAAA,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,EAAS,EAAE,EACpD,GAAI,OAAO,GAAU,UAAY,kCAAkC,KAAK,CAAK,EAAG,OAAO,EACvF,IAAM,EAAO,OAAO,GAAU,SAAW,IAAI,KAAK,CAAK,EAAI,EAC3D,GAAI,OAAO,MAAM,EAAK,QAAQ,CAAC,EAAG,MAAO,GACzC,IAAM,EAAQ,GAAG,EAAK,SAAS,EAAI,IAAI,SAAS,EAAG,GAAG,EAChD,EAAM,GAAG,EAAK,QAAQ,IAAI,SAAS,EAAG,GAAG,EACzC,EAAQ,GAAG,EAAK,SAAS,IAAI,SAAS,EAAG,GAAG,EAC5C,EAAU,GAAG,EAAK,WAAW,IAAI,SAAS,EAAG,GAAG,EACtD,MAAO,GAAG,EAAK,YAAY,EAAE,GAAG,EAAM,GAAG,EAAI,GAAG,EAAM,GAAG,GAC7D,CAaA,SAAgB,EACZ,EACA,EACM,CACN,GAAI,EAAA,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,CAAO,EAChD,IAAM,EAAO,OAAO,GAAU,SAAW,IAAI,KAAK,CAAK,EAAI,EAE3D,OADI,OAAO,MAAM,EAAK,QAAQ,CAAC,EAAU,GAClC,EAAA,eAAe,QAAS,CAAE,UAAW,QAAS,UAAW,OAAQ,CAAC,CAAC,CAAC,OAAO,CAAI,CAC1F,CAsCA,SAAgB,EAAY,EAAe,EAA8B,CAAC,EAAW,CACjF,IAAM,EAAS,EAAM,QAAQ,MAAO,EAAE,CAAC,CAAC,MAAM,EAAG,EAAE,EAEnD,GAAI,CAAC,EAAQ,OAIT,OAHI,EAAO,QAAU,GACV,EAAO,QAAQ,cAAe,SAAS,CAAC,CAAC,QAAQ,cAAe,OAAO,EAE3E,EAAO,QAAQ,cAAe,SAAS,CAAC,CAAC,QAAQ,cAAe,OAAO,EAGlF,GAAI,EAAO,QAAU,EAAG,OAAO,EAE/B,IAAM,EAAO,EAAO,MAAM,EAAG,CAAC,EAC1B,EAAa,EAAO,MAAM,CAAC,EAC3B,EAAW,KAAO,MAAK,EAAa,IAAI,KAC5C,EAAa,EAAW,MAAM,EAAG,CAAC,EAElC,IAAM,EAAS,EAAW,MAAM,EAAG,CAAC,EAC9B,EAAS,EAAW,MAAM,CAAC,EACjC,OAAO,EAAS,IAAI,EAAK,IAAI,EAAO,GAAG,IAAW,IAAI,EAAK,IAAI,GACnE,CAQA,SAAgB,EAAU,EAAuB,CAC7C,OAAO,EACF,QAAQ,MAAO,EAAE,CAAC,CAClB,MAAM,EAAG,EAAE,CAAC,CACZ,QAAQ,cAAe,OAAO,CAAC,CAC/B,QAAQ,cAAe,OAAO,CAAC,CAC/B,QAAQ,oBAAqB,OAAO,CAC7C,CAiCA,SAAgB,EACZ,EACA,EAAgC,CAAC,EAC3B,CACN,GAAI,EAAA,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,CAAO,EAC3E,IAAM,EAAW,EAAQ,UAAY,EACrC,OAAO,EAAA,aAAa,QAAS,CACzB,MAAO,UACP,sBAAuB,EACvB,sBAAuB,CAC3B,CAAC,CAAC,CAAC,OAAO,CAAK,CACnB"}
1
+ {"version":3,"file":"format.cjs","names":["isAbsent","fallbackText","numberFormat","dateTimeFormat","require_absent","require_intl_cache","formatCurrency","value","options","formatDate","date","formatDateForInput","month","day","formatDateTimeForInput","hours","minutes","formatDateTime","formatPhone","digits","area","subscriber","prefix","suffix","formatCPF","formatPercent","decimals"],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\n\n/**\n * Format a number as Brazilian Real currency.\n *\n * An absent or unrepresentable amount renders as `\"—\"` rather than as a number.\n * That branch is a data-correctness fix, not cosmetics: `Intl` coerces `null` to\n * zero, so an amount the backend left out used to reach the screen as\n * **`\"R$ 0,00\"`** — a plausible figure a reader has no way to question — and\n * `undefined` as `\"R$ NaN\"`.\n *\n * @example\n * ```typescript\n * formatCurrency(1234.56); // \"R$ 1.234,56\"\n * formatCurrency(null); // \"—\"\n * formatCurrency(null, { fallback: \"sem valor\" }); // \"sem valor\"\n * ```\n *\n * @param value - The amount in BRL, or `null`/`undefined` when there is none.\n * @param options - Text to render when there is nothing to format.\n * @returns A locale-formatted string, e.g. \"R$ 1.234,56\".\n */\nexport function formatCurrency(\n value: number | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(\"pt-BR\", { style: \"currency\", currency: \"BRL\" }).format(value);\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy`.\n *\n * Absent input answers `\"—\"`. It used to **throw**: `new Date(null)` is epoch and\n * `null.getTime` is a `TypeError`, so a nullable column — which is every\n * `deleted_at`, `expires_at` and half the `updated_at` a FastAPI backend sends —\n * took the screen down instead of rendering a gap.\n *\n * A value that is present and unparseable still answers `\"\"`, deliberately: on a\n * screen that reads a log, \"nobody filled this in\" and \"what they filled in is\n * broken\" are different findings, and the second is the one worth chasing.\n *\n * @example\n * ```typescript\n * formatDate(\"2026-05-16T12:00:00Z\"); // \"16/05/2026\"\n * formatDate(null); // \"—\"\n * formatDate(\"banana\"); // \"\"\n * ```\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted date string, the fallback when absent, or empty string when\n * the value is present and invalid.\n */\nexport function formatDate(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\").format(date);\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-dd`, the value an\n * `<input type=\"date\">` accepts.\n *\n * Built from the **local** calendar parts rather than `toISOString().slice(0, 10)`,\n * which is the reflex and which is wrong: `toISOString` converts to UTC first, so\n * anything after 21:00 in UTC-3 reports the next day and the form opens on the\n * wrong date. `formatDate` cannot fill this role because a date input rejects\n * `dd/MM/yyyy` outright.\n *\n * A value that is already `yyyy-MM-dd` is returned untouched, and that shortcut\n * is load-bearing rather than an optimisation: `new Date(\"2026-05-16\")` is parsed\n * as **UTC** midnight, which in UTC-3 is the 15th at 21:00, so round-tripping the\n * exact value a backend sent would move it back a day.\n *\n * @example\n * <input type=\"date\" defaultValue={formatDateForInput(order.createdAt)} />\n *\n * Absent input answers `\"\"` here — **not** the em dash the reading formatters\n * use — because that is what an input reads as \"no value\"; an em dash would\n * arrive as content the user has to delete before typing a date.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text for an absent value; defaults to `\"\"`.\n * @returns The `yyyy-MM-dd` value, or an empty string when the input is invalid —\n * which is what a date input reads as \"no value\", unlike `\"Invalid Date\"`.\n */\nexport function formatDateForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-ddTHH:mm`, the value an\n * `<input type=\"datetime-local\">` accepts.\n *\n * The sibling of {@link formatDateForInput}, and it exists for the same reason:\n * `toISOString().slice(0, 16)` is the reflex and it is wrong. `toISOString`\n * converts to UTC first, so a 22:00 appointment in UTC-3 opens the form on the\n * next day at 01:00 — here the trap costs the hour as well as the date.\n *\n * A value already in `yyyy-MM-ddTHH:mm` is returned untouched. A value carrying\n * a zone (`...Z`, `...-03:00`) deliberately does **not** take that shortcut: it\n * is a different instant from the naive string that looks like it, so it is\n * converted to the local calendar parts the input has to show.\n *\n * Seconds are dropped. A `datetime-local` steps by the minute unless the app\n * sets `step`, so a `:ss` the field cannot represent would be silently discarded\n * on the first edit anyway — truncating here keeps the rendered value and the\n * submitted value the same.\n *\n * @example\n * <input\n * type=\"datetime-local\"\n * defaultValue={formatDateTimeForInput(appointment.startsAt)}\n * />\n *\n * @param value - ISO string or Date.\n * @returns The `yyyy-MM-ddTHH:mm` value, or an empty string when the input is\n * invalid — which is what a datetime input reads as \"no value\", unlike\n * `\"Invalid Date\"`.\n */\nexport function formatDateTimeForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hours = `${date.getHours()}`.padStart(2, \"0\");\n const minutes = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}T${hours}:${minutes}`;\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy HH:mm`.\n *\n * Same contract as {@link formatDate}: absent answers the fallback (`\"—\"` by\n * default) instead of throwing, and present-but-invalid answers `\"\"`.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted datetime string, the fallback when absent, or empty string\n * when the value is present and invalid.\n */\nexport function formatDateTime(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\", { dateStyle: \"short\", timeStyle: \"short\" }).format(date);\n}\n\nexport interface FormatPhoneOptions {\n /**\n * Treat the number as a mobile line: insert the mandatory `9` after the area\n * code when it is missing, and group the subscriber part `5+4` from the\n * first digit typed instead of waiting for the eleventh.\n *\n * Default `false`, which keeps the length-based behaviour: `4+4` up to ten\n * digits, `5+4` at eleven.\n */\n mobile?: boolean;\n}\n\n/**\n * Apply the Brazilian phone mask `(XX) XXXXX-XXXX` or `(XX) XXXX-XXXX`.\n *\n * By default the grouping is decided by **length**, which is what a field\n * accepting both landlines and mobiles needs.\n *\n * `mobile: true` is for a field that only accepts mobile numbers, and it exists\n * because the default is wrong as an as-you-type mask there. Reading anything up\n * to ten digits as a landline puts the hyphen after the fourth subscriber digit,\n * so a half-typed mobile renders `(11) 9123-4`; it only becomes `(11) 91234-5`\n * once the eleventh digit lands. The separator visibly jumps backwards while the\n * user is still typing. With `mobile`, the same input reads `(11) 91234` and the\n * hyphen never moves. It also inserts the leading `9` every Brazilian mobile\n * carries, so a ten-digit number gets corrected rather than masked as a landline.\n *\n * @param value - Raw digits or partially masked string.\n * @param options - Masking options.\n * @returns Masked phone string.\n *\n * @example\n * formatPhone(\"1191234\"); // \"(11) 9123-4\"\n * formatPhone(\"1191234\", { mobile: true }); // \"(11) 91234\"\n * formatPhone(\"1112345678\", { mobile: true }); // \"(11) 91234-5678\" — 9 inserted\n */\nexport function formatPhone(value: string, options: FormatPhoneOptions = {}): string {\n const digits = value.replace(/\\D/g, \"\").slice(0, 11);\n\n if (!options.mobile) {\n if (digits.length <= 10) {\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{4})(\\d)/, \"$1-$2\");\n }\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{5})(\\d)/, \"$1-$2\");\n }\n\n if (digits.length <= 2) return digits;\n\n const area = digits.slice(0, 2);\n let subscriber = digits.slice(2);\n if (subscriber[0] !== \"9\") subscriber = `9${subscriber}`;\n subscriber = subscriber.slice(0, 9);\n\n const prefix = subscriber.slice(0, 5);\n const suffix = subscriber.slice(5);\n return suffix ? `(${area}) ${prefix}-${suffix}` : `(${area}) ${prefix}`;\n}\n\n/**\n * Apply the Brazilian CPF mask `XXX.XXX.XXX-XX`.\n *\n * @param value - Raw digits or partially masked string.\n * @returns Masked CPF string.\n */\nexport function formatCPF(value: string): string {\n return value\n .replace(/\\D/g, \"\")\n .slice(0, 11)\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d{1,2})$/, \"$1-$2\");\n}\n\n/** How {@link formatPercent} renders a fraction. */\nexport interface FormatPercentOptions extends FormatFallbackOptions {\n /**\n * Decimal places to show, fixed (padded as well as truncated).\n *\n * Defaults to `1`, which is what the function always did. Two is the case\n * that produced this option: a confidence of 98,74% and one of 98,7% are the\n * same number on a summary card and two different readings on a detail\n * screen, so the precision belongs to the call site.\n */\n decimals?: number;\n}\n\n/**\n * Format a fraction (0-1) as a percentage.\n *\n * A non-finite input renders as `\"—\"` rather than `\"NaN%\"` or `\"∞%\"`, which is\n * what `Intl.NumberFormat` produces and what a division by zero upstream puts on\n * the screen. It matches `formatDurationMs`, which already answers that way.\n *\n * @example\n * ```typescript\n * formatPercent(0.9874); // \"98,7%\"\n * formatPercent(0.9874, { decimals: 2 }); // \"98,74%\"\n * formatPercent(0 / 0); // \"—\"\n * ```\n *\n * @param value - Fraction between 0 and 1.\n * @param options - Rendering options; `decimals` defaults to 1.\n * @returns Formatted percent string, e.g. \"12,5%\", or `\"—\"` for a non-finite input.\n */\nexport function formatPercent(\n value: number | null | undefined,\n options: FormatPercentOptions = {},\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n const decimals = options.decimals ?? 1;\n return numberFormat(\"pt-BR\", {\n style: \"percent\",\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(value);\n}\n"],"mappings":"A,8DAuBA,SAAgBM,EACZ,EACA,EACM,CAEN,OADIN,EAAAA,SAASO,CAAK,GAAK,CAAC,OAAO,SAASA,CAAK,EAAUN,EAAAA,aAAaO,CAAO,EACpEN,EAAAA,aAAa,QAAS,CAAE,MAAO,WAAY,SAAU,KAAM,CAAC,CAAC,CAAC,OAAOK,CAAK,CACrF,CA0BA,SAAgBE,EACZ,EACA,EACM,CACN,GAAIT,EAAAA,SAASO,CAAK,EAAG,OAAON,EAAAA,aAAaO,CAAO,EAChD,IAAME,EAAO,OAAOH,GAAU,SAAW,IAAI,KAAKA,CAAK,EAAIA,EAE3D,OADI,OAAO,MAAMG,EAAK,QAAQ,CAAC,EAAU,GAClCP,EAAAA,eAAe,OAAO,CAAC,CAAC,OAAOO,CAAI,CAC9C,CA6BA,SAAgBC,EACZ,EACA,EACM,CACN,GAAIX,EAAAA,SAASO,CAAK,EAAG,OAAON,EAAAA,aAAaO,EAAS,EAAE,EACpD,GAAI,OAAOD,GAAU,UAAY,sBAAsB,KAAKA,CAAK,EAAG,OAAOA,EAC3E,IAAMG,EAAO,OAAOH,GAAU,SAAW,IAAI,KAAKA,CAAK,EAAIA,EAC3D,GAAI,OAAO,MAAMG,EAAK,QAAQ,CAAC,EAAG,MAAO,GACzC,IAAME,EAAQ,GAAGF,EAAK,SAAS,EAAI,IAAI,SAAS,EAAG,GAAG,EAChDG,EAAM,GAAGH,EAAK,QAAQ,IAAI,SAAS,EAAG,GAAG,EAC/C,MAAO,GAAGA,EAAK,YAAY,EAAE,GAAGE,EAAM,GAAGC,GAC7C,CAgCA,SAAgBC,EACZ,EACA,EACM,CACN,GAAId,EAAAA,SAASO,CAAK,EAAG,OAAON,EAAAA,aAAaO,EAAS,EAAE,EACpD,GAAI,OAAOD,GAAU,UAAY,kCAAkC,KAAKA,CAAK,EAAG,OAAOA,EACvF,IAAMG,EAAO,OAAOH,GAAU,SAAW,IAAI,KAAKA,CAAK,EAAIA,EAC3D,GAAI,OAAO,MAAMG,EAAK,QAAQ,CAAC,EAAG,MAAO,GACzC,IAAME,EAAQ,GAAGF,EAAK,SAAS,EAAI,IAAI,SAAS,EAAG,GAAG,EAChDG,EAAM,GAAGH,EAAK,QAAQ,IAAI,SAAS,EAAG,GAAG,EACzCK,EAAQ,GAAGL,EAAK,SAAS,IAAI,SAAS,EAAG,GAAG,EAC5CM,EAAU,GAAGN,EAAK,WAAW,IAAI,SAAS,EAAG,GAAG,EACtD,MAAO,GAAGA,EAAK,YAAY,EAAE,GAAGE,EAAM,GAAGC,EAAI,GAAGE,EAAM,GAAGC,GAC7D,CAaA,SAAgBC,EACZ,EACA,EACM,CACN,GAAIjB,EAAAA,SAASO,CAAK,EAAG,OAAON,EAAAA,aAAaO,CAAO,EAChD,IAAME,EAAO,OAAOH,GAAU,SAAW,IAAI,KAAKA,CAAK,EAAIA,EAE3D,OADI,OAAO,MAAMG,EAAK,QAAQ,CAAC,EAAU,GAClCP,EAAAA,eAAe,QAAS,CAAE,UAAW,QAAS,UAAW,OAAQ,CAAC,CAAC,CAAC,OAAOO,CAAI,CAC1F,CAsCA,SAAgBQ,EAAY,EAAe,EAA8B,CAAC,EAAW,CACjF,IAAMC,EAASZ,EAAM,QAAQ,MAAO,EAAE,CAAC,CAAC,MAAM,EAAG,EAAE,EAEnD,GAAI,CAACC,EAAQ,OAIT,OAHIW,EAAO,QAAU,GACVA,EAAO,QAAQ,cAAe,SAAS,CAAC,CAAC,QAAQ,cAAe,OAAO,EAE3EA,EAAO,QAAQ,cAAe,SAAS,CAAC,CAAC,QAAQ,cAAe,OAAO,EAGlF,GAAIA,EAAO,QAAU,EAAG,OAAOA,EAE/B,IAAMC,EAAOD,EAAO,MAAM,EAAG,CAAC,EAC1BE,EAAaF,EAAO,MAAM,CAAC,EAC3BE,EAAW,KAAO,MAAK,EAAa,IAAIA,KAC5C,EAAaA,EAAW,MAAM,EAAG,CAAC,EAElC,IAAMC,EAASD,EAAW,MAAM,EAAG,CAAC,EAC9BE,EAASF,EAAW,MAAM,CAAC,EACjC,OAAOE,EAAS,IAAIH,EAAK,IAAIE,EAAO,GAAGC,IAAW,IAAIH,EAAK,IAAIE,GACnE,CAQA,SAAgBE,EAAU,EAAuB,CAC7C,OAAOjB,EACF,QAAQ,MAAO,EAAE,CAAC,CAClB,MAAM,EAAG,EAAE,CAAC,CACZ,QAAQ,cAAe,OAAO,CAAC,CAC/B,QAAQ,cAAe,OAAO,CAAC,CAC/B,QAAQ,oBAAqB,OAAO,CAC7C,CAiCA,SAAgBkB,EACZ,EACA,EAAgC,CAAC,EAC3B,CACN,GAAIzB,EAAAA,SAASO,CAAK,GAAK,CAAC,OAAO,SAASA,CAAK,EAAG,OAAON,EAAAA,aAAaO,CAAO,EAC3E,IAAMkB,EAAWlB,EAAQ,UAAY,EACrC,OAAON,EAAAA,aAAa,QAAS,CACzB,MAAO,UACP,sBAAuBwB,EACvB,sBAAuBA,CAC3B,CAAC,CAAC,CAAC,OAAOnB,CAAK,CACnB,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\n\n/**\n * Format a number as Brazilian Real currency.\n *\n * An absent or unrepresentable amount renders as `\"—\"` rather than as a number.\n * That branch is a data-correctness fix, not cosmetics: `Intl` coerces `null` to\n * zero, so an amount the backend left out used to reach the screen as\n * **`\"R$ 0,00\"`** — a plausible figure a reader has no way to question — and\n * `undefined` as `\"R$ NaN\"`.\n *\n * @example\n * ```typescript\n * formatCurrency(1234.56); // \"R$ 1.234,56\"\n * formatCurrency(null); // \"—\"\n * formatCurrency(null, { fallback: \"sem valor\" }); // \"sem valor\"\n * ```\n *\n * @param value - The amount in BRL, or `null`/`undefined` when there is none.\n * @param options - Text to render when there is nothing to format.\n * @returns A locale-formatted string, e.g. \"R$ 1.234,56\".\n */\nexport function formatCurrency(\n value: number | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(\"pt-BR\", { style: \"currency\", currency: \"BRL\" }).format(value);\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy`.\n *\n * Absent input answers `\"—\"`. It used to **throw**: `new Date(null)` is epoch and\n * `null.getTime` is a `TypeError`, so a nullable column — which is every\n * `deleted_at`, `expires_at` and half the `updated_at` a FastAPI backend sends —\n * took the screen down instead of rendering a gap.\n *\n * A value that is present and unparseable still answers `\"\"`, deliberately: on a\n * screen that reads a log, \"nobody filled this in\" and \"what they filled in is\n * broken\" are different findings, and the second is the one worth chasing.\n *\n * @example\n * ```typescript\n * formatDate(\"2026-05-16T12:00:00Z\"); // \"16/05/2026\"\n * formatDate(null); // \"—\"\n * formatDate(\"banana\"); // \"\"\n * ```\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted date string, the fallback when absent, or empty string when\n * the value is present and invalid.\n */\nexport function formatDate(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\").format(date);\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-dd`, the value an\n * `<input type=\"date\">` accepts.\n *\n * Built from the **local** calendar parts rather than `toISOString().slice(0, 10)`,\n * which is the reflex and which is wrong: `toISOString` converts to UTC first, so\n * anything after 21:00 in UTC-3 reports the next day and the form opens on the\n * wrong date. `formatDate` cannot fill this role because a date input rejects\n * `dd/MM/yyyy` outright.\n *\n * A value that is already `yyyy-MM-dd` is returned untouched, and that shortcut\n * is load-bearing rather than an optimisation: `new Date(\"2026-05-16\")` is parsed\n * as **UTC** midnight, which in UTC-3 is the 15th at 21:00, so round-tripping the\n * exact value a backend sent would move it back a day.\n *\n * @example\n * <input type=\"date\" defaultValue={formatDateForInput(order.createdAt)} />\n *\n * Absent input answers `\"\"` here — **not** the em dash the reading formatters\n * use — because that is what an input reads as \"no value\"; an em dash would\n * arrive as content the user has to delete before typing a date.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text for an absent value; defaults to `\"\"`.\n * @returns The `yyyy-MM-dd` value, or an empty string when the input is invalid —\n * which is what a date input reads as \"no value\", unlike `\"Invalid Date\"`.\n */\nexport function formatDateForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-ddTHH:mm`, the value an\n * `<input type=\"datetime-local\">` accepts.\n *\n * The sibling of {@link formatDateForInput}, and it exists for the same reason:\n * `toISOString().slice(0, 16)` is the reflex and it is wrong. `toISOString`\n * converts to UTC first, so a 22:00 appointment in UTC-3 opens the form on the\n * next day at 01:00 — here the trap costs the hour as well as the date.\n *\n * A value already in `yyyy-MM-ddTHH:mm` is returned untouched. A value carrying\n * a zone (`...Z`, `...-03:00`) deliberately does **not** take that shortcut: it\n * is a different instant from the naive string that looks like it, so it is\n * converted to the local calendar parts the input has to show.\n *\n * Seconds are dropped. A `datetime-local` steps by the minute unless the app\n * sets `step`, so a `:ss` the field cannot represent would be silently discarded\n * on the first edit anyway — truncating here keeps the rendered value and the\n * submitted value the same.\n *\n * @example\n * <input\n * type=\"datetime-local\"\n * defaultValue={formatDateTimeForInput(appointment.startsAt)}\n * />\n *\n * @param value - ISO string or Date.\n * @returns The `yyyy-MM-ddTHH:mm` value, or an empty string when the input is\n * invalid — which is what a datetime input reads as \"no value\", unlike\n * `\"Invalid Date\"`.\n */\nexport function formatDateTimeForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hours = `${date.getHours()}`.padStart(2, \"0\");\n const minutes = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}T${hours}:${minutes}`;\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy HH:mm`.\n *\n * Same contract as {@link formatDate}: absent answers the fallback (`\"—\"` by\n * default) instead of throwing, and present-but-invalid answers `\"\"`.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted datetime string, the fallback when absent, or empty string\n * when the value is present and invalid.\n */\nexport function formatDateTime(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\", { dateStyle: \"short\", timeStyle: \"short\" }).format(date);\n}\n\nexport interface FormatPhoneOptions {\n /**\n * Treat the number as a mobile line: insert the mandatory `9` after the area\n * code when it is missing, and group the subscriber part `5+4` from the\n * first digit typed instead of waiting for the eleventh.\n *\n * Default `false`, which keeps the length-based behaviour: `4+4` up to ten\n * digits, `5+4` at eleven.\n */\n mobile?: boolean;\n}\n\n/**\n * Apply the Brazilian phone mask `(XX) XXXXX-XXXX` or `(XX) XXXX-XXXX`.\n *\n * By default the grouping is decided by **length**, which is what a field\n * accepting both landlines and mobiles needs.\n *\n * `mobile: true` is for a field that only accepts mobile numbers, and it exists\n * because the default is wrong as an as-you-type mask there. Reading anything up\n * to ten digits as a landline puts the hyphen after the fourth subscriber digit,\n * so a half-typed mobile renders `(11) 9123-4`; it only becomes `(11) 91234-5`\n * once the eleventh digit lands. The separator visibly jumps backwards while the\n * user is still typing. With `mobile`, the same input reads `(11) 91234` and the\n * hyphen never moves. It also inserts the leading `9` every Brazilian mobile\n * carries, so a ten-digit number gets corrected rather than masked as a landline.\n *\n * @param value - Raw digits or partially masked string.\n * @param options - Masking options.\n * @returns Masked phone string.\n *\n * @example\n * formatPhone(\"1191234\"); // \"(11) 9123-4\"\n * formatPhone(\"1191234\", { mobile: true }); // \"(11) 91234\"\n * formatPhone(\"1112345678\", { mobile: true }); // \"(11) 91234-5678\" — 9 inserted\n */\nexport function formatPhone(value: string, options: FormatPhoneOptions = {}): string {\n const digits = value.replace(/\\D/g, \"\").slice(0, 11);\n\n if (!options.mobile) {\n if (digits.length <= 10) {\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{4})(\\d)/, \"$1-$2\");\n }\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{5})(\\d)/, \"$1-$2\");\n }\n\n if (digits.length <= 2) return digits;\n\n const area = digits.slice(0, 2);\n let subscriber = digits.slice(2);\n if (subscriber[0] !== \"9\") subscriber = `9${subscriber}`;\n subscriber = subscriber.slice(0, 9);\n\n const prefix = subscriber.slice(0, 5);\n const suffix = subscriber.slice(5);\n return suffix ? `(${area}) ${prefix}-${suffix}` : `(${area}) ${prefix}`;\n}\n\n/**\n * Apply the Brazilian CPF mask `XXX.XXX.XXX-XX`.\n *\n * @param value - Raw digits or partially masked string.\n * @returns Masked CPF string.\n */\nexport function formatCPF(value: string): string {\n return value\n .replace(/\\D/g, \"\")\n .slice(0, 11)\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d{1,2})$/, \"$1-$2\");\n}\n\n/** How {@link formatPercent} renders a fraction. */\nexport interface FormatPercentOptions extends FormatFallbackOptions {\n /**\n * Decimal places to show, fixed (padded as well as truncated).\n *\n * Defaults to `1`, which is what the function always did. Two is the case\n * that produced this option: a confidence of 98,74% and one of 98,7% are the\n * same number on a summary card and two different readings on a detail\n * screen, so the precision belongs to the call site.\n */\n decimals?: number;\n}\n\n/**\n * Format a fraction (0-1) as a percentage.\n *\n * A non-finite input renders as `\"—\"` rather than `\"NaN%\"` or `\"∞%\"`, which is\n * what `Intl.NumberFormat` produces and what a division by zero upstream puts on\n * the screen. It matches `formatDurationMs`, which already answers that way.\n *\n * @example\n * ```typescript\n * formatPercent(0.9874); // \"98,7%\"\n * formatPercent(0.9874, { decimals: 2 }); // \"98,74%\"\n * formatPercent(0 / 0); // \"—\"\n * ```\n *\n * @param value - Fraction between 0 and 1.\n * @param options - Rendering options; `decimals` defaults to 1.\n * @returns Formatted percent string, e.g. \"12,5%\", or `\"—\"` for a non-finite input.\n */\nexport function formatPercent(\n value: number | null | undefined,\n options: FormatPercentOptions = {},\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n const decimals = options.decimals ?? 1;\n return numberFormat(\"pt-BR\", {\n style: \"percent\",\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(value);\n}\n"],"mappings":";;;AAuBA,SAAgB,EACZ,GACA,GACM;CAEN,OADI,EAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAK,IAAU,EAAa,CAAO,IACpE,EAAa,SAAS;EAAE,OAAO;EAAY,UAAU;CAAM,CAAC,CAAC,CAAC,OAAO,CAAK;AACrF;AA0BA,SAAgB,EACZ,GACA,GACM;CACN,IAAI,EAAS,CAAK,GAAG,OAAO,EAAa,CAAO;CAChD,IAAM,IAAO,OAAO,KAAU,WAAW,IAAI,KAAK,CAAK,IAAI;CAE3D,OADI,OAAO,MAAM,EAAK,QAAQ,CAAC,IAAU,KAClC,EAAe,OAAO,CAAC,CAAC,OAAO,CAAI;AAC9C;AA6BA,SAAgB,EACZ,GACA,GACM;CACN,IAAI,EAAS,CAAK,GAAG,OAAO,EAAa,GAAS,EAAE;CACpD,IAAI,OAAO,KAAU,YAAY,sBAAsB,KAAK,CAAK,GAAG,OAAO;CAC3E,IAAM,IAAO,OAAO,KAAU,WAAW,IAAI,KAAK,CAAK,IAAI;CAC3D,IAAI,OAAO,MAAM,EAAK,QAAQ,CAAC,GAAG,OAAO;CACzC,IAAM,IAAQ,GAAG,EAAK,SAAS,IAAI,IAAI,SAAS,GAAG,GAAG,GAChD,IAAM,GAAG,EAAK,QAAQ,IAAI,SAAS,GAAG,GAAG;CAC/C,OAAO,GAAG,EAAK,YAAY,EAAE,GAAG,EAAM,GAAG;AAC7C;AAgCA,SAAgB,EACZ,GACA,GACM;CACN,IAAI,EAAS,CAAK,GAAG,OAAO,EAAa,GAAS,EAAE;CACpD,IAAI,OAAO,KAAU,YAAY,kCAAkC,KAAK,CAAK,GAAG,OAAO;CACvF,IAAM,IAAO,OAAO,KAAU,WAAW,IAAI,KAAK,CAAK,IAAI;CAC3D,IAAI,OAAO,MAAM,EAAK,QAAQ,CAAC,GAAG,OAAO;CACzC,IAAM,IAAQ,GAAG,EAAK,SAAS,IAAI,IAAI,SAAS,GAAG,GAAG,GAChD,IAAM,GAAG,EAAK,QAAQ,IAAI,SAAS,GAAG,GAAG,GACzC,IAAQ,GAAG,EAAK,SAAS,IAAI,SAAS,GAAG,GAAG,GAC5C,IAAU,GAAG,EAAK,WAAW,IAAI,SAAS,GAAG,GAAG;CACtD,OAAO,GAAG,EAAK,YAAY,EAAE,GAAG,EAAM,GAAG,EAAI,GAAG,EAAM,GAAG;AAC7D;AAaA,SAAgB,EACZ,GACA,GACM;CACN,IAAI,EAAS,CAAK,GAAG,OAAO,EAAa,CAAO;CAChD,IAAM,IAAO,OAAO,KAAU,WAAW,IAAI,KAAK,CAAK,IAAI;CAE3D,OADI,OAAO,MAAM,EAAK,QAAQ,CAAC,IAAU,KAClC,EAAe,SAAS;EAAE,WAAW;EAAS,WAAW;CAAQ,CAAC,CAAC,CAAC,OAAO,CAAI;AAC1F;AAsCA,SAAgB,EAAY,GAAe,IAA8B,CAAC,GAAW;CACjF,IAAM,IAAS,EAAM,QAAQ,OAAO,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;CAEnD,IAAI,CAAC,EAAQ,QAIT,OAHI,EAAO,UAAU,KACV,EAAO,QAAQ,eAAe,SAAS,CAAC,CAAC,QAAQ,eAAe,OAAO,IAE3E,EAAO,QAAQ,eAAe,SAAS,CAAC,CAAC,QAAQ,eAAe,OAAO;CAGlF,IAAI,EAAO,UAAU,GAAG,OAAO;CAE/B,IAAM,IAAO,EAAO,MAAM,GAAG,CAAC,GAC1B,IAAa,EAAO,MAAM,CAAC;CAE/B,AADI,EAAW,OAAO,QAAK,IAAa,IAAI,MAC5C,IAAa,EAAW,MAAM,GAAG,CAAC;CAElC,IAAM,IAAS,EAAW,MAAM,GAAG,CAAC,GAC9B,IAAS,EAAW,MAAM,CAAC;CACjC,OAAO,IAAS,IAAI,EAAK,IAAI,EAAO,GAAG,MAAW,IAAI,EAAK,IAAI;AACnE;AAQA,SAAgB,EAAU,GAAuB;CAC7C,OAAO,EACF,QAAQ,OAAO,EAAE,CAAC,CAClB,MAAM,GAAG,EAAE,CAAC,CACZ,QAAQ,eAAe,OAAO,CAAC,CAC/B,QAAQ,eAAe,OAAO,CAAC,CAC/B,QAAQ,qBAAqB,OAAO;AAC7C;AAiCA,SAAgB,EACZ,GACA,IAAgC,CAAC,GAC3B;CACN,IAAI,EAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAK,GAAG,OAAO,EAAa,CAAO;CAC3E,IAAM,IAAW,EAAQ,YAAY;CACrC,OAAO,EAAa,SAAS;EACzB,OAAO;EACP,uBAAuB;EACvB,uBAAuB;CAC3B,CAAC,CAAC,CAAC,OAAO,CAAK;AACnB"}
1
+ {"version":3,"file":"format.js","names":["formatCurrency","isAbsent","value","fallbackText","options","numberFormat","formatDate","date","dateTimeFormat","formatDateForInput","month","day","formatDateTimeForInput","hours","minutes","formatDateTime","formatPhone","digits","area","subscriber","prefix","suffix","formatCPF","formatPercent","decimals"],"sources":["../../src/utils/format.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { dateTimeFormat, numberFormat } from \"@/utils/intl-cache\";\n\n/**\n * Format a number as Brazilian Real currency.\n *\n * An absent or unrepresentable amount renders as `\"—\"` rather than as a number.\n * That branch is a data-correctness fix, not cosmetics: `Intl` coerces `null` to\n * zero, so an amount the backend left out used to reach the screen as\n * **`\"R$ 0,00\"`** — a plausible figure a reader has no way to question — and\n * `undefined` as `\"R$ NaN\"`.\n *\n * @example\n * ```typescript\n * formatCurrency(1234.56); // \"R$ 1.234,56\"\n * formatCurrency(null); // \"—\"\n * formatCurrency(null, { fallback: \"sem valor\" }); // \"sem valor\"\n * ```\n *\n * @param value - The amount in BRL, or `null`/`undefined` when there is none.\n * @param options - Text to render when there is nothing to format.\n * @returns A locale-formatted string, e.g. \"R$ 1.234,56\".\n */\nexport function formatCurrency(\n value: number | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(\"pt-BR\", { style: \"currency\", currency: \"BRL\" }).format(value);\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy`.\n *\n * Absent input answers `\"—\"`. It used to **throw**: `new Date(null)` is epoch and\n * `null.getTime` is a `TypeError`, so a nullable column — which is every\n * `deleted_at`, `expires_at` and half the `updated_at` a FastAPI backend sends —\n * took the screen down instead of rendering a gap.\n *\n * A value that is present and unparseable still answers `\"\"`, deliberately: on a\n * screen that reads a log, \"nobody filled this in\" and \"what they filled in is\n * broken\" are different findings, and the second is the one worth chasing.\n *\n * @example\n * ```typescript\n * formatDate(\"2026-05-16T12:00:00Z\"); // \"16/05/2026\"\n * formatDate(null); // \"—\"\n * formatDate(\"banana\"); // \"\"\n * ```\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted date string, the fallback when absent, or empty string when\n * the value is present and invalid.\n */\nexport function formatDate(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\").format(date);\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-dd`, the value an\n * `<input type=\"date\">` accepts.\n *\n * Built from the **local** calendar parts rather than `toISOString().slice(0, 10)`,\n * which is the reflex and which is wrong: `toISOString` converts to UTC first, so\n * anything after 21:00 in UTC-3 reports the next day and the form opens on the\n * wrong date. `formatDate` cannot fill this role because a date input rejects\n * `dd/MM/yyyy` outright.\n *\n * A value that is already `yyyy-MM-dd` is returned untouched, and that shortcut\n * is load-bearing rather than an optimisation: `new Date(\"2026-05-16\")` is parsed\n * as **UTC** midnight, which in UTC-3 is the 15th at 21:00, so round-tripping the\n * exact value a backend sent would move it back a day.\n *\n * @example\n * <input type=\"date\" defaultValue={formatDateForInput(order.createdAt)} />\n *\n * Absent input answers `\"\"` here — **not** the em dash the reading formatters\n * use — because that is what an input reads as \"no value\"; an em dash would\n * arrive as content the user has to delete before typing a date.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text for an absent value; defaults to `\"\"`.\n * @returns The `yyyy-MM-dd` value, or an empty string when the input is invalid —\n * which is what a date input reads as \"no value\", unlike `\"Invalid Date\"`.\n */\nexport function formatDateForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n}\n\n/**\n * Format an ISO date or Date instance as `yyyy-MM-ddTHH:mm`, the value an\n * `<input type=\"datetime-local\">` accepts.\n *\n * The sibling of {@link formatDateForInput}, and it exists for the same reason:\n * `toISOString().slice(0, 16)` is the reflex and it is wrong. `toISOString`\n * converts to UTC first, so a 22:00 appointment in UTC-3 opens the form on the\n * next day at 01:00 — here the trap costs the hour as well as the date.\n *\n * A value already in `yyyy-MM-ddTHH:mm` is returned untouched. A value carrying\n * a zone (`...Z`, `...-03:00`) deliberately does **not** take that shortcut: it\n * is a different instant from the naive string that looks like it, so it is\n * converted to the local calendar parts the input has to show.\n *\n * Seconds are dropped. A `datetime-local` steps by the minute unless the app\n * sets `step`, so a `:ss` the field cannot represent would be silently discarded\n * on the first edit anyway — truncating here keeps the rendered value and the\n * submitted value the same.\n *\n * @example\n * <input\n * type=\"datetime-local\"\n * defaultValue={formatDateTimeForInput(appointment.startsAt)}\n * />\n *\n * @param value - ISO string or Date.\n * @returns The `yyyy-MM-ddTHH:mm` value, or an empty string when the input is\n * invalid — which is what a datetime input reads as \"no value\", unlike\n * `\"Invalid Date\"`.\n */\nexport function formatDateTimeForInput(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options, \"\");\n if (typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}$/.test(value)) return value;\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hours = `${date.getHours()}`.padStart(2, \"0\");\n const minutes = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}T${hours}:${minutes}`;\n}\n\n/**\n * Format an ISO date or Date instance as `dd/MM/yyyy HH:mm`.\n *\n * Same contract as {@link formatDate}: absent answers the fallback (`\"—\"` by\n * default) instead of throwing, and present-but-invalid answers `\"\"`.\n *\n * @param value - ISO string, Date, or `null`/`undefined`.\n * @param options - Text to render when the value is absent.\n * @returns Formatted datetime string, the fallback when absent, or empty string\n * when the value is present and invalid.\n */\nexport function formatDateTime(\n value: string | Date | null | undefined,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value)) return fallbackText(options);\n const date = typeof value === \"string\" ? new Date(value) : value;\n if (Number.isNaN(date.getTime())) return \"\";\n return dateTimeFormat(\"pt-BR\", { dateStyle: \"short\", timeStyle: \"short\" }).format(date);\n}\n\nexport interface FormatPhoneOptions {\n /**\n * Treat the number as a mobile line: insert the mandatory `9` after the area\n * code when it is missing, and group the subscriber part `5+4` from the\n * first digit typed instead of waiting for the eleventh.\n *\n * Default `false`, which keeps the length-based behaviour: `4+4` up to ten\n * digits, `5+4` at eleven.\n */\n mobile?: boolean;\n}\n\n/**\n * Apply the Brazilian phone mask `(XX) XXXXX-XXXX` or `(XX) XXXX-XXXX`.\n *\n * By default the grouping is decided by **length**, which is what a field\n * accepting both landlines and mobiles needs.\n *\n * `mobile: true` is for a field that only accepts mobile numbers, and it exists\n * because the default is wrong as an as-you-type mask there. Reading anything up\n * to ten digits as a landline puts the hyphen after the fourth subscriber digit,\n * so a half-typed mobile renders `(11) 9123-4`; it only becomes `(11) 91234-5`\n * once the eleventh digit lands. The separator visibly jumps backwards while the\n * user is still typing. With `mobile`, the same input reads `(11) 91234` and the\n * hyphen never moves. It also inserts the leading `9` every Brazilian mobile\n * carries, so a ten-digit number gets corrected rather than masked as a landline.\n *\n * @param value - Raw digits or partially masked string.\n * @param options - Masking options.\n * @returns Masked phone string.\n *\n * @example\n * formatPhone(\"1191234\"); // \"(11) 9123-4\"\n * formatPhone(\"1191234\", { mobile: true }); // \"(11) 91234\"\n * formatPhone(\"1112345678\", { mobile: true }); // \"(11) 91234-5678\" — 9 inserted\n */\nexport function formatPhone(value: string, options: FormatPhoneOptions = {}): string {\n const digits = value.replace(/\\D/g, \"\").slice(0, 11);\n\n if (!options.mobile) {\n if (digits.length <= 10) {\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{4})(\\d)/, \"$1-$2\");\n }\n return digits.replace(/(\\d{2})(\\d)/, \"($1) $2\").replace(/(\\d{5})(\\d)/, \"$1-$2\");\n }\n\n if (digits.length <= 2) return digits;\n\n const area = digits.slice(0, 2);\n let subscriber = digits.slice(2);\n if (subscriber[0] !== \"9\") subscriber = `9${subscriber}`;\n subscriber = subscriber.slice(0, 9);\n\n const prefix = subscriber.slice(0, 5);\n const suffix = subscriber.slice(5);\n return suffix ? `(${area}) ${prefix}-${suffix}` : `(${area}) ${prefix}`;\n}\n\n/**\n * Apply the Brazilian CPF mask `XXX.XXX.XXX-XX`.\n *\n * @param value - Raw digits or partially masked string.\n * @returns Masked CPF string.\n */\nexport function formatCPF(value: string): string {\n return value\n .replace(/\\D/g, \"\")\n .slice(0, 11)\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d)/, \"$1.$2\")\n .replace(/(\\d{3})(\\d{1,2})$/, \"$1-$2\");\n}\n\n/** How {@link formatPercent} renders a fraction. */\nexport interface FormatPercentOptions extends FormatFallbackOptions {\n /**\n * Decimal places to show, fixed (padded as well as truncated).\n *\n * Defaults to `1`, which is what the function always did. Two is the case\n * that produced this option: a confidence of 98,74% and one of 98,7% are the\n * same number on a summary card and two different readings on a detail\n * screen, so the precision belongs to the call site.\n */\n decimals?: number;\n}\n\n/**\n * Format a fraction (0-1) as a percentage.\n *\n * A non-finite input renders as `\"—\"` rather than `\"NaN%\"` or `\"∞%\"`, which is\n * what `Intl.NumberFormat` produces and what a division by zero upstream puts on\n * the screen. It matches `formatDurationMs`, which already answers that way.\n *\n * @example\n * ```typescript\n * formatPercent(0.9874); // \"98,7%\"\n * formatPercent(0.9874, { decimals: 2 }); // \"98,74%\"\n * formatPercent(0 / 0); // \"—\"\n * ```\n *\n * @param value - Fraction between 0 and 1.\n * @param options - Rendering options; `decimals` defaults to 1.\n * @returns Formatted percent string, e.g. \"12,5%\", or `\"—\"` for a non-finite input.\n */\nexport function formatPercent(\n value: number | null | undefined,\n options: FormatPercentOptions = {},\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n const decimals = options.decimals ?? 1;\n return numberFormat(\"pt-BR\", {\n style: \"percent\",\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n }).format(value);\n}\n"],"mappings":";;;AAuBA,SAAgBA,EACZ,GACA,GACM;CAEN,OADIC,EAASC,CAAK,KAAK,CAAC,OAAO,SAASA,CAAK,IAAUC,EAAaC,CAAO,IACpEC,EAAa,SAAS;EAAE,OAAO;EAAY,UAAU;CAAM,CAAC,CAAC,CAAC,OAAOH,CAAK;AACrF;AA0BA,SAAgBI,EACZ,GACA,GACM;CACN,IAAIL,EAASC,CAAK,GAAG,OAAOC,EAAaC,CAAO;CAChD,IAAMG,IAAO,OAAOL,KAAU,WAAW,IAAI,KAAKA,CAAK,IAAIA;CAE3D,OADI,OAAO,MAAMK,EAAK,QAAQ,CAAC,IAAU,KAClCC,EAAe,OAAO,CAAC,CAAC,OAAOD,CAAI;AAC9C;AA6BA,SAAgBE,EACZ,GACA,GACM;CACN,IAAIR,EAASC,CAAK,GAAG,OAAOC,EAAaC,GAAS,EAAE;CACpD,IAAI,OAAOF,KAAU,YAAY,sBAAsB,KAAKA,CAAK,GAAG,OAAOA;CAC3E,IAAMK,IAAO,OAAOL,KAAU,WAAW,IAAI,KAAKA,CAAK,IAAIA;CAC3D,IAAI,OAAO,MAAMK,EAAK,QAAQ,CAAC,GAAG,OAAO;CACzC,IAAMG,IAAQ,GAAGH,EAAK,SAAS,IAAI,IAAI,SAAS,GAAG,GAAG,GAChDI,IAAM,GAAGJ,EAAK,QAAQ,IAAI,SAAS,GAAG,GAAG;CAC/C,OAAO,GAAGA,EAAK,YAAY,EAAE,GAAGG,EAAM,GAAGC;AAC7C;AAgCA,SAAgBC,EACZ,GACA,GACM;CACN,IAAIX,EAASC,CAAK,GAAG,OAAOC,EAAaC,GAAS,EAAE;CACpD,IAAI,OAAOF,KAAU,YAAY,kCAAkC,KAAKA,CAAK,GAAG,OAAOA;CACvF,IAAMK,IAAO,OAAOL,KAAU,WAAW,IAAI,KAAKA,CAAK,IAAIA;CAC3D,IAAI,OAAO,MAAMK,EAAK,QAAQ,CAAC,GAAG,OAAO;CACzC,IAAMG,IAAQ,GAAGH,EAAK,SAAS,IAAI,IAAI,SAAS,GAAG,GAAG,GAChDI,IAAM,GAAGJ,EAAK,QAAQ,IAAI,SAAS,GAAG,GAAG,GACzCM,IAAQ,GAAGN,EAAK,SAAS,IAAI,SAAS,GAAG,GAAG,GAC5CO,IAAU,GAAGP,EAAK,WAAW,IAAI,SAAS,GAAG,GAAG;CACtD,OAAO,GAAGA,EAAK,YAAY,EAAE,GAAGG,EAAM,GAAGC,EAAI,GAAGE,EAAM,GAAGC;AAC7D;AAaA,SAAgBC,EACZ,GACA,GACM;CACN,IAAId,EAASC,CAAK,GAAG,OAAOC,EAAaC,CAAO;CAChD,IAAMG,IAAO,OAAOL,KAAU,WAAW,IAAI,KAAKA,CAAK,IAAIA;CAE3D,OADI,OAAO,MAAMK,EAAK,QAAQ,CAAC,IAAU,KAClCC,EAAe,SAAS;EAAE,WAAW;EAAS,WAAW;CAAQ,CAAC,CAAC,CAAC,OAAOD,CAAI;AAC1F;AAsCA,SAAgBS,EAAY,GAAe,IAA8B,CAAC,GAAW;CACjF,IAAMC,IAASf,EAAM,QAAQ,OAAO,EAAE,CAAC,CAAC,MAAM,GAAG,EAAE;CAEnD,IAAI,CAACE,EAAQ,QAIT,OAHIa,EAAO,UAAU,KACVA,EAAO,QAAQ,eAAe,SAAS,CAAC,CAAC,QAAQ,eAAe,OAAO,IAE3EA,EAAO,QAAQ,eAAe,SAAS,CAAC,CAAC,QAAQ,eAAe,OAAO;CAGlF,IAAIA,EAAO,UAAU,GAAG,OAAOA;CAE/B,IAAMC,IAAOD,EAAO,MAAM,GAAG,CAAC,GAC1BE,IAAaF,EAAO,MAAM,CAAC;CAE/B,AADIE,EAAW,OAAO,QAAK,IAAa,IAAIA,MAC5C,IAAaA,EAAW,MAAM,GAAG,CAAC;CAElC,IAAMC,IAASD,EAAW,MAAM,GAAG,CAAC,GAC9BE,IAASF,EAAW,MAAM,CAAC;CACjC,OAAOE,IAAS,IAAIH,EAAK,IAAIE,EAAO,GAAGC,MAAW,IAAIH,EAAK,IAAIE;AACnE;AAQA,SAAgBE,EAAU,GAAuB;CAC7C,OAAOpB,EACF,QAAQ,OAAO,EAAE,CAAC,CAClB,MAAM,GAAG,EAAE,CAAC,CACZ,QAAQ,eAAe,OAAO,CAAC,CAC/B,QAAQ,eAAe,OAAO,CAAC,CAC/B,QAAQ,qBAAqB,OAAO;AAC7C;AAiCA,SAAgBqB,EACZ,GACA,IAAgC,CAAC,GAC3B;CACN,IAAItB,EAASC,CAAK,KAAK,CAAC,OAAO,SAASA,CAAK,GAAG,OAAOC,EAAaC,CAAO;CAC3E,IAAMoB,IAAWpB,EAAQ,YAAY;CACrC,OAAOC,EAAa,SAAS;EACzB,OAAO;EACP,uBAAuBmB;EACvB,uBAAuBA;CAC3B,CAAC,CAAC,CAAC,OAAOtB,CAAK;AACnB"}
@@ -1,2 +1,2 @@
1
- function e(e,t){let n,r=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return r.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},r}function t(e,t){let n,r,i=0,a=t=>{i=Date.now(),e(...t)},o=(...e)=>{let o=t-(Date.now()-i);o<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(e)):(r=e,n===void 0&&(n=setTimeout(()=>{if(n=void 0,r!==void 0){let e=r;r=void 0,a(e)}},o)))};return o.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),r=void 0,i=0},o}function n(e){let t=!1,n;return(...r)=>(t||(t=!0,n=e(...r)),n)}function r(e){let t=!1,n,r,i=e=>{if(!t||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0};return(...a)=>i(a)?r:(n=a,r=e(...a),t=!0,r)}exports.debounce=e,exports.memoizeOne=r,exports.once=n,exports.throttle=t;
1
+ function e(e,t){let n,r=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return r.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},r}function t(e,t){let n,r,i=0,a=t=>{i=Date.now(),e(...t)},o=(...e)=>{let o=t-(Date.now()-i);o<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(e)):(r=e,n===void 0&&(n=setTimeout(()=>{if(n=void 0,r!==void 0){let e=r;r=void 0,a(e)}},o)))};return o.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),r=void 0,i=0},o}function n(e){let t=!1,n;return(...r)=>(t||(t=!0,n=e(...r)),n)}function r(e){let t=!1,n,r,i=e=>{if(!t||e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!Object.is(e[t],n[t]))return!1;return!0};return(...a)=>(i(a)||(n=a,r=e(...a),t=!0),r)}exports.debounce=e,exports.memoizeOne=r,exports.once=n,exports.throttle=t;
2
2
  //# sourceMappingURL=functions.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"functions.cjs","names":[],"sources":["../../src/utils/functions.ts"],"sourcesContent":["/**\n * Create a trailing-edge debounced version of `fn`.\n *\n * The wrapped function delays invoking `fn` until `wait` milliseconds have\n * elapsed since the last time it was called. Only the latest arguments are\n * used. Call `.cancel()` to clear any pending invocation.\n *\n * @example\n * const save = debounce((q: string) => search(q), 300);\n * save(\"a\"); save(\"ab\"); save(\"abc\"); // only \"abc\" runs after 300ms\n * save.cancel(); // nothing runs\n */\nexport function debounce<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const debounced = (...args: A): void => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n\n debounced.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n return debounced;\n}\n\n/**\n * Create a throttled version of `fn` with leading and trailing edges.\n *\n * `fn` runs immediately on the first call (leading edge), then at most once\n * per `wait` milliseconds. If calls happen during the wait window, the last\n * one fires on the trailing edge. Call `.cancel()` to drop any pending\n * trailing call and reset the window.\n *\n * @example\n * const onScroll = throttle(() => render(), 200);\n * window.addEventListener(\"scroll\", onScroll);\n * onScroll.cancel();\n */\nexport function throttle<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let lastArgs: A | undefined;\n let lastInvoke = 0;\n\n const invoke = (args: A): void => {\n lastInvoke = Date.now();\n fn(...args);\n };\n\n const throttled = (...args: A): void => {\n const now = Date.now();\n const remaining = wait - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n invoke(args);\n } else {\n lastArgs = args;\n if (timer === undefined) {\n timer = setTimeout(() => {\n timer = undefined;\n if (lastArgs !== undefined) {\n const pending = lastArgs;\n lastArgs = undefined;\n invoke(pending);\n }\n }, remaining);\n }\n }\n };\n\n throttled.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n lastArgs = undefined;\n lastInvoke = 0;\n };\n\n return throttled;\n}\n\n/**\n * Wrap `fn` so it runs at most once; subsequent calls return the cached result.\n *\n * @example\n * const init = once(() => expensiveSetup());\n * init(); // runs expensiveSetup()\n * init(); // returns the same cached result, no re-run\n */\nexport function once<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let called = false;\n let result: R;\n\n return (...args: A): R => {\n if (!called) {\n called = true;\n result = fn(...args);\n }\n return result;\n };\n}\n\n/**\n * Memoize only the most recent call of `fn`, keyed by shallow-equal arguments.\n *\n * If the next call has the same arguments (compared with `Object.is` per\n * position and equal length), the cached result is returned without re-running\n * `fn`. Any different argument list recomputes and replaces the cache.\n *\n * @example\n * const select = memoizeOne((a: number, b: number) => a + b);\n * select(1, 2); // computes 3\n * select(1, 2); // cached 3\n * select(2, 2); // recomputes 4\n */\nexport function memoizeOne<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let hasCache = false;\n let lastArgs: A;\n let lastResult: R;\n\n const sameArgs = (next: A): boolean => {\n if (!hasCache || next.length !== lastArgs.length) return false;\n for (let i = 0; i < next.length; i++) {\n if (!Object.is(next[i], lastArgs[i])) return false;\n }\n return true;\n };\n\n return (...args: A): R => {\n if (sameArgs(args)) return lastResult;\n lastArgs = args;\n lastResult = fn(...args);\n hasCache = true;\n return lastResult;\n };\n}\n"],"mappings":"AAYA,SAAgB,EACZ,EACA,EAC+C,CAC/C,IAAI,EAEE,GAAa,GAAG,IAAkB,CAChC,IAAU,IAAA,IAAW,aAAa,CAAK,EAC3C,EAAQ,eAAiB,CACrB,EAAQ,IAAA,GACR,EAAG,GAAG,CAAI,CACd,EAAG,CAAI,CACX,EASA,MAPA,GAAU,WAAqB,CACvB,IAAU,IAAA,KACV,aAAa,CAAK,EAClB,EAAQ,IAAA,GAEhB,EAEO,CACX,CAeA,SAAgB,EACZ,EACA,EAC+C,CAC/C,IAAI,EACA,EACA,EAAa,EAEX,EAAU,GAAkB,CAC9B,EAAa,KAAK,IAAI,EACtB,EAAG,GAAG,CAAI,CACd,EAEM,GAAa,GAAG,IAAkB,CAEpC,IAAM,EAAY,GADN,KAAK,IACS,EAAM,GAE5B,GAAa,GACT,IAAU,IAAA,KACV,aAAa,CAAK,EAClB,EAAQ,IAAA,IAEZ,EAAO,CAAI,IAEX,EAAW,EACP,IAAU,IAAA,KACV,EAAQ,eAAiB,CAErB,GADA,EAAQ,IAAA,GACJ,IAAa,IAAA,GAAW,CACxB,IAAM,EAAU,EAChB,EAAW,IAAA,GACX,EAAO,CAAO,CAClB,CACJ,EAAG,CAAS,GAGxB,EAWA,MATA,GAAU,WAAqB,CACvB,IAAU,IAAA,KACV,aAAa,CAAK,EAClB,EAAQ,IAAA,IAEZ,EAAW,IAAA,GACX,EAAa,CACjB,EAEO,CACX,CAUA,SAAgB,EAA6B,EAA0C,CACnF,IAAI,EAAS,GACT,EAEJ,OAAQ,GAAG,KACF,IACD,EAAS,GACT,EAAS,EAAG,GAAG,CAAI,GAEhB,EAEf,CAeA,SAAgB,EAAmC,EAA0C,CACzF,IAAI,EAAW,GACX,EACA,EAEE,EAAY,GAAqB,CACnC,GAAI,CAAC,GAAY,EAAK,SAAW,EAAS,OAAQ,MAAO,GACzD,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,IAC7B,GAAI,CAAC,OAAO,GAAG,EAAK,GAAI,EAAS,EAAE,EAAG,MAAO,GAEjD,MAAO,EACX,EAEA,OAAQ,GAAG,IACH,EAAS,CAAI,EAAU,GAC3B,EAAW,EACX,EAAa,EAAG,GAAG,CAAI,EACvB,EAAW,GACJ,EAEf"}
1
+ {"version":3,"file":"functions.cjs","names":["debounce","timer","debounced","args","fn","wait","throttle","lastArgs","lastInvoke","invoke","throttled","remaining","pending","once","called","result","memoizeOne","hasCache","lastResult","sameArgs","next","i"],"sources":["../../src/utils/functions.ts"],"sourcesContent":["/**\n * Create a trailing-edge debounced version of `fn`.\n *\n * The wrapped function delays invoking `fn` until `wait` milliseconds have\n * elapsed since the last time it was called. Only the latest arguments are\n * used. Call `.cancel()` to clear any pending invocation.\n *\n * @example\n * const save = debounce((q: string) => search(q), 300);\n * save(\"a\"); save(\"ab\"); save(\"abc\"); // only \"abc\" runs after 300ms\n * save.cancel(); // nothing runs\n */\nexport function debounce<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const debounced = (...args: A): void => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n\n debounced.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n return debounced;\n}\n\n/**\n * Create a throttled version of `fn` with leading and trailing edges.\n *\n * `fn` runs immediately on the first call (leading edge), then at most once\n * per `wait` milliseconds. If calls happen during the wait window, the last\n * one fires on the trailing edge. Call `.cancel()` to drop any pending\n * trailing call and reset the window.\n *\n * @example\n * const onScroll = throttle(() => render(), 200);\n * window.addEventListener(\"scroll\", onScroll);\n * onScroll.cancel();\n */\nexport function throttle<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let lastArgs: A | undefined;\n let lastInvoke = 0;\n\n const invoke = (args: A): void => {\n lastInvoke = Date.now();\n fn(...args);\n };\n\n const throttled = (...args: A): void => {\n const now = Date.now();\n const remaining = wait - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n invoke(args);\n } else {\n lastArgs = args;\n if (timer === undefined) {\n timer = setTimeout(() => {\n timer = undefined;\n if (lastArgs !== undefined) {\n const pending = lastArgs;\n lastArgs = undefined;\n invoke(pending);\n }\n }, remaining);\n }\n }\n };\n\n throttled.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n lastArgs = undefined;\n lastInvoke = 0;\n };\n\n return throttled;\n}\n\n/**\n * Wrap `fn` so it runs at most once; subsequent calls return the cached result.\n *\n * @example\n * const init = once(() => expensiveSetup());\n * init(); // runs expensiveSetup()\n * init(); // returns the same cached result, no re-run\n */\nexport function once<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let called = false;\n let result: R;\n\n return (...args: A): R => {\n if (!called) {\n called = true;\n result = fn(...args);\n }\n return result;\n };\n}\n\n/**\n * Memoize only the most recent call of `fn`, keyed by shallow-equal arguments.\n *\n * If the next call has the same arguments (compared with `Object.is` per\n * position and equal length), the cached result is returned without re-running\n * `fn`. Any different argument list recomputes and replaces the cache.\n *\n * @example\n * const select = memoizeOne((a: number, b: number) => a + b);\n * select(1, 2); // computes 3\n * select(1, 2); // cached 3\n * select(2, 2); // recomputes 4\n */\nexport function memoizeOne<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let hasCache = false;\n let lastArgs: A;\n let lastResult: R;\n\n const sameArgs = (next: A): boolean => {\n if (!hasCache || next.length !== lastArgs.length) return false;\n for (let i = 0; i < next.length; i++) {\n if (!Object.is(next[i], lastArgs[i])) return false;\n }\n return true;\n };\n\n return (...args: A): R => {\n if (sameArgs(args)) return lastResult;\n lastArgs = args;\n lastResult = fn(...args);\n hasCache = true;\n return lastResult;\n };\n}\n"],"mappings":"AAYA,SAAgBA,EACZ,EACA,EAC+C,CAC/C,IAAIC,EAEEC,GAAa,GAAGC,IAAkB,CAChCF,IAAU,IAAA,IAAW,aAAaA,CAAK,EAC3C,EAAQ,eAAiB,CACrB,EAAQ,IAAA,GACRG,EAAG,GAAGD,CAAI,CACd,EAAGE,CAAI,CACX,EASA,MAPA,GAAU,WAAqB,CACvBJ,IAAU,IAAA,KACV,aAAaA,CAAK,EAClB,EAAQ,IAAA,GAEhB,EAEOC,CACX,CAeA,SAAgBI,EACZ,EACA,EAC+C,CAC/C,IAAIL,EACAM,EACAC,EAAa,EAEXC,EAAU,GAAkB,CAC9B,EAAa,KAAK,IAAI,EACtBL,EAAG,GAAGD,CAAI,CACd,EAEMO,GAAa,GAAGP,IAAkB,CAEpC,IAAMQ,EAAYN,GADN,KAAK,IACS,EAAMG,GAE5BG,GAAa,GACTV,IAAU,IAAA,KACV,aAAaA,CAAK,EAClB,EAAQ,IAAA,IAEZQ,EAAON,CAAI,IAEX,EAAWA,EACPF,IAAU,IAAA,KACV,EAAQ,eAAiB,CAErB,GADA,EAAQ,IAAA,GACJM,IAAa,IAAA,GAAW,CACxB,IAAMK,EAAUL,EAChB,EAAW,IAAA,GACXE,EAAOG,CAAO,CAClB,CACJ,EAAGD,CAAS,GAGxB,EAWA,MATA,GAAU,WAAqB,CACvBV,IAAU,IAAA,KACV,aAAaA,CAAK,EAClB,EAAQ,IAAA,IAEZ,EAAW,IAAA,GACX,EAAa,CACjB,EAEOS,CACX,CAUA,SAAgBG,EAA6B,EAA0C,CACnF,IAAIC,EAAS,GACTC,EAEJ,OAAQ,GAAGZ,KACFW,IACD,EAAS,GACT,EAASV,EAAG,GAAGD,CAAI,GAEhBY,EAEf,CAeA,SAAgBC,EAAmC,EAA0C,CACzF,IAAIC,EAAW,GACXV,EACAW,EAEEC,EAAY,GAAqB,CACnC,GAAI,CAACF,GAAYG,EAAK,SAAWb,EAAS,OAAQ,MAAO,GACzD,IAAK,IAAIc,EAAI,EAAGA,EAAID,EAAK,OAAQ,IAC7B,GAAI,CAAC,OAAO,GAAGA,EAAKC,GAAId,EAASc,EAAE,EAAG,MAAO,GAEjD,MAAO,EACX,EAEA,OAAQ,GAAGlB,KACHgB,EAAShB,CAAI,IACjB,EAAWA,EACX,EAAaC,EAAG,GAAGD,CAAI,EACvB,EAAW,IACJe,EAEf,C"}
@@ -35,7 +35,7 @@ function r(e) {
35
35
  for (let t = 0; t < e.length; t++) if (!Object.is(e[t], n[t])) return !1;
36
36
  return !0;
37
37
  };
38
- return (...a) => i(a) ? r : (n = a, r = e(...a), t = !0, r);
38
+ return (...a) => (i(a) || (n = a, r = e(...a), t = !0), r);
39
39
  }
40
40
  //#endregion
41
41
  export { e as debounce, r as memoizeOne, n as once, t as throttle };
@@ -1 +1 @@
1
- {"version":3,"file":"functions.js","names":[],"sources":["../../src/utils/functions.ts"],"sourcesContent":["/**\n * Create a trailing-edge debounced version of `fn`.\n *\n * The wrapped function delays invoking `fn` until `wait` milliseconds have\n * elapsed since the last time it was called. Only the latest arguments are\n * used. Call `.cancel()` to clear any pending invocation.\n *\n * @example\n * const save = debounce((q: string) => search(q), 300);\n * save(\"a\"); save(\"ab\"); save(\"abc\"); // only \"abc\" runs after 300ms\n * save.cancel(); // nothing runs\n */\nexport function debounce<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const debounced = (...args: A): void => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n\n debounced.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n return debounced;\n}\n\n/**\n * Create a throttled version of `fn` with leading and trailing edges.\n *\n * `fn` runs immediately on the first call (leading edge), then at most once\n * per `wait` milliseconds. If calls happen during the wait window, the last\n * one fires on the trailing edge. Call `.cancel()` to drop any pending\n * trailing call and reset the window.\n *\n * @example\n * const onScroll = throttle(() => render(), 200);\n * window.addEventListener(\"scroll\", onScroll);\n * onScroll.cancel();\n */\nexport function throttle<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let lastArgs: A | undefined;\n let lastInvoke = 0;\n\n const invoke = (args: A): void => {\n lastInvoke = Date.now();\n fn(...args);\n };\n\n const throttled = (...args: A): void => {\n const now = Date.now();\n const remaining = wait - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n invoke(args);\n } else {\n lastArgs = args;\n if (timer === undefined) {\n timer = setTimeout(() => {\n timer = undefined;\n if (lastArgs !== undefined) {\n const pending = lastArgs;\n lastArgs = undefined;\n invoke(pending);\n }\n }, remaining);\n }\n }\n };\n\n throttled.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n lastArgs = undefined;\n lastInvoke = 0;\n };\n\n return throttled;\n}\n\n/**\n * Wrap `fn` so it runs at most once; subsequent calls return the cached result.\n *\n * @example\n * const init = once(() => expensiveSetup());\n * init(); // runs expensiveSetup()\n * init(); // returns the same cached result, no re-run\n */\nexport function once<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let called = false;\n let result: R;\n\n return (...args: A): R => {\n if (!called) {\n called = true;\n result = fn(...args);\n }\n return result;\n };\n}\n\n/**\n * Memoize only the most recent call of `fn`, keyed by shallow-equal arguments.\n *\n * If the next call has the same arguments (compared with `Object.is` per\n * position and equal length), the cached result is returned without re-running\n * `fn`. Any different argument list recomputes and replaces the cache.\n *\n * @example\n * const select = memoizeOne((a: number, b: number) => a + b);\n * select(1, 2); // computes 3\n * select(1, 2); // cached 3\n * select(2, 2); // recomputes 4\n */\nexport function memoizeOne<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let hasCache = false;\n let lastArgs: A;\n let lastResult: R;\n\n const sameArgs = (next: A): boolean => {\n if (!hasCache || next.length !== lastArgs.length) return false;\n for (let i = 0; i < next.length; i++) {\n if (!Object.is(next[i], lastArgs[i])) return false;\n }\n return true;\n };\n\n return (...args: A): R => {\n if (sameArgs(args)) return lastResult;\n lastArgs = args;\n lastResult = fn(...args);\n hasCache = true;\n return lastResult;\n };\n}\n"],"mappings":";AAYA,SAAgB,EACZ,GACA,GAC+C;CAC/C,IAAI,GAEE,KAAa,GAAG,MAAkB;EAEpC,AADI,MAAU,KAAA,KAAW,aAAa,CAAK,GAC3C,IAAQ,iBAAiB;GAErB,AADA,IAAQ,KAAA,GACR,EAAG,GAAG,CAAI;EACd,GAAG,CAAI;CACX;CASA,OAPA,EAAU,eAAqB;EAC3B,AAAI,MAAU,KAAA,MACV,aAAa,CAAK,GAClB,IAAQ,KAAA;CAEhB,GAEO;AACX;AAeA,SAAgB,EACZ,GACA,GAC+C;CAC/C,IAAI,GACA,GACA,IAAa,GAEX,KAAU,MAAkB;EAE9B,AADA,IAAa,KAAK,IAAI,GACtB,EAAG,GAAG,CAAI;CACd,GAEM,KAAa,GAAG,MAAkB;EAEpC,IAAM,IAAY,KADN,KAAK,IACS,IAAM;EAEhC,AAAI,KAAa,KACT,MAAU,KAAA,MACV,aAAa,CAAK,GAClB,IAAQ,KAAA,IAEZ,EAAO,CAAI,MAEX,IAAW,GACP,MAAU,KAAA,MACV,IAAQ,iBAAiB;GAErB,IADA,IAAQ,KAAA,GACJ,MAAa,KAAA,GAAW;IACxB,IAAM,IAAU;IAEhB,AADA,IAAW,KAAA,GACX,EAAO,CAAO;GAClB;EACJ,GAAG,CAAS;CAGxB;CAWA,OATA,EAAU,eAAqB;EAM3B,AALI,MAAU,KAAA,MACV,aAAa,CAAK,GAClB,IAAQ,KAAA,IAEZ,IAAW,KAAA,GACX,IAAa;CACjB,GAEO;AACX;AAUA,SAAgB,EAA6B,GAA0C;CACnF,IAAI,IAAS,IACT;CAEJ,QAAQ,GAAG,OACF,MACD,IAAS,IACT,IAAS,EAAG,GAAG,CAAI,IAEhB;AAEf;AAeA,SAAgB,EAAmC,GAA0C;CACzF,IAAI,IAAW,IACX,GACA,GAEE,KAAY,MAAqB;EACnC,IAAI,CAAC,KAAY,EAAK,WAAW,EAAS,QAAQ,OAAO;EACzD,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAC7B,IAAI,CAAC,OAAO,GAAG,EAAK,IAAI,EAAS,EAAE,GAAG,OAAO;EAEjD,OAAO;CACX;CAEA,QAAQ,GAAG,MACH,EAAS,CAAI,IAAU,KAC3B,IAAW,GACX,IAAa,EAAG,GAAG,CAAI,GACvB,IAAW,IACJ;AAEf"}
1
+ {"version":3,"file":"functions.js","names":["debounce","timer","debounced","args","fn","wait","throttle","lastArgs","lastInvoke","invoke","throttled","remaining","pending","once","called","result","memoizeOne","hasCache","lastResult","sameArgs","next","i"],"sources":["../../src/utils/functions.ts"],"sourcesContent":["/**\n * Create a trailing-edge debounced version of `fn`.\n *\n * The wrapped function delays invoking `fn` until `wait` milliseconds have\n * elapsed since the last time it was called. Only the latest arguments are\n * used. Call `.cancel()` to clear any pending invocation.\n *\n * @example\n * const save = debounce((q: string) => search(q), 300);\n * save(\"a\"); save(\"ab\"); save(\"abc\"); // only \"abc\" runs after 300ms\n * save.cancel(); // nothing runs\n */\nexport function debounce<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const debounced = (...args: A): void => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n\n debounced.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n };\n\n return debounced;\n}\n\n/**\n * Create a throttled version of `fn` with leading and trailing edges.\n *\n * `fn` runs immediately on the first call (leading edge), then at most once\n * per `wait` milliseconds. If calls happen during the wait window, the last\n * one fires on the trailing edge. Call `.cancel()` to drop any pending\n * trailing call and reset the window.\n *\n * @example\n * const onScroll = throttle(() => render(), 200);\n * window.addEventListener(\"scroll\", onScroll);\n * onScroll.cancel();\n */\nexport function throttle<A extends unknown[]>(\n fn: (...args: A) => void,\n wait: number,\n): ((...args: A) => void) & { cancel: () => void } {\n let timer: ReturnType<typeof setTimeout> | undefined;\n let lastArgs: A | undefined;\n let lastInvoke = 0;\n\n const invoke = (args: A): void => {\n lastInvoke = Date.now();\n fn(...args);\n };\n\n const throttled = (...args: A): void => {\n const now = Date.now();\n const remaining = wait - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n invoke(args);\n } else {\n lastArgs = args;\n if (timer === undefined) {\n timer = setTimeout(() => {\n timer = undefined;\n if (lastArgs !== undefined) {\n const pending = lastArgs;\n lastArgs = undefined;\n invoke(pending);\n }\n }, remaining);\n }\n }\n };\n\n throttled.cancel = (): void => {\n if (timer !== undefined) {\n clearTimeout(timer);\n timer = undefined;\n }\n lastArgs = undefined;\n lastInvoke = 0;\n };\n\n return throttled;\n}\n\n/**\n * Wrap `fn` so it runs at most once; subsequent calls return the cached result.\n *\n * @example\n * const init = once(() => expensiveSetup());\n * init(); // runs expensiveSetup()\n * init(); // returns the same cached result, no re-run\n */\nexport function once<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let called = false;\n let result: R;\n\n return (...args: A): R => {\n if (!called) {\n called = true;\n result = fn(...args);\n }\n return result;\n };\n}\n\n/**\n * Memoize only the most recent call of `fn`, keyed by shallow-equal arguments.\n *\n * If the next call has the same arguments (compared with `Object.is` per\n * position and equal length), the cached result is returned without re-running\n * `fn`. Any different argument list recomputes and replaces the cache.\n *\n * @example\n * const select = memoizeOne((a: number, b: number) => a + b);\n * select(1, 2); // computes 3\n * select(1, 2); // cached 3\n * select(2, 2); // recomputes 4\n */\nexport function memoizeOne<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R {\n let hasCache = false;\n let lastArgs: A;\n let lastResult: R;\n\n const sameArgs = (next: A): boolean => {\n if (!hasCache || next.length !== lastArgs.length) return false;\n for (let i = 0; i < next.length; i++) {\n if (!Object.is(next[i], lastArgs[i])) return false;\n }\n return true;\n };\n\n return (...args: A): R => {\n if (sameArgs(args)) return lastResult;\n lastArgs = args;\n lastResult = fn(...args);\n hasCache = true;\n return lastResult;\n };\n}\n"],"mappings":";AAYA,SAAgBA,EACZ,GACA,GAC+C;CAC/C,IAAIC,GAEEC,KAAa,GAAGC,MAAkB;EAEpC,AADIF,MAAU,KAAA,KAAW,aAAaA,CAAK,GAC3C,IAAQ,iBAAiB;GAErB,AADA,IAAQ,KAAA,GACRG,EAAG,GAAGD,CAAI;EACd,GAAGE,CAAI;CACX;CASA,OAPA,EAAU,eAAqB;EAC3B,AAAIJ,MAAU,KAAA,MACV,aAAaA,CAAK,GAClB,IAAQ,KAAA;CAEhB,GAEOC;AACX;AAeA,SAAgBI,EACZ,GACA,GAC+C;CAC/C,IAAIL,GACAM,GACAC,IAAa,GAEXC,KAAU,MAAkB;EAE9B,AADA,IAAa,KAAK,IAAI,GACtBL,EAAG,GAAGD,CAAI;CACd,GAEMO,KAAa,GAAGP,MAAkB;EAEpC,IAAMQ,IAAYN,KADN,KAAK,IACS,IAAMG;EAEhC,AAAIG,KAAa,KACTV,MAAU,KAAA,MACV,aAAaA,CAAK,GAClB,IAAQ,KAAA,IAEZQ,EAAON,CAAI,MAEX,IAAWA,GACPF,MAAU,KAAA,MACV,IAAQ,iBAAiB;GAErB,IADA,IAAQ,KAAA,GACJM,MAAa,KAAA,GAAW;IACxB,IAAMK,IAAUL;IAEhB,AADA,IAAW,KAAA,GACXE,EAAOG,CAAO;GAClB;EACJ,GAAGD,CAAS;CAGxB;CAWA,OATA,EAAU,eAAqB;EAM3B,AALIV,MAAU,KAAA,MACV,aAAaA,CAAK,GAClB,IAAQ,KAAA,IAEZ,IAAW,KAAA,GACX,IAAa;CACjB,GAEOS;AACX;AAUA,SAAgBG,EAA6B,GAA0C;CACnF,IAAIC,IAAS,IACTC;CAEJ,QAAQ,GAAGZ,OACFW,MACD,IAAS,IACT,IAASV,EAAG,GAAGD,CAAI,IAEhBY;AAEf;AAeA,SAAgBC,EAAmC,GAA0C;CACzF,IAAIC,IAAW,IACXV,GACAW,GAEEC,KAAY,MAAqB;EACnC,IAAI,CAACF,KAAYG,EAAK,WAAWb,EAAS,QAAQ,OAAO;EACzD,KAAK,IAAIc,IAAI,GAAGA,IAAID,EAAK,QAAQ,KAC7B,IAAI,CAAC,OAAO,GAAGA,EAAKC,IAAId,EAASc,EAAE,GAAG,OAAO;EAEjD,OAAO;CACX;CAEA,QAAQ,GAAGlB,OACHgB,EAAShB,CAAI,MACjB,IAAWA,GACX,IAAaC,EAAG,GAAGD,CAAI,GACvB,IAAW,KACJe;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"guards.cjs","names":[],"sources":["../../src/utils/guards.ts"],"sourcesContent":["/**\n * Type guard asserting a value is neither `null` nor `undefined`.\n *\n * Useful for narrowing in `Array.prototype.filter` to drop nullish entries\n * while preserving the element type.\n *\n * @example\n * const xs: (number | null)[] = [1, null, 2];\n * const clean: number[] = xs.filter(isDefined); // [1, 2]\n */\nexport function isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Type guard asserting a value is a string primitive.\n *\n * @example\n * isString(\"hi\"); // true\n * isString(42); // false\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\";\n}\n\n/**\n * Type guard asserting a value is a number, excluding `NaN`.\n *\n * @example\n * isNumber(42); // true\n * isNumber(NaN); // false\n * isNumber(\"42\"); // false\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === \"number\" && !Number.isNaN(value);\n}\n\n/**\n * Type guard asserting a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances —\n * only objects created from `{}` / `Object.create(null)` / object literals pass.\n *\n * @example\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(new Date()); // false\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Assert that a code path is unreachable, throwing at runtime if reached.\n *\n * Use in the `default` branch of an exhaustive `switch` so TypeScript flags any\n * unhandled union member at compile time and the runtime fails loudly if an\n * unexpected value slips through.\n *\n * @param value - The value that should be of type `never`.\n * @param message - Optional custom error message.\n * @throws {Error} Always.\n *\n * @example\n * type Shape = \"circle\" | \"square\";\n * function area(shape: Shape): number {\n * switch (shape) {\n * case \"circle\": return 1;\n * case \"square\": return 2;\n * default: return assertNever(shape);\n * }\n * }\n */\nexport function assertNever(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${String(value)}`);\n}\n"],"mappings":"AAUA,SAAgB,EAAa,EAAyC,CAClE,OAAO,GAAU,IACrB,CASA,SAAgB,EAAS,EAAiC,CACtD,OAAO,OAAO,GAAU,QAC5B,CAUA,SAAgB,EAAS,EAAiC,CACtD,OAAO,OAAO,GAAU,UAAY,CAAC,OAAO,MAAM,CAAK,CAC3D,CAcA,SAAgB,EAAc,EAAkD,CAC5E,GAAI,OAAO,GAAU,WAAY,EAAgB,MAAO,GACxD,IAAM,EAAQ,OAAO,eAAe,CAAK,EACzC,OAAO,IAAU,OAAO,WAAa,IAAU,IACnD,CAuBA,SAAgB,EAAY,EAAc,EAAyB,CAC/D,MAAU,MAAM,GAAW,qBAAqB,OAAO,CAAK,GAAG,CACnE"}
1
+ {"version":3,"file":"guards.cjs","names":["isDefined","value","isString","isNumber","isPlainObject","proto","assertNever","message"],"sources":["../../src/utils/guards.ts"],"sourcesContent":["/**\n * Type guard asserting a value is neither `null` nor `undefined`.\n *\n * Useful for narrowing in `Array.prototype.filter` to drop nullish entries\n * while preserving the element type.\n *\n * @example\n * const xs: (number | null)[] = [1, null, 2];\n * const clean: number[] = xs.filter(isDefined); // [1, 2]\n */\nexport function isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Type guard asserting a value is a string primitive.\n *\n * @example\n * isString(\"hi\"); // true\n * isString(42); // false\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\";\n}\n\n/**\n * Type guard asserting a value is a number, excluding `NaN`.\n *\n * @example\n * isNumber(42); // true\n * isNumber(NaN); // false\n * isNumber(\"42\"); // false\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === \"number\" && !Number.isNaN(value);\n}\n\n/**\n * Type guard asserting a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances —\n * only objects created from `{}` / `Object.create(null)` / object literals pass.\n *\n * @example\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(new Date()); // false\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Assert that a code path is unreachable, throwing at runtime if reached.\n *\n * Use in the `default` branch of an exhaustive `switch` so TypeScript flags any\n * unhandled union member at compile time and the runtime fails loudly if an\n * unexpected value slips through.\n *\n * @param value - The value that should be of type `never`.\n * @param message - Optional custom error message.\n * @throws {Error} Always.\n *\n * @example\n * type Shape = \"circle\" | \"square\";\n * function area(shape: Shape): number {\n * switch (shape) {\n * case \"circle\": return 1;\n * case \"square\": return 2;\n * default: return assertNever(shape);\n * }\n * }\n */\nexport function assertNever(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${String(value)}`);\n}\n"],"mappings":"AAUA,SAAgBA,EAAa,EAAyC,CAClE,OAAOC,GAAU,IACrB,CASA,SAAgBC,EAAS,EAAiC,CACtD,OAAO,OAAOD,GAAU,QAC5B,CAUA,SAAgBE,EAAS,EAAiC,CACtD,OAAO,OAAOF,GAAU,UAAY,CAAC,OAAO,MAAMA,CAAK,CAC3D,CAcA,SAAgBG,EAAc,EAAkD,CAC5E,GAAI,OAAOH,GAAU,WAAYA,EAAgB,MAAO,GACxD,IAAMI,EAAQ,OAAO,eAAeJ,CAAK,EACzC,OAAOI,IAAU,OAAO,WAAaA,IAAU,IACnD,CAuBA,SAAgBC,EAAY,EAAc,EAAyB,CAC/D,MAAU,MAAMC,GAAW,qBAAqB,OAAON,CAAK,GAAG,CACnE,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"guards.js","names":[],"sources":["../../src/utils/guards.ts"],"sourcesContent":["/**\n * Type guard asserting a value is neither `null` nor `undefined`.\n *\n * Useful for narrowing in `Array.prototype.filter` to drop nullish entries\n * while preserving the element type.\n *\n * @example\n * const xs: (number | null)[] = [1, null, 2];\n * const clean: number[] = xs.filter(isDefined); // [1, 2]\n */\nexport function isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Type guard asserting a value is a string primitive.\n *\n * @example\n * isString(\"hi\"); // true\n * isString(42); // false\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\";\n}\n\n/**\n * Type guard asserting a value is a number, excluding `NaN`.\n *\n * @example\n * isNumber(42); // true\n * isNumber(NaN); // false\n * isNumber(\"42\"); // false\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === \"number\" && !Number.isNaN(value);\n}\n\n/**\n * Type guard asserting a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances —\n * only objects created from `{}` / `Object.create(null)` / object literals pass.\n *\n * @example\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(new Date()); // false\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Assert that a code path is unreachable, throwing at runtime if reached.\n *\n * Use in the `default` branch of an exhaustive `switch` so TypeScript flags any\n * unhandled union member at compile time and the runtime fails loudly if an\n * unexpected value slips through.\n *\n * @param value - The value that should be of type `never`.\n * @param message - Optional custom error message.\n * @throws {Error} Always.\n *\n * @example\n * type Shape = \"circle\" | \"square\";\n * function area(shape: Shape): number {\n * switch (shape) {\n * case \"circle\": return 1;\n * case \"square\": return 2;\n * default: return assertNever(shape);\n * }\n * }\n */\nexport function assertNever(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${String(value)}`);\n}\n"],"mappings":";AAUA,SAAgB,EAAa,GAAyC;CAClE,OAAO,KAAU;AACrB;AASA,SAAgB,EAAS,GAAiC;CACtD,OAAO,OAAO,KAAU;AAC5B;AAUA,SAAgB,EAAS,GAAiC;CACtD,OAAO,OAAO,KAAU,YAAY,CAAC,OAAO,MAAM,CAAK;AAC3D;AAcA,SAAgB,EAAc,GAAkD;CAC5E,IAAI,OAAO,KAAU,aAAY,GAAgB,OAAO;CACxD,IAAM,IAAQ,OAAO,eAAe,CAAK;CACzC,OAAO,MAAU,OAAO,aAAa,MAAU;AACnD;AAuBA,SAAgB,EAAY,GAAc,GAAyB;CAC/D,MAAU,MAAM,KAAW,qBAAqB,OAAO,CAAK,GAAG;AACnE"}
1
+ {"version":3,"file":"guards.js","names":["isDefined","value","isString","isNumber","isPlainObject","proto","assertNever","message"],"sources":["../../src/utils/guards.ts"],"sourcesContent":["/**\n * Type guard asserting a value is neither `null` nor `undefined`.\n *\n * Useful for narrowing in `Array.prototype.filter` to drop nullish entries\n * while preserving the element type.\n *\n * @example\n * const xs: (number | null)[] = [1, null, 2];\n * const clean: number[] = xs.filter(isDefined); // [1, 2]\n */\nexport function isDefined<T>(value: T | null | undefined): value is T {\n return value !== null && value !== undefined;\n}\n\n/**\n * Type guard asserting a value is a string primitive.\n *\n * @example\n * isString(\"hi\"); // true\n * isString(42); // false\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\";\n}\n\n/**\n * Type guard asserting a value is a number, excluding `NaN`.\n *\n * @example\n * isNumber(42); // true\n * isNumber(NaN); // false\n * isNumber(\"42\"); // false\n */\nexport function isNumber(value: unknown): value is number {\n return typeof value === \"number\" && !Number.isNaN(value);\n}\n\n/**\n * Type guard asserting a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances —\n * only objects created from `{}` / `Object.create(null)` / object literals pass.\n *\n * @example\n * isPlainObject({ a: 1 }); // true\n * isPlainObject([]); // false\n * isPlainObject(null); // false\n * isPlainObject(new Date()); // false\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Assert that a code path is unreachable, throwing at runtime if reached.\n *\n * Use in the `default` branch of an exhaustive `switch` so TypeScript flags any\n * unhandled union member at compile time and the runtime fails loudly if an\n * unexpected value slips through.\n *\n * @param value - The value that should be of type `never`.\n * @param message - Optional custom error message.\n * @throws {Error} Always.\n *\n * @example\n * type Shape = \"circle\" | \"square\";\n * function area(shape: Shape): number {\n * switch (shape) {\n * case \"circle\": return 1;\n * case \"square\": return 2;\n * default: return assertNever(shape);\n * }\n * }\n */\nexport function assertNever(value: never, message?: string): never {\n throw new Error(message ?? `Unexpected value: ${String(value)}`);\n}\n"],"mappings":";AAUA,SAAgBA,EAAa,GAAyC;CAClE,OAAOC,KAAU;AACrB;AASA,SAAgBC,EAAS,GAAiC;CACtD,OAAO,OAAOD,KAAU;AAC5B;AAUA,SAAgBE,EAAS,GAAiC;CACtD,OAAO,OAAOF,KAAU,YAAY,CAAC,OAAO,MAAMA,CAAK;AAC3D;AAcA,SAAgBG,EAAc,GAAkD;CAC5E,IAAI,OAAOH,KAAU,aAAYA,GAAgB,OAAO;CACxD,IAAMI,IAAQ,OAAO,eAAeJ,CAAK;CACzC,OAAOI,MAAU,OAAO,aAAaA,MAAU;AACnD;AAuBA,SAAgBC,EAAY,GAAc,GAAyB;CAC/D,MAAU,MAAMC,KAAW,qBAAqB,OAAON,CAAK,GAAG;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ids.cjs","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["/**\n * Generate a collision-resistant id suitable for client-side UI keys.\n *\n * Uses `crypto.randomUUID()` when available, falling back to a\n * timestamp + `Math.random()` combination otherwise. When `prefix` is given,\n * the result is formatted as `${prefix}-${id}`.\n *\n * @example\n * randomId(); // \"9f1c2b3a-...\" (uuid) or \"lq3f8k-4a9z1\" (fallback)\n * randomId(\"user\"); // \"user-9f1c2b3a-...\"\n */\nexport function randomId(prefix?: string): string {\n let id: string;\n\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n id = crypto.randomUUID();\n } else {\n const time = Date.now().toString(36);\n const rand = Math.random().toString(36).slice(2, 10);\n id = `${time}-${rand}`;\n }\n\n return prefix ? `${prefix}-${id}` : id;\n}\n"],"mappings":"AAWA,SAAgB,EAAS,EAAyB,CAC9C,IAAI,EAUJ,MARA,CAKI,EALA,OAAO,OAAW,KAAe,OAAO,OAAO,YAAe,WACzD,OAAO,WAAW,EAIlB,GAFQ,KAAK,IAAI,CAAC,CAAC,SAAS,EAEzB,EAAK,GADA,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAG,EACjC,IAGb,EAAS,GAAG,EAAO,GAAG,IAAO,CACxC"}
1
+ {"version":3,"file":"ids.cjs","names":["randomId","id","prefix"],"sources":["../../src/utils/ids.ts"],"sourcesContent":["/**\n * Generate a collision-resistant id suitable for client-side UI keys.\n *\n * Uses `crypto.randomUUID()` when available, falling back to a\n * timestamp + `Math.random()` combination otherwise. When `prefix` is given,\n * the result is formatted as `${prefix}-${id}`.\n *\n * @example\n * randomId(); // \"9f1c2b3a-...\" (uuid) or \"lq3f8k-4a9z1\" (fallback)\n * randomId(\"user\"); // \"user-9f1c2b3a-...\"\n */\nexport function randomId(prefix?: string): string {\n let id: string;\n\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n id = crypto.randomUUID();\n } else {\n const time = Date.now().toString(36);\n const rand = Math.random().toString(36).slice(2, 10);\n id = `${time}-${rand}`;\n }\n\n return prefix ? `${prefix}-${id}` : id;\n}\n"],"mappings":"AAWA,SAAgBA,EAAS,EAAyB,CAC9C,IAAIC,EAUJ,MARA,CAKIA,EALA,OAAO,OAAW,KAAe,OAAO,OAAO,YAAe,WACzD,OAAO,WAAW,EAIlB,GAFQ,KAAK,IAAI,CAAC,CAAC,SAAS,EAEzB,EAAK,GADA,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAG,EACjC,IAGbC,EAAS,GAAGA,EAAO,GAAGD,IAAOA,CACxC,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ids.js","names":[],"sources":["../../src/utils/ids.ts"],"sourcesContent":["/**\n * Generate a collision-resistant id suitable for client-side UI keys.\n *\n * Uses `crypto.randomUUID()` when available, falling back to a\n * timestamp + `Math.random()` combination otherwise. When `prefix` is given,\n * the result is formatted as `${prefix}-${id}`.\n *\n * @example\n * randomId(); // \"9f1c2b3a-...\" (uuid) or \"lq3f8k-4a9z1\" (fallback)\n * randomId(\"user\"); // \"user-9f1c2b3a-...\"\n */\nexport function randomId(prefix?: string): string {\n let id: string;\n\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n id = crypto.randomUUID();\n } else {\n const time = Date.now().toString(36);\n const rand = Math.random().toString(36).slice(2, 10);\n id = `${time}-${rand}`;\n }\n\n return prefix ? `${prefix}-${id}` : id;\n}\n"],"mappings":";AAWA,SAAgB,EAAS,GAAyB;CAC9C,IAAI;CAUJ,OARA,AAKI,IALA,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACzD,OAAO,WAAW,IAIlB,GAFQ,KAAK,IAAI,CAAC,CAAC,SAAS,EAEzB,EAAK,GADA,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EACjC,KAGb,IAAS,GAAG,EAAO,GAAG,MAAO;AACxC"}
1
+ {"version":3,"file":"ids.js","names":["randomId","id","prefix"],"sources":["../../src/utils/ids.ts"],"sourcesContent":["/**\n * Generate a collision-resistant id suitable for client-side UI keys.\n *\n * Uses `crypto.randomUUID()` when available, falling back to a\n * timestamp + `Math.random()` combination otherwise. When `prefix` is given,\n * the result is formatted as `${prefix}-${id}`.\n *\n * @example\n * randomId(); // \"9f1c2b3a-...\" (uuid) or \"lq3f8k-4a9z1\" (fallback)\n * randomId(\"user\"); // \"user-9f1c2b3a-...\"\n */\nexport function randomId(prefix?: string): string {\n let id: string;\n\n if (typeof crypto !== \"undefined\" && typeof crypto.randomUUID === \"function\") {\n id = crypto.randomUUID();\n } else {\n const time = Date.now().toString(36);\n const rand = Math.random().toString(36).slice(2, 10);\n id = `${time}-${rand}`;\n }\n\n return prefix ? `${prefix}-${id}` : id;\n}\n"],"mappings":";AAWA,SAAgBA,EAAS,GAAyB;CAC9C,IAAIC;CAUJ,OARA,AAKIA,IALA,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACzD,OAAO,WAAW,IAIlB,GAFQ,KAAK,IAAI,CAAC,CAAC,SAAS,EAEzB,EAAK,GADA,KAAK,OAAO,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,GAAG,EACjC,KAGbC,IAAS,GAAGA,EAAO,GAAGD,MAAOA;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"intl-cache.cjs","names":[],"sources":["../../src/utils/intl-cache.ts"],"sourcesContent":["/**\n * Cached `Intl` formatter factories.\n *\n * Constructing an `Intl.NumberFormat` or `Intl.DateTimeFormat` resolves locale\n * data, which is the expensive half; formatting with one afterwards is cheap.\n * Building a fresh formatter per call is therefore the difference between a\n * table of money cells costing microseconds and costing a frame: measured at\n * 15.56 µs per construct-and-format against 0.29 µs when the formatter is\n * reused, so a 500 × 3 grid goes from 23.1 ms to 0.4 ms.\n *\n * The cache is keyed by locale plus the serialised options, so two call sites\n * asking for the same shape share one formatter. It is capped and cleared\n * wholesale when it overflows: a caller that varies its options per call (a\n * fraction-digit count driven by data, say) would otherwise grow the map without\n * bound, and dropping everything is both correct and cheaper than tracking\n * recency for a map this small.\n */\n\n/** Largest number of distinct formatter shapes kept before the cache resets. */\nconst MAX_ENTRIES = 64;\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateTimeFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Build the cache key for a locale and options pair.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - The formatter options, or `undefined`.\n * @returns A string that is equal exactly when both inputs are equivalent.\n */\nfunction keyFor(locale: string | undefined, options: object | undefined): string {\n return `${locale ?? \"\"}|${options === undefined ? \"\" : JSON.stringify(options)}`;\n}\n\n/**\n * Get an `Intl.NumberFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.NumberFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function numberFormat(\n locale?: string,\n options?: Intl.NumberFormatOptions,\n): Intl.NumberFormat {\n const key = keyFor(locale, options);\n const hit = numberFormats.get(key);\n if (hit) return hit;\n if (numberFormats.size >= MAX_ENTRIES) numberFormats.clear();\n const formatter = new Intl.NumberFormat(locale, options);\n numberFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Get an `Intl.DateTimeFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.DateTimeFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function dateTimeFormat(\n locale?: string,\n options?: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = keyFor(locale, options);\n const hit = dateTimeFormats.get(key);\n if (hit) return hit;\n if (dateTimeFormats.size >= MAX_ENTRIES) dateTimeFormats.clear();\n const formatter = new Intl.DateTimeFormat(locale, options);\n dateTimeFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Drop every cached formatter.\n *\n * Exists for tests that assert on cache behaviour; production code has no\n * reason to call it, because a formatter never goes stale.\n *\n * @returns Nothing.\n */\nexport function clearIntlCache(): void {\n numberFormats.clear();\n dateTimeFormats.clear();\n}\n"],"mappings":"AAmBA,IAEM,EAAgB,IAAI,IACpB,EAAkB,IAAI,IAS5B,SAAS,EAAO,EAA4B,EAAqC,CAC7E,MAAO,GAAG,GAAU,GAAG,GAAG,IAAY,IAAA,GAAY,GAAK,KAAK,UAAU,CAAO,GACjF,CASA,SAAgB,EACZ,EACA,EACiB,CACjB,IAAM,EAAM,EAAO,EAAQ,CAAO,EAC5B,EAAM,EAAc,IAAI,CAAG,EACjC,GAAI,EAAK,OAAO,EACZ,EAAc,MAAQ,IAAa,EAAc,MAAM,EAC3D,IAAM,EAAY,IAAI,KAAK,aAAa,EAAQ,CAAO,EAEvD,OADA,EAAc,IAAI,EAAK,CAAS,EACzB,CACX,CASA,SAAgB,EACZ,EACA,EACmB,CACnB,IAAM,EAAM,EAAO,EAAQ,CAAO,EAC5B,EAAM,EAAgB,IAAI,CAAG,EACnC,GAAI,EAAK,OAAO,EACZ,EAAgB,MAAQ,IAAa,EAAgB,MAAM,EAC/D,IAAM,EAAY,IAAI,KAAK,eAAe,EAAQ,CAAO,EAEzD,OADA,EAAgB,IAAI,EAAK,CAAS,EAC3B,CACX"}
1
+ {"version":3,"file":"intl-cache.cjs","names":["numberFormats","dateTimeFormats","keyFor","locale","options","numberFormat","key","hit","formatter","dateTimeFormat"],"sources":["../../src/utils/intl-cache.ts"],"sourcesContent":["/**\n * Cached `Intl` formatter factories.\n *\n * Constructing an `Intl.NumberFormat` or `Intl.DateTimeFormat` resolves locale\n * data, which is the expensive half; formatting with one afterwards is cheap.\n * Building a fresh formatter per call is therefore the difference between a\n * table of money cells costing microseconds and costing a frame: measured at\n * 15.56 µs per construct-and-format against 0.29 µs when the formatter is\n * reused, so a 500 × 3 grid goes from 23.1 ms to 0.4 ms.\n *\n * The cache is keyed by locale plus the serialised options, so two call sites\n * asking for the same shape share one formatter. It is capped and cleared\n * wholesale when it overflows: a caller that varies its options per call (a\n * fraction-digit count driven by data, say) would otherwise grow the map without\n * bound, and dropping everything is both correct and cheaper than tracking\n * recency for a map this small.\n */\n\n/** Largest number of distinct formatter shapes kept before the cache resets. */\nconst MAX_ENTRIES = 64;\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateTimeFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Build the cache key for a locale and options pair.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - The formatter options, or `undefined`.\n * @returns A string that is equal exactly when both inputs are equivalent.\n */\nfunction keyFor(locale: string | undefined, options: object | undefined): string {\n return `${locale ?? \"\"}|${options === undefined ? \"\" : JSON.stringify(options)}`;\n}\n\n/**\n * Get an `Intl.NumberFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.NumberFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function numberFormat(\n locale?: string,\n options?: Intl.NumberFormatOptions,\n): Intl.NumberFormat {\n const key = keyFor(locale, options);\n const hit = numberFormats.get(key);\n if (hit) return hit;\n if (numberFormats.size >= MAX_ENTRIES) numberFormats.clear();\n const formatter = new Intl.NumberFormat(locale, options);\n numberFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Get an `Intl.DateTimeFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.DateTimeFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function dateTimeFormat(\n locale?: string,\n options?: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = keyFor(locale, options);\n const hit = dateTimeFormats.get(key);\n if (hit) return hit;\n if (dateTimeFormats.size >= MAX_ENTRIES) dateTimeFormats.clear();\n const formatter = new Intl.DateTimeFormat(locale, options);\n dateTimeFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Drop every cached formatter.\n *\n * Exists for tests that assert on cache behaviour; production code has no\n * reason to call it, because a formatter never goes stale.\n *\n * @returns Nothing.\n */\nexport function clearIntlCache(): void {\n numberFormats.clear();\n dateTimeFormats.clear();\n}\n"],"mappings":"AAmBA,IAEMA,EAAgB,IAAI,IACpBC,EAAkB,IAAI,IAS5B,SAASC,EAAO,EAA4B,EAAqC,CAC7E,MAAO,GAAGC,GAAU,GAAG,GAAGC,IAAY,IAAA,GAAY,GAAK,KAAK,UAAUA,CAAO,GACjF,CASA,SAAgBC,EACZ,EACA,EACiB,CACjB,IAAMC,EAAMJ,EAAOC,EAAQC,CAAO,EAC5BG,EAAMP,EAAc,IAAIM,CAAG,EACjC,GAAIC,EAAK,OAAOA,EACZP,EAAc,MAAQ,IAAaA,EAAc,MAAM,EAC3D,IAAMQ,EAAY,IAAI,KAAK,aAAaL,EAAQC,CAAO,EAEvD,OADAJ,EAAc,IAAIM,EAAKE,CAAS,EACzBA,CACX,CASA,SAAgBC,EACZ,EACA,EACmB,CACnB,IAAMH,EAAMJ,EAAOC,EAAQC,CAAO,EAC5BG,EAAMN,EAAgB,IAAIK,CAAG,EACnC,GAAIC,EAAK,OAAOA,EACZN,EAAgB,MAAQ,IAAaA,EAAgB,MAAM,EAC/D,IAAMO,EAAY,IAAI,KAAK,eAAeL,EAAQC,CAAO,EAEzD,OADAH,EAAgB,IAAIK,EAAKE,CAAS,EAC3BA,CACX,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"intl-cache.js","names":[],"sources":["../../src/utils/intl-cache.ts"],"sourcesContent":["/**\n * Cached `Intl` formatter factories.\n *\n * Constructing an `Intl.NumberFormat` or `Intl.DateTimeFormat` resolves locale\n * data, which is the expensive half; formatting with one afterwards is cheap.\n * Building a fresh formatter per call is therefore the difference between a\n * table of money cells costing microseconds and costing a frame: measured at\n * 15.56 µs per construct-and-format against 0.29 µs when the formatter is\n * reused, so a 500 × 3 grid goes from 23.1 ms to 0.4 ms.\n *\n * The cache is keyed by locale plus the serialised options, so two call sites\n * asking for the same shape share one formatter. It is capped and cleared\n * wholesale when it overflows: a caller that varies its options per call (a\n * fraction-digit count driven by data, say) would otherwise grow the map without\n * bound, and dropping everything is both correct and cheaper than tracking\n * recency for a map this small.\n */\n\n/** Largest number of distinct formatter shapes kept before the cache resets. */\nconst MAX_ENTRIES = 64;\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateTimeFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Build the cache key for a locale and options pair.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - The formatter options, or `undefined`.\n * @returns A string that is equal exactly when both inputs are equivalent.\n */\nfunction keyFor(locale: string | undefined, options: object | undefined): string {\n return `${locale ?? \"\"}|${options === undefined ? \"\" : JSON.stringify(options)}`;\n}\n\n/**\n * Get an `Intl.NumberFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.NumberFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function numberFormat(\n locale?: string,\n options?: Intl.NumberFormatOptions,\n): Intl.NumberFormat {\n const key = keyFor(locale, options);\n const hit = numberFormats.get(key);\n if (hit) return hit;\n if (numberFormats.size >= MAX_ENTRIES) numberFormats.clear();\n const formatter = new Intl.NumberFormat(locale, options);\n numberFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Get an `Intl.DateTimeFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.DateTimeFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function dateTimeFormat(\n locale?: string,\n options?: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = keyFor(locale, options);\n const hit = dateTimeFormats.get(key);\n if (hit) return hit;\n if (dateTimeFormats.size >= MAX_ENTRIES) dateTimeFormats.clear();\n const formatter = new Intl.DateTimeFormat(locale, options);\n dateTimeFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Drop every cached formatter.\n *\n * Exists for tests that assert on cache behaviour; production code has no\n * reason to call it, because a formatter never goes stale.\n *\n * @returns Nothing.\n */\nexport function clearIntlCache(): void {\n numberFormats.clear();\n dateTimeFormats.clear();\n}\n"],"mappings":";AAmBA,IAEM,oBAAgB,IAAI,IAA+B,GACnD,oBAAkB,IAAI,IAAiC;AAS7D,SAAS,EAAO,GAA4B,GAAqC;CAC7E,OAAO,GAAG,KAAU,GAAG,GAAG,MAAY,KAAA,IAAY,KAAK,KAAK,UAAU,CAAO;AACjF;AASA,SAAgB,EACZ,GACA,GACiB;CACjB,IAAM,IAAM,EAAO,GAAQ,CAAO,GAC5B,IAAM,EAAc,IAAI,CAAG;CACjC,IAAI,GAAK,OAAO;CAChB,AAAI,EAAc,QAAQ,MAAa,EAAc,MAAM;CAC3D,IAAM,IAAY,IAAI,KAAK,aAAa,GAAQ,CAAO;CAEvD,OADA,EAAc,IAAI,GAAK,CAAS,GACzB;AACX;AASA,SAAgB,EACZ,GACA,GACmB;CACnB,IAAM,IAAM,EAAO,GAAQ,CAAO,GAC5B,IAAM,EAAgB,IAAI,CAAG;CACnC,IAAI,GAAK,OAAO;CAChB,AAAI,EAAgB,QAAQ,MAAa,EAAgB,MAAM;CAC/D,IAAM,IAAY,IAAI,KAAK,eAAe,GAAQ,CAAO;CAEzD,OADA,EAAgB,IAAI,GAAK,CAAS,GAC3B;AACX"}
1
+ {"version":3,"file":"intl-cache.js","names":["numberFormats","dateTimeFormats","keyFor","locale","options","numberFormat","key","hit","formatter","dateTimeFormat"],"sources":["../../src/utils/intl-cache.ts"],"sourcesContent":["/**\n * Cached `Intl` formatter factories.\n *\n * Constructing an `Intl.NumberFormat` or `Intl.DateTimeFormat` resolves locale\n * data, which is the expensive half; formatting with one afterwards is cheap.\n * Building a fresh formatter per call is therefore the difference between a\n * table of money cells costing microseconds and costing a frame: measured at\n * 15.56 µs per construct-and-format against 0.29 µs when the formatter is\n * reused, so a 500 × 3 grid goes from 23.1 ms to 0.4 ms.\n *\n * The cache is keyed by locale plus the serialised options, so two call sites\n * asking for the same shape share one formatter. It is capped and cleared\n * wholesale when it overflows: a caller that varies its options per call (a\n * fraction-digit count driven by data, say) would otherwise grow the map without\n * bound, and dropping everything is both correct and cheaper than tracking\n * recency for a map this small.\n */\n\n/** Largest number of distinct formatter shapes kept before the cache resets. */\nconst MAX_ENTRIES = 64;\n\nconst numberFormats = new Map<string, Intl.NumberFormat>();\nconst dateTimeFormats = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Build the cache key for a locale and options pair.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - The formatter options, or `undefined`.\n * @returns A string that is equal exactly when both inputs are equivalent.\n */\nfunction keyFor(locale: string | undefined, options: object | undefined): string {\n return `${locale ?? \"\"}|${options === undefined ? \"\" : JSON.stringify(options)}`;\n}\n\n/**\n * Get an `Intl.NumberFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.NumberFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function numberFormat(\n locale?: string,\n options?: Intl.NumberFormatOptions,\n): Intl.NumberFormat {\n const key = keyFor(locale, options);\n const hit = numberFormats.get(key);\n if (hit) return hit;\n if (numberFormats.size >= MAX_ENTRIES) numberFormats.clear();\n const formatter = new Intl.NumberFormat(locale, options);\n numberFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Get an `Intl.DateTimeFormat`, reusing one already built for the same shape.\n *\n * @param locale - The BCP 47 locale, or `undefined` for the runtime default.\n * @param options - Standard `Intl.DateTimeFormat` options.\n * @returns A formatter that must not be mutated by the caller.\n */\nexport function dateTimeFormat(\n locale?: string,\n options?: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const key = keyFor(locale, options);\n const hit = dateTimeFormats.get(key);\n if (hit) return hit;\n if (dateTimeFormats.size >= MAX_ENTRIES) dateTimeFormats.clear();\n const formatter = new Intl.DateTimeFormat(locale, options);\n dateTimeFormats.set(key, formatter);\n return formatter;\n}\n\n/**\n * Drop every cached formatter.\n *\n * Exists for tests that assert on cache behaviour; production code has no\n * reason to call it, because a formatter never goes stale.\n *\n * @returns Nothing.\n */\nexport function clearIntlCache(): void {\n numberFormats.clear();\n dateTimeFormats.clear();\n}\n"],"mappings":";AAmBA,IAEMA,oBAAgB,IAAI,IAA+B,GACnDC,oBAAkB,IAAI,IAAiC;AAS7D,SAASC,EAAO,GAA4B,GAAqC;CAC7E,OAAO,GAAGC,KAAU,GAAG,GAAGC,MAAY,KAAA,IAAY,KAAK,KAAK,UAAUA,CAAO;AACjF;AASA,SAAgBC,EACZ,GACA,GACiB;CACjB,IAAMC,IAAMJ,EAAOC,GAAQC,CAAO,GAC5BG,IAAMP,EAAc,IAAIM,CAAG;CACjC,IAAIC,GAAK,OAAOA;CAChB,AAAIP,EAAc,QAAQ,MAAaA,EAAc,MAAM;CAC3D,IAAMQ,IAAY,IAAI,KAAK,aAAaL,GAAQC,CAAO;CAEvD,OADAJ,EAAc,IAAIM,GAAKE,CAAS,GACzBA;AACX;AASA,SAAgBC,EACZ,GACA,GACmB;CACnB,IAAMH,IAAMJ,EAAOC,GAAQC,CAAO,GAC5BG,IAAMN,EAAgB,IAAIK,CAAG;CACnC,IAAIC,GAAK,OAAOA;CAChB,AAAIN,EAAgB,QAAQ,MAAaA,EAAgB,MAAM;CAC/D,IAAMO,IAAY,IAAI,KAAK,eAAeL,GAAQC,CAAO;CAEzD,OADAH,EAAgB,IAAIK,GAAKE,CAAS,GAC3BA;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"json-frame.cjs","names":[],"sources":["../../src/utils/json-frame.ts"],"sourcesContent":["import { isDevBuild } from \"./dev-mode\";\nimport { validateWithSchema, type SchemaIssue, type SchemaLike } from \"./schema-like\";\n\n/**\n * The one decoder behind `createWebSocket`, `useWebSocket` and\n * `createEventStream`.\n *\n * Internal, and imported by path rather than through the `utils` barrel: it\n * exists so the three transports share one answer to \"the frame is not JSON\",\n * not so consumers can call it.\n *\n * That question used to have three identical copies of the same wrong answer —\n * `return raw as unknown as T`, which hands the consumer a `string` announced as\n * `T`. The failure never surfaced at the parse; it surfaced later, on the first\n * `message.id`, with nothing left to say the frame had not been JSON.\n */\n\n/** Outcome of decoding one frame. */\nexport interface DecodedFrame<T> {\n /** Whether the message should reach `onMessage`. */\n delivered: boolean;\n /** The decoded payload. Only meaningful when `delivered` is `true`. */\n data: T;\n}\n\n/** How one frame should be turned into `T`, and who hears about failures. */\nexport interface DecodeFrameOptions<T> {\n /** Caller-supplied decoder, which owns the frame completely. */\n parser?: (raw: string) => T;\n /** Caller-supplied handler for a frame that is not valid JSON. */\n onParseError?: (error: unknown, raw: string) => void;\n /** Caller-supplied schema the decoded payload must satisfy. */\n schema?: SchemaLike<T>;\n /** Caller-supplied handler for a payload the schema refused. */\n onValidationError?: (issues: SchemaIssue[], raw: string) => void;\n}\n\nconst warned = new Set<string>();\n\n/**\n * Warn once per transport that a frame arrived which was not JSON.\n *\n * Once, because a stream sending text frames sends many, and a console line per\n * frame buries the one that mattered. Development builds only.\n *\n * @param transport - Label used in the message, e.g. `\"createWebSocket\"`.\n * @returns Nothing.\n */\nfunction warnOnce(transport: string): void {\n if (!isDevBuild() || warned.has(transport)) return;\n warned.add(transport);\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame was not valid JSON, so the raw string is ` +\n `being delivered as if it were your message type. Pass \\`parser\\` to decode it, or ` +\n `\\`onParseError\\` to drop it and handle the failure. This warning appears once.`,\n );\n}\n\n/**\n * Warn once per transport that a frame was dropped by the schema.\n *\n * A dropped frame with no `onValidationError` is otherwise completely silent —\n * the stream looks healthy and the payload simply never arrives, which is the\n * hardest shape of failure to notice. Development builds only, once, for the\n * same reason as {@link warnOnce}.\n *\n * @param transport - Label used in the message, e.g. `\"createEventStream\"`.\n * @param issues - The issues the schema reported, summarized into the message.\n * @returns Nothing.\n */\nfunction warnValidationOnce(transport: string, issues: SchemaIssue[]): void {\n const key = `${transport}:schema`;\n if (!isDevBuild() || warned.has(key)) return;\n warned.add(key);\n const summary = issues.map((issue) => `${issue.path}: ${issue.message}`).join(\"; \");\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame did not match \\`schema\\` and was dropped ` +\n `(${summary}). Pass \\`onValidationError\\` to handle it yourself. This warning ` +\n `appears once.`,\n );\n}\n\n/**\n * Decode one frame, reporting whether it should be delivered.\n *\n * A caller-supplied `parser` owns the frame completely: its result is delivered\n * as it is, or validated when a `schema` was also supplied — decoding text,\n * binary-as-base64 or a protocol of its own is the point of that option.\n *\n * Without one, the frame is parsed as JSON. When that throws:\n *\n * - with `onParseError`, the callback fires and the frame is **not** delivered,\n * because a consumer that asked to hear about failures did not ask to also\n * receive the broken frame;\n * - with `schema` and no `onParseError`, the raw string goes to the schema,\n * which refuses it — a caller who asked for validation never receives an\n * unvalidated payload, and a frame the server sent empty is exactly this case;\n * - with neither, the raw string is delivered as `T` — the behaviour every\n * version before this one had, kept so nothing breaks — and development builds\n * warn once that it happened.\n *\n * With a `schema`, a payload the schema refuses is not delivered, and\n * `onValidationError` hears the issues. The value delivered is the schema's\n * **output**, so a schema that coerces or defaults is honoured.\n *\n * @param raw - The frame body as text.\n * @param transport - Label used in the development warnings.\n * @param options - Caller-supplied decoder, schema and failure handlers.\n * @returns Whether to deliver, and the payload.\n */\nexport function decodeFrame<T>(\n raw: string,\n transport: string,\n options: DecodeFrameOptions<T>,\n): DecodedFrame<T> {\n const { parser, onParseError, schema, onValidationError } = options;\n\n /**\n * Put one decoded payload through the schema, when there is one.\n *\n * @param value - The payload as parsing produced it.\n * @returns Whether to deliver, and the payload the consumer should see.\n */\n function gate(value: unknown): DecodedFrame<T> {\n if (!schema) return { delivered: true, data: value as T };\n const result = validateWithSchema(schema, value);\n if (result.ok) return { delivered: true, data: result.data };\n if (onValidationError) onValidationError(result.issues, raw);\n else warnValidationOnce(transport, result.issues);\n return { delivered: false, data: undefined as T };\n }\n\n if (parser) return gate(parser(raw));\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error) {\n if (onParseError) {\n onParseError(error, raw);\n return { delivered: false, data: undefined as T };\n }\n if (schema) return gate(raw);\n warnOnce(transport);\n return { delivered: true, data: raw as unknown as T };\n }\n return gate(parsed);\n}\n\n/**\n * Forget which transports have already warned.\n *\n * Exists for tests, which would otherwise see the first case swallow the\n * warning for every case after it.\n *\n * @returns Nothing.\n */\nexport function resetFrameWarnings(): void {\n warned.clear();\n}\n"],"mappings":"iEAqCA,IAAM,EAAS,IAAI,IAWnB,SAAS,EAAS,EAAyB,CAClC,EAAA,WAAW,GAAK,GAAO,IAAI,CAAS,IACzC,EAAO,IAAI,CAAS,EACpB,QAAQ,KACJ,uBAAuB,EAAU,oNAGrC,EACJ,CAcA,SAAS,EAAmB,EAAmB,EAA6B,CACxE,IAAM,EAAM,GAAG,EAAU,SACzB,GAAI,CAAC,EAAA,WAAW,GAAK,EAAO,IAAI,CAAG,EAAG,OACtC,EAAO,IAAI,CAAG,EACd,IAAM,EAAU,EAAO,IAAK,GAAU,GAAG,EAAM,KAAK,IAAI,EAAM,SAAS,CAAC,CAAC,KAAK,IAAI,EAClF,QAAQ,KACJ,uBAAuB,EAAU,sDACzB,EAAQ,gFAEpB,CACJ,CA8BA,SAAgB,EACZ,EACA,EACA,EACe,CACf,GAAM,CAAE,SAAQ,eAAc,SAAQ,qBAAsB,EAQ5D,SAAS,EAAK,EAAiC,CAC3C,GAAI,CAAC,EAAQ,MAAO,CAAE,UAAW,GAAM,KAAM,CAAW,EACxD,IAAM,EAAS,EAAA,mBAAmB,EAAQ,CAAK,EAI/C,OAHI,EAAO,GAAW,CAAE,UAAW,GAAM,KAAM,EAAO,IAAK,GACvD,EAAmB,EAAkB,EAAO,OAAQ,CAAG,EACtD,EAAmB,EAAW,EAAO,MAAM,EACzC,CAAE,UAAW,GAAO,KAAM,IAAA,EAAe,EACpD,CAEA,GAAI,EAAQ,OAAO,EAAK,EAAO,CAAG,CAAC,EACnC,IAAI,EACJ,GAAI,CACA,EAAS,KAAK,MAAM,CAAG,CAC3B,OAAS,EAAO,CAOZ,OANI,GACA,EAAa,EAAO,CAAG,EAChB,CAAE,UAAW,GAAO,KAAM,IAAA,EAAe,GAEhD,EAAe,EAAK,CAAG,GAC3B,EAAS,CAAS,EACX,CAAE,UAAW,GAAM,KAAM,CAAoB,EACxD,CACA,OAAO,EAAK,CAAM,CACtB"}
1
+ {"version":3,"file":"json-frame.cjs","names":["isDevBuild","validateWithSchema","require_dev_mode","require_schema_like","warned","warnOnce","transport","warnValidationOnce","key","summary","issues","issue","decodeFrame","options","gate","schema","value","result","onValidationError","raw","parser","parsed","error","onParseError"],"sources":["../../src/utils/json-frame.ts"],"sourcesContent":["import { isDevBuild } from \"./dev-mode\";\nimport { validateWithSchema, type SchemaIssue, type SchemaLike } from \"./schema-like\";\n\n/**\n * The one decoder behind `createWebSocket`, `useWebSocket` and\n * `createEventStream`.\n *\n * Internal, and imported by path rather than through the `utils` barrel: it\n * exists so the three transports share one answer to \"the frame is not JSON\",\n * not so consumers can call it.\n *\n * That question used to have three identical copies of the same wrong answer —\n * `return raw as unknown as T`, which hands the consumer a `string` announced as\n * `T`. The failure never surfaced at the parse; it surfaced later, on the first\n * `message.id`, with nothing left to say the frame had not been JSON.\n */\n\n/** Outcome of decoding one frame. */\nexport interface DecodedFrame<T> {\n /** Whether the message should reach `onMessage`. */\n delivered: boolean;\n /** The decoded payload. Only meaningful when `delivered` is `true`. */\n data: T;\n}\n\n/** How one frame should be turned into `T`, and who hears about failures. */\nexport interface DecodeFrameOptions<T> {\n /** Caller-supplied decoder, which owns the frame completely. */\n parser?: (raw: string) => T;\n /** Caller-supplied handler for a frame that is not valid JSON. */\n onParseError?: (error: unknown, raw: string) => void;\n /** Caller-supplied schema the decoded payload must satisfy. */\n schema?: SchemaLike<T>;\n /** Caller-supplied handler for a payload the schema refused. */\n onValidationError?: (issues: SchemaIssue[], raw: string) => void;\n}\n\nconst warned = new Set<string>();\n\n/**\n * Warn once per transport that a frame arrived which was not JSON.\n *\n * Once, because a stream sending text frames sends many, and a console line per\n * frame buries the one that mattered. Development builds only.\n *\n * @param transport - Label used in the message, e.g. `\"createWebSocket\"`.\n * @returns Nothing.\n */\nfunction warnOnce(transport: string): void {\n if (!isDevBuild() || warned.has(transport)) return;\n warned.add(transport);\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame was not valid JSON, so the raw string is ` +\n `being delivered as if it were your message type. Pass \\`parser\\` to decode it, or ` +\n `\\`onParseError\\` to drop it and handle the failure. This warning appears once.`,\n );\n}\n\n/**\n * Warn once per transport that a frame was dropped by the schema.\n *\n * A dropped frame with no `onValidationError` is otherwise completely silent —\n * the stream looks healthy and the payload simply never arrives, which is the\n * hardest shape of failure to notice. Development builds only, once, for the\n * same reason as {@link warnOnce}.\n *\n * @param transport - Label used in the message, e.g. `\"createEventStream\"`.\n * @param issues - The issues the schema reported, summarized into the message.\n * @returns Nothing.\n */\nfunction warnValidationOnce(transport: string, issues: SchemaIssue[]): void {\n const key = `${transport}:schema`;\n if (!isDevBuild() || warned.has(key)) return;\n warned.add(key);\n const summary = issues.map((issue) => `${issue.path}: ${issue.message}`).join(\"; \");\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame did not match \\`schema\\` and was dropped ` +\n `(${summary}). Pass \\`onValidationError\\` to handle it yourself. This warning ` +\n `appears once.`,\n );\n}\n\n/**\n * Decode one frame, reporting whether it should be delivered.\n *\n * A caller-supplied `parser` owns the frame completely: its result is delivered\n * as it is, or validated when a `schema` was also supplied — decoding text,\n * binary-as-base64 or a protocol of its own is the point of that option.\n *\n * Without one, the frame is parsed as JSON. When that throws:\n *\n * - with `onParseError`, the callback fires and the frame is **not** delivered,\n * because a consumer that asked to hear about failures did not ask to also\n * receive the broken frame;\n * - with `schema` and no `onParseError`, the raw string goes to the schema,\n * which refuses it — a caller who asked for validation never receives an\n * unvalidated payload, and a frame the server sent empty is exactly this case;\n * - with neither, the raw string is delivered as `T` — the behaviour every\n * version before this one had, kept so nothing breaks — and development builds\n * warn once that it happened.\n *\n * With a `schema`, a payload the schema refuses is not delivered, and\n * `onValidationError` hears the issues. The value delivered is the schema's\n * **output**, so a schema that coerces or defaults is honoured.\n *\n * @param raw - The frame body as text.\n * @param transport - Label used in the development warnings.\n * @param options - Caller-supplied decoder, schema and failure handlers.\n * @returns Whether to deliver, and the payload.\n */\nexport function decodeFrame<T>(\n raw: string,\n transport: string,\n options: DecodeFrameOptions<T>,\n): DecodedFrame<T> {\n const { parser, onParseError, schema, onValidationError } = options;\n\n /**\n * Put one decoded payload through the schema, when there is one.\n *\n * @param value - The payload as parsing produced it.\n * @returns Whether to deliver, and the payload the consumer should see.\n */\n function gate(value: unknown): DecodedFrame<T> {\n if (!schema) return { delivered: true, data: value as T };\n const result = validateWithSchema(schema, value);\n if (result.ok) return { delivered: true, data: result.data };\n if (onValidationError) onValidationError(result.issues, raw);\n else warnValidationOnce(transport, result.issues);\n return { delivered: false, data: undefined as T };\n }\n\n if (parser) return gate(parser(raw));\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error) {\n if (onParseError) {\n onParseError(error, raw);\n return { delivered: false, data: undefined as T };\n }\n if (schema) return gate(raw);\n warnOnce(transport);\n return { delivered: true, data: raw as unknown as T };\n }\n return gate(parsed);\n}\n\n/**\n * Forget which transports have already warned.\n *\n * Exists for tests, which would otherwise see the first case swallow the\n * warning for every case after it.\n *\n * @returns Nothing.\n */\nexport function resetFrameWarnings(): void {\n warned.clear();\n}\n"],"mappings":"A,iEAqCA,IAAMI,EAAS,IAAI,IAWnB,SAASC,EAAS,EAAyB,CAClCL,EAAAA,WAAW,GAAK,GAAO,IAAIM,CAAS,IACzCF,EAAO,IAAIE,CAAS,EACpB,QAAQ,KACJ,uBAAuBA,EAAU,oNAGrC,EACJ,CAcA,SAASC,EAAmB,EAAmB,EAA6B,CACxE,IAAMC,EAAM,GAAGF,EAAU,SACzB,GAAI,CAACN,EAAAA,WAAW,GAAKI,EAAO,IAAII,CAAG,EAAG,OACtCJ,EAAO,IAAII,CAAG,EACd,IAAMC,EAAUC,EAAO,IAAK,GAAU,GAAGC,EAAM,KAAK,IAAIA,EAAM,SAAS,CAAC,CAAC,KAAK,IAAI,EAClF,QAAQ,KACJ,uBAAuBL,EAAU,sDACzBG,EAAQ,gFAEpB,CACJ,CA8BA,SAAgBG,EACZ,EACA,EACA,EACe,CACf,GAAM,CAAE,SAAQ,eAAc,SAAQ,qBAAsBC,EAQ5D,SAASC,EAAK,EAAiC,CAC3C,GAAI,CAACC,EAAQ,MAAO,CAAE,UAAW,GAAM,KAAMC,CAAW,EACxD,IAAMC,EAAShB,EAAAA,mBAAmBc,EAAQC,CAAK,EAI/C,OAHIC,EAAO,GAAW,CAAE,UAAW,GAAM,KAAMA,EAAO,IAAK,GACvDC,EAAmBA,EAAkBD,EAAO,OAAQE,CAAG,EACtDZ,EAAmBD,EAAWW,EAAO,MAAM,EACzC,CAAE,UAAW,GAAO,KAAM,IAAA,EAAe,EACpD,CAEA,GAAIG,EAAQ,OAAON,EAAKM,EAAOD,CAAG,CAAC,EACnC,IAAIE,EACJ,GAAI,CACA,EAAS,KAAK,MAAMF,CAAG,CAC3B,OAASG,EAAO,CAOZ,OANIC,GACAA,EAAaD,EAAOH,CAAG,EAChB,CAAE,UAAW,GAAO,KAAM,IAAA,EAAe,GAEhDJ,EAAeD,EAAKK,CAAG,GAC3Bd,EAASC,CAAS,EACX,CAAE,UAAW,GAAM,KAAMa,CAAoB,EACxD,CACA,OAAOL,EAAKO,CAAM,CACtB,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"json-frame.js","names":[],"sources":["../../src/utils/json-frame.ts"],"sourcesContent":["import { isDevBuild } from \"./dev-mode\";\nimport { validateWithSchema, type SchemaIssue, type SchemaLike } from \"./schema-like\";\n\n/**\n * The one decoder behind `createWebSocket`, `useWebSocket` and\n * `createEventStream`.\n *\n * Internal, and imported by path rather than through the `utils` barrel: it\n * exists so the three transports share one answer to \"the frame is not JSON\",\n * not so consumers can call it.\n *\n * That question used to have three identical copies of the same wrong answer —\n * `return raw as unknown as T`, which hands the consumer a `string` announced as\n * `T`. The failure never surfaced at the parse; it surfaced later, on the first\n * `message.id`, with nothing left to say the frame had not been JSON.\n */\n\n/** Outcome of decoding one frame. */\nexport interface DecodedFrame<T> {\n /** Whether the message should reach `onMessage`. */\n delivered: boolean;\n /** The decoded payload. Only meaningful when `delivered` is `true`. */\n data: T;\n}\n\n/** How one frame should be turned into `T`, and who hears about failures. */\nexport interface DecodeFrameOptions<T> {\n /** Caller-supplied decoder, which owns the frame completely. */\n parser?: (raw: string) => T;\n /** Caller-supplied handler for a frame that is not valid JSON. */\n onParseError?: (error: unknown, raw: string) => void;\n /** Caller-supplied schema the decoded payload must satisfy. */\n schema?: SchemaLike<T>;\n /** Caller-supplied handler for a payload the schema refused. */\n onValidationError?: (issues: SchemaIssue[], raw: string) => void;\n}\n\nconst warned = new Set<string>();\n\n/**\n * Warn once per transport that a frame arrived which was not JSON.\n *\n * Once, because a stream sending text frames sends many, and a console line per\n * frame buries the one that mattered. Development builds only.\n *\n * @param transport - Label used in the message, e.g. `\"createWebSocket\"`.\n * @returns Nothing.\n */\nfunction warnOnce(transport: string): void {\n if (!isDevBuild() || warned.has(transport)) return;\n warned.add(transport);\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame was not valid JSON, so the raw string is ` +\n `being delivered as if it were your message type. Pass \\`parser\\` to decode it, or ` +\n `\\`onParseError\\` to drop it and handle the failure. This warning appears once.`,\n );\n}\n\n/**\n * Warn once per transport that a frame was dropped by the schema.\n *\n * A dropped frame with no `onValidationError` is otherwise completely silent —\n * the stream looks healthy and the payload simply never arrives, which is the\n * hardest shape of failure to notice. Development builds only, once, for the\n * same reason as {@link warnOnce}.\n *\n * @param transport - Label used in the message, e.g. `\"createEventStream\"`.\n * @param issues - The issues the schema reported, summarized into the message.\n * @returns Nothing.\n */\nfunction warnValidationOnce(transport: string, issues: SchemaIssue[]): void {\n const key = `${transport}:schema`;\n if (!isDevBuild() || warned.has(key)) return;\n warned.add(key);\n const summary = issues.map((issue) => `${issue.path}: ${issue.message}`).join(\"; \");\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame did not match \\`schema\\` and was dropped ` +\n `(${summary}). Pass \\`onValidationError\\` to handle it yourself. This warning ` +\n `appears once.`,\n );\n}\n\n/**\n * Decode one frame, reporting whether it should be delivered.\n *\n * A caller-supplied `parser` owns the frame completely: its result is delivered\n * as it is, or validated when a `schema` was also supplied — decoding text,\n * binary-as-base64 or a protocol of its own is the point of that option.\n *\n * Without one, the frame is parsed as JSON. When that throws:\n *\n * - with `onParseError`, the callback fires and the frame is **not** delivered,\n * because a consumer that asked to hear about failures did not ask to also\n * receive the broken frame;\n * - with `schema` and no `onParseError`, the raw string goes to the schema,\n * which refuses it — a caller who asked for validation never receives an\n * unvalidated payload, and a frame the server sent empty is exactly this case;\n * - with neither, the raw string is delivered as `T` — the behaviour every\n * version before this one had, kept so nothing breaks — and development builds\n * warn once that it happened.\n *\n * With a `schema`, a payload the schema refuses is not delivered, and\n * `onValidationError` hears the issues. The value delivered is the schema's\n * **output**, so a schema that coerces or defaults is honoured.\n *\n * @param raw - The frame body as text.\n * @param transport - Label used in the development warnings.\n * @param options - Caller-supplied decoder, schema and failure handlers.\n * @returns Whether to deliver, and the payload.\n */\nexport function decodeFrame<T>(\n raw: string,\n transport: string,\n options: DecodeFrameOptions<T>,\n): DecodedFrame<T> {\n const { parser, onParseError, schema, onValidationError } = options;\n\n /**\n * Put one decoded payload through the schema, when there is one.\n *\n * @param value - The payload as parsing produced it.\n * @returns Whether to deliver, and the payload the consumer should see.\n */\n function gate(value: unknown): DecodedFrame<T> {\n if (!schema) return { delivered: true, data: value as T };\n const result = validateWithSchema(schema, value);\n if (result.ok) return { delivered: true, data: result.data };\n if (onValidationError) onValidationError(result.issues, raw);\n else warnValidationOnce(transport, result.issues);\n return { delivered: false, data: undefined as T };\n }\n\n if (parser) return gate(parser(raw));\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error) {\n if (onParseError) {\n onParseError(error, raw);\n return { delivered: false, data: undefined as T };\n }\n if (schema) return gate(raw);\n warnOnce(transport);\n return { delivered: true, data: raw as unknown as T };\n }\n return gate(parsed);\n}\n\n/**\n * Forget which transports have already warned.\n *\n * Exists for tests, which would otherwise see the first case swallow the\n * warning for every case after it.\n *\n * @returns Nothing.\n */\nexport function resetFrameWarnings(): void {\n warned.clear();\n}\n"],"mappings":";;;AAqCA,IAAM,oBAAS,IAAI,IAAY;AAW/B,SAAS,EAAS,GAAyB;CACnC,AAAC,EAAW,KAAK,GAAO,IAAI,CAAS,MACzC,EAAO,IAAI,CAAS,GACpB,QAAQ,KACJ,uBAAuB,EAAU,oNAGrC;AACJ;AAcA,SAAS,EAAmB,GAAmB,GAA6B;CACxE,IAAM,IAAM,GAAG,EAAU;CACzB,IAAI,CAAC,EAAW,KAAK,EAAO,IAAI,CAAG,GAAG;CACtC,EAAO,IAAI,CAAG;CACd,IAAM,IAAU,EAAO,KAAK,MAAU,GAAG,EAAM,KAAK,IAAI,EAAM,SAAS,CAAC,CAAC,KAAK,IAAI;CAClF,QAAQ,KACJ,uBAAuB,EAAU,sDACzB,EAAQ,gFAEpB;AACJ;AA8BA,SAAgB,EACZ,GACA,GACA,GACe;CACf,IAAM,EAAE,WAAQ,iBAAc,WAAQ,yBAAsB;CAQ5D,SAAS,EAAK,GAAiC;EAC3C,IAAI,CAAC,GAAQ,OAAO;GAAE,WAAW;GAAM,MAAM;EAAW;EACxD,IAAM,IAAS,EAAmB,GAAQ,CAAK;EAI/C,OAHI,EAAO,KAAW;GAAE,WAAW;GAAM,MAAM,EAAO;EAAK,KACvD,IAAmB,EAAkB,EAAO,QAAQ,CAAG,IACtD,EAAmB,GAAW,EAAO,MAAM,GACzC;GAAE,WAAW;GAAO,MAAM,KAAA;EAAe;CACpD;CAEA,IAAI,GAAQ,OAAO,EAAK,EAAO,CAAG,CAAC;CACnC,IAAI;CACJ,IAAI;EACA,IAAS,KAAK,MAAM,CAAG;CAC3B,SAAS,GAAO;EAOZ,OANI,KACA,EAAa,GAAO,CAAG,GAChB;GAAE,WAAW;GAAO,MAAM,KAAA;EAAe,KAEhD,IAAe,EAAK,CAAG,KAC3B,EAAS,CAAS,GACX;GAAE,WAAW;GAAM,MAAM;EAAoB;CACxD;CACA,OAAO,EAAK,CAAM;AACtB"}
1
+ {"version":3,"file":"json-frame.js","names":["warned","warnOnce","isDevBuild","transport","warnValidationOnce","key","summary","issues","issue","decodeFrame","options","gate","schema","value","result","validateWithSchema","onValidationError","raw","parser","parsed","error","onParseError"],"sources":["../../src/utils/json-frame.ts"],"sourcesContent":["import { isDevBuild } from \"./dev-mode\";\nimport { validateWithSchema, type SchemaIssue, type SchemaLike } from \"./schema-like\";\n\n/**\n * The one decoder behind `createWebSocket`, `useWebSocket` and\n * `createEventStream`.\n *\n * Internal, and imported by path rather than through the `utils` barrel: it\n * exists so the three transports share one answer to \"the frame is not JSON\",\n * not so consumers can call it.\n *\n * That question used to have three identical copies of the same wrong answer —\n * `return raw as unknown as T`, which hands the consumer a `string` announced as\n * `T`. The failure never surfaced at the parse; it surfaced later, on the first\n * `message.id`, with nothing left to say the frame had not been JSON.\n */\n\n/** Outcome of decoding one frame. */\nexport interface DecodedFrame<T> {\n /** Whether the message should reach `onMessage`. */\n delivered: boolean;\n /** The decoded payload. Only meaningful when `delivered` is `true`. */\n data: T;\n}\n\n/** How one frame should be turned into `T`, and who hears about failures. */\nexport interface DecodeFrameOptions<T> {\n /** Caller-supplied decoder, which owns the frame completely. */\n parser?: (raw: string) => T;\n /** Caller-supplied handler for a frame that is not valid JSON. */\n onParseError?: (error: unknown, raw: string) => void;\n /** Caller-supplied schema the decoded payload must satisfy. */\n schema?: SchemaLike<T>;\n /** Caller-supplied handler for a payload the schema refused. */\n onValidationError?: (issues: SchemaIssue[], raw: string) => void;\n}\n\nconst warned = new Set<string>();\n\n/**\n * Warn once per transport that a frame arrived which was not JSON.\n *\n * Once, because a stream sending text frames sends many, and a console line per\n * frame buries the one that mattered. Development builds only.\n *\n * @param transport - Label used in the message, e.g. `\"createWebSocket\"`.\n * @returns Nothing.\n */\nfunction warnOnce(transport: string): void {\n if (!isDevBuild() || warned.has(transport)) return;\n warned.add(transport);\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame was not valid JSON, so the raw string is ` +\n `being delivered as if it were your message type. Pass \\`parser\\` to decode it, or ` +\n `\\`onParseError\\` to drop it and handle the failure. This warning appears once.`,\n );\n}\n\n/**\n * Warn once per transport that a frame was dropped by the schema.\n *\n * A dropped frame with no `onValidationError` is otherwise completely silent —\n * the stream looks healthy and the payload simply never arrives, which is the\n * hardest shape of failure to notice. Development builds only, once, for the\n * same reason as {@link warnOnce}.\n *\n * @param transport - Label used in the message, e.g. `\"createEventStream\"`.\n * @param issues - The issues the schema reported, summarized into the message.\n * @returns Nothing.\n */\nfunction warnValidationOnce(transport: string, issues: SchemaIssue[]): void {\n const key = `${transport}:schema`;\n if (!isDevBuild() || warned.has(key)) return;\n warned.add(key);\n const summary = issues.map((issue) => `${issue.path}: ${issue.message}`).join(\"; \");\n console.warn(\n `[tempest-react-sdk] ${transport}: a frame did not match \\`schema\\` and was dropped ` +\n `(${summary}). Pass \\`onValidationError\\` to handle it yourself. This warning ` +\n `appears once.`,\n );\n}\n\n/**\n * Decode one frame, reporting whether it should be delivered.\n *\n * A caller-supplied `parser` owns the frame completely: its result is delivered\n * as it is, or validated when a `schema` was also supplied — decoding text,\n * binary-as-base64 or a protocol of its own is the point of that option.\n *\n * Without one, the frame is parsed as JSON. When that throws:\n *\n * - with `onParseError`, the callback fires and the frame is **not** delivered,\n * because a consumer that asked to hear about failures did not ask to also\n * receive the broken frame;\n * - with `schema` and no `onParseError`, the raw string goes to the schema,\n * which refuses it — a caller who asked for validation never receives an\n * unvalidated payload, and a frame the server sent empty is exactly this case;\n * - with neither, the raw string is delivered as `T` — the behaviour every\n * version before this one had, kept so nothing breaks — and development builds\n * warn once that it happened.\n *\n * With a `schema`, a payload the schema refuses is not delivered, and\n * `onValidationError` hears the issues. The value delivered is the schema's\n * **output**, so a schema that coerces or defaults is honoured.\n *\n * @param raw - The frame body as text.\n * @param transport - Label used in the development warnings.\n * @param options - Caller-supplied decoder, schema and failure handlers.\n * @returns Whether to deliver, and the payload.\n */\nexport function decodeFrame<T>(\n raw: string,\n transport: string,\n options: DecodeFrameOptions<T>,\n): DecodedFrame<T> {\n const { parser, onParseError, schema, onValidationError } = options;\n\n /**\n * Put one decoded payload through the schema, when there is one.\n *\n * @param value - The payload as parsing produced it.\n * @returns Whether to deliver, and the payload the consumer should see.\n */\n function gate(value: unknown): DecodedFrame<T> {\n if (!schema) return { delivered: true, data: value as T };\n const result = validateWithSchema(schema, value);\n if (result.ok) return { delivered: true, data: result.data };\n if (onValidationError) onValidationError(result.issues, raw);\n else warnValidationOnce(transport, result.issues);\n return { delivered: false, data: undefined as T };\n }\n\n if (parser) return gate(parser(raw));\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch (error) {\n if (onParseError) {\n onParseError(error, raw);\n return { delivered: false, data: undefined as T };\n }\n if (schema) return gate(raw);\n warnOnce(transport);\n return { delivered: true, data: raw as unknown as T };\n }\n return gate(parsed);\n}\n\n/**\n * Forget which transports have already warned.\n *\n * Exists for tests, which would otherwise see the first case swallow the\n * warning for every case after it.\n *\n * @returns Nothing.\n */\nexport function resetFrameWarnings(): void {\n warned.clear();\n}\n"],"mappings":";;;AAqCA,IAAMA,oBAAS,IAAI,IAAY;AAW/B,SAASC,EAAS,GAAyB;CACvC,AAAKC,EAAW,KAAK,GAAO,IAAIC,CAAS,MACzCH,EAAO,IAAIG,CAAS,GACpB,QAAQ,KACJ,uBAAuBA,EAAU,oNAGrC;AACJ;AAcA,SAASC,EAAmB,GAAmB,GAA6B;CACxE,IAAMC,IAAM,GAAGF,EAAU;CACzB,IAAI,CAACD,EAAW,KAAKF,EAAO,IAAIK,CAAG,GAAG;CACtC,EAAO,IAAIA,CAAG;CACd,IAAMC,IAAUC,EAAO,KAAK,MAAU,GAAGC,EAAM,KAAK,IAAIA,EAAM,SAAS,CAAC,CAAC,KAAK,IAAI;CAClF,QAAQ,KACJ,uBAAuBL,EAAU,sDACzBG,EAAQ,gFAEpB;AACJ;AA8BA,SAAgBG,EACZ,GACA,GACA,GACe;CACf,IAAM,EAAE,WAAQ,iBAAc,WAAQ,yBAAsBC;CAQ5D,SAASC,EAAK,GAAiC;EAC3C,IAAI,CAACC,GAAQ,OAAO;GAAE,WAAW;GAAM,MAAMC;EAAW;EACxD,IAAMC,IAASC,EAAmBH,GAAQC,CAAK;EAI/C,OAHIC,EAAO,KAAW;GAAE,WAAW;GAAM,MAAMA,EAAO;EAAK,KACvDE,IAAmBA,EAAkBF,EAAO,QAAQG,CAAG,IACtDb,EAAmBD,GAAWW,EAAO,MAAM,GACzC;GAAE,WAAW;GAAO,MAAM,KAAA;EAAe;CACpD;CAEA,IAAII,GAAQ,OAAOP,EAAKO,EAAOD,CAAG,CAAC;CACnC,IAAIE;CACJ,IAAI;EACA,IAAS,KAAK,MAAMF,CAAG;CAC3B,SAASG,GAAO;EAOZ,OANIC,KACAA,EAAaD,GAAOH,CAAG,GAChB;GAAE,WAAW;GAAO,MAAM,KAAA;EAAe,KAEhDL,IAAeD,EAAKM,CAAG,KAC3BhB,EAASE,CAAS,GACX;GAAE,WAAW;GAAM,MAAMc;EAAoB;CACxD;CACA,OAAON,EAAKQ,CAAM;AACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.cjs","names":[],"sources":["../../src/utils/numbers.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { numberFormat } from \"@/utils/intl-cache\";\n/**\n * Clamp `value` between `min` and `max` (inclusive).\n *\n * @example\n * clamp(120, 0, 100); // 100\n * clamp(-5, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (Number.isNaN(value)) return value;\n if (min > max) {\n const swap = min;\n min = max;\n max = swap;\n }\n if (value < min) return min;\n if (value > max) return max;\n return value;\n}\n\n/**\n * Format a byte count as a human-readable size string.\n *\n * Scales through B, KB, MB, GB and TB using 1024 as the base. `decimals`\n * controls the fractional digits for scaled units (default 1); `0` bytes\n * always renders as `\"0 B\"`.\n *\n * An absent or unrepresentable count renders as `\"—\"`. It used to render as\n * **`\"NaN undefined\"`**: `Math.log(NaN)` walks the exponent off the end of the\n * unit table, so the unit itself came out `undefined` — the size was not merely\n * unreadable, it claimed a unit that does not exist.\n *\n * @example\n * formatBytes(0); // \"0 B\"\n * formatBytes(1536); // \"1.5 KB\"\n * formatBytes(1048576); // \"1 MB\"\n * formatBytes(1536, 2); // \"1.50 KB\"\n * formatBytes(null); // \"—\"\n */\nexport function formatBytes(\n bytes: number | null | undefined,\n decimals: number = 1,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(bytes) || !Number.isFinite(bytes)) return fallbackText(options);\n if (bytes === 0) return \"0 B\";\n\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const base = 1024;\n const exponent = Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(base)),\n units.length - 1,\n );\n const value = bytes / base ** exponent;\n const digits = exponent === 0 ? 0 : Math.max(0, decimals);\n const formatted = parseFloat(value.toFixed(digits)).toString();\n\n return `${formatted} ${units[exponent]}`;\n}\n\n/**\n * What percentage of `total` is `part`, with an empty base yielding `0`.\n *\n * The guard is the whole point: `(part / total) * 100` produces `NaN` when the\n * base is zero and `Infinity` when only the base is missing, and both reach the\n * screen as a broken label — `NaN%` on an empty dashboard is the single most\n * common way a panel announces that it has no data yet.\n *\n * Returns a **0–100** number, which is what a bar width and a label want.\n * `formatPercent` takes a 0–1 fraction instead, so pair them as\n * `formatPercent(percentOf(a, b) / 100)` — or skip `percentOf` and pass the\n * fraction straight in.\n *\n * The result is not clamped: 120% of a target is a real number somebody wants to\n * see, and capping it would hide the interesting case.\n *\n * @example\n * percentOf(3, 4); // 75\n * percentOf(5, 0); // 0\n * percentOf(12, 8); // 150\n *\n * @param part - The measured amount.\n * @param total - The base it is measured against.\n * @returns The percentage, or `0` when the base is zero or either input is not finite.\n */\nexport function percentOf(part: number, total: number): number {\n if (!Number.isFinite(part) || !Number.isFinite(total) || total === 0) return 0;\n return (part / total) * 100;\n}\n\n/**\n * Format a number using compact notation (e.g. `1.2K`, `3.4M`).\n *\n * Wraps `Intl.NumberFormat` with `notation: \"compact\"`. The `locale` defaults\n * to `\"en-US\"`.\n *\n * An absent or unrepresentable value renders as `\"—\"`. The `null` case is the\n * one that matters: `Intl` coerces it to zero, so a count the backend left out\n * used to read as **`\"0\"`** — a number the reader has no reason to doubt.\n *\n * @example\n * formatCompactNumber(1234); // \"1.2K\"\n * formatCompactNumber(5600000); // \"5.6M\"\n * formatCompactNumber(1234, \"pt-BR\"); // \"1,2 mil\"\n * formatCompactNumber(null); // \"—\"\n */\nexport function formatCompactNumber(\n value: number | null | undefined,\n locale: string = \"en-US\",\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(locale, { notation: \"compact\", maximumFractionDigits: 1 }).format(value);\n}\n"],"mappings":"8DAUA,SAAgB,EAAM,EAAe,EAAa,EAAqB,CACnE,GAAI,OAAO,MAAM,CAAK,EAAG,OAAO,EAChC,GAAI,EAAM,EAAK,CACX,IAAM,EAAO,EACb,EAAM,EACN,EAAM,CACV,CAGA,OAFI,EAAQ,EAAY,EACpB,EAAQ,EAAY,EACjB,CACX,CAqBA,SAAgB,EACZ,EACA,EAAmB,EACnB,EACM,CACN,GAAI,EAAA,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EAAG,OAAO,EAAA,aAAa,CAAO,EAC3E,GAAI,IAAU,EAAG,MAAO,MAExB,IAAM,EAAQ,CAAC,IAAK,KAAM,KAAM,KAAM,IAAI,EACpC,EAAO,KACP,EAAW,KAAK,IAClB,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,CAAK,CAAC,EAAI,KAAK,IAAI,CAAI,CAAC,EACrD,EAAM,OAAS,CACnB,EACM,EAAQ,EAAQ,GAAQ,EACxB,EAAS,IAAa,EAAI,EAAI,KAAK,IAAI,EAAG,CAAQ,EAGxD,MAAO,GAFW,WAAW,EAAM,QAAQ,CAAM,CAAC,CAAC,CAAC,SAE1C,EAAU,GAAG,EAAM,IACjC,CA2BA,SAAgB,EAAU,EAAc,EAAuB,CAE3D,MADI,CAAC,OAAO,SAAS,CAAI,GAAK,CAAC,OAAO,SAAS,CAAK,GAAK,IAAU,EAAU,EACrE,EAAO,EAAS,GAC5B,CAkBA,SAAgB,EACZ,EACA,EAAiB,QACjB,EACM,CAEN,OADI,EAAA,SAAS,CAAK,GAAK,CAAC,OAAO,SAAS,CAAK,EAAU,EAAA,aAAa,CAAO,EACpE,EAAA,aAAa,EAAQ,CAAE,SAAU,UAAW,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAO,CAAK,CAC/F"}
1
+ {"version":3,"file":"numbers.cjs","names":["isAbsent","fallbackText","numberFormat","require_absent","require_intl_cache","clamp","value","min","max","swap","formatBytes","bytes","options","units","base","exponent","digits","decimals","percentOf","part","total","formatCompactNumber","locale"],"sources":["../../src/utils/numbers.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { numberFormat } from \"@/utils/intl-cache\";\n/**\n * Clamp `value` between `min` and `max` (inclusive).\n *\n * @example\n * clamp(120, 0, 100); // 100\n * clamp(-5, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (Number.isNaN(value)) return value;\n if (min > max) {\n const swap = min;\n min = max;\n max = swap;\n }\n if (value < min) return min;\n if (value > max) return max;\n return value;\n}\n\n/**\n * Format a byte count as a human-readable size string.\n *\n * Scales through B, KB, MB, GB and TB using 1024 as the base. `decimals`\n * controls the fractional digits for scaled units (default 1); `0` bytes\n * always renders as `\"0 B\"`.\n *\n * An absent or unrepresentable count renders as `\"—\"`. It used to render as\n * **`\"NaN undefined\"`**: `Math.log(NaN)` walks the exponent off the end of the\n * unit table, so the unit itself came out `undefined` — the size was not merely\n * unreadable, it claimed a unit that does not exist.\n *\n * @example\n * formatBytes(0); // \"0 B\"\n * formatBytes(1536); // \"1.5 KB\"\n * formatBytes(1048576); // \"1 MB\"\n * formatBytes(1536, 2); // \"1.50 KB\"\n * formatBytes(null); // \"—\"\n */\nexport function formatBytes(\n bytes: number | null | undefined,\n decimals: number = 1,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(bytes) || !Number.isFinite(bytes)) return fallbackText(options);\n if (bytes === 0) return \"0 B\";\n\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const base = 1024;\n const exponent = Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(base)),\n units.length - 1,\n );\n const value = bytes / base ** exponent;\n const digits = exponent === 0 ? 0 : Math.max(0, decimals);\n const formatted = parseFloat(value.toFixed(digits)).toString();\n\n return `${formatted} ${units[exponent]}`;\n}\n\n/**\n * What percentage of `total` is `part`, with an empty base yielding `0`.\n *\n * The guard is the whole point: `(part / total) * 100` produces `NaN` when the\n * base is zero and `Infinity` when only the base is missing, and both reach the\n * screen as a broken label — `NaN%` on an empty dashboard is the single most\n * common way a panel announces that it has no data yet.\n *\n * Returns a **0–100** number, which is what a bar width and a label want.\n * `formatPercent` takes a 0–1 fraction instead, so pair them as\n * `formatPercent(percentOf(a, b) / 100)` — or skip `percentOf` and pass the\n * fraction straight in.\n *\n * The result is not clamped: 120% of a target is a real number somebody wants to\n * see, and capping it would hide the interesting case.\n *\n * @example\n * percentOf(3, 4); // 75\n * percentOf(5, 0); // 0\n * percentOf(12, 8); // 150\n *\n * @param part - The measured amount.\n * @param total - The base it is measured against.\n * @returns The percentage, or `0` when the base is zero or either input is not finite.\n */\nexport function percentOf(part: number, total: number): number {\n if (!Number.isFinite(part) || !Number.isFinite(total) || total === 0) return 0;\n return (part / total) * 100;\n}\n\n/**\n * Format a number using compact notation (e.g. `1.2K`, `3.4M`).\n *\n * Wraps `Intl.NumberFormat` with `notation: \"compact\"`. The `locale` defaults\n * to `\"en-US\"`.\n *\n * An absent or unrepresentable value renders as `\"—\"`. The `null` case is the\n * one that matters: `Intl` coerces it to zero, so a count the backend left out\n * used to read as **`\"0\"`** — a number the reader has no reason to doubt.\n *\n * @example\n * formatCompactNumber(1234); // \"1.2K\"\n * formatCompactNumber(5600000); // \"5.6M\"\n * formatCompactNumber(1234, \"pt-BR\"); // \"1,2 mil\"\n * formatCompactNumber(null); // \"—\"\n */\nexport function formatCompactNumber(\n value: number | null | undefined,\n locale: string = \"en-US\",\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(locale, { notation: \"compact\", maximumFractionDigits: 1 }).format(value);\n}\n"],"mappings":"A,8DAUA,SAAgBK,EAAM,EAAe,EAAa,EAAqB,CACnE,GAAI,OAAO,MAAMC,CAAK,EAAG,OAAOA,EAChC,GAAIC,EAAMC,EAAK,CACX,IAAMC,EAAOF,EACb,EAAMC,EACN,EAAMC,CACV,CAGA,OAFIH,EAAQC,EAAYA,EACpBD,EAAQE,EAAYA,EACjBF,CACX,CAqBA,SAAgBI,EACZ,EACA,EAAmB,EACnB,EACM,CACN,GAAIV,EAAAA,SAASW,CAAK,GAAK,CAAC,OAAO,SAASA,CAAK,EAAG,OAAOV,EAAAA,aAAaW,CAAO,EAC3E,GAAID,IAAU,EAAG,MAAO,MAExB,IAAME,EAAQ,CAAC,IAAK,KAAM,KAAM,KAAM,IAAI,EACpCC,EAAO,KACPC,EAAW,KAAK,IAClB,KAAK,MAAM,KAAK,IAAI,KAAK,IAAIJ,CAAK,CAAC,EAAI,KAAK,IAAIG,CAAI,CAAC,EACrDD,EAAM,OAAS,CACnB,EACMP,EAAQK,EAAQG,GAAQC,EACxBC,EAASD,IAAa,EAAI,EAAI,KAAK,IAAI,EAAGE,CAAQ,EAGxD,MAAO,GAFW,WAAWX,EAAM,QAAQU,CAAM,CAAC,CAAC,CAAC,SAE1C,EAAU,GAAGH,EAAME,IACjC,CA2BA,SAAgBG,EAAU,EAAc,EAAuB,CAE3D,MADI,CAAC,OAAO,SAASC,CAAI,GAAK,CAAC,OAAO,SAASC,CAAK,GAAKA,IAAU,EAAU,EACrED,EAAOC,EAAS,GAC5B,CAkBA,SAAgBC,EACZ,EACA,EAAiB,QACjB,EACM,CAEN,OADIrB,EAAAA,SAASM,CAAK,GAAK,CAAC,OAAO,SAASA,CAAK,EAAUL,EAAAA,aAAaW,CAAO,EACpEV,EAAAA,aAAaoB,EAAQ,CAAE,SAAU,UAAW,sBAAuB,CAAE,CAAC,CAAC,CAAC,OAAOhB,CAAK,CAC/F,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.js","names":[],"sources":["../../src/utils/numbers.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { numberFormat } from \"@/utils/intl-cache\";\n/**\n * Clamp `value` between `min` and `max` (inclusive).\n *\n * @example\n * clamp(120, 0, 100); // 100\n * clamp(-5, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (Number.isNaN(value)) return value;\n if (min > max) {\n const swap = min;\n min = max;\n max = swap;\n }\n if (value < min) return min;\n if (value > max) return max;\n return value;\n}\n\n/**\n * Format a byte count as a human-readable size string.\n *\n * Scales through B, KB, MB, GB and TB using 1024 as the base. `decimals`\n * controls the fractional digits for scaled units (default 1); `0` bytes\n * always renders as `\"0 B\"`.\n *\n * An absent or unrepresentable count renders as `\"—\"`. It used to render as\n * **`\"NaN undefined\"`**: `Math.log(NaN)` walks the exponent off the end of the\n * unit table, so the unit itself came out `undefined` — the size was not merely\n * unreadable, it claimed a unit that does not exist.\n *\n * @example\n * formatBytes(0); // \"0 B\"\n * formatBytes(1536); // \"1.5 KB\"\n * formatBytes(1048576); // \"1 MB\"\n * formatBytes(1536, 2); // \"1.50 KB\"\n * formatBytes(null); // \"—\"\n */\nexport function formatBytes(\n bytes: number | null | undefined,\n decimals: number = 1,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(bytes) || !Number.isFinite(bytes)) return fallbackText(options);\n if (bytes === 0) return \"0 B\";\n\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const base = 1024;\n const exponent = Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(base)),\n units.length - 1,\n );\n const value = bytes / base ** exponent;\n const digits = exponent === 0 ? 0 : Math.max(0, decimals);\n const formatted = parseFloat(value.toFixed(digits)).toString();\n\n return `${formatted} ${units[exponent]}`;\n}\n\n/**\n * What percentage of `total` is `part`, with an empty base yielding `0`.\n *\n * The guard is the whole point: `(part / total) * 100` produces `NaN` when the\n * base is zero and `Infinity` when only the base is missing, and both reach the\n * screen as a broken label — `NaN%` on an empty dashboard is the single most\n * common way a panel announces that it has no data yet.\n *\n * Returns a **0–100** number, which is what a bar width and a label want.\n * `formatPercent` takes a 0–1 fraction instead, so pair them as\n * `formatPercent(percentOf(a, b) / 100)` — or skip `percentOf` and pass the\n * fraction straight in.\n *\n * The result is not clamped: 120% of a target is a real number somebody wants to\n * see, and capping it would hide the interesting case.\n *\n * @example\n * percentOf(3, 4); // 75\n * percentOf(5, 0); // 0\n * percentOf(12, 8); // 150\n *\n * @param part - The measured amount.\n * @param total - The base it is measured against.\n * @returns The percentage, or `0` when the base is zero or either input is not finite.\n */\nexport function percentOf(part: number, total: number): number {\n if (!Number.isFinite(part) || !Number.isFinite(total) || total === 0) return 0;\n return (part / total) * 100;\n}\n\n/**\n * Format a number using compact notation (e.g. `1.2K`, `3.4M`).\n *\n * Wraps `Intl.NumberFormat` with `notation: \"compact\"`. The `locale` defaults\n * to `\"en-US\"`.\n *\n * An absent or unrepresentable value renders as `\"—\"`. The `null` case is the\n * one that matters: `Intl` coerces it to zero, so a count the backend left out\n * used to read as **`\"0\"`** — a number the reader has no reason to doubt.\n *\n * @example\n * formatCompactNumber(1234); // \"1.2K\"\n * formatCompactNumber(5600000); // \"5.6M\"\n * formatCompactNumber(1234, \"pt-BR\"); // \"1,2 mil\"\n * formatCompactNumber(null); // \"—\"\n */\nexport function formatCompactNumber(\n value: number | null | undefined,\n locale: string = \"en-US\",\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(locale, { notation: \"compact\", maximumFractionDigits: 1 }).format(value);\n}\n"],"mappings":";;;AAUA,SAAgB,EAAM,GAAe,GAAa,GAAqB;CACnE,IAAI,OAAO,MAAM,CAAK,GAAG,OAAO;CAChC,IAAI,IAAM,GAAK;EACX,IAAM,IAAO;EAEb,AADA,IAAM,GACN,IAAM;CACV;CAGA,OAFI,IAAQ,IAAY,IACpB,IAAQ,IAAY,IACjB;AACX;AAqBA,SAAgB,EACZ,GACA,IAAmB,GACnB,GACM;CACN,IAAI,EAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAK,GAAG,OAAO,EAAa,CAAO;CAC3E,IAAI,MAAU,GAAG,OAAO;CAExB,IAAM,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;CAAI,GACpC,IAAO,MACP,IAAW,KAAK,IAClB,KAAK,MAAM,KAAK,IAAI,KAAK,IAAI,CAAK,CAAC,IAAI,KAAK,IAAI,CAAI,CAAC,GACrD,EAAM,SAAS,CACnB,GACM,IAAQ,IAAQ,KAAQ,GACxB,IAAS,MAAa,IAAI,IAAI,KAAK,IAAI,GAAG,CAAQ;CAGxD,OAAO,GAFW,WAAW,EAAM,QAAQ,CAAM,CAAC,CAAC,CAAC,SAE1C,EAAU,GAAG,EAAM;AACjC;AA2BA,SAAgB,EAAU,GAAc,GAAuB;CAE3D,OADI,CAAC,OAAO,SAAS,CAAI,KAAK,CAAC,OAAO,SAAS,CAAK,KAAK,MAAU,IAAU,IACrE,IAAO,IAAS;AAC5B;AAkBA,SAAgB,EACZ,GACA,IAAiB,SACjB,GACM;CAEN,OADI,EAAS,CAAK,KAAK,CAAC,OAAO,SAAS,CAAK,IAAU,EAAa,CAAO,IACpE,EAAa,GAAQ;EAAE,UAAU;EAAW,uBAAuB;CAAE,CAAC,CAAC,CAAC,OAAO,CAAK;AAC/F"}
1
+ {"version":3,"file":"numbers.js","names":["clamp","value","min","max","swap","formatBytes","isAbsent","bytes","fallbackText","options","units","base","exponent","digits","decimals","percentOf","part","total","formatCompactNumber","numberFormat","locale"],"sources":["../../src/utils/numbers.ts"],"sourcesContent":["import { fallbackText, isAbsent, type FormatFallbackOptions } from \"@/utils/absent\";\nimport { numberFormat } from \"@/utils/intl-cache\";\n/**\n * Clamp `value` between `min` and `max` (inclusive).\n *\n * @example\n * clamp(120, 0, 100); // 100\n * clamp(-5, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (Number.isNaN(value)) return value;\n if (min > max) {\n const swap = min;\n min = max;\n max = swap;\n }\n if (value < min) return min;\n if (value > max) return max;\n return value;\n}\n\n/**\n * Format a byte count as a human-readable size string.\n *\n * Scales through B, KB, MB, GB and TB using 1024 as the base. `decimals`\n * controls the fractional digits for scaled units (default 1); `0` bytes\n * always renders as `\"0 B\"`.\n *\n * An absent or unrepresentable count renders as `\"—\"`. It used to render as\n * **`\"NaN undefined\"`**: `Math.log(NaN)` walks the exponent off the end of the\n * unit table, so the unit itself came out `undefined` — the size was not merely\n * unreadable, it claimed a unit that does not exist.\n *\n * @example\n * formatBytes(0); // \"0 B\"\n * formatBytes(1536); // \"1.5 KB\"\n * formatBytes(1048576); // \"1 MB\"\n * formatBytes(1536, 2); // \"1.50 KB\"\n * formatBytes(null); // \"—\"\n */\nexport function formatBytes(\n bytes: number | null | undefined,\n decimals: number = 1,\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(bytes) || !Number.isFinite(bytes)) return fallbackText(options);\n if (bytes === 0) return \"0 B\";\n\n const units = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n const base = 1024;\n const exponent = Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(base)),\n units.length - 1,\n );\n const value = bytes / base ** exponent;\n const digits = exponent === 0 ? 0 : Math.max(0, decimals);\n const formatted = parseFloat(value.toFixed(digits)).toString();\n\n return `${formatted} ${units[exponent]}`;\n}\n\n/**\n * What percentage of `total` is `part`, with an empty base yielding `0`.\n *\n * The guard is the whole point: `(part / total) * 100` produces `NaN` when the\n * base is zero and `Infinity` when only the base is missing, and both reach the\n * screen as a broken label — `NaN%` on an empty dashboard is the single most\n * common way a panel announces that it has no data yet.\n *\n * Returns a **0–100** number, which is what a bar width and a label want.\n * `formatPercent` takes a 0–1 fraction instead, so pair them as\n * `formatPercent(percentOf(a, b) / 100)` — or skip `percentOf` and pass the\n * fraction straight in.\n *\n * The result is not clamped: 120% of a target is a real number somebody wants to\n * see, and capping it would hide the interesting case.\n *\n * @example\n * percentOf(3, 4); // 75\n * percentOf(5, 0); // 0\n * percentOf(12, 8); // 150\n *\n * @param part - The measured amount.\n * @param total - The base it is measured against.\n * @returns The percentage, or `0` when the base is zero or either input is not finite.\n */\nexport function percentOf(part: number, total: number): number {\n if (!Number.isFinite(part) || !Number.isFinite(total) || total === 0) return 0;\n return (part / total) * 100;\n}\n\n/**\n * Format a number using compact notation (e.g. `1.2K`, `3.4M`).\n *\n * Wraps `Intl.NumberFormat` with `notation: \"compact\"`. The `locale` defaults\n * to `\"en-US\"`.\n *\n * An absent or unrepresentable value renders as `\"—\"`. The `null` case is the\n * one that matters: `Intl` coerces it to zero, so a count the backend left out\n * used to read as **`\"0\"`** — a number the reader has no reason to doubt.\n *\n * @example\n * formatCompactNumber(1234); // \"1.2K\"\n * formatCompactNumber(5600000); // \"5.6M\"\n * formatCompactNumber(1234, \"pt-BR\"); // \"1,2 mil\"\n * formatCompactNumber(null); // \"—\"\n */\nexport function formatCompactNumber(\n value: number | null | undefined,\n locale: string = \"en-US\",\n options?: FormatFallbackOptions,\n): string {\n if (isAbsent(value) || !Number.isFinite(value)) return fallbackText(options);\n return numberFormat(locale, { notation: \"compact\", maximumFractionDigits: 1 }).format(value);\n}\n"],"mappings":";;;AAUA,SAAgBA,EAAM,GAAe,GAAa,GAAqB;CACnE,IAAI,OAAO,MAAMC,CAAK,GAAG,OAAOA;CAChC,IAAIC,IAAMC,GAAK;EACX,IAAMC,IAAOF;EAEb,AADA,IAAMC,GACN,IAAMC;CACV;CAGA,OAFIH,IAAQC,IAAYA,IACpBD,IAAQE,IAAYA,IACjBF;AACX;AAqBA,SAAgBI,EACZ,GACA,IAAmB,GACnB,GACM;CACN,IAAIC,EAASC,CAAK,KAAK,CAAC,OAAO,SAASA,CAAK,GAAG,OAAOC,EAAaC,CAAO;CAC3E,IAAIF,MAAU,GAAG,OAAO;CAExB,IAAMG,IAAQ;EAAC;EAAK;EAAM;EAAM;EAAM;CAAI,GACpCC,IAAO,MACPC,IAAW,KAAK,IAClB,KAAK,MAAM,KAAK,IAAI,KAAK,IAAIL,CAAK,CAAC,IAAI,KAAK,IAAII,CAAI,CAAC,GACrDD,EAAM,SAAS,CACnB,GACMT,IAAQM,IAAQI,KAAQC,GACxBC,IAASD,MAAa,IAAI,IAAI,KAAK,IAAI,GAAGE,CAAQ;CAGxD,OAAO,GAFW,WAAWb,EAAM,QAAQY,CAAM,CAAC,CAAC,CAAC,SAE1C,EAAU,GAAGH,EAAME;AACjC;AA2BA,SAAgBG,EAAU,GAAc,GAAuB;CAE3D,OADI,CAAC,OAAO,SAASC,CAAI,KAAK,CAAC,OAAO,SAASC,CAAK,KAAKA,MAAU,IAAU,IACrED,IAAOC,IAAS;AAC5B;AAkBA,SAAgBC,EACZ,GACA,IAAiB,SACjB,GACM;CAEN,OADIZ,EAASL,CAAK,KAAK,CAAC,OAAO,SAASA,CAAK,IAAUO,EAAaC,CAAO,IACpEU,EAAaC,GAAQ;EAAE,UAAU;EAAW,uBAAuB;CAAE,CAAC,CAAC,CAAC,OAAOnB,CAAK;AAC/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"objects.cjs","names":[],"sources":["../../src/utils/objects.ts"],"sourcesContent":["/**\n * Determine whether a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances.\n *\n * @internal\n */\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Create a new object containing only the given `keys` from `obj`.\n *\n * Missing keys are skipped. The input is never mutated.\n *\n * @example\n * pick({ id: 1, name: \"Ana\", age: 30 }, [\"id\", \"name\"]);\n * // { id: 1, name: \"Ana\" }\n */\nexport function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n\n/**\n * Create a new object with the given `keys` removed from `obj`.\n *\n * The input is never mutated.\n *\n * @example\n * omit({ id: 1, name: \"Ana\", age: 30 }, [\"age\"]);\n * // { id: 1, name: \"Ana\" }\n */\nexport function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const exclude = new Set<PropertyKey>(keys);\n const result = {} as Record<PropertyKey, unknown>;\n for (const key of Object.keys(obj) as (keyof T)[]) {\n if (!exclude.has(key)) {\n result[key] = obj[key];\n }\n }\n return result as Omit<T, K>;\n}\n\n/**\n * Recursively merge `source` into `target`, returning a new object.\n *\n * - Plain objects are merged key by key, recursing into nested plain objects.\n * - Arrays and non-plain values (dates, class instances, primitives) replace\n * the target value entirely — they are not merged element by element.\n * - Neither `target` nor `source` is mutated.\n *\n * @example\n * deepMerge(\n * { a: 1, nested: { x: 1, y: 2 } },\n * { nested: { y: 20, z: 30 } },\n * );\n * // { a: 1, nested: { x: 1, y: 20, z: 30 } }\n *\n * @example\n * deepMerge({ tags: [\"a\", \"b\"] }, { tags: [\"c\"] });\n * // { tags: [\"c\"] } (arrays replaced, not merged)\n */\nexport function deepMerge<T>(target: T, source: Partial<T>): T {\n if (!isPlainRecord(target) || !isPlainRecord(source)) {\n return (source === undefined ? target : (source as unknown as T)) as T;\n }\n const result: Record<string, unknown> = { ...target };\n for (const key of Object.keys(source)) {\n const sourceValue = (source as Record<string, unknown>)[key];\n const targetValue = result[key];\n if (isPlainRecord(targetValue) && isPlainRecord(sourceValue)) {\n result[key] = deepMerge(targetValue, sourceValue);\n } else {\n result[key] = sourceValue;\n }\n }\n return result as T;\n}\n\n/**\n * Check whether a value is considered \"empty\".\n *\n * Returns `true` for `null`, `undefined`, empty strings, empty arrays, empty\n * plain objects, and empty `Map`/`Set` instances. Returns `false` for numbers\n * (including `0` and `NaN`), booleans, and dates, which are never empty.\n *\n * @example\n * isEmpty(null); // true\n * isEmpty(\"\"); // true\n * isEmpty([]); // true\n * isEmpty({}); // true\n * isEmpty(new Map()); // true\n * isEmpty(0); // false\n * isEmpty(false); // false\n * isEmpty(new Date()); // false\n */\nexport function isEmpty(value: unknown): boolean {\n if (value === null || value === undefined) return true;\n if (typeof value === \"string\") return value.length === 0;\n if (Array.isArray(value)) return value.length === 0;\n if (value instanceof Map || value instanceof Set) return value.size === 0;\n if (isPlainRecord(value)) return Object.keys(value).length === 0;\n return false;\n}\n"],"mappings":"AAOA,SAAS,EAAc,EAAkD,CACrE,GAAI,OAAO,GAAU,WAAY,EAAgB,MAAO,GACxD,IAAM,EAAQ,OAAO,eAAe,CAAK,EACzC,OAAO,IAAU,OAAO,WAAa,IAAU,IACnD,CAWA,SAAgB,EAA0C,EAAQ,EAAuB,CACrF,IAAM,EAAS,CAAC,EAChB,IAAK,IAAM,KAAO,EACV,OAAO,UAAU,eAAe,KAAK,EAAK,CAAG,IAC7C,EAAO,GAAO,EAAI,IAG1B,OAAO,CACX,CAWA,SAAgB,EAA0C,EAAQ,EAAuB,CACrF,IAAM,EAAU,IAAI,IAAiB,CAAI,EACnC,EAAS,CAAC,EAChB,IAAK,IAAM,KAAO,OAAO,KAAK,CAAG,EACxB,EAAQ,IAAI,CAAG,IAChB,EAAO,GAAO,EAAI,IAG1B,OAAO,CACX,CAqBA,SAAgB,EAAa,EAAW,EAAuB,CAC3D,GAAI,CAAC,EAAc,CAAM,GAAK,CAAC,EAAc,CAAM,EAC/C,OAAQ,IAAW,IAAA,GAAY,EAAU,EAE7C,IAAM,EAAkC,CAAE,GAAG,CAAO,EACpD,IAAK,IAAM,KAAO,OAAO,KAAK,CAAM,EAAG,CACnC,IAAM,EAAe,EAAmC,GAClD,EAAc,EAAO,GAC3B,AAGI,EAAO,GAHP,EAAc,CAAW,GAAK,EAAc,CAAW,EACzC,EAAU,EAAa,CAAW,EAElC,CAEtB,CACA,OAAO,CACX,CAmBA,SAAgB,EAAQ,EAAyB,CAM7C,OALI,GAAU,KAAoC,GAC9C,OAAO,GAAU,UACjB,MAAM,QAAQ,CAAK,EAAU,EAAM,SAAW,EAC9C,aAAiB,KAAO,aAAiB,IAAY,EAAM,OAAS,EACpE,EAAc,CAAK,EAAU,OAAO,KAAK,CAAK,CAAC,CAAC,SAAW,EACxD,EACX"}
1
+ {"version":3,"file":"objects.cjs","names":["isPlainRecord","value","proto","pick","result","key","keys","obj","omit","exclude","deepMerge","target","source","sourceValue","targetValue","isEmpty"],"sources":["../../src/utils/objects.ts"],"sourcesContent":["/**\n * Determine whether a value is a plain object literal.\n *\n * Returns `false` for arrays, `null`, dates, maps, sets, and class instances.\n *\n * @internal\n */\nfunction isPlainRecord(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) return false;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n}\n\n/**\n * Create a new object containing only the given `keys` from `obj`.\n *\n * Missing keys are skipped. The input is never mutated.\n *\n * @example\n * pick({ id: 1, name: \"Ana\", age: 30 }, [\"id\", \"name\"]);\n * // { id: 1, name: \"Ana\" }\n */\nexport function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\n const result = {} as Pick<T, K>;\n for (const key of keys) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n\n/**\n * Create a new object with the given `keys` removed from `obj`.\n *\n * The input is never mutated.\n *\n * @example\n * omit({ id: 1, name: \"Ana\", age: 30 }, [\"age\"]);\n * // { id: 1, name: \"Ana\" }\n */\nexport function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\n const exclude = new Set<PropertyKey>(keys);\n const result = {} as Record<PropertyKey, unknown>;\n for (const key of Object.keys(obj) as (keyof T)[]) {\n if (!exclude.has(key)) {\n result[key] = obj[key];\n }\n }\n return result as Omit<T, K>;\n}\n\n/**\n * Recursively merge `source` into `target`, returning a new object.\n *\n * - Plain objects are merged key by key, recursing into nested plain objects.\n * - Arrays and non-plain values (dates, class instances, primitives) replace\n * the target value entirely — they are not merged element by element.\n * - Neither `target` nor `source` is mutated.\n *\n * @example\n * deepMerge(\n * { a: 1, nested: { x: 1, y: 2 } },\n * { nested: { y: 20, z: 30 } },\n * );\n * // { a: 1, nested: { x: 1, y: 20, z: 30 } }\n *\n * @example\n * deepMerge({ tags: [\"a\", \"b\"] }, { tags: [\"c\"] });\n * // { tags: [\"c\"] } (arrays replaced, not merged)\n */\nexport function deepMerge<T>(target: T, source: Partial<T>): T {\n if (!isPlainRecord(target) || !isPlainRecord(source)) {\n return (source === undefined ? target : (source as unknown as T)) as T;\n }\n const result: Record<string, unknown> = { ...target };\n for (const key of Object.keys(source)) {\n const sourceValue = (source as Record<string, unknown>)[key];\n const targetValue = result[key];\n if (isPlainRecord(targetValue) && isPlainRecord(sourceValue)) {\n result[key] = deepMerge(targetValue, sourceValue);\n } else {\n result[key] = sourceValue;\n }\n }\n return result as T;\n}\n\n/**\n * Check whether a value is considered \"empty\".\n *\n * Returns `true` for `null`, `undefined`, empty strings, empty arrays, empty\n * plain objects, and empty `Map`/`Set` instances. Returns `false` for numbers\n * (including `0` and `NaN`), booleans, and dates, which are never empty.\n *\n * @example\n * isEmpty(null); // true\n * isEmpty(\"\"); // true\n * isEmpty([]); // true\n * isEmpty({}); // true\n * isEmpty(new Map()); // true\n * isEmpty(0); // false\n * isEmpty(false); // false\n * isEmpty(new Date()); // false\n */\nexport function isEmpty(value: unknown): boolean {\n if (value === null || value === undefined) return true;\n if (typeof value === \"string\") return value.length === 0;\n if (Array.isArray(value)) return value.length === 0;\n if (value instanceof Map || value instanceof Set) return value.size === 0;\n if (isPlainRecord(value)) return Object.keys(value).length === 0;\n return false;\n}\n"],"mappings":"AAOA,SAASA,EAAc,EAAkD,CACrE,GAAI,OAAOC,GAAU,WAAYA,EAAgB,MAAO,GACxD,IAAMC,EAAQ,OAAO,eAAeD,CAAK,EACzC,OAAOC,IAAU,OAAO,WAAaA,IAAU,IACnD,CAWA,SAAgBC,EAA0C,EAAQ,EAAuB,CACrF,IAAMC,EAAS,CAAC,EAChB,IAAK,IAAMC,KAAOC,EACV,OAAO,UAAU,eAAe,KAAKC,EAAKF,CAAG,IAC7C,EAAOA,GAAOE,EAAIF,IAG1B,OAAOD,CACX,CAWA,SAAgBI,EAA0C,EAAQ,EAAuB,CACrF,IAAMC,EAAU,IAAI,IAAiBH,CAAI,EACnCF,EAAS,CAAC,EAChB,IAAK,IAAMC,KAAO,OAAO,KAAKE,CAAG,EACxBE,EAAQ,IAAIJ,CAAG,IAChB,EAAOA,GAAOE,EAAIF,IAG1B,OAAOD,CACX,CAqBA,SAAgBM,EAAa,EAAW,EAAuB,CAC3D,GAAI,CAACV,EAAcW,CAAM,GAAK,CAACX,EAAcY,CAAM,EAC/C,OAAQA,IAAW,IAAA,GAAYD,EAAUC,EAE7C,IAAMR,EAAkC,CAAE,GAAGO,CAAO,EACpD,IAAK,IAAMN,KAAO,OAAO,KAAKO,CAAM,EAAG,CACnC,IAAMC,EAAeD,EAAmCP,GAClDS,EAAcV,EAAOC,GAC3B,AAGID,EAAOC,GAHPL,EAAcc,CAAW,GAAKd,EAAca,CAAW,EACzCH,EAAUI,EAAaD,CAAW,EAElCA,CAEtB,CACA,OAAOT,CACX,CAmBA,SAAgBW,EAAQ,EAAyB,CAM7C,OALId,GAAU,KAAoC,GAC9C,OAAOA,GAAU,UACjB,MAAM,QAAQA,CAAK,EAAUA,EAAM,SAAW,EAC9CA,aAAiB,KAAOA,aAAiB,IAAYA,EAAM,OAAS,EACpED,EAAcC,CAAK,EAAU,OAAO,KAAKA,CAAK,CAAC,CAAC,SAAW,EACxD,EACX,C"}