tekivex-ui 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +12 -12
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1623 -1511
- package/dist/src/components/TkxConfigProvider.d.ts +100 -0
- package/dist/src/components/TkxConfigProvider.d.ts.map +1 -0
- package/dist/src/components/TkxEmpty.d.ts +870 -0
- package/dist/src/components/TkxEmpty.d.ts.map +1 -0
- package/dist/src/components/TkxForm.d.ts +54 -0
- package/dist/src/components/TkxForm.d.ts.map +1 -0
- package/dist/src/components/TkxLayout.d.ts +87 -0
- package/dist/src/components/TkxLayout.d.ts.map +1 -0
- package/dist/src/components/TkxSpin.d.ts +15 -0
- package/dist/src/components/TkxSpin.d.ts.map +1 -0
- package/dist/src/components/TkxStatistic.d.ts +1746 -0
- package/dist/src/components/TkxStatistic.d.ts.map +1 -0
- package/dist/src/components/TkxTypography.d.ts +2614 -0
- package/dist/src/components/TkxTypography.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +7 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/themes/index.d.ts +108 -0
- package/dist/src/themes/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/TkxConfigProvider.tsx +458 -0
- package/src/components/TkxEmpty.tsx +219 -0
- package/src/components/TkxForm.tsx +607 -0
- package/src/components/TkxLayout.tsx +647 -0
- package/src/components/TkxSpin.tsx +261 -0
- package/src/components/TkxStatistic.tsx +261 -0
- package/src/components/TkxTypography.tsx +263 -0
- package/src/components/index.ts +7 -0
- package/src/themes/index.ts +149 -0
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),t=require("react/jsx-runtime"),Be=require("react-dom"),
|
|
2
|
-
`)}function go(){Et.clear()}function sn(){if(typeof document>"u")return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=lr()}const bo={css:tn,fromObject:rn,responsive:nn,keyframes:on,cssVar:ar,extractCSS:lr,injectStyles:sn,resetStyles:go};function yo(e){const r=e.replace("#",""),n=r.length===3?r.split("").map(l=>l+l).join(""):r,i=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[i,s,a]}function vr(e){const[r,n,i]=yo(e).map(s=>{const a=s/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*r+.7152*n+.0722*i}function it(e,r){const n=vr(e),i=vr(r),s=Math.max(n,i),a=Math.min(n,i);return(s+.05)/(a+.05)}function zt(e,r,n=!1){return it(e,r)>=(n?3:4.5)}function an(e,r,n=!1){return it(e,r)>=(n?4.5:7)}function Ue(e,r){const i=r??["#ffffff","#000000"];return i.reduce((s,a)=>it(a,e)>it(s,e)?a:s,i[0])}function ln(){const e=document.createElement("div"),r=document.createElement("div");for(const n of[e,r])n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n);return e.setAttribute("aria-live","polite"),r.setAttribute("aria-live","assertive"),{announce(n,i="polite"){const s=i==="assertive"?r:e;s.textContent="",setTimeout(()=>{s.textContent=n},0)},destroy(){e.remove(),r.remove()}}}const vo=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function cr(e){let r=null,n=null;function i(){return Array.from(e.querySelectorAll(vo)).filter(s=>!s.closest("[hidden]")&&!s.closest('[aria-hidden="true"]'))}return{activate(){r=document.activeElement;const s=i();s.length>0&&s[0].focus(),n=a=>{if(a.key!=="Tab")return;const l=i();if(l.length===0)return;const d=l[0],u=l[l.length-1];a.shiftKey?document.activeElement===d&&(a.preventDefault(),u.focus()):document.activeElement===u&&(a.preventDefault(),d.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),r instanceof HTMLElement&&r.focus(),r=null,n=null}}}function cn(e,r,n,i){let s=r;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),s=r===0?n-1:r-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),s=r===n-1?0:r+1;break;case"Home":e.preventDefault(),s=0;break;case"End":e.preventDefault(),s=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;default:return}i(s)}function ko(e,r,n,i,s){let a=r;switch(e.key){case"ArrowUp":e.preventDefault(),a=r===0?n-1:r-1;break;case"ArrowDown":e.preventDefault(),a=r===n-1?0:r+1;break;case"Home":e.preventDefault(),a=0;break;case"End":e.preventDefault(),a=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;case"Escape":e.preventDefault(),s==null||s();return;default:return}i(a)}function dr(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function ur(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function wo(e,r="polite"){if(typeof document>"u")return;let n=document.getElementById("tkx-live-region");n||(n=document.createElement("div"),n.id="tkx-live-region",n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n)),n.textContent="",setTimeout(()=>{n&&(n.textContent=e)},0)}const jo={contrastRatio:it,meetsAA:zt,meetsAAA:an,getAccessibleForeground:Ue,createAnnouncer:ln,createFocusTrap:cr,handleTabsKeyboard:cn,handleMenuKeyboard:ko,prefersReducedMotion:dr,prefersHighContrast:ur,announce:wo},fr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},So={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},$o=/^#[0-9a-fA-F]{3,8}$/;function Mo(e,r){const n={...e,...r};for(const[i,s]of Object.entries(n))if(!$o.test(s))throw new Error(`Invalid hex color for theme token '${i}': ${s}`);return zt(n.text,n.bg)||console.warn(`[TekiVex] Theme contrast warning: text (${n.text}) vs bg (${n.bg}) does not meet WCAG AA minimum (4.5:1)`),zt(n.primary,n.bg)||console.warn(`[TekiVex] Theme contrast warning: primary (${n.primary}) vs bg (${n.bg}) does not meet WCAG AA minimum`),n}const pr=c.createContext(fr);function Co({theme:e=fr,children:r}){return c.useEffect(()=>{const n=Object.entries(e).map(([s,a])=>ar(s,a)).join(" ");let i=document.getElementById("tkx-theme");i||(i=document.createElement("style"),i.id="tkx-theme",document.head.appendChild(i)),i.textContent=`:root { ${n} }`},[e]),c.createElement(pr.Provider,{value:e},r)}function ee(){return c.useContext(pr)}const To={"<":"<",">":">","&":"&","'":"'",'"':"""};function B(e){return String(e).replace(/[<>&'"]/g,r=>To[r]??r)}function xr(e){const r={};for(const n of Object.keys(e))r[n]=dn(e[n]);return r}function dn(e){return typeof e=="string"?B(e):Array.isArray(e)?e.map(dn):e!==null&&typeof e=="object"&&!Io(e)?xr(e):e}function Io(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function At(e,r){const n=[];for(const[i,s]of Object.entries(r)){const a=e[i],l=a==null;if(s.required&&l){n.push(`prop '${i}' is required`);continue}if(!l){if(typeof a!==s.type){n.push(`prop '${i}' must be of type ${s.type}, got ${typeof a}`);continue}s.type==="number"&&typeof a=="number"&&(s.min!==void 0&&a<s.min&&n.push(`prop '${i}' must be >= ${s.min}`),s.max!==void 0&&a>s.max&&n.push(`prop '${i}' must be <= ${s.max}`)),s.type==="string"&&typeof a=="string"&&s.pattern&&!s.pattern.test(a)&&n.push(`prop '${i}' does not match pattern ${s.pattern}`),s.enum&&!s.enum.includes(a)&&n.push(`prop '${i}' must be one of: ${s.enum.join(", ")}`)}}return{valid:n.length===0,errors:n}}const un=new Map;function Eo(e,r){const n={"default-src":["'self'"],"style-src":r.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":r.allowDataUrls?["'self'","data:"]:r.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":r.allowScripts?["'self'"]:["'none'"]},i={componentId:e,permissions:r,directives:n};return un.set(e,i),i}function zo(e,r){const n=un.get(e);return(n==null?void 0:n.permissions[r])===!0}let Je=[];function fn(e,r,n){const i=tt(JSON.stringify(n??{})),s=Je.length>0?Je[Je.length-1].chainHash:"00000000",a=tt(s+i+r+e),l=Object.freeze({timestamp:Date.now(),component:r,action:e,propsHash:i,chainHash:a});return Je=Object.freeze([...Je,l]),l}function pn(e){let r=Je;return e!=null&&e.component&&(r=r.filter(n=>n.component===e.component)),e!=null&&e.action&&(r=r.filter(n=>n.action===e.action)),e!=null&&e.limit&&(r=r.slice(-e.limit)),r}function xn(){let e="00000000";for(const r of Je){if(tt(e+r.propsHash+r.component+r.action)!==r.chainHash)return!1;e=r.chainHash}return!0}const No={sanitize:B,sanitizeProps:xr,validateProps:At,createCSP:Eo,hasPermission:zo,audit:fn,getAuditLog:pn,verifyAuditIntegrity:xn};function ye(){const[e,r]=c.useState(()=>typeof window>"u"?!1:dr());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function Ro(){const[e,r]=c.useState(()=>typeof window>"u"?!1:ur());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(forced-colors: active)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function Dt(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=cr(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function hr(){const e=c.useRef(null);return c.useEffect(()=>{if(!(typeof document>"u"))return e.current=ln(),()=>{var r;(r=e.current)==null||r.destroy()}},[]),c.useCallback((r,n="polite")=>{var i;(i=e.current)==null||i.announce(r,n)},[])}function Lt(e,r=!0){const n=c.useRef(e);n.current=e,c.useEffect(()=>{if(!r||typeof document>"u")return;const i=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r])}function hn(e,r){const n=c.useRef(r);n.current=r,c.useEffect(()=>{const i=s=>{!e.current||e.current.contains(s.target)||n.current()};return document.addEventListener("pointerdown",i),()=>document.removeEventListener("pointerdown",i)},[e])}const he={0:"0",px:"1px","0.5":"2px",1:"4px","1.5":"6px",2:"8px","2.5":"10px",3:"12px","3.5":"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},kr={...he,screen:"100vh"},We={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},$t={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},wr={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},Ao={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},Do={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Lo={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},Fo={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Mt={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Po=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),mn=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Bo={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ae(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Pe(e){if(mn.has(e))return`var(--tkx-${e})`;if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="white")return"#ffffff";if(e==="black")return"#000000";if(e==="inherit")return"inherit";const r=ae(e);return r||e}function Wo(e){const r=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(r)return{[r[1]]:r[2]};const n={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(n[e])return{display:n[e]};const i={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(i[e])return{"flex-direction":i[e]};const s={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(s[e])return{"flex-wrap":s[e]};const a={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(a[e])return{flex:a[e]};if(e==="grow"||e==="flex-grow")return{"flex-grow":"1"};if(e==="grow-0")return{"flex-grow":"0"};if(e==="shrink"||e==="flex-shrink")return{"flex-shrink":"1"};if(e==="shrink-0"||e==="flex-shrink-0")return{"flex-shrink":"0"};const l={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(l[e])return{"align-items":l[e]};const d={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(d[e])return{"justify-content":d[e]};const u={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(u[e])return{"align-self":u[e]};const x={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(x[e])return{"align-content":x[e]};let o;if(o=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^col-span-(full|\d+)$/))return{"grid-column":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":o[1]};if(o=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":o[1]};if(o=e.match(/^row-span-(full|\d+)$/))return{"grid-row":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":o[1]};if(o=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":o[1]};if(e==="grid-flow-row")return{"grid-auto-flow":"row"};if(e==="grid-flow-col")return{"grid-auto-flow":"column"};if(e==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(e==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(e==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(o=e.match(/^p-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{padding:f}}if(o=e.match(/^px-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f,"padding-right":f}}if(o=e.match(/^py-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f,"padding-bottom":f}}if(o=e.match(/^pt-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f}}if(o=e.match(/^pr-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-right":f}}if(o=e.match(/^pb-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-bottom":f}}if(o=e.match(/^pl-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f}}if(o=e.match(/^-?m-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{margin:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mx-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const S=f&&g!=="0"?`-${g}`:g;return{"margin-left":S,"margin-right":S}}}if(o=e.match(/^-?my-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const S=f&&g!=="0"?`-${g}`:g;return{"margin-top":S,"margin-bottom":S}}}if(o=e.match(/^-?mt-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-top":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mr-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-right":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mb-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-bottom":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?ml-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-left":f&&g!=="0"?`-${g}`:g}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(o=e.match(/^gap-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{gap:f}}if(o=e.match(/^gap-x-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"column-gap":f}}if(o=e.match(/^gap-y-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"row-gap":f}}if(o=e.match(/^w-(.+)$/)){const f=o[1],g=he[f]??We[f]??ae(f);if(g)return{width:g}}if(o=e.match(/^min-w-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"min-width":f}}if(o=e.match(/^max-w-(.+)$/)){const g={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"max-width":g}}if(o=e.match(/^h-(.+)$/)){const f=o[1],g=kr[f]??We[f]??ae(f);if(g)return{height:g}}if(o=e.match(/^min-h-(.+)$/)){const g={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"min-height":g}}if(o=e.match(/^max-h-(.+)$/)){const f=kr[o[1]]??ae(o[1]);if(f)return{"max-height":f}}if(o=e.match(/^size-(.+)$/)){const f=he[o[1]]??We[o[1]]??ae(o[1]);if(f)return{width:f,height:f}}if(o=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[f,g]=Ao[o[1]]??["1rem","1.5rem"];return{"font-size":f,"line-height":g}}if(o=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Do[o[1]]??o[1]};if(o=e.match(/^leading-(.+)$/)){const f=Lo[o[1]]??ae(o[1]);if(f)return{"line-height":f}}if(o=e.match(/^tracking-(.+)$/)){const f=Fo[o[1]]??ae(o[1]);if(f)return{"letter-spacing":f}}const m={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(m[e])return{"text-align":m[e]};if(e==="italic")return{"font-style":"italic"};if(e==="not-italic")return{"font-style":"normal"};if(e==="uppercase")return{"text-transform":"uppercase"};if(e==="lowercase")return{"text-transform":"lowercase"};if(e==="capitalize")return{"text-transform":"capitalize"};if(e==="normal-case")return{"text-transform":"none"};if(e==="underline")return{"text-decoration-line":"underline"};if(e==="overline")return{"text-decoration-line":"overline"};if(e==="line-through")return{"text-decoration-line":"line-through"};if(e==="no-underline")return{"text-decoration-line":"none"};if(e==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(e==="text-ellipsis")return{"text-overflow":"ellipsis"};if(e==="text-clip")return{"text-overflow":"clip"};if(e==="whitespace-normal")return{"white-space":"normal"};if(e==="whitespace-nowrap")return{"white-space":"nowrap"};if(e==="whitespace-pre")return{"white-space":"pre"};if(e==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(e==="whitespace-pre-line")return{"white-space":"pre-line"};if(e==="break-words")return{"overflow-wrap":"break-word"};if(e==="break-all")return{"word-break":"break-all"};if(e==="break-keep")return{"word-break":"keep-all"};if(e==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(e==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(e==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(e==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(o=e.match(/^indent-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"text-indent":f}}if(o=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":o[1],"-webkit-box-orient":"vertical"};if(o=e.match(/^text-(.+)$/)){const[f,g]=o[1].split("/"),S=Pe(f);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(f)){if(g){const F=parseInt(g)/100;return{color:S,opacity:String(F)}}return{color:S}}}if(o=e.match(/^bg-(.+)$/)){const[f,g]=o[1].split("/"),S=Pe(f);return g?{"background-color":S,opacity:String(parseInt(g)/100)}:f==="none"?{background:"none"}:{"background-color":S}}if(o=e.match(/^border-color-(.+)$/))return{"border-color":Pe(o[1])};if(o=e.match(/^fill-(.+)$/))return{fill:Pe(o[1])};if(o=e.match(/^stroke-(.+)$/))return{stroke:Pe(o[1])};if(o=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Pe(o[1])};if(o=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Pe(o[1])};if(o=e.match(/^accent-(.+)$/))return{"accent-color":Pe(o[1])};if(o=e.match(/^caret-(.+)$/))return{"caret-color":Pe(o[1])};if(o=e.match(/^outline-color-(.+)$/))return{"outline-color":Pe(o[1])};if(e==="border")return{"border-width":"1px"};if(o=e.match(/^border-(\d+)$/))return{"border-width":`${o[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(o=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${o[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(o=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${o[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(o=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${o[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(o=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${o[1]}px`};if(e==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(e==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(e==="border-none")return{"border-style":"none"};if(e==="border-solid")return{"border-style":"solid"};if(e==="border-dashed")return{"border-style":"dashed"};if(e==="border-dotted")return{"border-style":"dotted"};if(e==="border-double")return{"border-style":"double"};if((o=e.match(/^border-([a-zA-Z].*)$/))&&mn.has(o[1]))return{"border-color":`var(--tkx-${o[1]})`};if(o=e.match(/^border-\[(.+)]$/))return{"border-color":o[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":$t[""]};if(o=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":$t[o[1]]??ae(o[1])??o[1]};if(o=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const f=o[1],g=$t[o[2]??""]??$t[""];return{t:{"border-top-left-radius":g,"border-top-right-radius":g},r:{"border-top-right-radius":g,"border-bottom-right-radius":g},b:{"border-bottom-left-radius":g,"border-bottom-right-radius":g},l:{"border-top-left-radius":g,"border-bottom-left-radius":g},tl:{"border-top-left-radius":g},tr:{"border-top-right-radius":g},br:{"border-bottom-right-radius":g},bl:{"border-bottom-left-radius":g}}[f]??{}}const p={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(e==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((o=e.match(/^ring-(\d+)$/))&&p[o[1]])return{"box-shadow":`0 0 0 ${p[o[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(o=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${o[1]}px`,"box-shadow":`0 0 0 ${o[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":wr[""]};if(o=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":wr[o[1]]};if(o=e.match(/^opacity-(\d+)$/)){const f=Po[o[1]];if(f!==void 0)return{opacity:f}}if(e==="bg-none")return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const y={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(y[e])return{"background-position":y[e]};const z={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(z[e])return{"background-repeat":z[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${Mt[""]})`};if(o=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${Mt[o[1]]})`};if(e==="blur")return{filter:`blur(${Mt[""]})`};if(o=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${Mt[o[1]]})`};if(e==="grayscale")return{filter:"grayscale(100%)"};if(e==="grayscale-0")return{filter:"grayscale(0)"};if(e==="invert")return{filter:"invert(100%)"};if(e==="invert-0")return{filter:"invert(0)"};const v={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(v[e])return{position:v[e]};if(e==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(e==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(e==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(e==="inset-x-0")return{left:"0",right:"0"};if(e==="inset-y-0")return{top:"0",bottom:"0"};if(o=e.match(/^-?top-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{top:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?right-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{right:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?bottom-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{bottom:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?left-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{left:f&&g!=="0"?`-${g}`:g}}const $={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(o=e.match(/^z-(.+)$/)){const f=$[o[1]]??ae(o[1]);if(f)return{"z-index":f}}const w={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(w[e])return{overflow:w[e]};if(o=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${o[1]}`]:o[2]};if(e==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(e==="visible")return{visibility:"visible"};if(e==="invisible")return{visibility:"hidden"};if(e==="collapse")return{visibility:"collapse"};const C={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(C[e])return{cursor:C[e]};if(e==="select-none")return{"user-select":"none"};if(e==="select-text")return{"user-select":"text"};if(e==="select-all")return{"user-select":"all"};if(e==="select-auto")return{"user-select":"auto"};if(e==="pointer-events-none")return{"pointer-events":"none"};if(e==="pointer-events-auto")return{"pointer-events":"auto"};const I={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(o=e.match(/^scale-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scale(${f})`}}if(o=e.match(/^scale-x-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleX(${f})`}}if(o=e.match(/^scale-y-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleY(${f})`}}const R={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(o=e.match(/^-?rotate-(.+)$/)){const f=e.startsWith("-"),g=R[o[1]]??ae(o[1]);if(g)return{transform:f?`rotate(-${g})`:`rotate(${g})`}}if(o=e.match(/^-?translate-x-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{transform:`translateX(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?translate-y-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??We[o[1]]??ae(o[1]);if(g)return{transform:`translateY(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?skew-x-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewX(-${g})`:`skewX(${g})`}}if(o=e.match(/^-?skew-y-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewY(-${g})`:`skewY(${g})`}}const M={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(M[e])return{"transform-origin":M[e]};const N={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(N[e])return{"transition-property":N[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const T={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(o=e.match(/^duration-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-duration":f}}if(o=e.match(/^delay-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-delay":f}}const j={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(j[e])return{"transition-timing-function":j[e]};const k={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(k[e])return{animation:k[e]};const Y={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return Y[e]?{"object-fit":Y[e]}:e==="aspect-square"?{"aspect-ratio":"1 / 1"}:e==="aspect-video"?{"aspect-ratio":"16 / 9"}:e==="aspect-auto"?{"aspect-ratio":"auto"}:(o=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":o[1]}:e==="list-none"?{"list-style-type":"none"}:e==="list-disc"?{"list-style-type":"disc"}:e==="list-decimal"?{"list-style-type":"decimal"}:e==="list-inside"?{"list-style-position":"inside"}:e==="list-outside"?{"list-style-position":"outside"}:(o=e.match(/^columns-(\d+)$/))?{columns:o[1]}:e==="resize"?{resize:"both"}:e==="resize-none"?{resize:"none"}:e==="resize-x"?{resize:"horizontal"}:e==="resize-y"?{resize:"vertical"}:e==="sr-only"?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:e==="not-sr-only"?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:e==="focus-ring"?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:e==="appearance-none"?{appearance:"none"}:e==="outline-none"?{outline:"none"}:e==="outline"?{outline:"2px solid currentColor","outline-offset":"2px"}:e==="float-left"?{float:"left"}:e==="float-right"?{float:"right"}:e==="float-none"?{float:"none"}:e==="clear-both"?{clear:"both"}:e==="isolate"?{isolation:"isolate"}:e==="isolation-auto"?{isolation:"auto"}:(o=e.match(/^will-change-(.+)$/))?{"will-change":o[1]}:e==="touch-manipulation"?{"touch-action":"manipulation"}:e==="touch-none"?{"touch-action":"none"}:e==="touch-pan-x"?{"touch-action":"pan-x"}:e==="touch-pan-y"?{"touch-action":"pan-y"}:e==="scroll-smooth"?{"scroll-behavior":"smooth"}:e==="scroll-auto"?{"scroll-behavior":"auto"}:(o=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[o[1]]:o[2]}:null}function Ho(e){let r=0,n=-1;for(let i=0;i<e.length;i++)if(e[i]==="[")r++;else if(e[i]==="]")r--;else if(e[i]===":"&&r===0){n=i;break}return n===-1?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function jr(e,r){for(const[n,i]of Object.entries(r))e[n]=i}function _t(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const Nt=new Map;let He=null;function Vo(){return(!He||!He.isConnected)&&(He=document.getElementById("tkx-atomic"),He||(He=document.createElement("style"),He.id="tkx-atomic",document.head.appendChild(He))),He}function Oo(e,r){if(!Nt.has(e)&&(Nt.set(e,r),typeof document<"u")){const n=Vo();n.textContent+=r+`
|
|
3
|
-
`}}function
|
|
4
|
-
`)}function Uo(){Nt.clear(),He=null}function ue(...e){return e.filter(Boolean).join(" ")}const Ko={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Xo={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Sr={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},qo={sm:14,md:16,lg:18,xl:20};function Zo({size:e}){const r=qo[e];return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:b("animate-spin shrink-0"),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}const bn=c.forwardRef(({variant:e="solid",size:r="md",colorScheme:n="primary",isLoading:i=!1,loadingText:s,leftIcon:a,rightIcon:l,isFullWidth:d=!1,glow:u=!1,disabled:x,children:o,className:m,style:p,...h},y)=>{const z=ee(),v=ye(),$=x||i,C={primary:z.primary,secondary:z.secondary,danger:z.danger,warning:z.warning,success:z.success}[n],I=Ue(C,["#ffffff","#000000",z.bg]),R=typeof o=="string"?B(o):o,M=s?B(s):void 0,N=e==="solid"?{backgroundColor:C,color:I,border:"none",boxShadow:u&&!v?`0 0 20px ${C}55`:void 0}:e==="outline"?{backgroundColor:"transparent",color:C,border:`2px solid ${C}`}:e==="ghost"?{backgroundColor:"transparent",color:C,border:"none"}:{backgroundColor:"transparent",color:C,border:"none",textDecoration:"underline"},T=b("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",Ko[r],Xo[r],Sr[r],e!=="link"&&Sr[r],d&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!v&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:y,"aria-busy":i,"aria-disabled":$,disabled:$,className:ue(T,m),style:{...N,...p},...h,children:i?t.jsxs(t.Fragment,{children:[t.jsx(Zo,{size:r}),M??R]}):t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{"aria-hidden":"true",children:a}),R,l&&t.jsx("span",{"aria-hidden":"true",children:l})]})})});bn.displayName="TkxButton";const Go={none:"",sm:"p-3",md:"p-5",lg:"p-7"},yn=c.forwardRef(({variant:e="default",isHoverable:r,isClickable:n,padding:i="md",as:s,children:a,className:l,style:d,...u},x)=>{const o=ee(),m=ye(),p=s??(n?"button":"div"),h={default:{backgroundColor:o.surface,border:`1px solid ${o.border}`},glass:{backgroundColor:`${o.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${o.border}55`,boxShadow:`0 4px 24px ${o.bg}40`},quantum:{backgroundColor:o.surfaceAlt,border:`1px solid ${o.primary}33`,boxShadow:`0 0 24px ${o.primary}18`},elevated:{backgroundColor:o.surface,boxShadow:`0 4px 20px ${o.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${o.border}`}}[e],y=b("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",Go[i],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(p,{ref:x,className:ue("tkx-card",y,l),style:{color:o.text,...h,...d},...u,children:a})});yn.displayName="TkxCard";function Jo({title:e,subtitle:r,action:n,children:i,className:s,...a}){const l=ee();return t.jsxs("div",{className:ue(b("flex justify-between items-start mb-4"),s),...a,children:[t.jsxs("div",{className:b("flex-1 min-w-0"),children:[e&&t.jsx("h3",{className:b("text-base font-semibold m-0"),style:{color:l.text},children:e}),r&&t.jsx("p",{className:b("text-sm mt-1 mb-0"),style:{color:l.textMuted},children:r}),i]}),n&&t.jsx("div",{className:b("ml-3 shrink-0"),children:n})]})}function Qo({children:e,className:r,...n}){return t.jsx("div",{className:ue(b(""),r),...n,children:e})}function es({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{className:ue(b("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${s.border}`,...n},...i,children:e})}const vn=c.forwardRef(({label:e,id:r,error:n,hint:i,leftAddon:s,rightAddon:a,isInvalid:l,isRequired:d,disabled:u,className:x,style:o,...m},p)=>{const h=ee(),y=c.useId(),z=r??y,v=`${z}-hint`,$=`${z}-error`,w=l||!!n,C=[i&&v,w&&$].filter(Boolean).join(" ")||void 0,I=B(e),R=n?B(n):void 0,M=i?B(i):void 0,N=w?h.danger:h.border;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),x),style:o,children:[t.jsxs("label",{htmlFor:z,className:b("text-sm font-medium font-sans"),style:{color:h.text},children:[I,d&&t.jsx("span",{"aria-hidden":"true",className:b("ml-1"),style:{color:h.danger},children:"*"})]}),t.jsxs("div",{className:b("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${N}`,backgroundColor:h.surface},children:[s&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderRight:`1px solid ${h.border}`},children:s}),t.jsx("input",{ref:p,id:z,"aria-invalid":w,"aria-required":d,"aria-describedby":C,disabled:u,className:ue(b("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:h.text},...m}),a&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderLeft:`1px solid ${h.border}`},children:a})]}),M&&!R&&t.jsx("span",{id:v,className:b("text-xs"),style:{color:h.textMuted},children:M}),R&&t.jsxs("span",{id:$,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:h.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),R]})]})});vn.displayName="TkxInput";const ts={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},rs={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},kn=c.forwardRef(({variant:e="default",size:r="md",dot:n=!1,pulse:i=!1,outlined:s=!1,children:a,className:l,style:d,...u},x)=>{const o=ee(),p={default:o.border,primary:o.primary,secondary:o.secondary,danger:o.danger,warning:o.warning,success:o.success,info:o.info}[e],h=Ue(p,["#ffffff","#000000",o.bg]),y=typeof a=="string"?B(a):a;return n?t.jsx("span",{ref:x,"aria-label":typeof a=="string"?B(a):void 0,className:ue(b("inline-block rounded-full",rs[r],i&&"animate-pulse"),l),style:{backgroundColor:p,...d},...u}):t.jsx("span",{ref:x,className:ue(b("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",ts[r],i&&"animate-pulse"),l),style:{backgroundColor:s?"transparent":p,color:s?p:h,border:s?`1px solid ${p}`:"none",...d},...u,children:y})});kn.displayName="TkxBadge";const ns={sm:"4px",md:"8px",lg:"12px"},os={sm:32,md:48,lg:64},wn=c.forwardRef(({value:e,variant:r="linear",size:n="md",label:i,showValue:s,color:a,className:l,style:d,...u},x)=>{const o=ee(),m=ye(),p=a??o.primary,h=e===void 0,y=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:v}=At({value:e},{value:{type:"number",min:0,max:100}});v.length>0&&console.warn("[TkxProgress]",v.join(", "))}if(r==="circular"){const v=os[n],$=n==="sm"?3:n==="md"?4:5,w=(v-$*2)/2,C=2*Math.PI*w,I=h?0:C-y/100*C;return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),className:ue(b("inline-flex flex-col items-center gap-1"),l),style:d,...u,children:[t.jsxs("svg",{width:v,height:v,viewBox:`0 0 ${v} ${v}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:o.border,strokeWidth:$}),t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:p,strokeWidth:$,strokeLinecap:"round",strokeDasharray:C,strokeDashoffset:I,transform:`rotate(-90 ${v/2} ${v/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:h&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!h&&t.jsxs("span",{className:b("text-xs"),style:{color:o.textMuted},children:[y,"%"]})]})}const z=ns[n];return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),className:ue(b("flex flex-col gap-1 w-full"),l),style:d,...u,children:[i&&t.jsxs("div",{className:b("flex justify-between text-sm"),style:{color:o.text},children:[t.jsx("span",{children:i}),s&&!h&&t.jsxs("span",{children:[y,"%"]})]}),t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:z,borderRadius:z,backgroundColor:o.border},children:t.jsx("div",{style:{height:"100%",borderRadius:z,backgroundColor:p,width:h?"40%":`${y}%`,transition:m?"none":"width 300ms ease",animation:h&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});wn.displayName="TkxProgress";const ss={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},jn=c.forwardRef(({checked:e,onChange:r,label:n,size:i="md",hideLabel:s,disabled:a,className:l,style:d,...u},x)=>{const o=ee(),m=ye(),p=c.useId();At({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:h,th:y,td:z,gap:v}=ss[i],$=e?h-z-v:v,w=e?o.primary:o.border;return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2",a?"opacity-50":""),l),style:d,children:[!s&&t.jsx("label",{htmlFor:p,className:b("text-sm font-sans",a?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:o.text},children:n}),t.jsx("button",{ref:x,id:p,role:"switch","aria-checked":e,"aria-label":s?n:void 0,disabled:a,onClick:()=>!a&&r(!e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&!a&&(C.preventDefault(),r(!e))},className:ue(b("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",a?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:h,height:y,borderRadius:y,backgroundColor:w},...u,children:t.jsx("span",{"aria-hidden":"true",className:b("absolute rounded-full"),style:{top:"50%",left:$,width:z,height:z,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});jn.displayName="TkxToggle";const is={info:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})};function as({variant:e,title:r,children:n,dismissible:i,onDismiss:s,icon:a,style:l,className:d}){const u=ee(),x=hr(),o=r?B(r):void 0;c.useEffect(()=>{o&&x(o,e==="danger"||e==="warning"?"assertive":"polite")},[o,e,x]);const p={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[e],h=e==="danger"||e==="warning"?"alert":"status";return t.jsxs("div",{role:h,className:b("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",d??""),style:{backgroundColor:`${p}18`,borderColor:p,color:u.text,...l},children:[t.jsx("span",{className:b("shrink-0 mt-[1px]"),style:{color:p},children:a??is[e]}),t.jsxs("div",{className:b("flex-1 min-w-0"),children:[o&&t.jsx("p",{className:b("m-0 font-semibold text-sm mb-1"),children:o}),t.jsx("div",{className:b("text-sm leading-relaxed"),children:n})]}),i&&s&&t.jsx("button",{"aria-label":"Dismiss alert",onClick:s,className:b("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const ls={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let tr=0;function cs(){++tr===1&&(document.body.style.overflow="hidden")}function $r(){--tr<=0&&(tr=0,document.body.style.overflow="")}function ds({isOpen:e,onClose:r,title:n,size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,children:l,footer:d}){const u=ee(),x=c.useId(),o=Dt(e),m=ye(),p=hr(),h=B(n),y=i==="full";return Lt(r,a&&e),c.useEffect(()=>(e?(cs(),p(h,"polite")):$r(),()=>{e&&$r()}),[e,h,p]),!e||typeof document>"u"?null:Be.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:s?r:void 0,className:b("absolute inset-0",!m&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-labelledby":x,className:b("relative z-10 flex flex-col overflow-hidden",!m&&"animate-slide-up",y?"":"rounded-xl"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,width:ls[i],maxWidth:"100%",maxHeight:y?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[t.jsxs("div",{className:b("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[t.jsx("h2",{id:x,className:b("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:h}),t.jsx("button",{onClick:r,"aria-label":"Close dialog",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:l}),d&&t.jsx("div",{className:b("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const Sn=c.createContext(null);function $n(){const e=c.useContext(Sn);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function us({defaultIndex:e=0,activeIndex:r,onChange:n,children:i,tabCount:s=0,style:a,className:l}){const[d,u]=c.useState(e),x=c.useId(),o=r!==void 0?r:d,m=p=>{r===void 0&&u(p),n==null||n(p)};return t.jsx(Sn.Provider,{value:{activeIndex:o,setActiveIndex:m,baseId:x,tabCount:s},children:t.jsx("div",{className:l,style:a,children:i})})}function fs({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{role:"tablist",className:ue(b("flex gap-1"),r),style:{borderBottom:`2px solid ${s.border}`,...n},...i,children:e})}function ps({index:e,children:r,disabled:n=!1,className:i,style:s}){const a=ee(),{activeIndex:l,setActiveIndex:d,baseId:u,tabCount:x}=$n(),o=c.useRef(null),m=l===e;return t.jsx("button",{ref:o,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:ue(b("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",n?"opacity-50 cursor-not-allowed":""),i),style:{color:m?a.primary:a.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${a.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!n&&d(e),onKeyDown:p=>cn(p,e,x,h=>{var y;d(h),(y=document.getElementById(`${u}-tab-${h}`))==null||y.focus()}),children:r})}function xs({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function hs({index:e,children:r,style:n,className:i}){const{activeIndex:s,baseId:a}=$n();return s!==e?null:t.jsx("div",{role:"tabpanel",id:`${a}-panel-${e}`,"aria-labelledby":`${a}-tab-${e}`,tabIndex:0,className:ue(b("pt-4"),i),style:n,children:r})}const ms={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function gs({content:e,children:r,placement:n="top",delay:i=300}){const s=ee(),[a,l]=c.useState(!1),d=c.useRef(null),u=c.useId(),x=c.useRef(null),o=ye(),m=B(e),p=Ue(s.surfaceAlt,[s.text,"#ffffff","#000000"]);function h(){x.current=setTimeout(()=>l(!0),i)}function y(){x.current&&clearTimeout(x.current),l(!1)}Lt(y,a),hn(d,y);const z=c.cloneElement(r,{"aria-describedby":a?u:void 0,onMouseEnter:v=>{var $,w;(w=($=r.props).onMouseEnter)==null||w.call($,v),h()},onMouseLeave:v=>{var $,w;(w=($=r.props).onMouseLeave)==null||w.call($,v),y()},onFocus:v=>{var $,w;(w=($=r.props).onFocus)==null||w.call($,v),h()},onBlur:v=>{var $,w;(w=($=r.props).onBlur)==null||w.call($,v),y()}});return t.jsxs("span",{ref:d,className:b("relative inline-flex"),children:[z,a&&t.jsx("span",{id:u,role:"tooltip",className:b("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!o&&"animate-fade-in"),style:{backgroundColor:s.surfaceAlt,color:p,border:`1px solid ${s.border}`,boxShadow:`0 4px 12px ${s.bg}40`,maxWidth:280,...ms[n]},children:m})]})}function Mr({variant:e,width:r,height:n,animation:i,bgColor:s,accentColor:a}){const l=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:l,rectangular:"80px"}[e],x=b(e==="circular"?"rounded-full":e==="text"?"rounded":"rounded-lg"),o=i==="pulse"?b("animate-pulse"):i==="wave"?b("animate-shimmer"):"",m=i==="wave"?{background:`linear-gradient(90deg,${s} 25%,${a} 50%,${s} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:s};return t.jsx("div",{className:ue(x,o),style:{width:l,height:u,...m}})}const mr=c.forwardRef(({variant:e="rectangular",width:r,height:n,lines:i,animation:s="pulse",className:a,style:l,...d},u)=>{const x=ee(),m=ye()?!1:s;return e==="text"&&i&&i>1?t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:ue(b("flex flex-col gap-2"),a),style:l,...d,children:Array.from({length:i},(p,h)=>t.jsx(Mr,{variant:"text",width:h===i-1?"75%":r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border},h))}):t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:a,style:l,...d,children:t.jsx(Mr,{variant:e,width:r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border})})});mr.displayName="TkxSkeleton";const bs={xs:24,sm:32,md:40,lg:56,xl:72},ys={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Mn=c.forwardRef(({src:e,alt:r,initials:n,size:i="md",shape:s="circle",status:a,className:l,style:d,...u},x)=>{const o=ee(),[m,p]=c.useState(!1),h=bs[i],y=s==="circle",z=o.surfaceAlt,v=Ue(z,[o.text,o.textMuted]),$=e&&!m,w=!$&&n,C=Math.max(8,h*.22),I=b("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),R=b("block object-cover",y?"rounded-full":"rounded-lg"),M=b("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:x,className:ue(I,l),style:{width:h,height:h,...d},...u,children:[$?t.jsx("img",{src:B(e),alt:B(r),onError:()=>p(!0),className:R,style:{width:h,height:h}}):t.jsx("div",{role:"img","aria-label":B(r),className:M,style:{width:h,height:h,backgroundColor:z,color:v,fontSize:h*.38},children:w?B(n).slice(0,2).toUpperCase():t.jsxs("svg",{width:h*.5,height:h*.5,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),a&&t.jsx("span",{"aria-label":`Status: ${a}`,className:b("absolute bottom-0 right-0 rounded-full"),style:{width:C,height:C,backgroundColor:ys[a],border:`2px solid ${o.bg}`}})]})});Mn.displayName="TkxAvatar";function vs({dir:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:b("shrink-0"),children:e==="asc"?t.jsx("path",{d:"M7 14l5-5 5 5H7z"}):e==="desc"?t.jsx("path",{d:"M7 10l5 5 5-5H7z"}):t.jsx("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function ks({columns:e,data:r,caption:n,sortable:i,stickyHeader:s,isLoading:a,emptyState:l,style:d,className:u,striped:x}){const o=ee(),[m,p]=c.useState(null),[h,y]=c.useState("asc"),z=c.useMemo(()=>!m||!i?r:[...r].sort((w,C)=>{const I=w[m],R=C[m];let M=0;return typeof I=="string"&&typeof R=="string"?M=I.localeCompare(R):typeof I=="number"&&typeof R=="number"&&(M=I-R),h==="asc"?M:-M}),[r,m,h,i]);function v(w){m===w?y(C=>C==="asc"?"desc":"asc"):(p(w),y("asc"))}function $(w){return m!==w?"none":h}return t.jsx("div",{className:b("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${o.border}`,...d},children:t.jsxs("table",{className:b("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:o.text},children:[n&&t.jsx("caption",{className:b("text-sm text-left p-2"),style:{color:o.textMuted},children:B(n)}),t.jsx("thead",{style:s?{position:"sticky",top:0,backgroundColor:o.surfaceAlt,zIndex:1}:{backgroundColor:o.surfaceAlt},children:t.jsx("tr",{children:e.map(w=>{const C=i&&w.sortable!==!1,I=$(w.key);return t.jsx("th",{scope:"col","aria-sort":C?I==="none"?"none":I==="asc"?"ascending":"descending":void 0,className:b("px-4 py-3 text-left font-semibold whitespace-nowrap",C?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:o.textMuted,borderBottom:`2px solid ${o.border}`,width:w.width},onClick:()=>C&&v(w.key),onKeyDown:R=>{C&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(w.key))},tabIndex:C?0:void 0,children:t.jsxs("span",{className:b("inline-flex items-center gap-1.5"),children:[B(w.header),C&&t.jsx(vs,{dir:I})]})},String(w.key))})})}),t.jsx("tbody",{children:a?Array.from({length:5},(w,C)=>t.jsx("tr",{children:e.map(I=>t.jsx("td",{className:b("px-4 py-3"),children:t.jsx(mr,{variant:"text",height:"16px"})},String(I.key)))},C)):z.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:b("px-4 py-8 text-center"),style:{color:o.textMuted},children:l??"No data available"})}):z.map((w,C)=>t.jsx("tr",{style:{backgroundColor:x&&C%2===1?o.surfaceAlt:"transparent",borderBottom:`1px solid ${o.border}`},children:e.map(I=>{const R=w[I.key],M=I.render?I.render(R,w):typeof R=="string"?B(R):String(R??"");return t.jsx("td",{className:b("px-4 py-3"),style:{color:o.text},children:M},String(I.key))})},C))})]})})}const Cn=c.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:i,style:s,...a},l)=>{const d=ee(),u=r?B(r):void 0,x=e==="vertical",o=x?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?t.jsxs("div",{role:"separator","aria-orientation":e,className:ue(b("flex items-center gap-3 text-xs"),i),style:{color:d.textMuted,...s},...a,children:[t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}}),t.jsx("span",{children:u}),t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}})]}):t.jsx("hr",{ref:l,role:"separator","aria-orientation":e,className:ue(b(x?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[o]:m,...s},...a})});Cn.displayName="TkxDivider";const ws={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function Cr(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function js(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=6,a=i-n.bottom-s,l=n.top-s,d=a>=Math.min(r,200)||a>=l?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+s:n.top+window.scrollY-s-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function Ss({size:e,color:r}){return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[t.jsx("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Tn({options:e,value:r,defaultValue:n,placeholder:i="Select an option…",size:s="md",isDisabled:a=!1,isInvalid:l=!1,label:d,hint:u,errorMessage:x,multiple:o=!1,searchable:m=!1,clearable:p=!1,isLoading:h=!1,onChange:y,renderOption:z,maxMenuHeight:v=280,id:$,className:w,style:C}){const I=ee(),R=c.useId(),M=$??R,N=`${M}-listbox`,T=`${M}-hint`,j=`${M}-error`,k=r!==void 0,[Y,f]=c.useState(Cr(n)),g=k?Cr(r):Y,[S,F]=c.useState(!1),[D,V]=c.useState(""),[E,P]=c.useState(-1),[W,O]=c.useState(null),[A,H]=c.useState(""),Q=c.useRef(null),G=c.useRef(null),ne=c.useRef(null),pe=c.useRef(null),xe=c.useRef(null),oe=ws[s],me=l||!!x,X=m&&D?e.filter(U=>U.label.toLowerCase().includes(D.toLowerCase())):e,Z=X.filter(U=>!U.disabled),ve=X.reduce((U,le)=>{const se=le.group??"";return U[se]||(U[se]=[]),U[se].push(le),U},{}),we=c.useCallback(U=>{var se;let le;o?le=g.includes(U)?g.filter(Se=>Se!==U):[...g,U]:le=[U],k||f(le),y==null||y(o?le:le[0]??""),o||(F(!1),V(""),P(-1),(se=G.current)==null||se.focus())},[k,o,y,g]),de=c.useCallback((U,le)=>{le.stopPropagation();const se=g.filter(Se=>Se!==U);k||f(se),y==null||y(o?se:se[0]??"")},[k,o,y,g]),ge=c.useCallback(U=>{U.stopPropagation(),k||f([]),y==null||y(o?[]:"")},[k,o,y]),J=c.useCallback(()=>{!G.current||!S||O(js(G.current,v))},[S,v]);c.useEffect(()=>{if(S)return J(),window.addEventListener("scroll",J,!0),window.addEventListener("resize",J),()=>{window.removeEventListener("scroll",J,!0),window.removeEventListener("resize",J)}},[S,J]),c.useEffect(()=>{if(!S)return;const U=le=>{var Se,Ae;const se=le.target;(Se=G.current)!=null&&Se.contains(se)||(Ae=pe.current)!=null&&Ae.contains(se)||(F(!1),V(""))};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[S]),c.useEffect(()=>{S&&m&&setTimeout(()=>{var U;return(U=ne.current)==null?void 0:U.focus()},0)},[S,m]),c.useEffect(()=>{var le;if(!S||E<0)return;const U=(le=xe.current)==null?void 0:le.querySelector(`[data-idx="${E}"]`);U==null||U.scrollIntoView({block:"nearest"})},[E,S]);const ie=U=>{switch(U.key){case"Enter":case" ":U.preventDefault(),S?E>=0&&Z[E]&&we(Z[E].value):te();break;case"Escape":U.preventDefault(),F(!1),V("");break;case"ArrowDown":U.preventDefault(),S?P(le=>Math.min(le+1,Z.length-1)):te();break;case"ArrowUp":U.preventDefault(),S?P(le=>Math.max(le-1,0)):te();break;case"Home":U.preventDefault(),S&&P(0);break;case"End":U.preventDefault(),S&&P(Z.length-1);break;default:U.key.length===1&&!U.ctrlKey&&!U.metaKey&&(S||te(),q(U.key))}},re=U=>{var le;switch(U.key){case"Escape":U.preventDefault(),F(!1),V(""),(le=G.current)==null||le.focus();break;case"ArrowDown":U.preventDefault(),P(se=>Math.min(se+1,Z.length-1));break;case"ArrowUp":U.preventDefault(),P(se=>Math.max(se-1,0));break;case"Home":U.preventDefault(),P(0);break;case"End":U.preventDefault(),P(Z.length-1);break;case"Enter":U.preventDefault(),E>=0&&Z[E]&&we(Z[E].value);break}};function q(U){Q.current&&clearTimeout(Q.current);const le=A+U.toLowerCase();H(le);const se=Z.findIndex(Se=>Se.label.toLowerCase().startsWith(le));se>=0&&P(se),Q.current=setTimeout(()=>H(""),800)}function te(){if(a||h)return;F(!0);const U=Z.findIndex(le=>g.includes(le.value));P(U>=0?U:0)}const be=me?I.danger:S?I.primary:I.border,$e=E>=0&&Z[E]?`${M}-opt-${Z[E].value}`:void 0,Me=[u&&T,me&&j].filter(Boolean).join(" ")||void 0,Te=g.map(U=>e.find(le=>le.value===U)).filter(Boolean),Ke=S&&W?Be.createPortal(t.jsxs("div",{ref:pe,role:"listbox",id:N,"aria-label":d?B(d):"Options","aria-multiselectable":o,style:{position:"absolute",top:W.top,left:W.left,width:W.width,zIndex:9999,backgroundColor:I.surface,border:`1.5px solid ${I.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:W.width,maxHeight:v,display:"flex",flexDirection:"column"},children:[m&&t.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${I.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("path",{d:"M21 21l-4.35-4.35"})]}),t.jsx("input",{ref:ne,type:"text",value:D,onChange:U=>{V(U.target.value),P(0)},onKeyDown:re,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:I.text,fontSize:oe.fontSize,fontFamily:"inherit",width:"100%"}})]}),t.jsxs("div",{ref:xe,style:{overflowY:"auto",flexGrow:1,maxHeight:v-(m?48:0)},children:[Object.entries(ve).map(([U,le])=>t.jsxs("div",{children:[U&&t.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:I.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:I.surface,zIndex:1,borderBottom:`1px solid ${I.border}`},children:B(U)}),le.map(se=>{const Se=Z.indexOf(se),Ae=Se===E,De=g.includes(se.value),at=z?z(se,De):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[se.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:se.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(se.label)})]}),se.description&&t.jsx("span",{style:{fontSize:"12px",color:I.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(se.description)})]});return t.jsxs("div",{id:`${M}-opt-${se.value}`,"data-idx":Se>=0?Se:void 0,role:"option","aria-selected":De,"aria-disabled":se.disabled||void 0,onClick:()=>!se.disabled&&we(se.value),onMouseEnter:()=>!se.disabled&&Se>=0&&P(Se),style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:se.disabled?I.textMuted:I.text,backgroundColor:Ae?`${I.primary}22`:De?`${I.primary}12`:"transparent",cursor:se.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:se.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[at,De&&!z&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},se.value)})]},U)),X.length===0&&t.jsx("div",{style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:I.textMuted,textAlign:"center"},children:h?"Loading…":"No options found"})]})]}),document.body):null,Ee=p&&g.length>0&&!a&&!h;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),w),style:C,children:[d&&t.jsx("label",{htmlFor:M,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:I.text,userSelect:"none"},children:B(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:a?.55:1},children:t.jsxs("button",{ref:G,id:M,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":N,"aria-activedescendant":$e,"aria-invalid":me||void 0,"aria-describedby":Me,"aria-multiselectable":o,disabled:a,onClick:()=>S?F(!1):te(),onKeyDown:ie,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:o&&g.length>0?`4px ${oe.px}`:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",backgroundColor:I.surface,color:g.length>0?I.text:I.textMuted,border:`1.5px solid ${be}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:a?"not-allowed":"pointer",outline:"none",minHeight:s==="sm"?34:s==="lg"?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:o&&Te.length>0?Te.map(U=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${oe.tagPy} ${oe.tagPx}`,fontSize:`calc(${oe.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${I.primary}22`,color:I.primary,borderRadius:6,border:`1px solid ${I.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:B(U.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${B(U.label)}`,tabIndex:-1,onClick:le=>de(U.value,le),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]},U.value)):!o&&g.length>0?(()=>{const U=e.find(le=>le.value===g[0]);return t.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(U==null?void 0:U.icon)&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:U.icon}),U?B(U.label):""]})})():t.jsx("span",{style:{opacity:.6},children:B(i)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:I.textMuted},children:[h&&t.jsx(Ss,{size:oe.iconSize,color:I.primary}),Ee&&!h&&t.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:ge,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:U=>U.currentTarget.style.opacity="1",onMouseLeave:U=>U.currentTarget.style.opacity="0.7",children:t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:S?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:t.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!me&&t.jsx("span",{id:T,style:{fontSize:"12px",color:I.textMuted,fontFamily:"inherit"},children:B(u)}),me&&x&&t.jsxs("span",{id:j,role:"alert",style:{fontSize:"12px",color:I.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),B(x)]}),Ke]})}Tn.displayName="TkxSelect";const $s={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},In=c.forwardRef(({label:e,hint:r,isInvalid:n,errorMessage:i,isIndeterminate:s=!1,size:a="md",colorScheme:l="primary",checked:d,defaultChecked:u,onChange:x,disabled:o,className:m,style:p,id:h,...y},z)=>{const v=ee(),$=ye(),w=c.useId(),C=h??w,I=`${C}-hint`,R=`${C}-error`,M=c.useRef(null),[N,T]=c.useState(!1),j=$s[a],k=n||!!i,f={primary:v.primary,success:v.success,danger:v.danger,warning:v.warning}[l]??v.primary,g=d!==void 0?d:void 0;c.useEffect(()=>{const O=(z==null?void 0:z.current)??M.current;O&&(O.indeterminate=s)},[s,z]);const S=s||(g??!1),F=S?f:v.surface,D=k?v.danger:S?f:v.border,V=Ue(f),E=N?{outline:`2px solid ${f}`,outlineOffset:"2px"}:{},P=[r&&I,k&&R].filter(Boolean).join(" ")||void 0,W=!$&&S?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return t.jsxs("div",{className:ue(b("flex flex-col gap-1"),m),style:{opacity:o?.5:1,...p},children:[t.jsx("style",{children:`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),t=require("react/jsx-runtime"),Be=require("react-dom"),co=2166136261,uo=16777619;function rt(e){let r=co;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,uo)>>>0;return r.toString(16).padStart(8,"0")}class Zr{constructor(r=512){this.cache=new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(r,512)}get(r){if(!this.cache.has(r)){this.misses++;return}this.hits++;const n=this.cache.get(r);return this.cache.delete(r),this.cache.set(r,n),n}set(r,n){this.cache.has(r)?this.cache.delete(r):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(r,n)}has(r){return this.cache.has(r)}invalidate(r){r!==void 0?this.cache.delete(r):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const r=this.hits+this.misses;return r===0?0:this.hits/r*100}}const it=new Zr(512);function Gr(e,r){const n=it.get(e);if(n!==void 0)return n;const i=r();return it.set(e,i),i}const Jr=[];let _t=!1;const pt=[];let ar=0,st=0;function fo(){const e=Jr.splice(0),r=performance.now();for(const i of e)try{i()}catch{}const n=performance.now()-r;ar+=n,st++,pt.push({duration:n,timestamp:Date.now()}),pt.length>100&&pt.shift()}function Qr(e){Jr.push(e),_t||(_t=!0,queueMicrotask(()=>{fo(),_t=!1}))}function po(e){const r=e!==void 0?pt.slice(-e):pt.slice();return{avgRenderTime:st===0?0:ar/st,cacheHitRate:it.cacheHitRate,renderCount:st,recent:r}}function xo(e){e!==void 0?it.invalidate(e):it.invalidate()}const ho={hash:rt,memoize:Gr,batchUpdate:Qr,invalidate:xo,get avgRenderTime(){return st===0?0:ar/st},get cacheHitRate(){return it.cacheHitRate},getMetrics:po},zt=new Map;function en(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function mo(e){return"tkx-"+rt(e)}function tn(e){const r=mo(e);return zt.has(r)||zt.set(r,e),r}function rn(e,...r){const n=e.reduce((s,a,l)=>s+a+(r[l]!==void 0?String(r[l]):""),"");return{className:tn(n.trim()),styles:n.trim()}}function nn(e){const r=Object.entries(e).map(([i,s])=>`${en(i)}: ${s};`).join(" ");return{className:tn(r),styles:r}}const go={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function on(e,r){return`@media (min-width: ${go[e]}) { ${r} }`}function sn(e,r){const n=Object.entries(r).map(([i,s])=>{const a=Object.entries(s).map(([l,d])=>`${en(l)}: ${d};`).join(" ");return`${i} { ${a} }`}).join(" ");return`@keyframes ${e} { ${n} }`}function lr(e,r){return r!==void 0?`--tkx-${e}: ${r};`:`var(--tkx-${e})`}function cr(){return Array.from(zt.entries()).map(([e,r])=>`.${e} { ${r} }`).join(`
|
|
2
|
+
`)}function bo(){zt.clear()}function an(){if(typeof document>"u")return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=cr()}const yo={css:rn,fromObject:nn,responsive:on,keyframes:sn,cssVar:lr,extractCSS:cr,injectStyles:an,resetStyles:bo};function vo(e){const r=e.replace("#",""),n=r.length===3?r.split("").map(l=>l+l).join(""):r,i=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[i,s,a]}function kr(e){const[r,n,i]=vo(e).map(s=>{const a=s/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*r+.7152*n+.0722*i}function at(e,r){const n=kr(e),i=kr(r),s=Math.max(n,i),a=Math.min(n,i);return(s+.05)/(a+.05)}function Nt(e,r,n=!1){return at(e,r)>=(n?3:4.5)}function ln(e,r,n=!1){return at(e,r)>=(n?4.5:7)}function Ke(e,r){const i=r??["#ffffff","#000000"];return i.reduce((s,a)=>at(a,e)>at(s,e)?a:s,i[0])}function cn(){const e=document.createElement("div"),r=document.createElement("div");for(const n of[e,r])n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n);return e.setAttribute("aria-live","polite"),r.setAttribute("aria-live","assertive"),{announce(n,i="polite"){const s=i==="assertive"?r:e;s.textContent="",setTimeout(()=>{s.textContent=n},0)},destroy(){e.remove(),r.remove()}}}const ko=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function dr(e){let r=null,n=null;function i(){return Array.from(e.querySelectorAll(ko)).filter(s=>!s.closest("[hidden]")&&!s.closest('[aria-hidden="true"]'))}return{activate(){r=document.activeElement;const s=i();s.length>0&&s[0].focus(),n=a=>{if(a.key!=="Tab")return;const l=i();if(l.length===0)return;const d=l[0],u=l[l.length-1];a.shiftKey?document.activeElement===d&&(a.preventDefault(),u.focus()):document.activeElement===u&&(a.preventDefault(),d.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),r instanceof HTMLElement&&r.focus(),r=null,n=null}}}function dn(e,r,n,i){let s=r;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),s=r===0?n-1:r-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),s=r===n-1?0:r+1;break;case"Home":e.preventDefault(),s=0;break;case"End":e.preventDefault(),s=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;default:return}i(s)}function wo(e,r,n,i,s){let a=r;switch(e.key){case"ArrowUp":e.preventDefault(),a=r===0?n-1:r-1;break;case"ArrowDown":e.preventDefault(),a=r===n-1?0:r+1;break;case"Home":e.preventDefault(),a=0;break;case"End":e.preventDefault(),a=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;case"Escape":e.preventDefault(),s==null||s();return;default:return}i(a)}function ur(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function fr(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function jo(e,r="polite"){if(typeof document>"u")return;let n=document.getElementById("tkx-live-region");n||(n=document.createElement("div"),n.id="tkx-live-region",n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n)),n.textContent="",setTimeout(()=>{n&&(n.textContent=e)},0)}const So={contrastRatio:at,meetsAA:Nt,meetsAAA:ln,getAccessibleForeground:Ke,createAnnouncer:cn,createFocusTrap:dr,handleTabsKeyboard:dn,handleMenuKeyboard:wo,prefersReducedMotion:ur,prefersHighContrast:fr,announce:jo},pr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},$o={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},Mo=/^#[0-9a-fA-F]{3,8}$/;function Co(e,r){const n={...e,...r};for(const[i,s]of Object.entries(n))if(!Mo.test(s))throw new Error(`Invalid hex color for theme token '${i}': ${s}`);return Nt(n.text,n.bg)||console.warn(`[TekiVex] Theme contrast warning: text (${n.text}) vs bg (${n.bg}) does not meet WCAG AA minimum (4.5:1)`),Nt(n.primary,n.bg)||console.warn(`[TekiVex] Theme contrast warning: primary (${n.primary}) vs bg (${n.bg}) does not meet WCAG AA minimum`),n}const xr=c.createContext(pr);function To({theme:e=pr,children:r}){return c.useEffect(()=>{const n=Object.entries(e).map(([s,a])=>lr(s,a)).join(" ");let i=document.getElementById("tkx-theme");i||(i=document.createElement("style"),i.id="tkx-theme",document.head.appendChild(i)),i.textContent=`:root { ${n} }`},[e]),c.createElement(xr.Provider,{value:e},r)}function ee(){return c.useContext(xr)}function Io(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,s=parseInt(r.slice(4,6),16)/255,a=Math.max(n,i,s),l=Math.min(n,i,s);let d=0,u=0;const p=(a+l)/2;if(a!==l){const o=a-l;switch(u=p>.5?o/(2-a-l):o/(a+l),a){case n:d=((i-s)/o+(i<s?6:0))/6;break;case i:d=((s-n)/o+2)/6;break;case s:d=((n-i)/o+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(p*100)]}function We(e,r,n){r/=100,n/=100;const i=r*Math.min(n,1-n),s=a=>{const l=(a+e/30)%12,d=n-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function Eo(e){const[r,n]=Io(e);return{50:We(r,Math.min(n,30),96),100:We(r,Math.min(n,40),90),200:We(r,Math.min(n,50),80),300:We(r,n,70),400:We(r,n,60),500:e,600:We(r,n,45),700:We(r,n,35),800:We(r,n,25),900:We(r,n,15)}}const zo={xs:{fontSize:"0.75rem",lineHeight:"1rem"},sm:{fontSize:"0.875rem",lineHeight:"1.25rem"},base:{fontSize:"1rem",lineHeight:"1.5rem"},lg:{fontSize:"1.125rem",lineHeight:"1.75rem"},xl:{fontSize:"1.25rem",lineHeight:"1.75rem"},"2xl":{fontSize:"1.5rem",lineHeight:"2rem"},"3xl":{fontSize:"1.875rem",lineHeight:"2.25rem"},"4xl":{fontSize:"2.25rem",lineHeight:"2.5rem"},"5xl":{fontSize:"3rem",lineHeight:"1.15"}},No={0:"0px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",4:"16px",5:"20px",6:"24px",8:"32px",10:"40px",12:"48px",16:"64px",20:"80px",24:"96px"},Ro={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Ao={none:"none",xs:"0 1px 2px 0 rgba(0,0,0,0.05)",sm:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)"},Do={hide:-1,base:0,dropdown:1e3,sticky:1100,fixed:1200,overlay:1300,modal:1400,popover:1500,tooltip:1600,toast:1700,max:9999},Lo={none:"0",sm:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px",full:"9999px"},Fo={"<":"<",">":">","&":"&","'":"'",'"':"""};function B(e){return String(e).replace(/[<>&'"]/g,r=>Fo[r]??r)}function hr(e){const r={};for(const n of Object.keys(e))r[n]=un(e[n]);return r}function un(e){return typeof e=="string"?B(e):Array.isArray(e)?e.map(un):e!==null&&typeof e=="object"&&!Po(e)?hr(e):e}function Po(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function Dt(e,r){const n=[];for(const[i,s]of Object.entries(r)){const a=e[i],l=a==null;if(s.required&&l){n.push(`prop '${i}' is required`);continue}if(!l){if(typeof a!==s.type){n.push(`prop '${i}' must be of type ${s.type}, got ${typeof a}`);continue}s.type==="number"&&typeof a=="number"&&(s.min!==void 0&&a<s.min&&n.push(`prop '${i}' must be >= ${s.min}`),s.max!==void 0&&a>s.max&&n.push(`prop '${i}' must be <= ${s.max}`)),s.type==="string"&&typeof a=="string"&&s.pattern&&!s.pattern.test(a)&&n.push(`prop '${i}' does not match pattern ${s.pattern}`),s.enum&&!s.enum.includes(a)&&n.push(`prop '${i}' must be one of: ${s.enum.join(", ")}`)}}return{valid:n.length===0,errors:n}}const fn=new Map;function Bo(e,r){const n={"default-src":["'self'"],"style-src":r.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":r.allowDataUrls?["'self'","data:"]:r.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":r.allowScripts?["'self'"]:["'none'"]},i={componentId:e,permissions:r,directives:n};return fn.set(e,i),i}function Wo(e,r){const n=fn.get(e);return(n==null?void 0:n.permissions[r])===!0}let Qe=[];function pn(e,r,n){const i=rt(JSON.stringify(n??{})),s=Qe.length>0?Qe[Qe.length-1].chainHash:"00000000",a=rt(s+i+r+e),l=Object.freeze({timestamp:Date.now(),component:r,action:e,propsHash:i,chainHash:a});return Qe=Object.freeze([...Qe,l]),l}function xn(e){let r=Qe;return e!=null&&e.component&&(r=r.filter(n=>n.component===e.component)),e!=null&&e.action&&(r=r.filter(n=>n.action===e.action)),e!=null&&e.limit&&(r=r.slice(-e.limit)),r}function hn(){let e="00000000";for(const r of Qe){if(rt(e+r.propsHash+r.component+r.action)!==r.chainHash)return!1;e=r.chainHash}return!0}const Ho={sanitize:B,sanitizeProps:hr,validateProps:Dt,createCSP:Bo,hasPermission:Wo,audit:pn,getAuditLog:xn,verifyAuditIntegrity:hn};function ye(){const[e,r]=c.useState(()=>typeof window>"u"?!1:ur());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function Vo(){const[e,r]=c.useState(()=>typeof window>"u"?!1:fr());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(forced-colors: active)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function Lt(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=dr(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function mr(){const e=c.useRef(null);return c.useEffect(()=>{if(!(typeof document>"u"))return e.current=cn(),()=>{var r;(r=e.current)==null||r.destroy()}},[]),c.useCallback((r,n="polite")=>{var i;(i=e.current)==null||i.announce(r,n)},[])}function Ft(e,r=!0){const n=c.useRef(e);n.current=e,c.useEffect(()=>{if(!r||typeof document>"u")return;const i=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r])}function mn(e,r){const n=c.useRef(r);n.current=r,c.useEffect(()=>{const i=s=>{!e.current||e.current.contains(s.target)||n.current()};return document.addEventListener("pointerdown",i),()=>document.removeEventListener("pointerdown",i)},[e])}const he={0:"0",px:"1px","0.5":"2px",1:"4px","1.5":"6px",2:"8px","2.5":"10px",3:"12px","3.5":"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},wr={...he,screen:"100vh"},He={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},Mt={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},jr={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},Oo={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},Yo={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},_o={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},Uo={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Ct={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Ko=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),gn=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Xo={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ae(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Pe(e){if(gn.has(e))return`var(--tkx-${e})`;if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="white")return"#ffffff";if(e==="black")return"#000000";if(e==="inherit")return"inherit";const r=ae(e);return r||e}function qo(e){const r=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(r)return{[r[1]]:r[2]};const n={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(n[e])return{display:n[e]};const i={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(i[e])return{"flex-direction":i[e]};const s={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(s[e])return{"flex-wrap":s[e]};const a={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(a[e])return{flex:a[e]};if(e==="grow"||e==="flex-grow")return{"flex-grow":"1"};if(e==="grow-0")return{"flex-grow":"0"};if(e==="shrink"||e==="flex-shrink")return{"flex-shrink":"1"};if(e==="shrink-0"||e==="flex-shrink-0")return{"flex-shrink":"0"};const l={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(l[e])return{"align-items":l[e]};const d={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(d[e])return{"justify-content":d[e]};const u={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(u[e])return{"align-self":u[e]};const p={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(p[e])return{"align-content":p[e]};let o;if(o=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^col-span-(full|\d+)$/))return{"grid-column":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":o[1]};if(o=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":o[1]};if(o=e.match(/^row-span-(full|\d+)$/))return{"grid-row":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":o[1]};if(o=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":o[1]};if(e==="grid-flow-row")return{"grid-auto-flow":"row"};if(e==="grid-flow-col")return{"grid-auto-flow":"column"};if(e==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(e==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(e==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(o=e.match(/^p-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{padding:f}}if(o=e.match(/^px-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f,"padding-right":f}}if(o=e.match(/^py-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f,"padding-bottom":f}}if(o=e.match(/^pt-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f}}if(o=e.match(/^pr-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-right":f}}if(o=e.match(/^pb-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-bottom":f}}if(o=e.match(/^pl-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f}}if(o=e.match(/^-?m-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{margin:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mx-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const S=f&&g!=="0"?`-${g}`:g;return{"margin-left":S,"margin-right":S}}}if(o=e.match(/^-?my-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const S=f&&g!=="0"?`-${g}`:g;return{"margin-top":S,"margin-bottom":S}}}if(o=e.match(/^-?mt-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-top":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mr-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-right":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mb-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-bottom":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?ml-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-left":f&&g!=="0"?`-${g}`:g}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(o=e.match(/^gap-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{gap:f}}if(o=e.match(/^gap-x-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"column-gap":f}}if(o=e.match(/^gap-y-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"row-gap":f}}if(o=e.match(/^w-(.+)$/)){const f=o[1],g=he[f]??He[f]??ae(f);if(g)return{width:g}}if(o=e.match(/^min-w-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"min-width":f}}if(o=e.match(/^max-w-(.+)$/)){const g={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"max-width":g}}if(o=e.match(/^h-(.+)$/)){const f=o[1],g=wr[f]??He[f]??ae(f);if(g)return{height:g}}if(o=e.match(/^min-h-(.+)$/)){const g={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"min-height":g}}if(o=e.match(/^max-h-(.+)$/)){const f=wr[o[1]]??ae(o[1]);if(f)return{"max-height":f}}if(o=e.match(/^size-(.+)$/)){const f=he[o[1]]??He[o[1]]??ae(o[1]);if(f)return{width:f,height:f}}if(o=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[f,g]=Oo[o[1]]??["1rem","1.5rem"];return{"font-size":f,"line-height":g}}if(o=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Yo[o[1]]??o[1]};if(o=e.match(/^leading-(.+)$/)){const f=_o[o[1]]??ae(o[1]);if(f)return{"line-height":f}}if(o=e.match(/^tracking-(.+)$/)){const f=Uo[o[1]]??ae(o[1]);if(f)return{"letter-spacing":f}}const m={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(m[e])return{"text-align":m[e]};if(e==="italic")return{"font-style":"italic"};if(e==="not-italic")return{"font-style":"normal"};if(e==="uppercase")return{"text-transform":"uppercase"};if(e==="lowercase")return{"text-transform":"lowercase"};if(e==="capitalize")return{"text-transform":"capitalize"};if(e==="normal-case")return{"text-transform":"none"};if(e==="underline")return{"text-decoration-line":"underline"};if(e==="overline")return{"text-decoration-line":"overline"};if(e==="line-through")return{"text-decoration-line":"line-through"};if(e==="no-underline")return{"text-decoration-line":"none"};if(e==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(e==="text-ellipsis")return{"text-overflow":"ellipsis"};if(e==="text-clip")return{"text-overflow":"clip"};if(e==="whitespace-normal")return{"white-space":"normal"};if(e==="whitespace-nowrap")return{"white-space":"nowrap"};if(e==="whitespace-pre")return{"white-space":"pre"};if(e==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(e==="whitespace-pre-line")return{"white-space":"pre-line"};if(e==="break-words")return{"overflow-wrap":"break-word"};if(e==="break-all")return{"word-break":"break-all"};if(e==="break-keep")return{"word-break":"keep-all"};if(e==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(e==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(e==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(e==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(o=e.match(/^indent-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"text-indent":f}}if(o=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":o[1],"-webkit-box-orient":"vertical"};if(o=e.match(/^text-(.+)$/)){const[f,g]=o[1].split("/"),S=Pe(f);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(f)){if(g){const F=parseInt(g)/100;return{color:S,opacity:String(F)}}return{color:S}}}if(o=e.match(/^bg-(.+)$/)){const[f,g]=o[1].split("/"),S=Pe(f);return g?{"background-color":S,opacity:String(parseInt(g)/100)}:f==="none"?{background:"none"}:{"background-color":S}}if(o=e.match(/^border-color-(.+)$/))return{"border-color":Pe(o[1])};if(o=e.match(/^fill-(.+)$/))return{fill:Pe(o[1])};if(o=e.match(/^stroke-(.+)$/))return{stroke:Pe(o[1])};if(o=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Pe(o[1])};if(o=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Pe(o[1])};if(o=e.match(/^accent-(.+)$/))return{"accent-color":Pe(o[1])};if(o=e.match(/^caret-(.+)$/))return{"caret-color":Pe(o[1])};if(o=e.match(/^outline-color-(.+)$/))return{"outline-color":Pe(o[1])};if(e==="border")return{"border-width":"1px"};if(o=e.match(/^border-(\d+)$/))return{"border-width":`${o[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(o=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${o[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(o=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${o[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(o=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${o[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(o=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${o[1]}px`};if(e==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(e==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(e==="border-none")return{"border-style":"none"};if(e==="border-solid")return{"border-style":"solid"};if(e==="border-dashed")return{"border-style":"dashed"};if(e==="border-dotted")return{"border-style":"dotted"};if(e==="border-double")return{"border-style":"double"};if((o=e.match(/^border-([a-zA-Z].*)$/))&&gn.has(o[1]))return{"border-color":`var(--tkx-${o[1]})`};if(o=e.match(/^border-\[(.+)]$/))return{"border-color":o[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":Mt[""]};if(o=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":Mt[o[1]]??ae(o[1])??o[1]};if(o=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const f=o[1],g=Mt[o[2]??""]??Mt[""];return{t:{"border-top-left-radius":g,"border-top-right-radius":g},r:{"border-top-right-radius":g,"border-bottom-right-radius":g},b:{"border-bottom-left-radius":g,"border-bottom-right-radius":g},l:{"border-top-left-radius":g,"border-bottom-left-radius":g},tl:{"border-top-left-radius":g},tr:{"border-top-right-radius":g},br:{"border-bottom-right-radius":g},bl:{"border-bottom-left-radius":g}}[f]??{}}const x={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(e==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((o=e.match(/^ring-(\d+)$/))&&x[o[1]])return{"box-shadow":`0 0 0 ${x[o[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(o=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${o[1]}px`,"box-shadow":`0 0 0 ${o[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":jr[""]};if(o=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":jr[o[1]]};if(o=e.match(/^opacity-(\d+)$/)){const f=Ko[o[1]];if(f!==void 0)return{opacity:f}}if(e==="bg-none")return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const y={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(y[e])return{"background-position":y[e]};const z={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(z[e])return{"background-repeat":z[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${Ct[""]})`};if(o=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${Ct[o[1]]})`};if(e==="blur")return{filter:`blur(${Ct[""]})`};if(o=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${Ct[o[1]]})`};if(e==="grayscale")return{filter:"grayscale(100%)"};if(e==="grayscale-0")return{filter:"grayscale(0)"};if(e==="invert")return{filter:"invert(100%)"};if(e==="invert-0")return{filter:"invert(0)"};const v={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(v[e])return{position:v[e]};if(e==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(e==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(e==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(e==="inset-x-0")return{left:"0",right:"0"};if(e==="inset-y-0")return{top:"0",bottom:"0"};if(o=e.match(/^-?top-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{top:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?right-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{right:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?bottom-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{bottom:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?left-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{left:f&&g!=="0"?`-${g}`:g}}const $={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(o=e.match(/^z-(.+)$/)){const f=$[o[1]]??ae(o[1]);if(f)return{"z-index":f}}const w={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(w[e])return{overflow:w[e]};if(o=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${o[1]}`]:o[2]};if(e==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(e==="visible")return{visibility:"visible"};if(e==="invisible")return{visibility:"hidden"};if(e==="collapse")return{visibility:"collapse"};const C={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(C[e])return{cursor:C[e]};if(e==="select-none")return{"user-select":"none"};if(e==="select-text")return{"user-select":"text"};if(e==="select-all")return{"user-select":"all"};if(e==="select-auto")return{"user-select":"auto"};if(e==="pointer-events-none")return{"pointer-events":"none"};if(e==="pointer-events-auto")return{"pointer-events":"auto"};const I={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(o=e.match(/^scale-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scale(${f})`}}if(o=e.match(/^scale-x-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleX(${f})`}}if(o=e.match(/^scale-y-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleY(${f})`}}const R={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(o=e.match(/^-?rotate-(.+)$/)){const f=e.startsWith("-"),g=R[o[1]]??ae(o[1]);if(g)return{transform:f?`rotate(-${g})`:`rotate(${g})`}}if(o=e.match(/^-?translate-x-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{transform:`translateX(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?translate-y-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??He[o[1]]??ae(o[1]);if(g)return{transform:`translateY(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?skew-x-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewX(-${g})`:`skewX(${g})`}}if(o=e.match(/^-?skew-y-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewY(-${g})`:`skewY(${g})`}}const M={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(M[e])return{"transform-origin":M[e]};const N={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(N[e])return{"transition-property":N[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const T={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(o=e.match(/^duration-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-duration":f}}if(o=e.match(/^delay-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-delay":f}}const j={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(j[e])return{"transition-timing-function":j[e]};const k={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(k[e])return{animation:k[e]};const Y={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return Y[e]?{"object-fit":Y[e]}:e==="aspect-square"?{"aspect-ratio":"1 / 1"}:e==="aspect-video"?{"aspect-ratio":"16 / 9"}:e==="aspect-auto"?{"aspect-ratio":"auto"}:(o=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":o[1]}:e==="list-none"?{"list-style-type":"none"}:e==="list-disc"?{"list-style-type":"disc"}:e==="list-decimal"?{"list-style-type":"decimal"}:e==="list-inside"?{"list-style-position":"inside"}:e==="list-outside"?{"list-style-position":"outside"}:(o=e.match(/^columns-(\d+)$/))?{columns:o[1]}:e==="resize"?{resize:"both"}:e==="resize-none"?{resize:"none"}:e==="resize-x"?{resize:"horizontal"}:e==="resize-y"?{resize:"vertical"}:e==="sr-only"?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:e==="not-sr-only"?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:e==="focus-ring"?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:e==="appearance-none"?{appearance:"none"}:e==="outline-none"?{outline:"none"}:e==="outline"?{outline:"2px solid currentColor","outline-offset":"2px"}:e==="float-left"?{float:"left"}:e==="float-right"?{float:"right"}:e==="float-none"?{float:"none"}:e==="clear-both"?{clear:"both"}:e==="isolate"?{isolation:"isolate"}:e==="isolation-auto"?{isolation:"auto"}:(o=e.match(/^will-change-(.+)$/))?{"will-change":o[1]}:e==="touch-manipulation"?{"touch-action":"manipulation"}:e==="touch-none"?{"touch-action":"none"}:e==="touch-pan-x"?{"touch-action":"pan-x"}:e==="touch-pan-y"?{"touch-action":"pan-y"}:e==="scroll-smooth"?{"scroll-behavior":"smooth"}:e==="scroll-auto"?{"scroll-behavior":"auto"}:(o=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[o[1]]:o[2]}:null}function Zo(e){let r=0,n=-1;for(let i=0;i<e.length;i++)if(e[i]==="[")r++;else if(e[i]==="]")r--;else if(e[i]===":"&&r===0){n=i;break}return n===-1?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function Sr(e,r){for(const[n,i]of Object.entries(r))e[n]=i}function Ut(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const Rt=new Map;let Ve=null;function Go(){return(!Ve||!Ve.isConnected)&&(Ve=document.getElementById("tkx-atomic"),Ve||(Ve=document.createElement("style"),Ve.id="tkx-atomic",document.head.appendChild(Ve))),Ve}function Jo(e,r){if(!Rt.has(e)&&(Rt.set(e,r),typeof document<"u")){const n=Go();n.textContent+=r+`
|
|
3
|
+
`}}function bn(e){const r=[];for(const n of e)if(n){if(typeof n=="string")r.push(...n.split(/\s+/).filter(Boolean));else if(Array.isArray(n))r.push(...bn(n));else if(typeof n=="object")for(const[i,s]of Object.entries(n))s&&r.push(i)}return r}function b(...e){const r=bn(e);if(r.length===0)return"";const n={base:{},variants:{}};for(const u of r){const{variant:p,utility:o}=Zo(u),m=qo(o);m&&(p?(n.variants[p]||(n.variants[p]={}),Sr(n.variants[p],m)):Sr(n.base,m))}const i=[],s=Ut(n.base),a=[s,...Object.entries(n.variants).map(([u,p])=>`${u}{${Ut(p)}}`)].join("|"),l=rt(a),d=`tkx-${l}`;s&&i.push(`.${d}{${s}}`);for(const[u,p]of Object.entries(n.variants)){const o=Ut(p);if(o)if(u.startsWith("@")){const m=u.slice(1),x=Xo[m];x&&i.push(`@media(min-width:${x}){.${d}{${o}}}`)}else if(u==="motion-safe")i.push(`@media(prefers-reduced-motion:no-preference){.${d}{${o}}}`);else if(u==="motion-reduce")i.push(`@media(prefers-reduced-motion:reduce){.${d}{${o}}}`);else if(u==="contrast-more")i.push(`@media(prefers-contrast:more){.${d}{${o}}}`);else if(u==="forced-colors")i.push(`@media(forced-colors:active){.${d}{${o}}}`);else if(u==="dark")i.push(`@media(prefers-color-scheme:dark){.${d}{${o}}}`);else if(u==="print")i.push(`@media print{.${d}{${o}}}`);else if(u==="group-hover")i.push(`.group:hover .${d}{${o}}`);else if(u==="group-focus")i.push(`.group:focus-within .${d}{${o}}`);else if(u==="peer-hover")i.push(`.peer:hover~.${d}{${o}}`);else{const x={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[u]??`:${u}`;i.push(`.${d}${x}{${o}}`)}}return i.length>0&&Jo(l,i.join("")),d}const Qo=b;function es(){return Array.from(Rt.values()).join(`
|
|
4
|
+
`)}function ts(){Rt.clear(),Ve=null}function ue(...e){return e.filter(Boolean).join(" ")}const rs={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},ns={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},$r={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},os={sm:14,md:16,lg:18,xl:20};function ss({size:e}){const r=os[e];return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:b("animate-spin shrink-0"),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}const yn=c.forwardRef(({variant:e="solid",size:r="md",colorScheme:n="primary",isLoading:i=!1,loadingText:s,leftIcon:a,rightIcon:l,isFullWidth:d=!1,glow:u=!1,disabled:p,children:o,className:m,style:x,...h},y)=>{const z=ee(),v=ye(),$=p||i,C={primary:z.primary,secondary:z.secondary,danger:z.danger,warning:z.warning,success:z.success}[n],I=Ke(C,["#ffffff","#000000",z.bg]),R=typeof o=="string"?B(o):o,M=s?B(s):void 0,N=e==="solid"?{backgroundColor:C,color:I,border:"none",boxShadow:u&&!v?`0 0 20px ${C}55`:void 0}:e==="outline"?{backgroundColor:"transparent",color:C,border:`2px solid ${C}`}:e==="ghost"?{backgroundColor:"transparent",color:C,border:"none"}:{backgroundColor:"transparent",color:C,border:"none",textDecoration:"underline"},T=b("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",rs[r],ns[r],$r[r],e!=="link"&&$r[r],d&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!v&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:y,"aria-busy":i,"aria-disabled":$,disabled:$,className:ue(T,m),style:{...N,...x},...h,children:i?t.jsxs(t.Fragment,{children:[t.jsx(ss,{size:r}),M??R]}):t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{"aria-hidden":"true",children:a}),R,l&&t.jsx("span",{"aria-hidden":"true",children:l})]})})});yn.displayName="TkxButton";const is={none:"",sm:"p-3",md:"p-5",lg:"p-7"},vn=c.forwardRef(({variant:e="default",isHoverable:r,isClickable:n,padding:i="md",as:s,children:a,className:l,style:d,...u},p)=>{const o=ee(),m=ye(),x=s??(n?"button":"div"),h={default:{backgroundColor:o.surface,border:`1px solid ${o.border}`},glass:{backgroundColor:`${o.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${o.border}55`,boxShadow:`0 4px 24px ${o.bg}40`},quantum:{backgroundColor:o.surfaceAlt,border:`1px solid ${o.primary}33`,boxShadow:`0 0 24px ${o.primary}18`},elevated:{backgroundColor:o.surface,boxShadow:`0 4px 20px ${o.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${o.border}`}}[e],y=b("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",is[i],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(x,{ref:p,className:ue("tkx-card",y,l),style:{color:o.text,...h,...d},...u,children:a})});vn.displayName="TkxCard";function as({title:e,subtitle:r,action:n,children:i,className:s,...a}){const l=ee();return t.jsxs("div",{className:ue(b("flex justify-between items-start mb-4"),s),...a,children:[t.jsxs("div",{className:b("flex-1 min-w-0"),children:[e&&t.jsx("h3",{className:b("text-base font-semibold m-0"),style:{color:l.text},children:e}),r&&t.jsx("p",{className:b("text-sm mt-1 mb-0"),style:{color:l.textMuted},children:r}),i]}),n&&t.jsx("div",{className:b("ml-3 shrink-0"),children:n})]})}function ls({children:e,className:r,...n}){return t.jsx("div",{className:ue(b(""),r),...n,children:e})}function cs({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{className:ue(b("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${s.border}`,...n},...i,children:e})}const kn=c.forwardRef(({label:e,id:r,error:n,hint:i,leftAddon:s,rightAddon:a,isInvalid:l,isRequired:d,disabled:u,className:p,style:o,...m},x)=>{const h=ee(),y=c.useId(),z=r??y,v=`${z}-hint`,$=`${z}-error`,w=l||!!n,C=[i&&v,w&&$].filter(Boolean).join(" ")||void 0,I=B(e),R=n?B(n):void 0,M=i?B(i):void 0,N=w?h.danger:h.border;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),p),style:o,children:[t.jsxs("label",{htmlFor:z,className:b("text-sm font-medium font-sans"),style:{color:h.text},children:[I,d&&t.jsx("span",{"aria-hidden":"true",className:b("ml-1"),style:{color:h.danger},children:"*"})]}),t.jsxs("div",{className:b("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${N}`,backgroundColor:h.surface},children:[s&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderRight:`1px solid ${h.border}`},children:s}),t.jsx("input",{ref:x,id:z,"aria-invalid":w,"aria-required":d,"aria-describedby":C,disabled:u,className:ue(b("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:h.text},...m}),a&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderLeft:`1px solid ${h.border}`},children:a})]}),M&&!R&&t.jsx("span",{id:v,className:b("text-xs"),style:{color:h.textMuted},children:M}),R&&t.jsxs("span",{id:$,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:h.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),R]})]})});kn.displayName="TkxInput";const ds={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},us={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},wn=c.forwardRef(({variant:e="default",size:r="md",dot:n=!1,pulse:i=!1,outlined:s=!1,children:a,className:l,style:d,...u},p)=>{const o=ee(),x={default:o.border,primary:o.primary,secondary:o.secondary,danger:o.danger,warning:o.warning,success:o.success,info:o.info}[e],h=Ke(x,["#ffffff","#000000",o.bg]),y=typeof a=="string"?B(a):a;return n?t.jsx("span",{ref:p,"aria-label":typeof a=="string"?B(a):void 0,className:ue(b("inline-block rounded-full",us[r],i&&"animate-pulse"),l),style:{backgroundColor:x,...d},...u}):t.jsx("span",{ref:p,className:ue(b("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",ds[r],i&&"animate-pulse"),l),style:{backgroundColor:s?"transparent":x,color:s?x:h,border:s?`1px solid ${x}`:"none",...d},...u,children:y})});wn.displayName="TkxBadge";const fs={sm:"4px",md:"8px",lg:"12px"},ps={sm:32,md:48,lg:64},jn=c.forwardRef(({value:e,variant:r="linear",size:n="md",label:i,showValue:s,color:a,className:l,style:d,...u},p)=>{const o=ee(),m=ye(),x=a??o.primary,h=e===void 0,y=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:v}=Dt({value:e},{value:{type:"number",min:0,max:100}});v.length>0&&console.warn("[TkxProgress]",v.join(", "))}if(r==="circular"){const v=ps[n],$=n==="sm"?3:n==="md"?4:5,w=(v-$*2)/2,C=2*Math.PI*w,I=h?0:C-y/100*C;return t.jsxs("div",{ref:p,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),className:ue(b("inline-flex flex-col items-center gap-1"),l),style:d,...u,children:[t.jsxs("svg",{width:v,height:v,viewBox:`0 0 ${v} ${v}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:o.border,strokeWidth:$}),t.jsx("circle",{cx:v/2,cy:v/2,r:w,fill:"none",stroke:x,strokeWidth:$,strokeLinecap:"round",strokeDasharray:C,strokeDashoffset:I,transform:`rotate(-90 ${v/2} ${v/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:h&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!h&&t.jsxs("span",{className:b("text-xs"),style:{color:o.textMuted},children:[y,"%"]})]})}const z=fs[n];return t.jsxs("div",{ref:p,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:y,"aria-label":i??(h?"Loading":`${y}%`),className:ue(b("flex flex-col gap-1 w-full"),l),style:d,...u,children:[i&&t.jsxs("div",{className:b("flex justify-between text-sm"),style:{color:o.text},children:[t.jsx("span",{children:i}),s&&!h&&t.jsxs("span",{children:[y,"%"]})]}),t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:z,borderRadius:z,backgroundColor:o.border},children:t.jsx("div",{style:{height:"100%",borderRadius:z,backgroundColor:x,width:h?"40%":`${y}%`,transition:m?"none":"width 300ms ease",animation:h&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});jn.displayName="TkxProgress";const xs={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},Sn=c.forwardRef(({checked:e,onChange:r,label:n,size:i="md",hideLabel:s,disabled:a,className:l,style:d,...u},p)=>{const o=ee(),m=ye(),x=c.useId();Dt({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:h,th:y,td:z,gap:v}=xs[i],$=e?h-z-v:v,w=e?o.primary:o.border;return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2",a?"opacity-50":""),l),style:d,children:[!s&&t.jsx("label",{htmlFor:x,className:b("text-sm font-sans",a?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:o.text},children:n}),t.jsx("button",{ref:p,id:x,role:"switch","aria-checked":e,"aria-label":s?n:void 0,disabled:a,onClick:()=>!a&&r(!e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&!a&&(C.preventDefault(),r(!e))},className:ue(b("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",a?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:h,height:y,borderRadius:y,backgroundColor:w},...u,children:t.jsx("span",{"aria-hidden":"true",className:b("absolute rounded-full"),style:{top:"50%",left:$,width:z,height:z,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});Sn.displayName="TkxToggle";const hs={info:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})};function ms({variant:e,title:r,children:n,dismissible:i,onDismiss:s,icon:a,style:l,className:d}){const u=ee(),p=mr(),o=r?B(r):void 0;c.useEffect(()=>{o&&p(o,e==="danger"||e==="warning"?"assertive":"polite")},[o,e,p]);const x={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[e],h=e==="danger"||e==="warning"?"alert":"status";return t.jsxs("div",{role:h,className:b("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",d??""),style:{backgroundColor:`${x}18`,borderColor:x,color:u.text,...l},children:[t.jsx("span",{className:b("shrink-0 mt-[1px]"),style:{color:x},children:a??hs[e]}),t.jsxs("div",{className:b("flex-1 min-w-0"),children:[o&&t.jsx("p",{className:b("m-0 font-semibold text-sm mb-1"),children:o}),t.jsx("div",{className:b("text-sm leading-relaxed"),children:n})]}),i&&s&&t.jsx("button",{"aria-label":"Dismiss alert",onClick:s,className:b("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const gs={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let rr=0;function bs(){++rr===1&&(document.body.style.overflow="hidden")}function Mr(){--rr<=0&&(rr=0,document.body.style.overflow="")}function ys({isOpen:e,onClose:r,title:n,size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,children:l,footer:d}){const u=ee(),p=c.useId(),o=Lt(e),m=ye(),x=mr(),h=B(n),y=i==="full";return Ft(r,a&&e),c.useEffect(()=>(e?(bs(),x(h,"polite")):Mr(),()=>{e&&Mr()}),[e,h,x]),!e||typeof document>"u"?null:Be.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:s?r:void 0,className:b("absolute inset-0",!m&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-labelledby":p,className:b("relative z-10 flex flex-col overflow-hidden",!m&&"animate-slide-up",y?"":"rounded-xl"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,width:gs[i],maxWidth:"100%",maxHeight:y?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[t.jsxs("div",{className:b("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[t.jsx("h2",{id:p,className:b("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:h}),t.jsx("button",{onClick:r,"aria-label":"Close dialog",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:l}),d&&t.jsx("div",{className:b("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const $n=c.createContext(null);function Mn(){const e=c.useContext($n);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function vs({defaultIndex:e=0,activeIndex:r,onChange:n,children:i,tabCount:s=0,style:a,className:l}){const[d,u]=c.useState(e),p=c.useId(),o=r!==void 0?r:d,m=x=>{r===void 0&&u(x),n==null||n(x)};return t.jsx($n.Provider,{value:{activeIndex:o,setActiveIndex:m,baseId:p,tabCount:s},children:t.jsx("div",{className:l,style:a,children:i})})}function ks({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{role:"tablist",className:ue(b("flex gap-1"),r),style:{borderBottom:`2px solid ${s.border}`,...n},...i,children:e})}function ws({index:e,children:r,disabled:n=!1,className:i,style:s}){const a=ee(),{activeIndex:l,setActiveIndex:d,baseId:u,tabCount:p}=Mn(),o=c.useRef(null),m=l===e;return t.jsx("button",{ref:o,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:ue(b("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",n?"opacity-50 cursor-not-allowed":""),i),style:{color:m?a.primary:a.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${a.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!n&&d(e),onKeyDown:x=>dn(x,e,p,h=>{var y;d(h),(y=document.getElementById(`${u}-tab-${h}`))==null||y.focus()}),children:r})}function js({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function Ss({index:e,children:r,style:n,className:i}){const{activeIndex:s,baseId:a}=Mn();return s!==e?null:t.jsx("div",{role:"tabpanel",id:`${a}-panel-${e}`,"aria-labelledby":`${a}-tab-${e}`,tabIndex:0,className:ue(b("pt-4"),i),style:n,children:r})}const $s={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function Ms({content:e,children:r,placement:n="top",delay:i=300}){const s=ee(),[a,l]=c.useState(!1),d=c.useRef(null),u=c.useId(),p=c.useRef(null),o=ye(),m=B(e),x=Ke(s.surfaceAlt,[s.text,"#ffffff","#000000"]);function h(){p.current=setTimeout(()=>l(!0),i)}function y(){p.current&&clearTimeout(p.current),l(!1)}Ft(y,a),mn(d,y);const z=c.cloneElement(r,{"aria-describedby":a?u:void 0,onMouseEnter:v=>{var $,w;(w=($=r.props).onMouseEnter)==null||w.call($,v),h()},onMouseLeave:v=>{var $,w;(w=($=r.props).onMouseLeave)==null||w.call($,v),y()},onFocus:v=>{var $,w;(w=($=r.props).onFocus)==null||w.call($,v),h()},onBlur:v=>{var $,w;(w=($=r.props).onBlur)==null||w.call($,v),y()}});return t.jsxs("span",{ref:d,className:b("relative inline-flex"),children:[z,a&&t.jsx("span",{id:u,role:"tooltip",className:b("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!o&&"animate-fade-in"),style:{backgroundColor:s.surfaceAlt,color:x,border:`1px solid ${s.border}`,boxShadow:`0 4px 12px ${s.bg}40`,maxWidth:280,...$s[n]},children:m})]})}function Cr({variant:e,width:r,height:n,animation:i,bgColor:s,accentColor:a}){const l=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:l,rectangular:"80px"}[e],p=b(e==="circular"?"rounded-full":e==="text"?"rounded":"rounded-lg"),o=i==="pulse"?b("animate-pulse"):i==="wave"?b("animate-shimmer"):"",m=i==="wave"?{background:`linear-gradient(90deg,${s} 25%,${a} 50%,${s} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:s};return t.jsx("div",{className:ue(p,o),style:{width:l,height:u,...m}})}const gr=c.forwardRef(({variant:e="rectangular",width:r,height:n,lines:i,animation:s="pulse",className:a,style:l,...d},u)=>{const p=ee(),m=ye()?!1:s;return e==="text"&&i&&i>1?t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:ue(b("flex flex-col gap-2"),a),style:l,...d,children:Array.from({length:i},(x,h)=>t.jsx(Cr,{variant:"text",width:h===i-1?"75%":r,height:n,animation:m,bgColor:p.surfaceAlt,accentColor:p.border},h))}):t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:a,style:l,...d,children:t.jsx(Cr,{variant:e,width:r,height:n,animation:m,bgColor:p.surfaceAlt,accentColor:p.border})})});gr.displayName="TkxSkeleton";const Cs={xs:24,sm:32,md:40,lg:56,xl:72},Ts={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Cn=c.forwardRef(({src:e,alt:r,initials:n,size:i="md",shape:s="circle",status:a,className:l,style:d,...u},p)=>{const o=ee(),[m,x]=c.useState(!1),h=Cs[i],y=s==="circle",z=o.surfaceAlt,v=Ke(z,[o.text,o.textMuted]),$=e&&!m,w=!$&&n,C=Math.max(8,h*.22),I=b("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),R=b("block object-cover",y?"rounded-full":"rounded-lg"),M=b("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:p,className:ue(I,l),style:{width:h,height:h,...d},...u,children:[$?t.jsx("img",{src:B(e),alt:B(r),onError:()=>x(!0),className:R,style:{width:h,height:h}}):t.jsx("div",{role:"img","aria-label":B(r),className:M,style:{width:h,height:h,backgroundColor:z,color:v,fontSize:h*.38},children:w?B(n).slice(0,2).toUpperCase():t.jsxs("svg",{width:h*.5,height:h*.5,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),a&&t.jsx("span",{"aria-label":`Status: ${a}`,className:b("absolute bottom-0 right-0 rounded-full"),style:{width:C,height:C,backgroundColor:Ts[a],border:`2px solid ${o.bg}`}})]})});Cn.displayName="TkxAvatar";function Is({dir:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:b("shrink-0"),children:e==="asc"?t.jsx("path",{d:"M7 14l5-5 5 5H7z"}):e==="desc"?t.jsx("path",{d:"M7 10l5 5 5-5H7z"}):t.jsx("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function Es({columns:e,data:r,caption:n,sortable:i,stickyHeader:s,isLoading:a,emptyState:l,style:d,className:u,striped:p}){const o=ee(),[m,x]=c.useState(null),[h,y]=c.useState("asc"),z=c.useMemo(()=>!m||!i?r:[...r].sort((w,C)=>{const I=w[m],R=C[m];let M=0;return typeof I=="string"&&typeof R=="string"?M=I.localeCompare(R):typeof I=="number"&&typeof R=="number"&&(M=I-R),h==="asc"?M:-M}),[r,m,h,i]);function v(w){m===w?y(C=>C==="asc"?"desc":"asc"):(x(w),y("asc"))}function $(w){return m!==w?"none":h}return t.jsx("div",{className:b("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${o.border}`,...d},children:t.jsxs("table",{className:b("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:o.text},children:[n&&t.jsx("caption",{className:b("text-sm text-left p-2"),style:{color:o.textMuted},children:B(n)}),t.jsx("thead",{style:s?{position:"sticky",top:0,backgroundColor:o.surfaceAlt,zIndex:1}:{backgroundColor:o.surfaceAlt},children:t.jsx("tr",{children:e.map(w=>{const C=i&&w.sortable!==!1,I=$(w.key);return t.jsx("th",{scope:"col","aria-sort":C?I==="none"?"none":I==="asc"?"ascending":"descending":void 0,className:b("px-4 py-3 text-left font-semibold whitespace-nowrap",C?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:o.textMuted,borderBottom:`2px solid ${o.border}`,width:w.width},onClick:()=>C&&v(w.key),onKeyDown:R=>{C&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(w.key))},tabIndex:C?0:void 0,children:t.jsxs("span",{className:b("inline-flex items-center gap-1.5"),children:[B(w.header),C&&t.jsx(Is,{dir:I})]})},String(w.key))})})}),t.jsx("tbody",{children:a?Array.from({length:5},(w,C)=>t.jsx("tr",{children:e.map(I=>t.jsx("td",{className:b("px-4 py-3"),children:t.jsx(gr,{variant:"text",height:"16px"})},String(I.key)))},C)):z.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:b("px-4 py-8 text-center"),style:{color:o.textMuted},children:l??"No data available"})}):z.map((w,C)=>t.jsx("tr",{style:{backgroundColor:p&&C%2===1?o.surfaceAlt:"transparent",borderBottom:`1px solid ${o.border}`},children:e.map(I=>{const R=w[I.key],M=I.render?I.render(R,w):typeof R=="string"?B(R):String(R??"");return t.jsx("td",{className:b("px-4 py-3"),style:{color:o.text},children:M},String(I.key))})},C))})]})})}const Tn=c.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:i,style:s,...a},l)=>{const d=ee(),u=r?B(r):void 0,p=e==="vertical",o=p?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?t.jsxs("div",{role:"separator","aria-orientation":e,className:ue(b("flex items-center gap-3 text-xs"),i),style:{color:d.textMuted,...s},...a,children:[t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}}),t.jsx("span",{children:u}),t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}})]}):t.jsx("hr",{ref:l,role:"separator","aria-orientation":e,className:ue(b(p?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[o]:m,...s},...a})});Tn.displayName="TkxDivider";const zs={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function Tr(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Ns(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=6,a=i-n.bottom-s,l=n.top-s,d=a>=Math.min(r,200)||a>=l?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+s:n.top+window.scrollY-s-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function Rs({size:e,color:r}){return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[t.jsx("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function In({options:e,value:r,defaultValue:n,placeholder:i="Select an option…",size:s="md",isDisabled:a=!1,isInvalid:l=!1,label:d,hint:u,errorMessage:p,multiple:o=!1,searchable:m=!1,clearable:x=!1,isLoading:h=!1,onChange:y,renderOption:z,maxMenuHeight:v=280,id:$,className:w,style:C}){const I=ee(),R=c.useId(),M=$??R,N=`${M}-listbox`,T=`${M}-hint`,j=`${M}-error`,k=r!==void 0,[Y,f]=c.useState(Tr(n)),g=k?Tr(r):Y,[S,F]=c.useState(!1),[D,V]=c.useState(""),[E,P]=c.useState(-1),[W,O]=c.useState(null),[A,H]=c.useState(""),Q=c.useRef(null),G=c.useRef(null),ne=c.useRef(null),pe=c.useRef(null),xe=c.useRef(null),oe=zs[s],me=l||!!p,X=m&&D?e.filter(U=>U.label.toLowerCase().includes(D.toLowerCase())):e,Z=X.filter(U=>!U.disabled),ve=X.reduce((U,le)=>{const se=le.group??"";return U[se]||(U[se]=[]),U[se].push(le),U},{}),we=c.useCallback(U=>{var se;let le;o?le=g.includes(U)?g.filter(Se=>Se!==U):[...g,U]:le=[U],k||f(le),y==null||y(o?le:le[0]??""),o||(F(!1),V(""),P(-1),(se=G.current)==null||se.focus())},[k,o,y,g]),de=c.useCallback((U,le)=>{le.stopPropagation();const se=g.filter(Se=>Se!==U);k||f(se),y==null||y(o?se:se[0]??"")},[k,o,y,g]),ge=c.useCallback(U=>{U.stopPropagation(),k||f([]),y==null||y(o?[]:"")},[k,o,y]),J=c.useCallback(()=>{!G.current||!S||O(Ns(G.current,v))},[S,v]);c.useEffect(()=>{if(S)return J(),window.addEventListener("scroll",J,!0),window.addEventListener("resize",J),()=>{window.removeEventListener("scroll",J,!0),window.removeEventListener("resize",J)}},[S,J]),c.useEffect(()=>{if(!S)return;const U=le=>{var Se,Ae;const se=le.target;(Se=G.current)!=null&&Se.contains(se)||(Ae=pe.current)!=null&&Ae.contains(se)||(F(!1),V(""))};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[S]),c.useEffect(()=>{S&&m&&setTimeout(()=>{var U;return(U=ne.current)==null?void 0:U.focus()},0)},[S,m]),c.useEffect(()=>{var le;if(!S||E<0)return;const U=(le=xe.current)==null?void 0:le.querySelector(`[data-idx="${E}"]`);U==null||U.scrollIntoView({block:"nearest"})},[E,S]);const ie=U=>{switch(U.key){case"Enter":case" ":U.preventDefault(),S?E>=0&&Z[E]&&we(Z[E].value):te();break;case"Escape":U.preventDefault(),F(!1),V("");break;case"ArrowDown":U.preventDefault(),S?P(le=>Math.min(le+1,Z.length-1)):te();break;case"ArrowUp":U.preventDefault(),S?P(le=>Math.max(le-1,0)):te();break;case"Home":U.preventDefault(),S&&P(0);break;case"End":U.preventDefault(),S&&P(Z.length-1);break;default:U.key.length===1&&!U.ctrlKey&&!U.metaKey&&(S||te(),q(U.key))}},re=U=>{var le;switch(U.key){case"Escape":U.preventDefault(),F(!1),V(""),(le=G.current)==null||le.focus();break;case"ArrowDown":U.preventDefault(),P(se=>Math.min(se+1,Z.length-1));break;case"ArrowUp":U.preventDefault(),P(se=>Math.max(se-1,0));break;case"Home":U.preventDefault(),P(0);break;case"End":U.preventDefault(),P(Z.length-1);break;case"Enter":U.preventDefault(),E>=0&&Z[E]&&we(Z[E].value);break}};function q(U){Q.current&&clearTimeout(Q.current);const le=A+U.toLowerCase();H(le);const se=Z.findIndex(Se=>Se.label.toLowerCase().startsWith(le));se>=0&&P(se),Q.current=setTimeout(()=>H(""),800)}function te(){if(a||h)return;F(!0);const U=Z.findIndex(le=>g.includes(le.value));P(U>=0?U:0)}const be=me?I.danger:S?I.primary:I.border,$e=E>=0&&Z[E]?`${M}-opt-${Z[E].value}`:void 0,Me=[u&&T,me&&j].filter(Boolean).join(" ")||void 0,Te=g.map(U=>e.find(le=>le.value===U)).filter(Boolean),Xe=S&&W?Be.createPortal(t.jsxs("div",{ref:pe,role:"listbox",id:N,"aria-label":d?B(d):"Options","aria-multiselectable":o,style:{position:"absolute",top:W.top,left:W.left,width:W.width,zIndex:9999,backgroundColor:I.surface,border:`1.5px solid ${I.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:W.width,maxHeight:v,display:"flex",flexDirection:"column"},children:[m&&t.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${I.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("path",{d:"M21 21l-4.35-4.35"})]}),t.jsx("input",{ref:ne,type:"text",value:D,onChange:U=>{V(U.target.value),P(0)},onKeyDown:re,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:I.text,fontSize:oe.fontSize,fontFamily:"inherit",width:"100%"}})]}),t.jsxs("div",{ref:xe,style:{overflowY:"auto",flexGrow:1,maxHeight:v-(m?48:0)},children:[Object.entries(ve).map(([U,le])=>t.jsxs("div",{children:[U&&t.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:I.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:I.surface,zIndex:1,borderBottom:`1px solid ${I.border}`},children:B(U)}),le.map(se=>{const Se=Z.indexOf(se),Ae=Se===E,De=g.includes(se.value),lt=z?z(se,De):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[se.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:se.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(se.label)})]}),se.description&&t.jsx("span",{style:{fontSize:"12px",color:I.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(se.description)})]});return t.jsxs("div",{id:`${M}-opt-${se.value}`,"data-idx":Se>=0?Se:void 0,role:"option","aria-selected":De,"aria-disabled":se.disabled||void 0,onClick:()=>!se.disabled&&we(se.value),onMouseEnter:()=>!se.disabled&&Se>=0&&P(Se),style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:se.disabled?I.textMuted:I.text,backgroundColor:Ae?`${I.primary}22`:De?`${I.primary}12`:"transparent",cursor:se.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:se.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[lt,De&&!z&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},se.value)})]},U)),X.length===0&&t.jsx("div",{style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:I.textMuted,textAlign:"center"},children:h?"Loading…":"No options found"})]})]}),document.body):null,Ee=x&&g.length>0&&!a&&!h;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),w),style:C,children:[d&&t.jsx("label",{htmlFor:M,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:I.text,userSelect:"none"},children:B(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:a?.55:1},children:t.jsxs("button",{ref:G,id:M,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":N,"aria-activedescendant":$e,"aria-invalid":me||void 0,"aria-describedby":Me,"aria-multiselectable":o,disabled:a,onClick:()=>S?F(!1):te(),onKeyDown:ie,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:o&&g.length>0?`4px ${oe.px}`:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",backgroundColor:I.surface,color:g.length>0?I.text:I.textMuted,border:`1.5px solid ${be}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:a?"not-allowed":"pointer",outline:"none",minHeight:s==="sm"?34:s==="lg"?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:o&&Te.length>0?Te.map(U=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${oe.tagPy} ${oe.tagPx}`,fontSize:`calc(${oe.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${I.primary}22`,color:I.primary,borderRadius:6,border:`1px solid ${I.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:B(U.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${B(U.label)}`,tabIndex:-1,onClick:le=>de(U.value,le),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]},U.value)):!o&&g.length>0?(()=>{const U=e.find(le=>le.value===g[0]);return t.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(U==null?void 0:U.icon)&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:U.icon}),U?B(U.label):""]})})():t.jsx("span",{style:{opacity:.6},children:B(i)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:I.textMuted},children:[h&&t.jsx(Rs,{size:oe.iconSize,color:I.primary}),Ee&&!h&&t.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:ge,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:U=>U.currentTarget.style.opacity="1",onMouseLeave:U=>U.currentTarget.style.opacity="0.7",children:t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:S?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:t.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!me&&t.jsx("span",{id:T,style:{fontSize:"12px",color:I.textMuted,fontFamily:"inherit"},children:B(u)}),me&&p&&t.jsxs("span",{id:j,role:"alert",style:{fontSize:"12px",color:I.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),B(p)]}),Xe]})}In.displayName="TkxSelect";const As={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},En=c.forwardRef(({label:e,hint:r,isInvalid:n,errorMessage:i,isIndeterminate:s=!1,size:a="md",colorScheme:l="primary",checked:d,defaultChecked:u,onChange:p,disabled:o,className:m,style:x,id:h,...y},z)=>{const v=ee(),$=ye(),w=c.useId(),C=h??w,I=`${C}-hint`,R=`${C}-error`,M=c.useRef(null),[N,T]=c.useState(!1),j=As[a],k=n||!!i,f={primary:v.primary,success:v.success,danger:v.danger,warning:v.warning}[l]??v.primary,g=d!==void 0?d:void 0;c.useEffect(()=>{const O=(z==null?void 0:z.current)??M.current;O&&(O.indeterminate=s)},[s,z]);const S=s||(g??!1),F=S?f:v.surface,D=k?v.danger:S?f:v.border,V=Ke(f),E=N?{outline:`2px solid ${f}`,outlineOffset:"2px"}:{},P=[r&&I,k&&R].filter(Boolean).join(" ")||void 0,W=!$&&S?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return t.jsxs("div",{className:ue(b("flex flex-col gap-1"),m),style:{opacity:o?.5:1,...x},children:[t.jsx("style",{children:`
|
|
5
5
|
@keyframes tkx-check-scale-in {
|
|
6
6
|
from { transform: scale(0.4); opacity: 0; }
|
|
7
7
|
to { transform: scale(1); opacity: 1; }
|
|
8
8
|
}
|
|
9
|
-
`}),t.jsxs("label",{htmlFor:C,className:b("flex items-center gap-2 select-none"),style:{cursor:o?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:O=>{M.current=O,typeof z=="function"?z(O):z&&(z.current=O)},id:C,type:"checkbox",checked:d,defaultChecked:u,onChange:
|
|
9
|
+
`}),t.jsxs("label",{htmlFor:C,className:b("flex items-center gap-2 select-none"),style:{cursor:o?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:O=>{M.current=O,typeof z=="function"?z(O):z&&(z.current=O)},id:C,type:"checkbox",checked:d,defaultChecked:u,onChange:p,disabled:o,"aria-invalid":k,"aria-describedby":P,onFocus:O=>{O.target.matches(":focus-visible")&&T(!0)},onBlur:()=>T(!1),className:b("sr-only"),...y}),t.jsx("span",{"aria-hidden":"true",style:{width:j.box,height:j.box,minWidth:j.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:F,display:"flex",alignItems:"center",justifyContent:"center",transition:$?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...E},children:s?t.jsx("span",{"aria-hidden":"true",style:{display:"block",width:j.box*.5,height:2,backgroundColor:V,borderRadius:"1px",...W}}):S?t.jsx("svg",{width:j.box*.6,height:j.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:V,strokeWidth:j.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:W,children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&t.jsx("span",{style:{fontSize:j.fontSize,color:v.text,lineHeight:1.4},children:typeof e=="string"?B(e):e})]}),r&&!k&&t.jsx("span",{id:I,className:b("text-xs ml-7"),style:{color:v.textMuted,marginLeft:j.box+8},children:B(r)}),k&&i&&t.jsxs("span",{id:R,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:v.danger,marginLeft:j.box+8},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),B(i)]})]})});En.displayName="TkxCheckbox";const zn=c.createContext(null);function Ds(){return c.useContext(zn)}const Ls={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Nn=c.forwardRef(({label:e,hint:r,size:n="md",colorScheme:i="primary",value:s,checked:a,onChange:l,disabled:d,name:u,className:p,style:o,id:m,...x},h)=>{const y=ee(),z=ye(),v=c.useId(),$=m??v,w=Ds(),C=w?w.value===String(s??""):a??!1,I=d??(w==null?void 0:w.isDisabled)??!1,R=u??(w==null?void 0:w.name)??"",M=()=>{I||(w?w.onChange(String(s??"")):l==null||l({target:{value:String(s??"")}}))},N=Ls[n],j={primary:y.primary,success:y.success,danger:y.danger}[i]??y.primary;Ke(j);const k=C?j:y.border,Y=y.surface;return t.jsxs("div",{className:ue(b("flex flex-col gap-0.5"),p),style:{opacity:I?.5:1,...o},children:[t.jsx("style",{children:`
|
|
10
10
|
@keyframes tkx-radio-dot-in {
|
|
11
11
|
from { transform: scale(0) translate(-50%, -50%); opacity: 0; }
|
|
12
12
|
to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
|
|
13
13
|
}
|
|
14
|
-
`}),t.jsxs("label",{htmlFor:$,className:b("flex items-center gap-2 select-none"),style:{cursor:I?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:h,id:$,type:"radio",name:R,value:s,checked:C,onChange:M,disabled:I,"aria-invalid":w==null?void 0:w.isInvalid,className:b("sr-only"),...
|
|
14
|
+
`}),t.jsxs("label",{htmlFor:$,className:b("flex items-center gap-2 select-none"),style:{cursor:I?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:h,id:$,type:"radio",name:R,value:s,checked:C,onChange:M,disabled:I,"aria-invalid":w==null?void 0:w.isInvalid,className:b("sr-only"),...x}),t.jsx("span",{"aria-hidden":"true",style:{position:"relative",width:N.outer,height:N.outer,minWidth:N.outer,borderRadius:"50%",border:`2px solid ${k}`,backgroundColor:Y,display:"inline-block",boxSizing:"border-box",transition:z?"none":"border-color 120ms"},children:C&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:N.inner,height:N.inner,borderRadius:"50%",backgroundColor:j,transform:"translate(-50%, -50%)",transformOrigin:"center",...z?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&t.jsx("span",{style:{fontSize:N.fontSize,color:y.text,lineHeight:1.4},children:typeof e=="string"?B(e):e})]}),r&&t.jsx("span",{className:b("text-xs"),style:{color:y.textMuted,marginLeft:N.outer+8},children:B(r)})]})});Nn.displayName="TkxRadio";function Fs({name:e,value:r,defaultValue:n="",onChange:i,label:s,orientation:a="vertical",isDisabled:l=!1,isInvalid:d=!1,errorMessage:u,children:p}){const o=ee(),x=`${c.useId()}-error`,[h,y]=c.useState(n),z=r!==void 0,v=z?r:h,$=C=>{z||y(C),i==null||i(C)},w=d||!!u;return t.jsx(zn.Provider,{value:{name:e,value:v,onChange:$,isDisabled:l,isInvalid:d},children:t.jsxs("div",{role:"radiogroup","aria-label":s?B(s):void 0,"aria-describedby":w?x:void 0,"aria-invalid":w,children:[s&&t.jsx("div",{className:b("text-sm font-medium font-sans mb-2"),style:{color:o.text},children:B(s)}),t.jsx("div",{className:b(a==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:p}),w&&u&&t.jsxs("span",{id:x,role:"alert",className:b("text-xs flex items-center gap-1 mt-1"),style:{color:o.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),B(u)]})]})})}const Rn=5;let tt=[],Ne=[];const nr=new Set,xt=new Map;function br(){const e=[...Ne];nr.forEach(r=>r(e))}function An(e,r){r!==0&&xt.set(e,setTimeout(()=>yr(e),r))}function yr(e){clearTimeout(xt.get(e)),xt.delete(e);const r=Ne.some(n=>n.id===e);if(Ne=Ne.filter(n=>n.id!==e),tt=tt.filter(n=>n.id!==e),r&&tt.length>0&&Ne.length<Rn){const n=tt.shift();Ne=[...Ne,n],An(n.id,n.duration??4e3)}br()}function Ps(e){const r=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:r,duration:e.duration??4e3};return Ne.length<Rn?(Ne=[...Ne,n],An(r,n.duration)):tt=[...tt,n],br(),r}function Bs(){xt.forEach(e=>clearTimeout(e)),xt.clear(),Ne=[],tt=[],br()}function Ws(){const e=c.useCallback(i=>Ps(i),[]),r=c.useCallback(i=>yr(i),[]),n=c.useCallback(()=>Bs(),[]);return{toast:e,dismiss:r,dismissAll:n}}const Hs={default:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},Vs={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function Os(e,r){return r?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Ys({toast:e,position:r,onDismiss:n,reduced:i}){const s=ee(),a=c.useId(),l={default:s.textMuted,success:s.success,danger:s.danger,warning:s.warning,info:s.info},d=e.variant??"default",u=l[d],p=d==="danger",o=e.title?B(e.title):void 0,m=e.description?B(e.description):void 0;return t.jsxs("div",{role:p?"alert":"status","aria-live":p?"assertive":"polite","aria-atomic":"true","aria-labelledby":o?a:void 0,className:b("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:s.surface,border:`1px solid ${u}55`,boxShadow:`0 8px 24px ${s.bg}cc`,color:s.text,...Os(r,i)},children:[t.jsx("span",{className:b("shrink-0 mt-[2px]"),style:{color:u},children:Hs[d]}),t.jsxs("div",{className:b("flex-1 min-w-0"),children:[o&&t.jsx("p",{id:a,className:b("m-0 font-semibold text-sm leading-snug"),children:o}),m&&t.jsx("p",{className:b("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:s.textMuted},children:m}),e.action&&t.jsx("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:b("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:u},children:B(e.action.label)})]}),t.jsx("button",{"aria-label":"Dismiss notification",onClick:()=>n(e.id),className:b("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function _s({position:e="top-right"}){const[r,n]=c.useState([...Ne]),i=ye();c.useEffect(()=>{n([...Ne]);const u=p=>n([...p]);return nr.add(u),()=>{nr.delete(u)}},[]);const s=e.startsWith("bottom"),a=Vs[e],l=c.useRef(!1);if(c.useEffect(()=>{if(!(l.current||typeof document>"u")&&(l.current=!0,!document.getElementById("tkx-toast-kf"))){const u=document.createElement("style");u.id="tkx-toast-kf",u.textContent=`
|
|
15
15
|
@keyframes tkx-toast-slide-down {
|
|
16
16
|
from { opacity: 0; transform: translateY(-16px); }
|
|
17
17
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -20,21 +20,21 @@
|
|
|
20
20
|
from { opacity: 0; transform: translateY(16px); }
|
|
21
21
|
to { opacity: 1; transform: translateY(0); }
|
|
22
22
|
}
|
|
23
|
-
`,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=s?[...r].reverse():r;return Be.createPortal(t.jsx("div",{"aria-label":"Notifications",className:b("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:a,children:d.map(u=>t.jsx("div",{className:b("pointer-events-auto"),children:t.jsx(Ds,{toast:u,position:e,onDismiss:br,reduced:i})},u.id))}),document.body)}const Fs={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function Tr({open:e,reduced:r,iconStyle:n,size:i,color:s}){const a=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?t.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:a,flexShrink:0},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),t.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function Ps({isOpen:e,reduced:r,children:n,id:i,triggerId:s}){const a=c.useRef(null),l=c.useRef(null),d=c.useRef(e),u=c.useRef(!1);c.useEffect(()=>{const o=a.current;o&&(e?(o.style.height="auto",o.style.overflow="visible"):(o.style.height="0px",o.style.overflow="hidden"))},[]),c.useEffect(()=>{if(d.current===e)return;d.current=e;const o=a.current,m=l.current;if(!(!o||!m)){if(r){o.style.height=e?"auto":"0px",o.style.overflow=e?"visible":"hidden";return}if(u.current){const p=o.getBoundingClientRect().height;o.style.transition="none",o.style.height=`${p}px`,o.offsetHeight}u.current=!0,o.style.overflow="hidden",e?(o.style.height="0px",o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height=`${m.scrollHeight}px`})})):(o.style.height=`${m.scrollHeight}px`,o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height="0px"})}))}},[e,r]);const x=o=>{if(o.propertyName!=="height")return;u.current=!1;const m=a.current;m&&(e?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return t.jsx("div",{ref:a,id:i,role:"region","aria-labelledby":s,onTransitionEnd:x,style:{willChange:"height"},children:t.jsx("div",{ref:l,children:n})})}function An({items:e,multiple:r=!1,defaultOpen:n,value:i,onChange:s,variant:a="default",size:l="md",iconPosition:d="right",iconStyle:u="chevron",flush:x=!1,className:o,style:m}){const p=ee(),h=ye(),y=c.useId(),z=i!==void 0,v=k=>k?Array.isArray(k)?new Set(k):new Set([k]):new Set,[$,w]=c.useState(()=>v(n)),C=z?v(i):$,I=c.useCallback((k,Y)=>{if(Y)return;let f;if(z){const S=v(i);f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k))}else{w(S=>{f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k));const F=[...f];return s==null||s(r?F:F[0]??""),f});return}const g=[...f];s==null||s(r?g:g[0]??"")},[r,s,z,i]),R=Fs[l],M=()=>{if(x)return{};switch(a){case"bordered":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},N=(k,Y,f)=>{if(x)return{};switch(a){case"default":return{borderBottom:f?"none":`1px solid ${p.border}`};case"bordered":return{borderBottom:f?"none":`1px solid ${p.border}`};case"separated":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};case"ghost":return{};default:return{}}},T=k=>a==="ghost"||a==="flush"?k?`${p.primary}10`:`${p.surfaceAlt}80`:k?`${p.primary}0d`:`${p.surfaceAlt}60`,j=a==="separated";return t.jsx("div",{className:b(o??""),style:{...M(),display:j?"flex":void 0,flexDirection:j?"column":void 0,gap:j?"8px":void 0,...m},children:e.map((k,Y)=>{const f=C.has(k.id),g=Y===e.length-1,S=`${y}-trigger-${k.id}`,F=`${y}-panel-${k.id}`;return t.jsxs("div",{className:k.className,style:N(Y,f,g),children:[t.jsxs("button",{id:S,type:"button",role:"button","aria-expanded":f,"aria-controls":F,disabled:k.disabled,onClick:()=>I(k.id,k.disabled),style:{width:"100%",display:"flex",alignItems:k.subtitle?"flex-start":"center",gap:"8px",padding:R.triggerPadding,border:"none",background:"transparent",cursor:k.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:R.fontSize,fontWeight:500,color:k.disabled?p.textMuted:p.text,opacity:k.disabled?.5:1,transition:h?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:D=>{k.disabled||(D.currentTarget.style.backgroundColor=T(f))},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=f?`${p.primary}0d`:"transparent"},onFocus:D=>{k.disabled||(D.currentTarget.style.outline=`2px solid ${p.primary}`,D.currentTarget.style.outlineOffset="2px")},onBlur:D=>{D.currentTarget.style.outline="none"},children:[k.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:k.subtitle?"1px":void 0},children:k.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Tr,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?p.primary:p.textMuted})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",lineHeight:1.4},children:k.title}),k.subtitle&&t.jsx("span",{style:{display:"block",fontSize:R.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:k.subtitle})]}),k.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:k.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Tr,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?p.primary:p.textMuted})})]}),t.jsx(Ps,{isOpen:f,reduced:h,id:F,triggerId:S,children:t.jsx("div",{style:{padding:R.contentPadding,fontSize:R.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:k.content})})]},k.id)})})}An.displayName="TkxAccordion";const Bs={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let nr=0;function Ws(){++nr===1&&(document.body.style.overflow="hidden")}function Ir(){--nr<=0&&(nr=0,document.body.style.overflow="")}function Hs(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function Vs(e,r){const n=Bs[r],i=e==="left"||e==="right",s={position:"absolute"};return i?{...s,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...s,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}function Er(){return t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Os({isOpen:e,onClose:r,placement:n="right",size:i="md",title:s,children:a,footer:l,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const x=ee(),o=ye(),m=c.useId(),p=Dt(e);if(Lt(r,u&&e),c.useEffect(()=>(e?Ws():Ir(),()=>{e&&Ir()}),[e]),typeof document>"u")return null;const h=Vs(n,i),y=Hs(n),z=o?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",v=typeof s=="string"?B(s):s;return Be.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[t.jsx("div",{"aria-hidden":"true",onClick:d?r:void 0,className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:o?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),t.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,className:b("absolute flex flex-col font-sans"),style:{...h,backgroundColor:x.surface,borderLeft:n==="right"?`1px solid ${x.border}`:void 0,borderRight:n==="left"?`1px solid ${x.border}`:void 0,borderTop:n==="bottom"?`1px solid ${x.border}`:void 0,borderBottom:n==="top"?`1px solid ${x.border}`:void 0,boxShadow:`0 20px 60px ${x.bg}99`,transform:e?"translate(0,0)":y,opacity:e?1:0,transition:z,willChange:"transform"},children:[s!==void 0&&t.jsxs("div",{className:b("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${x.border}`},children:[t.jsx("h2",{id:m,className:b("m-0 text-base font-semibold leading-snug"),style:{color:x.text},children:v}),t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:t.jsx(Er,{})})]}),s===void 0&&t.jsx("div",{className:b("flex justify-end px-3 pt-3 shrink-0"),children:t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:t.jsx(Er,{})})}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-5 py-4"),style:{color:x.text},children:a}),l&&t.jsx("div",{className:b("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${x.border}`},children:l})]})]}),document.body)}const Ys=["Su","Mo","Tu","We","Th","Fr","Sa"],zr=["January","February","March","April","May","June","July","August","September","October","November","December"],_s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Re(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ze(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Us(e,r,n){if(!r||!n)return!1;const i=ze(e).getTime(),s=ze(r).getTime(),a=ze(n).getTime(),l=Math.min(s,a),d=Math.max(s,a);return i>l&&i<d}function Nr(e,r,n){return!!(r&&Re(e,r)||n&&Re(e,n))}function _e(e,r="en-US"){return e?e.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function Ks(e){const r=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,i,s]=r.map(Number);if(n<1||n>12||i<1||i>31)return null;const a=new Date(s,n-1,i);return a.getMonth()!==n-1?null:a}function Rr(e,r){return new Date(e,r+1,0).getDate()}function Xs(e,r){const n=new Date(e,r,1).getDay(),i=Rr(e,r),s=[],a=Rr(e,r-1);for(let d=n-1;d>=0;d--)s.push(new Date(e,r-1,a-d));for(let d=1;d<=i;d++)s.push(new Date(e,r,d));let l=1;for(;s.length<42;)s.push(new Date(e,r+1,l++));return s}function Ut(e){return Math.floor(e/10)*10}function qs(){return[{label:"Today",getValue:()=>{const e=ze(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=ze(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-6),[r,e]}},{label:"Last 30 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-29),[r,e]}},{label:"Last 90 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-89),[r,e]}},{label:"This week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay());const n=new Date(r);return n.setDate(n.getDate()+6),[r,n]}},{label:"Last week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay()-1);const n=new Date(r);return n.setDate(n.getDate()-6),[n,r]}},{label:"This month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),r*3,1),new Date(e.getFullYear(),r*3+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3),n=r===0?3:r-1,i=r===0?e.getFullYear()-1:e.getFullYear();return[new Date(i,n*3,1),new Date(i,n*3+3,0)]}},{label:"This year",getValue:()=>{const e=new Date().getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=new Date().getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}function Zs(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=window.scrollY,a=window.scrollX,d=i-n.bottom<r+8&&n.top>r+8;return{top:d?s+n.top-r-4:s+n.bottom+4,left:a+n.left,flipUp:d}}function Ar({values:e,selected:r,onSelect:n,label:i,theme:s,format:a}){const l=c.useRef([]),d=c.useRef(null);c.useEffect(()=>{const x=l.current[r];x&&d.current&&x.scrollIntoView({block:"nearest"})},[r]);const u=a??(x=>String(x).padStart(2,"0"));return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:s.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:i}),t.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${s.border}`,borderRadius:"8px",padding:"4px"},children:e.map(x=>{const o=x===r;return t.jsx("button",{ref:m=>{l.current[x]=m},type:"button",onClick:()=>n(x),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?s.primary:"transparent",color:o?s.bg:s.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(x)},x)})})]})}function Dr({year:e,month:r,today:n,mode:i,selectedDate:s,selectedRange:a,multiDates:l,hoverDate:d,focusedDate:u,isDateDisabled:x,onSelectDate:o,onHoverDate:m,onSetFocused:p,theme:h,locale:y}){const z=Xs(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Ys.map(v=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:h.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:v},v))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:z.map((v,$)=>{const w=v.getMonth()===r,C=Re(v,n),I=v.getDay()===0||v.getDay()===6,R=x(v),M=i==="single"&&s!=null&&Re(v,s),N=i==="multiple"&&l.some(O=>Re(O,v)),T=i==="range"&&Nr(v,a[0],null),j=i==="range"&&Nr(v,null,a[1]),k=T||j,Y=i==="range"&&a[0]&&!a[1]&&d?d:a[1],f=i==="range"&&Us(v,a[0],Y),g=i==="range"&&a[0]&&!a[1]&&d&&Re(v,d),S=M||N||k,F=u!=null&&Re(v,u);let D="transparent",V=w?I?`${h.text}cc`:h.text:`${h.textMuted}60`,E="none",P=400;S||g?(D=h.primary,V=h.bg,P=600):f&&(D=`${h.primary}18`),C&&!S&&(E=`2px solid ${h.primary}`,P=600),R&&(V=`${h.textMuted}50`),F&&!S&&(E=`2px solid ${h.secondary}`);const W=v.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":W,"aria-pressed":S,"aria-disabled":R,disabled:R,onClick:()=>!R&&o(v),onMouseEnter:()=>m(v),onMouseLeave:()=>m(null),onFocus:()=>p(v),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:V,border:E,fontSize:"13px",fontWeight:P,cursor:R?"not-allowed":"pointer",opacity:R?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:R?"line-through":"none",transition:"background-color 80ms ease"},children:v.getDate()},$)})})]})}function Dn({value:e,onChange:r,rangeValue:n,onRangeChange:i,multiValue:s,onMultiChange:a,mode:l="single",minDate:d,maxDate:u,disabledDates:x,locale:o="en-US",showTime:m=!1,timeValue:p,onTimeChange:h,showPresets:y=!1,customPresets:z,label:v,placeholder:$="MM/DD/YYYY",hint:w,isDisabled:C=!1,isInvalid:I=!1,errorMessage:R,numberOfMonths:M=1,id:N,className:T,style:j}){const k=ee(),Y=c.useId(),f=N??Y,g=ye(),S=ze(new Date),F=e!==void 0,[D,V]=c.useState(null),E=F?e??null:D,P=n!==void 0,[W,O]=c.useState([null,null]),A=P?n:W,H=s!==void 0,[Q,G]=c.useState([]),ne=H?s:Q,[pe,xe]=c.useState("start"),oe=l==="range"||l==="single"&&m,[me,X]=c.useState([null,null]),[Z,ve]=c.useState(null),we=E??A[0]??S,[de,ge]=c.useState(we.getFullYear()),[J,ie]=c.useState(we.getMonth()),[re,q]=c.useState("day"),[te,be]=c.useState({h:0,m:0}),$e=p??te,[Me,Te]=c.useState(!1),[Ke,Ee]=c.useState(()=>{if(l==="single")return _e(E,o);if(l==="range"){const[_,K]=A;if(_&&K)return`${_e(_,o)} – ${_e(K,o)}`}return""}),[U,le]=c.useState(null),[se,Se]=c.useState(null),[Ae,De]=c.useState({top:0,left:0,flipUp:!1}),[,at]=c.useReducer(_=>_+1,0),rt=c.useRef(null),ht=c.useRef(null),mt=c.useRef(null),gt=y?420:m?480:360;c.useEffect(()=>{if(l==="single")Ee(_e(E,o));else if(l==="range"){const[_,K]=A;Ee(_&&K?`${_e(_,o)} – ${_e(K,o)}`:_?_e(_,o):"")}else l==="multiple"&&Ee(ne.length>0?`${ne.length} date${ne.length!==1?"s":""} selected`:"")},[E,A,ne,l,o]);const Oe=c.useCallback(()=>{rt.current&&De(Zs(rt.current,gt))},[gt]);c.useEffect(()=>{if(Me)return Oe(),window.addEventListener("scroll",Oe,!0),window.addEventListener("resize",Oe),()=>{window.removeEventListener("scroll",Oe,!0),window.removeEventListener("resize",Oe)}},[Me,Oe]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce,je;(ce=rt.current)!=null&&ce.contains(K.target)||(je=ht.current)!=null&&je.contains(K.target)||Te(!1)};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[Me]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce;K.key==="Escape"&&(Te(!1),(ce=mt.current)==null||ce.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[Me]);const Xe=c.useCallback(_=>d&&ze(_)<ze(d)||u&&ze(_)>ze(u)?!0:x?typeof x=="function"?x(_):x.some(K=>Re(K,_)):!1,[d,u,x]),nt=c.useCallback(_=>{if(!Xe(_)){if(l==="single")oe?ve(_):(F||V(_),r==null||r(_),Ee(_e(_,o)),Te(!1));else if(l==="range")if(pe==="start"){const K=[_,null];X(K),P||O(K),i==null||i(K),xe("end")}else{const K=me[0]??A[0],ce=K&&_<K?[_,K]:[K,_];X(ce),oe?xe("start"):(P||O(ce),i==null||i(ce),xe("start"),Te(!1))}else if(l==="multiple"){const ce=ne.some(je=>Re(je,_))?ne.filter(je=>!Re(je,_)):[...ne,_];H||G(ce),a==null||a(ce)}at()}},[l,Xe,F,P,H,r,i,a,pe,me,A,ne,oe,o]),Pt=c.useCallback(()=>{if(l==="single"){const _=Z??E;F||V(_),r==null||r(_)}else l==="range"&&(P||O(me),i==null||i(me));Te(!1),xe("start")},[l,Z,me,E,F,P,r,i]),Bt=c.useCallback(()=>{ve(null),X([null,null]),xe("start"),Te(!1)},[]),bt=()=>{J===0?(ie(11),ge(_=>_-1)):ie(_=>_-1),q("day")},yt=()=>{J===11?(ie(0),ge(_=>_+1)):ie(_=>_+1),q("day")},Wt=()=>ge(_=>_-1),Ht=()=>ge(_=>_+1),vt=()=>ge(_=>_-10),kt=()=>ge(_=>_+10),Vt=_=>{if(Ee(_),l==="single"){const K=Ks(_);K&&!Xe(K)&&(F||V(K),r==null||r(K),ge(K.getFullYear()),ie(K.getMonth()))}},wt=_=>{if(_.stopPropagation(),l==="single")F||V(null),r==null||r(null),Ee("");else if(l==="range"){const K=[null,null];P||O(K),i==null||i(K),X(K),Ee(""),xe("start")}else l==="multiple"&&(H||G([]),a==null||a([]),Ee(""))},Ot=_=>{if(re!=="day")return;const K=U??E??S;let ce=null;if(_.key==="ArrowRight")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+1);else if(_.key==="ArrowLeft")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-1);else if(_.key==="ArrowDown")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+7);else if(_.key==="ArrowUp")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-7);else if(_.key==="Enter"&&U){nt(U);return}ce&&(_.preventDefault(),le(ce),(ce.getMonth()!==J||ce.getFullYear()!==de)&&(ie(ce.getMonth()),ge(ce.getFullYear())))},L=()=>{ge(S.getFullYear()),ie(S.getMonth()),q("day"),nt(S)},fe=z??qs(),ke=_=>{const[K,ce]=_.getValue(),je=[K,ce];X(je),P||O(je),i==null||i(je),ge(K.getFullYear()),ie(K.getMonth()),xe("start"),oe||Te(!1)},Ce=J===11?0:J+1,qe=J===11?de+1:de,Ye=M>=2,lt=v?B(v):void 0,ct=w?B(w):void 0,dt=R?B(R):void 0,jt=B($),St=l==="single"&&E!=null||l==="range"&&(A[0]!=null||A[1]!=null)||l==="multiple"&&ne.length>0,Fe=l==="range"?oe?me:A:[null,null],oo=I?k.danger:Me?k.primary:k.border,so=Array.from({length:24},(_,K)=>K),io=Array.from({length:60},(_,K)=>K),ao=t.jsxs("div",{ref:ht,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Ot,style:{position:"absolute",top:Ae.top,left:Ae.left,zIndex:9999,backgroundColor:k.surface,border:`1px solid ${k.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:Ye?"580px":"300px",maxWidth:Ye&&y?"780px":Ye?"620px":y?"520px":"300px",opacity:Me?1:0,transform:Me?"translateY(0) scale(1)":Ae.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:g?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[y&&l==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${k.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:k.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),fe.map(_=>{const[K,ce]=_.getValue(),je=Fe[0]&&Fe[1]&&Re(Fe[0],K)&&Re(Fe[1],ce);return t.jsx("button",{type:"button",onClick:()=>ke(_),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:je?`${k.primary}20`:"transparent",color:je?k.primary:k.text,fontWeight:je?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:ut=>{je||(ut.currentTarget.style.backgroundColor=`${k.surfaceAlt}`)},onMouseLeave:ut=>{je||(ut.currentTarget.style.backgroundColor="transparent")},children:_.label},_.label)})]}),t.jsxs("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("button",{type:"button","aria-label":re==="day"?"Previous month":re==="month"?"Previous year":"Previous decade",onClick:()=>{re==="day"?bt():re==="month"?Wt():vt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[re==="day"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>q("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:zr[J]}),t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),Ye&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:k.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[zr[Ce]," ",qe]})]})]}),re==="month"&&t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),re==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[Ut(de),"–",Ut(de)+9]})]}),t.jsx("button",{type:"button","aria-label":re==="day"?"Next month":re==="month"?"Next year":"Next decade",onClick:()=>{re==="day"?yt():re==="month"?Ht():kt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),re==="day"&&t.jsxs("div",{style:{display:"flex",gap:"20px"},children:[t.jsx(Dr,{year:de,month:J,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:k,locale:o}),Ye&&t.jsx(Dr,{year:qe,month:Ce,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:k,locale:o})]}),re==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:_s.map((_,K)=>{const ce=K===J,je=K===S.getMonth()&&de===S.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{ie(K),q("day")},style:{padding:"10px",borderRadius:"8px",border:je&&!ce?`2px solid ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:ce?600:400,backgroundColor:ce?k.primary:"transparent",color:ce?k.bg:k.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:_},_)})}),re==="year"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(_,K)=>{const ce=Ut(de)-1+K,je=ce===de,ut=ce===S.getFullYear(),yr=K===0||K===11;return t.jsx("button",{type:"button",onClick:()=>{ge(ce),q("month")},style:{padding:"10px 6px",borderRadius:"8px",border:ut&&!je?`2px solid ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:je?600:400,backgroundColor:je?k.primary:"transparent",color:je?k.bg:yr?k.textMuted:k.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:yr?.5:1},children:ce},ce)})}),m&&re==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(Ar,{values:so,selected:$e.h,onSelect:_=>{p||be(K=>({...K,h:_})),h==null||h({...$e,h:_})},label:"Hour",theme:k}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:k.textMuted},children:":"}),t.jsx(Ar,{values:io,selected:$e.m,onSelect:_=>{p||be(K=>({...K,m:_})),h==null||h({...$e,m:_})},label:"Min",theme:k})]}),l==="multiple"&&re==="day"&&ne.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"8px",fontSize:"12px",color:k.textMuted,textAlign:"center"},children:[ne.length," date",ne.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:oe?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:L,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:k.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),oe&&t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx("button",{type:"button",onClick:Bt,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${k.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:k.text,fontFamily:"inherit"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:Pt,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:k.primary,color:k.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:T,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...j},children:[lt&&t.jsx("label",{htmlFor:f,style:{fontSize:"13px",fontWeight:500,color:k.text,marginBottom:"2px"},children:lt}),t.jsxs("div",{ref:rt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${oo}`,borderRadius:"8px",backgroundColor:k.surface,overflow:"hidden",transition:g?"none":"border-color 120ms ease",opacity:C?.5:1},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:k.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),t.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),t.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),t.jsx("input",{ref:mt,id:f,type:"text",value:Ke,placeholder:jt,disabled:C,"aria-invalid":I,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:l==="range"||l==="multiple",onChange:_=>Vt(_.target.value),onFocus:()=>{C||Te(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:k.text,cursor:l!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),St&&!C&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:wt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:t.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),t.jsx("button",{type:"button","aria-label":Me?"Close calendar":"Open calendar",tabIndex:-1,disabled:C,onClick:()=>{C||Te(_=>!_)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:C?"not-allowed":"pointer",color:k.textMuted,flexShrink:0},children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:Me?"rotate(180deg)":"rotate(0deg)",transition:g?"none":"transform 160ms ease"},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),ct&&!I&&t.jsx("span",{style:{fontSize:"12px",color:k.textMuted},children:ct}),I&&dt&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:k.danger},children:dt}),Me&&typeof document<"u"&&Be.createPortal(ao,document.body)]})}Dn.displayName="TkxDatePicker";const Gs={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Qe(e,r,n){return Math.min(Math.max(e,r),n)}function or(e,r,n){return Math.round((e-r)/n)*n+r}function Ve(e,r,n){return(e-r)/(n-r)*100}function Kt({value:e,min:r,max:n,step:i,isDisabled:s,trackColor:a,thumbSize:l,ariaLabel:d,tooltipMode:u,formatValue:x,orientation:o,onChange:m,onChangeEnd:p}){const[h,y]=c.useState(!1),[z,v]=c.useState(!1),[$,w]=c.useState(!1),C=j=>{s||(j.key==="ArrowRight"||j.key==="ArrowUp"?(j.preventDefault(),m(Qe(or(e+i,r,i),r,n))):j.key==="ArrowLeft"||j.key==="ArrowDown"?(j.preventDefault(),m(Qe(or(e-i,r,i),r,n))):j.key==="Home"?(j.preventDefault(),m(r)):j.key==="End"&&(j.preventDefault(),m(n)))},I=o==="vertical",R=Ve(e,r,n),M=u==="always"||u==="hover"&&($||z||h),N=I?{position:"absolute",bottom:`${R}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"}:{position:"absolute",left:`${R}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"},T=I?{position:"absolute",left:l+6,top:"50%",transform:"translateY(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:l+6,left:"50%",transform:"translateX(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return t.jsxs("div",{style:N,children:[M&&t.jsx("div",{style:T,children:x(e)}),t.jsx("div",{role:"slider",tabIndex:s?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":s,"aria-orientation":o,onKeyDown:C,onFocus:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:j=>{s||(v(!0),j.target.setPointerCapture(j.pointerId))},onPointerUp:()=>{v(!1),p==null||p()},style:{width:l,height:l,borderRadius:"50%",backgroundColor:s?"#888":a,border:"3px solid #fff",boxShadow:h?`0 0 0 3px ${a}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Ln({value:e,defaultValue:r=0,onChange:n,rangeValue:i,onRangeChange:s,min:a=0,max:l=100,step:d=1,isRange:u=!1,label:x,showValue:o=!1,showTicks:m=!1,tickCount:p=5,isDisabled:h=!1,colorScheme:y="primary",size:z="md",marks:v,orientation:$="horizontal",showTooltip:w=!1,formatValue:C,onChangeEnd:I,onRangeChangeEnd:R,gradient:M=!1}){const N=ee(),T=c.useId(),j=ye(),k=e!==void 0,[Y,f]=c.useState(r),g=k?e:Y,S=i!==void 0,[F,D]=c.useState([a,l]),V=S?i:F,E=c.useRef(null),P=c.useRef(g);P.current=g;const W=c.useRef(V);W.current=V;const O={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[y],A=Gs[z],H=$==="vertical",Q=w===!0?"hover":w===!1?!1:w,G=C??(J=>String(J)),ne=O+"66",pe=c.useCallback((J,ie)=>{const re=E.current;if(!re)return a;const q=re.getBoundingClientRect();let te;H?te=Qe((q.bottom-(ie??0))/q.height,0,1):te=Qe((J-q.left)/q.width,0,1);const be=te*(l-a)+a;return Qe(or(be,a,d),a,l)},[a,l,d,H]),xe=c.useCallback(J=>{if(h)return;const ie=pe(J.clientX,J.clientY);if(!u)k||f(ie),n==null||n(ie);else{const[re,q]=V,te=Math.abs(ie-re),be=Math.abs(ie-q),$e=te<=be?[ie,q]:[re,ie];S||D($e),s==null||s($e)}},[h,u,k,S,pe,n,s,V]),oe=J=>{k||f(J),n==null||n(J)},me=J=>{const ie=[Qe(J,a,V[1]),V[1]];S||D(ie),s==null||s(ie)},X=J=>{const ie=[V[0],Qe(J,V[0],l)];S||D(ie),s==null||s(ie)},Z=u?Ve(V[0],a,l):0,ve=Ve(u?V[1]:g,a,l),we=m?Array.from({length:p},(J,ie)=>a+ie/(p-1)*(l-a)):[],de=x?B(x):void 0,ge=j?"none":"background 150ms ease";return t.jsxs("div",{className:b("flex flex-col gap-2"),style:{opacity:h?.55:1,...H?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(de||o)&&t.jsxs("div",{className:b("flex items-center justify-between"),children:[de&&t.jsx("label",{htmlFor:T,className:b("text-sm font-medium"),style:{color:N.text,fontSize:A.fontSize},children:de}),o&&!u&&t.jsx("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:G(g)}),o&&u&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:[G(V[0])," – ",G(V[1])]})]}),t.jsxs("div",{style:{position:"relative",...H?{paddingLeft:A.thumb/2,paddingRight:A.thumb/2,flex:1}:{paddingTop:A.thumb/2,paddingBottom:A.thumb/2}},children:[t.jsxs("div",{ref:E,onPointerDown:xe,style:{position:"relative",...H?{width:A.track,height:"100%"}:{height:A.track},borderRadius:9999,backgroundColor:N.border,cursor:h?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",...H?{left:0,bottom:`${Z}%`,height:`${ve-Z}%`,width:"100%"}:{top:0,left:`${Z}%`,width:`${ve-Z}%`,height:"100%"},borderRadius:9999,...h?{backgroundColor:N.textMuted}:M?{background:H?`linear-gradient(to top, ${ne}, ${O})`:`linear-gradient(to right, ${ne}, ${O})`}:{backgroundColor:O},transition:ge}}),we.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Ve(J,a,l)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:A.track+4}:{left:`${Ve(J,a,l)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:A.track+4},backgroundColor:N.surface,borderRadius:9999,pointerEvents:"none"}},ie)),u?t.jsxs(t.Fragment,{children:[t.jsx(Kt,{value:V[0],min:a,max:V[1],step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:G,orientation:$,onChange:me,onChangeEnd:R?()=>R(W.current):void 0}),t.jsx(Kt,{value:V[1],min:V[0],max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:G,orientation:$,onChange:X,onChangeEnd:R?()=>R(W.current):void 0})]}):t.jsx(Kt,{value:g,min:a,max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:G,orientation:$,onChange:oe,onChangeEnd:I?()=>I(P.current):void 0})]}),v&&v.length>0&&t.jsx("div",{style:{position:H?"absolute":"relative",...H?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:v.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Ve(J.value,a,l)}%`,transform:"translateY(50%)",left:0}:{left:`${Ve(J.value,a,l)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:N.textMuted,whiteSpace:"nowrap"},children:B(J.label)},ie))})]}),m&&!v&&!H&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:we.map((J,ie)=>t.jsx("span",{style:{position:"absolute",left:`${Ve(J,a,l)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:N.textMuted},children:G(Math.round(J))},ie))})]})}Ln.displayName="TkxSlider";const Js={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function Qs(e,r,n,i){if(r<=1)return[1];const s=(y,z)=>Array.from({length:Math.max(0,z-y+1)},(v,$)=>y+$),a=Math.max(e-n,1),l=Math.min(e+n,r);if(!i){const y=[];return a>1&&y.push("..."),y.push(...s(a,l)),l<r&&y.push("..."),y}const d=1,u=r,x=a>d+2,o=l<u-2,m=[];m.push(1),x?m.push("left-ellipsis"):m.push(...s(2,a-1)),m.push(...s(Math.max(a,2),Math.min(l,r-1))),o?m.push("right-ellipsis"):m.push(...s(l+1,r-1)),r>1&&m.push(r);const p=new Set,h=[];for(const y of m)typeof y=="number"?p.has(y)||(p.add(y),h.push(y)):h.push(y);return h}function Fn({total:e,pageSize:r=10,page:n,defaultPage:i=1,onChange:s,siblingCount:a=1,showEdges:l=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:x=[10,25,50,100],size:o="md",variant:m="default"}){const p=ee(),h=c.useId(),y=n!==void 0,[z,v]=c.useState(i),$=y?n:z,[w,C]=c.useState(r),I=r,R=Math.max(1,Math.ceil(e/I)),M=S=>{const F=Math.min(Math.max(S,1),R);F!==$&&(y||v(F),s==null||s(F))},N=S=>{C(S),u==null||u(S),M(1)},T=Qs($,R,a,l),j=Js[o],k=Math.min(($-1)*I+1,e),Y=Math.min($*I,e),f=(S,F)=>{const D={height:j.height,minWidth:j.minWidth,paddingLeft:j.px,paddingRight:j.px,fontSize:j.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:F?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:F?.4:1};return S?{...D,backgroundColor:p.primary,color:p.bg,fontWeight:600,boxShadow:`0 0 0 2px ${p.primary}44`}:m==="default"?{...D,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`}:m==="outline"?{...D,backgroundColor:"transparent",color:p.text,border:`1px solid ${p.border}`}:{...D,backgroundColor:"transparent",color:p.text}},g=({d:S})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("polyline",{points:S})});return t.jsxs("nav",{"aria-label":"Pagination",className:b("flex flex-col gap-2"),children:[e>0&&t.jsx("p",{className:b("text-sm"),style:{color:p.textMuted,fontSize:j.fontSize},children:B(`Showing ${k}–${Y} of ${e} items`)}),t.jsxs("div",{className:b("flex items-center gap-1 flex-wrap"),children:[l&&t.jsxs("button",{type:"button","aria-label":"First page",disabled:$===1,onClick:()=>M(1),style:f(!1,$===1),children:[t.jsx(g,{d:"15 18 9 12 15 6"}),t.jsx(g,{d:"20 18 14 12 20 6"})]}),t.jsx("button",{type:"button","aria-label":"Previous page",disabled:$===1,onClick:()=>M($-1),style:f(!1,$===1),children:t.jsx(g,{d:"15 18 9 12 15 6"})}),T.map((S,F)=>{if(typeof S=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:j.minWidth,height:j.height,fontSize:j.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${S}-${F}`);const V=S,E=V===$;return t.jsx("button",{type:"button","aria-label":`Page ${V}`,"aria-current":E?"page":void 0,onClick:()=>M(V),style:f(E,!1),children:V},V)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:$===R,onClick:()=>M($+1),style:f(!1,$===R),children:t.jsx(g,{d:"9 18 15 12 9 6"})}),l&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:$===R,onClick:()=>M(R),style:f(!1,$===R),children:[t.jsx(g,{d:"4 18 10 12 4 6"}),t.jsx(g,{d:"14 18 20 12 14 6"})]}),d&&t.jsxs("div",{className:b("flex items-center gap-2 ml-2"),children:[t.jsx("label",{htmlFor:h,className:b("text-sm"),style:{color:p.textMuted,fontSize:j.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:h,value:w,onChange:S=>N(Number(S.target.value)),style:{height:j.height,paddingLeft:j.px,paddingRight:j.px,fontSize:j.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:x.map(S=>t.jsx("option",{value:S,children:S},S))})]})]})]})}Fn.displayName="TkxPagination";const ei={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},ti={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function ri({color:e,size:r}){return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function ni({src:e,alt:r,fallback:n,placeholder:i="skeleton",fit:s="cover",ratio:a="auto",radius:l="none",caption:d,lazy:u=!1,preview:x=!1,className:o,style:m,...p}){const h=ee(),y=ye(),[z,v]=c.useState(!1),[$,w]=c.useState(!1),[C,I]=c.useState(!1),R=c.useRef(null),M=B(e),N=r?B(r):"",T=d?B(d):"",j=ti[l];c.useEffect(()=>{var H;(H=R.current)!=null&&H.complete&&v(!0)},[]);const k=c.useCallback(()=>v(!0),[]),Y=c.useCallback(()=>w(!0),[]),f=c.useCallback(()=>{x&&!$&&I(!0)},[x,$]),g=c.useCallback(()=>I(!1),[]);c.useEffect(()=>{if(!C)return;const H=Q=>{Q.key==="Escape"&&g()};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[C,g]);const S=i==="skeleton"&&!z&&!$,F=S&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},D=$?null:t.jsx("img",{ref:R,src:M,alt:N||void 0,role:N?void 0:"img","aria-label":N?void 0:"Image",loading:u?"lazy":void 0,onLoad:k,onError:Y,onClick:x?f:void 0,className:ue(b("block w-full h-full"),x&&!$?b("cursor-pointer"):""),style:{objectFit:s,borderRadius:j,opacity:z?1:0,transition:y?"none":"opacity 200ms ease",position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0},...p}),V=$?n?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{role:"img","aria-label":N||"Image failed to load",className:b("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:h.surfaceAlt,borderRadius:j,color:h.textMuted,minHeight:"80px"},children:[t.jsx(ri,{color:h.textMuted,size:32}),t.jsx("span",{className:b("text-xs"),style:{color:h.textMuted},children:"Failed to load"})]}):null,E=S?t.jsx("div",{"aria-hidden":"true",style:{position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0,width:"100%",height:a==="auto"?"100%":void 0,minHeight:a==="auto"?"80px":void 0,borderRadius:j,backgroundColor:h.surfaceAlt,...F}}):null,P=a==="auto"?t.jsxs("div",{className:b("relative w-full"),style:{borderRadius:j},children:[E,D,V]}):t.jsxs("div",{className:b("relative w-full overflow-hidden"),style:{paddingBottom:ei[a],borderRadius:j},children:[E,D,V]}),W=T?t.jsxs("figure",{className:b("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:j},children:[P,t.jsx("figcaption",{className:b("text-sm text-center"),style:{color:h.textMuted},children:T})]}):P,O=t.jsx("div",{className:ue(b("inline-block w-full"),o),style:m,children:W}),A=C&&typeof document<"u"?Be.createPortal(t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":N||"Image preview",className:b("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:g,children:[t.jsx("div",{"aria-hidden":"true",className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),t.jsx("img",{src:M,alt:N||"Full-size preview",onClick:H=>H.stopPropagation(),className:b("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),t.jsx("button",{"aria-label":"Close preview",onClick:g,className:b("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null;return t.jsxs(t.Fragment,{children:[O,A]})}function Lr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function oi({mimeType:e,color:r}){return e.startsWith("image/")?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]}):e==="application/pdf"?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"}),t.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),t.jsx("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"})]})}let si=0;function ii(){return`tkx-file-${++si}`}function ai({accept:e,multiple:r=!1,maxSize:n,maxFiles:i,onChange:s,onError:a,label:l="Upload files",hint:d,isDisabled:u=!1,preview:x=!0,dragDrop:o=!0,variant:m="dropzone"}){const p=ee(),h=ye(),y=c.useId(),z=c.useRef(null),[v,$]=c.useState(!1),[w,C]=c.useState([]);c.useEffect(()=>()=>{w.forEach(E=>{E.objectUrl&&URL.revokeObjectURL(E.objectUrl)})},[]);const I=c.useCallback(E=>{let P=0;const W=setInterval(()=>{P+=Math.floor(Math.random()*20)+10,P>=100&&(P=100,clearInterval(W)),C(O=>O.map(A=>A.id===E?{...A,progress:P}:A))},100)},[]),R=c.useCallback(E=>{if(n&&E.size>n)return`"${B(E.name)}" exceeds max size of ${Lr(n)}`;if(e&&!e.split(",").map(O=>O.trim()).some(O=>O.startsWith(".")?E.name.toLowerCase().endsWith(O.toLowerCase()):O.endsWith("/*")?E.type.startsWith(O.slice(0,-1)):E.type===O))return`"${B(E.name)}" is not an accepted file type`},[e,n]),M=c.useCallback(E=>{const P=i?i-w.length:1/0;if(P<=0){a==null||a(`Maximum of ${i} file${i===1?"":"s"} allowed`);return}const O=E.slice(0,P).map(A=>{const H=R(A),Q=x&&A.type.startsWith("image/")&&!H?URL.createObjectURL(A):void 0;return{file:A,id:ii(),objectUrl:Q,progress:0,error:H}});C(A=>{const H=r?[...A,...O]:O,Q=H.filter(G=>!G.error).map(G=>G.file);return s==null||s(Q),H}),O.forEach(A=>{A.error&&(a==null||a(A.error))}),O.forEach(A=>{A.error||I(A.id)})},[w.length,i,r,s,a,x,I,R]),N=c.useCallback(E=>{const P=Array.from(E.target.files??[]);P.length&&M(P),E.target.value=""},[M]),T=c.useCallback(E=>{if(E.preventDefault(),$(!1),u)return;const P=Array.from(E.dataTransfer.files);P.length&&M(P)},[u,M]),j=c.useCallback(E=>{E.preventDefault(),u||$(!0)},[u]),k=c.useCallback(()=>$(!1),[]),Y=c.useCallback(E=>{C(P=>{const W=P.find(A=>A.id===E);W!=null&&W.objectUrl&&URL.revokeObjectURL(W.objectUrl);const O=P.filter(A=>A.id!==E);return s==null||s(O.filter(A=>!A.error).map(A=>A.file)),O})},[s]),f=c.useCallback(()=>{var E;u||(E=z.current)==null||E.click()},[u]),g=v?p.primary:p.border,S=B(l),F=d?B(d):"",D=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":S,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:f,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},onDrop:o?T:void 0,onDragOver:o?j:void 0,onDragLeave:o?k:void 0,className:b("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${g}`,backgroundColor:v?`${p.primary}10`:p.surface,cursor:u?"not-allowed":"pointer",opacity:u?.5:1,transition:h?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:v?p.primary:p.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),t.jsxs("div",{className:b("text-center"),children:[t.jsx("p",{className:b("m-0 text-sm font-medium"),style:{color:p.text},children:v?"Drop files here":S}),F&&t.jsx("p",{id:y,className:b("m-0 text-xs mt-1"),style:{color:p.textMuted},children:F})]})]}),V=t.jsxs("button",{type:"button",disabled:u,onClick:f,"aria-describedby":d?y:void 0,className:b("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:p.primary,color:p.bg,opacity:u?.5:1,cursor:u?"not-allowed":"pointer"},children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),S,d&&t.jsx("span",{id:y,className:b("sr-only"),children:F})]});return t.jsxs("div",{className:b("flex flex-col gap-3 w-full font-sans"),children:[t.jsx("input",{ref:z,type:"file",accept:e,multiple:r,disabled:u,onChange:N,className:b("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?D:V,w.length>0&&t.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:b("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(E=>t.jsxs("li",{className:b("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:p.surfaceAlt,border:`1px solid ${E.error?p.danger:p.border}`},children:[t.jsxs("div",{className:b("flex items-center gap-3"),children:[E.objectUrl&&x?t.jsx("img",{src:E.objectUrl,alt:B(E.file.name),className:b("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(oi,{mimeType:E.file.type,color:E.error?p.danger:p.textMuted})}),t.jsxs("div",{className:b("flex flex-col gap-0.5 flex-1 min-w-0"),children:[t.jsx("span",{className:b("text-sm font-medium truncate"),style:{color:E.error?p.danger:p.text},title:E.file.name,children:B(E.file.name)}),t.jsxs("span",{className:b("text-xs"),style:{color:p.textMuted},children:[Lr(E.file.size),E.error&&` — ${E.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${B(E.file.name)}`,onClick:()=>Y(E.id),className:b("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:p.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!E.error&&E.progress<100&&t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:p.border},"aria-hidden":"true",children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:p.primary,width:`${E.progress}%`,transition:h?"none":"width 100ms ease"}})})]},E.id))})]})}const li={sm:16,md:24,lg:32,xl:40};function ci({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function di({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ui({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function fi({type:e,size:r,filled:n,color:i,halfFilled:s,uid:a}){const l={size:r,filled:n,color:i,halfFilled:s,id:a};return e==="heart"?t.jsx(di,{...l}):e==="circle"?t.jsx(ui,{...l}):t.jsx(ci,{...l})}function Fr(e,r,n){return Math.min(n,Math.max(r,e))}function pi(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Pr(e,r,n){if(n===1)return r+1;const i=e.currentTarget.getBoundingClientRect(),s=i.left+i.width/2;return e.clientX<s?r+.5:r+1}function xi({value:e,defaultValue:r=0,onChange:n,max:i=5,precision:s=1,size:a="md",isReadOnly:l=!1,isDisabled:d=!1,label:u,showValue:x=!1,colorScheme:o="warning",emptyIcon:m="star",filledIcon:p="star"}){const h=ee(),y=ye(),z=c.useId(),v=e!==void 0,[$,w]=c.useState(r),[C,I]=c.useState(null),R=c.useRef(null),M=v?e??0:$,N=C??M,j={warning:h.warning,primary:h.primary,danger:h.danger}[o]??h.warning,k=li[a],Y=!l&&!d,f=c.useCallback(E=>{v||w(E),n==null||n(E)},[v,n]),g=c.useCallback((E,P)=>{Y&&I(Pr(E,P,s))},[Y,s]),S=c.useCallback(()=>{Y&&I(null)},[Y]),F=c.useCallback((E,P)=>{if(!Y)return;const W=Pr(E,P,s);f(W===M?0:W)},[Y,s,M,f]),D=c.useCallback(E=>{if(!Y)return;const P=s;let W=M;if(E.key==="ArrowRight"||E.key==="ArrowUp")E.preventDefault(),W=Fr(M+P,0,i);else if(E.key==="ArrowLeft"||E.key==="ArrowDown")E.preventDefault(),W=Fr(M-P,0,i);else if(E.key==="Home")E.preventDefault(),W=0;else if(E.key==="End")E.preventDefault(),W=i;else return;W=pi(W,s),f(W)},[Y,M,i,s,f]),V=u?B(u):"Rating";return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2 font-sans"),d?b("opacity-50"):""),children:[t.jsx("div",{ref:R,role:"radiogroup","aria-label":V,"aria-disabled":d,"aria-readonly":l,tabIndex:Y?0:-1,onKeyDown:D,onMouseLeave:S,className:b("flex items-center gap-0.5 outline-none"),style:{cursor:Y?"pointer":"default"},children:Array.from({length:i},(E,P)=>{const W=P+1,O=P+.5,A=N>=W,H=!A&&s===.5&&N>=O,Q=`${z}-${P}`;return t.jsx("span",{role:"radio","aria-checked":s===.5&&M===O||M===W,"aria-label":s===.5?`${O} star${O!==1?"s":""} / ${W} star${W!==1?"s":""}`:`${W} star${W!==1?"s":""}`,tabIndex:-1,onMouseMove:G=>g(G,P),onClick:G=>F(G,P),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:C!==null&&N>=O&&Y?"scale(1.15)":"scale(1)"},children:t.jsx(fi,{type:A||H?p:m,size:k,filled:A,halfFilled:H,color:A||H?j:h.border,uid:H?Q:void 0})},P)})}),x&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:h.textMuted},"aria-live":"polite","aria-atomic":"true",children:[M%1===0?M.toFixed(0):M.toFixed(1)," / ",i]})]})}let Br=!1;function hi(){if(Br||typeof document>"u")return;Br=!0;const e=document.createElement("style");e.textContent=`
|
|
23
|
+
`,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=s?[...r].reverse():r;return Be.createPortal(t.jsx("div",{"aria-label":"Notifications",className:b("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:a,children:d.map(u=>t.jsx("div",{className:b("pointer-events-auto"),children:t.jsx(Ys,{toast:u,position:e,onDismiss:yr,reduced:i})},u.id))}),document.body)}const Us={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function Ir({open:e,reduced:r,iconStyle:n,size:i,color:s}){const a=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?t.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:a,flexShrink:0},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),t.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function Ks({isOpen:e,reduced:r,children:n,id:i,triggerId:s}){const a=c.useRef(null),l=c.useRef(null),d=c.useRef(e),u=c.useRef(!1);c.useEffect(()=>{const o=a.current;o&&(e?(o.style.height="auto",o.style.overflow="visible"):(o.style.height="0px",o.style.overflow="hidden"))},[]),c.useEffect(()=>{if(d.current===e)return;d.current=e;const o=a.current,m=l.current;if(!(!o||!m)){if(r){o.style.height=e?"auto":"0px",o.style.overflow=e?"visible":"hidden";return}if(u.current){const x=o.getBoundingClientRect().height;o.style.transition="none",o.style.height=`${x}px`,o.offsetHeight}u.current=!0,o.style.overflow="hidden",e?(o.style.height="0px",o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height=`${m.scrollHeight}px`})})):(o.style.height=`${m.scrollHeight}px`,o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height="0px"})}))}},[e,r]);const p=o=>{if(o.propertyName!=="height")return;u.current=!1;const m=a.current;m&&(e?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return t.jsx("div",{ref:a,id:i,role:"region","aria-labelledby":s,onTransitionEnd:p,style:{willChange:"height"},children:t.jsx("div",{ref:l,children:n})})}function Dn({items:e,multiple:r=!1,defaultOpen:n,value:i,onChange:s,variant:a="default",size:l="md",iconPosition:d="right",iconStyle:u="chevron",flush:p=!1,className:o,style:m}){const x=ee(),h=ye(),y=c.useId(),z=i!==void 0,v=k=>k?Array.isArray(k)?new Set(k):new Set([k]):new Set,[$,w]=c.useState(()=>v(n)),C=z?v(i):$,I=c.useCallback((k,Y)=>{if(Y)return;let f;if(z){const S=v(i);f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k))}else{w(S=>{f=new Set(S),f.has(k)?f.delete(k):(r||f.clear(),f.add(k));const F=[...f];return s==null||s(r?F:F[0]??""),f});return}const g=[...f];s==null||s(r?g:g[0]??"")},[r,s,z,i]),R=Us[l],M=()=>{if(p)return{};switch(a){case"bordered":return{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},N=(k,Y,f)=>{if(p)return{};switch(a){case"default":return{borderBottom:f?"none":`1px solid ${x.border}`};case"bordered":return{borderBottom:f?"none":`1px solid ${x.border}`};case"separated":return{border:`1px solid ${x.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};case"ghost":return{};default:return{}}},T=k=>a==="ghost"||a==="flush"?k?`${x.primary}10`:`${x.surfaceAlt}80`:k?`${x.primary}0d`:`${x.surfaceAlt}60`,j=a==="separated";return t.jsx("div",{className:b(o??""),style:{...M(),display:j?"flex":void 0,flexDirection:j?"column":void 0,gap:j?"8px":void 0,...m},children:e.map((k,Y)=>{const f=C.has(k.id),g=Y===e.length-1,S=`${y}-trigger-${k.id}`,F=`${y}-panel-${k.id}`;return t.jsxs("div",{className:k.className,style:N(Y,f,g),children:[t.jsxs("button",{id:S,type:"button",role:"button","aria-expanded":f,"aria-controls":F,disabled:k.disabled,onClick:()=>I(k.id,k.disabled),style:{width:"100%",display:"flex",alignItems:k.subtitle?"flex-start":"center",gap:"8px",padding:R.triggerPadding,border:"none",background:"transparent",cursor:k.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:R.fontSize,fontWeight:500,color:k.disabled?x.textMuted:x.text,opacity:k.disabled?.5:1,transition:h?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:D=>{k.disabled||(D.currentTarget.style.backgroundColor=T(f))},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=f?`${x.primary}0d`:"transparent"},onFocus:D=>{k.disabled||(D.currentTarget.style.outline=`2px solid ${x.primary}`,D.currentTarget.style.outlineOffset="2px")},onBlur:D=>{D.currentTarget.style.outline="none"},children:[k.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:x.primary,marginTop:k.subtitle?"1px":void 0},children:k.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?x.primary:x.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Ir,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?x.primary:x.textMuted})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",lineHeight:1.4},children:k.title}),k.subtitle&&t.jsx("span",{style:{display:"block",fontSize:R.subtitleSize,color:x.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:k.subtitle})]}),k.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:k.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?x.primary:x.textMuted,marginTop:k.subtitle?"1px":void 0},children:t.jsx(Ir,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?x.primary:x.textMuted})})]}),t.jsx(Ks,{isOpen:f,reduced:h,id:F,triggerId:S,children:t.jsx("div",{style:{padding:R.contentPadding,fontSize:R.fontSize,lineHeight:1.6,color:x.textMuted,fontFamily:"inherit"},children:k.content})})]},k.id)})})}Dn.displayName="TkxAccordion";const Xs={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let or=0;function qs(){++or===1&&(document.body.style.overflow="hidden")}function Er(){--or<=0&&(or=0,document.body.style.overflow="")}function Zs(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function Gs(e,r){const n=Xs[r],i=e==="left"||e==="right",s={position:"absolute"};return i?{...s,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...s,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}function zr(){return t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function Js({isOpen:e,onClose:r,placement:n="right",size:i="md",title:s,children:a,footer:l,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const p=ee(),o=ye(),m=c.useId(),x=Lt(e);if(Ft(r,u&&e),c.useEffect(()=>(e?qs():Er(),()=>{e&&Er()}),[e]),typeof document>"u")return null;const h=Gs(n,i),y=Zs(n),z=o?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",v=typeof s=="string"?B(s):s;return Be.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[t.jsx("div",{"aria-hidden":"true",onClick:d?r:void 0,className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:o?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),t.jsxs("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,className:b("absolute flex flex-col font-sans"),style:{...h,backgroundColor:p.surface,borderLeft:n==="right"?`1px solid ${p.border}`:void 0,borderRight:n==="left"?`1px solid ${p.border}`:void 0,borderTop:n==="bottom"?`1px solid ${p.border}`:void 0,borderBottom:n==="top"?`1px solid ${p.border}`:void 0,boxShadow:`0 20px 60px ${p.bg}99`,transform:e?"translate(0,0)":y,opacity:e?1:0,transition:z,willChange:"transform"},children:[s!==void 0&&t.jsxs("div",{className:b("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${p.border}`},children:[t.jsx("h2",{id:m,className:b("m-0 text-base font-semibold leading-snug"),style:{color:p.text},children:v}),t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:p.textMuted},children:t.jsx(zr,{})})]}),s===void 0&&t.jsx("div",{className:b("flex justify-end px-3 pt-3 shrink-0"),children:t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:p.textMuted},children:t.jsx(zr,{})})}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-5 py-4"),style:{color:p.text},children:a}),l&&t.jsx("div",{className:b("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${p.border}`},children:l})]})]}),document.body)}const Qs=["Su","Mo","Tu","We","Th","Fr","Sa"],Nr=["January","February","March","April","May","June","July","August","September","October","November","December"],ei=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Re(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ze(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ti(e,r,n){if(!r||!n)return!1;const i=ze(e).getTime(),s=ze(r).getTime(),a=ze(n).getTime(),l=Math.min(s,a),d=Math.max(s,a);return i>l&&i<d}function Rr(e,r,n){return!!(r&&Re(e,r)||n&&Re(e,n))}function Ue(e,r="en-US"){return e?e.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function ri(e){const r=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,i,s]=r.map(Number);if(n<1||n>12||i<1||i>31)return null;const a=new Date(s,n-1,i);return a.getMonth()!==n-1?null:a}function Ar(e,r){return new Date(e,r+1,0).getDate()}function ni(e,r){const n=new Date(e,r,1).getDay(),i=Ar(e,r),s=[],a=Ar(e,r-1);for(let d=n-1;d>=0;d--)s.push(new Date(e,r-1,a-d));for(let d=1;d<=i;d++)s.push(new Date(e,r,d));let l=1;for(;s.length<42;)s.push(new Date(e,r+1,l++));return s}function Kt(e){return Math.floor(e/10)*10}function oi(){return[{label:"Today",getValue:()=>{const e=ze(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=ze(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-6),[r,e]}},{label:"Last 30 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-29),[r,e]}},{label:"Last 90 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-89),[r,e]}},{label:"This week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay());const n=new Date(r);return n.setDate(n.getDate()+6),[r,n]}},{label:"Last week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay()-1);const n=new Date(r);return n.setDate(n.getDate()-6),[n,r]}},{label:"This month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),r*3,1),new Date(e.getFullYear(),r*3+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3),n=r===0?3:r-1,i=r===0?e.getFullYear()-1:e.getFullYear();return[new Date(i,n*3,1),new Date(i,n*3+3,0)]}},{label:"This year",getValue:()=>{const e=new Date().getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=new Date().getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}function si(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=window.scrollY,a=window.scrollX,d=i-n.bottom<r+8&&n.top>r+8;return{top:d?s+n.top-r-4:s+n.bottom+4,left:a+n.left,flipUp:d}}function Dr({values:e,selected:r,onSelect:n,label:i,theme:s,format:a}){const l=c.useRef([]),d=c.useRef(null);c.useEffect(()=>{const p=l.current[r];p&&d.current&&p.scrollIntoView({block:"nearest"})},[r]);const u=a??(p=>String(p).padStart(2,"0"));return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:s.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:i}),t.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${s.border}`,borderRadius:"8px",padding:"4px"},children:e.map(p=>{const o=p===r;return t.jsx("button",{ref:m=>{l.current[p]=m},type:"button",onClick:()=>n(p),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?s.primary:"transparent",color:o?s.bg:s.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(p)},p)})})]})}function Lr({year:e,month:r,today:n,mode:i,selectedDate:s,selectedRange:a,multiDates:l,hoverDate:d,focusedDate:u,isDateDisabled:p,onSelectDate:o,onHoverDate:m,onSetFocused:x,theme:h,locale:y}){const z=ni(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Qs.map(v=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:h.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:v},v))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:z.map((v,$)=>{const w=v.getMonth()===r,C=Re(v,n),I=v.getDay()===0||v.getDay()===6,R=p(v),M=i==="single"&&s!=null&&Re(v,s),N=i==="multiple"&&l.some(O=>Re(O,v)),T=i==="range"&&Rr(v,a[0],null),j=i==="range"&&Rr(v,null,a[1]),k=T||j,Y=i==="range"&&a[0]&&!a[1]&&d?d:a[1],f=i==="range"&&ti(v,a[0],Y),g=i==="range"&&a[0]&&!a[1]&&d&&Re(v,d),S=M||N||k,F=u!=null&&Re(v,u);let D="transparent",V=w?I?`${h.text}cc`:h.text:`${h.textMuted}60`,E="none",P=400;S||g?(D=h.primary,V=h.bg,P=600):f&&(D=`${h.primary}18`),C&&!S&&(E=`2px solid ${h.primary}`,P=600),R&&(V=`${h.textMuted}50`),F&&!S&&(E=`2px solid ${h.secondary}`);const W=v.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":W,"aria-pressed":S,"aria-disabled":R,disabled:R,onClick:()=>!R&&o(v),onMouseEnter:()=>m(v),onMouseLeave:()=>m(null),onFocus:()=>x(v),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:V,border:E,fontSize:"13px",fontWeight:P,cursor:R?"not-allowed":"pointer",opacity:R?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:R?"line-through":"none",transition:"background-color 80ms ease"},children:v.getDate()},$)})})]})}function Ln({value:e,onChange:r,rangeValue:n,onRangeChange:i,multiValue:s,onMultiChange:a,mode:l="single",minDate:d,maxDate:u,disabledDates:p,locale:o="en-US",showTime:m=!1,timeValue:x,onTimeChange:h,showPresets:y=!1,customPresets:z,label:v,placeholder:$="MM/DD/YYYY",hint:w,isDisabled:C=!1,isInvalid:I=!1,errorMessage:R,numberOfMonths:M=1,id:N,className:T,style:j}){const k=ee(),Y=c.useId(),f=N??Y,g=ye(),S=ze(new Date),F=e!==void 0,[D,V]=c.useState(null),E=F?e??null:D,P=n!==void 0,[W,O]=c.useState([null,null]),A=P?n:W,H=s!==void 0,[Q,G]=c.useState([]),ne=H?s:Q,[pe,xe]=c.useState("start"),oe=l==="range"||l==="single"&&m,[me,X]=c.useState([null,null]),[Z,ve]=c.useState(null),we=E??A[0]??S,[de,ge]=c.useState(we.getFullYear()),[J,ie]=c.useState(we.getMonth()),[re,q]=c.useState("day"),[te,be]=c.useState({h:0,m:0}),$e=x??te,[Me,Te]=c.useState(!1),[Xe,Ee]=c.useState(()=>{if(l==="single")return Ue(E,o);if(l==="range"){const[_,K]=A;if(_&&K)return`${Ue(_,o)} – ${Ue(K,o)}`}return""}),[U,le]=c.useState(null),[se,Se]=c.useState(null),[Ae,De]=c.useState({top:0,left:0,flipUp:!1}),[,lt]=c.useReducer(_=>_+1,0),nt=c.useRef(null),mt=c.useRef(null),gt=c.useRef(null),bt=y?420:m?480:360;c.useEffect(()=>{if(l==="single")Ee(Ue(E,o));else if(l==="range"){const[_,K]=A;Ee(_&&K?`${Ue(_,o)} – ${Ue(K,o)}`:_?Ue(_,o):"")}else l==="multiple"&&Ee(ne.length>0?`${ne.length} date${ne.length!==1?"s":""} selected`:"")},[E,A,ne,l,o]);const Ye=c.useCallback(()=>{nt.current&&De(si(nt.current,bt))},[bt]);c.useEffect(()=>{if(Me)return Ye(),window.addEventListener("scroll",Ye,!0),window.addEventListener("resize",Ye),()=>{window.removeEventListener("scroll",Ye,!0),window.removeEventListener("resize",Ye)}},[Me,Ye]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce,je;(ce=nt.current)!=null&&ce.contains(K.target)||(je=mt.current)!=null&&je.contains(K.target)||Te(!1)};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[Me]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce;K.key==="Escape"&&(Te(!1),(ce=gt.current)==null||ce.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[Me]);const qe=c.useCallback(_=>d&&ze(_)<ze(d)||u&&ze(_)>ze(u)?!0:p?typeof p=="function"?p(_):p.some(K=>Re(K,_)):!1,[d,u,p]),ot=c.useCallback(_=>{if(!qe(_)){if(l==="single")oe?ve(_):(F||V(_),r==null||r(_),Ee(Ue(_,o)),Te(!1));else if(l==="range")if(pe==="start"){const K=[_,null];X(K),P||O(K),i==null||i(K),xe("end")}else{const K=me[0]??A[0],ce=K&&_<K?[_,K]:[K,_];X(ce),oe?xe("start"):(P||O(ce),i==null||i(ce),xe("start"),Te(!1))}else if(l==="multiple"){const ce=ne.some(je=>Re(je,_))?ne.filter(je=>!Re(je,_)):[...ne,_];H||G(ce),a==null||a(ce)}lt()}},[l,qe,F,P,H,r,i,a,pe,me,A,ne,oe,o]),Bt=c.useCallback(()=>{if(l==="single"){const _=Z??E;F||V(_),r==null||r(_)}else l==="range"&&(P||O(me),i==null||i(me));Te(!1),xe("start")},[l,Z,me,E,F,P,r,i]),Wt=c.useCallback(()=>{ve(null),X([null,null]),xe("start"),Te(!1)},[]),yt=()=>{J===0?(ie(11),ge(_=>_-1)):ie(_=>_-1),q("day")},vt=()=>{J===11?(ie(0),ge(_=>_+1)):ie(_=>_+1),q("day")},Ht=()=>ge(_=>_-1),Vt=()=>ge(_=>_+1),kt=()=>ge(_=>_-10),wt=()=>ge(_=>_+10),Ot=_=>{if(Ee(_),l==="single"){const K=ri(_);K&&!qe(K)&&(F||V(K),r==null||r(K),ge(K.getFullYear()),ie(K.getMonth()))}},jt=_=>{if(_.stopPropagation(),l==="single")F||V(null),r==null||r(null),Ee("");else if(l==="range"){const K=[null,null];P||O(K),i==null||i(K),X(K),Ee(""),xe("start")}else l==="multiple"&&(H||G([]),a==null||a([]),Ee(""))},Yt=_=>{if(re!=="day")return;const K=U??E??S;let ce=null;if(_.key==="ArrowRight")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+1);else if(_.key==="ArrowLeft")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-1);else if(_.key==="ArrowDown")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+7);else if(_.key==="ArrowUp")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-7);else if(_.key==="Enter"&&U){ot(U);return}ce&&(_.preventDefault(),le(ce),(ce.getMonth()!==J||ce.getFullYear()!==de)&&(ie(ce.getMonth()),ge(ce.getFullYear())))},L=()=>{ge(S.getFullYear()),ie(S.getMonth()),q("day"),ot(S)},fe=z??oi(),ke=_=>{const[K,ce]=_.getValue(),je=[K,ce];X(je),P||O(je),i==null||i(je),ge(K.getFullYear()),ie(K.getMonth()),xe("start"),oe||Te(!1)},Ce=J===11?0:J+1,Ze=J===11?de+1:de,_e=M>=2,ct=v?B(v):void 0,dt=w?B(w):void 0,ut=R?B(R):void 0,St=B($),$t=l==="single"&&E!=null||l==="range"&&(A[0]!=null||A[1]!=null)||l==="multiple"&&ne.length>0,Fe=l==="range"?oe?me:A:[null,null],so=I?k.danger:Me?k.primary:k.border,io=Array.from({length:24},(_,K)=>K),ao=Array.from({length:60},(_,K)=>K),lo=t.jsxs("div",{ref:mt,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Yt,style:{position:"absolute",top:Ae.top,left:Ae.left,zIndex:9999,backgroundColor:k.surface,border:`1px solid ${k.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:_e?"580px":"300px",maxWidth:_e&&y?"780px":_e?"620px":y?"520px":"300px",opacity:Me?1:0,transform:Me?"translateY(0) scale(1)":Ae.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:g?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[y&&l==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${k.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:k.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),fe.map(_=>{const[K,ce]=_.getValue(),je=Fe[0]&&Fe[1]&&Re(Fe[0],K)&&Re(Fe[1],ce);return t.jsx("button",{type:"button",onClick:()=>ke(_),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:je?`${k.primary}20`:"transparent",color:je?k.primary:k.text,fontWeight:je?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:ft=>{je||(ft.currentTarget.style.backgroundColor=`${k.surfaceAlt}`)},onMouseLeave:ft=>{je||(ft.currentTarget.style.backgroundColor="transparent")},children:_.label},_.label)})]}),t.jsxs("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("button",{type:"button","aria-label":re==="day"?"Previous month":re==="month"?"Previous year":"Previous decade",onClick:()=>{re==="day"?yt():re==="month"?Ht():kt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[re==="day"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>q("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:Nr[J]}),t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),_e&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:k.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[Nr[Ce]," ",Ze]})]})]}),re==="month"&&t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:k.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),re==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:k.text},children:[Kt(de),"–",Kt(de)+9]})]}),t.jsx("button",{type:"button","aria-label":re==="day"?"Next month":re==="month"?"Next year":"Next decade",onClick:()=>{re==="day"?vt():re==="month"?Vt():wt()},style:{border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),re==="day"&&t.jsxs("div",{style:{display:"flex",gap:"20px"},children:[t.jsx(Lr,{year:de,month:J,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:qe,onSelectDate:ot,onHoverDate:Se,onSetFocused:le,theme:k,locale:o}),_e&&t.jsx(Lr,{year:Ze,month:Ce,today:S,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:qe,onSelectDate:ot,onHoverDate:Se,onSetFocused:le,theme:k,locale:o})]}),re==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:ei.map((_,K)=>{const ce=K===J,je=K===S.getMonth()&&de===S.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{ie(K),q("day")},style:{padding:"10px",borderRadius:"8px",border:je&&!ce?`2px solid ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:ce?600:400,backgroundColor:ce?k.primary:"transparent",color:ce?k.bg:k.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:_},_)})}),re==="year"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(_,K)=>{const ce=Kt(de)-1+K,je=ce===de,ft=ce===S.getFullYear(),vr=K===0||K===11;return t.jsx("button",{type:"button",onClick:()=>{ge(ce),q("month")},style:{padding:"10px 6px",borderRadius:"8px",border:ft&&!je?`2px solid ${k.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:je?600:400,backgroundColor:je?k.primary:"transparent",color:je?k.bg:vr?k.textMuted:k.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:vr?.5:1},children:ce},ce)})}),m&&re==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(Dr,{values:io,selected:$e.h,onSelect:_=>{x||be(K=>({...K,h:_})),h==null||h({...$e,h:_})},label:"Hour",theme:k}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:k.textMuted},children:":"}),t.jsx(Dr,{values:ao,selected:$e.m,onSelect:_=>{x||be(K=>({...K,m:_})),h==null||h({...$e,m:_})},label:"Min",theme:k})]}),l==="multiple"&&re==="day"&&ne.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"8px",fontSize:"12px",color:k.textMuted,textAlign:"center"},children:[ne.length," date",ne.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${k.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:oe?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:L,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:k.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),oe&&t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx("button",{type:"button",onClick:Wt,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${k.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:k.text,fontFamily:"inherit"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:Bt,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:k.primary,color:k.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:T,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...j},children:[ct&&t.jsx("label",{htmlFor:f,style:{fontSize:"13px",fontWeight:500,color:k.text,marginBottom:"2px"},children:ct}),t.jsxs("div",{ref:nt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${so}`,borderRadius:"8px",backgroundColor:k.surface,overflow:"hidden",transition:g?"none":"border-color 120ms ease",opacity:C?.5:1},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:k.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),t.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),t.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),t.jsx("input",{ref:gt,id:f,type:"text",value:Xe,placeholder:St,disabled:C,"aria-invalid":I,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:l==="range"||l==="multiple",onChange:_=>Ot(_.target.value),onFocus:()=>{C||Te(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:k.text,cursor:l!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),$t&&!C&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:jt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:k.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:t.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),t.jsx("button",{type:"button","aria-label":Me?"Close calendar":"Open calendar",tabIndex:-1,disabled:C,onClick:()=>{C||Te(_=>!_)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:C?"not-allowed":"pointer",color:k.textMuted,flexShrink:0},children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:Me?"rotate(180deg)":"rotate(0deg)",transition:g?"none":"transform 160ms ease"},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),dt&&!I&&t.jsx("span",{style:{fontSize:"12px",color:k.textMuted},children:dt}),I&&ut&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:k.danger},children:ut}),Me&&typeof document<"u"&&Be.createPortal(lo,document.body)]})}Ln.displayName="TkxDatePicker";const ii={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function et(e,r,n){return Math.min(Math.max(e,r),n)}function sr(e,r,n){return Math.round((e-r)/n)*n+r}function Oe(e,r,n){return(e-r)/(n-r)*100}function Xt({value:e,min:r,max:n,step:i,isDisabled:s,trackColor:a,thumbSize:l,ariaLabel:d,tooltipMode:u,formatValue:p,orientation:o,onChange:m,onChangeEnd:x}){const[h,y]=c.useState(!1),[z,v]=c.useState(!1),[$,w]=c.useState(!1),C=j=>{s||(j.key==="ArrowRight"||j.key==="ArrowUp"?(j.preventDefault(),m(et(sr(e+i,r,i),r,n))):j.key==="ArrowLeft"||j.key==="ArrowDown"?(j.preventDefault(),m(et(sr(e-i,r,i),r,n))):j.key==="Home"?(j.preventDefault(),m(r)):j.key==="End"&&(j.preventDefault(),m(n)))},I=o==="vertical",R=Oe(e,r,n),M=u==="always"||u==="hover"&&($||z||h),N=I?{position:"absolute",bottom:`${R}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"}:{position:"absolute",left:`${R}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"},T=I?{position:"absolute",left:l+6,top:"50%",transform:"translateY(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:l+6,left:"50%",transform:"translateX(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return t.jsxs("div",{style:N,children:[M&&t.jsx("div",{style:T,children:p(e)}),t.jsx("div",{role:"slider",tabIndex:s?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":s,"aria-orientation":o,onKeyDown:C,onFocus:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:j=>{s||(v(!0),j.target.setPointerCapture(j.pointerId))},onPointerUp:()=>{v(!1),x==null||x()},style:{width:l,height:l,borderRadius:"50%",backgroundColor:s?"#888":a,border:"3px solid #fff",boxShadow:h?`0 0 0 3px ${a}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function Fn({value:e,defaultValue:r=0,onChange:n,rangeValue:i,onRangeChange:s,min:a=0,max:l=100,step:d=1,isRange:u=!1,label:p,showValue:o=!1,showTicks:m=!1,tickCount:x=5,isDisabled:h=!1,colorScheme:y="primary",size:z="md",marks:v,orientation:$="horizontal",showTooltip:w=!1,formatValue:C,onChangeEnd:I,onRangeChangeEnd:R,gradient:M=!1}){const N=ee(),T=c.useId(),j=ye(),k=e!==void 0,[Y,f]=c.useState(r),g=k?e:Y,S=i!==void 0,[F,D]=c.useState([a,l]),V=S?i:F,E=c.useRef(null),P=c.useRef(g);P.current=g;const W=c.useRef(V);W.current=V;const O={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[y],A=ii[z],H=$==="vertical",Q=w===!0?"hover":w===!1?!1:w,G=C??(J=>String(J)),ne=O+"66",pe=c.useCallback((J,ie)=>{const re=E.current;if(!re)return a;const q=re.getBoundingClientRect();let te;H?te=et((q.bottom-(ie??0))/q.height,0,1):te=et((J-q.left)/q.width,0,1);const be=te*(l-a)+a;return et(sr(be,a,d),a,l)},[a,l,d,H]),xe=c.useCallback(J=>{if(h)return;const ie=pe(J.clientX,J.clientY);if(!u)k||f(ie),n==null||n(ie);else{const[re,q]=V,te=Math.abs(ie-re),be=Math.abs(ie-q),$e=te<=be?[ie,q]:[re,ie];S||D($e),s==null||s($e)}},[h,u,k,S,pe,n,s,V]),oe=J=>{k||f(J),n==null||n(J)},me=J=>{const ie=[et(J,a,V[1]),V[1]];S||D(ie),s==null||s(ie)},X=J=>{const ie=[V[0],et(J,V[0],l)];S||D(ie),s==null||s(ie)},Z=u?Oe(V[0],a,l):0,ve=Oe(u?V[1]:g,a,l),we=m?Array.from({length:x},(J,ie)=>a+ie/(x-1)*(l-a)):[],de=p?B(p):void 0,ge=j?"none":"background 150ms ease";return t.jsxs("div",{className:b("flex flex-col gap-2"),style:{opacity:h?.55:1,...H?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(de||o)&&t.jsxs("div",{className:b("flex items-center justify-between"),children:[de&&t.jsx("label",{htmlFor:T,className:b("text-sm font-medium"),style:{color:N.text,fontSize:A.fontSize},children:de}),o&&!u&&t.jsx("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:G(g)}),o&&u&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:[G(V[0])," – ",G(V[1])]})]}),t.jsxs("div",{style:{position:"relative",...H?{paddingLeft:A.thumb/2,paddingRight:A.thumb/2,flex:1}:{paddingTop:A.thumb/2,paddingBottom:A.thumb/2}},children:[t.jsxs("div",{ref:E,onPointerDown:xe,style:{position:"relative",...H?{width:A.track,height:"100%"}:{height:A.track},borderRadius:9999,backgroundColor:N.border,cursor:h?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",...H?{left:0,bottom:`${Z}%`,height:`${ve-Z}%`,width:"100%"}:{top:0,left:`${Z}%`,width:`${ve-Z}%`,height:"100%"},borderRadius:9999,...h?{backgroundColor:N.textMuted}:M?{background:H?`linear-gradient(to top, ${ne}, ${O})`:`linear-gradient(to right, ${ne}, ${O})`}:{backgroundColor:O},transition:ge}}),we.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Oe(J,a,l)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:A.track+4}:{left:`${Oe(J,a,l)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:A.track+4},backgroundColor:N.surface,borderRadius:9999,pointerEvents:"none"}},ie)),u?t.jsxs(t.Fragment,{children:[t.jsx(Xt,{value:V[0],min:a,max:V[1],step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:G,orientation:$,onChange:me,onChangeEnd:R?()=>R(W.current):void 0}),t.jsx(Xt,{value:V[1],min:V[0],max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:G,orientation:$,onChange:X,onChangeEnd:R?()=>R(W.current):void 0})]}):t.jsx(Xt,{value:g,min:a,max:l,step:d,isDisabled:h,trackColor:O,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:G,orientation:$,onChange:oe,onChangeEnd:I?()=>I(P.current):void 0})]}),v&&v.length>0&&t.jsx("div",{style:{position:H?"absolute":"relative",...H?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:v.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Oe(J.value,a,l)}%`,transform:"translateY(50%)",left:0}:{left:`${Oe(J.value,a,l)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:N.textMuted,whiteSpace:"nowrap"},children:B(J.label)},ie))})]}),m&&!v&&!H&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:we.map((J,ie)=>t.jsx("span",{style:{position:"absolute",left:`${Oe(J,a,l)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:N.textMuted},children:G(Math.round(J))},ie))})]})}Fn.displayName="TkxSlider";const ai={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function li(e,r,n,i){if(r<=1)return[1];const s=(y,z)=>Array.from({length:Math.max(0,z-y+1)},(v,$)=>y+$),a=Math.max(e-n,1),l=Math.min(e+n,r);if(!i){const y=[];return a>1&&y.push("..."),y.push(...s(a,l)),l<r&&y.push("..."),y}const d=1,u=r,p=a>d+2,o=l<u-2,m=[];m.push(1),p?m.push("left-ellipsis"):m.push(...s(2,a-1)),m.push(...s(Math.max(a,2),Math.min(l,r-1))),o?m.push("right-ellipsis"):m.push(...s(l+1,r-1)),r>1&&m.push(r);const x=new Set,h=[];for(const y of m)typeof y=="number"?x.has(y)||(x.add(y),h.push(y)):h.push(y);return h}function Pn({total:e,pageSize:r=10,page:n,defaultPage:i=1,onChange:s,siblingCount:a=1,showEdges:l=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:p=[10,25,50,100],size:o="md",variant:m="default"}){const x=ee(),h=c.useId(),y=n!==void 0,[z,v]=c.useState(i),$=y?n:z,[w,C]=c.useState(r),I=r,R=Math.max(1,Math.ceil(e/I)),M=S=>{const F=Math.min(Math.max(S,1),R);F!==$&&(y||v(F),s==null||s(F))},N=S=>{C(S),u==null||u(S),M(1)},T=li($,R,a,l),j=ai[o],k=Math.min(($-1)*I+1,e),Y=Math.min($*I,e),f=(S,F)=>{const D={height:j.height,minWidth:j.minWidth,paddingLeft:j.px,paddingRight:j.px,fontSize:j.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:F?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:F?.4:1};return S?{...D,backgroundColor:x.primary,color:x.bg,fontWeight:600,boxShadow:`0 0 0 2px ${x.primary}44`}:m==="default"?{...D,backgroundColor:x.surface,color:x.text,border:`1px solid ${x.border}`}:m==="outline"?{...D,backgroundColor:"transparent",color:x.text,border:`1px solid ${x.border}`}:{...D,backgroundColor:"transparent",color:x.text}},g=({d:S})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("polyline",{points:S})});return t.jsxs("nav",{"aria-label":"Pagination",className:b("flex flex-col gap-2"),children:[e>0&&t.jsx("p",{className:b("text-sm"),style:{color:x.textMuted,fontSize:j.fontSize},children:B(`Showing ${k}–${Y} of ${e} items`)}),t.jsxs("div",{className:b("flex items-center gap-1 flex-wrap"),children:[l&&t.jsxs("button",{type:"button","aria-label":"First page",disabled:$===1,onClick:()=>M(1),style:f(!1,$===1),children:[t.jsx(g,{d:"15 18 9 12 15 6"}),t.jsx(g,{d:"20 18 14 12 20 6"})]}),t.jsx("button",{type:"button","aria-label":"Previous page",disabled:$===1,onClick:()=>M($-1),style:f(!1,$===1),children:t.jsx(g,{d:"15 18 9 12 15 6"})}),T.map((S,F)=>{if(typeof S=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:j.minWidth,height:j.height,fontSize:j.fontSize,color:x.textMuted,userSelect:"none"},children:"…"},`${S}-${F}`);const V=S,E=V===$;return t.jsx("button",{type:"button","aria-label":`Page ${V}`,"aria-current":E?"page":void 0,onClick:()=>M(V),style:f(E,!1),children:V},V)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:$===R,onClick:()=>M($+1),style:f(!1,$===R),children:t.jsx(g,{d:"9 18 15 12 9 6"})}),l&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:$===R,onClick:()=>M(R),style:f(!1,$===R),children:[t.jsx(g,{d:"4 18 10 12 4 6"}),t.jsx(g,{d:"14 18 20 12 14 6"})]}),d&&t.jsxs("div",{className:b("flex items-center gap-2 ml-2"),children:[t.jsx("label",{htmlFor:h,className:b("text-sm"),style:{color:x.textMuted,fontSize:j.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:h,value:w,onChange:S=>N(Number(S.target.value)),style:{height:j.height,paddingLeft:j.px,paddingRight:j.px,fontSize:j.fontSize,borderRadius:"8px",border:`1px solid ${x.border}`,backgroundColor:x.surface,color:x.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:p.map(S=>t.jsx("option",{value:S,children:S},S))})]})]})]})}Pn.displayName="TkxPagination";const ci={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},di={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function ui({color:e,size:r}){return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function fi({src:e,alt:r,fallback:n,placeholder:i="skeleton",fit:s="cover",ratio:a="auto",radius:l="none",caption:d,lazy:u=!1,preview:p=!1,className:o,style:m,...x}){const h=ee(),y=ye(),[z,v]=c.useState(!1),[$,w]=c.useState(!1),[C,I]=c.useState(!1),R=c.useRef(null),M=B(e),N=r?B(r):"",T=d?B(d):"",j=di[l];c.useEffect(()=>{var H;(H=R.current)!=null&&H.complete&&v(!0)},[]);const k=c.useCallback(()=>v(!0),[]),Y=c.useCallback(()=>w(!0),[]),f=c.useCallback(()=>{p&&!$&&I(!0)},[p,$]),g=c.useCallback(()=>I(!1),[]);c.useEffect(()=>{if(!C)return;const H=Q=>{Q.key==="Escape"&&g()};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[C,g]);const S=i==="skeleton"&&!z&&!$,F=S&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},D=$?null:t.jsx("img",{ref:R,src:M,alt:N||void 0,role:N?void 0:"img","aria-label":N?void 0:"Image",loading:u?"lazy":void 0,onLoad:k,onError:Y,onClick:p?f:void 0,className:ue(b("block w-full h-full"),p&&!$?b("cursor-pointer"):""),style:{objectFit:s,borderRadius:j,opacity:z?1:0,transition:y?"none":"opacity 200ms ease",position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0},...x}),V=$?n?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{role:"img","aria-label":N||"Image failed to load",className:b("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:h.surfaceAlt,borderRadius:j,color:h.textMuted,minHeight:"80px"},children:[t.jsx(ui,{color:h.textMuted,size:32}),t.jsx("span",{className:b("text-xs"),style:{color:h.textMuted},children:"Failed to load"})]}):null,E=S?t.jsx("div",{"aria-hidden":"true",style:{position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0,width:"100%",height:a==="auto"?"100%":void 0,minHeight:a==="auto"?"80px":void 0,borderRadius:j,backgroundColor:h.surfaceAlt,...F}}):null,P=a==="auto"?t.jsxs("div",{className:b("relative w-full"),style:{borderRadius:j},children:[E,D,V]}):t.jsxs("div",{className:b("relative w-full overflow-hidden"),style:{paddingBottom:ci[a],borderRadius:j},children:[E,D,V]}),W=T?t.jsxs("figure",{className:b("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:j},children:[P,t.jsx("figcaption",{className:b("text-sm text-center"),style:{color:h.textMuted},children:T})]}):P,O=t.jsx("div",{className:ue(b("inline-block w-full"),o),style:m,children:W}),A=C&&typeof document<"u"?Be.createPortal(t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":N||"Image preview",className:b("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:g,children:[t.jsx("div",{"aria-hidden":"true",className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),t.jsx("img",{src:M,alt:N||"Full-size preview",onClick:H=>H.stopPropagation(),className:b("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),t.jsx("button",{"aria-label":"Close preview",onClick:g,className:b("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null;return t.jsxs(t.Fragment,{children:[O,A]})}function Fr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function pi({mimeType:e,color:r}){return e.startsWith("image/")?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]}):e==="application/pdf"?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"}),t.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),t.jsx("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"})]})}let xi=0;function hi(){return`tkx-file-${++xi}`}function mi({accept:e,multiple:r=!1,maxSize:n,maxFiles:i,onChange:s,onError:a,label:l="Upload files",hint:d,isDisabled:u=!1,preview:p=!0,dragDrop:o=!0,variant:m="dropzone"}){const x=ee(),h=ye(),y=c.useId(),z=c.useRef(null),[v,$]=c.useState(!1),[w,C]=c.useState([]);c.useEffect(()=>()=>{w.forEach(E=>{E.objectUrl&&URL.revokeObjectURL(E.objectUrl)})},[]);const I=c.useCallback(E=>{let P=0;const W=setInterval(()=>{P+=Math.floor(Math.random()*20)+10,P>=100&&(P=100,clearInterval(W)),C(O=>O.map(A=>A.id===E?{...A,progress:P}:A))},100)},[]),R=c.useCallback(E=>{if(n&&E.size>n)return`"${B(E.name)}" exceeds max size of ${Fr(n)}`;if(e&&!e.split(",").map(O=>O.trim()).some(O=>O.startsWith(".")?E.name.toLowerCase().endsWith(O.toLowerCase()):O.endsWith("/*")?E.type.startsWith(O.slice(0,-1)):E.type===O))return`"${B(E.name)}" is not an accepted file type`},[e,n]),M=c.useCallback(E=>{const P=i?i-w.length:1/0;if(P<=0){a==null||a(`Maximum of ${i} file${i===1?"":"s"} allowed`);return}const O=E.slice(0,P).map(A=>{const H=R(A),Q=p&&A.type.startsWith("image/")&&!H?URL.createObjectURL(A):void 0;return{file:A,id:hi(),objectUrl:Q,progress:0,error:H}});C(A=>{const H=r?[...A,...O]:O,Q=H.filter(G=>!G.error).map(G=>G.file);return s==null||s(Q),H}),O.forEach(A=>{A.error&&(a==null||a(A.error))}),O.forEach(A=>{A.error||I(A.id)})},[w.length,i,r,s,a,p,I,R]),N=c.useCallback(E=>{const P=Array.from(E.target.files??[]);P.length&&M(P),E.target.value=""},[M]),T=c.useCallback(E=>{if(E.preventDefault(),$(!1),u)return;const P=Array.from(E.dataTransfer.files);P.length&&M(P)},[u,M]),j=c.useCallback(E=>{E.preventDefault(),u||$(!0)},[u]),k=c.useCallback(()=>$(!1),[]),Y=c.useCallback(E=>{C(P=>{const W=P.find(A=>A.id===E);W!=null&&W.objectUrl&&URL.revokeObjectURL(W.objectUrl);const O=P.filter(A=>A.id!==E);return s==null||s(O.filter(A=>!A.error).map(A=>A.file)),O})},[s]),f=c.useCallback(()=>{var E;u||(E=z.current)==null||E.click()},[u]),g=v?x.primary:x.border,S=B(l),F=d?B(d):"",D=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":S,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:f,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},onDrop:o?T:void 0,onDragOver:o?j:void 0,onDragLeave:o?k:void 0,className:b("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${g}`,backgroundColor:v?`${x.primary}10`:x.surface,cursor:u?"not-allowed":"pointer",opacity:u?.5:1,transition:h?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:v?x.primary:x.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),t.jsxs("div",{className:b("text-center"),children:[t.jsx("p",{className:b("m-0 text-sm font-medium"),style:{color:x.text},children:v?"Drop files here":S}),F&&t.jsx("p",{id:y,className:b("m-0 text-xs mt-1"),style:{color:x.textMuted},children:F})]})]}),V=t.jsxs("button",{type:"button",disabled:u,onClick:f,"aria-describedby":d?y:void 0,className:b("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:x.primary,color:x.bg,opacity:u?.5:1,cursor:u?"not-allowed":"pointer"},children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),S,d&&t.jsx("span",{id:y,className:b("sr-only"),children:F})]});return t.jsxs("div",{className:b("flex flex-col gap-3 w-full font-sans"),children:[t.jsx("input",{ref:z,type:"file",accept:e,multiple:r,disabled:u,onChange:N,className:b("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?D:V,w.length>0&&t.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:b("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(E=>t.jsxs("li",{className:b("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:x.surfaceAlt,border:`1px solid ${E.error?x.danger:x.border}`},children:[t.jsxs("div",{className:b("flex items-center gap-3"),children:[E.objectUrl&&p?t.jsx("img",{src:E.objectUrl,alt:B(E.file.name),className:b("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(pi,{mimeType:E.file.type,color:E.error?x.danger:x.textMuted})}),t.jsxs("div",{className:b("flex flex-col gap-0.5 flex-1 min-w-0"),children:[t.jsx("span",{className:b("text-sm font-medium truncate"),style:{color:E.error?x.danger:x.text},title:E.file.name,children:B(E.file.name)}),t.jsxs("span",{className:b("text-xs"),style:{color:x.textMuted},children:[Fr(E.file.size),E.error&&` — ${E.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${B(E.file.name)}`,onClick:()=>Y(E.id),className:b("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:x.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!E.error&&E.progress<100&&t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:x.border},"aria-hidden":"true",children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:x.primary,width:`${E.progress}%`,transition:h?"none":"width 100ms ease"}})})]},E.id))})]})}const gi={sm:16,md:24,lg:32,xl:40};function bi({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function yi({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function vi({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function ki({type:e,size:r,filled:n,color:i,halfFilled:s,uid:a}){const l={size:r,filled:n,color:i,halfFilled:s,id:a};return e==="heart"?t.jsx(yi,{...l}):e==="circle"?t.jsx(vi,{...l}):t.jsx(bi,{...l})}function Pr(e,r,n){return Math.min(n,Math.max(r,e))}function wi(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Br(e,r,n){if(n===1)return r+1;const i=e.currentTarget.getBoundingClientRect(),s=i.left+i.width/2;return e.clientX<s?r+.5:r+1}function ji({value:e,defaultValue:r=0,onChange:n,max:i=5,precision:s=1,size:a="md",isReadOnly:l=!1,isDisabled:d=!1,label:u,showValue:p=!1,colorScheme:o="warning",emptyIcon:m="star",filledIcon:x="star"}){const h=ee(),y=ye(),z=c.useId(),v=e!==void 0,[$,w]=c.useState(r),[C,I]=c.useState(null),R=c.useRef(null),M=v?e??0:$,N=C??M,j={warning:h.warning,primary:h.primary,danger:h.danger}[o]??h.warning,k=gi[a],Y=!l&&!d,f=c.useCallback(E=>{v||w(E),n==null||n(E)},[v,n]),g=c.useCallback((E,P)=>{Y&&I(Br(E,P,s))},[Y,s]),S=c.useCallback(()=>{Y&&I(null)},[Y]),F=c.useCallback((E,P)=>{if(!Y)return;const W=Br(E,P,s);f(W===M?0:W)},[Y,s,M,f]),D=c.useCallback(E=>{if(!Y)return;const P=s;let W=M;if(E.key==="ArrowRight"||E.key==="ArrowUp")E.preventDefault(),W=Pr(M+P,0,i);else if(E.key==="ArrowLeft"||E.key==="ArrowDown")E.preventDefault(),W=Pr(M-P,0,i);else if(E.key==="Home")E.preventDefault(),W=0;else if(E.key==="End")E.preventDefault(),W=i;else return;W=wi(W,s),f(W)},[Y,M,i,s,f]),V=u?B(u):"Rating";return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2 font-sans"),d?b("opacity-50"):""),children:[t.jsx("div",{ref:R,role:"radiogroup","aria-label":V,"aria-disabled":d,"aria-readonly":l,tabIndex:Y?0:-1,onKeyDown:D,onMouseLeave:S,className:b("flex items-center gap-0.5 outline-none"),style:{cursor:Y?"pointer":"default"},children:Array.from({length:i},(E,P)=>{const W=P+1,O=P+.5,A=N>=W,H=!A&&s===.5&&N>=O,Q=`${z}-${P}`;return t.jsx("span",{role:"radio","aria-checked":s===.5&&M===O||M===W,"aria-label":s===.5?`${O} star${O!==1?"s":""} / ${W} star${W!==1?"s":""}`:`${W} star${W!==1?"s":""}`,tabIndex:-1,onMouseMove:G=>g(G,P),onClick:G=>F(G,P),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:C!==null&&N>=O&&Y?"scale(1.15)":"scale(1)"},children:t.jsx(ki,{type:A||H?x:m,size:k,filled:A,halfFilled:H,color:A||H?j:h.border,uid:H?Q:void 0})},P)})}),p&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:h.textMuted},"aria-live":"polite","aria-atomic":"true",children:[M%1===0?M.toFixed(0):M.toFixed(1)," / ",i]})]})}let Wr=!1;function Si(){if(Wr||typeof document>"u")return;Wr=!0;const e=document.createElement("style");e.textContent=`
|
|
24
24
|
@keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }
|
|
25
25
|
@keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }
|
|
26
26
|
.tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }
|
|
27
27
|
.tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }
|
|
28
28
|
.tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }
|
|
29
29
|
.tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }
|
|
30
|
-
`,document.head.appendChild(e)}function
|
|
30
|
+
`,document.head.appendChild(e)}function $i(){return t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),t.jsx("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),t.jsx("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Mi(){return t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),t.jsx("path",{d:"M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z",fill:"currentColor"})]})}function Bn(){const e=ee();return t.jsxs("div",{className:b("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":"Assistant is thinking",children:[t.jsx("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),t.jsx("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),t.jsx("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function Wn({message:e,showTimestamp:r,avatarUser:n,avatarAssistant:i}){const s=ee(),a=ye(),{role:l,content:d,timestamp:u,isStreaming:p,error:o}=e,m=B(d),x=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if(l==="system")return t.jsx("div",{role:"listitem",className:b("flex justify-center my-2"),children:t.jsx("p",{className:b("text-xs italic px-3 py-1 rounded-full"),style:{color:s.textMuted,backgroundColor:s.surfaceAlt},children:m})});const h=l==="user",y=h?n??t.jsx($i,{}):i??t.jsx(Mi,{}),z=h?{backgroundColor:s.primary,color:s.bg}:{backgroundColor:s.surface,color:s.text,border:`1px solid ${o?s.danger:s.border}`};return o&&(z.borderColor=s.danger,z.borderWidth="2px"),t.jsxs("div",{role:"listitem",className:b("flex gap-2 mb-4",h?"flex-row-reverse":"flex-row"),children:[t.jsx("div",{className:b("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:h?s.primary:s.secondary},children:y}),t.jsxs("div",{className:b("flex flex-col gap-1 max-w-[75%]",h?"items-end":"items-start"),children:[t.jsxs("div",{className:ue(b("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),p&&!a?"tkx-cursor":""),style:z,children:[m,o&&t.jsx("span",{"aria-label":"Error",style:{marginLeft:6,color:s.danger},children:"⚠"})]}),r&&x&&t.jsx("span",{className:b("text-[10px]"),style:{color:s.textMuted},children:x})]})]})}function Ci({messages:e,onSend:r,isLoading:n=!1,placeholder:i="Type a message…",maxLength:s,showTimestamps:a=!1,avatarUser:l,avatarAssistant:d,height:u=480,inputPosition:p="bottom"}){const o=ee(),m=ye(),[x,h]=c.useState(""),y=c.useRef(null),z=c.useRef(null);c.useEffect(()=>{Si()},[]),c.useEffect(()=>{const N=y.current;N&&N.scrollTo({top:N.scrollHeight,behavior:m?"auto":"smooth"})},[e,n,m]);const v=c.useCallback(()=>{const N=x.trim();!N||!r||(r(N),h(""),z.current&&(z.current.style.height="auto"))},[x,r]),$=c.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),v())},[v]),w=c.useCallback(N=>{const T=s?N.target.value.slice(0,s):N.target.value;h(T);const j=z.current;if(j){j.style.height="auto";const Y=24*4+24;j.style.height=`${Math.min(j.scrollHeight,Y)}px`}},[s]),C=x.trim().length>0&&!n,I=typeof u=="number"?`${u}px`:u,R=p==="floating",M=t.jsxs("div",{className:b("flex flex-col gap-1 p-3"),style:R?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:o.surface,border:`1px solid ${o.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${o.border}`,backgroundColor:o.surface},children:[t.jsxs("div",{className:b("flex items-end gap-2"),children:[t.jsx("textarea",{ref:z,rows:1,value:x,onChange:w,onKeyDown:$,placeholder:B(i),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:b("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:o.text,caretColor:o.primary,minHeight:32,maxHeight:120}}),t.jsx("button",{onClick:v,disabled:!C,"aria-label":"Send message",className:b("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!m&&"transition-opacity duration-150",C?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:o.primary,color:o.bg},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),s&&t.jsxs("div",{className:b("text-right text-[10px]"),style:{color:o.textMuted},children:[x.length,"/",s]})]});return t.jsxs("div",{className:b("flex flex-col overflow-hidden rounded-2xl"),style:{height:I,backgroundColor:o.bg,border:`1px solid ${o.border}`,position:"relative"},children:[t.jsx("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:b("flex-1 overflow-y-auto p-4"),style:{paddingBottom:R?80:void 0},children:t.jsxs("div",{role:"list",children:[e.map(N=>t.jsx(Wn,{message:N,showTimestamp:a,avatarUser:l,avatarAssistant:d},N.id)),n&&t.jsxs("div",{role:"listitem",className:b("flex gap-2 mb-4"),children:[t.jsx("div",{className:b("w-8 h-8 shrink-0")}),t.jsx(Bn,{})]})]})}),M]})}const Ti={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Ii={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},Ei={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},zi={sm:12,md:14,lg:16};function Ni(e,r){const n=ee(),s={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return r==="solid"?{bg:s,color:n.bg,border:"transparent"}:r==="subtle"?{bg:`${s}22`,color:s,border:"transparent"}:{bg:"transparent",color:s,border:s}}function Hn({variant:e="subtle",size:r="md",colorScheme:n="default",onRemove:i,leftIcon:s,isDisabled:a=!1,clickable:l=!1,children:d,className:u,style:p,onClick:o,...m}){ee();const x=ye(),h=Ni(n,e),y=typeof d=="string"?B(d):d,z=zi[r],v=b("inline-flex items-center font-medium rounded-full select-none",Ti[r],Ii[r],Ei[r],a?"opacity-50 cursor-not-allowed":l?"cursor-pointer":"cursor-default",l&&!x&&"transition-opacity duration-150");return t.jsxs("span",{role:l?"button":void 0,tabIndex:l&&!a?0:void 0,"aria-disabled":a||void 0,className:ue(v,u),style:{backgroundColor:h.bg,color:h.color,border:`1px solid ${h.border==="transparent"?"transparent":h.border}`,...p},onClick:a?void 0:o,onKeyDown:l&&!a&&o?$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),o($))}:void 0,...m,children:[s&&t.jsx("span",{"aria-hidden":"true",className:b("shrink-0 flex items-center"),children:s}),t.jsx("span",{children:y}),i&&!a&&t.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:$=>{$.stopPropagation(),i()},className:b("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:z+4,height:z+4,color:h.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:t.jsx("svg",{width:z,height:z,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function Ri({value:e,defaultValue:r=[],onChange:n,placeholder:i="Add tag…",maxTags:s,allowDuplicates:a=!1,validate:l,colorScheme:d="primary",size:u="md",label:p,hint:o,isDisabled:m=!1}){const x=ee(),h=ye(),[y,z]=c.useState(r),[v,$]=c.useState(""),[w,C]=c.useState(null),I=c.useRef(null),R=e!==void 0,M=R?e:y,N=c.useCallback(S=>{R||z(S),n==null||n(S)},[R,n]),T=c.useCallback(S=>{const F=S.trim();if(F){if(s!==void 0&&M.length>=s){C(`Maximum ${s} tags allowed`);return}if(!a&&M.includes(F)){C("Duplicate tags are not allowed");return}if(l){const D=l(F);if(D===!1){C("Invalid tag");return}if(typeof D=="string"){C(D);return}}C(null),N([...M,F]),$("")}},[M,s,a,l,N]),j=c.useCallback(S=>{const F=M.filter((D,V)=>V!==S);N(F),C(null)},[M,N]),k=c.useCallback(S=>{S.key==="Enter"||S.key===","?(S.preventDefault(),T(v)):S.key==="Backspace"&&v===""&&M.length>0&&j(M.length-1)},[v,M,T,j]),Y=c.useCallback(S=>{const F=S.target.value;F.endsWith(",")?T(F.slice(0,-1)):($(F),w&&C(null))},[T,w]),f=u==="sm"?"6px 8px":u==="lg"?"10px 12px":"8px 10px",g=u==="sm"?11:u==="lg"?14:12;return t.jsxs("div",{className:b("flex flex-col gap-1.5"),children:[p&&t.jsx("label",{className:b("text-sm font-medium"),style:{color:x.text},onClick:()=>{var S;return(S=I.current)==null?void 0:S.focus()},children:B(p)}),t.jsxs("div",{className:b("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!h&&"transition-colors duration-150"),style:{padding:f,backgroundColor:x.surface,border:`1.5px solid ${w?x.danger:x.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var S;return!m&&((S=I.current)==null?void 0:S.focus())},children:[M.map((S,F)=>t.jsx(Hn,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>j(F),isDisabled:m,children:S},`${S}-${F}`)),(!s||M.length<s)&&!m&&t.jsx("input",{ref:I,type:"text",value:v,onChange:Y,onKeyDown:k,placeholder:M.length===0?B(i):"",disabled:m,className:b("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:g,color:x.text,caretColor:x.primary},"aria-label":p??"Tag input"})]}),w&&t.jsx("p",{className:b("text-xs"),style:{color:x.danger},role:"alert",children:w}),o&&!w&&t.jsx("p",{className:b("text-xs"),style:{color:x.textMuted},children:B(o)})]})}let Hr=!1;function Ai(){if(Hr||typeof document>"u")return;Hr=!0;const e=document.createElement("style");e.textContent=`
|
|
31
31
|
@keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }
|
|
32
32
|
@keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
|
|
33
33
|
@keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
|
|
34
34
|
.tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
|
|
35
35
|
.tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
|
|
36
36
|
.tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
|
|
37
|
-
`,document.head.appendChild(e)}function
|
|
37
|
+
`,document.head.appendChild(e)}function Di(e="pending"){const r=ee();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[e]}function qt({status:e="pending",icon:r,size:n=28}){const i=ee(),s=ye(),a=Di(e),l=e==="active";return t.jsx("div",{className:ue(b("relative flex items-center justify-center rounded-full shrink-0 z-10"),l&&!s?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:e==="pending"?i.surface:a,border:`2px solid ${a}`,color:e==="pending"?a:i.bg},"aria-hidden":"true",children:r?t.jsx("span",{style:{fontSize:n*.45,lineHeight:1},children:r}):t.jsx("span",{style:{width:n*.35,height:n*.35,borderRadius:"50%",backgroundColor:e==="pending"?a:i.bg,display:"block"}})})}function Vr({style:e,color:r,animate:n}){return ee(),t.jsx("div",{className:ue(b("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${r}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:r,marginLeft:1},"aria-hidden":"true"})}function Or({style:e,color:r,animate:n}){return t.jsx("div",{className:ue(b("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${r}`,borderColor:r},"aria-hidden":"true"})}function Zt({item:e,compact:r}){const n=ee(),i=e.timestamp?B(e.timestamp):null;return t.jsxs("div",{className:b("flex flex-col gap-0.5",r?"pb-3":"pb-5"),children:[t.jsxs("div",{className:b("flex items-center gap-2 flex-wrap"),children:[t.jsx("span",{className:b("text-sm font-semibold leading-snug"),style:{color:n.text},children:typeof e.title=="string"?B(e.title):e.title}),e.badge&&t.jsx("span",{children:e.badge}),i&&t.jsx("span",{className:b("text-[11px] ml-auto"),style:{color:n.textMuted},children:i})]}),e.description&&!r&&t.jsx("div",{className:b("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:typeof e.description=="string"?B(e.description):e.description})]})}function Li({items:e,variant:r="default",orientation:n="vertical",connectorStyle:i="solid"}){const s=ee(),a=ye(),l=c.useRef(!1);c.useEffect(()=>{Ai(),l.current=!0},[]);const d=!a,u=r==="compact",p=r==="alternating"&&n==="vertical";return n==="horizontal"?t.jsx("div",{role:"list","aria-label":"Timeline",className:b("flex items-start w-full overflow-x-auto"),children:e.map((m,x)=>{const h=m.status??"pending",y=h==="completed"?s.success:s.border,z=x===e.length-1;return t.jsx("div",{role:"listitem",className:b("flex items-start flex-1 min-w-0"),children:t.jsxs("div",{className:b("flex flex-col items-center flex-1 min-w-0"),children:[t.jsxs("div",{className:b("flex items-center w-full"),children:[x>0&&t.jsx(Or,{style:i,color:y,animate:d}),t.jsx(qt,{status:h,icon:m.icon,size:24}),!z&&t.jsx(Or,{style:i,color:y,animate:d})]}),t.jsxs("div",{className:b("mt-2 px-1 text-center min-w-0 w-full"),children:[t.jsx("div",{className:b("text-xs font-semibold truncate"),style:{color:s.text},children:typeof m.title=="string"?B(m.title):m.title}),m.timestamp&&t.jsx("div",{className:b("text-[10px] mt-0.5"),style:{color:s.textMuted},children:B(m.timestamp)})]})]})},m.id)})}):t.jsx("div",{role:"list","aria-label":"Timeline",className:b("flex flex-col"),children:e.map((m,x)=>{const h=m.status??"pending",y=x===e.length-1,z=h==="completed"?s.success:s.border,v=p&&x%2===0;return p?t.jsxs("div",{role:"listitem",className:b("flex items-stretch gap-0"),children:[t.jsx("div",{className:b("flex-1 flex flex-col items-end pr-4",v?"":"invisible"),children:v&&t.jsx(Zt,{item:m,compact:u})}),t.jsxs("div",{className:b("flex flex-col items-center"),children:[t.jsx(qt,{status:h,icon:m.icon,size:28}),!y&&t.jsx(Vr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 flex flex-col items-start pl-4",v?"invisible":""),children:!v&&t.jsx(Zt,{item:m,compact:u})})]},m.id):t.jsxs("div",{role:"listitem",className:b("flex gap-3 items-stretch"),children:[t.jsxs("div",{className:b("flex flex-col items-center"),children:[t.jsx(qt,{status:h,icon:m.icon,size:u?22:28}),!y&&t.jsx(Vr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 min-w-0 pt-0.5"),children:t.jsx(Zt,{item:m,compact:u})})]},m.id)})})}function Yr(e,r,n,i){const s=window.innerWidth,a=window.innerHeight,l=6;let d=0,u=0,p="top left";switch(r){case"bottom-start":d=e.bottom+l,u=e.left,p="top left",d+i>a&&e.top-l-i>0&&(d=e.top-l-i,p="bottom left"),u+n>s&&(u=Math.max(0,s-n-8));break;case"bottom-end":d=e.bottom+l,u=e.right-n,p="top right",d+i>a&&e.top-l-i>0&&(d=e.top-l-i,p="bottom right"),u<0&&(u=8);break;case"top-start":d=e.top-l-i,u=e.left,p="bottom left",d<0&&(d=e.bottom+l,p="top left"),u+n>s&&(u=Math.max(0,s-n-8));break;case"top-end":d=e.top-l-i,u=e.right-n,p="bottom right",d<0&&(d=e.bottom+l,p="top right"),u<0&&(u=8);break;case"right-start":d=e.top,u=e.right+l,p="top left",u+n>s&&(u=e.left-l-n,p="top right"),d+i>a&&(d=Math.max(8,a-i-8));break;case"left-start":d=e.top,u=e.left-l-n,p="top right",u<0&&(u=e.right+l,p="top left"),d+i>a&&(d=Math.max(8,a-i-8));break}return{top:d+window.scrollY,left:u+window.scrollX,transformOrigin:p}}function Fi(e,r,n){const i=window.innerWidth,s=window.innerHeight,a=4;let l=e.right+a,d="top left";l+r>i&&(l=e.left-a-r,d="top right");let u=e.top;return u+n>s&&(u=Math.max(8,s-n-8)),{top:u+window.scrollY,left:l+window.scrollX,transformOrigin:d}}const Pi=`
|
|
38
38
|
@keyframes tkxMenuIn {
|
|
39
39
|
from { opacity: 0; transform: scale(0.94); }
|
|
40
40
|
to { opacity: 1; transform: scale(1); }
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
animation: tkxMenuInReduced 100ms ease forwards;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
`;function Ei(e,r){return{position:"absolute",top:r.top,left:r.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:r.transformOrigin,overflow:"hidden"}}function zi({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Ni({color:e}){return t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"5",fill:e}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function Ri({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M9 18l6-6-6-6"})})}function Ai(e){const r=[];let n=0;for(const i of e)if(i.type!=="separator")if(i.type==="radio-group")for(let s=0;s<i.options.length;s++)r.push({kind:"radio",item:i,optionIdx:s,idx:n++});else i.type==="check"?r.push({kind:"check",item:i,idx:n++}):i.type==="submenu"?r.push({kind:"submenu",item:i,idx:n++}):r.push({kind:"action",item:i,idx:n++});return r}function Hn({items:e,pos:r,panelId:n,onClose:i,onCloseAll:s,isSubmenu:a=!1}){const l=ee(),[d,u]=c.useState(-1),[x,o]=c.useState(null),[m,p]=c.useState(null),h=c.useRef(null),[y,z]=c.useState(""),v=c.useRef(null),$=Ai(e);c.useEffect(()=>{var T;(T=h.current)==null||T.focus()},[]),c.useEffect(()=>{var j;if(d<0)return;const T=(j=h.current)==null?void 0:j.querySelector(`[data-midx="${d}"]`);T==null||T.scrollIntoView({block:"nearest"})},[d]);const w=c.useCallback(T=>{var j,k,Y,f,g,S;if(T.kind==="action"){if(T.item.disabled)return;(k=(j=T.item).onClick)==null||k.call(j),s()}else if(T.kind==="check"){if(T.item.disabled)return;(f=(Y=T.item).onChange)==null||f.call(Y,!T.item.checked)}else if(T.kind==="radio"){if(T.item.disabled)return;(S=(g=T.item).onChange)==null||S.call(g,T.item.options[T.optionIdx].value)}else if(T.kind==="submenu"){if(T.item.disabled)return;o(T.item.id)}},[s]),C=T=>{var j;switch(T.key){case"ArrowDown":T.preventDefault(),u(k=>{const Y=k+1;return Y<$.length?Y:0});break;case"ArrowUp":T.preventDefault(),u(k=>{const Y=k-1;return Y>=0?Y:$.length-1});break;case"Home":T.preventDefault(),u(0);break;case"End":T.preventDefault(),u($.length-1);break;case"Enter":case" ":T.preventDefault(),d>=0&&$[d]&&w($[d]);break;case"Escape":T.preventDefault(),a?i():s();break;case"Tab":T.preventDefault(),s();break;case"ArrowRight":T.preventDefault(),d>=0&&((j=$[d])==null?void 0:j.kind)==="submenu"&&o($[d].item.id);break;case"ArrowLeft":T.preventDefault(),a&&i();break;default:T.key.length===1&&!T.ctrlKey&&!T.metaKey&&I(T.key)}};function I(T){v.current&&clearTimeout(v.current);const j=y+T.toLowerCase();z(j);const k=$.findIndex(Y=>(Y.kind==="radio"?Y.item.options[Y.optionIdx].label:Y.item.label).toLowerCase().startsWith(j));k>=0&&u(k),v.current=setTimeout(()=>z(""),800)}function R(T,j){const k=j.getBoundingClientRect();o(T.id);const Y=Math.min(T.items.length*38+12,360);p(Ti(k,220,Y))}function M(){o(null),p(null)}const N=()=>{let T=-1;return e.map(j=>{if(j.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(j.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:j.label?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginLeft:14}}),t.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:B(j.label)}),t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginRight:14}})]}):t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,margin:"0 10px"}})},j.id);if(j.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":j.label,children:[j.label&&t.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:B(j.label)}),j.options.map((D,V)=>{T++;const E=T,P=E===d,W=D.value===j.value,O=!!j.disabled,A=Ct(l,P,!1,O);return t.jsxs("div",{role:"menuitemradio","aria-checked":W,"aria-disabled":O||void 0,"data-midx":E,tabIndex:-1,style:A,onClick:()=>{var H;return!O&&((H=j.onChange)==null?void 0:H.call(j,D.value))},onMouseEnter:()=>!O&&u(E),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:W?t.jsx(Ni,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${l.border}`,display:"inline-block"}})}),D.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:D.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(D.label)})]},D.value)})]},j.id);if(j.type==="check"){T++;const D=T,V=D===d,E=!!j.disabled,P=Ct(l,V,!1,E);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":j.checked,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:P,onClick:()=>{var W;return!E&&((W=j.onChange)==null?void 0:W.call(j,!j.checked))},onMouseEnter:()=>!E&&u(D),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.checked?t.jsx(zi,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),j.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:j.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)})]},j.id)}if(j.type==="submenu"){T++;const D=T,V=D===d,E=!!j.disabled,P=x===j.id,W=Ct(l,V||P,!1,E);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:W,onMouseEnter:O=>{E||(u(D),R(j,O.currentTarget))},onMouseLeave:()=>{},onClick:()=>{E||o(P?null:j.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.icon?t.jsx("span",{style:{display:"flex",color:l.textMuted},children:j.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)}),t.jsx(Ri,{color:l.textMuted})]}),P&&m&&Be.createPortal(t.jsx(Hn,{items:j.items,pos:m,panelId:`${n}-sub-${j.id}`,onClose:M,onCloseAll:s,isSubmenu:!0}),document.body)]},j.id)}const k=j;T++;const Y=T,f=Y===d,g=!!k.disabled,S=!!k.danger,F=Ct(l,f,S,g);return t.jsxs("div",{role:"menuitem","aria-disabled":g||void 0,"data-midx":Y,tabIndex:-1,style:F,onClick:()=>{var D;g||((D=k.onClick)==null||D.call(k),s())},onMouseEnter:()=>{g||(u(Y),M())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:k.icon?t.jsx("span",{style:{display:"flex",color:S?l.danger:l.textMuted},children:k.icon}):t.jsx("span",{style:{width:14}})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(k.label)}),k.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:l.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(k.description)})]}),k.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:l.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:B(k.shortcut)})]},k.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:Ii}),t.jsx("div",{ref:h,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:C,style:{...Ei(l,r),maxHeight:400,overflowY:"auto"},children:N()})]})}function Ct(e,r,n,i){const s=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:i?"not-allowed":"pointer",userSelect:"none",color:i?e.textMuted:r&&n?e.danger:s,backgroundColor:r?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:i?.5:1,outline:"none"}}function Vn({trigger:e,items:r,placement:n="bottom-start",isDisabled:i=!1,onOpen:s,onClose:a,className:l,style:d}){const x=`tkx-menu-${c.useId().replace(/:/g,"")}`,[o,m]=c.useState(!1),[p,h]=c.useState(null),y=c.useRef(null),z=c.useCallback(()=>{if(i)return;const w=y.current;if(!w)return;const C=w.getBoundingClientRect(),I=Math.min(r.length*38+12,360);h(Or(C,n,220,I)),m(!0),s==null||s()},[i,r.length,s,n]),v=c.useCallback(()=>{var w,C,I;m(!1),a==null||a(),(I=(C=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:C.focus)==null||I.call(C)},[a]);c.useEffect(()=>{if(!o)return;const w=C=>{var M;const I=C.target;if((M=y.current)!=null&&M.contains(I))return;const R=document.querySelectorAll(".tkx-menu-panel");for(const N of R)if(N.contains(I))return;v()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[o,v]),c.useEffect(()=>{if(!o)return;const w=()=>{const C=y.current;if(!C)return;const I=C.getBoundingClientRect(),R=Math.min(r.length*38+12,360);h(Or(I,n,220,R))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[o,r.length,n]);const $=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),o||z()),w.key==="Escape"&&o&&(w.preventDefault(),v())};return t.jsxs("span",{ref:y,className:l,style:{display:"inline-flex",...d},children:[t.jsx("span",{role:"button",tabIndex:i?-1:0,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?x:void 0,"aria-disabled":i||void 0,onClick:()=>o?v():z(),onKeyDown:$,style:{display:"inline-flex",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none"},children:e}),o&&p&&Be.createPortal(t.jsx(Hn,{items:r,pos:p,panelId:x,onClose:v,onCloseAll:v}),document.body)]})}Vn.displayName="TkxMenu";const Di={sm:120,md:180,lg:240,xl:320};function Tt(e){const r=new Date;if(e)try{const l=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(r),d=v=>{var $;return(($=l.find(w=>w.type===v))==null?void 0:$.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const x=parseInt(d("minute"),10),o=parseInt(d("second"),10),m=d("weekday"),p=d("month"),h=d("day"),y=d("year"),z=`${m}, ${p} ${h}, ${y}`;return{hours:u,minutes:x,seconds:o,milliseconds:r.getMilliseconds(),dateString:z}}catch{}const n=r.getHours(),i=r.getMinutes(),s=r.getSeconds(),a=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:i,seconds:s,milliseconds:r.getMilliseconds(),dateString:a}}function Li({time:e,size:r,analogStyle:n,showSeconds:i,reducedMotion:s,primary:a,danger:l,text:d,textMuted:u,border:x,surface:o,bg:m}){const p=r/2,h=r/2,y=r/2-4,{hours:z,minutes:v,seconds:$,milliseconds:w}=e,I=($+(s?0:w)/1e3)/60*360,R=v/60*360+$/60*6,M=z%12/12*360+v/60*30,N=(S,F)=>{const D=(S-90)*Math.PI/180;return{x:p+Math.cos(D)*F,y:h+Math.sin(D)*F}},T=s?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const S=(O,A)=>{const Q=-90+O*360,G={x:p+Math.cos(-90*Math.PI/180)*A,y:h+Math.sin(-90*Math.PI/180)*A},ne={x:p+Math.cos(Q*Math.PI/180)*A,y:h+Math.sin(Q*Math.PI/180)*A},pe=O>.5?1:0;return`M ${G.x} ${G.y} A ${A} ${A} 0 ${pe} 1 ${ne.x} ${ne.y}`},F=z%12/12+v/60/12,D=v/60+$/3600,V=($+(s?0:w/1e3))/60,E=y-2,P=y-10,W=y-18;return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:p,cy:h,r:E,fill:"none",stroke:x,strokeWidth:4}),t.jsx("circle",{cx:p,cy:h,r:P,fill:"none",stroke:x,strokeWidth:4}),i&&t.jsx("circle",{cx:p,cy:h,r:W,fill:"none",stroke:x,strokeWidth:3}),t.jsx("path",{d:S(F,E),fill:"none",stroke:a,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:S(D,P),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),i&&t.jsx("path",{d:S(V,W),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),t.jsx("circle",{cx:p,cy:h,r:4,fill:a}),t.jsxs("text",{x:p,y:h+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(z).padStart(2,"0"),":",String(v).padStart(2,"0")]})]})}const j=N(M,y*.5),k=N(R,y*.75),Y=N(I,y*.85),f=N(I+180,y*.2),g=[];if(n==="classic"){for(let F=0;F<60;F++){const D=F/60*360,V=F%5===0,E=(D-90)*Math.PI/180,P=V?y-10:y-6,W=p+Math.cos(E)*y,O=h+Math.sin(E)*y,A=p+Math.cos(E)*P,H=h+Math.sin(E)*P;g.push(t.jsx("line",{x1:W,y1:O,x2:A,y2:H,stroke:V?d:u,strokeWidth:V?2:1,strokeLinecap:"round"},F))}const S=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:F,angle:D}of S){const V=(D-90)*Math.PI/180,E=y-20;g.push(t.jsx("text",{x:p+Math.cos(V)*E,y:h+Math.sin(V)*E,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:F},`n${F}`))}}else for(let S=0;S<12;S++){const D=(S/12*360-90)*Math.PI/180,V=y-8;g.push(t.jsx("circle",{cx:p+Math.cos(D)*V,cy:h+Math.sin(D)*V,r:S%3===0?3:2,fill:S%3===0?d:u},S))}return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",style:{display:"block"},children:[t.jsx("circle",{cx:p,cy:h,r:y,fill:o,stroke:x,strokeWidth:2}),g,t.jsx("line",{x1:p,y1:h,x2:j.x,y2:j.y,stroke:a,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:T}}),t.jsx("line",{x1:p,y1:h,x2:k.x,y2:k.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:T}}),i&&t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:f.x,y1:f.y,x2:Y.x,y2:Y.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:"none"}}),t.jsx("circle",{cx:p,cy:h,r:3,fill:l})]}),t.jsx("circle",{cx:p,cy:h,r:n==="minimal"?3:5,fill:a})]})}function Yr({time:e,format:r,showSeconds:n,showDate:i,label:s,size:a,primary:l,text:d,textMuted:u,colonVisible:x}){const{hours:o,minutes:m,seconds:p,dateString:h}=e;let y=o,z="";r==="12h"&&(z=o>=12?"PM":"AM",y=o%12||12);const v=a*.2,$={opacity:x?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return t.jsxs("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[t.jsxs("div",{style:{fontSize:v,color:l,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[t.jsx("span",{children:String(y).padStart(2,"0")}),t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:v*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:v*.05},children:z})]}),i&&t.jsx("div",{style:{fontSize:a*.072,color:u,marginTop:a*.025,letterSpacing:"0.03em"},children:h}),s&&t.jsx("div",{style:{fontSize:a*.065,color:u,marginTop:a*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:B(s)})]})}function On({variant:e="both",size:r="md",showSeconds:n=!0,showDate:i=!1,format:s="24h",timezone:a,timezone2:l,label:d,analogStyle:u="classic",className:x,style:o}){const m=ee(),p=ye(),[h,y]=c.useState(()=>Tt(a)),[z,v]=c.useState(()=>l?Tt(l):null),[$,w]=c.useState(!0),[C,I]=c.useState(!1),R=c.useRef(null);c.useEffect(()=>{I(!0)},[]),c.useEffect(()=>{const k=()=>{y(Tt(a)),l&&v(Tt(l))};k();const Y=setInterval(k,1e3);return()=>clearInterval(Y)},[a,l]),c.useEffect(()=>(R.current=setInterval(()=>{w(k=>!k)},500),()=>{R.current&&clearInterval(R.current)}),[]);const M=Di[r],N=e==="analog"||e==="both",T=e==="digital"||e==="both",j={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${M*.06}px`:0,opacity:C?1:0,transition:p?"none":"opacity 0.4s ease",...o};return t.jsxs("div",{className:x,style:j,role:"timer","aria-live":"off",children:[N&&t.jsx(Li,{time:h,size:M,analogStyle:u,showSeconds:n,reducedMotion:p,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),T&&t.jsx(Yr,{time:h,format:s,showSeconds:n,showDate:i,label:d,size:M,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:$}),z&&l&&t.jsx("div",{style:{marginTop:M*.04,padding:`${M*.03}px ${M*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(Yr,{time:z,format:s,showSeconds:!1,showDate:!1,label:l,size:M*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:$})})]})}On.displayName="TkxClock";function Zt(e){if(!isFinite(e)||isNaN(e))return"0:00";const r=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${n}:${String(i).padStart(2,"0")}`}function Le({path:e,size:r=20,color:n="currentColor",title:i}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:n,"aria-hidden":i?void 0:"true",role:i?"img":void 0,"aria-label":i,style:{display:"block",flexShrink:0},children:t.jsx("path",{d:e})})}const Ie={play:"M8 5v14l11-7z",pause:"M6 19h4V5H6v14zm8-14v14h4V5h-4z",volumeUp:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",volumeMute:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",volumeDown:"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z",fullscreen:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fullscreenExit:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",pip:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",download:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",closedCaption:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",replay10:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",forward10:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",errorOutline:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",refresh:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"};function Ze({onClick:e,title:r,children:n,active:i,primary:s}){const[a,l]=c.useState(!1);return t.jsx("button",{type:"button",onClick:e,title:r,"aria-label":r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:i||a?s:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Yn({src:e,poster:r,title:n,width:i="100%",height:s,autoPlay:a=!1,loop:l=!1,muted:d=!1,controls:u=!0,showTitle:x=!0,allowFullscreen:o=!0,allowPiP:m=!0,allowDownload:p=!1,chapters:h=[],subtitles:y=[],startTime:z,onPlay:v,onPause:$,onEnded:w,onTimeUpdate:C,className:I,style:R}){const M=ee(),N=ye(),T=c.useRef(null),j=c.useRef(null),k=c.useRef(null),Y=c.useRef(null),[f,g]=c.useState(!1),[S,F]=c.useState(0),[D,V]=c.useState(0),[E,P]=c.useState(0),[W,O]=c.useState(1),[A,H]=c.useState(d),[Q,G]=c.useState(!1),[ne,pe]=c.useState(!0),[xe,oe]=c.useState(!1),[me,X]=c.useState(1),[Z,ve]=c.useState(!1),[we,de]=c.useState(-1),[ge,J]=c.useState(null),[ie,re]=c.useState(0),[q,te]=c.useState(null),[be,$e]=c.useState(!1),[Me,Te]=c.useState(!1),[Ke,Ee]=c.useState(null),[U,le]=c.useState(!1);c.useEffect(()=>{const L=T.current;if(!L)return;z!==void 0&&(L.currentTime=z);const fe=()=>{F(L.currentTime),L.buffered.length>0&&P(L.buffered.end(L.buffered.length-1))},ke=()=>V(L.duration),Ce=()=>g(!0),qe=()=>{g(!1),oe(!0)},Ye=()=>{g(!1),oe(!0),w==null||w()},lt=()=>$e(!0),ct=()=>$e(!1),dt=()=>Te(!0),jt=()=>Te(!1),St=()=>{const Fe=L.error;Ee(Fe?`Error ${Fe.code}: ${Fe.message||"Failed to load video"}`:"Failed to load video"),Te(!1)};return L.addEventListener("timeupdate",fe),L.addEventListener("durationchange",ke),L.addEventListener("play",Ce),L.addEventListener("pause",qe),L.addEventListener("ended",Ye),L.addEventListener("enterpictureinpicture",lt),L.addEventListener("leavepictureinpicture",ct),L.addEventListener("waiting",dt),L.addEventListener("canplay",jt),L.addEventListener("error",St),()=>{L.removeEventListener("timeupdate",fe),L.removeEventListener("durationchange",ke),L.removeEventListener("play",Ce),L.removeEventListener("pause",qe),L.removeEventListener("ended",Ye),L.removeEventListener("enterpictureinpicture",lt),L.removeEventListener("leavepictureinpicture",ct),L.removeEventListener("waiting",dt),L.removeEventListener("canplay",jt),L.removeEventListener("error",St)}},[w,z]),c.useEffect(()=>{T.current&&(f?v==null||v():$==null||$())},[f,v,$]),c.useEffect(()=>{C==null||C(S,D)},[S,D,C]),c.useEffect(()=>{const L=T.current;if(!L)return;const fe=L.textTracks;for(let ke=0;ke<fe.length;ke++)fe[ke].mode=ke===we?"showing":"disabled"},[we]),c.useEffect(()=>{const L=()=>G(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",L),()=>document.removeEventListener("fullscreenchange",L)},[]),c.useEffect(()=>{const L=j.current;if(!L)return;const fe=ke=>{const Ce=T.current;if(Ce&&ke.target.tagName!=="INPUT")switch(ke.key){case" ":case"k":ke.preventDefault(),Se();break;case"f":case"F":o&&De();break;case"m":case"M":Ae();break;case"ArrowRight":ke.preventDefault(),Ce.currentTime=Math.min(Ce.currentTime+10,Ce.duration);break;case"ArrowLeft":ke.preventDefault(),Ce.currentTime=Math.max(Ce.currentTime-10,0);break;case"ArrowUp":ke.preventDefault(),O(Math.min(W+.1,1)),T.current&&(T.current.volume=Math.min(W+.1,1));break;case"ArrowDown":ke.preventDefault(),O(Math.max(W-.1,0)),T.current&&(T.current.volume=Math.max(W-.1,0));break}};return L.addEventListener("keydown",fe),()=>L.removeEventListener("keydown",fe)},[W,o]);const se=c.useCallback(()=>{pe(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{f&&pe(!1)},3e3)},[f]);c.useEffect(()=>(se(),()=>{Y.current&&clearTimeout(Y.current)}),[f,se]);const Se=c.useCallback(()=>{const L=T.current;L&&(L.paused?(L.play().catch(()=>{}),te("play"),oe(!1)):(L.pause(),te("pause")),setTimeout(()=>te(null),600))},[]),Ae=c.useCallback(()=>{const L=T.current;if(!L)return;const fe=!A;H(fe),L.muted=fe},[A]),De=c.useCallback(()=>{const L=j.current;L&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):L.requestFullscreen().catch(()=>{}))},[]),at=c.useCallback(async()=>{const L=T.current;if(L)try{document.pictureInPictureElement?await document.exitPictureInPicture():await L.requestPictureInPicture()}catch{}},[]),rt=c.useCallback(()=>{y.length!==0&&(de(L=>(L+1)%(y.length+1)-1),de(L=>{const fe=L+1;return fe>=y.length?-1:fe}))},[y.length]),ht=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.min(L.currentTime+10,L.duration||0))},[]),mt=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.max(L.currentTime-10,0))},[]),gt=c.useCallback(()=>{const L=T.current;L&&(Ee(null),L.load())},[]),Oe=c.useCallback(()=>{o&&De()},[o,De]),Xe=c.useCallback(L=>{const fe=T.current,ke=k.current;if(!fe||!ke||!D)return;const Ce=ke.getBoundingClientRect(),qe=Math.max(0,Math.min(1,(L.clientX-Ce.left)/Ce.width));fe.currentTime=qe*D},[D]),nt=c.useCallback(L=>{const fe=k.current;if(!fe||!D)return;const ke=fe.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(L.clientX-ke.left)/ke.width));J(Ce*D),re(L.clientX-ke.left)},[D]),Pt=c.useCallback(L=>{const fe=parseFloat(L.target.value);O(fe),T.current&&(T.current.volume=fe,T.current.muted=fe===0,H(fe===0))},[]),Bt=c.useCallback(L=>{X(L),T.current&&(T.current.playbackRate=L),ve(!1)},[]),bt=h.length>0?[...h].reverse().find(L=>S>=L.time):null,yt=L=>[...h].reverse().find(fe=>L>=fe.time)??null,Wt=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Ht=Array.isArray(e)?e[0].src:e,vt=ne||xe||!f,kt=N?"none":"opacity 0.25s ease",Vt=A||W===0?Ie.volumeMute:W<.5?Ie.volumeDown:Ie.volumeUp,wt=D>0?S/D*100:0,Ot=D>0?E/D*100:0;return t.jsxs("div",{ref:j,className:I,tabIndex:0,onMouseMove:se,onMouseLeave:()=>{f&&pe(!1)},style:{position:"relative",width:i,height:s??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...R},children:[t.jsxs("video",{ref:T,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:a,loop:l,muted:d,playsInline:!0,onClick:Se,onDoubleClick:Oe,children:[Wt.map((L,fe)=>t.jsx("source",{src:L.src,type:L.type},fe)),y.map((L,fe)=>t.jsx("track",{kind:"subtitles",label:B(L.label),srcLang:L.lang,src:L.src,default:L.default},fe))]}),x&&n&&t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:vt?1:0,transition:kt,pointerEvents:"none"},children:[t.jsx("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:B(n)}),bt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",B(bt.label)]})]}),q&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:N?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:t.jsx(Le,{path:q==="play"?Ie.play:Ie.pause,size:32,color:"#fff"})}),Me&&!Ke&&t.jsx("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:t.jsx("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:M.primary,borderRadius:"50%",animation:N?"none":"tkxvp-spin 0.8s linear infinite"}})}),Ke&&t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[t.jsx(Le,{path:Ie.errorOutline,size:48,color:"#ef4444"}),t.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:Ke}),t.jsxs("button",{type:"button",onClick:gt,style:{display:"flex",alignItems:"center",gap:6,background:M.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(Le,{path:Ie.refresh,size:18,color:"#fff"}),"Retry"]})]}),u&&t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:vt?1:0,transition:kt},onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),children:[t.jsxs("div",{ref:k,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(D),"aria-valuenow":Math.floor(S),tabIndex:0,onClick:Xe,onMouseMove:nt,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:L=>{L.currentTarget.style.height="8px"},onMouseLeave:L=>{L.currentTarget.style.height="4px",J(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ot}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${wt}%`,background:M.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${wt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:M.primary,pointerEvents:"none"}}),h.map((L,fe)=>{const ke=D>0?L.time/D*100:0;return t.jsx("div",{title:B(L.label),style:{position:"absolute",top:"50%",left:`${ke}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${M.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},fe)}),ge!==null&&t.jsxs("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[Zt(ge),yt(ge)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:B(yt(ge).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(Ze,{onClick:Se,title:f?"Pause":"Play",primary:M.primary,children:t.jsx(Le,{path:f?Ie.pause:Ie.play,size:22})}),t.jsx(Ze,{onClick:mt,title:"Skip back 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{path:Ie.replay10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsx(Ze,{onClick:ht,title:"Skip forward 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{path:Ie.forward10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>le(!0),onMouseLeave:()=>le(!1),children:[t.jsx(Ze,{onClick:Ae,title:A?"Unmute":"Mute",primary:M.primary,children:t.jsx(Le,{path:Vt,size:20})}),t.jsx("div",{style:{overflow:"hidden",width:U?64:0,opacity:U?1:0,transition:N?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:t.jsx("input",{type:"range",min:0,max:1,step:.05,value:A?0:W,onChange:Pt,"aria-label":"Volume",style:{width:64,accentColor:M.primary,cursor:"pointer",height:4}})})]}),t.jsxs("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Zt(S)," / ",Zt(D)]}),t.jsx("div",{style:{flex:1}}),y.length>0&&t.jsx(Ze,{onClick:rt,title:"Subtitles",primary:M.primary,active:we>=0,children:t.jsx(Le,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>ve(L=>!L),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[me,"×"]}),me!==1&&t.jsxs("span",{style:{position:"absolute",top:0,right:0,background:M.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[me,"x"]}),Z&&t.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${M.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(L=>t.jsxs("button",{type:"button",onClick:()=>Bt(L),style:{display:"block",width:"100%",padding:"6px 14px",background:L===me?M.primary+"30":"none",border:"none",color:L===me?M.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[L,"×"]},L))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(Ze,{onClick:at,title:"Picture-in-Picture",primary:M.primary,active:be,children:t.jsx(Le,{path:Ie.pip,size:20})}),p&&t.jsx("a",{href:Ht,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(Le,{path:Ie.download,size:20})}),o&&t.jsx(Ze,{onClick:De,title:Q?"Exit fullscreen":"Fullscreen",primary:M.primary,children:t.jsx(Le,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
|
|
56
|
+
`;function Bi(e,r){return{position:"absolute",top:r.top,left:r.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:r.transformOrigin,overflow:"hidden"}}function Wi({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Hi({color:e}){return t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"5",fill:e}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function Vi({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M9 18l6-6-6-6"})})}function Oi(e){const r=[];let n=0;for(const i of e)if(i.type!=="separator")if(i.type==="radio-group")for(let s=0;s<i.options.length;s++)r.push({kind:"radio",item:i,optionIdx:s,idx:n++});else i.type==="check"?r.push({kind:"check",item:i,idx:n++}):i.type==="submenu"?r.push({kind:"submenu",item:i,idx:n++}):r.push({kind:"action",item:i,idx:n++});return r}function Vn({items:e,pos:r,panelId:n,onClose:i,onCloseAll:s,isSubmenu:a=!1}){const l=ee(),[d,u]=c.useState(-1),[p,o]=c.useState(null),[m,x]=c.useState(null),h=c.useRef(null),[y,z]=c.useState(""),v=c.useRef(null),$=Oi(e);c.useEffect(()=>{var T;(T=h.current)==null||T.focus()},[]),c.useEffect(()=>{var j;if(d<0)return;const T=(j=h.current)==null?void 0:j.querySelector(`[data-midx="${d}"]`);T==null||T.scrollIntoView({block:"nearest"})},[d]);const w=c.useCallback(T=>{var j,k,Y,f,g,S;if(T.kind==="action"){if(T.item.disabled)return;(k=(j=T.item).onClick)==null||k.call(j),s()}else if(T.kind==="check"){if(T.item.disabled)return;(f=(Y=T.item).onChange)==null||f.call(Y,!T.item.checked)}else if(T.kind==="radio"){if(T.item.disabled)return;(S=(g=T.item).onChange)==null||S.call(g,T.item.options[T.optionIdx].value)}else if(T.kind==="submenu"){if(T.item.disabled)return;o(T.item.id)}},[s]),C=T=>{var j;switch(T.key){case"ArrowDown":T.preventDefault(),u(k=>{const Y=k+1;return Y<$.length?Y:0});break;case"ArrowUp":T.preventDefault(),u(k=>{const Y=k-1;return Y>=0?Y:$.length-1});break;case"Home":T.preventDefault(),u(0);break;case"End":T.preventDefault(),u($.length-1);break;case"Enter":case" ":T.preventDefault(),d>=0&&$[d]&&w($[d]);break;case"Escape":T.preventDefault(),a?i():s();break;case"Tab":T.preventDefault(),s();break;case"ArrowRight":T.preventDefault(),d>=0&&((j=$[d])==null?void 0:j.kind)==="submenu"&&o($[d].item.id);break;case"ArrowLeft":T.preventDefault(),a&&i();break;default:T.key.length===1&&!T.ctrlKey&&!T.metaKey&&I(T.key)}};function I(T){v.current&&clearTimeout(v.current);const j=y+T.toLowerCase();z(j);const k=$.findIndex(Y=>(Y.kind==="radio"?Y.item.options[Y.optionIdx].label:Y.item.label).toLowerCase().startsWith(j));k>=0&&u(k),v.current=setTimeout(()=>z(""),800)}function R(T,j){const k=j.getBoundingClientRect();o(T.id);const Y=Math.min(T.items.length*38+12,360);x(Fi(k,220,Y))}function M(){o(null),x(null)}const N=()=>{let T=-1;return e.map(j=>{if(j.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(j.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:j.label?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginLeft:14}}),t.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:B(j.label)}),t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginRight:14}})]}):t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,margin:"0 10px"}})},j.id);if(j.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":j.label,children:[j.label&&t.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:B(j.label)}),j.options.map((D,V)=>{T++;const E=T,P=E===d,W=D.value===j.value,O=!!j.disabled,A=Tt(l,P,!1,O);return t.jsxs("div",{role:"menuitemradio","aria-checked":W,"aria-disabled":O||void 0,"data-midx":E,tabIndex:-1,style:A,onClick:()=>{var H;return!O&&((H=j.onChange)==null?void 0:H.call(j,D.value))},onMouseEnter:()=>!O&&u(E),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:W?t.jsx(Hi,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${l.border}`,display:"inline-block"}})}),D.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:D.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(D.label)})]},D.value)})]},j.id);if(j.type==="check"){T++;const D=T,V=D===d,E=!!j.disabled,P=Tt(l,V,!1,E);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":j.checked,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:P,onClick:()=>{var W;return!E&&((W=j.onChange)==null?void 0:W.call(j,!j.checked))},onMouseEnter:()=>!E&&u(D),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.checked?t.jsx(Wi,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),j.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:j.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)})]},j.id)}if(j.type==="submenu"){T++;const D=T,V=D===d,E=!!j.disabled,P=p===j.id,W=Tt(l,V||P,!1,E);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":P,"aria-disabled":E||void 0,"data-midx":D,tabIndex:-1,style:W,onMouseEnter:O=>{E||(u(D),R(j,O.currentTarget))},onMouseLeave:()=>{},onClick:()=>{E||o(P?null:j.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:j.icon?t.jsx("span",{style:{display:"flex",color:l.textMuted},children:j.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(j.label)}),t.jsx(Vi,{color:l.textMuted})]}),P&&m&&Be.createPortal(t.jsx(Vn,{items:j.items,pos:m,panelId:`${n}-sub-${j.id}`,onClose:M,onCloseAll:s,isSubmenu:!0}),document.body)]},j.id)}const k=j;T++;const Y=T,f=Y===d,g=!!k.disabled,S=!!k.danger,F=Tt(l,f,S,g);return t.jsxs("div",{role:"menuitem","aria-disabled":g||void 0,"data-midx":Y,tabIndex:-1,style:F,onClick:()=>{var D;g||((D=k.onClick)==null||D.call(k),s())},onMouseEnter:()=>{g||(u(Y),M())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:k.icon?t.jsx("span",{style:{display:"flex",color:S?l.danger:l.textMuted},children:k.icon}):t.jsx("span",{style:{width:14}})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(k.label)}),k.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:l.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:B(k.description)})]}),k.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:l.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:B(k.shortcut)})]},k.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:Pi}),t.jsx("div",{ref:h,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:C,style:{...Bi(l,r),maxHeight:400,overflowY:"auto"},children:N()})]})}function Tt(e,r,n,i){const s=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:i?"not-allowed":"pointer",userSelect:"none",color:i?e.textMuted:r&&n?e.danger:s,backgroundColor:r?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:i?.5:1,outline:"none"}}function On({trigger:e,items:r,placement:n="bottom-start",isDisabled:i=!1,onOpen:s,onClose:a,className:l,style:d}){const p=`tkx-menu-${c.useId().replace(/:/g,"")}`,[o,m]=c.useState(!1),[x,h]=c.useState(null),y=c.useRef(null),z=c.useCallback(()=>{if(i)return;const w=y.current;if(!w)return;const C=w.getBoundingClientRect(),I=Math.min(r.length*38+12,360);h(Yr(C,n,220,I)),m(!0),s==null||s()},[i,r.length,s,n]),v=c.useCallback(()=>{var w,C,I;m(!1),a==null||a(),(I=(C=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:C.focus)==null||I.call(C)},[a]);c.useEffect(()=>{if(!o)return;const w=C=>{var M;const I=C.target;if((M=y.current)!=null&&M.contains(I))return;const R=document.querySelectorAll(".tkx-menu-panel");for(const N of R)if(N.contains(I))return;v()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[o,v]),c.useEffect(()=>{if(!o)return;const w=()=>{const C=y.current;if(!C)return;const I=C.getBoundingClientRect(),R=Math.min(r.length*38+12,360);h(Yr(I,n,220,R))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[o,r.length,n]);const $=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),o||z()),w.key==="Escape"&&o&&(w.preventDefault(),v())};return t.jsxs("span",{ref:y,className:l,style:{display:"inline-flex",...d},children:[t.jsx("span",{role:"button",tabIndex:i?-1:0,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?p:void 0,"aria-disabled":i||void 0,onClick:()=>o?v():z(),onKeyDown:$,style:{display:"inline-flex",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none"},children:e}),o&&x&&Be.createPortal(t.jsx(Vn,{items:r,pos:x,panelId:p,onClose:v,onCloseAll:v}),document.body)]})}On.displayName="TkxMenu";const Yi={sm:120,md:180,lg:240,xl:320};function It(e){const r=new Date;if(e)try{const l=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(r),d=v=>{var $;return(($=l.find(w=>w.type===v))==null?void 0:$.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const p=parseInt(d("minute"),10),o=parseInt(d("second"),10),m=d("weekday"),x=d("month"),h=d("day"),y=d("year"),z=`${m}, ${x} ${h}, ${y}`;return{hours:u,minutes:p,seconds:o,milliseconds:r.getMilliseconds(),dateString:z}}catch{}const n=r.getHours(),i=r.getMinutes(),s=r.getSeconds(),a=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:i,seconds:s,milliseconds:r.getMilliseconds(),dateString:a}}function _i({time:e,size:r,analogStyle:n,showSeconds:i,reducedMotion:s,primary:a,danger:l,text:d,textMuted:u,border:p,surface:o,bg:m}){const x=r/2,h=r/2,y=r/2-4,{hours:z,minutes:v,seconds:$,milliseconds:w}=e,I=($+(s?0:w)/1e3)/60*360,R=v/60*360+$/60*6,M=z%12/12*360+v/60*30,N=(S,F)=>{const D=(S-90)*Math.PI/180;return{x:x+Math.cos(D)*F,y:h+Math.sin(D)*F}},T=s?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const S=(O,A)=>{const Q=-90+O*360,G={x:x+Math.cos(-90*Math.PI/180)*A,y:h+Math.sin(-90*Math.PI/180)*A},ne={x:x+Math.cos(Q*Math.PI/180)*A,y:h+Math.sin(Q*Math.PI/180)*A},pe=O>.5?1:0;return`M ${G.x} ${G.y} A ${A} ${A} 0 ${pe} 1 ${ne.x} ${ne.y}`},F=z%12/12+v/60/12,D=v/60+$/3600,V=($+(s?0:w/1e3))/60,E=y-2,P=y-10,W=y-18;return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:x,cy:h,r:E,fill:"none",stroke:p,strokeWidth:4}),t.jsx("circle",{cx:x,cy:h,r:P,fill:"none",stroke:p,strokeWidth:4}),i&&t.jsx("circle",{cx:x,cy:h,r:W,fill:"none",stroke:p,strokeWidth:3}),t.jsx("path",{d:S(F,E),fill:"none",stroke:a,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:S(D,P),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),i&&t.jsx("path",{d:S(V,W),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),t.jsx("circle",{cx:x,cy:h,r:4,fill:a}),t.jsxs("text",{x,y:h+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(z).padStart(2,"0"),":",String(v).padStart(2,"0")]})]})}const j=N(M,y*.5),k=N(R,y*.75),Y=N(I,y*.85),f=N(I+180,y*.2),g=[];if(n==="classic"){for(let F=0;F<60;F++){const D=F/60*360,V=F%5===0,E=(D-90)*Math.PI/180,P=V?y-10:y-6,W=x+Math.cos(E)*y,O=h+Math.sin(E)*y,A=x+Math.cos(E)*P,H=h+Math.sin(E)*P;g.push(t.jsx("line",{x1:W,y1:O,x2:A,y2:H,stroke:V?d:u,strokeWidth:V?2:1,strokeLinecap:"round"},F))}const S=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:F,angle:D}of S){const V=(D-90)*Math.PI/180,E=y-20;g.push(t.jsx("text",{x:x+Math.cos(V)*E,y:h+Math.sin(V)*E,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:F},`n${F}`))}}else for(let S=0;S<12;S++){const D=(S/12*360-90)*Math.PI/180,V=y-8;g.push(t.jsx("circle",{cx:x+Math.cos(D)*V,cy:h+Math.sin(D)*V,r:S%3===0?3:2,fill:S%3===0?d:u},S))}return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",style:{display:"block"},children:[t.jsx("circle",{cx:x,cy:h,r:y,fill:o,stroke:p,strokeWidth:2}),g,t.jsx("line",{x1:x,y1:h,x2:j.x,y2:j.y,stroke:a,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${x}px ${h}px`,transition:T}}),t.jsx("line",{x1:x,y1:h,x2:k.x,y2:k.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${x}px ${h}px`,transition:T}}),i&&t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:f.x,y1:f.y,x2:Y.x,y2:Y.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${x}px ${h}px`,transition:"none"}}),t.jsx("circle",{cx:x,cy:h,r:3,fill:l})]}),t.jsx("circle",{cx:x,cy:h,r:n==="minimal"?3:5,fill:a})]})}function _r({time:e,format:r,showSeconds:n,showDate:i,label:s,size:a,primary:l,text:d,textMuted:u,colonVisible:p}){const{hours:o,minutes:m,seconds:x,dateString:h}=e;let y=o,z="";r==="12h"&&(z=o>=12?"PM":"AM",y=o%12||12);const v=a*.2,$={opacity:p?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return t.jsxs("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[t.jsxs("div",{style:{fontSize:v,color:l,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[t.jsx("span",{children:String(y).padStart(2,"0")}),t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:$,children:":"}),t.jsx("span",{children:String(x).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:v*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:v*.05},children:z})]}),i&&t.jsx("div",{style:{fontSize:a*.072,color:u,marginTop:a*.025,letterSpacing:"0.03em"},children:h}),s&&t.jsx("div",{style:{fontSize:a*.065,color:u,marginTop:a*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:B(s)})]})}function Yn({variant:e="both",size:r="md",showSeconds:n=!0,showDate:i=!1,format:s="24h",timezone:a,timezone2:l,label:d,analogStyle:u="classic",className:p,style:o}){const m=ee(),x=ye(),[h,y]=c.useState(()=>It(a)),[z,v]=c.useState(()=>l?It(l):null),[$,w]=c.useState(!0),[C,I]=c.useState(!1),R=c.useRef(null);c.useEffect(()=>{I(!0)},[]),c.useEffect(()=>{const k=()=>{y(It(a)),l&&v(It(l))};k();const Y=setInterval(k,1e3);return()=>clearInterval(Y)},[a,l]),c.useEffect(()=>(R.current=setInterval(()=>{w(k=>!k)},500),()=>{R.current&&clearInterval(R.current)}),[]);const M=Yi[r],N=e==="analog"||e==="both",T=e==="digital"||e==="both",j={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${M*.06}px`:0,opacity:C?1:0,transition:x?"none":"opacity 0.4s ease",...o};return t.jsxs("div",{className:p,style:j,role:"timer","aria-live":"off",children:[N&&t.jsx(_i,{time:h,size:M,analogStyle:u,showSeconds:n,reducedMotion:x,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),T&&t.jsx(_r,{time:h,format:s,showSeconds:n,showDate:i,label:d,size:M,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:$}),z&&l&&t.jsx("div",{style:{marginTop:M*.04,padding:`${M*.03}px ${M*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(_r,{time:z,format:s,showSeconds:!1,showDate:!1,label:l,size:M*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:$})})]})}Yn.displayName="TkxClock";function Gt(e){if(!isFinite(e)||isNaN(e))return"0:00";const r=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${n}:${String(i).padStart(2,"0")}`}function Le({path:e,size:r=20,color:n="currentColor",title:i}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:n,"aria-hidden":i?void 0:"true",role:i?"img":void 0,"aria-label":i,style:{display:"block",flexShrink:0},children:t.jsx("path",{d:e})})}const Ie={play:"M8 5v14l11-7z",pause:"M6 19h4V5H6v14zm8-14v14h4V5h-4z",volumeUp:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",volumeMute:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",volumeDown:"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z",fullscreen:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fullscreenExit:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",pip:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",download:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",closedCaption:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",replay10:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",forward10:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",errorOutline:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",refresh:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"};function Ge({onClick:e,title:r,children:n,active:i,primary:s}){const[a,l]=c.useState(!1);return t.jsx("button",{type:"button",onClick:e,title:r,"aria-label":r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:i||a?s:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function _n({src:e,poster:r,title:n,width:i="100%",height:s,autoPlay:a=!1,loop:l=!1,muted:d=!1,controls:u=!0,showTitle:p=!0,allowFullscreen:o=!0,allowPiP:m=!0,allowDownload:x=!1,chapters:h=[],subtitles:y=[],startTime:z,onPlay:v,onPause:$,onEnded:w,onTimeUpdate:C,className:I,style:R}){const M=ee(),N=ye(),T=c.useRef(null),j=c.useRef(null),k=c.useRef(null),Y=c.useRef(null),[f,g]=c.useState(!1),[S,F]=c.useState(0),[D,V]=c.useState(0),[E,P]=c.useState(0),[W,O]=c.useState(1),[A,H]=c.useState(d),[Q,G]=c.useState(!1),[ne,pe]=c.useState(!0),[xe,oe]=c.useState(!1),[me,X]=c.useState(1),[Z,ve]=c.useState(!1),[we,de]=c.useState(-1),[ge,J]=c.useState(null),[ie,re]=c.useState(0),[q,te]=c.useState(null),[be,$e]=c.useState(!1),[Me,Te]=c.useState(!1),[Xe,Ee]=c.useState(null),[U,le]=c.useState(!1);c.useEffect(()=>{const L=T.current;if(!L)return;z!==void 0&&(L.currentTime=z);const fe=()=>{F(L.currentTime),L.buffered.length>0&&P(L.buffered.end(L.buffered.length-1))},ke=()=>V(L.duration),Ce=()=>g(!0),Ze=()=>{g(!1),oe(!0)},_e=()=>{g(!1),oe(!0),w==null||w()},ct=()=>$e(!0),dt=()=>$e(!1),ut=()=>Te(!0),St=()=>Te(!1),$t=()=>{const Fe=L.error;Ee(Fe?`Error ${Fe.code}: ${Fe.message||"Failed to load video"}`:"Failed to load video"),Te(!1)};return L.addEventListener("timeupdate",fe),L.addEventListener("durationchange",ke),L.addEventListener("play",Ce),L.addEventListener("pause",Ze),L.addEventListener("ended",_e),L.addEventListener("enterpictureinpicture",ct),L.addEventListener("leavepictureinpicture",dt),L.addEventListener("waiting",ut),L.addEventListener("canplay",St),L.addEventListener("error",$t),()=>{L.removeEventListener("timeupdate",fe),L.removeEventListener("durationchange",ke),L.removeEventListener("play",Ce),L.removeEventListener("pause",Ze),L.removeEventListener("ended",_e),L.removeEventListener("enterpictureinpicture",ct),L.removeEventListener("leavepictureinpicture",dt),L.removeEventListener("waiting",ut),L.removeEventListener("canplay",St),L.removeEventListener("error",$t)}},[w,z]),c.useEffect(()=>{T.current&&(f?v==null||v():$==null||$())},[f,v,$]),c.useEffect(()=>{C==null||C(S,D)},[S,D,C]),c.useEffect(()=>{const L=T.current;if(!L)return;const fe=L.textTracks;for(let ke=0;ke<fe.length;ke++)fe[ke].mode=ke===we?"showing":"disabled"},[we]),c.useEffect(()=>{const L=()=>G(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",L),()=>document.removeEventListener("fullscreenchange",L)},[]),c.useEffect(()=>{const L=j.current;if(!L)return;const fe=ke=>{const Ce=T.current;if(Ce&&ke.target.tagName!=="INPUT")switch(ke.key){case" ":case"k":ke.preventDefault(),Se();break;case"f":case"F":o&&De();break;case"m":case"M":Ae();break;case"ArrowRight":ke.preventDefault(),Ce.currentTime=Math.min(Ce.currentTime+10,Ce.duration);break;case"ArrowLeft":ke.preventDefault(),Ce.currentTime=Math.max(Ce.currentTime-10,0);break;case"ArrowUp":ke.preventDefault(),O(Math.min(W+.1,1)),T.current&&(T.current.volume=Math.min(W+.1,1));break;case"ArrowDown":ke.preventDefault(),O(Math.max(W-.1,0)),T.current&&(T.current.volume=Math.max(W-.1,0));break}};return L.addEventListener("keydown",fe),()=>L.removeEventListener("keydown",fe)},[W,o]);const se=c.useCallback(()=>{pe(!0),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{f&&pe(!1)},3e3)},[f]);c.useEffect(()=>(se(),()=>{Y.current&&clearTimeout(Y.current)}),[f,se]);const Se=c.useCallback(()=>{const L=T.current;L&&(L.paused?(L.play().catch(()=>{}),te("play"),oe(!1)):(L.pause(),te("pause")),setTimeout(()=>te(null),600))},[]),Ae=c.useCallback(()=>{const L=T.current;if(!L)return;const fe=!A;H(fe),L.muted=fe},[A]),De=c.useCallback(()=>{const L=j.current;L&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):L.requestFullscreen().catch(()=>{}))},[]),lt=c.useCallback(async()=>{const L=T.current;if(L)try{document.pictureInPictureElement?await document.exitPictureInPicture():await L.requestPictureInPicture()}catch{}},[]),nt=c.useCallback(()=>{y.length!==0&&(de(L=>(L+1)%(y.length+1)-1),de(L=>{const fe=L+1;return fe>=y.length?-1:fe}))},[y.length]),mt=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.min(L.currentTime+10,L.duration||0))},[]),gt=c.useCallback(()=>{const L=T.current;L&&(L.currentTime=Math.max(L.currentTime-10,0))},[]),bt=c.useCallback(()=>{const L=T.current;L&&(Ee(null),L.load())},[]),Ye=c.useCallback(()=>{o&&De()},[o,De]),qe=c.useCallback(L=>{const fe=T.current,ke=k.current;if(!fe||!ke||!D)return;const Ce=ke.getBoundingClientRect(),Ze=Math.max(0,Math.min(1,(L.clientX-Ce.left)/Ce.width));fe.currentTime=Ze*D},[D]),ot=c.useCallback(L=>{const fe=k.current;if(!fe||!D)return;const ke=fe.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(L.clientX-ke.left)/ke.width));J(Ce*D),re(L.clientX-ke.left)},[D]),Bt=c.useCallback(L=>{const fe=parseFloat(L.target.value);O(fe),T.current&&(T.current.volume=fe,T.current.muted=fe===0,H(fe===0))},[]),Wt=c.useCallback(L=>{X(L),T.current&&(T.current.playbackRate=L),ve(!1)},[]),yt=h.length>0?[...h].reverse().find(L=>S>=L.time):null,vt=L=>[...h].reverse().find(fe=>L>=fe.time)??null,Ht=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Vt=Array.isArray(e)?e[0].src:e,kt=ne||xe||!f,wt=N?"none":"opacity 0.25s ease",Ot=A||W===0?Ie.volumeMute:W<.5?Ie.volumeDown:Ie.volumeUp,jt=D>0?S/D*100:0,Yt=D>0?E/D*100:0;return t.jsxs("div",{ref:j,className:I,tabIndex:0,onMouseMove:se,onMouseLeave:()=>{f&&pe(!1)},style:{position:"relative",width:i,height:s??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...R},children:[t.jsxs("video",{ref:T,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:a,loop:l,muted:d,playsInline:!0,onClick:Se,onDoubleClick:Ye,children:[Ht.map((L,fe)=>t.jsx("source",{src:L.src,type:L.type},fe)),y.map((L,fe)=>t.jsx("track",{kind:"subtitles",label:B(L.label),srcLang:L.lang,src:L.src,default:L.default},fe))]}),p&&n&&t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:kt?1:0,transition:wt,pointerEvents:"none"},children:[t.jsx("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:B(n)}),yt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",B(yt.label)]})]}),q&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:N?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:t.jsx(Le,{path:q==="play"?Ie.play:Ie.pause,size:32,color:"#fff"})}),Me&&!Xe&&t.jsx("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:t.jsx("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:M.primary,borderRadius:"50%",animation:N?"none":"tkxvp-spin 0.8s linear infinite"}})}),Xe&&t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[t.jsx(Le,{path:Ie.errorOutline,size:48,color:"#ef4444"}),t.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:Xe}),t.jsxs("button",{type:"button",onClick:bt,style:{display:"flex",alignItems:"center",gap:6,background:M.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(Le,{path:Ie.refresh,size:18,color:"#fff"}),"Retry"]})]}),u&&t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:kt?1:0,transition:wt},onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),children:[t.jsxs("div",{ref:k,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(D),"aria-valuenow":Math.floor(S),tabIndex:0,onClick:qe,onMouseMove:ot,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:L=>{L.currentTarget.style.height="8px"},onMouseLeave:L=>{L.currentTarget.style.height="4px",J(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Yt}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${jt}%`,background:M.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${jt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:M.primary,pointerEvents:"none"}}),h.map((L,fe)=>{const ke=D>0?L.time/D*100:0;return t.jsx("div",{title:B(L.label),style:{position:"absolute",top:"50%",left:`${ke}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${M.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},fe)}),ge!==null&&t.jsxs("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[Gt(ge),vt(ge)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:B(vt(ge).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(Ge,{onClick:Se,title:f?"Pause":"Play",primary:M.primary,children:t.jsx(Le,{path:f?Ie.pause:Ie.play,size:22})}),t.jsx(Ge,{onClick:gt,title:"Skip back 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{path:Ie.replay10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsx(Ge,{onClick:mt,title:"Skip forward 10 seconds",primary:M.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Le,{path:Ie.forward10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>le(!0),onMouseLeave:()=>le(!1),children:[t.jsx(Ge,{onClick:Ae,title:A?"Unmute":"Mute",primary:M.primary,children:t.jsx(Le,{path:Ot,size:20})}),t.jsx("div",{style:{overflow:"hidden",width:U?64:0,opacity:U?1:0,transition:N?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:t.jsx("input",{type:"range",min:0,max:1,step:.05,value:A?0:W,onChange:Bt,"aria-label":"Volume",style:{width:64,accentColor:M.primary,cursor:"pointer",height:4}})})]}),t.jsxs("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Gt(S)," / ",Gt(D)]}),t.jsx("div",{style:{flex:1}}),y.length>0&&t.jsx(Ge,{onClick:nt,title:"Subtitles",primary:M.primary,active:we>=0,children:t.jsx(Le,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>ve(L=>!L),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[me,"×"]}),me!==1&&t.jsxs("span",{style:{position:"absolute",top:0,right:0,background:M.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[me,"x"]}),Z&&t.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${M.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(L=>t.jsxs("button",{type:"button",onClick:()=>Wt(L),style:{display:"block",width:"100%",padding:"6px 14px",background:L===me?M.primary+"30":"none",border:"none",color:L===me?M.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[L,"×"]},L))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(Ge,{onClick:lt,title:"Picture-in-Picture",primary:M.primary,active:be,children:t.jsx(Le,{path:Ie.pip,size:20})}),x&&t.jsx("a",{href:Vt,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(Le,{path:Ie.download,size:20})}),o&&t.jsx(Ge,{onClick:De,title:Q?"Exit fullscreen":"Fullscreen",primary:M.primary,children:t.jsx(Le,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
|
|
57
57
|
@keyframes tkxvp-flash {
|
|
58
58
|
0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
|
|
59
59
|
100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
0% { transform: rotate(0deg); }
|
|
63
63
|
100% { transform: rotate(360deg); }
|
|
64
64
|
}
|
|
65
|
-
`})]})}
|
|
65
|
+
`})]})}_n.displayName="TkxVideoPlayer";const Ui={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Ki({size:e}){const r=e*.55;return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Xi({size:e}){const r=e*.55;return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function qi({status:e,index:r,showStepNumbers:n,icon:i,circleSize:s,fontSize:a,primary:l,danger:d,success:u,text:p,textMuted:o,border:m,surface:x,variant:h,reducedMotion:y,clickable:z}){const v=e==="completed",$=e==="active",w=e==="error",C=e==="pending";let I=x,R=m,M=o,N=2;v?(I=h==="filled"?u:x,R=u,M=h==="filled"?"#fff":u):$?(I=h==="outlined"?x:l,R=l,M=h==="outlined"?l:"#fff",N=2):w?(I=h==="filled"?d:x,R=d,M=h==="filled"?"#fff":d):C&&(I=x,R=m,M=o);const T=$&&!y?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},j=z?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let k;return i&&!v&&!w?k=t.jsx("span",{style:{fontSize:a,lineHeight:1},children:i}):v?k=t.jsx(Ki,{size:s}):w?k=t.jsx(Xi,{size:s}):n?k=t.jsx("span",{style:{fontSize:a,fontWeight:600,lineHeight:1},children:r+1}):k=t.jsx("span",{style:{fontSize:s*.22,lineHeight:1,background:M,borderRadius:"50%",width:s*.22,height:s*.22,display:"block"}}),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`
|
|
66
66
|
@keyframes tkxstepper-pulse {
|
|
67
67
|
0%, 100% { box-shadow: 0 0 0 0 ${l}50; }
|
|
68
68
|
50% { box-shadow: 0 0 0 6px ${l}20; }
|
|
69
69
|
}
|
|
70
|
-
`}),t.jsx("div",{style:{width:s,height:s,minWidth:s,borderRadius:"50%",border:`${N}px solid ${R}`,backgroundColor:I,color:M,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...T,...j},children:k})]})}function _r({completed:e,orientation:r,connectorStyle:n,connectorWidth:i,primary:s,border:a,reducedMotion:l}){const d=e?s:a;return r==="horizontal"?t.jsx("div",{"aria-hidden":"true",style:{flex:1,height:i,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(90deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):t.jsx("div",{"aria-hidden":"true",style:{width:i,flex:1,minHeight:20,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(180deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function _n({steps:e,activeStep:r=0,orientation:n="horizontal",variant:i="default",size:s="md",clickable:a=!1,onStepClick:l,showStepNumbers:d=!0,alternateLabel:u=!1,connector:x="solid",className:o,style:m}){const p=ee(),h=ye(),y=Fi[s],z=($,w)=>$.status?$.status:w<r?"completed":w===r?"active":"pending",v=n==="horizontal";return t.jsx("div",{className:o,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:v?"row":"column",alignItems:v?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map(($,w)=>{const C=z($,w),I=w===e.length-1,R=C==="completed"||w<r,M=w%2===0,N=()=>{a&&(l==null||l(w))},T=t.jsx(Wi,{status:C,index:w,showStepNumbers:d,icon:$.icon,circleSize:y.circle,fontSize:y.fontSize,primary:p.primary,danger:p.danger,success:p.success,text:p.text,textMuted:p.textMuted,border:p.border,surface:p.surface,variant:i,reducedMotion:h,clickable:a}),j=t.jsxs("div",{style:{textAlign:v&&!u?"center":"left",maxWidth:v?120:void 0},children:[t.jsxs("div",{style:{fontSize:y.titleSize,fontWeight:C==="active"?600:500,color:C==="pending"?p.textMuted:C==="error"?p.danger:p.text,lineHeight:1.3,transition:h?"none":"color 0.2s"},children:[B($.title),$.optional&&t.jsx("span",{style:{fontSize:y.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),$.description&&t.jsx("div",{style:{fontSize:y.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:B($.description)}),$.error&&C==="error"&&t.jsx("div",{style:{fontSize:y.descSize,color:p.danger,marginTop:2},children:B($.error)})]});return v?t.jsxs("div",{role:"listitem",style:{display:"flex",flex:I?0:1,alignItems:"center",minWidth:0},children:[t.jsxs("div",{onClick:N,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:a?"pointer":"default",flexShrink:0},"aria-current":C==="active"?"step":void 0,children:[u&&!M&&t.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:j}),T,!u&&j,u&&M&&t.jsx("div",{style:{marginTop:6},children:j})]}),!I&&t.jsx(_r,{completed:R,orientation:"horizontal",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]},$.id):t.jsxs("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[t.jsx("div",{onClick:N,style:{cursor:a?"pointer":"default"},"aria-current":C==="active"?"step":void 0,children:T}),!I&&t.jsx(_r,{completed:R,orientation:"vertical",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]}),t.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:I?0:16,flex:1,minWidth:0},children:j})]},$.id)})})}_n.displayName="TkxStepper";function Un(e){let r=0,n=0,i=0;const s=e.replace("#","");s.length===3?(r=parseInt(s[0]+s[0],16),n=parseInt(s[1]+s[1],16),i=parseInt(s[2]+s[2],16)):s.length>=6&&(r=parseInt(s.slice(0,2),16),n=parseInt(s.slice(2,4),16),i=parseInt(s.slice(4,6),16)),r/=255,n/=255,i/=255;const a=Math.max(r,n,i),l=Math.min(r,n,i);let d=0,u=0;const x=(a+l)/2;if(a!==l){const o=a-l;switch(u=x>.5?o/(2-a-l):o/(a+l),a){case r:d=((n-i)/o+(n<i?6:0))/6;break;case n:d=((i-r)/o+2)/6;break;case i:d=((r-n)/o+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(x*100)]}function sr(e,r,n){r/=100,n/=100;const i=r*Math.min(n,1-n),s=a=>{const l=(a+e/30)%12,d=n-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function Rt(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(i)?0:i,isNaN(s)?0:s]}function Gt(e,r,n){return`#${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Ge(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Jt(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[i,s,a]=Rt(e);if(n==="rgb")return r<1?`rgba(${i}, ${s}, ${a}, ${r.toFixed(2)})`:`rgb(${i}, ${s}, ${a})`;const[l,d,u]=Un(e);return n==="hsl"?r<1?`hsla(${l}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${l}, ${d}%, ${u}%)`:e}const Hi=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Vi({hue:e,sat:r,bright:n,onChange:i}){const s=c.useRef(null),a=c.useRef(!1),l=c.useCallback(x=>{const o=s.current;if(!o)return;const m=o.getBoundingClientRect(),p=Math.max(0,Math.min(1,(x.clientX-m.left)/m.width)),h=Math.max(0,Math.min(1,(x.clientY-m.top)/m.height));i(Math.round(p*100),Math.round((1-h)*100))},[i]);c.useEffect(()=>{const x=m=>{a.current&&l(m)},o=()=>{a.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",o)}},[l]);const d=`${r}%`,u=`${100-n}%`;return t.jsxs("div",{ref:s,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:x=>{a.current=!0,l(x)},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),t.jsx("div",{style:{position:"absolute",left:d,top:u,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:sr(e,r,n/2+25)}})]})}function Oi({hue:e,onChange:r}){const n=c.useRef(null),i=c.useRef(!1),s=c.useCallback(a=>{const l=n.current;if(!l)return;const d=l.getBoundingClientRect(),u=Math.max(0,Math.min(1,(a.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return c.useEffect(()=>{const a=d=>{i.current&&s(d)},l=()=>{i.current=!1};return document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)}},[s]),t.jsx("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:a=>{i.current=!0,s(a)},children:t.jsx("div",{style:{position:"absolute",left:`${e/360*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Yi({alpha:e,hex:r,onChange:n}){const i=c.useRef(null),s=c.useRef(!1),a=c.useCallback(x=>{const o=i.current;if(!o)return;const m=o.getBoundingClientRect(),p=Math.max(0,Math.min(1,(x.clientX-m.left)/m.width));n(Math.round(p*100)/100)},[n]);c.useEffect(()=>{const x=m=>{s.current&&a(m)},o=()=>{s.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",o)}},[a]);const[l,d,u]=Rt(r);return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),t.jsx("div",{ref:i,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${l},${d},${u},0), rgba(${l},${d},${u},1))`},onMouseDown:x=>{s.current=!0,a(x)},children:t.jsx("div",{style:{position:"absolute",left:`${e*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${l},${d},${u},${e})`,pointerEvents:"none"}})})]})}function _i({value:e,defaultValue:r="#3b82f6",onChange:n,format:i="hex",showAlpha:s=!1,presets:a=Hi,disabled:l=!1,size:d="md",placeholder:u,label:x,style:o}){const m=ee(),p=c.useRef(null),h=c.useRef(null),[y,z]=c.useState(!1),v=e!==void 0,[$,w]=c.useState(v&&e||r),C=v?e||r:$,[I,R]=c.useState(1),[M,N]=c.useState(C),[T,j]=c.useState({top:0,left:0}),[k,Y,f]=Un(Ge(C)?C:r),g=c.useCallback((X,Z=I)=>{Ge(X)&&(N(X),v||w(X),n==null||n(Jt(X,Z,i),i))},[I,v,i,n]);c.useEffect(()=>{v&&e&&Ge(e)&&N(e)},[v,e]);const S=()=>{if(l)return;const X=p.current;if(!X)return;const Z=X.getBoundingClientRect(),we=window.innerHeight-Z.bottom>320?Z.bottom+6:Z.top-326;j({top:we+window.scrollY,left:Z.left+window.scrollX}),z(!0)};c.useEffect(()=>{if(!y)return;const X=Z=>{h.current&&!h.current.contains(Z.target)&&p.current&&!p.current.contains(Z.target)&&z(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[y]),c.useEffect(()=>{if(!y)return;const X=Z=>{Z.key==="Escape"&&z(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]);const F=(X,Z)=>{const ve=Z/100,we=X/100,de=ve*(1-we/2),ge=de===0||de===1?0:(ve-de)/Math.min(de,1-de),J=sr(k,Math.round(ge*100),Math.round(de*100));g(J)},D=X=>{const Z=sr(X,Y,f);g(Z)},V=X=>{R(X),n==null||n(Jt(C,X,i),i)},E=X=>{const Z=X.target.value;N(Z),Ge(Z)&&g(Z)},P=(X,Z)=>{const ve=Math.max(0,Math.min(255,parseInt(Z)||0)),[we,de,ge]=Rt(C),J=X==="r"?Gt(ve,de,ge):X==="g"?Gt(we,ve,ge):Gt(we,de,ve);g(J)},O={sm:28,md:34,lg:40}[d],[A,H,Q]=Rt(Ge(C)?C:r),G={display:"inline-flex",alignItems:"center",gap:"8px",height:`${O}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:l?"not-allowed":"pointer",opacity:l?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...o},ne={width:`${O-8}px`,height:`${O-8}px`,borderRadius:"4px",backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`,flexShrink:0},pe={position:"absolute",top:T.top,left:T.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},xe={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},oe={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},me=X=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:X,border:X.toLowerCase()===C.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return t.jsxs(t.Fragment,{children:[x&&t.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:x}),t.jsxs("button",{ref:p,type:"button",style:G,onClick:S,disabled:l,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":"dialog","aria-expanded":y,children:[t.jsx("div",{style:ne}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Jt(Ge(C)?C:r,I,i)})]}),y&&Be.createPortal(t.jsxs("div",{ref:h,style:pe,role:"dialog","aria-label":"Color picker",children:[t.jsx(Vi,{hue:k,sat:Y,bright:f,onChange:F}),t.jsx(Oi,{hue:k,onChange:D}),s&&t.jsx(Yi,{alpha:I,hex:Ge(C)?C:r,onChange:V}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`}}),t.jsx("input",{style:xe,value:M,onChange:E,maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(X=>{const Z=X==="r"?A:X==="g"?H:Q;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:255,value:Z,onChange:ve=>P(X,ve.target.value),"aria-label":`${X.toUpperCase()} channel`}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:X})]},X)}),s&&t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:100,value:Math.round(I*100),onChange:X=>V(Math.max(0,Math.min(1,parseInt(X.target.value)/100||0))),"aria-label":"Alpha channel"}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),a.length>0&&t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:a.map(X=>t.jsx("button",{type:"button",style:me(X),onClick:()=>g(X),"aria-label":`Select color ${X}`,onMouseEnter:Z=>{Z.currentTarget.style.transform="scale(1.15)"},onMouseLeave:Z=>{Z.currentTarget.style.transform="scale(1)"}},X))})]})]}),document.body)]})}const Ui={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Ur(e,r,n){let i=e;return r!==void 0&&(i=Math.max(i,r)),n!==void 0&&(i=Math.min(i,n)),i}function Qt(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function Ki(e,r,n,i,s){const a=i??"en-US";return r==="currency"?new Intl.NumberFormat(a,{style:"currency",currency:n??"USD",minimumFractionDigits:s??2,maximumFractionDigits:s??2}).format(e):r==="percent"?new Intl.NumberFormat(a,{style:"percent",minimumFractionDigits:s??0,maximumFractionDigits:s??0}).format(e/100):r==="decimal"||s!==void 0?new Intl.NumberFormat(a,{minimumFractionDigits:s??0,maximumFractionDigits:s??20}).format(e):String(e)}function Kr({direction:e,isDisabled:r,btnW:n,height:i,primaryColor:s,borderColor:a,textMuted:l,iconSz:d,onStep:u}){const x=c.useRef(null),o=c.useRef(null),m=e==="inc"?1:-1,p=c.useCallback(()=>{u(m),x.current=setTimeout(()=>{o.current=setInterval(()=>u(m),60)},400)},[m,u]),h=c.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),o.current&&(clearInterval(o.current),o.current=null)},[]);c.useEffect(()=>()=>h(),[h]);const y=e==="inc";return t.jsx("button",{type:"button","aria-label":y?"Increment":"Decrement",disabled:r,onMouseDown:p,onMouseUp:h,onMouseLeave:h,onTouchStart:z=>{z.preventDefault(),p()},onTouchEnd:h,style:{width:n,height:i,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:y?void 0:`1px solid ${a}`,borderLeft:y?`1px solid ${a}`:void 0,cursor:r?"not-allowed":"pointer",color:r?l:s,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:z=>{r||(z.currentTarget.style.background=`${s}12`)},onBlur:z=>{z.currentTarget.style.background="transparent"},children:y?t.jsxs("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsx("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function Kn({value:e,defaultValue:r=0,onChange:n,min:i,max:s,step:a=1,precision:l,prefix:d,suffix:u,format:x,currency:o,locale:m,clampOnBlur:p=!0,allowMouseWheel:h=!1,size:y="md",label:z,hint:v,isDisabled:$=!1,isReadOnly:w=!1,isInvalid:C=!1,errorMessage:I,id:R,className:M,style:N}){const T=ee(),j=c.useId(),k=R??j,Y=`${k}-hint`,f=`${k}-error`,g=e!==void 0,[S,F]=c.useState(r),D=g?e:S,[V,E]=c.useState(!1),[P,W]=c.useState(""),O=Ui[y],A=C||!!I,H=A?T.danger:V?T.primary:T.border,Q=[v&&Y,A&&f].filter(Boolean).join(" ")||void 0,G=z?B(z):void 0,ne=v?B(v):void 0,pe=I?B(I):void 0,xe=d?B(d):void 0,oe=u?B(u):void 0,me=c.useCallback(re=>{const q=Qt(re,l);g||F(q),n==null||n(q)},[g,n,l]),X=c.useCallback(re=>{if($||w)return;const q=Ur(Qt(D+re*a,l),i,s);me(q)},[$,w,D,a,l,i,s,me]),Z=()=>{E(!0),W(String(D))},ve=()=>{E(!1);const re=parseFloat(P);if(isNaN(re)){n==null||n(null),W(String(D));return}let q=Qt(re,l);p&&(q=Ur(q,i,s)),me(q)},we=re=>{W(re.target.value)},de=re=>{re.key==="ArrowUp"&&(re.preventDefault(),X(1)),re.key==="ArrowDown"&&(re.preventDefault(),X(-1))},ge=re=>{!h||!V||(re.preventDefault(),X(re.deltaY<0?1:-1))},J=V?P:Ki(D,x,o,m,l),ie=(xe||oe)&&!V;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),M),style:N,children:[G&&t.jsx("label",{htmlFor:k,className:b("text-sm font-medium font-sans"),style:{color:T.text},children:G}),t.jsxs("div",{className:b("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${H}`,backgroundColor:$?T.surfaceAlt:T.surface,opacity:$?.65:1,height:O.height},children:[t.jsx(Kr,{direction:"dec",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.iconSz,onStep:X}),t.jsxs("div",{className:b("relative flex-1 flex items-center overflow-hidden"),children:[ie&&xe&&t.jsx("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:k,type:"text",inputMode:"decimal",value:V?P:J,readOnly:w,disabled:$,"aria-invalid":A,"aria-describedby":Q,"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":D,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:T.text,paddingLeft:ie&&xe?`calc(${O.px} + 1.2em)`:O.px,paddingRight:ie&&oe?`calc(${O.px} + 1.2em)`:O.px,cursor:$?"not-allowed":w?"default":"text"},onFocus:Z,onBlur:ve,onChange:we,onKeyDown:de,onWheel:ge}),ie&&oe&&t.jsx("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:oe})]}),t.jsx(Kr,{direction:"inc",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.iconSz,onStep:X})]}),ne&&!pe&&t.jsx("span",{id:Y,className:b("text-xs"),style:{color:T.textMuted},children:ne}),pe&&t.jsxs("span",{id:f,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:T.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),pe]})]})}Kn.displayName="TkxNumberInput";const Xi={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},qi={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function Xr(e,r){return qi[r].test(e)?e.toUpperCase():""}function Xn({length:e=6,value:r,onChange:n,onComplete:i,type:s="number",mask:a=!1,autoFocus:l=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:x,hint:o,size:m="md",separator:p,separatorPosition:h,className:y,style:z}){const v=ee(),$=c.useId(),w=`${$}-hint`,C=`${$}-error`,I=r!==void 0,R=A=>{const H=A.split("").slice(0,e);for(;H.length<e;)H.push("");return H},[M,N]=c.useState(()=>R(I?r:"")),T=I?R(r):M,j=c.useRef([]),k=Xi[m],Y=u||!!x,f=T.every(A=>A!==""),g=o?B(o):void 0,S=x?B(x):void 0,F=A=>Y?v.danger:f?v.success:v.border;c.useEffect(()=>{var A;l&&((A=j.current[0])==null||A.focus())},[]);const D=c.useCallback(A=>{I||N(A);const H=A.join("");n==null||n(H),A.every(Q=>Q!=="")&&(i==null||i(H))},[I,n,i]),V=A=>{var Q;const H=Math.max(0,Math.min(e-1,A));(Q=j.current[H])==null||Q.focus()},E=A=>H=>{if(!d){if(H.key==="Backspace"){if(H.preventDefault(),T[A]!==""){const Q=[...T];Q[A]="",D(Q)}else if(A>0){const Q=[...T];Q[A-1]="",D(Q),V(A-1)}return}if(H.key==="Delete"){H.preventDefault();const Q=[...T];Q[A]="",D(Q);return}if(H.key==="ArrowLeft"){H.preventDefault(),V(A-1);return}if(H.key==="ArrowRight"){H.preventDefault(),V(A+1);return}if(H.key==="Home"){H.preventDefault(),V(0);return}if(H.key==="End"){H.preventDefault(),V(e-1);return}}},P=A=>H=>{if(d)return;const G=H.target.value.slice(-1);if(!G)return;const ne=Xr(G,s);if(!ne)return;const pe=[...T];pe[A]=ne,D(pe),A<e-1&&V(A+1)},W=A=>H=>{if(H.preventDefault(),d)return;const G=H.clipboardData.getData("text").split("").map(xe=>Xr(xe,s)).filter(Boolean);if(!G.length)return;const ne=[...T];let pe=A;for(const xe of G){if(pe>=e)break;ne[pe]=xe,pe++}D(ne),V(Math.min(pe,e-1))},O=[g&&w,Y&&C].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ue(b("flex flex-col gap-2 w-fit"),y),style:z,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":O,className:b("flex items-center"),style:{gap:k.gap},children:Array.from({length:e},(A,H)=>{const Q=F();return typeof document<"u"&&(document.activeElement,j.current[H]),t.jsxs("div",{className:b("flex items-center"),style:{gap:k.gap},children:[p&&h===H&&H!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:v.textMuted,userSelect:"none",flexShrink:0},children:p}),t.jsx("input",{ref:G=>{j.current[H]=G},type:a?"password":"text",inputMode:s==="number"?"numeric":"text",maxLength:1,value:T[H],disabled:d,"aria-label":`Digit ${H+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:P(H),onKeyDown:E(H),onPaste:W(H),onFocus:G=>G.target.select(),style:{width:k.box,height:k.box,textAlign:"center",fontSize:k.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?v.surfaceAlt:v.surface,color:v.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:G=>{d||(G.currentTarget.style.borderColor=Y?v.danger:v.primary,G.currentTarget.style.boxShadow=`0 0 0 3px ${Y?v.danger:v.primary}33`)},onBlurCapture:G=>{G.currentTarget.style.borderColor=F(),G.currentTarget.style.boxShadow="none"}})]},H)})}),g&&!S&&t.jsx("span",{id:w,className:b("text-xs"),style:{color:v.textMuted},children:g}),S&&t.jsxs("span",{id:C,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:v.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),S]})]})}Xn.displayName="TkxOTP";function Zi(e,r){c.useEffect(()=>{if(!r)return;const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r])}function Gi(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=r.current,i=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],a=i[i.length-1],l=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===s&&(d.preventDefault(),a==null||a.focus()):document.activeElement===a&&(d.preventDefault(),s==null||s.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),r}function Ji(){const[e,r]=c.useState(!1),n=c.useCallback(()=>r(!0),[]),i=c.useCallback(()=>r(!1),[]),s=c.useCallback(()=>r(a=>!a),[]);return{isOpen:e,open:n,close:i,toggle:s}}function er(e,r){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),i=r.toLowerCase(),s=i.indexOf(n);if(s!==-1)return{matched:!0,ranges:[[s,s+n.length-1]],score:s===0?100:80};const a=[];let l=0,d=-1,u=-1;for(let x=0;x<i.length&&l<n.length;x++)i[x]===n[l]&&((u===-1||x!==u+1)&&(d!==-1&&a.push([d,u]),d=x),u=x,l++);return d!==-1&&u!==-1&&a.push([d,u]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:a,score:40}}function Qi(e,r){if(!e.trim())return r.filter(i=>!i.disabled).map(i=>({item:i,score:0,labelRanges:[]}));const n=[];for(const i of r){if(i.disabled)continue;const s=er(e,i.label),a=i.description?er(e,i.description):{matched:!1,score:0},l=(i.keywords??[]).some(d=>er(e,d).matched);s.matched?n.push({item:i,score:s.score+20,labelRanges:s.ranges}):a.matched?n.push({item:i,score:a.score,labelRanges:[]}):l&&n.push({item:i,score:20,labelRanges:[]})}return n.sort((i,s)=>s.score-i.score)}function ea({text:e,ranges:r,color:n}){if(!r.length)return t.jsx(t.Fragment,{children:e});const i=[];let s=0;for(const[a,l]of r)s<a&&i.push(t.jsx("span",{children:e.slice(s,a)},`t-${s}`)),i.push(t.jsx("span",{style:{color:n,fontWeight:700},children:e.slice(a,l+1)},`h-${a}`)),s=l+1;return s<e.length&&i.push(t.jsx("span",{children:e.slice(s)},"t-end")),t.jsx(t.Fragment,{children:i})}function ta({surface:e,border:r}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[t.jsx("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[t.jsx("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function qn({items:e,isOpen:r=!1,onClose:n,placeholder:i="Type a command or search…",emptyMessage:s,maxItems:a=8,onItemSelect:l,className:d,style:u}){const x=ee(),[o,m]=c.useState(""),[p,h]=c.useState(0),[y,z]=c.useState(!1),v=c.useRef(null),$=c.useRef(null),w=c.useId(),C=Gi(r),I=Qi(o,e).slice(0,a),R=[];for(const f of I){const g=f.item.group,S=R.find(F=>F.group===g);S?S.items.push(f):R.push({group:g,items:[f]})}const M=R.flatMap(f=>f.items);Zi(()=>{n==null||n()},r),c.useEffect(()=>{r&&(m(""),h(0),setTimeout(()=>{var f;return(f=v.current)==null?void 0:f.focus()},30))},[r]),c.useEffect(()=>{p>=M.length&&h(Math.max(0,M.length-1))},[M.length,p]);const N=c.useCallback(f=>{const g=$.current;if(!g)return;const S=g.querySelectorAll("[data-command-item]")[f];S==null||S.scrollIntoView({block:"nearest"})},[]),T=f=>{if(f.key==="ArrowDown"){f.preventDefault();const g=Math.min(M.length-1,p+1);h(g),N(g)}else if(f.key==="ArrowUp"){f.preventDefault();const g=Math.max(0,p-1);h(g),N(g)}else if(f.key==="Enter"){f.preventDefault();const g=M[p];g&&j(g.item)}},j=f=>{var g;f.disabled||((g=f.onSelect)==null||g.call(f),l==null||l(f),n==null||n())};if(!r||typeof document>"u")return null;const k=B(i),Y=s?B(s):`No results for "${B(o)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const f=document.createElement("style");f.id="tkx-shimmer-style",f.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(f)}return Be.createPortal(t.jsxs("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[t.jsx("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),t.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:w,className:ue(d),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:x.surface,border:`1px solid ${x.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${x.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...u},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${x.border}`},children:[t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:x.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),t.jsx("input",{ref:v,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":M[p]?`${w}-item-${M[p].item.id}`:void 0,value:o,onChange:f=>{m(f.target.value),h(0)},onKeyDown:T,placeholder:k,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:x.text}}),o&&t.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var f;m(""),h(0),(f=v.current)==null||f.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:x.textMuted,display:"flex",alignItems:"center",padding:0},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{id:`${w}-list`,ref:$,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(f,g)=>t.jsx(ta,{surface:x.surface,border:x.border},g)):M.length===0?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:x.textMuted},children:[t.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),t.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),t.jsx("span",{style:{fontSize:"0.875rem"},children:Y})]}):R.map(({group:f,items:g},S)=>{const F=R.slice(0,S).reduce((D,V)=>D+V.items.length,0);return t.jsxs("div",{children:[f&&t.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:x.textMuted,padding:"10px 12px 4px"},children:B(f)}),g.map((D,V)=>{const E=F+V,P=E===p,W=D.item;return t.jsxs("div",{id:`${w}-item-${W.id}`,role:"option","aria-selected":P,"aria-disabled":W.disabled,"data-command-item":!0,onClick:()=>j(W),onMouseEnter:()=>h(E),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:W.disabled?"not-allowed":"pointer",opacity:W.disabled?.45:1,backgroundColor:P?`${x.primary}18`:"transparent",borderLeft:P?`2px solid ${x.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[W.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:P?x.primary:x.textMuted},children:W.icon}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:x.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.jsx(ea,{text:W.label,ranges:D.labelRanges,color:x.primary})}),W.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:x.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:B(W.description)})]}),W.shortcut&&t.jsx("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:x.textMuted,backgroundColor:x.surfaceAlt,border:`1px solid ${x.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:B(W.shortcut)})]},W.id)})]},f??"__default__")})}),M.length>0&&t.jsxs("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${x.border}`,fontSize:"0.6875rem",color:x.textMuted},children:[t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}qn.displayName="TkxCommand";function It({direction:e,onClick:r,isDisabled:n,primaryColor:i,position:s,orientation:a}){const l=a==="vertical",d=e==="prev",u=s==="inside"?{position:"absolute",zIndex:3,...l?{[d?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[d?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return t.jsx("button",{type:"button","aria-label":d?"Previous slide":"Next slide",disabled:n,onClick:r,style:{...u,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:x=>{x.currentTarget.style.boxShadow=`0 0 0 3px ${i}55`},onBlur:x=>{x.currentTarget.style.boxShadow="none"},onMouseEnter:x=>{n||(x.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"18 15 12 9 6 15"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})}function Zn({slides:e,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:i=!0,loop:s=!0,showArrows:a=!0,showDots:l=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:x=1,gap:o=0,transitionDuration:m=400,swipeable:p=!0,initialIndex:h=0,onChange:y,arrowPosition:z="inside",height:v=320,className:$,style:w}){const C=ee(),I=ye(),R=c.useId(),M=e.length,[N,T]=c.useState(h),[j,k]=c.useState(s?h+1:h),[Y,f]=c.useState(!1),[g,S]=c.useState(!1),F=c.useRef(null),D=c.useRef(null),V=c.useRef(null),E=c.useRef(0),P=c.useRef(!1),W=u==="vertical",O=I?0:m,A=s&&M>1?[e[M-1],...e,e[0]]:e,H=A.length,Q=100/x,G=(q,te=0)=>{const be=te!==0?` - ${te}px`:"";return W?`translateY(calc(-${q*Q}%${be}))`:`translateX(calc(-${q*Q}%${be}))`},ne=c.useCallback((q,te=!1)=>{const be=s?(q%M+M)%M:Math.max(0,Math.min(M-1,q)),$e=s?be+1:be;te&&F.current?(F.current.style.transition="none",k($e),T(be),F.current.offsetHeight,F.current.style.transition=""):(f(!0),k($e),T(be)),y==null||y(be)},[M,s,y]),pe=c.useCallback(()=>ne(N-1),[N,ne]),xe=c.useCallback(()=>ne(N+1),[N,ne]),oe=c.useCallback(()=>{f(!1),!(!s||M<=1)&&(j===0?ne(M-1,!0):j===H-1&&ne(0,!0))},[s,M,j,H,ne]);c.useEffect(()=>{if(!(!r||g||M<=1))return D.current=setInterval(xe,n),()=>{D.current&&clearInterval(D.current)}},[r,g,n,xe,M]),c.useEffect(()=>{const q=te=>{const be=document.activeElement,$e=document.getElementById(R);$e!=null&&$e.contains(be)&&(te.key===(W?"ArrowUp":"ArrowLeft")&&(te.preventDefault(),pe()),te.key===(W?"ArrowDown":"ArrowRight")&&(te.preventDefault(),xe()))};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[R,W,pe,xe]);const me=q=>"touches"in q?W?q.touches[0].clientY:q.touches[0].clientX:W?q.clientY:q.clientX,X=q=>{p&&(V.current=me(q),E.current=0,P.current=!0)},Z=q=>{if(!P.current||V.current===null)return;const te=me(q)-V.current;E.current=te,F.current&&(F.current.style.transition="none",F.current.style.transform=G(j,-te))},ve=()=>{if(!P.current)return;P.current=!1;const q=E.current,te=50;F.current&&(F.current.style.transition="",F.current.style.transform=""),q<-te?xe():q>te?pe():F.current&&(F.current.style.transform=G(j)),V.current=null,E.current=0},we=typeof v=="number"?`${v}px`:v,de={display:"flex",flexDirection:W?"column":"row",width:W?"100%":`${H/x*100}%`,height:W?`${H/x*100}%`:"100%",transform:G(j),transition:Y||!I?`transform ${O}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:o>0?o:void 0},ge={flexShrink:0,width:W?"100%":`${Q/(H/x)}%`,height:W?`${Q/(H/x)}%`:"100%",overflow:"hidden",position:"relative"},J=s||N>0,ie=s||N<M-1,re=z==="outside";return t.jsxs("div",{id:R,className:ue(b("flex flex-col gap-2"),$),style:w,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[t.jsxs("div",{className:b("flex items-center gap-2"),style:{gap:re&&a?8:0},children:[a&&re&&t.jsx(It,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:we,borderRadius:12,cursor:p?P.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>i&&S(!0),onMouseLeave:()=>{S(!1),ve()},onTouchStart:X,onTouchMove:Z,onTouchEnd:ve,onMouseDown:X,onMouseMove:Z,onMouseUp:ve,"aria-live":"polite","aria-atomic":"false",children:[a&&!re&&t.jsxs(t.Fragment,{children:[t.jsx(It,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"inside",orientation:u}),t.jsx(It,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"inside",orientation:u})]}),t.jsx("div",{ref:F,style:de,onTransitionEnd:oe,children:A.map((q,te)=>t.jsx("div",{style:ge,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(te-(s?1:0)+M)%M+1} of ${M}`,"aria-hidden":(te-(s?1:0)+M)%M!==N,children:q.content},`${q.id}-${te}`))}),l&&!d&&t.jsx("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((q,te)=>t.jsx("button",{type:"button","aria-label":`Go to slide ${te+1}`,"aria-current":te===N?"true":void 0,onClick:()=>ne(te),style:{width:te===N?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:te===N?C.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}66`},onBlur:be=>{be.currentTarget.style.boxShadow="none"}},q.id))})]}),a&&re&&t.jsx(It,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"outside",orientation:u})]}),d&&t.jsx("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((q,te)=>t.jsxs("button",{type:"button",role:"tab","aria-selected":te===N,"aria-label":`Thumbnail for slide ${te+1}`,onClick:()=>ne(te),style:{flexShrink:0,width:60,height:42,border:`2px solid ${te===N?C.primary:C.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:C.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}55`},onBlur:be=>{be.currentTarget.style.boxShadow="none"},children:[q.thumbnail?t.jsx("img",{src:q.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:C.textMuted,fontWeight:600},children:te+1}),te===N&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${C.primary}22`}})]},q.id))})]})}Zn.displayName="TkxCarousel";const Ft={close:"Close",cancel:"Cancel",confirm:"Confirm",save:"Save",delete:"Delete",search:"Search",loading:"Loading...",noResults:"No results found",required:"Required",previous:"Previous",next:"Next",pageOf:(e,r)=>`Page ${e} of ${r}`,selectPlaceholder:"Select...",clearSelection:"Clear selection",selectDate:"Select a date",today:"Today",dropFiles:"Drop files here or",browse:"Browse",noData:"No data available",sortAscending:"Sort ascending",sortDescending:"Sort descending"},Gn={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",delete:"Eliminar",search:"Buscar",loading:"Cargando...",noResults:"No se encontraron resultados",required:"Requerido",previous:"Anterior",next:"Siguiente",pageOf:(e,r)=>`Página ${e} de ${r}`,selectPlaceholder:"Seleccionar...",clearSelection:"Limpiar selección",selectDate:"Seleccionar fecha",today:"Hoy",dropFiles:"Suelte archivos aquí o",browse:"Explorar",noData:"No hay datos disponibles",sortAscending:"Orden ascendente",sortDescending:"Orden descendente"},Jn={close:"إغلاق",cancel:"إلغاء",confirm:"تأكيد",save:"حفظ",delete:"حذف",search:"بحث",loading:"...جارٍ التحميل",noResults:"لم يتم العثور على نتائج",required:"مطلوب",previous:"السابق",next:"التالي",pageOf:(e,r)=>`صفحة ${e} من ${r}`,selectPlaceholder:"...اختر",clearSelection:"مسح الاختيار",selectDate:"اختر تاريخ",today:"اليوم",dropFiles:"أفلت الملفات هنا أو",browse:"تصفح",noData:"لا توجد بيانات",sortAscending:"ترتيب تصاعدي",sortDescending:"ترتيب تنازلي"},Qn={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",save:"Enregistrer",delete:"Supprimer",search:"Rechercher",loading:"Chargement...",noResults:"Aucun résultat trouvé",required:"Obligatoire",previous:"Précédent",next:"Suivant",pageOf:(e,r)=>`Page ${e} sur ${r}`,selectPlaceholder:"Sélectionner...",clearSelection:"Effacer la sélection",selectDate:"Sélectionner une date",today:"Aujourd'hui",dropFiles:"Déposez les fichiers ici ou",browse:"Parcourir",noData:"Aucune donnée disponible",sortAscending:"Tri croissant",sortDescending:"Tri décroissant"},eo={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",save:"Speichern",delete:"Löschen",search:"Suchen",loading:"Wird geladen...",noResults:"Keine Ergebnisse gefunden",required:"Erforderlich",previous:"Zurück",next:"Weiter",pageOf:(e,r)=>`Seite ${e} von ${r}`,selectPlaceholder:"Auswählen...",clearSelection:"Auswahl löschen",selectDate:"Datum auswählen",today:"Heute",dropFiles:"Dateien hier ablegen oder",browse:"Durchsuchen",noData:"Keine Daten verfügbar",sortAscending:"Aufsteigend sortieren",sortDescending:"Absteigend sortieren"},to={close:"閉じる",cancel:"キャンセル",confirm:"確認",save:"保存",delete:"削除",search:"検索",loading:"読み込み中...",noResults:"結果が見つかりません",required:"必須",previous:"前へ",next:"次へ",pageOf:(e,r)=>`${r}ページ中${e}ページ`,selectPlaceholder:"選択...",clearSelection:"選択解除",selectDate:"日付を選択",today:"今日",dropFiles:"ファイルをドロップまたは",browse:"参照",noData:"データなし",sortAscending:"昇順",sortDescending:"降順"},ro={"en-US":Ft,"es-ES":Gn,"ar-SA":Jn,"fr-FR":Qn,"de-DE":eo,"ja-JP":to},ra=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function no(e){return ra.has(e)}const xt=c.createContext({locale:"en-US",direction:"ltr",strings:Ft});function na(){return c.useContext(xt)}function oa(){return c.useContext(xt).strings}function sa(){return c.useContext(xt).direction}function ia({locale:e="en-US",direction:r,strings:n,children:i}){const s=c.useMemo(()=>{const a=ro[e]??Ft,l=n?{...a,...n}:a,d=r??(no(e)?"rtl":"ltr");return{locale:e,direction:d,strings:l}},[e,r,n]);return t.jsx(xt.Provider,{value:s,children:t.jsx("div",{dir:s.direction,style:{direction:s.direction},children:i})})}function aa({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function la({politeness:e="polite",children:r,atomic:n=!0}){return t.jsx("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:r})}function ca({active:e,children:r,as:n="div"}){const i=Dt(e);return t.jsx(n,{ref:i,children:r})}function da({as:e,children:r,...n}){const i=e??"span";return t.jsx(i,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=ca;exports.I18nContext=xt;exports.I18nProvider=ia;exports.LOCALES=ro;exports.LRUCache=qr;exports.LiveRegion=la;exports.Quantum=xo;exports.Shield=No;exports.SkipNav=aa;exports.TKX=bo;exports.ThemeContext=pr;exports.ThemeProvider=Co;exports.TkxAccordion=An;exports.TkxAlert=as;exports.TkxAvatar=Mn;exports.TkxBadge=kn;exports.TkxButton=bn;exports.TkxCard=yn;exports.TkxCardBody=Qo;exports.TkxCardFooter=es;exports.TkxCardHeader=Jo;exports.TkxCarousel=Zn;exports.TkxChat=bi;exports.TkxChatBubble=Bn;exports.TkxCheckbox=In;exports.TkxClock=On;exports.TkxColorPicker=_i;exports.TkxCommand=qn;exports.TkxDatePicker=Dn;exports.TkxDivider=Cn;exports.TkxDrawer=Os;exports.TkxFileUpload=ai;exports.TkxImage=ni;exports.TkxInput=vn;exports.TkxMenu=Vn;exports.TkxModal=ds;exports.TkxNumberInput=Kn;exports.TkxOTP=Xn;exports.TkxPagination=Fn;exports.TkxProgress=wn;exports.TkxRadio=zn;exports.TkxRadioGroup=Ts;exports.TkxRating=xi;exports.TkxSelect=Tn;exports.TkxSkeleton=mr;exports.TkxSlider=Ln;exports.TkxStepper=_n;exports.TkxTab=ps;exports.TkxTabList=fs;exports.TkxTabPanel=hs;exports.TkxTabPanels=xs;exports.TkxTable=ks;exports.TkxTabs=us;exports.TkxTag=Wn;exports.TkxTagInput=Si;exports.TkxThinkingIndicator=Pn;exports.TkxTimeline=Ci;exports.TkxToastProvider=Ls;exports.TkxToggle=jn;exports.TkxTooltip=gs;exports.TkxVideoPlayer=Yn;exports.VisuallyHidden=da;exports.WCAGEngine=jo;exports.arSA=Jn;exports.audit=fn;exports.auroraLight=So;exports.batchUpdate=Jr;exports.contrastRatio=it;exports.createFocusTrap=cr;exports.createTheme=Mo;exports.css=tn;exports.cssVar=ar;exports.cx=ue;exports.deDE=eo;exports.enUS=Ft;exports.esES=Gn;exports.extractAtomicCSS=_o;exports.extractCSS=lr;exports.fnv1aHash=tt;exports.frFR=Qn;exports.fromObject=rn;exports.getAccessibleForeground=Ue;exports.getAuditLog=pn;exports.injectStyles=sn;exports.isRTL=no;exports.jaJP=to;exports.keyframes=on;exports.meetsAA=zt;exports.meetsAAA=an;exports.memoize=Zr;exports.prefersHighContrast=ur;exports.prefersReducedMotion=dr;exports.quantumDark=fr;exports.resetAtomicCSS=Uo;exports.responsive=nn;exports.sanitizeProps=xr;exports.sanitizeString=B;exports.tkx=b;exports.tx=Yo;exports.useAnnounce=hr;exports.useClickOutside=hn;exports.useDirection=sa;exports.useEscapeKey=Lt;exports.useFocusTrap=Dt;exports.useHighContrast=Ro;exports.useI18n=na;exports.useLocale=oa;exports.useReducedMotion=ye;exports.useTheme=ee;exports.useTkxCommand=Ji;exports.useToast=zs;exports.validateProps=At;exports.verifyAuditIntegrity=xn;
|
|
70
|
+
`}),t.jsx("div",{style:{width:s,height:s,minWidth:s,borderRadius:"50%",border:`${N}px solid ${R}`,backgroundColor:I,color:M,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...T,...j},children:k})]})}function Ur({completed:e,orientation:r,connectorStyle:n,connectorWidth:i,primary:s,border:a,reducedMotion:l}){const d=e?s:a;return r==="horizontal"?t.jsx("div",{"aria-hidden":"true",style:{flex:1,height:i,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(90deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):t.jsx("div",{"aria-hidden":"true",style:{width:i,flex:1,minHeight:20,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(180deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Un({steps:e,activeStep:r=0,orientation:n="horizontal",variant:i="default",size:s="md",clickable:a=!1,onStepClick:l,showStepNumbers:d=!0,alternateLabel:u=!1,connector:p="solid",className:o,style:m}){const x=ee(),h=ye(),y=Ui[s],z=($,w)=>$.status?$.status:w<r?"completed":w===r?"active":"pending",v=n==="horizontal";return t.jsx("div",{className:o,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:v?"row":"column",alignItems:v?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map(($,w)=>{const C=z($,w),I=w===e.length-1,R=C==="completed"||w<r,M=w%2===0,N=()=>{a&&(l==null||l(w))},T=t.jsx(qi,{status:C,index:w,showStepNumbers:d,icon:$.icon,circleSize:y.circle,fontSize:y.fontSize,primary:x.primary,danger:x.danger,success:x.success,text:x.text,textMuted:x.textMuted,border:x.border,surface:x.surface,variant:i,reducedMotion:h,clickable:a}),j=t.jsxs("div",{style:{textAlign:v&&!u?"center":"left",maxWidth:v?120:void 0},children:[t.jsxs("div",{style:{fontSize:y.titleSize,fontWeight:C==="active"?600:500,color:C==="pending"?x.textMuted:C==="error"?x.danger:x.text,lineHeight:1.3,transition:h?"none":"color 0.2s"},children:[B($.title),$.optional&&t.jsx("span",{style:{fontSize:y.descSize,color:x.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),$.description&&t.jsx("div",{style:{fontSize:y.descSize,color:x.textMuted,marginTop:2,lineHeight:1.4},children:B($.description)}),$.error&&C==="error"&&t.jsx("div",{style:{fontSize:y.descSize,color:x.danger,marginTop:2},children:B($.error)})]});return v?t.jsxs("div",{role:"listitem",style:{display:"flex",flex:I?0:1,alignItems:"center",minWidth:0},children:[t.jsxs("div",{onClick:N,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:a?"pointer":"default",flexShrink:0},"aria-current":C==="active"?"step":void 0,children:[u&&!M&&t.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:j}),T,!u&&j,u&&M&&t.jsx("div",{style:{marginTop:6},children:j})]}),!I&&t.jsx(Ur,{completed:R,orientation:"horizontal",connectorStyle:p,connectorWidth:y.connectorWidth,primary:x.primary,border:x.border,reducedMotion:h})]},$.id):t.jsxs("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[t.jsx("div",{onClick:N,style:{cursor:a?"pointer":"default"},"aria-current":C==="active"?"step":void 0,children:T}),!I&&t.jsx(Ur,{completed:R,orientation:"vertical",connectorStyle:p,connectorWidth:y.connectorWidth,primary:x.primary,border:x.border,reducedMotion:h})]}),t.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:I?0:16,flex:1,minWidth:0},children:j})]},$.id)})})}Un.displayName="TkxStepper";function Kn(e){let r=0,n=0,i=0;const s=e.replace("#","");s.length===3?(r=parseInt(s[0]+s[0],16),n=parseInt(s[1]+s[1],16),i=parseInt(s[2]+s[2],16)):s.length>=6&&(r=parseInt(s.slice(0,2),16),n=parseInt(s.slice(2,4),16),i=parseInt(s.slice(4,6),16)),r/=255,n/=255,i/=255;const a=Math.max(r,n,i),l=Math.min(r,n,i);let d=0,u=0;const p=(a+l)/2;if(a!==l){const o=a-l;switch(u=p>.5?o/(2-a-l):o/(a+l),a){case r:d=((n-i)/o+(n<i?6:0))/6;break;case n:d=((i-r)/o+2)/6;break;case i:d=((r-n)/o+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(p*100)]}function ir(e,r,n){r/=100,n/=100;const i=r*Math.min(n,1-n),s=a=>{const l=(a+e/30)%12,d=n-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function At(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(i)?0:i,isNaN(s)?0:s]}function Jt(e,r,n){return`#${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Je(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Qt(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[i,s,a]=At(e);if(n==="rgb")return r<1?`rgba(${i}, ${s}, ${a}, ${r.toFixed(2)})`:`rgb(${i}, ${s}, ${a})`;const[l,d,u]=Kn(e);return n==="hsl"?r<1?`hsla(${l}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${l}, ${d}%, ${u}%)`:e}const Zi=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Gi({hue:e,sat:r,bright:n,onChange:i}){const s=c.useRef(null),a=c.useRef(!1),l=c.useCallback(p=>{const o=s.current;if(!o)return;const m=o.getBoundingClientRect(),x=Math.max(0,Math.min(1,(p.clientX-m.left)/m.width)),h=Math.max(0,Math.min(1,(p.clientY-m.top)/m.height));i(Math.round(x*100),Math.round((1-h)*100))},[i]);c.useEffect(()=>{const p=m=>{a.current&&l(m)},o=()=>{a.current=!1};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",o)}},[l]);const d=`${r}%`,u=`${100-n}%`;return t.jsxs("div",{ref:s,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:p=>{a.current=!0,l(p)},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),t.jsx("div",{style:{position:"absolute",left:d,top:u,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:ir(e,r,n/2+25)}})]})}function Ji({hue:e,onChange:r}){const n=c.useRef(null),i=c.useRef(!1),s=c.useCallback(a=>{const l=n.current;if(!l)return;const d=l.getBoundingClientRect(),u=Math.max(0,Math.min(1,(a.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return c.useEffect(()=>{const a=d=>{i.current&&s(d)},l=()=>{i.current=!1};return document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)}},[s]),t.jsx("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:a=>{i.current=!0,s(a)},children:t.jsx("div",{style:{position:"absolute",left:`${e/360*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Qi({alpha:e,hex:r,onChange:n}){const i=c.useRef(null),s=c.useRef(!1),a=c.useCallback(p=>{const o=i.current;if(!o)return;const m=o.getBoundingClientRect(),x=Math.max(0,Math.min(1,(p.clientX-m.left)/m.width));n(Math.round(x*100)/100)},[n]);c.useEffect(()=>{const p=m=>{s.current&&a(m)},o=()=>{s.current=!1};return document.addEventListener("mousemove",p),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",o)}},[a]);const[l,d,u]=At(r);return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),t.jsx("div",{ref:i,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${l},${d},${u},0), rgba(${l},${d},${u},1))`},onMouseDown:p=>{s.current=!0,a(p)},children:t.jsx("div",{style:{position:"absolute",left:`${e*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${l},${d},${u},${e})`,pointerEvents:"none"}})})]})}function ea({value:e,defaultValue:r="#3b82f6",onChange:n,format:i="hex",showAlpha:s=!1,presets:a=Zi,disabled:l=!1,size:d="md",placeholder:u,label:p,style:o}){const m=ee(),x=c.useRef(null),h=c.useRef(null),[y,z]=c.useState(!1),v=e!==void 0,[$,w]=c.useState(v&&e||r),C=v?e||r:$,[I,R]=c.useState(1),[M,N]=c.useState(C),[T,j]=c.useState({top:0,left:0}),[k,Y,f]=Kn(Je(C)?C:r),g=c.useCallback((X,Z=I)=>{Je(X)&&(N(X),v||w(X),n==null||n(Qt(X,Z,i),i))},[I,v,i,n]);c.useEffect(()=>{v&&e&&Je(e)&&N(e)},[v,e]);const S=()=>{if(l)return;const X=x.current;if(!X)return;const Z=X.getBoundingClientRect(),we=window.innerHeight-Z.bottom>320?Z.bottom+6:Z.top-326;j({top:we+window.scrollY,left:Z.left+window.scrollX}),z(!0)};c.useEffect(()=>{if(!y)return;const X=Z=>{h.current&&!h.current.contains(Z.target)&&x.current&&!x.current.contains(Z.target)&&z(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[y]),c.useEffect(()=>{if(!y)return;const X=Z=>{Z.key==="Escape"&&z(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]);const F=(X,Z)=>{const ve=Z/100,we=X/100,de=ve*(1-we/2),ge=de===0||de===1?0:(ve-de)/Math.min(de,1-de),J=ir(k,Math.round(ge*100),Math.round(de*100));g(J)},D=X=>{const Z=ir(X,Y,f);g(Z)},V=X=>{R(X),n==null||n(Qt(C,X,i),i)},E=X=>{const Z=X.target.value;N(Z),Je(Z)&&g(Z)},P=(X,Z)=>{const ve=Math.max(0,Math.min(255,parseInt(Z)||0)),[we,de,ge]=At(C),J=X==="r"?Jt(ve,de,ge):X==="g"?Jt(we,ve,ge):Jt(we,de,ve);g(J)},O={sm:28,md:34,lg:40}[d],[A,H,Q]=At(Je(C)?C:r),G={display:"inline-flex",alignItems:"center",gap:"8px",height:`${O}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:l?"not-allowed":"pointer",opacity:l?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...o},ne={width:`${O-8}px`,height:`${O-8}px`,borderRadius:"4px",backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`,flexShrink:0},pe={position:"absolute",top:T.top,left:T.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},xe={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},oe={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},me=X=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:X,border:X.toLowerCase()===C.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return t.jsxs(t.Fragment,{children:[p&&t.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:p}),t.jsxs("button",{ref:x,type:"button",style:G,onClick:S,disabled:l,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":"dialog","aria-expanded":y,children:[t.jsx("div",{style:ne}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Qt(Je(C)?C:r,I,i)})]}),y&&Be.createPortal(t.jsxs("div",{ref:h,style:pe,role:"dialog","aria-label":"Color picker",children:[t.jsx(Gi,{hue:k,sat:Y,bright:f,onChange:F}),t.jsx(Ji,{hue:k,onChange:D}),s&&t.jsx(Qi,{alpha:I,hex:Je(C)?C:r,onChange:V}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`}}),t.jsx("input",{style:xe,value:M,onChange:E,maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(X=>{const Z=X==="r"?A:X==="g"?H:Q;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:255,value:Z,onChange:ve=>P(X,ve.target.value),"aria-label":`${X.toUpperCase()} channel`}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:X})]},X)}),s&&t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:100,value:Math.round(I*100),onChange:X=>V(Math.max(0,Math.min(1,parseInt(X.target.value)/100||0))),"aria-label":"Alpha channel"}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),a.length>0&&t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:a.map(X=>t.jsx("button",{type:"button",style:me(X),onClick:()=>g(X),"aria-label":`Select color ${X}`,onMouseEnter:Z=>{Z.currentTarget.style.transform="scale(1.15)"},onMouseLeave:Z=>{Z.currentTarget.style.transform="scale(1)"}},X))})]})]}),document.body)]})}const ta={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Kr(e,r,n){let i=e;return r!==void 0&&(i=Math.max(i,r)),n!==void 0&&(i=Math.min(i,n)),i}function er(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function ra(e,r,n,i,s){const a=i??"en-US";return r==="currency"?new Intl.NumberFormat(a,{style:"currency",currency:n??"USD",minimumFractionDigits:s??2,maximumFractionDigits:s??2}).format(e):r==="percent"?new Intl.NumberFormat(a,{style:"percent",minimumFractionDigits:s??0,maximumFractionDigits:s??0}).format(e/100):r==="decimal"||s!==void 0?new Intl.NumberFormat(a,{minimumFractionDigits:s??0,maximumFractionDigits:s??20}).format(e):String(e)}function Xr({direction:e,isDisabled:r,btnW:n,height:i,primaryColor:s,borderColor:a,textMuted:l,iconSz:d,onStep:u}){const p=c.useRef(null),o=c.useRef(null),m=e==="inc"?1:-1,x=c.useCallback(()=>{u(m),p.current=setTimeout(()=>{o.current=setInterval(()=>u(m),60)},400)},[m,u]),h=c.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),o.current&&(clearInterval(o.current),o.current=null)},[]);c.useEffect(()=>()=>h(),[h]);const y=e==="inc";return t.jsx("button",{type:"button","aria-label":y?"Increment":"Decrement",disabled:r,onMouseDown:x,onMouseUp:h,onMouseLeave:h,onTouchStart:z=>{z.preventDefault(),x()},onTouchEnd:h,style:{width:n,height:i,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:y?void 0:`1px solid ${a}`,borderLeft:y?`1px solid ${a}`:void 0,cursor:r?"not-allowed":"pointer",color:r?l:s,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:z=>{r||(z.currentTarget.style.background=`${s}12`)},onBlur:z=>{z.currentTarget.style.background="transparent"},children:y?t.jsxs("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsx("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function Xn({value:e,defaultValue:r=0,onChange:n,min:i,max:s,step:a=1,precision:l,prefix:d,suffix:u,format:p,currency:o,locale:m,clampOnBlur:x=!0,allowMouseWheel:h=!1,size:y="md",label:z,hint:v,isDisabled:$=!1,isReadOnly:w=!1,isInvalid:C=!1,errorMessage:I,id:R,className:M,style:N}){const T=ee(),j=c.useId(),k=R??j,Y=`${k}-hint`,f=`${k}-error`,g=e!==void 0,[S,F]=c.useState(r),D=g?e:S,[V,E]=c.useState(!1),[P,W]=c.useState(""),O=ta[y],A=C||!!I,H=A?T.danger:V?T.primary:T.border,Q=[v&&Y,A&&f].filter(Boolean).join(" ")||void 0,G=z?B(z):void 0,ne=v?B(v):void 0,pe=I?B(I):void 0,xe=d?B(d):void 0,oe=u?B(u):void 0,me=c.useCallback(re=>{const q=er(re,l);g||F(q),n==null||n(q)},[g,n,l]),X=c.useCallback(re=>{if($||w)return;const q=Kr(er(D+re*a,l),i,s);me(q)},[$,w,D,a,l,i,s,me]),Z=()=>{E(!0),W(String(D))},ve=()=>{E(!1);const re=parseFloat(P);if(isNaN(re)){n==null||n(null),W(String(D));return}let q=er(re,l);x&&(q=Kr(q,i,s)),me(q)},we=re=>{W(re.target.value)},de=re=>{re.key==="ArrowUp"&&(re.preventDefault(),X(1)),re.key==="ArrowDown"&&(re.preventDefault(),X(-1))},ge=re=>{!h||!V||(re.preventDefault(),X(re.deltaY<0?1:-1))},J=V?P:ra(D,p,o,m,l),ie=(xe||oe)&&!V;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),M),style:N,children:[G&&t.jsx("label",{htmlFor:k,className:b("text-sm font-medium font-sans"),style:{color:T.text},children:G}),t.jsxs("div",{className:b("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${H}`,backgroundColor:$?T.surfaceAlt:T.surface,opacity:$?.65:1,height:O.height},children:[t.jsx(Xr,{direction:"dec",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.iconSz,onStep:X}),t.jsxs("div",{className:b("relative flex-1 flex items-center overflow-hidden"),children:[ie&&xe&&t.jsx("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:k,type:"text",inputMode:"decimal",value:V?P:J,readOnly:w,disabled:$,"aria-invalid":A,"aria-describedby":Q,"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":D,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:T.text,paddingLeft:ie&&xe?`calc(${O.px} + 1.2em)`:O.px,paddingRight:ie&&oe?`calc(${O.px} + 1.2em)`:O.px,cursor:$?"not-allowed":w?"default":"text"},onFocus:Z,onBlur:ve,onChange:we,onKeyDown:de,onWheel:ge}),ie&&oe&&t.jsx("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:oe})]}),t.jsx(Xr,{direction:"inc",isDisabled:$||w,btnW:O.btnW,height:O.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:O.iconSz,onStep:X})]}),ne&&!pe&&t.jsx("span",{id:Y,className:b("text-xs"),style:{color:T.textMuted},children:ne}),pe&&t.jsxs("span",{id:f,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:T.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),pe]})]})}Xn.displayName="TkxNumberInput";const na={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},oa={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function qr(e,r){return oa[r].test(e)?e.toUpperCase():""}function qn({length:e=6,value:r,onChange:n,onComplete:i,type:s="number",mask:a=!1,autoFocus:l=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:p,hint:o,size:m="md",separator:x,separatorPosition:h,className:y,style:z}){const v=ee(),$=c.useId(),w=`${$}-hint`,C=`${$}-error`,I=r!==void 0,R=A=>{const H=A.split("").slice(0,e);for(;H.length<e;)H.push("");return H},[M,N]=c.useState(()=>R(I?r:"")),T=I?R(r):M,j=c.useRef([]),k=na[m],Y=u||!!p,f=T.every(A=>A!==""),g=o?B(o):void 0,S=p?B(p):void 0,F=A=>Y?v.danger:f?v.success:v.border;c.useEffect(()=>{var A;l&&((A=j.current[0])==null||A.focus())},[]);const D=c.useCallback(A=>{I||N(A);const H=A.join("");n==null||n(H),A.every(Q=>Q!=="")&&(i==null||i(H))},[I,n,i]),V=A=>{var Q;const H=Math.max(0,Math.min(e-1,A));(Q=j.current[H])==null||Q.focus()},E=A=>H=>{if(!d){if(H.key==="Backspace"){if(H.preventDefault(),T[A]!==""){const Q=[...T];Q[A]="",D(Q)}else if(A>0){const Q=[...T];Q[A-1]="",D(Q),V(A-1)}return}if(H.key==="Delete"){H.preventDefault();const Q=[...T];Q[A]="",D(Q);return}if(H.key==="ArrowLeft"){H.preventDefault(),V(A-1);return}if(H.key==="ArrowRight"){H.preventDefault(),V(A+1);return}if(H.key==="Home"){H.preventDefault(),V(0);return}if(H.key==="End"){H.preventDefault(),V(e-1);return}}},P=A=>H=>{if(d)return;const G=H.target.value.slice(-1);if(!G)return;const ne=qr(G,s);if(!ne)return;const pe=[...T];pe[A]=ne,D(pe),A<e-1&&V(A+1)},W=A=>H=>{if(H.preventDefault(),d)return;const G=H.clipboardData.getData("text").split("").map(xe=>qr(xe,s)).filter(Boolean);if(!G.length)return;const ne=[...T];let pe=A;for(const xe of G){if(pe>=e)break;ne[pe]=xe,pe++}D(ne),V(Math.min(pe,e-1))},O=[g&&w,Y&&C].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ue(b("flex flex-col gap-2 w-fit"),y),style:z,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":O,className:b("flex items-center"),style:{gap:k.gap},children:Array.from({length:e},(A,H)=>{const Q=F();return typeof document<"u"&&(document.activeElement,j.current[H]),t.jsxs("div",{className:b("flex items-center"),style:{gap:k.gap},children:[x&&h===H&&H!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:v.textMuted,userSelect:"none",flexShrink:0},children:x}),t.jsx("input",{ref:G=>{j.current[H]=G},type:a?"password":"text",inputMode:s==="number"?"numeric":"text",maxLength:1,value:T[H],disabled:d,"aria-label":`Digit ${H+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:P(H),onKeyDown:E(H),onPaste:W(H),onFocus:G=>G.target.select(),style:{width:k.box,height:k.box,textAlign:"center",fontSize:k.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?v.surfaceAlt:v.surface,color:v.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:G=>{d||(G.currentTarget.style.borderColor=Y?v.danger:v.primary,G.currentTarget.style.boxShadow=`0 0 0 3px ${Y?v.danger:v.primary}33`)},onBlurCapture:G=>{G.currentTarget.style.borderColor=F(),G.currentTarget.style.boxShadow="none"}})]},H)})}),g&&!S&&t.jsx("span",{id:w,className:b("text-xs"),style:{color:v.textMuted},children:g}),S&&t.jsxs("span",{id:C,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:v.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),S]})]})}qn.displayName="TkxOTP";function sa(e,r){c.useEffect(()=>{if(!r)return;const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r])}function ia(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=r.current,i=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],a=i[i.length-1],l=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===s&&(d.preventDefault(),a==null||a.focus()):document.activeElement===a&&(d.preventDefault(),s==null||s.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),r}function aa(){const[e,r]=c.useState(!1),n=c.useCallback(()=>r(!0),[]),i=c.useCallback(()=>r(!1),[]),s=c.useCallback(()=>r(a=>!a),[]);return{isOpen:e,open:n,close:i,toggle:s}}function tr(e,r){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),i=r.toLowerCase(),s=i.indexOf(n);if(s!==-1)return{matched:!0,ranges:[[s,s+n.length-1]],score:s===0?100:80};const a=[];let l=0,d=-1,u=-1;for(let p=0;p<i.length&&l<n.length;p++)i[p]===n[l]&&((u===-1||p!==u+1)&&(d!==-1&&a.push([d,u]),d=p),u=p,l++);return d!==-1&&u!==-1&&a.push([d,u]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:a,score:40}}function la(e,r){if(!e.trim())return r.filter(i=>!i.disabled).map(i=>({item:i,score:0,labelRanges:[]}));const n=[];for(const i of r){if(i.disabled)continue;const s=tr(e,i.label),a=i.description?tr(e,i.description):{matched:!1,score:0},l=(i.keywords??[]).some(d=>tr(e,d).matched);s.matched?n.push({item:i,score:s.score+20,labelRanges:s.ranges}):a.matched?n.push({item:i,score:a.score,labelRanges:[]}):l&&n.push({item:i,score:20,labelRanges:[]})}return n.sort((i,s)=>s.score-i.score)}function ca({text:e,ranges:r,color:n}){if(!r.length)return t.jsx(t.Fragment,{children:e});const i=[];let s=0;for(const[a,l]of r)s<a&&i.push(t.jsx("span",{children:e.slice(s,a)},`t-${s}`)),i.push(t.jsx("span",{style:{color:n,fontWeight:700},children:e.slice(a,l+1)},`h-${a}`)),s=l+1;return s<e.length&&i.push(t.jsx("span",{children:e.slice(s)},"t-end")),t.jsx(t.Fragment,{children:i})}function da({surface:e,border:r}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[t.jsx("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[t.jsx("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function Zn({items:e,isOpen:r=!1,onClose:n,placeholder:i="Type a command or search…",emptyMessage:s,maxItems:a=8,onItemSelect:l,className:d,style:u}){const p=ee(),[o,m]=c.useState(""),[x,h]=c.useState(0),[y,z]=c.useState(!1),v=c.useRef(null),$=c.useRef(null),w=c.useId(),C=ia(r),I=la(o,e).slice(0,a),R=[];for(const f of I){const g=f.item.group,S=R.find(F=>F.group===g);S?S.items.push(f):R.push({group:g,items:[f]})}const M=R.flatMap(f=>f.items);sa(()=>{n==null||n()},r),c.useEffect(()=>{r&&(m(""),h(0),setTimeout(()=>{var f;return(f=v.current)==null?void 0:f.focus()},30))},[r]),c.useEffect(()=>{x>=M.length&&h(Math.max(0,M.length-1))},[M.length,x]);const N=c.useCallback(f=>{const g=$.current;if(!g)return;const S=g.querySelectorAll("[data-command-item]")[f];S==null||S.scrollIntoView({block:"nearest"})},[]),T=f=>{if(f.key==="ArrowDown"){f.preventDefault();const g=Math.min(M.length-1,x+1);h(g),N(g)}else if(f.key==="ArrowUp"){f.preventDefault();const g=Math.max(0,x-1);h(g),N(g)}else if(f.key==="Enter"){f.preventDefault();const g=M[x];g&&j(g.item)}},j=f=>{var g;f.disabled||((g=f.onSelect)==null||g.call(f),l==null||l(f),n==null||n())};if(!r||typeof document>"u")return null;const k=B(i),Y=s?B(s):`No results for "${B(o)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const f=document.createElement("style");f.id="tkx-shimmer-style",f.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(f)}return Be.createPortal(t.jsxs("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[t.jsx("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),t.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:w,className:ue(d),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:p.surface,border:`1px solid ${p.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${p.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...u},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${p.border}`},children:[t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:p.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),t.jsx("input",{ref:v,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":M[x]?`${w}-item-${M[x].item.id}`:void 0,value:o,onChange:f=>{m(f.target.value),h(0)},onKeyDown:T,placeholder:k,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:p.text}}),o&&t.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var f;m(""),h(0),(f=v.current)==null||f.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:p.textMuted,display:"flex",alignItems:"center",padding:0},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{id:`${w}-list`,ref:$,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(f,g)=>t.jsx(da,{surface:p.surface,border:p.border},g)):M.length===0?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:p.textMuted},children:[t.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),t.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),t.jsx("span",{style:{fontSize:"0.875rem"},children:Y})]}):R.map(({group:f,items:g},S)=>{const F=R.slice(0,S).reduce((D,V)=>D+V.items.length,0);return t.jsxs("div",{children:[f&&t.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:p.textMuted,padding:"10px 12px 4px"},children:B(f)}),g.map((D,V)=>{const E=F+V,P=E===x,W=D.item;return t.jsxs("div",{id:`${w}-item-${W.id}`,role:"option","aria-selected":P,"aria-disabled":W.disabled,"data-command-item":!0,onClick:()=>j(W),onMouseEnter:()=>h(E),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:W.disabled?"not-allowed":"pointer",opacity:W.disabled?.45:1,backgroundColor:P?`${p.primary}18`:"transparent",borderLeft:P?`2px solid ${p.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[W.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:P?p.primary:p.textMuted},children:W.icon}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:p.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.jsx(ca,{text:W.label,ranges:D.labelRanges,color:p.primary})}),W.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:p.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:B(W.description)})]}),W.shortcut&&t.jsx("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:p.textMuted,backgroundColor:p.surfaceAlt,border:`1px solid ${p.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:B(W.shortcut)})]},W.id)})]},f??"__default__")})}),M.length>0&&t.jsxs("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${p.border}`,fontSize:"0.6875rem",color:p.textMuted},children:[t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}Zn.displayName="TkxCommand";function Et({direction:e,onClick:r,isDisabled:n,primaryColor:i,position:s,orientation:a}){const l=a==="vertical",d=e==="prev",u=s==="inside"?{position:"absolute",zIndex:3,...l?{[d?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[d?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return t.jsx("button",{type:"button","aria-label":d?"Previous slide":"Next slide",disabled:n,onClick:r,style:{...u,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:p=>{p.currentTarget.style.boxShadow=`0 0 0 3px ${i}55`},onBlur:p=>{p.currentTarget.style.boxShadow="none"},onMouseEnter:p=>{n||(p.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"18 15 12 9 6 15"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})}function Gn({slides:e,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:i=!0,loop:s=!0,showArrows:a=!0,showDots:l=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:p=1,gap:o=0,transitionDuration:m=400,swipeable:x=!0,initialIndex:h=0,onChange:y,arrowPosition:z="inside",height:v=320,className:$,style:w}){const C=ee(),I=ye(),R=c.useId(),M=e.length,[N,T]=c.useState(h),[j,k]=c.useState(s?h+1:h),[Y,f]=c.useState(!1),[g,S]=c.useState(!1),F=c.useRef(null),D=c.useRef(null),V=c.useRef(null),E=c.useRef(0),P=c.useRef(!1),W=u==="vertical",O=I?0:m,A=s&&M>1?[e[M-1],...e,e[0]]:e,H=A.length,Q=100/p,G=(q,te=0)=>{const be=te!==0?` - ${te}px`:"";return W?`translateY(calc(-${q*Q}%${be}))`:`translateX(calc(-${q*Q}%${be}))`},ne=c.useCallback((q,te=!1)=>{const be=s?(q%M+M)%M:Math.max(0,Math.min(M-1,q)),$e=s?be+1:be;te&&F.current?(F.current.style.transition="none",k($e),T(be),F.current.offsetHeight,F.current.style.transition=""):(f(!0),k($e),T(be)),y==null||y(be)},[M,s,y]),pe=c.useCallback(()=>ne(N-1),[N,ne]),xe=c.useCallback(()=>ne(N+1),[N,ne]),oe=c.useCallback(()=>{f(!1),!(!s||M<=1)&&(j===0?ne(M-1,!0):j===H-1&&ne(0,!0))},[s,M,j,H,ne]);c.useEffect(()=>{if(!(!r||g||M<=1))return D.current=setInterval(xe,n),()=>{D.current&&clearInterval(D.current)}},[r,g,n,xe,M]),c.useEffect(()=>{const q=te=>{const be=document.activeElement,$e=document.getElementById(R);$e!=null&&$e.contains(be)&&(te.key===(W?"ArrowUp":"ArrowLeft")&&(te.preventDefault(),pe()),te.key===(W?"ArrowDown":"ArrowRight")&&(te.preventDefault(),xe()))};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[R,W,pe,xe]);const me=q=>"touches"in q?W?q.touches[0].clientY:q.touches[0].clientX:W?q.clientY:q.clientX,X=q=>{x&&(V.current=me(q),E.current=0,P.current=!0)},Z=q=>{if(!P.current||V.current===null)return;const te=me(q)-V.current;E.current=te,F.current&&(F.current.style.transition="none",F.current.style.transform=G(j,-te))},ve=()=>{if(!P.current)return;P.current=!1;const q=E.current,te=50;F.current&&(F.current.style.transition="",F.current.style.transform=""),q<-te?xe():q>te?pe():F.current&&(F.current.style.transform=G(j)),V.current=null,E.current=0},we=typeof v=="number"?`${v}px`:v,de={display:"flex",flexDirection:W?"column":"row",width:W?"100%":`${H/p*100}%`,height:W?`${H/p*100}%`:"100%",transform:G(j),transition:Y||!I?`transform ${O}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:o>0?o:void 0},ge={flexShrink:0,width:W?"100%":`${Q/(H/p)}%`,height:W?`${Q/(H/p)}%`:"100%",overflow:"hidden",position:"relative"},J=s||N>0,ie=s||N<M-1,re=z==="outside";return t.jsxs("div",{id:R,className:ue(b("flex flex-col gap-2"),$),style:w,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[t.jsxs("div",{className:b("flex items-center gap-2"),style:{gap:re&&a?8:0},children:[a&&re&&t.jsx(Et,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:we,borderRadius:12,cursor:x?P.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>i&&S(!0),onMouseLeave:()=>{S(!1),ve()},onTouchStart:X,onTouchMove:Z,onTouchEnd:ve,onMouseDown:X,onMouseMove:Z,onMouseUp:ve,"aria-live":"polite","aria-atomic":"false",children:[a&&!re&&t.jsxs(t.Fragment,{children:[t.jsx(Et,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"inside",orientation:u}),t.jsx(Et,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"inside",orientation:u})]}),t.jsx("div",{ref:F,style:de,onTransitionEnd:oe,children:A.map((q,te)=>t.jsx("div",{style:ge,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(te-(s?1:0)+M)%M+1} of ${M}`,"aria-hidden":(te-(s?1:0)+M)%M!==N,children:q.content},`${q.id}-${te}`))}),l&&!d&&t.jsx("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((q,te)=>t.jsx("button",{type:"button","aria-label":`Go to slide ${te+1}`,"aria-current":te===N?"true":void 0,onClick:()=>ne(te),style:{width:te===N?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:te===N?C.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}66`},onBlur:be=>{be.currentTarget.style.boxShadow="none"}},q.id))})]}),a&&re&&t.jsx(Et,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"outside",orientation:u})]}),d&&t.jsx("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((q,te)=>t.jsxs("button",{type:"button",role:"tab","aria-selected":te===N,"aria-label":`Thumbnail for slide ${te+1}`,onClick:()=>ne(te),style:{flexShrink:0,width:60,height:42,border:`2px solid ${te===N?C.primary:C.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:C.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}55`},onBlur:be=>{be.currentTarget.style.boxShadow="none"},children:[q.thumbnail?t.jsx("img",{src:q.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:C.textMuted,fontWeight:600},children:te+1}),te===N&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${C.primary}22`}})]},q.id))})]})}Gn.displayName="TkxCarousel";const Pt={close:"Close",cancel:"Cancel",confirm:"Confirm",save:"Save",delete:"Delete",search:"Search",loading:"Loading...",noResults:"No results found",required:"Required",previous:"Previous",next:"Next",pageOf:(e,r)=>`Page ${e} of ${r}`,selectPlaceholder:"Select...",clearSelection:"Clear selection",selectDate:"Select a date",today:"Today",dropFiles:"Drop files here or",browse:"Browse",noData:"No data available",sortAscending:"Sort ascending",sortDescending:"Sort descending"},Jn={close:"Cerrar",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",delete:"Eliminar",search:"Buscar",loading:"Cargando...",noResults:"No se encontraron resultados",required:"Requerido",previous:"Anterior",next:"Siguiente",pageOf:(e,r)=>`Página ${e} de ${r}`,selectPlaceholder:"Seleccionar...",clearSelection:"Limpiar selección",selectDate:"Seleccionar fecha",today:"Hoy",dropFiles:"Suelte archivos aquí o",browse:"Explorar",noData:"No hay datos disponibles",sortAscending:"Orden ascendente",sortDescending:"Orden descendente"},Qn={close:"إغلاق",cancel:"إلغاء",confirm:"تأكيد",save:"حفظ",delete:"حذف",search:"بحث",loading:"...جارٍ التحميل",noResults:"لم يتم العثور على نتائج",required:"مطلوب",previous:"السابق",next:"التالي",pageOf:(e,r)=>`صفحة ${e} من ${r}`,selectPlaceholder:"...اختر",clearSelection:"مسح الاختيار",selectDate:"اختر تاريخ",today:"اليوم",dropFiles:"أفلت الملفات هنا أو",browse:"تصفح",noData:"لا توجد بيانات",sortAscending:"ترتيب تصاعدي",sortDescending:"ترتيب تنازلي"},eo={close:"Fermer",cancel:"Annuler",confirm:"Confirmer",save:"Enregistrer",delete:"Supprimer",search:"Rechercher",loading:"Chargement...",noResults:"Aucun résultat trouvé",required:"Obligatoire",previous:"Précédent",next:"Suivant",pageOf:(e,r)=>`Page ${e} sur ${r}`,selectPlaceholder:"Sélectionner...",clearSelection:"Effacer la sélection",selectDate:"Sélectionner une date",today:"Aujourd'hui",dropFiles:"Déposez les fichiers ici ou",browse:"Parcourir",noData:"Aucune donnée disponible",sortAscending:"Tri croissant",sortDescending:"Tri décroissant"},to={close:"Schließen",cancel:"Abbrechen",confirm:"Bestätigen",save:"Speichern",delete:"Löschen",search:"Suchen",loading:"Wird geladen...",noResults:"Keine Ergebnisse gefunden",required:"Erforderlich",previous:"Zurück",next:"Weiter",pageOf:(e,r)=>`Seite ${e} von ${r}`,selectPlaceholder:"Auswählen...",clearSelection:"Auswahl löschen",selectDate:"Datum auswählen",today:"Heute",dropFiles:"Dateien hier ablegen oder",browse:"Durchsuchen",noData:"Keine Daten verfügbar",sortAscending:"Aufsteigend sortieren",sortDescending:"Absteigend sortieren"},ro={close:"閉じる",cancel:"キャンセル",confirm:"確認",save:"保存",delete:"削除",search:"検索",loading:"読み込み中...",noResults:"結果が見つかりません",required:"必須",previous:"前へ",next:"次へ",pageOf:(e,r)=>`${r}ページ中${e}ページ`,selectPlaceholder:"選択...",clearSelection:"選択解除",selectDate:"日付を選択",today:"今日",dropFiles:"ファイルをドロップまたは",browse:"参照",noData:"データなし",sortAscending:"昇順",sortDescending:"降順"},no={"en-US":Pt,"es-ES":Jn,"ar-SA":Qn,"fr-FR":eo,"de-DE":to,"ja-JP":ro},ua=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function oo(e){return ua.has(e)}const ht=c.createContext({locale:"en-US",direction:"ltr",strings:Pt});function fa(){return c.useContext(ht)}function pa(){return c.useContext(ht).strings}function xa(){return c.useContext(ht).direction}function ha({locale:e="en-US",direction:r,strings:n,children:i}){const s=c.useMemo(()=>{const a=no[e]??Pt,l=n?{...a,...n}:a,d=r??(oo(e)?"rtl":"ltr");return{locale:e,direction:d,strings:l}},[e,r,n]);return t.jsx(ht.Provider,{value:s,children:t.jsx("div",{dir:s.direction,style:{direction:s.direction},children:i})})}function ma({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function ga({politeness:e="polite",children:r,atomic:n=!0}){return t.jsx("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:r})}function ba({active:e,children:r,as:n="div"}){const i=Lt(e);return t.jsx(n,{ref:i,children:r})}function ya({as:e,children:r,...n}){const i=e??"span";return t.jsx(i,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=ba;exports.I18nContext=ht;exports.I18nProvider=ha;exports.LOCALES=no;exports.LRUCache=Zr;exports.LiveRegion=ga;exports.Quantum=ho;exports.Shield=Ho;exports.SkipNav=ma;exports.TKX=yo;exports.ThemeContext=xr;exports.ThemeProvider=To;exports.TkxAccordion=Dn;exports.TkxAlert=ms;exports.TkxAvatar=Cn;exports.TkxBadge=wn;exports.TkxButton=yn;exports.TkxCard=vn;exports.TkxCardBody=ls;exports.TkxCardFooter=cs;exports.TkxCardHeader=as;exports.TkxCarousel=Gn;exports.TkxChat=Ci;exports.TkxChatBubble=Wn;exports.TkxCheckbox=En;exports.TkxClock=Yn;exports.TkxColorPicker=ea;exports.TkxCommand=Zn;exports.TkxDatePicker=Ln;exports.TkxDivider=Tn;exports.TkxDrawer=Js;exports.TkxFileUpload=mi;exports.TkxImage=fi;exports.TkxInput=kn;exports.TkxMenu=On;exports.TkxModal=ys;exports.TkxNumberInput=Xn;exports.TkxOTP=qn;exports.TkxPagination=Pn;exports.TkxProgress=jn;exports.TkxRadio=Nn;exports.TkxRadioGroup=Fs;exports.TkxRating=ji;exports.TkxSelect=In;exports.TkxSkeleton=gr;exports.TkxSlider=Fn;exports.TkxStepper=Un;exports.TkxTab=ws;exports.TkxTabList=ks;exports.TkxTabPanel=Ss;exports.TkxTabPanels=js;exports.TkxTable=Es;exports.TkxTabs=vs;exports.TkxTag=Hn;exports.TkxTagInput=Ri;exports.TkxThinkingIndicator=Bn;exports.TkxTimeline=Li;exports.TkxToastProvider=_s;exports.TkxToggle=Sn;exports.TkxTooltip=Ms;exports.TkxVideoPlayer=_n;exports.VisuallyHidden=ya;exports.WCAGEngine=So;exports.arSA=Qn;exports.audit=pn;exports.auroraLight=$o;exports.batchUpdate=Qr;exports.breakpoints=Ro;exports.contrastRatio=at;exports.createFocusTrap=dr;exports.createTheme=Co;exports.css=rn;exports.cssVar=lr;exports.cx=ue;exports.deDE=to;exports.enUS=Pt;exports.esES=Jn;exports.extractAtomicCSS=es;exports.extractCSS=cr;exports.fnv1aHash=rt;exports.frFR=eo;exports.fromObject=nn;exports.generatePalette=Eo;exports.getAccessibleForeground=Ke;exports.getAuditLog=xn;exports.injectStyles=an;exports.isRTL=oo;exports.jaJP=ro;exports.keyframes=sn;exports.meetsAA=Nt;exports.meetsAAA=ln;exports.memoize=Gr;exports.prefersHighContrast=fr;exports.prefersReducedMotion=ur;exports.quantumDark=pr;exports.radii=Lo;exports.resetAtomicCSS=ts;exports.responsive=on;exports.sanitizeProps=hr;exports.sanitizeString=B;exports.shadows=Ao;exports.spacing=No;exports.tkx=b;exports.tx=Qo;exports.typography=zo;exports.useAnnounce=mr;exports.useClickOutside=mn;exports.useDirection=xa;exports.useEscapeKey=Ft;exports.useFocusTrap=Lt;exports.useHighContrast=Vo;exports.useI18n=fa;exports.useLocale=pa;exports.useReducedMotion=ye;exports.useTheme=ee;exports.useTkxCommand=aa;exports.useToast=Ws;exports.validateProps=Dt;exports.verifyAuditIntegrity=hn;exports.zIndex=Do;
|