be-components 7.4.7 → 7.5.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 (596) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +4 -0
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/BetRouter/api/index.js +884 -0
  4. package/lib/commonjs/BetRouter/api/index.js.map +1 -0
  5. package/lib/commonjs/BetRouter/api/types.js +2 -0
  6. package/lib/commonjs/BetRouter/api/types.js.map +1 -0
  7. package/lib/commonjs/BetRouter/components/AccountManager.js +592 -0
  8. package/lib/commonjs/BetRouter/components/AccountManager.js.map +1 -0
  9. package/lib/commonjs/BetRouter/components/AdminPortal.js +51 -0
  10. package/lib/commonjs/BetRouter/components/AdminPortal.js.map +1 -0
  11. package/lib/commonjs/BetRouter/components/BuyOpportunities.js +550 -0
  12. package/lib/commonjs/BetRouter/components/BuyOpportunities.js.map +1 -0
  13. package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js +320 -0
  14. package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js.map +1 -0
  15. package/lib/commonjs/BetRouter/components/ContestLiquidity.js +666 -0
  16. package/lib/commonjs/BetRouter/components/ContestLiquidity.js.map +1 -0
  17. package/lib/commonjs/BetRouter/components/ContestSelector.js +193 -0
  18. package/lib/commonjs/BetRouter/components/ContestSelector.js.map +1 -0
  19. package/lib/commonjs/BetRouter/components/MyOpportunities.js +332 -0
  20. package/lib/commonjs/BetRouter/components/MyOpportunities.js.map +1 -0
  21. package/lib/commonjs/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  22. package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js +545 -0
  23. package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js.map +1 -0
  24. package/lib/commonjs/BetRouter/components/OpportunityHistory.js +489 -0
  25. package/lib/commonjs/BetRouter/components/OpportunityHistory.js.map +1 -0
  26. package/lib/commonjs/BetRouter/components/PartnerCredentials.js +229 -0
  27. package/lib/commonjs/BetRouter/components/PartnerCredentials.js.map +1 -0
  28. package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js +262 -0
  29. package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
  30. package/lib/commonjs/BetRouter/components/admin/AutoFillView.js +380 -0
  31. package/lib/commonjs/BetRouter/components/admin/AutoFillView.js.map +1 -0
  32. package/lib/commonjs/BetRouter/components/admin/ConfigManager.js +814 -0
  33. package/lib/commonjs/BetRouter/components/admin/ConfigManager.js.map +1 -0
  34. package/lib/commonjs/BetRouter/components/admin/JobManager.js +895 -0
  35. package/lib/commonjs/BetRouter/components/admin/JobManager.js.map +1 -0
  36. package/lib/commonjs/BetRouter/components/admin/LeagueContests.js +2844 -0
  37. package/lib/commonjs/BetRouter/components/admin/LeagueContests.js.map +1 -0
  38. package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js +378 -0
  39. package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js.map +1 -0
  40. package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js +795 -0
  41. package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
  42. package/lib/commonjs/BetRouter/index.js +411 -0
  43. package/lib/commonjs/BetRouter/index.js.map +1 -0
  44. package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js +312 -0
  45. package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
  46. package/lib/commonjs/BetRouter/layouts/DesktopLayout.js +271 -0
  47. package/lib/commonjs/BetRouter/layouts/DesktopLayout.js.map +1 -0
  48. package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js +435 -0
  49. package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
  50. package/lib/commonjs/BetRouter/layouts/MobileLayout.js +293 -0
  51. package/lib/commonjs/BetRouter/layouts/MobileLayout.js.map +1 -0
  52. package/lib/commonjs/BetRouter/types/ADMIN_PORTAL.md +863 -0
  53. package/lib/commonjs/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  54. package/lib/commonjs/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  55. package/lib/commonjs/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  56. package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  57. package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  58. package/lib/commonjs/BetRouter/types/README.md +249 -0
  59. package/lib/commonjs/BetRouter/types/accounts.js +2 -0
  60. package/lib/commonjs/BetRouter/types/accounts.js.map +1 -0
  61. package/lib/commonjs/BetRouter/types/api-contracts.js +776 -0
  62. package/lib/commonjs/BetRouter/types/api-contracts.js.map +1 -0
  63. package/lib/commonjs/BetRouter/types/config.js +2 -0
  64. package/lib/commonjs/BetRouter/types/config.js.map +1 -0
  65. package/lib/commonjs/BetRouter/types/contests.js +2 -0
  66. package/lib/commonjs/BetRouter/types/contests.js.map +1 -0
  67. package/lib/commonjs/BetRouter/types/credentials.js +90 -0
  68. package/lib/commonjs/BetRouter/types/credentials.js.map +1 -0
  69. package/lib/commonjs/BetRouter/types/index.js +149 -0
  70. package/lib/commonjs/BetRouter/types/index.js.map +1 -0
  71. package/lib/commonjs/BetRouter/types/jobs.js +2 -0
  72. package/lib/commonjs/BetRouter/types/jobs.js.map +1 -0
  73. package/lib/commonjs/BetRouter/types/leagues.js +2 -0
  74. package/lib/commonjs/BetRouter/types/leagues.js.map +1 -0
  75. package/lib/commonjs/BetRouter/types/liquidity.js +2 -0
  76. package/lib/commonjs/BetRouter/types/liquidity.js.map +1 -0
  77. package/lib/commonjs/BetRouter/types/markets.js +2 -0
  78. package/lib/commonjs/BetRouter/types/markets.js.map +1 -0
  79. package/lib/commonjs/BetRouter/types/opportunities.js +6 -0
  80. package/lib/commonjs/BetRouter/types/opportunities.js.map +1 -0
  81. package/lib/commonjs/BetRouter/types/orders.js +2 -0
  82. package/lib/commonjs/BetRouter/types/orders.js.map +1 -0
  83. package/lib/commonjs/BetRouter/types/participants.js +2 -0
  84. package/lib/commonjs/BetRouter/types/participants.js.map +1 -0
  85. package/lib/commonjs/BetRouter/types/partners.js +2 -0
  86. package/lib/commonjs/BetRouter/types/partners.js.map +1 -0
  87. package/lib/commonjs/Charts/README.md +310 -0
  88. package/lib/commonjs/Charts/adapters/TradeChartAdapter.js +406 -0
  89. package/lib/commonjs/Charts/adapters/TradeChartAdapter.js.map +1 -0
  90. package/lib/commonjs/Charts/components/BaseLineChart.js +285 -0
  91. package/lib/commonjs/Charts/components/BaseLineChart.js.map +1 -0
  92. package/lib/commonjs/Charts/components/LivePriceChart.js +504 -0
  93. package/lib/commonjs/Charts/components/LivePriceChart.js.map +1 -0
  94. package/lib/commonjs/Charts/index.js +126 -0
  95. package/lib/commonjs/Charts/index.js.map +1 -0
  96. package/lib/commonjs/Charts/themes/chartTheme.js +141 -0
  97. package/lib/commonjs/Charts/themes/chartTheme.js.map +1 -0
  98. package/lib/commonjs/Charts/types.js +2 -0
  99. package/lib/commonjs/Charts/types.js.map +1 -0
  100. package/lib/commonjs/Charts/utils/formatters.js +194 -0
  101. package/lib/commonjs/Charts/utils/formatters.js.map +1 -0
  102. package/lib/commonjs/Components/Dropdown.js +5 -3
  103. package/lib/commonjs/Components/Dropdown.js.map +1 -1
  104. package/lib/commonjs/Components/Icons.js +24 -0
  105. package/lib/commonjs/Components/Icons.js.map +1 -1
  106. package/lib/commonjs/Components/index.js +34 -0
  107. package/lib/commonjs/Components/index.js.map +1 -1
  108. package/lib/commonjs/LocationTracker/LocationStatus.js +5 -2
  109. package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -1
  110. package/lib/commonjs/LocationTracker/api/index.js +2 -2
  111. package/lib/commonjs/LocationTracker/api/index.js.map +1 -1
  112. package/lib/commonjs/index.js +28 -0
  113. package/lib/commonjs/index.js.map +1 -1
  114. package/lib/commonjs/types.d.js +16 -0
  115. package/lib/commonjs/types.d.js.map +1 -1
  116. package/lib/module/ApiOverrides/index.js +4 -0
  117. package/lib/module/ApiOverrides/index.js.map +1 -1
  118. package/lib/module/BetRouter/api/index.js +873 -0
  119. package/lib/module/BetRouter/api/index.js.map +1 -0
  120. package/lib/module/BetRouter/api/types.js +2 -0
  121. package/lib/module/BetRouter/api/types.js.map +1 -0
  122. package/lib/module/BetRouter/components/AccountManager.js +584 -0
  123. package/lib/module/BetRouter/components/AccountManager.js.map +1 -0
  124. package/lib/module/BetRouter/components/AdminPortal.js +43 -0
  125. package/lib/module/BetRouter/components/AdminPortal.js.map +1 -0
  126. package/lib/module/BetRouter/components/BuyOpportunities.js +542 -0
  127. package/lib/module/BetRouter/components/BuyOpportunities.js.map +1 -0
  128. package/lib/module/BetRouter/components/BuyOpportunityCard.js +313 -0
  129. package/lib/module/BetRouter/components/BuyOpportunityCard.js.map +1 -0
  130. package/lib/module/BetRouter/components/ContestLiquidity.js +658 -0
  131. package/lib/module/BetRouter/components/ContestLiquidity.js.map +1 -0
  132. package/lib/module/BetRouter/components/ContestSelector.js +185 -0
  133. package/lib/module/BetRouter/components/ContestSelector.js.map +1 -0
  134. package/lib/module/BetRouter/components/MyOpportunities.js +324 -0
  135. package/lib/module/BetRouter/components/MyOpportunities.js.map +1 -0
  136. package/lib/module/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  137. package/lib/module/BetRouter/components/OpportunityDetailModal.js +538 -0
  138. package/lib/module/BetRouter/components/OpportunityDetailModal.js.map +1 -0
  139. package/lib/module/BetRouter/components/OpportunityHistory.js +481 -0
  140. package/lib/module/BetRouter/components/OpportunityHistory.js.map +1 -0
  141. package/lib/module/BetRouter/components/PartnerCredentials.js +222 -0
  142. package/lib/module/BetRouter/components/PartnerCredentials.js.map +1 -0
  143. package/lib/module/BetRouter/components/PlacedOpportunityModal.js +255 -0
  144. package/lib/module/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
  145. package/lib/module/BetRouter/components/admin/AutoFillView.js +372 -0
  146. package/lib/module/BetRouter/components/admin/AutoFillView.js.map +1 -0
  147. package/lib/module/BetRouter/components/admin/ConfigManager.js +806 -0
  148. package/lib/module/BetRouter/components/admin/ConfigManager.js.map +1 -0
  149. package/lib/module/BetRouter/components/admin/JobManager.js +888 -0
  150. package/lib/module/BetRouter/components/admin/JobManager.js.map +1 -0
  151. package/lib/module/BetRouter/components/admin/LeagueContests.js +2836 -0
  152. package/lib/module/BetRouter/components/admin/LeagueContests.js.map +1 -0
  153. package/lib/module/BetRouter/components/admin/LeagueInfo.js +372 -0
  154. package/lib/module/BetRouter/components/admin/LeagueInfo.js.map +1 -0
  155. package/lib/module/BetRouter/components/admin/LeagueParticipants.js +787 -0
  156. package/lib/module/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
  157. package/lib/module/BetRouter/index.js +399 -0
  158. package/lib/module/BetRouter/index.js.map +1 -0
  159. package/lib/module/BetRouter/layouts/DesktopAdminLayout.js +304 -0
  160. package/lib/module/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
  161. package/lib/module/BetRouter/layouts/DesktopLayout.js +263 -0
  162. package/lib/module/BetRouter/layouts/DesktopLayout.js.map +1 -0
  163. package/lib/module/BetRouter/layouts/MobileAdminLayout.js +427 -0
  164. package/lib/module/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
  165. package/lib/module/BetRouter/layouts/MobileLayout.js +285 -0
  166. package/lib/module/BetRouter/layouts/MobileLayout.js.map +1 -0
  167. package/lib/module/BetRouter/types/ADMIN_PORTAL.md +863 -0
  168. package/lib/module/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  169. package/lib/module/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  170. package/lib/module/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  171. package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  172. package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  173. package/lib/module/BetRouter/types/README.md +249 -0
  174. package/lib/module/BetRouter/types/accounts.js +2 -0
  175. package/lib/module/BetRouter/types/accounts.js.map +1 -0
  176. package/lib/module/BetRouter/types/api-contracts.js +770 -0
  177. package/lib/module/BetRouter/types/api-contracts.js.map +1 -0
  178. package/lib/module/BetRouter/types/config.js +2 -0
  179. package/lib/module/BetRouter/types/config.js.map +1 -0
  180. package/lib/module/BetRouter/types/contests.js +2 -0
  181. package/lib/module/BetRouter/types/contests.js.map +1 -0
  182. package/lib/module/BetRouter/types/credentials.js +78 -0
  183. package/lib/module/BetRouter/types/credentials.js.map +1 -0
  184. package/lib/module/BetRouter/types/index.js +17 -0
  185. package/lib/module/BetRouter/types/index.js.map +1 -0
  186. package/lib/module/BetRouter/types/jobs.js +2 -0
  187. package/lib/module/BetRouter/types/jobs.js.map +1 -0
  188. package/lib/module/BetRouter/types/leagues.js +2 -0
  189. package/lib/module/BetRouter/types/leagues.js.map +1 -0
  190. package/lib/module/BetRouter/types/liquidity.js +2 -0
  191. package/lib/module/BetRouter/types/liquidity.js.map +1 -0
  192. package/lib/module/BetRouter/types/markets.js +2 -0
  193. package/lib/module/BetRouter/types/markets.js.map +1 -0
  194. package/lib/module/BetRouter/types/opportunities.js +2 -0
  195. package/lib/module/BetRouter/types/opportunities.js.map +1 -0
  196. package/lib/module/BetRouter/types/orders.js +2 -0
  197. package/lib/module/BetRouter/types/orders.js.map +1 -0
  198. package/lib/module/BetRouter/types/participants.js +2 -0
  199. package/lib/module/BetRouter/types/participants.js.map +1 -0
  200. package/lib/module/BetRouter/types/partners.js +2 -0
  201. package/lib/module/BetRouter/types/partners.js.map +1 -0
  202. package/lib/module/Charts/README.md +310 -0
  203. package/lib/module/Charts/adapters/TradeChartAdapter.js +400 -0
  204. package/lib/module/Charts/adapters/TradeChartAdapter.js.map +1 -0
  205. package/lib/module/Charts/components/BaseLineChart.js +281 -0
  206. package/lib/module/Charts/components/BaseLineChart.js.map +1 -0
  207. package/lib/module/Charts/components/LivePriceChart.js +497 -0
  208. package/lib/module/Charts/components/LivePriceChart.js.map +1 -0
  209. package/lib/module/Charts/index.js +36 -0
  210. package/lib/module/Charts/index.js.map +1 -0
  211. package/lib/module/Charts/themes/chartTheme.js +134 -0
  212. package/lib/module/Charts/themes/chartTheme.js.map +1 -0
  213. package/lib/module/Charts/types.js +2 -0
  214. package/lib/module/Charts/types.js.map +1 -0
  215. package/lib/module/Charts/utils/formatters.js +178 -0
  216. package/lib/module/Charts/utils/formatters.js.map +1 -0
  217. package/lib/module/Components/Dropdown.js +5 -3
  218. package/lib/module/Components/Dropdown.js.map +1 -1
  219. package/lib/module/Components/Icons.js +24 -1
  220. package/lib/module/Components/Icons.js.map +1 -1
  221. package/lib/module/Components/index.js +3 -0
  222. package/lib/module/Components/index.js.map +1 -1
  223. package/lib/module/LocationTracker/LocationStatus.js +5 -2
  224. package/lib/module/LocationTracker/LocationStatus.js.map +1 -1
  225. package/lib/module/LocationTracker/api/index.js +2 -2
  226. package/lib/module/LocationTracker/api/index.js.map +1 -1
  227. package/lib/module/index.js +5 -1
  228. package/lib/module/index.js.map +1 -1
  229. package/lib/module/types.d.js +16 -0
  230. package/lib/module/types.d.js.map +1 -1
  231. package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
  232. package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts +109 -0
  233. package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts.map +1 -0
  234. package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts +2 -0
  235. package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts.map +1 -0
  236. package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts +16 -0
  237. package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts.map +1 -0
  238. package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts +9 -0
  239. package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts.map +1 -0
  240. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts +16 -0
  241. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  242. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
  243. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  244. package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts +11 -0
  245. package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  246. package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts +11 -0
  247. package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts.map +1 -0
  248. package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts +8 -0
  249. package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  250. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts +14 -0
  251. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  252. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts +9 -0
  253. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  254. package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts +10 -0
  255. package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  256. package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts +11 -0
  257. package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  258. package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  259. package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  260. package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  261. package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  262. package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts +4 -0
  263. package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  264. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts +7 -0
  265. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  266. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
  267. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  268. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts +6 -0
  269. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  270. package/lib/typescript/lib/commonjs/BetRouter/index.d.ts +8 -0
  271. package/lib/typescript/lib/commonjs/BetRouter/index.d.ts.map +1 -0
  272. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
  273. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  274. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts +20 -0
  275. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  276. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
  277. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  278. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts +20 -0
  279. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  280. package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts +2 -0
  281. package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts.map +1 -0
  282. package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts +743 -0
  283. package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts.map +1 -0
  284. package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts +2 -0
  285. package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts.map +1 -0
  286. package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts +2 -0
  287. package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts.map +1 -0
  288. package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts +56 -0
  289. package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts.map +1 -0
  290. package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts +2 -0
  291. package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts.map +1 -0
  292. package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts +2 -0
  293. package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts.map +1 -0
  294. package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts +2 -0
  295. package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts.map +1 -0
  296. package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts +2 -0
  297. package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts.map +1 -0
  298. package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts +2 -0
  299. package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts.map +1 -0
  300. package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts +2 -0
  301. package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts.map +1 -0
  302. package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts +2 -0
  303. package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts.map +1 -0
  304. package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts +2 -0
  305. package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts.map +1 -0
  306. package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts +2 -0
  307. package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts.map +1 -0
  308. package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts +87 -0
  309. package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  310. package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts +31 -0
  311. package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts.map +1 -0
  312. package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts +45 -0
  313. package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts.map +1 -0
  314. package/lib/typescript/lib/commonjs/Charts/index.d.ts +95 -0
  315. package/lib/typescript/lib/commonjs/Charts/index.d.ts.map +1 -0
  316. package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts +106 -0
  317. package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts.map +1 -0
  318. package/lib/typescript/lib/commonjs/Charts/types.d.ts +2 -0
  319. package/lib/typescript/lib/commonjs/Charts/types.d.ts.map +1 -0
  320. package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts +24 -0
  321. package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts.map +1 -0
  322. package/lib/typescript/lib/commonjs/Components/Dropdown.d.ts.map +1 -1
  323. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  324. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  325. package/lib/typescript/lib/commonjs/LocationTracker/LocationStatus.d.ts +2 -1
  326. package/lib/typescript/lib/commonjs/LocationTracker/LocationStatus.d.ts.map +1 -1
  327. package/lib/typescript/lib/commonjs/LocationTracker/api/index.d.ts +1 -1
  328. package/lib/typescript/lib/commonjs/LocationTracker/api/index.d.ts.map +1 -1
  329. package/lib/typescript/lib/commonjs/index.d.ts +6 -1
  330. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  331. package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
  332. package/lib/typescript/lib/module/BetRouter/api/index.d.ts +108 -0
  333. package/lib/typescript/lib/module/BetRouter/api/index.d.ts.map +1 -0
  334. package/lib/typescript/lib/module/BetRouter/api/types.d.ts +2 -0
  335. package/lib/typescript/lib/module/BetRouter/api/types.d.ts.map +1 -0
  336. package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts +16 -0
  337. package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts.map +1 -0
  338. package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts +9 -0
  339. package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts.map +1 -0
  340. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts +16 -0
  341. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  342. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
  343. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  344. package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts +11 -0
  345. package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  346. package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts +11 -0
  347. package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts.map +1 -0
  348. package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts +8 -0
  349. package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  350. package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts +15 -0
  351. package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  352. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts +9 -0
  353. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  354. package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts +11 -0
  355. package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  356. package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts +12 -0
  357. package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  358. package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  359. package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  360. package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  361. package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  362. package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts +4 -0
  363. package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  364. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts +9 -0
  365. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  366. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
  367. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  368. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
  369. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  370. package/lib/typescript/lib/module/BetRouter/index.d.ts +9 -0
  371. package/lib/typescript/lib/module/BetRouter/index.d.ts.map +1 -0
  372. package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
  373. package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  374. package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts +20 -0
  375. package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  376. package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
  377. package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  378. package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts +20 -0
  379. package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  380. package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts +2 -0
  381. package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts.map +1 -0
  382. package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts +742 -0
  383. package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts.map +1 -0
  384. package/lib/typescript/lib/module/BetRouter/types/config.d.ts +2 -0
  385. package/lib/typescript/lib/module/BetRouter/types/config.d.ts.map +1 -0
  386. package/lib/typescript/lib/module/BetRouter/types/contests.d.ts +2 -0
  387. package/lib/typescript/lib/module/BetRouter/types/contests.d.ts.map +1 -0
  388. package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts +55 -0
  389. package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts.map +1 -0
  390. package/lib/typescript/lib/module/BetRouter/types/index.d.ts +14 -0
  391. package/lib/typescript/lib/module/BetRouter/types/index.d.ts.map +1 -0
  392. package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts +2 -0
  393. package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts.map +1 -0
  394. package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts +2 -0
  395. package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts.map +1 -0
  396. package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts +2 -0
  397. package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts.map +1 -0
  398. package/lib/typescript/lib/module/BetRouter/types/markets.d.ts +2 -0
  399. package/lib/typescript/lib/module/BetRouter/types/markets.d.ts.map +1 -0
  400. package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts +2 -0
  401. package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts.map +1 -0
  402. package/lib/typescript/lib/module/BetRouter/types/orders.d.ts +2 -0
  403. package/lib/typescript/lib/module/BetRouter/types/orders.d.ts.map +1 -0
  404. package/lib/typescript/lib/module/BetRouter/types/participants.d.ts +2 -0
  405. package/lib/typescript/lib/module/BetRouter/types/participants.d.ts.map +1 -0
  406. package/lib/typescript/lib/module/BetRouter/types/partners.d.ts +2 -0
  407. package/lib/typescript/lib/module/BetRouter/types/partners.d.ts.map +1 -0
  408. package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts +81 -0
  409. package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  410. package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts +31 -0
  411. package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts.map +1 -0
  412. package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts +41 -0
  413. package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts.map +1 -0
  414. package/lib/typescript/lib/module/Charts/index.d.ts +6 -0
  415. package/lib/typescript/lib/module/Charts/index.d.ts.map +1 -0
  416. package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts +102 -0
  417. package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts.map +1 -0
  418. package/lib/typescript/lib/module/Charts/types.d.ts +2 -0
  419. package/lib/typescript/lib/module/Charts/types.d.ts.map +1 -0
  420. package/lib/typescript/lib/module/Charts/utils/formatters.d.ts +14 -0
  421. package/lib/typescript/lib/module/Charts/utils/formatters.d.ts.map +1 -0
  422. package/lib/typescript/lib/module/Components/Dropdown.d.ts.map +1 -1
  423. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  424. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  425. package/lib/typescript/lib/module/Components/index.d.ts +1 -0
  426. package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
  427. package/lib/typescript/lib/module/LocationTracker/LocationStatus.d.ts +2 -1
  428. package/lib/typescript/lib/module/LocationTracker/LocationStatus.d.ts.map +1 -1
  429. package/lib/typescript/lib/module/LocationTracker/api/index.d.ts +1 -1
  430. package/lib/typescript/lib/module/index.d.ts +3 -1
  431. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  432. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  433. package/lib/typescript/src/BetRouter/api/index.d.ts +115 -0
  434. package/lib/typescript/src/BetRouter/api/index.d.ts.map +1 -0
  435. package/lib/typescript/src/BetRouter/api/types.d.ts +2 -0
  436. package/lib/typescript/src/BetRouter/api/types.d.ts.map +1 -0
  437. package/lib/typescript/src/BetRouter/components/AccountManager.d.ts +18 -0
  438. package/lib/typescript/src/BetRouter/components/AccountManager.d.ts.map +1 -0
  439. package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts +15 -0
  440. package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts.map +1 -0
  441. package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts +24 -0
  442. package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  443. package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts +19 -0
  444. package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  445. package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts +15 -0
  446. package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  447. package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts +13 -0
  448. package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts.map +1 -0
  449. package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts +16 -0
  450. package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  451. package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts +21 -0
  452. package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  453. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts +20 -0
  454. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  455. package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts +12 -0
  456. package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  457. package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts +18 -0
  458. package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  459. package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  460. package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  461. package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  462. package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  463. package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts +4 -0
  464. package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  465. package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts +9 -0
  466. package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  467. package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts +8 -0
  468. package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  469. package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
  470. package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  471. package/lib/typescript/src/BetRouter/index.d.ts +16 -0
  472. package/lib/typescript/src/BetRouter/index.d.ts.map +1 -0
  473. package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts +15 -0
  474. package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  475. package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts +44 -0
  476. package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  477. package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts +15 -0
  478. package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  479. package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts +44 -0
  480. package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  481. package/lib/typescript/src/BetRouter/types/accounts.d.ts +19 -0
  482. package/lib/typescript/src/BetRouter/types/accounts.d.ts.map +1 -0
  483. package/lib/typescript/src/BetRouter/types/api-contracts.d.ts +1071 -0
  484. package/lib/typescript/src/BetRouter/types/api-contracts.d.ts.map +1 -0
  485. package/lib/typescript/src/BetRouter/types/config.d.ts +12 -0
  486. package/lib/typescript/src/BetRouter/types/config.d.ts.map +1 -0
  487. package/lib/typescript/src/BetRouter/types/contests.d.ts +34 -0
  488. package/lib/typescript/src/BetRouter/types/contests.d.ts.map +1 -0
  489. package/lib/typescript/src/BetRouter/types/credentials.d.ts +24 -0
  490. package/lib/typescript/src/BetRouter/types/credentials.d.ts.map +1 -0
  491. package/lib/typescript/src/BetRouter/types/index.d.ts +14 -0
  492. package/lib/typescript/src/BetRouter/types/index.d.ts.map +1 -0
  493. package/lib/typescript/src/BetRouter/types/jobs.d.ts +35 -0
  494. package/lib/typescript/src/BetRouter/types/jobs.d.ts.map +1 -0
  495. package/lib/typescript/src/BetRouter/types/leagues.d.ts +26 -0
  496. package/lib/typescript/src/BetRouter/types/leagues.d.ts.map +1 -0
  497. package/lib/typescript/src/BetRouter/types/liquidity.d.ts +14 -0
  498. package/lib/typescript/src/BetRouter/types/liquidity.d.ts.map +1 -0
  499. package/lib/typescript/src/BetRouter/types/markets.d.ts +87 -0
  500. package/lib/typescript/src/BetRouter/types/markets.d.ts.map +1 -0
  501. package/lib/typescript/src/BetRouter/types/opportunities.d.ts +88 -0
  502. package/lib/typescript/src/BetRouter/types/opportunities.d.ts.map +1 -0
  503. package/lib/typescript/src/BetRouter/types/orders.d.ts +34 -0
  504. package/lib/typescript/src/BetRouter/types/orders.d.ts.map +1 -0
  505. package/lib/typescript/src/BetRouter/types/participants.d.ts +33 -0
  506. package/lib/typescript/src/BetRouter/types/participants.d.ts.map +1 -0
  507. package/lib/typescript/src/BetRouter/types/partners.d.ts +11 -0
  508. package/lib/typescript/src/BetRouter/types/partners.d.ts.map +1 -0
  509. package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts +117 -0
  510. package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  511. package/lib/typescript/src/Charts/components/BaseLineChart.d.ts +40 -0
  512. package/lib/typescript/src/Charts/components/BaseLineChart.d.ts.map +1 -0
  513. package/lib/typescript/src/Charts/components/LivePriceChart.d.ts +13 -0
  514. package/lib/typescript/src/Charts/components/LivePriceChart.d.ts.map +1 -0
  515. package/lib/typescript/src/Charts/index.d.ts +28 -0
  516. package/lib/typescript/src/Charts/index.d.ts.map +1 -0
  517. package/lib/typescript/src/Charts/themes/chartTheme.d.ts +78 -0
  518. package/lib/typescript/src/Charts/themes/chartTheme.d.ts.map +1 -0
  519. package/lib/typescript/src/Charts/types.d.ts +155 -0
  520. package/lib/typescript/src/Charts/types.d.ts.map +1 -0
  521. package/lib/typescript/src/Charts/utils/formatters.d.ts +66 -0
  522. package/lib/typescript/src/Charts/utils/formatters.d.ts.map +1 -0
  523. package/lib/typescript/src/Components/Dropdown.d.ts.map +1 -1
  524. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  525. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  526. package/lib/typescript/src/Components/index.d.ts +1 -0
  527. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  528. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +2 -1
  529. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -1
  530. package/lib/typescript/src/LocationTracker/api/index.d.ts +3 -1
  531. package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -1
  532. package/lib/typescript/src/index.d.ts +4 -1
  533. package/lib/typescript/src/index.d.ts.map +1 -1
  534. package/package.json +4 -2
  535. package/src/ApiOverrides/index.ts +4 -0
  536. package/src/BetRouter/api/index.ts +854 -0
  537. package/src/BetRouter/api/types.ts +0 -0
  538. package/src/BetRouter/components/AccountManager.tsx +533 -0
  539. package/src/BetRouter/components/AdminPortal.tsx +44 -0
  540. package/src/BetRouter/components/BuyOpportunities.tsx +491 -0
  541. package/src/BetRouter/components/BuyOpportunityCard.tsx +331 -0
  542. package/src/BetRouter/components/ContestLiquidity.tsx +613 -0
  543. package/src/BetRouter/components/ContestSelector.tsx +179 -0
  544. package/src/BetRouter/components/MyOpportunities.tsx +279 -0
  545. package/src/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  546. package/src/BetRouter/components/OpportunityDetailModal.tsx +360 -0
  547. package/src/BetRouter/components/OpportunityHistory.tsx +408 -0
  548. package/src/BetRouter/components/PartnerCredentials.tsx +212 -0
  549. package/src/BetRouter/components/PlacedOpportunityModal.tsx +192 -0
  550. package/src/BetRouter/components/admin/AutoFillView.tsx +275 -0
  551. package/src/BetRouter/components/admin/ConfigManager.tsx +596 -0
  552. package/src/BetRouter/components/admin/JobManager.tsx +758 -0
  553. package/src/BetRouter/components/admin/LeagueContests.tsx +2443 -0
  554. package/src/BetRouter/components/admin/LeagueInfo.tsx +253 -0
  555. package/src/BetRouter/components/admin/LeagueParticipants.tsx +662 -0
  556. package/src/BetRouter/index.tsx +453 -0
  557. package/src/BetRouter/layouts/DesktopAdminLayout.tsx +348 -0
  558. package/src/BetRouter/layouts/DesktopLayout.tsx +292 -0
  559. package/src/BetRouter/layouts/MobileAdminLayout.tsx +387 -0
  560. package/src/BetRouter/layouts/MobileLayout.tsx +325 -0
  561. package/src/BetRouter/types/ADMIN_PORTAL.md +863 -0
  562. package/src/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  563. package/src/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  564. package/src/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  565. package/src/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  566. package/src/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  567. package/src/BetRouter/types/README.md +249 -0
  568. package/src/BetRouter/types/accounts.ts +21 -0
  569. package/src/BetRouter/types/api-contracts.ts +1164 -0
  570. package/src/BetRouter/types/config.ts +12 -0
  571. package/src/BetRouter/types/contests.ts +37 -0
  572. package/src/BetRouter/types/credentials.ts +99 -0
  573. package/src/BetRouter/types/index.ts +16 -0
  574. package/src/BetRouter/types/jobs.ts +37 -0
  575. package/src/BetRouter/types/leagues.ts +29 -0
  576. package/src/BetRouter/types/liquidity.ts +15 -0
  577. package/src/BetRouter/types/markets.ts +94 -0
  578. package/src/BetRouter/types/opportunities.ts +107 -0
  579. package/src/BetRouter/types/orders.ts +51 -0
  580. package/src/BetRouter/types/participants.ts +34 -0
  581. package/src/BetRouter/types/partners.ts +10 -0
  582. package/src/Charts/README.md +310 -0
  583. package/src/Charts/adapters/TradeChartAdapter.ts +471 -0
  584. package/src/Charts/components/BaseLineChart.tsx +293 -0
  585. package/src/Charts/components/LivePriceChart.tsx +521 -0
  586. package/src/Charts/index.tsx +62 -0
  587. package/src/Charts/themes/chartTheme.ts +113 -0
  588. package/src/Charts/types.ts +160 -0
  589. package/src/Charts/utils/formatters.ts +182 -0
  590. package/src/Components/Dropdown.tsx +6 -3
  591. package/src/Components/Icons.tsx +12 -0
  592. package/src/Components/index.tsx +4 -0
  593. package/src/LocationTracker/LocationStatus.tsx +4 -3
  594. package/src/LocationTracker/api/index.tsx +2 -2
  595. package/src/index.tsx +6 -0
  596. package/src/types.d.ts +410 -2
