tekivex-ui 2.3.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/TkxForm-BWK4LqY3.js +1461 -0
  2. package/dist/TkxForm-ljQjX7KD.cjs +15 -0
  3. package/dist/charts.cjs +1 -0
  4. package/dist/charts.js +480 -0
  5. package/dist/headless.cjs +1 -0
  6. package/dist/headless.js +258 -0
  7. package/dist/index-BINBzXuY.cjs +2 -0
  8. package/dist/index-eT_U4qB2.js +512 -0
  9. package/dist/index.cjs +20 -32
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +7942 -8903
  13. package/dist/src/charts/TkxAreaChart.d.ts +29 -0
  14. package/dist/src/charts/TkxAreaChart.d.ts.map +1 -0
  15. package/dist/src/charts/TkxBarChart.d.ts +28 -0
  16. package/dist/src/charts/TkxBarChart.d.ts.map +1 -0
  17. package/dist/src/charts/TkxDonutChart.d.ts +23 -0
  18. package/dist/src/charts/TkxDonutChart.d.ts.map +1 -0
  19. package/dist/src/charts/TkxLineChart.d.ts +35 -0
  20. package/dist/src/charts/TkxLineChart.d.ts.map +1 -0
  21. package/dist/src/charts/TkxPieChart.d.ts +19 -0
  22. package/dist/src/charts/TkxPieChart.d.ts.map +1 -0
  23. package/dist/src/charts/TkxRadarChart.d.ts +20 -0
  24. package/dist/src/charts/TkxRadarChart.d.ts.map +1 -0
  25. package/dist/src/charts/TkxScatterChart.d.ts +28 -0
  26. package/dist/src/charts/TkxScatterChart.d.ts.map +1 -0
  27. package/dist/src/charts/index.d.ts +15 -0
  28. package/dist/src/charts/index.d.ts.map +1 -0
  29. package/dist/src/charts/shared.d.ts +33 -0
  30. package/dist/src/charts/shared.d.ts.map +1 -0
  31. package/dist/src/components/TkxDataGrid.d.ts +16 -2
  32. package/dist/src/components/TkxDataGrid.d.ts.map +1 -1
  33. package/dist/src/components/TkxForm.d.ts +33 -3
  34. package/dist/src/components/TkxForm.d.ts.map +1 -1
  35. package/dist/src/components/TkxImage.d.ts.map +1 -1
  36. package/dist/src/components/TkxTypography.d.ts +1 -1
  37. package/dist/src/components/TkxTypography.d.ts.map +1 -1
  38. package/dist/src/engine/tkx.d.ts.map +1 -1
  39. package/dist/src/headless/index.d.ts +18 -0
  40. package/dist/src/headless/index.d.ts.map +1 -0
  41. package/dist/src/headless/useControllable.d.ts +20 -0
  42. package/dist/src/headless/useControllable.d.ts.map +1 -0
  43. package/dist/src/headless/useDebounce.d.ts +14 -0
  44. package/dist/src/headless/useDebounce.d.ts.map +1 -0
  45. package/dist/src/headless/useDisclosure.d.ts +20 -0
  46. package/dist/src/headless/useDisclosure.d.ts.map +1 -0
  47. package/dist/src/headless/useFormState.d.ts +44 -0
  48. package/dist/src/headless/useFormState.d.ts.map +1 -0
  49. package/dist/src/headless/useIntersectionObserver.d.ts +23 -0
  50. package/dist/src/headless/useIntersectionObserver.d.ts.map +1 -0
  51. package/dist/src/headless/useListSelection.d.ts +29 -0
  52. package/dist/src/headless/useListSelection.d.ts.map +1 -0
  53. package/dist/src/headless/useLocalStorage.d.ts +9 -0
  54. package/dist/src/headless/useLocalStorage.d.ts.map +1 -0
  55. package/dist/src/headless/useMediaQuery.d.ts +21 -0
  56. package/dist/src/headless/useMediaQuery.d.ts.map +1 -0
  57. package/dist/src/headless/useRovingTabIndex.d.ts +33 -0
  58. package/dist/src/headless/useRovingTabIndex.d.ts.map +1 -0
  59. package/dist/src/headless/useThrottle.d.ts +9 -0
  60. package/dist/src/headless/useThrottle.d.ts.map +1 -0
  61. package/dist/src/i18n/index.d.ts +47 -2
  62. package/dist/src/i18n/index.d.ts.map +1 -1
  63. package/dist/src/themes/index.d.ts.map +1 -1
  64. package/package.json +61 -7
  65. package/src/charts/TkxAreaChart.tsx +119 -0
  66. package/src/charts/TkxBarChart.tsx +115 -0
  67. package/src/charts/TkxDonutChart.tsx +145 -0
  68. package/src/charts/TkxLineChart.tsx +135 -0
  69. package/src/charts/TkxPieChart.tsx +82 -0
  70. package/src/charts/TkxRadarChart.tsx +90 -0
  71. package/src/charts/TkxScatterChart.tsx +102 -0
  72. package/src/charts/index.ts +20 -0
  73. package/src/charts/shared.ts +45 -0
  74. package/src/components/TkxDataGrid.tsx +532 -268
  75. package/src/components/TkxForm.tsx +67 -15
  76. package/src/components/TkxImage.tsx +1 -1
  77. package/src/components/TkxTypography.tsx +4 -2
  78. package/src/engine/tkx.ts +60 -3
  79. package/src/headless/index.ts +44 -0
  80. package/src/headless/useControllable.ts +40 -0
  81. package/src/headless/useDebounce.ts +35 -0
  82. package/src/headless/useDisclosure.ts +28 -0
  83. package/src/headless/useFormState.ts +111 -0
  84. package/src/headless/useIntersectionObserver.ts +51 -0
  85. package/src/headless/useListSelection.ts +101 -0
  86. package/src/headless/useLocalStorage.ts +46 -0
  87. package/src/headless/useMediaQuery.ts +37 -0
  88. package/src/headless/useRovingTabIndex.ts +84 -0
  89. package/src/headless/useThrottle.ts +46 -0
  90. package/src/i18n/I18nProvider.tsx +1 -1
  91. package/src/i18n/index.ts +678 -38
  92. package/src/themes/index.ts +31 -4
package/dist/index.cjs CHANGED
@@ -1,17 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),t=require("react/jsx-runtime"),Ne=require("react-dom"),ss=2166136261,is=16777619;function ht(e){let r=ss;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,is)>>>0;return r.toString(16).padStart(8,"0")}class Tn{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 wt=new Tn(512);function En(e,r){const n=wt.get(e);if(n!==void 0)return n;const o=r();return wt.set(e,o),o}const In=[];let Jt=!1;const Et=[];let hr=0,kt=0;function as(){const e=In.splice(0),r=performance.now();for(const o of e)try{o()}catch{}const n=performance.now()-r;hr+=n,kt++,Et.push({duration:n,timestamp:Date.now()}),Et.length>100&&Et.shift()}function Nn(e){In.push(e),Jt||(Jt=!0,queueMicrotask(()=>{as(),Jt=!1}))}function ls(e){const r=e!==void 0?Et.slice(-e):Et.slice();return{avgRenderTime:kt===0?0:hr/kt,cacheHitRate:wt.cacheHitRate,renderCount:kt,recent:r}}function cs(e){e!==void 0?wt.invalidate(e):wt.invalidate()}const ds={hash:ht,memoize:En,batchUpdate:Nn,invalidate:cs,get avgRenderTime(){return kt===0?0:hr/kt},get cacheHitRate(){return wt.cacheHitRate},getMetrics:ls},Vt=new Map;function zn(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function us(e){return"tkx-"+ht(e)}function Ln(e){const r=us(e);return Vt.has(r)||Vt.set(r,e),r}function An(e,...r){const n=e.reduce((i,l,c)=>i+l+(r[c]!==void 0?String(r[c]):""),"");return{className:Ln(n.trim()),styles:n.trim()}}function Rn(e){const r=Object.entries(e).map(([o,i])=>`${zn(o)}: ${i};`).join(" ");return{className:Ln(r),styles:r}}const fs={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function Dn(e,r){return`@media (min-width: ${fs[e]}) { ${r} }`}function Bn(e,r){const n=Object.entries(r).map(([o,i])=>{const l=Object.entries(i).map(([c,d])=>`${zn(c)}: ${d};`).join(" ");return`${o} { ${l} }`}).join(" ");return`@keyframes ${e} { ${n} }`}function mr(e,r){return r!==void 0?`--tkx-${e}: ${r};`:`var(--tkx-${e})`}function gr(){return Array.from(Vt.entries()).map(([e,r])=>`.${e} { ${r} }`).join(`
2
- `)}function ps(){Vt.clear()}function Wn(){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=gr()}const xs={css:An,fromObject:Rn,responsive:Dn,keyframes:Bn,cssVar:mr,extractCSS:gr,injectStyles:Wn,resetStyles:ps};function hs(e){const r=e.replace("#",""),n=r.length===3?r.split("").map(c=>c+c).join(""):r,o=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16);return[o,i,l]}function Ir(e){const[r,n,o]=hs(e).map(i=>{const l=i/255;return l<=.03928?l/12.92:((l+.055)/1.055)**2.4});return .2126*r+.7152*n+.0722*o}function jt(e,r){const n=Ir(e),o=Ir(r),i=Math.max(n,o),l=Math.min(n,o);return(i+.05)/(l+.05)}function Ot(e,r,n=!1){return jt(e,r)>=(n?3:4.5)}function Fn(e,r,n=!1){return jt(e,r)>=(n?4.5:7)}function at(e,r){const o=r??["#ffffff","#000000"];return o.reduce((i,l)=>jt(l,e)>jt(i,e)?l:i,o[0])}function Pn(){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,o="polite"){const i=o==="assertive"?r:e;i.textContent="",setTimeout(()=>{i.textContent=n},0)},destroy(){e.remove(),r.remove()}}}const ms=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function br(e){let r=null,n=null;function o(){return Array.from(e.querySelectorAll(ms)).filter(i=>!i.closest("[hidden]")&&!i.closest('[aria-hidden="true"]'))}return{activate(){r=document.activeElement;const i=o();i.length>0&&i[0].focus(),n=l=>{if(l.key!=="Tab")return;const c=o();if(c.length===0)return;const d=c[0],u=c[c.length-1];l.shiftKey?document.activeElement===d&&(l.preventDefault(),u.focus()):document.activeElement===u&&(l.preventDefault(),d.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),r instanceof HTMLElement&&r.focus(),r=null,n=null}}}function Hn(e,r,n,o){let i=r;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),i=r===0?n-1:r-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),i=r===n-1?0:r+1;break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=n-1;break;case"Enter":case" ":e.preventDefault(),o(r);return;default:return}o(i)}function gs(e,r,n,o,i){let l=r;switch(e.key){case"ArrowUp":e.preventDefault(),l=r===0?n-1:r-1;break;case"ArrowDown":e.preventDefault(),l=r===n-1?0:r+1;break;case"Home":e.preventDefault(),l=0;break;case"End":e.preventDefault(),l=n-1;break;case"Enter":case" ":e.preventDefault(),o(r);return;case"Escape":e.preventDefault(),i==null||i();return;default:return}o(l)}function yr(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function vr(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function bs(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 ys={contrastRatio:jt,meetsAA:Ot,meetsAAA:Fn,getAccessibleForeground:at,createAnnouncer:Pn,createFocusTrap:br,handleTabsKeyboard:Hn,handleMenuKeyboard:gs,prefersReducedMotion:yr,prefersHighContrast:vr,announce:bs},kr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},vs={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},ks=/^#[0-9a-fA-F]{3,8}$/;function ws(e,r){const n={...e,...r};for(const[o,i]of Object.entries(n))if(!ks.test(i))throw new Error(`Invalid hex color for theme token '${o}': ${i}`);return Ot(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)`),Ot(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 wr=a.createContext(kr);function js({theme:e=kr,children:r}){return a.useEffect(()=>{const n=Object.entries(e).map(([i,l])=>mr(i,l)).join(" ");let o=document.getElementById("tkx-theme");o||(o=document.createElement("style"),o.id="tkx-theme",document.head.appendChild(o)),o.textContent=`:root { ${n} }`},[e]),a.createElement(wr.Provider,{value:e},r)}function U(){return a.useContext(wr)}function Ss(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16)/255,o=parseInt(r.slice(2,4),16)/255,i=parseInt(r.slice(4,6),16)/255,l=Math.max(n,o,i),c=Math.min(n,o,i);let d=0,u=0;const f=(l+c)/2;if(l!==c){const s=l-c;switch(u=f>.5?s/(2-l-c):s/(l+c),l){case n:d=((o-i)/s+(o<i?6:0))/6;break;case o:d=((i-n)/s+2)/6;break;case i:d=((n-o)/s+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(f*100)]}function Ke(e,r,n){r/=100,n/=100;const o=r*Math.min(n,1-n),i=l=>{const c=(l+e/30)%12,d=n-o*Math.max(Math.min(c-3,9-c,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function $s(e){const[r,n]=Ss(e);return{50:Ke(r,Math.min(n,30),96),100:Ke(r,Math.min(n,40),90),200:Ke(r,Math.min(n,50),80),300:Ke(r,n,70),400:Ke(r,n,60),500:e,600:Ke(r,n,45),700:Ke(r,n,35),800:Ke(r,n,25),900:Ke(r,n,15)}}const Ms={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"}},Cs={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"},Ts={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Es={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)"},Is={hide:-1,base:0,dropdown:1e3,sticky:1100,fixed:1200,overlay:1300,modal:1400,popover:1500,tooltip:1600,toast:1700,max:9999},Ns={none:"0",sm:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px",full:"9999px"},zs={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;"};function R(e){return String(e).replace(/[<>&'"]/g,r=>zs[r]??r)}function jr(e){const r={};for(const n of Object.keys(e))r[n]=Vn(e[n]);return r}function Vn(e){return typeof e=="string"?R(e):Array.isArray(e)?e.map(Vn):e!==null&&typeof e=="object"&&!Ls(e)?jr(e):e}function Ls(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function Ut(e,r){const n=[];for(const[o,i]of Object.entries(r)){const l=e[o],c=l==null;if(i.required&&c){n.push(`prop '${o}' is required`);continue}if(!c){if(typeof l!==i.type){n.push(`prop '${o}' must be of type ${i.type}, got ${typeof l}`);continue}i.type==="number"&&typeof l=="number"&&(i.min!==void 0&&l<i.min&&n.push(`prop '${o}' must be >= ${i.min}`),i.max!==void 0&&l>i.max&&n.push(`prop '${o}' must be <= ${i.max}`)),i.type==="string"&&typeof l=="string"&&i.pattern&&!i.pattern.test(l)&&n.push(`prop '${o}' does not match pattern ${i.pattern}`),i.enum&&!i.enum.includes(l)&&n.push(`prop '${o}' must be one of: ${i.enum.join(", ")}`)}}return{valid:n.length===0,errors:n}}const On=new Map;function As(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'"]},o={componentId:e,permissions:r,directives:n};return On.set(e,o),o}function Rs(e,r){const n=On.get(e);return(n==null?void 0:n.permissions[r])===!0}let ft=[];function _n(e,r,n){const o=ht(JSON.stringify(n??{})),i=ft.length>0?ft[ft.length-1].chainHash:"00000000",l=ht(i+o+r+e),c=Object.freeze({timestamp:Date.now(),component:r,action:e,propsHash:o,chainHash:l});return ft=Object.freeze([...ft,c]),c}function Yn(e){let r=ft;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 Un(){let e="00000000";for(const r of ft){if(ht(e+r.propsHash+r.component+r.action)!==r.chainHash)return!1;e=r.chainHash}return!0}const Ds={sanitize:R,sanitizeProps:jr,validateProps:Ut,createCSP:As,hasPermission:Rs,audit:_n,getAuditLog:Yn,verifyAuditIntegrity:Un};function te(){const[e,r]=a.useState(()=>typeof window>"u"?!1:yr());return a.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}function Bs(){const[e,r]=a.useState(()=>typeof window>"u"?!1:vr());return a.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(forced-colors: active)"),o=i=>r(i.matches);return n.addEventListener("change",o),()=>n.removeEventListener("change",o)},[]),e}function Kt(e){const r=a.useRef(null);return a.useEffect(()=>{if(!e||!r.current)return;const n=br(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function Sr(){const e=a.useRef(null);return a.useEffect(()=>{if(!(typeof document>"u"))return e.current=Pn(),()=>{var r;(r=e.current)==null||r.destroy()}},[]),a.useCallback((r,n="polite")=>{var o;(o=e.current)==null||o.announce(r,n)},[])}function lt(e,r=!0){const n=a.useRef(e);n.current=e,a.useEffect(()=>{if(!r||typeof document>"u")return;const o=i=>{i.key==="Escape"&&n.current()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[r])}function Kn(e,r){const n=a.useRef(r);n.current=r,a.useEffect(()=>{const o=i=>{!e.current||e.current.contains(i.target)||n.current()};return document.addEventListener("pointerdown",o),()=>document.removeEventListener("pointerdown",o)},[e])}const we={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"},Nr={...we,screen:"100vh"},Xe={"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%"},Dt={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},zr={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"},Ws={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"]},Fs={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Ps={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"},Hs={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},Bt={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Vs=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)])),Xn=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Os={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ce(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Ye(e){if(Xn.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=ce(e);return r||e}function _s(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 o={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(o[e])return{"flex-direction":o[e]};const i={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(i[e])return{"flex-wrap":i[e]};const l={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(l[e])return{flex:l[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 c={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(c[e])return{"align-items":c[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 f={"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(f[e])return{"align-content":f[e]};let s;if(s=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":s[1]==="none"?"none":s[1]==="subgrid"?"subgrid":`repeat(${s[1]},minmax(0,1fr))`};if(s=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":s[1]==="none"?"none":s[1]==="subgrid"?"subgrid":`repeat(${s[1]},minmax(0,1fr))`};if(s=e.match(/^col-span-(full|\d+)$/))return{"grid-column":s[1]==="full"?"1 / -1":`span ${s[1]} / span ${s[1]}`};if(s=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":s[1]};if(s=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":s[1]};if(s=e.match(/^row-span-(full|\d+)$/))return{"grid-row":s[1]==="full"?"1 / -1":`span ${s[1]} / span ${s[1]}`};if(s=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":s[1]};if(s=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":s[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(s=e.match(/^p-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{padding:C}}if(s=e.match(/^px-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-left":C,"padding-right":C}}if(s=e.match(/^py-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-top":C,"padding-bottom":C}}if(s=e.match(/^pt-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-top":C}}if(s=e.match(/^pr-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-right":C}}if(s=e.match(/^pb-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-bottom":C}}if(s=e.match(/^pl-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"padding-left":C}}if(s=e.match(/^-?m-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{margin:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mx-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k){const A=C&&k!=="0"?`-${k}`:k;return{"margin-left":A,"margin-right":A}}}if(s=e.match(/^-?my-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k){const A=C&&k!=="0"?`-${k}`:k;return{"margin-top":A,"margin-bottom":A}}}if(s=e.match(/^-?mt-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-top":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mr-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-right":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?mb-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-bottom":C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?ml-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??ce(s[1]);if(k)return{"margin-left":C&&k!=="0"?`-${k}`:k}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(s=e.match(/^gap-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{gap:C}}if(s=e.match(/^gap-x-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"column-gap":C}}if(s=e.match(/^gap-y-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"row-gap":C}}if(s=e.match(/^w-(.+)$/)){const C=s[1],k=we[C]??Xe[C]??ce(C);if(k)return{width:k}}if(s=e.match(/^min-w-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"min-width":C}}if(s=e.match(/^max-w-(.+)$/)){const k={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"}[s[1]]??we[s[1]]??ce(s[1]);if(k)return{"max-width":k}}if(s=e.match(/^h-(.+)$/)){const C=s[1],k=Nr[C]??Xe[C]??ce(C);if(k)return{height:k}}if(s=e.match(/^min-h-(.+)$/)){const k={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[s[1]]??we[s[1]]??ce(s[1]);if(k)return{"min-height":k}}if(s=e.match(/^max-h-(.+)$/)){const C=Nr[s[1]]??ce(s[1]);if(C)return{"max-height":C}}if(s=e.match(/^size-(.+)$/)){const C=we[s[1]]??Xe[s[1]]??ce(s[1]);if(C)return{width:C,height:C}}if(s=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[C,k]=Ws[s[1]]??["1rem","1.5rem"];return{"font-size":C,"line-height":k}}if(s=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Fs[s[1]]??s[1]};if(s=e.match(/^leading-(.+)$/)){const C=Ps[s[1]]??ce(s[1]);if(C)return{"line-height":C}}if(s=e.match(/^tracking-(.+)$/)){const C=Hs[s[1]]??ce(s[1]);if(C)return{"letter-spacing":C}}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(s=e.match(/^indent-(.+)$/)){const C=we[s[1]]??ce(s[1]);if(C)return{"text-indent":C}}if(s=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":s[1],"-webkit-box-orient":"vertical"};if(s=e.match(/^text-(.+)$/)){const[C,k]=s[1].split("/"),A=Ye(C);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(C)){if(k){const D=parseInt(k)/100;return{color:A,opacity:String(D)}}return{color:A}}}if(s=e.match(/^bg-(.+)$/)){const[C,k]=s[1].split("/"),A=Ye(C);return k?{"background-color":A,opacity:String(parseInt(k)/100)}:C==="none"?{background:"none"}:{"background-color":A}}if(s=e.match(/^border-color-(.+)$/))return{"border-color":Ye(s[1])};if(s=e.match(/^fill-(.+)$/))return{fill:Ye(s[1])};if(s=e.match(/^stroke-(.+)$/))return{stroke:Ye(s[1])};if(s=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Ye(s[1])};if(s=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Ye(s[1])};if(s=e.match(/^accent-(.+)$/))return{"accent-color":Ye(s[1])};if(s=e.match(/^caret-(.+)$/))return{"caret-color":Ye(s[1])};if(s=e.match(/^outline-color-(.+)$/))return{"outline-color":Ye(s[1])};if(e==="border")return{"border-width":"1px"};if(s=e.match(/^border-(\d+)$/))return{"border-width":`${s[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(s=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${s[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(s=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${s[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(s=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${s[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(s=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${s[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((s=e.match(/^border-([a-zA-Z].*)$/))&&Xn.has(s[1]))return{"border-color":`var(--tkx-${s[1]})`};if(s=e.match(/^border-\[(.+)]$/))return{"border-color":s[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":Dt[""]};if(s=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":Dt[s[1]]??ce(s[1])??s[1]};if(s=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const C=s[1],k=Dt[s[2]??""]??Dt[""];return{t:{"border-top-left-radius":k,"border-top-right-radius":k},r:{"border-top-right-radius":k,"border-bottom-right-radius":k},b:{"border-bottom-left-radius":k,"border-bottom-right-radius":k},l:{"border-top-left-radius":k,"border-bottom-left-radius":k},tl:{"border-top-left-radius":k},tr:{"border-top-right-radius":k},br:{"border-bottom-right-radius":k},bl:{"border-bottom-left-radius":k}}[C]??{}}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((s=e.match(/^ring-(\d+)$/))&&p[s[1]])return{"box-shadow":`0 0 0 ${p[s[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(s=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${s[1]}px`,"box-shadow":`0 0 0 ${s[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":zr[""]};if(s=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":zr[s[1]]};if(s=e.match(/^opacity-(\d+)$/)){const C=Vs[s[1]];if(C!==void 0)return{opacity:C}}if(e==="bg-none")return{background:"none"};const x={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(x[e])return{"background-size":x[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 v={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(v[e])return{"background-repeat":v[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${Bt[""]})`};if(s=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${Bt[s[1]]})`};if(e==="blur")return{filter:`blur(${Bt[""]})`};if(s=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${Bt[s[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 b={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(b[e])return{position:b[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(s=e.match(/^-?top-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{top:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?right-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{right:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?bottom-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{bottom:C&&k!=="0"?`-${k}`:k}}if(s=e.match(/^-?left-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{left:C&&k!=="0"?`-${k}`:k}}const g={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(s=e.match(/^z-(.+)$/)){const C=g[s[1]]??ce(s[1]);if(C)return{"z-index":C}}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(s=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${s[1]}`]:s[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 S={"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(S[e])return{cursor:S[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 M={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(s=e.match(/^scale-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scale(${C})`}}if(s=e.match(/^scale-x-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scaleX(${C})`}}if(s=e.match(/^scale-y-(.+)$/)){const C=M[s[1]]??ce(s[1]);if(C)return{transform:`scaleY(${C})`}}const N={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(s=e.match(/^-?rotate-(.+)$/)){const C=e.startsWith("-"),k=N[s[1]]??ce(s[1]);if(k)return{transform:C?`rotate(-${k})`:`rotate(${k})`}}if(s=e.match(/^-?translate-x-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{transform:`translateX(${C&&k!=="0"?`-${k}`:k})`}}if(s=e.match(/^-?translate-y-(.+)$/)){const C=e.startsWith("-"),k=we[s[1]]??Xe[s[1]]??ce(s[1]);if(k)return{transform:`translateY(${C&&k!=="0"?`-${k}`:k})`}}if(s=e.match(/^-?skew-x-(.+)$/)){const C=e.startsWith("-"),k=ce(s[1])??`${s[1]}deg`;return{transform:C?`skewX(-${k})`:`skewX(${k})`}}if(s=e.match(/^-?skew-y-(.+)$/)){const C=e.startsWith("-"),k=ce(s[1])??`${s[1]}deg`;return{transform:C?`skewY(-${k})`:`skewY(${k})`}}const j={"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(j[e])return{"transform-origin":j[e]};const L={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(L[e])return{"transition-property":L[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const I={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(s=e.match(/^duration-(.+)$/)){const C=I[s[1]]??ce(s[1]);if(C)return{"transition-duration":C}}if(s=e.match(/^delay-(.+)$/)){const C=I[s[1]]??ce(s[1]);if(C)return{"transition-delay":C}}const T={"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(T[e])return{"transition-timing-function":T[e]};const $={"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($[e])return{animation:$[e]};const z={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};if(z[e])return{"object-fit":z[e]};if(e==="aspect-square")return{"aspect-ratio":"1 / 1"};if(e==="aspect-video")return{"aspect-ratio":"16 / 9"};if(e==="aspect-auto")return{"aspect-ratio":"auto"};if(s=e.match(/^aspect-\[(.+)]$/))return{"aspect-ratio":s[1]};if(e==="list-none")return{"list-style-type":"none"};if(e==="list-disc")return{"list-style-type":"disc"};if(e==="list-decimal")return{"list-style-type":"decimal"};if(e==="list-inside")return{"list-style-position":"inside"};if(e==="list-outside")return{"list-style-position":"outside"};if(s=e.match(/^columns-(\d+)$/))return{columns:s[1]};if(e==="resize")return{resize:"both"};if(e==="resize-none")return{resize:"none"};if(e==="resize-x")return{resize:"horizontal"};if(e==="resize-y")return{resize:"vertical"};if(e==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"};if(e==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};if(e==="focus-ring")return{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"};if(e==="appearance-none")return{appearance:"none"};if(e==="outline-none")return{outline:"none"};if(e==="outline")return{outline:"2px solid currentColor","outline-offset":"2px"};if(e==="float-left")return{float:"left"};if(e==="float-right")return{float:"right"};if(e==="float-none")return{float:"none"};if(e==="clear-both")return{clear:"both"};if(e==="isolate")return{isolation:"isolate"};if(e==="isolation-auto")return{isolation:"auto"};if(s=e.match(/^will-change-(.+)$/))return{"will-change":s[1]};if(e==="touch-manipulation")return{"touch-action":"manipulation"};if(e==="touch-none")return{"touch-action":"none"};if(e==="touch-pan-x")return{"touch-action":"pan-x"};if(e==="touch-pan-y")return{"touch-action":"pan-y"};if(e==="scroll-smooth")return{"scroll-behavior":"smooth"};if(e==="scroll-auto")return{"scroll-behavior":"auto"};if(s=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))return{[s[1]]:s[2]};const E=Zn(e);return E||null}function Ys(e){let r=0,n=-1;for(let o=0;o<e.length;o++)if(e[o]==="[")r++;else if(e[o]==="]")r--;else if(e[o]===":"&&r===0){n=o;break}return n===-1?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function Lr(e,r){for(const[n,o]of Object.entries(r))e[n]=o}function Qt(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const _t=new Map;let qe=null;function Us(){return(!qe||!qe.isConnected)&&(qe=document.getElementById("tkx-atomic"),qe||(qe=document.createElement("style"),qe.id="tkx-atomic",document.head.appendChild(qe))),qe}function Ks(e,r){if(!_t.has(e)&&(_t.set(e,r),typeof document<"u")){const n=Us();n.textContent+=r+`
3
- `}}function qn(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(...qn(n));else if(typeof n=="object")for(const[o,i]of Object.entries(n))i&&r.push(o)}return r}function h(...e){const r=qn(e);if(r.length===0)return"";const n={base:{},variants:{}};for(const u of r){const{variant:f,utility:s}=Ys(u),m=_s(s);m&&(f?(n.variants[f]||(n.variants[f]={}),Lr(n.variants[f],m)):Lr(n.base,m))}const o=[],i=Qt(n.base),l=[i,...Object.entries(n.variants).map(([u,f])=>`${u}{${Qt(f)}}`)].join("|"),c=ht(l),d=`tkx-${c}`;i&&o.push(`.${d}{${i}}`);for(const[u,f]of Object.entries(n.variants)){const s=Qt(f);if(s)if(u.startsWith("@")){const m=u.slice(1),p=Os[m];p&&o.push(`@media(min-width:${p}){.${d}{${s}}}`)}else if(u==="motion-safe")o.push(`@media(prefers-reduced-motion:no-preference){.${d}{${s}}}`);else if(u==="motion-reduce")o.push(`@media(prefers-reduced-motion:reduce){.${d}{${s}}}`);else if(u==="contrast-more")o.push(`@media(prefers-contrast:more){.${d}{${s}}}`);else if(u==="forced-colors")o.push(`@media(forced-colors:active){.${d}{${s}}}`);else if(u==="dark")o.push(`@media(prefers-color-scheme:dark){.${d}{${s}}}`);else if(u==="print")o.push(`@media print{.${d}{${s}}}`);else if(u==="group-hover")o.push(`.group:hover .${d}{${s}}`);else if(u==="group-focus")o.push(`.group:focus-within .${d}{${s}}`);else if(u==="peer-hover")o.push(`.peer:hover~.${d}{${s}}`);else{const p={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}`;o.push(`.${d}${p}{${s}}`)}}return o.length>0&&Ks(c,o.join("")),d}const Xs=h;function qs(){return Array.from(_t.values()).join(`
4
- `)}function Zs(){_t.clear(),qe=null}function ae(...e){return e.filter(Boolean).join(" ")}const Xt=new Map;function Gs(e){Xt.set(e.name,e.utilities)}function Js(e){Xt.delete(e)}function Qs(){return Array.from(Xt.keys())}function Zn(e){for(const r of Xt.values())if(r[e])return r[e];return null}const ei={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},ti={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Ar={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},ri={sm:14,md:16,lg:18,xl:20};function ni({size:e}){const r=ri[e];return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:h("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 Gn=a.forwardRef(({variant:e="solid",size:r="md",colorScheme:n="primary",isLoading:o=!1,loadingText:i,leftIcon:l,rightIcon:c,isFullWidth:d=!1,glow:u=!1,disabled:f,children:s,className:m,style:p,...x},y)=>{const v=U(),b=te(),g=f||o,S={primary:v.primary,secondary:v.secondary,danger:v.danger,warning:v.warning,success:v.success}[n],M=at(S,["#ffffff","#000000",v.bg]),N=typeof s=="string"?R(s):s,j=i?R(i):void 0,L=e==="solid"?{backgroundColor:S,color:M,border:"none",boxShadow:u&&!b?`0 0 20px ${S}55`:void 0}:e==="outline"?{backgroundColor:"transparent",color:S,border:`2px solid ${S}`}:e==="ghost"?{backgroundColor:"transparent",color:S,border:"none"}:{backgroundColor:"transparent",color:S,border:"none",textDecoration:"underline"},I=h("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",ei[r],ti[r],Ar[r],e!=="link"&&Ar[r],d&&"w-full",g?"cursor-not-allowed opacity-60":"cursor-pointer",!b&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:y,"aria-busy":o,"aria-disabled":g,disabled:g,className:ae(I,m),style:{...L,...p},...x,children:o?t.jsxs(t.Fragment,{children:[t.jsx(ni,{size:r}),j??N]}):t.jsxs(t.Fragment,{children:[l&&t.jsx("span",{"aria-hidden":"true",children:l}),N,c&&t.jsx("span",{"aria-hidden":"true",children:c})]})})});Gn.displayName="TkxButton";const oi={none:"",sm:"p-3",md:"p-5",lg:"p-7"},Jn=a.forwardRef(({variant:e="default",isHoverable:r,isClickable:n,padding:o="md",as:i,children:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=i??(n?"button":"div"),x={default:{backgroundColor:s.surface,border:`1px solid ${s.border}`},glass:{backgroundColor:`${s.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${s.border}55`,boxShadow:`0 4px 24px ${s.bg}40`},quantum:{backgroundColor:s.surfaceAlt,border:`1px solid ${s.primary}33`,boxShadow:`0 0 24px ${s.primary}18`},elevated:{backgroundColor:s.surface,boxShadow:`0 4px 20px ${s.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${s.border}`}}[e],y=h("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",oi[o],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(p,{ref:f,className:ae("tkx-card",y,c),style:{color:s.text,...x,...d},...u,children:l})});Jn.displayName="TkxCard";function si({title:e,subtitle:r,action:n,children:o,className:i,...l}){const c=U();return t.jsxs("div",{className:ae(h("flex justify-between items-start mb-4"),i),...l,children:[t.jsxs("div",{className:h("flex-1 min-w-0"),children:[e&&t.jsx("h3",{className:h("text-base font-semibold m-0"),style:{color:c.text},children:e}),r&&t.jsx("p",{className:h("text-sm mt-1 mb-0"),style:{color:c.textMuted},children:r}),o]}),n&&t.jsx("div",{className:h("ml-3 shrink-0"),children:n})]})}function ii({children:e,className:r,...n}){return t.jsx("div",{className:ae(h(""),r),...n,children:e})}function ai({children:e,className:r,style:n,...o}){const i=U();return t.jsx("div",{className:ae(h("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${i.border}`,...n},...o,children:e})}const Qn=a.forwardRef(({label:e,id:r,error:n,hint:o,leftAddon:i,rightAddon:l,isInvalid:c,isRequired:d,disabled:u,className:f,style:s,...m},p)=>{const x=U(),y=a.useId(),v=r??y,b=`${v}-hint`,g=`${v}-error`,w=c||!!n,S=[o&&b,w&&g].filter(Boolean).join(" ")||void 0,M=R(e),N=n?R(n):void 0,j=o?R(o):void 0,L=w?x.danger:x.border;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),f),style:s,children:[t.jsxs("label",{htmlFor:v,className:h("text-sm font-medium font-sans"),style:{color:x.text},children:[M,d&&t.jsx("span",{"aria-hidden":"true",className:h("ml-1"),style:{color:x.danger},children:"*"})]}),t.jsxs("div",{className:h("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${L}`,backgroundColor:x.surface},children:[i&&t.jsx("div",{className:h("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:x.surfaceAlt,color:x.textMuted,borderRight:`1px solid ${x.border}`},children:i}),t.jsx("input",{ref:p,id:v,"aria-invalid":w,"aria-required":d,"aria-describedby":S,disabled:u,className:ae(h("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:x.text},...m}),l&&t.jsx("div",{className:h("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:x.surfaceAlt,color:x.textMuted,borderLeft:`1px solid ${x.border}`},children:l})]}),j&&!N&&t.jsx("span",{id:b,className:h("text-xs"),style:{color:x.textMuted},children:j}),N&&t.jsxs("span",{id:g,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:x.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"})}),N]})]})});Qn.displayName="TkxInput";const li={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]"},ci={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},eo=a.forwardRef(({variant:e="default",size:r="md",dot:n=!1,pulse:o=!1,outlined:i=!1,children:l,className:c,style:d,...u},f)=>{const s=U(),p={default:s.border,primary:s.primary,secondary:s.secondary,danger:s.danger,warning:s.warning,success:s.success,info:s.info}[e],x=at(p,["#ffffff","#000000",s.bg]),y=typeof l=="string"?R(l):l;return n?t.jsx("span",{ref:f,"aria-label":typeof l=="string"?R(l):void 0,className:ae(h("inline-block rounded-full",ci[r],o&&"animate-pulse"),c),style:{backgroundColor:p,...d},...u}):t.jsx("span",{ref:f,className:ae(h("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",li[r],o&&"animate-pulse"),c),style:{backgroundColor:i?"transparent":p,color:i?p:x,border:i?`1px solid ${p}`:"none",...d},...u,children:y})});eo.displayName="TkxBadge";const di={sm:"4px",md:"8px",lg:"12px"},ui={sm:32,md:48,lg:64},to=a.forwardRef(({value:e,variant:r="linear",size:n="md",label:o,showValue:i,color:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=l??s.primary,x=e===void 0,y=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:b}=Ut({value:e},{value:{type:"number",min:0,max:100}});b.length>0&&console.warn("[TkxProgress]",b.join(", "))}if(r==="circular"){const b=ui[n],g=n==="sm"?3:n==="md"?4:5,w=(b-g*2)/2,S=2*Math.PI*w,M=x?0:S-y/100*S;return t.jsxs("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":o??(x?"Loading":`${y}%`),className:ae(h("inline-flex flex-col items-center gap-1"),c),style:d,...u,children:[t.jsxs("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:s.border,strokeWidth:g}),t.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:p,strokeWidth:g,strokeLinecap:"round",strokeDasharray:S,strokeDashoffset:M,transform:`rotate(-90 ${b/2} ${b/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:x&&!m?"tkx-spin 1s linear infinite":void 0}})]}),i&&!x&&t.jsxs("span",{className:h("text-xs"),style:{color:s.textMuted},children:[y,"%"]})]})}const v=di[n];return t.jsxs("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":x?void 0:y,"aria-label":o??(x?"Loading":`${y}%`),className:ae(h("flex flex-col gap-1 w-full"),c),style:d,...u,children:[o&&t.jsxs("div",{className:h("flex justify-between text-sm"),style:{color:s.text},children:[t.jsx("span",{children:o}),i&&!x&&t.jsxs("span",{children:[y,"%"]})]}),t.jsx("div",{className:h("w-full overflow-hidden"),style:{height:v,borderRadius:v,backgroundColor:s.border},children:t.jsx("div",{style:{height:"100%",borderRadius:v,backgroundColor:p,width:x?"40%":`${y}%`,transition:m?"none":"width 300ms ease",animation:x&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});to.displayName="TkxProgress";const fi={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}},ro=a.forwardRef(({checked:e,onChange:r,label:n,size:o="md",hideLabel:i,disabled:l,className:c,style:d,...u},f)=>{const s=U(),m=te(),p=a.useId();Ut({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:x,th:y,td:v,gap:b}=fi[o],g=e?x-v-b:b,w=e?s.primary:s.border;return t.jsxs("div",{className:ae(h("inline-flex items-center gap-2",l?"opacity-50":""),c),style:d,children:[!i&&t.jsx("label",{htmlFor:p,className:h("text-sm font-sans",l?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:s.text},children:n}),t.jsx("button",{ref:f,id:p,role:"switch","aria-checked":e,"aria-label":i?n:void 0,disabled:l,onClick:()=>!l&&r(!e),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&!l&&(S.preventDefault(),r(!e))},className:ae(h("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",l?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:x,height:y,borderRadius:y,backgroundColor:w},...u,children:t.jsx("span",{"aria-hidden":"true",className:h("absolute rounded-full"),style:{top:"50%",left:g,width:v,height:v,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});ro.displayName="TkxToggle";const pi={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 xi({variant:e,title:r,children:n,dismissible:o,onDismiss:i,icon:l,style:c,className:d}){const u=U(),f=Sr(),s=r?R(r):void 0;a.useEffect(()=>{s&&f(s,e==="danger"||e==="warning"?"assertive":"polite")},[s,e,f]);const p={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[e],x=e==="danger"||e==="warning"?"alert":"status";return t.jsxs("div",{role:x,className:h("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,...c},children:[t.jsx("span",{className:h("shrink-0 mt-[1px]"),style:{color:p},children:l??pi[e]}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[s&&t.jsx("p",{className:h("m-0 font-semibold text-sm mb-1"),children:s}),t.jsx("div",{className:h("text-sm leading-relaxed"),children:n})]}),o&&i&&t.jsx("button",{"aria-label":"Dismiss alert",onClick:i,className:h("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 hi={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let cr=0;function mi(){++cr===1&&(document.body.style.overflow="hidden")}function Rr(){--cr<=0&&(cr=0,document.body.style.overflow="")}function gi({isOpen:e,onClose:r,title:n,size:o="md",closeOnOverlayClick:i=!0,closeOnEscape:l=!0,children:c,footer:d}){const u=U(),f=a.useId(),s=Kt(e),m=te(),p=Sr(),x=R(n),y=o==="full";return lt(r,l&&e),a.useEffect(()=>(e?(mi(),p(x,"polite")):Rr(),()=>{e&&Rr()}),[e,x,p]),!e||typeof document>"u"?null:Ne.createPortal(t.jsxs("div",{role:"presentation",className:h("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:i?r:void 0,className:h("absolute inset-0",!m&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-labelledby":f,className:h("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:hi[o],maxWidth:"100%",maxHeight:y?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[t.jsxs("div",{className:h("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[t.jsx("h2",{id:f,className:h("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:x}),t.jsx("button",{onClick:r,"aria-label":"Close dialog",className:h("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:h("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:c}),d&&t.jsx("div",{className:h("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const no=a.createContext(null);function oo(){const e=a.useContext(no);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function bi({defaultIndex:e=0,activeIndex:r,onChange:n,children:o,tabCount:i=0,style:l,className:c}){const[d,u]=a.useState(e),f=a.useId(),s=r!==void 0?r:d,m=p=>{r===void 0&&u(p),n==null||n(p)};return t.jsx(no.Provider,{value:{activeIndex:s,setActiveIndex:m,baseId:f,tabCount:i},children:t.jsx("div",{className:c,style:l,children:o})})}function yi({children:e,className:r,style:n,...o}){const i=U();return t.jsx("div",{role:"tablist",className:ae(h("flex gap-1"),r),style:{borderBottom:`2px solid ${i.border}`,...n},...o,children:e})}function vi({index:e,children:r,disabled:n=!1,className:o,style:i}){const l=U(),{activeIndex:c,setActiveIndex:d,baseId:u,tabCount:f}=oo(),s=a.useRef(null),m=c===e;return t.jsx("button",{ref:s,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:ae(h("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":""),o),style:{color:m?l.primary:l.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${l.primary}`:"2px solid transparent",marginBottom:"-2px",...i},onClick:()=>!n&&d(e),onKeyDown:p=>Hn(p,e,f,x=>{var y;d(x),(y=document.getElementById(`${u}-tab-${x}`))==null||y.focus()}),children:r})}function ki({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function wi({index:e,children:r,style:n,className:o}){const{activeIndex:i,baseId:l}=oo();return i!==e?null:t.jsx("div",{role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:ae(h("pt-4"),o),style:n,children:r})}const ji={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 Si({content:e,children:r,placement:n="top",delay:o=300}){const i=U(),[l,c]=a.useState(!1),d=a.useRef(null),u=a.useId(),f=a.useRef(null),s=te(),m=R(e),p=at(i.surfaceAlt,[i.text,"#ffffff","#000000"]);function x(){f.current=setTimeout(()=>c(!0),o)}function y(){f.current&&clearTimeout(f.current),c(!1)}lt(y,l),Kn(d,y);const v=a.cloneElement(r,{"aria-describedby":l?u:void 0,onMouseEnter:b=>{var g,w;(w=(g=r.props).onMouseEnter)==null||w.call(g,b),x()},onMouseLeave:b=>{var g,w;(w=(g=r.props).onMouseLeave)==null||w.call(g,b),y()},onFocus:b=>{var g,w;(w=(g=r.props).onFocus)==null||w.call(g,b),x()},onBlur:b=>{var g,w;(w=(g=r.props).onBlur)==null||w.call(g,b),y()}});return t.jsxs("span",{ref:d,className:h("relative inline-flex"),children:[v,l&&t.jsx("span",{id:u,role:"tooltip",className:h("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!s&&"animate-fade-in"),style:{backgroundColor:i.surfaceAlt,color:p,border:`1px solid ${i.border}`,boxShadow:`0 4px 12px ${i.bg}40`,maxWidth:280,...ji[n]},children:m})]})}function Dr({variant:e,width:r,height:n,animation:o,bgColor:i,accentColor:l}){const c=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:c,rectangular:"80px"}[e],f=h(e==="circular"?"rounded-full":e==="text"?"rounded":"rounded-lg"),s=o==="pulse"?h("animate-pulse"):o==="wave"?h("animate-shimmer"):"",m=o==="wave"?{background:`linear-gradient(90deg,${i} 25%,${l} 50%,${i} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:i};return t.jsx("div",{className:ae(f,s),style:{width:c,height:u,...m}})}const qt=a.forwardRef(({variant:e="rectangular",width:r,height:n,lines:o,animation:i="pulse",className:l,style:c,...d},u)=>{const f=U(),m=te()?!1:i;return e==="text"&&o&&o>1?t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:ae(h("flex flex-col gap-2"),l),style:c,...d,children:Array.from({length:o},(p,x)=>t.jsx(Dr,{variant:"text",width:x===o-1?"75%":r,height:n,animation:m,bgColor:f.surfaceAlt,accentColor:f.border},x))}):t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:l,style:c,...d,children:t.jsx(Dr,{variant:e,width:r,height:n,animation:m,bgColor:f.surfaceAlt,accentColor:f.border})})});qt.displayName="TkxSkeleton";const $i={xs:24,sm:32,md:40,lg:56,xl:72},Mi={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},so=a.forwardRef(({src:e,alt:r,initials:n,size:o="md",shape:i="circle",status:l,className:c,style:d,...u},f)=>{const s=U(),[m,p]=a.useState(!1),x=$i[o],y=i==="circle",v=s.surfaceAlt,b=at(v,[s.text,s.textMuted]),g=e&&!m,w=!g&&n,S=Math.max(8,x*.22),M=h("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),N=h("block object-cover",y?"rounded-full":"rounded-lg"),j=h("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:f,className:ae(M,c),style:{width:x,height:x,...d},...u,children:[g?t.jsx("img",{src:R(e),alt:R(r),onError:()=>p(!0),className:N,style:{width:x,height:x}}):t.jsx("div",{role:"img","aria-label":R(r),className:j,style:{width:x,height:x,backgroundColor:v,color:b,fontSize:x*.38},children:w?R(n).slice(0,2).toUpperCase():t.jsxs("svg",{width:x*.5,height:x*.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"})]})}),l&&t.jsx("span",{"aria-label":`Status: ${l}`,className:h("absolute bottom-0 right-0 rounded-full"),style:{width:S,height:S,backgroundColor:Mi[l],border:`2px solid ${s.bg}`}})]})});so.displayName="TkxAvatar";function Ci({dir:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:h("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 Ti({columns:e,data:r,caption:n,sortable:o,stickyHeader:i,isLoading:l,emptyState:c,style:d,className:u,striped:f}){const s=U(),[m,p]=a.useState(null),[x,y]=a.useState("asc"),v=a.useMemo(()=>!m||!o?r:[...r].sort((w,S)=>{const M=w[m],N=S[m];let j=0;return typeof M=="string"&&typeof N=="string"?j=M.localeCompare(N):typeof M=="number"&&typeof N=="number"&&(j=M-N),x==="asc"?j:-j}),[r,m,x,o]);function b(w){m===w?y(S=>S==="asc"?"desc":"asc"):(p(w),y("asc"))}function g(w){return m!==w?"none":x}return t.jsx("div",{className:h("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${s.border}`,...d},children:t.jsxs("table",{className:h("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:s.text},children:[n&&t.jsx("caption",{className:h("text-sm text-left p-2"),style:{color:s.textMuted},children:R(n)}),t.jsx("thead",{style:i?{position:"sticky",top:0,backgroundColor:s.surfaceAlt,zIndex:1}:{backgroundColor:s.surfaceAlt},children:t.jsx("tr",{children:e.map(w=>{const S=o&&w.sortable!==!1,M=g(w.key);return t.jsx("th",{scope:"col","aria-sort":S?M==="none"?"none":M==="asc"?"ascending":"descending":void 0,className:h("px-4 py-3 text-left font-semibold whitespace-nowrap",S?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:s.textMuted,borderBottom:`2px solid ${s.border}`,width:w.width},onClick:()=>S&&b(w.key),onKeyDown:N=>{S&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),b(w.key))},tabIndex:S?0:void 0,children:t.jsxs("span",{className:h("inline-flex items-center gap-1.5"),children:[R(w.header),S&&t.jsx(Ci,{dir:M})]})},String(w.key))})})}),t.jsx("tbody",{children:l?Array.from({length:5},(w,S)=>t.jsx("tr",{children:e.map(M=>t.jsx("td",{className:h("px-4 py-3"),children:t.jsx(qt,{variant:"text",height:"16px"})},String(M.key)))},S)):v.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:h("px-4 py-8 text-center"),style:{color:s.textMuted},children:c??"No data available"})}):v.map((w,S)=>t.jsx("tr",{style:{backgroundColor:f&&S%2===1?s.surfaceAlt:"transparent",borderBottom:`1px solid ${s.border}`},children:e.map(M=>{const N=w[M.key],j=M.render?M.render(N,w):typeof N=="string"?R(N):String(N??"");return t.jsx("td",{className:h("px-4 py-3"),style:{color:s.text},children:j},String(M.key))})},S))})]})})}const io=a.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:o,style:i,...l},c)=>{const d=U(),u=r?R(r):void 0,f=e==="vertical",s=f?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?t.jsxs("div",{role:"separator","aria-orientation":e,className:ae(h("flex items-center gap-3 text-xs"),o),style:{color:d.textMuted,...i},...l,children:[t.jsx("hr",{className:h("flex-1 m-0 border-none"),style:{[s]:m}}),t.jsx("span",{children:u}),t.jsx("hr",{className:h("flex-1 m-0 border-none"),style:{[s]:m}})]}):t.jsx("hr",{ref:c,role:"separator","aria-orientation":e,className:ae(h(f?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),o),style:{[s]:m,...i},...l})});io.displayName="TkxDivider";const Ei={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 Br(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function Ii(e,r){const n=e.getBoundingClientRect(),o=window.innerHeight,i=6,l=o-n.bottom-i,c=n.top-i,d=l>=Math.min(r,200)||l>=c?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+i:n.top+window.scrollY-i-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function Ni({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 ao({options:e,value:r,defaultValue:n,placeholder:o="Select an option…",size:i="md",isDisabled:l=!1,isInvalid:c=!1,label:d,hint:u,errorMessage:f,multiple:s=!1,searchable:m=!1,clearable:p=!1,isLoading:x=!1,onChange:y,renderOption:v,maxMenuHeight:b=280,virtualScroll:g,optionHeight:w=36,id:S,className:M,style:N}){const j=U(),L=a.useId(),I=S??L,T=`${I}-listbox`,$=`${I}-hint`,z=`${I}-error`,E=r!==void 0,[C,k]=a.useState(Br(n)),A=E?Br(r):C,[D,O]=a.useState(!1),[W,H]=a.useState(""),[B,P]=a.useState(-1),[F,V]=a.useState(null),[Q,re]=a.useState(""),ie=a.useRef(null),fe=a.useRef(null),xe=a.useRef(null),ve=a.useRef(null),ge=a.useRef(null),X=Ei[i],se=c||!!f,he=a.useRef(null),[Se,de]=a.useState(0),[be,ne]=a.useState(0),q=a.useCallback(()=>{he.current&&de(he.current.scrollTop)},[]);a.useEffect(()=>{if(!D){de(0);return}const _=he.current;if(!_)return;ne(_.clientHeight);const oe=new ResizeObserver(()=>{ne(_.clientHeight)});return oe.observe(_),()=>oe.disconnect()},[D]);const K=m&&W?e.filter(_=>_.label.toLowerCase().includes(W.toLowerCase())):e,G=K.filter(_=>!_.disabled),ee=K.some(_=>!!_.group),ke=(g!==void 0?g:K.length>=100)&&!ee,Me=8,je=K.length*w,ze=ke?Math.max(0,Math.floor(Se/w)-Me):0,Te=ke?Math.min(K.length,Math.ceil((Se+be)/w)+Me):K.length,Pe=ke?K.slice(ze,Te):K,Ge=ze*w,Je=K.reduce((_,oe)=>{const le=oe.group??"";return _[le]||(_[le]=[]),_[le].push(oe),_},{}),Be=a.useCallback(_=>{var le;let oe;s?oe=A.includes(_)?A.filter(ye=>ye!==_):[...A,_]:oe=[_],E||k(oe),y==null||y(s?oe:oe[0]??""),s||(O(!1),H(""),P(-1),(le=fe.current)==null||le.focus())},[E,s,y,A]),Qe=a.useCallback((_,oe)=>{oe.stopPropagation();const le=A.filter(ye=>ye!==_);E||k(le),y==null||y(s?le:le[0]??"")},[E,s,y,A]),et=a.useCallback(_=>{_.stopPropagation(),E||k([]),y==null||y(s?[]:"")},[E,s,y]),He=a.useCallback(()=>{!fe.current||!D||V(Ii(fe.current,b))},[D,b]);a.useEffect(()=>{if(D)return He(),window.addEventListener("scroll",He,!0),window.addEventListener("resize",He),()=>{window.removeEventListener("scroll",He,!0),window.removeEventListener("resize",He)}},[D,He]),a.useEffect(()=>{if(!D)return;const _=oe=>{var ye,We;const le=oe.target;(ye=fe.current)!=null&&ye.contains(le)||(We=ve.current)!=null&&We.contains(le)||(O(!1),H(""))};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[D]),a.useEffect(()=>{D&&m&&setTimeout(()=>{var _;return(_=xe.current)==null?void 0:_.focus()},0)},[D,m]),a.useEffect(()=>{var _;if(!(!D||B<0))if(ke&&he.current){const oe=B*w,le=oe+w,ye=he.current;oe<ye.scrollTop?ye.scrollTop=oe:le>ye.scrollTop+ye.clientHeight&&(ye.scrollTop=le-ye.clientHeight)}else{const oe=(_=ge.current)==null?void 0:_.querySelector(`[data-idx="${B}"]`);oe==null||oe.scrollIntoView({block:"nearest"})}},[B,D,ke,w]);const tt=_=>{switch(_.key){case"Enter":case" ":_.preventDefault(),D?B>=0&&G[B]&&Be(G[B].value):Ve();break;case"Escape":_.preventDefault(),O(!1),H("");break;case"ArrowDown":_.preventDefault(),D?P(oe=>Math.min(oe+1,G.length-1)):Ve();break;case"ArrowUp":_.preventDefault(),D?P(oe=>Math.max(oe-1,0)):Ve();break;case"Home":_.preventDefault(),D&&P(0);break;case"End":_.preventDefault(),D&&P(G.length-1);break;default:_.key.length===1&&!_.ctrlKey&&!_.metaKey&&(D||Ve(),gt(_.key))}},mt=_=>{var oe;switch(_.key){case"Escape":_.preventDefault(),O(!1),H(""),(oe=fe.current)==null||oe.focus();break;case"ArrowDown":_.preventDefault(),P(le=>Math.min(le+1,G.length-1));break;case"ArrowUp":_.preventDefault(),P(le=>Math.max(le-1,0));break;case"Home":_.preventDefault(),P(0);break;case"End":_.preventDefault(),P(G.length-1);break;case"Enter":_.preventDefault(),B>=0&&G[B]&&Be(G[B].value);break}};function gt(_){ie.current&&clearTimeout(ie.current);const oe=Q+_.toLowerCase();re(oe);const le=G.findIndex(ye=>ye.label.toLowerCase().startsWith(oe));le>=0&&P(le),ie.current=setTimeout(()=>re(""),800)}function Ve(){if(l||x)return;O(!0);const _=G.findIndex(oe=>A.includes(oe.value));P(_>=0?_:0)}const Oe=se?j.danger:D?j.primary:j.border,Ue=B>=0&&G[B]?`${I}-opt-${G[B].value}`:void 0,rt=[u&&$,se&&z].filter(Boolean).join(" ")||void 0,bt=A.map(_=>e.find(oe=>oe.value===_)).filter(Boolean),St=D&&F?Ne.createPortal(t.jsxs("div",{ref:ve,role:"listbox",id:T,"aria-label":d?R(d):"Options","aria-multiselectable":s,style:{position:"absolute",top:F.top,left:F.left,width:F.width,zIndex:9999,backgroundColor:j.surface,border:`1.5px solid ${j.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:F.width,maxHeight:b,display:"flex",flexDirection:"column"},children:[m&&t.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${j.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:j.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:xe,type:"text",value:W,onChange:_=>{H(_.target.value),P(0)},onKeyDown:mt,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:j.text,fontSize:X.fontSize,fontFamily:"inherit",width:"100%"}})]}),t.jsx("div",{ref:_=>{ge.current=_,he.current=_},onScroll:ke?q:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:b-(m?48:0)},children:ke?t.jsxs("div",{style:{height:je,position:"relative"},children:[t.jsx("div",{style:{position:"absolute",top:Ge,left:0,right:0},children:Pe.map(_=>{const oe=G.indexOf(_),le=oe===B,ye=A.includes(_.value),We=v?v(_,ye):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[_.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:_.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(_.label)})]}),_.description&&t.jsx("span",{style:{fontSize:"12px",color:j.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(_.description)})]});return t.jsxs("div",{id:`${I}-opt-${_.value}`,"data-idx":oe>=0?oe:void 0,role:"option","aria-selected":ye,"aria-disabled":_.disabled||void 0,onClick:()=>!_.disabled&&Be(_.value),onMouseEnter:()=>!_.disabled&&oe>=0&&P(oe),style:{height:w,boxSizing:"border-box",padding:`0 ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:_.disabled?j.textMuted:j.text,backgroundColor:le?`${j.primary}22`:ye?`${j.primary}12`:"transparent",cursor:_.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:_.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[We,ye&&!v&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:j.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},_.value)})}),K.length===0&&t.jsx("div",{style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:j.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:x?"Loading…":"No options found"})]}):t.jsxs(t.Fragment,{children:[Object.entries(Je).map(([_,oe])=>t.jsxs("div",{children:[_&&t.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:j.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:j.surface,zIndex:1,borderBottom:`1px solid ${j.border}`},children:R(_)}),oe.map(le=>{const ye=G.indexOf(le),We=ye===B,nt=A.includes(le.value),vt=v?v(le,nt):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[le.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:le.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(le.label)})]}),le.description&&t.jsx("span",{style:{fontSize:"12px",color:j.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(le.description)})]});return t.jsxs("div",{id:`${I}-opt-${le.value}`,"data-idx":ye>=0?ye:void 0,role:"option","aria-selected":nt,"aria-disabled":le.disabled||void 0,onClick:()=>!le.disabled&&Be(le.value),onMouseEnter:()=>!le.disabled&&ye>=0&&P(ye),style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:le.disabled?j.textMuted:j.text,backgroundColor:We?`${j.primary}22`:nt?`${j.primary}12`:"transparent",cursor:le.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:le.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[vt,nt&&!v&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:j.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},le.value)})]},_)),K.length===0&&t.jsx("div",{style:{padding:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",color:j.textMuted,textAlign:"center"},children:x?"Loading…":"No options found"})]})})]}),document.body):null,yt=p&&A.length>0&&!l&&!x;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),M),style:N,children:[d&&t.jsx("label",{htmlFor:I,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:j.text,userSelect:"none"},children:R(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:l?.55:1},children:t.jsxs("button",{ref:fe,id:I,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":D,"aria-controls":T,"aria-activedescendant":Ue,"aria-invalid":se||void 0,"aria-describedby":rt,"aria-multiselectable":s,disabled:l,onClick:()=>D?O(!1):Ve(),onKeyDown:tt,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:s&&A.length>0?`4px ${X.px}`:`${X.py} ${X.px}`,fontSize:X.fontSize,fontFamily:"inherit",backgroundColor:j.surface,color:A.length>0?j.text:j.textMuted,border:`1.5px solid ${Oe}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:l?"not-allowed":"pointer",outline:"none",minHeight:i==="sm"?34:i==="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:s&&bt.length>0?bt.map(_=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${X.tagPy} ${X.tagPx}`,fontSize:`calc(${X.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${j.primary}22`,color:j.primary,borderRadius:6,border:`1px solid ${j.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:R(_.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${R(_.label)}`,tabIndex:-1,onClick:oe=>Qe(_.value,oe),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"})})})]},_.value)):!s&&A.length>0?(()=>{const _=e.find(oe=>oe.value===A[0]);return t.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(_==null?void 0:_.icon)&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:_.icon}),_?R(_.label):""]})})():t.jsx("span",{style:{opacity:.6},children:R(o)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:j.textMuted},children:[x&&t.jsx(Ni,{size:X.iconSize,color:j.primary}),yt&&!x&&t.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:et,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:_=>_.currentTarget.style.opacity="1",onMouseLeave:_=>_.currentTarget.style.opacity="0.7",children:t.jsx("svg",{width:X.iconSize,height:X.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:X.iconSize,height:X.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:t.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!se&&t.jsx("span",{id:$,style:{fontSize:"12px",color:j.textMuted,fontFamily:"inherit"},children:R(u)}),se&&f&&t.jsxs("span",{id:z,role:"alert",style:{fontSize:"12px",color:j.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"})}),R(f)]}),St]})}ao.displayName="TkxSelect";const zi={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},lo=a.forwardRef(({label:e,hint:r,isInvalid:n,errorMessage:o,isIndeterminate:i=!1,size:l="md",colorScheme:c="primary",checked:d,defaultChecked:u,onChange:f,disabled:s,className:m,style:p,id:x,...y},v)=>{const b=U(),g=te(),w=a.useId(),S=x??w,M=`${S}-hint`,N=`${S}-error`,j=a.useRef(null),[L,I]=a.useState(!1),T=zi[l],$=n||!!o,E={primary:b.primary,success:b.success,danger:b.danger,warning:b.warning}[c]??b.primary,C=d!==void 0?d:void 0;a.useEffect(()=>{const P=(v==null?void 0:v.current)??j.current;P&&(P.indeterminate=i)},[i,v]);const k=i||(C??!1),A=k?E:b.surface,D=$?b.danger:k?E:b.border,O=at(E),W=L?{outline:`2px solid ${E}`,outlineOffset:"2px"}:{},H=[r&&M,$&&N].filter(Boolean).join(" ")||void 0,B=!g&&k?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return t.jsxs("div",{className:ae(h("flex flex-col gap-1"),m),style:{opacity:s?.5:1,...p},children:[t.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-BINBzXuY.cjs"),e=require("react/jsx-runtime"),a=require("react"),s=require("./TkxForm-ljQjX7KD.cjs"),Le=require("react-dom"),fs={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},xs={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},Kt={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},ps={sm:14,md:16,lg:18,xl:20};function hs({size:t}){const r=ps[t];return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:s.tkx("animate-spin shrink-0"),children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}const Fr=a.forwardRef(({variant:t="solid",size:r="md",colorScheme:n="primary",isLoading:i=!1,loadingText:o,leftIcon:l,rightIcon:c,isFullWidth:d=!1,glow:u=!1,disabled:x,children:f,className:m,style:p,...h},y)=>{const k=B.useTheme(),b=s.useReducedMotion(),g=x||i,j={primary:k.primary,secondary:k.secondary,danger:k.danger,warning:k.warning,success:k.success}[n],S=B.getAccessibleForeground(j,["#ffffff","#000000",k.bg]),z=typeof f=="string"?s.sanitizeString(f):f,v=o?s.sanitizeString(o):void 0,N=t==="solid"?{backgroundColor:j,color:S,border:"none",boxShadow:u&&!b?`0 0 20px ${j}55`:void 0}:t==="outline"?{backgroundColor:"transparent",color:j,border:`2px solid ${j}`}:t==="ghost"?{backgroundColor:"transparent",color:j,border:"none"}:{backgroundColor:"transparent",color:j,border:"none",textDecoration:"underline"},C=s.tkx("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",fs[r],xs[r],Kt[r],t!=="link"&&Kt[r],d&&"w-full",g?"cursor-not-allowed opacity-60":"cursor-pointer",!b&&"transition-all duration-200","focus-visible:focus-ring");return e.jsx("button",{ref:y,"aria-busy":i,"aria-disabled":g,disabled:g,className:s.cx(C,m),style:{...N,...p},...h,children:i?e.jsxs(e.Fragment,{children:[e.jsx(hs,{size:r}),v??z]}):e.jsxs(e.Fragment,{children:[l&&e.jsx("span",{"aria-hidden":"true",children:l}),z,c&&e.jsx("span",{"aria-hidden":"true",children:c})]})})});Fr.displayName="TkxButton";const ms={none:"",sm:"p-3",md:"p-5",lg:"p-7"},Wr=a.forwardRef(({variant:t="default",isHoverable:r,isClickable:n,padding:i="md",as:o,children:l,className:c,style:d,...u},x)=>{const f=B.useTheme(),m=s.useReducedMotion(),p=o??(n?"button":"div"),h={default:{backgroundColor:f.surface,border:`1px solid ${f.border}`},glass:{backgroundColor:`${f.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${f.border}55`,boxShadow:`0 4px 24px ${f.bg}40`},quantum:{backgroundColor:f.surfaceAlt,border:`1px solid ${f.primary}33`,boxShadow:`0 0 24px ${f.primary}18`},elevated:{backgroundColor:f.surface,boxShadow:`0 4px 20px ${f.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${f.border}`}}[t],y=s.tkx("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",ms[i],(r||n)&&!m&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return e.jsx(p,{ref:x,className:s.cx("tkx-card",y,c),style:{color:f.text,...h,...d},...u,children:l})});Wr.displayName="TkxCard";function gs({title:t,subtitle:r,action:n,children:i,className:o,...l}){const c=B.useTheme();return e.jsxs("div",{className:s.cx(s.tkx("flex justify-between items-start mb-4"),o),...l,children:[e.jsxs("div",{className:s.tkx("flex-1 min-w-0"),children:[t&&e.jsx("h3",{className:s.tkx("text-base font-semibold m-0"),style:{color:c.text},children:t}),r&&e.jsx("p",{className:s.tkx("text-sm mt-1 mb-0"),style:{color:c.textMuted},children:r}),i]}),n&&e.jsx("div",{className:s.tkx("ml-3 shrink-0"),children:n})]})}function bs({children:t,className:r,...n}){return e.jsx("div",{className:s.cx(s.tkx(""),r),...n,children:t})}function ys({children:t,className:r,style:n,...i}){const o=B.useTheme();return e.jsx("div",{className:s.cx(s.tkx("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${o.border}`,...n},...i,children:t})}const Hr=a.forwardRef(({label:t,id:r,error:n,hint:i,leftAddon:o,rightAddon:l,isInvalid:c,isRequired:d,disabled:u,className:x,style:f,...m},p)=>{const h=B.useTheme(),y=a.useId(),k=r??y,b=`${k}-hint`,g=`${k}-error`,w=c||!!n,j=[i&&b,w&&g].filter(Boolean).join(" ")||void 0,S=s.sanitizeString(t),z=n?s.sanitizeString(n):void 0,v=i?s.sanitizeString(i):void 0,N=w?h.danger:h.border;return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-1 w-full"),x),style:f,children:[e.jsxs("label",{htmlFor:k,className:s.tkx("text-sm font-medium font-sans"),style:{color:h.text},children:[S,d&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("ml-1"),style:{color:h.danger},children:"*"})]}),e.jsxs("div",{className:s.tkx("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${N}`,backgroundColor:h.surface},children:[o&&e.jsx("div",{className:s.tkx("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:o}),e.jsx("input",{ref:p,id:k,"aria-invalid":w,"aria-required":d,"aria-describedby":j,disabled:u,className:s.cx(s.tkx("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}),l&&e.jsx("div",{className:s.tkx("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:l})]}),v&&!z&&e.jsx("span",{id:b,className:s.tkx("text-xs"),style:{color:h.textMuted},children:v}),z&&e.jsxs("span",{id:g,role:"alert",className:s.tkx("text-xs flex items-center gap-1"),style:{color:h.danger},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})}),z]})]})});Hr.displayName="TkxInput";const ks={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]"},vs={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},Vr=a.forwardRef(({variant:t="default",size:r="md",dot:n=!1,pulse:i=!1,outlined:o=!1,children:l,className:c,style:d,...u},x)=>{const f=B.useTheme(),p={default:f.border,primary:f.primary,secondary:f.secondary,danger:f.danger,warning:f.warning,success:f.success,info:f.info}[t],h=B.getAccessibleForeground(p,["#ffffff","#000000",f.bg]),y=typeof l=="string"?s.sanitizeString(l):l;return n?e.jsx("span",{ref:x,"aria-label":typeof l=="string"?s.sanitizeString(l):void 0,className:s.cx(s.tkx("inline-block rounded-full",vs[r],i&&"animate-pulse"),c),style:{backgroundColor:p,...d},...u}):e.jsx("span",{ref:x,className:s.cx(s.tkx("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",ks[r],i&&"animate-pulse"),c),style:{backgroundColor:o?"transparent":p,color:o?p:h,border:o?`1px solid ${p}`:"none",...d},...u,children:y})});Vr.displayName="TkxBadge";const ws={sm:"4px",md:"8px",lg:"12px"},js={sm:32,md:48,lg:64},Or=a.forwardRef(({value:t,variant:r="linear",size:n="md",label:i,showValue:o,color:l,className:c,style:d,...u},x)=>{const f=B.useTheme(),m=s.useReducedMotion(),p=l??f.primary,h=t===void 0,y=t!==void 0?Math.min(100,Math.max(0,t)):0;if(t!==void 0){const{errors:b}=s.validateProps({value:t},{value:{type:"number",min:0,max:100}});b.length>0&&console.warn("[TkxProgress]",b.join(", "))}if(r==="circular"){const b=js[n],g=n==="sm"?3:n==="md"?4:5,w=(b-g*2)/2,j=2*Math.PI*w,S=h?0:j-y/100*j;return e.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:s.cx(s.tkx("inline-flex flex-col items-center gap-1"),c),style:d,...u,children:[e.jsxs("svg",{width:b,height:b,viewBox:`0 0 ${b} ${b}`,"aria-hidden":"true",children:[e.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:f.border,strokeWidth:g}),e.jsx("circle",{cx:b/2,cy:b/2,r:w,fill:"none",stroke:p,strokeWidth:g,strokeLinecap:"round",strokeDasharray:j,strokeDashoffset:S,transform:`rotate(-90 ${b/2} ${b/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:h&&!m?"tkx-spin 1s linear infinite":void 0}})]}),o&&!h&&e.jsxs("span",{className:s.tkx("text-xs"),style:{color:f.textMuted},children:[y,"%"]})]})}const k=ws[n];return e.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:s.cx(s.tkx("flex flex-col gap-1 w-full"),c),style:d,...u,children:[i&&e.jsxs("div",{className:s.tkx("flex justify-between text-sm"),style:{color:f.text},children:[e.jsx("span",{children:i}),o&&!h&&e.jsxs("span",{children:[y,"%"]})]}),e.jsx("div",{className:s.tkx("w-full overflow-hidden"),style:{height:k,borderRadius:k,backgroundColor:f.border},children:e.jsx("div",{style:{height:"100%",borderRadius:k,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}})})]})});Or.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}},_r=a.forwardRef(({checked:t,onChange:r,label:n,size:i="md",hideLabel:o,disabled:l,className:c,style:d,...u},x)=>{const f=B.useTheme(),m=s.useReducedMotion(),p=a.useId();s.validateProps({label:n,checked:t},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:h,th:y,td:k,gap:b}=Ss[i],g=t?h-k-b:b,w=t?f.primary:f.border;return e.jsxs("div",{className:s.cx(s.tkx("inline-flex items-center gap-2",l?"opacity-50":""),c),style:d,children:[!o&&e.jsx("label",{htmlFor:p,className:s.tkx("text-sm font-sans",l?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:f.text},children:n}),e.jsx("button",{ref:x,id:p,role:"switch","aria-checked":t,"aria-label":o?n:void 0,disabled:l,onClick:()=>!l&&r(!t),onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&!l&&(j.preventDefault(),r(!t))},className:s.cx(s.tkx("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",l?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:h,height:y,borderRadius:y,backgroundColor:w},...u,children:e.jsx("span",{"aria-hidden":"true",className:s.tkx("absolute rounded-full"),style:{top:"50%",left:g,width:k,height:k,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});_r.displayName="TkxToggle";const Cs={info:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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 Ts({variant:t,title:r,children:n,dismissible:i,onDismiss:o,icon:l,style:c,className:d}){const u=B.useTheme(),x=s.useAnnounce(),f=r?s.sanitizeString(r):void 0;a.useEffect(()=>{f&&x(f,t==="danger"||t==="warning"?"assertive":"polite")},[f,t,x]);const p={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[t],h=t==="danger"||t==="warning"?"alert":"status";return e.jsxs("div",{role:h,className:s.tkx("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,...c},children:[e.jsx("span",{className:s.tkx("shrink-0 mt-[1px]"),style:{color:p},children:l??Cs[t]}),e.jsxs("div",{className:s.tkx("flex-1 min-w-0"),children:[f&&e.jsx("p",{className:s.tkx("m-0 font-semibold text-sm mb-1"),children:f}),e.jsx("div",{className:s.tkx("text-sm leading-relaxed"),children:n})]}),i&&o&&e.jsx("button",{"aria-label":"Dismiss alert",onClick:o,className:s.tkx("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:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Ms={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let Pt=0;function $s(){++Pt===1&&(document.body.style.overflow="hidden")}function Xt(){--Pt<=0&&(Pt=0,document.body.style.overflow="")}function zs({isOpen:t,onClose:r,title:n,size:i="md",closeOnOverlayClick:o=!0,closeOnEscape:l=!0,children:c,footer:d}){const u=B.useTheme(),x=a.useId(),f=s.useFocusTrap(t),m=s.useReducedMotion(),p=s.useAnnounce(),h=s.sanitizeString(n),y=i==="full";return s.useEscapeKey(r,l&&t),a.useEffect(()=>(t?($s(),p(h,"polite")):Xt(),()=>{t&&Xt()}),[t,h,p]),!t||typeof document>"u"?null:Le.createPortal(e.jsxs("div",{role:"presentation",className:s.tkx("fixed inset-0 z-[9000] flex",y?"items-stretch":"items-center justify-center",y?"":"p-4"),children:[e.jsx("div",{"aria-hidden":"true",onClick:o?r:void 0,className:s.tkx("absolute inset-0",!m&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),e.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-labelledby":x,className:s.tkx("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:Ms[i],maxWidth:"100%",maxHeight:y?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[e.jsxs("div",{className:s.tkx("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[e.jsx("h2",{id:x,className:s.tkx("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:h}),e.jsx("button",{onClick:r,"aria-label":"Close dialog",className:s.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{className:s.tkx("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:c}),d&&e.jsx("div",{className:s.tkx("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const Yr=a.createContext(null);function Ur(){const t=a.useContext(Yr);if(!t)throw new Error("TkxTab must be used inside TkxTabs");return t}function Is({defaultIndex:t=0,activeIndex:r,onChange:n,children:i,tabCount:o=0,style:l,className:c}){const[d,u]=a.useState(t),x=a.useId(),f=r!==void 0?r:d,m=p=>{r===void 0&&u(p),n==null||n(p)};return e.jsx(Yr.Provider,{value:{activeIndex:f,setActiveIndex:m,baseId:x,tabCount:o},children:e.jsx("div",{className:c,style:l,children:i})})}function Es({children:t,className:r,style:n,...i}){const o=B.useTheme();return e.jsx("div",{role:"tablist",className:s.cx(s.tkx("flex gap-1"),r),style:{borderBottom:`2px solid ${o.border}`,...n},...i,children:t})}function Ns({index:t,children:r,disabled:n=!1,className:i,style:o}){const l=B.useTheme(),{activeIndex:c,setActiveIndex:d,baseId:u,tabCount:x}=Ur(),f=a.useRef(null),m=c===t;return e.jsx("button",{ref:f,role:"tab",id:`${u}-tab-${t}`,"aria-controls":`${u}-panel-${t}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:s.cx(s.tkx("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?l.primary:l.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${l.primary}`:"2px solid transparent",marginBottom:"-2px",...o},onClick:()=>!n&&d(t),onKeyDown:p=>B.handleTabsKeyboard(p,t,x,h=>{var y;d(h),(y=document.getElementById(`${u}-tab-${h}`))==null||y.focus()}),children:r})}function Rs({children:t,className:r,...n}){return e.jsx("div",{className:r,...n,children:t})}function Ls({index:t,children:r,style:n,className:i}){const{activeIndex:o,baseId:l}=Ur();return o!==t?null:e.jsx("div",{role:"tabpanel",id:`${l}-panel-${t}`,"aria-labelledby":`${l}-tab-${t}`,tabIndex:0,className:s.cx(s.tkx("pt-4"),i),style:n,children:r})}const Ds={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 As({content:t,children:r,placement:n="top",delay:i=300}){const o=B.useTheme(),[l,c]=a.useState(!1),d=a.useRef(null),u=a.useId(),x=a.useRef(null),f=s.useReducedMotion(),m=s.sanitizeString(t),p=B.getAccessibleForeground(o.surfaceAlt,[o.text,"#ffffff","#000000"]);function h(){x.current=setTimeout(()=>c(!0),i)}function y(){x.current&&clearTimeout(x.current),c(!1)}s.useEscapeKey(y,l),s.useClickOutside(d,y);const k=a.cloneElement(r,{"aria-describedby":l?u:void 0,onMouseEnter:b=>{var g,w;(w=(g=r.props).onMouseEnter)==null||w.call(g,b),h()},onMouseLeave:b=>{var g,w;(w=(g=r.props).onMouseLeave)==null||w.call(g,b),y()},onFocus:b=>{var g,w;(w=(g=r.props).onFocus)==null||w.call(g,b),h()},onBlur:b=>{var g,w;(w=(g=r.props).onBlur)==null||w.call(g,b),y()}});return e.jsxs("span",{ref:d,className:s.tkx("relative inline-flex"),children:[k,l&&e.jsx("span",{id:u,role:"tooltip",className:s.tkx("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!f&&"animate-fade-in"),style:{backgroundColor:o.surfaceAlt,color:p,border:`1px solid ${o.border}`,boxShadow:`0 4px 12px ${o.bg}40`,maxWidth:280,...Ds[n]},children:m})]})}function qt({variant:t,width:r,height:n,animation:i,bgColor:o,accentColor:l}){const c=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:c,rectangular:"80px"}[t],x=s.tkx(t==="circular"?"rounded-full":t==="text"?"rounded":"rounded-lg"),f=i==="pulse"?s.tkx("animate-pulse"):i==="wave"?s.tkx("animate-shimmer"):"",m=i==="wave"?{background:`linear-gradient(90deg,${o} 25%,${l} 50%,${o} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:o};return e.jsx("div",{className:s.cx(x,f),style:{width:c,height:u,...m}})}const Ct=a.forwardRef(({variant:t="rectangular",width:r,height:n,lines:i,animation:o="pulse",className:l,style:c,...d},u)=>{const x=B.useTheme(),m=s.useReducedMotion()?!1:o;return t==="text"&&i&&i>1?e.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:s.cx(s.tkx("flex flex-col gap-2"),l),style:c,...d,children:Array.from({length:i},(p,h)=>e.jsx(qt,{variant:"text",width:h===i-1?"75%":r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border},h))}):e.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:l,style:c,...d,children:e.jsx(qt,{variant:t,width:r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border})})});Ct.displayName="TkxSkeleton";const Ps={xs:24,sm:32,md:40,lg:56,xl:72},Bs={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Kr=a.forwardRef(({src:t,alt:r,initials:n,size:i="md",shape:o="circle",status:l,className:c,style:d,...u},x)=>{const f=B.useTheme(),[m,p]=a.useState(!1),h=Ps[i],y=o==="circle",k=f.surfaceAlt,b=B.getAccessibleForeground(k,[f.text,f.textMuted]),g=t&&!m,w=!g&&n,j=Math.max(8,h*.22),S=s.tkx("relative inline-flex shrink-0",y?"rounded-full":"rounded-lg"),z=s.tkx("block object-cover",y?"rounded-full":"rounded-lg"),v=s.tkx("flex items-center justify-center font-semibold font-sans select-none",y?"rounded-full":"rounded-lg");return e.jsxs("div",{ref:x,className:s.cx(S,c),style:{width:h,height:h,...d},...u,children:[g?e.jsx("img",{src:s.sanitizeString(t),alt:s.sanitizeString(r),onError:()=>p(!0),className:z,style:{width:h,height:h}}):e.jsx("div",{role:"img","aria-label":s.sanitizeString(r),className:v,style:{width:h,height:h,backgroundColor:k,color:b,fontSize:h*.38},children:w?s.sanitizeString(n).slice(0,2).toUpperCase():e.jsxs("svg",{width:h*.5,height:h*.5,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),l&&e.jsx("span",{"aria-label":`Status: ${l}`,className:s.tkx("absolute bottom-0 right-0 rounded-full"),style:{width:j,height:j,backgroundColor:Bs[l],border:`2px solid ${f.bg}`}})]})});Kr.displayName="TkxAvatar";function Fs({dir:t}){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:s.tkx("shrink-0"),children:t==="asc"?e.jsx("path",{d:"M7 14l5-5 5 5H7z"}):t==="desc"?e.jsx("path",{d:"M7 10l5 5 5-5H7z"}):e.jsx("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function Ws({columns:t,data:r,caption:n,sortable:i,stickyHeader:o,isLoading:l,emptyState:c,style:d,className:u,striped:x}){const f=B.useTheme(),[m,p]=a.useState(null),[h,y]=a.useState("asc"),k=a.useMemo(()=>!m||!i?r:[...r].sort((w,j)=>{const S=w[m],z=j[m];let v=0;return typeof S=="string"&&typeof z=="string"?v=S.localeCompare(z):typeof S=="number"&&typeof z=="number"&&(v=S-z),h==="asc"?v:-v}),[r,m,h,i]);function b(w){m===w?y(j=>j==="asc"?"desc":"asc"):(p(w),y("asc"))}function g(w){return m!==w?"none":h}return e.jsx("div",{className:s.tkx("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${f.border}`,...d},children:e.jsxs("table",{className:s.tkx("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:f.text},children:[n&&e.jsx("caption",{className:s.tkx("text-sm text-left p-2"),style:{color:f.textMuted},children:s.sanitizeString(n)}),e.jsx("thead",{style:o?{position:"sticky",top:0,backgroundColor:f.surfaceAlt,zIndex:1}:{backgroundColor:f.surfaceAlt},children:e.jsx("tr",{children:t.map(w=>{const j=i&&w.sortable!==!1,S=g(w.key);return e.jsx("th",{scope:"col","aria-sort":j?S==="none"?"none":S==="asc"?"ascending":"descending":void 0,className:s.tkx("px-4 py-3 text-left font-semibold whitespace-nowrap",j?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:f.textMuted,borderBottom:`2px solid ${f.border}`,width:w.width},onClick:()=>j&&b(w.key),onKeyDown:z=>{j&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),b(w.key))},tabIndex:j?0:void 0,children:e.jsxs("span",{className:s.tkx("inline-flex items-center gap-1.5"),children:[s.sanitizeString(w.header),j&&e.jsx(Fs,{dir:S})]})},String(w.key))})})}),e.jsx("tbody",{children:l?Array.from({length:5},(w,j)=>e.jsx("tr",{children:t.map(S=>e.jsx("td",{className:s.tkx("px-4 py-3"),children:e.jsx(Ct,{variant:"text",height:"16px"})},String(S.key)))},j)):k.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:s.tkx("px-4 py-8 text-center"),style:{color:f.textMuted},children:c??"No data available"})}):k.map((w,j)=>e.jsx("tr",{style:{backgroundColor:x&&j%2===1?f.surfaceAlt:"transparent",borderBottom:`1px solid ${f.border}`},children:t.map(S=>{const z=w[S.key],v=S.render?S.render(z,w):typeof z=="string"?s.sanitizeString(z):String(z??"");return e.jsx("td",{className:s.tkx("px-4 py-3"),style:{color:f.text},children:v},String(S.key))})},j))})]})})}const Xr=a.forwardRef(({orientation:t="horizontal",label:r,variant:n="solid",className:i,style:o,...l},c)=>{const d=B.useTheme(),u=r?s.sanitizeString(r):void 0,x=t==="vertical",f=x?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?e.jsxs("div",{role:"separator","aria-orientation":t,className:s.cx(s.tkx("flex items-center gap-3 text-xs"),i),style:{color:d.textMuted,...o},...l,children:[e.jsx("hr",{className:s.tkx("flex-1 m-0 border-none"),style:{[f]:m}}),e.jsx("span",{children:u}),e.jsx("hr",{className:s.tkx("flex-1 m-0 border-none"),style:{[f]:m}})]}):e.jsx("hr",{ref:c,role:"separator","aria-orientation":t,className:s.cx(s.tkx(x?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[f]:m,...o},...l})});Xr.displayName="TkxDivider";const Hs={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 Zt(t){return t===void 0?[]:Array.isArray(t)?t:[t]}function Vs(t,r){const n=t.getBoundingClientRect(),i=window.innerHeight,o=6,l=i-n.bottom-o,c=n.top-o,d=l>=Math.min(r,200)||l>=c?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+o:n.top+window.scrollY-o-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function Os({size:t,color:r}){return e.jsxs("svg",{width:t,height:t,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:[e.jsx("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),e.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function qr({options:t,value:r,defaultValue:n,placeholder:i="Select an option…",size:o="md",isDisabled:l=!1,isInvalid:c=!1,label:d,hint:u,errorMessage:x,multiple:f=!1,searchable:m=!1,clearable:p=!1,isLoading:h=!1,onChange:y,renderOption:k,maxMenuHeight:b=280,virtualScroll:g,optionHeight:w=36,id:j,className:S,style:z}){const v=B.useTheme(),N=a.useId(),C=j??N,M=`${C}-listbox`,T=`${C}-hint`,E=`${C}-error`,$=r!==void 0,[F,I]=a.useState(Zt(n)),W=$?Zt(r):F,[L,Y]=a.useState(!1),[D,V]=a.useState(""),[R,P]=a.useState(-1),[A,O]=a.useState(null),[G,ee]=a.useState(""),oe=a.useRef(null),ae=a.useRef(null),fe=a.useRef(null),de=a.useRef(null),ge=a.useRef(null),U=Hs[o],se=c||!!x,he=a.useRef(null),[we,ce]=a.useState(0),[me,re]=a.useState(0),le=a.useCallback(()=>{he.current&&ce(he.current.scrollTop)},[]);a.useEffect(()=>{if(!L){ce(0);return}const H=he.current;if(!H)return;re(H.clientHeight);const Q=new ResizeObserver(()=>{re(H.clientHeight)});return Q.observe(H),()=>Q.disconnect()},[L]);const J=m&&D?t.filter(H=>H.label.toLowerCase().includes(D.toLowerCase())):t,X=J.filter(H=>!H.disabled),ne=J.some(H=>!!H.group),ke=(g!==void 0?g:J.length>=100)&&!ne,Te=8,Me=J.length*w,He=ke?Math.max(0,Math.floor(we/w)-Te):0,$e=ke?Math.min(J.length,Math.ceil((we+me)/w)+Te):J.length,ze=ke?J.slice(He,$e):J,Ke=He*w,Xe=J.reduce((H,Q)=>{const ie=Q.group??"";return H[ie]||(H[ie]=[]),H[ie].push(Q),H},{}),De=a.useCallback(H=>{var ie;let Q;f?Q=W.includes(H)?W.filter(be=>be!==H):[...W,H]:Q=[H],$||I(Q),y==null||y(f?Q:Q[0]??""),f||(Y(!1),V(""),P(-1),(ie=ae.current)==null||ie.focus())},[$,f,y,W]),Pe=a.useCallback((H,Q)=>{Q.stopPropagation();const ie=W.filter(be=>be!==H);$||I(ie),y==null||y(f?ie:ie[0]??"")},[$,f,y,W]),Oe=a.useCallback(H=>{H.stopPropagation(),$||I([]),y==null||y(f?[]:"")},[$,f,y]),Ie=a.useCallback(()=>{!ae.current||!L||O(Vs(ae.current,b))},[L,b]);a.useEffect(()=>{if(L)return Ie(),window.addEventListener("scroll",Ie,!0),window.addEventListener("resize",Ie),()=>{window.removeEventListener("scroll",Ie,!0),window.removeEventListener("resize",Ie)}},[L,Ie]),a.useEffect(()=>{if(!L)return;const H=Q=>{var be,Ye;const ie=Q.target;(be=ae.current)!=null&&be.contains(ie)||(Ye=de.current)!=null&&Ye.contains(ie)||(Y(!1),V(""))};return document.addEventListener("pointerdown",H),()=>document.removeEventListener("pointerdown",H)},[L]),a.useEffect(()=>{L&&m&&setTimeout(()=>{var H;return(H=fe.current)==null?void 0:H.focus()},0)},[L,m]),a.useEffect(()=>{var H;if(!(!L||R<0))if(ke&&he.current){const Q=R*w,ie=Q+w,be=he.current;Q<be.scrollTop?be.scrollTop=Q:ie>be.scrollTop+be.clientHeight&&(be.scrollTop=ie-be.clientHeight)}else{const Q=(H=ge.current)==null?void 0:H.querySelector(`[data-idx="${R}"]`);Q==null||Q.scrollIntoView({block:"nearest"})}},[R,L,ke,w]);const qe=H=>{switch(H.key){case"Enter":case" ":H.preventDefault(),L?R>=0&&X[R]&&De(X[R].value):q();break;case"Escape":H.preventDefault(),Y(!1),V("");break;case"ArrowDown":H.preventDefault(),L?P(Q=>Math.min(Q+1,X.length-1)):q();break;case"ArrowUp":H.preventDefault(),L?P(Q=>Math.max(Q-1,0)):q();break;case"Home":H.preventDefault(),L&&P(0);break;case"End":H.preventDefault(),L&&P(X.length-1);break;default:H.key.length===1&&!H.ctrlKey&&!H.metaKey&&(L||q(),Je(H.key))}},_e=H=>{var Q;switch(H.key){case"Escape":H.preventDefault(),Y(!1),V(""),(Q=ae.current)==null||Q.focus();break;case"ArrowDown":H.preventDefault(),P(ie=>Math.min(ie+1,X.length-1));break;case"ArrowUp":H.preventDefault(),P(ie=>Math.max(ie-1,0));break;case"Home":H.preventDefault(),P(0);break;case"End":H.preventDefault(),P(X.length-1);break;case"Enter":H.preventDefault(),R>=0&&X[R]&&De(X[R].value);break}};function Je(H){oe.current&&clearTimeout(oe.current);const Q=G+H.toLowerCase();ee(Q);const ie=X.findIndex(be=>be.label.toLowerCase().startsWith(Q));ie>=0&&P(ie),oe.current=setTimeout(()=>ee(""),800)}function q(){if(l||h)return;Y(!0);const H=X.findIndex(Q=>W.includes(Q.value));P(H>=0?H:0)}const te=se?v.danger:L?v.primary:v.border,ve=R>=0&&X[R]?`${C}-opt-${X[R].value}`:void 0,Se=[u&&T,se&&E].filter(Boolean).join(" ")||void 0,ye=W.map(H=>t.find(Q=>Q.value===H)).filter(Boolean),Be=L&&A?Le.createPortal(e.jsxs("div",{ref:de,role:"listbox",id:M,"aria-label":d?s.sanitizeString(d):"Options","aria-multiselectable":f,style:{position:"absolute",top:A.top,left:A.left,width:A.width,zIndex:9999,backgroundColor:v.surface,border:`1.5px solid ${v.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:A.width,maxHeight:b,display:"flex",flexDirection:"column"},children:[m&&e.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${v.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:v.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("path",{d:"M21 21l-4.35-4.35"})]}),e.jsx("input",{ref:fe,type:"text",value:D,onChange:H=>{V(H.target.value),P(0)},onKeyDown:_e,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:v.text,fontSize:U.fontSize,fontFamily:"inherit",width:"100%"}})]}),e.jsx("div",{ref:H=>{ge.current=H,he.current=H},onScroll:ke?le:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:b-(m?48:0)},children:ke?e.jsxs("div",{style:{height:Me,position:"relative"},children:[e.jsx("div",{style:{position:"absolute",top:Ke,left:0,right:0},children:ze.map(H=>{const Q=X.indexOf(H),ie=Q===R,be=W.includes(H.value),Ye=k?k(H,be):e.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[H.icon&&e.jsx("span",{style:{flexShrink:0,display:"flex"},children:H.icon}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(H.label)})]}),H.description&&e.jsx("span",{style:{fontSize:"12px",color:v.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(H.description)})]});return e.jsxs("div",{id:`${C}-opt-${H.value}`,"data-idx":Q>=0?Q:void 0,role:"option","aria-selected":be,"aria-disabled":H.disabled||void 0,onClick:()=>!H.disabled&&De(H.value),onMouseEnter:()=>!H.disabled&&Q>=0&&P(Q),style:{height:w,boxSizing:"border-box",padding:`0 ${U.px}`,fontSize:U.fontSize,fontFamily:"inherit",color:H.disabled?v.textMuted:v.text,backgroundColor:ie?`${v.primary}22`:be?`${v.primary}12`:"transparent",cursor:H.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:H.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[Ye,be&&!k&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:v.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})]},H.value)})}),J.length===0&&e.jsx("div",{style:{padding:`${U.py} ${U.px}`,fontSize:U.fontSize,fontFamily:"inherit",color:v.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:h?"Loading…":"No options found"})]}):e.jsxs(e.Fragment,{children:[Object.entries(Xe).map(([H,Q])=>e.jsxs("div",{children:[H&&e.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:v.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:v.surface,zIndex:1,borderBottom:`1px solid ${v.border}`},children:s.sanitizeString(H)}),Q.map(ie=>{const be=X.indexOf(ie),Ye=be===R,Qe=W.includes(ie.value),lt=k?k(ie,Qe):e.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[ie.icon&&e.jsx("span",{style:{flexShrink:0,display:"flex"},children:ie.icon}),e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(ie.label)})]}),ie.description&&e.jsx("span",{style:{fontSize:"12px",color:v.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(ie.description)})]});return e.jsxs("div",{id:`${C}-opt-${ie.value}`,"data-idx":be>=0?be:void 0,role:"option","aria-selected":Qe,"aria-disabled":ie.disabled||void 0,onClick:()=>!ie.disabled&&De(ie.value),onMouseEnter:()=>!ie.disabled&&be>=0&&P(be),style:{padding:`${U.py} ${U.px}`,fontSize:U.fontSize,fontFamily:"inherit",color:ie.disabled?v.textMuted:v.text,backgroundColor:Ye?`${v.primary}22`:Qe?`${v.primary}12`:"transparent",cursor:ie.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:ie.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[lt,Qe&&!k&&e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:v.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})]},ie.value)})]},H)),J.length===0&&e.jsx("div",{style:{padding:`${U.py} ${U.px}`,fontSize:U.fontSize,fontFamily:"inherit",color:v.textMuted,textAlign:"center"},children:h?"Loading…":"No options found"})]})})]}),document.body):null,Ee=p&&W.length>0&&!l&&!h;return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-1 w-full"),S),style:z,children:[d&&e.jsx("label",{htmlFor:C,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:v.text,userSelect:"none"},children:s.sanitizeString(d)}),e.jsx("div",{style:{position:"relative",width:"100%",opacity:l?.55:1},children:e.jsxs("button",{ref:ae,id:C,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":L,"aria-controls":M,"aria-activedescendant":ve,"aria-invalid":se||void 0,"aria-describedby":Se,"aria-multiselectable":f,disabled:l,onClick:()=>L?Y(!1):q(),onKeyDown:qe,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:f&&W.length>0?`4px ${U.px}`:`${U.py} ${U.px}`,fontSize:U.fontSize,fontFamily:"inherit",backgroundColor:v.surface,color:W.length>0?v.text:v.textMuted,border:`1.5px solid ${te}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:l?"not-allowed":"pointer",outline:"none",minHeight:o==="sm"?34:o==="lg"?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[e.jsx("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:f&&ye.length>0?ye.map(H=>e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${U.tagPy} ${U.tagPx}`,fontSize:`calc(${U.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${v.primary}22`,color:v.primary,borderRadius:6,border:`1px solid ${v.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:s.sanitizeString(H.label)}),e.jsx("span",{role:"button","aria-label":`Remove ${s.sanitizeString(H.label)}`,tabIndex:-1,onClick:Q=>Pe(H.value,Q),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]},H.value)):!f&&W.length>0?(()=>{const H=t.find(Q=>Q.value===W[0]);return e.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(H==null?void 0:H.icon)&&e.jsx("span",{style:{flexShrink:0,display:"flex"},children:H.icon}),H?s.sanitizeString(H.label):""]})})():e.jsx("span",{style:{opacity:.6},children:s.sanitizeString(i)})}),e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:v.textMuted},children:[h&&e.jsx(Os,{size:U.iconSize,color:v.primary}),Ee&&!h&&e.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:Oe,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:H=>H.currentTarget.style.opacity="1",onMouseLeave:H=>H.currentTarget.style.opacity="0.7",children:e.jsx("svg",{width:U.iconSize,height:U.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:e.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),e.jsx("svg",{width:U.iconSize,height:U.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:L?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:e.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!se&&e.jsx("span",{id:T,style:{fontSize:"12px",color:v.textMuted,fontFamily:"inherit"},children:s.sanitizeString(u)}),se&&x&&e.jsxs("span",{id:E,role:"alert",style:{fontSize:"12px",color:v.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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.sanitizeString(x)]}),Be]})}qr.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}},Zr=a.forwardRef(({label:t,hint:r,isInvalid:n,errorMessage:i,isIndeterminate:o=!1,size:l="md",colorScheme:c="primary",checked:d,defaultChecked:u,onChange:x,disabled:f,className:m,style:p,id:h,...y},k)=>{const b=B.useTheme(),g=s.useReducedMotion(),w=a.useId(),j=h??w,S=`${j}-hint`,z=`${j}-error`,v=a.useRef(null),[N,C]=a.useState(!1),M=_s[l],T=n||!!i,$={primary:b.primary,success:b.success,danger:b.danger,warning:b.warning}[c]??b.primary,F=d!==void 0?d:void 0;a.useEffect(()=>{const P=(k==null?void 0:k.current)??v.current;P&&(P.indeterminate=o)},[o,k]);const I=o||(F??!1),W=I?$:b.surface,L=T?b.danger:I?$:b.border,Y=B.getAccessibleForeground($),D=N?{outline:`2px solid ${$}`,outlineOffset:"2px"}:{},V=[r&&S,T&&z].filter(Boolean).join(" ")||void 0,R=!g&&I?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-1"),m),style:{opacity:f?.5:1,...p},children:[e.jsx("style",{children:`
5
2
  @keyframes tkx-check-scale-in {
6
3
  from { transform: scale(0.4); opacity: 0; }
7
4
  to { transform: scale(1); opacity: 1; }
8
5
  }
9
- `}),t.jsxs("label",{htmlFor:S,className:h("flex items-center gap-2 select-none"),style:{cursor:s?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:P=>{j.current=P,typeof v=="function"?v(P):v&&(v.current=P)},id:S,type:"checkbox",checked:d,defaultChecked:u,onChange:f,disabled:s,"aria-invalid":$,"aria-describedby":H,onFocus:P=>{P.target.matches(":focus-visible")&&I(!0)},onBlur:()=>I(!1),className:h("sr-only"),...y}),t.jsx("span",{"aria-hidden":"true",style:{width:T.box,height:T.box,minWidth:T.box,borderRadius:"4px",border:`2px solid ${D}`,backgroundColor:A,display:"flex",alignItems:"center",justifyContent:"center",transition:g?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...W},children:i?t.jsx("span",{"aria-hidden":"true",style:{display:"block",width:T.box*.5,height:2,backgroundColor:O,borderRadius:"1px",...B}}):k?t.jsx("svg",{width:T.box*.6,height:T.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:O,strokeWidth:T.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:B,children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&t.jsx("span",{style:{fontSize:T.fontSize,color:b.text,lineHeight:1.4},children:typeof e=="string"?R(e):e})]}),r&&!$&&t.jsx("span",{id:M,className:h("text-xs ml-7"),style:{color:b.textMuted,marginLeft:T.box+8},children:R(r)}),$&&o&&t.jsxs("span",{id:N,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:b.danger,marginLeft:T.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"})}),R(o)]})]})});lo.displayName="TkxCheckbox";const co=a.createContext(null);function Li(){return a.useContext(co)}const Ai={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},uo=a.forwardRef(({label:e,hint:r,size:n="md",colorScheme:o="primary",value:i,checked:l,onChange:c,disabled:d,name:u,className:f,style:s,id:m,...p},x)=>{const y=U(),v=te(),b=a.useId(),g=m??b,w=Li(),S=w?w.value===String(i??""):l??!1,M=d??(w==null?void 0:w.isDisabled)??!1,N=u??(w==null?void 0:w.name)??"",j=()=>{M||(w?w.onChange(String(i??"")):c==null||c({target:{value:String(i??"")}}))},L=Ai[n],T={primary:y.primary,success:y.success,danger:y.danger}[o]??y.primary;at(T);const $=S?T:y.border,z=y.surface;return t.jsxs("div",{className:ae(h("flex flex-col gap-0.5"),f),style:{opacity:M?.5:1,...s},children:[t.jsx("style",{children:`
6
+ `}),e.jsxs("label",{htmlFor:j,className:s.tkx("flex items-center gap-2 select-none"),style:{cursor:f?"not-allowed":"pointer",fontFamily:"inherit"},children:[e.jsx("input",{ref:P=>{v.current=P,typeof k=="function"?k(P):k&&(k.current=P)},id:j,type:"checkbox",checked:d,defaultChecked:u,onChange:x,disabled:f,"aria-invalid":T,"aria-describedby":V,onFocus:P=>{P.target.matches(":focus-visible")&&C(!0)},onBlur:()=>C(!1),className:s.tkx("sr-only"),...y}),e.jsx("span",{"aria-hidden":"true",style:{width:M.box,height:M.box,minWidth:M.box,borderRadius:"4px",border:`2px solid ${L}`,backgroundColor:W,display:"flex",alignItems:"center",justifyContent:"center",transition:g?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...D},children:o?e.jsx("span",{"aria-hidden":"true",style:{display:"block",width:M.box*.5,height:2,backgroundColor:Y,borderRadius:"1px",...R}}):I?e.jsx("svg",{width:M.box*.6,height:M.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:Y,strokeWidth:M.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:R,children:e.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),t&&e.jsx("span",{style:{fontSize:M.fontSize,color:b.text,lineHeight:1.4},children:typeof t=="string"?s.sanitizeString(t):t})]}),r&&!T&&e.jsx("span",{id:S,className:s.tkx("text-xs ml-7"),style:{color:b.textMuted,marginLeft:M.box+8},children:s.sanitizeString(r)}),T&&i&&e.jsxs("span",{id:z,role:"alert",className:s.tkx("text-xs flex items-center gap-1"),style:{color:b.danger,marginLeft:M.box+8},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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.sanitizeString(i)]})]})});Zr.displayName="TkxCheckbox";const Gr=a.createContext(null);function Ys(){return a.useContext(Gr)}const Us={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},Jr=a.forwardRef(({label:t,hint:r,size:n="md",colorScheme:i="primary",value:o,checked:l,onChange:c,disabled:d,name:u,className:x,style:f,id:m,...p},h)=>{const y=B.useTheme(),k=s.useReducedMotion(),b=a.useId(),g=m??b,w=Ys(),j=w?w.value===String(o??""):l??!1,S=d??(w==null?void 0:w.isDisabled)??!1,z=u??(w==null?void 0:w.name)??"",v=()=>{S||(w?w.onChange(String(o??"")):c==null||c({target:{value:String(o??"")}}))},N=Us[n],M={primary:y.primary,success:y.success,danger:y.danger}[i]??y.primary;B.getAccessibleForeground(M);const T=j?M:y.border,E=y.surface;return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-0.5"),x),style:{opacity:S?.5:1,...f},children:[e.jsx("style",{children:`
10
7
  @keyframes tkx-radio-dot-in {
11
8
  from { transform: scale(0) translate(-50%, -50%); opacity: 0; }
12
9
  to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
13
10
  }
14
- `}),t.jsxs("label",{htmlFor:g,className:h("flex items-center gap-2 select-none"),style:{cursor:M?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:x,id:g,type:"radio",name:N,value:i,checked:S,onChange:j,disabled:M,"aria-invalid":w==null?void 0:w.isInvalid,className:h("sr-only"),...p}),t.jsx("span",{"aria-hidden":"true",style:{position:"relative",width:L.outer,height:L.outer,minWidth:L.outer,borderRadius:"50%",border:`2px solid ${$}`,backgroundColor:z,display:"inline-block",boxSizing:"border-box",transition:v?"none":"border-color 120ms"},children:S&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:L.inner,height:L.inner,borderRadius:"50%",backgroundColor:T,transform:"translate(-50%, -50%)",transformOrigin:"center",...v?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&t.jsx("span",{style:{fontSize:L.fontSize,color:y.text,lineHeight:1.4},children:typeof e=="string"?R(e):e})]}),r&&t.jsx("span",{className:h("text-xs"),style:{color:y.textMuted,marginLeft:L.outer+8},children:R(r)})]})});uo.displayName="TkxRadio";function Ri({name:e,value:r,defaultValue:n="",onChange:o,label:i,orientation:l="vertical",isDisabled:c=!1,isInvalid:d=!1,errorMessage:u,children:f}){const s=U(),p=`${a.useId()}-error`,[x,y]=a.useState(n),v=r!==void 0,b=v?r:x,g=S=>{v||y(S),o==null||o(S)},w=d||!!u;return t.jsx(co.Provider,{value:{name:e,value:b,onChange:g,isDisabled:c,isInvalid:d},children:t.jsxs("div",{role:"radiogroup","aria-label":i?R(i):void 0,"aria-describedby":w?p:void 0,"aria-invalid":w,children:[i&&t.jsx("div",{className:h("text-sm font-medium font-sans mb-2"),style:{color:s.text},children:R(i)}),t.jsx("div",{className:h(l==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:f}),w&&u&&t.jsxs("span",{id:p,role:"alert",className:h("text-xs flex items-center gap-1 mt-1"),style:{color:s.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(u)]})]})})}const fo=5;let xt=[],Re=[];const dr=new Set,It=new Map;function $r(){const e=[...Re];dr.forEach(r=>r(e))}function po(e,r){r!==0&&It.set(e,setTimeout(()=>Mr(e),r))}function Mr(e){clearTimeout(It.get(e)),It.delete(e);const r=Re.some(n=>n.id===e);if(Re=Re.filter(n=>n.id!==e),xt=xt.filter(n=>n.id!==e),r&&xt.length>0&&Re.length<fo){const n=xt.shift();Re=[...Re,n],po(n.id,n.duration??4e3)}$r()}function Di(e){const r=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:r,duration:e.duration??4e3};return Re.length<fo?(Re=[...Re,n],po(r,n.duration)):xt=[...xt,n],$r(),r}function Bi(){It.forEach(e=>clearTimeout(e)),It.clear(),Re=[],xt=[],$r()}function Wi(){const e=a.useCallback(o=>Di(o),[]),r=a.useCallback(o=>Mr(o),[]),n=a.useCallback(()=>Bi(),[]);return{toast:e,dismiss:r,dismissAll:n}}const Fi={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"})})},Pi={"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 Hi(e,r){return r?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Vi({toast:e,position:r,onDismiss:n,reduced:o}){const i=U(),l=a.useId(),c={default:i.textMuted,success:i.success,danger:i.danger,warning:i.warning,info:i.info},d=e.variant??"default",u=c[d],f=d==="danger",s=e.title?R(e.title):void 0,m=e.description?R(e.description):void 0;return t.jsxs("div",{role:f?"alert":"status","aria-live":f?"assertive":"polite","aria-atomic":"true","aria-labelledby":s?l:void 0,className:h("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:i.surface,border:`1px solid ${u}55`,boxShadow:`0 8px 24px ${i.bg}cc`,color:i.text,...Hi(r,o)},children:[t.jsx("span",{className:h("shrink-0 mt-[2px]"),style:{color:u},children:Fi[d]}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[s&&t.jsx("p",{id:l,className:h("m-0 font-semibold text-sm leading-snug"),children:s}),m&&t.jsx("p",{className:h("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:i.textMuted},children:m}),e.action&&t.jsx("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:h("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:u},children:R(e.action.label)})]}),t.jsx("button",{"aria-label":"Dismiss notification",onClick:()=>n(e.id),className:h("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:i.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 Oi({position:e="top-right"}){const[r,n]=a.useState([...Re]),o=te();a.useEffect(()=>{n([...Re]);const u=f=>n([...f]);return dr.add(u),()=>{dr.delete(u)}},[]);const i=e.startsWith("bottom"),l=Pi[e],c=a.useRef(!1);if(a.useEffect(()=>{if(!(c.current||typeof document>"u")&&(c.current=!0,!document.getElementById("tkx-toast-kf"))){const u=document.createElement("style");u.id="tkx-toast-kf",u.textContent=`
11
+ `}),e.jsxs("label",{htmlFor:g,className:s.tkx("flex items-center gap-2 select-none"),style:{cursor:S?"not-allowed":"pointer",fontFamily:"inherit"},children:[e.jsx("input",{ref:h,id:g,type:"radio",name:z,value:o,checked:j,onChange:v,disabled:S,"aria-invalid":w==null?void 0:w.isInvalid,className:s.tkx("sr-only"),...p}),e.jsx("span",{"aria-hidden":"true",style:{position:"relative",width:N.outer,height:N.outer,minWidth:N.outer,borderRadius:"50%",border:`2px solid ${T}`,backgroundColor:E,display:"inline-block",boxSizing:"border-box",transition:k?"none":"border-color 120ms"},children:j&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:N.inner,height:N.inner,borderRadius:"50%",backgroundColor:M,transform:"translate(-50%, -50%)",transformOrigin:"center",...k?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),t&&e.jsx("span",{style:{fontSize:N.fontSize,color:y.text,lineHeight:1.4},children:typeof t=="string"?s.sanitizeString(t):t})]}),r&&e.jsx("span",{className:s.tkx("text-xs"),style:{color:y.textMuted,marginLeft:N.outer+8},children:s.sanitizeString(r)})]})});Jr.displayName="TkxRadio";function Ks({name:t,value:r,defaultValue:n="",onChange:i,label:o,orientation:l="vertical",isDisabled:c=!1,isInvalid:d=!1,errorMessage:u,children:x}){const f=B.useTheme(),p=`${a.useId()}-error`,[h,y]=a.useState(n),k=r!==void 0,b=k?r:h,g=j=>{k||y(j),i==null||i(j)},w=d||!!u;return e.jsx(Gr.Provider,{value:{name:t,value:b,onChange:g,isDisabled:c,isInvalid:d},children:e.jsxs("div",{role:"radiogroup","aria-label":o?s.sanitizeString(o):void 0,"aria-describedby":w?p:void 0,"aria-invalid":w,children:[o&&e.jsx("div",{className:s.tkx("text-sm font-medium font-sans mb-2"),style:{color:f.text},children:s.sanitizeString(o)}),e.jsx("div",{className:s.tkx(l==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:x}),w&&u&&e.jsxs("span",{id:p,role:"alert",className:s.tkx("text-xs flex items-center gap-1 mt-1"),style:{color:f.danger},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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.sanitizeString(u)]})]})})}const Qr=5;let at=[],We=[];const Bt=new Set,pt=new Map;function Ot(){const t=[...We];Bt.forEach(r=>r(t))}function en(t,r){r!==0&&pt.set(t,setTimeout(()=>_t(t),r))}function _t(t){clearTimeout(pt.get(t)),pt.delete(t);const r=We.some(n=>n.id===t);if(We=We.filter(n=>n.id!==t),at=at.filter(n=>n.id!==t),r&&at.length>0&&We.length<Qr){const n=at.shift();We=[...We,n],en(n.id,n.duration??4e3)}Ot()}function Xs(t){const r=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...t,id:r,duration:t.duration??4e3};return We.length<Qr?(We=[...We,n],en(r,n.duration)):at=[...at,n],Ot(),r}function qs(){pt.forEach(t=>clearTimeout(t)),pt.clear(),We=[],at=[],Ot()}function Zs(){const t=a.useCallback(i=>Xs(i),[]),r=a.useCallback(i=>_t(i),[]),n=a.useCallback(()=>qs(),[]);return{toast:t,dismiss:r,dismissAll:n}}const Gs={default:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})})},Js={"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 Qs(t,r){return r?{}:{animation:`tkx-toast-slide-${t.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function eo({toast:t,position:r,onDismiss:n,reduced:i}){const o=B.useTheme(),l=a.useId(),c={default:o.textMuted,success:o.success,danger:o.danger,warning:o.warning,info:o.info},d=t.variant??"default",u=c[d],x=d==="danger",f=t.title?s.sanitizeString(t.title):void 0,m=t.description?s.sanitizeString(t.description):void 0;return e.jsxs("div",{role:x?"alert":"status","aria-live":x?"assertive":"polite","aria-atomic":"true","aria-labelledby":f?l:void 0,className:s.tkx("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:o.surface,border:`1px solid ${u}55`,boxShadow:`0 8px 24px ${o.bg}cc`,color:o.text,...Qs(r,i)},children:[e.jsx("span",{className:s.tkx("shrink-0 mt-[2px]"),style:{color:u},children:Gs[d]}),e.jsxs("div",{className:s.tkx("flex-1 min-w-0"),children:[f&&e.jsx("p",{id:l,className:s.tkx("m-0 font-semibold text-sm leading-snug"),children:f}),m&&e.jsx("p",{className:s.tkx("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:o.textMuted},children:m}),t.action&&e.jsx("button",{onClick:()=>{t.action.onClick(),n(t.id)},className:s.tkx("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:u},children:s.sanitizeString(t.action.label)})]}),e.jsx("button",{"aria-label":"Dismiss notification",onClick:()=>n(t.id),className:s.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:o.textMuted},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function to({position:t="top-right"}){const[r,n]=a.useState([...We]),i=s.useReducedMotion();a.useEffect(()=>{n([...We]);const u=x=>n([...x]);return Bt.add(u),()=>{Bt.delete(u)}},[]);const o=t.startsWith("bottom"),l=Js[t],c=a.useRef(!1);if(a.useEffect(()=>{if(!(c.current||typeof document>"u")&&(c.current=!0,!document.getElementById("tkx-toast-kf"))){const u=document.createElement("style");u.id="tkx-toast-kf",u.textContent=`
15
12
  @keyframes tkx-toast-slide-down {
16
13
  from { opacity: 0; transform: translateY(-16px); }
17
14
  to { opacity: 1; transform: translateY(0); }
@@ -20,21 +17,21 @@
20
17
  from { opacity: 0; transform: translateY(16px); }
21
18
  to { opacity: 1; transform: translateY(0); }
22
19
  }
23
- `,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=i?[...r].reverse():r;return Ne.createPortal(t.jsx("div",{"aria-label":"Notifications",className:h("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(u=>t.jsx("div",{className:h("pointer-events-auto"),children:t.jsx(Vi,{toast:u,position:e,onDismiss:Mr,reduced:o})},u.id))}),document.body)}const _i={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 Wr({open:e,reduced:r,iconStyle:n,size:o,color:i}){const l=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?t.jsx("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:l,flexShrink:0},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?t.jsxs("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:l,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:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:l,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 Yi({isOpen:e,reduced:r,children:n,id:o,triggerId:i}){const l=a.useRef(null),c=a.useRef(null),d=a.useRef(e),u=a.useRef(!1);a.useEffect(()=>{const s=l.current;s&&(e?(s.style.height="auto",s.style.overflow="visible"):(s.style.height="0px",s.style.overflow="hidden"))},[]),a.useEffect(()=>{if(d.current===e)return;d.current=e;const s=l.current,m=c.current;if(!(!s||!m)){if(r){s.style.height=e?"auto":"0px",s.style.overflow=e?"visible":"hidden";return}if(u.current){const p=s.getBoundingClientRect().height;s.style.transition="none",s.style.height=`${p}px`,s.offsetHeight}u.current=!0,s.style.overflow="hidden",e?(s.style.height="0px",s.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s.style.height=`${m.scrollHeight}px`})})):(s.style.height=`${m.scrollHeight}px`,s.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{s.style.height="0px"})}))}},[e,r]);const f=s=>{if(s.propertyName!=="height")return;u.current=!1;const m=l.current;m&&(e?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return t.jsx("div",{ref:l,id:o,role:"region","aria-labelledby":i,onTransitionEnd:f,style:{willChange:"height"},children:t.jsx("div",{ref:c,children:n})})}function xo({items:e,multiple:r=!1,defaultOpen:n,value:o,onChange:i,variant:l="default",size:c="md",iconPosition:d="right",iconStyle:u="chevron",flush:f=!1,className:s,style:m}){const p=U(),x=te(),y=a.useId(),v=o!==void 0,b=$=>$?Array.isArray($)?new Set($):new Set([$]):new Set,[g,w]=a.useState(()=>b(n)),S=v?b(o):g,M=a.useCallback(($,z)=>{if(z)return;let E;if(v){const k=b(o);E=new Set(k),E.has($)?E.delete($):(r||E.clear(),E.add($))}else{w(k=>{E=new Set(k),E.has($)?E.delete($):(r||E.clear(),E.add($));const A=[...E];return i==null||i(r?A:A[0]??""),E});return}const C=[...E];i==null||i(r?C:C[0]??"")},[r,i,v,o]),N=_i[c],j=()=>{if(f)return{};switch(l){case"bordered":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},L=($,z,E)=>{if(f)return{};switch(l){case"default":return{borderBottom:E?"none":`1px solid ${p.border}`};case"bordered":return{borderBottom:E?"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{}}},I=$=>l==="ghost"||l==="flush"?$?`${p.primary}10`:`${p.surfaceAlt}80`:$?`${p.primary}0d`:`${p.surfaceAlt}60`,T=l==="separated";return t.jsx("div",{className:h(s??""),style:{...j(),display:T?"flex":void 0,flexDirection:T?"column":void 0,gap:T?"8px":void 0,...m},children:e.map(($,z)=>{const E=S.has($.id),C=z===e.length-1,k=`${y}-trigger-${$.id}`,A=`${y}-panel-${$.id}`;return t.jsxs("div",{className:$.className,style:L(z,E,C),children:[t.jsxs("button",{id:k,type:"button",role:"button","aria-expanded":E,"aria-controls":A,disabled:$.disabled,onClick:()=>M($.id,$.disabled),style:{width:"100%",display:"flex",alignItems:$.subtitle?"flex-start":"center",gap:"8px",padding:N.triggerPadding,border:"none",background:"transparent",cursor:$.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:N.fontSize,fontWeight:500,color:$.disabled?p.textMuted:p.text,opacity:$.disabled?.5:1,transition:x?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:D=>{$.disabled||(D.currentTarget.style.backgroundColor=I(E))},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=E?`${p.primary}0d`:"transparent"},onFocus:D=>{$.disabled||(D.currentTarget.style.outline=`2px solid ${p.primary}`,D.currentTarget.style.outlineOffset="2px")},onBlur:D=>{D.currentTarget.style.outline="none"},children:[$.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:$.subtitle?"1px":void 0},children:$.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:E?p.primary:p.textMuted,marginTop:$.subtitle?"1px":void 0},children:t.jsx(Wr,{open:E,reduced:x,iconStyle:u,size:N.iconSize,color:E?p.primary:p.textMuted})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",lineHeight:1.4},children:$.title}),$.subtitle&&t.jsx("span",{style:{display:"block",fontSize:N.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:$.subtitle})]}),$.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:$.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:E?p.primary:p.textMuted,marginTop:$.subtitle?"1px":void 0},children:t.jsx(Wr,{open:E,reduced:x,iconStyle:u,size:N.iconSize,color:E?p.primary:p.textMuted})})]}),t.jsx(Yi,{isOpen:E,reduced:x,id:A,triggerId:k,children:t.jsx("div",{style:{padding:N.contentPadding,fontSize:N.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:$.content})})]},$.id)})})}xo.displayName="TkxAccordion";const Ui={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let ur=0;function Ki(){++ur===1&&(document.body.style.overflow="hidden")}function Fr(){--ur<=0&&(ur=0,document.body.style.overflow="")}function Xi(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function qi(e,r){const n=Ui[r],o=e==="left"||e==="right",i={position:"absolute"};return o?{...i,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...i,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}function Pr(){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 Zi({isOpen:e,onClose:r,placement:n="right",size:o="md",title:i,children:l,footer:c,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const f=U(),s=te(),m=a.useId(),p=Kt(e);if(lt(r,u&&e),a.useEffect(()=>(e?Ki():Fr(),()=>{e&&Fr()}),[e]),typeof document>"u")return null;const x=qi(n,o),y=Xi(n),v=s?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",b=typeof i=="string"?R(i):i;return Ne.createPortal(t.jsxs("div",{role:"presentation",className:h("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:h("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:s?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),t.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":i?m:void 0,className:h("absolute flex flex-col font-sans"),style:{...x,backgroundColor:f.surface,borderLeft:n==="right"?`1px solid ${f.border}`:void 0,borderRight:n==="left"?`1px solid ${f.border}`:void 0,borderTop:n==="bottom"?`1px solid ${f.border}`:void 0,borderBottom:n==="top"?`1px solid ${f.border}`:void 0,boxShadow:`0 20px 60px ${f.bg}99`,transform:e?"translate(0,0)":y,opacity:e?1:0,transition:v,willChange:"transform"},children:[i!==void 0&&t.jsxs("div",{className:h("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${f.border}`},children:[t.jsx("h2",{id:m,className:h("m-0 text-base font-semibold leading-snug"),style:{color:f.text},children:b}),t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:h("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:f.textMuted},children:t.jsx(Pr,{})})]}),i===void 0&&t.jsx("div",{className:h("flex justify-end px-3 pt-3 shrink-0"),children:t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:h("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:f.textMuted},children:t.jsx(Pr,{})})}),t.jsx("div",{className:h("flex-1 overflow-y-auto px-5 py-4"),style:{color:f.text},children:l}),c&&t.jsx("div",{className:h("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${f.border}`},children:c})]})]}),document.body)}const Gi=["Su","Mo","Tu","We","Th","Fr","Sa"],Hr=["January","February","March","April","May","June","July","August","September","October","November","December"],Ji=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function De(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Le(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Qi(e,r,n){if(!r||!n)return!1;const o=Le(e).getTime(),i=Le(r).getTime(),l=Le(n).getTime(),c=Math.min(i,l),d=Math.max(i,l);return o>c&&o<d}function Vr(e,r,n){return!!(r&&De(e,r)||n&&De(e,n))}function st(e,r="en-US"){return e?e.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function ea(e){const r=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,o,i]=r.map(Number);if(n<1||n>12||o<1||o>31)return null;const l=new Date(i,n-1,o);return l.getMonth()!==n-1?null:l}function Or(e,r){return new Date(e,r+1,0).getDate()}function ta(e,r){const n=new Date(e,r,1).getDay(),o=Or(e,r),i=[],l=Or(e,r-1);for(let d=n-1;d>=0;d--)i.push(new Date(e,r-1,l-d));for(let d=1;d<=o;d++)i.push(new Date(e,r,d));let c=1;for(;i.length<42;)i.push(new Date(e,r+1,c++));return i}function er(e){return Math.floor(e/10)*10}function ra(){return[{label:"Today",getValue:()=>{const e=Le(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=Le(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-6),[r,e]}},{label:"Last 30 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-29),[r,e]}},{label:"Last 90 days",getValue:()=>{const e=Le(new Date),r=new Date(e);return r.setDate(r.getDate()-89),[r,e]}},{label:"This week",getValue:()=>{const e=Le(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=Le(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,o=r===0?e.getFullYear()-1:e.getFullYear();return[new Date(o,n*3,1),new Date(o,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 na(e,r){const n=e.getBoundingClientRect(),o=window.innerHeight,i=window.scrollY,l=window.scrollX,d=o-n.bottom<r+8&&n.top>r+8;return{top:d?i+n.top-r-4:i+n.bottom+4,left:l+n.left,flipUp:d}}function _r({values:e,selected:r,onSelect:n,label:o,theme:i,format:l}){const c=a.useRef([]),d=a.useRef(null);a.useEffect(()=>{const f=c.current[r];f&&d.current&&f.scrollIntoView({block:"nearest"})},[r]);const u=l??(f=>String(f).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:i.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),t.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${i.border}`,borderRadius:"8px",padding:"4px"},children:e.map(f=>{const s=f===r;return t.jsx("button",{ref:m=>{c.current[f]=m},type:"button",onClick:()=>n(f),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:s?600:400,backgroundColor:s?i.primary:"transparent",color:s?i.bg:i.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(f)},f)})})]})}function Yr({year:e,month:r,today:n,mode:o,selectedDate:i,selectedRange:l,multiDates:c,hoverDate:d,focusedDate:u,isDateDisabled:f,onSelectDate:s,onHoverDate:m,onSetFocused:p,theme:x,locale:y}){const v=ta(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Gi.map(b=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:x.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:b},b))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:v.map((b,g)=>{const w=b.getMonth()===r,S=De(b,n),M=b.getDay()===0||b.getDay()===6,N=f(b),j=o==="single"&&i!=null&&De(b,i),L=o==="multiple"&&c.some(P=>De(P,b)),I=o==="range"&&Vr(b,l[0],null),T=o==="range"&&Vr(b,null,l[1]),$=I||T,z=o==="range"&&l[0]&&!l[1]&&d?d:l[1],E=o==="range"&&Qi(b,l[0],z),C=o==="range"&&l[0]&&!l[1]&&d&&De(b,d),k=j||L||$,A=u!=null&&De(b,u);let D="transparent",O=w?M?`${x.text}cc`:x.text:`${x.textMuted}60`,W="none",H=400;k||C?(D=x.primary,O=x.bg,H=600):E&&(D=`${x.primary}18`),S&&!k&&(W=`2px solid ${x.primary}`,H=600),N&&(O=`${x.textMuted}50`),A&&!k&&(W=`2px solid ${x.secondary}`);const B=b.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":B,"aria-pressed":k,"aria-disabled":N,disabled:N,onClick:()=>!N&&s(b),onMouseEnter:()=>m(b),onMouseLeave:()=>m(null),onFocus:()=>p(b),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:D,color:O,border:W,fontSize:"13px",fontWeight:H,cursor:N?"not-allowed":"pointer",opacity:N?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:N?"line-through":"none",transition:"background-color 80ms ease"},children:b.getDate()},g)})})]})}function ho({value:e,onChange:r,rangeValue:n,onRangeChange:o,multiValue:i,onMultiChange:l,mode:c="single",minDate:d,maxDate:u,disabledDates:f,locale:s="en-US",showTime:m=!1,timeValue:p,onTimeChange:x,showPresets:y=!1,customPresets:v,label:b,placeholder:g="MM/DD/YYYY",hint:w,isDisabled:S=!1,isInvalid:M=!1,errorMessage:N,numberOfMonths:j=1,id:L,className:I,style:T}){const $=U(),z=a.useId(),E=L??z,C=te(),k=Le(new Date),A=e!==void 0,[D,O]=a.useState(null),W=A?e??null:D,H=n!==void 0,[B,P]=a.useState([null,null]),F=H?n:B,V=i!==void 0,[Q,re]=a.useState([]),ie=V?i:Q,[fe,xe]=a.useState("start"),ve=c==="range"||c==="single"&&m,[ge,X]=a.useState([null,null]),[se,he]=a.useState(null),Se=W??F[0]??k,[de,be]=a.useState(Se.getFullYear()),[ne,q]=a.useState(Se.getMonth()),[K,G]=a.useState("day"),[ee,ue]=a.useState({h:0,m:0}),ke=p??ee,[Me,je]=a.useState(!1),[ze,Te]=a.useState(()=>{if(c==="single")return st(W,s);if(c==="range"){const[Z,J]=F;if(Z&&J)return`${st(Z,s)} – ${st(J,s)}`}return""}),[Pe,Ge]=a.useState(null),[Je,Be]=a.useState(null),[Qe,et]=a.useState({top:0,left:0,flipUp:!1}),[,He]=a.useReducer(Z=>Z+1,0),tt=a.useRef(null),mt=a.useRef(null),gt=a.useRef(null),Ve=y?420:m?480:360;a.useEffect(()=>{if(c==="single")Te(st(W,s));else if(c==="range"){const[Z,J]=F;Te(Z&&J?`${st(Z,s)} – ${st(J,s)}`:Z?st(Z,s):"")}else c==="multiple"&&Te(ie.length>0?`${ie.length} date${ie.length!==1?"s":""} selected`:"")},[W,F,ie,c,s]);const Oe=a.useCallback(()=>{tt.current&&et(na(tt.current,Ve))},[Ve]);a.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]),a.useEffect(()=>{if(!Me)return;const Z=J=>{var pe,Ce;(pe=tt.current)!=null&&pe.contains(J.target)||(Ce=mt.current)!=null&&Ce.contains(J.target)||je(!1)};return document.addEventListener("pointerdown",Z),()=>document.removeEventListener("pointerdown",Z)},[Me]),a.useEffect(()=>{if(!Me)return;const Z=J=>{var pe;J.key==="Escape"&&(je(!1),(pe=gt.current)==null||pe.focus())};return document.addEventListener("keydown",Z),()=>document.removeEventListener("keydown",Z)},[Me]);const Ue=a.useCallback(Z=>d&&Le(Z)<Le(d)||u&&Le(Z)>Le(u)?!0:f?typeof f=="function"?f(Z):f.some(J=>De(J,Z)):!1,[d,u,f]),rt=a.useCallback(Z=>{if(!Ue(Z)){if(c==="single")ve?he(Z):(A||O(Z),r==null||r(Z),Te(st(Z,s)),je(!1));else if(c==="range")if(fe==="start"){const J=[Z,null];X(J),H||P(J),o==null||o(J),xe("end")}else{const J=ge[0]??F[0],pe=J&&Z<J?[Z,J]:[J,Z];X(pe),ve?xe("start"):(H||P(pe),o==null||o(pe),xe("start"),je(!1))}else if(c==="multiple"){const pe=ie.some(Ce=>De(Ce,Z))?ie.filter(Ce=>!De(Ce,Z)):[...ie,Z];V||re(pe),l==null||l(pe)}He()}},[c,Ue,A,H,V,r,o,l,fe,ge,F,ie,ve,s]),bt=a.useCallback(()=>{if(c==="single"){const Z=se??W;A||O(Z),r==null||r(Z)}else c==="range"&&(H||P(ge),o==null||o(ge));je(!1),xe("start")},[c,se,ge,W,A,H,r,o]),St=a.useCallback(()=>{he(null),X([null,null]),xe("start"),je(!1)},[]),yt=()=>{ne===0?(q(11),be(Z=>Z-1)):q(Z=>Z-1),G("day")},_=()=>{ne===11?(q(0),be(Z=>Z+1)):q(Z=>Z+1),G("day")},oe=()=>be(Z=>Z-1),le=()=>be(Z=>Z+1),ye=()=>be(Z=>Z-10),We=()=>be(Z=>Z+10),nt=Z=>{if(Te(Z),c==="single"){const J=ea(Z);J&&!Ue(J)&&(A||O(J),r==null||r(J),be(J.getFullYear()),q(J.getMonth()))}},vt=Z=>{if(Z.stopPropagation(),c==="single")A||O(null),r==null||r(null),Te("");else if(c==="range"){const J=[null,null];H||P(J),o==null||o(J),X(J),Te(""),xe("start")}else c==="multiple"&&(V||re([]),l==null||l([]),Te(""))},Gt=Z=>{if(K!=="day")return;const J=Pe??W??k;let pe=null;if(Z.key==="ArrowRight")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()+1);else if(Z.key==="ArrowLeft")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()-1);else if(Z.key==="ArrowDown")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()+7);else if(Z.key==="ArrowUp")pe=new Date(J.getFullYear(),J.getMonth(),J.getDate()-7);else if(Z.key==="Enter"&&Pe){rt(Pe);return}pe&&(Z.preventDefault(),Ge(pe),(pe.getMonth()!==ne||pe.getFullYear()!==de)&&(q(pe.getMonth()),be(pe.getFullYear())))},Y=()=>{be(k.getFullYear()),q(k.getMonth()),G("day"),rt(k)},me=v??ra(),$e=Z=>{const[J,pe]=Z.getValue(),Ce=[J,pe];X(Ce),H||P(Ce),o==null||o(Ce),be(J.getFullYear()),q(J.getMonth()),xe("start"),ve||je(!1)},Ee=ne===11?0:ne+1,ct=ne===11?de+1:de,ot=j>=2,$t=b?R(b):void 0,Mt=w?R(w):void 0,Ct=N?R(N):void 0,At=R(g),Rt=c==="single"&&W!=null||c==="range"&&(F[0]!=null||F[1]!=null)||c==="multiple"&&ie.length>0,_e=c==="range"?ve?ge:F:[null,null],ts=M?$.danger:Me?$.primary:$.border,rs=Array.from({length:24},(Z,J)=>J),ns=Array.from({length:60},(Z,J)=>J),os=t.jsxs("div",{ref:mt,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Gt,style:{position:"absolute",top:Qe.top,left:Qe.left,zIndex:9999,backgroundColor:$.surface,border:`1px solid ${$.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:ot?"580px":"300px",maxWidth:ot&&y?"780px":ot?"620px":y?"520px":"300px",opacity:Me?1:0,transform:Me?"translateY(0) scale(1)":Qe.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:C?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[y&&c==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${$.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:$.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),me.map(Z=>{const[J,pe]=Z.getValue(),Ce=_e[0]&&_e[1]&&De(_e[0],J)&&De(_e[1],pe);return t.jsx("button",{type:"button",onClick:()=>$e(Z),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:Ce?`${$.primary}20`:"transparent",color:Ce?$.primary:$.text,fontWeight:Ce?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:Tt=>{Ce||(Tt.currentTarget.style.backgroundColor=`${$.surfaceAlt}`)},onMouseLeave:Tt=>{Ce||(Tt.currentTarget.style.backgroundColor="transparent")},children:Z.label},Z.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":K==="day"?"Previous month":K==="month"?"Previous year":"Previous decade",onClick:()=>{K==="day"?yt():K==="month"?oe():ye()},style:{border:"none",background:"transparent",cursor:"pointer",color:$.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:[K==="day"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>G("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:Hr[ne]}),t.jsx("button",{type:"button",onClick:()=>G("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),ot&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:$.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:$.text},children:[Hr[Ee]," ",ct]})]})]}),K==="month"&&t.jsx("button",{type:"button",onClick:()=>G("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:$.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),K==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:$.text},children:[er(de),"–",er(de)+9]})]}),t.jsx("button",{type:"button","aria-label":K==="day"?"Next month":K==="month"?"Next year":"Next decade",onClick:()=>{K==="day"?_():K==="month"?le():We()},style:{border:"none",background:"transparent",cursor:"pointer",color:$.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"})})})]}),K==="day"&&t.jsxs("div",{style:{display:"flex",gap:"20px"},children:[t.jsx(Yr,{year:de,month:ne,today:k,mode:c,selectedDate:W,selectedRange:_e,multiDates:ie,hoverDate:Je,focusedDate:Pe,isDateDisabled:Ue,onSelectDate:rt,onHoverDate:Be,onSetFocused:Ge,theme:$,locale:s}),ot&&t.jsx(Yr,{year:ct,month:Ee,today:k,mode:c,selectedDate:W,selectedRange:_e,multiDates:ie,hoverDate:Je,focusedDate:Pe,isDateDisabled:Ue,onSelectDate:rt,onHoverDate:Be,onSetFocused:Ge,theme:$,locale:s})]}),K==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:Ji.map((Z,J)=>{const pe=J===ne,Ce=J===k.getMonth()&&de===k.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{q(J),G("day")},style:{padding:"10px",borderRadius:"8px",border:Ce&&!pe?`2px solid ${$.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:pe?600:400,backgroundColor:pe?$.primary:"transparent",color:pe?$.bg:$.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:Z},Z)})}),K==="year"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(Z,J)=>{const pe=er(de)-1+J,Ce=pe===de,Tt=pe===k.getFullYear(),Er=J===0||J===11;return t.jsx("button",{type:"button",onClick:()=>{be(pe),G("month")},style:{padding:"10px 6px",borderRadius:"8px",border:Tt&&!Ce?`2px solid ${$.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:Ce?600:400,backgroundColor:Ce?$.primary:"transparent",color:Ce?$.bg:Er?$.textMuted:$.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:Er?.5:1},children:pe},pe)})}),m&&K==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(_r,{values:rs,selected:ke.h,onSelect:Z=>{p||ue(J=>({...J,h:Z})),x==null||x({...ke,h:Z})},label:"Hour",theme:$}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:$.textMuted},children:":"}),t.jsx(_r,{values:ns,selected:ke.m,onSelect:Z=>{p||ue(J=>({...J,m:Z})),x==null||x({...ke,m:Z})},label:"Min",theme:$})]}),c==="multiple"&&K==="day"&&ie.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"8px",fontSize:"12px",color:$.textMuted,textAlign:"center"},children:[ie.length," date",ie.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${$.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:ve?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:Y,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:$.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),ve&&t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx("button",{type:"button",onClick:St,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${$.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:$.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:$.primary,color:$.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:I,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...T},children:[$t&&t.jsx("label",{htmlFor:E,style:{fontSize:"13px",fontWeight:500,color:$.text,marginBottom:"2px"},children:$t}),t.jsxs("div",{ref:tt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${ts}`,borderRadius:"8px",backgroundColor:$.surface,overflow:"hidden",transition:C?"none":"border-color 120ms ease",opacity:S?.5:1},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:$.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:E,type:"text",value:ze,placeholder:At,disabled:S,"aria-invalid":M,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:c==="range"||c==="multiple",onChange:Z=>nt(Z.target.value),onFocus:()=>{S||je(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:$.text,cursor:c!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Rt&&!S&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:vt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:$.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:S,onClick:()=>{S||je(Z=>!Z)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:S?"not-allowed":"pointer",color:$.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:C?"none":"transform 160ms ease"},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),Mt&&!M&&t.jsx("span",{style:{fontSize:"12px",color:$.textMuted},children:Mt}),M&&Ct&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:$.danger},children:Ct}),Me&&typeof document<"u"&&Ne.createPortal(os,document.body)]})}ho.displayName="TkxDatePicker";const oa={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function pt(e,r,n){return Math.min(Math.max(e,r),n)}function fr(e,r,n){return Math.round((e-r)/n)*n+r}function Ze(e,r,n){return(e-r)/(n-r)*100}function tr({value:e,min:r,max:n,step:o,isDisabled:i,trackColor:l,thumbSize:c,ariaLabel:d,tooltipMode:u,formatValue:f,orientation:s,onChange:m,onChangeEnd:p}){const[x,y]=a.useState(!1),[v,b]=a.useState(!1),[g,w]=a.useState(!1),S=T=>{i||(T.key==="ArrowRight"||T.key==="ArrowUp"?(T.preventDefault(),m(pt(fr(e+o,r,o),r,n))):T.key==="ArrowLeft"||T.key==="ArrowDown"?(T.preventDefault(),m(pt(fr(e-o,r,o),r,n))):T.key==="Home"?(T.preventDefault(),m(r)):T.key==="End"&&(T.preventDefault(),m(n)))},M=s==="vertical",N=Ze(e,r,n),j=u==="always"||u==="hover"&&(g||v||x),L=M?{position:"absolute",bottom:`${N}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${c/2}px`,zIndex:2,cursor:i?"not-allowed":"grab"}:{position:"absolute",left:`${N}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${c/2}px`,zIndex:2,cursor:i?"not-allowed":"grab"},I=M?{position:"absolute",left:c+6,top:"50%",transform:"translateY(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:c+6,left:"50%",transform:"translateX(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return t.jsxs("div",{style:L,children:[j&&t.jsx("div",{style:I,children:f(e)}),t.jsx("div",{role:"slider",tabIndex:i?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":i,"aria-orientation":s,onKeyDown:S,onFocus:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:T=>{i||(b(!0),T.target.setPointerCapture(T.pointerId))},onPointerUp:()=>{b(!1),p==null||p()},style:{width:c,height:c,borderRadius:"50%",backgroundColor:i?"#888":l,border:"3px solid #fff",boxShadow:x?`0 0 0 3px ${l}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function mo({value:e,defaultValue:r=0,onChange:n,rangeValue:o,onRangeChange:i,min:l=0,max:c=100,step:d=1,isRange:u=!1,label:f,showValue:s=!1,showTicks:m=!1,tickCount:p=5,isDisabled:x=!1,colorScheme:y="primary",size:v="md",marks:b,orientation:g="horizontal",showTooltip:w=!1,formatValue:S,onChangeEnd:M,onRangeChangeEnd:N,gradient:j=!1}){const L=U(),I=a.useId(),T=te(),$=e!==void 0,[z,E]=a.useState(r),C=$?e:z,k=o!==void 0,[A,D]=a.useState([l,c]),O=k?o:A,W=a.useRef(null),H=a.useRef(C);H.current=C;const B=a.useRef(O);B.current=O;const P={primary:L.primary,success:L.success,danger:L.danger,warning:L.warning}[y],F=oa[v],V=g==="vertical",Q=w===!0?"hover":w===!1?!1:w,re=S??(ne=>String(ne)),ie=P+"66",fe=a.useCallback((ne,q)=>{const K=W.current;if(!K)return l;const G=K.getBoundingClientRect();let ee;V?ee=pt((G.bottom-(q??0))/G.height,0,1):ee=pt((ne-G.left)/G.width,0,1);const ue=ee*(c-l)+l;return pt(fr(ue,l,d),l,c)},[l,c,d,V]),xe=a.useCallback(ne=>{if(x)return;const q=fe(ne.clientX,ne.clientY);if(!u)$||E(q),n==null||n(q);else{const[K,G]=O,ee=Math.abs(q-K),ue=Math.abs(q-G),ke=ee<=ue?[q,G]:[K,q];k||D(ke),i==null||i(ke)}},[x,u,$,k,fe,n,i,O]),ve=ne=>{$||E(ne),n==null||n(ne)},ge=ne=>{const q=[pt(ne,l,O[1]),O[1]];k||D(q),i==null||i(q)},X=ne=>{const q=[O[0],pt(ne,O[0],c)];k||D(q),i==null||i(q)},se=u?Ze(O[0],l,c):0,he=Ze(u?O[1]:C,l,c),Se=m?Array.from({length:p},(ne,q)=>l+q/(p-1)*(c-l)):[],de=f?R(f):void 0,be=T?"none":"background 150ms ease";return t.jsxs("div",{className:h("flex flex-col gap-2"),style:{opacity:x?.55:1,...V?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(de||s)&&t.jsxs("div",{className:h("flex items-center justify-between"),children:[de&&t.jsx("label",{htmlFor:I,className:h("text-sm font-medium"),style:{color:L.text,fontSize:F.fontSize},children:de}),s&&!u&&t.jsx("span",{className:h("text-sm tabular-nums"),style:{color:L.textMuted,fontSize:F.fontSize},children:re(C)}),s&&u&&t.jsxs("span",{className:h("text-sm tabular-nums"),style:{color:L.textMuted,fontSize:F.fontSize},children:[re(O[0])," – ",re(O[1])]})]}),t.jsxs("div",{style:{position:"relative",...V?{paddingLeft:F.thumb/2,paddingRight:F.thumb/2,flex:1}:{paddingTop:F.thumb/2,paddingBottom:F.thumb/2}},children:[t.jsxs("div",{ref:W,onPointerDown:xe,style:{position:"relative",...V?{width:F.track,height:"100%"}:{height:F.track},borderRadius:9999,backgroundColor:L.border,cursor:x?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[t.jsx("div",{style:{position:"absolute",...V?{left:0,bottom:`${se}%`,height:`${he-se}%`,width:"100%"}:{top:0,left:`${se}%`,width:`${he-se}%`,height:"100%"},borderRadius:9999,...x?{backgroundColor:L.textMuted}:j?{background:V?`linear-gradient(to top, ${ie}, ${P})`:`linear-gradient(to right, ${ie}, ${P})`}:{backgroundColor:P},transition:be}}),Se.map((ne,q)=>t.jsx("div",{style:{position:"absolute",...V?{bottom:`${Ze(ne,l,c)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:F.track+4}:{left:`${Ze(ne,l,c)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:F.track+4},backgroundColor:L.surface,borderRadius:9999,pointerEvents:"none"}},q)),u?t.jsxs(t.Fragment,{children:[t.jsx(tr,{value:O[0],min:l,max:O[1],step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:re,orientation:g,onChange:ge,onChangeEnd:N?()=>N(B.current):void 0}),t.jsx(tr,{value:O[1],min:O[0],max:c,step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:re,orientation:g,onChange:X,onChangeEnd:N?()=>N(B.current):void 0})]}):t.jsx(tr,{value:C,min:l,max:c,step:d,isDisabled:x,trackColor:P,trackHeight:F.track,thumbSize:F.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:re,orientation:g,onChange:ve,onChangeEnd:M?()=>M(H.current):void 0})]}),b&&b.length>0&&t.jsx("div",{style:{position:V?"absolute":"relative",...V?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:b.map((ne,q)=>t.jsx("div",{style:{position:"absolute",...V?{bottom:`${Ze(ne.value,l,c)}%`,transform:"translateY(50%)",left:0}:{left:`${Ze(ne.value,l,c)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:L.textMuted,whiteSpace:"nowrap"},children:R(ne.label)},q))})]}),m&&!b&&!V&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:Se.map((ne,q)=>t.jsx("span",{style:{position:"absolute",left:`${Ze(ne,l,c)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:L.textMuted},children:re(Math.round(ne))},q))})]})}mo.displayName="TkxSlider";const sa={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 ia(e,r,n,o){if(r<=1)return[1];const i=(y,v)=>Array.from({length:Math.max(0,v-y+1)},(b,g)=>y+g),l=Math.max(e-n,1),c=Math.min(e+n,r);if(!o){const y=[];return l>1&&y.push("..."),y.push(...i(l,c)),c<r&&y.push("..."),y}const d=1,u=r,f=l>d+2,s=c<u-2,m=[];m.push(1),f?m.push("left-ellipsis"):m.push(...i(2,l-1)),m.push(...i(Math.max(l,2),Math.min(c,r-1))),s?m.push("right-ellipsis"):m.push(...i(c+1,r-1)),r>1&&m.push(r);const p=new Set,x=[];for(const y of m)typeof y=="number"?p.has(y)||(p.add(y),x.push(y)):x.push(y);return x}function go({total:e,pageSize:r=10,page:n,defaultPage:o=1,onChange:i,siblingCount:l=1,showEdges:c=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:f=[10,25,50,100],size:s="md",variant:m="default"}){const p=U(),x=a.useId(),y=n!==void 0,[v,b]=a.useState(o),g=y?n:v,[w,S]=a.useState(r),M=r,N=Math.max(1,Math.ceil(e/M)),j=k=>{const A=Math.min(Math.max(k,1),N);A!==g&&(y||b(A),i==null||i(A))},L=k=>{S(k),u==null||u(k),j(1)},I=ia(g,N,l,c),T=sa[s],$=Math.min((g-1)*M+1,e),z=Math.min(g*M,e),E=(k,A)=>{const D={height:T.height,minWidth:T.minWidth,paddingLeft:T.px,paddingRight:T.px,fontSize:T.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:A?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:A?.4:1};return k?{...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}},C=({d:k})=>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:k})});return t.jsxs("nav",{"aria-label":"Pagination",className:h("flex flex-col gap-2"),children:[e>0&&t.jsx("p",{className:h("text-sm"),style:{color:p.textMuted,fontSize:T.fontSize},children:R(`Showing ${$}–${z} of ${e} items`)}),t.jsxs("div",{className:h("flex items-center gap-1 flex-wrap"),children:[c&&t.jsxs("button",{type:"button","aria-label":"First page",disabled:g===1,onClick:()=>j(1),style:E(!1,g===1),children:[t.jsx(C,{d:"15 18 9 12 15 6"}),t.jsx(C,{d:"20 18 14 12 20 6"})]}),t.jsx("button",{type:"button","aria-label":"Previous page",disabled:g===1,onClick:()=>j(g-1),style:E(!1,g===1),children:t.jsx(C,{d:"15 18 9 12 15 6"})}),I.map((k,A)=>{if(typeof k=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:T.minWidth,height:T.height,fontSize:T.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${k}-${A}`);const O=k,W=O===g;return t.jsx("button",{type:"button","aria-label":`Page ${O}`,"aria-current":W?"page":void 0,onClick:()=>j(O),style:E(W,!1),children:O},O)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:g===N,onClick:()=>j(g+1),style:E(!1,g===N),children:t.jsx(C,{d:"9 18 15 12 9 6"})}),c&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:g===N,onClick:()=>j(N),style:E(!1,g===N),children:[t.jsx(C,{d:"4 18 10 12 4 6"}),t.jsx(C,{d:"14 18 20 12 14 6"})]}),d&&t.jsxs("div",{className:h("flex items-center gap-2 ml-2"),children:[t.jsx("label",{htmlFor:x,className:h("text-sm"),style:{color:p.textMuted,fontSize:T.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:x,value:w,onChange:k=>L(Number(k.target.value)),style:{height:T.height,paddingLeft:T.px,paddingRight:T.px,fontSize:T.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:f.map(k=>t.jsx("option",{value:k,children:k},k))})]})]})]})}go.displayName="TkxPagination";const aa={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},la={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function ca({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 da({src:e,alt:r,fallback:n,placeholder:o="skeleton",fit:i="cover",ratio:l="auto",radius:c="none",caption:d,lazy:u=!1,preview:f=!1,className:s,style:m,...p}){const x=U(),y=te(),[v,b]=a.useState(!1),[g,w]=a.useState(!1),[S,M]=a.useState(!1),N=a.useRef(null),j=R(e),L=r?R(r):"",I=d?R(d):"",T=la[c];a.useEffect(()=>{var V;(V=N.current)!=null&&V.complete&&b(!0)},[]);const $=a.useCallback(()=>b(!0),[]),z=a.useCallback(()=>w(!0),[]),E=a.useCallback(()=>{f&&!g&&M(!0)},[f,g]),C=a.useCallback(()=>M(!1),[]);a.useEffect(()=>{if(!S)return;const V=Q=>{Q.key==="Escape"&&C()};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[S,C]);const k=o==="skeleton"&&!v&&!g,A=k&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},D=g?null:t.jsx("img",{ref:N,src:j,alt:L||void 0,role:L?void 0:"img","aria-label":L?void 0:"Image",loading:u?"lazy":void 0,onLoad:$,onError:z,onClick:f?E:void 0,className:ae(h("block w-full h-full"),f&&!g?h("cursor-pointer"):""),style:{objectFit:i,borderRadius:T,opacity:v?1:0,transition:y?"none":"opacity 200ms ease",position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0},...p}),O=g?n?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{role:"img","aria-label":L||"Image failed to load",className:h("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:x.surfaceAlt,borderRadius:T,color:x.textMuted,minHeight:"80px"},children:[t.jsx(ca,{color:x.textMuted,size:32}),t.jsx("span",{className:h("text-xs"),style:{color:x.textMuted},children:"Failed to load"})]}):null,W=k?t.jsx("div",{"aria-hidden":"true",style:{position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0,width:"100%",height:l==="auto"?"100%":void 0,minHeight:l==="auto"?"80px":void 0,borderRadius:T,backgroundColor:x.surfaceAlt,...A}}):null,H=l==="auto"?t.jsxs("div",{className:h("relative w-full"),style:{borderRadius:T},children:[W,D,O]}):t.jsxs("div",{className:h("relative w-full overflow-hidden"),style:{paddingBottom:aa[l],borderRadius:T},children:[W,D,O]}),B=I?t.jsxs("figure",{className:h("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:T},children:[H,t.jsx("figcaption",{className:h("text-sm text-center"),style:{color:x.textMuted},children:I})]}):H,P=t.jsx("div",{className:ae(h("inline-block w-full"),s),style:m,children:B}),F=S&&typeof document<"u"?Ne.createPortal(t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":L||"Image preview",className:h("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:C,children:[t.jsx("div",{"aria-hidden":"true",className:h("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),t.jsx("img",{src:j,alt:L||"Full-size preview",onClick:V=>V.stopPropagation(),className:h("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:C,className:h("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:[P,F]})}function Ur(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ua({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 fa=0;function pa(){return`tkx-file-${++fa}`}function xa({accept:e,multiple:r=!1,maxSize:n,maxFiles:o,onChange:i,onError:l,label:c="Upload files",hint:d,isDisabled:u=!1,preview:f=!0,dragDrop:s=!0,variant:m="dropzone"}){const p=U(),x=te(),y=a.useId(),v=a.useRef(null),[b,g]=a.useState(!1),[w,S]=a.useState([]);a.useEffect(()=>()=>{w.forEach(W=>{W.objectUrl&&URL.revokeObjectURL(W.objectUrl)})},[]);const M=a.useCallback(W=>{let H=0;const B=setInterval(()=>{H+=Math.floor(Math.random()*20)+10,H>=100&&(H=100,clearInterval(B)),S(P=>P.map(F=>F.id===W?{...F,progress:H}:F))},100)},[]),N=a.useCallback(W=>{if(n&&W.size>n)return`"${R(W.name)}" exceeds max size of ${Ur(n)}`;if(e&&!e.split(",").map(P=>P.trim()).some(P=>P.startsWith(".")?W.name.toLowerCase().endsWith(P.toLowerCase()):P.endsWith("/*")?W.type.startsWith(P.slice(0,-1)):W.type===P))return`"${R(W.name)}" is not an accepted file type`},[e,n]),j=a.useCallback(W=>{const H=o?o-w.length:1/0;if(H<=0){l==null||l(`Maximum of ${o} file${o===1?"":"s"} allowed`);return}const P=W.slice(0,H).map(F=>{const V=N(F),Q=f&&F.type.startsWith("image/")&&!V?URL.createObjectURL(F):void 0;return{file:F,id:pa(),objectUrl:Q,progress:0,error:V}});S(F=>{const V=r?[...F,...P]:P,Q=V.filter(re=>!re.error).map(re=>re.file);return i==null||i(Q),V}),P.forEach(F=>{F.error&&(l==null||l(F.error))}),P.forEach(F=>{F.error||M(F.id)})},[w.length,o,r,i,l,f,M,N]),L=a.useCallback(W=>{const H=Array.from(W.target.files??[]);H.length&&j(H),W.target.value=""},[j]),I=a.useCallback(W=>{if(W.preventDefault(),g(!1),u)return;const H=Array.from(W.dataTransfer.files);H.length&&j(H)},[u,j]),T=a.useCallback(W=>{W.preventDefault(),u||g(!0)},[u]),$=a.useCallback(()=>g(!1),[]),z=a.useCallback(W=>{S(H=>{const B=H.find(F=>F.id===W);B!=null&&B.objectUrl&&URL.revokeObjectURL(B.objectUrl);const P=H.filter(F=>F.id!==W);return i==null||i(P.filter(F=>!F.error).map(F=>F.file)),P})},[i]),E=a.useCallback(()=>{var W;u||(W=v.current)==null||W.click()},[u]),C=b?p.primary:p.border,k=R(c),A=d?R(d):"",D=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":k,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:E,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),E())},onDrop:s?I:void 0,onDragOver:s?T:void 0,onDragLeave:s?$:void 0,className:h("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${C}`,backgroundColor:b?`${p.primary}10`:p.surface,cursor:u?"not-allowed":"pointer",opacity:u?.5:1,transition:x?"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:b?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:h("text-center"),children:[t.jsx("p",{className:h("m-0 text-sm font-medium"),style:{color:p.text},children:b?"Drop files here":k}),A&&t.jsx("p",{id:y,className:h("m-0 text-xs mt-1"),style:{color:p.textMuted},children:A})]})]}),O=t.jsxs("button",{type:"button",disabled:u,onClick:E,"aria-describedby":d?y:void 0,className:h("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"})]}),k,d&&t.jsx("span",{id:y,className:h("sr-only"),children:A})]});return t.jsxs("div",{className:h("flex flex-col gap-3 w-full font-sans"),children:[t.jsx("input",{ref:v,type:"file",accept:e,multiple:r,disabled:u,onChange:L,className:h("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?D:O,w.length>0&&t.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:h("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(W=>t.jsxs("li",{className:h("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:p.surfaceAlt,border:`1px solid ${W.error?p.danger:p.border}`},children:[t.jsxs("div",{className:h("flex items-center gap-3"),children:[W.objectUrl&&f?t.jsx("img",{src:W.objectUrl,alt:R(W.file.name),className:h("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(ua,{mimeType:W.file.type,color:W.error?p.danger:p.textMuted})}),t.jsxs("div",{className:h("flex flex-col gap-0.5 flex-1 min-w-0"),children:[t.jsx("span",{className:h("text-sm font-medium truncate"),style:{color:W.error?p.danger:p.text},title:W.file.name,children:R(W.file.name)}),t.jsxs("span",{className:h("text-xs"),style:{color:p.textMuted},children:[Ur(W.file.size),W.error&&` — ${W.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${R(W.file.name)}`,onClick:()=>z(W.id),className:h("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"})]})})]}),!W.error&&W.progress<100&&t.jsx("div",{className:h("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:`${W.progress}%`,transition:x?"none":"width 100ms ease"}})})]},W.id))})]})}const ha={sm:16,md:24,lg:32,xl:40};function ma({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ga({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ba({size:e,filled:r,color:n,halfFilled:o,id:i}){const l=i?`hg-${i}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&l&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,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:o&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function ya({type:e,size:r,filled:n,color:o,halfFilled:i,uid:l}){const c={size:r,filled:n,color:o,halfFilled:i,id:l};return e==="heart"?t.jsx(ga,{...c}):e==="circle"?t.jsx(ba,{...c}):t.jsx(ma,{...c})}function Kr(e,r,n){return Math.min(n,Math.max(r,e))}function va(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Xr(e,r,n){if(n===1)return r+1;const o=e.currentTarget.getBoundingClientRect(),i=o.left+o.width/2;return e.clientX<i?r+.5:r+1}function ka({value:e,defaultValue:r=0,onChange:n,max:o=5,precision:i=1,size:l="md",isReadOnly:c=!1,isDisabled:d=!1,label:u,showValue:f=!1,colorScheme:s="warning",emptyIcon:m="star",filledIcon:p="star"}){const x=U(),y=te(),v=a.useId(),b=e!==void 0,[g,w]=a.useState(r),[S,M]=a.useState(null),N=a.useRef(null),j=b?e??0:g,L=S??j,T={warning:x.warning,primary:x.primary,danger:x.danger}[s]??x.warning,$=ha[l],z=!c&&!d,E=a.useCallback(W=>{b||w(W),n==null||n(W)},[b,n]),C=a.useCallback((W,H)=>{z&&M(Xr(W,H,i))},[z,i]),k=a.useCallback(()=>{z&&M(null)},[z]),A=a.useCallback((W,H)=>{if(!z)return;const B=Xr(W,H,i);E(B===j?0:B)},[z,i,j,E]),D=a.useCallback(W=>{if(!z)return;const H=i;let B=j;if(W.key==="ArrowRight"||W.key==="ArrowUp")W.preventDefault(),B=Kr(j+H,0,o);else if(W.key==="ArrowLeft"||W.key==="ArrowDown")W.preventDefault(),B=Kr(j-H,0,o);else if(W.key==="Home")W.preventDefault(),B=0;else if(W.key==="End")W.preventDefault(),B=o;else return;B=va(B,i),E(B)},[z,j,o,i,E]),O=u?R(u):"Rating";return t.jsxs("div",{className:ae(h("inline-flex items-center gap-2 font-sans"),d?h("opacity-50"):""),children:[t.jsx("div",{ref:N,role:"radiogroup","aria-label":O,"aria-disabled":d,"aria-readonly":c,tabIndex:z?0:-1,onKeyDown:D,onMouseLeave:k,className:h("flex items-center gap-0.5 outline-none"),style:{cursor:z?"pointer":"default"},children:Array.from({length:o},(W,H)=>{const B=H+1,P=H+.5,F=L>=B,V=!F&&i===.5&&L>=P,Q=`${v}-${H}`;return t.jsx("span",{role:"radio","aria-checked":i===.5&&j===P||j===B,"aria-label":i===.5?`${P} star${P!==1?"s":""} / ${B} star${B!==1?"s":""}`:`${B} star${B!==1?"s":""}`,tabIndex:-1,onMouseMove:re=>C(re,H),onClick:re=>A(re,H),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:S!==null&&L>=P&&z?"scale(1.15)":"scale(1)"},children:t.jsx(ya,{type:F||V?p:m,size:$,filled:F,halfFilled:V,color:F||V?T:x.border,uid:V?Q:void 0})},H)})}),f&&t.jsxs("span",{className:h("text-sm tabular-nums"),style:{color:x.textMuted},"aria-live":"polite","aria-atomic":"true",children:[j%1===0?j.toFixed(0):j.toFixed(1)," / ",o]})]})}let qr=!1;function wa(){if(qr||typeof document>"u")return;qr=!0;const e=document.createElement("style");e.textContent=`
20
+ `,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=o?[...r].reverse():r;return Le.createPortal(e.jsx("div",{"aria-label":"Notifications",className:s.tkx("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:l,children:d.map(u=>e.jsx("div",{className:s.tkx("pointer-events-auto"),children:e.jsx(eo,{toast:u,position:t,onDismiss:_t,reduced:i})},u.id))}),document.body)}const ro={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 Gt({open:t,reduced:r,iconStyle:n,size:i,color:o}){const l=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?e.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:l,flexShrink:0},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?e.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:l,flexShrink:0},children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):e.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:t?"rotate(90deg)":"rotate(0deg)",transition:l,flexShrink:0},children:[e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),e.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function no({isOpen:t,reduced:r,children:n,id:i,triggerId:o}){const l=a.useRef(null),c=a.useRef(null),d=a.useRef(t),u=a.useRef(!1);a.useEffect(()=>{const f=l.current;f&&(t?(f.style.height="auto",f.style.overflow="visible"):(f.style.height="0px",f.style.overflow="hidden"))},[]),a.useEffect(()=>{if(d.current===t)return;d.current=t;const f=l.current,m=c.current;if(!(!f||!m)){if(r){f.style.height=t?"auto":"0px",f.style.overflow=t?"visible":"hidden";return}if(u.current){const p=f.getBoundingClientRect().height;f.style.transition="none",f.style.height=`${p}px`,f.offsetHeight}u.current=!0,f.style.overflow="hidden",t?(f.style.height="0px",f.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{f.style.height=`${m.scrollHeight}px`})})):(f.style.height=`${m.scrollHeight}px`,f.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{f.style.height="0px"})}))}},[t,r]);const x=f=>{if(f.propertyName!=="height")return;u.current=!1;const m=l.current;m&&(t?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return e.jsx("div",{ref:l,id:i,role:"region","aria-labelledby":o,onTransitionEnd:x,style:{willChange:"height"},children:e.jsx("div",{ref:c,children:n})})}function tn({items:t,multiple:r=!1,defaultOpen:n,value:i,onChange:o,variant:l="default",size:c="md",iconPosition:d="right",iconStyle:u="chevron",flush:x=!1,className:f,style:m}){const p=B.useTheme(),h=s.useReducedMotion(),y=a.useId(),k=i!==void 0,b=T=>T?Array.isArray(T)?new Set(T):new Set([T]):new Set,[g,w]=a.useState(()=>b(n)),j=k?b(i):g,S=a.useCallback((T,E)=>{if(E)return;let $;if(k){const I=b(i);$=new Set(I),$.has(T)?$.delete(T):(r||$.clear(),$.add(T))}else{w(I=>{$=new Set(I),$.has(T)?$.delete(T):(r||$.clear(),$.add(T));const W=[...$];return o==null||o(r?W:W[0]??""),$});return}const F=[...$];o==null||o(r?F:F[0]??"")},[r,o,k,i]),z=ro[c],v=()=>{if(x)return{};switch(l){case"bordered":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},N=(T,E,$)=>{if(x)return{};switch(l){case"default":return{borderBottom:$?"none":`1px solid ${p.border}`};case"bordered":return{borderBottom:$?"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{}}},C=T=>l==="ghost"||l==="flush"?T?`${p.primary}10`:`${p.surfaceAlt}80`:T?`${p.primary}0d`:`${p.surfaceAlt}60`,M=l==="separated";return e.jsx("div",{className:s.tkx(f??""),style:{...v(),display:M?"flex":void 0,flexDirection:M?"column":void 0,gap:M?"8px":void 0,...m},children:t.map((T,E)=>{const $=j.has(T.id),F=E===t.length-1,I=`${y}-trigger-${T.id}`,W=`${y}-panel-${T.id}`;return e.jsxs("div",{className:T.className,style:N(E,$,F),children:[e.jsxs("button",{id:I,type:"button",role:"button","aria-expanded":$,"aria-controls":W,disabled:T.disabled,onClick:()=>S(T.id,T.disabled),style:{width:"100%",display:"flex",alignItems:T.subtitle?"flex-start":"center",gap:"8px",padding:z.triggerPadding,border:"none",background:"transparent",cursor:T.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:z.fontSize,fontWeight:500,color:T.disabled?p.textMuted:p.text,opacity:T.disabled?.5:1,transition:h?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:L=>{T.disabled||(L.currentTarget.style.backgroundColor=C($))},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=$?`${p.primary}0d`:"transparent"},onFocus:L=>{T.disabled||(L.currentTarget.style.outline=`2px solid ${p.primary}`,L.currentTarget.style.outlineOffset="2px")},onBlur:L=>{L.currentTarget.style.outline="none"},children:[T.icon&&e.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:T.subtitle?"1px":void 0},children:T.icon}),d==="left"&&e.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:$?p.primary:p.textMuted,marginTop:T.subtitle?"1px":void 0},children:e.jsx(Gt,{open:$,reduced:h,iconStyle:u,size:z.iconSize,color:$?p.primary:p.textMuted})}),e.jsxs("span",{style:{flex:1,minWidth:0},children:[e.jsx("span",{style:{display:"block",lineHeight:1.4},children:T.title}),T.subtitle&&e.jsx("span",{style:{display:"block",fontSize:z.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:T.subtitle})]}),T.badge&&e.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:T.badge}),d==="right"&&e.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:$?p.primary:p.textMuted,marginTop:T.subtitle?"1px":void 0},children:e.jsx(Gt,{open:$,reduced:h,iconStyle:u,size:z.iconSize,color:$?p.primary:p.textMuted})})]}),e.jsx(no,{isOpen:$,reduced:h,id:W,triggerId:I,children:e.jsx("div",{style:{padding:z.contentPadding,fontSize:z.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:T.content})})]},T.id)})})}tn.displayName="TkxAccordion";const so={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let Ft=0;function oo(){++Ft===1&&(document.body.style.overflow="hidden")}function Jt(){--Ft<=0&&(Ft=0,document.body.style.overflow="")}function io(t){switch(t){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function ao(t,r){const n=so[r],i=t==="left"||t==="right",o={position:"absolute"};return i?{...o,top:0,bottom:0,[t]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[t]:0,height:n,maxHeight:"100vh",width:"100%"}}function Qt(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function lo({isOpen:t,onClose:r,placement:n="right",size:i="md",title:o,children:l,footer:c,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const x=B.useTheme(),f=s.useReducedMotion(),m=a.useId(),p=s.useFocusTrap(t);if(s.useEscapeKey(r,u&&t),a.useEffect(()=>(t?oo():Jt(),()=>{t&&Jt()}),[t]),typeof document>"u")return null;const h=ao(n,i),y=io(n),k=f?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",b=typeof o=="string"?s.sanitizeString(o):o;return Le.createPortal(e.jsxs("div",{role:"presentation",className:s.tkx("fixed inset-0 z-[9000]"),style:{pointerEvents:t?"auto":"none",visibility:t?"visible":"hidden"},children:[e.jsx("div",{"aria-hidden":"true",onClick:d?r:void 0,className:s.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:t?1:0,transition:f?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),e.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":o?m:void 0,className:s.tkx("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:t?"translate(0,0)":y,opacity:t?1:0,transition:k,willChange:"transform"},children:[o!==void 0&&e.jsxs("div",{className:s.tkx("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${x.border}`},children:[e.jsx("h2",{id:m,className:s.tkx("m-0 text-base font-semibold leading-snug"),style:{color:x.text},children:b}),e.jsx("button",{onClick:r,"aria-label":"Close drawer",className:s.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:e.jsx(Qt,{})})]}),o===void 0&&e.jsx("div",{className:s.tkx("flex justify-end px-3 pt-3 shrink-0"),children:e.jsx("button",{onClick:r,"aria-label":"Close drawer",className:s.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:e.jsx(Qt,{})})}),e.jsx("div",{className:s.tkx("flex-1 overflow-y-auto px-5 py-4"),style:{color:x.text},children:l}),c&&e.jsx("div",{className:s.tkx("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${x.border}`},children:c})]})]}),document.body)}const co=["Su","Mo","Tu","We","Th","Fr","Sa"],er=["January","February","March","April","May","June","July","August","September","October","November","December"],uo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ve(t,r){return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()&&t.getDate()===r.getDate()}function Ae(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function fo(t,r,n){if(!r||!n)return!1;const i=Ae(t).getTime(),o=Ae(r).getTime(),l=Ae(n).getTime(),c=Math.min(o,l),d=Math.max(o,l);return i>c&&i<d}function tr(t,r,n){return!!(r&&Ve(t,r)||n&&Ve(t,n))}function tt(t,r="en-US"){return t?t.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function xo(t){const r=t.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,i,o]=r.map(Number);if(n<1||n>12||i<1||i>31)return null;const l=new Date(o,n-1,i);return l.getMonth()!==n-1?null:l}function rr(t,r){return new Date(t,r+1,0).getDate()}function po(t,r){const n=new Date(t,r,1).getDay(),i=rr(t,r),o=[],l=rr(t,r-1);for(let d=n-1;d>=0;d--)o.push(new Date(t,r-1,l-d));for(let d=1;d<=i;d++)o.push(new Date(t,r,d));let c=1;for(;o.length<42;)o.push(new Date(t,r+1,c++));return o}function $t(t){return Math.floor(t/10)*10}function ho(){return[{label:"Today",getValue:()=>{const t=Ae(new Date);return[t,t]}},{label:"Yesterday",getValue:()=>{const t=Ae(new Date);return t.setDate(t.getDate()-1),[t,t]}},{label:"Last 7 days",getValue:()=>{const t=Ae(new Date),r=new Date(t);return r.setDate(r.getDate()-6),[r,t]}},{label:"Last 30 days",getValue:()=>{const t=Ae(new Date),r=new Date(t);return r.setDate(r.getDate()-29),[r,t]}},{label:"Last 90 days",getValue:()=>{const t=Ae(new Date),r=new Date(t);return r.setDate(r.getDate()-89),[r,t]}},{label:"This week",getValue:()=>{const t=Ae(new Date),r=new Date(t);r.setDate(r.getDate()-r.getDay());const n=new Date(r);return n.setDate(n.getDate()+6),[r,n]}},{label:"Last week",getValue:()=>{const t=Ae(new Date),r=new Date(t);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 t=new Date;return[new Date(t.getFullYear(),t.getMonth(),1),new Date(t.getFullYear(),t.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const t=new Date;return[new Date(t.getFullYear(),t.getMonth()-1,1),new Date(t.getFullYear(),t.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const t=new Date,r=Math.floor(t.getMonth()/3);return[new Date(t.getFullYear(),r*3,1),new Date(t.getFullYear(),r*3+3,0)]}},{label:"Last quarter",getValue:()=>{const t=new Date,r=Math.floor(t.getMonth()/3),n=r===0?3:r-1,i=r===0?t.getFullYear()-1:t.getFullYear();return[new Date(i,n*3,1),new Date(i,n*3+3,0)]}},{label:"This year",getValue:()=>{const t=new Date().getFullYear();return[new Date(t,0,1),new Date(t,11,31)]}},{label:"Last year",getValue:()=>{const t=new Date().getFullYear()-1;return[new Date(t,0,1),new Date(t,11,31)]}}]}function mo(t,r){const n=t.getBoundingClientRect(),i=window.innerHeight,o=window.scrollY,l=window.scrollX,d=i-n.bottom<r+8&&n.top>r+8;return{top:d?o+n.top-r-4:o+n.bottom+4,left:l+n.left,flipUp:d}}function nr({values:t,selected:r,onSelect:n,label:i,theme:o,format:l}){const c=a.useRef([]),d=a.useRef(null);a.useEffect(()=>{const x=c.current[r];x&&d.current&&x.scrollIntoView({block:"nearest"})},[r]);const u=l??(x=>String(x).padStart(2,"0"));return e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:o.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:i}),e.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${o.border}`,borderRadius:"8px",padding:"4px"},children:t.map(x=>{const f=x===r;return e.jsx("button",{ref:m=>{c.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:f?600:400,backgroundColor:f?o.primary:"transparent",color:f?o.bg:o.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(x)},x)})})]})}function sr({year:t,month:r,today:n,mode:i,selectedDate:o,selectedRange:l,multiDates:c,hoverDate:d,focusedDate:u,isDateDisabled:x,onSelectDate:f,onHoverDate:m,onSetFocused:p,theme:h,locale:y}){const k=po(t,r);return e.jsxs("div",{children:[e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:co.map(b=>e.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:h.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:b},b))}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:k.map((b,g)=>{const w=b.getMonth()===r,j=Ve(b,n),S=b.getDay()===0||b.getDay()===6,z=x(b),v=i==="single"&&o!=null&&Ve(b,o),N=i==="multiple"&&c.some(P=>Ve(P,b)),C=i==="range"&&tr(b,l[0],null),M=i==="range"&&tr(b,null,l[1]),T=C||M,E=i==="range"&&l[0]&&!l[1]&&d?d:l[1],$=i==="range"&&fo(b,l[0],E),F=i==="range"&&l[0]&&!l[1]&&d&&Ve(b,d),I=v||N||T,W=u!=null&&Ve(b,u);let L="transparent",Y=w?S?`${h.text}cc`:h.text:`${h.textMuted}60`,D="none",V=400;I||F?(L=h.primary,Y=h.bg,V=600):$&&(L=`${h.primary}18`),j&&!I&&(D=`2px solid ${h.primary}`,V=600),z&&(Y=`${h.textMuted}50`),W&&!I&&(D=`2px solid ${h.secondary}`);const R=b.toLocaleDateString(y,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return e.jsx("button",{type:"button","aria-label":R,"aria-pressed":I,"aria-disabled":z,disabled:z,onClick:()=>!z&&f(b),onMouseEnter:()=>m(b),onMouseLeave:()=>m(null),onFocus:()=>p(b),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:L,color:Y,border:D,fontSize:"13px",fontWeight:V,cursor:z?"not-allowed":"pointer",opacity:z?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:z?"line-through":"none",transition:"background-color 80ms ease"},children:b.getDate()},g)})})]})}function rn({value:t,onChange:r,rangeValue:n,onRangeChange:i,multiValue:o,onMultiChange:l,mode:c="single",minDate:d,maxDate:u,disabledDates:x,locale:f="en-US",showTime:m=!1,timeValue:p,onTimeChange:h,showPresets:y=!1,customPresets:k,label:b,placeholder:g="MM/DD/YYYY",hint:w,isDisabled:j=!1,isInvalid:S=!1,errorMessage:z,numberOfMonths:v=1,id:N,className:C,style:M}){const T=B.useTheme(),E=a.useId(),$=N??E,F=s.useReducedMotion(),I=Ae(new Date),W=t!==void 0,[L,Y]=a.useState(null),D=W?t??null:L,V=n!==void 0,[R,P]=a.useState([null,null]),A=V?n:R,O=o!==void 0,[G,ee]=a.useState([]),oe=O?o:G,[ae,fe]=a.useState("start"),de=c==="range"||c==="single"&&m,[ge,U]=a.useState([null,null]),[se,he]=a.useState(null),we=D??A[0]??I,[ce,me]=a.useState(we.getFullYear()),[re,le]=a.useState(we.getMonth()),[J,X]=a.useState("day"),[ne,xe]=a.useState({h:0,m:0}),ke=p??ne,[Te,Me]=a.useState(!1),[He,$e]=a.useState(()=>{if(c==="single")return tt(D,f);if(c==="range"){const[K,Z]=A;if(K&&Z)return`${tt(K,f)} – ${tt(Z,f)}`}return""}),[ze,Ke]=a.useState(null),[Xe,De]=a.useState(null),[Pe,Oe]=a.useState({top:0,left:0,flipUp:!1}),[,Ie]=a.useReducer(K=>K+1,0),qe=a.useRef(null),_e=a.useRef(null),Je=a.useRef(null),q=y?420:m?480:360;a.useEffect(()=>{if(c==="single")$e(tt(D,f));else if(c==="range"){const[K,Z]=A;$e(K&&Z?`${tt(K,f)} – ${tt(Z,f)}`:K?tt(K,f):"")}else c==="multiple"&&$e(oe.length>0?`${oe.length} date${oe.length!==1?"s":""} selected`:"")},[D,A,oe,c,f]);const te=a.useCallback(()=>{qe.current&&Oe(mo(qe.current,q))},[q]);a.useEffect(()=>{if(Te)return te(),window.addEventListener("scroll",te,!0),window.addEventListener("resize",te),()=>{window.removeEventListener("scroll",te,!0),window.removeEventListener("resize",te)}},[Te,te]),a.useEffect(()=>{if(!Te)return;const K=Z=>{var ue,Ce;(ue=qe.current)!=null&&ue.contains(Z.target)||(Ce=_e.current)!=null&&Ce.contains(Z.target)||Me(!1)};return document.addEventListener("pointerdown",K),()=>document.removeEventListener("pointerdown",K)},[Te]),a.useEffect(()=>{if(!Te)return;const K=Z=>{var ue;Z.key==="Escape"&&(Me(!1),(ue=Je.current)==null||ue.focus())};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[Te]);const ve=a.useCallback(K=>d&&Ae(K)<Ae(d)||u&&Ae(K)>Ae(u)?!0:x?typeof x=="function"?x(K):x.some(Z=>Ve(Z,K)):!1,[d,u,x]),Se=a.useCallback(K=>{if(!ve(K)){if(c==="single")de?he(K):(W||Y(K),r==null||r(K),$e(tt(K,f)),Me(!1));else if(c==="range")if(ae==="start"){const Z=[K,null];U(Z),V||P(Z),i==null||i(Z),fe("end")}else{const Z=ge[0]??A[0],ue=Z&&K<Z?[K,Z]:[Z,K];U(ue),de?fe("start"):(V||P(ue),i==null||i(ue),fe("start"),Me(!1))}else if(c==="multiple"){const ue=oe.some(Ce=>Ve(Ce,K))?oe.filter(Ce=>!Ve(Ce,K)):[...oe,K];O||ee(ue),l==null||l(ue)}Ie()}},[c,ve,W,V,O,r,i,l,ae,ge,A,oe,de,f]),ye=a.useCallback(()=>{if(c==="single"){const K=se??D;W||Y(K),r==null||r(K)}else c==="range"&&(V||P(ge),i==null||i(ge));Me(!1),fe("start")},[c,se,ge,D,W,V,r,i]),Be=a.useCallback(()=>{he(null),U([null,null]),fe("start"),Me(!1)},[]),Ee=()=>{re===0?(le(11),me(K=>K-1)):le(K=>K-1),X("day")},H=()=>{re===11?(le(0),me(K=>K+1)):le(K=>K+1),X("day")},Q=()=>me(K=>K-1),ie=()=>me(K=>K+1),be=()=>me(K=>K-10),Ye=()=>me(K=>K+10),Qe=K=>{if($e(K),c==="single"){const Z=xo(K);Z&&!ve(Z)&&(W||Y(Z),r==null||r(Z),me(Z.getFullYear()),le(Z.getMonth()))}},lt=K=>{if(K.stopPropagation(),c==="single")W||Y(null),r==null||r(null),$e("");else if(c==="range"){const Z=[null,null];V||P(Z),i==null||i(Z),U(Z),$e(""),fe("start")}else c==="multiple"&&(O||ee([]),l==null||l([]),$e(""))},Mt=K=>{if(J!=="day")return;const Z=ze??D??I;let ue=null;if(K.key==="ArrowRight")ue=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()+1);else if(K.key==="ArrowLeft")ue=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()-1);else if(K.key==="ArrowDown")ue=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()+7);else if(K.key==="ArrowUp")ue=new Date(Z.getFullYear(),Z.getMonth(),Z.getDate()-7);else if(K.key==="Enter"&&ze){Se(ze);return}ue&&(K.preventDefault(),Ke(ue),(ue.getMonth()!==re||ue.getFullYear()!==ce)&&(le(ue.getMonth()),me(ue.getFullYear())))},_=()=>{me(I.getFullYear()),le(I.getMonth()),X("day"),Se(I)},pe=k??ho(),je=K=>{const[Z,ue]=K.getValue(),Ce=[Z,ue];U(Ce),V||P(Ce),i==null||i(Ce),me(Z.getFullYear()),le(Z.getMonth()),fe("start"),de||Me(!1)},Ne=re===11?0:re+1,nt=re===11?ce+1:ce,et=v>=2,ct=b?s.sanitizeString(b):void 0,dt=w?s.sanitizeString(w):void 0,ut=z?s.sanitizeString(z):void 0,bt=s.sanitizeString(g),yt=c==="single"&&D!=null||c==="range"&&(A[0]!=null||A[1]!=null)||c==="multiple"&&oe.length>0,Ze=c==="range"?de?ge:A:[null,null],ls=S?T.danger:Te?T.primary:T.border,cs=Array.from({length:24},(K,Z)=>Z),ds=Array.from({length:60},(K,Z)=>Z),us=e.jsxs("div",{ref:_e,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Mt,style:{position:"absolute",top:Pe.top,left:Pe.left,zIndex:9999,backgroundColor:T.surface,border:`1px solid ${T.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:et?"580px":"300px",maxWidth:et&&y?"780px":et?"620px":y?"520px":"300px",opacity:Te?1:0,transform:Te?"translateY(0) scale(1)":Pe.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:F?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[y&&c==="range"&&e.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${T.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[e.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:T.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),pe.map(K=>{const[Z,ue]=K.getValue(),Ce=Ze[0]&&Ze[1]&&Ve(Ze[0],Z)&&Ve(Ze[1],ue);return e.jsx("button",{type:"button",onClick:()=>je(K),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:Ce?`${T.primary}20`:"transparent",color:Ce?T.primary:T.text,fontWeight:Ce?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:ft=>{Ce||(ft.currentTarget.style.backgroundColor=`${T.surfaceAlt}`)},onMouseLeave:ft=>{Ce||(ft.currentTarget.style.backgroundColor="transparent")},children:K.label},K.label)})]}),e.jsxs("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("button",{type:"button","aria-label":J==="day"?"Previous month":J==="month"?"Previous year":"Previous decade",onClick:()=>{J==="day"?Ee():J==="month"?Q():be()},style:{border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:e.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:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[J==="day"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>X("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:er[re]}),e.jsx("button",{type:"button",onClick:()=>X("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:ce}),et&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:T.textMuted,fontSize:"14px"},children:"–"}),e.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:T.text},children:[er[Ne]," ",nt]})]})]}),J==="month"&&e.jsx("button",{type:"button",onClick:()=>X("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:T.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:ce}),J==="year"&&e.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:T.text},children:[$t(ce),"–",$t(ce)+9]})]}),e.jsx("button",{type:"button","aria-label":J==="day"?"Next month":J==="month"?"Next year":"Next decade",onClick:()=>{J==="day"?H():J==="month"?ie():Ye()},style:{border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:e.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:e.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),J==="day"&&e.jsxs("div",{style:{display:"flex",gap:"20px"},children:[e.jsx(sr,{year:ce,month:re,today:I,mode:c,selectedDate:D,selectedRange:Ze,multiDates:oe,hoverDate:Xe,focusedDate:ze,isDateDisabled:ve,onSelectDate:Se,onHoverDate:De,onSetFocused:Ke,theme:T,locale:f}),et&&e.jsx(sr,{year:nt,month:Ne,today:I,mode:c,selectedDate:D,selectedRange:Ze,multiDates:oe,hoverDate:Xe,focusedDate:ze,isDateDisabled:ve,onSelectDate:Se,onHoverDate:De,onSetFocused:Ke,theme:T,locale:f})]}),J==="month"&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:uo.map((K,Z)=>{const ue=Z===re,Ce=Z===I.getMonth()&&ce===I.getFullYear();return e.jsx("button",{type:"button",onClick:()=>{le(Z),X("day")},style:{padding:"10px",borderRadius:"8px",border:Ce&&!ue?`2px solid ${T.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:ue?600:400,backgroundColor:ue?T.primary:"transparent",color:ue?T.bg:T.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:K},K)})}),J==="year"&&e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(K,Z)=>{const ue=$t(ce)-1+Z,Ce=ue===ce,ft=ue===I.getFullYear(),Ut=Z===0||Z===11;return e.jsx("button",{type:"button",onClick:()=>{me(ue),X("month")},style:{padding:"10px 6px",borderRadius:"8px",border:ft&&!Ce?`2px solid ${T.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:Ce?600:400,backgroundColor:Ce?T.primary:"transparent",color:Ce?T.bg:Ut?T.textMuted:T.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:Ut?.5:1},children:ue},ue)})}),m&&J==="day"&&e.jsxs("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[e.jsx(nr,{values:cs,selected:ke.h,onSelect:K=>{p||xe(Z=>({...Z,h:K})),h==null||h({...ke,h:K})},label:"Hour",theme:T}),e.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:T.textMuted},children:":"}),e.jsx(nr,{values:ds,selected:ke.m,onSelect:K=>{p||xe(Z=>({...Z,m:K})),h==null||h({...ke,m:K})},label:"Min",theme:T})]}),c==="multiple"&&J==="day"&&oe.length>0&&e.jsxs("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"8px",fontSize:"12px",color:T.textMuted,textAlign:"center"},children:[oe.length," date",oe.length!==1?"s":""," selected"]}),e.jsxs("div",{style:{borderTop:`1px solid ${T.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:de?"space-between":"flex-start",gap:"8px"},children:[e.jsx("button",{type:"button",onClick:_,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:T.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),de&&e.jsxs("div",{style:{display:"flex",gap:"6px"},children:[e.jsx("button",{type:"button",onClick:Be,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${T.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:T.text,fontFamily:"inherit"},children:"Cancel"}),e.jsx("button",{type:"button",onClick:ye,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:T.primary,color:T.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return e.jsxs("div",{className:C,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...M},children:[ct&&e.jsx("label",{htmlFor:$,style:{fontSize:"13px",fontWeight:500,color:T.text,marginBottom:"2px"},children:ct}),e.jsxs("div",{ref:qe,style:{display:"flex",alignItems:"center",border:`1.5px solid ${ls}`,borderRadius:"8px",backgroundColor:T.surface,overflow:"hidden",transition:F?"none":"border-color 120ms ease",opacity:j?.5:1},children:[e.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:T.textMuted,flexShrink:0},children:e.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:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),e.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),e.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),e.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),e.jsx("input",{ref:Je,id:$,type:"text",value:He,placeholder:bt,disabled:j,"aria-invalid":S,"aria-haspopup":"dialog","aria-expanded":Te,readOnly:c==="range"||c==="multiple",onChange:K=>Qe(K.target.value),onFocus:()=>{j||Me(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:T.text,cursor:c!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),yt&&!j&&e.jsx("button",{type:"button","aria-label":"Clear selection",onClick:lt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:T.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:e.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:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),e.jsx("button",{type:"button","aria-label":Te?"Close calendar":"Open calendar",tabIndex:-1,disabled:j,onClick:()=>{j||Me(K=>!K)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:j?"not-allowed":"pointer",color:T.textMuted,flexShrink:0},children:e.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:Te?"rotate(180deg)":"rotate(0deg)",transition:F?"none":"transform 160ms ease"},children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),dt&&!S&&e.jsx("span",{style:{fontSize:"12px",color:T.textMuted},children:dt}),S&&ut&&e.jsx("span",{role:"alert",style:{fontSize:"12px",color:T.danger},children:ut}),Te&&typeof document<"u"&&Le.createPortal(us,document.body)]})}rn.displayName="TkxDatePicker";const go={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function it(t,r,n){return Math.min(Math.max(t,r),n)}function Wt(t,r,n){return Math.round((t-r)/n)*n+r}function Ge(t,r,n){return(t-r)/(n-r)*100}function zt({value:t,min:r,max:n,step:i,isDisabled:o,trackColor:l,thumbSize:c,ariaLabel:d,tooltipMode:u,formatValue:x,orientation:f,onChange:m,onChangeEnd:p}){const[h,y]=a.useState(!1),[k,b]=a.useState(!1),[g,w]=a.useState(!1),j=M=>{o||(M.key==="ArrowRight"||M.key==="ArrowUp"?(M.preventDefault(),m(it(Wt(t+i,r,i),r,n))):M.key==="ArrowLeft"||M.key==="ArrowDown"?(M.preventDefault(),m(it(Wt(t-i,r,i),r,n))):M.key==="Home"?(M.preventDefault(),m(r)):M.key==="End"&&(M.preventDefault(),m(n)))},S=f==="vertical",z=Ge(t,r,n),v=u==="always"||u==="hover"&&(g||k||h),N=S?{position:"absolute",bottom:`${z}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${c/2}px`,zIndex:2,cursor:o?"not-allowed":"grab"}:{position:"absolute",left:`${z}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${c/2}px`,zIndex:2,cursor:o?"not-allowed":"grab"},C=S?{position:"absolute",left:c+6,top:"50%",transform:"translateY(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:c+6,left:"50%",transform:"translateX(-50%)",backgroundColor:l,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return e.jsxs("div",{style:N,children:[v&&e.jsx("div",{style:C,children:x(t)}),e.jsx("div",{role:"slider",tabIndex:o?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":t,"aria-disabled":o,"aria-orientation":f,onKeyDown:j,onFocus:()=>y(!0),onBlur:()=>y(!1),onPointerEnter:()=>w(!0),onPointerLeave:()=>w(!1),onPointerDown:M=>{o||(b(!0),M.target.setPointerCapture(M.pointerId))},onPointerUp:()=>{b(!1),p==null||p()},style:{width:c,height:c,borderRadius:"50%",backgroundColor:o?"#888":l,border:"3px solid #fff",boxShadow:h?`0 0 0 3px ${l}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function nn({value:t,defaultValue:r=0,onChange:n,rangeValue:i,onRangeChange:o,min:l=0,max:c=100,step:d=1,isRange:u=!1,label:x,showValue:f=!1,showTicks:m=!1,tickCount:p=5,isDisabled:h=!1,colorScheme:y="primary",size:k="md",marks:b,orientation:g="horizontal",showTooltip:w=!1,formatValue:j,onChangeEnd:S,onRangeChangeEnd:z,gradient:v=!1}){const N=B.useTheme(),C=a.useId(),M=s.useReducedMotion(),T=t!==void 0,[E,$]=a.useState(r),F=T?t:E,I=i!==void 0,[W,L]=a.useState([l,c]),Y=I?i:W,D=a.useRef(null),V=a.useRef(F);V.current=F;const R=a.useRef(Y);R.current=Y;const P={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[y],A=go[k],O=g==="vertical",G=w===!0?"hover":w===!1?!1:w,ee=j??(re=>String(re)),oe=P+"66",ae=a.useCallback((re,le)=>{const J=D.current;if(!J)return l;const X=J.getBoundingClientRect();let ne;O?ne=it((X.bottom-(le??0))/X.height,0,1):ne=it((re-X.left)/X.width,0,1);const xe=ne*(c-l)+l;return it(Wt(xe,l,d),l,c)},[l,c,d,O]),fe=a.useCallback(re=>{if(h)return;const le=ae(re.clientX,re.clientY);if(!u)T||$(le),n==null||n(le);else{const[J,X]=Y,ne=Math.abs(le-J),xe=Math.abs(le-X),ke=ne<=xe?[le,X]:[J,le];I||L(ke),o==null||o(ke)}},[h,u,T,I,ae,n,o,Y]),de=re=>{T||$(re),n==null||n(re)},ge=re=>{const le=[it(re,l,Y[1]),Y[1]];I||L(le),o==null||o(le)},U=re=>{const le=[Y[0],it(re,Y[0],c)];I||L(le),o==null||o(le)},se=u?Ge(Y[0],l,c):0,he=Ge(u?Y[1]:F,l,c),we=m?Array.from({length:p},(re,le)=>l+le/(p-1)*(c-l)):[],ce=x?s.sanitizeString(x):void 0,me=M?"none":"background 150ms ease";return e.jsxs("div",{className:s.tkx("flex flex-col gap-2"),style:{opacity:h?.55:1,...O?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(ce||f)&&e.jsxs("div",{className:s.tkx("flex items-center justify-between"),children:[ce&&e.jsx("label",{htmlFor:C,className:s.tkx("text-sm font-medium"),style:{color:N.text,fontSize:A.fontSize},children:ce}),f&&!u&&e.jsx("span",{className:s.tkx("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:ee(F)}),f&&u&&e.jsxs("span",{className:s.tkx("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:[ee(Y[0])," – ",ee(Y[1])]})]}),e.jsxs("div",{style:{position:"relative",...O?{paddingLeft:A.thumb/2,paddingRight:A.thumb/2,flex:1}:{paddingTop:A.thumb/2,paddingBottom:A.thumb/2}},children:[e.jsxs("div",{ref:D,onPointerDown:fe,style:{position:"relative",...O?{width:A.track,height:"100%"}:{height:A.track},borderRadius:9999,backgroundColor:N.border,cursor:h?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[e.jsx("div",{style:{position:"absolute",...O?{left:0,bottom:`${se}%`,height:`${he-se}%`,width:"100%"}:{top:0,left:`${se}%`,width:`${he-se}%`,height:"100%"},borderRadius:9999,...h?{backgroundColor:N.textMuted}:v?{background:O?`linear-gradient(to top, ${oe}, ${P})`:`linear-gradient(to right, ${oe}, ${P})`}:{backgroundColor:P},transition:me}}),we.map((re,le)=>e.jsx("div",{style:{position:"absolute",...O?{bottom:`${Ge(re,l,c)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:A.track+4}:{left:`${Ge(re,l,c)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:A.track+4},backgroundColor:N.surface,borderRadius:9999,pointerEvents:"none"}},le)),u?e.jsxs(e.Fragment,{children:[e.jsx(zt,{value:Y[0],min:l,max:Y[1],step:d,isDisabled:h,trackColor:P,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${ce??"Range"} start`,tooltipMode:G,formatValue:ee,orientation:g,onChange:ge,onChangeEnd:z?()=>z(R.current):void 0}),e.jsx(zt,{value:Y[1],min:Y[0],max:c,step:d,isDisabled:h,trackColor:P,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${ce??"Range"} end`,tooltipMode:G,formatValue:ee,orientation:g,onChange:U,onChangeEnd:z?()=>z(R.current):void 0})]}):e.jsx(zt,{value:F,min:l,max:c,step:d,isDisabled:h,trackColor:P,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:ce??"Slider",tooltipMode:G,formatValue:ee,orientation:g,onChange:de,onChangeEnd:S?()=>S(V.current):void 0})]}),b&&b.length>0&&e.jsx("div",{style:{position:O?"absolute":"relative",...O?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:b.map((re,le)=>e.jsx("div",{style:{position:"absolute",...O?{bottom:`${Ge(re.value,l,c)}%`,transform:"translateY(50%)",left:0}:{left:`${Ge(re.value,l,c)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:N.textMuted,whiteSpace:"nowrap"},children:s.sanitizeString(re.label)},le))})]}),m&&!b&&!O&&e.jsx("div",{style:{position:"relative",height:"1rem"},children:we.map((re,le)=>e.jsx("span",{style:{position:"absolute",left:`${Ge(re,l,c)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:N.textMuted},children:ee(Math.round(re))},le))})]})}nn.displayName="TkxSlider";const bo={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 yo(t,r,n,i){if(r<=1)return[1];const o=(y,k)=>Array.from({length:Math.max(0,k-y+1)},(b,g)=>y+g),l=Math.max(t-n,1),c=Math.min(t+n,r);if(!i){const y=[];return l>1&&y.push("..."),y.push(...o(l,c)),c<r&&y.push("..."),y}const d=1,u=r,x=l>d+2,f=c<u-2,m=[];m.push(1),x?m.push("left-ellipsis"):m.push(...o(2,l-1)),m.push(...o(Math.max(l,2),Math.min(c,r-1))),f?m.push("right-ellipsis"):m.push(...o(c+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 sn({total:t,pageSize:r=10,page:n,defaultPage:i=1,onChange:o,siblingCount:l=1,showEdges:c=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:x=[10,25,50,100],size:f="md",variant:m="default"}){const p=B.useTheme(),h=a.useId(),y=n!==void 0,[k,b]=a.useState(i),g=y?n:k,[w,j]=a.useState(r),S=r,z=Math.max(1,Math.ceil(t/S)),v=I=>{const W=Math.min(Math.max(I,1),z);W!==g&&(y||b(W),o==null||o(W))},N=I=>{j(I),u==null||u(I),v(1)},C=yo(g,z,l,c),M=bo[f],T=Math.min((g-1)*S+1,t),E=Math.min(g*S,t),$=(I,W)=>{const L={height:M.height,minWidth:M.minWidth,paddingLeft:M.px,paddingRight:M.px,fontSize:M.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:W?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:W?.4:1};return I?{...L,backgroundColor:p.primary,color:p.bg,fontWeight:600,boxShadow:`0 0 0 2px ${p.primary}44`}:m==="default"?{...L,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`}:m==="outline"?{...L,backgroundColor:"transparent",color:p.text,border:`1px solid ${p.border}`}:{...L,backgroundColor:"transparent",color:p.text}},F=({d:I})=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:e.jsx("polyline",{points:I})});return e.jsxs("nav",{"aria-label":"Pagination",className:s.tkx("flex flex-col gap-2"),children:[t>0&&e.jsx("p",{className:s.tkx("text-sm"),style:{color:p.textMuted,fontSize:M.fontSize},children:s.sanitizeString(`Showing ${T}–${E} of ${t} items`)}),e.jsxs("div",{className:s.tkx("flex items-center gap-1 flex-wrap"),children:[c&&e.jsxs("button",{type:"button","aria-label":"First page",disabled:g===1,onClick:()=>v(1),style:$(!1,g===1),children:[e.jsx(F,{d:"15 18 9 12 15 6"}),e.jsx(F,{d:"20 18 14 12 20 6"})]}),e.jsx("button",{type:"button","aria-label":"Previous page",disabled:g===1,onClick:()=>v(g-1),style:$(!1,g===1),children:e.jsx(F,{d:"15 18 9 12 15 6"})}),C.map((I,W)=>{if(typeof I=="string")return e.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:M.minWidth,height:M.height,fontSize:M.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${I}-${W}`);const Y=I,D=Y===g;return e.jsx("button",{type:"button","aria-label":`Page ${Y}`,"aria-current":D?"page":void 0,onClick:()=>v(Y),style:$(D,!1),children:Y},Y)}),e.jsx("button",{type:"button","aria-label":"Next page",disabled:g===z,onClick:()=>v(g+1),style:$(!1,g===z),children:e.jsx(F,{d:"9 18 15 12 9 6"})}),c&&e.jsxs("button",{type:"button","aria-label":"Last page",disabled:g===z,onClick:()=>v(z),style:$(!1,g===z),children:[e.jsx(F,{d:"4 18 10 12 4 6"}),e.jsx(F,{d:"14 18 20 12 14 6"})]}),d&&e.jsxs("div",{className:s.tkx("flex items-center gap-2 ml-2"),children:[e.jsx("label",{htmlFor:h,className:s.tkx("text-sm"),style:{color:p.textMuted,fontSize:M.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),e.jsx("select",{id:h,value:w,onChange:I=>N(Number(I.target.value)),style:{height:M.height,paddingLeft:M.px,paddingRight:M.px,fontSize:M.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:x.map(I=>e.jsx("option",{value:I,children:I},I))})]})]})]})}sn.displayName="TkxPagination";const ko={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},vo={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function wo({color:t,size:r}){return e.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function jo({src:t,alt:r,fallback:n,placeholder:i="skeleton",fit:o="cover",ratio:l="auto",radius:c="none",caption:d,lazy:u=!0,preview:x=!1,className:f,style:m,...p}){const h=B.useTheme(),y=s.useReducedMotion(),[k,b]=a.useState(!1),[g,w]=a.useState(!1),[j,S]=a.useState(!1),z=a.useRef(null),v=s.sanitizeString(t),N=r?s.sanitizeString(r):"",C=d?s.sanitizeString(d):"",M=vo[c];a.useEffect(()=>{var O;(O=z.current)!=null&&O.complete&&b(!0)},[]);const T=a.useCallback(()=>b(!0),[]),E=a.useCallback(()=>w(!0),[]),$=a.useCallback(()=>{x&&!g&&S(!0)},[x,g]),F=a.useCallback(()=>S(!1),[]);a.useEffect(()=>{if(!j)return;const O=G=>{G.key==="Escape"&&F()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[j,F]);const I=i==="skeleton"&&!k&&!g,W=I&&!y?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},L=g?null:e.jsx("img",{ref:z,src:v,alt:N||void 0,role:N?void 0:"img","aria-label":N?void 0:"Image",loading:u?"lazy":void 0,onLoad:T,onError:E,onClick:x?$:void 0,className:s.cx(s.tkx("block w-full h-full"),x&&!g?s.tkx("cursor-pointer"):""),style:{objectFit:o,borderRadius:M,opacity:k?1:0,transition:y?"none":"opacity 200ms ease",position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0},...p}),Y=g?n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{role:"img","aria-label":N||"Image failed to load",className:s.tkx("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:h.surfaceAlt,borderRadius:M,color:h.textMuted,minHeight:"80px"},children:[e.jsx(wo,{color:h.textMuted,size:32}),e.jsx("span",{className:s.tkx("text-xs"),style:{color:h.textMuted},children:"Failed to load"})]}):null,D=I?e.jsx("div",{"aria-hidden":"true",style:{position:l==="auto"?void 0:"absolute",inset:l==="auto"?void 0:0,width:"100%",height:l==="auto"?"100%":void 0,minHeight:l==="auto"?"80px":void 0,borderRadius:M,backgroundColor:h.surfaceAlt,...W}}):null,V=l==="auto"?e.jsxs("div",{className:s.tkx("relative w-full"),style:{borderRadius:M},children:[D,L,Y]}):e.jsxs("div",{className:s.tkx("relative w-full overflow-hidden"),style:{paddingBottom:ko[l],borderRadius:M},children:[D,L,Y]}),R=C?e.jsxs("figure",{className:s.tkx("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:M},children:[V,e.jsx("figcaption",{className:s.tkx("text-sm text-center"),style:{color:h.textMuted},children:C})]}):V,P=e.jsx("div",{className:s.cx(s.tkx("inline-block w-full"),f),style:m,children:R}),A=j&&typeof document<"u"?Le.createPortal(e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":N||"Image preview",className:s.tkx("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:F,children:[e.jsx("div",{"aria-hidden":"true",className:s.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),e.jsx("img",{src:v,alt:N||"Full-size preview",onClick:O=>O.stopPropagation(),className:s.tkx("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),e.jsx("button",{"aria-label":"Close preview",onClick:F,className:s.tkx("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:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null;return e.jsxs(e.Fragment,{children:[P,A]})}function or(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function So({mimeType:t,color:r}){return t.startsWith("image/")?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("path",{d:"M21 15l-5-5L5 21"})]}):t==="application/pdf"?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),e.jsx("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}let Co=0;function To(){return`tkx-file-${++Co}`}function Mo({accept:t,multiple:r=!1,maxSize:n,maxFiles:i,onChange:o,onError:l,label:c="Upload files",hint:d,isDisabled:u=!1,preview:x=!0,dragDrop:f=!0,variant:m="dropzone"}){const p=B.useTheme(),h=s.useReducedMotion(),y=a.useId(),k=a.useRef(null),[b,g]=a.useState(!1),[w,j]=a.useState([]);a.useEffect(()=>()=>{w.forEach(D=>{D.objectUrl&&URL.revokeObjectURL(D.objectUrl)})},[]);const S=a.useCallback(D=>{let V=0;const R=setInterval(()=>{V+=Math.floor(Math.random()*20)+10,V>=100&&(V=100,clearInterval(R)),j(P=>P.map(A=>A.id===D?{...A,progress:V}:A))},100)},[]),z=a.useCallback(D=>{if(n&&D.size>n)return`"${s.sanitizeString(D.name)}" exceeds max size of ${or(n)}`;if(t&&!t.split(",").map(P=>P.trim()).some(P=>P.startsWith(".")?D.name.toLowerCase().endsWith(P.toLowerCase()):P.endsWith("/*")?D.type.startsWith(P.slice(0,-1)):D.type===P))return`"${s.sanitizeString(D.name)}" is not an accepted file type`},[t,n]),v=a.useCallback(D=>{const V=i?i-w.length:1/0;if(V<=0){l==null||l(`Maximum of ${i} file${i===1?"":"s"} allowed`);return}const P=D.slice(0,V).map(A=>{const O=z(A),G=x&&A.type.startsWith("image/")&&!O?URL.createObjectURL(A):void 0;return{file:A,id:To(),objectUrl:G,progress:0,error:O}});j(A=>{const O=r?[...A,...P]:P,G=O.filter(ee=>!ee.error).map(ee=>ee.file);return o==null||o(G),O}),P.forEach(A=>{A.error&&(l==null||l(A.error))}),P.forEach(A=>{A.error||S(A.id)})},[w.length,i,r,o,l,x,S,z]),N=a.useCallback(D=>{const V=Array.from(D.target.files??[]);V.length&&v(V),D.target.value=""},[v]),C=a.useCallback(D=>{if(D.preventDefault(),g(!1),u)return;const V=Array.from(D.dataTransfer.files);V.length&&v(V)},[u,v]),M=a.useCallback(D=>{D.preventDefault(),u||g(!0)},[u]),T=a.useCallback(()=>g(!1),[]),E=a.useCallback(D=>{j(V=>{const R=V.find(A=>A.id===D);R!=null&&R.objectUrl&&URL.revokeObjectURL(R.objectUrl);const P=V.filter(A=>A.id!==D);return o==null||o(P.filter(A=>!A.error).map(A=>A.file)),P})},[o]),$=a.useCallback(()=>{var D;u||(D=k.current)==null||D.click()},[u]),F=b?p.primary:p.border,I=s.sanitizeString(c),W=d?s.sanitizeString(d):"",L=e.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":I,"aria-describedby":d?y:void 0,"aria-disabled":u,onClick:$,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),$())},onDrop:f?C:void 0,onDragOver:f?M:void 0,onDragLeave:f?T:void 0,className:s.tkx("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${F}`,backgroundColor:b?`${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:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:b?p.primary:p.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),e.jsxs("div",{className:s.tkx("text-center"),children:[e.jsx("p",{className:s.tkx("m-0 text-sm font-medium"),style:{color:p.text},children:b?"Drop files here":I}),W&&e.jsx("p",{id:y,className:s.tkx("m-0 text-xs mt-1"),style:{color:p.textMuted},children:W})]})]}),Y=e.jsxs("button",{type:"button",disabled:u,onClick:$,"aria-describedby":d?y:void 0,className:s.tkx("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:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),I,d&&e.jsx("span",{id:y,className:s.tkx("sr-only"),children:W})]});return e.jsxs("div",{className:s.tkx("flex flex-col gap-3 w-full font-sans"),children:[e.jsx("input",{ref:k,type:"file",accept:t,multiple:r,disabled:u,onChange:N,className:s.tkx("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?L:Y,w.length>0&&e.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:s.tkx("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:w.map(D=>e.jsxs("li",{className:s.tkx("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:p.surfaceAlt,border:`1px solid ${D.error?p.danger:p.border}`},children:[e.jsxs("div",{className:s.tkx("flex items-center gap-3"),children:[D.objectUrl&&x?e.jsx("img",{src:D.objectUrl,alt:s.sanitizeString(D.file.name),className:s.tkx("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):e.jsx("span",{style:{flexShrink:0},children:e.jsx(So,{mimeType:D.file.type,color:D.error?p.danger:p.textMuted})}),e.jsxs("div",{className:s.tkx("flex flex-col gap-0.5 flex-1 min-w-0"),children:[e.jsx("span",{className:s.tkx("text-sm font-medium truncate"),style:{color:D.error?p.danger:p.text},title:D.file.name,children:s.sanitizeString(D.file.name)}),e.jsxs("span",{className:s.tkx("text-xs"),style:{color:p.textMuted},children:[or(D.file.size),D.error&&` — ${D.error}`]})]}),e.jsx("button",{type:"button","aria-label":`Remove ${s.sanitizeString(D.file.name)}`,onClick:()=>E(D.id),className:s.tkx("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:p.textMuted,flexShrink:0},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!D.error&&D.progress<100&&e.jsx("div",{className:s.tkx("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:p.border},"aria-hidden":"true",children:e.jsx("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:p.primary,width:`${D.progress}%`,transition:h?"none":"width 100ms ease"}})})]},D.id))})]})}const $o={sm:16,md:24,lg:32,xl:40};function zo({size:t,filled:r,color:n,halfFilled:i,id:o}){const l=o?`hg-${o}`:void 0;return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&l&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:l,x1:"0",x2:"1",y1:"0",y2:"0",children:[e.jsx("stop",{offset:"50%",stopColor:n}),e.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),e.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&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Io({size:t,filled:r,color:n,halfFilled:i,id:o}){const l=o?`hg-${o}`:void 0;return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&l&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:l,x1:"0",x2:"1",y1:"0",y2:"0",children:[e.jsx("stop",{offset:"50%",stopColor:n}),e.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),e.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&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Eo({size:t,filled:r,color:n,halfFilled:i,id:o}){const l=o?`hg-${o}`:void 0;return e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&l&&e.jsx("defs",{children:e.jsxs("linearGradient",{id:l,x1:"0",x2:"1",y1:"0",y2:"0",children:[e.jsx("stop",{offset:"50%",stopColor:n}),e.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:i&&l?`url(#${l})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function No({type:t,size:r,filled:n,color:i,halfFilled:o,uid:l}){const c={size:r,filled:n,color:i,halfFilled:o,id:l};return t==="heart"?e.jsx(Io,{...c}):t==="circle"?e.jsx(Eo,{...c}):e.jsx(zo,{...c})}function ir(t,r,n){return Math.min(n,Math.max(r,t))}function Ro(t,r){return r===1?Math.round(t):Math.round(t*2)/2}function ar(t,r,n){if(n===1)return r+1;const i=t.currentTarget.getBoundingClientRect(),o=i.left+i.width/2;return t.clientX<o?r+.5:r+1}function Lo({value:t,defaultValue:r=0,onChange:n,max:i=5,precision:o=1,size:l="md",isReadOnly:c=!1,isDisabled:d=!1,label:u,showValue:x=!1,colorScheme:f="warning",emptyIcon:m="star",filledIcon:p="star"}){const h=B.useTheme(),y=s.useReducedMotion(),k=a.useId(),b=t!==void 0,[g,w]=a.useState(r),[j,S]=a.useState(null),z=a.useRef(null),v=b?t??0:g,N=j??v,M={warning:h.warning,primary:h.primary,danger:h.danger}[f]??h.warning,T=$o[l],E=!c&&!d,$=a.useCallback(D=>{b||w(D),n==null||n(D)},[b,n]),F=a.useCallback((D,V)=>{E&&S(ar(D,V,o))},[E,o]),I=a.useCallback(()=>{E&&S(null)},[E]),W=a.useCallback((D,V)=>{if(!E)return;const R=ar(D,V,o);$(R===v?0:R)},[E,o,v,$]),L=a.useCallback(D=>{if(!E)return;const V=o;let R=v;if(D.key==="ArrowRight"||D.key==="ArrowUp")D.preventDefault(),R=ir(v+V,0,i);else if(D.key==="ArrowLeft"||D.key==="ArrowDown")D.preventDefault(),R=ir(v-V,0,i);else if(D.key==="Home")D.preventDefault(),R=0;else if(D.key==="End")D.preventDefault(),R=i;else return;R=Ro(R,o),$(R)},[E,v,i,o,$]),Y=u?s.sanitizeString(u):"Rating";return e.jsxs("div",{className:s.cx(s.tkx("inline-flex items-center gap-2 font-sans"),d?s.tkx("opacity-50"):""),children:[e.jsx("div",{ref:z,role:"radiogroup","aria-label":Y,"aria-disabled":d,"aria-readonly":c,tabIndex:E?0:-1,onKeyDown:L,onMouseLeave:I,className:s.tkx("flex items-center gap-0.5 outline-none"),style:{cursor:E?"pointer":"default"},children:Array.from({length:i},(D,V)=>{const R=V+1,P=V+.5,A=N>=R,O=!A&&o===.5&&N>=P,G=`${k}-${V}`;return e.jsx("span",{role:"radio","aria-checked":o===.5&&v===P||v===R,"aria-label":o===.5?`${P} star${P!==1?"s":""} / ${R} star${R!==1?"s":""}`:`${R} star${R!==1?"s":""}`,tabIndex:-1,onMouseMove:ee=>F(ee,V),onClick:ee=>W(ee,V),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:j!==null&&N>=P&&E?"scale(1.15)":"scale(1)"},children:e.jsx(No,{type:A||O?p:m,size:T,filled:A,halfFilled:O,color:A||O?M:h.border,uid:O?G:void 0})},V)})}),x&&e.jsxs("span",{className:s.tkx("text-sm tabular-nums"),style:{color:h.textMuted},"aria-live":"polite","aria-atomic":"true",children:[v%1===0?v.toFixed(0):v.toFixed(1)," / ",i]})]})}let lr=!1;function Do(){if(lr||typeof document>"u")return;lr=!0;const t=document.createElement("style");t.textContent=`
24
21
  @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }
25
22
  @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }
26
23
  .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }
27
24
  .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }
28
25
  .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }
29
26
  .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }
30
- `,document.head.appendChild(e)}function ja(){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 Sa(){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 bo(){const e=U();return t.jsxs("div",{className:h("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 yo({message:e,showTimestamp:r,avatarUser:n,avatarAssistant:o}){const i=U(),l=te(),{role:c,content:d,timestamp:u,isStreaming:f,error:s}=e,m=R(d),p=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if(c==="system")return t.jsx("div",{role:"listitem",className:h("flex justify-center my-2"),children:t.jsx("p",{className:h("text-xs italic px-3 py-1 rounded-full"),style:{color:i.textMuted,backgroundColor:i.surfaceAlt},children:m})});const x=c==="user",y=x?n??t.jsx(ja,{}):o??t.jsx(Sa,{}),v=x?{backgroundColor:i.primary,color:i.bg}:{backgroundColor:i.surface,color:i.text,border:`1px solid ${s?i.danger:i.border}`};return s&&(v.borderColor=i.danger,v.borderWidth="2px"),t.jsxs("div",{role:"listitem",className:h("flex gap-2 mb-4",x?"flex-row-reverse":"flex-row"),children:[t.jsx("div",{className:h("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:x?i.primary:i.secondary},children:y}),t.jsxs("div",{className:h("flex flex-col gap-1 max-w-[75%]",x?"items-end":"items-start"),children:[t.jsxs("div",{className:ae(h("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),f&&!l?"tkx-cursor":""),style:v,children:[m,s&&t.jsx("span",{"aria-label":"Error",style:{marginLeft:6,color:i.danger},children:"⚠"})]}),r&&p&&t.jsx("span",{className:h("text-[10px]"),style:{color:i.textMuted},children:p})]})]})}function $a({messages:e,onSend:r,isLoading:n=!1,placeholder:o="Type a message…",maxLength:i,showTimestamps:l=!1,avatarUser:c,avatarAssistant:d,height:u=480,inputPosition:f="bottom"}){const s=U(),m=te(),[p,x]=a.useState(""),y=a.useRef(null),v=a.useRef(null);a.useEffect(()=>{wa()},[]),a.useEffect(()=>{const L=y.current;L&&L.scrollTo({top:L.scrollHeight,behavior:m?"auto":"smooth"})},[e,n,m]);const b=a.useCallback(()=>{const L=p.trim();!L||!r||(r(L),x(""),v.current&&(v.current.style.height="auto"))},[p,r]),g=a.useCallback(L=>{L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),b())},[b]),w=a.useCallback(L=>{const I=i?L.target.value.slice(0,i):L.target.value;x(I);const T=v.current;if(T){T.style.height="auto";const z=24*4+24;T.style.height=`${Math.min(T.scrollHeight,z)}px`}},[i]),S=p.trim().length>0&&!n,M=typeof u=="number"?`${u}px`:u,N=f==="floating",j=t.jsxs("div",{className:h("flex flex-col gap-1 p-3"),style:N?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:s.surface,border:`1px solid ${s.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${s.border}`,backgroundColor:s.surface},children:[t.jsxs("div",{className:h("flex items-end gap-2"),children:[t.jsx("textarea",{ref:v,rows:1,value:p,onChange:w,onKeyDown:g,placeholder:R(o),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:h("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:s.text,caretColor:s.primary,minHeight:32,maxHeight:120}}),t.jsx("button",{onClick:b,disabled:!S,"aria-label":"Send message",className:h("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!m&&"transition-opacity duration-150",S?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:s.primary,color:s.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"})})})]}),i&&t.jsxs("div",{className:h("text-right text-[10px]"),style:{color:s.textMuted},children:[p.length,"/",i]})]});return t.jsxs("div",{className:h("flex flex-col overflow-hidden rounded-2xl"),style:{height:M,backgroundColor:s.bg,border:`1px solid ${s.border}`,position:"relative"},children:[t.jsx("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:h("flex-1 overflow-y-auto p-4"),style:{paddingBottom:N?80:void 0},children:t.jsxs("div",{role:"list",children:[e.map(L=>t.jsx(yo,{message:L,showTimestamp:l,avatarUser:c,avatarAssistant:d},L.id)),n&&t.jsxs("div",{role:"listitem",className:h("flex gap-2 mb-4"),children:[t.jsx("div",{className:h("w-8 h-8 shrink-0")}),t.jsx(bo,{})]})]})}),j]})}const Ma={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Ca={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},Ta={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},Ea={sm:12,md:14,lg:16};function Ia(e,r){const n=U(),i={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:i,color:n.bg,border:"transparent"}:r==="subtle"?{bg:`${i}22`,color:i,border:"transparent"}:{bg:"transparent",color:i,border:i}}function vo({variant:e="subtle",size:r="md",colorScheme:n="default",onRemove:o,leftIcon:i,isDisabled:l=!1,clickable:c=!1,children:d,className:u,style:f,onClick:s,...m}){U();const p=te(),x=Ia(n,e),y=typeof d=="string"?R(d):d,v=Ea[r],b=h("inline-flex items-center font-medium rounded-full select-none",Ma[r],Ca[r],Ta[r],l?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!p&&"transition-opacity duration-150");return t.jsxs("span",{role:c?"button":void 0,tabIndex:c&&!l?0:void 0,"aria-disabled":l||void 0,className:ae(b,u),style:{backgroundColor:x.bg,color:x.color,border:`1px solid ${x.border==="transparent"?"transparent":x.border}`,...f},onClick:l?void 0:s,onKeyDown:c&&!l&&s?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),s(g))}:void 0,...m,children:[i&&t.jsx("span",{"aria-hidden":"true",className:h("shrink-0 flex items-center"),children:i}),t.jsx("span",{children:y}),o&&!l&&t.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:g=>{g.stopPropagation(),o()},className:h("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:v+4,height:v+4,color:x.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:t.jsx("svg",{width:v,height:v,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 Na({value:e,defaultValue:r=[],onChange:n,placeholder:o="Add tag…",maxTags:i,allowDuplicates:l=!1,validate:c,colorScheme:d="primary",size:u="md",label:f,hint:s,isDisabled:m=!1}){const p=U(),x=te(),[y,v]=a.useState(r),[b,g]=a.useState(""),[w,S]=a.useState(null),M=a.useRef(null),N=e!==void 0,j=N?e:y,L=a.useCallback(k=>{N||v(k),n==null||n(k)},[N,n]),I=a.useCallback(k=>{const A=k.trim();if(A){if(i!==void 0&&j.length>=i){S(`Maximum ${i} tags allowed`);return}if(!l&&j.includes(A)){S("Duplicate tags are not allowed");return}if(c){const D=c(A);if(D===!1){S("Invalid tag");return}if(typeof D=="string"){S(D);return}}S(null),L([...j,A]),g("")}},[j,i,l,c,L]),T=a.useCallback(k=>{const A=j.filter((D,O)=>O!==k);L(A),S(null)},[j,L]),$=a.useCallback(k=>{k.key==="Enter"||k.key===","?(k.preventDefault(),I(b)):k.key==="Backspace"&&b===""&&j.length>0&&T(j.length-1)},[b,j,I,T]),z=a.useCallback(k=>{const A=k.target.value;A.endsWith(",")?I(A.slice(0,-1)):(g(A),w&&S(null))},[I,w]),E=u==="sm"?"6px 8px":u==="lg"?"10px 12px":"8px 10px",C=u==="sm"?11:u==="lg"?14:12;return t.jsxs("div",{className:h("flex flex-col gap-1.5"),children:[f&&t.jsx("label",{className:h("text-sm font-medium"),style:{color:p.text},onClick:()=>{var k;return(k=M.current)==null?void 0:k.focus()},children:R(f)}),t.jsxs("div",{className:h("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!x&&"transition-colors duration-150"),style:{padding:E,backgroundColor:p.surface,border:`1.5px solid ${w?p.danger:p.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var k;return!m&&((k=M.current)==null?void 0:k.focus())},children:[j.map((k,A)=>t.jsx(vo,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>T(A),isDisabled:m,children:k},`${k}-${A}`)),(!i||j.length<i)&&!m&&t.jsx("input",{ref:M,type:"text",value:b,onChange:z,onKeyDown:$,placeholder:j.length===0?R(o):"",disabled:m,className:h("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:C,color:p.text,caretColor:p.primary},"aria-label":f??"Tag input"})]}),w&&t.jsx("p",{className:h("text-xs"),style:{color:p.danger},role:"alert",children:w}),s&&!w&&t.jsx("p",{className:h("text-xs"),style:{color:p.textMuted},children:R(s)})]})}let Zr=!1;function za(){if(Zr||typeof document>"u")return;Zr=!0;const e=document.createElement("style");e.textContent=`
27
+ `,document.head.appendChild(t)}function Ao(){return e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),e.jsx("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),e.jsx("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Po(){return e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),e.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 on(){const t=B.useTheme();return e.jsxs("div",{className:s.tkx("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:t.surface,border:`1px solid ${t.border}`},"aria-label":"Assistant is thinking",children:[e.jsx("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:t.textMuted}}),e.jsx("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:t.textMuted}}),e.jsx("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:t.textMuted}})]})}function an({message:t,showTimestamp:r,avatarUser:n,avatarAssistant:i}){const o=B.useTheme(),l=s.useReducedMotion(),{role:c,content:d,timestamp:u,isStreaming:x,error:f}=t,m=s.sanitizeString(d),p=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if(c==="system")return e.jsx("div",{role:"listitem",className:s.tkx("flex justify-center my-2"),children:e.jsx("p",{className:s.tkx("text-xs italic px-3 py-1 rounded-full"),style:{color:o.textMuted,backgroundColor:o.surfaceAlt},children:m})});const h=c==="user",y=h?n??e.jsx(Ao,{}):i??e.jsx(Po,{}),k=h?{backgroundColor:o.primary,color:o.bg}:{backgroundColor:o.surface,color:o.text,border:`1px solid ${f?o.danger:o.border}`};return f&&(k.borderColor=o.danger,k.borderWidth="2px"),e.jsxs("div",{role:"listitem",className:s.tkx("flex gap-2 mb-4",h?"flex-row-reverse":"flex-row"),children:[e.jsx("div",{className:s.tkx("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:h?o.primary:o.secondary},children:y}),e.jsxs("div",{className:s.tkx("flex flex-col gap-1 max-w-[75%]",h?"items-end":"items-start"),children:[e.jsxs("div",{className:s.cx(s.tkx("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),x&&!l?"tkx-cursor":""),style:k,children:[m,f&&e.jsx("span",{"aria-label":"Error",style:{marginLeft:6,color:o.danger},children:"⚠"})]}),r&&p&&e.jsx("span",{className:s.tkx("text-[10px]"),style:{color:o.textMuted},children:p})]})]})}function Bo({messages:t,onSend:r,isLoading:n=!1,placeholder:i="Type a message…",maxLength:o,showTimestamps:l=!1,avatarUser:c,avatarAssistant:d,height:u=480,inputPosition:x="bottom"}){const f=B.useTheme(),m=s.useReducedMotion(),[p,h]=a.useState(""),y=a.useRef(null),k=a.useRef(null);a.useEffect(()=>{Do()},[]),a.useEffect(()=>{const N=y.current;N&&N.scrollTo({top:N.scrollHeight,behavior:m?"auto":"smooth"})},[t,n,m]);const b=a.useCallback(()=>{const N=p.trim();!N||!r||(r(N),h(""),k.current&&(k.current.style.height="auto"))},[p,r]),g=a.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),b())},[b]),w=a.useCallback(N=>{const C=o?N.target.value.slice(0,o):N.target.value;h(C);const M=k.current;if(M){M.style.height="auto";const E=24*4+24;M.style.height=`${Math.min(M.scrollHeight,E)}px`}},[o]),j=p.trim().length>0&&!n,S=typeof u=="number"?`${u}px`:u,z=x==="floating",v=e.jsxs("div",{className:s.tkx("flex flex-col gap-1 p-3"),style:z?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:f.surface,border:`1px solid ${f.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${f.border}`,backgroundColor:f.surface},children:[e.jsxs("div",{className:s.tkx("flex items-end gap-2"),children:[e.jsx("textarea",{ref:k,rows:1,value:p,onChange:w,onKeyDown:g,placeholder:s.sanitizeString(i),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:s.tkx("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:f.text,caretColor:f.primary,minHeight:32,maxHeight:120}}),e.jsx("button",{onClick:b,disabled:!j,"aria-label":"Send message",className:s.tkx("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!m&&"transition-opacity duration-150",j?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:f.primary,color:f.bg},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),o&&e.jsxs("div",{className:s.tkx("text-right text-[10px]"),style:{color:f.textMuted},children:[p.length,"/",o]})]});return e.jsxs("div",{className:s.tkx("flex flex-col overflow-hidden rounded-2xl"),style:{height:S,backgroundColor:f.bg,border:`1px solid ${f.border}`,position:"relative"},children:[e.jsx("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:s.tkx("flex-1 overflow-y-auto p-4"),style:{paddingBottom:z?80:void 0},children:e.jsxs("div",{role:"list",children:[t.map(N=>e.jsx(an,{message:N,showTimestamp:l,avatarUser:c,avatarAssistant:d},N.id)),n&&e.jsxs("div",{role:"listitem",className:s.tkx("flex gap-2 mb-4"),children:[e.jsx("div",{className:s.tkx("w-8 h-8 shrink-0")}),e.jsx(on,{})]})]})}),v]})}const Fo={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Wo={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},Ho={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},Vo={sm:12,md:14,lg:16};function Oo(t,r){const n=B.useTheme(),o={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[t];return r==="solid"?{bg:o,color:n.bg,border:"transparent"}:r==="subtle"?{bg:`${o}22`,color:o,border:"transparent"}:{bg:"transparent",color:o,border:o}}function ln({variant:t="subtle",size:r="md",colorScheme:n="default",onRemove:i,leftIcon:o,isDisabled:l=!1,clickable:c=!1,children:d,className:u,style:x,onClick:f,...m}){B.useTheme();const p=s.useReducedMotion(),h=Oo(n,t),y=typeof d=="string"?s.sanitizeString(d):d,k=Vo[r],b=s.tkx("inline-flex items-center font-medium rounded-full select-none",Fo[r],Wo[r],Ho[r],l?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!p&&"transition-opacity duration-150");return e.jsxs("span",{role:c?"button":void 0,tabIndex:c&&!l?0:void 0,"aria-disabled":l||void 0,className:s.cx(b,u),style:{backgroundColor:h.bg,color:h.color,border:`1px solid ${h.border==="transparent"?"transparent":h.border}`,...x},onClick:l?void 0:f,onKeyDown:c&&!l&&f?g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),f(g))}:void 0,...m,children:[o&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("shrink-0 flex items-center"),children:o}),e.jsx("span",{children:y}),i&&!l&&e.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:g=>{g.stopPropagation(),i()},className:s.tkx("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:k+4,height:k+4,color:h.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:e.jsx("svg",{width:k,height:k,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function _o({value:t,defaultValue:r=[],onChange:n,placeholder:i="Add tag…",maxTags:o,allowDuplicates:l=!1,validate:c,colorScheme:d="primary",size:u="md",label:x,hint:f,isDisabled:m=!1}){const p=B.useTheme(),h=s.useReducedMotion(),[y,k]=a.useState(r),[b,g]=a.useState(""),[w,j]=a.useState(null),S=a.useRef(null),z=t!==void 0,v=z?t:y,N=a.useCallback(I=>{z||k(I),n==null||n(I)},[z,n]),C=a.useCallback(I=>{const W=I.trim();if(W){if(o!==void 0&&v.length>=o){j(`Maximum ${o} tags allowed`);return}if(!l&&v.includes(W)){j("Duplicate tags are not allowed");return}if(c){const L=c(W);if(L===!1){j("Invalid tag");return}if(typeof L=="string"){j(L);return}}j(null),N([...v,W]),g("")}},[v,o,l,c,N]),M=a.useCallback(I=>{const W=v.filter((L,Y)=>Y!==I);N(W),j(null)},[v,N]),T=a.useCallback(I=>{I.key==="Enter"||I.key===","?(I.preventDefault(),C(b)):I.key==="Backspace"&&b===""&&v.length>0&&M(v.length-1)},[b,v,C,M]),E=a.useCallback(I=>{const W=I.target.value;W.endsWith(",")?C(W.slice(0,-1)):(g(W),w&&j(null))},[C,w]),$=u==="sm"?"6px 8px":u==="lg"?"10px 12px":"8px 10px",F=u==="sm"?11:u==="lg"?14:12;return e.jsxs("div",{className:s.tkx("flex flex-col gap-1.5"),children:[x&&e.jsx("label",{className:s.tkx("text-sm font-medium"),style:{color:p.text},onClick:()=>{var I;return(I=S.current)==null?void 0:I.focus()},children:s.sanitizeString(x)}),e.jsxs("div",{className:s.tkx("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!h&&"transition-colors duration-150"),style:{padding:$,backgroundColor:p.surface,border:`1.5px solid ${w?p.danger:p.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var I;return!m&&((I=S.current)==null?void 0:I.focus())},children:[v.map((I,W)=>e.jsx(ln,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>M(W),isDisabled:m,children:I},`${I}-${W}`)),(!o||v.length<o)&&!m&&e.jsx("input",{ref:S,type:"text",value:b,onChange:E,onKeyDown:T,placeholder:v.length===0?s.sanitizeString(i):"",disabled:m,className:s.tkx("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:F,color:p.text,caretColor:p.primary},"aria-label":x??"Tag input"})]}),w&&e.jsx("p",{className:s.tkx("text-xs"),style:{color:p.danger},role:"alert",children:w}),f&&!w&&e.jsx("p",{className:s.tkx("text-xs"),style:{color:p.textMuted},children:s.sanitizeString(f)})]})}let cr=!1;function Yo(){if(cr||typeof document>"u")return;cr=!0;const t=document.createElement("style");t.textContent=`
31
28
  @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
29
  @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
33
30
  @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
34
31
  .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
35
32
  .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
36
33
  .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
37
- `,document.head.appendChild(e)}function La(e="pending"){const r=U();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[e]}function rr({status:e="pending",icon:r,size:n=28}){const o=U(),i=te(),l=La(e),c=e==="active";return t.jsx("div",{className:ae(h("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!i?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:e==="pending"?o.surface:l,border:`2px solid ${l}`,color:e==="pending"?l:o.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"?l:o.bg,display:"block"}})})}function Gr({style:e,color:r,animate:n}){return U(),t.jsx("div",{className:ae(h("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 Jr({style:e,color:r,animate:n}){return t.jsx("div",{className:ae(h("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${r}`,borderColor:r},"aria-hidden":"true"})}function nr({item:e,compact:r}){const n=U(),o=e.timestamp?R(e.timestamp):null;return t.jsxs("div",{className:h("flex flex-col gap-0.5",r?"pb-3":"pb-5"),children:[t.jsxs("div",{className:h("flex items-center gap-2 flex-wrap"),children:[t.jsx("span",{className:h("text-sm font-semibold leading-snug"),style:{color:n.text},children:typeof e.title=="string"?R(e.title):e.title}),e.badge&&t.jsx("span",{children:e.badge}),o&&t.jsx("span",{className:h("text-[11px] ml-auto"),style:{color:n.textMuted},children:o})]}),e.description&&!r&&t.jsx("div",{className:h("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:typeof e.description=="string"?R(e.description):e.description})]})}function Aa({items:e,variant:r="default",orientation:n="vertical",connectorStyle:o="solid"}){const i=U(),l=te(),c=a.useRef(!1);a.useEffect(()=>{za(),c.current=!0},[]);const d=!l,u=r==="compact",f=r==="alternating"&&n==="vertical";return n==="horizontal"?t.jsx("div",{role:"list","aria-label":"Timeline",className:h("flex items-start w-full overflow-x-auto"),children:e.map((m,p)=>{const x=m.status??"pending",y=x==="completed"?i.success:i.border,v=p===e.length-1;return t.jsx("div",{role:"listitem",className:h("flex items-start flex-1 min-w-0"),children:t.jsxs("div",{className:h("flex flex-col items-center flex-1 min-w-0"),children:[t.jsxs("div",{className:h("flex items-center w-full"),children:[p>0&&t.jsx(Jr,{style:o,color:y,animate:d}),t.jsx(rr,{status:x,icon:m.icon,size:24}),!v&&t.jsx(Jr,{style:o,color:y,animate:d})]}),t.jsxs("div",{className:h("mt-2 px-1 text-center min-w-0 w-full"),children:[t.jsx("div",{className:h("text-xs font-semibold truncate"),style:{color:i.text},children:typeof m.title=="string"?R(m.title):m.title}),m.timestamp&&t.jsx("div",{className:h("text-[10px] mt-0.5"),style:{color:i.textMuted},children:R(m.timestamp)})]})]})},m.id)})}):t.jsx("div",{role:"list","aria-label":"Timeline",className:h("flex flex-col"),children:e.map((m,p)=>{const x=m.status??"pending",y=p===e.length-1,v=x==="completed"?i.success:i.border,b=f&&p%2===0;return f?t.jsxs("div",{role:"listitem",className:h("flex items-stretch gap-0"),children:[t.jsx("div",{className:h("flex-1 flex flex-col items-end pr-4",b?"":"invisible"),children:b&&t.jsx(nr,{item:m,compact:u})}),t.jsxs("div",{className:h("flex flex-col items-center"),children:[t.jsx(rr,{status:x,icon:m.icon,size:28}),!y&&t.jsx(Gr,{style:o,color:v,animate:d})]}),t.jsx("div",{className:h("flex-1 flex flex-col items-start pl-4",b?"invisible":""),children:!b&&t.jsx(nr,{item:m,compact:u})})]},m.id):t.jsxs("div",{role:"listitem",className:h("flex gap-3 items-stretch"),children:[t.jsxs("div",{className:h("flex flex-col items-center"),children:[t.jsx(rr,{status:x,icon:m.icon,size:u?22:28}),!y&&t.jsx(Gr,{style:o,color:v,animate:d})]}),t.jsx("div",{className:h("flex-1 min-w-0 pt-0.5"),children:t.jsx(nr,{item:m,compact:u})})]},m.id)})})}function Qr(e,r,n,o){const i=window.innerWidth,l=window.innerHeight,c=6;let d=0,u=0,f="top left";switch(r){case"bottom-start":d=e.bottom+c,u=e.left,f="top left",d+o>l&&e.top-c-o>0&&(d=e.top-c-o,f="bottom left"),u+n>i&&(u=Math.max(0,i-n-8));break;case"bottom-end":d=e.bottom+c,u=e.right-n,f="top right",d+o>l&&e.top-c-o>0&&(d=e.top-c-o,f="bottom right"),u<0&&(u=8);break;case"top-start":d=e.top-c-o,u=e.left,f="bottom left",d<0&&(d=e.bottom+c,f="top left"),u+n>i&&(u=Math.max(0,i-n-8));break;case"top-end":d=e.top-c-o,u=e.right-n,f="bottom right",d<0&&(d=e.bottom+c,f="top right"),u<0&&(u=8);break;case"right-start":d=e.top,u=e.right+c,f="top left",u+n>i&&(u=e.left-c-n,f="top right"),d+o>l&&(d=Math.max(8,l-o-8));break;case"left-start":d=e.top,u=e.left-c-n,f="top right",u<0&&(u=e.right+c,f="top left"),d+o>l&&(d=Math.max(8,l-o-8));break}return{top:d+window.scrollY,left:u+window.scrollX,transformOrigin:f}}function Ra(e,r,n){const o=window.innerWidth,i=window.innerHeight,l=4;let c=e.right+l,d="top left";c+r>o&&(c=e.left-l-r,d="top right");let u=e.top;return u+n>i&&(u=Math.max(8,i-n-8)),{top:u+window.scrollY,left:c+window.scrollX,transformOrigin:d}}const Da=`
34
+ `,document.head.appendChild(t)}function Uo(t="pending"){const r=B.useTheme();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[t]}function It({status:t="pending",icon:r,size:n=28}){const i=B.useTheme(),o=s.useReducedMotion(),l=Uo(t),c=t==="active";return e.jsx("div",{className:s.cx(s.tkx("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!o?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:t==="pending"?i.surface:l,border:`2px solid ${l}`,color:t==="pending"?l:i.bg},"aria-hidden":"true",children:r?e.jsx("span",{style:{fontSize:n*.45,lineHeight:1},children:r}):e.jsx("span",{style:{width:n*.35,height:n*.35,borderRadius:"50%",backgroundColor:t==="pending"?l:i.bg,display:"block"}})})}function dr({style:t,color:r,animate:n}){return B.useTheme(),e.jsx("div",{className:s.cx(s.tkx("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${t} ${r}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:r,marginLeft:1},"aria-hidden":"true"})}function ur({style:t,color:r,animate:n}){return e.jsx("div",{className:s.cx(s.tkx("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${t} ${r}`,borderColor:r},"aria-hidden":"true"})}function Et({item:t,compact:r}){const n=B.useTheme(),i=t.timestamp?s.sanitizeString(t.timestamp):null;return e.jsxs("div",{className:s.tkx("flex flex-col gap-0.5",r?"pb-3":"pb-5"),children:[e.jsxs("div",{className:s.tkx("flex items-center gap-2 flex-wrap"),children:[e.jsx("span",{className:s.tkx("text-sm font-semibold leading-snug"),style:{color:n.text},children:typeof t.title=="string"?s.sanitizeString(t.title):t.title}),t.badge&&e.jsx("span",{children:t.badge}),i&&e.jsx("span",{className:s.tkx("text-[11px] ml-auto"),style:{color:n.textMuted},children:i})]}),t.description&&!r&&e.jsx("div",{className:s.tkx("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:typeof t.description=="string"?s.sanitizeString(t.description):t.description})]})}function Ko({items:t,variant:r="default",orientation:n="vertical",connectorStyle:i="solid"}){const o=B.useTheme(),l=s.useReducedMotion(),c=a.useRef(!1);a.useEffect(()=>{Yo(),c.current=!0},[]);const d=!l,u=r==="compact",x=r==="alternating"&&n==="vertical";return n==="horizontal"?e.jsx("div",{role:"list","aria-label":"Timeline",className:s.tkx("flex items-start w-full overflow-x-auto"),children:t.map((m,p)=>{const h=m.status??"pending",y=h==="completed"?o.success:o.border,k=p===t.length-1;return e.jsx("div",{role:"listitem",className:s.tkx("flex items-start flex-1 min-w-0"),children:e.jsxs("div",{className:s.tkx("flex flex-col items-center flex-1 min-w-0"),children:[e.jsxs("div",{className:s.tkx("flex items-center w-full"),children:[p>0&&e.jsx(ur,{style:i,color:y,animate:d}),e.jsx(It,{status:h,icon:m.icon,size:24}),!k&&e.jsx(ur,{style:i,color:y,animate:d})]}),e.jsxs("div",{className:s.tkx("mt-2 px-1 text-center min-w-0 w-full"),children:[e.jsx("div",{className:s.tkx("text-xs font-semibold truncate"),style:{color:o.text},children:typeof m.title=="string"?s.sanitizeString(m.title):m.title}),m.timestamp&&e.jsx("div",{className:s.tkx("text-[10px] mt-0.5"),style:{color:o.textMuted},children:s.sanitizeString(m.timestamp)})]})]})},m.id)})}):e.jsx("div",{role:"list","aria-label":"Timeline",className:s.tkx("flex flex-col"),children:t.map((m,p)=>{const h=m.status??"pending",y=p===t.length-1,k=h==="completed"?o.success:o.border,b=x&&p%2===0;return x?e.jsxs("div",{role:"listitem",className:s.tkx("flex items-stretch gap-0"),children:[e.jsx("div",{className:s.tkx("flex-1 flex flex-col items-end pr-4",b?"":"invisible"),children:b&&e.jsx(Et,{item:m,compact:u})}),e.jsxs("div",{className:s.tkx("flex flex-col items-center"),children:[e.jsx(It,{status:h,icon:m.icon,size:28}),!y&&e.jsx(dr,{style:i,color:k,animate:d})]}),e.jsx("div",{className:s.tkx("flex-1 flex flex-col items-start pl-4",b?"invisible":""),children:!b&&e.jsx(Et,{item:m,compact:u})})]},m.id):e.jsxs("div",{role:"listitem",className:s.tkx("flex gap-3 items-stretch"),children:[e.jsxs("div",{className:s.tkx("flex flex-col items-center"),children:[e.jsx(It,{status:h,icon:m.icon,size:u?22:28}),!y&&e.jsx(dr,{style:i,color:k,animate:d})]}),e.jsx("div",{className:s.tkx("flex-1 min-w-0 pt-0.5"),children:e.jsx(Et,{item:m,compact:u})})]},m.id)})})}function fr(t,r,n,i){const o=window.innerWidth,l=window.innerHeight,c=6;let d=0,u=0,x="top left";switch(r){case"bottom-start":d=t.bottom+c,u=t.left,x="top left",d+i>l&&t.top-c-i>0&&(d=t.top-c-i,x="bottom left"),u+n>o&&(u=Math.max(0,o-n-8));break;case"bottom-end":d=t.bottom+c,u=t.right-n,x="top right",d+i>l&&t.top-c-i>0&&(d=t.top-c-i,x="bottom right"),u<0&&(u=8);break;case"top-start":d=t.top-c-i,u=t.left,x="bottom left",d<0&&(d=t.bottom+c,x="top left"),u+n>o&&(u=Math.max(0,o-n-8));break;case"top-end":d=t.top-c-i,u=t.right-n,x="bottom right",d<0&&(d=t.bottom+c,x="top right"),u<0&&(u=8);break;case"right-start":d=t.top,u=t.right+c,x="top left",u+n>o&&(u=t.left-c-n,x="top right"),d+i>l&&(d=Math.max(8,l-i-8));break;case"left-start":d=t.top,u=t.left-c-n,x="top right",u<0&&(u=t.right+c,x="top left"),d+i>l&&(d=Math.max(8,l-i-8));break}return{top:d+window.scrollY,left:u+window.scrollX,transformOrigin:x}}function Xo(t,r,n){const i=window.innerWidth,o=window.innerHeight,l=4;let c=t.right+l,d="top left";c+r>i&&(c=t.left-l-r,d="top right");let u=t.top;return u+n>o&&(u=Math.max(8,o-n-8)),{top:u+window.scrollY,left:c+window.scrollX,transformOrigin:d}}const qo=`
38
35
  @keyframes tkxMenuIn {
39
36
  from { opacity: 0; transform: scale(0.94); }
40
37
  to { opacity: 1; transform: scale(1); }
@@ -53,7 +50,7 @@
53
50
  animation: tkxMenuInReduced 100ms ease forwards;
54
51
  }
55
52
  }
56
- `;function Ba(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 Wa({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 Fa({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 Pa({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 Ha(e){const r=[];let n=0;for(const o of e)if(o.type!=="separator")if(o.type==="radio-group")for(let i=0;i<o.options.length;i++)r.push({kind:"radio",item:o,optionIdx:i,idx:n++});else o.type==="check"?r.push({kind:"check",item:o,idx:n++}):o.type==="submenu"?r.push({kind:"submenu",item:o,idx:n++}):r.push({kind:"action",item:o,idx:n++});return r}function ko({items:e,pos:r,panelId:n,onClose:o,onCloseAll:i,isSubmenu:l=!1}){const c=U(),[d,u]=a.useState(-1),[f,s]=a.useState(null),[m,p]=a.useState(null),x=a.useRef(null),[y,v]=a.useState(""),b=a.useRef(null),g=Ha(e);a.useEffect(()=>{var I;(I=x.current)==null||I.focus()},[]),a.useEffect(()=>{var T;if(d<0)return;const I=(T=x.current)==null?void 0:T.querySelector(`[data-midx="${d}"]`);I==null||I.scrollIntoView({block:"nearest"})},[d]);const w=a.useCallback(I=>{var T,$,z,E,C,k;if(I.kind==="action"){if(I.item.disabled)return;($=(T=I.item).onClick)==null||$.call(T),i()}else if(I.kind==="check"){if(I.item.disabled)return;(E=(z=I.item).onChange)==null||E.call(z,!I.item.checked)}else if(I.kind==="radio"){if(I.item.disabled)return;(k=(C=I.item).onChange)==null||k.call(C,I.item.options[I.optionIdx].value)}else if(I.kind==="submenu"){if(I.item.disabled)return;s(I.item.id)}},[i]),S=I=>{var T;switch(I.key){case"ArrowDown":I.preventDefault(),u($=>{const z=$+1;return z<g.length?z:0});break;case"ArrowUp":I.preventDefault(),u($=>{const z=$-1;return z>=0?z:g.length-1});break;case"Home":I.preventDefault(),u(0);break;case"End":I.preventDefault(),u(g.length-1);break;case"Enter":case" ":I.preventDefault(),d>=0&&g[d]&&w(g[d]);break;case"Escape":I.preventDefault(),l?o():i();break;case"Tab":I.preventDefault(),i();break;case"ArrowRight":I.preventDefault(),d>=0&&((T=g[d])==null?void 0:T.kind)==="submenu"&&s(g[d].item.id);break;case"ArrowLeft":I.preventDefault(),l&&o();break;default:I.key.length===1&&!I.ctrlKey&&!I.metaKey&&M(I.key)}};function M(I){b.current&&clearTimeout(b.current);const T=y+I.toLowerCase();v(T);const $=g.findIndex(z=>(z.kind==="radio"?z.item.options[z.optionIdx].label:z.item.label).toLowerCase().startsWith(T));$>=0&&u($),b.current=setTimeout(()=>v(""),800)}function N(I,T){const $=T.getBoundingClientRect();s(I.id);const z=Math.min(I.items.length*38+12,360);p(Ra($,220,z))}function j(){s(null),p(null)}const L=()=>{let I=-1;return e.map(T=>{if(T.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(T.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:T.label?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginLeft:14}}),t.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:R(T.label)}),t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginRight:14}})]}):t.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,margin:"0 10px"}})},T.id);if(T.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":T.label,children:[T.label&&t.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:R(T.label)}),T.options.map((D,O)=>{I++;const W=I,H=W===d,B=D.value===T.value,P=!!T.disabled,F=Wt(c,H,!1,P);return t.jsxs("div",{role:"menuitemradio","aria-checked":B,"aria-disabled":P||void 0,"data-midx":W,tabIndex:-1,style:F,onClick:()=>{var V;return!P&&((V=T.onChange)==null?void 0:V.call(T,D.value))},onMouseEnter:()=>!P&&u(W),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:B?t.jsx(Fa,{color:c.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${c.border}`,display:"inline-block"}})}),D.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:D.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(D.label)})]},D.value)})]},T.id);if(T.type==="check"){I++;const D=I,O=D===d,W=!!T.disabled,H=Wt(c,O,!1,W);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":T.checked,"aria-disabled":W||void 0,"data-midx":D,tabIndex:-1,style:H,onClick:()=>{var B;return!W&&((B=T.onChange)==null?void 0:B.call(T,!T.checked))},onMouseEnter:()=>!W&&u(D),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:T.checked?t.jsx(Wa,{color:c.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),T.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:T.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(T.label)})]},T.id)}if(T.type==="submenu"){I++;const D=I,O=D===d,W=!!T.disabled,H=f===T.id,B=Wt(c,O||H,!1,W);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":H,"aria-disabled":W||void 0,"data-midx":D,tabIndex:-1,style:B,onMouseEnter:P=>{W||(u(D),N(T,P.currentTarget))},onMouseLeave:()=>{},onClick:()=>{W||s(H?null:T.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:T.icon?t.jsx("span",{style:{display:"flex",color:c.textMuted},children:T.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R(T.label)}),t.jsx(Pa,{color:c.textMuted})]}),H&&m&&Ne.createPortal(t.jsx(ko,{items:T.items,pos:m,panelId:`${n}-sub-${T.id}`,onClose:j,onCloseAll:i,isSubmenu:!0}),document.body)]},T.id)}const $=T;I++;const z=I,E=z===d,C=!!$.disabled,k=!!$.danger,A=Wt(c,E,k,C);return t.jsxs("div",{role:"menuitem","aria-disabled":C||void 0,"data-midx":z,tabIndex:-1,style:A,onClick:()=>{var D;C||((D=$.onClick)==null||D.call($),i())},onMouseEnter:()=>{C||(u(z),j())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:$.icon?t.jsx("span",{style:{display:"flex",color:k?c.danger:c.textMuted},children:$.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:R($.label)}),$.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:c.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:R($.description)})]}),$.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:c.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:R($.shortcut)})]},$.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:Da}),t.jsx("div",{ref:x,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:S,style:{...Ba(c,r),maxHeight:400,overflowY:"auto"},children:L()})]})}function Wt(e,r,n,o){const i=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:o?"not-allowed":"pointer",userSelect:"none",color:o?e.textMuted:r&&n?e.danger:i,backgroundColor:r?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function wo({trigger:e,items:r,placement:n="bottom-start",isDisabled:o=!1,onOpen:i,onClose:l,className:c,style:d}){const f=`tkx-menu-${a.useId().replace(/:/g,"")}`,[s,m]=a.useState(!1),[p,x]=a.useState(null),y=a.useRef(null),v=a.useCallback(()=>{if(o)return;const w=y.current;if(!w)return;const S=w.getBoundingClientRect(),M=Math.min(r.length*38+12,360);x(Qr(S,n,220,M)),m(!0),i==null||i()},[o,r.length,i,n]),b=a.useCallback(()=>{var w,S,M;m(!1),l==null||l(),(M=(S=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:S.focus)==null||M.call(S)},[l]);a.useEffect(()=>{if(!s)return;const w=S=>{var j;const M=S.target;if((j=y.current)!=null&&j.contains(M))return;const N=document.querySelectorAll(".tkx-menu-panel");for(const L of N)if(L.contains(M))return;b()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[s,b]),a.useEffect(()=>{if(!s)return;const w=()=>{const S=y.current;if(!S)return;const M=S.getBoundingClientRect(),N=Math.min(r.length*38+12,360);x(Qr(M,n,220,N))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[s,r.length,n]);const g=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),s||v()),w.key==="Escape"&&s&&(w.preventDefault(),b())};return t.jsxs("span",{ref:y,className:c,style:{display:"inline-flex",...d},children:[t.jsx("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":s,"aria-controls":s?f:void 0,"aria-disabled":o||void 0,onClick:()=>s?b():v(),onKeyDown:g,style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),s&&p&&Ne.createPortal(t.jsx(ko,{items:r,pos:p,panelId:f,onClose:b,onCloseAll:b}),document.body)]})}wo.displayName="TkxMenu";const Va={sm:120,md:180,lg:240,xl:320};function Ft(e){const r=new Date;if(e)try{const c=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=b=>{var g;return((g=c.find(w=>w.type===b))==null?void 0:g.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const f=parseInt(d("minute"),10),s=parseInt(d("second"),10),m=d("weekday"),p=d("month"),x=d("day"),y=d("year"),v=`${m}, ${p} ${x}, ${y}`;return{hours:u,minutes:f,seconds:s,milliseconds:r.getMilliseconds(),dateString:v}}catch{}const n=r.getHours(),o=r.getMinutes(),i=r.getSeconds(),l=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:i,milliseconds:r.getMilliseconds(),dateString:l}}function Oa({time:e,size:r,analogStyle:n,showSeconds:o,reducedMotion:i,primary:l,danger:c,text:d,textMuted:u,border:f,surface:s,bg:m}){const p=r/2,x=r/2,y=r/2-4,{hours:v,minutes:b,seconds:g,milliseconds:w}=e,M=(g+(i?0:w)/1e3)/60*360,N=b/60*360+g/60*6,j=v%12/12*360+b/60*30,L=(k,A)=>{const D=(k-90)*Math.PI/180;return{x:p+Math.cos(D)*A,y:x+Math.sin(D)*A}},I=i?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const k=(P,F)=>{const Q=-90+P*360,re={x:p+Math.cos(-90*Math.PI/180)*F,y:x+Math.sin(-90*Math.PI/180)*F},ie={x:p+Math.cos(Q*Math.PI/180)*F,y:x+Math.sin(Q*Math.PI/180)*F},fe=P>.5?1:0;return`M ${re.x} ${re.y} A ${F} ${F} 0 ${fe} 1 ${ie.x} ${ie.y}`},A=v%12/12+b/60/12,D=b/60+g/3600,O=(g+(i?0:w/1e3))/60,W=y-2,H=y-10,B=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:x,r:W,fill:"none",stroke:f,strokeWidth:4}),t.jsx("circle",{cx:p,cy:x,r:H,fill:"none",stroke:f,strokeWidth:4}),o&&t.jsx("circle",{cx:p,cy:x,r:B,fill:"none",stroke:f,strokeWidth:3}),t.jsx("path",{d:k(A,W),fill:"none",stroke:l,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:k(D,H),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),o&&t.jsx("path",{d:k(O,B),fill:"none",stroke:c,strokeWidth:3,strokeLinecap:"round"}),t.jsx("circle",{cx:p,cy:x,r:4,fill:l}),t.jsxs("text",{x:p,y:x+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(v).padStart(2,"0"),":",String(b).padStart(2,"0")]})]})}const T=L(j,y*.5),$=L(N,y*.75),z=L(M,y*.85),E=L(M+180,y*.2),C=[];if(n==="classic"){for(let A=0;A<60;A++){const D=A/60*360,O=A%5===0,W=(D-90)*Math.PI/180,H=O?y-10:y-6,B=p+Math.cos(W)*y,P=x+Math.sin(W)*y,F=p+Math.cos(W)*H,V=x+Math.sin(W)*H;C.push(t.jsx("line",{x1:B,y1:P,x2:F,y2:V,stroke:O?d:u,strokeWidth:O?2:1,strokeLinecap:"round"},A))}const k=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:A,angle:D}of k){const O=(D-90)*Math.PI/180,W=y-20;C.push(t.jsx("text",{x:p+Math.cos(O)*W,y:x+Math.sin(O)*W,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:A},`n${A}`))}}else for(let k=0;k<12;k++){const D=(k/12*360-90)*Math.PI/180,O=y-8;C.push(t.jsx("circle",{cx:p+Math.cos(D)*O,cy:x+Math.sin(D)*O,r:k%3===0?3:2,fill:k%3===0?d:u},k))}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:x,r:y,fill:s,stroke:f,strokeWidth:2}),C,t.jsx("line",{x1:p,y1:x,x2:T.x,y2:T.y,stroke:l,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:I}}),t.jsx("line",{x1:p,y1:x,x2:$.x,y2:$.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:I}}),o&&t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:E.x,y1:E.y,x2:z.x,y2:z.y,stroke:c,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${p}px ${x}px`,transition:"none"}}),t.jsx("circle",{cx:p,cy:x,r:3,fill:c})]}),t.jsx("circle",{cx:p,cy:x,r:n==="minimal"?3:5,fill:l})]})}function en({time:e,format:r,showSeconds:n,showDate:o,label:i,size:l,primary:c,text:d,textMuted:u,colonVisible:f}){const{hours:s,minutes:m,seconds:p,dateString:x}=e;let y=s,v="";r==="12h"&&(v=s>=12?"PM":"AM",y=s%12||12);const b=l*.2,g={opacity:f?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:b,color:c,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:g,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:g,children:":"}),t.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:b*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:b*.05},children:v})]}),o&&t.jsx("div",{style:{fontSize:l*.072,color:u,marginTop:l*.025,letterSpacing:"0.03em"},children:x}),i&&t.jsx("div",{style:{fontSize:l*.065,color:u,marginTop:l*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:R(i)})]})}function jo({variant:e="both",size:r="md",showSeconds:n=!0,showDate:o=!1,format:i="24h",timezone:l,timezone2:c,label:d,analogStyle:u="classic",className:f,style:s}){const m=U(),p=te(),[x,y]=a.useState(()=>Ft(l)),[v,b]=a.useState(()=>c?Ft(c):null),[g,w]=a.useState(!0),[S,M]=a.useState(!1),N=a.useRef(null);a.useEffect(()=>{M(!0)},[]),a.useEffect(()=>{const $=()=>{y(Ft(l)),c&&b(Ft(c))};$();const z=setInterval($,1e3);return()=>clearInterval(z)},[l,c]),a.useEffect(()=>(N.current=setInterval(()=>{w($=>!$)},500),()=>{N.current&&clearInterval(N.current)}),[]);const j=Va[r],L=e==="analog"||e==="both",I=e==="digital"||e==="both",T={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${j*.06}px`:0,opacity:S?1:0,transition:p?"none":"opacity 0.4s ease",...s};return t.jsxs("div",{className:f,style:T,role:"timer","aria-live":"off",children:[L&&t.jsx(Oa,{time:x,size:j,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}),I&&t.jsx(en,{time:x,format:i,showSeconds:n,showDate:o,label:d,size:j,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:g}),v&&c&&t.jsx("div",{style:{marginTop:j*.04,padding:`${j*.03}px ${j*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(en,{time:v,format:i,showSeconds:!1,showDate:!1,label:c,size:j*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:g})})]})}jo.displayName="TkxClock";function or(e){if(!isFinite(e)||isNaN(e))return"0:00";const r=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function Fe({path:e,size:r=20,color:n="currentColor",title:o}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,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 dt({onClick:e,title:r,children:n,active:o,primary:i}){const[l,c]=a.useState(!1);return t.jsx("button",{type:"button",onClick:e,title:r,"aria-label":r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||l?i:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function So({src:e,poster:r,title:n,width:o="100%",height:i,autoPlay:l=!1,loop:c=!1,muted:d=!1,controls:u=!0,showTitle:f=!0,allowFullscreen:s=!0,allowPiP:m=!0,allowDownload:p=!1,chapters:x=[],subtitles:y=[],startTime:v,onPlay:b,onPause:g,onEnded:w,onTimeUpdate:S,className:M,style:N}){const j=U(),L=te(),I=a.useRef(null),T=a.useRef(null),$=a.useRef(null),z=a.useRef(null),[E,C]=a.useState(!1),[k,A]=a.useState(0),[D,O]=a.useState(0),[W,H]=a.useState(0),[B,P]=a.useState(1),[F,V]=a.useState(d),[Q,re]=a.useState(!1),[ie,fe]=a.useState(!0),[xe,ve]=a.useState(!1),[ge,X]=a.useState(1),[se,he]=a.useState(!1),[Se,de]=a.useState(-1),[be,ne]=a.useState(null),[q,K]=a.useState(0),[G,ee]=a.useState(null),[ue,ke]=a.useState(!1),[Me,je]=a.useState(!1),[ze,Te]=a.useState(null),[Pe,Ge]=a.useState(!1);a.useEffect(()=>{const Y=I.current;if(!Y)return;v!==void 0&&(Y.currentTime=v);const me=()=>{A(Y.currentTime),Y.buffered.length>0&&H(Y.buffered.end(Y.buffered.length-1))},$e=()=>O(Y.duration),Ee=()=>C(!0),ct=()=>{C(!1),ve(!0)},ot=()=>{C(!1),ve(!0),w==null||w()},$t=()=>ke(!0),Mt=()=>ke(!1),Ct=()=>je(!0),At=()=>je(!1),Rt=()=>{const _e=Y.error;Te(_e?`Error ${_e.code}: ${_e.message||"Failed to load video"}`:"Failed to load video"),je(!1)};return Y.addEventListener("timeupdate",me),Y.addEventListener("durationchange",$e),Y.addEventListener("play",Ee),Y.addEventListener("pause",ct),Y.addEventListener("ended",ot),Y.addEventListener("enterpictureinpicture",$t),Y.addEventListener("leavepictureinpicture",Mt),Y.addEventListener("waiting",Ct),Y.addEventListener("canplay",At),Y.addEventListener("error",Rt),()=>{Y.removeEventListener("timeupdate",me),Y.removeEventListener("durationchange",$e),Y.removeEventListener("play",Ee),Y.removeEventListener("pause",ct),Y.removeEventListener("ended",ot),Y.removeEventListener("enterpictureinpicture",$t),Y.removeEventListener("leavepictureinpicture",Mt),Y.removeEventListener("waiting",Ct),Y.removeEventListener("canplay",At),Y.removeEventListener("error",Rt)}},[w,v]),a.useEffect(()=>{I.current&&(E?b==null||b():g==null||g())},[E,b,g]),a.useEffect(()=>{S==null||S(k,D)},[k,D,S]),a.useEffect(()=>{const Y=I.current;if(!Y)return;const me=Y.textTracks;for(let $e=0;$e<me.length;$e++)me[$e].mode=$e===Se?"showing":"disabled"},[Se]),a.useEffect(()=>{const Y=()=>re(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",Y),()=>document.removeEventListener("fullscreenchange",Y)},[]),a.useEffect(()=>{const Y=T.current;if(!Y)return;const me=$e=>{const Ee=I.current;if(Ee&&$e.target.tagName!=="INPUT")switch($e.key){case" ":case"k":$e.preventDefault(),Be();break;case"f":case"F":s&&et();break;case"m":case"M":Qe();break;case"ArrowRight":$e.preventDefault(),Ee.currentTime=Math.min(Ee.currentTime+10,Ee.duration);break;case"ArrowLeft":$e.preventDefault(),Ee.currentTime=Math.max(Ee.currentTime-10,0);break;case"ArrowUp":$e.preventDefault(),P(Math.min(B+.1,1)),I.current&&(I.current.volume=Math.min(B+.1,1));break;case"ArrowDown":$e.preventDefault(),P(Math.max(B-.1,0)),I.current&&(I.current.volume=Math.max(B-.1,0));break}};return Y.addEventListener("keydown",me),()=>Y.removeEventListener("keydown",me)},[B,s]);const Je=a.useCallback(()=>{fe(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{E&&fe(!1)},3e3)},[E]);a.useEffect(()=>(Je(),()=>{z.current&&clearTimeout(z.current)}),[E,Je]);const Be=a.useCallback(()=>{const Y=I.current;Y&&(Y.paused?(Y.play().catch(()=>{}),ee("play"),ve(!1)):(Y.pause(),ee("pause")),setTimeout(()=>ee(null),600))},[]),Qe=a.useCallback(()=>{const Y=I.current;if(!Y)return;const me=!F;V(me),Y.muted=me},[F]),et=a.useCallback(()=>{const Y=T.current;Y&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):Y.requestFullscreen().catch(()=>{}))},[]),He=a.useCallback(async()=>{const Y=I.current;if(Y)try{document.pictureInPictureElement?await document.exitPictureInPicture():await Y.requestPictureInPicture()}catch{}},[]),tt=a.useCallback(()=>{y.length!==0&&(de(Y=>(Y+1)%(y.length+1)-1),de(Y=>{const me=Y+1;return me>=y.length?-1:me}))},[y.length]),mt=a.useCallback(()=>{const Y=I.current;Y&&(Y.currentTime=Math.min(Y.currentTime+10,Y.duration||0))},[]),gt=a.useCallback(()=>{const Y=I.current;Y&&(Y.currentTime=Math.max(Y.currentTime-10,0))},[]),Ve=a.useCallback(()=>{const Y=I.current;Y&&(Te(null),Y.load())},[]),Oe=a.useCallback(()=>{s&&et()},[s,et]),Ue=a.useCallback(Y=>{const me=I.current,$e=$.current;if(!me||!$e||!D)return;const Ee=$e.getBoundingClientRect(),ct=Math.max(0,Math.min(1,(Y.clientX-Ee.left)/Ee.width));me.currentTime=ct*D},[D]),rt=a.useCallback(Y=>{const me=$.current;if(!me||!D)return;const $e=me.getBoundingClientRect(),Ee=Math.max(0,Math.min(1,(Y.clientX-$e.left)/$e.width));ne(Ee*D),K(Y.clientX-$e.left)},[D]),bt=a.useCallback(Y=>{const me=parseFloat(Y.target.value);P(me),I.current&&(I.current.volume=me,I.current.muted=me===0,V(me===0))},[]),St=a.useCallback(Y=>{X(Y),I.current&&(I.current.playbackRate=Y),he(!1)},[]),yt=x.length>0?[...x].reverse().find(Y=>k>=Y.time):null,_=Y=>[...x].reverse().find(me=>Y>=me.time)??null,oe=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],le=Array.isArray(e)?e[0].src:e,ye=ie||xe||!E,We=L?"none":"opacity 0.25s ease",nt=F||B===0?Ie.volumeMute:B<.5?Ie.volumeDown:Ie.volumeUp,vt=D>0?k/D*100:0,Gt=D>0?W/D*100:0;return t.jsxs("div",{ref:T,className:M,tabIndex:0,onMouseMove:Je,onMouseLeave:()=>{E&&fe(!1)},style:{position:"relative",width:o,height:i??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...N},children:[t.jsxs("video",{ref:I,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:l,loop:c,muted:d,playsInline:!0,onClick:Be,onDoubleClick:Oe,children:[oe.map((Y,me)=>t.jsx("source",{src:Y.src,type:Y.type},me)),y.map((Y,me)=>t.jsx("track",{kind:"subtitles",label:R(Y.label),srcLang:Y.lang,src:Y.src,default:Y.default},me))]}),f&&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:ye?1:0,transition:We,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:R(n)}),yt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",R(yt.label)]})]}),G&&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:L?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:t.jsx(Fe,{path:G==="play"?Ie.play:Ie.pause,size:32,color:"#fff"})}),Me&&!ze&&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:j.primary,borderRadius:"50%",animation:L?"none":"tkxvp-spin 0.8s linear infinite"}})}),ze&&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(Fe,{path:Ie.errorOutline,size:48,color:"#ef4444"}),t.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:ze}),t.jsxs("button",{type:"button",onClick:Ve,style:{display:"flex",alignItems:"center",gap:6,background:j.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(Fe,{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:ye?1:0,transition:We},onMouseEnter:()=>ve(!0),onMouseLeave:()=>ve(!1),children:[t.jsxs("div",{ref:$,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(D),"aria-valuenow":Math.floor(k),tabIndex:0,onClick:Ue,onMouseMove:rt,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:Y=>{Y.currentTarget.style.height="8px"},onMouseLeave:Y=>{Y.currentTarget.style.height="4px",ne(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Gt}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${vt}%`,background:j.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${vt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:j.primary,pointerEvents:"none"}}),x.map((Y,me)=>{const $e=D>0?Y.time/D*100:0;return t.jsx("div",{title:R(Y.label),style:{position:"absolute",top:"50%",left:`${$e}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${j.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},me)}),be!==null&&t.jsxs("div",{style:{position:"absolute",bottom:12,left:q,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:[or(be),_(be)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:R(_(be).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(dt,{onClick:Be,title:E?"Pause":"Play",primary:j.primary,children:t.jsx(Fe,{path:E?Ie.pause:Ie.play,size:22})}),t.jsx(dt,{onClick:gt,title:"Skip back 10 seconds",primary:j.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Fe,{path:Ie.replay10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsx(dt,{onClick:mt,title:"Skip forward 10 seconds",primary:j.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(Fe,{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:()=>Ge(!0),onMouseLeave:()=>Ge(!1),children:[t.jsx(dt,{onClick:Qe,title:F?"Unmute":"Mute",primary:j.primary,children:t.jsx(Fe,{path:nt,size:20})}),t.jsx("div",{style:{overflow:"hidden",width:Pe?64:0,opacity:Pe?1:0,transition:L?"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:F?0:B,onChange:bt,"aria-label":"Volume",style:{width:64,accentColor:j.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:[or(k)," / ",or(D)]}),t.jsx("div",{style:{flex:1}}),y.length>0&&t.jsx(dt,{onClick:tt,title:"Subtitles",primary:j.primary,active:Se>=0,children:t.jsx(Fe,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>he(Y=>!Y),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:[ge,"×"]}),ge!==1&&t.jsxs("span",{style:{position:"absolute",top:0,right:0,background:j.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[ge,"x"]}),se&&t.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${j.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(Y=>t.jsxs("button",{type:"button",onClick:()=>St(Y),style:{display:"block",width:"100%",padding:"6px 14px",background:Y===ge?j.primary+"30":"none",border:"none",color:Y===ge?j.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[Y,"×"]},Y))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(dt,{onClick:He,title:"Picture-in-Picture",primary:j.primary,active:ue,children:t.jsx(Fe,{path:Ie.pip,size:20})}),p&&t.jsx("a",{href:le,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(Fe,{path:Ie.download,size:20})}),s&&t.jsx(dt,{onClick:et,title:Q?"Exit fullscreen":"Fullscreen",primary:j.primary,children:t.jsx(Fe,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
53
+ `;function Zo(t,r){return{position:"absolute",top:r.top,left:r.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:t.surface,border:`1.5px solid ${t.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 Go({color:t}){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M20 6L9 17l-5-5"})})}function Jo({color:t}){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"5",fill:t}),e.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:t,strokeWidth:"2"})]})}function Qo({color:t}){return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2","aria-hidden":"true",children:e.jsx("path",{d:"M9 18l6-6-6-6"})})}function ei(t){const r=[];let n=0;for(const i of t)if(i.type!=="separator")if(i.type==="radio-group")for(let o=0;o<i.options.length;o++)r.push({kind:"radio",item:i,optionIdx:o,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 cn({items:t,pos:r,panelId:n,onClose:i,onCloseAll:o,isSubmenu:l=!1}){const c=B.useTheme(),[d,u]=a.useState(-1),[x,f]=a.useState(null),[m,p]=a.useState(null),h=a.useRef(null),[y,k]=a.useState(""),b=a.useRef(null),g=ei(t);a.useEffect(()=>{var C;(C=h.current)==null||C.focus()},[]),a.useEffect(()=>{var M;if(d<0)return;const C=(M=h.current)==null?void 0:M.querySelector(`[data-midx="${d}"]`);C==null||C.scrollIntoView({block:"nearest"})},[d]);const w=a.useCallback(C=>{var M,T,E,$,F,I;if(C.kind==="action"){if(C.item.disabled)return;(T=(M=C.item).onClick)==null||T.call(M),o()}else if(C.kind==="check"){if(C.item.disabled)return;($=(E=C.item).onChange)==null||$.call(E,!C.item.checked)}else if(C.kind==="radio"){if(C.item.disabled)return;(I=(F=C.item).onChange)==null||I.call(F,C.item.options[C.optionIdx].value)}else if(C.kind==="submenu"){if(C.item.disabled)return;f(C.item.id)}},[o]),j=C=>{var M;switch(C.key){case"ArrowDown":C.preventDefault(),u(T=>{const E=T+1;return E<g.length?E:0});break;case"ArrowUp":C.preventDefault(),u(T=>{const E=T-1;return E>=0?E:g.length-1});break;case"Home":C.preventDefault(),u(0);break;case"End":C.preventDefault(),u(g.length-1);break;case"Enter":case" ":C.preventDefault(),d>=0&&g[d]&&w(g[d]);break;case"Escape":C.preventDefault(),l?i():o();break;case"Tab":C.preventDefault(),o();break;case"ArrowRight":C.preventDefault(),d>=0&&((M=g[d])==null?void 0:M.kind)==="submenu"&&f(g[d].item.id);break;case"ArrowLeft":C.preventDefault(),l&&i();break;default:C.key.length===1&&!C.ctrlKey&&!C.metaKey&&S(C.key)}};function S(C){b.current&&clearTimeout(b.current);const M=y+C.toLowerCase();k(M);const T=g.findIndex(E=>(E.kind==="radio"?E.item.options[E.optionIdx].label:E.item.label).toLowerCase().startsWith(M));T>=0&&u(T),b.current=setTimeout(()=>k(""),800)}function z(C,M){const T=M.getBoundingClientRect();f(C.id);const E=Math.min(C.items.length*38+12,360);p(Xo(T,220,E))}function v(){f(null),p(null)}const N=()=>{let C=-1;return t.map(M=>{if(M.type==="separator")return e.jsx("div",{role:"separator",style:{margin:(M.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:M.label?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginLeft:14}}),e.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:s.sanitizeString(M.label)}),e.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,marginRight:14}})]}):e.jsx("div",{style:{flex:1,height:1,backgroundColor:c.border,margin:"0 10px"}})},M.id);if(M.type==="radio-group")return e.jsxs("div",{role:"group","aria-label":M.label,children:[M.label&&e.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:c.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:s.sanitizeString(M.label)}),M.options.map((L,Y)=>{C++;const D=C,V=D===d,R=L.value===M.value,P=!!M.disabled,A=kt(c,V,!1,P);return e.jsxs("div",{role:"menuitemradio","aria-checked":R,"aria-disabled":P||void 0,"data-midx":D,tabIndex:-1,style:A,onClick:()=>{var O;return!P&&((O=M.onChange)==null?void 0:O.call(M,L.value))},onMouseEnter:()=>!P&&u(D),children:[e.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:R?e.jsx(Jo,{color:c.primary}):e.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${c.border}`,display:"inline-block"}})}),L.icon&&e.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:L.icon}),e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(L.label)})]},L.value)})]},M.id);if(M.type==="check"){C++;const L=C,Y=L===d,D=!!M.disabled,V=kt(c,Y,!1,D);return e.jsxs("div",{role:"menuitemcheckbox","aria-checked":M.checked,"aria-disabled":D||void 0,"data-midx":L,tabIndex:-1,style:V,onClick:()=>{var R;return!D&&((R=M.onChange)==null?void 0:R.call(M,!M.checked))},onMouseEnter:()=>!D&&u(L),children:[e.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:M.checked?e.jsx(Go,{color:c.primary}):e.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),M.icon&&e.jsx("span",{style:{flexShrink:0,display:"flex",color:c.textMuted},children:M.icon}),e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(M.label)})]},M.id)}if(M.type==="submenu"){C++;const L=C,Y=L===d,D=!!M.disabled,V=x===M.id,R=kt(c,Y||V,!1,D);return e.jsxs("div",{style:{position:"relative"},children:[e.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":V,"aria-disabled":D||void 0,"data-midx":L,tabIndex:-1,style:R,onMouseEnter:P=>{D||(u(L),z(M,P.currentTarget))},onMouseLeave:()=>{},onClick:()=>{D||f(V?null:M.id)},children:[e.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:M.icon?e.jsx("span",{style:{display:"flex",color:c.textMuted},children:M.icon}):e.jsx("span",{style:{width:14}})}),e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(M.label)}),e.jsx(Qo,{color:c.textMuted})]}),V&&m&&Le.createPortal(e.jsx(cn,{items:M.items,pos:m,panelId:`${n}-sub-${M.id}`,onClose:v,onCloseAll:o,isSubmenu:!0}),document.body)]},M.id)}const T=M;C++;const E=C,$=E===d,F=!!T.disabled,I=!!T.danger,W=kt(c,$,I,F);return e.jsxs("div",{role:"menuitem","aria-disabled":F||void 0,"data-midx":E,tabIndex:-1,style:W,onClick:()=>{var L;F||((L=T.onClick)==null||L.call(T),o())},onMouseEnter:()=>{F||(u(E),v())},children:[e.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:T.icon?e.jsx("span",{style:{display:"flex",color:I?c.danger:c.textMuted},children:T.icon}):e.jsx("span",{style:{width:14}})}),e.jsxs("span",{style:{flex:1,minWidth:0},children:[e.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(T.label)}),T.description&&e.jsx("span",{style:{display:"block",fontSize:"12px",color:c.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.sanitizeString(T.description)})]}),T.shortcut&&e.jsx("span",{style:{fontSize:"12px",color:c.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:s.sanitizeString(T.shortcut)})]},T.id)})};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:qo}),e.jsx("div",{ref:h,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:j,style:{...Zo(c,r),maxHeight:400,overflowY:"auto"},children:N()})]})}function kt(t,r,n,i){const o=n?t.danger:t.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:i?"not-allowed":"pointer",userSelect:"none",color:i?t.textMuted:r&&n?t.danger:o,backgroundColor:r?n?`${t.danger}18`:`${t.primary}18`:"transparent",transition:"background-color 80ms",opacity:i?.5:1,outline:"none"}}function dn({trigger:t,items:r,placement:n="bottom-start",isDisabled:i=!1,onOpen:o,onClose:l,className:c,style:d}){const x=`tkx-menu-${a.useId().replace(/:/g,"")}`,[f,m]=a.useState(!1),[p,h]=a.useState(null),y=a.useRef(null),k=a.useCallback(()=>{if(i)return;const w=y.current;if(!w)return;const j=w.getBoundingClientRect(),S=Math.min(r.length*38+12,360);h(fr(j,n,220,S)),m(!0),o==null||o()},[i,r.length,o,n]),b=a.useCallback(()=>{var w,j,S;m(!1),l==null||l(),(S=(j=(w=y.current)==null?void 0:w.firstElementChild)==null?void 0:j.focus)==null||S.call(j)},[l]);a.useEffect(()=>{if(!f)return;const w=j=>{var v;const S=j.target;if((v=y.current)!=null&&v.contains(S))return;const z=document.querySelectorAll(".tkx-menu-panel");for(const N of z)if(N.contains(S))return;b()};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[f,b]),a.useEffect(()=>{if(!f)return;const w=()=>{const j=y.current;if(!j)return;const S=j.getBoundingClientRect(),z=Math.min(r.length*38+12,360);h(fr(S,n,220,z))};return window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w)}},[f,r.length,n]);const g=w=>{(w.key==="Enter"||w.key===" "||w.key==="ArrowDown")&&(w.preventDefault(),f||k()),w.key==="Escape"&&f&&(w.preventDefault(),b())};return e.jsxs("span",{ref:y,className:c,style:{display:"inline-flex",...d},children:[e.jsx("span",{role:"button",tabIndex:i?-1:0,"aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?x:void 0,"aria-disabled":i||void 0,onClick:()=>f?b():k(),onKeyDown:g,style:{display:"inline-flex",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none"},children:t}),f&&p&&Le.createPortal(e.jsx(cn,{items:r,pos:p,panelId:x,onClose:b,onCloseAll:b}),document.body)]})}dn.displayName="TkxMenu";const ti={sm:120,md:180,lg:240,xl:320};function vt(t){const r=new Date;if(t)try{const c=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(r),d=b=>{var g;return((g=c.find(w=>w.type===b))==null?void 0:g.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const x=parseInt(d("minute"),10),f=parseInt(d("second"),10),m=d("weekday"),p=d("month"),h=d("day"),y=d("year"),k=`${m}, ${p} ${h}, ${y}`;return{hours:u,minutes:x,seconds:f,milliseconds:r.getMilliseconds(),dateString:k}}catch{}const n=r.getHours(),i=r.getMinutes(),o=r.getSeconds(),l=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:i,seconds:o,milliseconds:r.getMilliseconds(),dateString:l}}function ri({time:t,size:r,analogStyle:n,showSeconds:i,reducedMotion:o,primary:l,danger:c,text:d,textMuted:u,border:x,surface:f,bg:m}){const p=r/2,h=r/2,y=r/2-4,{hours:k,minutes:b,seconds:g,milliseconds:w}=t,S=(g+(o?0:w)/1e3)/60*360,z=b/60*360+g/60*6,v=k%12/12*360+b/60*30,N=(I,W)=>{const L=(I-90)*Math.PI/180;return{x:p+Math.cos(L)*W,y:h+Math.sin(L)*W}},C=o?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const I=(P,A)=>{const G=-90+P*360,ee={x:p+Math.cos(-90*Math.PI/180)*A,y:h+Math.sin(-90*Math.PI/180)*A},oe={x:p+Math.cos(G*Math.PI/180)*A,y:h+Math.sin(G*Math.PI/180)*A},ae=P>.5?1:0;return`M ${ee.x} ${ee.y} A ${A} ${A} 0 ${ae} 1 ${oe.x} ${oe.y}`},W=k%12/12+b/60/12,L=b/60+g/3600,Y=(g+(o?0:w/1e3))/60,D=y-2,V=y-10,R=y-18;return e.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",children:[e.jsx("circle",{cx:p,cy:h,r:D,fill:"none",stroke:x,strokeWidth:4}),e.jsx("circle",{cx:p,cy:h,r:V,fill:"none",stroke:x,strokeWidth:4}),i&&e.jsx("circle",{cx:p,cy:h,r:R,fill:"none",stroke:x,strokeWidth:3}),e.jsx("path",{d:I(W,D),fill:"none",stroke:l,strokeWidth:4,strokeLinecap:"round"}),e.jsx("path",{d:I(L,V),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),i&&e.jsx("path",{d:I(Y,R),fill:"none",stroke:c,strokeWidth:3,strokeLinecap:"round"}),e.jsx("circle",{cx:p,cy:h,r:4,fill:l}),e.jsxs("text",{x:p,y:h+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(k).padStart(2,"0"),":",String(b).padStart(2,"0")]})]})}const M=N(v,y*.5),T=N(z,y*.75),E=N(S,y*.85),$=N(S+180,y*.2),F=[];if(n==="classic"){for(let W=0;W<60;W++){const L=W/60*360,Y=W%5===0,D=(L-90)*Math.PI/180,V=Y?y-10:y-6,R=p+Math.cos(D)*y,P=h+Math.sin(D)*y,A=p+Math.cos(D)*V,O=h+Math.sin(D)*V;F.push(e.jsx("line",{x1:R,y1:P,x2:A,y2:O,stroke:Y?d:u,strokeWidth:Y?2:1,strokeLinecap:"round"},W))}const I=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:W,angle:L}of I){const Y=(L-90)*Math.PI/180,D=y-20;F.push(e.jsx("text",{x:p+Math.cos(Y)*D,y:h+Math.sin(Y)*D,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:W},`n${W}`))}}else for(let I=0;I<12;I++){const L=(I/12*360-90)*Math.PI/180,Y=y-8;F.push(e.jsx("circle",{cx:p+Math.cos(L)*Y,cy:h+Math.sin(L)*Y,r:I%3===0?3:2,fill:I%3===0?d:u},I))}return e.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",style:{display:"block"},children:[e.jsx("circle",{cx:p,cy:h,r:y,fill:f,stroke:x,strokeWidth:2}),F,e.jsx("line",{x1:p,y1:h,x2:M.x,y2:M.y,stroke:l,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:C}}),e.jsx("line",{x1:p,y1:h,x2:T.x,y2:T.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:C}}),i&&e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:$.x,y1:$.y,x2:E.x,y2:E.y,stroke:c,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:"none"}}),e.jsx("circle",{cx:p,cy:h,r:3,fill:c})]}),e.jsx("circle",{cx:p,cy:h,r:n==="minimal"?3:5,fill:l})]})}function xr({time:t,format:r,showSeconds:n,showDate:i,label:o,size:l,primary:c,text:d,textMuted:u,colonVisible:x}){const{hours:f,minutes:m,seconds:p,dateString:h}=t;let y=f,k="";r==="12h"&&(k=f>=12?"PM":"AM",y=f%12||12);const b=l*.2,g={opacity:x?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return e.jsxs("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[e.jsxs("div",{style:{fontSize:b,color:c,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[e.jsx("span",{children:String(y).padStart(2,"0")}),e.jsx("span",{style:g,children:":"}),e.jsx("span",{children:String(m).padStart(2,"0")}),n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:g,children:":"}),e.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&e.jsx("span",{style:{fontSize:b*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:b*.05},children:k})]}),i&&e.jsx("div",{style:{fontSize:l*.072,color:u,marginTop:l*.025,letterSpacing:"0.03em"},children:h}),o&&e.jsx("div",{style:{fontSize:l*.065,color:u,marginTop:l*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:s.sanitizeString(o)})]})}function un({variant:t="both",size:r="md",showSeconds:n=!0,showDate:i=!1,format:o="24h",timezone:l,timezone2:c,label:d,analogStyle:u="classic",className:x,style:f}){const m=B.useTheme(),p=s.useReducedMotion(),[h,y]=a.useState(()=>vt(l)),[k,b]=a.useState(()=>c?vt(c):null),[g,w]=a.useState(!0),[j,S]=a.useState(!1),z=a.useRef(null);a.useEffect(()=>{S(!0)},[]),a.useEffect(()=>{const T=()=>{y(vt(l)),c&&b(vt(c))};T();const E=setInterval(T,1e3);return()=>clearInterval(E)},[l,c]),a.useEffect(()=>(z.current=setInterval(()=>{w(T=>!T)},500),()=>{z.current&&clearInterval(z.current)}),[]);const v=ti[r],N=t==="analog"||t==="both",C=t==="digital"||t==="both",M={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:t==="both"?`${v*.06}px`:0,opacity:j?1:0,transition:p?"none":"opacity 0.4s ease",...f};return e.jsxs("div",{className:x,style:M,role:"timer","aria-live":"off",children:[N&&e.jsx(ri,{time:h,size:v,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}),C&&e.jsx(xr,{time:h,format:o,showSeconds:n,showDate:i,label:d,size:v,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:g}),k&&c&&e.jsx("div",{style:{marginTop:v*.04,padding:`${v*.03}px ${v*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:e.jsx(xr,{time:k,format:o,showSeconds:!1,showDate:!1,label:c,size:v*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:g})})]})}un.displayName="TkxClock";function Nt(t){if(!isFinite(t)||isNaN(t))return"0:00";const r=Math.floor(t/3600),n=Math.floor(t%3600/60),i=Math.floor(t%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${n}:${String(i).padStart(2,"0")}`}function Ue({path:t,size:r=20,color:n="currentColor",title:i}){return e.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:e.jsx("path",{d:t})})}const Re={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 st({onClick:t,title:r,children:n,active:i,primary:o}){const[l,c]=a.useState(!1);return e.jsx("button",{type:"button",onClick:t,title:r,"aria-label":r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:i||l?o:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function fn({src:t,poster:r,title:n,width:i="100%",height:o,autoPlay:l=!1,loop:c=!1,muted:d=!1,controls:u=!0,showTitle:x=!0,allowFullscreen:f=!0,allowPiP:m=!0,allowDownload:p=!1,chapters:h=[],subtitles:y=[],startTime:k,onPlay:b,onPause:g,onEnded:w,onTimeUpdate:j,className:S,style:z}){const v=B.useTheme(),N=s.useReducedMotion(),C=a.useRef(null),M=a.useRef(null),T=a.useRef(null),E=a.useRef(null),[$,F]=a.useState(!1),[I,W]=a.useState(0),[L,Y]=a.useState(0),[D,V]=a.useState(0),[R,P]=a.useState(1),[A,O]=a.useState(d),[G,ee]=a.useState(!1),[oe,ae]=a.useState(!0),[fe,de]=a.useState(!1),[ge,U]=a.useState(1),[se,he]=a.useState(!1),[we,ce]=a.useState(-1),[me,re]=a.useState(null),[le,J]=a.useState(0),[X,ne]=a.useState(null),[xe,ke]=a.useState(!1),[Te,Me]=a.useState(!1),[He,$e]=a.useState(null),[ze,Ke]=a.useState(!1);a.useEffect(()=>{const _=C.current;if(!_)return;k!==void 0&&(_.currentTime=k);const pe=()=>{W(_.currentTime),_.buffered.length>0&&V(_.buffered.end(_.buffered.length-1))},je=()=>Y(_.duration),Ne=()=>F(!0),nt=()=>{F(!1),de(!0)},et=()=>{F(!1),de(!0),w==null||w()},ct=()=>ke(!0),dt=()=>ke(!1),ut=()=>Me(!0),bt=()=>Me(!1),yt=()=>{const Ze=_.error;$e(Ze?`Error ${Ze.code}: ${Ze.message||"Failed to load video"}`:"Failed to load video"),Me(!1)};return _.addEventListener("timeupdate",pe),_.addEventListener("durationchange",je),_.addEventListener("play",Ne),_.addEventListener("pause",nt),_.addEventListener("ended",et),_.addEventListener("enterpictureinpicture",ct),_.addEventListener("leavepictureinpicture",dt),_.addEventListener("waiting",ut),_.addEventListener("canplay",bt),_.addEventListener("error",yt),()=>{_.removeEventListener("timeupdate",pe),_.removeEventListener("durationchange",je),_.removeEventListener("play",Ne),_.removeEventListener("pause",nt),_.removeEventListener("ended",et),_.removeEventListener("enterpictureinpicture",ct),_.removeEventListener("leavepictureinpicture",dt),_.removeEventListener("waiting",ut),_.removeEventListener("canplay",bt),_.removeEventListener("error",yt)}},[w,k]),a.useEffect(()=>{C.current&&($?b==null||b():g==null||g())},[$,b,g]),a.useEffect(()=>{j==null||j(I,L)},[I,L,j]),a.useEffect(()=>{const _=C.current;if(!_)return;const pe=_.textTracks;for(let je=0;je<pe.length;je++)pe[je].mode=je===we?"showing":"disabled"},[we]),a.useEffect(()=>{const _=()=>ee(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",_),()=>document.removeEventListener("fullscreenchange",_)},[]),a.useEffect(()=>{const _=M.current;if(!_)return;const pe=je=>{const Ne=C.current;if(Ne&&je.target.tagName!=="INPUT")switch(je.key){case" ":case"k":je.preventDefault(),De();break;case"f":case"F":f&&Oe();break;case"m":case"M":Pe();break;case"ArrowRight":je.preventDefault(),Ne.currentTime=Math.min(Ne.currentTime+10,Ne.duration);break;case"ArrowLeft":je.preventDefault(),Ne.currentTime=Math.max(Ne.currentTime-10,0);break;case"ArrowUp":je.preventDefault(),P(Math.min(R+.1,1)),C.current&&(C.current.volume=Math.min(R+.1,1));break;case"ArrowDown":je.preventDefault(),P(Math.max(R-.1,0)),C.current&&(C.current.volume=Math.max(R-.1,0));break}};return _.addEventListener("keydown",pe),()=>_.removeEventListener("keydown",pe)},[R,f]);const Xe=a.useCallback(()=>{ae(!0),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{$&&ae(!1)},3e3)},[$]);a.useEffect(()=>(Xe(),()=>{E.current&&clearTimeout(E.current)}),[$,Xe]);const De=a.useCallback(()=>{const _=C.current;_&&(_.paused?(_.play().catch(()=>{}),ne("play"),de(!1)):(_.pause(),ne("pause")),setTimeout(()=>ne(null),600))},[]),Pe=a.useCallback(()=>{const _=C.current;if(!_)return;const pe=!A;O(pe),_.muted=pe},[A]),Oe=a.useCallback(()=>{const _=M.current;_&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):_.requestFullscreen().catch(()=>{}))},[]),Ie=a.useCallback(async()=>{const _=C.current;if(_)try{document.pictureInPictureElement?await document.exitPictureInPicture():await _.requestPictureInPicture()}catch{}},[]),qe=a.useCallback(()=>{y.length!==0&&(ce(_=>(_+1)%(y.length+1)-1),ce(_=>{const pe=_+1;return pe>=y.length?-1:pe}))},[y.length]),_e=a.useCallback(()=>{const _=C.current;_&&(_.currentTime=Math.min(_.currentTime+10,_.duration||0))},[]),Je=a.useCallback(()=>{const _=C.current;_&&(_.currentTime=Math.max(_.currentTime-10,0))},[]),q=a.useCallback(()=>{const _=C.current;_&&($e(null),_.load())},[]),te=a.useCallback(()=>{f&&Oe()},[f,Oe]),ve=a.useCallback(_=>{const pe=C.current,je=T.current;if(!pe||!je||!L)return;const Ne=je.getBoundingClientRect(),nt=Math.max(0,Math.min(1,(_.clientX-Ne.left)/Ne.width));pe.currentTime=nt*L},[L]),Se=a.useCallback(_=>{const pe=T.current;if(!pe||!L)return;const je=pe.getBoundingClientRect(),Ne=Math.max(0,Math.min(1,(_.clientX-je.left)/je.width));re(Ne*L),J(_.clientX-je.left)},[L]),ye=a.useCallback(_=>{const pe=parseFloat(_.target.value);P(pe),C.current&&(C.current.volume=pe,C.current.muted=pe===0,O(pe===0))},[]),Be=a.useCallback(_=>{U(_),C.current&&(C.current.playbackRate=_),he(!1)},[]),Ee=h.length>0?[...h].reverse().find(_=>I>=_.time):null,H=_=>[...h].reverse().find(pe=>_>=pe.time)??null,Q=Array.isArray(t)?t:[{src:t,type:"video/mp4"}],ie=Array.isArray(t)?t[0].src:t,be=oe||fe||!$,Ye=N?"none":"opacity 0.25s ease",Qe=A||R===0?Re.volumeMute:R<.5?Re.volumeDown:Re.volumeUp,lt=L>0?I/L*100:0,Mt=L>0?D/L*100:0;return e.jsxs("div",{ref:M,className:S,tabIndex:0,onMouseMove:Xe,onMouseLeave:()=>{$&&ae(!1)},style:{position:"relative",width:i,height:o??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...z},children:[e.jsxs("video",{ref:C,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:l,loop:c,muted:d,playsInline:!0,onClick:De,onDoubleClick:te,children:[Q.map((_,pe)=>e.jsx("source",{src:_.src,type:_.type},pe)),y.map((_,pe)=>e.jsx("track",{kind:"subtitles",label:s.sanitizeString(_.label),srcLang:_.lang,src:_.src,default:_.default},pe))]}),x&&n&&e.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:be?1:0,transition:Ye,pointerEvents:"none"},children:[e.jsx("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:s.sanitizeString(n)}),Ee&&e.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",s.sanitizeString(Ee.label)]})]}),X&&e.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:e.jsx(Ue,{path:X==="play"?Re.play:Re.pause,size:32,color:"#fff"})}),Te&&!He&&e.jsx("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:e.jsx("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:v.primary,borderRadius:"50%",animation:N?"none":"tkxvp-spin 0.8s linear infinite"}})}),He&&e.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:[e.jsx(Ue,{path:Re.errorOutline,size:48,color:"#ef4444"}),e.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:He}),e.jsxs("button",{type:"button",onClick:q,style:{display:"flex",alignItems:"center",gap:6,background:v.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[e.jsx(Ue,{path:Re.refresh,size:18,color:"#fff"}),"Retry"]})]}),u&&e.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:be?1:0,transition:Ye},onMouseEnter:()=>de(!0),onMouseLeave:()=>de(!1),children:[e.jsxs("div",{ref:T,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(L),"aria-valuenow":Math.floor(I),tabIndex:0,onClick:ve,onMouseMove:Se,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:_=>{_.currentTarget.style.height="8px"},onMouseLeave:_=>{_.currentTarget.style.height="4px",re(null)},children:[e.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Mt}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),e.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${lt}%`,background:v.primary,borderRadius:2,pointerEvents:"none"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:`${lt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:v.primary,pointerEvents:"none"}}),h.map((_,pe)=>{const je=L>0?_.time/L*100:0;return e.jsx("div",{title:s.sanitizeString(_.label),style:{position:"absolute",top:"50%",left:`${je}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${v.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},pe)}),me!==null&&e.jsxs("div",{style:{position:"absolute",bottom:12,left:le,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:[Nt(me),H(me)&&e.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:s.sanitizeString(H(me).label)})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(st,{onClick:De,title:$?"Pause":"Play",primary:v.primary,children:e.jsx(Ue,{path:$?Re.pause:Re.play,size:22})}),e.jsx(st,{onClick:Je,title:"Skip back 10 seconds",primary:v.primary,children:e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(Ue,{path:Re.replay10,size:22}),e.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),e.jsx(st,{onClick:_e,title:"Skip forward 10 seconds",primary:v.primary,children:e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(Ue,{path:Re.forward10,size:22}),e.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>Ke(!0),onMouseLeave:()=>Ke(!1),children:[e.jsx(st,{onClick:Pe,title:A?"Unmute":"Mute",primary:v.primary,children:e.jsx(Ue,{path:Qe,size:20})}),e.jsx("div",{style:{overflow:"hidden",width:ze?64:0,opacity:ze?1:0,transition:N?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:e.jsx("input",{type:"range",min:0,max:1,step:.05,value:A?0:R,onChange:ye,"aria-label":"Volume",style:{width:64,accentColor:v.primary,cursor:"pointer",height:4}})})]}),e.jsxs("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Nt(I)," / ",Nt(L)]}),e.jsx("div",{style:{flex:1}}),y.length>0&&e.jsx(st,{onClick:qe,title:"Subtitles",primary:v.primary,active:we>=0,children:e.jsx(Ue,{path:Re.closedCaption,size:20})}),e.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>he(_=>!_),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:[ge,"×"]}),ge!==1&&e.jsxs("span",{style:{position:"absolute",top:0,right:0,background:v.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[ge,"x"]}),se&&e.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${v.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(_=>e.jsxs("button",{type:"button",onClick:()=>Be(_),style:{display:"block",width:"100%",padding:"6px 14px",background:_===ge?v.primary+"30":"none",border:"none",color:_===ge?v.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[_,"×"]},_))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&e.jsx(st,{onClick:Ie,title:"Picture-in-Picture",primary:v.primary,active:xe,children:e.jsx(Ue,{path:Re.pip,size:20})}),p&&e.jsx("a",{href:ie,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:e.jsx(Ue,{path:Re.download,size:20})}),f&&e.jsx(st,{onClick:Oe,title:G?"Exit fullscreen":"Fullscreen",primary:v.primary,children:e.jsx(Ue,{path:G?Re.fullscreenExit:Re.fullscreen,size:20})})]})]}),e.jsx("style",{children:`
57
54
  @keyframes tkxvp-flash {
58
55
  0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
59
56
  100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
@@ -62,33 +59,33 @@
62
59
  0% { transform: rotate(0deg); }
63
60
  100% { transform: rotate(360deg); }
64
61
  }
65
- `})]})}So.displayName="TkxVideoPlayer";const _a={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 Ya({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 Ua({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 Ka({status:e,index:r,showStepNumbers:n,icon:o,circleSize:i,fontSize:l,primary:c,danger:d,success:u,text:f,textMuted:s,border:m,surface:p,variant:x,reducedMotion:y,clickable:v}){const b=e==="completed",g=e==="active",w=e==="error",S=e==="pending";let M=p,N=m,j=s,L=2;b?(M=x==="filled"?u:p,N=u,j=x==="filled"?"#fff":u):g?(M=x==="outlined"?p:c,N=c,j=x==="outlined"?c:"#fff",L=2):w?(M=x==="filled"?d:p,N=d,j=x==="filled"?"#fff":d):S&&(M=p,N=m,j=s);const I=g&&!y?{boxShadow:`0 0 0 4px ${c}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},T=v?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let $;return o&&!b&&!w?$=t.jsx("span",{style:{fontSize:l,lineHeight:1},children:o}):b?$=t.jsx(Ya,{size:i}):w?$=t.jsx(Ua,{size:i}):n?$=t.jsx("span",{style:{fontSize:l,fontWeight:600,lineHeight:1},children:r+1}):$=t.jsx("span",{style:{fontSize:i*.22,lineHeight:1,background:j,borderRadius:"50%",width:i*.22,height:i*.22,display:"block"}}),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`
62
+ `})]})}fn.displayName="TkxVideoPlayer";const ni={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 si({size:t}){const r=t*.55;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function oi({size:t}){const r=t*.55;return e.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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 ii({status:t,index:r,showStepNumbers:n,icon:i,circleSize:o,fontSize:l,primary:c,danger:d,success:u,text:x,textMuted:f,border:m,surface:p,variant:h,reducedMotion:y,clickable:k}){const b=t==="completed",g=t==="active",w=t==="error",j=t==="pending";let S=p,z=m,v=f,N=2;b?(S=h==="filled"?u:p,z=u,v=h==="filled"?"#fff":u):g?(S=h==="outlined"?p:c,z=c,v=h==="outlined"?c:"#fff",N=2):w?(S=h==="filled"?d:p,z=d,v=h==="filled"?"#fff":d):j&&(S=p,z=m,v=f);const C=g&&!y?{boxShadow:`0 0 0 4px ${c}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},M=k?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let T;return i&&!b&&!w?T=e.jsx("span",{style:{fontSize:l,lineHeight:1},children:i}):b?T=e.jsx(si,{size:o}):w?T=e.jsx(oi,{size:o}):n?T=e.jsx("span",{style:{fontSize:l,fontWeight:600,lineHeight:1},children:r+1}):T=e.jsx("span",{style:{fontSize:o*.22,lineHeight:1,background:v,borderRadius:"50%",width:o*.22,height:o*.22,display:"block"}}),e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
66
63
  @keyframes tkxstepper-pulse {
67
64
  0%, 100% { box-shadow: 0 0 0 0 ${c}50; }
68
65
  50% { box-shadow: 0 0 0 6px ${c}20; }
69
66
  }
70
- `}),t.jsx("div",{style:{width:i,height:i,minWidth:i,borderRadius:"50%",border:`${L}px solid ${N}`,backgroundColor:M,color:j,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...I,...T},children:$})]})}function tn({completed:e,orientation:r,connectorStyle:n,connectorWidth:o,primary:i,border:l,reducedMotion:c}){const d=e?i:l;return r==="horizontal"?t.jsx("div",{"aria-hidden":"true",style:{flex:1,height:o,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:c?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):t.jsx("div",{"aria-hidden":"true",style:{width:o,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:c?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function $o({steps:e,activeStep:r=0,orientation:n="horizontal",variant:o="default",size:i="md",clickable:l=!1,onStepClick:c,showStepNumbers:d=!0,alternateLabel:u=!1,connector:f="solid",className:s,style:m}){const p=U(),x=te(),y=_a[i],v=(g,w)=>g.status?g.status:w<r?"completed":w===r?"active":"pending",b=n==="horizontal";return t.jsx("div",{className:s,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:b?"row":"column",alignItems:b?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((g,w)=>{const S=v(g,w),M=w===e.length-1,N=S==="completed"||w<r,j=w%2===0,L=()=>{l&&(c==null||c(w))},I=t.jsx(Ka,{status:S,index:w,showStepNumbers:d,icon:g.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:o,reducedMotion:x,clickable:l}),T=t.jsxs("div",{style:{textAlign:b&&!u?"center":"left",maxWidth:b?120:void 0},children:[t.jsxs("div",{style:{fontSize:y.titleSize,fontWeight:S==="active"?600:500,color:S==="pending"?p.textMuted:S==="error"?p.danger:p.text,lineHeight:1.3,transition:x?"none":"color 0.2s"},children:[R(g.title),g.optional&&t.jsx("span",{style:{fontSize:y.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),g.description&&t.jsx("div",{style:{fontSize:y.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:R(g.description)}),g.error&&S==="error"&&t.jsx("div",{style:{fontSize:y.descSize,color:p.danger,marginTop:2},children:R(g.error)})]});return b?t.jsxs("div",{role:"listitem",style:{display:"flex",flex:M?0:1,alignItems:"center",minWidth:0},children:[t.jsxs("div",{onClick:L,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:l?"pointer":"default",flexShrink:0},"aria-current":S==="active"?"step":void 0,children:[u&&!j&&t.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:T}),I,!u&&T,u&&j&&t.jsx("div",{style:{marginTop:6},children:T})]}),!M&&t.jsx(tn,{completed:N,orientation:"horizontal",connectorStyle:f,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:x})]},g.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:L,style:{cursor:l?"pointer":"default"},"aria-current":S==="active"?"step":void 0,children:I}),!M&&t.jsx(tn,{completed:N,orientation:"vertical",connectorStyle:f,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:x})]}),t.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:M?0:16,flex:1,minWidth:0},children:T})]},g.id)})})}$o.displayName="TkxStepper";function Mo(e){let r=0,n=0,o=0;const i=e.replace("#","");i.length===3?(r=parseInt(i[0]+i[0],16),n=parseInt(i[1]+i[1],16),o=parseInt(i[2]+i[2],16)):i.length>=6&&(r=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),o=parseInt(i.slice(4,6),16)),r/=255,n/=255,o/=255;const l=Math.max(r,n,o),c=Math.min(r,n,o);let d=0,u=0;const f=(l+c)/2;if(l!==c){const s=l-c;switch(u=f>.5?s/(2-l-c):s/(l+c),l){case r:d=((n-o)/s+(n<o?6:0))/6;break;case n:d=((o-r)/s+2)/6;break;case o:d=((r-n)/s+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(f*100)]}function pr(e,r,n){r/=100,n/=100;const o=r*Math.min(n,1-n),i=l=>{const c=(l+e/30)%12,d=n-o*Math.max(Math.min(c-3,9-c,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function Yt(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16),o=parseInt(r.slice(2,4),16),i=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(i)?0:i]}function sr(e,r,n){return`#${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function ut(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function ir(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[o,i,l]=Yt(e);if(n==="rgb")return r<1?`rgba(${o}, ${i}, ${l}, ${r.toFixed(2)})`:`rgb(${o}, ${i}, ${l})`;const[c,d,u]=Mo(e);return n==="hsl"?r<1?`hsla(${c}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${c}, ${d}%, ${u}%)`:e}const Xa=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function qa({hue:e,sat:r,bright:n,onChange:o}){const i=a.useRef(null),l=a.useRef(!1),c=a.useCallback(f=>{const s=i.current;if(!s)return;const m=s.getBoundingClientRect(),p=Math.max(0,Math.min(1,(f.clientX-m.left)/m.width)),x=Math.max(0,Math.min(1,(f.clientY-m.top)/m.height));o(Math.round(p*100),Math.round((1-x)*100))},[o]);a.useEffect(()=>{const f=m=>{l.current&&c(m)},s=()=>{l.current=!1};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",s)}},[c]);const d=`${r}%`,u=`${100-n}%`;return t.jsxs("div",{ref:i,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:f=>{l.current=!0,c(f)},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:pr(e,r,n/2+25)}})]})}function Za({hue:e,onChange:r}){const n=a.useRef(null),o=a.useRef(!1),i=a.useCallback(l=>{const c=n.current;if(!c)return;const d=c.getBoundingClientRect(),u=Math.max(0,Math.min(1,(l.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return a.useEffect(()=>{const l=d=>{o.current&&i(d)},c=()=>{o.current=!1};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)}},[i]),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:l=>{o.current=!0,i(l)},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 Ga({alpha:e,hex:r,onChange:n}){const o=a.useRef(null),i=a.useRef(!1),l=a.useCallback(f=>{const s=o.current;if(!s)return;const m=s.getBoundingClientRect(),p=Math.max(0,Math.min(1,(f.clientX-m.left)/m.width));n(Math.round(p*100)/100)},[n]);a.useEffect(()=>{const f=m=>{i.current&&l(m)},s=()=>{i.current=!1};return document.addEventListener("mousemove",f),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",s)}},[l]);const[c,d,u]=Yt(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:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${c},${d},${u},0), rgba(${c},${d},${u},1))`},onMouseDown:f=>{i.current=!0,l(f)},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(${c},${d},${u},${e})`,pointerEvents:"none"}})})]})}function Ja({value:e,defaultValue:r="#3b82f6",onChange:n,format:o="hex",showAlpha:i=!1,presets:l=Xa,disabled:c=!1,size:d="md",placeholder:u,label:f,style:s}){const m=U(),p=a.useRef(null),x=a.useRef(null),[y,v]=a.useState(!1),b=e!==void 0,[g,w]=a.useState(b&&e||r),S=b?e||r:g,[M,N]=a.useState(1),[j,L]=a.useState(S),[I,T]=a.useState({top:0,left:0}),[$,z,E]=Mo(ut(S)?S:r),C=a.useCallback((X,se=M)=>{ut(X)&&(L(X),b||w(X),n==null||n(ir(X,se,o),o))},[M,b,o,n]);a.useEffect(()=>{b&&e&&ut(e)&&L(e)},[b,e]);const k=()=>{if(c)return;const X=p.current;if(!X)return;const se=X.getBoundingClientRect(),Se=window.innerHeight-se.bottom>320?se.bottom+6:se.top-326;T({top:Se+window.scrollY,left:se.left+window.scrollX}),v(!0)};a.useEffect(()=>{if(!y)return;const X=se=>{x.current&&!x.current.contains(se.target)&&p.current&&!p.current.contains(se.target)&&v(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[y]),a.useEffect(()=>{if(!y)return;const X=se=>{se.key==="Escape"&&v(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[y]);const A=(X,se)=>{const he=se/100,Se=X/100,de=he*(1-Se/2),be=de===0||de===1?0:(he-de)/Math.min(de,1-de),ne=pr($,Math.round(be*100),Math.round(de*100));C(ne)},D=X=>{const se=pr(X,z,E);C(se)},O=X=>{N(X),n==null||n(ir(S,X,o),o)},W=X=>{const se=X.target.value;L(se),ut(se)&&C(se)},H=(X,se)=>{const he=Math.max(0,Math.min(255,parseInt(se)||0)),[Se,de,be]=Yt(S),ne=X==="r"?sr(he,de,be):X==="g"?sr(Se,he,be):sr(Se,de,he);C(ne)},P={sm:28,md:34,lg:40}[d],[F,V,Q]=Yt(ut(S)?S:r),re={display:"inline-flex",alignItems:"center",gap:"8px",height:`${P}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...s},ie={width:`${P-8}px`,height:`${P-8}px`,borderRadius:"4px",backgroundColor:`rgba(${F},${V},${Q},${M})`,border:`1px solid ${m.border}`,flexShrink:0},fe={position:"absolute",top:I.top,left:I.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"},ve={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"},ge=X=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:X,border:X.toLowerCase()===S.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return t.jsxs(t.Fragment,{children:[f&&t.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:f}),t.jsxs("button",{ref:p,type:"button",style:re,onClick:k,disabled:c,"aria-label":`Color picker, current color ${S}`,"aria-haspopup":"dialog","aria-expanded":y,children:[t.jsx("div",{style:ie}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??ir(ut(S)?S:r,M,o)})]}),y&&Ne.createPortal(t.jsxs("div",{ref:x,style:fe,role:"dialog","aria-label":"Color picker",children:[t.jsx(qa,{hue:$,sat:z,bright:E,onChange:A}),t.jsx(Za,{hue:$,onChange:D}),i&&t.jsx(Ga,{alpha:M,hex:ut(S)?S:r,onChange:O}),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(${F},${V},${Q},${M})`,border:`1px solid ${m.border}`}}),t.jsx("input",{style:xe,value:j,onChange:W,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 se=X==="r"?F:X==="g"?V:Q;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:ve,type:"number",min:0,max:255,value:se,onChange:he=>H(X,he.target.value),"aria-label":`${X.toUpperCase()} channel`}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:X})]},X)}),i&&t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:ve,type:"number",min:0,max:100,value:Math.round(M*100),onChange:X=>O(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%"})]})]}),l.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:l.map(X=>t.jsx("button",{type:"button",style:ge(X),onClick:()=>C(X),"aria-label":`Select color ${X}`,onMouseEnter:se=>{se.currentTarget.style.transform="scale(1.15)"},onMouseLeave:se=>{se.currentTarget.style.transform="scale(1)"}},X))})]})]}),document.body)]})}const Qa={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 rn(e,r,n){let o=e;return r!==void 0&&(o=Math.max(o,r)),n!==void 0&&(o=Math.min(o,n)),o}function ar(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function el(e,r,n,o,i){const l=o??"en-US";return r==="currency"?new Intl.NumberFormat(l,{style:"currency",currency:n??"USD",minimumFractionDigits:i??2,maximumFractionDigits:i??2}).format(e):r==="percent"?new Intl.NumberFormat(l,{style:"percent",minimumFractionDigits:i??0,maximumFractionDigits:i??0}).format(e/100):r==="decimal"||i!==void 0?new Intl.NumberFormat(l,{minimumFractionDigits:i??0,maximumFractionDigits:i??20}).format(e):String(e)}function nn({direction:e,isDisabled:r,btnW:n,height:o,primaryColor:i,borderColor:l,textMuted:c,iconSz:d,onStep:u}){const f=a.useRef(null),s=a.useRef(null),m=e==="inc"?1:-1,p=a.useCallback(()=>{u(m),f.current=setTimeout(()=>{s.current=setInterval(()=>u(m),60)},400)},[m,u]),x=a.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null),s.current&&(clearInterval(s.current),s.current=null)},[]);a.useEffect(()=>()=>x(),[x]);const y=e==="inc";return t.jsx("button",{type:"button","aria-label":y?"Increment":"Decrement",disabled:r,onMouseDown:p,onMouseUp:x,onMouseLeave:x,onTouchStart:v=>{v.preventDefault(),p()},onTouchEnd:x,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:y?void 0:`1px solid ${l}`,borderLeft:y?`1px solid ${l}`:void 0,cursor:r?"not-allowed":"pointer",color:r?c:i,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:v=>{r||(v.currentTarget.style.background=`${i}12`)},onBlur:v=>{v.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 Co({value:e,defaultValue:r=0,onChange:n,min:o,max:i,step:l=1,precision:c,prefix:d,suffix:u,format:f,currency:s,locale:m,clampOnBlur:p=!0,allowMouseWheel:x=!1,size:y="md",label:v,hint:b,isDisabled:g=!1,isReadOnly:w=!1,isInvalid:S=!1,errorMessage:M,id:N,className:j,style:L}){const I=U(),T=a.useId(),$=N??T,z=`${$}-hint`,E=`${$}-error`,C=e!==void 0,[k,A]=a.useState(r),D=C?e:k,[O,W]=a.useState(!1),[H,B]=a.useState(""),P=Qa[y],F=S||!!M,V=F?I.danger:O?I.primary:I.border,Q=[b&&z,F&&E].filter(Boolean).join(" ")||void 0,re=v?R(v):void 0,ie=b?R(b):void 0,fe=M?R(M):void 0,xe=d?R(d):void 0,ve=u?R(u):void 0,ge=a.useCallback(K=>{const G=ar(K,c);C||A(G),n==null||n(G)},[C,n,c]),X=a.useCallback(K=>{if(g||w)return;const G=rn(ar(D+K*l,c),o,i);ge(G)},[g,w,D,l,c,o,i,ge]),se=()=>{W(!0),B(String(D))},he=()=>{W(!1);const K=parseFloat(H);if(isNaN(K)){n==null||n(null),B(String(D));return}let G=ar(K,c);p&&(G=rn(G,o,i)),ge(G)},Se=K=>{B(K.target.value)},de=K=>{K.key==="ArrowUp"&&(K.preventDefault(),X(1)),K.key==="ArrowDown"&&(K.preventDefault(),X(-1))},be=K=>{!x||!O||(K.preventDefault(),X(K.deltaY<0?1:-1))},ne=O?H:el(D,f,s,m,c),q=(xe||ve)&&!O;return t.jsxs("div",{className:ae(h("flex flex-col gap-1 w-full"),j),style:L,children:[re&&t.jsx("label",{htmlFor:$,className:h("text-sm font-medium font-sans"),style:{color:I.text},children:re}),t.jsxs("div",{className:h("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${V}`,backgroundColor:g?I.surfaceAlt:I.surface,opacity:g?.65:1,height:P.height},children:[t.jsx(nn,{direction:"dec",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:P.iconSz,onStep:X}),t.jsxs("div",{className:h("relative flex-1 flex items-center overflow-hidden"),children:[q&&xe&&t.jsx("span",{style:{position:"absolute",left:P.px,fontSize:P.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:$,type:"text",inputMode:"decimal",value:O?H:ne,readOnly:w,disabled:g,"aria-invalid":F,"aria-describedby":Q,"aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":D,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:P.fontSize,fontFamily:"inherit",color:I.text,paddingLeft:q&&xe?`calc(${P.px} + 1.2em)`:P.px,paddingRight:q&&ve?`calc(${P.px} + 1.2em)`:P.px,cursor:g?"not-allowed":w?"default":"text"},onFocus:se,onBlur:he,onChange:Se,onKeyDown:de,onWheel:be}),q&&ve&&t.jsx("span",{style:{position:"absolute",right:P.px,fontSize:P.fontSize,color:I.textMuted,pointerEvents:"none",userSelect:"none"},children:ve})]}),t.jsx(nn,{direction:"inc",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:I.primary,borderColor:I.border,textMuted:I.textMuted,iconSz:P.iconSz,onStep:X})]}),ie&&!fe&&t.jsx("span",{id:z,className:h("text-xs"),style:{color:I.textMuted},children:ie}),fe&&t.jsxs("span",{id:E,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:I.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"})}),fe]})]})}Co.displayName="TkxNumberInput";const tl={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},rl={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function on(e,r){return rl[r].test(e)?e.toUpperCase():""}function To({length:e=6,value:r,onChange:n,onComplete:o,type:i="number",mask:l=!1,autoFocus:c=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:f,hint:s,size:m="md",separator:p,separatorPosition:x,className:y,style:v}){const b=U(),g=a.useId(),w=`${g}-hint`,S=`${g}-error`,M=r!==void 0,N=F=>{const V=F.split("").slice(0,e);for(;V.length<e;)V.push("");return V},[j,L]=a.useState(()=>N(M?r:"")),I=M?N(r):j,T=a.useRef([]),$=tl[m],z=u||!!f,E=I.every(F=>F!==""),C=s?R(s):void 0,k=f?R(f):void 0,A=F=>z?b.danger:E?b.success:b.border;a.useEffect(()=>{var F;c&&((F=T.current[0])==null||F.focus())},[]);const D=a.useCallback(F=>{M||L(F);const V=F.join("");n==null||n(V),F.every(Q=>Q!=="")&&(o==null||o(V))},[M,n,o]),O=F=>{var Q;const V=Math.max(0,Math.min(e-1,F));(Q=T.current[V])==null||Q.focus()},W=F=>V=>{if(!d){if(V.key==="Backspace"){if(V.preventDefault(),I[F]!==""){const Q=[...I];Q[F]="",D(Q)}else if(F>0){const Q=[...I];Q[F-1]="",D(Q),O(F-1)}return}if(V.key==="Delete"){V.preventDefault();const Q=[...I];Q[F]="",D(Q);return}if(V.key==="ArrowLeft"){V.preventDefault(),O(F-1);return}if(V.key==="ArrowRight"){V.preventDefault(),O(F+1);return}if(V.key==="Home"){V.preventDefault(),O(0);return}if(V.key==="End"){V.preventDefault(),O(e-1);return}}},H=F=>V=>{if(d)return;const re=V.target.value.slice(-1);if(!re)return;const ie=on(re,i);if(!ie)return;const fe=[...I];fe[F]=ie,D(fe),F<e-1&&O(F+1)},B=F=>V=>{if(V.preventDefault(),d)return;const re=V.clipboardData.getData("text").split("").map(xe=>on(xe,i)).filter(Boolean);if(!re.length)return;const ie=[...I];let fe=F;for(const xe of re){if(fe>=e)break;ie[fe]=xe,fe++}D(ie),O(Math.min(fe,e-1))},P=[C&&w,z&&S].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ae(h("flex flex-col gap-2 w-fit"),y),style:v,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":P,className:h("flex items-center"),style:{gap:$.gap},children:Array.from({length:e},(F,V)=>{const Q=A();return typeof document<"u"&&(document.activeElement,T.current[V]),t.jsxs("div",{className:h("flex items-center"),style:{gap:$.gap},children:[p&&x===V&&V!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:b.textMuted,userSelect:"none",flexShrink:0},children:p}),t.jsx("input",{ref:re=>{T.current[V]=re},type:l?"password":"text",inputMode:i==="number"?"numeric":"text",maxLength:1,value:I[V],disabled:d,"aria-label":`Digit ${V+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:H(V),onKeyDown:W(V),onPaste:B(V),onFocus:re=>re.target.select(),style:{width:$.box,height:$.box,textAlign:"center",fontSize:$.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?b.surfaceAlt:b.surface,color:b.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:re=>{d||(re.currentTarget.style.borderColor=z?b.danger:b.primary,re.currentTarget.style.boxShadow=`0 0 0 3px ${z?b.danger:b.primary}33`)},onBlurCapture:re=>{re.currentTarget.style.borderColor=A(),re.currentTarget.style.boxShadow="none"}})]},V)})}),C&&!k&&t.jsx("span",{id:w,className:h("text-xs"),style:{color:b.textMuted},children:C}),k&&t.jsxs("span",{id:S,role:"alert",className:h("text-xs flex items-center gap-1"),style:{color:b.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"})}),k]})]})}To.displayName="TkxOTP";function nl(e,r){a.useEffect(()=>{if(!r)return;const n=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r])}function ol(e){const r=a.useRef(null);return a.useEffect(()=>{if(!e||!r.current)return;const n=r.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),i=o[0],l=o[o.length-1],c=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===i&&(d.preventDefault(),l==null||l.focus()):document.activeElement===l&&(d.preventDefault(),i==null||i.focus()))};return n.addEventListener("keydown",c),()=>n.removeEventListener("keydown",c)},[e]),r}function sl(){const[e,r]=a.useState(!1),n=a.useCallback(()=>r(!0),[]),o=a.useCallback(()=>r(!1),[]),i=a.useCallback(()=>r(l=>!l),[]);return{isOpen:e,open:n,close:o,toggle:i}}function lr(e,r){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=r.toLowerCase(),i=o.indexOf(n);if(i!==-1)return{matched:!0,ranges:[[i,i+n.length-1]],score:i===0?100:80};const l=[];let c=0,d=-1,u=-1;for(let f=0;f<o.length&&c<n.length;f++)o[f]===n[c]&&((u===-1||f!==u+1)&&(d!==-1&&l.push([d,u]),d=f),u=f,c++);return d!==-1&&u!==-1&&l.push([d,u]),c<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:l,score:40}}function il(e,r){if(!e.trim())return r.filter(o=>!o.disabled).map(o=>({item:o,score:0,labelRanges:[]}));const n=[];for(const o of r){if(o.disabled)continue;const i=lr(e,o.label),l=o.description?lr(e,o.description):{matched:!1,score:0},c=(o.keywords??[]).some(d=>lr(e,d).matched);i.matched?n.push({item:o,score:i.score+20,labelRanges:i.ranges}):l.matched?n.push({item:o,score:l.score,labelRanges:[]}):c&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((o,i)=>i.score-o.score)}function al({text:e,ranges:r,color:n}){if(!r.length)return t.jsx(t.Fragment,{children:e});const o=[];let i=0;for(const[l,c]of r)i<l&&o.push(t.jsx("span",{children:e.slice(i,l)},`t-${i}`)),o.push(t.jsx("span",{style:{color:n,fontWeight:700},children:e.slice(l,c+1)},`h-${l}`)),i=c+1;return i<e.length&&o.push(t.jsx("span",{children:e.slice(i)},"t-end")),t.jsx(t.Fragment,{children:o})}function ll({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 Eo({items:e,isOpen:r=!1,onClose:n,placeholder:o="Type a command or search…",emptyMessage:i,maxItems:l=8,onItemSelect:c,className:d,style:u}){const f=U(),[s,m]=a.useState(""),[p,x]=a.useState(0),[y,v]=a.useState(!1),b=a.useRef(null),g=a.useRef(null),w=a.useId(),S=ol(r),M=il(s,e).slice(0,l),N=[];for(const E of M){const C=E.item.group,k=N.find(A=>A.group===C);k?k.items.push(E):N.push({group:C,items:[E]})}const j=N.flatMap(E=>E.items);nl(()=>{n==null||n()},r),a.useEffect(()=>{r&&(m(""),x(0),setTimeout(()=>{var E;return(E=b.current)==null?void 0:E.focus()},30))},[r]),a.useEffect(()=>{p>=j.length&&x(Math.max(0,j.length-1))},[j.length,p]);const L=a.useCallback(E=>{const C=g.current;if(!C)return;const k=C.querySelectorAll("[data-command-item]")[E];k==null||k.scrollIntoView({block:"nearest"})},[]),I=E=>{if(E.key==="ArrowDown"){E.preventDefault();const C=Math.min(j.length-1,p+1);x(C),L(C)}else if(E.key==="ArrowUp"){E.preventDefault();const C=Math.max(0,p-1);x(C),L(C)}else if(E.key==="Enter"){E.preventDefault();const C=j[p];C&&T(C.item)}},T=E=>{var C;E.disabled||((C=E.onSelect)==null||C.call(E),c==null||c(E),n==null||n())};if(!r||typeof document>"u")return null;const $=R(o),z=i?R(i):`No results for "${R(s)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const E=document.createElement("style");E.id="tkx-shimmer-style",E.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(E)}return Ne.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:S,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:w,className:ae(d),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:f.surface,border:`1px solid ${f.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${f.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 ${f.border}`},children:[t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:f.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:b,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":j[p]?`${w}-item-${j[p].item.id}`:void 0,value:s,onChange:E=>{m(E.target.value),x(0)},onKeyDown:I,placeholder:$,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:f.text}}),s&&t.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var E;m(""),x(0),(E=b.current)==null||E.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:f.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:g,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(E,C)=>t.jsx(ll,{surface:f.surface,border:f.border},C)):j.length===0?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:f.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:z})]}):N.map(({group:E,items:C},k)=>{const A=N.slice(0,k).reduce((D,O)=>D+O.items.length,0);return t.jsxs("div",{children:[E&&t.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:f.textMuted,padding:"10px 12px 4px"},children:R(E)}),C.map((D,O)=>{const W=A+O,H=W===p,B=D.item;return t.jsxs("div",{id:`${w}-item-${B.id}`,role:"option","aria-selected":H,"aria-disabled":B.disabled,"data-command-item":!0,onClick:()=>T(B),onMouseEnter:()=>x(W),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:B.disabled?"not-allowed":"pointer",opacity:B.disabled?.45:1,backgroundColor:H?`${f.primary}18`:"transparent",borderLeft:H?`2px solid ${f.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[B.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:H?f.primary:f.textMuted},children:B.icon}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:f.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.jsx(al,{text:B.label,ranges:D.labelRanges,color:f.primary})}),B.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:f.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:R(B.description)})]}),B.shortcut&&t.jsx("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:f.textMuted,backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:R(B.shortcut)})]},B.id)})]},E??"__default__")})}),j.length>0&&t.jsxs("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${f.border}`,fontSize:"0.6875rem",color:f.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)}Eo.displayName="TkxCommand";function Pt({direction:e,onClick:r,isDisabled:n,primaryColor:o,position:i,orientation:l}){const c=l==="vertical",d=e==="prev",u=i==="inside"?{position:"absolute",zIndex:3,...c?{[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:f=>{f.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:f=>{f.currentTarget.style.boxShadow="none"},onMouseEnter:f=>{n||(f.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:c?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 Io({slides:e,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:o=!0,loop:i=!0,showArrows:l=!0,showDots:c=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:f=1,gap:s=0,transitionDuration:m=400,swipeable:p=!0,initialIndex:x=0,onChange:y,arrowPosition:v="inside",height:b=320,className:g,style:w}){const S=U(),M=te(),N=a.useId(),j=e.length,[L,I]=a.useState(x),[T,$]=a.useState(i?x+1:x),[z,E]=a.useState(!1),[C,k]=a.useState(!1),A=a.useRef(null),D=a.useRef(null),O=a.useRef(null),W=a.useRef(0),H=a.useRef(!1),B=u==="vertical",P=M?0:m,F=i&&j>1?[e[j-1],...e,e[0]]:e,V=F.length,Q=100/f,re=(G,ee=0)=>{const ue=ee!==0?` - ${ee}px`:"";return B?`translateY(calc(-${G*Q}%${ue}))`:`translateX(calc(-${G*Q}%${ue}))`},ie=a.useCallback((G,ee=!1)=>{const ue=i?(G%j+j)%j:Math.max(0,Math.min(j-1,G)),ke=i?ue+1:ue;ee&&A.current?(A.current.style.transition="none",$(ke),I(ue),A.current.offsetHeight,A.current.style.transition=""):(E(!0),$(ke),I(ue)),y==null||y(ue)},[j,i,y]),fe=a.useCallback(()=>ie(L-1),[L,ie]),xe=a.useCallback(()=>ie(L+1),[L,ie]),ve=a.useCallback(()=>{E(!1),!(!i||j<=1)&&(T===0?ie(j-1,!0):T===V-1&&ie(0,!0))},[i,j,T,V,ie]);a.useEffect(()=>{if(!(!r||C||j<=1))return D.current=setInterval(xe,n),()=>{D.current&&clearInterval(D.current)}},[r,C,n,xe,j]),a.useEffect(()=>{const G=ee=>{const ue=document.activeElement,ke=document.getElementById(N);ke!=null&&ke.contains(ue)&&(ee.key===(B?"ArrowUp":"ArrowLeft")&&(ee.preventDefault(),fe()),ee.key===(B?"ArrowDown":"ArrowRight")&&(ee.preventDefault(),xe()))};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[N,B,fe,xe]);const ge=G=>"touches"in G?B?G.touches[0].clientY:G.touches[0].clientX:B?G.clientY:G.clientX,X=G=>{p&&(O.current=ge(G),W.current=0,H.current=!0)},se=G=>{if(!H.current||O.current===null)return;const ee=ge(G)-O.current;W.current=ee,A.current&&(A.current.style.transition="none",A.current.style.transform=re(T,-ee))},he=()=>{if(!H.current)return;H.current=!1;const G=W.current,ee=50;A.current&&(A.current.style.transition="",A.current.style.transform=""),G<-ee?xe():G>ee?fe():A.current&&(A.current.style.transform=re(T)),O.current=null,W.current=0},Se=typeof b=="number"?`${b}px`:b,de={display:"flex",flexDirection:B?"column":"row",width:B?"100%":`${V/f*100}%`,height:B?`${V/f*100}%`:"100%",transform:re(T),transition:z||!M?`transform ${P}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:s>0?s:void 0},be={flexShrink:0,width:B?"100%":`${Q/(V/f)}%`,height:B?`${Q/(V/f)}%`:"100%",overflow:"hidden",position:"relative"},ne=i||L>0,q=i||L<j-1,K=v==="outside";return t.jsxs("div",{id:N,className:ae(h("flex flex-col gap-2"),g),style:w,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[t.jsxs("div",{className:h("flex items-center gap-2"),style:{gap:K&&l?8:0},children:[l&&K&&t.jsx(Pt,{direction:"prev",onClick:fe,isDisabled:!ne,primaryColor:S.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:Se,borderRadius:12,cursor:p?H.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>o&&k(!0),onMouseLeave:()=>{k(!1),he()},onTouchStart:X,onTouchMove:se,onTouchEnd:he,onMouseDown:X,onMouseMove:se,onMouseUp:he,"aria-live":"polite","aria-atomic":"false",children:[l&&!K&&t.jsxs(t.Fragment,{children:[t.jsx(Pt,{direction:"prev",onClick:fe,isDisabled:!ne,primaryColor:S.primary,position:"inside",orientation:u}),t.jsx(Pt,{direction:"next",onClick:xe,isDisabled:!q,primaryColor:S.primary,position:"inside",orientation:u})]}),t.jsx("div",{ref:A,style:de,onTransitionEnd:ve,children:F.map((G,ee)=>t.jsx("div",{style:be,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(ee-(i?1:0)+j)%j+1} of ${j}`,"aria-hidden":(ee-(i?1:0)+j)%j!==L,children:G.content},`${G.id}-${ee}`))}),c&&!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((G,ee)=>t.jsx("button",{type:"button","aria-label":`Go to slide ${ee+1}`,"aria-current":ee===L?"true":void 0,onClick:()=>ie(ee),style:{width:ee===L?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:ee===L?S.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:ue=>{ue.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}66`},onBlur:ue=>{ue.currentTarget.style.boxShadow="none"}},G.id))})]}),l&&K&&t.jsx(Pt,{direction:"next",onClick:xe,isDisabled:!q,primaryColor:S.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((G,ee)=>t.jsxs("button",{type:"button",role:"tab","aria-selected":ee===L,"aria-label":`Thumbnail for slide ${ee+1}`,onClick:()=>ie(ee),style:{flexShrink:0,width:60,height:42,border:`2px solid ${ee===L?S.primary:S.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:S.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:ue=>{ue.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}55`},onBlur:ue=>{ue.currentTarget.style.boxShadow="none"},children:[G.thumbnail?t.jsx("img",{src:G.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:S.textMuted,fontWeight:600},children:ee+1}),ee===L&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${S.primary}22`}})]},G.id))})]})}Io.displayName="TkxCarousel";function cl({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dl({onClick:e,bgColor:r,hoverColor:n,textColor:o}){const i=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),e())};return t.jsx("button",{type:"button",onClick:e,onKeyDown:i,"aria-label":"Show hidden breadcrumb items",className:h("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:r,color:o,transition:"background-color 150ms ease"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=n},onMouseLeave:l=>{l.currentTarget.style.backgroundColor=r},children:"…"})}function ul({items:e,separator:r,maxItems:n,onNavigate:o,className:i,style:l}){const c=U(),d=te(),u=n!==void 0&&n>1&&e.length>n,s=a.useCallback(()=>{if(!u||!n)return e.map((L,I)=>({item:L,originalIndex:I}));const S=Math.ceil((n-1)/2),M=n-1-S,N=e.slice(0,S).map((L,I)=>({item:L,originalIndex:I})),j=e.slice(e.length-M).map((L,I)=>({item:L,originalIndex:e.length-M+I}));return N.concat(j)},[e,n,u])(),m=u&&n?Math.ceil((n-1)/2):-1,p=(S,M)=>{o==null||o(S,M)},x=(S,M,N)=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),p(M,N))},y=d?{}:{transition:"color 150ms ease, background-color 150ms ease"},v=S=>t.jsx("li",{role:"presentation","aria-hidden":"true",className:h("flex items-center mx-1.5"),children:r??t.jsx(cl,{color:c.textMuted})},S),b=(S,M,N)=>{const j=R(S.label);if(N)return t.jsx("li",{children:t.jsxs("span",{"aria-current":"page",className:h("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:c.text},children:[S.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:S.icon}),j]})},`item-${M}`);const L=!!S.href,I={color:c.textMuted,textDecoration:"none",...y},T={onMouseEnter:z=>{z.currentTarget.style.color=c.primary},onMouseLeave:z=>{z.currentTarget.style.color=c.textMuted}},$=t.jsxs(t.Fragment,{children:[S.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:S.icon}),j]});return L?t.jsx("li",{children:t.jsx("a",{href:S.href,onClick:z=>{o&&(z.preventDefault(),p(S,M))},className:h("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...I,focusRingColor:c.primary},...T,children:$})},`item-${M}`):t.jsx("li",{children:t.jsx("button",{type:"button",onClick:()=>p(S,M),onKeyDown:z=>x(z,S,M),className:h("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:I,...T,children:$})},`item-${M}`)},g=[];let w=!1;for(let S=0;S<s.length;S++){const{item:M,originalIndex:N}=s[S],j=N===e.length-1;u&&!w&&S===m&&(g.length>0&&g.push(v("sep-ellipsis-before")),g.push(t.jsx("li",{role:"presentation",children:t.jsx(dl,{onClick:()=>{},bgColor:c.surfaceAlt,hoverColor:c.surface,textColor:c.textMuted})},"ellipsis")),w=!0),g.length>0&&g[g.length-1]!==null&&g.push(v(`sep-${N}`)),g.push(b(M,N,j))}return t.jsx("nav",{"aria-label":"Breadcrumb",className:h("font-sans",i??""),style:{...l},children:t.jsx("ol",{role:"list",className:h("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}const Ae=8,it=8;function fl(e,r,n){const o=r.getBoundingClientRect(),i=window.scrollX,l=window.scrollY,c=window.innerWidth,d=window.innerHeight;let u=0,f=0,s=n;const m={top:e.top-o.height-it-Ae>0,bottom:e.bottom+o.height+it+Ae<d,left:e.left-o.width-it-Ae>0,right:e.right+o.width+it+Ae<c};if(!m[n]){const x={top:"bottom",bottom:"top",left:"right",right:"left"};m[x[n]]&&(s=x[n])}switch(s){case"top":u=e.top+l-o.height-it-Ae,f=e.left+i+e.width/2-o.width/2;break;case"bottom":u=e.bottom+l+it+Ae,f=e.left+i+e.width/2-o.width/2;break;case"left":u=e.top+l+e.height/2-o.height/2,f=e.left+i-o.width-it-Ae;break;case"right":u=e.top+l+e.height/2-o.height/2,f=e.right+i+it+Ae;break}f=Math.max(8,Math.min(f,c+i-o.width-8)),u=Math.max(8,Math.min(u,d+l-o.height-8));const p={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:Ae};switch(s){case"top":Object.assign(p,{bottom:-Ae*2,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(p,{top:-Ae*2,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(p,{right:-Ae*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(p,{left:-Ae*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"});break}return{top:u,left:f,arrowStyle:p,resolvedPlacement:s}}function pl({trigger:e,content:r,placement:n="bottom",isOpen:o,onOpenChange:i,closeOnClickOutside:l=!0,className:c,style:d}){const u=U(),f=te(),s=a.useId(),m=o!==void 0,[p,x]=a.useState(!1),y=m?o:p,v=a.useRef(null),b=a.useRef(null);a.useRef(null);const[g,w]=a.useState(null),S=a.useCallback(I=>{m||x(I),i==null||i(I)},[m,i]),M=a.useCallback(()=>S(!1),[S]),N=a.useCallback(()=>S(!y),[S,y]);lt(M,y),a.useEffect(()=>{if(!y||!l)return;const I=T=>{var z,E;const $=T.target;(z=v.current)!=null&&z.contains($)||(E=b.current)!=null&&E.contains($)||M()};return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[y,l,M]),a.useEffect(()=>{if(!y||!v.current)return;const I=()=>{if(!v.current||!b.current)return;const T=v.current.getBoundingClientRect();w(fl(T,b.current,n))};return requestAnimationFrame(I),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}},[y,n]);const j=f?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},L=y&&typeof document<"u"?Ne.createPortal(t.jsxs("div",{ref:b,id:s,role:"dialog","aria-modal":"false",className:h("absolute z-[9100] rounded-lg font-sans",c??""),style:{"--tkx-popover-bg":u.surface,top:(g==null?void 0:g.top)??-9999,left:(g==null?void 0:g.left)??-9999,backgroundColor:u.surface,border:`1px solid ${u.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:u.text,...j,...d},children:[g&&t.jsx("span",{style:g.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:v,className:h("inline-flex"),onClick:N,onKeyDown:I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),N())},"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":y?s:void 0,children:e}),L,y&&!f&&t.jsx("style",{children:`
67
+ `}),e.jsx("div",{style:{width:o,height:o,minWidth:o,borderRadius:"50%",border:`${N}px solid ${z}`,backgroundColor:S,color:v,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:y?"none":"background-color 0.2s, border-color 0.2s",...C,...M},children:T})]})}function pr({completed:t,orientation:r,connectorStyle:n,connectorWidth:i,primary:o,border:l,reducedMotion:c}){const d=t?o:l;return r==="horizontal"?e.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:c?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):e.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:c?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function xn({steps:t,activeStep:r=0,orientation:n="horizontal",variant:i="default",size:o="md",clickable:l=!1,onStepClick:c,showStepNumbers:d=!0,alternateLabel:u=!1,connector:x="solid",className:f,style:m}){const p=B.useTheme(),h=s.useReducedMotion(),y=ni[o],k=(g,w)=>g.status?g.status:w<r?"completed":w===r?"active":"pending",b=n==="horizontal";return e.jsx("div",{className:f,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:b?"row":"column",alignItems:b?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:t.map((g,w)=>{const j=k(g,w),S=w===t.length-1,z=j==="completed"||w<r,v=w%2===0,N=()=>{l&&(c==null||c(w))},C=e.jsx(ii,{status:j,index:w,showStepNumbers:d,icon:g.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:l}),M=e.jsxs("div",{style:{textAlign:b&&!u?"center":"left",maxWidth:b?120:void 0},children:[e.jsxs("div",{style:{fontSize:y.titleSize,fontWeight:j==="active"?600:500,color:j==="pending"?p.textMuted:j==="error"?p.danger:p.text,lineHeight:1.3,transition:h?"none":"color 0.2s"},children:[s.sanitizeString(g.title),g.optional&&e.jsx("span",{style:{fontSize:y.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),g.description&&e.jsx("div",{style:{fontSize:y.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:s.sanitizeString(g.description)}),g.error&&j==="error"&&e.jsx("div",{style:{fontSize:y.descSize,color:p.danger,marginTop:2},children:s.sanitizeString(g.error)})]});return b?e.jsxs("div",{role:"listitem",style:{display:"flex",flex:S?0:1,alignItems:"center",minWidth:0},children:[e.jsxs("div",{onClick:N,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:l?"pointer":"default",flexShrink:0},"aria-current":j==="active"?"step":void 0,children:[u&&!v&&e.jsx("div",{style:{minHeight:y.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:M}),C,!u&&M,u&&v&&e.jsx("div",{style:{marginTop:6},children:M})]}),!S&&e.jsx(pr,{completed:z,orientation:"horizontal",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]},g.id):e.jsxs("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[e.jsx("div",{onClick:N,style:{cursor:l?"pointer":"default"},"aria-current":j==="active"?"step":void 0,children:C}),!S&&e.jsx(pr,{completed:z,orientation:"vertical",connectorStyle:x,connectorWidth:y.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]}),e.jsx("div",{style:{paddingTop:(y.circle-parseFloat(y.titleSize)*16)/2,paddingBottom:S?0:16,flex:1,minWidth:0},children:M})]},g.id)})})}xn.displayName="TkxStepper";function pn(t){let r=0,n=0,i=0;const o=t.replace("#","");o.length===3?(r=parseInt(o[0]+o[0],16),n=parseInt(o[1]+o[1],16),i=parseInt(o[2]+o[2],16)):o.length>=6&&(r=parseInt(o.slice(0,2),16),n=parseInt(o.slice(2,4),16),i=parseInt(o.slice(4,6),16)),r/=255,n/=255,i/=255;const l=Math.max(r,n,i),c=Math.min(r,n,i);let d=0,u=0;const x=(l+c)/2;if(l!==c){const f=l-c;switch(u=x>.5?f/(2-l-c):f/(l+c),l){case r:d=((n-i)/f+(n<i?6:0))/6;break;case n:d=((i-r)/f+2)/6;break;case i:d=((r-n)/f+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(x*100)]}function Ht(t,r,n){r/=100,n/=100;const i=r*Math.min(n,1-n),o=l=>{const c=(l+t/30)%12,d=n-i*Math.max(Math.min(c-3,9-c,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}function St(t){const r=t.replace("#",""),n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(i)?0:i,isNaN(o)?0:o]}function Rt(t,r,n){return`#${t.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function ot(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(t)}function Lt(t,r,n){if(n==="hex")return r<1?`${t}${Math.round(r*255).toString(16).padStart(2,"0")}`:t;const[i,o,l]=St(t);if(n==="rgb")return r<1?`rgba(${i}, ${o}, ${l}, ${r.toFixed(2)})`:`rgb(${i}, ${o}, ${l})`;const[c,d,u]=pn(t);return n==="hsl"?r<1?`hsla(${c}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${c}, ${d}%, ${u}%)`:t}const ai=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function li({hue:t,sat:r,bright:n,onChange:i}){const o=a.useRef(null),l=a.useRef(!1),c=a.useCallback(x=>{const f=o.current;if(!f)return;const m=f.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]);a.useEffect(()=>{const x=m=>{l.current&&c(m)},f=()=>{l.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",f)}},[c]);const d=`${r}%`,u=`${100-n}%`;return e.jsxs("div",{ref:o,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${t}, 100%, 50%)`,flexShrink:0},onMouseDown:x=>{l.current=!0,c(x)},children:[e.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),e.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),e.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:Ht(t,r,n/2+25)}})]})}function ci({hue:t,onChange:r}){const n=a.useRef(null),i=a.useRef(!1),o=a.useCallback(l=>{const c=n.current;if(!c)return;const d=c.getBoundingClientRect(),u=Math.max(0,Math.min(1,(l.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return a.useEffect(()=>{const l=d=>{i.current&&o(d)},c=()=>{i.current=!1};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c)}},[o]),e.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:l=>{i.current=!0,o(l)},children:e.jsx("div",{style:{position:"absolute",left:`${t/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(${t}, 100%, 50%)`,pointerEvents:"none"}})})}function di({alpha:t,hex:r,onChange:n}){const i=a.useRef(null),o=a.useRef(!1),l=a.useCallback(x=>{const f=i.current;if(!f)return;const m=f.getBoundingClientRect(),p=Math.max(0,Math.min(1,(x.clientX-m.left)/m.width));n(Math.round(p*100)/100)},[n]);a.useEffect(()=>{const x=m=>{o.current&&l(m)},f=()=>{o.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",f),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",f)}},[l]);const[c,d,u]=St(r);return e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),e.jsx("div",{ref:i,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${c},${d},${u},0), rgba(${c},${d},${u},1))`},onMouseDown:x=>{o.current=!0,l(x)},children:e.jsx("div",{style:{position:"absolute",left:`${t*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(${c},${d},${u},${t})`,pointerEvents:"none"}})})]})}function ui({value:t,defaultValue:r="#3b82f6",onChange:n,format:i="hex",showAlpha:o=!1,presets:l=ai,disabled:c=!1,size:d="md",placeholder:u,label:x,style:f}){const m=B.useTheme(),p=a.useRef(null),h=a.useRef(null),[y,k]=a.useState(!1),b=t!==void 0,[g,w]=a.useState(b&&t||r),j=b?t||r:g,[S,z]=a.useState(1),[v,N]=a.useState(j),[C,M]=a.useState({top:0,left:0}),[T,E,$]=pn(ot(j)?j:r),F=a.useCallback((U,se=S)=>{ot(U)&&(N(U),b||w(U),n==null||n(Lt(U,se,i),i))},[S,b,i,n]);a.useEffect(()=>{b&&t&&ot(t)&&N(t)},[b,t]);const I=()=>{if(c)return;const U=p.current;if(!U)return;const se=U.getBoundingClientRect(),we=window.innerHeight-se.bottom>320?se.bottom+6:se.top-326;M({top:we+window.scrollY,left:se.left+window.scrollX}),k(!0)};a.useEffect(()=>{if(!y)return;const U=se=>{h.current&&!h.current.contains(se.target)&&p.current&&!p.current.contains(se.target)&&k(!1)};return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[y]),a.useEffect(()=>{if(!y)return;const U=se=>{se.key==="Escape"&&k(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[y]);const W=(U,se)=>{const he=se/100,we=U/100,ce=he*(1-we/2),me=ce===0||ce===1?0:(he-ce)/Math.min(ce,1-ce),re=Ht(T,Math.round(me*100),Math.round(ce*100));F(re)},L=U=>{const se=Ht(U,E,$);F(se)},Y=U=>{z(U),n==null||n(Lt(j,U,i),i)},D=U=>{const se=U.target.value;N(se),ot(se)&&F(se)},V=(U,se)=>{const he=Math.max(0,Math.min(255,parseInt(se)||0)),[we,ce,me]=St(j),re=U==="r"?Rt(he,ce,me):U==="g"?Rt(we,he,me):Rt(we,ce,he);F(re)},P={sm:28,md:34,lg:40}[d],[A,O,G]=St(ot(j)?j:r),ee={display:"inline-flex",alignItems:"center",gap:"8px",height:`${P}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...f},oe={width:`${P-8}px`,height:`${P-8}px`,borderRadius:"4px",backgroundColor:`rgba(${A},${O},${G},${S})`,border:`1px solid ${m.border}`,flexShrink:0},ae={position:"absolute",top:C.top,left:C.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"},fe={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},de={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"},ge=U=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:U,border:U.toLowerCase()===j.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return e.jsxs(e.Fragment,{children:[x&&e.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:x}),e.jsxs("button",{ref:p,type:"button",style:ee,onClick:I,disabled:c,"aria-label":`Color picker, current color ${j}`,"aria-haspopup":"dialog","aria-expanded":y,children:[e.jsx("div",{style:oe}),e.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Lt(ot(j)?j:r,S,i)})]}),y&&Le.createPortal(e.jsxs("div",{ref:h,style:ae,role:"dialog","aria-label":"Color picker",children:[e.jsx(li,{hue:T,sat:E,bright:$,onChange:W}),e.jsx(ci,{hue:T,onChange:L}),o&&e.jsx(di,{alpha:S,hex:ot(j)?j:r,onChange:Y}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${A},${O},${G},${S})`,border:`1px solid ${m.border}`}}),e.jsx("input",{style:fe,value:v,onChange:D,maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),e.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(U=>{const se=U==="r"?A:U==="g"?O:G;return e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[e.jsx("input",{style:de,type:"number",min:0,max:255,value:se,onChange:he=>V(U,he.target.value),"aria-label":`${U.toUpperCase()} channel`}),e.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:U})]},U)}),o&&e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[e.jsx("input",{style:de,type:"number",min:0,max:100,value:Math.round(S*100),onChange:U=>Y(Math.max(0,Math.min(1,parseInt(U.target.value)/100||0))),"aria-label":"Alpha channel"}),e.jsx("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),l.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:l.map(U=>e.jsx("button",{type:"button",style:ge(U),onClick:()=>F(U),"aria-label":`Select color ${U}`,onMouseEnter:se=>{se.currentTarget.style.transform="scale(1.15)"},onMouseLeave:se=>{se.currentTarget.style.transform="scale(1)"}},U))})]})]}),document.body)]})}const fi={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 hr(t,r,n){let i=t;return r!==void 0&&(i=Math.max(i,r)),n!==void 0&&(i=Math.min(i,n)),i}function Dt(t,r){if(r===void 0)return t;const n=Math.pow(10,r);return Math.round(t*n)/n}function xi(t,r,n,i,o){const l=i??"en-US";return r==="currency"?new Intl.NumberFormat(l,{style:"currency",currency:n??"USD",minimumFractionDigits:o??2,maximumFractionDigits:o??2}).format(t):r==="percent"?new Intl.NumberFormat(l,{style:"percent",minimumFractionDigits:o??0,maximumFractionDigits:o??0}).format(t/100):r==="decimal"||o!==void 0?new Intl.NumberFormat(l,{minimumFractionDigits:o??0,maximumFractionDigits:o??20}).format(t):String(t)}function mr({direction:t,isDisabled:r,btnW:n,height:i,primaryColor:o,borderColor:l,textMuted:c,iconSz:d,onStep:u}){const x=a.useRef(null),f=a.useRef(null),m=t==="inc"?1:-1,p=a.useCallback(()=>{u(m),x.current=setTimeout(()=>{f.current=setInterval(()=>u(m),60)},400)},[m,u]),h=a.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),f.current&&(clearInterval(f.current),f.current=null)},[]);a.useEffect(()=>()=>h(),[h]);const y=t==="inc";return e.jsx("button",{type:"button","aria-label":y?"Increment":"Decrement",disabled:r,onMouseDown:p,onMouseUp:h,onMouseLeave:h,onTouchStart:k=>{k.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 ${l}`,borderLeft:y?`1px solid ${l}`:void 0,cursor:r?"not-allowed":"pointer",color:r?c:o,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:k=>{r||(k.currentTarget.style.background=`${o}12`)},onBlur:k=>{k.currentTarget.style.background="transparent"},children:y?e.jsxs("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):e.jsx("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function hn({value:t,defaultValue:r=0,onChange:n,min:i,max:o,step:l=1,precision:c,prefix:d,suffix:u,format:x,currency:f,locale:m,clampOnBlur:p=!0,allowMouseWheel:h=!1,size:y="md",label:k,hint:b,isDisabled:g=!1,isReadOnly:w=!1,isInvalid:j=!1,errorMessage:S,id:z,className:v,style:N}){const C=B.useTheme(),M=a.useId(),T=z??M,E=`${T}-hint`,$=`${T}-error`,F=t!==void 0,[I,W]=a.useState(r),L=F?t:I,[Y,D]=a.useState(!1),[V,R]=a.useState(""),P=fi[y],A=j||!!S,O=A?C.danger:Y?C.primary:C.border,G=[b&&E,A&&$].filter(Boolean).join(" ")||void 0,ee=k?s.sanitizeString(k):void 0,oe=b?s.sanitizeString(b):void 0,ae=S?s.sanitizeString(S):void 0,fe=d?s.sanitizeString(d):void 0,de=u?s.sanitizeString(u):void 0,ge=a.useCallback(J=>{const X=Dt(J,c);F||W(X),n==null||n(X)},[F,n,c]),U=a.useCallback(J=>{if(g||w)return;const X=hr(Dt(L+J*l,c),i,o);ge(X)},[g,w,L,l,c,i,o,ge]),se=()=>{D(!0),R(String(L))},he=()=>{D(!1);const J=parseFloat(V);if(isNaN(J)){n==null||n(null),R(String(L));return}let X=Dt(J,c);p&&(X=hr(X,i,o)),ge(X)},we=J=>{R(J.target.value)},ce=J=>{J.key==="ArrowUp"&&(J.preventDefault(),U(1)),J.key==="ArrowDown"&&(J.preventDefault(),U(-1))},me=J=>{!h||!Y||(J.preventDefault(),U(J.deltaY<0?1:-1))},re=Y?V:xi(L,x,f,m,c),le=(fe||de)&&!Y;return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-1 w-full"),v),style:N,children:[ee&&e.jsx("label",{htmlFor:T,className:s.tkx("text-sm font-medium font-sans"),style:{color:C.text},children:ee}),e.jsxs("div",{className:s.tkx("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${O}`,backgroundColor:g?C.surfaceAlt:C.surface,opacity:g?.65:1,height:P.height},children:[e.jsx(mr,{direction:"dec",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:P.iconSz,onStep:U}),e.jsxs("div",{className:s.tkx("relative flex-1 flex items-center overflow-hidden"),children:[le&&fe&&e.jsx("span",{style:{position:"absolute",left:P.px,fontSize:P.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:fe}),e.jsx("input",{id:T,type:"text",inputMode:"decimal",value:Y?V:re,readOnly:w,disabled:g,"aria-invalid":A,"aria-describedby":G,"aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":L,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:P.fontSize,fontFamily:"inherit",color:C.text,paddingLeft:le&&fe?`calc(${P.px} + 1.2em)`:P.px,paddingRight:le&&de?`calc(${P.px} + 1.2em)`:P.px,cursor:g?"not-allowed":w?"default":"text"},onFocus:se,onBlur:he,onChange:we,onKeyDown:ce,onWheel:me}),le&&de&&e.jsx("span",{style:{position:"absolute",right:P.px,fontSize:P.fontSize,color:C.textMuted,pointerEvents:"none",userSelect:"none"},children:de})]}),e.jsx(mr,{direction:"inc",isDisabled:g||w,btnW:P.btnW,height:P.height,primaryColor:C.primary,borderColor:C.border,textMuted:C.textMuted,iconSz:P.iconSz,onStep:U})]}),oe&&!ae&&e.jsx("span",{id:E,className:s.tkx("text-xs"),style:{color:C.textMuted},children:oe}),ae&&e.jsxs("span",{id:$,role:"alert",className:s.tkx("text-xs flex items-center gap-1"),style:{color:C.danger},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})}),ae]})]})}hn.displayName="TkxNumberInput";const pi={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},hi={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function gr(t,r){return hi[r].test(t)?t.toUpperCase():""}function mn({length:t=6,value:r,onChange:n,onComplete:i,type:o="number",mask:l=!1,autoFocus:c=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:x,hint:f,size:m="md",separator:p,separatorPosition:h,className:y,style:k}){const b=B.useTheme(),g=a.useId(),w=`${g}-hint`,j=`${g}-error`,S=r!==void 0,z=A=>{const O=A.split("").slice(0,t);for(;O.length<t;)O.push("");return O},[v,N]=a.useState(()=>z(S?r:"")),C=S?z(r):v,M=a.useRef([]),T=pi[m],E=u||!!x,$=C.every(A=>A!==""),F=f?s.sanitizeString(f):void 0,I=x?s.sanitizeString(x):void 0,W=A=>E?b.danger:$?b.success:b.border;a.useEffect(()=>{var A;c&&((A=M.current[0])==null||A.focus())},[]);const L=a.useCallback(A=>{S||N(A);const O=A.join("");n==null||n(O),A.every(G=>G!=="")&&(i==null||i(O))},[S,n,i]),Y=A=>{var G;const O=Math.max(0,Math.min(t-1,A));(G=M.current[O])==null||G.focus()},D=A=>O=>{if(!d){if(O.key==="Backspace"){if(O.preventDefault(),C[A]!==""){const G=[...C];G[A]="",L(G)}else if(A>0){const G=[...C];G[A-1]="",L(G),Y(A-1)}return}if(O.key==="Delete"){O.preventDefault();const G=[...C];G[A]="",L(G);return}if(O.key==="ArrowLeft"){O.preventDefault(),Y(A-1);return}if(O.key==="ArrowRight"){O.preventDefault(),Y(A+1);return}if(O.key==="Home"){O.preventDefault(),Y(0);return}if(O.key==="End"){O.preventDefault(),Y(t-1);return}}},V=A=>O=>{if(d)return;const ee=O.target.value.slice(-1);if(!ee)return;const oe=gr(ee,o);if(!oe)return;const ae=[...C];ae[A]=oe,L(ae),A<t-1&&Y(A+1)},R=A=>O=>{if(O.preventDefault(),d)return;const ee=O.clipboardData.getData("text").split("").map(fe=>gr(fe,o)).filter(Boolean);if(!ee.length)return;const oe=[...C];let ae=A;for(const fe of ee){if(ae>=t)break;oe[ae]=fe,ae++}L(oe),Y(Math.min(ae,t-1))},P=[F&&w,E&&j].filter(Boolean).join(" ")||void 0;return e.jsxs("div",{className:s.cx(s.tkx("flex flex-col gap-2 w-fit"),y),style:k,children:[e.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":P,className:s.tkx("flex items-center"),style:{gap:T.gap},children:Array.from({length:t},(A,O)=>{const G=W();return typeof document<"u"&&(document.activeElement,M.current[O]),e.jsxs("div",{className:s.tkx("flex items-center"),style:{gap:T.gap},children:[p&&h===O&&O!==0&&e.jsx("span",{"aria-hidden":"true",style:{color:b.textMuted,userSelect:"none",flexShrink:0},children:p}),e.jsx("input",{ref:ee=>{M.current[O]=ee},type:l?"password":"text",inputMode:o==="number"?"numeric":"text",maxLength:1,value:C[O],disabled:d,"aria-label":`Digit ${O+1} of ${t}`,autoComplete:"one-time-code",spellCheck:!1,onChange:V(O),onKeyDown:D(O),onPaste:R(O),onFocus:ee=>ee.target.select(),style:{width:T.box,height:T.box,textAlign:"center",fontSize:T.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${G}`,borderRadius:"8px",backgroundColor:d?b.surfaceAlt:b.surface,color:b.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:ee=>{d||(ee.currentTarget.style.borderColor=E?b.danger:b.primary,ee.currentTarget.style.boxShadow=`0 0 0 3px ${E?b.danger:b.primary}33`)},onBlurCapture:ee=>{ee.currentTarget.style.borderColor=W(),ee.currentTarget.style.boxShadow="none"}})]},O)})}),F&&!I&&e.jsx("span",{id:w,className:s.tkx("text-xs"),style:{color:b.textMuted},children:F}),I&&e.jsxs("span",{id:j,role:"alert",className:s.tkx("text-xs flex items-center gap-1"),style:{color:b.danger},children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})}),I]})]})}mn.displayName="TkxOTP";function mi(t,r){a.useEffect(()=>{if(!r)return;const n=i=>{i.key==="Escape"&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t,r])}function gi(t){const r=a.useRef(null);return a.useEffect(()=>{if(!t||!r.current)return;const n=r.current,i=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),o=i[0],l=i[i.length-1],c=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===o&&(d.preventDefault(),l==null||l.focus()):document.activeElement===l&&(d.preventDefault(),o==null||o.focus()))};return n.addEventListener("keydown",c),()=>n.removeEventListener("keydown",c)},[t]),r}function bi(){const[t,r]=a.useState(!1),n=a.useCallback(()=>r(!0),[]),i=a.useCallback(()=>r(!1),[]),o=a.useCallback(()=>r(l=>!l),[]);return{isOpen:t,open:n,close:i,toggle:o}}function At(t,r){if(!t)return{matched:!0,ranges:[],score:0};const n=t.toLowerCase(),i=r.toLowerCase(),o=i.indexOf(n);if(o!==-1)return{matched:!0,ranges:[[o,o+n.length-1]],score:o===0?100:80};const l=[];let c=0,d=-1,u=-1;for(let x=0;x<i.length&&c<n.length;x++)i[x]===n[c]&&((u===-1||x!==u+1)&&(d!==-1&&l.push([d,u]),d=x),u=x,c++);return d!==-1&&u!==-1&&l.push([d,u]),c<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:l,score:40}}function yi(t,r){if(!t.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 o=At(t,i.label),l=i.description?At(t,i.description):{matched:!1,score:0},c=(i.keywords??[]).some(d=>At(t,d).matched);o.matched?n.push({item:i,score:o.score+20,labelRanges:o.ranges}):l.matched?n.push({item:i,score:l.score,labelRanges:[]}):c&&n.push({item:i,score:20,labelRanges:[]})}return n.sort((i,o)=>o.score-i.score)}function ki({text:t,ranges:r,color:n}){if(!r.length)return e.jsx(e.Fragment,{children:t});const i=[];let o=0;for(const[l,c]of r)o<l&&i.push(e.jsx("span",{children:t.slice(o,l)},`t-${o}`)),i.push(e.jsx("span",{style:{color:n,fontWeight:700},children:t.slice(l,c+1)},`h-${l}`)),o=c+1;return o<t.length&&i.push(e.jsx("span",{children:t.slice(o)},"t-end")),e.jsx(e.Fragment,{children:i})}function vi({surface:t,border:r}){return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[e.jsx("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${r} 25%, ${t} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[e.jsx("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${r} 25%, ${t} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),e.jsx("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${r} 25%, ${t} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function gn({items:t,isOpen:r=!1,onClose:n,placeholder:i="Type a command or search…",emptyMessage:o,maxItems:l=8,onItemSelect:c,className:d,style:u}){const x=B.useTheme(),[f,m]=a.useState(""),[p,h]=a.useState(0),[y,k]=a.useState(!1),b=a.useRef(null),g=a.useRef(null),w=a.useId(),j=gi(r),S=yi(f,t).slice(0,l),z=[];for(const $ of S){const F=$.item.group,I=z.find(W=>W.group===F);I?I.items.push($):z.push({group:F,items:[$]})}const v=z.flatMap($=>$.items);mi(()=>{n==null||n()},r),a.useEffect(()=>{r&&(m(""),h(0),setTimeout(()=>{var $;return($=b.current)==null?void 0:$.focus()},30))},[r]),a.useEffect(()=>{p>=v.length&&h(Math.max(0,v.length-1))},[v.length,p]);const N=a.useCallback($=>{const F=g.current;if(!F)return;const I=F.querySelectorAll("[data-command-item]")[$];I==null||I.scrollIntoView({block:"nearest"})},[]),C=$=>{if($.key==="ArrowDown"){$.preventDefault();const F=Math.min(v.length-1,p+1);h(F),N(F)}else if($.key==="ArrowUp"){$.preventDefault();const F=Math.max(0,p-1);h(F),N(F)}else if($.key==="Enter"){$.preventDefault();const F=v[p];F&&M(F.item)}},M=$=>{var F;$.disabled||((F=$.onSelect)==null||F.call($),c==null||c($),n==null||n())};if(!r||typeof document>"u")return null;const T=s.sanitizeString(i),E=o?s.sanitizeString(o):`No results for "${s.sanitizeString(f)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const $=document.createElement("style");$.id="tkx-shimmer-style",$.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild($)}return Le.createPortal(e.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:[e.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"}}),e.jsxs("div",{ref:j,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:w,className:s.cx(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:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${x.border}`},children:[e.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:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:b,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${w}-list`,"aria-activedescendant":v[p]?`${w}-item-${v[p].item.id}`:void 0,value:f,onChange:$=>{m($.target.value),h(0)},onKeyDown:C,placeholder:T,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:x.text}}),f&&e.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var $;m(""),h(0),($=b.current)==null||$.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:x.textMuted,display:"flex",alignItems:"center",padding:0},children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("div",{id:`${w}-list`,ref:g,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},($,F)=>e.jsx(vi,{surface:x.surface,border:x.border},F)):v.length===0?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:x.textMuted},children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),e.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),e.jsx("span",{style:{fontSize:"0.875rem"},children:E})]}):z.map(({group:$,items:F},I)=>{const W=z.slice(0,I).reduce((L,Y)=>L+Y.items.length,0);return e.jsxs("div",{children:[$&&e.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:x.textMuted,padding:"10px 12px 4px"},children:s.sanitizeString($)}),F.map((L,Y)=>{const D=W+Y,V=D===p,R=L.item;return e.jsxs("div",{id:`${w}-item-${R.id}`,role:"option","aria-selected":V,"aria-disabled":R.disabled,"data-command-item":!0,onClick:()=>M(R),onMouseEnter:()=>h(D),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:R.disabled?"not-allowed":"pointer",opacity:R.disabled?.45:1,backgroundColor:V?`${x.primary}18`:"transparent",borderLeft:V?`2px solid ${x.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[R.icon&&e.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:V?x.primary:x.textMuted},children:R.icon}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:x.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.jsx(ki,{text:R.label,ranges:L.labelRanges,color:x.primary})}),R.description&&e.jsx("div",{style:{fontSize:"0.75rem",color:x.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.sanitizeString(R.description)})]}),R.shortcut&&e.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:s.sanitizeString(R.shortcut)})]},R.id)})]},$??"__default__")})}),v.length>0&&e.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:[e.jsxs("span",{children:[e.jsx("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}gn.displayName="TkxCommand";function wt({direction:t,onClick:r,isDisabled:n,primaryColor:i,position:o,orientation:l}){const c=l==="vertical",d=t==="prev",u=o==="inside"?{position:"absolute",zIndex:3,...c?{[d?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[d?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return e.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:c?d?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}):d?e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})})}function bn({slides:t,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:i=!0,loop:o=!0,showArrows:l=!0,showDots:c=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:x=1,gap:f=0,transitionDuration:m=400,swipeable:p=!0,initialIndex:h=0,onChange:y,arrowPosition:k="inside",height:b=320,className:g,style:w}){const j=B.useTheme(),S=s.useReducedMotion(),z=a.useId(),v=t.length,[N,C]=a.useState(h),[M,T]=a.useState(o?h+1:h),[E,$]=a.useState(!1),[F,I]=a.useState(!1),W=a.useRef(null),L=a.useRef(null),Y=a.useRef(null),D=a.useRef(0),V=a.useRef(!1),R=u==="vertical",P=S?0:m,A=o&&v>1?[t[v-1],...t,t[0]]:t,O=A.length,G=100/x,ee=(X,ne=0)=>{const xe=ne!==0?` - ${ne}px`:"";return R?`translateY(calc(-${X*G}%${xe}))`:`translateX(calc(-${X*G}%${xe}))`},oe=a.useCallback((X,ne=!1)=>{const xe=o?(X%v+v)%v:Math.max(0,Math.min(v-1,X)),ke=o?xe+1:xe;ne&&W.current?(W.current.style.transition="none",T(ke),C(xe),W.current.offsetHeight,W.current.style.transition=""):($(!0),T(ke),C(xe)),y==null||y(xe)},[v,o,y]),ae=a.useCallback(()=>oe(N-1),[N,oe]),fe=a.useCallback(()=>oe(N+1),[N,oe]),de=a.useCallback(()=>{$(!1),!(!o||v<=1)&&(M===0?oe(v-1,!0):M===O-1&&oe(0,!0))},[o,v,M,O,oe]);a.useEffect(()=>{if(!(!r||F||v<=1))return L.current=setInterval(fe,n),()=>{L.current&&clearInterval(L.current)}},[r,F,n,fe,v]),a.useEffect(()=>{const X=ne=>{const xe=document.activeElement,ke=document.getElementById(z);ke!=null&&ke.contains(xe)&&(ne.key===(R?"ArrowUp":"ArrowLeft")&&(ne.preventDefault(),ae()),ne.key===(R?"ArrowDown":"ArrowRight")&&(ne.preventDefault(),fe()))};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[z,R,ae,fe]);const ge=X=>"touches"in X?R?X.touches[0].clientY:X.touches[0].clientX:R?X.clientY:X.clientX,U=X=>{p&&(Y.current=ge(X),D.current=0,V.current=!0)},se=X=>{if(!V.current||Y.current===null)return;const ne=ge(X)-Y.current;D.current=ne,W.current&&(W.current.style.transition="none",W.current.style.transform=ee(M,-ne))},he=()=>{if(!V.current)return;V.current=!1;const X=D.current,ne=50;W.current&&(W.current.style.transition="",W.current.style.transform=""),X<-ne?fe():X>ne?ae():W.current&&(W.current.style.transform=ee(M)),Y.current=null,D.current=0},we=typeof b=="number"?`${b}px`:b,ce={display:"flex",flexDirection:R?"column":"row",width:R?"100%":`${O/x*100}%`,height:R?`${O/x*100}%`:"100%",transform:ee(M),transition:E||!S?`transform ${P}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:f>0?f:void 0},me={flexShrink:0,width:R?"100%":`${G/(O/x)}%`,height:R?`${G/(O/x)}%`:"100%",overflow:"hidden",position:"relative"},re=o||N>0,le=o||N<v-1,J=k==="outside";return e.jsxs("div",{id:z,className:s.cx(s.tkx("flex flex-col gap-2"),g),style:w,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[e.jsxs("div",{className:s.tkx("flex items-center gap-2"),style:{gap:J&&l?8:0},children:[l&&J&&e.jsx(wt,{direction:"prev",onClick:ae,isDisabled:!re,primaryColor:j.primary,position:"outside",orientation:u}),e.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:we,borderRadius:12,cursor:p?V.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>i&&I(!0),onMouseLeave:()=>{I(!1),he()},onTouchStart:U,onTouchMove:se,onTouchEnd:he,onMouseDown:U,onMouseMove:se,onMouseUp:he,"aria-live":"polite","aria-atomic":"false",children:[l&&!J&&e.jsxs(e.Fragment,{children:[e.jsx(wt,{direction:"prev",onClick:ae,isDisabled:!re,primaryColor:j.primary,position:"inside",orientation:u}),e.jsx(wt,{direction:"next",onClick:fe,isDisabled:!le,primaryColor:j.primary,position:"inside",orientation:u})]}),e.jsx("div",{ref:W,style:ce,onTransitionEnd:de,children:A.map((X,ne)=>e.jsx("div",{style:me,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(ne-(o?1:0)+v)%v+1} of ${v}`,"aria-hidden":(ne-(o?1:0)+v)%v!==N,children:X.content},`${X.id}-${ne}`))}),c&&!d&&e.jsx("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:t.map((X,ne)=>e.jsx("button",{type:"button","aria-label":`Go to slide ${ne+1}`,"aria-current":ne===N?"true":void 0,onClick:()=>oe(ne),style:{width:ne===N?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:ne===N?j.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:xe=>{xe.currentTarget.style.boxShadow=`0 0 0 3px ${j.primary}66`},onBlur:xe=>{xe.currentTarget.style.boxShadow="none"}},X.id))})]}),l&&J&&e.jsx(wt,{direction:"next",onClick:fe,isDisabled:!le,primaryColor:j.primary,position:"outside",orientation:u})]}),d&&e.jsx("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:t.map((X,ne)=>e.jsxs("button",{type:"button",role:"tab","aria-selected":ne===N,"aria-label":`Thumbnail for slide ${ne+1}`,onClick:()=>oe(ne),style:{flexShrink:0,width:60,height:42,border:`2px solid ${ne===N?j.primary:j.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:j.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:xe=>{xe.currentTarget.style.boxShadow=`0 0 0 3px ${j.primary}55`},onBlur:xe=>{xe.currentTarget.style.boxShadow="none"},children:[X.thumbnail?e.jsx("img",{src:X.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:j.textMuted,fontWeight:600},children:ne+1}),ne===N&&e.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${j.primary}22`}})]},X.id))})]})}bn.displayName="TkxCarousel";function wi({color:t}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:e.jsx("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ji({onClick:t,bgColor:r,hoverColor:n,textColor:i}){const o=l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t())};return e.jsx("button",{type:"button",onClick:t,onKeyDown:o,"aria-label":"Show hidden breadcrumb items",className:s.tkx("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:r,color:i,transition:"background-color 150ms ease"},onMouseEnter:l=>{l.currentTarget.style.backgroundColor=n},onMouseLeave:l=>{l.currentTarget.style.backgroundColor=r},children:"…"})}function Si({items:t,separator:r,maxItems:n,onNavigate:i,className:o,style:l}){const c=B.useTheme(),d=s.useReducedMotion(),u=n!==void 0&&n>1&&t.length>n,f=a.useCallback(()=>{if(!u||!n)return t.map((N,C)=>({item:N,originalIndex:C}));const j=Math.ceil((n-1)/2),S=n-1-j,z=t.slice(0,j).map((N,C)=>({item:N,originalIndex:C})),v=t.slice(t.length-S).map((N,C)=>({item:N,originalIndex:t.length-S+C}));return z.concat(v)},[t,n,u])(),m=u&&n?Math.ceil((n-1)/2):-1,p=(j,S)=>{i==null||i(j,S)},h=(j,S,z)=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),p(S,z))},y=d?{}:{transition:"color 150ms ease, background-color 150ms ease"},k=j=>e.jsx("li",{role:"presentation","aria-hidden":"true",className:s.tkx("flex items-center mx-1.5"),children:r??e.jsx(wi,{color:c.textMuted})},j),b=(j,S,z)=>{const v=s.sanitizeString(j.label);if(z)return e.jsx("li",{children:e.jsxs("span",{"aria-current":"page",className:s.tkx("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:c.text},children:[j.icon&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("flex-shrink-0"),children:j.icon}),v]})},`item-${S}`);const N=!!j.href,C={color:c.textMuted,textDecoration:"none",...y},M={onMouseEnter:E=>{E.currentTarget.style.color=c.primary},onMouseLeave:E=>{E.currentTarget.style.color=c.textMuted}},T=e.jsxs(e.Fragment,{children:[j.icon&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("flex-shrink-0"),children:j.icon}),v]});return N?e.jsx("li",{children:e.jsx("a",{href:j.href,onClick:E=>{i&&(E.preventDefault(),p(j,S))},className:s.tkx("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...C,focusRingColor:c.primary},...M,children:T})},`item-${S}`):e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>p(j,S),onKeyDown:E=>h(E,j,S),className:s.tkx("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:C,...M,children:T})},`item-${S}`)},g=[];let w=!1;for(let j=0;j<f.length;j++){const{item:S,originalIndex:z}=f[j],v=z===t.length-1;u&&!w&&j===m&&(g.length>0&&g.push(k("sep-ellipsis-before")),g.push(e.jsx("li",{role:"presentation",children:e.jsx(ji,{onClick:()=>{},bgColor:c.surfaceAlt,hoverColor:c.surface,textColor:c.textMuted})},"ellipsis")),w=!0),g.length>0&&g[g.length-1]!==null&&g.push(k(`sep-${z}`)),g.push(b(S,z,v))}return e.jsx("nav",{"aria-label":"Breadcrumb",className:s.tkx("font-sans",o??""),style:{...l},children:e.jsx("ol",{role:"list",className:s.tkx("flex items-center flex-wrap list-none m-0 p-0"),children:g})})}const Fe=8,rt=8;function Ci(t,r,n){const i=r.getBoundingClientRect(),o=window.scrollX,l=window.scrollY,c=window.innerWidth,d=window.innerHeight;let u=0,x=0,f=n;const m={top:t.top-i.height-rt-Fe>0,bottom:t.bottom+i.height+rt+Fe<d,left:t.left-i.width-rt-Fe>0,right:t.right+i.width+rt+Fe<c};if(!m[n]){const h={top:"bottom",bottom:"top",left:"right",right:"left"};m[h[n]]&&(f=h[n])}switch(f){case"top":u=t.top+l-i.height-rt-Fe,x=t.left+o+t.width/2-i.width/2;break;case"bottom":u=t.bottom+l+rt+Fe,x=t.left+o+t.width/2-i.width/2;break;case"left":u=t.top+l+t.height/2-i.height/2,x=t.left+o-i.width-rt-Fe;break;case"right":u=t.top+l+t.height/2-i.height/2,x=t.right+o+rt+Fe;break}x=Math.max(8,Math.min(x,c+o-i.width-8)),u=Math.max(8,Math.min(u,d+l-i.height-8));const p={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:Fe};switch(f){case"top":Object.assign(p,{bottom:-Fe*2,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(p,{top:-Fe*2,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(p,{right:-Fe*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(p,{left:-Fe*2,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"});break}return{top:u,left:x,arrowStyle:p,resolvedPlacement:f}}function Ti({trigger:t,content:r,placement:n="bottom",isOpen:i,onOpenChange:o,closeOnClickOutside:l=!0,className:c,style:d}){const u=B.useTheme(),x=s.useReducedMotion(),f=a.useId(),m=i!==void 0,[p,h]=a.useState(!1),y=m?i:p,k=a.useRef(null),b=a.useRef(null);a.useRef(null);const[g,w]=a.useState(null),j=a.useCallback(C=>{m||h(C),o==null||o(C)},[m,o]),S=a.useCallback(()=>j(!1),[j]),z=a.useCallback(()=>j(!y),[j,y]);s.useEscapeKey(S,y),a.useEffect(()=>{if(!y||!l)return;const C=M=>{var E,$;const T=M.target;(E=k.current)!=null&&E.contains(T)||($=b.current)!=null&&$.contains(T)||S()};return document.addEventListener("pointerdown",C),()=>document.removeEventListener("pointerdown",C)},[y,l,S]),a.useEffect(()=>{if(!y||!k.current)return;const C=()=>{if(!k.current||!b.current)return;const M=k.current.getBoundingClientRect();w(Ci(M,b.current,n))};return requestAnimationFrame(C),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[y,n]);const v=x?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},N=y&&typeof document<"u"?Le.createPortal(e.jsxs("div",{ref:b,id:f,role:"dialog","aria-modal":"false",className:s.tkx("absolute z-[9100] rounded-lg font-sans",c??""),style:{"--tkx-popover-bg":u.surface,top:(g==null?void 0:g.top)??-9999,left:(g==null?void 0:g.left)??-9999,backgroundColor:u.surface,border:`1px solid ${u.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:u.text,...v,...d},children:[g&&e.jsx("span",{style:g.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:k,className:s.tkx("inline-flex"),onClick:z,onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),z())},"aria-expanded":y,"aria-haspopup":"dialog","aria-controls":y?f:void 0,children:t}),N,y&&!x&&e.jsx("style",{children:`
71
68
  @keyframes tkxPopoverFadeIn {
72
69
  from { opacity: 0; transform: translateY(4px); }
73
70
  to { opacity: 1; transform: translateY(0); }
74
71
  }
75
- `})]})}function xl(e,r){if(!r)return!0;const n=r.toLowerCase(),o=e.label.toLowerCase();let i=0;for(let l=0;l<o.length&&i<n.length;l++)o[l]===n[i]&&i++;return i===n.length}function hl(e,r){const n=e.getBoundingClientRect(),o=4,i=window.innerHeight-n.bottom,l=n.top,c=i>=r+o||i>=l?"below":"above";return{top:c==="below"?n.bottom+window.scrollY+o:n.top+window.scrollY-r-o,left:n.left+window.scrollX,width:n.width,placement:c}}function sn({color:e}){return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[t.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),t.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}const an=280;function ml({options:e,value:r,onChange:n,onInputChange:o,placeholder:i="",label:l,isLoading:c=!1,emptyMessage:d="No results found",filterFn:u,freeSolo:f=!1,className:s,style:m}){const p=U(),x=te(),y=a.useId(),v=a.useId(),b=a.useRef(null),g=a.useRef(null),[w,S]=a.useState(""),[M,N]=a.useState(!1),[j,L]=a.useState(-1),[I,T]=a.useState(null);a.useEffect(()=>{if(r!==void 0){const B=e.find(P=>P.value===r);S(B?B.label:r)}},[r,e]);const $=u??xl,z=a.useMemo(()=>M?e.filter(B=>$(B,w)):[],[e,w,M,$]),E=R(l),C=R(d);a.useEffect(()=>{if(!M||!g.current)return;const B=()=>{g.current&&T(hl(g.current,an))};return B(),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B)}},[M]),a.useEffect(()=>{if(!M)return;const B=P=>{var Q;const F=P.target;if((Q=g.current)!=null&&Q.contains(F))return;const V=document.getElementById(v);V!=null&&V.contains(F)||N(!1)};return document.addEventListener("pointerdown",B),()=>document.removeEventListener("pointerdown",B)},[M,v]),lt(()=>N(!1),M);const k=a.useCallback(B=>{var P;B.disabled||(S(B.label),n==null||n(B.value),N(!1),L(-1),(P=b.current)==null||P.focus())},[n]),A=B=>{const P=B.target.value;S(P),o==null||o(P),M||N(!0),L(-1),f&&(n==null||n(P))},D=B=>{if(!M&&(B.key==="ArrowDown"||B.key==="ArrowUp")){N(!0);return}switch(B.key){case"ArrowDown":{B.preventDefault(),L(P=>{let F=P+1;for(;F<z.length&&z[F].disabled;)F++;return F<z.length?F:P});break}case"ArrowUp":{B.preventDefault(),L(P=>{let F=P-1;for(;F>=0&&z[F].disabled;)F--;return F>=0?F:P});break}case"Enter":{B.preventDefault(),j>=0&&j<z.length?k(z[j]):f&&w&&(n==null||n(w),N(!1));break}case"Escape":{N(!1),L(-1);break}}};a.useEffect(()=>{var P;if(j<0)return;const B=`${v}-opt-${j}`;(P=document.getElementById(B))==null||P.scrollIntoView({block:"nearest"})},[j,v]);const O=j>=0?`${v}-opt-${j}`:void 0,W=x?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},H=M&&typeof document<"u"&&I?Ne.createPortal(t.jsx("ul",{id:v,role:"listbox","aria-label":E,className:h("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:I.top,left:I.left,width:I.width,maxHeight:an,backgroundColor:p.surface,border:`1px solid ${p.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...W},children:c?t.jsxs("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:h("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:p.textMuted},children:[t.jsx(sn,{color:p.primary}),"Loading..."]}):z.length===0?t.jsx("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:h("px-3 py-2 text-sm text-center"),style:{color:p.textMuted},children:C}):z.map((B,P)=>{const F=P===j,V=R(B.label),Q=B.description?R(B.description):null;return t.jsxs("li",{id:`${v}-opt-${P}`,role:"option","aria-selected":B.value===r,"aria-disabled":B.disabled||void 0,className:h("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",B.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:F?p.surfaceAlt:"transparent",color:B.disabled?p.textMuted:p.text,transition:x?"none":"background-color 100ms ease"},onMouseEnter:()=>!B.disabled&&L(P),onMouseDown:re=>{re.preventDefault(),k(B)},children:[B.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:B.icon}),t.jsxs("span",{className:h("flex flex-col min-w-0"),children:[t.jsx("span",{className:h("truncate"),children:V}),Q&&t.jsx("span",{className:h("text-xs truncate"),style:{color:p.textMuted},children:Q})]}),B.value===r&&t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:h("ml-auto flex-shrink-0"),children:t.jsx("path",{d:"M3 8l3.5 3.5L13 5",stroke:p.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},B.value)})}),document.body):null;return t.jsxs("div",{ref:g,className:h("relative font-sans",s??""),style:m,children:[t.jsx("label",{htmlFor:y,className:h("block text-sm font-medium mb-1.5"),style:{color:p.text},children:E}),t.jsxs("div",{className:h("relative flex items-center"),style:{backgroundColor:p.surface,border:`1px solid ${M?p.primary:p.border}`,borderRadius:8,transition:x?"none":"border-color 150ms ease"},children:[t.jsx("input",{ref:b,id:y,type:"text",role:"combobox","aria-expanded":M,"aria-controls":v,"aria-activedescendant":O,"aria-autocomplete":"list","aria-label":E,value:w,placeholder:i,onChange:A,onFocus:()=>N(!0),onKeyDown:D,className:h("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:p.text}}),c&&t.jsx("span",{className:h("pr-3"),children:t.jsx(sn,{color:p.primary})})]}),H,M&&!x&&t.jsx("style",{children:`
72
+ `})]})}function Mi(t,r){if(!r)return!0;const n=r.toLowerCase(),i=t.label.toLowerCase();let o=0;for(let l=0;l<i.length&&o<n.length;l++)i[l]===n[o]&&o++;return o===n.length}function $i(t,r){const n=t.getBoundingClientRect(),i=4,o=window.innerHeight-n.bottom,l=n.top,c=o>=r+i||o>=l?"below":"above";return{top:c==="below"?n.bottom+window.scrollY+i:n.top+window.scrollY-r-i,left:n.left+window.scrollX,width:n.width,placement:c}}function br({color:t}){return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:t,strokeWidth:"2",opacity:"0.3"}),e.jsx("path",{d:"M14 8a6 6 0 00-6-6",stroke:t,strokeWidth:"2",strokeLinecap:"round"})]})}const yr=280;function zi({options:t,value:r,onChange:n,onInputChange:i,placeholder:o="",label:l,isLoading:c=!1,emptyMessage:d="No results found",filterFn:u,freeSolo:x=!1,className:f,style:m}){const p=B.useTheme(),h=s.useReducedMotion(),y=a.useId(),k=a.useId(),b=a.useRef(null),g=a.useRef(null),[w,j]=a.useState(""),[S,z]=a.useState(!1),[v,N]=a.useState(-1),[C,M]=a.useState(null);a.useEffect(()=>{if(r!==void 0){const R=t.find(P=>P.value===r);j(R?R.label:r)}},[r,t]);const T=u??Mi,E=a.useMemo(()=>S?t.filter(R=>T(R,w)):[],[t,w,S,T]),$=s.sanitizeString(l),F=s.sanitizeString(d);a.useEffect(()=>{if(!S||!g.current)return;const R=()=>{g.current&&M($i(g.current,yr))};return R(),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R),()=>{window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[S]),a.useEffect(()=>{if(!S)return;const R=P=>{var G;const A=P.target;if((G=g.current)!=null&&G.contains(A))return;const O=document.getElementById(k);O!=null&&O.contains(A)||z(!1)};return document.addEventListener("pointerdown",R),()=>document.removeEventListener("pointerdown",R)},[S,k]),s.useEscapeKey(()=>z(!1),S);const I=a.useCallback(R=>{var P;R.disabled||(j(R.label),n==null||n(R.value),z(!1),N(-1),(P=b.current)==null||P.focus())},[n]),W=R=>{const P=R.target.value;j(P),i==null||i(P),S||z(!0),N(-1),x&&(n==null||n(P))},L=R=>{if(!S&&(R.key==="ArrowDown"||R.key==="ArrowUp")){z(!0);return}switch(R.key){case"ArrowDown":{R.preventDefault(),N(P=>{let A=P+1;for(;A<E.length&&E[A].disabled;)A++;return A<E.length?A:P});break}case"ArrowUp":{R.preventDefault(),N(P=>{let A=P-1;for(;A>=0&&E[A].disabled;)A--;return A>=0?A:P});break}case"Enter":{R.preventDefault(),v>=0&&v<E.length?I(E[v]):x&&w&&(n==null||n(w),z(!1));break}case"Escape":{z(!1),N(-1);break}}};a.useEffect(()=>{var P;if(v<0)return;const R=`${k}-opt-${v}`;(P=document.getElementById(R))==null||P.scrollIntoView({block:"nearest"})},[v,k]);const Y=v>=0?`${k}-opt-${v}`:void 0,D=h?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},V=S&&typeof document<"u"&&C?Le.createPortal(e.jsx("ul",{id:k,role:"listbox","aria-label":$,className:s.tkx("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:C.top,left:C.left,width:C.width,maxHeight:yr,backgroundColor:p.surface,border:`1px solid ${p.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...D},children:c?e.jsxs("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:s.tkx("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:p.textMuted},children:[e.jsx(br,{color:p.primary}),"Loading..."]}):E.length===0?e.jsx("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:s.tkx("px-3 py-2 text-sm text-center"),style:{color:p.textMuted},children:F}):E.map((R,P)=>{const A=P===v,O=s.sanitizeString(R.label),G=R.description?s.sanitizeString(R.description):null;return e.jsxs("li",{id:`${k}-opt-${P}`,role:"option","aria-selected":R.value===r,"aria-disabled":R.disabled||void 0,className:s.tkx("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",R.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:A?p.surfaceAlt:"transparent",color:R.disabled?p.textMuted:p.text,transition:h?"none":"background-color 100ms ease"},onMouseEnter:()=>!R.disabled&&N(P),onMouseDown:ee=>{ee.preventDefault(),I(R)},children:[R.icon&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("flex-shrink-0"),children:R.icon}),e.jsxs("span",{className:s.tkx("flex flex-col min-w-0"),children:[e.jsx("span",{className:s.tkx("truncate"),children:O}),G&&e.jsx("span",{className:s.tkx("text-xs truncate"),style:{color:p.textMuted},children:G})]}),R.value===r&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:s.tkx("ml-auto flex-shrink-0"),children:e.jsx("path",{d:"M3 8l3.5 3.5L13 5",stroke:p.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},R.value)})}),document.body):null;return e.jsxs("div",{ref:g,className:s.tkx("relative font-sans",f??""),style:m,children:[e.jsx("label",{htmlFor:y,className:s.tkx("block text-sm font-medium mb-1.5"),style:{color:p.text},children:$}),e.jsxs("div",{className:s.tkx("relative flex items-center"),style:{backgroundColor:p.surface,border:`1px solid ${S?p.primary:p.border}`,borderRadius:8,transition:h?"none":"border-color 150ms ease"},children:[e.jsx("input",{ref:b,id:y,type:"text",role:"combobox","aria-expanded":S,"aria-controls":k,"aria-activedescendant":Y,"aria-autocomplete":"list","aria-label":$,value:w,placeholder:o,onChange:W,onFocus:()=>z(!0),onKeyDown:L,className:s.tkx("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:p.text}}),c&&e.jsx("span",{className:s.tkx("pr-3"),children:e.jsx(br,{color:p.primary})})]}),V,S&&!h&&e.jsx("style",{children:`
76
73
  @keyframes tkxAutoFadeIn {
77
74
  from { opacity: 0; transform: translateY(4px); }
78
75
  to { opacity: 1; transform: translateY(0); }
79
76
  }
80
- `})]})}function gl(e,r){const n=[];function o(i,l){var c;for(const d of i)n.push({node:d,depth:l}),(c=d.children)!=null&&c.length&&r.has(d.id)&&o(d.children,l+1)}return o(e,0),n}function bl({expanded:e,color:r,reducedMotion:n}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yl({checked:e,color:r,borderColor:n}){return t.jsx("span",{role:"presentation","aria-hidden":"true",className:h("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?r:n}`,backgroundColor:e?r:"transparent",transition:"all 100ms ease"},children:e&&t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}const ln=24;function vl({data:e,selected:r,onSelect:n,expanded:o,onExpand:i,multiSelect:l=!1,showCheckboxes:c=!1,showLines:d=!1,className:u,style:f}){const s=U(),m=te();a.useId();const[p,x]=a.useState([]),[y,v]=a.useState([]),b=new Set(r??p),g=new Set(o??y),w=a.useCallback(z=>{o===void 0&&v(z),i==null||i(z)},[o,i]),S=a.useCallback(z=>{r===void 0&&x(z),n==null||n(z)},[r,n]),M=a.useCallback(z=>{const E=Array.from(g);g.has(z)?w(E.filter(C=>C!==z)):w([...E,z])},[g,w]),N=a.useCallback(z=>{if(l){const E=Array.from(b);b.has(z)?S(E.filter(C=>C!==z)):S([...E,z])}else S(b.has(z)?[]:[z])},[l,b,S]),j=gl(e,g),L=a.useRef(0),I=a.useRef(new Map),T=z=>{var E;L.current=z,(E=I.current.get(z))==null||E.focus()},$=(z,E)=>{var D;const C=j[E];if(!C)return;const{node:k}=C,A=(((D=k.children)==null?void 0:D.length)??0)>0;switch(z.key){case"ArrowDown":{z.preventDefault(),E<j.length-1&&T(E+1);break}case"ArrowUp":{z.preventDefault(),E>0&&T(E-1);break}case"ArrowRight":{z.preventDefault(),A&&!g.has(k.id)?M(k.id):A&&g.has(k.id)&&E<j.length-1&&T(E+1);break}case"ArrowLeft":{if(z.preventDefault(),A&&g.has(k.id))M(k.id);else for(let O=E-1;O>=0;O--)if(j[O].depth<C.depth){T(O);break}break}case"Enter":case" ":{z.preventDefault(),k.disabled||N(k.id);break}case"Home":{z.preventDefault(),T(0);break}case"End":{z.preventDefault(),T(j.length-1);break}}};return t.jsx("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":l||void 0,className:h("list-none m-0 p-0 font-sans select-none",u??""),style:{color:s.text,...f},children:j.map(({node:z,depth:E},C)=>{var W;const k=(((W=z.children)==null?void 0:W.length)??0)>0,A=g.has(z.id),D=b.has(z.id),O=R(z.label);return t.jsxs("li",{role:"treeitem","aria-selected":D,"aria-expanded":k?A:void 0,"aria-disabled":z.disabled||void 0,"aria-level":E+1,"aria-setsize":j.filter(H=>H.depth===E).length,tabIndex:C===0?0:-1,ref:H=>{H?I.current.set(C,H):I.current.delete(C)},onKeyDown:H=>$(H,C),onClick:()=>{z.disabled||(k&&M(z.id),N(z.id))},className:h("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",z.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:E*ln+8,backgroundColor:D?`${s.primary}18`:"transparent",transition:m?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:H=>{!D&&!z.disabled&&(H.currentTarget.style.backgroundColor=s.surfaceAlt)},onMouseLeave:H=>{H.currentTarget.style.backgroundColor=D?`${s.primary}18`:"transparent"},children:[d&&E>0&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:(E-1)*ln+16,top:0,bottom:0,width:1,backgroundColor:s.border}}),k?t.jsx("span",{role:"presentation",onClick:H=>{H.stopPropagation(),M(z.id)},className:h("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:t.jsx(bl,{expanded:A,color:s.textMuted,reducedMotion:m})}):t.jsx("span",{style:{width:20,height:20},"aria-hidden":"true"}),c&&t.jsx(yl,{checked:D,color:s.primary,borderColor:s.border}),z.icon&&t.jsx("span",{"aria-hidden":"true",className:h("flex-shrink-0"),children:z.icon}),t.jsx("span",{className:h("text-sm truncate"),style:{color:z.disabled?s.textMuted:s.text},children:O})]},z.id)})})}const kl={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function wl({items:e,orientation:r="horizontal",size:n="md",variant:o="default",ariaLabel:i="Toolbar",className:l,style:c}){const d=U(),u=te(),f=kl[n],s=r==="horizontal",m=a.useRef(new Map),p=e.filter(g=>g.type!=="separator"&&!g.disabled).map(g=>g.id),x=a.useCallback(g=>{var w;(w=m.current.get(g))==null||w.focus()},[]),y=a.useCallback((g,w)=>{const S=p.indexOf(w);if(S<0)return;const M=s?"ArrowRight":"ArrowDown",N=s?"ArrowLeft":"ArrowUp";switch(g.key){case M:{g.preventDefault();const j=S+1<p.length?S+1:0;x(p[j]);break}case N:{g.preventDefault();const j=S-1>=0?S-1:p.length-1;x(p[j]);break}case"Home":{g.preventDefault(),x(p[0]);break}case"End":{g.preventDefault(),x(p[p.length-1]);break}}},[p,x,s]),v=()=>{switch(o){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${d.border}`};case"filled":return{backgroundColor:d.surfaceAlt,border:"none"};default:return{backgroundColor:d.surface,border:`1px solid ${d.border}`}}},b=g=>{g.type;const w=g.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${f.buttonPy}px ${f.buttonPx}px`,fontSize:f.fontSize,borderRadius:6,border:"none",cursor:g.disabled?"not-allowed":"pointer",backgroundColor:w?`${d.primary}20`:"transparent",color:w?d.primary:g.disabled?d.textMuted:d.text,opacity:g.disabled?.5:1,outline:"none",transition:u?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return t.jsx("div",{role:"toolbar","aria-label":i,"aria-orientation":r,className:h("inline-flex items-center rounded-lg font-sans",s?"flex-row":"flex-col",l??""),style:{...v(),padding:f.gap,gap:f.gap,...c},children:e.map((g,w)=>{if(g.type==="separator")return t.jsx("div",{role:"separator","aria-orientation":s?"vertical":"horizontal",className:h("flex-shrink-0"),style:{...s?{width:1,height:f.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:f.separatorSize,marginTop:2,marginBottom:2},backgroundColor:d.border}},g.id);const S=R(g.label),M=!g.disabled,N=p[0]===g.id;return t.jsxs("button",{ref:j=>{j?m.current.set(g.id,j):m.current.delete(g.id)},type:"button",role:(g.type==="toggle",void 0),"aria-pressed":g.type==="toggle"?g.active:void 0,"aria-label":S,"aria-disabled":g.disabled||void 0,tabIndex:M&&N?0:-1,disabled:g.disabled,onClick:()=>{var j;g.disabled||(j=g.onClick)==null||j.call(g)},onKeyDown:j=>{var L;y(j,g.id),(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),g.disabled||(L=g.onClick)==null||L.call(g))},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:b(g),onMouseEnter:j=>{!g.disabled&&!g.active&&(j.currentTarget.style.backgroundColor=d.surfaceAlt)},onMouseLeave:j=>{g.disabled||(j.currentTarget.style.backgroundColor=g.active?`${d.primary}20`:"transparent")},children:[g.icon&&t.jsx("span",{"aria-hidden":"true",style:{width:f.iconSize,height:f.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:g.icon}),!g.icon&&S]},g.id)})})}function jl({color:e}){return t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),t.jsx("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function cn({checked:e,primaryColor:r,borderColor:n}){return t.jsx("span",{"aria-hidden":"true",className:h("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?r:n}`,backgroundColor:e?r:"transparent",transition:"all 100ms ease"},children:e&&t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:t.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Sl({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function $l({color:e}){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dn({title:e,items:r,selected:n,onToggle:o,onToggleAll:i,search:l,onSearchChange:c,searchable:d,height:u,listId:f}){const s=U(),m=te(),p=R(e),x=a.useMemo(()=>{if(!l)return r;const g=l.toLowerCase();return r.filter(w=>w.label.toLowerCase().includes(g))},[r,l]),y=x.filter(g=>!g.disabled),v=y.length>0&&y.every(g=>n.has(g.value));y.some(g=>n.has(g.value));const b=(g,w)=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),o(w))};return t.jsxs("div",{className:h("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${s.border}`,backgroundColor:s.surface},children:[t.jsxs("div",{className:h("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:s.border,backgroundColor:s.surfaceAlt},children:[t.jsx("button",{type:"button","aria-label":v?`Deselect all ${p}`:`Select all ${p}`,onClick:i,className:h("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:t.jsx(cn,{checked:v,primaryColor:s.primary,borderColor:s.border})}),t.jsx("span",{className:h("text-sm font-medium flex-1 truncate"),style:{color:s.text},children:p}),t.jsxs("span",{className:h("text-xs"),style:{color:s.textMuted},children:[n.size,"/",r.length]})]}),d&&t.jsxs("div",{className:h("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:s.border},children:[t.jsx(jl,{color:s.textMuted}),t.jsx("input",{type:"text","aria-label":`Search ${p}`,value:l,onChange:g=>c(g.target.value),placeholder:"Search...",className:h("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:s.text}})]}),t.jsx("ul",{id:f,role:"listbox","aria-label":p,"aria-multiselectable":"true",className:h("list-none m-0 p-1 overflow-y-auto"),style:{height:u,minHeight:100},children:x.length===0?t.jsx("li",{className:h("text-xs text-center py-4"),style:{color:s.textMuted},"aria-disabled":"true",children:"No items"}):x.map(g=>{const w=n.has(g.value),S=R(g.label);return t.jsxs("li",{role:"option","aria-selected":w,"aria-disabled":g.disabled||void 0,tabIndex:0,onClick:()=>!g.disabled&&o(g.value),onKeyDown:M=>!g.disabled&&b(M,g.value),className:h("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",g.disabled?"opacity-50 cursor-not-allowed":""),style:{color:g.disabled?s.textMuted:s.text,backgroundColor:w?`${s.primary}10`:"transparent",transition:m?"none":"background-color 100ms ease"},onMouseEnter:M=>{!g.disabled&&!w&&(M.currentTarget.style.backgroundColor=s.surfaceAlt)},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=w?`${s.primary}10`:"transparent"},children:[t.jsx(cn,{checked:w,primaryColor:s.primary,borderColor:s.border}),t.jsx("span",{className:h("truncate"),children:S})]},g.value)})})]})}function Ml({sourceItems:e,targetItems:r,onTransfer:n,sourceTitle:o="Available",targetTitle:i="Selected",searchable:l=!1,height:c=300,className:d,style:u}){const f=U(),s=te(),m=a.useId(),p=a.useId(),[x,y]=a.useState(new Set),[v,b]=a.useState(new Set),[g,w]=a.useState(""),[S,M]=a.useState(""),N=a.useCallback(E=>{y(C=>{const k=new Set(C);return k.has(E)?k.delete(E):k.add(E),k})},[]),j=a.useCallback(E=>{b(C=>{const k=new Set(C);return k.has(E)?k.delete(E):k.add(E),k})},[]),L=a.useCallback(()=>{const E=e.filter(k=>!k.disabled).map(k=>k.value),C=E.every(k=>x.has(k));y(C?new Set:new Set(E))},[e,x]),I=a.useCallback(()=>{const E=r.filter(k=>!k.disabled).map(k=>k.value),C=E.every(k=>v.has(k));b(C?new Set:new Set(E))},[r,v]),T=a.useCallback(()=>{if(x.size===0)return;const E=e.filter(A=>x.has(A.value)&&!A.disabled),C=e.filter(A=>!x.has(A.value)||A.disabled),k=[...r,...E];n(C,k),y(new Set)},[e,r,x,n]),$=a.useCallback(()=>{if(v.size===0)return;const E=r.filter(A=>v.has(A.value)&&!A.disabled),C=r.filter(A=>!v.has(A.value)||A.disabled),k=[...e,...E];n(k,C),b(new Set)},[e,r,v,n]),z=E=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${f.border}`,backgroundColor:E?f.surface:f.surfaceAlt,cursor:E?"not-allowed":"pointer",opacity:E?.5:1,transition:s?"none":"all 100ms ease",outline:"none"});return t.jsxs("div",{className:h("flex gap-3 font-sans","flex-col sm:flex-row",d??""),style:{color:f.text,...u},children:[t.jsx(dn,{title:o,items:e,selected:x,onToggle:N,onToggleAll:L,search:g,onSearchChange:w,searchable:l,height:c,listId:m}),t.jsxs("div",{className:h("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[t.jsx("button",{type:"button","aria-label":"Move selected items to target list",disabled:x.size===0,onClick:T,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),T())},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:z(x.size===0),onMouseEnter:E=>{x.size>0&&(E.currentTarget.style.backgroundColor=f.primary,E.currentTarget.style.borderColor=f.primary)},onMouseLeave:E=>{E.currentTarget.style.backgroundColor=x.size===0?f.surface:f.surfaceAlt,E.currentTarget.style.borderColor=f.border},children:t.jsx(Sl,{color:f.text})}),t.jsx("button",{type:"button","aria-label":"Move selected items to source list",disabled:v.size===0,onClick:$,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),$())},className:h("focus-visible:ring-2 focus-visible:ring-offset-1"),style:z(v.size===0),onMouseEnter:E=>{v.size>0&&(E.currentTarget.style.backgroundColor=f.primary,E.currentTarget.style.borderColor=f.primary)},onMouseLeave:E=>{E.currentTarget.style.backgroundColor=v.size===0?f.surface:f.surfaceAlt,E.currentTarget.style.borderColor=f.border},children:t.jsx($l,{color:f.text})})]}),t.jsx(dn,{title:i,items:r,selected:v,onToggle:j,onToggleAll:I,search:S,onSearchChange:M,searchable:l,height:c,listId:p})]})}function Cl({color:e,rotated:r,reducedMotion:n}){return t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:r?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:t.jsx("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}const Tl={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function El(e,r,n){const o=(r+1)*n;switch(e){case"up":return{bottom:o,left:"50%",transform:"translateX(-50%)"};case"down":return{top:o,left:"50%",transform:"translateX(-50%)"};case"left":return{right:o,top:"50%",transform:"translateY(-50%)"};case"right":return{left:o,top:"50%",transform:"translateY(-50%)"}}}function Il(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10};case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}const un=56,fn=48,Nl=64;function zl({actions:e,icon:r,direction:n="up",position:o="bottom-right",className:i,style:l}){const c=U(),d=te(),u=a.useId(),[f,s]=a.useState(!1),[m,p]=a.useState(-1),x=a.useRef(null),y=a.useRef(new Map),v=a.useCallback(()=>{s(M=>!M),p(-1)},[]),b=a.useCallback(()=>{s(!1),p(-1)},[]);lt(b,f),a.useEffect(()=>{if(!f)return;const M=N=>{var j;(j=x.current)!=null&&j.contains(N.target)||b()};return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[f,b]),a.useEffect(()=>{var M;m>=0&&((M=y.current.get(m))==null||M.focus())},[m]);const g=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),v()),f&&((M.key==="ArrowUp"||M.key==="ArrowLeft")&&(M.preventDefault(),p(0)),(M.key==="ArrowDown"||M.key==="ArrowRight")&&(M.preventDefault(),p(0)))},w=(M,N)=>{var j,L;switch(M.key){case"ArrowUp":case"ArrowLeft":{M.preventDefault(),p(N>0?N-1:e.length-1);break}case"ArrowDown":case"ArrowRight":{M.preventDefault(),p(N<e.length-1?N+1:0);break}case"Enter":case" ":{M.preventDefault(),(L=(j=e[N]).onClick)==null||L.call(j),b();break}case"Escape":{b();break}case"Home":{M.preventDefault(),p(0);break}case"End":{M.preventDefault(),p(e.length-1);break}}},S=M=>d?"0ms":`${M*40}ms`;return t.jsxs(t.Fragment,{children:[f&&typeof document<"u"&&Ne.createPortal(t.jsx("div",{"aria-hidden":"true",onClick:b,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:d?"none":"opacity 200ms ease"}}),document.body),t.jsxs("div",{ref:x,className:h("fixed z-[9100] font-sans",i??""),style:{...Tl[o],...l},children:[f&&e.map((M,N)=>{const j=R(M.label),L=El(n,N,Nl),I=Il(n);return t.jsx("div",{className:h("absolute"),style:{...L,opacity:d?1:0,animation:d?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:S(N)},children:t.jsxs("div",{className:h("relative inline-flex"),children:[t.jsx("span",{className:h("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...I,backgroundColor:c.surfaceAlt,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:j}),t.jsx("button",{ref:T=>{T?y.current.set(N,T):y.current.delete(N)},type:"button","aria-label":j,tabIndex:f?0:-1,onClick:()=>{var T;(T=M.onClick)==null||T.call(M),b()},onKeyDown:T=>w(T,N),className:h("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:fn,height:fn,backgroundColor:c.surface,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:d?"none":"all 150ms ease"},onMouseEnter:T=>{T.currentTarget.style.backgroundColor=c.surfaceAlt,T.currentTarget.style.transform="scale(1.1)"},onMouseLeave:T=>{T.currentTarget.style.backgroundColor=c.surface,T.currentTarget.style.transform="scale(1)"},children:M.icon})]})},M.id)}),t.jsx("button",{type:"button","aria-label":f?"Close actions menu":"Open actions menu","aria-expanded":f,"aria-controls":u,"aria-haspopup":"true",onClick:v,onKeyDown:g,className:h("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:un,height:un,backgroundColor:c.primary,color:c.bg,boxShadow:`0 6px 20px ${c.primary}40`,transition:d?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:M=>{M.currentTarget.style.boxShadow=`0 8px 28px ${c.primary}60`,d||(M.currentTarget.style.transform="scale(1.05)")},onMouseLeave:M=>{M.currentTarget.style.boxShadow=`0 6px 20px ${c.primary}40`,M.currentTarget.style.transform="scale(1)"},children:r??t.jsx(Cl,{color:c.bg,rotated:f,reducedMotion:d})}),t.jsx("div",{id:u,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(M=>t.jsx("div",{role:"menuitem",children:R(M.label)},M.id))})]}),f&&!d&&t.jsx("style",{children:`
77
+ `})]})}function Ii(t,r){const n=[];function i(o,l){var c;for(const d of o)n.push({node:d,depth:l}),(c=d.children)!=null&&c.length&&r.has(d.id)&&i(d.children,l+1)}return i(t,0),n}function Ei({expanded:t,color:r,reducedMotion:n}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:e.jsx("path",{d:"M6 3l5 5-5 5",stroke:r,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ni({checked:t,color:r,borderColor:n}){return e.jsx("span",{role:"presentation","aria-hidden":"true",className:s.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${t?r:n}`,backgroundColor:t?r:"transparent",transition:"all 100ms ease"},children:t&&e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}const kr=24;function Ri({data:t,selected:r,onSelect:n,expanded:i,onExpand:o,multiSelect:l=!1,showCheckboxes:c=!1,showLines:d=!1,className:u,style:x}){const f=B.useTheme(),m=s.useReducedMotion();a.useId();const[p,h]=a.useState([]),[y,k]=a.useState([]),b=new Set(r??p),g=new Set(i??y),w=a.useCallback(E=>{i===void 0&&k(E),o==null||o(E)},[i,o]),j=a.useCallback(E=>{r===void 0&&h(E),n==null||n(E)},[r,n]),S=a.useCallback(E=>{const $=Array.from(g);g.has(E)?w($.filter(F=>F!==E)):w([...$,E])},[g,w]),z=a.useCallback(E=>{if(l){const $=Array.from(b);b.has(E)?j($.filter(F=>F!==E)):j([...$,E])}else j(b.has(E)?[]:[E])},[l,b,j]),v=Ii(t,g),N=a.useRef(0),C=a.useRef(new Map),M=E=>{var $;N.current=E,($=C.current.get(E))==null||$.focus()},T=(E,$)=>{var L;const F=v[$];if(!F)return;const{node:I}=F,W=(((L=I.children)==null?void 0:L.length)??0)>0;switch(E.key){case"ArrowDown":{E.preventDefault(),$<v.length-1&&M($+1);break}case"ArrowUp":{E.preventDefault(),$>0&&M($-1);break}case"ArrowRight":{E.preventDefault(),W&&!g.has(I.id)?S(I.id):W&&g.has(I.id)&&$<v.length-1&&M($+1);break}case"ArrowLeft":{if(E.preventDefault(),W&&g.has(I.id))S(I.id);else for(let Y=$-1;Y>=0;Y--)if(v[Y].depth<F.depth){M(Y);break}break}case"Enter":case" ":{E.preventDefault(),I.disabled||z(I.id);break}case"Home":{E.preventDefault(),M(0);break}case"End":{E.preventDefault(),M(v.length-1);break}}};return e.jsx("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":l||void 0,className:s.tkx("list-none m-0 p-0 font-sans select-none",u??""),style:{color:f.text,...x},children:v.map(({node:E,depth:$},F)=>{var D;const I=(((D=E.children)==null?void 0:D.length)??0)>0,W=g.has(E.id),L=b.has(E.id),Y=s.sanitizeString(E.label);return e.jsxs("li",{role:"treeitem","aria-selected":L,"aria-expanded":I?W:void 0,"aria-disabled":E.disabled||void 0,"aria-level":$+1,"aria-setsize":v.filter(V=>V.depth===$).length,tabIndex:F===0?0:-1,ref:V=>{V?C.current.set(F,V):C.current.delete(F)},onKeyDown:V=>T(V,F),onClick:()=>{E.disabled||(I&&S(E.id),z(E.id))},className:s.tkx("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",E.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:$*kr+8,backgroundColor:L?`${f.primary}18`:"transparent",transition:m?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:V=>{!L&&!E.disabled&&(V.currentTarget.style.backgroundColor=f.surfaceAlt)},onMouseLeave:V=>{V.currentTarget.style.backgroundColor=L?`${f.primary}18`:"transparent"},children:[d&&$>0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:($-1)*kr+16,top:0,bottom:0,width:1,backgroundColor:f.border}}),I?e.jsx("span",{role:"presentation",onClick:V=>{V.stopPropagation(),S(E.id)},className:s.tkx("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:e.jsx(Ei,{expanded:W,color:f.textMuted,reducedMotion:m})}):e.jsx("span",{style:{width:20,height:20},"aria-hidden":"true"}),c&&e.jsx(Ni,{checked:L,color:f.primary,borderColor:f.border}),E.icon&&e.jsx("span",{"aria-hidden":"true",className:s.tkx("flex-shrink-0"),children:E.icon}),e.jsx("span",{className:s.tkx("text-sm truncate"),style:{color:E.disabled?f.textMuted:f.text},children:Y})]},E.id)})})}const Li={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function Di({items:t,orientation:r="horizontal",size:n="md",variant:i="default",ariaLabel:o="Toolbar",className:l,style:c}){const d=B.useTheme(),u=s.useReducedMotion(),x=Li[n],f=r==="horizontal",m=a.useRef(new Map),p=t.filter(g=>g.type!=="separator"&&!g.disabled).map(g=>g.id),h=a.useCallback(g=>{var w;(w=m.current.get(g))==null||w.focus()},[]),y=a.useCallback((g,w)=>{const j=p.indexOf(w);if(j<0)return;const S=f?"ArrowRight":"ArrowDown",z=f?"ArrowLeft":"ArrowUp";switch(g.key){case S:{g.preventDefault();const v=j+1<p.length?j+1:0;h(p[v]);break}case z:{g.preventDefault();const v=j-1>=0?j-1:p.length-1;h(p[v]);break}case"Home":{g.preventDefault(),h(p[0]);break}case"End":{g.preventDefault(),h(p[p.length-1]);break}}},[p,h,f]),k=()=>{switch(i){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${d.border}`};case"filled":return{backgroundColor:d.surfaceAlt,border:"none"};default:return{backgroundColor:d.surface,border:`1px solid ${d.border}`}}},b=g=>{g.type;const w=g.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${x.buttonPy}px ${x.buttonPx}px`,fontSize:x.fontSize,borderRadius:6,border:"none",cursor:g.disabled?"not-allowed":"pointer",backgroundColor:w?`${d.primary}20`:"transparent",color:w?d.primary:g.disabled?d.textMuted:d.text,opacity:g.disabled?.5:1,outline:"none",transition:u?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return e.jsx("div",{role:"toolbar","aria-label":o,"aria-orientation":r,className:s.tkx("inline-flex items-center rounded-lg font-sans",f?"flex-row":"flex-col",l??""),style:{...k(),padding:x.gap,gap:x.gap,...c},children:t.map((g,w)=>{if(g.type==="separator")return e.jsx("div",{role:"separator","aria-orientation":f?"vertical":"horizontal",className:s.tkx("flex-shrink-0"),style:{...f?{width:1,height:x.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:x.separatorSize,marginTop:2,marginBottom:2},backgroundColor:d.border}},g.id);const j=s.sanitizeString(g.label),S=!g.disabled,z=p[0]===g.id;return e.jsxs("button",{ref:v=>{v?m.current.set(g.id,v):m.current.delete(g.id)},type:"button",role:(g.type==="toggle",void 0),"aria-pressed":g.type==="toggle"?g.active:void 0,"aria-label":j,"aria-disabled":g.disabled||void 0,tabIndex:S&&z?0:-1,disabled:g.disabled,onClick:()=>{var v;g.disabled||(v=g.onClick)==null||v.call(g)},onKeyDown:v=>{var N;y(v,g.id),(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),g.disabled||(N=g.onClick)==null||N.call(g))},className:s.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:b(g),onMouseEnter:v=>{!g.disabled&&!g.active&&(v.currentTarget.style.backgroundColor=d.surfaceAlt)},onMouseLeave:v=>{g.disabled||(v.currentTarget.style.backgroundColor=g.active?`${d.primary}20`:"transparent")},children:[g.icon&&e.jsx("span",{"aria-hidden":"true",style:{width:x.iconSize,height:x.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:g.icon}),!g.icon&&j]},g.id)})})}function Ai({color:t}){return e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"6",cy:"6",r:"4.5",stroke:t,strokeWidth:"1.5"}),e.jsx("path",{d:"M9.5 9.5L13 13",stroke:t,strokeWidth:"1.5",strokeLinecap:"round"})]})}function vr({checked:t,primaryColor:r,borderColor:n}){return e.jsx("span",{"aria-hidden":"true",className:s.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${t?r:n}`,backgroundColor:t?r:"transparent",transition:"all 100ms ease"},children:t&&e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Pi({color:t}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bi({color:t}){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function wr({title:t,items:r,selected:n,onToggle:i,onToggleAll:o,search:l,onSearchChange:c,searchable:d,height:u,listId:x}){const f=B.useTheme(),m=s.useReducedMotion(),p=s.sanitizeString(t),h=a.useMemo(()=>{if(!l)return r;const g=l.toLowerCase();return r.filter(w=>w.label.toLowerCase().includes(g))},[r,l]),y=h.filter(g=>!g.disabled),k=y.length>0&&y.every(g=>n.has(g.value));y.some(g=>n.has(g.value));const b=(g,w)=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),i(w))};return e.jsxs("div",{className:s.tkx("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${f.border}`,backgroundColor:f.surface},children:[e.jsxs("div",{className:s.tkx("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:f.border,backgroundColor:f.surfaceAlt},children:[e.jsx("button",{type:"button","aria-label":k?`Deselect all ${p}`:`Select all ${p}`,onClick:o,className:s.tkx("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:e.jsx(vr,{checked:k,primaryColor:f.primary,borderColor:f.border})}),e.jsx("span",{className:s.tkx("text-sm font-medium flex-1 truncate"),style:{color:f.text},children:p}),e.jsxs("span",{className:s.tkx("text-xs"),style:{color:f.textMuted},children:[n.size,"/",r.length]})]}),d&&e.jsxs("div",{className:s.tkx("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:f.border},children:[e.jsx(Ai,{color:f.textMuted}),e.jsx("input",{type:"text","aria-label":`Search ${p}`,value:l,onChange:g=>c(g.target.value),placeholder:"Search...",className:s.tkx("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:f.text}})]}),e.jsx("ul",{id:x,role:"listbox","aria-label":p,"aria-multiselectable":"true",className:s.tkx("list-none m-0 p-1 overflow-y-auto"),style:{height:u,minHeight:100},children:h.length===0?e.jsx("li",{className:s.tkx("text-xs text-center py-4"),style:{color:f.textMuted},"aria-disabled":"true",children:"No items"}):h.map(g=>{const w=n.has(g.value),j=s.sanitizeString(g.label);return e.jsxs("li",{role:"option","aria-selected":w,"aria-disabled":g.disabled||void 0,tabIndex:0,onClick:()=>!g.disabled&&i(g.value),onKeyDown:S=>!g.disabled&&b(S,g.value),className:s.tkx("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",g.disabled?"opacity-50 cursor-not-allowed":""),style:{color:g.disabled?f.textMuted:f.text,backgroundColor:w?`${f.primary}10`:"transparent",transition:m?"none":"background-color 100ms ease"},onMouseEnter:S=>{!g.disabled&&!w&&(S.currentTarget.style.backgroundColor=f.surfaceAlt)},onMouseLeave:S=>{S.currentTarget.style.backgroundColor=w?`${f.primary}10`:"transparent"},children:[e.jsx(vr,{checked:w,primaryColor:f.primary,borderColor:f.border}),e.jsx("span",{className:s.tkx("truncate"),children:j})]},g.value)})})]})}function Fi({sourceItems:t,targetItems:r,onTransfer:n,sourceTitle:i="Available",targetTitle:o="Selected",searchable:l=!1,height:c=300,className:d,style:u}){const x=B.useTheme(),f=s.useReducedMotion(),m=a.useId(),p=a.useId(),[h,y]=a.useState(new Set),[k,b]=a.useState(new Set),[g,w]=a.useState(""),[j,S]=a.useState(""),z=a.useCallback($=>{y(F=>{const I=new Set(F);return I.has($)?I.delete($):I.add($),I})},[]),v=a.useCallback($=>{b(F=>{const I=new Set(F);return I.has($)?I.delete($):I.add($),I})},[]),N=a.useCallback(()=>{const $=t.filter(I=>!I.disabled).map(I=>I.value),F=$.every(I=>h.has(I));y(F?new Set:new Set($))},[t,h]),C=a.useCallback(()=>{const $=r.filter(I=>!I.disabled).map(I=>I.value),F=$.every(I=>k.has(I));b(F?new Set:new Set($))},[r,k]),M=a.useCallback(()=>{if(h.size===0)return;const $=t.filter(W=>h.has(W.value)&&!W.disabled),F=t.filter(W=>!h.has(W.value)||W.disabled),I=[...r,...$];n(F,I),y(new Set)},[t,r,h,n]),T=a.useCallback(()=>{if(k.size===0)return;const $=r.filter(W=>k.has(W.value)&&!W.disabled),F=r.filter(W=>!k.has(W.value)||W.disabled),I=[...t,...$];n(I,F),b(new Set)},[t,r,k,n]),E=$=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${x.border}`,backgroundColor:$?x.surface:x.surfaceAlt,cursor:$?"not-allowed":"pointer",opacity:$?.5:1,transition:f?"none":"all 100ms ease",outline:"none"});return e.jsxs("div",{className:s.tkx("flex gap-3 font-sans","flex-col sm:flex-row",d??""),style:{color:x.text,...u},children:[e.jsx(wr,{title:i,items:t,selected:h,onToggle:z,onToggleAll:N,search:g,onSearchChange:w,searchable:l,height:c,listId:m}),e.jsxs("div",{className:s.tkx("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[e.jsx("button",{type:"button","aria-label":"Move selected items to target list",disabled:h.size===0,onClick:M,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),M())},className:s.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:E(h.size===0),onMouseEnter:$=>{h.size>0&&($.currentTarget.style.backgroundColor=x.primary,$.currentTarget.style.borderColor=x.primary)},onMouseLeave:$=>{$.currentTarget.style.backgroundColor=h.size===0?x.surface:x.surfaceAlt,$.currentTarget.style.borderColor=x.border},children:e.jsx(Pi,{color:x.text})}),e.jsx("button",{type:"button","aria-label":"Move selected items to source list",disabled:k.size===0,onClick:T,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),T())},className:s.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:E(k.size===0),onMouseEnter:$=>{k.size>0&&($.currentTarget.style.backgroundColor=x.primary,$.currentTarget.style.borderColor=x.primary)},onMouseLeave:$=>{$.currentTarget.style.backgroundColor=k.size===0?x.surface:x.surfaceAlt,$.currentTarget.style.borderColor=x.border},children:e.jsx(Bi,{color:x.text})})]}),e.jsx(wr,{title:o,items:r,selected:k,onToggle:v,onToggleAll:C,search:j,onSearchChange:S,searchable:l,height:c,listId:p})]})}function Wi({color:t,rotated:r,reducedMotion:n}){return e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:r?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:e.jsx("path",{d:"M12 5v14M5 12h14",stroke:t,strokeWidth:"2.5",strokeLinecap:"round"})})}const Hi={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function Vi(t,r,n){const i=(r+1)*n;switch(t){case"up":return{bottom:i,left:"50%",transform:"translateX(-50%)"};case"down":return{top:i,left:"50%",transform:"translateX(-50%)"};case"left":return{right:i,top:"50%",transform:"translateY(-50%)"};case"right":return{left:i,top:"50%",transform:"translateY(-50%)"}}}function Oi(t){switch(t){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10};case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}const jr=56,Sr=48,_i=64;function Yi({actions:t,icon:r,direction:n="up",position:i="bottom-right",className:o,style:l}){const c=B.useTheme(),d=s.useReducedMotion(),u=a.useId(),[x,f]=a.useState(!1),[m,p]=a.useState(-1),h=a.useRef(null),y=a.useRef(new Map),k=a.useCallback(()=>{f(S=>!S),p(-1)},[]),b=a.useCallback(()=>{f(!1),p(-1)},[]);s.useEscapeKey(b,x),a.useEffect(()=>{if(!x)return;const S=z=>{var v;(v=h.current)!=null&&v.contains(z.target)||b()};return document.addEventListener("pointerdown",S),()=>document.removeEventListener("pointerdown",S)},[x,b]),a.useEffect(()=>{var S;m>=0&&((S=y.current.get(m))==null||S.focus())},[m]);const g=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),k()),x&&((S.key==="ArrowUp"||S.key==="ArrowLeft")&&(S.preventDefault(),p(0)),(S.key==="ArrowDown"||S.key==="ArrowRight")&&(S.preventDefault(),p(0)))},w=(S,z)=>{var v,N;switch(S.key){case"ArrowUp":case"ArrowLeft":{S.preventDefault(),p(z>0?z-1:t.length-1);break}case"ArrowDown":case"ArrowRight":{S.preventDefault(),p(z<t.length-1?z+1:0);break}case"Enter":case" ":{S.preventDefault(),(N=(v=t[z]).onClick)==null||N.call(v),b();break}case"Escape":{b();break}case"Home":{S.preventDefault(),p(0);break}case"End":{S.preventDefault(),p(t.length-1);break}}},j=S=>d?"0ms":`${S*40}ms`;return e.jsxs(e.Fragment,{children:[x&&typeof document<"u"&&Le.createPortal(e.jsx("div",{"aria-hidden":"true",onClick:b,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:d?"none":"opacity 200ms ease"}}),document.body),e.jsxs("div",{ref:h,className:s.tkx("fixed z-[9100] font-sans",o??""),style:{...Hi[i],...l},children:[x&&t.map((S,z)=>{const v=s.sanitizeString(S.label),N=Vi(n,z,_i),C=Oi(n);return e.jsx("div",{className:s.tkx("absolute"),style:{...N,opacity:d?1:0,animation:d?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:j(z)},children:e.jsxs("div",{className:s.tkx("relative inline-flex"),children:[e.jsx("span",{className:s.tkx("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...C,backgroundColor:c.surfaceAlt,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:v}),e.jsx("button",{ref:M=>{M?y.current.set(z,M):y.current.delete(z)},type:"button","aria-label":v,tabIndex:x?0:-1,onClick:()=>{var M;(M=S.onClick)==null||M.call(S),b()},onKeyDown:M=>w(M,z),className:s.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:Sr,height:Sr,backgroundColor:c.surface,color:c.text,border:`1px solid ${c.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:d?"none":"all 150ms ease"},onMouseEnter:M=>{M.currentTarget.style.backgroundColor=c.surfaceAlt,M.currentTarget.style.transform="scale(1.1)"},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=c.surface,M.currentTarget.style.transform="scale(1)"},children:S.icon})]})},S.id)}),e.jsx("button",{type:"button","aria-label":x?"Close actions menu":"Open actions menu","aria-expanded":x,"aria-controls":u,"aria-haspopup":"true",onClick:k,onKeyDown:g,className:s.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:jr,height:jr,backgroundColor:c.primary,color:c.bg,boxShadow:`0 6px 20px ${c.primary}40`,transition:d?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.boxShadow=`0 8px 28px ${c.primary}60`,d||(S.currentTarget.style.transform="scale(1.05)")},onMouseLeave:S=>{S.currentTarget.style.boxShadow=`0 6px 20px ${c.primary}40`,S.currentTarget.style.transform="scale(1)"},children:r??e.jsx(Wi,{color:c.bg,rotated:x,reducedMotion:d})}),e.jsx("div",{id:u,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:t.map(S=>e.jsx("div",{role:"menuitem",children:s.sanitizeString(S.label)},S.id))})]}),x&&!d&&e.jsx("style",{children:`
81
78
  @keyframes tkxSpeedDialIn {
82
79
  from { opacity: 0; transform: translateX(-50%) scale(0.5); }
83
80
  to { opacity: 1; transform: translateX(-50%) scale(1); }
84
81
  }
85
- `})]})}const pn=768,Ll=56;function Al({open:e}){return t.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:e?t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),t.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),t.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Rl(){const[e,r]=a.useState(()=>typeof window>"u"?!1:window.innerWidth<pn);return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>r(window.innerWidth<pn);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function Dl({title:e,logo:r,actions:n,navigation:o,position:i="sticky",variant:l="default",color:c="surface"}){const d=U(),u=te(),f=Rl(),[s,m]=a.useState(!1),p=a.useRef(null),x=a.useId();lt(()=>m(!1),s),a.useEffect(()=>{!f&&s&&m(!1)},[f,s]),a.useEffect(()=>{if(!s)return;const N=j=>{p.current&&!p.current.contains(j.target)&&m(!1)};return document.addEventListener("pointerdown",N),()=>document.removeEventListener("pointerdown",N)},[s]);const y=a.useCallback(()=>{m(N=>!N)},[]),v=c==="primary"?d.primary:d.surface,b=c==="primary"?d.bg:d.text,g={default:{backgroundColor:v,borderBottom:`1px solid ${d.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:v,boxShadow:`0 2px 8px ${d.bg}66`,borderBottom:"none"}},w={fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}},S=typeof e=="string"?R(e):e,M=u?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return t.jsxs("header",{role:"banner",className:h("font-sans w-full"),style:{...w[i],...g[l],color:b,height:Ll},children:[t.jsxs("div",{ref:p,className:h("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&t.jsx("div",{className:h("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),S&&t.jsx("div",{className:h("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:b},children:S}),!f&&o&&t.jsx("nav",{id:x,"aria-label":"Main navigation",className:h("flex items-center flex-1 gap-1"),children:o}),f&&t.jsx("div",{className:h("flex-1")}),n&&t.jsx("div",{className:h("flex items-center gap-2 ml-auto shrink-0"),children:n}),f&&o&&t.jsx("button",{onClick:y,"aria-expanded":s,"aria-controls":x,"aria-label":s?"Close navigation menu":"Open navigation menu",className:h("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:b},children:t.jsx(Al,{open:s})})]}),f&&o&&t.jsx("nav",{id:x,"aria-label":"Main navigation",style:{maxHeight:s?400:0,opacity:s?1:0,overflow:"hidden",transition:M,backgroundColor:d.surface,borderBottom:s?`1px solid ${d.border}`:"none"},children:t.jsx("div",{className:h("flex flex-col gap-1 px-4 py-3"),role:"menu",children:o})})]})}const Bl=5,Wl=56;let xn=!1;function Fl(){if(xn||typeof document>"u")return;xn=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent=`
82
+ `})]})}const Cr=768,Ui=56;function Ki({open:t}){return e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:t?e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):e.jsxs(e.Fragment,{children:[e.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}function Xi(){const[t,r]=a.useState(()=>typeof window>"u"?!1:window.innerWidth<Cr);return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>r(window.innerWidth<Cr);return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t}function qi({title:t,logo:r,actions:n,navigation:i,position:o="sticky",variant:l="default",color:c="surface"}){const d=B.useTheme(),u=s.useReducedMotion(),x=Xi(),[f,m]=a.useState(!1),p=a.useRef(null),h=a.useId();s.useEscapeKey(()=>m(!1),f),a.useEffect(()=>{!x&&f&&m(!1)},[x,f]),a.useEffect(()=>{if(!f)return;const z=v=>{p.current&&!p.current.contains(v.target)&&m(!1)};return document.addEventListener("pointerdown",z),()=>document.removeEventListener("pointerdown",z)},[f]);const y=a.useCallback(()=>{m(z=>!z)},[]),k=c==="primary"?d.primary:d.surface,b=c==="primary"?d.bg:d.text,g={default:{backgroundColor:k,borderBottom:`1px solid ${d.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:k,boxShadow:`0 2px 8px ${d.bg}66`,borderBottom:"none"}},w={fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}},j=typeof t=="string"?s.sanitizeString(t):t,S=u?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return e.jsxs("header",{role:"banner",className:s.tkx("font-sans w-full"),style:{...w[o],...g[l],color:b,height:Ui},children:[e.jsxs("div",{ref:p,className:s.tkx("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&e.jsx("div",{className:s.tkx("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),j&&e.jsx("div",{className:s.tkx("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:b},children:j}),!x&&i&&e.jsx("nav",{id:h,"aria-label":"Main navigation",className:s.tkx("flex items-center flex-1 gap-1"),children:i}),x&&e.jsx("div",{className:s.tkx("flex-1")}),n&&e.jsx("div",{className:s.tkx("flex items-center gap-2 ml-auto shrink-0"),children:n}),x&&i&&e.jsx("button",{onClick:y,"aria-expanded":f,"aria-controls":h,"aria-label":f?"Close navigation menu":"Open navigation menu",className:s.tkx("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:b},children:e.jsx(Ki,{open:f})})]}),x&&i&&e.jsx("nav",{id:h,"aria-label":"Main navigation",style:{maxHeight:f?400:0,opacity:f?1:0,overflow:"hidden",transition:S,backgroundColor:d.surface,borderBottom:f?`1px solid ${d.border}`:"none"},children:e.jsx("div",{className:s.tkx("flex flex-col gap-1 px-4 py-3"),role:"menu",children:i})})]})}const Zi=5,Gi=56;let Tr=!1;function Ji(){if(Tr||typeof document>"u")return;Tr=!0;const t=document.createElement("style");t.id="tkx-bottom-nav-kf",t.textContent=`
86
83
  @keyframes tkx-bottom-nav-pulse {
87
84
  0% { transform: scale(1); }
88
85
  50% { transform: scale(1.15); }
89
86
  100% { transform: scale(1); }
90
87
  }
91
- `,document.head.appendChild(e)}function Pl({items:e,activeId:r,onChange:n,showLabels:o=!0}){const i=U(),l=te(),c=a.useRef(null);a.useEffect(()=>{Fl()},[]);const d=e.slice(0,Bl),u=a.useCallback(m=>{n==null||n(m)},[n]),f=a.useCallback(m=>{const p=c.current;if(!p)return;const x=Array.from(p.querySelectorAll('[role="tab"]')),y=x.findIndex(b=>b===document.activeElement);if(y===-1)return;let v=y;m.key==="ArrowRight"||m.key==="ArrowDown"?(m.preventDefault(),v=(y+1)%x.length):m.key==="ArrowLeft"||m.key==="ArrowUp"?(m.preventDefault(),v=(y-1+x.length)%x.length):m.key==="Home"?(m.preventDefault(),v=0):m.key==="End"&&(m.preventDefault(),v=x.length-1),v!==y&&(x[v].focus(),u(d[v].id))},[u,d]),s=l?"none":"color 200ms ease, transform 150ms ease";return t.jsx("nav",{ref:c,role:"navigation","aria-label":"Bottom navigation",className:h("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:Wl,backgroundColor:i.surface,borderTop:`1px solid ${i.border}`,boxShadow:`0 -2px 12px ${i.bg}44`},children:t.jsx("div",{role:"tablist","aria-label":"Navigation tabs",className:h("flex items-center justify-around h-full"),onKeyDown:f,children:d.map(m=>{const p=m.id===r,x=R(m.label),y=p?i.primary:i.textMuted;return t.jsxs("button",{role:"tab","aria-selected":p,"aria-label":x,tabIndex:p?0:-1,onClick:()=>u(m.id),className:h("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:y,transition:s,outline:"none"},children:[p&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:i.primary,transition:l?"none":"width 200ms ease"}}),t.jsxs("div",{className:h("relative flex items-center justify-center"),style:{animation:p&&!l?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[m.icon,m.badge!==void 0&&m.badge>0&&t.jsx("span",{"aria-label":`${m.badge} notifications`,className:h("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:i.danger,color:i.bg},children:m.badge>99?"99+":m.badge})]}),o&&t.jsx("span",{className:h("text-[10px] leading-tight mt-0.5"),style:{fontWeight:p?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x})]},m.id)})})})}const Hl=5e3;let hn=!1;function Vl(){if(hn||typeof document>"u")return;hn=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent=`
88
+ `,document.head.appendChild(t)}function Qi({items:t,activeId:r,onChange:n,showLabels:i=!0}){const o=B.useTheme(),l=s.useReducedMotion(),c=a.useRef(null);a.useEffect(()=>{Ji()},[]);const d=t.slice(0,Zi),u=a.useCallback(m=>{n==null||n(m)},[n]),x=a.useCallback(m=>{const p=c.current;if(!p)return;const h=Array.from(p.querySelectorAll('[role="tab"]')),y=h.findIndex(b=>b===document.activeElement);if(y===-1)return;let k=y;m.key==="ArrowRight"||m.key==="ArrowDown"?(m.preventDefault(),k=(y+1)%h.length):m.key==="ArrowLeft"||m.key==="ArrowUp"?(m.preventDefault(),k=(y-1+h.length)%h.length):m.key==="Home"?(m.preventDefault(),k=0):m.key==="End"&&(m.preventDefault(),k=h.length-1),k!==y&&(h[k].focus(),u(d[k].id))},[u,d]),f=l?"none":"color 200ms ease, transform 150ms ease";return e.jsx("nav",{ref:c,role:"navigation","aria-label":"Bottom navigation",className:s.tkx("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:Gi,backgroundColor:o.surface,borderTop:`1px solid ${o.border}`,boxShadow:`0 -2px 12px ${o.bg}44`},children:e.jsx("div",{role:"tablist","aria-label":"Navigation tabs",className:s.tkx("flex items-center justify-around h-full"),onKeyDown:x,children:d.map(m=>{const p=m.id===r,h=s.sanitizeString(m.label),y=p?o.primary:o.textMuted;return e.jsxs("button",{role:"tab","aria-selected":p,"aria-label":h,tabIndex:p?0:-1,onClick:()=>u(m.id),className:s.tkx("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:y,transition:f,outline:"none"},children:[p&&e.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:o.primary,transition:l?"none":"width 200ms ease"}}),e.jsxs("div",{className:s.tkx("relative flex items-center justify-center"),style:{animation:p&&!l?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[m.icon,m.badge!==void 0&&m.badge>0&&e.jsx("span",{"aria-label":`${m.badge} notifications`,className:s.tkx("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:o.danger,color:o.bg},children:m.badge>99?"99+":m.badge})]}),i&&e.jsx("span",{className:s.tkx("text-[10px] leading-tight mt-0.5"),style:{fontWeight:p?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:h})]},m.id)})})})}const ea=5e3;let Mr=!1;function ta(){if(Mr||typeof document>"u")return;Mr=!0;const t=document.createElement("style");t.id="tkx-snackbar-kf",t.textContent=`
92
89
  @keyframes tkx-snackbar-slide-up {
93
90
  from { opacity: 0; transform: translateY(24px); }
94
91
  to { opacity: 1; transform: translateY(0); }
@@ -101,31 +98,22 @@
101
98
  from { opacity: 1; }
102
99
  to { opacity: 0; transform: translateY(8px); }
103
100
  }
104
- `,document.head.appendChild(e)}const Ol={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"})}),error: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"})})},_l={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function Yl({message:e,isOpen:r,onClose:n,action:o,variant:i="default",position:l="bottom-center",autoHideDuration:c=Hl,icon:d}){const u=U(),f=te(),s=a.useId(),m=a.useRef(null),[p,x]=a.useState(!1),[y,v]=a.useState(!1);a.useEffect(()=>{Vl()},[]),a.useEffect(()=>{if(r)v(!1),x(!0);else if(p)if(f)x(!1);else{v(!0);const T=setTimeout(()=>{x(!1),v(!1)},250);return()=>clearTimeout(T)}},[r,f,p]),a.useEffect(()=>{if(!(!r||c<=0||!n))return m.current=setTimeout(()=>{n()},c),()=>{m.current&&clearTimeout(m.current)}},[r,c,n]);const b=a.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),g=a.useCallback(()=>{r&&c>0&&n&&(m.current=setTimeout(()=>n(),c))},[r,c,n]),S={default:u.textMuted,success:u.success,error:u.danger,warning:u.warning,info:u.info}[i],M=R(e);if(!p||typeof document>"u")return null;const j=l==="top-center"?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up";let L={};f||(y?L={animation:"tkx-snackbar-fade-out 250ms ease forwards"}:L={animation:`${j} 250ms cubic-bezier(0.16,1,0.3,1) both`});const I=d??Ol[i]??null;return Ne.createPortal(t.jsx("div",{role:i==="error"?"alert":"status","aria-live":i==="error"?"assertive":"polite","aria-atomic":"true","aria-labelledby":s,className:h("fixed z-[9500] font-sans"),style:{..._l[l],...L,pointerEvents:"auto"},onMouseEnter:b,onMouseLeave:g,children:t.jsxs("div",{className:h("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:u.surface,border:`1px solid ${S}44`,boxShadow:`0 8px 24px ${u.bg}aa`,color:u.text},children:[I&&t.jsx("span",{className:h("shrink-0 flex items-center"),style:{color:S},children:I}),t.jsx("span",{id:s,className:h("flex-1 text-sm leading-snug"),children:M}),o&&t.jsx("button",{onClick:()=>{o.onClick(),n==null||n()},className:h("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:u.primary},children:R(o.label)}),n&&t.jsx("button",{"aria-label":"Dismiss snackbar",onClick:n,className:h("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:u.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"})]})})]})}),document.body)}function Ul({direction:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:h("shrink-0 ml-1"),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.35"})})}function mn({checked:e,indeterminate:r}){const n=U();return t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[t.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||r?n.primary:"transparent",stroke:e||r?n.primary:n.border,strokeWidth:"1.5"}),r&&t.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),e&&!r&&t.jsx("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function gn(e,r){return typeof r=="function"?r(e):String(e[r])}function Kl(e,r){return e[r]}function Xl({colCount:e}){const r=U(),n=Array.from({length:5},(o,i)=>i);return t.jsx("tbody",{children:n.map(o=>t.jsx("tr",{children:Array.from({length:e},(i,l)=>t.jsx("td",{className:h("px-3 py-2"),style:{borderBottom:`1px solid ${r.border}`},children:t.jsx(qt,{height:16})},l))},o))})}function ql({columns:e,data:r,rowKey:n,selectable:o=!1,selectedRows:i=[],onSelectionChange:l,sortable:c=!1,onSort:d,loading:u=!1,emptyMessage:f="No data to display",stickyHeader:s=!1,striped:m=!1,bordered:p=!1,compact:x=!1,maxHeight:y,onRowClick:v,virtualScroll:b,rowHeight:g=40}){const w=U(),S=te(),M=a.useId(),N=10,j=b!==void 0?b:y!==void 0&&r.length>=50,L=a.useRef(null),[I,T]=a.useState(0),[$,z]=a.useState(0),E=a.useCallback(()=>{L.current&&T(L.current.scrollTop)},[]);a.useEffect(()=>{if(!j||!L.current)return;const q=L.current;z(q.clientHeight);const K=new ResizeObserver(()=>{z(q.clientHeight)});return K.observe(q),()=>K.disconnect()},[j]),r.length*g;const C=j?Math.max(0,Math.floor(I/g)-N):0,k=j?Math.min(r.length,Math.ceil((I+$)/g)+N):r.length,A=j?r.slice(C,k):r,D=C*g,[O,W]=a.useState(null),[H,B]=a.useState("asc"),P=a.useCallback(q=>{let K="asc";O===q&&(K=H==="asc"?"desc":"asc"),W(q),B(K),d==null||d(q,K)},[O,H,d]),F=a.useMemo(()=>new Set(i),[i]),V=a.useMemo(()=>r.map(q=>gn(q,n)),[r,n]),Q=V.length>0&&V.every(q=>F.has(q)),re=V.some(q=>F.has(q)),ie=a.useCallback(()=>{Q?l==null||l([]):l==null||l(V)},[Q,V,l]),fe=a.useCallback(q=>{const K=F.has(q)?i.filter(G=>G!==q):[...i,q];l==null||l(K)},[F,i,l]),[xe,ve]=a.useState({}),ge=a.useRef(null),X=a.useCallback((q,K)=>{K.preventDefault(),K.stopPropagation();const G=K.target.closest("th");if(!G)return;const ee=xe[q]||G.getBoundingClientRect().width;ge.current={key:q,startX:K.clientX,startWidth:ee};const ue=Me=>{if(!ge.current)return;const je=Me.clientX-ge.current.startX,ze=Math.max(50,ge.current.startWidth+je);ve(Te=>({...Te,[ge.current.key]:ze}))},ke=()=>{ge.current=null,document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",ke)};document.addEventListener("mousemove",ue),document.addEventListener("mouseup",ke)},[xe]),se=x?"4px":"8px",he=x?"8px":"12px",Se=q=>{const K=xe[q.key]||q.width;return{width:K||void 0,minWidth:K||80,textAlign:q.align??"left",padding:`${se} ${he}`}},de=p?`1px solid ${w.border}`:"none",be=R(f),ne=e.length+(o?1:0);return t.jsx("div",{role:"grid","aria-label":"Data grid",id:M,className:h("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${w.border}`,backgroundColor:w.bg},children:t.jsx("div",{ref:L,onScroll:j?E:void 0,style:{maxHeight:y??"none",overflowX:"auto",overflowY:y?"auto":"visible"},children:t.jsxs("table",{className:h("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[t.jsx("thead",{children:t.jsxs("tr",{children:[o&&t.jsx("th",{scope:"col",className:h("shrink-0"),style:{position:s?"sticky":"static",top:0,zIndex:2,backgroundColor:w.surface,borderBottom:`2px solid ${w.border}`,borderRight:p?de:"none",padding:`${se} ${he}`,width:40,textAlign:"center"},children:t.jsx("button",{onClick:ie,"aria-label":Q?"Deselect all rows":"Select all rows",className:h("bg-transparent border-none cursor-pointer p-0","flex items-center justify-center","focus-visible:focus-ring"),style:{margin:"0 auto"},children:t.jsx(mn,{checked:Q,indeterminate:re&&!Q})})}),e.map(q=>{const K=(q.sortable??c)&&q.sortable!==!1,G=O===q.key,ee=R(q.header);return t.jsx("th",{scope:"col","aria-sort":G?H==="asc"?"ascending":"descending":void 0,className:h("text-xs font-semibold uppercase tracking-wider"),style:{...Se(q),position:s?"sticky":"static",top:0,zIndex:2,backgroundColor:w.surface,color:w.textMuted,borderBottom:`2px solid ${w.border}`,borderRight:p?de:"none",cursor:K?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:S?"none":"background-color 150ms ease"},onClick:K?()=>P(q.key):void 0,onKeyDown:K?ue=>{(ue.key==="Enter"||ue.key===" ")&&(ue.preventDefault(),P(q.key))}:void 0,tabIndex:K?0:void 0,role:K?"columnheader button":"columnheader",children:t.jsxs("div",{className:h("flex items-center gap-1"),children:[q.renderHeader?q.renderHeader(q):ee,K&&t.jsx(Ul,{direction:G?H:null}),q.resizable&&t.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${ee}`,className:h("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:ue=>X(q.key,ue)})]})},q.key)})]})}),u&&t.jsx(Xl,{colCount:ne}),!u&&t.jsx("tbody",{children:r.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:ne,className:h("text-center py-10"),style:{color:w.textMuted},children:be})}):t.jsxs(t.Fragment,{children:[j&&D>0&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{colSpan:ne,style:{height:D,padding:0,border:"none"}})}),A.map((q,K)=>{const G=C+K,ee=gn(q,n),ue=F.has(ee),ke=m&&G%2===1;let Me="transparent";return ue?Me=`${w.primary}15`:ke&&(Me=w.surfaceAlt),t.jsxs("tr",{role:"row","aria-selected":o?ue:void 0,onClick:v?()=>v(q):void 0,className:h(v?"cursor-pointer":""),style:{backgroundColor:Me,transition:S?"none":"background-color 120ms ease",...j?{height:g,boxSizing:"border-box"}:{}},onMouseEnter:v?je=>{je.currentTarget.style.backgroundColor=ue?`${w.primary}22`:`${w.surfaceAlt}`}:void 0,onMouseLeave:v?je=>{je.currentTarget.style.backgroundColor=Me}:void 0,children:[o&&t.jsx("td",{style:{borderBottom:`1px solid ${w.border}`,borderRight:p?de:"none",padding:`${se} ${he}`,textAlign:"center",width:40},children:t.jsx("button",{onClick:je=>{je.stopPropagation(),fe(ee)},"aria-label":ue?`Deselect row ${ee}`:`Select row ${ee}`,className:h("bg-transparent border-none cursor-pointer p-0","flex items-center justify-center","focus-visible:focus-ring"),style:{margin:"0 auto"},children:t.jsx(mn,{checked:ue})})}),e.map(je=>{const ze=Kl(q,je.key),Te=je.renderCell?je.renderCell(ze,q):typeof ze=="string"?R(ze):String(ze??"");return t.jsx("td",{className:h("text-sm"),style:{...Se(je),borderBottom:`1px solid ${w.border}`,borderRight:p?de:"none",color:w.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te},je.key)})]},ee)}),j&&k<r.length&&t.jsx("tr",{"aria-hidden":"true",children:t.jsx("td",{colSpan:ne,style:{height:(r.length-k)*g,padding:0,border:"none"}})})]})})]})})})}const Ht={md:768,lg:1024};function Zl(){const[e,r]=a.useState(()=>{if(typeof window>"u")return"lg";const n=window.innerWidth;return n>=Ht.lg?"lg":n>=Ht.md?"md":"sm"});return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>{const o=window.innerWidth;o>=Ht.lg?r("lg"):o>=Ht.md?r("md"):r("sm")};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}function Gl(e,r){return e===void 0?3:typeof e=="number"?Math.max(1,e):r==="lg"?e.lg??e.md??e.sm??3:r==="md"?e.md??e.sm??2:e.sm??1}let bn=!1;function Jl(){if(bn||typeof document>"u")return;bn=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent=`
101
+ `,document.head.appendChild(t)}const ra={success:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})}),error:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})})},na={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function sa({message:t,isOpen:r,onClose:n,action:i,variant:o="default",position:l="bottom-center",autoHideDuration:c=ea,icon:d}){const u=B.useTheme(),x=s.useReducedMotion(),f=a.useId(),m=a.useRef(null),[p,h]=a.useState(!1),[y,k]=a.useState(!1);a.useEffect(()=>{ta()},[]),a.useEffect(()=>{if(r)k(!1),h(!0);else if(p)if(x)h(!1);else{k(!0);const M=setTimeout(()=>{h(!1),k(!1)},250);return()=>clearTimeout(M)}},[r,x,p]),a.useEffect(()=>{if(!(!r||c<=0||!n))return m.current=setTimeout(()=>{n()},c),()=>{m.current&&clearTimeout(m.current)}},[r,c,n]);const b=a.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),g=a.useCallback(()=>{r&&c>0&&n&&(m.current=setTimeout(()=>n(),c))},[r,c,n]),j={default:u.textMuted,success:u.success,error:u.danger,warning:u.warning,info:u.info}[o],S=s.sanitizeString(t);if(!p||typeof document>"u")return null;const v=l==="top-center"?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up";let N={};x||(y?N={animation:"tkx-snackbar-fade-out 250ms ease forwards"}:N={animation:`${v} 250ms cubic-bezier(0.16,1,0.3,1) both`});const C=d??ra[o]??null;return Le.createPortal(e.jsx("div",{role:o==="error"?"alert":"status","aria-live":o==="error"?"assertive":"polite","aria-atomic":"true","aria-labelledby":f,className:s.tkx("fixed z-[9500] font-sans"),style:{...na[l],...N,pointerEvents:"auto"},onMouseEnter:b,onMouseLeave:g,children:e.jsxs("div",{className:s.tkx("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:u.surface,border:`1px solid ${j}44`,boxShadow:`0 8px 24px ${u.bg}aa`,color:u.text},children:[C&&e.jsx("span",{className:s.tkx("shrink-0 flex items-center"),style:{color:j},children:C}),e.jsx("span",{id:f,className:s.tkx("flex-1 text-sm leading-snug"),children:S}),i&&e.jsx("button",{onClick:()=>{i.onClick(),n==null||n()},className:s.tkx("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:u.primary},children:s.sanitizeString(i.label)}),n&&e.jsx("button",{"aria-label":"Dismiss snackbar",onClick:n,className:s.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:u.textMuted},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)}function oa({direction:t}){return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:s.tkx("shrink-0 ml-1"),children:t==="asc"?e.jsx("path",{d:"M7 14l5-5 5 5H7z"}):t==="desc"?e.jsx("path",{d:"M7 10l5 5 5-5H7z"}):e.jsx("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function $r({checked:t,indeterminate:r}){const n=B.useTheme();return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[e.jsx("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:t||r?n.primary:"transparent",stroke:t||r?n.primary:n.border,strokeWidth:"1.5"}),r&&e.jsx("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:n.bg,strokeWidth:"2"}),t&&!r&&e.jsx("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:n.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zr(t,r){return typeof r=="function"?r(t):String(t[r])}function xt(t,r){return t[r]}function ia(t,r){return t==null&&r==null?0:t==null?1:r==null?-1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r),void 0,{numeric:!0,sensitivity:"base"})}function Ir(t){const r=String(t??"");return r.includes(",")||r.includes('"')||r.includes(`
102
+ `)?`"${r.replace(/"/g,'""')}"`:r}function aa({colCount:t}){const r=B.useTheme();return e.jsx("tbody",{children:Array.from({length:5},(n,i)=>e.jsx("tr",{children:Array.from({length:t},(o,l)=>e.jsx("td",{className:s.tkx("px-3 py-2"),style:{borderBottom:`1px solid ${r.border}`},children:e.jsx(Ct,{height:16})},l))},i))})}function la({label:t,showExport:r,onExport:n,totalRows:i,selectedCount:o,theme:l}){return!r&&o===0?null:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${l.border}`,backgroundColor:l.surface,gap:8},children:[e.jsx("span",{style:{fontSize:13,color:l.textMuted},children:o>0?`${o} of ${i} row${i!==1?"s":""} selected`:`${i} row${i!==1?"s":""}`}),r&&e.jsxs("button",{onClick:n,"aria-label":`Export ${t} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${l.border}`,backgroundColor:"transparent",color:l.text,cursor:"pointer"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]})}function ca({page:t,totalPages:r,pageSize:n,totalRows:i,onPageChange:o,theme:l}){const c=(t-1)*n+1,d=Math.min(t*n,i),u={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${l.border}`,backgroundColor:"transparent",color:l.text,cursor:"pointer",fontSize:13,fontWeight:500};return e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${l.border}`,backgroundColor:l.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[e.jsx("span",{style:{fontSize:13,color:l.textMuted},children:i===0?"0 rows":`${c}–${d} of ${i}`}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>o(1),disabled:t===1,"aria-label":"First page",style:{...u,opacity:t===1?.4:1},children:"«"}),e.jsx("button",{onClick:()=>o(t-1),disabled:t===1,"aria-label":"Previous page",style:{...u,opacity:t===1?.4:1},children:"‹"}),Array.from({length:Math.min(5,r)},(x,f)=>{let m=f+1;if(r>5){const p=Math.floor(2.5);m=Math.max(1,Math.min(t-p,r-4))+f}return e.jsx("button",{onClick:()=>o(m),"aria-label":`Page ${m}`,"aria-current":m===t?"page":void 0,style:{...u,backgroundColor:m===t?l.primary:"transparent",color:m===t?l.bg:l.text,borderColor:m===t?l.primary:l.border},children:m},m)}),e.jsx("button",{onClick:()=>o(t+1),disabled:t===r,"aria-label":"Next page",style:{...u,opacity:t===r?.4:1},children:"›"}),e.jsx("button",{onClick:()=>o(r),disabled:t===r,"aria-label":"Last page",style:{...u,opacity:t===r?.4:1},children:"»"})]})]})}function da({columns:t,data:r,rowKey:n,selectable:i=!1,selectedRows:o=[],onSelectionChange:l,sortable:c=!1,onSort:d,loading:u=!1,emptyMessage:x="No data to display",stickyHeader:f=!1,striped:m=!1,bordered:p=!1,compact:h=!1,maxHeight:y,onRowClick:k,virtualScroll:b,rowHeight:g=40,showFilters:w=!1,filterValues:j,onFilterChange:S,pageSize:z=0,showExport:v=!1,exportFileName:N="export"}){const C=B.useTheme(),M=s.useReducedMotion(),T=a.useId(),[E,$]=a.useState(null),[F,I]=a.useState("asc"),W=a.useCallback(q=>{const te=E===q&&F==="asc"?"desc":"asc";$(q),I(te),d==null||d(q,te)},[E,F,d]),L=a.useMemo(()=>d||!E?r:[...r].sort((q,te)=>{const ve=xt(q,E),Se=xt(te,E),ye=ia(ve,Se);return F==="asc"?ye:-ye}),[r,E,F,d]),[Y,D]=a.useState({}),V=j??Y,R=a.useCallback((q,te)=>{S?S(q,te):D(ve=>({...ve,[q]:te}))},[S]),P=a.useMemo(()=>{const q=Object.entries(V).filter(([,te])=>te.trim()!=="");return q.length===0?L:L.filter(te=>q.every(([ve,Se])=>{const ye=xt(te,ve);return String(ye??"").toLowerCase().includes(Se.toLowerCase())}))},[L,V]),[A,O]=a.useState(1),G=z>0,ee=P.length,oe=G?Math.max(1,Math.ceil(ee/z)):1;a.useEffect(()=>{O(1)},[V,E,F]);const ae=a.useMemo(()=>G?P.slice((A-1)*z,A*z):P,[P,G,A,z]),fe=10,de=b!==void 0?b:!G&&y!==void 0&&ae.length>=50,ge=a.useRef(null),[U,se]=a.useState(0),[he,we]=a.useState(0),ce=a.useCallback(()=>{ge.current&&se(ge.current.scrollTop)},[]);a.useEffect(()=>{if(!de||!ge.current)return;const q=ge.current;we(q.clientHeight);const te=new ResizeObserver(()=>we(q.clientHeight));return te.observe(q),()=>te.disconnect()},[de]),ae.length*g;const me=de?Math.max(0,Math.floor(U/g)-fe):0,re=de?Math.min(ae.length,Math.ceil((U+he)/g)+fe):ae.length,le=de?ae.slice(me,re):ae,J=me*g,X=a.useMemo(()=>new Set(o),[o]),ne=a.useMemo(()=>P.map(q=>zr(q,n)),[P,n]),xe=ne.length>0&&ne.every(q=>X.has(q)),ke=ne.some(q=>X.has(q)),Te=a.useCallback(()=>{l==null||l(xe?[]:ne)},[xe,ne,l]),Me=a.useCallback(q=>{const te=X.has(q)?o.filter(ve=>ve!==q):[...o,q];l==null||l(te)},[X,o,l]),[He,$e]=a.useState({}),ze=a.useRef(null),Ke=a.useCallback((q,te)=>{te.preventDefault(),te.stopPropagation();const ve=te.target.closest("th");if(!ve)return;const Se=He[q]||ve.getBoundingClientRect().width;ze.current={key:q,startX:te.clientX,startWidth:Se};const ye=Ee=>{if(!ze.current)return;const H=Math.max(50,ze.current.startWidth+Ee.clientX-ze.current.startX);$e(Q=>({...Q,[ze.current.key]:H}))},Be=()=>{ze.current=null,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Be)};document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Be)},[He]),Xe=a.useCallback(()=>{const q=t.map(Ee=>Ir(Ee.header)).join(","),te=P.map(Ee=>t.map(H=>{const Q=xt(Ee,H.key);return Ir(Q)}).join(",")),ve=[q,...te].join(`
103
+ `),Se=new Blob([ve],{type:"text/csv;charset=utf-8;"}),ye=URL.createObjectURL(Se),Be=document.createElement("a");Be.href=ye,Be.download=`${N}.csv`,Be.click(),URL.revokeObjectURL(ye)},[t,P,N]),De=h?"4px":"8px",Pe=h?"8px":"12px",Oe=q=>{const te=He[q.key]||q.width;return{width:te??void 0,minWidth:te??80,textAlign:q.align??"left",padding:`${De} ${Pe}`}},Ie=p?`1px solid ${C.border}`:"none",qe=s.sanitizeString(x),_e=t.length+(i?1:0),Je=t.some(q=>q.filterable);return e.jsxs("div",{role:"grid","aria-label":"Data grid","aria-rowcount":ee,id:T,className:s.tkx("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${C.border}`,backgroundColor:C.bg},children:[e.jsx(la,{label:"data grid",showExport:v,onExport:Xe,totalRows:ee,selectedCount:o.length,theme:C}),e.jsx("div",{ref:ge,onScroll:de?ce:void 0,style:{maxHeight:y??"none",overflowX:"auto",overflowY:y?"auto":"visible"},children:e.jsxs("table",{className:s.tkx("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[e.jsxs("thead",{children:[e.jsxs("tr",{role:"row",children:[i&&e.jsx("th",{scope:"col",role:"columnheader",style:{position:f?"sticky":"static",top:0,zIndex:2,backgroundColor:C.surface,borderBottom:`2px solid ${C.border}`,borderRight:Ie,padding:`${De} ${Pe}`,width:40,textAlign:"center"},children:e.jsxs("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[e.jsx("input",{type:"checkbox",checked:xe,ref:q=>{q&&(q.indeterminate=ke&&!xe)},onChange:Te,"aria-label":xe?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),e.jsx($r,{checked:xe,indeterminate:ke&&!xe})]})}),t.map(q=>{const te=(q.sortable??c)&&q.sortable!==!1,ve=E===q.key,Se=s.sanitizeString(q.header);return e.jsx("th",{scope:"col",role:"columnheader","aria-sort":ve?F==="asc"?"ascending":"descending":te?"none":void 0,className:s.tkx("text-xs font-semibold uppercase tracking-wider"),style:{...Oe(q),position:f?"sticky":"static",top:0,zIndex:2,backgroundColor:C.surface,color:C.textMuted,borderBottom:`2px solid ${C.border}`,borderRight:Ie,cursor:te?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:M?"none":"background-color 150ms ease"},onClick:te?()=>W(q.key):void 0,onKeyDown:te?ye=>{(ye.key==="Enter"||ye.key===" ")&&(ye.preventDefault(),W(q.key))}:void 0,tabIndex:te?0:void 0,children:e.jsxs("div",{className:s.tkx("flex items-center gap-1"),style:{position:"relative"},children:[q.renderHeader?q.renderHeader(q):Se,te&&e.jsx(oa,{direction:ve?F:null}),q.resizable&&e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${Se}`,className:s.tkx("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:ye=>Ke(q.key,ye)})]})},q.key)})]}),(w||Je)&&e.jsxs("tr",{role:"row","aria-label":"Column filters",children:[i&&e.jsx("th",{scope:"col",style:{backgroundColor:C.surfaceAlt,borderBottom:`1px solid ${C.border}`,borderRight:Ie,padding:`4px ${Pe}`,width:40}}),t.map(q=>e.jsx("th",{scope:"col",style:{backgroundColor:C.surfaceAlt,borderBottom:`1px solid ${C.border}`,borderRight:Ie,padding:`4px ${Pe}`},children:(q.filterable||w)&&e.jsx("input",{type:"text",value:V[q.key]??"",onChange:te=>R(q.key,te.target.value),placeholder:`Filter ${q.header}…`,"aria-label":`Filter by ${q.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${C.border}`,backgroundColor:C.bg,color:C.text,outline:"none"}})},q.key))]})]}),u&&e.jsx(aa,{colCount:_e}),!u&&e.jsx("tbody",{children:ae.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:_e,className:s.tkx("text-center py-10"),style:{color:C.textMuted},children:qe})}):e.jsxs(e.Fragment,{children:[de&&J>0&&e.jsx("tr",{"aria-hidden":"true",children:e.jsx("td",{colSpan:_e,style:{height:J,padding:0,border:"none"}})}),le.map((q,te)=>{const ve=me+te,Se=zr(q,n),ye=X.has(Se),Be=m&&ve%2===1;let Ee="transparent";return ye?Ee=`${C.primary}22`:Be&&(Ee=C.surfaceAlt),e.jsxs("tr",{role:"row","aria-rowindex":ve+1,"aria-selected":i?ye:void 0,onClick:k?()=>k(q):void 0,onKeyDown:k?H=>{(H.key==="Enter"||H.key===" ")&&(H.preventDefault(),k(q))}:void 0,tabIndex:k?0:void 0,className:s.tkx(k?"cursor-pointer":""),style:{backgroundColor:Ee,transition:M?"none":"background-color 120ms ease",...de?{height:g,boxSizing:"border-box"}:{}},onMouseEnter:k?H=>{H.currentTarget.style.backgroundColor=ye?`${C.primary}30`:C.surfaceAlt}:void 0,onMouseLeave:k?H=>{H.currentTarget.style.backgroundColor=Ee}:void 0,children:[i&&e.jsx("td",{role:"gridcell",style:{borderBottom:`1px solid ${C.border}`,borderRight:Ie,padding:`${De} ${Pe}`,textAlign:"center",width:40},children:e.jsxs("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:H=>H.stopPropagation(),children:[e.jsx("input",{type:"checkbox",checked:ye,onChange:()=>Me(Se),"aria-label":ye?`Deselect row ${Se}`:`Select row ${Se}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),e.jsx($r,{checked:ye})]})}),t.map(H=>{const Q=xt(q,H.key),ie=H.renderCell?H.renderCell(Q,q):typeof Q=="string"?s.sanitizeString(Q):String(Q??"");return e.jsx("td",{role:"gridcell",className:s.tkx("text-sm"),style:{...Oe(H),borderBottom:`1px solid ${C.border}`,borderRight:Ie,color:C.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ie},H.key)})]},Se)}),de&&re<ae.length&&e.jsx("tr",{"aria-hidden":"true",children:e.jsx("td",{colSpan:_e,style:{height:(ae.length-re)*g,padding:0,border:"none"}})})]})})]})}),G&&!u&&e.jsx(ca,{page:A,totalPages:oe,pageSize:z,totalRows:ee,onPageChange:O,theme:C})]})}const jt={md:768,lg:1024};function ua(){const[t,r]=a.useState(()=>{if(typeof window>"u")return"lg";const n=window.innerWidth;return n>=jt.lg?"lg":n>=jt.md?"md":"sm"});return a.useEffect(()=>{if(typeof window>"u")return;const n=()=>{const i=window.innerWidth;i>=jt.lg?r("lg"):i>=jt.md?r("md"):r("sm")};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t}function fa(t,r){return t===void 0?3:typeof t=="number"?Math.max(1,t):r==="lg"?t.lg??t.md??t.sm??3:r==="md"?t.md??t.sm??2:t.sm??1}let Er=!1;function xa(){if(Er||typeof document>"u")return;Er=!0;const t=document.createElement("style");t.id="tkx-masonry-kf",t.textContent=`
105
104
  @keyframes tkx-masonry-fade-in {
106
105
  from { opacity: 0; transform: translateY(8px); }
107
106
  to { opacity: 1; transform: translateY(0); }
108
107
  }
109
- `,document.head.appendChild(e)}function Ql({columns:e,gap:r=16,children:n}){U();const o=te(),i=Zl();a.useEffect(()=>{Jl()},[]);const l=Gl(e,i),c=a.Children.toArray(n),d=a.useMemo(()=>{const f=Array.from({length:l},()=>[]);return c.forEach((s,m)=>{f[m%l].push(s)}),f},[c,l]),u=f=>o?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(f*40,400)}ms`};return t.jsx("div",{role:"list","aria-label":"Masonry grid",className:h("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:d.map((f,s)=>t.jsx("div",{className:h("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:f.map((m,p)=>{const x=p*l+s;return t.jsx("div",{role:"listitem",style:u(x),children:m},p)})},s))})}const ec={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"})}),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"})}),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"})})},tc={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}};function rc({block:e}){const r=U(),n=e.level??1,o=`h${n}`,i=R(e.content??"");return t.jsx(o,{className:h("m-0"),style:{...tc[n],color:r.text},children:i})}function nc({block:e}){const r=U(),n=R(e.content??"");return t.jsx("p",{className:h("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:r.text,marginBottom:12},children:n})}function oc({block:e}){const r=U(),n=R(e.content??"");return t.jsx("blockquote",{className:h("m-0"),style:{borderLeft:`3px solid ${r.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${r.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:r.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})}function sc({block:e}){const r=U(),n=R(e.content??""),o=e.language?R(e.language):null;return t.jsxs("div",{className:h("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${r.border}`,backgroundColor:r.surfaceAlt},children:[o&&t.jsx("div",{className:h("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:r.textMuted,borderBottom:`1px solid ${r.border}`,backgroundColor:r.surface},children:o}),t.jsx("pre",{className:h("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:r.text,tabSize:2},children:t.jsx("code",{"aria-label":o?`Code block in ${o}`:"Code block",children:n})})]})}function ic({block:e}){const r=U(),n=e.ordered?"ol":"ul",o=(e.items??[]).map(i=>R(i));return t.jsx(n,{className:h("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:r.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:o.map((i,l)=>t.jsx("li",{role:"listitem",style:{marginBottom:4},children:i},l))})}function ac(){const e=U();return t.jsx("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${e.border}`,marginTop:20,marginBottom:20}})}function lc({block:e}){const r=U(),n=R(e.src??""),o=R(e.alt??"Image");return t.jsxs("figure",{className:h("m-0"),style:{marginTop:12,marginBottom:12},children:[t.jsx("img",{src:n,alt:o,loading:"lazy",className:h("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${r.border}`}}),e.alt&&t.jsx("figcaption",{className:h("text-xs mt-2 text-center"),style:{color:r.textMuted},children:o})]})}function cc({block:e}){const r=U(),n=e.variant??"info",o=R(e.content??""),l={info:r.info,warning:r.warning,success:r.success,danger:r.danger}[n],c=ec[n],d={info:"note",warning:"alert",success:"status",danger:"alert"};return t.jsxs("div",{role:d[n],className:h("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[t.jsx("span",{className:h("shrink-0 mt-[2px]"),style:{color:l},children:c}),t.jsx("div",{className:h("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:r.text},children:o})]})}const dc={heading:rc,paragraph:nc,blockquote:oc,code:sc,list:ic,divider:ac,image:lc,callout:cc};function uc({blocks:e,className:r,style:n}){const o=U(),i=te(),l=a.useMemo(()=>e.map((c,d)=>{const u=dc[c.type];return u?t.jsx("div",{style:i?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(d*30,300)}ms`},children:t.jsx(u,{block:c,index:d})},d):null}),[e,i]);return a.useMemo(()=>{if(typeof document>"u"||document.getElementById("tkx-rich-text-kf"))return;const c=document.createElement("style");c.id="tkx-rich-text-kf",c.textContent=`
108
+ `,document.head.appendChild(t)}function pa({columns:t,gap:r=16,children:n}){B.useTheme();const i=s.useReducedMotion(),o=ua();a.useEffect(()=>{xa()},[]);const l=fa(t,o),c=a.Children.toArray(n),d=a.useMemo(()=>{const x=Array.from({length:l},()=>[]);return c.forEach((f,m)=>{x[m%l].push(f)}),x},[c,l]),u=x=>i?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(x*40,400)}ms`};return e.jsx("div",{role:"list","aria-label":"Masonry grid",className:s.tkx("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:d.map((x,f)=>e.jsx("div",{className:s.tkx("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:x.map((m,p)=>{const h=p*l+f;return e.jsx("div",{role:"listitem",style:u(h),children:m},p)})},f))})}const ha={info:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})}),warning:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.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"})})},ma={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}};function ga({block:t}){const r=B.useTheme(),n=t.level??1,i=`h${n}`,o=s.sanitizeString(t.content??"");return e.jsx(i,{className:s.tkx("m-0"),style:{...ma[n],color:r.text},children:o})}function ba({block:t}){const r=B.useTheme(),n=s.sanitizeString(t.content??"");return e.jsx("p",{className:s.tkx("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:r.text,marginBottom:12},children:n})}function ya({block:t}){const r=B.useTheme(),n=s.sanitizeString(t.content??"");return e.jsx("blockquote",{className:s.tkx("m-0"),style:{borderLeft:`3px solid ${r.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${r.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:r.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:n})}function ka({block:t}){const r=B.useTheme(),n=s.sanitizeString(t.content??""),i=t.language?s.sanitizeString(t.language):null;return e.jsxs("div",{className:s.tkx("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${r.border}`,backgroundColor:r.surfaceAlt},children:[i&&e.jsx("div",{className:s.tkx("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:r.textMuted,borderBottom:`1px solid ${r.border}`,backgroundColor:r.surface},children:i}),e.jsx("pre",{className:s.tkx("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:r.text,tabSize:2},children:e.jsx("code",{"aria-label":i?`Code block in ${i}`:"Code block",children:n})})]})}function va({block:t}){const r=B.useTheme(),n=t.ordered?"ol":"ul",i=(t.items??[]).map(o=>s.sanitizeString(o));return e.jsx(n,{className:s.tkx("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:r.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:t.ordered?"decimal":"disc"},role:"list",children:i.map((o,l)=>e.jsx("li",{role:"listitem",style:{marginBottom:4},children:o},l))})}function wa(){const t=B.useTheme();return e.jsx("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${t.border}`,marginTop:20,marginBottom:20}})}function ja({block:t}){const r=B.useTheme(),n=s.sanitizeString(t.src??""),i=s.sanitizeString(t.alt??"Image");return e.jsxs("figure",{className:s.tkx("m-0"),style:{marginTop:12,marginBottom:12},children:[e.jsx("img",{src:n,alt:i,loading:"lazy",className:s.tkx("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${r.border}`}}),t.alt&&e.jsx("figcaption",{className:s.tkx("text-xs mt-2 text-center"),style:{color:r.textMuted},children:i})]})}function Sa({block:t}){const r=B.useTheme(),n=t.variant??"info",i=s.sanitizeString(t.content??""),l={info:r.info,warning:r.warning,success:r.success,danger:r.danger}[n],c=ha[n],d={info:"note",warning:"alert",success:"status",danger:"alert"};return e.jsxs("div",{role:d[n],className:s.tkx("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[e.jsx("span",{className:s.tkx("shrink-0 mt-[2px]"),style:{color:l},children:c}),e.jsx("div",{className:s.tkx("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:r.text},children:i})]})}const Ca={heading:ga,paragraph:ba,blockquote:ya,code:ka,list:va,divider:wa,image:ja,callout:Sa};function Ta({blocks:t,className:r,style:n}){const i=B.useTheme(),o=s.useReducedMotion(),l=a.useMemo(()=>t.map((c,d)=>{const u=Ca[c.type];return u?e.jsx("div",{style:o?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(d*30,300)}ms`},children:e.jsx(u,{block:c,index:d})},d):null}),[t,o]);return a.useMemo(()=>{if(typeof document>"u"||document.getElementById("tkx-rich-text-kf"))return;const c=document.createElement("style");c.id="tkx-rich-text-kf",c.textContent=`
110
109
  @keyframes tkx-rich-text-fade-in {
111
110
  from { opacity: 0; }
112
111
  to { opacity: 1; }
113
112
  }
114
- `,document.head.appendChild(c)},[]),t.jsx("article",{"aria-label":"Rich text content",className:h("font-sans",r??""),style:{color:o.text,maxWidth:720,...n},children:l})}const Cr=a.createContext(null);function fc(){const e=a.useContext(Cr);if(!e)throw new Error("TkxFormField must be used inside a <TkxForm>. Wrap your fields in a TkxForm component.");return e}async function yn(e,r){for(const n of r){if(n.required&&(e==null||e===""||Array.isArray(e)&&e.length===0))return n.message??"This field is required";if(!(e==null||e==="")){if(n.min!==void 0){if(typeof e=="string"&&e.length<n.min)return n.message??`Must be at least ${n.min} characters`;if(typeof e=="number"&&e<n.min)return n.message??`Must be at least ${n.min}`}if(n.max!==void 0){if(typeof e=="string"&&e.length>n.max)return n.message??`Must be no more than ${n.max} characters`;if(typeof e=="number"&&e>n.max)return n.message??`Must be no more than ${n.max}`}if(n.pattern&&typeof e=="string"&&!n.pattern.test(e))return n.message??"Invalid format";if(n.validator){const o=await n.validator(e);if(o)return o}}}return null}function pc(e,r){const n=e?[...e]:[];return r&&!n.some(o=>o.required)&&n.unshift({required:!0,message:"This field is required"}),n}function xc(e){return e.some(r=>r.required)}function hc(){const e=a.useContext(Cr);if(e)return e.instance;throw new Error("useTkxForm() must be called inside a <TkxForm> provider. Wrap your component tree with <TkxForm> first.")}function No({onSubmit:e,onValuesChange:r,initialValues:n={},layout:o="vertical",disabled:i=!1,children:l,className:c,style:d}){const u=U(),[f,s]=a.useState({values:{...n},errors:{},touched:{}}),m=a.useRef(n),p=a.useRef({}),x=a.useRef(f);x.current=f;const y=a.useCallback(($,z)=>{p.current[$]=z},[]),v=a.useCallback($=>{delete p.current[$]},[]),b=a.useCallback(($,z)=>{s(E=>{const C={...E,values:{...E.values,[$]:z}};return r==null||r({[$]:z},C.values),C})},[r]),g=a.useCallback(($,z)=>{s(E=>({...E,errors:{...E.errors,[$]:z}}))},[]),w=a.useCallback($=>{s(z=>({...z,touched:{...z.touched,[$]:!0}}))},[]),S=a.useCallback(async $=>{const z=p.current[$];if(!z)return!0;const E=x.current.values[$],C=await yn(E,z.rules);return s(k=>({...k,errors:{...k.errors,[$]:C},touched:{...k.touched,[$]:!0}})),C===null},[]),M=a.useCallback(async()=>{const $=Object.keys(p.current),z=await Promise.all($.map(async A=>{const D=p.current[A],O=x.current.values[A],W=await yn(O,D.rules);return{name:A,error:W}})),E={},C={};let k=!1;for(const{name:A,error:D}of z)E[A]=D,C[A]=!0,D&&(k=!0);if(s(A=>({...A,errors:{...A.errors,...E},touched:{...A.touched,...C}})),k){const A=Object.fromEntries(z.filter(D=>D.error).map(D=>[D.name,D.error]));return Promise.reject(A)}return{...x.current.values}},[]),N=a.useCallback(()=>{s({values:{...m.current},errors:{},touched:{}})},[]),j=a.useMemo(()=>({getFieldValue:$=>x.current.values[$],setFieldValue:b,getFieldsValue:()=>({...x.current.values}),setFieldsValue:$=>{s(z=>{const E={...z.values,...$};return r==null||r($,E),{...z,values:E}})},validateFields:M,validateField:S,resetFields:N,getFieldError:$=>x.current.errors[$]??null,isFieldTouched:$=>!!x.current.touched[$]}),[b,M,S,N,r]),L=a.useCallback(async $=>{$.preventDefault();try{const z=await M();await(e==null?void 0:e(z))}catch{}},[M,e]),I=h(o==="inline"?"flex flex-row flex-wrap items-end gap-4":"flex flex-col gap-5"),T=a.useMemo(()=>({state:f,initialValues:m.current,layout:o,disabled:i,fieldMeta:p,setFieldValue:b,setFieldError:g,setFieldTouched:w,registerField:y,unregisterField:v,validateField:S,instance:j}),[f,o,i,b,g,w,y,v,S,j]);return t.jsx(Cr.Provider,{value:T,children:t.jsx("form",{noValidate:!0,onSubmit:L,className:ae(I,c),style:{color:u.text,...d},children:l})})}No.displayName="TkxForm";function zo({name:e,label:r,rules:n,help:o,required:i,children:l,className:c,style:d}){const u=U(),f=fc(),{state:s,layout:m,disabled:p}=f,x=a.useMemo(()=>pc(n,i),[n,i]),y=xc(x),v=a.useRef({rules:x});v.current.rules=x;const b=a.useRef(!1);b.current||(f.registerField(e,v.current),b.current=!0),a.useMemo(()=>{f.registerField(e,v.current)},[x,e,f]);const g=s.values[e],w=s.touched[e]?s.errors[e]??null:null,S=w?R(w):null,M=r?R(r):void 0,N=o?R(o):void 0,j=a.useCallback(k=>{let A;if(k!==null&&typeof k=="object"&&"target"in k){const D=k.target;A=D.type==="checkbox"?D.checked:D.value}else A=k;f.setFieldValue(e,A)},[f,e]),L=a.useCallback(()=>{f.setFieldTouched(e),f.validateField(e)},[f,e]),I=a.cloneElement(l,{value:g??"",onChange:j,onBlur:L,error:S??void 0,isInvalid:!!S,isRequired:y,disabled:p||l.props.disabled,name:e}),T=m==="horizontal",$=m==="inline",z=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"})}),E=M?t.jsxs("label",{className:h("text-sm font-medium font-sans",T?"min-w-[140px] pt-2.5":""),style:{color:u.text},children:[M,y&&t.jsx("span",{"aria-hidden":"true",className:h("ml-1"),style:{color:u.danger},children:"*"})]}):null,C=t.jsxs(t.Fragment,{children:[N&&!S&&t.jsx("span",{className:h("text-xs mt-0.5"),style:{color:u.textMuted},children:N}),S&&t.jsxs("span",{role:"alert",className:h("text-xs flex items-center gap-1 mt-0.5"),style:{color:u.danger,animation:"tkxFormErrorReveal 200ms ease-out"},children:[z,S]})]});return $?t.jsxs("div",{className:ae(h("flex flex-col gap-1"),c),style:d,children:[E,I,C]}):T?t.jsxs("div",{className:ae(h("flex flex-row gap-4 items-start"),c),style:d,children:[E,t.jsxs("div",{className:h("flex flex-col gap-1 flex-1 min-w-0"),children:[I,C]})]}):t.jsxs("div",{className:ae(h("flex flex-col gap-1"),c),style:d,children:[E,I,C]})}zo.displayName="TkxFormField";let vn=!1;function mc(){if(vn||typeof document>"u")return;vn=!0;const e=document.createElement("style");e.setAttribute("data-tkx-form",""),e.textContent=`
115
- @keyframes tkxFormErrorReveal {
116
- from {
117
- opacity: 0;
118
- transform: translateY(-4px);
119
- }
120
- to {
121
- opacity: 1;
122
- transform: translateY(0);
123
- }
124
- }
125
- `,document.head.appendChild(e)}mc();const Lo={sm:576,md:768,lg:992,xl:1200};function Ao(e){return typeof e=="number"?`${e}px`:e}const Ro=a.createContext({h:0,v:0}),Do=a.forwardRef(({children:e,hasSider:r=!1,className:n,style:o,...i},l)=>{const c=U(),d=h("flex min-h-0 w-full font-sans"),u=r?{flexDirection:"row"}:{flexDirection:"column"};return t.jsx("section",{ref:l,className:ae("tkx-layout",d,n),style:{minHeight:"100%",color:c.text,backgroundColor:c.bg,...u,...o},...i,children:e})});Do.displayName="TkxLayout";const Bo=a.forwardRef(({children:e,height:r=64,fixed:n=!1,className:o,style:i,...l},c)=>{const d=U(),u=Ao(r),f=h("flex items-center px-6 shrink-0 w-full"),s=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return t.jsx("header",{ref:c,className:ae("tkx-layout-header",f,o),style:{height:u,minHeight:u,backgroundColor:d.surface,borderBottom:`1px solid ${d.border}`,...s,...i},...l,children:e})});Bo.displayName="TkxHeader";function gc({collapsed:e,onClick:r,color:n}){const o=te();return t.jsx("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:r,className:h("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:o?"none":"transform 200ms ease"},"aria-hidden":"true",children:t.jsx("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}const Wo=a.forwardRef(({children:e,width:r=240,collapsedWidth:n=64,collapsed:o,onCollapse:i,collapsible:l=!1,breakpoint:c,trigger:d,className:u,style:f,...s},m)=>{const p=U(),x=te(),[y,v]=a.useState(!1),b=o??y,g=a.useCallback(j=>{o===void 0&&v(j),i==null||i(j)},[o,i]);a.useEffect(()=>{if(!c)return;const j=Lo[c];if(!j)return;const L=window.matchMedia(`(max-width: ${j-1}px)`),I=T=>{g(T.matches)};return g(L.matches),L.addEventListener("change",I),()=>L.removeEventListener("change",I)},[c,g]);const w=Ao(r),S=b?`${n}px`:w,M=l&&d!==null,N=x?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return t.jsxs("aside",{ref:m,className:ae("tkx-layout-sider",h("shrink-0 overflow-hidden flex flex-col"),u),style:{width:S,minWidth:S,maxWidth:S,backgroundColor:p.surface,borderRight:`1px solid ${p.border}`,transition:N,...f},...s,children:[t.jsx("div",{className:h("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:S,transition:N},children:e}),M&&t.jsx("div",{className:h("shrink-0"),style:{borderTop:`1px solid ${p.border}`},children:d!==void 0?d:t.jsx(gc,{collapsed:b,onClick:()=>g(!b),color:p.textMuted})})]})});Wo.displayName="TkxSider";const Fo=a.forwardRef(({children:e,className:r,style:n,...o},i)=>{const l=U();return t.jsx("main",{ref:i,className:ae("tkx-layout-content",h("flex-1 min-w-0 min-h-0"),r),style:{backgroundColor:l.bg,padding:"24px",...n},...o,children:e})});Fo.displayName="TkxContent";const Po=a.forwardRef(({children:e,className:r,style:n,...o},i)=>{const l=U();return t.jsx("footer",{ref:i,className:ae("tkx-layout-footer",h("flex items-center px-6 py-4 shrink-0"),r),style:{backgroundColor:l.surface,borderTop:`1px solid ${l.border}`,color:l.textMuted,...n},...o,children:e})});Po.displayName="TkxFooter";const bc={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},yc={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Ho=a.forwardRef(({children:e,gutter:r,justify:n="start",align:o="top",wrap:i=!0,className:l,style:c,...d},u)=>{const[f,s]=Array.isArray(r)?r:[r??0,0],m=f/2,p=s/2,x=f||s?{marginLeft:-m,marginRight:-m,marginTop:-p,marginBottom:-p}:{},y={h:m,v:p};return t.jsx(Ro.Provider,{value:y,children:t.jsx("div",{ref:u,className:ae("tkx-row",h("flex w-full"),l),style:{flexWrap:i?"wrap":"nowrap",justifyContent:bc[n]??"flex-start",alignItems:yc[o]??"flex-start",...x,...c},...d,children:e})})});Ho.displayName="TkxRow";let kn=!1;function vc(){if(kn||typeof document>"u")return;kn=!0;const e=[];for(const[n,o]of Object.entries(Lo)){for(let i=1;i<=24;i++){const l=`${i/24*100}%`;e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${i} { flex: 0 0 ${l} !important; max-width: ${l} !important; } }`)}for(let i=0;i<=24;i++){const l=`${i/24*100}%`;e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${i} { margin-left: ${l} !important; } }`)}}const r=document.createElement("style");r.id="tkx-col-responsive",r.textContent=e.join(`
126
- `),document.head.appendChild(r)}function kc(e){if(e!==void 0)return typeof e=="number"?{span:e}:e}const Vo=a.forwardRef(({children:e,span:r,offset:n=0,push:o,pull:i,order:l,sm:c,md:d,lg:u,xl:f,className:s,style:m,...p},x)=>{a.useEffect(()=>{vc()},[]);const y=a.useContext(Ro),v=r!==void 0?`${r/24*100}%`:void 0,b=n?`${n/24*100}%`:void 0,g=[],w=[["sm",c],["md",d],["lg",u],["xl",f]];for(const[M,N]of w){const j=kc(N);j&&(g.push(`tkx-col-${M}-${j.span}`),j.offset!==void 0&&j.offset>0&&g.push(`tkx-col-${M}-offset-${j.offset}`))}const S={};return o!==void 0&&(S.left=`${o/24*100}%`,S.position="relative"),i!==void 0&&(S.right=`${i/24*100}%`,S.position="relative"),l!==void 0&&(S.order=l),t.jsx("div",{ref:x,className:ae("tkx-col",h("box-border min-h-[1px]"),...g,s),style:{flex:v?`0 0 ${v}`:"1",maxWidth:v??"100%",marginLeft:b,paddingLeft:y.h||void 0,paddingRight:y.h||void 0,paddingTop:y.v||void 0,paddingBottom:y.v||void 0,...S,...m},...p,children:e})});Vo.displayName="TkxCol";const wc={size:"md",variant:"default",animation:!0,bordered:!0},jc={locale:"en-US",direction:"ltr",componentDefaults:wc,componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0},xr=a.createContext(jc);function Oo({children:e,locale:r,direction:n,componentDefaults:o,componentOverrides:i,prefixCls:l}){const c=a.useContext(xr),d=a.useMemo(()=>({size:(o==null?void 0:o.size)??c.componentDefaults.size,variant:(o==null?void 0:o.variant)??c.componentDefaults.variant,animation:(o==null?void 0:o.animation)??c.componentDefaults.animation,bordered:(o==null?void 0:o.bordered)??c.componentDefaults.bordered}),[o,c.componentDefaults]),u=a.useMemo(()=>{const g=c.componentOverrides,w=i??{};return{button:{...g.button,...w.button},input:{...g.input,...w.input},table:{...g.table,...w.table},modal:{...g.modal,...w.modal}}},[i,c.componentOverrides]),f=r??c.locale,s=n??c.direction,m=l??c.prefixCls,p=a.useCallback(g=>`${m}-${g}`,[m]),x=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const S=u[g];if(S!=null&&S.size)return S.size}return d.size},[d.size,u]),y=a.useCallback(g=>g!==void 0?g:d.animation,[d.animation]),v=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const S=u[g];if((S==null?void 0:S.bordered)!==void 0)return S.bordered}return d.bordered},[d.bordered,u]),b=a.useMemo(()=>({locale:f,direction:s,componentDefaults:d,componentOverrides:u,prefixCls:m,configured:!0,cls:p,getSize:x,getAnimation:y,getBordered:v}),[f,s,d,u,m,p,x,y,v]);return t.jsx(xr.Provider,{value:b,children:t.jsx("div",{dir:s,lang:f,className:`${m}-config-root`,style:{direction:s},children:e})})}Oo.displayName="TkxConfigProvider";function zt(){return a.useContext(xr)}function Sc(e,r){const{prefixCls:n}=zt();return`${r??n}-${e}`}function $c(e,r){const{getSize:n}=zt();return n(e,r)}const Mc={sm:32,md:40,lg:48},Cc={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Tc={sm:8,md:12,lg:16},Ec={sm:4,md:8,lg:12},Ic={sm:4,md:6,lg:8},Nc={sm:14,md:16,lg:20};function zc(){const{direction:e}=zt();if(e==="rtl")return{transform:"scaleX(-1)"}}function Lc(e,r=0){const{direction:n}=zt(),o=typeof e=="number"?`${e}px`:e,i=typeof r=="number"?`${r}px`:r;return n==="rtl"?{marginRight:o,marginLeft:i}:{marginLeft:o,marginRight:i}}const wn={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},jn=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function Ac(e){return jn.has(e)||jn.has(e.split("-")[0])}function Rc(e){if(wn[e])return wn[e];if(typeof Intl<"u"&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e}function Nt(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(Nt).join(""):e&&typeof e=="object"&&"props"in e?Nt(e.props.children):""}function Tr({text:e}){const r=U(),[n,o]=a.useState(!1),i=a.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},[e]);return a.createElement("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?r.success:r.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function _o(e="default"){const r=U();return{default:r.text,secondary:r.textMuted,success:r.success,warning:r.warning,danger:r.danger}[e]}const Dc={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}};function Bc({level:e=1,children:r,copyable:n=!1,type:o="default",style:i}){const l=_o(o);U();const c=Dc[e],d=`h${e}`,u=typeof r=="string"?R(r):r,f=Nt(r);return a.createElement(d,{style:{color:l,fontSize:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...i}},u,n&&a.createElement(Tr,{text:f}))}function Wc({children:e,type:r="default",strong:n=!1,italic:o=!1,underline:i=!1,delete:l=!1,code:c=!1,mark:d=!1,copyable:u=!1,style:f}){const s=_o(r),m=U(),p=Nt(e),x=typeof e=="string"?R(e):e,y=[];i&&y.push("underline"),l&&y.push("line-through");let v=x;return c&&(v=a.createElement("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:"4px",fontFamily:"monospace"}},v)),d&&(v=a.createElement("mark",{style:{backgroundColor:`${m.warning}33`,color:s,padding:"0 2px",borderRadius:"2px"}},v)),a.createElement("span",{style:{color:s,fontWeight:n?600:"inherit",fontStyle:o?"italic":"normal",textDecoration:y.length>0?y.join(" "):"none",...f}},v,u&&a.createElement(Tr,{text:p}))}function Fc({children:e,type:r="default",copyable:n=!1,ellipsis:o=!1,style:i}){const l=U(),c=r==="secondary"?l.textMuted:l.text,d=Nt(e),u=typeof e=="string"?R(e):e,f={};if(o){const s=typeof o=="object"?o.rows??3:3;f.display="-webkit-box",f.WebkitLineClamp=s,f.WebkitBoxOrient="vertical",f.overflow="hidden"}return a.createElement("div",{style:{color:c,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...f,...i}},u,n&&a.createElement(Tr,{text:d}))}const Pc={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}};let Sn=!1;function Hc(){if(Sn||typeof document>"u")return;Sn=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent=`
113
+ `,document.head.appendChild(c)},[]),e.jsx("article",{"aria-label":"Rich text content",className:s.tkx("font-sans",r??""),style:{color:i.text,maxWidth:720,...n},children:l})}const yn={sm:576,md:768,lg:992,xl:1200};function kn(t){return typeof t=="number"?`${t}px`:t}const vn=a.createContext({h:0,v:0}),wn=a.forwardRef(({children:t,hasSider:r=!1,className:n,style:i,...o},l)=>{const c=B.useTheme(),d=s.tkx("flex min-h-0 w-full font-sans"),u=r?{flexDirection:"row"}:{flexDirection:"column"};return e.jsx("section",{ref:l,className:s.cx("tkx-layout",d,n),style:{minHeight:"100%",color:c.text,backgroundColor:c.bg,...u,...i},...o,children:t})});wn.displayName="TkxLayout";const jn=a.forwardRef(({children:t,height:r=64,fixed:n=!1,className:i,style:o,...l},c)=>{const d=B.useTheme(),u=kn(r),x=s.tkx("flex items-center px-6 shrink-0 w-full"),f=n?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return e.jsx("header",{ref:c,className:s.cx("tkx-layout-header",x,i),style:{height:u,minHeight:u,backgroundColor:d.surface,borderBottom:`1px solid ${d.border}`,...f,...o},...l,children:t})});jn.displayName="TkxHeader";function Ma({collapsed:t,onClick:r,color:n}){const i=s.useReducedMotion();return e.jsx("button",{type:"button","aria-label":t?"Expand sidebar":"Collapse sidebar",onClick:r,className:s.tkx("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:n},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:t?"rotate(0deg)":"rotate(180deg)",transition:i?"none":"transform 200ms ease"},"aria-hidden":"true",children:e.jsx("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}const Sn=a.forwardRef(({children:t,width:r=240,collapsedWidth:n=64,collapsed:i,onCollapse:o,collapsible:l=!1,breakpoint:c,trigger:d,className:u,style:x,...f},m)=>{const p=B.useTheme(),h=s.useReducedMotion(),[y,k]=a.useState(!1),b=i??y,g=a.useCallback(v=>{i===void 0&&k(v),o==null||o(v)},[i,o]);a.useEffect(()=>{if(!c)return;const v=yn[c];if(!v)return;const N=window.matchMedia(`(max-width: ${v-1}px)`),C=M=>{g(M.matches)};return g(N.matches),N.addEventListener("change",C),()=>N.removeEventListener("change",C)},[c,g]);const w=kn(r),j=b?`${n}px`:w,S=l&&d!==null,z=h?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return e.jsxs("aside",{ref:m,className:s.cx("tkx-layout-sider",s.tkx("shrink-0 overflow-hidden flex flex-col"),u),style:{width:j,minWidth:j,maxWidth:j,backgroundColor:p.surface,borderRight:`1px solid ${p.border}`,transition:z,...x},...f,children:[e.jsx("div",{className:s.tkx("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:j,transition:z},children:t}),S&&e.jsx("div",{className:s.tkx("shrink-0"),style:{borderTop:`1px solid ${p.border}`},children:d!==void 0?d:e.jsx(Ma,{collapsed:b,onClick:()=>g(!b),color:p.textMuted})})]})});Sn.displayName="TkxSider";const Cn=a.forwardRef(({children:t,className:r,style:n,...i},o)=>{const l=B.useTheme();return e.jsx("main",{ref:o,className:s.cx("tkx-layout-content",s.tkx("flex-1 min-w-0 min-h-0"),r),style:{backgroundColor:l.bg,padding:"24px",...n},...i,children:t})});Cn.displayName="TkxContent";const Tn=a.forwardRef(({children:t,className:r,style:n,...i},o)=>{const l=B.useTheme();return e.jsx("footer",{ref:o,className:s.cx("tkx-layout-footer",s.tkx("flex items-center px-6 py-4 shrink-0"),r),style:{backgroundColor:l.surface,borderTop:`1px solid ${l.border}`,color:l.textMuted,...n},...i,children:t})});Tn.displayName="TkxFooter";const $a={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},za={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},Mn=a.forwardRef(({children:t,gutter:r,justify:n="start",align:i="top",wrap:o=!0,className:l,style:c,...d},u)=>{const[x,f]=Array.isArray(r)?r:[r??0,0],m=x/2,p=f/2,h=x||f?{marginLeft:-m,marginRight:-m,marginTop:-p,marginBottom:-p}:{},y={h:m,v:p};return e.jsx(vn.Provider,{value:y,children:e.jsx("div",{ref:u,className:s.cx("tkx-row",s.tkx("flex w-full"),l),style:{flexWrap:o?"wrap":"nowrap",justifyContent:$a[n]??"flex-start",alignItems:za[i]??"flex-start",...h,...c},...d,children:t})})});Mn.displayName="TkxRow";let Nr=!1;function Ia(){if(Nr||typeof document>"u")return;Nr=!0;const t=[];for(const[n,i]of Object.entries(yn)){for(let o=1;o<=24;o++){const l=`${o/24*100}%`;t.push(`@media (min-width: ${i}px) { .tkx-col-${n}-${o} { flex: 0 0 ${l} !important; max-width: ${l} !important; } }`)}for(let o=0;o<=24;o++){const l=`${o/24*100}%`;t.push(`@media (min-width: ${i}px) { .tkx-col-${n}-offset-${o} { margin-left: ${l} !important; } }`)}}const r=document.createElement("style");r.id="tkx-col-responsive",r.textContent=t.join(`
114
+ `),document.head.appendChild(r)}function Ea(t){if(t!==void 0)return typeof t=="number"?{span:t}:t}const $n=a.forwardRef(({children:t,span:r,offset:n=0,push:i,pull:o,order:l,sm:c,md:d,lg:u,xl:x,className:f,style:m,...p},h)=>{a.useEffect(()=>{Ia()},[]);const y=a.useContext(vn),k=r!==void 0?`${r/24*100}%`:void 0,b=n?`${n/24*100}%`:void 0,g=[],w=[["sm",c],["md",d],["lg",u],["xl",x]];for(const[S,z]of w){const v=Ea(z);v&&(g.push(`tkx-col-${S}-${v.span}`),v.offset!==void 0&&v.offset>0&&g.push(`tkx-col-${S}-offset-${v.offset}`))}const j={};return i!==void 0&&(j.left=`${i/24*100}%`,j.position="relative"),o!==void 0&&(j.right=`${o/24*100}%`,j.position="relative"),l!==void 0&&(j.order=l),e.jsx("div",{ref:h,className:s.cx("tkx-col",s.tkx("box-border min-h-[1px]"),...g,f),style:{flex:k?`0 0 ${k}`:"1",maxWidth:k??"100%",marginLeft:b,paddingLeft:y.h||void 0,paddingRight:y.h||void 0,paddingTop:y.v||void 0,paddingBottom:y.v||void 0,...j,...m},...p,children:t})});$n.displayName="TkxCol";const Na={size:"md",variant:"default",animation:!0,bordered:!0},Ra={locale:"en-US",direction:"ltr",componentDefaults:Na,componentOverrides:{},prefixCls:"tkx",configured:!1,cls:t=>`tkx-${t}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0},Vt=a.createContext(Ra);function zn({children:t,locale:r,direction:n,componentDefaults:i,componentOverrides:o,prefixCls:l}){const c=a.useContext(Vt),d=a.useMemo(()=>({size:(i==null?void 0:i.size)??c.componentDefaults.size,variant:(i==null?void 0:i.variant)??c.componentDefaults.variant,animation:(i==null?void 0:i.animation)??c.componentDefaults.animation,bordered:(i==null?void 0:i.bordered)??c.componentDefaults.bordered}),[i,c.componentDefaults]),u=a.useMemo(()=>{const g=c.componentOverrides,w=o??{};return{button:{...g.button,...w.button},input:{...g.input,...w.input},table:{...g.table,...w.table},modal:{...g.modal,...w.modal}}},[o,c.componentOverrides]),x=r??c.locale,f=n??c.direction,m=l??c.prefixCls,p=a.useCallback(g=>`${m}-${g}`,[m]),h=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const j=u[g];if(j!=null&&j.size)return j.size}return d.size},[d.size,u]),y=a.useCallback(g=>g!==void 0?g:d.animation,[d.animation]),k=a.useCallback((g,w)=>{if(w!==void 0)return w;if(g){const j=u[g];if((j==null?void 0:j.bordered)!==void 0)return j.bordered}return d.bordered},[d.bordered,u]),b=a.useMemo(()=>({locale:x,direction:f,componentDefaults:d,componentOverrides:u,prefixCls:m,configured:!0,cls:p,getSize:h,getAnimation:y,getBordered:k}),[x,f,d,u,m,p,h,y,k]);return e.jsx(Vt.Provider,{value:b,children:e.jsx("div",{dir:f,lang:x,className:`${m}-config-root`,style:{direction:f},children:t})})}zn.displayName="TkxConfigProvider";function mt(){return a.useContext(Vt)}function La(t,r){const{prefixCls:n}=mt();return`${r??n}-${t}`}function Da(t,r){const{getSize:n}=mt();return n(t,r)}const Aa={sm:32,md:40,lg:48},Pa={sm:"0.75rem",md:"0.875rem",lg:"1rem"},Ba={sm:8,md:12,lg:16},Fa={sm:4,md:8,lg:12},Wa={sm:4,md:6,lg:8},Ha={sm:14,md:16,lg:20};function Va(){const{direction:t}=mt();if(t==="rtl")return{transform:"scaleX(-1)"}}function Oa(t,r=0){const{direction:n}=mt(),i=typeof t=="number"?`${t}px`:t,o=typeof r=="number"?`${r}px`:r;return n==="rtl"?{marginRight:i,marginLeft:o}:{marginLeft:i,marginRight:o}}const Rr={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},Lr=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function _a(t){return Lr.has(t)||Lr.has(t.split("-")[0])}function Ya(t){if(Rr[t])return Rr[t];if(typeof Intl<"u"&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(t)??t}catch{return t}return t}function ht(t){return typeof t=="string"?t:typeof t=="number"?String(t):Array.isArray(t)?t.map(ht).join(""):t&&typeof t=="object"&&"props"in t?ht(t.props.children):""}function Yt({text:t}){const r=B.useTheme(),[n,i]=a.useState(!1),o=a.useCallback(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[t]);return a.createElement("button",{type:"button",onClick:o,"aria-label":n?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:n?r.success:r.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},n?"Copied!":"⎘")}function In(t="default"){const r=B.useTheme();return{default:r.text,secondary:r.textMuted,success:r.success,warning:r.warning,danger:r.danger}[t]}const Ua={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}};function Ka({level:t=1,children:r,copyable:n=!1,type:i="default",style:o}){const l=In(i);B.useTheme();const c=Ua[t],d=`h${t}`,u=typeof r=="string"?s.sanitizeString(r):r,x=ht(r);return a.createElement(d,{style:{color:l,fontSize:c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...o}},u,n&&a.createElement(Yt,{text:x}))}function Xa({children:t,type:r="default",strong:n=!1,italic:i=!1,underline:o=!1,delete:l=!1,code:c=!1,mark:d=!1,copyable:u=!1,style:x}){const f=In(r),m=B.useTheme(),p=ht(t),h=typeof t=="string"?s.sanitizeString(t):t,y=[];o&&y.push("underline"),l&&y.push("line-through");let k=h;c&&(k=a.createElement("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:"4px",fontFamily:"monospace"}},k)),d&&(k=a.createElement("mark",{style:{backgroundColor:`${m.warning}33`,color:f,padding:"0 2px",borderRadius:"2px"}},k));const b=n?"strong":i?"em":"span";return a.createElement(b,{style:{color:f,fontStyle:i?"italic":"normal",textDecoration:y.length>0?y.join(" "):"none",...x}},k,u&&a.createElement(Yt,{text:p}))}function qa({children:t,type:r="default",copyable:n=!1,ellipsis:i=!1,style:o}){const l=B.useTheme(),c=r==="secondary"?l.textMuted:l.text,d=ht(t),u=typeof t=="string"?s.sanitizeString(t):t,x={};if(i){const f=typeof i=="object"?i.rows??3:3;x.display="-webkit-box",x.WebkitLineClamp=f,x.WebkitBoxOrient="vertical",x.overflow="hidden"}return a.createElement("div",{style:{color:c,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...x,...o}},u,n&&a.createElement(Yt,{text:d}))}const Za={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}};let Dr=!1;function Ga(){if(Dr||typeof document>"u")return;Dr=!0;const t=document.createElement("style");t.id="tkx-spin-styles",t.textContent=`
127
115
  @keyframes tkx-spin-rotate {
128
116
  0% { transform: rotate(0deg); }
129
117
  100% { transform: rotate(360deg); }
130
118
  }
131
- `,document.head.appendChild(e)}function Vc({size:e,color:r}){return a.createElement("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},a.createElement("circle",{cx:12,cy:12,r:10,stroke:`${r}33`,strokeWidth:2.5,fill:"none"}),a.createElement("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:r,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function Oc({size:e,borderWidth:r,color:n,reducedMotion:o}){return o?a.createElement(Vc,{size:e,color:n}):(Hc(),a.createElement("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${r}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function _c({spinning:e=!0,size:r="md",tip:n,indicator:o,children:i,fullscreen:l=!1,delay:c=0,style:d}){const u=U(),f=te(),[s,m]=a.useState(c===0&&e),p=a.useRef(null);if(a.useEffect(()=>(e&&c>0?p.current=setTimeout(()=>m(!0),c):m(e),()=>{p.current!==null&&clearTimeout(p.current)}),[e,c]),!s)return i?a.createElement("div",{style:d},i):null;const x=Pc[r],y=n?R(n):void 0,v=a.createElement("div",{role:"status","aria-live":"polite","aria-label":y??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},o??a.createElement(Oc,{size:x.dimension,borderWidth:x.borderWidth,color:u.primary,reducedMotion:f}),y&&a.createElement("span",{style:{color:u.primary,fontSize:x.fontSize,marginTop:"4px"}},y));return l?a.createElement("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}cc`,zIndex:9999,...d}},v):i?a.createElement("div",{style:{position:"relative",...d}},a.createElement("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:f?"none":"opacity 0.2s, filter 0.2s"}},i),a.createElement("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}66`,borderRadius:"4px"}},v)):a.createElement("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...d}},v)}function Yc({color:e,mutedColor:r}){return a.createElement("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},a.createElement("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${r}18`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${r}10`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${r}0d`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),a.createElement("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function Uc({mutedColor:e}){return a.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},a.createElement("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),a.createElement("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),a.createElement("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function Kc({image:e="default",description:r="No data",children:n,style:o}){const i=U(),l=typeof r=="string"?R(r):r;let c;return e==="default"?c=a.createElement(Yc,{color:i.primary,mutedColor:i.textMuted}):e==="simple"?c=a.createElement(Uc,{mutedColor:i.textMuted}):c=e,a.createElement("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...o}},a.createElement("div",{style:{marginBottom:"12px",opacity:.85}},c),l&&a.createElement("div",{style:{color:i.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},l),n&&a.createElement("div",{style:{marginTop:"16px"}},n))}function Xc(e,r,n=","){if(typeof e=="string")return e;const o=r!==void 0?e.toFixed(r):String(e),[i,l]=o.split("."),c=i.replace(/\B(?=(\d{3})+(?!\d))/g,n);return l!==void 0?`${c}.${l}`:c}function qc(e,r){if(e<=0)return r.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),i=Math.floor(n%86400/3600),l=Math.floor(n%3600/60),c=n%60,d=u=>String(u).padStart(2,"0");return r.replace(/DD/g,d(o)).replace(/D/g,String(o)).replace(/HH/g,d(i)).replace(/H/g,String(i)).replace(/mm/g,d(l)).replace(/m/g,String(l)).replace(/ss/g,d(c)).replace(/s/g,String(c))}function Zc({direction:e,color:r}){const n=e==="up"?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4";return a.createElement("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},a.createElement("path",{d:n,stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}let $n=!1;function Gc(){if($n||typeof document>"u")return;$n=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}function Jc({w:e,h:r,alt:n,bdr:o,rm:i}){return i||Gc(),a.createElement("div",{"aria-hidden":"true",style:{width:e,height:r,borderRadius:"4px",background:i?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:i?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function Qc({title:e,value:r,prefix:n,suffix:o,precision:i,groupSeparator:l=",",valueStyle:c,loading:d=!1,trend:u,trendValue:f,style:s}){const m=U(),p=te(),x=R(e),y=f?R(f):void 0,v=u==="up"?m.success:u==="down"?m.danger:void 0;return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...s}},a.createElement("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},x),d?a.createElement(Jc,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:p}):a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},n&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},n),a.createElement("span",null,Xc(r,i,l)),o&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},o)),u&&a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:v,marginTop:"2px"}},a.createElement(Zc,{direction:u,color:v}),y&&a.createElement("span",null,y)))}function ed({title:e,value:r,format:n="HH:mm:ss",onFinish:o,prefix:i,suffix:l,style:c}){const d=U(),u=R(e),f=a.useRef(o);f.current=o;const s=a.useRef(!1),[m,p]=a.useState(()=>Math.max(0,r-Date.now()));a.useEffect(()=>{s.current=!1;const y=()=>{var g;const b=Math.max(0,r-Date.now());p(b),b<=0&&!s.current&&(s.current=!0,(g=f.current)==null||g.call(f))};y();const v=setInterval(y,1e3);return()=>clearInterval(v)},[r]);const x=qc(m,n);return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},a.createElement("div",{style:{color:d.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},u),a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m<=0?d.danger:d.text,fontVariantNumeric:"tabular-nums"}},i&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},i),a.createElement("span",null,x),l&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:d.textMuted}},l)))}const td={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function rd({options:e,value:r,onChange:n,size:o="md",block:i=!1}){const l=U(),c=te(),d=a.useRef(null),[u,f]=a.useState(()=>Math.max(0,e.findIndex(v=>v.value===r))),[s,m]=a.useState({}),p=td[o];a.useEffect(()=>{const v=e.findIndex(b=>b.value===r);v>=0&&f(v)},[r,e]),a.useEffect(()=>{const v=d.current;if(!v)return;const g=v.querySelectorAll("[data-seg-btn]")[u];g&&m({left:g.offsetLeft,width:g.offsetWidth,height:g.offsetHeight,transition:c?"none":"left 0.2s ease, width 0.2s ease"})},[u,e,c]);const x=a.useCallback(v=>{const b=e[v];!b||b.disabled||(f(v),n==null||n(b.value))},[e,n]),y=a.useCallback(v=>{var g,w,S;let b=u;if(v.key==="ArrowRight"||v.key==="ArrowDown")for(v.preventDefault(),b=(u+1)%e.length;(g=e[b])!=null&&g.disabled&&b!==u;)b=(b+1)%e.length;else if(v.key==="ArrowLeft"||v.key==="ArrowUp")for(v.preventDefault(),b=(u-1+e.length)%e.length;(w=e[b])!=null&&w.disabled&&b!==u;)b=(b-1+e.length)%e.length;if(b!==u){x(b);const M=d.current,N=M==null?void 0:M.querySelectorAll("[data-seg-btn]");(S=N==null?void 0:N[b])==null||S.focus()}},[u,e,x]);return t.jsxs("div",{ref:d,role:"radiogroup","aria-label":"Segmented control",className:h("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:l.surfaceAlt,border:`1px solid ${l.border}`,width:i?"100%":void 0},onKeyDown:y,children:[t.jsx("div",{"aria-hidden":"true",className:h("absolute top-1 rounded-md"),style:{...s,backgroundColor:l.surface,boxShadow:`0 1px 3px ${l.border}`,zIndex:0}}),e.map((v,b)=>{const g=b===u,w=R(v.label);return t.jsxs("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":g,"aria-disabled":v.disabled||void 0,disabled:v.disabled,tabIndex:g?0:-1,className:h("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:p.height,fontSize:p.fontSize,padding:`0 ${p.px}px`,flex:i?1:void 0,color:g?l.text:l.textMuted,backgroundColor:"transparent",opacity:v.disabled?.4:1,fontWeight:g?600:400,transition:c?"none":"color 0.15s ease"},onClick:()=>x(b),children:[v.icon&&t.jsx("span",{"aria-hidden":"true",children:v.icon}),w]},v.value)})]})}function nd({options:e,value:r="",onChange:n,trigger:o="@",placeholder:i,label:l}){const c=U(),d=te(),u=a.useRef(null),f=a.useRef(null),[s,m]=a.useState(r),[p,x]=a.useState(!1),[y,v]=a.useState(""),[b,g]=a.useState(0),[w,S]=a.useState(-1);a.useEffect(()=>{r!==void 0&&m(r)},[r]);const M=e.filter($=>$.label.toLowerCase().includes(y.toLowerCase())),N=a.useCallback($=>{const z=$.target.value;m(z),n==null||n(z);const E=$.target.selectionStart??z.length,C=z.slice(0,E),k=C.lastIndexOf(o);if(k>=0){const A=C.slice(k+o.length);if(!/\s/.test(A)){v(A),S(k),x(!0),g(0);return}}x(!1)},[o,n]),j=a.useCallback($=>{var k;const z=s.slice(0,w),E=s.slice(w+o.length+y.length),C=`${z}${o}${$.value} ${E}`;m(C),n==null||n(C),x(!1),(k=u.current)==null||k.focus()},[s,w,o,y,n]),L=a.useCallback($=>{p&&($.key==="ArrowDown"?($.preventDefault(),g(z=>(z+1)%M.length)):$.key==="ArrowUp"?($.preventDefault(),g(z=>(z-1+M.length)%M.length)):$.key==="Enter"&&M[b]?($.preventDefault(),j(M[b])):$.key==="Escape"&&x(!1))},[p,M,b,j]);a.useEffect(()=>{if(!p||!f.current)return;const $=f.current.children[b];$==null||$.scrollIntoView({block:"nearest"})},[b,p]);const I=l?R(l):void 0,T=i?R(i):void 0;return t.jsxs("div",{className:h("relative font-sans"),style:{width:"100%"},children:[I&&t.jsx("label",{className:h("block text-sm font-medium mb-1"),style:{color:c.text},children:I}),t.jsx("textarea",{ref:u,role:"combobox","aria-expanded":p,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":I??"Mentions input",value:s,placeholder:T,onChange:N,onKeyDown:L,onBlur:()=>setTimeout(()=>x(!1),200),className:h("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:c.surface,borderColor:c.border,color:c.text,minHeight:80,outline:"none"},rows:3}),p&&M.length>0&&t.jsx("ul",{ref:f,role:"listbox","aria-label":"Mention suggestions",className:h("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:c.surface,borderColor:c.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:M.map(($,z)=>t.jsxs("li",{role:"option","aria-selected":z===b,className:h("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:z===b?c.surfaceAlt:"transparent",color:c.text},onMouseDown:E=>{E.preventDefault(),j($)},onMouseEnter:()=>g(z),children:[$.avatar&&t.jsx("img",{src:R($.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:h("rounded-full"),style:{objectFit:"cover"}}),t.jsx("span",{children:R($.label)}),t.jsxs("span",{style:{color:c.textMuted,marginLeft:"auto"},children:[o,R($.value)]})]},$.value))})]})}function od(e){let r=5381;for(let n=0;n<e.length;n++)r=(r<<5)+r+e.charCodeAt(n)|0;return Math.abs(r)}function sd(e){let r=e;return()=>(r=r*1664525+1013904223|0,(r>>>0)/4294967295)}const id={L:.38,M:.42,Q:.48,H:.55};function ad(e,r,n){const o=od(e),i=sd(o),l=id[n]??.42,c=Array.from({length:r},()=>Array.from({length:r},()=>!1)),d=(u,f)=>{for(let s=0;s<7;s++)for(let m=0;m<7;m++){const p=s===0||s===6||m===0||m===6,x=s>=2&&s<=4&&m>=2&&m<=4;c[u+s][f+m]=p||x}};d(0,0),d(0,r-7),d(r-7,0);for(let u=7;u<r-7;u++)c[6][u]=u%2===0,c[u][6]=u%2===0;for(let u=0;u<r;u++)for(let f=0;f<r;f++)u<8&&f<8||u<8&&f>=r-8||u>=r-8&&f<8||(u===6||f===6)||(c[u][f]=i()<l);return c}function ld({value:e,size:r=160,color:n,bgColor:o,errorLevel:i="M",icon:l,bordered:c=!0}){const d=U(),u=te(),f=a.useRef(null),s=R(e),m=n??d.text,p=o??d.surface,x=25,y=a.useMemo(()=>ad(s,x,i),[s,i]);return a.useEffect(()=>{const v=f.current;if(!v)return;const b=v.getContext("2d");if(!b)return;const g=window.devicePixelRatio||1;v.width=r*g,v.height=r*g,b.scale(g,g);const w=r/x;b.fillStyle=p,b.fillRect(0,0,r,r),b.fillStyle=m;for(let S=0;S<x;S++)for(let M=0;M<x;M++)y[S][M]&&b.fillRect(M*w,S*w,w,w);if(l){const S=r*.22,M=(r-S)/2;b.fillStyle=p,b.fillRect(M-2,M-2,S+4,S+4);const N=new Image;N.crossOrigin="anonymous",N.onload=()=>{b.drawImage(N,M,M,S,S)},N.src=R(l)}},[y,r,m,p,l]),t.jsx("div",{role:"img","aria-label":`QR code for: ${s}`,className:h("inline-block rounded-lg"),style:{padding:c?12:0,backgroundColor:c?p:"transparent",border:c?`1px solid ${d.border}`:"none",lineHeight:0,animation:u?"none":"tkxFadeIn 0.2s ease"},children:t.jsx("canvas",{ref:f,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})}const cd={success:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),t.jsx("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),t.jsx("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),t.jsx("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>t.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),t.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function dd(e,r){switch(e){case"success":return r.success;case"error":case"500":return r.danger;case"warning":return r.warning;case"info":return r.info;case"404":case"403":return r.textMuted}}function ud({status:e,title:r,subTitle:n,icon:o,extra:i}){const l=U(),c=te(),d=dd(e,l),u=R(r),f=n?R(n):void 0;return t.jsxs("div",{role:"status","aria-live":"polite",className:h("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[t.jsx("div",{className:h("mb-6"),children:o??cd[e](d)}),t.jsx("h2",{className:h("text-xl font-semibold m-0 mb-2"),style:{color:l.text},children:u}),f&&t.jsx("p",{className:h("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:l.textMuted},children:f}),i&&t.jsx("div",{className:h("flex items-center gap-3 mt-4"),children:i})]})}function fd(e){const r=document.querySelector(e);return r?r.getBoundingClientRect():null}function pd(e,r,n,o){switch(r){case"top":return{top:e.top-o-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"bottom":return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"left":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.left-n-12+window.scrollX};case"right":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}function xd({steps:e,isOpen:r=!1,onClose:n,current:o,onChange:i}){const l=U(),c=te(),[d,u]=a.useState(0),f=o??d,s=a.useRef(null),[m,p]=a.useState({top:0,left:0}),[x,y]=a.useState(null),v=e[f],b=a.useCallback(()=>{if(!v)return;const T=fd(v.target);if(y(T),T&&s.current){const $=s.current.offsetWidth,z=s.current.offsetHeight;p(pd(T,v.placement??"bottom",$,z))}},[v]);a.useEffect(()=>{if(r)return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[r,f,b]),a.useEffect(()=>{var T;r&&((T=s.current)==null||T.focus())},[r,f]);const g=a.useCallback(T=>{u(T),i==null||i(T)},[i]),w=a.useCallback(()=>{f<e.length-1?g(f+1):n==null||n()},[f,e.length,g,n]),S=a.useCallback(()=>{f>0&&g(f-1)},[f,g]);if(!r||!v)return null;const M=6,N=R(v.title),j=R(v.description),I=t.jsxs("div",{"aria-hidden":"true",children:[t.jsx("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:x?`polygon(0% 0%, 0% 100%, ${x.left-M}px 100%, ${x.left-M}px ${x.top-M}px, ${x.right+M}px ${x.top-M}px, ${x.right+M}px ${x.bottom+M}px, ${x.left-M}px ${x.bottom+M}px, ${x.left-M}px 100%, 100% 100%, 100% 0%)`:void 0,transition:c?"none":"clip-path 0.25s ease"},onClick:n}),t.jsxs("div",{ref:s,role:"dialog","aria-modal":"true","aria-label":`Tour step ${f+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:m.top,left:m.left,width:300,backgroundColor:l.surface,border:`1px solid ${l.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${l.bg}80`,animation:c?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:T=>{T.key==="Escape"&&(n==null||n())},children:[t.jsx("h3",{className:h("m-0 mb-2 text-base font-semibold"),style:{color:l.text},children:N}),t.jsx("p",{className:h("m-0 mb-4 text-sm leading-relaxed"),style:{color:l.textMuted},children:j}),t.jsx("div",{className:h("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((T,$)=>t.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:$===f?l.primary:l.border,transition:c?"none":"background-color 0.2s"}},$))}),t.jsxs("div",{className:h("flex items-center justify-between gap-2"),children:[t.jsx("button",{type:"button","aria-label":"Skip tour",onClick:n,className:h("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:l.textMuted},children:"Skip"}),t.jsxs("div",{className:h("flex gap-2"),children:[f>0&&t.jsx("button",{type:"button","aria-label":"Previous step",onClick:S,className:h("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:l.border,color:l.text},children:"Prev"}),t.jsx("button",{type:"button","aria-label":f===e.length-1?"Finish tour":"Next step",onClick:w,className:h("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:l.primary,color:"#fff"},children:f===e.length-1?"Finish":"Next"})]})]})]})]});return Ne.createPortal(I,document.body)}function hd(e,r,n,o,i){const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return"";const d=o*1.5,u=e.length*d,f=Math.max(...e.map(x=>x.length))*o*.6,s=n[0]+f,m=n[1]+u,p=2;return l.width=s*p,l.height=m*p,c.scale(p,p),c.translate(s/2,m/2),c.rotate(r*Math.PI/180),c.font=`${o}px sans-serif`,c.fillStyle=i,c.textAlign="center",c.textBaseline="middle",e.forEach((x,y)=>{const v=(y-(e.length-1)/2)*d;c.fillText(x,0,v)}),l.toDataURL()}function md({text:e,children:r,rotate:n=-22,gap:o=[100,100],fontSize:i=14,color:l,zIndex:c=10}){const d=U(),u=te(),f=a.useRef(null),[s,m]=a.useState(""),p=a.useMemo(()=>(Array.isArray(e)?e:[e]).map(v=>R(v)),[e]),x=l??`${d.textMuted}22`,y=a.useCallback(()=>hd(p,n,o,i,x),[p,n,o,i,x]);return a.useEffect(()=>{const v=y();v&&m(`url(${v})`)},[y]),a.useEffect(()=>{var g;const v=(g=f.current)==null?void 0:g.querySelector("[data-watermark]");if(!v)return;const b=new MutationObserver(()=>{const w=y();w&&(v.style.backgroundImage=`url(${w})`)});return b.observe(v,{attributes:!0,attributeFilter:["style"]}),()=>b.disconnect()},[y]),t.jsxs("div",{ref:f,className:h("relative"),style:{overflow:"hidden"},children:[r,t.jsx("div",{"data-watermark":!0,"aria-hidden":"true",className:h("absolute inset-0 pointer-events-none"),style:{zIndex:c,backgroundImage:s,backgroundRepeat:"repeat",animation:u?"none":"tkxFadeIn 0.3s ease"}})]})}function Mn(e){if(e)try{return e()}catch{return window}return window}function gd(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const r=e.getBoundingClientRect();return{top:r.top,bottom:r.bottom}}function bd({children:e,offsetTop:r,offsetBottom:n,onChange:o,target:i}){const l=U(),c=te(),d=a.useRef(null),u=a.useRef(null),[f,s]=a.useState(!1),[m,p]=a.useState({width:0,height:0}),x=a.useRef(!1),y=a.useMemo(()=>R("Sticky content"),[]),v=a.useCallback(()=>{const w=d.current;if(!w)return;const S=w.getBoundingClientRect(),M=gd(Mn(i));let N=!1;r!==void 0?N=S.top-M.top<=r:n!==void 0&&(N=M.bottom-S.bottom<=n),N!==x.current&&(x.current=N,s(N),p({width:S.width,height:S.height}),o==null||o(N))},[r,n,o,i]);a.useEffect(()=>{const w=Mn(i);return v(),w.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{w.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,i]);const b=f?{position:"fixed",zIndex:100,...r!==void 0?{top:r}:{},...n!==void 0?{bottom:n}:{},width:m.width||void 0,transition:c?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${l.border}`}:{},g=f?{height:m.height,width:m.width}:{};return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:d,"aria-hidden":f,style:g}),t.jsx("div",{ref:u,role:"region","aria-label":y,className:h(f?"tkx-affixed":""),style:b,children:e})]})}function Yo(e){const r=[];for(const n of e)r.push(n),n.children&&r.push(...Yo(n.children));return r}function Cn(e){return e.startsWith("#")?e.slice(1):e}function Uo({item:e,activeKey:r,depth:n,onClick:o,theme:i,reducedMotion:l}){const c=e.key===r,d=R(e.title);return t.jsxs("li",{role:"none",style:{listStyle:"none"},children:[t.jsx("a",{role:"treeitem","aria-current":c?"location":void 0,href:e.href,onClick:u=>{u.preventDefault(),o(e.href)},className:h("block text-sm py-1 no-underline"),style:{paddingLeft:12+n*16,color:c?i.primary:i.textMuted,fontWeight:c?600:400,borderLeft:`2px solid ${c?i.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),e.children&&e.children.length>0&&t.jsx("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(u=>t.jsx(Uo,{item:u,activeKey:r,depth:n+1,onClick:o,theme:i,reducedMotion:l},u.key))})]})}function yd({items:e,offsetTop:r=0,getCurrentAnchor:n,onChange:o}){var p;const i=U(),l=te(),[c,d]=a.useState(((p=e[0])==null?void 0:p.key)??""),u=a.useRef(!1),f=Yo(e),s=a.useCallback(()=>{var y;if(u.current)return;let x=((y=f[0])==null?void 0:y.key)??"";for(const v of f){const b=Cn(v.href),g=document.getElementById(b);g&&g.getBoundingClientRect().top<=r+10&&(x=v.key)}n&&(x=n(x)),x!==c&&(d(x),o==null||o(x))},[f,r,n,c,o]);a.useEffect(()=>(window.addEventListener("scroll",s,{passive:!0}),s(),()=>window.removeEventListener("scroll",s)),[s]);const m=a.useCallback(x=>{const y=Cn(x),v=document.getElementById(y);if(!v)return;u.current=!0;const b=v.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:b,behavior:l?"auto":"smooth"});const g=f.find(w=>w.href===x);g&&(d(g.key),o==null||o(g.key)),setTimeout(()=>{u.current=!1},800)},[f,r,l,o]);return t.jsx("nav",{role:"tree","aria-label":"Anchor navigation",className:h("font-sans"),style:{borderLeft:`1px solid ${i.border}`,padding:"4px 0"},children:t.jsx("ul",{role:"group",style:{margin:0,padding:0},children:e.map(x=>t.jsx(Uo,{item:x,activeKey:c,depth:0,onClick:m,theme:i,reducedMotion:l},x.key))})})}function vd(e,r){var i;const n=[e];let o=e;for(const l of r){const c=o.find(d=>d.value===l);if((i=c==null?void 0:c.children)!=null&&i.length)n.push(c.children),o=c.children;else break}return n}function Ko(e,r){const n=[];let o=e;for(const i of r){const l=o.find(c=>c.value===i);if(l)n.push(l),o=l.children??[];else break}return n}function kd(e,r){return Ko(e,r).map(n=>R(n.label)).join(" / ")}function wd({options:e,value:r=[],onChange:n,placeholder:o="Select...",label:i,multiple:l=!1}){const c=U(),d=te(),u=a.useRef(null),f=a.useRef(null),[s,m]=a.useState(!1),[p,x]=a.useState(r),[y,v]=a.useState({top:0,left:0,width:0}),b=i?R(i):void 0,g=R(o),w=r.length>0?kd(e,r):"";a.useEffect(()=>{if(!s||!u.current)return;const L=u.current.getBoundingClientRect();v({top:L.bottom+4+window.scrollY,left:L.left+window.scrollX,width:Math.max(L.width,200)})},[s]),a.useEffect(()=>{if(!s)return;const L=I=>{var T,$;!((T=u.current)!=null&&T.contains(I.target))&&!(($=f.current)!=null&&$.contains(I.target))&&m(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[s]);const S=a.useCallback((L,I)=>{var $;if(I.disabled)return;const T=[...p.slice(0,L),I.value];if(x(T),!(($=I.children)!=null&&$.length)){const z=Ko(e,T);n==null||n(T,z),l||m(!1)}},[p,e,n,l]),M=a.useCallback(L=>{var I;L.key==="Escape"?(m(!1),(I=u.current)==null||I.focus()):(L.key==="Enter"||L.key===" ")&&(s||(L.preventDefault(),m(!0)))},[s]),N=vd(e,p),j=s?Ne.createPortal(t.jsx("div",{ref:f,role:"tree","aria-label":b??"Cascader options",className:h("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:y.top,left:y.left,backgroundColor:c.surface,borderColor:c.border,boxShadow:`0 4px 16px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:N.map((L,I)=>t.jsx("ul",{role:"group",className:h("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:I<N.length-1?`1px solid ${c.border}`:"none"},children:L.map(T=>{var E;const $=p[I]===T.value,z=R(T.label);return t.jsxs("li",{role:"treeitem","aria-selected":$,"aria-disabled":T.disabled||void 0,"aria-expanded":(E=T.children)!=null&&E.length?$:void 0,className:h("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:$?c.surfaceAlt:"transparent",color:T.disabled?c.textMuted:c.text,opacity:T.disabled?.5:1,cursor:T.disabled?"not-allowed":"pointer"},onClick:()=>S(I,T),onMouseEnter:()=>{T.disabled||x(C=>[...C.slice(0,I),T.value])},children:[t.jsx("span",{children:z}),T.children&&T.children.length>0&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,flexShrink:0},children:t.jsx("path",{d:"M10 6l6 6-6 6V6z"})})]},T.value)})},I))}),document.body):null;return t.jsxs("div",{className:h("relative font-sans"),onKeyDown:M,children:[b&&t.jsx("label",{className:h("block text-sm font-medium mb-1"),style:{color:c.text},children:b}),t.jsxs("button",{ref:u,type:"button",role:"combobox","aria-expanded":s,"aria-haspopup":"tree","aria-label":b??"Cascader",className:h("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:c.surface,borderColor:s?c.primary:c.border,color:w?c.text:c.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>m(L=>!L),children:[t.jsx("span",{className:h("truncate"),children:w||g}),t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,transform:s?"rotate(180deg)":"rotate(0deg)",transition:d?"none":"transform 0.2s ease",flexShrink:0},children:t.jsx("path",{d:"M7 10l5 5 5-5H7z"})})]}),j]})}const jd={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Sd({theme:e,reducedMotion:r}){return t.jsxs("div",{className:h("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[t.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),t.jsxs("div",{className:h("flex-1"),children:[t.jsx("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),t.jsx("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function $d({items:e,header:r,footer:n,bordered:o=!0,size:i="md",loading:l=!1,emptyText:c="No data",grid:d}){const u=U(),f=te(),s=R(c),m=jd[i],p=!!d,x=(d==null?void 0:d.column)??1,y=(d==null?void 0:d.gutter)??16;return t.jsxs("div",{role:"list","aria-label":"List","aria-busy":l,className:h("font-sans rounded-lg overflow-hidden"),style:{border:o?`1px solid ${u.border}`:"none",backgroundColor:u.surface},children:[r&&t.jsx("div",{className:h("font-semibold text-sm"),style:{padding:m,color:u.text,borderBottom:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:r}),l&&t.jsx("div",{children:Array.from({length:3}).map((v,b)=>t.jsx(Sd,{theme:u,reducedMotion:f},b))}),!l&&e.length===0&&t.jsx("div",{role:"status",className:h("text-center py-12 text-sm"),style:{color:u.textMuted},children:s}),!l&&e.length>0&&t.jsx("div",{style:p?{display:"grid",gridTemplateColumns:`repeat(${x}, 1fr)`,gap:y,padding:y}:void 0,children:e.map((v,b)=>{const g=R(v.title),w=v.description?R(v.description):void 0;return t.jsxs("div",{role:"listitem",className:h("flex items-start gap-3"),style:{padding:m,borderBottom:!p&&b<e.length-1?`1px solid ${u.border}`:"none",...p?{border:`1px solid ${u.border}`,borderRadius:8,backgroundColor:u.surface}:{},animation:f?"none":`tkxFadeIn 0.2s ease ${b*.03}s both`},children:[v.avatar&&t.jsx("div",{"aria-hidden":"true",className:h("shrink-0"),children:v.avatar}),t.jsxs("div",{className:h("flex-1 min-w-0"),children:[t.jsx("div",{className:h("text-sm font-medium"),style:{color:u.text},children:g}),w&&t.jsx("div",{className:h("text-xs mt-1 leading-relaxed"),style:{color:u.textMuted},children:w})]}),v.extra&&t.jsx("div",{className:h("shrink-0 ml-auto"),style:{color:u.textMuted},children:v.extra}),v.actions&&t.jsx("div",{className:h("shrink-0 flex items-center gap-2"),children:v.actions})]},v.key)})}),n&&t.jsx("div",{className:h("text-sm"),style:{padding:m,color:u.textMuted,borderTop:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:n})]})}const Zt={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"},Xo={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"},qo={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:"ترتيب تنازلي"},Zo={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"},Go={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"},Jo={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:"降順"},Qo={"en-US":Zt,"es-ES":Xo,"ar-SA":qo,"fr-FR":Zo,"de-DE":Go,"ja-JP":Jo},Md=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function es(e){return Md.has(e)}const Lt=a.createContext({locale:"en-US",direction:"ltr",strings:Zt});function Cd(){return a.useContext(Lt)}function Td(){return a.useContext(Lt).strings}function Ed(){return a.useContext(Lt).direction}function Id({locale:e="en-US",direction:r,strings:n,children:o}){const i=a.useMemo(()=>{const l=Qo[e]??Zt,c=n?{...l,...n}:l,d=r??(es(e)?"rtl":"ltr");return{locale:e,direction:d,strings:c}},[e,r,n]);return t.jsx(Lt.Provider,{value:i,children:t.jsx("div",{dir:i.direction,style:{direction:i.direction},children:o})})}function Nd({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function zd({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 Ld({active:e,children:r,as:n="div"}){const o=Kt(e);return t.jsx(n,{ref:o,children:r})}function Ad({as:e,children:r,...n}){const o=e??"span";return t.jsx(o,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=Ld;exports.I18nContext=Lt;exports.I18nProvider=Id;exports.LOCALES=Qo;exports.LRUCache=Tn;exports.LiveRegion=zd;exports.Quantum=ds;exports.SIZE_BORDER_RADIUS=Ic;exports.SIZE_FONT=Cc;exports.SIZE_HEIGHT=Mc;exports.SIZE_ICON=Nc;exports.SIZE_PADDING_X=Tc;exports.SIZE_PADDING_Y=Ec;exports.Shield=Ds;exports.SkipNav=Nd;exports.TKX=xs;exports.ThemeContext=wr;exports.ThemeProvider=js;exports.TkxAccordion=xo;exports.TkxAffix=bd;exports.TkxAlert=xi;exports.TkxAnchor=yd;exports.TkxAppBar=Dl;exports.TkxAutocomplete=ml;exports.TkxAvatar=so;exports.TkxBadge=eo;exports.TkxBottomNav=Pl;exports.TkxBreadcrumb=ul;exports.TkxButton=Gn;exports.TkxCard=Jn;exports.TkxCardBody=ii;exports.TkxCardFooter=ai;exports.TkxCardHeader=si;exports.TkxCarousel=Io;exports.TkxCascader=wd;exports.TkxChat=$a;exports.TkxChatBubble=yo;exports.TkxCheckbox=lo;exports.TkxClock=jo;exports.TkxCol=Vo;exports.TkxColorPicker=Ja;exports.TkxCommand=Eo;exports.TkxConfigProvider=Oo;exports.TkxContent=Fo;exports.TkxCountdown=ed;exports.TkxDataGrid=ql;exports.TkxDatePicker=ho;exports.TkxDivider=io;exports.TkxDrawer=Zi;exports.TkxEmpty=Kc;exports.TkxFileUpload=xa;exports.TkxFooter=Po;exports.TkxForm=No;exports.TkxFormField=zo;exports.TkxHeader=Bo;exports.TkxImage=da;exports.TkxInput=Qn;exports.TkxLayout=Do;exports.TkxList=$d;exports.TkxMasonry=Ql;exports.TkxMentions=nd;exports.TkxMenu=wo;exports.TkxModal=gi;exports.TkxNumberInput=Co;exports.TkxOTP=To;exports.TkxPagination=go;exports.TkxParagraph=Fc;exports.TkxPopover=pl;exports.TkxProgress=to;exports.TkxQRCode=ld;exports.TkxRadio=uo;exports.TkxRadioGroup=Ri;exports.TkxRating=ka;exports.TkxResult=ud;exports.TkxRichTextDisplay=uc;exports.TkxRow=Ho;exports.TkxSegmented=rd;exports.TkxSelect=ao;exports.TkxSider=Wo;exports.TkxSkeleton=qt;exports.TkxSlider=mo;exports.TkxSnackbar=Yl;exports.TkxSpeedDial=zl;exports.TkxSpin=_c;exports.TkxStatistic=Qc;exports.TkxStepper=$o;exports.TkxTab=vi;exports.TkxTabList=yi;exports.TkxTabPanel=wi;exports.TkxTabPanels=ki;exports.TkxTable=Ti;exports.TkxTabs=bi;exports.TkxTag=vo;exports.TkxTagInput=Na;exports.TkxText=Wc;exports.TkxThinkingIndicator=bo;exports.TkxTimeline=Aa;exports.TkxTitle=Bc;exports.TkxToastProvider=Oi;exports.TkxToggle=ro;exports.TkxToolbar=wl;exports.TkxTooltip=Si;exports.TkxTour=xd;exports.TkxTransferList=Ml;exports.TkxTreeView=vl;exports.TkxVideoPlayer=So;exports.TkxWatermark=md;exports.VisuallyHidden=Ad;exports.WCAGEngine=ys;exports.arSA=qo;exports.audit=_n;exports.auroraLight=vs;exports.batchUpdate=Nn;exports.breakpoints=Ts;exports.contrastRatio=jt;exports.createFocusTrap=br;exports.createTheme=ws;exports.css=An;exports.cssVar=mr;exports.cx=ae;exports.deDE=Go;exports.enUS=Zt;exports.esES=Xo;exports.extractAtomicCSS=qs;exports.extractCSS=gr;exports.fnv1aHash=ht;exports.frFR=Zo;exports.fromObject=Rn;exports.generatePalette=$s;exports.getAccessibleForeground=at;exports.getAuditLog=Yn;exports.getLocaleDisplayName=Rc;exports.injectStyles=Wn;exports.isRTL=es;exports.isRtlLocale=Ac;exports.jaJP=Jo;exports.keyframes=Bn;exports.meetsAA=Ot;exports.meetsAAA=Fn;exports.memoize=En;exports.prefersHighContrast=vr;exports.prefersReducedMotion=yr;exports.quantumDark=kr;exports.radii=Ns;exports.resetAtomicCSS=Zs;exports.resolvePluginUtility=Zn;exports.responsive=Dn;exports.sanitizeProps=jr;exports.sanitizeString=R;exports.shadows=Es;exports.spacing=Cs;exports.tkx=h;exports.tkxListPlugins=Qs;exports.tkxPlugin=Gs;exports.tkxRemovePlugin=Js;exports.tx=Xs;exports.typography=Ms;exports.useAnnounce=Sr;exports.useClickOutside=Kn;exports.useComponentSize=$c;exports.useConfig=zt;exports.useDirection=Ed;exports.useEscapeKey=lt;exports.useFocusTrap=Kt;exports.useHighContrast=Bs;exports.useI18n=Cd;exports.useLocale=Td;exports.useLogicalSpacing=Lc;exports.usePrefixCls=Sc;exports.useReducedMotion=te;exports.useRtlFlip=zc;exports.useTheme=U;exports.useTkxCommand=sl;exports.useTkxForm=hc;exports.useToast=Wi;exports.validateProps=Ut;exports.verifyAuditIntegrity=Un;exports.zIndex=Is;
119
+ `,document.head.appendChild(t)}function Ja({size:t,color:r}){return a.createElement("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},a.createElement("circle",{cx:12,cy:12,r:10,stroke:`${r}33`,strokeWidth:2.5,fill:"none"}),a.createElement("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:r,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function Qa({size:t,borderWidth:r,color:n,reducedMotion:i}){return i?a.createElement(Ja,{size:t,color:n}):(Ga(),a.createElement("div",{role:"img","aria-label":"Loading",style:{width:`${t}px`,height:`${t}px`,border:`${r}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function el({spinning:t=!0,size:r="md",tip:n,indicator:i,children:o,fullscreen:l=!1,delay:c=0,style:d}){const u=B.useTheme(),x=s.useReducedMotion(),[f,m]=a.useState(c===0&&t),p=a.useRef(null);if(a.useEffect(()=>(t&&c>0?p.current=setTimeout(()=>m(!0),c):m(t),()=>{p.current!==null&&clearTimeout(p.current)}),[t,c]),!f)return o?a.createElement("div",{style:d},o):null;const h=Za[r],y=n?s.sanitizeString(n):void 0,k=a.createElement("div",{role:"status","aria-live":"polite","aria-label":y??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},i??a.createElement(Qa,{size:h.dimension,borderWidth:h.borderWidth,color:u.primary,reducedMotion:x}),y&&a.createElement("span",{style:{color:u.primary,fontSize:h.fontSize,marginTop:"4px"}},y));return l?a.createElement("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}cc`,zIndex:9999,...d}},k):o?a.createElement("div",{style:{position:"relative",...d}},a.createElement("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:x?"none":"opacity 0.2s, filter 0.2s"}},o),a.createElement("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${u.bg}66`,borderRadius:"4px"}},k)):a.createElement("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...d}},k)}function tl({color:t,mutedColor:r}){return a.createElement("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},a.createElement("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${r}18`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${r}10`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${r}0d`,stroke:r,strokeWidth:1.5,strokeLinejoin:"round"}),a.createElement("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${t}15`,stroke:t,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),a.createElement("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${t}15`,stroke:t,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function rl({mutedColor:t}){return a.createElement("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},a.createElement("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${t}12`,stroke:t,strokeWidth:1.5}),a.createElement("line",{x1:24,y1:20,x2:40,y2:20,stroke:t,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:28,x2:36,y2:28,stroke:t,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("line",{x1:24,y1:36,x2:32,y2:36,stroke:t,strokeWidth:1.5,strokeLinecap:"round"}),a.createElement("circle",{cx:32,cy:54,r:6,stroke:t,strokeWidth:1.2,fill:"none"}),a.createElement("line",{x1:28,y1:54,x2:36,y2:54,stroke:t,strokeWidth:1.2,strokeLinecap:"round"}))}function nl({image:t="default",description:r="No data",children:n,style:i}){const o=B.useTheme(),l=typeof r=="string"?s.sanitizeString(r):r;let c;return t==="default"?c=a.createElement(tl,{color:o.primary,mutedColor:o.textMuted}):t==="simple"?c=a.createElement(rl,{mutedColor:o.textMuted}):c=t,a.createElement("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...i}},a.createElement("div",{style:{marginBottom:"12px",opacity:.85}},c),l&&a.createElement("div",{style:{color:o.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},l),n&&a.createElement("div",{style:{marginTop:"16px"}},n))}function sl(t,r,n=","){if(typeof t=="string")return t;const i=r!==void 0?t.toFixed(r):String(t),[o,l]=i.split("."),c=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return l!==void 0?`${c}.${l}`:c}function ol(t,r){if(t<=0)return r.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(t/1e3),i=Math.floor(n/86400),o=Math.floor(n%86400/3600),l=Math.floor(n%3600/60),c=n%60,d=u=>String(u).padStart(2,"0");return r.replace(/DD/g,d(i)).replace(/D/g,String(i)).replace(/HH/g,d(o)).replace(/H/g,String(o)).replace(/mm/g,d(l)).replace(/m/g,String(l)).replace(/ss/g,d(c)).replace(/s/g,String(c))}function il({direction:t,color:r}){const n=t==="up"?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4";return a.createElement("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},a.createElement("path",{d:n,stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}let Ar=!1;function al(){if(Ar||typeof document>"u")return;Ar=!0;const t=document.createElement("style");t.id="tkx-statistic-skeleton",t.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(t)}function ll({w:t,h:r,alt:n,bdr:i,rm:o}){return o||al(),a.createElement("div",{"aria-hidden":"true",style:{width:t,height:r,borderRadius:"4px",background:o?n:`linear-gradient(90deg, ${n} 25%, ${i} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:o?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}function cl({title:t,value:r,prefix:n,suffix:i,precision:o,groupSeparator:l=",",valueStyle:c,loading:d=!1,trend:u,trendValue:x,style:f}){const m=B.useTheme(),p=s.useReducedMotion(),h=s.sanitizeString(t),y=x?s.sanitizeString(x):void 0,k=u==="up"?m.success:u==="down"?m.danger:void 0;return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...f}},a.createElement("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},h),d?a.createElement(ll,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:p}):a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},n&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},n),a.createElement("span",null,sl(r,o,l)),i&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},i)),u&&a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:k,marginTop:"2px"}},a.createElement(il,{direction:u,color:k}),y&&a.createElement("span",null,y)))}function dl({title:t,value:r,format:n="HH:mm:ss",onFinish:i,prefix:o,suffix:l,style:c}){const d=B.useTheme(),u=s.sanitizeString(t),x=a.useRef(i);x.current=i;const f=a.useRef(!1),[m,p]=a.useState(()=>Math.max(0,r-Date.now()));a.useEffect(()=>{f.current=!1;const y=()=>{var g;const b=Math.max(0,r-Date.now());p(b),b<=0&&!f.current&&(f.current=!0,(g=x.current)==null||g.call(x))};y();const k=setInterval(y,1e3);return()=>clearInterval(k)},[r]);const h=ol(m,n);return a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...c}},a.createElement("div",{style:{color:d.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},u),a.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m<=0?d.danger:d.text,fontVariantNumeric:"tabular-nums"}},o&&a.createElement("span",{style:{fontSize:"0.75em",fontWeight:400}},o),a.createElement("span",null,h),l&&a.createElement("span",{style:{fontSize:"0.6em",fontWeight:400,color:d.textMuted}},l)))}const ul={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function fl({options:t,value:r,onChange:n,size:i="md",block:o=!1}){const l=B.useTheme(),c=s.useReducedMotion(),d=a.useRef(null),[u,x]=a.useState(()=>Math.max(0,t.findIndex(k=>k.value===r))),[f,m]=a.useState({}),p=ul[i];a.useEffect(()=>{const k=t.findIndex(b=>b.value===r);k>=0&&x(k)},[r,t]),a.useEffect(()=>{const k=d.current;if(!k)return;const g=k.querySelectorAll("[data-seg-btn]")[u];g&&m({left:g.offsetLeft,width:g.offsetWidth,height:g.offsetHeight,transition:c?"none":"left 0.2s ease, width 0.2s ease"})},[u,t,c]);const h=a.useCallback(k=>{const b=t[k];!b||b.disabled||(x(k),n==null||n(b.value))},[t,n]),y=a.useCallback(k=>{var g,w,j;let b=u;if(k.key==="ArrowRight"||k.key==="ArrowDown")for(k.preventDefault(),b=(u+1)%t.length;(g=t[b])!=null&&g.disabled&&b!==u;)b=(b+1)%t.length;else if(k.key==="ArrowLeft"||k.key==="ArrowUp")for(k.preventDefault(),b=(u-1+t.length)%t.length;(w=t[b])!=null&&w.disabled&&b!==u;)b=(b-1+t.length)%t.length;if(b!==u){h(b);const S=d.current,z=S==null?void 0:S.querySelectorAll("[data-seg-btn]");(j=z==null?void 0:z[b])==null||j.focus()}},[u,t,h]);return e.jsxs("div",{ref:d,role:"radiogroup","aria-label":"Segmented control",className:s.tkx("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:l.surfaceAlt,border:`1px solid ${l.border}`,width:o?"100%":void 0},onKeyDown:y,children:[e.jsx("div",{"aria-hidden":"true",className:s.tkx("absolute top-1 rounded-md"),style:{...f,backgroundColor:l.surface,boxShadow:`0 1px 3px ${l.border}`,zIndex:0}}),t.map((k,b)=>{const g=b===u,w=s.sanitizeString(k.label);return e.jsxs("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":g,"aria-disabled":k.disabled||void 0,disabled:k.disabled,tabIndex:g?0:-1,className:s.tkx("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:p.height,fontSize:p.fontSize,padding:`0 ${p.px}px`,flex:o?1:void 0,color:g?l.text:l.textMuted,backgroundColor:"transparent",opacity:k.disabled?.4:1,fontWeight:g?600:400,transition:c?"none":"color 0.15s ease"},onClick:()=>h(b),children:[k.icon&&e.jsx("span",{"aria-hidden":"true",children:k.icon}),w]},k.value)})]})}function xl({options:t,value:r="",onChange:n,trigger:i="@",placeholder:o,label:l}){const c=B.useTheme(),d=s.useReducedMotion(),u=a.useRef(null),x=a.useRef(null),[f,m]=a.useState(r),[p,h]=a.useState(!1),[y,k]=a.useState(""),[b,g]=a.useState(0),[w,j]=a.useState(-1);a.useEffect(()=>{r!==void 0&&m(r)},[r]);const S=t.filter(T=>T.label.toLowerCase().includes(y.toLowerCase())),z=a.useCallback(T=>{const E=T.target.value;m(E),n==null||n(E);const $=T.target.selectionStart??E.length,F=E.slice(0,$),I=F.lastIndexOf(i);if(I>=0){const W=F.slice(I+i.length);if(!/\s/.test(W)){k(W),j(I),h(!0),g(0);return}}h(!1)},[i,n]),v=a.useCallback(T=>{var I;const E=f.slice(0,w),$=f.slice(w+i.length+y.length),F=`${E}${i}${T.value} ${$}`;m(F),n==null||n(F),h(!1),(I=u.current)==null||I.focus()},[f,w,i,y,n]),N=a.useCallback(T=>{p&&(T.key==="ArrowDown"?(T.preventDefault(),g(E=>(E+1)%S.length)):T.key==="ArrowUp"?(T.preventDefault(),g(E=>(E-1+S.length)%S.length)):T.key==="Enter"&&S[b]?(T.preventDefault(),v(S[b])):T.key==="Escape"&&h(!1))},[p,S,b,v]);a.useEffect(()=>{if(!p||!x.current)return;const T=x.current.children[b];T==null||T.scrollIntoView({block:"nearest"})},[b,p]);const C=l?s.sanitizeString(l):void 0,M=o?s.sanitizeString(o):void 0;return e.jsxs("div",{className:s.tkx("relative font-sans"),style:{width:"100%"},children:[C&&e.jsx("label",{className:s.tkx("block text-sm font-medium mb-1"),style:{color:c.text},children:C}),e.jsx("textarea",{ref:u,role:"combobox","aria-expanded":p,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":C??"Mentions input",value:f,placeholder:M,onChange:z,onKeyDown:N,onBlur:()=>setTimeout(()=>h(!1),200),className:s.tkx("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:c.surface,borderColor:c.border,color:c.text,minHeight:80,outline:"none"},rows:3}),p&&S.length>0&&e.jsx("ul",{ref:x,role:"listbox","aria-label":"Mention suggestions",className:s.tkx("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:c.surface,borderColor:c.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:S.map((T,E)=>e.jsxs("li",{role:"option","aria-selected":E===b,className:s.tkx("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:E===b?c.surfaceAlt:"transparent",color:c.text},onMouseDown:$=>{$.preventDefault(),v(T)},onMouseEnter:()=>g(E),children:[T.avatar&&e.jsx("img",{src:s.sanitizeString(T.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:s.tkx("rounded-full"),style:{objectFit:"cover"}}),e.jsx("span",{children:s.sanitizeString(T.label)}),e.jsxs("span",{style:{color:c.textMuted,marginLeft:"auto"},children:[i,s.sanitizeString(T.value)]})]},T.value))})]})}function pl(t){let r=5381;for(let n=0;n<t.length;n++)r=(r<<5)+r+t.charCodeAt(n)|0;return Math.abs(r)}function hl(t){let r=t;return()=>(r=r*1664525+1013904223|0,(r>>>0)/4294967295)}const ml={L:.38,M:.42,Q:.48,H:.55};function gl(t,r,n){const i=pl(t),o=hl(i),l=ml[n]??.42,c=Array.from({length:r},()=>Array.from({length:r},()=>!1)),d=(u,x)=>{for(let f=0;f<7;f++)for(let m=0;m<7;m++){const p=f===0||f===6||m===0||m===6,h=f>=2&&f<=4&&m>=2&&m<=4;c[u+f][x+m]=p||h}};d(0,0),d(0,r-7),d(r-7,0);for(let u=7;u<r-7;u++)c[6][u]=u%2===0,c[u][6]=u%2===0;for(let u=0;u<r;u++)for(let x=0;x<r;x++)u<8&&x<8||u<8&&x>=r-8||u>=r-8&&x<8||(u===6||x===6)||(c[u][x]=o()<l);return c}function bl({value:t,size:r=160,color:n,bgColor:i,errorLevel:o="M",icon:l,bordered:c=!0}){const d=B.useTheme(),u=s.useReducedMotion(),x=a.useRef(null),f=s.sanitizeString(t),m=n??d.text,p=i??d.surface,h=25,y=a.useMemo(()=>gl(f,h,o),[f,o]);return a.useEffect(()=>{const k=x.current;if(!k)return;const b=k.getContext("2d");if(!b)return;const g=window.devicePixelRatio||1;k.width=r*g,k.height=r*g,b.scale(g,g);const w=r/h;b.fillStyle=p,b.fillRect(0,0,r,r),b.fillStyle=m;for(let j=0;j<h;j++)for(let S=0;S<h;S++)y[j][S]&&b.fillRect(S*w,j*w,w,w);if(l){const j=r*.22,S=(r-j)/2;b.fillStyle=p,b.fillRect(S-2,S-2,j+4,j+4);const z=new Image;z.crossOrigin="anonymous",z.onload=()=>{b.drawImage(z,S,S,j,j)},z.src=s.sanitizeString(l)}},[y,r,m,p,l]),e.jsx("div",{role:"img","aria-label":`QR code for: ${f}`,className:s.tkx("inline-block rounded-lg"),style:{padding:c?12:0,backgroundColor:c?p:"transparent",border:c?`1px solid ${d.border}`:"none",lineHeight:0,animation:u?"none":"tkxFadeIn 0.2s ease"},children:e.jsx("canvas",{ref:x,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})}const yl={success:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("path",{d:"M22 37l9 9 19-19",stroke:t,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("path",{d:"M26 26l20 20M46 26L26 46",stroke:t,strokeWidth:"4",strokeLinecap:"round"})]}),warning:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M36 6L4 64h64L36 6z",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("path",{d:"M36 30v16",stroke:t,strokeWidth:"4",strokeLinecap:"round"}),e.jsx("circle",{cx:"36",cy:"54",r:"2.5",fill:t})]}),info:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("path",{d:"M36 32v18",stroke:t,strokeWidth:"4",strokeLinecap:"round"}),e.jsx("circle",{cx:"36",cy:"22",r:"2.5",fill:t})]}),404:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:t,children:"404"})]}),403:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("path",{d:"M28 30h16v16H28z",stroke:t,strokeWidth:"3",fill:"none"}),e.jsx("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:t,strokeWidth:"3",fill:"none"})]}),500:t=>e.jsxs("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"36",cy:"36",r:"34",stroke:t,strokeWidth:"3",fill:`${t}18`}),e.jsx("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:t,children:"500"})]})};function kl(t,r){switch(t){case"success":return r.success;case"error":case"500":return r.danger;case"warning":return r.warning;case"info":return r.info;case"404":case"403":return r.textMuted}}function vl({status:t,title:r,subTitle:n,icon:i,extra:o}){const l=B.useTheme(),c=s.useReducedMotion(),d=kl(t,l),u=s.sanitizeString(r),x=n?s.sanitizeString(n):void 0;return e.jsxs("div",{role:"status","aria-live":"polite",className:s.tkx("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[e.jsx("div",{className:s.tkx("mb-6"),children:i??yl[t](d)}),e.jsx("h2",{className:s.tkx("text-xl font-semibold m-0 mb-2"),style:{color:l.text},children:u}),x&&e.jsx("p",{className:s.tkx("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:l.textMuted},children:x}),o&&e.jsx("div",{className:s.tkx("flex items-center gap-3 mt-4"),children:o})]})}function wl(t){const r=document.querySelector(t);return r?r.getBoundingClientRect():null}function jl(t,r,n,i){switch(r){case"top":return{top:t.top-i-12+window.scrollY,left:t.left+t.width/2-n/2+window.scrollX};case"bottom":return{top:t.bottom+12+window.scrollY,left:t.left+t.width/2-n/2+window.scrollX};case"left":return{top:t.top+t.height/2-i/2+window.scrollY,left:t.left-n-12+window.scrollX};case"right":return{top:t.top+t.height/2-i/2+window.scrollY,left:t.right+12+window.scrollX};default:return{top:t.bottom+12+window.scrollY,left:t.left+window.scrollX}}}function Sl({steps:t,isOpen:r=!1,onClose:n,current:i,onChange:o}){const l=B.useTheme(),c=s.useReducedMotion(),[d,u]=a.useState(0),x=i??d,f=a.useRef(null),[m,p]=a.useState({top:0,left:0}),[h,y]=a.useState(null),k=t[x],b=a.useCallback(()=>{if(!k)return;const M=wl(k.target);if(y(M),M&&f.current){const T=f.current.offsetWidth,E=f.current.offsetHeight;p(jl(M,k.placement??"bottom",T,E))}},[k]);a.useEffect(()=>{if(r)return b(),window.addEventListener("resize",b),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",b),window.removeEventListener("scroll",b,!0)}},[r,x,b]),a.useEffect(()=>{var M;r&&((M=f.current)==null||M.focus())},[r,x]);const g=a.useCallback(M=>{u(M),o==null||o(M)},[o]),w=a.useCallback(()=>{x<t.length-1?g(x+1):n==null||n()},[x,t.length,g,n]),j=a.useCallback(()=>{x>0&&g(x-1)},[x,g]);if(!r||!k)return null;const S=6,z=s.sanitizeString(k.title),v=s.sanitizeString(k.description),C=e.jsxs("div",{"aria-hidden":"true",children:[e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:h?`polygon(0% 0%, 0% 100%, ${h.left-S}px 100%, ${h.left-S}px ${h.top-S}px, ${h.right+S}px ${h.top-S}px, ${h.right+S}px ${h.bottom+S}px, ${h.left-S}px ${h.bottom+S}px, ${h.left-S}px 100%, 100% 100%, 100% 0%)`:void 0,transition:c?"none":"clip-path 0.25s ease"},onClick:n}),e.jsxs("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":`Tour step ${x+1} of ${t.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:m.top,left:m.left,width:300,backgroundColor:l.surface,border:`1px solid ${l.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${l.bg}80`,animation:c?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:M=>{M.key==="Escape"&&(n==null||n())},children:[e.jsx("h3",{className:s.tkx("m-0 mb-2 text-base font-semibold"),style:{color:l.text},children:z}),e.jsx("p",{className:s.tkx("m-0 mb-4 text-sm leading-relaxed"),style:{color:l.textMuted},children:v}),e.jsx("div",{className:s.tkx("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:t.map((M,T)=>e.jsx("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:T===x?l.primary:l.border,transition:c?"none":"background-color 0.2s"}},T))}),e.jsxs("div",{className:s.tkx("flex items-center justify-between gap-2"),children:[e.jsx("button",{type:"button","aria-label":"Skip tour",onClick:n,className:s.tkx("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:l.textMuted},children:"Skip"}),e.jsxs("div",{className:s.tkx("flex gap-2"),children:[x>0&&e.jsx("button",{type:"button","aria-label":"Previous step",onClick:j,className:s.tkx("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:l.border,color:l.text},children:"Prev"}),e.jsx("button",{type:"button","aria-label":x===t.length-1?"Finish tour":"Next step",onClick:w,className:s.tkx("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:l.primary,color:"#fff"},children:x===t.length-1?"Finish":"Next"})]})]})]})]});return Le.createPortal(C,document.body)}function Cl(t,r,n,i,o){const l=document.createElement("canvas"),c=l.getContext("2d");if(!c)return"";const d=i*1.5,u=t.length*d,x=Math.max(...t.map(h=>h.length))*i*.6,f=n[0]+x,m=n[1]+u,p=2;return l.width=f*p,l.height=m*p,c.scale(p,p),c.translate(f/2,m/2),c.rotate(r*Math.PI/180),c.font=`${i}px sans-serif`,c.fillStyle=o,c.textAlign="center",c.textBaseline="middle",t.forEach((h,y)=>{const k=(y-(t.length-1)/2)*d;c.fillText(h,0,k)}),l.toDataURL()}function Tl({text:t,children:r,rotate:n=-22,gap:i=[100,100],fontSize:o=14,color:l,zIndex:c=10}){const d=B.useTheme(),u=s.useReducedMotion(),x=a.useRef(null),[f,m]=a.useState(""),p=a.useMemo(()=>(Array.isArray(t)?t:[t]).map(k=>s.sanitizeString(k)),[t]),h=l??`${d.textMuted}22`,y=a.useCallback(()=>Cl(p,n,i,o,h),[p,n,i,o,h]);return a.useEffect(()=>{const k=y();k&&m(`url(${k})`)},[y]),a.useEffect(()=>{var g;const k=(g=x.current)==null?void 0:g.querySelector("[data-watermark]");if(!k)return;const b=new MutationObserver(()=>{const w=y();w&&(k.style.backgroundImage=`url(${w})`)});return b.observe(k,{attributes:!0,attributeFilter:["style"]}),()=>b.disconnect()},[y]),e.jsxs("div",{ref:x,className:s.tkx("relative"),style:{overflow:"hidden"},children:[r,e.jsx("div",{"data-watermark":!0,"aria-hidden":"true",className:s.tkx("absolute inset-0 pointer-events-none"),style:{zIndex:c,backgroundImage:f,backgroundRepeat:"repeat",animation:u?"none":"tkxFadeIn 0.3s ease"}})]})}function Pr(t){if(t)try{return t()}catch{return window}return window}function Ml(t){if(t instanceof Window)return{top:0,bottom:t.innerHeight};const r=t.getBoundingClientRect();return{top:r.top,bottom:r.bottom}}function $l({children:t,offsetTop:r,offsetBottom:n,onChange:i,target:o}){const l=B.useTheme(),c=s.useReducedMotion(),d=a.useRef(null),u=a.useRef(null),[x,f]=a.useState(!1),[m,p]=a.useState({width:0,height:0}),h=a.useRef(!1),y=a.useMemo(()=>s.sanitizeString("Sticky content"),[]),k=a.useCallback(()=>{const w=d.current;if(!w)return;const j=w.getBoundingClientRect(),S=Ml(Pr(o));let z=!1;r!==void 0?z=j.top-S.top<=r:n!==void 0&&(z=S.bottom-j.bottom<=n),z!==h.current&&(h.current=z,f(z),p({width:j.width,height:j.height}),i==null||i(z))},[r,n,i,o]);a.useEffect(()=>{const w=Pr(o);return k(),w.addEventListener("scroll",k,{passive:!0}),window.addEventListener("resize",k),()=>{w.removeEventListener("scroll",k),window.removeEventListener("resize",k)}},[k,o]);const b=x?{position:"fixed",zIndex:100,...r!==void 0?{top:r}:{},...n!==void 0?{bottom:n}:{},width:m.width||void 0,transition:c?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${l.border}`}:{},g=x?{height:m.height,width:m.width}:{};return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:d,"aria-hidden":x,style:g}),e.jsx("div",{ref:u,role:"region","aria-label":y,className:s.tkx(x?"tkx-affixed":""),style:b,children:t})]})}function En(t){const r=[];for(const n of t)r.push(n),n.children&&r.push(...En(n.children));return r}function Br(t){return t.startsWith("#")?t.slice(1):t}function Nn({item:t,activeKey:r,depth:n,onClick:i,theme:o,reducedMotion:l}){const c=t.key===r,d=s.sanitizeString(t.title);return e.jsxs("li",{role:"none",style:{listStyle:"none"},children:[e.jsx("a",{role:"treeitem","aria-current":c?"location":void 0,href:t.href,onClick:u=>{u.preventDefault(),i(t.href)},className:s.tkx("block text-sm py-1 no-underline"),style:{paddingLeft:12+n*16,color:c?o.primary:o.textMuted,fontWeight:c?600:400,borderLeft:`2px solid ${c?o.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),t.children&&t.children.length>0&&e.jsx("ul",{role:"group",style:{margin:0,padding:0},children:t.children.map(u=>e.jsx(Nn,{item:u,activeKey:r,depth:n+1,onClick:i,theme:o,reducedMotion:l},u.key))})]})}function zl({items:t,offsetTop:r=0,getCurrentAnchor:n,onChange:i}){var p;const o=B.useTheme(),l=s.useReducedMotion(),[c,d]=a.useState(((p=t[0])==null?void 0:p.key)??""),u=a.useRef(!1),x=En(t),f=a.useCallback(()=>{var y;if(u.current)return;let h=((y=x[0])==null?void 0:y.key)??"";for(const k of x){const b=Br(k.href),g=document.getElementById(b);g&&g.getBoundingClientRect().top<=r+10&&(h=k.key)}n&&(h=n(h)),h!==c&&(d(h),i==null||i(h))},[x,r,n,c,i]);a.useEffect(()=>(window.addEventListener("scroll",f,{passive:!0}),f(),()=>window.removeEventListener("scroll",f)),[f]);const m=a.useCallback(h=>{const y=Br(h),k=document.getElementById(y);if(!k)return;u.current=!0;const b=k.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:b,behavior:l?"auto":"smooth"});const g=x.find(w=>w.href===h);g&&(d(g.key),i==null||i(g.key)),setTimeout(()=>{u.current=!1},800)},[x,r,l,i]);return e.jsx("nav",{role:"tree","aria-label":"Anchor navigation",className:s.tkx("font-sans"),style:{borderLeft:`1px solid ${o.border}`,padding:"4px 0"},children:e.jsx("ul",{role:"group",style:{margin:0,padding:0},children:t.map(h=>e.jsx(Nn,{item:h,activeKey:c,depth:0,onClick:m,theme:o,reducedMotion:l},h.key))})})}function Il(t,r){var o;const n=[t];let i=t;for(const l of r){const c=i.find(d=>d.value===l);if((o=c==null?void 0:c.children)!=null&&o.length)n.push(c.children),i=c.children;else break}return n}function Rn(t,r){const n=[];let i=t;for(const o of r){const l=i.find(c=>c.value===o);if(l)n.push(l),i=l.children??[];else break}return n}function El(t,r){return Rn(t,r).map(n=>s.sanitizeString(n.label)).join(" / ")}function Nl({options:t,value:r=[],onChange:n,placeholder:i="Select...",label:o,multiple:l=!1}){const c=B.useTheme(),d=s.useReducedMotion(),u=a.useRef(null),x=a.useRef(null),[f,m]=a.useState(!1),[p,h]=a.useState(r),[y,k]=a.useState({top:0,left:0,width:0}),b=o?s.sanitizeString(o):void 0,g=s.sanitizeString(i),w=r.length>0?El(t,r):"";a.useEffect(()=>{if(!f||!u.current)return;const N=u.current.getBoundingClientRect();k({top:N.bottom+4+window.scrollY,left:N.left+window.scrollX,width:Math.max(N.width,200)})},[f]),a.useEffect(()=>{if(!f)return;const N=C=>{var M,T;!((M=u.current)!=null&&M.contains(C.target))&&!((T=x.current)!=null&&T.contains(C.target))&&m(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[f]);const j=a.useCallback((N,C)=>{var T;if(C.disabled)return;const M=[...p.slice(0,N),C.value];if(h(M),!((T=C.children)!=null&&T.length)){const E=Rn(t,M);n==null||n(M,E),l||m(!1)}},[p,t,n,l]),S=a.useCallback(N=>{var C;N.key==="Escape"?(m(!1),(C=u.current)==null||C.focus()):(N.key==="Enter"||N.key===" ")&&(f||(N.preventDefault(),m(!0)))},[f]),z=Il(t,p),v=f?Le.createPortal(e.jsx("div",{ref:x,role:"tree","aria-label":b??"Cascader options",className:s.tkx("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:y.top,left:y.left,backgroundColor:c.surface,borderColor:c.border,boxShadow:`0 4px 16px ${c.bg}80`,animation:d?"none":"tkxFadeIn 0.15s ease"},children:z.map((N,C)=>e.jsx("ul",{role:"group",className:s.tkx("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:C<z.length-1?`1px solid ${c.border}`:"none"},children:N.map(M=>{var $;const T=p[C]===M.value,E=s.sanitizeString(M.label);return e.jsxs("li",{role:"treeitem","aria-selected":T,"aria-disabled":M.disabled||void 0,"aria-expanded":($=M.children)!=null&&$.length?T:void 0,className:s.tkx("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:T?c.surfaceAlt:"transparent",color:M.disabled?c.textMuted:c.text,opacity:M.disabled?.5:1,cursor:M.disabled?"not-allowed":"pointer"},onClick:()=>j(C,M),onMouseEnter:()=>{M.disabled||h(F=>[...F.slice(0,C),M.value])},children:[e.jsx("span",{children:E}),M.children&&M.children.length>0&&e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,flexShrink:0},children:e.jsx("path",{d:"M10 6l6 6-6 6V6z"})})]},M.value)})},C))}),document.body):null;return e.jsxs("div",{className:s.tkx("relative font-sans"),onKeyDown:S,children:[b&&e.jsx("label",{className:s.tkx("block text-sm font-medium mb-1"),style:{color:c.text},children:b}),e.jsxs("button",{ref:u,type:"button",role:"combobox","aria-expanded":f,"aria-haspopup":"tree","aria-label":b??"Cascader",className:s.tkx("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:c.surface,borderColor:f?c.primary:c.border,color:w?c.text:c.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>m(N=>!N),children:[e.jsx("span",{className:s.tkx("truncate"),children:w||g}),e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:c.textMuted,transform:f?"rotate(180deg)":"rotate(0deg)",transition:d?"none":"transform 0.2s ease",flexShrink:0},children:e.jsx("path",{d:"M7 10l5 5 5-5H7z"})})]}),v]})}const Rl={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Ll({theme:t,reducedMotion:r}){return e.jsxs("div",{className:s.tkx("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:t.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),e.jsxs("div",{className:s.tkx("flex-1"),children:[e.jsx("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:t.surfaceAlt,marginBottom:8,animation:r?"none":"tkxPulse 1.5s ease infinite"}}),e.jsx("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:t.surfaceAlt,animation:r?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function Dl({items:t,header:r,footer:n,bordered:i=!0,size:o="md",loading:l=!1,emptyText:c="No data",grid:d}){const u=B.useTheme(),x=s.useReducedMotion(),f=s.sanitizeString(c),m=Rl[o],p=!!d,h=(d==null?void 0:d.column)??1,y=(d==null?void 0:d.gutter)??16;return e.jsxs("div",{role:"list","aria-label":"List","aria-busy":l,className:s.tkx("font-sans rounded-lg overflow-hidden"),style:{border:i?`1px solid ${u.border}`:"none",backgroundColor:u.surface},children:[r&&e.jsx("div",{className:s.tkx("font-semibold text-sm"),style:{padding:m,color:u.text,borderBottom:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:r}),l&&e.jsx("div",{children:Array.from({length:3}).map((k,b)=>e.jsx(Ll,{theme:u,reducedMotion:x},b))}),!l&&t.length===0&&e.jsx("div",{role:"status",className:s.tkx("text-center py-12 text-sm"),style:{color:u.textMuted},children:f}),!l&&t.length>0&&e.jsx("div",{style:p?{display:"grid",gridTemplateColumns:`repeat(${h}, 1fr)`,gap:y,padding:y}:void 0,children:t.map((k,b)=>{const g=s.sanitizeString(k.title),w=k.description?s.sanitizeString(k.description):void 0;return e.jsxs("div",{role:"listitem",className:s.tkx("flex items-start gap-3"),style:{padding:m,borderBottom:!p&&b<t.length-1?`1px solid ${u.border}`:"none",...p?{border:`1px solid ${u.border}`,borderRadius:8,backgroundColor:u.surface}:{},animation:x?"none":`tkxFadeIn 0.2s ease ${b*.03}s both`},children:[k.avatar&&e.jsx("div",{"aria-hidden":"true",className:s.tkx("shrink-0"),children:k.avatar}),e.jsxs("div",{className:s.tkx("flex-1 min-w-0"),children:[e.jsx("div",{className:s.tkx("text-sm font-medium"),style:{color:u.text},children:g}),w&&e.jsx("div",{className:s.tkx("text-xs mt-1 leading-relaxed"),style:{color:u.textMuted},children:w})]}),k.extra&&e.jsx("div",{className:s.tkx("shrink-0 ml-auto"),style:{color:u.textMuted},children:k.extra}),k.actions&&e.jsx("div",{className:s.tkx("shrink-0 flex items-center gap-2"),children:k.actions})]},k.key)})}),n&&e.jsx("div",{className:s.tkx("text-sm"),style:{padding:m,color:u.textMuted,borderTop:`1px solid ${u.border}`,backgroundColor:u.surfaceAlt},children:n})]})}const Tt={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:(t,r)=>`Page ${t} 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",filterPlaceholder:"Filter...",exportCsv:"Export CSV",rowsSelected:t=>`${t} row${t===1?"":"s"} selected`},Ln={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:(t,r)=>`Página ${t} 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",filterPlaceholder:"Filtrar...",exportCsv:"Exportar CSV",rowsSelected:t=>`${t} fila${t===1?"":"s"} seleccionada${t===1?"":"s"}`},Dn={close:"Fechar",cancel:"Cancelar",confirm:"Confirmar",save:"Salvar",delete:"Excluir",search:"Pesquisar",loading:"Carregando...",noResults:"Nenhum resultado encontrado",required:"Obrigatório",previous:"Anterior",next:"Próximo",pageOf:(t,r)=>`Página ${t} de ${r}`,selectPlaceholder:"Selecionar...",clearSelection:"Limpar seleção",selectDate:"Selecionar data",today:"Hoje",dropFiles:"Solte arquivos aqui ou",browse:"Procurar",noData:"Nenhum dado disponível",sortAscending:"Ordenar crescente",sortDescending:"Ordenar decrescente",filterPlaceholder:"Filtrar...",exportCsv:"Exportar CSV",rowsSelected:t=>`${t} linha${t===1?"":"s"} selecionada${t===1?"":"s"}`},An={close:"Fechar",cancel:"Cancelar",confirm:"Confirmar",save:"Guardar",delete:"Eliminar",search:"Pesquisar",loading:"A carregar...",noResults:"Sem resultados",required:"Obrigatório",previous:"Anterior",next:"Próximo",pageOf:(t,r)=>`Página ${t} de ${r}`,selectPlaceholder:"Selecionar...",clearSelection:"Limpar seleção",selectDate:"Selecionar data",today:"Hoje",dropFiles:"Largue ficheiros aqui ou",browse:"Procurar",noData:"Sem dados disponíveis",sortAscending:"Ordenar crescente",sortDescending:"Ordenar decrescente",filterPlaceholder:"Filtrar...",exportCsv:"Exportar CSV",rowsSelected:t=>`${t} linha${t===1?"":"s"} selecionada${t===1?"":"s"}`},Pn={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:(t,r)=>`Page ${t} 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",filterPlaceholder:"Filtrer...",exportCsv:"Exporter CSV",rowsSelected:t=>`${t} ligne${t===1?"":"s"} sélectionnée${t===1?"":"s"}`},Bn={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:(t,r)=>`Seite ${t} 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",filterPlaceholder:"Filtern...",exportCsv:"CSV exportieren",rowsSelected:t=>`${t} Zeile${t===1?"":"n"} ausgewählt`},Fn={close:"Chiudi",cancel:"Annulla",confirm:"Conferma",save:"Salva",delete:"Elimina",search:"Cerca",loading:"Caricamento...",noResults:"Nessun risultato trovato",required:"Obbligatorio",previous:"Precedente",next:"Successivo",pageOf:(t,r)=>`Pagina ${t} di ${r}`,selectPlaceholder:"Seleziona...",clearSelection:"Cancella selezione",selectDate:"Seleziona una data",today:"Oggi",dropFiles:"Trascina file qui o",browse:"Sfoglia",noData:"Nessun dato disponibile",sortAscending:"Ordinamento crescente",sortDescending:"Ordinamento decrescente",filterPlaceholder:"Filtra...",exportCsv:"Esporta CSV",rowsSelected:t=>`${t} riga${t===1?"":"i"} selezionat${t===1?"a":"e"}`},Wn={close:"Sluiten",cancel:"Annuleren",confirm:"Bevestigen",save:"Opslaan",delete:"Verwijderen",search:"Zoeken",loading:"Laden...",noResults:"Geen resultaten gevonden",required:"Verplicht",previous:"Vorige",next:"Volgende",pageOf:(t,r)=>`Pagina ${t} van ${r}`,selectPlaceholder:"Selecteer...",clearSelection:"Selectie wissen",selectDate:"Selecteer een datum",today:"Vandaag",dropFiles:"Zet bestanden hier neer of",browse:"Bladeren",noData:"Geen gegevens beschikbaar",sortAscending:"Oplopend sorteren",sortDescending:"Aflopend sorteren",filterPlaceholder:"Filteren...",exportCsv:"CSV exporteren",rowsSelected:t=>`${t} rij${t===1?"":"en"} geselecteerd`},Hn={close:"Zamknij",cancel:"Anuluj",confirm:"Potwierdź",save:"Zapisz",delete:"Usuń",search:"Szukaj",loading:"Ładowanie...",noResults:"Nie znaleziono wyników",required:"Wymagane",previous:"Poprzednia",next:"Następna",pageOf:(t,r)=>`Strona ${t} z ${r}`,selectPlaceholder:"Wybierz...",clearSelection:"Wyczyść wybór",selectDate:"Wybierz datę",today:"Dzisiaj",dropFiles:"Upuść pliki tutaj lub",browse:"Przeglądaj",noData:"Brak danych",sortAscending:"Sortuj rosnąco",sortDescending:"Sortuj malejąco",filterPlaceholder:"Filtruj...",exportCsv:"Eksportuj CSV",rowsSelected:t=>`Wybrano ${t} wier${t===1?"sz":"sze"}`},Vn={close:"Закрыть",cancel:"Отмена",confirm:"Подтвердить",save:"Сохранить",delete:"Удалить",search:"Поиск",loading:"Загрузка...",noResults:"Результаты не найдены",required:"Обязательно",previous:"Назад",next:"Вперёд",pageOf:(t,r)=>`Страница ${t} из ${r}`,selectPlaceholder:"Выбрать...",clearSelection:"Снять выделение",selectDate:"Выбрать дату",today:"Сегодня",dropFiles:"Перетащите файлы сюда или",browse:"Обзор",noData:"Нет данных",sortAscending:"По возрастанию",sortDescending:"По убыванию",filterPlaceholder:"Фильтр...",exportCsv:"Экспорт CSV",rowsSelected:t=>`Выбрано ${t} строк`},On={close:"Закрити",cancel:"Скасувати",confirm:"Підтвердити",save:"Зберегти",delete:"Видалити",search:"Пошук",loading:"Завантаження...",noResults:"Результати не знайдено",required:"Обов'язково",previous:"Назад",next:"Далі",pageOf:(t,r)=>`Сторінка ${t} з ${r}`,selectPlaceholder:"Вибрати...",clearSelection:"Очистити вибір",selectDate:"Вибрати дату",today:"Сьогодні",dropFiles:"Перетягніть файли або",browse:"Огляд",noData:"Немає даних",sortAscending:"За зростанням",sortDescending:"За спаданням",filterPlaceholder:"Фільтр...",exportCsv:"Експорт CSV",rowsSelected:t=>`Вибрано ${t} рядків`},_n={close:"Kapat",cancel:"İptal",confirm:"Onayla",save:"Kaydet",delete:"Sil",search:"Ara",loading:"Yükleniyor...",noResults:"Sonuç bulunamadı",required:"Zorunlu",previous:"Önceki",next:"Sonraki",pageOf:(t,r)=>`${r} sayfadan ${t}. sayfa`,selectPlaceholder:"Seçin...",clearSelection:"Seçimi temizle",selectDate:"Tarih seçin",today:"Bugün",dropFiles:"Dosyaları buraya bırakın veya",browse:"Gözat",noData:"Veri yok",sortAscending:"Artan sıralama",sortDescending:"Azalan sıralama",filterPlaceholder:"Filtrele...",exportCsv:"CSV dışa aktar",rowsSelected:t=>`${t} satır seçildi`},Yn={close:"Stäng",cancel:"Avbryt",confirm:"Bekräfta",save:"Spara",delete:"Ta bort",search:"Sök",loading:"Laddar...",noResults:"Inga resultat hittades",required:"Obligatoriskt",previous:"Föregående",next:"Nästa",pageOf:(t,r)=>`Sida ${t} av ${r}`,selectPlaceholder:"Välj...",clearSelection:"Rensa val",selectDate:"Välj ett datum",today:"Idag",dropFiles:"Släpp filer här eller",browse:"Bläddra",noData:"Inga data tillgängliga",sortAscending:"Sortera stigande",sortDescending:"Sortera fallande",filterPlaceholder:"Filtrera...",exportCsv:"Exportera CSV",rowsSelected:t=>`${t} rad${t===1?"":"er"} vald${t===1?"":"a"}`},Un={close:"Luk",cancel:"Annuller",confirm:"Bekræft",save:"Gem",delete:"Slet",search:"Søg",loading:"Indlæser...",noResults:"Ingen resultater fundet",required:"Påkrævet",previous:"Forrige",next:"Næste",pageOf:(t,r)=>`Side ${t} af ${r}`,selectPlaceholder:"Vælg...",clearSelection:"Ryd valg",selectDate:"Vælg en dato",today:"I dag",dropFiles:"Slip filer her eller",browse:"Gennemse",noData:"Ingen data tilgængelige",sortAscending:"Sorter stigende",sortDescending:"Sorter faldende",filterPlaceholder:"Filtrer...",exportCsv:"Eksporter CSV",rowsSelected:t=>`${t} række${t===1?"":"r"} valgt`},Kn={close:"Zavřít",cancel:"Zrušit",confirm:"Potvrdit",save:"Uložit",delete:"Smazat",search:"Hledat",loading:"Načítání...",noResults:"Žádné výsledky",required:"Povinné",previous:"Předchozí",next:"Další",pageOf:(t,r)=>`Stránka ${t} z ${r}`,selectPlaceholder:"Vyberte...",clearSelection:"Vymazat výběr",selectDate:"Vyberte datum",today:"Dnes",dropFiles:"Přetáhněte soubory nebo",browse:"Procházet",noData:"Žádná data",sortAscending:"Seřadit vzestupně",sortDescending:"Seřadit sestupně",filterPlaceholder:"Filtrovat...",exportCsv:"Exportovat CSV",rowsSelected:t=>`Vybráno ${t} řádků`},Xn={close:"Bezárás",cancel:"Mégse",confirm:"Megerősítés",save:"Mentés",delete:"Törlés",search:"Keresés",loading:"Betöltés...",noResults:"Nincs találat",required:"Kötelező",previous:"Előző",next:"Következő",pageOf:(t,r)=>`${t}. oldal / ${r}`,selectPlaceholder:"Válasszon...",clearSelection:"Kijelölés törlése",selectDate:"Válasszon dátumot",today:"Ma",dropFiles:"Húzza ide a fájlokat vagy",browse:"Tallózás",noData:"Nincs adat",sortAscending:"Növekvő sorrend",sortDescending:"Csökkenő sorrend",filterPlaceholder:"Szűrés...",exportCsv:"CSV exportálása",rowsSelected:t=>`${t} sor kiválasztva`},qn={close:"إغلاق",cancel:"إلغاء",confirm:"تأكيد",save:"حفظ",delete:"حذف",search:"بحث",loading:"...جارٍ التحميل",noResults:"لم يتم العثور على نتائج",required:"مطلوب",previous:"السابق",next:"التالي",pageOf:(t,r)=>`صفحة ${t} من ${r}`,selectPlaceholder:"...اختر",clearSelection:"مسح الاختيار",selectDate:"اختر تاريخ",today:"اليوم",dropFiles:"أفلت الملفات هنا أو",browse:"تصفح",noData:"لا توجد بيانات",sortAscending:"ترتيب تصاعدي",sortDescending:"ترتيب تنازلي",filterPlaceholder:"...فلترة",exportCsv:"تصدير CSV",rowsSelected:t=>`تم تحديد ${t} صفوف`},Zn={close:"סגור",cancel:"ביטול",confirm:"אישור",save:"שמור",delete:"מחק",search:"חיפוש",loading:"טוען...",noResults:"לא נמצאו תוצאות",required:"חובה",previous:"הקודם",next:"הבא",pageOf:(t,r)=>`עמוד ${t} מתוך ${r}`,selectPlaceholder:"בחר...",clearSelection:"נקה בחירה",selectDate:"בחר תאריך",today:"היום",dropFiles:"גרור קבצים לכאן או",browse:"עיון",noData:"אין נתונים",sortAscending:"מיון עולה",sortDescending:"מיון יורד",filterPlaceholder:"סינון...",exportCsv:"ייצוא CSV",rowsSelected:t=>`נבחרו ${t} שורות`},Gn={close:"بستن",cancel:"لغو",confirm:"تأیید",save:"ذخیره",delete:"حذف",search:"جستجو",loading:"...در حال بارگذاری",noResults:"نتیجه‌ای یافت نشد",required:"الزامی",previous:"قبلی",next:"بعدی",pageOf:(t,r)=>`صفحه ${t} از ${r}`,selectPlaceholder:"...انتخاب کنید",clearSelection:"پاک کردن انتخاب",selectDate:"تاریخ را انتخاب کنید",today:"امروز",dropFiles:"فایل‌ها را اینجا رها کنید یا",browse:"مرور",noData:"داده‌ای موجود نیست",sortAscending:"مرتب‌سازی صعودی",sortDescending:"مرتب‌سازی نزولی",filterPlaceholder:"...فیلتر",exportCsv:"خروجی CSV",rowsSelected:t=>`${t} ردیف انتخاب شده`},Jn={close:"閉じる",cancel:"キャンセル",confirm:"確認",save:"保存",delete:"削除",search:"検索",loading:"読み込み中...",noResults:"結果が見つかりません",required:"必須",previous:"前へ",next:"次へ",pageOf:(t,r)=>`${r}ページ中${t}ページ`,selectPlaceholder:"選択...",clearSelection:"選択解除",selectDate:"日付を選択",today:"今日",dropFiles:"ファイルをドロップまたは",browse:"参照",noData:"データなし",sortAscending:"昇順",sortDescending:"降順",filterPlaceholder:"フィルター...",exportCsv:"CSVエクスポート",rowsSelected:t=>`${t}行選択中`},Qn={close:"닫기",cancel:"취소",confirm:"확인",save:"저장",delete:"삭제",search:"검색",loading:"로딩 중...",noResults:"검색 결과 없음",required:"필수",previous:"이전",next:"다음",pageOf:(t,r)=>`${r}페이지 중 ${t}페이지`,selectPlaceholder:"선택...",clearSelection:"선택 해제",selectDate:"날짜 선택",today:"오늘",dropFiles:"여기에 파일을 놓거나",browse:"찾아보기",noData:"데이터 없음",sortAscending:"오름차순 정렬",sortDescending:"내림차순 정렬",filterPlaceholder:"필터...",exportCsv:"CSV 내보내기",rowsSelected:t=>`${t}개 행 선택됨`},es={close:"关闭",cancel:"取消",confirm:"确认",save:"保存",delete:"删除",search:"搜索",loading:"加载中...",noResults:"未找到结果",required:"必填",previous:"上一页",next:"下一页",pageOf:(t,r)=>`第 ${t} 页,共 ${r} 页`,selectPlaceholder:"请选择...",clearSelection:"清除选择",selectDate:"选择日期",today:"今天",dropFiles:"将文件拖到此处或",browse:"浏览",noData:"暂无数据",sortAscending:"升序排列",sortDescending:"降序排列",filterPlaceholder:"筛选...",exportCsv:"导出 CSV",rowsSelected:t=>`已选择 ${t} 行`},ts={close:"關閉",cancel:"取消",confirm:"確認",save:"儲存",delete:"刪除",search:"搜尋",loading:"載入中...",noResults:"未找到結果",required:"必填",previous:"上一頁",next:"下一頁",pageOf:(t,r)=>`第 ${t} 頁,共 ${r} 頁`,selectPlaceholder:"請選擇...",clearSelection:"清除選擇",selectDate:"選擇日期",today:"今天",dropFiles:"將檔案拖曳至此或",browse:"瀏覽",noData:"暫無資料",sortAscending:"升冪排列",sortDescending:"降冪排列",filterPlaceholder:"篩選...",exportCsv:"匯出 CSV",rowsSelected:t=>`已選擇 ${t} 行`},rs={close:"ปิด",cancel:"ยกเลิก",confirm:"ยืนยัน",save:"บันทึก",delete:"ลบ",search:"ค้นหา",loading:"กำลังโหลด...",noResults:"ไม่พบผลลัพธ์",required:"จำเป็น",previous:"ก่อนหน้า",next:"ถัดไป",pageOf:(t,r)=>`หน้า ${t} จาก ${r}`,selectPlaceholder:"เลือก...",clearSelection:"ล้างการเลือก",selectDate:"เลือกวันที่",today:"วันนี้",dropFiles:"วางไฟล์ที่นี่หรือ",browse:"เรียกดู",noData:"ไม่มีข้อมูล",sortAscending:"เรียงจากน้อยไปมาก",sortDescending:"เรียงจากมากไปน้อย",filterPlaceholder:"กรอง...",exportCsv:"ส่งออก CSV",rowsSelected:t=>`เลือก ${t} แถว`},ns={close:"Đóng",cancel:"Hủy",confirm:"Xác nhận",save:"Lưu",delete:"Xóa",search:"Tìm kiếm",loading:"Đang tải...",noResults:"Không tìm thấy kết quả",required:"Bắt buộc",previous:"Trước",next:"Tiếp",pageOf:(t,r)=>`Trang ${t} / ${r}`,selectPlaceholder:"Chọn...",clearSelection:"Xóa lựa chọn",selectDate:"Chọn ngày",today:"Hôm nay",dropFiles:"Thả tệp vào đây hoặc",browse:"Duyệt",noData:"Không có dữ liệu",sortAscending:"Sắp xếp tăng dần",sortDescending:"Sắp xếp giảm dần",filterPlaceholder:"Lọc...",exportCsv:"Xuất CSV",rowsSelected:t=>`Đã chọn ${t} hàng`},ss={close:"Tutup",cancel:"Batal",confirm:"Konfirmasi",save:"Simpan",delete:"Hapus",search:"Cari",loading:"Memuat...",noResults:"Tidak ada hasil",required:"Wajib",previous:"Sebelumnya",next:"Berikutnya",pageOf:(t,r)=>`Halaman ${t} dari ${r}`,selectPlaceholder:"Pilih...",clearSelection:"Hapus pilihan",selectDate:"Pilih tanggal",today:"Hari ini",dropFiles:"Seret file ke sini atau",browse:"Jelajahi",noData:"Tidak ada data",sortAscending:"Urutkan naik",sortDescending:"Urutkan turun",filterPlaceholder:"Filter...",exportCsv:"Ekspor CSV",rowsSelected:t=>`${t} baris dipilih`},os={close:"Închide",cancel:"Anulează",confirm:"Confirmă",save:"Salvează",delete:"Șterge",search:"Caută",loading:"Se încarcă...",noResults:"Nu s-au găsit rezultate",required:"Obligatoriu",previous:"Anterior",next:"Următor",pageOf:(t,r)=>`Pagina ${t} din ${r}`,selectPlaceholder:"Selectați...",clearSelection:"Șterge selecția",selectDate:"Selectați o dată",today:"Astăzi",dropFiles:"Trageți fișierele aici sau",browse:"Răsfoiți",noData:"Nu există date",sortAscending:"Sortare crescătoare",sortDescending:"Sortare descrescătoare",filterPlaceholder:"Filtrați...",exportCsv:"Exportați CSV",rowsSelected:t=>`${t} rând${t===1?"":"uri"} selectat${t===1?"":"e"}`},is={"en-US":Tt,"es-ES":Ln,"pt-BR":Dn,"pt-PT":An,"fr-FR":Pn,"de-DE":Bn,"it-IT":Fn,"nl-NL":Wn,"pl-PL":Hn,"ru-RU":Vn,"uk-UA":On,"tr-TR":_n,"sv-SE":Yn,"da-DK":Un,"cs-CZ":Kn,"hu-HU":Xn,"ar-SA":qn,"he-IL":Zn,"fa-IR":Gn,"ja-JP":Jn,"ko-KR":Qn,"zh-CN":es,"zh-TW":ts,"th-TH":rs,"vi-VN":ns,"id-ID":ss,"ro-RO":os},Al=new Set(["ar-SA","he-IL","fa-IR","ur-PK"]);function as(t){return Al.has(t)}const gt=a.createContext({locale:"en-US",direction:"ltr",strings:Tt});function Pl(){return a.useContext(gt)}function Bl(){return a.useContext(gt).strings}function Fl(){return a.useContext(gt).direction}function Wl({locale:t="en-US",direction:r,strings:n,children:i}){const o=a.useMemo(()=>{const l=is[t]??Tt,c=n?{...l,...n}:l,d=r??(as(t)?"rtl":"ltr");return{locale:t,direction:d,strings:c}},[t,r,n]);return e.jsx(gt.Provider,{value:o,children:e.jsx("div",{dir:o.direction,style:{direction:o.direction,display:"contents"},children:i})})}function Hl({contentId:t="tkx-main-content",label:r="Skip to main content"}){return e.jsx("a",{href:`#${t}`,className:"tkx-skip-nav",children:r})}function Vl({politeness:t="polite",children:r,atomic:n=!0}){return e.jsx("div",{role:"status","aria-live":t,"aria-atomic":n,className:"tkx-sr-only",children:r})}function Ol({active:t,children:r,as:n="div"}){const i=s.useFocusTrap(t);return e.jsx(n,{ref:i,children:r})}function _l({as:t,children:r,...n}){const i=t??"span";return e.jsx(i,{className:"tkx-sr-only",...n,children:r})}exports.LRUCache=B.LRUCache;exports.Quantum=B.Quantum;exports.TKX=B.TKX;exports.ThemeContext=B.ThemeContext;exports.ThemeProvider=B.ThemeProvider;exports.WCAGEngine=B.WCAGEngine;exports.auroraLight=B.auroraLight;exports.batchUpdate=B.batchUpdate;exports.breakpoints=B.breakpoints;exports.contrastRatio=B.contrastRatio;exports.createFocusTrap=B.createFocusTrap;exports.createTheme=B.createTheme;exports.css=B.css;exports.cssVar=B.cssVar;exports.extractCSS=B.extractCSS;exports.fnv1aHash=B.fnv1aHash;exports.fromObject=B.fromObject;exports.generatePalette=B.generatePalette;exports.getAccessibleForeground=B.getAccessibleForeground;exports.injectStyles=B.injectStyles;exports.keyframes=B.keyframes;exports.meetsAA=B.meetsAA;exports.meetsAAA=B.meetsAAA;exports.memoize=B.memoize;exports.prefersHighContrast=B.prefersHighContrast;exports.prefersReducedMotion=B.prefersReducedMotion;exports.quantumDark=B.quantumDark;exports.radii=B.radii;exports.responsive=B.responsive;exports.shadows=B.shadows;exports.spacing=B.spacing;exports.typography=B.typography;exports.useTheme=B.useTheme;exports.zIndex=B.zIndex;exports.Shield=s.Shield;exports.TkxForm=s.TkxForm;exports.TkxFormField=s.TkxFormField;exports.audit=s.audit;exports.cx=s.cx;exports.extractAtomicCSS=s.extractAtomicCSS;exports.getAuditLog=s.getAuditLog;exports.resetAtomicCSS=s.resetAtomicCSS;exports.resolvePluginUtility=s.resolvePluginUtility;exports.sanitizeProps=s.sanitizeProps;exports.sanitizeString=s.sanitizeString;exports.tkx=s.tkx;exports.tkxListPlugins=s.tkxListPlugins;exports.tkxPlugin=s.tkxPlugin;exports.tkxRemovePlugin=s.tkxRemovePlugin;exports.tx=s.tx;exports.useAnnounce=s.useAnnounce;exports.useClickOutside=s.useClickOutside;exports.useEscapeKey=s.useEscapeKey;exports.useFocusTrap=s.useFocusTrap;exports.useHighContrast=s.useHighContrast;exports.useReducedMotion=s.useReducedMotion;exports.useTkxForm=s.useTkxForm;exports.validateProps=s.validateProps;exports.verifyAuditIntegrity=s.verifyAuditIntegrity;exports.FocusTrap=Ol;exports.I18nContext=gt;exports.I18nProvider=Wl;exports.LOCALES=is;exports.LiveRegion=Vl;exports.SIZE_BORDER_RADIUS=Wa;exports.SIZE_FONT=Pa;exports.SIZE_HEIGHT=Aa;exports.SIZE_ICON=Ha;exports.SIZE_PADDING_X=Ba;exports.SIZE_PADDING_Y=Fa;exports.SkipNav=Hl;exports.TkxAccordion=tn;exports.TkxAffix=$l;exports.TkxAlert=Ts;exports.TkxAnchor=zl;exports.TkxAppBar=qi;exports.TkxAutocomplete=zi;exports.TkxAvatar=Kr;exports.TkxBadge=Vr;exports.TkxBottomNav=Qi;exports.TkxBreadcrumb=Si;exports.TkxButton=Fr;exports.TkxCard=Wr;exports.TkxCardBody=bs;exports.TkxCardFooter=ys;exports.TkxCardHeader=gs;exports.TkxCarousel=bn;exports.TkxCascader=Nl;exports.TkxChat=Bo;exports.TkxChatBubble=an;exports.TkxCheckbox=Zr;exports.TkxClock=un;exports.TkxCol=$n;exports.TkxColorPicker=ui;exports.TkxCommand=gn;exports.TkxConfigProvider=zn;exports.TkxContent=Cn;exports.TkxCountdown=dl;exports.TkxDataGrid=da;exports.TkxDatePicker=rn;exports.TkxDivider=Xr;exports.TkxDrawer=lo;exports.TkxEmpty=nl;exports.TkxFileUpload=Mo;exports.TkxFooter=Tn;exports.TkxHeader=jn;exports.TkxImage=jo;exports.TkxInput=Hr;exports.TkxLayout=wn;exports.TkxList=Dl;exports.TkxMasonry=pa;exports.TkxMentions=xl;exports.TkxMenu=dn;exports.TkxModal=zs;exports.TkxNumberInput=hn;exports.TkxOTP=mn;exports.TkxPagination=sn;exports.TkxParagraph=qa;exports.TkxPopover=Ti;exports.TkxProgress=Or;exports.TkxQRCode=bl;exports.TkxRadio=Jr;exports.TkxRadioGroup=Ks;exports.TkxRating=Lo;exports.TkxResult=vl;exports.TkxRichTextDisplay=Ta;exports.TkxRow=Mn;exports.TkxSegmented=fl;exports.TkxSelect=qr;exports.TkxSider=Sn;exports.TkxSkeleton=Ct;exports.TkxSlider=nn;exports.TkxSnackbar=sa;exports.TkxSpeedDial=Yi;exports.TkxSpin=el;exports.TkxStatistic=cl;exports.TkxStepper=xn;exports.TkxTab=Ns;exports.TkxTabList=Es;exports.TkxTabPanel=Ls;exports.TkxTabPanels=Rs;exports.TkxTable=Ws;exports.TkxTabs=Is;exports.TkxTag=ln;exports.TkxTagInput=_o;exports.TkxText=Xa;exports.TkxThinkingIndicator=on;exports.TkxTimeline=Ko;exports.TkxTitle=Ka;exports.TkxToastProvider=to;exports.TkxToggle=_r;exports.TkxToolbar=Di;exports.TkxTooltip=As;exports.TkxTour=Sl;exports.TkxTransferList=Fi;exports.TkxTreeView=Ri;exports.TkxVideoPlayer=fn;exports.TkxWatermark=Tl;exports.VisuallyHidden=_l;exports.arSA=qn;exports.csCZ=Kn;exports.daDK=Un;exports.deDE=Bn;exports.enUS=Tt;exports.esES=Ln;exports.faIR=Gn;exports.frFR=Pn;exports.getLocaleDisplayName=Ya;exports.heIL=Zn;exports.huHU=Xn;exports.idID=ss;exports.isRTL=as;exports.isRtlLocale=_a;exports.itIT=Fn;exports.jaJP=Jn;exports.koKR=Qn;exports.nlNL=Wn;exports.plPL=Hn;exports.ptBR=Dn;exports.ptPT=An;exports.roRO=os;exports.ruRU=Vn;exports.svSE=Yn;exports.thTH=rs;exports.trTR=_n;exports.ukUA=On;exports.useComponentSize=Da;exports.useConfig=mt;exports.useDirection=Fl;exports.useI18n=Pl;exports.useLocale=Bl;exports.useLogicalSpacing=Oa;exports.usePrefixCls=La;exports.useRtlFlip=Va;exports.useTkxCommand=bi;exports.useToast=Zs;exports.viVN=ns;exports.zhCN=es;exports.zhTW=ts;