@jjlmoya/utils-forensic-science 1.1.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 (316) hide show
  1. package/package.json +69 -0
  2. package/scripts/crystal-lattice-catalog-translations.mjs +459 -0
  3. package/scripts/postinstall.mjs +27 -0
  4. package/scripts/sync-crystal-lattice-i18n.mjs +50 -0
  5. package/src/category/i18n/de.ts +55 -0
  6. package/src/category/i18n/en.ts +55 -0
  7. package/src/category/i18n/es.ts +55 -0
  8. package/src/category/i18n/fr.ts +55 -0
  9. package/src/category/i18n/id.ts +55 -0
  10. package/src/category/i18n/it.ts +55 -0
  11. package/src/category/i18n/ja.ts +56 -0
  12. package/src/category/i18n/ko.ts +56 -0
  13. package/src/category/i18n/nl.ts +55 -0
  14. package/src/category/i18n/pl.ts +55 -0
  15. package/src/category/i18n/pt.ts +55 -0
  16. package/src/category/i18n/ru.ts +55 -0
  17. package/src/category/i18n/sv.ts +55 -0
  18. package/src/category/i18n/tr.ts +55 -0
  19. package/src/category/i18n/zh.ts +56 -0
  20. package/src/category/index.ts +48 -0
  21. package/src/category/seo.astro +15 -0
  22. package/src/components/PreviewNavSidebar.astro +116 -0
  23. package/src/components/PreviewToolbar.astro +143 -0
  24. package/src/data.ts +10 -0
  25. package/src/entries.ts +48 -0
  26. package/src/env.d.ts +5 -0
  27. package/src/index.ts +29 -0
  28. package/src/layouts/PreviewLayout.astro +117 -0
  29. package/src/pages/[locale]/[slug].astro +162 -0
  30. package/src/pages/[locale].astro +261 -0
  31. package/src/pages/index.astro +3 -0
  32. package/src/tests/diacritics_density.test.ts +140 -0
  33. package/src/tests/faq_count.test.ts +19 -0
  34. package/src/tests/i18n_coverage.test.ts +36 -0
  35. package/src/tests/inverted_punctuation.test.ts +84 -0
  36. package/src/tests/locale_completeness.test.ts +24 -0
  37. package/src/tests/mocks/astro_mock.js +2 -0
  38. package/src/tests/no_en_dash.test.ts +70 -0
  39. package/src/tests/no_h1_in_components.test.ts +48 -0
  40. package/src/tests/schemas_fulfillment.test.ts +23 -0
  41. package/src/tests/script_density.test.ts +94 -0
  42. package/src/tests/seo_length.test.ts +46 -0
  43. package/src/tests/shared-test-helpers.ts +56 -0
  44. package/src/tests/slug_language_code_format.test.ts +23 -0
  45. package/src/tests/slug_uniqueness.test.ts +81 -0
  46. package/src/tests/title_quality.test.ts +55 -0
  47. package/src/tests/tool_exports.test.ts +34 -0
  48. package/src/tests/tool_validation.test.ts +16 -0
  49. package/src/tests/widmark.test.ts +28 -0
  50. package/src/tool/forensic-age-estimator/bibliography.astro +14 -0
  51. package/src/tool/forensic-age-estimator/bibliography.ts +16 -0
  52. package/src/tool/forensic-age-estimator/component.astro +321 -0
  53. package/src/tool/forensic-age-estimator/dental-skeletal-third-molar-age-estimator.css +634 -0
  54. package/src/tool/forensic-age-estimator/entry.ts +32 -0
  55. package/src/tool/forensic-age-estimator/i18n/de.ts +245 -0
  56. package/src/tool/forensic-age-estimator/i18n/en.ts +245 -0
  57. package/src/tool/forensic-age-estimator/i18n/es.ts +245 -0
  58. package/src/tool/forensic-age-estimator/i18n/fr.ts +245 -0
  59. package/src/tool/forensic-age-estimator/i18n/id.ts +245 -0
  60. package/src/tool/forensic-age-estimator/i18n/it.ts +245 -0
  61. package/src/tool/forensic-age-estimator/i18n/ja.ts +245 -0
  62. package/src/tool/forensic-age-estimator/i18n/ko.ts +245 -0
  63. package/src/tool/forensic-age-estimator/i18n/nl.ts +245 -0
  64. package/src/tool/forensic-age-estimator/i18n/pl.ts +245 -0
  65. package/src/tool/forensic-age-estimator/i18n/pt.ts +245 -0
  66. package/src/tool/forensic-age-estimator/i18n/ru.ts +245 -0
  67. package/src/tool/forensic-age-estimator/i18n/sv.ts +245 -0
  68. package/src/tool/forensic-age-estimator/i18n/tr.ts +245 -0
  69. package/src/tool/forensic-age-estimator/i18n/zh.ts +246 -0
  70. package/src/tool/forensic-age-estimator/index.ts +11 -0
  71. package/src/tool/forensic-age-estimator/logic.ts +81 -0
  72. package/src/tool/forensic-age-estimator/seo.astro +15 -0
  73. package/src/tool/forensic-blood-test-simulator/bibliography.astro +6 -0
  74. package/src/tool/forensic-blood-test-simulator/bibliography.ts +12 -0
  75. package/src/tool/forensic-blood-test-simulator/component.astro +168 -0
  76. package/src/tool/forensic-blood-test-simulator/dom-utils.ts +40 -0
  77. package/src/tool/forensic-blood-test-simulator/entry.ts +32 -0
  78. package/src/tool/forensic-blood-test-simulator/forensic-presumptive-blood-testing-luminol-kastle-meyer-simulator.css +532 -0
  79. package/src/tool/forensic-blood-test-simulator/helpers.ts +16 -0
  80. package/src/tool/forensic-blood-test-simulator/i18n/de.ts +185 -0
  81. package/src/tool/forensic-blood-test-simulator/i18n/en.ts +185 -0
  82. package/src/tool/forensic-blood-test-simulator/i18n/es.ts +185 -0
  83. package/src/tool/forensic-blood-test-simulator/i18n/fr.ts +220 -0
  84. package/src/tool/forensic-blood-test-simulator/i18n/id.ts +220 -0
  85. package/src/tool/forensic-blood-test-simulator/i18n/it.ts +220 -0
  86. package/src/tool/forensic-blood-test-simulator/i18n/ja.ts +220 -0
  87. package/src/tool/forensic-blood-test-simulator/i18n/ko.ts +220 -0
  88. package/src/tool/forensic-blood-test-simulator/i18n/nl.ts +220 -0
  89. package/src/tool/forensic-blood-test-simulator/i18n/pl.ts +220 -0
  90. package/src/tool/forensic-blood-test-simulator/i18n/pt.ts +220 -0
  91. package/src/tool/forensic-blood-test-simulator/i18n/ru.ts +220 -0
  92. package/src/tool/forensic-blood-test-simulator/i18n/sv.ts +220 -0
  93. package/src/tool/forensic-blood-test-simulator/i18n/tr.ts +220 -0
  94. package/src/tool/forensic-blood-test-simulator/i18n/zh.ts +220 -0
  95. package/src/tool/forensic-blood-test-simulator/index.ts +11 -0
  96. package/src/tool/forensic-blood-test-simulator/logic.ts +174 -0
  97. package/src/tool/forensic-blood-test-simulator/script.ts +192 -0
  98. package/src/tool/forensic-blood-test-simulator/seo.astro +15 -0
  99. package/src/tool/forensic-fiber-comparison-microscope/bibliography.astro +6 -0
  100. package/src/tool/forensic-fiber-comparison-microscope/bibliography.ts +16 -0
  101. package/src/tool/forensic-fiber-comparison-microscope/component.astro +146 -0
  102. package/src/tool/forensic-fiber-comparison-microscope/entry.ts +32 -0
  103. package/src/tool/forensic-fiber-comparison-microscope/forensic-fiber-comparison-microscope.css +629 -0
  104. package/src/tool/forensic-fiber-comparison-microscope/i18n/de.ts +250 -0
  105. package/src/tool/forensic-fiber-comparison-microscope/i18n/en.ts +246 -0
  106. package/src/tool/forensic-fiber-comparison-microscope/i18n/es.ts +246 -0
  107. package/src/tool/forensic-fiber-comparison-microscope/i18n/fr.ts +246 -0
  108. package/src/tool/forensic-fiber-comparison-microscope/i18n/id.ts +250 -0
  109. package/src/tool/forensic-fiber-comparison-microscope/i18n/it.ts +246 -0
  110. package/src/tool/forensic-fiber-comparison-microscope/i18n/ja.ts +250 -0
  111. package/src/tool/forensic-fiber-comparison-microscope/i18n/ko.ts +246 -0
  112. package/src/tool/forensic-fiber-comparison-microscope/i18n/nl.ts +246 -0
  113. package/src/tool/forensic-fiber-comparison-microscope/i18n/pl.ts +250 -0
  114. package/src/tool/forensic-fiber-comparison-microscope/i18n/pt.ts +250 -0
  115. package/src/tool/forensic-fiber-comparison-microscope/i18n/ru.ts +250 -0
  116. package/src/tool/forensic-fiber-comparison-microscope/i18n/sv.ts +250 -0
  117. package/src/tool/forensic-fiber-comparison-microscope/i18n/tr.ts +246 -0
  118. package/src/tool/forensic-fiber-comparison-microscope/i18n/zh.ts +250 -0
  119. package/src/tool/forensic-fiber-comparison-microscope/index.ts +11 -0
  120. package/src/tool/forensic-fiber-comparison-microscope/logic.ts +244 -0
  121. package/src/tool/forensic-fiber-comparison-microscope/render.ts +265 -0
  122. package/src/tool/forensic-fiber-comparison-microscope/seo.astro +15 -0
  123. package/src/tool/forensic-fiber-comparison-microscope/view.ts +267 -0
  124. package/src/tool/forensic-glass-becke-line-simulator/bibliography.astro +6 -0
  125. package/src/tool/forensic-glass-becke-line-simulator/bibliography.ts +16 -0
  126. package/src/tool/forensic-glass-becke-line-simulator/component.astro +81 -0
  127. package/src/tool/forensic-glass-becke-line-simulator/entry.ts +32 -0
  128. package/src/tool/forensic-glass-becke-line-simulator/forensic-glass-becke-line-simulator.css +392 -0
  129. package/src/tool/forensic-glass-becke-line-simulator/i18n/de.ts +231 -0
  130. package/src/tool/forensic-glass-becke-line-simulator/i18n/en.ts +231 -0
  131. package/src/tool/forensic-glass-becke-line-simulator/i18n/es.ts +231 -0
  132. package/src/tool/forensic-glass-becke-line-simulator/i18n/fr.ts +231 -0
  133. package/src/tool/forensic-glass-becke-line-simulator/i18n/id.ts +231 -0
  134. package/src/tool/forensic-glass-becke-line-simulator/i18n/it.ts +231 -0
  135. package/src/tool/forensic-glass-becke-line-simulator/i18n/ja.ts +231 -0
  136. package/src/tool/forensic-glass-becke-line-simulator/i18n/ko.ts +231 -0
  137. package/src/tool/forensic-glass-becke-line-simulator/i18n/nl.ts +231 -0
  138. package/src/tool/forensic-glass-becke-line-simulator/i18n/pl.ts +231 -0
  139. package/src/tool/forensic-glass-becke-line-simulator/i18n/pt.ts +231 -0
  140. package/src/tool/forensic-glass-becke-line-simulator/i18n/ru.ts +231 -0
  141. package/src/tool/forensic-glass-becke-line-simulator/i18n/sv.ts +231 -0
  142. package/src/tool/forensic-glass-becke-line-simulator/i18n/tr.ts +231 -0
  143. package/src/tool/forensic-glass-becke-line-simulator/i18n/zh.ts +231 -0
  144. package/src/tool/forensic-glass-becke-line-simulator/index.ts +11 -0
  145. package/src/tool/forensic-glass-becke-line-simulator/logic.ts +100 -0
  146. package/src/tool/forensic-glass-becke-line-simulator/seo.astro +15 -0
  147. package/src/tool/forensic-glass-becke-line-simulator/view.ts +281 -0
  148. package/src/tool/forensic-image-authenticity-analyzer/bibliography.astro +9 -0
  149. package/src/tool/forensic-image-authenticity-analyzer/bibliography.ts +7 -0
  150. package/src/tool/forensic-image-authenticity-analyzer/component.astro +250 -0
  151. package/src/tool/forensic-image-authenticity-analyzer/entry.ts +29 -0
  152. package/src/tool/forensic-image-authenticity-analyzer/forensic-image-metadata-authenticity-analyzer.css +679 -0
  153. package/src/tool/forensic-image-authenticity-analyzer/i18n/de.ts +105 -0
  154. package/src/tool/forensic-image-authenticity-analyzer/i18n/en.ts +105 -0
  155. package/src/tool/forensic-image-authenticity-analyzer/i18n/es.ts +105 -0
  156. package/src/tool/forensic-image-authenticity-analyzer/i18n/fr.ts +105 -0
  157. package/src/tool/forensic-image-authenticity-analyzer/i18n/id.ts +76 -0
  158. package/src/tool/forensic-image-authenticity-analyzer/i18n/it.ts +105 -0
  159. package/src/tool/forensic-image-authenticity-analyzer/i18n/ja.ts +72 -0
  160. package/src/tool/forensic-image-authenticity-analyzer/i18n/ko.ts +72 -0
  161. package/src/tool/forensic-image-authenticity-analyzer/i18n/nl.ts +75 -0
  162. package/src/tool/forensic-image-authenticity-analyzer/i18n/pl.ts +75 -0
  163. package/src/tool/forensic-image-authenticity-analyzer/i18n/pt.ts +105 -0
  164. package/src/tool/forensic-image-authenticity-analyzer/i18n/ru.ts +75 -0
  165. package/src/tool/forensic-image-authenticity-analyzer/i18n/sv.ts +76 -0
  166. package/src/tool/forensic-image-authenticity-analyzer/i18n/tr.ts +76 -0
  167. package/src/tool/forensic-image-authenticity-analyzer/i18n/zh.ts +71 -0
  168. package/src/tool/forensic-image-authenticity-analyzer/index.ts +11 -0
  169. package/src/tool/forensic-image-authenticity-analyzer/logic.ts +283 -0
  170. package/src/tool/forensic-image-authenticity-analyzer/seo.astro +10 -0
  171. package/src/tool/forensic-microcrystal-drug-simulator/bibliography.astro +6 -0
  172. package/src/tool/forensic-microcrystal-drug-simulator/bibliography.ts +12 -0
  173. package/src/tool/forensic-microcrystal-drug-simulator/component.astro +240 -0
  174. package/src/tool/forensic-microcrystal-drug-simulator/entry.ts +32 -0
  175. package/src/tool/forensic-microcrystal-drug-simulator/forensic-microcrystal-drug-simulator.css +430 -0
  176. package/src/tool/forensic-microcrystal-drug-simulator/i18n/de.ts +244 -0
  177. package/src/tool/forensic-microcrystal-drug-simulator/i18n/en.ts +244 -0
  178. package/src/tool/forensic-microcrystal-drug-simulator/i18n/es.ts +244 -0
  179. package/src/tool/forensic-microcrystal-drug-simulator/i18n/fr.ts +244 -0
  180. package/src/tool/forensic-microcrystal-drug-simulator/i18n/id.ts +244 -0
  181. package/src/tool/forensic-microcrystal-drug-simulator/i18n/it.ts +244 -0
  182. package/src/tool/forensic-microcrystal-drug-simulator/i18n/ja.ts +244 -0
  183. package/src/tool/forensic-microcrystal-drug-simulator/i18n/ko.ts +244 -0
  184. package/src/tool/forensic-microcrystal-drug-simulator/i18n/nl.ts +244 -0
  185. package/src/tool/forensic-microcrystal-drug-simulator/i18n/pl.ts +244 -0
  186. package/src/tool/forensic-microcrystal-drug-simulator/i18n/pt.ts +244 -0
  187. package/src/tool/forensic-microcrystal-drug-simulator/i18n/ru.ts +244 -0
  188. package/src/tool/forensic-microcrystal-drug-simulator/i18n/sv.ts +244 -0
  189. package/src/tool/forensic-microcrystal-drug-simulator/i18n/tr.ts +244 -0
  190. package/src/tool/forensic-microcrystal-drug-simulator/i18n/zh.ts +244 -0
  191. package/src/tool/forensic-microcrystal-drug-simulator/index.ts +11 -0
  192. package/src/tool/forensic-microcrystal-drug-simulator/logic.ts +189 -0
  193. package/src/tool/forensic-microcrystal-drug-simulator/seo.astro +15 -0
  194. package/src/tool/forensic-sex-determinator/bibliography.astro +14 -0
  195. package/src/tool/forensic-sex-determinator/bibliography.ts +12 -0
  196. package/src/tool/forensic-sex-determinator/component.astro +463 -0
  197. package/src/tool/forensic-sex-determinator/entry.ts +32 -0
  198. package/src/tool/forensic-sex-determinator/forensic-sex-determinator.css +413 -0
  199. package/src/tool/forensic-sex-determinator/i18n/de.ts +211 -0
  200. package/src/tool/forensic-sex-determinator/i18n/en.ts +211 -0
  201. package/src/tool/forensic-sex-determinator/i18n/es.ts +211 -0
  202. package/src/tool/forensic-sex-determinator/i18n/fr.ts +211 -0
  203. package/src/tool/forensic-sex-determinator/i18n/id.ts +211 -0
  204. package/src/tool/forensic-sex-determinator/i18n/it.ts +211 -0
  205. package/src/tool/forensic-sex-determinator/i18n/ja.ts +211 -0
  206. package/src/tool/forensic-sex-determinator/i18n/ko.ts +211 -0
  207. package/src/tool/forensic-sex-determinator/i18n/nl.ts +211 -0
  208. package/src/tool/forensic-sex-determinator/i18n/pl.ts +211 -0
  209. package/src/tool/forensic-sex-determinator/i18n/pt.ts +211 -0
  210. package/src/tool/forensic-sex-determinator/i18n/ru.ts +211 -0
  211. package/src/tool/forensic-sex-determinator/i18n/sv.ts +211 -0
  212. package/src/tool/forensic-sex-determinator/i18n/tr.ts +211 -0
  213. package/src/tool/forensic-sex-determinator/i18n/zh.ts +211 -0
  214. package/src/tool/forensic-sex-determinator/index.ts +11 -0
  215. package/src/tool/forensic-sex-determinator/logic.ts +89 -0
  216. package/src/tool/forensic-sex-determinator/seo.astro +15 -0
  217. package/src/tool/forensic-stature-estimator/bibliography.astro +14 -0
  218. package/src/tool/forensic-stature-estimator/bibliography.ts +12 -0
  219. package/src/tool/forensic-stature-estimator/component.astro +49 -0
  220. package/src/tool/forensic-stature-estimator/components/EstimationPanel.astro +65 -0
  221. package/src/tool/forensic-stature-estimator/components/OsteometricBoard.astro +39 -0
  222. package/src/tool/forensic-stature-estimator/components/OsteometricSelector.astro +109 -0
  223. package/src/tool/forensic-stature-estimator/dom-utils.ts +71 -0
  224. package/src/tool/forensic-stature-estimator/entry.ts +32 -0
  225. package/src/tool/forensic-stature-estimator/forensic-stature-estimator.css +689 -0
  226. package/src/tool/forensic-stature-estimator/helpers.ts +51 -0
  227. package/src/tool/forensic-stature-estimator/i18n/de.ts +196 -0
  228. package/src/tool/forensic-stature-estimator/i18n/en.ts +196 -0
  229. package/src/tool/forensic-stature-estimator/i18n/es.ts +196 -0
  230. package/src/tool/forensic-stature-estimator/i18n/fr.ts +196 -0
  231. package/src/tool/forensic-stature-estimator/i18n/id.ts +196 -0
  232. package/src/tool/forensic-stature-estimator/i18n/it.ts +196 -0
  233. package/src/tool/forensic-stature-estimator/i18n/ja.ts +196 -0
  234. package/src/tool/forensic-stature-estimator/i18n/ko.ts +196 -0
  235. package/src/tool/forensic-stature-estimator/i18n/nl.ts +196 -0
  236. package/src/tool/forensic-stature-estimator/i18n/pl.ts +196 -0
  237. package/src/tool/forensic-stature-estimator/i18n/pt.ts +196 -0
  238. package/src/tool/forensic-stature-estimator/i18n/ru.ts +196 -0
  239. package/src/tool/forensic-stature-estimator/i18n/sv.ts +196 -0
  240. package/src/tool/forensic-stature-estimator/i18n/tr.ts +196 -0
  241. package/src/tool/forensic-stature-estimator/i18n/zh.ts +196 -0
  242. package/src/tool/forensic-stature-estimator/index.ts +11 -0
  243. package/src/tool/forensic-stature-estimator/logic.ts +119 -0
  244. package/src/tool/forensic-stature-estimator/script.ts +288 -0
  245. package/src/tool/forensic-stature-estimator/seo.astro +15 -0
  246. package/src/tool/forensic-tlc-ink-simulator/bibliography.astro +6 -0
  247. package/src/tool/forensic-tlc-ink-simulator/bibliography.ts +16 -0
  248. package/src/tool/forensic-tlc-ink-simulator/component.astro +245 -0
  249. package/src/tool/forensic-tlc-ink-simulator/entry.ts +32 -0
  250. package/src/tool/forensic-tlc-ink-simulator/forensic-tlc-ink-simulator.css +462 -0
  251. package/src/tool/forensic-tlc-ink-simulator/i18n/de.ts +243 -0
  252. package/src/tool/forensic-tlc-ink-simulator/i18n/en.ts +243 -0
  253. package/src/tool/forensic-tlc-ink-simulator/i18n/es.ts +243 -0
  254. package/src/tool/forensic-tlc-ink-simulator/i18n/fr.ts +243 -0
  255. package/src/tool/forensic-tlc-ink-simulator/i18n/id.ts +243 -0
  256. package/src/tool/forensic-tlc-ink-simulator/i18n/it.ts +243 -0
  257. package/src/tool/forensic-tlc-ink-simulator/i18n/ja.ts +235 -0
  258. package/src/tool/forensic-tlc-ink-simulator/i18n/ko.ts +235 -0
  259. package/src/tool/forensic-tlc-ink-simulator/i18n/nl.ts +243 -0
  260. package/src/tool/forensic-tlc-ink-simulator/i18n/pl.ts +243 -0
  261. package/src/tool/forensic-tlc-ink-simulator/i18n/pt.ts +243 -0
  262. package/src/tool/forensic-tlc-ink-simulator/i18n/ru.ts +243 -0
  263. package/src/tool/forensic-tlc-ink-simulator/i18n/sv.ts +243 -0
  264. package/src/tool/forensic-tlc-ink-simulator/i18n/tr.ts +243 -0
  265. package/src/tool/forensic-tlc-ink-simulator/i18n/zh.ts +235 -0
  266. package/src/tool/forensic-tlc-ink-simulator/index.ts +11 -0
  267. package/src/tool/forensic-tlc-ink-simulator/logic.ts +152 -0
  268. package/src/tool/forensic-tlc-ink-simulator/seo.astro +15 -0
  269. package/src/tool/gsr-dispersion-calculator/bibliography.astro +6 -0
  270. package/src/tool/gsr-dispersion-calculator/bibliography.ts +16 -0
  271. package/src/tool/gsr-dispersion-calculator/component.astro +294 -0
  272. package/src/tool/gsr-dispersion-calculator/entry.ts +32 -0
  273. package/src/tool/gsr-dispersion-calculator/gsr-dispersion-calculator.css +305 -0
  274. package/src/tool/gsr-dispersion-calculator/i18n/de.ts +272 -0
  275. package/src/tool/gsr-dispersion-calculator/i18n/en.ts +272 -0
  276. package/src/tool/gsr-dispersion-calculator/i18n/es.ts +272 -0
  277. package/src/tool/gsr-dispersion-calculator/i18n/fr.ts +272 -0
  278. package/src/tool/gsr-dispersion-calculator/i18n/id.ts +272 -0
  279. package/src/tool/gsr-dispersion-calculator/i18n/it.ts +272 -0
  280. package/src/tool/gsr-dispersion-calculator/i18n/ja.ts +272 -0
  281. package/src/tool/gsr-dispersion-calculator/i18n/ko.ts +272 -0
  282. package/src/tool/gsr-dispersion-calculator/i18n/nl.ts +272 -0
  283. package/src/tool/gsr-dispersion-calculator/i18n/pl.ts +272 -0
  284. package/src/tool/gsr-dispersion-calculator/i18n/pt.ts +272 -0
  285. package/src/tool/gsr-dispersion-calculator/i18n/ru.ts +272 -0
  286. package/src/tool/gsr-dispersion-calculator/i18n/sv.ts +272 -0
  287. package/src/tool/gsr-dispersion-calculator/i18n/tr.ts +272 -0
  288. package/src/tool/gsr-dispersion-calculator/i18n/zh.ts +272 -0
  289. package/src/tool/gsr-dispersion-calculator/index.ts +11 -0
  290. package/src/tool/gsr-dispersion-calculator/logic.ts +148 -0
  291. package/src/tool/gsr-dispersion-calculator/seo.astro +15 -0
  292. package/src/tool/widmark-alcohol-simulator/bibliography.astro +14 -0
  293. package/src/tool/widmark-alcohol-simulator/bibliography.ts +12 -0
  294. package/src/tool/widmark-alcohol-simulator/component.astro +453 -0
  295. package/src/tool/widmark-alcohol-simulator/entry.ts +32 -0
  296. package/src/tool/widmark-alcohol-simulator/i18n/de.ts +193 -0
  297. package/src/tool/widmark-alcohol-simulator/i18n/en.ts +206 -0
  298. package/src/tool/widmark-alcohol-simulator/i18n/es.ts +193 -0
  299. package/src/tool/widmark-alcohol-simulator/i18n/fr.ts +193 -0
  300. package/src/tool/widmark-alcohol-simulator/i18n/id.ts +193 -0
  301. package/src/tool/widmark-alcohol-simulator/i18n/it.ts +193 -0
  302. package/src/tool/widmark-alcohol-simulator/i18n/ja.ts +193 -0
  303. package/src/tool/widmark-alcohol-simulator/i18n/ko.ts +193 -0
  304. package/src/tool/widmark-alcohol-simulator/i18n/nl.ts +193 -0
  305. package/src/tool/widmark-alcohol-simulator/i18n/pl.ts +193 -0
  306. package/src/tool/widmark-alcohol-simulator/i18n/pt.ts +193 -0
  307. package/src/tool/widmark-alcohol-simulator/i18n/ru.ts +193 -0
  308. package/src/tool/widmark-alcohol-simulator/i18n/sv.ts +193 -0
  309. package/src/tool/widmark-alcohol-simulator/i18n/tr.ts +193 -0
  310. package/src/tool/widmark-alcohol-simulator/i18n/zh.ts +193 -0
  311. package/src/tool/widmark-alcohol-simulator/index.ts +11 -0
  312. package/src/tool/widmark-alcohol-simulator/logic.ts +97 -0
  313. package/src/tool/widmark-alcohol-simulator/seo.astro +15 -0
  314. package/src/tool/widmark-alcohol-simulator/widmark-alcohol-simulator.css +386 -0
  315. package/src/tools.ts +27 -0
  316. package/src/types.ts +70 -0
