resuxjs 0.3.11 → 0.4.0-beta.2

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 (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3671
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +3 -0
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +3 -0
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +3 -0
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +7 -4
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +6 -3
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +11 -8
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +20 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +24 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
@@ -1,23 +1,24 @@
1
+ //#region src/i18n/shared.d.ts
1
2
  export type ResuxI18nStrategy = "prefix_except_default" | "prefix" | "no_prefix";
2
3
  export interface ResuxI18nLocale {
3
- code: string;
4
- name?: string;
5
- dir?: "ltr" | "rtl";
4
+ code: string;
5
+ name?: string;
6
+ dir?: "ltr" | "rtl";
6
7
  }
7
8
  export interface ResuxI18nRuntimeConfig {
8
- defaultLocale: string;
9
- fallbackLocale: string;
10
- strategy: ResuxI18nStrategy;
11
- locales: ResuxI18nLocale[];
12
- messages: Record<string, Record<string, unknown>>;
9
+ defaultLocale: string;
10
+ fallbackLocale: string;
11
+ strategy: ResuxI18nStrategy;
12
+ locales: ResuxI18nLocale[];
13
+ messages: Record<string, Record<string, unknown>>;
13
14
  }
14
15
  export interface ResuxI18nResolvedRoute {
15
- locale: ResuxI18nLocale;
16
- basePath: string;
17
- localizedPath: string;
16
+ locale: ResuxI18nLocale;
17
+ basePath: string;
18
+ localizedPath: string;
18
19
  }
19
20
  export interface ResuxI18nTranslationParams {
20
- [key: string]: string | number | boolean | null | undefined;
21
+ [key: string]: string | number | boolean | null | undefined;
21
22
  }
22
23
  export declare function normalizeI18nStrategy(value: unknown): ResuxI18nStrategy;
23
24
  export declare function normalizeI18nRuntimeConfig(value: unknown): ResuxI18nRuntimeConfig | null;
@@ -28,8 +29,10 @@ export declare function resolveLocalizedValue(value: unknown, localeCode: string
28
29
  export declare function translateRaw(config: ResuxI18nRuntimeConfig, localeCode: string, key: string): unknown;
29
30
  export declare function translateText(config: ResuxI18nRuntimeConfig, localeCode: string, key: string, params?: ResuxI18nTranslationParams): string;
30
31
  export declare function createI18nHead(routePath: string, routeOrigin: string | undefined, config: ResuxI18nRuntimeConfig, options?: {
31
- includeHreflang?: boolean;
32
+ includeHreflang?: boolean;
32
33
  }): {
33
- htmlAttrs: Record<string, string>;
34
- link: Array<Record<string, string>>;
34
+ htmlAttrs: Record<string, string>;
35
+ link: Array<Record<string, string>>;
35
36
  };
37
+ //#endregion
38
+ //# sourceMappingURL=shared.d.ts.map
@@ -1,284 +1,222 @@
1
+ //#region src/i18n/shared.ts
1
2
  function isRecord(value) {
2
- return Boolean(value && typeof value === "object" && !Array.isArray(value));
3
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
3
4
  }
4
5
  function normalizeLocaleCode(value) {
5
- if (typeof value !== "string") {
6
- return null;
7
- }
8
- const normalized = value.trim().toLowerCase();
9
- if (!/^[a-z0-9-]+$/.test(normalized)) {
10
- return null;
11
- }
12
- return normalized;
6
+ if (typeof value !== "string") return null;
7
+ const normalized = value.trim().toLowerCase();
8
+ if (!/^[a-z0-9-]+$/.test(normalized)) return null;
9
+ return normalized;
13
10
  }
14
11
  function normalizePathname(pathname) {
15
- const source = String(pathname || "").trim();
16
- if (!source) {
17
- return "/";
18
- }
19
- const withSlash = source.startsWith("/") ? source : `/${source}`;
20
- if (withSlash !== "/" && withSlash.endsWith("/")) {
21
- return withSlash.replace(/\/+$/g, "");
22
- }
23
- return withSlash;
12
+ const source = String(pathname || "").trim();
13
+ if (!source) return "/";
14
+ const withSlash = source.startsWith("/") ? source : `/${source}`;
15
+ if (withSlash !== "/" && withSlash.endsWith("/")) return withSlash.replace(/\/+$/g, "");
16
+ return withSlash;
24
17
  }
25
18
  function splitPathSuffix(input) {
26
- const source = String(input || "");
27
- const hashIndex = source.indexOf("#");
28
- const queryIndex = source.indexOf("?");
29
- const splitIndex = [hashIndex, queryIndex]
30
- .filter((index) => index >= 0)
31
- .sort((left, right) => left - right)[0];
32
- if (splitIndex === undefined) {
33
- return { pathname: source, suffix: "" };
34
- }
35
- return {
36
- pathname: source.slice(0, splitIndex),
37
- suffix: source.slice(splitIndex)
38
- };
19
+ const source = String(input || "");
20
+ const splitIndex = [source.indexOf("#"), source.indexOf("?")].filter((index) => index >= 0).sort((left, right) => left - right)[0];
21
+ if (splitIndex === void 0) return {
22
+ pathname: source,
23
+ suffix: ""
24
+ };
25
+ return {
26
+ pathname: source.slice(0, splitIndex),
27
+ suffix: source.slice(splitIndex)
28
+ };
39
29
  }
40
30
  function joinLocalePath(localeCode, basePath) {
41
- const normalizedBase = normalizePathname(basePath);
42
- return normalizedBase === "/" ? `/${localeCode}` : `/${localeCode}${normalizedBase}`;
31
+ const normalizedBase = normalizePathname(basePath);
32
+ return normalizedBase === "/" ? `/${localeCode}` : `/${localeCode}${normalizedBase}`;
43
33
  }
44
34
  function isLocalePrefixedForStrategy(strategy, localeCode, defaultLocale) {
45
- if (strategy === "prefix") {
46
- return true;
47
- }
48
- if (strategy === "prefix_except_default") {
49
- return localeCode !== defaultLocale;
50
- }
51
- return false;
35
+ if (strategy === "prefix") return true;
36
+ if (strategy === "prefix_except_default") return localeCode !== defaultLocale;
37
+ return false;
52
38
  }
53
39
  function resolveLocaleByCode(locales, code) {
54
- return locales.find((locale) => locale.code === code) ?? null;
40
+ return locales.find((locale) => locale.code === code) ?? null;
55
41
  }
56
- const FORBIDDEN_MESSAGE_KEYS = new Set(["__proto__", "prototype", "constructor"]);
42
+ const FORBIDDEN_MESSAGE_KEYS = /* @__PURE__ */ new Set([
43
+ "__proto__",
44
+ "prototype",
45
+ "constructor"
46
+ ]);
57
47
  function readNestedValue(source, key) {
58
- if (!key) {
59
- return source;
60
- }
61
- const parts = key.split(".");
62
- let cursor = source;
63
- for (const part of parts) {
64
- if (FORBIDDEN_MESSAGE_KEYS.has(part)
65
- || !isRecord(cursor)
66
- || !Object.hasOwn(cursor, part)) {
67
- return undefined;
68
- }
69
- cursor = cursor[part];
70
- }
71
- return cursor;
48
+ if (!key) return source;
49
+ const parts = key.split(".");
50
+ let cursor = source;
51
+ for (const part of parts) {
52
+ if (FORBIDDEN_MESSAGE_KEYS.has(part) || !isRecord(cursor) || !Object.hasOwn(cursor, part)) return;
53
+ cursor = cursor[part];
54
+ }
55
+ return cursor;
72
56
  }
73
57
  function interpolateMessage(template, params) {
74
- return template.replace(/\{([A-Za-z0-9_]+)\}/g, (match, key) => {
75
- const value = params[key];
76
- if (value === undefined || value === null) {
77
- return match;
78
- }
79
- return String(value);
80
- });
81
- }
82
- export function normalizeI18nStrategy(value) {
83
- if (value === "prefix" || value === "no_prefix" || value === "prefix_except_default") {
84
- return value;
85
- }
86
- return "prefix_except_default";
87
- }
88
- export function normalizeI18nRuntimeConfig(value) {
89
- if (!isRecord(value)) {
90
- return null;
91
- }
92
- const localeEntries = Array.isArray(value.locales) ? value.locales : [];
93
- const locales = [];
94
- for (const entry of localeEntries) {
95
- if (!isRecord(entry)) {
96
- continue;
97
- }
98
- const code = normalizeLocaleCode(entry.code);
99
- if (!code) {
100
- continue;
101
- }
102
- locales.push({
103
- code,
104
- ...(typeof entry.name === "string" ? { name: entry.name } : {}),
105
- dir: entry.dir === "rtl" ? "rtl" : "ltr"
106
- });
107
- }
108
- if (!locales.length) {
109
- return null;
110
- }
111
- const uniqueLocales = [];
112
- const localeCodes = new Set();
113
- for (const locale of locales) {
114
- if (localeCodes.has(locale.code)) {
115
- continue;
116
- }
117
- localeCodes.add(locale.code);
118
- uniqueLocales.push(locale);
119
- }
120
- const firstLocale = uniqueLocales[0];
121
- const defaultLocale = normalizeLocaleCode(value.defaultLocale) ?? firstLocale.code;
122
- const fallbackLocale = normalizeLocaleCode(value.fallbackLocale) ?? defaultLocale;
123
- const strategy = normalizeI18nStrategy(value.strategy);
124
- const messagesInput = isRecord(value.messages) ? value.messages : {};
125
- const messages = {};
126
- for (const locale of uniqueLocales) {
127
- const entry = messagesInput[locale.code];
128
- messages[locale.code] = isRecord(entry) ? entry : {};
129
- }
130
- const normalizedDefault = resolveLocaleByCode(uniqueLocales, defaultLocale)?.code ?? firstLocale.code;
131
- const normalizedFallback = resolveLocaleByCode(uniqueLocales, fallbackLocale)?.code ?? normalizedDefault;
132
- return {
133
- defaultLocale: normalizedDefault,
134
- fallbackLocale: normalizedFallback,
135
- strategy,
136
- locales: uniqueLocales,
137
- messages
138
- };
139
- }
140
- export function resolveI18nRoute(pathname, config) {
141
- // Route identity is pathname-only. Query strings and hashes belong to
142
- // navigation state and must not be mistaken for a route segment or leak into
143
- // canonical/hreflang URLs.
144
- const { pathname: rawPathname } = splitPathSuffix(pathname);
145
- const normalizedPath = normalizePathname(rawPathname);
146
- const segments = normalizedPath === "/" ? [] : normalizedPath.slice(1).split("/");
147
- const first = segments[0];
148
- const candidate = first ? resolveLocaleByCode(config.locales, first) : null;
149
- // For prefixed strategies, always consume a recognized locale segment. In
150
- // prefix_except_default the default-locale prefix is non-canonical, but it
151
- // still needs to be stripped so locale switching never produces paths such
152
- // as /fr/en/about.
153
- if (candidate && config.strategy !== "no_prefix") {
154
- const remainder = segments.slice(1);
155
- const basePath = remainder.length ? `/${remainder.join("/")}` : "/";
156
- const localizedPath = isLocalePrefixedForStrategy(config.strategy, candidate.code, config.defaultLocale)
157
- ? normalizedPath
158
- : basePath;
159
- return {
160
- locale: candidate,
161
- basePath,
162
- localizedPath
163
- };
164
- }
165
- const fallbackLocale = config.locales[0];
166
- if (!fallbackLocale) {
167
- return {
168
- locale: { code: "en", dir: "ltr" },
169
- basePath: normalizedPath,
170
- localizedPath: normalizedPath
171
- };
172
- }
173
- const defaultLocale = resolveLocaleByCode(config.locales, config.defaultLocale) ?? fallbackLocale;
174
- const defaultLocalizedPath = isLocalePrefixedForStrategy(config.strategy, defaultLocale.code, config.defaultLocale)
175
- ? joinLocalePath(defaultLocale.code, normalizedPath)
176
- : normalizedPath;
177
- return {
178
- locale: defaultLocale,
179
- basePath: normalizedPath,
180
- localizedPath: defaultLocalizedPath
181
- };
182
- }
183
- export function buildLocalePath(path, localeCode, config) {
184
- const fallbackLocale = config.locales[0];
185
- if (!fallbackLocale) {
186
- const { pathname, suffix } = splitPathSuffix(path);
187
- return `${normalizePathname(pathname)}${suffix}`;
188
- }
189
- const targetLocale = resolveLocaleByCode(config.locales, normalizeLocaleCode(localeCode) ?? config.defaultLocale)
190
- ?? resolveLocaleByCode(config.locales, config.defaultLocale)
191
- ?? fallbackLocale;
192
- const { pathname, suffix } = splitPathSuffix(path);
193
- const current = resolveI18nRoute(pathname, config);
194
- const basePath = normalizePathname(current.basePath);
195
- if (!isLocalePrefixedForStrategy(config.strategy, targetLocale.code, config.defaultLocale)) {
196
- return `${basePath}${suffix}`;
197
- }
198
- return `${joinLocalePath(targetLocale.code, basePath)}${suffix}`;
199
- }
200
- export function resolveLocaleDirection(config, localeCode) {
201
- return resolveLocaleByCode(config.locales, localeCode)?.dir === "rtl" ? "rtl" : "ltr";
202
- }
203
- export function resolveLocalizedValue(value, localeCode, fallbackLocale) {
204
- if (typeof value === "string") {
205
- return value;
206
- }
207
- if (!isRecord(value)) {
208
- return null;
209
- }
210
- const primary = value[localeCode];
211
- if (typeof primary === "string") {
212
- return primary;
213
- }
214
- const fallback = value[fallbackLocale];
215
- if (typeof fallback === "string") {
216
- return fallback;
217
- }
218
- return null;
219
- }
220
- export function translateRaw(config, localeCode, key) {
221
- const localeMessages = config.messages[localeCode];
222
- if (localeMessages) {
223
- const direct = readNestedValue(localeMessages, key);
224
- if (direct !== undefined) {
225
- return direct;
226
- }
227
- }
228
- const fallbackMessages = config.messages[config.fallbackLocale];
229
- if (fallbackMessages) {
230
- const fallback = readNestedValue(fallbackMessages, key);
231
- if (fallback !== undefined) {
232
- return fallback;
233
- }
234
- }
235
- return undefined;
236
- }
237
- export function translateText(config, localeCode, key, params = {}) {
238
- const raw = translateRaw(config, localeCode, key);
239
- if (typeof raw === "string") {
240
- return interpolateMessage(raw, params);
241
- }
242
- if (typeof raw === "number" || typeof raw === "boolean") {
243
- return String(raw);
244
- }
245
- return key;
246
- }
247
- export function createI18nHead(routePath, routeOrigin, config, options = {}) {
248
- const resolved = resolveI18nRoute(routePath, config);
249
- const includeHreflang = options.includeHreflang !== false;
250
- const htmlAttrs = {
251
- lang: resolved.locale.code,
252
- dir: resolveLocaleDirection(config, resolved.locale.code)
253
- };
254
- const link = [];
255
- const canonicalPath = buildLocalePath(resolved.basePath, resolved.locale.code, config);
256
- const canonicalHref = routeOrigin ? new URL(canonicalPath, routeOrigin).toString() : canonicalPath;
257
- link.push({
258
- rel: "canonical",
259
- href: canonicalHref
260
- });
261
- if (includeHreflang) {
262
- for (const locale of config.locales) {
263
- const hrefPath = buildLocalePath(resolved.basePath, locale.code, config);
264
- const href = routeOrigin ? new URL(hrefPath, routeOrigin).toString() : hrefPath;
265
- link.push({
266
- rel: "alternate",
267
- hreflang: locale.code,
268
- href
269
- });
270
- }
271
- const defaultHrefPath = buildLocalePath(resolved.basePath, config.defaultLocale, config);
272
- const defaultHref = routeOrigin ? new URL(defaultHrefPath, routeOrigin).toString() : defaultHrefPath;
273
- link.push({
274
- rel: "alternate",
275
- hreflang: "x-default",
276
- href: defaultHref
277
- });
278
- }
279
- return {
280
- htmlAttrs,
281
- link
282
- };
283
- }
58
+ return template.replace(/\{([A-Za-z0-9_]+)\}/g, (match, key) => {
59
+ const value = params[key];
60
+ if (value === void 0 || value === null) return match;
61
+ return String(value);
62
+ });
63
+ }
64
+ function normalizeI18nStrategy(value) {
65
+ if (value === "prefix" || value === "no_prefix" || value === "prefix_except_default") return value;
66
+ return "prefix_except_default";
67
+ }
68
+ function normalizeI18nRuntimeConfig(value) {
69
+ if (!isRecord(value)) return null;
70
+ const localeEntries = Array.isArray(value.locales) ? value.locales : [];
71
+ const locales = [];
72
+ for (const entry of localeEntries) {
73
+ if (!isRecord(entry)) continue;
74
+ const code = normalizeLocaleCode(entry.code);
75
+ if (!code) continue;
76
+ locales.push({
77
+ code,
78
+ ...typeof entry.name === "string" ? { name: entry.name } : {},
79
+ dir: entry.dir === "rtl" ? "rtl" : "ltr"
80
+ });
81
+ }
82
+ if (!locales.length) return null;
83
+ const uniqueLocales = [];
84
+ const localeCodes = /* @__PURE__ */ new Set();
85
+ for (const locale of locales) {
86
+ if (localeCodes.has(locale.code)) continue;
87
+ localeCodes.add(locale.code);
88
+ uniqueLocales.push(locale);
89
+ }
90
+ const firstLocale = uniqueLocales[0];
91
+ const defaultLocale = normalizeLocaleCode(value.defaultLocale) ?? firstLocale.code;
92
+ const fallbackLocale = normalizeLocaleCode(value.fallbackLocale) ?? defaultLocale;
93
+ const strategy = normalizeI18nStrategy(value.strategy);
94
+ const messagesInput = isRecord(value.messages) ? value.messages : {};
95
+ const messages = {};
96
+ for (const locale of uniqueLocales) {
97
+ const entry = messagesInput[locale.code];
98
+ messages[locale.code] = isRecord(entry) ? entry : {};
99
+ }
100
+ const normalizedDefault = resolveLocaleByCode(uniqueLocales, defaultLocale)?.code ?? firstLocale.code;
101
+ return {
102
+ defaultLocale: normalizedDefault,
103
+ fallbackLocale: resolveLocaleByCode(uniqueLocales, fallbackLocale)?.code ?? normalizedDefault,
104
+ strategy,
105
+ locales: uniqueLocales,
106
+ messages
107
+ };
108
+ }
109
+ function resolveI18nRoute(pathname, config) {
110
+ const { pathname: rawPathname } = splitPathSuffix(pathname);
111
+ const normalizedPath = normalizePathname(rawPathname);
112
+ const segments = normalizedPath === "/" ? [] : normalizedPath.slice(1).split("/");
113
+ const first = segments[0];
114
+ const candidate = first ? resolveLocaleByCode(config.locales, first) : null;
115
+ if (candidate && config.strategy !== "no_prefix") {
116
+ const remainder = segments.slice(1);
117
+ const basePath = remainder.length ? `/${remainder.join("/")}` : "/";
118
+ return {
119
+ locale: candidate,
120
+ basePath,
121
+ localizedPath: isLocalePrefixedForStrategy(config.strategy, candidate.code, config.defaultLocale) ? normalizedPath : basePath
122
+ };
123
+ }
124
+ const fallbackLocale = config.locales[0];
125
+ if (!fallbackLocale) return {
126
+ locale: {
127
+ code: "en",
128
+ dir: "ltr"
129
+ },
130
+ basePath: normalizedPath,
131
+ localizedPath: normalizedPath
132
+ };
133
+ const defaultLocale = resolveLocaleByCode(config.locales, config.defaultLocale) ?? fallbackLocale;
134
+ return {
135
+ locale: defaultLocale,
136
+ basePath: normalizedPath,
137
+ localizedPath: isLocalePrefixedForStrategy(config.strategy, defaultLocale.code, config.defaultLocale) ? joinLocalePath(defaultLocale.code, normalizedPath) : normalizedPath
138
+ };
139
+ }
140
+ function buildLocalePath(path, localeCode, config) {
141
+ const fallbackLocale = config.locales[0];
142
+ if (!fallbackLocale) {
143
+ const { pathname, suffix } = splitPathSuffix(path);
144
+ return `${normalizePathname(pathname)}${suffix}`;
145
+ }
146
+ const targetLocale = resolveLocaleByCode(config.locales, normalizeLocaleCode(localeCode) ?? config.defaultLocale) ?? resolveLocaleByCode(config.locales, config.defaultLocale) ?? fallbackLocale;
147
+ const { pathname, suffix } = splitPathSuffix(path);
148
+ const basePath = normalizePathname(resolveI18nRoute(pathname, config).basePath);
149
+ if (!isLocalePrefixedForStrategy(config.strategy, targetLocale.code, config.defaultLocale)) return `${basePath}${suffix}`;
150
+ return `${joinLocalePath(targetLocale.code, basePath)}${suffix}`;
151
+ }
152
+ function resolveLocaleDirection(config, localeCode) {
153
+ return resolveLocaleByCode(config.locales, localeCode)?.dir === "rtl" ? "rtl" : "ltr";
154
+ }
155
+ function resolveLocalizedValue(value, localeCode, fallbackLocale) {
156
+ if (typeof value === "string") return value;
157
+ if (!isRecord(value)) return null;
158
+ const primary = value[localeCode];
159
+ if (typeof primary === "string") return primary;
160
+ const fallback = value[fallbackLocale];
161
+ if (typeof fallback === "string") return fallback;
162
+ return null;
163
+ }
164
+ function translateRaw(config, localeCode, key) {
165
+ const localeMessages = config.messages[localeCode];
166
+ if (localeMessages) {
167
+ const direct = readNestedValue(localeMessages, key);
168
+ if (direct !== void 0) return direct;
169
+ }
170
+ const fallbackMessages = config.messages[config.fallbackLocale];
171
+ if (fallbackMessages) {
172
+ const fallback = readNestedValue(fallbackMessages, key);
173
+ if (fallback !== void 0) return fallback;
174
+ }
175
+ }
176
+ function translateText(config, localeCode, key, params = {}) {
177
+ const raw = translateRaw(config, localeCode, key);
178
+ if (typeof raw === "string") return interpolateMessage(raw, params);
179
+ if (typeof raw === "number" || typeof raw === "boolean") return String(raw);
180
+ return key;
181
+ }
182
+ function createI18nHead(routePath, routeOrigin, config, options = {}) {
183
+ const resolved = resolveI18nRoute(routePath, config);
184
+ const includeHreflang = options.includeHreflang !== false;
185
+ const htmlAttrs = {
186
+ lang: resolved.locale.code,
187
+ dir: resolveLocaleDirection(config, resolved.locale.code)
188
+ };
189
+ const link = [];
190
+ const canonicalPath = buildLocalePath(resolved.basePath, resolved.locale.code, config);
191
+ const canonicalHref = routeOrigin ? new URL(canonicalPath, routeOrigin).toString() : canonicalPath;
192
+ link.push({
193
+ rel: "canonical",
194
+ href: canonicalHref
195
+ });
196
+ if (includeHreflang) {
197
+ for (const locale of config.locales) {
198
+ const hrefPath = buildLocalePath(resolved.basePath, locale.code, config);
199
+ const href = routeOrigin ? new URL(hrefPath, routeOrigin).toString() : hrefPath;
200
+ link.push({
201
+ rel: "alternate",
202
+ hreflang: locale.code,
203
+ href
204
+ });
205
+ }
206
+ const defaultHrefPath = buildLocalePath(resolved.basePath, config.defaultLocale, config);
207
+ const defaultHref = routeOrigin ? new URL(defaultHrefPath, routeOrigin).toString() : defaultHrefPath;
208
+ link.push({
209
+ rel: "alternate",
210
+ hreflang: "x-default",
211
+ href: defaultHref
212
+ });
213
+ }
214
+ return {
215
+ htmlAttrs,
216
+ link
217
+ };
218
+ }
219
+ //#endregion
220
+ export { buildLocalePath, createI18nHead, normalizeI18nRuntimeConfig, normalizeI18nStrategy, resolveI18nRoute, resolveLocaleDirection, resolveLocalizedValue, translateRaw, translateText };
221
+
284
222
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/i18n/shared.ts"],"names":[],"mappings":"AA0BA,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,UAA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M,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACzE,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;YAChF,IAAI,CAAC,IAAI,CAAC;gBACR,GAAG,EAAE,WAAW;gBAChB,QAAQ,EAAE,MAAM,CAAC,IAAI;gBACrB,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,MAAM,eAAe,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACzF,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;QACrG,IAAI,CAAC,IAAI,CAAC;YACR,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,WAAW;YACrB,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,SAAS;QACT,IAAI;KACL,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../../src/i18n/shared.ts"],"sourcesContent":["export type ResuxI18nStrategy = \"prefix_except_default\" | \"prefix\" | \"no_prefix\";\n\nexport interface ResuxI18nLocale {\n code: string;\n name?: string;\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport interface ResuxI18nRuntimeConfig {\n defaultLocale: string;\n fallbackLocale: string;\n strategy: ResuxI18nStrategy;\n locales: ResuxI18nLocale[];\n messages: Record<string, Record<string, unknown>>;\n}\n\nexport interface ResuxI18nResolvedRoute {\n locale: ResuxI18nLocale;\n basePath: string;\n localizedPath: string;\n}\n\nexport interface ResuxI18nTranslationParams {\n [key: string]: string | number | boolean | null | undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return Boolean(value && typeof value === \"object\" && !Array.isArray(value));\n}\n\nfunction normalizeLocaleCode(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim().toLowerCase();\n if (!/^[a-z0-9-]+$/.test(normalized)) {\n return null;\n }\n return normalized;\n}\n\nfunction normalizePathname(pathname: string): string {\n const source = String(pathname || \"\").trim();\n if (!source) {\n return \"/\";\n }\n const withSlash = source.startsWith(\"/\") ? source : `/${source}`;\n if (withSlash !== \"/\" && withSlash.endsWith(\"/\")) {\n return withSlash.replace(/\\/+$/g, \"\");\n }\n return withSlash;\n}\n\nfunction splitPathSuffix(input: string): { pathname: string; suffix: string } {\n const source = String(input || \"\");\n const hashIndex = source.indexOf(\"#\");\n const queryIndex = source.indexOf(\"?\");\n const splitIndex = [hashIndex, queryIndex]\n .filter((index) => index >= 0)\n .sort((left, right) => left - right)[0];\n if (splitIndex === undefined) {\n return { pathname: source, suffix: \"\" };\n }\n return {\n pathname: source.slice(0, splitIndex),\n suffix: source.slice(splitIndex)\n };\n}\n\nfunction joinLocalePath(localeCode: string, basePath: string): string {\n const normalizedBase = normalizePathname(basePath);\n return normalizedBase === \"/\" ? `/${localeCode}` : `/${localeCode}${normalizedBase}`;\n}\n\nfunction isLocalePrefixedForStrategy(strategy: ResuxI18nStrategy, localeCode: string, defaultLocale: string): boolean {\n if (strategy === \"prefix\") {\n return true;\n }\n if (strategy === \"prefix_except_default\") {\n return localeCode !== defaultLocale;\n }\n return false;\n}\n\nfunction resolveLocaleByCode(locales: ResuxI18nLocale[], code: string): ResuxI18nLocale | null {\n return locales.find((locale) => locale.code === code) ?? null;\n}\n\nconst FORBIDDEN_MESSAGE_KEYS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\nfunction readNestedValue(source: Record<string, unknown>, key: string): unknown {\n if (!key) {\n return source;\n }\n const parts = key.split(\".\");\n let cursor: unknown = source;\n for (const part of parts) {\n if (\n FORBIDDEN_MESSAGE_KEYS.has(part)\n || !isRecord(cursor)\n || !Object.hasOwn(cursor, part)\n ) {\n return undefined;\n }\n cursor = cursor[part];\n }\n return cursor;\n}\n\nfunction interpolateMessage(template: string, params: ResuxI18nTranslationParams): string {\n return template.replace(/\\{([A-Za-z0-9_]+)\\}/g, (match, key: string) => {\n const value = params[key];\n if (value === undefined || value === null) {\n return match;\n }\n return String(value);\n });\n}\n\nexport function normalizeI18nStrategy(value: unknown): ResuxI18nStrategy {\n if (value === \"prefix\" || value === \"no_prefix\" || value === \"prefix_except_default\") {\n return value;\n }\n return \"prefix_except_default\";\n}\n\nexport function normalizeI18nRuntimeConfig(value: unknown): ResuxI18nRuntimeConfig | null {\n if (!isRecord(value)) {\n return null;\n }\n\n const localeEntries = Array.isArray(value.locales) ? value.locales : [];\n const locales: ResuxI18nLocale[] = [];\n for (const entry of localeEntries) {\n if (!isRecord(entry)) {\n continue;\n }\n const code = normalizeLocaleCode(entry.code);\n if (!code) {\n continue;\n }\n locales.push({\n code,\n ...(typeof entry.name === \"string\" ? { name: entry.name } : {}),\n dir: entry.dir === \"rtl\" ? \"rtl\" : \"ltr\"\n });\n }\n\n if (!locales.length) {\n return null;\n }\n\n const uniqueLocales: ResuxI18nLocale[] = [];\n const localeCodes = new Set<string>();\n for (const locale of locales) {\n if (localeCodes.has(locale.code)) {\n continue;\n }\n localeCodes.add(locale.code);\n uniqueLocales.push(locale);\n }\n\n const firstLocale = uniqueLocales[0];\n const defaultLocale = normalizeLocaleCode(value.defaultLocale) ?? firstLocale.code;\n const fallbackLocale = normalizeLocaleCode(value.fallbackLocale) ?? defaultLocale;\n const strategy = normalizeI18nStrategy(value.strategy);\n const messagesInput = isRecord(value.messages) ? value.messages : {};\n const messages: Record<string, Record<string, unknown>> = {};\n\n for (const locale of uniqueLocales) {\n const entry = messagesInput[locale.code];\n messages[locale.code] = isRecord(entry) ? entry : {};\n }\n\n const normalizedDefault = resolveLocaleByCode(uniqueLocales, defaultLocale)?.code ?? firstLocale.code;\n const normalizedFallback = resolveLocaleByCode(uniqueLocales, fallbackLocale)?.code ?? normalizedDefault;\n\n return {\n defaultLocale: normalizedDefault,\n fallbackLocale: normalizedFallback,\n strategy,\n locales: uniqueLocales,\n messages\n };\n}\n\nexport function resolveI18nRoute(pathname: string, config: ResuxI18nRuntimeConfig): ResuxI18nResolvedRoute {\n // Route identity is pathname-only. Query strings and hashes belong to\n // navigation state and must not be mistaken for a route segment or leak into\n // canonical/hreflang URLs.\n const { pathname: rawPathname } = splitPathSuffix(pathname);\n const normalizedPath = normalizePathname(rawPathname);\n const segments = normalizedPath === \"/\" ? [] : normalizedPath.slice(1).split(\"/\");\n const first = segments[0];\n const candidate = first ? resolveLocaleByCode(config.locales, first) : null;\n\n // For prefixed strategies, always consume a recognized locale segment. In\n // prefix_except_default the default-locale prefix is non-canonical, but it\n // still needs to be stripped so locale switching never produces paths such\n // as /fr/en/about.\n if (candidate && config.strategy !== \"no_prefix\") {\n const remainder = segments.slice(1);\n const basePath = remainder.length ? `/${remainder.join(\"/\")}` : \"/\";\n const localizedPath = isLocalePrefixedForStrategy(\n config.strategy,\n candidate.code,\n config.defaultLocale,\n )\n ? normalizedPath\n : basePath;\n return {\n locale: candidate,\n basePath,\n localizedPath\n };\n }\n\n const fallbackLocale = config.locales[0];\n if (!fallbackLocale) {\n return {\n locale: { code: \"en\", dir: \"ltr\" },\n basePath: normalizedPath,\n localizedPath: normalizedPath\n };\n }\n const defaultLocale = resolveLocaleByCode(config.locales, config.defaultLocale) ?? fallbackLocale;\n const defaultLocalizedPath = isLocalePrefixedForStrategy(config.strategy, defaultLocale.code, config.defaultLocale)\n ? joinLocalePath(defaultLocale.code, normalizedPath)\n : normalizedPath;\n return {\n locale: defaultLocale,\n basePath: normalizedPath,\n localizedPath: defaultLocalizedPath\n };\n}\n\nexport function buildLocalePath(path: string, localeCode: string, config: ResuxI18nRuntimeConfig): string {\n const fallbackLocale = config.locales[0];\n if (!fallbackLocale) {\n const { pathname, suffix } = splitPathSuffix(path);\n return `${normalizePathname(pathname)}${suffix}`;\n }\n const targetLocale = resolveLocaleByCode(config.locales, normalizeLocaleCode(localeCode) ?? config.defaultLocale)\n ?? resolveLocaleByCode(config.locales, config.defaultLocale)\n ?? fallbackLocale;\n const { pathname, suffix } = splitPathSuffix(path);\n const current = resolveI18nRoute(pathname, config);\n const basePath = normalizePathname(current.basePath);\n\n if (!isLocalePrefixedForStrategy(config.strategy, targetLocale.code, config.defaultLocale)) {\n return `${basePath}${suffix}`;\n }\n\n return `${joinLocalePath(targetLocale.code, basePath)}${suffix}`;\n}\n\nexport function resolveLocaleDirection(config: ResuxI18nRuntimeConfig, localeCode: string): \"ltr\" | \"rtl\" {\n return resolveLocaleByCode(config.locales, localeCode)?.dir === \"rtl\" ? \"rtl\" : \"ltr\";\n}\n\nexport function resolveLocalizedValue(\n value: unknown,\n localeCode: string,\n fallbackLocale: string\n): string | null {\n if (typeof value === \"string\") {\n return value;\n }\n if (!isRecord(value)) {\n return null;\n }\n const primary = value[localeCode];\n if (typeof primary === \"string\") {\n return primary;\n }\n const fallback = value[fallbackLocale];\n if (typeof fallback === \"string\") {\n return fallback;\n }\n return null;\n}\n\nexport function translateRaw(\n config: ResuxI18nRuntimeConfig,\n localeCode: string,\n key: string\n): unknown {\n const localeMessages = config.messages[localeCode];\n if (localeMessages) {\n const direct = readNestedValue(localeMessages, key);\n if (direct !== undefined) {\n return direct;\n }\n }\n\n const fallbackMessages = config.messages[config.fallbackLocale];\n if (fallbackMessages) {\n const fallback = readNestedValue(fallbackMessages, key);\n if (fallback !== undefined) {\n return fallback;\n }\n }\n\n return undefined;\n}\n\nexport function translateText(\n config: ResuxI18nRuntimeConfig,\n localeCode: string,\n key: string,\n params: ResuxI18nTranslationParams = {}\n): string {\n const raw = translateRaw(config, localeCode, key);\n if (typeof raw === \"string\") {\n return interpolateMessage(raw, params);\n }\n if (typeof raw === \"number\" || typeof raw === \"boolean\") {\n return String(raw);\n }\n return key;\n}\n\nexport function createI18nHead(\n routePath: string,\n routeOrigin: string | undefined,\n config: ResuxI18nRuntimeConfig,\n options: { includeHreflang?: boolean } = {}\n): { htmlAttrs: Record<string, string>; link: Array<Record<string, string>> } {\n const resolved = resolveI18nRoute(routePath, config);\n const includeHreflang = options.includeHreflang !== false;\n const htmlAttrs: Record<string, string> = {\n lang: resolved.locale.code,\n dir: resolveLocaleDirection(config, resolved.locale.code)\n };\n const link: Array<Record<string, string>> = [];\n\n const canonicalPath = buildLocalePath(resolved.basePath, resolved.locale.code, config);\n const canonicalHref = routeOrigin ? new URL(canonicalPath, routeOrigin).toString() : canonicalPath;\n link.push({\n rel: \"canonical\",\n href: canonicalHref\n });\n\n if (includeHreflang) {\n for (const locale of config.locales) {\n const hrefPath = buildLocalePath(resolved.basePath, locale.code, config);\n const href = routeOrigin ? new URL(hrefPath, routeOrigin).toString() : hrefPath;\n link.push({\n rel: \"alternate\",\n hreflang: locale.code,\n href\n });\n }\n\n const defaultHrefPath = buildLocalePath(resolved.basePath, config.defaultLocale, config);\n const defaultHref = routeOrigin ? new URL(defaultHrefPath, routeOrigin).toString() : defaultHrefPath;\n link.push({\n rel: \"alternate\",\n hreflang: \"x-default\",\n href: defaultHref\n });\n }\n\n return {\n htmlAttrs,\n link\n };\n}"],"mappings":";AA0BA,SAAS,SAAS,OAAkD;CAClE,OAAO,QAAQ,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,CAAC;AAC5E;AAEA,SAAS,oBAAoB,OAA+B;CAC1D,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,MAAM,aAAa,MAAM,KAAK,CAAC,CAAC,YAAY;CAC5C,IAAI,CAAC,eAAe,KAAK,UAAU,GACjC,OAAO;CAET,OAAO;AACT;AAEA,SAAS,kBAAkB,UAA0B;CACnD,MAAM,SAAS,OAAO,YAAY,EAAE,CAAC,CAAC,KAAK;CAC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