tokentracker-cli 0.68.0 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.ja.md +2 -0
  2. package/README.ko.md +2 -0
  3. package/README.md +2 -0
  4. package/README.zh-CN.md +2 -0
  5. package/dashboard/dist/assets/ActivityHeatmap-Bqy-meR1.js +42 -0
  6. package/dashboard/dist/assets/{Card--_I4rbLK.js → Card-DbzltTXg.js} +1 -1
  7. package/dashboard/dist/assets/CommunityStatsModal-CumafhRo.js +1 -0
  8. package/dashboard/dist/assets/ConfirmModal-CfmWYFAl.js +1 -0
  9. package/dashboard/dist/assets/DashboardPage-beIJMVvO.js +19 -0
  10. package/dashboard/dist/assets/DevicePage-Cb_cMnJj.js +1 -0
  11. package/dashboard/dist/assets/DialogClose-245t1wj3.js +1 -0
  12. package/dashboard/dist/assets/DialogDescription-CMG2f0Xr.js +1 -0
  13. package/dashboard/dist/assets/DialogTitle-C_S_W-qN.js +1 -0
  14. package/dashboard/dist/assets/{FadeIn-CJo3CY8P.js → FadeIn-9qSEABKW.js} +1 -1
  15. package/dashboard/dist/assets/{HeaderGithubStar-DlIkA0ge.js → HeaderGithubStar-C42NExcO.js} +1 -1
  16. package/dashboard/dist/assets/{IpCheckPage-D11sDL_F.js → IpCheckPage-C_LVvRK3.js} +3 -3
  17. package/dashboard/dist/assets/LandingPage-1ng5HTtU.js +4252 -0
  18. package/dashboard/dist/assets/LeaderboardAvatar-Dud2isij.js +1 -0
  19. package/dashboard/dist/assets/LeaderboardPage-BVLHknpa.js +2 -0
  20. package/dashboard/dist/assets/{LeaderboardProfileModal-BFCT2cD1.js → LeaderboardProfileModal-creqSCBC.js} +3 -3
  21. package/dashboard/dist/assets/{LeaderboardProfilePage-kYZ1Pk0J.js → LeaderboardProfilePage-CtCiW1ZR.js} +3 -3
  22. package/dashboard/dist/assets/{LimitsPage-wsAp4jGy.js → LimitsPage-DXhNfD6c.js} +3 -3
  23. package/dashboard/dist/assets/{LocalOnlyNotice-DH4MorD1.js → LocalOnlyNotice-CupEXgLA.js} +1 -1
  24. package/dashboard/dist/assets/LoginPage-Bvb6khA_.js +1 -0
  25. package/dashboard/dist/assets/PopoverPopup-1RwMOuZR.js +1 -0
  26. package/dashboard/dist/assets/ResetPasswordPage-C1t2TVSo.js +1 -0
  27. package/dashboard/dist/assets/Select-35dakfdf.js +1 -0
  28. package/dashboard/dist/assets/SelectItemText-Bn80bCzm.js +1 -0
  29. package/dashboard/dist/assets/SettingsPage-BtNI2EB5.js +1 -0
  30. package/dashboard/dist/assets/SkillsPage-DrtaOCt8.js +1 -0
  31. package/dashboard/dist/assets/WidgetsPage-DBP3CcAv.js +1 -0
  32. package/dashboard/dist/assets/{WrappedPage-CA9NmFM8.js → WrappedPage-Dxzewd0b.js} +1 -1
  33. package/dashboard/dist/assets/agent-logos-DXWdLSyr.js +1 -0
  34. package/dashboard/dist/assets/{arrow-up-right-DfeFj5sx.js → arrow-up-right-CAv_ofGl.js} +1 -1
  35. package/dashboard/dist/assets/check-BzPtb9x7.js +1 -0
  36. package/dashboard/dist/assets/copy-CkAl55Gc.js +1 -0
  37. package/dashboard/dist/assets/{download-CAPdZzcq.js → download-CHuHPQRG.js} +1 -1
  38. package/dashboard/dist/assets/format-tokens-BhF7ktma.js +1 -0
  39. package/dashboard/dist/assets/info-4RqgE-Sk.js +1 -0
  40. package/dashboard/dist/assets/main-CjU-7igC.css +1 -0
  41. package/dashboard/dist/assets/{main-QK2wZyt4.js → main-Cy1-zTjI.js} +69 -40
  42. package/dashboard/dist/assets/use-community-stats-BHARwgjJ.js +1 -0
  43. package/dashboard/dist/assets/{use-limits-display-prefs-CC1SjRQA.js → use-limits-display-prefs-D6TuBuXc.js} +1 -1
  44. package/dashboard/dist/assets/use-native-settings-8aQ6BEe6.js +1 -0
  45. package/dashboard/dist/assets/{use-ordered-list-DykwKTTq.js → use-ordered-list-B0XApham.js} +1 -1
  46. package/dashboard/dist/assets/{use-quality-per-dollar-pref-VMVZhzOm.js → use-quality-per-dollar-pref-DNa5uaGP.js} +1 -1
  47. package/dashboard/dist/assets/{use-usage-limits-CIwmIjBw.js → use-usage-limits-C1V3apqc.js} +1 -1
  48. package/dashboard/dist/assets/{useCurrency-Bm3doFX6.js → useCurrency-BEkNDMgc.js} +1 -1
  49. package/dashboard/dist/assets/useScrollLock-BRpWM_0H.js +1 -0
  50. package/dashboard/dist/brand-logos/deepseek.svg +1 -0
  51. package/dashboard/dist/index.html +2 -2
  52. package/dashboard/dist/share.html +2 -2
  53. package/package.json +1 -1
  54. package/src/commands/serve.js +32 -1
  55. package/src/lib/browser-auth.js +120 -20
  56. package/src/lib/cloud-account.js +8 -6
  57. package/src/lib/local-api.js +98 -56
  58. package/src/lib/pricing/seed-snapshot.json +1 -1
  59. package/dashboard/dist/assets/ActivityHeatmap-Cd928Ptz.js +0 -42
  60. package/dashboard/dist/assets/ConfirmModal-BJryA878.js +0 -1
  61. package/dashboard/dist/assets/DashboardPage-CikzR9-n.js +0 -19
  62. package/dashboard/dist/assets/DevicePage-Cucg8IJm.js +0 -1
  63. package/dashboard/dist/assets/DialogTitle-CBT-8O9t.js +0 -1
  64. package/dashboard/dist/assets/LandingPage-BR1-nUHp.js +0 -4415
  65. package/dashboard/dist/assets/LeaderboardAvatar-DbGYLk_s.js +0 -1
  66. package/dashboard/dist/assets/LeaderboardPage-BFPX67-5.js +0 -2
  67. package/dashboard/dist/assets/LoginPage-BNXijxzk.js +0 -1
  68. package/dashboard/dist/assets/PopoverPopup-Dqz11HEi.js +0 -1
  69. package/dashboard/dist/assets/ResetPasswordPage-CWvCPu5G.js +0 -1
  70. package/dashboard/dist/assets/Select-B1n0PW4j.js +0 -1
  71. package/dashboard/dist/assets/SelectItemText-BYGw7q1R.js +0 -1
  72. package/dashboard/dist/assets/SettingsPage-CCwxdKVg.js +0 -1
  73. package/dashboard/dist/assets/SkillsPage-ds_IoVAo.js +0 -1
  74. package/dashboard/dist/assets/WidgetsPage-DCI26iOU.js +0 -1
  75. package/dashboard/dist/assets/agent-logos-BASBNeBF.js +0 -1
  76. package/dashboard/dist/assets/main-B6BudUsC.css +0 -1
  77. package/dashboard/dist/assets/use-native-settings-BeV60g8D.js +0 -1
  78. package/dashboard/dist/assets/useScrollLock-DecJNW0u.js +0 -1
