@ipv9/tokentracker-cli 0.39.0 → 0.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -139
- package/dashboard/dist/assets/{ActivityHeatmap-BxBGHY1z.js → ActivityHeatmap-DMiLcNdW.js} +1 -1
- package/dashboard/dist/assets/{Card-GROxUc_6.js → Card-BYF4fWvv.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-JTMHUROG.js +19 -0
- package/dashboard/dist/assets/{DevicePage-CQts7ivB.js → DevicePage-DJ-H8_Oz.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-DqFsk26U.js → DialogTitle-BXPsx9HW.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-HBBXW_3q.js → FadeIn-DDGzwGrv.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-COD2HfaF.js → HeaderGithubStar-dbSUVZih.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-Cn0l8-BQ.js → IpCheckPage-DIvpHrqI.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-CmV1BMU4.js → LandingPage-BoNG4hkr.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-CiIpWZwb.js → LeaderboardAvatar-DRBoSOut.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-BU0mlR3g.js → LeaderboardPage-DAr4EXrF.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-C49_3Xm9.js → LeaderboardProfileModal-DX4KnQBi.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-Bh1n0BAM.js → LeaderboardProfilePage-DU7kjPuZ.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-fZAmwLWT.js → LimitsPage-2nakPy0e.js} +2 -2
- package/dashboard/dist/assets/{LocalOnlyNotice-D3rQdA-P.js → LocalOnlyNotice-BKzBNE-a.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-enO4XP-c.js → LoginPage-FSNMPJhA.js} +1 -1
- package/dashboard/dist/assets/PopoverPopup-BCQmdc9t.js +1 -0
- package/dashboard/dist/assets/{Select-tT9x4ntD.js → Select-CGpkLtRU.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-C7F7eIm0.js → SelectItemText-CN5ejq4k.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-pDasZNU2.js → SettingsPage-244I2HMy.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-DEu7FY-2.js → SkillsPage-VtbiObMq.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-DGcO7rbp.js → WidgetsPage-CWpeeZUH.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-D_1ID213.js → WrappedPage-Cr94-EYR.js} +1 -1
- package/dashboard/dist/assets/{agent-logos-DXQVg1xy.js → agent-logos-BlOvCoRm.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DNLo92Ba.js → arrow-up-right-DYB5rzeo.js} +1 -1
- package/dashboard/dist/assets/{download-DbBBBpJF.js → download-BIqrLJf0.js} +1 -1
- package/dashboard/dist/assets/{info-Bh5qTz6k.js → info-DoWx4rUB.js} +1 -1
- package/dashboard/dist/assets/{main-BIY3Nj6I.js → main-BN2u8ODm.js} +12 -10
- package/dashboard/dist/assets/{use-limits-display-prefs-B4iJ-bBc.js → use-limits-display-prefs-DY7luKuV.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-DHjPFDv8.js → use-native-settings-BEniEaPB.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-odqe9OY7.js → use-usage-limits-BJ-7YuWn.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BsSZiZMP.js → useCurrency-CrsGLZiC.js} +1 -1
- package/dashboard/dist/assets/{useOpenInteractionType-BQhgq4rv.js → useOpenInteractionType-BqOY0u5X.js} +2 -2
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +15 -7
- package/scripts/install-local-service.sh +2 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DashboardPage-BZ5VFoBk.js +0 -19
- package/dashboard/dist/assets/PopoverPopup-pitJEpN1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e,
|
|
1
|
+
import{r as d,j as e,N as j,S as w,T as N,L as k,az as L,A as s,aa as I}from"./main-BN2u8ODm.js";import{u as T}from"./useCurrency-CrsGLZiC.js";import{H as M}from"./HeaderGithubStar-dbSUVZih.js";import{useLeaderboardProfileData as C,ProfileSkeleton as _,ProfileContent as E}from"./LeaderboardProfileModal-DX4KnQBi.js";import"./LeaderboardAvatar-DRBoSOut.js";import"./ActivityHeatmap-DMiLcNdW.js";import"./info-DoWx4rUB.js";import"./arrow-up-right-DYB5rzeo.js";import"./useOpenInteractionType-BqOY0u5X.js";import"./DialogTitle-BXPsx9HW.js";const l=18;function y(){return e.jsxs("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2"}),e.jsx("path",{d:"M12 20v2"}),e.jsx("path",{d:"m4.93 4.93 1.41 1.41"}),e.jsx("path",{d:"m17.66 17.66 1.41 1.41"}),e.jsx("path",{d:"M2 12h2"}),e.jsx("path",{d:"M20 12h2"}),e.jsx("path",{d:"m6.34 17.66-1.41 1.41"}),e.jsx("path",{d:"m19.07 4.93-1.41 1.41"})]})}function v(){return e.jsx("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function S(){return e.jsxs("svg",{"aria-hidden":!0,width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),e.jsx("path",{d:"M8 21h8"}),e.jsx("path",{d:"M12 17v4"})]})}const P=[{value:"light",label:"Light",Icon:y},{value:"dark",label:"Dark",Icon:v},{value:"system",label:"System",Icon:S}];function z(a){return a==="dark"?v:y}function A({theme:a,resolvedTheme:h,onSetTheme:g,className:m="",direction:u="down",align:p="right"}){const[o,x]=d.useState(!1),c=d.useRef(null),n=d.useCallback(()=>x(!1),[]);d.useEffect(()=>{if(!o)return;const r=i=>{c.current&&!c.current.contains(i.target)&&n()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[o,n]),d.useEffect(()=>{if(!o)return;const r=i=>{i.key==="Escape"&&n()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[o,n]);const b=z(h);return e.jsxs("div",{ref:c,className:`relative ${m}`,children:[e.jsx("button",{type:"button","aria-label":"Theme","aria-expanded":o,onClick:()=>x(r=>!r),className:"flex items-center justify-center w-9 h-9 rounded-lg text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors",children:e.jsx(b,{})}),o&&e.jsx("div",{className:`absolute z-50 min-w-[140px] py-1 rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 shadow-lg ${u==="up"?"bottom-full mb-1":"top-full mt-1"} ${p==="left"?"left-0":"right-0"}`,children:P.map(({value:r,label:i,Icon:f})=>{const t=a===r;return e.jsxs("button",{type:"button",onClick:()=>{g(r),n()},className:`flex w-full items-center gap-2.5 px-3 py-2 text-sm transition-colors ${t?"text-oai-black dark:text-white bg-oai-gray-100 dark:bg-oai-gray-800":"text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-50 dark:hover:bg-oai-gray-800/60 hover:text-oai-black dark:hover:text-white"}`,children:[e.jsx(f,{}),e.jsx("span",{children:i})]},r)})})]})}function q({auth:a,signedIn:h,sessionSoftExpired:g,userId:m}){const{currency:u,rate:p}=T(),{theme:o,resolvedTheme:x,setTheme:c}=j(),{openLoginModal:n}=w(),{signedIn:b,loading:r}=N(),i=h&&!g,f=d.useMemo(()=>i&&(typeof a=="function"||typeof a=="string"||a&&typeof a=="object")?a:null,[a,i]),t=C({userId:m,period:"total",accessToken:f});return e.jsxs("div",{className:"flex flex-col min-h-screen bg-oai-gray-50 dark:bg-oai-gray-950 text-oai-black dark:text-oai-white font-oai antialiased transition-colors duration-200",children:[e.jsx("header",{className:"sticky top-0 z-50 w-full px-4 pt-4 pb-2 transition-all duration-300 pointer-events-none",children:e.jsxs("div",{className:"mx-auto max-w-3xl rounded-2xl border border-oai-gray-200/50 dark:border-white/10 bg-white/75 dark:bg-oai-gray-950/60 backdrop-blur-xl shadow-[0_8px_30px_rgb(0,0,0,0.04)] dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] flex h-14 items-center justify-between px-3 sm:px-4 pointer-events-auto transition-all duration-300",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(k,{to:"/",className:"flex items-center gap-3 no-underline outline-none rounded-md focus-visible:ring-2 focus-visible:ring-indigo-500 transition-opacity hover:opacity-80 active:scale-95",children:[e.jsx("img",{src:"/app-icon.png",alt:"",width:24,height:24,className:"rounded-md"}),e.jsx("span",{className:"text-sm font-semibold tracking-wide text-oai-black dark:text-white uppercase",children:"Token Tracker"})]}),e.jsx("div",{className:"hidden sm:block scale-90 origin-left opacity-90 hover:opacity-100 transition-opacity",children:e.jsx(M,{})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsxs(k,{to:"/leaderboard",className:"group no-underline inline-flex items-center gap-1.5 h-8 px-3 text-xs font-bold rounded-lg border border-oai-gray-200 dark:border-white/10 bg-transparent text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-white/5 hover:text-oai-black dark:hover:text-white transition-all duration-200 active:scale-95 shadow-sm",children:[e.jsx(L,{size:13,strokeWidth:2.5,"aria-hidden":!0,className:"transition-transform duration-150 ease-out group-hover:scale-110 group-hover:rotate-6"}),e.jsx("span",{children:s("leaderboard.profile.nav.back")})]}),r?e.jsx("div",{className:"h-8 w-16 animate-pulse rounded-lg bg-oai-gray-200 dark:bg-white/10","aria-hidden":!0}):b?e.jsx(I,{}):e.jsx("button",{type:"button",onClick:n,className:"inline-flex h-8 min-w-[76px] items-center justify-center rounded-lg bg-oai-gray-900 dark:bg-white text-white dark:text-oai-gray-950 hover:bg-oai-gray-800 dark:hover:bg-oai-gray-100 transition-all duration-200 active:scale-[0.98] select-none text-xs font-bold shadow-sm",children:s("header.auth.sign_in_aria")})]})]})}),e.jsx("main",{className:"flex-1 pt-4 pb-10 sm:pt-6 sm:pb-16",children:e.jsx("div",{className:"mx-auto max-w-2xl px-4 sm:px-6",children:e.jsxs("div",{className:"rounded-2xl bg-white dark:bg-oai-gray-950 ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 overflow-hidden shadow-sm dark:shadow-none",children:[t.loading&&e.jsx(_,{variant:"page"}),!t.loading&&t.error&&e.jsx("div",{className:"px-6 py-16 text-center",children:e.jsx("p",{className:"text-sm text-red-500 dark:text-red-400",children:s("leaderboard.profile_modal.error")})}),!t.loading&&!t.error&&!t.data&&e.jsx("div",{className:"px-6 py-16 text-center",children:e.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400",children:s("leaderboard.profile_modal.empty")})}),!t.loading&&!t.error&&t.data&&e.jsx(E,{data:t.data,currency:u,rate:p,variant:"page"})]})})}),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-2xl 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.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(A,{theme:o,resolvedTheme:x,onSetTheme:c,direction:"up",align:"right"}),e.jsx(k,{to:"/leaderboard",className:"text-oai-gray-400 dark:text-oai-gray-500 hover:text-oai-black dark:hover:text-white transition-colors",children:s("leaderboard.profile.nav.back")})]})]})})]})}export{q as LeaderboardProfilePage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as i,
|
|
2
|
-
`),d=async()=>{try{await navigator.clipboard.writeText(o),r(!0),setTimeout(()=>r(!1),1600)}catch{}};return i.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[i.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:s("limits.copilot.otelHint.title")}),i.jsx("div",{className:"mt-0.5 leading-snug",children:s("limits.copilot.otelHint.body")}),i.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:o}),i.jsx("button",{type:"button",onClick:d,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?s("limits.copilot.otelHint.copied"):s("limits.copilot.otelHint.copy")})]})}function Y({claude:n,codex:e,cursor:r,gemini:t,kimi:o,kiro:d,antigravity:p,copilot:y,order:w,visibility:h,displayMode:v}){const k={claude:n,codex:e,cursor:r,gemini:t,kimi:o,kiro:d,antigravity:p,copilot:y},N=Array.isArray(w)&&w.length>0?w:
|
|
1
|
+
import{j as i,O as f,A as s,r as E,aB as I,i as P,L as C,aC as O}from"./main-BN2u8ODm.js";import{u as R}from"./use-usage-limits-BJ-7YuWn.js";import{L as u,u as M}from"./use-limits-display-prefs-DY7luKuV.js";import{C as j}from"./Card-BYF4fWvv.js";import{F as T}from"./FadeIn-DDGzwGrv.js";import{L as S}from"./LocalOnlyNotice-BKzBNE-a.js";import"./arrow-up-right-DYB5rzeo.js";import"./download-BIqrLJf0.js";const A=[3,2,3,3,2,2,3];function x({className:n}){return i.jsx("div",{className:f("rounded bg-oai-gray-200/70 dark:bg-oai-gray-800/70 animate-pulse",n)})}function D(){return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(x,{className:"h-3 w-12 shrink-0"}),i.jsx(x,{className:"flex-1 h-1.5 rounded-full min-w-0"}),i.jsx(x,{className:"h-3 w-[30px] shrink-0"}),i.jsx(x,{className:"h-3 w-6 shrink-0"})]})}function $({bars:n,index:e}){const r=e%3===0?"w-24":e%3===1?"w-20":"w-[4.5rem]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(x,{className:"h-[14px] w-[14px] rounded shrink-0"}),i.jsx(x,{className:f("h-4",r)})]}),Array.from({length:n},(t,o)=>i.jsx(D,{},o))]})}function G(){return i.jsx(j,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx(x,{className:"h-3.5 w-28"}),A.map((n,e)=>i.jsx($,{bars:n,index:e},e))]})})}function l(n){if(!n)return null;const e=typeof n=="number"?n*1e3:Date.parse(n);if(!Number.isFinite(e))return null;const r=e-Date.now();if(r<=0)return s("shared.time.now");const t=Math.floor(r/6e4);if(t<60)return`${t}m`;const o=Math.floor(t/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function H(n,e){const r=e===u.REMAINING?100-n:n;return r>=90?"bg-red-500":r>=70?"bg-amber-500":"bg-emerald-500"}function a({label:n,pct:e,reset:r,mode:t=u.USED}){const o=Math.max(0,Math.min(100,Number(e)||0)),d=t===u.REMAINING?100-o:o,p=Math.round(d),y=d>0&&p===0?Math.max(d,.35):d,w=d>0&&p===0?"<1":String(p);return i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[11px] text-oai-gray-500 dark:text-oai-gray-400 w-12 shrink-0",children:n}),i.jsx("div",{className:"flex-1 bg-oai-gray-100 dark:bg-oai-gray-700/50 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:`${H(d,t)} rounded-full h-full transition-[width] duration-500 ease-out`,style:{width:`${y}%`,minWidth:d>0?"3px":0}})}),i.jsxs("span",{className:"text-[11px] tabular-nums text-oai-gray-500 dark:text-oai-gray-400 w-9 text-right shrink-0 whitespace-nowrap",children:[w,"%"]}),r?i.jsx("span",{className:"text-[10px] text-oai-gray-400 dark:text-oai-gray-500 w-6 text-right shrink-0",children:r}):null]})}function m({name:n,icon:e,children:r}){const o=e==="/brand-logos/cursor.svg"||e==="/brand-logos/kiro.svg"||e==="/brand-logos/copilot.svg"||e==="/brand-logos/kimi.svg"?"w-[14px] h-[14px] dark:invert":"w-[14px] h-[14px]";return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[e?i.jsx("img",{src:e,alt:"",className:o}):null,i.jsx("span",{className:"text-sm font-medium text-oai-black dark:text-oai-white",children:n})]}),r]})}const B=["claude","codex","cursor","gemini","kimi","kiro","copilot","antigravity"],F={claude:{name:"Claude",icon:"/brand-logos/claude-code.svg"},codex:{name:"Codex",icon:"/brand-logos/codex.svg"},cursor:{name:"Cursor",icon:"/brand-logos/cursor.svg"},gemini:{name:"Gemini",icon:"/brand-logos/gemini.svg"},kimi:{name:"Kimi",icon:"/brand-logos/kimi.svg"},kiro:{name:"Kiro",icon:"/brand-logos/kiro.svg"},copilot:{name:"GitHub Copilot",icon:"/brand-logos/copilot.svg"},antigravity:{name:"Antigravity",icon:"/brand-logos/antigravity.svg"}};function c({children:n,tone:e="neutral"}){const r=e==="error"?"text-red-600 dark:text-red-400":"text-oai-gray-500 dark:text-oai-gray-400";return i.jsx("div",{className:`text-[11px] leading-snug ${r}`,children:n})}function U(n,e,r){const t=F[n];if(!t)return null;if(!e?.configured)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{children:s("limits.status.not_connected")})},n);if(e.error)return i.jsx(m,{name:t.name,icon:t.icon,children:i.jsx(c,{tone:"error",children:s("shared.error.prefix",{error:e.error})})},n);const o=e.plan_label?`${t.name} ${e.plan_label}`:t.name;switch(n){case"claude":return i.jsxs(m,{name:o,icon:t.icon,children:[e.five_hour?i.jsx(a,{label:"5h",pct:e.five_hour.utilization,reset:l(e.five_hour.resets_at),mode:r}):null,e.seven_day?i.jsx(a,{label:"7d",pct:e.seven_day.utilization,reset:l(e.seven_day.resets_at),mode:r}):null,e.seven_day_opus?i.jsx(a,{label:"Opus",pct:e.seven_day_opus.utilization,reset:l(e.seven_day_opus.resets_at),mode:r}):null,!e.five_hour&&!e.seven_day&&!e.seven_day_opus?i.jsx(c,{children:s("limits.status.no_data")}):null]},"claude");case"codex":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"5h",pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"7d",pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"codex");case"cursor":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.cursor_plan"),pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.cursor_auto"),pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.cursor_api"),pct:e.tertiary_window.used_percent,reset:l(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"cursor");case"gemini":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Pro",pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"Flash",pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Lite",pct:e.tertiary_window.used_percent,reset:l(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"gemini");case"kimi":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kimi_weekly"),pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kimi_5h"),pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:s("limits.label.kimi_total"),pct:e.tertiary_window.used_percent,reset:l(e.tertiary_window.reset_at),mode:r}):null,e.parallel_limit?i.jsx(c,{children:s("limits.label.kimi_parallel",{count:e.parallel_limit})}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kimi");case"kiro":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.kiro_month"),pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.kiro_bonus"),pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"kiro");case"antigravity":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:"Claude",pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:"G Pro",pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,e.tertiary_window?i.jsx(a,{label:"Flash",pct:e.tertiary_window.used_percent,reset:l(e.tertiary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window&&!e.tertiary_window?i.jsx(c,{children:s("limits.status.no_data")}):null]},"antigravity");case"copilot":return i.jsxs(m,{name:o,icon:t.icon,children:[e.primary_window?i.jsx(a,{label:s("limits.label.copilot_premium"),pct:e.primary_window.used_percent,reset:l(e.primary_window.reset_at),mode:r}):null,e.secondary_window?i.jsx(a,{label:s("limits.label.copilot_chat"),pct:e.secondary_window.used_percent,reset:l(e.secondary_window.reset_at),mode:r}):null,!e.primary_window&&!e.secondary_window?i.jsx(c,{children:s("limits.status.no_data")}):null,e.otel_has_files||e.otel_enabled?null:i.jsx(z,{defaultDir:e.otel_default_dir})]},"copilot");default:return null}}function z({defaultDir:n}){const[e,r]=E.useState(!1),o=["export COPILOT_OTEL_ENABLED=true","export COPILOT_OTEL_EXPORTER_TYPE=file",`export COPILOT_OTEL_FILE_EXPORTER_PATH="${n||"$HOME/.copilot/otel"}/copilot-otel-$(date +%Y%m%d).jsonl"`].join(`
|
|
2
|
+
`),d=async()=>{try{await navigator.clipboard.writeText(o),r(!0),setTimeout(()=>r(!1),1600)}catch{}};return i.jsxs("div",{className:"mt-1 rounded-md border border-amber-300/60 dark:border-amber-700/40 bg-amber-50/50 dark:bg-amber-900/10 px-2.5 py-2 text-[11px] text-oai-gray-600 dark:text-oai-gray-300",children:[i.jsx("div",{className:"font-medium text-oai-gray-700 dark:text-oai-gray-200",children:s("limits.copilot.otelHint.title")}),i.jsx("div",{className:"mt-0.5 leading-snug",children:s("limits.copilot.otelHint.body")}),i.jsx("pre",{className:"mt-1.5 overflow-x-auto rounded bg-oai-gray-100 dark:bg-oai-gray-900/60 px-2 py-1.5 font-mono text-[10.5px] leading-tight whitespace-pre",children:o}),i.jsx("button",{type:"button",onClick:d,className:"mt-1 inline-flex items-center gap-1 rounded border border-oai-gray-300 dark:border-oai-gray-700 px-1.5 py-0.5 text-[10.5px] text-oai-gray-700 dark:text-oai-gray-200 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 transition-colors",children:e?s("limits.copilot.otelHint.copied"):s("limits.copilot.otelHint.copy")})]})}function Y({claude:n,codex:e,cursor:r,gemini:t,kimi:o,kiro:d,antigravity:p,copilot:y,order:w,visibility:h,displayMode:v}){const k={claude:n,codex:e,cursor:r,gemini:t,kimi:o,kiro:d,antigravity:p,copilot:y},N=Array.isArray(w)&&w.length>0?w:B,g=v===u.REMAINING?u.REMAINING:u.USED,L=g===u.REMAINING?s("limits.settings.display_mode_remaining"):s("limits.settings.display_mode_used"),b=N.filter(_=>!h||h[_]!==!1).map(_=>U(_,k[_],g)).filter(Boolean);return i.jsx(T,{delay:.15,children:i.jsx(j,{children:i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide",children:[s("limits.panel.title"),s("limits.panel.mode_separator"),L]}),b.length>0?b:i.jsx(c,{children:s("limits.status.all_hidden")})]})})})}const K=typeof window<"u"&&(window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1");function ie(){const n=I(),{data:e,error:r,isLoading:t}=R(n?{initialRefresh:!0,initialState:n,publishToPreloadCache:!0}:{initialRefresh:!0,publishToPreloadCache:!0}),o=M();return!K&&!P()?i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx(S,{})}):i.jsx("div",{className:"flex flex-col flex-1 text-oai-black dark:text-oai-white font-oai antialiased",children:i.jsx("main",{className:"flex-1 pt-8 sm:pt-10 pb-12 sm:pb-16",children:i.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[i.jsxs("div",{className:"flex flex-row items-start justify-between gap-4 mb-8",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("h1",{className:"text-3xl sm:text-4xl font-semibold tracking-tight text-oai-black dark:text-white mb-3",children:s("nav.limits")}),i.jsx("p",{className:"text-oai-gray-500 dark:text-oai-gray-400 text-sm sm:text-base",children:s("limits.page.subtitle")})]}),i.jsx(C,{to:"/settings","aria-label":s("limits.page.openSettings"),title:s("limits.page.openSettings"),className:"shrink-0 inline-flex h-9 w-9 items-center justify-center rounded-lg border border-oai-gray-200 dark:border-oai-gray-800 text-oai-gray-600 dark:text-oai-gray-400 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-800 hover:text-oai-black dark:hover:text-white transition-colors no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand-500",children:i.jsx(O,{className:"h-4 w-4","aria-hidden":!0})})]}),t?i.jsx(G,{}):i.jsxs(i.Fragment,{children:[r?i.jsx("p",{className:"mb-4 text-sm text-red-500 dark:text-red-400",children:s("shared.error.prefix",{error:r})}):null,i.jsx(Y,{claude:e?.claude,codex:e?.codex,cursor:e?.cursor,gemini:e?.gemini,kimi:e?.kimi,kiro:e?.kiro,antigravity:e?.antigravity,copilot:e?.copilot,order:o.order,visibility:o.visibility,displayMode:o.displayMode})]})]})})})}export{ie as LimitsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,A as t}from"./main-
|
|
1
|
+
import{j as e,A as t}from"./main-BN2u8ODm.js";import{A as r}from"./arrow-up-right-DYB5rzeo.js";import{D as o}from"./download-BIqrLJf0.js";const i="https://github.com/mm7894215/TokenTracker/releases/latest";function c(){const a=()=>{try{window.location.href="tokentracker://open"}catch{}};return e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center px-6 py-20 text-center",children:e.jsxs("div",{className:"max-w-md",children:[e.jsx("h2",{className:"text-lg font-semibold text-oai-black dark:text-white",children:t("local_only.title")}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-oai-gray-500 dark:text-oai-gray-400",children:t("local_only.body")}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[e.jsxs("button",{type:"button",onClick:a,className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium bg-oai-gray-900 text-white hover:bg-oai-gray-800 dark:bg-white dark:text-oai-gray-900 dark:hover:bg-oai-gray-100 transition-colors",children:[e.jsx("span",{children:t("local_only.open_app")}),e.jsx(r,{size:14,strokeWidth:2,"aria-hidden":!0})]}),e.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex h-9 items-center gap-1.5 rounded-full px-4 text-sm font-medium ring-1 ring-oai-gray-200 dark:ring-oai-gray-800 text-oai-gray-700 dark:text-oai-gray-300 hover:bg-oai-gray-100 dark:hover:bg-oai-gray-900 transition-colors",children:[e.jsx(o,{size:14,strokeWidth:2,"aria-hidden":!0}),e.jsx("span",{children:t("local_only.download")})]})]})]})})}export{c as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ao as Y,aE as Z,T as ee,r,A as s,j as e,L as G,O as v}from"./main-BN2u8ODm.js";function te(n){const a=new URLSearchParams(n).get("next");return typeof a!="string"||a.length===0||!a.startsWith("/")||a.startsWith("//")?"/dashboard":a}const V={google:"Google",github:"GitHub",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",facebook:"Facebook",instagram:"Instagram",tiktok:"TikTok",apple:"Apple",x:"X",spotify:"Spotify"};function $(n){const a=String(n||"").trim();return V[a]?V[a]:a.replace(/-/g," ")}function ie(){const n=Y(),[a,A]=Z(),{enabled:o,loading:g,signedIn:f,refreshUser:C,signInWithPassword:E,signUp:M,signInWithOAuth:I,getPublicAuthConfig:O}=ee(),m=r.useMemo(()=>te(a.toString()),[a]),[l,j]=r.useState("signin"),[x,H]=r.useState(""),[h,Q]=r.useState(""),[N,X]=r.useState(""),[k,p]=r.useState(!1),[F,c]=r.useState(null),[T,b]=r.useState(null),[S,U]=r.useState(!0),[_,B]=r.useState([]),[P,R]=r.useState([]),[W,z]=r.useState(8);r.useEffect(()=>{const t=a.get("insforge_status"),i=a.get("insforge_type"),u=a.get("insforge_error");t==="success"&&i==="verify_email"?b(s("login.verify_email_success")):t==="error"&&i==="verify_email"&&u&&b(s("shared.error.prefix",{error:u}))},[a]),r.useEffect(()=>{if(!o){U(!1);return}let t=!0;return(async()=>{const{data:i,error:u}=await O();t&&(u||!i?(B(["google","github"]),R([])):(B(Array.isArray(i.oAuthProviders)?i.oAuthProviders:[]),R(Array.isArray(i.customOAuthProviders)?i.customOAuthProviders:[]),typeof i.passwordMinLength=="number"&&i.passwordMinLength>0&&z(i.passwordMinLength)),U(!1))})(),()=>{t=!1}},[o,O]);const d=r.useMemo(()=>a.get("native")==="1",[a]),y=r.useMemo(()=>a.get("provider")||null,[a]);r.useEffect(()=>{if(!(!o||g)&&f){if(d){window.location.href="/auth/native-callback";return}n(m,{replace:!0})}},[o,g,f,n,m,d]),r.useEffect(()=>{o&&C()},[o,C]);const q=r.useMemo(()=>typeof window>"u"||d?"":`${window.location.origin}/`,[d]),D=r.useMemo(()=>typeof window>"u"?"":`${window.location.origin}/`,[]),J=r.useCallback(async t=>{t.preventDefault(),c(null),p(!0);try{if(l==="signup"){const{data:u,error:L}=await M({email:x.trim(),password:h,name:N.trim()||void 0,redirectTo:D});if(L){c(L.message||String(L));return}if(u?.requireEmailVerification){b(s("login.verify_email_pending")),j("signin");return}n(m,{replace:!0});return}const{error:i}=await E({email:x.trim(),password:h});if(i){c(i.message||String(i));return}n(m,{replace:!0})}finally{p(!1)}},[l,x,h,N,M,E,n,m,D]),w=r.useCallback(async t=>{c(null),p(!0);try{const{error:i}=await I(t,q);i&&c(i.message||String(i))}finally{p(!1)}},[I,q]);r.useEffect(()=>{if(d&&typeof window<"u")try{window.sessionStorage.setItem("tokentracker_native_login","1")}catch{}},[d]),r.useEffect(()=>{if(!o||g||f||S||!d||!y)return;[..._,...P].includes(y)&&w(y)},[o,g,f,S,d,y,_,P,w]);const K=r.useCallback(()=>{A(t=>{const i=new URLSearchParams(t);return i.delete("insforge_status"),i.delete("insforge_type"),i.delete("insforge_error"),i},{replace:!0}),b(null)},[A]);return o?e.jsxs("div",{className:"min-h-screen bg-oai-gray-950 text-oai-white font-oai antialiased dark flex flex-col",children:[e.jsx("header",{className:"border-b border-oai-gray-900 px-4 sm:px-6 h-16 flex items-center justify-between",children:e.jsx(G,{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-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold text-white tracking-tight",children:s("login.title")}),e.jsx("p",{className:"mt-2 text-sm text-oai-gray-500",children:s("login.subtitle")})]}),T?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:T}),e.jsx("button",{type:"button",onClick:K,className:"shrink-0 text-oai-gray-500 hover:text-white text-xs",children:s("login.dismiss")})]}):null,F?e.jsx("p",{className:"text-sm text-red-400",role:"alert",children:s("shared.error.prefix",{error:F})}):null,e.jsx("div",{className:"space-y-3",children:S?e.jsx("div",{className:"h-11 rounded-lg bg-oai-gray-900 animate-pulse","aria-hidden":!0}):e.jsxs(e.Fragment,{children:[_.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t)),P.map(t=>e.jsx("button",{type:"button",disabled:k,onClick:()=>w(t),className:v("w-full h-11 rounded-lg border border-oai-gray-700 bg-oai-gray-900 text-sm font-medium text-white","hover:bg-oai-gray-800 transition-colors disabled:opacity-50"),children:s("login.oauth.continue",{provider:$(t)})},t))]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center","aria-hidden":!0,children:e.jsx("span",{className:"w-full border-t border-oai-gray-800"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase tracking-wider",children:e.jsx("span",{className:"bg-oai-gray-950 px-3 text-oai-gray-600",children:s("login.divider")})})]}),e.jsxs("div",{className:"flex rounded-lg border border-oai-gray-800 p-0.5 bg-oai-gray-900/50",children:[e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signin"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signin"),c(null)},children:s("login.tab.sign_in")}),e.jsx("button",{type:"button",className:v("flex-1 py-2 text-sm font-medium rounded-md transition-colors",l==="signup"?"bg-oai-gray-800 text-white":"text-oai-gray-500 hover:text-oai-gray-300"),onClick:()=>{j("signup"),c(null)},children:s("login.tab.sign_up")})]}),e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[l==="signup"?e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-name",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.name")}),e.jsx("input",{id:"login-name",type:"text",autoComplete:"name",value:N,onChange:t=>X(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500",placeholder:s("login.field.name_placeholder")})]}):null,e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-email",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.email")}),e.jsx("input",{id:"login-email",type:"email",autoComplete:"email",required:!0,value:x,onChange:t=>H(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"login-password",className:"block text-xs font-medium text-oai-gray-500 mb-1",children:s("login.field.password")}),e.jsx("input",{id:"login-password",type:"password",autoComplete:l==="signup"?"new-password":"current-password",required:!0,minLength:l==="signup"?W:void 0,value:h,onChange:t=>Q(t.target.value),className:"w-full h-11 rounded-lg border border-oai-gray-800 bg-oai-gray-900 px-3 text-sm text-white placeholder-oai-gray-600 focus:outline-none focus:ring-2 focus:ring-oai-brand-500"}),l==="signup"?e.jsx("p",{className:"mt-1 text-xs text-oai-gray-600",children:s("login.password_hint",{min:String(W)})}):null]}),e.jsx("button",{type:"submit",disabled:k||g,className:"w-full h-11 rounded-lg bg-white text-oai-gray-950 text-sm font-semibold hover:bg-oai-gray-100 transition-colors disabled:opacity-50",children:l==="signup"?s("login.submit.sign_up"):s("login.submit.sign_in")})]})]})})]}):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(G,{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{ie as LoginPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as ke,r,bp as me,bq as Fe,br as we,aZ as z,b as W,bs as X,bt as te,bu as ve,a_ as ae,bv as de,bw as Z,am as ne,bx as Re,aY as re,by as ue,bz as Le,bA as Ae,bB as le,bC as He,bD as je,j as V,bE as Be,u as De,a as pe,bF as Ne,bG as he,bH as _e,bI as Ye,bJ as Ge,bK as Ve,bL as Ke,bM as Ue,bN as Xe,bO as qe,b6 as We,bP as ze,b7 as $e}from"./main-BN2u8ODm.js";import{i as oe,c as Te,d as Ce,e as se,g as Je,R as Ze,P as Qe,f as q,F as et,h as tt,j as nt,k as ot,l as Pe,u as rt,p as st,t as it,m as ct,I as at,n as ut,o as Se,q as lt,r as ft}from"./useOpenInteractionType-BqOY0u5X.js";import{p as dt,f as pt,g as gt,h as mt,i as ht,j as Et,k as bt}from"./DialogTitle-BXPsx9HW.js";import{p as vt,q as Rt,r as Oe,t as Tt,v as Ct}from"./SelectItemText-CN5ejq4k.js";const Pt=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Vt=ke("loader-circle",Pt);function ie(o,e,t){if(t&&!oe(t))return 0;if(typeof o=="number")return o;if(typeof o=="function"){const l=o();return typeof l=="number"?l:l?.[e]}return o?.[e]}const fe=Fe("safe-polygon"),St=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${we}`;function Ot(o){return o?!!o.closest(St):!1}function ye(o){const e=r.useRef(void 0),t=r.useRef(!1),l=r.useRef(void 0),E=r.useRef(!0),g=r.useRef(!1),v=r.useRef(()=>{}),k=r.useRef(!1),s=me(),P=me(),i=r.useRef(void 0);return r.useMemo(()=>{const a=o.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:t,handlerRef:l,blockMouseMoveRef:E,performedPointerEventsMutationRef:g,unbindMouseMoveRef:v,restTimeoutPendingRef:k,openChangeTimeout:s,restTimeout:P,handleCloseOptionsRef:i}),a.hoverInteractionState},[o,e,t,l,E,g,v,k,s,P,i])}const yt=new Set(["click","mousedown"]);function It(o,e={}){const t="rootStore"in o?o.rootStore:o,l=t.useState("open"),E=t.useState("floatingElement"),g=t.useState("domReferenceElement"),{dataRef:v}=t.context,{enabled:k=!0,closeDelay:s=0,externalTree:P}=e,{pointerTypeRef:i,interactedInsideRef:a,handlerRef:L,performedPointerEventsMutationRef:H,unbindMouseMoveRef:F,restTimeoutPendingRef:u,openChangeTimeout:I,handleCloseOptionsRef:D}=ye(t),f=Te(P),B=Ce(),M=z(()=>a.current?!0:v.current.openEvent?yt.has(v.current.openEvent.type):!1),x=z(()=>{const m=v.current.openEvent?.type;return m?.includes("mouse")&&m!=="mousedown"}),O=r.useCallback((m,w=!0)=>{const c=Mt(s,i.current);c&&!L.current?I.start(c,()=>t.setOpen(!1,W(X,m))):w&&(I.clear(),t.setOpen(!1,W(X,m)))},[s,L,t,i,I]),T=z(()=>{F.current(),L.current=void 0}),_=z(()=>{if(H.current){const m=te(E).body;m.style.pointerEvents="",m.removeAttribute(fe),H.current=!1}}),N=z(m=>{const w=ve(m);if(!Ot(w)){a.current=!1;return}a.current=!0});ae(()=>{l||(i.current=void 0,u.current=!1,a.current=!1,T(),_())},[l,i,u,a,T,_]),r.useEffect(()=>()=>{T()},[T]),r.useEffect(()=>_,[_]),ae(()=>{if(k&&l&&D.current?.blockPointerEvents&&x()&&de(g)&&E){H.current=!0;const m=te(E).body;m.setAttribute(fe,"");const w=g,c=E,n=f?.nodesRef.current.find(y=>y.id===B)?.context?.elements.floating;return n&&(n.style.pointerEvents=""),m.style.pointerEvents="none",w.style.pointerEvents="auto",c.style.pointerEvents="auto",()=>{m.style.pointerEvents="",w.style.pointerEvents="",c.style.pointerEvents=""}}},[k,l,g,E,D,x,f,B,H]),r.useEffect(()=>{if(!k)return;function m(y){if(M()||!v.current.floatingContext||!t.select("open"))return;const S=t.context.triggerElements;y.relatedTarget&&S.hasElement(y.relatedTarget)||(_(),T(),M()||O(y))}function w(y){I.clear(),_(),L.current?.(y),T()}function c(y){M()||O(y,!1)}const n=E;return n&&(n.addEventListener("mouseleave",m),n.addEventListener("mouseenter",w),n.addEventListener("mouseleave",c),n.addEventListener("pointerdown",N,!0)),()=>{n&&(n.removeEventListener("mouseleave",m),n.removeEventListener("mouseenter",w),n.removeEventListener("mouseleave",c),n.removeEventListener("pointerdown",N,!0))}})}function Mt(o,e){return e&&!oe(e)?0:typeof o=="function"?o():o}function ce(o){return typeof o=="function"?o():o}const xt={current:null};function kt(o,e={}){const t="rootStore"in o?o.rootStore:o,{dataRef:l,events:E}=t.context,{enabled:g=!0,delay:v=0,handleClose:k=null,mouseOnly:s=!1,restMs:P=0,move:i=!0,triggerElementRef:a=xt,externalTree:L,isActiveTrigger:H=!0}=e,F=Te(L),{pointerTypeRef:u,interactedInsideRef:I,handlerRef:D,blockMouseMoveRef:f,performedPointerEventsMutationRef:B,unbindMouseMoveRef:M,restTimeoutPendingRef:x,openChangeTimeout:O,restTimeout:T,handleCloseOptionsRef:_}=ye(t),N=se(k),m=se(v),w=se(P);H&&(_.current=N.current?.__options);const c=z(()=>I.current?!0:l.current.openEvent?["click","mousedown"].includes(l.current.openEvent.type):!1),n=r.useCallback((d,p=!0)=>{const R=ie(m.current,"close",u.current);R&&!D.current?O.start(R,()=>t.setOpen(!1,W(X,d))):p&&(O.clear(),t.setOpen(!1,W(X,d)))},[m,D,t,u,O]),y=z(()=>{M.current(),D.current=void 0}),S=z(()=>{if(B.current){const d=te(t.select("domReferenceElement")).body;d.style.pointerEvents="",d.removeAttribute(fe),B.current=!1}});r.useEffect(()=>{if(!g)return;function d(p){p.open||(O.clear(),T.clear(),f.current=!0,x.current=!1)}return E.on("openchange",d),()=>{E.off("openchange",d)}},[g,E,O,T,f,x]);const G=z(d=>{if(c()||!l.current.floatingContext)return;const p=t.context.triggerElements;if(d.relatedTarget&&p.hasElement(d.relatedTarget))return;const R=a.current;N.current?.({...l.current.floatingContext,tree:F,x:d.clientX,y:d.clientY,onClose(){S(),y(),!c()&&R===t.select("domReferenceElement")&&n(d)}})(d)});return r.useEffect(()=>{if(!g)return;const d=a.current??(H?t.select("domReferenceElement"):null);if(!de(d))return;function p(C){if(O.clear(),f.current=!1,s&&!oe(u.current)||ce(w.current)>0&&!ie(m.current,"open"))return;const A=ie(m.current,"open",u.current),Y=t.select("domReferenceElement"),b=t.context.triggerElements,U=(b.hasElement(C.target)||b.hasMatchingElement(J=>Z(J,C.target)))&&(!Y||!Z(Y,C.target)),h=C.currentTarget??null,j=t.select("open"),$=!j||U;U&&j?t.setOpen(!0,W(X,C,h)):A?O.start(A,()=>{$&&t.setOpen(!0,W(X,C,h))}):$&&t.setOpen(!0,W(X,C,h))}function R(C){if(c()){S();return}M.current();const A=t.select("domReferenceElement"),Y=te(A);T.clear(),x.current=!1;const b=t.context.triggerElements;if(C.relatedTarget&&b.hasElement(C.relatedTarget))return;if(N.current&&l.current.floatingContext){t.select("open")||O.clear();const h=a.current;D.current=N.current({...l.current.floatingContext,tree:F,x:C.clientX,y:C.clientY,onClose(){S(),y(),!c()&&h===t.select("domReferenceElement")&&n(C,!0)}});const j=D.current;j(C),Y.addEventListener("mousemove",j),M.current=()=>{Y.removeEventListener("mousemove",j)};return}(u.current!=="touch"||!Z(t.select("floatingElement"),C.relatedTarget))&&n(C)}function K(C){G(C)}return t.select("open")&&d.addEventListener("mouseleave",K),i&&d.addEventListener("mousemove",p,{once:!0}),d.addEventListener("mouseenter",p),d.addEventListener("mouseleave",R),()=>{d.removeEventListener("mouseleave",K),i&&d.removeEventListener("mousemove",p),d.removeEventListener("mouseenter",p),d.removeEventListener("mouseleave",R)}},[y,S,f,l,m,n,t,g,N,G,H,c,s,i,u,w,T,x,O,a,F,M,D]),r.useMemo(()=>{function d(p){u.current=p.pointerType}return{onPointerDown:d,onPointerEnter:d,onMouseMove(p){const{nativeEvent:R}=p,K=p.currentTarget,C=t.select("domReferenceElement"),A=t.context.triggerElements,Y=t.select("open"),b=(A.hasElement(p.target)||A.hasMatchingElement(h=>Z(h,p.target)))&&(!C||!Z(C,p.target));if(s&&!oe(u.current)||Y&&!b||ce(w.current)===0||!b&&x.current&&p.movementX**2+p.movementY**2<2)return;T.clear();function U(){if(x.current=!1,c())return;const h=t.select("open");!f.current&&(!h||b)&&t.setOpen(!0,W(X,R,K))}u.current==="touch"?ne.flushSync(()=>{U()}):b&&Y?U():(x.current=!0,T.start(ce(w.current),U))}}},[f,c,s,t,u,w,T,x])}function Ee(o,e){const[t,l]=o;let E=!1;const g=e.length;for(let v=0,k=g-1;v<g;k=v++){const[s,P]=e[v]||[0,0],[i,a]=e[k]||[0,0];P>=l!=a>=l&&t<=(i-s)*(l-P)/(a-P)+s&&(E=!E)}return E}function Ft(o,e){return o[0]>=e.x&&o[0]<=e.x+e.width&&o[1]>=e.y&&o[1]<=e.y+e.height}function wt(o={}){const{buffer:e=.5,blockPointerEvents:t=!1,requireIntent:l=!0}=o,E=new Re;let g=!1,v=null,k=null,s=typeof performance<"u"?performance.now():0;function P(a,L){const H=performance.now(),F=H-s;if(v===null||k===null||F===0)return v=a,k=L,s=H,null;const u=a-v,I=L-k,f=Math.sqrt(u*u+I*I)/F;return v=a,k=L,s=H,f}const i=({x:a,y:L,placement:H,elements:F,onClose:u,nodeId:I,tree:D})=>function(B){function M(){E.clear(),u()}if(E.clear(),!F.domReference||!F.floating||H==null||a==null||L==null)return;const{clientX:x,clientY:O}=B,T=[x,O],_=ve(B),N=B.type==="mouseleave",m=Z(F.floating,_),w=Z(F.domReference,_),c=F.domReference.getBoundingClientRect(),n=F.floating.getBoundingClientRect(),y=H.split("-")[0],S=a>n.right-n.width/2,G=L>n.bottom-n.height/2,d=Ft(T,c),p=n.width>c.width,R=n.height>c.height,K=(p?c:n).left,C=(p?c:n).right,A=(R?c:n).top,Y=(R?c:n).bottom;if(m&&(g=!0,!N))return;if(w&&(g=!1),w&&!N){g=!0;return}if(N&&de(B.relatedTarget)&&Z(F.floating,B.relatedTarget)||D&&Je(D.nodesRef.current,I).some(({context:h})=>h?.open))return;if(y==="top"&&L>=c.bottom-1||y==="bottom"&&L<=c.top+1||y==="left"&&a>=c.right-1||y==="right"&&a<=c.left+1)return M();let b=[];switch(y){case"top":b=[[K,c.top+1],[K,n.bottom-1],[C,n.bottom-1],[C,c.top+1]];break;case"bottom":b=[[K,n.top+1],[K,c.bottom-1],[C,c.bottom-1],[C,n.top+1]];break;case"left":b=[[n.right-1,Y],[n.right-1,A],[c.left+1,A],[c.left+1,Y]];break;case"right":b=[[c.right-1,Y],[c.right-1,A],[n.left+1,A],[n.left+1,Y]];break}function U([h,j]){switch(y){case"top":{const $=[p?h+e/2:S?h+e*4:h-e*4,j+e+1],J=[p?h-e/2:S?h+e*4:h-e*4,j+e+1],Q=[[n.left,S||p?n.bottom-e:n.top],[n.right,S?p?n.bottom-e:n.top:n.bottom-e]];return[$,J,...Q]}case"bottom":{const $=[p?h+e/2:S?h+e*4:h-e*4,j-e],J=[p?h-e/2:S?h+e*4:h-e*4,j-e],Q=[[n.left,S||p?n.top+e:n.bottom],[n.right,S?p?n.top+e:n.bottom:n.top+e]];return[$,J,...Q]}case"left":{const $=[h+e+1,R?j+e/2:G?j+e*4:j-e*4],J=[h+e+1,R?j-e/2:G?j+e*4:j-e*4];return[...[[G||R?n.right-e:n.left,n.top],[G?R?n.right-e:n.left:n.right-e,n.bottom]],$,J]}case"right":{const $=[h-e,R?j+e/2:G?j+e*4:j-e*4],J=[h-e,R?j-e/2:G?j+e*4:j-e*4],Q=[[G||R?n.left+e:n.right,n.top],[G?R?n.left+e:n.right:n.left+e,n.bottom]];return[$,J,...Q]}default:return[]}}if(!Ee([x,O],b)){if(g&&!d)return M();if(!N&&l){const h=P(B.clientX,B.clientY);if(h!==null&&h<.1)return M()}Ee([x,O],U([a,L]))?!g&&l&&E.start(40,M):M()}};return i.__options={blockPointerEvents:t},i}const Ie=r.createContext(void 0);function ee(o){const e=r.useContext(Ie);if(e===void 0&&!o)throw new Error(re(47));return e}function Lt(){return{...pt(),disabled:!1,modal:!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 At={...dt,disabled:q(o=>o.disabled),instantType:q(o=>o.instantType),openMethod:q(o=>o.openMethod),openChangeReason:q(o=>o.openChangeReason),modal:q(o=>o.modal),stickIfOpen:q(o=>o.stickIfOpen),titleElementId:q(o=>o.titleElementId),descriptionElementId:q(o=>o.descriptionElementId),openOnHover:q(o=>o.openOnHover),closeDelay:q(o=>o.closeDelay),hasViewport:q(o=>o.hasViewport)};class ge extends Ze{constructor(e){const t={...Lt(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),stickIfOpenTimeout:new Re,triggerElements:new Qe},At)}setOpen=(e,t)=>{const l=t.reason===X,E=t.reason===ue&&t.event.detail===0,g=!e&&(t.reason===Le||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;const v={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit("openchange",v);const s=()=>{const P={open:e,openChangeReason:t.reason},i=t.trigger?.id??null;(i||e)&&(P.activeTriggerId=i,P.activeTriggerElement=t.trigger??null),this.update(P)};l?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Ae,()=>{this.set("stickIfOpen",!1)}),ne.flushSync(s)):s(),E||g?this.set("instantType",E?"click":"dismiss"):t.reason===le?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){const l=He(()=>new ge(t)).current,E=e??l;return je(l.disposeEffect),E}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function be({props:o}){const{children:e,open:t,defaultOpen:l=!1,onOpenChange:E,onOpenChangeComplete:g,modal:v=!1,handle:k,triggerId:s,defaultTriggerId:P=null}=o,i=ge.useStore(k?.store,{open:t??l,modal:v,activeTriggerId:s!==void 0?s:P});i.useControlledProp("open",t,l),i.useControlledProp("activeTriggerId",s,P);const a=i.useState("open"),L=i.useState("positionerElement"),H=i.useState("payload"),F=i.useState("openChangeReason");i.useContextCallback("onOpenChange",E),i.useContextCallback("onOpenChangeComplete",g);const{openMethod:u,triggerProps:I,reset:D}=tt(a);gt(i);const{forceUnmount:f}=mt(a,i,()=>{i.update({stickIfOpen:!0,openChangeReason:null}),D()});nt(a&&v===!0&&F!==X&&u!=="touch",L),r.useEffect(()=>{a||i.context.stickIfOpenTimeout.clear()},[i,a]);const B=r.useCallback(S=>{const G=W(S);return G.preventUnmountOnClose=()=>{i.set("preventUnmountingOnClose",!0)},G},[i]),M=r.useCallback(()=>{i.setOpen(!1,B(Be))},[i,B]);r.useImperativeHandle(o.actionsRef,()=>({unmount:f,close:M}),[f,M]);const x=ht({popupStore:i,onOpenChange:i.setOpen}),O=ot(x,{outsidePressEvent:{mouse:v==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=Et(x),{getReferenceProps:_,getFloatingProps:N,getTriggerProps:m}=Pe([O,T]),w=r.useMemo(()=>_(I),[_,I]),c=r.useMemo(()=>m(I),[m,I]),n=r.useMemo(()=>N(),[N]);i.useSyncedValues({modal:v,openMethod:u,activeTriggerProps:w,inactiveTriggerProps:c,popupProps:n,floatingRootContext:x,nested:Ce()!=null});const y=r.useMemo(()=>({store:i}),[i]);return V.jsx(Ie.Provider,{value:y,children:typeof e=="function"?e({payload:H}):e})}function Kt(o){return ee(!0)?V.jsx(be,{props:o}):V.jsx(et,{children:V.jsx(be,{props:o})})}const Ht=300,Ut=r.forwardRef(function(e,t){const{render:l,className:E,disabled:g=!1,nativeButton:v=!0,handle:k,payload:s,openOnHover:P=!1,delay:i=Ht,closeDelay:a=0,id:L,...H}=e,F=ee(!0),u=k?.store??F?.store;if(!u)throw new Error(re(74));const I=rt(L),D=u.useState("isTriggerActive",I),f=u.useState("floatingRootContext"),B=u.useState("isOpenedByTrigger",I),M=r.useRef(null),{registerTrigger:x,isMountedByThisTrigger:O}=bt(I,M,u,{payload:s,disabled:g,openOnHover:P,closeDelay:a}),T=u.useState("openChangeReason"),_=u.useState("stickIfOpen"),N=u.useState("openMethod"),m=kt(f,{enabled:f!=null&&P&&(N!=="touch"||T!==ue),mouseOnly:!0,move:!1,handleClose:wt(),restMs:i,delay:{close:a},triggerElementRef:M,isActiveTrigger:D}),w=vt(f,{enabled:f!=null,stickIfOpen:_}),c=Pe([w]),n=u.useState("triggerProps",O),y=r.useMemo(()=>({disabled:g,open:B}),[g,B]),{getButtonProps:S,buttonRef:G}=De({disabled:g,native:v}),d=r.useMemo(()=>({open(A){return A&&T===ue?st.open(A):it.open(A)}}),[T]),p=pe("button",e,{state:y,ref:[G,t,x,M],props:[c.getReferenceProps(),m,n,{[Ne]:"",id:I},H,S],stateAttributesMapping:d}),R=r.useRef(null),K=z(A=>{ne.flushSync(()=>{u.setOpen(!1,W(le,A.nativeEvent,A.currentTarget))}),_e(R.current)?.focus()}),C=z(A=>{const Y=u.select("positionerElement");if(Y&&Ye(A,Y))u.context.beforeContentFocusGuardRef.current?.focus();else{ne.flushSync(()=>{u.setOpen(!1,W(le,A.nativeEvent,A.currentTarget))});let b=Ge(u.context.triggerFocusTargetRef.current||M.current);for(;b!==null&&Z(Y,b);){const U=b;if(b=Ve(b),b===U)break}b?.focus()}});return D?V.jsxs(r.Fragment,{children:[V.jsx(he,{ref:R,onFocus:K}),V.jsx(r.Fragment,{children:p},I),V.jsx(he,{ref:u.context.triggerFocusTargetRef,onFocus:C})]}):V.jsx(r.Fragment,{children:p},I)}),Me=r.createContext(void 0);function jt(){const o=r.useContext(Me);if(o===void 0)throw new Error(re(45));return o}const Xt=r.forwardRef(function(e,t){const{keepMounted:l=!1,...E}=e,{store:g}=ee();return g.useState("mounted")||l?V.jsx(Me.Provider,{value:l,children:V.jsx(Ke,{ref:t,...E,renderGuards:!1})}):null}),xe=r.createContext(void 0);function Bt(){const o=r.useContext(xe);if(!o)throw new Error(re(46));return o}const qt=r.forwardRef(function(e,t){const{render:l,className:E,anchor:g,positionMethod:v="absolute",side:k="bottom",align:s="center",sideOffset:P=0,alignOffset:i=0,collisionBoundary:a="clipping-ancestors",collisionPadding:L=5,arrowPadding:H=5,sticky:F=!1,disableAnchorTracking:u=!1,collisionAvoidance:I=Ue,...D}=e,{store:f}=ee(),B=jt(),M=ct(),x=f.useState("floatingRootContext"),O=f.useState("mounted"),T=f.useState("open"),_=f.useState("openChangeReason"),N=f.useState("activeTriggerElement"),m=f.useState("modal"),w=f.useState("positionerElement"),c=f.useState("instantType"),n=f.useState("transitionStatus"),y=f.useState("hasViewport"),S=r.useRef(null),G=Xe(w,!1,!1),d=Rt({anchor:g,floatingRootContext:x,positionMethod:v,mounted:O,side:k,sideOffset:P,align:s,alignOffset:i,arrowPadding:H,collisionBoundary:a,collisionPadding:L,sticky:F,disableAnchorTracking:u,keepMounted:B,nodeId:M,collisionAvoidance:I,adaptiveOrigin:y?Tt:void 0}),p=r.useMemo(()=>{const b={};return T||(b.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...d.positionerStyles,...b}}},[T,O,d.positionerStyles]),R=r.useMemo(()=>({props:p,...d}),[p,d]),K=x?.select("domReferenceElement");ae(()=>{const b=K,U=S.current;if(b&&(S.current=b),U&&b&&b!==U){f.set("instantType",void 0);const h=new AbortController;return G(()=>{f.set("instantType","trigger-change")},h.signal),()=>{h.abort()}}},[K,G,f]);const C=r.useMemo(()=>({open:T,side:R.side,align:R.align,anchorHidden:R.anchorHidden,instant:c}),[T,R.side,R.align,R.anchorHidden,c]),A=r.useCallback(b=>{f.set("positionerElement",b)},[f]),Y=pe("div",e,{state:C,props:[R.props,Oe(n),D],ref:[t,A],stateAttributesMapping:Se});return V.jsxs(xe.Provider,{value:R,children:[O&&m===!0&&_!==X&&V.jsx(at,{ref:f.context.internalBackdropRef,inert:qe(!T),cutout:N}),V.jsx(ut,{id:M,children:Y})]})}),Dt={...Se,...$e},Wt=r.forwardRef(function(e,t){const{className:l,render:E,initialFocus:g,finalFocus:v,...k}=e,{store:s}=ee(),P=Bt(),i=Ct()!=null,a=s.useState("open"),L=s.useState("openMethod"),H=s.useState("instantType"),F=s.useState("transitionStatus"),u=s.useState("popupProps"),I=s.useState("titleElementId"),D=s.useState("descriptionElementId"),f=s.useState("modal"),B=s.useState("mounted"),M=s.useState("openChangeReason"),x=s.useState("activeTriggerElement"),O=s.useState("floatingRootContext");We({open:a,ref:s.context.popupRef,onComplete(){a&&s.context.onOpenChangeComplete?.(!0)}});const T=s.useState("disabled"),_=s.useState("openOnHover"),N=s.useState("closeDelay");It(O,{enabled:_&&!T,closeDelay:N});function m(S){return S==="touch"?s.context.popupRef.current:!0}const w=g===void 0?m:g,c=r.useMemo(()=>({open:a,side:P.side,align:P.align,instant:H,transitionStatus:F}),[a,P.side,P.align,H,F]),n=r.useCallback(S=>{s.set("popupElement",S)},[s]),y=pe("div",e,{state:c,ref:[t,s.context.popupRef,n],props:[u,{"aria-labelledby":I,"aria-describedby":D,onKeyDown(S){i&&ft.has(S.key)&&S.stopPropagation()}},Oe(F),k],stateAttributesMapping:Dt});return V.jsx(lt,{context:O,openInteractionType:L,modal:f==="trap-focus",disabled:!B||M===X,initialFocus:w,returnFocus:v,restoreFocus:"popup",previousFocusableElement:ze(x)?x:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:y})});export{Vt as L,Kt as P,Ut as a,Xt as b,qt as c,Wt as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as S,
|
|
1
|
+
import{r as S,aZ as v,a as w,j as e,O as y}from"./main-BN2u8ODm.js";import{u as k,w as j,s as l,L as N,x as C,S as E,h as I,i as R,C as T,j as L,k as A,l as P,m as O,o as _,n as D}from"./SelectItemText-CN5ejq4k.js";import{a as i,C as G}from"./useOpenInteractionType-BqOY0u5X.js";const M=S.forwardRef(function(s,o){const{className:n,render:f,...t}=s,{store:r,scrollHandlerRef:c}=k(),{alignItemWithTriggerActive:d}=j(),g=i(r,l.hasScrollArrows),u=i(r,l.openMethod),h=i(r,l.multiple),m={id:`${i(r,l.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(b){c.current?.(b.currentTarget)},...d&&{style:N},className:g&&u!=="touch"?C.className:void 0},x=v(b=>{r.set("listElement",b)});return w("div",s,{ref:[o,x],props:[m,t]})}),V="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 H({value:p,onValueChange:s,options:o=[],ariaLabel:n,id:f,disabled:t=!1,leadingIcon:r=null,className:c="",popupClassName:d="",align:g="start",matchTriggerWidth:u=!1}){const h=o.map(a=>({value:a.value,label:a.label}));return e.jsxs(E,{value:p,items:h,disabled:t,onValueChange:a=>{!t&&a!=null&&s?.(a)},children:[e.jsxs(I,{id:f,"aria-label":n,className:y(V,t&&"cursor-not-allowed opacity-50 hover:border-oai-gray-200 dark:hover:border-oai-gray-800",c),children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r,e.jsx(R,{className:"truncate"})]}),e.jsx(T,{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(A,{align:g,side:"bottom",sideOffset:4,className:"z-50",children:e.jsx(P,{className:y("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:o.map(a=>e.jsxs(O,{value:a.value,disabled:a.disabled,className:({selected:m,disabled:x})=>y("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",m?"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",x&&"cursor-not-allowed opacity-50 hover:bg-transparent dark:hover:bg-transparent"),children:[e.jsx("span",{className:"flex w-3.5 shrink-0 items-center justify-center text-oai-gray-500 dark:text-oai-gray-300",children:e.jsx(_,{children:e.jsx(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{H as S};
|