@@ -0,0 +1,34 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import { validateToolExports } from './shared-test-helpers';
4
+
5
+ describe('Tool Exports Pattern Validation', () => {
6
+ describe('Component Exports Format', () => {
7
+ ALL_TOOLS.forEach((tool) => {
8
+ it(`${tool.entry.id}: Component should be a lazy-loaded function`, () => {
9
+ expect(typeof tool.Component).toBe('function');
10
+ expect(tool.Component).toBeInstanceOf(Function);
11
+ });
12
+
13
+ it(`${tool.entry.id}: SEOComponent should be a lazy-loaded function`, () => {
14
+ expect(typeof tool.SEOComponent).toBe('function');
15
+ expect(tool.SEOComponent).toBeInstanceOf(Function);
16
+ });
17
+
18
+ it(`${tool.entry.id}: BibliographyComponent should be a lazy-loaded function`, () => {
19
+ expect(typeof tool.BibliographyComponent).toBe('function');
20
+ expect(tool.BibliographyComponent).toBeInstanceOf(Function);
21
+ });
22
+ });
23
+ });
24
+
25
+ describe('Dynamic Import Validation', () => {
26
+ it('all tools must have functional dynamic imports', async () => {
27
+ const result = await validateToolExports(ALL_TOOLS);
28
+ if (!result.passed) {
29
+ throw new Error(`Tool export validation failed:\n${result.failures.join('\n')}`);
30
+ }
31
+ expect(result.passed).toBe(true);
32
+ });
33
+ });
34
+ });
@@ -0,0 +1,16 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import { scienceCategory } from '../data';
4
+
5
+ describe('Tool Validation Suite', () => {
6
+ describe('Library Registration', () => {
7
+ it('should have 11 tools in ALL_TOOLS', () => {
8
+ expect(ALL_TOOLS.length).toBe(11);
9
+ });
10
+
11
+ it('scienceCategory should be defined', () => {
12
+ expect(scienceCategory).toBeDefined();
13
+ expect(scienceCategory.i18n).toBeDefined();
14
+ });
15
+ });
16
+ });
@@ -0,0 +1,28 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { WidmarkEngine } from '../tool/widmark-alcohol-simulator/logic';
3
+
4
+ describe('WidmarkEngine simulation tests', () => {
5
+ it('should calculate correct BAC and linear decay for an 80kg male', () => {
6
+ const profile = {
7
+ weight: 80,
8
+ sex: 'male' as const,
9
+ hydration: 'normal' as const,
10
+ stomach: 'empty' as const,
11
+ };
12
+ const drinks = [
13
+ { volume: 1000, abv: 5, time: 0 },
14
+ ];
15
+
16
+ const result = WidmarkEngine.simulate(profile, drinks);
17
+ expect(result.peakBac).toBeGreaterThan(0.5);
18
+ expect(result.peakBac).toBeLessThan(0.75);
19
+
20
+ const peakIndex = result.datapoints.findIndex(dp => dp.bac === result.peakBac);
21
+ expect(peakIndex).toBeGreaterThan(0);
22
+
23
+ const step1 = result.datapoints[peakIndex + 5]!;
24
+ const step2 = result.datapoints[peakIndex + 15]!;
25
+ const rate = (step1.bac - step2.bac) / ((step2.time - step1.time));
26
+ expect(rate).toBeCloseTo(0.15, 1);
27
+ });
28
+ });
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { forensicAgeEstimator } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'en' } = Astro.props;
11
+ const content = await forensicAgeEstimator.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SharedBibliography links={content.bibliography} />}
@@ -0,0 +1,16 @@
1
+ import type { BibliographyEntry } from '../../types';
2
+
3
+ export const bibliography: BibliographyEntry[] = [
4
+ {
5
+ name: 'Forensic Science International - Study of third molars for estimating age',
6
+ url: 'https://pmc.ncbi.nlm.nih.gov/articles/PMC6100221/',
7
+ },
8
+ {
9
+ name: 'Royal College of Paediatrics and Child Health - Age assessment guidance',
10
+ url: 'https://www.rcpch.ac.uk/news-events/news/2022-02/rcpch-updates-position-statement-age-assessment',
11
+ },
12
+ {
13
+ name: 'UNICEF - Age assessment: a technical note',
14
+ url: 'https://www.refworld.org/en/download/90892',
15
+ },
16
+ ];
@@ -0,0 +1,321 @@
1
+ ---
2
+ import './dental-skeletal-third-molar-age-estimator.css';
3
+
4
+ interface Props {
5
+ ui: Record<string, string>;
6
+ }
7
+
8
+ const { ui } = Astro.props;
9
+
10
+ const stageValues = Array.from({ length: 9 }, (_, stage) => stage);
11
+ ---
12
+
13
+ <div class="forensic-age" id="forensic-age">
14
+ <section class="forensic-age-panel" aria-label={ui.controls}>
15
+ <label class="forensic-age-field" for="forensic-evidence">
16
+ <span>{ui.evidenceType}</span>
17
+ <select id="forensic-evidence">
18
+ <option value="mixed">{ui.mixedEvidence}</option>
19
+ <option value="dental">{ui.dentalPriority}</option>
20
+ <option value="skeletal">{ui.skeletalPriority}</option>
21
+ </select>
22
+ </label>
23
+
24
+ <div class="forensic-age-stage-field" data-stage-field="dental">
25
+ <button class="forensic-age-stage-select" type="button" aria-expanded="false" aria-controls="forensic-dental-list">
26
+ <span>
27
+ <b>{ui.dentalStage}</b>
28
+ <small>{ui.dentalStageHelp}</small>
29
+ </span>
30
+ <output id="forensic-dental-output">{ui.stageLabel} 4</output>
31
+ </button>
32
+ <div class="forensic-age-stage-list" id="forensic-dental-list" hidden>
33
+ {stageValues.map((stage) => (
34
+ <label class="forensic-age-stage-card">
35
+ <input name="forensic-dental-stage" data-stage-input="forensic-dental" type="radio" value={stage} checked={stage === 4} />
36
+ <svg viewBox="0 0 44 44" aria-hidden="true">
37
+ <path d="M16 10c4-3 8-3 12 0 4 4 4 11 1 19l-3 7h-8l-3-7c-3-8-3-15 1-19Z" />
38
+ <path style={`opacity:${0.18 + stage * 0.1}`} d="M17 26h10" />
39
+ </svg>
40
+ <strong>{ui.stageLabel} {stage}</strong>
41
+ <span>{ui[`dentalStage${stage}`]}</span>
42
+ </label>
43
+ ))}
44
+ </div>
45
+ </div>
46
+
47
+ <div class="forensic-age-stage-field" data-stage-field="epiphyseal">
48
+ <button class="forensic-age-stage-select" type="button" aria-expanded="false" aria-controls="forensic-epiphyseal-list">
49
+ <span>
50
+ <b>{ui.epiphysealStage}</b>
51
+ <small>{ui.epiphysealStageHelp}</small>
52
+ </span>
53
+ <output id="forensic-epiphyseal-output">{ui.stageLabel} 4</output>
54
+ </button>
55
+ <div class="forensic-age-stage-list" id="forensic-epiphyseal-list" hidden>
56
+ {stageValues.map((stage) => (
57
+ <label class="forensic-age-stage-card">
58
+ <input name="forensic-epiphyseal-stage" data-stage-input="forensic-epiphyseal" type="radio" value={stage} checked={stage === 4} />
59
+ <svg viewBox="0 0 44 44" aria-hidden="true">
60
+ <path d="M13 12h18M13 32h18" />
61
+ <path style={`opacity:${0.12 + stage * 0.1}`} d="M14 22h16" />
62
+ <path style={`opacity:${stage / 8}`} d="M22 12v20" />
63
+ </svg>
64
+ <strong>{ui.stageLabel} {stage}</strong>
65
+ <span>{ui[`epiphysealStage${stage}`]}</span>
66
+ </label>
67
+ ))}
68
+ </div>
69
+ </div>
70
+
71
+ <div class="forensic-age-stage-field" data-stage-field="molar">
72
+ <button class="forensic-age-stage-select" type="button" aria-expanded="false" aria-controls="forensic-molar-list">
73
+ <span>
74
+ <b>{ui.thirdMolarStage}</b>
75
+ <small>{ui.molarStageHelp}</small>
76
+ </span>
77
+ <output id="forensic-molar-output">{ui.stageLabel} 4</output>
78
+ </button>
79
+ <div class="forensic-age-stage-list" id="forensic-molar-list" hidden>
80
+ {stageValues.map((stage) => (
81
+ <label class="forensic-age-stage-card">
82
+ <input name="forensic-molar-stage" data-stage-input="forensic-molar" type="radio" value={stage} checked={stage === 4} />
83
+ <svg viewBox="0 0 44 44" aria-hidden="true">
84
+ <circle cx="22" cy="18" r="8" />
85
+ <path style={`opacity:${0.12 + stage * 0.1}`} d="M17 27c3 5 7 5 10 0" />
86
+ <path style={`opacity:${stage / 8}`} d="M22 26v9" />
87
+ </svg>
88
+ <strong>{ui.stageLabel} {stage}</strong>
89
+ <span>{ui[`molarStage${stage}`]}</span>
90
+ </label>
91
+ ))}
92
+ </div>
93
+ </div>
94
+ </section>
95
+
96
+ <section class="forensic-age-visual" aria-label={ui.caseBoard}>
97
+ <svg class="forensic-age-instrument" viewBox="0 0 430 430" role="img" aria-label={ui.maturityProfile}>
98
+ <circle class="forensic-age-progress-track" cx="215" cy="176" r="126" pathLength="100" />
99
+ <circle class="forensic-age-progress-fill" cx="215" cy="176" r="126" pathLength="100" />
100
+ <text class="forensic-age-score-label" x="215" y="160">{ui.maturityScore}</text>
101
+ <text class="forensic-age-score-value" id="forensic-score" x="215" y="203">-</text>
102
+ <g class="forensic-age-signals">
103
+ <line class="forensic-age-signal" x1="108" y1="320" x2="322" y2="320" />
104
+ <circle class="forensic-age-signal-dot forensic-age-signal-dot-dental" cx="108" cy="320" r="5" />
105
+ <circle class="forensic-age-signal-dot forensic-age-signal-dot-epiphyseal" cx="215" cy="320" r="5" />
106
+ <circle class="forensic-age-signal-dot forensic-age-signal-dot-molar" cx="322" cy="320" r="5" />
107
+ <text x="108" y="350">{ui.dentalShort}</text>
108
+ <text x="215" y="350">{ui.boneShort}</text>
109
+ <text x="322" y="350">{ui.molarShort}</text>
110
+ </g>
111
+ </svg>
112
+ </section>
113
+
114
+ <section class="forensic-age-results" aria-label={ui.results}>
115
+ <div class="forensic-age-band forensic-age-band-main">
116
+ <strong id="forensic-likely">-</strong>
117
+ </div>
118
+ <div class="forensic-age-interval">
119
+ <strong id="forensic-minimum">-</strong>
120
+ <strong id="forensic-likely-marker">-</strong>
121
+ <i></i>
122
+ <strong id="forensic-maximum">-</strong>
123
+ </div>
124
+
125
+ <div class="forensic-age-notes">
126
+ <strong id="forensic-confidence">-</strong>
127
+ <p id="forensic-notes">-</p>
128
+ </div>
129
+ </section>
130
+ </div>
131
+
132
+ <script id="forensic-age-ui" type="application/json" set:html={JSON.stringify(ui)}></script>
133
+
134
+ <script>
135
+ import { estimateForensicAge } from './logic';
136
+ import type { EvidenceType } from './logic';
137
+
138
+ const uiElement = document.getElementById('forensic-age-ui');
139
+ const ui = JSON.parse(uiElement?.textContent ?? '{}') as Record<string, string>;
140
+ const evidence = document.getElementById('forensic-evidence') as HTMLSelectElement | null;
141
+ const root = document.getElementById('forensic-age') as HTMLElement | null;
142
+ const dentalOutput = document.getElementById('forensic-dental-output');
143
+ const epiphysealOutput = document.getElementById('forensic-epiphyseal-output');
144
+ const molarOutput = document.getElementById('forensic-molar-output');
145
+ const minimum = document.getElementById('forensic-minimum');
146
+ const likely = document.getElementById('forensic-likely');
147
+ const likelyMarker = document.getElementById('forensic-likely-marker');
148
+ const maximum = document.getElementById('forensic-maximum');
149
+ const confidence = document.getElementById('forensic-confidence');
150
+ const notes = document.getElementById('forensic-notes');
151
+ const score = document.getElementById('forensic-score');
152
+ const progressFill = document.querySelector<SVGCircleElement>('.forensic-age-progress-fill');
153
+ const instrument = document.querySelector<SVGSVGElement>('.forensic-age-instrument');
154
+ const interval = document.querySelector<HTMLElement>('.forensic-age-interval');
155
+ const storageKey = 'forensic-age-estimator:last-input';
156
+ const renderedValues = new WeakMap<HTMLElement, number>();
157
+ let renderedScore = 0;
158
+
159
+ function selectedStage(name: string): number {
160
+ const input = document.querySelector<HTMLInputElement>(`[data-stage-input="${name}"]:checked`);
161
+ return Number(input?.value ?? 4);
162
+ }
163
+
164
+ function selectStage(name: string, value: number) {
165
+ const stage = Math.min(8, Math.max(0, Math.round(value)));
166
+ const input = document.querySelector<HTMLInputElement>(`[data-stage-input="${name}"][value="${stage}"]`);
167
+ if (input) input.checked = true;
168
+ }
169
+
170
+ function renderAge(target: HTMLElement | null, value: number, animate = true) {
171
+ if (!target) return;
172
+ const from = renderedValues.get(target) ?? value;
173
+ renderedValues.set(target, value);
174
+ animateNumber(from, value, (current) => {
175
+ target.innerHTML = `<span class="forensic-age-number">${current.toFixed(1)}</span><span class="forensic-age-unit">${ui.ageUnit}</span>`;
176
+ }, animate);
177
+ }
178
+
179
+ function isEvidenceType(value: string | undefined): value is EvidenceType {
180
+ return value === 'dental' || value === 'skeletal' || value === 'mixed';
181
+ }
182
+
183
+ function restoreInput() {
184
+ if (!evidence) return;
185
+
186
+ try {
187
+ const saved = JSON.parse(localStorage.getItem(storageKey) ?? '{}') as {
188
+ dentalStage?: number;
189
+ epiphysealStage?: number;
190
+ evidenceType?: EvidenceType;
191
+ molarStage?: number;
192
+ };
193
+
194
+ if (isEvidenceType(saved.evidenceType)) {
195
+ evidence.value = saved.evidenceType;
196
+ }
197
+
198
+ selectStage('forensic-dental', saved.dentalStage ?? 4);
199
+ selectStage('forensic-epiphyseal', saved.epiphysealStage ?? 4);
200
+ selectStage('forensic-molar', saved.molarStage ?? 4);
201
+ } catch {
202
+ localStorage.removeItem(storageKey);
203
+ }
204
+ }
205
+
206
+ function saveInput(dentalStage: number, epiphysealStage: number, molarStage: number) {
207
+ if (!evidence) return;
208
+
209
+ localStorage.setItem(storageKey, JSON.stringify({
210
+ dentalStage,
211
+ epiphysealStage,
212
+ evidenceType: evidence.value,
213
+ molarStage,
214
+ }));
215
+ }
216
+
217
+ function pulseInstrument() {
218
+ if (!instrument) return;
219
+ instrument.classList.remove('forensic-age-instrument-pulse');
220
+ requestAnimationFrame(() => instrument.classList.add('forensic-age-instrument-pulse'));
221
+ }
222
+
223
+ function pulseInterval() {
224
+ if (!interval) return;
225
+ interval.classList.remove('forensic-age-interval-pulse');
226
+ requestAnimationFrame(() => interval.classList.add('forensic-age-interval-pulse'));
227
+ }
228
+
229
+ function animateNumber(from: number, to: number, render: (value: number) => void, animate = true) {
230
+ if (!animate || window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
231
+ render(to);
232
+ return;
233
+ }
234
+
235
+ const started = performance.now();
236
+ const duration = 420;
237
+ const tick = (time: number) => {
238
+ const progress = Math.min(1, (time - started) / duration);
239
+ const eased = 1 - Math.pow(1 - progress, 3);
240
+ render(from + (to - from) * eased);
241
+ if (progress < 1) requestAnimationFrame(tick);
242
+ };
243
+ requestAnimationFrame(tick);
244
+ }
245
+
246
+ function renderResult(result: ReturnType<typeof estimateForensicAge>) {
247
+ renderAge(minimum, result.minimumAge);
248
+ renderAge(likely, result.likelyAge);
249
+ renderAge(likelyMarker, result.likelyAge);
250
+ renderAge(maximum, result.maximumAge);
251
+ confidence!.textContent = ui[`confidence${result.confidence}`] ?? null;
252
+ notes!.textContent = result.notes.map((note) => ui[note]).join(' ') || null;
253
+ animateNumber(renderedScore, result.maturityScore, (current) => {
254
+ score!.textContent = `${Math.round(current)}%`;
255
+ });
256
+ renderedScore = result.maturityScore;
257
+ progressFill?.classList.toggle('forensic-age-progress-fill-complete', result.maturityScore >= 100);
258
+ }
259
+
260
+ function update() {
261
+ if (!evidence || !root) return;
262
+
263
+ const dentalStage = selectedStage('forensic-dental');
264
+ const epiphysealStage = selectedStage('forensic-epiphyseal');
265
+ const molarStage = selectedStage('forensic-molar');
266
+
267
+ const result = estimateForensicAge({
268
+ dentalStage,
269
+ epiphysealStage,
270
+ thirdMolarStage: molarStage,
271
+ evidenceType: evidence.value as EvidenceType,
272
+ });
273
+
274
+ dentalOutput!.textContent = `${ui.stageLabel} ${dentalStage}`;
275
+ epiphysealOutput!.textContent = `${ui.stageLabel} ${epiphysealStage}`;
276
+ molarOutput!.textContent = `${ui.stageLabel} ${molarStage}`;
277
+ renderResult(result);
278
+ root.style.setProperty('--dental-maturity', String(dentalStage / 8));
279
+ root.style.setProperty('--epiphyseal-maturity', String(epiphysealStage / 8));
280
+ root.style.setProperty('--molar-maturity', String(molarStage / 8));
281
+ root.style.setProperty('--overall-maturity', String(result.maturityScore / 100));
282
+ saveInput(dentalStage, epiphysealStage, molarStage);
283
+ pulseInstrument();
284
+ pulseInterval();
285
+ }
286
+
287
+ function closeStageLists() {
288
+ document.querySelectorAll<HTMLElement>('.forensic-age-stage-list').forEach((item) => { item.hidden = true; });
289
+ document.querySelectorAll<HTMLButtonElement>('.forensic-age-stage-select').forEach((item) => {
290
+ item.setAttribute('aria-expanded', 'false');
291
+ });
292
+ }
293
+
294
+ restoreInput();
295
+ evidence?.addEventListener('change', update);
296
+ document.querySelectorAll<HTMLButtonElement>('.forensic-age-stage-select').forEach((button) => {
297
+ button.addEventListener('click', () => {
298
+ const list = document.getElementById(button.getAttribute('aria-controls') ?? '');
299
+ const shouldOpen = button.getAttribute('aria-expanded') !== 'true';
300
+ closeStageLists();
301
+ if (list) list.hidden = !shouldOpen;
302
+ button.setAttribute('aria-expanded', String(shouldOpen));
303
+ });
304
+ });
305
+ document.querySelectorAll<HTMLInputElement>('[data-stage-input]').forEach((input) => {
306
+ input.addEventListener('change', () => {
307
+ const field = input.closest<HTMLElement>('.forensic-age-stage-field');
308
+ field!.querySelector<HTMLElement>('.forensic-age-stage-list')!.hidden = true;
309
+ field!.querySelector<HTMLButtonElement>('.forensic-age-stage-select')!.setAttribute('aria-expanded', 'false');
310
+ update();
311
+ });
312
+ });
313
+ document.addEventListener('click', (event) => {
314
+ if ((event.target as HTMLElement).closest('.forensic-age-stage-field')) return;
315
+ closeStageLists();
316
+ });
317
+ document.addEventListener('keydown', (event) => {
318
+ if (event.key === 'Escape') closeStageLists();
319
+ });
320
+ update();
321
+ </script>