@gryt/ui 0.10.0 → 0.10.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;AAYb,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,IAAI,uGAgCf,CAAC"}
1
+ {"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;AAqBb,MAAM,WAAW,SACf,SAAQ,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACzD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,IAAI,uGAgCf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationItem.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationItem/ConversationItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7D,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,qHA+C3B,CAAC"}
1
+ {"version":3,"file":"ConversationItem.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationItem/ConversationItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI7D,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,qHAkD3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/utils/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,mGAC4E,CAAC;AAMnG,eAAO,MAAM,eAAe,wHAC2F,CAAC;AAExH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,QAMd,CAAC;AAEZ,uEAAuE;AACvE,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC;AAIhD,eAAO,MAAM,YAAY,wFAC8D,CAAC;AAIxF,eAAO,MAAM,WAAW,QAOb,CAAC;AAEZ,eAAO,MAAM,aAAa,8DACmC,CAAC;AAK9D,MAAM,MAAM,IAAI,GACZ,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO3C,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOzC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO3C,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAQhD,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOlD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO9C,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/utils/styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,mGAC4E,CAAC;AAMnG,eAAO,MAAM,eAAe,wHAC2F,CAAC;AAExH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,QAMd,CAAC;AAEZ,uEAAuE;AACvE,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,UAAU,CAAC;AAIhD,eAAO,MAAM,YAAY,wFAC8D,CAAC;AAIxF,eAAO,MAAM,WAAW,QAOb,CAAC;AAEZ,eAAO,MAAM,aAAa,8DACmC,CAAC;AAK9D,MAAM,MAAM,IAAI,GACZ,SAAS,GACT,WAAW,GACX,SAAS,GACT,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAKd,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO3C,CAAC;AAGF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOzC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO3C,CAAC;AAKF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAQhD,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAOlD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAO9C,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),G=require("@base-ui/react/tooltip"),Te=require("@base-ui/react/button"),c=require("react"),Oe=require("clsx"),Ue=require("tailwind-merge"),ee=require("@base-ui/react/field"),k=require("@phosphor-icons/react"),ce=require("@base-ui/react/avatar"),xe=require("@base-ui/react/checkbox"),he=require("@base-ui/react/radio"),Xe=require("@base-ui/react/radio-group"),we=require("@base-ui/react/switch"),Y=require("@base-ui/react/slider"),w=require("@base-ui/react/select"),Ke=require("@base-ui/react/separator"),le=require("@base-ui/react/progress"),L=require("@base-ui/react/dialog"),N=require("@base-ui/react/drawer"),H=require("@base-ui/react/menu"),Z=require("@base-ui/react/tabs"),W=require("@base-ui/react/accordion"),A=require("@base-ui/react/context-menu"),S=require("@base-ui/react/popover"),M=require("@base-ui/react/toast"),B=require("@base-ui/react/scroll-area"),We=require("@base-ui/react/toggle"),Je=require("@base-ui/react/toggle-group"),O=require("@base-ui/react/meter"),$=require("@base-ui/react/alert-dialog"),b=require("@base-ui/react/autocomplete"),m=require("@base-ui/react/combobox"),Qe=require("@base-ui/react/checkbox-group"),ge=require("@base-ui/react/collapsible"),Ze=require("@base-ui/react/form"),Pe=require("@base-ui/react/fieldset"),et=require("@base-ui/react/menubar"),v=require("@base-ui/react/navigation-menu"),I=require("@base-ui/react/number-field"),ve=require("@base-ui/react/otp-field"),E=require("@base-ui/react/preview-card"),_=require("@base-ui/react/toolbar");function Ce(o){return o<=.04045?o/12.92:((o+.055)/1.055)**2.4}function de(o){return o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055}function U(o){return Math.min(1,Math.max(0,o))}function X(o){const t=o.replace("#",""),r=t.length===3?t.split("").map(e=>e+e).join(""):t;return[parseInt(r.slice(0,2),16)/255,parseInt(r.slice(2,4),16)/255,parseInt(r.slice(4,6),16)/255]}function ke([o,t,r]){const e=a=>Math.round(U(a)*255).toString(16).padStart(2,"0");return`#${e(o)}${e(t)}${e(r)}`}function z(o){const[t,r,e]=X(o).map(Ce),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*e),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*e),l=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*e),d=.2104542553*a+.793617785*i-.0040720468*l,g=1.9779984951*a-2.428592205*i+.4505937099*l,y=.0259040371*a+.7827717662*i-.808675766*l;return{l:d,c:Math.hypot(g,y),h:(Math.atan2(y,g)*180/Math.PI+360)%360}}function C({l:o,c:t,h:r}){const e=t*Math.cos(r*Math.PI/180),a=t*Math.sin(r*Math.PI/180),i=(o+.3963377774*e+.2158037573*a)**3,l=(o-.1055613458*e-.0638541728*a)**3,d=(o-.0894841775*e-1.291485548*a)**3;return ke([de(U(4.0767416621*i-3.3077115913*l+.2309699292*d)),de(U(-1.2684380046*i+2.6097574011*l-.3413193965*d)),de(U(-.0041960863*i-.7034186147*l+1.707614701*d))])}const tt=[.195,.24,.27,.3,.33,.37,.43,.52],rt=[.014,.026,.04,.052,.062,.072,.084,.1];function T(o,t){const{h:r}=z(o),e=tt.map((d,g)=>C({l:d,c:rt[g],h:r}));e.push(o,t);const a=z(t).l,i=Math.min(.95,Math.max(.84,a+.04)),l=Math.min(.98,Math.max(i+.06,.93));return e.push(C({l:i,c:.11,h:r})),e.push(C({l,c:.055,h:r})),e}const ot=[.187,.231,.245,.268,.289,.31,.355,.425,.52,.57,.627,.908],nt=[.011,.014,.016,.019,.022,.024,.026,.026,.02,.012,0,.008];function Se(o){const t={0:o.bg,1:o.surface,2:o.surfaceRaised,5:o.border,10:o.muted,11:o.text},r=z(o.border).h;return ot.map((e,a)=>t[a]??C({l:e,c:nt[a],h:r}))}function J(o,t){const r=X(t);return o.map(e=>{const a=X(e);let i=0;for(let f=0;f<3;f++){const p=a[f],j=r[f];p>j?i=Math.max(i,j<1?(p-j)/(1-j):0):p<j&&(i=Math.max(i,j>0?(j-p)/j:0))}if(i<1e-6)return"transparent";const l=ke(a.map((f,p)=>U(r[p]+(f-r[p])/i))),[d,g,y]=X(l).map(f=>Math.round(f*255));return`rgb(${d} ${g} ${y} / ${(i*100).toFixed(1)}%)`})}const at=[.962,1,.978,.952,.928,.898,.855,.79,.66,.61,.48,.25],st=[.006,0,.004,.007,.01,.013,.016,.018,.016,.014,.012,.014],it=[.975,.955,.93,.905,.878,.845,.795,.72],ct=[.012,.024,.038,.05,.062,.074,.09,.11];function Me(o){const t={0:o.bg,1:o.surface,2:o.surfaceRaised,5:o.border,10:o.muted,11:o.text},r=z(o.border).h;return at.map((e,a)=>t[a]??C({l:e,c:st[a],h:r}))}function P(o){const{l:t,c:r,h:e}=z(o),a=it.map((i,l)=>C({l:i,c:ct[l],h:e}));return a.push(o),a.push(C({l:Math.max(0,t-.07),c:r,h:e})),a.push(C({l:.5,c:.15,h:e})),a.push(C({l:.33,c:.1,h:e})),a}function je(o){const[t,r,e]=X(o).map(Ce);return .2126*t+.7152*r+.0722*e}function lt(o,t){const r=je(o),e=je(t);return(Math.max(r,e)+.05)/(Math.min(r,e)+.05)}const u={color:{bg:"#111318",surface:"#1a1d24",surfaceRaised:"#1e2028",surfaceHover:"#334155",border:"#2b303d",text:"#e0e0e6",muted:"#888888",accent:"#968ff8",accentLight:"#b4afff",secondary:"#7dd3fc",secondaryLight:"#bae6fd",success:"#4ade80",danger:"#f87171",dangerLight:"#fca5a5",warning:"#fbbf24",onAccent:"#0c0a20",onSecondary:"#02121a",onDanger:"#1f0405"},radius:{sm:8,md:12,lg:20,xl:28,full:999}},R={bg:"#f1f2f7",surface:"#ffffff",surfaceRaised:"#f7f8fb",border:"#dadde6",muted:"#5b5d65",text:"#1f2129"},ue={neutral:Se({bg:u.color.bg,surface:u.color.surface,surfaceRaised:u.color.surfaceRaised,border:u.color.border,muted:u.color.muted,text:u.color.text}),accent:T(u.color.accent,u.color.accentLight),secondary:T(u.color.secondary,u.color.secondaryLight),success:T(u.color.success,u.color.success),danger:T(u.color.danger,u.color.dangerLight),warning:T(u.color.warning,u.color.warning)},re={neutral:Me(R),accent:P(u.color.accent),secondary:P(u.color.secondary),success:P(u.color.success),danger:P(u.color.danger),warning:P(u.color.warning)},Ae=re.neutral[3],dt={neutral:J(ue.neutral,u.color.bg),accent:J(ue.accent,u.color.bg)},ut={neutral:J(re.neutral,R.bg),accent:J(re.accent,R.bg)};function Le(o={}){const t=o.appearance==="light",e={...t?{...u.color,...R,surfaceHover:Ae}:u.color,...o.color},a={...u.radius,...o.radius},i={bg:e.bg,surface:e.surface,surfaceRaised:e.surfaceRaised,border:e.border,muted:e.muted,text:e.text},l=t?{neutral:Me(i),accent:P(e.accent),secondary:P(e.secondary),success:P(e.success),danger:P(e.danger),warning:P(e.warning)}:{neutral:Se(i),accent:T(e.accent,e.accentLight),secondary:T(e.secondary,e.secondaryLight),success:T(e.success,e.success),danger:T(e.danger,e.dangerLight),warning:T(e.warning,e.warning)},d={};for(const[g,y]of Object.entries(l))y.forEach((f,p)=>{d[`--gryt-${g}-${p+1}`]=f,d[`--color-gryt-${g}-${p+1}`]=f});for(const g of["neutral","accent"])J(l[g],e.bg).forEach((y,f)=>{d[`--gryt-${g}-a${f+1}`]=y,d[`--color-gryt-${g}-a${f+1}`]=y});return{...d,"--gryt-bg":e.bg,"--gryt-surface":e.surface,"--gryt-surface-raised":e.surfaceRaised,"--gryt-surface-hover":e.surfaceHover,"--gryt-border":e.border,"--gryt-text":e.text,"--gryt-muted":e.muted,"--gryt-accent":e.accent,"--gryt-accent-light":e.accentLight,"--gryt-secondary":e.secondary,"--gryt-secondary-light":e.secondaryLight,"--gryt-success":e.success,"--gryt-danger":e.danger,"--gryt-danger-light":e.dangerLight,"--gryt-warning":e.warning,"--gryt-on-accent":e.onAccent,"--gryt-on-secondary":e.onSecondary,"--gryt-on-danger":e.onDanger,"--color-gryt-bg":e.bg,"--color-gryt-surface":e.surface,"--color-gryt-surface-raised":e.surfaceRaised,"--color-gryt-surface-hover":e.surfaceHover,"--color-gryt-border":e.border,"--color-gryt-text":e.text,"--color-gryt-muted":e.muted,"--color-gryt-accent":e.accent,"--color-gryt-accent-light":e.accentLight,"--color-gryt-secondary":e.secondary,"--color-gryt-secondary-light":e.secondaryLight,"--color-gryt-success":e.success,"--color-gryt-danger":e.danger,"--color-gryt-danger-light":e.dangerLight,"--color-gryt-warning":e.warning,"--color-gryt-on-accent":e.onAccent,"--color-gryt-on-secondary":e.onSecondary,"--color-gryt-on-danger":e.onDanger,"--gryt-radius-sm":`${a.sm}px`,"--gryt-radius-md":`${a.md}px`,"--gryt-radius-lg":`${a.lg}px`,"--gryt-radius-xl":`${a.xl}px`,"--gryt-radius-full":`${a.full}px`}}function gt(o){return Object.keys(o).some(t=>t.startsWith("--"))}function ft({children:o,className:t,theme:r,tooltipDelay:e=400}){const a=r&&gt(r)?r:Le(r??{});return n.jsx("div",{className:t,style:a,children:n.jsx(G.Tooltip.Provider,{delay:e,children:o})})}const Q=["accent","accentLight","secondary","secondaryLight","success","danger","dangerLight","warning","onAccent","onSecondary","onDanger"],fe=["bg","surface","surfaceRaised","surfaceHover","border","muted","text"],oe=["sm","md","lg","xl","full"],$e=60;function ne(o){return o.replace(/\s+/g," ").trim().slice(0,$e)}const q={hue:{accent:u.color.accent,accentLight:u.color.accentLight,secondary:u.color.secondary,secondaryLight:u.color.secondaryLight,success:u.color.success,danger:u.color.danger,dangerLight:u.color.dangerLight,warning:u.color.warning,onAccent:u.color.onAccent,onSecondary:u.color.onSecondary,onDanger:u.color.onDanger},lightHue:null,dark:{bg:u.color.bg,surface:u.color.surface,surfaceRaised:u.color.surfaceRaised,surfaceHover:u.color.surfaceHover,border:u.color.border,muted:u.color.muted,text:u.color.text},light:{bg:R.bg,surface:R.surface,surfaceRaised:R.surfaceRaised,surfaceHover:Ae,border:R.border,muted:R.muted,text:R.text},radius:{...u.radius}};function ye(o){return{...o.name===void 0?{}:{name:o.name},hue:{...o.hue},lightHue:o.lightHue===null?null:{...o.lightHue},dark:{...o.dark},light:{...o.light},radius:{...o.radius}}}function De(o,t){return t==="light"&&o.lightHue!==null?o.lightHue:o.hue}function yt(o,t){return{appearance:t,color:{...De(o,t),...o[t]},radius:{...o.radius}}}const K={accent:"accent",accentLight:"accent-light",secondary:"secondary",secondaryLight:"secondary-light",success:"success",danger:"danger",dangerLight:"danger-light",warning:"warning",onAccent:"on-accent",onSecondary:"on-secondary",onDanger:"on-danger"},Ie={bg:"bg",surface:"surface",surfaceRaised:"raised",surfaceHover:"hover",border:"border",muted:"muted",text:"text"},pt=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function pe(o){return pt.test(o.trim())}function ae(o){const t=o.trim().toLowerCase();return t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function mt(o,t){const r=new URLSearchParams,e=i=>ae(i).slice(1),a=ne(o.name??"");a!==""&&r.set("name",a);for(const i of Q)o.hue[i]!==q.hue[i]&&r.set(K[i],e(o.hue[i]));if(o.lightHue!==null)for(const i of Q)r.set(`lh-${K[i]}`,e(o.lightHue[i]));for(const i of["dark","light"]){const l=i==="dark"?"d":"l";for(const d of fe)o[i][d]!==q[i][d]&&r.set(`${l}-${Ie[d]}`,e(o[i][d]))}for(const i of oe)o.radius[i]!==q.radius[i]&&r.set(`r-${i}`,String(o.radius[i]));return t==="light"&&r.set("mode","light"),r}function bt(o){const t=o.trim();if(t==="")return null;if(t.startsWith("{"))return ht(t);const r=t.includes("?")?t.slice(t.indexOf("?")+1):t;return xt(new URLSearchParams(r))}function xt(o){const t=ye(q);let r=!1;const e=i=>{const l=o.get(i);if(l===null)return null;const d=l.startsWith("#")?l:`#${l}`;return pe(d)?(r=!0,ae(d)):null},a=ne(o.get("name")??"");a!==""&&(t.name=a,r=!0);for(const i of Q){const l=e(K[i]);l!==null&&(t.hue[i]=l)}if(o.has(`lh-${K.accent}`)){const i={...t.hue};for(const l of Q){const d=e(`lh-${K[l]}`);d!==null&&(i[l]=d)}t.lightHue=i}for(const i of["dark","light"]){const l=i==="dark"?"d":"l";for(const d of fe){const g=e(`${l}-${Ie[d]}`);g!==null&&(t[i][d]=g)}}for(const i of oe){const l=Number(o.get(`r-${i}`));Number.isFinite(l)&&l>=0&&l<=999&&o.has(`r-${i}`)&&(t.radius[i]=Math.round(l),r=!0)}return r?{theme:t,appearance:o.get("mode")==="light"?"light":"dark"}:null}function ht(o){let t;try{t=JSON.parse(o)}catch{return null}if(typeof t!="object"||t===null)return null;const r=t,e=ye(q);let a=!1;const i=(l,d)=>{if(!(typeof l!="object"||l===null))for(const[g,y]of Object.entries(l))typeof y=="string"&&pe(y)&&g in d&&(d[g]=ae(y),a=!0)};if(typeof r.name=="string"){const l=ne(r.name);l!==""&&(e.name=l,a=!0)}if(i(r.hue,e.hue),i(r.dark,e.dark),i(r.light,e.light),typeof r.lightHue=="object"&&r.lightHue!==null){const l={...e.hue};i(r.lightHue,l),e.lightHue=l}if(typeof r.radius=="object"&&r.radius!==null)for(const[l,d]of Object.entries(r.radius)){const g=Number(d);oe.includes(l)&&Number.isFinite(g)&&g>=0&&g<=999&&(e.radius[l]=Math.round(g),a=!0)}return a?{theme:e,appearance:"dark"}:null}function s(...o){return Ue.twMerge(Oe.clsx(o))}const wt={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},vt={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},Ge=c.forwardRef(function({children:t,className:r,endIcon:e,size:a="medium",startIcon:i,tone:l="primary",...d},g){return n.jsxs(Te.Button,{ref:g,className:s("gryt-button","inline-flex items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-50",vt[a],wt[l],r),...d,children:[i,t,e]})}),x="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",jt="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",He=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),Fe={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},F="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",D=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),V="data-disabled:cursor-not-allowed data-disabled:opacity-50",Rt={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},Ee={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Nt={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Tt={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Pt={primary:"text-gryt-accent hover:not-data-disabled:bg-gryt-accent/10",secondary:"text-gryt-secondary hover:not-data-disabled:bg-gryt-secondary/10",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger hover:not-data-disabled:bg-gryt-danger/10",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Ct={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},kt=c.forwardRef(function({className:t,size:r="medium",tone:e="neutral",...a},i){return n.jsx(Te.Button,{ref:i,className:s("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",x,V,Ct[r],Pt[e],t),...a})}),St=c.forwardRef(function({className:t,elevated:r=!1,...e},a){return n.jsx("div",{ref:a,className:s("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",r?"bg-gryt-surface-raised":"bg-gryt-surface",t),...e})}),Mt=c.forwardRef(function({children:t,className:r,from:e="assistant",...a},i){return n.jsx("div",{ref:i,className:s("gryt-message-bubble",e==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",e==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",e==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",r),...a,children:t})}),At=c.forwardRef(function({className:t,error:r=!1,fieldClassName:e,helperText:a,label:i,minRows:l=3,multiline:d=!1,size:g="medium",...y},f){const p=n.jsx(ee.Field.Control,{ref:f,render:d?n.jsx("textarea",{rows:l}):void 0,className:s("gryt-text-field-control",He,d&&"resize-y leading-6",r?"border-gryt-danger":"border-gryt-border",Fe[g],t),...y});return n.jsxs(ee.Field.Root,{className:s("gryt-text-field flex w-full flex-col gap-1.5",e),children:[i?n.jsx(ee.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:i}):null,p,a?n.jsx(ee.Field.Description,{className:s("text-xs",r?"text-gryt-danger":"text-gryt-muted"),children:a}):null]})}),Lt=c.forwardRef(function({className:t,disabled:r=!1,maxRows:e=8,minRows:a=1,onSubmit:i,placeholder:l="Message Gryt",submitLabel:d="Send",...g},y){const f=c.useRef(null),p=c.useCallback(()=>{const h=f.current;if(!h)return;const ie=window.getComputedStyle(h),me=parseFloat(ie.lineHeight)||24,be=parseFloat(ie.paddingTop)+parseFloat(ie.paddingBottom);h.style.height="auto",h.style.height=`${Math.min(Math.max(h.scrollHeight,me*a+be),me*e+be)}px`},[e,a]);c.useLayoutEffect(p,[p,g.value]);function j(h){if(!i){h.preventDefault();return}i(h)}return n.jsxs("form",{className:s("gryt-composer",t),onSubmit:j,children:[n.jsx("textarea",{ref:h=>{f.current=h,typeof y=="function"?y(h):y&&(y.current=h)},rows:a,disabled:r,placeholder:l,onInput:p,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...g}),n.jsx(Ge,{type:"submit",disabled:r,size:"small",endIcon:n.jsx(k.PaperPlaneTilt,{size:14,weight:"fill"}),children:d})]})}),$t={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},_e=c.forwardRef(function({alt:t,children:r,className:e,fallback:a,size:i="medium",src:l,...d},g){return n.jsxs(ce.Avatar.Root,{ref:g,className:s("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",$t[i],e),...d,children:[l?n.jsx(ce.Avatar.Image,{src:l,alt:t,className:"h-full w-full object-cover"}):null,n.jsx(ce.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:a??r})]})}),Dt=c.forwardRef(function({active:t=!1,avatar:r,className:e,subtitle:a,title:i,...l},d){return n.jsxs("button",{ref:d,type:"button",className:s("gryt-conversation-item",t?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",e),...l,children:[r??n.jsx(_e,{size:"small",className:s(t?"bg-gryt-on-accent text-gryt-accent ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:i.slice(0,1).toUpperCase()}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-semibold",children:i}),a?n.jsx("span",{className:s("block truncate text-xs",t?"text-gryt-on-accent/70":"text-gryt-muted"),children:a}):null]})]})}),It=c.forwardRef(function({badgeContent:t,children:r,className:e,max:a=99,showZero:i=!1,...l},d){const g=typeof t=="number"?t:null,y=g!==null&&g===0&&!i,f=g!==null&&g>a?`${a}+`:t;return n.jsxs("span",{ref:d,className:s("gryt-badge relative inline-flex",e),...l,children:[r,t!==void 0&&!y?n.jsx("span",{className:s("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:f}):null]})}),Gt={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent/40 bg-gryt-accent/12 text-gryt-accent",secondary:"border-gryt-secondary/40 bg-gryt-secondary/12 text-gryt-secondary",success:"border-gryt-success/40 bg-gryt-success/12 text-gryt-success",warning:"border-gryt-warning/40 bg-gryt-warning/12 text-gryt-warning",danger:"border-gryt-danger/40 bg-gryt-danger/12 text-gryt-danger"},Ht=c.forwardRef(function({children:t,className:r,icon:e,label:a,onDelete:i,tone:l="neutral",...d},g){return n.jsxs("span",{ref:g,className:s("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Gt[l],r),...d,children:[e,a??t,i?n.jsx("button",{type:"button","aria-label":"Remove",onClick:i,className:s("-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",x),children:n.jsx(k.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Ft=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(xe.Checkbox.Root,{ref:a,className:s("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",x,V,Rt[r],t),...e,children:n.jsx(xe.Checkbox.Indicator,{keepMounted:!0,className:s("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:n.jsx(k.Check,{size:12,weight:"bold"})})})}),Et=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(he.Radio.Root,{ref:a,className:s("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",x,V,Nt[r],t),...e,children:n.jsx(he.Radio.Indicator,{keepMounted:!0,className:s("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",Ee[r])})})}),_t=c.forwardRef(function({className:t,...r},e){return n.jsx(Xe.RadioGroup,{ref:e,className:s("gryt-radio-group flex flex-col gap-2",t),...r})}),qt=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(we.Switch.Root,{ref:a,className:s("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",x,V,Tt[r],t),...e,children:n.jsx(we.Switch.Thumb,{className:s("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),Re=3;function Bt({className:o,tone:t="primary","aria-label":r,...e}){const[a,i]=c.useState(!1),l=c.useRef(null);c.useEffect(()=>{if(!a&&l.current===null)return;const f=()=>{l.current=null,i(!1)};return window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f),()=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)}},[a]);function d(f){l.current={x:f.clientX,y:f.clientY}}function g(f){const p=l.current;if(p===null||a)return;(Math.abs(f.clientX-p.x)>Re||Math.abs(f.clientY-p.y)>Re)&&i(!0)}const y=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return n.jsx(Y.Slider.Root,{className:s("gryt-slider w-full",o),...e,children:n.jsx(Y.Slider.Control,{className:"flex w-full touch-none items-center py-2 select-none",onPointerDown:d,onPointerMove:g,children:n.jsxs(Y.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[n.jsx(Y.Slider.Indicator,{className:s("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",y,Ee[t])}),n.jsx(Y.Slider.Thumb,{"aria-label":r,className:s("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",y,jt),children:n.jsx("span",{className:s("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const zt={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function Vt({className:o,label:t,options:r=[],placeholder:e="Select",size:a="medium",...i}){return n.jsxs(w.Select.Root,{items:r,...i,children:[n.jsxs("div",{className:s("gryt-select flex w-full flex-col gap-1.5",o),children:[t?n.jsx(w.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:t}):null,n.jsxs(w.Select.Trigger,{className:s("flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",x,zt[a]),children:[n.jsx(w.Select.Value,{placeholder:e}),n.jsx(w.Select.Icon,{className:"shrink-0 text-gryt-muted",children:n.jsx(k.CaretUpDown,{size:16})})]})]}),n.jsx(w.Select.Portal,{children:n.jsx(w.Select.Positioner,{sideOffset:6,className:"outline-none",children:n.jsx(w.Select.Popup,{className:s("min-w-(--anchor-width) p-1",F,D),children:n.jsx(w.Select.List,{children:r.map(l=>n.jsxs(w.Select.Item,{value:l.value,disabled:l.disabled,className:s("flex cursor-default items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[n.jsx(w.Select.ItemText,{children:l.label}),n.jsx(w.Select.ItemIndicator,{className:"text-gryt-accent",children:n.jsx(k.Check,{size:14,weight:"bold"})})]},String(l.value)))})})})})]})}function Yt({children:o,className:t,side:r="top",sideOffset:e=8,title:a}){return n.jsxs(G.Tooltip.Root,{children:[n.jsx(G.Tooltip.Trigger,{render:o}),n.jsx(G.Tooltip.Portal,{children:n.jsx(G.Tooltip.Positioner,{side:r,sideOffset:e,children:n.jsx(G.Tooltip.Popup,{className:s("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",D,t),children:a})})})]})}const Ot=G.Tooltip.Provider,Ut=c.forwardRef(function({className:t,orientation:r="horizontal",...e},a){return n.jsx(Ke.Separator,{ref:a,orientation:r,className:s("gryt-divider bg-gryt-border",r==="vertical"?"h-full w-px":"h-px w-full",t),...e})}),Xt=c.forwardRef(function({className:t,...r},e){return n.jsx("div",{ref:e,className:s("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",t),...r})});function Kt({children:o,className:t,subheader:r,title:e,...a}){return n.jsxs("div",{className:s("gryt-card-header flex flex-col gap-1 p-4",t),...a,children:[e?n.jsx("span",{className:"text-base font-semibold text-gryt-text",children:e}):null,r?n.jsx("span",{className:"text-sm text-gryt-muted",children:r}):null,o]})}function Wt({className:o,...t}){return n.jsx("div",{className:s("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",o),...t})}function Jt({className:o,...t}){return n.jsx("div",{className:s("gryt-card-actions flex items-center gap-2 px-4 pb-4",o),...t})}const Qt={info:"border-gryt-secondary/40 bg-gryt-secondary/10 text-gryt-secondary",success:"border-gryt-success/40 bg-gryt-success/10 text-gryt-success",warning:"border-gryt-warning/40 bg-gryt-warning/10 text-gryt-warning",error:"border-gryt-danger/40 bg-gryt-danger/10 text-gryt-danger"},Zt=c.forwardRef(function({className:t,severity:r="info",...e},a){return n.jsx("div",{ref:a,role:"alert",className:s("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",Qt[r],t),...e})});function er({className:o,value:t=null,...r}){return n.jsx(le.Progress.Root,{value:t,className:s("gryt-progress w-full",o),...r,children:n.jsx(le.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:n.jsx(le.Progress.Indicator,{className:"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-300 ease-out motion-reduce:transition-none"})})})}function tr({className:o,size:t=24,"aria-label":r="Loading"}){return n.jsx(k.CircleNotch,{role:"status","aria-label":r,size:t,weight:"bold",className:s("gryt-spinner text-gryt-accent motion-safe:animate-spin",o)})}const rr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function or({className:o,height:t,style:r,variant:e="text",width:a,...i}){const l={width:a,height:t,...r};return n.jsx("div",{"aria-hidden":"true",className:s("gryt-skeleton bg-white/9 motion-safe:animate-pulse",rr[e],o),style:l,...i})}const qe="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",nr=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Backdrop,{ref:e,className:s("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",qe,"data-starting-style:opacity-0 data-ending-style:opacity-0",t),...r})}),ar=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Popup,{ref:e,className:s("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",qe,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...r})}),sr=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Title,{ref:e,className:s("gryt-dialog-title text-base font-semibold text-gryt-text",t),...r})}),ir=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Description,{ref:e,className:s("gryt-dialog-description text-sm text-gryt-muted",t),...r})}),cr=c.forwardRef(function({className:t,...r},e){return n.jsx("div",{ref:e,className:s("gryt-dialog-footer flex justify-end gap-3",t),...r})}),lr={Root:L.Dialog.Root,Trigger:L.Dialog.Trigger,Portal:L.Dialog.Portal,Close:L.Dialog.Close,Backdrop:nr,Popup:ar,Title:sr,Description:ir,Footer:cr},dr=()=>()=>{};function Be(o){const t=c.useCallback(e=>{if(typeof window>"u"||!window.matchMedia)return dr();const a=window.matchMedia(o);return a.addEventListener("change",e),()=>a.removeEventListener("change",e)},[o]),r=c.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(o).matches,[o]);return c.useSyncExternalStore(t,r,()=>!1)}const ur={left:"left",right:"right",top:"up",bottom:"down"},se=c.createContext("right"),gr={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},fr={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},yr={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function pr({side:o="right",sheetOnMobile:t=!0,children:r,...e}){const a=Be("(max-width: 767px)"),i=t&&a?"bottom":o;return n.jsx(se.Provider,{value:i,children:n.jsx(N.Drawer.Root,{swipeDirection:ur[i],...e,children:r})})}const mr=c.forwardRef(function({className:t,...r},e){const a=c.useContext(se);return n.jsx(N.Drawer.Viewport,{ref:e,className:s("gryt-drawer-viewport fixed inset-0 z-50 flex",gr[a],t),...r})}),br=c.forwardRef(function({className:t,...r},e){const a=c.useContext(se);return n.jsx(N.Drawer.Popup,{ref:e,className:s("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",yr[a],fr[a],t),...r})}),xr=c.forwardRef(function({className:t,...r},e){return n.jsx(N.Drawer.Backdrop,{ref:e,className:s("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",t),...r})});function hr({className:o}){const t=c.useContext(se);return t!=="bottom"&&t!=="top"?null:n.jsx("div",{"aria-hidden":!0,className:s("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",t==="top"&&"order-last",o)})}const wr={Root:pr,Trigger:N.Drawer.Trigger,Portal:N.Drawer.Portal,Backdrop:xr,Viewport:mr,Popup:br,Content:N.Drawer.Content,Grabber:hr,Close:N.Drawer.Close,Title:N.Drawer.Title,Description:N.Drawer.Description},vr=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(H.Menu.Positioner,{ref:a,sideOffset:r,className:s("gryt-menu-positioner outline-none",t),...e})}),jr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Popup,{ref:e,className:s("gryt-menu min-w-44 p-1 outline-none",F,D,t),...r})}),Rr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Item,{ref:e,className:s("gryt-menu-item flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",t),...r})}),Nr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Separator,{ref:e,className:s("gryt-menu-separator my-1 h-px bg-gryt-border",t),...r})}),te={Root:H.Menu.Root,Trigger:H.Menu.Trigger,Portal:H.Menu.Portal,Positioner:vr,Popup:jr,Item:Rr,Separator:Nr},Tr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Root,{ref:e,className:s("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",t),...r})}),Pr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.List,{ref:e,className:s("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",t),...r})}),ze=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Tab,{ref:e,className:s("gryt-tab inline-flex min-h-8 items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 transition-colors duration-150 hover:text-gryt-text","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)",x,t),...r})}),Cr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Indicator,{ref:e,renderBeforeHydration:!0,className:s("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",t),...r})}),kr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Panel,{ref:e,className:s("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",t),...r})}),Sr=Object.assign(Tr,{List:Pr,Tab:ze,Panel:kr,Indicator:Cr}),Mr=c.forwardRef(function({className:t,...r},e){return n.jsx(W.Accordion.Root,{ref:e,className:s("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",t),...r})}),Ar=c.forwardRef(function({className:t,...r},e){return n.jsx(W.Accordion.Item,{ref:e,className:s("gryt-accordion-item",t),...r})}),Lr=c.forwardRef(function({children:t,className:r,expandIcon:e,...a},i){return n.jsx(W.Accordion.Header,{className:"gryt-accordion-header m-0",children:n.jsxs(W.Accordion.Trigger,{ref:i,className:s("gryt-accordion-trigger flex w-full items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised",x,r),...a,children:[t,e===void 0?n.jsx(k.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):e]})})}),$r=c.forwardRef(function({children:t,className:r,...e},a){return n.jsx(W.Accordion.Panel,{ref:a,className:s("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",r),...e,children:n.jsx("div",{className:"px-3 pt-1 pb-3",children:t})})}),Dr=Object.assign(Mr,{Item:Ar,Trigger:Lr,Panel:$r}),Ir=c.forwardRef(function({className:t,sideOffset:r=2,...e},a){return n.jsx(A.ContextMenu.Positioner,{ref:a,sideOffset:r,className:s("gryt-context-menu-positioner outline-none",t),...e})}),Gr={Root:A.ContextMenu.Root,Trigger:A.ContextMenu.Trigger,Portal:A.ContextMenu.Portal,Positioner:Ir,Popup:te.Popup,Item:te.Item,Separator:te.Separator,Group:A.ContextMenu.Group,GroupLabel:A.ContextMenu.GroupLabel,SubmenuRoot:A.ContextMenu.SubmenuRoot,SubmenuTrigger:A.ContextMenu.SubmenuTrigger},Hr=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(S.Popover.Positioner,{ref:a,sideOffset:r,className:s("gryt-popover-positioner outline-none",t),...e})}),Fr=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Popup,{ref:e,className:s("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",F,D,t),...r})}),Er=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Title,{ref:e,className:s("gryt-popover-title text-sm font-semibold text-gryt-text",t),...r})}),_r=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Description,{ref:e,className:s("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",t),...r})}),qr={Root:S.Popover.Root,Trigger:S.Popover.Trigger,Portal:S.Popover.Portal,Positioner:Hr,Popup:Fr,Title:Er,Description:_r,Close:S.Popover.Close,Arrow:S.Popover.Arrow},Br={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary/30 bg-gryt-secondary/8",success:"border-gryt-success/30 bg-gryt-success/8",warning:"border-gryt-warning/30 bg-gryt-warning/8",danger:"border-gryt-danger/30 bg-gryt-danger/8"},zr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Viewport,{ref:e,className:s("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",t),...r})}),Vr=c.forwardRef(function({className:t,severity:r="neutral",...e},a){return n.jsx(M.Toast.Root,{ref:a,className:s("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Br[r],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",t),...e})}),Yr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Title,{ref:e,className:s("gryt-toast-title text-sm font-semibold text-gryt-text",t),...r})}),Or=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Description,{ref:e,className:s("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",t),...r})}),Ur=c.forwardRef(function({className:t,children:r,...e},a){return n.jsx(M.Toast.Close,{ref:a,"aria-label":"Close",className:s("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...e,children:r??n.jsx(k.X,{size:14,weight:"bold"})})}),Xr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Action,{ref:e,className:s("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...r})}),Kr={Provider:M.Toast.Provider,Portal:M.Toast.Portal,Viewport:zr,Root:Vr,Title:Yr,Description:Or,Close:Ur,Action:Xr},Wr=M.Toast.useToastManager,Jr=c.forwardRef(function({className:t,...r},e){return n.jsx(B.ScrollArea.Root,{ref:e,className:s("gryt-scroll-area relative",t),...r})}),Qr=c.forwardRef(function({className:t,...r},e){return n.jsx(B.ScrollArea.Viewport,{ref:e,className:s("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",t),...r})}),Zr=c.forwardRef(function({className:t,orientation:r,...e},a){return n.jsx(B.ScrollArea.Scrollbar,{ref:a,orientation:r,className:s("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",r==="horizontal"?"h-2 flex-col":"w-2",t),...e,children:n.jsx(B.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),eo={Root:Jr,Viewport:Qr,Scrollbar:Zr,Content:B.ScrollArea.Content,Corner:B.ScrollArea.Corner},to={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},ro={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},oo=c.forwardRef(function({className:t,size:r="medium",tone:e="primary",...a},i){return n.jsx(We.Toggle,{ref:i,className:s("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",x,V,ro[r],to[e],t),...a})}),no=c.forwardRef(function({className:t,...r},e){return n.jsx(Je.ToggleGroup,{ref:e,className:s("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...r})}),ao={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function so({className:o,value:t,label:r,showValue:e=!1,tone:a="primary",...i}){return n.jsxs(O.Meter.Root,{value:t,className:s("gryt-meter flex w-full flex-col gap-1.5",o),...i,children:[(r||e)&&n.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[r?n.jsx(O.Meter.Label,{className:"text-sm text-gryt-muted",children:r}):n.jsx("span",{}),e&&n.jsx(O.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),n.jsx(O.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:n.jsx(O.Meter.Indicator,{className:s("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",ao[a])})})]})}const io=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Popup,{ref:e,className:s("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...r})}),co=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Backdrop,{ref:e,className:s("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",t),...r})}),lo=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Title,{ref:e,className:s("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",t),...r})}),uo=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Description,{ref:e,className:s("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",t),...r})}),go={Root:$.AlertDialog.Root,Trigger:$.AlertDialog.Trigger,Portal:$.AlertDialog.Portal,Backdrop:co,Popup:io,Title:lo,Description:uo,Close:$.AlertDialog.Close},Ve=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),Ye=[He,Fe.medium,"border-gryt-border",x].join(" "),fo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Input,{ref:e,className:s("gryt-combobox-input",Ye,t),...r})}),yo=c.forwardRef(function({className:t,sideOffset:r=6,...e},a){return n.jsx(m.Combobox.Positioner,{ref:a,sideOffset:r,className:s("gryt-combobox-positioner outline-none",t),...e})}),po=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Popup,{ref:e,className:s("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",F,D,t),...r})}),mo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Item,{ref:e,className:s("gryt-combobox-item",Ve,t),...r})}),bo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Empty,{ref:e,className:s("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",t),...r})}),xo={Root:m.Combobox.Root,Input:fo,InputGroup:m.Combobox.InputGroup,Trigger:m.Combobox.Trigger,Icon:m.Combobox.Icon,Clear:m.Combobox.Clear,Value:m.Combobox.Value,Chips:m.Combobox.Chips,Chip:m.Combobox.Chip,ChipRemove:m.Combobox.ChipRemove,Portal:m.Combobox.Portal,Positioner:yo,Popup:po,List:m.Combobox.List,Item:mo,ItemIndicator:m.Combobox.ItemIndicator,Group:m.Combobox.Group,GroupLabel:m.Combobox.GroupLabel,Empty:bo,Separator:m.Combobox.Separator},ho=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Input,{ref:e,className:s("gryt-autocomplete-input",Ye,t),...r})}),wo=c.forwardRef(function({className:t,sideOffset:r=6,...e},a){return n.jsx(b.Autocomplete.Positioner,{ref:a,sideOffset:r,className:s("gryt-autocomplete-positioner outline-none",t),...e})}),vo=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Popup,{ref:e,className:s("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",F,D,t),...r})}),jo=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Item,{ref:e,className:s("gryt-autocomplete-item",Ve,t),...r})}),Ro=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Empty,{ref:e,className:s("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",t),...r})}),No={Root:b.Autocomplete.Root,Input:ho,InputGroup:b.Autocomplete.InputGroup,Trigger:b.Autocomplete.Trigger,Icon:b.Autocomplete.Icon,Clear:b.Autocomplete.Clear,Value:b.Autocomplete.Value,Portal:b.Autocomplete.Portal,Positioner:wo,Popup:vo,List:b.Autocomplete.List,Item:jo,Group:b.Autocomplete.Group,GroupLabel:b.Autocomplete.GroupLabel,Empty:Ro,Separator:b.Autocomplete.Separator},To=c.forwardRef(function({className:t,...r},e){return n.jsx(Qe.CheckboxGroup,{ref:e,className:s("gryt-checkbox-group flex flex-col gap-2",t),...r})}),Po=c.forwardRef(function({className:t,...r},e){return n.jsx(ge.Collapsible.Trigger,{ref:e,className:s("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",x,t),...r})}),Co=c.forwardRef(function({className:t,...r},e){return n.jsx(ge.Collapsible.Panel,{ref:e,className:s("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...r})}),ko={Root:ge.Collapsible.Root,Trigger:Po,Panel:Co},So=c.forwardRef(function({className:t,...r},e){return n.jsx(Ze.Form,{ref:e,className:s("gryt-form flex flex-col gap-(--gryt-space-lg)",t),...r})}),Mo=c.forwardRef(function({className:t,...r},e){return n.jsx(Pe.Fieldset.Root,{ref:e,className:s("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",t),...r})}),Ao=c.forwardRef(function({className:t,...r},e){return n.jsx(Pe.Fieldset.Legend,{ref:e,className:s("gryt-fieldset-legend text-sm font-semibold text-gryt-text",t),...r})}),Lo={Root:Mo,Legend:Ao},$o=c.forwardRef(function({className:t,...r},e){return n.jsx(et.Menubar,{ref:e,className:s("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",t),...r})}),Do=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Trigger,{ref:e,className:s("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",x,t),...r})}),Io=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Popup,{ref:e,className:s("gryt-navigation-menu-popup outline-none",F,D,t),...r})}),Go=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Viewport,{ref:e,className:s("gryt-navigation-menu-viewport relative overflow-hidden",t),...r})}),Ho=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Link,{ref:e,className:s("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",x,t),...r})}),Fo={Root:v.NavigationMenu.Root,List:v.NavigationMenu.List,Item:v.NavigationMenu.Item,Trigger:Do,Content:v.NavigationMenu.Content,Portal:v.NavigationMenu.Portal,Positioner:v.NavigationMenu.Positioner,Viewport:Go,Popup:Io,Link:Ho,Icon:v.NavigationMenu.Icon,Arrow:v.NavigationMenu.Arrow},Ne="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",Eo=c.forwardRef(function({className:t,label:r,scrubbable:e=!1,...a},i){return n.jsxs(I.NumberField.Root,{ref:i,className:s("gryt-number-field flex flex-col gap-1.5",t),...a,children:[r&&(e?n.jsxs(I.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[r,n.jsx(I.NumberField.ScrubAreaCursor,{})]}):n.jsx("span",{className:"text-sm text-gryt-muted",children:r})),n.jsxs(I.NumberField.Group,{className:s("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",V),children:[n.jsx(I.NumberField.Decrement,{"aria-label":"Decrease",className:s(Ne,"rounded-l-(--gryt-radius-full)"),children:n.jsx(k.Minus,{size:14,weight:"bold"})}),n.jsx(I.NumberField.Input,{className:s("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",x)}),n.jsx(I.NumberField.Increment,{"aria-label":"Increase",className:s(Ne,"rounded-r-(--gryt-radius-full)"),children:n.jsx(k.Plus,{size:14,weight:"bold"})})]})]})}),_o=c.forwardRef(function({className:t,length:r=6,...e},a){return n.jsx(ve.OTPField.Root,{ref:a,length:r,className:s("gryt-otp-field flex gap-2",t),...e,children:Array.from({length:r},(i,l)=>n.jsx(ve.OTPField.Input,{className:s("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",x)},l))})}),qo=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(E.PreviewCard.Positioner,{ref:a,sideOffset:r,className:s("gryt-preview-card-positioner outline-none",t),...e})}),Bo=c.forwardRef(function({className:t,...r},e){return n.jsx(E.PreviewCard.Popup,{ref:e,className:s("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",F,D,t),...r})}),zo={Root:E.PreviewCard.Root,Trigger:E.PreviewCard.Trigger,Portal:E.PreviewCard.Portal,Positioner:qo,Popup:Bo,Arrow:E.PreviewCard.Arrow},Vo=c.forwardRef(function({className:t,...r},e){return n.jsx(_.Toolbar.Root,{ref:e,className:s("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...r})}),Yo=c.forwardRef(function({className:t,...r},e){return n.jsx(_.Toolbar.Separator,{ref:e,className:s("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",t),...r})}),Oo={Root:Vo,Group:_.Toolbar.Group,Button:_.Toolbar.Button,Link:_.Toolbar.Link,Input:_.Toolbar.Input,Separator:Yo};exports.Accordion=Dr;exports.Alert=Zt;exports.AlertDialog=go;exports.Autocomplete=No;exports.Avatar=_e;exports.Badge=It;exports.Button=Ge;exports.Card=Xt;exports.CardActions=Jt;exports.CardContent=Wt;exports.CardHeader=Kt;exports.Checkbox=Ft;exports.CheckboxGroup=To;exports.Chip=Ht;exports.Collapsible=ko;exports.Combobox=xo;exports.Composer=Lt;exports.ContextMenu=Gr;exports.ConversationItem=Dt;exports.Dialog=lr;exports.Divider=Ut;exports.Drawer=wr;exports.Fieldset=Lo;exports.Form=So;exports.GRYT_HUE_KEYS=Q;exports.GRYT_NEUTRAL_KEYS=fe;exports.GRYT_RADIUS_KEYS=oe;exports.GRYT_THEME_NAME_MAX=$e;exports.GrytProvider=ft;exports.IconButton=kt;exports.Menu=te;exports.Menubar=$o;exports.MessageBubble=Mt;exports.Meter=so;exports.NavigationMenu=Fo;exports.NumberField=Eo;exports.OtpField=_o;exports.Popover=qr;exports.PreviewCard=zo;exports.Progress=er;exports.Radio=Et;exports.RadioGroup=_t;exports.ScrollArea=eo;exports.Select=Vt;exports.Skeleton=or;exports.Slider=Bt;exports.Spinner=tr;exports.Surface=St;exports.Switch=qt;exports.Tab=ze;exports.Tabs=Sr;exports.TextField=At;exports.Toast=Kr;exports.Toggle=oo;exports.ToggleGroup=no;exports.Toolbar=Oo;exports.Tooltip=Yt;exports.TooltipProvider=Ot;exports.cloneGrytTheme=ye;exports.cn=s;exports.contrast=lt;exports.createGrytTheme=Le;exports.decodeGrytTheme=bt;exports.encodeGrytTheme=mt;exports.grytAlphaScales=dt;exports.grytAlphaScalesLight=ut;exports.grytLightTokens=R;exports.grytScales=ue;exports.grytScalesLight=re;exports.grytTheme=q;exports.grytThemeHues=De;exports.grytThemeToOptions=yt;exports.grytTokens=u;exports.hexToOklch=z;exports.isHexColor=pe;exports.normalizeHexColor=ae;exports.normalizeThemeName=ne;exports.oklchToHex=C;exports.useMediaQuery=Be;exports.useToastManager=Wr;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),G=require("@base-ui/react/tooltip"),Te=require("@base-ui/react/button"),c=require("react"),Oe=require("clsx"),Ue=require("tailwind-merge"),ee=require("@base-ui/react/field"),k=require("@phosphor-icons/react"),ce=require("@base-ui/react/avatar"),xe=require("@base-ui/react/checkbox"),he=require("@base-ui/react/radio"),Xe=require("@base-ui/react/radio-group"),we=require("@base-ui/react/switch"),Y=require("@base-ui/react/slider"),w=require("@base-ui/react/select"),Ke=require("@base-ui/react/separator"),le=require("@base-ui/react/progress"),L=require("@base-ui/react/dialog"),N=require("@base-ui/react/drawer"),H=require("@base-ui/react/menu"),Z=require("@base-ui/react/tabs"),W=require("@base-ui/react/accordion"),A=require("@base-ui/react/context-menu"),S=require("@base-ui/react/popover"),M=require("@base-ui/react/toast"),B=require("@base-ui/react/scroll-area"),We=require("@base-ui/react/toggle"),Je=require("@base-ui/react/toggle-group"),O=require("@base-ui/react/meter"),$=require("@base-ui/react/alert-dialog"),b=require("@base-ui/react/autocomplete"),m=require("@base-ui/react/combobox"),Qe=require("@base-ui/react/checkbox-group"),ge=require("@base-ui/react/collapsible"),Ze=require("@base-ui/react/form"),Pe=require("@base-ui/react/fieldset"),et=require("@base-ui/react/menubar"),v=require("@base-ui/react/navigation-menu"),I=require("@base-ui/react/number-field"),ve=require("@base-ui/react/otp-field"),E=require("@base-ui/react/preview-card"),_=require("@base-ui/react/toolbar");function Ce(o){return o<=.04045?o/12.92:((o+.055)/1.055)**2.4}function de(o){return o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055}function U(o){return Math.min(1,Math.max(0,o))}function X(o){const t=o.replace("#",""),r=t.length===3?t.split("").map(e=>e+e).join(""):t;return[parseInt(r.slice(0,2),16)/255,parseInt(r.slice(2,4),16)/255,parseInt(r.slice(4,6),16)/255]}function ke([o,t,r]){const e=a=>Math.round(U(a)*255).toString(16).padStart(2,"0");return`#${e(o)}${e(t)}${e(r)}`}function z(o){const[t,r,e]=X(o).map(Ce),a=Math.cbrt(.4122214708*t+.5363325363*r+.0514459929*e),i=Math.cbrt(.2119034982*t+.6806995451*r+.1073969566*e),l=Math.cbrt(.0883024619*t+.2817188376*r+.6299787005*e),d=.2104542553*a+.793617785*i-.0040720468*l,g=1.9779984951*a-2.428592205*i+.4505937099*l,y=.0259040371*a+.7827717662*i-.808675766*l;return{l:d,c:Math.hypot(g,y),h:(Math.atan2(y,g)*180/Math.PI+360)%360}}function C({l:o,c:t,h:r}){const e=t*Math.cos(r*Math.PI/180),a=t*Math.sin(r*Math.PI/180),i=(o+.3963377774*e+.2158037573*a)**3,l=(o-.1055613458*e-.0638541728*a)**3,d=(o-.0894841775*e-1.291485548*a)**3;return ke([de(U(4.0767416621*i-3.3077115913*l+.2309699292*d)),de(U(-1.2684380046*i+2.6097574011*l-.3413193965*d)),de(U(-.0041960863*i-.7034186147*l+1.707614701*d))])}const tt=[.195,.24,.27,.3,.33,.37,.43,.52],rt=[.014,.026,.04,.052,.062,.072,.084,.1];function T(o,t){const{h:r}=z(o),e=tt.map((d,g)=>C({l:d,c:rt[g],h:r}));e.push(o,t);const a=z(t).l,i=Math.min(.95,Math.max(.84,a+.04)),l=Math.min(.98,Math.max(i+.06,.93));return e.push(C({l:i,c:.11,h:r})),e.push(C({l,c:.055,h:r})),e}const ot=[.187,.231,.245,.268,.289,.31,.355,.425,.52,.57,.627,.908],nt=[.011,.014,.016,.019,.022,.024,.026,.026,.02,.012,0,.008];function Se(o){const t={0:o.bg,1:o.surface,2:o.surfaceRaised,5:o.border,10:o.muted,11:o.text},r=z(o.border).h;return ot.map((e,a)=>t[a]??C({l:e,c:nt[a],h:r}))}function J(o,t){const r=X(t);return o.map(e=>{const a=X(e);let i=0;for(let f=0;f<3;f++){const p=a[f],j=r[f];p>j?i=Math.max(i,j<1?(p-j)/(1-j):0):p<j&&(i=Math.max(i,j>0?(j-p)/j:0))}if(i<1e-6)return"transparent";const l=ke(a.map((f,p)=>U(r[p]+(f-r[p])/i))),[d,g,y]=X(l).map(f=>Math.round(f*255));return`rgb(${d} ${g} ${y} / ${(i*100).toFixed(1)}%)`})}const at=[.962,1,.978,.952,.928,.898,.855,.79,.66,.61,.48,.25],st=[.006,0,.004,.007,.01,.013,.016,.018,.016,.014,.012,.014],it=[.975,.955,.93,.905,.878,.845,.795,.72],ct=[.012,.024,.038,.05,.062,.074,.09,.11];function Me(o){const t={0:o.bg,1:o.surface,2:o.surfaceRaised,5:o.border,10:o.muted,11:o.text},r=z(o.border).h;return at.map((e,a)=>t[a]??C({l:e,c:st[a],h:r}))}function P(o){const{l:t,c:r,h:e}=z(o),a=it.map((i,l)=>C({l:i,c:ct[l],h:e}));return a.push(o),a.push(C({l:Math.max(0,t-.07),c:r,h:e})),a.push(C({l:.46,c:.15,h:e})),a.push(C({l:.33,c:.1,h:e})),a}function je(o){const[t,r,e]=X(o).map(Ce);return .2126*t+.7152*r+.0722*e}function lt(o,t){const r=je(o),e=je(t);return(Math.max(r,e)+.05)/(Math.min(r,e)+.05)}const u={color:{bg:"#111318",surface:"#1a1d24",surfaceRaised:"#1e2028",surfaceHover:"#334155",border:"#2b303d",text:"#e0e0e6",muted:"#888888",accent:"#968ff8",accentLight:"#b4afff",secondary:"#7dd3fc",secondaryLight:"#bae6fd",success:"#4ade80",danger:"#f87171",dangerLight:"#fca5a5",warning:"#fbbf24",onAccent:"#0c0a20",onSecondary:"#02121a",onDanger:"#1f0405"},radius:{sm:8,md:12,lg:20,xl:28,full:999}},R={bg:"#f1f2f7",surface:"#ffffff",surfaceRaised:"#f7f8fb",border:"#dadde6",muted:"#5b5d65",text:"#1f2129"},ue={neutral:Se({bg:u.color.bg,surface:u.color.surface,surfaceRaised:u.color.surfaceRaised,border:u.color.border,muted:u.color.muted,text:u.color.text}),accent:T(u.color.accent,u.color.accentLight),secondary:T(u.color.secondary,u.color.secondaryLight),success:T(u.color.success,u.color.success),danger:T(u.color.danger,u.color.dangerLight),warning:T(u.color.warning,u.color.warning)},re={neutral:Me(R),accent:P(u.color.accent),secondary:P(u.color.secondary),success:P(u.color.success),danger:P(u.color.danger),warning:P(u.color.warning)},Ae=re.neutral[3],dt={neutral:J(ue.neutral,u.color.bg),accent:J(ue.accent,u.color.bg)},ut={neutral:J(re.neutral,R.bg),accent:J(re.accent,R.bg)};function Le(o={}){const t=o.appearance==="light",e={...t?{...u.color,...R,surfaceHover:Ae}:u.color,...o.color},a={...u.radius,...o.radius},i={bg:e.bg,surface:e.surface,surfaceRaised:e.surfaceRaised,border:e.border,muted:e.muted,text:e.text},l=t?{neutral:Me(i),accent:P(e.accent),secondary:P(e.secondary),success:P(e.success),danger:P(e.danger),warning:P(e.warning)}:{neutral:Se(i),accent:T(e.accent,e.accentLight),secondary:T(e.secondary,e.secondaryLight),success:T(e.success,e.success),danger:T(e.danger,e.dangerLight),warning:T(e.warning,e.warning)},d={};for(const[g,y]of Object.entries(l))y.forEach((f,p)=>{d[`--gryt-${g}-${p+1}`]=f,d[`--color-gryt-${g}-${p+1}`]=f});for(const g of["neutral","accent"])J(l[g],e.bg).forEach((y,f)=>{d[`--gryt-${g}-a${f+1}`]=y,d[`--color-gryt-${g}-a${f+1}`]=y});return{...d,"--gryt-bg":e.bg,"--gryt-surface":e.surface,"--gryt-surface-raised":e.surfaceRaised,"--gryt-surface-hover":e.surfaceHover,"--gryt-border":e.border,"--gryt-text":e.text,"--gryt-muted":e.muted,"--gryt-accent":e.accent,"--gryt-accent-light":e.accentLight,"--gryt-secondary":e.secondary,"--gryt-secondary-light":e.secondaryLight,"--gryt-success":e.success,"--gryt-danger":e.danger,"--gryt-danger-light":e.dangerLight,"--gryt-warning":e.warning,"--gryt-on-accent":e.onAccent,"--gryt-on-secondary":e.onSecondary,"--gryt-on-danger":e.onDanger,"--color-gryt-bg":e.bg,"--color-gryt-surface":e.surface,"--color-gryt-surface-raised":e.surfaceRaised,"--color-gryt-surface-hover":e.surfaceHover,"--color-gryt-border":e.border,"--color-gryt-text":e.text,"--color-gryt-muted":e.muted,"--color-gryt-accent":e.accent,"--color-gryt-accent-light":e.accentLight,"--color-gryt-secondary":e.secondary,"--color-gryt-secondary-light":e.secondaryLight,"--color-gryt-success":e.success,"--color-gryt-danger":e.danger,"--color-gryt-danger-light":e.dangerLight,"--color-gryt-warning":e.warning,"--color-gryt-on-accent":e.onAccent,"--color-gryt-on-secondary":e.onSecondary,"--color-gryt-on-danger":e.onDanger,"--gryt-radius-sm":`${a.sm}px`,"--gryt-radius-md":`${a.md}px`,"--gryt-radius-lg":`${a.lg}px`,"--gryt-radius-xl":`${a.xl}px`,"--gryt-radius-full":`${a.full}px`}}function gt(o){return Object.keys(o).some(t=>t.startsWith("--"))}function ft({children:o,className:t,theme:r,tooltipDelay:e=400}){const a=r&&gt(r)?r:Le(r??{});return n.jsx("div",{className:t,style:a,children:n.jsx(G.Tooltip.Provider,{delay:e,children:o})})}const Q=["accent","accentLight","secondary","secondaryLight","success","danger","dangerLight","warning","onAccent","onSecondary","onDanger"],fe=["bg","surface","surfaceRaised","surfaceHover","border","muted","text"],oe=["sm","md","lg","xl","full"],$e=60;function ne(o){return o.replace(/\s+/g," ").trim().slice(0,$e)}const q={hue:{accent:u.color.accent,accentLight:u.color.accentLight,secondary:u.color.secondary,secondaryLight:u.color.secondaryLight,success:u.color.success,danger:u.color.danger,dangerLight:u.color.dangerLight,warning:u.color.warning,onAccent:u.color.onAccent,onSecondary:u.color.onSecondary,onDanger:u.color.onDanger},lightHue:null,dark:{bg:u.color.bg,surface:u.color.surface,surfaceRaised:u.color.surfaceRaised,surfaceHover:u.color.surfaceHover,border:u.color.border,muted:u.color.muted,text:u.color.text},light:{bg:R.bg,surface:R.surface,surfaceRaised:R.surfaceRaised,surfaceHover:Ae,border:R.border,muted:R.muted,text:R.text},radius:{...u.radius}};function ye(o){return{...o.name===void 0?{}:{name:o.name},hue:{...o.hue},lightHue:o.lightHue===null?null:{...o.lightHue},dark:{...o.dark},light:{...o.light},radius:{...o.radius}}}function De(o,t){return t==="light"&&o.lightHue!==null?o.lightHue:o.hue}function yt(o,t){return{appearance:t,color:{...De(o,t),...o[t]},radius:{...o.radius}}}const K={accent:"accent",accentLight:"accent-light",secondary:"secondary",secondaryLight:"secondary-light",success:"success",danger:"danger",dangerLight:"danger-light",warning:"warning",onAccent:"on-accent",onSecondary:"on-secondary",onDanger:"on-danger"},Ie={bg:"bg",surface:"surface",surfaceRaised:"raised",surfaceHover:"hover",border:"border",muted:"muted",text:"text"},pt=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function pe(o){return pt.test(o.trim())}function ae(o){const t=o.trim().toLowerCase();return t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function mt(o,t){const r=new URLSearchParams,e=i=>ae(i).slice(1),a=ne(o.name??"");a!==""&&r.set("name",a);for(const i of Q)o.hue[i]!==q.hue[i]&&r.set(K[i],e(o.hue[i]));if(o.lightHue!==null)for(const i of Q)r.set(`lh-${K[i]}`,e(o.lightHue[i]));for(const i of["dark","light"]){const l=i==="dark"?"d":"l";for(const d of fe)o[i][d]!==q[i][d]&&r.set(`${l}-${Ie[d]}`,e(o[i][d]))}for(const i of oe)o.radius[i]!==q.radius[i]&&r.set(`r-${i}`,String(o.radius[i]));return t==="light"&&r.set("mode","light"),r}function bt(o){const t=o.trim();if(t==="")return null;if(t.startsWith("{"))return ht(t);const r=t.includes("?")?t.slice(t.indexOf("?")+1):t;return xt(new URLSearchParams(r))}function xt(o){const t=ye(q);let r=!1;const e=i=>{const l=o.get(i);if(l===null)return null;const d=l.startsWith("#")?l:`#${l}`;return pe(d)?(r=!0,ae(d)):null},a=ne(o.get("name")??"");a!==""&&(t.name=a,r=!0);for(const i of Q){const l=e(K[i]);l!==null&&(t.hue[i]=l)}if(o.has(`lh-${K.accent}`)){const i={...t.hue};for(const l of Q){const d=e(`lh-${K[l]}`);d!==null&&(i[l]=d)}t.lightHue=i}for(const i of["dark","light"]){const l=i==="dark"?"d":"l";for(const d of fe){const g=e(`${l}-${Ie[d]}`);g!==null&&(t[i][d]=g)}}for(const i of oe){const l=Number(o.get(`r-${i}`));Number.isFinite(l)&&l>=0&&l<=999&&o.has(`r-${i}`)&&(t.radius[i]=Math.round(l),r=!0)}return r?{theme:t,appearance:o.get("mode")==="light"?"light":"dark"}:null}function ht(o){let t;try{t=JSON.parse(o)}catch{return null}if(typeof t!="object"||t===null)return null;const r=t,e=ye(q);let a=!1;const i=(l,d)=>{if(!(typeof l!="object"||l===null))for(const[g,y]of Object.entries(l))typeof y=="string"&&pe(y)&&g in d&&(d[g]=ae(y),a=!0)};if(typeof r.name=="string"){const l=ne(r.name);l!==""&&(e.name=l,a=!0)}if(i(r.hue,e.hue),i(r.dark,e.dark),i(r.light,e.light),typeof r.lightHue=="object"&&r.lightHue!==null){const l={...e.hue};i(r.lightHue,l),e.lightHue=l}if(typeof r.radius=="object"&&r.radius!==null)for(const[l,d]of Object.entries(r.radius)){const g=Number(d);oe.includes(l)&&Number.isFinite(g)&&g>=0&&g<=999&&(e.radius[l]=Math.round(g),a=!0)}return a?{theme:e,appearance:"dark"}:null}function s(...o){return Ue.twMerge(Oe.clsx(o))}const wt={primary:"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light",secondary:"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light",neutral:"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover",danger:"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light",ghost:"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},vt={xsmall:"min-h-8 px-3 text-xs",small:"min-h-9 px-4 text-sm",medium:"min-h-10 px-5 text-sm",large:"min-h-12 px-6 text-base"},Ge=c.forwardRef(function({children:t,className:r,endIcon:e,size:a="medium",startIcon:i,tone:l="primary",...d},g){return n.jsxs(Te.Button,{ref:g,className:s("gryt-button","inline-flex items-center justify-center gap-2 border-0 shadow-none","rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none","transition-[scale,background-color,color]","duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-50",vt[a],wt[l],r),...d,children:[i,t,e]})}),x="focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",jt="has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light",He=["w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised","text-gryt-text outline-none placeholder:text-gryt-muted","transition-colors duration-150 motion-reduce:transition-none","hover:border-gryt-accent-light focus:border-gryt-accent","disabled:cursor-not-allowed disabled:opacity-60"].join(" "),Fe={small:"min-h-9 px-3 py-1.5 text-sm",medium:"min-h-11 px-4 py-2.5 text-sm"},F="rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",D=["transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0"].join(" "),V="data-disabled:cursor-not-allowed data-disabled:opacity-50",Rt={primary:"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent",secondary:"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary",neutral:"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text",danger:"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger",success:"data-checked:bg-gryt-success data-checked:text-gryt-on-accent",warning:"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent"},Ee={primary:"bg-gryt-accent",secondary:"bg-gryt-secondary",neutral:"bg-gryt-surface-hover",danger:"bg-gryt-danger",success:"bg-gryt-success",warning:"bg-gryt-warning"},Nt={primary:"data-checked:border-gryt-accent",secondary:"data-checked:border-gryt-secondary",neutral:"data-checked:border-gryt-muted",danger:"data-checked:border-gryt-danger",success:"data-checked:border-gryt-success",warning:"data-checked:border-gryt-warning"},Tt={primary:"data-checked:bg-gryt-accent",secondary:"data-checked:bg-gryt-secondary",neutral:"data-checked:bg-gryt-surface-hover",danger:"data-checked:bg-gryt-danger",success:"data-checked:bg-gryt-success",warning:"data-checked:bg-gryt-warning"},Pt={primary:"text-gryt-accent-11 hover:not-data-disabled:bg-gryt-accent-3",secondary:"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3",neutral:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text",danger:"text-gryt-danger-11 hover:not-data-disabled:bg-gryt-danger-3",ghost:"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text"},Ct={xsmall:"h-8 w-8",small:"h-9 w-9",medium:"h-10 w-10",large:"h-12 w-12"},kt=c.forwardRef(function({className:t,size:r="medium",tone:e="neutral",...a},i){return n.jsx(Te.Button,{ref:i,className:s("gryt-icon-button","inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0","rounded-(--gryt-radius-full) select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]","motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]",x,V,Ct[r],Pt[e],t),...a})}),St=c.forwardRef(function({className:t,elevated:r=!1,...e},a){return n.jsx("div",{ref:a,className:s("gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text",r?"bg-gryt-surface-raised":"bg-gryt-surface",t),...e})}),Mt=c.forwardRef(function({children:t,className:r,from:e="assistant",...a},i){return n.jsx("div",{ref:i,className:s("gryt-message-bubble",e==="user"&&"ml-auto bg-gryt-accent text-gryt-on-accent",e==="assistant"&&"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text",e==="system"&&"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted",r),...a,children:t})}),At=c.forwardRef(function({className:t,error:r=!1,fieldClassName:e,helperText:a,label:i,minRows:l=3,multiline:d=!1,size:g="medium",...y},f){const p=n.jsx(ee.Field.Control,{ref:f,render:d?n.jsx("textarea",{rows:l}):void 0,className:s("gryt-text-field-control",He,d&&"resize-y leading-6",r?"border-gryt-danger":"border-gryt-border",Fe[g],t),...y});return n.jsxs(ee.Field.Root,{className:s("gryt-text-field flex w-full flex-col gap-1.5",e),children:[i?n.jsx(ee.Field.Label,{className:"text-xs font-medium text-gryt-muted",children:i}):null,p,a?n.jsx(ee.Field.Description,{className:s("text-xs",r?"text-gryt-danger-11":"text-gryt-muted"),children:a}):null]})}),Lt=c.forwardRef(function({className:t,disabled:r=!1,maxRows:e=8,minRows:a=1,onSubmit:i,placeholder:l="Message Gryt",submitLabel:d="Send",...g},y){const f=c.useRef(null),p=c.useCallback(()=>{const h=f.current;if(!h)return;const ie=window.getComputedStyle(h),me=parseFloat(ie.lineHeight)||24,be=parseFloat(ie.paddingTop)+parseFloat(ie.paddingBottom);h.style.height="auto",h.style.height=`${Math.min(Math.max(h.scrollHeight,me*a+be),me*e+be)}px`},[e,a]);c.useLayoutEffect(p,[p,g.value]);function j(h){if(!i){h.preventDefault();return}i(h)}return n.jsxs("form",{className:s("gryt-composer",t),onSubmit:j,children:[n.jsx("textarea",{ref:h=>{f.current=h,typeof y=="function"?y(h):y&&(y.current=h)},rows:a,disabled:r,placeholder:l,onInput:p,className:"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60",...g}),n.jsx(Ge,{type:"submit",disabled:r,size:"small",endIcon:n.jsx(k.PaperPlaneTilt,{size:14,weight:"fill"}),children:d})]})}),$t={small:"h-8 w-8 text-xs",medium:"h-10 w-10 text-sm",large:"h-12 w-12 text-base"},_e=c.forwardRef(function({alt:t,children:r,className:e,fallback:a,size:i="medium",src:l,...d},g){return n.jsxs(ce.Avatar.Root,{ref:g,className:s("gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none","rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border",$t[i],e),...d,children:[l?n.jsx(ce.Avatar.Image,{src:l,alt:t,className:"h-full w-full object-cover"}):null,n.jsx(ce.Avatar.Fallback,{className:"flex h-full w-full items-center justify-center",children:a??r})]})}),Dt=c.forwardRef(function({active:t=!1,avatar:r,className:e,subtitle:a,title:i,...l},d){return n.jsxs("button",{ref:d,type:"button",className:s("gryt-conversation-item",t?"bg-gryt-accent text-gryt-on-accent":"text-gryt-text hover:bg-white/5",e),...l,children:[r??n.jsx(_e,{size:"small",className:s(t?"bg-gryt-on-accent text-gryt-accent-9 ring-transparent":"bg-gryt-surface-raised text-gryt-text"),children:i.slice(0,1).toUpperCase()}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-sm font-semibold",children:i}),a?n.jsx("span",{className:s("block truncate text-xs",t?"text-gryt-on-accent/85":"text-gryt-muted"),children:a}):null]})]})}),It=c.forwardRef(function({badgeContent:t,children:r,className:e,max:a=99,showZero:i=!1,...l},d){const g=typeof t=="number"?t:null,y=g!==null&&g===0&&!i,f=g!==null&&g>a?`${a}+`:t;return n.jsxs("span",{ref:d,className:s("gryt-badge relative inline-flex",e),...l,children:[r,t!==void 0&&!y?n.jsx("span",{className:s("gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center","min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5","bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent","ring-2 ring-gryt-bg"),children:f}):null]})}),Gt={neutral:"border-gryt-border bg-gryt-surface-raised text-gryt-text",primary:"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11",secondary:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",danger:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Ht=c.forwardRef(function({children:t,className:r,icon:e,label:a,onDelete:i,tone:l="neutral",...d},g){return n.jsxs("span",{ref:g,className:s("gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium",Gt[l],r),...d,children:[e,a??t,i?n.jsx("button",{type:"button","aria-label":"Remove",onClick:i,className:s("-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-(--gryt-radius-full)","opacity-70 transition-opacity hover:opacity-100",x),children:n.jsx(k.X,{size:10,weight:"bold","aria-hidden":"true"})}):null]})}),Ft=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(xe.Checkbox.Root,{ref:a,className:s("gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",x,V,Rt[r],t),...e,children:n.jsx(xe.Checkbox.Indicator,{keepMounted:!0,className:s("flex origin-center","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none"),children:n.jsx(k.Check,{size:12,weight:"bold"})})})}),Et=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(he.Radio.Root,{ref:a,className:s("gryt-radio flex h-5 w-5 shrink-0 items-center justify-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.08]","motion-safe:active:not-data-disabled:scale-[0.92]",x,V,Nt[r],t),...e,children:n.jsx(he.Radio.Indicator,{keepMounted:!0,className:s("h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)","transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring","data-unchecked:scale-0 data-unchecked:opacity-0","motion-reduce:transition-none",Ee[r])})})}),_t=c.forwardRef(function({className:t,...r},e){return n.jsx(Xe.RadioGroup,{ref:e,className:s("gryt-radio-group flex flex-col gap-2",t),...r})}),qt=c.forwardRef(function({className:t,tone:r="primary",...e},a){return n.jsx(we.Switch.Root,{ref:a,className:s("gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5","transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring","data-checked:border-transparent","hover:not-data-disabled:border-gryt-accent-light","motion-safe:hover:not-data-disabled:scale-[1.05]","motion-safe:active:not-data-disabled:scale-[0.95]",x,V,Tt[r],t),...e,children:n.jsx(we.Switch.Thumb,{className:s("h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text","transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-checked:translate-x-4 data-checked:bg-gryt-bg")})})}),Re=3;function Bt({className:o,tone:t="primary","aria-label":r,...e}){const[a,i]=c.useState(!1),l=c.useRef(null);c.useEffect(()=>{if(!a&&l.current===null)return;const f=()=>{l.current=null,i(!1)};return window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f),()=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)}},[a]);function d(f){l.current={x:f.clientX,y:f.clientY}}function g(f){const p=l.current;if(p===null||a)return;(Math.abs(f.clientX-p.x)>Re||Math.abs(f.clientY-p.y)>Re)&&i(!0)}const y=a?"transition-none":"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none";return n.jsx(Y.Slider.Root,{className:s("gryt-slider w-full",o),...e,children:n.jsx(Y.Slider.Control,{className:"flex w-full touch-none items-center py-2 select-none",onPointerDown:d,onPointerMove:g,children:n.jsxs(Y.Slider.Track,{className:"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none",children:[n.jsx(Y.Slider.Indicator,{className:s("h-full rounded-(--gryt-radius-full) select-none","transition-[width]",y,Ee[t])}),n.jsx(Y.Slider.Thumb,{"aria-label":r,className:s("group h-4 w-4 rounded-(--gryt-radius-full) select-none","transition-[inset-inline-start]",y,jt),children:n.jsx("span",{className:s("block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]","motion-reduce:transition-none")})})]})})})}const zt={small:"min-h-9 px-3 text-sm",medium:"min-h-11 px-4 text-sm"};function Vt({className:o,label:t,options:r=[],placeholder:e="Select",size:a="medium",...i}){return n.jsxs(w.Select.Root,{items:r,...i,children:[n.jsxs("div",{className:s("gryt-select flex w-full flex-col gap-1.5",o),children:[t?n.jsx(w.Select.Label,{className:"text-xs font-medium text-gryt-muted",children:t}):null,n.jsxs(w.Select.Trigger,{className:s("flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised","text-gryt-text select-none","transition-colors duration-150 hover:border-gryt-accent-light","data-disabled:cursor-not-allowed data-disabled:opacity-60",x,zt[a]),children:[n.jsx(w.Select.Value,{placeholder:e}),n.jsx(w.Select.Icon,{className:"shrink-0 text-gryt-muted",children:n.jsx(k.CaretUpDown,{size:16})})]})]}),n.jsx(w.Select.Portal,{children:n.jsx(w.Select.Positioner,{sideOffset:6,className:"outline-none",children:n.jsx(w.Select.Popup,{className:s("min-w-(--anchor-width) p-1",F,D),children:n.jsx(w.Select.List,{children:r.map(l=>n.jsxs(w.Select.Item,{value:l.value,disabled:l.disabled,className:s("flex cursor-default items-center justify-between gap-2","rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text","outline-none select-none data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50"),children:[n.jsx(w.Select.ItemText,{children:l.label}),n.jsx(w.Select.ItemIndicator,{className:"text-gryt-accent-11",children:n.jsx(k.Check,{size:14,weight:"bold"})})]},String(l.value)))})})})})]})}function Yt({children:o,className:t,side:r="top",sideOffset:e=8,title:a}){return n.jsxs(G.Tooltip.Root,{children:[n.jsx(G.Tooltip.Trigger,{render:o}),n.jsx(G.Tooltip.Portal,{children:n.jsx(G.Tooltip.Positioner,{side:r,sideOffset:e,children:n.jsx(G.Tooltip.Popup,{className:s("gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised","px-2.5 py-1.5 text-xs text-gryt-text",D,t),children:a})})})]})}const Ot=G.Tooltip.Provider,Ut=c.forwardRef(function({className:t,orientation:r="horizontal",...e},a){return n.jsx(Ke.Separator,{ref:a,orientation:r,className:s("gryt-divider bg-gryt-border",r==="vertical"?"h-full w-px":"h-px w-full",t),...e})}),Xt=c.forwardRef(function({className:t,...r},e){return n.jsx("div",{ref:e,className:s("gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text",t),...r})});function Kt({children:o,className:t,subheader:r,title:e,...a}){return n.jsxs("div",{className:s("gryt-card-header flex flex-col gap-1 p-4",t),...a,children:[e?n.jsx("span",{className:"text-base font-semibold text-gryt-text",children:e}):null,r?n.jsx("span",{className:"text-sm text-gryt-muted",children:r}):null,o]})}function Wt({className:o,...t}){return n.jsx("div",{className:s("gryt-card-content px-4 pb-4 text-sm text-gryt-muted",o),...t})}function Jt({className:o,...t}){return n.jsx("div",{className:s("gryt-card-actions flex items-center gap-2 px-4 pb-4",o),...t})}const Qt={info:"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11",success:"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11",warning:"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11",error:"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11"},Zt=c.forwardRef(function({className:t,severity:r="info",...e},a){return n.jsx("div",{ref:a,role:"alert",className:s("gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm",Qt[r],t),...e})});function er({className:o,value:t=null,...r}){return n.jsx(le.Progress.Root,{value:t,className:s("gryt-progress w-full",o),...r,children:n.jsx(le.Progress.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:n.jsx(le.Progress.Indicator,{className:"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-300 ease-out motion-reduce:transition-none"})})})}function tr({className:o,size:t=24,"aria-label":r="Loading"}){return n.jsx(k.CircleNotch,{role:"status","aria-label":r,size:t,weight:"bold",className:s("gryt-spinner text-gryt-accent-11 motion-safe:animate-spin",o)})}const rr={text:"h-4 rounded-(--gryt-radius-sm)",rounded:"rounded-(--gryt-radius-lg)",circular:"rounded-(--gryt-radius-full)",rectangular:"rounded-none"};function or({className:o,height:t,style:r,variant:e="text",width:a,...i}){const l={width:a,height:t,...r};return n.jsx("div",{"aria-hidden":"true",className:s("gryt-skeleton bg-white/9 motion-safe:animate-pulse",rr[e],o),style:l,...i})}const qe="transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none",nr=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Backdrop,{ref:e,className:s("gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)",qe,"data-starting-style:opacity-0 data-ending-style:opacity-0",t),...r})}),ar=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Popup,{ref:e,className:s("gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text",qe,"data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...r})}),sr=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Title,{ref:e,className:s("gryt-dialog-title text-base font-semibold text-gryt-text",t),...r})}),ir=c.forwardRef(function({className:t,...r},e){return n.jsx(L.Dialog.Description,{ref:e,className:s("gryt-dialog-description text-sm text-gryt-muted",t),...r})}),cr=c.forwardRef(function({className:t,...r},e){return n.jsx("div",{ref:e,className:s("gryt-dialog-footer flex justify-end gap-3",t),...r})}),lr={Root:L.Dialog.Root,Trigger:L.Dialog.Trigger,Portal:L.Dialog.Portal,Close:L.Dialog.Close,Backdrop:nr,Popup:ar,Title:sr,Description:ir,Footer:cr},dr=()=>()=>{};function Be(o){const t=c.useCallback(e=>{if(typeof window>"u"||!window.matchMedia)return dr();const a=window.matchMedia(o);return a.addEventListener("change",e),()=>a.removeEventListener("change",e)},[o]),r=c.useCallback(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(o).matches,[o]);return c.useSyncExternalStore(t,r,()=>!1)}const ur={left:"left",right:"right",top:"up",bottom:"down"},se=c.createContext("right"),gr={left:"items-stretch justify-start",right:"items-stretch justify-end",top:"items-start justify-center",bottom:"items-end justify-center"},fr={left:"rounded-r-(--gryt-radius-xl)",right:"rounded-l-(--gryt-radius-xl)",top:"rounded-b-(--gryt-radius-xl)",bottom:"rounded-t-(--gryt-radius-xl)"},yr={left:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),right:["h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]","-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateX(var(--drawer-swipe-movement-x))]","data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]"].join(" "),top:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]"].join(" "),bottom:["w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]","-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]","[transform:translateY(var(--drawer-swipe-movement-y))]","data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]","data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]"].join(" ")};function pr({side:o="right",sheetOnMobile:t=!0,children:r,...e}){const a=Be("(max-width: 767px)"),i=t&&a?"bottom":o;return n.jsx(se.Provider,{value:i,children:n.jsx(N.Drawer.Root,{swipeDirection:ur[i],...e,children:r})})}const mr=c.forwardRef(function({className:t,...r},e){const a=c.useContext(se);return n.jsx(N.Drawer.Viewport,{ref:e,className:s("gryt-drawer-viewport fixed inset-0 z-50 flex",gr[a],t),...r})}),br=c.forwardRef(function({className:t,...r},e){const a=c.useContext(se);return n.jsx(N.Drawer.Popup,{ref:e,className:s("gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text","overflow-y-auto overscroll-contain outline-none","transition-transform duration-(--gryt-dur-spring-soft) ease-spring","data-swiping:duration-0 data-swiping:select-none","motion-reduce:transition-none",yr[a],fr[a],t),...r})}),xr=c.forwardRef(function({className:t,...r},e){return n.jsx(N.Drawer.Backdrop,{ref:e,className:s("gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","[opacity:calc(1-var(--drawer-swipe-progress,0))]","transition-opacity duration-(--gryt-dur-spring-soft) ease-spring","data-swiping:duration-0","data-starting-style:opacity-0 data-ending-style:opacity-0","motion-reduce:transition-none",t),...r})});function hr({className:o}){const t=c.useContext(se);return t!=="bottom"&&t!=="top"?null:n.jsx("div",{"aria-hidden":!0,className:s("gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border",t==="top"&&"order-last",o)})}const wr={Root:pr,Trigger:N.Drawer.Trigger,Portal:N.Drawer.Portal,Backdrop:xr,Viewport:mr,Popup:br,Content:N.Drawer.Content,Grabber:hr,Close:N.Drawer.Close,Title:N.Drawer.Title,Description:N.Drawer.Description},vr=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(H.Menu.Positioner,{ref:a,sideOffset:r,className:s("gryt-menu-positioner outline-none",t),...e})}),jr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Popup,{ref:e,className:s("gryt-menu min-w-44 p-1 outline-none",F,D,t),...r})}),Rr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Item,{ref:e,className:s("gryt-menu-item flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-disabled:cursor-not-allowed data-disabled:opacity-50",t),...r})}),Nr=c.forwardRef(function({className:t,...r},e){return n.jsx(H.Menu.Separator,{ref:e,className:s("gryt-menu-separator my-1 h-px bg-gryt-border",t),...r})}),te={Root:H.Menu.Root,Trigger:H.Menu.Trigger,Portal:H.Menu.Portal,Positioner:vr,Popup:jr,Item:Rr,Separator:Nr},Tr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Root,{ref:e,className:s("gryt-tabs","data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch",t),...r})}),Pr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.List,{ref:e,className:s("gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1","data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0","data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch","data-[orientation=vertical]:rounded-(--gryt-radius-lg)",t),...r})}),ze=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Tab,{ref:e,className:s("gryt-tab inline-flex min-h-8 items-center justify-center whitespace-nowrap","rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5","text-sm font-medium text-gryt-muted select-none","relative z-10 transition-colors duration-150 hover:text-gryt-text","data-active:text-gryt-on-accent","data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start","data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3","data-[orientation=vertical]:rounded-(--gryt-radius-md)",x,t),...r})}),Cr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Indicator,{ref:e,renderBeforeHydration:!0,className:s("gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]","w-(--active-tab-width) translate-x-(--active-tab-left)","rounded-(--gryt-radius-full) bg-gryt-accent","transition-[translate,width] duration-(--gryt-dur-spring) ease-spring","motion-reduce:transition-none","[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1","[[data-orientation=vertical]_&]:h-(--active-tab-height)","[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]","[[data-orientation=vertical]_&]:translate-x-0","[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)","[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)","[[data-orientation=vertical]_&]:transition-[translate,height]",t),...r})}),kr=c.forwardRef(function({className:t,...r},e){return n.jsx(Z.Tabs.Panel,{ref:e,className:s("gryt-tabs-panel pt-3 text-sm text-gryt-text","data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1","data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4",t),...r})}),Sr=Object.assign(Tr,{List:Pr,Tab:ze,Panel:kr,Indicator:Cr}),Mr=c.forwardRef(function({className:t,...r},e){return n.jsx(W.Accordion.Root,{ref:e,className:s("gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2",t),...r})}),Ar=c.forwardRef(function({className:t,...r},e){return n.jsx(W.Accordion.Item,{ref:e,className:s("gryt-accordion-item",t),...r})}),Lr=c.forwardRef(function({children:t,className:r,expandIcon:e,...a},i){return n.jsx(W.Accordion.Header,{className:"gryt-accordion-header m-0",children:n.jsxs(W.Accordion.Trigger,{ref:i,className:s("gryt-accordion-trigger flex w-full items-center justify-between gap-3","rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5","text-left text-sm font-medium text-gryt-text select-none","transition-colors duration-150 hover:bg-gryt-surface-raised",x,r),...a,children:[t,e===void 0?n.jsx(k.CaretDown,{size:16,className:"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none"}):e]})})}),$r=c.forwardRef(function({children:t,className:r,...e},a){return n.jsx(W.Accordion.Panel,{ref:a,className:s("gryt-accordion-panel overflow-hidden text-sm text-gryt-muted","h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",r),...e,children:n.jsx("div",{className:"px-3 pt-1 pb-3",children:t})})}),Dr=Object.assign(Mr,{Item:Ar,Trigger:Lr,Panel:$r}),Ir=c.forwardRef(function({className:t,sideOffset:r=2,...e},a){return n.jsx(A.ContextMenu.Positioner,{ref:a,sideOffset:r,className:s("gryt-context-menu-positioner outline-none",t),...e})}),Gr={Root:A.ContextMenu.Root,Trigger:A.ContextMenu.Trigger,Portal:A.ContextMenu.Portal,Positioner:Ir,Popup:te.Popup,Item:te.Item,Separator:te.Separator,Group:A.ContextMenu.Group,GroupLabel:A.ContextMenu.GroupLabel,SubmenuRoot:A.ContextMenu.SubmenuRoot,SubmenuTrigger:A.ContextMenu.SubmenuTrigger},Hr=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(S.Popover.Positioner,{ref:a,sideOffset:r,className:s("gryt-popover-positioner outline-none",t),...e})}),Fr=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Popup,{ref:e,className:s("gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none",F,D,t),...r})}),Er=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Title,{ref:e,className:s("gryt-popover-title text-sm font-semibold text-gryt-text",t),...r})}),_r=c.forwardRef(function({className:t,...r},e){return n.jsx(S.Popover.Description,{ref:e,className:s("gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted",t),...r})}),qr={Root:S.Popover.Root,Trigger:S.Popover.Trigger,Portal:S.Popover.Portal,Positioner:Hr,Popup:Fr,Title:Er,Description:_r,Close:S.Popover.Close,Arrow:S.Popover.Arrow},Br={neutral:"border-white/8 bg-gryt-surface",info:"border-gryt-secondary-6 bg-gryt-secondary-2",success:"border-gryt-success-6 bg-gryt-success-2",warning:"border-gryt-warning-6 bg-gryt-warning-2",danger:"border-gryt-danger-6 bg-gryt-danger-2"},zr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Viewport,{ref:e,className:s("gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]","flex-col gap-2 outline-none",t),...r})}),Vr=c.forwardRef(function({className:t,severity:r="neutral",...e},a){return n.jsx(M.Toast.Root,{ref:a,className:s("gryt-toast relative flex flex-col p-3 pr-9","rounded-(--gryt-radius-xl) border text-gryt-text",Br[r],"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring","data-starting-style:translate-y-2 data-starting-style:opacity-0","data-ending-style:translate-y-2 data-ending-style:opacity-0","motion-reduce:transition-none",t),...e})}),Yr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Title,{ref:e,className:s("gryt-toast-title text-sm font-semibold text-gryt-text",t),...r})}),Or=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Description,{ref:e,className:s("gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted",t),...r})}),Ur=c.forwardRef(function({className:t,children:r,...e},a){return n.jsx(M.Toast.Close,{ref:a,"aria-label":"Close",className:s("gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center","rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted","transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...e,children:r??n.jsx(k.X,{size:14,weight:"bold"})})}),Xr=c.forwardRef(function({className:t,...r},e){return n.jsx(M.Toast.Action,{ref:e,className:s("gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0","bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent","transition-[scale] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light",t),...r})}),Kr={Provider:M.Toast.Provider,Portal:M.Toast.Portal,Viewport:zr,Root:Vr,Title:Yr,Description:Or,Close:Ur,Action:Xr},Wr=M.Toast.useToastManager,Jr=c.forwardRef(function({className:t,...r},e){return n.jsx(B.ScrollArea.Root,{ref:e,className:s("gryt-scroll-area relative",t),...r})}),Qr=c.forwardRef(function({className:t,...r},e){return n.jsx(B.ScrollArea.Viewport,{ref:e,className:s("gryt-scroll-area-viewport h-full w-full overscroll-contain","focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light",t),...r})}),Zr=c.forwardRef(function({className:t,orientation:r,...e},a){return n.jsx(B.ScrollArea.Scrollbar,{ref:a,orientation:r,className:s("gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none","opacity-0 transition-opacity duration-(--gryt-dur-fast)","data-hovering:opacity-100 data-scrolling:opacity-100","motion-reduce:transition-none",r==="horizontal"?"h-2 flex-col":"w-2",t),...e,children:n.jsx(B.ScrollArea.Thumb,{className:"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none"})})}),eo={Root:Jr,Viewport:Qr,Scrollbar:Zr,Content:B.ScrollArea.Content,Corner:B.ScrollArea.Corner},to={primary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent","data-pressed:hover:not-data-disabled:bg-gryt-accent"].join(" "),secondary:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary","data-pressed:hover:not-data-disabled:bg-gryt-secondary"].join(" "),neutral:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text"].join(" "),danger:["text-gryt-muted hover:not-data-disabled:bg-white/8","data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger","data-pressed:hover:not-data-disabled:bg-gryt-danger"].join(" ")},ro={xsmall:"h-8 min-w-8 px-2 text-xs",small:"h-9 min-w-9 px-2.5 text-sm",medium:"h-10 min-w-10 px-3 text-sm",large:"h-12 min-w-12 px-4 text-base"},oo=c.forwardRef(function({className:t,size:r="medium",tone:e="primary",...a},i){return n.jsx(We.Toggle,{ref:i,className:s("gryt-toggle","inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent","rounded-(--gryt-radius-full) font-medium select-none","transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring","motion-safe:hover:not-data-disabled:scale-[1.06]","motion-safe:active:not-data-disabled:scale-[0.94]",x,V,ro[r],to[e],t),...a})}),no=c.forwardRef(function({className:t,...r},e){return n.jsx(Je.ToggleGroup,{ref:e,className:s("gryt-toggle-group inline-flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...r})}),ao={primary:"bg-gryt-accent",success:"bg-gryt-success",warning:"bg-gryt-warning",danger:"bg-gryt-danger"};function so({className:o,value:t,label:r,showValue:e=!1,tone:a="primary",...i}){return n.jsxs(O.Meter.Root,{value:t,className:s("gryt-meter flex w-full flex-col gap-1.5",o),...i,children:[(r||e)&&n.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[r?n.jsx(O.Meter.Label,{className:"text-sm text-gryt-muted",children:r}):n.jsx("span",{}),e&&n.jsx(O.Meter.Value,{className:"font-mono text-xs text-gryt-muted tabular-nums"})]}),n.jsx(O.Meter.Track,{className:"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised",children:n.jsx(O.Meter.Indicator,{className:s("h-full rounded-(--gryt-radius-full)","transition-[width] duration-120 ease-out motion-reduce:transition-none",ao[a])})})]})}const io=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Popup,{ref:e,className:s("gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2","flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4","rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text","outline-none","transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:scale-[0.98] data-starting-style:opacity-0","data-ending-style:scale-[0.98] data-ending-style:opacity-0",t),...r})}),co=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Backdrop,{ref:e,className:s("gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60","backdrop-blur-(--gryt-backdrop-blur)","transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none","data-starting-style:opacity-0 data-ending-style:opacity-0",t),...r})}),lo=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Title,{ref:e,className:s("gryt-alert-dialog-title text-lg font-semibold text-gryt-text",t),...r})}),uo=c.forwardRef(function({className:t,...r},e){return n.jsx($.AlertDialog.Description,{ref:e,className:s("gryt-alert-dialog-description text-sm leading-6 text-gryt-muted",t),...r})}),go={Root:$.AlertDialog.Root,Trigger:$.AlertDialog.Trigger,Portal:$.AlertDialog.Portal,Backdrop:co,Popup:io,Title:lo,Description:uo,Close:$.AlertDialog.Close},Ve=["flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)","px-3 py-2 text-sm text-gryt-text outline-none select-none","data-highlighted:bg-gryt-surface-raised","data-selected:text-gryt-accent-11","data-disabled:cursor-not-allowed data-disabled:opacity-50"].join(" "),Ye=[He,Fe.medium,"border-gryt-border",x].join(" "),fo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Input,{ref:e,className:s("gryt-combobox-input",Ye,t),...r})}),yo=c.forwardRef(function({className:t,sideOffset:r=6,...e},a){return n.jsx(m.Combobox.Positioner,{ref:a,sideOffset:r,className:s("gryt-combobox-positioner outline-none",t),...e})}),po=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Popup,{ref:e,className:s("gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",F,D,t),...r})}),mo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Item,{ref:e,className:s("gryt-combobox-item",Ve,t),...r})}),bo=c.forwardRef(function({className:t,...r},e){return n.jsx(m.Combobox.Empty,{ref:e,className:s("gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted",t),...r})}),xo={Root:m.Combobox.Root,Input:fo,InputGroup:m.Combobox.InputGroup,Trigger:m.Combobox.Trigger,Icon:m.Combobox.Icon,Clear:m.Combobox.Clear,Value:m.Combobox.Value,Chips:m.Combobox.Chips,Chip:m.Combobox.Chip,ChipRemove:m.Combobox.ChipRemove,Portal:m.Combobox.Portal,Positioner:yo,Popup:po,List:m.Combobox.List,Item:mo,ItemIndicator:m.Combobox.ItemIndicator,Group:m.Combobox.Group,GroupLabel:m.Combobox.GroupLabel,Empty:bo,Separator:m.Combobox.Separator},ho=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Input,{ref:e,className:s("gryt-autocomplete-input",Ye,t),...r})}),wo=c.forwardRef(function({className:t,sideOffset:r=6,...e},a){return n.jsx(b.Autocomplete.Positioner,{ref:a,sideOffset:r,className:s("gryt-autocomplete-positioner outline-none",t),...e})}),vo=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Popup,{ref:e,className:s("gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none",F,D,t),...r})}),jo=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Item,{ref:e,className:s("gryt-autocomplete-item",Ve,t),...r})}),Ro=c.forwardRef(function({className:t,...r},e){return n.jsx(b.Autocomplete.Empty,{ref:e,className:s("gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted",t),...r})}),No={Root:b.Autocomplete.Root,Input:ho,InputGroup:b.Autocomplete.InputGroup,Trigger:b.Autocomplete.Trigger,Icon:b.Autocomplete.Icon,Clear:b.Autocomplete.Clear,Value:b.Autocomplete.Value,Portal:b.Autocomplete.Portal,Positioner:wo,Popup:vo,List:b.Autocomplete.List,Item:jo,Group:b.Autocomplete.Group,GroupLabel:b.Autocomplete.GroupLabel,Empty:Ro,Separator:b.Autocomplete.Separator},To=c.forwardRef(function({className:t,...r},e){return n.jsx(Qe.CheckboxGroup,{ref:e,className:s("gryt-checkbox-group flex flex-col gap-2",t),...r})}),Po=c.forwardRef(function({className:t,...r},e){return n.jsx(ge.Collapsible.Trigger,{ref:e,className:s("gryt-collapsible-trigger flex w-full items-center justify-between gap-2","rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left","text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",x,t),...r})}),Co=c.forwardRef(function({className:t,...r},e){return n.jsx(ge.Collapsible.Panel,{ref:e,className:s("gryt-collapsible-panel overflow-hidden","h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring","data-starting-style:h-0 data-ending-style:h-0","motion-reduce:transition-none",t),...r})}),ko={Root:ge.Collapsible.Root,Trigger:Po,Panel:Co},So=c.forwardRef(function({className:t,...r},e){return n.jsx(Ze.Form,{ref:e,className:s("gryt-form flex flex-col gap-(--gryt-space-lg)",t),...r})}),Mo=c.forwardRef(function({className:t,...r},e){return n.jsx(Pe.Fieldset.Root,{ref:e,className:s("gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0",t),...r})}),Ao=c.forwardRef(function({className:t,...r},e){return n.jsx(Pe.Fieldset.Legend,{ref:e,className:s("gryt-fieldset-legend text-sm font-semibold text-gryt-text",t),...r})}),Lo={Root:Mo,Legend:Ao},$o=c.forwardRef(function({className:t,...r},e){return n.jsx(et.Menubar,{ref:e,className:s("gryt-menubar flex items-center gap-1","rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1",t),...r})}),Do=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Trigger,{ref:e,className:s("gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)","border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none","data-popup-open:bg-gryt-surface-raised",x,t),...r})}),Io=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Popup,{ref:e,className:s("gryt-navigation-menu-popup outline-none",F,D,t),...r})}),Go=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Viewport,{ref:e,className:s("gryt-navigation-menu-viewport relative overflow-hidden",t),...r})}),Ho=c.forwardRef(function({className:t,...r},e){return n.jsx(v.NavigationMenu.Link,{ref:e,className:s("gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2","text-sm text-gryt-text no-underline outline-none","transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none",x,t),...r})}),Fo={Root:v.NavigationMenu.Root,List:v.NavigationMenu.List,Item:v.NavigationMenu.Item,Trigger:Do,Content:v.NavigationMenu.Content,Portal:v.NavigationMenu.Portal,Positioner:v.NavigationMenu.Positioner,Viewport:Go,Popup:Io,Link:Ho,Icon:v.NavigationMenu.Icon,Arrow:v.NavigationMenu.Arrow},Ne="flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50",Eo=c.forwardRef(function({className:t,label:r,scrubbable:e=!1,...a},i){return n.jsxs(I.NumberField.Root,{ref:i,className:s("gryt-number-field flex flex-col gap-1.5",t),...a,children:[r&&(e?n.jsxs(I.NumberField.ScrubArea,{className:"cursor-ew-resize text-sm text-gryt-muted select-none",children:[r,n.jsx(I.NumberField.ScrubAreaCursor,{})]}):n.jsx("span",{className:"text-sm text-gryt-muted",children:r})),n.jsxs(I.NumberField.Group,{className:s("flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)","border border-gryt-border bg-gryt-surface-raised","focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light",V),children:[n.jsx(I.NumberField.Decrement,{"aria-label":"Decrease",className:s(Ne,"rounded-l-(--gryt-radius-full)"),children:n.jsx(k.Minus,{size:14,weight:"bold"})}),n.jsx(I.NumberField.Input,{className:s("w-16 border-0 bg-transparent px-1 py-2 text-center","font-mono text-sm text-gryt-text tabular-nums outline-none",x)}),n.jsx(I.NumberField.Increment,{"aria-label":"Increase",className:s(Ne,"rounded-r-(--gryt-radius-full)"),children:n.jsx(k.Plus,{size:14,weight:"bold"})})]})]})}),_o=c.forwardRef(function({className:t,length:r=6,...e},a){return n.jsx(ve.OTPField.Root,{ref:a,length:r,className:s("gryt-otp-field flex gap-2",t),...e,children:Array.from({length:r},(i,l)=>n.jsx(ve.OTPField.Input,{className:s("gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center","border border-gryt-border bg-gryt-surface-raised","font-mono text-lg text-gryt-text tabular-nums outline-none","transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none","data-filled:border-gryt-accent",x)},l))})}),qo=c.forwardRef(function({className:t,sideOffset:r=8,...e},a){return n.jsx(E.PreviewCard.Positioner,{ref:a,sideOffset:r,className:s("gryt-preview-card-positioner outline-none",t),...e})}),Bo=c.forwardRef(function({className:t,...r},e){return n.jsx(E.PreviewCard.Popup,{ref:e,className:s("gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none",F,D,t),...r})}),zo={Root:E.PreviewCard.Root,Trigger:E.PreviewCard.Trigger,Portal:E.PreviewCard.Portal,Positioner:qo,Popup:Bo,Arrow:E.PreviewCard.Arrow},Vo=c.forwardRef(function({className:t,...r},e){return n.jsx(_.Toolbar.Root,{ref:e,className:s("gryt-toolbar flex items-center gap-1","rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1",t),...r})}),Yo=c.forwardRef(function({className:t,...r},e){return n.jsx(_.Toolbar.Separator,{ref:e,className:s("gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border",t),...r})}),Oo={Root:Vo,Group:_.Toolbar.Group,Button:_.Toolbar.Button,Link:_.Toolbar.Link,Input:_.Toolbar.Input,Separator:Yo};exports.Accordion=Dr;exports.Alert=Zt;exports.AlertDialog=go;exports.Autocomplete=No;exports.Avatar=_e;exports.Badge=It;exports.Button=Ge;exports.Card=Xt;exports.CardActions=Jt;exports.CardContent=Wt;exports.CardHeader=Kt;exports.Checkbox=Ft;exports.CheckboxGroup=To;exports.Chip=Ht;exports.Collapsible=ko;exports.Combobox=xo;exports.Composer=Lt;exports.ContextMenu=Gr;exports.ConversationItem=Dt;exports.Dialog=lr;exports.Divider=Ut;exports.Drawer=wr;exports.Fieldset=Lo;exports.Form=So;exports.GRYT_HUE_KEYS=Q;exports.GRYT_NEUTRAL_KEYS=fe;exports.GRYT_RADIUS_KEYS=oe;exports.GRYT_THEME_NAME_MAX=$e;exports.GrytProvider=ft;exports.IconButton=kt;exports.Menu=te;exports.Menubar=$o;exports.MessageBubble=Mt;exports.Meter=so;exports.NavigationMenu=Fo;exports.NumberField=Eo;exports.OtpField=_o;exports.Popover=qr;exports.PreviewCard=zo;exports.Progress=er;exports.Radio=Et;exports.RadioGroup=_t;exports.ScrollArea=eo;exports.Select=Vt;exports.Skeleton=or;exports.Slider=Bt;exports.Spinner=tr;exports.Surface=St;exports.Switch=qt;exports.Tab=ze;exports.Tabs=Sr;exports.TextField=At;exports.Toast=Kr;exports.Toggle=oo;exports.ToggleGroup=no;exports.Toolbar=Oo;exports.Tooltip=Yt;exports.TooltipProvider=Ot;exports.cloneGrytTheme=ye;exports.cn=s;exports.contrast=lt;exports.createGrytTheme=Le;exports.decodeGrytTheme=bt;exports.encodeGrytTheme=mt;exports.grytAlphaScales=dt;exports.grytAlphaScalesLight=ut;exports.grytLightTokens=R;exports.grytScales=ue;exports.grytScalesLight=re;exports.grytTheme=q;exports.grytThemeHues=De;exports.grytThemeToOptions=yt;exports.grytTokens=u;exports.hexToOklch=z;exports.isHexColor=pe;exports.normalizeHexColor=ae;exports.normalizeThemeName=ne;exports.oklchToHex=C;exports.useMediaQuery=Be;exports.useToastManager=Wr;
2
2
  //# sourceMappingURL=index.cjs.map