tokentracker-cli 1.3.3 → 1.3.5
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.
- package/README.de.md +5 -5
- package/README.ja.md +3 -3
- package/README.ko.md +3 -3
- package/README.md +6 -5
- package/README.zh-CN.md +3 -3
- package/THIRD_PARTY_NOTICES.md +92 -0
- package/dashboard/dist/THIRD_PARTY_NOTICES.txt +92 -0
- package/dashboard/dist/assets/AchievementBadge-Dazs3pEa.js +1 -0
- package/dashboard/dist/assets/AchievementsPage-LWnxZvmw.js +2 -0
- package/dashboard/dist/assets/{AchievementsSection-CDUUEfIi.js → AchievementsSection-BLqczmU9.js} +1 -1
- package/dashboard/dist/assets/BadgeDetailModal-B_n4aj2S.js +1 -0
- package/dashboard/dist/assets/{BotAnimated-Dx_vvTtC.js → BotAnimated-KDWI_YcZ.js} +1 -1
- package/dashboard/dist/assets/Card-BYoxd4OC.js +1 -0
- package/dashboard/dist/assets/CloudCheckoutPage-BR2_B03P.js +1 -0
- package/dashboard/dist/assets/CloudPage-DL5RkJKK.js +1 -0
- package/dashboard/dist/assets/CloudUsageExport-C_DqZKo1.js +4 -0
- package/dashboard/dist/assets/CommandPalette-DkCaIQI4.js +1 -0
- package/dashboard/dist/assets/CommunityStatsModal-pX9OePi4.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-BQ-xB1S_.js → ConfirmModal-tkgZwz4u.js} +1 -1
- package/dashboard/dist/assets/Controls-MTUhGWy8.js +1 -0
- package/dashboard/dist/assets/DashboardPage-SOx-A7lH.js +1 -0
- package/dashboard/dist/assets/DateRangePopover-B-BMOm3O.js +1 -0
- package/dashboard/dist/assets/{DevicePage-Dg6XkIaY.js → DevicePage-DSK9lm7v.js} +1 -1
- package/dashboard/dist/assets/DialogClose-uVUNu4rg.js +1 -0
- package/dashboard/dist/assets/DialogDescription-DBqGGWNj.js +1 -0
- package/dashboard/dist/assets/DialogTitle-B-VifiA3.js +1 -0
- package/dashboard/dist/assets/{FadeIn-ChVf45WW.js → FadeIn-B6lrj4uo.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-B740_G7a.js → HeaderGithubStar-Cx5zOhXa.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-BzP5FudR.js → HoverTooltip-DY1ENf69.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BuZH3F14.js → IpCheckPage-D6TEq64d.js} +1 -1
- package/dashboard/dist/assets/LandingPage-OdZUfq--.js +2 -0
- package/dashboard/dist/assets/LeaderboardPage-DCK5xcAt.js +2 -0
- package/dashboard/dist/assets/LeaderboardProBadge-CBXJ1u_m.js +1 -0
- package/dashboard/dist/assets/{LeaderboardProfileModal-OUZvO6u-.js → LeaderboardProfileModal-Ccdzb7QK.js} +4 -4
- package/dashboard/dist/assets/{LeaderboardProfilePage-bHI1oTEK.js → LeaderboardProfilePage-CFXlZ0fL.js} +2 -2
- package/dashboard/dist/assets/LimitsPage-5krjm-g9.js +9 -0
- package/dashboard/dist/assets/{LocalOnlyNotice-BaEq6qN7.js → LocalOnlyNotice-Rk1B8PaZ.js} +1 -1
- package/dashboard/dist/assets/LoginCard-DTTIm8vk.js +1 -0
- package/dashboard/dist/assets/LoginModal-BNcDdjfr.js +1 -0
- package/dashboard/dist/assets/LoginPage-CQgXP7Ee.js +1 -0
- package/dashboard/dist/assets/{PetPage-BPBsUHyL.js → PetPage-Cw_kAPRs.js} +1 -1
- package/dashboard/dist/assets/PopoverPopup-NYiGE8A2.js +1 -0
- package/dashboard/dist/assets/{ProviderIcon-BshO2uER.js → ProviderIcon-Bp7iFJ_m.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-RTFTD8Dr.js → ResetPasswordPage-Cf9kAWDW.js} +1 -1
- package/dashboard/dist/assets/Select-kIcvQFAo.js +1 -0
- package/dashboard/dist/assets/SelectItemText-BpIsAg3b.js +1 -0
- package/dashboard/dist/assets/{SelfHostPage-BlwTt8XM.js → SelfHostPage-Ch2vvSwI.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-BkIcJpYK.js → ServiceStatusPage-hoYBvGbu.js} +1 -1
- package/dashboard/dist/assets/SessionsPage-BzRB6q-Z.js +3 -0
- package/dashboard/dist/assets/SessionsPage-GV2fuNmd.css +1 -0
- package/dashboard/dist/assets/SettingsPage-DRl2uX-i.js +2 -0
- package/dashboard/dist/assets/SkillsPage-CkqThTZL.js +1 -0
- package/dashboard/dist/assets/{TokenGalaxy-DiXUpXKF.js → TokenGalaxy-eLG-UIZY.js} +1 -1
- package/dashboard/dist/assets/TooltipPopup-bnMJyilQ.js +1 -0
- package/dashboard/dist/assets/TrendMonitor-X7-aGzIv.js +19 -0
- package/dashboard/dist/assets/WidgetsPage-CGznIzrW.js +1 -0
- package/dashboard/dist/assets/{WrappedPage-ClEo-RmR.js → WrappedPage-p31-uUoF.js} +1 -1
- package/dashboard/dist/assets/__vite-browser-external-2g_4s3ot.js +45 -0
- package/dashboard/dist/assets/__vite-browser-external-LpFw4zXh.css +1 -0
- package/dashboard/dist/assets/agent-logos-2TVT3fIE.js +1 -0
- package/dashboard/dist/assets/arrow-left-DL0hAp_7.js +1 -0
- package/dashboard/dist/assets/{arrow-right-CwBz5dwb.js → arrow-right-DFCpnV_9.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-jPmRN562.js → arrow-up-right-DLvfE0Wu.js} +1 -1
- package/dashboard/dist/assets/calendar-days-B0aDoKSG.js +1 -0
- package/dashboard/dist/assets/{check-CKwHc4Hv.js → check-C_cfrxiz.js} +1 -1
- package/dashboard/dist/assets/chevron-down-Ck8ml43e.js +1 -0
- package/dashboard/dist/assets/cloud-checkout-PYnwNfdH.js +1 -0
- package/dashboard/dist/assets/composite-INW-ELWX.js +1 -0
- package/dashboard/dist/assets/download-B7uokeIo.js +1 -0
- package/dashboard/dist/assets/{external-link-B5yXxdPy.js → external-link-CI3crg4K.js} +1 -1
- package/dashboard/dist/assets/{flame-CKjAluj_.js → flame-DCzvFKV1.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-mk49THtv.js → format-tokens-CSTEYK2m.js} +1 -1
- package/dashboard/dist/assets/gift-dEHDFMc6.js +1 -0
- package/dashboard/dist/assets/{host-mode-efKlSYjX.js → host-mode-r2SW9Mdv.js} +1 -1
- package/dashboard/dist/assets/{icons-ZB1ZthjH.js → icons-q-3zvEkh.js} +1 -1
- package/dashboard/dist/assets/{index-BImBG3eS.js → index-BV7qwUw4.js} +1 -1
- package/dashboard/dist/assets/{index-BgdM7kBl.js → index-BbrsgHf4.js} +1 -1
- package/dashboard/dist/assets/{index-DweUMAUD.js → index-CyHYj9XI.js} +1 -1
- package/dashboard/dist/assets/info-BBdY9hV4.js +1 -0
- package/dashboard/dist/assets/{link-2-Dn2soiyd.js → link-2-CLPePfXs.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-CNT630zn.js → loader-circle-ETrjzfmn.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-WPx0bc2K.js → modifiers.esm-DHqnp2ol.js} +1 -1
- package/dashboard/dist/assets/module-BNnaKM__.js +3 -0
- package/dashboard/dist/assets/monitor-smartphone-D1kdzrdb.js +1 -0
- package/dashboard/dist/assets/play-Cxp-ronD.js +1 -0
- package/dashboard/dist/assets/plus-4n94VzDK.js +1 -0
- package/dashboard/dist/assets/provider-display-CRlbeO7t.js +42 -0
- package/dashboard/dist/assets/{react-B7SkZTgg.js → react-DlHjGQFN.js} +1 -1
- package/dashboard/dist/assets/safePolygon-CVZ27a2_.js +1 -0
- package/dashboard/dist/assets/{search-Ol3OZBm4.js → search-BDPr56_h.js} +1 -1
- package/dashboard/dist/assets/{server-DFCbznC7.js → server-Bm7fHvVa.js} +1 -1
- package/dashboard/dist/assets/{shield-check-YcmLwVZ6.js → shield-check-DtT8ACzI.js} +1 -1
- package/dashboard/dist/assets/{skills-api-C-9vK884.js → skills-api-Dc1-2qu6.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-CKC9NuR-.js → sortable.esm-B-qN-Xk2.js} +1 -1
- package/dashboard/dist/assets/store-gHeBU8dQ.js +1 -0
- package/dashboard/dist/assets/{terminal-B3_fCLFs.js → terminal-D4VZbvhg.js} +1 -1
- package/dashboard/dist/assets/{trash-CZGfgbFa.js → trash-BZtLAFQy.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-CW-qkYn7.js → use-community-stats-BdqndrbB.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-DHv7vfFE.js → use-latest-request-guard-DhGg1cDS.js} +1 -1
- package/dashboard/dist/assets/use-limits-display-prefs-D3HOcRFv.js +1 -0
- package/dashboard/dist/assets/{use-native-settings-CWiLqfZh.js → use-native-settings-BniKwA_n.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-Df8pw-WJ.js → use-ordered-list-b09H7EHq.js} +1 -1
- package/dashboard/dist/assets/use-pet-settings-CPZdlq_e.js +2 -0
- package/dashboard/dist/assets/use-reduced-motion-D1gcKJUo.js +1 -0
- package/dashboard/dist/assets/{use-transform-BHwEAfmO.js → use-transform-CIdxjmI8.js} +1 -1
- package/dashboard/dist/assets/use-usage-limits-eJlU65yY.js +1 -0
- package/dashboard/dist/assets/{useCurrency-pwClnCZ5.js → useCurrency-CM22CmAq.js} +1 -1
- package/dashboard/dist/assets/usePositioner-B3l2ulTw.js +1 -0
- package/dashboard/dist/assets/{useTokenFormat-BMvVAe6V.js → useTokenFormat-D7nzgxKw.js} +1 -1
- package/dashboard/dist/assets/zap-Daxct1WV.js +1 -0
- package/dashboard/dist/index.html +14 -12
- package/dashboard/dist/ip-check.html +2 -2
- package/dashboard/dist/leaderboard.html +2 -2
- package/dashboard/dist/llms.txt +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +3 -2
- package/src/commands/init.js +43 -1
- package/src/commands/status.js +27 -0
- package/src/commands/sync.js +54 -4
- package/src/commands/uninstall.js +19 -0
- package/src/lib/claude-config.js +47 -15
- package/src/lib/codex-rollout-parser.js +11 -3
- package/src/lib/command-runner.js +15 -1
- package/src/lib/cursor-config.js +2 -1
- package/src/lib/gemini-config.js +3 -2
- package/src/lib/local-api.js +13 -3
- package/src/lib/notify-command.js +38 -0
- package/src/lib/openclaw-session-plugin.js +47 -14
- package/src/lib/passive-mode.js +12 -0
- package/src/lib/pricing/curated-overrides.json +42 -5
- package/src/lib/pricing/matcher.js +14 -5
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/rollout.js +150 -28
- package/src/lib/session-analytics.js +108 -9
- package/src/lib/usage-limits.js +183 -20
- package/src/lib/zcode-limits.js +218 -18
- package/src/lib/zcode-reset-credits.js +66 -0
- package/dashboard/dist/assets/AchievementBadge-BaqdyZaV.js +0 -1
- package/dashboard/dist/assets/AchievementsPage-B4Ju0guv.js +0 -2
- package/dashboard/dist/assets/BadgeDetailModal-B-XMJAvL.js +0 -1
- package/dashboard/dist/assets/Card-D-5mABVt.js +0 -1
- package/dashboard/dist/assets/CloudCheckoutPage-BELoh56h.js +0 -1
- package/dashboard/dist/assets/CloudPage-CfBruNxe.js +0 -1
- package/dashboard/dist/assets/CloudUsageExport-BoFU7xCT.js +0 -4
- package/dashboard/dist/assets/CommandPalette-BmmKZWn-.js +0 -1
- package/dashboard/dist/assets/CommunityStatsModal-BF77zVhN.js +0 -1
- package/dashboard/dist/assets/Controls-BnTeX7T4.js +0 -1
- package/dashboard/dist/assets/DashboardPage-BWulHa5J.js +0 -1
- package/dashboard/dist/assets/DialogClose-DAyilsH-.js +0 -1
- package/dashboard/dist/assets/DialogDescription-j4XnRy6y.js +0 -1
- package/dashboard/dist/assets/DialogTitle-B1iNGD2S.js +0 -1
- package/dashboard/dist/assets/LandingPage-Dtgq_caz.js +0 -2
- package/dashboard/dist/assets/LeaderboardPage-Di1kEg2O.js +0 -2
- package/dashboard/dist/assets/LeaderboardProBadge-h8FfR0au.js +0 -1
- package/dashboard/dist/assets/LimitsPage-DKojB73_.js +0 -8
- package/dashboard/dist/assets/LoginCard-Dn5Xy4If.js +0 -1
- package/dashboard/dist/assets/LoginModal-C5h-5GOA.js +0 -1
- package/dashboard/dist/assets/LoginPage-BpX8Tgjj.js +0 -1
- package/dashboard/dist/assets/PopoverPopup-CVTiEVHs.js +0 -1
- package/dashboard/dist/assets/Select-CtTceC4T.js +0 -1
- package/dashboard/dist/assets/SelectItemText-C7xi8iGp.js +0 -1
- package/dashboard/dist/assets/SessionsPage-BngTWN7Q.css +0 -1
- package/dashboard/dist/assets/SessionsPage-okHobk_L.js +0 -3
- package/dashboard/dist/assets/SettingsPage-C-cc6wcF.js +0 -2
- package/dashboard/dist/assets/SkillsPage-D2LlKKJN.js +0 -1
- package/dashboard/dist/assets/TrendMonitor-C88S-5aa.js +0 -19
- package/dashboard/dist/assets/WidgetsPage-WsEFPNwp.js +0 -1
- package/dashboard/dist/assets/__vite-browser-external-DFRX9dp-.css +0 -1
- package/dashboard/dist/assets/__vite-browser-external-DUJeOWgd.js +0 -45
- package/dashboard/dist/assets/agent-logos-BM9jlReI.js +0 -1
- package/dashboard/dist/assets/arrow-left-BEM-HVmC.js +0 -1
- package/dashboard/dist/assets/cloud-checkout-nYNHDFoR.js +0 -1
- package/dashboard/dist/assets/composite-B4Z3F65o.js +0 -1
- package/dashboard/dist/assets/download-CJUnX1Bs.js +0 -1
- package/dashboard/dist/assets/info-CyDY7NYM.js +0 -1
- package/dashboard/dist/assets/module-WSx8viXK.js +0 -3
- package/dashboard/dist/assets/monitor-smartphone-C-qC0RAt.js +0 -1
- package/dashboard/dist/assets/plus-Cx82jb7o.js +0 -1
- package/dashboard/dist/assets/provider-display-CodMmiRb.js +0 -42
- package/dashboard/dist/assets/safePolygon-CKpREa4K.js +0 -1
- package/dashboard/dist/assets/store-C9yWYHfg.js +0 -1
- package/dashboard/dist/assets/use-limits-display-prefs-NZ-AAYD5.js +0 -1
- package/dashboard/dist/assets/use-pet-settings-Bg2CDprr.js +0 -2
- package/dashboard/dist/assets/use-reduced-motion-iDZEUyua.js +0 -1
- package/dashboard/dist/assets/use-usage-limits-CSxFFn3_.js +0 -1
- package/dashboard/dist/assets/usePositioner-B0j1orGj.js +0 -1
- package/dashboard/dist/assets/zap-DvX2aYx5.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LeaderboardProfileModal-OUZvO6u-.js","assets/__vite-browser-external-DUJeOWgd.js","assets/__vite-browser-external-DFRX9dp-.css","assets/provider-display-CodMmiRb.js","assets/useCurrency-pwClnCZ5.js","assets/useTokenFormat-BMvVAe6V.js","assets/terminal-B3_fCLFs.js","assets/info-CyDY7NYM.js","assets/LeaderboardProBadge-h8FfR0au.js","assets/safePolygon-CKpREa4K.js","assets/composite-B4Z3F65o.js","assets/store-C9yWYHfg.js","assets/usePositioner-B0j1orGj.js","assets/ProviderIcon-BshO2uER.js","assets/AchievementBadge-BaqdyZaV.js","assets/zap-DvX2aYx5.js","assets/flame-CKjAluj_.js","assets/shield-check-YcmLwVZ6.js","assets/AchievementsSection-CDUUEfIi.js","assets/react-B7SkZTgg.js","assets/format-tokens-mk49THtv.js","assets/use-reduced-motion-iDZEUyua.js","assets/arrow-up-right-jPmRN562.js","assets/link-2-Dn2soiyd.js","assets/check-CKwHc4Hv.js","assets/DialogTitle-B1iNGD2S.js","assets/CommunityStatsModal-BF77zVhN.js","assets/icons-ZB1ZthjH.js","assets/TrendMonitor-C88S-5aa.js","assets/use-latest-request-guard-DHv7vfFE.js","assets/PopoverPopup-CVTiEVHs.js","assets/SelectItemText-C7xi8iGp.js","assets/DialogDescription-j4XnRy6y.js","assets/DialogClose-DAyilsH-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{j as e,a6 as ua,c as s,J as c,r as d,a_ as xa,d as ba,u as pa,a as ha,a$ as ya,a7 as fa,b0 as ka,b1 as wa,b2 as Be,b3 as va,b4 as ie,g as ja,b5 as Na,L as _a,b6 as Sa,i as Ca,b7 as Aa,b8 as La,au as Ea,a9 as Ge,h as Ta,O as Ma}from"./__vite-browser-external-DUJeOWgd.js";import{S as Pa}from"./Select-CtTceC4T.js";import{m as Ka}from"./react-B7SkZTgg.js";import{u as Ra,C as Ia,a as za,b as $e,D as Ba,c as $a,S as Da,h as Ua,s as Oa,K as Fa,P as Ga}from"./sortable.esm-CKC9NuR-.js";import{r as Ha}from"./modifiers.esm-WPx0bc2K.js";import{P as ye}from"./ProviderIcon-BshO2uER.js";import{u as Ya}from"./useCurrency-pwClnCZ5.js";import{u as Q}from"./useTokenFormat-BMvVAe6V.js";import{L as X,a as ne}from"./LeaderboardProBadge-h8FfR0au.js";import{s as Wa,c as Va,A as Ja,t as Za,b as Xa}from"./AchievementBadge-BaqdyZaV.js";import{u as qa}from"./use-ordered-list-Df8pw-WJ.js";import{A as Qa}from"./arrow-right-CwBz5dwb.js";import{u as er}from"./use-community-stats-CW-qkYn7.js";import"./SelectItemText-C7xi8iGp.js";import"./composite-B4Z3F65o.js";import"./usePositioner-B0j1orGj.js";import"./check-CKwHc4Hv.js";import"./safePolygon-CKpREa4K.js";import"./store-C9yWYHfg.js";import"./zap-DvX2aYx5.js";import"./flame-CKjAluj_.js";import"./shield-check-YcmLwVZ6.js";function H(a,{min:r,max:o,fallback:i}){const l=Number(a);if(!Number.isFinite(l))return i;const n=Math.floor(l);return n<r?r:n>o?o:n}function ar(a,r){const o=H(r,{min:0,max:1e6,fallback:0}),i=H(a,{min:1,max:Math.max(1,o||1),fallback:1});if(o<=1)return[1];const l=new Set([1,o,i-2,i-1,i,i+1,i+2]),n=Array.from(l).filter(u=>Number.isInteger(u)&&u>=1&&u<=o).sort((u,h)=>u-h),m=[];let b=null;for(const u of n)b!=null&&u-b>1&&m.push(null),m.push(u),b=u;return m}function rr({page:a,totalPages:r}){const o=typeof r=="number"&&Number.isFinite(r)&&r>=0,i=o?H(r,{min:0,max:1e6,fallback:0}):null,l=H(a,{min:1,max:o?Math.max(1,i||1):1e6,fallback:1}),n=l>1,m=o?l<i:!0;return{canPrev:n,canNext:m,safePage:l,safeTotal:i}}function tr({entries:a,me:r,meLabel:o}){const i=Array.isArray(a)?a:[],l=r&&typeof r.rank=="number"?r.rank:null;return!l||i.some(m=>!!m?.is_me)?i:[{rank:l,is_me:!0,is_pinned:!0,user_id:r?.user_id??null,display_name:o,avatar_url:r?.avatar_url??null,pro_active:r?.pro_active===!0,github_url:null,is_public:!1,gpt_tokens:r?.gpt_tokens??"0",claude_tokens:r?.claude_tokens??"0",gemini_tokens:r?.gemini_tokens??"0",cursor_tokens:r?.cursor_tokens??"0",opencode_tokens:r?.opencode_tokens??"0",openclaw_tokens:r?.openclaw_tokens??"0",hermes_tokens:r?.hermes_tokens??"0",kiro_tokens:r?.kiro_tokens??"0",copilot_tokens:r?.copilot_tokens??"0",kimi_tokens:r?.kimi_tokens??"0",other_tokens:r?.other_tokens??"0",total_tokens:r?.total_tokens??"0",estimated_cost_usd:r?.estimated_cost_usd??null,badges:Array.isArray(r?.badges)?r.badges:[]},...i]}function or(a,r){const o=Number(a),i=Number(r);return!Number.isFinite(o)||o<1||!Number.isFinite(i)||i<1?null:Math.ceil(o/i)}const sr=new Set(["/brand-logos/cursor.svg","/brand-logos/kimi.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg","/brand-logos/hermes.svg"]);function ir({iconSrc:a,label:r}){return e.jsxs("span",{className:"inline-flex items-center gap-3",children:[a?e.jsx("img",{src:a,alt:"",width:16,height:16,className:`h-4 w-4 shrink-0 object-contain opacity-90 ${sr.has(a)?"dark:invert":""}`}):null,e.jsx("span",{className:"whitespace-nowrap",children:r})]})}const le=ua.memo(function({badges:r,max:o=3,className:i=""}){const l=Wa((r||[]).filter(n=>n&&Va.has(n.id)&&(n.tier||0)>=1)).slice(0,o);return l.length===0?null:e.jsx("span",{className:`pointer-events-none inline-flex shrink-0 items-center ${i}`,children:l.map((n,m)=>e.jsx("span",{title:s("achievements.mini.tooltip",{name:s(Xa(n.id,"name")),tier:s(`achievements.tier.${Za(n.tier)}`)}),style:{zIndex:l.length-m},className:`pointer-events-auto relative inline-flex ${m>0?"-ml-1.5":""}`,children:e.jsx(Ja,{badgeId:n.id,tier:n.tier,size:"xs",className:"rounded-full ring-[1.5px] ring-white dark:ring-oai-gray-950"})},n.id))})}),q=[{key:"gpt_tokens",copyKey:"leaderboard.column.codex",icon:"/brand-logos/codex.svg"},{key:"claude_tokens",copyKey:"leaderboard.column.claude",icon:"/brand-logos/claude-code.svg"},{key:"gemini_tokens",copyKey:"leaderboard.column.gemini",icon:"/brand-logos/gemini.svg"},{key:"cursor_tokens",copyKey:"leaderboard.column.cursor",icon:"/brand-logos/cursor.svg"},{key:"kiro_tokens",copyKey:"leaderboard.column.kiro",icon:"/brand-logos/kiro.svg"},{key:"copilot_tokens",copyKey:"leaderboard.column.copilot",icon:"/brand-logos/copilot.svg"},{key:"kimi_tokens",copyKey:"leaderboard.column.kimi",icon:"/brand-logos/kimi.svg"},{key:"opencode_tokens",copyKey:"leaderboard.column.opencode",icon:"/brand-logos/opencode.svg"},{key:"openclaw_tokens",copyKey:"leaderboard.column.openclaw",icon:"/brand-logos/openclaw.svg"},{key:"hermes_tokens",copyKey:"leaderboard.column.hermes",icon:"/brand-logos/hermes.svg"},{key:"other_tokens",copyKey:"leaderboard.column.supplemental",icon:null}],He="sticky left-0 z-40 w-14 min-w-14 max-w-14 sm:w-[72px] sm:min-w-[72px] sm:max-w-[72px] bg-white dark:bg-oai-gray-950 px-2.5 sm:px-4 py-4 align-middle",Ye="sticky left-[55px] sm:left-[71px] z-40 min-w-[96px] sm:min-w-[200px] max-w-[170px] sm:max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 px-3 sm:px-4 py-4 align-middle";function de(a){return c("sticky left-0 z-30 w-14 min-w-14 max-w-14 sm:w-[72px] sm:min-w-[72px] sm:max-w-[72px] px-2.5 sm:px-4 py-4 whitespace-nowrap",a?"bg-oai-gray-50 dark:bg-oai-gray-900":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900")}function ce(a){return c("sticky left-[55px] sm:left-[71px] z-30 hover:z-50 min-w-[96px] sm:min-w-[200px] max-w-[170px] sm:max-w-[min(260px,45vw)] border-l border-r border-oai-gray-200 dark:border-oai-gray-800 px-3 sm:px-4 py-4 min-w-0",a?"bg-oai-gray-50 dark:bg-oai-gray-900":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900")}function f({className:a}){return e.jsx("div",{className:c("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",a)})}function nr({index:a}){const r=a<3?"w-24":a<8?"w-20":"w-16",o=a<3?"w-16":"w-12",i=a<5?"w-14":"w-10";return e.jsxs("tr",{className:"group",children:[e.jsx("td",{className:c(de(!1),"!group-hover:bg-transparent"),children:e.jsx(f,{className:"h-4 w-6"})}),e.jsx("td",{className:c(ce(!1),"!group-hover:bg-transparent"),children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(f,{className:"h-8 w-8 min-w-8 rounded-full"}),e.jsx(f,{className:c("h-4",r)})]})}),e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(f,{className:c("h-4",o)})}),e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(f,{className:"h-4 w-12"})}),q.map(l=>e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(f,{className:c("h-4",i)})},l.key))]})}function lr({index:a}){const r=a<3?"w-24":a<8?"w-20":"w-16",o=a%3===0?3:a%3===1?2:1;return e.jsxs("div",{className:"mx-0 my-1 rounded-xl bg-white dark:bg-oai-gray-950 border border-oai-gray-100 dark:border-oai-gray-800/60 px-3.5 py-3 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(f,{className:"h-4 w-3 shrink-0 rounded"}),e.jsx(f,{className:"h-9 w-9 shrink-0 rounded-full"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(f,{className:c("h-4",r)}),e.jsx(f,{className:"mt-2 h-3.5 w-20"})]}),e.jsxs("div",{className:"shrink-0 text-right",children:[e.jsx(f,{className:"ml-auto h-3 w-8"}),e.jsx(f,{className:"mt-1.5 ml-auto h-4 w-14"})]})]}),e.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-2 border-t border-oai-gray-100 pt-2.5 dark:border-oai-gray-800/70",children:Array.from({length:o},(i,l)=>e.jsx(f,{className:"h-5 w-12 rounded-full"},l))})]})}function dr({rows:a=10}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden w-full overflow-x-auto sm:block",children:e.jsxs("table",{className:"min-w-max w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:c(He,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(f,{className:"h-3.5 w-6"})}),e.jsx("th",{className:c(Ye,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(f,{className:"h-3.5 w-12"})}),e.jsx("th",{className:"px-4 py-4",children:e.jsx(f,{className:"h-3.5 w-10"})}),e.jsx("th",{className:"px-4 py-4",children:e.jsx(f,{className:"h-3.5 w-14"})}),q.map(r=>e.jsx("th",{className:"px-4 py-4",children:e.jsx(f,{className:"h-3.5 w-12"})},r.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:a},(r,o)=>e.jsx(nr,{index:o},o))})]})}),e.jsx("div",{className:"flex flex-col py-1 sm:hidden",children:Array.from({length:a},(r,o)=>e.jsx(lr,{index:o},o))})]})}function cr({id:a,thClassName:r,children:o}){const{attributes:i,listeners:l,setNodeRef:n,transform:m,transition:b,isDragging:u}=Ra({id:a}),h=Ia.Transform.toString(m)||"";d.useLayoutEffect(()=>{const y=document.querySelectorAll(`td[data-column-key="${a}"]`),p="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return y.forEach(x=>{x.style.transform=h,x.style.transition=b||"",x.style.zIndex=u?"20":"",x.style.position=h?"relative":"",x.style.boxShadow=u?p:""}),()=>{y.forEach(x=>{x.style.transform="",x.style.transition="",x.style.zIndex="",x.style.position="",x.style.boxShadow=""})}},[a,h,b,u]);const v={transform:h,transition:b,position:h?"relative":void 0,zIndex:u?20:void 0,boxShadow:u?"0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)":void 0};return e.jsx("th",{ref:n,style:v,className:c(r,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...i,...l,children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("span",{"aria-hidden":"true",className:c("-mr-1 inline-flex h-4 w-3 shrink-0 items-center justify-center text-oai-gray-400 dark:text-oai-gray-600","opacity-0 transition-opacity duration-150 group-hover/col:opacity-100",u&&"opacity-100"),children:e.jsxs("svg",{viewBox:"0 0 8 14",width:"8",height:"14",fill:"currentColor","aria-hidden":"true",children:[e.jsx("circle",{cx:"2",cy:"2",r:"1"}),e.jsx("circle",{cx:"6",cy:"2",r:"1"}),e.jsx("circle",{cx:"2",cy:"7",r:"1"}),e.jsx("circle",{cx:"6",cy:"7",r:"1"}),e.jsx("circle",{cx:"2",cy:"12",r:"1"}),e.jsx("circle",{cx:"6",cy:"12",r:"1"})]})}),o]})})}const mr="tokentracker.leaderboard.columnOrder.v1";function gr(a){return qa(mr,a)}const ur=50;function xr(a,r){const o=Number(a),i=Number(r);return!Number.isFinite(o)||o<1||!Number.isFinite(i)||i<1?null:Math.min(100,Math.max(1,Math.ceil(o/i*100)))}function We(a){return typeof a=="string"?a.trim():""}function br(a){const r=We(a);return r?r.toLowerCase()==="anonymous":!0}function pr({me:a,totalEntries:r,meLabel:o,onOpenProfile:i,onJumpToMe:l,canJump:n,className:m}){const b=a&&typeof a.rank=="number"?a.rank:null;if(!b)return null;const u=Number(r)||0,h=xr(b,u),v=We(a?.display_name),y=!v||br(v)?o||"You":v,p=a?.user_id||y,x=i||(n?l:null),E=typeof x=="function",C=E?"button":"div",ee=E?{type:"button",onClick:x,"aria-label":s(i?"leaderboard.summary.view_profile":"leaderboard.summary.jump_to_me")}:{};return e.jsxs(C,{...ee,className:c("group inline-flex h-9 items-center gap-2.5 rounded-full border pl-1 pr-3.5 transition-all duration-300 select-none",E?"border-oai-gray-200 hover:border-oai-gray-400 dark:border-oai-gray-800 dark:hover:border-oai-gray-500/80 bg-oai-gray-50/50 dark:bg-white/[0.02] backdrop-blur-md hover:bg-oai-gray-100/40 dark:hover:bg-oai-gray-900/20 active:scale-[0.97] dark:ring-1 dark:ring-white/[0.04] dark:hover:ring-white/[0.08]":"border-oai-gray-100 dark:border-oai-gray-800/60 bg-oai-gray-50/20 dark:bg-white/[0.01] backdrop-blur-sm dark:ring-1 dark:ring-white/[0.02]",m),children:[e.jsx(X,{size:"sm",avatarUrl:a?.avatar_url,displayName:y,seed:p,proActive:a?.pro_active===!0}),e.jsx("span",{className:"hidden sm:inline max-w-[120px] truncate text-xs font-semibold text-oai-black dark:text-oai-gray-200 group-hover:text-oai-gray-800 dark:group-hover:text-oai-gray-100 transition-colors",children:y}),a?.pro_active===!0&&e.jsx("span",{className:"leaderboard-pro-badge",role:"img","aria-label":s("leaderboard.pro.badge_aria"),"aria-description":s("leaderboard.pro.tooltip"),children:s("leaderboard.pro.badge")}),e.jsxs("span",{className:"text-xs font-bold tabular-nums text-oai-gray-800 dark:text-white",children:["#",b.toLocaleString()]}),h!=null&&h<=ur&&e.jsx("span",{className:"hidden sm:inline-flex items-center rounded-full px-2 py-0.5 text-[9px] font-extrabold tracking-wider tabular-nums uppercase transition-colors duration-300 ring-1 bg-oai-gray-100 text-oai-gray-700 dark:bg-oai-gray-800 dark:text-oai-gray-300 ring-oai-gray-300/30 dark:ring-oai-gray-600/30",children:s("leaderboard.summary.percentile",{p:String(h)})}),E?e.jsx(Qa,{"aria-hidden":!0,className:"size-3 text-oai-gray-400 transition-all duration-300 group-hover:text-oai-gray-600 dark:text-oai-gray-500 group-hover:translate-x-0.5 group-hover:scale-110"}):e.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0 items-center justify-center ml-1",title:"You are here",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-oai-gray-400 opacity-75 duration-1000"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-oai-gray-400 dark:bg-oai-gray-500"})]})]})}const hr=d.lazy(()=>Ge(()=>import("./LeaderboardProfileModal-OUZvO6u-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])).then(a=>({default:a.LeaderboardProfileModal}))),yr=d.lazy(()=>Ge(()=>import("./CommunityStatsModal-BF77zVhN.js"),__vite__mapDeps([26,1,2,19,27,5,13,28,4,29,6,30,11,10,31,12,9,21,14,15,16,17,25,32,33])).then(a=>({default:a.CommunityStatsModal}))),me=[10,20,50,100],ge=20,Ve="tokentracker:leaderboard:pageSize";function fr(){if(typeof window>"u")return ge;try{const a=window.localStorage.getItem(Ve),r=Number(a);if(me.includes(r))return r}catch{}return ge}function ue(a,r,o){const i=Number(a);if(!Number.isFinite(i)||i<=0)return"-";const l=Sa(r),n=r===Ma?i:i*o;return n>=1e3?`${l}${Math.round(n).toLocaleString()}`:n>=10?`${l}${Math.round(n)}`:`${l}${n.toFixed(2)}`}function kr(a){if(typeof a!="string"||!a.trim())return null;const r=new Date(a);if(!Number.isFinite(r.getTime()))return null;const o=Ta();return{dateTime:r.toISOString(),display:new Intl.DateTimeFormat(o,{dateStyle:"medium",timeStyle:"short"}).format(r),exact:new Intl.DateTimeFormat(o,{dateStyle:"full",timeStyle:"long"}).format(r)}}function xe({value:a}){const{formatTokens:r,formatTokensTooltip:o}=Q();return e.jsx("span",{title:o(a),children:r(a)})}function wr({communityStats:a,onClick:r}){const{formatTokens:o,formatTokensTooltip:i}=Q();return a.status!=="ready"?null:e.jsxs("button",{type:"button",onClick:r,className:"inline-flex min-w-0 max-w-full flex-1 items-center gap-1.5 whitespace-nowrap rounded-xl border border-oai-gray-200 bg-oai-gray-50/50 px-2.5 py-2 text-xs text-oai-gray-500 backdrop-blur-md transition-all duration-300 hover:border-oai-gray-400 hover:bg-oai-gray-100/40 active:scale-[0.97] dark:border-oai-gray-800 dark:bg-white/[0.02] dark:text-oai-gray-400 dark:hover:border-oai-gray-500/80 dark:hover:bg-oai-gray-900/20 sm:h-9 sm:flex-none sm:gap-2.5 sm:rounded-full sm:px-3.5 sm:py-0",title:s("leaderboard.community.view_stats"),children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0","aria-hidden":"true",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-oai-gray-400/80 opacity-75 duration-1000"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-oai-gray-400 dark:bg-oai-gray-500"})]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-semibold text-oai-black dark:text-white tabular-nums",children:e.jsx("span",{title:i(a.tokenFloor),children:o(a.tokenFloor)})}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:s("leaderboard.community.tokens_chip")})]}),e.jsx("span",{className:"text-oai-gray-200 dark:text-oai-gray-800 select-none",children:"·"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"font-semibold text-oai-black dark:text-white tabular-nums",children:[e.jsx("span",{className:"sm:hidden",children:Ca(a.totalEntries)}),e.jsx("span",{className:"hidden sm:inline",children:(Number(a.totalEntries)||0).toLocaleString("en-US")})]}),e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:s("leaderboard.community.devs_chip")})]})]})}function De({entry:a,isMe:r,orderedColumns:o}){const{formatTokens:i,formatTokensTooltip:l}=Q(),n=r?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",m=r?"bg-oai-gray-50 dark:bg-oai-gray-900":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900";return o.map(b=>e.jsx("td",{"data-column-key":b.key,title:l(a?.[b.key]),className:c("hidden sm:table-cell px-3 sm:px-4 py-4 whitespace-nowrap text-right tabular-nums",n,m),children:i(a?.[b.key])},b.key))}function vr(a){return a?.key==="gpt_tokens"?"CODEX":a?.key==="claude_tokens"?"CLAUDE":(a?.icon?.split("/").pop()||"").replace(/\.svg$/i,"").toUpperCase()||"OTHER"}const jr={1:"ring-2 ring-amber-400 dark:ring-amber-500/80 shadow-[0_0_8px_rgba(245,158,11,0.25)]",2:"ring-2 ring-slate-350 dark:ring-slate-450 shadow-[0_0_8px_rgba(148,163,184,0.2)]",3:"ring-2 ring-orange-400 dark:ring-orange-500/70 shadow-[0_0_8px_rgba(249,115,22,0.25)]"};function Nr({rank:a,placeholder:r}){return a===1?e.jsx("span",{className:"text-base font-extrabold italic text-amber-500 dark:text-amber-400 tracking-tighter",children:"1"}):a===2?e.jsx("span",{className:"text-base font-extrabold italic text-slate-400 dark:text-slate-350 tracking-tighter",children:"2"}):a===3?e.jsx("span",{className:"text-base font-extrabold italic text-orange-500 dark:text-orange-400 tracking-tighter",children:"3"}):e.jsx("span",{className:"text-[13px] font-bold tabular-nums text-oai-gray-400 dark:text-oai-gray-500",children:a==null?r:`#${a}`})}function _r({githubUrl:a}){return e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),"aria-label":"GitHub profile",className:"absolute bottom-0 right-0 translate-x-1 translate-y-1 flex h-4.5 w-4.5 items-center justify-center rounded-full bg-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-gray-100 shadow border border-oai-gray-100 dark:border-oai-gray-800 transition-transform active:scale-110",children:e.jsx(ye,{provider:"GITHUB",size:11})})}function Sr({entry:a,orderedColumns:r}){const{formatTokens:o,formatTokensTooltip:i}=Q(),l=r.filter(n=>{const m=Number(a?.[n.key]);return Number.isFinite(m)&&m>0});return l.length===0?null:e.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-x-1.5 gap-y-2 border-t border-oai-gray-100/70 pt-3 dark:border-oai-gray-800/60",children:l.map(n=>{const m=s(n.copyKey);return e.jsxs("span",{title:m,"aria-label":`${m}: ${i(a?.[n.key])}`,className:"inline-flex shrink-0 items-center gap-1 rounded-full bg-oai-gray-50/80 dark:bg-oai-gray-900/60 px-2 py-0.5 border border-oai-gray-100/80 dark:border-oai-gray-800/40 text-[10px] font-medium text-oai-gray-600 dark:text-oai-gray-300 transition-colors",children:[e.jsx(ye,{provider:vr(n),size:12,className:"shrink-0 opacity-90"}),e.jsx("span",{className:"tabular-nums",children:o(a?.[n.key])})]},n.key)})})}function Cr({entry:a,entryIdx:r,name:o,meLabel:i,currency:l,rate:n,orderedColumns:m,placeholder:b,onOpenProfile:u}){if(a?.is_ellipsis)return e.jsx("div",{"aria-hidden":"true",className:"px-4 py-2 text-center text-xs tracking-[0.4em] text-oai-gray-400 dark:text-oai-gray-600",children:"···"},`mobile-ellipsis-${r}`);const h=!!a?.is_me,v=!h&&pe(a?.display_name),y=typeof a?.user_id=="string"?a.user_id:null,p=!!y,x=h?i:o,E=C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),u(y))};return e.jsxs("div",{role:p?"button":void 0,tabIndex:p?0:void 0,onClick:p?()=>u(y):void 0,onKeyDown:p?E:void 0,"aria-label":p?s("leaderboard.profile_modal.row_aria",{name:x}):void 0,className:c("relative mx-0 my-1 rounded-xl px-3.5 py-3 transition-all duration-200 border shadow-sm select-none",h?"bg-oai-gray-50 dark:bg-oai-gray-900 border-oai-gray-300/60 dark:border-oai-gray-500/25":v?"bg-white/90 dark:bg-oai-gray-950/90 border-oai-gray-100/70 dark:border-oai-gray-800/40":"bg-white dark:bg-oai-gray-950 border-oai-gray-100 dark:border-oai-gray-800/60",p&&"cursor-pointer hover:border-oai-gray-200 dark:hover:border-oai-gray-700/80 active:scale-[0.985] active:bg-oai-gray-50/60 dark:active:bg-oai-gray-900/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-oai-gray-500/60"),children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"flex w-5 shrink-0 items-center justify-center",children:e.jsx(Nr,{rank:a?.rank,placeholder:b})}),e.jsxs("span",{className:"relative inline-flex shrink-0",children:[e.jsx("span",{className:c("inline-flex rounded-full p-0.5 transition-all duration-300",a?.pro_active!==!0&&(jr[a?.rank]||"ring-1 ring-oai-gray-200 dark:ring-oai-gray-800/80"),v&&"opacity-60 grayscale-[15%]"),children:e.jsx(X,{size:"md",avatarUrl:a?.avatar_url,displayName:x,seed:he(a,x),proActive:a?.pro_active===!0})}),a?.github_url&&e.jsx(_r,{githubUrl:a.github_url})]}),e.jsxs("div",{className:"min-w-0 flex-1 pl-1",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:c("min-w-0 truncate text-sm tracking-tight",h?"font-semibold text-oai-black dark:text-oai-white":v?"font-normal text-oai-gray-400 dark:text-oai-gray-500":"font-medium text-oai-gray-800 dark:text-oai-gray-200"),children:x}),e.jsx(ne,{proActive:a?.pro_active===!0}),e.jsx(le,{badges:a?.badges,className:"shrink-0 scale-95"})]}),e.jsxs("div",{className:"mt-1 text-[11px] text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("span",{children:s("leaderboard.column.est_cost")}),e.jsx("span",{className:c("ml-1 tabular-nums font-medium",v?"text-oai-gray-400/80 dark:text-oai-gray-500/80":"text-oai-gray-600 dark:text-oai-gray-300"),children:ue(a?.estimated_cost_usd,l,n)})]})]}),e.jsxs("div",{className:"shrink-0 text-right",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.08em] text-oai-gray-400 dark:text-oai-gray-500",children:s("leaderboard.column.total")}),e.jsx("div",{className:c("mt-0.5 text-sm font-semibold tabular-nums tracking-tight",h?"text-oai-black dark:text-oai-white":v?"text-oai-gray-400 dark:text-oai-gray-500":"text-oai-gray-800 dark:text-oai-gray-200"),children:e.jsx(xe,{value:a?.total_tokens})})]})]}),e.jsx(Sr,{entry:a,orderedColumns:m})]},`mobile-row-${a?.rank}-${x}`)}const Ar={1:{text:"text-amber-600 dark:text-amber-400",badge:"bg-amber-50 dark:bg-amber-900/20"},2:{text:"text-gray-500 dark:text-gray-300",badge:"bg-gray-50 dark:bg-gray-800/40"},3:{text:"text-orange-700 dark:text-orange-400",badge:"bg-orange-50 dark:bg-orange-900/20"}};function Ue({rank:a,placeholder:r}){const o=Ar[a];return o?e.jsx("span",{className:c("inline-flex items-center justify-center h-7 w-7 rounded-full text-xs font-bold",o.text,o.badge),children:a}):e.jsx("span",{className:"inline-flex items-center justify-center h-7 w-7 text-sm",children:a??r})}function Oe(a){if(typeof a!="string")return null;const r=a.trim().toLowerCase();return r==="week"||r==="month"||r==="total"?r:null}function Lr(a){if(!a)return s("shared.error.prefix",{error:s("leaderboard.error.unknown")});const r=a?.message||String(a),o=String(r||"").trim()||s("leaderboard.error.unknown");return s("shared.error.prefix",{error:o})}function be(a){return typeof a!="string"?"":a.trim()}function pe(a){const r=be(a);return r?r.toLowerCase()==="anonymous":!0}function he(a,r){const o=typeof a?.user_id=="string"?a.user_id.trim():"";return o||`${a?.rank??""}:${r}`}function Fe({githubUrl:a}){return e.jsxs("span",{className:"absolute left-1/2 top-full -translate-x-1/2 -translate-y-1/2 inline-flex group/gh",children:[e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),"aria-label":s("leaderboard.github.aria"),className:"flex h-4 w-4 items-center justify-center rounded-full bg-white dark:bg-oai-gray-950 text-oai-black dark:text-oai-gray-100 transition-transform hover:scale-110",children:e.jsx(ye,{provider:"GITHUB",size:14})}),e.jsxs("span",{role:"tooltip",className:"invisible opacity-0 group-hover/gh:visible group-hover/gh:opacity-100 absolute left-0 bottom-full mb-2 whitespace-nowrap rounded-md bg-oai-black dark:bg-oai-gray-700 px-2.5 py-1.5 text-[11px] leading-relaxed text-white shadow-lg transition-opacity duration-150 z-50 before:content-[''] before:absolute before:inset-x-0 before:top-full before:h-2.5",children:[e.jsx("span",{className:"block",children:s("leaderboard.github.tooltipAction")}),e.jsxs("span",{className:"block text-oai-gray-300 dark:text-oai-gray-400",children:[s("leaderboard.github.tooltipPrefix")," ",e.jsx(_a,{to:"/settings",onClick:r=>r.stopPropagation(),className:"text-white underline underline-offset-2 decoration-oai-gray-400 hover:text-oai-brand-300 hover:decoration-oai-brand-300",children:s("leaderboard.github.tooltipSettingsLink")})," ",s("leaderboard.github.tooltipSuffix")]})]})]})}function et({auth:a,signedIn:r,sessionSoftExpired:o}){const i=xa(),l=ba(),{openLoginModal:n}=pa(),{signedIn:m,loading:b,user:u}=ha(),{currency:h,rate:v}=Ya(),y=d.useMemo(()=>ya(),[]),p=fa(),x=r&&!o,E=d.useMemo(()=>x&&(typeof a=="function"||typeof a=="string"||a&&typeof a=="object")?a:null,[a,x]),C=x?E:null,ee=x&&ka(C),ae=s("shared.placeholder.short"),Je=d.useMemo(()=>q.map(t=>t.key),[]),{order:re,reorder:fe}=gr(Je),ke=d.useMemo(()=>{const t=new Map;for(const g of q)t.set(g.key,g);return t},[]),B=d.useMemo(()=>re.map(t=>ke.get(t)).filter(Boolean),[re,ke]),Ze=za($e(Ga,{activationConstraint:{distance:6}}),$e(Fa,{coordinateGetter:Oa})),Xe=d.useCallback(t=>{const{active:g,over:w}=t;!w||g.id===w.id||fe(String(g.id),String(w.id))},[fe]),[te,M]=d.useState(1),[_,qe]=d.useState(fr),[we,ve]=d.useState(null),[Qe,je]=d.useState(!1),Y=d.useCallback(t=>{typeof t=="string"&&t.trim()&&ve(t.trim())},[]),ea=d.useCallback(()=>ve(null),[]),aa=d.useCallback(t=>{const g=me.includes(t)?t:ge;qe(g),M(1);try{window.localStorage.setItem(Ve,String(g))}catch{}},[]),[Ne,ra]=d.useState(0),[ta,oa]=d.useState(()=>wa()),[_e,Se]=d.useState(!1);d.useEffect(()=>{if(typeof window>"u")return;const t=()=>{ra(g=>g+1)};return window.addEventListener(Be,t),()=>{window.removeEventListener(Be,t)}},[]);const N=d.useMemo(()=>{const t=new URLSearchParams(i?.search||"");return Oe(t.get("period"))||"total"},[i?.search]),sa=t=>{const g=Oe(t);if(!g||g===N)return;const w=new URLSearchParams(i?.search||"");w.set("period",g),M(1),l(`${i?.pathname||"/leaderboard"}?${w.toString()}`,{replace:!0})};d.useEffect(()=>{b||p||m||n()},[m,b,p,n]),d.useEffect(()=>{M(1)},[N]);const W=d.useMemo(()=>(H(te,{min:1,max:1e6,fallback:1})-1)*_,[te,_]),R=d.useMemo(()=>p?"mock":b?"unavailable":m?"cloud":r?"local":y?"public":"unavailable",[b,m,y,p,r]),k=d.useMemo(()=>va({accessMode:R,baseUrl:y,mockEnabled:p,userId:u?.id||null,period:N,pageSize:_,offset:W}),[u?.id,R,y,W,p,_,N]),[$,D]=d.useState(()=>{const t=ie(k);return t?{loading:!1,error:null,data:t.data,contextKey:k}:{loading:!1,error:null,data:null,contextKey:null}});d.useEffect(()=>{if(!y&&!p||!p&&R==="unavailable"){D({loading:!1,error:null,data:null,contextKey:null});return}const t=ie(k);let g=!0;return D(t?{loading:!1,error:null,data:t.data,contextKey:k}:{loading:!0,error:null,data:null,contextKey:null}),(async()=>{const w=await ja({userId:u?.id||null,period:N,limit:_,offset:W});g&&(Na(w,{activeContextKey:k,contextKey:k,source:Ne>0?"manual-refresh":"page-load"}),D({loading:!1,error:null,data:w,contextKey:k}))})().catch(w=>{if(!g)return;const T=Lr(w);D(F=>F.contextKey===k?{...F,loading:!1,error:T}:{loading:!1,error:T,data:null,contextKey:k})}),()=>{g=!1}},[y,R,u?.id,k,W,Ne,p,N,_]);const oe=d.useMemo(()=>$.contextKey===k?null:ie(k),[k,$.contextKey]),j=d.useMemo(()=>$.contextKey===k?$:oe?{loading:!1,error:null,data:oe.data,contextKey:k}:{loading:!!(y||p)&&R!=="unavailable",error:null,data:null,contextKey:k},[R,y,k,$,p,oe]),S=j.data,U=S?.total_pages??null,ia=S?.total_entries??0,P=S?.page??te,na=d.useMemo(()=>ar(P,U),[P,U]),Ce=S?.from||null,Ae=S?.to||null,la=S?.generated_at||null,V=kr(la),Le=er(),K=S?.me||null,I=s("leaderboard.me_label"),Ee=s("leaderboard.anon_label"),Te=s("leaderboard.period.week"),Me=s("leaderboard.period.month"),Pe=s("leaderboard.period.total"),Ke=N==="month"?Me:N==="total"?Pe:Te,J=d.useMemo(()=>{const t=Array.isArray(S?.entries)?S.entries:[];return tr({entries:t,me:K,meLabel:I})},[S?.entries,K,I]),z=d.useMemo(()=>or(K?.rank,_),[K?.rank,_]),da=z!=null&&z===P,ca=d.useCallback(()=>{z!=null&&M(z)},[z]),ma=async()=>{Se(!0);try{Aa(!0),oa(!0),await La(()=>Ea(C))}catch(t){console.warn("[tokentracker] sync:",t)}finally{Se(!1)}},{canPrev:Re,canNext:Ie}=rr({page:P,totalPages:U}),Z=Array.isArray(J)&&J.length!==0;let O=null;j.loading&&!Z?O=e.jsx(dr,{rows:_}):j.error&&!Z?O=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:j.error})}):Z?O=e.jsxs(Ba,{sensors:Ze,collisionDetection:$a,modifiers:[Ha],onDragEnd:Xe,children:[e.jsx("div",{className:"hidden w-full overflow-x-auto sm:block",children:e.jsxs("table",{className:"min-w-full w-full text-left text-sm sm:min-w-max",children:[e.jsx("thead",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800",children:e.jsxs("tr",{children:[e.jsx("th",{className:c(He,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:s("leaderboard.column.rank")}),e.jsx("th",{className:c(Ye,"text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500"),children:s("leaderboard.column.user")}),e.jsx("th",{className:"px-3 sm:px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",children:s("leaderboard.column.total")}),e.jsx("th",{className:"hidden sm:table-cell px-3 sm:px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap text-right align-middle",title:"Based on estimated API pricing, not actual billing",children:s("leaderboard.column.est_cost")}),e.jsx(Da,{items:re,strategy:Ua,children:B.map(t=>e.jsx(cr,{id:t.key,thClassName:"hidden sm:table-cell px-3 sm:px-4 py-4 text-[11px] font-semibold uppercase tracking-wider text-oai-gray-400 dark:text-oai-gray-500 whitespace-nowrap align-middle",children:e.jsx(ir,{iconSrc:t.icon,label:s(t.copyKey)})},t.key))})]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:J.map((t,g)=>{if(t?.is_ellipsis){const L=4+B.length;return e.jsx("tr",{"aria-hidden":"true",children:e.jsx("td",{colSpan:L,className:"px-4 py-2 text-center text-oai-gray-400 dark:text-oai-gray-600 bg-white dark:bg-oai-gray-950 select-none tracking-[0.4em] text-xs",children:"···"})},`ellipsis-${g}`)}const w=!!t?.is_me,T=typeof t?.user_id=="string"?t.user_id:null,F=be(t?.display_name),ga=pe(F)?Ee:F,A=w?I:ga,G=!!T,ze=G?{role:"button",tabIndex:0,onClick:G?()=>Y(T):void 0,onKeyDown:G?L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),Y(T))}:void 0,"aria-label":s("leaderboard.profile_modal.row_aria",{name:A})}:{};if(w){const L=!!t?.is_pinned;return e.jsxs("tr",{...ze,className:c("bg-oai-gray-50 dark:bg-oai-gray-900 transition-colors",L?"border-t border-b border-oai-gray-300/40 dark:border-oai-gray-500/20":"border-y border-oai-gray-300/40 dark:border-oai-gray-500/30",G&&"cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-gray-500/60"),children:[e.jsx("td",{className:c(de(!0),"font-semibold text-oai-gray-700 dark:text-oai-gray-300",L&&"before:absolute before:left-0 before:top-[15%] before:h-[70%] before:w-[3px] before:rounded-r before:bg-oai-gray-500 dark:before:bg-oai-gray-400"),children:e.jsx(Ue,{rank:t?.rank,placeholder:ae})}),e.jsx("td",{className:ce(!0),children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsxs("span",{className:c("relative inline-flex shrink-0 rounded-full p-[2px]",t?.github_url&&t?.pro_active!==!0&&"gh-avatar-frame"),children:[e.jsx("span",{className:c("inline-flex rounded-full p-px",t?.github_url&&t?.pro_active!==!0&&"bg-white dark:bg-oai-gray-950"),children:e.jsx(X,{avatarUrl:t?.avatar_url,displayName:A,seed:he(t,A),proActive:t?.pro_active===!0})}),t?.github_url&&e.jsx(Fe,{githubUrl:t.github_url})]}),e.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:A}),e.jsx(ne,{proActive:t?.pro_active===!0}),e.jsx(le,{badges:t?.badges,className:"hidden sm:inline-flex"})]})}),e.jsx("td",{className:"px-3 sm:px-4 py-4 font-medium text-oai-black dark:text-oai-white whitespace-nowrap text-right tabular-nums bg-oai-gray-50 dark:bg-oai-gray-900",children:e.jsx(xe,{value:t?.total_tokens})}),e.jsx("td",{className:"hidden sm:table-cell px-3 sm:px-4 py-4 font-medium text-oai-gray-700 dark:text-oai-gray-300 whitespace-nowrap text-right tabular-nums bg-oai-gray-50 dark:bg-oai-gray-900",title:"Based on estimated API pricing, not actual billing",children:ue(t?.estimated_cost_usd,h,v)}),e.jsx(De,{entry:t,isMe:!0,orderedColumns:B})]},`row-${t?.rank}-${A}${L?"-pin":""}`)}return e.jsxs("tr",{...ze,className:c("group transition-colors",G&&"cursor-pointer hover:bg-oai-gray-50 dark:hover:bg-oai-gray-900/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-gray-500/60"),children:[e.jsx("td",{className:c(de(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(Ue,{rank:t?.rank,placeholder:ae})}),e.jsx("td",{className:ce(!1),children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsxs("span",{className:c("relative inline-flex shrink-0 rounded-full p-[2px]",t?.github_url&&t?.pro_active!==!0&&"gh-avatar-frame"),children:[e.jsx("span",{className:c("inline-flex rounded-full p-px",t?.github_url&&t?.pro_active!==!0&&"bg-white dark:bg-oai-gray-950"),children:e.jsx(X,{avatarUrl:t?.avatar_url,displayName:A,seed:he(t,A),proActive:t?.pro_active===!0})}),t?.github_url&&e.jsx(Fe,{githubUrl:t.github_url})]}),e.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:A}),e.jsx(ne,{proActive:t?.pro_active===!0}),e.jsx(le,{badges:t?.badges,className:"hidden sm:inline-flex"})]})}),e.jsx("td",{className:"px-3 sm:px-4 py-4 font-semibold text-oai-gray-800 dark:text-oai-gray-200 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",children:e.jsx(xe,{value:t?.total_tokens})}),e.jsx("td",{className:"hidden sm:table-cell px-3 sm:px-4 py-4 text-oai-gray-500 dark:text-oai-gray-400 whitespace-nowrap text-right tabular-nums bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60",title:"Based on estimated API pricing, not actual billing",children:ue(t?.estimated_cost_usd,h,v)}),e.jsx(De,{entry:t,isMe:!1,orderedColumns:B})]},`row-${t?.rank}-${A}`)})})]})}),e.jsx("div",{className:"flex flex-col py-1.5 sm:hidden",children:J.map((t,g)=>{const w=be(t?.display_name),T=pe(w)?Ee:w;return e.jsx(Cr,{entry:t,entryIdx:g,name:t?.is_me?I:T,meLabel:I,currency:h,rate:v,orderedColumns:B,placeholder:ae,onOpenProfile:Y},`mobile-${t?.rank??"ellipsis"}-${g}`)})})]}):O=e.jsx("div",{className:"px-6 py-12 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.empty")})});let se=null;return typeof U=="number"?se=na.map((t,g)=>t==null?e.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:s("leaderboard.pagination.ellipsis")},`ellipsis-${g}`):e.jsx("button",{className:c("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",t===P?"bg-oai-gray-200 dark:bg-oai-gray-800 text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white"),onClick:()=>M(t),disabled:j.loading,children:String(t)},`page-${t}`)):se=e.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.pagination.page_unknown",{page:String(P)})}),e.jsxs("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:[e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"mb-4 grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 gap-y-3.5 sm:mb-8 sm:grid-cols-[minmax(0,1fr)_auto] sm:gap-4",children:[e.jsx("h1",{className:"col-start-1 row-start-1 min-w-0 whitespace-nowrap text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:col-span-2 sm:row-start-1 sm:text-4xl",children:s("leaderboard.title")}),e.jsxs("p",{className:"col-span-2 row-start-2 hidden text-sm text-oai-gray-500 dark:text-oai-gray-400 sm:block sm:row-start-2 sm:text-base",children:[N==="total"?s("leaderboard.range.total"):Ce&&Ae?s("leaderboard.range",{period:Ke,from:Ce,to:Ae}):s("leaderboard.range_loading",{period:Ke}),V&&e.jsx("time",{dateTime:V.dateTime,title:s("leaderboard.generated_at",{ts:V.exact}),className:"ml-2 hidden border-l border-oai-gray-200 pl-2 text-xs text-oai-gray-500 dark:border-oai-gray-800 dark:text-oai-gray-400 sm:inline-block",children:s("leaderboard.generated_at",{ts:V.display})})]}),e.jsx("div",{className:"col-start-2 row-start-1 inline-flex h-9 shrink-0 items-center rounded-full border border-oai-gray-200 p-1 dark:border-oai-gray-800 sm:col-start-1 sm:row-start-3 sm:justify-self-start",children:["week","month","total"].map(t=>{const g=N===t;return e.jsxs("button",{onClick:()=>sa(t),disabled:j.loading,className:c("px-3 sm:px-4 h-7 text-sm font-medium rounded-full flex items-center justify-center transition-colors relative",g?"text-oai-black dark:text-white":"text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-gray-800 dark:hover:text-oai-gray-200"),children:[e.jsx("span",{className:"relative z-10",children:t==="week"?Te:t==="month"?Me:Pe}),g&&e.jsx(Ka.div,{layoutId:"leaderboard-period-active-bg",className:"absolute inset-0 bg-oai-gray-200 dark:bg-oai-gray-800 rounded-full z-0",transition:{type:"spring",stiffness:380,damping:30}})]},t)})}),e.jsxs("div",{className:"col-span-2 row-start-2 mb-0 flex w-full min-w-0 items-center justify-between sm:justify-end gap-2.5 sm:col-span-1 sm:col-start-2 sm:row-start-3 sm:mb-0 sm:w-auto sm:shrink-0",children:[e.jsx(wr,{communityStats:Le,onClick:()=>je(!0)}),e.jsx(pr,{me:K,totalEntries:ia,meLabel:I,onOpenProfile:K?.user_id?()=>Y(K.user_id):void 0,onJumpToMe:ca,canJump:z!=null&&!da&&!j.loading,className:"shrink-0"})]})]}),!r&&e.jsxs("div",{className:"mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between text-sm",children:[e.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.signin_prompt")}),e.jsx("button",{onClick:n,className:"shrink-0 whitespace-nowrap self-start sm:self-auto px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 transition-colors",children:s("leaderboard.signin_button")})]}),x&&ee&&!ta&&e.jsxs("div",{className:"mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between text-sm",children:[e.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.sync_prompt")}),e.jsx("button",{onClick:ma,disabled:_e,className:"shrink-0 whitespace-nowrap self-start sm:self-auto px-3 py-1.5 text-sm font-medium text-oai-gray-600 dark:text-oai-gray-300 border border-oai-gray-300 dark:border-oai-gray-700 rounded-md hover:text-oai-black dark:hover:text-white hover:border-oai-gray-400 dark:hover:border-oai-gray-600 disabled:opacity-50 transition-colors",children:_e?s("leaderboard.sync_button.busy"):s("leaderboard.sync_button.idle")})]}),e.jsxs("div",{className:"sm:rounded-xl sm:border sm:border-oai-gray-200 sm:dark:border-oai-gray-800 sm:overflow-hidden border-none bg-transparent",children:[j.error&&Z?e.jsx("div",{className:"border-b border-oai-gray-200 dark:border-oai-gray-800 px-6 py-3",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:j.error})}):null,O,e.jsxs("div",{className:"flex flex-col gap-3 sm:border-t border-oai-gray-200 px-4 py-3 sm:flex-row sm:items-center sm:justify-end sm:gap-x-4 sm:px-6 dark:border-oai-gray-800 border-none mt-2.5 sm:mt-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400 sm:justify-start",children:[e.jsx("label",{htmlFor:"leaderboard-page-size",className:"whitespace-nowrap",children:s("leaderboard.pagination.page_size_label")}),e.jsx(Pa,{id:"leaderboard-page-size",value:_,onValueChange:t=>aa(Number(t)),disabled:j.loading,ariaLabel:s("leaderboard.pagination.page_size_label"),options:me.map(t=>({value:t,label:String(t)})),align:"end",className:"px-3 py-1 text-oai-gray-700 dark:text-oai-gray-300"})]}),e.jsx("div",{className:"hidden h-5 w-px bg-oai-gray-200 dark:bg-oai-gray-800 sm:block","aria-hidden":"true"}),e.jsxs("div",{className:"flex w-full items-center justify-between sm:w-auto sm:justify-end gap-1.5",children:[e.jsx("button",{className:c("whitespace-nowrap rounded-xl border border-oai-gray-100 bg-oai-gray-50/50 px-3.5 py-2 text-xs font-medium text-oai-gray-500 dark:border-oai-gray-800/80 dark:bg-white/[0.01] dark:text-oai-gray-400 transition-all duration-200 active:scale-[0.97] sm:rounded-md sm:border-0 sm:bg-transparent sm:px-3 sm:py-1.5 sm:text-sm sm:font-medium sm:active:scale-100",Re&&!j.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>M(t=>Math.max(1,t-1)),disabled:!Re||j.loading,children:s("leaderboard.pagination.prev")}),e.jsxs("span",{className:"text-xs font-semibold tabular-nums text-oai-gray-500 dark:text-oai-gray-455 px-2 sm:hidden",children:[P," / ",U||"?"]}),e.jsx("div",{className:"hidden sm:flex items-center gap-1",children:se}),e.jsx("button",{className:c("whitespace-nowrap rounded-xl border border-oai-gray-100 bg-oai-gray-50/50 px-3.5 py-2 text-xs font-medium text-oai-gray-500 dark:border-oai-gray-800/80 dark:bg-white/[0.01] dark:text-oai-gray-400 transition-all duration-200 active:scale-[0.97] sm:rounded-md sm:border-0 sm:bg-transparent sm:px-3 sm:py-1.5 sm:text-sm sm:font-medium sm:active:scale-100",Ie&&!j.loading?"hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white":"opacity-50 cursor-not-allowed"),onClick:()=>M(t=>t+1),disabled:!Ie||j.loading,children:s("leaderboard.pagination.next")})]})]})]})]})}),e.jsx("footer",{className:"border-t border-oai-gray-200 dark:border-oai-gray-900 py-8 transition-colors duration-200",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between px-4 sm:px-6 text-sm text-oai-gray-400 dark:text-oai-gray-500",children:[e.jsx("p",{children:s("landing.v2.footer.line")}),e.jsx("a",{href:"https://github.com/xiufengsun/TokenTracker",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",target:"_blank",rel:"noopener noreferrer",children:s("landing.v2.nav.github")})]})}),e.jsxs(d.Suspense,{fallback:null,children:[e.jsx(hr,{isOpen:!!we,userId:we,period:N,accessToken:C,onClose:ea}),e.jsx(yr,{isOpen:Qe,onClose:()=>je(!1),communityStats:Le})]})]})}export{et as LeaderboardPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,aI as te,aK as k,j as v,aH as Fe,$ as M,bT as Te,aJ as z,bz as Pe,aO as G,aQ as xe,aT as U,aN as Le,bW as Ne,bX as Be,aL as j,bY as _e,bZ as le,aM as ue,aS as pe,b_ as Q,b$ as Ue,c0 as Ve,bw as Ye,be,bf as Xe,a6 as de,J as fe,bc as J,bd as $e,bi as Ge,c1 as Ke,bj as Je,bP as We,a1 as Ze,bo as ze,_ as Re,c2 as Qe,aP as q,c3 as qe,bs as et,bv as tt,c as $}from"./__vite-browser-external-DUJeOWgd.js";import{g as K,u as nt,c as ot,a as rt,s as st,b as it}from"./safePolygon-CKpREa4K.js";import{i as ye,D as at,P as ct,m as lt,j as ut,k as pt,l as dt,n as ft,o as gt,u as ht,p as mt,c as Tt,t as Pt,x as xt,y as bt}from"./composite-B4Z3F65o.js";import{p as Rt,c as yt}from"./store-C9yWYHfg.js";import{u as vt,a as Ct,g as St}from"./usePositioner-B0j1orGj.js";const ve=c.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Fe,currentIdRef:{current:null},currentContextRef:{current:null}});function Et(n,e){n.current=e.current}function Ot(n){const{children:e,delay:t,timeoutMs:r=0}=n,o=c.useRef(t),p=c.useRef(t),i=c.useRef(null),l=c.useRef(null),f=te();return k(()=>{if(p.current=t,!i.current){o.current=t;return}o.current={open:K(o.current,"open"),close:K(t,"close")}},[t,i,o,p]),v.jsx(ve.Provider,{value:c.useMemo(()=>({hasProvider:!0,delayRef:o,initialDelayRef:p,currentIdRef:i,timeoutMs:r,currentContextRef:l,timeout:f}),[r,f]),children:e})}function It(n,e={open:!1}){const{open:t}=e,r="rootStore"in n?n.rootStore:n,o=r.useState("floatingId"),p=c.useContext(ve),{currentIdRef:i,delayRef:l,timeoutMs:f,initialDelayRef:h,currentContextRef:u,hasProvider:T,timeout:d}=p,[m,s]=c.useState(!1),x=c.useRef(t);return k(()=>{x.current=t},[t]),k(()=>{function a(){u.current?.setIsInstantPhase(!1),i.current=null,u.current=null,l.current=h.current,d.clear()}if(i.current&&!t&&i.current===o){if(s(!1),f){const g=o;return d.start(f,()=>{r.select("open")||i.current&&i.current!==g||a()}),()=>{(x.current||i.current!==g)&&d.clear()}}a()}},[t,o,i,l,f,h,u,d,r]),k(()=>{if(!t)return;const a=u.current,g=i.current;d.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:s},i.current=o,l.current={open:0,close:K(h.current,"close")},g!==null&&g!==o?(s(!0),a?.setIsInstantPhase(!0),a?.onOpenChange(!1,M(Te))):(s(!1),a?.setIsInstantPhase(!1))},[t,o,r,i,l,h,u,d]),k(()=>()=>{if(i.current===o){if(u.current=null,!x.current)return;i.current=null,Et(l,h),d.clear()}},[u,i,l,o,h,d]),c.useMemo(()=>({activeIdRef:i,hasProvider:T,delayRef:l,isInstantPhase:m}),[i,T,l,m])}function wt(n,e){let t=null,r=null,o=!1;return{contextElement:n||void 0,getBoundingClientRect(){const p=n?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},i=e.axis==="x"||e.axis==="both",l=e.axis==="y"||e.axis==="both",f=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let h=p.width,u=p.height,T=p.x,d=p.y;return t==null&&e.x&&i&&(t=p.x-e.x),r==null&&e.y&&l&&(r=p.y-e.y),T-=t||0,d-=r||0,h=0,u=0,!o||f?(h=e.axis==="y"?p.width:0,u=e.axis==="x"?p.height:0,T=i&&e.x!=null?e.x:T,d=l&&e.y!=null?e.y:d):o&&!f&&(u=e.axis==="x"?p.height:u,h=e.axis==="y"?p.width:h),o=!0,{width:h,height:u,x:T,y:d,top:d,right:T+h,bottom:d+u,left:T}}}}function ge(n){return n!=null&&n.clientX!=null}function Mt(n,e={}){const{enabled:t=!0,axis:r="both"}=e,o="rootStore"in n?n.rootStore:n,p=o.useState("open"),i=o.useState("floatingElement"),l=o.useState("domReferenceElement"),f=o.context.dataRef,h=c.useRef(!1),u=c.useRef(null),[T,d]=c.useState(),[m,s]=c.useState([]),x=z(P=>{o.set("positionReference",P)}),a=z((P,y,E)=>{h.current||f.current.openEvent&&!ge(f.current.openEvent)||o.set("positionReference",wt(E??l,{x:P,y,axis:r,dataRef:f,pointerType:T}))}),g=z(P=>{p?u.current||(a(P.clientX,P.clientY,P.currentTarget),s([])):a(P.clientX,P.clientY,P.currentTarget)}),C=ye(T)?i:p;c.useEffect(()=>{if(!t){x(l);return}if(!C)return;function P(){u.current?.(),u.current=null}const y=Pe(i);function E(S){const I=xe(S);U(i,I)?P():a(S.clientX,S.clientY)}return!f.current.openEvent||ge(f.current.openEvent)?u.current=G(y,"mousemove",E):x(l),P},[C,t,i,f,l,o,a,x,m]),c.useEffect(()=>()=>{o.set("positionReference",null)},[o]),c.useEffect(()=>{t&&!i&&(h.current=!1)},[t,i]),c.useEffect(()=>{!t&&p&&(h.current=!0)},[t,p]);const b=c.useMemo(()=>{function P(y){d(y.pointerType)}return{onPointerDown:P,onPointerEnter:P,onMouseMove:g,onMouseEnter:g}},[g]);return c.useMemo(()=>t?{reference:b,trigger:b}:{},[t,b])}const ee=Ne&&Be;function Dt(n,e={}){const{enabled:t=!0,delay:r}=e,o="rootStore"in n?n.rootStore:n,{events:p,dataRef:i}=o.context,l=c.useRef(!1),f=c.useRef(null),h=c.useRef(!0),u=te();c.useEffect(()=>{const d=o.select("domReferenceElement");if(!t)return;const m=Pe(d);function s(){const g=o.select("domReferenceElement");!o.select("open")&&Ye(g)&&g===le(ue(g))&&(l.current=!0,f.current=g)}function x(){h.current=!0}function a(){h.current=!1}return Le(G(m,"blur",s),ee&&G(m,"keydown",x,!0),ee&&G(m,"pointerdown",a,!0))},[o,t]),c.useEffect(()=>{if(!t)return;function d(m){if(m.reason===be||m.reason===Xe){const s=o.select("domReferenceElement");j(s)&&(f.current=s,l.current=!0)}}return p.on("openchange",d),()=>{p.off("openchange",d)}},[p,t,o]);const T=c.useMemo(()=>{function d(){l.current=!1,f.current=null}return{onMouseLeave(){d()},onFocus(m){const s=m.currentTarget;if(l.current){if(f.current===s)return;d()}const x=xe(m.nativeEvent);if(j(x)){if(ee&&!m.relatedTarget){if(!h.current&&!Ue(x))return}else if(!Ve(x))return}const a=pe(m.relatedTarget,o.context.triggerElements),{nativeEvent:g,currentTarget:C}=m,b=typeof r=="function"?r():r;if(o.select("open")&&a||b===0||b===void 0){o.setOpen(!0,M(Q,g,C));return}u.start(b,()=>{l.current||o.setOpen(!0,M(Q,g,C))})},onBlur(m){d();const s=m.relatedTarget,x=m.nativeEvent,a=j(s)&&s.hasAttribute(_e("focus-guard"))&&s.getAttribute("data-type")==="outside";u.start(0,()=>{const g=o.select("domReferenceElement"),C=le(ue(g));!s&&C===g||U(i.current.floatingContext?.refs.floating.current,C)||U(g,C)||a||pe(s??C,o.context.triggerElements)||o.setOpen(!1,M(Q,x))})}}},[i,r,o,u]);return c.useMemo(()=>t?{reference:T,trigger:T}:{},[t,T])}function kt(n){let e=0;const t=String(n??"");for(let r=0;r<t.length;r+=1)e=Math.imul(31,e)+t.charCodeAt(r)|0;return Math.abs(e)%360}function At(n){const e=String(n??"").trim();if(!e)return"?";const t=e.split(/\s+/).filter(Boolean);if(t.length>=2){const r=t[0][0]||"",o=t[1][0]||"";return`${r}${o}`.toUpperCase()}return e.slice(0,2).toUpperCase()}const he={sm:"h-7 w-7 min-h-7 min-w-7 text-[10px]",md:"h-8 w-8 min-h-8 min-w-8 text-[11px]",lg:"h-14 w-14 min-h-14 min-w-14 text-base",xl:"h-[68px] w-[68px] min-h-[68px] min-w-[68px] text-xl"};function rn({avatarUrl:n,displayName:e,seed:t,size:r="md",proActive:o=!1,className:p}){const i=he[r]||he.md,l=kt(t??e??""),f=typeof n=="string"?n.trim():"",[h,u]=de.useState(!1),T=o===!0?"leaderboard-pro-avatar":null;return de.useEffect(()=>{u(!1)},[f]),f&&!h?v.jsx("img",{src:f,alt:"",referrerPolicy:"no-referrer",onError:()=>u(!0),className:fe("rounded-full object-cover ring-1 ring-white/10",i,p,T)}):v.jsx("div",{className:fe("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",i,p,T),style:{backgroundColor:`hsl(${l} 42% 34%)`},"aria-hidden":!0,children:At(e)})}const Ce=c.createContext(void 0);function W(n){const e=c.useContext(Ce);if(e===void 0&&!n)throw new Error(J(72));return e}const Ht={...Rt,disabled:n=>n.disabled,instantType:n=>n.instantType,isInstantPhase:n=>n.isInstantPhase,trackCursorAxis:n=>n.trackCursorAxis,disableHoverablePopup:n=>n.disableHoverablePopup,lastOpenChangeReason:n=>n.openChangeReason,closeOnClick:n=>n.closeOnClick,closeDelay:n=>n.closeDelay,adaptiveOrigin:n=>n.adaptiveOrigin};class jt extends $e{constructor(e,t,r){const o=new ct;super(Ft(e,o,t,r),Lt(o),Ht)}setOpen=(e,t)=>{at(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,M(be,e))}}function Ft(n,e,t,r=!1){return{...yt(e,t,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...n}}function Lt(n){return{popupRef:c.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:n}}const Nt=Ge(function(e){const{disabled:t=!1,defaultOpen:r=!1,open:o,disableHoverablePopup:p=!1,trackCursorAxis:i="none",actionsRef:l,onOpenChange:f,onOpenChangeComplete:h,handle:u,triggerId:T,defaultTriggerId:d=null,children:m}=e,s=lt((F,L)=>new jt({open:r,openProp:o,activeTriggerId:d,triggerIdProp:T},F,L));s.useControlledProp("openProp",o),s.useControlledProp("triggerIdProp",T),s.useContextCallback("onOpenChange",f),s.useContextCallback("onOpenChangeComplete",h);const x=s.useState("open"),a=!t&&x,g=s.useState("activeTriggerId"),C=s.useState("mounted"),b=s.useState("payload");s.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:p,disabled:t}),ut(s,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:P,transitionStatus:y}=pt(a,s),E=s.useState("isInstantPhase"),S=s.useState("instantType"),I=s.useState("lastOpenChangeReason"),D=c.useRef(null);k(()=>{x&&t&&s.setOpen(!1,M(Ke))},[x,t,s]),k(()=>{y==="ending"&&I===Te||y!=="ending"&&E?(S!=="delay"&&(D.current=S),s.set("instantType","delay")):D.current!==null&&(s.set("instantType",D.current),D.current=null)},[y,E,I,S,s]),k(()=>{a&&g==null&&s.set("payload",void 0)},[s,g,a]),c.useImperativeHandle(l,()=>({unmount:P,close:()=>s.setOpen(!1,M(Je))}),[P,s]);const H=a||C||!t&&i!=="none";return v.jsxs(Ce.Provider,{value:s,children:[u&&v.jsx(dt,{handle:u,store:s}),H&&v.jsx(Bt,{store:s,disabled:t,trackCursorAxis:i}),typeof m=="function"?m({payload:b}):m]})});function Bt({store:n,disabled:e,trackCursorAxis:t}){const r=n.useState("floatingRootContext"),o=ft(r,{enabled:!e,referencePress:()=>n.select("closeOnClick")}),p=Mt(r,{enabled:!e&&t!=="none",axis:t==="none"?void 0:t}),i=c.useMemo(()=>We(p.reference,o.reference),[p.reference,o.reference]);return gt(n,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:o.floating??Ze}),null}const Se=c.createContext(void 0);function _t(){return c.useContext(Se)}const Ut=600,Ee="data-base-ui-tooltip-trigger";function me(n){if("composedPath"in n){const t=n.composedPath();for(let r=0;r<t.length;r+=1){const o=t[r];if(j(o))return o}}const e=n.target;return j(e)?e:null}function Vt(n){let e=n;for(;e;){const t=e.closest(`[${Ee}]`);if(t)return t;const r=e.getRootNode();e="host"in r&&j(r.host)?r.host:null}return null}const Yt=ze(function(e,t){const{render:r,className:o,style:p,handle:i,payload:l,disabled:f,delay:h,closeOnClick:u=!0,closeDelay:T,id:d,...m}=e,s=W(!0),a=nt(i)??s;if(!a)throw new Error(J(82));const g=ht(d),C=a.useState("isTriggerActive",g),b=a.useState("isOpenedByTrigger",g),P=a.useState("floatingRootContext"),y=c.useRef(null),E=T??0,{registerTrigger:S,isMountedByThisTrigger:I}=mt(g,y,a,{payload:l,closeOnClick:u,closeDelay:E}),D=_t(),{activeIdRef:H,delayRef:F,isInstantPhase:L,hasProvider:O}=It(P,{open:b}),N=ot(P);a.useSyncedValue("isInstantPhase",L);const Z=a.useState("disabled"),B=f??Z,ne=Tt(B),oe=a.useState("trackCursorAxis"),we=a.useState("disableHoverablePopup"),_=c.useRef(!1),V=te(),Y=c.useRef(void 0);function re(){return O&&H.current!=null?0:h??D??Ut}function se(R){const w=y.current;if(!w||!R)return!1;const A=Vt(R);return A!==null&&A!==w&&U(w,A)}function Me(R){const w=se(R);return _.current=w,w&&(N.openChangeTimeout.clear(),N.restTimeout.clear(),N.restTimeoutPending=!1,V.clear()),w}const De=rt(P,{enabled:!B,mouseOnly:!0,move:!1,handleClose:!we&&oe!=="both"?st():null,restMs:re,delay(){return T==null&&O?{close:K(F.current,"close")}:{close:E}},triggerElementRef:y,isActiveTrigger:C,isClosing:()=>a.select("transitionStatus")==="ending",shouldOpen(){return!_.current}}),ke=Dt(P,{enabled:!B}).reference,Ae=R=>{const w=_.current,A=me(R),ie=Me(A),X=y.current,je=X&&A&&U(X,A);if(ie&&a.select("open")&&a.select("lastOpenChangeReason")===q){a.setOpen(!1,M(q,R));return}if(w&&!ie&&je&&!ne.current&&!a.select("open")&&X&&ye(Y.current)){const ae=()=>{!_.current&&!ne.current&&!a.select("open")&&a.setOpen(!0,M(q,R,X))},ce=re();ce===0?(V.clear(),ae()):V.start(ce,ae)}},He=a.useState("triggerProps",I);return Re("button",e,{state:{open:b},ref:[t,S,y],props:[De,ke,I||oe!=="none"?He:void 0,{onMouseOver(R){Ae(R.nativeEvent)},onFocus(R){se(me(R.nativeEvent))&&R.preventBaseUIHandler()},onMouseLeave(){_.current=!1,V.clear(),Y.current=void 0},onPointerEnter(R){Y.current=R.pointerType},onPointerDown(R){Y.current=R.pointerType,a.set("closeOnClick",u),u&&!a.select("open")&&a.cancelPendingOpen(R.nativeEvent)},onClick(R){u&&!a.select("open")&&a.cancelPendingOpen(R.nativeEvent)},id:g,[Qe]:B?"":void 0,[Ee]:B?void 0:""},m],stateAttributesMapping:Pt})}),Oe=c.createContext(void 0);function Xt(){const n=c.useContext(Oe);if(n===void 0)throw new Error(J(70));return n}const $t=c.forwardRef(function(e,t){const{keepMounted:r=!1,...o}=e;return W().useState("mounted")||r?v.jsx(Oe.Provider,{value:r,children:v.jsx(qe,{ref:t,...o})}):null}),Ie=c.createContext(void 0);function Gt(){const n=c.useContext(Ie);if(n===void 0)throw new Error(J(71));return n}const Kt=c.forwardRef(function(e,t){const{render:r,className:o,anchor:p,positionMethod:i="absolute",side:l="top",align:f="center",sideOffset:h=0,alignOffset:u=0,collisionBoundary:T="clipping-ancestors",collisionPadding:d=5,arrowPadding:m=5,sticky:s=!1,disableAnchorTracking:x=!1,collisionAvoidance:a=et,style:g,...C}=e,b=W(),P=Xt(),y=b.useState("open"),E=b.useState("mounted"),S=b.useState("trackCursorAxis"),I=b.useState("disableHoverablePopup"),D=b.useState("floatingRootContext"),H=b.useState("instantType"),F=b.useState("transitionStatus"),L=b.useState("adaptiveOrigin"),O=vt({anchor:p,positionMethod:i,floatingRootContext:D,mounted:E,side:l,sideOffset:h,align:f,alignOffset:u,collisionBoundary:T,collisionPadding:d,sticky:s,arrowPadding:m,disableAnchorTracking:x,keepMounted:P,collisionAvoidance:a,adaptiveOrigin:L}),N=c.useMemo(()=>({open:y,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:S!=="none"?"tracking-cursor":H}),[y,O.side,O.align,O.anchorHidden,S,H]),Z=Ct(e,N,{styles:O.positionerStyles,transitionStatus:F,props:C,refs:[t,b.useStateSetter("positionerElement")],hidden:!E,inert:!y||S==="both"||I});return v.jsx(Ie.Provider,{value:O,children:Z})}),Jt=c.forwardRef(function(e,t){const{render:r,className:o,style:p,...i}=e,l=W(),{side:f,align:h}=Gt(),u=l.useState("open"),T=l.useState("instantType"),d=l.useState("transitionStatus"),m=l.useState("popupProps"),s=l.useState("floatingRootContext"),x=l.useState("disabled"),a=l.useState("closeDelay");tt({open:u,ref:l.context.popupRef,onComplete(){u&&l.context.onOpenChangeComplete?.(!0)}}),it(s,{enabled:!x,closeDelay:a});const g=l.useStateSetter("popupElement");return Re("div",e,{state:{open:u,side:f,align:h,instant:T,transitionStatus:d},ref:[t,l.context.popupRef,g],props:[xt,m,St(d),i],stateAttributesMapping:bt})}),Wt=function(e){const{delay:t,closeDelay:r,timeout:o=400}=e,p=c.useMemo(()=>({open:t,close:r}),[t,r]);return v.jsx(Se.Provider,{value:t,children:v.jsx(Ot,{delay:p,timeoutMs:o,children:e.children})})};function sn({proActive:n=!1}){return n!==!0?null:v.jsx(Wt,{delay:350,children:v.jsxs(Nt,{children:[v.jsx(Yt,{render:v.jsx("span",{role:"img",tabIndex:0}),className:"leaderboard-pro-badge","aria-label":$("leaderboard.pro.badge_aria"),"aria-description":$("leaderboard.pro.tooltip"),onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.stopPropagation()},children:$("leaderboard.pro.badge")}),v.jsx($t,{children:v.jsx(Kt,{side:"top",sideOffset:6,className:"leaderboard-pro-tooltip-layer",children:v.jsx(Jt,{className:"leaderboard-pro-tooltip",children:$("leaderboard.pro.tooltip")})})})]})})}export{rn as L,sn as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{A as z,j as e,J as Te,c as r,h as ae,r as x,ai as ot,B,ba as lt,a6 as D,e as ct,a7 as ve,L as dt,bb as ut,G as mt,I as xt}from"./__vite-browser-external-DUJeOWgd.js";import{m as ke}from"./react-B7SkZTgg.js";import{P as ge,c as pt,r as re,a as gt,u as ht,b as ft,s as bt}from"./use-usage-limits-CSxFFn3_.js";import{b as k,c as Ee,l as Z,d as He,u as yt}from"./use-limits-display-prefs-NZ-AAYD5.js";import{C as Ie}from"./Card-D-5mABVt.js";import{F as vt}from"./FadeIn-ChVf45WW.js";import{P as Ae}from"./ProviderIcon-BshO2uER.js";import{H as kt}from"./HoverTooltip-BzP5FudR.js";import{C as jt}from"./ConfirmModal-BQ-xB1S_.js";import{I as je,L as wt}from"./LocalOnlyNotice-BaEq6qN7.js";import{S as ue}from"./Select-CtTceC4T.js";import{P as Nt}from"./plus-Cx82jb7o.js";import{P as _t,a as Ct,b as Pt,c as Mt,d as St}from"./PopoverPopup-CVTiEVHs.js";import{u as Dt}from"./use-reduced-motion-iDZEUyua.js";import"./use-latest-request-guard-DHv7vfFE.js";import"./DialogTitle-B1iNGD2S.js";import"./composite-B4Z3F65o.js";import"./store-C9yWYHfg.js";import"./DialogDescription-j4XnRy6y.js";import"./arrow-up-right-jPmRN562.js";import"./download-CJUnX1Bs.js";import"./SelectItemText-C7xi8iGp.js";import"./usePositioner-B0j1orGj.js";import"./check-CKwHc4Hv.js";import"./safePolygon-CKpREa4K.js";const Re={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};Re.node;const Tt=z(Re);const Oe={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};Oe.node;const Et=z(Oe);const Le={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};Le.node;const Fe=z(Le);const $e={name:"clock",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]};$e.node;const Ue=z($e);const Be={name:"infinity",size:24,node:[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]]};Be.node;const Ge=z(Be),Ht=[3,2,3,3,2,2,3];function I({className:t}){return e.jsx("div",{className:Te("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",t)})}function It(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(I,{className:"h-3 w-12 shrink-0"}),e.jsx(I,{className:"flex-1 h-1.5 rounded-full min-w-0"}),e.jsx(I,{className:"h-3 w-[30px] shrink-0"}),e.jsx(I,{className:"h-3 w-6 shrink-0"})]})}function At({bars:t,index:a}){const i=a%3===0?"w-24":a%3===1?"w-20":"w-[4.5rem]";return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(I,{className:"h-[14px] w-[14px] rounded shrink-0"}),e.jsx(I,{className:Te("h-4",i)})]}),Array.from({length:t},(s,n)=>e.jsx(It,{},n))]})}function Rt(){return e.jsx(Ie,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(I,{className:"h-3.5 w-28"}),Ht.map((t,a)=>e.jsx(At,{bars:t,index:a},a))]})})}const he=100;function we(t){const a=Date.parse(t);return Number.isFinite(a)?a:null}function Ot(t){return Math.max(0,Math.min(he,Math.round(t)))}function Lt(t){return new Intl.DateTimeFormat(ae(),{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(t))}function Ft(t,a,i){if(t==null||t>=a)return he;const s=a-t,n=a-i;return Ot(n/s*he)}function $t(t){const a=t.available_count;return a===null?null:Number.isInteger(a)&&a>=0?a:void 0}function Ut(t,{now:a}={}){if(!t||typeof t!="object")return null;const i=$t(t);if(i===void 0)return null;const s=Array.isArray(t.credits)?t.credits:[],n=a instanceof Date?a.getTime():Number(a??Date.now()),o=[];for(const l of s){const c=we(l?.expires_at);if(c==null)continue;const d=o.length+1;o.push({key:`reset-${d}`,label:r("limits.codex_reset_bank.row_label",{index:d}),expiresAt:Lt(c),expiresMs:c,percent:Ft(we(l?.granted_at),c,n)})}return i===0?null:o.length>0?{kind:"rows",availableCount:i??o.length,rows:o}:i>0?{kind:"count_only",availableCount:i,rows:[]}:null}const W=864e5;function A(t,a){const i=new Date(t),s=i.getUTCDate(),n=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth()+a,1,i.getUTCHours(),i.getUTCMinutes())),o=new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth()+1,0)).getUTCDate();return n.setUTCDate(Math.min(s,o)),n.getTime()}function We(t,a){if(a==="weekly")return t-7*W;if(a==="yearly")return A(t,-12);const i=new Date(t),s=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),0)).getUTCDate(),n=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth()-1,1,i.getUTCHours(),i.getUTCMinutes()));return n.setUTCDate(Math.min(i.getUTCDate(),s)),n.getTime()}function ze(t,a){return a==="weekly"?t+7*W:a==="yearly"?A(t,12):A(t,1)}function Bt(t){if(t.startedAt!=null){const a=new Date(t.startedAt).getTime();if(Number.isFinite(a))return a}return We(new Date(t.nextBillingAt).getTime(),t.cycle)}function Gt(t,a,i){if(t.startedAt!=null){const s=new Date(t.startedAt).getTime();if(Number.isFinite(s))return s}return We(i,a)}function Wt(t,a,i){if(a==="weekly"){const c=7*W,d=i<=t?0:Math.floor((i-t)/c);return{startMs:t+d*c,endMs:t+(d+1)*c}}const s=a==="yearly"?12:1,n=s*30.436875*W;let o=i<=t?0:Math.floor((i-t)/n);for(;o>0&&A(t,o*s)>i;)o-=1;let l=0;for(;A(t,(o+1)*s)<=i&&l<12e3;)o+=1,l+=1;return{startMs:A(t,o*s),endMs:A(t,(o+1)*s)}}function ee(t,a){const i=new Date(t.nextBillingAt).getTime();if(!Number.isFinite(i))return null;const s=["weekly","monthly","yearly"].includes(t.cycle)?t.cycle:"monthly",n=Gt(t,s,i);if(!Number.isFinite(n))return null;let o,l,c=!1;t.autoRenew?{startMs:o,endMs:l}=Wt(n,s,a):t.startedAt!=null?(o=n,l=ze(n,s),c=l<=a):(o=n,l=i,c=l<=a);const d=Math.max(1,l-o),m=c?1:Math.max(0,Math.min(1,(a-o)/d));return{endMs:l,startMs:o,progress:m,cycleDays:Math.max(1,Math.round(d/W)),expired:c}}function qe(t,a){const i=t-a;if(i<=0)return r("subscriptions.expired");const s=Math.ceil(i/6e4);if(s<60)return`${s}m`;const n=Math.floor(s/60);return n<24?`${n}h`:`${Math.floor(n/24)}d`}function fe(t,a){const i=t-a;if(i<=0)return r("subscriptions.expired");const s=Math.floor(i/6e4),n=Math.floor(s/1440),o=Math.floor(s%1440/60),l=s%60;return r("subscriptions.countdown",{days:n,hours:o,minutes:l})}const zt="shrink-0 text-oai-black dark:text-oai-white";function Ve(){const t=typeof navigator>"u"?"":navigator.userAgent||"";return/Windows/i.test(t)?"windows":/Linux/i.test(t)?"linux":"macos"}function Ye(){return Ve()==="windows"?r("limits.commandCode.setupHint.snippet_login_windows"):r("limits.commandCode.setupHint.snippet_login")}function Ke(){return r("limits.devin.setupHint.snippet_login")}function qt(t){const a=re(t);if(!Number.isFinite(a))return null;const i=a-Date.now();if(i<=0)return r("shared.time.now");const s=Math.floor(i/6e4);if(s<60)return`${s}m`;const n=Math.floor(s/60);return n<24?`${n}h`:`${Math.floor(n/24)}d`}function Vt(t,a){const i=a===k.REMAINING?100-t:t;return i>=90?"bg-red-500":i>=70?"bg-amber-500":"bg-emerald-500"}function te(t,a="used_percent"){return t?a==="utilization"?t.utilization:t.used_percent:null}function ie(t,a="reset_at"){return t?a==="resets_at"?t.resets_at:t.reset_at:null}function me(t){const a=Math.max(0,Math.min(100,Number(t)||0)),i=Math.round(a);return a>0&&i===0?r("limits.bar.sub_one_percent"):String(i)}function Q(t,{useGrouping:a=!0,maximumFractionDigits:i}={}){const s=Number(t);return Number.isFinite(s)?new Intl.NumberFormat(void 0,{minimumFractionDigits:0,maximumFractionDigits:i??(s>=100?0:2),useGrouping:a}).format(s):null}function Yt(t){if(!t||typeof t!="object"||!(Number(t.limit_credits)>0))return null;const a={useGrouping:t.unit!=="calls"},i=Q(t.used_credits,a),s=Q(t.limit_credits,a),n=Q(t.remaining_credits,a);if(!i||!s||!n)return null;const o=t.unit==="calls"?"limits.qoder_calls.detail":"limits.codex_credits.detail";return r(o,{used:i,limit:s,remaining:n})}function Kt(t,a,i){return pt({usedPercent:te(t.window,t.pctField),windowSeconds:gt(t,t.window),resetMs:re(ie(t.window,t.resetField)),mode:a,now:i})}function Xe(t){return Number.isFinite(t)?new Intl.DateTimeFormat(ae(),{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(t)):null}function Xt(t,a,i){const s=[Qe(t,a,i)],n=re(ie(t.window,t.resetField)),o=Xe(n);o&&s.push(r(t.timeKind==="expiry"?"limits.hover.expires_at":"limits.hover.resets_at",{time:o}));const l=Yt(t.window);return l&&s.push(l),s.join(`
|
|
2
|
-
`)}const Je=kt;function Jt({label:t,pct:a,reset:i,mode:s=k.USED,pacePercent:n=null,paceOver:o=!1,title:l=null}){const c=Math.max(0,Math.min(100,Number(a)||0)),d=s===k.REMAINING?100-c:c,m=Math.round(d),h=d>0&&m===0?Math.max(d,.35):d;let f=String(m);d>0&&m===0&&(f=r("limits.bar.sub_one_percent"));const b=n==null?null:Math.max(0,Math.min(100,n));return e.jsxs("div",{className:"group relative flex items-center gap-2",children:[e.jsx(Je,{text:l}),e.jsx("span",{"data-limit-label":"",className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 shrink-0 whitespace-nowrap",style:{width:"var(--tt-limits-label-w)"},children:t}),e.jsxs("div",{className:"relative flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:[e.jsx("div",{className:`${Vt(d,s)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${h}%`,minWidth:d>0?"3px":0}}),b!=null&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute top-0 h-full bg-oai-gray-100 dark:bg-oai-gray-700/50",style:{left:`calc(${b}% - 3px)`,width:"6px"}}),e.jsx("div",{className:`absolute top-0 h-full ${o?"bg-red-500":"bg-emerald-500"}`,style:{left:`calc(${b}% - 1px)`,width:"2px"}})]})]}),e.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:[f,"%"]}),i&&e.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:i})]})}function Qe(t,a,i){const s=t.label??r(t.labelKey),n=i===k.REMAINING,o=d=>n?100-d:d;if(a.expectedPercent==null){const d=Math.max(0,Math.min(100,Number(te(t.window,t.pctField))||0)),m=me(o(d));return n?r("limits.explain.remaining",{label:s,used:m}):r("limits.explain.used",{label:s,used:m})}if(a.paceOver){if(a.runsOutEta)return r("limits.explain.ahead_eta",{label:s,eta:a.runsOutEta});const d=me(o(a.projectedEnd??100));return r(n?"limits.explain.ahead_pct_remaining":"limits.explain.ahead_pct",{label:s,pct:d})}const l=Math.max(0,Math.min(100,Number(te(t.window,t.pctField))||0)),c=me(o(a.projectedEnd??l));return r(n?"limits.explain.on_track_remaining":"limits.explain.on_track",{label:s,pct:c})}function Qt({pace:t}){return t.pacePercent!=null}function Zt({rows:t,mode:a,now:i=Date.now()}){if(t.length===0)return null;const s=a===k.REMAINING,n=t.some(Qt);return e.jsxs("div",{className:"mt-1 flex flex-col gap-1",children:[t.map(({spec:o,pace:l})=>{const c=Xe(re(ie(o.window,o.resetField)));return e.jsxs("div",{className:"text-[11px] leading-snug text-oai-gray-600 dark:text-oai-gray-300",children:[Qe(o,l,a),c?e.jsxs("span",{className:"text-oai-gray-400 dark:text-oai-gray-500",children:[" · ",r(o.timeKind==="expiry"?"limits.hover.expires_at":"limits.hover.resets_at",{time:c})]}):null]},o.key)}),n?e.jsx("div",{className:"mt-1 pt-1.5 border-t border-oai-gray-200/70 dark:border-oai-gray-700/50 text-[10.5px] leading-snug text-oai-gray-400 dark:text-oai-gray-500",children:r(s?"limits.explain.body_remaining":"limits.explain.body")}):null]})}function G(t){if(!t)return null;const a=Date.now()-new Date(t).getTime();if(a<0)return null;const i=Math.floor(a/6e4);if(i<1)return r("shared.time.now");if(i<60)return r("shared.time.m_ago",{n:i});const s=Math.floor(i/60);if(s<24)return r("shared.time.h_ago",{n:s});const n=Math.floor(s/24);return r("shared.time.d_ago",{n})}const Ne={live:{surface:"bg-oai-gray-50 dark:bg-oai-gray-800 border-oai-gray-200/60 dark:border-oai-gray-700/60 text-oai-gray-500 dark:text-oai-gray-400",dot:"bg-emerald-500",pulse:"bg-emerald-400"},stale:{surface:"bg-oai-gray-50 dark:bg-oai-gray-800 border-oai-gray-200/60 dark:border-oai-gray-700/60 text-oai-gray-500 dark:text-oai-gray-400",dot:"bg-amber-500",pulse:"bg-amber-400"},cached:{surface:"bg-oai-gray-50 dark:bg-oai-gray-800 border-oai-gray-200/60 dark:border-oai-gray-700/60 text-oai-gray-500 dark:text-oai-gray-400",dot:"bg-amber-500",pulse:"bg-amber-400"}},ea={claude:"claude",codex:"codex",antigravity:"agy"};function L({label:t,age:a=null,tone:i="live",tooltip:s=null}){const n=Ne[i]||Ne.live,o=i==="live";return e.jsxs("div",{className:"relative inline-flex items-center group cursor-help ml-1",onClick:l=>l.stopPropagation(),children:[e.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[9px] font-semibold uppercase tracking-wider border leading-normal ${n.surface}`,children:[o?e.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[e.jsx("span",{className:`animate-ping absolute inline-flex h-full w-full rounded-full ${n.pulse} opacity-75`}),e.jsx("span",{className:`relative inline-flex rounded-full h-1.5 w-1.5 ${n.dot}`})]}):e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${n.dot}`}),t,a?e.jsxs(e.Fragment,{children:[" · ",a]}):null]}),s?e.jsxs("span",{className:"pointer-events-none absolute left-1/2 bottom-full z-20 mb-2 -translate-x-1/2 w-48 rounded-md bg-oai-gray-900 dark:bg-oai-gray-800 px-2.5 py-1.5 text-[10px] font-normal text-white text-center opacity-0 scale-95 translate-y-1 group-hover:opacity-100 group-hover:scale-100 group-hover:translate-y-0 transition-all duration-200 cubic-bezier(0.16, 1, 0.3, 1) leading-normal shadow-lg origin-bottom border border-oai-gray-800 dark:border-oai-gray-700",children:[s,e.jsx("span",{className:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-oai-gray-900 dark:border-t-oai-gray-800"})]}):null]})}function Ze({name:t,providerId:a,children:i,expandable:s=!1,expanded:n=!1,onToggle:o,badge:l=null,rightAdornment:c=null}){const d=He(a),m=e.jsxs("div",{className:"flex items-center gap-1.5",children:[d?e.jsx(Ae,{provider:d,size:14,className:zt}):null,e.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:t}),c?e.jsx("span",{className:"shrink-0",children:c}):null,l]});return s?e.jsxs("div",{role:"button",tabIndex:0,"aria-expanded":n,onClick:o,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o?.())},className:"flex flex-col gap-1.5 -mx-1.5 px-1.5 py-1 rounded-lg cursor-pointer transition-colors hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/40 aria-expanded:bg-oai-gray-50 dark:aria-expanded:bg-oai-gray-800/40",children:[m,i]}):e.jsxs("div",{className:"flex flex-col gap-1.5",children:[m,i]})}function et({subscription:t}){const a=t.autoRenew?r("subscriptions.badge.auto_renew"):r("subscriptions.badge.stops"),i=t.autoRenew?Ge:Ue;return e.jsx("span",{role:"img","aria-label":a,title:a,className:`inline-flex translate-y-px ${t.autoRenew?"text-oai-brand-600 dark:text-oai-brand-400":"text-blue-600 dark:text-blue-400"}`,children:e.jsx(i,{size:14,strokeWidth:2,"aria-hidden":!0})})}function tt({subscription:t,now:a,mode:i=k.USED}){const s=ee(t,a);if(!s)return null;const{endMs:n,expired:o}=s,l=!o&&n-a<=3*864e5,c=o?100:s.progress*100,d=i===k.REMAINING?100-c:c,m=o?100:Math.max(0,Math.min(100,d)),h=Math.round(m),f=m>0&&h===0?r("limits.bar.sub_one_percent"):`${h}%`;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 shrink-0 whitespace-nowrap",style:{width:"var(--tt-limits-label-w)"},children:r("subscriptions.inline.label")}),e.jsx("div",{className:"relative flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:e.jsx("div",{className:`${o?"bg-red-500":l?"bg-amber-500":"bg-blue-500"} rounded-full h-full block motion-safe:transition-[width] motion-safe:duration-500 ease-out motion-reduce:transition-none`,style:{width:`${m}%`,minWidth:m>0?"3px":0}})}),e.jsx("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:f}),e.jsx("span",{className:`text-[10px] tabular-nums shrink-0 whitespace-nowrap w-6 text-right ${o?"text-oai-error":"text-oai-gray-400 dark:text-oai-gray-500"}`,children:qe(n,a)})]})}function at({subscription:t,now:a}){const i=ee(t,a);if(!i)return null;const s=new Intl.DateTimeFormat(ae(),{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.jsxs("div",{className:"text-[11px] leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx("span",{children:r("subscriptions.inline.label")}),e.jsx("span",{className:"text-oai-gray-300 dark:text-oai-gray-600",children:":"}),e.jsx("span",{children:t.autoRenew?r("subscriptions.label.renews_at"):r("subscriptions.label.expires_at")}),e.jsx("span",{children:" "}),e.jsx("span",{className:"font-mono tabular-nums",children:s.format(new Date(i.endMs))}),e.jsx("span",{className:"text-oai-gray-300 dark:text-oai-gray-600",children:" · "}),e.jsx("span",{className:i.expired?"text-oai-error":void 0,children:fe(i.endMs,a)}),e.jsx("span",{className:"text-oai-gray-300 dark:text-oai-gray-600",children:" · "}),e.jsx("span",{children:t.autoRenew?r("subscriptions.status.auto_renew"):r("subscriptions.status.manual")})]})}const ta=Ee;function R({children:t,tone:a="neutral"}){const i=a==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return e.jsx("div",{className:`text-[11px] leading-snug ${i}`,children:t})}function aa({rows:t,mode:a,extra:i=null}){const s=t.length===0&&!i;return e.jsxs(e.Fragment,{children:[t.map(({spec:n,pace:o})=>e.jsx(Jt,{label:n.label??r(n.labelKey),pct:te(n.window,n.pctField),reset:qt(ie(n.window,n.resetField)),mode:a,pacePercent:o.pacePercent,paceOver:o.paceOver,title:Xt(n,o,a)},n.key)),s?e.jsx(R,{children:r("limits.status.no_data")}):null,i]})}function ra(t){if(!Number.isFinite(t.expiresMs))return null;const a=Math.floor((t.expiresMs-Date.now())/864e5);return a<0?null:a===0?r("limits.reset_bank.hover_detail_today",{date:t.expiresAt}):r("limits.reset_bank.hover_detail",{date:t.expiresAt,days:a})}function ia({row:t}){const a=Math.max(0,Math.min(100,Number(t.percent)||0));return e.jsxs("div",{className:"group relative flex items-center gap-2","data-reset-bank-row":"",children:[e.jsx(Je,{text:ra(t)}),e.jsx("span",{"data-limit-label":"",className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 shrink-0 whitespace-nowrap",style:{width:"var(--tt-limits-label-w)"},children:t.label}),e.jsx("div",{className:"relative flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:e.jsx("div",{className:"bg-oai-gray-400 dark:bg-oai-gray-500 rounded-full h-full transition-[width] duration-500 ease-out",style:{width:`${a}%`,minWidth:a>0?"3px":0}})}),e.jsx("span",{className:"text-[10px] tabular-nums text-oai-gray-400 dark:text-oai-gray-500 w-[4.25rem] text-right shrink-0 whitespace-nowrap",children:t.expiresAt})]})}function na({model:t}){const a=t.kind==="count_only"?r("limits.codex_reset_bank.count_only",{count:t.availableCount}):null;return e.jsxs("div",{className:"mt-1 flex flex-col gap-1","data-reset-bank-section":t.kind,children:[e.jsx("div",{className:"text-[10.5px] font-medium uppercase tracking-wide text-oai-gray-400 dark:text-oai-gray-500",children:r("limits.codex_reset_bank.title")}),a?e.jsx("div",{className:"text-[11px] leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:a}):t.rows.map(i=>e.jsx(ia,{row:i},i.key))]})}function rt(t,a){if(t==="codex_meta"){const i=Ut(a.reset_credits);return i?e.jsx(na,{model:i}):null}if(t==="kimi_parallel"&&a.parallel_limit)return e.jsx(R,{children:r("limits.label.kimi_parallel",{count:a.parallel_limit})});if(t==="kiro_credits"&&Number.isFinite(Number(a.tracked_credits))&&Number(a.tracked_credit_records)>0){const i=Q(a.tracked_credits,{maximumFractionDigits:2});return e.jsx(R,{children:r("limits.label.kiro_tracked_credits",{credits:i,count:Number(a.tracked_credit_records)})})}return t==="copilot_otel"&&!a.otel_has_files&&!a.otel_enabled?e.jsx(la,{defaultDir:a.otel_default_dir}):null}function sa(t,a,i,s,n,o,l=null,c=null,d=Date.now()){const m=ge[t];if(!m)return null;const h=m.windows(a).filter(b=>b.window).map(b=>({spec:b,pace:Kt(b,s,d)})),f=rt(m.extra,a);return e.jsxs(Ze,{name:i,providerId:t,expandable:h.length>0||!!c,expanded:n,onToggle:o,badge:l,rightAdornment:c?e.jsx(et,{subscription:c}):null,children:[e.jsx(aa,{mode:s,rows:h,extra:f}),c?e.jsx(tt,{subscription:c,now:d,mode:s}):null,n?e.jsx(Zt,{rows:h,mode:s,now:d}):null,n&&c?e.jsx(at,{subscription:c,now:d}):null]},t)}function xe(t,a,i,s,n=null,o=Date.now(),l=k.USED){const c=!!n;return e.jsxs(Ze,{name:Z(t),providerId:t,expandable:c,expanded:i,onToggle:s,rightAdornment:c?e.jsx(et,{subscription:n}):null,children:[a,c?e.jsx(tt,{subscription:n,now:o,mode:l}):null,c&&i?e.jsx("div",{className:"mt-1",children:e.jsx(at,{subscription:n,now:o})}):null]},t)}function oa(t,a,i,s,n,o=null,l=Date.now()){if(!ge[t])return null;if(!a?.configured)return xe(t,e.jsxs(e.Fragment,{children:[e.jsx(R,{children:r("limits.status.not_connected")}),t==="opencodeGo"?e.jsx(_e,{}):null,t==="commandCode"?e.jsx(Ce,{}):null,t==="codingPlan"?e.jsx(Me,{}):null,t==="agentPlan"?e.jsx(Se,{}):null,t==="devin"?e.jsx(Pe,{}):null]}),s,n,o,l,i);if(t==="opencodeGo"&&a.subscription_status==="inactive")return xe(t,e.jsx(R,{children:r("limits.opencodeGo.status.inactive")}),s,n,o,l,i);if(a.error)return xe(t,e.jsxs(e.Fragment,{children:[e.jsx(R,{tone:"error",children:r("shared.error.prefix",{error:a.error})}),t==="kiro"?rt(ge.kiro.extra,a):null,t==="opencodeGo"?e.jsx(_e,{}):null,t==="commandCode"?e.jsx(Ce,{}):null,t==="codingPlan"?e.jsx(Me,{}):null,t==="agentPlan"?e.jsx(Se,{}):null,t==="devin"?e.jsx(Pe,{}):null]}),s,n,o,l,i);const c=Z(t),d=a.plan_label?`${c} ${a.plan_label}`:c;let m=null;if(a.auth_action_required==="reauth"){const f=t==="commandCode"?Ye():t==="devin"?Ke():ea[t];m=e.jsx(L,{label:r("limits.reauth.badge"),age:G(a.cached_at),tone:"stale",tooltip:f?r("limits.reauth.tooltip",{command:f}):null})}if(!m&&t==="antigravity")if(a.cached){const f=G(a.cached_at);m=e.jsx(L,{label:r("limits.label.antigravity_cached"),age:f,tone:"cached",tooltip:r("limits.tooltip.antigravity_cached")})}else m=e.jsx(L,{label:r("limits.label.antigravity_live"),tone:"live",tooltip:r("limits.tooltip.antigravity_live")});!m&&(t==="qoder"||t==="qoderCn")&&a.cached&&(m=e.jsx(L,{label:r("limits.label.antigravity_cached"),age:G(a.cached_at),tone:"cached",tooltip:r("limits.tooltip.qoder_cached")})),!m&&(t==="codingPlan"||t==="agentPlan")&&a.cached&&(m=e.jsx(L,{label:r("limits.label.antigravity_cached"),age:G(a.cached_at),tone:"cached",tooltip:r("limits.tooltip.ark_cached")}));const h=a.provenance;return h?.stale&&!m&&(m=e.jsx(L,{label:r("limits.provenance.stale"),age:G(h.captured_at),tone:"stale",tooltip:r("limits.provenance.tooltip",{source:h.source,confidence:h.confidence})})),sa(t,a,d,i,s,n,m,o,l)}function la({defaultDir:t}){const[a,i]=x.useState(!1),n=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${t||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
|
|
3
|
-
`),o=async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),1600)}catch{}};return e.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:r("limits.copilot.otelHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug",children:r("limits.copilot.otelHint.body")}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:n}),e.jsx("button",{type:"button",onClick:o,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:a?r("limits.copilot.otelHint.copied"):r("limits.copilot.otelHint.copy")})]})}function j({n:t,children:a}){return e.jsxs("li",{className:"flex gap-2.5",children:[e.jsx("span",{className:"mt-[1px] flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-oai-brand/15 text-[9px] font-semibold text-oai-brand",children:t}),e.jsx("div",{className:"min-w-0 flex-1 leading-snug",children:a})]})}function be(){return e.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",className:"h-2.5 w-2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M4.5 2.75h4.75V7.5M9.25 2.75 3 9"})})}function _e(){const[t,a]=x.useState(!1),i=["read -r -s OPENCODE_GO_API_KEY","export OPENCODE_GO_API_KEY",'launchctl setenv OPENCODE_GO_API_KEY "$OPENCODE_GO_API_KEY"'].join(`
|
|
4
|
-
`),s=async n=>{n.stopPropagation();try{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),1600)}catch{}};return e.jsxs("div",{className:"mt-1.5 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700/60 bg-oai-gray-50/50 dark:bg-oai-gray-900/20 p-3 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"text-[12px] font-semibold text-oai-gray-800 dark:text-oai-gray-100",children:r("limits.opencodeGo.setupHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.opencodeGo.setupHint.subtitle")}),e.jsxs("ol",{className:"mt-2.5 space-y-2.5",children:[e.jsxs(j,{n:"1",children:[e.jsx("div",{children:r("limits.opencodeGo.setupHint.step1")}),e.jsxs("a",{href:"https://opencode.ai",target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 rounded-md bg-oai-brand/10 px-2 py-1 font-medium text-oai-brand hover:bg-oai-brand/15 transition-colors",children:[r("limits.opencodeGo.setupHint.cta"),e.jsx(be,{})]})]}),e.jsx(j,{n:"2",children:e.jsx("div",{children:r("limits.opencodeGo.setupHint.step2")})}),e.jsxs(j,{n:"3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:r("limits.opencodeGo.setupHint.step3")}),e.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded-md border border-oai-gray-300 dark:border-oai-gray-700 px-2 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:t?r("limits.opencodeGo.setupHint.copied"):r("limits.opencodeGo.setupHint.copy")})]}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:i}),e.jsx("div",{className:"mt-1 text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:r("limits.opencodeGo.setupHint.note_app")})]})]})]})}function Ce(){const[t,a]=x.useState(!1),i=Ve(),s=Ye(),n=i==="windows"?r("limits.commandCode.setupHint.snippet_env_windows").replaceAll("\\n",`
|
|
5
|
-
`):[r("limits.commandCode.setupHint.snippet_read"),r("limits.commandCode.setupHint.snippet_export"),...i==="macos"?[r("limits.commandCode.setupHint.snippet_setenv")]:[]].join(`
|
|
6
|
-
`),o=async l=>{l.stopPropagation();try{await navigator.clipboard.writeText(n),a(!0),setTimeout(()=>a(!1),1600)}catch{}};return e.jsxs("div",{className:"mt-1.5 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700/60 bg-oai-gray-50/50 dark:bg-oai-gray-900/20 p-3 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"text-[12px] font-semibold text-oai-gray-800 dark:text-oai-gray-100",children:r("limits.commandCode.setupHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.commandCode.setupHint.subtitle")}),e.jsxs("ol",{className:"mt-2.5 space-y-2.5",children:[e.jsxs(j,{n:"1",children:[e.jsx("div",{children:r("limits.commandCode.setupHint.step1")}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:s})]}),e.jsxs(j,{n:"2",children:[e.jsx("div",{children:r("limits.commandCode.setupHint.step2")}),e.jsx("div",{className:"mt-1.5 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:o,className:"shrink-0 rounded-md border border-oai-gray-300 dark:border-oai-gray-700 px-2 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:t?r("limits.commandCode.setupHint.copied"):r("limits.commandCode.setupHint.copy")})}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:n}),e.jsx("div",{className:"mt-1 text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:i==="windows"?r("limits.commandCode.setupHint.note_windows"):i==="linux"?r("limits.commandCode.setupHint.note_linux"):r("limits.commandCode.setupHint.note_app")})]})]})]})}function Pe(){const t=Ke();return e.jsxs("div",{className:"mt-1.5 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700/60 bg-oai-gray-50/50 dark:bg-oai-gray-900/20 p-3 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"text-[12px] font-semibold text-oai-gray-800 dark:text-oai-gray-100",children:r("limits.devin.setupHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.devin.setupHint.subtitle")}),e.jsx("ol",{className:"mt-2.5 space-y-2.5",children:e.jsxs(j,{n:"1",children:[e.jsx("div",{children:r("limits.devin.setupHint.step1")}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:t}),e.jsx("div",{className:"mt-1 text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:r("limits.devin.setupHint.note")})]})})]})}function Me(){const[t,a]=x.useState(!1),i=["npm install -g @volcengine/ark-cli","arkcli auth login volc-sso # browser SSO (recommended)","arkcli auth status # verify the session"].join(`
|
|
7
|
-
`),s=async n=>{n.stopPropagation();try{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),1600)}catch{}};return e.jsxs("div",{className:"mt-1.5 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700/60 bg-oai-gray-50/50 dark:bg-oai-gray-900/20 p-3 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"text-[12px] font-semibold text-oai-gray-800 dark:text-oai-gray-100",children:r("limits.codingPlan.setupHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.codingPlan.setupHint.subtitle")}),e.jsxs("ol",{className:"mt-2.5 space-y-2.5",children:[e.jsxs(j,{n:"1",children:[e.jsx("div",{children:r("limits.codingPlan.setupHint.step1")}),e.jsxs("a",{href:"https://www.volcengine.com/docs/82379/2536875",target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 rounded-md bg-oai-brand/10 px-2 py-1 font-medium text-oai-brand hover:bg-oai-brand/15 transition-colors",children:[r("limits.codingPlan.setupHint.cta"),e.jsx(be,{})]})]}),e.jsxs(j,{n:"2",children:[e.jsx("div",{children:r("limits.codingPlan.setupHint.step2")}),e.jsx("div",{className:"mt-0.5 text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.codingPlan.setupHint.step2_remote")})]}),e.jsxs(j,{n:"3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:r("limits.codingPlan.setupHint.step3")}),e.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded-md border border-oai-gray-300 dark:border-oai-gray-700 px-2 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:t?r("limits.codingPlan.setupHint.copied"):r("limits.codingPlan.setupHint.copy")})]}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:i}),e.jsx("div",{className:"mt-1 text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:r("limits.codingPlan.setupHint.note_app")})]})]})]})}function Se(){const[t,a]=x.useState(!1),i=[r("limits.agentPlan.setupHint.snippet_install"),r("limits.agentPlan.setupHint.snippet_login"),r("limits.agentPlan.setupHint.snippet_status")].join(`
|
|
8
|
-
`),s=async n=>{n.stopPropagation();try{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),1600)}catch{}};return e.jsxs("div",{className:"mt-1.5 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700/60 bg-oai-gray-50/50 dark:bg-oai-gray-900/20 p-3 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("div",{className:"text-[12px] font-semibold text-oai-gray-800 dark:text-oai-gray-100",children:r("limits.agentPlan.setupHint.title")}),e.jsx("div",{className:"mt-0.5 leading-snug text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.agentPlan.setupHint.subtitle")}),e.jsxs("ol",{className:"mt-2.5 space-y-2.5",children:[e.jsxs(j,{n:"1",children:[e.jsx("div",{children:r("limits.agentPlan.setupHint.step1")}),e.jsxs("a",{href:"https://www.volcengine.com/docs/82379/2536875",target:"_blank",rel:"noreferrer",onClick:n=>n.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 rounded-md bg-oai-brand/10 px-2 py-1 font-medium text-oai-brand hover:bg-oai-brand/15 transition-colors",children:[r("limits.agentPlan.setupHint.cta"),e.jsx(be,{})]})]}),e.jsxs(j,{n:"2",children:[e.jsx("div",{children:r("limits.agentPlan.setupHint.step2")}),e.jsx("div",{className:"mt-0.5 text-oai-gray-500 dark:text-oai-gray-400",children:r("limits.agentPlan.setupHint.step2_remote")})]}),e.jsxs(j,{n:"3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:r("limits.agentPlan.setupHint.step3")}),e.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded-md border border-oai-gray-300 dark:border-oai-gray-700 px-2 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:t?r("limits.agentPlan.setupHint.copied"):r("limits.agentPlan.setupHint.copy")})]}),e.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded-md bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-relaxed whitespace-pre",children:i}),e.jsx("div",{className:"mt-1 text-[10px] text-oai-gray-400 dark:text-oai-gray-500",children:r("limits.agentPlan.setupHint.note_app")})]})]})]})}function ca(t){const[a,i]=x.useState(0);return x.useLayoutEffect(()=>{const s=t.current;if(!s)return;const n=s.querySelectorAll("[data-limit-label]");let o=0,l=null;if(n.length>0)try{l=document.createElement("canvas").getContext("2d")}catch{l=null}if(l){const d=window.getComputedStyle(n[0]);l.font=`${d.fontStyle} ${d.fontWeight} ${d.fontSize} ${d.fontFamily}`;for(const m of n)o=Math.max(o,l.measureText(m.textContent).width)}const c=Math.ceil(o);i(d=>d===c?d:c)}),a}function da({claude:t,codex:a,cursor:i,gemini:s,kimi:n,kiro:o,grok:l,antigravity:c,copilot:d,zcode:m,opencodeGo:h,commandCode:f,qoder:b,qoderCn:N,codingPlan:T,agentPlan:_,devin:w,order:E,visibility:q,displayMode:V,subscriptions:ne=[],showSubscriptions:F=!0}){const se={claude:t,codex:a,cursor:i,gemini:s,kimi:n,kiro:o,grok:l,antigravity:c,copilot:d,zcode:m,opencodeGo:h,commandCode:f,qoder:b,qoderCn:N,codingPlan:T,agentPlan:_,devin:w},oe=x.useRef(null),C=ca(oe),[le,Y]=x.useState(null),[P,K]=x.useState(()=>Date.now()),ce=Array.isArray(E)&&E.length>0?E:ta,X=V===k.REMAINING?k.REMAINING:k.USED,de=X===k.REMAINING?r("limits.settings.display_mode_remaining"):r("limits.settings.display_mode_used");x.useEffect(()=>{const g=setInterval(()=>K(Date.now()),6e4);return()=>clearInterval(g)},[]);const H=new Map;if(F)for(const g of ne||[]){if(!g?.provider)continue;const M=new Date(g.nextBillingAt).getTime();if(!Number.isFinite(M))continue;const J=H.get(g.provider);if(!J){H.set(g.provider,g);continue}const S=new Date(J.nextBillingAt).getTime(),U=M>P,u=S>P;(U&&(!u||S>M)||!U&&!u&&M>S)&&H.set(g.provider,g)}const $=ce.filter(g=>!q||q[g]!==!1||H.has(g)).map(g=>oa(g,se[g],X,le===g,()=>Y(M=>M===g?null:g),H.get(g)||null,P)).filter(Boolean);return e.jsx(vt,{delay:.15,children:e.jsx(Ie,{children:e.jsxs("div",{ref:oe,className:"flex flex-col gap-3",style:C>0?{"--tt-limits-label-w":`${C}px`}:void 0,children:[e.jsxs("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:[r("limits.panel.title"),r("limits.panel.mode_separator"),de]}),$.length>0?$:e.jsx(R,{children:r("limits.status.all_hidden")})]})})})}async function it(t){const a=await t.json().catch(()=>null);if(!t.ok||a?.ok===!1)throw new Error(a?.error||`Subscription request failed with HTTP ${t.status}`);return a}async function ua(){const t=await fetch("/functions/tokentracker-subscription-manager",{headers:{Accept:"application/json"},cache:"no-store"}),a=await it(t);return Array.isArray(a.subscriptions)?a.subscriptions:[]}async function ye(t){const a=await ot();return it(await fetch("/functions/tokentracker-subscription-manager",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...a},cache:"no-store",body:JSON.stringify(t)}))}function ma(t){return ye({action:"create",subscription:t})}function xa(t,a){return ye({action:"update",id:t,subscription:a})}function pa(t){return ye({action:"delete",id:t})}const pe={plan:"",provider:"",cycle:"monthly",autoRenew:!0,startedAt:""};function ga(t){const a=new Date(t);if(Number.isNaN(a.getTime()))return"";const i=s=>String(s).padStart(2,"0");return`${a.getFullYear()}-${i(a.getMonth()+1)}-${i(a.getDate())}T${i(a.getHours())}:${i(a.getMinutes())}`}function ha({subscriptions:t,onChanged:a}){const[i,s]=x.useState(!1),[n,o]=x.useState(null),[l,c]=x.useState(pe),[d,m]=x.useState(!1),[h,f]=x.useState(!1),[b,N]=x.useState(!1),[T,_]=x.useState(!1),[w,E]=x.useState(null),[q,V]=x.useState(!1),[ne,F]=x.useState(!1),[se,oe]=x.useState(null),[C,le]=x.useState(()=>Date.now()),Y=x.useRef(null),P=ae(),K=x.useMemo(()=>new Intl.DateTimeFormat(P,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),[P]);x.useEffect(()=>{const u=setInterval(()=>le(Date.now()),6e4);return()=>clearInterval(u)},[]),x.useEffect(()=>{if(!i)return;const u=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;Y.current?.scrollIntoView?.({behavior:u?"auto":"smooth",block:"nearest"})},[i,n]);const ce=x.useMemo(()=>Ee.map(u=>{const v=(t||[]).some(y=>y.provider===u&&y.id!==n),p=Z(u);return{value:u,label:v?`${p} ${r("subscriptions.form.provider_taken_suffix")}`:p,disabled:v}}),[P,t,n]),X=x.useMemo(()=>[{value:"weekly",label:r("subscriptions.form.cycle_weekly")},{value:"monthly",label:r("subscriptions.form.cycle_monthly")},{value:"yearly",label:r("subscriptions.form.cycle_yearly")}],[P]),de=x.useMemo(()=>[{value:"true",label:r("subscriptions.form.auto_renew_on")},{value:"false",label:r("subscriptions.form.auto_renew_off")}],[P]),H=x.useCallback(()=>{c(pe),o(null),f(!1),N(!1),_(!1),s(!0)},[]),$=x.useCallback(u=>{c({plan:u.plan||"",provider:u.provider||"",cycle:u.cycle||"monthly",autoRenew:u.autoRenew,startedAt:ga(new Date(Bt(u)).toISOString())}),o(u.id),f(!1),N(!1),_(!1),s(!0)},[]),g=x.useCallback(()=>{s(!1),o(null),c(pe),f(!1),N(!1),_(!1)},[]),M=x.useCallback(async u=>{if(u.preventDefault(),f(!1),!l.provider){N(!0);return}if((t||[]).some(O=>O.provider===l.provider&&O.id!==n)){_(!0);return}const p=new Date(l.startedAt).getTime();if(!Number.isFinite(p)){f(!0);return}const y={service:Z(l.provider),plan:l.plan,provider:l.provider||null,autoRenew:l.autoRenew,cycle:l.cycle,startedAt:p,nextBillingAt:ze(p,l.cycle)};m(!0);try{n?await xa(n,y):await ma(y),g(),await a?.()}catch{f(!0)}finally{m(!1)}},[g,n,l,a,t]),J=x.useCallback(async()=>{if(w){V(!0),F(!1);try{await pa(w.id),w.id===n&&g(),E(null),await a?.()}catch{F(!0)}finally{V(!1)}}},[g,n,a,w]),S=t||[],U=()=>{const u=n?S.find(p=>p.id===n):null,v=u?ee(u,C):null;return e.jsxs("form",{ref:Y,onSubmit:M,className:"grid grid-cols-1 gap-3 px-3 py-3 text-left sm:grid-cols-2",children:[e.jsx("div",{className:"flex items-center justify-between sm:col-span-2",children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400",children:n?r("subscriptions.edit"):r("subscriptions.add")})}),v?e.jsxs("div",{className:"sm:col-span-2 rounded-md bg-oai-gray-50 dark:bg-oai-gray-800/50 px-2.5 py-2 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("span",{className:"text-oai-gray-400 dark:text-oai-gray-500",children:u.autoRenew?r("subscriptions.label.renews_at"):r("subscriptions.label.expires_at")})," ",e.jsx("span",{className:"font-mono tabular-nums",children:K.format(new Date(v.endMs))})," · ",e.jsx("span",{className:v.expired?"text-oai-error":void 0,children:fe(v.endMs,C)})]}):null,e.jsxs("div",{className:"flex flex-col sm:col-span-1",children:[e.jsx("label",{htmlFor:"subscription-provider",className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5",children:r("subscriptions.form.provider")}),e.jsx(ue,{id:"subscription-provider",value:l.provider,onValueChange:p=>c({...l,provider:String(p)}),options:ce,matchTriggerWidth:!0,className:"h-10 w-full px-3 text-sm"})]}),e.jsx("div",{className:"sm:col-span-1",children:e.jsx(je,{label:r("subscriptions.form.plan"),value:l.plan,maxLength:120,placeholder:r("subscriptions.form.plan_placeholder"),onChange:p=>c({...l,plan:p.target.value})})}),e.jsxs("div",{className:"flex flex-col sm:col-span-1",children:[e.jsx("label",{htmlFor:"subscription-cycle",className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5",children:r("subscriptions.form.cycle")}),e.jsx(ue,{id:"subscription-cycle",value:l.cycle,onValueChange:p=>c({...l,cycle:String(p)}),options:X,matchTriggerWidth:!0,className:"h-10 w-full px-3 text-sm"})]}),e.jsxs("div",{className:"flex flex-col sm:col-span-1",children:[e.jsx("label",{htmlFor:"subscription-auto-renew",className:"block text-sm font-medium text-oai-gray-700 dark:text-oai-gray-300 mb-1.5",children:r("subscriptions.form.auto_renew")}),e.jsx(ue,{id:"subscription-auto-renew",value:String(l.autoRenew),onValueChange:p=>c({...l,autoRenew:p==="true"}),options:de,matchTriggerWidth:!0,className:"h-10 w-full px-3 text-sm"})]}),e.jsx("div",{className:"sm:col-span-2",children:e.jsx(je,{label:r("subscriptions.form.started_at"),type:"datetime-local",value:l.startedAt,required:!0,onChange:p=>c({...l,startedAt:p.target.value})})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 sm:col-span-2",children:[n?e.jsx(B,{type:"button",variant:"secondary",size:"sm",onClick:()=>{const p=S.find(y=>y.id===n);p&&E(p)},className:"!text-red-600 dark:!text-red-400 mr-auto",children:r("subscriptions.delete")}):null,b?e.jsx("p",{className:"mr-auto text-sm text-oai-error",role:"alert",children:r("subscriptions.form.provider_required")}):null,T?e.jsx("p",{className:"mr-auto text-sm text-oai-error",role:"alert",children:r("subscriptions.form.provider_taken")}):null,h?e.jsx("p",{className:"mr-auto text-sm text-oai-error",role:"alert",children:r("subscriptions.form.error")}):null,e.jsx(B,{type:"button",variant:"secondary",size:"sm",onClick:g,children:r("shared.action.cancel")}),e.jsx(B,{type:"submit",size:"sm",disabled:d,children:r("subscriptions.save")})]})]})};return e.jsxs("div",{className:"flex max-h-[min(80vh,42rem)] w-[min(92vw,32rem)] flex-col gap-3 overflow-y-auto rounded-xl border border-oai-gray-200 bg-white p-4 shadow-lg dark:border-oai-gray-700 dark:bg-oai-gray-900",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("span",{className:"block truncate text-sm font-semibold text-oai-black dark:text-white",children:r("limits.page.openSubscriptions")})}),e.jsxs(B,{type:"button",size:"sm",onClick:H,className:"shrink-0 gap-1.5",children:[e.jsx(Nt,{size:14,strokeWidth:2,"aria-hidden":!0}),e.jsx("span",{children:r("subscriptions.add")})]})]}),S.length===0&&!(i&&!n)?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 rounded-lg border border-dashed border-oai-gray-200 px-4 py-10 text-center dark:border-oai-gray-700",children:[e.jsx(Fe,{className:"h-6 w-6 text-oai-gray-300 dark:text-oai-gray-600 mb-2","aria-hidden":!0}),e.jsx("p",{className:"text-sm font-medium text-oai-black dark:text-white",children:r("subscriptions.empty.title")}),e.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:r("subscriptions.empty.body")})]}):e.jsxs("ul",{className:"flex flex-col gap-1.5",children:[S.map(u=>{const v=ee(u,C);if(!v)return null;const{endMs:p,expired:y}=v,O=y?100:v.progress*100,nt=!y&&p-C<=3*864e5,st=se===u.id;return e.jsxs("li",{className:"rounded-lg border border-oai-gray-100 dark:border-oai-gray-800",children:[e.jsxs("button",{type:"button",onClick:()=>$(u),"aria-label":`${r("subscriptions.edit")} ${u.service}`,"aria-expanded":n===u.id,className:"w-full flex flex-col gap-1.5 px-3 py-2.5 text-left cursor-pointer hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/40 rounded-lg transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Ae,{provider:He(u.provider)||"OTHER",size:14}),e.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-white truncate",children:u.service}),e.jsx("span",{role:"img","aria-label":u.autoRenew?r("subscriptions.badge.auto_renew"):r("subscriptions.badge.stops"),title:u.autoRenew?r("subscriptions.badge.auto_renew"):r("subscriptions.badge.stops"),className:`inline-flex shrink-0 translate-y-px ${u.autoRenew?"text-oai-brand-600 dark:text-oai-brand-400":"text-blue-600 dark:text-blue-400"}`,children:u.autoRenew?e.jsx(Ge,{size:14,strokeWidth:2,"aria-hidden":!0}):e.jsx(Ue,{size:14,strokeWidth:2,"aria-hidden":!0})}),u.plan?e.jsx("span",{className:"text-xs rounded-full border border-oai-gray-200 dark:border-oai-gray-700 px-2 py-0.5 text-oai-gray-500 dark:text-oai-gray-400 shrink-0",children:u.plan}):null]}),e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[10px] text-oai-gray-500 dark:text-oai-gray-400 shrink-0",children:r("subscriptions.inline.label")}),e.jsx("span",{className:"relative flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1 overflow-hidden",children:e.jsx("span",{className:`${y?"bg-red-500":nt?"bg-amber-500":"bg-blue-500"} rounded-full h-full block transition-[width] duration-500 ease-out`,style:{width:`${O}%`,minWidth:O>0?"3px":0}})}),e.jsx("span",{className:`text-[10px] tabular-nums shrink-0 ${y?"text-oai-error":"text-oai-gray-400 dark:text-oai-gray-500"}`,children:qe(p,C)})]})]}),n===u.id?e.jsx("div",{className:"border-t border-oai-gray-100 dark:border-oai-gray-800",children:U()}):null,n!==u.id&&st?e.jsxs("div",{className:"px-3 pb-3 flex flex-col gap-2 border-t border-oai-gray-100 dark:border-oai-gray-800",children:[e.jsxs("p",{className:"pt-2 text-xs text-oai-gray-600 dark:text-oai-gray-300",children:[e.jsx("span",{className:"text-oai-gray-400 dark:text-oai-gray-500",children:u.autoRenew?r("subscriptions.label.renews_at"):r("subscriptions.label.expires_at")})," ",e.jsx("span",{className:"font-mono tabular-nums",children:K.format(new Date(p))})," · ",e.jsx("span",{className:y?"text-oai-error":void 0,children:fe(p,C)})," · ",e.jsx("span",{children:u.autoRenew?r("subscriptions.status.auto_renew"):r("subscriptions.status.manual")})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(B,{type:"button",variant:"secondary",size:"sm",onClick:()=>$(u),children:r("subscriptions.edit")})})]}):null]},u.id)}),i&&!n?e.jsx("li",{className:"rounded-lg border border-oai-gray-100 dark:border-oai-gray-800",children:U()}):null]}),e.jsx(jt,{open:!!w,title:r("subscriptions.confirm_delete_title"),description:w?.service||"",error:ne?r("subscriptions.delete_error"):null,confirmLabel:r("subscriptions.delete"),cancelLabel:r("shared.action.cancel"),destructive:!0,busy:q,onCancel:()=>{E(null),F(!1)},onConfirm:J})]})}const De=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"),fa="x-apple.systempreferences:com.apple.preference.notifications";function ba(){const t=Dt(),a=mt(),i=r("limits.alert.blocked"),s=a?ke.button:ke.div;return e.jsxs(s,{type:a?"button":void 0,onClick:a?()=>xt({type:"action",name:"openURL",value:fa}):void 0,initial:t?!1:{opacity:0,x:14,scale:.9},animate:{opacity:1,x:0,scale:1},transition:{type:"spring",stiffness:320,damping:18},title:i,className:`relative hidden sm:inline-flex min-w-0 max-w-[360px] items-center gap-1.5 rounded-full border border-amber-300/70 bg-amber-50 px-3 py-1.5 text-xs text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300 ${a?"cursor-pointer transition-colors hover:bg-amber-100 dark:hover:bg-amber-500/20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-500/60":""}`,children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-amber-500"})]}),e.jsx("span",{className:"truncate",children:i}),e.jsx("span",{"aria-hidden":!0,className:"absolute left-full top-1/2 -translate-y-1/2 border-[5px] border-transparent border-l-amber-300/80 dark:border-l-amber-500/40"})]})}function Wa(){const t=lt(),{data:a,error:i,isLoading:s}=ht(t?{initialRefresh:!0,initialState:t,publishToPreloadCache:!0}:{initialRefresh:!0,publishToPreloadCache:!0}),n=yt(),o=ft(),[l,c]=D.useState([]),[d,m]=D.useState(!1),[h,f]=D.useState(!1),[b]=ct(),N=D.useRef(0),T=D.useCallback(async()=>{if(!De&&!ve())return;const _=++N.current;try{const w=await ua();if(_!==N.current)return;c(w),m(!1)}catch{if(_!==N.current)return;m(!0)}},[]);return D.useEffect(()=>{T()},[T]),D.useEffect(()=>{b.get("openSubscriptions")==="1"&&f(!0)},[b]),D.useEffect(()=>{o.enabled&&a&&bt(a)},[o.enabled,a]),!De&&!ve()?e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx(wt,{})}):e.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:e.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[e.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:r("nav.limits")}),e.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:r("limits.page.subtitle")})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.enabled&&o.permissionBlocked?e.jsx(ba,{}):null,e.jsxs(_t,{open:h,onOpenChange:f,children:[e.jsx(Ct,{"aria-label":r("limits.page.openSubscriptions"),title:r("limits.page.openSubscriptions"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:e.jsx(Fe,{className:"h-4 w-4","aria-hidden":!0})}),e.jsx(Pt,{children:e.jsx(Mt,{side:"bottom",align:"end",sideOffset:8,className:"z-50",children:e.jsx(St,{children:e.jsx(ha,{subscriptions:l,onChanged:T})})})})]}),e.jsx("button",{type:"button",onClick:()=>{o.setEnabled(!o.enabled)},"aria-label":o.enabled?r("limits.alert.disable"):r("limits.alert.enable"),title:o.enabled?r("limits.alert.disable"):r("limits.alert.enable"),className:`inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 ${o.enabled&&o.permissionBlocked?"text-amber-600 dark:text-amber-400":"text-oai-gray-600 dark:text-oai-gray-400 hover:text-oai-black dark:hover:text-white"}`,children:o.enabled?e.jsx(Et,{className:"h-4 w-4","aria-hidden":!0}):e.jsx(Tt,{className:"h-4 w-4","aria-hidden":!0})}),e.jsx(dt,{to:"/settings?section=limits","aria-label":r("limits.page.openSettings"),title:r("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:e.jsx(ut,{className:"h-4 w-4","aria-hidden":!0})})]})]}),s?e.jsx(Rt,{}):e.jsxs(e.Fragment,{children:[i?e.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:r("shared.error.prefix",{error:i})}):null,d?e.jsx("p",{className:"mb-4 text-sm text-amber-600 dark:text-amber-400",children:r("subscriptions.load_error")}):null,e.jsx(da,{claude:a?.claude,codex:a?.codex,cursor:a?.cursor,gemini:a?.gemini,kimi:a?.kimi,kiro:a?.kiro,grok:a?.grok,antigravity:a?.antigravity,copilot:a?.copilot,zcode:a?.zcode,opencodeGo:a?.opencodeGo,commandCode:a?.commandCode,qoder:a?.qoder,qoderCn:a?.qoderCn,codingPlan:a?.codingPlan,agentPlan:a?.agentPlan,devin:a?.devin,order:n.order,visibility:n.visibility,displayMode:n.displayMode,subscriptions:l,showSubscriptions:n.showSubscriptions!==!1})]})]})})})}export{Wa as LimitsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as me,aa as xe,a as he,r as o,F as ae,c as a,j as e,J as h}from"./__vite-browser-external-DUJeOWgd.js";import{A as be}from"./arrow-left-BEM-HVmC.js";const te={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};te.node;const fe=me(te),pe=e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),e.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23Z",fill:"#34A853"}),e.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18A10.96 10.96 0 0 0 1 12c0 1.77.42 3.44 1.18 4.93l3.66-2.84Z",fill:"#FBBC05"}),e.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53Z",fill:"#EA4335"})]}),ye=e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),we={google:pe,github:ye},ke={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",apple:"Apple"};function ve(i){return ke[i]||String(i||"").replace(/-/g," ")}function je(i){if(typeof i=="string"&&i.trim())return i.trim();if(i&&typeof i=="object"){if(typeof i.token=="string"&&i.token.trim())return i.token.trim();if(typeof i.otp=="string"&&i.otp.trim())return i.otp.trim()}return""}function Ce({title:i,subtitle:D,className:oe="",onSuccess:S,hideLogo:H=!1,initialMode:p="signin",tokenFromUrl:P="",initialEmail:y="",initialCode:v=""}){xe();const{enabled:w,configurationError:se,connectionHost:G,signedIn:j,refreshUser:A,signInWithPassword:Z,signUp:T,signInWithOAuth:U,getPublicAuthConfig:V,sendResetPasswordEmail:$,exchangeResetPasswordToken:W,resetPassword:z}=he(),[n,u]=o.useState(p),[c,k]=o.useState(y),[m,N]=o.useState(""),[E,L]=o.useState(""),[F,ie]=o.useState(""),[R,J]=o.useState(v),[_,x]=o.useState(!1),[K,s]=o.useState(null),[C,b]=o.useState(null),[q,O]=o.useState(!1),[ne,le]=o.useState(!!(p!=="signin"||y)),[M,Q]=o.useState(!0),[I,X]=o.useState([]),[Y,de]=o.useState(8);o.useEffect(()=>{p&&u(p)},[p]),o.useEffect(()=>{y&&k(y)},[y]),o.useEffect(()=>{v&&J(v)},[v]),o.useEffect(()=>{if(!w)return;let r=!0;return Q(!0),(async()=>{const{data:t,error:l}=await V();if(r){if(l||!t)X(["google","github"]);else{const d=Array.isArray(t.oAuthProviders)?t.oAuthProviders:[],f=Array.isArray(t.customOAuthProviders)?t.customOAuthProviders:[];X([...d,...f]),typeof t.passwordMinLength=="number"&&t.passwordMinLength>0&&de(t.passwordMinLength)}Q(!1)}})(),()=>{r=!1}},[w,V]),o.useEffect(()=>{j&&S&&S()},[j,S]);const ee=o.useCallback(()=>{if(typeof window>"u")return"";const r=new URLSearchParams(window.location.search).get("next");return!ae()&&/^\/(cloud|billing\/checkout)(\?|$)/.test(r||"")?`${window.location.origin}/dashboard`:ae()?"tokentracker://auth/callback":`${window.location.origin}/`},[]),re=o.useMemo(()=>typeof window>"u"?"/reset-password":`${window.location.origin}/reset-password`,[]),B=o.useCallback(async r=>{s(null),x(!0);try{const{error:t}=await U(r,ee());t&&s(t.message||String(t))}finally{x(!1)}},[U,ee]);o.useEffect(()=>{if(!w||M||j||typeof window>"u")return;const r=window.location.search;if(!r)return;const t=new URLSearchParams(r),l=t.get("native")==="1",d=t.get("provider");l&&d&&[...I].includes(d)&&B(d)},[w,M,j,I,B]);const ce=o.useCallback(async r=>{r.preventDefault(),s(null),x(!0);try{if(n==="signup"){const{data:l,error:d}=await T({email:c.trim(),password:m,name:F.trim()||void 0});if(d){s(d.message||String(d));return}if(l?.requireEmailVerification){b(a("login.verify_email_pending")),u("signin");return}await A();return}const{error:t}=await Z({email:c.trim(),password:m});if(t){s(t.message||String(t));return}await A()}finally{x(!1)}},[n,c,m,F,T,Z,A]),ge=o.useCallback(async r=>{r.preventDefault(),s(null),x(!0);try{const t=c.trim(),{error:l}=await $({email:t,redirectTo:re});if(l){s(l.message||String(l));return}k(t),b(a("reset_password.request.sent")),u("reset_confirm")}finally{x(!1)}},[c,re,$]),ue=o.useCallback(async r=>{if(r.preventDefault(),s(null),m!==E){s(a("reset_password.error.password_mismatch"));return}x(!0);try{let t=P;if(!t){const{data:d,error:f}=await W({email:c.trim(),code:R.trim()});if(f){s(f.message||String(f));return}if(t=je(d),!t){s(a("reset_password.error.missing_token"));return}}const{error:l}=await z({newPassword:m,otp:t});if(l){s(l.message||String(l));return}O(!0),b(a("reset_password.success"))}finally{x(!1)}},[R,E,c,W,m,z,P]);if(!w)return se?e.jsx("p",{role:"alert",className:"p-4 text-sm leading-6 text-oai-gray-700 dark:text-oai-gray-300",children:a("instance.configuration.invalid")}):null;const g=n==="reset_email"||n==="reset_confirm";return e.jsxs("div",{className:h("w-full bg-white dark:bg-oai-gray-950 p-6 transition-colors duration-200",oe),children:[g&&e.jsxs("button",{type:"button",onClick:()=>{u("signin"),b(null),s(null),O(!1),N(""),L("")},className:"flex items-center gap-1.5 text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors mb-4 focus:outline-none",children:[e.jsx(be,{className:"h-3.5 w-3.5"}),a("reset_password.back_to_sign_in")]}),e.jsxs("div",{className:h("mb-6",g?"text-left":"text-center"),children:[!H&&!g&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:28,height:28,className:"rounded-md"}),e.jsx("span",{className:"text-lg font-semibold text-oai-black dark:text-white font-oai tracking-tight",children:a("shared.app_name")})]}),e.jsx("h2",{className:h("text-sm font-semibold text-oai-black dark:text-white tracking-tight mb-1",(H||g)&&"text-base font-bold md:text-lg"),children:g?a("reset_password.title"):i||a("login_modal.subtitle")}),!g&&D&&e.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px] mx-auto",children:D}),g&&e.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400 mt-1.5 leading-relaxed max-w-[320px]",children:C&&n==="reset_confirm"&&!q?C:a("reset_password.subtitle")})]}),G?e.jsx("p",{className:"mb-4 text-center text-sm leading-6 text-oai-gray-600 dark:text-oai-gray-300",children:a("instance.connection.destination",{host:G})}):null,C&&(!g||q)&&e.jsx("div",{className:"mb-4 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900/50 px-3 py-2 text-xs text-oai-gray-700 dark:text-oai-gray-300",children:C}),K&&e.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400 text-center",role:"alert",children:K}),n==="reset_email"&&e.jsxs("form",{onSubmit:ge,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-reset-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("login.field.email")}),e.jsx("input",{id:"card-reset-email",type:"email",autoComplete:"email",required:!0,value:c,onChange:r=>k(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsx("button",{type:"submit",disabled:_,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:a("reset_password.request.submit")})]}),n==="reset_confirm"&&(q?e.jsx("button",{type:"button",onClick:()=>{u("signin"),O(!1),b(null),s(null),N(""),L("")},className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors text-center shadow-sm",children:a("reset_password.success_cta")}):e.jsxs("form",{onSubmit:ue,className:"space-y-3",children:[!P&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-reset-email-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("login.field.email")}),e.jsx("input",{id:"card-reset-email-confirm",type:"email",autoComplete:"email",required:!0,value:c,onChange:r=>k(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-reset-code",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("reset_password.field.code")}),e.jsx("input",{id:"card-reset-code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",required:!0,value:R,onChange:r=>J(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-reset-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("reset_password.field.new_password")}),e.jsx("input",{id:"card-reset-password",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:m,onChange:r=>N(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-reset-password-confirm",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("reset_password.field.confirm_password")}),e.jsx("input",{id:"card-reset-password-confirm",type:"password",autoComplete:"new-password",required:!0,minLength:8,value:E,onChange:r=>L(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsx("button",{type:"submit",disabled:_,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:a("reset_password.reset.submit")})]})),!g&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-2.5 mb-5",children:M?e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"}),e.jsx("div",{className:"h-10 rounded-lg bg-oai-gray-100 dark:bg-oai-gray-900/50 animate-pulse"})]}):I.map(r=>e.jsxs("button",{type:"button",disabled:_,onClick:()=>B(r),className:h("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors disabled:opacity-50","flex items-center justify-center gap-2.5"),children:[we[r]||null,a("login.oauth.continue",{provider:ve(r)})]},r))}),ne?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative mb-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:a("login_modal.divider_email")})})]}),e.jsxs("div",{className:"flex rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 p-0.5 bg-oai-gray-50 dark:bg-oai-gray-900/50 mb-4",children:[e.jsx("button",{type:"button",className:h("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",n==="signin"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{u("signin"),s(null)},children:a("login.tab.sign_in")}),e.jsx("button",{type:"button",className:h("flex-1 py-1.5 text-xs font-medium rounded-md transition-colors",n==="signup"?"bg-white dark:bg-oai-gray-800 text-oai-black dark:text-white shadow-sm":"text-oai-gray-500 hover:text-oai-gray-700 dark:hover:text-oai-gray-300"),onClick:()=>{u("signup"),s(null)},children:a("login.tab.sign_up")})]}),e.jsxs("form",{onSubmit:ce,className:"space-y-3",children:[n==="signup"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("login.field.name")}),e.jsx("input",{id:"card-name",type:"text",autoComplete:"name",value:F,onChange:r=>ie(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:a("login.field.name_placeholder")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("login.field.email")}),e.jsx("input",{id:"card-email",type:"email",autoComplete:"email",required:!0,value:c,onChange:r=>k(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"card-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:a("login.field.password")}),e.jsx("input",{id:"card-password",type:"password",autoComplete:n==="signup"?"new-password":"current-password",required:!0,minLength:n==="signup"?Y:void 0,value:m,onChange:r=>N(r.target.value),className:"w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-oai-gray-50 dark:bg-oai-gray-900 px-3 text-sm text-oai-black dark:text-white placeholder-oai-gray-400 dark:placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),n==="signup"&&e.jsx("p",{className:"mt-1 text-xs text-oai-gray-400 dark:text-oai-gray-600",children:a("login.password_hint",{min:String(Y)})}),n==="signin"&&e.jsx("div",{className:"mt-1 text-right",children:e.jsx("button",{type:"button",onClick:()=>{u("reset_email"),s(null),b(null)},className:"text-xs font-medium text-oai-gray-500 hover:text-oai-black dark:hover:text-white no-underline bg-transparent border-0 p-0 cursor-pointer focus:outline-none",children:a("login.forgot_password")})})]}),e.jsx("button",{type:"submit",disabled:_,className:"w-full h-10 rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:n==="signup"?a("login.submit.sign_up"):a("login.submit.sign_in")})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative mb-5",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t border-oai-gray-200 dark:border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-white dark:bg-oai-gray-950 px-3 text-oai-gray-400 dark:text-oai-gray-600",children:a("login.divider")})})]}),e.jsxs("button",{type:"button",onClick:()=>le(!0),className:h("w-full h-10 rounded-lg border border-oai-gray-200 dark:border-oai-gray-700 bg-oai-gray-50 dark:bg-oai-gray-900 text-sm font-medium text-oai-black dark:text-white","hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:border-oai-gray-300 dark:hover:border-oai-gray-600 transition-colors","flex items-center justify-center gap-2.5"),children:[e.jsx(fe,{className:"h-[18px] w-[18px] text-oai-gray-500 dark:text-oai-gray-400",strokeWidth:1.75}),a("login_modal.continue_email")]})]})]})]})}export{Ce as L};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as s,a as c,r as l,j as e,X as d}from"./__vite-browser-external-DUJeOWgd.js";import{m as o}from"./react-B7SkZTgg.js";import{L as m}from"./LoginCard-Dn5Xy4If.js";import{A as p}from"./index-BImBG3eS.js";import"./arrow-left-BEM-HVmC.js";function f(){const{isOpen:i,closeLoginModal:t}=s(),{enabled:r}=c();return l.useEffect(()=>{if(!i)return;const a=n=>{n.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[i,t]),r?e.jsx(p,{children:i&&e.jsxs(o.div,{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[e.jsx(o.div,{className:"absolute inset-0 bg-black/40 dark:bg-black/60",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),e.jsxs(o.div,{className:"relative w-full max-w-[420px] rounded-2xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-950 shadow-2xl overflow-hidden",initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},onClick:a=>a.stopPropagation(),children:[e.jsx("button",{type:"button",onClick:t,className:"absolute right-4 top-4 z-10 text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(d,{className:"h-5 w-5"})}),e.jsx(m,{onSuccess:t,className:"p-6 bg-transparent"})]})]})}):null}export{f as LoginModal};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as w,e as v,a as j,r,c as s,j as e,L as b}from"./__vite-browser-external-DUJeOWgd.js";import{L as N}from"./LoginCard-Dn5Xy4If.js";import"./arrow-left-BEM-HVmC.js";function _(n){const t=new URLSearchParams(n).get("next");return typeof t!="string"||t.length===0||!t.startsWith("/")||t.startsWith("//")?"/dashboard":t}function E(){const n=w(),[t,u]=v(),{enabled:o,configurationError:f,loading:g,signedIn:m,refreshUser:x}=j(),i=r.useMemo(()=>_(t.toString()),[t]),[h,d]=r.useState(null);r.useEffect(()=>{if(/^\/(cloud|billing\/checkout)(\?|$)/.test(i))try{window.sessionStorage.setItem("tt.cloud.return",i)}catch{}},[i]),r.useEffect(()=>{const l=t.get("insforge_status"),a=t.get("insforge_type"),y=t.get("insforge_error");l==="success"&&a==="verify_email"?d(s("login.verify_email_success")):l==="error"&&a==="verify_email"&&y&&d(s("shared.error.prefix",{error:y}))},[t]);const c=r.useMemo(()=>t.get("native")==="1",[t]);r.useEffect(()=>{if(!(!o||g)&&m){if(c){window.location.href="/auth/native-callback";return}try{window.sessionStorage.removeItem("tt.cloud.return")}catch{}n(i,{replace:!0})}},[o,g,m,n,i,c]),r.useEffect(()=>{o&&x()},[o,x]),r.useEffect(()=>{if(c&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[c]);const p=r.useCallback(()=>{u(l=>{const a=new URLSearchParams(l);return a.delete("insforge_status"),a.delete("insforge_type"),a.delete("insforge_error"),a},{replace:!0}),d(null)},[u]);return o?e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:e.jsx(b,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 rounded",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md space-y-6",children:[h?e.jsxs("div",{className:"rounded-lg border border-oai-gray-800 bg-oai-gray-900/50 px-4 py-3 text-sm text-oai-gray-300 flex justify-between gap-3 items-start",role:"status",children:[e.jsx("span",{children:h}),e.jsx("button",{type:"button",onClick:p,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:s("login.dismiss")})]}):null,e.jsx("div",{className:"border border-oai-gray-900 bg-oai-gray-950 rounded-2xl overflow-hidden shadow-2xl",children:e.jsx(N,{hideLogo:!0,title:s("login.title"),subtitle:s("login.subtitle"),className:"p-8 bg-transparent",onSuccess:()=>{if(c)window.location.href="/auth/native-callback";else{try{window.sessionStorage.removeItem("tt.cloud.return")}catch{}n(i,{replace:!0})}}})})]})})]}):e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 py-4",children:e.jsx(b,{to:"/",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:s("login.back_home")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4",children:e.jsx("p",{className:"text-oai-gray-400 text-center max-w-md",role:f?"alert":void 0,children:f?s("instance.configuration.invalid"):s("login.cloud_only")})})]})}export{E as LoginPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,bc as V,bd as re,aP as Q,be as J,bf as ae,a0 as ie,bg as ce,an as Z,bh as $,aH as ue,j as d,bi as le,$ as z,bj as pe,bk as de,bl as ge,aT as fe,bm as me,bn as Pe,bo as he,Z as Ce,_ as te,bp as Se,bq as X,br as Te,bs as be,bt as ve,aK as xe,bu as Re,aJ as Ie,bv as Ee,bw as Oe}from"./__vite-browser-external-DUJeOWgd.js";import{p as ye,c as Fe}from"./store-C9yWYHfg.js";import{d as Me,e as ke,P as je,f as we,h as Ae,j as He,k as Be,l as Ge,m as Ne,n as _e,o as Le,u as Ke,p as Ue,q as De,t as Ve,r as qe,I as Ye,s as Je,v as Ze,w as $e,x as ze,C as Qe,y as We}from"./composite-B4Z3F65o.js";import{k as Xe,l as et,m as tt,n as ot}from"./SelectItemText-C7xi8iGp.js";import{u as nt,a as st,s as rt,b as at}from"./safePolygon-CKpREa4K.js";import{u as it,a as ct,g as ut}from"./usePositioner-B0j1orGj.js";const oe=a.createContext(void 0);function K(e){const o=a.useContext(oe);if(o===void 0&&!e)throw new Error(V(47));return o}const lt={...ye,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class pt extends re{constructor(o,t,i){const s=new je;super(dt(o,s,t,i),gt(s),lt)}setOpen=(o,t)=>{const i=t.reason===Q,s=t.reason===J&&t.event.detail===0,g=!o&&(t.reason===ae||t.reason==null),l=Me(t),c=this.select("activeTriggerId");if(!o&&t.reason===ie&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(o,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(o,t);const f=()=>{const m=ke(this.state,o,t.trigger,l());m.openChangeReason=t.reason,this.update(m)};i?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(ce,()=>{this.set("stickIfOpen",!1)}),Z.flushSync(f)):f();let n;s?n="click":g?n="dismiss":t.reason===$&&(n="focus"),this.set("instantType",n)}}function dt(e,o,t,i=!1){const s={...Fe(o,t,i),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&e?.mounted===void 0&&(s.mounted=!0),s}function gt(e){return{popupRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:a.createRef(),beforeContentFocusGuardRef:a.createRef(),stickIfOpenTimeout:new ue,triggerElements:e}}const ee=le(function({props:o}){const{children:t,open:i,defaultOpen:s=!1,onOpenChange:g,onOpenChangeComplete:l,modal:c=!1,handle:f,triggerId:n,defaultTriggerId:m=null}=o,r=ft(f,{modal:c,open:s,openProp:i,activeTriggerId:m,triggerIdProp:n});r.useControlledProp("openProp",i),r.useControlledProp("triggerIdProp",n);const P=r.useState("open"),I=r.useState("mounted"),T=r.useState("payload");r.useContextCallback("onOpenChange",g),r.useContextCallback("onOpenChangeComplete",l),Ae(r,P),He(r);const{forceUnmount:v}=Be(P,r,()=>{r.update({stickIfOpen:!0,openChangeReason:null})});r.useSyncedValues({modal:c}),a.useEffect(()=>{P||r.context.stickIfOpenTimeout.clear()},[r,P]),a.useImperativeHandle(o.actionsRef,()=>({unmount:v,close:()=>r.setOpen(!1,z(pe))}),[v,r]);const y=P||I;return d.jsxs(oe.Provider,{value:r,children:[f&&d.jsx(Ge,{handle:f,store:r}),y&&d.jsx(mt,{store:r,modal:c}),typeof t=="function"?t({payload:T}):t]})});function yt(e){return K(!0)?d.jsx(ee,{props:e}):d.jsx(we,{children:d.jsx(ee,{props:e})})}function ft(e,o){const t=Ne((i,s)=>new pt(o,i,s));return a.useEffect(()=>t.context.stickIfOpenTimeout.disposeEffect(),[t]),t}function mt({store:e,modal:o}){const t=e.useState("floatingRootContext"),i=_e(t,{outsidePressEvent:{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=i.reference,g=i.floating;return Le(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:g}),null}const Pt=300;function ht(e,o){const t=a.useRef(null);function i(g){Z.flushSync(()=>{e.setOpen(!1,z($,g.nativeEvent,g.currentTarget))}),Pe(t.current)?.focus()}function s(g){const l=e.select("positionerElement");if(l&&de(g,l))e.context.beforeContentFocusGuardRef.current?.focus();else{Z.flushSync(()=>{e.setOpen(!1,z($,g.nativeEvent,g.currentTarget))});let c=ge(e.context.triggerFocusTargetRef.current||o.current);for(;c!==null&&fe(l,c);){const f=c;if(c=me(c),c===f)break}c?.focus()}}return{preFocusGuardRef:t,handlePreFocusGuardFocus:i,handleFocusTargetFocus:s}}const Ft=he(function(o,t){const{render:i,className:s,style:g,disabled:l=!1,nativeButton:c=!0,handle:f,payload:n,openOnHover:m=!1,delay:r=Pt,closeDelay:P=0,id:I,...T}=o,v=K(!0),u=nt(f)??v;if(!u)throw new Error(V(74));const h=Ke(I),p=u.useState("isTriggerActive",h),F=u.useState("floatingRootContext"),E=u.useState("isOpenedByTrigger",h),M=u.useState("triggerPopupId",h),C=a.useRef(null),{registerTrigger:b,isMountedByThisTrigger:x}=Ue(h,C,u,{payload:n,disabled:l,openOnHover:m,closeDelay:P}),O=u.useState("openChangeReason"),B=u.useState("stickIfOpen"),G=u.useState("openMethod"),k=u.useState("focusManagerModal"),N=st(F,{enabled:!l&&m&&(G!=="touch"||O!==J),mouseOnly:!0,move:!1,handleClose:rt(),restMs:r,delay:{close:P},triggerElementRef:C,isActiveTrigger:p,isClosing:()=>u.select("transitionStatus")==="ending"}),j=Xe(F,{stickIfOpen:B}),_=et(()=>u.select("open"),R=>{u.set("openMethod",R)}),w=u.useState("triggerProps",x),{getButtonProps:A,buttonRef:S}=Ce({disabled:l,native:c}),U={open(R){return R&&O===J?De.open(R):Ve.open(R)}},{preFocusGuardRef:D,handlePreFocusGuardFocus:q,handleFocusTargetFocus:Y}=ht(u,C),H=te("button",o,{state:{disabled:l,open:E},ref:[S,t,b,C],props:[j.reference,N,w,_,{[Se]:"",id:h,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":M},T,A],stateAttributesMapping:U}),L=d.jsx(a.Fragment,{children:H},h);return x&&!k?d.jsxs(a.Fragment,{children:[d.jsx(X,{ref:D,onFocus:q}),L,d.jsx(X,{ref:u.context.triggerFocusTargetRef,onFocus:Y})]}):L}),ne=a.createContext(void 0);function Ct(){const e=a.useContext(ne);if(e===void 0)throw new Error(V(45));return e}const Mt=a.forwardRef(function(o,t){const{keepMounted:i=!1,...s}=o;return K().useState("mounted")||i?d.jsx(ne.Provider,{value:i,children:d.jsx(Te,{ref:t,...s})}):null}),se=a.createContext(void 0);function St(){const e=a.useContext(se);if(!e)throw new Error(V(46));return e}const kt=a.forwardRef(function(o,t){const{render:i,className:s,style:g,anchor:l,positionMethod:c,side:f,align:n,sideOffset:m,alignOffset:r,collisionBoundary:P="clipping-ancestors",collisionPadding:I,arrowPadding:T,sticky:v,disableAnchorTracking:y=!1,collisionAvoidance:u=be,...h}=o,p=K(),F=Ct(),E=qe(),M=p.useState("floatingRootContext"),C=p.useState("mounted"),b=p.useState("open"),x=p.useState("openChangeReason"),O=p.useState("activeTriggerElement"),B=p.useState("modal"),G=p.useState("openMethod"),k=p.useState("positionerElement"),N=p.useState("instantType"),j=p.useState("transitionStatus"),_=p.useState("adaptiveOrigin"),w=a.useRef(null),A=ve(k),S=it({anchor:l,floatingRootContext:M,positionMethod:c,mounted:C,side:f,sideOffset:m,align:n,alignOffset:r,arrowPadding:T,collisionBoundary:P,collisionPadding:I,sticky:v,disableAnchorTracking:y,keepMounted:F,nodeId:E,collisionAvoidance:u,adaptiveOrigin:_}),U=M.useState("domReferenceElement");xe(()=>{const H=U,L=w.current;if(H&&(w.current=H),L&&H&&H!==L){p.set("instantType",void 0);const R=new AbortController;return A(()=>{p.set("instantType","trigger-change")},R.signal),()=>{R.abort()}}},[U,A,p]);const D=B===!0&&x!==Q;tt(b&&D,G==="touch",k,O);const q=p.useStateSetter("positionerElement"),Y={open:b,side:S.side,align:S.align,anchorHidden:S.anchorHidden,instant:N},W=ct(o,Y,{styles:S.positionerStyles,transitionStatus:j,props:h,refs:[t,q],hidden:!C,inert:!b});return d.jsxs(se.Provider,{value:S,children:[C&&D&&d.jsx(Ye,{inert:Re(!b),cutout:O}),d.jsx(Je,{id:E,children:W})]})}),Tt=a.createContext(void 0);function bt(){const[e,o]=a.useState(0),t=Ie(()=>(o(s=>s+1),()=>{o(s=>Math.max(0,s-1))}));return{context:a.useMemo(()=>({register:t}),[t]),hasClosePart:e>0}}const jt=a.forwardRef(function(o,t){const{render:i,className:s,style:g,initialFocus:l,finalFocus:c,...f}=o,n=K(),m=St(),r=ot()!=null,{context:P,hasClosePart:I}=bt(),T=n.useState("open"),v=n.useState("openMethod"),y=n.useState("instantType"),u=n.useState("transitionStatus"),h=n.useState("popupProps"),p=n.useState("titleElementId"),F=n.useState("descriptionElementId"),E=n.useState("modal"),M=n.useState("mounted"),C=n.useState("openChangeReason"),b=n.useState("activeTriggerElement"),x=n.useState("floatingRootContext"),O=x.useState("floatingId"),B=n.useState("disabled"),G=n.useState("openOnHover"),k=n.useState("closeDelay");Ee({open:T,ref:n.context.popupRef,onComplete(){T&&n.context.onOpenChangeComplete?.(!0)}}),at(x,{enabled:G&&!B,closeDelay:k});const N=l===void 0?Ze(n.context.popupRef):l,j=E!==!1&&I;n.useSyncedValue("focusManagerModal",j);const _=n.useStateSetter("popupElement"),w={open:T,side:m.side,align:m.align,instant:y,transitionStatus:u},A=te("div",o,{state:w,ref:[t,n.context.popupRef,_],props:[h,{id:O,role:"dialog",...ze,"aria-labelledby":p,"aria-describedby":F,onKeyDown(S){r&&Qe.has(S.key)&&S.stopPropagation()}},ut(u),f],stateAttributesMapping:We});return d.jsx($e,{context:x,openInteractionType:v,modal:j,disabled:!M||C===Q,initialFocus:N,returnFocus:c,restoreFocus:"popup",previousFocusableElement:Oe(b)?b:void 0,nextFocusableElement:n.context.triggerFocusTargetRef,beforeContentFocusGuardRef:n.context.beforeContentFocusGuardRef,children:d.jsx(Tt.Provider,{value:P,children:A})})});export{yt as P,Ft as a,Mt as b,kt as c,jt as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as p,_ as S,j as e,J as h}from"./__vite-browser-external-DUJeOWgd.js";import{u as v,a as w,b as k,L as j,s as N,S as C,c as R,d as E,C as I,e as T,f as L,g as P,h as A,i as _,j as O}from"./SelectItemText-C7xi8iGp.js";import{C as D}from"./check-CKwHc4Hv.js";const G=p.forwardRef(function(t,s){const{render:i,className:x,style:o,...l}=t,r=v(),{multiple:n,readOnly:c}=w(),{alignItemWithTriggerActive:d}=k(),g=r.useState("hasScrollArrows"),a=r.useState("openMethod"),u={id:`${r.useState("id")}-list`,role:"listbox","aria-multiselectable":n||void 0,"aria-readonly":c||void 0,onScroll(f){r.context.scrollHandlerRef.current?.(f.currentTarget)},...d&&{style:j},className:g&&a!=="touch"?N.className:void 0},y=r.useStateSetter("listElement");return S("div",t,{ref:[s,y],props:[u,l]})}),M="relative inline-flex items-center justify-between gap-2 rounded-lg border border-oai-gray-200 bg-white text-oai-black transition-colors hover:border-oai-gray-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500 dark:border-oai-gray-800 dark:bg-oai-gray-900 dark:text-white dark:hover:border-oai-gray-700";function F({value:m,onValueChange:t,options:s=[],ariaLabel:i,id:x,disabled:o=!1,leadingIcon:l=null,className:r="",popupClassName:n="",align:c="start",matchTriggerWidth:d=!1}){const g=s.map(a=>({value:a.value,label:a.label}));return e.jsxs(C,{value:m,items:g,disabled:o,onValueChange:a=>{!o&&a!=null&&t?.(a)},children:[e.jsxs(R,{id:x,"aria-label":i,className:h(M,o&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800",r),children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[l,e.jsx(E,{className:"truncate"})]}),e.jsx(I,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]}),e.jsx(T,{children:e.jsx(L,{align:c,side:"bottom",sideOffset:4,className:"z-50",children:e.jsx(P,{className:h("max-h-[min(18rem,var(--available-height))] origin-[var(--transform-origin)] overflow-y-auto","rounded-xl border border-oai-gray-200 bg-white p-1 shadow-lg ring-1 ring-black/[0.04]","dark:border-oai-gray-700 dark:bg-oai-gray-900 dark:ring-white/[0.05]","transition-[opacity,transform] duration-150 ease-out","data-[starting-style]:scale-95 data-[starting-style]:opacity-0","data-[ending-style]:scale-95 data-[ending-style]:opacity-0",d&&"min-w-[var(--anchor-width)]",n),children:e.jsx(G,{role:"listbox","aria-label":i,children:s.map(a=>e.jsxs(A,{value:a.value,disabled:a.disabled,className:({selected:b,disabled:u})=>h("flex w-full cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-lg py-1.5 pl-1.5 pr-6","text-left text-xs outline-none transition-colors",b?"bg-oai-gray-100 text-oai-black dark:bg-oai-gray-800/70 dark:text-white":"text-oai-gray-600 hover:bg-oai-gray-50 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800/60",u&&"cursor-not-allowed opacity-50 hover:bg-transparent dark:hover:bg-transparent"),children:[e.jsx("span",{className:"flex w-3.5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-300",children:e.jsx(_,{children:e.jsx(D,{className:"h-3 w-3","aria-hidden":!0})})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.jsx(O,{children:a.label})})]},String(a.value)))})})})})]})}export{F as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as wn,be as vn,r as o,cL as st,aI as $e,aQ as Kt,b$ as Mn,a1 as Ge,$ as pe,cI as Pn,aF as ke,aK as q,aL as On,cM as Yt,cJ as An,aJ as Y,cZ as Dt,c_ as mt,c$ as kt,bZ as ht,aM as Ne,aT as Ee,d0 as Nt,bw as Ht,d1 as Je,bh as $t,bX as Gt,d2 as ct,d3 as ut,d4 as Xt,d5 as Tt,cT as Ln,d6 as Vn,d7 as bt,cY as Fn,bc as He,aD as te,j as ae,bv as Et,bP as yt,bO as Dn,bR as kn,bS as Nn,bT as it,bd as Hn,cO as _n,bz as rt,cG as Un,Z as Jt,_ as _e,d8 as Bn,br as Wn,d9 as jn,bu as zn,aO as qn,da as Kn,bN as Zt,db as xt}from"./__vite-browser-external-DUJeOWgd.js";import{i as St,E as Qt,b as en,F as Yn,P as $n,c as Oe,a as Gn,G as Xn,H as Ie,J as tn,A as Jn,u as Zn,B as nn,n as Qn,x as er,q as tr,I as nr,w as rr,z as or,C as sr}from"./composite-B4Z3F65o.js";import{u as ir,a as lr,b as cr,p as ur,r as ar,g as fr}from"./usePositioner-B0j1orGj.js";const rn={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};rn.node;const wo=wn(rn);function Ke(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function dr(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:l=!0,touchOpenDelay:f=0,reason:c=vn}=t,y="rootStore"in e?e.rootStore:e,b=y.context.dataRef,x=o.useRef(void 0),w=st(),m=$e(),V=o.useMemo(()=>{function v(d,_,T,p){const a=pe(c,_,T);d&&p==="touch"&&f>0?m.start(f,()=>{y.setOpen(!0,a)}):y.setOpen(d,a)}function C(d,_,T){const p=b.current.openEvent,a=y.select("domReferenceElement")!==_;return d&&a||!d||!s?!0:p&&l?!T(p.type):!1}return{onPointerDown(d){x.current=St(d.pointerType,!0)&&Qt(d.nativeEvent)?"virtual":d.pointerType},onMouseDown(d){const _=x.current,T=d.nativeEvent,p=y.select("open");if(d.button!==0||r==="click"||St(_,!0)&&i)return;const a=C(p,d.currentTarget,S=>S==="click"||S==="mousedown"),O=Kt(T);if(Mn(O)){v(a,T,O,_);return}const h=d.currentTarget;w.request(()=>{v(a,T,h,_)})},onClick(d){if(r==="mousedown-only")return;const _=x.current;if(r==="mousedown"&&_){x.current=void 0;return}if(St(_,!0)&&i)return;const T=y.select("open"),p=C(T,d.currentTarget,a=>a==="click"||a==="mousedown"||a==="keydown"||a==="keyup");v(p,d.nativeEvent,d.currentTarget,_)},onKeyDown(){x.current=void 0}}},[b,r,i,c,y,l,s,w,m,f]);return o.useMemo(()=>n?{reference:V}:Ge,[n,V])}function pr(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,s=Pn(),i=en()!=null,l=ke(()=>new Yn({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new $n,floatingId:s,syncOnly:!1,nested:i})).current;return q(()=>{const f={open:t,floatingId:s};r.reference!==void 0&&(f.referenceElement=r.reference,f.domReferenceElement=On(r.reference)?r.reference:null),r.floating!==void 0&&(f.floatingElement=r.floating),l.update(f)},[t,s,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=i,l}const gr="Escape";function _t(e){return Gt&&e.movementX===0&&e.movementY===0}function at(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ze(e,t){return at(t,e===Xt||e===Tt,e===ct||e===ut)}function Rt(e,t,n){return at(t,e===Tt,n?e===ct:e===ut)||e==="Enter"||e===" "||e===""}function mr(e,t,n){return at(t,n?e===ct:e===ut,e===Tt)}function hr(e,t,n,r){const s=n?e===ut:e===ct,i=e===Xt;return t==="both"||t==="horizontal"&&r?e===gr:at(t,s,i)}function xr(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:l=null,allowEscape:f=!1,loopFocus:c=!1,nested:y=!1,rtl:b=!1,virtual:x=!1,focusItemOnOpen:w="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:V=!0,disabledIndices:v=void 0,orientation:C="vertical",parentOrientation:d,id:_,resetOnPointerLeave:T=!0,externalTree:p,grid:a}=t,O=a!=null,h="rootStore"in e?e.rootStore:e,S=h.useState("open"),H=h.useState("floatingElement"),D=h.useState("domReferenceElement"),G=h.context.dataRef,$=Yt(H),R=An(D),F=Oe($),K=en(),J=Gn(p),z=o.useRef(w),M=o.useRef(l??-1),U=o.useRef(null),g=o.useRef(!0),E=Y(u=>{s(M.current===-1?null:M.current,u)}),A=o.useRef(!!H),L=o.useRef(S),k=o.useRef(!1),X=o.useRef(!1),ne=o.useRef(null),re=Oe(v),se=Oe(S),le=Oe(l),oe=Oe(T),fe=st(),B=st(),j=Y(()=>{function u(N){x?J?.events.emit("virtualfocus",N):ne.current=Xn(N,{sync:k.current,preventScroll:!0})}const I=n.current[M.current],Q=X.current;I&&u(I),(k.current?N=>N():N=>fe.request(N))(()=>{const N=n.current[M.current]||I;if(!N)return;I||u(N),ue&&(Q||!g.current)&&N.scrollIntoView?.({block:"nearest",inline:"nearest"})})});q(()=>{G.current.orientation=C},[G,C]),q(()=>{i&&(S&&H?(M.current=l??-1,z.current&&l!=null&&(X.current=!0,E())):A.current&&(M.current=-1,E()))},[i,S,H,l,E]),q(()=>{if(i){if(!S){k.current=!1;return}if(H)if(r==null){if(k.current=!1,le.current!=null)return;if(A.current&&(M.current=-1,j()),(!L.current||!A.current)&&z.current&&(U.current!=null||z.current===!0&&U.current==null)){let u=0;const I=()=>{n.current[0]==null?(u<2&&(u?P=>B.request(P):queueMicrotask)(I),u+=1):(M.current=U.current==null||Rt(U.current,C,b)||y?mt(n):kt(n),U.current=null,E())};I()}}else Dt(n.current,r)||(M.current=r,j(),X.current=!1)}},[i,S,H,r,le,y,n,C,b,E,j,B]),q(()=>{if(!i||H||!J||x||!A.current)return;const u=J.nodesRef.current,I=u.find(N=>N.id===K)?.context?.elements.floating,Q=ht(Ne(D??I??null)),P=u.some(N=>N.context&&Ee(N.context.elements.floating,Q));I&&!P&&g.current&&I.focus({preventScroll:!0})},[i,H,D,J,K,x]),q(()=>{L.current=S,A.current=!!H}),q(()=>{S||(U.current=null,z.current=w)},[S,w]);const ce=r!=null,Z=Y(u=>{if(!se.current)return;const I=n.current.indexOf(u.currentTarget);I!==-1&&(M.current!==I||r!==I)&&(M.current=I,E(u))}),ge=Y(()=>d??J?.nodesRef.current.find(u=>u.id===K)?.context?.dataRef?.current.orientation),xe=Y(()=>mt(n,re.current)),de=Y(u=>{if(g.current=!1,k.current=!0,u.which===229||!se.current&&u.currentTarget===F.current)return;if(y&&hr(u.key,C,b,O)){Ze(u.key,ge())||Ie(u),h.setOpen(!1,pe(Nt,u.nativeEvent)),Ht(D)&&(x?J?.events.emit("virtualfocus",D):D.focus());return}const I=M.current,Q=mt(n,v),P=kt(n,v);if(R||(u.key==="Home"&&(Ie(u),M.current=Q,E(u)),u.key==="End"&&(Ie(u),M.current=P,E(u))),a!=null){const N=a(u,M.current,n,C,c,b,v,Q,P);if(N!=null&&(M.current=N,E(u)),C==="both")return}if(Ze(u.key,C)){if(Ie(u),S&&!x&&ht(u.currentTarget.ownerDocument)===u.currentTarget){M.current=Rt(u.key,C,b)?Q:P,E(u);return}Rt(u.key,C,b)?c?I>=P?f&&I!==n.current.length?M.current=-1:(k.current=!1,M.current=Q):M.current=Je(n.current,{startingIndex:I,disabledIndices:v}):M.current=Math.min(P,Je(n.current,{startingIndex:I,disabledIndices:v})):c?I<=Q?f&&I!==-1?M.current=n.current.length:(k.current=!1,M.current=P):M.current=Je(n.current,{startingIndex:I,decrement:!0,disabledIndices:v}):M.current=Math.max(Q,Je(n.current,{startingIndex:I,decrement:!0,disabledIndices:v})),Dt(n.current,M.current)&&(M.current=-1),E(u)}}),ue=o.useMemo(()=>({onFocus(I){k.current=!0,Z(I)},onClick:({currentTarget:I})=>I.focus({preventScroll:!0}),onMouseMove(I){_t(I)||(k.current=!0,X.current=!1,m&&Z(I))},onPointerLeave(I){if(!se.current||!g.current||I.pointerType==="touch")return;k.current=!0;const Q=I.relatedTarget;if(!(!m||n.current.includes(Q))&&oe.current&&(ne.current?.(),ne.current=null,M.current=-1,E(I),!x)){const P=F.current,N=ht(Ne(P));P&&Ee(P,N)&&P.focus({preventScroll:!0})}}}),[Z,se,F,m,n,E,oe,x]),me=o.useMemo(()=>x&&S&&ce&&{"aria-activedescendant":`${_}-${r}`},[x,S,ce,_,r]),Se=o.useMemo(()=>({...R?{}:me,onKeyDown(u){if(u.key==="Tab"&&u.shiftKey&&S&&!x){const I=Kt(u.nativeEvent);if(I&&!Ee(F.current,I))return;Ie(u),h.setOpen(!1,pe($t,u.nativeEvent)),Ht(D)&&D.focus();return}de(u)},onPointerMove(u){_t(u)||(g.current=!0)}}),[me,de,F,R,h,S,x,D]),ee=o.useMemo(()=>{function u(P){h.setOpen(!0,pe(Nt,P.nativeEvent,P.currentTarget))}function I(P){w==="auto"&&tn(P.nativeEvent)&&(z.current=!x)}function Q(P){z.current=w,w==="auto"&&Qt(P.nativeEvent)&&(z.current=!0)}return{onKeyDown(P){const N=h.select("open");g.current=!1;const ve=P.key.startsWith("Arrow"),Me=mr(P.key,ge(),b),be=Ze(P.key,C),Re=(y?Me:be)||P.key==="Enter"||P.key.trim()==="";if(x&&N)return de(P);if(!(!N&&!V&&ve)){if(Re){const Ue=Ze(P.key,ge());U.current=y&&Ue?null:P.key}if(y){Me&&(Ie(P),N?(M.current=xe(),E(P)):u(P));return}be&&(le.current!=null&&(M.current=le.current),Ie(P),!N&&V?u(P):de(P),N&&E(P))}},onFocus(P){h.select("open")&&!x&&(M.current=-1,E(P))},onPointerDown:Q,onPointerEnter:Q,onMouseDown:I,onClick:I}},[de,w,xe,y,E,h,V,C,ge,b,le,x]),we=o.useMemo(()=>({...me,...ee}),[me,ee]);return o.useMemo(()=>i?{reference:we,floating:Se,item:ue,trigger:ee}:{},[i,we,Se,ee,ue])}function Sr(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:i,disabledIndices:l,onTyping:f,enabled:c=!0,resetMs:y=750,selectedIndex:b=null}=t,x="rootStore"in e?e.rootStore:e,w=x.useState("open"),m=$e(),V=o.useRef(""),v=o.useRef(b??s??-1),C=o.useRef(null),d=Y(p=>{function a(F){return r?.current[F]}function O(F){const K=a(F);return K&&!Ln(K)||K?.matches(":disabled")?!1:l==null||!Vn(bt,F,l)}function h(F,K,J=0){if(F.length===0)return-1;const z=(J%F.length+F.length)%F.length,M=K.toLowerCase();for(let U=0;U<F.length;U+=1){const g=(z+U)%F.length;if(!(!F[g]?.toLowerCase().startsWith(M)||!O(g)))return g}return-1}const S=n.current;if(V.current.length>0&&p.key===" "&&(Ie(p),f?.(!0)),V.current.length>0&&V.current[0]!==" "&&h(S,V.current)===-1&&p.key!==" "&&f?.(!1),S==null||p.key.length!==1||p.ctrlKey||p.metaKey||p.altKey)return;w&&p.key!==" "&&(Ie(p),f?.(!0));const H=V.current==="";H&&(v.current=b??s??-1),S.every((F,K)=>F&&O(K)?F[0]?.toLowerCase()!==F[1]?.toLowerCase():!0)&&V.current===p.key&&(V.current="",v.current=C.current),V.current+=p.key,m.start(y,()=>{V.current="",v.current=C.current,f?.(!1)});const $=((H?b??s??-1:v.current)??0)+1,R=h(S,V.current,$);R!==-1?(i?.(R),C.current=R):p.key!==" "&&(V.current="",f?.(!1))}),_=Y(p=>{const a=p.relatedTarget,O=x.select("domReferenceElement"),h=x.select("floatingElement");Ee(O,a)||Ee(h,a)||(m.clear(),V.current="",v.current=C.current,f?.(!1))});q(()=>{!w&&b!==null||(m.clear(),C.current=null,V.current!==""&&(V.current=""))},[w,b,m]);const T=o.useMemo(()=>({onKeyDown:d,onBlur:_}),[d,_]);return o.useMemo(()=>c?{reference:T,floating:T}:{},[c,T])}function Rr(e){const t=o.useRef(""),n=o.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:o.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function on(e,t){const n=o.useRef(e),r=Y(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function br(e,t){const n=Y((i,l)=>{(typeof e=="function"?e():e)||t(l||(Fn?"touch":""))}),{onClick:r,onPointerDown:s}=Rr(n);return o.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function yr(e){const[t,n]=o.useState(null),r=br(e,n);return on(e,s=>{s&&!e&&n(null)}),o.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}const Ir=20;function Cr(e,t,n,r){const[s,i]=o.useState(!1);q(()=>{if(!e||!t||n==null){i(!1);return}const l=Ne(n).documentElement.clientWidth,f=n.offsetWidth;i(l>0&&f>0&&f>=l-Ir)},[e,t,n]),Jn(e&&(!t||s),r)}const Tr=o.createContext(void 0);function Er(e){return o.useContext(Tr)}function wr(e){const[t,n]=o.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function vr(e){const t=o.useRef(!0);t.current&&(t.current=!1,e())}function Mr(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Ut({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=o.useRef(e!==void 0),[i,l]=o.useState(t),f=s&&e!==void 0?e:i,c=o.useCallback(y=>{s||l(y)},[]);return[f,c]}const sn=o.createContext(void 0),ln=o.createContext(void 0),cn=o.createContext(void 0);function Le(){const e=o.useContext(sn);if(e===void 0)throw new Error(He(60));return e}function wt(){const e=o.useContext(ln);if(e===void 0)throw new Error(He(101));return e}function un(){const e=o.useContext(cn);if(e===void 0)throw new Error(He(61));return e}const Pr="data-valid",Or="data-invalid",Ar={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Lr={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Vr={disabled:!1,...Lr},Fr={valid(e){return e===null?null:e?{[Pr]:""}:{[Or]:""}}},Dr={invalid:void 0,name:void 0,validityData:{state:Ar,errors:[],error:"",value:"",initialValue:null},setValidityData:te,disabled:void 0,setTouched:te,setDirty:te,setFilled:te,setFocused:te,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Vr,registerFieldControl:te,validation:{getValidationProps:(e,t=Ge)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:te,getInputControl:()=>null,commit:async()=>{},change:te}},kr=o.createContext(Dr);function vt(e=!0){const t=o.useContext(kr);if(t.setValidityData===te&&!e)throw new Error(He(28));return t}function Nr(e,t,n,r,s=!0,i){const{registerFieldControl:l}=vt(),f=ke(()=>Symbol());q(()=>{const c=f.current;if(!s){l(c,void 0);return}l(c,{controlRef:e,getValue:r,id:t,name:i,value:n})},[e,s,r,t,i,l,f,n]),q(()=>{const c=f.current;return()=>{l(c,void 0)}},[l,f])}const Hr=o.createContext({controlId:void 0,registerControlId:te,resetControlId:te,labelId:void 0,setLabelId:te,messageIds:[],setMessageIds:te,getDescriptionProps:e=>e});function an(){return o.useContext(Hr)}function fn(e={}){const{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:s,resetControlId:i}=an(),l=Zn(),f=ke(()=>Symbol()),c=o.useRef(!1),y=o.useRef(!1),b=Y(()=>{!c.current||s===te||(c.current=!1,s(f.current,void 0))});return q(()=>{if(!n||s===te){b();return}let x;if(t!==void 0)y.current=!0,x=t;else if(y.current)x=l;else{i();return}if(x===void 0){b();return}c.current=!0,s(f.current,x)},[t,n,s,i,l,f,b]),q(()=>b,[b]),(n?r:void 0)??t??l}function _r(e,t,n=Object.is){const{length:r}=e;if(r!==t.length)return!1;for(let s=0;s<r;s+=1)if(!n(e[s],t[s]))return!1;return!0}const dn=(e,t)=>Object.is(e,t);function Ae(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ur(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!_r(e,t,(r,s)=>Ae(r,s,n)):e!==t}function It(e,t,n){return e?e.some(r=>r===void 0?!1:Ae(t,r,n)):!1}function ot(e,t,n){return e?e.findIndex(r=>r===void 0?!1:Ae(r,t,n)):-1}function Br(e,t){if(t!==dn)return r=>It(e,r,t);const n=new Set(e);return n.delete(void 0),r=>n.has(r)&&(r!==0||e.some(s=>Object.is(r,s)))}function pn(e,t,n,r){const s=r&&Array.isArray(t)?e.findIndex(Br(t,n)):ot(e,t,n);return s===-1?null:s}function Wr(e,t,n,r,s,i){return It(r,t,s)?i!=null&&e>i&&It(r,n[i],s)?i:e:e===i?pn(n,r,s,!0):i}function jr(e,t,n){return e.filter(r=>!Ae(t,r,n))}function Ct(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function zr(e){return typeof e=="object"&&e!=null&&Array.isArray(e.items)}function gn(e){return zr(e?.[0])}function qr(e){return gn(e)?e.flatMap(t=>t.items):e}function Kr(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(gn(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function mn(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return Ct(e)}function De(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ct(e.value):Ct(e)}function hn(e,t,n){function r(){return mn(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){const i=qr(t);if(e==null||typeof e!="object"){const l=i.find(f=>f.value===e);return l&&l.label!=null?l.label:r()}if("value"in e){const l=i.find(f=>f&&f.value===e.value);if(l&&l.label!=null)return l.label}}return r()}function Yr(e,t,n){return e.reduce((r,s,i)=>(i>0&&r.push(", "),r.push(ae.jsx(o.Fragment,{children:hn(s,t,n)},i)),r),[])}const $r={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:De(t,r)!==""},hasNullItemLabel:(e,t)=>t?Kr(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>Ae(t,s,n)):Ae(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows},Gr=o.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:te,validationMode:"onSubmit",submitCountRef:{current:0}});function Xr(){return o.useContext(Gr)}const Ce=1;function xn(e,t){return Math.max(0,e-t)}function Jr(e,t){if(t<=0)return 0;const n=Ke(e,0,t),r=n,s=t-n,i=r<=Ce,l=s<=Ce;return i&&l?r<=s?0:t:i?0:l?t:n}function vo(e){const{id:t,value:n,defaultValue:r=null,onValueChange:s,open:i,defaultOpen:l=!1,onOpenChange:f,name:c,form:y,autoComplete:b,disabled:x=!1,readOnly:w=!1,required:m=!1,modal:V=!0,actionsRef:v,inputRef:C,onOpenChangeComplete:d,items:_,multiple:T=!1,itemToStringLabel:p,itemToStringValue:a,isItemEqualToValue:O=dn,highlightItemOnHover:h=!0,children:S}=e,{clearErrors:H}=Xr(),{setDirty:D,setTouched:G,setFocused:$,validityData:R,setFilled:F,name:K,disabled:J,validation:z,validationMode:M}=vt(),U=fn({id:t}),g=J||x,E=K??c,[A,L]=Ut({controlled:n,default:T?r??bt:r,name:"Select",state:"value"}),[k,X]=Ut({controlled:i,default:l,name:"Select",state:"open"}),ne=o.useRef([]),re=o.useRef([]),se=o.useRef(null),le=o.useRef(null),oe=o.useRef(0),fe=o.useRef(null),B=o.useRef([]),j=o.useRef(!1),ce=o.useRef(null),Z=o.useRef(null),ge=o.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),xe=o.useRef(!1),de=o.useRef(A),{mounted:ue,setMounted:me,transitionStatus:Se}=nn(k),{openMethod:ee,triggerProps:we}=yr(k),u=ke(()=>new Hn({id:U,labelId:void 0,modal:V,multiple:T,itemToStringLabel:p,itemToStringValue:a,isItemEqualToValue:O,value:A,open:k,mounted:ue,transitionStatus:Se,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Ge,triggerProps:Ge,triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:te,setOpen:te,handleScrollArrowVisibility:te,onOpenChangeComplete:te,listRef:ne,popupRef:se,scrollHandlerRef:le,scrollArrowsMountedCountRef:oe,valueRef:fe,valuesRef:B,labelsRef:re,typingRef:j,selectionRef:ge,firstItemTextRef:ce,selectedItemTextRef:Z,alignItemWithTriggerActiveRef:xe,initialValueRef:de},$r)).current,I=u.useState("activeIndex"),Q=u.useState("selectedIndex"),P=u.useState("triggerElement"),N=u.useState("positionerElement"),ve=wr(ee),Me=ee??ve,be=o.useMemo(()=>T?"":De(A,a),[T,A,a]),Re=o.useMemo(()=>T&&Array.isArray(A)?A.map(W=>De(W,a)):De(A,a),[T,A,a]),Ue=Oe(P),Be=Y(()=>Re);Nr(Ue,U,A,Be,!g,c);const We=T?Array.isArray(A)&&A.length>0:A!=null&&be!=="";q(()=>{F(We)},[We,F]),q(function(){const ie=pn(B.current,A,O,T);ie===null&&(Z.current=null),!k&&u.set("selectedIndex",ie)},[T,k,A,O,u]),on(A,()=>{H(E),D(Ur(A,R.initialValue,O)),z.change(A)});const je=Y((W,ie)=>{f?.(W,ie),!ie.isCanceled&&(X(W),!W&&(ie.reason===$t||ie.reason===_n)&&(G(!0),$(!1),M==="onBlur"&&z.commit(A)))}),Ve=Y(()=>{me(!1),u.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),d?.(!1)});Et({enabled:!v,open:k,ref:se,onComplete(){k||Ve()}}),o.useImperativeHandle(v,()=>({unmount:Ve}),[Ve]);const ze=Y((W,ie)=>{s?.(W,ie),!ie.isCanceled&&L(W)}),ft=Y(W=>{const ie=xn(W.scrollHeight,W.clientHeight),Xe=Jr(W.scrollTop,ie),dt=Xe>0,qe=Xe<ie;u.set("scrollUpArrowVisible",dt),u.set("scrollDownArrowVisible",qe)}),Pe=pr({open:k,onOpenChange:je,elements:{reference:P,floating:N}}),he=dr(Pe,{enabled:!g,event:"mousedown"}),ye=Qn(Pe),Te=xr(Pe,{enabled:!g,listRef:ne,activeIndex:I,selectedIndex:Q,disabledIndices:bt,onNavigate(W){W===null&&!k||u.set("activeIndex",W)},focusItemOnHover:h}),Fe=Sr(Pe,{enabled:!g&&(k||!w&&!T),listRef:re,activeIndex:I,selectedIndex:Q,disabledIndices:W=>Mr(ne.current[W]),onMatch(W){k?u.set("activeIndex",W):ze(B.current[W],pe(it))},onTyping(W){j.current=W}}),Pt=o.useMemo(()=>yt(Fe.reference,Te.reference,ye.reference,he.reference,we),[he.reference,Fe.reference,Te.reference,ye.reference,we]),Ot=o.useMemo(()=>yt(er,Fe.floating,Te.floating,ye.floating),[Fe.floating,Te.floating,ye.floating]),At=Te.item??Ge;u.useContextCallback("setValue",ze),u.useContextCallback("setOpen",je),u.useContextCallback("handleScrollArrowVisibility",ft),u.useContextCallback("onOpenChangeComplete",d),vr(()=>{u.update({popupProps:Ot,triggerProps:Pt})}),u.useSyncedValues({id:U,modal:V,multiple:T,value:A,open:k,mounted:ue,transitionStatus:Se,popupProps:Ot,triggerProps:Pt,items:_,itemToStringLabel:p,itemToStringValue:a,isItemEqualToValue:O,openMethod:Me});const In=o.useMemo(()=>({disabled:g,readOnly:w,required:m,multiple:T,highlightItemOnHover:h,itemProps:At}),[g,w,m,T,h,At]),Cn=Dn(C,z.inputRef),Lt=T?void 0:E,Tn=o.useMemo(()=>!T||!Array.isArray(A)||!E?null:A.map(W=>{const ie=De(W,a);return ae.jsx("input",{type:"hidden",form:y,name:E,value:ie,disabled:g},ie)}),[T,A,y,E,a,g]);return ae.jsxs(sn.Provider,{value:u,children:[ae.jsx(ln.Provider,{value:In,children:ae.jsx(cn.Provider,{value:Pe,children:S})}),ae.jsx("input",{...z.getValidationProps(g,{onFocus(){u.state.triggerElement?.focus({focusVisible:!0})},onChange(W){if(W.nativeEvent.defaultPrevented||g||w)return;const ie=W.currentTarget.value,Xe=pe(it,W.nativeEvent);function dt(){if(T)return;const qe=ie.toLowerCase();let pt=B.current.findIndex(gt=>De(gt,a).toLowerCase()===qe||mn(gt,p).toLowerCase()===qe);pt===-1&&(pt=B.current.findIndex((gt,En)=>{const Ft=re.current[En];return Ft!=null&&Ft.toLowerCase()===qe}));const Vt=B.current[pt];Vt!=null&&ze(Vt,Xe)}u.set("forceMount",!0),queueMicrotask(dt)}}),id:U&&Lt==null?`${U}-hidden-input`:void 0,form:y,name:Lt,autoComplete:b,value:be,disabled:g,required:m&&!(T&&We),readOnly:w,ref:Cn,style:E?kn:Nn,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Tn]})}function Zr(e,t){return e??t}const Qe=5;function Qr(e,t){const n=eo(t);return e.clientX>=n.left-Qe&&e.clientX<=n.right+Qe&&e.clientY>=n.top-Qe&&e.clientY<=n.bottom+Qe}function eo(e){const t=e.getBoundingClientRect(),n=rt(e);if(Un)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,f=parseFloat(r.height)||0,c=parseFloat(s.width)||0,y=parseFloat(s.height)||0,b=Math.max(t.width,l,c),x=Math.max(t.height,f,y),w=b-t.width,m=x-t.height;return{left:t.left-w/2,right:t.right+w/2,top:t.top-m/2,bottom:t.bottom+m/2}}const to="data-popup-side",no=400,ro={...tr,...Fr,popupSide:e=>e?{[to]:e}:null,value:()=>null},Mo=o.forwardRef(function(t,n){const{render:r,className:s,id:i,disabled:l=!1,nativeButton:f=!0,style:c,...y}=t,{setTouched:b,setFocused:x,validationMode:w,validation:m,state:V,disabled:v}=vt(),{labelId:C}=an(),d=Le(),{readOnly:_,required:T,disabled:p}=wt(),a=v||p||l,O=d.useState("open"),h=d.useState("mounted"),S=d.useState("value"),H=d.useState("triggerProps"),D=d.useState("positionerElement"),G=d.useState("listElement"),$=d.useState("popupSide"),R=d.useState("id"),F=d.useState("labelId"),K=d.useState("hasSelectedValue"),J=h&&D?$:null,z=i??R,M=Zr(C,F);fn({id:i});const U=Oe(D),g=o.useRef(null),{getButtonProps:E,buttonRef:A}=Jt({disabled:a,native:f}),L=d.useStateSetter("triggerElement"),k=$e(),X=$e(),ne=$e();o.useEffect(()=>{if(O)return ne.start(no,()=>{d.context.selectionRef.current.allowUnselectedMouseUp=!0,d.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ne.clear()};d.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},X.clear()},[O,d,X,ne]);const re=yt(H,{id:z,role:"combobox","aria-expanded":O,"aria-haspopup":"listbox","aria-controls":O?G?.id??Yt(D)?.id:void 0,"aria-labelledby":M,"aria-readonly":_||void 0,"aria-required":T||void 0,tabIndex:a?-1:0,onFocus(oe){x(!0),O&&d.context.alignItemWithTriggerActiveRef.current&&d.context.setOpen(!1,pe(it,oe.nativeEvent)),k.start(0,()=>{d.set("forceMount",!0)})},onBlur(oe){Ee(D,oe.relatedTarget)||(b(!0),x(!1),w==="onBlur"&&m.commit(S))},onMouseDown(oe){if(O)return;const fe=Ne(oe.currentTarget);function B(j){if(!g.current)return;const ce=j.target;Ee(g.current,ce)||Ee(U.current,ce)||Qr(j,g.current)||d.context.setOpen(!1,pe(Bn,j))}X.start(0,()=>{fe.addEventListener("mouseup",B,{once:!0})})}},y,E),se=m.getValidationProps(a,re);se.role="combobox";const le={...V,open:O,disabled:a,value:S,readOnly:_,popupSide:J,placeholder:!K};return _e("button",t,{ref:[n,g,A,L],state:le,stateAttributesMapping:ro,props:se})}),oo={value:()=>null},Po=o.forwardRef(function(t,n){const{className:r,render:s,children:i,placeholder:l,style:f,...c}=t,y=Le(),b=y.useState("value"),x=y.useState("items"),w=y.useState("itemToStringLabel"),m=y.useState("hasSelectedValue"),V=!m&&l!=null&&i==null,v=y.useState("hasNullItemLabel",V),C={value:b,placeholder:!m};let d=null;return typeof i=="function"?d=i(b):i!=null?d=i:V&&!v?d=l:Array.isArray(b)?d=Yr(b,x,w):d=hn(b,x,w),_e("span",t,{state:C,ref:[n,y.context.valueRef],props:[{children:d},c],stateAttributesMapping:oo})}),Oo=o.forwardRef(function(t,n){const r=Le(),s=r.useState("mounted"),i=r.useState("forceMount");return s||i?ae.jsx(Wn,{ref:n,...t}):null}),Sn=o.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function so(){return o.useContext(Sn)}function io(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,i=Y(s),[,l]=o.useState(!1),f=ke(co).current,c=ke(lo).current,y=o.useRef(0),b=o.useRef(!0),x=o.useRef(null),w=o.useRef(null),m=Y(()=>{b.current||(b.current=!0,l(a=>!a))}),V=Y((a,O)=>{c.set(a,O),m()}),v=Y(a=>{c.delete(a),m()}),C=Y(a=>{const O=new Map;return n.current.length=0,r&&(r.current.length=0),a.forEach(h=>{O.set(h.element,{...h.registration.metadata??{},index:h.index}),n.current[h.index]=h.element,r&&(r.current[h.index]=h.registration.label!==void 0?h.registration.label:h.registration.textRef?.current?.textContent??h.element.textContent)}),y.current=n.current.length,O});function d(a){if(w.current?.disconnect(),w.current=null,typeof MutationObserver!="function"||a.length<2)return;const O=new MutationObserver(S=>{if(!fo(S))return;let H=null;for(const D of a)if(D.isConnected){if(H&&Rn(H,D)>0){O.disconnect(),m();return}H=D}});w.current=O;const h=new Set;for(let S=1;S<a.length;S+=1){const H=ao(a[S-1],a[S]);H&&h.add(H)}h.forEach(S=>O.observe(S,{childList:!0}))}const _=Y(()=>{const[a,O]=uo(c),h=C(a),S=x.current,H=!S||S.length!==a.length||a.some((D,G)=>{const $=S[G];return D.index!==$.index||D.element!==$.element||D.registration.index!==$.registration.index||D.registration.metadata!==$.registration.metadata});d(O),x.current=a,b.current=!1,H&&(f.forEach(D=>D(h)),i(h))});q(()=>(!b.current&&x.current&&C(x.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,C]),q(()=>{b.current&&_()}),q(()=>()=>{w.current?.disconnect(),b.current=!0},[]);const T=Y(a=>(f.add(a),()=>{f.delete(a)})),p=o.useMemo(()=>({register:V,unregister:v,subscribeMapChange:T,nextIndexRef:y}),[V,v,T,y]);return ae.jsx(Sn.Provider,{value:p,children:t})}function lo(){return new Map}function co(){return new Set}function uo(e){const t=new Set,n=[],r=[];e.forEach((i,l)=>{if(!l.isConnected)return;const f=i.index,c={index:f??-1,element:l,registration:i};f===null?r.push(c):f>=0&&(t.add(f),n.push(c))});let s=0;return r.sort((i,l)=>Rn(i.element,l.element)),r.forEach(i=>{for(;t.has(s);)s+=1;i.index=s,n.push(i),s+=1}),t.size>0&&n.sort((i,l)=>i.index-l.index),[n,r.map(i=>i.element)]}function ao(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function fo(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function Rn(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const bn=o.createContext(void 0);function po(){const e=o.useContext(bn);if(!e)throw new Error(He(59));return e}function lt(e,t){e&&Object.assign(e.style,t)}const go={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},mo={position:"fixed"},Ao=o.forwardRef(function(t,n){const{anchor:r,className:s,render:i,positionMethod:l,side:f,align:c,sideOffset:y,alignOffset:b,collisionBoundary:x="clipping-ancestors",collisionPadding:w,arrowPadding:m,sticky:V,disableAnchorTracking:v,alignItemWithTrigger:C=!0,collisionAvoidance:d=jn,style:_,...T}=t,p=Le(),a=un(),O=p.useState("open"),h=p.useState("mounted"),S=p.useState("modal"),H=p.useState("value"),D=p.useState("openMethod"),G=p.useState("positionerElement"),$=p.useState("triggerElement"),R=p.useState("isItemEqualToValue"),F=p.useState("transitionStatus"),K=o.useRef(null),J=o.useRef(null),[z,M]=o.useState(C),U=h&&z&&D!=="touch";!h&&z!==C&&M(C),o.useImperativeHandle(p.context.alignItemWithTriggerActiveRef,()=>U),Cr((U||S)&&O,D==="touch",G,$);const g=ir({anchor:r,floatingRootContext:a,positionMethod:l,mounted:h,side:f,sideOffset:y,align:c,alignOffset:b,arrowPadding:m,collisionBoundary:x,collisionPadding:w,sticky:V,disableAnchorTracking:v??U,collisionAvoidance:d,keepMounted:!0}),E=U?"none":g.side,A=U?mo:g.positionerStyles,L={open:O,side:E,align:g.align,anchorHidden:g.anchorHidden};q(()=>{p.set("popupSide",g.side)},[p,g.side]);const k=p.useStateSetter("positionerElement"),X=lr(t,L,{styles:A,transitionStatus:F,props:T,refs:[n,k],hidden:!h,inert:!O}),ne=o.useRef(0),re=Y(le=>{if(p.context.valuesRef.current.length===0)return;const oe=ne.current;ne.current=le.size;const fe=pe(it);if(oe!==0&&!p.state.multiple&&H!==null&&ot(p.context.valuesRef.current,H,R)===-1){const j=p.context.initialValueRef.current,Z=j!=null&&ot(p.context.valuesRef.current,j,R)!==-1?j:null;p.context.setValue(Z,fe),Z===null&&(p.set("selectedIndex",null),p.context.selectedItemTextRef.current=null)}if(oe!==0&&p.state.multiple&&Array.isArray(H)){const B=H.filter(j=>ot(p.context.valuesRef.current,j,R)!==-1);B.length!==H.length&&(p.context.setValue(B,fe),B.length===0&&(p.set("selectedIndex",null),p.context.selectedItemTextRef.current=null))}if(O&&U){p.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const B={height:""};lt(G,B),lt(p.context.popupRef.current,B)}}),se=o.useMemo(()=>({...g,side:E,alignItemWithTriggerActive:U,setControlledAlignItemWithTrigger:M,scrollUpArrowRef:K,scrollDownArrowRef:J}),[g,E,U,M]);return ae.jsx(io,{elementsRef:p.context.listRef,labelsRef:p.context.labelsRef,onMapChange:re,children:ae.jsxs(bn.Provider,{value:se,children:[h&&S&&ae.jsx(nr,{inert:zn(!O),cutout:$}),X]})})}),et="base-ui-disable-scrollbar",Bt={className:et,getElement(e){return ae.jsx("style",{nonce:e,href:et,precedence:"base-ui:low",children:`.${et}{scrollbar-width:none}.${et}::-webkit-scrollbar{display:none}`})}},ho=o.createContext(void 0),xo={disableStyleElements:!1};function So(){return o.useContext(ho)??xo}const Wt="--transform-origin",Ro={...or,...Zt},Lo=o.forwardRef(function(t,n){const{render:r,className:s,style:i,finalFocus:l,...f}=t,c=Le(),{multiple:y,readOnly:b,highlightItemOnHover:x}=wt(),w=un(),{side:m,align:V,alignItemWithTriggerActive:v,isPositioned:C,setControlledAlignItemWithTrigger:d}=po(),_=Er()!=null,T=cr(),{nonce:p,disableStyleElements:a}=So(),O=c.useState("id"),h=c.useState("open"),S=c.useState("openMethod"),H=c.useState("mounted"),D=c.useState("popupProps"),G=c.useState("transitionStatus"),$=c.useState("triggerElement"),R=c.useState("positionerElement"),F=c.useState("listElement"),K=o.useRef(!1),J=o.useRef(!1),z=o.useRef({}),M=st(),U=Y(L=>{if(!R||!c.context.popupRef.current||!J.current)return;const k=R.style.top==="0px",X=R.style.bottom==="0px";if(K.current||!v||!k&&!X){c.context.handleScrollArrowVisibility(L);return}const ne=zt(R),re=Ye(R.getBoundingClientRect().height,"y",ne),se=Ne(R),le=rt(R),oe=le.getComputedStyle(R),fe=parseFloat(oe.marginTop),B=parseFloat(oe.marginBottom),j=jt(le.getComputedStyle(c.context.popupRef.current)),ce=Math.min(se.documentElement.clientHeight-fe-B,j),Z=L.scrollTop,ge=tt(L);let xe=null;const de=ee=>{R.style.height=`${ee}px`},ue=k?ge-Z:Z,me=Math.min(re+ue,ce);if(ue<=Ce){const ee=Ke(ue,0,ce-re);ee>0&&de(re+ee),L.scrollTop=k?ge:0,ce-(re+ee)<=Ce&&(K.current=!0),c.context.handleScrollArrowVisibility(L);return}if(ce-me>Ce)xe=k?1/0:0;else if(X&&Z<ge){const ee=re+ue-ce;xe=Z-(ue-ee)}const Se=Math.ceil(me);if(Se!==0&&de(Se),xe!=null){const ee=Ke(xe,0,tt(L));Math.abs(L.scrollTop-ee)>Ce&&(L.scrollTop=ee)}Se>=ce-Ce&&(K.current=!0),c.context.handleScrollArrowVisibility(L)});o.useImperativeHandle(c.context.scrollHandlerRef,()=>U,[U]),Et({open:h,ref:c.context.popupRef,onComplete(){h&&c.context.onOpenChangeComplete(!0)}});const g={open:h,transitionStatus:G,side:m,align:V};q(()=>{!R||!c.context.popupRef.current||Object.keys(z.current).length||(z.current={top:R.style.top||"0",left:R.style.left||"0",right:R.style.right,height:R.style.height,bottom:R.style.bottom,minHeight:R.style.minHeight,maxHeight:R.style.maxHeight,marginTop:R.style.marginTop,marginBottom:R.style.marginBottom})},[c,R]),q(()=>{h||v||(J.current=!1,K.current=!1,lt(R,z.current))},[h,v,R]),q(()=>{const L=c.context.popupRef.current;if(!h||!$||!R||!L||v&&!C||c.state.transitionStatus==="ending")return;if(J.current=!0,L.style.removeProperty(Wt),!v){M.request(()=>c.context.handleScrollArrowVisibility(F||L));return}const k=bo(L);try{let X=c.context.selectedItemTextRef.current;X?.isConnected||(X=!c.select("hasSelectedValue")&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);const ne=c.context.valueRef.current,re=rt(R),se=re.getComputedStyle(R),le=re.getComputedStyle(L),oe=Ne($),fe=zt($),B=nt($.getBoundingClientRect(),fe),j=nt(R.getBoundingClientRect(),fe),ce=B.height,Z=F||L,ge=Z.scrollHeight,xe=parseFloat(le.borderBottomWidth),de=parseFloat(se.marginTop)||10,ue=parseFloat(se.marginBottom)||10,me=parseFloat(se.minHeight)||100,Se=jt(le),ee=5,we=5,u=20,I=oe.documentElement.clientHeight-de-ue,Q=oe.documentElement.clientWidth,P=I-B.bottom+ce;let N,ve=T==="rtl"?B.right-j.width:B.left,Me=0;if(X&&ne){const he=nt(ne.getBoundingClientRect(),fe);N=nt(X.getBoundingClientRect(),fe),ve=j.left+(T==="rtl"?he.right-N.right:he.left-N.left);const ye=he.top-B.top+he.height/2;Me=N.top-j.top+N.height/2-ye}const be=P+Me+ue+xe;let Re=Math.min(I,be);const Ue=I-de-ue,Be=be-Re,We=Q-we;R.style.left=`${Ke(ve,ee,We-j.width)}px`,R.style.height=`${Re}px`,R.style.maxHeight="none",R.style.marginTop=`${de}px`,R.style.marginBottom=`${ue}px`,L.style.height="100%";const je=tt(Z),Ve=Be>=je-Ce;Ve&&(Re=Math.min(I,j.height)-(Be-je));const ze=B.top<u||B.bottom>I-u||Math.ceil(Re)+Ce<Math.min(ge,me),ft=(re.visualViewport?.scale??1)!==1&≫if(ze||ft){lt(R,z.current),d(!1);return}const Pe=Math.max(me,Re);if(Ve){const he=Math.max(0,I-be);R.style.top=j.height>=Ue?"0":`${he}px`,R.style.height=`${Re}px`,Z.scrollTop=tt(Z)}else R.style.bottom="0",Z.scrollTop=Be;if(N){const he=j.top,ye=j.height,Te=N.top+N.height/2,Fe=Ke(ye>0?(Te-he)/ye*100:50,0,100);L.style.setProperty(Wt,`50% ${Fe}%`)}(Pe===I||Re>=Se)&&(K.current=!0),c.context.handleScrollArrowVisibility(Z),x&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set("activeIndex",0)}finally{k()}},[c,h,R,$,v,d,M,F,x,T,C]),o.useEffect(()=>{if(!v||!R||!h)return;const L=rt(R);function k(X){c.context.setOpen(!1,pe(Kn,X))}return qn(L,"resize",k)},[c,v,R,h]);const E={...F?{role:"presentation"}:{role:"listbox","aria-multiselectable":y||void 0,"aria-readonly":b||void 0,id:`${O}-list`},onKeyDown(L){_&&sr.has(L.key)&&L.stopPropagation()},onScroll(L){F||U(L.currentTarget)},...v&&{style:F?{height:"100%"}:go},className:!F&&v?Bt.className:void 0},A=_e("div",t,{ref:[n,c.context.popupRef],state:g,stateAttributesMapping:Ro,props:[D,E,fr(G),f]});return ae.jsxs(o.Fragment,{children:[!a&&Bt.getElement(p),ae.jsx(rr,{context:w,modal:!1,disabled:!H,openInteractionType:S,returnFocus:l,restoreFocus:!0,children:A})]})});function jt(e){const t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function tt(e){return xn(e.scrollHeight,e.clientHeight)}function zt(e){return ur.getScale(e)}function Ye(e,t,n){return e/n[t]}function nt(e,t){return ar({x:Ye(e.x,"x",t),y:Ye(e.y,"y",t),width:Ye(e.width,"x",t),height:Ye(e.height,"y",t)})}const qt=[["transform","none"],["scale","1"],["translate","0 0"]];function bo(e){const{style:t}=e,n={};for(const[r,s]of qt)n[r]=t.getPropertyValue(r),t.setProperty(r,s,"important");return()=>{for(const[r]of qt){const s=n[r];s?t.setProperty(r,s):t.removeProperty(r)}}}function yo(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:i}=e,{register:l,unregister:f,subscribeMapChange:c,nextIndexRef:y}=so(),b=o.useRef(-1),[x,w]=o.useState(i==null&&t?()=>{if(b.current===-1){const C=y.current;y.current+=1,b.current=C}return b.current}:-1),m=i??x,V=o.useRef(null),v=o.useCallback(C=>{const d=V.current;d&&f(d),V.current=C,C&&l(C,{metadata:r??null,index:i??null,label:n,textRef:s})},[i,l,f,r,n,s]);return q(()=>{if(i==null)return c(C=>{const d=V.current?C.get(V.current)?.index:null;d!=null&&w(d)})},[i,c]),{ref:v,index:m}}const yn=o.createContext(void 0);function Mt(){const e=o.useContext(yn);if(!e)throw new Error(He(57));return e}const Vo=o.memo(o.forwardRef(function(t,n){const{render:r,className:s,style:i,value:l=null,label:f,disabled:c=!1,nativeButton:y=!1,...b}=t,x=o.useRef(null),w=yo({guess:!0,label:f,textRef:x}),m=Le(),{itemProps:V,multiple:v,disabled:C,readOnly:d}=wt(),_=C||c,T=m.useState("isActive",w.index),p=m.useState("open"),a=m.useState("isSelected",l),O=m.useState("isSelectedByFocus",w.index),h=m.useState("isItemEqualToValue"),S=w.index,H=o.useRef(null);q(()=>{const g=m.context.valuesRef.current;return g[S]=l,()=>{delete g[S]}},[S,l,m]),q(()=>{const g=m.state.value,E=m.state.selectedIndex;let A=E,L;v&&Array.isArray(g)?(A=Wr(S,l,m.context.valuesRef.current,g,h,E),L=A===S,S===E&&!L&&(m.context.selectedItemTextRef.current=null)):(L=g!==void 0&&Ae(l,g,h),L&&(A=S)),m.set("selectedIndex",A),L&&x.current&&(m.context.selectedItemTextRef.current=x.current)},[S,v,h,m,l]);const D=o.useRef("mouse"),G=o.useRef(!1),{getButtonProps:$,buttonRef:R}=Jt({disabled:_,focusableWhenDisabled:!0,native:y,composite:!0}),F={disabled:_,selected:a,highlighted:T};function K(g){if(C||d)return;const E=m.state.value;if(v){const A=Array.isArray(E)?E:[],L=a?jr(A,l,h):[...A,l];m.context.setValue(L,pe(xt,g))}else m.context.setValue(l,pe(xt,g)),m.context.setOpen(!1,pe(xt,g))}function J(){m.context.selectionRef.current.dragY=0}const z={role:"option","aria-selected":a,tabIndex:p&&T?0:-1,onKeyDown(g){m.set("activeIndex",S),g.key===" "&&m.context.typingRef.current&&g.preventDefault()},onClick(g){const E=D.current!=="touch",A=g.nativeEvent.pointerType,L=E&&tn(g.nativeEvent)&&(A!==void 0||T),k=E&&!L&&!G.current;G.current=!1,!(_||k)&&K(g.nativeEvent)},onPointerEnter(g){D.current=g.pointerType},onPointerMove(g){if(g.pointerType==="mouse"&&g.buttons===1){const E=m.context.selectionRef.current;E.dragY+=g.movementY,E.dragY**2>=64&&(E.allowUnselectedMouseUp=!0)}},onPointerDown(g){D.current=g.pointerType,G.current=!0,J()},onMouseUp(){if(J(),_||D.current==="touch"||G.current)return;const g=!m.context.selectionRef.current.allowSelectedMouseUp&&a,E=!m.context.selectionRef.current.allowUnselectedMouseUp&&!a;g||E||(G.current=!0,H.current?.click(),G.current=!1)}},M=_e("div",t,{ref:[R,n,w.ref,H],state:F,props:[V,z,b,$]}),U=o.useMemo(()=>({selected:a,index:S,textRef:x,selectedByFocus:O}),[a,S,x,O]);return ae.jsx(yn.Provider,{value:U,children:M})})),Fo=o.forwardRef(function(t,n){const{selected:r}=Mt();return t.keepMounted||r?ae.jsx(Io,{...t,ref:n}):null}),Io=o.memo(o.forwardRef((e,t)=>{const{render:n,className:r,style:s,keepMounted:i,...l}=e,{selected:f}=Mt(),c=o.useRef(null),{transitionStatus:y,setMounted:b}=nn(f),w=_e("span",e,{ref:[t,c],state:{selected:f,transitionStatus:y},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:Zt});return Et({batch:!0,enabled:!f,open:f,ref:c,onComplete(){f||b(!1)}}),w})),Do=o.memo(o.forwardRef(function(t,n){const{index:r,textRef:s,selectedByFocus:i}=Mt(),l=Le(),{render:f,className:c,style:y,...b}=t,x=o.useCallback(m=>{m&&(r===0&&(l.context.firstItemTextRef.current=m),i&&(l.context.selectedItemTextRef.current=m))},[l,r,i]);return _e("div",t,{ref:[x,n,s],props:b})}));export{wo as C,go as L,vo as S,wt as a,po as b,Mo as c,Po as d,Oo as e,Ao as f,Lo as g,Vo as h,Fo as i,Do as j,dr as k,br as l,Cr as m,Er as n,Fr as o,Xr as p,vt as q,an as r,Bt as s,fn as t,Le as u,Ut as v,Nr as w,on as x};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.sessions-row-grid{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:12px;align-items:start}.sessions-row-identity{grid-column:1;grid-row:1}.sessions-row-metrics{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.sessions-row-action{grid-column:2;grid-row:1}.sessions-row-action:disabled{opacity:.4}.sessions-row-value{min-width:0}.sessions-row-meta{-moz-column-gap:12px;column-gap:12px}@media(max-width:767px){.sessions-row-metrics dt{font-size:11px;line-height:16px}.sessions-row-metrics dd{margin-top:0}}.sessions-row-nested .sessions-row-identity,.sessions-thread-models{padding-left:16px}.sessions-list-header{display:none}.sessions-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.sessions-toolbar-search{grid-column:1 / -1}.sessions-filter-trigger{border-radius:6px}.sessions-filter-trigger>svg:last-child{margin-left:auto}.sessions-model-filter>svg:first-of-type{display:none}.sessions-kpis>div{min-width:0}@media(min-width:640px){.sessions-kpis>div+div{border-left:1px solid rgb(229 229 229);padding-left:16px}:root.dark .sessions-kpis>div+div{border-left-color:#262626}}@media(min-width:768px){.sessions-row-grid{grid-template-columns:minmax(0,1fr) 72px 80px 96px 32px;gap:16px}.sessions-row-metrics{display:contents}.sessions-row-meta{-moz-column-gap:0;column-gap:0}.sessions-meta-item+.sessions-meta-item:before{content:"·";padding:0 6px}.sessions-row-value{text-align:right}.sessions-row-action{grid-column:5;margin-top:-6px}@media(hover:hover){.sessions-row .sessions-row-action:not(:focus-visible){opacity:0}.sessions-row:hover .sessions-row-action:not(:disabled){opacity:1}.sessions-row:hover .sessions-row-action:disabled{opacity:.4}}.sessions-row-nested .sessions-row-identity,.sessions-thread-models{padding-left:30px}.sessions-list-header{display:grid}}@media(min-width:1024px){.sessions-toolbar{grid-template-columns:minmax(0,1fr) repeat(4,minmax(0,168px))}.sessions-toolbar-search{grid-column:auto}}
|