@@ -1 +0,0 @@
1
- import{R as l,j as c,V as h}from"./main-QK2wZyt4.js";function x(n){let t=0;const e=String(n??"");for(let r=0;r<e.length;r+=1)t=Math.imul(31,t)+e.charCodeAt(r)|0;return Math.abs(t)%360}function d(n){const t=String(n??"").trim();if(!t)return"?";const e=t.split(/\s+/).filter(Boolean);if(e.length>=2){const r=e[0][0]||"",i=e[1][0]||"";return`${r}${i}`.toUpperCase()}return t.slice(0,2).toUpperCase()}const m={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 g({avatarUrl:n,displayName:t,seed:e,size:r="md",className:i}){const o=m[r]||m.md,f=x(e??t??""),s=typeof n=="string"?n.trim():"",[u,a]=l.useState(!1);return l.useEffect(()=>{a(!1)},[s]),s&&!u?c.jsx("img",{src:s,alt:"",referrerPolicy:"no-referrer",onError:()=>a(!0),className:h("rounded-full object-cover ring-1 ring-white/10",o,i)}):c.jsx("div",{className:h("flex shrink-0 items-center justify-center rounded-full font-semibold text-white ring-1 ring-white/10",o,i),style:{backgroundColor:`hsl(${f} 42% 34%)`},"aria-hidden":!0,children:d(t)})}export{g as L};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LeaderboardProfileModal-BFCT2cD1.js","assets/main-QK2wZyt4.js","assets/main-B6BudUsC.css","assets/useCurrency-Bm3doFX6.js","assets/LeaderboardAvatar-DbGYLk_s.js","assets/ActivityHeatmap-Cd928Ptz.js","assets/DialogTitle-CBT-8O9t.js","assets/useScrollLock-DecJNW0u.js","assets/arrow-up-right-DfeFj5sx.js"])))=>i.map(i=>d[i]);
2
- import{c as oa,j as e,V as d,r as i,G as s,av as na,aw as sa,W as ia,Y as la,ax as da,i as ca,f as ua,ay as ma,az as ga,aA as re,a4 as xa,aB as ba,m as pa,U as ha,L as ya,J as fa,ag as Re,H as ka,aC as wa,aD as va,aE as Se,aF as ja,a2 as Na,K as _a}from"./main-QK2wZyt4.js";import{S as Sa}from"./Select-B1n0PW4j.js";import{a as Ca,C as La,u as Pa,b as Ka,c as Ce,D as Aa,d as Ea,S as Ma,h as Ta,s as Ra,K as za,P as Ia}from"./use-ordered-list-DykwKTTq.js";import{u as Ba}from"./useCurrency-Bm3doFX6.js";import{L as te}from"./LeaderboardAvatar-DbGYLk_s.js";import"./SelectItemText-BYGw7q1R.js";import"./useScrollLock-DecJNW0u.js";const Ua=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],$a=oa("arrow-right",Ua),Da=a=>{let{transform:t}=a;return{...t,y:0}};function O(a,{min:t,max:o,fallback:n}){const c=Number(a);if(!Number.isFinite(c))return n;const l=Math.floor(c);return l<t?t:l>o?o:l}function Oa(a,t){const o=O(t,{min:0,max:1e6,fallback:0}),n=O(a,{min:1,max:Math.max(1,o||1),fallback:1});if(o<=1)return[1];const c=new Set([1,o,n-2,n-1,n,n+1,n+2]),l=Array.from(c).filter(m=>Number.isInteger(m)&&m>=1&&m<=o).sort((m,h)=>m-h),b=[];let p=null;for(const m of l)p!=null&&m-p>1&&b.push(null),b.push(m),p=m;return b}function Fa({page:a,totalPages:t}){const o=typeof t=="number"&&Number.isFinite(t)&&t>=0,n=o?O(t,{min:0,max:1e6,fallback:0}):null,c=O(a,{min:1,max:o?Math.max(1,n||1):1e6,fallback:1}),l=c>1,b=o?c<n:!0;return{canPrev:l,canNext:b,safePage:c,safeTotal:n}}function Ga({entries:a,me:t,meLabel:o}){const n=Array.isArray(a)?a:[],c=t&&typeof t.rank=="number"?t.rank:null;return!c||n.some(b=>!!b?.is_me)?n:[{rank:c,is_me:!0,is_pinned:!0,user_id:t?.user_id??null,display_name:o,avatar_url:t?.avatar_url??null,github_url:null,is_public:!1,gpt_tokens:t?.gpt_tokens??"0",claude_tokens:t?.claude_tokens??"0",gemini_tokens:t?.gemini_tokens??"0",cursor_tokens:t?.cursor_tokens??"0",opencode_tokens:t?.opencode_tokens??"0",openclaw_tokens:t?.openclaw_tokens??"0",hermes_tokens:t?.hermes_tokens??"0",kiro_tokens:t?.kiro_tokens??"0",copilot_tokens:t?.copilot_tokens??"0",kimi_tokens:t?.kimi_tokens??"0",other_tokens:t?.other_tokens??"0",total_tokens:t?.total_tokens??"0",estimated_cost_usd:t?.estimated_cost_usd??null},...n]}function Ya(a,t){const o=Number(a),n=Number(t);return!Number.isFinite(o)||o<1||!Number.isFinite(n)||n<1?null:Math.ceil(o/n)}const Ha=new Set(["/brand-logos/cursor.svg","/brand-logos/kimi.svg","/brand-logos/kiro.svg","/brand-logos/copilot.svg","/brand-logos/hermes.svg"]);function Wa({iconSrc:a,label:t}){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 ${Ha.has(a)?"dark:invert":""}`}):null,e.jsx("span",{className:"whitespace-nowrap",children:t})]})}const J=[{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}],ze="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",Ie="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 oe(a){return d("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-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function ne(a){return d("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-brand-50 dark:bg-emerald-950":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60")}function j({className:a}){return e.jsx("div",{className:d("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",a)})}function Ja({index:a}){const t=a<3?"w-24":a<8?"w-20":"w-16",o=a<3?"w-16":"w-12",n=a<5?"w-14":"w-10";return e.jsxs("tr",{className:"group",children:[e.jsx("td",{className:d(oe(!1),"!group-hover:bg-transparent"),children:e.jsx(j,{className:"h-4 w-6"})}),e.jsx("td",{className:d(ne(!1),"!group-hover:bg-transparent"),children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(j,{className:"h-8 w-8 min-w-8 rounded-full"}),e.jsx(j,{className:d("h-4",t)})]})}),e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(j,{className:d("h-4",o)})}),e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(j,{className:"h-4 w-12"})}),J.map(c=>e.jsx("td",{className:"px-4 py-4 bg-white dark:bg-oai-gray-950",children:e.jsx(j,{className:d("h-4",n)})},c.key))]})}function Va({rows:a=10}){return e.jsx("div",{className:"w-full overflow-x-auto",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:d(ze,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(j,{className:"h-3.5 w-6"})}),e.jsx("th",{className:d(Ie,"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(j,{className:"h-3.5 w-12"})}),e.jsx("th",{className:"px-4 py-4",children:e.jsx(j,{className:"h-3.5 w-10"})}),e.jsx("th",{className:"px-4 py-4",children:e.jsx(j,{className:"h-3.5 w-14"})}),J.map(t=>e.jsx("th",{className:"px-4 py-4",children:e.jsx(j,{className:"h-3.5 w-12"})},t.key))]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:Array.from({length:a},(t,o)=>e.jsx(Ja,{index:o},o))})]})})}function Za({id:a,thClassName:t,children:o}){const{attributes:n,listeners:c,setNodeRef:l,transform:b,transition:p,isDragging:m}=Ca({id:a}),h=La.Transform.toString(b)||"";i.useLayoutEffect(()=>{const y=document.querySelectorAll(`td[data-column-key="${a}"]`),f="0 2px 10px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06)";return y.forEach(g=>{g.style.transform=h,g.style.transition=p||"",g.style.zIndex=m?"20":"",g.style.position=h?"relative":"",g.style.boxShadow=m?f:""}),()=>{y.forEach(g=>{g.style.transform="",g.style.transition="",g.style.zIndex="",g.style.position="",g.style.boxShadow=""})}},[a,h,p,m]);const L={transform:h,transition:p,position:h?"relative":void 0,zIndex:m?20:void 0,boxShadow:m?"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:l,style:L,className:d(t,"group/col select-none cursor-grab active:cursor-grabbing touch-none"),...n,...c,children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx("span",{"aria-hidden":"true",className:d("-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",m&&"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 qa="tokentracker.leaderboard.columnOrder.v1";function Xa(a){return Pa(qa,a)}const Qa=50;function er(a,t){const o=Number(a),n=Number(t);return!Number.isFinite(o)||o<1||!Number.isFinite(n)||n<1?null:Math.min(100,Math.max(1,Math.ceil(o/n*100)))}function Be(a){return typeof a=="string"?a.trim():""}function ar(a){const t=Be(a);return t?t.toLowerCase()==="anonymous":!0}function rr({me:a,totalEntries:t,meLabel:o,onOpenProfile:n,onJumpToMe:c,canJump:l,className:b}){const p=a&&typeof a.rank=="number"?a.rank:null;if(!p)return null;const m=Number(t)||0,h=er(p,m),L=Be(a?.display_name),y=!L||ar(L)?o||"You":L,f=a?.user_id||y,g=n||(l?c:null),A=typeof g=="function",E=A?"button":"div",V=A?{type:"button",onClick:g,"aria-label":s(n?"leaderboard.summary.view_profile":"leaderboard.summary.jump_to_me")}:{};return e.jsxs(E,{...V,className:d("group inline-flex h-9 items-center gap-2.5 rounded-full border pl-1 pr-3.5 transition-all duration-300 select-none shadow-[0_1px_2px_rgba(0,0,0,0.03)]",A?"border-oai-gray-200 hover:border-oai-brand-400 dark:border-oai-gray-800 dark:hover:border-oai-brand-500/80 bg-oai-gray-50/50 dark:bg-white/[0.02] backdrop-blur-md hover:bg-oai-brand-50/40 dark:hover:bg-oai-brand-950/20 active:scale-[0.97] hover:shadow-[0_4px_12px_rgba(0,0,0,0.05)] dark:hover:shadow-[0_4px_20px_rgba(0,0,0,0.25)] 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]",b),children:[e.jsx(te,{size:"sm",avatarUrl:a?.avatar_url,displayName:y,seed:f}),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-brand-600 dark:group-hover:text-oai-brand-400 transition-colors",children:y}),e.jsxs("span",{className:"text-xs font-bold tabular-nums text-oai-gray-800 dark:text-white",children:["#",p.toLocaleString()]}),h!=null&&h<=Qa&&e.jsx("span",{className:d("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",h<=10?"bg-amber-500/10 text-amber-600 dark:bg-amber-500/15 dark:text-amber-400 ring-amber-500/20":"bg-oai-brand-100/50 text-oai-brand-700 dark:bg-oai-brand-500/10 dark:text-oai-brand-400 ring-oai-brand-500/10"),children:s("leaderboard.summary.percentile",{p:String(h)})}),A?e.jsx($a,{"aria-hidden":!0,className:"size-3 text-oai-gray-400 transition-all duration-300 group-hover:text-oai-brand-500 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-emerald-400 opacity-75 duration-1000"}),e.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-500"})]})]})}const tr=i.lazy(()=>Na(()=>import("./LeaderboardProfileModal-BFCT2cD1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(a=>({default:a.LeaderboardProfileModal}))),se=[10,20,50,100],ie=20,Ue="tokentracker:leaderboard:pageSize";function or(){if(typeof window>"u")return ie;try{const a=window.localStorage.getItem(Ue),t=Number(a);if(se.includes(t))return t}catch{}return ie}function Le(a,t,o){const n=Number(a);if(!Number.isFinite(n)||n<=0)return"-";const c=ka(t),l=t===_a?n:n*o;return l>=1e3?`${c}${Math.round(l).toLocaleString()}`:l>=10?`${c}${Math.round(l)}`:`${c}${l.toFixed(2)}`}function Pe({value:a}){return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"sm:hidden",children:fa(a)}),e.jsx("span",{className:"hidden sm:inline",children:Re(a)})]})}function Ke(a,t,o){const n=t?"text-oai-gray-700 dark:text-oai-gray-300":"text-oai-gray-500 dark:text-oai-gray-400",c=t?"bg-oai-brand-50 dark:bg-oai-brand-900/10":"bg-white dark:bg-oai-gray-950 group-hover:bg-oai-gray-50 dark:group-hover:bg-oai-gray-900/60";return o.map(l=>e.jsx("td",{"data-column-key":l.key,className:d("hidden sm:table-cell px-3 sm:px-4 py-4 whitespace-nowrap text-right tabular-nums",n,c),children:Re(a?.[l.key])},l.key))}const nr={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 Ae({rank:a,placeholder:t}){const o=nr[a];return o?e.jsx("span",{className:d("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??t})}function Ee(a){if(typeof a!="string")return null;const t=a.trim().toLowerCase();return t==="week"||t==="month"||t==="total"?t:null}function sr(a){if(!a)return s("shared.error.prefix",{error:s("leaderboard.error.unknown")});const t=a?.message||String(a),o=String(t||"").trim()||s("leaderboard.error.unknown");return s("shared.error.prefix",{error:o})}function $e(a){return typeof a!="string"?"":a.trim()}function ir(a){const t=$e(a);return t?t.toLowerCase()==="anonymous":!0}function Me(a,t){const o=typeof a?.user_id=="string"?a.user_id.trim():"";return o||`${a?.rank??""}:${t}`}function Te({githubUrl:a}){return e.jsxs("span",{className:"relative inline-flex items-center group/gh shrink-0",children:[e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",onClick:t=>t.stopPropagation(),"aria-label":s("leaderboard.github.aria"),className:"text-oai-black hover:text-oai-gray-500 dark:text-white dark:hover:text-oai-gray-400 transition-colors",children:e.jsx(ha,{provider:"GITHUB",size:16})}),e.jsxs("span",{role:"tooltip",className:"invisible opacity-0 group-hover/gh:visible group-hover/gh:opacity-100 absolute right-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(ya,{to:"/settings",onClick:t=>t.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 hr({auth:a,signedIn:t,sessionSoftExpired:o}){const n=na(),c=sa(),{openLoginModal:l}=ia(),{signedIn:b,loading:p,user:m}=la(),{currency:h,rate:L}=Ba(),y=i.useMemo(()=>da(),[]),f=ca(),g=t&&!o,A=i.useMemo(()=>g&&(typeof a=="function"||typeof a=="string"||a&&typeof a=="object")?a:null,[a,g]),E=g?A:null,V=g&&ua(E),le=s("shared.placeholder.short"),De=i.useMemo(()=>J.map(r=>r.key),[]),{order:Z,reorder:de}=Xa(De),ce=i.useMemo(()=>{const r=new Map;for(const u of J)r.set(u.key,u);return r},[]),F=i.useMemo(()=>Z.map(r=>ce.get(r)).filter(Boolean),[Z,ce]),Oe=Ka(Ce(Ia,{activationConstraint:{distance:6}}),Ce(za,{coordinateGetter:Ra})),Fe=i.useCallback(r=>{const{active:u,over:w}=r;!w||u.id===w.id||de(String(u.id),String(w.id))},[de]),[q,P]=i.useState(1),[N,Ge]=i.useState(or),[ue,me]=i.useState(null),X=i.useCallback(r=>{typeof r=="string"&&r.trim()&&me(r.trim())},[]),Ye=i.useCallback(()=>me(null),[]),He=i.useCallback(r=>{const u=se.includes(r)?r:ie;Ge(u),P(1);try{window.localStorage.setItem(Ue,String(u))}catch{}},[]),[ge,We]=i.useState(0),[Je,Ve]=i.useState(()=>ma()),[xe,be]=i.useState(!1),v=i.useMemo(()=>{const r=new URLSearchParams(n?.search||"");return Ee(r.get("period"))||"total"},[n?.search]),Ze=r=>{const u=Ee(r);if(!u||u===v)return;const w=new URLSearchParams(n?.search||"");w.set("period",u),P(1),c(`${n?.pathname||"/leaderboard"}?${w.toString()}`,{replace:!0})};i.useEffect(()=>{p||f||b||l()},[b,p,f,l]),i.useEffect(()=>{P(1)},[v]);const G=i.useMemo(()=>(O(q,{min:1,max:1e6,fallback:1})-1)*N,[q,N]),M=i.useMemo(()=>f?"mock":p?"unavailable":b?"cloud":t?"local":y?"public":"unavailable",[p,b,y,f,t]),x=i.useMemo(()=>ga({accessMode:M,baseUrl:y,mockEnabled:f,userId:m?.id||null,period:v,pageSize:N,offset:G}),[m?.id,M,y,G,f,N,v]),[I,B]=i.useState(()=>{const r=re(x);return r?{loading:!1,error:null,data:r.data,contextKey:x}:{loading:!1,error:null,data:null,contextKey:null}});i.useEffect(()=>{if(!y&&!f||!f&&M==="unavailable"){B({loading:!1,error:null,data:null,contextKey:null});return}const r=re(x);let u=!0;return B(r?{loading:!1,error:null,data:r.data,contextKey:x}:{loading:!0,error:null,data:null,contextKey:null}),(async()=>{const w=await xa({userId:m?.id||null,period:v,limit:N,offset:G});u&&(ba(w,{activeContextKey:x,contextKey:x,source:ge>0?"manual-refresh":"page-load"}),B({loading:!1,error:null,data:w,contextKey:x}))})().catch(w=>{if(!u)return;const z=sr(w);B($=>$.contextKey===x?{...$,loading:!1,error:z}:{loading:!1,error:z,data:null,contextKey:x})}),()=>{u=!1}},[y,M,m?.id,x,G,ge,f,v,N]);const Q=i.useMemo(()=>I.contextKey===x?null:re(x),[x,I.contextKey]),k=i.useMemo(()=>I.contextKey===x?I:Q?{loading:!1,error:null,data:Q.data,contextKey:x}:{loading:!!(y||f)&&M!=="unavailable",error:null,data:null,contextKey:x},[M,y,x,I,f,Q]),_=k.data,Y=_?.total_pages??null,qe=_?.total_entries??0,T=_?.page??q,Xe=i.useMemo(()=>Oa(T,Y),[T,Y]),pe=_?.from||null,he=_?.to||null,ye=_?.generated_at||null,K=_?.me||null,H=s("leaderboard.me_label"),Qe=s("leaderboard.anon_label"),fe=s("leaderboard.period.week"),ke=s("leaderboard.period.month"),we=s("leaderboard.period.total"),ve=v==="month"?ke:v==="total"?we:fe,ee=i.useMemo(()=>{const r=Array.isArray(_?.entries)?_.entries:[];return Ga({entries:r,me:K,meLabel:H})},[_?.entries,K,H]),R=i.useMemo(()=>Ya(K?.rank,N),[K?.rank,N]),ea=R!=null&&R===T,aa=i.useCallback(()=>{R!=null&&P(R)},[R]),ra=async()=>{be(!0);try{wa(!0),Ve(!0),await va(()=>Se(E));const r=await Se(E);r&&await ja({accessToken:r,period:v,source:"leaderboard-enable-sync"}),We(u=>u+1)}catch(r){console.warn("[tokentracker] sync:",r)}finally{be(!1)}},{canPrev:je,canNext:Ne}=Fa({page:T,totalPages:Y}),W=Array.isArray(ee)&&ee.length!==0;let U=null;k.loading&&!W?U=e.jsx(Va,{rows:N}):k.error&&!W?U=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:k.error})}):W?U=e.jsx(Aa,{sensors:Oe,collisionDetection:Ea,modifiers:[Da],onDragEnd:Fe,children:e.jsx("div",{className:"w-full overflow-x-auto",children:e.jsxs("table",{className:"min-w-full sm: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:d(ze,"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:d(Ie,"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(Ma,{items:Z,strategy:Ta,children:F.map(r=>e.jsx(Za,{id:r.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(Wa,{iconSrc:r.icon,label:s(r.copyKey)})},r.key))})]})}),e.jsx("tbody",{className:"divide-y divide-oai-gray-100 dark:divide-oai-gray-800/50",children:ee.map((r,u)=>{if(r?.is_ellipsis){const C=4+F.length;return e.jsx("tr",{"aria-hidden":"true",children:e.jsx("td",{colSpan:C,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-${u}`)}const w=!!r?.is_me,z=typeof r?.user_id=="string"?r.user_id:null,$=$e(r?.display_name),ta=ir($)?Qe:$,S=w?H:ta,D=!!z,_e=D?{role:"button",tabIndex:0,onClick:D?()=>X(z):void 0,onKeyDown:D?C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),X(z))}:void 0,"aria-label":s("leaderboard.profile_modal.row_aria",{name:S})}:{};if(w){const C=!!r?.is_pinned;return e.jsxs("tr",{..._e,className:d("bg-oai-brand-50 dark:bg-oai-brand-900/10 transition-colors",C?"border-t border-b border-oai-brand-300/40 dark:border-oai-brand-500/20":"border-y border-oai-brand-300/40 dark:border-oai-brand-500/30",D&&"cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500/60"),children:[e.jsx("td",{className:d(oe(!0),"font-semibold text-oai-brand-600 dark:text-oai-brand-400",C&&"before:absolute before:left-0 before:top-[15%] before:h-[70%] before:w-[3px] before:rounded-r before:bg-oai-brand-500 dark:before:bg-oai-brand-400"),children:e.jsx(Ae,{rank:r?.rank,placeholder:le})}),e.jsx("td",{className:ne(!0),children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(te,{avatarUrl:r?.avatar_url,displayName:S,seed:Me(r,S)}),e.jsx("span",{className:"truncate font-semibold text-oai-black dark:text-oai-white",children:S}),r?.github_url&&e.jsx(Te,{githubUrl:r.github_url})]})}),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-brand-50 dark:bg-oai-brand-900/10",children:e.jsx(Pe,{value:r?.total_tokens})}),e.jsx("td",{className:"hidden sm:table-cell px-3 sm:px-4 py-4 font-medium text-oai-brand-600 dark:text-oai-brand-400 whitespace-nowrap text-right tabular-nums bg-oai-brand-50 dark:bg-oai-brand-900/10",title:"Based on estimated API pricing, not actual billing",children:Le(r?.estimated_cost_usd,h,L)}),Ke(r,!0,F)]},`row-${r?.rank}-${S}${C?"-pin":""}`)}return e.jsxs("tr",{..._e,className:d("group transition-colors",D&&"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-brand-500/60"),children:[e.jsx("td",{className:d(oe(!1),"font-medium text-oai-gray-500 dark:text-oai-gray-400"),children:e.jsx(Ae,{rank:r?.rank,placeholder:le})}),e.jsx("td",{className:ne(!1),children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(te,{avatarUrl:r?.avatar_url,displayName:S,seed:Me(r,S)}),e.jsx("span",{className:"truncate font-medium text-oai-gray-800 dark:text-oai-gray-200",children:S}),r?.github_url&&e.jsx(Te,{githubUrl:r.github_url})]})}),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(Pe,{value:r?.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:Le(r?.estimated_cost_usd,h,L)}),Ke(r,!1,F)]},`row-${r?.rank}-${S}`)})})]})})}):U=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 ae=null;return typeof Y=="number"?ae=Xe.map((r,u)=>r==null?e.jsx("span",{className:"px-2 text-oai-gray-400 dark:text-oai-gray-500",children:s("leaderboard.pagination.ellipsis")},`ellipsis-${u}`):e.jsx("button",{className:d("flex h-8 w-8 items-center justify-center rounded-md text-sm font-medium transition-colors",r===T?"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:()=>P(r),disabled:k.loading,children:String(r)},`page-${r}`)):ae=e.jsx("span",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.pagination.page_unknown",{page:String(T)})}),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-5 sm:mb-6",children:[e.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-2 sm:mb-3",children:s("leaderboard.title")}),e.jsxs("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:[v==="total"?s("leaderboard.range.total"):pe&&he?s("leaderboard.range",{period:ve,from:pe,to:he}):s("leaderboard.range_loading",{period:ve}),ye&&e.jsx("span",{className:"ml-2 pl-2 border-l border-oai-gray-200 dark:border-oai-gray-800 hidden sm:inline-block text-oai-gray-400 dark:text-oai-gray-500 text-xs",children:s("leaderboard.generated_at",{ts:ye})})]})]}),e.jsxs("div",{className:"mb-6 sm:mb-8 flex flex-row items-center justify-between gap-3",children:[e.jsx("div",{className:"inline-flex h-9 p-1 border border-oai-gray-200 dark:border-oai-gray-800 rounded-full items-center relative",children:["week","month","total"].map(r=>{const u=v===r;return e.jsxs("button",{onClick:()=>Ze(r),disabled:k.loading,className:d("px-3 sm:px-4 h-7 text-sm font-medium rounded-full flex items-center justify-center transition-colors relative",u?"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:r==="week"?fe:r==="month"?ke:we}),u&&e.jsx(pa.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}})]},r)})}),e.jsx(rr,{me:K,totalEntries:qe,meLabel:H,onOpenProfile:K?.user_id?()=>X(K.user_id):void 0,onJumpToMe:aa,canJump:R!=null&&!ea&&!k.loading,className:"shrink-0"})]}),!t&&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:l,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")})]}),g&&V&&!Je&&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:ra,disabled:xe,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:xe?s("leaderboard.sync_button.busy"):s("leaderboard.sync_button.idle")})]}),e.jsxs("div",{className:"rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 overflow-hidden",children:[k.error&&W?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:k.error})}):null,U,e.jsxs("div",{className:"px-6 py-3 border-t border-oai-gray-200 dark:border-oai-gray-800 flex flex-wrap items-center justify-end gap-x-4 gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx("label",{htmlFor:"leaderboard-page-size",className:"whitespace-nowrap",children:s("leaderboard.pagination.page_size_label")}),e.jsx(Sa,{id:"leaderboard-page-size",value:N,onValueChange:r=>He(Number(r)),disabled:k.loading,ariaLabel:s("leaderboard.pagination.page_size_label"),options:se.map(r=>({value:r,label:String(r)})),align:"end",className:"px-3 py-1 text-oai-gray-700 dark:text-oai-gray-300"})]}),e.jsx("div",{className:"h-5 w-px bg-oai-gray-200 dark:bg-oai-gray-800","aria-hidden":"true"}),e.jsx("button",{className:d("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",je&&!k.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:()=>P(r=>Math.max(1,r-1)),disabled:!je||k.loading,children:s("leaderboard.pagination.prev")}),e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:ae}),e.jsx("button",{className:d("px-3 py-1.5 text-sm font-medium text-oai-gray-500 dark:text-oai-gray-400 rounded-md transition-colors",Ne&&!k.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:()=>P(r=>r+1),disabled:!Ne||k.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/mm7894215/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.jsx(i.Suspense,{fallback:null,children:e.jsx(tr,{isOpen:!!ue,userId:ue,period:v,accessToken:E,onClose:Ye})})]})}export{hr as LeaderboardPage};
@@ -1 +0,0 @@
1
- import{aw as p,aN as w,Y as v,r,G as s,j as e,L as y,$ as j}from"./main-QK2wZyt4.js";function N(i){const t=new URLSearchParams(i).get("next");return typeof t!="string"||t.length===0||!t.startsWith("/")||t.startsWith("//")?"/dashboard":t}function k(){const i=p(),[t,u]=w(),{enabled:n,loading:f,signedIn:x,refreshUser:g}=v(),c=r.useMemo(()=>N(t.toString()),[t]),[h,d]=r.useState(null);r.useEffect(()=>{const l=t.get("insforge_status"),a=t.get("insforge_type"),m=t.get("insforge_error");l==="success"&&a==="verify_email"?d(s("login.verify_email_success")):l==="error"&&a==="verify_email"&&m&&d(s("shared.error.prefix",{error:m}))},[t]);const o=r.useMemo(()=>t.get("native")==="1",[t]);r.useEffect(()=>{if(!(!n||f)&&x){if(o){window.location.href="/auth/native-callback";return}i(c,{replace:!0})}},[n,f,x,i,c,o]),r.useEffect(()=>{n&&g()},[n,g]),r.useEffect(()=>{if(o&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[o]);const b=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 n?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(y,{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:b,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(j,{hideLogo:!0,title:s("login.title"),subtitle:s("login.subtitle"),className:"p-8 bg-transparent",onSuccess:()=>{o?window.location.href="/auth/native-callback":i(c,{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(y,{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",children:s("login.cloud_only")})})]})}export{k as LoginPage};
@@ -1 +0,0 @@
1
- import{c as we,ba as Ue,bB as Ke,bC as le,bD as We,bE as ne,b8 as ge,r as m,bF as J,bG as me,bH as he,bI as oe,bJ as be,bK as qe,bL as Le,bM as $,b as z,bN as W,aG as ue,b9 as pe,bO as $e,bP as Ee,bQ as Qe,d as ze,bR as Je,bS as Te,bT as q,j as Y,bU as Ze,be as Me,bd as et,bV as tt,bW as nt,bX as ot,bY as st,u as rt,a as He,bZ as it,b_ as ye,b$ as at,c0 as ct,c1 as lt,c2 as ut,bj as ft,c3 as dt,bk as pt}from"./main-QK2wZyt4.js";import{i as Ce,b as Ae,c as Be,g as Pe,d as se,P as gt,e as mt,f as ht,s as Et,F as Tt,h as Ct,j as Pt,k as vt,l as bt,m as Rt,n as _e,o as St,u as Ot,p as It,q as Mt,t as yt,r as xt,I as Ft,v as kt,w as wt,x as Lt,y as Ht,z as At}from"./useScrollLock-DecJNW0u.js";import{f as Bt,p as _t,g as Dt}from"./DialogTitle-CBT-8O9t.js";import{p as Nt,q as jt,r as Yt,t as Gt,v as Vt,w as Xt,x as Ut,y as Kt}from"./SelectItemText-BYGw7q1R.js";const Wt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cn=we("chevron-right",Wt);const qt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=we("loader-circle",qt);function $t(e,n){return n!=null&&!Ce(n)?0:typeof e=="function"?e():e}function ve(e,n,t){const l=$t(e,t);return typeof l=="number"?l:l?.[n]}function xe(e){return typeof e=="function"?e():e}function De(e,n){return n||e==="click"||e==="mousedown"}function Qt(e){return e?.includes("mouse")&&e!=="mousedown"}class Re{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new le,this.restTimeout=new le,this.handleCloseOptions=void 0}static create(){return new Re}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const fe=new WeakMap;function de(e){if(!e.performedPointerEventsMutation)return;const n=e.pointerEventsScopeElement;n&&fe.get(n)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),fe.delete(n)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ne(e,n){const{scopeElement:t,referenceElement:l,floatingElement:i}=n,o=fe.get(t);o&&o!==e&&de(o),de(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=t,e.pointerEventsReferenceElement=l,e.pointerEventsFloatingElement=i,fe.set(t,e),t.style.pointerEvents="none",l.style.pointerEvents="auto",i.style.pointerEvents="auto"}function je(e){const n=e.context.dataRef.current,t=Ue(()=>n.hoverInteractionState??Re.create()).current;return n.hoverInteractionState||(n.hoverInteractionState=t),Ke(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function zt(e,n={}){const{enabled:t=!0,closeDelay:l=0,nodeId:i}=n,o="rootStore"in e?e.rootStore:e,p=o.useState("open"),E=o.useState("floatingElement"),S=o.useState("domReferenceElement"),{dataRef:c}=o.context,r=Ae(),O=Be(),h=je(o),j=We(),u=ne(()=>De(c.current.openEvent?.type,h.interactedInside)),B=ne(()=>Qt(c.current.openEvent?.type)),g=ne(()=>{de(h)});ge(()=>{p||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,g())},[p,h,g]),m.useEffect(()=>g,[g]),ge(()=>{if(t&&p&&h.handleCloseOptions?.blockPointerEvents&&B()&&J(S)&&E){const x=S,a=E,d=me(E),F=r?.nodesRef.current.find(b=>b.id===O)?.context?.elements.floating;F&&(F.style.pointerEvents="");const A=h.pointerEventsScopeElement!==a?h.pointerEventsScopeElement:null,C=F!==a?F:null,v=h.handleCloseOptions?.getScope?.()??A??C??x.closest("[data-rootownerid]")??d.body;return Ne(h,{scopeElement:v,referenceElement:x,floatingElement:a}),()=>{g()}}},[t,p,S,E,h,B,r,O,g]),m.useEffect(()=>{if(!t)return;function x(){return!!(r&&O&&Pe(r.nodesRef.current,O).length>0)}function a(b){const M=ve(l,"close",h.pointerType),D=()=>{o.setOpen(!1,z(W,b)),r?.events.emit("floating.closed",b)};M?h.openChangeTimeout.start(M,D):(h.openChangeTimeout.clear(),D())}function d(b){const M=be(b);if(!qe(M)){h.interactedInside=!1;return}h.interactedInside=M?.closest("[aria-haspopup]")!=null}function F(){h.openChangeTimeout.clear(),j.clear(),r?.events.off("floating.closed",C),g()}function A(b){if(x()&&r){r.events.on("floating.closed",C);return}if(Le(b.relatedTarget,o.context.triggerElements))return;const M=c.current.floatingContext?.nodeId??i,D=b.relatedTarget;if(!(r&&M&&J(D)&&Pe(r.nodesRef.current,M,!1).some(X=>$(X.context?.elements.floating,D)))){if(h.handler){h.handler(b);return}g(),B()&&!u()&&a(b)}}function C(b){!r||!O||x()||j.start(0,()=>{r.events.off("floating.closed",C),o.setOpen(!1,z(W,b)),r.events.emit("floating.closed",b)})}const v=E;return he(v&&oe(v,"mouseenter",F),v&&oe(v,"mouseleave",A),v&&oe(v,"pointerdown",d,!0),()=>{r?.events.off("floating.closed",C)})},[t,E,o,c,l,i,B,u,g,h,r,O,j])}const Jt={current:null};function Zt(e,n={}){const{enabled:t=!0,delay:l=0,handleClose:i=null,mouseOnly:o=!1,restMs:p=0,move:E=!0,triggerElementRef:S=Jt,externalTree:c,isActiveTrigger:r=!0,getHandleCloseContext:O,isClosing:h,shouldOpen:j}=n,u="rootStore"in e?e.rootStore:e,{dataRef:B,events:g}=u.context,x=Ae(c),a=je(u),d=m.useRef(!1),F=se(i),A=se(l),C=se(p),v=se(t),b=se(j),M=se(h),D=ne(()=>De(B.current.openEvent?.type,a.interactedInside)),V=ne(()=>b.current?.()!==!1),X=ne((s,T,L)=>{const R=u.context.triggerElements;if(R.hasElement(T))return!s||!$(s,T);if(!J(L))return!1;const f=L;return R.hasMatchingElement(H=>$(H,f))&&(!s||!$(s,f))}),N=ne(()=>{if(!a.handler)return;me(u.select("domReferenceElement")).removeEventListener("mousemove",a.handler),a.handler=void 0}),w=ne(()=>{de(a)});return r&&(a.handleCloseOptions=F.current?.__options),m.useEffect(()=>N,[N]),m.useEffect(()=>{if(!t)return;function s(T){T.open?d.current=!1:(d.current=T.reason===W,N(),a.openChangeTimeout.clear(),a.restTimeout.clear(),a.blockMouseMove=!0,a.restTimeoutPending=!1)}return g.on("openchange",s),()=>{g.off("openchange",s)}},[t,g,a,N]),m.useEffect(()=>{if(!t)return;function s(f,H=!0){const _=ve(A.current,"close",a.pointerType);_?a.openChangeTimeout.start(_,()=>{u.setOpen(!1,z(W,f)),x?.events.emit("floating.closed",f)}):H&&(a.openChangeTimeout.clear(),u.setOpen(!1,z(W,f)),x?.events.emit("floating.closed",f))}const T=S.current??(r?u.select("domReferenceElement"):null);if(!J(T))return;function L(f){if(a.openChangeTimeout.clear(),a.blockMouseMove=!1,o&&!Ce(a.pointerType))return;const H=xe(C.current),_=ve(A.current,"open",a.pointerType),G=be(f),U=f.currentTarget??null,I=u.select("domReferenceElement");let k=U;if(J(G)&&!u.context.triggerElements.hasElement(G)){for(const Ie of u.context.triggerElements.elements())if($(Ie,G)){k=Ie;break}}J(U)&&J(I)&&!u.context.triggerElements.hasElement(U)&&$(U,I)&&(k=I);const P=k==null?!1:X(I,k,G),Q=u.select("open"),Z=M.current?.()??u.select("transitionStatus")==="ending",K=!Q&&Z&&d.current,ee=!P&&J(k)&&J(I)&&$(I,k)&&K,te=H>0&&!_,Xe=P&&(Q||K)||ee,Oe=!Q||P;if(Xe){V()&&u.setOpen(!0,z(W,f,k));return}te||(_?a.openChangeTimeout.start(_,()=>{Oe&&V()&&u.setOpen(!0,z(W,f,k))}):Oe&&V()&&u.setOpen(!0,z(W,f,k)))}function R(f){if(D()){w();return}N();const H=u.select("domReferenceElement"),_=me(H);a.restTimeout.clear(),a.restTimeoutPending=!1;const G=B.current.floatingContext??O?.();if(Le(f.relatedTarget,u.context.triggerElements))return;if(F.current&&G){u.select("open")||a.openChangeTimeout.clear();const I=S.current;a.handler=F.current({...G,tree:x,x:f.clientX,y:f.clientY,onClose(){w(),N(),v.current&&!D()&&I===u.select("domReferenceElement")&&s(f,!0)}}),_.addEventListener("mousemove",a.handler),a.handler(f);return}(a.pointerType!=="touch"||!$(u.select("floatingElement"),f.relatedTarget))&&s(f)}return E?he(oe(T,"mousemove",L,{once:!0}),oe(T,"mouseenter",L),oe(T,"mouseleave",R)):he(oe(T,"mouseenter",L),oe(T,"mouseleave",R))},[N,w,B,A,u,t,F,a,r,X,D,o,E,C,S,x,v,O,M,V]),m.useMemo(()=>{if(!t)return;function s(T){a.pointerType=T.pointerType}return{onPointerDown:s,onPointerEnter:s,onMouseMove(T){const{nativeEvent:L}=T,R=T.currentTarget,f=u.select("domReferenceElement"),H=u.select("open"),_=X(f,R,T.target);if(o&&!Ce(a.pointerType))return;if(H&&_&&a.handleCloseOptions?.blockPointerEvents){const I=u.select("floatingElement");if(I){const k=a.handleCloseOptions?.getScope?.()??R.ownerDocument.body;Ne(a,{scopeElement:k,referenceElement:R,floatingElement:I})}}const G=xe(C.current);if(H&&!_||G===0||!_&&a.restTimeoutPending&&T.movementX**2+T.movementY**2<2)return;a.restTimeout.clear();function U(){if(a.restTimeoutPending=!1,D())return;const I=u.select("open");!a.blockMouseMove&&(!I||_)&&V()&&u.setOpen(!0,z(W,L,R))}a.pointerType==="touch"?ue.flushSync(()=>{U()}):_&&H?U():(a.restTimeoutPending=!0,a.restTimeout.start(G,U))}}},[t,a,D,X,o,u,C,V])}const Fe=.1,en=Fe*Fe,y=.5;function ie(e,n,t,l,i,o){return l>=n!=o>=n&&e<=(i-t)*(n-l)/(o-l)+t}function ae(e,n,t,l,i,o,p,E,S,c){let r=!1;return ie(e,n,t,l,i,o)&&(r=!r),ie(e,n,i,o,p,E)&&(r=!r),ie(e,n,p,E,S,c)&&(r=!r),ie(e,n,S,c,t,l)&&(r=!r),r}function tn(e,n,t){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function ce(e,n,t,l,i,o){const p=Math.min(t,i),E=Math.max(t,i),S=Math.min(l,o),c=Math.max(l,o);return e>=p&&e<=E&&n>=S&&n<=c}function nn(e={}){const{blockPointerEvents:n=!1}=e,t=new le,l=({x:i,y:o,placement:p,elements:E,onClose:S,nodeId:c,tree:r})=>{const O=p?.split("-")[0];let h=!1,j=null,u=null,B=typeof performance<"u"?performance.now():0;function g(a,d){const F=performance.now(),A=F-B;if(j===null||u===null||A===0)return j=a,u=d,B=F,!1;const C=a-j,v=d-u,b=C*C+v*v,M=A*A*en;return j=a,u=d,B=F,b<M}function x(){t.clear(),S()}return function(d){t.clear();const F=E.domReference,A=E.floating;if(!F||!A||O==null||i==null||o==null)return;const{clientX:C,clientY:v}=d,b=be(d),M=d.type==="mouseleave",D=$(A,b),V=$(F,b);if(D&&(h=!0,!M))return;if(V&&(h=!1,!M)){h=!0;return}if(M&&J(d.relatedTarget)&&$(A,d.relatedTarget))return;function X(){return!!(r&&Pe(r.nodesRef.current,c).length>0)}function N(){X()||x()}if(X())return;const w=F.getBoundingClientRect(),s=A.getBoundingClientRect(),T=i>s.right-s.width/2,L=o>s.bottom-s.height/2,R=s.width>w.width,f=s.height>w.height,H=(R?w:s).left,_=(R?w:s).right,G=(f?w:s).top,U=(f?w:s).bottom;if(O==="top"&&o>=w.bottom-1||O==="bottom"&&o<=w.top+1||O==="left"&&i>=w.right-1||O==="right"&&i<=w.left+1){N();return}let I=!1;switch(O){case"top":I=ce(C,v,H,w.top+1,_,s.bottom-1);break;case"bottom":I=ce(C,v,H,s.top+1,_,w.bottom-1);break;case"left":I=ce(C,v,s.right-1,U,w.left+1,G);break;case"right":I=ce(C,v,w.right-1,U,s.left+1,G);break}if(I)return;if(h&&!tn(C,v,w)){N();return}if(!M&&g(C,v)){N();return}let k=!1;switch(O){case"top":{const P=R?y/2:y*4,Q=R||T?i+P:i-P,Z=R?i-P:T?i+P:i-P,K=o+y+1,ee=T||R?s.bottom-y:s.top,te=T?R?s.bottom-y:s.top:s.bottom-y;k=ae(C,v,Q,K,Z,K,s.left,ee,s.right,te);break}case"bottom":{const P=R?y/2:y*4,Q=R||T?i+P:i-P,Z=R?i-P:T?i+P:i-P,K=o-y,ee=T||R?s.top+y:s.bottom,te=T?R?s.top+y:s.bottom:s.top+y;k=ae(C,v,Q,K,Z,K,s.left,ee,s.right,te);break}case"left":{const P=f?y/2:y*4,Q=f||L?o+P:o-P,Z=f?o-P:L?o+P:o-P,K=i+y+1,ee=L||f?s.right-y:s.left,te=L?f?s.right-y:s.left:s.right-y;k=ae(C,v,ee,s.top,te,s.bottom,K,Q,K,Z);break}case"right":{const P=f?y/2:y*4,Q=f||L?o+P:o-P,Z=f?o-P:L?o+P:o-P,K=i-y,ee=L||f?s.left+y:s.right,te=L?f?s.left+y:s.right:s.left+y;k=ae(C,v,K,Q,K,Z,ee,s.top,te,s.bottom);break}}k?h||t.start(40,N):N()}};return l.__options={...e,blockPointerEvents:n},l}const Ye=m.createContext(void 0);function re(e){const n=m.useContext(Ye);if(n===void 0&&!e)throw new Error(pe(47));return n}function on(){return{...Dt(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const sn={..._t,disabled:q(e=>e.disabled),instantType:q(e=>e.instantType),openMethod:q(e=>e.openMethod),openChangeReason:q(e=>e.openChangeReason),modal:q(e=>e.modal),focusManagerModal:q(e=>e.focusManagerModal),stickIfOpen:q(e=>e.stickIfOpen),titleElementId:q(e=>e.titleElementId),descriptionElementId:q(e=>e.descriptionElementId),openOnHover:q(e=>e.openOnHover),closeDelay:q(e=>e.closeDelay),hasViewport:q(e=>e.hasViewport)};class Se extends $e{constructor(n,t,l=!1){const i={...on(),...n},o=new gt;i.open&&n?.mounted===void 0&&(i.mounted=!0),i.floatingRootContext=Bt(o,t,l),super(i,{popupRef:m.createRef(),backdropRef:m.createRef(),internalBackdropRef:m.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:m.createRef(),beforeContentFocusGuardRef:m.createRef(),stickIfOpenTimeout:new le,triggerElements:o},sn)}setOpen=(n,t)=>{const l=t.reason===W,i=t.reason===Ee&&t.event.detail===0,o=!n&&(t.reason===Qe||t.reason==null),p=mt(t),E=this.select("activeTriggerId");if(!n&&t.reason===ze&&t.trigger==null&&E!=null&&(t.trigger=this.context.triggerElements.getById(E)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(n,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,t);const S=()=>{const c={open:n,openChangeReason:t.reason};Et(c,n,t.trigger,p()),this.update(c)};l?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Je,()=>{this.set("stickIfOpen",!1)}),ue.flushSync(S)):S(),i||o?this.set("instantType",i?"click":"dismiss"):t.reason===Te?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(n,t){const{store:l,internalStore:i}=ht(n,(o,p)=>new Se(t,o,p));return m.useEffect(()=>i?.disposeEffect(),[i]),l}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function ke({props:e}){const{children:n,open:t,defaultOpen:l=!1,onOpenChange:i,onOpenChangeComplete:o,modal:p=!1,handle:E,triggerId:S,defaultTriggerId:c=null}=e,r=Se.useStore(E?.store,{modal:p,open:l,openProp:t,activeTriggerId:c,triggerIdProp:S});Ct(r,t,l,c),r.useControlledProp("openProp",t),r.useControlledProp("triggerIdProp",S);const O=r.useState("open"),h=r.useState("mounted"),j=r.useState("payload"),u=Be()!=null;r.useContextCallback("onOpenChange",i),r.useContextCallback("onOpenChangeComplete",o),Pt(r,O),vt(r);const{forceUnmount:B}=bt(O,r,()=>{r.update({stickIfOpen:!0,openChangeReason:null})});r.useSyncedValues({modal:p,nested:u}),m.useEffect(()=>{O||r.context.stickIfOpenTimeout.clear()},[r,O]);const g=m.useCallback(()=>{r.setOpen(!1,z(Ze))},[r]);m.useImperativeHandle(e.actionsRef,()=>({unmount:B,close:g}),[B,g]);const x=O||h,a=m.useMemo(()=>({store:r}),[r]);return Y.jsxs(Ye.Provider,{value:a,children:[x&&Y.jsx(rn,{store:r,modal:p}),typeof n=="function"?n({payload:j}):n]})}function vn(e){return re(!0)?Y.jsx(ke,{props:e}):Y.jsx(Tt,{children:Y.jsx(ke,{props:e})})}function rn({store:e,modal:n}){const t=e.useState("floatingRootContext"),l=Rt(t,{outsidePressEvent:{mouse:n==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),i=l.reference??Me,o=l.trigger??Me,p=m.useMemo(()=>et(_e,l.floating),[l.floating]);return St(e,{activeTriggerProps:i,inactiveTriggerProps:o,popupProps:p}),null}const an=300;function cn(e,n){const t=m.useRef(null);function l(o){ue.flushSync(()=>{e.setOpen(!1,z(Te,o.nativeEvent,o.currentTarget))}),st(t.current)?.focus()}function i(o){const p=e.select("positionerElement");if(p&&tt(o,p))e.context.beforeContentFocusGuardRef.current?.focus();else{ue.flushSync(()=>{e.setOpen(!1,z(Te,o.nativeEvent,o.currentTarget))});let E=nt(e.context.triggerFocusTargetRef.current||n.current);for(;E!==null&&$(p,E);){const S=E;if(E=ot(E),E===S)break}E?.focus()}}return{preFocusGuardRef:t,handlePreFocusGuardFocus:l,handleFocusTargetFocus:i}}const bn=m.forwardRef(function(n,t){const{render:l,className:i,style:o,disabled:p=!1,nativeButton:E=!0,handle:S,payload:c,openOnHover:r=!1,delay:O=an,closeDelay:h=0,id:j,...u}=n,B=re(!0),g=S?.store??B?.store;if(!g)throw new Error(pe(74));const x=Ot(j),a=g.useState("isTriggerActive",x),d=g.useState("floatingRootContext"),F=g.useState("isOpenedByTrigger",x),A=g.useState("triggerPopupId",x),C=m.useRef(null),{registerTrigger:v,isMountedByThisTrigger:b}=It(x,C,g,{payload:c,disabled:p,openOnHover:r,closeDelay:h}),M=g.useState("openChangeReason"),D=g.useState("stickIfOpen"),V=g.useState("openMethod"),X=g.useState("focusManagerModal"),N=Zt(d,{enabled:!p&&d!=null&&r&&(V!=="touch"||M!==Ee),mouseOnly:!0,move:!1,handleClose:nn(),restMs:O,delay:{close:h},triggerElementRef:C,isActiveTrigger:a,isClosing:()=>g.select("transitionStatus")==="ending"}),w=Nt(d,{enabled:d!=null,stickIfOpen:D}),s=jt(()=>g.select("open"),k=>{g.set("openMethod",k)}),T=g.useState("triggerProps",b),{getButtonProps:L,buttonRef:R}=rt({disabled:p,native:E}),f={open(k){return k&&M===Ee?Mt.open(k):yt.open(k)}},{preFocusGuardRef:H,handlePreFocusGuardFocus:_,handleFocusTargetFocus:G}=cn(g,C),I=He("button",n,{state:{disabled:p,open:F},ref:[R,t,v,C],props:[w.reference,N,T,s,{[it]:"",id:x,"aria-haspopup":"dialog","aria-expanded":F,"aria-controls":A},u,L],stateAttributesMapping:f});return b&&!X?Y.jsxs(m.Fragment,{children:[Y.jsx(ye,{ref:H,onFocus:_}),Y.jsx(m.Fragment,{children:I},x),Y.jsx(ye,{ref:g.context.triggerFocusTargetRef,onFocus:G})]}):Y.jsx(m.Fragment,{children:I},x)}),Ge=m.createContext(void 0);function ln(){const e=m.useContext(Ge);if(e===void 0)throw new Error(pe(45));return e}const Rn=m.forwardRef(function(n,t){const{keepMounted:l=!1,...i}=n,{store:o}=re();return o.useState("mounted")||l?Y.jsx(Ge.Provider,{value:l,children:Y.jsx(at,{ref:t,...i})}):null}),Ve=m.createContext(void 0);function un(){const e=m.useContext(Ve);if(!e)throw new Error(pe(46));return e}const Sn=m.forwardRef(function(n,t){const{render:l,className:i,style:o,anchor:p,positionMethod:E="absolute",side:S="bottom",align:c="center",sideOffset:r=0,alignOffset:O=0,collisionBoundary:h="clipping-ancestors",collisionPadding:j=5,arrowPadding:u=5,sticky:B=!1,disableAnchorTracking:g=!1,collisionAvoidance:x=ct,...a}=n,{store:d}=re(),F=ln(),A=xt(),C=d.useState("floatingRootContext"),v=d.useState("mounted"),b=d.useState("open"),M=d.useState("openChangeReason"),D=d.useState("activeTriggerElement"),V=d.useState("modal"),X=d.useState("openMethod"),N=d.useState("positionerElement"),w=d.useState("instantType"),s=d.useState("transitionStatus"),T=d.useState("hasViewport"),L=m.useRef(null),R=lt(N,!1,!1),f=Yt({anchor:p,floatingRootContext:C,positionMethod:E,mounted:v,side:S,sideOffset:r,align:c,alignOffset:O,arrowPadding:u,collisionBoundary:h,collisionPadding:j,sticky:B,disableAnchorTracking:g,keepMounted:F,nodeId:A,collisionAvoidance:x,adaptiveOrigin:T?Xt:void 0}),H=C.useState("domReferenceElement");ge(()=>{const I=H,k=L.current;if(I&&(L.current=I),k&&I&&I!==k){d.set("instantType",void 0);const P=new AbortController;return R(()=>{d.set("instantType","trigger-change")},P.signal),()=>{P.abort()}}},[H,R,d]),Gt(b&&V===!0&&M!==W,X==="touch",N,D);const _=m.useCallback(I=>{d.set("positionerElement",I)},[d]),G={open:b,side:f.side,align:f.align,anchorHidden:f.anchorHidden,instant:w},U=Vt(n,G,{styles:f.positionerStyles,transitionStatus:s,props:a,refs:[t,_],hidden:!v,inert:!b});return Y.jsxs(Ve.Provider,{value:f,children:[v&&V===!0&&M!==W&&Y.jsx(Ft,{ref:d.context.internalBackdropRef,inert:ut(!b),cutout:D}),Y.jsx(kt,{id:A,children:U})]})}),fn=m.createContext(void 0);function dn(){const[e,n]=m.useState(0),t=ne(()=>(n(i=>i+1),()=>{n(i=>Math.max(0,i-1))}));return{context:m.useMemo(()=>({register:t}),[t]),hasClosePart:e>0}}function pn(e){const{value:n,children:t}=e;return Y.jsx(fn.Provider,{value:n,children:t})}const gn={...At,...pt},On=m.forwardRef(function(n,t){const{render:l,className:i,style:o,initialFocus:p,finalFocus:E,...S}=n,{store:c}=re(),r=un(),O=Ut()!=null,{context:h,hasClosePart:j}=dn(),u=c.useState("open"),B=c.useState("openMethod"),g=c.useState("instantType"),x=c.useState("transitionStatus"),a=c.useState("popupProps"),d=c.useState("titleElementId"),F=c.useState("descriptionElementId"),A=c.useState("modal"),C=c.useState("mounted"),v=c.useState("openChangeReason"),b=c.useState("activeTriggerElement"),M=c.useState("floatingRootContext"),D=M.useState("floatingId"),V=c.useState("disabled"),X=c.useState("openOnHover"),N=c.useState("closeDelay"),w=S.id??D;ft({open:u,ref:c.context.popupRef,onComplete(){u&&c.context.onOpenChangeComplete?.(!0)}}),zt(M,{enabled:X&&!V,closeDelay:N});const s=p===void 0?wt(c.context.popupRef):p,T=A!==!1&&j;c.useSyncedValue("focusManagerModal",T);const L=m.useCallback(H=>{c.set("popupElement",H)},[c]),R={open:u,side:r.side,align:r.align,instant:g,transitionStatus:x},f=He("div",n,{state:R,ref:[t,c.context.popupRef,L],props:[a,{id:w,role:"dialog",..._e,"aria-labelledby":d,"aria-describedby":F,onKeyDown(H){O&&Ht.has(H.key)&&H.stopPropagation()}},Kt(x),S],stateAttributesMapping:gn});return Y.jsx(Lt,{context:M,openInteractionType:B,modal:T,disabled:!C||v===W,initialFocus:s,returnFocus:E,restoreFocus:"popup",previousFocusableElement:dt(b)?b:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:Y.jsx(pn,{value:h,children:f})})});export{Cn as C,Pn as L,vn as P,bn as a,Rn as b,Sn as c,On as d};
@@ -1 +0,0 @@
1
- import{aN as d,Y as m,r as t,j as e,L as l,G as o,$ as x}from"./main-QK2wZyt4.js";function n(s,a){for(const r of a){const i=s.get(r);if(typeof i=="string"&&i.trim())return i.trim()}return""}function u(){const[s]=d(),{enabled:a}=m(),r=t.useMemo(()=>n(s,["otp","token","reset_token","insforge_token"]),[s]),i=t.useMemo(()=>n(s,["email"]),[s]),c=t.useMemo(()=>n(s,["code"]),[s]);return a?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(l,{to:"/login",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:o("reset_password.back_to_sign_in")})}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-4 py-12",children:e.jsx("div",{className:"w-full max-w-md border border-oai-gray-900 bg-oai-gray-950 rounded-2xl overflow-hidden shadow-2xl",children:e.jsx(x,{hideLogo:!0,initialMode:r?"reset_confirm":"reset_email",tokenFromUrl:r,initialEmail:i,initialCode:c})})})]}):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(l,{to:"/login",className:"text-sm font-medium text-oai-gray-400 hover:text-white no-underline",children:o("reset_password.back_to_sign_in")})}),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",children:o("login.cloud_only")})})]})}export{u as ResetPasswordPage};
@@ -1 +0,0 @@
1
- import{r as v,b7 as l,bE as w,a as k,j as e,V as x}from"./main-QK2wZyt4.js";import{u as j,z as N,s as i,L as C,A as E,S as I,h as R,i as T,C as A,j as L,k as P,l as V,m as _,o as z,n as D}from"./SelectItemText-BYGw7q1R.js";import{C as G}from"./useScrollLock-DecJNW0u.js";const M=v.forwardRef(function(t,s){const{render:n,className:p,style:o,...c}=t,{store:r,scrollHandlerRef:d}=j(),{alignItemWithTriggerActive:g}=N(),u=l(r,i.hasScrollArrows),h=l(r,i.openMethod),a=l(r,i.multiple),m={id:`${l(r,i.id)}-list`,role:"listbox","aria-multiselectable":a||void 0,onScroll(b){d.current?.(b.currentTarget)},...g&&{style:C},className:u&&h!=="touch"?E.className:void 0},S=w(b=>{r.set("listElement",b)});return k("div",t,{ref:[s,S],props:[m,c]})}),O="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 U({value:y,onValueChange:t,options:s=[],ariaLabel:n,id:p,disabled:o=!1,leadingIcon:c=null,className:r="",popupClassName:d="",align:g="start",matchTriggerWidth:u=!1}){const h=s.map(a=>({value:a.value,label:a.label}));return e.jsxs(I,{value:y,items:h,disabled:o,onValueChange:a=>{!o&&a!=null&&t?.(a)},children:[e.jsxs(R,{id:p,"aria-label":n,className:x(O,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:[c,e.jsx(T,{className:"truncate"})]}),e.jsx(A,{className:"h-3.5 w-3.5 shrink-0 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})]}),e.jsx(L,{children:e.jsx(P,{align:g,side:"bottom",sideOffset:4,className:"z-50",children:e.jsx(V,{className:x("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",u&&"min-w-[var(--anchor-width)]",d),children:e.jsx(M,{role:"listbox","aria-label":n,children:s.map(a=>e.jsxs(_,{value:a.value,disabled:a.disabled,className:({selected:f,disabled:m})=>x("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",f?"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",m&&"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(z,{children:e.jsx(G,{className:"h-3 w-3","aria-hidden":!0})})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.jsx(D,{children:a.label})})]},String(a.value)))})})})})]})}export{U as S};
@@ -1 +0,0 @@
1
- import{c as Vr,bP as kr,r as l,c8 as Ht,bD as vt,bJ as qn,c9 as Nr,be as zt,b as _e,bF as Ae,ca as it,cb as rn,c3 as nt,cc as rt,bf as Be,cd as un,ce as Ct,cf as _t,cg as Hr,ch as Kn,ci as _r,cj as fn,ck as dn,cl as jt,cm as En,cn as Xn,aG as Br,co as Wr,ba as Tt,b8 as J,cp as Gn,cq as Ur,bE as ue,cr as Cn,cs as Jt,ct as Tn,cu as Qt,bG as ot,bM as at,cv as An,cw as It,bS as Jn,cx as Yt,cy as qt,cz as Qn,cA as pn,cB as $r,cC as zr,cD as on,cE as jr,a as gt,cF as Yr,b9 as Mt,bb as Le,j as Me,bT as oe,b7 as z,bj as gn,bd as sn,bc as qr,bg as Kr,bh as Xr,bi as mn,cG as Gr,cH as Jr,cI as Qr,u as Zn,cJ as Zr,b$ as eo,cK as to,c2 as no,cL as ro,bI as oo,cM as so,bk as er,cN as Zt}from"./main-QK2wZyt4.js";import{i as Mn,c as tr,A as io,P as co,b as nr,d as Ye,B as lo,D as et,E as rr,G as ao,z as or,u as uo,a as sr,m as fo,n as po,H as go,q as mo,J as ho,I as xo,x as yo,y as wo}from"./useScrollLock-DecJNW0u.js";const bo=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ei=Vr("chevron-down",bo),Ro=["top","right","bottom","left"],wt=Math.min,He=Math.max,Bt=Math.round,Ot=Math.floor,Ge=e=>({x:e,y:e}),So={left:"right",right:"left",bottom:"top",top:"bottom"};function cn(e,t,n){return He(e,wt(t,n))}function st(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function ut(e){return e.split("-")[1]}function hn(e){return e==="x"?"y":"x"}function xn(e){return e==="y"?"height":"width"}function je(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yn(e){return hn(je(e))}function vo(e,t,n){n===void 0&&(n=!1);const r=ut(e),o=yn(e),s=xn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Wt(i)),[i,Wt(i)]}function Eo(e){const t=Wt(e);return[ln(e),t,ln(t)]}function ln(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const In=["left","right"],On=["right","left"],Co=["top","bottom"],To=["bottom","top"];function Ao(e,t,n){switch(e){case"top":case"bottom":return n?t?On:In:t?In:On;case"left":case"right":return t?Co:To;default:return[]}}function Mo(e,t,n,r){const o=ut(e);let s=Ao(Ve(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ln)))),s}function Wt(e){const t=Ve(e);return So[t]+e.slice(t.length)}function Io(e){return{top:0,right:0,bottom:0,left:0,...e}}function ir(e){return typeof e!="number"?Io(e):{top:e,right:e,bottom:e,left:e}}function At(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function bt(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Oo(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:i=!0,touchOpenDelay:c=0,reason:a=kr}=t,f="rootStore"in e?e.rootStore:e,g=f.context.dataRef,u=l.useRef(void 0),d=Ht(),p=vt(),m=l.useMemo(()=>{function y(h,R,x,w){const S=_e(a,R,x);h&&w==="touch"&&c>0?p.start(c,()=>{f.setOpen(!0,S)}):f.setOpen(h,S)}function b(h,R,x){const w=g.current.openEvent,S=f.select("domReferenceElement")!==R;return h&&S||!h||!o?!0:w&&i?!x(w.type):!1}return{onPointerDown(h){u.current=h.pointerType},onMouseDown(h){const R=u.current,x=h.nativeEvent,w=f.select("open");if(h.button!==0||r==="click"||Mn(R,!0)&&s)return;const S=b(w,h.currentTarget,T=>T==="click"||T==="mousedown"),C=qn(x);if(Nr(C)){y(S,x,C,R);return}const P=h.currentTarget;d.request(()=>{y(S,x,P,R)})},onClick(h){if(r==="mousedown-only")return;const R=u.current;if(r==="mousedown"&&R){u.current=void 0;return}if(Mn(R,!0)&&s)return;const x=f.select("open"),w=b(x,h.currentTarget,S=>S==="click"||S==="mousedown"||S==="keydown"||S==="keyup");y(w,h.nativeEvent,h.currentTarget,R)},onKeyDown(){u.current=void 0}}},[g,r,s,a,f,i,o,d,p,c]);return l.useMemo(()=>n?{reference:m}:zt,[n,m])}function Pn(e,t,n){let{reference:r,floating:o}=e;const s=je(t),i=yn(t),c=xn(i),a=Ve(t),f=s==="y",g=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(a){case"top":p={x:g,y:r.y-o.height};break;case"bottom":p={x:g,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(ut(t)){case"start":p[i]-=d*(n&&f?-1:1);break;case"end":p[i]+=d*(n&&f?-1:1);break}return p}async function Po(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=st(t,e),m=ir(p),b=c[d?u==="floating"?"reference":"floating":u],h=At(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:g,strategy:a})),R=u==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),w=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},S=At(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:x,strategy:a}):R);return{top:(h.top-S.top+m.top)/w.y,bottom:(S.bottom-h.bottom+m.bottom)/w.y,left:(h.left-S.left+m.left)/w.x,right:(S.right-h.right+m.right)/w.x}}const Do=50,Lo=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:Po},a=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:g,y:u}=Pn(f,r,a),d=r,p=0;const m={};for(let y=0;y<s.length;y++){const b=s[y];if(!b)continue;const{name:h,fn:R}=b,{x,y:w,data:S,reset:C}=await R({x:g,y:u,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:f,platform:c,elements:{reference:e,floating:t}});g=x??g,u=w??u,m[h]={...m[h],...S},C&&p<Do&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(f=C.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:g,y:u}=Pn(f,d,a)),y=-1)}return{x:g,y:u,placement:d,strategy:o,middlewareData:m}},Fo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:f}=t,{mainAxis:g=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...b}=st(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const h=Ve(o),R=je(c),x=Ve(c)===c,w=await(a.isRTL==null?void 0:a.isRTL(f.floating)),S=d||(x||!y?[Wt(c)]:Eo(c)),C=m!=="none";!d&&C&&S.push(...Mo(c,y,m,w));const P=[c,...S],T=await a.detectOverflow(t,b),L=[];let _=((r=s.flip)==null?void 0:r.overflows)||[];if(g&&L.push(T[h]),u){const M=vo(o,i,w);L.push(T[M[0]],T[M[1]])}if(_=[..._,{placement:o,overflows:L}],!L.every(M=>M<=0)){var X,B;const M=(((X=s.flip)==null?void 0:X.index)||0)+1,N=P[M];if(N&&(!(u==="alignment"?R!==je(N):!1)||_.every(E=>je(E.placement)===R?E.overflows[0]>0:!0)))return{data:{index:M,overflows:_},reset:{placement:N}};let Y=(B=_.filter(F=>F.overflows[0]<=0).sort((F,E)=>F.overflows[1]-E.overflows[1])[0])==null?void 0:B.placement;if(!Y)switch(p){case"bestFit":{var k;const F=(k=_.filter(E=>{if(C){const W=je(E.placement);return W===R||W==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(W=>W>0).reduce((W,A)=>W+A,0)]).sort((E,W)=>E[1]-W[1])[0])==null?void 0:k[0];F&&(Y=F);break}case"initialPlacement":Y=c;break}if(o!==Y)return{reset:{placement:Y}}}return{}}}};function Dn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ln(e){return Ro.some(t=>e[t]>=0)}const Vo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=st(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),c=Dn(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Ln(c)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),c=Dn(i,n.floating);return{data:{escapedOffsets:c,escaped:Ln(c)}}}default:return{}}}}},cr=new Set(["left","top"]);async function ko(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ve(n),c=ut(n),a=je(n)==="y",f=cr.has(i)?-1:1,g=s&&a?-1:1,u=st(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),a?{x:p*g,y:d*f}:{x:d*f,y:p*g}}const No=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,a=await ko(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},Ho=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:h=>{let{x:R,y:x}=h;return{x:R,y:x}}},...f}=st(e,t),g={x:n,y:r},u=await s.detectOverflow(t,f),d=je(Ve(o)),p=hn(d);let m=g[p],y=g[d];if(i){const h=p==="y"?"top":"left",R=p==="y"?"bottom":"right",x=m+u[h],w=m-u[R];m=cn(x,m,w)}if(c){const h=d==="y"?"top":"left",R=d==="y"?"bottom":"right",x=y+u[h],w=y-u[R];y=cn(x,y,w)}const b=a.fn({...t,[p]:m,[d]:y});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[d]:c}}}}}},_o=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:f=!0}=st(e,t),g={x:n,y:r},u=je(o),d=hn(u);let p=g[d],m=g[u];const y=st(c,t),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const x=d==="y"?"height":"width",w=s.reference[d]-s.floating[x]+b.mainAxis,S=s.reference[d]+s.reference[x]-b.mainAxis;p<w?p=w:p>S&&(p=S)}if(f){var h,R;const x=d==="y"?"width":"height",w=cr.has(Ve(o)),S=s.reference[u]-s.floating[x]+(w&&((h=i.offset)==null?void 0:h[u])||0)+(w?0:b.crossAxis),C=s.reference[u]+s.reference[x]+(w?0:((R=i.offset)==null?void 0:R[u])||0)-(w?b.crossAxis:0);m<S?m=S:m>C&&(m=C)}return{[d]:p,[u]:m}}}},Bo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...f}=st(e,t),g=await i.detectOverflow(t,f),u=Ve(o),d=ut(o),p=je(o)==="y",{width:m,height:y}=s.floating;let b,h;u==="top"||u==="bottom"?(b=u,h=d===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(h=u,b=d==="end"?"top":"bottom");const R=y-g.top-g.bottom,x=m-g.left-g.right,w=wt(y-g[b],R),S=wt(m-g[h],x),C=!t.middlewareData.shift;let P=w,T=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(P=R),C&&!d){const _=He(g.left,0),X=He(g.right,0),B=He(g.top,0),k=He(g.bottom,0);p?T=m-2*(_!==0||X!==0?_+X:He(g.left,g.right)):P=y-2*(B!==0||k!==0?B+k:He(g.top,g.bottom))}await a({...t,availableWidth:T,availableHeight:P});const L=await i.getDimensions(c.floating);return m!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function lr(e){const t=rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Bt(n)!==s||Bt(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function wn(e){return Ae(e)?e:e.contextElement}function yt(e){const t=wn(e);if(!nt(t))return Ge(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=lr(t);let i=(s?Bt(n.width):n.width)/r,c=(s?Bt(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Wo=Ge(0);function ar(e){const t=Be(e);return!Xn()||!t.visualViewport?Wo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Uo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Be(e)?!1:t}function dt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=wn(e);let i=Ge(1);t&&(r?Ae(r)&&(i=yt(r)):i=yt(e));const c=Uo(s,n,r)?ar(s):Ge(0);let a=(o.left+c.x)/i.x,f=(o.top+c.y)/i.y,g=o.width/i.x,u=o.height/i.y;if(s){const d=Be(s),p=r&&Ae(r)?Be(r):r;let m=d,y=En(m);for(;y&&r&&p!==m;){const b=yt(y),h=y.getBoundingClientRect(),R=rt(y),x=h.left+(y.clientLeft+parseFloat(R.paddingLeft))*b.x,w=h.top+(y.clientTop+parseFloat(R.paddingTop))*b.y;a*=b.x,f*=b.y,g*=b.x,u*=b.y,a+=x,f+=w,m=Be(y),y=En(m)}}return At({width:g,height:u,x:a,y:f})}function Kt(e,t){const n=jt(e).scrollLeft;return t?t.left+n:dt(it(e)).left+n}function ur(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Kt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function $o(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=it(r),c=t?un(t.floating):!1;if(r===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},f=Ge(1);const g=Ge(0),u=nt(r);if((u||!u&&!s)&&((fn(r)!=="body"||dn(i))&&(a=jt(r)),u)){const p=dt(r);f=yt(r),g.x=p.x+r.clientLeft,g.y=p.y+r.clientTop}const d=i&&!u&&!s?ur(i,a):Ge(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+g.x+d.x,y:n.y*f.y-a.scrollTop*f.y+g.y+d.y}}function zo(e){return Array.from(e.getClientRects())}function jo(e){const t=it(e),n=jt(e),r=e.ownerDocument.body,o=He(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=He(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Kt(e);const c=-n.scrollTop;return rt(r).direction==="rtl"&&(i+=He(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}const Fn=25;function Yo(e,t){const n=Be(e),r=it(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,a=0;if(o){s=o.width,i=o.height;const g=Xn();(!g||g&&t==="fixed")&&(c=o.offsetLeft,a=o.offsetTop)}const f=Kt(r);if(f<=0){const g=r.ownerDocument,u=g.body,d=getComputedStyle(u),p=g.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,m=Math.abs(r.clientWidth-u.clientWidth-p);m<=Fn&&(s-=m)}else f<=Fn&&(s+=f);return{width:s,height:i,x:c,y:a}}function qo(e,t){const n=dt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=nt(e)?yt(e):Ge(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=o*s.x,f=r*s.y;return{width:i,height:c,x:a,y:f}}function Vn(e,t,n){let r;if(t==="viewport")r=Yo(e,n);else if(t==="document")r=jo(it(e));else if(Ae(t))r=qo(t,n);else{const o=ar(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return At(r)}function fr(e,t){const n=Ct(e);return n===t||!Ae(n)||_t(n)?!1:rt(n).position==="fixed"||fr(n,t)}function Ko(e,t){const n=t.get(e);if(n)return n;let r=rn(e,[],!1).filter(c=>Ae(c)&&fn(c)!=="body"),o=null;const s=rt(e).position==="fixed";let i=s?Ct(e):e;for(;Ae(i)&&!_t(i);){const c=rt(i),a=Kn(i);!a&&c.position==="fixed"&&(o=null),(s?!a&&!o:!a&&c.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||dn(i)&&!a&&fr(e,i))?r=r.filter(g=>g!==i):o=c,i=Ct(i)}return t.set(e,r),r}function Xo(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?un(t)?[]:Ko(t,this._c):[].concat(n),r],c=Vn(t,i[0],o);let a=c.top,f=c.right,g=c.bottom,u=c.left;for(let d=1;d<i.length;d++){const p=Vn(t,i[d],o);a=He(p.top,a),f=wt(p.right,f),g=wt(p.bottom,g),u=He(p.left,u)}return{width:f-u,height:g-a,x:u,y:a}}function Go(e){const{width:t,height:n}=lr(e);return{width:t,height:n}}function Jo(e,t,n){const r=nt(t),o=it(t),s=n==="fixed",i=dt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=Ge(0);function f(){a.x=Kt(o)}if(r||!r&&!s)if((fn(t)!=="body"||dn(o))&&(c=jt(t)),r){const p=dt(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else o&&f();s&&!r&&o&&f();const g=o&&!r&&!s?ur(o,c):Ge(0),u=i.left+c.scrollLeft-a.x-g.x,d=i.top+c.scrollTop-a.y-g.y;return{x:u,y:d,width:i.width,height:i.height}}function en(e){return rt(e).position==="static"}function kn(e,t){if(!nt(e)||rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return it(e)===n&&(n=n.ownerDocument.body),n}function dr(e,t){const n=Be(e);if(un(e))return n;if(!nt(e)){let o=Ct(e);for(;o&&!_t(o);){if(Ae(o)&&!en(o))return o;o=Ct(o)}return n}let r=kn(e,t);for(;r&&Hr(r)&&en(r);)r=kn(r,t);return r&&_t(r)&&en(r)&&!Kn(r)?n:r||_r(e)||n}const Qo=async function(e){const t=this.getOffsetParent||dr,n=this.getDimensions,r=await n(e.floating);return{reference:Jo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zo(e){return rt(e).direction==="rtl"}const pr={convertOffsetParentRelativeRectToViewportRelativeRect:$o,getDocumentElement:it,getClippingRect:Xo,getOffsetParent:dr,getElementRects:Qo,getClientRects:zo,getDimensions:Go,getScale:yt,isElement:Ae,isRTL:Zo};function gr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function es(e,t){let n=null,r;const o=it(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const f=e.getBoundingClientRect(),{left:g,top:u,width:d,height:p}=f;if(c||t(),!d||!p)return;const m=Ot(u),y=Ot(o.clientWidth-(g+d)),b=Ot(o.clientHeight-(u+p)),h=Ot(g),x={rootMargin:-m+"px "+-y+"px "+-b+"px "+-h+"px",threshold:He(0,wt(1,a))||1};let w=!0;function S(C){const P=C[0].intersectionRatio;if(P!==a){if(!w)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}P===1&&!gr(f,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(S,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,x)}n.observe(e)}return i(!0),s}function Nn(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,f=wn(e),g=o||s?[...f?rn(f):[],...t?rn(t):[]]:[];g.forEach(h=>{o&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});const u=f&&c?es(f,n):null;let d=-1,p=null;i&&(p=new ResizeObserver(h=>{let[R]=h;R&&R.target===f&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),f&&!a&&p.observe(f),t&&p.observe(t));let m,y=a?dt(e):null;a&&b();function b(){const h=dt(e);y&&!gr(y,h)&&n(),y=h,m=requestAnimationFrame(b)}return n(),()=>{var h;g.forEach(R=>{o&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),u?.(),(h=p)==null||h.disconnect(),p=null,a&&cancelAnimationFrame(m)}}const ts=No,ns=Ho,rs=Fo,os=Bo,ss=Vo,is=_o,cs=(e,t,n)=>{const r=new Map,o={platform:pr,...n},s={...o.platform,_c:r};return Lo(e,t,{...o,platform:s})};var ls=typeof document<"u",as=function(){},kt=ls?l.useLayoutEffect:as;function Ut(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ut(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ut(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hn(e,t){const n=mr(e);return Math.round(t*n)/n}function tn(e){const t=l.useRef(e);return kt(()=>{t.current=e}),t}function us(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:f}=e,[g,u]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=l.useState(r);Ut(d,r)||p(r);const[m,y]=l.useState(null),[b,h]=l.useState(null),R=l.useCallback(E=>{E!==C.current&&(C.current=E,y(E))},[]),x=l.useCallback(E=>{E!==P.current&&(P.current=E,h(E))},[]),w=s||m,S=i||b,C=l.useRef(null),P=l.useRef(null),T=l.useRef(g),L=a!=null,_=tn(a),X=tn(o),B=tn(f),k=l.useCallback(()=>{if(!C.current||!P.current)return;const E={placement:t,strategy:n,middleware:d};X.current&&(E.platform=X.current),cs(C.current,P.current,E).then(W=>{const A={...W,isPositioned:B.current!==!1};M.current&&!Ut(T.current,A)&&(T.current=A,Br.flushSync(()=>{u(A)}))})},[d,t,n,X,B]);kt(()=>{f===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,u(E=>({...E,isPositioned:!1})))},[f]);const M=l.useRef(!1);kt(()=>(M.current=!0,()=>{M.current=!1}),[]),kt(()=>{if(w&&(C.current=w),S&&(P.current=S),w&&S){if(_.current)return _.current(w,S,k);k()}},[w,S,k,_,L]);const N=l.useMemo(()=>({reference:C,floating:P,setReference:R,setFloating:x}),[R,x]),Y=l.useMemo(()=>({reference:w,floating:S}),[w,S]),F=l.useMemo(()=>{const E={position:n,left:0,top:0};if(!Y.floating)return E;const W=Hn(Y.floating,g.x),A=Hn(Y.floating,g.y);return c?{...E,transform:"translate("+W+"px, "+A+"px)",...mr(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:A}},[n,c,Y.floating,g.x,g.y]);return l.useMemo(()=>({...g,update:k,refs:N,elements:Y,floatingStyles:F}),[g,k,N,Y,F])}const fs=(e,t)=>{const n=ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},ds=(e,t)=>{const n=ns(e);return{name:n.name,fn:n.fn,options:[e,t]}},ps=(e,t)=>({fn:is(e).fn,options:[e,t]}),gs=(e,t)=>{const n=rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ms=(e,t)=>{const n=os(e);return{name:n.name,fn:n.fn,options:[e,t]}},hs=(e,t)=>{const n=ss(e);return{name:n.name,fn:n.fn,options:[e,t]}};function hr(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Wr(),s=tr()!=null,i=Tt(()=>new io({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new co,floatingId:o,syncOnly:!1,nested:s})).current;return J(()=>{const c={open:t,floatingId:o};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=Ae(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),i.update(c)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function xs(e={}){const{nodeId:t,externalTree:n}=e,r=hr(e),o=e.rootContext||r,s=o.useState("referenceElement"),i=o.useState("floatingElement"),c=o.useState("domReferenceElement"),a=o.useState("open"),f=o.useState("floatingId"),[g,u]=l.useState(null),[d,p]=l.useState(void 0),[m,y]=l.useState(void 0),b=l.useRef(null),h=nr(n),R=l.useMemo(()=>({reference:s,floating:i,domReference:c}),[s,i,c]),x=us({...e,elements:{...R,...g&&{reference:g}}}),w=Ae(d)?d:null,S=m===void 0?o.state.floatingElement:m;o.useSyncedValue("referenceElement",d??null),o.useSyncedValue("domReferenceElement",d===void 0?c:w),o.useSyncedValue("floatingElement",S);const C=l.useCallback(B=>{const k=Ae(B)?{getBoundingClientRect:()=>B.getBoundingClientRect(),getClientRects:()=>B.getClientRects(),contextElement:B}:B;u(k),x.refs.setReference(k)},[x.refs]),P=l.useCallback(B=>{(Ae(B)||B===null)&&(b.current=B,p(B)),(Ae(x.refs.reference.current)||x.refs.reference.current===null||B!==null&&!Ae(B))&&x.refs.setReference(B)},[x.refs,p]),T=l.useCallback(B=>{y(B),x.refs.setFloating(B)},[x.refs]),L=l.useMemo(()=>({...x.refs,setReference:P,setFloating:T,setPositionReference:C,domReference:b}),[x.refs,P,T,C]),_=l.useMemo(()=>({...x.elements,domReference:c}),[x.elements,c]),X=l.useMemo(()=>({...x,dataRef:o.context.dataRef,open:a,onOpenChange:o.setOpen,events:o.context.events,floatingId:f,refs:L,elements:_,nodeId:t,rootStore:o}),[x,L,_,t,o,a,f]);return J(()=>{c&&(b.current=c)},[c]),J(()=>{o.context.dataRef.current.floatingContext=X;const B=h?.nodesRef.current.find(k=>k.id===t);B&&(B.context=X)}),l.useMemo(()=>({...x,context:X,refs:L,elements:_,rootStore:o}),[x,L,_,X,o])}const ys="Escape";function Xt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Pt(e,t){return Xt(t,e===Qn||e===pn,e===Yt||e===qt)}function nn(e,t,n){return Xt(t,e===pn,n?e===Yt:e===qt)||e==="Enter"||e===" "||e===""}function ws(e,t,n){return Xt(t,n?e===Yt:e===qt,e===pn)}function bs(e,t,n,r){const o=n?e===qt:e===Yt,s=e===Qn;return t==="both"||t==="horizontal"&&r?e===ys:Xt(t,o,s)}function Rs(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:s=!0,selectedIndex:i=null,allowEscape:c=!1,loopFocus:a=!1,nested:f=!1,rtl:g=!1,virtual:u=!1,focusItemOnOpen:d="auto",focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:y=void 0,orientation:b="vertical",parentOrientation:h,id:R,resetOnPointerLeave:x=!0,externalTree:w,grid:S}=t,C=S!=null,P="rootStore"in e?e.rootStore:e,T=P.useState("open"),L=P.useState("floatingElement"),_=P.useState("domReferenceElement"),X=P.context.dataRef,B=Gn(L),k=Ur(_),M=Ye(B),N=tr(),Y=nr(w),F=l.useRef(d),E=l.useRef(i??-1),W=l.useRef(null),A=l.useRef(!0),v=ue(I=>{o(E.current===-1?null:E.current,I)}),H=l.useRef(!!L),me=l.useRef(T),q=l.useRef(!1),ye=l.useRef(!1),he=l.useRef(null),O=Ye(y),j=Ye(T),le=Ye(i),Ce=Ye(x),Q=Ht(),ne=Ht(),se=ue(()=>{function I(G){u?Y?.events.emit("virtualfocus",G):he.current=lo(G,{sync:q.current,preventScroll:!0})}const D=n.current[E.current],Z=ye.current;D&&I(D),(q.current?G=>G():G=>Q.request(G))(()=>{const G=n.current[E.current]||D;if(!G)return;D||I(G),we&&(Z||!A.current)&&G.scrollIntoView?.({block:"nearest",inline:"nearest"})})});J(()=>{X.current.orientation=b},[X,b]),J(()=>{s&&(T&&L?(E.current=i??-1,F.current&&i!=null&&(ye.current=!0,v())):H.current&&(E.current=-1,v()))},[s,T,L,i,v]),J(()=>{if(s){if(!T){q.current=!1;return}if(L)if(r==null){if(q.current=!1,le.current!=null)return;if(H.current&&(E.current=-1,se()),(!me.current||!H.current)&&F.current&&(W.current!=null||F.current===!0&&W.current==null)){let I=0;const D=()=>{n.current[0]==null?(I<2&&(I?V=>ne.request(V):queueMicrotask)(D),I+=1):(E.current=W.current==null||nn(W.current,b,g)||f?Jt(n):Tn(n),W.current=null,v())};D()}}else Cn(n.current,r)||(E.current=r,se(),ye.current=!1)}},[s,T,L,r,le,f,n,b,g,v,se,ne]),J(()=>{if(!s||L||!Y||u||!H.current)return;const I=Y.nodesRef.current,D=I.find(G=>G.id===N)?.context?.elements.floating,Z=Qt(ot(_??D??null)),V=I.some(G=>G.context&&at(G.context.elements.floating,Z));D&&!V&&A.current&&D.focus({preventScroll:!0})},[s,L,_,Y,N,u]),J(()=>{me.current=T,H.current=!!L}),J(()=>{T||(W.current=null,F.current=d)},[T,d]);const Se=r!=null,fe=ue(I=>{if(!j.current)return;const D=n.current.indexOf(I.currentTarget);D!==-1&&(E.current!==D||r!==D)&&(E.current=D,v(I))}),de=ue(()=>h??Y?.nodesRef.current.find(I=>I.id===N)?.context?.dataRef?.current.orientation),xe=ue(()=>Jt(n,O.current)),te=ue(I=>{if(A.current=!1,q.current=!0,I.which===229||!j.current&&I.currentTarget===M.current)return;if(f&&bs(I.key,b,g,C)){Pt(I.key,de())||et(I),P.setOpen(!1,_e(An,I.nativeEvent)),nt(_)&&(u?Y?.events.emit("virtualfocus",_):_.focus());return}const D=E.current,Z=Jt(n,y),V=Tn(n,y);if(k||(I.key==="Home"&&(et(I),E.current=Z,v(I)),I.key==="End"&&(et(I),E.current=V,v(I))),S!=null){const G=S(I,E.current,n,b,a,g,y,Z,V);if(G!=null&&(E.current=G,v(I)),b==="both")return}if(Pt(I.key,b)){if(et(I),T&&!u&&Qt(I.currentTarget.ownerDocument)===I.currentTarget){E.current=nn(I.key,b,g)?Z:V,v(I);return}nn(I.key,b,g)?a?D>=V?c&&D!==n.current.length?E.current=-1:(q.current=!1,E.current=Z):E.current=It(n.current,{startingIndex:D,disabledIndices:y}):E.current=Math.min(V,It(n.current,{startingIndex:D,disabledIndices:y})):a?D<=Z?c&&D!==-1?E.current=n.current.length:(q.current=!1,E.current=V):E.current=It(n.current,{startingIndex:D,decrement:!0,disabledIndices:y}):E.current=Math.max(Z,It(n.current,{startingIndex:D,decrement:!0,disabledIndices:y})),Cn(n.current,E.current)&&(E.current=-1),v(I)}}),we=l.useMemo(()=>({onFocus(D){q.current=!0,fe(D)},onClick:({currentTarget:D})=>D.focus({preventScroll:!0}),onMouseMove(D){q.current=!0,ye.current=!1,p&&fe(D)},onPointerLeave(D){if(!j.current||!A.current||D.pointerType==="touch")return;q.current=!0;const Z=D.relatedTarget;if(!(!p||n.current.includes(Z))&&Ce.current&&(he.current?.(),he.current=null,E.current=-1,v(D),!u)){const V=M.current,G=Qt(ot(V));V&&at(V,G)&&V.focus({preventScroll:!0})}}}),[fe,j,M,p,n,v,Ce,u]),ce=l.useMemo(()=>u&&T&&Se&&{"aria-activedescendant":`${R}-${r}`},[u,T,Se,R,r]),ie=l.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...k?{}:ce,onKeyDown(I){if(I.key==="Tab"&&I.shiftKey&&T&&!u){const D=qn(I.nativeEvent);if(D&&!at(M.current,D))return;et(I),P.setOpen(!1,_e(Jn,I.nativeEvent)),nt(_)&&_.focus();return}te(I)},onPointerMove(){A.current=!0}}),[ce,te,M,b,k,P,T,u,_]),re=l.useMemo(()=>{function I(V){P.setOpen(!0,_e(An,V.nativeEvent,V.currentTarget))}function D(V){d==="auto"&&rr(V.nativeEvent)&&(F.current=!u)}function Z(V){F.current=d,d==="auto"&&ao(V.nativeEvent)&&(F.current=!0)}return{onKeyDown(V){const G=P.select("open");A.current=!1;const ke=V.key.startsWith("Arrow"),We=ws(V.key,de(),g),Ie=Pt(V.key,b),Fe=(f?We:Ie)||V.key==="Enter"||V.key.trim()==="";if(u&&G)return te(V);if(!(!G&&!m&&ke)){if(Fe){const ae=Pt(V.key,de());W.current=f&&ae?null:V.key}if(f){We&&(et(V),G?(E.current=xe(),v(V)):I(V));return}Ie&&(le.current!=null&&(E.current=le.current),et(V),!G&&m?I(V):te(V),G&&v(V))}},onFocus(V){P.select("open")&&!u&&(E.current=-1,v(V))},onPointerDown:Z,onPointerEnter:Z,onMouseDown:D,onClick:D}},[te,d,xe,f,v,P,m,b,de,g,le,u]),$=l.useMemo(()=>({...ce,...re}),[ce,re]);return l.useMemo(()=>s?{reference:$,floating:ie,item:we,trigger:re}:{},[s,$,ie,re,we])}function Ss(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:s,disabledIndices:i,onTyping:c,enabled:a=!0,resetMs:f=750,selectedIndex:g=null}=t,u="rootStore"in e?e.rootStore:e,d=u.useState("open"),p=vt(),m=l.useRef(""),y=l.useRef(g??o??-1),b=l.useRef(null),h=ue(w=>{function S(M){const N=r?.current[M];return!N||zr(N)}function C(M){return S(M)?i==null||!$r(on,M,i):!1}function P(M,N,Y=0){if(M.length===0)return-1;const F=(Y%M.length+M.length)%M.length,E=N.toLowerCase();for(let W=0;W<M.length;W+=1){const A=(F+W)%M.length;if(!(!M[A]?.toLowerCase().startsWith(E)||!C(A)))return A}return-1}const T=n.current;if(m.current.length>0&&w.key===" "&&(et(w),c?.(!0)),m.current.length>0&&m.current[0]!==" "&&P(T,m.current)===-1&&w.key!==" "&&c?.(!1),T==null||w.key.length!==1||w.ctrlKey||w.metaKey||w.altKey)return;d&&w.key!==" "&&(et(w),c?.(!0));const L=m.current==="";L&&(y.current=g??o??-1),T.every((M,N)=>M&&C(N)?M[0]?.toLowerCase()!==M[1]?.toLowerCase():!0)&&m.current===w.key&&(m.current="",y.current=b.current),m.current+=w.key,p.start(f,()=>{m.current="",y.current=b.current,c?.(!1)});const B=((L?g??o??-1:y.current)??0)+1,k=P(T,m.current,B);k!==-1?(s?.(k),b.current=k):w.key!==" "&&(m.current="",c?.(!1))}),R=ue(w=>{const S=w.relatedTarget,C=u.select("domReferenceElement"),P=u.select("floatingElement");at(C,S)||at(P,S)||(p.clear(),m.current="",y.current=b.current,c?.(!1))});J(()=>{!d&&g!==null||(p.clear(),b.current=null,m.current!==""&&(m.current=""))},[d,g,p]),J(()=>{d&&m.current===""&&(y.current=g??o??-1)},[d,g,o]);const x=l.useMemo(()=>({onKeyDown:h,onBlur:R}),[h,R]);return l.useMemo(()=>a?{reference:x,floating:x}:{},[a,x])}const vs=l.createContext(void 0);function xr(){return l.useContext(vs)?.direction??"ltr"}const Es=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:f,padding:g=0,offsetParent:u="real"}=st(e,t)||{};if(f==null)return{};const d=ir(g),p={x:n,y:r},m=yn(o),y=xn(m),b=await i.getDimensions(f),h=m==="y",R=h?"top":"left",x=h?"bottom":"right",w=h?"clientHeight":"clientWidth",S=s.reference[y]+s.reference[m]-p[m]-s.floating[y],C=p[m]-s.reference[m],P=u==="real"?await i.getOffsetParent?.(f):c.floating;let T=c.floating[w]||s.floating[y];(!T||!await i.isElement?.(P))&&(T=c.floating[w]||s.floating[y]);const L=S/2-C/2,_=T/2-b[y]/2-1,X=Math.min(d[R],_),B=Math.min(d[x],_),k=X,M=T-b[y]-B,N=T/2-b[y]/2+L,Y=cn(k,N,M),F=!a.arrow&&ut(o)!=null&&N!==Y&&s.reference[y]/2-(N<k?X:B)-b[y]/2<0,E=F?N<k?N-k:N-M:0;return{[m]:p[m]+E,data:{[m]:Y,centerOffset:N-Y-E,...F&&{alignmentOffset:E}},reset:F}}}),Cs=(e,t)=>({...Es(e),options:[e,t]}),Ts=hs().fn,As={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await Ts(e)).data?.referenceHidden||s}}}},Nt={sideX:"left",sideY:"top"},Ci={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:c}=e,a=Be(o),f=a.getComputedStyle(o);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:Nt};const u=await s.getOffsetParent?.(o);let d={width:0,height:0};if(i==="fixed"&&a?.visualViewport)d={width:a.visualViewport.width,height:a.visualViewport.height};else if(u===a){const R=ot(o);d={width:R.documentElement.clientWidth,height:R.documentElement.clientHeight}}else await s.isElement?.(u)&&(d=await s.getDimensions(u));const p=Ve(c);let m=t,y=n;p==="left"&&(m=d.width-(t+r.width)),p==="top"&&(y=d.height-(n+r.height));const b=p==="left"?"right":Nt.sideX,h=p==="top"?"bottom":Nt.sideY;return{x:m,y,data:{sideX:b,sideY:h}}}};function yr(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function _n(e,t,n){const{rects:r,placement:o}=e;return{side:yr(t,Ve(o),n),align:ut(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ms(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:a=5,sticky:f=!1,arrowPadding:g=5,disableAnchorTracking:u=!1,inline:d,keepMounted:p=!1,floatingRootContext:m,mounted:y,collisionAvoidance:b,shiftCrossAxis:h=!1,nodeId:R,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:S}=e,[C,P]=l.useState(null);!y&&C!==null&&P(null);const T=b.side||"flip",L=b.align||"flip",_=b.fallbackAxisSide||"end",X=typeof t=="function"?t:void 0,B=ue(X),k=X?B:t,M=Ye(t),N=Ye(y),F=xr()==="rtl",E=C||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":F?"left":"right","inline-start":F?"right":"left"}[r],W=s==="center"?E:`${E}-${s}`;let A=a;const v=1,H=r==="bottom"?v:0,me=r==="top"?v:0,q=r==="right"?v:0,ye=r==="left"?v:0;typeof A=="number"?A={top:A+H,right:A+ye,bottom:A+me,left:A+q}:A&&(A={top:(A.top||0)+H,right:(A.right||0)+ye,bottom:(A.bottom||0)+me,left:(A.left||0)+q});const he={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:A},O=l.useRef(null),j=Ye(o),le=Ye(i),Ce=typeof o!="function"?o:0,Q=typeof i!="function"?i:0,ne=[];d&&ne.push(d),ne.push(fs(ee=>{const pe=_n(ee,r,F),ve=typeof j.current=="function"?j.current(pe):j.current,Re=typeof le.current=="function"?le.current(pe):le.current;return{mainAxis:ve,crossAxis:Re,alignmentAxis:Re}},[Ce,Q,F,r]));const se=L==="none"&&T!=="shift",Se=!se&&(f||h||T==="shift"),fe=T==="none"?null:gs({...he,padding:{top:A.top+v,right:A.right+v,bottom:A.bottom+v,left:A.left+v},mainAxis:!h&&T==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),de=se?null:ds(ee=>{const pe=ot(ee.elements.floating).documentElement;return{...he,rootBoundary:h?{x:0,y:0,width:pe.clientWidth,height:pe.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:Se,limiter:f||h?void 0:ps(ve=>{if(!O.current)return{};const{width:Re,height:Te}=O.current.getBoundingClientRect(),be=je(Ve(ve.placement)),Oe=be==="y"?Re:Te,ze=be==="y"?A.left+A.right:A.top+A.bottom;return{offset:Oe/2+ze/2}})}},[he,f,h,A,L]);T==="shift"||L==="shift"||s==="center"?ne.push(de,fe):ne.push(fe,de),ne.push(ms({...he,apply({elements:{floating:ee},availableWidth:pe,availableHeight:ve,rects:Re}){if(!N.current)return;const Te=ee.style;Te.setProperty("--available-width",`${pe}px`),Te.setProperty("--available-height",`${ve}px`);const be=Be(ee).devicePixelRatio||1,{x:Oe,y:ze,width:qe,height:ct}=Re.reference,Pe=(Math.round((Oe+qe)*be)-Math.round(Oe*be))/be,Ke=(Math.round((ze+ct)*be)-Math.round(ze*be))/be;Te.setProperty("--anchor-width",`${Pe}px`),Te.setProperty("--anchor-height",`${Ke}px`)}}),Cs(ee=>({element:O.current||ot(ee.elements.floating).createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ee){const{elements:pe,middlewareData:ve,placement:Re,rects:Te,y:be}=ee,Oe=Ve(Re),ze=je(Oe),qe=O.current,ct=ve.arrow?.x||0,Pe=ve.arrow?.y||0,Ke=qe?.clientWidth||0,ht=qe?.clientHeight||0,lt=ct+Ke/2,xt=Pe+ht/2,K=Math.abs(ve.shift?.y||0),ge=Te.reference.height/2,Ee=typeof o=="function"?o(_n(ee,r,F)):o,De=K>Ee,Xe={top:`${lt}px calc(100% + ${Ee}px)`,bottom:`${lt}px ${-Ee}px`,left:`calc(100% + ${Ee}px) ${xt}px`,right:`${-Ee}px ${xt}px`}[Oe],Ze=`${lt}px ${Te.reference.y+ge-be}px`;return pe.floating.style.setProperty("--transform-origin",Se&&ze==="y"&&De?Ze:Xe),{}}},As,x),J(()=>{!y&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,m]);const xe=l.useMemo(()=>({elementResize:!u&&typeof ResizeObserver<"u",layoutShift:!u&&typeof IntersectionObserver<"u"}),[u]),{refs:te,elements:we,x:ce,y:ie,middlewareData:re,update:$,placement:I,context:D,isPositioned:Z,floatingStyles:V}=xs({rootContext:m,open:p?y:void 0,placement:W,middleware:ne,strategy:n,whileElementsMounted:p?void 0:(...ee)=>Nn(...ee,xe),nodeId:R,externalTree:S}),{sideX:G,sideY:ke}=re.adaptiveOrigin||Nt,We=Z?n:"fixed",Ie=l.useMemo(()=>{const ee=x?{position:We,[G]:ce,[ke]:ie}:{position:We,...V};return Z||(ee.opacity=0),ee},[x,We,G,ce,ke,ie,V,Z]),Fe=l.useRef(null);J(()=>{if(!y)return;const ee=M.current,pe=typeof ee=="function"?ee():ee,Re=(Bn(pe)?pe.current:pe)||null||null;Re!==Fe.current&&(te.setPositionReference(Re),Fe.current=Re)},[y,te,k,M]),l.useEffect(()=>{if(!y)return;const ee=M.current;typeof ee!="function"&&Bn(ee)&&ee.current!==Fe.current&&(te.setPositionReference(ee.current),Fe.current=ee.current)},[y,te,k,M]),l.useEffect(()=>{if(p&&y&&we.reference&&we.floating)return Nn(we.reference,we.floating,$,xe)},[p,y,we,$,xe]);const ae=Ve(I),Ue=yr(r,ae,F),$e=ut(I)||"center",Ne=!!re.hide?.referenceHidden;J(()=>{w&&y&&Z&&P(ae)},[w,y,Z,ae]);const Je=l.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),Qe=re.arrow?.centerOffset!==0;return l.useMemo(()=>({positionerStyles:Ie,arrowStyles:Je,arrowRef:O,arrowUncentered:Qe,side:Ue,align:$e,physicalSide:ae,anchorHidden:Ne,refs:te,context:D,isPositioned:Z,update:$}),[Ie,Je,O,Qe,Ue,$e,ae,Ne,te,D,Z,$])}function Bn(e){return e!=null&&"current"in e}function wr(e){return e==="starting"?jr:zt}function Is(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:c=!1}){const a={...n};return c&&(a.pointerEvents="none"),gt("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:a},wr(r),o],stateAttributesMapping:or})}function Os(e){const t=l.useRef(""),n=l.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:l.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function br(e,t){const n=l.useRef(e),r=ue(t);J(()=>{n.current!==e&&r(n.current)},[e,r]),J(()=>{n.current=e},[e])}function Ps(e,t){const n=ue((s,i)=>{(typeof e=="function"?e():e)||t(i||(Yr?"touch":""))}),{onClick:r,onPointerDown:o}=Os(n);return l.useMemo(()=>({onClick:r,onPointerDown:o}),[r,o])}function Ds(e){const[t,n]=l.useState(null),r=Ps(e,n);return br(e,o=>{o&&!e&&n(null)}),l.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Ls(e){const[t,n]=l.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function Fs(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}function Wn({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=l.useRef(e!==void 0),[s,i]=l.useState(t),c=o?e:s,a=l.useCallback(f=>{o||i(f)},[]);return[c,a]}const Rr=l.createContext(null),Sr=l.createContext(null);function mt(){const e=l.useContext(Rr);if(e===null)throw new Error(Mt(60));return e}function vr(){const e=l.useContext(Sr);if(e===null)throw new Error(Mt(61));return e}let Un=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Vs={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Rt={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},ks={disabled:!1,...Rt},Ns={valid(e){return e===null?null:e?{[Un.valid]:""}:{[Un.invalid]:""}}},Hs={invalid:void 0,name:void 0,validityData:{state:Vs,errors:[],error:"",value:"",initialValue:null},setValidityData:Le,disabled:void 0,touched:Rt.touched,setTouched:Le,dirty:Rt.dirty,setDirty:Le,filled:Rt.filled,setFilled:Le,focused:Rt.focused,setFocused:Le,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:ks,markedDirtyRef:{current:!1},registerFieldControl:Le,validation:{getValidationProps:(e,t=zt)=>t,inputRef:{current:null},registerInput:Le,commit:async()=>{},change:Le}},_s=l.createContext(Hs);function bn(e=!0){const t=l.useContext(_s);if(t.setValidityData===Le&&!e)throw new Error(Mt(28));return t}function Bs(e,t,n,r,o=!0,s){const{registerFieldControl:i}=bn(),c=l.useRef(null);c.current||(c.current=Symbol()),J(()=>{const a=c.current;return!a||!o?void 0:(i(a,{controlRef:e,getValue:r,id:t,name:s,value:n}),()=>{i(a,void 0)})},[e,o,r,t,s,i,n])}const Ws=l.createContext({controlId:void 0,registerControlId:Le,labelId:void 0,setLabelId:Le,messageIds:[],setMessageIds:Le,getDescriptionProps:e=>e});function Er(){return l.useContext(Ws)}function Cr(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Er(),i=uo(t),c=n?o:void 0,a=Tt(()=>Symbol("labelable-control")),f=l.useRef(!1),g=l.useRef(t!=null),u=ue(()=>{!f.current||s===Le||(f.current=!1,s(a.current,void 0))});return J(()=>{if(s===Le)return;let d;if(n){const p=r?.current;Ae(p)&&p.closest("label")!=null?d=t??null:d=c??i}else if(t!=null)g.current=!0,d=t;else if(g.current)d=i;else{u();return}if(d===void 0){u();return}f.current=!0,s(a.current,d)},[t,r,c,s,n,i,a,u]),l.useEffect(()=>u,[u]),o??i}const Us=(e,t)=>Object.is(e,t);function pt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function $s(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:pt(t,r,n))}function Et(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:pt(r,t,n))}function zs(e,t,n){return e.filter(r=>!pt(t,r,n))}function an(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tr(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function js(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(Tr(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 Ar(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 an(e)}function ft(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?an(e.value):an(e)}function Mr(e,t,n){function r(){return Ar(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 t[e]??r();if(Array.isArray(t)){const o=t,s=Tr(o)?o.flatMap(i=>i.items):o;if(e==null||typeof e!="object"){const i=s.find(c=>c.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=s.find(c=>c&&c.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function Ys(e,t,n){return e.reduce((r,o,s)=>(s>0&&r.push(", "),r.push(Me.jsx(l.Fragment,{children:Mr(o,t,n)},s)),r),[])}const U={id:oe(e=>e.id),labelId:oe(e=>e.labelId),modal:oe(e=>e.modal),multiple:oe(e=>e.multiple),items:oe(e=>e.items),itemToStringLabel:oe(e=>e.itemToStringLabel),itemToStringValue:oe(e=>e.itemToStringValue),isItemEqualToValue:oe(e=>e.isItemEqualToValue),value:oe(e=>e.value),hasSelectedValue:oe(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:ft(t,r)!==""}),hasNullItemLabel:oe((e,t)=>t?js(e.items):!1),open:oe(e=>e.open),mounted:oe(e=>e.mounted),forceMount:oe(e=>e.forceMount),transitionStatus:oe(e=>e.transitionStatus),openMethod:oe(e=>e.openMethod),activeIndex:oe(e=>e.activeIndex),selectedIndex:oe(e=>e.selectedIndex),isActive:oe((e,t)=>e.activeIndex===t),isSelected:oe((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(o=>pt(t,o,n)):pt(t,r,n)}),isSelectedByFocus:oe((e,t)=>e.selectedIndex===t),popupProps:oe(e=>e.popupProps),triggerProps:oe(e=>e.triggerProps),triggerElement:oe(e=>e.triggerElement),positionerElement:oe(e=>e.positionerElement),listElement:oe(e=>e.listElement),popupSide:oe(e=>e.popupSide),scrollUpArrowVisible:oe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:oe(e=>e.scrollDownArrowVisible),hasScrollArrows:oe(e=>e.hasScrollArrows)},qs=l.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Le,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Ks(){return l.useContext(qs)}function Xs(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}const tt=1;function Ir(e,t){return Math.max(0,e-t)}function Gs(e,t){if(t<=0)return 0;const n=bt(e,0,t),r=n,o=t-n,s=r<=tt,i=o<=tt;return s&&i?r<=o?0:t:s?0:i?t:n}function Ti(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:c,name:a,form:f,autoComplete:g,disabled:u=!1,readOnly:d=!1,required:p=!1,modal:m=!0,actionsRef:y,inputRef:b,onOpenChangeComplete:h,items:R,multiple:x=!1,itemToStringLabel:w,itemToStringValue:S,isItemEqualToValue:C=Us,highlightItemOnHover:P=!0,children:T}=e,{clearErrors:L}=Ks(),{setDirty:_,setTouched:X,setFocused:B,validityData:k,setFilled:M,name:N,disabled:Y,validation:F,validationMode:E}=bn(),W=Cr({id:t}),A=Y||u,v=N??a,[H,me]=Wn({controlled:n,default:x?r??on:r,name:"Select",state:"value"}),[q,ye]=Wn({controlled:s,default:i,name:"Select",state:"open"}),he=l.useRef([]),O=l.useRef([]),j=l.useRef(null),le=l.useRef(null),Ce=l.useRef(0),Q=l.useRef(null),ne=l.useRef([]),se=l.useRef(!1),Se=l.useRef(null),fe=l.useRef(null),de=l.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),xe=l.useRef(!1),{mounted:te,setMounted:we,transitionStatus:ce}=sr(q),{openMethod:ie,triggerProps:re}=Ds(q),$=Tt(()=>new Gr({id:W,labelId:void 0,modal:m,multiple:x,itemToStringLabel:w,itemToStringValue:S,isItemEqualToValue:C,value:H,open:q,mounted:te,transitionStatus:ce,items:R,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,I=z($,U.activeIndex),D=z($,U.selectedIndex),Z=z($,U.triggerElement),V=z($,U.positionerElement),G=Ls(ie),ke=ie??G??null,We=l.useMemo(()=>x?"":ft(H,S),[x,H,S]),Ie=l.useMemo(()=>x&&Array.isArray(H)?H.map(K=>ft(K,S)):ft(H,S),[x,H,S]),Fe=Ye($.state.triggerElement),ae=ue(()=>Ie);Bs(Fe,W,H,ae,!A,a);const Ue=l.useRef(H),$e=x?Array.isArray(H)&&H.length>0:H!=null&&ft(H,S)!=="";J(()=>{H!==Ue.current&&$.set("forceMount",!0)},[$,H]),J(()=>{M($e)},[$e,M]),J(function(){const ge=ne.current;let Ee;if(x){const De=Array.isArray(H)?H:[];if(De.length===0)Ee=null;else{const Xe=De[De.length-1],Ze=Et(ge,Xe,C);Ee=Ze===-1?null:Ze}}else{const De=Et(ge,H,C);Ee=De===-1?null:De}Ee===null&&(fe.current=null),!q&&$.set("selectedIndex",Ee)},[$e,x,q,H,ne,C,$,fe]);function Ne(K){const ge=k.initialValue;return Array.isArray(K)&&Array.isArray(ge)?!Xs(K,ge,(Ee,De)=>pt(Ee,De,C)):K!==ge}br(H,()=>{L(v),_(Ne(H)),F.change(H)});const Je=ue((K,ge)=>{c?.(K,ge),!ge.isCanceled&&(ye(K),!K&&(ge.reason===Jn||ge.reason===Jr)&&(X(!0),B(!1),E==="onBlur"&&F.commit(H)))}),Qe=ue(()=>{we(!1),$.update({activeIndex:null,openMethod:null}),h?.(!1)});gn({enabled:!y,open:q,ref:j,onComplete(){q||Qe()}}),l.useImperativeHandle(y,()=>({unmount:Qe}),[Qe]);const ee=ue((K,ge)=>{o?.(K,ge),!ge.isCanceled&&me(K)}),pe=ue(()=>{const K=$.state.listElement||j.current;if(!K)return;const ge=Ir(K.scrollHeight,K.clientHeight),Ee=Gs(K.scrollTop,ge),De=Ee>0,Xe=Ee<ge;$.state.scrollUpArrowVisible!==De&&$.set("scrollUpArrowVisible",De),$.state.scrollDownArrowVisible!==Xe&&$.set("scrollDownArrowVisible",Xe)}),ve=hr({open:q,onOpenChange:Je,elements:{reference:Z,floating:V}}),Re=Oo(ve,{enabled:!d&&!A,event:"mousedown"}),Te=fo(ve),be=Rs(ve,{enabled:!d&&!A,listRef:he,activeIndex:I,selectedIndex:D,disabledIndices:on,onNavigate(K){K===null&&!q||$.set("activeIndex",K)},focusItemOnHover:P}),Oe=Ss(ve,{enabled:!d&&!A&&(q||!x),listRef:O,activeIndex:I,selectedIndex:D,disabledIndices:K=>Fs(he.current[K]),onMatch(K){q?$.set("activeIndex",K):ee(ne.current[K],_e("none"))},onTyping(K){se.current=K}}),ze=l.useMemo(()=>{const K=sn(Oe.reference,be.reference,Te.reference,Re.reference,re);return W&&(K.id=W),K},[Re.reference,Oe.reference,be.reference,Te.reference,re,W]),qe=l.useMemo(()=>sn(po,Oe.floating,be.floating,Te.floating),[Oe.floating,be.floating,Te.floating]),ct=be.item??zt;go(()=>{$.update({popupProps:qe,triggerProps:ze})}),J(()=>{$.update({id:W,modal:m,multiple:x,value:H,open:q,mounted:te,transitionStatus:ce,popupProps:qe,triggerProps:ze,items:R,itemToStringLabel:w,itemToStringValue:S,isItemEqualToValue:C,openMethod:ke})},[$,W,m,x,H,q,te,ce,qe,ze,R,w,S,C,ke]);const Pe=l.useMemo(()=>({store:$,name:v,required:p,disabled:A,readOnly:d,multiple:x,highlightItemOnHover:P,setValue:ee,setOpen:Je,listRef:he,popupRef:j,scrollHandlerRef:le,handleScrollArrowVisibility:pe,scrollArrowsMountedCountRef:Ce,itemProps:ct,valueRef:Q,valuesRef:ne,labelsRef:O,typingRef:se,selectionRef:de,firstItemTextRef:Se,selectedItemTextRef:fe,validation:F,onOpenChangeComplete:h,alignItemWithTriggerActiveRef:xe,initialValueRef:Ue}),[$,v,p,A,d,x,P,ee,Je,ct,F,h,pe]),Ke=qr(b,F.inputRef),ht=x&&Array.isArray(H)&&H.length>0,lt=x?void 0:v,xt=l.useMemo(()=>!x||!Array.isArray(H)||!v?null:H.map(K=>{const ge=ft(K,S);return Me.jsx("input",{type:"hidden",form:f,name:v,value:ge,disabled:A},ge)}),[x,H,f,v,S,A]);return Me.jsx(Rr.Provider,{value:Pe,children:Me.jsxs(Sr.Provider,{value:ve,children:[T,Me.jsx("input",{...F.getValidationProps(A,{onFocus(){$.state.triggerElement?.focus({focusVisible:!0})},onChange(K){if(K.nativeEvent.defaultPrevented||A||d)return;const ge=K.currentTarget.value,Ee=_e(mn,K.nativeEvent);function De(){if(x)return;const Xe=ge.toLowerCase();let Ze=ne.current.findIndex(Gt=>ft(Gt,S).toLowerCase()===Xe||Ar(Gt,w).toLowerCase()===Xe);Ze===-1&&(Ze=ne.current.findIndex((Gt,Fr)=>{const vn=O.current[Fr];return vn!=null&&vn.toLowerCase()===Xe}));const Sn=Ze===-1?void 0:ne.current[Ze];Sn!=null&&ee(Sn,Ee)}$.set("forceMount",!0),queueMicrotask(De)}}),id:W&&lt==null?`${W}-hidden-input`:void 0,form:f,name:lt,autoComplete:g,value:We,disabled:A,required:p&&!ht,readOnly:d,ref:Ke,style:v?Kr:Xr,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),xt]})})}function Js(e,t){return e??t}function Qs(e){const t=e.getBoundingClientRect(),n=Be(e);if(Qr)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,c=parseFloat(r.height)||0,a=parseFloat(o.width)||0,f=parseFloat(o.height)||0,g=Math.max(t.width,i,a),u=Math.max(t.height,c,f),d=g-t.width,p=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-p/2,bottom:t.bottom+p/2}}const Dt=2,Zs=400,ei={...mo,...Ns,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Ai=l.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:c=!0,style:a,...f}=t,{setTouched:g,setFocused:u,validationMode:d,state:p,disabled:m}=bn(),{labelId:y}=Er(),{store:b,setOpen:h,selectionRef:R,validation:x,readOnly:w,required:S,alignItemWithTriggerActiveRef:C,disabled:P}=mt(),T=m||P||i,L=z(b,U.open),_=z(b,U.mounted),X=z(b,U.value),B=z(b,U.triggerProps),k=z(b,U.positionerElement),M=z(b,U.listElement),N=z(b,U.popupSide),Y=z(b,U.id),F=z(b,U.labelId),E=z(b,U.hasSelectedValue),W=_&&k?N:null,A=s??Y,v=Js(y,F);Cr({id:A});const H=Ye(k),me=l.useRef(null),{getButtonProps:q,buttonRef:ye}=Zn({disabled:T,native:c}),he=ue(se=>{b.set("triggerElement",se)}),O=vt(),j=vt(),le=vt();l.useEffect(()=>{if(L)return le.start(Zs,()=>{R.current.allowUnselectedMouseUp=!0,R.current.allowSelectedMouseUp=!0}),()=>{le.clear()};R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},j.clear()},[L,R,j,le]);const Ce=sn(B,{id:A,role:"combobox","aria-expanded":L?"true":"false","aria-haspopup":"listbox","aria-controls":L?M?.id??Gn(k)?.id:void 0,"aria-labelledby":v,"aria-readonly":w||void 0,"aria-required":S||void 0,tabIndex:T?-1:0,onFocus(se){u(!0),L&&C.current&&h(!1,_e(mn,se.nativeEvent)),O.start(0,()=>{b.set("forceMount",!0)})},onBlur(se){at(k,se.relatedTarget)||(g(!0),u(!1),d==="onBlur"&&x.commit(X))},onMouseDown(se){if(L)return;const Se=ot(se.currentTarget);function fe(de){if(!me.current)return;const xe=de.target;if(at(me.current,xe)||at(H.current,xe))return;const te=Qs(me.current);de.clientX>=te.left-Dt&&de.clientX<=te.right+Dt&&de.clientY>=te.top-Dt&&de.clientY<=te.bottom+Dt||h(!1,_e(Zr,de))}j.start(0,()=>{Se.addEventListener("mouseup",fe,{once:!0})})}},f,q),Q=x.getValidationProps(T,Ce);Q.role="combobox";const ne={...p,open:L,disabled:T,value:X,readOnly:w,popupSide:W,placeholder:!E};return gt("button",t,{ref:[n,me,ye,he],state:ne,stateAttributesMapping:ei,props:Q})}),ti={value:()=>null},Mi=l.forwardRef(function(t,n){const{className:r,render:o,children:s,placeholder:i,style:c,...a}=t,{store:f,valueRef:g}=mt(),u=z(f,U.value),d=z(f,U.items),p=z(f,U.itemToStringLabel),m=z(f,U.hasSelectedValue),y=!m&&i!=null&&s==null,b=z(f,U.hasNullItemLabel,y),h={value:u,placeholder:!m};let R=null;return typeof s=="function"?R=s(u):s!=null?R=s:!m&&i!=null&&!b?R=i:Array.isArray(u)?R=Ys(u,d,p):R=Mr(u,d,p),gt("span",t,{state:h,ref:[n,g],props:[{children:R},a],stateAttributesMapping:ti})}),ni=l.createContext(void 0),Ii=l.forwardRef(function(t,n){const{store:r}=mt(),o=z(r,U.mounted),s=z(r,U.forceMount);return o||s?Me.jsx(ni.Provider,{value:!0,children:Me.jsx(eo,{ref:n,...t})}):null}),Or=l.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ri(){return l.useContext(Or)}function oi(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ue(o),i=l.useRef(0),c=Tt(ii).current,a=Tt(si).current,[f,g]=l.useState(0),u=l.useRef(f),d=ue((h,R)=>{a.set(h,R??null),u.current+=1,g(u.current)}),p=ue(h=>{a.delete(h),u.current+=1,g(u.current)}),m=l.useMemo(()=>{const h=new Map;return Array.from(a.keys()).filter(x=>x.isConnected).sort(ci).forEach((x,w)=>{const S=a.get(x)??{};h.set(x,{...S,index:w})}),h},[a,f]);J(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const h=new MutationObserver(R=>{const x=new Set,w=S=>x.has(S)?x.delete(S):x.add(S);R.forEach(S=>{S.removedNodes.forEach(w),S.addedNodes.forEach(w)}),x.size===0&&(u.current+=1,g(u.current))});return m.forEach((R,x)=>{x.parentElement&&h.observe(x.parentElement,{childList:!0})}),()=>{h.disconnect()}},[m]),J(()=>{u.current===f&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),s(m)},[s,m,n,r,f]),J(()=>()=>{n.current=[]},[n]),J(()=>()=>{r&&(r.current=[])},[r]);const y=ue(h=>(c.add(h),()=>{c.delete(h)}));J(()=>{c.forEach(h=>h(m))},[c,m]);const b=l.useMemo(()=>({register:d,unregister:p,subscribeMapChange:y,elementsRef:n,labelsRef:r,nextIndexRef:i}),[d,p,y,n,r,i]);return Me.jsx(Or.Provider,{value:b,children:t})}function si(){return new Map}function ii(){return new Set}function ci(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Pr=l.createContext(void 0);function li(){const e=l.useContext(Pr);if(!e)throw new Error(Mt(59));return e}function $t(e,t){e&&Object.assign(e.style,t)}const ai={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ui=20;function fi(e,t,n,r){const[o,s]=l.useState(!1);J(()=>{if(!e||!t||n==null){s(!1);return}const i=ot(n).documentElement.clientWidth,c=n.offsetWidth;s(i>0&&c>0&&c>=i-ui)},[e,t,n]),ho(e&&(!t||o),r)}const di={position:"fixed"},Oi=l.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:c="bottom",align:a="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:u="clipping-ancestors",collisionPadding:d,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:y,alignItemWithTrigger:b=!0,collisionAvoidance:h=to,style:R,...x}=t,{store:w,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:P,selectedItemTextRef:T,valuesRef:L,initialValueRef:_,popupRef:X,setValue:B}=mt(),k=vr(),M=z(w,U.open),N=z(w,U.mounted),Y=z(w,U.modal),F=z(w,U.value),E=z(w,U.openMethod),W=z(w,U.positionerElement),A=z(w,U.triggerElement),v=z(w,U.isItemEqualToValue),H=z(w,U.transitionStatus),me=l.useRef(null),q=l.useRef(null),[ye,he]=l.useState(b),O=N&&ye&&E!=="touch";!N&&ye!==b&&he(b),J(()=>{N||(U.scrollUpArrowVisible(w.state)&&w.set("scrollUpArrowVisible",!1),U.scrollDownArrowVisible(w.state)&&w.set("scrollDownArrowVisible",!1))},[w,N]),l.useImperativeHandle(P,()=>O),fi((O||Y)&&M,E==="touch",W,A);const j=Ms({anchor:r,floatingRootContext:k,positionMethod:o,mounted:N,side:c,sideOffset:f,align:a,alignOffset:g,arrowPadding:p,collisionBoundary:u,collisionPadding:d,sticky:m,disableAnchorTracking:y??O,collisionAvoidance:h,keepMounted:!0}),le=O?"none":j.side,Ce=O?di:j.positionerStyles,Q={open:M,side:le,align:j.align,anchorHidden:j.anchorHidden};J(()=>{w.set("popupSide",j.side)},[w,j.side]);const ne=ue(xe=>{w.set("positionerElement",xe)}),se=Is(t,Q,{styles:Ce,transitionStatus:H,props:x,refs:[n,ne],hidden:!N,inert:!M}),Se=l.useRef(0),fe=ue(xe=>{if(xe.size===0&&Se.current===0||L.current.length===0)return;const te=Se.current;if(Se.current=xe.size,xe.size===te)return;const we=_e(mn);if(te!==0&&!w.state.multiple&&F!==null&&Et(L.current,F,v)===-1){const ie=_.current,$=ie!=null&&Et(L.current,ie,v)!==-1?ie:null;B($,we),$===null&&(w.set("selectedIndex",null),T.current=null)}if(te!==0&&w.state.multiple&&Array.isArray(F)){const ce=re=>Et(L.current,re,v)!==-1,ie=F.filter(re=>ce(re));(ie.length!==F.length||ie.some(re=>!$s(F,re,v)))&&(B(ie,we),ie.length===0&&(w.set("selectedIndex",null),T.current=null))}if(M&&O){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ce={height:""};$t(W,ce),$t(X.current,ce)}}),de=l.useMemo(()=>({...j,side:le,alignItemWithTriggerActive:O,setControlledAlignItemWithTrigger:he,scrollUpArrowRef:me,scrollDownArrowRef:q}),[j,le,O,he]);return Me.jsx(oi,{elementsRef:S,labelsRef:C,onMapChange:fe,children:Me.jsxs(Pr.Provider,{value:de,children:[N&&Y&&Me.jsx(xo,{inert:no(!M),cutout:A}),se]})})}),Lt="base-ui-disable-scrollbar",$n={className:Lt,getElement(e){return Me.jsx("style",{nonce:e,href:Lt,precedence:"base-ui:low",children:`.${Lt}{scrollbar-width:none}.${Lt}::-webkit-scrollbar{display:none}`})}},pi=l.createContext(void 0);function gi(e){return l.useContext(pi)}const mi=l.createContext(void 0),hi={disableStyleElements:!1};function xi(){return l.useContext(mi)??hi}const yi={...or,...er},Pi=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...c}=t,{store:a,popupRef:f,onOpenChangeComplete:g,setOpen:u,valueRef:d,firstItemTextRef:p,selectedItemTextRef:m,multiple:y,handleScrollArrowVisibility:b,scrollHandlerRef:h,listRef:R,highlightItemOnHover:x}=mt(),{side:w,align:S,alignItemWithTriggerActive:C,isPositioned:P,setControlledAlignItemWithTrigger:T}=li(),L=gi()!=null,_=vr(),X=xr(),{nonce:B,disableStyleElements:k}=xi(),M=z(a,U.id),N=z(a,U.open),Y=z(a,U.openMethod),F=z(a,U.mounted),E=z(a,U.popupProps),W=z(a,U.transitionStatus),A=z(a,U.triggerElement),v=z(a,U.positionerElement),H=z(a,U.listElement),me=l.useRef(!1),q=l.useRef(!1),ye=l.useRef({}),he=Ht(),O=ue(Q=>{if(!v||!f.current||!q.current)return;if(me.current||!C){b();return}const ne=v.style.top==="0px",se=v.style.bottom==="0px";if(!ne&&!se){b();return}const Se=jn(v),fe=St(v.getBoundingClientRect().height,"y",Se),de=ot(v),xe=Be(v),te=xe.getComputedStyle(v),we=parseFloat(te.marginTop),ce=parseFloat(te.marginBottom),ie=zn(xe.getComputedStyle(f.current)),re=Math.min(de.documentElement.clientHeight-we-ce,ie),$=Q.scrollTop,I=Ft(Q);let D=0,Z=null,V=!1,G=!1;const ke=ae=>{v.style.height=`${ae}px`},We=(ae,Ue)=>{const $e=bt(ae,0,re-fe);$e>0&&ke(fe+$e),Q.scrollTop=Ue,re-(fe+$e)<=tt&&(me.current=!0),b()},Ie=ne?I-$:$,Fe=Math.min(fe+Ie,re);if(D=Fe,Ie<=tt){We(Ie,ne?I:0);return}if(re-Fe>tt)ne?G=!0:Z=0;else if(V=!0,se&&$<I){const ae=fe+Ie-re;Z=$-(Ie-ae)}if(D=Math.ceil(D),D!==0&&ke(D),G||Z!=null){const ae=Ft(Q),Ue=G?ae:bt(Z,0,ae);Math.abs(Q.scrollTop-Ue)>tt&&(Q.scrollTop=Ue)}(V||D>=re-tt)&&(me.current=!0),b()});l.useImperativeHandle(h,()=>O,[O]),gn({open:N,ref:f,onComplete(){N&&g?.(!0)}});const j={open:N,transitionStatus:W,side:w,align:S};J(()=>{!v||!f.current||Object.keys(ye.current).length||(ye.current={top:v.style.top||"0",left:v.style.left||"0",right:v.style.right,height:v.style.height,bottom:v.style.bottom,minHeight:v.style.minHeight,maxHeight:v.style.maxHeight,marginTop:v.style.marginTop,marginBottom:v.style.marginBottom})},[f,v]),J(()=>{N||C||(q.current=!1,me.current=!1,$t(v,ye.current))},[N,C,v,f]),J(()=>{const Q=f.current;if(!N||!A||!v||!Q||C&&!P||a.state.transitionStatus==="ending")return;if(!C){q.current=!0,he.request(b),Q.style.removeProperty("--transform-origin");return}const ne=wi(Q);Q.style.removeProperty("--transform-origin");try{let se=m.current;se?.isConnected||(se=!U.hasSelectedValue(a.state)&&p.current?.isConnected?p.current:null);const Se=d.current,fe=Be(v),de=fe.getComputedStyle(v),xe=fe.getComputedStyle(Q),te=ot(A),we=jn(A),ce=Vt(A.getBoundingClientRect(),we),ie=Vt(v.getBoundingClientRect(),we),re=ce.height,$=H||Q,I=$.scrollHeight,D=parseFloat(xe.borderBottomWidth),Z=parseFloat(de.marginTop)||10,V=parseFloat(de.marginBottom)||10,G=parseFloat(de.minHeight)||100,ke=zn(xe),We=5,Ie=5,Fe=20,ae=te.documentElement.clientHeight-Z-V,Ue=te.documentElement.clientWidth,$e=ae-ce.bottom+re;let Ne,Je=X==="rtl"?ce.right-ie.width:ce.left,Qe=0;if(se&&Se){const Pe=Vt(Se.getBoundingClientRect(),we);Ne=Vt(se.getBoundingClientRect(),we),Je=ie.left+(X==="rtl"?Pe.right-Ne.right:Pe.left-Ne.left);const Ke=Pe.top-ce.top+Pe.height/2;Qe=Ne.top-ie.top+Ne.height/2-Ke}const ee=$e+Qe+V+D;let pe=Math.min(ae,ee);const ve=ae-Z-V,Re=ee-pe,Te=Ue-Ie;v.style.left=`${bt(Je,We,Te-ie.width)}px`,v.style.height=`${pe}px`,v.style.maxHeight="none",v.style.marginTop=`${Z}px`,v.style.marginBottom=`${V}px`,Q.style.height="100%";const be=Ft($),Oe=Re>=be-tt;Oe&&(pe=Math.min(ae,ie.height)-(Re-be));const ze=ce.top<Fe||ce.bottom>ae-Fe||Math.ceil(pe)+tt<Math.min(I,G),qe=(fe.visualViewport?.scale??1)!==1&&ro;if(ze||qe){q.current=!0,$t(v,ye.current),T(!1);return}const ct=Math.max(G,pe);if(Oe){const Pe=Math.max(0,ae-ee);v.style.top=ie.height>=ve?"0":`${Pe}px`,v.style.height=`${pe}px`,$.scrollTop=Ft($)}else v.style.bottom="0",$.scrollTop=Re;if(Ne){const Pe=ie.top,Ke=ie.height,ht=Ne.top+Ne.height/2,lt=Ke>0?(ht-Pe)/Ke*100:50,xt=bt(lt,0,100);Q.style.setProperty("--transform-origin",`50% ${xt}%`)}(ct===ae||pe>=ke)&&(me.current=!0),b(),x&&a.state.selectedIndex===null&&a.state.activeIndex===null&&R.current[0]!=null&&a.set("activeIndex",0),q.current=!0}finally{ne()}},[a,N,v,A,d,p,m,f,b,C,T,he,H,R,x,X,P]),l.useEffect(()=>{if(!C||!v||!N)return;const Q=Be(v);function ne(se){u(!1,_e(so,se))}return oo(Q,"resize",ne)},[u,C,v,N]);const le={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":y||void 0,id:`${M}-list`},onKeyDown(Q){L&&wo.has(Q.key)&&Q.stopPropagation()},onScroll(Q){H||O(Q.currentTarget)},...C&&{style:H?{height:"100%"}:ai}},Ce=gt("div",t,{ref:[n,f],state:j,stateAttributesMapping:yi,props:[E,le,wr(W),{className:!H&&C?$n.className:void 0},c]});return Me.jsxs(l.Fragment,{children:[!k&&$n.getElement(B),Me.jsx(yo,{context:_,modal:!1,disabled:!F,openInteractionType:Y,returnFocus:i,restoreFocus:!0,children:Ce})]})});function zn(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ft(e){return Ir(e.scrollHeight,e.clientHeight)}function jn(e){return pr.getScale(e)}function St(e,t,n){return e/n[t]}function Vt(e,t){return At({x:St(e.x,"x",t),y:St(e.y,"y",t),width:St(e.width,"x",t),height:St(e.height,"y",t)})}const Yn=[["transform","none"],["scale","1"],["translate","0 0"]];function wi(e){const{style:t}=e,n={};for(const[r,o]of Yn)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Yn){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}let Dr=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function bi(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:c,subscribeMapChange:a,elementsRef:f,labelsRef:g,nextIndexRef:u}=ri(),d=l.useRef(-1),[p,m]=l.useState(s??(o===Dr.GuessFromOrder?()=>{if(d.current===-1){const h=u.current;u.current+=1,d.current=h}return d.current}:-1)),y=l.useRef(null),b=l.useCallback(h=>{if(y.current=h,p!==-1&&h!==null&&(f.current[p]=h,g)){const R=t!==void 0;g.current[p]=R?t:r?.current?.textContent??h.textContent}},[p,f,g,t,r]);return J(()=>{if(s!=null)return;const h=y.current;if(h)return i(h,n),()=>{c(h)}},[s,i,c,n]),J(()=>{if(s==null)return a(h=>{const R=y.current?h.get(y.current)?.index:null;R!=null&&m(R)})},[s,a,m]),{ref:b,index:p}}const Lr=l.createContext(void 0);function Rn(){const e=l.useContext(Lr);if(!e)throw new Error(Mt(57));return e}const Di=l.memo(l.forwardRef(function(t,n){const{render:r,className:o,style:s,value:i=null,label:c,disabled:a=!1,nativeButton:f=!1,...g}=t,u=l.useRef(null),d=bi({label:c,textRef:u,indexGuessBehavior:Dr.GuessFromOrder}),{store:p,itemProps:m,setOpen:y,setValue:b,selectionRef:h,typingRef:R,valuesRef:x,multiple:w,selectedItemTextRef:S,disabled:C,readOnly:P}=mt(),T=z(p,U.isActive,d.index),L=z(p,U.open),_=z(p,U.isSelected,i),X=z(p,U.isSelectedByFocus,d.index),B=z(p,U.isItemEqualToValue),k=d.index,M=k!==-1,N=l.useRef(null);J(()=>{if(!M)return;const O=x.current;return O[k]=i,()=>{delete O[k]}},[M,k,i,x]),J(()=>{if(!M)return;const O=p.state.value;let j=O;w&&Array.isArray(O)&&(j=O.length>0?O[O.length-1]:void 0),j!==void 0&&pt(i,j,B)&&(p.set("selectedIndex",k),u.current&&(S.current=u.current))},[M,k,w,B,p,i,S]);const Y=l.useRef(null),F=l.useRef("mouse"),E=l.useRef(!1),{getButtonProps:W,buttonRef:A}=Zn({disabled:a,focusableWhenDisabled:!0,native:f,composite:!0}),v={disabled:a,selected:_,highlighted:T};function H(O){if(C||P)return;const j=p.state.value;if(w){const le=Array.isArray(j)?j:[],Ce=_?zs(le,i,B):[...le,i];b(Ce,_e(Zt,O))}else b(i,_e(Zt,O)),y(!1,_e(Zt,O))}function me(){h.current.dragY=0}const q={role:"option","aria-selected":_,tabIndex:L&&T?0:-1,onKeyDown(O){Y.current=O.key,p.set("activeIndex",k),O.key===" "&&R.current&&O.preventDefault()},onClick(O){const j=O.type==="click"&&F.current!=="touch",le=O.nativeEvent.pointerType,Ce=j&&rr(O.nativeEvent)&&(le!==void 0||T),Q=j&&!Ce&&!E.current;E.current=!1,!(O.type==="keydown"&&Y.current===null)&&(a||O.type==="keydown"&&Y.current===" "&&R.current||Q||(Y.current=null,H(O.nativeEvent)))},onPointerEnter(O){F.current=O.pointerType},onPointerMove(O){if(O.pointerType==="mouse"&&O.buttons===1){const j=h.current;j.dragY+=O.movementY,j.dragY**2>=64&&(j.allowUnselectedMouseUp=!0)}},onPointerDown(O){F.current=O.pointerType,E.current=!0,me()},onMouseUp(){if(me(),a||F.current==="touch"||E.current)return;const O=!h.current.allowSelectedMouseUp&&_,j=!h.current.allowUnselectedMouseUp&&!_;O||j||(E.current=!0,N.current?.click(),E.current=!1)}},ye=gt("div",t,{ref:[A,n,d.ref,N],state:v,props:[m,q,g,W]}),he=l.useMemo(()=>({selected:_,index:k,textRef:u,selectedByFocus:X,hasRegistered:M}),[_,k,u,X,M]);return Me.jsx(Lr.Provider,{value:he,children:ye})})),Li=l.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Rn();return r||o?Me.jsx(Ri,{...t,ref:n}):null}),Ri=l.memo(l.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:c}=Rn(),a=l.useRef(null),{transitionStatus:f,setMounted:g}=sr(c),d=gt("span",e,{ref:[t,a],state:{selected:c,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:er});return gn({open:c,ref:a,onComplete(){c||g(!1)}}),d})),Fi=l.memo(l.forwardRef(function(t,n){const{index:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Rn(),{firstItemTextRef:c,selectedItemTextRef:a}=mt(),{render:f,className:g,style:u,...d}=t,p=l.useCallback(y=>{y&&(i&&r===0&&(c.current=y),i&&s&&(a.current=y))},[c,a,r,s,i]);return gt("div",t,{ref:[p,n,o],props:d})}));export{$n as A,Ei as C,ai as L,Ti as S,Ks as a,bn as b,Er as c,Wn as d,Bs as e,Ns as f,br as g,Ai as h,Mi as i,Ii as j,Oi as k,Pi as l,Di as m,Fi as n,Li as o,Oo as p,Ps as q,Ms as r,U as s,fi as t,mt as u,Is as v,Ci as w,gi as x,wr as y,li as z};
@@ -1 +0,0 @@
1
- import{c as N,r as c,as as te,am as ne,aP as G,j as t,m as D,U as ae,V as k,G as a,Y as ie,ay as se,aQ as oe,aC as re,aD as le,aE as T,aR as ce,aS as ue,W as de,R as C,S as ge,T as he,a5 as U,aT as pe,aU as me,a1 as be,aV as fe,K as xe,aW as ye,aX as ve,aY as je,aZ as ke,a_ as Ne,a$ as Se,b0 as we,b1 as Ce,ak as Le,b2 as A}from"./main-QK2wZyt4.js";import{b as I,l as P,u as Ee,L as _}from"./use-limits-display-prefs-CC1SjRQA.js";import{S,T as j,a as x,b as M,u as R}from"./use-native-settings-BeV60g8D.js";import{u as Ge,P as Ae}from"./use-quality-per-dollar-pref-VMVZhzOm.js";import{C as Ie}from"./useScrollLock-DecJNW0u.js";import{u as Pe}from"./useCurrency-Bm3doFX6.js";import{S as F}from"./Select-B1n0PW4j.js";import{I as _e}from"./DialogTitle-CBT-8O9t.js";import{C as Oe}from"./ConfirmModal-BJryA878.js";import{D as De}from"./download-CAPdZzcq.js";import"./Card--_I4rbLK.js";import"./SelectItemText-BYGw7q1R.js";const Te=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ue=N("activity",Te);const Me=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Re=N("copy",Me);const Fe=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],He=N("grip-vertical",Fe);const Ve=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],$e=N("languages",Ve);const Be=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],ze=N("log-out",Be),We=e=>!e.isLayoutDirty&&e.willUpdate(!1);function O(){const e=new Set,n=new WeakMap,i=()=>e.forEach(We);return{add:s=>{e.add(s),n.set(s,s.addEventListener("willUpdate",i))},remove:s=>{e.delete(s);const o=n.get(s);o&&(o(),n.delete(s)),i()},dirty:i}}const Ze=c.createContext(null);function Ke(){const e=c.useRef(!1);return te(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function qe(){const e=Ke(),[n,i]=c.useState(0),s=c.useCallback(()=>{e.current&&i(n+1)},[n]);return[c.useCallback(()=>ne.postRender(s),[s]),n]}const H=e=>e===!0,Ye=e=>H(e===!0)||e==="id",Qe=({children:e,id:n,inherit:i=!0})=>{const s=c.useContext(G),o=c.useContext(Ze),[r,l]=qe(),u=c.useRef(null),g=s.id||o;u.current===null&&(Ye(i)&&g&&(n=n?g+"-"+n:g),u.current={id:n,group:H(i)&&s.group||O()});const p=c.useMemo(()=>({...u.current,forceRender:r}),[l]);return t.jsx(G.Provider,{value:p,children:e})},Je="shrink-0 text-oai-gray-900 dark:text-oai-gray-200";function Xe({checked:e,onChange:n,ariaLabel:i}){return t.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,onClick:n,className:k("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",e?"bg-oai-brand-500":"bg-oai-gray-300 dark:bg-oai-gray-700"),children:t.jsx("span",{className:k("inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform",e?"translate-x-[18px]":"translate-x-[3px]")})})}function et({prefs:e}){const{order:n,visibility:i,toggle:s,moveToward:o}=e,[r,l]=c.useState(null),[u,g]=c.useState(null),p=d=>m=>{l(d),m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/plain",d)},b=d=>m=>{m.preventDefault(),m.dataTransfer.dropEffect="move",r&&r!==d&&u!==d&&(g(d),o(r,d))},f=()=>{l(null),g(null)},y=d=>{d.preventDefault(),l(null),g(null)};return t.jsx(Qe,{children:t.jsx("div",{className:"flex flex-col",children:n.map(d=>{const m=i[d]!==!1,h=r===d;return t.jsxs(D.div,{layout:!0,transition:{duration:.28,ease:[.22,1,.36,1]},draggable:!0,onDragStart:p(d),onDragOver:b(d),onDragEnd:f,onDrop:y,className:k("flex items-center gap-3 py-2 rounded-md","hover:bg-oai-gray-100/60 dark:hover:bg-oai-gray-800/60",h&&"opacity-40"),style:{cursor:h?"grabbing":"grab"},children:[t.jsx(He,{className:"h-4 w-4 shrink-0 text-oai-gray-400 dark:text-oai-gray-500",strokeWidth:1.75,"aria-hidden":!0}),I(d)?t.jsx(ae,{provider:I(d),size:18,className:k("pointer-events-none",Je)}):null,t.jsx("span",{className:"flex-1 text-sm text-oai-gray-900 dark:text-oai-gray-200 select-none",children:P(d)}),t.jsx("div",{onMouseDown:v=>v.stopPropagation(),draggable:!1,children:t.jsx(Xe,{checked:m,onChange:()=>s(d),ariaLabel:`${a("limits.settings.toggle_visible")}: ${P(d)}`})})]},d)})})})}function tt(e){if(!e||typeof e!="object")return"";const n=e.user_metadata&&typeof e.user_metadata=="object"?e.user_metadata:{},i=e.profile&&typeof e.profile=="object"?e.profile:{},s=n.full_name||n.name||i.name||n.user_name||n.preferred_username;return typeof s=="string"&&s.trim()?s.trim():typeof e.email=="string"&&e.email.includes("@")?e.email.split("@")[0].trim()||e.email.trim():typeof e.email=="string"?e.email.trim():""}function nt(e){return!e||typeof e!="object"?"":typeof e.email=="string"?e.email.trim():""}function at(e){const n=typeof e=="string"?e.trim():"";if(!n)return null;const i=n.match(/^@?([A-Za-z0-9][A-Za-z0-9-]{0,38})$/),s=n.match(/^https:\/\/github\.com\/([A-Za-z0-9][A-Za-z0-9-]{0,38})\/?$/i),o=i?.[1]||s?.[1];return o?`https://github.com/${o}`:null}function L(e,n){console.warn(`[tokentracker] settings ${e}:`,n)}function it(e,n,i){const[s,o]=c.useState(()=>se()),r=n&&i&&oe(),l=c.useCallback(async()=>{const u=!s;if(re(u),o(u),!!u)try{await le(()=>e())}catch(g){L("cloud sync",g)}},[s,e]);return{cloudSyncOn:s,handleCloudSyncToggle:l,showLocalCloudSync:r}}function st(e){const[n,i]=c.useState(!1),[s,o]=c.useState(!1),[r,l]=c.useState(!1),[u,g]=c.useState(!1),[p,b]=c.useState(null),[f,y]=c.useState(!1),[d,m]=c.useState(""),[h,v]=c.useState(!1),[w,E]=c.useState(""),[z,W]=c.useState(""),[Z,K]=c.useState(!1),[q,Y]=c.useState(null),Q=c.useMemo(()=>tt(e),[e]),J=c.useMemo(()=>nt(e),[e]),X=c.useMemo(()=>typeof e?.id=="string"?e.id.trim():"",[e]),ee=c.useMemo(()=>({setAnonymousOn:o,setCustomDisplayName:b,setGithubUrl:E,setProfileLoading:l,setPublicProfileOn:i,setShowGithubOn:v}),[]);return{anonymousOn:s,customDisplayName:p,displayName:Q,editingGithub:Z,editingName:f,email:J,githubError:q,githubInput:z,githubUrl:w,loadSetters:ee,nameInput:d,profileLoading:r,profileSaving:u,publicProfileOn:n,setAnonymousOn:o,setCustomDisplayName:b,setEditingGithub:K,setEditingName:y,setGithubError:Y,setGithubInput:W,setGithubUrl:E,setNameInput:m,setProfileLoading:l,setProfileSaving:g,setPublicProfileOn:i,setShowGithubOn:v,showGithubOn:h,userId:X}}function ot(e,n,i){c.useEffect(()=>{if(!n)return;let s=!0;return i.setProfileLoading(!0),(async()=>{try{const o=await T({getAccessToken:e});if(!s||!o)return;const r=await ce({accessToken:o});if(!s)return;i.setPublicProfileOn(!!r?.enabled),i.setAnonymousOn(!!r?.anonymous),r?.display_name&&i.setCustomDisplayName(r.display_name),i.setShowGithubOn(!!r?.show_github_url),i.setGithubUrl(r?.github_url||"")}catch(o){L("load public profile",o)}finally{s&&i.setProfileLoading(!1)}})(),()=>{s=!1}},[e,n,i])}function rt(e,n){return c.useCallback(async(i,{label:s,onError:o,onSuccess:r}={})=>{if(n.profileSaving)return!1;n.setProfileSaving(!0);try{const l=await T({getAccessToken:e});if(!l)return!1;const u=await ue({accessToken:l,...i});return r?.(u),!0}catch(l){return o?o(l):L(s||"mutate profile",l),!1}finally{n.setProfileSaving(!1)}},[e,n])}function lt(e,n){return{anonymousOn:e.anonymousOn,customDisplayName:e.customDisplayName,displayName:e.displayName,editingName:e.editingName,handleAnonymousToggle:n.handleAnonymousToggle,handleSaveName:n.handleSaveName,nameInput:e.nameInput,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingName:e.setEditingName,setNameInput:e.setNameInput,startEditingName:n.startEditingName}}function ct(e,n){return{editingGithub:e.editingGithub,githubError:e.githubError,githubInput:e.githubInput,githubUrl:e.githubUrl,handleSaveGithub:n.handleSaveGithub,handleShowGithubToggle:n.handleShowGithubToggle,profileLoading:e.profileLoading,profileSaving:e.profileSaving,setEditingGithub:e.setEditingGithub,setGithubError:e.setGithubError,setGithubInput:e.setGithubInput,showGithubOn:e.showGithubOn,startEditingGithub:n.startEditingGithub}}function ut(e,n){const i=c.useCallback(async()=>{const o=!e.publicProfileOn;await n({enabled:o},{label:"toggle public profile",onSuccess:()=>e.setPublicProfileOn(o)})},[n,e]);return{handleAnonymousToggle:c.useCallback(async()=>{const o=!e.anonymousOn;await n({anonymous:o},{label:"toggle anonymous",onSuccess:()=>e.setAnonymousOn(o)})},[n,e]),handlePublicProfileToggle:i}}function dt(e,n,i){const s=c.useCallback(async()=>{const r=e.nameInput.trim().slice(0,50);r&&await n({display_name:r},{label:"save display name",onSuccess:()=>{e.setCustomDisplayName(r),e.setEditingName(!1),i?.()}})},[n,e,i]),o=c.useCallback(()=>{e.setNameInput(e.customDisplayName||e.displayName),e.setEditingName(!0)},[e]);return{handleSaveName:s,startEditingName:o}}function gt(e,n){const i=c.useCallback(async()=>{if(!e.showGithubOn&&!e.githubUrl){e.setEditingGithub(!0),e.setGithubInput(""),e.setGithubError(null);return}const r=!e.showGithubOn;await n({show_github_url:r},{label:"toggle GitHub profile",onSuccess:()=>e.setShowGithubOn(r)})},[n,e]),s=c.useCallback(async()=>{const r=at(e.githubInput);if(e.githubInput.trim()&&!r){e.setGithubError(a("settings.account.githubUrlInvalid"));return}e.setGithubError(null),await n({github_url:r,show_github_url:!!r},{label:"save GitHub profile",onError:l=>e.setGithubError(l?.message||a("settings.account.githubUrlInvalid")),onSuccess:l=>{e.setGithubUrl(l?.github_url||r||""),e.setShowGithubOn(!!r),e.setEditingGithub(!1)}})},[n,e]),o=c.useCallback(()=>{e.setGithubInput(e.githubUrl),e.setGithubError(null),e.setEditingGithub(!0)},[e]);return{handleSaveGithub:s,handleShowGithubToggle:i,startEditingGithub:o}}function ht(){const e=ie(),n=st(e.user),i=it(e.getAccessToken,e.enabled,e.signedIn);ot(e.getAccessToken,e.signedIn,n.loadSetters);const s=rt(e.getAccessToken,n),o=ut(n,s),r=dt(n,s,e.refreshDisplayName),l=gt(n,s);return{...e,...i,email:n.email,handlePublicProfileToggle:o.handlePublicProfileToggle,userId:n.userId,name:lt(n,{...o,...r}),github:ct(n,l),profileLoading:n.profileLoading,profileSaving:n.profileSaving,publicProfileOn:n.publicProfileOn}}function V({disabled:e,onCancel:n,onSave:i,saveLabel:s=a("settings.account.save")}){return t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:i,disabled:e,className:"rounded-md bg-oai-brand-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-oai-brand-600 disabled:opacity-50",children:s}),t.jsx("button",{type:"button",onClick:n,className:"rounded-md px-2 py-1.5 text-xs text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:a("settings.account.cancel")})]})}function pt({nameInput:e,setEditingName:n,setNameInput:i,profileSaving:s,handleSaveName:o}){return t.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[t.jsx("input",{type:"text",value:e,onChange:r=>i(r.target.value),onKeyDown:r=>{r.key==="Enter"&&o(),r.key==="Escape"&&n(!1)},maxLength:50,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:a("settings.account.displayName")}),t.jsx(V,{disabled:s||!e.trim(),onCancel:()=>n(!1),onSave:o,saveLabel:s?a("settings.account.saving"):void 0})]})}function mt({githubError:e,githubInput:n,handleSaveGithub:i,profileSaving:s,setEditingGithub:o,setGithubError:r,setGithubInput:l}){return t.jsxs("div",{className:"mt-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"text",value:n,onChange:u=>{l(u.target.value),e&&r(null)},onKeyDown:u=>{u.key==="Enter"&&i(),u.key==="Escape"&&(o(!1),r(null))},maxLength:100,autoFocus:!0,className:"flex-1 rounded-md border border-oai-gray-300 bg-transparent px-2.5 py-1.5 text-sm text-oai-black outline-none focus:border-oai-brand-500 focus:ring-1 focus:ring-inset focus:ring-oai-brand-500 dark:border-oai-gray-700 dark:text-white",placeholder:a("settings.account.githubUrlPlaceholder")}),t.jsx(V,{disabled:s,onCancel:()=>{o(!1),r(null)},onSave:i,saveLabel:s?a("settings.account.saving"):void 0})]}),e?t.jsx("div",{className:"mt-1.5 text-xs text-red-600 dark:text-red-400",children:e}):null]})}function $({disabled:e=!1,label:n,onClick:i,title:s}){return t.jsxs("button",{type:"button",onClick:i,disabled:e,title:s,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(Ae,{className:"h-3.5 w-3.5","aria-hidden":!0}),n]})}function B({actions:e,editing:n,editor:i,hint:s,label:o}){return t.jsx("div",{className:"py-3",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:o}),n?i:t.jsx("div",{className:"mt-0.5 truncate text-xs text-oai-gray-500 dark:text-oai-gray-400",children:s})]}),n?null:e]})})}function bt({name:e}){const n=e.anonymousOn?a("settings.account.displayNameDisabledWhileAnon"):void 0;return t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx($,{disabled:e.anonymousOn,label:a("settings.account.edit"),onClick:e.startEditingName,title:n}),t.jsx(j,{checked:!e.anonymousOn,onChange:e.handleAnonymousToggle,disabled:e.profileLoading||e.profileSaving,ariaLabel:a("settings.account.displayName")})]})}function ft({name:e}){const{anonymousOn:n,customDisplayName:i,displayName:s,editingName:o,handleAnonymousToggle:r,handleSaveName:l,nameInput:u,profileLoading:g,profileSaving:p,setEditingName:b,setNameInput:f,startEditingName:y}=e,d=n?a("settings.account.displayNameAnonymousHint"):i||s;return t.jsx(B,{label:a("settings.account.displayName"),editing:o,hint:d,editor:t.jsx(pt,{nameInput:u,setEditingName:b,setNameInput:f,profileSaving:p,handleSaveName:l}),actions:t.jsx(bt,{name:e})})}function xt({github:e}){const{editingGithub:n,githubError:i,githubInput:s,githubUrl:o,handleSaveGithub:r,handleShowGithubToggle:l,profileLoading:u,profileSaving:g,setEditingGithub:p,setGithubError:b,setGithubInput:f,showGithubOn:y,startEditingGithub:d}=e,{enabled:m,toggle:h}=Ge();return t.jsxs(t.Fragment,{children:[t.jsx(B,{label:a("settings.account.githubUrl"),editing:n,hint:o||a("settings.account.githubUrlHint"),editor:t.jsx(mt,{githubError:i,githubInput:s,handleSaveGithub:r,profileSaving:g,setEditingGithub:p,setGithubError:b,setGithubInput:f}),actions:t.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[t.jsx($,{label:a("settings.account.edit"),onClick:d}),t.jsx(j,{checked:y,onChange:l,disabled:u||g,ariaLabel:a("settings.account.githubUrl")})]})}),o&&t.jsx(x,{label:t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{children:a("settings.labs.qpd.label")}),t.jsx("span",{className:"px-1.5 py-0.5 text-[8px] font-semibold tracking-wider text-oai-gray-500 bg-oai-gray-100 dark:text-oai-gray-400 dark:bg-oai-gray-800/80 rounded uppercase scale-90 origin-left",children:a("qpd.card.badge")})]}),hint:a("settings.labs.qpd.hint"),control:t.jsx(j,{checked:m,onChange:h,ariaLabel:a("settings.labs.qpd.aria")})})]})}function yt(){const{openLoginModal:e}=de();return t.jsx(S,{title:a("settings.section.account"),children:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.account.signedOutHint")}),t.jsx("button",{type:"button",onClick:e,className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-oai-gray-900 px-4 text-xs font-medium text-white transition-colors hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100",children:a("settings.account.signIn")})]})})}function vt({name:e,github:n}){return t.jsxs(t.Fragment,{children:[t.jsx(ft,{name:e}),t.jsx(xt,{github:n})]})}function jt(){const e=ht();return e.enabled?e.signedIn?t.jsxs(S,{title:a("settings.section.account"),subtitle:e.email||e.name.customDisplayName||e.name.displayName,action:t.jsx(Nt,{onSignOut:e.signOut}),children:[t.jsx(kt,{userId:e.userId}),t.jsx(St,{settings:e}),t.jsx(wt,{checked:e.publicProfileOn,disabled:e.profileLoading||e.profileSaving,onChange:e.handlePublicProfileToggle}),t.jsx(Ct,{visible:e.publicProfileOn,name:e.name,github:e.github})]}):t.jsx(yt,{}):null}function kt({userId:e}){const[n,i]=C.useState(!1);if(!e)return null;const s=async()=>{try{if(typeof navigator>"u"||!navigator.clipboard?.writeText)return;await navigator.clipboard.writeText(e),i(!0),globalThis.setTimeout(()=>i(!1),1200)}catch{i(!1)}};return t.jsxs("div",{className:"flex items-center justify-between gap-4 py-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("div",{className:"text-sm text-oai-gray-900 dark:text-oai-gray-200",children:a("settings.account.userId")}),t.jsx("div",{className:"mt-0.5 truncate font-mono text-xs text-oai-gray-500 dark:text-oai-gray-400",children:e})]}),t.jsxs("button",{type:"button",onClick:s,className:"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800","aria-label":a("settings.account.copyUserId"),children:[n?t.jsx(Ie,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Re,{className:"h-3.5 w-3.5","aria-hidden":!0}),n?a("settings.account.copied"):a("settings.account.copy")]})]})}function Nt({onSignOut:e}){return t.jsxs("button",{type:"button",onClick:()=>e(),className:"inline-flex h-7 items-center gap-1.5 text-xs font-medium text-oai-gray-500 transition-colors hover:text-oai-gray-700 dark:hover:text-oai-gray-300",children:[t.jsx(ze,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.account.signOut")]})}function St({settings:e}){return e.showLocalCloudSync?t.jsx(x,{label:a("settings.account.cloudSync"),hint:a("settings.account.cloudSyncHint"),control:t.jsx(j,{checked:e.cloudSyncOn,onChange:e.handleCloudSyncToggle,ariaLabel:a("settings.account.cloudSync")})}):null}function wt({checked:e,disabled:n,onChange:i}){return t.jsx(x,{label:a("settings.account.publicProfile"),hint:a("settings.account.publicProfileHint"),control:t.jsx(j,{checked:e,onChange:i,disabled:n,ariaLabel:a("settings.account.publicProfile")})})}function Ct({visible:e,name:n,github:i}){return t.jsx(ge,{initial:!1,children:e?t.jsx(D.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{height:{duration:.28,ease:[.22,1,.36,1]},opacity:{duration:.2,ease:[.22,1,.36,1]}},style:{overflow:"hidden"},className:"divide-y divide-oai-gray-200/60 dark:divide-oai-gray-800/60",children:t.jsx(vt,{name:n,github:i})},"public-profile-fields"):null})}function Lt(){return[{value:"light",label:a("settings.appearance.theme.light"),Icon:pe},{value:"dark",label:a("settings.appearance.theme.dark"),Icon:me},{value:"system",label:a("settings.appearance.theme.system"),Icon:be}]}function Et(){return[{value:ye,label:a("settings.appearance.language.system")},{value:ve,label:a("settings.appearance.language.english")},{value:je,label:a("settings.appearance.language.chinese")},{value:ke,label:a("settings.appearance.language.traditional_chinese")},{value:Ne,label:a("settings.appearance.language.japanese")},{value:Se,label:a("settings.appearance.language.korean")},{value:we,label:a("settings.appearance.language.german")}]}function Gt(e){if(!e)return null;try{const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toLocaleString()}catch{return null}}function At(e,n){const i=a(`settings.appearance.currency.rate_source.${e}`),s=Gt(n),o=s?a("settings.appearance.currency.rate_updated",{when:s}):a("settings.appearance.currency.rate_never");return`${i} · ${o}`}function It({locale:e,setLocale:n}){const i=Et();return t.jsx(F,{value:e,onValueChange:n,options:i,ariaLabel:a("settings.appearance.language.label"),className:"px-2.5 py-1.5 text-xs font-medium",leadingIcon:t.jsx($e,{className:"h-3.5 w-3.5 text-oai-gray-500 dark:text-oai-gray-400","aria-hidden":!0})})}function Pt({currency:e,setCurrency:n}){const i=fe().map(s=>({value:s.code,label:a(s.labelKey)}));return t.jsx(F,{value:e,onValueChange:n,options:i,ariaLabel:a("settings.appearance.currency.label"),className:"px-3 py-1.5 text-xs font-medium"})}function _t({currency:e,rate:n,rateSource:i,rateFetchedAt:s}){if(e===xe)return t.jsx(t.Fragment,{children:a("settings.appearance.currency.hint")});const o=At(i,s);return t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[t.jsx("span",{children:`1 USD = ${n.toFixed(4)} ${e}`}),t.jsx("span",{role:"img","aria-label":o,title:o,className:"inline-flex h-4 w-4 cursor-help items-center justify-center text-oai-gray-400 hover:text-oai-gray-600 dark:text-oai-gray-500 dark:hover:text-oai-gray-300",children:t.jsx(_e,{className:"h-3.5 w-3.5","aria-hidden":!0})})]})}function Ot(){const{theme:e,setTheme:n}=he(),{locale:i,setLocale:s}=U(),{currency:o,rate:r,rateSource:l,rateFetchedAt:u,setCurrency:g}=Pe();return t.jsxs(S,{title:a("settings.section.appearance"),children:[t.jsx(x,{label:a("settings.appearance.theme.label"),hint:a("settings.appearance.theme.hint"),control:t.jsx(M,{options:Lt(),value:e,onChange:n})}),t.jsx(x,{label:a("settings.appearance.language.label"),hint:a("settings.appearance.language.hint"),control:t.jsx(It,{locale:i,setLocale:s})}),t.jsx(x,{label:a("settings.appearance.currency.label"),hint:t.jsx(_t,{currency:o,rate:r,rateSource:l,rateFetchedAt:u}),control:t.jsx(Pt,{currency:o,setCurrency:g})})]})}function Dt(){const{available:e,settings:n,setSetting:i,runAction:s}=R();if(!e)return null;const o=!!n?.launchAtLogin,r=n?.launchAtLoginSupported!==!1,l=n?.updateStatus||null,u=!!n?.updateBusy,g=!!n?.isSyncing;return t.jsxs(S,{title:a("settings.section.menubar"),children:[r?t.jsx(x,{label:a("settings.menubar.launchAtLogin"),hint:a("settings.menubar.launchAtLoginHint"),control:t.jsx(j,{checked:o,onChange:()=>i("launchAtLogin",!o),ariaLabel:a("settings.menubar.launchAtLogin")})}):null,t.jsx(x,{label:a("settings.menubar.syncNow"),hint:a("settings.menubar.syncNowHint"),control:t.jsxs("button",{type:"button",onClick:()=>s("syncNow"),disabled:g,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(Ce,{className:k("h-3.5 w-3.5",g&&"animate-spin"),"aria-hidden":!0}),g?a("settings.menubar.syncing"):a("settings.menubar.syncNow")]})}),t.jsx(x,{label:a("settings.menubar.updates"),hint:l||void 0,control:t.jsxs("button",{type:"button",onClick:()=>s("checkForUpdates"),disabled:u,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-oai-gray-200 px-3 text-xs font-medium text-oai-gray-700 transition-colors hover:bg-oai-gray-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-oai-gray-800 dark:text-oai-gray-300 dark:hover:bg-oai-gray-800",children:[t.jsx(De,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.menubar.checkUpdates")]})})]})}function Tt(e,n){function i(r){return r.replace(/^v/,"").split(".").map(Number)}const s=i(e),o=i(n);for(let r=0;r<Math.max(s.length,o.length);r++){const l=s[r]||0,u=o[r]||0;if(l<u)return!0;if(l>u)return!1}return!1}function Ut(){const{available:e,settings:n,runAction:i}=R(),s=e&&n?.version,[o,r]=C.useState(!1),[l,u]=C.useState({open:!1,latestVersion:"",htmlUrl:""}),{resolvedLocale:g}=U(),p="0.68.0",b=async()=>{r(!0);try{const h=await fetch("https://api.github.com/repos/mm7894215/TokenTracker/releases/latest");if(!h.ok)throw new Error("Failed to fetch");const v=await h.json(),w=v.tag_name;Tt(p,w)?u({open:!0,latestVersion:w,htmlUrl:v.html_url}):A({title:a("settings.menubar.updates.upToDate")})}catch(h){console.error("Check updates failed:",h),A({title:a("settings.menubar.updates.failed")})}finally{r(!1)}},f=a("settings.menubar.updates.modalTitle"),y=a("settings.menubar.updates.modalDescription",{version:l.latestVersion}),d=a("settings.menubar.updates.modalConfirm"),m=a("settings.menubar.updates.modalCancel");return t.jsxs("div",{className:"mt-6 flex flex-col items-center justify-center gap-4 text-xs text-oai-gray-500 dark:text-oai-gray-500",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[s?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a("settings.menubar.updates.footerCombined",{barVersion:n.version,coreVersion:p})}),t.jsx("span",{"aria-hidden":!0,children:"·"}),t.jsx("button",{type:"button",onClick:()=>i("openAbout"),className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:"GitHub"}),t.jsx("span",{"aria-hidden":!0,children:"·"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:a("settings.menubar.updates.footerCore",{version:p})}),t.jsx("span",{"aria-hidden":!0,children:"·"}),t.jsx("button",{type:"button",onClick:b,disabled:o,className:"underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300 disabled:opacity-50",children:o?a("settings.menubar.updates.checking"):a("settings.menubar.checkUpdates")}),t.jsx("span",{"aria-hidden":!0,children:"·"})]}),t.jsxs("a",{href:Le,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 underline-offset-2 transition-colors hover:text-oai-gray-700 hover:underline dark:hover:text-oai-gray-300",children:[t.jsx(Ue,{className:"h-3.5 w-3.5","aria-hidden":!0}),a("settings.footer.statusPage")]})]}),t.jsx(Oe,{open:l.open,title:f,description:y,confirmLabel:d,cancelLabel:m,onConfirm:()=>{window.open(l.htmlUrl,"_blank"),u(h=>({...h,open:!1}))},onCancel:()=>u(h=>({...h,open:!1}))})]})}function Mt({prefs:e}){return t.jsx(M,{options:[{value:_.USED,label:a("limits.settings.display_mode_used")},{value:_.REMAINING,label:a("limits.settings.display_mode_remaining")}],value:e.displayMode,onChange:e.setDisplayMode})}function Qt(){const e=Ee();return t.jsx("div",{className:"flex flex-1 flex-col font-oai text-oai-black antialiased dark:text-oai-white",children:t.jsx("main",{className:"flex-1 pb-12 pt-8 sm:pb-16 sm:pt-10",children:t.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-oai-black dark:text-white sm:text-4xl",children:a("settings.page.title")}),t.jsx("p",{className:"mt-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:a("settings.page.subtitle")})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(Ot,{}),t.jsx(Dt,{}),t.jsx(jt,{}),t.jsx(S,{title:a("settings.section.limits"),action:t.jsx(Mt,{prefs:e}),children:t.jsx(et,{prefs:e})})]}),t.jsx(Ut,{})]})})})}export{Qt as SettingsPage};