tokentracker-cli 1.3.3 → 1.3.4

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 (156) hide show
  1. package/THIRD_PARTY_NOTICES.md +92 -0
  2. package/dashboard/dist/THIRD_PARTY_NOTICES.txt +92 -0
  3. package/dashboard/dist/assets/AchievementBadge-CKjtQp-U.js +1 -0
  4. package/dashboard/dist/assets/AchievementsPage-DpOXrabE.js +2 -0
  5. package/dashboard/dist/assets/{AchievementsSection-CDUUEfIi.js → AchievementsSection-DiXyIoa0.js} +1 -1
  6. package/dashboard/dist/assets/BadgeDetailModal-CILTTkPF.js +1 -0
  7. package/dashboard/dist/assets/{BotAnimated-Dx_vvTtC.js → BotAnimated-CrBHWiRi.js} +1 -1
  8. package/dashboard/dist/assets/Card-DUItW3xI.js +1 -0
  9. package/dashboard/dist/assets/CloudCheckoutPage-C_t_PDlG.js +1 -0
  10. package/dashboard/dist/assets/CloudPage-pvJUrhya.js +1 -0
  11. package/dashboard/dist/assets/CloudUsageExport-DQbDwiyk.js +4 -0
  12. package/dashboard/dist/assets/CommandPalette-BvHilrbV.js +1 -0
  13. package/dashboard/dist/assets/CommunityStatsModal-CizxEYv-.js +1 -0
  14. package/dashboard/dist/assets/{ConfirmModal-BQ-xB1S_.js → ConfirmModal-h9nISVy7.js} +1 -1
  15. package/dashboard/dist/assets/Controls-BjdIonTX.js +1 -0
  16. package/dashboard/dist/assets/DashboardPage-Bxryr4qp.js +1 -0
  17. package/dashboard/dist/assets/DateRangePopover-DpKh-0l8.js +1 -0
  18. package/dashboard/dist/assets/{DevicePage-Dg6XkIaY.js → DevicePage-DUJR9hJC.js} +1 -1
  19. package/dashboard/dist/assets/DialogClose-BmVAmN-o.js +1 -0
  20. package/dashboard/dist/assets/DialogDescription-C0Cgq67g.js +1 -0
  21. package/dashboard/dist/assets/DialogTitle-BsaIbN8k.js +1 -0
  22. package/dashboard/dist/assets/{FadeIn-ChVf45WW.js → FadeIn-BpSt2P_W.js} +1 -1
  23. package/dashboard/dist/assets/{HeaderGithubStar-B740_G7a.js → HeaderGithubStar-Cc_VHB0R.js} +1 -1
  24. package/dashboard/dist/assets/{HoverTooltip-BzP5FudR.js → HoverTooltip-WFd21iP9.js} +1 -1
  25. package/dashboard/dist/assets/{IpCheckPage-BuZH3F14.js → IpCheckPage-C_mUPSRB.js} +1 -1
  26. package/dashboard/dist/assets/LandingPage-DVR8ClZO.js +2 -0
  27. package/dashboard/dist/assets/LeaderboardPage-D8ydzVpn.js +2 -0
  28. package/dashboard/dist/assets/LeaderboardProBadge-BjX4EFl2.js +1 -0
  29. package/dashboard/dist/assets/{LeaderboardProfileModal-OUZvO6u-.js → LeaderboardProfileModal-vbPMNn7W.js} +4 -4
  30. package/dashboard/dist/assets/{LeaderboardProfilePage-bHI1oTEK.js → LeaderboardProfilePage-CqClmuA-.js} +2 -2
  31. package/dashboard/dist/assets/{LimitsPage-DKojB73_.js → LimitsPage-DaRggHge.js} +2 -2
  32. package/dashboard/dist/assets/{LocalOnlyNotice-BaEq6qN7.js → LocalOnlyNotice-B6nDke_u.js} +1 -1
  33. package/dashboard/dist/assets/LoginCard-C28QVjd7.js +1 -0
  34. package/dashboard/dist/assets/LoginModal-Bx1btNhH.js +1 -0
  35. package/dashboard/dist/assets/LoginPage-DVOGNGYI.js +1 -0
  36. package/dashboard/dist/assets/{PetPage-BPBsUHyL.js → PetPage-nOKryTde.js} +1 -1
  37. package/dashboard/dist/assets/PopoverPopup-Ch6NLnu6.js +1 -0
  38. package/dashboard/dist/assets/{ProviderIcon-BshO2uER.js → ProviderIcon-BRY2br-g.js} +1 -1
  39. package/dashboard/dist/assets/{ResetPasswordPage-RTFTD8Dr.js → ResetPasswordPage-ko1OQecQ.js} +1 -1
  40. package/dashboard/dist/assets/Select-Q8mS3_od.js +1 -0
  41. package/dashboard/dist/assets/SelectItemText-C1id8GDj.js +1 -0
  42. package/dashboard/dist/assets/{SelfHostPage-BlwTt8XM.js → SelfHostPage-Dzb2bDiM.js} +1 -1
  43. package/dashboard/dist/assets/{ServiceStatusPage-BkIcJpYK.js → ServiceStatusPage-ewFwz29J.js} +1 -1
  44. package/dashboard/dist/assets/SessionsPage-C6Y8kbnM.js +3 -0
  45. package/dashboard/dist/assets/SessionsPage-GV2fuNmd.css +1 -0
  46. package/dashboard/dist/assets/SettingsPage-nztCXEPs.js +2 -0
  47. package/dashboard/dist/assets/SkillsPage-CcG77tqU.js +1 -0
  48. package/dashboard/dist/assets/{TokenGalaxy-DiXUpXKF.js → TokenGalaxy-D2HDrbQR.js} +1 -1
  49. package/dashboard/dist/assets/TooltipPopup-C_bF2ZwO.js +1 -0
  50. package/dashboard/dist/assets/TrendMonitor-BcyoN5ns.js +19 -0
  51. package/dashboard/dist/assets/WidgetsPage-BirK0U_N.js +1 -0
  52. package/dashboard/dist/assets/{WrappedPage-ClEo-RmR.js → WrappedPage-thsXBuw6.js} +1 -1
  53. package/dashboard/dist/assets/__vite-browser-external-Bq8nj-JV.js +45 -0
  54. package/dashboard/dist/assets/__vite-browser-external-BwmeEfv7.css +1 -0
  55. package/dashboard/dist/assets/agent-logos-CK6SzhI7.js +1 -0
  56. package/dashboard/dist/assets/arrow-left-c_NOSfoq.js +1 -0
  57. package/dashboard/dist/assets/{arrow-right-CwBz5dwb.js → arrow-right-CP7drKCT.js} +1 -1
  58. package/dashboard/dist/assets/{arrow-up-right-jPmRN562.js → arrow-up-right-DQ6QfCpo.js} +1 -1
  59. package/dashboard/dist/assets/calendar-days-D_pxFQvT.js +1 -0
  60. package/dashboard/dist/assets/{check-CKwHc4Hv.js → check-HAS31kTT.js} +1 -1
  61. package/dashboard/dist/assets/chevron-down-BIMuk6oN.js +1 -0
  62. package/dashboard/dist/assets/cloud-checkout-COmDwrUT.js +1 -0
  63. package/dashboard/dist/assets/composite-kLwqpqEk.js +1 -0
  64. package/dashboard/dist/assets/download-9RgsZIiH.js +1 -0
  65. package/dashboard/dist/assets/{external-link-B5yXxdPy.js → external-link-C_gYjHGF.js} +1 -1
  66. package/dashboard/dist/assets/{flame-CKjAluj_.js → flame-BSsCvgT8.js} +1 -1
  67. package/dashboard/dist/assets/{format-tokens-mk49THtv.js → format-tokens-N22Wqv1X.js} +1 -1
  68. package/dashboard/dist/assets/{host-mode-efKlSYjX.js → host-mode-JzrhHX7F.js} +1 -1
  69. package/dashboard/dist/assets/{icons-ZB1ZthjH.js → icons-pK99mIMv.js} +1 -1
  70. package/dashboard/dist/assets/{index-DweUMAUD.js → index-BhviBroj.js} +1 -1
  71. package/dashboard/dist/assets/{index-BImBG3eS.js → index-CmD84EJi.js} +1 -1
  72. package/dashboard/dist/assets/{index-BgdM7kBl.js → index-Dk43KNa6.js} +1 -1
  73. package/dashboard/dist/assets/info-D-RLFnSK.js +1 -0
  74. package/dashboard/dist/assets/{link-2-Dn2soiyd.js → link-2-BiKXW9mV.js} +1 -1
  75. package/dashboard/dist/assets/{loader-circle-CNT630zn.js → loader-circle-KVUaEKV2.js} +1 -1
  76. package/dashboard/dist/assets/{modifiers.esm-WPx0bc2K.js → modifiers.esm-5NK8j3mT.js} +1 -1
  77. package/dashboard/dist/assets/monitor-smartphone-u9yr-_Es.js +1 -0
  78. package/dashboard/dist/assets/play-D0MaDCOx.js +1 -0
  79. package/dashboard/dist/assets/plus-DTJVtoAJ.js +1 -0
  80. package/dashboard/dist/assets/provider-display-YhtG0I9Y.js +42 -0
  81. package/dashboard/dist/assets/{react-B7SkZTgg.js → react-gIVxucOB.js} +1 -1
  82. package/dashboard/dist/assets/safePolygon-C_sPnJ1L.js +1 -0
  83. package/dashboard/dist/assets/{search-Ol3OZBm4.js → search-DdQRwFYV.js} +1 -1
  84. package/dashboard/dist/assets/{server-DFCbznC7.js → server-M0rmbGWy.js} +1 -1
  85. package/dashboard/dist/assets/{shield-check-YcmLwVZ6.js → shield-check-9-sqQKdD.js} +1 -1
  86. package/dashboard/dist/assets/{skills-api-C-9vK884.js → skills-api-B0qBWnuK.js} +1 -1
  87. package/dashboard/dist/assets/{sortable.esm-CKC9NuR-.js → sortable.esm-iqbm7x5D.js} +1 -1
  88. package/dashboard/dist/assets/store-DstuWd4a.js +1 -0
  89. package/dashboard/dist/assets/{terminal-B3_fCLFs.js → terminal-Dz0MxHNG.js} +1 -1
  90. package/dashboard/dist/assets/{trash-CZGfgbFa.js → trash-DBMFOFVz.js} +1 -1
  91. package/dashboard/dist/assets/{use-community-stats-CW-qkYn7.js → use-community-stats-CacbAcUR.js} +1 -1
  92. package/dashboard/dist/assets/{use-latest-request-guard-DHv7vfFE.js → use-latest-request-guard-nBuQVZOR.js} +1 -1
  93. package/dashboard/dist/assets/use-limits-display-prefs-fqg8hs6b.js +1 -0
  94. package/dashboard/dist/assets/{use-native-settings-CWiLqfZh.js → use-native-settings-EAqAFx2x.js} +1 -1
  95. package/dashboard/dist/assets/{use-ordered-list-Df8pw-WJ.js → use-ordered-list-DGLjjU6Q.js} +1 -1
  96. package/dashboard/dist/assets/use-pet-settings-C5MzWHE7.js +2 -0
  97. package/dashboard/dist/assets/use-reduced-motion-DK2oZ2uC.js +1 -0
  98. package/dashboard/dist/assets/{use-transform-BHwEAfmO.js → use-transform-C25eCuz_.js} +1 -1
  99. package/dashboard/dist/assets/{use-usage-limits-CSxFFn3_.js → use-usage-limits-BhqnEai3.js} +1 -1
  100. package/dashboard/dist/assets/{useCurrency-pwClnCZ5.js → useCurrency-t3PYQi1l.js} +1 -1
  101. package/dashboard/dist/assets/usePositioner-C59mj6kG.js +1 -0
  102. package/dashboard/dist/assets/{useTokenFormat-BMvVAe6V.js → useTokenFormat-C0xQsBGf.js} +1 -1
  103. package/dashboard/dist/assets/zap-CyH0tvKM.js +1 -0
  104. package/dashboard/dist/index.html +2 -2
  105. package/dashboard/dist/ip-check.html +2 -2
  106. package/dashboard/dist/leaderboard.html +2 -2
  107. package/dashboard/dist/share.html +2 -2
  108. package/package.json +2 -1
  109. package/src/lib/pricing/seed-snapshot.json +1 -1
  110. package/dashboard/dist/assets/AchievementBadge-BaqdyZaV.js +0 -1
  111. package/dashboard/dist/assets/AchievementsPage-B4Ju0guv.js +0 -2
  112. package/dashboard/dist/assets/BadgeDetailModal-B-XMJAvL.js +0 -1
  113. package/dashboard/dist/assets/Card-D-5mABVt.js +0 -1
  114. package/dashboard/dist/assets/CloudCheckoutPage-BELoh56h.js +0 -1
  115. package/dashboard/dist/assets/CloudPage-CfBruNxe.js +0 -1
  116. package/dashboard/dist/assets/CloudUsageExport-BoFU7xCT.js +0 -4
  117. package/dashboard/dist/assets/CommandPalette-BmmKZWn-.js +0 -1
  118. package/dashboard/dist/assets/CommunityStatsModal-BF77zVhN.js +0 -1
  119. package/dashboard/dist/assets/Controls-BnTeX7T4.js +0 -1
  120. package/dashboard/dist/assets/DashboardPage-BWulHa5J.js +0 -1
  121. package/dashboard/dist/assets/DialogClose-DAyilsH-.js +0 -1
  122. package/dashboard/dist/assets/DialogDescription-j4XnRy6y.js +0 -1
  123. package/dashboard/dist/assets/DialogTitle-B1iNGD2S.js +0 -1
  124. package/dashboard/dist/assets/LandingPage-Dtgq_caz.js +0 -2
  125. package/dashboard/dist/assets/LeaderboardPage-Di1kEg2O.js +0 -2
  126. package/dashboard/dist/assets/LeaderboardProBadge-h8FfR0au.js +0 -1
  127. package/dashboard/dist/assets/LoginCard-Dn5Xy4If.js +0 -1
  128. package/dashboard/dist/assets/LoginModal-C5h-5GOA.js +0 -1
  129. package/dashboard/dist/assets/LoginPage-BpX8Tgjj.js +0 -1
  130. package/dashboard/dist/assets/PopoverPopup-CVTiEVHs.js +0 -1
  131. package/dashboard/dist/assets/Select-CtTceC4T.js +0 -1
  132. package/dashboard/dist/assets/SelectItemText-C7xi8iGp.js +0 -1
  133. package/dashboard/dist/assets/SessionsPage-BngTWN7Q.css +0 -1
  134. package/dashboard/dist/assets/SessionsPage-okHobk_L.js +0 -3
  135. package/dashboard/dist/assets/SettingsPage-C-cc6wcF.js +0 -2
  136. package/dashboard/dist/assets/SkillsPage-D2LlKKJN.js +0 -1
  137. package/dashboard/dist/assets/TrendMonitor-C88S-5aa.js +0 -19
  138. package/dashboard/dist/assets/WidgetsPage-WsEFPNwp.js +0 -1
  139. package/dashboard/dist/assets/__vite-browser-external-DFRX9dp-.css +0 -1
  140. package/dashboard/dist/assets/__vite-browser-external-DUJeOWgd.js +0 -45
  141. package/dashboard/dist/assets/agent-logos-BM9jlReI.js +0 -1
  142. package/dashboard/dist/assets/arrow-left-BEM-HVmC.js +0 -1
  143. package/dashboard/dist/assets/cloud-checkout-nYNHDFoR.js +0 -1
  144. package/dashboard/dist/assets/composite-B4Z3F65o.js +0 -1
  145. package/dashboard/dist/assets/download-CJUnX1Bs.js +0 -1
  146. package/dashboard/dist/assets/info-CyDY7NYM.js +0 -1
  147. package/dashboard/dist/assets/monitor-smartphone-C-qC0RAt.js +0 -1
  148. package/dashboard/dist/assets/plus-Cx82jb7o.js +0 -1
  149. package/dashboard/dist/assets/provider-display-CodMmiRb.js +0 -42
  150. package/dashboard/dist/assets/safePolygon-CKpREa4K.js +0 -1
  151. package/dashboard/dist/assets/store-C9yWYHfg.js +0 -1
  152. package/dashboard/dist/assets/use-limits-display-prefs-NZ-AAYD5.js +0 -1
  153. package/dashboard/dist/assets/use-pet-settings-Bg2CDprr.js +0 -2
  154. package/dashboard/dist/assets/use-reduced-motion-iDZEUyua.js +0 -1
  155. package/dashboard/dist/assets/usePositioner-B0j1orGj.js +0 -1
  156. package/dashboard/dist/assets/zap-DvX2aYx5.js +0 -1