@@ -0,0 +1,2836 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { View, Text, Button } from "../../../Components/Themed";
3
+ import { ActivityIndicator, TouchableOpacity, FlatList, TextInput, ScrollView } from 'react-native';
4
+ import { useColors } from '../../../constants/useColors';
5
+ import { BetRouterApi } from '../../api';
6
+ import { Icons, SearchBox } from '../../../Components';
7
+ import Pagination from '../../../Components/Pagination';
8
+ import Switch from '../../../Components/Switch';
9
+ import moment from 'moment-mini';
10
+ const RAW_CONTESTS_PER_PAGE = 10;
11
+ const PARTICIPANTS_PER_PAGE = 10;
12
+ const LeagueContests = ({
13
+ league,
14
+ initialContestId
15
+ }) => {
16
+ const Colors = useColors();
17
+ const [contestData, setContestData] = useState({
18
+ contests: [],
19
+ partnerContests: [],
20
+ partners: [],
21
+ participants: [],
22
+ selectedContest: null,
23
+ loading: true,
24
+ loadingMarkets: false,
25
+ loadingModal: false,
26
+ searchValue: '',
27
+ currentTab: 'partners',
28
+ linkStatusFilter: 'all',
29
+ dateFilter: 'all',
30
+ customDateFrom: '',
31
+ customDateTo: '',
32
+ showLinkModal: false,
33
+ selectedPartner: null,
34
+ availableRawContests: [],
35
+ selectedRawIds: [],
36
+ rawSearchValue: '',
37
+ rawPage: 0,
38
+ showAutoLinkModal: false,
39
+ autoLinkResults: null,
40
+ showAutoLinkResults: false,
41
+ showMarketAutoLinkModal: false,
42
+ allRouterMarkets: [],
43
+ selectedMarketIds: [],
44
+ showManageMarketsModal: false,
45
+ marketContests: [],
46
+ partnerMarkets: [],
47
+ showLinkMarketsModal: false,
48
+ selectedMarketContest: null,
49
+ availableRawMarkets: [],
50
+ alreadyLinkedRawMarkets: [],
51
+ showAddVariableModal: false,
52
+ newVariableValue: '',
53
+ showInspectModal: false,
54
+ inspectPartnerMarkets: [],
55
+ marketSides: [],
56
+ marketVariables: [],
57
+ showManualLinkModal: false,
58
+ selectedRawMarket: null,
59
+ linkingData: null,
60
+ manualLinkForm: {
61
+ sideParticipants: [],
62
+ timeframe_id: '',
63
+ variable: '',
64
+ variable_type: 'spread'
65
+ },
66
+ participantSearchValue: '',
67
+ participantPage: 0,
68
+ selectedSideIndex: 0
69
+ });
70
+ useEffect(() => {
71
+ loadContestData();
72
+ }, [league.router_league_id]);
73
+
74
+ // Auto-select contest when data loads
75
+ useEffect(() => {
76
+ if (initialContestId && contestData.contests.length > 0 && !contestData.selectedContest) {
77
+ const contest = contestData.contests.find(c => c.router_contest_id === initialContestId);
78
+ if (contest) {
79
+ console.log('Auto-selecting contest:', contest);
80
+ setContestData(prev => ({
81
+ ...prev,
82
+ selectedContest: contest
83
+ }));
84
+ }
85
+ }
86
+ }, [initialContestId, contestData.contests]);
87
+ const loadContestData = async () => {
88
+ setContestData(prev => ({
89
+ ...prev,
90
+ loading: true
91
+ }));
92
+ try {
93
+ const [contestsRes, partnerContestsRes, partnersRes, participantsRes, sidesRes, variablesRes] = await Promise.all([BetRouterApi.BetRouter.ContestApi.getOpenContests(league.router_league_id, 'open'), BetRouterApi.BetRouter.ContestApi.getPartnerContests(), BetRouterApi.BetRouter.PartnerApi.getPartners(), BetRouterApi.BetRouter.ParticipantApi.getRouterParticipants(league.router_league_id),
94
+ // Load market sides and variables once - they're small and global
95
+ BetRouterApi.BetRouter.MarketApi.getMarketSides(), BetRouterApi.BetRouter.MarketApi.getMarketVariables()]);
96
+ setContestData(prev => ({
97
+ ...prev,
98
+ contests: contestsRes.router_contests || [],
99
+ partnerContests: Array.isArray(partnerContestsRes) ? partnerContestsRes : [],
100
+ partners: Array.isArray(partnersRes) ? partnersRes : [],
101
+ participants: Array.isArray(participantsRes) ? participantsRes : [],
102
+ marketSides: Array.isArray(sidesRes) ? sidesRes : [],
103
+ marketVariables: Array.isArray(variablesRes) ? variablesRes : [],
104
+ loading: false
105
+ }));
106
+ } catch (error) {
107
+ console.error('Failed to load contest data:', error);
108
+ setContestData(prev => ({
109
+ ...prev,
110
+ loading: false
111
+ }));
112
+ }
113
+ };
114
+ const loadRawContests = async partner => {
115
+ try {
116
+ setContestData(prev => ({
117
+ ...prev,
118
+ loading: true
119
+ }));
120
+ const result = await BetRouterApi.BetRouter.ContestApi.loadRawContests(partner.partner_id, league.router_league_id);
121
+ alert(`Loaded ${result.count} raw contests from ${partner.name}`);
122
+ await loadContestData(); // Reload to get updated data
123
+ } catch (error) {
124
+ console.error('Error loading raw contests:', error);
125
+ alert('Error loading raw contests: ' + error.message);
126
+ } finally {
127
+ setContestData(prev => ({
128
+ ...prev,
129
+ loading: false
130
+ }));
131
+ }
132
+ };
133
+ const openLinkModal = async (contest, partner) => {
134
+ try {
135
+ setContestData(prev => ({
136
+ ...prev,
137
+ loading: true
138
+ }));
139
+ const data = await BetRouterApi.BetRouter.ContestApi.getAvailableRawContests(contest.router_contest_id, partner.partner_id);
140
+ setContestData(prev => ({
141
+ ...prev,
142
+ availableRawContests: data.raw_contests || [],
143
+ showLinkModal: true,
144
+ selectedPartner: partner,
145
+ selectedContest: contest,
146
+ selectedRawIds: [],
147
+ rawSearchValue: '',
148
+ rawPage: 0,
149
+ loading: false
150
+ }));
151
+ } catch (error) {
152
+ console.error('Error loading raw contests:', error);
153
+ setContestData(prev => ({
154
+ ...prev,
155
+ loading: false
156
+ }));
157
+ }
158
+ };
159
+ const linkSelectedContests = async () => {
160
+ if (!contestData.selectedContest || contestData.selectedRawIds.length === 0) return;
161
+ try {
162
+ setContestData(prev => ({
163
+ ...prev,
164
+ loading: true
165
+ }));
166
+ await BetRouterApi.BetRouter.ContestApi.linkContest(contestData.selectedRawIds, contestData.selectedContest.router_contest_id);
167
+ alert(`Linked ${contestData.selectedRawIds.length} raw contests`);
168
+ setContestData(prev => ({
169
+ ...prev,
170
+ showLinkModal: false
171
+ }));
172
+ await loadContestData(); // Reload to get updated data
173
+ } catch (error) {
174
+ console.error('Error linking contests:', error);
175
+ alert('Error linking contests: ' + error.message);
176
+ } finally {
177
+ setContestData(prev => ({
178
+ ...prev,
179
+ loading: false
180
+ }));
181
+ }
182
+ };
183
+ const toggleRawContestSelection = rawContestId => {
184
+ setContestData(prev => ({
185
+ ...prev,
186
+ selectedRawIds: prev.selectedRawIds.includes(rawContestId) ? prev.selectedRawIds.filter(id => id !== rawContestId) : [...prev.selectedRawIds, rawContestId]
187
+ }));
188
+ };
189
+ const getUniquePartnerCountForContest = contestId => {
190
+ const contestPartners = contestData.partnerContests.filter(pc => pc.router_contest_id === contestId);
191
+ const uniquePartnerIds = new Set(contestPartners.map(pc => pc.partner_id));
192
+ return uniquePartnerIds.size;
193
+ };
194
+ const isPartnerLinked = (contestId, partnerId) => {
195
+ return contestData.partnerContests.some(pc => pc.router_contest_id === contestId && pc.partner_id === partnerId);
196
+ };
197
+
198
+ // Calculate link status for a contest
199
+ const getContestLinkStatus = contest => {
200
+ const linkedPartnerCount = getUniquePartnerCountForContest(contest.router_contest_id);
201
+ const totalPartners = contestData.partners.length;
202
+ if (linkedPartnerCount === 0) return 'none';
203
+ if (linkedPartnerCount === totalPartners) return 'complete';
204
+ return 'partial';
205
+ };
206
+
207
+ // Get contests by link status
208
+ const getContestsByStatus = status => {
209
+ if (status === 'all') return contestData.contests;
210
+ return contestData.contests.filter(contest => getContestLinkStatus(contest) === status);
211
+ };
212
+ const getLinkedExternalIds = (contestId, partnerId) => {
213
+ return contestData.partnerContests.filter(pc => pc.router_contest_id === contestId && pc.partner_id === partnerId).map(pc => pc.external_id);
214
+ };
215
+ const openManageMarketsModal = async contest => {
216
+ try {
217
+ setContestData(prev => ({
218
+ ...prev,
219
+ loadingModal: true
220
+ }));
221
+ const data = await BetRouterApi.BetRouter.MarketApi.getAvailableToSupport(contest.router_contest_id);
222
+ setContestData(prev => ({
223
+ ...prev,
224
+ allRouterMarkets: data.all_router_markets || [],
225
+ marketContests: data.market_contests || [],
226
+ showManageMarketsModal: true,
227
+ loadingModal: false
228
+ }));
229
+ } catch (error) {
230
+ console.error('Error loading available markets:', error);
231
+ alert('Error loading markets: ' + error.message);
232
+ setContestData(prev => ({
233
+ ...prev,
234
+ loadingModal: false
235
+ }));
236
+ }
237
+ };
238
+ const toggleMarketSupport = async routerMarketId => {
239
+ if (!contestData.selectedContest) return;
240
+ const isSupported = contestData.marketContests.some(mc => mc.router_market_id === routerMarketId);
241
+ try {
242
+ setContestData(prev => ({
243
+ ...prev,
244
+ loadingModal: true
245
+ }));
246
+ if (isSupported) {
247
+ // Remove it
248
+ const marketContest = contestData.marketContests.find(mc => mc.router_market_id === routerMarketId);
249
+ if (marketContest) {
250
+ await BetRouterApi.BetRouter.MarketApi.removeSupportedMarket(marketContest.market_contest_id);
251
+ }
252
+ } else {
253
+ // Add it
254
+ await BetRouterApi.BetRouter.MarketApi.addSupportedMarket(contestData.selectedContest.router_contest_id, routerMarketId);
255
+ }
256
+
257
+ // Reload the data
258
+ const data = await BetRouterApi.BetRouter.MarketApi.getAvailableToSupport(contestData.selectedContest.router_contest_id);
259
+ setContestData(prev => ({
260
+ ...prev,
261
+ marketContests: data.market_contests || [],
262
+ loadingModal: false
263
+ }));
264
+ } catch (error) {
265
+ console.error('Error toggling market support:', error);
266
+ alert('Error updating market: ' + error.message);
267
+ setContestData(prev => ({
268
+ ...prev,
269
+ loadingModal: false
270
+ }));
271
+ }
272
+ };
273
+ const loadSupportedMarkets = async contest => {
274
+ try {
275
+ setContestData(prev => ({
276
+ ...prev,
277
+ loadingMarkets: true
278
+ }));
279
+ const data = await BetRouterApi.BetRouter.MarketApi.getSupportedMarkets(contest.router_contest_id);
280
+
281
+ // Also load all router markets so we can display market info
282
+ const allMarketsData = await BetRouterApi.BetRouter.MarketApi.getAvailableToSupport(contest.router_contest_id);
283
+ setContestData(prev => ({
284
+ ...prev,
285
+ marketContests: data.market_contests || [],
286
+ allRouterMarkets: allMarketsData.all_router_markets || [],
287
+ loadingMarkets: false
288
+ }));
289
+ } catch (error) {
290
+ console.error('Error loading supported markets:', error);
291
+ setContestData(prev => ({
292
+ ...prev,
293
+ loadingMarkets: false
294
+ }));
295
+ }
296
+ };
297
+ const removeSupportedMarket = async (marketContestId, contest) => {
298
+ try {
299
+ setContestData(prev => ({
300
+ ...prev,
301
+ loadingMarkets: true
302
+ }));
303
+ await BetRouterApi.BetRouter.MarketApi.removeSupportedMarket(marketContestId);
304
+ await loadSupportedMarkets(contest);
305
+ } catch (error) {
306
+ console.error('Error removing supported market:', error);
307
+ alert('Error removing market: ' + error.message);
308
+ setContestData(prev => ({
309
+ ...prev,
310
+ loadingMarkets: false
311
+ }));
312
+ }
313
+ };
314
+ const loadPartnerMarketsForContest = async contest => {
315
+ try {
316
+ // Use contest-scoped endpoint to get only data for this specific contest
317
+ const contestData = await BetRouterApi.BetRouter.ContestApi.getContest(contest.router_contest_id);
318
+ setContestData(prev => ({
319
+ ...prev,
320
+ partnerMarkets: contestData.partner_markets || []
321
+ // marketSides and marketVariables are global, load them once
322
+ // We'll fetch these only when needed or load them globally once
323
+ }));
324
+ } catch (error) {
325
+ console.error('Error loading partner markets for contest:', error);
326
+ }
327
+ };
328
+
329
+ // Helper to get participant name from partner_participant_id
330
+ // This now uses linkingData which is loaded on-demand in the manual link modal
331
+ const getParticipantName = partner_participant_id => {
332
+ if (!contestData.linkingData?.participants) return null;
333
+ const participant = contestData.linkingData.participants.find(p => p.partner_participant_id === partner_participant_id);
334
+ return participant?.name || null;
335
+ };
336
+ const openManualLinkModal = async rawMarket => {
337
+ if (!contestData.selectedContest || !contestData.selectedMarketContest || !contestData.selectedPartner) return;
338
+ try {
339
+ setContestData(prev => ({
340
+ ...prev,
341
+ loadingModal: true
342
+ }));
343
+ const data = await BetRouterApi.BetRouter.MarketApi.getMarketLinkingData(contestData.selectedContest.router_contest_id, contestData.selectedMarketContest.router_market_id, contestData.selectedPartner.partner_id);
344
+ const routerMarket = contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id);
345
+
346
+ // Set default values
347
+ const defaultTimeframe = data.timeframes?.[0]?.timeframe_id || '';
348
+ const defaultVariableType = routerMarket?.default_variable_type || 'spread';
349
+
350
+ // Initialize sideParticipants with empty entries for each side
351
+ const sideParticipants = data.market_sides.map(side => ({
352
+ market_side_id: side.market_side_id,
353
+ partner_participant_id: '',
354
+ price_key: ''
355
+ }));
356
+ setContestData(prev => ({
357
+ ...prev,
358
+ showManualLinkModal: true,
359
+ selectedRawMarket: rawMarket,
360
+ linkingData: data,
361
+ manualLinkForm: {
362
+ sideParticipants: sideParticipants,
363
+ timeframe_id: defaultTimeframe,
364
+ variable: '',
365
+ variable_type: defaultVariableType
366
+ },
367
+ participantSearchValue: '',
368
+ participantPage: 0,
369
+ selectedSideIndex: 0,
370
+ loadingModal: false
371
+ }));
372
+ } catch (error) {
373
+ console.error('Error loading linking data:', error);
374
+ alert('Error loading linking data: ' + error.message);
375
+ setContestData(prev => ({
376
+ ...prev,
377
+ loadingModal: false
378
+ }));
379
+ }
380
+ };
381
+ const submitManualLink = async () => {
382
+ if (!contestData.selectedRawMarket || !contestData.selectedMarketContest) return;
383
+ const routerMarket = contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id);
384
+
385
+ // Validate required fields - at least one side must have a participant
386
+ const sidesWithParticipants = contestData.manualLinkForm.sideParticipants.filter(sp => sp.partner_participant_id);
387
+ if (sidesWithParticipants.length === 0) {
388
+ alert('Please select at least one participant');
389
+ return;
390
+ }
391
+ if (routerMarket?.variable_required && !contestData.manualLinkForm.variable) {
392
+ alert('Please enter a variable value');
393
+ return;
394
+ }
395
+ try {
396
+ setContestData(prev => ({
397
+ ...prev,
398
+ loadingModal: true
399
+ }));
400
+ const baseVariable = contestData.manualLinkForm.variable ? parseFloat(contestData.manualLinkForm.variable) : 0;
401
+ const isSpread = contestData.manualLinkForm.variable_type === 'spread';
402
+
403
+ // Create a link for each side that has a participant selected
404
+ const linkPromises = sidesWithParticipants.map(sideParticipant => {
405
+ // Find the side info to determine if we need to flip the variable
406
+ const side = contestData.linkingData.market_sides.find(s => s.market_side_id === sideParticipant.market_side_id);
407
+
408
+ // For spreads, flip the sign for away side (home keeps the value as entered)
409
+ let variableValue = baseVariable;
410
+ if (isSpread && side?.side_key.toLowerCase() === 'away') {
411
+ variableValue = baseVariable * -1;
412
+ }
413
+ return BetRouterApi.BetRouter.MarketApi.linkMarket(contestData.selectedRawMarket.raw_market_id, contestData.selectedMarketContest.router_market_id, sideParticipant.market_side_id, sideParticipant.partner_participant_id, contestData.manualLinkForm.timeframe_id, variableValue, contestData.manualLinkForm.variable_type, sideParticipant.price_key || undefined);
414
+ });
415
+ await Promise.all(linkPromises);
416
+
417
+ // Reload data
418
+ if (contestData.selectedContest) {
419
+ await Promise.all([loadPartnerMarketsForContest(contestData.selectedContest), openLinkMarketsModal(contestData.selectedMarketContest, contestData.selectedPartner)]);
420
+ }
421
+ setContestData(prev => ({
422
+ ...prev,
423
+ showManualLinkModal: false,
424
+ selectedRawMarket: null,
425
+ linkingData: null,
426
+ loadingModal: false
427
+ }));
428
+ alert(`Successfully linked ${sidesWithParticipants.length} market side${sidesWithParticipants.length !== 1 ? 's' : ''}!`);
429
+ } catch (error) {
430
+ console.error('Error linking market:', error);
431
+ alert('Error linking market: ' + error.message);
432
+ setContestData(prev => ({
433
+ ...prev,
434
+ loadingModal: false
435
+ }));
436
+ }
437
+ };
438
+ const openLinkMarketsModal = async (marketContest, partner) => {
439
+ if (!contestData.selectedContest) return;
440
+ try {
441
+ setContestData(prev => ({
442
+ ...prev,
443
+ loadingModal: true
444
+ }));
445
+ const data = await BetRouterApi.BetRouter.MarketApi.getAvailableRawMarkets(contestData.selectedContest.router_contest_id, marketContest.router_market_id, partner.partner_id);
446
+ setContestData(prev => ({
447
+ ...prev,
448
+ availableRawMarkets: data.raw_markets || [],
449
+ alreadyLinkedRawMarkets: data.already_linked || [],
450
+ showLinkMarketsModal: true,
451
+ selectedMarketContest: marketContest,
452
+ selectedPartner: partner,
453
+ loadingModal: false
454
+ }));
455
+ } catch (error) {
456
+ console.error('Error loading raw markets:', error);
457
+ alert('Error loading markets: ' + error.message);
458
+ setContestData(prev => ({
459
+ ...prev,
460
+ loadingModal: false
461
+ }));
462
+ }
463
+ };
464
+ const openAddVariableModal = (marketContest, partner) => {
465
+ setContestData(prev => ({
466
+ ...prev,
467
+ showAddVariableModal: true,
468
+ selectedMarketContest: marketContest,
469
+ selectedPartner: partner,
470
+ newVariableValue: ''
471
+ }));
472
+ };
473
+ const addVariable = async () => {
474
+ if (!contestData.selectedContest || !contestData.selectedMarketContest || !contestData.selectedPartner) return;
475
+ const variableValue = parseFloat(contestData.newVariableValue);
476
+ if (isNaN(variableValue)) {
477
+ alert('Please enter a valid number');
478
+ return;
479
+ }
480
+ try {
481
+ setContestData(prev => ({
482
+ ...prev,
483
+ loadingModal: true
484
+ }));
485
+ const result = await BetRouterApi.BetRouter.MarketApi.addVariable(contestData.selectedContest.router_contest_id, contestData.selectedMarketContest.router_market_id, contestData.selectedPartner.partner_id, variableValue);
486
+
487
+ // Reload partner markets to show the new links
488
+ if (contestData.selectedContest) {
489
+ await loadPartnerMarketsForContest(contestData.selectedContest);
490
+ }
491
+ setContestData(prev => ({
492
+ ...prev,
493
+ showAddVariableModal: false,
494
+ newVariableValue: '',
495
+ loadingModal: false
496
+ }));
497
+ alert(`Successfully added variable ${variableValue}. Created ${result.count} partner market${result.count !== 1 ? 's' : ''}.`);
498
+ } catch (error) {
499
+ console.error('Error adding variable:', error);
500
+ alert('Error adding variable: ' + error.message);
501
+ setContestData(prev => ({
502
+ ...prev,
503
+ loadingModal: false
504
+ }));
505
+ }
506
+ };
507
+ const inspectPartnerMarkets = (marketContest, partner) => {
508
+ if (!contestData.selectedContest) return;
509
+
510
+ //const routerMarket = contestData.allRouterMarkets.find(m => m.router_market_id === marketContest.router_market_id);
511
+
512
+ // Filter partner markets for this specific market and partner
513
+ // No need to filter by router_contest_id - data is already scoped to this contest
514
+ const relevantPartnerMarkets = contestData.partnerMarkets.filter(pm => pm.router_market_id === marketContest.router_market_id && pm.partner_id === partner.partner_id);
515
+ setContestData(prev => ({
516
+ ...prev,
517
+ showInspectModal: true,
518
+ inspectPartnerMarkets: relevantPartnerMarkets,
519
+ selectedMarketContest: marketContest,
520
+ selectedPartner: partner
521
+ }));
522
+ };
523
+
524
+ // Apply search, link status, and date filters, then sort by scheduled_datetime
525
+ const filteredContests = contestData.contests.filter(c => {
526
+ // Search filter
527
+ const matchesSearch = c.contest_label.toLowerCase().includes(contestData.searchValue.toLowerCase());
528
+ // Link status filter
529
+ const matchesStatus = contestData.linkStatusFilter === 'all' || getContestLinkStatus(c) === contestData.linkStatusFilter;
530
+
531
+ // Date filter
532
+ let matchesDate = true;
533
+ if (contestData.dateFilter !== 'all') {
534
+ const contestDate = moment(c.scheduled_datetime);
535
+ const now = moment();
536
+ const todayStart = moment().startOf('day');
537
+ const todayEnd = moment().endOf('day');
538
+ if (contestData.dateFilter === 'upcoming') {
539
+ matchesDate = contestDate.isAfter(now);
540
+ } else if (contestData.dateFilter === 'today') {
541
+ matchesDate = contestDate.isBetween(todayStart, todayEnd, undefined, '[]');
542
+ } else if (contestData.dateFilter === 'past') {
543
+ matchesDate = contestDate.isBefore(now);
544
+ }
545
+ }
546
+ return matchesSearch && matchesStatus && matchesDate;
547
+ }).sort((a, b) => {
548
+ // Sort by scheduled_datetime ascending (earliest first)
549
+ return moment(a.scheduled_datetime).valueOf() - moment(b.scheduled_datetime).valueOf();
550
+ });
551
+ const filteredRawContests = contestData.availableRawContests.filter(c => c.pretty_title.toLowerCase().includes(contestData.rawSearchValue.toLowerCase()));
552
+ const totalRawPages = Math.ceil(filteredRawContests.length / RAW_CONTESTS_PER_PAGE);
553
+ const paginatedRawContests = filteredRawContests.slice(contestData.rawPage * RAW_CONTESTS_PER_PAGE, (contestData.rawPage + 1) * RAW_CONTESTS_PER_PAGE);
554
+ if (contestData.loading) {
555
+ return /*#__PURE__*/React.createElement(View, {
556
+ transparent: true,
557
+ style: {
558
+ padding: 40,
559
+ alignItems: 'center'
560
+ }
561
+ }, /*#__PURE__*/React.createElement(ActivityIndicator, {
562
+ size: "large",
563
+ color: Colors.text.h1
564
+ }));
565
+ }
566
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
567
+ transparent: true,
568
+ style: {
569
+ flex: 1
570
+ }
571
+ }, /*#__PURE__*/React.createElement(View, {
572
+ transparent: true,
573
+ style: {
574
+ marginBottom: 24
575
+ }
576
+ }, /*#__PURE__*/React.createElement(Text, {
577
+ theme: "h1",
578
+ size: 24
579
+ }, "Contests"), /*#__PURE__*/React.createElement(Text, {
580
+ theme: "description",
581
+ size: 14,
582
+ style: {
583
+ marginTop: 8
584
+ }
585
+ }, league.name, " - Manage contests and partner mappings")), /*#__PURE__*/React.createElement(View, {
586
+ type: "body",
587
+ style: {
588
+ padding: 16,
589
+ marginBottom: 16,
590
+ borderRadius: 8,
591
+ borderWidth: 1,
592
+ borderColor: Colors.borders.light
593
+ }
594
+ }, /*#__PURE__*/React.createElement(View, {
595
+ type: "header",
596
+ style: {
597
+ padding: 16,
598
+ marginBottom: 12
599
+ }
600
+ }, /*#__PURE__*/React.createElement(Text, {
601
+ theme: "h2",
602
+ size: 16
603
+ }, "Load Raw Contests from Partners"), /*#__PURE__*/React.createElement(Text, {
604
+ theme: "description",
605
+ size: 12,
606
+ style: {
607
+ marginTop: 4
608
+ }
609
+ }, "Fetch contests from each partner's API")), /*#__PURE__*/React.createElement(View, {
610
+ transparent: true,
611
+ style: {
612
+ paddingHorizontal: 16,
613
+ paddingBottom: 16
614
+ }
615
+ }, contestData.partners.map(partner => /*#__PURE__*/React.createElement(View, {
616
+ key: partner.partner_id,
617
+ transparent: true,
618
+ style: {
619
+ flexDirection: 'row',
620
+ alignItems: 'center',
621
+ marginBottom: 8,
622
+ padding: 12,
623
+ backgroundColor: Colors.views.header,
624
+ borderRadius: 6
625
+ }
626
+ }, /*#__PURE__*/React.createElement(Text, {
627
+ theme: "h2",
628
+ size: 13,
629
+ style: {
630
+ flex: 1
631
+ }
632
+ }, partner.name), /*#__PURE__*/React.createElement(Button, {
633
+ type: "action",
634
+ title: "Load Contests",
635
+ onPress: () => loadRawContests(partner),
636
+ style: {
637
+ paddingHorizontal: 15,
638
+ paddingVertical: 8
639
+ }
640
+ }))))), /*#__PURE__*/React.createElement(View, {
641
+ transparent: true,
642
+ style: {
643
+ flexDirection: 'row',
644
+ gap: 12,
645
+ marginBottom: 16
646
+ }
647
+ }, (() => {
648
+ const allCount = contestData.contests.length;
649
+ const completeCount = getContestsByStatus('complete').length;
650
+ const partialCount = getContestsByStatus('partial').length;
651
+ const noneCount = getContestsByStatus('none').length;
652
+ const stats = [{
653
+ status: 'all',
654
+ label: 'All Contests',
655
+ count: allCount,
656
+ color: Colors.text.h1
657
+ }, {
658
+ status: 'complete',
659
+ label: 'Fully Linked',
660
+ count: completeCount,
661
+ color: Colors.text.success
662
+ }, {
663
+ status: 'partial',
664
+ label: 'Partially Linked',
665
+ count: partialCount,
666
+ color: Colors.text.warning
667
+ }, {
668
+ status: 'none',
669
+ label: 'Not Linked',
670
+ count: noneCount,
671
+ color: Colors.text.error
672
+ }];
673
+ return stats.map(stat => /*#__PURE__*/React.createElement(TouchableOpacity, {
674
+ key: stat.status,
675
+ onPress: () => setContestData(prev => ({
676
+ ...prev,
677
+ linkStatusFilter: stat.status
678
+ })),
679
+ style: {
680
+ flex: 1,
681
+ padding: 16,
682
+ backgroundColor: Colors.views.header,
683
+ borderRadius: 8,
684
+ borderWidth: 2,
685
+ borderColor: contestData.linkStatusFilter === stat.status ? stat.color : Colors.borders.light
686
+ }
687
+ }, /*#__PURE__*/React.createElement(Text, {
688
+ theme: "description",
689
+ size: 11,
690
+ style: {
691
+ marginBottom: 4
692
+ }
693
+ }, stat.label.toUpperCase()), /*#__PURE__*/React.createElement(Text, {
694
+ size: 28,
695
+ style: {
696
+ color: stat.color,
697
+ fontWeight: '600'
698
+ }
699
+ }, stat.count)));
700
+ })()), /*#__PURE__*/React.createElement(View, {
701
+ type: "body",
702
+ style: {
703
+ flex: 1,
704
+ borderRadius: 8,
705
+ borderWidth: 1,
706
+ borderColor: Colors.borders.light,
707
+ overflow: 'hidden'
708
+ }
709
+ }, /*#__PURE__*/React.createElement(View, {
710
+ type: "header",
711
+ style: {
712
+ padding: 16
713
+ }
714
+ }, /*#__PURE__*/React.createElement(View, {
715
+ transparent: true,
716
+ style: {
717
+ flexDirection: 'row',
718
+ justifyContent: 'space-between',
719
+ alignItems: 'center'
720
+ }
721
+ }, /*#__PURE__*/React.createElement(View, {
722
+ transparent: true
723
+ }, /*#__PURE__*/React.createElement(Text, {
724
+ theme: "h2",
725
+ size: 16
726
+ }, "Router Contests"), /*#__PURE__*/React.createElement(Text, {
727
+ theme: "description",
728
+ size: 12,
729
+ style: {
730
+ marginTop: 4
731
+ }
732
+ }, filteredContests.length, " contest", filteredContests.length !== 1 ? 's' : '', contestData.linkStatusFilter !== 'all' && ` (${contestData.linkStatusFilter})`)), /*#__PURE__*/React.createElement(View, {
733
+ transparent: true,
734
+ style: {
735
+ flexDirection: 'row',
736
+ gap: 8
737
+ }
738
+ }, /*#__PURE__*/React.createElement(Button, {
739
+ type: "action",
740
+ title: "\uD83D\uDD17 Auto-Link Contests",
741
+ onPress: () => setContestData(prev => ({
742
+ ...prev,
743
+ showAutoLinkModal: true
744
+ })),
745
+ style: {
746
+ paddingHorizontal: 15,
747
+ paddingVertical: 8
748
+ }
749
+ }), /*#__PURE__*/React.createElement(Button, {
750
+ type: "action",
751
+ title: "\uD83D\uDD17 Auto-Link Markets",
752
+ onPress: async () => {
753
+ try {
754
+ setContestData(prev => ({
755
+ ...prev,
756
+ loading: true
757
+ }));
758
+ const markets = await BetRouterApi.BetRouter.MarketApi.getRouterMarkets();
759
+ setContestData(prev => ({
760
+ ...prev,
761
+ allRouterMarkets: Array.isArray(markets) ? markets : [],
762
+ showMarketAutoLinkModal: true,
763
+ loading: false
764
+ }));
765
+ } catch (error) {
766
+ console.error('Error loading router markets:', error);
767
+ alert('Error loading markets: ' + error.message);
768
+ setContestData(prev => ({
769
+ ...prev,
770
+ loading: false
771
+ }));
772
+ }
773
+ },
774
+ style: {
775
+ paddingHorizontal: 15,
776
+ paddingVertical: 8
777
+ }
778
+ }))), /*#__PURE__*/React.createElement(View, {
779
+ transparent: true,
780
+ style: {
781
+ marginTop: 12
782
+ }
783
+ }, /*#__PURE__*/React.createElement(SearchBox, {
784
+ placeholder: "Search contests...",
785
+ onChange: text => setContestData(prev => ({
786
+ ...prev,
787
+ searchValue: text
788
+ })),
789
+ hide_search_button: true
790
+ })), /*#__PURE__*/React.createElement(View, {
791
+ transparent: true,
792
+ style: {
793
+ marginTop: 12
794
+ }
795
+ }, /*#__PURE__*/React.createElement(Text, {
796
+ theme: "description",
797
+ size: 11,
798
+ style: {
799
+ marginBottom: 6,
800
+ textTransform: 'uppercase'
801
+ }
802
+ }, "Filter by Date"), /*#__PURE__*/React.createElement(View, {
803
+ transparent: true,
804
+ style: {
805
+ flexDirection: 'row',
806
+ gap: 8,
807
+ flexWrap: 'wrap'
808
+ }
809
+ }, [{
810
+ value: 'all',
811
+ label: 'All'
812
+ }, {
813
+ value: 'today',
814
+ label: 'Today'
815
+ }, {
816
+ value: 'upcoming',
817
+ label: 'Upcoming'
818
+ }, {
819
+ value: 'past',
820
+ label: 'Past'
821
+ }].map(filter => /*#__PURE__*/React.createElement(TouchableOpacity, {
822
+ key: filter.value,
823
+ onPress: () => setContestData(prev => ({
824
+ ...prev,
825
+ dateFilter: filter.value
826
+ })),
827
+ style: {
828
+ paddingHorizontal: 14,
829
+ paddingVertical: 7,
830
+ borderRadius: 6,
831
+ borderWidth: 1,
832
+ borderColor: contestData.dateFilter === filter.value ? Colors.text.success : Colors.borders.light,
833
+ backgroundColor: contestData.dateFilter === filter.value ? Colors.views.body : 'transparent'
834
+ }
835
+ }, /*#__PURE__*/React.createElement(Text, {
836
+ theme: contestData.dateFilter === filter.value ? 'h2' : 'description',
837
+ size: 12
838
+ }, filter.label)))))), /*#__PURE__*/React.createElement(FlatList, {
839
+ data: filteredContests,
840
+ keyExtractor: item => item.router_contest_id,
841
+ renderItem: ({
842
+ item: contest
843
+ }) => {
844
+ const partnerCount = getUniquePartnerCountForContest(contest.router_contest_id);
845
+ const isExpanded = contestData.selectedContest?.router_contest_id === contest.router_contest_id;
846
+ return /*#__PURE__*/React.createElement(View, {
847
+ transparent: true,
848
+ style: {
849
+ borderBottomWidth: 1,
850
+ borderBottomColor: Colors.borders.light
851
+ }
852
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
853
+ onPress: () => {
854
+ if (isExpanded) {
855
+ setContestData(prev => ({
856
+ ...prev,
857
+ selectedContest: null
858
+ }));
859
+ } else {
860
+ setContestData(prev => ({
861
+ ...prev,
862
+ selectedContest: contest
863
+ }));
864
+ // Load supported markets and partner markets when expanding
865
+ loadSupportedMarkets(contest);
866
+ loadPartnerMarketsForContest(contest);
867
+ }
868
+ },
869
+ style: {
870
+ padding: 16,
871
+ backgroundColor: isExpanded ? Colors.views.header : 'transparent',
872
+ flexDirection: 'row',
873
+ alignItems: 'center'
874
+ }
875
+ }, /*#__PURE__*/React.createElement(Icons.ChevronIcon, {
876
+ direction: isExpanded ? 'down' : 'right',
877
+ size: 8,
878
+ color: Colors.text.h1
879
+ }), /*#__PURE__*/React.createElement(View, {
880
+ transparent: true,
881
+ style: {
882
+ flex: 1,
883
+ marginLeft: 12
884
+ }
885
+ }, /*#__PURE__*/React.createElement(Text, {
886
+ theme: "h2",
887
+ size: 14
888
+ }, contest.contest_label), /*#__PURE__*/React.createElement(Text, {
889
+ theme: "description",
890
+ size: 11,
891
+ style: {
892
+ marginTop: 2
893
+ }
894
+ }, moment(contest.scheduled_datetime).format('ddd, MMM D, YYYY [at] h:mm A'), " \u2022 ", partnerCount, " partner", partnerCount !== 1 ? 's' : '')), /*#__PURE__*/React.createElement(View, {
895
+ transparent: true,
896
+ style: {
897
+ flexDirection: 'row',
898
+ alignItems: 'center',
899
+ gap: 8
900
+ }
901
+ }, /*#__PURE__*/React.createElement(Text, {
902
+ theme: "description",
903
+ size: 12
904
+ }, "Auto-fill:"), /*#__PURE__*/React.createElement(Switch, {
905
+ value: contest.auto_fill ?? false,
906
+ switch_type: "on_off",
907
+ size: 14,
908
+ onChange: async value => {
909
+ try {
910
+ await BetRouterApi.BetRouter.ContestApi.updateRouterContest(contest.router_contest_id, {
911
+ auto_fill: value
912
+ });
913
+ setContestData(prev => ({
914
+ ...prev,
915
+ contests: prev.contests.map(c => c.router_contest_id === contest.router_contest_id ? {
916
+ ...c,
917
+ auto_fill: value
918
+ } : c)
919
+ }));
920
+ } catch (error) {
921
+ console.error('Failed to update auto_fill:', error);
922
+ alert('Failed to update auto-fill setting');
923
+ }
924
+ }
925
+ }))), isExpanded && /*#__PURE__*/React.createElement(View, {
926
+ transparent: true,
927
+ style: {
928
+ paddingTop: 0
929
+ }
930
+ }, /*#__PURE__*/React.createElement(View, {
931
+ transparent: true,
932
+ style: {
933
+ flexDirection: 'row',
934
+ borderBottomWidth: 1,
935
+ borderBottomColor: Colors.borders.light,
936
+ paddingHorizontal: 16
937
+ }
938
+ }, /*#__PURE__*/React.createElement(TouchableOpacity, {
939
+ onPress: () => setContestData(prev => ({
940
+ ...prev,
941
+ currentTab: 'partners'
942
+ })),
943
+ style: {
944
+ paddingVertical: 12,
945
+ paddingHorizontal: 16,
946
+ borderBottomWidth: contestData.currentTab === 'partners' ? 2 : 0,
947
+ borderBottomColor: Colors.text.action
948
+ }
949
+ }, /*#__PURE__*/React.createElement(Text, {
950
+ theme: contestData.currentTab === 'partners' ? 'h2' : 'description',
951
+ size: 13,
952
+ style: {
953
+ color: contestData.currentTab === 'partners' ? Colors.text.action : Colors.text.description
954
+ }
955
+ }, "Partner Links")), /*#__PURE__*/React.createElement(TouchableOpacity, {
956
+ onPress: () => {
957
+ setContestData(prev => ({
958
+ ...prev,
959
+ currentTab: 'markets'
960
+ }));
961
+ loadSupportedMarkets(contest);
962
+ loadPartnerMarketsForContest(contest);
963
+ },
964
+ style: {
965
+ paddingVertical: 12,
966
+ paddingHorizontal: 16,
967
+ borderBottomWidth: contestData.currentTab === 'markets' ? 2 : 0,
968
+ borderBottomColor: Colors.text.action
969
+ }
970
+ }, /*#__PURE__*/React.createElement(Text, {
971
+ theme: contestData.currentTab === 'markets' ? 'h2' : 'description',
972
+ size: 13,
973
+ style: {
974
+ color: contestData.currentTab === 'markets' ? Colors.text.action : Colors.text.description
975
+ }
976
+ }, "Markets"))), /*#__PURE__*/React.createElement(View, {
977
+ transparent: true,
978
+ style: {
979
+ padding: 16
980
+ }
981
+ }, contestData.currentTab === 'partners' ?
982
+ /*#__PURE__*/
983
+ // Partners tab
984
+ React.createElement(React.Fragment, null, contestData.partners.map(partner => {
985
+ const linked = isPartnerLinked(contest.router_contest_id, partner.partner_id);
986
+ const externalIds = getLinkedExternalIds(contest.router_contest_id, partner.partner_id);
987
+ return /*#__PURE__*/React.createElement(View, {
988
+ key: partner.partner_id,
989
+ transparent: true,
990
+ style: {
991
+ padding: 12,
992
+ marginBottom: 8,
993
+ backgroundColor: Colors.views.header,
994
+ borderRadius: 6,
995
+ flexDirection: 'row',
996
+ alignItems: 'center'
997
+ }
998
+ }, /*#__PURE__*/React.createElement(View, {
999
+ transparent: true,
1000
+ style: {
1001
+ flex: 1
1002
+ }
1003
+ }, /*#__PURE__*/React.createElement(View, {
1004
+ transparent: true,
1005
+ style: {
1006
+ flexDirection: 'row',
1007
+ alignItems: 'center',
1008
+ gap: 8
1009
+ }
1010
+ }, /*#__PURE__*/React.createElement(Text, {
1011
+ theme: "h2",
1012
+ size: 13
1013
+ }, partner.name), linked ? /*#__PURE__*/React.createElement(Icons.CheckCirlceIcon, {
1014
+ color: Colors.text.success,
1015
+ size: 14
1016
+ }) : /*#__PURE__*/React.createElement(Text, {
1017
+ theme: "description",
1018
+ size: 11
1019
+ }, "Not Linked")), linked && externalIds.length > 0 && /*#__PURE__*/React.createElement(Text, {
1020
+ theme: "description",
1021
+ size: 11,
1022
+ style: {
1023
+ marginTop: 4
1024
+ }
1025
+ }, "External IDs: ", externalIds.join(', '))), /*#__PURE__*/React.createElement(Button, {
1026
+ type: "action",
1027
+ title: linked ? 'Manage Links' : 'Link',
1028
+ onPress: () => openLinkModal(contest, partner),
1029
+ style: {
1030
+ paddingHorizontal: 12,
1031
+ paddingVertical: 6
1032
+ }
1033
+ }));
1034
+ })) :
1035
+ /*#__PURE__*/
1036
+ // Markets tab
1037
+ React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
1038
+ type: "action",
1039
+ title: "Manage Markets",
1040
+ onPress: () => openManageMarketsModal(contest),
1041
+ style: {
1042
+ marginBottom: 16
1043
+ }
1044
+ }), contestData.loadingMarkets ? /*#__PURE__*/React.createElement(View, {
1045
+ transparent: true,
1046
+ style: {
1047
+ padding: 40,
1048
+ alignItems: 'center'
1049
+ }
1050
+ }, /*#__PURE__*/React.createElement(ActivityIndicator, {
1051
+ size: "small",
1052
+ color: Colors.text.h1
1053
+ }), /*#__PURE__*/React.createElement(Text, {
1054
+ theme: "description",
1055
+ size: 12,
1056
+ style: {
1057
+ marginTop: 8
1058
+ }
1059
+ }, "Loading markets...")) : contestData.marketContests.length === 0 ? /*#__PURE__*/React.createElement(Text, {
1060
+ theme: "description",
1061
+ size: 12,
1062
+ style: {
1063
+ textAlign: 'center',
1064
+ padding: 20,
1065
+ opacity: 0.6
1066
+ }
1067
+ }, "No supported markets yet. Add a market above to get started.") : contestData.marketContests.map(marketContest => {
1068
+ const routerMarket = contestData.allRouterMarkets.find(rm => rm.router_market_id === marketContest.router_market_id);
1069
+ if (!routerMarket) return null;
1070
+ return /*#__PURE__*/React.createElement(View, {
1071
+ key: marketContest.market_contest_id,
1072
+ transparent: true,
1073
+ style: {
1074
+ marginBottom: 16,
1075
+ padding: 15,
1076
+ backgroundColor: Colors.views.header,
1077
+ borderRadius: 8,
1078
+ borderWidth: 1,
1079
+ borderColor: Colors.borders.light
1080
+ }
1081
+ }, /*#__PURE__*/React.createElement(View, {
1082
+ transparent: true,
1083
+ style: {
1084
+ flexDirection: 'row',
1085
+ alignItems: 'center',
1086
+ marginBottom: 10
1087
+ }
1088
+ }, /*#__PURE__*/React.createElement(Text, {
1089
+ theme: "h2",
1090
+ size: 14,
1091
+ style: {
1092
+ flex: 1
1093
+ }
1094
+ }, routerMarket.market_label), /*#__PURE__*/React.createElement(View, {
1095
+ transparent: true,
1096
+ style: {
1097
+ flexDirection: 'row',
1098
+ alignItems: 'center',
1099
+ gap: 12,
1100
+ marginRight: 12
1101
+ }
1102
+ }, /*#__PURE__*/React.createElement(Text, {
1103
+ theme: "description",
1104
+ size: 11
1105
+ }, "Auto-fill:"), /*#__PURE__*/React.createElement(Switch, {
1106
+ value: marketContest.auto_fill ?? false,
1107
+ switch_type: "on_off",
1108
+ size: 12,
1109
+ onChange: async value => {
1110
+ try {
1111
+ await BetRouterApi.BetRouter.MarketApi.updateMarketContest(marketContest.market_contest_id, {
1112
+ auto_fill: value
1113
+ });
1114
+ setContestData(prev => ({
1115
+ ...prev,
1116
+ marketContests: prev.marketContests.map(mc => mc.market_contest_id === marketContest.market_contest_id ? {
1117
+ ...mc,
1118
+ auto_fill: value
1119
+ } : mc)
1120
+ }));
1121
+ } catch (error) {
1122
+ console.error('Failed to update market auto_fill:', error);
1123
+ alert('Failed to update auto-fill setting');
1124
+ }
1125
+ }
1126
+ })), /*#__PURE__*/React.createElement(TouchableOpacity, {
1127
+ onPress: () => removeSupportedMarket(marketContest.market_contest_id, contest)
1128
+ }, /*#__PURE__*/React.createElement(Text, {
1129
+ theme: "description",
1130
+ size: 12,
1131
+ style: {
1132
+ color: Colors.text.warning
1133
+ }
1134
+ }, "Remove"))), /*#__PURE__*/React.createElement(Text, {
1135
+ theme: "description",
1136
+ size: 11,
1137
+ style: {
1138
+ marginBottom: 12
1139
+ }
1140
+ }, routerMarket.market_description), /*#__PURE__*/React.createElement(View, {
1141
+ transparent: true,
1142
+ style: {
1143
+ paddingTop: 8,
1144
+ borderTopWidth: 1,
1145
+ borderTopColor: Colors.borders.light
1146
+ }
1147
+ }, contestData.partners.map(partner => {
1148
+ // No need to filter by router_contest_id - data is already scoped to this contest
1149
+ const partnerMarketsForThis = contestData.partnerMarkets.filter(pm => pm.router_market_id === routerMarket.router_market_id && pm.partner_id === partner.partner_id);
1150
+ const isLinked = partnerMarketsForThis.length > 0;
1151
+ return /*#__PURE__*/React.createElement(View, {
1152
+ key: partner.partner_id,
1153
+ transparent: true,
1154
+ style: {
1155
+ flexDirection: 'row',
1156
+ alignItems: 'center',
1157
+ padding: 10,
1158
+ marginTop: 8
1159
+ }
1160
+ }, /*#__PURE__*/React.createElement(View, {
1161
+ transparent: true,
1162
+ style: {
1163
+ flex: 1,
1164
+ flexDirection: 'row',
1165
+ alignItems: 'center',
1166
+ gap: 10
1167
+ }
1168
+ }, /*#__PURE__*/React.createElement(Text, {
1169
+ theme: "description",
1170
+ size: 12
1171
+ }, partner.name, ":"), isLinked ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Icons.CheckCirlceIcon, {
1172
+ color: Colors.text.success,
1173
+ size: 14
1174
+ }), /*#__PURE__*/React.createElement(Text, {
1175
+ theme: "description",
1176
+ size: 11
1177
+ }, "(", partnerMarketsForThis.length, " linked)")) : /*#__PURE__*/React.createElement(Text, {
1178
+ theme: "description",
1179
+ size: 11
1180
+ }, "\u274C Not Linked")), /*#__PURE__*/React.createElement(View, {
1181
+ transparent: true,
1182
+ style: {
1183
+ flexDirection: 'row',
1184
+ gap: 8
1185
+ }
1186
+ }, isLinked && /*#__PURE__*/React.createElement(Button, {
1187
+ type: "close",
1188
+ title: "Inspect",
1189
+ onPress: () => inspectPartnerMarkets(marketContest, partner),
1190
+ style: {
1191
+ paddingHorizontal: 12,
1192
+ paddingVertical: 6
1193
+ }
1194
+ }), /*#__PURE__*/React.createElement(Button, {
1195
+ type: "action",
1196
+ title: !isLinked ? 'Link Markets' : routerMarket.variable_required ? '+ Add Variable' : '+ Add More',
1197
+ onPress: () => {
1198
+ if (!isLinked || !routerMarket.variable_required) {
1199
+ openLinkMarketsModal(marketContest, partner);
1200
+ } else {
1201
+ openAddVariableModal(marketContest, partner);
1202
+ }
1203
+ },
1204
+ style: {
1205
+ paddingHorizontal: 12,
1206
+ paddingVertical: 6
1207
+ }
1208
+ })));
1209
+ })));
1210
+ })))));
1211
+ }
1212
+ })), contestData.showLinkModal && /*#__PURE__*/React.createElement(View, {
1213
+ style: {
1214
+ position: 'absolute',
1215
+ top: 0,
1216
+ left: 0,
1217
+ right: 0,
1218
+ bottom: 0,
1219
+ backgroundColor: 'rgba(0,0,0,0.5)',
1220
+ justifyContent: 'center',
1221
+ alignItems: 'center',
1222
+ padding: 20
1223
+ }
1224
+ }, /*#__PURE__*/React.createElement(View, {
1225
+ float: true,
1226
+ style: {
1227
+ width: '90%',
1228
+ maxWidth: 600,
1229
+ maxHeight: '80%',
1230
+ borderRadius: 8,
1231
+ overflow: 'hidden',
1232
+ flexDirection: 'column'
1233
+ }
1234
+ }, /*#__PURE__*/React.createElement(View, {
1235
+ type: "header",
1236
+ style: {
1237
+ padding: 16,
1238
+ flexDirection: 'row',
1239
+ justifyContent: 'space-between',
1240
+ alignItems: 'center'
1241
+ }
1242
+ }, /*#__PURE__*/React.createElement(View, {
1243
+ transparent: true
1244
+ }, /*#__PURE__*/React.createElement(Text, {
1245
+ theme: "h1",
1246
+ size: 18
1247
+ }, "Link Raw Contests"), /*#__PURE__*/React.createElement(Text, {
1248
+ theme: "description",
1249
+ size: 12,
1250
+ style: {
1251
+ marginTop: 4
1252
+ }
1253
+ }, contestData.selectedPartner?.name, " \u2192 ", contestData.selectedContest?.contest_label)), /*#__PURE__*/React.createElement(TouchableOpacity, {
1254
+ onPress: () => setContestData(prev => ({
1255
+ ...prev,
1256
+ showLinkModal: false
1257
+ }))
1258
+ }, /*#__PURE__*/React.createElement(Icons.CloseIcon, {
1259
+ size: 24,
1260
+ color: Colors.text.h1
1261
+ }))), /*#__PURE__*/React.createElement(View, {
1262
+ transparent: true,
1263
+ style: {
1264
+ padding: 16,
1265
+ paddingTop: 0
1266
+ }
1267
+ }, /*#__PURE__*/React.createElement(SearchBox, {
1268
+ placeholder: "Search raw contests...",
1269
+ onChange: text => setContestData(prev => ({
1270
+ ...prev,
1271
+ rawSearchValue: text,
1272
+ rawPage: 0
1273
+ })),
1274
+ hide_search_button: true
1275
+ })), /*#__PURE__*/React.createElement(View, {
1276
+ transparent: true,
1277
+ style: {
1278
+ paddingHorizontal: 16,
1279
+ paddingBottom: 8
1280
+ }
1281
+ }, /*#__PURE__*/React.createElement(Text, {
1282
+ theme: "description",
1283
+ size: 12
1284
+ }, "Showing ", paginatedRawContests.length, " of ", filteredRawContests.length, " contest", filteredRawContests.length !== 1 ? 's' : '')), /*#__PURE__*/React.createElement(FlatList, {
1285
+ data: paginatedRawContests,
1286
+ keyExtractor: item => item.raw_contest_id,
1287
+ renderItem: ({
1288
+ item: rawContest
1289
+ }) => {
1290
+ const isSelected = contestData.selectedRawIds.includes(rawContest.raw_contest_id);
1291
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
1292
+ onPress: () => toggleRawContestSelection(rawContest.raw_contest_id),
1293
+ style: {
1294
+ padding: 12,
1295
+ backgroundColor: isSelected ? Colors.views.header : Colors.views.body,
1296
+ borderBottomWidth: 1,
1297
+ borderBottomColor: Colors.borders.light,
1298
+ flexDirection: 'row',
1299
+ alignItems: 'center'
1300
+ }
1301
+ }, /*#__PURE__*/React.createElement(View, {
1302
+ transparent: true,
1303
+ style: {
1304
+ width: 24,
1305
+ height: 24,
1306
+ marginRight: 12
1307
+ }
1308
+ }, isSelected && /*#__PURE__*/React.createElement(Icons.CheckIcon, {
1309
+ color: Colors.text.success,
1310
+ size: 20
1311
+ })), /*#__PURE__*/React.createElement(View, {
1312
+ transparent: true,
1313
+ style: {
1314
+ flex: 1
1315
+ }
1316
+ }, /*#__PURE__*/React.createElement(Text, {
1317
+ theme: "h2",
1318
+ size: 13
1319
+ }, rawContest.pretty_title), /*#__PURE__*/React.createElement(Text, {
1320
+ theme: "description",
1321
+ size: 11,
1322
+ style: {
1323
+ marginTop: 2
1324
+ }
1325
+ }, new Date(rawContest.scheduled_datetime).toLocaleString(), " \u2022 ", rawContest.external_id)));
1326
+ }
1327
+ }), totalRawPages > 1 && /*#__PURE__*/React.createElement(View, {
1328
+ transparent: true,
1329
+ style: {
1330
+ padding: 16,
1331
+ paddingTop: 8
1332
+ }
1333
+ }, /*#__PURE__*/React.createElement(Pagination, {
1334
+ offset: contestData.rawPage,
1335
+ pages: totalRawPages,
1336
+ onNext: () => setContestData(prev => ({
1337
+ ...prev,
1338
+ rawPage: prev.rawPage + 1
1339
+ })),
1340
+ onPrevious: () => setContestData(prev => ({
1341
+ ...prev,
1342
+ rawPage: prev.rawPage - 1
1343
+ }))
1344
+ })), /*#__PURE__*/React.createElement(View, {
1345
+ type: "footer",
1346
+ style: {
1347
+ padding: 16,
1348
+ flexDirection: 'row',
1349
+ justifyContent: 'flex-end',
1350
+ gap: 10
1351
+ }
1352
+ }, /*#__PURE__*/React.createElement(Button, {
1353
+ type: "close",
1354
+ title: "Cancel",
1355
+ onPress: () => setContestData(prev => ({
1356
+ ...prev,
1357
+ showLinkModal: false
1358
+ }))
1359
+ }), /*#__PURE__*/React.createElement(Button, {
1360
+ type: "action",
1361
+ title: `Link ${contestData.selectedRawIds.length} Contest${contestData.selectedRawIds.length !== 1 ? 's' : ''}`,
1362
+ onPress: linkSelectedContests,
1363
+ disabled: contestData.selectedRawIds.length === 0
1364
+ }))))), contestData.showAutoLinkModal && /*#__PURE__*/React.createElement(View, {
1365
+ style: {
1366
+ position: 'fixed',
1367
+ top: 0,
1368
+ left: 0,
1369
+ right: 0,
1370
+ bottom: 0,
1371
+ backgroundColor: Colors.views.blur,
1372
+ justifyContent: 'center',
1373
+ alignItems: 'center',
1374
+ padding: 20,
1375
+ zIndex: 1000
1376
+ }
1377
+ }, /*#__PURE__*/React.createElement(View, {
1378
+ float: true,
1379
+ style: {
1380
+ maxWidth: 500,
1381
+ width: '100%',
1382
+ borderRadius: 8,
1383
+ overflow: 'hidden'
1384
+ }
1385
+ }, /*#__PURE__*/React.createElement(View, {
1386
+ type: "header",
1387
+ style: {
1388
+ padding: 20
1389
+ }
1390
+ }, /*#__PURE__*/React.createElement(Text, {
1391
+ theme: "h1",
1392
+ size: 18
1393
+ }, "Auto-Link Contests"), /*#__PURE__*/React.createElement(Text, {
1394
+ theme: "description",
1395
+ size: 14,
1396
+ style: {
1397
+ marginTop: 5
1398
+ }
1399
+ }, "Select partner to automatically match and link contests")), /*#__PURE__*/React.createElement(View, {
1400
+ type: "body",
1401
+ style: {
1402
+ padding: 20
1403
+ }
1404
+ }, /*#__PURE__*/React.createElement(Text, {
1405
+ theme: "description",
1406
+ size: 12,
1407
+ style: {
1408
+ marginBottom: 15
1409
+ }
1410
+ }, "This will attempt to automatically match contests based on scheduled time and participants."), contestData.partners.map(partner => {
1411
+ const linkedCount = contestData.partnerContests.filter(pc => pc.partner_id === partner.partner_id).length;
1412
+ const totalCount = contestData.contests.length;
1413
+ return /*#__PURE__*/React.createElement(View, {
1414
+ key: partner.partner_id,
1415
+ transparent: true,
1416
+ style: {
1417
+ flexDirection: 'row',
1418
+ alignItems: 'center',
1419
+ padding: 15,
1420
+ marginBottom: 10,
1421
+ backgroundColor: Colors.views.header,
1422
+ borderRadius: 8
1423
+ }
1424
+ }, /*#__PURE__*/React.createElement(View, {
1425
+ transparent: true,
1426
+ style: {
1427
+ flex: 1
1428
+ }
1429
+ }, /*#__PURE__*/React.createElement(Text, {
1430
+ theme: "h2",
1431
+ size: 14
1432
+ }, partner.name), /*#__PURE__*/React.createElement(Text, {
1433
+ theme: "description",
1434
+ size: 11,
1435
+ style: {
1436
+ marginTop: 3
1437
+ }
1438
+ }, linkedCount, "/", totalCount, " contests linked")), /*#__PURE__*/React.createElement(Button, {
1439
+ type: "action",
1440
+ title: "Auto-Link",
1441
+ onPress: async () => {
1442
+ try {
1443
+ setContestData(prev => ({
1444
+ ...prev,
1445
+ loading: true
1446
+ }));
1447
+ const result = await BetRouterApi.BetRouter.AutoLinkingApi.autoLinkContests(league.router_league_id, partner.partner_id);
1448
+ setContestData(prev => ({
1449
+ ...prev,
1450
+ autoLinkResults: result,
1451
+ showAutoLinkModal: false,
1452
+ showAutoLinkResults: true
1453
+ }));
1454
+
1455
+ // Reload partner contests
1456
+ const allPartnerContests = await BetRouterApi.BetRouter.ContestApi.getPartnerContests();
1457
+ setContestData(prev => ({
1458
+ ...prev,
1459
+ partnerContests: Array.isArray(allPartnerContests) ? allPartnerContests : [],
1460
+ loading: false
1461
+ }));
1462
+ } catch (error) {
1463
+ console.error('Error auto-linking contests:', error);
1464
+ alert('Error auto-linking contests: ' + error.message);
1465
+ setContestData(prev => ({
1466
+ ...prev,
1467
+ loading: false
1468
+ }));
1469
+ }
1470
+ },
1471
+ style: {
1472
+ paddingHorizontal: 15,
1473
+ paddingVertical: 8
1474
+ }
1475
+ }));
1476
+ })), /*#__PURE__*/React.createElement(View, {
1477
+ type: "footer",
1478
+ style: {
1479
+ padding: 15
1480
+ }
1481
+ }, /*#__PURE__*/React.createElement(Button, {
1482
+ type: "close",
1483
+ title: "Cancel",
1484
+ onPress: () => setContestData(prev => ({
1485
+ ...prev,
1486
+ showAutoLinkModal: false
1487
+ }))
1488
+ })))), contestData.showAutoLinkResults && contestData.autoLinkResults && /*#__PURE__*/React.createElement(View, {
1489
+ style: {
1490
+ position: 'fixed',
1491
+ top: 0,
1492
+ left: 0,
1493
+ right: 0,
1494
+ bottom: 0,
1495
+ backgroundColor: Colors.views.blur,
1496
+ justifyContent: 'center',
1497
+ alignItems: 'center',
1498
+ padding: 20,
1499
+ zIndex: 1000
1500
+ }
1501
+ }, /*#__PURE__*/React.createElement(View, {
1502
+ float: true,
1503
+ style: {
1504
+ maxWidth: 600,
1505
+ width: '100%',
1506
+ maxHeight: '90%',
1507
+ borderRadius: 8,
1508
+ overflow: 'hidden'
1509
+ }
1510
+ }, /*#__PURE__*/React.createElement(View, {
1511
+ type: "header",
1512
+ style: {
1513
+ padding: 20
1514
+ }
1515
+ }, /*#__PURE__*/React.createElement(Text, {
1516
+ theme: "h1",
1517
+ size: 18
1518
+ }, "Auto-Link Results"), /*#__PURE__*/React.createElement(Text, {
1519
+ theme: "description",
1520
+ size: 14,
1521
+ style: {
1522
+ marginTop: 5
1523
+ }
1524
+ }, contestData.autoLinkResults.partner_name, " \u2022 ", league.name)), /*#__PURE__*/React.createElement(ScrollView, {
1525
+ style: {
1526
+ flex: 1
1527
+ }
1528
+ }, /*#__PURE__*/React.createElement(View, {
1529
+ transparent: true,
1530
+ style: {
1531
+ padding: 20
1532
+ }
1533
+ }, /*#__PURE__*/React.createElement(View, {
1534
+ type: "body",
1535
+ style: {
1536
+ padding: 16,
1537
+ borderRadius: 8,
1538
+ marginBottom: 16
1539
+ }
1540
+ }, /*#__PURE__*/React.createElement(Text, {
1541
+ theme: "h2",
1542
+ size: 16,
1543
+ style: {
1544
+ marginBottom: 12
1545
+ }
1546
+ }, "Summary"), /*#__PURE__*/React.createElement(Text, {
1547
+ theme: "description",
1548
+ size: 13,
1549
+ style: {
1550
+ marginBottom: 6
1551
+ }
1552
+ }, "Successfully linked: ", contestData.autoLinkResults.matched_count, "/", contestData.autoLinkResults.total_router_entities, " contests"), contestData.autoLinkResults.failed_count > 0 && /*#__PURE__*/React.createElement(Text, {
1553
+ theme: "description",
1554
+ size: 13,
1555
+ style: {
1556
+ color: Colors.text.warning
1557
+ }
1558
+ }, "Failed: ", contestData.autoLinkResults.failed_count, " contests")), contestData.autoLinkResults.results.filter(r => !r.success).length > 0 && /*#__PURE__*/React.createElement(View, {
1559
+ type: "body",
1560
+ style: {
1561
+ padding: 16,
1562
+ borderRadius: 8
1563
+ }
1564
+ }, /*#__PURE__*/React.createElement(Text, {
1565
+ theme: "h2",
1566
+ size: 16,
1567
+ style: {
1568
+ marginBottom: 12
1569
+ }
1570
+ }, "Failed Matches"), contestData.autoLinkResults.results.filter(r => !r.success).map((result, index) => /*#__PURE__*/React.createElement(View, {
1571
+ key: index,
1572
+ transparent: true,
1573
+ style: {
1574
+ padding: 12,
1575
+ marginBottom: 8,
1576
+ backgroundColor: Colors.views.header,
1577
+ borderRadius: 6
1578
+ }
1579
+ }, /*#__PURE__*/React.createElement(Text, {
1580
+ theme: "h2",
1581
+ size: 13
1582
+ }, result.router_entity_label), /*#__PURE__*/React.createElement(Text, {
1583
+ theme: "description",
1584
+ size: 11,
1585
+ style: {
1586
+ marginTop: 4,
1587
+ color: Colors.text.warning
1588
+ }
1589
+ }, result.error || 'No matches found')))))), /*#__PURE__*/React.createElement(View, {
1590
+ type: "footer",
1591
+ style: {
1592
+ padding: 15
1593
+ }
1594
+ }, /*#__PURE__*/React.createElement(Button, {
1595
+ type: "action",
1596
+ title: "Done",
1597
+ onPress: () => setContestData(prev => ({
1598
+ ...prev,
1599
+ showAutoLinkResults: false,
1600
+ autoLinkResults: null
1601
+ }))
1602
+ })))), contestData.showMarketAutoLinkModal && /*#__PURE__*/React.createElement(View, {
1603
+ style: {
1604
+ position: 'fixed',
1605
+ top: 0,
1606
+ left: 0,
1607
+ right: 0,
1608
+ bottom: 0,
1609
+ backgroundColor: Colors.views.blur,
1610
+ justifyContent: 'center',
1611
+ alignItems: 'center',
1612
+ padding: 20,
1613
+ zIndex: 1000
1614
+ }
1615
+ }, /*#__PURE__*/React.createElement(View, {
1616
+ float: true,
1617
+ style: {
1618
+ maxWidth: 700,
1619
+ width: '100%',
1620
+ maxHeight: '90%',
1621
+ borderRadius: 8,
1622
+ overflow: 'hidden'
1623
+ }
1624
+ }, /*#__PURE__*/React.createElement(View, {
1625
+ type: "header",
1626
+ style: {
1627
+ padding: 20
1628
+ }
1629
+ }, /*#__PURE__*/React.createElement(Text, {
1630
+ theme: "h1",
1631
+ size: 18
1632
+ }, "Auto-Link Markets"), /*#__PURE__*/React.createElement(Text, {
1633
+ theme: "description",
1634
+ size: 14,
1635
+ style: {
1636
+ marginTop: 5
1637
+ }
1638
+ }, "Select markets and partner to auto-link")), /*#__PURE__*/React.createElement(ScrollView, {
1639
+ style: {
1640
+ flex: 1
1641
+ }
1642
+ }, /*#__PURE__*/React.createElement(View, {
1643
+ transparent: true,
1644
+ style: {
1645
+ padding: 20
1646
+ }
1647
+ }, /*#__PURE__*/React.createElement(Text, {
1648
+ theme: "h2",
1649
+ size: 14,
1650
+ style: {
1651
+ marginBottom: 10
1652
+ }
1653
+ }, "Select Markets:"), /*#__PURE__*/React.createElement(Text, {
1654
+ theme: "description",
1655
+ size: 12,
1656
+ style: {
1657
+ marginBottom: 15
1658
+ }
1659
+ }, "Choose which markets to auto-link for the selected partner"), contestData.allRouterMarkets.filter(m => m.status === 'active').map(market => {
1660
+ const isSelected = contestData.selectedMarketIds.includes(market.router_market_id);
1661
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
1662
+ key: market.router_market_id,
1663
+ style: {
1664
+ padding: 12,
1665
+ marginBottom: 8,
1666
+ backgroundColor: isSelected ? Colors.text.action : Colors.views.header,
1667
+ borderRadius: 6,
1668
+ borderWidth: isSelected ? 2 : 1,
1669
+ borderColor: isSelected ? Colors.text.action : Colors.borders.light
1670
+ },
1671
+ onPress: () => {
1672
+ setContestData(prev => ({
1673
+ ...prev,
1674
+ selectedMarketIds: isSelected ? prev.selectedMarketIds.filter(id => id !== market.router_market_id) : [...prev.selectedMarketIds, market.router_market_id]
1675
+ }));
1676
+ }
1677
+ }, /*#__PURE__*/React.createElement(View, {
1678
+ transparent: true,
1679
+ style: {
1680
+ flexDirection: 'row',
1681
+ alignItems: 'center',
1682
+ gap: 10
1683
+ }
1684
+ }, /*#__PURE__*/React.createElement(View, {
1685
+ style: {
1686
+ width: 20,
1687
+ height: 20,
1688
+ borderRadius: 4,
1689
+ borderWidth: 2,
1690
+ borderColor: isSelected ? Colors.text.success : Colors.borders.light,
1691
+ backgroundColor: isSelected ? Colors.text.success : 'transparent',
1692
+ justifyContent: 'center',
1693
+ alignItems: 'center'
1694
+ }
1695
+ }, isSelected && /*#__PURE__*/React.createElement(Icons.CheckIcon, {
1696
+ color: Colors.text.white,
1697
+ size: 12
1698
+ })), /*#__PURE__*/React.createElement(View, {
1699
+ transparent: true,
1700
+ style: {
1701
+ flex: 1
1702
+ }
1703
+ }, /*#__PURE__*/React.createElement(Text, {
1704
+ theme: "h2",
1705
+ size: 13
1706
+ }, market.market_label), /*#__PURE__*/React.createElement(Text, {
1707
+ theme: "description",
1708
+ size: 11,
1709
+ style: {
1710
+ marginTop: 2
1711
+ }
1712
+ }, market.market_description))));
1713
+ }), /*#__PURE__*/React.createElement(Text, {
1714
+ theme: "h2",
1715
+ size: 14,
1716
+ style: {
1717
+ marginTop: 20,
1718
+ marginBottom: 10
1719
+ }
1720
+ }, "Select Partner:"), contestData.partners.map(partner => /*#__PURE__*/React.createElement(View, {
1721
+ key: partner.partner_id,
1722
+ transparent: true,
1723
+ style: {
1724
+ marginBottom: 10,
1725
+ padding: 15,
1726
+ backgroundColor: Colors.views.header,
1727
+ borderRadius: 8,
1728
+ flexDirection: 'row',
1729
+ alignItems: 'center',
1730
+ justifyContent: 'space-between'
1731
+ }
1732
+ }, /*#__PURE__*/React.createElement(Text, {
1733
+ theme: "h2",
1734
+ size: 14
1735
+ }, partner.name), /*#__PURE__*/React.createElement(Button, {
1736
+ type: "action",
1737
+ title: "Auto-Link",
1738
+ onPress: async () => {
1739
+ if (contestData.selectedMarketIds.length === 0) {
1740
+ alert('Please select at least one market');
1741
+ return;
1742
+ }
1743
+ try {
1744
+ setContestData(prev => ({
1745
+ ...prev,
1746
+ loading: true
1747
+ }));
1748
+ const results = [];
1749
+
1750
+ // Call auto-link for each selected market
1751
+ for (const marketId of contestData.selectedMarketIds) {
1752
+ const result = await BetRouterApi.BetRouter.AutoLinkingApi.autoLinkMarkets(league.router_league_id, marketId, partner.partner_id);
1753
+ results.push(result);
1754
+ }
1755
+
1756
+ // Combine results
1757
+ const combinedResults = {
1758
+ entity_type: 'market',
1759
+ partner_name: partner.name,
1760
+ total_router_entities: results.reduce((sum, r) => sum + r.total_router_entities, 0),
1761
+ matched_count: results.reduce((sum, r) => sum + r.matched_count, 0),
1762
+ created_count: results.reduce((sum, r) => sum + (r.created_count || 0), 0),
1763
+ updated_count: results.reduce((sum, r) => sum + (r.updated_count || 0), 0),
1764
+ failed_count: results.reduce((sum, r) => sum + r.failed_count, 0),
1765
+ results: results.flatMap(r => r.results)
1766
+ };
1767
+ setContestData(prev => ({
1768
+ ...prev,
1769
+ autoLinkResults: combinedResults,
1770
+ showMarketAutoLinkModal: false,
1771
+ showAutoLinkResults: true,
1772
+ selectedMarketIds: [],
1773
+ loading: false
1774
+ }));
1775
+ } catch (error) {
1776
+ console.error('Error auto-linking markets:', error);
1777
+ alert('Error auto-linking markets: ' + error.message);
1778
+ setContestData(prev => ({
1779
+ ...prev,
1780
+ loading: false
1781
+ }));
1782
+ }
1783
+ },
1784
+ style: {
1785
+ paddingHorizontal: 15,
1786
+ paddingVertical: 8
1787
+ }
1788
+ }))))), /*#__PURE__*/React.createElement(View, {
1789
+ type: "footer",
1790
+ style: {
1791
+ padding: 15
1792
+ }
1793
+ }, /*#__PURE__*/React.createElement(Button, {
1794
+ type: "close",
1795
+ title: "Cancel",
1796
+ onPress: () => setContestData(prev => ({
1797
+ ...prev,
1798
+ showMarketAutoLinkModal: false,
1799
+ selectedMarketIds: []
1800
+ }))
1801
+ })))), contestData.showManageMarketsModal && contestData.selectedContest && /*#__PURE__*/React.createElement(View, {
1802
+ style: {
1803
+ position: 'fixed',
1804
+ top: 0,
1805
+ left: 0,
1806
+ right: 0,
1807
+ bottom: 0,
1808
+ backgroundColor: Colors.views.blur,
1809
+ justifyContent: 'center',
1810
+ alignItems: 'center',
1811
+ padding: 20,
1812
+ zIndex: 1000
1813
+ }
1814
+ }, /*#__PURE__*/React.createElement(View, {
1815
+ float: true,
1816
+ style: {
1817
+ maxWidth: 600,
1818
+ width: '100%',
1819
+ maxHeight: '80%',
1820
+ borderRadius: 8,
1821
+ overflow: 'hidden'
1822
+ }
1823
+ }, /*#__PURE__*/React.createElement(View, {
1824
+ type: "header",
1825
+ style: {
1826
+ padding: 20
1827
+ }
1828
+ }, /*#__PURE__*/React.createElement(Text, {
1829
+ theme: "h1",
1830
+ size: 18
1831
+ }, "Manage Markets"), /*#__PURE__*/React.createElement(Text, {
1832
+ theme: "description",
1833
+ size: 14,
1834
+ style: {
1835
+ marginTop: 5
1836
+ }
1837
+ }, "Select which markets are supported for \"", contestData.selectedContest.contest_label, "\"")), /*#__PURE__*/React.createElement(ScrollView, {
1838
+ style: {
1839
+ flex: 1
1840
+ }
1841
+ }, /*#__PURE__*/React.createElement(View, {
1842
+ transparent: true,
1843
+ style: {
1844
+ padding: 20
1845
+ }
1846
+ }, contestData.allRouterMarkets.length === 0 ? /*#__PURE__*/React.createElement(Text, {
1847
+ theme: "description",
1848
+ size: 13,
1849
+ style: {
1850
+ textAlign: 'center',
1851
+ padding: 20
1852
+ }
1853
+ }, "No markets available") : contestData.allRouterMarkets.map(market => {
1854
+ const isSupported = contestData.marketContests.some(mc => mc.router_market_id === market.router_market_id);
1855
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
1856
+ key: market.router_market_id,
1857
+ style: {
1858
+ padding: 15,
1859
+ marginBottom: 10,
1860
+ backgroundColor: isSupported ? Colors.text.action : Colors.views.header,
1861
+ borderRadius: 8,
1862
+ borderWidth: isSupported ? 2 : 1,
1863
+ borderColor: isSupported ? Colors.text.success : Colors.borders.light
1864
+ },
1865
+ onPress: () => toggleMarketSupport(market.router_market_id)
1866
+ }, /*#__PURE__*/React.createElement(View, {
1867
+ transparent: true,
1868
+ style: {
1869
+ flexDirection: 'row',
1870
+ alignItems: 'center'
1871
+ }
1872
+ }, /*#__PURE__*/React.createElement(View, {
1873
+ transparent: true,
1874
+ style: {
1875
+ marginRight: 10
1876
+ }
1877
+ }, isSupported ? /*#__PURE__*/React.createElement(Icons.CheckCirlceIcon, {
1878
+ color: Colors.text.success,
1879
+ size: 20
1880
+ }) : /*#__PURE__*/React.createElement(View, {
1881
+ style: {
1882
+ width: 20,
1883
+ height: 20,
1884
+ borderWidth: 2,
1885
+ borderColor: Colors.borders.light,
1886
+ borderRadius: 4
1887
+ }
1888
+ })), /*#__PURE__*/React.createElement(View, {
1889
+ transparent: true,
1890
+ style: {
1891
+ flex: 1
1892
+ }
1893
+ }, /*#__PURE__*/React.createElement(Text, {
1894
+ theme: "h2",
1895
+ size: 14
1896
+ }, market.market_label), /*#__PURE__*/React.createElement(Text, {
1897
+ theme: "description",
1898
+ size: 12,
1899
+ style: {
1900
+ marginTop: 3
1901
+ }
1902
+ }, market.market_description), isSupported && /*#__PURE__*/React.createElement(Text, {
1903
+ theme: "description",
1904
+ size: 12,
1905
+ style: {
1906
+ marginTop: 3,
1907
+ color: Colors.text.success
1908
+ }
1909
+ }, "\u2713 Currently Active"))));
1910
+ }))), /*#__PURE__*/React.createElement(View, {
1911
+ type: "footer",
1912
+ style: {
1913
+ padding: 15
1914
+ }
1915
+ }, /*#__PURE__*/React.createElement(Button, {
1916
+ type: "action",
1917
+ title: "Done",
1918
+ onPress: () => setContestData(prev => ({
1919
+ ...prev,
1920
+ showManageMarketsModal: false
1921
+ }))
1922
+ })))), contestData.showLinkMarketsModal && contestData.selectedMarketContest && contestData.selectedPartner && /*#__PURE__*/React.createElement(View, {
1923
+ style: {
1924
+ position: 'fixed',
1925
+ top: 0,
1926
+ left: 0,
1927
+ right: 0,
1928
+ bottom: 0,
1929
+ backgroundColor: Colors.views.blur,
1930
+ justifyContent: 'center',
1931
+ alignItems: 'center',
1932
+ padding: 20,
1933
+ zIndex: 1000
1934
+ }
1935
+ }, /*#__PURE__*/React.createElement(View, {
1936
+ float: true,
1937
+ style: {
1938
+ width: '90%',
1939
+ maxWidth: 600,
1940
+ maxHeight: '80%',
1941
+ borderRadius: 8,
1942
+ overflow: 'hidden',
1943
+ flexDirection: 'column'
1944
+ }
1945
+ }, /*#__PURE__*/React.createElement(View, {
1946
+ type: "header",
1947
+ style: {
1948
+ padding: 16,
1949
+ flexDirection: 'row',
1950
+ justifyContent: 'space-between',
1951
+ alignItems: 'center'
1952
+ }
1953
+ }, /*#__PURE__*/React.createElement(View, {
1954
+ transparent: true
1955
+ }, /*#__PURE__*/React.createElement(Text, {
1956
+ theme: "h1",
1957
+ size: 18
1958
+ }, "Link Raw Markets"), /*#__PURE__*/React.createElement(Text, {
1959
+ theme: "description",
1960
+ size: 12,
1961
+ style: {
1962
+ marginTop: 4
1963
+ }
1964
+ }, contestData.selectedPartner.name, " \u2192 ", contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id)?.market_label)), /*#__PURE__*/React.createElement(TouchableOpacity, {
1965
+ onPress: () => setContestData(prev => ({
1966
+ ...prev,
1967
+ showLinkMarketsModal: false
1968
+ }))
1969
+ }, /*#__PURE__*/React.createElement(Icons.CloseIcon, {
1970
+ size: 24,
1971
+ color: Colors.text.h1
1972
+ }))), contestData.alreadyLinkedRawMarkets.length > 0 && /*#__PURE__*/React.createElement(View, {
1973
+ transparent: true,
1974
+ style: {
1975
+ padding: 16,
1976
+ paddingTop: 0
1977
+ }
1978
+ }, /*#__PURE__*/React.createElement(Text, {
1979
+ theme: "h2",
1980
+ size: 13,
1981
+ style: {
1982
+ marginBottom: 8
1983
+ }
1984
+ }, "Already Linked:"), contestData.alreadyLinkedRawMarkets.map(raw => /*#__PURE__*/React.createElement(View, {
1985
+ key: raw.raw_market_id,
1986
+ transparent: true,
1987
+ style: {
1988
+ padding: 8,
1989
+ marginBottom: 4,
1990
+ backgroundColor: Colors.views.header,
1991
+ borderRadius: 4
1992
+ }
1993
+ }, /*#__PURE__*/React.createElement(Text, {
1994
+ theme: "description",
1995
+ size: 12
1996
+ }, raw.pretty_title, " (", raw.external_id, ")")))), /*#__PURE__*/React.createElement(ScrollView, {
1997
+ style: {
1998
+ flex: 1
1999
+ }
2000
+ }, /*#__PURE__*/React.createElement(View, {
2001
+ transparent: true,
2002
+ style: {
2003
+ padding: 16
2004
+ }
2005
+ }, /*#__PURE__*/React.createElement(Text, {
2006
+ theme: "h2",
2007
+ size: 13,
2008
+ style: {
2009
+ marginBottom: 8
2010
+ }
2011
+ }, "Available Raw Markets:"), contestData.availableRawMarkets.length === 0 ? /*#__PURE__*/React.createElement(Text, {
2012
+ theme: "description",
2013
+ size: 12,
2014
+ style: {
2015
+ textAlign: 'center',
2016
+ padding: 20,
2017
+ opacity: 0.6
2018
+ }
2019
+ }, "No available raw markets to link") : contestData.availableRawMarkets.map(rawMarket => /*#__PURE__*/React.createElement(View, {
2020
+ key: rawMarket.raw_market_id,
2021
+ transparent: true,
2022
+ style: {
2023
+ padding: 12,
2024
+ marginBottom: 8,
2025
+ backgroundColor: Colors.views.header,
2026
+ borderRadius: 6,
2027
+ borderWidth: 1,
2028
+ borderColor: Colors.borders.light
2029
+ }
2030
+ }, /*#__PURE__*/React.createElement(View, {
2031
+ transparent: true,
2032
+ style: {
2033
+ flexDirection: 'row',
2034
+ justifyContent: 'space-between',
2035
+ alignItems: 'center'
2036
+ }
2037
+ }, /*#__PURE__*/React.createElement(View, {
2038
+ transparent: true,
2039
+ style: {
2040
+ flex: 1
2041
+ }
2042
+ }, /*#__PURE__*/React.createElement(Text, {
2043
+ theme: "h2",
2044
+ size: 13
2045
+ }, rawMarket.pretty_title), /*#__PURE__*/React.createElement(Text, {
2046
+ theme: "description",
2047
+ size: 11,
2048
+ style: {
2049
+ marginTop: 2
2050
+ }
2051
+ }, "External ID: ", rawMarket.external_id)), /*#__PURE__*/React.createElement(Button, {
2052
+ type: "action",
2053
+ title: "Link",
2054
+ onPress: () => openManualLinkModal(rawMarket),
2055
+ style: {
2056
+ paddingHorizontal: 12,
2057
+ paddingVertical: 6
2058
+ }
2059
+ })))))), /*#__PURE__*/React.createElement(View, {
2060
+ type: "footer",
2061
+ style: {
2062
+ padding: 16
2063
+ }
2064
+ }, /*#__PURE__*/React.createElement(Button, {
2065
+ type: "close",
2066
+ title: "Close",
2067
+ onPress: () => setContestData(prev => ({
2068
+ ...prev,
2069
+ showLinkMarketsModal: false
2070
+ }))
2071
+ })))), contestData.showAddVariableModal && contestData.selectedMarketContest && contestData.selectedPartner && /*#__PURE__*/React.createElement(View, {
2072
+ style: {
2073
+ position: 'fixed',
2074
+ top: 0,
2075
+ left: 0,
2076
+ right: 0,
2077
+ bottom: 0,
2078
+ backgroundColor: Colors.views.blur,
2079
+ justifyContent: 'center',
2080
+ alignItems: 'center',
2081
+ padding: 20,
2082
+ zIndex: 1000
2083
+ }
2084
+ }, /*#__PURE__*/React.createElement(View, {
2085
+ float: true,
2086
+ style: {
2087
+ maxWidth: 500,
2088
+ width: '100%',
2089
+ borderRadius: 8,
2090
+ overflow: 'hidden'
2091
+ }
2092
+ }, /*#__PURE__*/React.createElement(View, {
2093
+ type: "header",
2094
+ style: {
2095
+ padding: 20
2096
+ }
2097
+ }, /*#__PURE__*/React.createElement(Text, {
2098
+ theme: "h1",
2099
+ size: 18
2100
+ }, "Add Variable"), /*#__PURE__*/React.createElement(Text, {
2101
+ theme: "description",
2102
+ size: 14,
2103
+ style: {
2104
+ marginTop: 5
2105
+ }
2106
+ }, contestData.selectedPartner.name, " \u2022 ", contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id)?.market_label)), /*#__PURE__*/React.createElement(View, {
2107
+ type: "body",
2108
+ style: {
2109
+ padding: 20
2110
+ }
2111
+ }, (() => {
2112
+ const routerMarket = contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id);
2113
+ const variableType = routerMarket?.default_variable_type || 'spread';
2114
+
2115
+ // Try to find home participant from existing partner markets
2116
+ const homeSide = contestData.marketSides.find(s => s.router_market_id === routerMarket?.router_market_id && s.side_key === 'home');
2117
+ const existingHomeMarket = contestData.inspectPartnerMarkets.length > 0 ? contestData.inspectPartnerMarkets.find(pm => pm.market_side_id === homeSide?.market_side_id) : contestData.partnerMarkets.find(pm => pm.router_market_id === routerMarket?.router_market_id && pm.market_side_id === homeSide?.market_side_id && pm.router_contest_id === contestData.selectedContest?.router_contest_id);
2118
+ const homeParticipantId = existingHomeMarket?.partner_participant_id;
2119
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
2120
+ theme: "description",
2121
+ size: 13,
2122
+ style: {
2123
+ marginBottom: 15
2124
+ }
2125
+ }, variableType === 'spread' ? 'Enter the spread value from the HOME team\'s perspective. For example, if the home team is favored by 7 points, enter -7. This creates home -7 and away +7.' : 'Enter the total value (e.g., 220.5 for over/under 220.5). This will automatically create both over and under sides.'), homeParticipantId && (() => {
2126
+ const participantName = getParticipantName(homeParticipantId);
2127
+ return /*#__PURE__*/React.createElement(View, {
2128
+ transparent: true,
2129
+ style: {
2130
+ padding: 10,
2131
+ backgroundColor: Colors.views.header,
2132
+ borderRadius: 6,
2133
+ marginBottom: 12
2134
+ }
2135
+ }, /*#__PURE__*/React.createElement(Text, {
2136
+ theme: "description",
2137
+ size: 11,
2138
+ style: {
2139
+ marginBottom: 4
2140
+ }
2141
+ }, "Home Team:"), /*#__PURE__*/React.createElement(Text, {
2142
+ theme: "h2",
2143
+ size: 12
2144
+ }, participantName || homeParticipantId), participantName && /*#__PURE__*/React.createElement(Text, {
2145
+ theme: "description",
2146
+ size: 10,
2147
+ style: {
2148
+ marginTop: 2
2149
+ }
2150
+ }, "ID: ", homeParticipantId));
2151
+ })(), /*#__PURE__*/React.createElement(Text, {
2152
+ theme: "h2",
2153
+ size: 13,
2154
+ style: {
2155
+ marginBottom: 8
2156
+ }
2157
+ }, variableType === 'spread' ? 'Home Team Spread:' : 'Total Value:'), /*#__PURE__*/React.createElement(TextInput, {
2158
+ style: {
2159
+ padding: 12,
2160
+ borderWidth: 1,
2161
+ borderColor: Colors.borders.light,
2162
+ borderRadius: 6,
2163
+ backgroundColor: Colors.views.header,
2164
+ color: Colors.text.h1,
2165
+ fontSize: 14
2166
+ },
2167
+ value: contestData.newVariableValue,
2168
+ onChangeText: text => setContestData(prev => ({
2169
+ ...prev,
2170
+ newVariableValue: text
2171
+ })),
2172
+ placeholder: variableType === 'spread' ? 'e.g., -7 or +3.5' : 'e.g., 220.5',
2173
+ placeholderTextColor: Colors.text.description,
2174
+ keyboardType: "numeric"
2175
+ }), variableType === 'spread' && contestData.newVariableValue && !isNaN(parseFloat(contestData.newVariableValue)) && /*#__PURE__*/React.createElement(Text, {
2176
+ theme: "description",
2177
+ size: 11,
2178
+ style: {
2179
+ marginTop: 8,
2180
+ fontStyle: 'italic'
2181
+ }
2182
+ }, "Will create: Home ", contestData.newVariableValue, " / Away ", parseFloat(contestData.newVariableValue) * -1), /*#__PURE__*/React.createElement(Text, {
2183
+ theme: "description",
2184
+ size: 11,
2185
+ style: {
2186
+ marginTop: 10,
2187
+ fontStyle: 'italic'
2188
+ }
2189
+ }, "This will create partner markets for all raw markets from ", contestData.selectedPartner.name, " that match this contest."));
2190
+ })()), /*#__PURE__*/React.createElement(View, {
2191
+ type: "footer",
2192
+ style: {
2193
+ padding: 15,
2194
+ flexDirection: 'row',
2195
+ gap: 10,
2196
+ justifyContent: 'flex-end'
2197
+ }
2198
+ }, /*#__PURE__*/React.createElement(Button, {
2199
+ type: "close",
2200
+ title: "Cancel",
2201
+ onPress: () => setContestData(prev => ({
2202
+ ...prev,
2203
+ showAddVariableModal: false,
2204
+ newVariableValue: ''
2205
+ }))
2206
+ }), /*#__PURE__*/React.createElement(Button, {
2207
+ type: "action",
2208
+ title: "Add Variable",
2209
+ onPress: addVariable,
2210
+ disabled: !contestData.newVariableValue || isNaN(parseFloat(contestData.newVariableValue))
2211
+ })))), contestData.showInspectModal && contestData.selectedMarketContest && contestData.selectedPartner && /*#__PURE__*/React.createElement(View, {
2212
+ style: {
2213
+ position: 'fixed',
2214
+ top: 0,
2215
+ left: 0,
2216
+ right: 0,
2217
+ bottom: 0,
2218
+ backgroundColor: Colors.views.blur,
2219
+ justifyContent: 'center',
2220
+ alignItems: 'center',
2221
+ padding: 20,
2222
+ zIndex: 1000
2223
+ }
2224
+ }, /*#__PURE__*/React.createElement(View, {
2225
+ float: true,
2226
+ style: {
2227
+ width: '90%',
2228
+ maxWidth: 800,
2229
+ maxHeight: '85%',
2230
+ borderRadius: 8,
2231
+ overflow: 'hidden',
2232
+ flexDirection: 'column'
2233
+ }
2234
+ }, /*#__PURE__*/React.createElement(View, {
2235
+ type: "header",
2236
+ style: {
2237
+ padding: 16,
2238
+ flexDirection: 'row',
2239
+ justifyContent: 'space-between',
2240
+ alignItems: 'center'
2241
+ }
2242
+ }, /*#__PURE__*/React.createElement(View, {
2243
+ transparent: true
2244
+ }, /*#__PURE__*/React.createElement(Text, {
2245
+ theme: "h1",
2246
+ size: 18
2247
+ }, "Partner Markets"), /*#__PURE__*/React.createElement(Text, {
2248
+ theme: "description",
2249
+ size: 12,
2250
+ style: {
2251
+ marginTop: 4
2252
+ }
2253
+ }, contestData.selectedPartner.name, " \u2022 ", contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id)?.market_label)), /*#__PURE__*/React.createElement(TouchableOpacity, {
2254
+ onPress: () => setContestData(prev => ({
2255
+ ...prev,
2256
+ showInspectModal: false
2257
+ }))
2258
+ }, /*#__PURE__*/React.createElement(Icons.CloseIcon, {
2259
+ size: 24,
2260
+ color: Colors.text.h1
2261
+ }))), /*#__PURE__*/React.createElement(ScrollView, {
2262
+ style: {
2263
+ flex: 1
2264
+ }
2265
+ }, /*#__PURE__*/React.createElement(View, {
2266
+ transparent: true,
2267
+ style: {
2268
+ padding: 16
2269
+ }
2270
+ }, contestData.inspectPartnerMarkets.length === 0 ? /*#__PURE__*/React.createElement(Text, {
2271
+ theme: "description",
2272
+ size: 13,
2273
+ style: {
2274
+ textAlign: 'center',
2275
+ padding: 20
2276
+ }
2277
+ }, "No partner markets found") : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
2278
+ theme: "h2",
2279
+ size: 14,
2280
+ style: {
2281
+ marginBottom: 12
2282
+ }
2283
+ }, contestData.inspectPartnerMarkets.length, " Partner Market", contestData.inspectPartnerMarkets.length !== 1 ? 's' : ''), contestData.inspectPartnerMarkets.map((pm, index) => {
2284
+ // Find enriched data
2285
+ const side = contestData.marketSides.find(s => s.market_side_id === pm.market_side_id);
2286
+ const variable = contestData.marketVariables.find(v => v.router_market_variable_id === pm.router_market_variable_id);
2287
+ return /*#__PURE__*/React.createElement(View, {
2288
+ key: pm.partner_market_id,
2289
+ transparent: true,
2290
+ style: {
2291
+ padding: 14,
2292
+ marginBottom: 10,
2293
+ backgroundColor: Colors.views.header,
2294
+ borderRadius: 8,
2295
+ borderWidth: 1,
2296
+ borderColor: Colors.borders.light
2297
+ }
2298
+ }, /*#__PURE__*/React.createElement(View, {
2299
+ transparent: true,
2300
+ style: {
2301
+ flexDirection: 'row',
2302
+ justifyContent: 'space-between',
2303
+ marginBottom: 8
2304
+ }
2305
+ }, /*#__PURE__*/React.createElement(Text, {
2306
+ theme: "h2",
2307
+ size: 13
2308
+ }, side ? `${side.side_key}` : `Partner Market #${index + 1}`, variable ? ` (${variable.variable > 0 ? '+' : ''}${variable.variable})` : ''), /*#__PURE__*/React.createElement(Text, {
2309
+ theme: "description",
2310
+ size: 11
2311
+ }, "ID: ", pm.partner_market_id.slice(0, 8), "...")), /*#__PURE__*/React.createElement(View, {
2312
+ transparent: true,
2313
+ style: {
2314
+ gap: 6
2315
+ }
2316
+ }, /*#__PURE__*/React.createElement(View, {
2317
+ transparent: true,
2318
+ style: {
2319
+ flexDirection: 'row'
2320
+ }
2321
+ }, /*#__PURE__*/React.createElement(Text, {
2322
+ theme: "description",
2323
+ size: 12,
2324
+ style: {
2325
+ width: 160
2326
+ }
2327
+ }, "External ID:"), /*#__PURE__*/React.createElement(Text, {
2328
+ theme: "h2",
2329
+ size: 12,
2330
+ style: {
2331
+ flex: 1
2332
+ }
2333
+ }, pm.external_id)), side && /*#__PURE__*/React.createElement(View, {
2334
+ transparent: true,
2335
+ style: {
2336
+ flexDirection: 'row'
2337
+ }
2338
+ }, /*#__PURE__*/React.createElement(Text, {
2339
+ theme: "description",
2340
+ size: 12,
2341
+ style: {
2342
+ width: 160
2343
+ }
2344
+ }, "Side:"), /*#__PURE__*/React.createElement(Text, {
2345
+ theme: "h2",
2346
+ size: 12,
2347
+ style: {
2348
+ flex: 1
2349
+ }
2350
+ }, side.side_key, " (", side.side_type, ")")), variable && /*#__PURE__*/React.createElement(View, {
2351
+ transparent: true,
2352
+ style: {
2353
+ flexDirection: 'row'
2354
+ }
2355
+ }, /*#__PURE__*/React.createElement(Text, {
2356
+ theme: "description",
2357
+ size: 12,
2358
+ style: {
2359
+ width: 160
2360
+ }
2361
+ }, "Variable:"), /*#__PURE__*/React.createElement(Text, {
2362
+ theme: "h2",
2363
+ size: 12,
2364
+ style: {
2365
+ flex: 1
2366
+ }
2367
+ }, variable.variable, " (", variable.variable_type, ")")), /*#__PURE__*/React.createElement(View, {
2368
+ transparent: true,
2369
+ style: {
2370
+ flexDirection: 'row'
2371
+ }
2372
+ }, /*#__PURE__*/React.createElement(Text, {
2373
+ theme: "description",
2374
+ size: 12,
2375
+ style: {
2376
+ width: 160
2377
+ }
2378
+ }, "Raw Market ID:"), /*#__PURE__*/React.createElement(Text, {
2379
+ theme: "h2",
2380
+ size: 12,
2381
+ style: {
2382
+ flex: 1
2383
+ }
2384
+ }, pm.raw_market_id)), pm.partner_participant_id && (() => {
2385
+ const participantName = getParticipantName(pm.partner_participant_id);
2386
+ return /*#__PURE__*/React.createElement(View, {
2387
+ transparent: true,
2388
+ style: {
2389
+ flexDirection: 'row'
2390
+ }
2391
+ }, /*#__PURE__*/React.createElement(Text, {
2392
+ theme: "description",
2393
+ size: 12,
2394
+ style: {
2395
+ width: 160
2396
+ }
2397
+ }, "Participant:"), /*#__PURE__*/React.createElement(View, {
2398
+ transparent: true,
2399
+ style: {
2400
+ flex: 1
2401
+ }
2402
+ }, /*#__PURE__*/React.createElement(Text, {
2403
+ theme: "h2",
2404
+ size: 12
2405
+ }, participantName || pm.partner_participant_id), participantName && /*#__PURE__*/React.createElement(Text, {
2406
+ theme: "description",
2407
+ size: 10,
2408
+ style: {
2409
+ marginTop: 2
2410
+ }
2411
+ }, "ID: ", pm.partner_participant_id)));
2412
+ })(), pm.timeframe_id && /*#__PURE__*/React.createElement(View, {
2413
+ transparent: true,
2414
+ style: {
2415
+ flexDirection: 'row'
2416
+ }
2417
+ }, /*#__PURE__*/React.createElement(Text, {
2418
+ theme: "description",
2419
+ size: 12,
2420
+ style: {
2421
+ width: 160
2422
+ }
2423
+ }, "Timeframe ID:"), /*#__PURE__*/React.createElement(Text, {
2424
+ theme: "h2",
2425
+ size: 12,
2426
+ style: {
2427
+ flex: 1
2428
+ }
2429
+ }, pm.timeframe_id)), pm.price_key && /*#__PURE__*/React.createElement(View, {
2430
+ transparent: true,
2431
+ style: {
2432
+ flexDirection: 'row'
2433
+ }
2434
+ }, /*#__PURE__*/React.createElement(Text, {
2435
+ theme: "description",
2436
+ size: 12,
2437
+ style: {
2438
+ width: 160
2439
+ }
2440
+ }, "Price Key:"), /*#__PURE__*/React.createElement(Text, {
2441
+ theme: "h2",
2442
+ size: 12,
2443
+ style: {
2444
+ flex: 1
2445
+ }
2446
+ }, pm.price_key))));
2447
+ })))), /*#__PURE__*/React.createElement(View, {
2448
+ type: "footer",
2449
+ style: {
2450
+ padding: 16
2451
+ }
2452
+ }, /*#__PURE__*/React.createElement(Button, {
2453
+ type: "close",
2454
+ title: "Close",
2455
+ onPress: () => setContestData(prev => ({
2456
+ ...prev,
2457
+ showInspectModal: false
2458
+ }))
2459
+ })))), contestData.showManualLinkModal && contestData.selectedRawMarket && contestData.linkingData && /*#__PURE__*/React.createElement(View, {
2460
+ style: {
2461
+ position: 'fixed',
2462
+ top: 0,
2463
+ left: 0,
2464
+ right: 0,
2465
+ bottom: 0,
2466
+ backgroundColor: Colors.views.blur,
2467
+ justifyContent: 'center',
2468
+ alignItems: 'center',
2469
+ padding: 20,
2470
+ zIndex: 1000
2471
+ }
2472
+ }, /*#__PURE__*/React.createElement(View, {
2473
+ float: true,
2474
+ style: {
2475
+ width: '90%',
2476
+ maxWidth: 600,
2477
+ maxHeight: '85%',
2478
+ borderRadius: 8,
2479
+ overflow: 'hidden',
2480
+ flexDirection: 'column'
2481
+ }
2482
+ }, /*#__PURE__*/React.createElement(View, {
2483
+ type: "header",
2484
+ style: {
2485
+ padding: 16,
2486
+ flexDirection: 'row',
2487
+ justifyContent: 'space-between',
2488
+ alignItems: 'center'
2489
+ }
2490
+ }, /*#__PURE__*/React.createElement(View, {
2491
+ transparent: true
2492
+ }, /*#__PURE__*/React.createElement(Text, {
2493
+ theme: "h1",
2494
+ size: 18
2495
+ }, "Link Market"), /*#__PURE__*/React.createElement(Text, {
2496
+ theme: "description",
2497
+ size: 12,
2498
+ style: {
2499
+ marginTop: 4
2500
+ }
2501
+ }, contestData.selectedRawMarket.pretty_title)), /*#__PURE__*/React.createElement(TouchableOpacity, {
2502
+ onPress: () => setContestData(prev => ({
2503
+ ...prev,
2504
+ showManualLinkModal: false
2505
+ }))
2506
+ }, /*#__PURE__*/React.createElement(Icons.CloseIcon, {
2507
+ size: 24,
2508
+ color: Colors.text.h1
2509
+ }))), contestData.loadingModal ? /*#__PURE__*/React.createElement(View, {
2510
+ transparent: true,
2511
+ style: {
2512
+ padding: 40,
2513
+ alignItems: 'center'
2514
+ }
2515
+ }, /*#__PURE__*/React.createElement(ActivityIndicator, {
2516
+ size: "large",
2517
+ color: Colors.text.h1
2518
+ })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ScrollView, {
2519
+ style: {
2520
+ flex: 1
2521
+ }
2522
+ }, /*#__PURE__*/React.createElement(View, {
2523
+ transparent: true,
2524
+ style: {
2525
+ padding: 16
2526
+ }
2527
+ }, (() => {
2528
+ const routerMarket = contestData.allRouterMarkets.find(m => m.router_market_id === contestData.selectedMarketContest?.router_market_id);
2529
+ return /*#__PURE__*/React.createElement(React.Fragment, null, routerMarket?.variable_required && /*#__PURE__*/React.createElement(View, {
2530
+ transparent: true,
2531
+ style: {
2532
+ marginBottom: 20
2533
+ }
2534
+ }, /*#__PURE__*/React.createElement(Text, {
2535
+ theme: "h2",
2536
+ size: 13,
2537
+ style: {
2538
+ marginBottom: 8
2539
+ }
2540
+ }, routerMarket.default_variable_type === 'spread' ? 'Spread' : 'Total', " Value: ", /*#__PURE__*/React.createElement(Text, {
2541
+ theme: "error",
2542
+ size: 13
2543
+ }, "*")), /*#__PURE__*/React.createElement(TextInput, {
2544
+ value: contestData.manualLinkForm.variable,
2545
+ onChangeText: text => setContestData(prev => ({
2546
+ ...prev,
2547
+ manualLinkForm: {
2548
+ ...prev.manualLinkForm,
2549
+ variable: text
2550
+ }
2551
+ })),
2552
+ placeholder: routerMarket.default_variable_type === 'spread' ? 'e.g., -7 or +3.5' : 'e.g., 220.5',
2553
+ keyboardType: "numeric",
2554
+ style: {
2555
+ padding: 12,
2556
+ borderWidth: 1,
2557
+ borderColor: Colors.borders.light,
2558
+ borderRadius: 6,
2559
+ backgroundColor: Colors.views.header,
2560
+ color: Colors.text.h1,
2561
+ fontSize: 14
2562
+ }
2563
+ })), /*#__PURE__*/React.createElement(View, {
2564
+ transparent: true,
2565
+ style: {
2566
+ marginBottom: 20
2567
+ }
2568
+ }, /*#__PURE__*/React.createElement(Text, {
2569
+ theme: "h2",
2570
+ size: 13,
2571
+ style: {
2572
+ marginBottom: 8
2573
+ }
2574
+ }, "Select Side: ", /*#__PURE__*/React.createElement(Text, {
2575
+ theme: "error",
2576
+ size: 13
2577
+ }, "*")), /*#__PURE__*/React.createElement(View, {
2578
+ transparent: true,
2579
+ style: {
2580
+ flexDirection: 'row',
2581
+ gap: 8
2582
+ }
2583
+ }, contestData.linkingData.market_sides.map((side, index) => {
2584
+ const sideParticipant = contestData.manualLinkForm.sideParticipants[index];
2585
+ const hasParticipant = !!sideParticipant?.partner_participant_id;
2586
+ const isSelected = contestData.selectedSideIndex === index;
2587
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
2588
+ key: side.market_side_id,
2589
+ onPress: () => setContestData(prev => ({
2590
+ ...prev,
2591
+ selectedSideIndex: index,
2592
+ participantSearchValue: '',
2593
+ participantPage: 0
2594
+ })),
2595
+ style: {
2596
+ flex: 1,
2597
+ padding: 12,
2598
+ backgroundColor: Colors.views.header,
2599
+ borderRadius: 6,
2600
+ borderWidth: 2,
2601
+ borderColor: isSelected ? Colors.text.success : Colors.borders.light,
2602
+ flexDirection: 'row',
2603
+ alignItems: 'center',
2604
+ justifyContent: 'center',
2605
+ gap: 6
2606
+ }
2607
+ }, /*#__PURE__*/React.createElement(Text, {
2608
+ size: 14,
2609
+ style: {
2610
+ color: isSelected ? Colors.text.success : Colors.text.h1,
2611
+ fontWeight: isSelected ? '600' : '400'
2612
+ }
2613
+ }, side.side_key), hasParticipant && /*#__PURE__*/React.createElement(Text, {
2614
+ size: 14,
2615
+ style: {
2616
+ color: Colors.text.success
2617
+ }
2618
+ }, "\u2713"));
2619
+ }))), (() => {
2620
+ const selectedSide = contestData.linkingData.market_sides[contestData.selectedSideIndex];
2621
+ const sideParticipant = contestData.manualLinkForm.sideParticipants[contestData.selectedSideIndex];
2622
+ const contestLeagueId = contestData.selectedContest?.router_league_id;
2623
+
2624
+ // Filter and paginate participants
2625
+ const searchFiltered = contestData.linkingData.participants.filter(p => {
2626
+ const searchLower = contestData.participantSearchValue.toLowerCase();
2627
+ return p.name.toLowerCase().includes(searchLower) || p.raw_name.toLowerCase().includes(searchLower) || p.external_id.toLowerCase().includes(searchLower);
2628
+ });
2629
+ const leagueFiltered = searchFiltered.filter(p => {
2630
+ const routerParticipant = contestData.participants.find(rp => rp.participant_id === p.router_participant_id);
2631
+ return routerParticipant?.router_league_id === contestLeagueId;
2632
+ });
2633
+ const totalPages = Math.ceil(leagueFiltered.length / PARTICIPANTS_PER_PAGE);
2634
+ const startIdx = contestData.participantPage * PARTICIPANTS_PER_PAGE;
2635
+ const endIdx = startIdx + PARTICIPANTS_PER_PAGE;
2636
+ const paginatedParticipants = leagueFiltered.slice(startIdx, endIdx);
2637
+ return /*#__PURE__*/React.createElement(View, {
2638
+ transparent: true,
2639
+ style: {
2640
+ marginBottom: 20
2641
+ }
2642
+ }, /*#__PURE__*/React.createElement(Text, {
2643
+ theme: "h2",
2644
+ size: 13,
2645
+ style: {
2646
+ marginBottom: 8
2647
+ }
2648
+ }, "Participant for ", selectedSide?.side_key, ": ", /*#__PURE__*/React.createElement(Text, {
2649
+ theme: "error",
2650
+ size: 13
2651
+ }, "*")), /*#__PURE__*/React.createElement(Text, {
2652
+ theme: "description",
2653
+ size: 11,
2654
+ style: {
2655
+ marginBottom: 12
2656
+ }
2657
+ }, leagueFiltered.length, " participants available"), /*#__PURE__*/React.createElement(View, {
2658
+ transparent: true,
2659
+ style: {
2660
+ marginBottom: 12
2661
+ }
2662
+ }, /*#__PURE__*/React.createElement(SearchBox, {
2663
+ placeholder: "Search participants...",
2664
+ onChange: text => setContestData(prev => ({
2665
+ ...prev,
2666
+ participantSearchValue: text,
2667
+ participantPage: 0
2668
+ })),
2669
+ hide_search_button: true
2670
+ })), paginatedParticipants.length === 0 ? /*#__PURE__*/React.createElement(Text, {
2671
+ theme: "description",
2672
+ size: 12,
2673
+ style: {
2674
+ textAlign: 'center',
2675
+ padding: 20,
2676
+ opacity: 0.6
2677
+ }
2678
+ }, contestData.participantSearchValue ? 'No participants match your search' : 'No participants available for this league') : paginatedParticipants.map(participant => {
2679
+ const isSelected = sideParticipant?.partner_participant_id === participant.partner_participant_id;
2680
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
2681
+ key: participant.partner_participant_id,
2682
+ onPress: () => {
2683
+ setContestData(prev => ({
2684
+ ...prev,
2685
+ manualLinkForm: {
2686
+ ...prev.manualLinkForm,
2687
+ sideParticipants: prev.manualLinkForm.sideParticipants.map((sp, idx) => idx === prev.selectedSideIndex ? {
2688
+ ...sp,
2689
+ partner_participant_id: participant.partner_participant_id
2690
+ } : sp)
2691
+ }
2692
+ }));
2693
+ },
2694
+ style: {
2695
+ padding: 12,
2696
+ marginBottom: 6,
2697
+ backgroundColor: Colors.views.header,
2698
+ borderRadius: 6,
2699
+ borderWidth: 1,
2700
+ borderColor: isSelected ? Colors.text.success : Colors.borders.light
2701
+ }
2702
+ }, /*#__PURE__*/React.createElement(Text, {
2703
+ size: 13,
2704
+ style: {
2705
+ color: isSelected ? Colors.text.success : Colors.text.h1,
2706
+ fontWeight: isSelected ? '600' : '400'
2707
+ }
2708
+ }, participant.name), /*#__PURE__*/React.createElement(Text, {
2709
+ theme: "description",
2710
+ size: 11,
2711
+ style: {
2712
+ marginTop: 2
2713
+ }
2714
+ }, participant.raw_name, " \u2022 External ID: ", participant.external_id));
2715
+ }), totalPages > 1 && /*#__PURE__*/React.createElement(View, {
2716
+ transparent: true,
2717
+ style: {
2718
+ marginTop: 12
2719
+ }
2720
+ }, /*#__PURE__*/React.createElement(Pagination, {
2721
+ offset: contestData.participantPage,
2722
+ pages: totalPages,
2723
+ onSelectPage: page => setContestData(prev => ({
2724
+ ...prev,
2725
+ participantPage: page
2726
+ }))
2727
+ })));
2728
+ })(), contestData.linkingData.timeframes.length > 0 && /*#__PURE__*/React.createElement(View, {
2729
+ transparent: true,
2730
+ style: {
2731
+ marginBottom: 20
2732
+ }
2733
+ }, /*#__PURE__*/React.createElement(Text, {
2734
+ theme: "h2",
2735
+ size: 13,
2736
+ style: {
2737
+ marginBottom: 8
2738
+ }
2739
+ }, "Timeframe:"), contestData.linkingData.timeframes.map(timeframe => {
2740
+ const isSelected = contestData.manualLinkForm.timeframe_id === timeframe.timeframe_id;
2741
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
2742
+ key: timeframe.timeframe_id,
2743
+ onPress: () => setContestData(prev => ({
2744
+ ...prev,
2745
+ manualLinkForm: {
2746
+ ...prev.manualLinkForm,
2747
+ timeframe_id: timeframe.timeframe_id
2748
+ }
2749
+ })),
2750
+ style: {
2751
+ padding: 12,
2752
+ marginBottom: 6,
2753
+ backgroundColor: Colors.views.header,
2754
+ borderRadius: 6,
2755
+ borderWidth: 1,
2756
+ borderColor: isSelected ? Colors.text.success : Colors.borders.light
2757
+ }
2758
+ }, /*#__PURE__*/React.createElement(Text, {
2759
+ size: 13,
2760
+ style: {
2761
+ color: isSelected ? Colors.text.success : Colors.text.h1,
2762
+ fontWeight: isSelected ? '600' : '400'
2763
+ }
2764
+ }, timeframe.label));
2765
+ })), (() => {
2766
+ const selectedSide = contestData.linkingData.market_sides[contestData.selectedSideIndex];
2767
+ const sideParticipant = contestData.manualLinkForm.sideParticipants[contestData.selectedSideIndex];
2768
+ return /*#__PURE__*/React.createElement(View, {
2769
+ transparent: true,
2770
+ style: {
2771
+ marginBottom: 20
2772
+ }
2773
+ }, /*#__PURE__*/React.createElement(Text, {
2774
+ theme: "h2",
2775
+ size: 13,
2776
+ style: {
2777
+ marginBottom: 8
2778
+ }
2779
+ }, "Price Key for ", selectedSide?.side_key, " (optional):"), /*#__PURE__*/React.createElement(TextInput, {
2780
+ value: sideParticipant?.price_key || '',
2781
+ onChangeText: text => setContestData(prev => ({
2782
+ ...prev,
2783
+ manualLinkForm: {
2784
+ ...prev.manualLinkForm,
2785
+ sideParticipants: prev.manualLinkForm.sideParticipants.map((sp, idx) => idx === prev.selectedSideIndex ? {
2786
+ ...sp,
2787
+ price_key: text
2788
+ } : sp)
2789
+ }
2790
+ })),
2791
+ placeholder: "e.g., yes or no (for Kalshi)",
2792
+ style: {
2793
+ padding: 12,
2794
+ borderWidth: 1,
2795
+ borderColor: Colors.borders.light,
2796
+ borderRadius: 6,
2797
+ backgroundColor: Colors.views.header,
2798
+ color: Colors.text.h1,
2799
+ fontSize: 14
2800
+ }
2801
+ }), /*#__PURE__*/React.createElement(Text, {
2802
+ theme: "description",
2803
+ size: 11,
2804
+ style: {
2805
+ marginTop: 4
2806
+ }
2807
+ }, "Used by some partners to indicate which price to use for this side"));
2808
+ })());
2809
+ })())), /*#__PURE__*/React.createElement(View, {
2810
+ type: "footer",
2811
+ style: {
2812
+ padding: 16,
2813
+ flexDirection: 'row',
2814
+ gap: 12
2815
+ }
2816
+ }, /*#__PURE__*/React.createElement(Button, {
2817
+ type: "close",
2818
+ title: "Cancel",
2819
+ onPress: () => setContestData(prev => ({
2820
+ ...prev,
2821
+ showManualLinkModal: false
2822
+ })),
2823
+ style: {
2824
+ flex: 1
2825
+ }
2826
+ }), /*#__PURE__*/React.createElement(Button, {
2827
+ type: "action",
2828
+ title: "Link Market",
2829
+ onPress: submitManualLink,
2830
+ style: {
2831
+ flex: 1
2832
+ }
2833
+ }))))));
2834
+ };
2835
+ export default LeagueContests;
2836
+ //# sourceMappingURL=LeagueContests.js.map