fansunited-data-layer 0.2.0 → 0.2.1

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 (308) hide show
  1. package/api/fansunited/constants.d.ts +5 -0
  2. package/api/fansunited/constants.d.ts.map +1 -0
  3. package/api/fansunited/football/competition/index.d.ts +30 -0
  4. package/api/fansunited/football/competition/index.d.ts.map +1 -0
  5. package/api/fansunited/football/competition/transformer.d.ts +11 -0
  6. package/api/fansunited/football/competition/transformer.d.ts.map +1 -0
  7. package/api/fansunited/football/competition/types.d.ts +70 -0
  8. package/api/fansunited/football/competition/types.d.ts.map +1 -0
  9. package/api/fansunited/football/competitions/index.d.ts +27 -0
  10. package/api/fansunited/football/competitions/index.d.ts.map +1 -0
  11. package/api/fansunited/football/competitions/transformer.d.ts +14 -0
  12. package/api/fansunited/football/competitions/transformer.d.ts.map +1 -0
  13. package/api/fansunited/football/competitions/types.d.ts +67 -0
  14. package/api/fansunited/football/competitions/types.d.ts.map +1 -0
  15. package/api/fansunited/football/http.d.ts +8 -0
  16. package/api/fansunited/football/http.d.ts.map +1 -0
  17. package/api/fansunited/football/index.d.ts +19 -0
  18. package/api/fansunited/football/index.d.ts.map +1 -0
  19. package/api/fansunited/football/matches/index.d.ts +61 -0
  20. package/api/fansunited/football/matches/index.d.ts.map +1 -0
  21. package/api/fansunited/football/matches/transformer.d.ts +28 -0
  22. package/api/fansunited/football/matches/transformer.d.ts.map +1 -0
  23. package/api/fansunited/football/matches/types.d.ts +328 -0
  24. package/api/fansunited/football/matches/types.d.ts.map +1 -0
  25. package/api/fansunited/football/players/index.d.ts +30 -0
  26. package/api/fansunited/football/players/index.d.ts.map +1 -0
  27. package/api/fansunited/football/players/transformer.d.ts +10 -0
  28. package/api/fansunited/football/players/transformer.d.ts.map +1 -0
  29. package/api/fansunited/football/players/types.d.ts +70 -0
  30. package/api/fansunited/football/players/types.d.ts.map +1 -0
  31. package/api/fansunited/football/search/index.d.ts +49 -0
  32. package/api/fansunited/football/search/index.d.ts.map +1 -0
  33. package/api/fansunited/football/search/transformer.d.ts +10 -0
  34. package/api/fansunited/football/search/transformer.d.ts.map +1 -0
  35. package/api/fansunited/football/search/types.d.ts +151 -0
  36. package/api/fansunited/football/search/types.d.ts.map +1 -0
  37. package/api/fansunited/football/teams/index.d.ts +30 -0
  38. package/api/fansunited/football/teams/index.d.ts.map +1 -0
  39. package/api/fansunited/football/teams/transformer.d.ts +10 -0
  40. package/api/fansunited/football/teams/transformer.d.ts.map +1 -0
  41. package/api/fansunited/football/teams/types.d.ts +87 -0
  42. package/api/fansunited/football/teams/types.d.ts.map +1 -0
  43. package/api/fansunited/http.d.ts +54 -0
  44. package/api/fansunited/http.d.ts.map +1 -0
  45. package/api/fansunited/index.d.ts +10 -0
  46. package/api/fansunited/index.d.ts.map +1 -0
  47. package/api/sportal365-sports/constants.d.ts +16 -0
  48. package/api/sportal365-sports/constants.d.ts.map +1 -0
  49. package/api/sportal365-sports/football/competitions/competition.types.d.ts +148 -0
  50. package/api/sportal365-sports/football/competitions/competition.types.d.ts.map +1 -0
  51. package/api/sportal365-sports/football/competitions/index.d.ts +54 -0
  52. package/api/sportal365-sports/football/competitions/index.d.ts.map +1 -0
  53. package/api/sportal365-sports/football/competitions/utils.d.ts +14 -0
  54. package/api/sportal365-sports/football/competitions/utils.d.ts.map +1 -0
  55. package/api/sportal365-sports/football/http.d.ts +8 -0
  56. package/api/sportal365-sports/football/http.d.ts.map +1 -0
  57. package/api/sportal365-sports/football/index.d.ts +19 -0
  58. package/api/sportal365-sports/football/index.d.ts.map +1 -0
  59. package/api/sportal365-sports/football/matches/index.d.ts +151 -0
  60. package/api/sportal365-sports/football/matches/index.d.ts.map +1 -0
  61. package/api/sportal365-sports/football/matches/transformers/commentary.d.ts +12 -0
  62. package/api/sportal365-sports/football/matches/transformers/commentary.d.ts.map +1 -0
  63. package/api/sportal365-sports/football/matches/transformers/index.d.ts +10 -0
  64. package/api/sportal365-sports/football/matches/transformers/index.d.ts.map +1 -0
  65. package/api/sportal365-sports/football/matches/transformers/lineup.d.ts +11 -0
  66. package/api/sportal365-sports/football/matches/transformers/lineup.d.ts.map +1 -0
  67. package/api/sportal365-sports/football/matches/transformers/match-event.d.ts +12 -0
  68. package/api/sportal365-sports/football/matches/transformers/match-event.d.ts.map +1 -0
  69. package/api/sportal365-sports/football/matches/transformers/match.d.ts +11 -0
  70. package/api/sportal365-sports/football/matches/transformers/match.d.ts.map +1 -0
  71. package/api/sportal365-sports/football/matches/transformers/odds.d.ts +11 -0
  72. package/api/sportal365-sports/football/matches/transformers/odds.d.ts.map +1 -0
  73. package/api/sportal365-sports/football/matches/transformers/statistics.d.ts +11 -0
  74. package/api/sportal365-sports/football/matches/transformers/statistics.d.ts.map +1 -0
  75. package/api/sportal365-sports/football/matches/types/commentary.types.d.ts +27 -0
  76. package/api/sportal365-sports/football/matches/types/commentary.types.d.ts.map +1 -0
  77. package/api/sportal365-sports/football/matches/types/event.types.d.ts +19 -0
  78. package/api/sportal365-sports/football/matches/types/event.types.d.ts.map +1 -0
  79. package/api/sportal365-sports/football/matches/types/index.d.ts +16 -0
  80. package/api/sportal365-sports/football/matches/types/index.d.ts.map +1 -0
  81. package/api/sportal365-sports/football/matches/types/lineup.types.d.ts +80 -0
  82. package/api/sportal365-sports/football/matches/types/lineup.types.d.ts.map +1 -0
  83. package/api/sportal365-sports/football/matches/types/match.types.d.ts +47 -0
  84. package/api/sportal365-sports/football/matches/types/match.types.d.ts.map +1 -0
  85. package/api/sportal365-sports/football/matches/types/minute.types.d.ts +8 -0
  86. package/api/sportal365-sports/football/matches/types/minute.types.d.ts.map +1 -0
  87. package/api/sportal365-sports/football/matches/types/odds.types.d.ts +80 -0
  88. package/api/sportal365-sports/football/matches/types/odds.types.d.ts.map +1 -0
  89. package/api/sportal365-sports/football/matches/types/option.types.d.ts +129 -0
  90. package/api/sportal365-sports/football/matches/types/option.types.d.ts.map +1 -0
  91. package/api/sportal365-sports/football/matches/types/referee.types.d.ts +13 -0
  92. package/api/sportal365-sports/football/matches/types/referee.types.d.ts.map +1 -0
  93. package/api/sportal365-sports/football/matches/types/statistics.types.d.ts +45 -0
  94. package/api/sportal365-sports/football/matches/types/statistics.types.d.ts.map +1 -0
  95. package/api/sportal365-sports/football/matches/types/status.types.d.ts +13 -0
  96. package/api/sportal365-sports/football/matches/types/status.types.d.ts.map +1 -0
  97. package/api/sportal365-sports/football/matches/types/team.types.d.ts +17 -0
  98. package/api/sportal365-sports/football/matches/types/team.types.d.ts.map +1 -0
  99. package/api/sportal365-sports/football/matches/types/winner.types.d.ts +15 -0
  100. package/api/sportal365-sports/football/matches/types/winner.types.d.ts.map +1 -0
  101. package/api/sportal365-sports/football/search/index.d.ts +45 -0
  102. package/api/sportal365-sports/football/search/index.d.ts.map +1 -0
  103. package/api/sportal365-sports/football/search/search.transformer.d.ts +10 -0
  104. package/api/sportal365-sports/football/search/search.transformer.d.ts.map +1 -0
  105. package/api/sportal365-sports/football/search/search.types.d.ts +147 -0
  106. package/api/sportal365-sports/football/search/search.types.d.ts.map +1 -0
  107. package/api/sportal365-sports/football/standings/index.d.ts +43 -0
  108. package/api/sportal365-sports/football/standings/index.d.ts.map +1 -0
  109. package/api/sportal365-sports/football/standings/standing.transformer.d.ts +15 -0
  110. package/api/sportal365-sports/football/standings/standing.transformer.d.ts.map +1 -0
  111. package/api/sportal365-sports/football/standings/standing.types.d.ts +73 -0
  112. package/api/sportal365-sports/football/standings/standing.types.d.ts.map +1 -0
  113. package/api/sportal365-sports/football/statistics/index.d.ts +42 -0
  114. package/api/sportal365-sports/football/statistics/index.d.ts.map +1 -0
  115. package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts +11 -0
  116. package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts.map +1 -0
  117. package/api/sportal365-sports/football/statistics/player-season.types.d.ts +84 -0
  118. package/api/sportal365-sports/football/statistics/player-season.types.d.ts.map +1 -0
  119. package/api/sportal365-sports/football/teams/index.d.ts +53 -0
  120. package/api/sportal365-sports/football/teams/index.d.ts.map +1 -0
  121. package/api/sportal365-sports/football/teams/squad.types.d.ts +63 -0
  122. package/api/sportal365-sports/football/teams/squad.types.d.ts.map +1 -0
  123. package/api/sportal365-sports/football/teams/team.types.d.ts +58 -0
  124. package/api/sportal365-sports/football/teams/team.types.d.ts.map +1 -0
  125. package/api/sportal365-sports/football/teams/utils.d.ts +24 -0
  126. package/api/sportal365-sports/football/teams/utils.d.ts.map +1 -0
  127. package/api/sportal365-sports/http.d.ts +59 -0
  128. package/api/sportal365-sports/http.d.ts.map +1 -0
  129. package/api/sportal365-sports/index.d.ts +14 -0
  130. package/api/sportal365-sports/index.d.ts.map +1 -0
  131. package/api/sportal365-sports/search/http.d.ts +8 -0
  132. package/api/sportal365-sports/search/http.d.ts.map +1 -0
  133. package/api/sportal365-sports/search/index.d.ts +43 -0
  134. package/api/sportal365-sports/search/index.d.ts.map +1 -0
  135. package/api/sportal365-sports/search/search.transformer.d.ts +10 -0
  136. package/api/sportal365-sports/search/search.transformer.d.ts.map +1 -0
  137. package/api/sportal365-sports/search/search.types.d.ts +209 -0
  138. package/api/sportal365-sports/search/search.types.d.ts.map +1 -0
  139. package/api/sportal365-sports/shared/index.d.ts +6 -0
  140. package/api/sportal365-sports/shared/index.d.ts.map +1 -0
  141. package/api/sportal365-sports/shared/providerRef.helper.d.ts +79 -0
  142. package/api/sportal365-sports/shared/providerRef.helper.d.ts.map +1 -0
  143. package/api/sportal365-sports/shared/types.d.ts +189 -0
  144. package/api/sportal365-sports/shared/types.d.ts.map +1 -0
  145. package/api/sportal365-sports/statistics/http.d.ts +8 -0
  146. package/api/sportal365-sports/statistics/http.d.ts.map +1 -0
  147. package/api/sportal365-sports/statistics/index.d.ts +55 -0
  148. package/api/sportal365-sports/statistics/index.d.ts.map +1 -0
  149. package/api/sportal365-sports/statistics/team-stats.transformer.d.ts +14 -0
  150. package/api/sportal365-sports/statistics/team-stats.transformer.d.ts.map +1 -0
  151. package/api/sportal365-sports/statistics/team-stats.types.d.ts +45 -0
  152. package/api/sportal365-sports/statistics/team-stats.types.d.ts.map +1 -0
  153. package/client.cjs +8 -0
  154. package/client.d.ts +20 -0
  155. package/client.d.ts.map +1 -0
  156. package/client.js +12065 -0
  157. package/config/index.d.ts +31 -0
  158. package/config/index.d.ts.map +1 -0
  159. package/config/types.d.ts +36 -0
  160. package/config/types.d.ts.map +1 -0
  161. package/fansunited-data-layer.cjs +1 -0
  162. package/fansunited-data-layer.js +1739 -0
  163. package/helpers/competition.helpers.d.ts +22 -0
  164. package/helpers/competition.helpers.d.ts.map +1 -0
  165. package/helpers/index.d.ts +7 -0
  166. package/helpers/index.d.ts.map +1 -0
  167. package/helpers/team.helpers.d.ts +289 -0
  168. package/helpers/team.helpers.d.ts.map +1 -0
  169. package/index-Cogo-Kkd.cjs +1 -0
  170. package/index-D7T2Yy11.js +1170 -0
  171. package/index.d.ts +39 -0
  172. package/index.d.ts.map +1 -0
  173. package/package.json +12 -15
  174. package/providers/competition/hooks/index.d.ts +6 -0
  175. package/providers/competition/hooks/index.d.ts.map +1 -0
  176. package/providers/competition/hooks/useCompetitionStats.d.ts +8 -0
  177. package/providers/competition/hooks/useCompetitionStats.d.ts.map +1 -0
  178. package/providers/competition/hooks/useGoalDistribution.d.ts +11 -0
  179. package/providers/competition/hooks/useGoalDistribution.d.ts.map +1 -0
  180. package/providers/competition/hooks/useMatchHelpers.d.ts +16 -0
  181. package/providers/competition/hooks/useMatchHelpers.d.ts.map +1 -0
  182. package/providers/competition/hooks/useStandingsCalculations.d.ts +18 -0
  183. package/providers/competition/hooks/useStandingsCalculations.d.ts.map +1 -0
  184. package/providers/competition/hooks/useStandingsHelpers.d.ts +23 -0
  185. package/providers/competition/hooks/useStandingsHelpers.d.ts.map +1 -0
  186. package/providers/competition/hooks/useTeamPosition.d.ts +8 -0
  187. package/providers/competition/hooks/useTeamPosition.d.ts.map +1 -0
  188. package/providers/competition/hooks/useTeamResultsTable.d.ts +9 -0
  189. package/providers/competition/hooks/useTeamResultsTable.d.ts.map +1 -0
  190. package/providers/competition/utils/competitionStats.d.ts +42 -0
  191. package/providers/competition/utils/competitionStats.d.ts.map +1 -0
  192. package/providers/competition/utils/goalDistribution.d.ts +41 -0
  193. package/providers/competition/utils/goalDistribution.d.ts.map +1 -0
  194. package/providers/competition/utils/index.d.ts +6 -0
  195. package/providers/competition/utils/index.d.ts.map +1 -0
  196. package/providers/competition/utils/standingsCalculations.d.ts +24 -0
  197. package/providers/competition/utils/standingsCalculations.d.ts.map +1 -0
  198. package/providers/competition.context.d.ts +8 -0
  199. package/providers/competition.context.d.ts.map +1 -0
  200. package/providers/competition.provider.d.ts +3 -0
  201. package/providers/competition.provider.d.ts.map +1 -0
  202. package/providers/competition.types.d.ts +118 -0
  203. package/providers/competition.types.d.ts.map +1 -0
  204. package/providers/fansunited-config.context.d.ts +6 -0
  205. package/providers/fansunited-config.context.d.ts.map +1 -0
  206. package/providers/fansunited-config.hooks.d.ts +19 -0
  207. package/providers/fansunited-config.hooks.d.ts.map +1 -0
  208. package/providers/fansunited-config.provider.d.ts +44 -0
  209. package/providers/fansunited-config.provider.d.ts.map +1 -0
  210. package/providers/fansunited-config.types.d.ts +48 -0
  211. package/providers/fansunited-config.types.d.ts.map +1 -0
  212. package/providers/fansunited-sdk.hook.d.ts +40 -0
  213. package/providers/fansunited-sdk.hook.d.ts.map +1 -0
  214. package/providers/index.d.ts +20 -0
  215. package/providers/index.d.ts.map +1 -0
  216. package/providers/match/hooks/useEventHelpers.d.ts +12 -0
  217. package/providers/match/hooks/useEventHelpers.d.ts.map +1 -0
  218. package/providers/match/hooks/useHeadToHeadHelpers.d.ts +13 -0
  219. package/providers/match/hooks/useHeadToHeadHelpers.d.ts.map +1 -0
  220. package/providers/match/hooks/useLineupHelpers.d.ts +13 -0
  221. package/providers/match/hooks/useLineupHelpers.d.ts.map +1 -0
  222. package/providers/match/hooks/useMatchStandingsCalculations.d.ts +20 -0
  223. package/providers/match/hooks/useMatchStandingsCalculations.d.ts.map +1 -0
  224. package/providers/match/hooks/useMatchStatus.d.ts +12 -0
  225. package/providers/match/hooks/useMatchStatus.d.ts.map +1 -0
  226. package/providers/match/hooks/useOddsHelpers.d.ts +10 -0
  227. package/providers/match/hooks/useOddsHelpers.d.ts.map +1 -0
  228. package/providers/match/hooks/useScoreHelpers.d.ts +16 -0
  229. package/providers/match/hooks/useScoreHelpers.d.ts.map +1 -0
  230. package/providers/match/hooks/useStandingsHelpers.d.ts +22 -0
  231. package/providers/match/hooks/useStandingsHelpers.d.ts.map +1 -0
  232. package/providers/match/hooks/useStatisticsHelpers.d.ts +13 -0
  233. package/providers/match/hooks/useStatisticsHelpers.d.ts.map +1 -0
  234. package/providers/match/hooks/useTeamHelpers.d.ts +11 -0
  235. package/providers/match/hooks/useTeamHelpers.d.ts.map +1 -0
  236. package/providers/match/hooks/useTeamStatsHelpers.d.ts +12 -0
  237. package/providers/match/hooks/useTeamStatsHelpers.d.ts.map +1 -0
  238. package/providers/match.context.d.ts +8 -0
  239. package/providers/match.context.d.ts.map +1 -0
  240. package/providers/match.provider.d.ts +3 -0
  241. package/providers/match.provider.d.ts.map +1 -0
  242. package/providers/match.types.d.ts +151 -0
  243. package/providers/match.types.d.ts.map +1 -0
  244. package/providers/team/hooks/useFormStats.d.ts +49 -0
  245. package/providers/team/hooks/useFormStats.d.ts.map +1 -0
  246. package/providers/team/hooks/useMatchHelpers.d.ts +12 -0
  247. package/providers/team/hooks/useMatchHelpers.d.ts.map +1 -0
  248. package/providers/team/hooks/useSquadHelpers.d.ts +17 -0
  249. package/providers/team/hooks/useSquadHelpers.d.ts.map +1 -0
  250. package/providers/team.context.d.ts +8 -0
  251. package/providers/team.context.d.ts.map +1 -0
  252. package/providers/team.provider.d.ts +3 -0
  253. package/providers/team.provider.d.ts.map +1 -0
  254. package/providers/team.types.d.ts +68 -0
  255. package/providers/team.types.d.ts.map +1 -0
  256. package/types/canonical/base.types.d.ts +366 -0
  257. package/types/canonical/base.types.d.ts.map +1 -0
  258. package/types/canonical/commentary.types.d.ts +42 -0
  259. package/types/canonical/commentary.types.d.ts.map +1 -0
  260. package/types/canonical/event.types.d.ts +31 -0
  261. package/types/canonical/event.types.d.ts.map +1 -0
  262. package/types/canonical/index.d.ts +17 -0
  263. package/types/canonical/index.d.ts.map +1 -0
  264. package/types/canonical/lineup.types.d.ts +33 -0
  265. package/types/canonical/lineup.types.d.ts.map +1 -0
  266. package/types/canonical/match.types.d.ts +153 -0
  267. package/types/canonical/match.types.d.ts.map +1 -0
  268. package/types/canonical/odds.types.d.ts +73 -0
  269. package/types/canonical/odds.types.d.ts.map +1 -0
  270. package/types/canonical/search.types.d.ts +101 -0
  271. package/types/canonical/search.types.d.ts.map +1 -0
  272. package/types/canonical/sports-search.types.d.ts +151 -0
  273. package/types/canonical/sports-search.types.d.ts.map +1 -0
  274. package/types/canonical/squad.types.d.ts +30 -0
  275. package/types/canonical/squad.types.d.ts.map +1 -0
  276. package/types/canonical/standing.types.d.ts +85 -0
  277. package/types/canonical/standing.types.d.ts.map +1 -0
  278. package/types/canonical/statistics.types.d.ts +81 -0
  279. package/types/canonical/statistics.types.d.ts.map +1 -0
  280. package/types/index.d.ts +10 -0
  281. package/types/index.d.ts.map +1 -0
  282. package/utilities/stats/core/helpers.d.ts +65 -0
  283. package/utilities/stats/core/helpers.d.ts.map +1 -0
  284. package/utilities/stats/core/index.d.ts +7 -0
  285. package/utilities/stats/core/index.d.ts.map +1 -0
  286. package/utilities/stats/core/types.d.ts +39 -0
  287. package/utilities/stats/core/types.d.ts.map +1 -0
  288. package/utilities/stats/index.d.ts +27 -0
  289. package/utilities/stats/index.d.ts.map +1 -0
  290. package/utilities/stats/match/headToHead.d.ts +73 -0
  291. package/utilities/stats/match/headToHead.d.ts.map +1 -0
  292. package/utilities/stats/match/homeVsAway.d.ts +30 -0
  293. package/utilities/stats/match/homeVsAway.d.ts.map +1 -0
  294. package/utilities/stats/match/index.d.ts +8 -0
  295. package/utilities/stats/match/index.d.ts.map +1 -0
  296. package/utilities/stats/match/overUnder.d.ts +59 -0
  297. package/utilities/stats/match/overUnder.d.ts.map +1 -0
  298. package/utilities/stats/match/result.d.ts +13 -0
  299. package/utilities/stats/match/result.d.ts.map +1 -0
  300. package/utilities/stats/team/commonOpponents.d.ts +28 -0
  301. package/utilities/stats/team/commonOpponents.d.ts.map +1 -0
  302. package/utilities/stats/team/goalStats.d.ts +42 -0
  303. package/utilities/stats/team/goalStats.d.ts.map +1 -0
  304. package/utilities/stats/team/index.d.ts +7 -0
  305. package/utilities/stats/team/index.d.ts.map +1 -0
  306. package/utilities/stats/team/streaks.d.ts +48 -0
  307. package/utilities/stats/team/streaks.d.ts.map +1 -0
  308. package/vite.svg +1 -0
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Statistics FUSports types
3
+ */
4
+ /**
5
+ * Match period for statistics breakdown
6
+ */
7
+ export type FUSportsMatchPeriod = "FULL_TIME" | "FIRST_HALF" | "SECOND_HALF" | "EXTRA_TIME";
8
+ /**
9
+ * Single statistic entry - generic key-value pair with display metadata
10
+ */
11
+ export interface FUSportsStatisticEntry {
12
+ key: string;
13
+ value: string;
14
+ label: string;
15
+ unit?: string;
16
+ period?: FUSportsMatchPeriod;
17
+ }
18
+ /**
19
+ * Competitor statistics in a match - sport-agnostic array of stats
20
+ */
21
+ export interface FUSportsCompetitorStatistics {
22
+ competitorId: string;
23
+ statistics: FUSportsStatisticEntry[];
24
+ }
25
+ /**
26
+ * Match statistics for both competitors
27
+ */
28
+ export interface FUSportsMatchStatistics {
29
+ competitorOne: FUSportsCompetitorStatistics;
30
+ competitorTwo: FUSportsCompetitorStatistics;
31
+ }
32
+ /**
33
+ * Individual statistic entry for a player
34
+ */
35
+ export interface FUSportsPlayerStatistic {
36
+ name: string;
37
+ value: string | number;
38
+ }
39
+ /**
40
+ * Player seasonal statistics
41
+ */
42
+ export interface FUSportsPlayerSeasonStatistics {
43
+ playerId: string;
44
+ seasonId: string;
45
+ teamId: string;
46
+ appearances?: number;
47
+ started?: number;
48
+ substituteIn?: number;
49
+ substituteOut?: number;
50
+ minutes?: number;
51
+ minutesSubstitute?: number;
52
+ goals?: number;
53
+ goalsSubstitute?: number;
54
+ penaltyGoals?: number;
55
+ ownGoals?: number;
56
+ assists?: number;
57
+ shots?: number;
58
+ shotsOnTarget?: number;
59
+ yellowCards?: number;
60
+ redCards?: number;
61
+ foulsCommitted?: number;
62
+ penaltiesCommitted?: number;
63
+ penaltiesMissed?: number;
64
+ cleansheets?: number;
65
+ saves?: number;
66
+ conceded?: number;
67
+ caughtBall?: number;
68
+ penaltiesReceived?: number;
69
+ offsides?: number;
70
+ rawStatistics?: FUSportsPlayerStatistic[];
71
+ }
72
+ /**
73
+ * Team seasonal statistics - aggregate stats for a team in a season
74
+ */
75
+ export interface FUSportsTeamSeasonStatistics {
76
+ teamId: string;
77
+ teamName: string;
78
+ seasonId: string;
79
+ statistics: FUSportsStatisticEntry[];
80
+ }
81
+ //# sourceMappingURL=statistics.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/canonical/statistics.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAE5F;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,aAAa,EAAE,4BAA4B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AAMD;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,sBAAsB,EAAE,CAAC;CACxC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Type definitions for fansunited-data-layer
3
+ */
4
+ export type { RawAsset, RawAssets, RawCountry, RawCity, RawVenueProfile, RawVenue, RawMatchVenue, RawTournament, RawSeason, RawGroup, RawStage, RawRound, RawCompetitionCountry, RawCompetition, RawPartialPlayer, RawTeamScore, RawScore, RawFormMatchStatus, RawFormMatchResult, RawFormMatchParticipant, RawFormMatch, ApiError, } from "../api/sportal365-sports/shared/types";
5
+ export type { RawTeamSocial, RawCoach, RawShirtColor, RawTeamProfile, GetFootballTeamOptions, } from "../api/sportal365-sports/football/teams/team.types";
6
+ export type { RawMatchStatusType, RawMatchStatus, RawMatchTeam, RawMatchEventTypeCode, RawMatchEvent, RawMatchReferee, RawMatchWinnerReason, RawMatchOrAggregateWinner, RawMatchWinner, RawMatchMinute, RawMatchOdd, RawMatchCoverage, RawLineupStatus, RawMatch, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, GetFootballMatchOptions, } from "../api/sportal365-sports/football/matches/types";
7
+ export type { RawFootballStandingTeam, RawFootballEventStatus, RawFootballFormEvent, RawFootballFormEntry, RawFootballStandingRule, RawFootballStandingEntry, RawFootballStandingsResponse, } from "../api/sportal365-sports/football/standings";
8
+ export type { FUSportsCountry, FUSportsCity, FUSportsCompetitor, FUSportsCompetitorBase, FUSportsTeamCompetitor, FUSportsPlayerCompetitor, FUSportsPairCompetitor, FUSportsShirtColor, FUSportsCompetition, FUSportsVenue, FUSportsOfficial, FUSportsMember, FUSportsMatchMember, FUSportsCoach, FUSportsSocials, FUBranding, FUSportsSeason, FUSportsRound, FUSportsStage, FUSportsSeasonDetails, FUSportsMatchScore, FUSportsMatchStatus, FUSportsMatchTiming, FUSportsMatchWinner, FUSportsMatch, FUSportsMatchSimple, FUSportsFootballEventType, FUSportsOtherEventType, FUSportsMatchEvent, FUSportsLineupMember, FUSportsCompetitorLineup, FUSportsMatchLineups, FUSportsStatisticEntry, FUSportsCompetitorStatistics, FUSportsMatchStatistics, FUSportsPlayerStatistic, FUSportsPlayerSeasonStatistics, FUSportsBettingOperatorBranding, FUSportsBettingOperator, FUSportsOddSelection, FUSportsMarketPeriod, FUSportsMarketType, FUSportsOddMarket, FUSportsBettingOperatorOdds, FUSportsMatchOdds, FUSportsCommentaryDetail, FUSportsCommentaryMeta, FUSportsCommentaryItem, FUSportsStandingEntry, FUSportsCompetitorForm, FUSportsStandingLegendItem, FUSportsStandingsMetadata, FUSportsStandings, FUSportsSquadMember, FUSportsSquad, FUSportsSearchResultBase, FUSportsTournamentSearchResult, FUSportsPlayerSearchResult, FUSportsTeamSearchResult, FUSportsPresidentSearchResult, FUSportsVenueSearchResult, FUSportsCoachSearchResult, FUSportsSearchResult, FUSportsSearchResults, FUSportsTranslation, FUSportsDisplayAsset, FUSportsSportsSearchResultBase, FUSportsSportsSearchCountry, FUSportsTeamSportsSearchResult, FUSportsCitySportsSearchResult, FUSportsHorseSportsSearchResult, FUSportsPlayerSportsSearchResult, FUSportsCoachSportsSearchResult, FUSportsRefereeSportsSearchResult, FUSportsVenueSportsSearchResult, FUSportsTournamentSportsSearchResult, FUSportsMatchSportsSearchResult, FUSportsCountrySportsSearchResult, FUSportsSportsSearchResult, FUSportsSportsSearchResults, } from "./canonical";
9
+ export type { DataLayerConfig, Sportal365SportsConfig } from "../config/types";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAER,QAAQ,EACR,SAAS,EAET,UAAU,EACV,OAAO,EACP,eAAe,EACf,QAAQ,EACR,aAAa,EAEb,aAAa,EACb,SA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,EAE9B,+BAA+B,EAC/B,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EAEjB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EAEtB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,iBAAiB,EAEjB,mBAAmB,EACnB,aAAa,EAEb,wBAAwB,EACxB,8BAA8B,EAC9B,0BAA0B,EAC1B,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EAErB,mBAAmB,EACnB,oBAAoB,EACpB,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,+BAA+B,EAC/B,gCAAgC,EAChC,+BAA+B,EAC/B,iCAAiC,EACjC,+BAA+B,EAC/B,oCAAoC,EACpC,+BAA+B,EAC/B,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,GAC9B,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Shared calculation helper functions.
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ import type { MatchAnalysis } from "./types";
6
+ /**
7
+ * Calculate percentage from count and total.
8
+ * @returns Percentage value (0-100)
9
+ */
10
+ export declare function calcPercentage(count: number, total: number): number;
11
+ /**
12
+ * Calculate average from sum and count.
13
+ */
14
+ export declare function calcAverage(sum: number, count: number): number;
15
+ /**
16
+ * Format a number as a display value.
17
+ * @param value - The numeric value to format
18
+ * @param isPercentage - If true, appends % symbol
19
+ * @param decimals - Number of decimal places (default: 2)
20
+ */
21
+ export declare function formatStatValue(value: number, isPercentage?: boolean, decimals?: number): string;
22
+ /**
23
+ * Format stats with total and average per match.
24
+ * @example formatWithAverage(10, 5) => "10 (2.0 avg)"
25
+ */
26
+ export declare function formatWithAverage(total: string | number, matchesPlayed: number): string;
27
+ /**
28
+ * Format stats as average only.
29
+ * @example formatAsAverage(10, 5) => "2.0"
30
+ */
31
+ export declare function formatAsAverage(total: string | number, matchesPlayed: number): string;
32
+ /**
33
+ * Format possession percentage with % symbol.
34
+ */
35
+ export declare function formatPossessionPercentage(value: string): string;
36
+ /**
37
+ * Analyze a match from a team's perspective.
38
+ * @returns MatchAnalysis or null if match is not finished
39
+ */
40
+ export declare function analyzeMatch(match: FUSportsMatch, _teamId: string, isHome: boolean): MatchAnalysis | null;
41
+ /**
42
+ * Check if a team is the home team in a match.
43
+ */
44
+ export declare function isTeamHome(match: FUSportsMatch, teamId: string): boolean;
45
+ /**
46
+ * Check if a team is the away team in a match.
47
+ */
48
+ export declare function isTeamAway(match: FUSportsMatch, teamId: string): boolean;
49
+ /**
50
+ * Check if a team participates in a match.
51
+ */
52
+ export declare function isTeamInMatch(match: FUSportsMatch, teamId: string): boolean;
53
+ /**
54
+ * Check if a match is finished.
55
+ */
56
+ export declare function isMatchFinished(match: FUSportsMatch): boolean;
57
+ /**
58
+ * Get team's score from a match.
59
+ */
60
+ export declare function getTeamScore(match: FUSportsMatch, teamId: string): number;
61
+ /**
62
+ * Get opponent's score from a match.
63
+ */
64
+ export declare function getOpponentScore(match: FUSportsMatch, teamId: string): number;
65
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/core/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;GAEG;AACH,wBAAg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
+ * Core statistics utilities - shared helpers, types, and constants.
3
+ */
4
+ export type { MatchAnalysis, MatchResult, MatchFilter, VenueFilter } from "./types";
5
+ export { GOAL_EVENT_TYPES } from "./types";
6
+ export { calcPercentage, calcAverage, formatStatValue, formatWithAverage, formatAsAverage, formatPossessionPercentage, analyzeMatch, isTeamHome, isTeamAway, isTeamInMatch, isMatchFinished, getTeamScore, getOpponentScore, } from "./helpers";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/core/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EACH,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,gBAAgB,GACnB,MAAM,WAAW,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Shared types for statistics calculations.
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ /**
6
+ * Analyzed match data from a team's perspective.
7
+ */
8
+ export interface MatchAnalysis {
9
+ goalsFor: number;
10
+ goalsAgainst: number;
11
+ halfTimeGoalsFor: number | null;
12
+ halfTimeGoalsAgainst: number | null;
13
+ cornersFor: number | null;
14
+ cornersAgainst: number | null;
15
+ isWin: boolean;
16
+ isDraw: boolean;
17
+ isLoss: boolean;
18
+ }
19
+ /**
20
+ * Match result from a team's perspective.
21
+ */
22
+ export interface MatchResult {
23
+ score: string;
24
+ result: "W" | "D" | "L";
25
+ isHome: boolean;
26
+ }
27
+ /**
28
+ * Filter function type for match filtering.
29
+ */
30
+ export type MatchFilter = (match: FUSportsMatch, teamId: string, isHome: boolean) => boolean;
31
+ /**
32
+ * Venue filter type.
33
+ */
34
+ export type VenueFilter = "home" | "away";
35
+ /**
36
+ * Goal event types that count as a goal.
37
+ */
38
+ export declare const GOAL_EVENT_TYPES: readonly ["GOAL", "PENALTY_GOAL", "OWN_GOAL"];
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;AAE7F;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,gBAAgB,+CAAgD,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Statistics utilities for sports data analysis.
3
+ *
4
+ * This module provides comprehensive statistics calculations for:
5
+ * - Match analysis (H2H, Home vs Away, Over/Under)
6
+ * - Team performance (streaks, goal stats, common opponents)
7
+ * - Core helpers and types
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { calculateH2HStats, calculateHomeVsAwayStats } from 'fansunited-data-layer/stats';
12
+ *
13
+ * const h2hStats = calculateH2HStats(matches, homeTeamId, awayTeamId);
14
+ * const homeStats = calculateHomeVsAwayStats(matches, teamId, 'home');
15
+ * ```
16
+ */
17
+ export type { MatchAnalysis, MatchResult, MatchFilter, VenueFilter } from "./core";
18
+ export { GOAL_EVENT_TYPES } from "./core";
19
+ export { calcPercentage, calcAverage, formatStatValue, formatWithAverage, formatAsAverage, formatPossessionPercentage, analyzeMatch, isTeamHome, isTeamAway, isTeamInMatch, isMatchFinished, getTeamScore, getOpponentScore, } from "./core";
20
+ export { calculateH2HStats, getRecentH2HMeetings, type H2HStats, type H2HMatch } from "./match";
21
+ export { getTeamHomeAwayStats, type HomeVsAwayStats } from "./match";
22
+ export { getTeamOverUnderStats, type TeamOverUnderStats } from "./match";
23
+ export { getMatchResult } from "./match";
24
+ export { getTeamGoalStats, type TeamGoalStats, type GoalStatRow } from "./team";
25
+ export { calculateStreak, getTeamStreaks, getTeamStreaksComparison, streakFilters, type StreakData, type StreakRow, } from "./team";
26
+ export { getTeamsCommonOpponents, type TeamOpponentResults, type TeamsResultsRow } from "./team";
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utilities/stats/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EACH,cAAc,EACd,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,gBAAgB,GACnB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAChF,OAAO,EACH,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,uBAAuB,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Head-to-head statistics calculations between two teams.
3
+ *
4
+ * Note: To fetch H2H matches from the API, use `getFootballMatches` with both team IDs:
5
+ *
6
+ * ```typescript
7
+ * import { getFootballMatches } from 'fansunited-data-layer';
8
+ *
9
+ * const h2hMatches = await getFootballMatches({
10
+ * teamIds: [homeTeamId, awayTeamId],
11
+ * teamIdsOperator: 'AND',
12
+ * statusTypes: ['FINISHED'],
13
+ * sortDirection: 'desc',
14
+ * limit: 50,
15
+ * offset: 0
16
+ * });
17
+ *
18
+ * const stats = calculateH2HStats(h2hMatches, homeTeamId, awayTeamId);
19
+ * ```
20
+ */
21
+ import type { FUSportsMatch } from "../../../types/canonical";
22
+ export interface H2HStats {
23
+ totalMatches: number;
24
+ homeTeamWins: number;
25
+ awayTeamWins: number;
26
+ draws: number;
27
+ homeTeamGoals: number;
28
+ awayTeamGoals: number;
29
+ homeTeamWinPercentage: number;
30
+ awayTeamWinPercentage: number;
31
+ drawPercentage: number;
32
+ homeTeamAvgGoals: number;
33
+ awayTeamAvgGoals: number;
34
+ }
35
+ export interface H2HMatch {
36
+ id: string;
37
+ date: string;
38
+ homeTeamName: string;
39
+ awayTeamName: string;
40
+ homeTeamLogo?: string;
41
+ awayTeamLogo?: string;
42
+ homeScore: number;
43
+ awayScore: number;
44
+ venue?: string;
45
+ /** Which team won from perspective of the two teams we're comparing */
46
+ winner: "home" | "away" | "draw";
47
+ }
48
+ /**
49
+ * Calculate H2H statistics between two teams from an array of matches.
50
+ *
51
+ * The matches array should contain only matches between these two teams.
52
+ * Use `getFootballMatches` with `teamIds` and `teamIdsOperator: 'AND'` to fetch H2H matches.
53
+ *
54
+ * @param matches - Array of matches between the two teams (fetch using getFootballMatches)
55
+ * @param homeTeamId - ID of the home team in the current context
56
+ * @param awayTeamId - ID of the away team in the current context
57
+ * @returns H2H statistics
58
+ */
59
+ export declare function calculateH2HStats(matches: FUSportsMatch[], homeTeamId: string, awayTeamId: string): H2HStats;
60
+ /**
61
+ * Get formatted list of recent H2H meetings.
62
+ *
63
+ * The matches array should contain only matches between these two teams.
64
+ * Use `getFootballMatches` with `teamIds` and `teamIdsOperator: 'AND'` to fetch H2H matches.
65
+ *
66
+ * @param matches - Array of matches between the two teams (fetch using getFootballMatches)
67
+ * @param homeTeamId - ID of the home team in the current context
68
+ * @param awayTeamId - ID of the away team in the current context (used for determining winner perspective)
69
+ * @param limit - Maximum number of recent meetings to return
70
+ * @returns Array of formatted H2H matches
71
+ */
72
+ export declare function getRecentH2HMeetings(matches: FUSportsMatch[], homeTeamId: string, awayTeamId: string, limit?: number): H2HMatch[];
73
+ //# sourceMappingURL=headToHead.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headToHead.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/match/head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Away statistics calculations.
3
+ * Compares the home team's home performance against the away team's away performance.
4
+ */
5
+ import type { FUSportsMatch } from "../../../types/canonical";
6
+ import type { VenueFilter } from "../core/types";
7
+ export interface HomeVsAwayStats {
8
+ played: number;
9
+ goalsForPerMatch: number;
10
+ cleanSheets: number;
11
+ wonToNil: number;
12
+ scoringRate: number;
13
+ scoredInBothHalves: number;
14
+ scoredFirst: number;
15
+ leadingAtHalfTime: number;
16
+ goalsAgainstPerMatch: number;
17
+ failedToScore: number;
18
+ lostToNil: number;
19
+ concedingRate: number;
20
+ concededInBothHalves: number;
21
+ concededFirst: number;
22
+ losingAtHalfTime: number;
23
+ avgCornersFor: number;
24
+ avgCornersAgainst: number;
25
+ }
26
+ /**
27
+ * Get Home vs Away stats for a team.
28
+ */
29
+ export declare function getTeamHomeAwayStats(matches: FUSportsMatch[], teamId: string, filterType: VenueFilter): HomeVsAwayStats;
30
+ //# sourceMappingURL=homeVsAway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homeVsAway.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/match/homeVsAway.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAIhE,MAAM,WAAW,eAAe;IAE5B,MAAM,EAAE,MAAM,CAAC;IAGf,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAgHD;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,aAAa,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,GACxB,eAAe,CAuGjB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Match statistics module - H2H, Home/Away, Over/Under calculations.
3
+ */
4
+ export { calculateH2HStats, getRecentH2HMeetings, type H2HStats, type H2HMatch } from "./headToHead";
5
+ export { getTeamHomeAwayStats, type HomeVsAwayStats } from "./homeVsAway";
6
+ export { getTeamOverUnderStats, type TeamOverUnderStats } from "./overUnder";
7
+ export { getMatchResult } from "./result";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/match/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGrG,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAG1E,OAAO,EAAE,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Over/Under goal threshold statistics calculations.
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ /**
6
+ * Over/Under statistics for a team.
7
+ */
8
+ export interface TeamOverUnderStats {
9
+ over05: {
10
+ home: number;
11
+ total: number;
12
+ away: number;
13
+ };
14
+ over15: {
15
+ home: number;
16
+ total: number;
17
+ away: number;
18
+ };
19
+ over25: {
20
+ home: number;
21
+ total: number;
22
+ away: number;
23
+ };
24
+ over35: {
25
+ home: number;
26
+ total: number;
27
+ away: number;
28
+ };
29
+ over45: {
30
+ home: number;
31
+ total: number;
32
+ away: number;
33
+ };
34
+ over55: {
35
+ home: number;
36
+ total: number;
37
+ away: number;
38
+ };
39
+ over05HT: {
40
+ home: number;
41
+ total: number;
42
+ away: number;
43
+ };
44
+ over15HT: {
45
+ home: number;
46
+ total: number;
47
+ away: number;
48
+ };
49
+ over25HT: {
50
+ home: number;
51
+ total: number;
52
+ away: number;
53
+ };
54
+ }
55
+ /**
56
+ * Calculate over/under statistics for a team from match data.
57
+ */
58
+ export declare function getTeamOverUnderStats(matches: FUSportsMatch[], teamId: string): TeamOverUnderStats;
59
+ //# sourceMappingURL=overUnder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overUnder.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/match/overUnder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAE/B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtD,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D;AAqDD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,kBAAkB,CA8DlG"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Match result calculation utilities.
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ import type { MatchResult } from "../core/types";
6
+ /**
7
+ * Get match result from a team's perspective.
8
+ */
9
+ export declare function getMatchResult(match: FUSportsMatch, teamId: string): {
10
+ result: MatchResult;
11
+ isHome: boolean;
12
+ } | null;
13
+ //# sourceMappingURL=result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/match/result.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAwBpH"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Common opponents analysis - how two teams performed against shared opponents.
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ import type { MatchResult } from "../core/types";
6
+ export interface TeamOpponentResults {
7
+ opponentId: string;
8
+ opponentName: string;
9
+ opponentLogo?: string;
10
+ homeResult?: MatchResult;
11
+ awayResult?: MatchResult;
12
+ }
13
+ export interface TeamsResultsRow {
14
+ opponentId: string;
15
+ opponentName: string;
16
+ opponentLogo?: string;
17
+ homeTeamHome?: MatchResult;
18
+ homeTeamAway?: MatchResult;
19
+ awayTeamHome?: MatchResult;
20
+ awayTeamAway?: MatchResult;
21
+ isHomeTeamRow: boolean;
22
+ isAwayTeamRow: boolean;
23
+ }
24
+ /**
25
+ * Get teams common opponents comparison.
26
+ */
27
+ export declare function getTeamsCommonOpponents(matches: FUSportsMatch[], homeTeamId: string, awayTeamId: string, homeTeamName: string, awayTeamName: string, homeTeamLogo?: string, awayTeamLogo?: string): TeamsResultsRow[];
28
+ //# sourceMappingURL=commonOpponents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonOpponents.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/team/commonOpponents.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,YAAY,CAAC,EAAE,WAAW,CAAC;IAE3B,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,YAAY,CAAC,EAAE,WAAW,CAAC;IAE3B,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAoCD;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,aAAa,EAAE,EACxB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,MAAM,GACtB,eAAe,EAAE,CA0DnB"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Team goal statistics from standings data.
3
+ */
4
+ import type { FUSportsStandings } from "../../../types/canonical";
5
+ export interface TeamGoalStats {
6
+ homeGoals: number;
7
+ totalGoals: number;
8
+ awayGoals: number;
9
+ homeGamesPlayed: number;
10
+ awayGamesPlayed: number;
11
+ totalGamesPlayed: number;
12
+ homeGoalsConceded: number;
13
+ totalGoalsConceded: number;
14
+ awayGoalsConceded: number;
15
+ gfPerMatch: number;
16
+ gaPerMatch: number;
17
+ gfGaPerMatch: number;
18
+ homeGfPerMatch: number;
19
+ awayGfPerMatch: number;
20
+ homeGaPerMatch: number;
21
+ awayGaPerMatch: number;
22
+ homeGfGaPerMatch: number;
23
+ awayGfGaPerMatch: number;
24
+ }
25
+ /**
26
+ * Goal stat row definition for the comparison table.
27
+ */
28
+ export interface GoalStatRow {
29
+ id: string;
30
+ label: string;
31
+ homeTeamHomeValue: string | number;
32
+ homeTeamTotalValue: string | number;
33
+ awayTeamTotalValue: string | number;
34
+ awayTeamAwayValue: string | number;
35
+ highlightType?: "positive" | "negative" | "neutral";
36
+ }
37
+ /**
38
+ * Get team goal stats from standings data.
39
+ * Uses separate offence standings (for goals scored) and defence standings (for goals conceded).
40
+ */
41
+ export declare function getTeamGoalStats(teamId: string, overallStandings: FUSportsStandings | undefined, homeOffenceStandings: FUSportsStandings | undefined, awayOffenceStandings: FUSportsStandings | undefined, homeDefenceStandings: FUSportsStandings | undefined, awayDefenceStandings: FUSportsStandings | undefined): TeamGoalStats | null;
42
+ //# sourceMappingURL=goalStats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goalStats.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/team/goalStats.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,WAAW,aAAa;IAE1B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAG1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAGrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAGvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC,aAAa,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CACvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,iBAAiB,GAAG,SAAS,EAC/C,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,EACnD,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,EACnD,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,EACnD,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,GACpD,aAAa,GAAG,IAAI,CAyDtB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Team statistics module - goal stats, streaks, common opponents.
3
+ */
4
+ export { getTeamGoalStats, type TeamGoalStats, type GoalStatRow } from "./goalStats";
5
+ export { calculateStreak, getTeamStreaks, getTeamStreaksComparison, streakFilters, type StreakData, type StreakRow, } from "./streaks";
6
+ export { getTeamsCommonOpponents, type TeamOpponentResults, type TeamsResultsRow } from "./commonOpponents";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/team/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAGrF,OAAO,EACH,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,aAAa,EACb,KAAK,UAAU,EACf,KAAK,SAAS,GACjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,uBAAuB,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Team streak calculations (consecutive results).
3
+ */
4
+ import type { FUSportsMatch } from "../../../types/canonical";
5
+ import type { MatchFilter, VenueFilter } from "../core/types";
6
+ export interface StreakData {
7
+ home: number | null;
8
+ total: number | null;
9
+ }
10
+ export interface StreakRow {
11
+ label: string;
12
+ homeTeam: StreakData;
13
+ awayTeam: StreakData;
14
+ colorType: "positive" | "negative" | "neutral";
15
+ }
16
+ /**
17
+ * Calculate streak for a team based on a filter condition.
18
+ * Returns how many consecutive recent matches satisfy the condition.
19
+ */
20
+ export declare function calculateStreak(matches: FUSportsMatch[], teamId: string, filter: MatchFilter, venueFilter?: VenueFilter): number | null;
21
+ /**
22
+ * Predefined streak filter functions.
23
+ */
24
+ export declare const streakFilters: {
25
+ win: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
26
+ draw: (m: FUSportsMatch) => boolean;
27
+ loss: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
28
+ noWin: (m: FUSportsMatch, teamId: string, isHome: boolean) => boolean;
29
+ noDraw: (m: FUSportsMatch) => boolean;
30
+ noDefeat: (m: FUSportsMatch, teamId: string, isHome: boolean) => boolean;
31
+ scored: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
32
+ conceded: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
33
+ noGoalScored: (m: FUSportsMatch, teamId: string, isHome: boolean) => boolean;
34
+ noGoalConceded: (m: FUSportsMatch, teamId: string, isHome: boolean) => boolean;
35
+ over25: (m: FUSportsMatch) => boolean;
36
+ under25: (m: FUSportsMatch) => boolean;
37
+ scoredTwice: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
38
+ concededTwice: (m: FUSportsMatch, _teamId: string, isHome: boolean) => boolean;
39
+ };
40
+ /**
41
+ * Get all streaks for a team.
42
+ */
43
+ export declare function getTeamStreaks(matches: FUSportsMatch[], teamId: string, venueFilter?: VenueFilter): Record<string, number | null>;
44
+ /**
45
+ * Get team streaks comparison for two teams.
46
+ */
47
+ export declare function getTeamStreaksComparison(matches: FUSportsMatch[], homeTeamId: string, awayTeamId: string): StreakRow[];
48
+ //# sourceMappingURL=streaks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaks.d.ts","sourceRoot":"","sources":["../../../../src/lib/utilities/stats/team/streaks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;CAClD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC3B,OAAO,EAAE,aAAa,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,WAAW,CAAC,EAAE,WAAW,GAC1B,MAAM,GAAG,IAAI,CA0Bf;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;aACb,aAAa,WAAW,MAAM,UAAU,OAAO;cAK9C,aAAa;cAGb,aAAa,WAAW,MAAM,UAAU,OAAO;eAK9C,aAAa,UAAU,MAAM,UAAU,OAAO;gBAC7C,aAAa;kBACX,aAAa,UAAU,MAAM,UAAU,OAAO;gBAChD,aAAa,WAAW,MAAM,UAAU,OAAO;kBAI7C,aAAa,WAAW,MAAM,UAAU,OAAO;sBAI3C,aAAa,UAAU,MAAM,UAAU,OAAO;wBAC5C,aAAa,UAAU,MAAM,UAAU,OAAO;gBACtD,aAAa;iBAIZ,aAAa;qBAIT,aAAa,WAAW,MAAM,UAAU,OAAO;uBAI7C,aAAa,WAAW,MAAM,UAAU,OAAO;CAIrE,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,aAAa,EAAE,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,WAAW,GAC1B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAiB/B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,aAAa,EAAE,EACxB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACnB,SAAS,EAAE,CA+Fb"}
package/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>