@@ -1 +0,0 @@
1
- import{A as n,a6 as R,j as i}from"./__vite-browser-external-DUJeOWgd.js";import{Z as F}from"./zap-DvX2aYx5.js";import{F as I}from"./flame-CKjAluj_.js";import{S as G}from"./shield-check-YcmLwVZ6.js";const u={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]};u.node;const N=n(u);const k={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};k.node;const S=n(k);const v={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};v.node;const V=n(v);const M={name:"crown",size:24,node:[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]};M.node;const Z=n(M);const b={name:"feather",size:24,node:[["path",{d:"M14.086 18.412A2 2 0 0112.67 19H5v-7.672a2 2 0 01.586-1.414L11.75 3.75a6 6 0 118.49 8.49z",key:"1nq9jb"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.488 15H9",key:"16yirz"}]]};b.node;const O=n(b);const _={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]};_.node;const P=n(_);const x={name:"footprints",size:24,node:[["path",{d:"M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z",key:"1dudjm"}],["path",{d:"M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z",key:"l2t8xc"}],["path",{d:"M16 17h4",key:"1dejxt"}],["path",{d:"M4 13h4",key:"1bwh8b"}]]};x.node;const X=n(x);const w={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};w.node;const K=n(w);const z={name:"medal",size:24,node:[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]};z.node;const U=n(z);const A={name:"moon-star",size:24,node:[["path",{d:"M18 5h4",key:"1lhgn2"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};A.node;const W=n(A);const D={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};D.node;const Y=n(D);const $={name:"trending-up",size:24,node:[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]};$.node;const J=n($),j=[{id:"token_titan",scope:"cloud",icon:Z,format:"tokens",art:"/achievements/token-titan.png"},{id:"big_day",scope:"cloud",icon:F,format:"tokens",art:"/achievements/big-day.png"},{id:"wordsmith",scope:"cloud",icon:O,format:"tokens",art:"/achievements/wordsmith.png"},{id:"marathoner",scope:"cloud",icon:X,format:"days",art:"/achievements/marathoner.png"},{id:"streak",scope:"cloud",icon:I,format:"days",art:"/achievements/streak.png"},{id:"weekend_warrior",scope:"cloud",icon:V,format:"days",art:"/achievements/weekend-warrior.png"},{id:"momentum",scope:"cloud",icon:J,format:"multiplier",art:"/achievements/momentum.png"},{id:"polyglot",scope:"cloud",icon:S,format:"count",art:"/achievements/polyglot.png"},{id:"trendsetter",scope:"cloud",icon:Y,format:"count",art:"/achievements/trendsetter.png"},{id:"multitool",scope:"cloud",icon:N,format:"count",art:"/achievements/multitool.png"},{id:"podium",scope:"cloud",icon:U,format:"rank",art:"/achievements/podium.png"},{id:"veteran",scope:"cloud",icon:G,format:"days",art:"/achievements/veteran.png"},{id:"project_hopper",scope:"local",icon:P,format:"count",art:"/achievements/project-hopper.png"},{id:"project_devotion",scope:"local",icon:K,format:"tokens",art:"/achievements/project-devotion.png"},{id:"night_owl",scope:"local",icon:W,format:"count",art:"/achievements/night-owl.png"}],E=new Map(j.map(e=>[e.id,e])),m=new Map(j.map((e,a)=>[e.id,a]));function de(e,a){return`achievements.badge.${e}.${a}`}function Q(e){return[...e||[]].sort((a,t)=>{const c=(t?.tier||0)-(a?.tier||0);return c!==0?c:(m.get(a?.id)??99)-(m.get(t?.id)??99)})}function ie(e){const a=(e||[]).filter(t=>t&&(t.tier||0)>=1&&E.has(t.id));return a.length===0?null:Q(a)[0]}const L={1:"bronze",2:"silver",3:"gold",4:"diamond"},re=["bronze","silver","gold","diamond"],ee={bronze:{rim:["#a06a44","#5c3a22"],face:["#d29a6c","#96602f"],glyph:"#3f2817",ring:"#e8c3a0",sheen:"rgba(255, 236, 220, 0.45)",label:"#a06a44"},silver:{rim:["#aab3bb","#67707b"],face:["#dde2e7","#9ba5ae"],glyph:"#39424b",ring:"#f2f5f7",sheen:"rgba(255, 255, 255, 0.55)",label:"#8b959f"},gold:{rim:["#c9971c","#8a6508"],face:["#f2ca52","#cf9c26"],glyph:"#5c430e",ring:"#ffe9a8",sheen:"rgba(255, 248, 214, 0.55)",label:"#b8860b"},diamond:{rim:["#62b1e0","#7c6fd9"],face:["#c8ecf6","#84b4ea"],glyph:"#27496d",ring:"#eafcff",sheen:"rgba(255, 255, 255, 0.65)",label:"#5a9bd8"}},g={rim:["#a8ada9","#7c817d"],face:["#cdd2ce","#a3a8a4"],glyph:"#6a706c",ring:"#dde1de",sheen:"rgba(255, 255, 255, 0.25)",label:"#8b908c"};function ae(e,a=!1){return a||!e||e<1?g:ee[L[Math.min(e,4)]]||g}function se(e){return L[e]||null}const y={xs:18,sm:24,md:44,xl:88,lg:108},f={xs:.75,sm:1,md:1.5,xl:2,lg:2};function le({badgeId:e,tier:a=0,size:t="md",locked:c=!1,label:r,className:T=""}){const s=E.get(e),h=c||!a||a<1,o=ae(a,h),d=t==="fill",l=d?"100%":y[t]||y.md,q=d?4:f[t]||f.md,[B,C]=R.useState(!1),p=s?.icon||null,H=!!s?.art&&!B;return i.jsx("span",{role:r?"img":void 0,"aria-label":r||void 0,"aria-hidden":r?void 0:!0,className:`inline-flex shrink-0 rounded-full ${T}`,style:{width:l,height:l,padding:q,background:`linear-gradient(135deg, ${o.rim[0]} 0%, ${o.ring} 42%, ${o.rim[1]} 100%)`,boxShadow:d||t==="md"||t==="xl"||t==="lg"?"0 0 0 1px rgba(10, 15, 12, 0.06), 0 1px 2px rgba(10, 15, 12, 0.08)":void 0},children:H?i.jsx("img",{src:s.art,alt:"",draggable:!1,loading:"lazy",onError:()=>C(!0),className:"h-full w-full rounded-full object-cover",style:h?{filter:"grayscale(1)",opacity:.55}:void 0}):i.jsx("span",{className:"flex h-full w-full items-center justify-center rounded-full",style:{background:`linear-gradient(145deg, ${o.face[0]}, ${o.face[1]})`},children:p?i.jsx(p,{size:d?64:Math.round(l*.5),color:o.glyph,strokeWidth:2}):null})})}export{le as A,j as B,K as H,J as T,ee as a,de as b,E as c,re as d,ie as h,ae as p,Q as s,se as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BadgeDetailModal-B-XMJAvL.js","assets/__vite-browser-external-DUJeOWgd.js","assets/__vite-browser-external-DFRX9dp-.css","assets/react-B7SkZTgg.js","assets/AchievementBadge-BaqdyZaV.js","assets/zap-DvX2aYx5.js","assets/flame-CKjAluj_.js","assets/shield-check-YcmLwVZ6.js","assets/use-transform-BHwEAfmO.js","assets/use-reduced-motion-iDZEUyua.js","assets/AchievementsSection-CDUUEfIi.js","assets/format-tokens-mk49THtv.js","assets/DialogTitle-B1iNGD2S.js","assets/composite-B4Z3F65o.js","assets/store-C9yWYHfg.js"])))=>i.map(i=>d[i]);
2
- import{r as l,a3 as h,a4 as f,a5 as p,j as e,c,L as v,a6 as g,a as y,a7 as b,a8 as k,a9 as j}from"./__vite-browser-external-DUJeOWgd.js";import{A as w}from"./AchievementsSection-CDUUEfIi.js";import{B as x}from"./AchievementBadge-BaqdyZaV.js";import"./react-B7SkZTgg.js";import"./format-tokens-mk49THtv.js";import"./use-reduced-motion-iDZEUyua.js";import"./zap-DvX2aYx5.js";import"./flame-CKjAluj_.js";import"./shield-check-YcmLwVZ6.js";function N({enabled:a=!0}={}){const[r,t]=l.useState({status:"loading",achievements:[],error:null}),s=l.useMemo(()=>h(),[]);return l.useEffect(()=>{if(!a){t({status:"disabled",achievements:[],error:null});return}let i=!1;return t(n=>({...n,status:"loading"})),f({timeZone:s,tzOffsetMinutes:p()}).then(n=>{i||t({status:"ready",achievements:Array.isArray(n?.achievements)?n.achievements:[],error:null})}).catch(n=>{i||t({status:"error",achievements:[],error:n})}),()=>{i=!0}},[a,s]),r}const A=g.lazy(()=>j(()=>import("./BadgeDetailModal-B-XMJAvL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])));function I({authLoading:a,authEnabled:r,authUserId:t,mockEnabled:s}){if(s)return{authLoading:!1,signedIn:!0,userId:"mock-user"};const i=!!(r&&t);return{authLoading:!!a,signedIn:i,userId:i?t:null}}function B(){const a=y(),[r,t]=l.useState({status:"loading",achievements:[],userId:null}),s=b(),{authLoading:i,signedIn:n,userId:o}=I({authLoading:a?.loading,authEnabled:a?.enabled,authUserId:a?.user?.id,mockEnabled:s});return l.useEffect(()=>{if(i){t({status:"loading",achievements:[],userId:null});return}if(!n){t({status:"signed-out",achievements:[],userId:null});return}let d=!1;return t({status:"loading",achievements:[],userId:o}),(async()=>{try{const u=s?null:await a.getAccessToken?.(),m=await k({accessToken:u,userId:o});if(d)return;t({status:"ready",achievements:Array.isArray(m?.badges)?m.badges:[],userId:o})}catch{d||t({status:"error",achievements:[],userId:o})}})(),()=>{d=!0}},[i,s,n,o]),{...r,signedIn:n,settled:_({authLoading:i,signedIn:n,userId:o,state:r})}}function _({authLoading:a,signedIn:r,userId:t,state:s}){return a?!1:r?s.userId===t&&(s.status==="ready"||s.status==="error"):s.status==="signed-out"}function S(){return e.jsx("div",{className:"mx-0 grid animate-pulse grid-cols-[repeat(3,max-content)] justify-between gap-y-7 sm:-mx-2 sm:grid-cols-[repeat(4,max-content)] lg:grid-cols-[repeat(5,max-content)]","aria-hidden":!0,children:Array.from({length:x.length}).map((a,r)=>e.jsxs("div",{className:"flex w-[6.75rem] flex-col items-center px-0 pb-3 pt-4 sm:w-[7.75rem]",children:[e.jsx("div",{className:"h-[108px] w-[108px] rounded-full bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsx("div",{className:"mt-3 h-3 w-16 rounded bg-oai-gray-200 dark:bg-oai-gray-800"}),e.jsx("div",{className:"mt-2 h-2 w-10 rounded bg-oai-gray-100 dark:bg-oai-gray-800/60"})]},r))})}function P(){const a=N(),r=B(),[t,s]=l.useState(null),i=a.status==="loading"||!r.settled,n=l.useMemo(()=>[...r.achievements||[],...a.achievements||[]],[r.achievements,a.achievements]),o=l.useMemo(()=>n.filter(u=>(u?.tier||0)>=1).length,[n]),d=x.length;return e.jsxs("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:[e.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:e.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6",children:[e.jsxs("div",{className:"mb-7 flex items-baseline justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:c("achievements.page.title")}),e.jsx("p",{className:"mt-1.5 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:c("achievements.page.local_note")})]}),!i&&e.jsxs("div",{className:"shrink-0 text-right",children:[e.jsxs("div",{className:"font-mono text-2xl font-semibold leading-none tabular-nums text-oai-black dark:text-white",children:[o,e.jsxs("span",{className:"text-oai-gray-400 dark:text-oai-gray-600",children:["/",d]})]}),e.jsx("div",{className:"mt-2 h-1 w-24 overflow-hidden rounded-full bg-oai-gray-200 dark:bg-oai-gray-800",children:e.jsx("div",{className:"h-full rounded-full bg-oai-brand-600 transition-[width] duration-500",style:{width:`${Math.round(o/d*100)}%`}})})]})]}),!r.signedIn&&!i&&e.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 rounded-xl border border-oai-gray-200 bg-oai-gray-50 px-4 py-3 dark:border-oai-gray-800 dark:bg-oai-gray-900/60",children:[e.jsx("p",{className:"text-sm text-oai-gray-600 dark:text-oai-gray-300",children:c("achievements.signin.prompt")}),e.jsx(v,{to:"/login",className:"shrink-0 rounded-lg bg-oai-brand-600 px-3 py-1.5 text-sm font-medium text-white transition-colors duration-200 hover:bg-oai-brand-700 active:scale-[0.98]",children:c("achievements.signin.action")})]}),i?e.jsx(S,{}):e.jsxs(e.Fragment,{children:[e.jsx(w,{achievements:n,isOwn:!0,columns:"wide",size:"lg",animateIn:!0,onSelect:s}),e.jsxs("p",{className:"mt-10 text-center text-xs text-oai-gray-400 dark:text-oai-gray-500",children:[c("achievements.page.suggest")," ",e.jsx("a",{href:"https://github.com/xiufengsun/TokenTracker/issues",target:"_blank",rel:"noopener noreferrer",className:"underline decoration-oai-gray-300 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:decoration-oai-gray-500 dark:decoration-oai-gray-600 dark:hover:text-oai-gray-300",children:c("achievements.page.suggest_link")})]})]})]})}),t&&e.jsx(g.Suspense,{fallback:null,children:e.jsx(A,{badge:t,onClose:()=>s(null)})})]})}export{_ as cloudBadgesSettled,P as default,I as resolveCloudBadgeIdentity};
@@ -1 +0,0 @@
1
- import{r as L,j as a,H as De,c as h,J as ye,X as Ie}from"./__vite-browser-external-DUJeOWgd.js";import{k as _e,V as Me,l as Ve,r as Te,n as $e,o as be,q as ve,s as Oe,t as Re,v as Be,w as Pe,x as Ke,y as Ce,z as Fe,A as Le,B as Xe,S as Ge,H as We,C as G,D as ze,E as He,e as Ue,F as Ye,m as C}from"./react-B7SkZTgg.js";import{c as je,A as Ze,p as qe,b as H,t as le,a as T,d as Je}from"./AchievementBadge-BaqdyZaV.js";import{u as Qe,a as z}from"./use-transform-BHwEAfmO.js";import{u as et}from"./use-reduced-motion-iDZEUyua.js";import{l as ce,f as ue,b as tt}from"./AchievementsSection-CDUUEfIi.js";import{D as nt,a as rt,b as at,c as st,d as it,e as ot}from"./DialogTitle-B1iNGD2S.js";import"./zap-DvX2aYx5.js";import"./flame-CKjAluj_.js";import"./shield-check-YcmLwVZ6.js";import"./format-tokens-mk49THtv.js";import"./composite-B4Z3F65o.js";import"./store-C9yWYHfg.js";const lt=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function Ne(e,t){return _e(e)?e[lt(0,e.length,t)]:e}class ct{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,s)=>{r&&r(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return de(this.animations,"duration")}get iterationDuration(){return de(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function de(e,t){let n=0;for(let r=0;r<e.length;r++){const s=e[r][t];s!==null&&s>n&&(n=s)}return n}class ut extends ct{then(t,n){return this.finished.finally(t).then(()=>{})}}function dt(e,t){return e in t}class mt extends Me{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(dt(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Ve()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function U(e){return typeof e=="object"&&!Array.isArray(e)}function ke(e,t,n,r){return e==null?[]:typeof e=="string"&&U(t)?Te(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(s=>s!=null):[e]}function ft(e,t,n){return e*(t+1)+n*t}function me(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function pt(e,t,n){for(let r=0;r<e.length;r++){const s=e[r];s.at>t&&s.at<n&&(be(e,s),r--)}}function ht(e,t,n,r,s,c){pt(e,s,c);for(let i=0;i<t.length;i++)e.push({value:t[i],at:$e(s,c,r[i]),easing:Ne(n,i)})}function gt(e,t,n=0){const r=t+1+t*n;for(let s=0;s<e.length;s++)e[s]=e[s]/r}function xt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const yt="easeInOut",bt=20;function vt(e,{defaultTransition:t={},...n}={},r,s){const c=t.duration||.3,i=new Map,f=new Map,m={},p=new Map;let g=0,u=0,x=0;for(let N=0;N<e.length;N++){const k=e[N];if(typeof k=="string"){p.set(k,u);continue}else if(!Array.isArray(k)){p.set(k.name,me(u,k.at,g,p));continue}let[E,b,v={}]=k;v.at!==void 0&&(u=me(u,v.at,g,p));let j=0;const _=(w,M,A,o=0,l=0)=>{const d=jt(w),{delay:D=0,times:y=Oe(d),type:R=t.type||"keyframes",repeat:B,repeatType:W,repeatDelay:Y=0,...Se}=M;let{ease:I=t.ease||"easeOut",duration:S}=M;const Z=typeof D=="function"?D(o,l):D,q=d.length,J=Ke(R)?R:s?.[R||"keyframes"];if(q<=2&&J){let $=100;if(q===2&&wt(d)){const P=d[1]-d[0];$=Math.abs(P)}const O={...t,...Se};S!==void 0&&(O.duration=Ce(S));const X=Re(O,$,J);I=X.ease,S=X.duration}S??(S=c);const Q=u+Z;y.length===1&&y[0]===0&&(y[1]=1);const ee=y.length-d.length;if(ee>0&&Be(y,ee),d.length===1&&d.unshift(null),B&&B<bt){const $=S>0?Y/S:0;S=ft(S,B,Y);const O=[...d],X=[...y];I=Array.isArray(I)?[...I]:[I];const P=[...I],ne=W==="reverse"||W==="mirror";let re=O,ae=P;ne&&(re=[...O].reverse(),W==="reverse"&&(ae=[...P].reverse().map(V=>typeof V=="function"?Pe(V):V)));for(let V=0;V<B;V++){const se=ne&&V%2===0,ie=se?re:O,Ee=se?ae:P,oe=(V+1)*(1+$);$>0&&(d.push(d[d.length-1]),y.push(oe),I.push("linear")),d.push(...ie);for(let K=0;K<ie.length;K++)y.push(X[K]+oe),I.push(K===0?"linear":Ne(Ee,K-1))}gt(y,B,$)}const te=Q+S;ht(A,d,I,y,Q,te),j=Math.max(Z+S,j),x=Math.max(te,x)};if(ve(E)){const w=fe(E,f);_(b,v,pe("default",w))}else{const w=ke(E,b,r,m),M=w.length;for(let A=0;A<M;A++){b=b,v=v;const o=w[A],l=fe(o,f);for(const d in b)_(b[d],Nt(v,d),pe(d,l),A,M)}}g=u,u+=j}return f.forEach((N,k)=>{for(const E in N){const b=N[E];b.sort(xt);const v=[],j=[],_=[];for(let o=0;o<b.length;o++){const{at:l,value:d,easing:D}=b[o];v.push(d),j.push(Fe(0,x,l)),_.push(D||"easeOut")}j[0]!==0&&(j.unshift(0),v.unshift(v[0]),_.unshift(yt)),j[j.length-1]!==1&&(j.push(1),v.push(null)),i.has(k)||i.set(k,{keyframes:{},transition:{}});const w=i.get(k);w.keyframes[E]=v;const{type:M,...A}=t;w.transition[E]={...A,duration:x,ease:_,times:j,...n}}}),i}function fe(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function pe(e,t){return t[e]||(t[e]=[]),t[e]}function jt(e){return Array.isArray(e)?e:[e]}function Nt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const kt=e=>typeof e=="number",wt=e=>e.every(kt);function At(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!Xe(e)?new Ge(t):new We(t);n.mount(e),G.set(e,n)}function St(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new mt(t);n.mount(e),G.set(e,n)}function Et(e,t){return ve(e)||typeof e=="number"||typeof e=="string"&&!U(t)}function we(e,t,n,r){const s=[];if(Et(e,t))s.push(ze(e,U(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return s;const c=ke(e,t,r),i=c.length;for(let f=0;f<i;f++){const m=c[f],p=m instanceof Element?At:St;G.has(m)||p(m);const g=G.get(m),u={...n};"delay"in u&&typeof u.delay=="function"&&(u.delay=u.delay(f,i)),s.push(...He(g,{...t,transition:u},{}))}}return s}function Dt(e,t,n){const r=[],s=e.map(i=>{if(Array.isArray(i)&&typeof i[0]=="function"){const f=i[0],m=Ue(0);return m.on("change",f),i.length===1?[m,[0,1]]:i.length===2?[m,[0,1],i[1]]:[m,i[1],i[2]]}return i});return vt(s,t,n,{spring:Ye}).forEach(({keyframes:i,transition:f},m)=>{r.push(...we(m,i,f))}),r}function It(e){return Array.isArray(e)&&e.some(Array.isArray)}function _t(e={}){const{scope:t,reduceMotion:n,skipAnimations:r}=e;function s(c,i,f){let m=[],p;const g={};if(n!==void 0&&(g.reduceMotion=n),r!==void 0&&(g.skipAnimations=r),It(c)){const{onComplete:x,...N}=i||{};typeof x=="function"&&(p=x),m=Dt(c,{...g,...N},t)}else{const{onComplete:x,...N}=f||{};typeof x=="function"&&(p=x),m=we(c,i,{...g,...N},t)}const u=new ut(m);return p&&u.finished.then(p),t&&(t.animations.push(u),u.finished.then(()=>{be(t.animations,u)})),u}return s}const F=_t(),he=8;function Mt({badgeId:e,tier:t,locked:n=!1,size:r=176,backLines:s=[],label:c}){const i=Qe(0),f=et(),m=L.useRef(null),p=L.useRef(null),g=L.useRef(!1),u=qe(t,n),x=je.get(e)?.icon||null,N=z(i,o=>`${(o%360+360)%360/360*160-80}%`),k=z(i,o=>`${80-(o%360+360)%360/360*160}%`),E=z(i,o=>{const l=Math.abs(Math.sin(o*Math.PI/180));return Math.max(0,(l-.35)/.65)*.3}),b=()=>{p.current?.stop?.(),p.current=null};L.useEffect(()=>{if(f||g.current)return;let o=!1;i.set(-360);const l=F(i,0,{duration:.9,ease:[.16,1,.3,1]});return p.current=l,l.then(()=>{o||g.current||(p.current=F(i,[0,-14,14,0],{duration:4.5,repeat:1/0,ease:"easeInOut"}))}),()=>{o=!0,b()}},[f,i]);const v=o=>{const l=i.get();if(f){const y=Math.round(l/180)*180;p.current=F(i,y,{duration:.2,ease:"easeOut"});return}const d=l+o*.35,D=Math.round(d/180)*180;p.current=F(i,D,{type:"spring",velocity:o,stiffness:58,damping:13.5,mass:1})},j=o=>{g.current=!0,b(),o.currentTarget.setPointerCapture?.(o.pointerId),m.current={pointerId:o.pointerId,startX:o.clientX,startRot:i.get(),samples:[{t:o.timeStamp,x:o.clientX}]}},_=o=>{const l=m.current;!l||l.pointerId!==o.pointerId||(i.set(l.startRot+(o.clientX-l.startX)*.55),l.samples.push({t:o.timeStamp,x:o.clientX}),l.samples.length>5&&l.samples.shift())},w=o=>{const l=m.current;if(!l||l.pointerId!==o.pointerId)return;m.current=null;const d=l.samples[0],D=l.samples[l.samples.length-1],y=D.t-d.t,R=y>0?(D.x-d.x)*.55*1e3/y:0;v(R)},M=o=>{if(o.key!=="ArrowLeft"&&o.key!=="ArrowRight")return;o.preventDefault(),g.current=!0,b();const l=o.key==="ArrowRight"?30:-30;p.current=F(i,i.get()+l,{duration:.15,ease:"easeOut"})},A={backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden"};return a.jsx("div",{role:"img","aria-label":c,tabIndex:0,onPointerDown:j,onPointerMove:_,onPointerUp:w,onPointerCancel:w,onKeyDown:M,className:"inline-flex cursor-grab select-none items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-oai-brand/60 rounded-full active:cursor-grabbing",style:{perspective:900,touchAction:"pan-y"},children:a.jsxs("div",{className:"relative",style:{transform:"rotateX(-8deg)",transformStyle:"preserve-3d"},children:[a.jsxs(C.div,{className:"relative",style:{rotateY:i,transformStyle:"preserve-3d",width:r,height:r},children:[[-3,-1.5,0,1.5,3].map(o=>a.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 rounded-full",style:{transform:`translateZ(${o}px)`,background:u.rim[1]}},o)),a.jsxs("div",{className:"absolute inset-0 overflow-hidden rounded-full",style:{...A,transform:`translateZ(${he/2}px)`},children:[a.jsx(Ze,{badgeId:e,tier:t,locked:n,size:"fill",className:"brightness-105 saturate-[1.08]"}),a.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"radial-gradient(circle at 30% 20%, rgba(255,255,255,0.45), rgba(255,255,255,0) 42%), linear-gradient(172deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 38%, rgba(0,0,0,0.08) 100%)",boxShadow:"inset 0 3px 7px rgba(255,255,255,0.5), inset 0 -3px 8px rgba(0,0,0,0.15)"}}),a.jsx(C.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{x:N,background:"linear-gradient(105deg, transparent 34%, rgba(255,255,255,0.5) 50%, transparent 66%)"}}),a.jsx(C.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{opacity:E,background:"rgba(8, 12, 10, 0.9)"}})]}),a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-1 overflow-hidden rounded-full px-6 text-center",style:{...A,transform:`rotateY(180deg) translateZ(${he/2}px)`,background:`linear-gradient(145deg, ${u.face[0]}, ${u.face[1]})`,boxShadow:`inset 0 0 0 6px ${u.rim[1]}, inset 0 0 0 7.5px rgba(255,255,255,0.22), inset 0 3px 7px rgba(255,255,255,0.4), inset 0 -4px 12px rgba(0,0,0,0.22)`},children:[a.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 4px)"}}),x?a.jsx(x,{"aria-hidden":!0,size:Math.round(r*.62),strokeWidth:1.1,color:u.glyph,className:"pointer-events-none absolute opacity-[0.13]",style:{filter:"drop-shadow(0 1px 0 rgba(255,255,255,0.3)) drop-shadow(0 -1px 0 rgba(0,0,0,0.35))"}}):null,a.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{background:"radial-gradient(circle at 70% 20%, rgba(255,255,255,0.4), rgba(255,255,255,0) 44%), linear-gradient(188deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 38%, rgba(0,0,0,0.10) 100%)"}}),s.map((o,l)=>a.jsx("div",{className:`font-mono tabular-nums ${l===0?"text-[10px] uppercase tracking-[0.18em]":l===1?"text-lg font-bold":"text-[11px]"}`,style:{color:u.glyph,textShadow:"0 1px 0 rgba(255,255,255,0.28), 0 -1px 0 rgba(0,0,0,0.3)"},children:o},`${l}-${o}`)),a.jsx(C.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0",style:{x:k,background:"linear-gradient(105deg, transparent 34%, rgba(255,255,255,0.45) 50%, transparent 66%)"}}),a.jsx(C.div,{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 rounded-full",style:{opacity:E,background:"rgba(8, 12, 10, 0.9)"}})]})]}),a.jsx("div",{"aria-hidden":!0,className:"absolute left-1/2 h-3 w-3/5 rounded-[100%] bg-black/20 blur-md dark:bg-black/45",style:{bottom:-20,transform:"translateX(-50%)"}})]})})}function Ae(e){if(!e)return null;const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleDateString():null}function Vt(e){const t=Number(e);return!Number.isSafeInteger(t)||t<1?null:String(t).padStart(6,"0")}function Tt(e,t,n){if(t?.scope!=="cloud"||!n)return null;const r=Number(e?.serials?.[n]);return Number.isSafeInteger(r)&&r>=1?r:null}function $t({badge:e}){return a.jsx("div",{className:"flex items-center gap-1",children:Je.map((t,n)=>{const r=(e.tier||0)>=n+1,s=Ae(e.achieved?.[t]),c=T[t];return a.jsx("span",{title:s?`${h(`achievements.tier.${t}`)} · ${s}`:h(`achievements.tier.${t}`),className:"inline-flex h-2 w-8 rounded-full",style:r?{background:`linear-gradient(120deg, ${c.rim[0]} 0%, ${c.ring} 55%, ${c.rim[1]} 100%)`,boxShadow:"inset 0 1px 1px rgba(255,255,255,0.4), 0 0 0 1px rgba(10,15,12,0.05)"}:void 0,children:!r&&a.jsx("span",{className:"h-full w-full rounded-full bg-oai-gray-200 dark:bg-oai-gray-800"})},t)})})}function ge({badge:e,onClose:t}){const n=je.get(e.id),r=h(H(e.id,"name")),s=(e.tier||0)>=1,c=s?le(e.tier):null,i=Ae(s?e.achieved?.[c]||(ce(e)?new Date(ce(e)).toISOString():null):null),f=ue(n?.format,e.metric_value),m=tt(e),p=e.tier<4?le((e.tier||0)+1):null,g=Tt(e,n,c),u=Vt(g),x=u?[h("achievements.modal.achieved_label"),h("achievements.modal.issue_number",{number:u}),i||r]:[s?h("achievements.modal.achieved_label"):h("achievements.modal.locked"),s?f:"···",s&&i?i:r];return a.jsxs("div",{className:"flex flex-col items-center px-6 pb-6 pt-5 text-center",children:[a.jsxs("div",{className:"flex w-full items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[a.jsx("h2",{className:"truncate text-lg font-semibold tracking-tight text-oai-black dark:text-white",children:r}),a.jsx("p",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:h(H(e.id,"desc"))})]}),a.jsx("button",{type:"button",onClick:t,"aria-label":h("achievements.modal.close"),className:"shrink-0 rounded-md p-1.5 text-oai-gray-400 transition-colors hover:bg-oai-gray-100 hover:text-oai-gray-700 dark:hover:bg-oai-gray-900 dark:hover:text-oai-gray-200",children:a.jsx(Ie,{size:16})})]}),a.jsx("div",{className:"mt-5 mb-7",children:a.jsx(Mt,{badgeId:e.id,tier:e.tier,locked:!s,backLines:x,label:h("achievements.modal.coin_aria",{name:r})})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"rounded-full px-2.5 py-0.5 text-[11px] font-semibold uppercase tracking-wide",style:s?{background:`linear-gradient(120deg, ${T[c].rim[0]} 0%, ${T[c].ring} 55%, ${T[c].rim[1]} 100%)`,color:T[c].glyph,textShadow:"0 1px 0 rgba(255,255,255,0.35)",boxShadow:"inset 0 1px 1px rgba(255,255,255,0.4), 0 0 0 1px rgba(10,15,12,0.06)"}:{background:"rgba(128,134,130,0.75)",color:"rgba(250,250,250,0.95)"},children:s?h(`achievements.tier.${c}`):h("achievements.modal.locked")}),s&&i?a.jsx("span",{className:"text-xs tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:i}):null]}),a.jsxs("dl",{className:"mt-5 w-full space-y-3 border-t border-oai-gray-200/70 pt-4 text-left dark:border-oai-gray-800/60",children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[a.jsx("dt",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:h("achievements.modal.value_label")}),a.jsx("dd",{className:"font-mono font-semibold tabular-nums text-oai-black dark:text-white",children:f})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-baseline justify-between gap-3 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[a.jsx("span",{children:e.tier>=4?h("achievements.modal.max_tier"):h("achievements.modal.progress_to_next",{tier:h(`achievements.tier.${p}`)})}),e.tier<4&&e.next_threshold!=null?a.jsxs("span",{className:"font-mono tabular-nums",children:[f," ",e.lower_is_better?"→":"/"," ",ue(n?.format,e.next_threshold)]}):null]}),a.jsx("div",{className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-oai-gray-200 dark:bg-oai-gray-800",children:a.jsx("div",{className:"h-full rounded-full transition-[width] duration-500",style:{width:`${Math.round((e.tier>=4?1:m)*100)}%`,background:s?`linear-gradient(90deg, ${T[c].rim[0]} 0%, ${T[c].ring} 55%, ${T[c].rim[1]} 100%)`:"rgba(128,134,130,0.75)",boxShadow:s?"inset 0 1px 1px rgba(255,255,255,0.35)":void 0}})})]}),a.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:[a.jsx("span",{children:h("achievements.modal.tier_history")}),a.jsx($t,{badge:e})]})]})]})}const xe=ye("relative w-full max-w-[380px] flex flex-col","rounded-2xl bg-white dark:bg-oai-gray-950","shadow-[0_20px_60px_-20px_rgba(0,0,0,0.25)] dark:shadow-[0_20px_60px_-10px_rgba(0,0,0,0.65)]","ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 overflow-hidden","dark:border-t dark:border-white/[0.08]");function Ut({badge:e,onClose:t}){const n=De(),r=!!e;return L.useEffect(()=>{if(!n||!r)return;const s=c=>{c.key==="Escape"&&(c.stopPropagation(),t?.())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[n,r,t]),r?n?a.jsxs("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px]",onClick:t,"aria-hidden":!0}),a.jsx("div",{className:xe,children:a.jsx(ge,{badge:e,onClose:t})})]}):a.jsx(nt,{open:!0,onOpenChange:s=>{s||t?.()},children:a.jsxs(rt,{children:[a.jsx(at,{className:"cost-modal-backdrop z-[110]"}),a.jsx(st,{className:"fixed inset-0 z-[120] flex items-center justify-center p-4",children:a.jsxs(it,{className:ye("cost-modal-popup",xe),children:[a.jsx(ot,{render:a.jsx("h2",{className:"sr-only"}),children:h(H(e.id,"name"))}),a.jsx(ge,{badge:e,onClose:t})]})})]})}):null}export{Ut as BadgeDetailModal,Tt as currentBadgeIssueNumber,Ut as default,Vt as formatIssueNumber};
@@ -1 +0,0 @@
1
- import{j as r,J as e}from"./__vite-browser-external-DUJeOWgd.js";function n({children:i,title:a,subtitle:o,className:s="",bodyClassName:d=""}){return r.jsxs("div",{className:e("rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 transition-colors duration-200",s),children:[(a||o)&&r.jsxs("div",{className:"px-5 py-4 border-b border-oai-gray-200 dark:border-oai-gray-800 transition-colors duration-200",children:[a&&r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide transition-colors duration-200",children:a}),o&&r.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-300 mt-1 transition-colors duration-200",children:o})]}),r.jsx("div",{className:`p-5 ${d}`,children:i})]})}export{n as C};
@@ -1 +0,0 @@
1
- import{A as Be,d as De,e as Te,r as o,o as Ue,p as $e,t as ze,G as Me,H as He,E as Fe,ab as U,c as t,j as e,B as l,L as u,x as te,z as p,v as ge,ac as Ge,ad as We,S as Je,C as Ke,y as Qe}from"./__vite-browser-external-DUJeOWgd.js";import{c as G,r as fe,C as _e,a as Ve,g as Xe,s as ye,b as Ye,o as Ze}from"./cloud-checkout-nYNHDFoR.js";import{d as et}from"./os-DMmhX9tk.js";import{C as ke}from"./Card-D-5mABVt.js";import{L as tt}from"./loader-circle-CNT630zn.js";import{S as rt}from"./shield-check-YcmLwVZ6.js";import{E as at}from"./external-link-B5yXxdPy.js";import{A as st}from"./arrow-left-BEM-HVmC.js";const ve={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};ve.node;const ct=Be(ve);function xt(){const be=De(),[g,$]=Te();o.useEffect(()=>{if(!g.has("_ptxn"))return;const s=new URLSearchParams(g);s.delete("_ptxn"),$(s,{replace:!0})},[g,$]);const{catalog:m,loading:I,error:j,refresh:je}=Ue(),{account:f,auth:S,refresh:z}=$e(),n=g.get("order")||"",v=g.get("intent")==="trial",we=g.get("sku"),[re,M]=o.useState(null),[_,ae]=o.useState(!1),[W,J]=o.useState(!!n),[se,L]=o.useState(null),[ce,Ne]=o.useState(null),[K,Q]=o.useState(null),[Ce,ne]=o.useState(!1),V=o.useRef(!1),q=o.useRef(0),X=o.useRef(null),y=o.useRef(!0),r=S?.signedIn?S.user?.id:null,ie=o.useRef(n);ie.current=n;const k=o.useRef(r);k.current=r;const oe=re?.ownerId===r?re:null,le=ce?.ownerId===r?ce:null,Re=K?.ownerId===r&&K?.orderId===n?K.error:null,h=se||Re,a=oe?.order,A=le||oe?.membership||f?.membership,P=m?.policy?.hosting_mode==="self_hosted"||A?.status==="self_hosted",O=a?.sku||we,w=m?.prices?.find(s=>s.sku===O),B=a?.currency||w?.currency,Y=a?.amount_cents??w?.amount_cents,N=a?.billing_mode||w?.billing_mode,de=a?.term_months||w?.term_months,H=a?.provider||"waffo",i=le?"trial_success":_&&!a?"creating":G(a,A),b=ze(m),F=!!m?.providers?.[H],D=!!(a?.retry_payment_conflict_at||[...f?.conflict_orders||[],...f?.pending_orders||[]].some(s=>s.retry_payment_conflict_at)),ue=A?.has_gift===!0||f?.membership?.has_gift===!0||f?.gifts?.some(s=>["active","pending"].includes(s.state)),Ee=a?.provider==="waffo"&&a.payment_state==="unpaid"&&a.status!=="paid"&&["awaiting","expired","canceled"].includes(i)&&b&&F&&!D&&!ue,C=S?.getAccessToken,d=fe(r),me=`/login?next=${encodeURIComponent(`/billing/checkout?${g}`)}`,he=m?.environment==="live"&&!v&&g.getAll("order").length===1&&_e.test(n)&&["mac","windows"].includes(et())&&!(navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Me()&&!He()&&!Fe()?`tokentracker://billing/return?order=${n.toLowerCase()}`:null;o.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]);const R=o.useCallback(async()=>{if(P||!n||!r||k.current!==r)return null;if(!_e.test(n))return L({code:"order_not_found"}),J(!1),null;const s=++q.current;try{const c=await U("order",{auth:C,params:{id:n}});if(s!==q.current||k.current!==r)return null;M({...c,ownerId:r}),L(null);const ee=G(c.order,c.membership);if(ee==="success"&&Q(null),["success","refunded"].includes(ee)){const E=`${r}:${n}:${ee}`;X.current!==E&&(X.current=E,z())}if(["success","expired","canceled","refunded"].includes(G(c.order,c.membership))){const E=fe(r),Oe=c.order.payment_state==="unpaid"&&c.order.status!=="paid"&&["expired","canceled"].includes(G(c.order,c.membership))&&E?.retry_order_id===n&&E?.retry_request_id;E?.order_id===n&&!Oe&&Ve(r)}return c}catch(c){return s===q.current&&L(c),null}finally{s===q.current&&J(!1)}},[n,r,C,P,z]);o.useEffect(()=>(M(null),L(null),X.current=null,J(!!(n&&r)),R(),()=>{q.current+=1}),[R,n,r]),o.useEffect(()=>{if(P||!n||!r||["success","canceled","expired","refunded"].includes(i))return;const s=()=>{document.visibilityState==="visible"&&R()},c=window.setInterval(s,5e3);return window.addEventListener("focus",s),document.addEventListener("visibilitychange",s),()=>{window.clearInterval(c),window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",s)}},[n,r,i,R,P]);const T=async s=>{if(!V.current){V.current=!0,ae(!0),L(null),Q(null);try{await s()}catch(c){y.current&&k.current===r&&Q({ownerId:r,orderId:n,error:c})}finally{V.current=!1,ae(!1)}}},Ie=()=>T(async()=>{const s=Xe(r,O,H),c=await U("checkout",{auth:C,body:{sku:O,provider:H,request_id:s.request_id,mobile:window.matchMedia("(max-width: 640px)").matches}});ye(r,{...s,order_id:c.order.id}),!(!y.current||k.current!==r)&&(M({...c,ownerId:r,order:{...w,provider:H,...c.order}}),$({order:c.order.id},{replace:!0}))}),Se=()=>T(async()=>{const s=await U("trial",{auth:C,body:{}});!y.current||k.current!==r||(Ne({...s.membership,ownerId:r}),z())}),xe=()=>T(async()=>{await U("reconcile",{auth:C,body:{id:n}}),!(!y.current||k.current!==r)&&(await R(),await z())}),Le=()=>T(async()=>{const s=Ye(r,a);ne(!0);try{const c=await U("restart-checkout",{auth:C,body:{id:a.id,request_id:s.retry_request_id}});if(ye(r,{sku:a.sku,provider:a.provider,request_id:s.retry_request_id,order_id:c.order.id}),!y.current||k.current!==r||ie.current!==a.id)return;M({...c,ownerId:r}),$({order:c.order.id},{replace:!0})}finally{y.current&&ne(!1)}}),qe=()=>T(async()=>{await Ze(a.checkout_url)}),Z=m?.limits?.trial_days||7,Ae=new Date(Date.now()+Z*864e5).toISOString(),pe=v?t("cloud.checkout.starting_trial"):t("cloud.checkout.creating"),Pe={review:v?t("cloud.checkout.trial_title"):t("cloud.checkout.title"),creating:pe,awaiting:t("cloud.checkout.awaiting"),activating:t("cloud.checkout.activating"),success:t("cloud.checkout.success"),canceled:t("cloud.checkout.canceled"),expired:a?.status==="paid"?t("cloud.checkout.term_ended"):t("cloud.checkout.expired"),refunded:t("cloud.checkout.refunded"),trial_success:t("cloud.checkout.trial_success")};let x=null;if(!r)x=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.sign_in")}),e.jsx(l,{as:u,to:me,className:"w-full no-underline",disabled:S?.loading,children:t("cloud.action.sign_in_continue")})]});else if(W||_&&!a)x=e.jsxs("p",{role:"status",className:"flex items-center gap-2 text-sm",children:[e.jsx(tt,{className:"motion-safe:animate-spin",size:17,"aria-hidden":!0}),W?t("cloud.checkout.loading"):pe]});else if(i==="trial_success"||i==="success")x=e.jsxs("div",{className:"space-y-5",children:[e.jsx(ct,{size:32,className:"text-oai-gray-700 dark:text-oai-gray-200","aria-hidden":!0}),e.jsx("p",{className:"text-sm leading-6",children:i==="trial_success"?t("cloud.trial.ends",{date:te(A.trial_ends_at)}):t("cloud.membership.expires",{date:te(A.expires_at)})}),e.jsx(l,{as:u,to:"/dashboard",className:"w-full no-underline",children:t("cloud.action.open_dashboard")}),e.jsx(u,{to:"/settings?section=account",className:"flex min-h-10 items-center justify-center text-sm underline underline-offset-4",children:t("cloud.action.manage_membership")})]});else if(i==="review"&&!n&&ue)x=e.jsxs("div",{className:"space-y-5",children:[e.jsx(p,{children:t("cloud.gift.error_active")}),e.jsx(l,{as:u,to:"/settings?section=account",variant:"secondary",className:"w-full no-underline",children:t("cloud.action.manage_membership")})]});else if(i==="review"&&!n&&v)x=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6",children:t("cloud.trial.disclosure",{days:Z,date:te(Ae)})}),e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.trial.expiry")}),f?.membership&&!f.membership.trial_available?e.jsx(p,{children:t("cloud.error.trial")}):null,e.jsx(l,{onClick:Se,disabled:_||!b||!f?.membership?.trial_available,className:"w-full",children:t("cloud.action.start_trial",{days:Z})})]});else if(i==="review"&&!n&&w)x=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6",children:t("cloud.checkout.review")}),e.jsxs("p",{className:"inline-flex items-center gap-2 text-sm",children:[e.jsx(rt,{size:16,"aria-hidden":!0}),t("cloud.checkout.waffo")]}),N?e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:N==="fixed"?t("cloud.checkout.methods_fixed"):t("cloud.checkout.methods_recurring")}):null,N?e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:N==="fixed"?t("cloud.renewal.manual"):t("cloud.renewal.auto")}):null,d?.order_id?e.jsx(l,{as:u,to:`/billing/checkout?order=${encodeURIComponent(d.order_id)}`,className:"w-full no-underline",children:t("cloud.action.resume_order")}):null,d?.request_id&&!d.order_id&&d.sku!==O?e.jsx(l,{as:u,to:`/billing/checkout?sku=${encodeURIComponent(d.sku)}`,className:"w-full no-underline",children:t("cloud.action.resume_purchase")}):null,!d?.order_id&&!(d?.request_id&&d.sku!==O)?e.jsx(l,{onClick:Ie,disabled:_||!b||!F||!N||!!d?.order_id||D,className:"w-full",children:t("cloud.action.create_checkout",{amount:ge(Y,B)})}):null]});else if(a){const s={creating:t("cloud.checkout.pending_creation"),awaiting:t("cloud.checkout.pending_payment"),activating:t("cloud.checkout.received"),expired:a?.status==="paid"?t("cloud.checkout.term_ended_detail"):t("cloud.checkout.expired_detail"),canceled:t("cloud.checkout.canceled_detail"),refunded:t("cloud.checkout.refunded_detail")};x=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:s[i]}),i==="awaiting"&&a.checkout_url&&b&&F&&!D?e.jsxs(l,{onClick:qe,disabled:_,className:"w-full",children:[t("cloud.action.open_payment"),e.jsx(at,{size:15,className:"ml-2","aria-hidden":!0})]}):null,i!=="refunded"?e.jsxs(e.Fragment,{children:[e.jsx(l,{onClick:xe,disabled:_,variant:"ghost",className:"mx-auto flex underline underline-offset-4",children:_?t("cloud.action.checking"):t("cloud.action.check_payment")}),e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.recovery_hint")})]}):null,Ee?e.jsxs("details",{open:i!=="awaiting",className:"border-t border-oai-gray-200 pt-4 dark:border-oai-gray-800",children:[e.jsx("summary",{className:"min-h-10 cursor-pointer text-sm font-medium leading-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:t("cloud.checkout.help_title")}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.restart_detail")}),e.jsx(l,{onClick:Le,disabled:_,variant:i==="awaiting"?"secondary":"primary",className:"w-full",children:Ce?t("cloud.action.restarting_checkout"):t("cloud.action.restart_checkout")})]})]}):null,["canceled","expired"].includes(i)&&!D?e.jsx(u,{to:"/cloud",className:"flex min-h-10 items-center justify-center text-sm underline underline-offset-4",children:a.status==="paid"?t("cloud.action.renew"):t("cloud.action.choose_plan")}):null,i==="refunded"?e.jsx(l,{as:u,to:"/settings?section=account",className:"w-full no-underline",children:t("cloud.action.manage_membership")}):null,e.jsxs("details",{className:"border-t border-oai-gray-200 pt-4 dark:border-oai-gray-800",children:[e.jsxs("summary",{className:"min-h-10 cursor-pointer text-xs leading-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:[t("cloud.checkout.order_id")," · ",a.id.slice(0,8)]}),e.jsx("p",{className:"mb-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:Ge(a.provider)}),e.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.order_id")}),e.jsx("p",{className:"mt-1 break-all font-mono text-xs select-all",children:a.id}),a.status!=="paid"&&a.expires_at?e.jsx("p",{className:"mt-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.expires",{date:We(a.expires_at)})}):null]})]})}else x=e.jsx(p,{children:n?t("cloud.error.order_not_found"):t("cloud.checkout.choose_plan")});return P?e.jsx(Je,{}):e.jsx("div",{className:"tt-cloud-theme flex flex-1 flex-col font-oai text-oai-black dark:text-oai-white",children:e.jsxs("main",{className:"mx-auto w-full max-w-4xl px-4 py-8 sm:px-6 sm:py-12",children:[e.jsxs(u,{to:"/cloud",className:"mb-7 inline-flex min-h-10 items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand",children:[e.jsx(st,{size:16,"aria-hidden":!0}),t("cloud.checkout.back")]}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight","aria-live":"polite",children:W?t("cloud.checkout.loading"):Pe[i]}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.local_free")}),m?.environment==="sandbox"&&!v?e.jsx("p",{className:"mt-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.price.draft")}):null,D?e.jsx("div",{className:"mt-5",children:e.jsx(Ke,{})}):null,e.jsxs("div",{className:"mt-7 grid items-start gap-5 md:grid-cols-[minmax(0,1fr)_18rem]",children:[e.jsxs(ke,{bodyClassName:"sm:p-7",children:[x,he?e.jsxs("div",{className:"mt-5 space-y-3 border-t border-oai-gray-200 pt-5 dark:border-oai-gray-800",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.return_app_hint")}),e.jsx("a",{href:he,className:"inline-flex min-h-10 items-center text-sm underline underline-offset-4",children:t("cloud.action.open_app")})]}):null]}),e.jsxs(ke,{children:[e.jsx("h2",{className:"text-sm font-semibold",children:t("cloud.checkout.summary")}),v?e.jsx("p",{className:"mt-3 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.trial.no_card")}):e.jsxs("div",{className:"mt-4 border-b border-oai-gray-200 pb-4 dark:border-oai-gray-800",children:[e.jsx("p",{className:"text-2xl font-semibold tabular-nums",children:Y!=null&&B?ge(Y,B):t(I?"cloud.catalog.loading":"cloud.price.pending")}),de?e.jsx("p",{className:"mt-1 text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:de===12?t("cloud.price.per_year"):t("cloud.price.per_month")}):null,N&&B?e.jsx("p",{className:"mt-2 text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:B==="USD"?t("cloud.checkout.tax"):t("cloud.renewal.manual")}):null]}),e.jsx("div",{className:"mt-5",children:e.jsx(Qe,{limits:m?.limits})})]})]}),e.jsxs("div",{className:"mt-5 space-y-3",children:[h?e.jsx(p,{error:h,onRetry:n?se?R:xe:void 0}):null,h&&["subscription_already_exists","fixed_term_still_active","checkout_request_conflict","pending_checkout_exists","gift_membership_active"].includes(h.code||h.message)?e.jsx(l,{as:u,to:"/settings?section=account",variant:"secondary",className:"no-underline",children:t("cloud.action.manage_membership")}):null,h&&["authentication_required","invalid_token","invalid_authentication"].includes(h.code||h.message)?e.jsx(l,{onClick:async()=>{await S?.signOut?.(),be(me)},variant:"secondary",children:t("cloud.action.sign_in_continue")}):null,j?e.jsx(p,{error:j,onRetry:je}):null,!j&&I?e.jsx(p,{children:t("cloud.catalog.loading")}):null,!j&&!I&&!b?e.jsx(p,{children:t("cloud.catalog.preview")}):null,!j&&!I&&b&&!v&&!h&&!F&&["review","creating","awaiting"].includes(i)?e.jsx(p,{children:t("cloud.catalog.provider_unavailable")}):null,!j&&!I&&b&&m?.environment==="sandbox"?e.jsx(p,{children:t("cloud.catalog.sandbox")}):null]})]})})}export{xt as CloudCheckoutPage};
@@ -1 +0,0 @@
1
- import{r as N,d as Q,o as V,p as W,q as X,t as Y,c as a,j as e,S as Z,C as ee,M as ae,B as m,L as _,v as y,w as te,x as E,y as se,z as x}from"./__vite-browser-external-DUJeOWgd.js";import{S as le}from"./Controls-BnTeX7T4.js";import{C as U}from"./Card-D-5mABVt.js";import{C as I}from"./check-CKwHc4Hv.js";import{A as L}from"./arrow-right-CwBz5dwb.js";import{S as re}from"./server-DFCbznC7.js";function xe(){const z=N.useRef(null);N.useLayoutEffect(()=>{const t=z.current?.parentElement;t&&(t.scrollTop=0)},[]);const T=Q(),{catalog:r,loading:n,error:o,refresh:$}=V(),{account:u,auth:b,loading:D,error:v,refresh:F}=W(),[i,G]=N.useState("recurring"),[c,H]=N.useState(12),l=r?.prices?.find(t=>t.billing_mode===i&&t.term_months===c),J=r?.prices?.find(t=>t.billing_mode===i&&t.term_months===1),K=r?.prices?.find(t=>t.billing_mode===i&&t.term_months===12),g=l?.currency||"USD",A=X(J,K),h=Y(r),M=r?.providers?.waffo,s=u?.membership,j=s?.has_gift===!0||u?.gifts?.some(t=>["active","pending"].includes(t.state)),k=[...u?.conflict_orders||[],...u?.pending_orders||[]].some(t=>t.retry_payment_conflict_at),p=s&&["active","trial","transition","legacy_free"].includes(s.status),f=u?.subscriptions?.some(t=>["active","trialing","past_due","paused"].includes(t.status)&&!t.cancel_at_period_end),w=s?.trial_available===!1,R=!b?.signedIn||s?.trial_available===!0,C=!!(b?.loading||b?.signedIn&&(D||v||!s)),d=s?.status==="active"||f||j,S=!p&&!f&&!j&&!w,P=a(i==="fixed"?"cloud.action.buy_pro":"cloud.action.subscribe"),B=!l||!h||n||o||C||!M||k,q=(t=!1)=>{const O=t?new URLSearchParams({intent:"trial"}):new URLSearchParams({sku:l.sku});T(`/billing/checkout?${O}`)};return r?.policy?.hosting_mode==="self_hosted"||s?.status==="self_hosted"?e.jsx(Z,{}):e.jsx("div",{ref:z,className:"tt-cloud-theme flex flex-1 flex-col font-oai text-oai-black dark:text-oai-white",children:e.jsxs("main",{className:"mx-auto w-full max-w-5xl px-4 py-7 sm:px-6 sm:py-9",children:[e.jsxs("div",{className:"mb-8 max-w-2xl",children:[e.jsx("h1",{className:"text-balance text-3xl font-semibold tracking-tight",children:a("cloud.page.title")}),e.jsx("p",{className:"mt-3 text-base leading-7 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.page.subtitle")}),r?.environment==="sandbox"?e.jsx("p",{className:"mt-3 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.price.draft")}):null]}),k?e.jsx("div",{className:"mb-6",children:e.jsx(ee,{})}):null,e.jsxs("div",{className:"grid items-start gap-5 md:grid-cols-2",children:[e.jsxs(U,{className:"order-2 md:order-1",bodyClassName:"flex flex-col sm:p-6",children:[e.jsxs("div",{className:"mb-2 flex min-h-11 items-center gap-2",children:[e.jsx(ae,{size:19,className:"text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0}),e.jsx("h2",{className:"text-lg font-semibold",children:a("cloud.free.title")})]}),e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400 md:min-h-12",children:a("cloud.free.subtitle")}),e.jsxs("div",{className:"my-6",children:[e.jsx("p",{className:"text-3xl font-semibold tracking-tight",children:a("cloud.free.price")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.free.forever")})]}),e.jsx(m,{as:_,to:b?.signedIn?"/dashboard":"/landing#download",variant:"secondary",className:"w-full no-underline",children:a("cloud.free.cta")}),e.jsx("div",{className:"mt-7 border-t border-oai-gray-200 pt-6 dark:border-oai-gray-800",children:e.jsx("ul",{className:"space-y-3 text-sm",children:[a("cloud.free.tracking"),a("cloud.free.limits"),a("cloud.free.desktop"),a("cloud.free.exports"),a("cloud.free.community")].map(t=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx(I,{size:16,className:"mt-0.5 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0}),t]},t))})}),e.jsx("p",{className:"pt-6 text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.free.installations")})]}),e.jsxs(U,{className:"order-1 border-oai-gray-300 dark:border-oai-gray-600 md:order-2",bodyClassName:"sm:p-6",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[e.jsx("h2",{className:"text-lg font-semibold",children:a("cloud.plan.title")}),e.jsx("div",{role:"group","aria-label":a("cloud.selector.term"),className:"tt-pro-period-control shrink-0",children:e.jsx(le,{options:[{value:1,label:a("cloud.term.monthly")},{value:12,label:a("cloud.term.yearly")}],value:c,onChange:H})})]}),e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400 md:min-h-12",children:a("cloud.plan.subtitle")}),e.jsxs("div",{className:"mb-4 mt-5","aria-live":"polite",children:[e.jsxs("p",{className:"flex flex-wrap items-baseline gap-2",children:[e.jsx("span",{className:"text-4xl font-semibold tracking-tight tabular-nums",children:l?y(l.amount_cents,g):a("cloud.price.pending")}),e.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:c===12?a("cloud.price.per_year"):a("cloud.price.per_month")})]}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:l?i==="fixed"?a(c===12?"cloud.price.fixed_annual_total":"cloud.price.fixed_monthly_total",{equivalent:y(Math.round(l.amount_cents/12),g)}):c===12?a("cloud.price.annual_total",{total:y(l.amount_cents,g),equivalent:y(Math.round(l.amount_cents/12),g)}):a("cloud.price.monthly_total",{total:y(l.amount_cents,g)}):a("cloud.price.waiting")}),c===12&&A!==0?e.jsx("p",{className:"mt-1 text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.price.savings",{percent:A})}):null]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("label",{htmlFor:"pro-renewal-toggle",className:"cursor-pointer text-sm font-medium",children:a("cloud.billing_mode.recurring")}),e.jsx("button",{id:"pro-renewal-toggle",type:"button",role:"switch","aria-checked":i==="recurring","aria-label":a("cloud.billing_mode.recurring"),"aria-describedby":"pro-renewal-description",onClick:()=>G(t=>t==="recurring"?"fixed":"recurring"),className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-md",children:e.jsx("span",{"aria-hidden":!0,className:`relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${i==="recurring"?"bg-oai-gray-900 dark:bg-oai-gray-100":"bg-oai-gray-300 dark:bg-oai-gray-700"}`,children:e.jsx("span",{className:`h-3.5 w-3.5 rounded-full transition-transform motion-reduce:transition-none ${i==="recurring"?"translate-x-[19px] bg-white dark:bg-oai-gray-900":"translate-x-[3px] bg-white"}`})})})]}),e.jsx("p",{id:"pro-renewal-description",className:"text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:a(i==="recurring"?"cloud.renewal.auto":"cloud.renewal.manual")})]}),d?e.jsx(m,{as:_,to:"/settings?section=account",className:"w-full no-underline",children:a("cloud.action.manage_membership")}):null,!d&&S?e.jsxs(m,{type:"button",onClick:()=>q(!0),disabled:!h||n||o||C||!R||k,className:"w-full",children:[a("cloud.action.try",{days:r?.limits?.trial_days||7}),e.jsx(L,{size:16,className:"ml-2","aria-hidden":!0})]}):null,!d&&!S?e.jsxs(m,{type:"button",onClick:()=>q(),disabled:B,className:"w-full",children:[P,e.jsx(L,{size:16,className:"ml-2","aria-hidden":!0})]}):null,p||f||w&&!p||R&&!C?e.jsx("p",{className:"mt-2 text-center text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:p||f?te(s?.status):w?a("cloud.error.trial"):a("cloud.trial.no_card")}):null,p&&!d?e.jsxs("p",{className:"mt-2 text-center text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:[s?.status==="transition"&&s.transition_ends_at?a("cloud.membership.expires",{date:E(s.transition_ends_at)}):s?.status==="trial"&&s.trial_ends_at?a("cloud.membership.expires",{date:E(s.trial_ends_at)}):null,e.jsx(_,{to:"/settings?section=account",className:"ml-2 inline-flex min-h-8 items-center underline underline-offset-4",children:a("cloud.action.manage_membership")})]}):null,!f&&!j&&(S||d&&i==="fixed")?e.jsx(m,{type:"button",variant:"ghost",onClick:()=>q(),disabled:B,className:"mx-auto mt-1 !flex w-fit underline underline-offset-4",children:d?a("cloud.action.renew"):P}):null,j?e.jsx("p",{className:"mt-3 text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.gift.error_active")}):null,l?e.jsx("p",{className:"mt-2 text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.checkout.tax")}):null,e.jsxs("div",{className:"mt-6 border-t border-oai-gray-200 pt-6 dark:border-oai-gray-800",children:[e.jsx(se,{limits:r?.limits}),e.jsxs("p",{className:"mt-4 flex items-start gap-3 text-sm leading-6",children:[e.jsx(I,{size:17,className:"mt-1 shrink-0 text-oai-gray-600 dark:text-oai-gray-300","aria-hidden":!0}),a("cloud.feature.pro_identity")]})]}),e.jsx("p",{className:"mt-5 text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.feature.privacy_detail")})]})]}),e.jsxs("div",{className:"mt-5",children:[v?e.jsx(x,{error:v,context:"account",onRetry:F}):null,o?e.jsx(x,{error:o,onRetry:$}):null,!o&&n?e.jsx(x,{children:a("cloud.catalog.loading")}):null,!o&&!n&&!h?e.jsx(x,{children:a("cloud.catalog.preview")}):null,!o&&!n&&h&&!M?e.jsx(x,{children:a("cloud.catalog.provider_unavailable")}):null,!o&&!n&&h&&r?.environment==="sandbox"?e.jsx(x,{children:a("cloud.catalog.sandbox")}):null]}),e.jsxs("section",{className:"mt-8 flex flex-col gap-5 rounded-xl border border-oai-gray-200 p-5 dark:border-oai-gray-800 sm:flex-row sm:items-center sm:justify-between sm:p-7",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-base font-semibold",children:[e.jsx(re,{size:18,"aria-hidden":!0}),a("cloud.self_host.title")]}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:a("cloud.self_host.body")})]}),e.jsxs(m,{as:_,to:"/self-host",variant:"secondary",className:"shrink-0 self-start no-underline sm:self-auto",children:[a("cloud.self_host.cta"),e.jsx(L,{size:16,className:"ml-2","aria-hidden":!0})]})]}),e.jsxs("div",{className:"mt-10 grid gap-7 border-t border-oai-gray-200 pt-7 dark:border-oai-gray-800 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:a("cloud.faq.cost_title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.faq.cost_body")})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:a("cloud.faq.local_title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.faq.local_body")})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:a("cloud.faq.expiry_title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.faq.expiry_body")})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:a("cloud.faq.existing_title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.faq.existing_body")})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:a("cloud.faq.platform_title")}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a("cloud.faq.platform_body")})]})]})]})})}export{xe as CloudPage};
@@ -1,4 +0,0 @@
1
- import{A as ee,r as o,D as V,af as Z,ao as te,ap as ae,ah as re,ag as ne,ae as oe,a as se,aq as H,j as u,B as $,c as i,ar as ce}from"./__vite-browser-external-DUJeOWgd.js";import{D as ie}from"./download-CJUnX1Bs.js";const X={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};X.node;const xe=ee(X),K="tt.qualityPerDollar.enabled";function B(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(K)==="1"}catch{return!1}}function he(){const[e,a]=o.useState(B);o.useEffect(()=>{if(typeof window>"u")return;const n=r=>{(r.key===null||r.key===K)&&a(B())};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},[]);const t=o.useCallback(n=>{const r=!!n;a(r);try{window.localStorage.setItem(K,r?"1":"0")}catch{}},[]),s=o.useCallback(()=>t(!B()),[t]);return{enabled:e,setEnabled:t,toggle:s}}const Y="tt.sessionEfficiency.enabled";function J(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Y)==="1"}catch{return!1}}function we(){const[e,a]=o.useState(J);o.useEffect(()=>{if(typeof window>"u")return;const n=r=>{(r.key===null||r.key===Y)&&a(J())};return window.addEventListener("storage",n),()=>window.removeEventListener("storage",n)},[]);const t=o.useCallback(n=>{const r=!!n;a(r);try{window.localStorage.setItem(Y,r?"1":"0")}catch{}},[]),s=o.useCallback(()=>t(!J()),[t]);return{enabled:e,setEnabled:t,toggle:s}}const q=["total_tokens","billable_total_tokens","input_tokens","output_tokens","cached_input_tokens","cache_creation_input_tokens","reasoning_output_tokens","conversation_count","total_cost_usd"];class c extends Error{constructor(a,t=0){super(a),this.code=a,this.status=t}code;status}function A(e){return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e+"T00:00:00Z"))&&new Date(e+"T00:00:00Z").toISOString().slice(0,10)===e}function le(e,a){if(!oe(e))throw new c("export_auth_required",401);try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=JSON.parse(atob(t.padEnd(Math.ceil(t.length/4)*4,"=")));if((s.sub||s.user_id)!==a||s.role!=="authenticated"||!Number.isFinite(s.exp)||s.exp*1e3<=Date.now())throw Error()}catch{throw new c("export_auth_required",401)}}function W(e){if(typeof e?.membership?.can_read_cloud!="boolean")throw new c("export_invalid_data",503);if(!e.membership.can_read_cloud)throw new c("export_access_denied",402);const a=e.membership;return JSON.stringify([e.environment,a.phase,a.status,a.hosting_mode,a.expires_at,a.trial_ends_at,a.transition_ends_at,a.read_only_until])}async function ue({userId:e,auth:a,from:t,to:s,deviceId:n=null,signal:r,assertCurrent:h=()=>{},fetchImpl:R=fetch}){if(!A(t)||!A(s)||t>s)throw new c("export_invalid_dates",400);if(typeof a!="function")throw new c("export_auth_required",401);if(!e||n&&!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n))throw new c("export_invalid_scope",400);const S=V(),k=Z();if(!S)throw new c("export_instance_changed",409);const d=()=>{if(r?.aborted)throw new c("export_cancelled",409);if(h(),S!==V()||k!==Z())throw new c("export_instance_changed",409)};async function N(f,_){d();const w=await ae(a);d(),le(w||"",e);const p=new URL(re(S,f));for(const[g,b]of Object.entries(_))p.searchParams.set(g,b);const D=new AbortController,I=()=>D.abort();r?.addEventListener("abort",I,{once:!0});const y=setTimeout(I,25e3);try{const g=await ne(p.toString(),{method:"GET",cache:"no-store",redirect:"error",signal:D.signal,headers:{Accept:"application/json",Authorization:"Bearer "+w,...k?{apikey:k}:{}}},R);if(d(),!g.ok)throw new c(g.status===401?"export_auth_required":g.status===402||g.status===403?"export_access_denied":"export_failed",g.status);const b=await g.json();return d(),b}finally{clearTimeout(y),r?.removeEventListener("abort",I)}}const O=W(await N("tokentracker-billing",{action:"account"})),L={from:t,to:s,tz_offset_minutes:"0",...n?{device_id:n}:{}};if(await N("tokentracker-account-daily",L),W(await N("tokentracker-billing",{action:"account"}))!==O)throw new c("export_access_changed",409);const l=await N("tokentracker-account-daily",L);if(!A(l?.from)||!A(l?.to)||l.from<t||l.to>s||l.from>l.to||!Array.isArray(l.data)||l.data.length>1096)throw new c("export_invalid_data",503);const j=new Set,C=l.data.map(f=>{if(!A(f?.day)||f.day<l.from||f.day>l.to||j.has(f.day))throw new c("export_invalid_data",503);j.add(f.day);const _={day:f.day};for(const w of q){const p=f[w];if(typeof p!="number"||!Number.isFinite(p)||p<0||w!=="total_cost_usd"&&!Number.isSafeInteger(p))throw new c("export_invalid_data",503);_[w==="total_cost_usd"?"estimated_cost_usd":w]=p}return _}).sort((f,_)=>f.day.localeCompare(_.day));return d(),{schema:"tokentracker.cloud-usage.v1",metadata:{source:"cloud",backend_origin:new URL(S).origin,exported_at:new Date().toISOString(),timezone:"UTC",requested_range:{from:t,to:s},effective_range:{from:l.from,to:l.to},device_scope:n?"selected":"all",aggregation:"daily_all_providers",cost_currency:"USD",cost_basis:"estimated",row_count:C.length},rows:C}}function de(e){const a=String(e??"");return'"'+(/^[\s]*[=+\-@]/.test(a)?"'"+a:a).replace(/"/g,'""')+'"'}function fe(e,a){if(a==="json")return JSON.stringify(e,null,2)+`
2
- `;const t=e.metadata,s=["row_type","source","backend_origin","exported_at","timezone","cost_currency","cost_basis","requested_from","requested_to","effective_from","effective_to","device_scope","aggregation","row_count","day",...q.map(r=>r==="total_cost_usd"?"estimated_cost_usd":r)],n=[t.source,t.backend_origin,t.exported_at,t.timezone,t.cost_currency,t.cost_basis,t.requested_range.from,t.requested_range.to,t.effective_range.from,t.effective_range.to,t.device_scope,t.aggregation,t.row_count];return[s,["metadata",...n,"",...q.map(()=>"")],...e.rows.map(r=>["usage",...n,r.day,...q.map(h=>r[h==="total_cost_usd"?"estimated_cost_usd":h])])].map(r=>r.map(de).join(",")).join(`\r
3
- `)+`\r
4
- `}async function pe(e,a,{signal:t,assertCurrent:s=()=>{}}={}){const n=fe(e,a),r=`tokentracker-cloud-usage-${e.metadata.effective_range.from}-${e.metadata.effective_range.to}.${a}`,h=()=>{if(t?.aborted)throw new c("export_cancelled",409);s()};h();const R=await te({filename:r,content:n,format:a,signal:t});if(h(),R?.saved===!0)return;if(R!==null)throw new c("export_failed",503);const S=new Blob([n],{type:a==="csv"?"text/csv;charset=utf-8":"application/json;charset=utf-8"}),k=URL.createObjectURL(S);try{const d=document.createElement("a");d.href=k,d.download=r,document.body.appendChild(d);try{d.click()}finally{d.remove()}}finally{setTimeout(()=>URL.revokeObjectURL(k),1e3)}}function ge(e){return e?.status===401?i("cloud.export.error_auth"):e?.status===402||e?.status===403?i("cloud.export.error_access"):e?.code==="export_invalid_dates"?i("cloud.export.error_dates"):e?.status===409?i("cloud.export.error_changed"):i("cloud.export.error_failed")}function ye({from:e,to:a,deviceId:t=null,auth:s}){const n=se(),r=s||n,h=r?.signedIn?r.user?.id:null,R=new Date().toISOString().slice(0,10),S=new Date(Date.now()-29*864e5).toISOString().slice(0,10),[k,d]=o.useState(e||S),[N,O]=o.useState(a||R),[L,l]=o.useState(!1),[j,C]=o.useState(!1),[f,_]=o.useState(null),[w,p]=o.useState(null),D=o.useId(),I=o.useRef(null),y=o.useRef(0),g=o.useRef(null),b=o.useRef(!1),U=o.useRef(!1);if(I.current={userId:h,client:r?.client,start:k,end:N,deviceId:t,from:e,to:a},o.useEffect(()=>{U.current=!0;const m=()=>{++y.current,g.current?.abort(),b.current=!1,C(!1),p(null),_(null)};return window.addEventListener(H,m),()=>{U.current=!1,++y.current,g.current?.abort(),window.removeEventListener(H,m)}},[]),o.useEffect(()=>{++y.current,g.current?.abort(),b.current=!1,C(!1),_(null),p(null),e&&d(e),a&&O(a)},[h,r?.client,e,a,t]),!h||r?.enabled===!1)return null;function G(m,x){++y.current,g.current?.abort(),b.current=!1,C(!1),_(null),p(null),m(x)}async function M(m){if(b.current)return;b.current=!0;const x=I.current,F=++y.current,P=new AbortController;g.current=P,C(!0),_(null),p(null);const T=()=>{const v=I.current;if(!U.current||F!==y.current||!v||Object.keys(x).some(E=>x[E]!==v[E])||x.client&&!ce(x.client))throw new c("export_cancelled",409)};try{const v=await ue({userId:x.userId,auth:r.getAccessToken,from:x.start,to:x.end,deviceId:x.deviceId,signal:P.signal,assertCurrent:T});T(),await pe(v,m,{signal:P.signal,assertCurrent:T}),T();const E=v.metadata.effective_range,Q=v.rows.length?i("cloud.export.success",{count:v.rows.length,from:E.from,to:E.to}):i("cloud.export.empty");p(E.from!==x.start||E.to!==x.end?`${Q} ${i("cloud.export.truncated",{from:E.from,to:E.to})}`:Q)}catch(v){U.current&&F===y.current&&_(ge(v))}finally{F===y.current&&(b.current=!1,U.current&&C(!1))}}const z="hover:!text-oai-black dark:hover:!text-oai-white hover:!bg-oai-gray-100 dark:hover:!bg-oai-gray-800 focus:!ring-oai-gray-500/40";return u.jsxs("section",{className:"tt-cloud-theme","aria-label":i("cloud.export.open"),children:[u.jsxs($,{type:"button",variant:"ghost",size:"sm",className:z,"aria-expanded":L,"aria-controls":D,onClick:()=>l(m=>!m),children:[u.jsx(ie,{className:"mr-2 h-4 w-4","aria-hidden":"true"}),i("cloud.export.open")]}),L?u.jsxs("div",{id:D,className:"mt-2 border-l-2 border-oai-gray-200 pl-3 dark:border-oai-gray-700","aria-busy":j,children:[u.jsx("p",{className:"max-w-prose text-xs leading-5 text-oai-gray-600 dark:text-oai-gray-300",children:i("cloud.export.description")}),u.jsxs("div",{className:"mt-3 flex flex-wrap items-end gap-3",children:[u.jsxs("label",{className:"text-xs text-oai-gray-700 dark:text-oai-gray-200",children:[i("cloud.export.from"),u.jsx("input",{type:"date",value:k,onChange:m=>G(d,m.target.value),className:"mt-1 block rounded-md border border-oai-gray-300 bg-white px-2 py-1.5 text-sm text-oai-black focus:outline-none focus:ring-2 focus:ring-inset focus:ring-oai-gray-500/40 dark:border-oai-gray-700 dark:bg-oai-gray-900 dark:text-oai-white"})]}),u.jsxs("label",{className:"text-xs text-oai-gray-700 dark:text-oai-gray-200",children:[i("cloud.export.to"),u.jsx("input",{type:"date",value:N,onChange:m=>G(O,m.target.value),className:"mt-1 block rounded-md border border-oai-gray-300 bg-white px-2 py-1.5 text-sm text-oai-black focus:outline-none focus:ring-2 focus:ring-inset focus:ring-oai-gray-500/40 dark:border-oai-gray-700 dark:bg-oai-gray-900 dark:text-oai-white"})]}),u.jsx($,{type:"button",variant:"ghost",size:"sm",className:z,disabled:j,onClick:()=>M("csv"),children:i("cloud.export.csv")}),u.jsx($,{type:"button",variant:"ghost",size:"sm",className:z,disabled:j,onClick:()=>M("json"),children:i("cloud.export.json")})]}),j?u.jsx("p",{role:"status",className:"mt-2 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:i("cloud.export.busy")}):null,f?u.jsx("p",{role:"alert",className:"mt-2 text-xs text-red-700 dark:text-red-300",children:f}):null,w?u.jsx("p",{role:"status",className:"mt-2 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:w}):null]}):null]})}export{ye as C,xe as P,we as a,he as u};
@@ -1 +0,0 @@
1
- import{A as M,d as E,r,a2 as I,c as i,j as o,J as A}from"./__vite-browser-external-DUJeOWgd.js";import{m as j}from"./react-B7SkZTgg.js";import{P as L}from"./ProviderIcon-BshO2uER.js";import{g as $}from"./skills-api-C-9vK884.js";import{S as R}from"./search-Ol3OZBm4.js";import{u as K}from"./use-reduced-motion-iDZEUyua.js";import{A as q}from"./index-BImBG3eS.js";const N={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};N.node;const O=M(N),T=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function J(){const f=E(),d=K(),[u,g]=r.useState(!1),[x,h]=r.useState(""),[n,l]=r.useState(0),[m,k]=r.useState([]),b=r.useRef(null),w=r.useRef(null);r.useEffect(()=>{const e=t=>{(t.metaKey||t.ctrlKey)&&(t.key==="k"||t.key==="K")&&(t.preventDefault(),g(c=>!c))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),r.useEffect(()=>{if(!u)return;h(""),l(0);const e=requestAnimationFrame(()=>b.current?.focus());return T&&!m.length&&$().then(t=>k(t?.skills||[])).catch(()=>k([])),()=>cancelAnimationFrame(e)},[u,m.length]);const y=r.useMemo(()=>{const e=I().flatMap(a=>a.items.map(c=>({kind:"page",id:`page:${c.id}`,label:c.label,sub:i("cmdk.group.pages"),Icon:c.icon,run:()=>f(c.to)}))),t=(m||[]).map(a=>({kind:"skill",id:`skill:${a.id||a.directory}`,label:a.name||a.directory,sub:a.repoOwner&&a.repoName?`${a.repoOwner}/${a.repoName}`:i("cmdk.group.skills"),provider:(a.targets||[])[0]||"claude",run:()=>f(`/skills?skill=${encodeURIComponent(a.directory||a.id)}`)}));return[...e,...t]},[f,m]),s=r.useMemo(()=>{const e=x.trim().toLowerCase();return e?y.filter(t=>t.label.toLowerCase().includes(e)||String(t.sub||"").toLowerCase().includes(e)):y},[y,x]);r.useEffect(()=>{n>=s.length&&l(s.length?s.length-1:0)},[n,s.length]),r.useEffect(()=>{if(!u)return;w.current?.querySelector(`[data-cmdk-index="${n}"]`)?.scrollIntoView({block:"nearest"})},[n,u]);const p=r.useCallback(()=>g(!1),[]),v=r.useCallback(e=>{e&&(p(),e.run())},[p]),C=e=>{e.key==="ArrowDown"?(e.preventDefault(),l(t=>Math.min(t+1,Math.max(0,s.length-1)))):e.key==="ArrowUp"?(e.preventDefault(),l(t=>Math.max(t-1,0))):e.key==="Enter"?(e.preventDefault(),v(s[n])):e.key==="Escape"&&(e.preventDefault(),p())},S={duration:d?0:.12},D=d?{duration:0}:{type:"spring",stiffness:460,damping:34,mass:.6};return o.jsx(q,{children:u?o.jsxs(j.div,{className:"fixed inset-0 z-[120] flex items-start justify-center px-4 pt-[16vh]",initial:d?!1:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:S,children:[o.jsx("button",{type:"button","aria-label":i("cmdk.close"),onClick:p,className:"absolute inset-0 cursor-default bg-oai-black/40"}),o.jsxs(j.div,{role:"dialog","aria-modal":"true","aria-label":i("cmdk.open_aria"),initial:d?!1:{opacity:0,y:-8,scale:.985},animate:{opacity:1,y:0,scale:1},exit:d?{opacity:0}:{opacity:0,y:-8,scale:.985},transition:D,className:"relative w-full max-w-xl overflow-hidden rounded-2xl border border-oai-gray-200 bg-oai-white shadow-2xl dark:border-oai-gray-800 dark:bg-oai-gray-950",children:[o.jsxs("div",{className:"flex items-center gap-2.5 border-b border-oai-gray-200 px-4 dark:border-oai-gray-800",children:[o.jsx(R,{className:"h-4 w-4 shrink-0 text-oai-gray-400","aria-hidden":!0}),o.jsx("input",{ref:b,type:"text",value:x,onChange:e=>{h(e.target.value),l(0)},onKeyDown:C,"aria-label":i("cmdk.placeholder"),"aria-controls":"cmdk-listbox","aria-activedescendant":s[n]?`cmdk-opt-${n}`:void 0,role:"combobox","aria-expanded":"true",placeholder:i("cmdk.placeholder"),className:"h-12 w-full bg-transparent text-sm text-oai-black placeholder:text-oai-gray-400 focus:outline-none dark:text-white"})]}),o.jsx("div",{ref:w,id:"cmdk-listbox",role:"listbox",className:"max-h-[min(56vh,22rem)] overflow-y-auto p-1.5",children:s.length===0?o.jsx("div",{className:"px-3 py-8 text-center text-sm text-oai-gray-500 dark:text-oai-gray-400",children:i("cmdk.empty")}):s.map((e,t)=>{const a=t===n;return o.jsxs("button",{type:"button",role:"option",id:`cmdk-opt-${t}`,"data-cmdk-index":t,"aria-selected":a,onMouseMove:()=>l(t),onClick:()=>v(e),className:A("flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition-colors",a?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-700 dark:text-oai-gray-200"),children:[o.jsx("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-400",children:e.kind==="skill"?o.jsx(L,{provider:e.provider,size:16}):o.jsx(e.Icon,{className:"h-4 w-4","aria-hidden":!0})}),o.jsx("span",{className:"min-w-0 flex-1 truncate font-medium",children:e.label}),o.jsx("span",{className:"shrink-0 truncate text-xs text-oai-gray-400 dark:text-oai-gray-500",children:e.sub}),a?o.jsx(O,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-400","aria-hidden":!0}):null]},e.id)})})]})]}):null})}export{J as CommandPalette};
@@ -1 +0,0 @@
1
- import{A as R,j as e,aj as P,l as z,r as D,c as n,X as S,i as K}from"./__vite-browser-external-DUJeOWgd.js";import{m as M}from"./react-B7SkZTgg.js";import{A as U,W as B}from"./icons-ZB1ZthjH.js";import{u as F}from"./useTokenFormat-BMvVAe6V.js";import{P as G}from"./ProviderIcon-BshO2uER.js";import{T as W}from"./TrendMonitor-C88S-5aa.js";import{T as V}from"./AchievementBadge-BaqdyZaV.js";import{T as X}from"./terminal-B3_fCLFs.js";import{D as Y,a as Z,b as H,c as q,d as J,e as Q}from"./DialogTitle-B1iNGD2S.js";import{D as ee}from"./DialogDescription-j4XnRy6y.js";import{D as ae}from"./DialogClose-DAyilsH-.js";import"./useCurrency-pwClnCZ5.js";import"./use-latest-request-guard-DHv7vfFE.js";import"./PopoverPopup-CVTiEVHs.js";import"./store-C9yWYHfg.js";import"./composite-B4Z3F65o.js";import"./SelectItemText-C7xi8iGp.js";import"./usePositioner-B0j1orGj.js";import"./safePolygon-CKpREa4K.js";import"./use-reduced-motion-iDZEUyua.js";import"./zap-DvX2aYx5.js";import"./flame-CKjAluj_.js";import"./shield-check-YcmLwVZ6.js";const C={name:"trending-down",size:24,node:[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]};C.node;const te=R(C),O=10,_={input:"var(--community-token-input)",cache_read:"var(--community-token-cache-read)",cache_write:"var(--community-token-cache-write)",output:"var(--community-token-output)",reasoning:"var(--community-token-reasoning)"},re={CLAUDE:"var(--community-claude)",CODEX:"var(--community-codex)",GEMINI:"var(--community-gemini)",CURSOR:"var(--community-cursor)",OPENCODE:"var(--community-opencode)",HERMES:"var(--community-hermes)",KIMI:"var(--community-kimi)",MIMO:"var(--community-mimo)",COPILOT:"var(--community-copilot)",KIRO:"var(--community-kiro)",GROK:"var(--community-grok)",DEEPSEEK:"var(--community-deepseek)",ZCODE:"var(--community-zcode)",WORKBUDDY:"var(--community-workbuddy)",MINIMAX:"var(--community-minimax)",DROID:"var(--community-droid)"};function ie(t){return re[String(t||"").toUpperCase()]||"var(--community-muted)"}const se=[[/claude|fable|opus|sonnet|haiku/,"CLAUDE"],[/gpt|codex|o3|o4/,"CODEX"],[/gemini/,"GEMINI"],[/composer|cursor/,"CURSOR"],[/kimi/,"KIMI"],[/mimo/,"MIMO"],[/copilot/,"COPILOT"],[/kiro/,"KIRO"],[/grok/,"GROK"],[/deepseek/,"DEEPSEEK"],[/glm/,"ZCODE"],[/hy3/,"WORKBUDDY"],[/minimax/,"MINIMAX"]],g=["overview","providers","community","models"];function oe(t){const s=String(t||"").toLowerCase(),a=se.find(([i])=>i.test(s));return a?a[1]:""}function u(t){const s=Number(t);return Number.isFinite(s)?`${s.toFixed(1)}%`:"—"}function p(t){return K(Number(t)||0)}function ne(t){return t?new Date(`${t}T00:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"}):""}function k(){return e.jsx("div",{className:"flex h-full min-h-40 items-center justify-center text-xs text-oai-gray-400",children:n("leaderboard.community.modal.no_data")})}function b({children:t,detail:s}){return e.jsxs("div",{className:"mb-3 flex items-baseline justify-between gap-4",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:t}),s?e.jsx("span",{className:"text-xs text-oai-gray-400",children:s}):null]})}function A({value:t,label:s}){const a=Number(t);if(!Number.isFinite(a))return null;const i=Math.sign(a)!==-1,r=i?V:te;return e.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium tabular-nums ${i?"text-emerald-600 dark:text-emerald-400":"text-rose-600 dark:text-rose-400"}`,title:s,children:[e.jsx(r,{className:"size-3","aria-hidden":"true"}),i?"+":"",a.toFixed(1),"%"]})}function j({label:t,value:s,title:a,delta:i,deltaLabel:r}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-xl font-semibold leading-none tracking-tight text-oai-black tabular-nums dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function I({fillWidth:t,share:s,color:a="var(--oai-blue)",ariaLabel:i,dataAttrs:r,children:o}){return e.jsxs("div",{...r,className:"group relative grid min-h-11 grid-cols-[minmax(0,1fr)_auto] items-center gap-3 overflow-hidden px-2.5 transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 opacity-[0.15] transition-opacity group-hover:opacity-[0.22] dark:opacity-[0.24] dark:group-hover:opacity-[0.32]",style:{width:`${t}%`,backgroundColor:a},role:"progressbar","aria-label":i,"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":Number(s)||0}),o]})}function T({rank:t,provider:s,name:a,fillWidth:i,share:r,tokens:o,tokensTitle:l,dataAttrs:c}){return e.jsxs(I,{fillWidth:i,share:r,color:ie(s),ariaLabel:`${a} ${u(r)}`,dataAttrs:c,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:`w-5 shrink-0 text-xs tabular-nums ${t<=3?"font-semibold text-oai-gray-700 dark:text-oai-gray-200":"text-oai-gray-400"}`,children:t}),e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(G,{provider:s,size:15})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",title:a,children:a})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",title:l,children:o}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",children:u(r)})]})]})}function le({rows:t,formatTokensTooltip:s}){return t.length?e.jsxs("div",{className:"mt-7",children:[e.jsx(b,{children:n("leaderboard.community.modal.token_mix")}),e.jsx("div",{className:"flex h-1.5 overflow-hidden bg-oai-gray-100 dark:bg-oai-gray-800",children:t.map(a=>e.jsx("div",{style:{width:`${Math.max(Number(a.share)||0,0)}%`,backgroundColor:_[a.key]||"var(--community-muted)"},title:`${n(`leaderboard.community.modal.token_mix.${a.key}`)} · ${u(a.share)}`},a.key))}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-x-5 gap-y-1.5",children:t.map(a=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",title:s(a.tokens),children:[e.jsx("span",{className:"size-2",style:{backgroundColor:_[a.key]||"var(--community-muted)"}}),n(`leaderboard.community.modal.token_mix.${a.key}`),e.jsx("span",{className:"tabular-nums text-oai-gray-700 dark:text-oai-gray-200",children:u(a.share)})]},a.key))})]}):null}function f({label:t,value:s,title:a,delta:i,deltaLabel:r,className:o=""}){return e.jsxs("div",{className:`min-w-0 ${o}`,children:[e.jsx("div",{className:"truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-baseline gap-2",children:[e.jsx("span",{className:"truncate text-base font-semibold leading-none tracking-tight tabular-nums text-oai-black dark:text-white",title:a,children:s}),e.jsx(A,{value:i,label:r})]})]})}function de({trendRows:t,activeDevelopers30d:s,developerGrowthPct:a,formatTokens:i,formatTokensTooltip:r}){if(!t.length)return null;const o=t.reduce((m,h)=>m+h.value,0),l=t.reduce((m,h)=>m.value<h.value?h:m,t[0]),c=o/t.length;return e.jsxs("div",{className:"mt-5 grid grid-cols-3 divide-x divide-oai-gray-100 border-y border-oai-gray-100 py-3.5 dark:divide-oai-gray-800/80 dark:border-oai-gray-800/80",children:[e.jsx(f,{className:"pr-4",label:n("leaderboard.community.modal.daily_average"),value:i(c),title:r(c)}),e.jsx(f,{className:"px-4",label:`${n("leaderboard.community.modal.peak_day")} · ${l.day}`,value:i(l.value),title:r(l.value)}),e.jsx(f,{className:"pl-4",label:n("leaderboard.community.modal.active_30d"),value:p(s),title:Number(s).toLocaleString(),delta:a,deltaLabel:n("leaderboard.community.modal.vs_previous_week")})]})}function me({trendRows:t,mix:s,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{children:[e.jsx(b,{detail:n("leaderboard.community.modal.utc_note"),children:n("leaderboard.community.modal.community_activity")}),e.jsx(W,{embedded:!0,rows:t,from:t[0]?.day,to:t.at(-1)?.day,chartHeightClass:"h-44"}),e.jsx(de,{trendRows:t,activeDevelopers30d:a,developerGrowthPct:i,formatTokens:r,formatTokensTooltip:o}),e.jsx(le,{rows:s,formatTokensTooltip:o})]})}function ce({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>e.jsx(T,{rank:o+1,dataAttrs:{"data-provider-rank":o+1,"data-provider-name":r.name},provider:String(r.name).toUpperCase(),name:r.name,fillWidth:Math.max((Number(r.share)||0)/s*100,2),share:r.share,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name))}):e.jsx(k,{})}function xe({rows:t,maxShare:s,formatTokens:a,formatTokensTooltip:i}){return t.length?e.jsx("div",{className:"space-y-0.5",children:t.map((r,o)=>{const l=Number(r.share)||0;return e.jsx(T,{rank:o+1,dataAttrs:{"data-model-rank":o+1,"data-model-name":r.name},provider:oe(r.name),name:r.name,fillWidth:Math.max(l/s*100,2),share:l,tokens:a(r.tokens),tokensTitle:i(r.tokens)},r.name)})}):e.jsx(k,{})}function ue({name:t}){const s=String(t||"").toLowerCase();return s==="darwin"?e.jsx(U,{className:"size-3.5"}):s==="win32"?e.jsx(B,{className:"size-3.5"}):e.jsx(X,{className:"size-4","aria-hidden":"true"})}const he=.175,ye=.3;function ge({bands:t,formatTokensTooltip:s}){const a=t.reduce((r,o)=>Math.max(r,Number(o.developer_share)||0),0)||1,i=r=>`${n(`leaderboard.community.modal.band.${r.key}`)} · ${n("leaderboard.community.modal.developer_count",{count:p(r.developers)})} (${s(r.tokens)})`;return e.jsxs("div",{children:[e.jsx("div",{className:"flex gap-2 border-b border-oai-gray-200 dark:border-oai-gray-800",children:t.map((r,o)=>{const l=Number(r.developer_share)||0,c=Math.max(l/a*80,2);return e.jsxs("div",{className:"relative h-32 min-w-0 flex-1",title:i(r),children:[e.jsx("div",{role:"progressbar","aria-label":n("leaderboard.community.modal.developer_share_title",{share:u(l)}),"aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":l,className:"absolute inset-x-0 bottom-0",style:{height:`${c}%`,backgroundColor:"var(--oai-blue)",opacity:ye+o*he}}),e.jsx("div",{className:"absolute inset-x-0 text-center text-xs font-medium tabular-nums text-oai-gray-700 dark:text-oai-gray-200",style:{bottom:`calc(${c}% + 4px)`},children:u(l)})]},r.key)})}),e.jsx("div",{className:"mt-2 flex gap-2",children:t.map(r=>e.jsxs("div",{className:"min-w-0 flex-1 text-center",title:i(r),children:[e.jsx("div",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.band.${r.key}`)}),e.jsx("div",{className:"truncate text-xs tabular-nums text-oai-gray-500 dark:text-oai-gray-400",children:p(r.developers)})]},r.key))})]})}function pe({bands:t,platforms:s,formatTokensTooltip:a}){return!t.length&&!s.length?e.jsx(k,{}):e.jsxs("div",{className:"space-y-8",children:[t.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.usage_distribution")}),e.jsx(ge,{bands:t,formatTokensTooltip:a})]}):null,s.length?e.jsxs("div",{children:[e.jsx(b,{children:n("leaderboard.community.modal.platforms")}),e.jsx("div",{className:"space-y-0.5",children:s.map(i=>e.jsxs(I,{fillWidth:Math.max(Number(i.share)||0,1),share:i.share,ariaLabel:`${n(`leaderboard.community.modal.platform.${i.name}`)} ${u(i.share)}`,children:[e.jsxs("div",{className:"relative flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:"grid size-6 shrink-0 place-items-center text-oai-gray-700 dark:text-oai-gray-200",children:e.jsx(ue,{name:i.name})}),e.jsx("span",{className:"truncate text-xs font-medium text-oai-gray-700 dark:text-oai-gray-200",children:n(`leaderboard.community.modal.platform.${i.name}`)})]}),e.jsxs("div",{className:"relative min-w-[4.5rem] text-right",children:[e.jsx("div",{className:"text-xs font-semibold text-oai-black tabular-nums dark:text-white",children:u(i.share)}),e.jsx("div",{className:"text-xs text-oai-gray-500 tabular-nums dark:text-oai-gray-400",title:Number(i.machines||0).toLocaleString(),children:n("leaderboard.community.modal.machine_count",{count:p(i.machines)})})]})]},i.name))})]}):null]})}function ve({isOpen:t,onClose:s,communityStats:a}){const{formatTokens:i,formatTokensTooltip:r}=F(),[o,l]=D.useState("overview"),c=a?.status==="ready",m=D.useMemo(()=>{if(!c)return null;const d=(Array.isArray(a.providers)?a.providers:[]).slice(0,O),x=(Array.isArray(a.topModels)?a.topModels:[]).slice(0,O),y=v=>v.reduce(($,L)=>Math.max($,Number(L.share)||0),0)||1;return{providers:d,models:x,providersMaxShare:y(d),modelsMaxShare:y(x),trendRows:(Array.isArray(a.dailyGrowth)?a.dailyGrowth:[]).map(v=>({day:ne(v.day),value:Number(v.tokens)||0})),mix:Array.isArray(a.tokenMix)?a.tokenMix:[],bands:Array.isArray(a.userDistribution)?a.userDistribution:[],platforms:Array.isArray(a.platforms)?a.platforms:[]}},[c,a]);if(!m)return null;const h=Number(a.tokenFloor)||0,N=Number(a.activeDevelopersTotal)||Number(a.totalEntries)||0,w=Number(a.tokens30d)||0,E=d=>{if(d.key!=="ArrowRight"&&d.key!=="ArrowLeft")return;d.preventDefault();const x=d.key==="ArrowRight"?1:-1,y=g[(g.indexOf(o)+x+g.length)%g.length];l(y),d.currentTarget.querySelector(`[data-tab-id="${y}"]`)?.focus()};return e.jsx(Y,{open:t,onOpenChange:d=>!d&&s(),children:e.jsxs(Z,{children:[e.jsx(H,{className:"fixed inset-0 z-[100] bg-black/50 backdrop-blur-[3px] transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),e.jsx(q,{className:"fixed inset-0 z-[101] flex items-center justify-center p-2 sm:p-5",children:e.jsxs(J,{className:"relative flex h-[min(42rem,92vh)] w-full max-w-xl flex-col overflow-hidden rounded-2xl bg-white shadow-2xl ring-1 ring-black/10 transition-[opacity,transform] duration-[220ms] ease-[cubic-bezier(0.16,1,0.3,1)] data-[ending-style]:translate-y-3 data-[ending-style]:scale-[0.98] data-[ending-style]:opacity-0 data-[starting-style]:translate-y-3 data-[starting-style]:scale-[0.98] data-[starting-style]:opacity-0 dark:bg-oai-gray-950 dark:ring-white/10",children:[e.jsxs("header",{"data-testid":"community-metrics-header",className:"shrink-0 px-5 pt-5 sm:px-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(Q,{className:"text-lg font-semibold tracking-[-0.02em] text-oai-black dark:text-white",children:n("leaderboard.community.modal.title")}),e.jsx(ee,{className:"sr-only",children:n("leaderboard.community.modal.description")})]}),e.jsx(ae,{className:"-mr-1 -mt-1 grid size-8 place-items-center rounded-full text-oai-gray-400 transition-colors hover:bg-black/5 hover:text-oai-black dark:hover:bg-white/10 dark:hover:text-white","aria-label":n("shared.dialog.close"),children:e.jsx(S,{className:"size-4"})})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-x-5",children:[e.jsx(j,{label:n("leaderboard.community.modal.total_tokens"),value:i(h),title:r(h)}),e.jsx(j,{label:n("leaderboard.community.modal.tokens_30d"),value:i(w),title:r(w),delta:a.tokenGrowthPct,deltaLabel:n("leaderboard.community.modal.vs_previous_week")}),e.jsx(j,{label:n("leaderboard.community.modal.contributors"),value:p(N),title:N.toLocaleString()})]}),e.jsx("div",{className:"mt-4 flex items-end overflow-x-auto border-b border-oai-gray-100 dark:border-oai-gray-900",role:"tablist","aria-label":n("leaderboard.community.modal.views"),onKeyDown:E,children:g.map(d=>{const x=o===d;return e.jsxs("button",{type:"button",role:"tab","data-tab-id":d,"aria-selected":x,tabIndex:x?0:-1,onClick:()=>l(d),className:`relative mr-5 h-10 shrink-0 text-sm font-medium transition-colors last:mr-0 ${x?"text-oai-black dark:text-white":"text-oai-gray-500 hover:text-oai-gray-700 dark:text-oai-gray-400 dark:hover:text-oai-gray-200"}`,children:[n(`leaderboard.community.modal.tab.${d}`),x?e.jsx(M.span,{layoutId:"community-metrics-tab-underline",className:"absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-oai-black dark:bg-white",transition:{type:"spring",stiffness:420,damping:34}}):null]},d)})})]}),e.jsx("div",{"data-testid":"community-metrics-content",className:"min-h-0 flex-1 overflow-y-auto px-5 py-5 sm:px-6",children:e.jsxs(M.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.16,1,.3,1]},className:"h-full",children:[o==="overview"?e.jsx(me,{trendRows:m.trendRows,mix:m.mix,activeDevelopers30d:Number(a.activeDevelopers30d)||0,developerGrowthPct:a.developerGrowthPct,formatTokens:i,formatTokensTooltip:r}):null,o==="providers"?e.jsx(ce,{rows:m.providers,maxShare:m.providersMaxShare,formatTokens:i,formatTokensTooltip:r}):null,o==="community"?e.jsx(pe,{bands:m.bands,platforms:m.platforms,formatTokensTooltip:r}):null,o==="models"?e.jsx(xe,{rows:m.models,maxShare:m.modelsMaxShare,formatTokens:i,formatTokensTooltip:r}):null]},o)})]})})]})})}function Be(t){return e.jsx(P,{mode:z.COMPACT,children:e.jsx(ve,{...t})})}export{Be as CommunityStatsModal};
@@ -1 +0,0 @@
1
- import{j as e,J as n}from"./__vite-browser-external-DUJeOWgd.js";import{C as c}from"./Card-D-5mABVt.js";function g({checked:a,onChange:s,disabled:i,ariaLabel:r}){return e.jsx("button",{type:"button",role:"switch","aria-checked":a,"aria-label":r,onClick:s,disabled:i,className:n("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 disabled:opacity-50 disabled:cursor-not-allowed",a?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:e.jsx("span",{className:n("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",a?"translate-x-[18px]":"translate-x-[3px]")})})}function u({label:a,hint:s,control:i}){return e.jsxs("div",{className:"flex flex-col gap-2 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:a}),s?e.jsx("div",{className:"mt-0.5 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:s}):null]}),e.jsx("div",{className:"self-end sm:shrink-0 sm:self-auto",children:i})]})}function b({title:a,subtitle:s,action:i,children:r}){return e.jsxs(c,{className:"rounded-lg",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:a}),s?e.jsx("p",{className:"mt-1 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:s}):null]}),i?e.jsx("div",{className:"shrink-0",children:i}):null]}),e.jsx("div",{className:"-mb-3 divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:r})]})}function h({options:a,value:s,onChange:i,disabled:r=!1}){return e.jsx("div",{className:"inline-flex items-center rounded-lg border border-oai-gray-200 bg-oai-gray-50 p-0.5 dark:border-oai-gray-800 dark:bg-oai-gray-900",children:a.map(({value:t,label:o,Icon:l})=>{const d=s===t;return e.jsxs("button",{type:"button",onClick:()=>i(t),"aria-pressed":d,disabled:r,className:n("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",d?"bg-white text-oai-black shadow-sm dark:bg-oai-gray-800 dark:text-white":"text-oai-gray-500 hover:text-oai-black dark:text-oai-gray-400 dark:hover:text-white"),children:[l?e.jsx(l,{className:"h-3.5 w-3.5","aria-hidden":!0}):null,e.jsx("span",{children:o})]},t)})})}export{h as S,g as T,b as a,u as b};